From 94a337b9beeef879df5555d22b03a4070ca86af5 Mon Sep 17 00:00:00 2001 From: Man Zhang Date: Tue, 4 Jun 2019 09:50:10 -0600 Subject: [PATCH 01/89] scidoc update --- physics/docs/library.bib | 12 +- physics/docs/pdftxt/suite_input.nml.txt | 635 +++++++++++++++--------- 2 files changed, 425 insertions(+), 222 deletions(-) diff --git a/physics/docs/library.bib b/physics/docs/library.bib index 4836aceba..d34d2f3fa 100644 --- a/physics/docs/library.bib +++ b/physics/docs/library.bib @@ -1,13 +1,23 @@ %% This BibTeX bibliography file was created using BibDesk. %% http://bibdesk.sourceforge.net/ -%% Created for Man Zhang at 2019-05-24 12:46:55 -0600 +%% Created for Man Zhang at 2019-05-31 14:47:36 -0600 %% Saved with string encoding Unicode (UTF-8) +@article{nakanishi_2000, + Author = {M. Nakanishi }, + Date-Added = {2019-05-31 14:46:02 -0600}, + Date-Modified = {2019-05-31 14:47:32 -0600}, + Journal = {Boundary-Layer Meteorology}, + Pages = {461-493}, + Title = {Large-eddy simulation of radiation fog}, + Volume = {94}, + Year = {2000}} + @article{Gehne_2019, Author = {Gehne, Maria and Hamill, Thomas M. and Bates, Gary T. and Pegion, Philip and Kolczynski, Walter}, Date-Added = {2019-05-24 12:46:43 -0600}, diff --git a/physics/docs/pdftxt/suite_input.nml.txt b/physics/docs/pdftxt/suite_input.nml.txt index 6e90827b7..e88051aaa 100644 --- a/physics/docs/pdftxt/suite_input.nml.txt +++ b/physics/docs/pdftxt/suite_input.nml.txt @@ -3,233 +3,426 @@ \section gfs_physics_nml GFS Physics Parameters The namelist variable description is provided in host-model side: GFS_typedefs.F90 +
option DDT in Host Model Description Default Value -
\b &gfs_physics_nml +
\b &gfs_physics_nml
fhzero gfs_control_type hour between clearing of diagnostic buckets 0.0
h2o_phys gfs_control_type flag for stratosphere h2o scheme .false.
ldiag3d gfs_control_type flag for 3D diagnostic fields .false. +
lssav gfs_control_type logical flag for storing diagnostics .false. +
lgocart gfs_control_type logical flag for 3D diagnostic fields for gocart 1 .false. +
cplflx gfs_control_type logical flag for cplflx collection .false. +
cplwav gfs_control_type logical flag for cplwav collection .false. +
cplchm gfs_control_type logical flag for chemistry collection .false. +
lsidea gfs_control_type logical flag for idealized physics .false.
oz_phys gfs_control_type flag for old (2006) ozone physics .true.
oz_phys_2015 gfs_control_type flag for new (2015) ozone physics .false. - fhcyc | gfs_typedefs::gfs_control_type | frequency for surface data cycling in hours | 0.0 | - use_ufo | gfs_typedefs::gfs_control_type | flag for using unfiltered orography surface option | .false. | - pre_rad | gfs_typedefs::gfs_control_type | flag for testing purpose | .false. | - ncld | gfs_typedefs::gfs_control_type | number of hydrometeors | 1 | - +
fhcyc gfs_control_type frequency for surface data cycling in hours 0.0 +
use_ufo gfs_control_type flag for using unfiltered orography surface option .false. +
pre_rad gfs_control_type flag for testing purpose .false. +
ncld gfs_control_type number of hydrometeors 1 +
imp_physics gfs_control_type choice of microphysics scheme: \n +
    +
  • 11: GFDL microphysics scheme +
  • 8: Thompson microphysics scheme +
  • 10: Morrison-Gettelman microphysics scheme +
+
99 +
pdfcld gfs_control_type flag for PDF clouds .false. +
fhswr gfs_control_type frequency for shortwave radiation (secs) 3600. +
fhlwr gfs_control_type frequency for longwave radiation (secs) 3600. +
levr gfs_control_type number of vertical levels for radiation calculations -99 +
nfxr gfs_control_type second dimension of radiation input/output array fluxr 39+6 +
iflip gfs_control_type control flag for vertical index direction \n +
    +
  • 0: index from TOA to surface +
  • 1: index from surface to TOA +
+
1 +
icliq_sw gfs_control_type sw optical property for liquid clouds \n +
    +
  • 0: input cloud optical depth, ignoring iswcice setting +
  • 1: cloud optical property scheme based on Hu and Stamnes (1993) \cite hu_and_stamnes_1993 method +
  • 2: cloud optical property scheme based on Hu and Stamnes (1993) \cite hu_and_stamnes_1993 - updated +
+
1 +
iovr_sw gfs_control_type control flag for cloud overlap in SW radiation \n +
    +
  • 0: random overlapping clouds +
  • 1: max/ran overlapping clouds +
  • 2: maximum overlap clouds (mcica only) +
  • 3: decorrelation-length overlap (mcica only) +
+
1 +
iovr_lw gfs_control_type control flag for cloud overlap in LW radiation \n +
    +
  • 0: random overlapping clouds +
  • 1: max/ran overlapping clouds +
  • 2: maximum overlap clouds (mcica only) +
  • 3: decorrelation-length overlap (mcica only) +
+
1 +
ictm gfs_control_type external data time/date control flag \n +
    +
  • -2: same as 0, but superimpose seasonal cycle from climatology data set +
  • -1: use user provided external data for the forecast time, no extrapolation +
  • 0: use data at initial condition time, if not available, use latest, no extrapolation +
  • 1: use data at the forecast time, if not available, use latest and extrapolation +
  • yyyy0: use yyyy data for the forecast time, no further data extrapolation +
  • yyyy1: use yyyy data for the forecast. if needed, do extrapolation to match the fcst time +
+
1 +
crick_proof gfs_control_type control flag for eliminating CRICK \n +
    +
  • .true.: apply layer smoothing to eliminate CRICK +
  • .false.: do not apply layer smoothing +
+
.false. +
ccnorm gfs_control_type control flag for in-cloud condensate mixing ratio \n +
    +
  • .true.: normalize cloud condensate +
  • .false.: not normalize cloud condensate +
+
.false. +
norad_precip gfs_control_type control flag for not using precip in radiation (Ferrier scheme) \n +
    +
  • .true.: snow/rain has no impact on radiation +
  • .false.: snow/rain has impact on radiation +
+
.false. +
ialb gfs_control_type SW surface albedo control flag: \n +
    +
  • 0: using climatology surface albedo scheme for SW +
  • 1: using MODIS based land surface albedo for SW +
+
0 +
iems gfs_control_type LW surface emissivity control flag (ab 2-digit integer) : \n +
    +
  • a: =0 set surface air/ground t same for LW radiation +
  • =1 set surface air/ground t diff for LW radiation +
  • b: =0 use fixed surface emissivity = 1.0 (black-body) +
  • =1 use varying climatology surface emissivity (veg based) +
  • =2 future development (not yet) +
+
0 +
iaer gfs_control_type aerosol flag "abc" (volcanic, LW, SW): \n +
    +
  • a: stratospheric volcanic aerosols +
  • b: tropospheric aerosols for LW +
  • c: tropospheric aerosols for SW \n + 0: aerosol effect is not included; \n + 1: aerosol effect is included +
+
1 +
ico2 gfs_control_type \f$CO_2\f$ data source control flag:\n +
    +
  • 0: prescribed value (380 ppmv) +
  • 1: yearly global averaged annual mean from observations +
  • 2: monthly 15 degree horizontal resolution from observations +
+
0 +
isubc_sw gfs_control_type subgrid cloud approximation control flag in SW radiation: \n +
    +
  • 0: no McICA approximation in SW radiation +
  • 1: use McICA with prescribed permutation seeds (test mode) +
  • 2: use McICA with randomly generated permutation seeds +
+
0 +
isubc_lw gfs_control_type subgrid cloud approximation control flag in LW radiation: \n +
    +
  • 0: no McICA approximation in LW radiation +
  • 1: use McICA with prescribed permutatition seeds (test mode) +
  • 2: use McICA with randomly generated permutation seeds +
+
0 +
isol gfs_control_type solar constant scheme control flag: \n +
    +
  • 0: fixed value = 1366.0 \f$W m^{-2}\f$ (old standard) +
  • 10: fixed value = 1360.8 \f$W m^{-2}\f$ (new standard) +
  • 1: NOAA ABS-scale TSI table (yearly) with 11-yr cycle approximation +
  • 2: NOAA TIM-scale TSI table (yearly) with 11-yr cycle approximation +
  • 3: CMIP5 TIM-scale TSI table (yearly) with 11-yr cycle approximation +
  • 4: CMIP5 TIM-scale TSI table (monthly) with 11-yr cycle approximation +
+
0 +
lwhtr gfs_control_type logical flag for output of longwave heating rate .true. +
swhtr gfs_control_type logical flag for output of shortwave heating rate .true. +
cnvgwd gfs_control_type logical flag for convective gravity wave drag scheme .false. +
shal_cnv gfs_control_type logical flag for calling shallow convection .false. +
lmfshal gfs_control_type flag for mass-flux shallow convection scheme in the cloud fraction calculation shal_cnv .and. (imfshalcnv > 0) +
lmfdeep2 gfs_control_type flag for mass-flux deep convection scheme in the cloud fraction calculation imfdeepcnv == 2 .or. 3 .or.4 +
cal_pre gfs_control_type logical flag for calling precipitation type algorithm .false. +
redrag gfs_control_type logical flag for applying reduced drag coefficient for high wind over sea in GFS surface layer scheme .false. +
dspheat gfs_control_type logical flag for using TKE dissipative heating to temperature tendency in hybrid EDMF and TKE-EDMF schemes .false. +
hybedmf gfs_control_type logical flag for calling hybrid EDMF PBL scheme .false. +
random_clds gfs_control_type logical flag for whether clouds are random .false. +
trans_trac gfs_control_type logical flag for convective transport of tracers .false. +
lheatstrg gfs_control_type logical flag for canopy heat storage parameterization .false. +
shinhong gfs_control_type flag for scale-aware Shinhong PBL scheme .false. +
do_ysu gfs_control_type flag for YSU PBL scheme .false. +
cnvcld gfs_control_type logical flag for convective cloud .false. +
imfshalcnv gfs_control_type flag for mass flux shallow convective scheme:\n +
    +
  • 1:July 2010 version of mass-flux shallow convective scheme (operational as of 2016) +
  • 2: scale- & aerosol-aware mass-flux shallow convective scheme (2017) +
  • 3: scale- & aerosol-aware Grell-Freitas scheme (GSD) +
  • 4: New Tiedtke scheme (CAPS) +
  • 0: modified Tiedtke's eddy-diffusion shallow convective scheme +
  • -1: no shallow convection used +
+
1 +
imfdeepcnv gfs_control_type flag for mass-flux deep convective scheme:\n +
    +
  • 1: July 2010 version of SAS convective scheme (operational version as of 2016) +
  • 2: scale- & aerosol-aware mass-flux deep convective scheme (2017) +
  • 3: scale- & aerosol-aware Grell-Freitas scheme (GSD) +
  • 4: New Tiedtke scheme (CAPS) +
+
1 +
lgfdlmprad gfs_control_type flag for GFDL mp scheme and radiation consistency .false. +
cdmbgwd(2) gfs_control_type multiplication factors for mountain blocking and orographic gravity wave drag /2.0d0,0.25d0/ +
prslrd0 gfs_control_type pressure level above which to apply Rayleigh damping 0.0d0 +
lsm gfs_control_type flag for land surface model to use \n +
    +
  • 0: OSU LSM +
  • 1: NOAH LSM +
  • 2: RUC LSM +
+
1 +
lsoil gfs_control_type number of soil layers 4 +
ivegsrc gfs_control_type flag for vegetation type dataset choice: \n +
    +
  • 0: USGS +
  • 1: IGBP(20 category) +
  • 2: UMD (13 category) +
+
2 +
isot gfs_control_type flag for soil type dataset choice:\n +
    +
  • 0: Zobler soil type (9 category) +
  • 1: STATSGO soil type (19 category) +
+
0 +
mom4ice gfs_control_type flag controls mom4 sea ice .false. +
debug gfs_control_type flag for debug printout .false. +
nstf_name(5) gfs_control_type NSST related paramters:\n +
    +
  • nstf_name(1): 0=NSSTM off, 1= NSSTM on but uncoupled, 2= NSSTM on and coupled +
  • nstf_name(2): 1=NSSTM spin up on, 0=NSSTM spin up off +
  • nstf_name(3): 1=NSST analysis on, 0=NSSTM analysis off +
  • nstf_name(4): zsea1 in mm +
  • nstf_name(5): zesa2 in mm +
+
/0,0,1,0,5/ +
nst_anl gfs_control_type flag for NSSTM analysis in gcycle/sfcsub .false. +
satmedmf gfs_control_type logical flag for calling TKE EDMF PBL scheme .false. +
effr_in gfs_control_type logical flag for using input cloud effective radii calculation .false. +
aero_in gfs_control_type logical flag for using aerosols in Morrison-Gettelman microphysics .false. +
iau_delthrs gfs_control_type incremental analysis update (IAU) time interval in hours 6 +
iaufhrs gfs_control_type forecast hours associated with increment files -1 +
\b CPT_v0 \b Suite \b Specific \b Parameters +
crtrh(3) gfs_control_type critical relative humidity at the surface, PBL top and at the top of the atmosphere /0.90d0,0.90d0,0.90d0/ +
ras gfs_control_type logical flag for RAS convection scheme .false. +
cscnv gfs_control_type logical flag for Chikira-Sugiyama deep convection .false. +
do_aw gfs_control_type flag for Arakawa-Wu scale-awere adjustment .false. +
do_awdd gfs_control_type flag to enable treating convective tendencies following Arakwaw-Wu for downdrafts (2013) .false. +
do_sb_physics gfs_control_type logical flag for SB2001 autoconversion or accretion .true. +
do_cldice gfs_control_type flag for cloud ice processes for MG microphysics .true. +
hetfrz_classnuc gfs_control_type flag for heterogeneous freezing for MG microphysics .false. +
mg_nccons gfs_control_type flag for constant droplet concentration for MG microphysics .false. +
mg_nicons gfs_control_type flag for constant ice concentration for MG microphysics .false. +
mg_ngcons gfs_control_type flag for constant graupel concentration for MG microphysics .false. +
sed_supersat gfs_control_type flag for allowing supersaturation after sedimentation for MG microphysics .true. +
mg_do_graupel gfs_control_type flag for turning on prognostic graupel (with fprcp=2) .true. +
mg_do_hail gfs_control_type flag for turning on prognostic hail (with fprcp=2) .false. +
shcnvcw gfs_control_type logical flag for shallow convective cloud .false. +
xkzm_h gfs_control_type background vertical diffusion for heat and q 1.0d0 +
xkzm_m gfs_control_type background vertical diffusion for momentum 1.0d0 +
xkzm_s gfs_control_type sigma threshold for background mom. diffusion 1.0d0 +
microp_uniform gfs_control_type logical flag for uniform subcolumns for MG microphysics .true. +
mg_do_ice_gmao gfs_control_type logical flag for turning on gmao ice autoconversion in MG microphysics .false. +
mg_do_liq_liu gfs_control_type logical flag for turning on Liu liquid treatment in MG microphysics .true. +
mg_dcs gfs_control_type autoconversion size threshold for cloud ice to snow in MG microphysics 200.0 +
mg_alf gfs_control_type tuning factor for alphas (alpha = 1 - critical relative humidity) 1.0 +
mg_ts_auto_ice(2) gfs_control_type autoconversion time scale for ice in MG microphysics /180.0,180.0/ +
mg_qcvar gfs_control_type cloud water relative variance in MG microphysics 1.0 +
mg_rhmini gfs_control_type relative humidity threshold parameter for nucleating ice 1.01 +
mg_ncnst gfs_control_type constant droplet num concentration \f$m^{-3}\f$ 100.e6 +
mg_ninst gfs_control_type constant ice num concentration \f$m^{-3}\f$ 0.15e6 +
mg_ngnst gfs_control_type constant graupel/hail num concertration \f$m^{-3}\f$ 0.10e6 +
mg_berg_eff_factor gfs_control_type berg efficiency factor 2.0 +
mg_qcmin(2) gfs_control_type min liquid and ice mixing ratio in MG macro clouds /1.0d-9, 1.0d-9/ +
mg_precip_frac_method gfs_control_type type of precipitation fraction method 'max_overlap' +
fprcp gfs_control_type number of frozen precipitation species in MG microphysics \n +
    +
  • 0: no prognostic rain and snow +
  • 1: MG2 +
  • 2: MG3 +
+
0 +
pdfflag gfs_control_type pdf flag for MG macro physics 4 +
cs_parm(10) gfs_control_type tunable parameters for Chikira-Sugiyama convection /8.0,4.0,1.0e3,3.5e3,20.0,1.0,-999.,1.,0.6,0./ +
iccn gfs_control_type flag for using IN and CCN forcing in MG2/3 microphysics .false. +
rhcmax gfs_control_type maximum critical relative humidity 0.9999999 +
\b GSD_v0 \b Suite \b Specific \b Parameters +
make_number_concentrations gfs_control_type flag to calculate initial number concentrations from mass concentrations if not in ICs/BCs .false. +
ltaerosol gfs_control_type logical flag for using aerosol climotology in Thompson MP scheme .false. +
lradar gfs_control_type logical flag for computing radar reflectivity in Thompson MP scheme .false. +
ttendlim gfs_control_type temperature tendency limiter per time step in K/s, set to < 0 to deactivate -999.0 +
do_mynnedmf gfs_control_type flag to activate MYNN-EDMF scheme .false. +
do_mynnsfclay gfs_control_type flag to activate MYNN-SFCLAY scheme .false. +
grav_settling gfs_control_type flag to activate gravitational settling of cloud droplets as described in Nakanishi (2000) \cite nakanishi_2000 0 +
bl_mynn_mixlength gfs_control_type flag for different version of mixing length formulation \n +
    +
  • 0: Original form from Nakanishi and Niino (2009) \cite NAKANISHI_2009 . NO scale-awareness is applied to the master mixing length, regardless of "scaleware" setting +
  • 1: HRRR operational form 201609-201807. Designed to work without the mass-flux scheme. Uses BouLac mixing length in free atmosphere. +
  • 2: HRRR operational form 201807-present. Designed to be compatible with mass-flux scheme activated (default) +
+
2 +
bl_mynn_edmf gfs_control_type flag to activate the mass-flux scheme \n +
    +
  • 0: Deactivate mass-flux scheme +
  • 1: Activate dynamic multiplume mass-flux scheme +
+
0 +
bl_mynn_edmf_mom gfs_control_type flag to activate the transport of momentum \n +
    +
  • 0: Deactivate momentum transport in mass-flux scheme +
  • 1: Activate momentum transport in dynamic multiplume mass-flux scheme. \p bl_mynn_edmf must be set to 1 +
+
1 +
bl_mynn_edmf_tke gfs_control_type flag to activate the transport of TKE \n +
    +
  • 0: Deactivate TKE transport in mass-flux scheme +
  • 1: Activate TKE transport in dynamic multiplume mass-flux scheme. \p bl_mynn_edmf must be set to 1 +
+
0 +
bl_mynn_edmf_part gfs_control_type flag to partitioning the MF and ED areas 0 +
bl_mynn_edmf_tkeadvect gfs_control_type activate computation of TKE advection (not yet in use for FV3) \n +
    +
  • False: Deactivate TKE advection +
  • True: Activate TKE advection +
+
.false. +
bl_mynn_edmf_tkebudget gfs_control_type flag to activate TKE budget 0 +
bl_mynn_edmf_cloudpdf gfs_control_type flag to determine which cloud PDF to use \n +
    +
  • 0: use Sommeria-Deardorff subgrid cloud PDF +
  • 1: use Kuwano-Yoshida subgrid cloud PDF +
  • 2: use modified Chaboureau-Bechtold subgrid cloud PDF +
+
2 +
bl_mynn_edmf_cloudmix gfs_control_type flag to activate mixing of cloud species \n +
    +
  • 0: Deactivate the mixing of any water species mixing ratios +
  • 1: activate the mixing of all water species mixing ratios +
+
1 +
bl_mynn_mixqt gfs_control_type flag to mix total water or individual species \n +
    +
  • 0: Mix individual water species separately +
  • 1: DO NOT USE +
+
0 +
icloud_bl gfs_control_type flag to coupling SGS clouds to radiation \n +
    +
  • 0: Deactivate coupling subgrid clouds to radiation +
  • 1: Activate subgrid cloud coupling to radiation (highly suggested) +
+
1 +
lsoil_lsm gfs_control_type number of soil layers internal to land surface model -1 +
\b Stochastic \Physics \b Specific \b Parameters +
do_sppt gfs_control_type flag for stochastic SPPT option .false. +
do_shum gfs_control_type flag for stochastic SHUM option .false. +
do_skeb gfs_control_type flag for stochastic SKEB option .false. +
do_sfcperts gfs_control_type flag for stochastic surface perturbations option .false. +
\b sfcperts +
nsfcpert gfs_control_type number of weights for stochastic surface perturbation 0 +
pertz0 gfs_control_type magnitude of perturbation of momentum roughness length -999. +
pertzt gfs_control_type magnitude of perturbation of heat to momentum roughness length ratio -999. +
pertshc gfs_control_type magnitude of perturbation of soil hydraulic conductivity -999. +
pertlai gfs_control_type magnitude of perturbation of leaf area index -999. +
pertalb gfs_control_type magnitude of surface albedo perturbation -999. +
pertvegf gfs_control_type magnitude of perturbation of vegetation fraction -999. +
iseed_sfc compns_stochy_mod random seeds (if 0 use system clock) 0 +
sfc_tau compns_stochy_mod time scales -999. +
sfc_lscale compns_stochy_mod length scales -999. +
sppt_land compns_stochy_mod .false. +
\b stochy +
use_zmtnblck compns_stochy_mod flag for mountain blocking. .T. = do not apply perturbations below the dividing streamline that is diagnosed by the gravity wave drag, mountain blocking scheme .false. +
ntrunc compns_stochy_mod spectral resolution (e.g. T126) of random patterns -999 +
lon_s, lat_s compns_stochy_mod number of longitude and latitude point for the Gaussian grid -999 +
fhstoch compns_stochy_mod forecast hour to write out random pattern in order to restart the pattern for a different forecast (used in DA), file is stoch_out.F -999.0 +
stochini compns_stochy_mod set to true if wanting to read in a previous random pattern (input file need to be named \c stoch_ini) .false. +
sppt compns_stochy_mod amplitude of random patterns -999. +
sppt_tau compns_stochy_mod decorrelation timescales in seconds -999. +
sppt_lscale compns_stochy_mod decorrelation spatial scales in meters -999. +
sppt_logit compns_stochy_mod logit transform for SPPT to bounded interval [-1,+1] .false. +
iseed_sppt compns_stochy_mod seeds for setting the random number sequence (ignored if \c stochini is true) 0 +
sppt_sigtop1, sppt_sigtop2 compns_stochy_mod sigma levels to taper perturbations to zeros 0.1, 0.025 +
sppt_sfclimit compns_stochy_mod reduce amplitude of SPPT near surface (lowest 2 levels) .false. +
shum compns_stochy_mod amplitude of stochastic boundary layer specific humidity perturbations -999. +
shum_tau compns_stochy_mod decorrelation time scales in seconds -999. +
shum_lscale compns_stochy_mod decorrelation spatial scales in meters -999. +
shum_sigefold compns_stochy_mod e-folding lengthscale (in units of sigma) of specific humidity perturbations 0.2 +
skeb compns_stochy_mod stochastic KE backscatter amplitude -999. +
skeb_tau compns_stochy_mod decorrelation timescales in seconds -999. +
skeb_lscale compns_stochy_mod decorrelation spatial scales in meter -999. +
iseed_skeb compns_stochy_mod seeds for setting the random number sequnce (ignored if \c stochini is true) 0 +
skeb_vfilt compns_stochy_mod 0 +
skebnorm compns_stochy_mod 0: random pattern is stream function,1: pattern is kenorm, 2: pattern is vorticity 0 +
skeb_varspect_opt compns_stochy_mod Gaussian or power law variance spectrum for SKEB (0: Gaussian, 1: power law) 0 +
skeb_npass compns_stochy_mod number of passes of smoother for dissipation estimate 11 +
skeb_vdof compns_stochy_mod the number of degrees of freedom in the vertical for the SKEB random pattern 5 +
skeb_sigtop1, skeb_sigtop2 compns_stochy_mod sigma levels to taper perturbations to zeros 0.1, 0.025 +
skebint compns_stochy_mod 0 +
\b GFDL \b Cloud \b Microphysics \b Parameters +
sedi_transport gfdl_cloud_microphys_mod logical flag for turning on horizontal momentum transport during sedimentation .true. +
do_sedi_heat gfdl_cloud_microphys_mod logical flag for turning on horizontal heat transport during sedimentation .true. +
rad_snow gfdl_cloud_microphys_mod logical flag for considering snow in cloud fraction calculation .true. +
rad_graupel gfdl_cloud_microphys_mod logical flag for considering graupel in cloud fraction calculation .true. +
rad_rain gfdl_cloud_microphys_mod logical flag for considering rain in cloud fraction calculation .true. +
const_vi gfdl_cloud_microphys_mod logical flag for using constant cloud ice fall speed .false. +
const_vs gfdl_cloud_microphys_mod logical flag for using constant snow fall speed .false. +
const_vg gfdl_cloud_microphys_mod logical flag for using constant graupel fall speed .false. +
const_vr gfdl_cloud_microphys_mod logical flag for using constant rain fall speed .false. +
vi_max gfdl_cloud_microphys_mod maximum fall speed for cloud ice 0.5 +
vs_max gfdl_cloud_microphys_mod maximum fall speed for snow 5.0 +
vg_max gfdl_cloud_microphys_mod maximum fall speed for graupel 8.0 +
vr_max gfdl_cloud_microphys_mod maximum fall speed for rain 12.0 +
qi_lim gfdl_cloud_microphys_mod cloud ice limiter to prevent large ice built up in cloud ice freezing and deposition 1. +
prog_ccn gfdl_cloud_microphys_mod logical flag for activating prognostic CCN (not supported in GFS Physics) .false. +
do_qa gfdl_cloud_microphys_mod logical flag for activating inline cloud fraction diagnosis in fast saturation adjustment .true. +
fast_sat_adj gfdl_cloud_microphys_mod logical flag for adjusting cloud water evaporation/freezing, cloud ice deposition when fast saturation adjustment is activated .true. +
tau_l2v gfdl_cloud_microphys_mod time scale for evaporation of cloud water to water vapor. Increasing(decreasing) \p tau_l2v can decrease(boost) deposition of cloud water to water vapor 300. +
tau_v2l gfdl_cloud_microphys_mod time scale for condensation of water vapor to cloud water. Increasing(decreasing) \p tau_v2l can decrease(boost) condensation of water vapor to cloud water 150. +
tau_g2v gfdl_cloud_microphys_mod time scale for sublimation of graupel to water vapor. Increasing(decreasing) \p tau_g2v can decrease(boost) sublimation of graupel to water vapor 900. +
rthresh gfdl_cloud_microphys_mod critical cloud water radius for autoconversion (cloud water -> rain). Increasing(decreasing) of \p rthresh makes the autoconversion harder(easier) 10.0e-6 +
dw_land gfdl_cloud_microphys_mod base value for subgrid deviation/variability over land 0.20 +
dw_ocean gfdl_cloud_microphys_mod base value for subgrid deviation/variability over ocean 0.10 +
ql_gen gfdl_cloud_microphys_mod maximum value for cloud water generated from condensation of water vapor (water vapor-> cloud water) 1.0e-3 +
ql_mlt gfdl_cloud_microphys_mod maximum value of cloud water allowed from melted cloud ice (cloud ice -> cloud water or rain) 2.0e-3 +
qi0_crt gfdl_cloud_microphys_mod threshold of cloud ice to snow autoconversion (cloud ice -> snow) 1.0e-4 +
qs0_crt gfdl_cloud_microphys_mod threshold of snow to graupel autoconversion (snow -> graupel) 1.0e-3 +
tau_i2s gfdl_cloud_microphys_mod time scale for autoconversion of cloud ice to snow 1000. +
c_psaci gfdl_cloud_microphys_mod accretion efficiency of cloud ice to snow 0.02 +
c_pgacs gfdl_cloud_microphys_mod accretion efficiency of snow to graupel 2.0e-3 +
rh_inc gfdl_cloud_microphys_mod relative humidity increment for complete evaporation of cloud water and cloud ice 0.25 +
rh_inr gfdl_cloud_microphys_mod relative humidity increment for sublimation of snow 0.25 +
rh_ins gfdl_cloud_microphys_mod relative humidity increment for minimum evaporation of rain 0.25 +
ccn_l gfdl_cloud_microphys_mod base CCN over land \f$cm^{-3}\f$ 270. +
ccn_o gfdl_cloud_microphys_mod base CCN over ocean \f$cm^{-3}\f$ 90. +
c_paut gfdl_cloud_microphys_mod autoconversion efficiency of cloud water to rain 0.55 +
c_cracw gfdl_cloud_microphys_mod accretion efficiency of cloud water to rain 0.9 +
use_ppm gfdl_cloud_microphys_mod \e true to use PPM fall scheme; \e false to use time-implicit monotonic fall scheme .false. +
use_ccn gfdl_cloud_microphys_mod \e true to compute prescribed CCN. It should be .true. when \p prog_ccn = .false. .false. +
mono_prof gfdl_cloud_microphys_mod \e true to turn on terminal fall with monotonic PPM scheme. This is used together with \p use_ppm=.true. .true. +
z_slope_liq gfdl_cloud_microphys_mod \e true to turn on vertically subgrid linear monotonic slope for autoconversion of cloud water to rain .true. +
z_slope_ice gfdl_cloud_microphys_mod \e true to turn on vertically subgrid linear monotonic slope for autoconversion of cloud ice to snow .false. +
de_ice gfdl_cloud_microphys_mod \e true to convert excessive cloud ice to snow to prevent ice over-built from other sources like convection scheme (not supported in GFS physics) .false. +
fix_negative gfdl_cloud_microphys_mod \e true to fix negative water species using nearby points .false. +
icloud_f gfdl_cloud_microphys_mod flag (0,1,or 2) for cloud fraction diagnostic scheme 0 +
mp_time gfdl_cloud_microphys_mod time step of GFDL cloud microphysics 150.
- - - -\section gfs_physics_nml GFS Physics Parameters - option | DDT in Host Model | Description | Default Value | --------------------|---------------------------------|----------------------------------------------------|---------------| - fhzero | gfs_typedefs::gfs_control_type | hour between clearing of diagnostic buckets | 0.0 | - h2o_phys | gfs_typedefs::gfs_control_type | flag for stratosphere h2o scheme | .false. | - ldiag3d | gfs_typedefs::gfs_control_type | flag for 3D diagnostic fields | .false. | - oz_phys | gfs_typedefs::gfs_control_type | flag for old (2006) ozone physics | .true. | - oz_phys_2015 | gfs_typedefs::gfs_control_type | flag for new (2015) ozone physics | .false. | - fhcyc | gfs_typedefs::gfs_control_type | frequency for surface data cycling in hours | 0.0 | - use_ufo | gfs_typedefs::gfs_control_type | flag for using unfiltered orography surface option | .false. | - pre_rad | gfs_typedefs::gfs_control_type | flag for testing purpose | .false. | - ncld | gfs_typedefs::gfs_control_type | number of hydrometeors | 1 | - imp_physics | gfs_typedefs::gfs_control_type | choice of microphysics scheme: \n 11: GFDL microphysics scheme \n 8: GSD Thompson microphysics scheme \n 6: WSMG microphysics scheme \n 10: Morrison-Gettelman microphysics scheme | 99 | - pdfcld | gfs_typedefs::gfs_control_type | flag for PDF clouds | .false. | - fhswr | gfs_typedefs::gfs_control_type | frequency for shortwave radiation (secs) | 3600. | - fhlwr | gfs_typedefs::gfs_control_type | frequency for longwave radiation (secs) | 3600. | - ialb | gfs_typedefs::gfs_control_type | SW surface albedo control flag: \n 0: using climatology surface albedo scheme for SW \n 1: using MODIS based land surface albedo for SW | 0 | - iems | gfs_typedefs::gfs_control_type | LW surface emissivity control flag: \n 0: black-body emissivity \n 1:surface type based climatology in 1 degree horizontal resolution | 0 | - iaer | gfs_typedefs::gfs_control_type | aerosol flag "abc" (volcanic, LW, SW): \n a: stratospheric volcanic aerosols \n b: tropospheric aerosols for LW \n c: tropospheric aerosols for SW.\n 0: aerosol effect is not included; 1: aerosol effect is included | 1 | - ico2 | gfs_typedefs::gfs_control_type | \f$CO_2\f$ data source control flag:\n 0: prescribed value (380 ppmv) \n 1: yearly global averaged annual mean from observations \n 2: monthly 15 degree horizontal resolution from observations| 0 | - isubc_sw | gfs_typedefs::gfs_control_type | subgrid cloud approximation control flag in SW radiation: \n 0: no McICA approximation in SW radiation \n 1: use McICA with prescribed permutation seeds (test mode) \n 2: use McICA with randomly generated permutation seeds | 0 | - isubc_lw | gfs_typedefs::gfs_control_type | subgrid cloud approximation control flag in LW radiation: \n 0: no McICA approximation in LW radiation \n 1: use McICA with prescribed permutation seeds (test mode) \n 2: use McICA with randomly generated permutation seeds | 0 | - isol | gfs_typedefs::gfs_control_type | solar constant scheme control flag: \n 0: fixed value = 1366.0 \f$W m^{-2}\f$ (old standard) \n 10: fixed value =1360.8 \f$W m^{-2}\f$ (new standard) \n 1: NOAA ABS-scale TSI table (yearly) with 11-yr cycle approximation \n 2: NOAA TIM-scale TSI table(yearly) with 11-yr cycle approximation \n 3: CMIP5 TIM-scale TSI table (yearly) with 11-yr cycle approximation \n 4: CMIP5 TIM-scale TSI table (monthly) with 11-yr cycle approximation | 0 | - lwhtr | gfs_typedefs::gfs_control_type | logical flag for output of longwave heating rate | .true. | - swhtr | gfs_typedefs::gfs_control_type | logical flag for output of shortwave heating rate | .true. | - cnvgwd | gfs_typedefs::gfs_control_type | logical flag for convective gravity wave drag scheme | .false. | - shal_cnv | gfs_typedefs::gfs_control_type | logical flag for calling shallow convection | .false. | - cal_pre | gfs_typedefs::gfs_control_type | logical flag for calling precipitation type algorithm | .false. | - redrag | gfs_typedefs::gfs_control_type | logical flag for applying reduced drag coefficient for high wind over sea in GFS surface layer scheme | .false. | - dspheat | gfs_typedefs::gfs_control_type | logical flag for using TKE dissipative heating to temperature tendency in hybrid EDMF and TKE-EDMF schemes | .false. | - hybedmf | gfs_typedefs::gfs_control_type | logical flag for calling hybrid EDMF PBL scheme | .false. | - random_clds | gfs_typedefs::gfs_control_type | logical flag for whether clouds are random | .false. | - trans_trac | gfs_typedefs::gfs_control_type | logical flag for convective transport of tracers | .false. | - cnvcld | gfs_typedefs::gfs_control_type | logical flag for convective cloud | .false. | - imfshalcnv | gfs_typedefs::gfs_control_type | flag for mass flux shallow convective scheme:\n 1:July 2010 version of mass-flux shallow convective scheme (operational as of 2016) \n 2: scale- & aerosol- aware mass-flux shallow convective scheme (2017) \n 0: modified Tiedtke's eddy-diffusion shallow convective scheme \n -1: no shallow convection used | 1 | - imfdeepcnv | gfs_typedefs::gfs_control_type | flag for mass-flux deep convective scheme:\n 1: July 2010 version of SAS convective scheme (operational version as of 2016) \n 2: scale- & aerosol-aware mass-flux deep convective scheme (2017) \n 0: old SAS convective scheme before July 2010 | 1 | - cdmbgwd(2) | gfs_typedefs::gfs_control_type | multiplication factors for mountain blocking and orographic gravity wave drag | /2.0d0,0.25d0/ | - prslrd0 | gfs_typedefs::gfs_control_type | pressure level above which to apply Rayleigh damping | 0.0d0 | - ivegsrc | gfs_typedefs::gfs_control_type | flag for vegetation type dataset choice: \n 0: USGS; 1: IGBP(20 category); 2: UMD (13 category) | 2 | - isot | gfs_typedefs::gfs_control_type | flag for soil type dataset choice:\n 0: Zobler soil type (9 category) \n 1: STATSGO soil type (19 category) | 0 | - debug | gfs_typedefs::gfs_control_type | flag for debug printout | .false. | - nstf_name(5) | gfs_typedefs::gfs_control_type | NSST related paramters:\n flag 0 for no NST; 1 for uncoupled nst; and 2 for coupled NST \n nstf_name(1): 0=NSSTM off, 1= NSSTM on but uncoupled, 2= NSSTM on and coupled \n nstf_name(2): 1=NSSTM spin up on, 0=NSSTM spin up off \n nstf_name(3): 1=NSST analysis on, 0=NSSTM analysis off \n nstf_name(4): zsea1 in mm \n nstf_name(5): zesa2 in mm | /0,0,1,0,5/ | - nst_anl | gfs_typedefs::gfs_control_type | flag for NSSTM analysis in gcycle/sfcsub | .false. | - satmedmf | gfs_typedefs::gfs_control_type | logical flag for calling TKE EDMF PBL scheme | .false. | - -\section cpt_physics_nml EMC CPT Physics Parameters - \c NML_option | Definition in Host Model | Description | Default Value | --------------------|----------------------------------|---------------------------------------------------|-----------------------| - crtrh(3) | gfs_typedefs::gfs_control_type | critical relative humidity at the surface, PBL top and at the top of the atmosphere | /0.90d0,0.90d0,0.90d0/ | - ras | gfs_typedefs::gfs_control_type | logical flag for RAS convection scheme | .false. | - cscnv | gfs_typedefs::gfs_control_type | logical flag for Chikira-Sugiyama deep convection | .false. | - do_aw | gfs_typedefs::gfs_control_type | flag for Arakawa-Wu scale-awere adjustment | .false. | - shcnvcw | gfs_typedefs::gfs_control_type | logical flag for shallow convective cloud | .false. | - xkzm_h | gfs_typedefs::gfs_control_type | background vertical diffusion for heat q | 1.0d0 | - xkzm_m | gfs_typedefs::gfs_control_type | background vertical diffusion for momentum | 1.0d0 | - xkzm_s | gfs_typedefs::gfs_control_type | sigma threshold for background mom. diffusion | 1.0d0 | - microp_uniform | gfs_typedefs::gfs_control_type | logical flag for uniform subcolumns for MG microphysics | .true. | - mg_do_ice_gmao | gfs_typedefs::gfs_control_type | logical flag for turning on gmao ice autoconversion in MG microphysics | .false. | - mg_do_liq_liu | gfs_typedefs::gfs_control_type | logical flag for turning on Liu liquid treatment in MG microphysics | .true. | - mg_dcs | gfs_typedefs::gfs_control_type | autoconversion size threshold for cloud ice to snow in MG microphysics | 200.0 | - mg_alf | gfs_typedefs::gfs_control_type | tuning factor for alphas (alpha = 1 - critical relative humidity) | 1.0 | - mg_ts_auto_ice(2) | gfs_typedefs::gfs_control_type | autoconversion time scale for ice in MG microphysics | /180.0,180.0/ | - mg_qcvar | gfs_typedefs::gfs_control_type | cloud water relative variance in MG microphysics | 1.0 | - fprcp | gfs_typedefs::gfs_control_type | number of frozen precipitation species in MG microphysics \n 0: no prognostic rain and snow, 1: MG2;2:MG3 | 0 | - cs_parm(10) | gfs_typedefs::gfs_control_type | tunable parameters for Chikira-Sugiyama convection | /8.0,4.0,1.0e3,3.5e3,20.0,1.0,-999.,1.,0.6,0./ | - iccn | gfs_typedefs::gfs_control_type | flag for using IN and CCN forcing in MG2/3 microphysics | .false. | - aero_in | gfs_typedefs::gfs_control_type | flag for using aerosols in MG microphysics | .false. | - ctei_rm(2) | gfs_typedefs::gfs_control_type | critical cloud top entrainment instability criteria (used if mstrat=.true.) | /10.0d0,10.0d0/ | - rhcmax | gfs_typedefs::gfs_control_type | maximum critical relative humidity | 0.9999999 | - effr_in | gfs_typedefs::gfs_control_type | logical flag for using input cloud effective radii calculation | .false. | - cplflx | gfs_typedefs::gfs_control_type | logical flag for controlling cplflx collection | .false. | - iau_delthrs | gfs_typedefs::gfs_control_type | incremental analysis update (IAU) time interval in hours | 6 | - iaufhrs | gfs_typedefs::gfs_control_type | forecast hours associated with increment files | -1 | - -\section gsd_hrrr_nml GSD Physics Parameters - \c NML_option | Definition in Host Model | Description | Default Value | ----------------------------|---------------------------------|-----------------------------------------------|-----------------------| - ltaerosol | gfs_typedefs::gfs_control_type | logical flag for using aerosol climotology | .false. | - lradar | gfs_typedefs::gfs_control_type | logical flag for computing radar reflectivity | .false. | - do_mynnedmf | gfs_typedefs::gfs_control_type | flag to activate MYNN-EDMF scheme | .false. | - do_mynnsfclay | gfs_typedefs::gfs_control_type | flag to activate MYNN-SFCLAY scheme | .false. | - lmfshal | gfs_typedefs::gfs_control_type | flag for mass-flux shallow convection scheme in the cloud fraction calculation (lmf=shal_cnv .and. imfshalcnv > 0) | shal_cnv .and. (imfshalcnv > 0) | - bl_mynn_mixlength | gfs_typedefs::gfs_control_type | flag for different version of mixing length formulation \n 0: Original form from Nakanishi and Niino (2009) \cite NAKANISHI_2009 . NO scale-awareness is applied to the master mixing length, regardless of "scaleware" setting \n 1: HRRR operational form 201609-201807.Designed to work without the mass-flux scheme. Uses BouLac mixing length in free atmosphere. \n 2: HRRR operational form 201807-present. Designed to be compatible with mass-flux scheme activated (default) | 2 | - bl_mynn_edmf | gfs_typedefs::gfs_control_type | flag to activate the mass-flux scheme \n 0: Deactivate mass-flux scheme \n 1: Activate dynamic multiplume mass-flux scheme (default) | 0 | - bl_mynn_edmf_mom | gfs_typedefs::gfs_control_type | flag to activate the transport of momentum \n 0: Deactivate momentum transport in mass-flux scheme (default) \n 1: Activate momentum transport in dynamic multiplume mass-flux scheme. \p bl_mynn_edmf must be set to 1 | 1 | - bl_mynn_edmf_tke | gfs_typedefs::gfs_control_type | flag to activate the transport of TKE \n 0: Deactivate TKE transport in mass-flux scheme (default) \n 1: Activate TKE transport in dynamic multiplume mass-flux scheme. \p bl_mynn_edmf must be set to 1 | 0 | - bl_mynn_edmf_tkeadvect | gfs_typedefs::gfs_control_type | activate computation of TKE advection (not yet in use for FV3) \n False: Deactivate TKE advection (default) \n True: Activate TKE advection | .false. | - bl_mynn_edmf_tkebudget | gfs_typedefs::gfs_control_type | flag to activate TKE budget | 0 | - bl_mynn_edmf_cloudpdf | gfs_typedefs::gfs_control_type | flag to determine which cloud PDF to use \n 0: use Sommeria-Deardorff subgrid cloud PDF \n 1: use Kuwano-Yoshida subgrid cloud PDF \n 2: use modified Chaboureau-Bechtold subgrid cloud PDF (default) | 2 | - bl_mynn_edmf_cloudmix | gfs_typedefs::gfs_control_type | flag to activate mixing of cloud species \n: Deactivate the mixing of any water species mixing ratios \n 1: activate the mixing of all water species mixing ratios (default) | 1 | - bl_mynn_mixqt | gfs_typedefs::gfs_control_type | flag to mix total water or individual species \n 0: Mix individual water species separately (default) \n 1: DO NOT USE | 0 | - icloud_bl | gfs_typedefs::gfs_control_type | flag to coupling sgs clouds to radiation \n 0: Deactivate coupling subgrid clouds to radiation \n 1: Activate subgrid cloud coupling to radiation (highly suggested) | 1 | - lsoil_lsm | gfs_typedefs::gfs_control_type | number of soil layers internal to land surface model | -1 | - lsm | gfs_typedefs::gfs_control_type | flag for land surface model | 1 | - -\section stochy_nml Stochastic Physics Parameters - \c NML_option | Definition in Host Model | Description | Default Value | --------------------|--------------------------------|-----------------------------------------------------------------------|---------------| - do_sppt | gfs_typedefs::gfs_control_type | flag for stochastic SPPT option | .false. | - do_shum | gfs_typedefs::gfs_control_type | flag for stochastic SHUM option | .false. | - do_skeb | gfs_typedefs::gfs_control_type | flag for stochastic SKEB option | .false. | - use_zmtnblck | gfs_typedefs::gfs_control_type | flag for mountain blocking | .false. | - do_sfcperts | gfs_typedefs::gfs_control_type | flag for stochastic surface perturbations option | .false. | - nsfcpert | gfs_typedefs::gfs_control_type | number of weights for stochastic surface perturbation | 6 | - pertz0 | gfs_typedefs::gfs_control_type | magnitude of perturbation of momentum roughness length | -999. | - pertzt | gfs_typedefs::gfs_control_type | magnitude of perturbation of heat to momentum roughness length ratio | -999. | - pertshc | gfs_typedefs::gfs_control_type | magnitude of perturbation of soil hydraulic conductivity | -999. | - pertlai | gfs_typedefs::gfs_control_type | magnitude of perturbation of leaf area index | -999. | - pertalb | gfs_typedefs::gfs_control_type | magnitude of surface albedo perturbation | -999. | - pertvegf | gfs_typedefs::gfs_control_type | magnitude of perturbation of vegetation fraction | -999. | - -\subsection gen_stochy_nml General Stochastic Physics Paramters - \c NML_option | Definition in Host Model | Description | Default Value | --------------------|----------------------------|--------------------------------------------------------------|---------------| - ntrunc | compns_stochy_mod | spectral resolution (e.g. T126) of random patterns | -999 | - lon_s, lat_s | compns_stochy_mod | number of longitude and latitude point for the Gaussian grid | -999 | - fhstoch | compns_stochy_mod | forecast hour to write out random pattern in order to restart the pattern for a different forecast (used in DA), file is stoch_out.F | -999.0 | - stochini | compns_stochy_mod | set to true if wanting to read in a previous random pattern (input file need to be named \c stoch_ini) | -999.0 | .false. | - -\subsection sppt_contrl_nml SPPT Control Parameters - \c NML_option | Definition in Host Model | Description | Default Value | --------------------|----------------------------|--------------------------------------------------------------------------------|---------------| - sppt | compns_stochy_mod | amplitude of random patterns | -999. | - sppt_tau | compns_stochy_mod | decorrelation timescales in secods | -999. | - sppt_lscale | compns_stochy_mod | decorrelation spatial scales in meters | -999. | - sppt_logit | compns_stochy_mod | logit transform for SPPT to bounded interval [-1,+1] | .false. | - iseed_sppt | compns_stochy_mod | seeds for setting the random number sequence (ignored if \c stochini is true) | 0 | - sppt_sigtop1, sppt_sigtop2 | compns_stochy_mod | sigma levels to taper perturbations to zeros | 0.1, 0.025 | - sppt_sfclimit | compns_stochy_mod | reduce amplitude of SPPT near surface (lowest 2 levels) | .false. | - use_zmtnblck | gfs_typedefs::gfs_control_type | flag for mountain blocking. .T. = do not apply perturbations below the dividing streamline that is diagnosed by the gravity wave drag, mountain blocking scheme | .false. | - - -\subsection shum_contrl_nml SHUM Control Parameters - \c NML_option | Definition in Host Model | Description | Default Value | --------------------|----------------------------|------------------------------------------------------------------------------|---------------| - shum | compns_stochy_mod | amplitude of stochastic boundary layer specific humidity perturbations | -999. | - shum_tau | compns_stochy_mod | decorrelation time scales in seconds | -999. | - shum_lscale | compns_stochy_mod | decorrelation spatial scales in meters | -999. | - shum_sigefold | compns_stochy_mod | e-folding lengthscale (in units of sigma) of specific humidity perturbations | 0.2 | - -\subsection skeb_contrl_nml SKEB Control Parameters - \c NML_option | Definition in Host Model | Description | Default Value | -------------------------------|----------------------------|------------------------------------------------------------------------------------|---------------| - skeb | compns_stochy_mod | stochastic KE backscatter amplitude | -999. | - skeb_tau | compns_stochy_mod | decorrelation timescales in seconds | -999. | - skeb_lscale | compns_stochy_mod | decorrelation spatial scales in meter | -999. | - iseed_skeb | compns_stochy_mod | seeds for setting the random number sequnce (ignored if \c stochini is true) | 0 | - skebnorm | compns_stochy_mod | 0: random pattern is stream function,1: pattern is kenorm, 2: pattern is vorticity | 0 | - skeb_varspect_opt | compns_stochy_mod | Gaussian or power law variance spectrum for SKEB (0: Gaussian, 1: power law | 0 | - skeb_npass | compns_stochy_mod | number of passes of smoother for dissipation estimate | 11 | - skeb_vdof | compns_stochy_mod | the number of degrees of freedom in the vertical for the SKEB random pattern | 5 | - skeb_sigtop1, skeb_sigtop2 | compns_stochy_mod | sigma levels to taper perturbations to zeros | 0.1, 0.025 | - - - -\section zhao_carr_nml Zhao-Carr MP Parameters - \c NML_option | DDT in Host Model | Description | Default Value | --------------------|---------------------------------|-----------------------------------------------|---------------------| - psautco(2) | gfs_typedefs::gfs_control_type | auto conversion coeff from ice to snow | /6.0d-4,3.0d-4/ | - prautco(2) | gfs_typedefs::gfs_control_type | auto conversion coeff from cloud to rain | /1.0d-4,1.0d-4/ | - -\section gfdl_cloud_microphysics_nml GFDL Cloud MP Parameters -The namelist variable description is provided in module_gfdl_cloud_microphys.F90 - \c NML_option | Definition in CCPP | Description | Default Value | --------------------------|---------------------------|--------------------------------------------------------------------------------|----------------------| - sedi_transport | gfdl_cloud_microphys_mod | logical flag for turning on horizontal momentum transport during sedimentation | .true. | - do_sedi_heat | gfdl_cloud_microphys_mod | logical flag for turning on horizontal heat transport during sedimentation | .true. | - rad_snow | gfdl_cloud_microphys_mod | logical flag for considering snow in cloud fraction calculation | .true. | - rad_graupel | gfdl_cloud_microphys_mod | logical flag for considering graupel in cloud fraction calculation | .true. | - rad_rain | gfdl_cloud_microphys_mod | logical flag for considering rain in cloud fraction calculation | .true. | - const_vi | gfdl_cloud_microphys_mod | logical flag for using constant cloud ice fall speed | .false. | - const_vs | gfdl_cloud_microphys_mod | logical flag for using constant snow fall speed | .false. | - const_vg | gfdl_cloud_microphys_mod | logical flag for using constant graupel fall speed | .false. | - const_vr | gfdl_cloud_microphys_mod | logical flag for using constant rain fall speed | .false. | - vi_max | gfdl_cloud_microphys_mod | maximum fall speed for cloud ice | 0.5 | - vs_max | gfdl_cloud_microphys_mod | maximum fall speed for snow | 5.0 | - vg_max | gfdl_cloud_microphys_mod | maximum fall speed for graupel | 8.0 | - vr_max | gfdl_cloud_microphys_mod | maximum fall speed for rain | 12.0 | - qi_lim | gfdl_cloud_microphys_mod | cloud ice limiter to prevent large ice built up in cloud ice freezing and deposition | 1. | - prog_ccn | gfdl_cloud_microphys_mod | logical flag for activating prognostic CCN (not supported in GFS Physics) | .false. | - do_qa | gfdl_cloud_microphys_mod | logical flag for activating inline cloud fraction diagnosis in fast saturation adjustment | .true. | - fast_sat_adj | gfdl_cloud_microphys_mod | logical flag for adjusting cloud water evaporation/freezing, cloud ice deposition when fast saturation adjustment is activated (do_sat_adj=.true.) | .true. | - tau_l2v | gfdl_cloud_microphys_mod | time scale for evaporation of cloud water to water vapor. Increasing(decreasing) \p tau_l2v can decrease(boost) deposition of cloud water to water vapor | 300. | - tau_v2l | gfdl_cloud_microphys_mod | time scale for condensation of water vapor to cloud water. Increasing(decreasing) \p tau_v2l can decrease(boost) condensation of water vapor to cloud water | 150. | - tau_g2v | gfdl_cloud_microphys_mod | time scale for sublimation of graupel to water vapor. Increasing(decreasing) \p tau_g2v can decrease(boost) sublimation of graupel to water vapor | 900. | - rthresh | gfdl_cloud_microphys_mod | critical cloud water radius for autoconversion (cloud water -> rain). Increasing(decreasing) of \p rthresh makes the autoconversion harder(easier) | 10.0e-6 | - dw_land | gfdl_cloud_microphys_mod | base value for subgrid deviation/variability over land | 0.20 | - dw_ocean | gfdl_cloud_microphys_mod | base value for subgrid deviation/variability over ocean | 0.10 | - ql_gen | gfdl_cloud_microphys_mod | maximum value for cloud water generated from condensation of water vapor (water vapor-> cloud water) | 1.0e-3 | - ql_mlt | gfdl_cloud_microphys_mod | maximum value of cloud water allowed from melted cloud ice (cloud ice -> cloud water or rain) | 2.0e-3 | - qi0_crt | gfdl_cloud_microphys_mod | threshold of cloud ice to snow autoconversion (cloud ice -> snow) | 1.0e-4 | - qs0_crt | gfdl_cloud_microphys_mod | threshold of snow to graupel autoconversion (snow->graupel) | 1.0e-3 | - tau_i2s | gfdl_cloud_microphys_mod | time scale for autoconversion of cloud ice to snow | 1000. | - c_psaci | gfdl_cloud_microphys_mod | accretion efficiency of cloud ice to snow | 0.02 | - c_pgacs | gfdl_cloud_microphys_mod | accretion efficiency of snow to graupel | 2.0e-3 | - rh_inc | gfdl_cloud_microphys_mod | relative humidity increment for complete evaporation of cloud water and cloud ice | 0.25 | - rh_inr | gfdl_cloud_microphys_mod | relative humidity increment for sublimation of snow | 0.25 | - rh_ins | gfdl_cloud_microphys_mod | relative humidity increment for minimum evaporation of rain | 0.25 | - ccn_l | gfdl_cloud_microphys_mod | base CCN over land \f$cm^{-3}\f$ | 270. | - ccn_o | gfdl_cloud_microphys_mod | base CCN over ocean \f$cm^{-3}\f$ | 90. | - c_paut | gfdl_cloud_microphys_mod | autoconversion efficiency of cloud water to rain | 0.55 | - c_cracw | gfdl_cloud_microphys_mod | accretion efficiency of cloud water to rain | 0.9 | - use_ppm | gfdl_cloud_microphys_mod | \e true to use PPM fall scheme; \e false to use time-implicit monotonic fall scheme | .false. | - use_ccn | gfdl_cloud_microphys_mod | \e true to compute prescribed CCN. It should be .true. when \p prog_ccn = .false. | .false. | - mono_prof | gfdl_cloud_microphys_mod | \e true to turn on terminal fall with monotonic PPM scheme. This is used together with \p use_ppm=.true. | .true. | - z_slope_liq | gfdl_cloud_microphys_mod | \e true to turn on vertically subgrid linear monotonic slope for autoconversion of cloud water to rain | .true. | - z_slope_ice | gfdl_cloud_microphys_mod | \e true to turn on vertically subgrid linear monotonic slope for autoconversion of cloud ice to snow | .false. | - de_ice | gfdl_cloud_microphys_mod | \e true to convert excessive cloud ice to snow to prevent ice over-built from other sources like convection scheme (not supported in GFS physics) | .false. | - fix_negative | gfdl_cloud_microphys_mod | \e true to fix negative water species using nearby points | .false. | - icloud_f | gfdl_cloud_microphys_mod | flag (0,1,or 2) for cloud fraction diagnostic scheme | 0 | - mp_time | gfdl_cloud_microphys_mod | time step of GFDL cloud microphysics | 150. | - */ From 80528f287dec77fb90b0e8ee50adff3a0982cf65 Mon Sep 17 00:00:00 2001 From: Man Zhang Date: Wed, 5 Jun 2019 14:25:17 -0600 Subject: [PATCH 02/89] scidoc update --- physics/docs/library.bib | 104 ++++----- physics/docs/pdftxt/CPT_CSAW.txt | 2 +- physics/docs/pdftxt/CPT_MG3.txt | 32 ++- physics/docs/pdftxt/CPT_adv_suite.txt | 172 +++++++-------- physics/docs/pdftxt/GFSv15_suite.txt | 212 ++++++++++--------- physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt | 198 +++++++++-------- physics/docs/pdftxt/GSD_adv_suite.txt | 131 ++++++------ physics/docs/pdftxt/all_shemes_list.txt | 76 +++---- physics/docs/pdftxt/suite_input.nml.txt | 44 ++-- physics/micro_mg3_0.F90 | 2 - physics/module_mp_thompson.F90 | 6 +- physics/mp_thompson.F90 | 2 +- physics/satmedmfvdif.F | 23 +- 13 files changed, 495 insertions(+), 509 deletions(-) diff --git a/physics/docs/library.bib b/physics/docs/library.bib index d34d2f3fa..dbc820d07 100644 --- a/physics/docs/library.bib +++ b/physics/docs/library.bib @@ -1,15 +1,27 @@ %% This BibTeX bibliography file was created using BibDesk. %% http://bibdesk.sourceforge.net/ -%% Created for Man Zhang at 2019-05-31 14:47:36 -0600 +%% Created for Man Zhang at 2019-06-05 10:35:17 -0600 %% Saved with string encoding Unicode (UTF-8) +@article{Gettelman_et_al_2019, + Author = {A. Gettelman and H. Morrison and K. Thayer-Calder and C. M. Zarzycki}, + Date-Added = {2019-06-05 16:32:22 +0000}, + Date-Modified = {2019-06-05 16:34:07 +0000}, + Journal = {Journal of Advances in Modeling Earth Systems}, + Title = {The impact of rimed ice hydrometeors on global and regional climate}, + Year = {2019}} + +@article{cite-key, + Date-Added = {2019-06-05 16:32:11 +0000}, + Date-Modified = {2019-06-05 16:32:11 +0000}} + @article{nakanishi_2000, - Author = {M. Nakanishi }, + Author = {M. Nakanishi}, Date-Added = {2019-05-31 14:46:02 -0600}, Date-Modified = {2019-05-31 14:47:32 -0600}, Journal = {Boundary-Layer Meteorology}, @@ -73,16 +85,11 @@ @article{HOBBS_1974 @article{Pichugina_2008, Author = {Pichugina, Yelena L. and Tucker, Sara C. and Banta, Robert M. and Brewer, W. Alan and Kelley, Neil D. and Jonkman, Bonnie J. and Newsom, Rob K.}, Date-Added = {2019-05-22 11:25:17 -0600}, - Date-Modified = {2019-05-22 11:25:17 -0600}, - Doi = {10.1175/2008jtecha988.1}, - Issn = {1520-0426}, + Date-Modified = {2019-06-05 15:59:49 +0000}, Journal = {Journal of Atmospheric and Oceanic Technology}, - Month = {Aug}, Number = {8}, Pages = {1307--1327}, - Publisher = {American Meteorological Society}, Title = {Horizontal-Velocity and Variance Measurements in the Stable Boundary Layer Using Doppler Lidar: Sensitivity to Averaging Procedures}, - Url = {http://dx.doi.org/10.1175/2008JTECHA988.1}, Volume = {25}, Year = {2008}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/2008JTECHA988.1}, @@ -91,16 +98,11 @@ @article{Pichugina_2008 @article{Nielsen_Gammon_2008, Author = {Nielsen-Gammon, John W. and Powell, Christina L. and Mahoney, M. J. and Angevine, Wayne M. and Senff, Christoph and White, Allen and Berkowitz, Carl and Doran, Christopher and Knupp, Kevin}, Date-Added = {2019-05-22 11:19:45 -0600}, - Date-Modified = {2019-05-22 11:19:45 -0600}, - Doi = {10.1175/2007jamc1503.1}, - Issn = {1558-8432}, + Date-Modified = {2019-06-05 15:31:19 +0000}, Journal = {Journal of Applied Meteorology and Climatology}, - Month = {Jan}, Number = {1}, Pages = {27--43}, - Publisher = {American Meteorological Society}, Title = {Multisensor Estimation of Mixing Heights over a Coastal City}, - Url = {http://dx.doi.org/10.1175/2007JAMC1503.1}, Volume = {47}, Year = {2008}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/2007JAMC1503.1}, @@ -286,15 +288,11 @@ @article{Rutter_2009 @article{Essery_2009, Author = {Essery, Richard and Rutter, Nick and Pomeroy, John and Baxter, Robert and St{\"a}hli, Manfred and Gustafsson, David and Barr, Alan and Bartlett, Paul and Elder, Kelly}, Date-Added = {2019-05-06 14:20:27 -0600}, - Date-Modified = {2019-05-20 16:04:05 -0600}, - Doi = {10.1175/2009bams2629.1}, - Issn = {1520-0477}, + Date-Modified = {2019-06-05 16:01:14 +0000}, Journal = {Bulletin of the American Meteorological Society}, Number = {8}, Pages = {1120-1136}, - Publisher = {American Meteorological Society}, Title = {SNOWMIP2: An Evaluation of Forest Snow Process Simulations}, - Url = {http://dx.doi.org/10.1175/2009BAMS2629.1}, Volume = {90}, Year = {2009}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/2009BAMS2629.1}, @@ -436,15 +434,11 @@ @article{Benjamin_2004a @article{Smirnova_2000, Author = {Smirnova, Tatiana G. and Brown, John M. and Benjamin, Stanley G. and Kim, Dongsoo}, - Doi = {10.1029/1999jd901047}, - Issn = {0148-0227}, + Date-Modified = {2019-06-05 15:32:20 +0000}, Journal = {Journal of Geophysical Research: Atmospheres}, - Month = {Feb}, Number = {D3}, Pages = {4077--4086}, - Publisher = {American Geophysical Union (AGU)}, Title = {Parameterization of cold-season processes in the MAPS land-surface scheme}, - Url = {http://dx.doi.org/10.1029/1999JD901047}, Volume = {105}, Year = {2000}, Bdsk-Url-1 = {http://dx.doi.org/10.1029/1999JD901047}} @@ -889,16 +883,11 @@ @article{Thompson_2004 @article{Abdul_Razzak_2000, Author = {Abdul-Razzak, Hayder and Ghan, Steven J.}, Date-Added = {2019-01-22 11:02:36 -0700}, - Date-Modified = {2019-05-20 16:02:47 -0600}, - Doi = {10.1029/1999jd901161}, - Issn = {0148-0227}, + Date-Modified = {2019-06-05 15:28:16 +0000}, Journal = {Journal of Geophysical Research: Atmospheres}, - Month = {Mar}, Number = {D5}, Pages = {6837-6844}, - Publisher = {American Geophysical Union (AGU)}, Title = {A parameterization of aerosol activation: 2. Multiple aerosol types}, - Url = {http://dx.doi.org/10.1029/1999JD901161}, Volume = {105}, Year = {2000}, Bdsk-Url-1 = {http://dx.doi.org/10.1029/1999JD901161}} @@ -1095,16 +1084,11 @@ @article{Lewis_2005 @article{Zhu_2018, Author = {Zhu, Yuejian and Zhou, Xiaqiong and Li, Wei and Hou, Dingchen and Melhauser, Christopher and Sinsky, Eric and Pe{\~n}a, Malaquias and Fu, Bing and Guan, Hong and Kolczynski, Walter and et al.}, Date-Added = {2018-09-07 11:48:50 -0600}, - Date-Modified = {2018-09-07 11:48:50 -0600}, - Doi = {10.1029/2018jd028506}, - Issn = {2169-897X}, + Date-Modified = {2019-06-05 15:33:03 +0000}, Journal = {Journal of Geophysical Research: Atmospheres}, - Month = {Jul}, Number = {13}, Pages = {6732--6745}, - Publisher = {American Geophysical Union (AGU)}, Title = {Toward the Improvement of Subseasonal Prediction in the National Centers for Environmental Prediction Global Ensemble Forecast System}, - Url = {http://dx.doi.org/10.1029/2018JD028506}, Volume = {123}, Year = {2018}, Bdsk-Url-1 = {http://dx.doi.org/10.1029/2018JD028506}, @@ -1779,12 +1763,12 @@ @article{zeng_and_dickinson_1998 @conference{zheng_et_al_2009, Address = {Omaha, Nebraska}, Author = {W. Zheng and H. Wei and J. Meng and M. Ek and K. Mitchell and J. Derber and X. Zeng and Z. Wang}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBWLi4vLi4vLi4vLi4vLi4vRGVza3RvcC9OT0FIX0xTTS9JbXByb3ZlbWVudF9vZl9MYW5kX1N1cmZhY2VfU2tpbl9UZW1wZXJhdHVyZV9pbl9OQy5wZGZPEQIgAAAAAAIgAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADT4djXSCsAAANl5rUfSW1wcm92ZW1lbnRfb2ZfTGFuZCMzNjVGRjBGLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2X/D9aQ780AAAAAAAAAAAAFAAMAAAkgAAAAAAAAAAAAAAAAAAAACE5PQUhfTFNNABAACAAA0+ItNwAAABEACAAA1pFSPQAAAAEAEANl5rUAD8YgAA/GDwAGL94AAgBRTWFjaW50b3NoIEhEOlVzZXJzOgBtYW4uemhhbmc6AERlc2t0b3A6AE5PQUhfTFNNOgBJbXByb3ZlbWVudF9vZl9MYW5kIzM2NUZGMEYucGRmAAAOAG4ANgBJAG0AcAByAG8AdgBlAG0AZQBuAHQAXwBvAGYAXwBMAGEAbgBkAF8AUwB1AHIAZgBhAGMAZQBfAFMAawBpAG4AXwBUAGUAbQBwAGUAcgBhAHQAdQByAGUAXwBpAG4AXwBOAEMALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAFdVc2Vycy9tYW4uemhhbmcvRGVza3RvcC9OT0FIX0xTTS9JbXByb3ZlbWVudF9vZl9MYW5kX1N1cmZhY2VfU2tpbl9UZW1wZXJhdHVyZV9pbl9OQy5wZGYAABMAAS8AABUAAgAQ//8AAAAIAA0AGgAkAH0AAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACoQ==}, Date-Added = {2018-01-26 22:19:06 +0000}, Date-Modified = {2018-01-29 23:51:37 +0000}, Organization = {The 23rd Conference on Weather Analysis and Forecasting (WAF)/19th Conference on Numerical Weather Prediction(NWP)}, Title = {Improvement of land surface skin temperature in NCEP Operational NWP models and its impact on satellite Data Assimilation}, - Year = {2009}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBWLi4vLi4vLi4vLi4vLi4vRGVza3RvcC9OT0FIX0xTTS9JbXByb3ZlbWVudF9vZl9MYW5kX1N1cmZhY2VfU2tpbl9UZW1wZXJhdHVyZV9pbl9OQy5wZGZPEQIgAAAAAAIgAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADT4djXSCsAAANl5rUfSW1wcm92ZW1lbnRfb2ZfTGFuZCMzNjVGRjBGLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2X/D9aQ780AAAAAAAAAAAAFAAMAAAkgAAAAAAAAAAAAAAAAAAAACE5PQUhfTFNNABAACAAA0+ItNwAAABEACAAA1pFSPQAAAAEAEANl5rUAD8YgAA/GDwAGL94AAgBRTWFjaW50b3NoIEhEOlVzZXJzOgBtYW4uemhhbmc6AERlc2t0b3A6AE5PQUhfTFNNOgBJbXByb3ZlbWVudF9vZl9MYW5kIzM2NUZGMEYucGRmAAAOAG4ANgBJAG0AcAByAG8AdgBlAG0AZQBuAHQAXwBvAGYAXwBMAGEAbgBkAF8AUwB1AHIAZgBhAGMAZQBfAFMAawBpAG4AXwBUAGUAbQBwAGUAcgBhAHQAdQByAGUAXwBpAG4AXwBOAEMALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAFdVc2Vycy9tYW4uemhhbmcvRGVza3RvcC9OT0FIX0xTTS9JbXByb3ZlbWVudF9vZl9MYW5kX1N1cmZhY2VfU2tpbl9UZW1wZXJhdHVyZV9pbl9OQy5wZGYAABMAAS8AABUAAgAQ//8AAAAIAA0AGgAkAH0AAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACoQ==}} + Year = {2009}} @article{chen_et_al_1997, Author = {F. Chen and Z. Janjic and K. Mitchell}, @@ -2023,6 +2007,7 @@ @article{iacono_et_al_2008 @article{grant_2001, Abstract = {A closure for the fluxes of mass, heat, and moisture at cloud base in the cumulus-capped boundary layer is developed. The cloud-base mass flux is obtained from a simplifed turbulence kinetic energy (TKE) budget for the sub-cloud layer, in which cumulus convection is assumed to be associated with a transport of TKE from the sub-cloud layer to the cloud layer.The heat and moisture fluxes are obtained from a jump model based on the virtual-potential-temperature equation. A key part of this parametrization is the parametrization of the virtual-temperature flux at the top of the transition zone between the sub-cloud and cloud layers.It is argued that pressure fluctuations must be responsible for the transport of TKE from the cloud layer to the sub-cloud layer.}, Author = {A. L. M. Grant}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvR3JhbnQvMjAwMS5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAoiV4IMjAwMS5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARgJuNOHLk4AAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAABUdyYW50AAAQAAgAANHneLIAAAARAAgAANOHgq4AAAABABgAKIleAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AEdyYW50OgAyMDAxLnBkZgAADgASAAgAMgAwADAAMQAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9HcmFudC8yMDAxLnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Date-Added = {2016-06-15 22:11:22 +0000}, Date-Modified = {2018-07-06 19:02:34 +0000}, Doi = {10.1002/qj.49712757209}, @@ -2036,13 +2021,13 @@ @article{grant_2001 Url = {http://dx.doi.org/10.1002/qj.49712757209}, Volume = {127}, Year = {2001}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvR3JhbnQvMjAwMS5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAoiV4IMjAwMS5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARgJuNOHLk4AAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAABUdyYW50AAAQAAgAANHneLIAAAARAAgAANOHgq4AAAABABgAKIleAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AEdyYW50OgAyMDAxLnBkZgAADgASAAgAMgAwADAAMQAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9HcmFudC8yMDAxLnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Bdsk-Url-1 = {http://dx.doi.org/10.1002/qj.49712757209}} @article{zhang_and_wu_2003, Abstract = {Abstract This study uses a 2D cloud-resolving model to investigate the vertical transport of horizontal momentum and to understand the role of a convection-generated perturbation pressure field in the momentum transport by convective systems during part of the Tropical Ocean and Global Atmosphere Coupled Ocean?Atmosphere Response Experiment (TOGA COARE) Intensive Observation Period. It shows that convective updrafts transport a significant amount of momentum vertically. This transport is downgradient in the easterly wind regime, but upgradient during a westerly wind burst. The differences in convective momentum transport between easterly and westerly wind regimes are examined. The perturbation pressure gradient accounts for an important part of the apparent momentum source. In general it is opposite in sign to the product of cloud mass flux and the vertical wind shear, with smaller magnitude. Examination of the dynamic forcing to the pressure field demonstrates that the linear forcing representing the interaction between the convective updrafts and the large-scale wind shear is the dominant term, while the nonlinear forcing is of secondary importance. Thus, parameterization schemes taking into account the linear interaction between the convective updrafts and the large-scale wind shear can capture the essential features of the perturbation pressure field. The parameterization scheme for momentum transport by Zhang and Cho is evaluated using the model simulation data. The parameterized pressure gradient force using the scheme is in excellent agreement with the simulated one. The parameterized apparent momentum source is also in good agreement with the model simulation. Other parameterization methods for the pressure gradient are also discussed.}, Annote = {doi: 10.1175/1520-0469(2003)060<1120:CMTAPP>2.0.CO;2}, Author = {Zhang, Guang J. and Wu, Xiaoqing}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvWmhhbmcvMjAwMy5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAqjuYIMjAwMy5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFrUP9K0L8MAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAABVpoYW5nAAAQAAgAANHneLIAAAARAAgAANK0kjMAAAABABgAKo7mAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AFpoYW5nOgAyMDAzLnBkZgAADgASAAgAMgAwADAAMwAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9aaGFuZy8yMDAzLnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Booktitle = {Journal of the Atmospheric Sciences}, Da = {2003/05/01}, Date-Added = {2016-06-14 23:39:50 +0000}, @@ -2061,13 +2046,13 @@ @article{zhang_and_wu_2003 Url = {http://dx.doi.org/10.1175/1520-0469(2003)060<1120:CMTAPP>2.0.CO;2}, Volume = {60}, Year = {2003}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvWmhhbmcvMjAwMy5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAqjuYIMjAwMy5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFrUP9K0L8MAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAABVpoYW5nAAAQAAgAANHneLIAAAARAAgAANK0kjMAAAABABgAKo7mAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AFpoYW5nOgAyMDAzLnBkZgAADgASAAgAMgAwADAAMwAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9aaGFuZy8yMDAzLnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/1520-0469(2003)060%3C1120:CMTAPP%3E2.0.CO;2}} @article{fritsch_and_chappell_1980, Abstract = {Abstract A parameterization formulation for incorporating the effects of midlatitude deep convection into mesoscale-numerical models is presented. The formulation is based on the hypothesis that the buoyant energy available to a parcel, in combination with a prescribed period of time for the convection to remove that energy, can be used to regulate the amount of convection in a mesoscale numerical model grid element. Individual clouds are represented as entraining moist updraft and downdraft plumes. The fraction of updraft condensate evaporated in moist downdrafts is determined from an empirical relationship between the vertical shear of the horizontal wind and precipitation efficiency. Vertical transports of horizontal momentum and warming by compensating subsidence are included in the parameterization. Since updraft and downdraft areas are sometimes a substantial fraction of mesoscale model grid-element areas, grid-point temperatures (adjusted for convection) are an area-weighted mean of updraft, downdraft and environmental temperatures.}, Annote = {doi: 10.1175/1520-0469(1980)037<1722:NPOCDM>2.0.CO;2}, Author = {Fritsch, J. M. and Chappell, C. F.}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBDLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvRnJpdHNjaC8xOTgwLnBkZk8RAcoAAAAAAcoAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAARCuMwgxOTgwLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEKs103xvpgAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAHRnJpdHNjaAAAEAAIAADR53iyAAAAEQAIAADTfMQGAAAAAQAYARCuMwAobJYAKGyLAChnewAbXgcAAphcAAIAXU1hY2ludG9zaCBIRDpVc2VyczoAZ3JhbnRmOgBDbG91ZFN0YXRpb246AGZpcmxfbGlicmFyeToAZmlybF9saWJyYXJ5X2ZpbGVzOgBGcml0c2NoOgAxOTgwLnBkZgAADgASAAgAMQA5ADgAMAAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9Gcml0c2NoLzE5ODAucGRmABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGoAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOA==}, Booktitle = {Journal of the Atmospheric Sciences}, Da = {1980/08/01}, Date = {1980/08/01}, @@ -2088,12 +2073,12 @@ @article{fritsch_and_chappell_1980 Volume = {37}, Year = {1980}, Year1 = {1980}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBDLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvRnJpdHNjaC8xOTgwLnBkZk8RAcoAAAAAAcoAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAARCuMwgxOTgwLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEKs103xvpgAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAHRnJpdHNjaAAAEAAIAADR53iyAAAAEQAIAADTfMQGAAAAAQAYARCuMwAobJYAKGyLAChnewAbXgcAAphcAAIAXU1hY2ludG9zaCBIRDpVc2VyczoAZ3JhbnRmOgBDbG91ZFN0YXRpb246AGZpcmxfbGlicmFyeToAZmlybF9saWJyYXJ5X2ZpbGVzOgBGcml0c2NoOgAxOTgwLnBkZgAADgASAAgAMQA5ADgAMAAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9Gcml0c2NoLzE5ODAucGRmABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGoAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOA==}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/1520-0469(1980)037%3C1722:NPOCDM%3E2.0.CO;2}} @article{bechtold_et_al_2008, Abstract = {Advances in simulating atmospheric variability with the ECMWF model are presented that stem from revisions of the convection and diffusion parametrizations. The revisions concern in particular the introduction of a variable convective adjustment time-scale, a convective entrainment rate proportional to the environmental relative humidity, as well as free tropospheric diffusion coefficients for heat and momentum based on Monin--Obukhov functional dependencies.The forecasting system is evaluated against analyses and observations using high-resolution medium-range deterministic and ensemble forecasts, monthly and seasonal integrations, and decadal integrations with coupled atmosphere-ocean models. The results show a significantly higher and more realistic level of model activity in terms of the amplitude of tropical and extratropical mesoscale, synoptic and planetary perturbations. Importantly, with the higher variability and reduced bias not only the probabilistic scores are improved, but also the midlatitude deterministic scores in the short and medium ranges. Furthermore, for the first time the model is able to represent a realistic spectrum of convectively coupled equatorial Kelvin and Rossby waves, and maintains a realistic amplitude of the Madden--Julian oscillation (MJO) during monthly forecasts. However, the propagation speed of the MJO is slower than observed. The higher tropical tropospheric wave activity also results in better stratospheric temperatures and winds through the deposition of momentum.The partitioning between convective and resolved precipitation is unaffected by the model changes with roughly 62% of the total global precipitation being of the convective type. Finally, the changes in convection and diffusion parametrizations resulted in a larger spread of the ensemble forecasts, which allowed the amplitude of the initial perturbations in the ensemble prediction system to decrease by 30%. Copyright {\copyright} 2008 Royal Meteorological Society}, Author = {Bechtold, Peter and K{\"o}hler, Martin and Jung, Thomas and Doblas-Reyes, Francisco and Leutbecher, Martin and Rodwell, Mark J. and Vitart, Frederic and Balsamo, Gianpaolo}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBELi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQmVjaHRvbGQvMjAwOC5wZGZPEQHMAAAAAAHMAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAobfkIMjAwOC5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARZce9OEjEwAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAACEJlY2h0b2xkABAACAAA0ed4sgAAABEACAAA04TgrAAAAAEAGAAobfkAKGyWAChsiwAoZ3sAG14HAAKYXAACAF5NYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoAQmVjaHRvbGQ6ADIwMDgucGRmAA4AEgAIADIAMAAwADgALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEtVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQmVjaHRvbGQvMjAwOC5wZGYAABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGsAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOw==}, Date-Added = {2016-06-14 23:11:58 +0000}, Date-Modified = {2016-06-14 23:11:58 +0000}, Doi = {10.1002/qj.289}, @@ -2107,12 +2092,12 @@ @article{bechtold_et_al_2008 Url = {http://dx.doi.org/10.1002/qj.289}, Volume = {134}, Year = {2008}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBELi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQmVjaHRvbGQvMjAwOC5wZGZPEQHMAAAAAAHMAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAobfkIMjAwOC5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARZce9OEjEwAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAACEJlY2h0b2xkABAACAAA0ed4sgAAABEACAAA04TgrAAAAAEAGAAobfkAKGyWAChsiwAoZ3sAG14HAAKYXAACAF5NYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoAQmVjaHRvbGQ6ADIwMDgucGRmAA4AEgAIADIAMAAwADgALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEtVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQmVjaHRvbGQvMjAwOC5wZGYAABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGsAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOw==}, Bdsk-Url-1 = {http://dx.doi.org/10.1002/qj.289}} @article{han_and_pan_2011, Annote = {doi: 10.1175/WAF-D-10-05038.1}, Author = {Han, Jongil and Pan, Hua-Lu}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxA/Li4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvSGFuLzIwMTEucGRmTxEBvgAAAAABvgACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAA0eckUkgrAAAAWsT5CDIwMTEucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADC1cfTGvlvAAAAAAAAAAAAAgAFAAAJIAAAAAAAAAAAAAAAAAAAAANIYW4AABAACAAA0ed4sgAAABEACAAA0xtNzwAAAAEAGABaxPkAKGyWAChsiwAoZ3sAG14HAAKYXAACAFlNYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoASGFuOgAyMDExLnBkZgAADgASAAgAMgAwADEAMQAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIARlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9IYW4vMjAxMS5wZGYAEwABLwAAFQACAA3//wAAAAgADQAaACQAZgAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIo}, Booktitle = {Weather and Forecasting}, Da = {2011/08/01}, Date = {2011/08/01}, @@ -2133,22 +2118,22 @@ @article{han_and_pan_2011 Volume = {26}, Year = {2011}, Year1 = {2011}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxA/Li4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvSGFuLzIwMTEucGRmTxEBvgAAAAABvgACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAA0eckUkgrAAAAWsT5CDIwMTEucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADC1cfTGvlvAAAAAAAAAAAAAgAFAAAJIAAAAAAAAAAAAAAAAAAAAANIYW4AABAACAAA0ed4sgAAABEACAAA0xtNzwAAAAEAGABaxPkAKGyWAChsiwAoZ3sAG14HAAKYXAACAFlNYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoASGFuOgAyMDExLnBkZgAADgASAAgAMgAwADEAMQAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIARlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9IYW4vMjAxMS5wZGYAEwABLwAAFQACAA3//wAAAAgADQAaACQAZgAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIo}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/WAF-D-10-05038.1}} @article{pan_and_wu_1995, Author = {Pan, H. -L. and W.-S. Wu}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxA/Li4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvUGFuLzE5OTUucGRmTxEBvgAAAAABvgACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAA0eckUkgrAAAAwtTNCDE5OTUucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADCtU/TGvMJAAAAAAAAAAAAAgAFAAAJIAAAAAAAAAAAAAAAAAAAAANQYW4AABAACAAA0ed4sgAAABEACAAA0xtHaQAAAAEAGADC1M0AKGyWAChsiwAoZ3sAG14HAAKYXAACAFlNYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoAUGFuOgAxOTk1LnBkZgAADgASAAgAMQA5ADkANQAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIARlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9QYW4vMTk5NS5wZGYAEwABLwAAFQACAA3//wAAAAgADQAaACQAZgAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIo}, Date-Added = {2016-06-14 23:06:41 +0000}, Date-Modified = {2016-06-14 23:06:41 +0000}, Journal = {NMC Office Note, No. 409}, Pages = {40pp}, Title = {Implementing a Mass Flux Convection Parameterization Package for the NMC Medium-Range Forecast Model}, - Year = {1995}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxA/Li4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvUGFuLzE5OTUucGRmTxEBvgAAAAABvgACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAA0eckUkgrAAAAwtTNCDE5OTUucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADCtU/TGvMJAAAAAAAAAAAAAgAFAAAJIAAAAAAAAAAAAAAAAAAAAANQYW4AABAACAAA0ed4sgAAABEACAAA0xtHaQAAAAEAGADC1M0AKGyWAChsiwAoZ3sAG14HAAKYXAACAFlNYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoAUGFuOgAxOTk1LnBkZgAADgASAAgAMQA5ADkANQAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIARlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9QYW4vMTk5NS5wZGYAEwABLwAAFQACAA3//wAAAAgADQAaACQAZgAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIo}} + Year = {1995}} @article{grell_1993, Annote = {doi: 10.1175/1520-0493(1993)121<0764:PEOAUB>2.0.CO;2}, Author = {Grell, Georg A.}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvR3JlbGwvMTk5My5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAoie0IMTk5My5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMK4dtMa9LMAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAABUdyZWxsAAAQAAgAANHneLIAAAARAAgAANMbSRMAAAABABgAKIntAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AEdyZWxsOgAxOTkzLnBkZgAADgASAAgAMQA5ADkAMwAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9HcmVsbC8xOTkzLnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Booktitle = {Monthly Weather Review}, Da = {1993/03/01}, Date = {1993/03/01}, @@ -2169,11 +2154,11 @@ @article{grell_1993 Volume = {121}, Year = {1993}, Year1 = {1993}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvR3JlbGwvMTk5My5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAoie0IMTk5My5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMK4dtMa9LMAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAABUdyZWxsAAAQAAgAANHneLIAAAARAAgAANMbSRMAAAABABgAKIntAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AEdyZWxsOgAxOTkzLnBkZgAADgASAAgAMQA5ADkAMwAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9HcmVsbC8xOTkzLnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/1520-0493(1993)121%3C0764:PEOAUB%3E2.0.CO;2}} @article{arakawa_and_schubert_1974, Author = {Arakawa, A and Schubert, WH}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBDLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQXJha2F3YS8xOTc0LnBkZk8RAcoAAAAAAcoAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAAChtVQgxOTc0LnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKG1ctM8h9AAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAHQXJha2F3YQAAEAAIAADR53iyAAAAEQAIAAC0z4RkAAAAAQAYAChtVQAobJYAKGyLAChnewAbXgcAAphcAAIAXU1hY2ludG9zaCBIRDpVc2VyczoAZ3JhbnRmOgBDbG91ZFN0YXRpb246AGZpcmxfbGlicmFyeToAZmlybF9saWJyYXJ5X2ZpbGVzOgBBcmFrYXdhOgAxOTc0LnBkZgAADgASAAgAMQA5ADcANAAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9BcmFrYXdhLzE5NzQucGRmABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGoAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOA==}, Date-Added = {2016-06-14 23:04:30 +0000}, Date-Modified = {2018-07-18 19:00:17 +0000}, Isi = {A1974S778800004}, @@ -2186,7 +2171,6 @@ @article{arakawa_and_schubert_1974 Title = {Interaction of a cumulus cloud ensemble with the large-scale environment, Part I}, Volume = {31}, Year = {1974}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBDLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQXJha2F3YS8xOTc0LnBkZk8RAcoAAAAAAcoAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAAChtVQgxOTc0LnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKG1ctM8h9AAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAHQXJha2F3YQAAEAAIAADR53iyAAAAEQAIAAC0z4RkAAAAAQAYAChtVQAobJYAKGyLAChnewAbXgcAAphcAAIAXU1hY2ludG9zaCBIRDpVc2VyczoAZ3JhbnRmOgBDbG91ZFN0YXRpb246AGZpcmxfbGlicmFyeToAZmlybF9saWJyYXJ5X2ZpbGVzOgBBcmFrYXdhOgAxOTc0LnBkZgAADgASAAgAMQA5ADcANAAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9BcmFrYXdhLzE5NzQucGRmABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGoAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOA==}, Bdsk-Url-1 = {http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/A1974S778800004}} @article{harshvardhan_et_al_1989, @@ -2420,6 +2404,7 @@ @article{akmaev_1991 @article{siebesma_et_al_2007, Abstract = {A better conceptual understanding and more realistic parameterizations of convective boundary layers in climate and weather prediction models have been major challenges in meteorological research. In particular, parameterizations of the dry convective boundary layer, in spite of the absence of water phase-changes and its consequent simplicity as compared to moist convection, typically suffer from problems in attempting to represent realistically the boundary layer growth and what is often referred to as countergradient fluxes. The eddy-diffusivity (ED) approach has been relatively successful in representing some characteristics of neutral boundary layers and surface layers in general. The mass-flux (MF) approach, on the other hand, has been used for the parameterization of shallow and deep moist convection. In this paper, a new approach that relies on a combination of the ED and MF parameterizations (EDMF) is proposed for the dry convective boundary layer. It is shown that the EDMF approach follows naturally from a decomposition of the turbulent fluxes into 1) a part that includes strong organized updrafts, and 2) a remaining turbulent field. At the basis of the EDMF approach is the concept that nonlocal subgrid transport due to the strong updrafts is taken into account by the MF approach, while the remaining transport is taken into account by an ED closure. Large-eddy simulation (LES) results of the dry convective boundary layer are used to support the theoretical framework of this new approach and to determine the parameters of the EDMF model. The performance of the new formulation is evaluated against LES results, and it is shown that the EDMF closure is able to reproduce the main properties of dry convective boundary layers in a realistic manner. Furthermore, it will be shown that this approach has strong advantages over the more traditional countergradient approach, especially in the entrainment layer. As a result, this EDMF approach opens the way to parameterize the clear and cumulus-topped boundary layer in a simple and unified way.}, Author = {Siebesma, A. Pier and Soares, Pedro M. M. and Teixeira, Joao}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBELi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvU2llYmVzbWEvMjAwNy5wZGZPEQHMAAAAAAHMAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAqYEwIMjAwNy5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACphyMc7+4hQREYgQ0FSTwACAAUAAAkgAAAAAAAAAAAAAAAAAAAACFNpZWJlc21hABAACAAA0ed4sgAAABEACAAAxzxd+AAAAAEAGAAqYEwAKGyWAChsiwAoZ3sAG14HAAKYXAACAF5NYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoAU2llYmVzbWE6ADIwMDcucGRmAA4AEgAIADIAMAAwADcALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEtVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvU2llYmVzbWEvMjAwNy5wZGYAABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGsAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOw==}, Date-Added = {2016-05-20 17:17:49 +0000}, Date-Modified = {2016-05-20 17:17:49 +0000}, Doi = {DOI 10.1175/JAS3888.1}, @@ -2433,12 +2418,12 @@ @article{siebesma_et_al_2007 Title = {A combined eddy-diffusivity mass-flux approach for the convective boundary layer}, Volume = {64}, Year = {2007}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBELi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvU2llYmVzbWEvMjAwNy5wZGZPEQHMAAAAAAHMAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAqYEwIMjAwNy5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACphyMc7+4hQREYgQ0FSTwACAAUAAAkgAAAAAAAAAAAAAAAAAAAACFNpZWJlc21hABAACAAA0ed4sgAAABEACAAAxzxd+AAAAAEAGAAqYEwAKGyWAChsiwAoZ3sAG14HAAKYXAACAF5NYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoAU2llYmVzbWE6ADIwMDcucGRmAA4AEgAIADIAMAAwADcALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEtVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvU2llYmVzbWEvMjAwNy5wZGYAABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGsAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOw==}, Bdsk-Url-1 = {http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/000245742600011}} @article{soares_et_al_2004, Abstract = {Recently, a new consistent way of parametrizing simultaneously local and non-local turbulent transport for the convective atmospheric boundary layer has been proposed and tested for the clear boundary layer. This approach assumes that in the convective boundary layer the subgrid-scale fluxes result from two different mixing scales: small eddies, that are parametrized by an eddy-diffusivity approach, and thermals, which are represented by a mass-flux contribution. Since the interaction between the cloud layer and the underlying sub-cloud layer predominantly takes place through strong updraughts, this approach offers an interesting avenue of establishing a unified description of the turbulent transport in the cumulus-topped boundary layer. This paper explores the possibility of such a new approach for the cumulus-topped boundary layer. In the sub-cloud and cloud layers, the mass-flux term represents the effect of strong updraughts. These are modelled by a simple entraining parcel, which determines the mean properties of the strong updraughts, the boundary-layer height, the lifting condensation level and cloud top. The residual smaller-scale turbulent transport is parametrized with an eddy-diffusivity approach that uses a turbulent kinetic energy closure. The new scheme is implemented and tested in the research model MesoNH. Copyright {\copyright} 2004 Royal Meteorological Society}, Author = {Soares, P. M. M. and Miranda, P. M. A. and Siebesma, A. P. and Teixeira, J.}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBCLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvU29hcmVzLzIwMDQucGRmTxEBxgAAAAABxgACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAA0eckUkgrAAAAWIC2CDIwMDQucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYf6DSsqNwAAAAAAAAAAAAAgAFAAAJIAAAAAAAAAAAAAAAAAAAAAZTb2FyZXMAEAAIAADR53iyAAAAEQAIAADSswXgAAAAAQAYAFiAtgAobJYAKGyLAChnewAbXgcAAphcAAIAXE1hY2ludG9zaCBIRDpVc2VyczoAZ3JhbnRmOgBDbG91ZFN0YXRpb246AGZpcmxfbGlicmFyeToAZmlybF9saWJyYXJ5X2ZpbGVzOgBTb2FyZXM6ADIwMDQucGRmAA4AEgAIADIAMAAwADQALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAElVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvU29hcmVzLzIwMDQucGRmAAATAAEvAAAVAAIADf//AAAACAANABoAJABpAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjM=}, Date-Added = {2016-05-20 17:17:49 +0000}, Date-Modified = {2016-05-20 17:17:49 +0000}, Doi = {10.1256/qj.03.223}, @@ -2452,11 +2437,11 @@ @article{soares_et_al_2004 Url = {http://dx.doi.org/10.1256/qj.03.223}, Volume = {130}, Year = {2004}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBCLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvU29hcmVzLzIwMDQucGRmTxEBxgAAAAABxgACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAA0eckUkgrAAAAWIC2CDIwMDQucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYf6DSsqNwAAAAAAAAAAAAAgAFAAAJIAAAAAAAAAAAAAAAAAAAAAZTb2FyZXMAEAAIAADR53iyAAAAEQAIAADSswXgAAAAAQAYAFiAtgAobJYAKGyLAChnewAbXgcAAphcAAIAXE1hY2ludG9zaCBIRDpVc2VyczoAZ3JhbnRmOgBDbG91ZFN0YXRpb246AGZpcmxfbGlicmFyeToAZmlybF9saWJyYXJ5X2ZpbGVzOgBTb2FyZXM6ADIwMDQucGRmAA4AEgAIADIAMAAwADQALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAElVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvU29hcmVzLzIwMDQucGRmAAATAAEvAAAVAAIADf//AAAACAANABoAJABpAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjM=}, Bdsk-Url-1 = {http://dx.doi.org/10.1256/qj.03.223}} @article{troen_and_mahrt_1986, Author = {Troen, IB and Mahrt, L.}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvVHJvZW4vMTk4Ni5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAABNeegIMTk4Ni5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE13kNKUWwUAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAABVRyb2VuAAAQAAgAANHneLIAAAARAAgAANKUvXUAAAABABgATXnoAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AFRyb2VuOgAxOTg2LnBkZgAADgASAAgAMQA5ADgANgAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9Ucm9lbi8xOTg2LnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Date-Added = {2016-05-20 17:17:49 +0000}, Date-Modified = {2016-05-20 17:17:49 +0000}, Doi = {10.1007/BF00122760}, @@ -2470,13 +2455,13 @@ @article{troen_and_mahrt_1986 Url = {http://dx.doi.org/10.1007/BF00122760}, Volume = {37}, Year = {1986}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvVHJvZW4vMTk4Ni5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAABNeegIMTk4Ni5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE13kNKUWwUAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAABVRyb2VuAAAQAAgAANHneLIAAAARAAgAANKUvXUAAAABABgATXnoAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AFRyb2VuOgAxOTg2LnBkZgAADgASAAgAMQA5ADgANgAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9Ucm9lbi8xOTg2LnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Bdsk-Url-1 = {http://dx.doi.org/10.1007/BF00122760}} @article{macvean_and_mason_1990, Abstract = {Abstract In a recent paper, Kuo and Schubert demonstrated the lack of observational support for the relevance of the criterion for cloud-top entrainment instability proposed by Randall and by Deardorff. Here we derive a new criterion, based on a model of the instability as resulting from the energy released close to cloud top, by Mixing between saturated boundary-layer air and unsaturated air from above the capping inversion. The condition is derived by considering the net conversion from potential to kinetic energy in a system consisting of two layers of fluid straddling cloud-top, when a small amount of mixing occurs between these layers. This contrasts with previous analyses, which only considered the change in buoyancy of the cloud layer when unsaturated air is mixed into it. In its most general form, this new criterion depends on the ratio of the depths of the layers involved in the mixing. It is argued that, for a self-sustaining instability, there must be a net release of kinetic energy on the same depth and time scales as the entrainment process itself. There are two plausible ways in which this requirement may be satisfied. Either one takes the depths of the layers involved in the mixing to each be comparable to the vertical scale of the entrainment process, which is typically of order tens of meters or less, or alternatively, one must allow for the efficiency with which energy released by mixing through a much deeper lower layer becomes available to initiate further entrainment. In both cases the same criterion for instability results. This criterion is much more restrictive than that proposed by Randall and by Deardorff; furthermore, the observational data is then consistent with the predictions of the current theory. Further analysis provides estimates of the turbulent fluxes associated with cloud-top entrainment instability. This analysis effectively constitutes an energetically consistent turbulence closure for models of boundary layers with cloud. The implications for such numerical models are discussed. Comparisons are also made with other possible criteria for cloud-top entrainment instability which have recently been suggested.}, Annote = {doi: 10.1175/1520-0469(1990)047<1012:CTEITS>2.0.CO;2}, Author = {MacVean, M. K. and Mason, P. J.}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBDLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvTWFjVmVhbi8xOTkwLnBkZk8RAcoAAAAAAcoAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAAFx8zwgxOTkwLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXHyn0rkkRQAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAHTWFjVmVhbgAAEAAIAADR53iyAAAAEQAIAADSuYa1AAAAAQAYAFx8zwAobJYAKGyLAChnewAbXgcAAphcAAIAXU1hY2ludG9zaCBIRDpVc2VyczoAZ3JhbnRmOgBDbG91ZFN0YXRpb246AGZpcmxfbGlicmFyeToAZmlybF9saWJyYXJ5X2ZpbGVzOgBNYWNWZWFuOgAxOTkwLnBkZgAADgASAAgAMQA5ADkAMAAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9NYWNWZWFuLzE5OTAucGRmABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGoAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOA==}, Booktitle = {Journal of the Atmospheric Sciences}, Da = {1990/04/01}, Date-Added = {2016-05-20 17:16:05 +0000}, @@ -2495,11 +2480,11 @@ @article{macvean_and_mason_1990 Url = {http://dx.doi.org/10.1175/1520-0469(1990)047<1012:CTEITS>2.0.CO;2}, Volume = {47}, Year = {1990}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBDLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvTWFjVmVhbi8xOTkwLnBkZk8RAcoAAAAAAcoAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAAFx8zwgxOTkwLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXHyn0rkkRQAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAHTWFjVmVhbgAAEAAIAADR53iyAAAAEQAIAADSuYa1AAAAAQAYAFx8zwAobJYAKGyLAChnewAbXgcAAphcAAIAXU1hY2ludG9zaCBIRDpVc2VyczoAZ3JhbnRmOgBDbG91ZFN0YXRpb246AGZpcmxfbGlicmFyeToAZmlybF9saWJyYXJ5X2ZpbGVzOgBNYWNWZWFuOgAxOTkwLnBkZgAADgASAAgAMQA5ADkAMAAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9NYWNWZWFuLzE5OTAucGRmABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGoAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOA==}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/1520-0469(1990)047%3C1012:CTEITS%3E2.0.CO;2}} @article{louis_1979, Author = {Louis, JF}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvTG91aXMvMTk3OS5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAonogIMTk3OS5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACiej8FuU4pQREYgQ0FSTwACAAUAAAkgAAAAAAAAAAAAAAAAAAAABUxvdWlzAAAQAAgAANHneLIAAAARAAgAAMFutfoAAAABABgAKJ6IAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AExvdWlzOgAxOTc5LnBkZgAADgASAAgAMQA5ADcAOQAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9Mb3Vpcy8xOTc5LnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Date-Added = {2016-05-20 17:15:52 +0000}, Date-Modified = {2016-05-20 17:15:52 +0000}, Isi = {A1979HT69700004}, @@ -2512,12 +2497,12 @@ @article{louis_1979 Title = {A PARAMETRIC MODEL OF VERTICAL EDDY FLUXES IN THE ATMOSPHERE}, Volume = {17}, Year = {1979}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvTG91aXMvMTk3OS5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAonogIMTk3OS5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACiej8FuU4pQREYgQ0FSTwACAAUAAAkgAAAAAAAAAAAAAAAAAAAABUxvdWlzAAAQAAgAANHneLIAAAARAAgAAMFutfoAAAABABgAKJ6IAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AExvdWlzOgAxOTc5LnBkZgAADgASAAgAMQA5ADcAOQAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9Mb3Vpcy8xOTc5LnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Bdsk-Url-1 = {http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/A1979HT69700004}} @article{lock_et_al_2000, Abstract = {A new boundary layer turbulent mixing scheme has been developed for use in the UKMO weather forecasting and climate prediction models. This includes a representation of nonlocal mixing (driven by both surface fluxes and cloud-top processes) in unstable layers, either coupled to or decoupled from the surface, and an explicit entrainment parameterization. The scheme is formulated in moist conserved variables so that it can treat both dry and cloudy layers. Details of the scheme and examples of its performance in single-column model tests are presented.}, Author = {Lock, AP and Brown, AR and Bush, MR and Martin, GM and Smith, RNB}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBALi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvTG9jay8yMDAwLnBkZk8RAcAAAAAAAcAAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAACibewgyMDAwLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKJuLywPrPAAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAETG9jawAQAAgAANHneLIAAAARAAgAAMsETawAAAABABgAKJt7AChslgAobIsAKGd7ABteBwACmFwAAgBaTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AExvY2s6ADIwMDAucGRmAA4AEgAIADIAMAAwADAALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEdVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvTG9jay8yMDAwLnBkZgAAEwABLwAAFQACAA3//wAAAAgADQAaACQAZwAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIr}, Date-Added = {2016-05-20 17:15:36 +0000}, Date-Modified = {2016-05-20 17:15:36 +0000}, Isi = {000089461100008}, @@ -2530,13 +2515,13 @@ @article{lock_et_al_2000 Title = {A new boundary layer mixing scheme. {P}art {I}: Scheme description and single-column model tests}, Volume = {128}, Year = {2000}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBALi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvTG9jay8yMDAwLnBkZk8RAcAAAAAAAcAAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAACibewgyMDAwLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKJuLywPrPAAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAETG9jawAQAAgAANHneLIAAAARAAgAAMsETawAAAABABgAKJt7AChslgAobIsAKGd7ABteBwACmFwAAgBaTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AExvY2s6ADIwMDAucGRmAA4AEgAIADIAMAAwADAALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEdVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvTG9jay8yMDAwLnBkZgAAEwABLwAAFQACAA3//wAAAAgADQAaACQAZwAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIr}, Bdsk-Url-1 = {http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/000089461100008}} @article{hong_and_pan_1996, Abstract = {Abstract In this paper, the incorporation of a simple atmospheric boundary layer diffusion scheme into the NCEP Medium-Range Forecast Model is described. A boundary layer diffusion package based on the Troen and Mahrt nonlocal diffusion concept has been tested for possible operational implementation. The results from this approach are compared with those from the local diffusion approach, which is the current operational scheme, and verified against FIFE observations during 9?10 August 1987. The comparisons between local and nonlocal approaches are extended to the forecast for a heavy rain case of 15?17 May 1995. The sensitivity of both the boundary layer development and the precipitation forecast to the tuning parameters in the nonlocal diffusion scheme is also investigated. Special attention is given to the interaction of boundary layer processes with precipitation physics. Some results of parallel runs during August 1995 are also presented.}, Annote = {doi: 10.1175/1520-0493(1996)124<2322:NBLVDI>2.0.CO;2}, Author = {Hong, Song-You and Pan, Hua-Lu}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBALi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvSG9uZy8xOTk2LnBkZk8RAcAAAAAAAcAAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAAE18FggxOTk2LnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATXvY0pRb8QAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAESG9uZwAQAAgAANHneLIAAAARAAgAANKUvmEAAAABABgATXwWAChslgAobIsAKGd7ABteBwACmFwAAgBaTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AEhvbmc6ADE5OTYucGRmAA4AEgAIADEAOQA5ADYALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEdVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvSG9uZy8xOTk2LnBkZgAAEwABLwAAFQACAA3//wAAAAgADQAaACQAZwAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIr}, Booktitle = {Monthly Weather Review}, Da = {1996/10/01}, Date = {1996/10/01}, @@ -2557,13 +2542,13 @@ @article{hong_and_pan_1996 Volume = {124}, Year = {1996}, Year1 = {1996}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBALi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvSG9uZy8xOTk2LnBkZk8RAcAAAAAAAcAAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAAE18FggxOTk2LnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATXvY0pRb8QAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAESG9uZwAQAAgAANHneLIAAAARAAgAANKUvmEAAAABABgATXwWAChslgAobIsAKGd7ABteBwACmFwAAgBaTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AEhvbmc6ADE5OTYucGRmAA4AEgAIADEAOQA5ADYALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEdVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvSG9uZy8xOTk2LnBkZgAAEwABLwAAFQACAA3//wAAAAgADQAaACQAZwAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIr}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/1520-0493(1996)124%3C2322:NBLVDI%3E2.0.CO;2}} @article{han_and_pan_2006, Abstract = {Abstract A parameterization of the convection-induced pressure gradient force (PGF) in convective momentum transport (CMT) is tested for hurricane intensity forecasting using NCEP's operational Global Forecast System (GFS) and its nested Regional Spectral Model (RSM). In the parameterization the PGF is assumed to be proportional to the product of the cloud mass flux and vertical wind shear. Compared to control forecasts using the present operational GFS and RSM where the PGF effect in CMT is taken into account empirically, the new PGF parameterization helps increase hurricane intensity by reducing the vertical momentum exchange, giving rise to a closer comparison to the observations. In addition, the new PGF parameterization forecasts not only show more realistically organized precipitation patterns with enhanced hurricane intensity but also reduce the forecast track error. Nevertheless, the model forecasts with the new PGF parameterization still largely underpredict the observed intensity. One of the many possible reasons for the large underprediction may be the absence of hurricane initialization in the models.}, Annote = {doi: 10.1175/MWR3090.1}, Author = {Han, Jongil and Pan, Hua-Lu}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxA/Li4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvSGFuLzIwMDYucGRmTxEBvgAAAAABvgACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAA0eckUkgrAAAAWsT5CDIwMDYucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABazFjStCvVAAAAAAAAAAAAAgAFAAAJIAAAAAAAAAAAAAAAAAAAAANIYW4AABAACAAA0ed4sgAAABEACAAA0rSORQAAAAEAGABaxPkAKGyWAChsiwAoZ3sAG14HAAKYXAACAFlNYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoASGFuOgAyMDA2LnBkZgAADgASAAgAMgAwADAANgAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIARlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9IYW4vMjAwNi5wZGYAEwABLwAAFQACAA3//wAAAAgADQAaACQAZgAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIo}, Booktitle = {Monthly Weather Review}, Da = {2006/02/01}, Date-Added = {2016-05-20 17:11:17 +0000}, @@ -2582,11 +2567,11 @@ @article{han_and_pan_2006 Url = {http://dx.doi.org/10.1175/MWR3090.1}, Volume = {134}, Year = {2006}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxA/Li4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvSGFuLzIwMDYucGRmTxEBvgAAAAABvgACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAA0eckUkgrAAAAWsT5CDIwMDYucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABazFjStCvVAAAAAAAAAAAAAgAFAAAJIAAAAAAAAAAAAAAAAAAAAANIYW4AABAACAAA0ed4sgAAABEACAAA0rSORQAAAAEAGABaxPkAKGyWAChsiwAoZ3sAG14HAAKYXAACAFlNYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoASGFuOgAyMDA2LnBkZgAADgASAAgAMgAwADAANgAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIARlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9IYW4vMjAwNi5wZGYAEwABLwAAFQACAA3//wAAAAgADQAaACQAZgAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIo}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/MWR3090.1}} @article{businger_et_al_1971, Author = {Businger, JA and Wyngaard, JC and Izumi, Y and Bradley, EF}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBELi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQnVzaW5nZXIvMTk3MS5wZGZPEQHMAAAAAAHMAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAodUUIMTk3MS5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACh1cbTPIxwAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAACEJ1c2luZ2VyABAACAAA0ed4sgAAABEACAAAtM+FjAAAAAEAGAAodUUAKGyWAChsiwAoZ3sAG14HAAKYXAACAF5NYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoAQnVzaW5nZXI6ADE5NzEucGRmAA4AEgAIADEAOQA3ADEALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEtVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQnVzaW5nZXIvMTk3MS5wZGYAABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGsAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOw==}, Date-Added = {2016-05-20 17:10:50 +0000}, Date-Modified = {2018-07-18 18:58:08 +0000}, Isi = {A1971I822800004}, @@ -2599,7 +2584,6 @@ @article{businger_et_al_1971 Title = {Flux-profile relationships in the atmospheric surface layer}, Volume = {28}, Year = {1971}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBELi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQnVzaW5nZXIvMTk3MS5wZGZPEQHMAAAAAAHMAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAodUUIMTk3MS5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACh1cbTPIxwAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAACEJ1c2luZ2VyABAACAAA0ed4sgAAABEACAAAtM+FjAAAAAEAGAAodUUAKGyWAChsiwAoZ3sAG14HAAKYXAACAF5NYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoAQnVzaW5nZXI6ADE5NzEucGRmAA4AEgAIADEAOQA3ADEALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEtVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQnVzaW5nZXIvMTk3MS5wZGYAABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGsAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOw==}, Bdsk-Url-1 = {http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/A1971I822800004}} @article{xu_and_randall_1996, @@ -2790,17 +2774,18 @@ @article{kim_and_arakawa_1995 @techreport{hou_et_al_2002, Author = {Y. Hou and S. Moorthi and K. Campana}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxAiLi4vLi4vemhhbmctbGliL2hvdV9ldF9hbF8yMDAyLnBkZk8RAdwAAAAAAdwAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAAM/T1mZIKwAAAFKkjRJob3VfZXRfYWxfMjAwMi5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUqai02OGCgAAAAAAAAAAAAIAAgAACSAAAAAAAAAAAAAAAAAAAAAJemhhbmctbGliAAAQAAgAAM/UKsYAAAARAAgAANNj2moAAAABABgAUqSNAE1lSgAj19QACTbFAAk2xAACZvkAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBtYW56aGFuZzoARG9jdW1lbnRzOgBNYW4uWmhhbmc6AGdtdGItZG9jOgB6aGFuZy1saWI6AGhvdV9ldF9hbF8yMDAyLnBkZgAADgAmABIAaABvAHUAXwBlAHQAXwBhAGwAXwAyADAAMAAyAC4AcABkAGYADwAaAAwATQBhAGMAaQBuAHQAbwBzAGgAIABIAEQAEgBIVXNlcnMvbWFuemhhbmcvRG9jdW1lbnRzL01hbi5aaGFuZy9nbXRiLWRvYy96aGFuZy1saWIvaG91X2V0X2FsXzIwMDIucGRmABMAAS8AABUAAgAP//8AAAAIAA0AGgAkAEkAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACKQ==}, Date-Added = {2016-05-19 19:52:22 +0000}, Date-Modified = {2016-05-20 15:14:59 +0000}, Institution = {NCEP}, Number = {441}, Title = {Parameterization of Solar Radiation Transfer}, Type = {office note}, - Year = {2002}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxAiLi4vLi4vemhhbmctbGliL2hvdV9ldF9hbF8yMDAyLnBkZk8RAdwAAAAAAdwAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAAM/T1mZIKwAAAFKkjRJob3VfZXRfYWxfMjAwMi5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUqai02OGCgAAAAAAAAAAAAIAAgAACSAAAAAAAAAAAAAAAAAAAAAJemhhbmctbGliAAAQAAgAAM/UKsYAAAARAAgAANNj2moAAAABABgAUqSNAE1lSgAj19QACTbFAAk2xAACZvkAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBtYW56aGFuZzoARG9jdW1lbnRzOgBNYW4uWmhhbmc6AGdtdGItZG9jOgB6aGFuZy1saWI6AGhvdV9ldF9hbF8yMDAyLnBkZgAADgAmABIAaABvAHUAXwBlAHQAXwBhAGwAXwAyADAAMAAyAC4AcABkAGYADwAaAAwATQBhAGMAaQBuAHQAbwBzAGgAIABIAEQAEgBIVXNlcnMvbWFuemhhbmcvRG9jdW1lbnRzL01hbi5aaGFuZy9nbXRiLWRvYy96aGFuZy1saWIvaG91X2V0X2FsXzIwMDIucGRmABMAAS8AABUAAgAP//8AAAAIAA0AGgAkAEkAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACKQ==}} + Year = {2002}} @article{hu_and_stamnes_1993, Author = {Y.X. Hu and K. Stamnes}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxAnLi4vLi4vemhhbmctbGliL2h1X2FuZF9zdGFtbmVzXzE5OTMucGRmTxEB8AAAAAAB8AACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAAz9PWZkgrAAAAUqSNF2h1X2FuZF9zdGFtbmVzXzE5OTMucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSpJHTY3R+AAAAAAAAAAAAAgACAAAJIAAAAAAAAAAAAAAAAAAAAAl6aGFuZy1saWIAABAACAAAz9QqxgAAABEACAAA02PI3gAAAAEAGABSpI0ATWVKACPX1AAJNsUACTbEAAJm+QACAGBNYWNpbnRvc2ggSEQ6VXNlcnM6AG1hbnpoYW5nOgBEb2N1bWVudHM6AE1hbi5aaGFuZzoAZ210Yi1kb2M6AHpoYW5nLWxpYjoAaHVfYW5kX3N0YW1uZXNfMTk5My5wZGYADgAwABcAaAB1AF8AYQBuAGQAXwBzAHQAYQBtAG4AZQBzAF8AMQA5ADkAMwAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIATVVzZXJzL21hbnpoYW5nL0RvY3VtZW50cy9NYW4uWmhhbmcvZ210Yi1kb2MvemhhbmctbGliL2h1X2FuZF9zdGFtbmVzXzE5OTMucGRmAAATAAEvAAAVAAIAD///AAAACAANABoAJABOAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAkI=}, Date-Added = {2016-05-19 19:31:56 +0000}, Date-Modified = {2016-05-20 15:13:12 +0000}, Journal = {J. Climate}, @@ -2808,5 +2793,4 @@ @article{hu_and_stamnes_1993 Pages = {728-742}, Title = {An accurate parameterization of the radiative properties of water clouds suitable for use in climate models}, Volume = {6}, - Year = {1993}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxAnLi4vLi4vemhhbmctbGliL2h1X2FuZF9zdGFtbmVzXzE5OTMucGRmTxEB8AAAAAAB8AACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAAz9PWZkgrAAAAUqSNF2h1X2FuZF9zdGFtbmVzXzE5OTMucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSpJHTY3R+AAAAAAAAAAAAAgACAAAJIAAAAAAAAAAAAAAAAAAAAAl6aGFuZy1saWIAABAACAAAz9QqxgAAABEACAAA02PI3gAAAAEAGABSpI0ATWVKACPX1AAJNsUACTbEAAJm+QACAGBNYWNpbnRvc2ggSEQ6VXNlcnM6AG1hbnpoYW5nOgBEb2N1bWVudHM6AE1hbi5aaGFuZzoAZ210Yi1kb2M6AHpoYW5nLWxpYjoAaHVfYW5kX3N0YW1uZXNfMTk5My5wZGYADgAwABcAaAB1AF8AYQBuAGQAXwBzAHQAYQBtAG4AZQBzAF8AMQA5ADkAMwAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIATVVzZXJzL21hbnpoYW5nL0RvY3VtZW50cy9NYW4uWmhhbmcvZ210Yi1kb2MvemhhbmctbGliL2h1X2FuZF9zdGFtbmVzXzE5OTMucGRmAAATAAEvAAAVAAIAD///AAAACAANABoAJABOAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAkI=}} + Year = {1993}} diff --git a/physics/docs/pdftxt/CPT_CSAW.txt b/physics/docs/pdftxt/CPT_CSAW.txt index 09b81fa10..781c9937a 100644 --- a/physics/docs/pdftxt/CPT_CSAW.txt +++ b/physics/docs/pdftxt/CPT_CSAW.txt @@ -1,5 +1,5 @@ /** -\page CSAW_scheme CPT Scale-Aware Chikira-Sugiyama Scale-aware Convection Scheme with Arakawa-Wu Extension +\page CSAW_scheme Scale-Aware Chikira-Sugiyama Scale-aware Convection Scheme with Arakawa-Wu Extension \section cs_descrip Description Chikira-Sugiyama cumulus scheme (Chikira and Sugiyama (2010) \cite Chikira_2010) with prognostic closure and diff --git a/physics/docs/pdftxt/CPT_MG3.txt b/physics/docs/pdftxt/CPT_MG3.txt index 04d5d0a33..c6d169dc1 100644 --- a/physics/docs/pdftxt/CPT_MG3.txt +++ b/physics/docs/pdftxt/CPT_MG3.txt @@ -1,9 +1,8 @@ /** -\page CPT_MG3 CPT MG3 Cloud Microphysics Scheme +\page CPT_MG3 Morrison-Gettelman Cloud Microphysics Scheme \section des_MG3_cloud Description -MG3 microphysics (MP) scheme is a six-category double momentum bulk scheme. It forecasts mass of ten -hydrometeors (cloud water, cloud ice, rain, snow and graupel) and their number concentrations in addition to mass of water vapor. -Physics processes of MG3 cloud MP are described in Figure 1. +The Morrison-Gettelman Version 3 (MG3) microphysics scheme is a six-category double momentum bulk scheme. It forecasts mass +and number concentration of five hydrometeors (cloud water, cloud ice, rain, snow and graupel) in addition to mass of water vapor. # Morrison Gettelman Advancements - MG1: Morrison and Gettelman (2008) \cite Morrison_2008 (CESM1, CAM5) @@ -13,33 +12,28 @@ Physics processes of MG3 cloud MP are described in Figure 1. - MG2: Gettelman and Morrison (2015) \cite Gettelman_2015_1 \cite Gettelman_2015_2 (CESM2, CAM6) - Prognostic precipitation (rain and snow) - Sub-stepping and sub-column capable -- MG3: Gettelman et al. 2019 (accepted by JAMES) - - Rimed hydrometeors (graupel or hail) are added to stratiform cloud scheme for global models. - - Global climate impacts are limited to small increased in ice mass. - - High (14 km) resolution similations show local production of rimed ice (graupel) can affect regional precipitation amounts and intensity. +- MG3: Gettelman et al. 2019 \cite Gettelman_et_al_2019 + - Rimed hydrometeors (graupel or hail) are added to stratiform cloud scheme for global models + - Global climate impacts are limited to small increased in ice mass + - High (14 km) resolution simulations show local production of rimed ice (graupel) can affect regional +precipitation amounts and intensity A schematic of the MG3 scheme is shown in Figure 1. MG3 starts with MG2 \cite Gettelman_2015_1 \cite Gettelman_2015_2 and adds a series of processes (in red). One rimed hydrometeor category is added. Both mass and number are prognosed. Rimed ice has the -"character" of hail or graupel by pre-selecting density and fall speed paramters. +"character" of hail or graupel by pre-selecting density and fall speed parameters. \image html MG3_MP_diagram.png "Figure 1: A schematic of the MG3 scheme (Courtesy of A. Gettleman )" width=10cm - - Some unique attributes of MG3 cloud microphysics include: -# Consistent treatment of cloud fraction in cloud macrophysics and radiation -# Subgrid-scale microphysics --# Max-overlap and in-cloud precipitation fraction area +-# Maximum-overlap and in-cloud precipitation fraction area -# Options for subcolumn microphysics --# Options to run MG2 using the same code as MG3 --# Options to run MG1 --# Completely aerosol awareness with 1) 1) constant aerosol mixing ratio, 2) climatology IN/CCN from CAM5, 3) climatology aerosol from MERRA2 , 4) GOCART, and 5) MAM7 --# Options to call fast physics as GFDL microphysics --# Number concentration of all species forcasted and has local storage +-# Options for running with fewer species and processes, simulating MG1 and MG2 codes +-# Completely aerosol awareness with 1) constant aerosol mixing ratio, 2) climatology IN/CCN from CAM5 (default; \c cam5_4_143_NAAI_monclimo2.nc), 3) climatology aerosol from MERRA2 , 4) GOCART, and 5) MAM7 -# Sub-step semi-implicit sedimentation - - +-# Can be used along with the FV in-core saturation adjustment \section intra_mg3 Intraphysics Communication \ref arg_table_m_micro_run diff --git a/physics/docs/pdftxt/CPT_adv_suite.txt b/physics/docs/pdftxt/CPT_adv_suite.txt index fa9801e07..fb4fb8c0a 100644 --- a/physics/docs/pdftxt/CPT_adv_suite.txt +++ b/physics/docs/pdftxt/CPT_adv_suite.txt @@ -1,9 +1,9 @@ /** -\page suite3_page FV3_CPT_v0 +\page MGCSAW_page MGCSAW -\section CPT_suite_overview Overview +\section MGCSAW_suite_overview Overview -The advanced CPT physics suite uses the parameterizations in the following order: +The advanced MGCSAW physics suite uses the parameterizations in the following order: - \ref fast_sat_adj - \ref GFS_RRTMG - \ref GFS_SFCLYR @@ -25,11 +25,11 @@ The advanced CPT physics suite uses the parameterizations in the following order \section sdf_cpt_suite Suite Definition File -The advanced CPT physics suite uses the parameterizations in the following order, as defined in \c FV3_CPT : +The advanced MGCSAW physics suite uses the parameterizations in the following order, as defined in \c FV3_CPT : \code - + @@ -132,85 +132,89 @@ The advanced CPT physics suite uses the parameterizations in the following order \section cpt_nml_option Namelist Option \code - fhzero = 6 - h2o_phys = .true. - oz_phys = .false. - oz_phys_2015 = .true. - ldiag3d = .false. - fhcyc = 24 - use_ufo = .true. - pre_rad = .false. - crtrh = 0.95,0.95,0.90 - ncld = 2 - imp_physics = 10 - pdfcld = .false. - fhswr = 3600. - fhlwr = 3600. - ialb = 1 - iems = 1 - iaer = 111 - ico2 = 2 - isubc_sw = 2 - isubc_lw = 2 - isol = 2 - lwhtr = .true. - swhtr = .true. - cnvgwd = .true. - shal_cnv = .true. - cal_pre = .false. - redrag = .true. - dspheat = .true. - hybedmf = .true. - random_clds = .false. - trans_trac = .true. - cnvcld = .true. - imfshalcnv = 2 - imfdeepcnv = -1 - cdmbgwd = 3.5,0.25 - prslrd0 = 0. - ivegsrc = 1 - isot = 1 - debug = .false. - ras = .false. - cscnv = .true. - do_shoc = .false. - do_aw = .true. - shoc_cld = .false. - h2o_phys = .true. - shcnvcw = .false. - xkzm_h = 0.5 - xkzm_m = 0.5 - xkzm_s = 1.0 - nstf_name = 2,1,0,0 - nst_anl = .true. - psautco = 0.0008,0.0005 - prautco = 0.00015,0.00015 - microp_uniform = .false. - mg_do_ice_gmao = .true. - mg_do_liq_liu = .true. - mg_dcs = 100.00 - mg_alf = 1.2 - mg_ts_auto_ice = 500.,2000. - mg_qcvar = 0.5 - fprcp = 2 - cs_parm = 2.6,1.0,0.05e3,2.0e3,50.0,1.0,-999.,1.,0.6,0. - shoc_parm = 7000.0,1.0,4.2857143,0.7,-999.0 - iccn = .false. - aero_in = .false. - ctei_rm = 10.0,10.0 - max_lon = 8000 - max_lat = 4000 - rhcmax = 0.9999999 - effr_in = .true. - ltaerosol = .false. - lradar = .false. - cplflx = .false. - iau_delthrs = 6 - iaufhrs = 30 - iau_inc_files = '' - +&gfs_physics_nml + fhzero = 6. + ldiag3d = .true. + fhcyc = 24. + use_ufo = .true. + pre_rad = .false. + crtrh = 0.93,0.90,0.95 + ncld = 2 + imp_physics = 10 + pdfcld = .false. + fhswr = 3600. + fhlwr = 3600. + ialb = 1 + iems = 1 + IAER = 111 + ico2 = 2 + isubc_sw = 2 + isubc_lw = 2 + isol = 2 + lwhtr = .true. + swhtr = .true. + cnvgwd = .true. + shal_cnv = .true. + cal_pre = .false. + redrag = .true. + dspheat = .true. + hybedmf = .true. + satmedmf = .false. + lheatstrg = .false. + random_clds = .true. + trans_trac = .true. + cnvcld = .true. + imfshalcnv = 2 + imfdeepcnv = -1 + cdmbgwd = 3.5,0.25 + prslrd0 = 0. + ivegsrc = 1 + isot = 1 + oz_phys = .false. + oz_phys_2015 = .true. + debug = .false. + ras = .false. + cscnv = .true. + do_shoc = .false. + do_aw = .true. + shoc_cld = .false. + h2o_phys = .true. + shcnvcw = .false. + xkzm_h = 0.5 + xkzm_m = 0.5 + xkzm_s = 1.0 + nstf_name = 2,1,1,0,5 + nst_anl = .true. + ccwf = 1.0,1.0 + dlqf = 0.25,0.05 + mg_dcs = 200.0 + mg_ts_auto_ice = 180.0,900.0 + mg_qcvar = 1.0 + fprcp = 2 + pdfflag = 4 + iccn = .false. + aero_in = .false. + mg_do_graupel = .true. + mg_do_hail = .false. + do_sb_physics = .true. + mg_do_ice_gmao = .false. + mg_do_liq_liu = .true. + cs_parm = 8.0,4.0,1.0e3,3.5e3,20.0,1.0,0.0,1.0,0.6,0.0 + shoc_parm = 7000.0,1.0,2.0,0.7,-999.0 + ctei_rm = 0.60,0.23 + max_lon = 8000 + max_lat = 4000 + rhcmax = 0.9999999 + effr_in = .true. + ltaerosol = .false. + lradar = .false. + cplflx = .false. + iau_delthrs = 6 + iaufhrs = 30 + iau_inc_files = "''" +/ \endcode -- \ref gfs_physics_nml -- \ref cpt_physics_nml + + */ diff --git a/physics/docs/pdftxt/GFSv15_suite.txt b/physics/docs/pdftxt/GFSv15_suite.txt index cf7e68068..428c1c4e7 100644 --- a/physics/docs/pdftxt/GFSv15_suite.txt +++ b/physics/docs/pdftxt/GFSv15_suite.txt @@ -1,19 +1,16 @@ /** -\page suite1_page FV3_GFS_v15 +\page GFS_v15_page GFS_v15 \section gfs1_suite_overview Overview -Effective on or about Wednesday, June 12, 2019, begining with the 1200 +Effective on or about Wednesday, June 12, 2019, beginning with the 1200 Coordinated Universal Time (UTC) run, the National Centers for Environmental -Prediction (NCEP) will upgrade the Global Forecast Systems (GFS) from version 14 to 15.1. +Prediction (NCEP) will upgrade the Global Forecast Systems (GFS) from version 14 to 15. -NOAA/NWS selected the finite-volume cubed-sphere (FV3) dynamical core as the Next -Generation Global Prediction System (NGGPS). The FV3 was developed by the Geophysical -Fluid Dynamics Laboratory (GFDL) under NOAA's Office of Atmospheric Research (OAR). -The GFS version 15.1 uses the FV3 dynamical core and improved physics parameterizations. Compared -to version 14, the GFS version 15.1 uses the same physics package except for: -- Replacement of \ref GFS_ZHAOC with the more advanced \ref GFDL_cloud -- Updated paramterization of ozone photochemistry with additional production and loss terms +GFS v15 will use the Finite-Volume Cubed-Sphere (FV3) dynamical core +and a revised physics suite when compared to GFS v14. +- Replacement of the Zhao-Carr microphysics with the more advanced \ref GFDL_cloud +- Updated parameterization of ozone photochemistry with additional production and loss terms - Newly introduced parameterization of middle atmospheric water vapor photochemistry (\ref GFS_H2OPHYS) - Revised bare soil evaporation scheme - Modified convective parameterization scheme to reduce excessive cloud top cooling @@ -141,99 +138,110 @@ The GFSv15 suite uses the parameterizations in the following order, as defined i \section gfs15_nml_opt_des Namelist Option \code - fhzero = 6 - h2o_phys = .true. - oz_phys = .false. - oz_phys_2015 = .true. - ldiag3d = .false. - fhcyc = 24 - use_ufo = .true. - pre_rad = .false. - ncld = 5 - imp_physics = 11 - pdfcld = .false. - fhswr = 3600. - fhlwr = 3600. - ialb = 1 - iems = 1 - iaer = 111 - ico2 = 2 - isubc_sw = 2 - isubc_lw = 2 - isol = 2 - lwhtr = .true. - swhtr = .true. - cnvgwd = .true. - shal_cnv = .true. - cal_pre = .false. - redrag = .true. - dspheat = .true. - hybedmf = .true. - random_clds = .false. - trans_trac = .true. - cnvcld = .true. - imfshalcnv = 2 - imfdeepcnv = 2 - cdmbgwd = 3.5,0.25 - prslrd0 = 0. - ivegsrc = 1 - isot = 1 - debug = .false. - nstf_name = 2,0,0,0,0 - nst_anl = .true. - psautco = 0.0008,0.0005 - prautco = 0.00015,0.00015 -\endcode -check \ref gfs_physics_nml for description +&gfs_physics_nml + fhzero = 6. + ldiag3d = .true. + fhcyc = 24. + nst_anl = .true. + use_ufo = .true. + pre_rad = .false. + ncld = 5 + imp_physics = 11 + pdfcld = .false. + fhswr = 3600. + fhlwr = 3600. + ialb = 1 + iems = 1 + IAER = 111 + ico2 = 2 + isubc_sw = 2 + isubc_lw = 2 + isol = 2 + lwhtr = .true. + swhtr = .true. + cnvgwd = .true. + shal_cnv = .true. + cal_pre = .false. + redrag = .true. + dspheat = .true. + hybedmf = .true. + satmedmf = .false. + shinhong = .false. + do_ysu = .false. + lheatstrg = .false. + lgfdlmprad = .false. + effr_in = .false. + random_clds = .false. + trans_trac = .false. + cnvcld = .true. + imfshalcnv = 2 + imfdeepcnv = 2 + cdmbgwd = 3.5,0.25 + prslrd0 = 0. + ivegsrc = 1 + isot = 1 + debug = .false. + oz_phys = .false. + oz_phys_2015 = .true. + h2o_phys = .true. + nstf_name = 2,1,1,0,5 + xkzminv = 0.3 + xkzm_m = 1.0 + xkzm_h = 1.0 + do_sppt = .false. + do_shum = .false. + do_skeb = .false. + do_sfcperts = .false. +/ -\code - sedi_transport = .true. - do_sedi_heat = .false. - rad_snow = .true. - rad_graupel = .true. - rad_rain = .true. - const_vi = .F. - const_vs = .F. - const_vg = .F. - const_vr = .F. - vi_max = 1. - vs_max = 2. - vg_max = 12. - vr_max = 12. - qi_lim = 1. - prog_ccn = .false. - do_qa = .true. - fast_sat_adj = .true. - tau_l2v = 225. - tau_v2l = 150. - tau_g2v = 900. - rthresh = 10.e-6 - dw_land = 0.16 - dw_ocean = 0.10 - ql_gen = 1.0e-3 - ql_mlt = 1.0e-3 - qi0_crt = 8.0E-5 - qs0_crt = 1.0e-3 - tau_i2s = 1000. - c_psaci = 0.05 - c_pgacs = 0.01 - rh_inc = 0.30 - rh_inr = 0.30 - rh_ins = 0.30 - ccn_l = 300. - ccn_o = 100. - c_paut = 0.5 - c_cracw = 0.8 - use_ppm = .false. - use_ccn = .true. - mono_prof = .true. - z_slope_liq = .true. - z_slope_ice = .true. - de_ice = .false. - fix_negative = .true. - icloud_f = 1 - mp_time = 150. +&gfdl_cloud_microphysics_nml + sedi_transport = .true. + do_sedi_heat = .false. + rad_snow = .true. + rad_graupel = .true. + rad_rain = .true. + const_vi = .F. + const_vs = .F. + const_vg = .F. + const_vr = .F. + vi_max = 1. + vs_max = 2. + vg_max = 12. + vr_max = 12. + qi_lim = 1. + prog_ccn = .false. + do_qa = .false. + fast_sat_adj = .false. + tau_l2v = 225. + tau_v2l = 150. + tau_g2v = 900. + rthresh = 10.e-6 + dw_land = 0.16 + dw_ocean = 0.10 + ql_gen = 1.0e-3 + ql_mlt = 1.0e-3 + qi0_crt = 8.0E-5 + qs0_crt = 1.0e-3 + tau_i2s = 1000. + c_psaci = 0.05 + c_pgacs = 0.01 + rh_inc = 0.30 + rh_inr = 0.30 + rh_ins = 0.30 + ccn_l = 300. + ccn_o = 100. + c_paut = 0.5 + c_cracw = 0.8 + use_ppm = .false. + use_ccn = .true. + mono_prof = .true. + z_slope_liq = .true. + z_slope_ice = .true. + de_ice = .false. + fix_negative = .true. + icloud_f = 1 + mp_time = 150. +/ \endcode -check \ref gfdl_cloud_microphysics_nml for description */ diff --git a/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt b/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt index 3b0868cec..cbcf6d849 100644 --- a/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt +++ b/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt @@ -1,5 +1,5 @@ /** -\page suite2_page FV3_GFS_v15plus +\page GFS_v15plus_page GFS_v15plus \section gfs2p_suite_overview Overview @@ -128,100 +128,110 @@ The GFSv15plus suite uses the parameterizations in the following order, as defin \section gfs15p_nml_opt_des Namelist Option \code - fhzero = 6 - h2o_phys = .true. - oz_phys = .false. - oz_phys_2015 = .true. - ldiag3d = .false. - fhcyc = 24 - use_ufo = .true. - pre_rad = .false. - ncld = 5 - imp_physics = 11 - pdfcld = .false. - fhswr = 3600. - fhlwr = 3600. - ialb = 1 - iems = 1 - iaer = 111 - ico2 = 2 - isubc_sw = 2 - isubc_lw = 2 - isol = 2 - lwhtr = .true. - swhtr = .true. - cnvgwd = .true. - shal_cnv = .true. - cal_pre = .false. - redrag = .true. - dspheat = .true. - hybedmf = .false. - satmedmf = .true. - random_clds = .false. - trans_trac = .true. - cnvcld = .true. - imfshalcnv = 2 - imfdeepcnv = 2 - cdmbgwd = 3.5,0.25 - prslrd0 = 0. - ivegsrc = 1 - isot = 1 - debug = .false. - nstf_name = 2,0,0,0,0 - nst_anl = .true. - psautco = 0.0008,0.0005 - prautco = 0.00015,0.00015 -\endcode -check \ref gfs_physics_nml for description +&gfs_physics_nml + fhzero = 6. + ldiag3d = .true. + fhcyc = 24. + nst_anl = .true. + use_ufo = .true. + pre_rad = .false. + ncld = 5 + imp_physics = 11 + pdfcld = .false. + fhswr = 3600. + fhlwr = 3600. + ialb = 1 + iems = 1 + IAER = 111 + ico2 = 2 + isubc_sw = 2 + isubc_lw = 2 + isol = 2 + lwhtr = .true. + swhtr = .true. + cnvgwd = .true. + shal_cnv = .true. + cal_pre = .false. + redrag = .true. + dspheat = .true. + hybedmf = .false. + satmedmf = .true. + shinhong = .false. + do_ysu = .false. + lheatstrg = .false. + lgfdlmprad = .false. + effr_in = .false. + random_clds = .false. + trans_trac = .false. + cnvcld = .true. + imfshalcnv = 2 + imfdeepcnv = 2 + cdmbgwd = 3.5,0.25 + prslrd0 = 0. + ivegsrc = 1 + isot = 1 + debug = .false. + oz_phys = .false. + oz_phys_2015 = .true. + h2o_phys = .true. + nstf_name = 2,1,1,0,5 + xkzminv = 0.3 + xkzm_m = 1.0 + xkzm_h = 1.0 + do_sppt = .false. + do_shum = .false. + do_skeb = .false. + do_sfcperts = .false. +/ -\code - sedi_transport = .true. - do_sedi_heat = .false. - rad_snow = .true. - rad_graupel = .true. - rad_rain = .true. - const_vi = .F. - const_vs = .F. - const_vg = .F. - const_vr = .F. - vi_max = 1. - vs_max = 2. - vg_max = 12. - vr_max = 12. - qi_lim = 1. - prog_ccn = .false. - do_qa = .true. - fast_sat_adj = .true. - tau_l2v = 225. - tau_v2l = 150. - tau_g2v = 900. - rthresh = 10.e-6 - dw_land = 0.16 - dw_ocean = 0.10 - ql_gen = 1.0e-3 - ql_mlt = 1.0e-3 - qi0_crt = 8.0E-5 - qs0_crt = 1.0e-3 - tau_i2s = 1000. - c_psaci = 0.05 - c_pgacs = 0.01 - rh_inc = 0.30 - rh_inr = 0.30 - rh_ins = 0.30 - ccn_l = 300. - ccn_o = 100. - c_paut = 0.5 - c_cracw = 0.8 - use_ppm = .false. - use_ccn = .true. - mono_prof = .true. - z_slope_liq = .true. - z_slope_ice = .true. - de_ice = .false. - fix_negative = .true. - icloud_f = 1 - mp_time = 150. +&gfdl_cloud_microphysics_nml + sedi_transport = .true. + do_sedi_heat = .false. + rad_snow = .true. + rad_graupel = .true. + rad_rain = .true. + const_vi = .F. + const_vs = .F. + const_vg = .F. + const_vr = .F. + vi_max = 1. + vs_max = 2. + vg_max = 12. + vr_max = 12. + qi_lim = 1. + prog_ccn = .false. + do_qa = .false. + fast_sat_adj = .false. + tau_l2v = 225. + tau_v2l = 150. + tau_g2v = 900. + rthresh = 10.e-6 + dw_land = 0.16 + dw_ocean = 0.10 + ql_gen = 1.0e-3 + ql_mlt = 1.0e-3 + qi0_crt = 8.0E-5 + qs0_crt = 1.0e-3 + tau_i2s = 1000. + c_psaci = 0.05 + c_pgacs = 0.01 + rh_inc = 0.30 + rh_inr = 0.30 + rh_ins = 0.30 + ccn_l = 300. + ccn_o = 100. + c_paut = 0.5 + c_cracw = 0.8 + use_ppm = .false. + use_ccn = .true. + mono_prof = .true. + z_slope_liq = .true. + z_slope_ice = .true. + de_ice = .false. + fix_negative = .true. + icloud_f = 1 + mp_time = 150. +/ \endcode -check \ref gfdl_cloud_microphysics_nml for description */ diff --git a/physics/docs/pdftxt/GSD_adv_suite.txt b/physics/docs/pdftxt/GSD_adv_suite.txt index 7850c8631..3d1b79f1d 100644 --- a/physics/docs/pdftxt/GSD_adv_suite.txt +++ b/physics/docs/pdftxt/GSD_adv_suite.txt @@ -1,5 +1,5 @@ /** -\page suite4_page FV3_GSD_v0 +\page GSD_v0_page GSD_v0 \section gsd_suite_overview Overview @@ -138,72 +138,71 @@ The GSD RAP/HRRR physics suite uses the parameterizations in the following order \section gsd_nml_option Namelist Option \code - fhzero = 6 - h2o_phys = .true. - oz_phys = .false. - oz_phys_2015 = .true. - ldiag3d = .false. - fhcyc = 24 - use_ufo = .true. - pre_rad = .false. - ncld = 5 - imp_physics = 8 - ltaerosol = .true. - lradar = .false. - pdfcld = .false. - fhswr = 3600. - fhlwr = 3600. - ialb = 1 - iems = 1 - iaer = 111 - ico2 = 2 - isubc_sw = 2 - isubc_lw = 2 - isol = 2 - lwhtr = .true. - swhtr = .true. - cnvgwd = .true. - shal_cnv = .true. - cal_pre = .false. - redrag = .true. - dspheat = .true. - hybedmf = .false. - satmedmf = .false. - do_mynnedmf = .true. - do_mynnsfclay = .false. - random_clds = .false. - trans_trac = .true. - cnvcld = .true. - imfshalcnv = 3 - imfdeepcnv = 3 - force_lmfshal = .true. - lmfshal = .false. - force_lmfdeep2 = .false. - cdmbgwd = 3.5,0.25 - prslrd0 = 0. - ivegsrc = 1 - isot = 1 - debug = .false. - oz_phys = .false. - oz_phys_2015 = .true. - nstf_name = 2,0,0,0,0 - nst_anl = .true. - psautco = 0.0008,0.0005 - prautco = 0.00015,0.00015 - do_sppt = .false. - do_shum = .false. - do_skeb = .false. - do_sfcperts = .false. - lsm = 2 - lsoil_lsm = 9 - icloud_bl = 1 - bl_mynn_tkeadvect = .true. - bl_mynn_edmf = 1 - bl_mynn_edmf_mom = 1 +&gfs_physics_nml + fhzero = 6. + h2o_phys = .true. + ldiag3d = .true. + fhcyc = 0. + nst_anl = .true. + use_ufo = .true. + pre_rad = .false. + ncld = 5 + imp_physics = 8 + ltaerosol = .true. + lradar = .true. + ttendlim = -999. + make_number_concentrations = .true. + pdfcld = .false. + fhswr = 3600. + fhlwr = 3600. + ialb = 1 + iems = 1 + iaer = 111 + ico2 = 2 + isubc_sw = 2 + isubc_lw = 2 + isol = 2 + lwhtr = .true. + swhtr = .true. + cnvgwd = .true. + shal_cnv = .true. + cal_pre = .false. + redrag = .true. + dspheat = .true. + hybedmf = .false. + satmedmf = .false. + lheatstrg = .false. + do_mynnedmf = .true. + do_mynnsfclay = .false. + random_clds = .false. + trans_trac = .true. + cnvcld = .true. + imfshalcnv = 3 + imfdeepcnv = 3 + cdmbgwd = 3.5,0.25 + prslrd0 = 0. + ivegsrc = 1 + isot = 1 + debug = .false. + oz_phys = .false. + oz_phys_2015 = .true. + nstf_name = 2,1,1,0,5 + cplflx = .false. + iau_delthrs = 6 + iaufhrs = 30 + iau_inc_files = "''" + do_sppt = .false. + do_shum = .false. + do_skeb = .false. + do_sfcperts = .false. + lsm = 2 + lsoil_lsm = 9 + icloud_bl = 1 + bl_mynn_tkeadvect = .true. + bl_mynn_edmf = 1 + bl_mynn_edmf_mom = 1 +/ \endcode -Check NML option description at: -- \ref gfs_physics_nml -- \ref gsd_hrrr_nml */ diff --git a/physics/docs/pdftxt/all_shemes_list.txt b/physics/docs/pdftxt/all_shemes_list.txt index 97f5fbb22..3d57b41ea 100644 --- a/physics/docs/pdftxt/all_shemes_list.txt +++ b/physics/docs/pdftxt/all_shemes_list.txt @@ -11,18 +11,18 @@ parameterizations in suites. - Radiation: - \subpage GFS_RRTMG -- PBL and turbulence: +- PBL and Turbulence: - \subpage GFS_HEDMF - \subpage GFS_SATMEDMF - \subpage GSD_MYNNEDMF -- Land surface model: +- Land Surface Model: - \subpage GFS_NOAH - \subpage surf_pert - \subpage GSD_RUCLSM -# Cumulus parameterizations: - - GFS Simplified Arakawa Schubert (SAS) +- Cumulus Parameterizations: + - GFS Scale-Aware Arakawa Schubert (SAS) Scheme - \subpage GFS_SAMFdeep - \subpage GFS_SAMFshal - \subpage CSAW_scheme @@ -42,7 +42,6 @@ parameterizations in suites. - Ozone: - \subpage GFS_OZPHYS - - \ref GFS_ozphys - \ref GFS_ozphys_2015 - Water Vapor Photochemical Production and Loss: @@ -52,8 +51,7 @@ parameterizations in suites. - \subpage GFS_GWDPS - \subpage GFS_GWDC - -- Surface layer/Sea Ice/NSST: +- Surface Layer and Simplified Ocean and Sea Ice Representation: - \subpage GFS_SFCLYR - \subpage GFS_NSST - \subpage GFS_SFCSICE @@ -69,57 +67,37 @@ In addition to the physical schemes themselves, this scientific documentation al - \ref radcons The input information for the physics include the values of the gridbox mean prognostic variables (wind components, temperature, -specific humidity, cloud fraction, vater contents for cloud liquid, cloud ice, rain, snow, graupel, and ozone concentration), the provisional +specific humidity, cloud fraction, water contents for cloud liquid, cloud ice, rain, snow, graupel, and ozone concentration), the provisional dynamical tendencies for the same variables and various surface fields, both fixed and variable. -The time integration of the GFS physics suite is based on the following: -- The tendencies from the different physical processes are computed by the parameterizations or derived in separate interstitial routines; +The time integration of the physics suites is based on the following: +- The tendencies from the different physical processes are computed by the parameterizations or derived in separate interstitial routines - The first part of the suite, comprised of the parameterizations for radiation, surface layer, surface (land, ocean, and sea ice), boundary layer, -orographic gravity wave drag, and Rayleigh damping, is computed using a hybrid of parallel and sequential splitting (Donahue and Caldwell(2018) -\cite donahue_and_caldwell_2018), a method in which the various parameterizations use the same model state as input but feel the effect of the preceding +orographic gravity wave drag, and Rayleigh damping, is computed using a hybrid of parallel and sequential splitting described in Donahue and Caldwell(2018) +\cite donahue_and_caldwell_2018, a method in which the various parameterizations use the same model state as input but are impacted by the preceding parameterizations. The tendencies from the various parameterizations are then added together and used to update the model state. -- The second part of the physics suite, comprised of the parameterizations of ozone, stratospheric \f$H_2O\f$, deep convection, convective gravity wave drag, +- The surface parameterizations (land, ocean and sea ice) are invoked twice in a loop, with the first time to create a guess, and the second time to +produce the tendencies. +- The second part of the physics suite, comprised of the parameterizations of ozone, stratospheric water vapor, deep convection, convective gravity wave drag, shallow convection, and microphysics, is computed using sequential splitting in the order listed above, in which the model state is updated between calls to the parameterization. +- If the in-core saturation adjustment is used (\p do_sat_adj=.true.), it is invoked at shorter timesteps along with the dynamical solver. \section allsuite_overview Physics Suites -With funding from the Next Generation Global Prediction System (NGGPS) initiative and broad support from the community NCEP/EMC recently -replaced the dynamic core in its flagship operational model, the GFS. Version 15 of the GFS (GFSv15), schedule for implementation in -middle 2019, will include the Finite-volume Cubed-Sphere (FV3) non-hydrostatic dynamic core in place of the long-running spectral Gaussian -hydrostatic core. - -The next major upgrade of the GFS is expected to be in the area of model physics.Physics upgrades are particular challenging.But community -support, enhanced collaborations, and the CCPP framework are now making it feasible to accelerate advancements in operational model physics -through wholesale replacement of individual parameterizations or even entire parameterizations suites. - -Current plans call for major changes to the GFSv15 parameterization suite in anticipation of the GFSv16 implementaion, schedule for FY2021. -Several parameterizations have been identified as likely new components of the \b GFSv16 suite, including: -- The \b RRTMGP radiation parameterization, developed by Robert Pincus and colleagues, is scheduled to replace the current \ref GFS_RRTMG -- The \b Noah-MP land-surface parameterization is expected to replace the current \ref GFS_NOAH -- A unified gravity-wave-drag (\b UGWD) parameterization, developed by Valery Yudin and collaborators, will replace the separate -\ref GFS_GWDPS and \ref GFS_GWDC currently being used. -- Fresh-water lake (\b FLAKE) and multi-layer snow parameterizations will be introduced to enhance the representation of earth-atmosphere -interactions. - -In addition, new parameterizations for deep and shallow moist convection (CP), cloud microphysics (MP), and planetary boundary layer (PBLP)/ -turbulence are being considered. Unlike the parameterizations mentioned above, there are multiple viable options for parameterizing these -processes in GFSv16, including the schemes currently used in GFSv15. The "suite" approach is being taken for this subset of all model -parameterizations because the individual parameterizations within each candidate CP-MP-PBLP suite are highly interdependent. Thus, optimal -performance typically has been achieved within the candidate suites through collective tuning of individual parameterizations. Developers -have been invited to contribute their parameterizations as members of pre-tuned suites in hopes of optimizing performance in the GFS. This -approach is one way of "leveling the playing field" so that parameterizations developed outside the GFS framework are not unduly handicapped -by sub-optimal interactions with other GFS parameterizations. - - -Two suites of CP-MP-PBLP parameterizations have been identified as possible replacements for the current GFSv15 suite. \b GSD suite is -derived from the operational Rapid Refresh (RAP) and High-Resolution Rapid Refresh (HRRR) modeling system \cite Benjamin_2016 and was developed largely at NOAA/OAR/ESRL/GSD for mesoscale applications, while the second candidate, i.e., the \b CPT \b (Climate Process Team) suite, has components that were -developed at multiple ressearch centers and universities, including Colorado State, Utah, NASA, NCAR, and EMC. Its individual -parameterizations have been applied primarily to medium-range and longer prediction scales. For the GFSv15 suite, a very similar suite, but -with TKE-EDMF in repace of K-EDMF have been developed at EMC (Han et al. 2019 \cite Han_2019). - -Table 1. physics-suite options included in this documentation. + +The CCPP v3 includes the suite used in the GFS v15 implemented operationally in June 2019 (suite GFS_v15). Additionally, it includes three +developmental suites which are undergoing testing for possible future implementation in the UFS. Suite GFS_v15 plus is identical to suite +GFS_v15 except for a replacement in the PBL parameterization (Han et al. 2019 \cite Han_2019 ). Suite MGCSAW differs from GFS_v15 as it +contains different convection and microphysics schemes made available through a NOAA Climate Process Team (CPT) with components developed +at multiple research centers and universities, including Colorado State, Utah, NASA, NCAR, and EMC. Suite GSD_v0 differs from v15 as it +uses the convection, microphysics, and boundary layer schemes employed in the Rapid Refresh (RAP) and High-Resolution Rapid Refresh (HRRR \cite Benjamin_2016 ) +operational models and was assembled by NOAA/GSD. An assessment of an earlier version of these suites can be found in + the UFS portal +and in the GMTB website . + +Table 1. Physics suite options included in this documentation. \tableofcontents -| Phys suites | FV3_GFS_v15 | FV3_GFS_v15plus | FV3_CPT_v0 | FV3_GSD_v0 | +| Phys suites | GFS_v15 | GFS_v15plus | MGCSAW | GSD_v0 | |------------------|----------------------|----------------------|---------------------|----------------------| | Deep Cu | \ref GFS_SAMFdeep | \ref GFS_SAMFdeep | \ref CSAW_scheme | \ref GSD_CU_GF | | Shallow Cu | \ref GFS_SAMFshal | \ref GFS_SAMFshal | \ref GFS_SAMFshal | \ref GSD_MYNNEDMF and \ref cu_gf_sh_group | diff --git a/physics/docs/pdftxt/suite_input.nml.txt b/physics/docs/pdftxt/suite_input.nml.txt index e88051aaa..0444044cf 100644 --- a/physics/docs/pdftxt/suite_input.nml.txt +++ b/physics/docs/pdftxt/suite_input.nml.txt @@ -1,10 +1,22 @@ /** -\page GFSsuite_nml Namelist Option Description +\page GFSsuite_nml Namelist Options Description -\section gfs_physics_nml GFS Physics Parameters -The namelist variable description is provided in host-model side: GFS_typedefs.F90 +At runtime, the SCM and the UFS Atmosphere access runtime configurations from file \c input.nml. This file contains +various namelists that control aspects of the I/O, dynamics, physics etc. Most physics-related options are grouped into +two namelists:&gfs_physics_nml and &gfdl_cloud_microphysics_nml, with additional specifications for stochastic physics in +namelists &stochy_nam and &nam_sfcperts. + +Namelist &gfdl_cloud_microphysics_nml is only relevant when the GFDL microphysics is used, and its variables are defined in +module_gfdl_cloud_microphys.F90. + +Namelist &gfs_physics_nml pertains to all of the suites used, but some of the variables are only relevant for specific +parameterizations. Its variables are defined in file GFS_typedefs.F90 in the host model. + +Namelist &stochy_nam specifies options for the use of SPPT, SKEB and SHUM, while namelist &nam_sfcperts specifies whether +and how stochastic perturbations are used in the loah Land surface model. +
NML Description
option DDT in Host Model Description Default Value
\b &gfs_physics_nml
fhzero gfs_control_type hour between clearing of diagnostic buckets 0.0 @@ -156,6 +168,8 @@ The namelist variable description is provided in host-model side: GFS_typedefs.F
redrag gfs_control_type logical flag for applying reduced drag coefficient for high wind over sea in GFS surface layer scheme .false.
dspheat gfs_control_type logical flag for using TKE dissipative heating to temperature tendency in hybrid EDMF and TKE-EDMF schemes .false.
hybedmf gfs_control_type logical flag for calling hybrid EDMF PBL scheme .false. +
satmedmf gfs_control_type logical flag for calling TKE EDMF PBL scheme .false. +
do_mynnedmf gfs_control_type flag to activate MYNN-EDMF scheme .false.
random_clds gfs_control_type logical flag for whether clouds are random .false.
trans_trac gfs_control_type logical flag for convective transport of tracers .false.
lheatstrg gfs_control_type logical flag for canopy heat storage parameterization .false. @@ -181,7 +195,7 @@ The namelist variable description is provided in host-model side: GFS_typedefs.F 1
lgfdlmprad gfs_control_type flag for GFDL mp scheme and radiation consistency .false. -
cdmbgwd(2) gfs_control_type multiplication factors for mountain blocking and orographic gravity wave drag /2.0d0,0.25d0/ +
cdmbgwd(2) gfs_control_type multiplication factors for mountain blocking and orographic gravity wave drag 2.0,0.25
prslrd0 gfs_control_type pressure level above which to apply Rayleigh damping 0.0d0
lsm gfs_control_type flag for land surface model to use \n
    @@ -216,14 +230,12 @@ The namelist variable description is provided in host-model side: GFS_typedefs.F
/0,0,1,0,5/
nst_anl gfs_control_type flag for NSSTM analysis in gcycle/sfcsub .false. -
satmedmf gfs_control_type logical flag for calling TKE EDMF PBL scheme .false.
effr_in gfs_control_type logical flag for using input cloud effective radii calculation .false.
aero_in gfs_control_type logical flag for using aerosols in Morrison-Gettelman microphysics .false.
iau_delthrs gfs_control_type incremental analysis update (IAU) time interval in hours 6
iaufhrs gfs_control_type forecast hours associated with increment files -1 -
\b CPT_v0 \b Suite \b Specific \b Parameters -
crtrh(3) gfs_control_type critical relative humidity at the surface, PBL top and at the top of the atmosphere /0.90d0,0.90d0,0.90d0/ -
ras gfs_control_type logical flag for RAS convection scheme .false. +
\b Parameters \b Specific \b to \b MGCSAW \b Suite +
crtrh(3) gfs_control_type critical relative humidity at the surface, PBL top and at the top of the atmosphere 0.90,0.90,0.90
cscnv gfs_control_type logical flag for Chikira-Sugiyama deep convection .false.
do_aw gfs_control_type flag for Arakawa-Wu scale-awere adjustment .false.
do_awdd gfs_control_type flag to enable treating convective tendencies following Arakwaw-Wu for downdrafts (2013) .false. @@ -240,19 +252,20 @@ The namelist variable description is provided in host-model side: GFS_typedefs.F
xkzm_h gfs_control_type background vertical diffusion for heat and q 1.0d0
xkzm_m gfs_control_type background vertical diffusion for momentum 1.0d0
xkzm_s gfs_control_type sigma threshold for background mom. diffusion 1.0d0 +
xkzminv gfs_control_type maximum background value of heat diffusivity in the inversion layer 0.3
microp_uniform gfs_control_type logical flag for uniform subcolumns for MG microphysics .true.
mg_do_ice_gmao gfs_control_type logical flag for turning on gmao ice autoconversion in MG microphysics .false.
mg_do_liq_liu gfs_control_type logical flag for turning on Liu liquid treatment in MG microphysics .true.
mg_dcs gfs_control_type autoconversion size threshold for cloud ice to snow in MG microphysics 200.0
mg_alf gfs_control_type tuning factor for alphas (alpha = 1 - critical relative humidity) 1.0 -
mg_ts_auto_ice(2) gfs_control_type autoconversion time scale for ice in MG microphysics /180.0,180.0/ +
mg_ts_auto_ice(2) gfs_control_type autoconversion time scale for ice in MG microphysics 180.0,180.0
mg_qcvar gfs_control_type cloud water relative variance in MG microphysics 1.0
mg_rhmini gfs_control_type relative humidity threshold parameter for nucleating ice 1.01
mg_ncnst gfs_control_type constant droplet num concentration \f$m^{-3}\f$ 100.e6
mg_ninst gfs_control_type constant ice num concentration \f$m^{-3}\f$ 0.15e6
mg_ngnst gfs_control_type constant graupel/hail num concertration \f$m^{-3}\f$ 0.10e6
mg_berg_eff_factor gfs_control_type berg efficiency factor 2.0 -
mg_qcmin(2) gfs_control_type min liquid and ice mixing ratio in MG macro clouds /1.0d-9, 1.0d-9/ +
mg_qcmin(2) gfs_control_type min liquid and ice mixing ratio in MG macro clouds 1.0d-9, 1.0d-9
mg_precip_frac_method gfs_control_type type of precipitation fraction method 'max_overlap'
fprcp gfs_control_type number of frozen precipitation species in MG microphysics \n
    @@ -262,15 +275,14 @@ The namelist variable description is provided in host-model side: GFS_typedefs.F
0
pdfflag gfs_control_type pdf flag for MG macro physics 4 -
cs_parm(10) gfs_control_type tunable parameters for Chikira-Sugiyama convection /8.0,4.0,1.0e3,3.5e3,20.0,1.0,-999.,1.,0.6,0./ +
cs_parm(10) gfs_control_type tunable parameters for Chikira-Sugiyama convection 8.0,4.0,1.0e3,3.5e3,20.0,1.0,-999.,1.,0.6,0.
iccn gfs_control_type flag for using IN and CCN forcing in MG2/3 microphysics .false.
rhcmax gfs_control_type maximum critical relative humidity 0.9999999 -
\b GSD_v0 \b Suite \b Specific \b Parameters +
\b Parameters \b Specific \b to \b GSD_v0 \b Suite
make_number_concentrations gfs_control_type flag to calculate initial number concentrations from mass concentrations if not in ICs/BCs .false.
ltaerosol gfs_control_type logical flag for using aerosol climotology in Thompson MP scheme .false.
lradar gfs_control_type logical flag for computing radar reflectivity in Thompson MP scheme .false.
ttendlim gfs_control_type temperature tendency limiter per time step in K/s, set to < 0 to deactivate -999.0 -
do_mynnedmf gfs_control_type flag to activate MYNN-EDMF scheme .false.
do_mynnsfclay gfs_control_type flag to activate MYNN-SFCLAY scheme .false.
grav_settling gfs_control_type flag to activate gravitational settling of cloud droplets as described in Nakanishi (2000) \cite nakanishi_2000 0
bl_mynn_mixlength gfs_control_type flag for different version of mixing length formulation \n @@ -337,7 +349,7 @@ The namelist variable description is provided in host-model side: GFS_typedefs.F
do_shum gfs_control_type flag for stochastic SHUM option .false.
do_skeb gfs_control_type flag for stochastic SKEB option .false.
do_sfcperts gfs_control_type flag for stochastic surface perturbations option .false. -
\b sfcperts +
\b &nam_sfcperts
nsfcpert gfs_control_type number of weights for stochastic surface perturbation 0
pertz0 gfs_control_type magnitude of perturbation of momentum roughness length -999.
pertzt gfs_control_type magnitude of perturbation of heat to momentum roughness length ratio -999. @@ -349,7 +361,7 @@ The namelist variable description is provided in host-model side: GFS_typedefs.F
sfc_tau compns_stochy_mod time scales -999.
sfc_lscale compns_stochy_mod length scales -999.
sppt_land compns_stochy_mod .false. -
\b stochy +
\b &stochy_nam
use_zmtnblck compns_stochy_mod flag for mountain blocking. .T. = do not apply perturbations below the dividing streamline that is diagnosed by the gravity wave drag, mountain blocking scheme .false.
ntrunc compns_stochy_mod spectral resolution (e.g. T126) of random patterns -999
lon_s, lat_s compns_stochy_mod number of longitude and latitude point for the Gaussian grid -999 @@ -377,7 +389,7 @@ The namelist variable description is provided in host-model side: GFS_typedefs.F
skeb_vdof compns_stochy_mod the number of degrees of freedom in the vertical for the SKEB random pattern 5
skeb_sigtop1, skeb_sigtop2 compns_stochy_mod sigma levels to taper perturbations to zeros 0.1, 0.025
skebint compns_stochy_mod 0 -
\b GFDL \b Cloud \b Microphysics \b Parameters +
\b &gfdl_cloud_microphysics_nml
sedi_transport gfdl_cloud_microphys_mod logical flag for turning on horizontal momentum transport during sedimentation .true.
do_sedi_heat gfdl_cloud_microphys_mod logical flag for turning on horizontal heat transport during sedimentation .true.
rad_snow gfdl_cloud_microphys_mod logical flag for considering snow in cloud fraction calculation .true. diff --git a/physics/micro_mg3_0.F90 b/physics/micro_mg3_0.F90 index 0157ac763..fc2d4733b 100644 --- a/physics/micro_mg3_0.F90 +++ b/physics/micro_mg3_0.F90 @@ -44,8 +44,6 @@ !! Part II: Global model solutions and Aerosol-Cloud Interactions. !! 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 !! !! NOTE: Modified to allow other microphysics packages (e.g. CARMA) to do ice !! microphysics in cooperation with the MG liquid microphysics. This is diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index f958ab5e8..1113377ba 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -408,7 +408,7 @@ MODULE module_mp_thompson !>\ingroup aathompson !! This subroutine calculates simplified cloud species equations and create !! lookup tables in Thomspson scheme. -!>\section gen_thompson_init GSD thompson_init General Algorithm +!>\section gen_thompson_init thompson_init General Algorithm !> @{ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & ids, ide, jds, jde, kds, kde, & @@ -994,7 +994,7 @@ END SUBROUTINE thompson_init !>\ingroup aathompson !!This is a wrapper routine designed to transfer values from 3D to 1D. -!!\section gen_mpgtdriver GSD Thompson mp_gt_driver General Algorithm +!!\section gen_mpgtdriver Thompson mp_gt_driver General Algorithm !> @{ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, & nwfa, nifa, nwfa2d, nifa2d, & @@ -1477,7 +1477,7 @@ END SUBROUTINE thompson_finalize !! Previously this code was based on Reisner et al (1998), but few of !! those pieces remain. A complete description is now found in !! Thompson et al. (2004, 2008)\cite Thompson_2004 \cite Thompson_2008. -!>\section gen_mp_thompson GSD mp_thompson General Algorithm +!>\section gen_mp_thompson mp_thompson General Algorithm !> @{ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & nr1d, nc1d, nwfa1d, nifa1d, t1d, p1d, w1d, dzq, & diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index e87847f95..f54cee0e5 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -194,7 +194,7 @@ end subroutine mp_thompson_init !! #endif !>\ingroup aathompson -!>\section gen_thompson_hrrr GSD Thompson MP General Algorithm +!>\section gen_thompson_hrrr Thompson MP General Algorithm !>@{ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & spechum, qc, qr, qi, qs, qg, ni, nr, & diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F index 2e2d472ac..4bf4e2251 100644 --- a/physics/satmedmfvdif.F +++ b/physics/satmedmfvdif.F @@ -83,15 +83,14 @@ end subroutine satmedmfvdif_finalize !! !!\section gen_satmedmfvdif GFS satmedmfvdif General Algorithm !! satmedmfvdif_run() computes subgrid vertical turbulence mixing -!! using scale-aware TKE-based moist eddy-diffusion mass-flux (EDMF) parameterization -!! (Han and Bretherton (2019)). -!! -# For the convective boundary layer, the scheme adopts -!! EDMF parameterization (Siebesma et al., 2007) to take -!! into account nonlocal transport by large eddies (mfpblt.f). -!! -# A new mass-flux parameterization for stratocumulus-top-induced turbulence -!! mixing has been introduced (previously, it was eddy diffusion form) -!! [mfscu.f]. -!! -# For local turbulence mixing, a TKE closure model is used. +!! using the scale-aware TKE-based moist eddy-diffusion mass-flux (EDMF) parameterization of +!! Han and Bretherton (2019) \cite Han_2019 . +!! -# The local turbulent mixing is represented by an eddy-diffusivity scheme which +!! is a function of a prognostic TKE. +!! -# For the convective boundary layer, nonlocal transport by large eddies +!! (mfpblt.f), is represented using a mass flux approach (Siebesma et al.(2007) \cite Siebesma_2007 ). +!! -# A mass-flux approach is also used to represent the stratocumulus-top-induced turbulence +!! (mfscu.f). !! \section detail_satmedmfvidf GFS satmedmfvdif Detailed Algorithm !> @{ subroutine satmedmfvdif_run(ix,im,km,ntrac,ntcw,ntiw,ntke, & @@ -520,7 +519,7 @@ subroutine satmedmfvdif_run(ix,im,km,ntrac,ntcw,ntiw,ntke, & if(.not.sfcflg(i) .or. sflux(i) <= 0.) pblflg(i)=.false. enddo ! -!> - Compute critical bulk richardson number (\f$Rb_{cr}\f$) (crb) +!> - Compute critical bulk Richardson number (\f$Rb_{cr}\f$) (crb) !! - For the unstable PBL, crb is a constant (0.25) !! - For the stable boundary layer (SBL), \f$Rb_{cr}\f$ varies !! with the surface Rossby number, \f$R_{0}\f$, as given by @@ -573,7 +572,7 @@ subroutine satmedmfvdif_run(ix,im,km,ntrac,ntcw,ntiw,ntke, & enddo enddo ! -! Find pbl height based on bulk richardson number (mrf pbl scheme) +! Find pbl height based on bulk Richardson number (mrf pbl scheme) ! and also for diagnostic purpose ! ! @@ -584,7 +583,7 @@ subroutine satmedmfvdif_run(ix,im,km,ntrac,ntcw,ntiw,ntke, & !> - Given the thermal's properties and the critical Richardson number, !! a loop is executed to find the first level above the surface (kpblx) where !! the modified Richardson number is greater than the critical Richardson -!! number, using equation 10a from Toen and Mahrt (1996) \cite troen_and_mahrt_1986 +!! number, using equation 10a from Troen and Mahrt (1996) \cite troen_and_mahrt_1986 !! (also equation 8 from Hong and Pan (1996) \cite hong_and_pan_1996): do k = 1, kmpbl do i = 1, im From 2857802aed75b1bac8202ce47fe6b28d481aa5c6 Mon Sep 17 00:00:00 2001 From: Laurie Carson Date: Thu, 6 Jun 2019 12:34:57 -0600 Subject: [PATCH 03/89] v3.0 release: Prune physics (#260) * remove special linking of interal NCEPlibs for SCM * Prune unnecessary files from physics for SCM v3.0 release --- CMakeLists.txt | 25 +- physics/GFS_phys_time_vary.fv3.F90 | 486 -- physics/GFS_rad_time_vary.fv3.F90 | 114 - physics/GFS_stochastics.F90 | 249 - physics/GFS_suite_init_finalize_test.F90 | 68 - physics/GFS_time_vary_pre.fv3.F90 | 141 - physics/cu_ntiedtke.F90 | 3840 ---------- physics/cu_ntiedtke_post.F90 | 53 - physics/cu_ntiedtke_pre.F90 | 84 - physics/gcm_shoc.F90 | 2040 ----- physics/gcycle.F90 | 245 - physics/gscond.f | 526 -- physics/module_MYNNSFC_wrapper.F90 | 362 - physics/module_sf_mynn.F90 | 2446 ------ physics/moninshoc.f | 607 -- physics/ozphys.f | 202 - physics/precpd.f | 735 -- physics/sfcsub.F | 8745 ---------------------- physics/shinhongvdif.F90 | 2106 ------ physics/ysuvdif.F90 | 1271 ---- 20 files changed, 4 insertions(+), 24341 deletions(-) delete mode 100644 physics/GFS_phys_time_vary.fv3.F90 delete mode 100644 physics/GFS_rad_time_vary.fv3.F90 delete mode 100644 physics/GFS_stochastics.F90 delete mode 100644 physics/GFS_suite_init_finalize_test.F90 delete mode 100644 physics/GFS_time_vary_pre.fv3.F90 delete mode 100644 physics/cu_ntiedtke.F90 delete mode 100644 physics/cu_ntiedtke_post.F90 delete mode 100644 physics/cu_ntiedtke_pre.F90 delete mode 100644 physics/gcm_shoc.F90 delete mode 100644 physics/gcycle.F90 delete mode 100644 physics/gscond.f delete mode 100644 physics/module_MYNNSFC_wrapper.F90 delete mode 100644 physics/module_sf_mynn.F90 delete mode 100644 physics/moninshoc.f delete mode 100644 physics/ozphys.f delete mode 100644 physics/precpd.f delete mode 100644 physics/sfcsub.F delete mode 100644 physics/shinhongvdif.F90 delete mode 100644 physics/ysuvdif.F90 diff --git a/CMakeLists.txt b/CMakeLists.txt index ff6a08455..af33fb1ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -263,19 +263,6 @@ elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "PGI") endif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU") if (PROJECT STREQUAL "CCPP-SCM") - SET(W3LIB_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../external/w3nco/v2.0.6/src) - SET(BACIOLIB_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../external/bacio/v2.0.1/src) - SET(SPLIB_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../external/sp/v2.0.2/src) - - #add "sibling" directories (must specify the build directory too) - ADD_SUBDIRECTORY(${W3LIB_SRC} ${CMAKE_BINARY_DIR}/w3nco) - ADD_SUBDIRECTORY(${BACIOLIB_SRC} ${CMAKE_BINARY_DIR}/bacio) - ADD_SUBDIRECTORY(${SPLIB_SRC} ${CMAKE_BINARY_DIR}/sp) - - INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/w3nco) - INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/sp) - INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/bacio) - INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/ccpp/framework/src) endif (PROJECT STREQUAL "CCPP-SCM") @@ -293,14 +280,10 @@ else(STATIC) add_library(ccppphys SHARED ${SCHEMES} ${SCHEMES_SFX} ${CAPS}) endif(STATIC) -if (PROJECT STREQUAL "CCPP-FV3") - # Link required NCEPlibs for dynamic builds - if (NOT STATIC) - target_link_libraries(ccppphys LINK_PUBLIC ${LIBS} ${BACIO_LIB4} ${SP_LIBd} ${W3NCO_LIBd}) - endif (NOT STATIC) -elseif (PROJECT STREQUAL "CCPP-SCM") - target_link_libraries(ccppphys LINK_PUBLIC ${LIBS} w3 sp bacio) -endif (PROJECT STREQUAL "CCPP-FV3") +if (NOT STATIC) + target_link_libraries(ccppphys LINK_PUBLIC ${LIBS} ${BACIO_LIB4} ${SP_LIBd} ${W3NCO_LIBd}) +endif (NOT STATIC) + set_target_properties(ccppphys PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 deleted file mode 100644 index b8823fac6..000000000 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ /dev/null @@ -1,486 +0,0 @@ -!> \file GFS_phys_time_vary.fv3.F90 -!! Contains code related to GFS physics suite setup (physics part of time_vary_step) - -!>\defgroup mod_GFS_phys_time_vary GFS Physics Time Update -!! This module contains GFS physics time vary subroutines including ozone, h2o, i -!! aerosol and IN&CCN updates. - module GFS_phys_time_vary - -#ifdef OPENMP - use omp_lib -#endif - - use ozne_def, only : levozp, oz_coeff, oz_lat, oz_pres, oz_time, ozplin - use ozinterp, only : read_o3data, setindxoz, ozinterpol - - use h2o_def, only : levh2o, h2o_coeff, h2o_lat, h2o_pres, h2o_time, h2oplin - use h2ointerp, only : read_h2odata, setindxh2o, h2ointerpol - - use aerclm_def, only : aerin, aer_pres, ntrcaer, ntrcaerm - use aerinterp, only : read_aerdata, setindxaer, aerinterpol - - use iccn_def, only : ciplin, ccnin, ci_pres - use iccninterp, only : read_cidata, setindxci, ciinterpol - - implicit none - - private - - public GFS_phys_time_vary_init, GFS_phys_time_vary_run, GFS_phys_time_vary_finalize - - logical :: is_initialized = .false. - - contains - -!> \section arg_table_GFS_phys_time_vary_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | Data | GFS_data_type_instance_all_blocks | Fortran DDT containing FV3-GFS data | DDT | 1 | GFS_data_type | | inout | F | -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | -!! | Interstitial | GFS_interstitial_type_instance_all_threads | Fortran DDT containing FV3-GFS interstitial data | DDT | 1 | GFS_interstitial_type | | inout | F | -!! | nthrds | omp_threads | number of OpenMP threads available for physics schemes | count | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, errflg) - - use GFS_typedefs, only: GFS_control_type, GFS_data_type, GFS_interstitial_type - - implicit none - - ! Interface variables - type(GFS_data_type), intent(inout) :: Data(:) - type(GFS_control_type), intent(inout) :: Model - type(GFS_interstitial_type), intent(inout) :: Interstitial(:) - integer, intent(in) :: nthrds - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Local variables - integer :: nb, nblks, nt - integer :: i, j, ix - logical :: non_uniform_blocks - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (is_initialized) return - - nblks = size(Model%blksz) - - ! Non-uniform blocks require special handling: instead - ! of nthrds elements of the Interstitial array, there are - ! nthrds+1 elements. The extra Interstitial(nthrds+1) is - ! allocated for the smaller block length of the last block, - ! while all other elements are allocated to the maximum - ! block length (which is the same for all blocks except - ! the last block). - if (minval(Model%blksz)==maxval(Model%blksz)) then - non_uniform_blocks = .false. - else - non_uniform_blocks = .true. - end if - - ! Consistency check - number of threads passed in via the argument list - ! has to match the size of the Interstitial data type. - if (.not. non_uniform_blocks .and. nthrds/=size(Interstitial)) then - write(errmsg,'(*(a))') 'Logic error: nthrds does not match size of Interstitial variable' - errflg = 1 - return - else if (non_uniform_blocks .and. nthrds+1/=size(Interstitial)) then - write(errmsg,'(*(a))') 'Logic error: nthrds+1 does not match size of Interstitial variable ' // & - '(including extra last element for shorter blocksizes)' - errflg = 1 - return - end if - -!$OMP parallel num_threads(nthrds) default(none) & -!$OMP private (nt,nb) & -!$OMP shared (Model,Data,Interstitial,errmsg,errflg) & -!$OMP shared (levozp,oz_coeff,oz_pres) & -!$OMP shared (levh2o,h2o_coeff,h2o_pres) & -!$OMP shared (ntrcaer,nblks,nthrds,non_uniform_blocks) - -#ifdef OPENMP - nt = omp_get_thread_num()+1 -#else - nt = 1 -#endif - -!$OMP sections - -!$OMP section - call read_o3data (Model%ntoz, Model%me, Model%master) - - ! Consistency check that the hardcoded values for levozp and - ! oz_coeff in GFS_typedefs.F90 match what is set by read_o3data - ! in GFS_typedefs.F90: allocate (Tbd%ozpl (IM,levozp,oz_coeff)) - if (size(Data(1)%Tbd%ozpl, dim=2).ne.levozp) then - write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & - "levozp from read_o3data does not match value in GFS_typedefs.F90: ", & - levozp, " /= ", size(Data(1)%Tbd%ozpl, dim=2) - errflg = 1 - end if - if (size(Data(1)%Tbd%ozpl, dim=3).ne.oz_coeff) then - write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & - "oz_coeff from read_o3data does not match value in GFS_typedefs.F90: ", & - oz_coeff, " /= ", size(Data(1)%Tbd%ozpl, dim=3) - errflg = 1 - end if - -!$OMP section - call read_h2odata (Model%h2o_phys, Model%me, Model%master) - - ! Consistency check that the hardcoded values for levh2o and - ! h2o_coeff in GFS_typedefs.F90 match what is set by read_o3data - ! in GFS_typedefs.F90: allocate (Tbd%h2opl (IM,levh2o,h2o_coeff)) - if (size(Data(1)%Tbd%h2opl, dim=2).ne.levh2o) then - write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & - "levh2o from read_h2odata does not match value in GFS_typedefs.F90: ", & - levh2o, " /= ", size(Data(1)%Tbd%h2opl, dim=2) - errflg = 1 - end if - if (size(Data(1)%Tbd%h2opl, dim=3).ne.h2o_coeff) then - write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & - "h2o_coeff from read_h2odata does not match value in GFS_typedefs.F90: ", & - h2o_coeff, " /= ", size(Data(1)%Tbd%h2opl, dim=3) - errflg = 1 - end if - -!$OMP section - if (Model%aero_in) then - ! Consistency check that the value for ntrcaerm set in GFS_typedefs.F90 - ! and used to allocate Tbd%aer_nm matches the value defined in aerclm_def - if (size(Data(1)%Tbd%aer_nm, dim=3).ne.ntrcaerm) then - write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & - "ntrcaerm from aerclm_def does not match value in GFS_typedefs.F90: ", & - ntrcaerm, " /= ", size(Data(1)%Tbd%aer_nm, dim=3) - errflg = 1 - else - ! Update the value of ntrcaer in aerclm_def with the value defined - ! in GFS_typedefs.F90 that is used to allocate the Tbd DDT. - ! If Model%aero_in is .true., then ntrcaer == ntrcaerm - ntrcaer = size(Data(1)%Tbd%aer_nm, dim=3) - ! Read aerosol climatology - call read_aerdata (Model%me,Model%master,Model%iflip,Model%idate) - endif - else - ! Update the value of ntrcaer in aerclm_def with the value defined - ! in GFS_typedefs.F90 that is used to allocate the Tbd DDT. - ! If Model%aero_in is .false., then ntrcaer == 1 - ntrcaer = size(Data(1)%Tbd%aer_nm, dim=3) - endif - -!$OMP section - if (Model%iccn) then - call read_cidata ( Model%me, Model%master) - ! No consistency check needed for in/ccn data, all values are - ! hardcoded in module iccn_def.F and GFS_typedefs.F90 - endif - -!$OMP end sections - - ! Update values of oz_pres in Interstitial data type for all threads - if (Model%ntoz > 0) then - Interstitial(nt)%oz_pres = oz_pres -!$OMP single - if (non_uniform_blocks) then - ! For non-uniform block sizes, set Interstitial(nthrds+1)%oz_pres - Interstitial(nthrds+1)%oz_pres = oz_pres - end if -!$OMP end single nowait - end if - - ! Update values of h2o_pres in Interstitial data type for all threads - if (Model%h2o_phys) then - Interstitial(nt)%h2o_pres = h2o_pres -!$OMP single - if (non_uniform_blocks) then - ! For non-uniform block sizes, set Interstitial(nthrds+1)%oz_pres - Interstitial(nthrds+1)%h2o_pres = h2o_pres - end if -!$OMP end single nowait - end if - - - !--- read in and initialize ozone - if (Model%ntoz > 0) then -!$OMP do schedule (dynamic,1) - do nb = 1, nblks - call setindxoz (Model%blksz(nb), Data(nb)%Grid%xlat_d, Data(nb)%Grid%jindx1_o3, & - Data(nb)%Grid%jindx2_o3, Data(nb)%Grid%ddy_o3) - enddo -!$OMP end do - endif - - !--- read in and initialize stratospheric water - if (Model%h2o_phys) then -!$OMP do schedule (dynamic,1) - do nb = 1, nblks - call setindxh2o (Model%blksz(nb), Data(nb)%Grid%xlat_d, Data(nb)%Grid%jindx1_h, & - Data(nb)%Grid%jindx2_h, Data(nb)%Grid%ddy_h) - enddo -!$OMP end do - endif - - !--- read in and initialize aerosols - if (Model%aero_in) then -!$OMP do schedule (dynamic,1) - do nb = 1, nblks - call setindxaer (Model%blksz(nb), Data(nb)%Grid%xlat_d, Data(nb)%Grid%jindx1_aer, & - Data(nb)%Grid%jindx2_aer, Data(nb)%Grid%ddy_aer, Data(nb)%Grid%xlon_d, & - Data(nb)%Grid%iindx1_aer, Data(nb)%Grid%iindx2_aer, Data(nb)%Grid%ddx_aer, & - Model%me, Model%master) - enddo -!$OMP end do - endif - - !--- read in and initialize IN and CCN - if (Model%iccn) then -!$OMP do schedule (dynamic,1) - do nb = 1, nblks - call setindxci (Model%blksz(nb), Data(nb)%Grid%xlat_d, Data(nb)%Grid%jindx1_ci, & - Data(nb)%Grid%jindx2_ci, Data(nb)%Grid%ddy_ci, Data(nb)%Grid%xlon_d, & - Data(nb)%Grid%iindx1_ci, Data(nb)%Grid%iindx2_ci, Data(nb)%Grid%ddx_ci) - enddo -!$OMP end do - endif - -!$OMP end parallel - - !--- initial calculation of maps local ix -> global i and j, store in Tbd - ix = 0 - nb = 1 - do j = 1,Model%ny - do i = 1,Model%nx - ix = ix + 1 - if (ix .gt. Model%blksz(nb)) then - ix = 1 - nb = nb + 1 - endif - Data(nb)%Tbd%jmap(ix) = j - Data(nb)%Tbd%imap(ix) = i - enddo - enddo - - is_initialized = .true. - - end subroutine GFS_phys_time_vary_init - - -!> \section arg_table_GFS_phys_time_vary_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine GFS_phys_time_vary_finalize(errmsg, errflg) - - implicit none - - ! Interface variables - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (.not.is_initialized) return - - ! Deallocate ozone arrays - if (allocated(oz_lat) ) deallocate(oz_lat) - if (allocated(oz_pres) ) deallocate(oz_pres) - if (allocated(oz_time) ) deallocate(oz_time) - if (allocated(ozplin) ) deallocate(ozplin) - - ! Deallocate h2o arrays - if (allocated(h2o_lat) ) deallocate(h2o_lat) - if (allocated(h2o_pres)) deallocate(h2o_pres) - if (allocated(h2o_time)) deallocate(h2o_time) - if (allocated(h2oplin) ) deallocate(h2oplin) - - ! Deallocate aerosol arrays - if (allocated(aerin) ) deallocate(aerin) - if (allocated(aer_pres)) deallocate(aer_pres) - - ! Deallocate IN and CCN arrays - if (allocated(ciplin) ) deallocate(ciplin) - if (allocated(ccnin) ) deallocate(ccnin) - if (allocated(ci_pres) ) deallocate(ci_pres) - - is_initialized = .false. - - end subroutine GFS_phys_time_vary_finalize - - -!> \section arg_table_GFS_phys_time_vary_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | Data | GFS_data_type_instance_all_blocks | Fortran DDT containing FV3-GFS data | DDT | 1 | GFS_data_type | | inout | F | -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | -!! | nthrds | omp_threads | number of OpenMP threads available for physics schemes | count | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg) - - use mersenne_twister, only: random_setseed, random_number - use machine, only: kind_phys - use GFS_typedefs, only: GFS_control_type, GFS_data_type - - implicit none - - ! Interface variables - type(GFS_data_type), intent(in) :: Data(:) - type(GFS_control_type), intent(inout) :: Model - integer, intent(in) :: nthrds - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Local variables - real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys - real(kind=kind_phys), parameter :: con_99 = 99.0_kind_phys - real(kind=kind_phys), parameter :: con_100 = 100.0_kind_phys - - integer :: i, j, k, iseed, iskip, ix, nb, nblks - real(kind=kind_phys) :: wrk(1) - real(kind=kind_phys) :: rannie(Model%cny) - real(kind=kind_phys) :: rndval(Model%cnx*Model%cny*Model%nrcm) - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - ! Check initialization status - if (.not.is_initialized) then - write(errmsg,'(*(a))') "Logic error: GFS_phys_time_vary_run called before GFS_phys_time_vary_init" - errflg = 1 - return - end if - - nblks = size(Model%blksz) - - !--- switch for saving convective clouds - cnvc90.f - !--- aka Ken Campana/Yu-Tai Hou legacy - if ((mod(Model%kdt,Model%nsswr) == 0) .and. (Model%lsswr)) then - !--- initialize,accumulate,convert - Model%clstp = 1100 + min(Model%fhswr/con_hr,Model%fhour,con_99) - elseif (mod(Model%kdt,Model%nsswr) == 0) then - !--- accumulate,convert - Model%clstp = 0100 + min(Model%fhswr/con_hr,Model%fhour,con_99) - elseif (Model%lsswr) then - !--- initialize,accumulate - Model%clstp = 1100 - else - !--- accumulate - Model%clstp = 0100 - endif - -!$OMP parallel num_threads(nthrds) default(none) & -!$OMP private (nb,iskip,ix,i,j,k) & -!$OMP shared (Model,Data,iseed,wrk,rannie,rndval) & -!$OMP shared (nblks) - - !--- random number needed for RAS and old SAS and when cal_pre=.true. - ! Model%imfdeepcnv < 0 when Model%ras = .true. - if ( (Model%imfdeepcnv <= 0 .or. Model%cal_pre) .and. Model%random_clds ) then -!$OMP single - iseed = mod(con_100*sqrt(Model%fhour*con_hr),1.0d9) + Model%seed0 - call random_setseed(iseed) - call random_number(wrk) - do i = 1,Model%cnx*Model%nrcm - iseed = iseed + nint(wrk(1)*1000.0) * i - call random_setseed(iseed) - call random_number(rannie) - rndval(1+(i-1)*Model%cny:i*Model%cny) = rannie(1:Model%cny) - enddo -!$OMP end single - - do k = 1,Model%nrcm - iskip = (k-1)*Model%cnx*Model%cny -!$OMP do schedule (dynamic,1) - do nb=1,nblks - do ix=1,Model%blksz(nb) - j = Data(nb)%Tbd%jmap(ix) - i = Data(nb)%Tbd%imap(ix) - Data(nb)%Tbd%rann(ix,k) = rndval(i+Model%isc-1 + (j+Model%jsc-2)*Model%cnx + iskip) - enddo - enddo -!$OMP end do - enddo - endif ! imfdeepcnv, cal_re, random_clds - - !--- o3 interpolation - if (Model%ntoz > 0) then -!$OMP do schedule (dynamic,1) - do nb = 1, nblks - call ozinterpol (Model%me, Model%blksz(nb), Model%idate, Model%fhour, & - Data(nb)%Grid%jindx1_o3, Data(nb)%Grid%jindx2_o3, & - Data(nb)%Tbd%ozpl, Data(nb)%Grid%ddy_o3) - enddo -!$OMP end do - endif - - !--- h2o interpolation - if (Model%h2o_phys) then -!$OMP do schedule (dynamic,1) - do nb = 1, nblks - call h2ointerpol (Model%me, Model%blksz(nb), Model%idate, Model%fhour, & - Data(nb)%Grid%jindx1_h, Data(nb)%Grid%jindx2_h, & - Data(nb)%Tbd%h2opl, Data(nb)%Grid%ddy_h) - enddo -!$OMP end do - endif - - !--- aerosol interpolation - if (Model%aero_in) then -!$OMP do schedule (dynamic,1) - do nb = 1, nblks - call aerinterpol (Model%me, Model%master, Model%blksz(nb), & - Model%idate, Model%fhour, & - Data(nb)%Grid%jindx1_aer, Data(nb)%Grid%jindx2_aer, & - Data(nb)%Grid%ddy_aer,Data(nb)%Grid%iindx1_aer, & - Data(nb)%Grid%iindx2_aer,Data(nb)%Grid%ddx_aer, & - Model%levs,Data(nb)%Statein%prsl, & - Data(nb)%Tbd%aer_nm) - enddo -!$OMP end do - endif - - !--- ICCN interpolation - if (Model%iccn) then -!$OMP do schedule (dynamic,1) - do nb = 1, nblks - call ciinterpol (Model%me, Model%blksz(nb), Model%idate, Model%fhour, & - Data(nb)%Grid%jindx1_ci, Data(nb)%Grid%jindx2_ci, & - Data(nb)%Grid%ddy_ci,Data(nb)%Grid%iindx1_ci, & - Data(nb)%Grid%iindx2_ci,Data(nb)%Grid%ddx_ci, & - Model%levs,Data(nb)%Statein%prsl, & - Data(nb)%Tbd%in_nm, Data(nb)%Tbd%ccn_nm) - enddo -!$OMP end do - endif - -!$OMP end parallel - - !--- repopulate specific time-varying sfc properties for AMIP/forecast runs - if (Model%nscyc > 0) then - if (mod(Model%kdt,Model%nscyc) == 1) THEN - call gcycle (nblks, Model, Data(:)%Grid, Data(:)%Sfcprop, Data(:)%Cldprop) - endif - endif - - !--- determine if diagnostics buckets need to be cleared - if (mod(Model%kdt,Model%nszero) == 1) then - do nb = 1,nblks - call Data(nb)%Intdiag%rad_zero (Model) - call Data(nb)%Intdiag%phys_zero (Model) - !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED - enddo - endif - - end subroutine GFS_phys_time_vary_run - - end module GFS_phys_time_vary diff --git a/physics/GFS_rad_time_vary.fv3.F90 b/physics/GFS_rad_time_vary.fv3.F90 deleted file mode 100644 index ac96e78d0..000000000 --- a/physics/GFS_rad_time_vary.fv3.F90 +++ /dev/null @@ -1,114 +0,0 @@ -!>\file GFS_rad_time_vary.F90 -!! Contains code related to GFS physics suite setup (radiation part of time_vary_step) - module GFS_rad_time_vary - - implicit none - - private - - public GFS_rad_time_vary_init, GFS_rad_time_vary_run, GFS_rad_time_vary_finalize - - contains - -!>\defgroup GFS_rad_time_vary GFS RRTMG Update -!!\ingroup RRTMG -!! @{ -!! \section arg_table_GFS_rad_time_vary_init Argument Table -!! - subroutine GFS_rad_time_vary_init - end subroutine GFS_rad_time_vary_init - -!> \section arg_table_GFS_rad_time_vary_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-------------------|--------------------------------------------------------|-------------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | -!! | Data | GFS_data_type_instance_all_blocks | Fortran DDT containing FV3-GFS data | DDT | 1 | GFS_data_type | | inout | F | -!! | nthrds | omp_threads | number of OpenMP threads available for physics schemes | count | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine GFS_rad_time_vary_run (Model, Data, nthrds, errmsg, errflg) - - use physparam, only: ipsd0, ipsdlim, iaerflg - use mersenne_twister, only: random_setseed, random_index, random_stat - use machine, only: kind_phys - use GFS_typedefs, only: GFS_control_type, & - GFS_data_type - use radcons, only: qmin, con_100 - - implicit none - - type(GFS_control_type), intent(inout) :: Model - type(GFS_data_type), intent(inout) :: Data(:) - integer, intent(in) :: nthrds - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - !--- local variables - type (random_stat) :: stat - integer :: ix, nb, j, i, nblks, ipseed - integer :: numrdm(Model%cnx*Model%cny*2) - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (Model%lsswr .or. Model%lslwr) then - - nblks = size(Model%blksz) - - !--- call to GFS_radupdate_run is now in GFS_rrtmg_setup_run - -!$OMP parallel num_threads(nthrds) default(none) & -!$OMP private (nb,ix,i,j) & -!$OMP shared (Model,Data,ipsdlim,ipsd0,ipseed) & -!$OMP shared (numrdm,stat,nblks) - - !--- set up random seed index in a reproducible way for entire cubed-sphere face (lat-lon grid) - if ((Model%isubc_lw==2) .or. (Model%isubc_sw==2)) then -!$OMP single - ipseed = mod(nint(con_100*sqrt(Model%sec)), ipsdlim) + 1 + ipsd0 - call random_setseed (ipseed, stat) - call random_index (ipsdlim, numrdm, stat) -!$OMP end single - -!$OMP do schedule (dynamic,1) - do nb=1,nblks - do ix=1,Model%blksz(nb) - j = Data(nb)%Tbd%jmap(ix) - i = Data(nb)%Tbd%imap(ix) - !--- for testing purposes, replace numrdm with '100' - Data(nb)%Tbd%icsdsw(ix) = numrdm(i+Model%isc-1 + (j+Model%jsc-2)*Model%cnx) - Data(nb)%Tbd%icsdlw(ix) = numrdm(i+Model%isc-1 + (j+Model%jsc-2)*Model%cnx + Model%cnx*Model%cny) - enddo - enddo -!$OMP end do - endif ! isubc_lw and isubc_sw - - if (Model%imp_physics == 99) then - if (Model%kdt == 1) then -!$OMP do schedule (dynamic,1) - do nb = 1,nblks - Data(nb)%Tbd%phy_f3d(:,:,1) = Data(nb)%Statein%tgrs - Data(nb)%Tbd%phy_f3d(:,:,2) = max(qmin,Data(nb)%Statein%qgrs(:,:,1)) - Data(nb)%Tbd%phy_f3d(:,:,3) = Data(nb)%Statein%tgrs - Data(nb)%Tbd%phy_f3d(:,:,4) = max(qmin,Data(nb)%Statein%qgrs(:,:,1)) - Data(nb)%Tbd%phy_f2d(:,1) = Data(nb)%Statein%prsi(:,1) - Data(nb)%Tbd%phy_f2d(:,2) = Data(nb)%Statein%prsi(:,1) - enddo -!$OMP end do - endif - endif - -!$OMP end parallel - - endif - - end subroutine GFS_rad_time_vary_run - -!> \section arg_table_GFS_rad_time_vary_finalize Argument Table -!! - subroutine GFS_rad_time_vary_finalize() - end subroutine GFS_rad_time_vary_finalize -!! @} - end module GFS_rad_time_vary diff --git a/physics/GFS_stochastics.F90 b/physics/GFS_stochastics.F90 deleted file mode 100644 index 7fa2e256b..000000000 --- a/physics/GFS_stochastics.F90 +++ /dev/null @@ -1,249 +0,0 @@ -!> \file GFS_stochastics.f90 -!! This file contains code previously in GFS_stochastics_driver. - - module GFS_stochastics - - contains - - subroutine GFS_stochastics_init () - end subroutine GFS_stochastics_init - - subroutine GFS_stochastics_finalize() - end subroutine GFS_stochastics_finalize - - -!>\defgroup gfs_stoch GFS Stochastics Physics Module -!! This module -!> @{ -!> \section arg_table_GFS_stochastics_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|---------------------------------------------------------------------------|--------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | km | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | do_sppt | flag_for_stochastic_surface_physics_perturbations | flag for stochastic surface physics perturbations | flag | 0 | logical | | in | F | -!! | use_zmtnblck | flag_for_mountain_blocking | flag for mountain blocking | flag | 0 | logical | | in | F | -!! | do_shum | flag_for_stochastic_shum_option | flag for stochastic shum option | flag | 0 | logical | | in | F | -!! | do_skeb | flag_for_stochastic_skeb_option | flag for stochastic skeb option | flag | 0 | logical | | in | F | -!! | zmtnblck | level_of_dividing_streamline | level of the dividing streamline | none | 1 | real | kind_phys | in | F | -!! | sppt_wts | weights_for_stochastic_sppt_perturbation | weights for stochastic sppt perturbation | none | 2 | real | kind_phys | inout | F | -!! | skebu_wts | weights_for_stochastic_skeb_perturbation_of_x_wind | weights for stochastic skeb perturbation of x wind | none | 2 | real | kind_phys | in | F | -!! | skebv_wts | weights_for_stochastic_skeb_perturbation_of_y_wind | weights for stochastic skeb perturbation of y wind | none | 2 | real | kind_phys | in | F | -!! | shum_wts | weights_for_stochastic_shum_perturbation | weights for stochastic shum perturbation | none | 2 | real | kind_phys | in | F | -!! | sppt_wts_inv | weights_for_stochastic_sppt_perturbation_flipped | weights for stochastic sppt perturbation, flipped | none | 2 | real | kind_phys | inout | F | -!! | skebu_wts_inv | weights_for_stochastic_skeb_perturbation_of_x_wind_flipped | weights for stochastic skeb perturbation of x wind, flipped | none | 2 | real | kind_phys | inout | F | -!! | skebv_wts_inv | weights_for_stochastic_skeb_perturbation_of_y_wind_flipped | weights for stochastic skeb perturbation of y wind, flipped | none | 2 | real | kind_phys | inout | F | -!! | shum_wts_inv | weights_for_stochastic_shum_perturbation_flipped | weights for stochastic shum perturbation, flipped | none | 2 | real | kind_phys | inout | F | -!! | diss_est | dissipation_estimate_of_air_temperature_at_model_layers | dissipation estimate model layer mean temperature | K | 2 | real | kind_phys | in | F | -!! | ugrs | x_wind | zonal wind | m s-1 | 2 | real | kind_phys | in | F | -!! | vgrs | y_wind | meridional wind | m s-1 | 2 | real | kind_phys | in | F | -!! | tgrs | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | in | F | -!! | qgrs | water_vapor_specific_humidity | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gu0 | x_wind_updated_by_physics | zonal wind updated by physics | m s-1 | 2 | real | kind_phys | inout | F | -!! | gv0 | y_wind_updated_by_physics | meridional wind updated by physics | m s-1 | 2 | real | kind_phys | inout | F | -!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | inout | F | -!! | gq0 | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | dtdtr | tendency_of_air_temperature_due_to_radiative_heating_on_physics_time_step | temp. change due to radiative heating per time step | K | 2 | real | kind_phys | in | F | -!! | rain | lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total rain at this time step | m | 1 | real | kind_phys | in | F | -!! | rainc | lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep | convective rain at this time step | m | 1 | real | kind_phys | in | F | -!! | tprcp | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total precipitation amount in each time step | m | 1 | real | kind_phys | inout | F | -!! | totprcp | accumulated_lwe_thickness_of_precipitation_amount | accumulated total precipitation | m | 1 | real | kind_phys | inout | F | -!! | cnvprcp | cumulative_lwe_thickness_of_convective_precipitation_amount | cumulative convective precipitation | m | 1 | real | kind_phys | inout | F | -!! | totprcpb | accumulated_lwe_thickness_of_precipitation_amount_in_bucket | accumulated total precipitation in bucket | m | 1 | real | kind_phys | inout | F | -!! | cnvprcpb | cumulative_lwe_thickness_of_convective_precipitation_amount_in_bucket | cumulative convective precipitation in bucket | m | 1 | real | kind_phys | inout | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | -!! | rain_cpl | lwe_thickness_of_precipitation_amount_for_coupling | total rain precipitation | m | 1 | real | kind_phys | inout | F | -!! | snow_cpl | lwe_thickness_of_snow_amount_for_coupling | total snow precipitation | m | 1 | real | kind_phys | inout | F | -!! | drain_cpl | tendency_of_lwe_thickness_of_precipitation_amount_for_coupling | change in rain_cpl (coupling_type) | m | 1 | real | kind_phys | in | F | -!! | dsnow_cpl | tendency_of_lwe_thickness_of_snow_amount_for_coupling | change in show_cpl (coupling_type) | m | 1 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! -!>\section gfs_stochy_general GFS_stochastics_run General Algorithm -!! This is the GFS stochastic physics driver. -!! Routines are called prior to radiation and physics steps to handle: -!! -# sets up various time/date variables -!! -# sets up various triggers -!! -# defines random seed indices for radiation (in a reproducible way) -!! -# interpolates coefficients for prognostic ozone calculation -!! -# performs surface data cycling via the GFS gcycle routine - subroutine GFS_stochastics_run (im, km, do_sppt, use_zmtnblck, do_shum, do_skeb, & - zmtnblck, sppt_wts, skebu_wts, skebv_wts, shum_wts,& - sppt_wts_inv, skebu_wts_inv, skebv_wts_inv, & - shum_wts_inv, diss_est, & - ugrs, vgrs, tgrs, qgrs, gu0, gv0, gt0, gq0, dtdtr, & - rain, rainc, tprcp, totprcp, cnvprcp, & - totprcpb, cnvprcpb, cplflx, & - rain_cpl, snow_cpl, drain_cpl, dsnow_cpl, & - errmsg, errflg) - - use machine, only: kind_phys - - implicit none - - integer, intent(in) :: im - integer, intent(in) :: km - logical, intent(in) :: do_sppt - logical, intent(in) :: use_zmtnblck - logical, intent(in) :: do_shum - logical, intent(in) :: do_skeb - !logical, intent(in) :: isppt_deep - real(kind_phys), dimension(1:im), intent(in) :: zmtnblck - ! sppt_wts only allocated if do_sppt == .true. - real(kind_phys), dimension(:,:), intent(inout) :: sppt_wts - ! skebu_wts, skebv_wts only allocated if do_skeb == .true. - real(kind_phys), dimension(:,:), intent(in) :: skebu_wts - real(kind_phys), dimension(:,:), intent(in) :: skebv_wts - ! shum_wts only allocated if do_shum == .true. - real(kind_phys), dimension(:,:), intent(in) :: shum_wts - ! inverse/flipped weights are always allocated - real(kind_phys), dimension(1:im,1:km), intent(inout) :: sppt_wts_inv - real(kind_phys), dimension(1:im,1:km), intent(inout) :: skebu_wts_inv - real(kind_phys), dimension(1:im,1:km), intent(inout) :: skebv_wts_inv - real(kind_phys), dimension(1:im,1:km), intent(inout) :: shum_wts_inv - real(kind_phys), dimension(1:im,1:km), intent(in) :: diss_est - real(kind_phys), dimension(1:im,1:km), intent(in) :: ugrs - real(kind_phys), dimension(1:im,1:km), intent(in) :: vgrs - real(kind_phys), dimension(1:im,1:km), intent(in) :: tgrs - real(kind_phys), dimension(1:im,1:km), intent(in) :: qgrs - real(kind_phys), dimension(1:im,1:km), intent(inout) :: gu0 - real(kind_phys), dimension(1:im,1:km), intent(inout) :: gv0 - real(kind_phys), dimension(1:im,1:km), intent(inout) :: gt0 - real(kind_phys), dimension(1:im,1:km), intent(inout) :: gq0 - ! dtdtr only allocated if do_sppt == .true. - real(kind_phys), dimension(:,:), intent(in) :: dtdtr - real(kind_phys), dimension(1:im), intent(in) :: rain - real(kind_phys), dimension(1:im), intent(in) :: rainc - real(kind_phys), dimension(1:im), intent(inout) :: tprcp - real(kind_phys), dimension(1:im), intent(inout) :: totprcp - real(kind_phys), dimension(1:im), intent(inout) :: cnvprcp - real(kind_phys), dimension(1:im), intent(inout) :: totprcpb - real(kind_phys), dimension(1:im), intent(inout) :: cnvprcpb - logical, intent(in) :: cplflx - ! rain_cpl, snow_cpl only allocated if cplflx == .true. or do_sppt == .true. - real(kind_phys), dimension(:), intent(inout) :: rain_cpl - real(kind_phys), dimension(:), intent(inout) :: snow_cpl - ! drain_cpl, dsnow_cpl only allocated if do_sppt == .true. - real(kind_phys), dimension(:), intent(in) :: drain_cpl - real(kind_phys), dimension(:), intent(in) :: dsnow_cpl - ! tconvtend ... vconvtend only allocated if isppt_deep == .true. - !real(kind_phys), dimension(:,:), intent(in) :: tconvtend - !real(kind_phys), dimension(:,:), intent(in) :: qconvtend - !real(kind_phys), dimension(:,:), intent(in) :: uconvtend - !real(kind_phys), dimension(:,:), intent(in) :: vconvtend - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - !--- local variables - integer :: k, i - real(kind=kind_phys) :: upert, vpert, tpert, qpert, qnew, sppt_vwt - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (do_sppt) then - do k=1,km - do i=1,im - sppt_vwt=1.0 - if (zmtnblck(i).EQ.0.0) then - sppt_vwt=1.0 - else - if (k.GT.zmtnblck(i)+2) then - sppt_vwt=1.0 - endif - if (k.LE.zmtnblck(i)) then - sppt_vwt=0.0 - endif - if (k.EQ.zmtnblck(i)+1) then - sppt_vwt=0.333333 - endif - if (k.EQ.zmtnblck(i)+2) then - sppt_vwt=0.666667 - endif - endif - if (use_zmtnblck)then - sppt_wts(i,k)=(sppt_wts(i,k)-1)*sppt_vwt+1.0 - endif - sppt_wts_inv(i,km-k+1)=sppt_wts(i,k) - - !if(isppt_deep)then - - ! upert = (gu0(i,k) - ugrs(i,k) - uconvtend(i,k)) + uconvtend(i,k) * sppt_wts(i,k) - ! vpert = (gv0(i,k) - vgrs(i,k) - vconvtend(i,k)) + vconvtend(i,k) * sppt_wts(i,k) - ! tpert = (gt0(i,k) - tgrs(i,k) - dtdtr(i,k) - tconvtend(i,k)) + tconvtend(i,k) * sppt_wts(i,k) - ! qpert = (gq0(i,k) - qgrs(i,k) - qconvtend(i,k)) + qconvtend(i,k) * sppt_wts(i,k) - - !else - - upert = (gu0(i,k) - ugrs(i,k)) * sppt_wts(i,k) - vpert = (gv0(i,k) - vgrs(i,k)) * sppt_wts(i,k) - tpert = (gt0(i,k) - tgrs(i,k) - dtdtr(i,k)) * sppt_wts(i,k) - qpert = (gq0(i,k) - qgrs(i,k)) * sppt_wts(i,k) - - !endif - - gu0(i,k) = ugrs(i,k)+upert - gv0(i,k) = vgrs(i,k)+vpert - - !negative humidity check - qnew = qgrs(i,k)+qpert - if (qnew >= 1.0e-10) then - gq0(i,k) = qnew - gt0(i,k) = tgrs(i,k) + tpert + dtdtr(i,k) - endif - enddo - enddo - - !if(isppt_deep)then - ! tprcp(:) = tprcp(:) + (sppt_wts(:,15) - 1 )*rainc(:) - ! totprcp(:) = totprcp(:) + (sppt_wts(:,15) - 1 )*rainc(:) - ! cnvprcp(:) = cnvprcp(:) + (sppt_wts(:,15) - 1 )*rainc(:) - !! ! bucket precipitation adjustment due to sppt - ! totprcpb(:) = totprcpb(:) + (sppt_wts(:,15) - 1 )*rainc(:) - ! cnvprcpb(:) = cnvprcpb(:) + (sppt_wts(:,15) - 1 )*rainc(:) - - ! if (cplflx) then !Need to make proper adjustments for deep convection only perturbations - ! rain_cpl(:) = rain_cpl(:) + (sppt_wts(:,15) - 1.0)*drain_cpl(:) - ! snow_cpl(:) = snow_cpl(:) + (sppt_wts(:,15) - 1.0)*dsnow_cpl(:) - ! endif - - !else - - ! instantaneous precip rate going into land model at the next time step - tprcp(:) = sppt_wts(:,15)*tprcp(:) - totprcp(:) = totprcp(:) + (sppt_wts(:,15) - 1 )*rain(:) - ! acccumulated total and convective preciptiation - cnvprcp(:) = cnvprcp(:) + (sppt_wts(:,15) - 1 )*rainc(:) - ! bucket precipitation adjustment due to sppt - totprcpb(:) = totprcpb(:) + (sppt_wts(:,15) - 1 )*rain(:) - cnvprcpb(:) = cnvprcpb(:) + (sppt_wts(:,15) - 1 )*rainc(:) - - if (cplflx) then - rain_cpl(:) = rain_cpl(:) + (sppt_wts(:,15) - 1.0)*drain_cpl(:) - snow_cpl(:) = snow_cpl(:) + (sppt_wts(:,15) - 1.0)*dsnow_cpl(:) - endif - - !endif - - endif - - if (do_shum) then - do k=1,km - gq0(:,k) = gq0(:,k)*(1.0 + shum_wts(:,k)) - shum_wts_inv(:,km-k+1) = shum_wts(:,k) - end do - endif - - if (do_skeb) then - do k=1,km - gu0(:,k) = gu0(:,k)+skebu_wts(:,k)*(diss_est(:,k)) - gv0(:,k) = gv0(:,k)+skebv_wts(:,k)*(diss_est(:,k)) - skebu_wts_inv(:,km-k+1) = skebu_wts(:,k) - skebv_wts_inv(:,km-k+1) = skebv_wts(:,k) - enddo - endif - - end subroutine GFS_stochastics_run - - end module GFS_stochastics -!> @} diff --git a/physics/GFS_suite_init_finalize_test.F90 b/physics/GFS_suite_init_finalize_test.F90 deleted file mode 100644 index efd0530e2..000000000 --- a/physics/GFS_suite_init_finalize_test.F90 +++ /dev/null @@ -1,68 +0,0 @@ - module GFS_suite_ini_fini_test - - contains - -!> \section arg_table_GFS_suite_ini_fini_test_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine GFS_suite_ini_fini_test_init (errmsg, errflg) - - implicit none - - ! interface variables - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - errmsg = '' - errflg = 0 - - write(0,*) "DH DEBUG: IN GFS_suite_ini_fini_test_init" - - end subroutine GFS_suite_ini_fini_test_init - -!> \section arg_table_GFS_suite_ini_fini_test_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine GFS_suite_ini_fini_test_finalize(errmsg, errflg) - - implicit none - - ! interface variables - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - errmsg = '' - errflg = 0 - - write(0,*) "DH DEBUG: IN GFS_suite_ini_fini_test_finalize" - - end subroutine GFS_suite_ini_fini_test_finalize - -!> \section arg_table_GFS_suite_ini_fini_test_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine GFS_suite_ini_fini_test_run (errmsg, errflg) - - use GFS_typedefs, only: GFS_interstitial_type - - implicit none - - ! interface variables - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - write(errmsg,'(a)') "DH ERROR: GFS_suite_ini_fini_test_run should not be called" - errflg = 1 - - end subroutine GFS_suite_ini_fini_test_run - - end module GFS_suite_ini_fini_test diff --git a/physics/GFS_time_vary_pre.fv3.F90 b/physics/GFS_time_vary_pre.fv3.F90 deleted file mode 100644 index 4fecabad5..000000000 --- a/physics/GFS_time_vary_pre.fv3.F90 +++ /dev/null @@ -1,141 +0,0 @@ -!> \file GFS_time_vary_pre.F90 -!! Contains code related to GFS physics suite setup (generic part of time_vary_step) - - module GFS_time_vary_pre - - use funcphys, only: gfuncphys - - implicit none - - private - - public GFS_time_vary_pre_init, GFS_time_vary_pre_run, GFS_time_vary_pre_finalize - - logical :: is_initialized = .false. - - contains - -!> \section arg_table_GFS_time_vary_pre_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine GFS_time_vary_pre_init (errmsg, errflg) - - implicit none - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (is_initialized) return - - !--- Call gfuncphys (funcphys.f) to compute all physics function tables. - call gfuncphys () - - is_initialized = .true. - - end subroutine GFS_time_vary_pre_init - - -!> \section arg_table_GFS_time_vary_pre_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine GFS_time_vary_pre_finalize(errmsg, errflg) - - implicit none - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (.not. is_initialized) return - - ! DH* this is the place to deallocate whatever is allocated by gfuncphys() in GFS_time_vary_pre_init - - is_initialized = .false. - - end subroutine GFS_time_vary_pre_finalize - - -!> \section arg_table_GFS_time_vary_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine GFS_time_vary_pre_run (Model, errmsg, errflg) - - use machine, only: kind_phys - use GFS_typedefs, only: GFS_control_type - - implicit none - - type(GFS_control_type), intent(inout) :: Model - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - real(kind=kind_phys), parameter :: con_24 = 24.0_kind_phys - real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys - real(kind=kind_phys) :: rinc(5) - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - ! Check initialization status - if (.not.is_initialized) then - write(errmsg,'(*(a))') "Logic error: GFS_time_vary_pre_run called before GFS_time_vary_pre_init" - errflg = 1 - return - end if - - !--- Model%jdat is being updated directly inside of FV3GFS_cap.F90 - !--- update calendars and triggers - rinc(1:5) = 0 - call w3difdat(Model%jdat,Model%idat,4,rinc) - Model%sec = rinc(4) - Model%phour = Model%sec/con_hr - !--- set current bucket hour - Model%zhour = Model%phour - Model%fhour = (Model%sec + Model%dtp)/con_hr - Model%kdt = nint((Model%sec + Model%dtp)/Model%dtp) - - Model%ipt = 1 - Model%lprnt = .false. - Model%lssav = .true. - - !--- radiation triggers - Model%lsswr = (mod(Model%kdt, Model%nsswr) == 1) - Model%lslwr = (mod(Model%kdt, Model%nslwr) == 1) - - !--- set the solar hour based on a combination of phour and time initial hour - Model%solhr = mod(Model%phour+Model%idate(1),con_24) - - if ((Model%debug) .and. (Model%me == Model%master)) then - print *,' sec ', Model%sec - print *,' kdt ', Model%kdt - print *,' nsswr ', Model%nsswr - print *,' nslwr ', Model%nslwr - print *,' nscyc ', Model%nscyc - print *,' lsswr ', Model%lsswr - print *,' lslwr ', Model%lslwr - print *,' fhour ', Model%fhour - print *,' phour ', Model%phour - print *,' solhr ', Model%solhr - endif - - end subroutine GFS_time_vary_pre_run - - end module GFS_time_vary_pre diff --git a/physics/cu_ntiedtke.F90 b/physics/cu_ntiedtke.F90 deleted file mode 100644 index 954c4a65f..000000000 --- a/physics/cu_ntiedtke.F90 +++ /dev/null @@ -1,3840 +0,0 @@ -!> \file cu_ntiedtke.F90 -!! This file contains the CCPP-compliant new Tiedtke scheme which parameterize -!! Shallow, deep, and mid-level convections in the model -!! Please refer to Tiedtke (1989), Bechtold et al. (2004,2008, 2014), -!! Zhang et al. (2011), Zhang and Wang (2017, 2018) -!! -!########################################################### - -module cu_ntiedtke - -!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - use machine , only : kind_phys - ! DH* TODO - replace with arguments to subroutine calls, - ! this also requires redefining derived constants in the - ! parameter section below - use physcons, only:rd=>con_rd, rv=>con_rv, g=>con_g, & - & cpd=>con_cp, alv=>con_hvap, alf=>con_hfus - - implicit none - real(kind=kind_phys),private :: rcpd,vtmpc1,tmelt,als,t13, & - c1es,c2es,c3les,c3ies,c4les,c4ies,c5les,c5ies,zrg - - real(kind=kind_phys),private :: rovcp,r5alvcp,r5alscp,ralvdcp,ralsdcp,ralfdcp,rtwat,rtber,rtice - real(kind=kind_phys),private :: entrdd,cmfcmax,cmfcmin,cmfdeps,zdnoprc,cprcon - integer,private :: momtrans,p650 - - parameter( & - t13 = 0.333333333,& - rcpd=1.0/cpd, & - tmelt=273.16, & - zrg=1.0/g, & - c1es=610.78, & - c2es=c1es*rd/rv, & - c3les=17.2693882, & - c3ies=21.875, & - c4les=35.86, & - c4ies=7.66, & - als = alv+alf, & - c5les=c3les*(tmelt-c4les), & - c5ies=c3ies*(tmelt-c4ies), & - r5alvcp=c5les*alv*rcpd, & - r5alscp=c5ies*als*rcpd, & - ralvdcp=alv*rcpd, & - ralsdcp=als*rcpd, & - ralfdcp=alf*rcpd, & - rtwat=tmelt, & - rtber=tmelt-5., & - rtice=tmelt-23., & - vtmpc1=rv/rd-1.0, & - rovcp = rd*rcpd ) -! -! entrdd: average entrainment & detrainment rate for downdrafts -! ------ -! - parameter(entrdd = 2.0e-4) -! -! cmfcmax: maximum massflux value allowed for updrafts etc -! ------- -! - parameter(cmfcmax = 1.0) -! -! cmfcmin: minimum massflux value (for safety) -! ------- -! - parameter(cmfcmin = 1.e-10) -! -! cmfdeps: fractional massflux for downdrafts at lfs -! ------- -! - parameter(cmfdeps = 0.30) - -! zdnoprc: deep cloud is thicker than this height (Unit:Pa) -! - parameter(zdnoprc = 2.0e4) -! ------- -! -! cprcon: coefficient from cloud water to rain water -! - parameter(cprcon = 1.4e-3) -! ------- -! -! momtrans: momentum transport method -! ( 1 = IFS40r1 method; 2 = new method ) -! - parameter(momtrans = 2 ) -! ------- -! - logical :: isequil -! isequil: representing equilibrium and nonequilibrium convection -! ( .false. [default]; .true. [experimental]. Ref. Bechtold et al. 2014 JAS ) -! - parameter(isequil = .false. ) -! -!-------------------- -! switches for deep, mid, shallow convections, downdraft, and momemtum transport -! ------------------ - logical :: lmfpen,lmfmid,lmfscv,lmfdd,lmfdudv - parameter(lmfpen=.true.,lmfmid=.true.,lmfscv=.true.,lmfdd=.true.,lmfdudv=.true.) -!-------------------- -!#################### end of variables definition########################## -!----------------------------------------------------------------------- -! -contains -!> \brief Brief description of the subroutine -!! -!! \section arg_table_cu_ntiedtke_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------------|--------------------|------------------------------------------|-------|------|-----------|-----------|--------|----------| -!! | mpirank | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | mpiroot | mpi_root | master MPI-rank | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine cu_ntiedtke_init(mpirank, mpiroot, errmsg, errflg) - - implicit none - - integer, intent(in) :: mpirank - integer, intent(in) :: mpiroot - character(len=*), intent( out) :: errmsg - integer, intent( out) :: errflg - - ! initialize ccpp error handling variables - errmsg = '' - errflg = 0 - - ! DH* temporary - if (mpirank==mpiroot) then - write(0,*) ' -----------------------------------------------------------------------------------------------------------------------------' - write(0,*) ' --- WARNING --- the CCPP New Tiedtke convection scheme is currently under development, use at your own risk --- WARNING ---' - write(0,*) ' -----------------------------------------------------------------------------------------------------------------------------' - end if - ! *DH temporary - - end subroutine cu_ntiedtke_init - - -!> \brief Brief description of the subroutine -!! -!! \section arg_table_cu_ntiedtke_finalize Argument Table -!! - subroutine cu_ntiedtke_finalize() - end subroutine cu_ntiedtke_finalize -! -! Tiedtke cumulus scheme from WRF with small modifications -! This scheme includes both deep and shallow convections -!=================== -! -!! -!! \section arg_table_cu_ntiedtke_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------|----------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | pu | x_wind_updated_by_physics | updated x-direction wind | m s-1 | 2 | real | kind_phys | inout | F | -!! | pv | y_wind_updated_by_physics | updated y-direction wind | m s-1 | 2 | real | kind_phys | inout | F | -!! | pt | air_temperature_updated_by_physics | updated temperature | K | 2 | real | kind_phys | inout | F | -!! | pqv | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | pqvf | moisture_tendency_due_to_dynamics | moisture tendency due to dynamics only | kg kg-1 s-1 | 2 | real | kind_phys | in | F | -!! | ptf | temperature_tendency_due_to_dynamics | temperature tendency due to dynamics only | K s-1 | 2 | real | kind_phys | in | F | -!! | clw | convective_transportable_tracers | array to contain cloud water and other tracers | kg kg-1 | 3 | real | kind_phys | inout | F | -!! | poz | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | pzz | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | pomg | omega | layer mean vertical velocity | Pa s-1 | 2 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | hfx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | zprecc | lwe_thickness_of_deep_convective_precipitation_amount | deep convective rainfall amount on physics timestep | m | 1 | real | kind_phys | out | F | -!! | lmask | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | -!! | lq | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | dx | cell_size | size of the grid cell | m | 1 | real | kind_phys | in | F | -!! | kbot | vertical_index_at_cloud_base | index for cloud base | index | 1 | integer | | out | F | -!! | ktop | vertical_index_at_cloud_top | index for cloud top | index | 1 | integer | | out | F | -!! | kcnv | flag_deep_convection | deep convection: 0=no, 1=yes | flag | 1 | integer | | out | F | -!! | ktrac | number_of_total_tracers | number of total tracers | count | 0 | integer | | in | F | -!! | ud_mf | instantaneous_atmosphere_updraft_convective_mass_flux | (updraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | -!! | dd_mf | instantaneous_atmosphere_downdraft_convective_mass_flux | (downdraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | -!! | dt_mf | instantaneous_atmosphere_detrainment_convective_mass_flux | (detrainment mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | -!! | cnvw | convective_cloud_water_mixing_ratio | convective cloud water | kg kg-1 | 2 | real | kind_phys | out | F | -!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! -!----------------------------------------------------------------------- -! level 1 subroutine 'tiecnvn' -!----------------------------------------------------------------- - subroutine cu_ntiedtke_run(pu,pv,pt,pqv,pqvf,ptf,clw,poz,pzz,prsl,prsi,pomg, & - evap,hfx,zprecc,lmask,lq,ix,km,dt,dx,kbot,ktop,kcnv,& - ktrac,ud_mf,dd_mf,dt_mf,cnvw,cnvc,errmsg,errflg) -!----------------------------------------------------------------- -! this is the interface between the model and the mass -! flux convection module -!----------------------------------------------------------------- - implicit none -! in&out variables - integer, intent(in) :: lq, ix, km, ktrac - real(kind=kind_phys), intent(in ) :: dt - integer, dimension( lq ), intent(in) :: lmask - real(kind=kind_phys), dimension( lq ), intent(in ) :: evap, hfx, dx - real(kind=kind_phys), dimension( ix , km ), intent(inout) :: pu, pv, pt, pqv - real(kind=kind_phys), dimension( ix , km ), intent(in ) :: poz, prsl, pomg, pqvf, ptf - real(kind=kind_phys), dimension( ix , km+1 ), intent(in ) :: pzz, prsi - real(kind=kind_phys), dimension( ix , km, ktrac+2 ), intent(inout ) :: clw - - integer, dimension( lq ), intent(out) :: kbot, ktop, kcnv - real(kind=kind_phys), dimension( lq ), intent(out) :: zprecc - real(kind=kind_phys), dimension (lq,km), intent(out) :: ud_mf, dd_mf, dt_mf, cnvw, cnvc - -! error messages - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -! local variables - real(kind=kind_phys) pum1(lq,km), pvm1(lq,km), ztt(lq,km), & - & ptte(lq,km), pqte(lq,km), pvom(lq,km), pvol(lq,km), & - & pverv(lq,km), pgeo(lq,km), pap(lq,km), paph(lq,km+1) - real(kind=kind_phys) pqhfl(lq), zqq(lq,km), & - & prsfc(lq), pssfc(lq), pcte(lq,km), & - & phhfl(lq), pgeoh(lq,km+1) - real(kind=kind_phys) ztp1(lq,km), zqp1(lq,km), ztu(lq,km), zqu(lq,km),& - & zlu(lq,km), zlude(lq,km), zmfu(lq,km), zmfd(lq,km), zmfude_rate(lq,km),& - & zqsat(lq,km), zrain(lq) - real(kind=kind_phys) pcen(lq,km,ktrac),ptenc(lq,km,ktrac) - - integer icbot(lq), ictop(lq), ktype(lq), lndj(lq) - logical locum(lq) -! - real(kind=kind_phys) ztmst,fliq,fice,ztc,zalf,tt - integer i,j,k,k1,n,km1 - real(kind=kind_phys) ztpp1 - real(kind=kind_phys) zew,zqs,zcor -! -! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - km1 = km + 1 - ztmst=dt -! -! masv flux diagnostics. -! - do j=1,lq - zrain(j)=0.0 - locum(j)=.false. - prsfc(j)=0.0 - pssfc(j)=0.0 - pqhfl(j)=evap(j) - phhfl(j)=hfx(j) - pgeoh(j,km1)=pzz(j,1) - paph(j,km1)=prsi(j,1) - if(lmask(j).eq.1) then - lndj(j)=1 - else - lndj(j)=0 - end if - end do -! -! convert model variables for mflux scheme -! - do k=1,km - k1=km-k+1 - do j=1,lq - pcte(j,k1)=0.0 - pvom(j,k1)=0.0 - pvol(j,k1)=0.0 - ztp1(j,k1)=pt(j,k) - zqp1(j,k1)=pqv(j,k) - pum1(j,k1)=pu(j,k) - pvm1(j,k1)=pv(j,k) - pverv(j,k1)=pomg(j,k) - pgeo(j,k1)=poz(j,k) - pgeoh(j,k1)=pzz(j,k+1) - pap(j,k1)=prsl(j,k) - paph(j,k1)=prsi(j,k+1) - tt=ztp1(j,k1) - zew = foeewm(tt) - zqs = zew/pap(j,k1) - zqs = min(0.5,zqs) - zcor = 1./(1.-vtmpc1*zqs) - zqsat(j,k1)=zqs*zcor - pqte(j,k1)=pqvf(j,k) - zqq(j,k1) =pqte(j,k1) - ptte(j,k1)=ptf(j,k) - ztt(j,k1) =ptte(j,k1) - ud_mf(j,k1)=0. - dd_mf(j,k1)=0. - dt_mf(j,k1)=0. - cnvw(j,k1)=0. - cnvc(j,k1)=0. - end do - end do - - do n=1,ktrac - do k=1,km - k1=km-k+1 - do j=1,lq - pcen(j,k1,n) = clw(j,k,n+2) - ptenc(j,k1,n)= 0. - end do - end do - end do - -! print *, "pgeo=",pgeo(1,:) -! print *, "pgeoh=",pgeoh(1,:) -! print *, "pap=",pap(1,:) -! print *, "paph=",paph(1,:) -! print *, "ztp1=",ztp1(1,:) -! print *, "zqp1=",zqp1(1,:) -! print *, "pum1=",pum1(1,:) -! print *, "pvm1=",pvm1(1,:) -! print *, "pverv=",pverv(1,:) -! print *, "pqte=",pqte(1,:) -! print *, "ptte=",ptte(1,:) -! print *, "hfx=", pqhfl(1),phhfl(1),dx(1) -! -!----------------------------------------------------------------------- -!* 2. call 'cumastrn'(master-routine for cumulus parameterization) -! - call cumastrn & - & (lq, km, km1, km-1, ztp1, & - & zqp1, pum1, pvm1, pverv, zqsat,& - & pqhfl, ztmst, pap, paph, pgeo, & - & ptte, pqte, pvom, pvol, prsfc,& - & pssfc, locum, ktrac, pcen, ptenc,& - & ktype, icbot, ictop, ztu, zqu, & - & zlu, zlude, zmfu, zmfd, zrain,& - & pcte, phhfl, lndj, pgeoh, zmfude_rate, dx) -! -! to include the cloud water and cloud ice detrained from convection -! - do k=1,km - k1=km-k+1 - do j=1,lq - if(pcte(j,k1).gt.0.) then - fliq=foealfa(ztp1(j,k1)) - fice=1.0-fliq - clw(j,k,2)=clw(j,k,2)+fliq*pcte(j,k1)*ztmst - clw(j,k,1)=clw(j,k,1)+fice*pcte(j,k1)*ztmst - endif - end do - end do -! - do k=1,km - k1 = km-k+1 - do j=1,lq - pt(j,k) = ztp1(j,k1)+(ptte(j,k1)-ztt(j,k1))*ztmst - pqv(j,k)= zqp1(j,k1)+(pqte(j,k1)-zqq(j,k1))*ztmst - ud_mf(j,k)= zmfu(j,k1)*ztmst - dd_mf(j,k)= zmfd(j,k1)*ztmst - dt_mf(j,k)= zmfude_rate(j,k1)*ztmst - cnvw(j,k) = zlude(j,k1)*ztmst*g/(prsi(j,k)-prsi(j,k+1)) - cnvc(j,k) = 0.04 * log(1. + 675. * ud_mf(j,k)) - cnvc(j,k) = min(cnvc(j,k), 0.6) - cnvc(j,k) = max(cnvc(j,k), 0.0) - end do - end do - - do j=1,lq - zprecc(j)=amax1(0.0,(prsfc(j)+pssfc(j))*ztmst*0.001) - kbot(j) = km-icbot(j)+1 - ktop(j) = km-ictop(j)+1 - if(ktype(j).eq.1 .or. ktype(j).eq.3) then - kcnv(j)=1 - else - kcnv(j)=0 - end if - end do - - if (lmfdudv) then - do k=1,km - k1=km-k+1 - do j=1,lq - pu(j,k)=pu(j,k)+pvom(j,k1)*ztmst - pv(j,k)=pv(j,k)+pvol(j,k1)*ztmst - end do - end do - endif -! - if (ktrac > 0) then - do n=1,ktrac - do k=1,km - k1=km-k+1 - do j=1,lq - clw(j,k,n+2)=pcen(j,k,n)+ptenc(j,k1,n)*ztmst - end do - end do - end do - end if -! - return - end subroutine cu_ntiedtke_run - -!############################################################# -! -! level 2 subroutines -! -!############################################################# -!*********************************************************** -! subroutine cumastrn -!*********************************************************** - subroutine cumastrn & - & (klon, klev, klevp1, klevm1, pten, & - & pqen, puen, pven, pverv, pqsen,& - & pqhfl, ztmst, pap, paph, pgeo, & - & ptte, pqte, pvom, pvol, prsfc,& - & pssfc, ldcum, ktrac, pcen, ptenc,& - & ktype, kcbot, kctop, ptu, pqu,& - & plu, plude, pmfu, pmfd, prain,& - & pcte, phhfl, lndj, zgeoh, pmfude_rate, dx) - implicit none -! -!***cumastrn* master routine for cumulus massflux-scheme -! m.tiedtke e.c.m.w.f. 1986/1987/1989 -! modifications -! y.wang i.p.r.c 2001 -! c.zhang 2012 -!***purpose -! ------- -! this routine computes the physical tendencies of the -! prognostic variables t,q,u and v due to convective processes. -! processes considered are: convective fluxes, formation of -! precipitation, evaporation of falling rain below cloud base, -! saturated cumulus downdrafts. -!***method -! ------ -! parameterization is done using a massflux-scheme. -! (1) define constants and parameters -! (2) specify values (t,q,qs...) at half levels and -! initialize updraft- and downdraft-values in 'cuinin' -! (3) calculate cloud base in 'cutypen', calculate cloud types in cutypen, -! and specify cloud base massflux -! (4) do cloud ascent in 'cuascn' in absence of downdrafts -! (5) do downdraft calculations: -! (a) determine values at lfs in 'cudlfsn' -! (b) determine moist descent in 'cuddrafn' -! (c) recalculate cloud base massflux considering the -! effect of cu-downdrafts -! (6) do final adjusments to convective fluxes in 'cuflxn', -! do evaporation in subcloud layer -! (7) calculate increments of t and q in 'cudtdqn' -! (8) calculate increments of u and v in 'cududvn' -!***externals. -! ---------- -! cuinin: initializes values at vertical grid used in cu-parametr. -! cutypen: cloud bypes, 1: deep cumulus 2: shallow cumulus -! cuascn: cloud ascent for entraining plume -! cudlfsn: determines values at lfs for downdrafts -! cuddrafn:does moist descent for cumulus downdrafts -! cuflxn: final adjustments to convective fluxes (also in pbl) -! cudqdtn: updates tendencies for t and q -! cududvn: updates tendencies for u and v -!***switches. -! -------- -! lmfmid=.t. midlevel convection is switched on -! lmfdd=.t. cumulus downdrafts switched on -! lmfdudv=.t. cumulus friction switched on -!*** -! model parameters (defined in subroutine cuparam) -! ------------------------------------------------ -! entrdd entrainment rate for cumulus downdrafts -! cmfcmax maximum massflux value allowed for -! cmfcmin minimum massflux value (for safety) -! cmfdeps fractional massflux for downdrafts at lfs -! cprcon coefficient for conversion from cloud water to rain -!***reference. -! ---------- -! paper on massflux scheme (tiedtke,1989) -!----------------------------------------------------------------- - integer klev,klon,ktrac,klevp1,klevm1 - real(kind=kind_phys) pten(klon,klev), pqen(klon,klev),& - & puen(klon,klev), pven(klon,klev),& - & ptte(klon,klev), pqte(klon,klev),& - & pvom(klon,klev), pvol(klon,klev),& - & pqsen(klon,klev), pgeo(klon,klev),& - & pap(klon,klev), paph(klon,klevp1),& - & pverv(klon,klev), pqhfl(klon),& - & phhfl(klon) - real(kind=kind_phys) ptu(klon,klev), pqu(klon,klev),& - & plu(klon,klev), plude(klon,klev),& - & pmfu(klon,klev), pmfd(klon,klev),& - & prain(klon),& - & prsfc(klon), pssfc(klon) - real(kind=kind_phys) ztenh(klon,klev), zqenh(klon,klev),& - & zgeoh(klon,klevp1), zqsenh(klon,klev),& - & ztd(klon,klev), zqd(klon,klev),& - & zmfus(klon,klev), zmfds(klon,klev),& - & zmfuq(klon,klev), zmfdq(klon,klev),& - & zdmfup(klon,klev), zdmfdp(klon,klev),& - & zmful(klon,klev), zrfl(klon),& - & zuu(klon,klev), zvu(klon,klev),& - & zud(klon,klev), zvd(klon,klev),& - & zlglac(klon,klev) - real(kind=kind_phys) pmflxr(klon,klevp1), pmflxs(klon,klevp1) - real(kind=kind_phys) zhcbase(klon),& - & zmfub(klon), zmfub1(klon),& - & zdhpbl(klon) - real(kind=kind_phys) zsfl(klon), zdpmel(klon,klev),& - & pcte(klon,klev), zcape(klon),& - & zcape1(klon), zcape2(klon),& - & ztauc(klon), ztaubl(klon),& - & zheat(klon) - real(kind=kind_phys) pcen(klon,klev,ktrac), ptenc(klon,klev,ktrac) - real(kind=kind_phys) wup(klon), zdqcv(klon) - real(kind=kind_phys) wbase(klon), zmfuub(klon) - real(kind=kind_phys) upbl(klon) - real(kind=kind_phys) dx(klon) - real(kind=kind_phys) pmfude_rate(klon,klev), pmfdde_rate(klon,klev) - real(kind=kind_phys) zmfuus(klon,klev), zmfdus(klon,klev) - real(kind=kind_phys) zmfudr(klon,klev), zmfddr(klon,klev) - real(kind=kind_phys) zuv2(klon,klev),ztenu(klon,klev),ztenv(klon,klev) - real(kind=kind_phys) zmfuvb(klon),zsum12(klon),zsum22(klon) - integer ilab(klon,klev), idtop(klon),& - & ictop0(klon), ilwmin(klon) - integer kdpl(klon) - integer kcbot(klon), kctop(klon),& - & ktype(klon), lndj(klon) - logical ldcum(klon), lldcum(klon) - logical loddraf(klon), llddraf3(klon), llo1, llo2(klon) - -! local varaiables - real(kind=kind_phys) zcons,zcons2,zqumqe,zdqmin,zdh,zmfmax - real(kind=kind_phys) zalfaw,zalv,zqalv,zc5ldcp,zc4les,zhsat,zgam,zzz,zhhat - real(kind=kind_phys) zpbmpt,zro,zdz,zdp,zeps,zfac,wspeed - integer jl,jk,ik - integer ikb,ikt,icum,itopm2 - real(kind=kind_phys) ztmst,ztau,zerate,zderate,zmfa - real(kind=kind_phys) zmfs(klon),pmean(klev),zlon - real(kind=kind_phys) zduten,zdvten,ztdis,pgf_u,pgf_v -!------------------------------------------- -! 1. specify constants and parameters -!------------------------------------------- - zcons=1./(g*ztmst) - zcons2=3./(g*ztmst) - - zlon = real(klon) - do jk = klev , 1 , -1 - pmean(jk) = sum(pap(:,jk))/zlon - end do - p650 = klev-2 - do jk = klev , 3 , -1 - if ( pmean(jk)/pmean(klev)*1.013250e5 > 650.e2 ) p650 = jk - end do - -!-------------------------------------------------------------- -!* 2. initialize values at vertical grid points in 'cuini' -!-------------------------------------------------------------- - call cuinin & - & (klon, klev, klevp1, klevm1, pten, & - & pqen, pqsen, puen, pven, pverv,& - & pgeo, paph, zgeoh, ztenh, zqenh,& - & zqsenh, ilwmin, ptu, pqu, ztd, & - & zqd, zuu, zvu, zud, zvd, & - & pmfu, pmfd, zmfus, zmfds, zmfuq,& - & zmfdq, zdmfup, zdmfdp, zdpmel, plu, & - & plude, ilab) - -!---------------------------------- -!* 3.0 cloud base calculations -!---------------------------------- -!* (a) determine cloud base values in 'cutypen', -! and the cumulus type 1 or 2 -! ------------------------------------------- - call cutypen & - & ( klon, klev, klevp1, klevm1, pqen,& - & ztenh, zqenh, zqsenh, zgeoh, paph,& - & phhfl, pqhfl, pgeo, pqsen, pap,& - & pten, lndj, ptu, pqu, ilab,& - & ldcum, kcbot, ictop0, ktype, wbase, plu, kdpl) - -!* (b) assign the first guess mass flux at cloud base -! ------------------------------------------ - do jl=1,klon - zdhpbl(jl)=0.0 - upbl(jl) = 0.0 - idtop(jl)=0 - end do - - do jk=2,klev - do jl=1,klon - if(jk.ge.kcbot(jl) .and. ldcum(jl)) then - zdhpbl(jl)=zdhpbl(jl)+(alv*pqte(jl,jk)+cpd*ptte(jl,jk))& - & *(paph(jl,jk+1)-paph(jl,jk)) - if(lndj(jl) .eq. 0) then - wspeed = sqrt(puen(jl,jk)**2 + pven(jl,jk)**2) - upbl(jl) = upbl(jl) + wspeed*(paph(jl,jk+1)-paph(jl,jk)) - end if - end if - end do - end do - - do jl=1,klon - if(ldcum(jl)) then - ikb=kcbot(jl) - zmfmax = (paph(jl,ikb)-paph(jl,ikb-1))*zcons2 - if(ktype(jl) == 1) then - zmfub(jl)= 0.1*zmfmax - else if ( ktype(jl) == 2 ) then - zqumqe = pqu(jl,ikb) + plu(jl,ikb) - zqenh(jl,ikb) - zdqmin = max(0.01*zqenh(jl,ikb),1.e-10) - zdh = cpd*(ptu(jl,ikb)-ztenh(jl,ikb)) + alv*zqumqe - zdh = g*max(zdh,1.e5*zdqmin) - if ( zdhpbl(jl) > 0. ) then - zmfub(jl) = zdhpbl(jl)/zdh - zmfub(jl) = min(zmfub(jl),zmfmax) - else - zmfub(jl) = 0.1*zmfmax - ldcum(jl) = .false. - end if - end if - else - zmfub(jl) = 0. - end if - end do -!------------------------------------------------------ -!* 4.0 determine cloud ascent for entraining plume -!------------------------------------------------------ -!* (a) do ascent in 'cuasc'in absence of downdrafts -!---------------------------------------------------------- - call cuascn & - & (klon, klev, klevp1, klevm1, ztenh,& - & zqenh, puen, pven, pten, pqen,& - & pqsen, pgeo, zgeoh, pap, paph,& - & pqte, pverv, ilwmin, ldcum, zhcbase,& - & ktype, ilab, ptu, pqu, plu,& - & zuu, zvu, pmfu, zmfub,& - & zmfus, zmfuq, zmful, plude, zdmfup,& - & kcbot, kctop, ictop0, icum, ztmst,& - & zqsenh, zlglac, lndj, wup, wbase, kdpl, pmfude_rate ) - -!* (b) check cloud depth and change entrainment rate accordingly -! calculate precipitation rate (for downdraft calculation) -!------------------------------------------------------------------ - do jl=1,klon - if ( ldcum(jl) ) then - ikb = kcbot(jl) - itopm2 = kctop(jl) - zpbmpt = paph(jl,ikb) - paph(jl,itopm2) - if ( ktype(jl) == 1 .and. zpbmpt < zdnoprc ) ktype(jl) = 2 - if ( ktype(jl) == 2 .and. zpbmpt >= zdnoprc ) ktype(jl) = 1 - ictop0(jl) = kctop(jl) - end if - zrfl(jl)=zdmfup(jl,1) - end do - - do jk=2,klev - do jl=1,klon - zrfl(jl)=zrfl(jl)+zdmfup(jl,jk) - end do - end do - - do jk = 1,klev - do jl = 1,klon - pmfd(jl,jk) = 0. - zmfds(jl,jk) = 0. - zmfdq(jl,jk) = 0. - zdmfdp(jl,jk) = 0. - zdpmel(jl,jk) = 0. - end do - end do - -!----------------------------------------- -!* 6.0 cumulus downdraft calculations -!----------------------------------------- - if(lmfdd) then -!* (a) determine lfs in 'cudlfsn' -!-------------------------------------- - call cudlfsn & - & (klon, klev,& - & kcbot, kctop, lndj, ldcum, & - & ztenh, zqenh, puen, pven, & - & pten, pqsen, pgeo, & - & zgeoh, paph, ptu, pqu, plu, & - & zuu, zvu, zmfub, zrfl, & - & ztd, zqd, zud, zvd, & - & pmfd, zmfds, zmfdq, zdmfdp, & - & idtop, loddraf) -!* (b) determine downdraft t,q and fluxes in 'cuddrafn' -!------------------------------------------------------------ - call cuddrafn & - & ( klon, klev, loddraf, & - & ztenh, zqenh, puen, pven, & - & pgeo, zgeoh, paph, zrfl, & - & ztd, zqd, zud, zvd, pmfu, & - & pmfd, zmfds, zmfdq, zdmfdp, pmfdde_rate ) -!----------------------------------------------------------- - end if -! -!----------------------------------------------------------------------- -!* 6.0 closure and clean work -! ------ -!-- 6.1 recalculate cloud base massflux from a cape closure -! for deep convection (ktype=1) -! - do jl=1,klon - if(ldcum(jl) .and. ktype(jl) .eq. 1) then - ikb = kcbot(jl) - ikt = kctop(jl) - zheat(jl)=0.0 - zcape(jl)=0.0 - zcape1(jl)=0.0 - zcape2(jl)=0.0 - zmfub1(jl)=zmfub(jl) - - ztauc(jl) = (zgeoh(jl,ikt)-zgeoh(jl,ikb)) / & - ((2.+ min(15.0,wup(jl)))*g) - if(lndj(jl) .eq. 0) then - upbl(jl) = 2.+ upbl(jl)/(paph(jl,klev+1)-paph(jl,ikb)) - ztaubl(jl) = (zgeoh(jl,ikb)-zgeoh(jl,klev+1))/(g*upbl(jl)) - ztaubl(jl) = min(300., ztaubl(jl)) - else - ztaubl(jl) = ztauc(jl) - end if - end if - end do -! - do jk = 1 , klev - do jl = 1 , klon - llo1 = ldcum(jl) .and. ktype(jl) .eq. 1 - if ( llo1 .and. jk <= kcbot(jl) .and. jk > kctop(jl) ) then - ikb = kcbot(jl) - zdz = pgeo(jl,jk-1)-pgeo(jl,jk) - zdp = pap(jl,jk)-pap(jl,jk-1) - zheat(jl) = zheat(jl) + ((pten(jl,jk-1)-pten(jl,jk)+zdz*rcpd) / & - ztenh(jl,jk)+vtmpc1*(pqen(jl,jk-1)-pqen(jl,jk))) * & - (g*(pmfu(jl,jk)+pmfd(jl,jk))) - zcape1(jl) = zcape1(jl) + ((ptu(jl,jk)-ztenh(jl,jk))/ztenh(jl,jk) + & - vtmpc1*(pqu(jl,jk)-zqenh(jl,jk))-plu(jl,jk))*zdp - end if - - if ( llo1 .and. jk >= kcbot(jl) ) then - if((paph(jl,klev+1)-paph(jl,kdpl(jl)))<50.e2) then - zdp = paph(jl,jk+1)-paph(jl,jk) - zcape2(jl) = zcape2(jl) + ztaubl(jl)* & - ((1.+vtmpc1*pqen(jl,jk))*ptte(jl,jk)+vtmpc1*pten(jl,jk)*pqte(jl,jk))*zdp - end if - end if - end do - end do - - do jl=1,klon - if(ldcum(jl).and.ktype(jl).eq.1) then - ikb = kcbot(jl) - ikt = kctop(jl) - ztau = ztauc(jl) * (1.+1.33e-5*dx(jl)) - ztau = max(ztmst,ztau) - ztau = max(720.,ztau) - ztau = min(10800.,ztau) - if(isequil) then - zcape2(jl)= max(0.,zcape2(jl)) - zcape(jl) = max(0.,min(zcape1(jl)-zcape2(jl),5000.)) - else - zcape(jl) = max(0.,min(zcape1(jl),5000.)) - end if - zheat(jl) = max(1.e-4,zheat(jl)) - zmfub1(jl) = (zcape(jl)*zmfub(jl))/(zheat(jl)*ztau) - zmfub1(jl) = max(zmfub1(jl),0.001) - zmfmax=(paph(jl,ikb)-paph(jl,ikb-1))*zcons2 - zmfub1(jl)=min(zmfub1(jl),zmfmax) - end if - end do -! -!* 6.2 recalculate convective fluxes due to effect of -! downdrafts on boundary layer moist static energy budget (ktype=2) -!-------------------------------------------------------- - do jl=1,klon - if(ldcum(jl) .and. ktype(jl) .eq. 2) then - ikb=kcbot(jl) - if(pmfd(jl,ikb).lt.0.0 .and. loddraf(jl)) then - zeps=-pmfd(jl,ikb)/max(zmfub(jl),cmfcmin) - else - zeps=0. - endif - zqumqe=pqu(jl,ikb)+plu(jl,ikb)- & - & zeps*zqd(jl,ikb)-(1.-zeps)*zqenh(jl,ikb) - zdqmin=max(0.01*zqenh(jl,ikb),cmfcmin) - zmfmax=(paph(jl,ikb)-paph(jl,ikb-1))*zcons2 -! using moist static engergy closure instead of moisture closure - zdh=cpd*(ptu(jl,ikb)-zeps*ztd(jl,ikb)- & - & (1.-zeps)*ztenh(jl,ikb))+alv*zqumqe - zdh=g*max(zdh,1.e5*zdqmin) - if(zdhpbl(jl).gt.0.)then - zmfub1(jl)=zdhpbl(jl)/zdh - else - zmfub1(jl) = zmfub(jl) - end if - zmfub1(jl) = min(zmfub1(jl),zmfmax) - end if - -!* 6.3 mid-level convection - nothing special -!--------------------------------------------------------- - if(ldcum(jl) .and. ktype(jl) .eq. 3 ) then - zmfub1(jl) = zmfub(jl) - end if - - end do - -!* 6.4 scaling the downdraft mass flux -!--------------------------------------------------------- - do jk=1,klev - do jl=1,klon - if( ldcum(jl) ) then - zfac=zmfub1(jl)/max(zmfub(jl),cmfcmin) - pmfd(jl,jk)=pmfd(jl,jk)*zfac - zmfds(jl,jk)=zmfds(jl,jk)*zfac - zmfdq(jl,jk)=zmfdq(jl,jk)*zfac - zdmfdp(jl,jk)=zdmfdp(jl,jk)*zfac - pmfdde_rate(jl,jk) = pmfdde_rate(jl,jk)*zfac - end if - end do - end do - -!* 6.5 scaling the updraft mass flux -! -------------------------------------------------------- - do jl = 1,klon - if ( ldcum(jl) ) zmfs(jl) = zmfub1(jl)/max(cmfcmin,zmfub(jl)) - end do - do jk = 2 , klev - do jl = 1,klon - if ( ldcum(jl) .and. jk >= kctop(jl)-1 ) then - ikb = kcbot(jl) - if ( jk>ikb ) then - zdz = ((paph(jl,klev+1)-paph(jl,jk))/(paph(jl,klev+1)-paph(jl,ikb))) - pmfu(jl,jk) = pmfu(jl,ikb)*zdz - end if - zmfmax = (paph(jl,jk)-paph(jl,jk-1))*zcons2 - if ( pmfu(jl,jk)*zmfs(jl) > zmfmax ) then - zmfs(jl) = min(zmfs(jl),zmfmax/pmfu(jl,jk)) - end if - end if - end do - end do - do jk = 2 , klev - do jl = 1,klon - if ( ldcum(jl) .and. jk <= kcbot(jl) .and. jk >= kctop(jl)-1 ) then - pmfu(jl,jk) = pmfu(jl,jk)*zmfs(jl) - zmfus(jl,jk) = zmfus(jl,jk)*zmfs(jl) - zmfuq(jl,jk) = zmfuq(jl,jk)*zmfs(jl) - zmful(jl,jk) = zmful(jl,jk)*zmfs(jl) - zdmfup(jl,jk) = zdmfup(jl,jk)*zmfs(jl) - plude(jl,jk) = plude(jl,jk)*zmfs(jl) - pmfude_rate(jl,jk) = pmfude_rate(jl,jk)*zmfs(jl) - end if - end do - end do - -!* 6.6 if ktype = 2, kcbot=kctop is not allowed -! --------------------------------------------------- - do jl = 1,klon - if ( ktype(jl) == 2 .and. & - kcbot(jl) == kctop(jl) .and. kcbot(jl) >= klev-1 ) then - ldcum(jl) = .false. - ktype(jl) = 0 - end if - end do - - if ( .not. lmfscv .or. .not. lmfpen ) then - do jl = 1,klon - llo2(jl) = .false. - if ( (.not. lmfscv .and. ktype(jl) == 2) .or. & - (.not. lmfpen .and. ktype(jl) == 1) ) then - llo2(jl) = .true. - ldcum(jl) = .false. - end if - end do - end if - -!* 6.7 set downdraft mass fluxes to zero above cloud top -!---------------------------------------------------- - do jl = 1,klon - if ( loddraf(jl) .and. idtop(jl) <= kctop(jl) ) then - idtop(jl) = kctop(jl) + 1 - end if - end do - do jk = 2 , klev - do jl = 1,klon - if ( loddraf(jl) ) then - if ( jk < idtop(jl) ) then - pmfd(jl,jk) = 0. - zmfds(jl,jk) = 0. - zmfdq(jl,jk) = 0. - pmfdde_rate(jl,jk) = 0. - zdmfdp(jl,jk) = 0. - else if ( jk == idtop(jl) ) then - pmfdde_rate(jl,jk) = 0. - end if - end if - end do - end do - - itopm2 = 2 -!---------------------------------------------------------- -!* 7.0 determine final convective fluxes in 'cuflx' -!---------------------------------------------------------- - call cuflxn & - & ( klon, klev, ztmst & - & , pten, pqen, pqsen, ztenh, zqenh & - & , paph, pap, zgeoh, lndj, ldcum & - & , kcbot, kctop, idtop, itopm2 & - & , ktype, loddraf & - & , pmfu, pmfd, zmfus, zmfds & - & , zmfuq, zmfdq, zmful, plude & - & , zdmfup, zdmfdp, zdpmel, zlglac & - & , prain, pmfdde_rate, pmflxr, pmflxs ) - -! some adjustments needed - do jl=1,klon - zmfs(jl) = 1. - zmfuub(jl)=0. - end do - do jk = 2 , klev - do jl = 1,klon - if ( loddraf(jl) .and. jk >= idtop(jl)-1 ) then - zmfmax = pmfu(jl,jk)*0.98 - if ( pmfd(jl,jk)+zmfmax+1.e-15 < 0. ) then - zmfs(jl) = min(zmfs(jl),-zmfmax/pmfd(jl,jk)) - end if - end if - end do - end do - - do jk = 2 , klev - do jl = 1 , klon - if ( zmfs(jl) < 1. .and. jk >= idtop(jl)-1 ) then - pmfd(jl,jk) = pmfd(jl,jk)*zmfs(jl) - zmfds(jl,jk) = zmfds(jl,jk)*zmfs(jl) - zmfdq(jl,jk) = zmfdq(jl,jk)*zmfs(jl) - pmfdde_rate(jl,jk) = pmfdde_rate(jl,jk)*zmfs(jl) - zmfuub(jl) = zmfuub(jl) - (1.-zmfs(jl))*zdmfdp(jl,jk) - pmflxr(jl,jk+1) = pmflxr(jl,jk+1) + zmfuub(jl) - zdmfdp(jl,jk) = zdmfdp(jl,jk)*zmfs(jl) - end if - end do - end do - - do jk = 2 , klev - 1 - do jl = 1, klon - if ( loddraf(jl) .and. jk >= idtop(jl)-1 ) then - zerate = -pmfd(jl,jk) + pmfd(jl,jk-1) + pmfdde_rate(jl,jk) - if ( zerate < 0. ) then - pmfdde_rate(jl,jk) = pmfdde_rate(jl,jk) - zerate - end if - end if - if ( ldcum(jl) .and. jk >= kctop(jl)-1 ) then - zerate = pmfu(jl,jk) - pmfu(jl,jk+1) + pmfude_rate(jl,jk) - if ( zerate < 0. ) then - pmfude_rate(jl,jk) = pmfude_rate(jl,jk) - zerate - end if - zdmfup(jl,jk) = pmflxr(jl,jk+1) + pmflxs(jl,jk+1) - & - pmflxr(jl,jk) - pmflxs(jl,jk) - zdmfdp(jl,jk) = 0. - end if - end do - end do - -! avoid negative humidities at ddraught top - do jl = 1,klon - if ( loddraf(jl) ) then - jk = idtop(jl) - ik = min(jk+1,klev) - if ( zmfdq(jl,jk) < 0.3*zmfdq(jl,ik) ) then - zmfdq(jl,jk) = 0.3*zmfdq(jl,ik) - end if - end if - end do - -! avoid negative humidities near cloud top because gradient of precip flux -! and detrainment / liquid water flux are too large - do jk = 2 , klev - do jl = 1, klon - if ( ldcum(jl) .and. jk >= kctop(jl)-1 .and. jk < kcbot(jl) ) then - zdz = ztmst*g/(paph(jl,jk+1)-paph(jl,jk)) - zmfa = zmfuq(jl,jk+1) + zmfdq(jl,jk+1) - & - zmfuq(jl,jk) - zmfdq(jl,jk) + & - zmful(jl,jk+1) - zmful(jl,jk) + zdmfup(jl,jk) - zmfa = (zmfa-plude(jl,jk))*zdz - if ( pqen(jl,jk)+zmfa < 0. ) then - plude(jl,jk) = plude(jl,jk) + 2.*(pqen(jl,jk)+zmfa)/zdz - end if - if ( plude(jl,jk) < 0. ) plude(jl,jk) = 0. - end if - if ( .not. ldcum(jl) ) pmfude_rate(jl,jk) = 0. - if ( abs(pmfd(jl,jk-1)) < 1.0e-20 ) pmfdde_rate(jl,jk) = 0. - end do - end do - - do jl=1,klon - prsfc(jl) = pmflxr(jl,klev+1) - pssfc(jl) = pmflxs(jl,klev+1) - end do - -!---------------------------------------------------------------- -!* 8.0 update tendencies for t and q in subroutine cudtdq -!---------------------------------------------------------------- - call cudtdqn(klon,klev,itopm2,kctop,idtop,ldcum,loddraf, & - ztmst,paph,zgeoh,pgeo,pten,ztenh,pqen,zqenh,pqsen, & - zlglac,plude,pmfu,pmfd,zmfus,zmfds,zmfuq,zmfdq,zmful, & - zdmfup,zdmfdp,zdpmel,ptte,pqte,pcte) -!---------------------------------------------------------------- -!* 9.0 update tendencies for u and u in subroutine cududv -!---------------------------------------------------------------- - if(lmfdudv) then - do jk = klev-1 , 2 , -1 - ik = jk + 1 - do jl = 1,klon - if ( ldcum(jl) ) then - if ( jk == kcbot(jl) .and. ktype(jl) < 3 ) then - ikb = kdpl(jl) - zuu(jl,jk) = puen(jl,ikb-1) - zvu(jl,jk) = pven(jl,ikb-1) - else if ( jk == kcbot(jl) .and. ktype(jl) == 3 ) then - zuu(jl,jk) = puen(jl,jk-1) - zvu(jl,jk) = pven(jl,jk-1) - end if - if ( jk < kcbot(jl) .and. jk >= kctop(jl) ) then - if(momtrans .eq. 1)then - zfac = 0. - if ( ktype(jl) == 1 .or. ktype(jl) == 3 ) zfac = 2. - if ( ktype(jl) == 1 .and. jk <= kctop(jl)+2 ) zfac = 3. - zerate = pmfu(jl,jk) - pmfu(jl,ik) + & - (1.+zfac)*pmfude_rate(jl,jk) - zderate = (1.+zfac)*pmfude_rate(jl,jk) - zmfa = 1./max(cmfcmin,pmfu(jl,jk)) - zuu(jl,jk) = (zuu(jl,ik)*pmfu(jl,ik) + & - zerate*puen(jl,jk)-zderate*zuu(jl,ik))*zmfa - zvu(jl,jk) = (zvu(jl,ik)*pmfu(jl,ik) + & - zerate*pven(jl,jk)-zderate*zvu(jl,ik))*zmfa - else - if(ktype(jl) == 1 .or. ktype(jl) == 3) then - pgf_u = -0.7*0.5*(pmfu(jl,ik)*(puen(jl,ik)-puen(jl,jk))+& - pmfu(jl,jk)*(puen(jl,jk)-puen(jl,jk-1))) - pgf_v = -0.7*0.5*(pmfu(jl,ik)*(pven(jl,ik)-pven(jl,jk))+& - pmfu(jl,jk)*(pven(jl,jk)-pven(jl,jk-1))) - else - pgf_u = 0. - pgf_v = 0. - end if - zerate = pmfu(jl,jk) - pmfu(jl,ik) + pmfude_rate(jl,jk) - zderate = pmfude_rate(jl,jk) - zmfa = 1./max(cmfcmin,pmfu(jl,jk)) - zuu(jl,jk) = (zuu(jl,ik)*pmfu(jl,ik) + & - zerate*puen(jl,jk)-zderate*zuu(jl,ik)+pgf_u)*zmfa - zvu(jl,jk) = (zvu(jl,ik)*pmfu(jl,ik) + & - zerate*pven(jl,jk)-zderate*zvu(jl,ik)+pgf_v)*zmfa - end if - end if - end if - end do - end do - - if(lmfdd) then - do jk = 3 , klev - ik = jk - 1 - do jl = 1,klon - if ( ldcum(jl) ) then - if ( jk == idtop(jl) ) then - zud(jl,jk) = 0.5*(zuu(jl,jk)+puen(jl,ik)) - zvd(jl,jk) = 0.5*(zvu(jl,jk)+pven(jl,ik)) - else if ( jk > idtop(jl) ) then - zerate = -pmfd(jl,jk) + pmfd(jl,ik) + pmfdde_rate(jl,jk) - zmfa = 1./min(-cmfcmin,pmfd(jl,jk)) - zud(jl,jk) = (zud(jl,ik)*pmfd(jl,ik) - & - zerate*puen(jl,ik)+pmfdde_rate(jl,jk)*zud(jl,ik))*zmfa - zvd(jl,jk) = (zvd(jl,ik)*pmfd(jl,ik) - & - zerate*pven(jl,ik)+pmfdde_rate(jl,jk)*zvd(jl,ik))*zmfa - end if - end if - end do - end do - end if -! -------------------------------------------------- -! rescale massfluxes for stability in Momentum -!------------------------------------------------------------------------ - zmfs(:) = 1. - do jk = 2 , klev - do jl = 1, klon - if ( ldcum(jl) .and. jk >= kctop(jl)-1 ) then - zmfmax = (paph(jl,jk)-paph(jl,jk-1))*zcons - if ( pmfu(jl,jk) > zmfmax .and. jk >= kctop(jl) ) then - zmfs(jl) = min(zmfs(jl),zmfmax/pmfu(jl,jk)) - end if - end if - end do - end do - do jk = 1 , klev - do jl = 1, klon - zmfuus(jl,jk) = pmfu(jl,jk) - zmfdus(jl,jk) = pmfd(jl,jk) - if ( ldcum(jl) .and. jk >= kctop(jl)-1 ) then - zmfuus(jl,jk) = pmfu(jl,jk)*zmfs(jl) - zmfdus(jl,jk) = pmfd(jl,jk)*zmfs(jl) - end if - end do - end do -!* 9.1 update u and v in subroutine cududvn -!------------------------------------------------------------------- - do jk = 1 , klev - do jl = 1, klon - ztenu(jl,jk) = pvom(jl,jk) - ztenv(jl,jk) = pvol(jl,jk) - end do - end do - - call cududvn(klon,klev,itopm2,ktype,kcbot,kctop, & - ldcum,ztmst,paph,puen,pven,zmfuus,zmfdus,zuu, & - zud,zvu,zvd,pvom,pvol) - -! calculate KE dissipation - do jl = 1, klon - zsum12(jl) = 0. - zsum22(jl) = 0. - end do - do jk = 1 , klev - do jl = 1, klon - zuv2(jl,jk) = 0. - if ( ldcum(jl) .and. jk >= kctop(jl)-1 ) then - zdz = (paph(jl,jk+1)-paph(jl,jk)) - zduten = pvom(jl,jk) - ztenu(jl,jk) - zdvten = pvol(jl,jk) - ztenv(jl,jk) - zuv2(jl,jk) = sqrt(zduten**2+zdvten**2) - zsum22(jl) = zsum22(jl) + zuv2(jl,jk)*zdz - zsum12(jl) = zsum12(jl) - & - (puen(jl,jk)*zduten+pven(jl,jk)*zdvten)*zdz - end if - end do - end do - do jk = 1 , klev - do jl = 1, klon - if ( ldcum(jl) .and. jk>=kctop(jl)-1 ) then - ztdis = rcpd*zsum12(jl)*zuv2(jl,jk)/max(1.e-15,zsum22(jl)) - ptte(jl,jk) = ptte(jl,jk) + ztdis - end if - end do - end do - - end if - -!---------------------------------------------------------------------- -!* 10. IN CASE THAT EITHER DEEP OR SHALLOW IS SWITCHED OFF -! NEED TO SET SOME VARIABLES A POSTERIORI TO ZERO -! --------------------------------------------------- - if ( .not. lmfscv .or. .not. lmfpen ) then - do jk = 2 , klev - do jl = 1, klon - if ( llo2(jl) .and. jk >= kctop(jl)-1 ) then - ptu(jl,jk) = pten(jl,jk) - pqu(jl,jk) = pqen(jl,jk) - plu(jl,jk) = 0. - pmfude_rate(jl,jk) = 0. - pmfdde_rate(jl,jk) = 0. - end if - end do - end do - do jl = 1, klon - if ( llo2(jl) ) then - kctop(jl) = klev - 1 - kcbot(jl) = klev - 1 - end if - end do - end if - - !---------------------------------------------------------------------- - !* 11.0 CHEMICAL TRACER TRANSPORT - ! ------------------------- - - if ( ktrac > 0 ) then - ! transport switched off for mid-level convection - do jl = 1, klon - if ( ldcum(jl) .and. ktype(jl) /= 3 .and. & - kcbot(jl)-kctop(jl) >= 1 ) then - lldcum(jl) = .true. - llddraf3(jl) = loddraf(jl) - else - lldcum(jl) = .false. - llddraf3(jl) = .false. - end if - end do - ! check and correct mass fluxes for CFL criterium - zmfs(:) = 1. - do jk = 2 , klev - do jl = 1, klon - if ( lldcum(jl) .and. jk >= kctop(jl) ) then - zmfmax = (paph(jl,jk)-paph(jl,jk-1))*0.8*zcons - if ( pmfu(jl,jk) > zmfmax ) then - zmfs(jl) = min(zmfs(jl),zmfmax/pmfu(jl,jk)) - end if - end if - end do - end do - - do jk = 1, klev - do jl = 1, klon - if ( lldcum(jl) .and. jk >= kctop(jl)-1 ) then - zmfuus(jl,jk) = pmfu(jl,jk)*zmfs(jl) - zmfudr(jl,jk) = pmfude_rate(jl,jk)*zmfs(jl) - else - zmfuus(jl,jk) = 0. - zmfudr(jl,jk) = 0. - end if - if ( llddraf3(jl) .and. jk >= idtop(jl)-1 ) then - zmfdus(jl,jk) = pmfd(jl,jk)*zmfs(jl) - zmfddr(jl,jk) = pmfdde_rate(jl,jk)*zmfs(jl) - else - zmfdus(jl,jk) = 0. - zmfddr(jl,jk) = 0. - end if - end do - end do - - call cuctracer(klon,klev,ktrac,kctop,idtop, & - lldcum,llddraf3,ztmst,paph,zmfuus,zmfdus, & - zmfudr,zmfddr,pcen,ptenc) - end if - - return - end subroutine cumastrn - -!********************************************** -! level 3 subroutine cuinin -!********************************************** -! - subroutine cuinin & - & (klon, klev, klevp1, klevm1, pten,& - & pqen, pqsen, puen, pven, pverv,& - & pgeo, paph, pgeoh, ptenh, pqenh,& - & pqsenh, klwmin, ptu, pqu, ptd,& - & pqd, puu, pvu, pud, pvd,& - & pmfu, pmfd, pmfus, pmfds, pmfuq,& - & pmfdq, pdmfup, pdmfdp, pdpmel, plu,& - & plude, klab) - implicit none -! m.tiedtke e.c.m.w.f. 12/89 -!***purpose -! ------- -! this routine interpolates large-scale fields of t,q etc. -! to half levels (i.e. grid for massflux scheme), -! and initializes values for updrafts and downdrafts -!***interface -! --------- -! this routine is called from *cumastr*. -!***method. -! -------- -! for extrapolation to half levels see tiedtke(1989) -!***externals -! --------- -! *cuadjtq* to specify qs at half levels -! ---------------------------------------------------------------- - integer klon,klev,klevp1,klevm1 - real(kind=kind_phys) pten(klon,klev), pqen(klon,klev),& - & puen(klon,klev), pven(klon,klev),& - & pqsen(klon,klev), pverv(klon,klev),& - & pgeo(klon,klev), pgeoh(klon,klevp1),& - & paph(klon,klevp1), ptenh(klon,klev),& - & pqenh(klon,klev), pqsenh(klon,klev) - real(kind=kind_phys) ptu(klon,klev), pqu(klon,klev),& - & ptd(klon,klev), pqd(klon,klev),& - & puu(klon,klev), pud(klon,klev),& - & pvu(klon,klev), pvd(klon,klev),& - & pmfu(klon,klev), pmfd(klon,klev),& - & pmfus(klon,klev), pmfds(klon,klev),& - & pmfuq(klon,klev), pmfdq(klon,klev),& - & pdmfup(klon,klev), pdmfdp(klon,klev),& - & plu(klon,klev), plude(klon,klev) - real(kind=kind_phys) zwmax(klon), zph(klon), & - & pdpmel(klon,klev) - integer klab(klon,klev), klwmin(klon) - logical loflag(klon) -! local variables - integer jl,jk - integer icall,ik - real(kind=kind_phys) zzs -!------------------------------------------------------------ -!* 1. specify large scale parameters at half levels -!* adjust temperature fields if staticly unstable -!* find level of maximum vertical velocity -! ----------------------------------------------------------- - do jk=2,klev - do jl=1,klon - ptenh(jl,jk)=(max(cpd*pten(jl,jk-1)+pgeo(jl,jk-1), & - & cpd*pten(jl,jk)+pgeo(jl,jk))-pgeoh(jl,jk))*rcpd - pqenh(jl,jk) = pqen(jl,jk-1) - pqsenh(jl,jk)= pqsen(jl,jk-1) - zph(jl)=paph(jl,jk) - loflag(jl)=.true. - end do - - if ( jk >= klev-1 .or. jk < 2 ) cycle - ik=jk - icall=0 - call cuadjtqn(klon,klev,ik,zph,ptenh,pqsenh,loflag,icall) - do jl=1,klon - pqenh(jl,jk)=min(pqen(jl,jk-1),pqsen(jl,jk-1)) & - & +(pqsenh(jl,jk)-pqsen(jl,jk-1)) - pqenh(jl,jk)=max(pqenh(jl,jk),0.) - end do - end do - - do jl=1,klon - ptenh(jl,klev)=(cpd*pten(jl,klev)+pgeo(jl,klev)- & - & pgeoh(jl,klev))*rcpd - pqenh(jl,klev)=pqen(jl,klev) - ptenh(jl,1)=pten(jl,1) - pqenh(jl,1)=pqen(jl,1) - klwmin(jl)=klev - zwmax(jl)=0. - end do - - do jk=klevm1,2,-1 - do jl=1,klon - zzs=max(cpd*ptenh(jl,jk)+pgeoh(jl,jk), & - & cpd*ptenh(jl,jk+1)+pgeoh(jl,jk+1)) - ptenh(jl,jk)=(zzs-pgeoh(jl,jk))*rcpd - end do - end do - - do jk=klev,3,-1 - do jl=1,klon - if(pverv(jl,jk).lt.zwmax(jl)) then - zwmax(jl)=pverv(jl,jk) - klwmin(jl)=jk - end if - end do - end do -!----------------------------------------------------------- -!* 2.0 initialize values for updrafts and downdrafts -!----------------------------------------------------------- - do jk=1,klev - ik=jk-1 - if(jk.eq.1) ik=1 - do jl=1,klon - ptu(jl,jk)=ptenh(jl,jk) - ptd(jl,jk)=ptenh(jl,jk) - pqu(jl,jk)=pqenh(jl,jk) - pqd(jl,jk)=pqenh(jl,jk) - plu(jl,jk)=0. - puu(jl,jk)=puen(jl,ik) - pud(jl,jk)=puen(jl,ik) - pvu(jl,jk)=pven(jl,ik) - pvd(jl,jk)=pven(jl,ik) - klab(jl,jk)=0 - end do - end do - return - end subroutine cuinin - -!--------------------------------------------------------- -! level 3 souroutines -!-------------------------------------------------------- - subroutine cutypen & - & ( klon, klev, klevp1, klevm1, pqen,& - & ptenh, pqenh, pqsenh, pgeoh, paph,& - & hfx, qfx, pgeo, pqsen, pap,& - & pten, lndj, cutu, cuqu, culab,& - & ldcum, cubot, cutop, ktype, wbase, culu, kdpl ) -! zhang & wang iprc 2011-2013 -!***purpose. -! -------- -! to produce first guess updraught for cu-parameterizations -! calculates condensation level, and sets updraught base variables and -! first guess cloud type -!***interface -! --------- -! this routine is called from *cumastr*. -! input are environm. values of t,q,p,phi at half levels. -! it returns cloud types as follows; -! ktype=1 for deep cumulus -! ktype=2 for shallow cumulus -!***method. -! -------- -! based on a simplified updraught equation -! partial(hup)/partial(z)=eta(h - hup) -! eta is the entrainment rate for test parcel -! h stands for dry static energy or the total water specific humidity -! references: christian jakob, 2003: a new subcloud model for -! mass-flux convection schemes -! influence on triggering, updraft properties, and model -! climate, mon.wea.rev. -! 131, 2765-2778 -! and -! ifs documentation - cy36r1,cy38r1 -!***input variables: -! ptenh [ztenh] - environment temperature on half levels. (cuini) -! pqenh [zqenh] - env. specific humidity on half levels. (cuini) -! pgeoh [zgeoh] - geopotential on half levels, (mssflx) -! paph - pressure of half levels. (mssflx) -! rho - density of the lowest model level -! qfx - net upward moisture flux at the surface (kg/m^2/s) -! hfx - net upward heat flux at the surface (w/m^2) -!***variables output by cutype: -! ktype - convection type - 1: penetrative (cumastr) -! 2: stratocumulus (cumastr) -! 3: mid-level (cuasc) -! information for updraft parcel (ptu,pqu,plu,kcbot,klab,kdpl...) -! ---------------------------------------------------------------- -!------------------------------------------------------------------- - implicit none -!------------------------------------------------------------------- - integer klon, klev, klevp1, klevm1 - real(kind=kind_phys) ptenh(klon,klev), pqenh(klon,klev),& - & pqsen(klon,klev), pqsenh(klon,klev),& - & pgeoh(klon,klevp1), paph(klon,klevp1),& - & pap(klon,klev), pqen(klon,klev) - real(kind=kind_phys) pten(klon,klev) - real(kind=kind_phys) ptu(klon,klev),pqu(klon,klev),plu(klon,klev) - real(kind=kind_phys) pgeo(klon,klev) - integer klab(klon,klev) - integer kctop(klon),kcbot(klon) - - real(kind=kind_phys) qfx(klon),hfx(klon) - real(kind=kind_phys) zph(klon) - integer lndj(klon) - logical loflag(klon), deepflag(klon), resetflag(klon) - -! output variables - real(kind=kind_phys) cutu(klon,klev), cuqu(klon,klev), culu(klon,klev) - integer culab(klon,klev) - real(kind=kind_phys) wbase(klon) - integer ktype(klon),cubot(klon),cutop(klon),kdpl(klon) - logical ldcum(klon) - -! local variables - real(kind=kind_phys) zqold(klon) - real(kind=kind_phys) rho, part1, part2, root, conw, deltt, deltq - real(kind=kind_phys) eta(klon),dz(klon),coef(klon) - real(kind=kind_phys) dhen(klon,klev), dh(klon,klev) - real(kind=kind_phys) plude(klon,klev) - real(kind=kind_phys) kup(klon,klev) - real(kind=kind_phys) vptu(klon,klev),vten(klon,klev) - real(kind=kind_phys) zbuo(klon,klev),abuoy(klon,klev) - - real(kind=kind_phys) zz,zdken,zdq - real(kind=kind_phys) fscale,crirh1,pp - real(kind=kind_phys) atop1,atop2,abot - real(kind=kind_phys) tmix,zmix,qmix,pmix - real(kind=kind_phys) zlglac,dp - integer nk,is,ikb,ikt - - real(kind=kind_phys) zqsu,zcor,zdp,zesdp,zalfaw,zfacw,zfaci,zfac,zdsdp,zdqsdt,zdtdp - real(kind=kind_phys) zpdifftop, zpdiffbot - integer zcbase(klon), itoppacel(klon) - integer jl,jk,ik,icall,levels - logical needreset, lldcum(klon) -!-------------------------------------------------------------- - do jl=1,klon - kcbot(jl)=klev - kctop(jl)=klev - kdpl(jl) =klev - ktype(jl)=0 - wbase(jl)=0. - ldcum(jl)=.false. - end do - -!----------------------------------------------------------- -! let's do test,and check the shallow convection first -! the first level is klev -! define deltat and deltaq -!----------------------------------------------------------- - do jk=1,klev - do jl=1,klon - plu(jl,jk)=culu(jl,jk) ! parcel liquid water - ptu(jl,jk)=cutu(jl,jk) ! parcel temperature - pqu(jl,jk)=cuqu(jl,jk) ! parcel specific humidity - klab(jl,jk)=culab(jl,jk) - dh(jl,jk)=0.0 ! parcel dry static energy - dhen(jl,jk)=0.0 ! environment dry static energy - kup(jl,jk)=0.0 ! updraught kinetic energy for parcel - vptu(jl,jk)=0.0 ! parcel virtual temperature considering water-loading - vten(jl,jk)=0.0 ! environment virtual temperature - zbuo(jl,jk)=0.0 ! parcel buoyancy - abuoy(jl,jk)=0.0 - end do - end do - - do jl=1,klon - zqold(jl) = 0. - lldcum(jl) = .false. - loflag(jl) = .true. - end do - -! check the levels from lowest level to second top level - do jk=klevm1,2,-1 - -! define the variables at the first level - if(jk .eq. klevm1) then - do jl=1,klon - rho=pap(jl,klev)/ & - & (rd*(pten(jl,klev)*(1.+vtmpc1*pqen(jl,klev)))) - hfx(jl) = hfx(jl)*rho*cpd - qfx(jl) = qfx(jl)*rho - part1 = 1.5*0.4*pgeo(jl,klev)/ & - & (rho*pten(jl,klev)) - part2 = -hfx(jl)*rcpd-vtmpc1*pten(jl,klev)*qfx(jl) - root = 0.001-part1*part2 - if(part2 .lt. 0.) then - conw = 1.2*(root)**t13 - deltt = max(1.5*hfx(jl)/(rho*cpd*conw),0.) - deltq = max(1.5*qfx(jl)/(rho*conw),0.) - kup(jl,klev) = 0.5*(conw**2) - pqu(jl,klev)= pqenh(jl,klev) + deltq - dhen(jl,klev)= pgeoh(jl,klev) + ptenh(jl,klev)*cpd - dh(jl,klev) = dhen(jl,klev) + deltt*cpd - ptu(jl,klev) = (dh(jl,klev)-pgeoh(jl,klev))*rcpd - vptu(jl,klev)=ptu(jl,klev)*(1.+vtmpc1*pqu(jl,klev)) - vten(jl,klev)=ptenh(jl,klev)*(1.+vtmpc1*pqenh(jl,klev)) - zbuo(jl,klev)=(vptu(jl,klev)-vten(jl,klev))/vten(jl,klev) - klab(jl,klev) = 1 - else - loflag(jl) = .false. - end if - end do - end if - - is=0 - do jl=1,klon - if(loflag(jl))then - is=is+1 - endif - enddo - if(is.eq.0) exit - -! the next levels, we use the variables at the first level as initial values - do jl=1,klon - if(loflag(jl)) then - eta(jl) = 0.55/(pgeo(jl,jk)*zrg)+1.e-4 - dz(jl) = (pgeoh(jl,jk)-pgeoh(jl,jk+1))*zrg - coef(jl)= 0.5*eta(jl)*dz(jl) - dhen(jl,jk) = pgeoh(jl,jk) + cpd*ptenh(jl,jk) - dh(jl,jk) = (coef(jl)*(dhen(jl,jk+1)+dhen(jl,jk))& - & +(1.-coef(jl))*dh(jl,jk+1))/(1.+coef(jl)) - pqu(jl,jk) =(coef(jl)*(pqenh(jl,jk+1)+pqenh(jl,jk))& - & +(1.-coef(jl))*pqu(jl,jk+1))/(1.+coef(jl)) - ptu(jl,jk) = (dh(jl,jk)-pgeoh(jl,jk))*rcpd - zqold(jl) = pqu(jl,jk) - zph(jl)=paph(jl,jk) - end if - end do -! check if the parcel is saturated - ik=jk - icall=1 - call cuadjtqn(klon,klev,ik,zph,ptu,pqu,loflag,icall) - do jl=1,klon - if( loflag(jl) ) then - zdq = max((zqold(jl) - pqu(jl,jk)),0.) - plu(jl,jk) = plu(jl,jk+1) + zdq - zlglac=zdq*((1.-foealfa(ptu(jl,jk))) - & - (1.-foealfa(ptu(jl,jk+1)))) - plu(jl,jk) = min(plu(jl,jk),5.e-3) - dh(jl,jk) = pgeoh(jl,jk) + cpd*(ptu(jl,jk)+ralfdcp*zlglac) -! compute the updraft speed - vptu(jl,jk) = ptu(jl,jk)*(1.+vtmpc1*pqu(jl,jk)-plu(jl,jk))+& - ralfdcp*zlglac - vten(jl,jk) = ptenh(jl,jk)*(1.+vtmpc1*pqenh(jl,jk)) - zbuo(jl,jk) = (vptu(jl,jk) - vten(jl,jk))/vten(jl,jk) - abuoy(jl,jk)=(zbuo(jl,jk)+zbuo(jl,jk+1))*0.5*g - atop1 = 1.0 - 2.*coef(jl) - atop2 = 2.0*dz(jl)*abuoy(jl,jk) - abot = 1.0 + 2.*coef(jl) - kup(jl,jk) = (atop1*kup(jl,jk+1) + atop2) / abot - -! let's find the exact cloud base - if ( plu(jl,jk) > 0. .and. klab(jl,jk+1) == 1 ) then - ik = jk + 1 - zqsu = foeewm(ptu(jl,ik))/paph(jl,ik) - zqsu = min(0.5,zqsu) - zcor = 1./(1.-vtmpc1*zqsu) - zqsu = zqsu*zcor - zdq = min(0.,pqu(jl,ik)-zqsu) - zalfaw = foealfa(ptu(jl,ik)) - zfacw = c5les/((ptu(jl,ik)-c4les)**2) - zfaci = c5ies/((ptu(jl,ik)-c4ies)**2) - zfac = zalfaw*zfacw + (1.-zalfaw)*zfaci - zesdp = foeewm(ptu(jl,ik))/paph(jl,ik) - zcor = 1./(1.-vtmpc1*zesdp) - zdqsdt = zfac*zcor*zqsu - zdtdp = rd*ptu(jl,ik)/(cpd*paph(jl,ik)) - zdp = zdq/(zdqsdt*zdtdp) - zcbase(jl) = paph(jl,ik) + zdp -! chose nearest half level as cloud base (jk or jk+1) - zpdifftop = zcbase(jl) - paph(jl,jk) - zpdiffbot = paph(jl,jk+1) - zcbase(jl) - if ( zpdifftop > zpdiffbot .and. kup(jl,jk+1) > 0. ) then - ikb = min(klev-1,jk+1) - klab(jl,ikb) = 2 - klab(jl,jk) = 2 - kcbot(jl) = ikb - plu(jl,jk+1) = 1.0e-8 - else if ( zpdifftop <= zpdiffbot .and.kup(jl,jk) > 0. ) then - klab(jl,jk) = 2 - kcbot(jl) = jk - end if - end if - - if(kup(jl,jk) .lt. 0.)then - loflag(jl) = .false. - if(plu(jl,jk+1) .gt. 0.) then - kctop(jl) = jk - lldcum(jl) = .true. - else - lldcum(jl) = .false. - end if - else - if(plu(jl,jk) .gt. 0.)then - klab(jl,jk)=2 - else - klab(jl,jk)=1 - end if - end if - end if - end do - - end do ! end all the levels - - do jl=1,klon - ikb = kcbot(jl) - ikt = kctop(jl) - if(paph(jl,ikb) - paph(jl,ikt) > zdnoprc) lldcum(jl) = .false. - if(lldcum(jl)) then - ktype(jl) = 2 - ldcum(jl) = .true. - wbase(jl) = sqrt(max(2.*kup(jl,ikb),0.)) - cubot(jl) = ikb - cutop(jl) = ikt - kdpl(jl) = klev - else - cutop(jl) = -1 - cubot(jl) = -1 - kdpl(jl) = klev - 1 - ldcum(jl) = .false. - wbase(jl) = 0. - end if - end do - - do jk=klev,1,-1 - do jl=1,klon - ikt = kctop(jl) - if(jk .ge. ikt)then - culab(jl,jk) = klab(jl,jk) - cutu(jl,jk) = ptu(jl,jk) - cuqu(jl,jk) = pqu(jl,jk) - culu(jl,jk) = plu(jl,jk) - end if - end do - end do - -!----------------------------------------------------------- -! next, let's check the deep convection -! the first level is klevm1-1 -! define deltat and deltaq -!---------------------------------------------------------- -! we check the parcel starting level by level -! assume the mix-layer is 60hPa - deltt = 0.2 - deltq = 1.0e-4 - do jl=1,klon - deepflag(jl) = .false. - end do - - do jk=klev,1,-1 - do jl=1,klon - if((paph(jl,klev+1)-paph(jl,jk)) .lt. 350.e2) itoppacel(jl) = jk - end do - end do - - do levels=klevm1-1,klevm1-20,-1 ! loop starts - do jk=1,klev - do jl=1,klon - plu(jl,jk)=0.0 ! parcel liquid water - ptu(jl,jk)=0.0 ! parcel temperature - pqu(jl,jk)=0.0 ! parcel specific humidity - dh(jl,jk)=0.0 ! parcel dry static energy - dhen(jl,jk)=0.0 ! environment dry static energy - kup(jl,jk)=0.0 ! updraught kinetic energy for parcel - vptu(jl,jk)=0.0 ! parcel virtual temperature consideringwater-loading - vten(jl,jk)=0.0 ! environment virtual temperature - abuoy(jl,jk)=0.0 - zbuo(jl,jk)=0.0 - klab(jl,jk)=0 - end do - end do - - do jl=1,klon - kcbot(jl) = levels - kctop(jl) = levels - zqold(jl) = 0. - lldcum(jl) = .false. - resetflag(jl)= .false. - loflag(jl) = (.not. deepflag(jl)) .and. (levels.ge.itoppacel(jl)) - end do - -! start the inner loop to search the deep convection points - do jk=levels,2,-1 - is=0 - do jl=1,klon - if(loflag(jl))then - is=is+1 - endif - enddo - if(is.eq.0) exit - -! define the variables at the departure level - if(jk .eq. levels) then - do jl=1,klon - if(loflag(jl)) then - if((paph(jl,klev+1)-paph(jl,jk)) < 60.e2) then - tmix=0. - qmix=0. - zmix=0. - pmix=0. - do nk=jk+2,jk,-1 - if(pmix < 50.e2) then - dp = paph(jl,nk) - paph(jl,nk-1) - tmix=tmix+dp*ptenh(jl,nk) - qmix=qmix+dp*pqenh(jl,nk) - zmix=zmix+dp*pgeoh(jl,nk) - pmix=pmix+dp - end if - end do - tmix=tmix/pmix - qmix=qmix/pmix - zmix=zmix/pmix - else - tmix=ptenh(jl,jk+1) - qmix=pqenh(jl,jk+1) - zmix=pgeoh(jl,jk+1) - end if - - pqu(jl,jk+1) = qmix + deltq - dhen(jl,jk+1)= zmix + tmix*cpd - dh(jl,jk+1) = dhen(jl,jk+1) + deltt*cpd - ptu(jl,jk+1) = (dh(jl,jk+1)-pgeoh(jl,jk+1))*rcpd - kup(jl,jk+1) = 0.5 - klab(jl,jk+1)= 1 - vptu(jl,jk+1)=ptu(jl,jk+1)*(1.+vtmpc1*pqu(jl,jk+1)) - vten(jl,jk+1)=ptenh(jl,jk+1)*(1.+vtmpc1*pqenh(jl,jk+1)) - zbuo(jl,jk+1)=(vptu(jl,jk+1)-vten(jl,jk+1))/vten(jl,jk+1) - end if - end do - end if - -! the next levels, we use the variables at the first level as initial values - do jl=1,klon - if(loflag(jl)) then -! define the fscale - fscale = min(1.,(pqsen(jl,jk)/pqsen(jl,levels))**3) - eta(jl) = 1.75e-3*fscale - dz(jl) = (pgeoh(jl,jk)-pgeoh(jl,jk+1))*zrg - coef(jl)= 0.5*eta(jl)*dz(jl) - dhen(jl,jk) = pgeoh(jl,jk) + cpd*ptenh(jl,jk) - dh(jl,jk) = (coef(jl)*(dhen(jl,jk+1)+dhen(jl,jk))& - & +(1.-coef(jl))*dh(jl,jk+1))/(1.+coef(jl)) - pqu(jl,jk) =(coef(jl)*(pqenh(jl,jk+1)+pqenh(jl,jk))& - & +(1.-coef(jl))*pqu(jl,jk+1))/(1.+coef(jl)) - ptu(jl,jk) = (dh(jl,jk)-pgeoh(jl,jk))*rcpd - zqold(jl) = pqu(jl,jk) - zph(jl)=paph(jl,jk) - end if - end do -! check if the parcel is saturated - ik=jk - icall=1 - call cuadjtqn(klon,klev,ik,zph,ptu,pqu,loflag,icall) - - do jl=1,klon - if( loflag(jl) ) then - zdq = max((zqold(jl) - pqu(jl,jk)),0.) - plu(jl,jk) = plu(jl,jk+1) + zdq - zlglac=zdq*((1.-foealfa(ptu(jl,jk))) - & - (1.-foealfa(ptu(jl,jk+1)))) - plu(jl,jk) = 0.5*plu(jl,jk) - dh(jl,jk) = pgeoh(jl,jk) + cpd*(ptu(jl,jk)+ralfdcp*zlglac) -! compute the updraft speed - vptu(jl,jk) = ptu(jl,jk)*(1.+vtmpc1*pqu(jl,jk)-plu(jl,jk))+& - ralfdcp*zlglac - vten(jl,jk) = ptenh(jl,jk)*(1.+vtmpc1*pqenh(jl,jk)) - zbuo(jl,jk) = (vptu(jl,jk) - vten(jl,jk))/vten(jl,jk) - abuoy(jl,jk)=(zbuo(jl,jk)+zbuo(jl,jk+1))*0.5*g - atop1 = 1.0 - 2.*coef(jl) - atop2 = 2.0*dz(jl)*abuoy(jl,jk) - abot = 1.0 + 2.*coef(jl) - kup(jl,jk) = (atop1*kup(jl,jk+1) + atop2) / abot -! let's find the exact cloud base - if ( plu(jl,jk) > 0. .and. klab(jl,jk+1) == 1 ) then - ik = jk + 1 - zqsu = foeewm(ptu(jl,ik))/paph(jl,ik) - zqsu = min(0.5,zqsu) - zcor = 1./(1.-vtmpc1*zqsu) - zqsu = zqsu*zcor - zdq = min(0.,pqu(jl,ik)-zqsu) - zalfaw = foealfa(ptu(jl,ik)) - zfacw = c5les/((ptu(jl,ik)-c4les)**2) - zfaci = c5ies/((ptu(jl,ik)-c4ies)**2) - zfac = zalfaw*zfacw + (1.-zalfaw)*zfaci - zesdp = foeewm(ptu(jl,ik))/paph(jl,ik) - zcor = 1./(1.-vtmpc1*zesdp) - zdqsdt = zfac*zcor*zqsu - zdtdp = rd*ptu(jl,ik)/(cpd*paph(jl,ik)) - zdp = zdq/(zdqsdt*zdtdp) - zcbase(jl) = paph(jl,ik) + zdp -! chose nearest half level as cloud base (jk or jk+1) - zpdifftop = zcbase(jl) - paph(jl,jk) - zpdiffbot = paph(jl,jk+1) - zcbase(jl) - if ( zpdifftop > zpdiffbot .and. kup(jl,jk+1) > 0. ) then - ikb = min(klev-1,jk+1) - klab(jl,ikb) = 2 - klab(jl,jk) = 2 - kcbot(jl) = ikb - plu(jl,jk+1) = 1.0e-8 - else if ( zpdifftop <= zpdiffbot .and.kup(jl,jk) > 0. ) then - klab(jl,jk) = 2 - kcbot(jl) = jk - end if - end if - - if(kup(jl,jk) .lt. 0.)then - loflag(jl) = .false. - if(plu(jl,jk+1) .gt. 0.) then - kctop(jl) = jk - lldcum(jl) = .true. - else - lldcum(jl) = .false. - end if - else - if(plu(jl,jk) .gt. 0.)then - klab(jl,jk)=2 - else - klab(jl,jk)=1 - end if - end if - end if - end do - - end do ! end all the levels - - needreset = .false. - do jl=1,klon - ikb = kcbot(jl) - ikt = kctop(jl) - if(paph(jl,ikb) - paph(jl,ikt) < zdnoprc) lldcum(jl) = .false. - if(lldcum(jl)) then - ktype(jl) = 1 - ldcum(jl) = .true. - deepflag(jl) = .true. - wbase(jl) = sqrt(max(2.*kup(jl,ikb),0.)) - cubot(jl) = ikb - cutop(jl) = ikt - kdpl(jl) = levels+1 - needreset = .true. - resetflag(jl)= .true. - end if - end do - - if(needreset) then - do jk=klev,1,-1 - do jl=1,klon - if(resetflag(jl)) then - ikt = kctop(jl) - ikb = kdpl(jl) - if(jk .le. ikb .and. jk .ge. ikt )then - culab(jl,jk) = klab(jl,jk) - cutu(jl,jk) = ptu(jl,jk) - cuqu(jl,jk) = pqu(jl,jk) - culu(jl,jk) = plu(jl,jk) - else - culab(jl,jk) = 1 - cutu(jl,jk) = ptenh(jl,jk) - cuqu(jl,jk) = pqenh(jl,jk) - culu(jl,jk) = 0. - end if - if ( jk .lt. ikt ) culab(jl,jk) = 0 - end if - end do - end do - end if - - end do ! end all cycles - - return - end subroutine cutypen - -!----------------------------------------------------------------- -! level 3 subroutines 'cuascn' -!----------------------------------------------------------------- - subroutine cuascn & - & (klon, klev, klevp1, klevm1, ptenh,& - & pqenh, puen, pven, pten, pqen,& - & pqsen, pgeo, pgeoh, pap, paph,& - & pqte, pverv, klwmin, ldcum, phcbase,& - & ktype, klab, ptu, pqu, plu,& - & puu, pvu, pmfu, pmfub, & - & pmfus, pmfuq, pmful, plude, pdmfup,& - & kcbot, kctop, kctop0, kcum, ztmst,& - & pqsenh, plglac, lndj, wup, wbase, kdpl, pmfude_rate) - implicit none -! this routine does the calculations for cloud ascents -! for cumulus parameterization -! m.tiedtke e.c.m.w.f. 7/86 modif. 12/89 -! y.wang iprc 11/01 modif. -! c.zhang iprc 05/12 modif. -!***purpose. -! -------- -! to produce cloud ascents for cu-parametrization -! (vertical profiles of t,q,l,u and v and corresponding -! fluxes as well as precipitation rates) -!***interface -! --------- -! this routine is called from *cumastr*. -!***method. -! -------- -! lift surface air dry-adiabatically to cloud base -! and then calculate moist ascent for -! entraining/detraining plume. -! entrainment and detrainment rates differ for -! shallow and deep cumulus convection. -! in case there is no penetrative or shallow convection -! check for possibility of mid level convection -! (cloud base values calculated in *cubasmc*) -!***externals -! --------- -! *cuadjtqn* adjust t and q due to condensation in ascent -! *cuentrn* calculate entrainment/detrainment rates -! *cubasmcn* calculate cloud base values for midlevel convection -!***reference -! --------- -! (tiedtke,1989) -!***input variables: -! ptenh [ztenh] - environ temperature on half levels. (cuini) -! pqenh [zqenh] - env. specific humidity on half levels. (cuini) -! puen - environment wind u-component. (mssflx) -! pven - environment wind v-component. (mssflx) -! pten - environment temperature. (mssflx) -! pqen - environment specific humidity. (mssflx) -! pqsen - environment saturation specific humidity. (mssflx) -! pgeo - geopotential. (mssflx) -! pgeoh [zgeoh] - geopotential on half levels, (mssflx) -! pap - pressure in pa. (mssflx) -! paph - pressure of half levels. (mssflx) -! pqte - moisture convergence (delta q/delta t). (mssflx) -! pverv - large scale vertical velocity (omega). (mssflx) -! klwmin [ilwmin] - level of minimum omega. (cuini) -! klab [ilab] - level label - 1: sub-cloud layer. -! 2: condensation level (cloud base) -! pmfub [zmfub] - updraft mass flux at cloud base. (cumastr) -!***variables modified by cuasc: -! ldcum - logical denoting profiles. (cubase) -! ktype - convection type - 1: penetrative (cumastr) -! 2: stratocumulus (cumastr) -! 3: mid-level (cuasc) -! ptu - cloud temperature. -! pqu - cloud specific humidity. -! plu - cloud liquid water (moisture condensed out) -! puu [zuu] - cloud momentum u-component. -! pvu [zvu] - cloud momentum v-component. -! pmfu - updraft mass flux. -! pmfus [zmfus] - updraft flux of dry static energy. (cubasmc) -! pmfuq [zmfuq] - updraft flux of specific humidity. -! pmful [zmful] - updraft flux of cloud liquid water. -! plude - liquid water returned to environment by detrainment. -! pdmfup [zmfup] - -! kcbot - cloud base level. (cubase) -! kctop - cloud top level -! kctop0 [ictop0] - estimate of cloud top. (cumastr) -! kcum [icum] - flag to control the call - - integer klev,klon,klevp1,klevm1 - real(kind=kind_phys) ptenh(klon,klev), pqenh(klon,klev), & - & puen(klon,klev), pven(klon,klev),& - & pten(klon,klev), pqen(klon,klev),& - & pgeo(klon,klev), pgeoh(klon,klevp1),& - & pap(klon,klev), paph(klon,klevp1),& - & pqsen(klon,klev), pqte(klon,klev),& - & pverv(klon,klev), pqsenh(klon,klev) - real(kind=kind_phys) ptu(klon,klev), pqu(klon,klev),& - & puu(klon,klev), pvu(klon,klev),& - & pmfu(klon,klev), zph(klon),& - & pmfub(klon), & - & pmfus(klon,klev), pmfuq(klon,klev),& - & plu(klon,klev), plude(klon,klev),& - & pmful(klon,klev), pdmfup(klon,klev) - real(kind=kind_phys) zdmfen(klon), zdmfde(klon),& - & zmfuu(klon), zmfuv(klon),& - & zpbase(klon), zqold(klon) - real(kind=kind_phys) phcbase(klon), zluold(klon) - real(kind=kind_phys) zprecip(klon), zlrain(klon,klev) - real(kind=kind_phys) zbuo(klon,klev), kup(klon,klev) - real(kind=kind_phys) wup(klon) - real(kind=kind_phys) wbase(klon), zodetr(klon,klev) - real(kind=kind_phys) plglac(klon,klev) - - real(kind=kind_phys) eta(klon),dz(klon) - - integer klwmin(klon), ktype(klon),& - & klab(klon,klev), kcbot(klon),& - & kctop(klon), kctop0(klon) - integer lndj(klon) - logical ldcum(klon), loflag(klon) - logical llo2,llo3, llo1(klon) - - integer kdpl(klon) - real(kind=kind_phys) zoentr(klon), zdpmean(klon) - real(kind=kind_phys) pdmfen(klon,klev), pmfude_rate(klon,klev) -! local variables - integer jl,jk - integer ikb,icum,itopm2,ik,icall,is,kcum,jlm,jll - integer jlx(klon) - real(kind=kind_phys) ztmst,zcons2,zfacbuo,zprcdgw,z_cwdrag,z_cldmax,z_cwifrac,z_cprc2 - real(kind=kind_phys) zmftest,zmfmax,zqeen,zseen,zscde,zqude - real(kind=kind_phys) zmfusk,zmfuqk,zmfulk - real(kind=kind_phys) zbc,zbe,zkedke,zmfun,zwu,zprcon,zdt,zcbf,zzco - real(kind=kind_phys) zlcrit,zdfi,zc,zd,zint,zlnew,zvw,zvi,zalfaw,zrold - real(kind=kind_phys) zrnew,zz,zdmfeu,zdmfdu,dp - real(kind=kind_phys) zfac,zbuoc,zdkbuo,zdken,zvv,zarg,zchange,zxe,zxs,zdshrd - real(kind=kind_phys) atop1,atop2,abot -!-------------------------------- -!* 1. specify parameters -!-------------------------------- - zcons2=3./(g*ztmst) - zfacbuo = 0.5/(1.+0.5) - zprcdgw = cprcon*zrg - z_cldmax = 5.e-3 - z_cwifrac = 0.5 - z_cprc2 = 0.5 - z_cwdrag = (3.0/8.0)*0.506/0.2 -!--------------------------------- -! 2. set default values -!--------------------------------- - llo3 = .false. - do jl=1,klon - zluold(jl)=0. - wup(jl)=0. - zdpmean(jl)=0. - zoentr(jl)=0. - if(.not.ldcum(jl)) then - ktype(jl)=0 - kcbot(jl) = -1 - pmfub(jl) = 0. - pqu(jl,klev) = 0. - end if - end do - - ! initialize variout quantities - do jk=1,klev - do jl=1,klon - if(jk.ne.kcbot(jl)) plu(jl,jk)=0. - pmfu(jl,jk)=0. - pmfus(jl,jk)=0. - pmfuq(jl,jk)=0. - pmful(jl,jk)=0. - plude(jl,jk)=0. - plglac(jl,jk)=0. - pdmfup(jl,jk)=0. - zlrain(jl,jk)=0. - zbuo(jl,jk)=0. - kup(jl,jk)=0. - pdmfen(jl,jk) = 0. - pmfude_rate(jl,jk) = 0. - if(.not.ldcum(jl).or.ktype(jl).eq.3) klab(jl,jk)=0 - if(.not.ldcum(jl).and.paph(jl,jk).lt.4.e4) kctop0(jl)=jk - end do - end do - - do jl = 1,klon - if ( ktype(jl) == 3 ) ldcum(jl) = .false. - end do -!------------------------------------------------ -! 3.0 initialize values at cloud base level -!------------------------------------------------ - do jl=1,klon - kctop(jl)=kcbot(jl) - if(ldcum(jl)) then - ikb = kcbot(jl) - kup(jl,ikb) = 0.5*wbase(jl)**2 - pmfu(jl,ikb) = pmfub(jl) - pmfus(jl,ikb) = pmfub(jl)*(cpd*ptu(jl,ikb)+pgeoh(jl,ikb)) - pmfuq(jl,ikb) = pmfub(jl)*pqu(jl,ikb) - pmful(jl,ikb) = pmfub(jl)*plu(jl,ikb) - end if - end do -! -!----------------------------------------------------------------- -! 4. do ascent: subcloud layer (klab=1) ,clouds (klab=2) -! by doing first dry-adiabatic ascent and then -! by adjusting t,q and l accordingly in *cuadjtqn*, -! then check for buoyancy and set flags accordingly -!----------------------------------------------------------------- -! - do jk=klevm1,3,-1 -! specify cloud base values for midlevel convection -! in *cubasmc* in case there is not already convection -! --------------------------------------------------------------------- - ik=jk - call cubasmcn& - & (klon, klev, klevm1, ik, pten,& - & pqen, pqsen, puen, pven, pverv,& - & pgeo, pgeoh, ldcum, ktype, klab, zlrain,& - & pmfu, pmfub, kcbot, ptu,& - & pqu, plu, puu, pvu, pmfus,& - & pmfuq, pmful, pdmfup) - is = 0 - jlm = 0 - do jl = 1,klon - loflag(jl) = .false. - zprecip(jl) = 0. - llo1(jl) = .false. - is = is + klab(jl,jk+1) - if ( klab(jl,jk+1) == 0 ) klab(jl,jk) = 0 - if ( (ldcum(jl) .and. klab(jl,jk+1) == 2) .or. & - (ktype(jl) == 3 .and. klab(jl,jk+1) == 1) ) then - loflag(jl) = .true. - jlm = jlm + 1 - jlx(jlm) = jl - end if - zph(jl) = paph(jl,jk) - if ( ktype(jl) == 3 .and. jk == kcbot(jl) ) then - zmfmax = (paph(jl,jk)-paph(jl,jk-1))*zcons2 - if ( pmfub(jl) > zmfmax ) then - zfac = zmfmax/pmfub(jl) - pmfu(jl,jk+1) = pmfu(jl,jk+1)*zfac - pmfus(jl,jk+1) = pmfus(jl,jk+1)*zfac - pmfuq(jl,jk+1) = pmfuq(jl,jk+1)*zfac - pmfub(jl) = zmfmax - end if - pmfub(jl)=min(pmfub(jl),zmfmax) - end if - end do - - if(is.gt.0) llo3 = .true. -! -!* specify entrainment rates in *cuentr* -! ------------------------------------- - ik=jk - call cuentrn(klon,klev,ik,kcbot,ldcum,llo3, & - pgeoh,pmfu,zdmfen,zdmfde) -! -! do adiabatic ascent for entraining/detraining plume - if(llo3) then -! ------------------------------------------------------- -! - do jl = 1,klon - zqold(jl) = 0. - end do - do jll = 1 , jlm - jl = jlx(jll) - zdmfde(jl) = min(zdmfde(jl),0.75*pmfu(jl,jk+1)) - if ( jk == kcbot(jl) ) then - zoentr(jl) = -1.75e-3*(min(1.,pqen(jl,jk)/pqsen(jl,jk)) - & - 1.)*(pgeoh(jl,jk)-pgeoh(jl,jk+1))*zrg - zoentr(jl) = min(0.4,zoentr(jl))*pmfu(jl,jk+1) - end if - if ( jk < kcbot(jl) ) then - zmfmax = (paph(jl,jk)-paph(jl,jk-1))*zcons2 - zxs = max(pmfu(jl,jk+1)-zmfmax,0.) - wup(jl) = wup(jl) + kup(jl,jk+1)*(pap(jl,jk+1)-pap(jl,jk)) - zdpmean(jl) = zdpmean(jl) + pap(jl,jk+1) - pap(jl,jk) - zdmfen(jl) = zoentr(jl) - if ( ktype(jl) >= 2 ) then - zdmfen(jl) = 2.0*zdmfen(jl) - zdmfde(jl) = zdmfen(jl) - end if - zdmfde(jl) = zdmfde(jl) * & - (1.6-min(1.,pqen(jl,jk)/pqsen(jl,jk))) - zmftest = pmfu(jl,jk+1) + zdmfen(jl) - zdmfde(jl) - zchange = max(zmftest-zmfmax,0.) - zxe = max(zchange-zxs,0.) - zdmfen(jl) = zdmfen(jl) - zxe - zchange = zchange - zxe - zdmfde(jl) = zdmfde(jl) + zchange - end if - pdmfen(jl,jk) = zdmfen(jl) - zdmfde(jl) - pmfu(jl,jk) = pmfu(jl,jk+1) + zdmfen(jl) - zdmfde(jl) - zqeen = pqenh(jl,jk+1)*zdmfen(jl) - zseen = (cpd*ptenh(jl,jk+1)+pgeoh(jl,jk+1))*zdmfen(jl) - zscde = (cpd*ptu(jl,jk+1)+pgeoh(jl,jk+1))*zdmfde(jl) - zqude = pqu(jl,jk+1)*zdmfde(jl) - plude(jl,jk) = plu(jl,jk+1)*zdmfde(jl) - zmfusk = pmfus(jl,jk+1) + zseen - zscde - zmfuqk = pmfuq(jl,jk+1) + zqeen - zqude - zmfulk = pmful(jl,jk+1) - plude(jl,jk) - plu(jl,jk) = zmfulk*(1./max(cmfcmin,pmfu(jl,jk))) - pqu(jl,jk) = zmfuqk*(1./max(cmfcmin,pmfu(jl,jk))) - ptu(jl,jk) = (zmfusk * & - (1./max(cmfcmin,pmfu(jl,jk)))-pgeoh(jl,jk))*rcpd - ptu(jl,jk) = max(100.,ptu(jl,jk)) - ptu(jl,jk) = min(400.,ptu(jl,jk)) - zqold(jl) = pqu(jl,jk) - zlrain(jl,jk) = zlrain(jl,jk+1)*(pmfu(jl,jk+1)-zdmfde(jl)) * & - (1./max(cmfcmin,pmfu(jl,jk))) - zluold(jl) = plu(jl,jk) - end do -! reset to environmental values if below departure level - do jl = 1,klon - if ( jk > kdpl(jl) ) then - ptu(jl,jk) = ptenh(jl,jk) - pqu(jl,jk) = pqenh(jl,jk) - plu(jl,jk) = 0. - zluold(jl) = plu(jl,jk) - end if - end do -!* do corrections for moist ascent -!* by adjusting t,q and l in *cuadjtq* -!------------------------------------------------ - ik=jk - icall=1 -! - if ( jlm > 0 ) then - call cuadjtqn(klon,klev,ik,zph,ptu,pqu,loflag,icall) - end if -! compute the upfraft speed in cloud layer - do jll = 1 , jlm - jl = jlx(jll) - if ( pqu(jl,jk) /= zqold(jl) ) then - plglac(jl,jk) = plu(jl,jk) * & - ((1.-foealfa(ptu(jl,jk)))- & - (1.-foealfa(ptu(jl,jk+1)))) - ptu(jl,jk) = ptu(jl,jk) + ralfdcp*plglac(jl,jk) - end if - end do - do jll = 1 , jlm - jl = jlx(jll) - if ( pqu(jl,jk) /= zqold(jl) ) then - klab(jl,jk) = 2 - plu(jl,jk) = plu(jl,jk) + zqold(jl) - pqu(jl,jk) - zbc = ptu(jl,jk)*(1.+vtmpc1*pqu(jl,jk)-plu(jl,jk+1) - & - zlrain(jl,jk+1)) - zbe = ptenh(jl,jk)*(1.+vtmpc1*pqenh(jl,jk)) - zbuo(jl,jk) = zbc - zbe -! set flags for the case of midlevel convection - if ( ktype(jl) == 3 .and. klab(jl,jk+1) == 1 ) then - if ( zbuo(jl,jk) > -0.5 ) then - ldcum(jl) = .true. - kctop(jl) = jk - kup(jl,jk) = 0.5 - else - klab(jl,jk) = 0 - pmfu(jl,jk) = 0. - plude(jl,jk) = 0. - plu(jl,jk) = 0. - end if - end if - if ( klab(jl,jk+1) == 2 ) then - if ( zbuo(jl,jk) < 0. ) then - ptenh(jl,jk) = 0.5*(pten(jl,jk)+pten(jl,jk-1)) - pqenh(jl,jk) = 0.5*(pqen(jl,jk)+pqen(jl,jk-1)) - zbuo(jl,jk) = zbc - ptenh(jl,jk)*(1.+vtmpc1*pqenh(jl,jk)) - end if - zbuoc = (zbuo(jl,jk) / & - (ptenh(jl,jk)*(1.+vtmpc1*pqenh(jl,jk)))+zbuo(jl,jk+1) / & - (ptenh(jl,jk+1)*(1.+vtmpc1*pqenh(jl,jk+1))))*0.5 - zdkbuo = (pgeoh(jl,jk)-pgeoh(jl,jk+1))*zfacbuo*zbuoc -! mixing and "pressure" gradient term in upper troposphere - if ( zdmfen(jl) > 0. ) then - zdken = min(1.,(1.+z_cwdrag)*zdmfen(jl) / & - max(cmfcmin,pmfu(jl,jk+1))) - else - zdken = min(1.,(1.+z_cwdrag)*zdmfde(jl) / & - max(cmfcmin,pmfu(jl,jk+1))) - end if - kup(jl,jk) = (kup(jl,jk+1)*(1.-zdken)+zdkbuo) / & - (1.+zdken) - if ( zbuo(jl,jk) < 0. ) then - zkedke = kup(jl,jk)/max(1.e-10,kup(jl,jk+1)) - zkedke = max(0.,min(1.,zkedke)) - zmfun = sqrt(zkedke)*pmfu(jl,jk+1) !* (1.6-min(1.,pqen(jl,jk) / & - ! pqsen(jl,jk))) - zdmfde(jl) = max(zdmfde(jl),pmfu(jl,jk+1)-zmfun) - plude(jl,jk) = plu(jl,jk+1)*zdmfde(jl) - pmfu(jl,jk) = pmfu(jl,jk+1) + zdmfen(jl) - zdmfde(jl) - end if - if ( zbuo(jl,jk) > -0.2 ) then - ikb = kcbot(jl) - zoentr(jl) = 1.75e-3*(0.3-(min(1.,pqen(jl,jk-1) / & - pqsen(jl,jk-1))-1.))*(pgeoh(jl,jk-1)-pgeoh(jl,jk)) * & - zrg*min(1.,pqsen(jl,jk)/pqsen(jl,ikb))**3 - zoentr(jl) = min(0.4,zoentr(jl))*pmfu(jl,jk) - else - zoentr(jl) = 0. - end if -! erase values if below departure level - if ( jk > kdpl(jl) ) then - pmfu(jl,jk) = pmfu(jl,jk+1) - kup(jl,jk) = 0.5 - end if - if ( kup(jl,jk) > 0. .and. pmfu(jl,jk) > 0. ) then - kctop(jl) = jk - llo1(jl) = .true. - else - klab(jl,jk) = 0 - pmfu(jl,jk) = 0. - kup(jl,jk) = 0. - zdmfde(jl) = pmfu(jl,jk+1) - plude(jl,jk) = plu(jl,jk+1)*zdmfde(jl) - end if -! save detrainment rates for updraught - if ( pmfu(jl,jk+1) > 0. ) pmfude_rate(jl,jk) = zdmfde(jl) - end if - else if ( ktype(jl) == 2 .and. pqu(jl,jk) == zqold(jl) ) then - klab(jl,jk) = 0 - pmfu(jl,jk) = 0. - kup(jl,jk) = 0. - zdmfde(jl) = pmfu(jl,jk+1) - plude(jl,jk) = plu(jl,jk+1)*zdmfde(jl) - pmfude_rate(jl,jk) = zdmfde(jl) - end if - end do - - do jl = 1,klon - if ( llo1(jl) ) then -! conversions only proceeds if plu is greater than a threshold liquid water -! content of 0.3 g/kg over water and 0.5 g/kg over land to prevent precipitation -! generation from small water contents. - if ( lndj(jl).eq.1 ) then - zdshrd = 5.e-4 - else - zdshrd = 3.e-4 - end if - ikb=kcbot(jl) - if ( plu(jl,jk) > zdshrd )then -! if ((paph(jl,ikb)-paph(jl,jk))>zdnoprc) then - zwu = min(15.0,sqrt(2.*max(0.1,kup(jl,jk+1)))) - zprcon = zprcdgw/(0.75*zwu) -! PARAMETERS FOR BERGERON-FINDEISEN PROCESS (T < -5C) - zdt = min(rtber-rtice,max(rtber-ptu(jl,jk),0.)) - zcbf = 1. + z_cprc2*sqrt(zdt) - zzco = zprcon*zcbf - zlcrit = zdshrd/zcbf - zdfi = pgeoh(jl,jk) - pgeoh(jl,jk+1) - zc = (plu(jl,jk)-zluold(jl)) - zarg = (plu(jl,jk)/zlcrit)**2 - if ( zarg < 25.0 ) then - zd = zzco*(1.-exp(-zarg))*zdfi - else - zd = zzco*zdfi - end if - zint = exp(-zd) - zlnew = zluold(jl)*zint + zc/zd*(1.-zint) - zlnew = max(0.,min(plu(jl,jk),zlnew)) - zlnew = min(z_cldmax,zlnew) - zprecip(jl) = max(0.,zluold(jl)+zc-zlnew) - pdmfup(jl,jk) = zprecip(jl)*pmfu(jl,jk) - zlrain(jl,jk) = zlrain(jl,jk) + zprecip(jl) - plu(jl,jk) = zlnew - end if - end if - end do - do jl = 1, klon - if ( llo1(jl) ) then - if ( zlrain(jl,jk) > 0. ) then - zvw = 21.18*zlrain(jl,jk)**0.2 - zvi = z_cwifrac*zvw - zalfaw = foealfa(ptu(jl,jk)) - zvv = zalfaw*zvw + (1.-zalfaw)*zvi - zrold = zlrain(jl,jk) - zprecip(jl) - zc = zprecip(jl) - zwu = min(15.0,sqrt(2.*max(0.1,kup(jl,jk)))) - zd = zvv/zwu - zint = exp(-zd) - zrnew = zrold*zint + zc/zd*(1.-zint) - zrnew = max(0.,min(zlrain(jl,jk),zrnew)) - zlrain(jl,jk) = zrnew - end if - end if - end do - do jll = 1 , jlm - jl = jlx(jll) - pmful(jl,jk) = plu(jl,jk)*pmfu(jl,jk) - pmfus(jl,jk) = (cpd*ptu(jl,jk)+pgeoh(jl,jk))*pmfu(jl,jk) - pmfuq(jl,jk) = pqu(jl,jk)*pmfu(jl,jk) - end do - end if - end do -!---------------------------------------------------------------------- -! 5. final calculations -! ------------------ - do jl = 1,klon - if ( kctop(jl) == -1 ) ldcum(jl) = .false. - kcbot(jl) = max(kcbot(jl),kctop(jl)) - if ( ldcum(jl) ) then - wup(jl) = max(1.e-2,wup(jl)/max(1.,zdpmean(jl))) - wup(jl) = sqrt(2.*wup(jl)) - end if - end do - - return - end subroutine cuascn -!--------------------------------------------------------- -! level 3 souroutines -!-------------------------------------------------------- - subroutine cudlfsn & - & (klon, klev, & - & kcbot, kctop, lndj, ldcum, & - & ptenh, pqenh, puen, pven, & - & pten, pqsen, pgeo, & - & pgeoh, paph, ptu, pqu, plu,& - & puu, pvu, pmfub, prfl, & - & ptd, pqd, pud, pvd, & - & pmfd, pmfds, pmfdq, pdmfdp, & - & kdtop, lddraf) - -! this routine calculates level of free sinking for -! cumulus downdrafts and specifies t,q,u and v values - -! m.tiedtke e.c.m.w.f. 12/86 modif. 12/89 - -! purpose. -! -------- -! to produce lfs-values for cumulus downdrafts -! for massflux cumulus parameterization - -! interface -! --------- -! this routine is called from *cumastr*. -! input are environmental values of t,q,u,v,p,phi -! and updraft values t,q,u and v and also -! cloud base massflux and cu-precipitation rate. -! it returns t,q,u and v values and massflux at lfs. - -! method. - -! check for negative buoyancy of air of equal parts of -! moist environmental air and cloud air. - -! parameter description units -! --------- ----------- ----- -! input parameters (integer): - -! *klon* number of grid points per packet -! *klev* number of levels -! *kcbot* cloud base level -! *kctop* cloud top level - -! input parameters (logical): - -! *lndj* land sea mask (1 for land) -! *ldcum* flag: .true. for convective points - -! input parameters (real(kind=kind_phys)): - -! *ptenh* env. temperature (t+1) on half levels k -! *pqenh* env. spec. humidity (t+1) on half levels kg/kg -! *puen* provisional environment u-velocity (t+1) m/s -! *pven* provisional environment v-velocity (t+1) m/s -! *pten* provisional environment temperature (t+1) k -! *pqsen* environment spec. saturation humidity (t+1) kg/kg -! *pgeo* geopotential m2/s2 -! *pgeoh* geopotential on half levels m2/s2 -! *paph* provisional pressure on half levels pa -! *ptu* temperature in updrafts k -! *pqu* spec. humidity in updrafts kg/kg -! *plu* liquid water content in updrafts kg/kg -! *puu* u-velocity in updrafts m/s -! *pvu* v-velocity in updrafts m/s -! *pmfub* massflux in updrafts at cloud base kg/(m2*s) - -! updated parameters (real(kind=kind_phys)): - -! *prfl* precipitation rate kg/(m2*s) - -! output parameters (real(kind=kind_phys)): - -! *ptd* temperature in downdrafts k -! *pqd* spec. humidity in downdrafts kg/kg -! *pud* u-velocity in downdrafts m/s -! *pvd* v-velocity in downdrafts m/s -! *pmfd* massflux in downdrafts kg/(m2*s) -! *pmfds* flux of dry static energy in downdrafts j/(m2*s) -! *pmfdq* flux of spec. humidity in downdrafts kg/(m2*s) -! *pdmfdp* flux difference of precip. in downdrafts kg/(m2*s) - -! output parameters (integer): - -! *kdtop* top level of downdrafts - -! output parameters (logical): - -! *lddraf* .true. if downdrafts exist - -! externals -! --------- -! *cuadjtq* for calculating wet bulb t and q at lfs -!---------------------------------------------------------------------- - implicit none - - integer klev,klon - real(kind=kind_phys) ptenh(klon,klev), pqenh(klon,klev), & - & puen(klon,klev), pven(klon,klev), & - & pten(klon,klev), pqsen(klon,klev), & - & pgeo(klon,klev), & - & pgeoh(klon,klev+1), paph(klon,klev+1),& - & ptu(klon,klev), pqu(klon,klev), & - & puu(klon,klev), pvu(klon,klev), & - & plu(klon,klev), & - & pmfub(klon), prfl(klon) - - real(kind=kind_phys) ptd(klon,klev), pqd(klon,klev), & - & pud(klon,klev), pvd(klon,klev), & - & pmfd(klon,klev), pmfds(klon,klev), & - & pmfdq(klon,klev), pdmfdp(klon,klev) - integer kcbot(klon), kctop(klon), & - & kdtop(klon), ikhsmin(klon) - logical ldcum(klon), & - & lddraf(klon) - integer lndj(klon) - - real(kind=kind_phys) ztenwb(klon,klev), zqenwb(klon,klev), & - & zcond(klon), zph(klon), & - & zhsmin(klon) - logical llo2(klon) -! local variables - integer jl,jk - integer is,ik,icall,ike - real(kind=kind_phys) zhsk,zttest,zqtest,zbuo,zmftop - -!---------------------------------------------------------------------- - -! 1. set default values for downdrafts -! --------------------------------- - do jl=1,klon - lddraf(jl)=.false. - kdtop(jl)=klev+1 - ikhsmin(jl)=klev+1 - zhsmin(jl)=1.e8 - enddo -!---------------------------------------------------------------------- - -! 2. determine level of free sinking: -! downdrafts shall start at model level of minimum -! of saturation moist static energy or below -! respectively - -! for every point and proceed as follows: - -! (1) determine level of minimum of hs -! (2) determine wet bulb environmental t and q -! (3) do mixing with cumulus cloud air -! (4) check for negative buoyancy -! (5) if buoyancy>0 repeat (2) to (4) for next -! level below - -! the assumption is that air of downdrafts is mixture -! of 50% cloud air + 50% environmental air at wet bulb -! temperature (i.e. which became saturated due to -! evaporation of rain and cloud water) -! ---------------------------------------------------- - do jk=3,klev-2 - do jl=1,klon - zhsk=cpd*pten(jl,jk)+pgeo(jl,jk) + & - & foelhm(pten(jl,jk))*pqsen(jl,jk) - if(zhsk .lt. zhsmin(jl)) then - zhsmin(jl) = zhsk - ikhsmin(jl)= jk - end if - end do - end do - - - ike=klev-3 - do jk=3,ike - -! 2.1 calculate wet-bulb temperature and moisture -! for environmental air in *cuadjtq* -! ------------------------------------------- - is=0 - do jl=1,klon - ztenwb(jl,jk)=ptenh(jl,jk) - zqenwb(jl,jk)=pqenh(jl,jk) - zph(jl)=paph(jl,jk) - llo2(jl)=ldcum(jl).and.prfl(jl).gt.0..and..not.lddraf(jl).and. & - & (jk.lt.kcbot(jl).and.jk.gt.kctop(jl)).and. jk.ge.ikhsmin(jl) - if(llo2(jl))then - is=is+1 - endif - enddo - if(is.eq.0) cycle - - ik=jk - icall=2 - call cuadjtqn & - & ( klon, klev, ik, zph, ztenwb, zqenwb, llo2, icall) - -! 2.2 do mixing of cumulus and environmental air -! and check for negative buoyancy. -! then set values for downdraft at lfs. -! ---------------------------------------- - do jl=1,klon - if(llo2(jl)) then - zttest=0.5*(ptu(jl,jk)+ztenwb(jl,jk)) - zqtest=0.5*(pqu(jl,jk)+zqenwb(jl,jk)) - zbuo=zttest*(1.+vtmpc1 *zqtest)- & - & ptenh(jl,jk)*(1.+vtmpc1 *pqenh(jl,jk)) - zcond(jl)=pqenh(jl,jk)-zqenwb(jl,jk) - zmftop=-cmfdeps*pmfub(jl) - if(zbuo.lt.0..and.prfl(jl).gt.10.*zmftop*zcond(jl)) then - kdtop(jl)=jk - lddraf(jl)=.true. - ptd(jl,jk)=zttest - pqd(jl,jk)=zqtest - pmfd(jl,jk)=zmftop - pmfds(jl,jk)=pmfd(jl,jk)*(cpd*ptd(jl,jk)+pgeoh(jl,jk)) - pmfdq(jl,jk)=pmfd(jl,jk)*pqd(jl,jk) - pdmfdp(jl,jk-1)=-0.5*pmfd(jl,jk)*zcond(jl) - prfl(jl)=prfl(jl)+pdmfdp(jl,jk-1) - endif - endif - enddo - - enddo - - return - end subroutine cudlfsn - -!--------------------------------------------------------- -! level 3 souroutines -!-------------------------------------------------------- -!********************************************** -! subroutine cuddrafn -!********************************************** - subroutine cuddrafn & - & ( klon, klev, lddraf & - & , ptenh, pqenh, puen, pven & - & , pgeo, pgeoh, paph, prfl & - & , ptd, pqd, pud, pvd, pmfu & - & , pmfd, pmfds, pmfdq, pdmfdp, pmfdde_rate ) - -! this routine calculates cumulus downdraft descent - -! m.tiedtke e.c.m.w.f. 12/86 modif. 12/89 - -! purpose. -! -------- -! to produce the vertical profiles for cumulus downdrafts -! (i.e. t,q,u and v and fluxes) - -! interface -! --------- - -! this routine is called from *cumastr*. -! input is t,q,p,phi,u,v at half levels. -! it returns fluxes of s,q and evaporation rate -! and u,v at levels where downdraft occurs - -! method. -! -------- -! calculate moist descent for entraining/detraining plume by -! a) moving air dry-adiabatically to next level below and -! b) correcting for evaporation to obtain saturated state. - -! parameter description units -! --------- ----------- ----- -! input parameters (integer): - -! *klon* number of grid points per packet -! *klev* number of levels - -! input parameters (logical): - -! *lddraf* .true. if downdrafts exist - -! input parameters (real(kind=kind_phys)): - -! *ptenh* env. temperature (t+1) on half levels k -! *pqenh* env. spec. humidity (t+1) on half levels kg/kg -! *puen* provisional environment u-velocity (t+1) m/s -! *pven* provisional environment v-velocity (t+1) m/s -! *pgeo* geopotential m2/s2 -! *pgeoh* geopotential on half levels m2/s2 -! *paph* provisional pressure on half levels pa -! *pmfu* massflux updrafts kg/(m2*s) - -! updated parameters (real(kind=kind_phys)): - -! *prfl* precipitation rate kg/(m2*s) - -! output parameters (real(kind=kind_phys)): - -! *ptd* temperature in downdrafts k -! *pqd* spec. humidity in downdrafts kg/kg -! *pud* u-velocity in downdrafts m/s -! *pvd* v-velocity in downdrafts m/s -! *pmfd* massflux in downdrafts kg/(m2*s) -! *pmfds* flux of dry static energy in downdrafts j/(m2*s) -! *pmfdq* flux of spec. humidity in downdrafts kg/(m2*s) -! *pdmfdp* flux difference of precip. in downdrafts kg/(m2*s) - -! externals -! --------- -! *cuadjtq* for adjusting t and q due to evaporation in -! saturated descent -!---------------------------------------------------------------------- - implicit none - - integer klev,klon - real(kind=kind_phys) ptenh(klon,klev), pqenh(klon,klev), & - & puen(klon,klev), pven(klon,klev), & - & pgeoh(klon,klev+1), paph(klon,klev+1), & - & pgeo(klon,klev), pmfu(klon,klev) - - real(kind=kind_phys) ptd(klon,klev), pqd(klon,klev), & - & pud(klon,klev), pvd(klon,klev), & - & pmfd(klon,klev), pmfds(klon,klev), & - & pmfdq(klon,klev), pdmfdp(klon,klev), & - & prfl(klon) - real(kind=kind_phys) pmfdde_rate(klon,klev) - logical lddraf(klon) - - real(kind=kind_phys) zdmfen(klon), zdmfde(klon), & - & zcond(klon), zoentr(klon), & - & zbuoy(klon) - real(kind=kind_phys) zph(klon) - logical llo2(klon) - logical llo1 -! local variables - integer jl,jk - integer is,ik,icall,ike, itopde(klon) - real(kind=kind_phys) zentr,zdz,zzentr,zseen,zqeen,zsdde,zqdde,zdmfdp - real(kind=kind_phys) zmfdsk,zmfdqk,zbuo,zrain,zbuoyz,zmfduk,zmfdvk - -!---------------------------------------------------------------------- -! 1. calculate moist descent for cumulus downdraft by -! (a) calculating entrainment/detrainment rates, -! including organized entrainment dependent on -! negative buoyancy and assuming -! linear decrease of massflux in pbl -! (b) doing moist descent - evaporative cooling -! and moistening is calculated in *cuadjtq* -! (c) checking for negative buoyancy and -! specifying final t,q,u,v and downward fluxes -! ------------------------------------------------- - do jl=1,klon - zoentr(jl)=0. - zbuoy(jl)=0. - zdmfen(jl)=0. - zdmfde(jl)=0. - enddo - - do jk=klev,1,-1 - do jl=1,klon - pmfdde_rate(jl,jk) = 0. - if((paph(jl,klev+1)-paph(jl,jk)).lt. 60.e2) itopde(jl) = jk - end do - end do - - do jk=3,klev - is=0 - do jl=1,klon - zph(jl)=paph(jl,jk) - llo2(jl)=lddraf(jl).and.pmfd(jl,jk-1).lt.0. - if(llo2(jl)) then - is=is+1 - endif - enddo - if(is.eq.0) cycle - - do jl=1,klon - if(llo2(jl)) then - zentr = entrdd*pmfd(jl,jk-1)*(pgeoh(jl,jk-1)-pgeoh(jl,jk))*zrg - zdmfen(jl)=zentr - zdmfde(jl)=zentr - endif - enddo - - do jl=1,klon - if(llo2(jl)) then - if(jk.gt.itopde(jl)) then - zdmfen(jl)=0. - zdmfde(jl)=pmfd(jl,itopde(jl))* & - & (paph(jl,jk)-paph(jl,jk-1))/ & - & (paph(jl,klev+1)-paph(jl,itopde(jl))) - endif - endif - enddo - - do jl=1,klon - if(llo2(jl)) then - if(jk.le.itopde(jl)) then - zdz=-(pgeoh(jl,jk-1)-pgeoh(jl,jk))*zrg - zzentr=zoentr(jl)*zdz*pmfd(jl,jk-1) - zdmfen(jl)=zdmfen(jl)+zzentr - zdmfen(jl)=max(zdmfen(jl),0.3*pmfd(jl,jk-1)) - zdmfen(jl)=max(zdmfen(jl),-0.75*pmfu(jl,jk)- & - & (pmfd(jl,jk-1)-zdmfde(jl))) - zdmfen(jl)=min(zdmfen(jl),0.) - endif - endif - enddo - - do jl=1,klon - if(llo2(jl)) then - pmfd(jl,jk)=pmfd(jl,jk-1)+zdmfen(jl)-zdmfde(jl) - zseen=(cpd*ptenh(jl,jk-1)+pgeoh(jl,jk-1))*zdmfen(jl) - zqeen=pqenh(jl,jk-1)*zdmfen(jl) - zsdde=(cpd*ptd(jl,jk-1)+pgeoh(jl,jk-1))*zdmfde(jl) - zqdde=pqd(jl,jk-1)*zdmfde(jl) - zmfdsk=pmfds(jl,jk-1)+zseen-zsdde - zmfdqk=pmfdq(jl,jk-1)+zqeen-zqdde - pqd(jl,jk)=zmfdqk*(1./min(-cmfcmin,pmfd(jl,jk))) - ptd(jl,jk)=(zmfdsk*(1./min(-cmfcmin,pmfd(jl,jk)))-& - & pgeoh(jl,jk))*rcpd - ptd(jl,jk)=min(400.,ptd(jl,jk)) - ptd(jl,jk)=max(100.,ptd(jl,jk)) - zcond(jl)=pqd(jl,jk) - endif - enddo - - ik=jk - icall=2 - call cuadjtqn(klon, klev, ik, zph, ptd, pqd, llo2, icall ) - - do jl=1,klon - if(llo2(jl)) then - zcond(jl)=zcond(jl)-pqd(jl,jk) - zbuo=ptd(jl,jk)*(1.+vtmpc1 *pqd(jl,jk))- & - & ptenh(jl,jk)*(1.+vtmpc1 *pqenh(jl,jk)) - if(prfl(jl).gt.0..and.pmfu(jl,jk).gt.0.) then - zrain=prfl(jl)/pmfu(jl,jk) - zbuo=zbuo-ptd(jl,jk)*zrain - endif - if(zbuo.ge.0 .or. prfl(jl).le.(pmfd(jl,jk)*zcond(jl))) then - pmfd(jl,jk)=0. - zbuo=0. - endif - pmfds(jl,jk)=(cpd*ptd(jl,jk)+pgeoh(jl,jk))*pmfd(jl,jk) - pmfdq(jl,jk)=pqd(jl,jk)*pmfd(jl,jk) - zdmfdp=-pmfd(jl,jk)*zcond(jl) - pdmfdp(jl,jk-1)=zdmfdp - prfl(jl)=prfl(jl)+zdmfdp - -! compute organized entrainment for use at next level - zbuoyz=zbuo/ptenh(jl,jk) - zbuoyz=min(zbuoyz,0.0) - zdz=-(pgeo(jl,jk-1)-pgeo(jl,jk)) - zbuoy(jl)=zbuoy(jl)+zbuoyz*zdz - zoentr(jl)=g*zbuoyz*0.5/(1.+zbuoy(jl)) - pmfdde_rate(jl,jk) = -zdmfde(jl) - endif - enddo - - enddo - - return - end subroutine cuddrafn -!--------------------------------------------------------- -! level 3 souroutines -!-------------------------------------------------------- - subroutine cuflxn & - & ( klon, klev, ztmst & - & , pten, pqen, pqsen, ptenh, pqenh & - & , paph, pap, pgeoh, lndj, ldcum & - & , kcbot, kctop, kdtop, ktopm2 & - & , ktype, lddraf & - & , pmfu, pmfd, pmfus, pmfds & - & , pmfuq, pmfdq, pmful, plude & - & , pdmfup, pdmfdp, pdpmel, plglac & - & , prain, pmfdde_rate, pmflxr, pmflxs ) - -! m.tiedtke e.c.m.w.f. 7/86 modif. 12/89 - -! purpose -! ------- - -! this routine does the final calculation of convective -! fluxes in the cloud layer and in the subcloud layer - -! interface -! --------- -! this routine is called from *cumastr*. - - -! parameter description units -! --------- ----------- ----- -! input parameters (integer): - -! *klon* number of grid points per packet -! *klev* number of levels -! *kcbot* cloud base level -! *kctop* cloud top level -! *kdtop* top level of downdrafts - -! input parameters (logical): - -! *lndj* land sea mask (1 for land) -! *ldcum* flag: .true. for convective points - -! input parameters (real(kind=kind_phys)): - -! *ztmst* time step for the physics s -! *pten* provisional environment temperature (t+1) k -! *pqen* provisional environment spec. humidity (t+1) kg/kg -! *pqsen* environment spec. saturation humidity (t+1) kg/kg -! *ptenh* env. temperature (t+1) on half levels k -! *pqenh* env. spec. humidity (t+1) on half levels kg/kg -! *paph* provisional pressure on half levels pa -! *pap* provisional pressure on full levels pa -! *pgeoh* geopotential on half levels m2/s2 - -! updated parameters (integer): - -! *ktype* set to zero if ldcum=.false. - -! updated parameters (logical): - -! *lddraf* set to .false. if ldcum=.false. or kdtop= kdtop(jl) - if ( llddraf .and.jk.ge.kdtop(jl)) then - pmfds(jl,jk) = pmfds(jl,jk)-pmfd(jl,jk) * & - (cpd*ptenh(jl,jk)+pgeoh(jl,jk)) - pmfdq(jl,jk) = pmfdq(jl,jk)-pmfd(jl,jk)*pqenh(jl,jk) - else - pmfd(jl,jk) = 0. - pmfds(jl,jk) = 0. - pmfdq(jl,jk) = 0. - pdmfdp(jl,jk-1) = 0. - end if - if ( llddraf .and. pmfd(jl,jk) < 0. .and. & - abs(pmfd(jl,ikb)) < 1.e-20 ) then - idbas(jl) = jk - end if - else - pmfu(jl,jk)=0. - pmfd(jl,jk)=0. - pmfus(jl,jk)=0. - pmfds(jl,jk)=0. - pmfuq(jl,jk)=0. - pmfdq(jl,jk)=0. - pmful(jl,jk)=0. - plglac(jl,jk)=0. - pdmfup(jl,jk-1)=0. - pdmfdp(jl,jk-1)=0. - plude(jl,jk-1)=0. - endif - enddo - enddo - - do jl=1,klon - pmflxr(jl,klev+1) = 0. - pmflxs(jl,klev+1) = 0. - end do - do jl=1,klon - if(ldcum(jl)) then - ikb=kcbot(jl) - ik=ikb+1 - zzp=((paph(jl,klev+1)-paph(jl,ik))/ & - & (paph(jl,klev+1)-paph(jl,ikb))) - if(ktype(jl).eq.3) then - zzp=zzp**2 - endif - pmfu(jl,ik)=pmfu(jl,ikb)*zzp - pmfus(jl,ik)=(pmfus(jl,ikb)- & - & foelhm(ptenh(jl,ikb))*pmful(jl,ikb))*zzp - pmfuq(jl,ik)=(pmfuq(jl,ikb)+pmful(jl,ikb))*zzp - pmful(jl,ik)=0. - endif - enddo - - do jk=ktopm2,klev - do jl=1,klon - if(ldcum(jl).and.jk.gt.kcbot(jl)+1) then - ikb=kcbot(jl)+1 - zzp=((paph(jl,klev+1)-paph(jl,jk))/ & - & (paph(jl,klev+1)-paph(jl,ikb))) - if(ktype(jl).eq.3) then - zzp=zzp**2 - endif - pmfu(jl,jk)=pmfu(jl,ikb)*zzp - pmfus(jl,jk)=pmfus(jl,ikb)*zzp - pmfuq(jl,jk)=pmfuq(jl,ikb)*zzp - pmful(jl,jk)=0. - endif - ik = idbas(jl) - llddraf = lddraf(jl) .and. jk > ik .and. ik < klev - if ( llddraf .and. ik == kcbot(jl)+1 ) then - zzp = ((paph(jl,klev+1)-paph(jl,jk))/(paph(jl,klev+1)-paph(jl,ik))) - if ( ktype(jl) == 3 ) zzp = zzp*zzp - pmfd(jl,jk) = pmfd(jl,ik)*zzp - pmfds(jl,jk) = pmfds(jl,ik)*zzp - pmfdq(jl,jk) = pmfdq(jl,ik)*zzp - pmfdde_rate(jl,jk) = -(pmfd(jl,jk-1)-pmfd(jl,jk)) - else if ( llddraf .and. ik /= kcbot(jl)+1 .and. jk == ik+1 ) then - pmfdde_rate(jl,jk) = -(pmfd(jl,jk-1)-pmfd(jl,jk)) - end if - enddo - enddo -!* 2. calculate rain/snow fall rates -!* calculate melting of snow -!* calculate evaporation of precip -! ------------------------------- - - do jk=ktopm2,klev - do jl=1,klon - if(ldcum(jl) .and. jk >=kctop(jl)-1 ) then - prain(jl)=prain(jl)+pdmfup(jl,jk) - if(pmflxs(jl,jk).gt.0..and.pten(jl,jk).gt.tmelt) then - zcons1=zcons1a*(1.+0.5*(pten(jl,jk)-tmelt)) - zfac=zcons1*(paph(jl,jk+1)-paph(jl,jk)) - zsnmlt=min(pmflxs(jl,jk),zfac*(pten(jl,jk)-tmelt)) - pdpmel(jl,jk)=zsnmlt - pqsen(jl,jk)=foeewm(pten(jl,jk)-zsnmlt/zfac)/pap(jl,jk) - endif - zalfaw=foealfa(pten(jl,jk)) - ! - ! No liquid precipitation above melting level - ! - if ( pten(jl,jk) < tmelt .and. zalfaw > 0. ) then - plglac(jl,jk) = plglac(jl,jk)+zalfaw*(pdmfup(jl,jk)+pdmfdp(jl,jk)) - zalfaw = 0. - end if - pmflxr(jl,jk+1)=pmflxr(jl,jk)+zalfaw* & - & (pdmfup(jl,jk)+pdmfdp(jl,jk))+pdpmel(jl,jk) - pmflxs(jl,jk+1)=pmflxs(jl,jk)+(1.-zalfaw)* & - & (pdmfup(jl,jk)+pdmfdp(jl,jk))-pdpmel(jl,jk) - if(pmflxr(jl,jk+1)+pmflxs(jl,jk+1).lt.0.0) then - pdmfdp(jl,jk)=-(pmflxr(jl,jk)+pmflxs(jl,jk)+pdmfup(jl,jk)) - pmflxr(jl,jk+1)=0.0 - pmflxs(jl,jk+1)=0.0 - pdpmel(jl,jk) =0.0 - else if ( pmflxr(jl,jk+1) < 0. ) then - pmflxs(jl,jk+1) = pmflxs(jl,jk+1)+pmflxr(jl,jk+1) - pmflxr(jl,jk+1) = 0. - else if ( pmflxs(jl,jk+1) < 0. ) then - pmflxr(jl,jk+1) = pmflxr(jl,jk+1)+pmflxs(jl,jk+1) - pmflxs(jl,jk+1) = 0. - end if - endif - enddo - enddo - do jk=ktopm2,klev - do jl=1,klon - if(ldcum(jl).and.jk.ge.kcbot(jl)) then - zrfl=pmflxr(jl,jk)+pmflxs(jl,jk) - if(zrfl.gt.1.e-20) then - zdrfl1=zcpecons*max(0.,pqsen(jl,jk)-pqen(jl,jk))*zcucov* & - & (sqrt(paph(jl,jk)/paph(jl,klev+1))/5.09e-3* & - & zrfl/zcucov)**0.5777* & - & (paph(jl,jk+1)-paph(jl,jk)) - zrnew=zrfl-zdrfl1 - zrmin=zrfl-zcucov*max(0.,rhevap(jl)*pqsen(jl,jk) & - & -pqen(jl,jk)) *zcons2*(paph(jl,jk+1)-paph(jl,jk)) - zrnew=max(zrnew,zrmin) - zrfln=max(zrnew,0.) - zdrfl=min(0.,zrfln-zrfl) - zdenom=1./max(1.e-20,pmflxr(jl,jk)+pmflxs(jl,jk)) - zalfaw=foealfa(pten(jl,jk)) - if ( pten(jl,jk) < tmelt ) zalfaw = 0. - zpdr=zalfaw*pdmfdp(jl,jk) - zpds=(1.-zalfaw)*pdmfdp(jl,jk) - pmflxr(jl,jk+1)=pmflxr(jl,jk)+zpdr & - & +pdpmel(jl,jk)+zdrfl*pmflxr(jl,jk)*zdenom - pmflxs(jl,jk+1)=pmflxs(jl,jk)+zpds & - & -pdpmel(jl,jk)+zdrfl*pmflxs(jl,jk)*zdenom - pdmfup(jl,jk)=pdmfup(jl,jk)+zdrfl - if ( pmflxr(jl,jk+1)+pmflxs(jl,jk+1) < 0. ) then - pdmfup(jl,jk) = pdmfup(jl,jk)-(pmflxr(jl,jk+1)+pmflxs(jl,jk+1)) - pmflxr(jl,jk+1) = 0. - pmflxs(jl,jk+1) = 0. - pdpmel(jl,jk) = 0. - else if ( pmflxr(jl,jk+1) < 0. ) then - pmflxs(jl,jk+1) = pmflxs(jl,jk+1)+pmflxr(jl,jk+1) - pmflxr(jl,jk+1) = 0. - else if ( pmflxs(jl,jk+1) < 0. ) then - pmflxr(jl,jk+1) = pmflxr(jl,jk+1)+pmflxs(jl,jk+1) - pmflxs(jl,jk+1) = 0. - end if - else - pmflxr(jl,jk+1)=0.0 - pmflxs(jl,jk+1)=0.0 - pdmfdp(jl,jk)=0.0 - pdpmel(jl,jk)=0.0 - endif - endif - enddo - enddo - - return - end subroutine cuflxn -!--------------------------------------------------------- -! level 3 souroutines -!-------------------------------------------------------- - subroutine cudtdqn(klon,klev,ktopm2,kctop,kdtop,ldcum, & - lddraf,ztmst,paph,pgeoh,pgeo,pten,ptenh,pqen, & - pqenh,pqsen,plglac,plude,pmfu,pmfd,pmfus,pmfds, & - pmfuq,pmfdq,pmful,pdmfup,pdmfdp,pdpmel,ptent,ptenq,pcte) - implicit none - integer klon,klev,ktopm2 - integer kctop(klon), kdtop(klon) - logical ldcum(klon), lddraf(klon) - real(kind=kind_phys) ztmst - real(kind=kind_phys) paph(klon,klev+1), pgeoh(klon,klev+1) - real(kind=kind_phys) pgeo(klon,klev), pten(klon,klev), & - pqen(klon,klev), ptenh(klon,klev),& - pqenh(klon,klev), pqsen(klon,klev),& - plglac(klon,klev), plude(klon,klev) - real(kind=kind_phys) pmfu(klon,klev), pmfd(klon,klev),& - pmfus(klon,klev), pmfds(klon,klev),& - pmfuq(klon,klev), pmfdq(klon,klev),& - pmful(klon,klev), pdmfup(klon,klev),& - pdpmel(klon,klev), pdmfdp(klon,klev) - real(kind=kind_phys) ptent(klon,klev), ptenq(klon,klev) - real(kind=kind_phys) pcte(klon,klev) - -! local variables - integer jk , ik , jl - real(kind=kind_phys) zalv , zzp - real(kind=kind_phys) zdtdt(klon,klev) , zdqdt(klon,klev) , zdp(klon,klev) - !* 1.0 SETUP AND INITIALIZATIONS - ! ------------------------- - do jk = 1 , klev - do jl = 1, klon - if ( ldcum(jl) ) then - zdp(jl,jk) = g/(paph(jl,jk+1)-paph(jl,jk)) - end if - end do - end do - - !----------------------------------------------------------------------- - !* 2.0 COMPUTE TENDENCIES - ! ------------------ - do jk = ktopm2 , klev - if ( jk < klev ) then - do jl = 1,klon - if ( ldcum(jl) ) then - zalv = foelhm(pten(jl,jk)) - zdtdt(jl,jk) = zdp(jl,jk)*rcpd * & - (pmfus(jl,jk+1)-pmfus(jl,jk)+pmfds(jl,jk+1) - & - pmfds(jl,jk)+alf*plglac(jl,jk)-alf*pdpmel(jl,jk) - & - zalv*(pmful(jl,jk+1)-pmful(jl,jk)-plude(jl,jk)-pdmfup(jl,jk)-pdmfdp(jl,jk))) - zdqdt(jl,jk) = zdp(jl,jk)*(pmfuq(jl,jk+1) - & - pmfuq(jl,jk)+pmfdq(jl,jk+1)-pmfdq(jl,jk)+pmful(jl,jk+1) - & - pmful(jl,jk)-plude(jl,jk)-pdmfup(jl,jk)-pdmfdp(jl,jk)) - end if - end do - else - do jl = 1,klon - if ( ldcum(jl) ) then - zalv = foelhm(pten(jl,jk)) - zdtdt(jl,jk) = -zdp(jl,jk)*rcpd * & - (pmfus(jl,jk)+pmfds(jl,jk)+alf*pdpmel(jl,jk) - & - zalv*(pmful(jl,jk)+pdmfup(jl,jk)+pdmfdp(jl,jk)+plude(jl,jk))) - zdqdt(jl,jk) = -zdp(jl,jk)*(pmfuq(jl,jk) + plude(jl,jk) + & - pmfdq(jl,jk)+(pmful(jl,jk)+pdmfup(jl,jk)+pdmfdp(jl,jk))) - end if - end do - end if - end do - !--------------------------------------------------------------- - !* 3.0 UPDATE TENDENCIES - ! ----------------- - do jk = ktopm2 , klev - do jl = 1, klon - if ( ldcum(jl) ) then - ptent(jl,jk) = ptent(jl,jk) + zdtdt(jl,jk) - ptenq(jl,jk) = ptenq(jl,jk) + zdqdt(jl,jk) - pcte(jl,jk) = zdp(jl,jk)*plude(jl,jk) - end if - end do - end do - - return - end subroutine cudtdqn -!--------------------------------------------------------- -! level 3 souroutines -!-------------------------------------------------------- - subroutine cududvn(klon,klev,ktopm2,ktype,kcbot,kctop,ldcum, & - ztmst,paph,puen,pven,pmfu,pmfd,puu,pud,pvu,pvd,ptenu, & - ptenv) - implicit none - integer klon,klev,ktopm2 - integer ktype(klon), kcbot(klon), kctop(klon) - logical ldcum(klon) - real(kind=kind_phys) ztmst - real(kind=kind_phys) paph(klon,klev+1) - real(kind=kind_phys) puen(klon,klev), pven(klon,klev),& - pmfu(klon,klev), pmfd(klon,klev),& - puu(klon,klev), pud(klon,klev),& - pvu(klon,klev), pvd(klon,klev) - real(kind=kind_phys) ptenu(klon,klev), ptenv(klon,klev) - -!local variables - real(kind=kind_phys) zuen(klon,klev) , zven(klon,klev) , zmfuu(klon,klev), & - zmfdu(klon,klev), zmfuv(klon,klev), zmfdv(klon,klev) - - integer ik , ikb , jk , jl - real(kind=kind_phys) zzp, zdtdt - - real(kind=kind_phys) zdudt(klon,klev), zdvdt(klon,klev), zdp(klon,klev) -! - do jk = 1 , klev - do jl = 1, klon - if ( ldcum(jl) ) then - zuen(jl,jk) = puen(jl,jk) - zven(jl,jk) = pven(jl,jk) - zdp(jl,jk) = g/(paph(jl,jk+1)-paph(jl,jk)) - end if - end do - end do -!---------------------------------------------------------------------- -!* 1.0 CALCULATE FLUXES AND UPDATE U AND V TENDENCIES -! ---------------------------------------------- - do jk = ktopm2 , klev - ik = jk - 1 - do jl = 1,klon - if ( ldcum(jl) ) then - zmfuu(jl,jk) = pmfu(jl,jk)*(puu(jl,jk)-zuen(jl,ik)) - zmfuv(jl,jk) = pmfu(jl,jk)*(pvu(jl,jk)-zven(jl,ik)) - zmfdu(jl,jk) = pmfd(jl,jk)*(pud(jl,jk)-zuen(jl,ik)) - zmfdv(jl,jk) = pmfd(jl,jk)*(pvd(jl,jk)-zven(jl,ik)) - end if - end do - end do - ! linear fluxes below cloud - do jk = ktopm2 , klev - do jl = 1, klon - if ( ldcum(jl) .and. jk > kcbot(jl) ) then - ikb = kcbot(jl) - zzp = ((paph(jl,klev+1)-paph(jl,jk))/(paph(jl,klev+1)-paph(jl,ikb))) - if ( ktype(jl) == 3 ) zzp = zzp*zzp - zmfuu(jl,jk) = zmfuu(jl,ikb)*zzp - zmfuv(jl,jk) = zmfuv(jl,ikb)*zzp - zmfdu(jl,jk) = zmfdu(jl,ikb)*zzp - zmfdv(jl,jk) = zmfdv(jl,ikb)*zzp - end if - end do - end do -!---------------------------------------------------------------------- -!* 2.0 COMPUTE TENDENCIES -! ------------------ - do jk = ktopm2 , klev - if ( jk < klev ) then - ik = jk + 1 - do jl = 1,klon - if ( ldcum(jl) ) then - zdudt(jl,jk) = zdp(jl,jk) * & - (zmfuu(jl,ik)-zmfuu(jl,jk)+zmfdu(jl,ik)-zmfdu(jl,jk)) - zdvdt(jl,jk) = zdp(jl,jk) * & - (zmfuv(jl,ik)-zmfuv(jl,jk)+zmfdv(jl,ik)-zmfdv(jl,jk)) - end if - end do - else - do jl = 1,klon - if ( ldcum(jl) ) then - zdudt(jl,jk) = -zdp(jl,jk)*(zmfuu(jl,jk)+zmfdu(jl,jk)) - zdvdt(jl,jk) = -zdp(jl,jk)*(zmfuv(jl,jk)+zmfdv(jl,jk)) - end if - end do - end if - end do -!--------------------------------------------------------------------- -!* 3.0 UPDATE TENDENCIES -! ----------------- - do jk = ktopm2 , klev - do jl = 1, klon - if ( ldcum(jl) ) then - ptenu(jl,jk) = ptenu(jl,jk) + zdudt(jl,jk) - ptenv(jl,jk) = ptenv(jl,jk) + zdvdt(jl,jk) - end if - end do - end do -!---------------------------------------------------------------------- - return - end subroutine cududvn - -!--------------------------------------------------------- -! level 3 souroutines -!-------------------------------------------------------- - subroutine cuctracer(klon,klev,ktrac,kctop,kdtop, & - ldcum,lddraf,ztmst,paph,pmfu,pmfd, & - pudrate,pddrate,pcen,ptenc) - implicit none - integer klon,klev,ktrac - integer kctop(klon), kdtop(klon) - logical ldcum(klon), lddraf(klon) - real(kind=kind_phys) ztmst - real(kind=kind_phys) paph(klon,klev+1) - real(kind=kind_phys) pmfu(klon,klev) - real(kind=kind_phys) pmfd(klon,klev) - real(kind=kind_phys) pudrate(klon,klev) - real(kind=kind_phys) pddrate(klon,klev) - real(kind=kind_phys) pcen(klon,klev,ktrac) - real(kind=kind_phys) ptenc(klon,klev,ktrac) - !---------------------------------------------------------------------- - integer ik , jk , jl , jn - real(kind=kind_phys) zzp , zmfa , zerate , zposi - ! ALLOCATABLE ARAYS - real(kind=kind_phys) , dimension(:,:,:) , allocatable :: zcen , zcu , zcd , & - ztenc , zmfc - real(kind=kind_phys) , dimension(:,:) , allocatable :: zdp - logical , dimension(:,:) , allocatable :: llcumask , llcumbas - !---------------------------------------------------------------------- - allocate (zcen(klon,klev,ktrac)) ! Half-level environmental values - allocate (zcu(klon,klev,ktrac)) ! Updraft values - allocate (zcd(klon,klev,ktrac)) ! Downdraft values - allocate (ztenc(klon,klev,ktrac)) ! Tendency - allocate (zmfc(klon,klev,ktrac)) ! Fluxes - allocate (zdp(klon,klev)) ! Pressure difference - allocate (llcumask(klon,klev)) ! Mask for convection - ! Initialize Cumulus mask + some setups - do jk = 2, klev - do jl = 1, klon - llcumask(jl,jk) = .false. - if ( ldcum(jl) ) then - zdp(jl,jk) = g/(paph(jl,jk+1)-paph(jl,jk)) - if ( jk >= kctop(jl)-1 ) llcumask(jl,jk) = .true. - end if - end do - end do - !---------------------------------------------------------------------- - do jn = 1 , ktrac - !* 1.0 DEFINE TRACERS AT HALF LEVELS - ! ----------------------------- - do jk = 2 , klev - ik = jk - 1 - do jl = 1, klon - zcen(jl,jk,jn) = pcen(jl,jk,jn) - zcd(jl,jk,jn) = pcen(jl,ik,jn) - zcu(jl,jk,jn) = pcen(jl,ik,jn) - zmfc(jl,jk,jn) = 0. - ztenc(jl,jk,jn)= 0. - end do - end do - - do jl = 1, klon - zcu(jl,klev,jn) = pcen(jl,klev,jn) - end do - !* 2.0 COMPUTE UPDRAFT VALUES - ! ---------------------- - do jk = klev - 1 , 3 , -1 - ik = jk + 1 - do jl = 1, klon - if ( llcumask(jl,jk) ) then - zerate = pmfu(jl,jk) - pmfu(jl,ik) + pudrate(jl,jk) - zmfa = 1./max(cmfcmin,pmfu(jl,jk)) - if ( jk >= kctop(jl) ) then - zcu(jl,jk,jn) = (pmfu(jl,ik)*zcu(jl,ik,jn) + & - zerate*pcen(jl,jk,jn)-pudrate(jl,jk)*zcu(jl,ik,jn))*zmfa - end if - end if - end do - end do - !* 3.0 COMPUTE DOWNDRAFT VALUES - ! ------------------------ - do jk = 3 , klev - ik = jk - 1 - do jl = 1, klon - if ( lddraf(jl) .and. jk == kdtop(jl) ) then - ! Nota: in order to avoid final negative Tracer values at LFS - ! the allowed value of ZCD depends on the jump in mass flux - ! at the LFS - zcd(jl,jk,jn) = 0.1*zcu(jl,jk,jn) + 0.9*pcen(jl,ik,jn) - else if ( lddraf(jl).and.jk>kdtop(jl) ) then - zerate = -pmfd(jl,jk) + pmfd(jl,ik) + pddrate(jl,jk) - zmfa = 1./min(-cmfcmin,pmfd(jl,jk)) - zcd(jl,jk,jn) = (pmfd(jl,ik)*zcd(jl,ik,jn) - & - zerate*pcen(jl,ik,jn)+pddrate(jl,jk)*zcd(jl,ik,jn))*zmfa - end if - end do - end do - ! In order to avoid negative Tracer at KLEV adjust ZCD - jk = klev - ik = jk - 1 - do jl = 1, klon - if ( lddraf(jl) ) then - zposi = -zdp(jl,jk) *(pmfu(jl,jk)*zcu(jl,jk,jn) + & - pmfd(jl,jk)*zcd(jl,jk,jn)-(pmfu(jl,jk)+pmfd(jl,jk))*pcen(jl,ik,jn)) - if ( pcen(jl,jk,jn)+zposi*ztmst < 0. ) then - zmfa = 1./min(-cmfcmin,pmfd(jl,jk)) - zcd(jl,jk,jn) = ((pmfu(jl,jk)+pmfd(jl,jk))*pcen(jl,ik,jn) - & - pmfu(jl,jk)*zcu(jl,jk,jn)+pcen(jl,jk,jn) / & - (ztmst*zdp(jl,jk)))*zmfa - end if - end if - end do - end do - !---------------------------------------------------------------------- - do jn = 1 , ktrac - !* 4.0 COMPUTE FLUXES - ! -------------- - do jk = 2 , klev - ik = jk - 1 - do jl = 1, klon - if ( llcumask(jl,jk) ) then - zmfa = pmfu(jl,jk) + pmfd(jl,jk) - zmfc(jl,jk,jn) = pmfu(jl,jk)*zcu(jl,jk,jn) + & - pmfd(jl,jk)*zcd(jl,jk,jn) - zmfa*zcen(jl,ik,jn) - end if - end do - end do - !* 5.0 COMPUTE TENDENCIES = RHS - ! ------------------------ - do jk = 2 , klev - 1 - ik = jk + 1 - do jl = 1, klon - if ( llcumask(jl,jk) ) then - ztenc(jl,jk,jn) = zdp(jl,jk)*(zmfc(jl,ik,jn)-zmfc(jl,jk,jn)) - end if - end do - end do - jk = klev - do jl = 1, klon - if ( ldcum(jl) ) ztenc(jl,jk,jn) = -zdp(jl,jk)*zmfc(jl,jk,jn) - end do - end do - !* 6.0 UPDATE TENDENCIES - ! ----------------- - do jn = 1, ktrac - do jk = 2, klev - do jl = 1, klon - if ( llcumask(jl,jk) ) then - ptenc(jl,jk,jn) = ptenc(jl,jk,jn)+ztenc(jl,jk,jn) - end if - end do - end do - end do - !--------------------------------------------------------------------------- - deallocate (llcumask) - deallocate (zdp) - deallocate (zmfc) - deallocate (ztenc) - deallocate (zcd) - deallocate (zcu) - deallocate (zcen) - end subroutine cuctracer - -!--------------------------------------------------------- -! level 4 souroutines -!-------------------------------------------------------- - subroutine cuadjtqn & - & (klon, klev, kk, psp, pt, pq, ldflag, kcall) -! m.tiedtke e.c.m.w.f. 12/89 -! purpose. -! -------- -! to produce t,q and l values for cloud ascent - -! interface -! --------- -! this routine is called from subroutines: -! *cond* (t and q at condensation level) -! *cubase* (t and q at condensation level) -! *cuasc* (t and q at cloud levels) -! *cuini* (environmental t and qs values at half levels) -! input are unadjusted t and q values, -! it returns adjusted values of t and q - -! parameter description units -! --------- ----------- ----- -! input parameters (integer): - -! *klon* number of grid points per packet -! *klev* number of levels -! *kk* level -! *kcall* defines calculation as -! kcall=0 env. t and qs in*cuini* -! kcall=1 condensation in updrafts (e.g. cubase, cuasc) -! kcall=2 evaporation in downdrafts (e.g. cudlfs,cuddraf) -! input parameters (real(kind=kind_phys)): - -! *psp* pressure pa - -! updated parameters (real(kind=kind_phys)): - -! *pt* temperature k -! *pq* specific humidity kg/kg -! externals -! --------- -! for condensation calculations. -! the tables are initialised in *suphec*. - -!---------------------------------------------------------------------- - - implicit none - - integer klev,klon - real(kind=kind_phys) pt(klon,klev), pq(klon,klev), & - & psp(klon) - logical ldflag(klon) -! local variables - integer jl,jk - integer isum,kcall,kk - real(kind=kind_phys) zqmax,zqsat,zcor,zqp,zcond,zcond1,zl,zi,zf -!---------------------------------------------------------------------- -! 1. define constants -! ---------------- - zqmax=0.5 - -! 2. calculate condensation and adjust t and q accordingly -! ----------------------------------------------------- - - if ( kcall == 1 ) then - do jl = 1,klon - if ( ldflag(jl) ) then - zqp = 1./psp(jl) - zl = 1./(pt(jl,kk)-c4les) - zi = 1./(pt(jl,kk)-c4ies) - zqsat = c2es*(foealfa(pt(jl,kk))*exp(c3les*(pt(jl,kk)-tmelt)*zl) + & - (1.-foealfa(pt(jl,kk)))*exp(c3ies*(pt(jl,kk)-tmelt)*zi)) - zqsat = zqsat*zqp - zqsat = min(0.5,zqsat) - zcor = 1. - vtmpc1*zqsat - zf = foealfa(pt(jl,kk))*r5alvcp*zl**2 + & - (1.-foealfa(pt(jl,kk)))*r5alscp*zi**2 - zcond = (pq(jl,kk)*zcor**2-zqsat*zcor)/(zcor**2+zqsat*zf) - if ( zcond > 0. ) then - pt(jl,kk) = pt(jl,kk) + foeldcpm(pt(jl,kk))*zcond - pq(jl,kk) = pq(jl,kk) - zcond - zl = 1./(pt(jl,kk)-c4les) - zi = 1./(pt(jl,kk)-c4ies) - zqsat = c2es*(foealfa(pt(jl,kk)) * & - exp(c3les*(pt(jl,kk)-tmelt)*zl)+(1.-foealfa(pt(jl,kk))) * & - exp(c3ies*(pt(jl,kk)-tmelt)*zi)) - zqsat = zqsat*zqp - zqsat = min(0.5,zqsat) - zcor = 1. - vtmpc1*zqsat - zf = foealfa(pt(jl,kk))*r5alvcp*zl**2 + & - (1.-foealfa(pt(jl,kk)))*r5alscp*zi**2 - zcond1 = (pq(jl,kk)*zcor**2-zqsat*zcor)/(zcor**2+zqsat*zf) - if ( abs(zcond) < 1.e-20 ) zcond1 = 0. - pt(jl,kk) = pt(jl,kk) + foeldcpm(pt(jl,kk))*zcond1 - pq(jl,kk) = pq(jl,kk) - zcond1 - end if - end if - end do - elseif ( kcall == 2 ) then - do jl = 1,klon - if ( ldflag(jl) ) then - zqp = 1./psp(jl) - zqsat = foeewm(pt(jl,kk))*zqp - zqsat = min(0.5,zqsat) - zcor = 1./(1.-vtmpc1*zqsat) - zqsat = zqsat*zcor - zcond = (pq(jl,kk)-zqsat)/(1.+zqsat*zcor*foedem(pt(jl,kk))) - zcond = min(zcond,0.) - pt(jl,kk) = pt(jl,kk) + foeldcpm(pt(jl,kk))*zcond - pq(jl,kk) = pq(jl,kk) - zcond - zqsat = foeewm(pt(jl,kk))*zqp - zqsat = min(0.5,zqsat) - zcor = 1./(1.-vtmpc1*zqsat) - zqsat = zqsat*zcor - zcond1 = (pq(jl,kk)-zqsat)/(1.+zqsat*zcor*foedem(pt(jl,kk))) - if ( abs(zcond) < 1.e-20 ) zcond1 = min(zcond1,0.) - pt(jl,kk) = pt(jl,kk) + foeldcpm(pt(jl,kk))*zcond1 - pq(jl,kk) = pq(jl,kk) - zcond1 - end if - end do - else if ( kcall == 0 ) then - do jl = 1,klon - zqp = 1./psp(jl) - zqsat = foeewm(pt(jl,kk))*zqp - zqsat = min(0.5,zqsat) - zcor = 1./(1.-vtmpc1*zqsat) - zqsat = zqsat*zcor - zcond1 = (pq(jl,kk)-zqsat)/(1.+zqsat*zcor*foedem(pt(jl,kk))) - pt(jl,kk) = pt(jl,kk) + foeldcpm(pt(jl,kk))*zcond1 - pq(jl,kk) = pq(jl,kk) - zcond1 - zqsat = foeewm(pt(jl,kk))*zqp - zqsat = min(0.5,zqsat) - zcor = 1./(1.-vtmpc1*zqsat) - zqsat = zqsat*zcor - zcond1 = (pq(jl,kk)-zqsat)/(1.+zqsat*zcor*foedem(pt(jl,kk))) - pt(jl,kk) = pt(jl,kk) + foeldcpm(pt(jl,kk))*zcond1 - pq(jl,kk) = pq(jl,kk) - zcond1 - end do - end if - - return - end subroutine cuadjtqn -!--------------------------------------------------------- -! level 4 souroutines -!-------------------------------------------------------- - subroutine cubasmcn & - & (klon, klev, klevm1, kk, pten,& - & pqen, pqsen, puen, pven, pverv,& - & pgeo, pgeoh, ldcum, ktype, klab, plrain,& - & pmfu, pmfub, kcbot, ptu,& - & pqu, plu, puu, pvu, pmfus,& - & pmfuq, pmful, pdmfup) - implicit none -! m.tiedtke e.c.m.w.f. 12/89 -! c.zhang iprc 05/2012 -!***purpose. -! -------- -! this routine calculates cloud base values -! for midlevel convection -!***interface -! --------- -! this routine is called from *cuasc*. -! input are environmental values t,q etc -! it returns cloudbase values for midlevel convection -!***method. -! ------- -! s. tiedtke (1989) -!***externals -! --------- -! none -! ---------------------------------------------------------------- - real(kind=kind_phys) pten(klon,klev), pqen(klon,klev),& - & puen(klon,klev), pven(klon,klev),& - & pqsen(klon,klev), pverv(klon,klev),& - & pgeo(klon,klev), pgeoh(klon,klev+1) - real(kind=kind_phys) ptu(klon,klev), pqu(klon,klev),& - & puu(klon,klev), pvu(klon,klev),& - & plu(klon,klev), pmfu(klon,klev),& - & pmfub(klon), & - & pmfus(klon,klev), pmfuq(klon,klev),& - & pmful(klon,klev), pdmfup(klon,klev),& - & plrain(klon,klev) - integer ktype(klon), kcbot(klon),& - & klab(klon,klev) - logical ldcum(klon) -! local variabels - integer jl,kk,klev,klon,klevp1,klevm1 - real(kind=kind_phys) zzzmb -!-------------------------------------------------------- -!* 1. calculate entrainment and detrainment rates -! ------------------------------------------------------- - do jl=1,klon - if(.not.ldcum(jl) .and. klab(jl,kk+1).eq.0) then - if(lmfmid .and. pqen(jl,kk) .gt. 0.80*pqsen(jl,kk).and. & - pgeo(jl,kk)*zrg .gt. 5.0e2 .and. & - & pgeo(jl,kk)*zrg .lt. 1.0e4 ) then - ptu(jl,kk+1)=(cpd*pten(jl,kk)+pgeo(jl,kk)-pgeoh(jl,kk+1))& - & *rcpd - pqu(jl,kk+1)=pqen(jl,kk) - plu(jl,kk+1)=0. - zzzmb=max(cmfcmin,-pverv(jl,kk)*zrg) - zzzmb=min(zzzmb,cmfcmax) - pmfub(jl)=zzzmb - pmfu(jl,kk+1)=pmfub(jl) - pmfus(jl,kk+1)=pmfub(jl)*(cpd*ptu(jl,kk+1)+pgeoh(jl,kk+1)) - pmfuq(jl,kk+1)=pmfub(jl)*pqu(jl,kk+1) - pmful(jl,kk+1)=0. - pdmfup(jl,kk+1)=0. - kcbot(jl)=kk - klab(jl,kk+1)=1 - plrain(jl,kk+1)=0.0 - ktype(jl)=3 - end if - end if - end do - return - end subroutine cubasmcn -! -!--------------------------------------------------------- -! level 4 souroutines -!--------------------------------------------------------- - subroutine cuentrn(klon,klev,kk,kcbot,ldcum,ldwork, & - pgeoh,pmfu,pdmfen,pdmfde) - implicit none - integer klon,klev,kk - integer kcbot(klon) - logical ldcum(klon) - logical ldwork - real(kind=kind_phys) pgeoh(klon,klev+1) - real(kind=kind_phys) pmfu(klon,klev) - real(kind=kind_phys) pdmfen(klon) - real(kind=kind_phys) pdmfde(klon) - logical llo1 - integer jl - real(kind=kind_phys) zdz , zmf - real(kind=kind_phys) zentr(klon) - ! - !* 1. CALCULATE ENTRAINMENT AND DETRAINMENT RATES - ! ------------------------------------------- - if ( ldwork ) then - do jl = 1,klon - pdmfen(jl) = 0. - pdmfde(jl) = 0. - zentr(jl) = 0. - end do - ! - !* 1.1 SPECIFY ENTRAINMENT RATES - ! ------------------------- - do jl = 1, klon - if ( ldcum(jl) ) then - zdz = (pgeoh(jl,kk)-pgeoh(jl,kk+1))*zrg - zmf = pmfu(jl,kk+1)*zdz - llo1 = kk < kcbot(jl) - if ( llo1 ) then - pdmfen(jl) = zentr(jl)*zmf - pdmfde(jl) = 0.75e-4*zmf - end if - end if - end do - end if - end subroutine cuentrn -! -!-------------------------------------------------------- -! external functions -!------------------------------------------------------ - real(kind=kind_phys) function foealfa(tt) -! foealfa is calculated to distinguish the three cases: -! -! foealfa=1 water phase -! foealfa=0 ice phase -! 0 < foealfa < 1 mixed phase -! -! input : tt = temperature -! - implicit none - real(kind=kind_phys) tt - foealfa = min(1.,((max(rtice,min(rtwat,tt))-rtice) & - & /(rtwat-rtice))**2) - - return - end function foealfa - - real(kind=kind_phys) function foelhm(tt) - implicit none - real(kind=kind_phys) tt - foelhm = foealfa(tt)*alv + (1.-foealfa(tt))*als - return - end function foelhm - - real(kind=kind_phys) function foeewm(tt) - implicit none - real(kind=kind_phys) tt - foeewm = c2es * & - & (foealfa(tt)*exp(c3les*(tt-tmelt)/(tt-c4les))+ & - & (1.-foealfa(tt))*exp(c3ies*(tt-tmelt)/(tt-c4ies))) - return - end function foeewm - - real(kind=kind_phys) function foedem(tt) - implicit none - real(kind=kind_phys) tt - foedem = foealfa(tt)*r5alvcp*(1./(tt-c4les)**2)+ & - & (1.-foealfa(tt))*r5alscp*(1./(tt-c4ies)**2) - return - end function foedem - - real(kind=kind_phys) function foeldcpm(tt) - implicit none - real(kind=kind_phys) tt - foeldcpm = foealfa(tt)*ralvdcp+ & - & (1.-foealfa(tt))*ralsdcp - return - end function foeldcpm - - real(kind=kind_phys) function foeldcp(tt) - implicit none - real(kind=kind_phys) tt - foeldcp = foedelta(tt)*ralvdcp + (1.-foedelta(tt))*ralsdcp - end function foeldcp - - real(kind=kind_phys) function foedelta(tt) - implicit none - real(kind=kind_phys) tt - foedelta = max(0.,sign(1.,tt-tmelt)) - end function foedelta - -end module cu_ntiedtke - diff --git a/physics/cu_ntiedtke_post.F90 b/physics/cu_ntiedtke_post.F90 deleted file mode 100644 index fdc0b8b0f..000000000 --- a/physics/cu_ntiedtke_post.F90 +++ /dev/null @@ -1,53 +0,0 @@ -!> \file cu_ntiedtke_post.F90 -!! Contains code related to New Tiedtke convective scheme - -module cu_ntiedtke_post - - implicit none - - private - - public :: cu_ntiedtke_post_init, cu_ntiedtke_post_run, cu_ntiedtke_post_finalize - - contains - - subroutine cu_ntiedtke_post_init () - end subroutine cu_ntiedtke_post_init - - subroutine cu_ntiedtke_post_finalize() - end subroutine cu_ntiedtke_post_finalize - -!> \section arg_table_cu_ntiedtke_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|--------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | t | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | in | F | -!! | q | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | prevst | temperature_from_previous_timestep | temperature from previous time step | K | 2 | real | kind_phys | out | F | -!! | prevsq | moisture_from_previous_timestep | moisture from previous time step | kg kg-1 | 2 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine cu_ntiedtke_post_run (t, q, prevst, prevsq, errmsg, errflg) - - use machine, only: kind_phys - - implicit none - - ! Interface variables - real(kind_phys), intent(in) :: t(:,:) - real(kind_phys), intent(in) :: q(:,:) - real(kind_phys), intent(out) :: prevst(:,:) - real(kind_phys), intent(out) :: prevsq(:,:) - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - prevst(:,:) = t(:,:) - prevsq(:,:) = q(:,:) - - end subroutine cu_ntiedtke_post_run - -end module cu_ntiedtke_post diff --git a/physics/cu_ntiedtke_pre.F90 b/physics/cu_ntiedtke_pre.F90 deleted file mode 100644 index 725b4a351..000000000 --- a/physics/cu_ntiedtke_pre.F90 +++ /dev/null @@ -1,84 +0,0 @@ -!> \file cu_ntiedtke_pre.F90 -!! Contains code related to New Tiedtke convective scheme - -module cu_ntiedtke_pre - - implicit none - - private - - public :: cu_ntiedtke_pre_init, cu_ntiedtke_pre_run, cu_ntiedtke_pre_finalize - - contains - - subroutine cu_ntiedtke_pre_init () - end subroutine cu_ntiedtke_pre_init - - subroutine cu_ntiedtke_pre_finalize() - end subroutine cu_ntiedtke_pre_finalize - -!> \section arg_table_cu_ntiedtke_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|--------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | flag_init | flag_for_first_time_step | flag signaling first time step for time integration loop | flag | 0 | logical | | in | F | -!! | flag_restart | flag_for_restart | flag for restart (warmstart) or coldstart | flag | 0 | logical | | in | F | -!! | kdt | index_of_time_step | current forecast iteration | index | 0 | integer | | in | F | -!! | fhour | forecast_time | curent forecast time | h | 0 | real | kind_phys | in | F | -!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | -!! | t | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | in | F | -!! | q | water_vapor_specific_humidity | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | in | F | -!! | prevst | temperature_from_previous_timestep | temperature from previous time step | K | 2 | real | kind_phys | in | F | -!! | prevsq | moisture_from_previous_timestep | moisture from previous time step | kg kg-1 | 2 | real | kind_phys | in | F | -!! | forcet | temperature_tendency_due_to_dynamics | temperature tendency due to dynamics only | K s-1 | 2 | real | kind_phys | out | F | -!! | forceq | moisture_tendency_due_to_dynamics | moisture tendency due to dynamics only | kg kg-1 s-1 | 2 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine cu_ntiedtke_pre_run (flag_init, flag_restart, kdt, fhour, dtp, t, q, prevst, prevsq, & - forcet, forceq, errmsg, errflg) - - use machine, only: kind_phys - - implicit none - - logical, intent(in) :: flag_init - logical, intent(in) :: flag_restart - integer, intent(in) :: kdt - real(kind_phys), intent(in) :: fhour - real(kind_phys), intent(in) :: dtp - real(kind_phys), intent(in) :: t(:,:) - real(kind_phys), intent(in) :: q(:,:) - real(kind_phys), intent(in) :: prevst(:,:) - real(kind_phys), intent(in) :: prevsq(:,:) - real(kind_phys), intent(out) :: forcet(:,:) - real(kind_phys), intent(out) :: forceq(:,:) - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! local variables - real(kind=kind_phys) :: dtdyn - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - ! For restart runs, can assume that prevst and prevsq - ! are read from the restart files beforehand, same - ! for conv_act. - if(flag_init .and. .not.flag_restart) then - forcet(:,:)=0.0 - forceq(:,:)=0.0 - else - dtdyn=3600.0*(fhour)/kdt - if(dtp > dtdyn) then - forcet(:,:)=(t(:,:) - prevst(:,:))/dtp - forceq(:,:)=(q(:,:) - prevsq(:,:))/dtp - else - forcet(:,:)=(t(:,:) - prevst(:,:))/dtdyn - forceq(:,:)=(q(:,:) - prevsq(:,:))/dtdyn - endif - endif - - end subroutine cu_ntiedtke_pre_run - -end module cu_ntiedtke_pre diff --git a/physics/gcm_shoc.F90 b/physics/gcm_shoc.F90 deleted file mode 100644 index f2c9b7a7b..000000000 --- a/physics/gcm_shoc.F90 +++ /dev/null @@ -1,2040 +0,0 @@ -!> \file gcm_shoc.F90 -!! Contains the Simplified Higher-Order Closure (SHOC) scheme. - -!> This module contains the CCPP-compliant SHOC scheme. -module shoc - use machine, only: kind_phys - - implicit none - - private - - public shoc_run, shoc_init, shoc_finalize - -contains - -subroutine shoc_init () -end subroutine shoc_init - -subroutine shoc_finalize () -end subroutine shoc_finalize - -#if 0 -!> \section arg_table_shoc_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------------------|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|---------------|------|------------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | nx | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | nzm | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | do_shoc | flag_for_shoc | flag for SHOC | flag | 0 | logical | | in | F | -!! | shocaftcnv | flag_for_shoc_after_convection | flag to execute SHOC after convection | flag | 0 | logical | | in | F | -!! | mg3_as_mg2 | flag_mg3_as_mg2 | flag for controlling prep for Morrison-Gettelman microphysics | flag | 0 | logical | | in | F | -!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_zhao_carr | flag_for_zhao_carr_microphysics_scheme | choice of Zhao-Carr microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_zhao_carr_pdf | flag_for_zhao_carr_pdf_microphysics_scheme | choice of Zhao-Carr microphysics scheme with PDF clouds | flag | 0 | integer | | in | F | -!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman rmicrophysics scheme | flag | 0 | integer | | in | F | -!! | fprcp | number_of_frozen_precipitation_species | number of frozen precipitation species | count | 0 | integer | | in | F | -!! | tcr | cloud_phase_transition_threshold_temperature | threshold temperature below which cloud starts to freeze | K | 0 | real | kind_phys | in | F | -!! | tcrf | cloud_phase_transition_denominator | denominator in cloud phase transition = 1/(tcr-tf) | K-1 | 0 | real | kind_phys | in | F | -!! | con_cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | con_hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | con_hfus | latent_heat_of_fusion_of_water_at_0C | latent heat of fusion | J kg-1 | 0 | real | kind_phys | in | F | -!! | con_rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | con_rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | con_pi | pi | ratio of a circle's circumference to its diameter | radians | 0 | real | kind_phys | in | F | -!! | con_fvirt | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | gq0_cloud_ice | ice_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of ice water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gq0_rain | rain_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of rain water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gq0_snow | snow_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of snow water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gq0_graupel | graupel_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of graupel updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | dtp | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | -!! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | u | x_wind_updated_by_physics | zonal wind updated by physics | m s-1 | 2 | real | kind_phys | in | F | -!! | v | y_wind_updated_by_physics | meridional wind updated by physics | m s-1 | 2 | real | kind_phys | in | F | -!! | omega | omega | layer mean vertical velocity | Pa s-1 | 2 | real | kind_phys | in | F | -!! | rhc | critical_relative_humidity | critical relative humidity | frac | 2 | real | kind_phys | in | F | -!! | supice | ice_supersaturation_threshold | ice supersaturation parameter for PDF clouds | none | 0 | real | kind_phys | in | F | -!! | pcrit | shoc_tke_dissipatation_pressure_threshold | pressure below which extra TKE diss. is applied in SHOC | Pa | 0 | real | kind_phys | in | F | -!! | cefac | shoc_tke_dissipation_tunable_parameter | mult. tuning parameter for TKE diss. in SHOC | none | 0 | real | kind_phys | in | F | -!! | cesfac | shoc_tke_dissipation_tunable_parameter_near_surface | mult. tuning parameter for TKE diss. at surface in SHOC | none | 0 | real | kind_phys | in | F | -!! | tkef1 | shoc_implicit_TKE_integration_uncentering_term | uncentering term for TKE integration in SHOC | none | 0 | real | kind_phys | in | F | -!! | dis_opt | shoc_flag_for_optional_surface_TKE_dissipation | flag for alt. TKE diss. near surface in SHOC (>0 = ON) | none | 0 | real | kind_phys | in | F | -!! | hflx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | prnum | prandtl_number | turbulent Prandtl number | none | 2 | real | kind_phys | in | F | -!! | skip_macro | flag_skip_macro | flag to skip cloud macrophysics in Morrison scheme | flag | 0 | logical | | inout | F | -!! | clw_ice | ice_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | clw_liquid | cloud_condensed_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | gq0_cloud_liquid | cloud_condensed_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of cloud condensed water updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ncpl | cloud_droplet_number_concentration_updated_by_physics | number concentration of cloud droplets updated by physics | kg-1 | 2 | real | kind_phys | inout | F | -!! | ncpi | ice_number_concentration_updated_by_physics | number concentration of ice updated by physics | kg-1 | 2 | real | kind_phys | inout | F | -!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | inout | F | -!! | gq0_water_vapor | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | cld_sgs | subgrid_scale_cloud_fraction_from_shoc | subgrid-scale cloud fraction from the SHOC scheme | frac | 2 | real | kind_phys | inout | F | -!! | tke | turbulent_kinetic_energy_convective_transport_tracer | turbulent kinetic energy in the convectively transported tracer array | m2 s-2 | 2 | real | kind_phys | inout | F | -!! | tkh | atmosphere_heat_diffusivity_from_shoc | diffusivity for heat from the SHOC scheme | m2 s-1 | 2 | real | kind_phys | inout | F | -!! | wthv_sec | kinematic_buoyancy_flux_from_shoc | upward kinematic buoyancy flux from the SHOC scheme | K m s-1 | 2 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! -#endif -subroutine shoc_run (ix, nx, nzm, do_shoc, shocaftcnv, mg3_as_mg2, imp_physics, imp_physics_gfdl, imp_physics_zhao_carr, & - imp_physics_zhao_carr_pdf, imp_physics_mg, fprcp, tcr, tcrf, con_cp, con_g, con_hvap, con_hfus, con_rv, con_rd, con_pi, & - con_fvirt, gq0_cloud_ice, gq0_rain, gq0_snow, gq0_graupel, dtp, me, prsl, phii, phil, u, v, omega, rhc, supice, pcrit, & - cefac, cesfac, tkef1, dis_opt, hflx, evap, prnum, & - skip_macro, clw_ice, clw_liquid, gq0_cloud_liquid, ncpl, ncpi, gt0, gq0_water_vapor, cld_sgs, tke, tkh, wthv_sec, & - errmsg, errflg) - - implicit none - - integer, intent(in) :: ix, nx, nzm, imp_physics, imp_physics_gfdl, imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, & - imp_physics_mg, fprcp, me - logical, intent(in) :: do_shoc, shocaftcnv, mg3_as_mg2 - real(kind=kind_phys), intent(in) :: tcr, tcrf, con_cp, con_g, con_hvap, con_hfus, con_rv, con_rd, con_pi, con_fvirt, & - dtp, supice, pcrit, cefac, cesfac, tkef1, dis_opt - ! - real(kind=kind_phys), intent(in), dimension(nx) :: hflx, evap - real(kind=kind_phys), intent(in), dimension(nx,nzm) :: gq0_cloud_ice, gq0_rain, gq0_snow, gq0_graupel, prsl, phil, & - u, v, omega, rhc, prnum - real(kind=kind_phys), intent(in), dimension(nx,nzm+1) :: phii - ! - logical, intent(inout) :: skip_macro - real(kind=kind_phys), intent(inout), dimension(nx,nzm) :: clw_ice, clw_liquid, gq0_cloud_liquid, ncpl, ncpi, gt0, & - gq0_water_vapor, cld_sgs, tke, tkh, wthv_sec - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - real(kind=kind_phys), parameter :: epsq = 1.e-20 - - integer :: i, k - - real(kind=kind_phys) :: tem - real(kind=kind_phys), dimension(nx,nzm) :: qsnw ! qsnw can be local to this routine - real(kind=kind_phys), dimension(nx,nzm) :: qgl ! qgl can be local to this routine - -! Initialize CCPP error handling variables - - errmsg = '' - errflg = 0 - - if (shocaftcnv) then - if (imp_physics == imp_physics_mg) then - skip_macro = do_shoc - if (abs(fprcp) == 1 .or. mg3_as_mg2) then - do k=1,nzm - do i=1,nx - !GF - gq0(ntrw) is passed in directly, no need to copy - !qrn(i,k) = gq0_rain(i,k) - qsnw(i,k) = gq0_snow(i,k) - qgl(i,k) = 0.0 - enddo - enddo - elseif (fprcp > 1) then - do k=1,nzm - do i=1,nx - !qrn(i,k) = gq0_rain(i,k) - qsnw(i,k) = gq0_snow(i,k) + gq0_graupel(i,k) - qgl(i,k) = 0.0 - enddo - enddo - endif - endif - else - if (imp_physics == imp_physics_mg) then - skip_macro = do_shoc - do k=1,nzm - do i=1,nx - ! DH* THESE ARE NOT IN THE ORIGINAL CODE (AND THEY WERE NEVER) ::: clw_ice(i,k) = gq0_cloud_ice(i,k) ! ice - ! DH* THESE ARE NOT IN THE ORIGINAL CODE (AND THEY WERE NEVER) ::: clw_liquid(i,k) = gq0_cloud_liquid(i,k) ! water - !GF - since gq0(ntlnc/ntinc) are passed in directly, no need to copy - !ncpl(i,k) = Stateout%gq0(i,k,ntlnc) - !ncpi(i,k) = Stateout%gq0(i,k,ntinc) - enddo - enddo - if (abs(fprcp) == 1 .or. mg3_as_mg2) then - do k=1,nzm - do i=1,nx - !GF - gq0(ntrw) is passed in directly, no need to copy - !qrn(i,k) = gq0_rain(i,k) - qsnw(i,k) = gq0_snow(i,k) - qgl(i,k) = 0.0 - enddo - enddo - elseif (fprcp > 1) then - do k=1,nzm - do i=1,nx - !qrn(i,k) = gq0_rain(i,k) - qsnw(i,k) = gq0_snow(i,k) + gq0_graupel(i,k) - qgl(i,k) = 0.0 - clw_ice(i,k) = clw_ice(i,k) + gq0_graupel(i,k) - enddo - enddo - endif - elseif (imp_physics == imp_physics_gfdl) then ! GFDL MP - needs modify for condensation - do k=1,nzm - do i=1,nx - clw_ice(i,k) = gq0_cloud_ice(i,k) ! ice - clw_liquid(i,k) = gq0_cloud_liquid(i,k) ! water - !qrn(i,k) = gq0_rain(i,k) - qsnw(i,k) = gq0_snow(i,k) - qgl(i,k) = 0.0 - enddo - enddo - elseif (imp_physics == imp_physics_zhao_carr .or. imp_physics == imp_physics_zhao_carr_pdf) then - do k=1,nzm - do i=1,nx - if (abs(gq0_cloud_liquid(i,k)) < epsq) then - gq0_cloud_liquid(i,k) = 0.0 - endif - tem = gq0_cloud_liquid(i,k) * max(0.0, MIN(1.0, (tcr-gt0(i,k))*tcrf)) - clw_ice(i,k) = tem ! ice - clw_liquid(i,k) = gq0_cloud_liquid(i,k) - tem ! water - qsnw(i,k) = 0.0 - qgl(i,k) = 0.0 - enddo - enddo - endif - endif !shocaftcnv - - ! phy_f3d(1,1,ntot3d-2) - shoc determined sgs clouds - ! phy_f3d(1,1,ntot3d-1) - shoc determined diffusion coefficients - ! phy_f3d(1,1,ntot3d ) - shoc determined w'theta' - - !GFDL lat has no meaning inside of shoc - changed to "1" - - - ! DH* can we pass in gq0_graupel? is that zero? the original code - ! passes in qgl which is zero (always? sometimes?), in shoc_work - ! this qgl gets added to qpi, qpi = qpi_i + qgl with qpi_i = qsnw; - ! - with the above qsnw(i,k) = gq0_snow(i,k) + gq0_graupel(i,k), - ! would that be double counting? *DH - call shoc_work (ix, nx, 1, nzm, nzm+1, dtp, me, 1, prsl, & - phii, phil, u, v, omega, gt0, & - gq0_water_vapor, clw_ice, clw_liquid, qsnw, gq0_rain, & - qgl, rhc, supice, pcrit, cefac, cesfac, tkef1, dis_opt, & - cld_sgs, tke, hflx, evap, prnum, tkh, wthv_sec, .false., 1, ncpl, ncpi, & - con_cp, con_g, con_hvap, con_hfus, con_rv, con_rd, con_pi, con_fvirt) - - if (.not.shocaftcnv) then - if (imp_physics == imp_physics_mg .and. fprcp > 1) then - do k=1,nzm - do i=1,nx - clw_ice(i,k) = clw_ice(i,k) - gq0_graupel(i,k) - enddo - enddo - endif - endif ! .not. shocaftcnv - - !GF since gq0(ntlnc/ntinc) are passed in directly, no need to copy back - ! if (ntlnc > 0 .and. ntinc > 0 .and. ncld >= 2) then - ! do k=1,nzm - ! do i=1,nx - ! Stateout%gq0(i,k,ntlnc) = ncpl(i,k) - ! Stateout%gq0(i,k,ntinc) = ncpi(i,k) - ! enddo - ! enddo - ! endif - -end subroutine shoc_run - - ! Implementation of the Simplified High Order Closure (SHOC) scheme - ! of Bogenschutz and Krueger (2013), J. Adv. Model. Earth Syst, 5, 195-211, - ! doi: 10.1002/jame.200118. (further referred to as BK13) - ! in a single column form suitable for use in a GCM physics package. - ! Alex Belochitski, heavily based on the code of Peter Bogenschutz. - ! S Moorthi - optimization, cleanup, improve and customize for gsm - ! - improved solution for sgs-tke equation - ! S Moorthi - 05-11-17 - modified shear production term to eliminate - ! spurious tke ove Antarctica. - ! S Moorthi - 01-12-17 - added extra pressure dependent tke dissipation at - ! pressures below a critical value pcrit - ! S Moorthi - 04-12-17 - fixed a bug in the definition of hl on input - ! replacing fac_fus by fac_sub - ! S.Moorthi - 00-00-17 - added an alternate option for near boundary cek following - ! Scipion et. al., from U. Oklahoma. - subroutine shoc_work (ix, nx, ny, nzm, nz, dtn, me, lat, & - prsl, phii, phil, u, v, omega, tabs, & - qwv, qi, qc, qpi_i, qpl, qgl, rhc, supice, & - pcrit, cefac, cesfac, tkef1, dis_opt, & - cld_sgs, tke, hflx, evap, prnum, tkh, & - wthv_sec, lprnt, ipr, ncpl, ncpi, & - cp, ggr, lcond, lfus, rv, rgas, pi, epsv) - - use funcphys , only : fpvsl, fpvsi, fpvs ! saturation vapor pressure for water & ice - - implicit none - - real, intent(in) :: cp, ggr, lcond, lfus, rv, rgas, pi, epsv - integer, intent(in) :: ix ! max number of points in the physics window in the x - integer, intent(in) :: nx ! Number of points in the physics window in the x - integer, intent(in) :: ny ! and y directions - integer, intent(in) :: me ! MPI rank - integer, intent(in) :: lat ! latitude - - integer, intent(in) :: nzm ! Number of vertical layers - integer, intent(in) :: nz ! Number of layer interfaces (= nzm + 1) - real, intent(in) :: dtn ! Physics time step, s - - real, intent(in) :: pcrit ! pressure in Pa below which additional tke dissipation is applied - real, intent(in) :: cefac ! tunable multiplier to dissipation term - real, intent(in) :: cesfac ! tunable multiplier to dissipation term for bottom level - real, intent(in) :: tkef1 ! uncentering terms in implicit tke integration - real, intent(in) :: dis_opt ! when > 0 use different formula for near surface dissipation - - real, intent(in) :: hflx(nx) - real, intent(in) :: evap(nx) - -! The interface is talored to GFS in a sense that input variables are 2D - - real, intent(in) :: prsl (ix,ny,nzm) ! mean layer presure - real, intent(in) :: phii (ix,ny,nz ) ! interface geopotential height - real, intent(in) :: phil (ix,ny,nzm) ! layer geopotential height - real, intent(in) :: u (ix,ny,nzm) ! u-wind, m/s - real, intent(in) :: v (ix,ny,nzm) ! v-wind, m/s - real, intent(in) :: omega (ix,ny,nzm) ! omega, Pa/s - real, intent(inout) :: tabs (ix,ny,nzm) ! temperature, K - real, intent(inout) :: qwv (ix,ny,nzm) ! water vapor mixing ratio, kg/kg - real, intent(inout) :: qc (ix,ny,nzm) ! cloud water mixing ratio, kg/kg - real, intent(inout) :: qi (ix,ny,nzm) ! cloud ice mixing ratio, kg/kg -! Anning Cheng 03/11/2016 SHOC feedback to number concentration - real, intent(inout) :: ncpl (nx,ny,nzm) ! cloud water number concentration,/m^3 - real, intent(inout) :: ncpi (nx,ny,nzm) ! cloud ice number concentration,/m^3 - real, intent(in) :: qpl (nx,ny,nzm) ! rain mixing ratio, kg/kg - not used at this time - real, intent(in) :: qpi_i (nx,ny,nzm) ! snow mixing ratio, kg/kg - not used at this time - real, intent(in) :: qgl (nx,ny,nzm) ! graupel mixing ratio, kg/kg - not used at this time - real, intent(in) :: rhc (nx,ny,nzm) ! critical relative humidity - real, intent(in) :: supice ! ice supersaturation parameter - real, intent(inout) :: cld_sgs(ix,ny,nzm) ! sgs cloud fraction -! real, intent(inout) :: cld_sgs(nx,ny,nzm) ! sgs cloud fraction - real, intent(inout) :: tke (ix,ny,nzm) ! turbulent kinetic energy. m**2/s**2 -! real, intent(inout) :: tk (nx,ny,nzm) ! eddy viscosity - real, intent(inout) :: tkh (ix,ny,nzm) ! eddy diffusivity - real, intent(in) :: prnum (nx,ny,nzm) ! turbulent Prandtl number - real, intent(inout) :: wthv_sec (ix,ny,nzm) ! Buoyancy flux, K*m/s - - real, parameter :: zero=0.0, one=1.0, half=0.5, two=2.0, eps=0.622, & - three=3.0, oneb3=one/three, twoby3=two/three - real, parameter :: sqrt2 = sqrt(two), twoby15 = two / 15.0, & - skew_facw=1.2, skew_fact=0.0, & - tkhmax=300.0 - real :: lsub, fac_cond, fac_fus, cpolv, fac_sub, ggri, kapa, gocp, rog, sqrtpii, & - epsterm, onebeps, onebrvcp - -! SHOC tunable parameters - - real, parameter :: lambda = 0.04 -! real, parameter :: min_tke = 1e-6 ! Minumum TKE value, m**2/s**2 - real, parameter :: min_tke = 1e-4 ! Minumum TKE value, m**2/s**2 -! real, parameter :: max_tke = 100.0 ! Maximum TKE value, m**2/s**2 - real, parameter :: max_tke = 40.0 ! Maximum TKE value, m**2/s**2 -! Maximum turbulent eddy length scale, m -! real, parameter :: max_eddy_length_scale = 2000. - real, parameter :: max_eddy_length_scale = 1000. -! Maximum "return-to-isotropy" time scale, s - real, parameter :: max_eddy_dissipation_time_scale = 2000. - real, parameter :: Pr = 1.0 ! Prandtl number - -! Constants for the TKE dissipation term based on Deardorff (1980) - real, parameter :: pt19=0.19, pt51=0.51, pt01=0.01, atmin=0.01, atmax=one-atmin - real, parameter :: Cs = 0.15, epsln=1.0e-6 - real, parameter :: Ck = 0.1 ! Coeff in the eddy diffusivity - TKE relationship, see Eq. 7 in BK13 - -! real, parameter :: Ce = Ck**3/(0.7*Cs**4) -! real, parameter :: Ce = Ck**3/(0.7*Cs**4) * 2.2 -! real, parameter :: Ce = Ck**3/(0.7*Cs**4) * 3.0 , Ces = Ce -! real, parameter :: Ce = Ck**3/(0.7*Cs**4) * 2.5 , Ces = Ce * 3.0 / 2.5 -! real, parameter :: Ces = Ce/0.7*3.0 - -! real, parameter :: Ce = Ck**3/(0.7*Cs**4), Ces = Ce*3.0/0.7 ! Commented Moor - - real, parameter :: Ce = Ck**3/Cs**4, Ces = Ce -! real, parameter :: Ce = Ck**3/Cs**4, Ces = Ce*3.0/0.7 - -! real, parameter :: vonk=0.35 ! Von Karman constant - real, parameter :: vonk=0.4 ! Von Karman constant Moorthi - as in GFS - real, parameter :: tscale=400.! time scale set based off of similarity results of BK13, s - real, parameter :: w_tol_sqd = 4.0e-04 ! Min vlaue of second moment of w -! real, parameter :: w_tol_sqd = 1.0e-04 ! Min vlaue of second moment of w - real, parameter :: w_thresh = 0.0, thresh = 0.0 - real, parameter :: w3_tol = 1.0e-20 ! Min vlaue of third moment of w - - -! These parameters are a tie-in with a microphysical scheme -! Double check their values for the Zhao-Carr scheme. - real, parameter :: tbgmin = 233.16 ! Minimum temperature for cloud water., K (ZC) -! real, parameter :: tbgmin = 258.16 ! Minimum temperature for cloud water., K (ZC) -! real, parameter :: tbgmin = 253.16 ! Minimum temperature for cloud water., K - real, parameter :: tbgmax = 273.16 ! Maximum temperature for cloud ice, K - real, parameter :: a_bg = one/(tbgmax-tbgmin) -! -! Parameters to tune the second order moments- No tuning is performed currently - - real, parameter :: thl2tune = 1.0, qw2tune = 1.0, qwthl2tune = 1.0, & -! thl_tol = 1.e-4, rt_tol = 1.e-8, basetemp = 300.0 - thl_tol = 1.e-2, rt_tol = 1.e-4, basetemp = 300.0 - - integer, parameter :: nitr=6 - -! Local variables. Note that pressure is in millibars in the SHOC code. - - logical lprnt - integer ipr - - real zl (nx,ny,nzm) ! height of the pressure levels above surface, m - real zi (nx,ny,nz) ! height of the interface levels, m - real adzl (nx,ny,nzm) ! layer thickness i.e. zi(k+1)-zi(k) - defined at levels - real adzi (nx,ny,nz) ! level thickness i.e. zl(k)-zl(k-1) - defined at interface - - real hl (nx,ny,nzm) ! liquid/ice water static energy , K - real qv (nx,ny,nzm) ! water vapor, kg/kg - real qcl (nx,ny,nzm) ! liquid water (condensate), kg/kg - real qci (nx,ny,nzm) ! ice water (condensate), kg/kg - real w (nx,ny,nzm) ! z-wind, m/s - real bet (nx,ny,nzm) ! ggr/tv0 - real gamaz (nx,ny,nzm) ! ggr/cp*z - real qpi (nx,ny,nzm) ! snow + graupel mixing ratio, kg/kg -! real qpl (nx,ny,nzm) ! rain mixing ratio, kg/kg - -! Moments of the trivariate double Gaussian PDF for the SGS total water mixing ratio -! SGS liquid/ice static energy, and vertical velocity - - real qw_sec (nx,ny,nzm) ! Second moment total water mixing ratio, kg^2/kg^2 - real thl_sec (nx,ny,nzm) ! Second moment liquid/ice static energy, K^2 - real qwthl_sec(nx,ny,nzm) ! Covariance tot. wat. mix. ratio and static energy, K*kg/kg - real wqw_sec (nx,ny,nzm) ! Turbulent flux of tot. wat. mix., kg/kg*m/s - real wthl_sec (nx,ny,nzm) ! Turbulent flux of liquid/ice static energy, K*m/s - real w_sec (nx,ny,nzm) ! Second moment of vertical velocity, m**2/s**2 - real w3 (nx,ny,nzm) ! Third moment of vertical velocity, m**3/s**3 - real wqp_sec (nx,ny,nzm) ! Turbulent flux of precipitation, kg/kg*m/s - -! Eddy length formulation - real smixt (nx,ny,nzm) ! Turbulent length scale, m - real isotropy (nx,ny,nzm) ! "Return-to-isotropy" eddy dissipation time scale, s -! real isotropy_debug (nx,ny,nzm) ! Return to isotropy scale, s without artificial limits - real brunt (nx,ny,nzm) ! Moist Brunt-Vaisalla frequency, s^-1 - real conv_vel2(nx,ny,nzm) ! Convective velocity scale cubed, m^3/s^3 - - real cek(nx,ny) - -! Output of SHOC - real diag_frac, diag_qn, diag_qi, diag_ql - -! real diag_frac(nx,ny,nzm) ! SGS cloud fraction -! real diag_qn (nx,ny,nzm) ! SGS cloud+ice condensate, kg/kg -! real diag_qi (nx,ny,nzm) ! SGS ice condensate, kg/kg -! real diag_ql (nx,ny,nzm) ! SGS liquid condensate, kg/kg - - -! Horizontally averaged variables -! real conv_vel(nzm) ! Convective velocity scale cubed, m^3/s^3 - real wqlsb (nzm) ! liquid water flux, kg/kg/ m/s - real wqisb (nzm) ! ice flux, kg/kg m/s -! real thlv (nzm) ! Grid-scale level-average virtual potential temperature -! (not used) - - -! Local variables - -! real, dimension(nx,ny,nzm) :: tkesbbuoy, tkesbshear, tkesbdiss, tkesbbuoy_debug & -! tkebuoy_sgs, total_water, tscale1_debug, brunt2 - - real, dimension(nx,ny,nzm) :: total_water, brunt2, thv, tkesbdiss - real, dimension(nx,ny,nzm) :: def2 - real, dimension(nx,ny) :: denom, numer, l_inf, cldarr, thedz, thedz2 - - real lstarn, depth, omn, betdz, bbb, term, qsatt, dqsat, & - conv_var, tkes, skew_w, skew_qw, aterm, w1_1, w1_2, w2_1, & - w2_2, w3var, thl1_1, thl1_2, thl2_1, thl2_2, qw1_1, qw1_2, qw2_1, & - qw2_2, ql1, ql2, w_ql1, w_ql2, & - r_qwthl_1, r_wqw_1, r_wthl_1, testvar, s1, s2, std_s1, std_s2, C1, C2, & - thl_first, qw_first, w_first, Tl1_1, Tl1_2, betatest, pval, pkap, & - w2thl, w2qw,w2ql, w2ql_1, w2ql_2, & - thec, thlsec, qwsec, qwthlsec, wqwsec, wthlsec, thestd,dum, & - cqt1, cthl1, cqt2, cthl2, qn1, qn2, qi1, qi2, omn1, omn2, & - basetemp2, beta1, beta2, qs1, qs2, & - esval1_1, esval2_1, esval1_2, esval2_2, om1, om2, & - lstarn1, lstarn2, sqrtw2, sqrtthl, sqrtqt, & - sqrtstd1, sqrtstd2, tsign, tvar, sqrtw2t, wqls, wqis, & - sqrtqw2_1, sqrtqw2_2, sqrtthl2_1, sqrtthl2_2, sm, prespot, & - corrtest1, corrtest2, wrk, wrk1, wrk2, wrk3, onema, pfac - - - integer i,j,k,km1,ku,kd,ka,kb - -!calculate derived constants - lsub = lcond+lfus - fac_cond = lcond/cp - fac_fus = lfus/cp - cpolv = cp/lcond - fac_sub = lsub/cp - ggri = 1.0/ggr - kapa = rgas/cp - gocp = ggr/cp - rog = rgas*ggri - sqrtpii = one/sqrt(pi+pi) - epsterm = rgas/rv - onebeps = one/epsterm - onebrvcp= one/(rv*cp) - -! Map GFS variables to those of SHOC - SHOC operates on 3D fields -! Here a Y-dimension is added to the input variables, along with some unit conversions - - do k=1,nz - do j=1,ny - do i=1,nx - zi(i,j,k) = phii(i,j,k) * ggri - enddo - enddo - enddo - -! if (lprnt) write(0,*)' tabsin=',tabs(ipr,1,1:40) -! if (lprnt) write(0,*)' qcin=',qc(ipr,1,1:40) -! if (lprnt) write(0,*)' qwvin=',qwv(ipr,1,1:40) -! if (lprnt) write(0,*)' qiin=',qi(ipr,1,1:40) -! if (lprnt) write(0,*)' qplin=',qpl(ipr,1,1:40) -! if (lprnt) write(0,*)' qpiin=',qpi(ipr,1,1:40) -! -! move water from vapor to condensate if the condensate is negative -! - do k=1,nzm - do j=1,ny - do i=1,nx - if (qc(i,j,k) < zero) then - wrk = qwv(i,j,k) + qc(i,j,k) - if (wrk >= zero) then - qwv(i,j,k) = wrk - tabs(i,j,k) = tabs(i,j,k) - fac_cond * qc(i,j,k) - qc(i,j,k) = zero - else - qc(i,j,k) = zero - tabs(i,j,k) = tabs(i,j,k) + fac_cond * qwv(i,j,k) - qwv(i,j,k) = zero - endif - endif - if (qi(i,j,k) < zero) then - wrk = qwv(i,j,k) + qi(i,j,k) - if (wrk >= zero) then - qwv(i,j,k) = wrk - tabs(i,j,k) = tabs(i,j,k) - fac_sub * qi(i,j,k) - qi(i,j,k) = zero - else - qi(i,j,k) = zero - tabs(i,j,k) = tabs(i,j,k) + fac_sub * qwv(i,j,k) - qwv(i,j,k) = zero - endif - endif - enddo - enddo - enddo - -! if (lprnt) write(0,*)' tabsin2=',tabs(ipr,1,1:40) - - do k=1,nzm - do j=1,ny - do i=1,nx - zl(i,j,k) = phil(i,j,k) * ggri - wrk = one / prsl(i,j,k) - qv(i,j,k) = max(qwv(i,j,k), zero) - thv(i,j,k) = tabs(i,j,k) * (one+epsv*qv(i,j,k)) - w(i,j,k) = - rog * omega(i,j,k) * thv(i,j,k) * wrk - qcl(i,j,k) = max(qc(i,j,k), zero) - qci(i,j,k) = max(qi(i,j,k), zero) - qpi(i,j,k) = qpi_i(i,j,k) + qgl(i,j,k) ! add snow and graupel together -! -! qpl(i,j,k) = zero ! comment or remove when using with prognostic rain/snow -! qpi(i,j,k) = zero ! comment or remove when using with prognostic rain/snow - - wqp_sec(i,j,k) = zero ! Turbulent flux of precipiation -! - total_water(i,j,k) = qcl(i,j,k) + qci(i,j,k) + qv(i,j,k) - - prespot = (100000.0*wrk) ** kapa ! Exner function - bet(i,j,k) = ggr/(tabs(i,j,k)*prespot) ! Moorthi - thv(i,j,k) = thv(i,j,k)*prespot ! Moorthi -! -! Lapse rate * height = reference temperature - gamaz(i,j,k) = gocp * zl(i,j,k) - -! Liquid/ice water static energy - ! Note the the units are degrees K - hl(i,j,k) = tabs(i,j,k) + gamaz(i,j,k) - fac_cond*(qcl(i,j,k)+qpl(i,j,k)) & - - fac_sub *(qci(i,j,k)+qpi(i,j,k)) - w3(i,j,k) = zero - enddo - enddo - enddo - -! if (lprnt) write(0,*)' hlin=',hl(ipr,1,1:40) - -! Define vertical grid increments for later use in the vertical differentiation - - do k=2,nzm - km1 = k - 1 - do j=1,ny - do i=1,nx - adzi(i,j,k) = zl(i,j,k) - zl(i,j,km1) - adzl(i,j,km1) = zi(i,j,k) - zi(i,j,km1) - enddo - enddo - enddo - do j=1,ny - do i=1,nx - adzi(i,j,1) = (zl(i,j,1)-zi(i,j,1)) ! unused in the code - adzi(i,j,nz) = adzi(i,j,nzm) ! at the top - probably unused - adzl(i,j,nzm) = zi(i,j,nz) - zi(i,j,nzm) -! - wthl_sec(i,j,1) = hflx(i) - wqw_sec(i,j,1) = evap(i) - enddo - enddo - - - call tke_shoc() ! Integrate prognostic TKE equation forward in time - - -! diagnose second order moments of the subgrid PDF following -! Redelsperger J.L., and G. Sommeria, 1986, JAS, 43, 2619-2635 sans the use of stabilty -! weighting functions - Result is in global variables w_sec, thl_sec, qw_sec, and qwthl_sec - -! call diag_moments(total_water,tke,tkh) - -! Second moment of vertical velocity. -! Note that Eq 6 in BK13 gives a different expression that is dependent on -! vertical gradient of grid scale vertical velocity - - do k=1,nzm - ku = k+1 - kd = k-1 - ka = ku - kb = k - if (k == 1) then - kd = k - kb = ka - elseif (k == nzm) then - ku = k - ka = kb - endif - do j=1,ny - do i=1,nx - if (tke(i,j,k) > zero) then -! wrk = half*(tkh(i,j,ka)+tkh(i,j,kb))*(w(i,j,ku) - w(i,j,kd)) & - wrk = half*(tkh(i,j,ka)*prnum(i,j,ka)+tkh(i,j,kb)*prnum(i,j,kb))*(w(i,j,ku) - w(i,j,kd)) & - * sqrt(tke(i,j,k)) / (zl(i,j,ku) - zl(i,j,kd)) - w_sec(i,j,k) = max(twoby3 * tke(i,j,k) - twoby15 * wrk, zero) -! w_sec(i,j,k) = max(twoby3 * tke(i,j,k), zero) -! if(lprnt .and. i == ipr .and. k <40) write(0,*)' w_sec=',w_sec(i,j,k),' tke=r',tke(i,j,k),& -! ' tkh=',tkh(i,j,ka),tkh(i,j,kb),' w=',w(i,j,ku),w(i,j,kd),' prnum=',prnum(i,j,ka),prnum(i,j,kb) - else - w_sec(i,j,k) = zero - endif - enddo - enddo - enddo - - do k=2,nzm - - km1 = k - 1 - do j=1,ny - do i=1,nx - -! Use backward difference in the vertical, use averaged values of "return-to-isotropy" -! time scale and diffusion coefficient - - wrk1 = one / adzi(i,j,k) ! adzi(k) = (zl(k)-zl(km1)) -! wrk3 = max(tkh(i,j,k),pt01) * wrk1 - wrk3 = max(tkh(i,j,k),epsln) * wrk1 - - sm = half*(isotropy(i,j,k)+isotropy(i,j,km1))*wrk1*wrk3 ! Tau*Kh/dz^2 - -! SGS vertical flux liquid/ice water static energy. Eq 1 in BK13 -! No rain, snow or graupel in pdf (Annig, 08/29/2018) - - wrk1 = hl(i,j,k) - hl(i,j,km1) & - + (qpl(i,j,k) - qpl(i,j,km1)) * fac_cond & - + (qpi(i,j,k) - qpi(i,j,km1)) * fac_sub - wthl_sec(i,j,k) = - wrk3 * wrk1 - -! SGS vertical flux of total water. Eq 2 in BK13 - - wrk2 = total_water(i,j,k) - total_water(i,j,km1) - wqw_sec(i,j,k) = - wrk3 * wrk2 - -! Second moment of liquid/ice water static energy. Eq 4 in BK13 - - thl_sec(i,j,k) = thl2tune * sm * wrk1 * wrk1 - -! Second moment of total water mixing ratio. Eq 3 in BK13 - - qw_sec(i,j,k) = qw2tune * sm * wrk2 * wrk2 - -! Covariance of total water mixing ratio and liquid/ice water static energy. -! Eq 5 in BK13 - - qwthl_sec(i,j,k) = qwthl2tune * sm * wrk1 * wrk2 - - enddo ! i loop - enddo ! j loop - enddo ! k loop - -! These would be at the surface - do we need them? - do j=1,ny - do i=1,nx -! wthl_sec(i,j,1) = wthl_sec(i,j,2) -! wqw_sec(i,j,1) = wqw_sec(i,j,2) - thl_sec(i,j,1) = thl_sec(i,j,2) - qw_sec(i,j,1) = qw_sec(i,j,2) - qwthl_sec(i,j,1) = qwthl_sec(i,j,2) - enddo - enddo - -! Diagnose the third moment of SGS vertical velocity - - call canuto() - -! Recover parameters of the subgrid PDF using diagnosed moments -! and calculate SGS cloudiness, condensation and it's effects on temeperature -! and moisture variables - - call assumed_pdf() - -contains - - subroutine tke_shoc() - -! This subroutine solves the TKE equation, -! Heavily based on SAM's tke_full.f90 by Marat Khairoutdinov - - real grd,betdz,Cee,lstarn, lstarp, bbb, omn, omp,qsatt,dqsat, smix, & - buoy_sgs,ratio,a_prod_sh,a_prod_bu,a_diss,a_prod_bu_debug, buoy_sgs_debug, & - tscale1, wrk, wrk1, wtke, wtk2, rdtn, tkef2 - integer i,j,k,ku,kd,itr,k1 - - rdtn = one / dtn - - call tke_shear_prod(def2) ! Calculate shear production of TKE - -! Ensure values of TKE are reasonable - - do k=1,nzm - do j=1,ny - do i=1,nx - tke(i,j,k) = max(min_tke,tke(i,j,k)) - tkesbdiss(i,j,k) = zero -! tkesbshear(i,j,k) = zero -! tkesbbuoy(i,j,k) = zero - enddo - enddo - enddo - - call eddy_length() ! Find turbulent mixing length - call check_eddy() ! Make sure it's reasonable - - tkef2 = 1.0 - tkef1 - do k=1,nzm - ku = k+1 - kd = k - -! Cek = Ce * cefac - - if(k == 1) then - ku = 2 - kd = 2 -! Cek = Ces - elseif(k == nzm) then - ku = k - kd = k -! Cek = Ces - endif - - if (dis_opt > 0) then - do j=1,ny - do i=1,nx - wrk = (zl(i,j,k)-zi(i,j,1)) / adzl(i,j,1) + 1.5 - cek(i,j) = 1.0 + 2.0 / max((wrk*wrk - 3.3), 0.5) - enddo - enddo - else - if (k == 1) then - cek = ces * cesfac - else - cek = ce * cefac - endif - endif - - do j=1,ny - do i=1,nx - grd = adzl(i,j,k) ! adzl(k) = zi(k+1)-zi(k) - - -! TKE boyancy production term. wthv_sec (buoyancy flux) is calculated in -! assumed_pdf(). The value used here is from the previous time step - - a_prod_bu = ggr / thv(i,j,k) * wthv_sec(i,j,k) - -! If wthv_sec from subgrid PDF is not available use Brunt-Vaisalla frequency from eddy_length() - -!Obtain Brunt-Vaisalla frequency from diagnosed SGS buoyancy flux -!Presumably it is more precise than BV freq. calculated in eddy_length()? - - buoy_sgs = - (a_prod_bu+a_prod_bu) / (tkh(i,j,ku)+tkh(i,j,kd) + 0.0001) ! tkh is eddy thermal diffussivity - - -!Compute $c_k$ (variable Cee) for the TKE dissipation term following Deardorff (1980) - - if (buoy_sgs <= zero) then - smix = grd - else - smix = min(grd,max(0.1*grd, 0.76*sqrt(tke(i,j,k)/(buoy_sgs+1.e-10)))) - endif - - ratio = smix/grd - Cee = Cek(i,j) * (pt19 + pt51*ratio) * max(one, sqrt(pcrit/prsl(i,j,k))) - -! TKE shear production term - a_prod_sh = half*(def2(i,j,ku)*tkh(i,j,ku)*prnum(i,j,ku) & - + def2(i,j,kd)*tkh(i,j,kd)*prnum(i,j,kd)) - - -! smixt (turb. mixing lenght) is calculated in eddy_length() -! Explicitly integrate TKE equation forward in time -! a_diss = Cee/smixt(i,j,k)*tke(i,j,k)**1.5 ! TKE dissipation term -! tke(i,j,k) = max(zero,tke(i,j,k)+dtn*(max(zero,a_prod_sh+a_prod_bu)-a_diss)) - -! Semi-implicitly integrate TKE equation forward in time - - wtke = tke(i,j,k) - wtk2 = wtke -! wrk = (dtn*Cee)/smixt(i,j,k) - wrk = (dtn*Cee) / smixt(i,j,k) - wrk1 = wtke + dtn*(a_prod_sh+a_prod_bu) - -! if (lprnt .and. i == ipr .and. k<40) write(0,*)' wtke=',wtke,' wrk1=',wrk1,& -! ' a_prod_sh=',a_prod_sh,' a_prod_bu=',a_prod_bu,' dtn=',dtn,' smixt=',& -! smixt(i,j,k),' tkh=',tkh(i,j,ku),tkh(i,j,kd),' def2=',def2(i,j,ku),def2(i,j,kd)& -! ,' prnum=',prnum(i,j,ku),prnum(i,j,kd),' wthv_sec=',wthv_sec(i,j,k),' thv=',thv(i,j,k) - - do itr=1,nitr ! iterate for implicit solution - wtke = min(max(min_tke, wtke), max_tke) - a_diss = wrk*sqrt(wtke) ! Coefficient in the TKE dissipation term - wtke = wrk1 / (one+a_diss) - wtke = tkef1*wtke + tkef2*wtk2 ! tkef1+tkef2 = 1.0 - -! if (lprnt .and. i == ipr .and. k<40) write(0,*)' wtke=',wtke,' wtk2=',wtk2,& -! ' a_diss=',a_diss,' a_prod_sh=',a_prod_sh,' a_prod_bu=',a_prod_bu,& -! ' wrk1=',wrk1,' itr=',itr,' k=',k - - wtk2 = wtke - - enddo - - tke(i,j,k) = min(max(min_tke, wtke), max_tke) - a_diss = wrk*sqrt(tke(i,j,k)) - - tscale1 = (dtn+dtn) / a_diss ! corrected Eq 8 in BK13 -- tau = 2*tke/eps - - tkesbdiss(i,j,k) = rdtn*a_diss*tke(i,j,k) ! TKE dissipation term, epsilon - - -! Calculate "return-to-isotropy" eddy dissipation time scale, see Eq. 8 in BK13 - - if (buoy_sgs <= zero) then - isotropy(i,j,k) = min(max_eddy_dissipation_time_scale,tscale1) - else - isotropy(i,j,k) = min(max_eddy_dissipation_time_scale, & - tscale1/(one+lambda*buoy_sgs*tscale1*tscale1)) - endif - -! TKE budget terms - -! tkesbdiss(i,j,k) = a_diss -! tkesbshear(i,j,k) = a_prod_sh -! tkesbbuoy(i,j,k) = a_prod_bu -! tkesbbuoy_debug(i,j,k) = a_prod_bu_debug -! tkebuoy_sgs(i,j,k) = buoy_sgs - - enddo ! i loop - enddo ! j loop - enddo ! k -! - wrk = half * ck - do k=2,nzm - k1 = k - 1 - do j=1,ny - do i=1,nx - tkh(i,j,k) = min(tkhmax, wrk * (isotropy(i,j,k) * tke(i,j,k) & - + isotropy(i,j,k1) * tke(i,j,k1))) ! Eddy thermal diffusivity - enddo ! i - enddo ! j - enddo ! k - - - end subroutine tke_shoc - - - subroutine tke_shear_prod(def2) - -! Calculate TKE shear production term - - real, intent(out) :: def2(nx,ny,nzm) - - real rdzw, wrku, wrkv, wrkw - integer i,j,k,k1 - -! Calculate TKE shear production term at layer interface - - do k=2,nzm - k1 = k - 1 - do j=1,ny - do i=1,nx - rdzw = one / adzi(i,j,k) - wrku = (u(i,j,k)-u(i,j,k1)) * rdzw - wrkv = (v(i,j,k)-v(i,j,k1)) * rdzw -! wrkw = (w(i,j,k)-w(i,j,k1)) * rdzw - def2(i,j,k) = wrku*wrku + wrkv*wrkv !+ 2*wrkw(1) * wrkw(1) - enddo - enddo - enddo ! k loop - do j=1,ny - do i=1,nx -! def2(i,j,1) = def2(i,j,2) - def2(i,j,1) = (u(i,j,1)*u(i,j,1) + v(i,j,1)*v(i,j,1)) & - / (zl(i,j,1)*zl(i,j,1)) - enddo - enddo - - end subroutine tke_shear_prod - - subroutine eddy_length() - -! This subroutine computes the turbulent length scale based on a new -! formulation described in BK13 - -! Local variables - real wrk, wrk1, wrk2, wrk3 - integer i, j, k, kk, kl, ku, kb, kc, kli, kui - - do j=1,ny - do i=1,nx - cldarr(i,j) = zero - numer(i,j) = zero - denom(i,j) = zero - enddo - enddo - -! Find the length scale outside of clouds, that includes boundary layers. - - do k=1,nzm - do j=1,ny - do i=1,nx - -! Reinitialize the mixing length related arrays to zero -! smixt(i,j,k) = one ! shoc_mod module variable smixt - smixt(i,j,k) = epsln ! shoc_mod module variable smixt - brunt(i,j,k) = zero - -!Eq. 11 in BK13 (Eq. 4.13 in Pete's dissertation) -!Outside of cloud, integrate from the surface to the cloud base -!Should the 'if' below check if the cloud liquid < a small constant instead? - - if (qcl(i,j,k)+qci(i,j,k) <= zero) then - tkes = sqrt(tke(i,j,k)) * adzl(i,j,k) - numer(i,j) = numer(i,j) + tkes*zl(i,j,k) ! Numerator in Eq. 11 in BK13 - denom(i,j) = denom(i,j) + tkes ! Denominator in Eq. 11 in BK13 - else - cldarr(i,j) = one ! Take note of columns containing cloud. - endif - enddo - enddo - enddo - -! Calculate the measure of PBL depth, Eq. 11 in BK13 (Is this really PBL depth?) - do j=1,ny - do i=1,nx - if (denom(i,j) > zero .and. numer(i,j) > zero) then - l_inf(i,j) = min(0.1 * (numer(i,j)/denom(i,j)), 100.0) - else - l_inf(i,j) = 100.0 - endif - enddo - enddo - -!Calculate length scale outside of cloud, Eq. 10 in BK13 (Eq. 4.12 in Pete's dissertation) - do k=1,nzm - - kb = k-1 - kc = k+1 - if (k == 1) then - kb = 1 - kc = 2 - thedz(:,:) = adzi(:,:,kc) - elseif (k == nzm) then - kb = nzm-1 - kc = nzm - thedz(:,:) = adzi(:,:,k) - else - thedz(:,:) = adzi(:,:,kc) + adzi(:,:,k) ! = (z(k+1)-z(k-1)) - endif - - do j=1,ny - do i=1,nx - -! vars module variable bet (=ggr/tv0) ; grid module variable adzi - - betdz = bet(i,j,k) / thedz(i,j) - - tkes = sqrt(tke(i,j,k)) - -! Compute local Brunt-Vaisalla frequency - - wrk = qcl(i,j,k) + qci(i,j,k) - if (wrk > zero) then ! If in the cloud - -! Find the in-cloud Brunt-Vaisalla frequency - - omn = qcl(i,j,k) / (wrk+1.e-20) ! Ratio of liquid water to total water - -! Latent heat of phase transformation based on relative water phase content -! fac_cond = lcond/cp, fac_fus = lfus/cp - - lstarn = fac_cond + (one-omn)*fac_fus - -! Derivative of saturation mixing ratio over water/ice wrt temp. based on relative water phase content - dqsat = omn * dtqsatw(tabs(i,j,k),prsl(i,j,k)) & - + (one-omn) * dtqsati(tabs(i,j,k),prsl(i,j,k)) - -! Saturation mixing ratio over water/ice wrt temp based on relative water phase content - - qsatt = omn * qsatw(tabs(i,j,k),prsl(i,j,k)) & - + (one-omn) * qsati(tabs(i,j,k),prsl(i,j,k)) - -! liquid/ice moist static energy static energy divided by cp? - - bbb = (one + epsv*qsatt-wrk-qpl(i,j,k)-qpi(i,j,k) & - + 1.61*tabs(i,j,k)*dqsat) / (one+lstarn*dqsat) - -! Calculate Brunt-Vaisalla frequency using centered differences in the vertical - - brunt(i,j,k) = betdz*(bbb*(hl(i,j,kc)-hl(i,j,kb)) & - + (bbb*lstarn - (one+lstarn*dqsat)*tabs(i,j,k)) & - * (total_water(i,j,kc)-total_water(i,j,kb)) & - + (bbb*fac_cond - (one+fac_cond*dqsat)*tabs(i,j,k))*(qpl(i,j,kc)-qpl(i,j,kb)) & - + (bbb*fac_sub - (one+fac_sub*dqsat)*tabs(i,j,k))*(qpi(i,j,kc)-qpi(i,j,kb)) ) - - else ! outside of cloud - -! Find outside-of-cloud Brunt-Vaisalla frequency -! Only unsaturated air, rain and snow contribute to virt. pot. temp. -! liquid/ice moist static energy divided by cp? - - bbb = one + epsv*qv(i,j,k) - qpl(i,j,k) - qpi(i,j,k) - brunt(i,j,k) = betdz*( bbb*(hl(i,j,kc)-hl(i,j,kb)) & - + epsv*tabs(i,j,k)*(total_water(i,j,kc)-total_water(i,j,kb)) & - + (bbb*fac_cond-tabs(i,j,k))*(qpl(i,j,kc)-qpl(i,j,kb)) & - + (bbb*fac_sub -tabs(i,j,k))*(qpi(i,j,kc)-qpi(i,j,kb)) ) - endif - -! Reduction of mixing length in the stable regions (where B.-V. freq. > 0) is required. -! Here we find regions of Brunt-Vaisalla freq. > 0 for later use. - - if (brunt(i,j,k) >= zero) then - brunt2(i,j,k) = brunt(i,j,k) - else - brunt2(i,j,k) = zero - endif - -! Calculate turbulent length scale in the boundary layer. -! See Eq. 10 in BK13 (Eq. 4.12 in Pete's dissertation) - -! Keep the length scale adequately small near the surface following Blackadar (1984) -! Note that this is not documented in BK13 and was added later for SP-CAM runs - -! if (k == 1) then -! term = 600.*tkes -! smixt(i,j,k) = term + (0.4*zl(i,j,k)-term)*exp(-zl(i,j,k)*0.01) -! else - -! tscale is the eddy turnover time scale in the boundary layer and is -! an empirically derived constant - - if (tkes > zero .and. l_inf(i,j) > zero) then - wrk1 = one / (tscale*tkes*vonk*zl(i,j,k)) - wrk2 = one / (tscale*tkes*l_inf(i,j)) - wrk1 = wrk1 + wrk2 + pt01 * brunt2(i,j,k) / tke(i,j,k) - wrk1 = sqrt(one / max(wrk1,1.0e-8)) * (one/0.3) -! smixt(i,j,k) = min(max_eddy_length_scale, 2.8284*sqrt(wrk1)/0.3) - smixt(i,j,k) = min(max_eddy_length_scale, wrk1) - -! smixt(i,j,k) = min(max_eddy_length_scale,(2.8284*sqrt(1./((1./(tscale*tkes*vonk*zl(i,j,k))) & -! + (1./(tscale*tkes*l_inf(i,j)))+0.01*(brunt2(i,j,k)/tke(i,j,k)))))/0.3) -! else -! smixt(i,j,k) = zero - endif - -! endif - - enddo - - enddo - enddo - - -! Now find the in-cloud turbulence length scale -! See Eq. 13 in BK13 (Eq. 4.18 in Pete's disseration) - -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! Remove after coupling to subgrid PDF. -!wthv_sec = -300/ggr*brunt*tk -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -! determine cubed convective velocity scale (conv_vel2) inside the cloud - -! call conv_scale() ! inlining the relevant code - -! do j=1,ny -! do i=1,nx -! conv_vel2(i,j,1) = zero ! Convective velocity scale cubed -! enddo -! enddo - ! Integrate velocity scale in the vertical -! do k=2,nzm -! do j=1,ny -! do i=1,nx -! conv_vel2(i,j,k) = conv_vel2(i,j,k-1) & -! + 2.5*adzi(i,j,k)*bet(i,j,k)*wthv_sec(i,j,k) -! enddo -! enddo -! enddo - - do j=1,ny - do i=1,nx - - if (cldarr(i,j) == 1) then ! If there's a cloud in this column - - kl = 0 - ku = 0 - do k=2,nzm-3 - -! Look for the cloud base in this column -! thresh (=0) is a variable local to eddy_length(). Should be a module constant. - wrk = qcl(i,j,k) + qci(i,j,k) - if (wrk > thresh .and. kl == 0) then - kl = k - endif - -! Look for the cloud top in this column - if (wrk > thresh .and. qcl(i,j,k+1)+qci(i,j,k+1) <= thresh) then - ku = k -! conv_vel2 (Cubed convective velocity scale) is calculated in conv_scale() -! Use the value of conv_vel2 at the top of the cloud. -! conv_var = conv_vel2(i,j,k)**(oneb3) - endif - -! Compute the mixing length scale for the cloud layer that we just found -! if (kl > 0 .and. ku > 0 .and. ku-kl > 1) then - if (kl > 0 .and. ku > 0 .and. ku-kl > 0) then - -! The calculation below finds the integral in the Eq. 10 in BK13 for the current cloud - conv_var = zero - do kk=kl,ku - conv_var = conv_var+ 2.5*adzi(i,j,kk)*bet(i,j,kk)*wthv_sec(i,j,kk) - enddo - conv_var = conv_var ** oneb3 - - if (conv_var > 0) then ! If convective vertical velocity scale > 0 - - depth = (zl(i,j,ku)-zl(i,j,kl)) + adzl(i,j,kl) - - - do kk=kl,ku -! in-cloud turbulence length scale, Eq. 13 in BK13 (Eq. 4.18) - -! wrk = conv_var/(depth*sqrt(tke(i,j,kk))) -! wrk = wrk * wrk + pt01*brunt2(i,j,kk)/tke(i,j,kk) - - wrk = conv_var/(depth*depth*sqrt(tke(i,j,kk))) & - + pt01*brunt2(i,j,kk)/tke(i,j,kk) - - smixt(i,j,kk) = min(max_eddy_length_scale, (one/0.3)*sqrt(one/wrk)) - - enddo - - endif ! If convective vertical velocity scale > 0 - kl = zero - ku = zero - endif ! if inside the cloud layer - - enddo ! k=2,nzm-3 - endif ! if in the cloudy column - enddo ! i=1,nx - enddo ! j=1,ny - - - end subroutine eddy_length - - - subroutine conv_scale() - -! This subroutine calculates the cubed convective velocity scale needed -! for the definition of the length scale in clouds -! See Eq. 16 in BK13 (Eq. 4.21 in Pete's dissertation) - - integer i, j, k - -!!!!!!!!! -!! A bug in formulation of conv_vel -! Obtain it by averaging conv_vel2 in the horizontal -!!!!!!!!!! - -! conv_vel(1)=zero ! Horizontally averaged convective velocity scale cubed - do j=1,ny - do i=1,nx - conv_vel2(i,j,1) = zero ! Convective velocity scale cubed - enddo - enddo -! Integrate velocity scale in the vertical - do k=2,nzm -! conv_vel(k)=conv_vel(k-1) - do j=1,ny - do i=1,nx -!********************************************************************** -!Do not include grid-scale contribution to convective velocity scale in GCM applications -! conv_vel(k)=conv_vel(k-1)+2.5*adzi(k)*bet(k)*(tvwle(k)+tvws(k)) -! conv_vel(k)=conv_vel(k)+2.5*adzi(i,j,k)*bet(i,j,k)*(tvws(k)) -!Do not include grid-scale contribution to convective velocity scale in GCM applications -! conv_vel2(i,j,k)=conv_vel2(i,j,k-1)+2.5*adzi(k)*bet(k)*(tvwle(k)+wthv_sec(i,j,k)) -!********************************************************************** - - conv_vel2(i,j,k) = conv_vel2(i,j,k-1) & - + 2.5*adzi(i,j,k)*bet(i,j,k)*wthv_sec(i,j,k) - enddo - enddo - enddo - - end subroutine conv_scale - - - subroutine check_eddy() - -! This subroutine checks eddy length values - - integer i, j, k, kb, ks, zend - real wrk -! real zstart, zthresh, qthresh - -! Temporary kludge for marine stratocumulus under very strong inversions at coarse resolution -! Placement until some explicity PBL top is put in -! Not used. -! zthresh = 100. -! qthresh = -6.0 - - do k=1,nzm - - if (k == nzm) then - kb = k - else - kb = k+1 - endif - - do j=1,ny - do i=1,nx - - wrk = 0.1*adzl(i,j,k) - ! Minimum 0.1 of local dz - smixt(i,j,k) = max(wrk, min(max_eddy_length_scale,smixt(i,j,k))) - -! If chracteristic grid dimension in the horizontal< 1000m, set lengthscale to -! be not larger that that. -! if (sqrt(dx*dy) .le. 1000.) smixt(i,j,k)=min(sqrt(dx*dy),smixt(i,j,k)) - - if (qcl(i,j,kb) == 0 .and. qcl(i,j,k) > 0 .and. brunt(i,j,k) > 1.e-4) then -!If just above the cloud top and atmosphere is stable, set to 0.1 of local dz - smixt(i,j,k) = wrk - endif - - enddo ! i - enddo ! j - enddo ! k - - end subroutine check_eddy - - subroutine canuto() - -! Subroutine impements an analytic expression for the third moment of SGS vertical velocity -! based on Canuto et at, 2001, JAS, 58, 1169-1172 (further referred to as C01) -! This allows to avoid having a prognostic equation for the third moment. -! Result is returned in a global variable w3 defined at the interface levels. - -! Local variables - integer i, j, k, kb, kc - - real bet2, f0, f1, f2, f3, f4, f5, iso, isosqr, & - omega0, omega1, omega2, X0, Y0, X1, Y1, AA0, AA1, buoy_sgs2, & - wrk, wrk1, wrk2, wrk3, avew -! cond, wrk, wrk1, wrk2, wrk3, avew -! -! See Eq. 7 in C01 (B.7 in Pete's dissertation) - real, parameter :: c=7.0, a0=0.52/(c*c*(c-2.)), a1=0.87/(c*c), & - a2=0.5/c, a3=0.6/(c*(c-2.)), a4=2.4/(3.*c+5.), & - a5=0.6/(c*(3.*c+5)) -!Moorthi a5=0.6/(c*(3.+5.*c)) - -! do k=1,nzm - do k=2,nzm - - kb = k-1 - kc = k+1 - -! if(k == 1) then -! kb = 1 -! kc = 2 -! do j=1,ny -! do i=1,nx -! thedz(i,j) = one / adzl(i,j,kc) -! thedz2(i,j) = thedz(i,j) -! enddo -! enddo -! elseif(k == nzm) then - if (k == nzm) then - kb = nzm-1 - kc = nzm - do j=1,ny - do i=1,nx - thedz(i,j) = one / adzi(i,j,k) - thedz2(i,j) = one / adzl(i,j,kb) - enddo - enddo - else - do j=1,ny - do i=1,nx - thedz(i,j) = one / adzi(i,j,k) - thedz2(i,j) = one / (adzl(i,j,k)+adzl(i,j,kb)) - enddo - enddo - endif - - - do j=1,ny - do i=1,nx - - iso = half*(isotropy(i,j,k)+isotropy(i,j,kb)) - isosqr = iso*iso ! Two-level average of "return-to-isotropy" time scale squared - buoy_sgs2 = isosqr*half*(brunt(i,j,k)+brunt(i,j,kb)) - bet2 = half*(bet(i,j,k)+bet(i,j,kb)) !Two-level average of BV frequency squared - - -! Compute functions f0-f5, see Eq, 8 in C01 (B.8 in Pete's dissertation) - - - avew = half*(w_sec(i,j,k)+w_sec(i,j,kb)) -!aab -! - wrk1 = bet2*iso - wrk2 = thedz2(i,j)*wrk1*wrk1*iso - wrk3 = thl_sec(i,j,kc) - thl_sec(i,j,kb) - - f0 = wrk2 * wrk1 * wthl_sec(i,j,k) * wrk3 - - wrk = wthl_sec(i,j,kc) - wthl_sec(i,j,kb) - - f1 = wrk2 * (wrk*wthl_sec(i,j,k) + half*avew*wrk3) - - wrk1 = bet2*isosqr - f2 = thedz(i,j)*wrk1*wthl_sec(i,j,k)*(w_sec(i,j,k)-w_sec(i,j,kb)) & - + (thedz2(i,j)+thedz2(i,j))*bet(i,j,k)*isosqr*wrk - - f3 = thedz2(i,j)*wrk1*wrk + thedz(i,j)*bet2*isosqr*(wthl_sec(i,j,k)*(tke(i,j,k)-tke(i,j,kb))) - - wrk1 = thedz(i,j)*iso*avew - f4 = wrk1*(w_sec(i,j,k)-w_sec(i,j,kb) + tke(i,j,k)-tke(i,j,kb)) - - f5 = wrk1*(w_sec(i,j,k)-w_sec(i,j,kb)) - - -! Compute the "omega" terms, see Eq. 6 in C01 (B.6 in Pete's dissertation) - - omega0 = a4 / (one-a5*buoy_sgs2) - omega1 = omega0 / (c+c) - omega2 = omega1*f3+(5./4.)*omega0*f4 - -! Compute the X0, Y0, X1, Y1 terms, see Eq. 5 a-b in C01 (B.5 in Pete's dissertation) - - wrk1 = one / (one-(a1+a3)*buoy_sgs2) - wrk2 = one / (one-a3*buoy_sgs2) - X0 = wrk1 * (a2*buoy_sgs2*(one-a3*buoy_sgs2)) - Y0 = wrk2 * (two*a2*buoy_sgs2*X0) - X1 = wrk1 * (a0*f0+a1*f1+a2*(one-a3*buoy_sgs2)*f2) - Y1 = wrk2 * (two*a2*(buoy_sgs2*X1+(a0/a1)*f0+f1)) - -! Compute the A0, A1 terms, see Eq. 5d in C01 (B.5 in Pete's dissertation) - - AA0 = omega0*X0 + omega1*Y0 - AA1 = omega0*X1 + omega1*Y1 + omega2 - -! Finally, we have the third moment of w, see Eq. 4c in C01 (B.4 in Pete's dissertation) -! cond is an estimate of third moment from second oment - If the third moment is larger -! than the estimate - limit w3. - -!aab - -! Implemetation of the C01 approach in this subroutine is nearly complete -! (the missing part are Eqs. 5c and 5e which are very simple) -! therefore it's easy to diagnose other third order moments obtained in C01 using this code. - - enddo - enddo - enddo - do j=1,ny - do i=1,nx - w3(i,j,1) = w3(i,j,2) - enddo - enddo - - end subroutine canuto - - subroutine assumed_pdf() - -! Compute SGS buoyancy flux, SGS cloud fraction, and SGS condensation -! using assumed analytic double-gaussian PDF for SGS vertical velocity, -! moisture, and liquid/ice water static energy, based on the -! general approach of Larson et al 2002, JAS, 59, 3519-3539, -! and Golaz et al 2002, JAS, 59, 3540-3551 -! References in the comments in this code are given to -! the Appendix A of Pete Bogenschutz's dissertation. - -! Local variables - - integer i,j,k,ku,kd - real wrk, wrk1, wrk2, wrk3, wrk4, bastoeps, eps_ss1, eps_ss2, cond_w - -! bastoeps = basetemp / epsterm - - -! Initialize for statistics - do k=1,nzm - wqlsb(k) = zero - wqisb(k) = zero - enddo - - DO k=1,nzm - - kd = k - ku = k + 1 -! if (k == nzm) ku = k - - DO j=1,ny - DO i=1,nx - -! Initialize cloud variables to zero - diag_qn = zero - diag_frac = zero - diag_ql = zero - diag_qi = zero - - pval = prsl(i,j,k) - pfac = pval * 1.0e-5 - pkap = pfac ** kapa - -! Read in liquid/ice static energy, total water mixing ratio, -! and vertical velocity to variables PDF needs - - thl_first = hl(i,j,k) + fac_cond*qpl(i,j,k) & - + fac_sub*qpi(i,j,k) - - qw_first = total_water(i,j,k) -! w_first = half*(w(i,j,kd)+w(i,j,ku)) - w_first = w(i,j,k) - - -! GET ALL INPUT VARIABLES ON THE SAME GRID -! Points to be computed with relation to thermo point -! Read in points that need to be averaged - - if (k < nzm) then - w3var = half*(w3(i,j,kd)+w3(i,j,ku)) - thlsec = max(zero, half*(thl_sec(i,j,kd)+thl_sec(i,j,ku)) ) - qwsec = max(zero, half*(qw_sec(i,j,kd)+qw_sec(i,j,ku)) ) - qwthlsec = half * (qwthl_sec(i,j,kd) + qwthl_sec(i,j,ku)) - wqwsec = half * (wqw_sec(i,j,kd) + wqw_sec(i,j,ku)) - wthlsec = half * (wthl_sec(i,j,kd) + wthl_sec(i,j,ku)) - else ! at the model top assuming zeros - w3var = half*w3(i,j,k) - thlsec = max(zero, half*thl_sec(i,j,k)) - qwsec = max(zero, half*qw_sec(i,j,k)) - qwthlsec = half * qwthl_sec(i,j,k) - wqwsec = half * wqw_sec(i,j,k) - wthlsec = half * wthl_sec(i,j,k) - endif - -! w3var = w3(i,j,k) -! thlsec = max(zero,thl_sec(i,j,k)) -! qwsec = max(zero,qw_sec(i,j,k)) -! qwthlsec = qwthl_sec(i,j,k) -! wqwsec = wqw_sec(i,j,k) -! wthlsec = wthl_sec(i,j,k) - -! Compute square roots of some variables so we don't have to do it again -! if (lprnt .and. i == ipr .and. k<40) write(0,*)' w_sec=',w_sec(i,j,k),' k=',k - if (w_sec(i,j,k) > zero) then - sqrtw2 = sqrt(w_sec(i,j,k)) - else - sqrtw2 = zero - endif - if (thlsec > zero) then - sqrtthl = sqrt(thlsec) - else - sqrtthl = zero - endif - if (qwsec > zero) then - sqrtqt = sqrt(qwsec) - else - sqrtqt = zero - endif - - -! Find parameters of the double Gaussian PDF of vertical velocity - -! Skewness of vertical velocity -! Skew_w = w3var / w_sec(i,j,k)**(3./2.) -! Skew_w = w3var / (sqrtw2*sqrtw2*sqrtw2) ! Moorthi - - IF (w_sec(i,j,k) <= w_tol_sqd) THEN ! If variance of w is too small then - ! PDF is a sum of two delta functions - Skew_w = zero - w1_1 = w_first - w1_2 = w_first - w2_1 = zero - w2_2 = zero - aterm = half - onema = half - ELSE - -!aab - - Skew_w = w3var / (sqrtw2*sqrtw2*sqrtw2) ! Moorthi -! Proportionality coefficients between widths of each vertical velocity -! gaussian and the sqrt of the second moment of w - w2_1 = 0.4 - w2_2 = 0.4 - -! Compute realtive weight of the first PDF "plume" -! See Eq A4 in Pete's dissertaion - Ensure 0.01 < a < 0.99 - - wrk = one - w2_1 - aterm = max(atmin,min(half*(one-Skew_w*sqrt(one/(4.*wrk*wrk*wrk+Skew_w*Skew_w))),atmax)) - onema = one - aterm - - sqrtw2t = sqrt(wrk) - -! Eq. A.5-A.6 - wrk = sqrt(onema/aterm) - w1_1 = sqrtw2t * wrk - w1_2 = - sqrtw2t / wrk - - w2_1 = w2_1 * w_sec(i,j,k) - w2_2 = w2_2 * w_sec(i,j,k) - - ENDIF - -! Find parameters of the PDF of liquid/ice static energy - -! if (lprnt .and. i == ipr .and. k<40) write(0,*)' thlsec=',thlsec,' w1_2=',w1_2,' w1_1=',w1_1,& -! ' thl_first=',thl_first,' k=',k,' wthlsec=',wthlsec,sqrtw2,sqrtthl - IF (thlsec <= thl_tol*thl_tol .or. abs(w1_2-w1_1) <= w_thresh) THEN - thl1_1 = thl_first - thl1_2 = thl_first - thl2_1 = zero - thl2_2 = zero - sqrtthl2_1 = zero - sqrtthl2_2 = zero - ELSE - - corrtest1 = max(-one,min(one,wthlsec/(sqrtw2*sqrtthl))) - - thl1_1 = -corrtest1 / w1_2 ! A.7 - thl1_2 = -corrtest1 / w1_1 ! A.8 - - wrk1 = thl1_1 * thl1_1 - wrk2 = thl1_2 * thl1_2 - wrk3 = three * (one - aterm*wrk1 - onema*wrk2) - wrk4 = -skew_facw*Skew_w - aterm*wrk1*thl1_1 - onema*wrk2*thl1_2 ! testing - Moorthi -! wrk4 = -skew_fact*Skew_w - aterm*wrk1*thl1_1 - onema*wrk2*thl1_2 ! testing - Moorthi -! wrk4 = - aterm*wrk1*thl1_1 - onema*wrk2*thl1_2 - wrk = three * (thl1_2-thl1_1) - if (wrk /= zero) then - thl2_1 = thlsec * min(100.,max(zero,( thl1_2*wrk3-wrk4)/(aterm*wrk))) ! A.10 - thl2_2 = thlsec * min(100.,max(zero,(-thl1_1*wrk3+wrk4)/(onema*wrk))) ! A.11 - else - thl2_1 = zero - thl2_2 = zero - endif -! -! if (lprnt .and. i == ipr .and. k<40) write(0,*)' thl1_1=',thl1_1,' sqrtthl=',sqrtthl,' thl_first=',thl_first,& -! ' thl1_2=',thl1_2,' corrtest1=',corrtest1,' w1_2=',w1_2,' w1_1=',w1_1 - - thl1_1 = thl1_1*sqrtthl + thl_first - thl1_2 = thl1_2*sqrtthl + thl_first - -! if (lprnt .and. i == ipr .and. k<40) write(0,*)' thl1_1=',thl1_1,' thl1_2=',thl1_2 - - sqrtthl2_1 = sqrt(thl2_1) - sqrtthl2_2 = sqrt(thl2_2) - - ENDIF - -! FIND PARAMETERS FOR TOTAL WATER MIXING RATIO - - IF (qwsec <= rt_tol*rt_tol .or. abs(w1_2-w1_1) <= w_thresh) THEN - qw1_1 = qw_first - qw1_2 = qw_first - qw2_1 = zero - qw2_2 = zero - sqrtqw2_1 = zero - sqrtqw2_2 = zero - ELSE - - corrtest2 = max(-one,min(one,wqwsec/(sqrtw2*sqrtqt))) - - qw1_1 = - corrtest2 / w1_2 ! A.7 - qw1_2 = - corrtest2 / w1_1 ! A.8 - - tsign = abs(qw1_2-qw1_1) - -! Skew_qw = skew_facw*Skew_w - - IF (tsign > 0.4) THEN - Skew_qw = skew_facw*Skew_w - ELSEIF (tsign <= 0.2) THEN - Skew_qw = zero - ELSE - Skew_qw = (skew_facw/0.2) * Skew_w * (tsign-0.2) - ENDIF - - wrk1 = qw1_1 * qw1_1 - wrk2 = qw1_2 * qw1_2 - wrk3 = three * (one - aterm*wrk1 - onema*wrk2) - wrk4 = Skew_qw - aterm*wrk1*qw1_1 - onema*wrk2*qw1_2 - wrk = three * (qw1_2-qw1_1) - - if (wrk /= zero) then - qw2_1 = qwsec * min(100.,max(zero,( qw1_2*wrk3-wrk4)/(aterm*wrk))) ! A.10 - qw2_2 = qwsec * min(100.,max(zero,(-qw1_1*wrk3+wrk4)/(onema*wrk))) ! A.11 - else - qw2_1 = zero - qw2_2 = zero - endif -! - qw1_1 = qw1_1*sqrtqt + qw_first - qw1_2 = qw1_2*sqrtqt + qw_first - - sqrtqw2_1 = sqrt(qw2_1) - sqrtqw2_2 = sqrt(qw2_2) - - ENDIF - -! CONVERT FROM TILDA VARIABLES TO "REAL" VARIABLES - - w1_1 = w1_1*sqrtw2 + w_first - w1_2 = w1_2*sqrtw2 + w_first - -! FIND WITHIN-PLUME CORRELATIONS - - testvar = aterm*sqrtqw2_1*sqrtthl2_1 + onema*sqrtqw2_2*sqrtthl2_2 - - IF (testvar == 0) THEN - r_qwthl_1 = zero - ELSE - r_qwthl_1 = max(-one,min(one,(qwthlsec-aterm*(qw1_1-qw_first)*(thl1_1-thl_first) & - -onema*(qw1_2-qw_first)*(thl1_2-thl_first))/testvar)) ! A.12 - ENDIF - -! BEGIN TO COMPUTE CLOUD PROPERTY STATISTICS - -! wrk1 = gamaz(i,j,k) - fac_cond * qpl(i,j,k) - fac_sub * qpi(i,j,k) -! Tl1_1 = thl1_1 - wrk1 -! Tl1_2 = thl1_2 - wrk1 - - Tl1_1 = thl1_1 - gamaz(i,j,k) - Tl1_2 = thl1_2 - gamaz(i,j,k) - -! if (lprnt .and. i == ipr .and. k<40) write(0,*)' Tl1_1=',Tl1_1,' Tl1_2=',Tl1_2,& -! ' wrk1=',wrk1,' thl1_1=',thl1_1,' thl1_2=',thl1_2,' qpl=',qpl(i,j,k),' qpi=',qpi(i,j,k) - -! Now compute qs - - esval1_1 = zero - esval2_1 = zero - eps_ss1 = eps - eps_ss2 = eps - om1 = one - -! Partition based on temperature for the first plume - - IF (Tl1_1 >= tbgmax) THEN - esval1_1 = min(fpvsl(Tl1_1), pval) -! esval1_1 = esatw(Tl1_1) - lstarn1 = lcond - ELSE IF (Tl1_1 <= tbgmin) THEN - esval1_1 = min(fpvsi(Tl1_1), pval) -! esval1_1 = esati(Tl1_1) - lstarn1 = lsub - eps_ss1 = eps * supice - ELSE - esval1_1 = min(fpvsl(Tl1_1), pval) - esval2_1 = min(fpvsi(Tl1_1), pval) -! esval1_1 = esatw(Tl1_1) -! esval2_1 = esati(Tl1_1) - om1 = max(zero, min(one, a_bg*(Tl1_1-tbgmin))) - lstarn1 = lcond + (one-om1)*lfus - eps_ss2 = eps * supice - - ENDIF - qs1 = om1 * eps_ss1*esval1_1/(pval-0.378*esval1_1) & - + (one-om1) * eps_ss2*esval2_1/(pval-0.378*esval2_1) - -! beta1 = (rgas/rv)*(lstarn1/(rgas*Tl1_1))*(lstarn1/(cp*Tl1_1)) - beta1 = (lstarn1*lstarn1*onebrvcp) / (Tl1_1*Tl1_1) ! A.18 - - -! Are the two plumes equal? If so then set qs and beta -! in each column to each other to save computation - IF (Tl1_1 == Tl1_2) THEN - qs2 = qs1 - beta2 = beta1 - ELSE - - esval1_2 = zero - esval2_2 = zero - eps_ss1 = eps - eps_ss2 = eps - om2 = one - - IF (Tl1_2 >= tbgmax) THEN - esval1_2 = min(fpvsl(Tl1_2), pval) -! esval1_2 = esatw(Tl1_2) - lstarn2 = lcond - ELSE IF (Tl1_2 <= tbgmin) THEN - esval1_2 = min(fpvsi(Tl1_2), pval) -! esval1_2 = esati(Tl1_2) - lstarn2 = lsub - eps_ss1 = eps * supice - ELSE - esval1_2 = min(fpvsl(Tl1_2), pval) - esval2_2 = min(fpvsi(Tl1_2), pval) -! esval1_2 = esatw(Tl1_2) -! esval2_2 = esati(Tl1_2) - om2 = max(zero, min(one, a_bg*(Tl1_2-tbgmin))) - lstarn2 = lcond + (one-om2)*lfus - eps_ss2 = eps * supice - ENDIF - - qs2 = om2 * eps_ss1*esval1_2/(pval-0.378*esval1_2) & - + (one-om2) * eps_ss2*esval2_2/(pval-0.378*esval2_2) - -! beta2 = (rgas/rv)*(lstarn2/(rgas*Tl1_2))*(lstarn2/(cp*Tl1_2)) ! A.18 - beta2 = (lstarn2*lstarn2*onebrvcp) / (Tl1_2*Tl1_2) ! A.18 - - ENDIF - - qs1 = qs1 * rhc(i,j,k) - qs2 = qs2 * rhc(i,j,k) - -! Now compute cloud stuff - compute s term - - cqt1 = one / (one+beta1*qs1) ! A.19 - wrk = qs1 * (one+beta1*qw1_1) * cqt1 - s1 = qw1_1 - wrk ! A.17 - cthl1 = cqt1*wrk*cpolv*beta1*pkap ! A.20 - - wrk1 = cthl1 * cthl1 - wrk2 = cqt1 * cqt1 -! std_s1 = sqrt(max(zero,wrk1*thl2_1+wrk2*qw2_1-2.*cthl1*sqrtthl2_1*cqt1*sqrtqw2_1*r_qwthl_1)) - std_s1 = sqrt(max(zero, wrk1*thl2_1+wrk2*qw2_1 & - - two*cthl1*sqrtthl2_1*cqt1*sqrtqw2_1*r_qwthl_1)) - - qn1 = zero - C1 = zero - - IF (std_s1 > zero) THEN - wrk = s1 / (std_s1*sqrt2) - C1 = max(zero, min(one, half*(one+erf(wrk)))) ! A.15 - -! if (lprnt .and. i == ipr .and. k<40) write(0,*)' in shoc wrk=',wrk,' s1=','std=',std_s1,& -! ' c1=',c1*100,' qs1=',qs1,' qw1_1=',qw1_1,' k=',k - -! IF (C1 > zero) qn1 = s1*C1 + (std_s1*sqrtpii)*exp(-wrk*wrk) ! A.16 - qn1 = max(zero, s1*C1 + (std_s1*sqrtpii)*exp(-wrk*wrk)) ! A.16 - ELSEIF (s1 > zero) THEN - C1 = one - qn1 = s1 - ENDIF - -! now compute non-precipitating cloud condensate - -! If two plumes exactly equal, then just set many of these -! variables to themselves to save on computation. - IF (qw1_1 == qw1_2 .and. thl2_1 == thl2_2 .and. qs1 == qs2) THEN - s2 = s1 - cthl2 = cthl1 - cqt2 = cqt1 - std_s2 = std_s1 - C2 = C1 - qn2 = qn1 - ELSE - - cqt2 = one / (one+beta2*qs2) - wrk = qs2 * (one+beta2*qw1_2) * cqt2 - s2 = qw1_2 - wrk - cthl2 = wrk*cqt2*cpolv*beta2*pkap - wrk1 = cthl2 * cthl2 - wrk2 = cqt2 * cqt2 -! std_s2 = sqrt(max(zero,wrk1*thl2_2+wrk2*qw2_2-2.*cthl2*sqrtthl2_2*cqt2*sqrtqw2_2*r_qwthl_1)) - std_s2 = sqrt(max(zero, wrk1*thl2_2+wrk2*qw2_2 & - - two*cthl2*sqrtthl2_2*cqt2*sqrtqw2_2*r_qwthl_1)) - - qn2 = zero - C2 = zero - - IF (std_s2 > zero) THEN - wrk = s2 / (std_s2*sqrt2) - C2 = max(zero, min(one, half*(one+erf(wrk)))) -! IF (C2 > zero) qn2 = s2*C2 + (std_s2*sqrtpii)*exp(-wrk*wrk) - qn2 = max(zero, s2*C2 + (std_s2*sqrtpii)*exp(-wrk*wrk)) - ELSEIF (s2 > zero) THEN - C2 = one - qn2 = s2 - ENDIF - - ENDIF - -! finally, compute the SGS cloud fraction - diag_frac = aterm*C1 + onema*C2 - - om1 = max(zero, min(one, (Tl1_1-tbgmin)*a_bg)) - om2 = max(zero, min(one, (Tl1_2-tbgmin)*a_bg)) - - qn1 = min(qn1,qw1_1) - qn2 = min(qn2,qw1_2) - - ql1 = qn1*om1 - ql2 = qn2*om2 - - qi1 = qn1 - ql1 - qi2 = qn2 - ql2 - -! if (lprnt .and. i == ipr .and. k<40) write(0,*)' in shoc qi=',qi1,qi2,' ql=',ql1,ql2,& -! ' c1=',c1,' c2=',c2,' s1=',s1,' s2=',s2,' k=',k,' tl1=',tl1_1,tl1_2,' om1=',om1,'om2=',om2& -! ,' tbgmin=',tbgmin,'a_bg=',a_bg - - - diag_qn = min(max(zero, aterm*qn1 + onema*qn2), total_water(i,j,k)) - diag_ql = min(max(zero, aterm*ql1 + onema*ql2), diag_qn) - diag_qi = diag_qn - diag_ql - - -! Update temperature variable based on diagnosed cloud properties - om1 = max(zero, min(one, (tabs(i,j,k)-tbgmin)*a_bg)) - lstarn1 = lcond + (one-om1)*lfus - tabs(i,j,k) = hl(i,j,k) - gamaz(i,j,k) + fac_cond*(diag_ql+qpl(i,j,k)) & - + fac_sub *(diag_qi+qpi(i,j,k)) & - + tkesbdiss(i,j,k) * (dtn/cp) ! tke dissipative heating - -! if (lprnt .and. i == ipr .and. k < 40) write(0,*)' tabsout=',tabs(ipr,1,k),' k=',k& -! ,' hl=',hl(i,j,k),' gamaz=',gamaz(i,j,k),' diag_ql=',diag_ql,' qpl=',qpl(i,j,k)& -! ,' diag_qi=',diag_qi,' qpi=',qpi(i,j,k),' diag_qn =',diag_qn ,' aterm=',aterm,' onema=',onema& -! ,' qn1=',qn1 ,' qn2=',qn2,' ql1=',ql1,' ql2=',ql2 -! Update moisture fields - -! Update ncpl and ncpi Anning Cheng 03/11/2016 -! ncpl(i,j,k) = diag_ql/max(qc(i,j,k),1.e-10)*ncpl(i,j,k) -! The following commneted by Moorthi on April 26, 2017 to test blowing up -! ncpl(i,j,k) = (1.0-diag_ql/max(qc(i,j,k),1.e-10)) * ncpl(i,j,k) -! ncpi(i,j,k) = (1.0-diag_qi/max(qi(i,j,k),1.e-10)) * ncpi(i,j,k) - qc(i,j,k) = diag_ql - qi(i,j,k) = diag_qi - qwv(i,j,k) = total_water(i,j,k) - diag_qn - cld_sgs(i,j,k) = diag_frac - - -! Compute the liquid water flux - wqls = aterm * ((w1_1-w_first)*ql1) + onema * ((w1_2-w_first)*ql2) - wqis = aterm * ((w1_1-w_first)*qi1) + onema * ((w1_2-w_first)*qi2) - -! Compute statistics for the fluxes so we don't have to save these variables - wqlsb(k) = wqlsb(k) + wqls - wqisb(k) = wqisb(k) + wqis - -! diagnostic buoyancy flux. Includes effects from liquid water, ice -! condensate, liquid & ice precipitation -! wrk = epsv * basetemp - wrk = epsv * thv(i,j,k) - - bastoeps = onebeps * thv(i,j,k) - - if (k < nzm) then - wthv_sec(i,j,k) = wthlsec + wrk*wqwsec & - + (fac_cond-bastoeps)*wqls & - + (fac_sub-bastoeps) *wqis & - + ((lstarn1/cp)-thv(i,j,k))*half*(wqp_sec(i,j,kd)+wqp_sec(i,j,ku)) - else - wthv_sec(i,j,k) = wthlsec + wrk*wqwsec & - + (fac_cond-bastoeps)*wqls & - + (fac_sub-bastoeps) *wqis & - + ((lstarn1/cp)-thv(i,j,k))*half*wqp_sec(i,j,k) - endif - -! wthv_sec(i,j,k) = wthlsec + wrk*wqwsec & -! + (fac_cond-bastoeps)*wqls & -! + (fac_sub-bastoeps)*wqis & -! + ((lstarn1/cp)-basetemp)*half*(wqp_sec(i,j,kd)+wqp_sec(i,j,ku)) - - ENDDO - ENDDO - ENDDO - - - end subroutine assumed_pdf - - -! Saturation vapor pressure and mixing ratio subroutines -! Based on Flatau et al (1992), J. App. Met., 31, 1507-1513 -! Code by Marat Khairoutdinov - - - real function esatw(t) - real t ! temperature (K) - real a0,a1,a2,a3,a4,a5,a6,a7,a8 - data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & - 6.11239921, 0.443987641, 0.142986287e-1, & - 0.264847430e-3, 0.302950461e-5, 0.206739458e-7, & - 0.640689451e-10, -0.952447341e-13,-0.976195544e-15/ - real dt - dt = max(-80.,t-273.16) - esatw = a0 + dt*(a1+dt*(a2+dt*(a3+dt*(a4+dt*(a5+dt*(a6+dt*(a7+a8*dt))))))) - end function esatw - - real function qsatw(t,p) -! implicit none - real t ! temperature (K) - real p ! pressure (Pa) - real esat -! esat = fpvs(t) - esat = fpvsl(t) - qsatw = 0.622 * esat/max(esat,p-0.378*esat) -! esat = esatw(t) -! qsatw = 0.622 * esat/max(esat,p-esat) - end function qsatw - - - real function esati(t) - real t ! temperature (K) - real a0,a1,a2,a3,a4,a5,a6,a7,a8 - data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & - 6.11147274, 0.503160820, 0.188439774e-1, & - 0.420895665e-3, 0.615021634e-5, 0.602588177e-7, & - 0.385852041e-9, 0.146898966e-11, 0.252751365e-14/ - real dt -! real esatw - if(t > 273.15) then - esati = esatw(t) - else if(t.gt.185.) then - dt = t-273.16 - esati = a0 + dt*(a1+dt*(a2+dt*(a3+dt*(a4+dt*(a5+dt*(a6+dt*(a7+a8*dt))))))) - else ! use some additional interpolation below 184K - dt = max(-100.,t-273.16) - esati = 0.00763685 + dt*(0.000151069+dt*7.48215e-07) - endif - end function esati - - real function qsati(t,p) - real t ! temperature (K) - real p ! pressure (Pa) - real esat !,esati -! esat = fpvs(t) - esat = fpvsi(t) - qsati = 0.622 * esat/max(esat,p-0.378*esat) -! esat = esati(t) -! qsati = 0.622 * esat/max(esat,p-esat) - end function qsati - - real function dtesatw(t) - real t ! temperature (K) - real a0,a1,a2,a3,a4,a5,a6,a7,a8 - data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & - 0.443956472, 0.285976452e-1, 0.794747212e-3, & - 0.121167162e-4, 0.103167413e-6, 0.385208005e-9, & - -0.604119582e-12, -0.792933209e-14, -0.599634321e-17/ - real dt - dt = max(-80.,t-273.16) - dtesatw = a0 + dt* (a1+dt*(a2+dt*(a3+dt*(a4+dt*(a5+dt*(a6+dt*(a7+a8*dt))))))) - end function dtesatw - - real function dtqsatw(t,p) - real t ! temperature (K) - real p ! pressure (Pa) -! real dtesatw - dtqsatw = 100.0*0.622*dtesatw(t)/p - end function dtqsatw - - real function dtesati(t) - real t ! temperature (K) - real a0,a1,a2,a3,a4,a5,a6,a7,a8 - data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & - 0.503223089, 0.377174432e-1, 0.126710138e-2, & - 0.249065913e-4, 0.312668753e-6, 0.255653718e-8, & - 0.132073448e-10, 0.390204672e-13, 0.497275778e-16/ - real dt -! real dtesatw - if(t > 273.15) then - dtesati = dtesatw(t) - else if(t > 185.) then - dt = t-273.16 - dtesati = a0 + dt*(a1+dt*(a2+dt*(a3+dt*(a4+dt*(a5+dt*(a6+dt*(a7+a8*dt))))))) - else ! use additional interpolation below 185K - dt = max(-100.,t-273.16) - dtesati = 0.0013186 + dt*(2.60269e-05+dt*1.28676e-07) - endif - end function dtesati - - - real function dtqsati(t,p) - real t ! temperature (K) - real p ! pressure (Pa) -! real dtesati - dtqsati = 100.0*0.622*dtesati(t)/p - end function dtqsati - -end subroutine shoc_work - -end module shoc diff --git a/physics/gcycle.F90 b/physics/gcycle.F90 deleted file mode 100644 index 4fc1bfa04..000000000 --- a/physics/gcycle.F90 +++ /dev/null @@ -1,245 +0,0 @@ -!>\file gcycle.F90 -!! This file repopulates specific time-varying sfc properties for -!! AMIP/forecast runs - -# 1 "physics/gcycle.F90" -!>\ingroup Noah_LSM -!! This subroutine repopulates specific time-varying sfc properties for -!! AMIP/forecast runs. - SUBROUTINE GCYCLE (nblks, Model, Grid, Sfcprop, Cldprop) -! -! - USE MACHINE, only: kind_phys - USE PHYSCONS, only: PI => con_PI - USE GFS_typedefs, only: GFS_control_type, GFS_grid_type, & - GFS_sfcprop_type, GFS_cldprop_type - implicit none - - integer, intent(in) :: nblks - type(GFS_control_type), intent(in) :: Model - type(GFS_grid_type), intent(in) :: Grid(nblks) - type(GFS_sfcprop_type), intent(inout) :: Sfcprop(nblks) - type(GFS_cldprop_type), intent(inout) :: Cldprop(nblks) - -! -! Local variables -! --------------- - integer :: & - I_INDEX(Model%nx*Model%ny), & - J_INDEX(Model%nx*Model%ny) - - real(kind=kind_phys) :: & - RLA (Model%nx*Model%ny), & - RLO (Model%nx*Model%ny), & - SLMASK (Model%nx*Model%ny), & - OROG (Model%nx*Model%ny), & - OROG_UF (Model%nx*Model%ny), & - SLIFCS (Model%nx*Model%ny), & - TSFFCS (Model%nx*Model%ny), & - SNOFCS (Model%nx*Model%ny), & - ZORFCS (Model%nx*Model%ny), & - TG3FCS (Model%nx*Model%ny), & - CNPFCS (Model%nx*Model%ny), & - AISFCS (Model%nx*Model%ny), & -! F10MFCS(Model%nx*Model%ny), & - VEGFCS (Model%nx*Model%ny), & - VETFCS (Model%nx*Model%ny), & - SOTFCS (Model%nx*Model%ny), & - CVFCS (Model%nx*Model%ny), & - CVBFCS (Model%nx*Model%ny), & - CVTFCS (Model%nx*Model%ny), & - SWDFCS (Model%nx*Model%ny), & - SIHFCS (Model%nx*Model%ny), & - SICFCS (Model%nx*Model%ny), & - SITFCS (Model%nx*Model%ny), & - VMNFCS (Model%nx*Model%ny), & - VMXFCS (Model%nx*Model%ny), & - SLPFCS (Model%nx*Model%ny), & - ABSFCS (Model%nx*Model%ny), & - ALFFC1 (Model%nx*Model%ny*2), & - ALBFC1 (Model%nx*Model%ny*4), & - SMCFC1 (Model%nx*Model%ny*Model%lsoil), & - STCFC1 (Model%nx*Model%ny*Model%lsoil), & - SLCFC1 (Model%nx*Model%ny*Model%lsoil) - - character(len=6) :: tile_num_ch - real(kind=kind_phys), parameter :: pifac=180.0/pi - real(kind=kind_phys) :: sig1t - integer :: npts, len, nb, ix, jx, ls, ios - logical :: exists -! -!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -! -! if (Model%me .eq. 0) print *,' nlats=',nlats,' lonsinpe=' -! *,lonsinpe(0,1) - - tile_num_ch = " " - if (Model%tile_num < 10) then - write(tile_num_ch, "(a4,i1)") "tile", Model%tile_num - else - write(tile_num_ch, "(a4,i2)") "tile", Model%tile_num - endif - - len = 0 - do jx = Model%jsc, (Model%jsc+Model%ny-1) - do ix = Model%isc, (Model%isc+Model%nx-1) - len = len + 1 - i_index(len) = ix - j_index(len) = jx - enddo - enddo - - sig1t = 0.0 - npts = Model%nx*Model%ny -! - len = 0 - do nb = 1,nblks - do ix = 1,size(Grid(nb)%xlat,1) - len = len + 1 - RLA (len) = Grid(nb)%xlat (ix) * pifac - RLO (len) = Grid(nb)%xlon (ix) * pifac - OROG (len) = Sfcprop(nb)%oro (ix) - OROG_UF (len) = Sfcprop(nb)%oro_uf (ix) - SLIFCS (len) = Sfcprop(nb)%slmsk (ix) - if ( Model%nstf_name(1) > 0 ) then - TSFFCS(len) = Sfcprop(nb)%tref (ix) - else - TSFFCS(len) = Sfcprop(nb)%tsfc (ix) - endif - SNOFCS (len) = Sfcprop(nb)%weasd (ix) - ZORFCS (len) = Sfcprop(nb)%zorl (ix) - TG3FCS (len) = Sfcprop(nb)%tg3 (ix) - CNPFCS (len) = Sfcprop(nb)%canopy (ix) -! F10MFCS (len) = Sfcprop(nb)%f10m (ix) - VEGFCS (len) = Sfcprop(nb)%vfrac (ix) - VETFCS (len) = Sfcprop(nb)%vtype (ix) - SOTFCS (len) = Sfcprop(nb)%stype (ix) - CVFCS (len) = Cldprop(nb)%cv (ix) - CVBFCS (len) = Cldprop(nb)%cvb (ix) - CVTFCS (len) = Cldprop(nb)%cvt (ix) - SWDFCS (len) = Sfcprop(nb)%snowd (ix) - SIHFCS (len) = Sfcprop(nb)%hice (ix) - SICFCS (len) = Sfcprop(nb)%fice (ix) - SITFCS (len) = Sfcprop(nb)%tisfc (ix) - VMNFCS (len) = Sfcprop(nb)%shdmin (ix) - VMXFCS (len) = Sfcprop(nb)%shdmax (ix) - SLPFCS (len) = Sfcprop(nb)%slope (ix) - ABSFCS (len) = Sfcprop(nb)%snoalb (ix) - - ALFFC1 (len ) = Sfcprop(nb)%facsf (ix) - ALFFC1 (len + npts) = Sfcprop(nb)%facwf (ix) - - ALBFC1 (len ) = Sfcprop(nb)%alvsf (ix) - ALBFC1 (len + npts ) = Sfcprop(nb)%alvwf (ix) - ALBFC1 (len + npts*2) = Sfcprop(nb)%alnsf (ix) - ALBFC1 (len + npts*3) = Sfcprop(nb)%alnwf (ix) - - do ls = 1,Model%lsoil - SMCFC1 (len + (ls-1)*npts) = Sfcprop(nb)%smc (ix,ls) - STCFC1 (len + (ls-1)*npts) = Sfcprop(nb)%stc (ix,ls) - SLCFC1 (len + (ls-1)*npts) = Sfcprop(nb)%slc (ix,ls) - enddo - - IF (SLIFCS(len) .LT. 0.1 .OR. SLIFCS(len) .GT. 1.5) THEN - SLMASK(len) = 0 - ELSE - SLMASK(len) = 1 - ENDIF - - IF (SLIFCS(len) .EQ. 2) THEN - AISFCS(len) = 1. - ELSE - AISFCS(len) = 0. - ENDIF - -! if (Model%me .eq. 0) -! & print *,' len=',len,' rla=',rla(len),' rlo=',rlo(len) - ENDDO !-----END BLOCK SIZE LOOP------------------------------ - ENDDO !-----END BLOCK LOOP------------------------------- - -! check -! call mymaxmin(slifcs,len,len,1,'slifcs') -! call mymaxmin(slmask,len,len,1,'slmsk') -! -#ifndef INTERNAL_FILE_NML - inquire (file=trim(Model%fn_nml),exist=exists) - if (.not. exists) then - write(6,*) 'gcycle:: namelist file: ',trim(Model%fn_nml),' does not exist' - stop - else - open (unit=Model%nlunit, file=trim(Model%fn_nml), action='READ', status='OLD', iostat=ios) - rewind (Model%nlunit) - endif -#endif - CALL SFCCYCLE (9998, npts, Model%lsoil, SIG1T, Model%fhcyc, & - Model%idate(4), Model%idate(2), & - Model%idate(3), Model%idate(1), & - Model%phour, RLA, RLO, SLMASK, & -! Model%fhour, RLA, RLO, SLMASK, & - OROG, OROG_UF, Model%USE_UFO, Model%nst_anl, & - SIHFCS, SICFCS, SITFCS, SWDFCS, SLCFC1, & - VMNFCS, VMXFCS, SLPFCS, ABSFCS, TSFFCS, & - SNOFCS, ZORFCS, ALBFC1, TG3FCS, CNPFCS, & - SMCFC1, STCFC1, SLIFCS, AISFCS, & - VEGFCS, VETFCS, SOTFCS, ALFFC1, CVFCS, & - CVBFCS, CVTFCS, Model%me, Model%nlunit, & - size(Model%input_nml_file), & - Model%input_nml_file, & - Model%ialb, Model%isot, Model%ivegsrc, & - trim(tile_num_ch), i_index, j_index) -#ifndef INTERNAL_FILE_NML - close (Model%nlunit) -#endif - - len = 0 - do nb = 1,nblks - do ix = 1,size(Grid(nb)%xlat,1) - len = len + 1 - Sfcprop(nb)%slmsk (ix) = SLIFCS (len) - if ( Model%nstf_name(1) > 0 ) then - Sfcprop(nb)%tref(ix) = TSFFCS (len) - else - Sfcprop(nb)%tsfc(ix) = TSFFCS (len) - endif - Sfcprop(nb)%weasd (ix) = SNOFCS (len) - Sfcprop(nb)%zorl (ix) = ZORFCS (len) - Sfcprop(nb)%tg3 (ix) = TG3FCS (len) - Sfcprop(nb)%canopy (ix) = CNPFCS (len) -! Sfcprop(nb)%f10m (ix) = F10MFCS (len) - Sfcprop(nb)%vfrac (ix) = VEGFCS (len) - Sfcprop(nb)%vtype (ix) = VETFCS (len) - Sfcprop(nb)%stype (ix) = SOTFCS (len) - Cldprop(nb)%cv (ix) = CVFCS (len) - Cldprop(nb)%cvb (ix) = CVBFCS (len) - Cldprop(nb)%cvt (ix) = CVTFCS (len) - Sfcprop(nb)%snowd (ix) = SWDFCS (len) - Sfcprop(nb)%hice (ix) = SIHFCS (len) - Sfcprop(nb)%fice (ix) = SICFCS (len) - Sfcprop(nb)%tisfc (ix) = SITFCS (len) - Sfcprop(nb)%shdmin (ix) = VMNFCS (len) - Sfcprop(nb)%shdmax (ix) = VMXFCS (len) - Sfcprop(nb)%slope (ix) = SLPFCS (len) - Sfcprop(nb)%snoalb (ix) = ABSFCS (len) - - Sfcprop(nb)%facsf (ix) = ALFFC1 (len ) - Sfcprop(nb)%facwf (ix) = ALFFC1 (len + npts) - - Sfcprop(nb)%alvsf (ix) = ALBFC1 (len ) - Sfcprop(nb)%alvwf (ix) = ALBFC1 (len + npts ) - Sfcprop(nb)%alnsf (ix) = ALBFC1 (len + npts*2) - Sfcprop(nb)%alnwf (ix) = ALBFC1 (len + npts*3) - do ls = 1,Model%lsoil - Sfcprop(nb)%smc (ix,ls) = SMCFC1 (len + (ls-1)*npts) - Sfcprop(nb)%stc (ix,ls) = STCFC1 (len + (ls-1)*npts) - Sfcprop(nb)%slc (ix,ls) = SLCFC1 (len + (ls-1)*npts) - enddo - ENDDO !-----END BLOCK SIZE LOOP------------------------------ - ENDDO !-----END BLOCK LOOP------------------------------- - -! check -! call mymaxmin(slifcs,len,len,1,'slifcs') -! -! if (Model%me .eq. 0) print*,'executed gcycle during hour=',fhour - - RETURN - END diff --git a/physics/gscond.f b/physics/gscond.f deleted file mode 100644 index bfc6115fa..000000000 --- a/physics/gscond.f +++ /dev/null @@ -1,526 +0,0 @@ -!> \file gscond.f -!! This file contains the subroutine that calculates grid-scale -!! condensation and evaporation for use in Zhao and Carr (1997) -!! \cite zhao_and_carr_1997 scheme. - -!> This module contains the CCPP-compliant zhao_carr_gscond scheme. - module zhaocarr_gscond - contains - - -! \brief Brief description of the subroutine -! -!> \section arg_table_gscond_init Argument Table -!! - subroutine zhaocarr_gscond_init - end subroutine zhaocarr_gscond_init - -! \brief Brief description of the subroutine -! -!> \section arg_table_gscond_finalize Argument Table -!! - subroutine zhaocarr_gscond_finalize - end subroutine zhaocarr_gscond_finalize - -!> \defgroup condense GFS gscond Main -!> @{ -!! This subroutine computes grid-scale condensation and evaporation of -!! cloud condensate. -!! -#if 0 -!> \section arg_table_zhaocarr_gscond_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|----------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | dtf | time_step_for_dynamics | dynamics time step | s | 0 | real | kind_phys | in | F | -!! | prsl | air_pressure | layer mean air pressure | Pa | 2 | real | kind_phys | in | F | -!! | ps | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | q | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | clw1 | ice_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | in | F | -!! | clw2 | cloud_condensed_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | in | F | -!! | cwm | cloud_condensed_water_mixing_ratio_updated_by_physics | moist cloud condensed water mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | -!! | t | air_temperature_updated_by_physics | layer mean air temperature | K | 2 | real | kind_phys | inout | F | -!! | tp | air_temperature_two_time_steps_back | air temperature two time steps back | K | 2 | real | kind_phys | inout | F | -!! | qp | water_vapor_specific_humidity_two_time_steps_back | water vapor specific humidity two time steps back | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | psp | surface_air_pressure_two_time_steps_back | surface air pressure two time steps back | Pa | 1 | real | kind_phys | inout | F | -!! | tp1 | air_temperature_at_previous_time_step | air temperature at previous time step | K | 2 | real | kind_phys | inout | F | -!! | qp1 | water_vapor_specific_humidity_at_previous_time_step | water vapor specific humidity at previous time step | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | psp1 | surface_air_pressure_at_previous_time_step | surface air surface pressure at previous time step | Pa | 1 | real | kind_phys | inout | F | -!! | u | critical_relative_humidity | critical relative humidity | frac | 2 | real | kind_phys | in | F | -!! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | -!! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! -#endif -!> \section general_gscond GFS gscond Scheme General Algorithm -!! -# Calculate ice-water identification number \f$IW\f$ in order to make a distinction between -!! cloud water and cloud ice (table2 of Zhao and Carr (1997) \cite zhao_and_carr_1997). -!! -# Calculate the changes in \f$t\f$, \f$q\f$ and \f$p\f$ due to all the processes except microphysics. -!! -# Calculate cloud evaporation rate (\f$E_c\f$, eq. 19 of Zhao and Carr (1997)\cite zhao_and_carr_1997). -!! -# Calculate cloud condensation rate (\f$C_g\f$, eq.8 of Zhao and Carr (1997)\cite zhao_and_carr_1997). -!! -# Update \f$t\f$, \f$q\f$, \f$cwm\f$ due to cloud evaporation and condensation processes. -!> \section Zhao-Carr_cond_detailed GFS gscond Scheme Detailed Algorithm -!> @{ - subroutine zhaocarr_gscond_run (im,ix,km,dt,dtf,prsl,ps,q,clw1 & - &, clw2, cwm, t, tp, qp, psp & - &, tp1, qp1, psp1, u, lprnt, ipr, errmsg, errflg) - -! -! ****************************************************************** -! * * -! * subroutine for grid-scale condensation & evaporation * -! * for the mrf model at ncep. * -! * * -! ****************************************************************** -! * * -! * created by: q. zhao jan. 1995 * -! * modified by: h.-l. pan sep. 1998 * -! * modified by: s. moorthi aug. 1998, 1999, 2000 * -! * * -! * references: * -! * * -! ****************************************************************** -! - use machine , only : kind_phys - use funcphys , only : fpvs - use physcons, psat => con_psat, hvap => con_hvap, grav => con_g - &, hfus => con_hfus, ttp => con_ttp, rd => con_rd - &, cp => con_cp, eps => con_eps, epsm1 => con_epsm1 - &, rv => con_rv -! use namelist_def, only: nsdfi,fhdfi - implicit none -! -! Interface variables - integer, intent(in) :: im, ix, km, ipr - real(kind=kind_phys), intent(in) :: dt, dtf - real(kind=kind_phys), intent(in) :: prsl(ix,km), ps(im) - real(kind=kind_phys), intent(inout) :: q(ix,km) - real(kind=kind_phys), intent(in) :: clw1(ix,km), clw2(ix,km) - real(kind=kind_phys), intent(out) :: cwm(ix,km) - real(kind=kind_phys), intent(inout) :: t(ix,km) & - &, tp(ix,km), qp(ix,km), psp(im) & - &, tp1(ix,km), qp1(ix,km), psp1(im) - real(kind=kind_phys), intent(in) :: u(im,km) - logical, intent(in) :: lprnt -! - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -! -! Local variables - real (kind=kind_phys) h1 - &, d00, elwv, eliv - &, epsq - &, r, cpr, rcp - parameter (h1=1.e0, d00=0.e0 - &, elwv=hvap, eliv=hvap+hfus - &, epsq=2.e-12, r=rd - &, cpr=cp*r, rcp=h1/cp) -! - real(kind=kind_phys), parameter :: cons_0=0.0, cons_m15=-15.0 -! - real (kind=kind_phys) qi(im), qint(im), ccrik, e0 - &, cond, rdt, us, cclimit, climit - &, tmt0, tmt15, qik, cwmik - &, ai, qw, u00ik, tik, pres, pp0, fi - &, at, aq, ap, fiw, elv, qc, rqik - &, rqikk, tx1, tx2, tx3, es, qs - &, tsq, delq, condi, cone0, us00, ccrik1 - &, aa, ab, ac, ad, ae, af, ag - &, el2orc, albycp -! real (kind=kind_phys) vprs(im) - integer iw(im,km), i, k, iwik -! - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 -! -!-----------------GFS interstitial in driver ---------------------------- - do i = 1,im - do k= 1,km - cwm(i,k) = clw1(i,k)+clw2(i,k) - enddo - enddo -!-----------------prepare constants for later uses----------------- -! - el2orc = hvap*hvap / (rv*cp) - albycp = hvap / cp -! write(0,*)' in gscond im=',im,' ix=',ix -! - rdt = h1/dt - us = h1 - cclimit = 1.0e-3 - climit = 1.0e-20 -! - do i = 1, im - iw(i,km) = d00 - enddo -! -! check for first time step -! -! if (tp(1,1) < 1.) then -! do k = 1, km -! do i = 1, im -! tp(i,k) = t(i,k) -! qp(i,k) = max(q(i,k),epsq) -! tp1(i,k) = t(i,k) -! qp1(i,k) = max(q(i,k),epsq) -! enddo -! enddo -! do i = 1, im -! psp(i) = ps(i) -! psp1(i) = ps(i) -! enddo -! endif -! -!************************************************************* -!> -# Begining of grid-scale condensation/evaporation loop (start of -!! k-loop, i-loop) -!************************************************************* -! -! do k = km-1,2,-1 - do k = km,1,-1 -! vprs(:) = 0.001 * fpvs(t(:,k)) ! fpvs in pa -!----------------------------------------------------------------------- -!------------------qw, qi and qint-------------------------------------- - do i = 1, im - tmt0 = t(i,k)-273.16 - tmt15 = min(tmt0,cons_m15) - qik = max(q(i,k),epsq) - cwmik = max(cwm(i,k),climit) -! -! ai = 0.008855 -! bi = 1.0 -! if (tmt0 .lt. -20.0) then -! ai = 0.007225 -! bi = 0.9674 -! end if -! -! the global qsat computation is done in pa - pres = prsl(i,k) -! -! qw = vprs(i) - qw = min(pres, fpvs(t(i,k))) -! - qw = eps * qw / (pres + epsm1 * qw) - qw = max(qw,epsq) -! qi(i) = qw *(bi+ai*min(tmt0,cons_0)) -! qint(i) = qw *(1.-0.00032*tmt15*(tmt15+15.)) - qi(i) = qw - qint(i) = qw -! if (tmt0 .le. -40.) qint(i) = qi(i) - -!> -# Compute ice-water identification number IW. -!!\n The distinction between cloud water and cloud ice is made by the -!! cloud identification number IW, which is zero for cloud water and -!! unity for cloud ice (Table 2 in Zhao and Carr (1997) -!! \cite zhao_and_carr_1997): -!! - All clouds are defined to consist of liquid water below the -!! freezing level (\f$T\geq 0^oC\f$) and of ice particles above the -!! \f$T=-15^oC\f$ level. -!! - In the temperature region between \f$-15^oC\f$ and \f$0^oC\f$, -!! clouds may be composed of liquid water or ice. If there are cloud -!! ice particles above this point at the previous or current time step, -!! or if the cloud at this point at the previous time step consists of -!! ice particles, then the cloud substance at this point is considered -!! to be ice particles because of the cloud seeding effect and the -!! memory of its content. Otherwise, all clouds in this region are -!! considered to contain supercooled cloud water. - -!-------------------ice-water id number iw------------------------------ - if(tmt0.lt.-15.0) then - u00ik = u(i,k) - fi = qik - u00ik*qi(i) - if(fi > d00.or.cwmik > climit) then - iw(i,k) = 1 - else - iw(i,k) = 0 - end if - end if -! - if(tmt0.ge.0.0) then - iw(i,k) = 0 - end if -! - if (tmt0 < 0.0 .and. tmt0 >= -15.0) then - iw(i,k) = 0 - if (k < km) then - if (iw(i,k+1) == 1 .and. cwmik > climit) iw(i,k) = 1 - endif - end if - enddo -!> -# Condensation and evaporation of cloud -!--------------condensation and evaporation of cloud-------------------- - do i = 1, im -!> - Compute the changes in t, q and p (\f$A_{t}\f$,\f$A_{q}\f$ and -!! \f$A_{p}\f$) caused by all the processes except grid-scale -!! condensation and evaporation. -!!\f[ -!! A_{t}=(t-tp)/dt -!!\f] -!!\f[ -!! A_{q}=(q-qp)/dt -!!\f] -!!\f[ -!! A_{p}=(prsl-\frac{prsl}{ps} \times psp)/dt -!!\f] -!------------------------at, aq and dp/dt------------------------------- - qik = max(q(i,k),epsq) - cwmik = max(cwm(i,k),climit) - iwik = iw(i,k) - u00ik = u(i,k) - tik = t(i,k) - pres = prsl(i,k) - pp0 = (pres / ps(i)) * psp(i) - at = (tik-tp(i,k)) * rdt - aq = (qik-qp(i,k)) * rdt - ap = (pres-pp0) * rdt -!> - Calculate the saturation specific humidity \f$q_{s}\f$ and the -!! relative humidity \f$f\f$ using IW. -!----------------the satuation specific humidity------------------------ - fiw = float(iwik) - elv = (h1-fiw)*elwv + fiw*eliv - qc = (h1-fiw)*qint(i) + fiw*qi(i) -! if (lprnt) print *,' qc=',qc,' qint=',qint(i),' qi=',qi(i) -!----------------the relative humidity---------------------------------- - if(qc.le.1.0e-10) then - rqik=d00 - else - rqik = qik/qc - endif - -!> - According to Sundqvist et al. (1989) \cite sundqvist_et_al_1989, -!! estimate cloud fraction \f$b\f$ at a grid point from relative -!! humidity \f$f\f$ using the equation -!!\f[ -!! b=1-\left ( \frac{f_{s}-f}{f_{s}-u} \right )^{1/2} -!!\f] -!! for \f$f>u\f$; and \f$b=0\f$ for \f$f1.0\times10^{-3}\f$, condense water vapor -!! into cloud condensate (\f$C_{g}\f$). -!!\n Using \f$q=fq_{s}\f$, \f$q_{s}=\epsilon e_{s}/p\f$, and the -!! Clausius-Clapeyron equation \f$de_{s}/dT=\epsilon Le_{s}/RT^{2}\f$, -!! where \f$q_{s}\f$ is the saturation specific humidity,\f$e_{s}\f$ -!! is the saturation vapor pressure, \f$R\f$ is the specific gas -!! constant for dry air, \f$f\f$ is the relative humidity, and -!! \f$\epsilon=0.622\f$, the expression for \f$C_{g}\f$ has the form -!!\f[ -!! C_{g}=\frac{M-q_{s}f_{t}}{1+(f\epsilon L^{2}q_{s}/RC_{p}T^{2})}+E_{c} -!!\f] -!! where -!!\f[ -!! M=A_{q}-\frac{f\epsilon Lq_{s}}{RT^{2}}A_{t}+\frac{fq_{s}}{p}A_{p} -!!\f] -!! To close the system, an equation for the relative humidity tendency -!! \f$f_{t}\f$ was derived by Sundqvist et al.(1989) -!! \cite sundqvist_et_al_1989 using the hypothesis that the quantity -!! \f$M+E_{c}\f$ is divided into one part,\f$bM\f$,which condenses -!! in the already cloudy portion of a grid square, and another part, -!! \f$(1-b)M+E_{c}\f$,which is used to increase the relative humidity -!! of the cloud-free portion and the cloudiness in the square. The -!! equation is written as -!!\f[ -!! f_{t}=\frac{2(1-b)(f_{s}-u)[(1-b)M+E_{c}]}{2q_{s}(1-b)(f_{s}-u)+cwm/b} -!!\f] -!! - Check and correct if over condensation occurs. -!! - Update t, q and cwm (according to Eqs(6) and (7) in Zhao and Carr (1997) -!! \cite zhao_and_carr_1997) -!!\f[ -!! cwm=cwm+(C_{g}-E_{c})\times dt -!!\f] -!!\f[ -!! q=q-(C_{g}-E_{c})\times dt -!!\f] -!!\f[ -!! t=t+\frac{L}{C_{p}}(C_{g}-E_{c})\times dt -!!\f] -!!\n where \f$L\f$ is the latent heat of condensation/deposition, and -!! \f$C_{p}\f$ is the specific heat of air at constant pressure. - -!----------------cloud cover ratio ccrik-------------------------------- - if (rqik .lt. u00ik) then - ccrik = d00 - elseif(rqik.ge.us) then - ccrik = us - else - rqikk = min(us,rqik) - ccrik = h1-sqrt((us-rqikk)/(us-u00ik)) - endif -!-----------correct ccr if it is too small in large cwm regions-------- -! if(ccrik.ge.0.01.and.ccrik.le.0.2.and -! & .cwmik.ge.0.2e-3) then -! ccrik=min(1.0,cwmik*1.0e3) -! end if -!---------------------------------------------------------------------- -! if no cloud exists then evaporate any existing cloud condensate -!----------------evaporation of cloud water----------------------------- - e0 = d00 - if (ccrik <= cclimit.and. cwmik > climit) then -! -! first iteration - increment halved -! - tx1 = tik - tx3 = qik -! - es = min(pres, fpvs(tx1)) - qs = u00ik * eps * es / (pres + epsm1*es) - tsq = tx1 * tx1 - delq = 0.5 * (qs - tx3) * tsq / (tsq + el2orc * qs) -! - tx2 = delq - tx1 = tx1 - delq * albycp - tx3 = tx3 + delq -! -! second iteration -! - es = min(pres, fpvs(tx1)) - qs = u00ik * eps * es / (pres + epsm1*es) - tsq = tx1 * tx1 - delq = (qs - tx3) * tsq / (tsq + el2orc * qs) -! - tx2 = tx2 + delq - tx1 = tx1 - delq * albycp - tx3 = tx3 + delq -! -! third iteration -! - es = min(pres, fpvs(tx1)) - qs = u00ik * eps * es / (pres + epsm1*es) - tsq = tx1 * tx1 - delq = (qs - tx3) * tsq / (tsq + el2orc * qs) - tx2 = tx2 + delq -! - e0 = max(tx2*rdt, cons_0) -! if (lprnt .and. i .eq. ipr .and. k .eq. 34) -! & print *,' tx2=',tx2,' qc=',qc,' u00ik=',u00ik,' rqik=',rqik -! &,' cwmik=',cwmik,' e0',e0 - -! e0 = max(qc*(u00ik-rqik)*rdt, cons_0) - e0 = min(cwmik*rdt, e0) - e0 = max(cons_0,e0) - end if -! if cloud cover > 0.2 condense water vapor in to cloud condensate -!-----------the eqs. for cond. has been reorganized to reduce cpu------ - cond = d00 -! if (ccrik .gt. 0.20 .and. qc .gt. epsq) then - if (ccrik .gt. cclimit .and. qc .gt. epsq) then - us00 = us - u00ik - ccrik1 = 1.0 - ccrik - aa = eps*elv*pres*qik - ab = ccrik*ccrik1*qc*us00 - ac = ab + 0.5*cwmik - ad = ab * ccrik1 - ae = cpr*tik*tik - af = ae * pres - ag = aa * elv - ai = cp * aa - cond = (ac-ad)*(af*aq-ai*at+ae*qik*ap)/(ac*(af+ag)) -!-----------check & correct if over condensation occurs----------------- - condi = (qik -u00ik *qc*1.0)*rdt - cond = min(cond, condi) -!----------check & correct if supersatuation is too high---------------- -! qtemp=qik-max(0.,(cond-e0))*dt -! if(qc.le.1.0e-10) then -! rqtmp=0.0 -! else -! rqtmp=qtemp/qc -! end if -! if(rqtmp.ge.1.10) then -! cond=(qik-1.10*qc)*rdt -! end if -!----------------------------------------------------------------------- - cond = max(cond, d00) -!-------------------update of t, q and cwm------------------------------ - end if - cone0 = (cond-e0) * dt - cwm(i,k) = cwm(i,k) + cone0 -! if (lprnt .and. i .eq. ipr) print *,' t=',t(i,k),' cone0',cone0 -! &,' cond=',cond,' e0=',e0,' elv=',elv,' rcp=',rcp,' k=',k -! &,' cwm=',cwm(i,k) - t(i,k) = t(i,k) + elv*rcp*cone0 - q(i,k) = q(i,k) - cone0 - enddo ! end of i-loop! - enddo ! end of k-loop! -! -!********************************************************************* -!> -# End of the condensation/evaporation loop (end of i-loop,k-loop). -!********************************************************************* -! -!> -# Store \f$t\f$, \f$q\f$, \f$ps\f$ for next time step. - - if (dt > dtf+0.001) then ! three time level - do k = 1, km - do i = 1, im - tp(i,k) = tp1(i,k) - qp(i,k) = qp1(i,k) -! - tp1(i,k) = t(i,k) - qp1(i,k) = max(q(i,k),epsq) - enddo - enddo - do i = 1, im - psp(i) = psp1(i) - psp1(i) = ps(i) - enddo - else ! two time level scheme - tp1, qp1, psp1 not used - do k = 1, km -! write(0,*)' in gscond k=',k,' im=',im,' km=',km - do i = 1, im -! write(0,*)' in gscond i=',i - tp(i,k) = t(i,k) - qp(i,k) = max(q(i,k),epsq) -! qp(i,k) = q(i,k) - tp1(i,k) = tp(i,k) - qp1(i,k) = qp(i,k) - enddo - enddo - do i = 1, im - psp(i) = ps(i) - psp1(i) = ps(i) - enddo - endif -!----------------------------------------------------------------------- - return - end subroutine zhaocarr_gscond_run -!> @} -!> @} - end module zhaocarr_gscond diff --git a/physics/module_MYNNSFC_wrapper.F90 b/physics/module_MYNNSFC_wrapper.F90 deleted file mode 100644 index 554a00e74..000000000 --- a/physics/module_MYNNSFC_wrapper.F90 +++ /dev/null @@ -1,362 +0,0 @@ -!> \file module_mynnsfc_wrapper.F90 -!! Contains all of the code related to running the MYNN surface layer scheme - - MODULE mynnsfc_wrapper - - contains - - subroutine mynnsfc_wrapper_init () - end subroutine mynnsfc_wrapper_init - - subroutine mynnsfc_wrapper_finalize () - end subroutine mynnsfc_wrapper_finalize - -!>\defgroup gsd_mynn_sfc GSD MYNN Surface Layer Scheme Module -!> \brief This scheme (1) performs pre-mynnsfc work, (2) runs the mynn sfc layer scheme, and (3) performs post-mynnsfc work -#if 0 -!! \section arg_table_mynnsfc_wrapper_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |---------------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | iter | ccpp_loop_counter | loop counter for subcycling loops in CCPP | index | 0 | integer | | in | F | -!! | flag_init | flag_for_first_time_step | flag signaling first time step for time integration loop | flag | 0 | logical | | in | F | -!! | flag_restart | flag_for_restart | flag for restart (warmstart) or coldstart | flag | 0 | logical | | in | F | -!! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | -!! | dx | cell_size | size of the grid cell | m | 1 | real | kind_phys | in | F | -!! | u | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | v | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | t3d | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | -!! | qvsh | water_vapor_specific_humidity | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | in | F | -!! | qc | cloud_condensed_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) | kg kg-1 | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | exner | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | -!! | tsq | t_prime_squared | temperature fluctuation squared | K2 | 2 | real | kind_phys | in | F | -!! | qsq | q_prime_squared | water vapor fluctuation squared | kg2 kg-2 | 2 | real | kind_phys | in | F | -!! | cov | t_prime_q_prime | covariance of temperature and moisture | K kg kg-1 | 2 | real | kind_phys | in | F | -!! | el_pbl | mixing_length | mixing length in meters | m | 2 | real | kind_phys | in | F | -!! | Sh3D | stability_function_for_heat | stability function for heat | none | 2 | real | kind_phys | in | F | -!! | QC_BL | subgrid_cloud_mixing_ratio_pbl | subgrid cloud cloud mixing ratio from PBL scheme | kg kg-1 | 2 | real | kind_phys | in | F | -!! | CLDFRA_BL | subgrid_cloud_fraction_pbl | subgrid cloud fraction from PBL scheme | frac | 2 | real | kind_phys | in | F | -!! | ps | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | PBLH | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | in | F | -!! | slmsk | sea_land_ice_mask_real | landmask: sea/land/ice=0/1/2 | flag | 1 | real | kind_phys | in | F | -!! | tsk | surface_skin_temperature | surface temperature | K | 1 | real | kind_phys | in | F | -!! | qsfc | surface_specific_humidity | surface air saturation specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | snowd | surface_snow_thickness_water_equivalent | water equivalent snow depth over land | mm | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | inout | F | -!! | ust | surface_friction_velocity | boundary layer parameter | m s-1 | 1 | real | kind_phys | inout | F | -!! | ustm | surface_friction_velocity_drag | friction velocity isolated for momentum only | m s-1 | 1 | real | kind_phys | inout | F | -!! | zol | surface_stability_parameter | monin obukhov surface stability parameter | none | 1 | real | kind_phys | inout | F | -!! | mol | theta_star | temperature flux divided by ustar (temperature scale) | K | 1 | real | kind_phys | inout | F | -!! | rmol | reciprocal_of_obukhov_length | one over obukhov length | m-1 | 1 | real | kind_phys | inout | F | -!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | inout | F | -!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | inout | F | -!! | fm10 | Monin-Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | inout | F | -!! | fh2 | Monin-Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | inout | F | -!! | wspd | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | inout | F | -!! | br | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | inout | F | -!! | ch | surface_drag_wind_speed_for_momentum_in_air | momentum exchange coefficient | m s-1 | 1 | real | kind_phys | inout | F | -!! | hflx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | inout | F | -!! | QFX | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | inout | F | -!! | lh | surface_latent_heat | latent heating at the surface (pos = up) | W m-2 | 1 | real | kind_phys | inout | F | -!! | flhc | surface_exchange_coefficient_for_heat | surface exchange coefficient for heat | W m-2 K-1 | 1 | real | kind_phys | inout | F | -!! | flqc | surface_exchange_coefficient_for_moisture | surface exchange coefficient for moisture | kg m-2 s-1 | 1 | real | kind_phys | inout | F | -!! | u10 | x_wind_at_10m | 10 meter u wind speed | m s-1 | 1 | real | kind_phys | inout | F | -!! | v10 | y_wind_at_10m | 10 meter v wind speed | m s-1 | 1 | real | kind_phys | inout | F | -!! | th2 | potential_temperature_at_2m | 2 meter potential temperature | K | 1 | real | kind_phys | inout | F | -!! | t2 | temperature_at_2m | 2 meter temperature | K | 1 | real | kind_phys | inout | F | -!! | q2 | specific_humidity_at_2m | 2 meter specific humidity | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | wstar | surface_wind_enhancement_due_to_convection | surface wind enhancement due to convection | m s-1 | 1 | real | kind_phys | inout | F | -!! | chs2 | surface_exchange_coefficient_for_heat_at_2m | exchange coefficient for heat at 2 meters | m s-1 | 1 | real | kind_phys | inout | F | -!! | cqs2 | surface_exchange_coefficient_for_moisture_at_2m | exchange coefficient for moisture at 2 meters | m s-1 | 1 | real | kind_phys | inout | F | -!! | cda | surface_drag_coefficient_for_momentum_in_air | surface exchange coeff for momentum | none | 1 | real | kind_phys | inout | F | -!! | cka | surface_drag_coefficient_for_heat_and_moisture_in_air | surface exchange coeff heat & moisture | none | 1 | real | kind_phys | inout | F | -!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | inout | F | -!! | bl_mynn_cloudpdf | cloudpdf | flag to determine which cloud PDF to use | flag | 0 | integer | | in | F | -!! | icloud_bl | couple_sgs_clouds_to_radiation_flag | flag for coupling sgs clouds to radiation | flag | 0 | integer | | in | F | -!! | lprnt | flag_print | control flag for diagnostic print out | flag | 0 | logical | | none | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! -#endif -!###=================================================================== -SUBROUTINE mynnsfc_wrapper_run( & - & ix,im,levs, & - & iter,flag_init,flag_restart, & - & delt,dx, & - & u, v, t3d, qvsh, qc, prsl, phii,& - & exner, tsq, qsq, cov, sh3d, & - & el_pbl, qc_bl, cldfra_bl, & - & ps, PBLH, slmsk, TSK, & - & QSFC, snowd, & - & zorl,UST,USTM, ZOL,MOL,RMOL, & - & fm, fh, fm10, fh2, WSPD, br, ch,& - & HFLX, QFX, LH, FLHC, FLQC, & - & U10, V10, TH2, T2, Q2, & - & wstar, CHS2, CQS2, & - & cda, cka, stress, & -! & CP, G, ROVCP, R, XLV, & -! & SVP1, SVP2, SVP3, SVPT0, & -! & EP1,EP2,KARMAN, & - & icloud_bl, bl_mynn_cloudpdf, & - & lprnt, errmsg, errflg ) - - -! should be moved to inside the mynn: - use machine , only : kind_phys -! use funcphys, only : fpvs - - use physcons, only : cp => con_cp, & - & g => con_g, & - & r_d => con_rd, & - & r_v => con_rv, & - & cpv => con_cvap, & - & cliq => con_cliq, & - & Cice => con_csol, & - & rcp => con_rocp, & - & XLV => con_hvap, & - & XLF => con_hfus, & - & EP_1 => con_fvirt, & - & EP_2 => con_eps - - USE module_sf_mynn, only : SFCLAY_mynn - -!------------------------------------------------------------------- - implicit none -!------------------------------------------------------------------- -! --- constant parameters: -! real(kind=kind_phys), parameter :: rvovrd = r_v/r_d - real(kind=kind_phys), parameter :: karman = 0.4 -! real(kind=kind_phys), parameter :: XLS = 2.85E6 -! real(kind=kind_phys), parameter :: p1000mb = 100000. - real(kind=kind_phys), parameter :: SVP1 = 0.6112 - real(kind=kind_phys), parameter :: SVP2 = 17.67 - real(kind=kind_phys), parameter :: SVP3 = 29.65 - real(kind=kind_phys), parameter :: SVPT0 = 273.15 - -!------------------------------------------------------------------- -!For WRF: -!------------------------------------------------------------------- -! USE module_model_constants, only: & -! &karman, g, p1000mb, & -! &cp, r_d, r_v, rcp, xlv, xlf, xls, & -! &svp1, svp2, svp3, svpt0, ep_1, ep_2, rvovrd, & -! &cpv, cliq, cice - -!------------------------------------------------------------------- -!For reference -! REAL , PARAMETER :: karman = 0.4 -! REAL , PARAMETER :: g = 9.81 -! REAL , PARAMETER :: r_d = 287. -! REAL , PARAMETER :: cp = 7.*r_d/2. -! REAL , PARAMETER :: r_v = 461.6 -! REAL , PARAMETER :: cpv = 4.*r_v -! REAL , PARAMETER :: cliq = 4190. -! REAL , PARAMETER :: Cice = 2106. -! REAL , PARAMETER :: rcp = r_d/cp -! REAL , PARAMETER :: XLS = 2.85E6 -! REAL , PARAMETER :: XLV = 2.5E6 -! REAL , PARAMETER :: XLF = 3.50E5 -! REAL , PARAMETER :: p1000mb = 100000. -! REAL , PARAMETER :: rvovrd = r_v/r_d -! REAL , PARAMETER :: SVP1 = 0.6112 -! REAL , PARAMETER :: SVP2 = 17.67 -! REAL , PARAMETER :: SVP3 = 29.65 -! REAL , PARAMETER :: SVPT0 = 273.15 -! REAL , PARAMETER :: EP_1 = R_v/R_d-1. -! REAL , PARAMETER :: EP_2 = R_d/R_v - - REAL, PARAMETER :: xlvcp=xlv/cp, xlscp=(xlv+xlf)/cp, ev=xlv, rd=r_d, & - &rk=cp/rd, svp11=svp1*1.e3, p608=ep_1, ep_3=1.-ep_2, g_inv=1/g - - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -! NAMELIST OPTIONS (INPUT): - INTEGER, INTENT(IN) :: & - & bl_mynn_cloudpdf, & - & icloud_bl - -!MISC CONFIGURATION OPTIONS - INTEGER, PARAMETER :: & - & spp_pbl = 0, & - & isftcflx = 0, & - & iz0tlnd = 0, & - & isfflx = 1 - -!MYNN-1D - REAL :: delt - INTEGER :: im, ix, levs - INTEGER :: iter, k, i, itimestep - LOGICAL :: flag_init,flag_restart,lprnt - INTEGER :: IDS,IDE,JDS,JDE,KDS,KDE, & - & IMS,IME,JMS,JME,KMS,KME, & - & ITS,ITE,JTS,JTE,KTS,KTE - -!MYNN-3D - real(kind=kind_phys), dimension(im,levs+1) :: phii - real(kind=kind_phys), dimension(im,levs) :: & - & exner, PRSL, & - & u, v, t3d, qvsh, qc, & - & Sh3D, EL_PBL, EXCH_H, & - & qc_bl, cldfra_bl, & - & Tsq, Qsq, Cov - !LOCAL - real(kind=kind_phys), dimension(im,levs) :: & - & dz, rho, th, qv, & - & pattern_spp_pbl - -!MYNN-2D - real(kind=kind_phys), dimension(im) :: & - & dx, pblh, slmsk, tsk, qsfc, ps, & - & zorl, ust, ustm, hflx, qfx, br, wspd, snowd, & - & FLHC, FLQC, U10, V10, TH2, T2, Q2, & - & CHS2, CQS2, rmol, zol, mol, ch, & - & fm, fh, fm10, fh2, & - & lh, cda, cka, stress, wstar - !LOCAL - real, dimension(im) :: & - & qcg, hfx, znt, ts, snowh, psim, psih, & - & chs, ck, cd, mavail, regime, xland, GZ1OZ0 - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (lprnt) then - write(0,*)"==============================================" - write(0,*)"in mynn surface layer wrapper..." - write(0,*)"flag_init=",flag_init - write(0,*)"flag_restart=",flag_restart - write(0,*)"iter=",iter - endif - - ! If initialization is needed and mynnsfc_wrapper is called - ! in a subcycling loop, then test for (flag_init==.T. .and. iter==1); - ! initialization in sfclay_mynn is triggered by itimestep == 1 - ! DH* TODO: Use flag_restart to distinguish which fields need - ! to be initialized and which are read from restart files - if (flag_init.and.iter==1) then - itimestep = 1 - else - itimestep = 2 - endif - - !prep MYNN-only variables - do k=1,levs - do i=1,im - dz(i,k)=(phii(i,k+1) - phii(i,k))*g_inv - th(i,k)=t3d(i,k)/exner(i,k) - !qc(i,k)=MAX(qgrs(i,k,ntcw),0.0) - qv(i,k)=qvsh(i,k)/(1.0 - qvsh(i,k)) - rho(i,k)=prsl(i,k)/(r_d*t3d(i,k)) !gt0(i,k)) - pattern_spp_pbl(i,k)=0.0 - enddo - enddo - do i=1,im - if (slmsk(i)==1. .or. slmsk(i)==2.)then !sea/land/ice mask (=0/1/2) in FV3 - xland(i)=1.0 !but land/water = (1/2) in SFCLAY_mynn - else - xland(i)=2.0 - endif -! ust(i) = sqrt(stress(i)) - !ch(i)=0.0 - HFX(i)=hflx(i)*rho(i,1)*cp - !QFX(i)=evap(i) - !wstar(i)=0.0 - qcg(i)=0.0 - snowh(i)=snowd(i)*800. !mm -> m - znt(i)=zorl(i)*0.01 !cm -> m? - ts(i)=tsk(i)/exner(i,1) !theta -! qsfc(i)=qss(i) -! ps(i)=pgr(i) -! wspd(i)=wind(i) - mavail(i)=1.0 !???? - enddo - - if (lprnt) then - write(0,*)"CALLING SFCLAY_mynn; input:" - print*,"T:",t3d(1,1),t3d(1,2),t3d(1,3) - print*,"TH:",th(1,1),th(1,2),th(1,3) - print*,"rho:",rho(1,1),rho(1,2),rho(1,3) - print*,"u:",u(1,1:3) - !print*,"qv:",qv(1,1:3,1) - print*,"p:",prsl(1,1)," snowh=",snowh(1) - print*,"dz:",dz(1,1)," qsfc=",qsfc(1) - print*,"rmol:",rmol(1)," ust:",ust(1) - print*,"Tsk:",tsk(1)," Thetasurf:",ts(1) - print*,"HFX:",hfx(1)," qfx",qfx(1) - print*,"qsfc:",qsfc(1)," ps:",ps(1) - print*,"wspd:",wspd(1),"br=",br(1) - print*,"znt:",znt(1)," delt=",delt - print*,"im=",im," levs=",levs - print*,"flag_init=",flag_init !," ntcw=",ntcw!," ntk=",ntk - print*,"flag_restart=",flag_restart !," ntcw=",ntcw!," ntk=",ntk - print*,"iter=",iter - !print*,"ncld=",ncld," ntrac(gq0)=",ntrac - print*,"zlvl(1)=",dz(1,1)*0.5 - print*,"PBLH=",pblh(1)," xland=",xland(1) - endif - - - CALL SFCLAY_mynn( & - u3d=u,v3d=v,t3d=t3d,qv3d=qv,p3d=prsl,dz8w=dz, & - CP=cp,G=g,ROVCP=rcp,R=r_d,XLV=xlv, & - PSFCPA=ps,CHS=chs,CHS2=chs2,CQS2=cqs2, & - ZNT=znt,UST=ust,PBLH=pblh,MAVAIL=mavail, & - ZOL=zol,MOL=mol,REGIME=regime,psim=psim,psih=psih, & - psix=fm,psit=fh,psix10=fm10,psit2=fh2, & -! fm=psix,fh=psit,fm10=psix10,fh2=psit2, & - XLAND=xland,HFX=hfx,QFX=qfx,LH=lh,TSK=tsk, & - FLHC=flhc,FLQC=flqc,QSFC=qsfc,RMOL=rmol, & - U10=u10,V10=v10,TH2=th2,T2=t2,Q2=q2,SNOWH=snowh, & - GZ1OZ0=GZ1OZ0,WSPD=wspd,BR=br,ISFFLX=isfflx,DX=dx, & - SVP1=svp1,SVP2=svp2,SVP3=svp3,SVPT0=svpt0, & - EP1=ep_1,EP2=ep_2,KARMAN=karman, & - itimestep=itimestep,ch=ch, & - th3d=th,pi3d=exner,qc3d=qc,rho3d=rho, & - tsq=tsq,qsq=qsq,cov=cov,sh3d=sh3d,el_pbl=el_pbl, & - qcg=qcg,wstar=wstar, & - icloud_bl=icloud_bl,qc_bl=qc_bl,cldfra_bl=cldfra_bl, & - spp_pbl=spp_pbl,pattern_spp_pbl=pattern_spp_pbl, & - ids=1,ide=im, jds=1,jde=1, kds=1,kde=levs, & - ims=1,ime=im, jms=1,jme=1, kms=1,kme=levs, & - its=1,ite=im, jts=1,jte=1, kts=1,kte=levs, & - ustm=ustm, ck=ck, cka=cka, cd=cd, cda=cda, & - isftcflx=isftcflx, iz0tlnd=iz0tlnd, & - bl_mynn_cloudpdf=bl_mynn_cloudpdf ) - - - ! POST MYNN SURFACE LAYER (INTERSTITIAL) WORK: - do i = 1, im - hflx(i)=hfx(i)/(rho(i,1)*cp) - !QFX(i)=evap(i) - zorl(i)=znt(i)*100. !m -> cm - stress(i) = ust(i)**2 - enddo - - - if (lprnt) then - print* - print*,"finished with mynn_surface layer; output:" - print*,"xland=",xland(1)," cda=",cda(1) - print*,"rmol:",rmol(1)," ust:",ust(1) - print*,"Tsk:",tsk(1)," Thetasurf:",ts(1) - print*,"HFX:",hfx(1)," qfx",qfx(1) - print*,"qsfc:",qsfc(1)," ps:",ps(1) - print*,"wspd:",wspd(1)," br=",br(1) - print*,"znt:",znt(1),"pblh:",pblh(1) - print*,"FLHC=",FLHC(1)," CHS=",CHS(1) - print* - endif - - - END SUBROUTINE mynnsfc_wrapper_run - -!###================================================================= - -END MODULE mynnsfc_wrapper diff --git a/physics/module_sf_mynn.F90 b/physics/module_sf_mynn.F90 deleted file mode 100644 index 70b98363d..000000000 --- a/physics/module_sf_mynn.F90 +++ /dev/null @@ -1,2446 +0,0 @@ -!>\file module_sf_mynn.F90 -!! This file contains -!WRF:MODEL_LAYER:PHYSICS -! -!>\ingroup gsd_mynn_sfc -!>\defgroup module_sf_mynn_mod GSD MYNN SFC Module -MODULE module_sf_mynn - -!------------------------------------------------------------------- -!Modifications implemented by Joseph Olson NOAA/GSD/AMB - CU/CIRES -!for WRFv3.4, v3.4.1, v3.5.1, v3.6, v3.7.1, and v3.9: -! -! BOTH LAND AND WATER: -!1) Calculation of stability parameter (z/L) taken from Li et al. (2010 BLM) -! for first iteration of first time step; afterwards, exact calculation. -!2) Fixed isfflx=0 option to turn off scalar fluxes, but keep momentum -! fluxes for idealized studies (credit: Anna Fitch). -!3) Kinematic viscosity now varies with temperature -!4) Uses Monin-Obukhov flux-profile relationships more consistent with -! those used in the MYNN PBL code. -!5) Allows negative QFX, similar to MYJ scheme -! -! LAND only: -!1) iz0tlnd option is now available with the following options: -! (default) =0: Zilitinkevich (1995) -! =1: Czil_new (modified according to Chen & Zhang 2008) -! =2: Modified Yang et al (2002, 2008) - generalized for all landuse -! =3: constant zt = z0/7.4 (original form; Garratt 1992) -! =4: Pan et al. (1994) with RUC mods for z_q, zili for z_t -!2) Relaxed u* minimum from 0.1 to 0.01 -! -! WATER only: -!1) isftcflx option is now available with the following options: -! (default) =0: z0, zt, and zq from the COARE algorithm. Set COARE_OPT (below) to -! 3.0 (Fairall et al. 2003, default) -! 3.5 (Edson et al 2013) -! =1: z0 from Davis et al (2008), zt & zq from COARE 3.0/3.5 -! =2: z0 from Davis et al (2008), zt & zq from Garratt (1992) -! =3: z0 from Taylor and Yelland (2004), zt and zq from COARE 3.0/3.5 -! =4: z0 from Zilitinkevich (2001), zt & zq from COARE 3.0/3.5 -! -! SNOW/ICE only: -!1) Added Andreas (2002) snow/ice parameterization for thermal and -! moisture roughness to help reduce the cool/moist bias in the arctic -! region. Also added a z0 mod for snow (Andreas et al. 2005, BLM), which -! -! Misc: -! 2) added a more elaborate diagnostic for u10 & V10 for high vertical resolution -! model configurations. -! -! New for v3.9: -! - option for stochastic parameter perturbations (SPP) -! -!NOTE: This code was primarily tested in combination with the RUC LSM. -! Performance with the Noah (or other) LSM is relatively unknown. -!------------------------------------------------------------------- -!For WRF -! USE module_model_constants, only: & -! &g, p1000mb, cp, xlv, ep_2, r_d, r_v, rcp, cpv -! - USE module_bl_mynn, only: tv0, b1, b2, p608, ev, rd, & !, mym_condensation - &esat_blend, xl_blend, qsat_blend - - use physcons, only : cp => con_cp, & - & g => con_g, & - & r_d => con_rd, & - & r_v => con_rv, & - & cpv => con_cvap, & - & cliq => con_cliq, & - & Cice => con_csol, & - & rcp => con_rocp, & - & XLV => con_hvap, & - & XLF => con_hfus, & - & EP_1 => con_fvirt, & - & EP_2 => con_eps - -!------------------------------------------------------------------- - IMPLICIT NONE -!------------------------------------------------------------------- -!For non-WRF -! REAL , PARAMETER :: g = 9.81 -! REAL , PARAMETER :: r_d = 287. -! REAL , PARAMETER :: cp = 7.*r_d/2. -! REAL , PARAMETER :: r_v = 461.6 -! REAL , PARAMETER :: cpv = 4.*r_v -! REAL , PARAMETER :: rcp = r_d/cp -! REAL , PARAMETER :: XLV = 2.5E6 -! REAL , PARAMETER :: XLF = 3.50E5 - REAL , PARAMETER :: p1000mb = 100000. -! REAL , PARAMETER :: EP_2 = r_d/r_v - - - - REAL, PARAMETER :: xlvcp=xlv/cp, ep_3=1.-ep_2 - REAL, PARAMETER :: wmin=0.1 ! Minimum wind speed - REAL, PARAMETER :: VCONVC=1.25 - REAL, PARAMETER :: SNOWZ0=0.011 - REAL, PARAMETER :: COARE_OPT=3.0 ! 3.0 or 3.5 - !For debugging purposes: - LOGICAL, PARAMETER :: debug_code = .false. - -CONTAINS - -!------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!> Fill the PSIM and PSIH tables. The subroutine "sfclayinit". -!! can be found in module_sf_sfclay.F. This subroutine returns -!! the forms from Dyer and Hicks (1974). - SUBROUTINE mynn_sf_init_driver(allowed_to_read) - - LOGICAL, INTENT(in) :: allowed_to_read - -! CALL sfclayinit(allowed_to_read) - - END SUBROUTINE mynn_sf_init_driver - -!------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!! This subroutine - SUBROUTINE SFCLAY_mynn( & - U3D,V3D,T3D,QV3D,P3D,dz8w, & - CP,G,ROVCP,R,XLV,PSFCPA,CHS,CHS2,CQS2, & - ZNT,UST,PBLH,MAVAIL,ZOL,MOL,REGIME, & - PSIM,PSIH,PSIX,PSIX10,PSIT,PSIT2, & - XLAND,HFX,QFX,LH,TSK,FLHC,FLQC,QSFC,RMOL, & - U10,V10,TH2,T2,Q2,SNOWH, & - GZ1OZ0,WSPD,BR,ISFFLX,DX, & - SVP1,SVP2,SVP3,SVPT0,EP1,EP2, & - KARMAN,itimestep,ch,th3d,pi3d,qc3d,rho3d, & - tsq,qsq,cov,sh3d,el_pbl,qcg,wstar, & - icloud_bl,qc_bl,cldfra_bl, & - spp_pbl,pattern_spp_pbl, & - ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte, & - ustm,ck,cka,cd,cda,isftcflx,iz0tlnd, & - bl_mynn_cloudpdf) -!------------------------------------------------------------------- - IMPLICIT NONE -!------------------------------------------------------------------- -!-- U3D 3D u-velocity interpolated to theta points (m/s) -!-- V3D 3D v-velocity interpolated to theta points (m/s) -!-- T3D 3D temperature (K) -!-- QV3D 3D water vapor mixing ratio (Kg/Kg) -!-- P3D 3D pressure (Pa) -!-- RHO3D 3D density (kg/m3) -!-- dz8w 3D dz between full levels (m) -!-- CP heat capacity at constant pressure for dry air (J/kg/K) -!-- G acceleration due to gravity (m/s^2) -!-- ROVCP R/CP -!-- R gas constant for dry air (J/kg/K) -!-- XLV latent heat of vaporization for water (J/kg) -!-- PSFCPA surface pressure (Pa) -!-- ZNT roughness length (m) -!-- UST u* in similarity theory (m/s) -!-- USTM u* in similarity theory (m/s) w* added to WSPD. This is -! used to couple with TKE scheme but not in MYNN. -! (as of now, USTM = UST in this version) -!-- PBLH PBL height from previous time (m) -!-- MAVAIL surface moisture availability (between 0 and 1) -!-- ZOL z/L height over Monin-Obukhov length -!-- MOL T* (similarity theory) (K) -!-- RMOL Reciprocal of M-O length (/m) -!-- REGIME flag indicating PBL regime (stable, unstable, etc.) -!-- PSIM similarity stability function for momentum -!-- PSIH similarity stability function for heat -!-- XLAND land mask (1 for land, 2 for water) -!-- HFX upward heat flux at the surface (W/m^2) -!-- QFX upward moisture flux at the surface (kg/m^2/s) -!-- LH net upward latent heat flux at surface (W/m^2) -!-- TSK surface temperature (K) -!-- FLHC exchange coefficient for heat (W/m^2/K) -!-- FLQC exchange coefficient for moisture (kg/m^2/s) -!-- CHS heat/moisture exchange coefficient for LSM (m/s) -!-- QGH lowest-level saturated mixing ratio -!-- QSFC qv (specific humidity) at the surface -!-- QSFCMR qv (mixing ratio) at the surface -!-- U10 diagnostic 10m u wind -!-- V10 diagnostic 10m v wind -!-- TH2 diagnostic 2m theta (K) -!-- T2 diagnostic 2m temperature (K) -!-- Q2 diagnostic 2m mixing ratio (kg/kg) -!-- SNOWH Snow height (m) -!-- GZ1OZ0 log((z1+ZNT)/ZNT) where ZNT is roughness length -!-- WSPD wind speed at lowest model level (m/s) -!-- BR bulk Richardson number in surface layer -!-- ISFFLX isfflx=1 for surface heat and moisture fluxes -!-- DX horizontal grid size (m) -!-- SVP1 constant for saturation vapor pressure (=0.6112 kPa) -!-- SVP2 constant for saturation vapor pressure (=17.67 dimensionless) -!-- SVP3 constant for saturation vapor pressure (=29.65 K) -!-- SVPT0 constant for saturation vapor pressure (=273.15 K) -!-- EP1 constant for virtual temperature (Rv/Rd - 1) (dimensionless) -!-- EP2 constant for spec. hum. calc (Rd/Rv = 0.622) (dimensionless) -!-- EP3 constant for spec. hum. calc (1 - Rd/Rv = 0.378 ) (dimensionless) -!-- KARMAN Von Karman constant -!-- ck enthalpy exchange coeff at 10 meters -!-- cd momentum exchange coeff at 10 meters -!-- cka enthalpy exchange coeff at the lowest model level -!-- cda momentum exchange coeff at the lowest model level -!-- isftcflx =0: z0, zt, and zq from COARE3.0/3.5 (Fairall et al 2003/Edson et al 2013) -! (water =1: z0 from Davis et al (2008), zt & zq from COARE3.0/3.5 -! only) =2: z0 from Davis et al (2008), zt & zq from Garratt (1992) -! =3: z0 from Taylor and Yelland (2004), zt and zq from COARE 3.0/3.5 -! =4: z0 from Zilitinkevich (2001), zt & zq from COARE 3.0/3.5 -!-- iz0tlnd =0: Zilitinkevich (1995) with Czil=0.10, -! (land =1: Czil_new (modified according to Chen & Zhang 2008) -! only) =2: Modified Yang et al (2002, 2008) - generalized for all landuse -! =3: constant zt = z0/7.4 (Garratt 1992) -! =4: Pan et al (1994) for zq; ZIlitintevich for zt -!-- bl_mynn_cloudpdf =0: Mellor & Yamada -! =1: Kuwano et al. -!-- el_pbl = mixing length from PBL scheme (meters) -!-- Sh3d = Stability finction for heat (unitless) -!-- cov = T'q' from PBL scheme -!-- tsq = T'T' from PBL scheme -!-- qsq = q'q' from PBL scheme -!-- icloud_bl = namelist option for subgrid scale cloud/radiation feedback -!-- qc_bl = subgrid scale (bloundary layer) clouds -!-- cldfra_bl = subgridscale cloud fraction -! -!-- ids start index for i in domain -!-- ide end index for i in domain -!-- jds start index for j in domain -!-- jde end index for j in domain -!-- kds start index for k in domain -!-- kde end index for k in domain -!-- ims start index for i in memory -!-- ime end index for i in memory -!-- jms start index for j in memory -!-- jme end index for j in memory -!-- kms start index for k in memory -!-- kme end index for k in memory -!-- its start index for i in tile -!-- ite end index for i in tile -!-- jts start index for j in tile -!-- jte end index for j in tile -!-- kts start index for k in tile -!-- kte end index for k in tile -!================================================================= -! SCALARS -!=================================== - INTEGER, INTENT(IN) :: ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte - INTEGER, INTENT(IN) :: itimestep - REAL, INTENT(IN) :: SVP1,SVP2,SVP3,SVPT0 - REAL, INTENT(IN) :: EP1,EP2,KARMAN - REAL, INTENT(IN) :: CP,G,ROVCP,R,XLV !,DX -!NAMELIST OPTIONS: - INTEGER, INTENT(IN) :: ISFFLX - INTEGER, OPTIONAL, INTENT(IN) :: ISFTCFLX, IZ0TLND,& - bl_mynn_cloudpdf,& - icloud_bl - INTEGER, INTENT(IN),OPTIONAL :: spp_pbl - -!=================================== -! 3D VARIABLES -!=================================== - REAL, DIMENSION( ims:ime, kms:kme, jms:jme ) , & - INTENT(IN ) :: dz8w, & - QV3D, & - P3D, & - T3D, & - QC3D, & - U3D,V3D, & - RHO3D,th3d,pi3d,tsq,qsq,cov,sh3d,el_pbl - - REAL, DIMENSION( ims:ime, kms:kme, jms:jme ) :: qc_bl, & - cldfra_bl - REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(IN),OPTIONAL ::pattern_spp_pbl -!=================================== -! 2D VARIABLES -!=================================== - REAL, DIMENSION( ims:ime, jms:jme ) , & - INTENT(IN ) :: MAVAIL, & - PBLH, & - XLAND, & - TSK, & - QCG, & - PSFCPA, & - SNOWH, & - DX - - REAL, DIMENSION( ims:ime, jms:jme ) , & - INTENT(OUT ) :: U10,V10, & - TH2,T2,Q2 - - REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ) , & - INTENT(OUT) :: ck,cka,cd,cda,ustm -! - REAL, DIMENSION( ims:ime, jms:jme ) , & - INTENT(INOUT) :: REGIME, & - HFX, & - QFX, & - LH, & - MOL,RMOL, & - QSFC, & - ZNT, & - ZOL, & - UST, & - CHS2, & - CQS2, & - CHS, & - CH, & - FLHC,FLQC, & - GZ1OZ0,WSPD,BR, & - PSIM,PSIH, & - WSTAR, & - PSIX,PSIX10,PSIT,PSIT2 - -!ADDITIONAL OUTPUT -!JOE-begin - REAL, DIMENSION( ims:ime, jms:jme ) :: z0zt_ratio, & - BulkRi,qstar,resist,logres -!JOE-end -!=================================== -! 1D LOCAL ARRAYS -!=================================== - REAL, DIMENSION( its:ite ) :: U1D, & - V1D, & - U1D2,V1D2, & !level2 winds - QV1D, & - P1D, & - T1D,QC1D, & - RHO1D, & - dz8w1d, & !level 1 height - dz2w1d !level 2 height - - REAL, DIMENSION( its:ite ) :: rstoch1D - - ! VARIABLE FOR PASSING TO MYM_CONDENSATION - REAL, DIMENSION(kts:kts+1 ) :: dummy1,dummy2,dummy3,dummy4, & - dummy5,dummy6,dummy7,dummy8, & - dummy9,dummy10,dummy11, & - dummy12,dummy13,dummy14 - - REAL, DIMENSION( its:ite ) :: vt1,vq1 - REAL, DIMENSION(kts:kts+1) :: thl, qw, vt, vq - REAL :: ql - - INTEGER :: I,J,K,itf,jtf,ktf -!----------------------------------------------------------- -!joe -test printing of constants: -! print*,"cp=", cp -! print*,"g=", g -! print*,"Rd=", r_d -! print*,"Rv=", r_v -! print*,"cpc=", cpv -! print*,"cliq=", cliq -! print*,"cice=", Cice -! print*,"rcp=", rcp -! print*,"xlv=", XLV -! print*,"xlf=", XLF -! print*,"ep1=", EP_1 -! print*,"ep2=", EP_2 - - - itf=ite !MIN0(ite,ide-1) - jtf=jte !MIN0(jte,jde-1) - ktf=kte !MIN0(kte,kde-1) - - DO J=jts,jte - DO i=its,ite - dz8w1d(I) = dz8w(i,kts,j) - dz2w1d(I) = dz8w(i,kts+1,j) - U1D(i) =U3D(i,kts,j) - V1D(i) =V3D(i,kts,j) - !2nd model level winds - for diags with high-res grids - U1D2(i) =U3D(i,kts+1,j) - V1D2(i) =V3D(i,kts+1,j) - QV1D(i)=QV3D(i,kts,j) - QC1D(i)=QC3D(i,kts,j) - P1D(i) =P3D(i,kts,j) - T1D(i) =T3D(i,kts,j) - RHO1D(i)=RHO3D(i,kts,j) - if (spp_pbl==1) then - rstoch1D(i)=pattern_spp_pbl(i,kts,j) - else - rstoch1D(i)=0.0 - endif - ENDDO - - IF (itimestep==1) THEN - DO i=its,ite - vt1(i)=0. - vq1(i)=0. - UST(i,j)=MAX(0.025*SQRT(U1D(i)*U1D(i) + V1D(i)*V1D(i)),0.001) - MOL(i,j)=0. ! Tstar - QSFC(i,j)=QV3D(i,kts,j)/(1.+QV3D(i,kts,j)) - qstar(i,j)=0.0 - ENDDO - ELSE - DO i=its,ite - DO k = kts,kts+1 - ql = qc3d(i,k,j)/(1.+qc3d(i,k,j)) - qw(k) = qv3d(i,k,j)/(1.+qv3d(i,k,j)) + ql - thl(k) = th3d(i,k,j)-xlvcp*ql/pi3d(i,k,j) - dummy1(k)=dz8w(i,k,j) - dummy2(k)=thl(k) - dummy3(k)=qw(k) - dummy4(k)=p3d(i,k,j) - dummy5(k)=pi3d(i,k,j) - dummy6(k)=tsq(i,k,j) - dummy7(k)=qsq(i,k,j) - dummy8(k)=cov(i,k,j) - dummy9(k)=Sh3d(i,k,j) - dummy10(k)=el_pbl(i,k,j) - dummy14(k)=th3d(i,k,j) - if(icloud_bl > 0) then - dummy11(k)=qc_bl(i,k,j) - dummy12(k)=cldfra_bl(i,k,j) - else - dummy11(k)=0.0 - dummy12(k)=0.0 - endif - dummy13(k)=0.0 !sgm - ENDDO - - ! NOTE: The last grid number is kts+1 instead of kte. - CALL mym_condensation (kts,kts+1, dx(i,j),& - & dummy1,dummy2,dummy3, & - & dummy4,dummy5,dummy6, & - & dummy7,dummy8,dummy9, & - & dummy10,bl_mynn_cloudpdf,& - & dummy11,dummy12, & - & PBLH(i,j),HFX(i,j), & - & vt(kts:kts+1), vq(kts:kts+1), & - & dummy14,dummy13) - -! ! NOTE: The last grid number is kts+1 instead of kte. -! CALL mym_condensation (kts,kts+1, dx, & -! & dz8w(i,kts:kts+1,j), & -! & thl(kts:kts+1), & -! & qw(kts:kts+1), & -! & p3d(i,kts:kts+1,j), & -! & pi3d(i,kts:kts+1,j), & -! & tsq(i,kts:kts+1,j), & -! & qsq(i,kts:kts+1,j), & -! & cov(i,kts:kts+1,j), & -! & Sh3d(i,kts:kts+1,j), & !JOE - cloud PDF testing -! & el_pbl(i,kts:kts+1,j), & !JOE - cloud PDF testing -! & bl_mynn_cloudpdf, & !JOE - cloud PDF testing -! & qc_bl2D(i,kts:kts+1), & !JOE-subgrid BL clouds -! & cldfra_bl2D(i,kts:kts+1),& !JOE-subgrid BL clouds -! & PBLH(i,j),HFX(i,j), & !JOE-subgrid BL clouds -! & vt(kts:kts+1), vq(kts:kts+1), & - ! & th,sgm) - vt1(i) = vt(kts) - vq1(i) = vq(kts) - ENDDO - ENDIF - - CALL SFCLAY1D_mynn( & - J,U1D,V1D,T1D,QV1D,P1D,dz8w1d,rho1d, & - U1D2,V1D2,dz2w1d, & - CP,G,ROVCP,R,XLV,PSFCPA(ims,j),CHS(ims,j),CHS2(ims,j),& - CQS2(ims,j), PBLH(ims,j), RMOL(ims,j), & - ZNT(ims,j),UST(ims,j),MAVAIL(ims,j),ZOL(ims,j), & - MOL(ims,j),REGIME(ims,j),PSIM(ims,j),PSIH(ims,j), & - PSIX(ims,j),PSIX10(ims,j),PSIT(ims,j),PSIT2(ims,j),& - XLAND(ims,j),HFX(ims,j),QFX(ims,j),TSK(ims,j), & - U10(ims,j),V10(ims,j),TH2(ims,j),T2(ims,j), & - Q2(ims,j),FLHC(ims,j),FLQC(ims,j),SNOWH(ims,j), & - QSFC(ims,j),LH(ims,j), & - GZ1OZ0(ims,j),WSPD(ims,j),BR(ims,j),ISFFLX,DX(ims,j),& - SVP1,SVP2,SVP3,SVPT0,EP1,EP2,KARMAN, & - ch(ims,j),vt1,vq1,qc1d,qcg(ims,j), & - itimestep, & -!JOE-begin additional output - z0zt_ratio(ims,j),wstar(ims,j), & - qstar(ims,j),resist(ims,j),logres(ims,j), & -!JOE-end - spp_pbl,rstoch1D, & - ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte & - ,isftcflx,iz0tlnd, & - USTM(ims,j),CK(ims,j),CKA(ims,j), & - CD(ims,j),CDA(ims,j) & - ) - - ENDDO - - END SUBROUTINE SFCLAY_MYNN - -!------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!! This subroutine calculates - SUBROUTINE SFCLAY1D_mynn( & - J,U1D,V1D,T1D,QV1D,P1D,dz8w1d,rho1d, & - U1D2,V1D2,dz2w1d, & - CP,G,ROVCP,R,XLV,PSFCPA,CHS,CHS2,CQS2, & - PBLH,RMOL,ZNT,UST,MAVAIL,ZOL,MOL,REGIME, & - PSIM,PSIH,PSIX,PSIX10,PSIT,PSIT2, & - XLAND,HFX,QFX,TSK, & - U10,V10,TH2,T2,Q2,FLHC,FLQC,SNOWH, & - QSFC,LH,GZ1OZ0,WSPD,BR,ISFFLX,DX, & - SVP1,SVP2,SVP3,SVPT0,EP1,EP2, & - KARMAN,ch,vt1,vq1,qc1d,qcg, & - itimestep, & -!JOE-additional output - zratio,wstar,qstar,resist,logres, & -!JOE-end - spp_pbl,rstoch1D, & - ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte & - ,isftcflx, iz0tlnd, & - ustm,ck,cka,cd,cda & - ) - -!------------------------------------------------------------------- - IMPLICIT NONE -!------------------------------------------------------------------- -! SCALARS -!----------------------------- - INTEGER, INTENT(IN) :: ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte, & - J, itimestep - - REAL, PARAMETER :: XKA=2.4E-5 !molecular diffusivity - REAL, PARAMETER :: PRT=1. !prandlt number - REAL, INTENT(IN) :: SVP1,SVP2,SVP3,SVPT0,EP1,EP2 - REAL, INTENT(IN) :: KARMAN,CP,G,ROVCP,R,XLV !,DX - -!----------------------------- -! NAMELIST OPTIONS -!----------------------------- - INTEGER, INTENT(IN) :: ISFFLX - INTEGER, OPTIONAL, INTENT(IN ) :: ISFTCFLX, IZ0TLND - INTEGER, INTENT(IN) :: spp_pbl - -!----------------------------- -! 1D ARRAYS -!----------------------------- - REAL, DIMENSION( ims:ime ), INTENT(IN) :: MAVAIL, & - PBLH, & - XLAND, & - TSK, & - PSFCPA, & - QCG, & - SNOWH, DX - - REAL, DIMENSION( its:ite ), INTENT(IN) :: U1D,V1D, & - U1D2,V1D2, & - QV1D,P1D, & - T1D,QC1d, & - dz8w1d,dz2w1d, & - RHO1D, & - vt1,vq1 - - REAL, DIMENSION( ims:ime ), INTENT(INOUT) :: REGIME, & - HFX,QFX,LH, & - MOL,RMOL, & - QSFC, & - ZNT, & - ZOL, & - UST, & - CHS2,CQS2, & - CHS,CH, & - FLHC,FLQC, & - GZ1OZ0, & - WSPD, & - BR, & - PSIM,PSIH, & - PSIX,PSIX10,PSIT,PSIT2 - - REAL, DIMENSION( its:ite ), INTENT(IN) :: rstoch1D - - ! DIAGNOSTIC OUTPUT - REAL, DIMENSION( ims:ime ), INTENT(OUT) :: U10,V10, & - TH2,T2,Q2 - - REAL, OPTIONAL, DIMENSION( ims:ime ) , & - INTENT(OUT) :: ck,cka,cd,cda,ustm -!-------------------------------------------- -!JOE-additinal output - REAL, DIMENSION( ims:ime ) :: zratio,wstar,qstar, & - resist,logres -!JOE-end -!---------------------------------------------------------------- -! LOCAL VARS -!---------------------------------------------------------------- - REAL :: thl1,sqv1,sqc1,exner1,sqvg,sqcg,vv,ww - - REAL, DIMENSION(its:ite) :: & - ZA, & !Height of lowest 1/2 sigma level(m) - ZA2, & !Height of 2nd lowest 1/2 sigma level(m) - THV1D, & !Theta-v at lowest 1/2 sigma (K) - TH1D, & !Theta at lowest 1/2 sigma (K) - TC1D, & !T at lowest 1/2 sigma (Celsius) - TV1D, & !Tv at lowest 1/2 sigma (K) - QVSH, & !qv at lowest 1/2 sigma (spec humidity) - PSIH2,PSIM2, & !M-O stability functions at z=2 m - PSIH10,PSIM10, & !M-O stability functions at z=10 m - WSPDI, & - CPM, & - z_t,z_q, & !thermal & moisture roughness lengths - ZNTstoch, & - GOVRTH, & !g/theta - THGB, & !theta at ground - THVGB, & !theta-v at ground - PSFC, & !press at surface (Pa/1000) - QSFCMR, & !qv at surface (mixing ratio, kg/kg) - GZ2OZ0, & !LOG((2.0+ZNT(I))/ZNT(I)) - GZ10OZ0, & !LOG((10.+ZNT(I))/ZNT(I)) - GZ2OZt, & !LOG((2.0+z_t(i))/z_t(i)) - GZ10OZt, & !LOG((10.+z_t(i))/z_t(i)) - GZ1OZt !LOG((ZA(I)+z_t(i))/z_t(i)) - - INTEGER :: N,I,K,L,NZOL,NK,NZOL2,NZOL10, ITER, yesno - INTEGER, PARAMETER :: ITMAX=1 - - REAL :: PL,THCON,TVCON,E1 - REAL :: DTHVDZ,DTHVM,VCONV,RZOL,RZOL2,RZOL10,ZOL2,ZOL10 - REAL :: DTG,DTTHX,DTHDZ,PSIT10,PSIQ,PSIQ2,PSIQ10 - REAL :: FLUXC,VSGD - REAL :: restar,VISC,DQG,OLDUST,OLDTST - REAL, PARAMETER :: psilim = -10. ! ONLY AFFECTS z/L > 2.0 -!------------------------------------------------------------------- - - DO I=its,ite - ! CONVERT GROUND & LOWEST LAYER TEMPERATURE TO POTENTIAL TEMPERATURE: - ! PSFC cmb - PSFC(I)=PSFCPA(I)/1000. - THGB(I)=TSK(I)*(100./PSFC(I))**ROVCP !(K) - ! PL cmb - PL=P1D(I)/1000. - THCON=(100./PL)**ROVCP - TH1D(I)=T1D(I)*THCON !(Theta, K) - TC1D(I)=T1D(I)-273.15 !(T, Celsius) - - ! CONVERT TO VIRTUAL TEMPERATURE - QVSH(I)=QV1D(I)/(1.+QV1D(I)) !CONVERT TO SPEC HUM (kg/kg) - TVCON=(1.+EP1*QVSH(I)) - THV1D(I)=TH1D(I)*TVCON !(K) - TV1D(I)=T1D(I)*TVCON !(K) - - !RHO1D(I)=PSFCPA(I)/(R*TV1D(I)) !now using value calculated in sfc driver - ZA(I)=0.5*dz8w1d(I) !height of first half-sigma level - ZA2(I)=dz8w1d(I) + 0.5*dz2w1d(I) !height of 2nd half-sigma level - GOVRTH(I)=G/TH1D(I) - ENDDO - - DO I=its,ite - IF (TSK(I) .LT. 273.15) THEN - !SATURATION VAPOR PRESSURE WRT ICE (SVP1=.6112; 10*mb) - E1=SVP1*EXP(4648*(1./273.15 - 1./TSK(I)) - & - & 11.64*LOG(273.15/TSK(I)) + 0.02265*(273.15 - TSK(I))) - ELSE - !SATURATION VAPOR PRESSURE WRT WATER (Bolton 1980) - E1=SVP1*EXP(SVP2*(TSK(I)-SVPT0)/(TSK(I)-SVP3)) - ENDIF - !FOR LAND POINTS, QSFC can come from LSM, ONLY RECOMPUTE OVER WATER - IF (xland(i).gt.1.5 .or. QSFC(i).le.0.0) THEN !WATER - QSFC(I)=EP2*E1/(PSFC(I)-ep_3*E1) !specific humidity - QSFCMR(I)=EP2*E1/(PSFC(I)-E1) !mixing ratio - ELSE !LAND - QSFCMR(I)=QSFC(I)/(1.-QSFC(I)) - ENDIF - - IF (TSK(I) .LT. 273.15) THEN - !SATURATION VAPOR PRESSURE WRT ICE - E1=SVP1*EXP(4648*(1./273.15 - 1./T1D(I)) - & - & 11.64*LOG(273.15/T1D(I)) + 0.02265*(273.15 - T1D(I))) - ELSE - !SATURATION VAPOR PRESSURE WRT WATER (Bolton 1980) - E1=SVP1*EXP(SVP2*(T1D(I)-SVPT0)/(T1D(I)-SVP3)) - ENDIF - PL=P1D(I)/1000. - CPM(I)=CP*(1.+0.84*QV1D(I)) - ENDDO - - DO I=its,ite - WSPD(I)=SQRT(U1D(I)*U1D(I)+V1D(I)*V1D(I)) - - !account for partial condensation - exner1=(p1d(I)/p1000mb)**ROVCP - sqc1=qc1d(I)/(1.+qc1d(I)) !lowest mod level cloud water spec hum - sqv1=QVSH(I) !lowest mod level water vapor spec hum - thl1=TH1D(I)-xlvcp/exner1*sqc1 - sqvg=qsfc(I) !sfc water vapor spec hum - sqcg=qcg(I)/(1.+qcg(I)) !sfc cloud water spec hum - - vv = thl1-THGB(I) - !TGS:ww = mavail(I)*(sqv1-sqvg) + (sqc1-sqcg) - ww = (sqv1-sqvg) + (sqc1-sqcg) - - !TGS:THVGB(I)=THGB(I)*(1.+EP1*QSFC(I)*MAVAIL(I)) - THVGB(I)=THGB(I)*(1.+EP1*QSFC(I)) - - DTHDZ=(TH1D(I)-THGB(I)) - DTHVDZ=(THV1D(I)-THVGB(I)) - !DTHVDZ= (vt1(i) + 1.0)*vv + (vq1(i) + tv0)*ww - - !-------------------------------------------------------- - ! Calculate the convective velocity scale (WSTAR) and - ! subgrid-scale velocity (VSGD) following Beljaars (1995, QJRMS) - ! and Mahrt and Sun (1995, MWR), respectively - !------------------------------------------------------- - ! Use Beljaars over land and water - fluxc = max(hfx(i)/RHO1D(i)/cp & - & + ep1*THVGB(I)*qfx(i)/RHO1D(i),0.) - WSTAR(I) = vconvc*(g/TSK(i)*pblh(i)*fluxc)**.33 - - !-------------------------------------------------------- - ! Mahrt and Sun low-res correction - ! (for 13 km ~ 0.37 m/s; for 3 km == 0 m/s) - !-------------------------------------------------------- - VSGD = 0.32 * (max(dx(i)/5000.-1.,0.))**.33 - WSPD(I)=SQRT(WSPD(I)*WSPD(I)+WSTAR(I)*WSTAR(I)+vsgd*vsgd) - WSPD(I)=MAX(WSPD(I),wmin) - - !-------------------------------------------------------- - ! CALCULATE THE BULK RICHARDSON NUMBER OF SURFACE LAYER, - ! ACCORDING TO AKB(1976), EQ(12). - !-------------------------------------------------------- - BR(I)=GOVRTH(I)*ZA(I)*DTHVDZ/(WSPD(I)*WSPD(I)) - !SET LIMITS ACCORDING TO Li et al. (2010) Boundary-Layer Meteorol (p.158) - BR(I)=MAX(BR(I),-20.0) - BR(I)=MIN(BR(I),2.0) - - ! IF PREVIOUSLY UNSTABLE, DO NOT LET INTO REGIMES 1 AND 2 (STABLE) - !if (itimestep .GT. 1) THEN - ! IF(MOL(I).LT.0.)BR(I)=MIN(BR(I),0.0) - !ENDIF - - !IF(I .eq. 2)THEN - ! write(*,1006)"BR:",BR(I)," fluxc:",fluxc," vt1:",vt1(i)," vq1:",vq1(i) - ! write(*,1007)"XLAND:",XLAND(I)," WSPD:",WSPD(I)," DTHVDZ:",DTHVDZ," WSTAR:",WSTAR(I) - !ENDIF - - ENDDO - - 1006 format(A,F7.3,A,f9.4,A,f9.5,A,f9.4) - 1007 format(A,F2.0,A,f6.2,A,f7.3,A,f7.2) - -!-------------------------------------------------------------------- -!-------------------------------------------------------------------- -!--- BEGIN ITERATION LOOP (ITMAX=5); USUALLY CONVERGES IN TWO PASSES -!-------------------------------------------------------------------- -!-------------------------------------------------------------------- - - DO I=its,ite - - ITER = 1 - DO WHILE (ITER .LE. ITMAX) - - !COMPUTE KINEMATIC VISCOSITY (m2/s) Andreas (1989) CRREL Rep. 89-11 - !valid between -173 and 277 degrees C. - VISC=1.326e-5*(1. + 6.542e-3*TC1D(I) + 8.301e-6*TC1D(I)*TC1D(I) & - - 4.84e-9*TC1D(I)*TC1D(I)*TC1D(I)) - - IF((XLAND(I)-1.5).GE.0)THEN - !-------------------------------------- - ! WATER - !-------------------------------------- - ! CALCULATE z0 (znt) - !-------------------------------------- - IF ( PRESENT(ISFTCFLX) ) THEN - IF ( ISFTCFLX .EQ. 0 ) THEN - IF (COARE_OPT .EQ. 3.0) THEN - !COARE 3.0 (MISLEADING SUBROUTINE NAME) - CALL charnock_1955(ZNT(i),UST(i),WSPD(i),visc,ZA(I)) - ELSE - !COARE 3.5 - CALL edson_etal_2013(ZNT(i),UST(i),WSPD(i),visc,ZA(I)) - ENDIF - ELSEIF ( ISFTCFLX .EQ. 1 .OR. ISFTCFLX .EQ. 2 ) THEN - CALL davis_etal_2008(ZNT(i),UST(i)) - ELSEIF ( ISFTCFLX .EQ. 3 ) THEN - CALL Taylor_Yelland_2001(ZNT(i),UST(i),WSPD(i)) - ELSEIF ( ISFTCFLX .EQ. 4 ) THEN - IF (COARE_OPT .EQ. 3.0) THEN - !COARE 3.0 (MISLEADING SUBROUTINE NAME) - CALL charnock_1955(ZNT(i),UST(i),WSPD(i),visc,ZA(I)) - ELSE - !COARE 3.5 - CALL edson_etal_2013(ZNT(i),UST(i),WSPD(i),visc,ZA(I)) - ENDIF - ENDIF - ELSE - !DEFAULT TO COARE 3.0/3.5 - IF (COARE_OPT .EQ. 3.0) THEN - !COARE 3.0 - CALL charnock_1955(ZNT(i),UST(i),WSPD(i),visc,ZA(I)) - ELSE - !COARE 3.5 - CALL edson_etal_2013(ZNT(i),UST(i),WSPD(i),visc,ZA(I)) - ENDIF - ENDIF - - ! add stochastic perturbaction of ZNT - if (spp_pbl==1) then - ZNTstoch(I) = MAX(ZNT(I) + 1.5 * ZNT(I) * rstoch1D(i), 1e-6) - else - ZNTstoch(I) = ZNT(I) - endif - - !COMPUTE ROUGHNESS REYNOLDS NUMBER (restar) USING NEW ZNT - ! AHW: Garrattt formula: Calculate roughness Reynolds number - ! Kinematic viscosity of air (linear approx to - ! temp dependence at sea level) - restar=MAX(ust(i)*ZNTstoch(i)/visc, 0.1) - - !-------------------------------------- - !CALCULATE z_t and z_q - !-------------------------------------- - IF ( PRESENT(ISFTCFLX) ) THEN - IF ( ISFTCFLX .EQ. 0 ) THEN - IF (COARE_OPT .EQ. 3.0) THEN - CALL fairall_etal_2003(z_t(i),z_q(i),restar,UST(i),visc) - ELSE - !presumably, this will be published soon, but hasn't yet - CALL fairall_etal_2014(z_t(i),z_q(i),restar,UST(i),visc,rstoch1D(i),spp_pbl) - ENDIF - ELSEIF ( ISFTCFLX .EQ. 1 ) THEN - IF (COARE_OPT .EQ. 3.0) THEN - CALL fairall_etal_2003(z_t(i),z_q(i),restar,UST(i),visc) - ELSE - CALL fairall_etal_2014(z_t(i),z_q(i),restar,UST(i),visc,rstoch1D(i),spp_pbl) - ENDIF - ELSEIF ( ISFTCFLX .EQ. 2 ) THEN - CALL garratt_1992(z_t(i),z_q(i),ZNTstoch(i),restar,XLAND(I)) - ELSEIF ( ISFTCFLX .EQ. 3 ) THEN - IF (COARE_OPT .EQ. 3.0) THEN - CALL fairall_etal_2003(z_t(i),z_q(i),restar,UST(i),visc) - ELSE - CALL fairall_etal_2014(z_t(i),z_q(i),restar,UST(i),visc,rstoch1D(i),spp_pbl) - ENDIF - ELSEIF ( ISFTCFLX .EQ. 4 ) THEN - CALL zilitinkevich_1995(ZNTstoch(i),z_t(i),z_q(i),restar,& - UST(I),KARMAN,XLAND(I),IZ0TLND,spp_pbl,rstoch1D(i)) - ENDIF - ELSE - !DEFAULT TO COARE 3.0/3.5 - IF (COARE_OPT .EQ. 3.0) THEN - CALL fairall_etal_2003(z_t(i),z_q(i),restar,UST(i),visc) - ELSE - CALL fairall_etal_2014(z_t(i),z_q(i),restar,UST(i),visc,rstoch1D(i),spp_pbl) - ENDIF - ENDIF - - ELSE - - ! add stochastic perturbaction of ZNT - if (spp_pbl==1) then - ZNTstoch(I) = MAX(ZNT(I) + 1.5 * ZNT(I) * rstoch1D(i), 1e-6) - else - ZNTstoch(I) = ZNT(I) - endif - - !-------------------------------------- - ! LAND - !-------------------------------------- - !COMPUTE ROUGHNESS REYNOLDS NUMBER (restar) USING DEFAULT ZNT - restar=MAX(ust(i)*ZNTstoch(i)/visc, 0.1) - - !-------------------------------------- - !GET z_t and z_q - !-------------------------------------- - !CHECK FOR SNOW/ICE POINTS OVER LAND - !IF ( ZNTSTOCH(i) .LE. SNOWZ0 .AND. TSK(I) .LE. 273.15 ) THEN - IF ( SNOWH(i) .GE. 0.1) THEN - CALL Andreas_2002(ZNTSTOCH(i),visc,ust(i),z_t(i),z_q(i)) - ELSE - IF ( PRESENT(IZ0TLND) ) THEN - IF ( IZ0TLND .LE. 1 .OR. IZ0TLND .EQ. 4) THEN - !IF IZ0TLND==4, THEN PSIQ WILL BE RECALCULATED USING - !PAN ET AL (1994), but PSIT FROM ZILI WILL BE USED. - CALL zilitinkevich_1995(ZNTSTOCH(i),z_t(i),z_q(i),restar,& - UST(I),KARMAN,XLAND(I),IZ0TLND,spp_pbl,rstoch1D(i)) - ELSEIF ( IZ0TLND .EQ. 2 ) THEN - CALL Yang_2008(ZNTSTOCH(i),z_t(i),z_q(i),UST(i),MOL(I),& - qstar(I),restar,visc,XLAND(I)) - ELSEIF ( IZ0TLND .EQ. 3 ) THEN - !Original MYNN in WRF-ARW used this form: - CALL garratt_1992(z_t(i),z_q(i),ZNTSTOCH(i),restar,XLAND(I)) - ENDIF - ELSE - !DEFAULT TO ZILITINKEVICH - CALL zilitinkevich_1995(ZNTSTOCH(i),z_t(i),z_q(i),restar,& - UST(I),KARMAN,XLAND(I),0,spp_pbl,rstoch1D(i)) - ENDIF - ENDIF - - ENDIF - zratio(i)=zntstoch(i)/z_t(i) - - !ADD RESISTANCE (SOMEWHAT FOLLOWING JIMENEZ ET AL. (2012)) TO PROTECT AGAINST - !EXCESSIVE FLUXES WHEN USING A LOW FIRST MODEL LEVEL (ZA < 10 m). - !Formerly: GZ1OZ0(I)= LOG(ZA(I)/ZNTstoch(I)) - GZ1OZ0(I)= LOG((ZA(I)+ZNTstoch(I))/ZNTstoch(I)) - GZ1OZt(I)= LOG((ZA(I)+z_t(i))/z_t(i)) - GZ2OZ0(I)= LOG((2.0+ZNTstoch(I))/ZNTstoch(I)) - GZ2OZt(I)= LOG((2.0+z_t(i))/z_t(i)) - GZ10OZ0(I)=LOG((10.+ZNTstoch(I))/ZNTstoch(I)) - GZ10OZt(I)=LOG((10.+z_t(i))/z_t(i)) - - !-------------------------------------------------------------------- - !--- DIAGNOSE BASIC PARAMETERS FOR THE APPROPRIATE STABILITY CLASS: - ! - ! THE STABILITY CLASSES ARE DETERMINED BY BR (BULK RICHARDSON NO.). - ! - ! CRITERIA FOR THE CLASSES ARE AS FOLLOWS: - ! - ! 1. BR .GE. 0.2; - ! REPRESENTS NIGHTTIME STABLE CONDITIONS (REGIME=1), - ! - ! 2. BR .LT. 0.2 .AND. BR .GT. 0.0; - ! REPRESENTS DAMPED MECHANICAL TURBULENT CONDITIONS - ! (REGIME=2), - ! - ! 3. BR .EQ. 0.0 - ! REPRESENTS FORCED CONVECTION CONDITIONS (REGIME=3), - ! - ! 4. BR .LT. 0.0 - ! REPRESENTS FREE CONVECTION CONDITIONS (REGIME=4). - ! - !-------------------------------------------------------------------- - IF (BR(I) .GT. 0.0) THEN - IF (BR(I) .GT. 0.2) THEN - !---CLASS 1; STABLE (NIGHTTIME) CONDITIONS: - REGIME(I)=1. - ELSE - !---CLASS 2; DAMPED MECHANICAL TURBULENCE: - REGIME(I)=2. - ENDIF - - !COMPUTE z/L - !CALL Li_etal_2010(ZOL(I),BR(I),ZA(I)/ZNTstoch(I),zratio(I)) -! IF (ITER .EQ. 1 .AND. itimestep .LE. 1) THEN - CALL Li_etal_2010(ZOL(I),BR(I),ZA(I)/ZNTstoch(I),zratio(I)) -! ELSE -! ZOL(I)=ZA(I)*KARMAN*G*MOL(I)/(TH1D(I)*MAX(UST(I)*UST(I),0.0001)) -! ZOL(I)=MAX(ZOL(I),0.0) -! ZOL(I)=MIN(ZOL(I),2.) -! ENDIF - - !COMPUTE PSIM and PSIH - IF((XLAND(I)-1.5).GE.0)THEN - ! WATER - !CALL PSI_Suselj_Sood_2010(PSIM(I),PSIH(I),ZOL(I)) - !CALL PSI_Beljaars_Holtslag_1991(PSIM(I),PSIH(I),ZOL(I)) - !CALL PSI_Businger_1971(PSIM(I),PSIH(I),ZOL(I)) - CALL PSI_DyerHicks(PSIM(I),PSIH(I),ZOL(I),z_t(I),ZNTstoch(I),ZA(I)) - ELSE - ! LAND - !CALL PSI_Beljaars_Holtslag_1991(PSIM(I),PSIH(I),ZOL(I)) - !CALL PSI_Businger_1971(PSIM(I),PSIH(I),ZOL(I)) - !CALL PSI_Zilitinkevich_Esau_2007(PSIM(I),PSIH(I),ZOL(I)) - CALL PSI_DyerHicks(PSIM(I),PSIH(I),ZOL(I),z_t(I),ZNTstoch(I),ZA(I)) - ENDIF - - ! LOWER LIMIT ON PSI IN STABLE CONDITIONS - PSIM(I)=MAX(PSIM(I),psilim) - PSIH(I)=MAX(PSIH(I),psilim) - PSIM10(I)=MAX(10./ZA(I)*PSIM(I), psilim) - PSIH10(I)=MAX(10./ZA(I)*PSIH(I), psilim) - PSIM2(I)=MAX(2./ZA(I)*PSIM(I), psilim) - PSIH2(I)=MAX(2./ZA(I)*PSIH(I), psilim) - ! 1.0 over Monin-Obukhov length - RMOL(I)= ZOL(I)/ZA(I) - - ELSEIF(BR(I) .EQ. 0.) THEN - !========================================================= - !-----CLASS 3; FORCED CONVECTION/NEUTRAL: - !========================================================= - REGIME(I)=3. - - PSIM(I)=0.0 - PSIH(I)=PSIM(I) - PSIM10(I)=0. - PSIH10(I)=PSIM10(I) - PSIM2(I)=0. - PSIH2(I)=PSIM2(I) - - !ZOL(I)=0. - IF(UST(I) .LT. 0.01)THEN - ZOL(I)=BR(I)*GZ1OZ0(I) - ELSE - ZOL(I)=KARMAN*GOVRTH(I)*ZA(I)*MOL(I)/(MAX(UST(I)*UST(I),0.001)) - ENDIF - RMOL(I) = ZOL(I)/ZA(I) - - ELSEIF(BR(I) .LT. 0.)THEN - !========================================================== - !-----CLASS 4; FREE CONVECTION: - !========================================================== - REGIME(I)=4. - - !COMPUTE z/L - !CALL Li_etal_2010(ZOL(I),BR(I),ZA(I)/ZNTstoch(I),zratio(I)) - !IF (ITER .EQ. 1 .AND. itimestep .LE. 1) THEN - CALL Li_etal_2010(ZOL(I),BR(I),ZA(I)/ZNTstoch(I),zratio(I)) - !ELSE - ! ZOL(I)=ZA(I)*KARMAN*G*MOL(I)/(TH1D(I)*MAX(UST(I)*UST(I),0.001)) - ! ZOL(I)=MAX(ZOL(I),-19.999) - ! ZOL(I)=MIN(ZOL(I),0.0) - !ENDIF - - ZOL10=10./ZA(I)*ZOL(I) - ZOL2=2./ZA(I)*ZOL(I) - ZOL(I)=MIN(ZOL(I),0.) - ZOL(I)=MAX(ZOL(I),-19.9999) - ZOL10=MIN(ZOL10,0.) - ZOL10=MAX(ZOL10,-19.9999) - ZOL2=MIN(ZOL2,0.) - ZOL2=MAX(ZOL2,-19.9999) - NZOL=INT(-ZOL(I)*100.) - RZOL=-ZOL(I)*100.-NZOL - NZOL10=INT(-ZOL10*100.) - RZOL10=-ZOL10*100.-NZOL10 - NZOL2=INT(-ZOL2*100.) - RZOL2=-ZOL2*100.-NZOL2 - - !COMPUTE PSIM and PSIH - IF((XLAND(I)-1.5).GE.0)THEN - ! WATER - !CALL PSI_Suselj_Sood_2010(PSIM(I),PSIH(I),ZOL(I)) - !CALL PSI_Hogstrom_1996(PSIM(I),PSIH(I),ZOL(I), z_t(I), ZNTstoch(I), ZA(I)) - !CALL PSI_Businger_1971(PSIM(I),PSIH(I),ZOL(I)) - CALL PSI_DyerHicks(PSIM(I),PSIH(I),ZOL(I),z_t(I),ZNTstoch(I),ZA(I)) - ELSE - ! LAND - !CALL PSI_Hogstrom_1996(PSIM(I),PSIH(I),ZOL(I), z_t(I), ZNTstoch(I), ZA(I)) - !CALL PSI_Businger_1971(PSIM(I),PSIH(I),ZOL(I)) - CALL PSI_DyerHicks(PSIM(I),PSIH(I),ZOL(I),z_t(I),ZNTstoch(I),ZA(I)) - ENDIF - - PSIM10(I)=10./ZA(I)*PSIM(I) - PSIH10(I)=10./ZA(I)*PSIH(I) - PSIM2(I)=2./ZA(I)*PSIM(I) - PSIH2(I)=2./ZA(I)*PSIH(I) - - !---LIMIT PSIH AND PSIM IN THE CASE OF THIN LAYERS AND - !---HIGH ROUGHNESS. THIS PREVENTS DENOMINATOR IN FLUXES - !---FROM GETTING TOO SMALL - !PSIH(I)=MIN(PSIH(I),0.9*GZ1OZt(I)) !JOE: less restricitive over forest/urban. - PSIH(I)=MIN(PSIH(I),0.9*GZ1OZ0(I)) - PSIM(I)=MIN(PSIM(I),0.9*GZ1OZ0(I)) - !PSIH2(I)=MIN(PSIH2(I),0.9*GZ2OZt(I)) !JOE: less restricitive over forest/urban. - PSIH2(I)=MIN(PSIH2(I),0.9*GZ2OZ0(I)) - PSIM2(I)=MIN(PSIM2(I),0.9*GZ2OZ0(I)) - PSIM10(I)=MIN(PSIM10(I),0.9*GZ10OZ0(I)) - PSIH10(I)=MIN(PSIH10(I),0.9*GZ10OZ0(I)) - - RMOL(I) = ZOL(I)/ZA(I) - - ENDIF - - !------------------------------------------------------------ - !-----COMPUTE THE FRICTIONAL VELOCITY: - !------------------------------------------------------------ - ! ZA(1982) EQS(2.60),(2.61). - PSIX(I)=GZ1OZ0(I)-PSIM(I) - PSIX10(I)=GZ10OZ0(I)-PSIM10(I) - ! TO PREVENT OSCILLATIONS AVERAGE WITH OLD VALUE - OLDUST = UST(I) - UST(I)=0.5*UST(I)+0.5*KARMAN*WSPD(I)/PSIX(I) - !NON-AVERAGED: UST(I)=KARMAN*WSPD(I)/PSIX(I) - - ! Compute u* without vconv for use in HFX calc when isftcflx > 0 - WSPDI(I)=MAX(SQRT(U1D(I)*U1D(I)+V1D(I)*V1D(I)), wmin) - IF ( PRESENT(USTM) ) THEN - USTM(I)=0.5*USTM(I)+0.5*KARMAN*WSPDI(I)/PSIX(I) - ENDIF - - IF ((XLAND(I)-1.5).LT.0.) THEN !LAND - UST(I)=MAX(UST(I),0.005) !Further relaxing this limit - no need to go lower - !Keep ustm = ust over land. - IF ( PRESENT(USTM) ) USTM(I)=UST(I) - ENDIF - - !------------------------------------------------------------ - !-----COMPUTE THE THERMAL AND MOISTURE RESISTANCE (PSIQ AND PSIT): - !------------------------------------------------------------ - ! LOWER LIMIT ADDED TO PREVENT LARGE FLHC IN SOIL MODEL - ! ACTIVATES IN UNSTABLE CONDITIONS WITH THIN LAYERS OR HIGH Z0 - GZ1OZt(I)= LOG((ZA(I)+z_t(i))/z_t(i)) - GZ2OZt(I)= LOG((2.0+z_t(i))/z_t(i)) - - PSIT(I) =MAX(GZ1OZt(I)-PSIH(I) ,1.) - PSIT2(I)=MAX(GZ2OZt(I)-PSIH2(I),1.) - resist(I)=PSIT(I) - logres(I)=GZ1OZt(I) - - PSIQ=MAX(LOG((ZA(I)+z_q(i))/z_q(I))-PSIH(I) ,1.0) - PSIQ2=MAX(LOG((2.0+z_q(i))/z_q(I))-PSIH2(I) ,1.0) - - IF((XLAND(I)-1.5).LT.0)THEN !Land only - IF ( IZ0TLND .EQ. 4 ) THEN - CALL Pan_etal_1994(PSIQ,PSIQ2,UST(I),PSIH(I),PSIH2(I),& - & KARMAN,ZA(I)) - ENDIF - ENDIF - - !---------------------------------------------------- - !COMPUTE THE TEMPERATURE SCALE (or FRICTION TEMPERATURE, T*) - !---------------------------------------------------- - !DTG=TH1D(I)-THGB(I) !SWITCH TO THETA-V - DTG=THV1D(I)-THVGB(I) - OLDTST=MOL(I) - MOL(I)=KARMAN*DTG/PSIT(I)/PRT - !t_star(I) = -HFX(I)/(UST(I)*CPM(I)*RHO1D(I)) - !t_star(I) = MOL(I) - !---------------------------------------------------- - !COMPUTE THE MOISTURE SCALE (or q*) - DQG=(QVSH(i)-qsfc(i))*1000. !(kg/kg -> g/kg) - qstar(I)=KARMAN*DQG/PSIQ/PRT - - !CHECK FOR CONVERGENCE - IF (ITER .GE. 2) THEN - !IF (ABS(OLDUST-UST(I)) .lt. 0.01) THEN - IF (ABS(OLDTST-MOL(I)) .lt. 0.01) THEN - ITER = ITER+ITMAX - ENDIF - - !IF () THEN - ! print*,"ITER:",ITER - ! write(*,1001)"REGIME:",REGIME(I)," z/L:",ZOL(I)," U*:",UST(I)," Tstar:",MOL(I) - ! write(*,1002)"PSIM:",PSIM(I)," PSIH:",PSIH(I)," W*:",WSTAR(I)," DTHV:",THV1D(I)-THVGB(I) - ! write(*,1003)"CPM:",CPM(I)," RHO1D:",RHO1D(I)," L:",ZOL(I)/ZA(I)," DTH:",TH1D(I)-THGB(I) - ! write(*,1004)"Z0/Zt:",zratio(I)," Z0:",ZNTstoch(I)," Zt:",z_t(I)," za:",za(I) - ! write(*,1005)"Re:",restar," MAVAIL:",MAVAIL(I)," QSFC(I):",QSFC(I)," QVSH(I):",QVSH(I) - ! print*,"VISC=",VISC," Z0:",ZNTstoch(I)," T1D(i):",T1D(i) - ! write(*,*)"=============================================" - !ENDIF - ENDIF - - ITER = ITER + 1 - - ENDDO ! end ITERATION-loop - - ENDDO ! end i-loop - - 1000 format(A,F6.1, A,f6.1, A,f5.1, A,f7.1) - 1001 format(A,F2.0, A,f10.4,A,f5.3, A,f11.5) - 1002 format(A,f7.2, A,f7.2, A,f7.2, A,f10.3) - 1003 format(A,f7.2, A,f7.2, A,f10.3,A,f10.3) - 1004 format(A,f11.3,A,f9.7, A,f9.7, A,f6.2, A,f10.3) - 1005 format(A,f9.2,A,f6.4,A,f7.4,A,f7.4) - - !---------------------------------------------------------- - ! COMPUTE SURFACE HEAT AND MOISTURE FLUXES - !---------------------------------------------------------- - DO I=its,ite - - !For computing the diagnostics and fluxes (below), whether the fluxes - !are turned off or on, we need the following: - PSIX(I)=GZ1OZ0(I)-PSIM(I) - PSIX10(I)=GZ10OZ0(I)-PSIM10(I) - - PSIT(I) =MAX(GZ1OZt(I)-PSIH(I), 1.0) - PSIT2(I)=MAX(GZ2OZt(I)-PSIH2(I),1.0) - PSIT10=MAX(GZ10OZ0(I)-PSIH10(I), 1.0) - - PSIQ=MAX(LOG((ZA(I)+z_q(i))/z_q(I))-PSIH(I) ,1.0) - PSIQ2=MAX(LOG((2.0+z_q(i))/z_q(I))-PSIH2(I) ,1.0) - PSIQ10=MAX(GZ10OZ0(I)-PSIH10(I),1.0) - - IF (ISFFLX .LT. 1) THEN - - QFX(i) = 0. - HFX(i) = 0. - FLHC(I) = 0. - FLQC(I) = 0. - LH(I) = 0. - CHS(I) = 0. - CH(I) = 0. - CHS2(i) = 0. - CQS2(i) = 0. - IF(PRESENT(ck) .and. PRESENT(cd) .and. & - &PRESENT(cka) .and. PRESENT(cda)) THEN - Ck(I) = 0. - Cd(I) = 0. - Cka(I)= 0. - Cda(I)= 0. - ENDIF - ELSE - - IF((XLAND(I)-1.5).LT.0)THEN !LAND Only - IF ( IZ0TLND .EQ. 4 ) THEN - CALL Pan_etal_1994(PSIQ,PSIQ2,UST(I),PSIH(I),PSIH2(I),& - & KARMAN,ZA(I)) - ENDIF - ENDIF - - !------------------------------------------ - ! CALCULATE THE EXCHANGE COEFFICIENTS FOR HEAT (FLHC) - ! AND MOISTURE (FLQC) - !------------------------------------------ - FLQC(I)=RHO1D(I)*MAVAIL(I)*UST(I)*KARMAN/PSIQ - FLHC(I)=RHO1D(I)*CPM(I)*UST(I)*KARMAN/PSIT(I) - !OLD WAY: - !DTTHX=ABS(TH1D(I)-THGB(I)) - !IF(DTTHX.GT.1.E-5)THEN - ! FLHC(I)=CPM(I)*RHO1D(I)*UST(I)*MOL(I)/(TH1D(I)-THGB(I)) - !ELSE - ! FLHC(I)=0. - !ENDIF - - !---------------------------------- - ! COMPUTE SURFACE MOISTURE FLUX: - !---------------------------------- - QFX(I)=FLQC(I)*(QSFCMR(I)-QV1D(I)) - !JOE: QFX(I)=MAX(QFX(I),0.) !originally did not allow neg QFX - QFX(I)=MAX(QFX(I),-0.02) !allows small neg QFX, like MYJ - LH(I)=XLV*QFX(I) - - !---------------------------------- - ! COMPUTE SURFACE HEAT FLUX: - !---------------------------------- - IF(XLAND(I)-1.5.GT.0.)THEN !WATER - HFX(I)=FLHC(I)*(THGB(I)-TH1D(I)) - IF ( PRESENT(ISFTCFLX) ) THEN - IF ( ISFTCFLX.NE.0 ) THEN - ! AHW: add dissipative heating term - HFX(I)=HFX(I)+RHO1D(I)*USTM(I)*USTM(I)*WSPDI(I) - ENDIF - ENDIF - ELSEIF(XLAND(I)-1.5.LT.0.)THEN !LAND - HFX(I)=FLHC(I)*(THGB(I)-TH1D(I)) - HFX(I)=MAX(HFX(I),-250.) - ENDIF - - !CHS(I)=UST(I)*KARMAN/(ALOG(KARMAN*UST(I)*ZA(I) & - ! /XKA+ZA(I)/ZL)-PSIH(I)) - - CHS(I)=UST(I)*KARMAN/PSIT(I) - - ! The exchange coefficient for cloud water is assumed to be the - ! same as that for heat. CH is multiplied by WSPD. - - !ch(i)=chs(i) - ch(i)=flhc(i)/( cpm(i)*RHO1D(i) ) - - !THESE ARE USED FOR 2-M DIAGNOSTICS ONLY - CQS2(I)=UST(I)*KARMAN/PSIQ2 - CHS2(I)=UST(I)*KARMAN/PSIT2(I) - - IF(PRESENT(ck) .and. PRESENT(cd) .and. & - &PRESENT(cka) .and. PRESENT(cda)) THEN - Ck(I)=(karman/psix10(I))*(karman/psiq10) - Cd(I)=(karman/psix10(I))*(karman/psix10(I)) - Cka(I)=(karman/psix(I))*(karman/psiq) - Cda(I)=(karman/psix(I))*(karman/psix(I)) - ENDIF - - ENDIF !end ISFFLX option - - !----------------------------------------------------- - !COMPUTE DIAGNOSTICS - !----------------------------------------------------- - !COMPUTE 10 M WNDS - !----------------------------------------------------- - ! If the lowest model level is close to 10-m, use it - ! instead of the flux-based diagnostic formula. - if (ZA(i) .le. 7.0) then - ! high vertical resolution - if(ZA2(i) .gt. 7.0 .and. ZA2(i) .lt. 13.0) then - !use 2nd model level - U10(I)=U1D2(I) - V10(I)=V1D2(I) - else - U10(I)=U1D(I)*log(10./ZNTstoch(I))/log(ZA(I)/ZNTstoch(I)) - V10(I)=V1D(I)*log(10./ZNTstoch(I))/log(ZA(I)/ZNTstoch(I)) - endif - elseif(ZA(i) .gt. 7.0 .and. ZA(i) .lt. 13.0) then - !moderate vertical resolution - !U10(I)=U1D(I)*PSIX10(I)/PSIX(I) - !V10(I)=V1D(I)*PSIX10(I)/PSIX(I) - !use neutral-log: - U10(I)=U1D(I)*log(10./ZNTstoch(I))/log(ZA(I)/ZNTstoch(I)) - V10(I)=V1D(I)*log(10./ZNTstoch(I))/log(ZA(I)/ZNTstoch(I)) - else - ! very coarse vertical resolution - U10(I)=U1D(I)*PSIX10(I)/PSIX(I) - V10(I)=V1D(I)*PSIX10(I)/PSIX(I) - endif - - !----------------------------------------------------- - !COMPUTE 2m T, TH, AND Q - !THESE WILL BE OVERWRITTEN FOR LAND POINTS IN THE LSM - !----------------------------------------------------- - DTG=TH1D(I)-THGB(I) - TH2(I)=THGB(I)+DTG*PSIT2(I)/PSIT(I) - !*** BE CERTAIN THAT THE 2-M THETA IS BRACKETED BY - !*** THE VALUES AT THE SURFACE AND LOWEST MODEL LEVEL. - IF ((TH1D(I)>THGB(I) .AND. (TH2(I)TH1D(I))) .OR. & - (TH1D(I)THGB(I) .OR. TH2(I)QSFCMR(I) .AND. (Q2(I)QV1D(I))) .OR. & - (QV1D(I)QSFCMR(I) .OR. Q2(I) 1200. .OR. HFX(I) < -700.)THEN - print*,"SUSPICIOUS VALUES IN MYNN SFCLAYER",& - ITER-ITMAX," ITERATIONS",I,J, "HFX: ",HFX(I) - yesno = 1 - ENDIF - IF (LH(I) > 1200. .OR. LH(I) < -700.)THEN - print*,"SUSPICIOUS VALUES IN MYNN SFCLAYER",& - ITER-ITMAX," ITERATIONS",I,J, "LH: ",LH(I) - yesno = 1 - ENDIF - IF (UST(I) < 0.0 .OR. UST(I) > 4.0 )THEN - print*,"SUSPICIOUS VALUES IN MYNN SFCLAYER",& - ITER-ITMAX," ITERATIONS",I,J, "UST: ",UST(I) - yesno = 1 - ENDIF - IF (WSTAR(I)<0.0 .OR. WSTAR(I) > 6.0)THEN - print*,"SUSPICIOUS VALUES IN MYNN SFCLAYER",& - ITER-ITMAX," ITERATIONS",I,J, "WSTAR: ",WSTAR(I) - yesno = 1 - ENDIF - IF (RHO1D(I)<0.0 .OR. RHO1D(I) > 1.6 )THEN - print*,"SUSPICIOUS VALUES IN MYNN SFCLAYER",& - ITER-ITMAX," ITERATIONS",I,J, "rho: ",RHO1D(I) - yesno = 1 - ENDIF - IF (QSFC(I)*1000. <0.0 .OR. QSFC(I)*1000. >40.)THEN - print*,"SUSPICIOUS VALUES IN MYNN SFCLAYER",& - ITER-ITMAX," ITERATIONS",I,J, "QSFC: ",QSFC(I) - yesno = 1 - ENDIF - IF (PBLH(I)<0. .OR. PBLH(I)>6000.)THEN - print*,"SUSPICIOUS VALUES IN MYNN SFCLAYER",& - ITER-ITMAX," ITERATIONS",I,J, "PBLH: ",PBLH(I) - yesno = 1 - ENDIF - - IF (yesno == 1) THEN - print*," OTHER INFO:" - write(*,1001)"REGIME:",REGIME(I)," z/L:",ZOL(I)," U*:",UST(I),& - " Tstar:",MOL(I) - write(*,1002)"PSIM:",PSIM(I)," PSIH:",PSIH(I)," W*:",WSTAR(I),& - " DTHV:",THV1D(I)-THVGB(I) - write(*,1003)"CPM:",CPM(I)," RHO1D:",RHO1D(I)," L:",& - ZOL(I)/ZA(I)," DTH:",TH1D(I)-THGB(I) - write(*,1004)"Z0/Zt:",zratio(I)," Z0:",ZNTstoch(I)," Zt:",z_t(I),& - " za:",za(I) - write(*,1005)"Re:",restar," MAVAIL:",MAVAIL(I)," QSFC(I):",& - QSFC(I)," QVSH(I):",QVSH(I) - print*,"PSIX=",PSIX(I)," Z0:",ZNTstoch(I)," T1D(i):",T1D(i) - write(*,*)"=============================================" - ENDIF - ENDIF - - ENDDO !end i-loop - -END SUBROUTINE SFCLAY1D_mynn -!------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!> This subroutine returns the thermal and moisture roughness lengths -!! from Zilitinkevich (1995) and Zilitinkevich et al. (2001) over -!! land and water, respectively. -!! -!! MODS: -!! 20120705 : added IZ0TLND option. Note: This option was designed -!! to work with the Noah LSM and may be specific for that -!! LSM only. Tests with RUC LSM showed no improvements. - SUBROUTINE zilitinkevich_1995(Z_0,Zt,Zq,restar,ustar,KARMAN,& - & landsea,IZ0TLND2,spp_pbl,rstoch) - - IMPLICIT NONE - REAL, INTENT(IN) :: Z_0,restar,ustar,KARMAN,landsea - INTEGER, OPTIONAL, INTENT(IN):: IZ0TLND2 - REAL, INTENT(OUT) :: Zt,Zq - REAL :: CZIL !=0.100 in Chen et al. (1997) - !=0.075 in Zilitinkevich (1995) - !=0.500 in Lemone et al. (2008) - INTEGER, INTENT(IN) :: spp_pbl - REAL, INTENT(IN) :: rstoch - - - IF (landsea-1.5 .GT. 0) THEN !WATER - - !THIS IS BASED ON Zilitinkevich, Grachev, and Fairall (2001; - !Their equations 15 and 16). - IF (restar .LT. 0.1) THEN - Zt = Z_0*EXP(KARMAN*2.0) - Zt = MIN( Zt, 6.0e-5) - Zt = MAX( Zt, 2.0e-9) - Zq = Z_0*EXP(KARMAN*3.0) - Zq = MIN( Zq, 6.0e-5) - Zq = MAX( Zq, 2.0e-9) - ELSE - Zt = Z_0*EXP(-KARMAN*(4.0*SQRT(restar)-3.2)) - Zt = MIN( Zt, 6.0e-5) - Zt = MAX( Zt, 2.0e-9) - Zq = Z_0*EXP(-KARMAN*(4.0*SQRT(restar)-4.2)) - Zq = MIN( Zt, 6.0e-5) - Zq = MAX( Zt, 2.0e-9) - ENDIF - - ELSE !LAND - - !Option to modify CZIL according to Chen & Zhang, 2009 - IF ( IZ0TLND2 .EQ. 1 ) THEN - CZIL = 10.0 ** ( -0.40 * ( Z_0 / 0.07 ) ) - ELSE - CZIL = 0.075 !0.10 - END IF - - Zt = Z_0*EXP(-KARMAN*CZIL*SQRT(restar)) - Zt = MIN( Zt, Z_0/2.) - - Zq = Z_0*EXP(-KARMAN*CZIL*SQRT(restar)) - Zq = MIN( Zq, Z_0/2.) - -! perturb thermal and moisture roughness lenth by +/-50% -! uses same perturbation pattern for perturbing cloud fraction -! and turbulent mixing length (module_sf_mynn.F), but -! twice the amplitude; -! multiplication with -1.0 anticorrelates patterns - if (spp_pbl==1) then - Zt = Zt + Zt * 2.0 * rstoch - Zt = MAX(Zt, 0.001) - Zq = Zt - endif - - ENDIF - - return - - END SUBROUTINE zilitinkevich_1995 -!-------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!! This subroutine returns the resistance (PSIQ) for moisture -!! exchange. This is a modified form originating from Pan et al.. -!! (1994) but modified according to tests in both the RUC model. -!! and WRF-ARW. Note that it is very similar to Carlson and -!! Boland (1978) model (include below in comments) but has an -!! extra molecular layer (a third layer) instead of two layers. - SUBROUTINE Pan_etal_1994(PSIQ,PSIQ2,ustar,psih,psih2,KARMAN,Z1) - - IMPLICIT NONE - REAL, INTENT(IN) :: Z1,ustar,KARMAN,psih,psih2 - REAL, INTENT(OUT) :: psiq,psiq2 - REAL, PARAMETER :: Cpan=1.0 !was 20.8 in Pan et al 1994 - REAL, PARAMETER :: ZL=0.01 - REAL, PARAMETER :: ZMUs=0.2E-3 - REAL, PARAMETER :: XKA = 2.4E-5 - - !PAN et al. (1994): 3-layer model, as in paper: - !ZMU = Cpan*XKA/(KARMAN*UST(I)) - !PSIQ =MAX(KARMAN*ustar*ZMU/XKA + LOG((KARMAN*ustar*ZL + XKA)/XKA + & - ! & Z1/ZL) - PSIH,2.0) - !PSIQ2=MAX(KARMAN*ustar*ZMU/XKA + LOG((KARMAN*ustar*ZL + XKA)/XKA + & - ! & 2./ZL) - PSIH2,2.0) - !MODIFIED FORM: - PSIQ =MAX(KARMAN*ustar*ZMUs/XKA + LOG((KARMAN*ustar*Z1)/XKA + & - & Z1/ZL) - PSIH,2.0) - PSIQ2=MAX(KARMAN*ustar*ZMUs/XKA + LOG((KARMAN*ustar*2.0)/XKA + & - & 2./ZL) - PSIH2,2.0) - - !CARLSON AND BOLAND (1978): 2-layer model - !PSIQ =MAX(LOG(KARMAN*ustar*Z1/XKA + Z1/ZL)-PSIH ,2.0) - !PSIQ2=MAX(LOG(KARMAN*ustar*2./XKA + 2./ZL)-PSIH2 ,2.0) - - END SUBROUTINE Pan_etal_1994 -!-------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!! This formulation for roughness length was designed to match. -!! the labratory experiments of Donelan et al. (2004). -!! This is an update version from Davis et al. 2008, which -!! corrects a small-bias in Z_0 (AHW real-time 2012). - SUBROUTINE davis_etal_2008(Z_0,ustar) - - IMPLICIT NONE - REAL, INTENT(IN) :: ustar - REAL, INTENT(OUT) :: Z_0 - REAL :: ZW, ZN1, ZN2 - REAL, PARAMETER :: G=9.81, OZO=1.59E-5 - - !OLD FORM: Z_0 = 10.*EXP(-10./(ustar**(1./3.))) - !NEW FORM: - - ZW = MIN((ustar/1.06)**(0.3),1.0) - ZN1 = 0.011*ustar*ustar/G + OZO - ZN2 = 10.*exp(-9.5*ustar**(-.3333)) + & - 0.11*1.5E-5/AMAX1(ustar,0.01) - Z_0 = (1.0-ZW) * ZN1 + ZW * ZN2 - - Z_0 = MAX( Z_0, 1.27e-7) !These max/mins were suggested by - Z_0 = MIN( Z_0, 2.85e-3) !Davis et al. (2008) - - return - - END SUBROUTINE davis_etal_2008 -!-------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!>This formulation for roughness length was designed account for. -!!wave steepness. - SUBROUTINE Taylor_Yelland_2001(Z_0,ustar,wsp10) - - IMPLICIT NONE - REAL, INTENT(IN) :: ustar,wsp10 - REAL, INTENT(OUT) :: Z_0 - REAL, parameter :: g=9.81, pi=3.14159265 - REAL :: hs, Tp, Lp - - !hs is the significant wave height - hs = 0.0248*(wsp10**2.) - !Tp dominant wave period - Tp = 0.729*MAX(wsp10,0.1) - !Lp is the wavelength of the dominant wave - Lp = g*Tp**2/(2*pi) - - Z_0 = 1200.*hs*(hs/Lp)**4.5 - Z_0 = MAX( Z_0, 1.27e-7) !These max/mins were suggested by - Z_0 = MIN( Z_0, 2.85e-3) !Davis et al. (2008) - - return - - END SUBROUTINE Taylor_Yelland_2001 -!-------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!>This version of Charnock's relation employs a varying -!! Charnock parameter, similar to COARE3.0 [Fairall et al. (2003)]. -!! The Charnock parameter CZC is varied from .011 to .018. -!! between 10-m wsp = 10 and 18.. - SUBROUTINE charnock_1955(Z_0,ustar,wsp10,visc,zu) - - IMPLICIT NONE - REAL, INTENT(IN) :: ustar, visc, wsp10, zu - REAL, INTENT(OUT) :: Z_0 - REAL, PARAMETER :: G=9.81, CZO2=0.011 - REAL :: CZC !variable charnock "constant" - REAL :: wsp10m ! logarithmically calculated 10 m - - wsp10m = wsp10*log(10./1e-4)/log(zu/1e-4) - CZC = CZO2 + 0.007*MIN(MAX((wsp10m-10.)/8., 0.), 1.0) - - Z_0 = CZC*ustar*ustar/G + (0.11*visc/MAX(ustar,0.05)) - Z_0 = MAX( Z_0, 1.27e-7) !These max/mins were suggested by - Z_0 = MIN( Z_0, 2.85e-3) !Davis et al. (2008) - - return - - END SUBROUTINE charnock_1955 -!-------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!> This version of Charnock's relation employs a varying -!!Charnock parameter, taken from COARE 3.5 [Edson et al. (2001, JPO)]. -!!The Charnock parameter CZC is varied from about .005 to .028 -!!between 10-m wind speeds of 6 and 19 m/s. - SUBROUTINE edson_etal_2013(Z_0,ustar,wsp10,visc,zu) - - IMPLICIT NONE - REAL, INTENT(IN) :: ustar, visc, wsp10, zu - REAL, INTENT(OUT) :: Z_0 - REAL, PARAMETER :: G=9.81 - REAL, PARAMETER :: m=0.017, b=-0.005 - REAL :: CZC ! variable charnock "constant" - REAL :: wsp10m ! logarithmically calculated 10 m - - wsp10m = wsp10*log(10/1e-4)/log(zu/1e-4) - wsp10m = MIN(19., wsp10m) - CZC = m*wsp10m + b - CZC = MAX(CZC, 0.0) - - Z_0 = CZC*ustar*ustar/G + (0.11*visc/MAX(ustar,0.07)) - Z_0 = MAX( Z_0, 1.27e-7) !These max/mins were suggested by - Z_0 = MIN( Z_0, 2.85e-3) !Davis et al. (2008) - - return - - END SUBROUTINE edson_etal_2013 -!-------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!> This formulation for the thermal and moisture roughness lengths -!! (Zt and Zq) relates them to Z0 via the roughness Reynolds number (Ren). -!!This formula comes from Fairall et al. (2003). It is modified from -!!the original Garratt-Brutsaert model to better fit the COARE/HEXMAX -!!data. The formula for land uses a constant ratio (Z_0/7.4) taken -!!from Garratt (1992). - SUBROUTINE garratt_1992(Zt,Zq,Z_0,Ren,landsea) - - IMPLICIT NONE - REAL, INTENT(IN) :: Ren, Z_0,landsea - REAL, INTENT(OUT) :: Zt,Zq - REAL :: Rq - REAL, PARAMETER :: e=2.71828183 - - IF (landsea-1.5 .GT. 0) THEN !WATER - - Zt = Z_0*EXP(2.0 - (2.48*(Ren**0.25))) - Zq = Z_0*EXP(2.0 - (2.28*(Ren**0.25))) - - Zq = MIN( Zq, 5.5e-5) - Zq = MAX( Zq, 2.0e-9) - Zt = MIN( Zt, 5.5e-5) - Zt = MAX( Zt, 2.0e-9) !same lower limit as ECMWF - ELSE !LAND - Zq = Z_0/(e**2.) !taken from Garratt (1980,1992) - Zt = Zq - ENDIF - - return - - END SUBROUTINE garratt_1992 -!-------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!>This formulation for thermal and moisture roughness length (Zt and Zq) -!! as a function of the roughness Reynolds number (Ren) comes from the -!! COARE3.0 formulation, empirically derived from COARE and HEXMAX data -!! [Fairall et al. (2003)]. Edson et al. (2004; JGR) suspected that this -!!relationship overestimated the scalar roughness lengths for low Reynolds -!!number flows, so an optional smooth flow relationship, taken from Garratt -!!(1992, p. 102), is available for flows with Ren < 2. -!! -!!This is for use over water only. - SUBROUTINE fairall_etal_2003(Zt,Zq,Ren,ustar,visc) - - IMPLICIT NONE - REAL, INTENT(IN) :: Ren,ustar,visc - REAL, INTENT(OUT) :: Zt,Zq - - IF (Ren .le. 2.) then - - Zt = (5.5e-5)*(Ren**(-0.60)) - Zq = Zt - !FOR SMOOTH SEAS, CAN USE GARRATT - !Zq = 0.2*visc/MAX(ustar,0.1) - !Zq = 0.3*visc/MAX(ustar,0.1) - - ELSE - - !FOR ROUGH SEAS, USE COARE - Zt = (5.5e-5)*(Ren**(-0.60)) - Zq = Zt - - ENDIF - - Zt = MIN(Zt,1.0e-4) - Zt = MAX(Zt,2.0e-9) - - Zq = MIN(Zt,1.0e-4) - Zq = MAX(Zt,2.0e-9) - - return - - END SUBROUTINE fairall_etal_2003 -!-------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!> This formulation for thermal and moisture roughness length (Zt and Zq) -!! as a function of the roughness Reynolds number (Ren) comes from the -!! COARE 3.5/4.0 formulation, empirically derived from COARE and HEXMAX data -!! [Fairall et al. (2014? coming soon, not yet published as of July 2014)]. -!! This is for use over water only. - SUBROUTINE fairall_etal_2014(Zt,Zq,Ren,ustar,visc,rstoch,spp_pbl) - - IMPLICIT NONE - REAL, INTENT(IN) :: Ren,ustar,visc,rstoch - INTEGER, INTENT(IN):: spp_pbl - REAL, INTENT(OUT) :: Zt,Zq - - !Zt = (5.5e-5)*(Ren**(-0.60)) - Zt = MIN(1.6E-4, 5.8E-5/(Ren**0.72)) - Zq = Zt - - IF (spp_pbl ==1) THEN - Zt = MAX(Zt + Zt*2.0*rstoch,2.0e-9) - Zq = MAX(Zt + Zt*2.0*rstoch,2.0e-9) - ELSE - Zt = MAX(Zt,2.0e-9) - Zq = MAX(Zt,2.0e-9) - ENDIF - - return - - END SUBROUTINE fairall_etal_2014 -!-------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!> This is a modified version of Yang et al (2002 QJRMS, 2008 JAMC) -!! and Chen et al (2010, J of Hydromet). Although it was originally -!! designed for arid regions with bare soil, it is modified -!! here to perform over a broader spectrum of vegetation. -!! -!!The original formulation relates the thermal roughness length (Zt) -!!to u* and T*: -!! -!! Zt = ht * EXP(-beta*(ustar**0.5)*(ABS(tstar)**0.25)) -!! -!!where ht = Renc*visc/ustar and the critical Reynolds number -!!(Renc) = 70. Beta was originally = 10 (2002 paper) but was revised -!!to 7.2 (in 2008 paper). Their form typically varies the -!!ratio Z0/Zt by a few orders of magnitude (1-1E4). -!! -!!This modified form uses beta = 1.5 and a variable Renc (function of Z_0), -!!so zt generally varies similarly to the Zilitinkevich form (with Czil = 0.1) -!!for very small or negative surface heat fluxes but can become close to the -!!Zilitinkevich with Czil = 0.2 for very large HFX (large negative T*). -!!Also, the exponent (0.25) on tstar was changed to 1.0, since we found -!!Zt was reduced too much for low-moderate positive heat fluxes. -!! -!!This should only be used over land! - SUBROUTINE Yang_2008(Z_0,Zt,Zq,ustar,tstar,qst,Ren,visc,landsea) - - IMPLICIT NONE - REAL, INTENT(IN) :: Z_0, Ren, ustar, tstar, qst, visc, landsea - REAL :: ht, &! roughness height at critical Reynolds number - tstar2, &! bounded T*, forced to be non-positive - qstar2, &! bounded q*, forced to be non-positive - Z_02, &! bounded Z_0 for variable Renc2 calc - Renc2 ! variable Renc, function of Z_0 - REAL, INTENT(OUT) :: Zt,Zq - REAL, PARAMETER :: Renc=300., & !old constant Renc - beta=1.5, & !important for diurnal variation - m=170., & !slope for Renc2 function - b=691. !y-intercept for Renc2 function - - Z_02 = MIN(Z_0,0.5) - Z_02 = MAX(Z_02,0.04) - Renc2= b + m*log(Z_02) - ht = Renc2*visc/MAX(ustar,0.01) - tstar2 = MIN(tstar, 0.0) - qstar2 = MIN(qst,0.0) - - Zt = ht * EXP(-beta*(ustar**0.5)*(ABS(tstar2)**1.0)) - Zq = ht * EXP(-beta*(ustar**0.5)*(ABS(qstar2)**1.0)) - !Zq = Zt - - Zt = MIN(Zt, Z_0/2.0) - Zq = MIN(Zq, Z_0/2.0) - - return - - END SUBROUTINE Yang_2008 -!-------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!> This is taken from Andreas (2002; J. of Hydromet) and -!! Andreas et al. (2005; BLM). -!! -!! This should only be used over snow/ice! - SUBROUTINE Andreas_2002(Z_0,bvisc,ustar,Zt,Zq) - - IMPLICIT NONE - REAL, INTENT(IN) :: Z_0, bvisc, ustar - REAL, INTENT(OUT) :: Zt, Zq - REAL :: Ren2, zntsno - - REAL, PARAMETER :: bt0_s=1.25, bt0_t=0.149, bt0_r=0.317, & - bt1_s=0.0, bt1_t=-0.55, bt1_r=-0.565, & - bt2_s=0.0, bt2_t=0.0, bt2_r=-0.183 - - REAL, PARAMETER :: bq0_s=1.61, bq0_t=0.351, bq0_r=0.396, & - bq1_s=0.0, bq1_t=-0.628, bq1_r=-0.512, & - bq2_s=0.0, bq2_t=0.0, bq2_r=-0.180 - - !Calculate zo for snow (Andreas et al. 2005, BLM) - zntsno = 0.135*bvisc/ustar + & - (0.035*(ustar*ustar)/9.8) * & - (5.*exp(-1.*(((ustar - 0.18)/0.1)*((ustar - 0.18)/0.1))) + 1.) - Ren2 = ustar*zntsno/bvisc - - ! Make sure that Re is not outside of the range of validity - ! for using their equations - IF (Ren2 .gt. 1000.) Ren2 = 1000. - - IF (Ren2 .le. 0.135) then - - Zt = zntsno*EXP(bt0_s + bt1_s*LOG(Ren2) + bt2_s*LOG(Ren2)**2) - Zq = zntsno*EXP(bq0_s + bq1_s*LOG(Ren2) + bq2_s*LOG(Ren2)**2) - - ELSE IF (Ren2 .gt. 0.135 .AND. Ren2 .lt. 2.5) then - - Zt = zntsno*EXP(bt0_t + bt1_t*LOG(Ren2) + bt2_t*LOG(Ren2)**2) - Zq = zntsno*EXP(bq0_t + bq1_t*LOG(Ren2) + bq2_t*LOG(Ren2)**2) - - ELSE - - Zt = zntsno*EXP(bt0_r + bt1_r*LOG(Ren2) + bt2_r*LOG(Ren2)**2) - Zq = zntsno*EXP(bq0_r + bq1_r*LOG(Ren2) + bq2_r*LOG(Ren2)**2) - - ENDIF - - return - - END SUBROUTINE Andreas_2002 -!-------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!> This subroutine returns the stability functions based off -!! of Hogstrom (1996). - SUBROUTINE PSI_Hogstrom_1996(psi_m, psi_h, zL, Zt, Z_0, Za) - - IMPLICIT NONE - REAL, INTENT(IN) :: zL, Zt, Z_0, Za - REAL, INTENT(OUT) :: psi_m, psi_h - REAL :: x, x0, y, y0, zmL, zhL - - zmL = Z_0*zL/Za - zhL = Zt*zL/Za - - IF (zL .gt. 0.) THEN !STABLE (not well tested - seem large) - - psi_m = -5.3*(zL - zmL) - psi_h = -8.0*(zL - zhL) - - ELSE !UNSTABLE - - x = (1.-19.0*zL)**0.25 - x0= (1.-19.0*zmL)**0.25 - y = (1.-11.6*zL)**0.5 - y0= (1.-11.6*zhL)**0.5 - - psi_m = 2.*LOG((1.+x)/(1.+x0)) + & - &LOG((1.+x**2.)/(1.+x0**2.)) - & - &2.0*ATAN(x) + 2.0*ATAN(x0) - psi_h = 2.*LOG((1.+y)/(1.+y0)) - - ENDIF - - return - - END SUBROUTINE PSI_Hogstrom_1996 -!-------------------------------------------------------------------- -!> \ingroup module_sf_mynn_mod -!> This subroutine returns the stability functions based off -!! of Hogstrom (1996), but with different constants compatible -!! with Dyer and Hicks (1970/74?). This formulation is used for -!! testing/development by Nakanishi (personal communication). - SUBROUTINE PSI_DyerHicks(psi_m, psi_h, zL, Zt, Z_0, Za) - - IMPLICIT NONE - REAL, INTENT(IN) :: zL, Zt, Z_0, Za - REAL, INTENT(OUT) :: psi_m, psi_h - REAL :: x, x0, y, y0, zmL, zhL - - zmL = Z_0*zL/Za !Zo/L - zhL = Zt*zL/Za !Zt/L - - IF (zL .gt. 0.) THEN !STABLE - - psi_m = -5.0*(zL - zmL) - psi_h = -5.0*(zL - zhL) - - ELSE !UNSTABLE - - x = (1.-16.*zL)**0.25 - x0= (1.-16.*zmL)**0.25 - - y = (1.-16.*zL)**0.5 - y0= (1.-16.*zhL)**0.5 - - psi_m = 2.*LOG((1.+x)/(1.+x0)) + & - &LOG((1.+x**2.)/(1.+x0**2.)) - & - &2.0*ATAN(x) + 2.0*ATAN(x0) - psi_h = 2.*LOG((1.+y)/(1.+y0)) - - ENDIF - - return - - END SUBROUTINE PSI_DyerHicks -!-------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!> This subroutine returns the stability functions based off -!! of Beljaar and Holtslag 1991, which is an extension of Holtslag -!! and Debruin 1989. - SUBROUTINE PSI_Beljaars_Holtslag_1991(psi_m, psi_h, zL) - - IMPLICIT NONE - REAL, INTENT(IN) :: zL - REAL, INTENT(OUT) :: psi_m, psi_h - REAL, PARAMETER :: a=1., b=0.666, c=5., d=0.35 - - IF (zL .lt. 0.) THEN !UNSTABLE - - WRITE(*,*)"WARNING: Universal stability functions from" - WRITE(*,*)" Beljaars and Holtslag (1991) should only" - WRITE(*,*)" be used in the stable regime!" - psi_m = 0. - psi_h = 0. - - ELSE !STABLE - - psi_m = -(a*zL + b*(zL -(c/d))*exp(-d*zL) + (b*c/d)) - psi_h = -((1.+.666*a*zL)**1.5 + & - b*(zL - (c/d))*exp(-d*zL) + (b*c/d) -1.) - - ENDIF - - return - - END SUBROUTINE PSI_Beljaars_Holtslag_1991 -!-------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!> This subroutine returns the stability functions come from -!! Zilitinkevich and Esau (2007, BM), which are formulatioed from the -!! "generalized similarity theory" and tuned to the LES DATABASE64 -!! to determine their dependence on z/L. - SUBROUTINE PSI_Zilitinkevich_Esau_2007(psi_m, psi_h, zL) - - IMPLICIT NONE - REAL, INTENT(IN) :: zL - REAL, INTENT(OUT) :: psi_m, psi_h - REAL, PARAMETER :: Cm=3.0, Ct=2.5 - - IF (zL .lt. 0.) THEN !UNSTABLE - - WRITE(*,*)"WARNING: Universal stability function from" - WRITE(*,*)" Zilitinkevich and Esau (2007) should only" - WRITE(*,*)" be used in the stable regime!" - psi_m = 0. - psi_h = 0. - - ELSE !STABLE - - psi_m = -Cm*(zL**(5./6.)) - psi_h = -Ct*(zL**(4./5.)) - - ENDIF - - return - - END SUBROUTINE PSI_Zilitinkevich_Esau_2007 -!-------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!> This subroutine returns the flux-profile relationships -!! of Businger el al. 1971. - SUBROUTINE PSI_Businger_1971(psi_m, psi_h, zL) - - IMPLICIT NONE - REAL, INTENT(IN) :: zL - REAL, INTENT(OUT) :: psi_m, psi_h - REAL :: x, y - REAL, PARAMETER :: Pi180 = 3.14159265/180. - - IF (zL .lt. 0.) THEN !UNSTABLE - - x = (1. - 15.0*zL)**0.25 - y = (1. - 9.0*zL)**0.5 - - psi_m = LOG(((1.+x)/2.)**2.) + & - &LOG((1.+x**2.)/2.) - & - &2.0*ATAN(x) + Pi180*90. - psi_h = 2.*LOG((1.+y)/2.) - - ELSE !STABLE - - psi_m = -4.7*zL - psi_h = -(4.7/0.74)*zL - - ENDIF - - return - - END SUBROUTINE PSI_Businger_1971 -!-------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!> This subroutine returns flux-profile relatioships based off -!!of Lobocki (1993), which is derived from the MY-level 2 model. -!!Suselj and Sood (2010) applied the surface layer length scales -!!from Nakanishi (2001) to get this new relationship. These functions -!!are more agressive (larger magnitude) than most formulations. They -!!showed improvement over water, but untested over land. - SUBROUTINE PSI_Suselj_Sood_2010(psi_m, psi_h, zL) - - IMPLICIT NONE - REAL, INTENT(IN) :: zL - REAL, INTENT(OUT) :: psi_m, psi_h - REAL, PARAMETER :: Rfc=0.19, Ric=0.183, PHIT=0.8 - - IF (zL .gt. 0.) THEN !STABLE - - psi_m = -(zL/Rfc + 1.1223*EXP(1.-1.6666/zL)) - !psi_h = -zL*Ric/((Rfc**2.)*PHIT) + 8.209*(zL**1.1091) - !THEIR EQ FOR PSI_H CRASHES THE MODEL AND DOES NOT MATCH - !THEIR FIG 1. THIS EQ (BELOW) MATCHES THEIR FIG 1 BETTER: - psi_h = -(zL*Ric/((Rfc**2.)*5.) + 7.09*(zL**1.1091)) - - ELSE !UNSTABLE - - psi_m = 0.9904*LOG(1. - 14.264*zL) - psi_h = 1.0103*LOG(1. - 16.3066*zL) - - ENDIF - - return - - END SUBROUTINE PSI_Suselj_Sood_2010 -!-------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!>This subroutine returns a more robust z/L that best matches -!! the z/L from Hogstrom (1996) for unstable conditions and Beljaars -!! and Holtslag (1991) for stable conditions. - SUBROUTINE Li_etal_2010(zL, Rib, zaz0, z0zt) - - IMPLICIT NONE - REAL, INTENT(OUT) :: zL - REAL, INTENT(IN) :: Rib, zaz0, z0zt - REAL :: alfa, beta, zaz02, z0zt2 - REAL, PARAMETER :: au11=0.045, bu11=0.003, bu12=0.0059, & - &bu21=-0.0828, bu22=0.8845, bu31=0.1739, & - &bu32=-0.9213, bu33=-0.1057 - REAL, PARAMETER :: aw11=0.5738, aw12=-0.4399, aw21=-4.901,& - &aw22=52.50, bw11=-0.0539, bw12=1.540, & - &bw21=-0.669, bw22=-3.282 - REAL, PARAMETER :: as11=0.7529, as21=14.94, bs11=0.1569,& - &bs21=-0.3091, bs22=-1.303 - - !set limits according to Li et al (2010), p 157. - zaz02=zaz0 - IF (zaz0 .lt. 100.0) zaz02=100. - IF (zaz0 .gt. 100000.0) zaz02=100000. - - !set more limits according to Li et al (2010) - z0zt2=z0zt - IF (z0zt .lt. 0.5) z0zt2=0.5 - IF (z0zt .gt. 100.0) z0zt2=100. - - alfa = LOG(zaz02) - beta = LOG(z0zt2) - - IF (Rib .le. 0.0) THEN - zL = au11*alfa*Rib**2 + ( & - & (bu11*beta + bu12)*alfa**2 + & - & (bu21*beta + bu22)*alfa + & - & (bu31*beta**2 + bu32*beta + bu33))*Rib - !if(zL .LT. -15 .OR. zl .GT. 0.)print*,"VIOLATION Rib<0:",zL - zL = MAX(zL,-15.) !LIMITS SET ACCORDING TO Li et al (2010) - zL = MIN(zL,0.) !Figure 1. - ELSEIF (Rib .gt. 0.0 .AND. Rib .le. 0.2) THEN - zL = ((aw11*beta + aw12)*alfa + & - & (aw21*beta + aw22))*Rib**2 + & - & ((bw11*beta + bw12)*alfa + & - & (bw21*beta + bw22))*Rib - !if(zL .LT. 0 .OR. zl .GT. 4)print*,"VIOLATION 00.2:",zL - zL = MIN(zL,20.) !LIMITS ACCORDING TO Li et al (2010), THIER - !FIGUE 1C. - zL = MAX(zL,1.) - ENDIF - - return - - END SUBROUTINE Li_etal_2010 - -!------------------------------------------------------------------- -!>\ingroup module_sf_mynn_mod -!! This subroutine adds pbl modules so they can be optimized in pbl code - SUBROUTINE mym_condensation (kts,kte, & - & dx, dz, & - & thl, qw, & - & p,exner, & - & tsq, qsq, cov, & - & Sh, el, bl_mynn_cloudpdf,& - & qc_bl1D, cldfra_bl1D, & - & PBLH1,HFX1, & - & Vt, Vq, th, sgm) - -!------------------------------------------------------------------- - - INTEGER, INTENT(IN) :: kts,kte, bl_mynn_cloudpdf - REAL, INTENT(IN) :: dx,PBLH1,HFX1 - REAL, DIMENSION(kts:kte), INTENT(IN) :: dz - REAL, DIMENSION(kts:kte), INTENT(IN) :: p,exner, thl, qw, & - &tsq, qsq, cov, th - - REAL, DIMENSION(kts:kte), INTENT(INOUT) :: vt,vq,sgm - - REAL, DIMENSION(kts:kte) :: qmq,alp,a,bet,b,ql,q1,cld,RH - REAL, DIMENSION(kts:kte), INTENT(OUT) :: qc_bl1D,cldfra_bl1D - DOUBLE PRECISION :: t3sq, r3sq, c3sq - - REAL :: qsl,esat,qsat,tlk,qsat_tl,dqsl,cld0,q1k,eq1,qll,& - &q2p,pt,rac,qt,t,xl,rsl,cpm,cdhdz,Fng,qww,alpha,beta,bb,ls_min,ls,wt - INTEGER :: i,j,k - - REAL :: erf - - !JOE: NEW VARIABLES FOR ALTERNATE SIGMA - REAL::dth,dtl,dqw,dzk - REAL, DIMENSION(kts:kte), INTENT(IN) :: Sh,el - - !JOE: variables for BL clouds - REAL::zagl,cld9,damp,edown,RHcrit,RHmean,RHsum,RHnum,Hshcu,PBLH2,ql_limit - REAL, PARAMETER :: Hfac = 3.0 !cloud depth factor for HFX (m^3/W) - REAL, PARAMETER :: HFXmin = 50.0 !min W/m^2 for BL clouds - REAL :: RH_00L, RH_00O, phi_dz, lfac - REAL, PARAMETER :: cdz = 2.0 - REAL, PARAMETER :: mdz = 1.5 - - !JAYMES: variables for tropopause-height estimation - REAL :: theta1, theta2, ht1, ht2 - INTEGER :: k_tropo - - REAL, PARAMETER :: rr2=0.7071068, rrp=0.3989423 - - k_tropo=5 - - zagl = 0. - - SELECT CASE(bl_mynn_cloudpdf) - - CASE (0) ! ORIGINAL MYNN PARTIAL-CONDENSATION SCHEME - - DO k = kts,kte-1 - t = th(k)*exner(k) - - !SATURATED VAPOR PRESSURE - esat = esat_blend(t) - !SATURATED SPECIFIC HUMIDITY - qsl=ep_2*esat/(p(k)-ep_3*esat) - !dqw/dT: Clausius-Clapeyron - dqsl = qsl*ep_2*ev/( rd*t**2 ) - !RH (0 to 1.0) - RH(k)=MAX(MIN(1.0,qw(k)/MAX(1.E-8,qsl)),0.001) - - alp(k) = 1.0/( 1.0+dqsl*xlvcp ) - bet(k) = dqsl*exner(k) - - !NOTE: negative bl_mynn_cloudpdf will zero-out the stratus subgrid clouds - ! at the end of this subroutine. - !Sommeria and Deardorff (1977) scheme, as implemented - !in Nakanishi and Niino (2009), Appendix B - t3sq = MAX( tsq(k), 0.0 ) - r3sq = MAX( qsq(k), 0.0 ) - c3sq = cov(k) - c3sq = SIGN( MIN( ABS(c3sq), SQRT(t3sq*r3sq) ), c3sq ) - r3sq = r3sq +bet(k)**2*t3sq -2.0*bet(k)*c3sq - !DEFICIT/EXCESS WATER CONTENT - qmq(k) = qw(k) -qsl - !ORIGINAL STANDARD DEVIATION: limit e-6 produces ~10% more BL clouds - !than e-10 - sgm(k) = SQRT( MAX( r3sq, 1.0d-10 )) - !NORMALIZED DEPARTURE FROM SATURATION - q1(k) = qmq(k) / sgm(k) - !CLOUD FRACTION. rr2 = 1/SQRT(2) = 0.707 - cld(k) = 0.5*( 1.0+erf( q1(k)*rr2 ) ) - - END DO - - CASE (1, -1) !ALTERNATIVE FORM (Nakanishi & Niino 2004 BLM, eq. B6, and - !Kuwano-Yoshida et al. 2010 QJRMS, eq. 7): - DO k = kts,kte-1 - t = th(k)*exner(k) - !SATURATED VAPOR PRESSURE - esat = esat_blend(t) - !SATURATED SPECIFIC HUMIDITY - qsl=ep_2*esat/(p(k)-ep_3*esat) - !dqw/dT: Clausius-Clapeyron - dqsl = qsl*ep_2*ev/( rd*t**2 ) - !RH (0 to 1.0) - RH(k)=MAX(MIN(1.0,qw(k)/MAX(1.E-8,qsl)),0.001) - - alp(k) = 1.0/( 1.0+dqsl*xlvcp ) - bet(k) = dqsl*exner(k) - - if (k .eq. kts) then - dzk = 0.5*dz(k) - else - dzk = 0.5*( dz(k) + dz(k-1) ) - end if - dth = 0.5*(thl(k+1)+thl(k)) - 0.5*(thl(k)+thl(MAX(k-1,kts))) - dqw = 0.5*(qw(k+1) + qw(k)) - 0.5*(qw(k) + qw(MAX(k-1,kts))) - sgm(k) = SQRT( MAX( (alp(k)**2 * MAX(el(k)**2,0.1) * & - b2 * MAX(Sh(k),0.03))/4. * & - (dqw/dzk - bet(k)*(dth/dzk ))**2 , 1.0e-10) ) - qmq(k) = qw(k) -qsl - q1(k) = qmq(k) / sgm(k) - cld(k) = 0.5*( 1.0+erf( q1(k)*rr2 ) ) - END DO - - CASE (2, -2) - !Diagnostic statistical scheme of Chaboureau and Bechtold (2002), JAS - !JAYMES- this added 27 Apr 2015 - DO k = kts,kte-1 - t = th(k)*exner(k) - !SATURATED VAPOR PRESSURE - esat = esat_blend(t) - !SATURATED SPECIFIC HUMIDITY - qsl=ep_2*esat/(p(k)-ep_3*esat) - !dqw/dT: Clausius-Clapeyron - dqsl = qsl*ep_2*ev/( rd*t**2 ) - !RH (0 to 1.0) - RH(k)=MAX(MIN(1.0,qw(k)/MAX(1.E-8,qsl)),0.001) - - alp(k) = 1.0/( 1.0+dqsl*xlvcp ) - bet(k) = dqsl*exner(k) - - xl = xl_blend(t) ! obtain latent heat - - tlk = thl(k)*(p(k)/p1000mb)**rcp ! recover liquid temp (tl) from thl - qsat_tl = qsat_blend(tlk,p(k)) ! get saturation water vapor mixing ratio - ! at tl and p - - rsl = xl*qsat_tl / (r_v*tlk**2) ! slope of C-C curve at t = tl - ! CB02, Eqn. 4 - - cpm = cp + qw(k)*cpv ! CB02, sec. 2, para. 1 - - a(k) = 1./(1. + xl*rsl/cpm) ! CB02 variable "a" - - qmq(k) = a(k) * (qw(k) - qsat_tl) ! saturation deficit/excess; - ! the numerator of Q1 - - b(k) = a(k)*rsl ! CB02 variable "b" - - dtl = 0.5*(thl(k+1)*(p(k+1)/p1000mb)**rcp + tlk) & - & - 0.5*(tlk + thl(MAX(k-1,kts))*(p(MAX(k-1,kts))/p1000mb)**rcp) - - dqw = 0.5*(qw(k+1) + qw(k)) - 0.5*(qw(k) + qw(MAX(k-1,kts))) - - if (k .eq. kts) then - dzk = 0.5*dz(k) - else - dzk = 0.5*( dz(k) + dz(k-1) ) - end if - - cdhdz = dtl/dzk + (g/cpm)*(1.+qw(k)) ! expression below Eq. 9 - ! in CB02 - zagl = zagl + dz(k) - ls_min = MIN(MAX(zagl,25.),300.) ! Let this be the minimum possible length scale: - ! 25 m < ls_min(=zagl) < 300 m - lfac=MIN(4.25+dx/4000.,6.) ! A dx-dependent multiplier for the master length scale: - ! lfac(750 m) = 4.4 - ! lfac(3 km) = 5.0 - ! lfac(13 km) = 6.0 - - ls = MAX(MIN(lfac*el(k),900.),ls_min) ! Bounded: ls_min < ls < 900 m - ! Note: CB02 use 900 m as a constant free-atmosphere length scale. - ! Above 300 m AGL, ls_min remains 300 m. For dx = 3 km, the - ! MYNN master length scale (el) must exceed 60 m before ls - ! becomes responsive to el, otherwise ls = ls_min = 300 m. - - sgm(k) = MAX(1.e-10, 0.225*ls*SQRT(MAX(0., & ! Eq. 9 in CB02: - & (a(k)*dqw/dzk)**2 & ! < 1st term in brackets, - & -2*a(k)*b(k)*cdhdz*dqw/dzk & ! < 2nd term, - & +b(k)**2 * cdhdz**2))) ! < 3rd term - ! CB02 use a multiplier of 0.2, but 0.225 is chosen - ! based on tests - - q1(k) = qmq(k) / sgm(k) ! Q1, the normalized saturation - - cld(k) = MAX(0., MIN(1., 0.5+0.36*ATAN(1.55*q1(k)))) ! Eq. 7 in CB02 - - END DO - END SELECT - - zagl = 0. - RHsum=0. - RHnum=0. - RHmean=0.1 !initialize with small value for small PBLH cases - damp =0 - PBLH2=MAX(10.,PBLH1) - - SELECT CASE(bl_mynn_cloudpdf) - - CASE (-1 : 1) ! ORIGINAL MYNN PARTIAL-CONDENSATION SCHEME - ! OR KUWANO ET AL. - DO k = kts,kte-1 - t = th(k)*exner(k) - q1k = q1(k) - zagl = zagl + dz(k) - !q1=0. - !cld(k)=0. - - !COMPUTE MEAN RH IN PBL (NOT PRESSURE WEIGHTED). - IF (zagl < PBLH2 .AND. PBLH2 > 400.) THEN - RHsum=RHsum+RH(k) - RHnum=RHnum+1.0 - RHmean=RHsum/RHnum - ENDIF - RHcrit = 1. - 0.35*(1.0 - (MAX(250.- MAX(HFX1,HFXmin),0.0)/200.)**2) - if (HFX1 > HFXmin) then - cld9=MIN(MAX(0., (rh(k)-RHcrit)/(1.1-RHcrit)), 1.)**2 - else - cld9=0.0 - endif - - edown=PBLH2*.1 - !Vary BL cloud depth (Hshcu) by mean RH in PBL and HFX - !(somewhat following results from Zhang and Klein (2013, JAS)) - Hshcu=200. + (RHmean+0.5)**1.5*MAX(HFX1,0.)*Hfac - if (zagl < PBLH2-edown) then - damp=MIN(1.0,exp(-ABS(((PBLH2-edown)-zagl)/edown))) - elseif(zagl >= PBLH2-edown .AND. zagl < PBLH2+Hshcu)then - damp=1. - elseif (zagl >= PBLH2+Hshcu)then - damp=MIN(1.0,exp(-ABS((zagl-(PBLH2+Hshcu))/500.))) - endif - cldfra_bl1D(k)=cld9*damp - !cldfra_bl1D(k)=cld(k) ! JAYMES: use this form to retain the Sommeria-Deardorff value - - !use alternate cloud fraction to estimate qc for use in BL clouds-radiation - eq1 = rrp*EXP( -0.5*q1k*q1k ) - qll = MAX( cldfra_bl1D(k)*q1k + eq1, 0.0 ) - !ESTIMATED LIQUID WATER CONTENT (UNNORMALIZED) - ql (k) = alp(k)*sgm(k)*qll - if(cldfra_bl1D(k)>0.01 .and. ql(k)<1.E-6)ql(k)=1.E-6 - qc_bl1D(k)=ql(k)*damp - !now recompute estimated lwc for PBL scheme's use - !qll IS THE NORMALIZED LIQUID WATER CONTENT (Sommeria and - !Deardorff (1977, eq 29a). rrp = 1/(sqrt(2*pi)) = 0.3989 - eq1 = rrp*EXP( -0.5*q1k*q1k ) - qll = MAX( cld(k)*q1k + eq1, 0.0 ) - !ESTIMATED LIQUID WATER CONTENT (UNNORMALIZED) - ql (k) = alp(k)*sgm(k)*qll - - q2p = xlvcp/exner(k) - pt = thl(k) +q2p*ql(k) ! potential temp - - !qt is a THETA-V CONVERSION FOR TOTAL WATER (i.e., THETA-V = qt*THETA) - qt = 1.0 +p608*qw(k) -(1.+p608)*ql(k) - rac = alp(k)*( cld(k)-qll*eq1 )*( q2p*qt-(1.+p608)*pt ) - - !BUOYANCY FACTORS: wherever vt and vq are used, there is a - !"+1" and "+tv0", respectively, so these are subtracted out here. - !vt is unitless and vq has units of K. - vt(k) = qt-1.0 -rac*bet(k) - vq(k) = p608*pt-tv0 +rac - - !To avoid FPE in radiation driver, when these two quantities are multiplied by eachother, - ! add limit to qc_bl and cldfra_bl: - IF (QC_BL1D(k) < 1E-6 .AND. ABS(CLDFRA_BL1D(k)) > 0.01) QC_BL1D(k)= 1E-6 - IF (CLDFRA_BL1D(k) < 1E-2)THEN - CLDFRA_BL1D(k)=0. - QC_BL1D(k)=0. - ENDIF - - END DO - CASE ( 2, -2) - ! JAYMES- this option added 8 May 2015 - ! The cloud water formulations are taken from CB02, Eq. 8. - ! "fng" represents the non-Gaussian contribution to the liquid - ! water flux; these formulations are from Cuijpers and Bechtold - ! (1995), Eq. 7. CB95 also draws from Bechtold et al. 1995, - ! hereafter BCMT95 - DO k = kts,kte-1 - t = th(k)*exner(k) - q1k = q1(k) - zagl = zagl + dz(k) - IF (q1k < 0.) THEN - ql (k) = sgm(k)*EXP(1.2*q1k-1) - ELSE IF (q1k > 2.) THEN - ql (k) = sgm(k)*q1k - ELSE - ql (k) = sgm(k)*(EXP(-1.) + 0.66*q1k + 0.086*q1k**2) - ENDIF - - !Next, adjust our initial estimates of cldfra and ql based - !on tropopause-height and PBLH considerations - !JAYMES: added 4 Nov 2016 - if ((cld(k) .gt. 0.) .or. (ql(k) .gt. 0.)) then - if (k .le. k_tropo) then - !At and below tropopause: impose an upper limit on ql; assume that - !a maximum of 0.5 percent supersaturation in water vapor can be - !available for cloud production - ql_limit = 0.005 * qsat_blend( th(k)*exner(k), p(k) ) - ql(k) = MIN( ql(k), ql_limit ) - else - !Above tropopause: eliminate subgrid clouds from CB scheme - cld(k) = 0. - ql(k) = 0. - endif - endif - - !Buoyancy-flux-related calculations follow... - ! "Fng" represents the non-Gaussian transport factor - ! (non-dimensional) from from Bechtold et al. 1995 - ! (hereafter BCMT95), section 3(c). Their suggested - ! forms for Fng (from their Eq. 20) are: - ! For purposes of the buoyancy flux in stratus, we will use Fng = 1 - Fng = 1. - - xl = xl_blend(t) - bb = b(k)*t/th(k) ! bb is "b" in BCMT95. Their "b" differs from - ! "b" in CB02 (i.e., b(k) above) by a factor - ! of T/theta. Strictly, b(k) above is formulated in - ! terms of sat. mixing ratio, but bb in BCMT95 is - ! cast in terms of sat. specific humidity. The - ! conversion is neglected here. - qww = 1.+0.61*qw(k) - alpha = 0.61*th(k) - beta = (th(k)/t)*(xl/cp) - 1.61*th(k) - - vt(k) = qww - cld(k)*beta*bb*Fng - 1. - vq(k) = alpha + cld(k)*beta*a(k)*Fng - tv0 - ! vt and vq correspond to beta-theta and beta-q, respectively, - ! in NN09, Eq. B8. They also correspond to the bracketed - ! expressions in BCMT95, Eq. 15, since (s*ql/sigma^2) = cldfra*Fng - ! The "-1" and "-tv0" terms are included for consistency with - ! the legacy vt and vq formulations (above). - - ! increase the cloud fraction estimate below PBLH+1km - if (zagl .lt. PBLH2+1000.) cld(k) = MIN( 1., 1.8*cld(k) ) - ! return a cloud condensate and cloud fraction for icloud_bl option: - cldfra_bl1D(k) = cld(k) - qc_bl1D(k) = ql(k) - - !To avoid FPE in radiation driver, when these two quantities are multiplied by eachother, - ! add limit to qc_bl and cldfra_bl: - IF (QC_BL1D(k) < 1E-6 .AND. ABS(CLDFRA_BL1D(k)) > 0.01) QC_BL1D(k)= 1E-6 - IF (CLDFRA_BL1D(k) < 1E-2)THEN - CLDFRA_BL1D(k)=0. - QC_BL1D(k)=0. - ENDIF - - END DO - - END SELECT !end cloudPDF option - - !FOR TESTING PURPOSES ONLY, ISOLATE ON THE MASS-CLOUDS. - IF (bl_mynn_cloudpdf .LT. 0) THEN - DO k = kts,kte-1 - cldfra_bl1D(k) = 0.0 - qc_bl1D(k) = 0.0 - END DO - ENDIF - - cld(kte) = cld(kte-1) - ql(kte) = ql(kte-1) - vt(kte) = vt(kte-1) - vq(kte) = vq(kte-1) - qc_bl1D(kte)=0. - cldfra_bl1D(kte)=0. - - RETURN - - END SUBROUTINE mym_condensation - -! ================================================================== - - -END MODULE module_sf_mynn - diff --git a/physics/moninshoc.f b/physics/moninshoc.f deleted file mode 100644 index 05473db6c..000000000 --- a/physics/moninshoc.f +++ /dev/null @@ -1,607 +0,0 @@ -!> \file moninshoc.f -!! Contains most of the SHOC PBL/shallow convection scheme. - -!> This module contains the CCPP-compliant SHOC scheme. - module moninshoc - - contains - - subroutine moninshoc_init () - end subroutine moninshoc_init - - subroutine moninshoc_finalize () - end subroutine moninshoc_finalize - -!!!!! ========================================================== !!!!! -! subroutine 'moninshoc' computes pbl height and applies vertical diffusion -! using the coefficient provided by the SHOC scheme (from previous step) -! 2015-05-04 - Shrinivas Moorthi - original version based on monin -! 2018-03-21 - Shrinivas Moorthi - fixed a bug related to tke vertical diffusion -! and gneralized the tke location in tracer array -! 2018-03-23 - Shrinivas Moorthi - used twice the momentum diffusion coefficient -! for tke as in Deardorff (1980) - added tridi1 -! -!> \section arg_table_moninshoc_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | ntrac | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | cloud condensate index in tracer array | index | 0 | integer | | in | F | -!! | ncnd | number_of_tracers_for_cloud_condensate | number of tracers for cloud condensate | count | 0 | integer | | in | F | -!! | dv | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | du | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | tau | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | -!! | rtg | tendency_of_vertically_diffused_tracer_concentration | updated tendency of the tracers due to vertical diffusion in PBL scheme | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | -!! | u1 | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | v1 | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | t1 | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | -!! | q1 | vertically_diffused_tracer_concentration | tracer concentration diffused by PBL scheme | kg kg-1 | 3 | real | kind_phys | in | F | -!! | tkh | atmosphere_heat_diffusivity_from_shoc | diffusivity for heat from the SHOC scheme | m2 s-1 | 2 | real | kind_phys | in | F | -!! | prnum | prandtl_number | turbulent Prandtl number | none | 2 | real | kind_phys | inout | F | -!! | ntke | index_for_turbulent_kinetic_energy | tracer index for turbulent kinetic energy | index | 0 | integer | | in | F | -!! | psk | dimensionless_exner_function_at_lowest_model_interface | dimensionless Exner function at the surface interface | none | 1 | real | kind_phys | in | F | -!! | rbsoil | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | -!! | u10m | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | -!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | -!! | tsea | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | -!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | -!! | spd1 | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | -!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | prslk | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | -!! | dusfc | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dvsfc | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dkt | atmosphere_heat_diffusivity | diffusivity for heat | m2 s-1 | 2 | real | kind_phys | out | F | -!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | -!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | in | F | -!! | xkzm_m | atmosphere_momentum_diffusivity_background | background value of momentum diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | -!! | xkzm_h | atmosphere_heat_diffusivity_background | background value of heat diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | -!! | xkzm_s | diffusivity_background_sigma_level | sigma level threshold for background diffusivity | none | 0 | real | kind_phys | in | F | -!! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | -!! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | -!! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | grav | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | fv | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine moninshoc_run (ix,im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, - & u1,v1,t1,q1,tkh,prnum,ntke, - & psk,rbsoil,zorl,u10m,v10m,fm,fh, - & tsea,heat,evap,stress,spd1,kpbl, - & prsi,del,prsl,prslk,phii,phil,delt, - & dusfc,dvsfc,dtsfc,dqsfc,dkt,hpbl, - & kinver,xkzm_m,xkzm_h,xkzm_s,lprnt,ipr,me, - & grav, rd, cp, hvap, fv, - & errmsg,errflg) -! - use machine , only : kind_phys - use funcphys , only : fpvs - - implicit none -! -! arguments -! - logical, intent(in) :: lprnt - integer, intent(in) :: ix, im, - & km, ntrac, ntcw, ncnd, ntke, ipr, me - integer, dimension(im), intent(in) :: kinver - - real(kind=kind_phys), intent(in) :: delt, - & xkzm_m, xkzm_h, xkzm_s - real(kind=kind_phys), intent(in) :: grav, - & rd, cp, hvap, fv - real(kind=kind_phys), dimension(im), intent(in) :: psk, - & rbsoil, zorl, u10m, v10m, fm, fh, tsea, heat, evap, stress, spd1 - real(kind=kind_phys), dimension(ix,km), intent(in) :: u1, v1, - & t1, tkh, del, prsl, phil, prslk - real(kind=kind_phys), dimension(ix,km+1), intent(in) :: prsi, phii - real(kind=kind_phys), dimension(ix,km,ntrac), intent(in) :: q1 - - real(kind=kind_phys), dimension(im,km), intent(inout) :: du, dv, - & tau, prnum - real(kind=kind_phys), dimension(im,km,ntrac), intent(inout) :: rtg - - integer, dimension(im), intent(out) :: kpbl - real(kind=kind_phys), dimension(im), intent(out) :: dusfc, - & dvsfc, dtsfc, dqsfc, hpbl - real(kind=kind_phys), dimension(im,km-1), intent(out) :: dkt - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -! -! locals -! - integer i,is,k,kk,km1,kmpbl,kp1, ntloc -! - logical pblflg(im), sfcflg(im), flg(im) - - real(kind=kind_phys), dimension(im) :: phih, phim - &, rbdn, rbup, sflux, z0, crb, zol, thermal - &, beta, tx1 -! - real(kind=kind_phys), dimension(im,km) :: theta, thvx, zl, a1, ad - &, dt2odel - real(kind=kind_phys), dimension(im,km-1):: xkzo, xkzmo, al, au - &, dku, rdzt -! - real(kind=kind_phys) zi(im,km+1), a2(im,km*(ntrac+1)) -! - real(kind=kind_phys) dsdz2, dsdzq, dsdzt, dsig, dt2, rdt - &, dtodsd, dtodsu, rdz, tem, tem1 - &, ttend, utend, vtend, qtend - &, spdk2, rbint, ri, zol1, robn, bvf2 -! - real(kind=kind_phys), parameter :: zolcr=0.2, - & zolcru=-0.5, rimin=-100., sfcfrac=0.1, - & crbcon=0.25, crbmin=0.15, crbmax=0.35, - & qmin=1.e-8, zfmin=1.e-8, qlmin=1.e-12, - & aphi5=5., aphi16=16., f0=1.e-4 - &, dkmin=0.0, dkmax=1000. -! &, dkmin=0.0, dkmax=1000., xkzminv=0.3 - &, prmin=0.25, prmax=4.0 - &, vk=0.4, cfac=6.5 - real(kind=kind_phys) :: gravi, cont, conq, conw, gocp - - gravi = 1.0/grav - cont = cp/grav - conq = hvap/grav - conw = 1.0/grav - gocp = grav/cp - -! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 -! -!----------------------------------------------------------------------- -! -! compute preliminary variables -! - if (ix < im) stop -! -! if (lprnt) write(0,*)' in moninshoc tsea=',tsea(ipr) - dt2 = delt - rdt = 1. / dt2 - km1 = km - 1 - kmpbl = km / 2 -! - do k=1,km - do i=1,im - zi(i,k) = phii(i,k) * gravi - zl(i,k) = phil(i,k) * gravi - dt2odel(i,k) = dt2 / del(i,k) - enddo - enddo - do i=1,im - zi(i,km+1) = phii(i,km+1) * gravi - enddo -! - do k = 1,km1 - do i=1,im - rdzt(i,k) = 1.0 / (zl(i,k+1) - zl(i,k)) - prnum(i,k) = 1.0 - enddo - enddo -! Setup backgrond diffision - do i=1,im - prnum(i,km) = 1.0 - tx1(i) = 1.0 / prsi(i,1) - enddo - do k = 1,km1 - do i=1,im - xkzo(i,k) = 0.0 - xkzmo(i,k) = 0.0 - if (k < kinver(i)) then -! vertical background diffusivity for heat and momentum - tem1 = 1.0 - prsi(i,k+1) * tx1(i) - tem1 = min(1.0, exp(-tem1 * tem1 * 10.0)) - xkzo(i,k) = xkzm_h * tem1 - xkzmo(i,k) = xkzm_m * tem1 - endif - enddo - enddo -! if (lprnt) then -! print *,' xkzo=',(xkzo(ipr,k),k=1,km1) -! print *,' xkzmo=',(xkzmo(ipr,k),k=1,km1) -! endif -! -! diffusivity in the inversion layer is set to be xkzminv (m^2/s) -! -! do k = 1,kmpbl -! do i=1,im -! if(zi(i,k+1) > 250.) then -! tem1 = (t1(i,k+1)-t1(i,k)) * rdzt(i,k) -! if(tem1 > 1.e-5) then -! xkzo(i,k) = min(xkzo(i,k),xkzminv) -! endif -! endif -! enddo -! enddo -! -! - do i = 1,im - z0(i) = 0.01 * zorl(i) - kpbl(i) = 1 - hpbl(i) = zi(i,1) - pblflg(i) = .true. - sfcflg(i) = .true. - if(rbsoil(i) > 0.) sfcflg(i) = .false. - dusfc(i) = 0. - dvsfc(i) = 0. - dtsfc(i) = 0. - dqsfc(i) = 0. - enddo -! - do k = 1,km - do i=1,im - tx1(i) = 0.0 - enddo - do kk=1,ncnd - do i=1,im - tx1(i) = tx1(i) + max(q1(i,k,ntcw+kk-1), qlmin) - enddo - enddo - do i = 1,im - theta(i,k) = t1(i,k) * psk(i) / prslk(i,k) - thvx(i,k) = theta(i,k)*(1.+fv*max(q1(i,k,1),qmin)-tx1(i)) - enddo - enddo -! -! if (lprnt) write(0,*)' heat=',heat(ipr),' evap=',evap(ipr) - do i = 1,im - sflux(i) = heat(i) + evap(i)*fv*theta(i,1) - if(.not.sfcflg(i) .or. sflux(i) <= 0.) pblflg(i)=.false. - beta(i) = dt2 / (zi(i,2)-zi(i,1)) - enddo -! -! compute the pbl height -! -! write(0,*)' IN moninbl u10=',u10m(1:5),' v10=',v10m(1:5) - do i=1,im - flg(i) = .false. - rbup(i) = rbsoil(i) -! - if(pblflg(i)) then - thermal(i) = thvx(i,1) - crb(i) = crbcon - else - thermal(i) = tsea(i)*(1.+fv*max(q1(i,1,1),qmin)) - tem = max(1.0, sqrt(u10m(i)*u10m(i) + v10m(i)*v10m(i))) - robn = tem / (f0 * z0(i)) - tem1 = 1.e-7 * robn - crb(i) = max(min(0.16 * (tem1 ** (-0.18)), crbmax), crbmin) - endif - enddo - do k = 1, kmpbl - do i = 1, im - if(.not.flg(i)) then - rbdn(i) = rbup(i) - spdk2 = max((u1(i,k)*u1(i,k)+v1(i,k)*v1(i,k)), 1.) - rbup(i) = (thvx(i,k)-thermal(i))*phil(i,k) - & / (thvx(i,1)*spdk2) - kpbl(i) = k - flg(i) = rbup(i) > crb(i) - endif - enddo - enddo - do i = 1,im - if(kpbl(i) > 1) then - k = kpbl(i) - if(rbdn(i) >= crb(i)) then - rbint = 0. - elseif(rbup(i) <= crb(i)) then - rbint = 1. - else - rbint = (crb(i)-rbdn(i)) / (rbup(i)-rbdn(i)) - endif - hpbl(i) = zl(i,k-1) + rbint*(zl(i,k)-zl(i,k-1)) - if(hpbl(i) < zi(i,kpbl(i))) kpbl(i) = kpbl(i) - 1 - else - hpbl(i) = zl(i,1) - kpbl(i) = 1 - endif - enddo -! -! compute similarity parameters -! - do i=1,im - zol(i) = max(rbsoil(i)*fm(i)*fm(i)/fh(i),rimin) - if(sfcflg(i)) then - zol(i) = min(zol(i),-zfmin) - else - zol(i) = max(zol(i),zfmin) - endif - zol1 = zol(i)*sfcfrac*hpbl(i)/zl(i,1) - if(sfcflg(i)) then -! phim(i) = (1.-aphi16*zol1)**(-1./4.) -! phih(i) = (1.-aphi16*zol1)**(-1./2.) - tem = 1.0 / max(1. - aphi16*zol1, 1.0e-8) - phih(i) = sqrt(tem) - phim(i) = sqrt(phih(i)) - else - phim(i) = 1. + aphi5*zol1 - phih(i) = phim(i) - endif - enddo -! -! enhance the pbl height by considering the thermal excess -! - do i=1,im - flg(i) = .true. - if (pblflg(i)) then - flg(i) = .false. - rbup(i) = rbsoil(i) - endif - enddo - do k = 2, kmpbl - do i = 1, im - if(.not.flg(i)) then - rbdn(i) = rbup(i) - spdk2 = max((u1(i,k)*u1(i,k)+v1(i,k)*v1(i,k)), 1.) - rbup(i) = (thvx(i,k)-thermal(i)) * phil(i,k) - & / (thvx(i,1)*spdk2) - kpbl(i) = k - flg(i) = rbup(i) > crb(i) - endif - enddo - enddo - do i = 1,im - if (pblflg(i)) then - k = kpbl(i) - if(rbdn(i) >= crb(i)) then - rbint = 0. - elseif(rbup(i) <= crb(i)) then - rbint = 1. - else - rbint = (crb(i)-rbdn(i)) / (rbup(i)-rbdn(i)) - endif - if (k > 1) then - hpbl(i) = zl(i,k-1) + rbint*(zl(i,k)-zl(i,k-1)) - if(hpbl(i) < zi(i,kpbl(i))) kpbl(i) = kpbl(i) - 1 - if(kpbl(i) <= 1) then - pblflg(i) = .false. - endif - else - pblflg(i) = .false. - endif - endif - if (pblflg(i)) then - tem = phih(i)/phim(i) + cfac*vk*sfcfrac - else - tem = phih(i)/phim(i) - endif - prnum(i,1) = min(prmin,max(prmax,tem)) - enddo -! - do i = 1, im - if(zol(i) > zolcr) then - kpbl(i) = 1 - endif - enddo -! -! compute Prandtl number above boundary layer -! - do k = 1, km1 - kp1 = k + 1 - do i=1,im - if(k >= kpbl(i)) then - rdz = rdzt(i,k) - tem = u1(i,k) - u1(i,kp1) - tem1 = v1(i,k) - v1(i,kp1) - tem = (tem*tem + tem1*tem1) * rdz * rdz - bvf2 = (0.5*grav)*(thvx(i,kp1)-thvx(i,k))*rdz - & / (t1(i,k)+t1(i,kp1)) - ri = max(bvf2/tem,rimin) - if(ri < 0.) then ! unstable regime - prnum(i,kp1) = 1.0 - else - prnum(i,kp1) = min(1.0 + 2.1*ri, prmax) - endif - elseif (k > 1) then - prnum(i,kp1) = prnum(i,1) - endif -! -! prnum(i,kp1) = 1.0 - prnum(i,kp1) = max(prmin, min(prmax, prnum(i,kp1))) - tem = tkh(i,kp1) * prnum(i,kp1) - dku(i,k) = max(min(tem+xkzmo(i,k), dkmax), xkzmo(i,k)) - dkt(i,k) = max(min(tkh(i,kp1)+xkzo(i,k), dkmax), xkzo(i,k)) - enddo - enddo -! -! compute tridiagonal matrix elements for heat and moisture -! - do i=1,im - ad(i,1) = 1. - a1(i,1) = t1(i,1) + beta(i) * heat(i) - a2(i,1) = q1(i,1,1) + beta(i) * evap(i) - enddo -! if (lprnt) write(0,*)' a1=',a1(ipr,1),' beta=',beta(ipr) -! &,' heat=',heat(ipr), ' t1=',t1(ipr,1) - - ntloc = 1 - if(ntrac > 1) then - is = 0 - do k = 2, ntrac - if (k /= ntke) then - ntloc = ntloc + 1 - is = is + km - do i = 1, im - a2(i,1+is) = q1(i,1,k) - enddo - endif - enddo - endif -! - do k = 1,km1 - kp1 = k + 1 - do i = 1,im - dtodsd = dt2odel(i,k) - dtodsu = dt2odel(i,kp1) - dsig = prsl(i,k)-prsl(i,kp1) - rdz = rdzt(i,k) - tem1 = dsig * dkt(i,k) * rdz - dsdz2 = tem1 * rdz - au(i,k) = -dtodsd*dsdz2 - al(i,k) = -dtodsu*dsdz2 -! - ad(i,k) = ad(i,k)-au(i,k) - ad(i,kp1) = 1.-al(i,k) - dsdzt = tem1 * gocp - a1(i,k) = a1(i,k) + dtodsd*dsdzt - a1(i,kp1) = t1(i,kp1) - dtodsu*dsdzt - a2(i,kp1) = q1(i,kp1,1) -! - enddo - enddo -! - if(ntrac > 1) then - is = 0 - do kk = 2, ntrac - if (kk /= ntke) then - is = is + km - do k = 1, km1 - kp1 = k + 1 - do i = 1, im - a2(i,kp1+is) = q1(i,kp1,kk) - enddo - enddo - endif - enddo - endif -! -! solve tridiagonal problem for heat and moisture -! - call tridin(im,km,ntloc,al,ad,au,a1,a2,au,a1,a2) - -! -! recover tendencies of heat and moisture -! - do k = 1,km - do i = 1,im - ttend = (a1(i,k)-t1(i,k)) * rdt - qtend = (a2(i,k)-q1(i,k,1)) * rdt - tau(i,k) = tau(i,k) + ttend -! if(lprnt .and. i==ipr .and. k<11) write(0,*)' tau=',tau(ipr,k) -! &,' ttend=',ttend,' a1=',a1(ipr,k),' t1=',t1(ipr,k) - rtg(i,k,1) = rtg(i,k,1) + qtend - dtsfc(i) = dtsfc(i) + cont*del(i,k)*ttend - dqsfc(i) = dqsfc(i) + conq*del(i,k)*qtend - enddo - enddo - if(ntrac > 1) then - is = 0 - do kk = 2, ntrac - if (kk /= ntke) then - is = is + km - do k = 1, km - do i = 1, im - qtend = (a2(i,k+is)-q1(i,k,kk))*rdt - rtg(i,k,kk) = rtg(i,k,kk) + qtend - enddo - enddo - endif - enddo - endif -! -! compute tridiagonal matrix elements for momentum -! - do i=1,im - ad(i,1) = 1.0 + beta(i) * stress(i) / spd1(i) - a1(i,1) = u1(i,1) - a2(i,1) = v1(i,1) - enddo -! - do k = 1,km1 - kp1 = k + 1 - do i=1,im - dtodsd = dt2odel(i,k) - dtodsu = dt2odel(i,kp1) - dsig = prsl(i,k)-prsl(i,kp1) - rdz = rdzt(i,k) - tem1 = dsig*dku(i,k)*rdz - dsdz2 = tem1 * rdz - au(i,k) = -dtodsd*dsdz2 - al(i,k) = -dtodsu*dsdz2 -! - ad(i,k) = ad(i,k) - au(i,k) - ad(i,kp1) = 1.0 - al(i,k) - a1(i,kp1) = u1(i,kp1) - a2(i,kp1) = v1(i,kp1) -! - enddo - enddo - - call tridi2(im,km,al,ad,au,a1,a2,au,a1,a2) -! -! recover tendencies of momentum -! - do k = 1,km - do i = 1,im - utend = (a1(i,k)-u1(i,k))*rdt - vtend = (a2(i,k)-v1(i,k))*rdt - du(i,k) = du(i,k) + utend - dv(i,k) = dv(i,k) + vtend - dusfc(i) = dusfc(i) + conw*del(i,k)*utend - dvsfc(i) = dvsfc(i) + conw*del(i,k)*vtend - enddo - enddo -! - if (ntke > 0) then ! solve tridiagonal problem for momentum and tke -! -! compute tridiagonal matrix elements for tke -! - do i=1,im - ad(i,1) = 1.0 - a1(i,1) = q1(i,1,ntke) - enddo -! - do k = 1,km1 - kp1 = k + 1 - do i=1,im - dtodsd = dt2odel(i,k) - dtodsu = dt2odel(i,kp1) - dsig = prsl(i,k)-prsl(i,kp1) - rdz = rdzt(i,k) - tem1 = dsig*dku(i,k)*(rdz+rdz) - dsdz2 = tem1 * rdz - au(i,k) = -dtodsd*dsdz2 - al(i,k) = -dtodsu*dsdz2 -! - ad(i,k) = ad(i,k) - au(i,k) - ad(i,kp1) = 1.0 - al(i,k) - a1(i,kp1) = q1(i,kp1,ntke) - enddo - enddo - - call tridi1(im,km,al,ad,au,a1,au,a1) -! - do k = 1, km ! recover tendencies of tke - do i = 1, im - qtend = (a1(i,k)-q1(i,k,ntke))*rdt - rtg(i,k,ntke) = rtg(i,k,ntke) + qtend - enddo - enddo - endif -! - return - end subroutine moninshoc_run - - end module moninshoc diff --git a/physics/ozphys.f b/physics/ozphys.f deleted file mode 100644 index 4acf87107..000000000 --- a/physics/ozphys.f +++ /dev/null @@ -1,202 +0,0 @@ -!> \file ozphys.f -!! This file is ozone sources and sinks (previous version). - - -!> This module contains the CCPP-compliant Ozone photochemistry scheme. - module ozphys - - contains - -! \brief Brief description of the subroutine -! -!> \section arg_table_ozphys_init Argument Table -!! - subroutine ozphys_init() - end subroutine ozphys_init - -! \brief Brief description of the subroutine -! -!> \section arg_table_ozphys_finalize Argument Table -!! - subroutine ozphys_finalize() - end subroutine ozphys_finalize - - -!>\defgroup GFS_ozphys GFS ozphys Main -!! \brief The operational GFS currently parameterizes ozone production and -!! destruction based on monthly mean coefficients (\c global_o3prdlos.f77) provided by Naval -!! Research Laboratory through CHEM2D chemistry model -!! (McCormack et al. (2006) \cite mccormack_et_al_2006). -!! \section arg_table_ozphys_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|---------------------------------------------------------------------------|----------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | -!! | ko3 | vertical_dimension_of_ozone_forcing_data | number of vertical layers in ozone forcing data | count | 0 | integer | | in | F | -!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | oz | ozone_concentration_updated_by_physics | ozone concentration updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | tin | air_temperature_updated_by_physics | updated air temperature | K | 2 | real | kind_phys | in | F | -!! | po3 | natural_log_of_ozone_forcing_data_pressure_levels | natural log of ozone forcing data pressure levels | log(Pa) | 1 | real | kind_phys | in | F | -!! | prsl | air_pressure | mid-layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | prdout | ozone_forcing | ozone forcing coefficients | various | 3 | real | kind_phys | in | F | -!! | oz_coeff | number_of_coefficients_in_ozone_forcing_data | number of coefficients in ozone forcing data | index | 0 | integer | | in | F | -!! | delp | air_pressure_difference_between_midlayers | difference between mid-layer pressures | Pa | 2 | real | kind_phys | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for calculating 3-D diagnostic fields | flag | 0 | logical | | in | F | -!! | ozp1 | cumulative_change_in_ozone_concentration_due_to_production_and_loss_rate | cumulative change in ozone concentration due to production and loss rate | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ozp2 | cumulative_change_in_ozone_concentration_due_to_ozone_mixing_ratio | cumulative change in ozone concentration due to ozone mixing ratio | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ozp3 | cumulative_change_in_ozone_concentration_due_to_temperature | cumulative change in ozone concentration due to temperature | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ozp4 | cumulative_change_in_ozone_concentration_due_to_overhead_ozone_column | cumulative change in ozone concentration due to overhead ozone column | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | me | mpi_rank | rank of the current MPI task | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! -!> \section genal_ozphys GFS ozphys_run General Algorithm -!> @{ - subroutine ozphys_run ( & - & ix, im, levs, ko3, dt, oz, tin, po3, & - & prsl, prdout, oz_coeff, delp, ldiag3d, & - & ozp1, ozp2, ozp3, ozp4, con_g, me, errmsg, errflg) -! -! this code assumes that both prsl and po3 are from bottom to top -! as are all other variables -! - use machine , only : kind_phys - implicit none -! - ! Interface variables - integer, intent(in) :: im, ix, levs, ko3, oz_coeff, me - real(kind=kind_phys), intent(inout) :: & - & oz(ix,levs) - ! These arrays may not be allocated and need assumed array sizes - real(kind=kind_phys), intent(inout) :: & - & ozp1(:,:), ozp2(:,:), ozp3(:,:), ozp4(:,:) - real(kind=kind_phys), intent(in) :: & - & dt, po3(ko3), prdout(ix,ko3,oz_coeff), & - & prsl(ix,levs), tin(ix,levs), delp(ix,levs), & - & con_g - real :: gravi - logical, intent(in) :: ldiag3d - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -! - ! Local variables - integer k,kmax,kmin,l,i,j - logical flg(im) - real(kind=kind_phys) pmax, pmin, tem, temp - real(kind=kind_phys) wk1(im), wk2(im), wk3(im), prod(im,oz_coeff), - & ozib(im), colo3(im,levs+1), ozi(ix,levs) -! - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 -! -! save input oz in ozi - ozi = oz - gravi=1.0/con_g -! -!> - Calculate vertical integrated column ozone values. - if (oz_coeff > 2) then - colo3(:,levs+1) = 0.0 - do l=levs,1,-1 - do i=1,im - colo3(i,l) = colo3(i,l+1) + ozi(i,l) * delp(i,l) * gravi - enddo - enddo - endif -! -!> - Apply vertically linear interpolation to the ozone coefficients. - do l=1,levs - pmin = 1.0e10 - pmax = -1.0e10 -! - do i=1,im - wk1(i) = log(prsl(i,l)) - pmin = min(wk1(i), pmin) - pmax = max(wk1(i), pmax) - prod(i,:) = 0.0 - enddo - kmax = 1 - kmin = 1 - do k=1,ko3-1 - if (pmin < po3(k)) kmax = k - if (pmax < po3(k)) kmin = k - enddo -! - do k=kmin,kmax - temp = 1.0 / (po3(k) - po3(k+1)) - do i=1,im - flg(i) = .false. - if (wk1(i) < po3(k) .and. wk1(i) >= po3(k+1)) then - flg(i) = .true. - wk2(i) = (wk1(i) - po3(k+1)) * temp - wk3(i) = 1.0 - wk2(i) - endif - enddo - do j=1,oz_coeff - do i=1,im - if (flg(i)) then - prod(i,j) = wk2(i) * prdout(i,k,j) - & + wk3(i) * prdout(i,k+1,j) - endif - enddo - enddo - enddo -! - do j=1,oz_coeff - do i=1,im - if (wk1(i) < po3(ko3)) then - prod(i,j) = prdout(i,ko3,j) - endif - if (wk1(i) >= po3(1)) then - prod(i,j) = prdout(i,1,j) - endif - enddo - enddo - - if (oz_coeff == 2) then - do i=1,im - ozib(i) = ozi(i,l) ! no filling - oz(i,l) = (ozib(i) + prod(i,1)*dt) / (1.0 + prod(i,2)*dt) - enddo -! - !if (ldiag3d) then ! ozone change diagnostics - ! do i=1,im - ! ozp1(i,l) = ozp1(i,l) + prod(i,1)*dt - ! ozp2(i,l) = ozp2(i,l) + (oz(i,l) - ozib(i)) - ! enddo - !endif - endif -!> - Calculate the 4 terms of prognostic ozone change during time \a dt: -!! - ozp1(:,:) - Ozone production from production/loss ratio -!! - ozp2(:,:) - Ozone production from ozone mixing ratio -!! - ozp3(:,:) - Ozone production from temperature term at model layers -!! - ozp4(:,:) - Ozone production from column ozone term at model layers - if (oz_coeff == 4) then - do i=1,im - ozib(i) = ozi(i,l) ! no filling - tem = prod(i,1) + prod(i,3)*tin(i,l) - & + prod(i,4)*colo3(i,l+1) -! if (me .eq. 0) print *,'ozphys tem=',tem,' prod=',prod(i,:) -! &,' ozib=',ozib(i),' l=',l,' tin=',tin(i,l),'colo3=',colo3(i,l+1) - oz(i,l) = (ozib(i) + tem*dt) / (1.0 + prod(i,2)*dt) - enddo - !if (ldiag3d) then ! ozone change diagnostics - ! do i=1,im - ! ozp1(i,l) = ozp1(i,l) + prod(i,1)*dt - ! ozp2(i,l) = ozp2(i,l) + (oz(i,l) - ozib(i)) - ! ozp3(i,l) = ozp3(i,l) + prod(i,3)*tin(i,l)*dt - ! ozp4(i,l) = ozp4(i,l) + prod(i,4)*colo3(i,l+1)*dt - ! enddo - !endif - endif - - enddo ! vertical loop -! - return - end subroutine ozphys_run -!> @} - - end module ozphys diff --git a/physics/precpd.f b/physics/precpd.f deleted file mode 100644 index 9e8f5b696..000000000 --- a/physics/precpd.f +++ /dev/null @@ -1,735 +0,0 @@ -!> \file precpd.f -!! This file contains the subroutine that calculates precipitation -!! processes from suspended cloud water/ice. - -!> This module contains the CCPP-compliant zhao_carr_precpd scheme. - module zhaocarr_precpd - contains - -!! \brief Brief description of the subroutine -!! -!! \section arg_table_zhaocarr_precpd_init Argument Table -!! - subroutine zhaocarr_precpd_init () - end subroutine zhaocarr_precpd_init - -!> \defgroup precip GFS precpd Main -!! \brief This subroutine computes the conversion from condensation to -!! precipitation (snow or rain) or evaporation of rain. -!! -!! \section arg_table_zhaocarr_precpd_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|---------------------------------------------------------------|-------------------------------------------------------------------|-------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | pressure level thickness | Pa | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | layer mean pressure | Pa | 2 | real | kind_phys | in | F | -!! | q | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | cwm | cloud_condensed_water_mixing_ratio_updated_by_physics | moist cloud condensed water mixing ratio | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | t | air_temperature_updated_by_physics | layer mean air temperature | K | 2 | real | kind_phys | inout | F | -!! | rn | lwe_thickness_of_explicit_precipitation_amount | explicit precipitation amount on physics timestep | m | 1 | real | kind_phys | out | F | -!! | sr | ratio_of_snowfall_to_rainfall | ratio of snowfall to large-scale rainfall | frac | 1 | real | kind_phys | out | F | -!! | rainp | tendency_of_rain_water_mixing_ratio_due_to_microphysics | tendency of rain water mixing ratio due to microphysics | kg kg-1 s-1 | 2 | real | kind_phys | out | F | -!! | u00k | critical_relative_humidity | critical relative humidity | frac | 2 | real | kind_phys | in | F | -!! | psautco | coefficient_from_cloud_ice_to_snow | conversion coefficient from cloud ice to snow | none | 1 | real | kind_phys | in | F | -!! | prautco | coefficient_from_cloud_water_to_rain | conversion coefficient from cloud water to rain | none | 1 | real | kind_phys | in | F | -!! | evpco | coefficient_for_evaporation_of_rainfall | coefficient for evaporation of rainfall | none | 0 | real | kind_phys | in | F | -!! | wminco | cloud_condensed_water_conversion_threshold | conversion coefficient from cloud liquid and ice to precipitation | none | 1 | real | kind_phys | in | F | -!! | wk1 | grid_size_related_coefficient_used_in_scale-sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | -!! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | -!! | jpr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! -!> \section general_precpd GFS precpd Scheme General Algorithm -!! The following two equations can be used to calculate the -!! precipitation rates of rain and snow at each model level: -!!\f[ -!! P_{r}(\eta)=\frac{p_{s}-p_{t}}{g\eta_{s}}\int_{\eta}^{\eta_{t}}(P_{raut}+P_{racw}+P_{sacw}+P_{sm1}+P_{sm2}-E_{rr})d\eta -!! \f] -!! and -!! \f[ -!! P_{s}(\eta)=\frac{p_{s}-p_{t}}{g\eta_{s}}\int_{\eta}^{\eta_{t}}(P_{saut}+P_{saci}-P_{sm1}-P_{sm2}-E_{rs})d\eta -!! \f] -!! where \f$p_{s}\f$ and\f$p_{t}\f$ are the surface pressure and the -!! pressure at the top of model domain, respectively, and \f$g\f$ is -!! gravity. The implementation of the precipitation scheme also -!! includes a simplified procedure of computing \f$P_{r}\f$ -!! and \f$P_{s}\f$ (Zhao and Carr (1997) \cite zhao_and_carr_1997). -!! -!! The calculation is as follows: -!! -# Calculate precipitation production by auto conversion and accretion (\f$P_{saut}\f$, \f$P_{saci}\f$, \f$P_{raut}\f$). -!! - The accretion of cloud water by rain, \f$P_{racw}\f$, is not included in the current operational scheme. -!! -# Calculate evaporation of precipitation (\f$E_{rr}\f$ and \f$E_{rs}\f$). -!! -# Calculate melting of snow (\f$P_{sm1}\f$ and \f$P_{sm2}\f$, \f$P_{sacw}\f$). -!! -# Update t and q due to precipitation (snow or rain) production. -!! -# Calculate precipitation at surface (\f$rn\f$) and fraction of frozen precipitation (\f$sr\f$). -!! \section Zhao-Carr_precip_detailed GFS precpd Scheme Detailed Algorithm -!> @{ - subroutine zhaocarr_precpd_run (im,ix,km,dt,del,prsl,q,cwm,t,rn & - &, sr,rainp,u00k,psautco,prautco,evpco,wminco & - &, wk1,lprnt,jpr,errmsg,errflg) - -! -! ****************************************************************** -! * * -! * subroutine for precipitation processes * -! * from suspended cloud water/ice * -! * * -! ****************************************************************** -! * * -! * originally created by q. zhao jan. 1995 * -! * ------- * -! * modified and rewritten by shrinivas moorthi oct. 1998 * -! * ----------------- * -! * and hua-lu pan * -! * ---------- * -! * * -! * references: * -! * * -! * zhao and carr (1997), monthly weather review (august) * -! * sundqvist et al., (1989) monthly weather review. (august) * -! * chuang 2013, modify sr to define frozen precipitation fraction* -! ****************************************************************** -! -! in this code vertical indexing runs from surface to top of the -! model -! -! argument list: -! -------------- -! im : inner dimension over which calculation is made -! ix : maximum inner dimension -! km : number of vertical levels -! dt : time step in seconds -! del(km) : pressure layer thickness (bottom to top) -! prsl(km) : pressure values for model layers (bottom to top) -! q(ix,km) : specific humidity (updated in the code) -! cwm(ix,km) : condensate mixing ratio (updated in the code) -! t(ix,km) : temperature (updated in the code) -! rn(im) : precipitation over one time-step dt (m/dt) -!old sr(im) : index (=-1 snow, =0 rain/snow, =1 rain) -!new sr(im) : "snow ratio", ratio of snow to total precipitation -! cll(ix,km) : cloud cover -!hchuang rn(im) unit in m per time step -! precipitation rate conversion 1 mm/s = 1 kg/m2/s -! - use machine , only : kind_phys - use funcphys , only : fpvs - use physcons, grav => con_g, hvap => con_hvap, hfus => con_hfus - &, ttp => con_ttp, cp => con_cp - &, eps => con_eps, epsm1 => con_epsm1 - implicit none -! include 'constant.h' -! -! Interface variables - integer, intent(in) :: im, ix, km, jpr - real (kind=kind_phys), intent(in) :: dt - real (kind=kind_phys), intent(in) :: del(ix,km), prsl(ix,km) - real (kind=kind_phys), intent(inout) :: q(ix,km), t(ix,km), & - & cwm(ix,km) - real (kind=kind_phys), intent(out) :: rn(im), sr(im), rainp(im,km) - real (kind=kind_phys), intent(in) :: u00k(im,km) - real (kind=kind_phys), intent(in) :: psautco(2), prautco(2), & - & evpco, wminco(2), wk1(im) - logical, intent(in) :: lprnt - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -! -! Local variables - real (kind=kind_phys) g, h1, h1000 - &, d00 - &, elwv, eliv, row - &, epsq, eliw - &, rcp, rrow - parameter (g=grav, h1=1.e0, h1000=1000.0 - &, d00=0.e0 - &, elwv=hvap, eliv=hvap+hfus, row=1.e3 - &, epsq=2.e-12 - &, eliw=eliv-elwv, rcp=h1/cp, rrow=h1/row) -! - real(kind=kind_phys), parameter :: cons_0=0.0, cons_p01=0.01 - &, cons_20=20.0 - &, cons_m30=-30.0, cons_50=50.0 -! - real (kind=kind_phys) rnp(im), psautco_l(im), prautco_l(im) & - &, wk2(im) -! - real (kind=kind_phys) err(im), ers(im), precrl(im) & - &, precsl(im), precrl1(im), precsl1(im) & - &, rq(im), condt(im) & - &, conde(im), rconde(im), tmt0(im) & - &, wmin(im,km), wmink(im), pres(im) & - &, wmini(im,km), ccr(im) & - &, tt(im), qq(im), ww(im) & - &, zaodt - real (kind=kind_phys) cclim(km) -! - integer iw(im,km), ipr(im), iwl(im), iwl1(im) -! - logical comput(im) -! - real (kind=kind_phys) ke, rdt, us, climit, cws, csm1 - &, crs1, crs2, cr, aa2, dtcp, c00, cmr - &, tem, c1, c2, wwn -! &, tem, c1, c2, u00b, u00t, wwn - &, precrk, precsk, pres1, qk, qw, qi - &, qint, fiw, wws, cwmk, expf - &, psaut, psaci, amaxcm, tem1, tem2 - &, tmt0k, psm1, psm2, ppr - &, rprs, erk, pps, sid, rid, amaxps - &, praut, fi, qc, amaxrq, rqkll - integer i, k, ihpr, n -! - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 -!-------------- GFS psautco/prautco interstitial ---------------- - do i=1, im - wk2(i) = 1.0-wk1(i) - psautco_l(i) = psautco(1)*wk1(i) + psautco(2)*wk2(i) - prautco_l(i) = prautco(1)*wk1(i) + prautco(2)*wk2(i) - enddo -!-----------------------preliminaries --------------------------------- -! -! do k=1,km -! do i=1,im -! cll(i,k) = 0.0 -! enddo -! enddo -! - rdt = h1 / dt -! ke = 2.0e-5 ! commented on 09/10/99 -- opr value -! ke = 2.0e-6 -! ke = 1.0e-5 -!!! ke = 5.0e-5 -!! ke = 7.0e-5 - ke = evpco -! ke = 7.0e-5 - us = h1 - climit = 1.0e-20 - cws = 0.025 -! - zaodt = 800.0 * rdt -! - csm1 = 5.0000e-8 * zaodt - crs1 = 5.00000e-6 * zaodt - crs2 = 6.66600e-10 * zaodt - cr = 5.0e-4 * zaodt - aa2 = 1.25e-3 * zaodt -! - ke = ke * sqrt(rdt) -! ke = ke * sqrt(zaodt) -! - dtcp = dt * rcp -! -! c00 = 1.5e-1 * dt -! c00 = 10.0e-1 * dt -! c00 = 3.0e-1 * dt !05/09/2000 -! c00 = 1.0e-4 * dt !05/09/2000 -! c00 = prautco * dt !05/09/2000 - cmr = 1.0 / 3.0e-4 -! cmr = 1.0 / 5.0e-4 -! c1 = 100.0 - c1 = 300.0 - c2 = 0.5 -! -! -!--------calculate c0 and cmr using lc at previous step----------------- -! - do k=1,km - do i=1,im - tem = (prsl(i,k)*0.00001) -! tem = sqrt(tem) - iw(i,k) = 0.0 -! wmin(i,k) = 1.0e-5 * tem -! wmini(i,k) = 1.0e-5 * tem ! testing for ras -! - - wmin(i,k) = wminco(1) * tem - wmini(i,k) = wminco(2) * tem - - - rainp(i,k) = 0.0 - - enddo - enddo - do i=1,im -! c0(i) = 1.5e-1 -! cmr(i) = 3.0e-4 -! - iwl1(i) = 0 - precrl1(i) = d00 - precsl1(i) = d00 - comput(i) = .false. - rn(i) = d00 - sr(i) = d00 - ccr(i) = d00 -! - rnp(i) = d00 - enddo -!> -# Select columns where rain can be produced, where -!!\f[ -!! cwm > \min (wmin, wmini) -!!\f] -!! where the cloud water and ice conversion threshold: -!! \f[ -!! wmin=wminco(1)\times prsl\times 10^{-5} -!! \f] -!! \f[ -!! wmini=wminco(2)\times prsl\times 10^{-5} -!! \f] - -!------------select columns where rain can be produced-------------- - do k=1, km-1 - do i=1,im - tem = min(wmin(i,k), wmini(i,k)) - if (cwm(i,k) > tem) comput(i) = .true. - enddo - enddo - ihpr = 0 - do i=1,im - if (comput(i)) then - ihpr = ihpr + 1 - ipr(ihpr) = i - endif - enddo -!*********************************************************************** -!-----------------begining of precipitation calculation----------------- -!*********************************************************************** -! do k=km-1,2,-1 - do k=km,1,-1 - do n=1,ihpr - precrl(n) = precrl1(n) - precsl(n) = precsl1(n) - err (n) = d00 - ers (n) = d00 - iwl (n) = 0 -! - i = ipr(n) - tt(n) = t(i,k) - qq(n) = q(i,k) - ww(n) = cwm(i,k) - wmink(n) = wmin(i,k) - pres(n) = prsl(i,k) -! - precrk = max(cons_0, precrl1(n)) - precsk = max(cons_0, precsl1(n)) - wwn = max(ww(n), climit) -! if (wwn .gt. wmink(n) .or. (precrk+precsk) .gt. d00) then - if (wwn > climit .or. (precrk+precsk) > d00) then - comput(n) = .true. - else - comput(n) = .false. - endif - enddo -! -! es(1:ihpr) = fpvs(tt(1:ihpr)) - do n=1,ihpr - if (comput(n)) then - i = ipr(n) - conde(n) = (dt/g) * del(i,k) - condt(n) = conde(n) * rdt - rconde(n) = h1 / conde(n) - qk = max(epsq, qq(n)) - tmt0(n) = tt(n) - 273.16 - wwn = max(ww(n), climit) -! -! pl = pres(n) * 0.01 -! call qsatd(tt(n), pl, qc) -! rq(n) = max(qq(n), epsq) / max(qc, 1.0e-10) -! rq(n) = max(1.0e-10, rq(n)) ! -- relative humidity--- -! -! the global qsat computation is done in pa - pres1 = pres(n) -! qw = es(n) - qw = min(pres1, fpvs(tt(n))) - qw = eps * qw / (pres1 + epsm1 * qw) - qw = max(qw,epsq) -! -! tmt15 = min(tmt0(n), cons_m15) -! ai = 0.008855 -! bi = 1.0 -! if (tmt0(n) .lt. -20.0) then -! ai = 0.007225 -! bi = 0.9674 -! endif -! qi = qw * (bi + ai*min(tmt0(n),cons_0)) -! qint = qw * (1.-0.00032*tmt15*(tmt15+15.)) -! - qi = qw - qint = qw -! if (tmt0(n).le.-40.) qint = qi -! -!-------------------ice-water id number iw------------------------------ -!> -# Calculate ice-water identification number IW (see algorithm in -!! \ref condense). - if(tmt0(n) < -15.) then - fi = qk - u00k(i,k)*qi - if(fi > d00 .or. wwn > climit) then - iwl(n) = 1 - else - iwl(n) = 0 - endif -! endif - elseif (tmt0(n) >= 0.) then - iwl(n) = 0 -! -! if(tmt0(n).lt.0.0.and.tmt0(n).ge.-15.0) then - else - iwl(n) = 0 - if(iwl1(n) == 1 .and. wwn > climit) iwl(n) = 1 - endif -! -! if(tmt0(n).ge.0.) then -! iwl(n) = 0 -! endif -!----------------the satuation specific humidity------------------------ - fiw = float(iwl(n)) - qc = (h1-fiw)*qint + fiw*qi -!----------------the relative humidity---------------------------------- - if(qc <= 1.0e-10) then - rq(n) = d00 - else - rq(n) = qk / qc - endif -!----------------cloud cover ratio ccr---------------------------------- -!> -# Calculate cloud fraction \f$b\f$ (see algorithm in \ref condense) - if(rq(n) < u00k(i,k)) then - ccr(n) = d00 - elseif(rq(n) >= us) then - ccr(n) = us - else - rqkll = min(us,rq(n)) - ccr(n) = h1-sqrt((us-rqkll)/(us-u00k(i,k))) - endif -! - endif - enddo -!-------------------ice-water id number iwl------------------------------ -! do n=1,ihpr -! if (comput(n) .and. (ww(n) .gt. climit)) then -! if (tmt0(n) .lt. -15.0 -! * .or. (tmt0(n) .lt. 0.0 .and. iwl1(n) .eq. 1)) -! * iwl(n) = 1 -! cll(ipr(n),k) = 1.0 ! cloud cover! -! cll(ipr(n),k) = min(1.0, ww(n)*cclim(k)) ! cloud cover! -! endif -! enddo -! -!> -# Precipitation production by auto conversion and accretion -!! - The autoconversion of cloud ice to snow (\f$P_{saut}\f$) is simulated -!! using the equation from Lin et al.(1983)\cite lin_et_al_1983 -!!\f[ -!! P_{saut}=a_{1}(cwm-wmini) -!!\f] -!! Since snow production in this process is caused by the increase in -!! size of cloud ice particles due to depositional growth and -!! aggregation of small ice particles, \f$P_{saut}\f$ is a function of -!! temperature as determined by coefficient \f$a_{1}\f$, given by -!! \f[ -!! a_{1}=psautco \times dt \times exp\left[ 0.025\left(T-273.15\right)\right] -!! \f] -!! -!! - The accretion of cloud ice by snow (\f$P_{saci}\f$) in the -!! regions where cloud ice exists is simulated by -!!\f[ -!! P_{saci}=C_{s}cwm P_{s} -!!\f] -!! where \f$P_{s}\f$ is the precipitation rate of snow. The collection -!! coefficient \f$C_{s}\f$ is a function of temperature since the open -!! structures of ice crystals at relative warm temperatures are more -!! likely to stick, given a collision, than crystals of other shapes -!! (Rogers (1979) \cite rogers_1979). Above the freezing level, -!! \f$C_{s}\f$ is expressed by -!!\f[ -!! C_{s}=c_{1}exp\left[ 0.025\left(T-273.15\right)\right] -!!\f] -!! where \f$c_{1}=1.25\times 10^{-3} m^{2}kg^{-1}s^{-1}\f$ are used. -!! \f$C_{s}\f$ is set to zero below the freezing level. -!! -!--- precipitation production -- auto conversion and accretion -! - do n=1,ihpr - if (comput(n) .and. ccr(n) > 0.0) then - wws = ww(n) - cwmk = max(cons_0, wws) - i = ipr(n) -! amaxcm = max(cons_0, cwmk - wmink(n)) - if (iwl(n) == 1) then ! ice phase - amaxcm = max(cons_0, cwmk - wmini(i,k)) - expf = dt * exp(0.025*tmt0(n)) - psaut = min(cwmk, psautco_l(i)*expf*amaxcm) - ww(n) = ww(n) - psaut - cwmk = max(cons_0, ww(n)) -! cwmk = max(cons_0, ww(n)-wmini(i,k)) - psaci = min(cwmk, aa2*expf*precsl1(n)*cwmk) - - ww(n) = ww(n) - psaci - precsl(n) = precsl(n) + (wws - ww(n)) * condt(n) - else ! liquid water -! -!> - Following Sundqvist et al. (1989)\cite sundqvist_et_al_1989, -!! the autoconversion of cloud water to rain (\f$P_{raut}\f$) can be -!! parameterized from the cloud water mixing ratio \f$m\f$ and cloud -!! coverage \f$b\f$, that is, -!!\f[ -!! P_{raut}=(prautco \times dt )\times (cwm-wmin)\left\{1-exp[-(\frac{cwm-wmin}{m_{r}b})^{2}]\right\} -!!\f] -!! where \f$m_{r}\f$ is \f$3.0\times 10^{-4}\f$. -! for using sundqvist precip formulation of rain -! - amaxcm = max(cons_0, cwmk - wmink(n)) -!! amaxcm = cwmk - tem1 = precsl1(n) + precrl1(n) - tem2 = min(max(cons_0, 268.0-tt(n)), cons_20) - tem = (1.0+c1*sqrt(tem1*rdt)) * (1+c2*sqrt(tem2)) -! - tem2 = amaxcm * cmr * tem / max(ccr(n),cons_p01) - tem2 = min(cons_50, tem2*tem2) -! praut = c00 * tem * amaxcm * (1.0-exp(-tem2)) - praut = (prautco_l(i)*dt) * tem * amaxcm - & * (1.0-exp(-tem2)) - praut = min(praut, cwmk) - ww(n) = ww(n) - praut -! -! - Calculate the accretion of cloud water by rain \f$P_{racw}\f$, -! can be expressed using the cloud mixing ratio \f$cwm\f$ and rainfall -! rate \f$P_{r}\f$: -!\f[ -! P_{racw}=C_{r}cwmP_{r} -!\f] -! where \f$C_{r}=5.0\times10^{-4}m^{2}kg^{-1}s^{-1}\f$ is the -! collection coeffiecient. Note that this process is not included in -! current operational physcics. -! below is for zhao's precip formulation (water) -! -! amaxcm = max(cons_0, cwmk - wmink(n)) -! praut = min(cwmk, c00*amaxcm*amaxcm) -! ww(n) = ww(n) - praut -! -! cwmk = max(cons_0, ww(n)) -! tem1 = precsl1(n) + precrl1(n) -! pracw = min(cwmk, cr*dt*tem1*cwmk) -! ww(n) = ww(n) - pracw -! - precrl(n) = precrl(n) + (wws - ww(n)) * condt(n) -! -!hchuang code change [+1l] : add record to record information in vertical -! turn rnp in unit of ww (cwm and q, kg/kg ???) - rnp(n) = rnp(n) + (wws - ww(n)) - endif - endif - enddo -!> -# Evaporation of precipitation (\f$E_{rr}\f$ and \f$E_{rs}\f$) -!!\n Evaporation of precipitation is an important process that moistens -!! the layers below cloud base. Through this process, some of the -!! precipitating water is evaporated back to the atmosphere and the -!! precipitation efficiency is reduced. -!! - Evaporation of rain is calculated using the equation (Sundqvist(1988)\cite sundqvist_1988): -!!\f[ -!! E_{rr}= evpco \times (u-f)(P_{r})^{\beta} -!!\f] -!! where \f$u\f$ is u00k, \f$f\f$ is the relative humidity. -!! \f$\beta = 0.5\f$ are empirical parameter. -!! - Evaporation of snow is calculated using the equation: -!!\f[ -!! E_{rs}=[C_{rs1}+C_{rs2}(T-273.15)](\frac{u-f}{u})P_{s} -!!\f] -!! where \f$C_{rs1}=5\times 10^{-6}m^{2}kg^{-1}s^{-1}\f$ and -!! \f$C_{rs2}=6.67\times 10^{-10}m^{2}kg^{-1}K^{-1}s^{-1}\f$. The -!! evaporation of melting snow below the freezing level is ignored in -!! this scheme because of the difficulty in the latent heat treatment -!! since the surface of a melting snowflake is usually covered by a -!! thin layer of liquid water. -! -!-----evaporation of precipitation------------------------- -!**** err & ers positive--->evaporation-- negtive--->condensation -! - do n=1,ihpr - if (comput(n)) then - i = ipr(n) - qk = max(epsq, qq(n)) - tmt0k = max(cons_m30, tmt0(n)) - precrk = max(cons_0, precrl(n)) - precsk = max(cons_0, precsl(n)) - amaxrq = max(cons_0, u00k(i,k)-rq(n)) * conde(n) -!---------------------------------------------------------------------- -! increase the evaporation for strong/light prec -!---------------------------------------------------------------------- - ppr = ke * amaxrq * sqrt(precrk) -! ppr = ke * amaxrq * sqrt(precrk*rdt) - if (tmt0(n) .ge. 0.) then - pps = 0. - else - pps = (crs1+crs2*tmt0k) * amaxrq * precsk / u00k(i,k) - end if -!---------------correct if over-evapo./cond. occurs-------------------- - erk=precrk+precsk - if(rq(n).ge.1.0e-10) erk = amaxrq * qk * rdt / rq(n) - if (ppr+pps .gt. abs(erk)) then - rprs = erk / (precrk+precsk) - ppr = precrk * rprs - pps = precsk * rprs - endif - ppr = min(ppr, precrk) - pps = min(pps, precsk) - err(n) = ppr * rconde(n) - ers(n) = pps * rconde(n) - precrl(n) = precrl(n) - ppr -!hchuang code change [+1l] : add record to record information in vertical -! use err for kg/kg/dt not the ppr (mm/dt=kg/m2/dt) -! - rnp(n) = rnp(n) - err(n) -! - precsl(n) = precsl(n) - pps - endif - enddo -!> -# Melting of snow (\f$P_{sm1}\f$ and \f$P_{sm2}\f$) -!!\n In this scheme, we allow snow melting to take place in certain -!! temperature regions below the freezing level in two ways. In both -!! cases, the melted snow is assumed to become raindrops. -!! - One is the continuous melting of snow due to the increase in -!! temperature as it falls down through the freezing level. This -!! process is parameterized as a function of temperature and snow -!! precipitation rate, that is, -!!\f[ -!! P_{sm1}=C_{sm}(T-273.15)^{2}P_{s} -!!\f] -!! where \f$C_{sm}=5\times 10^{-8}m^{2}kg^{-1}K^{-2}s^{-1}\f$ -!! cause the falling snow to melt almost completely before it reaches -!! the \f$T=278.15 K\f$ level. -!! - Another is the immediate melting of melting snow by collection of -!! the cloud water below the freezing level. In order to calculate the -!! melting rate, the collection rate of cloud water by melting snow is -!! computed first. Similar to the collection of cloud water by rain, -!! the collection of cloud water by melting snow can be parameterized -!! to be proportional to the cloud water mixing ratio \f$m\f$ and the -!! precipitation rate of snow \f$P_{s}\f$: -!!\f[ -!! P_{sacw}=C_{r}cwmP_{s} -!!\f] -!! where \f$C_{r}\f$ is the collection coefficient, -!! \f$C_{r}=5.0\times 10^{-4}m^{2}kg^{-1}s^{-1}\f$ . The melting rate -!! of snow then can be computed from -!!\f[ -!! P_{sm2}=C_{ws}P_{sacw} -!!\f] -!! where \f$C_{ws}=0.025\f$. -!--------------------melting of the snow-------------------------------- - do n=1,ihpr - if (comput(n)) then - if (tmt0(n) .gt. 0.) then - amaxps = max(cons_0, precsl(n)) - psm1 = csm1 * tmt0(n) * tmt0(n) * amaxps - psm2 = cws * cr * max(cons_0, ww(n)) * amaxps - ppr = (psm1 + psm2) * conde(n) - if (ppr .gt. amaxps) then - ppr = amaxps - psm1 = amaxps * rconde(n) - endif - precrl(n) = precrl(n) + ppr -! -!hchuang code change [+1l] : add record to record information in vertical -! turn ppr (mm/dt=kg/m2/dt) to kg/kg/dt -> ppr/air density (kg/m3) - rnp(n) = rnp(n) + ppr * rconde(n) -! - precsl(n) = precsl(n) - ppr - else - psm1 = d00 - endif -! -!---------------update t and q------------------------------------------ -!> - Update t and q. -!!\f[ -!! t=t-\frac{L}{C_{p}}(E_{rr}+E_{rs}+P_{sm1})\times dt -!!\f] -!!\f[ -!! q=q+(E_{rr}+E_{rs})\times dt -!!\f] - - tt(n) = tt(n) - dtcp * (elwv*err(n)+eliv*ers(n)+eliw*psm1) - qq(n) = qq(n) + dt * (err(n)+ers(n)) - endif - enddo -! - do n=1,ihpr - iwl1(n) = iwl(n) - precrl1(n) = max(cons_0, precrl(n)) - precsl1(n) = max(cons_0, precsl(n)) - i = ipr(n) - t(i,k) = tt(n) - q(i,k) = qq(n) - cwm(i,k) = ww(n) - iw(i,k) = iwl(n) -!hchuang code change [+1l] : add record to record information in vertical -! rnp = precrl1*rconde(n) unit in kg/kg/dt -! - rainp(i,k) = rnp(n) - enddo -! -! move water from vapor to liquid should the liquid amount be negative -! - do i = 1, im - if (cwm(i,k) < 0.) then - tem = q(i,k) + cwm(i,k) - if (tem >= 0.0) then - q(i,k) = tem - t(i,k) = t(i,k) - elwv * rcp * cwm(i,k) - cwm(i,k) = 0. - elseif (q(i,k) > 0.0) then - cwm(i,k) = tem - t(i,k) = t(i,k) + elwv * rcp * q(i,k) - q(i,k) = 0.0 - endif - endif - enddo -! - enddo ! k loop ends here! -!********************************************************************** -!-----------------------end of precipitation processes----------------- -!********************************************************************** -! -!> -# Calculate precipitation at surface (\f$rn\f$)and determine -!! fraction of frozen precipitation (\f$sr\f$). -!!\f[ -!! rn= (P_{r}(\eta_{sfc})+P_{s}(\eta_{sfc}))/10^3 -!!\f] -!!\f[ -!! sr=\frac{P_{s}(\eta_{sfc})}{P_{s}(\eta_{sfc})+P_{r}(\eta_{sfc})} -!!\f] - do n=1,ihpr - i = ipr(n) - rn(i) = (precrl1(n) + precsl1(n)) * rrow ! precip at surface -! -!----sr=1 if sfc prec is rain ; ----sr=-1 if sfc prec is snow -!----sr=0 for both of them or no sfc prec -! -! rid = 0. -! sid = 0. -! if (precrl1(n) .ge. 1.e-13) rid = 1. -! if (precsl1(n) .ge. 1.e-13) sid = -1. -! sr(i) = rid + sid ! sr=1 --> rain, sr=-1 -->snow, sr=0 -->both -! chuang, june 2013: change sr to define fraction of frozen precipitation instead -! because wpc uses it in their winter experiment - - rid = precrl1(n) + precsl1(n) - if (rid < 1.e-13) then - sr(i) = 0. - else - sr(i) = precsl1(n)/rid - endif - enddo -! - return - end subroutine zhaocarr_precpd_run -!> @} - -!! \section arg_table_zhaocarr_precpd_finalize Argument Table -!! - subroutine zhaocarr_precpd_finalize - end subroutine zhaocarr_precpd_finalize - - - end module zhaocarr_precpd diff --git a/physics/sfcsub.F b/physics/sfcsub.F deleted file mode 100644 index 7c78707f5..000000000 --- a/physics/sfcsub.F +++ /dev/null @@ -1,8745 +0,0 @@ -!>\file sfcsub.F -!! This file contains gribcode for each parameter. - - -!>\defgroup mod_sfcsub_mod GFS sfcsub Module -!!\ingroup Noah_LSM -!> @{ -!>\ingroup mod_sfcsub -!! This module contains grib code for each parameter-used in subroutines sfccycle() -!! and setrmsk(). - module sfccyc_module - implicit none - save -! -! grib code for each parameter - used in subroutines sfccycle and setrmsk. -! - integer kpdtsf,kpdwet,kpdsno,kpdzor,kpdais,kpdtg3,kpdplr,kpdgla, - & kpdmxi,kpdscv,kpdsmc,kpdoro,kpdmsk,kpdstc,kpdacn,kpdveg, - & kpdvet,kpdsot - &, kpdvmn,kpdvmx,kpdslp,kpdabs - &, kpdsnd, kpdabs_0, kpdabs_1, kpdalb(4) - parameter(kpdtsf=11, kpdwet=86, kpdsno=65, kpdzor=83, -! 1 kpdalb=84, kpdais=91, kpdtg3=11, kpdplr=224, - 1 kpdais=91, kpdtg3=11, kpdplr=224, - 2 kpdgla=238, kpdmxi=91, kpdscv=238, kpdsmc=144, - 3 kpdoro=8, kpdmsk=81, kpdstc=11, kpdacn=91, kpdveg=87, -!cbosu max snow albedo uses a grib id number of 159, not 255. - & kpdvmn=255, kpdvmx=255,kpdslp=236, kpdabs_0=255, - & kpdvet=225, kpdsot=224,kpdabs_1=159, - & kpdsnd=66 ) -! - integer, parameter :: kpdalb_0(4)=(/212,215,213,216/) - integer, parameter :: kpdalb_1(4)=(/189,190,191,192/) - integer, parameter :: kpdalf(2)=(/214,217/) -! - integer, parameter :: xdata=5000, ydata=2500, mdata=xdata*ydata - integer :: veg_type_landice - integer :: soil_type_landice -! - end module sfccyc_module - -!>\ingroup mod_sfcsub - subroutine sfccycle(lugb,len,lsoil,sig1t,deltsfc - &, iy,im,id,ih,fh - &, rla, rlo, slmask,orog,orog_uf,use_ufo,nst_anl - &, sihfcs,sicfcs,sitfcs - &, swdfcs,slcfcs - &, vmnfcs,vmxfcs,slpfcs,absfcs - &, tsffcs,snofcs,zorfcs,albfcs,tg3fcs - &, cnpfcs,smcfcs,stcfcs,slifcs,aisfcs - &, vegfcs,vetfcs,sotfcs,alffcs - &, cvfcs,cvbfcs,cvtfcs,me,nlunit - &, sz_nml,input_nml_file - &, ialb,isot,ivegsrc,tile_num_ch,i_index,j_index) -! - use machine , only : kind_io8,kind_io4 - use sfccyc_module - implicit none - character(len=*), intent(in) :: tile_num_ch - integer,intent(in) :: i_index(len), j_index(len) - logical use_ufo, nst_anl - real (kind=kind_io8) sllnd,slsea,aicice,aicsea,tgice,rlapse, - & orolmx,orolmn,oroomx,oroomn,orosmx, - & orosmn,oroimx,oroimn,orojmx,orojmn, - & alblmx,alblmn,albomx,albomn,albsmx, - & albsmn,albimx,albimn,albjmx,albjmn, - & wetlmx,wetlmn,wetomx,wetomn,wetsmx, - & wetsmn,wetimx,wetimn,wetjmx,wetjmn, - & snolmx,snolmn,snoomx,snoomn,snosmx, - & snosmn,snoimx,snoimn,snojmx,snojmn, - & zorlmx,zorlmn,zoromx,zoromn,zorsmx, - & zorsmn,zorimx,zorimn,zorjmx, zorjmn, - & plrlmx,plrlmn,plromx,plromn,plrsmx, - & plrsmn,plrimx,plrimn,plrjmx,plrjmn, - & tsflmx,tsflmn,tsfomx,tsfomn,tsfsmx, - & tsfsmn,tsfimx,tsfimn,tsfjmx,tsfjmn, - & tg3lmx,tg3lmn,tg3omx,tg3omn,tg3smx, - & tg3smn,tg3imx,tg3imn,tg3jmx,tg3jmn, - & stclmx,stclmn,stcomx,stcomn,stcsmx, - & stcsmn,stcimx,stcimn,stcjmx,stcjmn, - & smclmx,smclmn,smcomx,smcomn,smcsmx, - & smcsmn,smcimx,smcimn,smcjmx,smcjmn, - & scvlmx,scvlmn,scvomx,scvomn,scvsmx, - & scvsmn,scvimx,scvimn,scvjmx,scvjmn, - & veglmx,veglmn,vegomx,vegomn,vegsmx, - & vegsmn,vegimx,vegimn,vegjmx,vegjmn, - & vetlmx,vetlmn,vetomx,vetomn,vetsmx, - & vetsmn,vetimx,vetimn,vetjmx,vetjmn, - & sotlmx,sotlmn,sotomx,sotomn,sotsmx, - & sotsmn,sotimx,sotimn,sotjmx,sotjmn, - & alslmx,alslmn,alsomx,alsomn,alssmx, - & alssmn,alsimx,alsimn,alsjmx,alsjmn, - & epstsf,epsalb,epssno,epswet,epszor, - & epsplr,epsoro,epssmc,epsscv,eptsfc, - & epstg3,epsais,epsacn,epsveg,epsvet, - & epssot,epsalf,qctsfs,qcsnos,qctsfi, - & aislim,snwmin,snwmax,cplrl,cplrs, - & cvegl,czors,csnol,csnos,czorl,csots, - & csotl,cvwgs,cvetl,cvets,calfs, - & fcalfl,fcalfs,ccvt,ccnp,ccv,ccvb, - & calbl,calfl,calbs,ctsfs,grboro, - & grbmsk,ctsfl,deltf,caisl,caiss, - & fsalfl,fsalfs,flalfs,falbl,ftsfl, - & ftsfs,fzorl,fzors,fplrl,fsnos,faisl, - & faiss,fsnol,bltmsk,falbs,cvegs,percrit, - & deltsfc,critp2,critp3,blnmsk,critp1, - & fcplrl,fcplrs,fczors,fvets,fsotl,fsots, - & fvetl,fplrs,fvegl,fvegs,fcsnol,fcsnos, - & fczorl,fcalbs,fctsfl,fctsfs,fcalbl, - & falfs,falfl,fh,crit,zsca,ztsfc,tem1,tem2 - &, fsihl,fsihs,fsicl,fsics, - & csihl,csihs,csicl,csics,epssih,epssic - &, fvmnl,fvmns,fvmxl,fvmxs,fslpl,fslps, - & fabsl,fabss,cvmnl,cvmns,cvmxl,cvmxs, - & cslpl,cslps,cabsl,cabss,epsvmn,epsvmx, - & epsslp,epsabs - &, sihlmx,sihlmn,sihomx,sihomn,sihsmx, - & sihsmn,sihimx,sihimn,sihjmx,sihjmn, - & siclmx,siclmn,sicomx,sicomn,sicsmx, - & sicsmn,sicimx,sicimn,sicjmx,sicjmn - &, glacir_hice - &, vmnlmx,vmnlmn,vmnomx,vmnomn,vmnsmx, - & vmnsmn,vmnimx,vmnimn,vmnjmx,vmnjmn, - & vmxlmx,vmxlmn,vmxomx,vmxomn,vmxsmx, - & vmxsmn,vmximx,vmximn,vmxjmx,vmxjmn, - & slplmx,slplmn,slpomx,slpomn,slpsmx, - & slpsmn,slpimx,slpimn,slpjmx,slpjmn, - & abslmx,abslmn,absomx,absomn,abssmx, - & abssmn,absimx,absimn,absjmx,absjmn - &, sihnew - - integer imsk,jmsk,ifp,irtscv,irtacn,irtais,irtsno,irtzor, - & irtalb,irtsot,irtalf,j,irtvet,irtsmc,irtstc,irtveg, - & irtwet,k,iprnt,kk,irttsf,iret,i,igrdbg,iy,im,id, - & icalbl,icalbs,icalfl,ictsfs,lugb,len,lsoil,ih, - & ictsfl,iczors,icplrl,icplrs,iczorl,icalfs,icsnol, - & icsnos,irttg3,me,kqcm,nlunit,sz_nml,ialb - &, irtvmn, irtvmx, irtslp, irtabs, isot, ivegsrc - logical gausm, deads, qcmsk, znlst, monclm, monanl, - & monfcs, monmer, mondif, landice - character(len=*), intent(in) :: input_nml_file(sz_nml) - - integer num_parthds -! -!> this is a limited point version of surface program. -!! -!! this program runs in two different modes: -!! -!! 1. analysis mode (fh=0.) -!! -!! this program merges climatology, analysis and forecast guess to create -!! new surface fields. if analysis file is given, the program -!! uses it if date of the analysis matches with iy,im,id,ih (see note -!! below). -!! -!! 2. forecast mode (fh.gt.0.) -!! -!! this program interpolates climatology to the date corresponding to the -!! forecast hour. if surface analysis file is given, for the corresponding -!! dates, the program will use it. -!! -!! note: -!! -!! if the date of the analysis does not match given iy,im,id,ih, (and fh), -!! the program searches an old analysis by going back 6 hours, then 12 hours, -!! then one day upto nrepmx days (parameter statement in the subrotine fixrd. -!! now defined as 8). this allows the user to provide non-daily analysis to -!! be used. if matching field is not found, the forecast guess will be used. -!! -!! use of a combined earlier surface analyses and current analysis is -!! not allowed (as was done in the old version for snow analysis in which -!! old snow analysis is used in combination with initial guess), except -!! for sea surface temperature. for sst anolmaly interpolation, you need to -!! set lanom=.true. and must provide sst analysis at initial time. -!! -!! if you want to do complex merging of past and present surface field analysis, -!! you need to create a separate file that contains daily surface field. -!! -!! for a dead start, do not supply fnbgsi or set fnbgsi=' ' -! -! lugb is the unit number used in this subprogram -! len ... number of points on which sfccyc operates -! lsoil .. number of soil layers (2 as of april, 1994) -! iy,im,id,ih .. year, month, day, and hour of initial state. -! fh .. forecast hour -! rla, rlo -- latitude and longitudes of the len points -! sig1t .. sigma level 1 temperature for dead start. should be on gaussian -! grid. if not dead start, no need for dimension but set to zero -! as in the example below. -! -! variable naming conventions: -! -! oro .. orography -! alb .. albedo -! wet .. soil wetness as defined for bucket model -! sno .. snow depth -! zor .. surface roughness length -! vet .. vegetation type -! plr .. plant evaporation resistance -! tsf .. surface skin temperature. sea surface temp. over ocean. -! tg3 .. deep soil temperature (at 500cm) -! stc .. soil temperature (lsoil layrs) -! smc .. soil moisture (lsoil layrs) -! scv .. snow cover (not snow depth) -! ais .. sea ice mask (0 or 1) -! acn .. sea ice concentration (fraction) -! gla .. glacier (permanent snow) mask (0 or 1) -! mxi .. maximum sea ice extent (0 or 1) -! msk .. land ocean mask (0=ocean 1=land) -! cnp .. canopy water content -! cv .. convective cloud cover -! cvb .. convective cloud base -! cvt .. convective cloud top -! sli .. land/sea/sea-ice mask. (1/0/2 respectively) -! veg .. vegetation cover -! sot .. soil type -!cwu [+2l] add sih & sic -! sih .. sea ice thickness -! sic .. sea ice concentration -!clu [+6l] add swd,slc,vmn,vmx,slp,abs -! swd .. actual snow depth -! slc .. liquid soil moisture (lsoil layers) -! vmn .. vegetation cover minimum -! vmx .. vegetation cover maximum -! slp .. slope type -! abs .. maximum snow albedo - -! -! definition of land/sea mask. sllnd for land and slsea for sea. -! definition of sea/ice mask. aicice for ice, aicsea for sea. -! tgice=max ice temperature -! rlapse=lapse rate for sst correction due to surface angulation -! - parameter(sllnd =1.0,slsea =0.0) - parameter(aicice=1.0,aicsea=0.0) - parameter(tgice=271.2) - parameter(rlapse=0.65e-2) -! -! max/min of fields for check and replace. -! -! ???lmx .. max over bare land -! ???lmn .. min over bare land -! ???omx .. max over open ocean -! ???omn .. min over open ocean -! ???smx .. max over snow surface (land and sea-ice) -! ???smn .. min over snow surface (land and sea-ice) -! ???imx .. max over bare sea ice -! ???imn .. min over bare sea ice -! ???jmx .. max over snow covered sea ice -! ???jmn .. min over snow covered sea ice -! - parameter(orolmx=8000.,orolmn=-1000.,oroomx=3000.,oroomn=-1000., - & orosmx=8000.,orosmn=-1000.,oroimx=3000.,oroimn=-1000., - & orojmx=3000.,orojmn=-1000.) -! parameter(alblmx=0.80,alblmn=0.06,albomx=0.06,albomn=0.06, -! & albsmx=0.80,albsmn=0.06,albimx=0.80,albimn=0.80, -! & albjmx=0.80,albjmn=0.80) -!cwu [-3l/+9l] change min/max for alb; add min/max for sih & sic -! parameter(alblmx=0.80,alblmn=0.01,albomx=0.01,albomn=0.01, -! & albsmx=0.80,albsmn=0.01,albimx=0.01,albimn=0.01, -! & albjmx=0.01,albjmn=0.01) -! note: the range values for bare land and snow covered land -! (alblmx, alblmn, albsmx, albsmn) are set below -! based on whether the old or new radiation is selected - parameter(albomx=0.06,albomn=0.06, - & albimx=0.80,albimn=0.06, - & albjmx=0.80,albjmn=0.06) - parameter(sihlmx=0.0,sihlmn=0.0,sihomx=5.0,sihomn=0.0, - & sihsmx=5.0,sihsmn=0.0,sihimx=5.0,sihimn=0.10, - & sihjmx=5.0,sihjmn=0.10,glacir_hice=3.0) -!cwu change sicimn & sicjmn Jan 2015 -! parameter(siclmx=0.0,siclmn=0.0,sicomx=1.0,sicomn=0.0, -! & sicsmx=1.0,sicsmn=0.0,sicimx=1.0,sicimn=0.50, -! & sicjmx=1.0,sicjmn=0.50) -! -! parameter(sihlmx=0.0,sihlmn=0.0,sihomx=8.0,sihomn=0.0, -! & sihsmx=8.0,sihsmn=0.0,sihimx=8.0,sihimn=0.10, -! & sihjmx=8.0,sihjmn=0.10,glacir_hice=3.0) - parameter(siclmx=0.0,siclmn=0.0,sicomx=1.0,sicomn=0.0, - & sicsmx=1.0,sicsmn=0.0,sicimx=1.0,sicimn=0.15, - & sicjmx=1.0,sicjmn=0.15) - - parameter(wetlmx=0.15,wetlmn=0.00,wetomx=0.15,wetomn=0.15, - & wetsmx=0.15,wetsmn=0.15,wetimx=0.15,wetimn=0.15, - & wetjmx=0.15,wetjmn=0.15) - parameter(snolmx=0.0,snolmn=0.0,snoomx=0.0,snoomn=0.0, - & snosmx=55000.,snosmn=0.001,snoimx=0.,snoimn=0.0, - & snojmx=10000.,snojmn=0.01) - parameter(zorlmx=300.,zorlmn=1.0,zoromx=1.0,zoromn=1.e-05, - & zorsmx=300.,zorsmn=1.0,zorimx=1.0,zorimn=1.0, - & zorjmx=1.0,zorjmn=1.0) - parameter(plrlmx=1000.,plrlmn=0.0,plromx=1000.0,plromn=0.0, - & plrsmx=1000.,plrsmn=0.0,plrimx=1000.,plrimn=0.0, - & plrjmx=1000.,plrjmn=0.0) -!clu [-1l/+1l] relax tsfsmx (for noah lsm) - parameter(tsflmx=353.,tsflmn=173.0,tsfomx=313.0,tsfomn=271.2, - & tsfsmx=305.0,tsfsmn=173.0,tsfimx=271.2,tsfimn=173.0, - & tsfjmx=273.16,tsfjmn=173.0) -! parameter(tsflmx=353.,tsflmn=173.0,tsfomx=313.0,tsfomn=271.21, -!* & tsfsmx=273.16,tsfsmn=173.0,tsfimx=271.21,tsfimn=173.0, -! & tsfsmx=305.0,tsfsmn=173.0,tsfimx=271.21,tsfimn=173.0, - parameter(tg3lmx=310.,tg3lmn=200.0,tg3omx=310.0,tg3omn=200.0, - & tg3smx=310.,tg3smn=200.0,tg3imx=310.0,tg3imn=200.0, - & tg3jmx=310.,tg3jmn=200.0) - parameter(stclmx=353.,stclmn=173.0,stcomx=313.0,stcomn=200.0, - & stcsmx=310.,stcsmn=200.0,stcimx=310.0,stcimn=200.0, - & stcjmx=310.,stcjmn=200.0) -!landice mods force a flag value of soil moisture of 1.0 -! at non-land points - parameter(smclmx=0.55,smclmn=0.0,smcomx=1.0,smcomn=1.0, - & smcsmx=0.55,smcsmn=0.0,smcimx=1.0,smcimn=1.0, - & smcjmx=1.0,smcjmn=1.0) - parameter(scvlmx=0.0,scvlmn=0.0,scvomx=0.0,scvomn=0.0, - & scvsmx=1.0,scvsmn=1.0,scvimx=0.0,scvimn=0.0, - & scvjmx=1.0,scvjmn=1.0) - parameter(veglmx=1.0,veglmn=0.0,vegomx=0.0,vegomn=0.0, - & vegsmx=1.0,vegsmn=0.0,vegimx=0.0,vegimn=0.0, - & vegjmx=0.0,vegjmn=0.0) - parameter(vmnlmx=1.0,vmnlmn=0.0,vmnomx=0.0,vmnomn=0.0, - & vmnsmx=1.0,vmnsmn=0.0,vmnimx=0.0,vmnimn=0.0, - & vmnjmx=0.0,vmnjmn=0.0) - parameter(vmxlmx=1.0,vmxlmn=0.0,vmxomx=0.0,vmxomn=0.0, - & vmxsmx=1.0,vmxsmn=0.0,vmximx=0.0,vmximn=0.0, - & vmxjmx=0.0,vmxjmn=0.0) - parameter(slplmx=9.0,slplmn=1.0,slpomx=0.0,slpomn=0.0, - & slpsmx=9.0,slpsmn=1.0,slpimx=0.,slpimn=0., - & slpjmx=0.,slpjmn=0.) -! note: the range values for bare land and snow covered land -! (alblmx, alblmn, albsmx, albsmn) are set below -! based on whether the old or new radiation is selected - parameter(absomx=0.0,absomn=0.0, - & absimx=0.0,absimn=0.0, - & absjmx=0.0,absjmn=0.0) -! vegetation type - parameter(vetlmx=20.,vetlmn=1.0,vetomx=0.0,vetomn=0.0, - & vetsmx=20.,vetsmn=1.0,vetimx=0.,vetimn=0., - & vetjmx=0.,vetjmn=0.) -! soil type - parameter(sotlmx=16.,sotlmn=1.0,sotomx=0.0,sotomn=0.0, - & sotsmx=16.,sotsmn=1.0,sotimx=0.,sotimn=0., - & sotjmx=0.,sotjmn=0.) -! fraction of vegetation for strongly and weakly zeneith angle dependent -! albedo - parameter(alslmx=1.0,alslmn=0.0,alsomx=0.0,alsomn=0.0, - & alssmx=1.0,alssmn=0.0,alsimx=0.0,alsimn=0.0, - & alsjmx=0.0,alsjmn=0.0) -! -! criteria used for monitoring -! - parameter(epstsf=0.01,epsalb=0.001,epssno=0.01, - & epswet=0.01,epszor=0.0000001,epsplr=1.,epsoro=0., - & epssmc=0.0001,epsscv=0.,eptsfc=0.01,epstg3=0.01, - & epsais=0.,epsacn=0.01,epsveg=0.01, - & epssih=0.001,epssic=0.001, - & epsvmn=0.01,epsvmx=0.01,epsabs=0.001,epsslp=0.01, - & epsvet=.01,epssot=.01,epsalf=.001) -! -! quality control of analysis snow and sea ice -! -! qctsfs .. surface temperature above which no snow allowed -! qcsnos .. snow depth above which snow must exist -! qctsfi .. sst above which sea-ice is not allowed -! -!clu relax qctsfs (for noah lsm) -!* parameter(qctsfs=283.16,qcsnos=100.,qctsfi=280.16) -!* parameter(qctsfs=288.16,qcsnos=100.,qctsfi=280.16) - parameter(qctsfs=293.16,qcsnos=100.,qctsfi=280.16) -! -!cwu [-2l] -!* ice concentration for ice limit (55 percent) -! -!* parameter(aislim=0.55) -! -! parameters to obtain snow depth from snow cover and temperature -! -! parameter(snwmin=25.,snwmax=100.) - parameter(snwmin=5.0,snwmax=100.) - real (kind=kind_io8), parameter :: ten=10.0, one=1.0 -! -! coeeficients of blending forecast and interpolated clim -! (or analyzed) fields over sea or land(l) (not for clouds) -! 1.0 = use of forecast -! 0.0 = replace with interpolated analysis -! -! these values are set for analysis mode. -! -! variables land sea -! --------------------------------------------------------- -! surface temperature forecast analysis -! surface temperature forecast forecast (over sea ice) -! albedo analysis analysis -! sea-ice analysis analysis -! snow analysis forecast (over sea ice) -! roughness analysis forecast -! plant resistance analysis analysis -! soil wetness (layer) weighted average analysis -! soil temperature forecast analysis -! canopy waver content forecast forecast -! convective cloud cover forecast forecast -! convective cloud bottm forecast forecast -! convective cloud top forecast forecast -! vegetation cover analysis analysis -! vegetation type analysis analysis -! soil type analysis analysis -! sea-ice thickness forecast forecast -! sea-ice concentration analysis analysis -! vegetation cover min analysis analysis -! vegetation cover max analysis analysis -! max snow albedo analysis analysis -! slope type analysis analysis -! liquid soil wetness analysis-weighted analysis -! actual snow depth analysis-weighted analysis -! -! note: if analysis file is not given, then time interpolated climatology -! is used. if analyiss file is given, it will be used as far as the -! date and time matches. if they do not match, it uses forecast. -! -! critical percentage value for aborting bad points when lgchek=.true. -! - logical lgchek - data lgchek/.true./ - data critp1,critp2,critp3/80.,80.,25./ -! -! integer kpdalb(4), kpdalf(2) -! data kpdalb/212,215,213,216/, kpdalf/214,217/ -! save kpdalb, kpdalf -! -! mask orography and variance on gaussian grid -! - real (kind=kind_io8) slmask(len),orog(len), orog_uf(len) - &, orogd(len) - real (kind=kind_io8) rla(len), rlo(len) -! -! permanent/extremes -! - character*500 fnglac,fnmxic - real (kind=kind_io8), allocatable :: glacir(:),amxice(:),tsfcl0(:) -! -! tsfcl0 is the climatological tsf at fh=0 -! -! climatology surface fields (last character 'c' or 'clm' indicate climatology) -! - character*500 fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, - & fnplrc,fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc, - & fnvegc,fnvetc,fnsotc - &, fnvmnc,fnvmxc,fnslpc,fnabsc, fnalbc2 - real (kind=kind_io8) tsfclm(len), wetclm(len), snoclm(len), - & zorclm(len), albclm(len,4), aisclm(len), - & tg3clm(len), acnclm(len), cnpclm(len), - & cvclm (len), cvbclm(len), cvtclm(len), - & scvclm(len), tsfcl2(len), vegclm(len), - & vetclm(len), sotclm(len), alfclm(len,2), sliclm(len), - & smcclm(len,lsoil), stcclm(len,lsoil) - &, sihclm(len), sicclm(len) - &, vmnclm(len), vmxclm(len), slpclm(len), absclm(len) -! -! analyzed surface fields (last character 'a' or 'anl' indicate analysis) -! - character*500 fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, - & fnplra,fntg3a,fnscva,fnsmca,fnstca,fnacna, - & fnvega,fnveta,fnsota - &, fnvmna,fnvmxa,fnslpa,fnabsa -! - real (kind=kind_io8) tsfanl(len), wetanl(len), snoanl(len), - & zoranl(len), albanl(len,4), aisanl(len), - & tg3anl(len), acnanl(len), cnpanl(len), - & cvanl (len), cvbanl(len), cvtanl(len), - & scvanl(len), tsfan2(len), veganl(len), - & vetanl(len), sotanl(len), alfanl(len,2), slianl(len), - & smcanl(len,lsoil), stcanl(len,lsoil) - &, sihanl(len), sicanl(len) - &, vmnanl(len), vmxanl(len), slpanl(len), absanl(len) -! - real (kind=kind_io8) tsfan0(len) ! sea surface temperature analysis at ft=0. -! -! predicted surface fields (last characters 'fcs' indicates forecast) -! - real (kind=kind_io8) tsffcs(len), wetfcs(len), snofcs(len), - & zorfcs(len), albfcs(len,4), aisfcs(len), - & tg3fcs(len), acnfcs(len), cnpfcs(len), - & cvfcs (len), cvbfcs(len), cvtfcs(len), - & slifcs(len), vegfcs(len), - & vetfcs(len), sotfcs(len), alffcs(len,2), - & smcfcs(len,lsoil), stcfcs(len,lsoil) - &, sihfcs(len), sicfcs(len), sitfcs(len) - &, vmnfcs(len), vmxfcs(len), slpfcs(len), absfcs(len) - &, swdfcs(len), slcfcs(len,lsoil) -! -! ratio of sigma level 1 wind and 10m wind (diagnozed by model and not touched -! in this program). -! - real (kind=kind_io8) f10m (len) - real (kind=kind_io8) fsmcl(25),fsmcs(25),fstcl(25),fstcs(25) - real (kind=kind_io8) fcsmcl(25),fcsmcs(25),fcstcl(25),fcstcs(25) - -!clu [+1l] add swratio (soil moisture liquid-to-total ratio) - real (kind=kind_io8) swratio(len,lsoil) -!clu [+1l] add fixratio (option to adjust slc from smc) - logical fixratio(lsoil) -! - integer icsmcl(25), icsmcs(25), icstcl(25), icstcs(25) -! - real (kind=kind_io8) csmcl(25), csmcs(25) - real (kind=kind_io8) cstcl(25), cstcs(25) -! - real (kind=kind_io8) slmskh(mdata) - character*500 fnmskh - integer kpd7, kpd9 -! - logical icefl1(len), icefl2(len) -! -! input and output surface fields (bges) file names -! -! -! sigma level 1 temperature for dead start -! - real (kind=kind_io8) sig1t(len) -! - character*32 label -! -! = 1 ==> forecast is used -! = 0 ==> analysis (or climatology) is used -! -! output file ... primary surface file for radiation and forecast -! -! rec. 1 label -! rec. 2 date record -! rec. 3 tsf -! rec. 4 soilm(two layers) ----> 4 layers -! rec. 5 snow -! rec. 6 soilt(two layers) ----> 4 layers -! rec. 7 tg3 -! rec. 8 zor -! rec. 9 cv -! rec. 10 cvb -! rec. 11 cvt -! rec. 12 albedo (four types) -! rec. 13 slimsk -! rec. 14 vegetation cover -! rec. 14 plantr -----> skip this record -! rec. 15 f10m -----> canopy -! rec. 16 canopy water content (cnpanl) -----> f10m -! rec. 17 vegetation type -! rec. 18 soil type -! rec. 19 zeneith angle dependent vegetation fraction (two types) -! rec. 20 uustar -! rec. 21 ffmm -! rec. 22 ffhh -!cwu add sih & sic -! rec. 23 sih(one category only) -! rec. 24 sic -!clu [+8l] add prcp, flag, swd, slc, vmn, vmx, slp, abs -! rec. 25 tprcp -! rec. 26 srflag -! rec. 27 swd -! rec. 28 slc (4 layers) -! rec. 29 vmn -! rec. 30 vmx -! rec. 31 slp -! rec. 32 abs - -! -! debug only -! ldebug=.true. creates bges files for climatology and analysis -! lqcbgs=.true. quality controls input bges file before merging (should have been -! qced in the forecast program) -! - logical ldebug,lqcbgs - logical lprnt -! -! debug only -! - character*500 fndclm,fndanl -! - logical lanom - -! - namelist/namsfc/fnglac,fnmxic, - & fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, - & fnplrc,fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc, - & fnvegc,fnvetc,fnsotc,fnalbc2, - & fnvmnc,fnvmxc,fnslpc,fnabsc, - & fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, - & fnplra,fntg3a,fnscva,fnsmca,fnstca,fnacna, - & fnvega,fnveta,fnsota, - & fnvmna,fnvmxa,fnslpa,fnabsa, - & fnmskh, - & ldebug,lgchek,lqcbgs,critp1,critp2,critp3, - & fndclm,fndanl, - & lanom, - & ftsfl,ftsfs,falbl,falbs,faisl,faiss,fsnol,fsnos, - & fzorl,fzors,fplrl,fplrs,fsmcl,fsmcs, - & fstcl,fstcs,fvegl,fvegs,fvetl,fvets,fsotl,fsots, - & fctsfl,fctsfs,fcalbl,fcalbs,fcsnol,fcsnos, - & fczorl,fczors,fcplrl,fcplrs,fcsmcl,fcsmcs, - & fcstcl,fcstcs,fsalfl,fsalfs,fcalfl,flalfs, - & fsihl,fsicl,fsihs,fsics,aislim,sihnew, - & fvmnl,fvmns,fvmxl,fvmxs,fslpl,fslps, - & fabsl,fabss, - & ictsfl,ictsfs,icalbl,icalbs,icsnol,icsnos, - & iczorl,iczors,icplrl,icplrs,icsmcl,icsmcs, - & icstcl,icstcs,icalfl,icalfs, - & gausm, deads, qcmsk, znlst, - & monclm, monanl, monfcs, monmer, mondif, igrdbg, - & blnmsk, bltmsk, landice -! - data gausm/.true./, deads/.false./, blnmsk/0.0/, bltmsk/90.0/ - &, qcmsk/.false./, znlst/.false./, igrdbg/-1/ - &, monclm/.false./, monanl/.false./, monfcs/.false./ - &, monmer/.false./, mondif/.false./, landice/.true./ -! -! defaults file names -! - data fnmskh/'global_slmask.t126.grb'/ - data fnalbc/'global_albedo4.1x1.grb'/ - data fnalbc2/'global_albedo4.1x1.grb'/ - data fntsfc/'global_sstclim.2x2.grb'/ - data fnsotc/'global_soiltype.1x1.grb'/ - data fnvegc/'global_vegfrac.1x1.grb'/ - data fnvetc/'global_vegtype.1x1.grb'/ - data fnglac/'global_glacier.2x2.grb'/ - data fnmxic/'global_maxice.2x2.grb'/ - data fnsnoc/'global_snoclim.1.875.grb'/ - data fnzorc/'global_zorclim.1x1.grb'/ - data fnaisc/'global_iceclim.2x2.grb'/ - data fntg3c/'global_tg3clim.2.6x1.5.grb'/ - data fnsmcc/'global_soilmcpc.1x1.grb'/ -!clu [+4l] add fn()c for vmn, vmx, abs, slp - data fnvmnc/'global_shdmin.0.144x0.144.grb'/ - data fnvmxc/'global_shdmax.0.144x0.144.grb'/ - data fnslpc/'global_slope.1x1.grb'/ - data fnabsc/'global_snoalb.1x1.grb'/ -! - data fnwetc/' '/ - data fnplrc/' '/ - data fnstcc/' '/ - data fnscvc/' '/ - data fnacnc/' '/ -! - data fntsfa/' '/ - data fnweta/' '/ - data fnsnoa/' '/ - data fnzora/' '/ - data fnalba/' '/ - data fnaisa/' '/ - data fnplra/' '/ - data fntg3a/' '/ - data fnsmca/' '/ - data fnstca/' '/ - data fnscva/' '/ - data fnacna/' '/ - data fnvega/' '/ - data fnveta/' '/ - data fnsota/' '/ -!clu [+4l] add fn()a for vmn, vmx, abs, slp - data fnvmna/' '/ - data fnvmxa/' '/ - data fnslpa/' '/ - data fnabsa/' '/ -! - data ldebug/.false./, lqcbgs/.true./ - data fndclm/' '/ - data fndanl/' '/ - data lanom/.false./ -! -! default relaxation time in hours to analysis or climatology - data ftsfl/99999.0/, ftsfs/0.0/ - data falbl/0.0/, falbs/0.0/ - data falfl/0.0/, falfs/0.0/ - data faisl/0.0/, faiss/0.0/ - data fsnol/0.0/, fsnos/99999.0/ - data fzorl/0.0/, fzors/99999.0/ - data fplrl/0.0/, fplrs/0.0/ - data fvetl/0.0/, fvets/99999.0/ - data fsotl/0.0/, fsots/99999.0/ - data fvegl/0.0/, fvegs/99999.0/ -!cwu [+4l] add f()l and f()s for sih, sic and aislim, sihlim - data fsihl/99999.0/, fsihs/99999.0/ -! data fsicl/99999.0/, fsics/99999.0/ - data fsicl/0.0/, fsics/0.0/ -! default ice concentration limit (50%), new ice thickness (20cm) -!cwu change ice concentration limit (15%) Jan 2015 -! data aislim/0.50/, sihnew/0.2/ - data aislim/0.15/, sihnew/0.2/ -!clu [+4l] add f()l and f()s for vmn, vmx, abs, slp - data fvmnl/0.0/, fvmns/99999.0/ - data fvmxl/0.0/, fvmxs/99999.0/ - data fslpl/0.0/, fslps/99999.0/ - data fabsl/0.0/, fabss/99999.0/ -! default relaxation time in hours to climatology if analysis missing - data fctsfl/99999.0/, fctsfs/99999.0/ - data fcalbl/99999.0/, fcalbs/99999.0/ - data fcsnol/99999.0/, fcsnos/99999.0/ - data fczorl/99999.0/, fczors/99999.0/ - data fcplrl/99999.0/, fcplrs/99999.0/ -! default flag to apply climatological annual cycle - data ictsfl/0/, ictsfs/1/ - data icalbl/1/, icalbs/1/ - data icalfl/1/, icalfs/1/ - data icsnol/0/, icsnos/0/ - data iczorl/1/, iczors/0/ - data icplrl/1/, icplrs/0/ -! - data ccnp/1.0/ - data ccv/1.0/, ccvb/1.0/, ccvt/1.0/ -! - data ifp/0/ -! - save ifp,fnglac,fnmxic, - & fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, - & fnplrc,fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,fnvegc, - & fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, - & fnplra,fntg3a,fnscva,fnsmca,fnstca,fnacna,fnvega, - & fnvetc,fnveta, - & fnsotc,fnsota, -!clu [+2l] add fn()c and fn()a for vmn, vmx, slp, abs - & fnvmnc,fnvmxc,fnabsc,fnslpc, - & fnvmna,fnvmxa,fnabsa,fnslpa, - & ldebug,lgchek,lqcbgs,critp1,critp2,critp3, - & fndclm,fndanl, - & lanom, - & ftsfl,ftsfs,falbl,falbs,faisl,faiss,fsnol,fsnos, - & fzorl,fzors,fplrl,fplrs,fsmcl,fsmcs,falfl,falfs, - & fstcl,fstcs,fvegl,fvegs,fvetl,fvets,fsotl,fsots, - & fctsfl,fctsfs,fcalbl,fcalbs,fcsnol,fcsnos, - & fczorl,fczors,fcplrl,fcplrs,fcsmcl,fcsmcs, - & fcstcl,fcstcs,fcalfl,fcalfs, -!cwu [+1l] add f()l and f()s for sih, sic and aislim, sihnew - & fsihl,fsihs,fsicl,fsics,aislim,sihnew, -!clu [+2l] add f()l and f()s for vmn, vmx, slp, abs - & fvmnl,fvmns,fvmxl,fvmxs,fslpl,fslps, - & fabsl,fabss, - & ictsfl,ictsfs,icalbl,icalbs,icsnol,icsnos, - & iczorl,iczors,icplrl,icplrs,icsmcl,icsmcs, - & icstcl,icstcs,icalfl,icalfs, - & gausm, deads, qcmsk, - & monclm, monanl, monfcs, monmer, mondif, igrdbg, - & grboro, grbmsk, -! - & ctsfl, ctsfs, calbl, calfl, calbs, calfs, csmcs, - & csnol, csnos, czorl, czors, cplrl, cplrs, cstcl, - & cstcs, cvegl, cvwgs, cvetl, cvets, csotl, csots, - & csmcl -!cwu [+1l] add c()l and c()s for sih, sic - &, csihl, csihs, csicl, csics -!clu [+2l] add c()l and c()s for vmn, vmx, slp, abs - &, cvmnl, cvmns, cvmxl, cvmxs, cslpl, cslps, - & cabsl, cabss - &, imsk, jmsk, slmskh, blnmsk, bltmsk - &, glacir, amxice, tsfcl0 - &, caisl, caiss, cvegs -! - lprnt = .false. - iprnt = 1 -! do i=1,len -! if (ifp .eq. 0 .and. rla(i) .gt. 80.0) print *,' rla=',rla(i) -! *,' rlo=',rlo(i) -! tem1 = abs(rla(i) - 48.75) -! tem2 = abs(rlo(i) - (-68.50)) -! if(tem1 .lt. 0.25 .and. tem2 .lt. 0.50) then -! lprnt = .true. -! iprnt = i -! print *,' lprnt=',lprnt,' iprnt=',iprnt -! print *,' rla(i)=',rla(i),' rlo(i)=',rlo(i) -! endif -! enddo - if (ialb == 1) then - kpdabs = kpdabs_1 - kpdalb = kpdalb_1 - alblmx = .99 - albsmx = .99 - alblmn = .01 - albsmn = .01 - abslmx = 1.0 - abssmx = 1.0 - abssmn = .01 - abslmn = .01 - else - kpdabs = kpdabs_0 - kpdalb = kpdalb_0 - alblmx = .80 - albsmx = .80 - alblmn = .06 - albsmn = .06 - abslmx = .80 - abssmx = .80 - abslmn = .01 - abssmn = .01 - endif - if(ifp.eq.0) then - ifp = 1 - do k=1,lsoil - fsmcl(k) = 99999. - fsmcs(k) = 0. - fstcl(k) = 99999. - fstcs(k) = 0. - enddo -#ifdef INTERNAL_FILE_NML - read(input_nml_file, nml=namsfc) -#else -! print *,' in sfcsub nlunit=',nlunit,' me=',me,' ialb=',ialb - rewind(nlunit) - read (nlunit,namsfc) -#endif -! write(6,namsfc) -! - if (me .eq. 0) then - print *,'ftsfl,falbl,faisl,fsnol,fzorl=', - & ftsfl,falbl,faisl,fsnol,fzorl - print *,'fsmcl=',fsmcl(1:lsoil) - print *,'fstcl=',fstcl(1:lsoil) - print *,'ftsfs,falbs,faiss,fsnos,fzors=', - & ftsfs,falbs,faiss,fsnos,fzors - print *,'fsmcs=',fsmcs(1:lsoil) - print *,'fstcs=',fstcs(1:lsoil) - print *,' aislim=',aislim,' sihnew=',sihnew - print *,' isot=', isot,' ivegsrc=',ivegsrc - endif - - if (ivegsrc == 2) then ! sib - veg_type_landice=13 - else - veg_type_landice=15 - endif - if (isot == 0) then - soil_type_landice=9 - else - soil_type_landice=16 - endif -! - deltf = deltsfc / 24.0 -! - ctsfl=0. !... tsfc over land - if(ftsfl.ge.99999.) ctsfl=1. - if((ftsfl.gt.0.).and.(ftsfl.lt.99999)) ctsfl=exp(-deltf/ftsfl) -! - ctsfs=0. !... tsfc over sea - if(ftsfs.ge.99999.) ctsfs=1. - if((ftsfs.gt.0.).and.(ftsfs.lt.99999)) ctsfs=exp(-deltf/ftsfs) -! - do k=1,lsoil - csmcl(k)=0. !... soilm over land - if(fsmcl(k).ge.99999.) csmcl(k)=1. - if((fsmcl(k).gt.0.).and.(fsmcl(k).lt.99999)) - & csmcl(k)=exp(-deltf/fsmcl(k)) - csmcs(k)=0. !... soilm over sea - if(fsmcs(k).ge.99999.) csmcs(k)=1. - if((fsmcs(k).gt.0.).and.(fsmcs(k).lt.99999)) - & csmcs(k)=exp(-deltf/fsmcs(k)) - enddo -! - calbl=0. !... albedo over land - if(falbl.ge.99999.) calbl=1. - if((falbl.gt.0.).and.(falbl.lt.99999)) calbl=exp(-deltf/falbl) -! - calfl=0. !... fraction field for albedo over land - if(falfl.ge.99999.) calfl=1. - if((falfl.gt.0.).and.(falfl.lt.99999)) calfl=exp(-deltf/falfl) -! - calbs=0. !... albedo over sea - if(falbs.ge.99999.) calbs=1. - if((falbs.gt.0.).and.(falbs.lt.99999)) calbs=exp(-deltf/falbs) -! - calfs=0. !... fraction field for albedo over sea - if(falfs.ge.99999.) calfs=1. - if((falfs.gt.0.).and.(falfs.lt.99999)) calfs=exp(-deltf/falfs) -! - caisl=0. !... sea ice over land - if(faisl.ge.99999.) caisl=1. - if((faisl.gt.0.).and.(faisl.lt.99999)) caisl=1. -! - caiss=0. !... sea ice over sea - if(faiss.ge.99999.) caiss=1. - if((faiss.gt.0.).and.(faiss.lt.99999)) caiss=1. -! - csnol=0. !... snow over land - if(fsnol.ge.99999.) csnol=1. - if((fsnol.gt.0.).and.(fsnol.lt.99999)) csnol=exp(-deltf/fsnol) -! using the same way to bending snow as narr when fsnol is the negative value -! the magnitude of fsnol is the thread to determine the lower and upper bound -! of final swe - if(fsnol.lt.0.)csnol=fsnol -! - csnos=0. !... snow over sea - if(fsnos.ge.99999.) csnos=1. - if((fsnos.gt.0.).and.(fsnos.lt.99999)) csnos=exp(-deltf/fsnos) -! - czorl=0. !... roughness length over land - if(fzorl.ge.99999.) czorl=1. - if((fzorl.gt.0.).and.(fzorl.lt.99999)) czorl=exp(-deltf/fzorl) -! - czors=0. !... roughness length over sea - if(fzors.ge.99999.) czors=1. - if((fzors.gt.0.).and.(fzors.lt.99999)) czors=exp(-deltf/fzors) -! -! cplrl=0. !... plant resistance over land -! if(fplrl.ge.99999.) cplrl=1. -! if((fplrl.gt.0.).and.(fplrl.lt.99999)) cplrl=exp(-deltf/fplrl) -! -! cplrs=0. !... plant resistance over sea -! if(fplrs.ge.99999.) cplrs=1. -! if((fplrs.gt.0.).and.(fplrs.lt.99999)) cplrs=exp(-deltf/fplrs) -! - do k=1,lsoil - cstcl(k)=0. !... soilt over land - if(fstcl(k).ge.99999.) cstcl(k)=1. - if((fstcl(k).gt.0.).and.(fstcl(k).lt.99999)) - & cstcl(k)=exp(-deltf/fstcl(k)) - cstcs(k)=0. !... soilt over sea - if(fstcs(k).ge.99999.) cstcs(k)=1. - if((fstcs(k).gt.0.).and.(fstcs(k).lt.99999)) - & cstcs(k)=exp(-deltf/fstcs(k)) - enddo -! - cvegl=0. !... vegetation fraction over land - if(fvegl.ge.99999.) cvegl=1. - if((fvegl.gt.0.).and.(fvegl.lt.99999)) cvegl=exp(-deltf/fvegl) -! - cvegs=0. !... vegetation fraction over sea - if(fvegs.ge.99999.) cvegs=1. - if((fvegs.gt.0.).and.(fvegs.lt.99999)) cvegs=exp(-deltf/fvegs) -! - cvetl=0. !... vegetation type over land - if(fvetl.ge.99999.) cvetl=1. - if((fvetl.gt.0.).and.(fvetl.lt.99999)) cvetl=exp(-deltf/fvetl) -! - cvets=0. !... vegetation type over sea - if(fvets.ge.99999.) cvets=1. - if((fvets.gt.0.).and.(fvets.lt.99999)) cvets=exp(-deltf/fvets) -! - csotl=0. !... soil type over land - if(fsotl.ge.99999.) csotl=1. - if((fsotl.gt.0.).and.(fsotl.lt.99999)) csotl=exp(-deltf/fsotl) -! - csots=0. !... soil type over sea - if(fsots.ge.99999.) csots=1. - if((fsots.gt.0.).and.(fsots.lt.99999)) csots=exp(-deltf/fsots) - -!cwu [+16l]--------------------------------------------------------------- -! - csihl=0. !... sea ice thickness over land - if(fsihl.ge.99999.) csihl=1. - if((fsihl.gt.0.).and.(fsihl.lt.99999)) csihl=exp(-deltf/fsihl) -! - csihs=0. !... sea ice thickness over sea - if(fsihs.ge.99999.) csihs=1. - if((fsihs.gt.0.).and.(fsihs.lt.99999)) csihs=exp(-deltf/fsihs) -! - csicl=0. !... sea ice concentration over land - if(fsicl.ge.99999.) csicl=1. - if((fsicl.gt.0.).and.(fsicl.lt.99999)) csicl=exp(-deltf/fsicl) -! - csics=0. !... sea ice concentration over sea - if(fsics.ge.99999.) csics=1. - if((fsics.gt.0.).and.(fsics.lt.99999)) csics=exp(-deltf/fsics) - -!clu [+32l]--------------------------------------------------------------- -! - cvmnl=0. !... min veg cover over land - if(fvmnl.ge.99999.) cvmnl=1. - if((fvmnl.gt.0.).and.(fvmnl.lt.99999)) cvmnl=exp(-deltf/fvmnl) -! - cvmns=0. !... min veg cover over sea - if(fvmns.ge.99999.) cvmns=1. - if((fvmns.gt.0.).and.(fvmns.lt.99999)) cvmns=exp(-deltf/fvmns) -! - cvmxl=0. !... max veg cover over land - if(fvmxl.ge.99999.) cvmxl=1. - if((fvmxl.gt.0.).and.(fvmxl.lt.99999)) cvmxl=exp(-deltf/fvmxl) -! - cvmxs=0. !... max veg cover over sea - if(fvmxs.ge.99999.) cvmxs=1. - if((fvmxs.gt.0.).and.(fvmxs.lt.99999)) cvmxs=exp(-deltf/fvmxs) -! - cslpl=0. !... slope type over land - if(fslpl.ge.99999.) cslpl=1. - if((fslpl.gt.0.).and.(fslpl.lt.99999)) cslpl=exp(-deltf/fslpl) -! - cslps=0. !... slope type over sea - if(fslps.ge.99999.) cslps=1. - if((fslps.gt.0.).and.(fslps.lt.99999)) cslps=exp(-deltf/fslps) -! - cabsl=0. !... snow albedo over land - if(fabsl.ge.99999.) cabsl=1. - if((fabsl.gt.0.).and.(fabsl.lt.99999)) cabsl=exp(-deltf/fabsl) -! - cabss=0. !... snow albedo over sea - if(fabss.ge.99999.) cabss=1. - if((fabss.gt.0.).and.(fabss.lt.99999)) cabss=exp(-deltf/fabss) -!clu ---------------------------------------------------------------------- -! -! read a high resolution mask field for use in grib interpolation -! - call hmskrd(lugb,imsk,jmsk,fnmskh, - & kpdmsk,slmskh,gausm,blnmsk,bltmsk,me) -! if (qcmsk) call qcmask(slmskh,sllnd,slsea,imsk,jmsk,rla,rlo) -! - if (me .eq. 0) then - write(6,*) ' ' - write(6,*) ' lugb=',lugb,' len=',len, ' lsoil=',lsoil - write(6,*) 'iy=',iy,' im=',im,' id=',id,' ih=',ih,' fh=',fh - &, ' sig1t(1)=',sig1t(1) - &, ' gausm=',gausm,' blnmsk=',blnmsk,' bltmsk=',bltmsk - write(6,*) ' ' - endif -! -! reading permanent/extreme features (glacier points and maximum ice extent) -! - allocate (tsfcl0(len)) - allocate (glacir(len)) - allocate (amxice(len)) -! -! read glacier -! - kpd9 = -1 - kpd7 = -1 - call fixrdc(lugb,fnglac,kpdgla,kpd7,kpd9,slmask, - & glacir,len,iret - &, imsk, jmsk, slmskh, gausm, blnmsk, bltmsk - &, rla, rlo, me) -! znnt=1. -! call nntprt(glacir,len,znnt) -! -! read maximum ice extent -! - kpd7 = -1 - call fixrdc(lugb,fnmxic,kpdmxi,kpd7,kpd9,slmask, - & amxice,len,iret - &, imsk, jmsk, slmskh, gausm, blnmsk, bltmsk - &, rla, rlo, me) -! znnt=1. -! call nntprt(amxice,len,znnt) -! - crit=0.5 - call rof01(glacir,len,'ge',crit) - call rof01(amxice,len,'ge',crit) -! -! quality control max ice limit based on glacier points -! - call qcmxice(glacir,amxice,len,me) -! - endif ! first time loop finished -! - do i=1,len - sliclm(i) = 1. - snoclm(i) = 0. - icefl1(i) = .true. - enddo -! if(lprnt) print *,' tsffcsin=',tsffcs(iprnt) -! -! read climatology fields -! - if (me .eq. 0) then - write(6,*) '==============' - write(6,*) 'climatology' - write(6,*) '==============' - endif -! - percrit=critp1 -! - call clima(lugb,iy,im,id,ih,fh,len,lsoil,slmask, - & fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, - & fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,fnvegc, - & fnvetc,fnsotc, - & fnvmnc,fnvmxc,fnslpc,fnabsc, - & tsfclm,tsfcl2,wetclm,snoclm,zorclm,albclm,aisclm, - & tg3clm,cvclm ,cvbclm,cvtclm, - & cnpclm,smcclm,stcclm,sliclm,scvclm,acnclm,vegclm, - & vetclm,sotclm,alfclm, - & vmnclm,vmxclm,slpclm,absclm, - & kpdtsf,kpdwet,kpdsno,kpdzor,kpdalb,kpdais, - & kpdtg3,kpdscv,kpdacn,kpdsmc,kpdstc,kpdveg, - & kpdvet,kpdsot,kpdalf,tsfcl0, - & kpdvmn,kpdvmx,kpdslp,kpdabs, - & deltsfc, lanom - &, imsk, jmsk, slmskh, rla, rlo, gausm, blnmsk, bltmsk,me - &, lprnt,iprnt,fnalbc2,ialb,tile_num_ch,i_index,j_index) -! if(lprnt) print *,'tsfclm=',tsfclm(iprnt),' tsfcl2=',tsfcl2(iprnt) -! -! scale surface roughness and albedo to model required units -! - zsca=100. - call scale(zorclm,len,zsca) - zsca=0.01 - call scale(albclm,len,zsca) - call scale(albclm(1,2),len,zsca) - call scale(albclm(1,3),len,zsca) - call scale(albclm(1,4),len,zsca) - call scale(alfclm,len,zsca) - call scale(alfclm(1,2),len,zsca) -!clu [+4l] scale vmn, vmx, abs from percent to fraction - zsca=0.01 - call scale(vmnclm,len,zsca) - call scale(vmxclm,len,zsca) - call scale(absclm,len,zsca) - -! -! set albedo over ocean to albomx -! - call albocn(albclm,slmask,albomx,len) -! -! make sure vegetation type and soil type are non zero over land -! - call landtyp(vetclm,sotclm,slpclm,slmask,len) -! -!cwu [-1l/+1l] -!* ice concentration or ice mask (only ice mask used in the model now) -! ice concentration and ice mask (both are used in the model now) -! - if(fnaisc(1:8).ne.' ') then -!cwu [+5l/-1l] update sihclm, sicclm - do i=1,len - sihclm(i) = 3.0*aisclm(i) - sicclm(i) = aisclm(i) - if(slmask(i).eq.0..and.glacir(i).eq.1..and. - & sicclm(i).ne.1.) then - sicclm(i) = sicimx - sihfcs(i) = glacir_hice - endif - enddo - crit=aislim -!* crit=0.5 - call rof01(aisclm,len,'ge',crit) - elseif(fnacnc(1:8).ne.' ') then -!cwu [+4l] update sihclm, sicclm - do i=1,len - sihclm(i) = 3.0*acnclm(i) - sicclm(i) = acnclm(i) - if(slmask(i).eq.0..and.glacir(i).eq.1..and. - & sicclm(i).ne.1.) then - sicclm(i) = sicimx - sihfcs(i) = glacir_hice - endif - enddo - call rof01(acnclm,len,'ge',aislim) - do i=1,len - aisclm(i) = acnclm(i) - enddo - endif -! -! quality control of sea ice mask -! - call qcsice(aisclm,glacir,amxice,aicice,aicsea,sllnd,slmask, - & rla,rlo,len,me) -! -! set ocean/land/sea-ice mask -! - call setlsi(slmask,aisclm,len,aicice,sliclm) -! if(lprnt) print *,' aisclm=',aisclm(iprnt),' sliclm=' -! *,sliclm(iprnt),' slmask=',slmask(iprnt) -! -! write(6,*) 'sliclm' -! znnt=1. -! call nntprt(sliclm,len,znnt) -! -! quality control of snow -! - call qcsnow(snoclm,slmask,aisclm,glacir,len,snosmx,landice,me) -! - call setzro(snoclm,epssno,len) -! -! snow cover handling (we assume climatological snow depth is available) -! quality control of snow depth (note that snow should be corrected first -! because it influences tsf -! - kqcm=1 - call qcmxmn('snow ',snoclm,sliclm,snoclm,icefl1, - & snolmx,snolmn,snoomx,snoomn,snoimx,snoimn, - & snojmx,snojmn,snosmx,snosmn,epssno, - & rla,rlo,len,kqcm,percrit,lgchek,me) -! write(6,*) 'snoclm' -! znnt=1. -! call nntprt(snoclm,len,znnt) -! -! get snow cover from snow depth array -! - if(fnscvc(1:8).eq.' ') then - call getscv(snoclm,scvclm,len) - endif -! -! set tsfc over snow to tsfsmx if greater -! - call snosfc(snoclm,tsfclm,tsfsmx,len,me) -! call snosfc(snoclm,tsfcl2,tsfsmx,len) - -! -! quality control -! - do i=1,len - icefl2(i) = sicclm(i) .gt. 0.99999 - enddo - kqcm=1 - call qcmxmn('tsfc ',tsfclm,sliclm,snoclm,icefl2, - & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn, - & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('tsf2 ',tsfcl2,sliclm,snoclm,icefl2, - & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn, - & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf, - & rla,rlo,len,kqcm,percrit,lgchek,me) - do kk = 1, 4 - call qcmxmn('albc ',albclm(1,kk),sliclm,snoclm,icefl1, - & alblmx,alblmn,albomx,albomn,albimx,albimn, - & albjmx,albjmn,albsmx,albsmn,epsalb, - & rla,rlo,len,kqcm,percrit,lgchek,me) - enddo - if(fnwetc(1:8).ne.' ') then - call qcmxmn('wetc ',wetclm,sliclm,snoclm,icefl1, - & wetlmx,wetlmn,wetomx,wetomn,wetimx,wetimn, - & wetjmx,wetjmn,wetsmx,wetsmn,epswet, - & rla,rlo,len,kqcm,percrit,lgchek,me) - endif - call qcmxmn('zorc ',zorclm,sliclm,snoclm,icefl1, - & zorlmx,zorlmn,zoromx,zoromn,zorimx,zorimn, - & zorjmx,zorjmn,zorsmx,zorsmn,epszor, - & rla,rlo,len,kqcm,percrit,lgchek,me) -! if(fnplrc(1:8).ne.' ') then -! call qcmxmn('plntc ',plrclm,sliclm,snoclm,icefl1, -! & plrlmx,plrlmn,plromx,plromn,plrimx,plrimn, -! & plrjmx,plrjmn,plrsmx,plrsmn,epsplr, -! & rla,rlo,len,kqcm,percrit,lgchek,me) -! endif - call qcmxmn('tg3c ',tg3clm,sliclm,snoclm,icefl1, - & tg3lmx,tg3lmn,tg3omx,tg3omn,tg3imx,tg3imn, - & tg3jmx,tg3jmn,tg3smx,tg3smn,epstg3, - & rla,rlo,len,kqcm,percrit,lgchek,me) -! -! get soil temp and moisture (after all the qcs are completed) -! - if(fnsmcc(1:8).eq.' ') then - call getsmc(wetclm,len,lsoil,smcclm,me) - endif - call qcmxmn('smc1c ',smcclm(1,1),sliclm,snoclm,icefl1, - & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, - & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('smc2c ',smcclm(1,2),sliclm,snoclm,icefl1, - & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, - & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!clu [+8l] add smcclm(3:4) - if(lsoil.gt.2) then - call qcmxmn('smc3c ',smcclm(1,3),sliclm,snoclm,icefl1, - & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, - & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('smc4c ',smcclm(1,4),sliclm,snoclm,icefl1, - & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, - & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - endif - if(fnstcc(1:8).eq.' ') then - call getstc(tsfclm,tg3clm,sliclm,len,lsoil,stcclm,tsfimx) - endif - call qcmxmn('stc1c ',stcclm(1,1),sliclm,snoclm,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('stc2c ',stcclm(1,2),sliclm,snoclm,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!clu [+8l] add stcclm(3:4) - if(lsoil.gt.2) then - call qcmxmn('stc3c ',stcclm(1,3),sliclm,snoclm,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('stc4c ',stcclm(1,4),sliclm,snoclm,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - endif - call qcmxmn('vegc ',vegclm,sliclm,snoclm,icefl1, - & veglmx,veglmn,vegomx,vegomn,vegimx,vegimn, - & vegjmx,vegjmn,vegsmx,vegsmn,epsveg, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('vetc ',vetclm,sliclm,snoclm,icefl1, - & vetlmx,vetlmn,vetomx,vetomn,vetimx,vetimn, - & vetjmx,vetjmn,vetsmx,vetsmn,epsvet, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('sotc ',sotclm,sliclm,snoclm,icefl1, - & sotlmx,sotlmn,sotomx,sotomn,sotimx,sotimn, - & sotjmx,sotjmn,sotsmx,sotsmn,epssot, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!cwu [+8l] --------------------------------------------------------------- - call qcmxmn('sihc ',sihclm,sliclm,snoclm,icefl1, - & sihlmx,sihlmn,sihomx,sihomn,sihimx,sihimn, - & sihjmx,sihjmn,sihsmx,sihsmn,epssih, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('sicc ',sicclm,sliclm,snoclm,icefl1, - & siclmx,siclmn,sicomx,sicomn,sicimx,sicimn, - & sicjmx,sicjmn,sicsmx,sicsmn,epssic, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!clu [+16l] --------------------------------------------------------------- - call qcmxmn('vmnc ',vmnclm,sliclm,snoclm,icefl1, - & vmnlmx,vmnlmn,vmnomx,vmnomn,vmnimx,vmnimn, - & vmnjmx,vmnjmn,vmnsmx,vmnsmn,epsvmn, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('vmxc ',vmxclm,sliclm,snoclm,icefl1, - & vmxlmx,vmxlmn,vmxomx,vmxomn,vmximx,vmximn, - & vmxjmx,vmxjmn,vmxsmx,vmxsmn,epsvmx, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('slpc ',slpclm,sliclm,snoclm,icefl1, - & slplmx,slplmn,slpomx,slpomn,slpimx,slpimn, - & slpjmx,slpjmn,slpsmx,slpsmn,epsslp, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('absc ',absclm,sliclm,snoclm,icefl1, - & abslmx,abslmn,absomx,absomn,absimx,absimn, - & absjmx,absjmn,abssmx,abssmn,epsabs, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!clu ---------------------------------------------------------------------- -! -! monitoring prints -! - if (monclm) then - if (me .eq. 0) then - print *,' ' - print *,'monitor of time and space interpolated climatology' - print *,' ' -! call count(sliclm,snoclm,len) - print *,' ' - call monitr('tsfclm',tsfclm,sliclm,snoclm,len) - call monitr('albclm',albclm(1,1),sliclm,snoclm,len) - call monitr('albclm',albclm(1,2),sliclm,snoclm,len) - call monitr('albclm',albclm(1,3),sliclm,snoclm,len) - call monitr('albclm',albclm(1,4),sliclm,snoclm,len) - call monitr('aisclm',aisclm,sliclm,snoclm,len) - call monitr('snoclm',snoclm,sliclm,snoclm,len) - call monitr('scvclm',scvclm,sliclm,snoclm,len) - call monitr('smcclm1',smcclm(1,1),sliclm,snoclm,len) - call monitr('smcclm2',smcclm(1,2),sliclm,snoclm,len) - call monitr('stcclm1',stcclm(1,1),sliclm,snoclm,len) - call monitr('stcclm2',stcclm(1,2),sliclm,snoclm,len) -!clu [+4l] add smcclm(3:4) and stcclm(3:4) - if(lsoil.gt.2) then - call monitr('smcclm3',smcclm(1,3),sliclm,snoclm,len) - call monitr('smcclm4',smcclm(1,4),sliclm,snoclm,len) - call monitr('stcclm3',stcclm(1,3),sliclm,snoclm,len) - call monitr('stcclm4',stcclm(1,4),sliclm,snoclm,len) - endif - call monitr('tg3clm',tg3clm,sliclm,snoclm,len) - call monitr('zorclm',zorclm,sliclm,snoclm,len) -! if (gaus) then - call monitr('cvaclm',cvclm ,sliclm,snoclm,len) - call monitr('cvbclm',cvbclm,sliclm,snoclm,len) - call monitr('cvtclm',cvtclm,sliclm,snoclm,len) -! endif - call monitr('sliclm',sliclm,sliclm,snoclm,len) -! call monitr('plrclm',plrclm,sliclm,snoclm,len) - call monitr('orog ',orog ,sliclm,snoclm,len) - call monitr('vegclm',vegclm,sliclm,snoclm,len) - call monitr('vetclm',vetclm,sliclm,snoclm,len) - call monitr('sotclm',sotclm,sliclm,snoclm,len) -!cwu [+2l] add sih, sic - call monitr('sihclm',sihclm,sliclm,snoclm,len) - call monitr('sicclm',sicclm,sliclm,snoclm,len) -!clu [+4l] add vmn, vmx, slp, abs - call monitr('vmnclm',vmnclm,sliclm,snoclm,len) - call monitr('vmxclm',vmxclm,sliclm,snoclm,len) - call monitr('slpclm',slpclm,sliclm,snoclm,len) - call monitr('absclm',absclm,sliclm,snoclm,len) - endif - endif -! -! - if (me .eq. 0) then - write(6,*) '==============' - write(6,*) ' analysis' - write(6,*) '==============' - endif -! -! fill in analysis array with climatology before reading analysis. -! - call filanl(tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl,aisanl, - & tg3anl,cvanl ,cvbanl,cvtanl, - & cnpanl,smcanl,stcanl,slianl,scvanl,veganl, - & vetanl,sotanl,alfanl, - & sihanl,sicanl, - & vmnanl,vmxanl,slpanl,absanl, - & tsfclm,tsfcl2,wetclm,snoclm,zorclm,albclm,aisclm, - & tg3clm,cvclm ,cvbclm,cvtclm, - & cnpclm,smcclm,stcclm,sliclm,scvclm,vegclm, - & vetclm,sotclm,alfclm, - & sihclm,sicclm, - & vmnclm,vmxclm,slpclm,absclm, - & len,lsoil) -! -! reverse scaling to match with grib analysis input -! - zsca=0.01 - call scale(zoranl,len, zsca) - zsca=100. - call scale(albanl,len,zsca) - call scale(albanl(1,2),len,zsca) - call scale(albanl(1,3),len,zsca) - call scale(albanl(1,4),len,zsca) - call scale(alfanl,len,zsca) - call scale(alfanl(1,2),len,zsca) -!clu [+4l] reverse scale for vmn, vmx, abs - zsca=100. - call scale(vmnanl,len,zsca) - call scale(vmxanl,len,zsca) - call scale(absanl,len,zsca) -! - percrit=critp2 -! -! read analysis fields -! - call analy(lugb,iy,im,id,ih,fh,len,lsoil,slmask, - & fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, - & fntg3a,fnscva,fnsmca,fnstca,fnacna,fnvega, - & fnveta,fnsota, - & fnvmna,fnvmxa,fnslpa,fnabsa, - & tsfanl,wetanl,snoanl,zoranl,albanl,aisanl, - & tg3anl,cvanl ,cvbanl,cvtanl, - & smcanl,stcanl,slianl,scvanl,acnanl,veganl, - & vetanl,sotanl,alfanl,tsfan0, - & vmnanl,vmxanl,slpanl,absanl, - & kpdtsf,kpdwet,kpdsno,kpdsnd,kpdzor,kpdalb,kpdais, - & kpdtg3,kpdscv,kpdacn,kpdsmc,kpdstc,kpdveg, - & kpdvet,kpdsot,kpdalf, - & kpdvmn,kpdvmx,kpdslp,kpdabs, - & irttsf,irtwet,irtsno,irtzor,irtalb,irtais, - & irttg3,irtscv,irtacn,irtsmc,irtstc,irtveg, - & irtvet,irtsot,irtalf - &, irtvmn,irtvmx,irtslp,irtabs, - & imsk, jmsk, slmskh, rla, rlo, gausm, blnmsk, bltmsk - &, me, lanom) -! if(lprnt) print *,' tsfanl=',tsfanl(iprnt) -! -! scale zor and alb to match forecast model units -! - zsca=100. - call scale(zoranl,len, zsca) - zsca=0.01 - call scale(albanl,len,zsca) - call scale(albanl(1,2),len,zsca) - call scale(albanl(1,3),len,zsca) - call scale(albanl(1,4),len,zsca) - call scale(alfanl,len,zsca) - call scale(alfanl(1,2),len,zsca) -!clu [+4] scale vmn, vmx, abs from percent to fraction - zsca=0.01 - call scale(vmnanl,len,zsca) - call scale(vmxanl,len,zsca) - call scale(absanl,len,zsca) -! -! interpolate climatology but fixing initial anomaly -! - if(fh > 0.0 .and. fntsfa(1:8) /= ' ' .and. lanom) then - call anomint(tsfan0,tsfclm,tsfcl0,tsfanl,len) - endif -! -! if the tsfanl is at sea level, then bring it to the surface using -! unfiltered orography (for lakes). if the analysis is at lake surface -! as in the nst model, then this call should be removed - moorthi 09/23/2011 -! - if (use_ufo .and. .not. nst_anl) then - ztsfc = 0.0 - call tsfcor(tsfanl,orog_uf,slmask,ztsfc,len,rlapse) - endif -! -! ice concentration or ice mask (only ice mask used in the model now) -! - if(fnaisa(1:8).ne.' ') then -!cwu [+5l/-1l] update sihanl, sicanl - do i=1,len - sihanl(i) = 3.0*aisanl(i) - sicanl(i) = aisanl(i) - if(slmask(i).eq.0..and.glacir(i).eq.1..and. - & sicanl(i).ne.1.) then - sicanl(i) = sicimx - sihfcs(i) = glacir_hice - endif - enddo - crit=aislim -!* crit=0.5 - call rof01(aisanl,len,'ge',crit) - elseif(fnacna(1:8).ne.' ') then -!cwu [+17l] update sihanl, sicanl - do i=1,len - sihanl(i) = 3.0*acnanl(i) - sicanl(i) = acnanl(i) - if(slmask(i).eq.0..and.glacir(i).eq.1..and. - & sicanl(i).ne.1.) then - sicanl(i) = sicimx - sihfcs(i) = glacir_hice - endif - enddo - crit=aislim - do i=1,len - if((slianl(i).eq.0.).and.(sicanl(i).ge.crit)) then - slianl(i)=2. -! print *,'cycle - new ice form: fice=',sicanl(i) - else if((slianl(i).ge.2.).and.(sicanl(i).lt.crit)) then - slianl(i)=0. -! print *,'cycle - ice free: fice=',sicanl(i) - else if((slianl(i).eq.1.).and.(sicanl(i).ge.sicimn)) then -! print *,'cycle - land covered by sea-ice: fice=',sicanl(i) - sicanl(i)=0. - endif - enddo -! znnt=10. -! call nntprt(acnanl,len,znnt) -! if(lprnt) print *,' acnanl=',acnanl(iprnt) -! do i=1,len -! if (acnanl(i) .gt. 0.3 .and. aisclm(i) .eq. 1.0 -! & .and. aisfcs(i) .ge. 0.75) acnanl(i) = aislim -! enddo -! if(lprnt) print *,' acnanl=',acnanl(iprnt) - call rof01(acnanl,len,'ge',aislim) - do i=1,len - aisanl(i)=acnanl(i) - enddo - endif -! if(lprnt) print *,' aisanl1=',aisanl(iprnt),' glacir=' -! &,glacir(iprnt),' slmask=',slmask(iprnt) -! - call qcsice(aisanl,glacir,amxice,aicice,aicsea,sllnd,slmask, - & rla,rlo,len,me) -! -! set ocean/land/sea-ice mask -! - call setlsi(slmask,aisanl,len,aicice,slianl) -! if(lprnt) print *,' aisanl=',aisanl(iprnt),' slianl=' -! *,slianl(iprnt),' slmask=',slmask(iprnt) -! -! - do k=1,lsoil - do i=1,len - if (slianl(i) .eq. 0) then - smcanl(i,k) = smcomx - stcanl(i,k) = tsfanl(i) - endif - enddo - enddo - -! write(6,*) 'slianl' -! znnt=1. -! call nntprt(slianl,len,znnt) -!cwu [+8l]---------------------------------------------------------------------- - call qcmxmn('siha ',sihanl,slianl,snoanl,icefl1, - & sihlmx,sihlmn,sihomx,sihomn,sihimx,sihimn, - & sihjmx,sihjmn,sihsmx,sihsmn,epssih, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('sica ',sicanl,slianl,snoanl,icefl1, - & siclmx,siclmn,sicomx,sicomn,sicimx,sicimn, - & sicjmx,sicjmn,sicsmx,sicsmn,epssic, - & rla,rlo,len,kqcm,percrit,lgchek,me) -! -! set albedo over ocean to albomx -! - call albocn(albanl,slmask,albomx,len) -! -! quality control of snow and sea-ice -! process snow depth or snow cover -! - if(fnsnoa(1:8).ne.' ') then - call setzro(snoanl,epssno,len) - call qcsnow(snoanl,slmask,aisanl,glacir,len,ten,landice,me) - if (.not.landice) then - call snodpth2(glacir,snosmx,snoanl, len, me) - endif - kqcm=1 - call snosfc(snoanl,tsfanl,tsfsmx,len,me) - call qcmxmn('snoa ',snoanl,slianl,snoanl,icefl1, - & snolmx,snolmn,snoomx,snoomn,snoimx,snoimn, - & snojmx,snojmn,snosmx,snosmn,epssno, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call getscv(snoanl,scvanl,len) - call qcmxmn('sncva ',scvanl,slianl,snoanl,icefl1, - & scvlmx,scvlmn,scvomx,scvomn,scvimx,scvimn, - & scvjmx,scvjmn,scvsmx,scvsmn,epsscv, - & rla,rlo,len,kqcm,percrit,lgchek,me) - else - crit=0.5 - call rof01(scvanl,len,'ge',crit) - call qcsnow(scvanl,slmask,aisanl,glacir,len,one,landice,me) - call qcmxmn('sncva ',scvanl,slianl,scvanl,icefl1, - & scvlmx,scvlmn,scvomx,scvomn,scvimx,scvimn, - & scvjmx,scvjmn,scvsmx,scvsmn,epsscv, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call snodpth(scvanl,slianl,tsfanl,snoclm, - & glacir,snwmax,snwmin,landice,len,snoanl,me) - call qcsnow(scvanl,slmask,aisanl,glacir,len,snosmx,landice,me) - call snosfc(snoanl,tsfanl,tsfsmx,len,me) - call qcmxmn('snowa ',snoanl,slianl,snoanl,icefl1, - & snolmx,snolmn,snoomx,snoomn,snoimx,snoimn, - & snojmx,snojmn,snosmx,snosmn,epssno, - & rla,rlo,len,kqcm,percrit,lgchek,me) - endif -! - do i=1,len - icefl2(i) = sicanl(i) .gt. 0.99999 - enddo - call qcmxmn('tsfa ',tsfanl,slianl,snoanl,icefl2, - & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn, - & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf, - & rla,rlo,len,kqcm,percrit,lgchek,me) - do kk = 1, 4 - call qcmxmn('alba ',albanl(1,kk),slianl,snoanl,icefl1, - & alblmx,alblmn,albomx,albomn,albimx,albimn, - & albjmx,albjmn,albsmx,albsmn,epsalb, - & rla,rlo,len,kqcm,percrit,lgchek,me) - enddo - if(fnwetc(1:8).ne.' ' .or. fnweta(1:8).ne.' ' ) then - call qcmxmn('weta ',wetanl,slianl,snoanl,icefl1, - & wetlmx,wetlmn,wetomx,wetomn,wetimx,wetimn, - & wetjmx,wetjmn,wetsmx,wetsmn,epswet, - & rla,rlo,len,kqcm,percrit,lgchek,me) - endif - call qcmxmn('zora ',zoranl,slianl,snoanl,icefl1, - & zorlmx,zorlmn,zoromx,zoromn,zorimx,zorimn, - & zorjmx,zorjmn,zorsmx,zorsmn,epszor, - & rla,rlo,len,kqcm,percrit,lgchek,me) -! if(fnplrc(1:8).ne.' ' .or. fnplra(1:8).ne.' ' ) then -! call qcmxmn('plna ',plranl,slianl,snoanl,icefl1, -! & plrlmx,plrlmn,plromx,plromn,plrimx,plrimn, -! & plrjmx,plrjmn,plrsmx,plrsmn,epsplr, -! & rla,rlo,len,kqcm,percrit,lgchek,me) -! endif - call qcmxmn('tg3a ',tg3anl,slianl,snoanl,icefl1, - & tg3lmx,tg3lmn,tg3omx,tg3omn,tg3imx,tg3imn, - & tg3jmx,tg3jmn,tg3smx,tg3smn,epstg3, - & rla,rlo,len,kqcm,percrit,lgchek,me) -! -! get soil temp and moisture -! - if(fnsmca(1:8).eq.' ' .and. fnsmcc(1:8).eq.' ') then - call getsmc(wetanl,len,lsoil,smcanl,me) - endif - call qcmxmn('smc1a ',smcanl(1,1),slianl,snoanl,icefl1, - & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, - & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('smc2a ',smcanl(1,2),slianl,snoanl,icefl1, - & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, - & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!clu [+8l] add smcanl(3:4) - if(lsoil.gt.2) then - call qcmxmn('smc3a ',smcanl(1,3),slianl,snoanl,icefl1, - & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, - & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('smc4a ',smcanl(1,4),slianl,snoanl,icefl1, - & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, - & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - endif - if(fnstca(1:8).eq.' ') then - call getstc(tsfanl,tg3anl,slianl,len,lsoil,stcanl,tsfimx) - endif - call qcmxmn('stc1a ',stcanl(1,1),slianl,snoanl,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('stc2a ',stcanl(1,2),slianl,snoanl,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!clu [+8l] add stcanl(3:4) - if(lsoil.gt.2) then - call qcmxmn('stc3a ',stcanl(1,3),slianl,snoanl,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('stc4a ',stcanl(1,4),slianl,snoanl,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - endif - call qcmxmn('vega ',veganl,slianl,snoanl,icefl1, - & veglmx,veglmn,vegomx,vegomn,vegimx,vegimn, - & vegjmx,vegjmn,vegsmx,vegsmn,epsveg, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('veta ',vetanl,slianl,snoanl,icefl1, - & vetlmx,vetlmn,vetomx,vetomn,vetimx,vetimn, - & vetjmx,vetjmn,vetsmx,vetsmn,epsvet, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('sota ',sotanl,slianl,snoanl,icefl1, - & sotlmx,sotlmn,sotomx,sotomn,sotimx,sotimn, - & sotjmx,sotjmn,sotsmx,sotsmn,epssot, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!clu [+16l]---------------------------------------------------------------------- - call qcmxmn('vmna ',vmnanl,slianl,snoanl,icefl1, - & vmnlmx,vmnlmn,vmnomx,vmnomn,vmnimx,vmnimn, - & vmnjmx,vmnjmn,vmnsmx,vmnsmn,epsvmn, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('vmxa ',vmxanl,slianl,snoanl,icefl1, - & vmxlmx,vmxlmn,vmxomx,vmxomn,vmximx,vmximn, - & vmxjmx,vmxjmn,vmxsmx,vmxsmn,epsvmx, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('slpa ',slpanl,slianl,snoanl,icefl1, - & slplmx,slplmn,slpomx,slpomn,slpimx,slpimn, - & slpjmx,slpjmn,slpsmx,slpsmn,epsslp, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('absa ',absanl,slianl,snoanl,icefl1, - & abslmx,abslmn,absomx,absomn,absimx,absimn, - & absjmx,absjmn,abssmx,abssmn,epsabs, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!clu ---------------------------------------------------------------------------- -! -! monitoring prints -! - if (monanl) then - if (me .eq. 0) then - print *,' ' - print *,'monitor of time and space interpolated analysis' - print *,' ' -! call count(slianl,snoanl,len) - print *,' ' - call monitr('tsfanl',tsfanl,slianl,snoanl,len) - call monitr('albanl',albanl,slianl,snoanl,len) - call monitr('aisanl',aisanl,slianl,snoanl,len) - call monitr('snoanl',snoanl,slianl,snoanl,len) - call monitr('scvanl',scvanl,slianl,snoanl,len) - call monitr('smcanl1',smcanl(1,1),slianl,snoanl,len) - call monitr('smcanl2',smcanl(1,2),slianl,snoanl,len) - call monitr('stcanl1',stcanl(1,1),slianl,snoanl,len) - call monitr('stcanl2',stcanl(1,2),slianl,snoanl,len) -!clu [+4l] add smcanl(3:4) and stcanl(3:4) - if(lsoil.gt.2) then - call monitr('smcanl3',smcanl(1,3),slianl,snoanl,len) - call monitr('smcanl4',smcanl(1,4),slianl,snoanl,len) - call monitr('stcanl3',stcanl(1,3),slianl,snoanl,len) - call monitr('stcanl4',stcanl(1,4),slianl,snoanl,len) - endif - call monitr('tg3anl',tg3anl,slianl,snoanl,len) - call monitr('zoranl',zoranl,slianl,snoanl,len) -! if (gaus) then - call monitr('cvaanl',cvanl ,slianl,snoanl,len) - call monitr('cvbanl',cvbanl,slianl,snoanl,len) - call monitr('cvtanl',cvtanl,slianl,snoanl,len) -! endif - call monitr('slianl',slianl,slianl,snoanl,len) -! call monitr('plranl',plranl,slianl,snoanl,len) - call monitr('orog ',orog ,slianl,snoanl,len) - call monitr('veganl',veganl,slianl,snoanl,len) - call monitr('vetanl',vetanl,slianl,snoanl,len) - call monitr('sotanl',sotanl,slianl,snoanl,len) -!cwu [+2l] add sih, sic - call monitr('sihanl',sihanl,slianl,snoanl,len) - call monitr('sicanl',sicanl,slianl,snoanl,len) -!clu [+4l] add vmn, vmx, slp, abs - call monitr('vmnanl',vmnanl,slianl,snoanl,len) - call monitr('vmxanl',vmxanl,slianl,snoanl,len) - call monitr('slpanl',slpanl,slianl,snoanl,len) - call monitr('absanl',absanl,slianl,snoanl,len) - endif - - endif -! -! read in forecast fields if needed -! - if (me .eq. 0) then - write(6,*) '==============' - write(6,*) ' fcst guess' - write(6,*) '==============' - endif -! - percrit=critp2 -! - if(deads) then -! -! fill in guess array with analysis if dead start. -! - percrit=critp3 - if (me .eq. 0) write(6,*) 'this run is dead start run' - call filfcs(tsffcs,wetfcs,snofcs,zorfcs,albfcs, - & tg3fcs,cvfcs ,cvbfcs,cvtfcs, - & cnpfcs,smcfcs,stcfcs,slifcs,aisfcs, - & vegfcs,vetfcs,sotfcs,alffcs, -!cwu [+1l] add ()fcs for sih, sic - & sihfcs,sicfcs, -!clu [+1l] add ()fcs for vmn, vmx, slp, abs - & vmnfcs,vmxfcs,slpfcs,absfcs, - & tsfanl,wetanl,snoanl,zoranl,albanl, - & tg3anl,cvanl ,cvbanl,cvtanl, - & cnpanl,smcanl,stcanl,slianl,aisanl, - & veganl,vetanl,sotanl,alfanl, -!cwu [+1l] add ()anl for sih, sic - & sihanl,sicanl, -!clu [+1l] add ()anl for vmn, vmx, slp, abs - & vmnanl,vmxanl,slpanl,absanl, - & len,lsoil) - if(sig1t(1).ne.0.) then - call usesgt(sig1t,slianl,tg3anl,len,lsoil,tsffcs,stcfcs, - & tsfimx) - do i=1,len - icefl2(i) = sicfcs(i) .gt. 0.99999 - enddo - kqcm=1 - call qcmxmn('tsff ',tsffcs,slifcs,snofcs,icefl2, - & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn, - & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('stc1f ',stcfcs(1,1),slifcs,snofcs,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('stc2f ',stcfcs(1,2),slifcs,snofcs,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - endif - else - percrit=critp2 -! -! make reverse angulation correction to tsf -! make reverse orography correction to tg3 -! - if (use_ufo) then - orogd = orog - orog_uf -! -! The tiled version of the substrate temperature is properly -! adjusted to the terrain. Only invoke when using the old -! global tg3 grib file. -! - if ( index(fntg3c, "tileX.nc") == 0) then ! global file - ztsfc = 1.0 - call tsfcor(tg3fcs,orogd,slmask,ztsfc,len,-rlapse) - endif - ztsfc = 0. - call tsfcor(tsffcs,orogd,slmask,ztsfc,len,-rlapse) - else - ztsfc = 0. - call tsfcor(tsffcs,orog,slmask,ztsfc,len,-rlapse) - endif - -!clu [+12l] -------------------------------------------------------------- -! -! compute soil moisture liquid-to-total ratio over land -! - do j=1, lsoil - do i=1, len - if(smcfcs(i,j) .ne. 0.) then - swratio(i,j) = slcfcs(i,j)/smcfcs(i,j) - else - swratio(i,j) = -999. - endif - enddo - enddo -!clu ----------------------------------------------------------------------- -! - if(lqcbgs .and. irtacn .eq. 0) then - call qcsli(slianl,slifcs,len,me) - call albocn(albfcs,slmask,albomx,len) - do i=1,len - icefl2(i) = sicfcs(i) .gt. 0.99999 - enddo - kqcm=1 - call qcmxmn('snof ',snofcs,slifcs,snofcs,icefl1, - & snolmx,snolmn,snoomx,snoomn,snoimx,snoimn, - & snojmx,snojmn,snosmx,snosmn,epssno, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('tsff ',tsffcs,slifcs,snofcs,icefl2, - & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn, - & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf, - & rla,rlo,len,kqcm,percrit,lgchek,me) - do kk = 1, 4 - call qcmxmn('albf ',albfcs(1,kk),slifcs,snofcs,icefl1, - & alblmx,alblmn,albomx,albomn,albimx,albimn, - & albjmx,albjmn,albsmx,albsmn,epsalb, - & rla,rlo,len,kqcm,percrit,lgchek,me) - enddo - if(fnwetc(1:8).ne.' ' .or. fnweta(1:8).ne.' ' ) - & then - call qcmxmn('wetf ',wetfcs,slifcs,snofcs,icefl1, - & wetlmx,wetlmn,wetomx,wetomn,wetimx,wetimn, - & wetjmx,wetjmn,wetsmx,wetsmn,epswet, - & rla,rlo,len,kqcm,percrit,lgchek,me) - endif - call qcmxmn('zorf ',zorfcs,slifcs,snofcs,icefl1, - & zorlmx,zorlmn,zoromx,zoromn,zorimx,zorimn, - & zorjmx,zorjmn,zorsmx,zorsmn,epszor, - & rla,rlo,len,kqcm,percrit,lgchek,me) -! if(fnplrc(1:8).ne.' ' .or. fnplra(1:8).ne.' ' ) -! call qcmxmn('plnf ',plrfcs,slifcs,snofcs,icefl1, -! & plrlmx,plrlmn,plromx,plromn,plrimx,plrimn, -! & plrjmx,plrjmn,plrsmx,plrsmn,epsplr, -! & rla,rlo,len,kqcm,percrit,lgchek,me) -! endif - call qcmxmn('tg3f ',tg3fcs,slifcs,snofcs,icefl1, - & tg3lmx,tg3lmn,tg3omx,tg3omn,tg3imx,tg3imn, - & tg3jmx,tg3jmn,tg3smx,tg3smn,epstg3, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!cwu [+8l] --------------------------------------------------------------- - call qcmxmn('sihf ',sihfcs,slifcs,snofcs,icefl1, - & sihlmx,sihlmn,sihomx,sihomn,sihimx,sihimn, - & sihjmx,sihjmn,sihsmx,sihsmn,epssih, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('sicf ',sicfcs,slifcs,snofcs,icefl1, - & siclmx,siclmn,sicomx,sicomn,sicimx,sicimn, - & sicjmx,sicjmn,sicsmx,sicsmn,epssic, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('smc1f ',smcfcs(1,1),slifcs,snofcs,icefl1, - & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, - & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('smc2f ',smcfcs(1,2),slifcs,snofcs,icefl1, - & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, - & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!clu [+8l] add smcfcs(3:4) - if(lsoil.gt.2) then - call qcmxmn('smc3f ',smcfcs(1,3),slifcs,snofcs,icefl1, - & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, - & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('smc4f ',smcfcs(1,4),slifcs,snofcs,icefl1, - & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, - & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - endif - call qcmxmn('stc1f ',stcfcs(1,1),slifcs,snofcs,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('stc2f ',stcfcs(1,2),slifcs,snofcs,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!clu [+8l] add stcfcs(3:4) - if(lsoil.gt.2) then - call qcmxmn('stc3f ',stcfcs(1,3),slifcs,snofcs,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('stc4f ',stcfcs(1,4),slifcs,snofcs,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - endif - call qcmxmn('vegf ',vegfcs,slifcs,snofcs,icefl1, - & veglmx,veglmn,vegomx,vegomn,vegimx,vegimn, - & vegjmx,vegjmn,vegsmx,vegsmn,epsveg, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('vetf ',vetfcs,slifcs,snofcs,icefl1, - & vetlmx,vetlmn,vetomx,vetomn,vetimx,vetimn, - & vetjmx,vetjmn,vetsmx,vetsmn,epsvet, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('sotf ',sotfcs,slifcs,snofcs,icefl1, - & sotlmx,sotlmn,sotomx,sotomn,sotimx,sotimn, - & sotjmx,sotjmn,sotsmx,sotsmn,epssot, - & rla,rlo,len,kqcm,percrit,lgchek,me) - -!clu [+16l] --------------------------------------------------------------- - call qcmxmn('vmnf ',vmnfcs,slifcs,snofcs,icefl1, - & vmnlmx,vmnlmn,vmnomx,vmnomn,vmnimx,vmnimn, - & vmnjmx,vmnjmn,vmnsmx,vmnsmn,epsvmn, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('vmxf ',vmxfcs,slifcs,snofcs,icefl1, - & vmxlmx,vmxlmn,vmxomx,vmxomn,vmximx,vmximn, - & vmxjmx,vmxjmn,vmxsmx,vmxsmn,epsvmx, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('slpf ',slpfcs,slifcs,snofcs,icefl1, - & slplmx,slplmn,slpomx,slpomn,slpimx,slpimn, - & slpjmx,slpjmn,slpsmx,slpsmn,epsslp, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('absf ',absfcs,slifcs,snofcs,icefl1, - & abslmx,abslmn,absomx,absomn,absimx,absimn, - & absjmx,absjmn,abssmx,abssmn,epsabs, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!clu ----------------------------------------------------------------------- - endif - endif -! - if (monfcs) then - if (me .eq. 0) then - print *,' ' - print *,'monitor of guess' - print *,' ' -! call count(slifcs,snofcs,len) - print *,' ' - call monitr('tsffcs',tsffcs,slifcs,snofcs,len) - call monitr('albfcs',albfcs,slifcs,snofcs,len) - call monitr('aisfcs',aisfcs,slifcs,snofcs,len) - call monitr('snofcs',snofcs,slifcs,snofcs,len) - call monitr('smcfcs1',smcfcs(1,1),slifcs,snofcs,len) - call monitr('smcfcs2',smcfcs(1,2),slifcs,snofcs,len) - call monitr('stcfcs1',stcfcs(1,1),slifcs,snofcs,len) - call monitr('stcfcs2',stcfcs(1,2),slifcs,snofcs,len) -!clu [+4l] add smcfcs(3:4) and stcfcs(3:4) - if(lsoil.gt.2) then - call monitr('smcfcs3',smcfcs(1,3),slifcs,snofcs,len) - call monitr('smcfcs4',smcfcs(1,4),slifcs,snofcs,len) - call monitr('stcfcs3',stcfcs(1,3),slifcs,snofcs,len) - call monitr('stcfcs4',stcfcs(1,4),slifcs,snofcs,len) - endif - call monitr('tg3fcs',tg3fcs,slifcs,snofcs,len) - call monitr('zorfcs',zorfcs,slifcs,snofcs,len) -! if (gaus) then - call monitr('cvafcs',cvfcs ,slifcs,snofcs,len) - call monitr('cvbfcs',cvbfcs,slifcs,snofcs,len) - call monitr('cvtfcs',cvtfcs,slifcs,snofcs,len) -! endif - call monitr('slifcs',slifcs,slifcs,snofcs,len) -! call monitr('plrfcs',plrfcs,slifcs,snofcs,len) - call monitr('orog ',orog ,slifcs,snofcs,len) - call monitr('vegfcs',vegfcs,slifcs,snofcs,len) - call monitr('vetfcs',vetfcs,slifcs,snofcs,len) - call monitr('sotfcs',sotfcs,slifcs,snofcs,len) -!cwu [+2l] add sih, sic - call monitr('sihfcs',sihfcs,slifcs,snofcs,len) - call monitr('sicfcs',sicfcs,slifcs,snofcs,len) -!clu [+4l] add vmn, vmx, slp, abs - call monitr('vmnfcs',vmnfcs,slifcs,snofcs,len) - call monitr('vmxfcs',vmxfcs,slifcs,snofcs,len) - call monitr('slpfcs',slpfcs,slifcs,snofcs,len) - call monitr('absfcs',absfcs,slifcs,snofcs,len) - endif - endif -! -!... update annual cycle in the sst guess.. -! -! if(lprnt) print *,'tsfclm=',tsfclm(iprnt),' tsfcl2=',tsfcl2(iprnt) -! *,' tsffcs=',tsffcs(iprnt),' slianl=',slianl(iprnt) - - if (fh-deltsfc > -0.001 ) then - do i=1,len - if(slianl(i) == 0.0) then - tsffcs(i) = tsffcs(i) + (tsfclm(i) - tsfcl2(i)) - endif - enddo - endif -! -! quality control analysis using forecast guess -! - call qcbyfc(tsffcs,snofcs,qctsfs,qcsnos,qctsfi,len,lsoil, - & snoanl,aisanl,slianl,tsfanl,albanl, - & zoranl,smcanl, - & smcclm,tsfsmx,albomx,zoromx,me) -! -! blend climatology and predicted fields -! - if(me .eq. 0) then - write(6,*) '==============' - write(6,*) ' merging' - write(6,*) '==============' - endif -! if(lprnt) print *,' tsffcs=',tsffcs(iprnt) -! - percrit=critp3 -! -! merge analysis and forecast. note tg3, ais are not merged -! - call merge(len,lsoil,iy,im,id,ih,fh,deltsfc, - & sihfcs,sicfcs, - & vmnfcs,vmxfcs,slpfcs,absfcs, - & tsffcs,wetfcs,snofcs,zorfcs,albfcs,aisfcs, - & cvfcs ,cvbfcs,cvtfcs, - & cnpfcs,smcfcs,stcfcs,slifcs,vegfcs, - & vetfcs,sotfcs,alffcs, - & sihanl,sicanl, - & vmnanl,vmxanl,slpanl,absanl, - & tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl,aisanl, - & cvanl ,cvbanl,cvtanl, - & cnpanl,smcanl,stcanl,slianl,veganl, - & vetanl,sotanl,alfanl, - & ctsfl,calbl,caisl,csnol,csmcl,czorl,cstcl,cvegl, - & ctsfs,calbs,caiss,csnos,csmcs,czors,cstcs,cvegs, - & ccv,ccvb,ccvt,ccnp,cvetl,cvets,csotl,csots, - & calfl,calfs, - & csihl,csihs,csicl,csics, - & cvmnl,cvmns,cvmxl,cvmxs,cslpl,cslps,cabsl,cabss, - & irttsf,irtwet,irtsno,irtzor,irtalb,irtais, - & irttg3,irtscv,irtacn,irtsmc,irtstc,irtveg, - & irtvmn,irtvmx,irtslp,irtabs, - & irtvet,irtsot,irtalf,landice,me) - - call setzro(snoanl,epssno,len) - -! if(lprnt) print *,' tanlm=',tsfanl(iprnt),' tfcsm=',tsffcs(iprnt) -! if(lprnt) print *,' sliam=',slianl(iprnt),' slifm=',slifcs(iprnt) - -! -! new ice/melted ice -! - call newice(slianl,slifcs,tsfanl,tsffcs,len,lsoil, -!cwu [+1l] add sihnew, aislim, sihanl & sicanl - & sihnew,aislim,sihanl,sicanl, - & albanl,snoanl,zoranl,smcanl,stcanl, - & albomx,snoomx,zoromx,smcomx,smcimx, -!cwu [-1l/+1l] change albimx to albimn - note albimx & albimn have been modified -! & tsfomn,tsfimx,albimx,zorimx,tgice, - & tsfomn,tsfimx,albimn,zorimx,tgice, - & rla,rlo,me) - -! if(lprnt) print *,'tsfanl=',tsfanl(iprnt),' tsffcs=',tsffcs(iprnt) -! if(lprnt) print *,' slian=',slianl(iprnt),' slifn=',slifcs(iprnt) -! -! set tsfc to tsnow over snow -! - call snosfc(snoanl,tsfanl,tsfsmx,len,me) -! - do i=1,len - icefl2(i) = sicanl(i) .gt. 0.99999 - enddo - kqcm=0 - call qcmxmn('snowm ',snoanl,slianl,snoanl,icefl1, - & snolmx,snolmn,snoomx,snoomn,snoimx,snoimn, - & snojmx,snojmn,snosmx,snosmn,epssno, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('tsfm ',tsfanl,slianl,snoanl,icefl2, - & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn, - & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf, - & rla,rlo,len,kqcm,percrit,lgchek,me) - do kk = 1, 4 - call qcmxmn('albm ',albanl(1,kk),slianl,snoanl,icefl1, - & alblmx,alblmn,albomx,albomn,albimx,albimn, - & albjmx,albjmn,albsmx,albsmn,epsalb, - & rla,rlo,len,kqcm,percrit,lgchek,me) - enddo - if(fnwetc(1:8).ne.' ' .or. fnweta(1:8).ne.' ' ) - & then - call qcmxmn('wetm ',wetanl,slianl,snoanl,icefl1, - & wetlmx,wetlmn,wetomx,wetomn,wetimx,wetimn, - & wetjmx,wetjmn,wetsmx,wetsmn,epswet, - & rla,rlo,len,kqcm,percrit,lgchek,me) - endif - call qcmxmn('zorm ',zoranl,slianl,snoanl,icefl1, - & zorlmx,zorlmn,zoromx,zoromn,zorimx,zorimn, - & zorjmx,zorjmn,zorsmx,zorsmn,epszor, - & rla,rlo,len,kqcm,percrit,lgchek,me) -! if(fnplrc(1:8).ne.' ' .or. fnplra(1:8).ne.' ' ) -! & then -! call qcmxmn('plntm ',plranl,slianl,snoanl,icefl1, -! & plrlmx,plrlmn,plromx,plromn,plrimx,plrimn, -! & plrjmx,plrjmn,plrsmx,plrsmn,epsplr, -! & rla,rlo,len,kqcm,percrit,lgchek,me) -! endif - call qcmxmn('stc1m ',stcanl(1,1),slianl,snoanl,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('stc2m ',stcanl(1,2),slianl,snoanl,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!clu [+8l] add stcanl(3:4) - if(lsoil.gt.2) then - call qcmxmn('stc3m ',stcanl(1,3),slianl,snoanl,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('stc4m ',stcanl(1,4),slianl,snoanl,icefl1, - & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, - & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - endif - call qcmxmn('smc1m ',smcanl(1,1),slianl,snoanl,icefl1, - & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, - & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('smc2m ',smcanl(1,2),slianl,snoanl,icefl1, - & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, - & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!clu [+8l] add smcanl(3:4) - if(lsoil.gt.2) then - call qcmxmn('smc3m ',smcanl(1,3),slianl,snoanl,icefl1, - & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, - & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('smc4m ',smcanl(1,4),slianl,snoanl,icefl1, - & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, - & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, - & rla,rlo,len,kqcm,percrit,lgchek,me) - endif - kqcm=1 - call qcmxmn('vegm ',veganl,slianl,snoanl,icefl1, - & veglmx,veglmn,vegomx,vegomn,vegimx,vegimn, - & vegjmx,vegjmn,vegsmx,vegsmn,epsveg, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('vetm ',vetanl,slianl,snoanl,icefl1, - & vetlmx,vetlmn,vetomx,vetomn,vetimx,vetimn, - & vetjmx,vetjmn,vetsmx,vetsmn,epsvet, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('sotm ',sotanl,slianl,snoanl,icefl1, - & sotlmx,sotlmn,sotomx,sotomn,sotimx,sotimn, - & sotjmx,sotjmn,sotsmx,sotsmn,epssot, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!cwu [+8l] add sih, sic, - call qcmxmn('sihm ',sihanl,slianl,snoanl,icefl1, - & sihlmx,sihlmn,sihomx,sihomn,sihimx,sihimn, - & sihjmx,sihjmn,sihsmx,sihsmn,epssih, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('sicm ',sicanl,slianl,snoanl,icefl1, - & siclmx,siclmn,sicomx,sicomn,sicimx,sicimn, - & sicjmx,sicjmn,sicsmx,sicsmn,epssic, - & rla,rlo,len,kqcm,percrit,lgchek,me) -!clu [+16l] add vmn, vmx, slp, abs - call qcmxmn('vmnm ',vmnanl,slianl,snoanl,icefl1, - & vmnlmx,vmnlmn,vmnomx,vmnomn,vmnimx,vmnimn, - & vmnjmx,vmnjmn,vmnsmx,vmnsmn,epsvmn, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('vmxm ',vmxanl,slianl,snoanl,icefl1, - & vmxlmx,vmxlmn,vmxomx,vmxomn,vmximx,vmximn, - & vmxjmx,vmxjmn,vmxsmx,vmxsmn,epsvmx, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('slpm ',slpanl,slianl,snoanl,icefl1, - & slplmx,slplmn,slpomx,slpomn,slpimx,slpimn, - & slpjmx,slpjmn,slpsmx,slpsmn,epsslp, - & rla,rlo,len,kqcm,percrit,lgchek,me) - call qcmxmn('absm ',absanl,slianl,snoanl,icefl1, - & abslmx,abslmn,absomx,absomn,absimx,absimn, - & absjmx,absjmn,abssmx,abssmn,epsabs, - & rla,rlo,len,kqcm,percrit,lgchek,me) - -! - if(me .eq. 0) then - write(6,*) '==============' - write(6,*) 'final results' - write(6,*) '==============' - endif -! -! foreward correction to tg3 and tsf at the last stage -! -! if(lprnt) print *,' tsfbc=',tsfanl(iprnt) - if (use_ufo) then -! -! The tiled version of the substrate temperature is properly -! adjusted to the terrain. Only invoke when using the old -! global tg3 grib file. -! - if ( index(fntg3c, "tileX.nc") == 0) then ! global file - ztsfc = 1. - call tsfcor(tg3anl,orogd,slmask,ztsfc,len,rlapse) - endif - ztsfc = 0. - call tsfcor(tsfanl,orogd,slmask,ztsfc,len,rlapse) - else - ztsfc = 0. - call tsfcor(tsfanl,orog,slmask,ztsfc,len,rlapse) - endif -! if(lprnt) print *,' tsfaf=',tsfanl(iprnt) -! -! check the final merged product -! - if (monmer) then - if(me .eq. 0) then - print *,' ' - print *,'monitor of updated surface fields' - print *,' (includes angulation correction)' - print *,' ' -! call count(slianl,snoanl,len) - print *,' ' - call monitr('tsfanl',tsfanl,slianl,snoanl,len) - call monitr('albanl',albanl,slianl,snoanl,len) - call monitr('aisanl',aisanl,slianl,snoanl,len) - call monitr('snoanl',snoanl,slianl,snoanl,len) - call monitr('smcanl1',smcanl(1,1),slianl,snoanl,len) - call monitr('smcanl2',smcanl(1,2),slianl,snoanl,len) - call monitr('stcanl1',stcanl(1,1),slianl,snoanl,len) - call monitr('stcanl2',stcanl(1,2),slianl,snoanl,len) -!clu [+4l] add smcanl(3:4) and stcanl(3:4) - if(lsoil.gt.2) then - call monitr('smcanl3',smcanl(1,3),slianl,snoanl,len) - call monitr('smcanl4',smcanl(1,4),slianl,snoanl,len) - call monitr('stcanl3',stcanl(1,3),slianl,snoanl,len) - call monitr('stcanl4',stcanl(1,4),slianl,snoanl,len) - call monitr('tg3anl',tg3anl,slianl,snoanl,len) - call monitr('zoranl',zoranl,slianl,snoanl,len) - endif -! if (gaus) then - call monitr('cvaanl',cvanl ,slianl,snoanl,len) - call monitr('cvbanl',cvbanl,slianl,snoanl,len) - call monitr('cvtanl',cvtanl,slianl,snoanl,len) -! endif - call monitr('slianl',slianl,slianl,snoanl,len) -! call monitr('plranl',plranl,slianl,snoanl,len) - call monitr('orog ',orog ,slianl,snoanl,len) - call monitr('cnpanl',cnpanl,slianl,snoanl,len) - call monitr('veganl',veganl,slianl,snoanl,len) - call monitr('vetanl',vetanl,slianl,snoanl,len) - call monitr('sotanl',sotanl,slianl,snoanl,len) -!cwu [+2l] add sih, sic, - call monitr('sihanl',sihanl,slianl,snoanl,len) - call monitr('sicanl',sicanl,slianl,snoanl,len) -!clu [+4l] add vmn, vmx, slp, abs - call monitr('vmnanl',vmnanl,slianl,snoanl,len) - call monitr('vmxanl',vmxanl,slianl,snoanl,len) - call monitr('slpanl',slpanl,slianl,snoanl,len) - call monitr('absanl',absanl,slianl,snoanl,len) - endif - endif -! - if (mondif) then - do i=1,len - tsffcs(i) = tsfanl(i) - tsffcs(i) - snofcs(i) = snoanl(i) - snofcs(i) - tg3fcs(i) = tg3anl(i) - tg3fcs(i) - zorfcs(i) = zoranl(i) - zorfcs(i) -! plrfcs(i) = plranl(i) - plrfcs(i) -! albfcs(i) = albanl(i) - albfcs(i) - slifcs(i) = slianl(i) - slifcs(i) - aisfcs(i) = aisanl(i) - aisfcs(i) - cnpfcs(i) = cnpanl(i) - cnpfcs(i) - vegfcs(i) = veganl(i) - vegfcs(i) - vetfcs(i) = vetanl(i) - vetfcs(i) - sotfcs(i) = sotanl(i) - sotfcs(i) -!clu [+2l] add sih, sic - sihfcs(i) = sihanl(i) - sihfcs(i) - sicfcs(i) = sicanl(i) - sicfcs(i) -!clu [+4l] add vmn, vmx, slp, abs - vmnfcs(i) = vmnanl(i) - vmnfcs(i) - vmxfcs(i) = vmxanl(i) - vmxfcs(i) - slpfcs(i) = slpanl(i) - slpfcs(i) - absfcs(i) = absanl(i) - absfcs(i) - enddo - do j = 1,lsoil - do i = 1,len - smcfcs(i,j) = smcanl(i,j) - smcfcs(i,j) - stcfcs(i,j) = stcanl(i,j) - stcfcs(i,j) - enddo - enddo - do j = 1,4 - do i = 1,len - albfcs(i,j) = albanl(i,j) - albfcs(i,j) - enddo - enddo -! -! monitoring prints -! - if(me .eq. 0) then - print *,' ' - print *,'monitor of difference' - print *,' (includes angulation correction)' - print *,' ' - call monitr('tsfdif',tsffcs,slianl,snoanl,len) - call monitr('albdif',albfcs,slianl,snoanl,len) - call monitr('albdif1',albfcs,slianl,snoanl,len) - call monitr('albdif2',albfcs(1,2),slianl,snoanl,len) - call monitr('albdif3',albfcs(1,3),slianl,snoanl,len) - call monitr('albdif4',albfcs(1,4),slianl,snoanl,len) - call monitr('aisdif',aisfcs,slianl,snoanl,len) - call monitr('snodif',snofcs,slianl,snoanl,len) - call monitr('smcanl1',smcfcs(1,1),slianl,snoanl,len) - call monitr('smcanl2',smcfcs(1,2),slianl,snoanl,len) - call monitr('stcanl1',stcfcs(1,1),slianl,snoanl,len) - call monitr('stcanl2',stcfcs(1,2),slianl,snoanl,len) -!clu [+4l] add smcfcs(3:4) and stc(3:4) - if(lsoil.gt.2) then - call monitr('smcanl3',smcfcs(1,3),slianl,snoanl,len) - call monitr('smcanl4',smcfcs(1,4),slianl,snoanl,len) - call monitr('stcanl3',stcfcs(1,3),slianl,snoanl,len) - call monitr('stcanl4',stcfcs(1,4),slianl,snoanl,len) - endif - call monitr('tg3dif',tg3fcs,slianl,snoanl,len) - call monitr('zordif',zorfcs,slianl,snoanl,len) -! if (gaus) then - call monitr('cvadif',cvfcs ,slianl,snoanl,len) - call monitr('cvbdif',cvbfcs,slianl,snoanl,len) - call monitr('cvtdif',cvtfcs,slianl,snoanl,len) -! endif - call monitr('slidif',slifcs,slianl,snoanl,len) -! call monitr('plrdif',plrfcs,slianl,snoanl,len) - call monitr('cnpdif',cnpfcs,slianl,snoanl,len) - call monitr('vegdif',vegfcs,slianl,snoanl,len) - call monitr('vetdif',vetfcs,slianl,snoanl,len) - call monitr('sotdif',sotfcs,slianl,snoanl,len) -!cwu [+2l] add sih, sic - call monitr('sihdif',sihfcs,slianl,snoanl,len) - call monitr('sicdif',sicfcs,slianl,snoanl,len) -!clu [+4l] add vmn, vmx, slp, abs - call monitr('vmndif',vmnfcs,slianl,snoanl,len) - call monitr('vmxdif',vmxfcs,slianl,snoanl,len) - call monitr('slpdif',slpfcs,slianl,snoanl,len) - call monitr('absdif',absfcs,slianl,snoanl,len) - endif - endif -! -! - do i=1,len - tsffcs(i) = tsfanl(i) - snofcs(i) = snoanl(i) - tg3fcs(i) = tg3anl(i) - zorfcs(i) = zoranl(i) -! plrfcs(i) = plranl(i) -! albfcs(i) = albanl(i) - slifcs(i) = slianl(i) - aisfcs(i) = aisanl(i) - cvfcs(i) = cvanl(i) - cvbfcs(i) = cvbanl(i) - cvtfcs(i) = cvtanl(i) - cnpfcs(i) = cnpanl(i) - vegfcs(i) = veganl(i) - vetfcs(i) = vetanl(i) - sotfcs(i) = sotanl(i) -!clu [+4l] add vmn, vmx, slp, abs - vmnfcs(i) = vmnanl(i) - vmxfcs(i) = vmxanl(i) - slpfcs(i) = slpanl(i) - absfcs(i) = absanl(i) - enddo - do j = 1,lsoil - do i = 1,len - smcfcs(i,j) = smcanl(i,j) - if (slifcs(i) .gt. 0.0) then - stcfcs(i,j) = stcanl(i,j) - else - stcfcs(i,j) = tsffcs(i) - endif - enddo - enddo - do j = 1,4 - do i = 1,len - albfcs(i,j) = albanl(i,j) - enddo - enddo - do j = 1,2 - do i = 1,len - alffcs(i,j) = alfanl(i,j) - enddo - enddo - -!cwu [+20l] update sihfcs, sicfcs. remove sea ice over non-ice points - crit=aislim - do i=1,len - sihfcs(i) = sihanl(i) - sitfcs(i) = tsffcs(i) - if (slifcs(i).ge.2.) then - if (sicfcs(i).gt.crit) then - tsffcs(i) = (sicanl(i)*tsffcs(i) - & + (sicfcs(i)-sicanl(i))*tgice)/sicfcs(i) - sitfcs(i) = (tsffcs(i)-tgice*(1.0-sicfcs(i))) / sicfcs(i) - else - tsffcs(i) = tsfanl(i) -! tsffcs(i) = tgice - sihfcs(i) = sihnew - endif - endif - sicfcs(i) = sicanl(i) - enddo - do i=1,len - if (slifcs(i).lt.1.5) then - sihfcs(i) = 0. - sicfcs(i) = 0. - sitfcs(i) = tsffcs(i) - else if ((slifcs(i).ge.1.5).and.(sicfcs(i).lt.crit)) then - print *,'warning: check, slifcs and sicfcs', - & slifcs(i),sicfcs(i) - endif - enddo - -! -! ensure the consistency between slc and smc -! - do k=1, lsoil - fixratio(k) = .false. - if (fsmcl(k).lt.99999.) fixratio(k) = .true. - enddo - - if(me .eq. 0) then - print *,'dbgx --fixratio:',(fixratio(k),k=1,lsoil) - endif - - do k=1, lsoil - if(fixratio(k)) then - do i = 1, len - if(swratio(i,k) .eq. -999.) then - slcfcs(i,k) = smcfcs(i,k) - else - slcfcs(i,k) = swratio(i,k) * smcfcs(i,k) - endif - if (slifcs(i) .ne. 1.0) slcfcs(i,k) = 1.0 ! flag value for non-land points. - enddo - endif - enddo -! set liquid soil moisture to a flag value of 1.0 - if (landice) then - do i = 1, len - if (slifcs(i) .eq. 1.0 .and. - & nint(vetfcs(i)) == veg_type_landice) then - do k=1, lsoil - slcfcs(i,k) = 1.0 - enddo - endif - enddo - end if -! -! ensure the consistency between snwdph and sheleg -! - if(fsnol .lt. 99999.) then - if(me .eq. 0) then - print *,'dbgx -- scale snwdph from sheleg' - endif - do i = 1, len - if(slifcs(i).eq.1.) swdfcs(i) = 10.* snofcs(i) - enddo - endif - -! sea ice model only uses the liquid equivalent depth. -! so update the physical depth only for display purposes. -! use the same 3:1 ratio used by ice model. - - do i = 1, len - if (slifcs(i).ne.1) swdfcs(i) = 3.*snofcs(i) - enddo - - do i = 1, len - if(slifcs(i).eq.1.) then - if(snofcs(i).ne.0. .and. swdfcs(i).eq.0.) then - print *,'dbgx --scale snwdph from sheleg', - + i, swdfcs(i), snofcs(i) - swdfcs(i) = 10.* snofcs(i) - endif - endif - enddo -! landice mods - impose same minimum snow depth at -! landice as noah lsm. also ensure -! lower thermal boundary condition -! and skin t is no warmer than freezing -! after adjustment to terrain. - if (landice) then - do i = 1, len - if (slifcs(i) .eq. 1.0 .and. - & nint(vetfcs(i)) == veg_type_landice) then - snofcs(i) = max(snofcs(i),100.0) ! in mm - swdfcs(i) = max(swdfcs(i),1000.0) ! in mm - tg3fcs(i) = min(tg3fcs(i),273.15) - tsffcs(i) = min(tsffcs(i),273.15) - endif - enddo - end if -! -! if(lprnt) print *,' tsffcsf=',tsffcs(iprnt) - return - end subroutine sfccycle - -!>\ingroup mod_sfcsub -!! This subroutine counts number of points for the four surface -!! conditions. - subroutine count(slimsk,sno,ijmax) - use machine , only : kind_io8,kind_io4 - implicit none - real (kind=kind_io8) rl3,rl1,rl0,rl2,rl6,rl7,rl4,rl5 - integer l8,l7,l1,l2,ijmax,l0,l3,l5,l6,l4,ij -! - real (kind=kind_io8) slimsk(1),sno(1) -! -! count number of points for the four surface conditions -! - l0 = 0 - l1 = 0 - l2 = 0 - l3 = 0 - l4 = 0 - do ij=1,ijmax - if(slimsk(ij).eq.0.) l1 = l1 + 1 - if(slimsk(ij).eq.1. .and. sno(ij).le.0.) l0 = l0 + 1 - if(slimsk(ij).eq.2. .and. sno(ij).le.0.) l2 = l2 + 1 - if(slimsk(ij).eq.1. .and. sno(ij).gt.0.) l3 = l3 + 1 - if(slimsk(ij).eq.2. .and. sno(ij).gt.0.) l4 = l4 + 1 - enddo - l5 = l0 + l3 - l6 = l2 + l4 - l7 = l1 + l6 - l8 = l1 + l5 + l6 - rl0 = float(l0) / float(l8)*100. - rl3 = float(l3) / float(l8)*100. - rl1 = float(l1) / float(l8)*100. - rl2 = float(l2) / float(l8)*100. - rl4 = float(l4) / float(l8)*100. - rl5 = float(l5) / float(l8)*100. - rl6 = float(l6) / float(l8)*100. - rl7 = float(l7) / float(l8)*100. - print *,'1) no. of not snow-covered land points ',l0,' ',rl0,' ' - print *,'2) no. of snow covered land points ',l3,' ',rl3,' ' - print *,'3) no. of open sea points ',l1,' ',rl1,' ' - print *,'4) no. of not snow-covered seaice points ',l2,' ',rl2,' ' - print *,'5) no. of snow covered sea ice points ',l4,' ',rl4,' ' - print *,' ' - print *,'6) no. of land points ',l5,' ',rl5,' ' - print *,'7) no. sea points (including sea ice) ',l7,' ',rl7,' ' - print *,' (no. of sea ice points) (',l6,')',' ',rl6,' ' - print *,' ' - print *,'9) no. of total grid points ',l8 -! print *,' ' -! print *,' ' - -! -! if(lprnt) print *,' tsffcsf=',tsffcs(iprnt) - return - end - -!>\ingroup mod_sfcsub - subroutine monitr(lfld,fld,slimsk,sno,ijmax) - use machine , only : kind_io8,kind_io4 - implicit none - integer ij,n,ijmax -! - real (kind=kind_io8) fld(ijmax), slimsk(ijmax),sno(ijmax) -! - real (kind=kind_io8) rmax(5),rmin(5) - character(len=*) lfld -! -! find max/min -! - do n=1,5 - rmax(n) = -9.e20 - rmin(n) = 9.e20 - enddo -! - do ij=1,ijmax - if(slimsk(ij).eq.0.) then - rmax(1) = max(rmax(1), fld(ij)) - rmin(1) = min(rmin(1), fld(ij)) - elseif(slimsk(ij).eq.1.) then - if(sno(ij).le.0.) then - rmax(2) = max(rmax(2), fld(ij)) - rmin(2) = min(rmin(2), fld(ij)) - else - rmax(4) = max(rmax(4), fld(ij)) - rmin(4) = min(rmin(4), fld(ij)) - endif - else - if(sno(ij).le.0.) then - rmax(3) = max(rmax(3), fld(ij)) - rmin(3) = min(rmin(3), fld(ij)) - else - rmax(5) = max(rmax(5), fld(ij)) - rmin(5) = min(rmin(5), fld(ij)) - endif - endif - enddo -! - print 100,lfld - print 101,rmax(1),rmin(1) - print 102,rmax(2),rmin(2), rmax(4), rmin(4) - print 103,rmax(3),rmin(3), rmax(5), rmin(5) -! -! print 102,rmax(2),rmin(2) -! print 103,rmax(3),rmin(3) -! print 104,rmax(4),rmin(4) -! print 105,rmax(5),rmin(5) - 100 format('0 *** ',a8,' ***') - 101 format(' open sea ......... max=',e12.4,' min=',e12.4) - 102 format(' land nosnow/snow .. max=',e12.4,' min=',e12.4 - &, ' max=',e12.4,' min=',e12.4) - 103 format(' seaice nosnow/snow max=',e12.4,' min=',e12.4 - &, ' max=',e12.4,' min=',e12.4) -! -! 100 format('0',2x,'*** ',a8,' ***') -! 102 format(2x,' land without snow ..... max=',e12.4,' min=',e12.4) -! 103 format(2x,' seaice without snow ... max=',e12.4,' min=',e12.4) -! 104 format(2x,' land with snow ........ max=',e12.4,' min=',e12.4) -! 105 format(2x,' sea ice with snow ..... max=',e12.4,' min=',e12.4) -! - return - end - -!>\ingroup mod_sfcsub -!! This subroutine figures out the day of the year given imo and idy. - subroutine dayoyr(iyr,imo,idy,ldy) - implicit none - integer ldy,i,idy,iyr,imo -! -! this routine figures out the day of the year given imo and idy -! - integer month(13) - data month/0,31,28,31,30,31,30,31,31,30,31,30,31/ - if(mod(iyr,4).eq.0) month(3) = 29 - ldy = idy - do i = 1, imo - ldy = ldy + month(i) - enddo - return - end - -!>\ingroup mod_sfcsub - subroutine hmskrd(lugb,imsk,jmsk,fnmskh, - & kpds5,slmskh,gausm,blnmsk,bltmsk,me) - use machine , only : kind_io8,kind_io4 - use sfccyc_module, only : mdata, xdata, ydata - implicit none - integer kpds5,me,i,imsk,jmsk,lugb -! - character*500 fnmskh -! - real (kind=kind_io8) slmskh(mdata) - logical gausm - real (kind=kind_io8) blnmsk,bltmsk -! - imsk = xdata - jmsk = ydata - - if (me .eq. 0) then - write(6,*)' imsk=',imsk,' jmsk=',jmsk,' xdata=',xdata,' ydata=' - &, ydata - endif - - call fixrdg(lugb,imsk,jmsk,fnmskh, - & kpds5,slmskh,gausm,blnmsk,bltmsk,me) - -! print *,'in sfc_sub, aft fixrdg,slmskh=',maxval(slmskh), -! & minval(slmskh),'mdata=',mdata,'imsk*jmsk=',imsk*jmsk - - do i=1,imsk*jmsk - slmskh(i) = nint(slmskh(i)) - enddo -! - return - end - -!>\ingroup mod_sfcsub - subroutine fixrdg(lugb,idim,jdim,fngrib, - & kpds5,gdata,gaus,blno,blto,me) - use machine , only : kind_io8,kind_io4 - use sfccyc_module, only : mdata - implicit none - integer lgrib,n,lskip,jret,j,ndata,lugi,jdim,idim,lugb, - & iret, me,kpds5,kdata,i,w3kindreal,w3kindint -! - character*(*) fngrib -! - real (kind=kind_io8) gdata(idim*jdim) - logical gaus - real (kind=kind_io8) blno,blto - real (kind=kind_io8), allocatable :: data8(:) - real (kind=kind_io4), allocatable :: data4(:) -! - logical*1, allocatable :: lbms(:) -! - integer kpds(200),kgds(200) - integer jpds(200),jgds(200), kpds0(200) -! - allocate(data8(1:idim*jdim)) - allocate(lbms(1:mdata)) - kpds = 0 - kgds = 0 - jpds = 0 - jgds = 0 - kpds0 = 0 -! -! if(me .eq. 0) then -! write(6,*) ' ' -! write(6,*) '************************************************' -! endif -! - close(lugb) - call baopenr(lugb,fngrib,iret) - if (iret .ne. 0) then - write(6,*) ' error in opening file ',trim(fngrib) - print *,'error in opening file ',trim(fngrib) - call abort - endif - if (me .eq. 0) write(6,*) ' file ',trim(fngrib), - & ' opened. unit=',lugb - lugi = 0 - lskip = -1 - n = 0 - jpds = -1 - jgds = -1 - jpds(5) = kpds5 - kpds = jpds -! - call getgbh(lugb,lugi,lskip,jpds,jgds,lgrib,ndata, - & lskip,kpds,kgds,iret) -! - if(me .eq. 0) then - write(6,*) ' first grib record.' - write(6,*) ' kpds( 1-10)=',(kpds(j),j= 1,10) - write(6,*) ' kpds(11-20)=',(kpds(j),j=11,20) - write(6,*) ' kpds(21- )=',(kpds(j),j=21,22) - endif -! - kpds0=jpds - kpds0(4)=-1 - kpds0(18)=-1 - if(iret.ne.0) then - write(6,*) ' error in getgbh. iret: ', iret - if (iret == 99) write(6,*) ' field not found.' - call abort - endif -! - jpds = kpds0 - lskip = -1 - kdata=idim*jdim - call w3kind(w3kindreal,w3kindint) - if (w3kindreal == 8) then - call getgb(lugb,lugi,kdata,lskip,jpds,jgds,ndata,lskip, - & kpds,kgds,lbms,data8,jret) - else if (w3kindreal == 4) then - allocate(data4(1:idim*jdim)) - call getgb(lugb,lugi,kdata,lskip,jpds,jgds,ndata,lskip, - & kpds,kgds,lbms,data4,jret) - data8 = real(data4, kind=kind_io8) - deallocate(data4) - else - write(0,*)' Invalid w3kindreal --- aborting' - call abort - endif -! - if(jret == 0) then - if(ndata.eq.0) then - write(6,*) ' error in getgb' - write(6,*) ' kpds=',kpds - write(6,*) ' kgds=',kgds - call abort - endif - idim = kgds(2) - jdim = kgds(3) - gaus = kgds(1).eq.4 - blno = kgds(5)*1.d-3 - blto = kgds(4)*1.d-3 - gdata(1:idim*jdim) = data8(1:idim*jdim) - if (me == 0) write(6,*) 'idim,jdim=',idim,jdim - &, ' gaus=',gaus,' blno=',blno,' blto=',blto - else - if (me ==. 0) write(6,*) 'idim,jdim=',idim,jdim - &, ' gaus=',gaus,' blno=',blno,' blto=',blto - write(6,*) ' error in getgb : jret=',jret - write(6,*) ' kpds(13)=',kpds(13),' kpds(15)=',kpds(15) - call abort - endif -! - deallocate(data8) - deallocate(lbms) - return - end - -!>\ingroup mod_sfcsub -!! This subroutine get area of the grib record. - subroutine getarea(kgds,dlat,dlon,rslat,rnlat,wlon,elon,ijordr - &, me) - use machine , only : kind_io8,kind_io4 - implicit none - integer j,me,kgds11 - real (kind=kind_io8) f0lon,f0lat,elon,dlon,dlat,rslat,wlon,rnlat -! -! get area of the grib record -! - integer kgds(22) - logical ijordr -! - if (me .eq. 0) then - write(6,*) ' kgds( 1-12)=',(kgds(j),j= 1,12) - write(6,*) ' kgds(13-22)=',(kgds(j),j=13,22) - endif -! - if(kgds(1).eq.0) then ! lat/lon grid -! - if (me .eq. 0) write(6,*) 'lat/lon grid' - dlat = float(kgds(10)) * 0.001 - dlon = float(kgds( 9)) * 0.001 - f0lon = float(kgds(5)) * 0.001 - f0lat = float(kgds(4)) * 0.001 - kgds11 = kgds(11) - if(kgds11.ge.128) then - wlon = f0lon - dlon*(kgds(2)-1) - elon = f0lon - if(dlon*kgds(2).gt.359.99) then - wlon =f0lon - dlon*kgds(2) - endif - dlon = -dlon - kgds11 = kgds11 - 128 - else - wlon = f0lon - elon = f0lon + dlon*(kgds(2)-1) - if(dlon*kgds(2).gt.359.99) then - elon = f0lon + dlon*kgds(2) - endif - endif - if(kgds11.ge.64) then - rnlat = f0lat + dlat*(kgds(3)-1) - rslat = f0lat - kgds11 = kgds11 - 64 - else - rnlat = f0lat - rslat = f0lat - dlat*(kgds(3)-1) - dlat = -dlat - endif - if(kgds11.ge.32) then - ijordr = .false. - else - ijordr = .true. - endif - - if(wlon.gt.180.) wlon = wlon - 360. - if(elon.gt.180.) elon = elon - 360. - wlon = nint(wlon*1000.) * 0.001 - elon = nint(elon*1000.) * 0.001 - rslat = nint(rslat*1000.) * 0.001 - rnlat = nint(rnlat*1000.) * 0.001 - return -! - elseif(kgds(1).eq.1) then ! mercator projection - write(6,*) 'mercator grid' - write(6,*) 'cannot process' - call abort -! - elseif(kgds(1).eq.2) then ! gnomonic projection - write(6,*) 'gnomonic grid' - write(6,*) 'error!! gnomonic projection not coded' - call abort -! - elseif(kgds(1).eq.3) then ! lambert conformal - write(6,*) 'lambert conformal' - write(6,*) 'cannot process' - call abort - elseif(kgds(1).eq.4) then ! gaussian grid -! - if (me .eq. 0) write(6,*) 'gaussian grid' - dlat = 99. - dlon = float(kgds( 9)) / 1000.0 - f0lon = float(kgds(5)) / 1000.0 - f0lat = 99. - kgds11 = kgds(11) - if(kgds11.ge.128) then - wlon = f0lon - elon = f0lon - if(dlon*kgds(2).gt.359.99) then - wlon = f0lon - dlon*kgds(2) - endif - dlon = -dlon - kgds11 = kgds11-128 - else - wlon = f0lon - elon = f0lon + dlon*(kgds(2)-1) - if(dlon*kgds(2).gt.359.99) then - elon = f0lon + dlon*kgds(2) - endif - endif - if(kgds11.ge.64) then - rnlat = 99. - rslat = 99. - kgds11 = kgds11 - 64 - else - rnlat = 99. - rslat = 99. - dlat = -99. - endif - if(kgds11.ge.32) then - ijordr = .false. - else - ijordr = .true. - endif - return -! - elseif(kgds(1).eq.5) then ! polar strereographic - write(6,*) 'polar stereographic grid' - write(6,*) 'cannot process' - call abort - return -! - elseif(kgds(1).eq.13) then ! oblique lambert conformal - write(6,*) 'oblique lambert conformal grid' - write(6,*) 'cannot process' - call abort -! - elseif(kgds(1).eq.50) then ! spherical coefficient - write(6,*) 'spherical coefficient' - write(6,*) 'cannot process' - call abort - return -! - elseif(kgds(1).eq.90) then ! space view perspective -! (orthographic grid) - write(6,*) 'space view perspective grid' - write(6,*) 'cannot process' - call abort - return -! - else ! unknown projection. abort. - write(6,*) 'error!! unknown map projection' - write(6,*) 'kgds(1)=',kgds(1) - print *,'error!! unknown map projection' - print *,'kgds(1)=',kgds(1) - call abort - endif -! - return - end - -!>\ingroup mod_sfcsub - subroutine subst(data,imax,jmax,dlon,dlat,ijordr) - use machine , only : kind_io8,kind_io4 - implicit none - integer i,j,ii,jj,jmax,imax,iret - real (kind=kind_io8) dlat,dlon -! - logical ijordr -! - real (kind=kind_io8) data(imax,jmax) - real (kind=kind_io8), allocatable :: work(:,:) -! - if(.not.ijordr.or. - & (ijordr.and.(dlat.gt.0..or.dlon.lt.0.))) then - allocate (work(imax,jmax)) - - if(.not.ijordr) then - do j=1,jmax - do i=1,imax - work(i,j) = data(j,i) - enddo - enddo - else - do j=1,jmax - do i=1,imax - work(i,j) = data(i,j) - enddo - enddo - endif - if (dlat > 0.0) then - if (dlon > 0.0) then - do j=1,jmax - jj = jmax - j + 1 - do i=1,imax - data(i,jj) = work(i,j) - enddo - enddo - else - do i=1,imax - data(imax-i+1,jj) = work(i,j) - enddo - endif - else - if (dlon > 0.0) then - do j=1,jmax - do i=1,imax - data(i,j) = work(i,j) - enddo - enddo - else - do j=1,jmax - do i=1,imax - data(imax-i+1,j) = work(i,j) - enddo - enddo - endif - endif - deallocate (work, stat=iret) - endif - return - end - -!>\ingroup mod_sfcsub -!! This subroutine conducts interpolation from lat/lon to Gaussian -!! grid to other lat/lon grid. - subroutine la2ga(regin,imxin,jmxin,rinlon,rinlat,rlon,rlat,inttyp, - & gauout,len,lmask,rslmsk,slmask - &, outlat, outlon,me) - use machine , only : kind_io8,kind_io4 - implicit none - real (kind=kind_io8) wei4,wei3,wei2,sum2,sum1,sum3,wei1,sum4, - & wsum,tem,wsumiv,sums,sumn,wi2j2,x,y,wi1j1, - & wi1j2,wi2j1,rlat,rlon,aphi, - & rnume,alamd,denom - integer jy,ifills,ix,len,inttyp,me,i,j,jmxin,imxin,jq,jx,j1,j2, - & ii,i1,i2,kmami,it - integer nx,kxs,kxt - integer, allocatable, save :: imxnx(:) - integer, allocatable :: ifill(:) -! -! interpolation from lat/lon or gaussian grid to other lat/lon grid -! - real (kind=kind_io8) outlon(len),outlat(len),gauout(len), - & slmask(len) - real (kind=kind_io8) regin (imxin,jmxin),rslmsk(imxin,jmxin) -! - real (kind=kind_io8) rinlat(jmxin), rinlon(imxin) - integer iindx1(len), iindx2(len) - integer jindx1(len), jindx2(len) - real (kind=kind_io8) ddx(len), ddy(len), wrk(len) -! - logical lmask -! - logical first - integer num_threads - data first /.true./ - save num_threads, first -! - integer len_thread_m, len_thread, i1_t, i2_t - integer num_parthds -! - if (first) then - num_threads = num_parthds() - first = .false. - if (.not. allocated(imxnx)) allocate (imxnx(num_threads)) - endif -! -! if (me == 0) print *,' num_threads =',num_threads,' me=',me -! -! if(me .eq. 0) then -! print *,'rlon=',rlon,' me=',me -! print *,'rlat=',rlat,' me=',me,' imxin=',imxin,' jmxin=',jmxin -! endif -! -! do j=1,jmxin -! if(rlat.gt.0.) then -! rinlat(j) = rlat - float(j-1)*dlain -! else -! rinlat(j) = rlat + float(j-1)*dlain -! endif -! enddo -! -! if (me .eq. 0) then -! print *,'rinlat=' -! print *,(rinlat(j),j=1,jmxin) -! print *,'rinlon=' -! print *,(rinlon(i),i=1,imxin) -! -! print *,'outlat=' -! print *,(outlat(j),j=1,len) -! print *,(outlon(j),j=1,len) -! endif -! -! do i=1,imxin -! rinlon(i) = rlon + float(i-1)*dloin -! enddo -! -! print *,'rinlon=' -! print *,(rinlon(i),i=1,imxin) -! - len_thread_m = (len+num_threads-1) / num_threads - - if (inttyp /=1) allocate (ifill(num_threads)) -! -!$omp parallel do default(none) -!$omp+private(i1_t,i2_t,len_thread,it,i,ii,i1,i2) -!$omp+private(j,j1,j2,jq,ix,jy,nx,kxs,kxt,kmami) -!$omp+private(alamd,denom,rnume,aphi,x,y,wsum,wsumiv,sum1,sum2) -!$omp+private(sum3,sum4,wi1j1,wi2j1,wi1j2,wi2j2,wei1,wei2,wei3,wei4) -!$omp+private(sumn,sums) -!$omp+shared(imxin,jmxin,ifill) -!$omp+shared(outlon,outlat,wrk,iindx1,rinlon,jindx1,rinlat,ddx,ddy) -!$omp+shared(rlon,rlat,regin,gauout,imxnx) -!$omp+private(tem) -!$omp+shared(num_threads,len_thread_m,len,lmask,iindx2,jindx2,rslmsk) -!$omp+shared(inttyp,me,slmask) -! - do it=1,num_threads ! start of threaded loop ................... - i1_t = (it-1)*len_thread_m+1 - i2_t = min(i1_t+len_thread_m-1,len) - len_thread = i2_t-i1_t+1 -! -! find i-index for interpolation -! - do i=i1_t, i2_t - alamd = outlon(i) - if (alamd .lt. rlon) alamd = alamd + 360.0 - if (alamd .gt. 360.0+rlon) alamd = alamd - 360.0 - wrk(i) = alamd - iindx1(i) = imxin - enddo - do i=i1_t,i2_t - do ii=1,imxin - if(wrk(i) .ge. rinlon(ii)) iindx1(i) = ii - enddo - enddo - do i=i1_t,i2_t - i1 = iindx1(i) - if (i1 .lt. 1) i1 = imxin - i2 = i1 + 1 - if (i2 .gt. imxin) i2 = 1 - iindx1(i) = i1 - iindx2(i) = i2 - denom = rinlon(i2) - rinlon(i1) - if(denom.lt.0.) denom = denom + 360. - rnume = wrk(i) - rinlon(i1) - if(rnume.lt.0.) rnume = rnume + 360. - ddx(i) = rnume / denom - enddo -! -! find j-index for interplation -! - if(rlat.gt.0.) then - do j=i1_t,i2_t - jindx1(j)=0 - enddo - do jx=1,jmxin - do j=i1_t,i2_t - if(outlat(j).le.rinlat(jx)) jindx1(j) = jx - enddo - enddo - do j=i1_t,i2_t - jq = jindx1(j) - aphi=outlat(j) - if(jq.ge.1 .and. jq .lt. jmxin) then - j2=jq+1 - j1=jq - ddy(j)=(aphi-rinlat(j1))/(rinlat(j2)-rinlat(j1)) - elseif (jq .eq. 0) then - j2=1 - j1=1 - if(abs(90.-rinlat(j1)).gt.0.001) then - ddy(j)=(aphi-rinlat(j1))/(90.-rinlat(j1)) - else - ddy(j)=0.0 - endif - else - j2=jmxin - j1=jmxin - if(abs(-90.-rinlat(j1)).gt.0.001) then - ddy(j)=(aphi-rinlat(j1))/(-90.-rinlat(j1)) - else - ddy(j)=0.0 - endif - endif - jindx1(j)=j1 - jindx2(j)=j2 - enddo - else - do j=i1_t,i2_t - jindx1(j) = jmxin+1 - enddo - do jx=jmxin,1,-1 - do j=i1_t,i2_t - if(outlat(j).le.rinlat(jx)) jindx1(j) = jx - enddo - enddo - do j=i1_t,i2_t - jq = jindx1(j) - aphi=outlat(j) - if(jq.gt.1 .and. jq .le. jmxin) then - j2=jq - j1=jq-1 - ddy(j)=(aphi-rinlat(j1))/(rinlat(j2)-rinlat(j1)) - elseif (jq .eq. 1) then - j2=1 - j1=1 - if(abs(-90.-rinlat(j1)).gt.0.001) then - ddy(j)=(aphi-rinlat(j1))/(-90.-rinlat(j1)) - else - ddy(j)=0.0 - endif - else - j2=jmxin - j1=jmxin - if(abs(90.-rinlat(j1)).gt.0.001) then - ddy(j)=(aphi-rinlat(j1))/(90.-rinlat(j1)) - else - ddy(j)=0.0 - endif - endif - jindx1(j)=j1 - jindx2(j)=j2 - enddo - endif -! -! if (me .eq. 0 .and. inttyp .eq. 1) then -! print *,'la2ga' -! print *,'iindx1' -! print *,(iindx1(n),n=1,len) -! print *,'iindx2' -! print *,(iindx2(n),n=1,len) -! print *,'jindx1' -! print *,(jindx1(n),n=1,len) -! print *,'jindx2' -! print *,(jindx2(n),n=1,len) -! print *,'ddy' -! print *,(ddy(n),n=1,len) -! print *,'ddx' -! print *,(ddx(n),n=1,len) -! endif -! - sum1 = 0. - sum2 = 0. - sum3 = 0. - sum4 = 0. - if (lmask) then - wei1 = 0. - wei2 = 0. - wei3 = 0. - wei4 = 0. - do i=1,imxin - sum1 = sum1 + regin(i,1) * rslmsk(i,1) - sum2 = sum2 + regin(i,jmxin) * rslmsk(i,jmxin) - wei1 = wei1 + rslmsk(i,1) - wei2 = wei2 + rslmsk(i,jmxin) -! - sum3 = sum3 + regin(i,1) * (1.0-rslmsk(i,1)) - sum4 = sum4 + regin(i,jmxin) * (1.0-rslmsk(i,jmxin)) - wei3 = wei3 + (1.0-rslmsk(i,1)) - wei4 = wei4 + (1.0-rslmsk(i,jmxin)) - enddo -! - if(wei1.gt.0.) then - sum1 = sum1 / wei1 - else - sum1 = 0. - endif - if(wei2.gt.0.) then - sum2 = sum2 / wei2 - else - sum2 = 0. - endif - if(wei3.gt.0.) then - sum3 = sum3 / wei3 - else - sum3 = 0. - endif - if(wei4.gt.0.) then - sum4 = sum4 / wei4 - else - sum4 = 0. - endif - else - do i=1,imxin - sum1 = sum1 + regin(i,1) - sum2 = sum2 + regin(i,jmxin) - enddo - sum1 = sum1 / imxin - sum2 = sum2 / imxin - sum3 = sum1 - sum4 = sum2 - endif -! -! print *,' sum1=',sum1,' sum2=',sum2 -! *,' sum3=',sum3,' sum4=',sum4 -! print *,' rslmsk=',(rslmsk(i,1),i=1,imxin) -! print *,' slmask=',(slmask(i),i=1,imxout) -! *,' j1=',jindx1(1),' j2=',jindx2(1) -! -! -! inttyp=1 take the closest point value -! - if(inttyp.eq.1) then - - do i=i1_t,i2_t - jy = jindx1(i) - if(ddy(i) .ge. 0.5) jy = jindx2(i) - ix = iindx1(i) - if(ddx(i) .ge. 0.5) ix = iindx2(i) -! -!cggg start -! - if (.not. lmask) then - - gauout(i) = regin(ix,jy) - - else - - if(slmask(i).eq.rslmsk(ix,jy)) then - - gauout(i) = regin(ix,jy) - - else - - i1 = ix - j1 = jy - -! spiral around until matching mask is found. - do nx=1,jmxin*imxin/2 - kxs=sqrt(4*nx-2.5) - kxt=nx-int(kxs**2/4+1) - select case(mod(kxs,4)) - case(1) - ix=i1-kxs/4+kxt - jx=j1-kxs/4 - case(2) - ix=i1+1+kxs/4 - jx=j1-kxs/4+kxt - case(3) - ix=i1+1+kxs/4-kxt - jx=j1+1+kxs/4 - case default - ix=i1-kxs/4 - jx=j1+kxs/4-kxt - end select - if(jx.lt.1) then - ix=ix+imxin/2 - jx=2-jx - elseif(jx.gt.jmxin) then - ix=ix+imxin/2 - jx=2*jmxin-jx - endif - ix=modulo(ix-1,imxin)+1 - if(slmask(i).eq.rslmsk(ix,jx)) then - gauout(i) = regin(ix,jx) - go to 81 - endif - enddo - -!cggg here, set the gauout value to be 0, and let's sarah's land -!cggg routine assign a default. - - if (num_threads == 1) then - print*,'no matching mask found ',i,i1,j1,ix,jx - print*,'set to default value.' - endif - gauout(i) = 0.0 - - - 81 continue - - end if - - end if - -!cggg end - - enddo -! kmami=1 -! if (me == 0 .and. num_threads == 1) -! & call maxmin(gauout(i1_t),len_thread,kmami) - else ! nearest neighbor interpolation - -! -! quasi-bilinear interpolation -! - ifill(it) = 0 - imxnx(it) = 0 - do i=i1_t,i2_t - y = ddy(i) - j1 = jindx1(i) - j2 = jindx2(i) - x = ddx(i) - i1 = iindx1(i) - i2 = iindx2(i) -! - wi1j1 = (1.-x) * (1.-y) - wi2j1 = x *( 1.-y) - wi1j2 = (1.-x) * y - wi2j2 = x * y -! - tem = 4.*slmask(i) - rslmsk(i1,j1) - rslmsk(i2,j1) - & - rslmsk(i1,j2) - rslmsk(i2,j2) - if(lmask .and. abs(tem) .gt. 0.01) then - if(slmask(i).eq.1.) then - wi1j1 = wi1j1 * rslmsk(i1,j1) - wi2j1 = wi2j1 * rslmsk(i2,j1) - wi1j2 = wi1j2 * rslmsk(i1,j2) - wi2j2 = wi2j2 * rslmsk(i2,j2) - else - wi1j1 = wi1j1 * (1.0-rslmsk(i1,j1)) - wi2j1 = wi2j1 * (1.0-rslmsk(i2,j1)) - wi1j2 = wi1j2 * (1.0-rslmsk(i1,j2)) - wi2j2 = wi2j2 * (1.0-rslmsk(i2,j2)) - endif - endif -! - wsum = wi1j1 + wi2j1 + wi1j2 + wi2j2 - wrk(i) = wsum - if(wsum.ne.0.) then - wsumiv = 1./wsum -! - if(j1.ne.j2) then - gauout(i) = (wi1j1*regin(i1,j1) + wi2j1*regin(i2,j1) + - & wi1j2*regin(i1,j2) + wi2j2*regin(i2,j2)) - & *wsumiv - else -! - if (rlat .gt. 0.0) then - if (slmask(i) .eq. 1.0) then - sumn = sum1 - sums = sum2 - else - sumn = sum3 - sums = sum4 - endif - if( j1 .eq. 1) then - gauout(i) = (wi1j1*sumn +wi2j1*sumn + - & wi1j2*regin(i1,j2)+wi2j2*regin(i2,j2)) - & * wsumiv - elseif (j1 .eq. jmxin) then - gauout(i) = (wi1j1*regin(i1,j1)+wi2j1*regin(i2,j1)+ - & wi1j2*sums +wi2j2*sums ) - & * wsumiv - endif -! print *,' slmask=',slmask(i),' sums=',sums,' sumn=',sumn -! & ,' regin=',regin(i1,j2),regin(i2,j2),' j1=',j1,' j2=',j2 -! & ,' wij=',wi1j1, wi2j1, wi1j2, wi2j2,wsumiv - else - if (slmask(i) .eq. 1.0) then - sums = sum1 - sumn = sum2 - else - sums = sum3 - sumn = sum4 - endif - if( j1 .eq. 1) then - gauout(i) = (wi1j1*regin(i1,j1)+wi2j1*regin(i2,j1)+ - & wi1j2*sums +wi2j2*sums ) - & * wsumiv - elseif (j1 .eq. jmxin) then - gauout(i) = (wi1j1*sumn +wi2j1*sumn + - & wi1j2*regin(i1,j2)+wi2j2*regin(i2,j2)) - & * wsumiv - endif - endif - endif ! if j1 .ne. j2 - endif - enddo - do i=i1_t,i2_t - j1 = jindx1(i) - j2 = jindx2(i) - i1 = iindx1(i) - i2 = iindx2(i) - if(wrk(i) .eq. 0.0) then - if(.not.lmask) then - if (num_threads == 1) - & write(6,*) ' la2ga called with lmask=.true. but bad', - & ' rslmsk or slmask given' - call abort - endif - ifill(it) = ifill(it) + 1 - if(ifill(it) <= 2 ) then - if (me == 0 .and. num_threads == 1) then - write(6,*) 'i1,i2,j1,j2=',i1,i2,j1,j2 - write(6,*) 'rslmsk=',rslmsk(i1,j1),rslmsk(i1,j2), - & rslmsk(i2,j1),rslmsk(i2,j2) -! write(6,*) 'i,j=',i,j,' slmask(i)=',slmask(i) - write(6,*) 'i=',i,' slmask(i)=',slmask(i) - &, ' outlon=',outlon(i),' outlat=',outlat(i) - endif - endif -! spiral around until matching mask is found. - do nx=1,jmxin*imxin/2 - kxs=sqrt(4*nx-2.5) - kxt=nx-int(kxs**2/4+1) - select case(mod(kxs,4)) - case(1) - ix=i1-kxs/4+kxt - jx=j1-kxs/4 - case(2) - ix=i1+1+kxs/4 - jx=j1-kxs/4+kxt - case(3) - ix=i1+1+kxs/4-kxt - jx=j1+1+kxs/4 - case default - ix=i1-kxs/4 - jx=j1+kxs/4-kxt - end select - if(jx.lt.1) then - ix=ix+imxin/2 - jx=2-jx - elseif(jx.gt.jmxin) then - ix=ix+imxin/2 - jx=2*jmxin-jx - endif - ix=modulo(ix-1,imxin)+1 - if(slmask(i).eq.rslmsk(ix,jx)) then - gauout(i) = regin(ix,jx) - imxnx(it) = max(imxnx(it),nx) - go to 71 - endif - enddo -! - if (num_threads == 1) then - write(6,*) ' error!!! no filling value found in la2ga' -! write(6,*) ' i ix jx slmask(i) rslmsk ', -! & i,ix,jx,slmask(i),rslmsk(ix,jx) - endif - call abort -! - 71 continue - endif -! - enddo - endif - enddo ! end of threaded loop ................... -!$omp end parallel do -! - if(inttyp /= 1)then - ifills = 0 - do it=1,num_threads - ifills = ifills + ifill(it) - enddo - - if(ifills.gt.1) then - if (me .eq. 0) then - write(6,*) ' unable to interpolate. filled with nearest', - & ' point value at ',ifills,' points' -! & ' point value at ',ifills,' points imxnx=',imxnx(:) - endif - endif - deallocate (ifill) - endif -! -! kmami = 1 -! if (me == 0) call maxmin(gauout,len,kmami) -! - return - end subroutine la2ga - -!>\ingroup mod_sfcsub - subroutine maxmin(f,imax,kmax) - use machine , only : kind_io8,kind_io4 - implicit none - integer i,iimin,iimax,kmax,imax,k - real (kind=kind_io8) fmin,fmax -! - real (kind=kind_io8) f(imax,kmax) -! - do k=1,kmax -! - fmax = f(1,k) - fmin = f(1,k) -! - do i=1,imax - if(fmax.le.f(i,k)) then - fmax = f(i,k) - iimax = i - endif - if(fmin.ge.f(i,k)) then - fmin = f(i,k) - iimin = i - endif - enddo -! -! write(6,100) k,fmax,iimax,fmin,iimin -! 100 format(2x,'level=',i2,' max=',e11.4,' at i=',i7, -! & ' min=',e11.4,' at i=',i7) -! - enddo -! - return - end - -!>\ingroup mod_sfcsub - subroutine filanl(tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl, - & aisanl, - & tg3anl,cvanl ,cvbanl,cvtanl, - & cnpanl,smcanl,stcanl,slianl,scvanl,veganl, - & vetanl,sotanl,alfanl, -!cwu [+1l] add ()anl for sih, sic - & sihanl,sicanl, -!clu [+1l] add ()anl for vmn, vmx, slp, abs - & vmnanl,vmxanl,slpanl,absanl, - & tsfclm,tsfcl2,wetclm,snoclm,zorclm,albclm, - & aisclm, - & tg3clm,cvclm ,cvbclm,cvtclm, - & cnpclm,smcclm,stcclm,sliclm,scvclm,vegclm, - & vetclm,sotclm,alfclm, -!cwu [+1l] add ()clm for sih, sic - & sihclm,sicclm, -!clu [+1l] add ()clm for vmn, vmx, slp, abs - & vmnclm,vmxclm,slpclm,absclm, - & len,lsoil) - use machine , only : kind_io8,kind_io4 - implicit none - integer i,j,len,lsoil -! - real (kind=kind_io8) tsfanl(len),tsfan2(len),wetanl(len), - & snoanl(len), - & zoranl(len),albanl(len,4),aisanl(len), - & tg3anl(len), - & cvanl (len),cvbanl(len),cvtanl(len), - & cnpanl(len), - & smcanl(len,lsoil),stcanl(len,lsoil), - & slianl(len),scvanl(len),veganl(len), - & vetanl(len),sotanl(len),alfanl(len,2) -!cwu [+1l] add ()anl for sih, sic - &, sihanl(len),sicanl(len) -!clu [+1l] add ()anl for vmn, vmx, slp, abs - &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len) - real (kind=kind_io8) tsfclm(len),tsfcl2(len),wetclm(len), - & snoclm(len), - & zorclm(len),albclm(len,4),aisclm(len), - & tg3clm(len), - & cvclm (len),cvbclm(len),cvtclm(len), - & cnpclm(len), - & smcclm(len,lsoil),stcclm(len,lsoil), - & sliclm(len),scvclm(len),vegclm(len), - & vetclm(len),sotclm(len),alfclm(len,2) -!cwu [+1l] add ()clm for sih, sic - &, sihclm(len),sicclm(len) -!clu [+1l] add ()clm for vmn, vmx, slp, abs - &, vmnclm(len),vmxclm(len),slpclm(len),absclm(len) -! - do i=1,len - tsfanl(i) = tsfclm(i) ! tsf at t - tsfan2(i) = tsfcl2(i) ! tsf at t-deltsfc - wetanl(i) = wetclm(i) ! soil wetness - snoanl(i) = snoclm(i) ! snow - scvanl(i) = scvclm(i) ! snow cover - aisanl(i) = aisclm(i) ! seaice - slianl(i) = sliclm(i) ! land/sea/snow mask - zoranl(i) = zorclm(i) ! surface roughness -! plranl(i) = plrclm(i) ! maximum stomatal resistance - tg3anl(i) = tg3clm(i) ! deep soil temperature - cnpanl(i) = cnpclm(i) ! canopy water content - veganl(i) = vegclm(i) ! vegetation cover - vetanl(i) = vetclm(i) ! vegetation type - sotanl(i) = sotclm(i) ! soil type - cvanl(i) = cvclm(i) ! cv - cvbanl(i) = cvbclm(i) ! cvb - cvtanl(i) = cvtclm(i) ! cvt -!cwu [+4l] add sih, sic - sihanl(i) = sihclm(i) ! sea ice thickness - sicanl(i) = sicclm(i) ! sea ice concentration -!clu [+4l] add vmn, vmx, slp, abs - vmnanl(i) = vmnclm(i) ! min vegetation cover - vmxanl(i) = vmxclm(i) ! max vegetation cover - slpanl(i) = slpclm(i) ! slope type - absanl(i) = absclm(i) ! max snow albedo - enddo -! - do j=1,lsoil - do i=1,len - smcanl(i,j) = smcclm(i,j) ! layer soil wetness - stcanl(i,j) = stcclm(i,j) ! soil temperature - enddo - enddo - do j=1,4 - do i=1,len - albanl(i,j) = albclm(i,j) ! albedo - enddo - enddo - do j=1,2 - do i=1,len - alfanl(i,j) = alfclm(i,j) ! vegetation fraction for albedo - enddo - enddo -! - return - end - -!>\ingroup mod_sfcsub - subroutine analy(lugb,iy,im,id,ih,fh,len,lsoil, - & slmask,fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, - & fntg3a,fnscva,fnsmca,fnstca,fnacna,fnvega, - & fnveta,fnsota, -!clu [+1l] add fn()a for vmn, vmx, slp, abs - & fnvmna,fnvmxa,fnslpa,fnabsa, - & tsfanl,wetanl,snoanl,zoranl,albanl,aisanl, - & tg3anl,cvanl ,cvbanl,cvtanl, - & smcanl,stcanl,slianl,scvanl,acnanl,veganl, - & vetanl,sotanl,alfanl,tsfan0, -!clu [+1l] add ()anl for vmn, vmx, slp, abs - & vmnanl,vmxanl,slpanl,absanl, -!cggg snow mods start & kpdtsf,kpdwet,kpdsno,kpdzor,kpdalb,kpdais, - & kpdtsf,kpdwet,kpdsno,kpdsnd,kpdzor,kpdalb,kpdais, -!cggg snow mods end - & kpdtg3,kpdscv,kpdacn,kpdsmc,kpdstc,kpdveg, - & kprvet,kpdsot,kpdalf, -!clu [+1l] add kpd() for vmn, vmx, slp, abs - & kpdvmn,kpdvmx,kpdslp,kpdabs, - & irttsf,irtwet,irtsno,irtzor,irtalb,irtais, - & irttg3,irtscv,irtacn,irtsmc,irtstc,irtveg, - & irtvet,irtsot,irtalf -!clu [+1l] add irt() for vmn, vmx, slp, abs - &, irtvmn,irtvmx,irtslp,irtabs - &, imsk, jmsk, slmskh, outlat, outlon - &, gaus, blno, blto, me, lanom) - use machine , only : kind_io8,kind_io4 - implicit none - logical lanom - integer irtsmc,irtacn,irtstc,irtvet,irtveg,irtscv,irtzor,irtsno, - & irtalb,irttg3,irtais,iret,me,kk,kpdvet,i,irtalf,irtsot, -!cggg snow mods start & imsk,jmsk,irtwet,lsoil,len, kpdtsf,kpdsno,kpdwet,iy, - & imsk,jmsk,irtwet,lsoil,len,kpdtsf,kpdsno,kpdsnd,kpdwet,iy, -!cggg snow mods end - & lugb,im,ih,id,kpdveg,kpdstc,kprvet,irttsf,kpdsot,kpdsmc, - & kpdais,kpdzor,kpdtg3,kpdacn,kpdscv,j -!clu [+1l] add kpd() and irt() for vmn, vmx, slp, abs - &, kpdvmn,kpdvmx,kpdslp,kpdabs,irtvmn,irtvmx,irtslp,irtabs - real (kind=kind_io8) blto,blno,fh -! - real (kind=kind_io8) slmask(len) - real (kind=kind_io8) slmskh(imsk,jmsk) - real (kind=kind_io8) outlat(len), outlon(len) - integer kpdalb(4), kpdalf(2) -!cggg snow mods start - integer kpds(1000),kgds(1000),jpds(1000),jgds(1000) - integer lugi, lskip, lgrib, ndata -!cggg snow mods end -! - character*500 fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, - & fntg3a,fnscva,fnsmca,fnstca,fnacna,fnvega, - & fnveta,fnsota -!clu [+1l] add fn()a for vmn, vmx, slp, abs - &, fnvmna,fnvmxa,fnslpa,fnabsa - - real (kind=kind_io8) tsfanl(len), wetanl(len), snoanl(len), - & zoranl(len), albanl(len,4), aisanl(len), - & tg3anl(len), acnanl(len), - & cvanl (len), cvbanl(len), cvtanl(len), - & slianl(len), scvanl(len), veganl(len), - & vetanl(len), sotanl(len), alfanl(len,2), - & smcanl(len,lsoil), stcanl(len,lsoil), - & tsfan0(len) -!clu [+1l] add ()anl for vmn, vmx, slp, abs - &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len) -! - logical gaus -! -! tsf -! - irttsf = 1 - if(fntsfa(1:8).ne.' ') then - call fixrda(lugb,fntsfa,kpdtsf,slmask, - & iy,im,id,ih,fh,tsfanl,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irttsf = iret - if(iret == 1) then - write(6,*) 't surface analysis read error' - call abort - elseif(iret == -1) then - if (me == 0) then - print *,'old t surface analysis provided, indicating proper' - &, ' file name is given. no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me == 0) print *,'t surface analysis provided.' - endif - else - if (me == 0) then -! print *,'************************************************' - print *,'no tsf analysis available. climatology used' - endif - endif -! -! tsf0 -! - if(fntsfa(1:8).ne.' ' .and. lanom) then - call fixrda(lugb,fntsfa,kpdtsf,slmask, - & iy,im,id,ih,0.,tsfan0,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - if(iret == 1) then - write(6,*) 't surface at ft=0 analysis read error' - call abort - elseif(iret == -1) then - if (me == 0) then - write(6,*) 'could not find t surface analysis at ft=0' - endif - call abort - else - print *,'t surface analysis at ft=0 found.' - endif - else - do i=1,len - tsfan0(i)=-999.9 - enddo - endif -! -! albedo -! - irtalb=0 - if(fnalba(1:8).ne.' ') then - do kk = 1, 4 - call fixrda(lugb,fnalba,kpdalb(kk),slmask, - & iy,im,id,ih,fh,albanl(1,kk),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irtalb=iret - if(iret.eq.1) then - write(6,*) 'albedo analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old albedo analysis provided, indicating proper', - & ' file name is given. no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0 .and. kk .eq. 4) - & print *,'albedo analysis provided.' - endif - enddo - else - if (me .eq. 0) then -! print *,'************************************************' - print *,'no albedo analysis available. climatology used' - endif - endif -! -! vegetation fraction for albedo -! - irtalf=0 - if(fnalba(1:8).ne.' ') then - do kk = 1, 2 - call fixrda(lugb,fnalba,kpdalf(kk),slmask, - & iy,im,id,ih,fh,alfanl(1,kk),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irtalf=iret - if(iret.eq.1) then - write(6,*) 'albedo analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old albedo analysis provided, indicating proper', - & ' file name is given. no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0 .and. kk .eq. 4) - & print *,'albedo analysis provided.' - endif - enddo - else - if (me .eq. 0) then -! print *,'************************************************' - print *,'no vegfalbedo analysis available. climatology used' - endif - endif -! -! soil wetness -! - irtwet=0 - irtsmc=0 - if(fnweta(1:8).ne.' ') then - call fixrda(lugb,fnweta,kpdwet,slmask, - & iy,im,id,ih,fh,wetanl,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irtwet=iret - if(iret.eq.1) then - write(6,*) 'bucket wetness analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old wetness analysis provided, indicating proper', - & ' file name is given. no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0) print *,'bucket wetness analysis provided.' - endif - elseif(fnsmca(1:8).ne.' ') then - call fixrda(lugb,fnsmca,kpdsmc,slmask, - & iy,im,id,ih,fh,smcanl(1,1),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - call fixrda(lugb,fnsmca,kpdsmc,slmask, - & iy,im,id,ih,fh,smcanl(1,2),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irtsmc=iret - if(iret.eq.1) then - write(6,*) 'layer soil wetness analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old layer soil wetness analysis provided', - & ' indicating proper file name is given.' - print *,' no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0) print *,'layer soil wetness analysis provided.' - endif - else - if (me .eq. 0) then -! print *,'************************************************' - print *,'no soil wetness analysis available. climatology used' - endif - endif -! -! read in snow depth/snow cover -! - irtscv=0 - if(fnsnoa(1:8).ne.' ') then - do i=1,len - scvanl(i)=0. - enddo -!cggg snow mods start -!cggg need to determine if the snow data is on the gaussian grid -!cggg or not. if gaussian, then data is a depth, not liq equiv -!cggg depth. if not gaussian, then data is from hua-lu's -!cggg program and is a liquid equiv. need to communicate -!cggg this to routine fixrda via the 3rd argument which is -!cggg the grib parameter id number. - call baopenr(lugb,fnsnoa,iret) - if (iret .ne. 0) then - write(6,*) ' error in opening file ',trim(fnsnoa) - print *,'error in opening file ',trim(fnsnoa) - call abort - endif - lugi=0 - lskip=-1 - jpds=-1 - jgds=-1 - kpds=jpds - call getgbh(lugb,lugi,lskip,jpds,jgds,lgrib,ndata, - & lskip,kpds,kgds,iret) - close(lugb) - if (iret .ne. 0) then - write(6,*) ' error reading header of file: ',trim(fnsnoa) - print *,'error reading header of file: ',trim(fnsnoa) - call abort - endif - if (kgds(1) == 4) then ! gaussian data is depth - call fixrda(lugb,fnsnoa,kpdsnd,slmask, - & iy,im,id,ih,fh,snoanl,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - snoanl=snoanl*100. ! convert from meters to liq. eq. - ! depth in mm using 10:1 ratio - else ! lat/lon data is liq equv. depth - call fixrda(lugb,fnsnoa,kpdsno,slmask, - & iy,im,id,ih,fh,snoanl,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - endif -!cggg snow mods end - irtscv=iret - if(iret.eq.1) then - write(6,*) 'snow depth analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old snow depth analysis provided, indicating proper', - & ' file name is given. no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0) print *,'snow depth analysis provided.' - endif - irtsno=0 - elseif(fnscva(1:8).ne.' ') then - do i=1,len - snoanl(i)=0. - enddo - call fixrda(lugb,fnscva,kpdscv,slmask, - & iy,im,id,ih,fh,scvanl,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irtsno=iret - if(iret.eq.1) then - write(6,*) 'snow cover analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old snow cover analysis provided, indicating proper', - & ' file name is given. no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0) print *,'snow cover analysis provided.' - endif - else - if (me .eq. 0) then -! print *,'************************************************' - print *,'no snow/snocov analysis available. climatology used' - endif - endif -! -! sea ice mask -! - irtacn=0 - irtais=0 - if(fnacna(1:8).ne.' ') then - call fixrda(lugb,fnacna,kpdacn,slmask, - & iy,im,id,ih,fh,acnanl,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irtacn=iret - if(iret.eq.1) then - write(6,*) 'ice concentration analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old ice concentration analysis provided', - & ' indicating proper file name is given' - print *,' no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0) print *,'ice concentration analysis provided.' - endif - elseif(fnaisa(1:8).ne.' ') then - call fixrda(lugb,fnaisa,kpdais,slmask, - & iy,im,id,ih,fh,aisanl,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irtais=iret - if(iret.eq.1) then - write(6,*) 'ice mask analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old ice-mask analysis provided, indicating proper', - & ' file name is given. no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0) print *,'ice mask analysis provided.' - endif - else - if (me .eq. 0) then -! print *,'************************************************' - print *,'no sea-ice analysis available. climatology used' - endif - endif -! -! surface roughness -! - irtzor=0 - if(fnzora(1:8).ne.' ') then - call fixrda(lugb,fnzora,kpdzor,slmask, - & iy,im,id,ih,fh,zoranl,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irtzor=iret - if(iret.eq.1) then - write(6,*) 'roughness analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old roughness analysis provided, indicating proper', - & ' file name is given. no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0) print *,'roughness analysis provided.' - endif - else - if (me .eq. 0) then -! print *,'************************************************' - print *,'no srfc roughness analysis available. climatology used' - endif - endif -! -! deep soil temperature -! - irttg3=0 - irtstc=0 - if(fntg3a(1:8).ne.' ') then - call fixrda(lugb,fntg3a,kpdtg3,slmask, - & iy,im,id,ih,fh,tg3anl,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irttg3=iret - if(iret.eq.1) then - write(6,*) 'deep soil tmp analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old deep soil temp analysis provided', - & ' indicating proper file name is given.' - print *,' no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0) print *,'deep soil tmp analysis provided.' - endif - elseif(fnstca(1:8).ne.' ') then - call fixrda(lugb,fnstca,kpdstc,slmask, - & iy,im,id,ih,fh,stcanl(1,1),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - call fixrda(lugb,fnstca,kpdstc,slmask, - & iy,im,id,ih,fh,stcanl(1,2),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irtstc=iret - if(iret.eq.1) then - write(6,*) 'layer soil tmp analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old deep soil temp analysis provided', - & 'iindicating proper file name is given.' - print *,' no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0) print *,'layer soil tmp analysis provided.' - endif - else - if (me .eq. 0) then -! print *,'************************************************' - print *,'no deep soil temp analy available. climatology used' - endif - endif -! -! vegetation cover -! - irtveg=0 - if(fnvega(1:8).ne.' ') then - call fixrda(lugb,fnvega,kpdveg,slmask, - & iy,im,id,ih,fh,veganl,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irtveg=iret - if(iret.eq.1) then - write(6,*) 'vegetation cover analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old vegetation cover analysis provided', - & ' indicating proper file name is given.' - print *,' no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0) print *,'gegetation cover analysis provided.' - endif - else - if (me .eq. 0) then -! print *,'************************************************' - print *,'no vegetation cover anly available. climatology used' - endif - endif -! -! vegetation type -! - irtvet=0 - if(fnveta(1:8).ne.' ') then - call fixrda(lugb,fnveta,kpdvet,slmask, - & iy,im,id,ih,fh,vetanl,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irtvet=iret - if(iret.eq.1) then - write(6,*) 'vegetation type analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old vegetation type analysis provided', - & ' indicating proper file name is given.' - print *,' no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0) print *,'vegetation type analysis provided.' - endif - else - if (me .eq. 0) then -! print *,'************************************************' - print *,'no vegetation type anly available. climatology used' - endif - endif -! -! soil type -! - irtsot=0 - if(fnsota(1:8).ne.' ') then - call fixrda(lugb,fnsota,kpdsot,slmask, - & iy,im,id,ih,fh,sotanl,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irtsot=iret - if(iret.eq.1) then - write(6,*) 'soil type analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old soil type analysis provided', - & ' indicating proper file name is given.' - print *,' no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0) print *,'soil type analysis provided.' - endif - else - if (me .eq. 0) then -! print *,'************************************************' - print *,'no soil type anly available. climatology used' - endif - endif - -!clu [+120l]-------------------------------------------------------------- -! -! min vegetation cover -! - irtvmn=0 - if(fnvmna(1:8).ne.' ') then - call fixrda(lugb,fnvmna,kpdvmn,slmask, - & iy,im,id,ih,fh,vmnanl,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irtvmn=iret - if(iret.eq.1) then - write(6,*) 'shdmin analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old shdmin analysis provided', - & ' indicating proper file name is given.' - print *,' no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0) print *,'shdmin analysis provided.' - endif - else - if (me .eq. 0) then -! print *,'************************************************' - print *,'no shdmin anly available. climatology used' - endif - endif - -! -! max vegetation cover -! - irtvmx=0 - if(fnvmxa(1:8).ne.' ') then - call fixrda(lugb,fnvmxa,kpdvmx,slmask, - & iy,im,id,ih,fh,vmxanl,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irtvmx=iret - if(iret.eq.1) then - write(6,*) 'shdmax analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old shdmax analysis provided', - & ' indicating proper file name is given.' - print *,' no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0) print *,'shdmax analysis provided.' - endif - else - if (me .eq. 0) then -! print *,'************************************************' - print *,'no shdmax anly available. climatology used' - endif - endif - -! -! slope type -! - irtslp=0 - if(fnslpa(1:8).ne.' ') then - call fixrda(lugb,fnslpa,kpdslp,slmask, - & iy,im,id,ih,fh,slpanl,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irtslp=iret - if(iret.eq.1) then - write(6,*) 'slope type analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old slope type analysis provided', - & ' indicating proper file name is given.' - print *,' no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0) print *,'slope type analysis provided.' - endif - else - if (me .eq. 0) then -! print *,'************************************************' - print *,'no slope type anly available. climatology used' - endif - endif - -! -! max snow albedo -! - irtabs=0 - if(fnabsa(1:8).ne.' ') then - call fixrda(lugb,fnabsa,kpdabs,slmask, - & iy,im,id,ih,fh,absanl,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - irtabs=iret - if(iret.eq.1) then - write(6,*) 'snoalb analysis read error' - call abort - elseif(iret.eq.-1) then - if (me .eq. 0) then - print *,'old snoalb analysis provided', - & ' indicating proper file name is given.' - print *,' no error suspected.' - write(6,*) 'forecast guess will be used' - endif - else - if (me .eq. 0) print *,'snoalb analysis provided.' - endif - else - if (me .eq. 0) then -! print *,'************************************************' - print *,'no snoalb anly available. climatology used' - endif - endif - -!clu ---------------------------------------------------------------------- -! - return - end - -!>\ingroup mod_sfcsub - subroutine filfcs(tsffcs,wetfcs,snofcs,zorfcs,albfcs, - & tg3fcs,cvfcs ,cvbfcs,cvtfcs, - & cnpfcs,smcfcs,stcfcs,slifcs,aisfcs, - & vegfcs, vetfcs, sotfcs, alffcs, -!cwu [+1l] add ()fcs for sih, sic - & sihfcs,sicfcs, -!clu [+1l] add ()fcs for vmn, vmx, slp, abs - & vmnfcs,vmxfcs,slpfcs,absfcs, - & tsfanl,wetanl,snoanl,zoranl,albanl, - & tg3anl,cvanl ,cvbanl,cvtanl, - & cnpanl,smcanl,stcanl,slianl,aisanl, - & veganl, vetanl, sotanl, alfanl, -!cwu [+1l] add ()anl for sih, sic - & sihanl,sicanl, -!clu [+1l] add ()anl for vmn, vmx, slp, abs - & vmnanl,vmxanl,slpanl,absanl, - & len,lsoil) -! - use machine , only : kind_io8,kind_io4 - implicit none - integer i,j,len,lsoil - real (kind=kind_io8) tsffcs(len),wetfcs(len),snofcs(len), - & zorfcs(len),albfcs(len,4),aisfcs(len), - & tg3fcs(len), - & cvfcs (len),cvbfcs(len),cvtfcs(len), - & cnpfcs(len), - & smcfcs(len,lsoil),stcfcs(len,lsoil), - & slifcs(len),vegfcs(len), - & vetfcs(len),sotfcs(len),alffcs(len,2) -!cwu [+1l] add ()fcs for sih, sic - &, sihfcs(len),sicfcs(len) -!clu [+1l] add ()fcs for vmn, vmx, slp, abs - &, vmnfcs(len),vmxfcs(len),slpfcs(len),absfcs(len) - real (kind=kind_io8) tsfanl(len),wetanl(len),snoanl(len), - & zoranl(len),albanl(len,4),aisanl(len), - & tg3anl(len), - & cvanl (len),cvbanl(len),cvtanl(len), - & cnpanl(len), - & smcanl(len,lsoil),stcanl(len,lsoil), - & slianl(len),veganl(len), - & vetanl(len),sotanl(len),alfanl(len,2) -!cwu [+1l] add ()anl for sih, sic - &, sihanl(len),sicanl(len) -!clu [+1l] add ()anl for vmn, vmx, slp, abs - &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len) -! - write(6,*) ' this is a dead start run, tsfc over land is', - & ' set as lowest sigma level temperture if given.' - write(6,*) ' if not, set to climatological tsf over land is used' -! -! - do i=1,len - tsffcs(i) = tsfanl(i) ! tsf - albfcs(i,1) = albanl(i,1) ! albedo - albfcs(i,2) = albanl(i,2) ! albedo - albfcs(i,3) = albanl(i,3) ! albedo - albfcs(i,4) = albanl(i,4) ! albedo - wetfcs(i) = wetanl(i) ! soil wetness - snofcs(i) = snoanl(i) ! snow - aisfcs(i) = aisanl(i) ! seaice - slifcs(i) = slianl(i) ! land/sea/snow mask - zorfcs(i) = zoranl(i) ! surface roughness -! plrfcs(i) = plranl(i) ! maximum stomatal resistance - tg3fcs(i) = tg3anl(i) ! deep soil temperature - cnpfcs(i) = cnpanl(i) ! canopy water content - cvfcs(i) = cvanl(i) ! cv - cvbfcs(i) = cvbanl(i) ! cvb - cvtfcs(i) = cvtanl(i) ! cvt - vegfcs(i) = veganl(i) ! vegetation cover - vetfcs(i) = vetanl(i) ! vegetation type - sotfcs(i) = sotanl(i) ! soil type - alffcs(i,1) = alfanl(i,1) ! vegetation fraction for albedo - alffcs(i,2) = alfanl(i,2) ! vegetation fraction for albedo -!cwu [+2l] add sih, sic - sihfcs(i) = sihanl(i) ! sea ice thickness - sicfcs(i) = sicanl(i) ! sea ice concentration -!clu [+4l] add vmn, vmx, slp, abs - vmnfcs(i) = vmnanl(i) ! min vegetation cover - vmxfcs(i) = vmxanl(i) ! max vegetation cover - slpfcs(i) = slpanl(i) ! slope type - absfcs(i) = absanl(i) ! max snow albedo - enddo -! - do j=1,lsoil - do i=1,len - smcfcs(i,j) = smcanl(i,j) ! layer soil wetness - stcfcs(i,j) = stcanl(i,j) ! soil temperature - enddo - enddo -! - return - end - -!>\ingroup mod_sfcsub - subroutine bktges(smcfcs,slianl,stcfcs,len,lsoil) -! - use machine , only : kind_io8,kind_io4 - implicit none - integer i,j,len,lsoil,k - real (kind=kind_io8) smcfcs(len,lsoil), stcfcs(len,lsoil), - & slianl(len) -! -! note that smfcs comes in with the original unit (cm?) (not grib file) -! - do i = 1, len - smcfcs(i,1) = (smcfcs(i,1)/150.) * .37 + .1 - enddo - do k = 2, lsoil - do i = 1, len - smcfcs(i,k) = smcfcs(i,1) - enddo - enddo - if(lsoil.gt.2) then - do k = 3, lsoil - do i = 1, len - stcfcs(i,k) = stcfcs(i,2) - enddo - enddo - endif -! - return - end - -!>\ingroup mod_sfcsub - subroutine rof01(aisfld,len,op,crit) - use machine , only : kind_io8,kind_io4 - implicit none - integer i,len - real (kind=kind_io8) aisfld(len),crit - character*2 op -! - if(op.eq.'ge') then - do i=1,len - if(aisfld(i).ge.crit) then - aisfld(i)=1. - else - aisfld(i)=0. - endif - enddo - elseif(op.eq.'gt') then - do i=1,len - if(aisfld(i).gt.crit) then - aisfld(i)=1. - else - aisfld(i)=0. - endif - enddo - elseif(op.eq.'le') then - do i=1,len - if(aisfld(i).le.crit) then - aisfld(i)=1. - else - aisfld(i)=0. - endif - enddo - elseif(op.eq.'lt') then - do i=1,len - if(aisfld(i).lt.crit) then - aisfld(i)=1. - else - aisfld(i)=0. - endif - enddo - else - write(6,*) ' illegal operator in rof01. op=',op - call abort - endif -! - return - end - -!>\ingroup mod_sfcsub - subroutine tsfcor(tsfc,orog,slmask,umask,len,rlapse) -! - use machine , only : kind_io8,kind_io4 - implicit none - integer i,len - real (kind=kind_io8) rlapse,umask - real (kind=kind_io8) tsfc(len), orog(len), slmask(len) -! - do i=1,len - if(slmask(i).eq.umask) then - tsfc(i) = tsfc(i) - orog(i)*rlapse - endif - enddo - return - end - subroutine snodpth(scvanl,slianl,tsfanl,snoclm, - & glacir,snwmax,snwmin,landice,len,snoanl, me) - use machine , only : kind_io8,kind_io4 - implicit none - integer i,me,len - logical, intent(in) :: landice - real (kind=kind_io8) sno,snwmax,snwmin -! - real (kind=kind_io8) scvanl(len), slianl(len), tsfanl(len), - & snoclm(len), snoanl(len), glacir(len) -! - if (me .eq. 0) write(6,*) 'snodpth' -! -! use surface temperature to get snow depth estimate -! - do i=1,len - sno = 0.0 -! -! over land -! - if(slianl(i).eq.1.) then - if(scvanl(i).eq.1.0) then - if(tsfanl(i).lt.243.0) then - sno = snwmax - elseif(tsfanl(i).lt.273.0) then - sno = snwmin+(snwmax-snwmin)*(273.0-tsfanl(i))/30.0 - else - sno = snwmin - endif - endif -! -! if glacial points has snow in climatology, set sno to snomax -! - if (.not.landice) then - if(glacir(i).eq.1.0) then - sno = snoclm(i) - if(sno.eq.0.) sno=snwmax - endif - endif - endif -! -! over sea ice -! -! snow over sea ice is cycled as of 01/01/94.....hua-lu pan -! - if(slianl(i).eq.2.0) then - sno=snoclm(i) - if(sno.eq.0.) sno=snwmax - endif -! - snoanl(i) = sno - enddo - return - end subroutine snodpth - -!>\ingroup mod_sfcsub - subroutine merge(len,lsoil,iy,im,id,ih,fh,deltsfc, - & sihfcs,sicfcs, - & vmnfcs,vmxfcs,slpfcs,absfcs, - & tsffcs,wetfcs,snofcs,zorfcs,albfcs,aisfcs, - & cvfcs ,cvbfcs,cvtfcs, - & cnpfcs,smcfcs,stcfcs,slifcs,vegfcs, - & vetfcs,sotfcs,alffcs, - & sihanl,sicanl, - & vmnanl,vmxanl,slpanl,absanl, - & tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl,aisanl, - & cvanl ,cvbanl,cvtanl, - & cnpanl,smcanl,stcanl,slianl,veganl, - & vetanl,sotanl,alfanl, - & ctsfl,calbl,caisl,csnol,csmcl,czorl,cstcl,cvegl, - & ctsfs,calbs,caiss,csnos,csmcs,czors,cstcs,cvegs, - & ccv,ccvb,ccvt,ccnp,cvetl,cvets,csotl,csots, - & calfl,calfs, - & csihl,csihs,csicl,csics, - & cvmnl,cvmns,cvmxl,cvmxs,cslpl,cslps,cabsl,cabss, - & irttsf,irtwet,irtsno,irtzor,irtalb,irtais, - & irttg3,irtscv,irtacn,irtsmc,irtstc,irtveg, - & irtvmn,irtvmx,irtslp,irtabs, - & irtvet,irtsot,irtalf, landice, me) - use machine , only : kind_io8,kind_io4 - use sfccyc_module, only : veg_type_landice, soil_type_landice - implicit none - integer k,i,im,id,iy,len,lsoil,ih,irtacn,irtsmc,irtscv,irtais, - & irttg3,irtstc,irtalf,me,irtsot,irtveg,irtvet, irtzor, - & irtalb,irtsno,irttsf,irtwet,j - &, irtvmn,irtvmx,irtslp,irtabs - logical, intent(in) :: landice - real (kind=kind_io8) rvegs,rvets,rzors,raiss,rsnos,rsots,rcnp, - & rcvt,rcv,rcvb,rsnol,rzorl,raisl,ralbl, - & ralfl,rvegl,ralbs,ralfs,rtsfs,rvetl,rsotl, - & qzors,qvegs,qsnos,qalfs,qaiss,qvets,qcvt, - & qcnp,qcvb,qsots,qcv,qaisl,qsnol,qalfl, - & qtsfl,qalbl,qzorl,qtsfs,qalbs,qsotl,qvegl, - & qvetl,rtsfl,calbs,caiss,ctsfs,czorl,cvegl, - & csnos,ccvb,ccvt,ccv,czors,cvegs,caisl,csnol, - & calbl,fh,ctsfl,ccnp,csots,calfl,csotl,cvetl, - & cvets,calfs,deltsfc, - & csihl,csihs,csicl,csics, - & rsihl,rsihs,rsicl,rsics, - & qsihl,qsihs,qsicl,qsics - &, cvmnl,cvmns,cvmxl,cvmxs,cslpl,cslps - &, cabsl,cabss,rvmnl,rvmns,rvmxl,rvmxs - &, rslpl,rslps,rabsl,rabss,qvmnl,qvmns - &, qvmxl,qvmxs,qslpl,qslps,qabsl,qabss -! - real (kind=kind_io8) tsffcs(len), wetfcs(len), snofcs(len), - & zorfcs(len), albfcs(len,4), aisfcs(len), - & cvfcs (len), cvbfcs(len), cvtfcs(len), - & cnpfcs(len), - & smcfcs(len,lsoil),stcfcs(len,lsoil), - & slifcs(len), vegfcs(len), - & vetfcs(len), sotfcs(len), alffcs(len,2) - &, sihfcs(len), sicfcs(len) - &, vmnfcs(len),vmxfcs(len),slpfcs(len),absfcs(len) - real (kind=kind_io8) tsfanl(len),tsfan2(len), - & wetanl(len),snoanl(len), - & zoranl(len), albanl(len,4), aisanl(len), - & cvanl (len), cvbanl(len), cvtanl(len), - & cnpanl(len), - & smcanl(len,lsoil),stcanl(len,lsoil), - & slianl(len), veganl(len), - & vetanl(len), sotanl(len), alfanl(len,2) - &, sihanl(len),sicanl(len) - &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len) -! - real (kind=kind_io8) csmcl(lsoil), csmcs(lsoil), - & cstcl(lsoil), cstcs(lsoil) - real (kind=kind_io8) rsmcl(lsoil), rsmcs(lsoil), - & rstcl(lsoil), rstcs(lsoil) - real (kind=kind_io8) qsmcl(lsoil), qsmcs(lsoil), - & qstcl(lsoil), qstcs(lsoil) - logical first - integer num_threads - data first /.true./ - save num_threads, first -! - integer len_thread_m, i1_t, i2_t, it - integer num_parthds -! - if (first) then - num_threads = num_parthds() - first = .false. - endif -! -! coeeficients of blending forecast and interpolated clim -! (or analyzed) fields over sea or land(l) (not for clouds) -! 1.0 = use of forecast -! 0.0 = replace with interpolated analysis -! -! merging coefficients are defined by parameter statement in calling program -! and therefore they should not be modified in this program. -! - rtsfl = ctsfl - ralbl = calbl - ralfl = calfl - raisl = caisl - rsnol = csnol -!clu rsmcl = csmcl - rzorl = czorl - rvegl = cvegl - rvetl = cvetl - rsotl = csotl - rsihl = csihl - rsicl = csicl - rvmnl = cvmnl - rvmxl = cvmxl - rslpl = cslpl - rabsl = cabsl -! - rtsfs = ctsfs - ralbs = calbs - ralfs = calfs - raiss = caiss - rsnos = csnos -! rsmcs = csmcs - rzors = czors - rvegs = cvegs - rvets = cvets - rsots = csots - rsihs = csihs - rsics = csics - rvmns = cvmns - rvmxs = cvmxs - rslps = cslps - rabss = cabss -! - rcv = ccv - rcvb = ccvb - rcvt = ccvt - rcnp = ccnp -! - do k=1,lsoil - rsmcl(k) = csmcl(k) - rsmcs(k) = csmcs(k) - rstcl(k) = cstcl(k) - rstcs(k) = cstcs(k) - enddo - if (fh-deltsfc < -0.001 .and. irttsf == 1) then - rtsfs = 1.0 - rtsfl = 1.0 -! do k=1,lsoil -! rsmcl(k) = 1.0 -! rsmcs(k) = 1.0 -! rstcl(k) = 1.0 -! rstcs(k) = 1.0 -! enddo - endif -! -! if analysis file name is given but no matching analysis date found, -! use guess (these are flagged by irt???=1). -! - if(irttsf == -1) then - rtsfl = 1. - rtsfs = 1. - endif - if(irtalb == -1) then - ralbl = 1. - ralbs = 1. - ralfl = 1. - ralfs = 1. - endif - if(irtais == -1) then - raisl = 1. - raiss = 1. - endif - if(irtsno == -1 .or. irtscv == -1) then - rsnol = 1. - rsnos = 1. - endif - if(irtsmc == -1 .or. irtwet == -1) then -! rsmcl = 1. -! rsmcs = 1. - do k=1,lsoil - rsmcl(k) = 1. - rsmcs(k) = 1. - enddo - endif - if(irtstc.eq.-1) then - do k=1,lsoil - rstcl(k) = 1. - rstcs(k) = 1. - enddo - endif - if(irtzor == -1) then - rzorl = 1. - rzors = 1. - endif - if(irtveg == -1) then - rvegl = 1. - rvegs = 1. - endif - if(irtvet.eq.-1) then - rvetl = 1. - rvets = 1. - endif - if(irtsot == -1) then - rsotl = 1. - rsots = 1. - endif - - if(irtacn == -1) then - rsicl = 1. - rsics = 1. - endif - if(irtvmn == -1) then - rvmnl = 1. - rvmns = 1. - endif - if(irtvmx == -1) then - rvmxl = 1. - rvmxs = 1. - endif - if(irtslp == -1) then - rslpl = 1. - rslps = 1. - endif - if(irtabs == -1) then - rabsl = 1. - rabss = 1. - endif -! - if(raiss == 1. .or. irtacn == -1) then - if (me == 0) print *,'use forecast land-sea-ice mask' - do i = 1, len - aisanl(i) = aisfcs(i) - slianl(i) = slifcs(i) - enddo - endif -! - if (me == 0) then - write(6,100) rtsfl,ralbl,raisl,rsnol,rsmcl,rzorl,rvegl - 100 format('rtsfl,ralbl,raisl,rsnol,rsmcl,rzorl,rvegl=',10f7.3) - write(6,101) rtsfs,ralbs,raiss,rsnos,rsmcs,rzors,rvegs - 101 format('rtsfs,ralbs,raiss,rsnos,rsmcs,rzors,rvegs=',10f7.3) -! print *,' ralfl=',ralfl,' ralfs=',ralfs,' rsotl=',rsotl -! *,' rsots=',rsots,' rvetl=',rvetl,' rvets=',rvets - endif -! - qtsfl = 1. - rtsfl - qalbl = 1. - ralbl - qalfl = 1. - ralfl - qaisl = 1. - raisl - qsnol = 1. - rsnol -! qsmcl = 1. - rsmcl - qzorl = 1. - rzorl - qvegl = 1. - rvegl - qvetl = 1. - rvetl - qsotl = 1. - rsotl - qsihl = 1. - rsihl - qsicl = 1. - rsicl - qvmnl = 1. - rvmnl - qvmxl = 1. - rvmxl - qslpl = 1. - rslpl - qabsl = 1. - rabsl -! - qtsfs = 1. - rtsfs - qalbs = 1. - ralbs - qalfs = 1. - ralfs - qaiss = 1. - raiss - qsnos = 1. - rsnos -! qsmcs = 1. - rsmcs - qzors = 1. - rzors - qvegs = 1. - rvegs - qvets = 1. - rvets - qsots = 1. - rsots - qsihs = 1. - rsihs - qsics = 1. - rsics - qvmns = 1. - rvmns - qvmxs = 1. - rvmxs - qslps = 1. - rslps - qabss = 1. - rabss -! - qcv = 1. - rcv - qcvb = 1. - rcvb - qcvt = 1. - rcvt - qcnp = 1. - rcnp -! - do k=1,lsoil - qsmcl(k) = 1. - rsmcl(k) - qsmcs(k) = 1. - rsmcs(k) - qstcl(k) = 1. - rstcl(k) - qstcs(k) = 1. - rstcs(k) - enddo -! -! merging -! - if(me .eq. 0) then - print *, 'dbgx-- csmcl:', (csmcl(k),k=1,lsoil) - print *, 'dbgx-- rsmcl:', (rsmcl(k),k=1,lsoil) - print *, 'dbgx-- csnol, csnos:',csnol,csnos - print *, 'dbgx-- rsnol, rsnos:',rsnol,rsnos - endif - -! print *, rtsfs, qtsfs, raiss , qaiss -! *, rsnos , qsnos, rzors , qzors, rvegs , qvegs -! *, rvets , qvets, rsots , qsots -! *, rcv, rcvb, rcvt, qcv, qcvb, qcvt -! *, ralbs, qalbs, ralfs, qalfs -! print *, rtsfl, qtsfl, raisl , qaisl -! *, rsnol , qsnol, rzorl , qzorl, rvegl , qvegl -! *, rvetl , qvetl, rsotl , qsotl -! *, ralbl, qalbl, ralfl, qalfl -! -! - len_thread_m = (len+num_threads-1) / num_threads - -!$omp parallel do private(i1_t,i2_t,it,i) - do it=1,num_threads ! start of threaded loop ................... - i1_t = (it-1)*len_thread_m+1 - i2_t = min(i1_t+len_thread_m-1,len) - do i=i1_t,i2_t - if(slianl(i).eq.0.) then - vetanl(i) = vetfcs(i)*rvets + vetanl(i)*qvets - sotanl(i) = sotfcs(i)*rsots + sotanl(i)*qsots - else - vetanl(i) = vetfcs(i)*rvetl + vetanl(i)*qvetl - sotanl(i) = sotfcs(i)*rsotl + sotanl(i)*qsotl - endif - enddo - enddo -!$omp end parallel do -! -!$omp parallel do private(i1_t,i2_t,it,i,k) -! - do it=1,num_threads ! start of threaded loop ................... - i1_t = (it-1)*len_thread_m+1 - i2_t = min(i1_t+len_thread_m-1,len) -! - do i=i1_t,i2_t - if(slianl(i).eq.0.) then -!.... tsffc2 is the previous anomaly + today's climatology -! tsffc2 = (tsffcs(i)-tsfan2(i))+tsfanl(i) -! tsfanl(i) = tsffc2 *rtsfs+tsfanl(i)*qtsfs -! - tsfanl(i) = tsffcs(i)*rtsfs + tsfanl(i)*qtsfs -! albanl(i) = albfcs(i)*ralbs + albanl(i)*qalbs - aisanl(i) = aisfcs(i)*raiss + aisanl(i)*qaiss - snoanl(i) = snofcs(i)*rsnos + snoanl(i)*qsnos - - zoranl(i) = zorfcs(i)*rzors + zoranl(i)*qzors - veganl(i) = vegfcs(i)*rvegs + veganl(i)*qvegs - sihanl(i) = sihfcs(i)*rsihs + sihanl(i)*qsihs - sicanl(i) = sicfcs(i)*rsics + sicanl(i)*qsics - vmnanl(i) = vmnfcs(i)*rvmns + vmnanl(i)*qvmns - vmxanl(i) = vmxfcs(i)*rvmxs + vmxanl(i)*qvmxs - slpanl(i) = slpfcs(i)*rslps + slpanl(i)*qslps - absanl(i) = absfcs(i)*rabss + absanl(i)*qabss - else - tsfanl(i) = tsffcs(i)*rtsfl + tsfanl(i)*qtsfl -! albanl(i) = albfcs(i)*ralbl + albanl(i)*qalbl - aisanl(i) = aisfcs(i)*raisl + aisanl(i)*qaisl - if(rsnol.ge.0)then - snoanl(i) = snofcs(i)*rsnol + snoanl(i)*qsnol - else ! envelope method - if(snoanl(i).ne.0)then - snoanl(i) = max(-snoanl(i)/rsnol, - & min(-snoanl(i)*rsnol, snofcs(i))) - endif - endif - zoranl(i) = zorfcs(i)*rzorl + zoranl(i)*qzorl - veganl(i) = vegfcs(i)*rvegl + veganl(i)*qvegl - vmnanl(i) = vmnfcs(i)*rvmnl + vmnanl(i)*qvmnl - vmxanl(i) = vmxfcs(i)*rvmxl + vmxanl(i)*qvmxl - slpanl(i) = slpfcs(i)*rslpl + slpanl(i)*qslpl - absanl(i) = absfcs(i)*rabsl + absanl(i)*qabsl - sihanl(i) = sihfcs(i)*rsihl + sihanl(i)*qsihl - sicanl(i) = sicfcs(i)*rsicl + sicanl(i)*qsicl - endif - - cnpanl(i) = cnpfcs(i)*rcnp + cnpanl(i)*qcnp -! -! snow over sea ice is cycled -! - if(slianl(i).eq.2.) then - snoanl(i) = snofcs(i) - endif -! - enddo - -! at landice points, set the soil type, slope type and -! greenness fields to flag values. - - if (landice) then - do i=i1_t,i2_t - if (nint(slianl(i)) == 1) then - if (nint(vetanl(i)) == veg_type_landice) then - sotanl(i) = soil_type_landice - veganl(i) = 0.0 - slpanl(i) = 9.0 - vmnanl(i) = 0.0 - vmxanl(i) = 0.0 - endif - end if ! if land - enddo - endif - - do i=i1_t,i2_t - cvanl(i) = cvfcs(i)*rcv + cvanl(i)*qcv - cvbanl(i) = cvbfcs(i)*rcvb + cvbanl(i)*qcvb - cvtanl(i) = cvtfcs(i)*rcvt + cvtanl(i)*qcvt - enddo -! - do k = 1, 4 - do i=i1_t,i2_t - if(slianl(i).eq.0.) then - albanl(i,k) = albfcs(i,k)*ralbs + albanl(i,k)*qalbs - else - albanl(i,k) = albfcs(i,k)*ralbl + albanl(i,k)*qalbl - endif - enddo - enddo -! - do k = 1, 2 - do i=i1_t,i2_t - if(slianl(i).eq.0.) then - alfanl(i,k) = alffcs(i,k)*ralfs + alfanl(i,k)*qalfs - else - alfanl(i,k) = alffcs(i,k)*ralfl + alfanl(i,k)*qalfl - endif - enddo - enddo -! - do k = 1, lsoil - do i=i1_t,i2_t - if(slianl(i).eq.0.) then - smcanl(i,k) = smcfcs(i,k)*rsmcs(k) + smcanl(i,k)*qsmcs(k) - stcanl(i,k) = stcfcs(i,k)*rstcs(k) + stcanl(i,k)*qstcs(k) - else -! soil moisture not used at landice points, so -! don't bother merging it. also, for now don't allow nudging -! to raise subsurface temperature above freezing. - stcanl(i,k) = stcfcs(i,k)*rstcl(k) + stcanl(i,k)*qstcl(k) - if (landice .and. slianl(i) == 1.0 .and. - & nint(vetanl(i)) == veg_type_landice) then - smcanl(i,k) = 1.0 ! use value as flag - stcanl(i,k) = min(stcanl(i,k), 273.15) - else - smcanl(i,k) = smcfcs(i,k)*rsmcl(k) + smcanl(i,k)*qsmcl(k) - end if - endif - enddo - enddo -! - enddo ! end of threaded loop ................... -!$omp end parallel do - return - end subroutine merge - -!>\ingroup mod_sfcsub - subroutine newice(slianl,slifcs,tsfanl,tsffcs,len,lsoil, -!cwu [+1l] add sihnew,sicnew,sihanl,sicanl - & sihnew,sicnew,sihanl,sicanl, - & albanl,snoanl,zoranl,smcanl,stcanl, - & albsea,snosea,zorsea,smcsea,smcice, - & tsfmin,tsfice,albice,zorice,tgice, - & rla,rlo,me) -! - use machine , only : kind_io8,kind_io4 - implicit none - real (kind=kind_io8), parameter :: one=1.0 - real (kind=kind_io8) tgice,albice,zorice,tsfice,albsea,snosea, - & smcice,tsfmin,zorsea,smcsea -!cwu [+1l] add sicnew,sihnew - &, sicnew,sihnew - integer i,me,kount1,kount2,k,len,lsoil - real (kind=kind_io8) slianl(len), slifcs(len), - & tsffcs(len),tsfanl(len) - real (kind=kind_io8) albanl(len,4), snoanl(len), zoranl(len) - real (kind=kind_io8) smcanl(len,lsoil), stcanl(len,lsoil) -!cwu [+1l] add sihanl & sicanl - real (kind=kind_io8) sihanl(len), sicanl(len) -! - real (kind=kind_io8) rla(len), rlo(len) -! - if (me .eq. 0) write(6,*) 'newice' -! - kount1 = 0 - kount2 = 0 - do i=1,len - if(slifcs(i).ne.slianl(i)) then - if(slifcs(i).eq.1..or.slianl(i).eq.1.) then - print *,'inconsistency in slifcs or slianl' - print 910,rla(i),rlo(i),slifcs(i),slianl(i), - & tsffcs(i),tsfanl(i) - 910 format(2x,'at lat=',f5.1,' lon=',f5.1,' slifcs=',f4.1, - & ' slimsk=',f4.1,' tsffcs=',f5.1,' set to tsfanl=',f5.1) - call abort - endif -! -! interpolated climatology indicates melted sea ice -! - if(slianl(i).eq.0..and.slifcs(i).eq.2.) then - tsfanl(i) = tsfmin - albanl(i,1) = albsea - albanl(i,2) = albsea - albanl(i,3) = albsea - albanl(i,4) = albsea - snoanl(i) = snosea - zoranl(i) = zorsea - do k = 1, lsoil - smcanl(i,k) = smcsea -!cwu [+1l] set stcanl to tgice (over sea-ice) - stcanl(i,k) = tgice - enddo -!cwu [+2l] set siganl and sicanl - sihanl(i) = 0. - sicanl(i) = 0. - kount1 = kount1 + 1 - endif -! -! interplated climatoloyg/analysis indicates new sea ice -! - if(slianl(i).eq.2..and.slifcs(i).eq.0.) then - tsfanl(i) = tsfice - albanl(i,1) = albice - albanl(i,2) = albice - albanl(i,3) = albice - albanl(i,4) = albice - snoanl(i) = 0. - zoranl(i) = zorice - do k = 1, lsoil - smcanl(i,k) = smcice - stcanl(i,k) = tgice - enddo -!cwu [+2l] add sihanl & sicanl - sihanl(i) = sihnew - sicanl(i) = min(one, max(sicnew,sicanl(i))) - kount2 = kount2 + 1 - endif - endif - enddo -! - if (me .eq. 0) then - if(kount1.gt.0) then - write(6,*) 'sea ice melted. tsf,alb,zor are filled', - & ' at ',kount1,' points' - endif - if(kount2.gt.0) then - write(6,*) 'sea ice formed. tsf,alb,zor are filled', - & ' at ',kount2,' points' - endif - endif -! - return - end - -!>\ingroup mod_sfcsub - subroutine qcsnow(snoanl,slmask,aisanl,glacir,len,snoval, - & landice,me) - use machine , only : kind_io8,kind_io4 - implicit none - integer kount,i,len,me - logical, intent(in) :: landice - real (kind=kind_io8) per,snoval - real (kind=kind_io8) snoanl(len),slmask(len), - & aisanl(len),glacir(len) - if (me .eq. 0) then - write(6,*) ' ' - write(6,*) 'qc of snow' - endif - if (.not.landice) then - kount=0 - do i=1,len - if(glacir(i).ne.0..and.snoanl(i).eq.0.) then -! if(glacir(i).ne.0..and.snoanl(i).lt.snoval*0.5) then - snoanl(i) = snoval - kount = kount + 1 - endif - enddo - per = float(kount) / float(len)*100. - if(kount.gt.0) then - if (me .eq. 0) then - print *,'snow filled over glacier points at ',kount, - & ' points (',per,'percent)' - endif - endif - endif ! landice check - kount = 0 - do i=1,len - if(slmask(i).eq.0.and.aisanl(i).eq.0) then - snoanl(i) = 0. - kount = kount + 1 - endif - enddo - per = float(kount) / float(len)*100. - if(kount.gt.0) then - if (me .eq. 0) then - print *,'snow set to zero over open sea at ',kount, - & ' points (',per,'percent)' - endif - endif - return - end subroutine qcsnow - -!>\ingroup mod_sfcsub - subroutine qcsice(ais,glacir,amxice,aicice,aicsea,sllnd,slmask, - & rla,rlo,len,me) - use machine , only : kind_io8,kind_io4 - implicit none - integer kount1,kount,i,me,len - real (kind=kind_io8) per,aicsea,aicice,sllnd -! - real (kind=kind_io8) ais(len), glacir(len), - & amxice(len), slmask(len) - real (kind=kind_io8) rla(len), rlo(len) -! -! check sea-ice cover mask against land-sea mask -! - if (me .eq. 0) write(6,*) 'qc of sea ice' - kount = 0 - kount1 = 0 - do i=1,len - if(ais(i).ne.aicice.and.ais(i).ne.aicsea) then - print *,'sea ice mask not ',aicice,' or ',aicsea - print *,'ais(i),aicice,aicsea,rla(i),rlo(i,=', - & ais(i),aicice,aicsea,rla(i),rlo(i) - call abort - endif - if(slmask(i).eq.0..and.glacir(i).eq.1..and. -! if(slmask(i).eq.0..and.glacir(i).eq.2..and. - & ais(i).ne.1.) then - kount1 = kount1 + 1 - ais(i) = 1. - endif - if(slmask(i).eq.sllnd.and.ais(i).eq.aicice) then - kount = kount + 1 - ais(i) = aicsea - endif - enddo -! enddo - per = float(kount) / float(len)*100. - if(kount.gt.0) then - if(me .eq. 0) then - print *,' sea ice over land mask at ',kount,' points (',per, - & 'percent)' - endif - endif - per = float(kount1) / float(len)*100. - if(kount1.gt.0) then - if(me .eq. 0) then - print *,' sea ice set over glacier points over ocean at ', - & kount1,' points (',per,'percent)' - endif - endif -! kount=0 -! do j=1,jdim -! do i=1,idim -! if(amxice(i,j).ne.0..and.ais(i,j).eq.0.) then -! ais(i,j)=0. -! kount=kount+1 -! endif -! enddo -! enddo -! per=float(kount)/float(idim*jdim)*100. -! if(kount.gt.0) then -! print *,' sea ice exceeds maxice at ',kount,' points (',per, -! & 'percent)' -! endif -! -! remove isolated open ocean surrounded by sea ice and/or land -! -! remove isolated open ocean surrounded by sea ice and/or land -! -! ij = 0 -! do j=1,jdim -! do i=1,idim -! ij = ij + 1 -! ip = i + 1 -! im = i - 1 -! jp = j + 1 -! jm = j - 1 -! if(jp.gt.jdim) jp = jdim - 1 -! if(jm.lt.1) jm = 2 -! if(ip.gt.idim) ip = 1 -! if(im.lt.1) im = idim -! if(slmask(i,j).eq.0..and.ais(i,j).eq.0.) then -! if((slmask(ip,jp).eq.1..or.ais(ip,jp).eq.1.).and. -! & (slmask(i ,jp).eq.1..or.ais(i ,jp).eq.1.).and. -! & (slmask(im,jp).eq.1..or.ais(im,jp).eq.1.).and. -! & (slmask(ip,j ).eq.1..or.ais(ip,j ).eq.1.).and. -! & (slmask(im,j ).eq.1..or.ais(im,j ).eq.1.).and. -! & (slmask(ip,jm).eq.1..or.ais(ip,jm).eq.1.).and. -! & (slmask(i ,jm).eq.1..or.ais(i ,jm).eq.1.).and. -! & (slmask(im,jm).eq.1..or.ais(im,jm).eq.1.)) then -! ais(i,j) = 1. -! write(6,*) ' isolated open sea point surrounded by', -! & ' sea ice or land modified to sea ice', -! & ' at lat=',rla(i,j),' lon=',rlo(i,j) -! endif -! endif -! enddo -! enddo - return - end - -!>\ingroup mod_sfcsub - subroutine setlsi(slmask,aisfld,len,aicice,slifld) -! - use machine , only : kind_io8,kind_io4 - implicit none - integer i,len - real (kind=kind_io8) aicice - real (kind=kind_io8) slmask(len), slifld(len), aisfld(len) -! -! set surface condition indicator slimsk -! - do i=1,len - slifld(i) = slmask(i) -! if(aisfld(i).eq.aicice) slifld(i) = 2.0 - if(aisfld(i).eq.aicice .and. slmask(i) .eq. 0.0) - & slifld(i) = 2.0 - enddo - return - end -!>\ingroup mod_sfcsub - subroutine scale(fld,len,scl) -! - use machine , only : kind_io8,kind_io4 - implicit none - integer i,len - real (kind=kind_io8) fld(len),scl - do i=1,len - fld(i) = fld(i) * scl - enddo - return - end - -!>\ingroup mod_sfcsub - subroutine qcmxmn(ttl,fld,slimsk,sno,iceflg, - & fldlmx,fldlmn,fldomx,fldomn,fldimx,fldimn, - & fldjmx,fldjmn,fldsmx,fldsmn,epsfld, - & rla,rlo,len,mode,percrit,lgchek,me) -! - use machine , only : kind_io8,kind_io4 - implicit none - real (kind=kind_io8) permax,per,fldimx,fldimn,fldjmx,fldomn, - & fldlmx,fldlmn,fldomx,fldjmn,percrit, - & fldsmx,fldsmn,epsfld - integer kmaxi,kmini,kmaxj,kmino,kmaxl,kminl,kmaxo,mmprt,kminj, - & ij,nprt,kmaxs,kmins,i,me,len,mode - parameter(mmprt=2) -! - character*8 ttl - logical iceflg(len) - real (kind=kind_io8) fld(len),slimsk(len),sno(len), - & rla(len), rlo(len) - integer iwk(len) - logical lgchek -! - logical first - integer num_threads - data first /.true./ - save num_threads, first -! - integer len_thread_m, i1_t, i2_t, it - integer num_parthds -! - if (first) then - num_threads = num_parthds() - first = .false. - endif -! -! check against land-sea mask and ice cover mask -! - if(me .eq. 0) then -! print *,' ' - print *,'performing qc of ',ttl,' mode=',mode, - & '(0=count only, 1=replace)' - endif -! - len_thread_m = (len+num_threads-1) / num_threads - kmaxl = 0 - kminl = 0 - kmaxo = 0 - kmino = 0 - kmaxi = 0 - kmini = 0 - kmaxj = 0 - kminj = 0 - kmaxs = 0 - kmins = 0 -!$omp parallel do private(i1_t,i2_t,it,i) -!$omp+private(nprt,ij,iwk) -!$omp+reduction(+:kmaxs,kmins,kmaxl,kminl,kmaxo) -!$omp+reduction(+:kmino,kmaxi,kmini,kmaxj,kminj) -!$omp+shared(mode,epsfld) -!$omp+shared(fldlmx,fldlmn,fldomx,fldjmn,fldsmx,fldsmn) -!$omp+shared(fld,slimsk,sno,rla,rlo) - do it=1,num_threads ! start of threaded loop - i1_t = (it-1)*len_thread_m+1 - i2_t = min(i1_t+len_thread_m-1,len) -! -! -! -! lower bound check over bare land -! - if (fldlmn .ne. 999.0) then - do i=i1_t,i2_t - if(slimsk(i).eq.1..and.sno(i).le.0..and. - & fld(i).lt.fldlmn-epsfld) then - kminl=kminl+1 - iwk(kminl) = i - endif - enddo - if(me == 0 . and. it == 1 .and. num_threads == 1) then - nprt = min(mmprt,kminl) - do i=1,nprt - ij = iwk(i) - print 8001,rla(ij),rlo(ij),fld(ij),fldlmn - 8001 format(' bare land min. check. lat=',f5.1, - & ' lon=',f6.1,' fld=',e13.6, ' to ',e13.6) - enddo - endif - if (mode .eq. 1) then - do i=1,kminl - fld(iwk(i)) = fldlmn - enddo - endif - endif -! -! upper bound check over bare land -! - if (fldlmx .ne. 999.0) then - do i=i1_t,i2_t - if(slimsk(i).eq.1..and.sno(i).le.0..and. - & fld(i).gt.fldlmx+epsfld) then - kmaxl=kmaxl+1 - iwk(kmaxl) = i - endif - enddo - if(me == 0 . and. it == 1 .and. num_threads == 1) then - nprt = min(mmprt,kmaxl) - do i=1,nprt - ij = iwk(i) - print 8002,rla(ij),rlo(ij),fld(ij),fldlmx - 8002 format(' bare land max. check. lat=',f5.1, - & ' lon=',f6.1,' fld=',e13.6, ' to ',e13.6) - enddo - endif - if (mode .eq. 1) then - do i=1,kmaxl - fld(iwk(i)) = fldlmx - enddo - endif - endif -! -! lower bound check over snow covered land -! - if (fldsmn .ne. 999.0) then - do i=i1_t,i2_t - if(slimsk(i).eq.1..and.sno(i).gt.0..and. - & fld(i).lt.fldsmn-epsfld) then - kmins=kmins+1 - iwk(kmins) = i - endif - enddo - if(me == 0 . and. it == 1 .and. num_threads == 1) then - nprt = min(mmprt,kmins) - do i=1,nprt - ij = iwk(i) - print 8003,rla(ij),rlo(ij),fld(ij),fldsmn - 8003 format(' sno covrd land min. check. lat=',f5.1, - & ' lon=',f6.1,' fld=',e11.4, ' to ',e11.4) - enddo - endif - if (mode .eq. 1) then - do i=1,kmins - fld(iwk(i)) = fldsmn - enddo - endif - endif -! -! upper bound check over snow covered land -! - if (fldsmx .ne. 999.0) then - do i=i1_t,i2_t - if(slimsk(i).eq.1..and.sno(i).gt.0..and. - & fld(i).gt.fldsmx+epsfld) then - kmaxs=kmaxs+1 - iwk(kmaxs) = i - endif - enddo - if(me == 0 . and. it == 1 .and. num_threads == 1) then - nprt = min(mmprt,kmaxs) - do i=1,nprt - ij = iwk(i) - print 8004,rla(ij),rlo(ij),fld(ij),fldsmx - 8004 format(' snow land max. check. lat=',f5.1, - & ' lon=',f6.1,' fld=',e11.4, ' to ',e11.4) - enddo - endif - if (mode .eq. 1) then - do i=1,kmaxs - fld(iwk(i)) = fldsmx - enddo - endif - endif -! -! lower bound check over open ocean -! - if (fldomn .ne. 999.0) then - do i=i1_t,i2_t - if(slimsk(i).eq.0..and. - & fld(i).lt.fldomn-epsfld) then - kmino=kmino+1 - iwk(kmino) = i - endif - enddo - if(me == 0 . and. it == 1 .and. num_threads == 1) then - nprt = min(mmprt,kmino) - do i=1,nprt - ij = iwk(i) - print 8005,rla(ij),rlo(ij),fld(ij),fldomn - 8005 format(' open ocean min. check. lat=',f5.1, - & ' lon=',f6.1,' fld=',e11.4,' to ',e11.4) - enddo - endif - if (mode .eq. 1) then - do i=1,kmino - fld(iwk(i)) = fldomn - enddo - endif - endif -! -! upper bound check over open ocean -! - if (fldomx .ne. 999.0) then - do i=i1_t,i2_t - if(fldomx.ne.999..and.slimsk(i).eq.0..and. - & fld(i).gt.fldomx+epsfld) then - kmaxo=kmaxo+1 - iwk(kmaxo) = i - endif - enddo - if(me == 0 . and. it == 1 .and. num_threads == 1) then - nprt = min(mmprt,kmaxo) - do i=1,nprt - ij = iwk(i) - print 8006,rla(ij),rlo(ij),fld(ij),fldomx - 8006 format(' open ocean max. check. lat=',f5.1, - & ' lon=',f6.1,' fld=',e11.4, ' to ',e11.4) - enddo - endif - if (mode .eq. 1) then - do i=1,kmaxo - fld(iwk(i)) = fldomx - enddo - endif - endif -! -! lower bound check over sea ice without snow -! - if (fldimn .ne. 999.0) then - do i=i1_t,i2_t - if(slimsk(i).eq.2..and.sno(i).le.0..and. - & fld(i).lt.fldimn-epsfld) then - kmini=kmini+1 - iwk(kmini) = i - endif - enddo - if(me == 0 . and. it == 1 .and. num_threads == 1) then - nprt = min(mmprt,kmini) - do i=1,nprt - ij = iwk(i) - print 8007,rla(ij),rlo(ij),fld(ij),fldimn - 8007 format(' seaice no snow min. check lat=',f5.1, - & ' lon=',f6.1,' fld=',e11.4, ' to ',e11.4) - enddo - endif - if (mode .eq. 1) then - do i=1,kmini - fld(iwk(i)) = fldimn - enddo - endif - endif -! -! upper bound check over sea ice without snow -! - if (fldimx .ne. 999.0) then - do i=i1_t,i2_t - if(slimsk(i).eq.2..and.sno(i).le.0..and. - & fld(i).gt.fldimx+epsfld .and. iceflg(i)) then -! & fld(i).gt.fldimx+epsfld) then - kmaxi=kmaxi+1 - iwk(kmaxi) = i - endif - enddo - if(me == 0 . and. it == 1 .and. num_threads == 1) then - nprt = min(mmprt,kmaxi) - do i=1,nprt - ij = iwk(i) - print 8008,rla(ij),rlo(ij),fld(ij),fldimx - 8008 format(' seaice no snow max. check lat=',f5.1, - & ' lon=',f6.1,' fld=',e11.4, ' to ',e11.4) - enddo - endif - if (mode .eq. 1) then - do i=1,kmaxi - fld(iwk(i)) = fldimx - enddo - endif - endif -! -! lower bound check over sea ice with snow -! - if (fldjmn .ne. 999.0) then - do i=i1_t,i2_t - if(slimsk(i).eq.2..and.sno(i).gt.0..and. - & fld(i).lt.fldjmn-epsfld) then - kminj=kminj+1 - iwk(kminj) = i - endif - enddo - if(me == 0 . and. it == 1 .and. num_threads == 1) then - nprt = min(mmprt,kminj) - do i=1,nprt - ij = iwk(i) - print 8009,rla(ij),rlo(ij),fld(ij),fldjmn - 8009 format(' sea ice snow min. check lat=',f5.1, - & ' lon=',f6.1,' fld=',e11.4, ' to ',e11.4) - enddo - endif - if (mode .eq. 1) then - do i=1,kminj - fld(iwk(i)) = fldjmn - enddo - endif - endif -! -! upper bound check over sea ice with snow -! - if (fldjmx .ne. 999.0) then - do i=i1_t,i2_t - if(slimsk(i).eq.2..and.sno(i).gt.0..and. - & fld(i).gt.fldjmx+epsfld .and. iceflg(i)) then -! & fld(i).gt.fldjmx+epsfld) then - kmaxj=kmaxj+1 - iwk(kmaxj) = i - endif - enddo - if(me == 0 .and. it == 1 .and. num_threads == 1) then - nprt = min(mmprt,kmaxj) - do i=1,nprt - ij = iwk(i) - print 8010,rla(ij),rlo(ij),fld(ij),fldjmx - 8010 format(' seaice snow max check lat=',f5.1, - & ' lon=',f6.1,' fld=',e11.4, ' to ',e11.4) - enddo - endif - if (mode .eq. 1) then - do i=1,kmaxj - fld(iwk(i)) = fldjmx - enddo - endif - endif - enddo ! end of threaded loop -!$omp end parallel do -! -! print results -! - if(me .eq. 0) then -! write(6,*) 'summary of qc' - permax=0. - if(kminl.gt.0) then - per=float(kminl)/float(len)*100. - print 9001,fldlmn,kminl,per - 9001 format(' bare land min check. modified to ',f8.1, - & ' at ',i5,' points ',f8.1,'percent') - if(per.gt.permax) permax=per - endif - if(kmaxl.gt.0) then - per=float(kmaxl)/float(len)*100. - print 9002,fldlmx,kmaxl,per - 9002 format(' bare land max check. modified to ',f8.1, - & ' at ',i5,' points ',f4.1,'percent') - if(per.gt.permax) permax=per - endif - if(kmino.gt.0) then - per=float(kmino)/float(len)*100. - print 9003,fldomn,kmino,per - 9003 format(' open ocean min check. modified to ',f8.1, - & ' at ',i5,' points ',f4.1,'percent') - if(per.gt.permax) permax=per - endif - if(kmaxo.gt.0) then - per=float(kmaxo)/float(len)*100. - print 9004,fldomx,kmaxo,per - 9004 format(' open sea max check. modified to ',f8.1, - & ' at ',i5,' points ',f4.1,'percent') - if(per.gt.permax) permax=per - endif - if(kmins.gt.0) then - per=float(kmins)/float(len)*100. - print 9009,fldsmn,kmins,per - 9009 format(' snow covered land min check. modified to ',f8.1, - & ' at ',i5,' points ',f4.1,'percent') - if(per.gt.permax) permax=per - endif - if(kmaxs.gt.0) then - per=float(kmaxs)/float(len)*100. - print 9010,fldsmx,kmaxs,per - 9010 format(' snow covered land max check. modified to ',f8.1, - & ' at ',i5,' points ',f4.1,'percent') - if(per.gt.permax) permax=per - endif - if(kmini.gt.0) then - per=float(kmini)/float(len)*100. - print 9005,fldimn,kmini,per - 9005 format(' bare ice min check. modified to ',f8.1, - & ' at ',i5,' points ',f4.1,'percent') - if(per.gt.permax) permax=per - endif - if(kmaxi.gt.0) then - per=float(kmaxi)/float(len)*100. - print 9006,fldimx,kmaxi,per - 9006 format(' bare ice max check. modified to ',f8.1, - & ' at ',i5,' points ',f4.1,'percent') - if(per.gt.permax) permax=per - endif - if(kminj.gt.0) then - per=float(kminj)/float(len)*100. - print 9007,fldjmn,kminj,per - 9007 format(' snow covered ice min check. modified to ',f8.1, - & ' at ',i5,' points ',f4.1,'percent') - if(per.gt.permax) permax=per - endif - if(kmaxj.gt.0) then - per=float(kmaxj)/float(len)*100. - print 9008,fldjmx,kmaxj,per - 9008 format(' snow covered ice max check. modified to ',f8.1, - & ' at ',i5,' points ',f4.1,'percent') - if(per.gt.permax) permax=per - endif -! commented on 06/30/99 -- moorthi -! if(lgchek) then -! if(permax.gt.percrit) then -! write(6,*) ' too many bad points. aborting ....' -! call abort -! endif -! endif -! - endif -! - return - end - -!>\ingroup mod_sfcsub - subroutine setzro(fld,eps,len) -! - use machine , only : kind_io8,kind_io4 - implicit none - integer i,len - real (kind=kind_io8) fld(len),eps - do i=1,len - if(abs(fld(i)).lt.eps) fld(i) = 0. - enddo - return - end - -!>\ingroup mod_sfcsub - subroutine getscv(snofld,scvfld,len) -! - use machine , only : kind_io8,kind_io4 - implicit none - integer i,len - real (kind=kind_io8) snofld(len),scvfld(len) -! - do i=1,len - scvfld(i) = 0. - if(snofld(i).gt.0.) scvfld(i) = 1. - enddo - return - end - -!>\ingroup mod_sfcsub - subroutine getstc(tsffld,tg3fld,slifld,len,lsoil,stcfld,tsfimx) -! - use machine , only : kind_io8,kind_io4 - implicit none - integer k,i,len,lsoil - real (kind=kind_io8) factor,tsfimx - real (kind=kind_io8) tsffld(len), tg3fld(len), slifld(len) - real (kind=kind_io8) stcfld(len,lsoil) -! -! layer soil temperature -! - do k = 1, lsoil - do i = 1, len - if(slifld(i).eq.1.0) then - factor = ((k-1) * 2 + 1) / (2. * lsoil) - stcfld(i,k) = factor*tg3fld(i)+(1.-factor)*tsffld(i) - elseif(slifld(i).eq.2.0) then - factor = ((k-1) * 2 + 1) / (2. * lsoil) - stcfld(i,k) = factor*tsfimx+(1.-factor)*tsffld(i) - else - stcfld(i,k) = tg3fld(i) - endif - enddo - enddo - if(lsoil.gt.2) then - do k = 3, lsoil - do i = 1, len - stcfld(i,k) = stcfld(i,2) - enddo - enddo - endif - return - end - -!>\ingroup mod_sfcsub -!! This subroutine calculates layer soil wetness. - subroutine getsmc(wetfld,len,lsoil,smcfld,me) -! - use machine , only : kind_io8,kind_io4 - implicit none - integer k,i,len,lsoil,me - real (kind=kind_io8) wetfld(len), smcfld(len,lsoil) -! - if (me .eq. 0) write(6,*) 'getsmc' -! -! layer soil wetness -! - do k = 1, lsoil - do i = 1, len - smcfld(i,k) = (wetfld(i)*1000./150.)*.37 + .1 - enddo - enddo - return - end - -!>\ingroup mod_sfcsub - subroutine usesgt(sig1t,slianl,tg3anl,len,lsoil,tsfanl,stcanl, - & tsfimx) -! - use machine , only : kind_io8,kind_io4 - implicit none - integer i,len,lsoil - real (kind=kind_io8) tsfimx - real (kind=kind_io8) sig1t(len), slianl(len), tg3anl(len) - real (kind=kind_io8) tsfanl(len), stcanl(len,lsoil) -! -! soil temperature -! - if(sig1t(1).gt.0.) then - do i=1,len - if(slianl(i).ne.0.) then - tsfanl(i) = sig1t(i) - endif - enddo - endif - call getstc(tsfanl,tg3anl,slianl,len,lsoil,stcanl,tsfimx) -! - return - end - -!>\ingroup mod_sfcsub - subroutine snosfc(snoanl,tsfanl,tsfsmx,len,me) - use machine , only : kind_io8,kind_io4 - implicit none - integer kount,i,len,me - real (kind=kind_io8) per,tsfsmx - real (kind=kind_io8) snoanl(len), tsfanl(len) -! - if (me .eq. 0) write(6,*) 'set snow temp to tsfsmx if greater' - kount=0 - do i=1,len - if(snoanl(i).gt.0.) then - if(tsfanl(i).gt.tsfsmx) tsfanl(i)=tsfsmx - kount = kount + 1 - endif - enddo - if(kount.gt.0) then - if(me .eq. 0) then - per=float(kount)/float(len)*100. - write(6,*) 'snow sfc. tsf set to ',tsfsmx,' at ', - & kount, ' points ',per,'percent' - endif - endif - return - end - -!>\ingroup mod_sfcsub - subroutine albocn(albclm,slmask,albomx,len) - use machine , only : kind_io8,kind_io4 - implicit none - integer i,len - real (kind=kind_io8) albomx - real (kind=kind_io8) albclm(len,4), slmask(len) - do i=1,len - if(slmask(i).eq.0) then - albclm(i,1) = albomx - albclm(i,2) = albomx - albclm(i,3) = albomx - albclm(i,4) = albomx - endif - enddo - return - end - -!>\ingroup mod_sfcsub - subroutine qcmxice(glacir,amxice,len,me) - use machine , only : kind_io8,kind_io4 - implicit none - integer i,kount,len,me - real (kind=kind_io8) glacir(len),amxice(len),per - if (me .eq. 0) write(6,*) 'qc of maximum ice extent' - kount=0 - do i=1,len - if(glacir(i).eq.1..and.amxice(i).eq.0.) then - amxice(i) = 0. - kount = kount + 1 - endif - enddo - if(kount.gt.0) then - per = float(kount) / float(len)*100. - if(me .eq. 0) write(6,*) ' max ice limit less than glacier' - &, ' coverage at ', kount, ' points ',per,'percent' - endif - return - end - -!>\ingroup mod_sfcsub - subroutine qcsli(slianl,slifcs,len,me) - use machine , only : kind_io8,kind_io4 - implicit none - integer i,kount,len,me - real (kind=kind_io8) slianl(len), slifcs(len),per - if (me .eq. 0) then - write(6,*) ' ' - write(6,*) 'qcsli' - endif - kount=0 - do i=1,len - if(slianl(i).eq.1..and.slifcs(i).eq.0.) then - kount = kount + 1 - slifcs(i) = 1. - endif - if(slianl(i).eq.0..and.slifcs(i).eq.1.) then - kount = kount + 1 - slifcs(i) = 0. - endif - if(slianl(i).eq.2..and.slifcs(i).eq.1.) then - kount = kount + 1 - slifcs(i) = 0. - endif - if(slianl(i).eq.1..and.slifcs(i).eq.2.) then - kount = kount + 1 - slifcs(i) = 1. - endif - enddo - if(kount.gt.0) then - per=float(kount)/float(len)*100. - if(me .eq. 0) then - write(6,*) ' inconsistency of slmask between forecast and', - & ' analysis corrected at ',kount, ' points ',per, - & 'percent' - endif - endif - return - end -! subroutine nntprt(data,imax,fact) -! real (kind=kind_io8) data(imax) -! ilast=0 -! i1=1 -! i2=80 -!1112 continue -! if(i2.ge.imax) then -! ilast=1 -! i2=imax -! endif -! write(6,*) ' ' -! do j=1,jmax -! write(6,1111) (nint(data(imax*(j-1)+i)*fact),i=i1,i2) -! enddo -! if(ilast.eq.1) return -! i1=i1+80 -! i2=i1+79 -! if(i2.ge.imax) then -! ilast=1 -! i2=imax -! endif -! go to 1112 -!1111 format(80i1) -! return -! end - -!>\ingroup mod_sfcsub - subroutine qcbyfc(tsffcs,snofcs,qctsfs,qcsnos,qctsfi, - & len,lsoil,snoanl,aisanl,slianl,tsfanl,albanl, - & zoranl,smcanl, - & smcclm,tsfsmx,albomx,zoromx, me) -! - use machine , only : kind_io8,kind_io4 - implicit none - integer kount,me,k,i,lsoil,len - real (kind=kind_io8) zoromx,per,albomx,qctsfi,qcsnos,qctsfs,tsfsmx - real (kind=kind_io8) tsffcs(len), snofcs(len) - real (kind=kind_io8) snoanl(len), aisanl(len), - & slianl(len), zoranl(len), - & tsfanl(len), albanl(len,4), - & smcanl(len,lsoil) - real (kind=kind_io8) smcclm(len,lsoil) -! - if (me .eq. 0) write(6,*) 'qc of snow and sea-ice analysis' -! -! qc of snow analysis -! -! questionable snow cover -! - kount = 0 - do i=1,len - if(slianl(i).gt.0..and. - & tsffcs(i).gt.qctsfs.and.snoanl(i).gt.0.) then - kount = kount + 1 - snoanl(i) = 0. - tsfanl(i) = tsffcs(i) - endif - enddo - if(kount.gt.0) then - per=float(kount)/float(len)*100. - if (me .eq. 0) then - write(6,*) ' guess surface temp .gt. ',qctsfs, - & ' but snow analysis indicates snow cover' - write(6,*) ' snow analysis set to zero', - & ' at ',kount, ' points ',per,'percent' - endif - endif -! -! questionable no snow cover -! - kount = 0 - do i=1,len - if(slianl(i).gt.0..and. - & snofcs(i).gt.qcsnos.and.snoanl(i).lt.0.) then - kount = kount + 1 - snoanl(i) = snofcs(i) - tsfanl(i) = tsffcs(i) - endif - enddo - if(kount.gt.0) then - per=float(kount)/float(len)*100. - if (me .eq. 0) then - write(6,*) ' guess snow depth .gt. ',qcsnos, - & ' but snow analysis indicates no snow cover' - write(6,*) ' snow analysis set to guess value', - & ' at ',kount, ' points ',per,'percent' - endif - endif -! -! questionable sea ice cover ! this qc is disable to correct error in -! surface temparature over observed sea ice points -! -! kount = 0 -! do i=1,len -! if(slianl(i).eq.2..and. -! & tsffcs(i).gt.qctsfi.and.aisanl(i).eq.1.) then -! kount = kount + 1 -! aisanl(i) = 0. -! slianl(i) = 0. -! tsfanl(i) = tsffcs(i) -! snoanl(i) = 0. -! zoranl(i) = zoromx -! albanl(i,1) = albomx -! albanl(i,2) = albomx -! albanl(i,3) = albomx -! albanl(i,4) = albomx -! do k=1,lsoil -! smcanl(i,k) = smcclm(i,k) -! enddo -! endif -! enddo -! if(kount.gt.0) then -! per=float(kount)/float(len)*100. -! if (me .eq. 0) then -! write(6,*) ' guess surface temp .gt. ',qctsfi, -! & ' but sea-ice analysis indicates sea-ice' -! write(6,*) ' sea-ice analysis set to zero', -! & ' at ',kount, ' points ',per,'percent' -! endif -! endif -! - return - end - -!>\ingroup mod_sfcsub - subroutine setrmsk(kpds5,slmask,igaul,jgaul,wlon,rnlat, - & data,imax,jmax,rlnout,rltout,lmask,rslmsk - &, gaus,blno, blto, kgds1, kpds4, lbms) - use machine , only : kind_io8,kind_io4 - use sfccyc_module - implicit none - real (kind=kind_io8) blno,blto,wlon,rnlat,crit,data_max - integer i,j,ijmax,jgaul,igaul,kpds5,jmax,imax, kgds1, kspla - integer, intent(in) :: kpds4 - logical*1, intent(in) :: lbms(imax,jmax) - real*4 :: dummy(imax,jmax) - - real (kind=kind_io8) slmask(igaul,jgaul) - real (kind=kind_io8) data(imax,jmax),rslmsk(imax,jmax) - &, rlnout(imax), rltout(jmax) - real (kind=kind_io8) a(jmax), w(jmax), radi, dlat, dlon - logical lmask, gaus -! -! set the longitude and latitudes for the grib file -! - if (kgds1 .eq. 4) then ! grib file on gaussian grid - kspla=4 - call splat(kspla, jmax, a, w) -! - radi = 180.0 / (4.*atan(1.)) - do j=1,jmax - rltout(j) = acos(a(j)) * radi - enddo -! - if (rnlat .gt. 0.0) then - do j=1,jmax - rltout(j) = 90. - rltout(j) - enddo - else - do j=1,jmax - rltout(j) = -90. + rltout(j) - enddo - endif - elseif (kgds1 .eq. 0) then ! grib file on lat/lon grid - dlat = -(rnlat+rnlat) / float(jmax-1) - do j=1,jmax - rltout(j) = rnlat + (j-1) * dlat - enddo - else ! grib file on some other grid - call abort - endif - dlon = 360.0 / imax - do i=1,imax - rlnout(i) = wlon + (i-1)*dlon - enddo -! -! - ijmax = imax*jmax - rslmsk = 0. -! -! surface temperature -! - if(kpds5.eq.kpdtsf) then -! lmask=.false. - call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat - &, rlnout, rltout, gaus, blno, blto) -! &, dlon, dlat, gaus, blno, blto) - crit=0.5 - call rof01(rslmsk,ijmax,'ge',crit) - lmask=.true. -! -! bucket soil wetness -! - elseif(kpds5.eq.kpdwet) then - call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat - &, rlnout, rltout, gaus, blno, blto) -! &, dlon, dlat, gaus, blno, blto) - crit=0.5 - call rof01(rslmsk,ijmax,'ge',crit) - lmask=.true. -! write(6,*) 'wet rslmsk' -! znnt=1. -! call nntprt(rslmsk,ijmax,znnt) -! -! snow depth -! - elseif(kpds5.eq.kpdsnd) then - if(kpds4 == 192) then ! use the bitmap - rslmsk = 0. - do j = 1, jmax - do i = 1, imax - if (lbms(i,j)) then - rslmsk(i,j) = 1. - end if - enddo - enddo - lmask=.true. - else - lmask=.false. - end if -! -! snow liq equivalent depth -! - elseif(kpds5.eq.kpdsno) then - call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat - &, rlnout, rltout, gaus, blno, blto) -! &, dlon, dlat, gaus, blno, blto) - crit=0.5 - call rof01(rslmsk,ijmax,'ge',crit) - lmask=.true. -! write(6,*) 'sno rslmsk' -! znnt=1. -! call nntprt(rslmsk,ijmax,znnt) -! -! soil moisture -! - elseif(kpds5.eq.kpdsmc) then - if(kpds4 == 192) then ! use the bitmap - rslmsk = 0. - do j = 1, jmax - do i = 1, imax - if (lbms(i,j)) then - rslmsk(i,j) = 1. - end if - enddo - enddo - lmask=.true. - else - call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat - &, rlnout, rltout, gaus, blno, blto) - crit=0.5 - call rof01(rslmsk,ijmax,'ge',crit) - lmask=.true. - endif -! -! surface roughness -! - elseif(kpds5.eq.kpdzor) then - do j=1,jmax - do i=1,imax - rslmsk(i,j)=data(i,j) - enddo - enddo - crit=9.9 - call rof01(rslmsk,ijmax,'lt',crit) - lmask=.true. -! write(6,*) 'zor rslmsk' -! znnt=1. -! call nntprt(rslmsk,ijmax,znnt) -! -! albedo -! -! elseif(kpds5.eq.kpdalb) then -! do j=1,jmax -! do i=1,imax -! rslmsk(i,j)=data(i,j) -! enddo -! enddo -! crit=99. -! call rof01(rslmsk,ijmax,'lt',crit) -! lmask=.true. -! write(6,*) 'alb rslmsk' -! znnt=1. -! call nntprt(rslmsk,ijmax,znnt) -! -! albedo -! -!cbosu new snowfree albedo database has bitmap, use it. - elseif(kpds5.eq.kpdalb(1)) then - if (kpds4 == 192) then ! use the bitmap - rslmsk = 0. - do j = 1, jmax - do i = 1, imax - if (lbms(i,j)) then - rslmsk(i,j) = 1. - end if - enddo - enddo - lmask = .true. - else ! no bitmap. old database has no water flag. - lmask=.false. - end if - elseif(kpds5.eq.kpdalb(2)) then -!cbosu - if (kpds4 == 192) then ! use the bitmap - rslmsk = 0. - do j = 1, jmax - do i = 1, imax - if (lbms(i,j)) then - rslmsk(i,j) = 1. - end if - enddo - enddo - lmask = .true. - else ! no bitmap. old database has no water flag. - lmask=.false. - end if - elseif(kpds5.eq.kpdalb(3)) then -!cbosu - if (kpds4 == 192) then ! use the bitmap - rslmsk = 0. - do j = 1, jmax - do i = 1, imax - if (lbms(i,j)) then - rslmsk(i,j) = 1. - end if - enddo - enddo - lmask = .true. - else ! no bitmap. old database has no water flag. - lmask=.false. - end if - elseif(kpds5.eq.kpdalb(4)) then -!cbosu - if (kpds4 == 192) then ! use the bitmap - rslmsk = 0. - do j = 1, jmax - do i = 1, imax - if (lbms(i,j)) then - rslmsk(i,j) = 1. - end if - enddo - enddo - lmask = .true. - else ! no bitmap. old database has no water flag. - lmask=.false. - end if -! -! vegetation fraction for albedo -! - elseif(kpds5.eq.kpdalf(1)) then -! rslmsk=data -! crit=0. -! call rof01(rslmsk,ijmax,'gt',crit) -! lmask=.true. - lmask=.false. - elseif(kpds5.eq.kpdalf(2)) then -! rslmsk=data -! crit=0. -! call rof01(rslmsk,ijmax,'gt',crit) -! lmask=.true. - lmask=.false. -! -! sea ice -! - elseif(kpds5.eq.kpdais) then - lmask=.false. -! call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat -! &, dlon, dlat, gaus, blno, blto) -! crit=0.5 -! call rof01(rslmsk,ijmax,'ge',crit) -! - data_max = 0.0 - do j=1,jmax - do i=1,imax - rslmsk(i,j) = data(i,j) - data_max= max(data_max,data(i,j)) - enddo - enddo - crit=1.0 - if (data_max .gt. crit) then - call rof01(rslmsk,ijmax,'gt',crit) - lmask=.true. - else - lmask=.false. - endif -! write(6,*) 'acn rslmsk' -! znnt=1. -! call nntprt(rslmsk,ijmax,znnt) -! -! deep soil temperature -! - elseif(kpds5.eq.kpdtg3) then - lmask=.false. -! call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat -! &, rlnout, rltout, gaus, blno, blto) -! &, dlon, dlat, gaus, blno, blto) -! crit=0.5 -! call rof01(rslmsk,ijmax,'ge',crit) -! lmask=.true. -! -! plant resistance -! -! elseif(kpds5.eq.kpdplr) then -! call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat -! &, rlnout, rltout, gaus, blno, blto) -! &, dlon, dlat, gaus, blno, blto) -! crit=0.5 -! call rof01(rslmsk,ijmax,'ge',crit) -! lmask=.true. -! -! write(6,*) 'plr rslmsk' -! znnt=1. -! call nntprt(rslmsk,ijmax,znnt) -! -! glacier points -! - elseif(kpds5.eq.kpdgla) then - lmask=.false. -! -! max ice extent -! - elseif(kpds5.eq.kpdmxi) then - lmask=.false. -! -! snow cover -! - elseif(kpds5.eq.kpdscv) then - call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat - &, rlnout, rltout, gaus, blno, blto) -! &, dlon, dlat, gaus, blno, blto) - crit=0.5 - call rof01(rslmsk,ijmax,'ge',crit) - lmask=.true. -! write(6,*) 'scv rslmsk' -! znnt=1. -! call nntprt(rslmsk,ijmax,znnt) -! -! sea ice concentration -! - elseif(kpds5.eq.kpdacn) then - lmask=.false. - call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat - &, rlnout, rltout, gaus, blno, blto) -! &, dlon, dlat, gaus, blno, blto) - crit=0.5 - call rof01(rslmsk,ijmax,'ge',crit) - lmask=.true. -! write(6,*) 'acn rslmsk' -! znnt=1. -! call nntprt(rslmsk,ijmax,znnt) -! -! vegetation cover -! - elseif(kpds5.eq.kpdveg) then -!cggg - if (kpds4 == 192) then ! use the bitmap - rslmsk = 0. - do j = 1, jmax - do i = 1, imax - if (lbms(i,j)) then - rslmsk(i,jmax-j+1) = 1. ! need to flip grid in n/s direction - end if - enddo - enddo - lmask = .true. - else ! no bitmap, set mask the old way. - - call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat - &, rlnout, rltout, gaus, blno, blto) - crit=0.5 - call rof01(rslmsk,ijmax,'ge',crit) - lmask=.true. - - end if -! -! soil type -! - elseif(kpds5.eq.kpdsot) then - - if (kpds4 == 192) then ! use the bitmap - rslmsk = 0. - do j = 1, jmax - do i = 1, imax - if (lbms(i,j)) then - rslmsk(i,j) = 1. - end if - enddo - enddo -! soil type is zero over water, use this to get a bitmap. - else - do j = 1, jmax - do i = 1, imax - rslmsk(i,j) = data(i,j) - enddo - enddo - crit=0.1 - call rof01(rslmsk,ijmax,'gt',crit) - endif - lmask=.true. -! -! vegetation type -! - elseif(kpds5.eq.kpdvet) then - - if (kpds4 == 192) then ! use the bitmap - rslmsk = 0. - do j = 1, jmax - do i = 1, imax - if (lbms(i,j)) then - rslmsk(i,j) = 1. - end if - enddo - enddo -! veg type is zero over water, use this to get a bitmap. - else - do j = 1, jmax - do i = 1, imax - rslmsk(i,j) = data(i,j) - enddo - enddo - crit=0.1 - call rof01(rslmsk,ijmax,'gt',crit) - endif - lmask=.true. -! -! these are for four new data type added by clu -- not sure its correct! -! - elseif(kpds5.eq.kpdvmn) then -! -!cggg greenness is zero over water, use this to get a bitmap. -! - do j = 1, jmax - do i = 1, imax - rslmsk(i,j) = data(i,j) - enddo - enddo -! - crit=0.1 - call rof01(rslmsk,ijmax,'gt',crit) - lmask=.true. -!cggg lmask=.false. -! - elseif(kpds5.eq.kpdvmx) then -! -!cggg greenness is zero over water, use this to get a bitmap. -! - do j = 1, jmax - do i = 1, imax - rslmsk(i,j) = data(i,j) - enddo - enddo -! - crit=0.1 - call rof01(rslmsk,ijmax,'gt',crit) - lmask=.true. -!cggg lmask=.false. -! - elseif(kpds5.eq.kpdslp) then -! -!cggg slope type is zero over water, use this to get a bitmap. -! - do j = 1, jmax - do i = 1, imax - rslmsk(i,j) = data(i,j) - enddo - enddo -! - crit=0.1 - call rof01(rslmsk,ijmax,'gt',crit) - lmask=.true. -!cggg lmask=.false. -! -!cbosu new maximum snow albedo database has bitmap - elseif(kpds5.eq.kpdabs) then - if (kpds4 == 192) then ! use the bitmap - rslmsk = 0. - do j = 1, jmax - do i = 1, imax - if (lbms(i,j)) then - rslmsk(i,j) = 1. - end if - enddo - enddo - lmask = .true. - else ! no bitmap. old database has zero over water - do j = 1, jmax - do i = 1, imax - rslmsk(i,j) = data(i,j) - enddo - enddo - crit=0.1 - call rof01(rslmsk,ijmax,'gt',crit) - lmask=.true. - end if - endif -! - return - end - -!>\ingroup mod_sfcsub - subroutine ga2la(gauin,imxin,jmxin,regout,imxout,jmxout, - & wlon,rnlat,rlnout,rltout,gaus,blno, blto) - use machine , only : kind_io8,kind_io4 - implicit none - integer i1,i2,j2,ishft,i,jj,j1,jtem,jmxout,imxin,jmxin,imxout, - & j,iret - real (kind=kind_io8) alamd,dxin,aphi,x,sum1,sum2,y,dlati,wlon, - & rnlat,dxout,dphi,dlat,facns,tem,blno, - & blto -! -! interpolation from lat/lon grid to other lat/lon grid -! - real (kind=kind_io8) gauin (imxin,jmxin), regout(imxout,jmxout) - &, rlnout(imxout), rltout(jmxout) - logical gaus -! - real, allocatable :: gaul(:) - real (kind=kind_io8) ddx(imxout),ddy(jmxout) - integer iindx1(imxout), iindx2(imxout), - & jindx1(jmxout), jindx2(jmxout) - integer jmxsav,n,kspla - data jmxsav/0/ - save jmxsav, gaul, dlati - real (kind=kind_io8) radi - real (kind=kind_io8) a(jmxin), w(jmxin) -! -! - logical first - integer num_threads - data first /.true./ - save num_threads, first -! - integer len_thread_m, j1_t, j2_t, it - integer num_parthds -! - if (first) then - num_threads = num_parthds() - first = .false. - endif -! - if (jmxin .ne. jmxsav) then - if (jmxsav .gt. 0) deallocate (gaul, stat=iret) - allocate (gaul(jmxin)) - jmxsav = jmxin - if (gaus) then -cjfe call gaulat(gaul,jmxin) -cjfe -! - kspla=4 - call splat(kspla, jmxin, a, w) -! - radi = 180.0 / (4.*atan(1.)) - do n=1,jmxin - gaul(n) = acos(a(n)) * radi - enddo -cjfe - do j=1,jmxin - gaul(j) = 90. - gaul(j) - enddo - else - dlat = -2*blto / float(jmxin-1) - dlati = 1 / dlat - do j=1,jmxin - gaul(j) = blto + (j-1) * dlat - enddo - endif - endif -! -! - dxin = 360. / float(imxin ) -! - do i=1,imxout - alamd = rlnout(i) - i1 = floor((alamd-blno)/dxin) + 1 - ddx(i) = (alamd-blno)/dxin-(i1-1) - iindx1(i) = modulo(i1-1,imxin) + 1 - iindx2(i) = modulo(i1 ,imxin) + 1 - enddo -! -! - len_thread_m = (jmxout+num_threads-1) / num_threads -! - if (gaus) then -! -!$omp parallel do private(j1_t,j2_t,it,j1,j2,jj) -!$omp+private(aphi) -!$omp+shared(num_threads,len_thread_m) -!$omp+shared(jmxin,jmxout,gaul,rltout,jindx1,ddy) -! - do it=1,num_threads ! start of threaded loop ................... - j1_t = (it-1)*len_thread_m+1 - j2_t = min(j1_t+len_thread_m-1,jmxout) -! - j2=1 - do 40 j=j1_t,j2_t - aphi=rltout(j) - do 50 jj=1,jmxin - if(aphi.lt.gaul(jj)) go to 50 - j2=jj - go to 42 - 50 continue - 42 continue - if(j2.gt.2) go to 43 - j1=1 - j2=2 - go to 44 - 43 continue - if(j2.le.jmxin) go to 45 - j1=jmxin-1 - j2=jmxin - go to 44 - 45 continue - j1=j2-1 - 44 continue - jindx1(j)=j1 - jindx2(j)=j2 - ddy(j)=(aphi-gaul(j1))/(gaul(j2)-gaul(j1)) - 40 continue - enddo ! end of threaded loop ................... -!$omp end parallel do -! - else -!$omp parallel do private(j1_t,j2_t,it,j1,j2,jtem) -!$omp+private(aphi) -!$omp+shared(num_threads,len_thread_m) -!$omp+shared(jmxin,jmxout,gaul,rltout,jindx1,ddy,dlati,blto) -! - do it=1,num_threads ! start of threaded loop ................... - j1_t = (it-1)*len_thread_m+1 - j2_t = min(j1_t+len_thread_m-1,jmxout) -! - j2=1 - do 400 j=j1_t,j2_t - aphi=rltout(j) - jtem = (aphi - blto) * dlati + 1 - if (jtem .ge. 1 .and. jtem .lt. jmxin) then - j1 = jtem - j2 = j1 + 1 - ddy(j)=(aphi-gaul(j1))/(gaul(j2)-gaul(j1)) - elseif (jtem .eq. jmxin) then - j1 = jmxin - j2 = jmxin - ddy(j)=1.0 - else - j1 = 1 - j2 = 1 - ddy(j)=1.0 - endif -! - jindx1(j) = j1 - jindx2(j) = j2 - 400 continue - enddo ! end of threaded loop ................... -!$omp end parallel do - endif -! -! write(6,*) 'ga2la' -! write(6,*) 'iindx1' -! write(6,*) (iindx1(n),n=1,imxout) -! write(6,*) 'iindx2' -! write(6,*) (iindx2(n),n=1,imxout) -! write(6,*) 'jindx1' -! write(6,*) (jindx1(n),n=1,jmxout) -! write(6,*) 'jindx2' -! write(6,*) (jindx2(n),n=1,jmxout) -! write(6,*) 'ddy' -! write(6,*) (ddy(n),n=1,jmxout) -! write(6,*) 'ddx' -! write(6,*) (ddx(n),n=1,jmxout) -! -! -!$omp parallel do private(j1_t,j2_t,it,i,i1,i2) -!$omp+private(j,j1,j2,x,y) -!$omp+shared(num_threads,len_thread_m) -!$omp+shared(imxout,iindx1,jindx1,ddx,ddy,gauin,regout) -! - do it=1,num_threads ! start of threaded loop ................... - j1_t = (it-1)*len_thread_m+1 - j2_t = min(j1_t+len_thread_m-1,jmxout) -! - do j=j1_t,j2_t - y = ddy(j) - j1 = jindx1(j) - j2 = jindx2(j) - do i=1,imxout - x = ddx(i) - i1 = iindx1(i) - i2 = iindx2(i) - regout(i,j) = (1.-x)*((1.-y)*gauin(i1,j1) + y*gauin(i1,j2)) - & + x *((1.-y)*gauin(i2,j1) + y*gauin(i2,j2)) - enddo - enddo - enddo ! end of threaded loop ................... -!$omp end parallel do -! - sum1 = 0. - sum2 = 0. - do i=1,imxin - sum1 = sum1 + gauin(i,1) - sum2 = sum2 + gauin(i,jmxin) - enddo - sum1 = sum1 / float(imxin) - sum2 = sum2 / float(imxin) -! - if (gaus) then - if (rnlat .gt. 0.0) then - do i=1,imxout - regout(i, 1) = sum1 - regout(i,jmxout) = sum2 - enddo - else - do i=1,imxout - regout(i, 1) = sum2 - regout(i,jmxout) = sum1 - enddo - endif - else - if (blto .lt. 0.0) then - if (rnlat .gt. 0.0) then - do i=1,imxout - regout(i, 1) = sum2 - regout(i,jmxout) = sum1 - enddo - else - do i=1,imxout - regout(i, 1) = sum1 - regout(i,jmxout) = sum2 - enddo - endif - else - if (rnlat .lt. 0.0) then - do i=1,imxout - regout(i, 1) = sum2 - regout(i,jmxout) = sum1 - enddo - else - do i=1,imxout - regout(i, 1) = sum1 - regout(i,jmxout) = sum2 - enddo - endif - endif - endif -! - return - end - -!>\ingroup mod_sfcsub - subroutine landtyp(vegtype,soiltype,slptype,slmask,len) - use machine , only : kind_io8,kind_io4 - implicit none - integer i,len - real (kind=kind_io8) vegtype(len),soiltype(len),slmask(len) - +, slptype(len) -! -! make sure that the soil type and veg type are non-zero over land -! - do i = 1, len - if (slmask(i) .eq. 1) then - if (vegtype(i) .eq. 0.) vegtype(i) = 7 - if (soiltype(i) .eq. 0.) soiltype(i) = 2 - if (slptype(i) .eq. 0.) slptype(i) = 1 - endif - enddo - return - -!>\ingroup mod_sfcsub - end subroutine landtyp - subroutine gaulat(gaul,k) -! - use machine , only : kind_io8,kind_io4 - implicit none - integer n,k - real (kind=kind_io8) radi - real (kind=kind_io8) a(k), w(k), gaul(k) -! - call splat(4, k, a, w) -! - radi = 180.0 / (4.*atan(1.)) - do n=1,k - gaul(n) = acos(a(n)) * radi - enddo -! -! print *,'gaussian lat (deg) for jmax=',k -! print *,(gaul(n),n=1,k) -! - return - 70 write(6,6000) - 6000 format(//5x,'error in gauaw'//) - stop - end -!----------------------------------------------------------------------- -!>\ingroup mod_sfcsub -!! The subroutine conducts time interpolation of anomalies, -!! and add initial anomaly to date interpolated climatology. - subroutine anomint(tsfan0,tsfclm,tsfcl0,tsfanl,len) -! - use machine , only : kind_io8,kind_io4 - implicit none - integer i,len - real (kind=kind_io8) tsfanl(len), tsfan0(len), - & tsfclm(len), tsfcl0(len) -! -! time interpolation of anomalies -! add initial anomaly to date interpolated climatology -! - write(6,*) 'anomint' - do i=1,len - tsfanl(i) = tsfan0(i) - tsfcl0(i) + tsfclm(i) - enddo - return - end - -!>\ingroup mod_sfcsub - subroutine clima(lugb,iy,im,id,ih,fh,len,lsoil, - & slmask,fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, - & fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,fnvegc, - & fnvetc,fnsotc, - & fnvmnc,fnvmxc,fnslpc,fnabsc, - & tsfclm,tsfcl2,wetclm,snoclm,zorclm,albclm,aisclm, - & tg3clm,cvclm ,cvbclm,cvtclm, - & cnpclm,smcclm,stcclm,sliclm,scvclm,acnclm,vegclm, - & vetclm,sotclm,alfclm, - & vmnclm,vmxclm,slpclm,absclm, - & kpdtsf,kpdwet,kpdsno,kpdzor,kpdalb,kpdais, - & kpdtg3,kpdscv,kpdacn,kpdsmc,kpdstc,kpdveg, - & kpdvet,kpdsot,kpdalf,tsfcl0, - & kpdvmn,kpdvmx,kpdslp,kpdabs, - & deltsfc, lanom - &, imsk, jmsk, slmskh, outlat, outlon - &, gaus, blno, blto, me,lprnt,iprnt, fnalbc2, ialb - &, tile_num_ch, i_index, j_index) -! - use machine , only : kind_io8,kind_io4 - implicit none - character(len=*), intent(in) :: tile_num_ch - integer, intent(in) :: i_index(len), j_index(len) - real (kind=kind_io8) rjday,wei1x,wei2x,rjdayh,wei2m,wei1m,wei1s, - & wei2s,fh,stcmon1s,blto,blno,deltsfc,rjdayh2 - real (kind=kind_io8) wei1y,wei2y - integer jdoy,jday,jh,jdow,mmm,mmp,mm,iret,monend,i,k,jm,jd,iy4, - & jy,mon1,is2,isx,kpd9,is1,l,nn,mon2,mon,is,kpdsno, - & kpdzor,kpdtsf,kpdwet,kpdscv,kpdacn,kpdais,kpdtg3,im,id, - & lugb,iy,len,lsoil,ih,kpdsmc,iprnt,me,m1,m2,k1,k2, - & kpdvet,kpdsot,kpdstc,kpdveg,jmsk,imsk,j,ialb - &, kpdvmn,kpdvmx,kpdslp,kpdabs,landice_cat - integer kpdalb(4), kpdalf(2) -! - character*500 fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, - & fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,fnvegc, - & fnvetc,fnsotc,fnalbc2 - &, fnvmnc,fnvmxc,fnslpc,fnabsc - real (kind=kind_io8) tsfclm(len),tsfcl2(len), - & wetclm(len),snoclm(len), - & zorclm(len),albclm(len,4),aisclm(len), - & tg3clm(len),acnclm(len), - & cvclm (len),cvbclm(len),cvtclm(len), - & cnpclm(len), - & smcclm(len,lsoil),stcclm(len,lsoil), - & sliclm(len),scvclm(len),vegclm(len), - & vetclm(len),sotclm(len),alfclm(len,2) - &, vmnclm(len),vmxclm(len),slpclm(len),absclm(len) - real (kind=kind_io8) slmskh(imsk,jmsk) - real (kind=kind_io8) outlat(len), outlon(len) -! - real (kind=kind_io8) slmask(len), tsfcl0(len) - real (kind=kind_io8), allocatable :: slmask_noice(:) -! - logical lanom, gaus, first -! -! set z0 based on sib vegetation type - real (kind=kind_io8) z0_sib(13) - data z0_sib /2.653, 0.826, 0.563, 1.089, 0.854, 0.856, - & 0.035, 0.238, 0.065, 0.076, 0.011, 0.125, - & 0.011 / -! set z0 based on igbp vegetation type - real (kind=kind_io8) z0_igbp_min(20), z0_igbp_max(20) - real (kind=kind_io8) z0_season(12) - data z0_igbp_min /1.089, 2.653, 0.854, 0.826, 0.800, 0.050, - & 0.030, 0.856, 0.856, 0.150, 0.040, 0.130, - & 1.000, 0.250, 0.011, 0.011, 0.001, 0.076, - & 0.050, 0.030/ - data z0_igbp_max /1.089, 2.653, 0.854, 0.826, 0.800, 0.050, - & 0.030, 0.856, 0.856, 0.150, 0.040, 0.130, - & 1.000, 0.250, 0.011, 0.011, 0.001, 0.076, - & 0.050, 0.030/ -! -! dayhf : julian day of the middle of each month -! - real (kind=kind_io8) dayhf(13) - data dayhf/ 15.5, 45.0, 74.5,105.0,135.5,166.0, - & 196.5,227.5,258.0,288.5,319.0,349.5,380.5/ -! - real (kind=kind_io8) fha(5) - real(4) fha4(5) - integer w3kindreal,w3kindint - integer ida(8),jda(8),ivtyp, kpd7 -! - real (kind=kind_io8), allocatable :: tsf(:,:),sno(:,:), - & zor(:,:),wet(:,:), - & ais(:,:), acn(:,:), scv(:,:), smc(:,:,:), - & tg3(:), alb(:,:,:), alf(:,:), - & vet(:), sot(:), tsf2(:), - & veg(:,:), stc(:,:,:) - &, vmn(:), vmx(:), slp(:), absm(:) -! - integer mon1s, mon2s, sea1s, sea2s, sea1, sea2, hyr1, hyr2 - data first/.true./ - data mon1s/0/, mon2s/0/, sea1s/0/, sea2s/0/ -! - save first, tsf, sno, zor, wet, ais, acn, scv, smc, tg3, - & alb, alf, vet, sot, tsf2, veg, stc, - & vmn, vmx, slp, absm, - & mon1s, mon2s, sea1s, sea2s, dayhf, k1, k2, m1, m2, - & landice_cat -! - logical lprnt -! - do i=1,len - tsfclm(i) = 0.0 - tsfcl2(i) = 0.0 - snoclm(i) = 0.0 - wetclm(i) = 0.0 - zorclm(i) = 0.0 - aisclm(i) = 0.0 - tg3clm(i) = 0.0 - acnclm(i) = 0.0 - cvclm(i) = 0.0 - cvbclm(i) = 0.0 - cvtclm(i) = 0.0 - cnpclm(i) = 0.0 - sliclm(i) = 0.0 - scvclm(i) = 0.0 - vmnclm(i) = 0.0 - vmxclm(i) = 0.0 - slpclm(i) = 0.0 - absclm(i) = 0.0 - enddo - do k=1,lsoil - do i=1,len - smcclm(i,k) = 0.0 - stcclm(i,k) = 0.0 - enddo - enddo - do k=1,4 - do i=1,len - albclm(i,k) = 0.0 - enddo - enddo - do k=1,2 - do i=1,len - alfclm(i,k) = 0.0 - enddo - enddo -! - iret = 0 - monend = 9999 -! - if (first) then -! -! allocate variables to be saved -! - allocate (tsf(len,2), sno(len,2), zor(len,2), - & wet(len,2), ais(len,2), acn(len,2), - & scv(len,2), smc(len,lsoil,2), - & tg3(len), alb(len,4,2), alf(len,2), - & vet(len), sot(len), tsf2(len), -!clu [+1l] add vmn, vmx, slp, abs - & vmn(len), vmx(len), slp(len), absm(len), - & veg(len,2), stc(len,lsoil,2)) -! -! get tsf climatology for the begining of the forecast -! - if (fh .gt. 0.0) then -!cbosu - if (me == 0) print*,'bosu fh gt 0' - - iy4=iy - if(iy.lt.101) iy4=1900+iy4 - fha=0 - ida=0 - jda=0 -! fha(2)=nint(fh) - ida(1)=iy - ida(2)=im - ida(3)=id - ida(5)=ih - call w3kind(w3kindreal,w3kindint) - if(w3kindreal == 4) then - fha4=fha - call w3movdat(fha4,ida,jda) - else - call w3movdat(fha,ida,jda) - endif - jy=jda(1) - jm=jda(2) - jd=jda(3) - jh=jda(5) - if (me .eq. 0) write(6,*) ' forecast jy,jm,jd,jh', - & jy,jm,jd,jh - jdow = 0 - jdoy = 0 - jday = 0 - call w3doxdat(jda,jdow,jdoy,jday) - rjday=jdoy+jda(5)/24. - if(rjday.lt.dayhf(1)) rjday=rjday+365. -! - if (me .eq. 0) write(6,*) 'forecast jy,jm,jd,jh=',jy,jm,jd,jh -! -! for monthly mean climatology -! - monend = 12 - do mm=1,monend - mmm=mm - mmp=mm+1 - if(rjday.ge.dayhf(mmm).and.rjday.lt.dayhf(mmp)) then - mon1=mmm - mon2=mmp - go to 10 - endif - enddo - print *,'wrong rjday',rjday - call abort - 10 continue - wei1m = (dayhf(mon2)-rjday)/(dayhf(mon2)-dayhf(mon1)) - wei2m = (rjday-dayhf(mon1))/(dayhf(mon2)-dayhf(mon1)) - if(mon2.eq.13) mon2=1 - if (me .eq. 0) print *,'rjday,mon1,mon2,wei1m,wei2m=', - & rjday,mon1,mon2,wei1m,wei2m -! -! read monthly mean climatology of tsf -! - kpd7 = -1 - do nn=1,2 - mon = mon1 - if (nn .eq. 2) mon = mon2 - call fixrdc(lugb,fntsfc,kpdtsf,kpd7,mon,slmask, - & tsf(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - enddo -! -! tsf at the begining of forecast i.e. fh=0 -! - do i=1,len - tsfcl0(i) = wei1m * tsf(i,1) + wei2m * tsf(i,2) - enddo - endif - endif -! -! compute current jy,jm,jd,jh of forecast and the day of the year -! - iy4=iy - if(iy.lt.101) iy4=1900+iy4 - fha = 0 - ida = 0 - jda = 0 - fha(2) = nint(fh) - ida(1) = iy - ida(2) = im - ida(3) = id - ida(5) = ih - call w3kind(w3kindreal,w3kindint) - if(w3kindreal==4) then - fha4=fha - call w3movdat(fha4,ida,jda) - else - call w3movdat(fha,ida,jda) - endif - jy = jda(1) - jm = jda(2) - jd = jda(3) - jh = jda(5) -! if (me .eq. 0) write(6,*) ' forecast jy,jm,jd,jh,rjday=', -! & jy,jm,jd,jh,rjday - jdow = 0 - jdoy = 0 - jday = 0 - call w3doxdat(jda,jdow,jdoy,jday) - rjday = jdoy+jda(5)/24. - if(rjday.lt.dayhf(1)) rjday=rjday+365. - - if (me .eq. 0) write(6,*) ' forecast jy,jm,jd,jh,rjday=', - & jy,jm,jd,jh,rjday -! - if (me .eq. 0) write(6,*) 'forecast jy,jm,jd,jh=',jy,jm,jd,jh -! -! for monthly mean climatology -! - monend = 12 - do mm=1,monend - mmm=mm - mmp=mm+1 - if(rjday.ge.dayhf(mmm).and.rjday.lt.dayhf(mmp)) then - mon1=mmm - mon2=mmp - go to 20 - endif - enddo - print *,'wrong rjday',rjday - call abort - 20 continue - wei1m=(dayhf(mon2)-rjday)/(dayhf(mon2)-dayhf(mon1)) - wei2m=(rjday-dayhf(mon1))/(dayhf(mon2)-dayhf(mon1)) - if(mon2.eq.13) mon2=1 - if (me .eq. 0) print *,'rjday,mon1,mon2,wei1m,wei2m=', - & rjday,mon1,mon2,wei1m,wei2m -! -! for seasonal mean climatology -! - monend = 4 - is = im/3 + 1 - if (is.eq.5) is = 1 - do mm=1,monend - mmm = mm*3 - 2 - mmp = (mm+1)*3 - 2 - if(rjday.ge.dayhf(mmm).and.rjday.lt.dayhf(mmp)) then - sea1 = mmm - sea2 = mmp - go to 30 - endif - enddo - print *,'wrong rjday',rjday - call abort - 30 continue - wei1s = (dayhf(sea2)-rjday)/(dayhf(sea2)-dayhf(sea1)) - wei2s = (rjday-dayhf(sea1))/(dayhf(sea2)-dayhf(sea1)) - if(sea2.eq.13) sea2=1 - if (me .eq. 0) print *,'rjday,sea1,sea2,wei1s,wei2s=', - & rjday,sea1,sea2,wei1s,wei2s -! -! for summer and winter values (maximum and minimum). -! - monend = 2 - is = im/6 + 1 - if (is.eq.3) is = 1 - do mm=1,monend - mmm = mm*6 - 5 - mmp = (mm+1)*6 - 5 - if(rjday.ge.dayhf(mmm).and.rjday.lt.dayhf(mmp)) then - hyr1 = mmm - hyr2 = mmp - go to 31 - endif - enddo - print *,'wrong rjday',rjday - call abort - 31 continue - wei1y = (dayhf(hyr2)-rjday)/(dayhf(hyr2)-dayhf(hyr1)) - wei2y = (rjday-dayhf(hyr1))/(dayhf(hyr2)-dayhf(hyr1)) - if(hyr2.eq.13) hyr2=1 - if (me .eq. 0) print *,'rjday,hyr1,hyr2,wei1y,wei2y=', - & rjday,hyr1,hyr2,wei1y,wei2y -! -! start reading in climatology and interpolate to the date -! - first_time : if (first) then -!cbosu - if (me == 0) print*,'bosu first time thru' -! -! annual mean climatology -! -! fraction of vegetation field for albedo -- there are two -! fraction fields in this version: strong zenith angle dependent -! and weak zenith angle dependent -! - kpd9 = -1 -cjfe - alf=0. -cjfe - - kpd7=-1 - if (ialb == 1) then -!cbosu still need facsf and facwf. read them from the production -!cbosu file - if ( index(fnalbc2, "tileX.nc") == 0) then ! grib file - call fixrdc(lugb,fnalbc2,kpdalf(1),kpd7,kpd9,slmask - &, alf,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - else - call fixrdc_tile(fnalbc2, tile_num_ch, i_index, j_index, - & kpdalf(1), alf(:,1), 1, len, me) - endif - else - call fixrdc(lugb,fnalbc,kpdalf(1),kpd7,kpd9,slmask - &, alf,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - endif - do i = 1, len - if(slmask(i).eq.1.) then - alf(i,2) = 100. - alf(i,1) - endif - enddo -! -! deep soil temperature -! - if(fntg3c(1:8).ne.' ') then - if ( index(fntg3c, "tileX.nc") == 0) then ! grib file - kpd7=-1 - call fixrdc(lugb,fntg3c,kpdtg3,kpd7,kpd9,slmask, - & tg3,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - else - call fixrdc_tile(fntg3c, tile_num_ch, i_index, j_index, - & kpdtg3, tg3, 1, len, me) - endif - endif -! -! vegetation type -! -! when using the new gldas soil moisture climatology, a veg type -! dataset must be selected. -! - if(fnvetc(1:8).ne.' ') then - if ( index(fnvetc, "tileX.nc") == 0) then ! grib file - kpd7=-1 - call fixrdc(lugb,fnvetc,kpdvet,kpd7,kpd9,slmask, - & vet,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - landice_cat=13 - if (maxval(vet)> 13.0) landice_cat=15 - else - call fixrdc_tile(fnvetc, tile_num_ch, i_index, j_index, - & kpdvet, vet, 1, len, me) - landice_cat=15 - endif - if (me .eq. 0) write(6,*) 'climatological vegetation', - & ' type read in.' - elseif(index(fnsmcc,'soilmgldas') /= 0) then ! new soil moisture climo - if (me .eq. 0) write(6,*) 'fatal error: must choose' - if (me .eq. 0) write(6,*) 'climatological veg type when' - if (me .eq. 0) write(6,*) 'using new gldas soil moisture.' - call abort - endif -! -! soil type -! - if(fnsotc(1:8).ne.' ') then - if ( index(fnsotc, "tileX.nc") == 0) then ! grib file - kpd7=-1 - call fixrdc(lugb,fnsotc,kpdsot,kpd7,kpd9,slmask, - & sot,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - else - call fixrdc_tile(fnsotc, tile_num_ch, i_index, j_index, - & kpdsot, sot, 1, len, me) - endif - if (me .eq. 0) write(6,*) 'climatological soil type read in.' - endif - -! -! min vegetation cover -! - if(fnvmnc(1:8).ne.' ') then - if ( index(fnvmnc, "tileX.nc") == 0) then ! grib file - kpd7=-1 - call fixrdc(lugb,fnvmnc,kpdvmn,kpd7,kpd9,slmask, - & vmn,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - else - call fixrdc_tile(fnvmnc, tile_num_ch, i_index, j_index, - & 257, vmn, 99, len, me) - - endif - if (me .eq. 0) write(6,*) 'climatological shdmin read in.' - endif -! -! max vegetation cover -! - if(fnvmxc(1:8).ne.' ') then - if ( index(fnvmxc, "tileX.nc") == 0) then ! grib file - kpd7=-1 - call fixrdc(lugb,fnvmxc,kpdvmx,kpd7,kpd9,slmask, - & vmx,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - else - call fixrdc_tile(fnvmxc, tile_num_ch, i_index, j_index, - & 256, vmx, 99, len, me) - endif - if (me .eq. 0) write(6,*) 'climatological shdmax read in.' - endif -! -! slope type -! - if(fnslpc(1:8).ne.' ') then - if ( index(fnslpc, "tileX.nc") == 0) then ! grib file - kpd7=-1 - call fixrdc(lugb,fnslpc,kpdslp,kpd7,kpd9,slmask, - & slp,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - else - call fixrdc_tile(fnslpc, tile_num_ch, i_index, j_index, - & kpdslp, slp, 1, len, me) - endif - if (me .eq. 0) write(6,*) 'climatological slope read in.' - endif -! -! max snow albeod -! - if(fnabsc(1:8).ne.' ') then - if ( index(fnabsc, "tileX.nc") == 0) then ! grib file - kpd7=-1 - call fixrdc(lugb,fnabsc,kpdabs,kpd7,kpd9,slmask, - & absm,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - else - call fixrdc_tile(fnabsc, tile_num_ch, i_index, j_index, - & kpdabs, absm, 1, len, me) - endif - if (me .eq. 0) write(6,*) 'climatological snoalb read in.' - endif -!clu ---------------------------------------------------------------------- -! - is1 = sea1/3 + 1 - is2 = sea2/3 + 1 - if (is1 .eq. 5) is1 = 1 - if (is2 .eq. 5) is2 = 1 - do nn=1,2 -! -! seasonal mean climatology - if(nn.eq.1) then - isx=is1 - else - isx=is2 - endif - if(isx.eq.1) kpd9 = 12 - if(isx.eq.2) kpd9 = 3 - if(isx.eq.3) kpd9 = 6 - if(isx.eq.4) kpd9 = 9 -! -! seasonal mean climatology -! -! albedo -! there are four albedo fields in this version: -! two for strong zeneith angle dependent (visible and near ir) -! and two for weak zeneith angle dependent (vis ans nir) -! - if (ialb == 0) then - kpd7=-1 - do k = 1, 4 - call fixrdc(lugb,fnalbc,kpdalb(k),kpd7,kpd9,slmask, - & alb(1,k,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - enddo - endif -! -! monthly mean climatology -! - mon = mon1 - if (nn .eq. 2) mon = mon2 -!cbosu -!cbosu new snowfree albedo database is monthly. - if (ialb == 1) then - if ( index(fnalbc, "tileX.nc") == 0) then ! grib file - kpd7=-1 - do k = 1, 4 - call fixrdc(lugb,fnalbc,kpdalb(k),kpd7,mon,slmask, - & alb(1,k,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - enddo - else - do k = 1, 4 - call fixrdc_tile(fnalbc, tile_num_ch, i_index, j_index, - & kpdalb(k), alb(:,k,nn), mon, len, me) - enddo - endif - endif - -! if(lprnt) print *,' mon1=',mon1,' mon2=',mon2 -! -! tsf at the current time t -! - kpd7=-1 - call fixrdc(lugb,fntsfc,kpdtsf,kpd7,mon,slmask, - & tsf(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) -! if(lprnt) print *,' tsf=',tsf(iprnt,nn),' nn=',nn -! -! tsf...at time t-deltsfc -! -! fh2 = fh - deltsfc -! if (fh2 .gt. 0.0) then -! call fixrd(lugb,fntsfc,kpdtsf,lclim,slmask, -! & iy,im,id,ih,fh2,tsfcl2,len,iret -! &, imsk, jmsk, slmskh, gaus,blno, blto -! &, outlat, outlon, me) -! else -! do i=1,len -! tsfcl2(i) = tsfclm(i) -! enddo -! endif -! -! soil wetness -! - if(fnwetc(1:8).ne.' ') then - kpd7=-1 - call fixrdc(lugb,fnwetc,kpdwet,kpd7,mon,slmask, - & wet(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - elseif(fnsmcc(1:8).ne.' ') then - if (index(fnsmcc,'global_soilmcpc.1x1.grb') /= 0) then ! the old climo data - kpd7=-1 - call fixrdc(lugb,fnsmcc,kpdsmc,kpd7,mon,slmask, - & smc(1,lsoil,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - do l=1,lsoil-1 - do i = 1, len - smc(i,l,nn) = smc(i,lsoil,nn) - enddo - enddo - else ! the new gldas data. it does not have data defined at landice - ! points. so for efficiency, don't have fixrdc try to - ! find a value at landice points as defined by the vet type (vet). - allocate(slmask_noice(len)) - slmask_noice=1.0 - do i = 1, len - if (nint(vet(i)) < 1 .or. - & nint(vet(i)) == landice_cat) then - slmask_noice(i) = 0.0 - endif - enddo - do k = 1, lsoil - if (k==1) kpd7=10 ! 0_10 cm (pds octs 11 and 12) - if (k==2) kpd7=2600 ! 10_40 cm - if (k==3) kpd7=10340 ! 40_100 cm - if (k==4) kpd7=25800 ! 100_200 cm - call fixrdc(lugb,fnsmcc,kpdsmc,kpd7,mon,slmask_noice, - & smc(1,k,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - enddo - deallocate(slmask_noice) - endif - else - write(6,*) 'climatological soil wetness file not given' - call abort - endif -! -! soil temperature -! - if(fnstcc(1:8).ne.' ') then - kpd7=-1 - call fixrdc(lugb,fnstcc,kpdstc,kpd7,mon,slmask, - & stc(1,lsoil,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - do l=1,lsoil-1 - do i = 1, len - stc(i,l,nn) = stc(i,lsoil,nn) - enddo - enddo - endif -! -! sea ice -! - kpd7=-1 - if(fnacnc(1:8).ne.' ') then - call fixrdc(lugb,fnacnc,kpdacn,kpd7,mon,slmask, - & acn(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - elseif(fnaisc(1:8).ne.' ') then - call fixrdc(lugb,fnaisc,kpdais,kpd7,mon,slmask, - & ais(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - else - write(6,*) 'climatological ice cover file not given' - call abort - endif -! -! snow depth -! - kpd7=-1 - call fixrdc(lugb,fnsnoc,kpdsno,kpd7,mon,slmask, - & sno(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) -! -! snow cover -! - if(fnscvc(1:8).ne.' ') then - kpd7=-1 - call fixrdc(lugb,fnscvc,kpdscv,kpd7,mon,slmask, - & scv(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - write(6,*) 'climatological snow cover read in.' - endif -! -! surface roughness -! - if(fnzorc(1:3) == 'sib') then - if (me == 0) then - write(6,*) 'roughness length to be set from sib veg type' - endif - elseif(fnzorc(1:4) == 'igbp') then - if (me == 0) then - write(6,*) 'roughness length to be set from igbp veg type' - endif - else - kpd7=-1 - call fixrdc(lugb,fnzorc,kpdzor,kpd7,mon,slmask, - & zor(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - endif -! - do i = 1, len -! set clouds climatology to zero - cvclm (i) = 0. - cvbclm(i) = 0. - cvtclm(i) = 0. -! - cnpclm(i) = 0. !set canopy water content climatology to zero - enddo -! -! vegetation cover -! - if(fnvegc(1:8).ne.' ') then - if ( index(fnvegc, "tileX.nc") == 0) then ! grib file - kpd7=-1 - call fixrdc(lugb,fnvegc,kpdveg,kpd7,mon,slmask, - & veg(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - else - call fixrdc_tile(fnvegc, tile_num_ch, i_index, j_index, - & kpdveg, veg(:,nn), mon, len, me) - endif - if (me .eq. 0) write(6,*) 'climatological vegetation', - & ' cover read in for mon=',mon - endif - - enddo -! - mon1s = mon1 ; mon2s = mon2 ; sea1s = sea1 ; sea2s = sea2 -! - if (me .eq. 0) print *,' mon1s=',mon1s,' mon2s=',mon2s - &,' sea1s=',sea1s,' sea2s=',sea2s -! - k1 = 1 ; k2 = 2 - m1 = 1 ; m2 = 2 -! - first = .false. - endif first_time -! -! to get tsf climatology at the previous call to sfccycle -! -! if (fh-deltsfc >= 0.0) then - rjdayh = rjday - deltsfc/24.0 -! else -! rjdayh = rjday -! endif -! if(lprnt) print *,' rjdayh=',rjdayh,' mon1=',mon1,' mon2=' -! &,mon2,' mon1s=',mon1s,' mon2s=',mon2s,' k1=',k1,' k2=',k2 - if (rjdayh .ge. dayhf(mon1)) then - if (mon2 .eq. 1) mon2 = 13 - wei1x = (dayhf(mon2)-rjdayh)/(dayhf(mon2)-dayhf(mon1)) - wei2x = 1.0 - wei1x - if (mon2 .eq. 13) mon2 = 1 - else - rjdayh2 = rjdayh - if (rjdayh .lt. dayhf(1)) rjdayh2 = rjdayh2 + 365.0 - if (mon1s .eq. mon1) then - mon1s = mon1 - 1 - if (mon1s .eq. 0) mon1s = 12 - k2 = k1 - k1 = mod(k2,2) + 1 - mon = mon1s - kpd7=-1 - call fixrdc(lugb,fntsfc,kpdtsf,kpd7,mon,slmask, - & tsf(1,k1),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - endif - mon2s = mon1s + 1 -! if (mon2s .eq. 1) mon2s = 13 - wei1x = (dayhf(mon2s)-rjdayh2)/(dayhf(mon2s)-dayhf(mon1s)) - wei2x = 1.0 - wei1x - if (mon2s .eq. 13) mon2s = 1 - do i=1,len - tsf2(i) = wei1x * tsf(i,k1) + wei2x * tsf(i,k2) - enddo - endif -! -!cbosu new albedo is monthly - if (sea1 .ne. sea1s) then - sea1s = sea1 - sea2s = sea2 - m1 = mod(m1,2) + 1 - m2 = mod(m1,2) + 1 -! -! seasonal mean climatology -! - isx = sea2/3 + 1 - if (isx .eq. 5) isx = 1 - if(isx.eq.1) kpd9 = 12 - if(isx.eq.2) kpd9 = 3 - if(isx.eq.3) kpd9 = 6 - if(isx.eq.4) kpd9 = 9 -! -! albedo -! there are four albedo fields in this version: -! two for strong zeneith angle dependent (visible and near ir) -! and two for weak zeneith angle dependent (vis ans nir) -! -!cbosu - if (ialb == 0) then - kpd7=-1 - do k = 1, 4 - call fixrdc(lugb,fnalbc,kpdalb(k),kpd7,kpd9,slmask - &, alb(1,k,m2),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - enddo - endif - - endif - - if (mon1 .ne. mon1s) then - - mon1s = mon1 - mon2s = mon2 - k1 = mod(k1,2) + 1 - k2 = mod(k1,2) + 1 -! -! monthly mean climatology -! - mon = mon2 - nn = k2 -!cbosu - if (ialb == 1) then - if (me == 0) print*,'bosu 2nd time in clima for month ', - & mon, k1,k2 - if ( index(fnalbc, "tileX.nc") == 0) then ! grib file - kpd7=-1 - do k = 1, 4 - call fixrdc(lugb,fnalbc,kpdalb(k),kpd7,mon,slmask, - & alb(1,k,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - enddo - else - do k = 1, 4 - call fixrdc_tile(fnalbc, tile_num_ch, i_index, j_index, - & kpdalb(k), alb(:,k,nn), mon, len, me) - enddo - endif - endif -! -! tsf at the current time t -! - kpd7=-1 - call fixrdc(lugb,fntsfc,kpdtsf,kpd7,mon,slmask, - & tsf(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) -! -! soil wetness -! - if(fnwetc(1:8).ne.' ') then - kpd7=-1 - call fixrdc(lugb,fnwetc,kpdwet,kpd7,mon,slmask, - & wet(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - elseif(fnsmcc(1:8).ne.' ') then - if (index(fnsmcc,'global_soilmcpc.1x1.grb') /= 0) then ! the old climo data - kpd7=-1 - call fixrdc(lugb,fnsmcc,kpdsmc,kpd7,mon,slmask, - & smc(1,lsoil,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - do l=1,lsoil-1 - do i = 1, len - smc(i,l,nn) = smc(i,lsoil,nn) - enddo - enddo - else ! the new gldas data. it does not have data defined at landice - ! points. so for efficiency, don't have fixrdc try to - ! find a value at landice points as defined by the vet type (vet). - allocate(slmask_noice(len)) - slmask_noice=1.0 - do i = 1, len - if (nint(vet(i)) < 1 .or. - & nint(vet(i)) == landice_cat) then - slmask_noice(i) = 0.0 - endif - enddo - do k = 1, lsoil - if (k==1) kpd7=10 ! 0_10 cm (pds octs 11 and 12) - if (k==2) kpd7=2600 ! 10_40 cm - if (k==3) kpd7=10340 ! 40_100 cm - if (k==4) kpd7=25800 ! 100_200 cm - call fixrdc(lugb,fnsmcc,kpdsmc,kpd7,mon,slmask_noice, - & smc(1,k,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - enddo - deallocate(slmask_noice) - endif - else - write(6,*) 'climatological soil wetness file not given' - call abort - endif -! -! sea ice -! - kpd7=-1 - if(fnacnc(1:8).ne.' ') then - call fixrdc(lugb,fnacnc,kpdacn,kpd7,mon,slmask, - & acn(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - elseif(fnaisc(1:8).ne.' ') then - call fixrdc(lugb,fnaisc,kpdais,kpd7,mon,slmask, - & ais(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - else - write(6,*) 'climatological ice cover file not given' - call abort - endif -! -! snow depth -! - kpd7=-1 - call fixrdc(lugb,fnsnoc,kpdsno,kpd7,mon,slmask, - & sno(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) -! -! snow cover -! - if(fnscvc(1:8).ne.' ') then - kpd7=-1 - call fixrdc(lugb,fnscvc,kpdscv,kpd7,mon,slmask, - & scv(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - write(6,*) 'climatological snow cover read in.' - endif -! -! surface roughness -! - if(fnzorc(1:3) == 'sib') then - if (me == 0) then - write(6,*) 'roughness length to be set from sib veg type' - endif - elseif(fnzorc(1:4) == 'igbp') then - if (me == 0) then - write(6,*) 'roughness length to be set from igbp veg type' - endif - else - kpd7=-1 - call fixrdc(lugb,fnzorc,kpdzor,kpd7,mon,slmask, - & zor(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - endif -! -! vegetation cover -! - if(fnvegc(1:8).ne.' ') then - if ( index(fnvegc, "tileX.nc") == 0) then ! grib file - kpd7=-1 - call fixrdc(lugb,fnvegc,kpdveg,kpd7,mon,slmask, - & veg(1,nn),len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - else - call fixrdc_tile(fnvegc, tile_num_ch, i_index, j_index, - & kpdveg, veg(:,nn), mon, len, me) - endif -! if (me .eq. 0) write(6,*) 'climatological vegetation', -! & ' cover read in for mon=',mon - endif -! - endif -! -! now perform the time interpolation -! -! when chosen, set the z0 based on the vegetation type. -! for this option to work, namelist variable fnvetc must be -! set to point at the proper vegetation type file. - if(fnzorc(1:3) == 'sib') then - if(fnvetc(1:4) == ' ') then - if (me==0) write(6,*) "must choose sib veg type climo file" - call abort - endif - zorclm = 0.0 - do i=1,len - ivtyp=nint(vet(i)) - if (ivtyp >= 1 .and. ivtyp <= 13) then - zorclm(i) = z0_sib(ivtyp) - endif - enddo - elseif(fnzorc(1:4) == 'igbp') then - if(fnvetc(1:4) == ' ') then - if (me==0) write(6,*) "must choose igbp veg type climo file" - call abort - endif - zorclm = 0.0 - do i=1,len - ivtyp=nint(vet(i)) - if (ivtyp >= 1 .and. ivtyp <= 20) then - z0_season(1) = z0_igbp_min(ivtyp) - z0_season(7) = z0_igbp_max(ivtyp) - if(outlat(i) < 0.0)then - zorclm(i) = wei1y * z0_season(hyr2) + - & wei2y *z0_season(hyr1) - else - zorclm(i) = wei1y * z0_season(hyr1) + - & wei2y *z0_season(hyr2) - endif - endif - enddo - else - do i=1,len - zorclm(i) = wei1m * zor(i,k1) + wei2m * zor(i,k2) - enddo - endif -! - do i=1,len - tsfclm(i) = wei1m * tsf(i,k1) + wei2m * tsf(i,k2) - snoclm(i) = wei1m * sno(i,k1) + wei2m * sno(i,k2) - cvclm(i) = 0.0 - cvbclm(i) = 0.0 - cvtclm(i) = 0.0 - cnpclm(i) = 0.0 - tsfcl2(i) = tsf2(i) - enddo -! if(lprnt) print *,' tsfclm=',tsfclm(iprnt),' wei1m=',wei1m -! &,' wei2m=',wei2m,' tsfk12=',tsf(iprnt,k1),tsf(iprnt,k2) -! - if (fh .eq. 0.0) then - do i=1,len - tsfcl0(i) = tsfclm(i) - enddo - endif - if (rjdayh .ge. dayhf(mon1)) then - do i=1,len - tsf2(i) = wei1x * tsf(i,k1) + wei2x * tsf(i,k2) - tsfcl2(i) = tsf2(i) - enddo - endif -! if(lprnt) print *,' tsf2=',tsf2(iprnt),' wei1x=',wei1x -! &,' wei2x=',wei2x,' tsfk12=',tsf(iprnt,k1),tsf(iprnt,k2) -! &,' mon1s=',mon1s,' mon2s=',mon2s -! &,' slmask=',slmask(iprnt) -! - if(fnacnc(1:8).ne.' ') then - do i=1,len - acnclm(i) = wei1m * acn(i,k1) + wei2m * acn(i,k2) - enddo - elseif(fnaisc(1:8).ne.' ') then - do i=1,len - aisclm(i) = wei1m * ais(i,k1) + wei2m * ais(i,k2) - enddo - endif -! - if(fnwetc(1:8).ne.' ') then - do i=1,len - wetclm(i) = wei1m * wet(i,k1) + wei2m * wet(i,k2) - enddo - elseif(fnsmcc(1:8).ne.' ') then - do k=1,lsoil - do i=1,len - smcclm(i,k) = wei1m * smc(i,k,k1) + wei2m * smc(i,k,k2) - enddo - enddo - endif -! - if(fnscvc(1:8).ne.' ') then - do i=1,len - scvclm(i) = wei1m * scv(i,k1) + wei2m * scv(i,k2) - enddo - endif -! - if(fntg3c(1:8).ne.' ') then - do i=1,len - tg3clm(i) = tg3(i) - enddo - elseif(fnstcc(1:8).ne.' ') then - do k=1,lsoil - do i=1,len - stcclm(i,k) = wei1m * stc(i,k,k1) + wei2m * stc(i,k,k2) - enddo - enddo - endif -! - if(fnvegc(1:8).ne.' ') then - do i=1,len - vegclm(i) = wei1m * veg(i,k1) + wei2m * veg(i,k2) - enddo - endif -! - if(fnvetc(1:8).ne.' ') then - do i=1,len - vetclm(i) = vet(i) - enddo - endif -! - if(fnsotc(1:8).ne.' ') then - do i=1,len - sotclm(i) = sot(i) - enddo - endif - - -!clu ---------------------------------------------------------------------- -! - if(fnvmnc(1:8).ne.' ') then - do i=1,len - vmnclm(i) = vmn(i) - enddo - endif -! - if(fnvmxc(1:8).ne.' ') then - do i=1,len - vmxclm(i) = vmx(i) - enddo - endif -! - if(fnslpc(1:8).ne.' ') then - do i=1,len - slpclm(i) = slp(i) - enddo - endif -! - if(fnabsc(1:8).ne.' ') then - do i=1,len - absclm(i) = absm(i) - enddo - endif -!clu ---------------------------------------------------------------------- -! -!cbosu diagnostic print - if (me == 0) print*,'monthly albedo weights are ', - & wei1m,' for k', k1, wei2m, ' for k', k2 - - if (ialb == 1) then - do k=1,4 - do i=1,len - albclm(i,k) = wei1m * alb(i,k,k1) + wei2m * alb(i,k,k2) - enddo - enddo - else - do k=1,4 - do i=1,len - albclm(i,k) = wei1s * alb(i,k,m1) + wei2s * alb(i,k,m2) - enddo - enddo - endif -! - do k=1,2 - do i=1,len - alfclm(i,k) = alf(i,k) - enddo - enddo -! -! end of climatology reads -! - return - end subroutine clima - -!>\ingroup mod_sfcsub - subroutine fixrdc_tile(filename_raw, tile_num_ch, - & i_index, j_index, kpds, - & var, mon, npts, me) - use netcdf - use machine , only : kind_io8 - implicit none - character(len=*), intent(in) :: filename_raw - character(len=*), intent(in) :: tile_num_ch - integer, intent(in) :: npts, me, kpds, mon - integer, intent(in) :: i_index(npts) - integer, intent(in) :: j_index(npts) - real(kind_io8), intent(out) :: var(npts) - character(len=500) :: filename - character(len=80) :: errmsg - integer :: i, ii, ncid, t - integer :: error, id_dim - integer :: nx, ny, num_times - integer :: id_var - real(kind=4), allocatable :: dummy(:,:,:) - ii=index(filename_raw,"tileX") - - do i = 1, len(filename) - filename(i:i) = " " - enddo - - filename = filename_raw(1:ii-1) // tile_num_ch // ".nc" - - if (me == 0) print*, ' in fixrdc_tile for mon=',mon, - & ' filename=', trim(filename) - - error=nf90_open(trim(filename), nf90_nowrite, ncid) - if (error /= nf90_noerr) call netcdf_err(error) - - error=nf90_inq_dimid(ncid, 'nx', id_dim) - if (error /= nf90_noerr) call netcdf_err(error) - error=nf90_inquire_dimension(ncid,id_dim,len=nx) - if (error /= nf90_noerr) call netcdf_err(error) - - error=nf90_inq_dimid(ncid, 'ny', id_dim) - if (error /= nf90_noerr) call netcdf_err(error) - error=nf90_inquire_dimension(ncid,id_dim,len=ny) - if (error /= nf90_noerr) call netcdf_err(error) - - error=nf90_inq_dimid(ncid, 'time', id_dim) - if (error /= nf90_noerr) call netcdf_err(error) - error=nf90_inquire_dimension(ncid,id_dim,len=num_times) - if (error /= nf90_noerr) call netcdf_err(error) - - select case (kpds) - case(11) - error=nf90_inq_varid(ncid, 'substrate_temperature', id_var) - case(87) - error=nf90_inq_varid(ncid, 'vegetation_greenness', id_var) - case(159) - error=nf90_inq_varid(ncid, 'maximum_snow_albedo', id_var) - case(189) - error=nf90_inq_varid(ncid, 'visible_black_sky_albedo', id_var) - case(190) - error=nf90_inq_varid(ncid, 'visible_white_sky_albedo', id_var) - case(191) - error=nf90_inq_varid(ncid, 'near_IR_black_sky_albedo', id_var) - case(192) - error=nf90_inq_varid(ncid, 'near_IR_white_sky_albedo', id_var) - case(214) - error=nf90_inq_varid(ncid, 'facsf', id_var) - case(224) - error=nf90_inq_varid(ncid, 'soil_type', id_var) - case(225) - error=nf90_inq_varid(ncid, 'vegetation_type', id_var) - case(236) - error=nf90_inq_varid(ncid, 'slope_type', id_var) - case(256:257) - error=nf90_inq_varid(ncid, 'vegetation_greenness', id_var) - case default - print*,'fatal error in fixrdc_tile of sfcsub.F.' - print*,'unknown variable.' - call abort - end select - if (error /= nf90_noerr) call netcdf_err(error) - - allocate(dummy(nx,ny,1)) - - if (kpds == 256) then ! max veg greenness - - var = -9999. - do t = 1, num_times - error=nf90_get_var(ncid, id_var, dummy, start=(/1,1,t/), - & count=(/nx,ny,1/) ) - if (error /= nf90_noerr) call netcdf_err(error) - do ii = 1,npts - var(ii) = max(var(ii), dummy(i_index(ii),j_index(ii),1)) - enddo - enddo - - elseif (kpds == 257) then ! min veg greenness - - var = 9999. - do t = 1, num_times - error=nf90_get_var(ncid, id_var, dummy, start=(/1,1,t/), - & count=(/nx,ny,1/) ) - if (error /= nf90_noerr) call netcdf_err(error) - do ii = 1, npts - var(ii) = min(var(ii), dummy(i_index(ii),j_index(ii),1)) - enddo - enddo - - else - - error=nf90_get_var(ncid, id_var, dummy, start=(/1,1,mon/), - & count=(/nx,ny,1/) ) - if (error /= nf90_noerr) call netcdf_err(error) - - do ii = 1, npts - var(ii) = dummy(i_index(ii),j_index(ii),1) - enddo - - endif - - deallocate(dummy) - - error=nf90_close(ncid) - - select case (kpds) - case(159) ! max snow alb - var = var * 100.0 - case(214) ! facsf - where (var < 0.0) var = 0.0 - var = var * 100.0 - case(189:192) - var = var * 100.0 - case(256:257) - var = var * 100.0 - end select - - return - - end subroutine fixrdc_tile - -!>\ingroup mod_sfcsub - subroutine netcdf_err(error) - - use netcdf - implicit none - - integer,intent(in) :: error - character(len=256) :: errmsg - - errmsg = nf90_strerror(error) - print*,'fatal error in sfcsub.F: ', trim(errmsg) - call abort - - end subroutine netcdf_err - -!>\ingroup mod_sfcsub - subroutine fixrdc(lugb,fngrib,kpds5,kpds7,mon,slmask, - & gdata,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - use machine , only : kind_io8,kind_io4 - use sfccyc_module, only : mdata - implicit none - integer imax,jmax,ijmax,i,j,n,jret,inttyp,iret,imsk, - & jmsk,len,lugb,kpds5,mon,lskip,lgrib,ndata,lugi,me,kmami - &, jj,w3kindreal,w3kindint - real (kind=kind_io8) wlon,elon,rnlat,dlat,dlon,rslat,blno,blto -! -! read in grib climatology files and interpolate to the input -! grid. grib files should allow all the necessary parameters -! to be extracted from the description records. -! -! - character*500 fngrib -! character*80 fngrib, asgnstr -! - real (kind=kind_io8) slmskh(imsk,jmsk) -! - real (kind=kind_io8) gdata(len), slmask(len) - real (kind=kind_io8), allocatable :: data(:,:), rslmsk(:,:) - real (kind=kind_io8), allocatable :: data8(:) - real (kind=kind_io4), allocatable :: data4(:) - real (kind=kind_io8), allocatable :: rlngrb(:), rltgrb(:) -! - logical lmask, yr2kc, gaus, ijordr - logical*1, allocatable :: lbms(:) -! - integer, intent(in) :: kpds7 - integer kpds(1000),kgds(1000) - integer jpds(1000),jgds(1000), kpds0(1000) - real (kind=kind_io8) outlat(len), outlon(len) -! - allocate(data8(1:mdata)) - allocate(lbms(mdata)) -! -! integer imax_sv, jmax_sv, wlon_sv, rnlat_sv, kpds1_sv -! date imax_sv/0/, jmax_sv/0/, wlon_sv/999.0/, rnlat_sv/999.0/ -! &, kpds1_sv/-1/ -! save imax_sv, jmax_sv, wlon_sv, rnlat_sv, kpds1_sv -! &, rlngrb, rltgrb -! - iret = 0 -! - if (me .eq. 0) write(6,*) ' in fixrdc for mon=',mon - &,' fngrib=',trim(fngrib) -! - close(lugb) - call baopenr(lugb,fngrib,iret) - if (iret .ne. 0) then - write(6,*) ' error in opening file ',trim(fngrib) - print *,'error in opening file ',trim(fngrib) - call abort - endif - if (me .eq. 0) write(6,*) ' file ',trim(fngrib), - & ' opened. unit=',lugb -! - lugi = 0 -! - lskip = -1 - jpds = -1 - jgds = -1 - jpds(5) = kpds5 - jpds(7) = kpds7 - kpds = jpds - call getgbh(lugb,lugi,lskip,jpds,jgds,lgrib,ndata, - & lskip,kpds,kgds,iret) - if (me .eq. 0) then - write(6,*) ' first grib record.' - write(6,*) ' kpds( 1-10)=',(kpds(j),j= 1,10) - write(6,*) ' kpds(11-20)=',(kpds(j),j=11,20) - write(6,*) ' kpds(21- )=',(kpds(j),j=21,22) - endif - yr2kc = (kpds(8) / 100) .gt. 0 - kpds0 = jpds - kpds0(4) = -1 - kpds0(18) = -1 - if(iret.ne.0) then - write(6,*) ' error in getgbh. iret: ', iret - if (iret==99) write(6,*) ' field not found.' - call abort - endif -! -! handling climatology file -! - lskip = -1 - n = 0 - jpds = kpds0 - jpds(9) = mon - if(jpds(9).eq.13) jpds(9) = 1 - call w3kind(w3kindreal,w3kindint) - if (w3kindreal==8) then - call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip, - & kpds,kgds,lbms,data8,jret) - else if (w3kindreal==4) then - allocate(data4(1:mdata)) - call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip, - & kpds,kgds,lbms,data4,jret) - data8 = real(data4, kind=kind_io8) - deallocate(data4) - endif - if (me .eq. 0) write(6,*) ' input grib file dates=', - & (kpds(i),i=8,11) - if(jret.eq.0) then - if(ndata.eq.0) then - write(6,*) ' error in getgb' - write(6,*) ' kpds=',kpds - write(6,*) ' kgds=',kgds - call abort - endif - imax=kgds(2) - jmax=kgds(3) - ijmax=imax*jmax - allocate (data(imax,jmax)) - do j=1,jmax - jj = (j-1)*imax - do i=1,imax - data(i,j) = data8(jj+i) - enddo - enddo - if (me .eq. 0) write(6,*) 'imax,jmax,ijmax=',imax,jmax,ijmax - else - write(6,*) ' error in getgb - jret=', jret - call abort - endif -! -! if (me == 0) then -! write(6,*) ' maxmin of input as is' -! kmami=1 -! call maxmin(data(1,1),ijmax,kmami) -! endif -! - call getarea(kgds,dlat,dlon,rslat,rnlat,wlon,elon,ijordr,me) - if (me == 0) then - write(6,*) 'imax,jmax,ijmax,dlon,dlat,ijordr,wlon,rnlat=' - write(6,*) imax,jmax,ijmax,dlon,dlat,ijordr,wlon,rnlat - endif - call subst(data,imax,jmax,dlon,dlat,ijordr) -! -! first get slmask over input grid -! - allocate (rlngrb(imax), rltgrb(jmax)) - allocate (rslmsk(imax,jmax)) - - call setrmsk(kpds5,slmskh,imsk,jmsk,wlon,rnlat, - & data,imax,jmax,rlngrb,rltgrb,lmask,rslmsk - &, gaus,blno, blto, kgds(1), kpds(4), lbms) -! write(6,*) ' kpds5=',kpds5,' lmask=',lmask -! - inttyp = 0 - if(kpds5.eq.225) inttyp = 1 - if(kpds5.eq.230) inttyp = 1 - if(kpds5.eq.236) inttyp = 1 - if(kpds5.eq.224) inttyp = 1 - if (me .eq. 0) then - if(inttyp.eq.1) print *, ' nearest grid point used' - &, ' kpds5=',kpds5, ' lmask = ',lmask - endif -! - call la2ga(data,imax,jmax,rlngrb,rltgrb,wlon,rnlat,inttyp, - & gdata,len,lmask,rslmsk,slmask - &, outlat, outlon,me) -! - deallocate (rlngrb, stat=iret) - deallocate (rltgrb, stat=iret) - deallocate (data, stat=iret) - deallocate (rslmsk, stat=iret) - call baclose(lugb,iret) -! - deallocate(data8) - deallocate(lbms) - return - end subroutine fixrdc - -!>\ingroup mod_sfcsub - subroutine fixrda(lugb,fngrib,kpds5,slmask, - & iy,im,id,ih,fh,gdata,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto - &, outlat, outlon, me) - use machine , only : kind_io8,kind_io4 - use sfccyc_module, only : mdata - implicit none - integer nrepmx,nvalid,imo,iyr,idy,jret,ihr,nrept,lskip,lugi, - & lgrib,j,ndata,i,inttyp,jmax,imax,ijmax,ij,jday,len,iret, - & jmsk,imsk,ih,kpds5,lugb,iy,id,im,jh,jd,jdoy,jdow,jm,me, - & monend,jy,iy4,kmami,iret2,jj,w3kindreal,w3kindint - real (kind=kind_io8) rnlat,rslat,wlon,elon,dlon,dlat,fh,blno, - & rjday,blto -! -! read in grib climatology/analysis files and interpolate to the input -! dates and the grid. grib files should allow all the necessary parameters -! to be extracted from the description records. -! -! nrepmx: max number of days for going back date search -! nvalid: analysis later than (current date - nvalid) is regarded as -! valid for current analysis -! - parameter(nrepmx=15, nvalid=4) -! - character*500 fngrib -! character*80 fngrib, asgnstr -! - real (kind=kind_io8) slmskh(imsk,jmsk) -! - real (kind=kind_io8) gdata(len), slmask(len) - real (kind=kind_io8), allocatable :: data(:,:),rslmsk(:,:) - real (kind=kind_io8), allocatable :: data8(:) - real (kind=kind_io4), allocatable :: data4(:) - real (kind=kind_io8), allocatable :: rlngrb(:), rltgrb(:) -! - logical lmask, yr2kc, gaus, ijordr - logical*1 lbms(mdata) -! - integer kpds(1000),kgds(1000) - integer jpds(1000),jgds(1000), kpds0(1000) - real (kind=kind_io8) outlat(len), outlon(len) -! -! dayhf : julian day of the middle of each month -! - real (kind=kind_io8) dayhf(13) - data dayhf/ 15.5, 45.0, 74.5,105.0,135.5,166.0, - & 196.5,227.5,258.0,288.5,319.0,349.5,380.5/ -! -! mjday : number of days in a month -! - integer mjday(12) - data mjday/31,28,31,30,31,30,31,31,30,31,30,31/ -! - real (kind=kind_io8) fha(5) - real(4) fha4(5) - integer ida(8),jda(8) -! - allocate(data8(1:mdata)) - iret = 0 - monend = 9999 -! -! compute jy,jm,jd,jh of forecast and the day of the year -! - iy4=iy - if(iy.lt.101) iy4=1900+iy4 - fha=0 - ida=0 - jda=0 - fha(2)=nint(fh) - ida(1)=iy - ida(2)=im - ida(3)=id - ida(5)=ih - call w3kind(w3kindreal,w3kindint) - if(w3kindreal==4) then - fha4=fha - call w3movdat(fha4,ida,jda) - else - call w3movdat(fha,ida,jda) - endif - jy=jda(1) - jm=jda(2) - jd=jda(3) - jh=jda(5) -! if (me .eq. 0) write(6,*) ' forecast jy,jm,jd,jh,rjday=', -! & jy,jm,jd,jh,rjday - jdow = 0 - jdoy = 0 - jday = 0 - call w3doxdat(jda,jdow,jdoy,jday) - rjday=jdoy+jda(5)/24. - if(rjday.lt.dayhf(1)) rjday=rjday+365. - - if (me .eq. 0) write(6,*) ' forecast jy,jm,jd,jh,rjday=', - & jy,jm,jd,jh,rjday -! - if (me .eq. 0) then - write(6,*) 'forecast jy,jm,jd,jh=',jy,jm,jd,jh -! - write(6,*) ' ' - write(6,*) '************************************************' - endif -! - close(lugb) - call baopenr(lugb,fngrib,iret) - if (iret .ne. 0) then - write(6,*) ' error in opening file ',trim(fngrib) - print *,'error in opening file ',trim(fngrib) - call abort - endif - if (me .eq. 0) write(6,*) ' file ',trim(fngrib), - & ' opened. unit=',lugb -! - lugi = 0 -! - lskip=-1 - jpds=-1 - jgds=-1 - jpds(5)=kpds5 - kpds = jpds - call getgbh(lugb,lugi,lskip,jpds,jgds,lgrib,ndata, - & lskip,kpds,kgds,iret) - if (me .eq. 0) then - write(6,*) ' first grib record.' - write(6,*) ' kpds( 1-10)=',(kpds(j),j= 1,10) - write(6,*) ' kpds(11-20)=',(kpds(j),j=11,20) - write(6,*) ' kpds(21- )=',(kpds(j),j=21,22) - endif - yr2kc = (kpds(8) / 100) .gt. 0 - kpds0=jpds - kpds0(4)=-1 - kpds0(18)=-1 - if(iret.ne.0) then - write(6,*) ' error in getgbh. iret: ', iret - if(iret==99) write(6,*) ' field not found.' - call abort - endif -! -! handling analysis file -! -! find record for the given hour/day/month/year -! - nrept=0 - jpds=kpds0 - lskip = -1 - iyr=jy - if(iyr.le.100) iyr=2050-mod(2050-iyr,100) - imo=jm - idy=jd - ihr=jh -! year 2000 compatible data - if (yr2kc) then - jpds(8) = iyr - else - jpds(8) = mod(iyr,1900) - endif - 50 continue - jpds( 8)=mod(iyr-1,100)+1 - jpds( 9)=imo - jpds(10)=idy -! jpds(11)=ihr - jpds(21)=(iyr-1)/100+1 - call w3kind(w3kindreal,w3kindint) - if (w3kindreal == 8) then - call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip, - & kpds,kgds,lbms,data8,jret) - elseif (w3kindreal == 4) then - allocate (data4(1:mdata)) - call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip, - & kpds,kgds,lbms,data4,jret) - data8 = real(data4, kind=kind_io8) - deallocate(data4) - endif - if (me .eq. 0) write(6,*) ' input grib file dates=', - & (kpds(i),i=8,11) - if(jret.eq.0) then - if(ndata.eq.0) then - write(6,*) ' error in getgb' - write(6,*) ' kpds=',kpds - write(6,*) ' kgds=',kgds - call abort - endif - imax=kgds(2) - jmax=kgds(3) - ijmax=imax*jmax - allocate (data(imax,jmax)) - do j=1,jmax - jj = (j-1)*imax - do i=1,imax - data(i,j) = data8(jj+i) - enddo - enddo - else - if(nrept.eq.0) then - if (me .eq. 0) then - write(6,*) ' no matching dates found. start searching', - & ' nearest matching dates (going back).' - endif - endif -! -! no matching ih found. search nearest hour -! - if(ihr.eq.6) then - ihr=0 - go to 50 - elseif(ihr.eq.12) then - ihr=0 - go to 50 - elseif(ihr.eq.18) then - ihr=12 - go to 50 - elseif(ihr.eq.0.or.ihr.eq.-1) then - idy=idy-1 - if(idy.eq.0) then - imo=imo-1 - if(imo.eq.0) then - iyr=iyr-1 - if(iyr.lt.0) iyr=99 - imo=12 - endif - idy=31 - if(imo.eq.4.or.imo.eq.6.or.imo.eq.9.or.imo.eq.11) idy=30 - if(imo.eq.2) then - if(mod(iyr,4).eq.0) then - idy=29 - else - idy=28 - endif - endif - endif - ihr=-1 - if (me .eq. 0) write(6,*) ' decremented dates=', - & iyr,imo,idy,ihr - nrept=nrept+1 - if(nrept.gt.nvalid) iret=-1 - if(nrept.gt.nrepmx) then - if (me .eq. 0) then - write(6,*) ' searching range exceeded.' - &, ' may be wrong grib file given' - write(6,*) ' fngrib=',trim(fngrib) - write(6,*) ' terminating search and', - & ' and setting gdata to -999' - write(6,*) ' range max=',nrepmx - endif -! imax=kgds(2) -! jmax=kgds(3) -! ijmax=imax*jmax -! do ij=1,ijmax -! data(ij)=0. -! enddo - go to 100 - endif - go to 50 - else - if (me .eq. 0) then - write(6,*) ' search of analysis for ihr=',ihr,' failed.' - write(6,*) ' kpds=',kpds - write(6,*) ' iyr,imo,idy,ihr=',iyr,imo,idy,ihr - endif - go to 100 - endif - endif -! - 80 continue -! if (me == 0) then -! write(6,*) ' maxmin of input as is' -! kmami=1 -! call maxmin(data(1,1),ijmax,kmami) -! endif -! - call getarea(kgds,dlat,dlon,rslat,rnlat,wlon,elon,ijordr,me) - if (me == 0) then - write(6,*) 'imax,jmax,ijmax,dlon,dlat,ijordr,wlon,rnlat=' - write(6,*) imax,jmax,ijmax,dlon,dlat,ijordr,wlon,rnlat - endif - call subst(data,imax,jmax,dlon,dlat,ijordr) -! -! first get slmask over input grid -! - allocate (rlngrb(imax), rltgrb(jmax)) - allocate (rslmsk(imax,jmax)) - call setrmsk(kpds5,slmskh,imsk,jmsk,wlon,rnlat, - & data,imax,jmax,rlngrb,rltgrb,lmask,rslmsk -! & data,imax,jmax,abs(dlon),abs(dlat),lmask,rslmsk -!cggg &, gaus,blno, blto, kgds(1)) - &, gaus,blno, blto, kgds(1), kpds(4), lbms) - -! write(6,*) ' kpds5=',kpds5,' lmask=',lmask -! - inttyp = 0 - if(kpds5.eq.225) inttyp = 1 - if(kpds5.eq.230) inttyp = 1 - if(kpds5.eq.66) inttyp = 1 - if(inttyp.eq.1) print *, ' nearest grid point used' -! - call la2ga(data,imax,jmax,rlngrb,rltgrb,wlon,rnlat,inttyp, - & gdata,len,lmask,rslmsk,slmask - &, outlat, outlon, me) -! - deallocate (rlngrb, stat=iret) - deallocate (rltgrb, stat=iret) - deallocate (data, stat=iret) - deallocate (rslmsk, stat=iret) - call baclose(lugb,iret2) -! write(6,*) ' ' - deallocate(data8) - return -! - 100 continue - iret=1 - do i=1,len - gdata(i) = -999. - enddo -! - call baclose(lugb,iret2) -! - deallocate(data8) - return - end subroutine fixrda - -!>\ingroup mod_sfcsub - subroutine snodpth2(glacir,snwmax,snoanl, len, me) - use machine , only : kind_io8,kind_io4 - implicit none - integer i,me,len - real (kind=kind_io8) snwmax -! - real (kind=kind_io8) snoanl(len), glacir(len) -! - if (me .eq. 0) write(6,*) 'snodpth2' -! - do i=1,len -! -! if glacial points has snow in climatology, set sno to snomax -! - if(glacir(i).ne.0..and.snoanl(i).lt.snwmax*0.5) then - snoanl(i) = snwmax + snoanl(i) - endif -! - enddo - return - end -!>@} diff --git a/physics/shinhongvdif.F90 b/physics/shinhongvdif.F90 deleted file mode 100644 index c5011218b..000000000 --- a/physics/shinhongvdif.F90 +++ /dev/null @@ -1,2106 +0,0 @@ -!> \file shinhongvdif.F90 -!! This file contains the CCPP-compliant Shinhong (saYSU) scheme which computes -!! subgrid vertical turbulence mixing using traditional K-profile method -!! Please refer to (Shin and Hong, 2013,2015). -!! -!! Subroutine 'shinhongvdif_run' computes subgrid vertical turbulence mixing -!! using scale-aware YSU K-profile method -!! -!---------------------------------------------------------------------- - - module shinhongvdif - contains - - subroutine shinhongvdif_init () - end subroutine shinhongvdif_init - - subroutine shinhongvdif_finalize () - end subroutine shinhongvdif_finalize - -!> \defgroup SHINHONG FV3GFS shinhongvdif_run Main -!! \brief This subroutine contains all of the logic for the -!! scale-aware Shinhong scheme. -!! -!> \section arg_table_shinhongvdif_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | ux | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | vx | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | tx | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | -!! | qx | tracer_concentration | model layer mean tracer concentration | kg kg-1 | 3 | real | kind_phys | in | F | -!! | p2d | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | p2di | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | pi2d | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | -!! | vtnp | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | utnp | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | ttnp | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | -!! | qtnp | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers due to model physics | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | -!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | ndiff | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | tracer index for cloud condensate (or liquid water) | index | 0 | integer | | in | F | -!! | ntiw | index_for_ice_cloud_condensate | tracer index for ice water | index | 0 | integer | | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | psfcpa | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | -!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | -!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | -!! | psim | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | -!! | psih | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | -!! | landmask | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | -!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | wspd | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | br | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | -!! | g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | ep1 | ratio_of_vapor_to_dry_air_gas_constants_minus_one | rv/rd - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | ep2 | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | -!! | xlv | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | dusfc | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dvsfc | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | -!! | kpbl1d | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | -!! | u10 | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | v10 | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | dx | cell_size | size of the grid cell | m | 1 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! -!------------------------------------------------------------------------------- - subroutine shinhongvdif_run(ix,im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & - utnp,vtnp,ttnp,qtnp,ntrac,ndiff,ntcw,ntiw, & - phii,phil,psfcpa, & - zorl,stress,hpbl,psim,psih, & - landmask,heat,evap,wspd,br, & - g,rd,cp,rv,ep1,ep2,xlv, & - dusfc,dvsfc,dtsfc,dqsfc, & - dt,kpbl1d, & - u10,v10, & - dx,errmsg,errflg ) - - use machine , only : kind_phys -! -!------------------------------------------------------------------------------- - implicit none -!------------------------------------------------------------------------------- -! -! the shinhongpbl (shin and hong 2015) is based on the les study of shin -! and hong (2013). the major ingredients of the shinhongpbl are -! 1) the prescribed nonlocal heat transport profile fit to the les and -! 2) inclusion of explicit scale dependency functions for vertical -! transport in convective pbl. -! so, the shinhongpbl works at the gray zone resolution of convective pbl. -! note that honnert et al. (2011) first suggested explicit scale dependency -! function, and shin and hong (2013) further classified the function by -! stability (u*/w*) in convective pbl and calculated the function for -! nonlocal and local transport separately. -! vertical mixing in the stable boundary layer and free atmosphere follows -! hong (2010) and hong et al. (2006), same as the ysupbl scheme. -! -! shinhongpbl: -! coded and implemented by hyeyum hailey shin (ncar) -! summer 2014 -! -! ysupbl: -! coded by song-you hong (yonsei university) and implemented by -! song-you hong (yonsei university) and jimy dudhia (ncar) -! summer 2002 -! -! references: -! shin and hong (2015) mon. wea. rev. -! shin and hong (2013) j. atmos. sci. -! honnert, masson, and couvreux (2011) j. atmos. sci. -! hong (2010) quart. j. roy. met. soc -! hong, noh, and dudhia (2006), mon. wea. rev. -! -!------------------------------------------------------------------------------- -! - real(kind=kind_phys),parameter :: xkzminm = 0.1,xkzminh = 0.01 - real(kind=kind_phys),parameter :: xkzmax = 1000.,rimin = -100. - real(kind=kind_phys),parameter :: rlam = 30.,prmin = 0.25,prmax = 4. - real(kind=kind_phys),parameter :: brcr_ub = 0.0,brcr_sb = 0.25,cori = 1.e-4 - real(kind=kind_phys),parameter :: afac = 6.8,bfac = 6.8,pfac = 2.0,pfac_q = 2.0 - real(kind=kind_phys),parameter :: phifac = 8.,sfcfrac = 0.1 - real(kind=kind_phys),parameter :: d1 = 0.02, d2 = 0.05, d3 = 0.001 - real(kind=kind_phys),parameter :: h1 = 0.33333335, h2 = 0.6666667 - real(kind=kind_phys),parameter :: ckz = 0.001,zfmin = 1.e-8,aphi5 = 5.,aphi16 = 16. - real(kind=kind_phys),parameter :: tmin=1.e-2 - real(kind=kind_phys),parameter :: gamcrt = 3.,gamcrq = 2.e-3 - real(kind=kind_phys),parameter :: xka = 2.4e-5 - real(kind=kind_phys),parameter :: karman = 0.4 - real(kind=kind_phys),parameter :: corf=0.000073 - real(kind=kind_phys),parameter :: rcl = 1.0 - integer,parameter :: imvdif = 1 - integer,parameter :: shinhong_tke_diag = 0 -! -! tunable parameters for tke -! - real(kind=kind_phys),parameter :: epsq2l = 0.01,c_1 = 1.0,gamcre = 0.224 -! -! tunable parameters for prescribed nonlocal transport profile -! - real(kind=kind_phys),parameter :: mltop = 1.0,sfcfracn1 = 0.075 - real(kind=kind_phys),parameter :: nlfrac = 0.7,enlfrac = -0.4 - real(kind=kind_phys),parameter :: a11 = 1.0,a12 = -1.15 - real(kind=kind_phys),parameter :: ezfac = 1.5 - real(kind=kind_phys),parameter :: cpent = -0.4,rigsmax = 100. - real(kind=kind_phys),parameter :: entfmin = 1.0, entfmax = 5.0 -! 1D in - integer, intent(in ) :: ix,im,km,ntrac,ndiff,ntcw,ntiw - real(kind=kind_phys), intent(in ) :: g,cp,rd,rv,ep1,ep2,xlv,dt -! 3D in - real(kind=kind_phys), dimension(ix, km) , & - intent(in ) :: phil, & - pi2d, & - p2d, & - ux, & - vx, & - tx - real(kind=kind_phys), dimension( ix, km, ntrac ) , & - intent(in ) :: qx - - real(kind=kind_phys), dimension( ix, km+1 ) , & - intent(in ) :: p2di, & - phii -! 3D in&out - real(kind=kind_phys), dimension(im, km) , & - intent(inout) :: utnp, & - vtnp, & - ttnp - real(kind=kind_phys), dimension(im, km, ntrac ) , & - intent(inout) :: qtnp -! 2D in - integer, dimension(im) , & - intent(in ) :: landmask - - real(kind=kind_phys), dimension(im) , & - intent(in ) :: heat, & - evap, & - br, & - psim, & - psih, & - psfcpa, & - stress, & - zorl, & - wspd, & - u10, & - v10, & - dx -! 2D: out - integer, dimension(im) , & - intent(out ) :: kpbl1d - - real(kind=kind_phys), dimension(im) , & - intent(out ) :: hpbl, & - dusfc, & - dvsfc, & - dtsfc, & - dqsfc - -! error messages - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -! -! local vars -! - integer :: n,i,k,l,ic - integer :: klpbl - integer :: lmh,lmxl,kts,kte,its,ite -! - real(kind=kind_phys) :: dt2,rdt,spdk2,fm,fh,hol1,gamfac,vpert,prnum,prnum0 - real(kind=kind_phys) :: ss,ri,qmean,tmean,alpha,chi,zk,rl2,dk,sri - real(kind=kind_phys) :: brint,dtodsd,dtodsu,rdz,dsdzt,dsdzq,dsdz2,rlamdz - real(kind=kind_phys) :: utend,vtend,ttend,qtend - real(kind=kind_phys) :: dtstep,govrthv - real(kind=kind_phys) :: cont, conq, conw, conwrc - real(kind=kind_phys) :: delxy,pu1,pth1,pq1 - real(kind=kind_phys) :: dex,hgame_c - real(kind=kind_phys) :: zfacdx - real(kind=kind_phys) :: amf1,amf2,bmf2,amf3,bmf3,amf4,bmf4,sflux0,snlflux0 - real(kind=kind_phys) :: mlfrac,ezfrac,sfcfracn - real(kind=kind_phys) :: uwst,uwstx,csfac - real(kind=kind_phys) :: prnumfac,bfx0,hfx0,qfx0,delb,dux,dvx, & - dsdzu,dsdzv,wm3,dthx,dqx,wspd10,ross,tem1,dsig,tvcon,conpr, & - prfac,prfac2,phim8z -! - integer, dimension(im) :: kpbl - real(kind=kind_phys), dimension(im) :: hol - real(kind=kind_phys), dimension(im) :: deltaoh - real(kind=kind_phys), dimension(im) :: rigs, & - enlfrac2, & - cslen - real(kind=kind_phys), dimension(im) :: & - rhox, & - govrth, & - zl1,thermal, & - wscale, & - hgamt,hgamq, & - brdn,brup, & - phim,phih, & - prpbl, & - wspd1, & - ust,hfx,qfx,znt, & - xland - real(kind=kind_phys), dimension(im) :: & - ust3, & - wstar3, & - wstar,delta, & - hgamu,hgamv, & - wm2, we, & - bfxpbl, & - hfxpbl,qfxpbl, & - ufxpbl,vfxpbl, & - dthvx - real(kind=kind_phys), dimension(im) :: & - brcr, & - sflux, & - zol1, & - brcr_sbro - real(kind=kind_phys), dimension(im) :: & - efxpbl, & - hpbl_cbl, & - epshol, & - ct -! - real(kind=kind_phys), dimension(im,km) :: & - xkzm,xkzh, & - f1,f2, & - r1,r2, & - ad,au, & - cu, & - al, & - xkzq, & - zfac - real(kind=kind_phys), dimension(im,km) :: & - thx,thvx, & - del, & - dza, & - dzq, & - xkzom, & - xkzoh, & - za - real(kind=kind_phys), dimension(im,km) :: & - wscalek - real(kind=kind_phys), dimension(im,km) :: & - xkzml,xkzhl, & - zfacent,entfac - real(kind=kind_phys), dimension(im,km) :: & - mf, & - zfacmf, & - entfacmf - real(kind=kind_phys), dimension(im,km) :: & - q2x, & - hgame2d, & - tflux_e, & - qflux_e, & - tvflux_e - real(kind=kind_phys), dimension( im, km+1 ) :: zq - real(kind=kind_phys), dimension( im, km, ndiff ) :: r3,f3 -! - real(kind=kind_phys), dimension( km ) :: & - uxk,vxk, & - txk,thxk,thvxk, & - q2xk, & - hgame - real(kind=kind_phys), dimension( km ) :: & - ps1d,pb1d,eps1d,pt1d, & - xkze1d,eflx_l1d,eflx_nl1d, & - ptke1 - real(kind=kind_phys), dimension( 2:km ) :: & - s2,gh,rig,el, & - akmk,akhk, & - mfk,ufxpblk,vfxpblk,qfxpblk - real(kind=kind_phys), dimension( km+1 ) :: zqk - - real(kind=kind_phys), dimension(im,km) :: dz8w2d -! - logical, dimension(im) :: pblflg, & - sfcflg, & - stable - logical, dimension( ndiff ) :: ifvmix -! -!------------------------------------------------------------------------------- -! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - its = 1 - ite = im - kts = 1 - kte = km - - klpbl = kte - lmh = 1 - lmxl = 1 -! - cont=cp/g - conq=xlv/g - conw=1./g - conwrc = conw*sqrt(rcl) - conpr = bfac*karman*sfcfrac -! change xland values - do i=its,ite - if(landmask(i).eq.0) then !ocean - xland(i) = 2 - else - xland(i) = 1 !land - end if - end do -! -! k-start index for cloud and rain -! - ifvmix(:) = .true. -! - do k = kts,kte - do i = its,ite - thx(i,k) = tx(i,k)/pi2d(i,k) - enddo - enddo -! - do k = kts,kte - do i = its,ite - tvcon = (1.+ep1*qx(i,k,1)) - thvx(i,k) = thx(i,k)*tvcon - enddo - enddo -! - do i = its,ite - tvcon = (1.+ep1*qx(i,1,1)) - rhox(i) = psfcpa(i)/(rd*tx(i,1)*tvcon) - govrth(i) = g/thx(i,1) - hfx(i) = heat(i)*rhox(i)*cp ! reset to the variable in WRF - qfx(i) = evap(i)*rhox(i) ! reset to the variable in WRF - ust(i) = sqrt(stress(i)) ! reset to the variable in WRF - znt(i) = 0.01*zorl(i) ! reset to the variable in WRF - enddo -! -!-----compute the height of full- and half-sigma levels above ground -! level, and the layer thicknesses. -! - do i = its,ite - zq(i,1) = 0. - enddo -! - do k = kts,kte - do i = its,ite - zq(i,k+1) = phii(i,k+1)*conw - za(i,k) = phil(i,k)*conw - enddo - enddo -! - do k = kts,kte - do i = its,ite - dzq(i,k) = zq(i,k+1)-zq(i,k) - del(i,k) = p2di(i,k)-p2di(i,k+1) - dz8w2d(i,k)=dzq(i,k) - enddo - enddo -! - do i = its,ite - dza(i,1) = za(i,1) - enddo -! - do k = kts+1,kte - do i = its,ite - dza(i,k) = za(i,k)-za(i,k-1) - enddo - enddo -! - do i = its,ite - wspd1(i) = sqrt(ux(i,1)*ux(i,1)+vx(i,1)*vx(i,1))+1.e-9 - enddo - -! write(0,*)"===CALLING shinhong; input:" -! print*,"t:",tx(1,1),tx(1,2),tx(1,km) -! print*,"u:",ux(1,1),ux(1,2),ux(1,km) -! print*,"v:",vx(1,1),vx(1,2),vx(1,km) -! print*,"q:",qx(1,1,1),qx(1,2,1),qx(1,km,1) -! print*,"exner:",pi2d(1,1),pi2d(1,2),pi2d(1,km) -! print*,"dz8w2d:",dz8w2d(1,1),dz8w2d(1,2),dz8w2d(1,km) -! print *,"del:",del(1,1),del(1,2),del(1,km) -! print*,"phii:",zq(1,1),zq(1,2),zq(1,km+1) -! print*,"phil:",za(1,1),za(1,2),za(1,km) -! print*,"p2d:",p2d(1,1),p2d(1,2),p2d(1,km) -! print*,"p2di:",p2di(1,1),p2di(1,2),p2di(1,km+1) -! print*,"znt,ust,wspd:",znt(1),ust(1),wspd(1) -! print*,"hfx,qfx,xland:",hfx(1),qfx(1),xland(1) -! print*,"rd,rv,g:",rd,rv,g -! print*,"ep1,ep2,xlv:",ep1,ep2,xlv -! print*,"br,psim,psih:",br(1),psim(1),psih(1) -! print*,"dx,u10,v10:",dx(1),u10(1),v10(1) -! print*,"psfcpa,cp:",psfcpa(1),cp -! print*,"ntrac,ndiff,ntcw,ntiw:",ntrac,ndiff,ntcw,ntiw -! -!---- compute vertical diffusion -! -! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -! compute preliminary variables -! - dtstep = dt - dt2 = 2.*dtstep - rdt = 1./dt2 -! - do i = its,ite - bfxpbl(i) = 0.0 - hfxpbl(i) = 0.0 - qfxpbl(i) = 0.0 - ufxpbl(i) = 0.0 - vfxpbl(i) = 0.0 - hgamu(i) = 0.0 - hgamv(i) = 0.0 - delta(i) = 0.0 - enddo -! - do i = its,ite - efxpbl(i) = 0.0 - hpbl_cbl(i) = 0.0 - epshol(i) = 0.0 - ct(i) = 0.0 - enddo -! - do i = its,ite - deltaoh(i) = 0.0 - rigs(i) = 0.0 - enlfrac2(i) = 0.0 - cslen(i) = 0.0 - enddo -! - do k = kts,klpbl - do i = its,ite - wscalek(i,k) = 0.0 - enddo - enddo -! - do k = kts,klpbl - do i = its,ite - zfac(i,k) = 0.0 - enddo - enddo -! - do k = kts,kte - do i = its,ite - q2x(i,k) = 1.e-4 - enddo - enddo -! - do k = kts,kte - do i = its,ite - hgame2d(i,k) = 0.0 - tflux_e(i,k) = 0.0 - qflux_e(i,k) = 0.0 - tvflux_e(i,k) = 0.0 - enddo - enddo -! - do k = kts,kte - do i = its,ite - mf(i,k) = 0.0 - zfacmf(i,k) = 0.0 - enddo - enddo -! - do k = kts,klpbl-1 - do i = its,ite - xkzom(i,k) = xkzminm - xkzoh(i,k) = xkzminh - enddo - enddo -! - do i = its,ite - dusfc(i) = 0. - dvsfc(i) = 0. - dtsfc(i) = 0. - dqsfc(i) = 0. - enddo -! - do i = its,ite - hgamt(i) = 0. - hgamq(i) = 0. - wscale(i) = 0. - kpbl(i) = 1 - hpbl(i) = zq(i,1) - hpbl_cbl(i) = zq(i,1) - zl1(i) = za(i,1) - thermal(i)= thvx(i,1) - pblflg(i) = .true. - sfcflg(i) = .true. - sflux(i) = hfx(i)/rhox(i)/cp + qfx(i)/rhox(i)*ep1*thx(i,1) - if(br(i).gt.0.0) sfcflg(i) = .false. - enddo -! -! compute the first guess of pbl height -! - do i = its,ite - stable(i) = .false. - brup(i) = br(i) - brcr(i) = brcr_ub - enddo -! - do k = 2,klpbl - do i = its,ite - if(.not.stable(i))then - brdn(i) = brup(i) - spdk2 = max(ux(i,k)**2+vx(i,k)**2,1.) - brup(i) = (thvx(i,k)-thermal(i))*(g*za(i,k)/thvx(i,1))/spdk2 - kpbl(i) = k - stable(i) = brup(i).gt.brcr(i) - endif - enddo - enddo -! - do i = its,ite - k = kpbl(i) - if(brdn(i).ge.brcr(i))then - brint = 0. - elseif(brup(i).le.brcr(i))then - brint = 1. - else - brint = (brcr(i)-brdn(i))/(brup(i)-brdn(i)) - endif - hpbl(i) = za(i,k-1)+brint*(za(i,k)-za(i,k-1)) - if(hpbl(i).lt.zq(i,2)) kpbl(i) = 1 - if(kpbl(i).le.1) pblflg(i) = .false. - enddo -! - do i = its,ite - fm = psim(i) - fh = psih(i) - zol1(i) = max(br(i)*fm*fm/fh,rimin) - if(sfcflg(i))then - zol1(i) = min(zol1(i),-zfmin) - else - zol1(i) = max(zol1(i),zfmin) - endif - hol1 = zol1(i)*hpbl(i)/zl1(i)*sfcfrac - epshol(i) = hol1 - if(sfcflg(i))then - phim(i) = (1.-aphi16*hol1)**(-1./4.) - phih(i) = (1.-aphi16*hol1)**(-1./2.) - bfx0 = max(sflux(i),0.) - hfx0 = max(hfx(i)/rhox(i)/cp,0.) - qfx0 = max(ep1*thx(i,1)*qfx(i)/rhox(i),0.) - wstar3(i) = (govrth(i)*bfx0*hpbl(i)) - wstar(i) = (wstar3(i))**h1 - else - phim(i) = (1.+aphi5*hol1) - phih(i) = phim(i) - wstar(i) = 0. - wstar3(i) = 0. - endif - ust3(i) = ust(i)**3. - wscale(i) = (ust3(i)+phifac*karman*wstar3(i)*0.5)**h1 - wscale(i) = min(wscale(i),ust(i)*aphi16) - wscale(i) = max(wscale(i),ust(i)/aphi5) - enddo -! -! compute the surface variables for pbl height estimation -! under unstable conditions -! - do i = its,ite - if(sfcflg(i).and.sflux(i).gt.0.0)then - gamfac = bfac/rhox(i)/wscale(i) - hgamt(i) = min(gamfac*hfx(i)/cp,gamcrt) - hgamq(i) = min(gamfac*qfx(i),gamcrq) - vpert = (hgamt(i)+ep1*thx(i,1)*hgamq(i))/bfac*afac - thermal(i) = thermal(i)+max(vpert,0.)*min(za(i,1)/(sfcfrac*hpbl(i)),1.0) - hgamt(i) = max(hgamt(i),0.0) - hgamq(i) = max(hgamq(i),0.0) - brint = -15.9*ust(i)*ust(i)/wspd(i)*wstar3(i)/(wscale(i)**4.) - hgamu(i) = brint*ux(i,1) - hgamv(i) = brint*vx(i,1) - else - pblflg(i) = .false. - endif - enddo -! -! enhance the pbl height by considering the thermal -! - do i = its,ite - if(pblflg(i))then - kpbl(i) = 1 - hpbl(i) = zq(i,1) - endif - enddo -! - do i = its,ite - if(pblflg(i))then - stable(i) = .false. - brup(i) = br(i) - brcr(i) = brcr_ub - endif - enddo -! - do k = 2,klpbl - do i = its,ite - if(.not.stable(i).and.pblflg(i))then - brdn(i) = brup(i) - spdk2 = max(ux(i,k)**2+vx(i,k)**2,1.) - brup(i) = (thvx(i,k)-thermal(i))*(g*za(i,k)/thvx(i,1))/spdk2 - kpbl(i) = k - stable(i) = brup(i).gt.brcr(i) - endif - enddo - enddo -! - do i = its,ite - if(pblflg(i)) then - k = kpbl(i) - if(brdn(i).ge.brcr(i))then - brint = 0. - elseif(brup(i).le.brcr(i))then - brint = 1. - else - brint = (brcr(i)-brdn(i))/(brup(i)-brdn(i)) - endif - hpbl(i) = za(i,k-1)+brint*(za(i,k)-za(i,k-1)) - if(hpbl(i).lt.zq(i,2)) kpbl(i) = 1 - if(kpbl(i).le.1) pblflg(i) = .false. - uwst = abs(ust(i)/wstar(i)-0.5) - uwstx = -80.*uwst+14. - csfac = 0.5*(tanh(uwstx)+3.) - cslen(i) = csfac*hpbl(i) - endif - enddo -! -! stable boundary layer -! - do i = its,ite - hpbl_cbl(i) = hpbl(i) - if((.not.sfcflg(i)).and.hpbl(i).lt.zq(i,2)) then - brup(i) = br(i) - stable(i) = .false. - else - stable(i) = .true. - endif - enddo -! - do i = its,ite - if((.not.stable(i)).and.((xland(i)-1.5).ge.0))then - wspd10 = u10(i)*u10(i) + v10(i)*v10(i) - wspd10 = sqrt(wspd10) - ross = wspd10 / (cori*znt(i)) - brcr_sbro(i) = min(0.16*(1.e-7*ross)**(-0.18),.3) - endif - enddo -! - do i = its,ite - if(.not.stable(i))then - if((xland(i)-1.5).ge.0)then - brcr(i) = brcr_sbro(i) - else - brcr(i) = brcr_sb - endif - endif - enddo -! - do k = 2,klpbl - do i = its,ite - if(.not.stable(i))then - brdn(i) = brup(i) - spdk2 = max(ux(i,k)**2+vx(i,k)**2,1.) - brup(i) = (thvx(i,k)-thermal(i))*(g*za(i,k)/thvx(i,1))/spdk2 - kpbl(i) = k - stable(i) = brup(i).gt.brcr(i) - endif - enddo - enddo -! - do i = its,ite - if((.not.sfcflg(i)).and.hpbl(i).lt.zq(i,2)) then - k = kpbl(i) - if(brdn(i).ge.brcr(i))then - brint = 0. - elseif(brup(i).le.brcr(i))then - brint = 1. - else - brint = (brcr(i)-brdn(i))/(brup(i)-brdn(i)) - endif - hpbl(i) = za(i,k-1)+brint*(za(i,k)-za(i,k-1)) - if(hpbl(i).lt.zq(i,2)) kpbl(i) = 1 - if(kpbl(i).le.1) pblflg(i) = .false. - endif - enddo -! -! scale dependency for nonlocal momentum and moisture transport -! - do i = its,ite - pu1=pu(dx(i),cslen(i)) - pq1=pq(dx(i),cslen(i)) - if(pblflg(i)) then - hgamu(i) = hgamu(i)*pu1 - hgamv(i) = hgamv(i)*pu1 - hgamq(i) = hgamq(i)*pq1 - endif - enddo -! -! estimate the entrainment parameters -! - do i = its,ite - if(pblflg(i)) then - k = kpbl(i) - 1 - prpbl(i) = 1.0 - wm3 = wstar3(i) + 5. * ust3(i) - wm2(i) = wm3**h2 - bfxpbl(i) = -0.15*thvx(i,1)/g*wm3/hpbl(i) - dthvx(i) = max(thvx(i,k+1)-thvx(i,k),tmin) - dthx = max(thx(i,k+1)-thx(i,k),tmin) - dqx = min(qx(i,k+1,1)-qx(i,k,1),0.0) - we(i) = max(bfxpbl(i)/dthvx(i),-sqrt(wm2(i))) - hfxpbl(i) = we(i)*dthx - pq1=pq(dx(i),cslen(i)) - qfxpbl(i) = we(i)*dqx*pq1 -! - pu1=pu(dx(i),cslen(i)) - dux = ux(i,k+1)-ux(i,k) - dvx = vx(i,k+1)-vx(i,k) - if(dux.gt.tmin) then - ufxpbl(i) = max(prpbl(i)*we(i)*dux*pu1,-ust(i)*ust(i)) - elseif(dux.lt.-tmin) then - ufxpbl(i) = min(prpbl(i)*we(i)*dux*pu1,ust(i)*ust(i)) - else - ufxpbl(i) = 0.0 - endif - if(dvx.gt.tmin) then - vfxpbl(i) = max(prpbl(i)*we(i)*dvx*pu1,-ust(i)*ust(i)) - elseif(dvx.lt.-tmin) then - vfxpbl(i) = min(prpbl(i)*we(i)*dvx*pu1,ust(i)*ust(i)) - else - vfxpbl(i) = 0.0 - endif - delb = govrth(i)*d3*hpbl(i) - delta(i) = min(d1*hpbl(i) + d2*wm2(i)/delb,100.) - delb = govrth(i)*dthvx(i) - deltaoh(i) = d1*hpbl(i) + d2*wm2(i)/delb - deltaoh(i) = max(ezfac*deltaoh(i),hpbl(i)-za(i,kpbl(i)-1)-1.) - deltaoh(i) = min(deltaoh(i) ,hpbl(i)) - rigs(i) = govrth(i)*dthvx(i)*deltaoh(i)/(dux**2.+dvx**2.) - rigs(i) = max(min(rigs(i), rigsmax),rimin) - enlfrac2(i) = max(min(wm3/wstar3(i)/(1.+cpent/rigs(i)),entfmax), entfmin) - enlfrac2(i) = enlfrac2(i)*enlfrac - endif - enddo -! - do k = kts,klpbl - do i = its,ite - if(pblflg(i))then - entfacmf(i,k) = sqrt(((zq(i,k+1)-hpbl(i))/deltaoh(i))**2.) - endif - if(pblflg(i).and.k.ge.kpbl(i))then - entfac(i,k) = ((zq(i,k+1)-hpbl(i))/deltaoh(i))**2. - else - entfac(i,k) = 1.e30 - endif - enddo - enddo -! -! compute diffusion coefficients below pbl -! - do k = kts,klpbl - do i = its,ite - if(k.lt.kpbl(i)) then - zfac(i,k) = min(max((1.-(zq(i,k+1)-zl1(i))/(hpbl(i)-zl1(i))),zfmin),1.) - zfacent(i,k) = (1.-zfac(i,k))**3. - wscalek(i,k) = (ust3(i)+phifac*karman*wstar3(i)*(1.-zfac(i,k)))**h1 - if(sfcflg(i)) then - prfac = conpr - prfac2 = 15.9*wstar3(i)/ust3(i)/(1.+4.*karman*wstar3(i)/ust3(i)) - prnumfac = -3.*(max(zq(i,k+1)-sfcfrac*hpbl(i),0.))**2./hpbl(i)**2. - else - prfac = 0. - prfac2 = 0. - prnumfac = 0. - phim8z = 1.+aphi5*zol1(i)*zq(i,k+1)/zl1(i) - wscalek(i,k) = ust(i)/phim8z - wscalek(i,k) = max(wscalek(i,k),0.001) - endif - prnum0 = (phih(i)/phim(i)+prfac) - prnum0 = max(min(prnum0,prmax),prmin) - xkzm(i,k) = wscalek(i,k)*karman*zq(i,k+1)*zfac(i,k)**pfac - prnum = 1. + (prnum0-1.)*exp(prnumfac) - xkzq(i,k) = xkzm(i,k)/prnum*zfac(i,k)**(pfac_q-pfac) - prnum0 = prnum0/(1.+prfac2*karman*sfcfrac) - prnum = 1. + (prnum0-1.)*exp(prnumfac) - xkzh(i,k) = xkzm(i,k)/prnum - xkzm(i,k) = xkzm(i,k)+xkzom(i,k) - xkzh(i,k) = xkzh(i,k)+xkzoh(i,k) - xkzq(i,k) = xkzq(i,k)+xkzoh(i,k) - xkzm(i,k) = min(xkzm(i,k),xkzmax) - xkzh(i,k) = min(xkzh(i,k),xkzmax) - xkzq(i,k) = min(xkzq(i,k),xkzmax) - endif - enddo - enddo -! -! compute diffusion coefficients over pbl (free atmosphere) -! - do k = kts,kte-1 - do i = its,ite - if(k.ge.kpbl(i)) then - ss = ((ux(i,k+1)-ux(i,k))*(ux(i,k+1)-ux(i,k)) & - +(vx(i,k+1)-vx(i,k))*(vx(i,k+1)-vx(i,k))) & - /(dza(i,k+1)*dza(i,k+1))+1.e-9 - govrthv = g/(0.5*(thvx(i,k+1)+thvx(i,k))) - ri = govrthv*(thvx(i,k+1)-thvx(i,k))/(ss*dza(i,k+1)) -! in cloud - if(imvdif.eq.1.and.ntcw.ge.2.and.ntiw.ge.2)then - if((qx(i,k,ntcw)+qx(i,k,ntiw)).gt.0.01e-3 & - .and.(qx(i,k+1,ntcw)+qx(i,k+1,ntiw)).gt.0.01e-3) then - qmean = 0.5*(qx(i,k,1)+qx(i,k+1,1)) - tmean = 0.5*(tx(i,k)+tx(i,k+1)) - alpha = xlv*qmean/rd/tmean - chi = xlv*xlv*qmean/cp/rv/tmean/tmean - ri = (1.+alpha)*(ri-g*g/ss/tmean/cp*((chi-alpha)/(1.+chi))) - endif - endif - zk = karman*zq(i,k+1) - rlamdz = min(max(0.1*dza(i,k+1),rlam),300.) - rlamdz = min(dza(i,k+1),rlamdz) - rl2 = (zk*rlamdz/(rlamdz+zk))**2 - dk = rl2*sqrt(ss) - if(ri.lt.0.)then -! unstable regime - ri = max(ri, rimin) - sri = sqrt(-ri) - xkzm(i,k) = dk*(1+8.*(-ri)/(1+1.746*sri)) - xkzh(i,k) = dk*(1+8.*(-ri)/(1+1.286*sri)) - else -! stable regime - xkzh(i,k) = dk/(1+5.*ri)**2 - prnum = 1.0+2.1*ri - prnum = min(prnum,prmax) - xkzm(i,k) = xkzh(i,k)*prnum - endif -! - xkzm(i,k) = xkzm(i,k)+xkzom(i,k) - xkzh(i,k) = xkzh(i,k)+xkzoh(i,k) - xkzm(i,k) = min(xkzm(i,k),xkzmax) - xkzh(i,k) = min(xkzh(i,k),xkzmax) - xkzml(i,k) = xkzm(i,k) - xkzhl(i,k) = xkzh(i,k) - endif - enddo - enddo -! -! prescribe nonlocal heat transport below pbl -! - do i = its,ite - deltaoh(i) = deltaoh(i)/hpbl(i) - enddo -! - do i = its,ite - mlfrac = mltop-deltaoh(i) - ezfrac = mltop+deltaoh(i) - zfacmf(i,1) = min(max((zq(i,2)/hpbl(i)),zfmin),1.) - sfcfracn = max(sfcfracn1,zfacmf(i,1)) -! - sflux0 = (a11+a12*sfcfracn)*sflux(i) - snlflux0 = nlfrac*sflux0 - amf1 = snlflux0/sfcfracn - amf2 = -snlflux0/(mlfrac-sfcfracn) - bmf2 = -mlfrac*amf2 - amf3 = snlflux0*enlfrac2(i)/deltaoh(i) - bmf3 = -amf3*mlfrac - hfxpbl(i) = amf3+bmf3 - pth1=pthnl(dx(i),cslen(i)) - hfxpbl(i) = hfxpbl(i)*pth1 -! - do k = kts,klpbl - zfacmf(i,k) = max((zq(i,k+1)/hpbl(i)),zfmin) - if(pblflg(i).and.k.lt.kpbl(i)) then - if(zfacmf(i,k).le.sfcfracn) then - mf(i,k) = amf1*zfacmf(i,k) - else if (zfacmf(i,k).le.mlfrac) then - mf(i,k) = amf2*zfacmf(i,k)+bmf2 - endif - mf(i,k) = mf(i,k)+hfxpbl(i)*exp(-entfacmf(i,k)) - mf(i,k) = mf(i,k)*pth1 - endif - enddo - enddo -! -! compute tridiagonal matrix elements for heat -! - do k = kts,kte - do i = its,ite - au(i,k) = 0. - al(i,k) = 0. - ad(i,k) = 0. - f1(i,k) = 0. - enddo - enddo -! - do i = its,ite - ad(i,1) = 1. - f1(i,1) = thx(i,1)-300.+hfx(i)/cont/del(i,1)*dt2 - enddo -! - do k = kts,kte-1 - do i = its,ite - dtodsd = dt2/del(i,k) - dtodsu = dt2/del(i,k+1) - dsig = p2d(i,k)-p2d(i,k+1) - rdz = 1./dza(i,k+1) - tem1 = dsig*xkzh(i,k)*rdz - if(pblflg(i).and.k.lt.kpbl(i)) then - dsdzt = tem1*(-mf(i,k)/xkzh(i,k)) - f1(i,k) = f1(i,k)+dtodsd*dsdzt - f1(i,k+1) = thx(i,k+1)-300.-dtodsu*dsdzt - elseif(pblflg(i).and.k.ge.kpbl(i).and.entfac(i,k).lt.4.6) then - xkzh(i,k) = -we(i)*dza(i,kpbl(i))*exp(-entfac(i,k)) - xkzh(i,k) = sqrt(xkzh(i,k)*xkzhl(i,k)) - xkzh(i,k) = max(xkzh(i,k),xkzoh(i,k)) - xkzh(i,k) = min(xkzh(i,k),xkzmax) - f1(i,k+1) = thx(i,k+1)-300. - else - f1(i,k+1) = thx(i,k+1)-300. - endif - tem1 = dsig*xkzh(i,k)*rdz - dsdz2 = tem1*rdz - au(i,k) = -dtodsd*dsdz2 - al(i,k) = -dtodsu*dsdz2 -! -! scale dependency for local heat transport -! - zfacdx=0.2*hpbl(i)/zq(i,k+1) - delxy=dx(i)*max(zfacdx,1.0) - pth1=pthl(delxy,hpbl(i)) - if(pblflg(i).and.k.lt.kpbl(i)) then - au(i,k) = au(i,k)*pth1 - al(i,k) = al(i,k)*pth1 - endif - ad(i,k) = ad(i,k)-au(i,k) - ad(i,k+1) = 1.-al(i,k) - enddo - enddo -! -! copies here to avoid duplicate input args for tridin -! - do k = kts,kte - do i = its,ite - cu(i,k) = au(i,k) - r1(i,k) = f1(i,k) - enddo - enddo -! - call tridin_ysu(al,ad,cu,r1,au,f1,its,ite,kts,kte,1) -! -! recover tendencies of heat -! - do k = kte,kts,-1 - do i = its,ite - ttend = (f1(i,k)-thx(i,k)+300.)*rdt*pi2d(i,k) - ttnp(i,k) = ttnp(i,k)+ttend - dtsfc(i) = dtsfc(i)+ttend*cont*del(i,k) - if(k.eq.kte) then - tflux_e(i,k) = ttend*dz8w2d(i,k) - else - tflux_e(i,k) = tflux_e(i,k+1) + ttend*dz8w2d(i,k) - endif - enddo - enddo -! -! compute tridiagonal matrix elements for moisture, clouds, and gases -! - do k = kts,kte - do i = its,ite - au(i,k) = 0. - al(i,k) = 0. - ad(i,k) = 0. - enddo - enddo -! - do ic = 1,ndiff - do i = its,ite - do k = kts,kte - f3(i,k,ic) = 0. - enddo - enddo - enddo -! - do i = its,ite - ad(i,1) = 1. - f3(i,1,1) = qx(i,1,1)+qfx(i)*g/del(i,1)*dt2 - enddo -! - if(ndiff.ge.2) then - do ic = 2,ndiff - do i = its,ite - f3(i,1,ic) = qx(i,1,ic) - enddo - enddo - endif -! - do k = kts,kte-1 - do i = its,ite - if(k.ge.kpbl(i)) then - xkzq(i,k) = xkzh(i,k) - endif - enddo - enddo -! - do k = kts,kte-1 - do i = its,ite - dtodsd = dt2/del(i,k) - dtodsu = dt2/del(i,k+1) - dsig = p2d(i,k)-p2d(i,k+1) - rdz = 1./dza(i,k+1) - tem1 = dsig*xkzq(i,k)*rdz - if(pblflg(i).and.k.lt.kpbl(i)) then - dsdzq = tem1*(-qfxpbl(i)*zfacent(i,k)/xkzq(i,k)) - f3(i,k,1) = f3(i,k,1)+dtodsd*dsdzq - f3(i,k+1,1) = qx(i,k+1,1)-dtodsu*dsdzq - elseif(pblflg(i).and.k.ge.kpbl(i).and.entfac(i,k).lt.4.6) then - xkzq(i,k) = -we(i)*dza(i,kpbl(i))*exp(-entfac(i,k)) - xkzq(i,k) = sqrt(xkzq(i,k)*xkzhl(i,k)) - xkzq(i,k) = max(xkzq(i,k),xkzoh(i,k)) - xkzq(i,k) = min(xkzq(i,k),xkzmax) - f3(i,k+1,1) = qx(i,k+1,1) - else - f3(i,k+1,1) = qx(i,k+1,1) - endif - tem1 = dsig*xkzq(i,k)*rdz - dsdz2 = tem1*rdz - au(i,k) = -dtodsd*dsdz2 - al(i,k) = -dtodsu*dsdz2 -! -! scale dependency for local moisture transport -! - zfacdx=0.2*hpbl(i)/zq(i,k+1) - delxy=dx(i)*max(zfacdx,1.0) - pq1=pq(delxy,hpbl(i)) - if(pblflg(i).and.k.lt.kpbl(i)) then - au(i,k) = au(i,k)*pq1 - al(i,k) = al(i,k)*pq1 - endif - ad(i,k) = ad(i,k)-au(i,k) - ad(i,k+1) = 1.-al(i,k) - enddo - enddo -! - if(ndiff.ge.2) then - do ic = 2,ndiff - do k = kts,kte-1 - do i = its,ite - f3(i,k+1,ic) = qx(i,k+1,ic) - enddo - enddo - enddo - endif -! -! copies here to avoid duplicate input args for tridin -! - do k = kts,kte - do i = its,ite - cu(i,k) = au(i,k) - enddo - enddo -! - do ic = 1,ndiff - do k = kts,kte - do i = its,ite - r3(i,k,ic) = f3(i,k,ic) - enddo - enddo - enddo -! -! solve tridiagonal problem for moisture, clouds, and gases -! - call tridin_ysu(al,ad,cu,r3,au,f3,its,ite,kts,kte,ndiff) -! -! recover tendencies of heat and moisture -! - do k = kte,kts,-1 - do i = its,ite - qtend = (f3(i,k,1)-qx(i,k,1))*rdt - qtnp(i,k,1) = qtnp(i,k,1)+qtend - dqsfc(i) = dqsfc(i)+qtend*conq*del(i,k) - if(k.eq.kte) then - qflux_e(i,k) = qtend*dz8w2d(i,k) - else - qflux_e(i,k) = qflux_e(i,k+1) + qtend*dz8w2d(i,k) - endif - tvflux_e(i,k) = tflux_e(i,k) + qflux_e(i,k)*ep1*thx(i,k) - enddo - enddo -! print*,"qtnp:",maxval(qtnp(:,:,1)),minval(qtnp(:,:,1)) -! - do k = kts,kte - do i = its,ite - if(pblflg(i).and.k.lt.kpbl(i)) then - hgame_c=c_1*0.2*2.5*(g/thvx(i,k))*wstar(i)/(0.25*(q2x(i,k+1)+q2x(i,k))) - hgame_c=min(hgame_c,gamcre) - if(k.eq.kte)then - hgame2d(i,k)=hgame_c*0.5*tvflux_e(i,k)*hpbl(i) - hgame2d(i,k)=max(hgame2d(i,k),0.0) - else - hgame2d(i,k)=hgame_c*0.5*(tvflux_e(i,k)+tvflux_e(i,k+1))*hpbl(i) - hgame2d(i,k)=max(hgame2d(i,k),0.0) - endif - endif - enddo - enddo -! - if(ndiff.ge.2) then - do ic = 2,ndiff - if(ifvmix(ic)) then - do k = kte,kts,-1 - do i = its,ite - qtend = (f3(i,k,ic)-qx(i,k,ic))*rdt - qtnp(i,k,ic) = qtnp(i,k,ic)+qtend - enddo - enddo - endif - enddo - endif -! -! compute tridiagonal matrix elements for momentum -! - do i = its,ite - do k = kts,kte - au(i,k) = 0. - al(i,k) = 0. - ad(i,k) = 0. - f1(i,k) = 0. - f2(i,k) = 0. - enddo - enddo -! - do i = its,ite - ad(i,1) = 1.+ust(i)**2/wspd1(i)*rhox(i)*g/del(i,1)*dt2 & - *(wspd1(i)/wspd(i))**2 - f1(i,1) = ux(i,1) - f2(i,1) = vx(i,1) - enddo -! - do k = kts,kte-1 - do i = its,ite - dtodsd = dt2/del(i,k) - dtodsu = dt2/del(i,k+1) - dsig = p2d(i,k)-p2d(i,k+1) - rdz = 1./dza(i,k+1) - tem1 = dsig*xkzm(i,k)*rdz - if(pblflg(i).and.k.lt.kpbl(i))then - dsdzu = tem1*(-hgamu(i)/hpbl(i)-ufxpbl(i)*zfacent(i,k)/xkzm(i,k)) - dsdzv = tem1*(-hgamv(i)/hpbl(i)-vfxpbl(i)*zfacent(i,k)/xkzm(i,k)) - f1(i,k) = f1(i,k)+dtodsd*dsdzu - f1(i,k+1) = ux(i,k+1)-dtodsu*dsdzu - f2(i,k) = f2(i,k)+dtodsd*dsdzv - f2(i,k+1) = vx(i,k+1)-dtodsu*dsdzv - elseif(pblflg(i).and.k.ge.kpbl(i).and.entfac(i,k).lt.4.6) then - xkzm(i,k) = prpbl(i)*xkzh(i,k) - xkzm(i,k) = sqrt(xkzm(i,k)*xkzml(i,k)) - xkzm(i,k) = max(xkzm(i,k),xkzom(i,k)) - xkzm(i,k) = min(xkzm(i,k),xkzmax) - f1(i,k+1) = ux(i,k+1) - f2(i,k+1) = vx(i,k+1) - else - f1(i,k+1) = ux(i,k+1) - f2(i,k+1) = vx(i,k+1) - endif - tem1 = dsig*xkzm(i,k)*rdz - dsdz2 = tem1*rdz - au(i,k) = -dtodsd*dsdz2 - al(i,k) = -dtodsu*dsdz2 -! -! scale dependency for local momentum transport -! - zfacdx=0.2*hpbl(i)/zq(i,k+1) - delxy=dx(i)*max(zfacdx,1.0) - pu1=pu(delxy,hpbl(i)) - if(pblflg(i).and.k.lt.kpbl(i)) then - au(i,k) = au(i,k)*pu1 - al(i,k) = al(i,k)*pu1 - endif - ad(i,k) = ad(i,k)-au(i,k) - ad(i,k+1) = 1.-al(i,k) - enddo - enddo -! -! copies here to avoid duplicate input args for tridin -! - do k = kts,kte - do i = its,ite - cu(i,k) = au(i,k) - r1(i,k) = f1(i,k) - r2(i,k) = f2(i,k) - enddo - enddo -! -! solve tridiagonal problem for momentum -! - call tridi1n(al,ad,cu,r1,r2,au,f1,f2,its,ite,kts,kte,1) -! -! recover tendencies of momentum -! - do k = kte,kts,-1 - do i = its,ite - utend = (f1(i,k)-ux(i,k))*rdt - vtend = (f2(i,k)-vx(i,k))*rdt - utnp(i,k) = utnp(i,k)+utend - vtnp(i,k) = vtnp(i,k)+vtend - dusfc(i) = dusfc(i) + utend*conwrc*del(i,k) - dvsfc(i) = dvsfc(i) + vtend*conwrc*del(i,k) - enddo - enddo -! - do i = its,ite - kpbl1d(i) = kpbl(i) - enddo -! -!---- calculate sgs tke which is consistent with shinhongpbl algorithm -! - if (shinhong_tke_diag.eq.1) then -! - tke_calculation: do i = its,ite - do k = kts+1,kte - s2(k) = 0.0 - gh(k) = 0.0 - rig(k) = 0.0 - el(k) = 0.0 - akmk(k) = 0.0 - akhk(k) = 0.0 - mfk(k) = 0.0 - ufxpblk(k) = 0.0 - vfxpblk(k) = 0.0 - qfxpblk(k) = 0.0 - enddo -! - do k = kts,kte - uxk(k) = 0.0 - vxk(k) = 0.0 - txk(k) = 0.0 - thxk(k) = 0.0 - thvxk(k) = 0.0 - q2xk(k) = 0.0 - hgame(k) = 0.0 - ps1d(k) = 0.0 - pb1d(k) = 0.0 - eps1d(k) = 0.0 - pt1d(k) = 0.0 - xkze1d(k) = 0.0 - eflx_l1d(k) = 0.0 - eflx_nl1d(k) = 0.0 - ptke1(k) = 1.0 - enddo -! - do k = kts,kte+1 - zqk(k) = 0.0 - enddo -! - do k = kts,kte - uxk(k) = ux(i,k) - vxk(k) = vx(i,k) - txk(k) = tx(i,k) - thxk(k) = thx(i,k) - thvxk(k) = thvx(i,k) - q2xk(k) = q2x(i,k) - hgame(k) = hgame2d(i,k) - enddo -! - do k = kts,kte-1 - if(pblflg(i).and.k.le.kpbl(i)) then - zfacdx = 0.2*hpbl(i)/za(i,k) - delxy = dx(i)*max(zfacdx,1.0) - ptke1(k+1) = ptke(delxy,hpbl(i)) - endif - enddo -! - do k = kts,kte+1 - zqk(k) = zq(i,k) - enddo -! - do k = kts+1,kte - akmk(k) = xkzm(i,k-1) - akhk(k) = xkzh(i,k-1) - mfk(k) = mf(i,k-1)/xkzh(i,k-1) - ufxpblk(k) = ufxpbl(i)*zfacent(i,k-1)/xkzm(i,k-1) - vfxpblk(k) = vfxpbl(i)*zfacent(i,k-1)/xkzm(i,k-1) - qfxpblk(k) = qfxpbl(i)*zfacent(i,k-1)/xkzq(i,k-1) - enddo -! - if(pblflg(i)) then - k = kpbl(i) - 1 - dex = 0.25*(q2xk(k+2)-q2xk(k)) - efxpbl(i) = we(i)*dex - endif -! -!---- find the mixing length -! - call mixlen(lmh,uxk,vxk,txk,thxk,qx(i,kts,1),qx(i,kts,ntcw) & - ,q2xk,zqk,ust(i),corf,epshol(i) & - ,s2,gh,rig,el & - ,hpbl(i),kpbl(i),lmxl,ct(i) & - ,hgamu(i),hgamv(i),hgamq(i),pblflg(i) & - ,mfk,ufxpblk,vfxpblk,qfxpblk & - ,ep1,karman,cp & - ,kts,kte ) -! -!---- solve for the production/dissipation of the turbulent kinetic energy -! - call prodq2(lmh,dt,ust(i),s2,rig,q2xk,el,zqk,akmk,akhk & - ,uxk,vxk,thxk,thvxk & - ,hgamu(i),hgamv(i),hgamq(i),dx(i) & - ,hpbl(i),pblflg(i),kpbl(i) & - ,mfk,ufxpblk,vfxpblk,qfxpblk & - ,ep1 & - ,kts,kte ) -! -! -!---- carry out the vertical diffusion of turbulent kinetic energy -! - call vdifq(lmh,dt,q2xk,el,zqk & - ,akhk,ptke1 & - ,hgame,hpbl(i),pblflg(i),kpbl(i) & - ,efxpbl(i) & - ,kts,kte ) -! -!---- save the new tke and mixing length. -! - do k = kts,kte - q2x(i,k) = amax1(q2xk(k),epsq2l) - enddo -! - enddo tke_calculation - endif -! -!---- end of tke calculation -! -! -!---- end of vertical diffusion -! - end subroutine shinhongvdif_run -!------------------------------------------------------------------------------- -! -!------------------------------------------------------------------------------- - subroutine tridi1n(cl,cm,cu,r1,r2,au,f1,f2,its,ite,kts,kte,nt) -!------------------------------------------------------------------------------- - use machine , only : kind_phys - implicit none -!------------------------------------------------------------------------------- -! - integer, intent(in ) :: its,ite, kts,kte, nt -! - real(kind=kind_phys), dimension( its:ite, kts+1:kte+1 ) , & - intent(in ) :: cl -! - real(kind=kind_phys), dimension( its:ite, kts:kte ) , & - intent(in ) :: cm, & - r1 - real(kind=kind_phys), dimension( its:ite, kts:kte,nt ) , & - intent(in ) :: r2 -! - real(kind=kind_phys), dimension( its:ite, kts:kte ) , & - intent(inout) :: au, & - cu, & - f1 - real(kind=kind_phys), dimension( its:ite, kts:kte,nt ) , & - intent(inout) :: f2 -! - real(kind=kind_phys) :: fk - integer :: i,k,l,n,it -! -!------------------------------------------------------------------------------- -! - l = ite - n = kte -! - do i = its,l - fk = 1./cm(i,1) - au(i,1) = fk*cu(i,1) - f1(i,1) = fk*r1(i,1) - enddo -! - do it = 1,nt - do i = its,l - fk = 1./cm(i,1) - f2(i,1,it) = fk*r2(i,1,it) - enddo - enddo -! - do k = kts+1,n-1 - do i = its,l - fk = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) - au(i,k) = fk*cu(i,k) - f1(i,k) = fk*(r1(i,k)-cl(i,k)*f1(i,k-1)) - enddo - enddo -! - do it = 1,nt - do k = kts+1,n-1 - do i = its,l - fk = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) - f2(i,k,it) = fk*(r2(i,k,it)-cl(i,k)*f2(i,k-1,it)) - enddo - enddo - enddo -! - do i = its,l - fk = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) - f1(i,n) = fk*(r1(i,n)-cl(i,n)*f1(i,n-1)) - enddo -! - do it = 1,nt - do i = its,l - fk = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) - f2(i,n,it) = fk*(r2(i,n,it)-cl(i,n)*f2(i,n-1,it)) - enddo - enddo -! - do k = n-1,kts,-1 - do i = its,l - f1(i,k) = f1(i,k)-au(i,k)*f1(i,k+1) - enddo - enddo -! - do it = 1,nt - do k = n-1,kts,-1 - do i = its,l - f2(i,k,it) = f2(i,k,it)-au(i,k)*f2(i,k+1,it) - enddo - enddo - enddo -! - end subroutine tridi1n -!------------------------------------------------------------------------------- -! -!------------------------------------------------------------------------------- - subroutine tridin_ysu(cl,cm,cu,r2,au,f2,its,ite,kts,kte,nt) -!------------------------------------------------------------------------------- - use machine , only : kind_phys - implicit none -!------------------------------------------------------------------------------- -! - integer, intent(in ) :: its,ite, kts,kte, nt -! - real(kind=kind_phys), dimension( its:ite, kts+1:kte+1 ) , & - intent(in ) :: cl -! - real(kind=kind_phys), dimension( its:ite, kts:kte ) , & - intent(in ) :: cm - real(kind=kind_phys), dimension( its:ite, kts:kte,nt ) , & - intent(in ) :: r2 -! - real(kind=kind_phys), dimension( its:ite, kts:kte ) , & - intent(inout) :: au, & - cu - real(kind=kind_phys), dimension( its:ite, kts:kte,nt ) , & - intent(inout) :: f2 -! - real(kind=kind_phys) :: fk - integer :: i,k,l,n,it -! -!------------------------------------------------------------------------------- -! - l = ite - n = kte -! - do it = 1,nt - do i = its,l - fk = 1./cm(i,1) - au(i,1) = fk*cu(i,1) - f2(i,1,it) = fk*r2(i,1,it) - enddo - enddo -! - do it = 1,nt - do k = kts+1,n-1 - do i = its,l - fk = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) - au(i,k) = fk*cu(i,k) - f2(i,k,it) = fk*(r2(i,k,it)-cl(i,k)*f2(i,k-1,it)) - enddo - enddo - enddo -! - do it = 1,nt - do i = its,l - fk = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) - f2(i,n,it) = fk*(r2(i,n,it)-cl(i,n)*f2(i,n-1,it)) - enddo - enddo -! - do it = 1,nt - do k = n-1,kts,-1 - do i = its,l - f2(i,k,it) = f2(i,k,it)-au(i,k)*f2(i,k+1,it) - enddo - enddo - enddo -! - end subroutine tridin_ysu -!------------------------------------------------------------------------------- -! -!------------------------------------------------------------------------------- - subroutine mixlen(lmh,u,v,t,the,q,cwm,q2,z,ustar,corf,epshol, & - s2,gh,ri,el,hpbl,lpbl,lmxl,ct, & - hgamu,hgamv,hgamq,pblflg, & - mf,ufxpbl,vfxpbl,qfxpbl, & - p608,vkarman,cp, & - kts,kte) -!------------------------------------------------------------------------------- - use machine , only : kind_phys - implicit none -!------------------------------------------------------------------------------- -! qnse model constants -!------------------------------------------------------------------------------- - real(kind=kind_phys),parameter :: blckdr=0.0063,cn=0.75 - real(kind=kind_phys),parameter :: eps1=1.e-12,epsl=0.32,epsru=1.e-7,epsrs=1.e-7 - real(kind=kind_phys),parameter :: el0max=1000.,el0min=1.,elfc=0.23*0.5 - real(kind=kind_phys),parameter :: alph=0.30,beta=1./273.,g=9.81,btg=beta*g - real(kind=kind_phys),parameter :: a1=0.659888514560862645,a2x=0.6574209922667784586 - real(kind=kind_phys),parameter :: b1=11.87799326209552761,b2=7.226971804046074028 - real(kind=kind_phys),parameter :: c1=0.000830955950095854396 - real(kind=kind_phys),parameter :: adnh= 9.*a1*a2x*a2x*(12.*a1+3.*b2)*btg*btg - real(kind=kind_phys),parameter :: adnm=18.*a1*a1*a2x*(b2-3.*a2x)*btg - real(kind=kind_phys),parameter :: bdnh= 3.*a2x*(7.*a1+b2)*btg,bdnm= 6.*a1*a1 -!------------------------------------------------------------------------------- -! free term in the equilibrium equation for (l/q)**2 -!------------------------------------------------------------------------------- - real(kind=kind_phys),parameter :: aeqh=9.*a1*a2x*a2x*b1*btg*btg & - +9.*a1*a2x*a2x*(12.*a1+3.*b2)*btg*btg - real(kind=kind_phys),parameter :: aeqm=3.*a1*a2x*b1*(3.*a2x+3.*b2*c1+18.*a1*c1-b2) & - *btg+18.*a1*a1*a2x*(b2-3.*a2x)*btg -!------------------------------------------------------------------------------- -! forbidden turbulence area -!------------------------------------------------------------------------------- - real(kind=kind_phys),parameter :: requ=-aeqh/aeqm - real(kind=kind_phys),parameter :: epsgh=1.e-9,epsgm=requ*epsgh -!------------------------------------------------------------------------------- -! near isotropy for shear turbulence, ww/q2 lower limit -!------------------------------------------------------------------------------- - real(kind=kind_phys),parameter :: ubryl=(18.*requ*a1*a1*a2x*b2*c1*btg & - +9.*a1*a2x*a2x*b2*btg*btg) & - /(requ*adnm+adnh) - real(kind=kind_phys),parameter :: ubry=(1.+epsrs)*ubryl,ubry3=3.*ubry - real(kind=kind_phys),parameter :: aubh=27.*a1*a2x*a2x*b2*btg*btg-adnh*ubry3 - real(kind=kind_phys),parameter :: aubm=54.*a1*a1*a2x*b2*c1*btg -adnm*ubry3 - real(kind=kind_phys),parameter :: bubh=(9.*a1*a2x+3.*a2x*b2)*btg-bdnh*ubry3 - real(kind=kind_phys),parameter :: bubm=18.*a1*a1*c1 -bdnm*ubry3 - real(kind=kind_phys),parameter :: cubr=1.-ubry3,rcubr=1./cubr -!------------------------------------------------------------------------------- -! k profile constants -!------------------------------------------------------------------------------- - real(kind=kind_phys),parameter :: elcbl=0.77 -!------------------------------------------------------------------------------- -! - integer, intent(in ) :: kts,kte - integer, intent(in ) :: lmh,lmxl,lpbl -! - real(kind=kind_phys), intent(in ) :: p608,vkarman,cp - real(kind=kind_phys), intent(in ) :: hpbl,corf,ustar,hgamu,hgamv,hgamq - real(kind=kind_phys), intent(inout) :: ct,epshol -! - real(kind=kind_phys), dimension( kts:kte ) , & - intent(in ) :: cwm, & - q, & - q2, & - t, & - the, & - u, & - v -! - real(kind=kind_phys), dimension( kts+1:kte ) , & - intent(in ) :: mf, & - ufxpbl, & - vfxpbl, & - qfxpbl -! - real(kind=kind_phys), dimension( kts:kte+1 ) , & - intent(in ) :: z -! - real(kind=kind_phys), dimension( kts+1:kte ) , & - intent(out ) :: el, & - ri, & - gh, & - s2 -! - logical,intent(in) :: pblflg -! -! local vars -! - integer :: k,lpblm - real(kind=kind_phys) :: suk,svk,elocp - real(kind=kind_phys) :: a,aden,b,bden,aubr,bubr,blmx,el0,eloq2x,ghl,s2l, & - qol2st,qol2un,qdzl,rdz,sq,srel,szq,tem,thm,vkrmz,rlambda, & - rlb,rln,f - real(kind=kind_phys) :: ckp - real(kind=kind_phys), dimension( kts:kte ) :: q1, & - en2 - real(kind=kind_phys), dimension( kts+1:kte ) :: dth, & - elm, & - rel -! -!------------------------------------------------------------------------------- -! - elocp=2.72e6/cp - ct=0. -! - do k = kts,kte - q1(k) = 0. - enddo -! - do k = kts+1,kte - dth(k) = the(k)-the(k-1) - enddo -! - do k = kts+2,kte - if(dth(k)>0..and.dth(k-1)<=0.)then - dth(k)=dth(k)+ct - exit - endif - enddo -! -! compute local gradient richardson number -! - do k = kte,kts+1,-1 - rdz=2./(z(k+1)-z(k-1)) - s2l=((u(k)-u(k-1))**2+(v(k)-v(k-1))**2)*rdz*rdz ! s**2 - if(pblflg.and.k.le.lpbl)then - suk=(u(k)-u(k-1))*rdz - svk=(v(k)-v(k-1))*rdz - s2l=(suk-hgamu/hpbl-ufxpbl(k))*suk+(svk-hgamv/hpbl-vfxpbl(k))*svk - endif - s2l=max(s2l,epsgm) - s2(k)=s2l -! - tem=(t(k)+t(k-1))*0.5 - thm=(the(k)+the(k-1))*0.5 - a=thm*p608 - b=(elocp/tem-1.-p608)*thm - ghl=(dth(k)*((q(k)+q(k-1)+cwm(k)+cwm(k-1))*(0.5*p608)+1.) & - +(q(k)-q(k-1)+cwm(k)-cwm(k-1))*a & - +(cwm(k)-cwm(k-1))*b)*rdz ! dtheta/dz - if(pblflg.and.k.le.lpbl)then - ghl=ghl-mf(k)-(hgamq/hpbl+qfxpbl(k))*a - endif - if(abs(ghl)<=epsgh)ghl=epsgh -! - en2(k)=ghl*g/thm ! n**2 - gh(k)=ghl - ri(k)=en2(k)/s2l - enddo -! -! find maximum mixing lengths and the level of the pbl top -! - do k = kte,kts+1,-1 - s2l=s2(k) - ghl=gh(k) - if(ghl>=epsgh)then - if(s2l/ghl<=requ)then - elm(k)=epsl - else - aubr=(aubm*s2l+aubh*ghl)*ghl - bubr= bubm*s2l+bubh*ghl - qol2st=(-0.5*bubr+sqrt(bubr*bubr*0.25-aubr*cubr))*rcubr - eloq2x=1./qol2st - elm(k)=max(sqrt(eloq2x*q2(k)),epsl) - endif - else - aden=(adnm*s2l+adnh*ghl)*ghl - bden= bdnm*s2l+bdnh*ghl - qol2un=-0.5*bden+sqrt(bden*bden*0.25-aden) - eloq2x=1./(qol2un+epsru) ! repsr1/qol2un - elm(k)=max(sqrt(eloq2x*q2(k)),epsl) - endif - enddo -! - do k = lpbl,lmh,-1 - q1(k)=sqrt(q2(k)) - enddo -! - szq=0. - sq =0. - do k = kte,kts+1,-1 - qdzl=(q1(k)+q1(k-1))*(z(k)-z(k-1)) - szq=(z(k)+z(k-1)-z(lmh)-z(lmh))*qdzl+szq - sq=qdzl+sq - enddo -! -! computation of asymptotic l in blackadar formula -! - el0=min(alph*szq*0.5/sq,el0max) - el0=max(el0 ,el0min) -! -! above the pbl top -! - lpblm=min(lpbl+1,kte) - do k = kte,lpblm,-1 - el(k)=(z(k+1)-z(k-1))*elfc - rel(k)=el(k)/elm(k) - enddo -! -! inside the pbl -! - epshol=min(epshol,0.0) - ckp=elcbl*((1.0-8.0*epshol)**(1./3.)) - if(lpbl>lmh)then - do k = lpbl,lmh+1,-1 - vkrmz=(z(k)-z(lmh))*vkarman - if(pblflg) then - vkrmz=ckp*(z(k)-z(lmh))*vkarman - el(k)=vkrmz/(vkrmz/el0+1.) - else - el(k)=vkrmz/(vkrmz/el0+1.) - endif - rel(k)=el(k)/elm(k) - enddo - endif -! - do k = lpbl-1,lmh+2,-1 - srel=min(((rel(k-1)+rel(k+1))*0.5+rel(k))*0.5,rel(k)) - el(k)=max(srel*elm(k),epsl) - enddo -! -! mixing length for the qnse model in stable case -! - f=max(corf,eps1) - rlambda=f/(blckdr*ustar) - do k = kte,kts+1,-1 - if(en2(k)>=0.0)then ! stable case - vkrmz=(z(k)-z(lmh))*vkarman - rlb=rlambda+1./vkrmz - rln=sqrt(2.*en2(k)/q2(k))/cn - el(k)=1./(rlb+rln) - endif - enddo -! - end subroutine mixlen -!------------------------------------------------------------------------------- -! -!------------------------------------------------------------------------------- - subroutine prodq2(lmh,dtturbl,ustar,s2,ri,q2,el,z,akm,akh, & - uxk,vxk,thxk,thvxk, & - hgamu,hgamv,hgamq,delxy, & - hpbl,pblflg,kpbl, & - mf,ufxpbl,vfxpbl,qfxpbl, & - p608, & - kts,kte) -!------------------------------------------------------------------------------- - use machine , only : kind_phys - implicit none -!------------------------------------------------------------------------------- -! - real(kind=kind_phys),parameter :: epsq2l = 0.01,c0 = 0.55,ceps = 16.6,g = 9.81 -! - integer, intent(in ) :: kts,kte - integer, intent(in ) :: lmh,kpbl -! - real(kind=kind_phys), intent(in ) :: p608,dtturbl,ustar - real(kind=kind_phys), intent(in ) :: hgamu,hgamv,hgamq,delxy,hpbl -! - logical, intent(in ) :: pblflg -! - real(kind=kind_phys), dimension( kts:kte ) , & - intent(in ) :: uxk, & - vxk, & - thxk, & - thvxk - real(kind=kind_phys), dimension( kts+1:kte ) , & - intent(in ) :: s2, & - ri, & - akm, & - akh, & - el, & - mf, & - ufxpbl, & - vfxpbl, & - qfxpbl -! - real(kind=kind_phys), dimension( kts:kte+1 ) , & - intent(in ) :: z -! - real(kind=kind_phys), dimension( kts:kte ) , & - intent(inout) :: q2 -! -! local vars -! - integer :: k -! - real(kind=kind_phys) :: s2l,q2l,deltaz,akml,akhl,en2,pr,bpr,dis,rc02 - real(kind=kind_phys) :: suk,svk,gthvk,govrthvk,pru,prv - real(kind=kind_phys) :: thm,disel -! -!------------------------------------------------------------------------------- -! - rc02=2.0/(c0*c0) -! -! start of production/dissipation loop -! - main_integration: do k = kts+1,kte - deltaz=0.5*(z(k+1)-z(k-1)) - s2l=s2(k) - q2l=q2(k) - suk=(uxk(k)-uxk(k-1))/deltaz - svk=(vxk(k)-vxk(k-1))/deltaz - gthvk=(thvxk(k)-thvxk(k-1))/deltaz - govrthvk=g/(0.5*(thvxk(k)+thvxk(k-1))) - akml=akm(k) - akhl=akh(k) - en2=ri(k)*s2l !n**2 - thm=(thxk(k)+thxk(k-1))*0.5 -! -! turbulence production term -! - if(pblflg.and.k.le.kpbl)then - pru=(akml*(suk-hgamu/hpbl-ufxpbl(k)))*suk - prv=(akml*(svk-hgamv/hpbl-vfxpbl(k)))*svk - else - pru=akml*suk*suk - prv=akml*svk*svk - endif - pr=pru+prv -! -! buoyancy production -! - if(pblflg.and.k.le.kpbl)then - bpr=(akhl*(gthvk-mf(k)-(hgamq/hpbl+qfxpbl(k))*p608*thm))*govrthvk - else - bpr=akhl*gthvk*govrthvk - endif -! -! dissipation -! - disel=min(delxy,ceps*el(k)) - dis=(q2l)**1.5/disel -! - q2l=q2l+2.0*(pr-bpr-dis)*dtturbl - q2(k)=amax1(q2l,epsq2l) -! -! end of production/dissipation loop -! - enddo main_integration -! -! lower boundary condition for q2 -! - q2(kts)=amax1(rc02*ustar*ustar,epsq2l) -! - end subroutine prodq2 -!------------------------------------------------------------------------------- -! -!------------------------------------------------------------------------------- - subroutine vdifq(lmh,dtdif,q2,el,z, & - akhk,ptke1, & - hgame,hpbl,pblflg,kpbl, & - efxpbl, & - kts,kte) -!------------------------------------------------------------------------------- - use machine , only : kind_phys - implicit none -!------------------------------------------------------------------------------- -! - real(kind=kind_phys),parameter :: c_k=1.0,esq=5.0 -! - integer, intent(in ) :: kts,kte - integer, intent(in ) :: lmh,kpbl -! - real(kind=kind_phys), intent(in ) :: dtdif,hpbl,efxpbl -! - logical, intent(in ) :: pblflg -! - real(kind=kind_phys), dimension( kts:kte ) , & - intent(in ) :: hgame, & - ptke1 - real(kind=kind_phys), dimension( kts+1:kte ) , & - intent(in ) :: el, & - akhk - real(kind=kind_phys), dimension( kts:kte+1 ) , & - intent(in ) :: z -! - real(kind=kind_phys), dimension( kts:kte ) , & - intent(inout) :: q2 -! -! local vars -! - integer :: k -! - real(kind=kind_phys) :: aden,akqs,bden,besh,besm,cden,cf,dtozs,ell,eloq2,eloq4 - real(kind=kind_phys) :: elqdz,esh,esm,esqhf,ghl,gml,q1l,rden,rdz - real(kind=kind_phys) :: zak -! - real(kind=kind_phys), dimension( kts+1:kte ) :: zfacentk - real(kind=kind_phys), dimension( kts+2:kte ) :: akq, & - cm, & - cr, & - dtoz, & - rsq2 -! -!------------------------------------------------------------------------------- -! -! vertical turbulent diffusion -! - esqhf=0.5*esq - do k = kts+1,kte - zak=0.5*(z(k)+z(k-1)) !zak of vdifq = za(k-1) of shinhong2d - zfacentk(k)=(zak/hpbl)**3.0 - enddo -! - do k = kte,kts+2,-1 - dtoz(k)=(dtdif+dtdif)/(z(k+1)-z(k-1)) - akq(k)=c_k*(akhk(k)/(z(k+1)-z(k-1))+akhk(k-1)/(z(k)-z(k-2))) - akq(k)=akq(k)*ptke1(k) - cr(k)=-dtoz(k)*akq(k) - enddo -! - akqs=c_k*akhk(kts+1)/(z(kts+2)-z(kts)) - akqs=akqs*ptke1(kts+1) - cm(kte)=dtoz(kte)*akq(kte)+1. - rsq2(kte)=q2(kte) -! - do k = kte-1,kts+2,-1 - cf=-dtoz(k)*akq(k+1)/cm(k+1) - cm(k)=-cr(k+1)*cf+(akq(k+1)+akq(k))*dtoz(k)+1. - rsq2(k)=-rsq2(k+1)*cf+q2(k) - if(pblflg.and.k.lt.kpbl) then - rsq2(k)=rsq2(k)-dtoz(k)*(2.0*hgame(k)/hpbl)*akq(k+1)*(z(k+1)-z(k)) & - +dtoz(k)*(2.0*hgame(k-1)/hpbl)*akq(k)*(z(k)-z(k-1)) - rsq2(k)=rsq2(k)-dtoz(k)*2.0*efxpbl*zfacentk(k+1) & - +dtoz(k)*2.0*efxpbl*zfacentk(k) - endif - enddo -! - dtozs=(dtdif+dtdif)/(z(kts+2)-z(kts)) - cf=-dtozs*akq(lmh+2)/cm(lmh+2) -! - if(pblflg.and.((lmh+1).lt.kpbl)) then - q2(lmh+1)=(dtozs*akqs*q2(lmh)-rsq2(lmh+2)*cf+q2(lmh+1) & - -dtozs*(2.0*hgame(lmh+1)/hpbl)*akq(lmh+2)*(z(lmh+2)-z(lmh+1)) & - +dtozs*(2.0*hgame(lmh)/hpbl)*akqs*(z(lmh+1)-z(lmh))) - q2(lmh+1)=q2(lmh+1)-dtozs*2.0*efxpbl*zfacentk(lmh+2) & - +dtozs*2.0*efxpbl*zfacentk(lmh+1) - q2(lmh+1)=q2(lmh+1)/((akq(lmh+2)+akqs)*dtozs-cr(lmh+2)*cf+1.) - else - q2(lmh+1)=(dtozs*akqs*q2(lmh)-rsq2(lmh+2)*cf+q2(lmh+1)) & - /((akq(lmh+2)+akqs)*dtozs-cr(lmh+2)*cf+1.) - endif -! - do k = lmh+2,kte - q2(k)=(-cr(k)*q2(k-1)+rsq2(k))/cm(k) - enddo -! - end subroutine vdifq -!------------------------------------------------------------------------------- - function pu(d,h) -!------------------------------------------------------------------------------- - use machine , only : kind_phys - implicit none -!------------------------------------------------------------------------------- - real(kind=kind_phys) :: pu - real(kind=kind_phys),parameter :: pmin = 0.0,pmax = 1.0 - real(kind=kind_phys),parameter :: a1 = 1.0, a2 = 0.070, a3 = 1.0, a4 = 0.142, a5 = 0.071 - real(kind=kind_phys),parameter :: b1 = 2.0, b2 = 0.6666667 - real(kind=kind_phys) :: d,h,doh,num,den -! - doh=d/h - num=a1*(doh)**b1+a2*(doh)**b2 - den=a3*(doh)**b1+a4*(doh)**b2+a5 - pu=num/den - pu=max(pu,pmin) - pu=min(pu,pmax) -! - return - end function -!------------------------------------------------------------------------------- -! -!------------------------------------------------------------------------------- - function pq(d,h) -!------------------------------------------------------------------------------- - use machine , only : kind_phys - implicit none -!------------------------------------------------------------------------------- - real(kind=kind_phys) :: pq - real(kind=kind_phys),parameter :: pmin = 0.0,pmax = 1.0 - real(kind=kind_phys),parameter :: a1 = 1.0, a2 = -0.098, a3 = 1.0, a4 = 0.106, a5 = 0.5 - real(kind=kind_phys),parameter :: b1 = 2.0 - real(kind=kind_phys) :: d,h,doh,num,den -! - doh=d/h - num=a1*(doh)**b1+a2 - den=a3*(doh)**b1+a4 - pq=a5*num/den+(1.-a5) - pq=max(pq,pmin) - pq=min(pq,pmax) -! - return - end function -!------------------------------------------------------------------------------- -! -!------------------------------------------------------------------------------- - function pthnl(d,h) -!------------------------------------------------------------------------------- - use machine , only : kind_phys - implicit none -!------------------------------------------------------------------------------- - real(kind=kind_phys) :: pthnl - real(kind=kind_phys),parameter :: pmin = 0.0,pmax = 1.0 - real(kind=kind_phys),parameter :: a1 = 1.000, a2 = 0.936, a3 = -1.110, & - a4 = 1.000, a5 = 0.312, a6 = 0.329, a7 = 0.243 - real(kind=kind_phys),parameter :: b1 = 2.0, b2 = 0.875 - real(kind=kind_phys) :: d,h,doh,num,den -! - doh=d/h - num=a1*(doh)**b1+a2*(doh)**b2+a3 - den=a4*(doh)**b1+a5*(doh)**b2+a6 - pthnl=a7*num/den+(1.-a7) - pthnl=max(pthnl,pmin) - pthnl=min(pthnl,pmax) -! - return - end function -!------------------------------------------------------------------------------- -! -!------------------------------------------------------------------------------- - function pthl(d,h) -!------------------------------------------------------------------------------- - use machine , only : kind_phys - implicit none -!------------------------------------------------------------------------------- - real(kind=kind_phys) :: pthl - real(kind=kind_phys),parameter :: pmin = 0.0,pmax = 1.0 - real(kind=kind_phys),parameter :: a1 = 1.000, a2 = 0.870, a3 = -0.913, & - a4 = 1.000, a5 = 0.153, a6 = 0.278, a7 = 0.280 - real(kind=kind_phys),parameter :: b1 = 2.0, b2 = 0.5 - real(kind=kind_phys) :: d,h,doh,num,den -! - doh=d/h - num=a1*(doh)**b1+a2*(doh)**b2+a3 - den=a4*(doh)**b1+a5*(doh)**b2+a6 - pthl=a7*num/den+(1.-a7) - pthl=max(pthl,pmin) - pthl=min(pthl,pmax) -! - return - end function -!------------------------------------------------------------------------------- -! -!------------------------------------------------------------------------------- - function ptke(d,h) -!------------------------------------------------------------------------------- - use machine , only : kind_phys - implicit none -!------------------------------------------------------------------------------- - real(kind=kind_phys) :: ptke - real(kind=kind_phys),parameter :: pmin = 0.0,pmax = 1.0 - real(kind=kind_phys),parameter :: a1 = 1.000, a2 = 0.070, & - a3 = 1.000, a4 = 0.142, a5 = 0.071 - real(kind=kind_phys),parameter :: b1 = 2.0, b2 = 0.6666667 - real(kind=kind_phys) :: d,h,doh,num,den -! - doh=d/h - num=a1*(doh)**b1+a2*(doh)**b2 - den=a3*(doh)**b1+a4*(doh)**b2+a5 - ptke=num/den - ptke=max(ptke,pmin) - ptke=min(ptke,pmax) -! - return - end function -!------------------------------------------------------------------------------- - end module shinhongvdif diff --git a/physics/ysuvdif.F90 b/physics/ysuvdif.F90 deleted file mode 100644 index e76f2120b..000000000 --- a/physics/ysuvdif.F90 +++ /dev/null @@ -1,1271 +0,0 @@ -!> \file ysuvdif.F90 -!! This file contains the CCPP-compliant YSU scheme which computes -!! subgrid vertical turbulence mixing using traditional K-profile method -!! Please refer to (Hong, Noh and Dudhia, 2006, MWR). -!! -!! Subroutine 'ysuvdif_run' computes subgrid vertical turbulence mixing -!! using YSU K-profile method -!! -!---------------------------------------------------------------------- - - module ysuvdif - contains - - subroutine ysuvdif_init () - end subroutine ysuvdif_init - - subroutine ysuvdif_finalize () - end subroutine ysuvdif_finalize - -!> \defgroup YSU FV3GFS ysuvdif_run Main -!! \brief This subroutine contains all of the logic for the -!! YSU scheme. -!! -!> \section arg_table_ysuvdif_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | ux | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | vx | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | tx | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | -!! | qx | tracer_concentration | model layer mean tracer concentration | kg kg-1 | 3 | real | kind_phys | in | F | -!! | p2d | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | p2di | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | pi2d | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | -!! | vtnp | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | utnp | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | ttnp | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | -!! | qtnp | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers due to model physics | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | -!! | swh | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step | total sky shortwave heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | hlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step | total sky longwave heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave | none | 1 | real | kind_phys | in | F | -!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | ndiff | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | tracer index for cloud condensate (or liquid water) | index | 0 | integer | | in | F | -!! | ntiw | index_for_ice_cloud_condensate | tracer index for ice water | index | 0 | integer | | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | psfcpa | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | -!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | -!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | -!! | psim | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | -!! | psih | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | -!! | landmask | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | -!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | wspd | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | br | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | -!! | g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | ep1 | ratio_of_vapor_to_dry_air_gas_constants_minus_one | rv/rd - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | ep2 | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | -!! | xlv | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | dusfc | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dvsfc | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | -!! | kpbl1d | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | -!! | u10 | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | v10 | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! -!------------------------------------------------------------------------------- - subroutine ysuvdif_run(ix,im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & - utnp,vtnp,ttnp,qtnp, & - swh,hlw,xmu,ntrac,ndiff,ntcw,ntiw, & - phii,phil,psfcpa, & - zorl,stress,hpbl,psim,psih, & - landmask,heat,evap,wspd,br, & - g,rd,cp,rv,ep1,ep2,xlv, & - dusfc,dvsfc,dtsfc,dqsfc, & - dt,kpbl1d,u10,v10,errmsg,errflg ) - - use machine , only : kind_phys -! -!------------------------------------------------------------------------------- - implicit none -!------------------------------------------------------------------------------- - real(kind=kind_phys),parameter :: xkzminm = 0.1,xkzminh = 0.01 - real(kind=kind_phys),parameter :: xkzmin = 0.01,xkzmax = 1000.,rimin = -100. - real(kind=kind_phys),parameter :: rlam = 30.,prmin = 0.25,prmax = 4. - real(kind=kind_phys),parameter :: brcr_ub = 0.0,brcr_sb = 0.25,cori = 1.e-4 - real(kind=kind_phys),parameter :: afac = 6.8,bfac = 6.8,pfac = 2.0,pfac_q = 2.0 - real(kind=kind_phys),parameter :: phifac = 8.,sfcfrac = 0.1 - real(kind=kind_phys),parameter :: d1 = 0.02, d2 = 0.05, d3 = 0.001 - real(kind=kind_phys),parameter :: h1 = 0.33333335, h2 = 0.6666667 - real(kind=kind_phys),parameter :: zfmin = 1.e-8,aphi5 = 5.,aphi16 = 16. - real(kind=kind_phys),parameter :: tmin=1.e-2 - real(kind=kind_phys),parameter :: gamcrt = 3.,gamcrq = 2.e-3 - real(kind=kind_phys),parameter :: xka = 2.4e-5 - real(kind=kind_phys),parameter :: rcl = 1.0 - real(kind=kind_phys),parameter :: karman = 0.4 - integer,parameter :: imvdif = 1 - integer,parameter :: ysu_topdown_pblmix = 1 -! -!------------------------------------------------------------------------------------- -! input variables - integer, intent(in ) :: ix,im,km,ntrac,ndiff,ntcw,ntiw - real(kind=kind_phys), intent(in ) :: g,cp,rd,rv,ep1,ep2,xlv,dt - - real(kind=kind_phys), dimension( ix,km ), & - intent(in) :: pi2d,p2d,phil,ux,vx,swh,hlw,tx - - real(kind=kind_phys), dimension( ix,km,ntrac ) , & - intent(in ) :: qx - - real(kind=kind_phys), dimension( ix, km+1 ) , & - intent(in ) :: p2di,phii - - real(kind=kind_phys), dimension( im ) , & - intent(in) :: stress,zorl,heat,evap,wspd,br,psim,psih,psfcpa, & - u10,v10,xmu - integer, dimension(im) ,& - intent(in ) :: landmask -! -!---------------------------------------------------------------------------------- -! input/output variables -! - real(kind=kind_phys), dimension( im,km ) , & - intent(inout) :: utnp,vtnp,ttnp - real(kind=kind_phys), dimension( im,km,ntrac ) , & - intent(inout) :: qtnp -! -!--------------------------------------------------------------------------------- -! output variables - integer, dimension( im ), intent(out ) :: kpbl1d - real(kind=kind_phys), dimension( im ), & - intent(out) :: hpbl - - ! error messages - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -! -!-------------------------------------------------------------------------------- -! -! local vars -! - real(kind=kind_phys), dimension( im ) :: hol - real(kind=kind_phys), dimension( im, km+1 ) :: zq -! - real(kind=kind_phys), dimension( im, km ) :: & - thx,thvx,thlix, & - del, & - dza, & - dzq, & - xkzom, & - xkzoh, & - za -! - real(kind=kind_phys), dimension( im ) :: & - rhox, & - govrth, & - zl1,thermal, & - wscale, & - hgamt,hgamq, & - brdn,brup, & - phim,phih, & - dusfc,dvsfc, & - dtsfc,dqsfc, & - prpbl, & - wspd1,thermalli -! - real(kind=kind_phys), dimension( im, km ) :: xkzm,xkzh, & - f1,f2, & - r1,r2, & - ad,au, & - cu, & - al, & - xkzq, & - zfac, & - rhox2, & - hgamt2 -! - real(kind=kind_phys), dimension( im ) :: & - brcr, & - sflux, & - zol1, & - brcr_sbro -! - real(kind=kind_phys), dimension( im ) :: xland - real(kind=kind_phys), dimension( im ) :: ust - real(kind=kind_phys), dimension( im ) :: hfx - real(kind=kind_phys), dimension( im ) :: qfx - real(kind=kind_phys), dimension( im ) :: znt - real(kind=kind_phys), dimension( im ) :: uox - real(kind=kind_phys), dimension( im ) :: vox -! - real(kind=kind_phys), dimension( im, km, ndiff) :: r3,f3 - integer, dimension( im ) :: kpbl,kpblold -! - logical, dimension( im ) :: pblflg, & - sfcflg, & - stable, & - cloudflg - - logical :: definebrup -! - integer :: n,i,k,l,ic,is,kk - integer :: klpbl, ktrace1, ktrace2, ktrace3 -! -! - real(kind=kind_phys) :: dt2,rdt,spdk2,fm,fh,hol1,gamfac,vpert,prnum,prnum0 - real(kind=kind_phys) :: ss,ri,qmean,tmean,alph,chi,zk,rl2,dk,sri - real(kind=kind_phys) :: brint,dtodsd,dtodsu,rdz,dsdzt,dsdzq,dsdz2,rlamdz - real(kind=kind_phys) :: utend,vtend,ttend,qtend - real(kind=kind_phys) :: dtstep,govrthv - real(kind=kind_phys) :: cont, conq, conw, conwrc, rovcp -! - - real(kind=kind_phys), dimension( im, km ) :: wscalek,wscalek2 - real(kind=kind_phys), dimension( im ) :: wstar - real(kind=kind_phys), dimension( im ) :: delta - real(kind=kind_phys), dimension( im, km ) :: xkzml,xkzhl, & - zfacent,entfac - real(kind=kind_phys), dimension( im ) :: ust3, & - wstar3, & - wstar3_2, & - hgamu,hgamv, & - wm2, we, & - bfxpbl, & - hfxpbl,qfxpbl, & - ufxpbl,vfxpbl, & - dthvx - real(kind=kind_phys) :: prnumfac,bfx0,hfx0,qfx0,delb,dux,dvx, & - dsdzu,dsdzv,wm3,dthx,dqx,wspd10,ross,tem1,dsig,tvcon,conpr, & - prfac,prfac2,phim8z,radsum,tmp1,templ,rvls,temps,ent_eff, & - rcldb,bruptmp,radflux -! -!------------------------------------------------------------------------------- -! -! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - klpbl = km -! - rovcp=rd/cp - cont=cp/g - conq=xlv/g - conw=1./g - conwrc = conw*sqrt(rcl) - conpr = bfac*karman*sfcfrac -! -! change xland values - do i=1,im - if(landmask(i).eq.0) then !ocean - xland(i) = 2 - else - xland(i) = 1 !land - end if - end do -! - do k = 1,km - do i = 1,im - thx(i,k) = tx(i,k)/pi2d(i,k) - thlix(i,k) = (tx(i,k)-xlv*qx(i,k,ntcw)/cp-2.834E6*qx(i,k,ntiw)/cp)/pi2d(i,k) - enddo - enddo -! - do k = 1,km - do i = 1,im - tvcon = (1.+ep1*qx(i,k,1)) - thvx(i,k) = thx(i,k)*tvcon - enddo - enddo -! - do i = 1,im - tvcon = (1.+ep1*qx(i,1,1)) - rhox(i) = psfcpa(i)/(rd*tx(i,1)*tvcon) - govrth(i) = g/thx(i,1) - hfx(i) = heat(i)*rhox(i)*cp ! reset to the variable in WRF - qfx(i) = evap(i)*rhox(i) ! reset to the variable in WRF - ust(i) = sqrt(stress(i)) ! reset to the variable in WRF - znt(i) = 0.01*zorl(i) ! reset to the variable in WRF - uox(i) = 0.0 - vox(i) = 0.0 - enddo -! -!-----compute the height of full- and half-sigma levels above ground -! level, and the layer thicknesses. -! - do i = 1,im - zq(i,1) = 0. - enddo -! - do k = 1,km - do i = 1,im - zq(i,k+1) = phii(i,k+1)*conw - tvcon = (1.+ep1*qx(i,k,1)) - rhox2(i,k) = p2d(i,k)/(rd*tx(i,k)*tvcon) - enddo - enddo -! - do k = 1,km - do i = 1,im - za(i,k) = phil(i,k)*conw - dzq(i,k) = zq(i,k+1)-zq(i,k) - del(i,k) = p2di(i,k)-p2di(i,k+1) - enddo - enddo -! - do i = 1,im - dza(i,1) = za(i,1) - enddo -! - do k = 2,km - do i = 1,im - dza(i,k) = za(i,k)-za(i,k-1) - enddo - enddo - -! write(0,*)"===CALLING ysu; input:" -! print*,"t:",tx(1,1),tx(1,2),tx(1,km) -! print*,"u:",ux(1,1),ux(1,2),ux(1,km) -! print*,"v:",vx(1,1),vx(1,2),vx(1,km) -! print*,"q:",qx(1,1,1),qx(1,2,1),qx(1,km,1) -! print*,"exner:",pi2d(1,1),pi2d(1,2),pi2d(1,km) -! print*,"phii:",zq(1,1),zq(1,2),zq(1,km+1) -! print*,"phil:",za(1,1),za(1,2),za(1,km) -! print*,"p2d:",p2d(1,1),p2d(1,2),p2d(1,km) -! print*,"p2di:",p2di(1,1),p2di(1,2),p2di(1,km+1) -! print *,"del:",del(1,1),del(1,2),del(1,km) -! print*,"znt,ust,wspd:",znt(1),ust(1),wspd(1) -! print*,"hfx,qfx,xland:",hfx(1),qfx(1),xland(1) -! print*,"rd,rv,g:",rd,rv,g -! print*,"ep1,ep2,xlv:",ep1,ep2,xlv -! print*,"br,psim,psih:",br(1),psim(1),psih(1) -! print*,"u10,v10:",u10(1),v10(1) -! print*,"psfcpa,cp:",psfcpa(1),cp -! print*,"ntrac,ndiff,ntcw,ntiw:",ntrac,ndiff,ntcw,ntiw -! -! -!-----initialize vertical tendencies and -! -! utnp(:,:) = 0. -! vtnp(:,:) = 0. -! ttnp(:,:) = 0. -! qtnp(:,:,:) = 0. -! - do i = 1,im - wspd1(i) = sqrt( (ux(i,1)-uox(i))*(ux(i,1)-uox(i)) + (vx(i,1)-vox(i))*(vx(i,1)-vox(i)) )+1.e-9 - enddo -! -!---- compute vertical diffusion -! -! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -! compute preliminary variables -! - dtstep = dt - dt2 = 2.*dtstep - rdt = 1./dt2 -! - do i = 1,im - bfxpbl(i) = 0.0 - hfxpbl(i) = 0.0 - qfxpbl(i) = 0.0 - ufxpbl(i) = 0.0 - vfxpbl(i) = 0.0 - hgamu(i) = 0.0 - hgamv(i) = 0.0 - delta(i) = 0.0 - wstar3_2(i) = 0.0 - enddo -! - do k = 1,klpbl - do i = 1,im - wscalek(i,k) = 0.0 - wscalek2(i,k) = 0.0 - enddo - enddo -! - do k = 1,klpbl - do i = 1,im - zfac(i,k) = 0.0 - enddo - enddo - do k = 1,klpbl-1 - do i = 1,im - xkzom(i,k) = xkzminm - xkzoh(i,k) = xkzminh - enddo - enddo -! - do i = 1,im - dusfc(i) = 0. - dvsfc(i) = 0. - dtsfc(i) = 0. - dqsfc(i) = 0. - enddo -! - do i = 1,im - hgamt(i) = 0. - hgamq(i) = 0. - wscale(i) = 0. - kpbl(i) = 1 - hpbl(i) = zq(i,1) - zl1(i) = za(i,1) - thermal(i)= thvx(i,1) - thermalli(i) = thlix(i,1) - pblflg(i) = .true. - sfcflg(i) = .true. - sflux(i) = hfx(i)/rhox(i)/cp + qfx(i)/rhox(i)*ep1*thx(i,1) - if(br(i).gt.0.0) sfcflg(i) = .false. - enddo -! -! compute the first guess of pbl height -! - do i = 1,im - stable(i) = .false. - brup(i) = br(i) - brcr(i) = brcr_ub - enddo -! - do k = 2,klpbl - do i = 1,im - if(.not.stable(i))then - brdn(i) = brup(i) - spdk2 = max(ux(i,k)**2+vx(i,k)**2,1.) - brup(i) = (thvx(i,k)-thermal(i))*(g*za(i,k)/thvx(i,1))/spdk2 - kpbl(i) = k - stable(i) = brup(i).gt.brcr(i) - endif - enddo - enddo -! - do i = 1,im - k = kpbl(i) - if(brdn(i).ge.brcr(i))then - brint = 0. - elseif(brup(i).le.brcr(i))then - brint = 1. - else - brint = (brcr(i)-brdn(i))/(brup(i)-brdn(i)) - endif - hpbl(i) = za(i,k-1)+brint*(za(i,k)-za(i,k-1)) - if(hpbl(i).lt.zq(i,2)) kpbl(i) = 1 - if(kpbl(i).le.1) pblflg(i) = .false. - enddo -! - do i = 1,im - fm = psim(i) - fh = psih(i) - zol1(i) = max(br(i)*fm*fm/fh,rimin) - if(sfcflg(i))then - zol1(i) = min(zol1(i),-zfmin) - else - zol1(i) = max(zol1(i),zfmin) - endif - hol1 = zol1(i)*hpbl(i)/zl1(i)*sfcfrac - if(sfcflg(i))then - phim(i) = (1.-aphi16*hol1)**(-1./4.) - phih(i) = (1.-aphi16*hol1)**(-1./2.) - bfx0 = max(sflux(i),0.) - hfx0 = max(hfx(i)/rhox(i)/cp,0.) - qfx0 = max(ep1*thx(i,1)*qfx(i)/rhox(i),0.) - wstar3(i) = (govrth(i)*bfx0*hpbl(i)) - wstar(i) = (wstar3(i))**h1 - else - phim(i) = (1.+aphi5*hol1) - phih(i) = phim(i) - wstar(i) = 0. - wstar3(i) = 0. - endif - ust3(i) = ust(i)**3. - wscale(i) = (ust3(i)+phifac*karman*wstar3(i)*0.5)**h1 - wscale(i) = min(wscale(i),ust(i)*aphi16) - wscale(i) = max(wscale(i),ust(i)/aphi5) - enddo -! -! compute the surface variables for pbl height estimation -! under unstable conditions -! - do i = 1,im - if(sfcflg(i).and.sflux(i).gt.0.0)then - gamfac = bfac/rhox(i)/wscale(i) - hgamt(i) = min(gamfac*hfx(i)/cp,gamcrt) - hgamq(i) = min(gamfac*qfx(i),gamcrq) - vpert = (hgamt(i)+ep1*thx(i,1)*hgamq(i))/bfac*afac - thermal(i) = thermal(i)+max(vpert,0.)*min(za(i,1)/(sfcfrac*hpbl(i)),1.0) - thermalli(i)= thermalli(i)+max(vpert,0.)*min(za(i,1)/(sfcfrac*hpbl(i)),1.0) - hgamt(i) = max(hgamt(i),0.0) - hgamq(i) = max(hgamq(i),0.0) - brint = -15.9*ust(i)*ust(i)/wspd(i)*wstar3(i)/(wscale(i)**4.) - hgamu(i) = brint*ux(i,1) - hgamv(i) = brint*vx(i,1) - else - pblflg(i) = .false. - endif - enddo -! -! enhance the pbl height by considering the thermal -! - do i = 1,im - if(pblflg(i))then - kpbl(i) = 1 - hpbl(i) = zq(i,1) - endif - enddo -! - do i = 1,im - if(pblflg(i))then - stable(i) = .false. - brup(i) = br(i) - brcr(i) = brcr_ub - endif - enddo -! - do k = 2,klpbl - do i = 1,im - if(.not.stable(i).and.pblflg(i))then - brdn(i) = brup(i) - spdk2 = max(ux(i,k)**2+vx(i,k)**2,1.) - brup(i) = (thvx(i,k)-thermal(i))*(g*za(i,k)/thvx(i,1))/spdk2 - kpbl(i) = k - stable(i) = brup(i).gt.brcr(i) - endif - enddo - enddo -! -! enhance pbl by theta-li -! - if (ysu_topdown_pblmix.eq.1)then - do i = 1,im - kpblold(i) = kpbl(i) - definebrup=.false. - do k = kpblold(i), km-1 - spdk2 = max(ux(i,k)**2+vx(i,k)**2,1.) - bruptmp = (thlix(i,k)-thermalli(i))*(g*za(i,k)/thlix(i,1))/spdk2 - stable(i) = bruptmp.ge.brcr(i) - if (definebrup) then - kpbl(i) = k - brup(i) = bruptmp - definebrup=.false. - endif - if (.not.stable(i)) then !overwrite brup brdn values - brdn(i)=bruptmp - definebrup=.true. - pblflg(i)=.true. - endif - enddo - enddo - endif - - do i = 1,im - if(pblflg(i)) then - k = kpbl(i) - if(brdn(i).ge.brcr(i))then - brint = 0. - elseif(brup(i).le.brcr(i))then - brint = 1. - else - brint = (brcr(i)-brdn(i))/(brup(i)-brdn(i)) - endif - hpbl(i) = za(i,k-1)+brint*(za(i,k)-za(i,k-1)) - if(hpbl(i).lt.zq(i,2)) kpbl(i) = 1 - if(kpbl(i).le.1) pblflg(i) = .false. - endif - enddo -! -! stable boundary layer -! - do i = 1,im - if((.not.sfcflg(i)).and.hpbl(i).lt.zq(i,2)) then - brup(i) = br(i) - stable(i) = .false. - else - stable(i) = .true. - endif - enddo -! - do i = 1,im - if((.not.stable(i)).and.((xland(i)-1.5).ge.0))then - wspd10 = u10(i)*u10(i) + v10(i)*v10(i) - wspd10 = sqrt(wspd10) - ross = wspd10 / (cori*znt(i)) - brcr_sbro(i) = min(0.16*(1.e-7*ross)**(-0.18),.3) - endif - enddo -! - do i = 1,im - if(.not.stable(i))then - if((xland(i)-1.5).ge.0)then - brcr(i) = brcr_sbro(i) - else - brcr(i) = brcr_sb - endif - endif - enddo -! - do k = 2,klpbl - do i = 1,im - if(.not.stable(i))then - brdn(i) = brup(i) - spdk2 = max(ux(i,k)**2+vx(i,k)**2,1.) - brup(i) = (thvx(i,k)-thermal(i))*(g*za(i,k)/thvx(i,1))/spdk2 - kpbl(i) = k - stable(i) = brup(i).gt.brcr(i) - endif - enddo - enddo -! - do i = 1,im - if((.not.sfcflg(i)).and.hpbl(i).lt.zq(i,2)) then - k = kpbl(i) - if(brdn(i).ge.brcr(i))then - brint = 0. - elseif(brup(i).le.brcr(i))then - brint = 1. - else - brint = (brcr(i)-brdn(i))/(brup(i)-brdn(i)) - endif - hpbl(i) = za(i,k-1)+brint*(za(i,k)-za(i,k-1)) - if(hpbl(i).lt.zq(i,2)) kpbl(i) = 1 - if(kpbl(i).le.1) pblflg(i) = .false. - endif - enddo -! -! estimate the entrainment parameters -! - do i = 1,im - cloudflg(i)=.false. - if(pblflg(i)) then - k = kpbl(i) - 1 - wm3 = wstar3(i) + 5. * ust3(i) - wm2(i) = wm3**h2 - bfxpbl(i) = -0.15*thvx(i,1)/g*wm3/hpbl(i) - dthvx(i) = max(thvx(i,k+1)-thvx(i,k),tmin) - we(i) = max(bfxpbl(i)/dthvx(i),-sqrt(wm2(i))) - if((qx(i,k,ntcw)+qx(i,k,ntiw)).gt.0.01e-3.and.ysu_topdown_pblmix.eq.1)then - if ( kpbl(i) .ge. 2) then - cloudflg(i)=.true. - templ=thlix(i,k)*(p2di(i,k+1)/100000)**rovcp - !rvls is ws at full level - rvls=100.*6.112*EXP(17.67*(templ-273.16)/(templ-29.65))*(ep2/p2di(i,k+1)) - temps=templ + ((qx(i,k,1)+qx(i,k,ntcw))-rvls)/(cp/xlv + & - ep2*xlv*rvls/(rd*templ**2)) - rvls=100.*6.112*EXP(17.67*(temps-273.15)/(temps-29.65))*(ep2/p2di(i,k+1)) - rcldb=max((qx(i,k,1)+qx(i,k,ntcw))-rvls,0.) - !entrainment efficiency - dthvx(i) = (thlix(i,k+2)+thx(i,k+2)*ep1*(qx(i,k+2,1)+qx(i,k+2,ntcw))) & - - (thlix(i,k) + thx(i,k) *ep1*(qx(i,k,1) +qx(i,k,ntcw))) - dthvx(i) = max(dthvx(i),0.1) - tmp1 = xlv/cp * rcldb/(pi2d(i,k)*dthvx(i)) - ent_eff = 0.2 * 8. * tmp1 +0.2 - - radsum=0. - do kk = 1,kpbl(i)-1 - radflux=swh(i,kk)*xmu(i)+hlw(i,kk) !radiative heating rate temp/s - radflux=radflux*cp/g*(p2di(i,kk)-p2di(i,kk+1)) ! converts temp/s to W/m^2 - if (radflux < 0.0 ) radsum=abs(radflux)+radsum - enddo - radsum=max(radsum,0.0) - - !recompute entrainment from sfc thermals - bfx0 = max(max(sflux(i),0.0)-radsum/rhox2(i,k)/cp,0.) - bfx0 = max(sflux(i),0.0) - wm3 = (govrth(i)*bfx0*hpbl(i))+5. * ust3(i) - wm2(i) = wm3**h2 - bfxpbl(i) = -0.15*thvx(i,1)/g*wm3/hpbl(i) - dthvx(i) = max(thvx(i,k+1)-thvx(i,k),tmin) - we(i) = max(bfxpbl(i)/dthvx(i),-sqrt(wm2(i))) - - !entrainment from PBL top thermals - bfx0 = max(radsum/rhox2(i,k)/cp-max(sflux(i),0.0),0.) - bfx0 = max(radsum/rhox2(i,k)/cp,0.) - wm3 = (g/thvx(i,k)*bfx0*hpbl(i)) ! this is wstar3(i) - wm2(i) = wm2(i)+wm3**h2 - bfxpbl(i) = - ent_eff * bfx0 - dthvx(i) = max(thvx(i,k+1)-thvx(i,k),0.1) - we(i) = we(i) + max(bfxpbl(i)/dthvx(i),-sqrt(wm3**h2)) - - !wstar3_2 - bfx0 = max(radsum/rhox2(i,k)/cp,0.) - wstar3_2(i) = (g/thvx(i,k)*bfx0*hpbl(i)) - !recompute hgamt - wscale(i) = (ust3(i)+phifac*karman*(wstar3(i)+wstar3_2(i))*0.5)**h1 - wscale(i) = min(wscale(i),ust(i)*aphi16) - wscale(i) = max(wscale(i),ust(i)/aphi5) - gamfac = bfac/rhox(i)/wscale(i) - hgamt(i) = min(gamfac*hfx(i)/cp,gamcrt) - hgamq(i) = min(gamfac*qfx(i),gamcrq) - gamfac = bfac/rhox2(i,k)/wscale(i) - hgamt2(i,k) = min(gamfac*radsum/cp,gamcrt) - hgamt(i) = max(hgamt(i),0.0) + max(hgamt2(i,k),0.0) - brint = -15.9*ust(i)*ust(i)/wspd(i)*(wstar3(i)+wstar3_2(i))/(wscale(i)**4.) - hgamu(i) = brint*ux(i,1) - hgamv(i) = brint*vx(i,1) - endif - endif - prpbl(i) = 1.0 - dthx = max(thx(i,k+1)-thx(i,k),tmin) - dqx = min(qx(i,k+1,1)-qx(i,k,1),0.0) - hfxpbl(i) = we(i)*dthx - qfxpbl(i) = we(i)*dqx -! - dux = ux(i,k+1)-ux(i,k) - dvx = vx(i,k+1)-vx(i,k) - if(dux.gt.tmin) then - ufxpbl(i) = max(prpbl(i)*we(i)*dux,-ust(i)*ust(i)) - elseif(dux.lt.-tmin) then - ufxpbl(i) = min(prpbl(i)*we(i)*dux,ust(i)*ust(i)) - else - ufxpbl(i) = 0.0 - endif - if(dvx.gt.tmin) then - vfxpbl(i) = max(prpbl(i)*we(i)*dvx,-ust(i)*ust(i)) - elseif(dvx.lt.-tmin) then - vfxpbl(i) = min(prpbl(i)*we(i)*dvx,ust(i)*ust(i)) - else - vfxpbl(i) = 0.0 - endif - delb = govrth(i)*d3*hpbl(i) - delta(i) = min(d1*hpbl(i) + d2*wm2(i)/delb,100.) - endif - enddo -! - do k = 1,klpbl - do i = 1,im - if(pblflg(i).and.k.ge.kpbl(i))then - entfac(i,k) = ((zq(i,k+1)-hpbl(i))/delta(i))**2. - else - entfac(i,k) = 1.e30 - endif - enddo - enddo -! -! compute diffusion coefficients below pbl -! - do k = 1,klpbl - do i = 1,im - if(k.lt.kpbl(i)) then - zfac(i,k) = min(max((1.-(zq(i,k+1)-zl1(i))/(hpbl(i)-zl1(i))),zfmin),1.) - zfacent(i,k) = (1.-zfac(i,k))**3. - wscalek(i,k) = (ust3(i)+phifac*karman*wstar3(i)*(1.-zfac(i,k)))**h1 - wscalek2(i,k) = (phifac*karman*wstar3_2(i)*(zfac(i,k)))**h1 - if(sfcflg(i)) then - prfac = conpr - prfac2 = 15.9*(wstar3(i)+wstar3_2(i))/ust3(i)/(1.+4.*karman*(wstar3(i)+wstar3_2(i))/ust3(i)) - prnumfac = -3.*(max(zq(i,k+1)-sfcfrac*hpbl(i),0.))**2./hpbl(i)**2. - else - prfac = 0. - prfac2 = 0. - prnumfac = 0. - phim8z = 1.+aphi5*zol1(i)*zq(i,k+1)/zl1(i) - wscalek(i,k) = ust(i)/phim8z - wscalek(i,k) = max(wscalek(i,k),0.001) - endif - prnum0 = (phih(i)/phim(i)+prfac) - prnum0 = max(min(prnum0,prmax),prmin) - xkzm(i,k) = wscalek(i,k) *karman* zq(i,k+1) * zfac(i,k)**pfac+ & - wscalek2(i,k)*karman*(hpbl(i)-zq(i,k+1))*(1-zfac(i,k))**pfac - !Do not include xkzm at kpbl-1 since it changes entrainment - if (k.eq.kpbl(i)-1.and.cloudflg(i).and.we(i).lt.0.0) then - xkzm(i,k) = 0.0 - endif - prnum = 1. + (prnum0-1.)*exp(prnumfac) - xkzq(i,k) = xkzm(i,k)/prnum*zfac(i,k)**(pfac_q-pfac) - prnum0 = prnum0/(1.+prfac2*karman*sfcfrac) - prnum = 1. + (prnum0-1.)*exp(prnumfac) - xkzh(i,k) = xkzm(i,k)/prnum - xkzm(i,k) = xkzm(i,k)+xkzom(i,k) - xkzh(i,k) = xkzh(i,k)+xkzoh(i,k) - xkzq(i,k) = xkzq(i,k)+xkzoh(i,k) - xkzm(i,k) = min(xkzm(i,k),xkzmax) - xkzh(i,k) = min(xkzh(i,k),xkzmax) - xkzq(i,k) = min(xkzq(i,k),xkzmax) - endif - enddo - enddo -! -! compute diffusion coefficients over pbl (free atmosphere) -! - do k = 1,km-1 - do i = 1,im - if(k.ge.kpbl(i)) then - ss = ((ux(i,k+1)-ux(i,k))*(ux(i,k+1)-ux(i,k)) & - +(vx(i,k+1)-vx(i,k))*(vx(i,k+1)-vx(i,k))) & - /(dza(i,k+1)*dza(i,k+1))+1.e-9 - govrthv = g/(0.5*(thvx(i,k+1)+thvx(i,k))) - ri = govrthv*(thvx(i,k+1)-thvx(i,k))/(ss*dza(i,k+1)) - if(imvdif.eq.1.and.ntcw.ge.2.and.ntiw.ge.2)then - if((qx(i,k,ntcw)+qx(i,k,ntiw)).gt.0.01e-3.and.(qx(i & - ,k+1,ntcw)+qx(i,k+1,ntiw)).gt.0.01e-3)then -! in cloud - qmean = 0.5*(qx(i,k,1)+qx(i,k+1,1)) - tmean = 0.5*(tx(i,k)+tx(i,k+1)) - alph = xlv*qmean/rd/tmean - chi = xlv*xlv*qmean/cp/rv/tmean/tmean - ri = (1.+alph)*(ri-g*g/ss/tmean/cp*((chi-alph)/(1.+chi))) - endif - endif - zk = karman*zq(i,k+1) - rlamdz = min(max(0.1*dza(i,k+1),rlam),300.) - rlamdz = min(dza(i,k+1),rlamdz) - rl2 = (zk*rlamdz/(rlamdz+zk))**2 - dk = rl2*sqrt(ss) - if(ri.lt.0.)then -! unstable regime - ri = max(ri, rimin) - sri = sqrt(-ri) - xkzm(i,k) = dk*(1+8.*(-ri)/(1+1.746*sri)) - xkzh(i,k) = dk*(1+8.*(-ri)/(1+1.286*sri)) - else -! stable regime - xkzh(i,k) = dk/(1+5.*ri)**2 - prnum = 1.0+2.1*ri - prnum = min(prnum,prmax) - xkzm(i,k) = xkzh(i,k)*prnum - endif -! - xkzm(i,k) = xkzm(i,k)+xkzom(i,k) - xkzh(i,k) = xkzh(i,k)+xkzoh(i,k) - xkzm(i,k) = min(xkzm(i,k),xkzmax) - xkzh(i,k) = min(xkzh(i,k),xkzmax) - xkzml(i,k) = xkzm(i,k) - xkzhl(i,k) = xkzh(i,k) - endif - enddo - enddo -! -! compute tridiagonal matrix elements for heat -! - do k = 1,km - do i = 1,im - au(i,k) = 0. - al(i,k) = 0. - ad(i,k) = 0. - f1(i,k) = 0. - enddo - enddo -! - do i = 1,im - ad(i,1) = 1. - f1(i,1) = thx(i,1)-300.+hfx(i)/cont/del(i,1)*dt2 - enddo -! - do k = 1,km-1 - do i = 1,im - dtodsd = dt2/del(i,k) - dtodsu = dt2/del(i,k+1) - dsig = p2d(i,k)-p2d(i,k+1) - rdz = 1./dza(i,k+1) - tem1 = dsig*xkzh(i,k)*rdz - if(pblflg(i).and.k.lt.kpbl(i)) then - dsdzt = tem1*(-hgamt(i)/hpbl(i)-hfxpbl(i)*zfacent(i,k)/xkzh(i,k)) - f1(i,k) = f1(i,k)+dtodsd*dsdzt - f1(i,k+1) = thx(i,k+1)-300.-dtodsu*dsdzt - elseif(pblflg(i).and.k.ge.kpbl(i).and.entfac(i,k).lt.4.6) then - xkzh(i,k) = -we(i)*dza(i,kpbl(i))*exp(-entfac(i,k)) - xkzh(i,k) = sqrt(xkzh(i,k)*xkzhl(i,k)) - xkzh(i,k) = max(xkzh(i,k),xkzoh(i,k)) - xkzh(i,k) = min(xkzh(i,k),xkzmax) - f1(i,k+1) = thx(i,k+1)-300. - else - f1(i,k+1) = thx(i,k+1)-300. - endif - tem1 = dsig*xkzh(i,k)*rdz - dsdz2 = tem1*rdz - au(i,k) = -dtodsd*dsdz2 - al(i,k) = -dtodsu*dsdz2 - ad(i,k) = ad(i,k)-au(i,k) - ad(i,k+1) = 1.-al(i,k) - enddo - enddo -! -! copies here to avoid duplicate input args for tridin -! - do k = 1,km - do i = 1,im - cu(i,k) = au(i,k) - r1(i,k) = f1(i,k) - enddo - enddo -! - call tridin_ysu(al,ad,cu,r1,au,f1,im,km,1) -! -! recover tendencies of heat -! - do k = km,1,-1 - do i = 1,im - ttend = (f1(i,k)-thx(i,k)+300.)*rdt*pi2d(i,k) - ttnp(i,k) = ttnp(i,k)+ttend - dtsfc(i) = dtsfc(i)+ttend*cont*del(i,k) - enddo - enddo -! -! compute tridiagonal matrix elements for moisture, clouds, and gases -! - do k = 1,km - do i = 1,im - au(i,k) = 0. - al(i,k) = 0. - ad(i,k) = 0. - enddo - enddo -! - do ic = 1,ndiff - do i = 1,im - do k = 1,km - f3(i,k,ic) = 0. - enddo - enddo - enddo -! - do i = 1,im - ad(i,1) = 1. - f3(i,1,1) = qx(i,1,1)+qfx(i)*g/del(i,1)*dt2 - enddo -! - if(ndiff.ge.2) then - do ic = 2,ndiff - do i = 1,im - f3(i,1,ic) = qx(i,1,ic) - enddo - enddo - endif -! - do k = 1,km-1 - do i = 1,im - if(k.ge.kpbl(i)) then - xkzq(i,k) = xkzh(i,k) - endif - enddo - enddo -! - do k = 1,km-1 - do i = 1,im - dtodsd = dt2/del(i,k) - dtodsu = dt2/del(i,k+1) - dsig = p2d(i,k)-p2d(i,k+1) - rdz = 1./dza(i,k+1) - tem1 = dsig*xkzq(i,k)*rdz - if(pblflg(i).and.k.lt.kpbl(i)) then - dsdzq = tem1*(-qfxpbl(i)*zfacent(i,k)/xkzq(i,k)) - f3(i,k,1) = f3(i,k,1)+dtodsd*dsdzq - f3(i,k+1,1) = qx(i,k+1,1)-dtodsu*dsdzq - elseif(pblflg(i).and.k.ge.kpbl(i).and.entfac(i,k).lt.4.6) then - xkzq(i,k) = -we(i)*dza(i,kpbl(i))*exp(-entfac(i,k)) - xkzq(i,k) = sqrt(xkzq(i,k)*xkzhl(i,k)) - xkzq(i,k) = max(xkzq(i,k),xkzoh(i,k)) - xkzq(i,k) = min(xkzq(i,k),xkzmax) - f3(i,k+1,1) = qx(i,k+1,1) - else - f3(i,k+1,1) = qx(i,k+1,1) - endif - tem1 = dsig*xkzq(i,k)*rdz - dsdz2 = tem1*rdz - au(i,k) = -dtodsd*dsdz2 - al(i,k) = -dtodsu*dsdz2 - ad(i,k) = ad(i,k)-au(i,k) - ad(i,k+1) = 1.-al(i,k) - enddo - enddo -! - if(ndiff.ge.2) then - do ic = 2,ndiff - do k = 1,km-1 - do i = 1,im - f3(i,k+1,ic) = qx(i,k+1,ic) - enddo - enddo - enddo - endif -! -! copies here to avoid duplicate input args for tridin -! - do k = 1,km - do i = 1,im - cu(i,k) = au(i,k) - enddo - enddo -! - do ic = 1,ndiff - do k = 1,km - do i = 1,im - r3(i,k,ic) = f3(i,k,ic) - enddo - enddo - enddo -! -! solve tridiagonal problem for moisture, clouds, and gases -! - call tridin_ysu(al,ad,cu,r3,au,f3,im,km,ndiff) -! -! recover tendencies of heat and moisture -! - do k = km,1,-1 - do i = 1,im - qtend = (f3(i,k,1)-qx(i,k,1))*rdt - qtnp(i,k,1) = qtnp(i,k,1)+qtend - dqsfc(i) = dqsfc(i)+qtend*conq*del(i,k) - enddo - enddo -! - if(ndiff.ge.2) then - do ic = 2,ndiff - do k = km,1,-1 - do i = 1,im - qtend = (f3(i,k,ic)-qx(i,k,ic))*rdt - qtnp(i,k,ic) = qtnp(i,k,ic)+qtend - enddo - enddo - enddo - endif -! -! compute tridiagonal matrix elements for momentum -! - do i = 1,im - do k = 1,km - au(i,k) = 0. - al(i,k) = 0. - ad(i,k) = 0. - f1(i,k) = 0. - f2(i,k) = 0. - enddo - enddo -! - do i = 1,im - ad(i,1) = 1.+ust(i)**2/wspd1(i)*rhox(i)*g/del(i,1)*dt2 & - *(wspd1(i)/wspd(i))**2 - f1(i,1) = ux(i,1)+uox(i)*ust(i)**2*g/del(i,1)*dt2/wspd1(i) - f2(i,1) = vx(i,1)+vox(i)*ust(i)**2*g/del(i,1)*dt2/wspd1(i) - enddo -! - do k = 1,km-1 - do i = 1,im - dtodsd = dt2/del(i,k) - dtodsu = dt2/del(i,k+1) - dsig = p2d(i,k)-p2d(i,k+1) - rdz = 1./dza(i,k+1) - tem1 = dsig*xkzm(i,k)*rdz - if(pblflg(i).and.k.lt.kpbl(i))then - dsdzu = tem1*(-hgamu(i)/hpbl(i)-ufxpbl(i)*zfacent(i,k)/xkzm(i,k)) - dsdzv = tem1*(-hgamv(i)/hpbl(i)-vfxpbl(i)*zfacent(i,k)/xkzm(i,k)) - f1(i,k) = f1(i,k)+dtodsd*dsdzu - f1(i,k+1) = ux(i,k+1)-dtodsu*dsdzu - f2(i,k) = f2(i,k)+dtodsd*dsdzv - f2(i,k+1) = vx(i,k+1)-dtodsu*dsdzv - elseif(pblflg(i).and.k.ge.kpbl(i).and.entfac(i,k).lt.4.6) then - xkzm(i,k) = prpbl(i)*xkzh(i,k) - xkzm(i,k) = sqrt(xkzm(i,k)*xkzml(i,k)) - xkzm(i,k) = max(xkzm(i,k),xkzom(i,k)) - xkzm(i,k) = min(xkzm(i,k),xkzmax) - f1(i,k+1) = ux(i,k+1) - f2(i,k+1) = vx(i,k+1) - else - f1(i,k+1) = ux(i,k+1) - f2(i,k+1) = vx(i,k+1) - endif - tem1 = dsig*xkzm(i,k)*rdz - dsdz2 = tem1*rdz - au(i,k) = -dtodsd*dsdz2 - al(i,k) = -dtodsu*dsdz2 - ad(i,k) = ad(i,k)-au(i,k) - ad(i,k+1) = 1.-al(i,k) - enddo - enddo -! -! copies here to avoid duplicate input args for tridin -! - do k = 1,km - do i = 1,im - cu(i,k) = au(i,k) - r1(i,k) = f1(i,k) - r2(i,k) = f2(i,k) - enddo - enddo -! -! solve tridiagonal problem for momentum -! - call tridi1n(al,ad,cu,r1,r2,au,f1,f2,im,km,1) -! -! recover tendencies of momentum -! - do k = km,1,-1 - do i = 1,im - utend = (f1(i,k)-ux(i,k))*rdt - vtend = (f2(i,k)-vx(i,k))*rdt - utnp(i,k) = utnp(i,k)+utend - vtnp(i,k) = vtnp(i,k)+vtend - dusfc(i) = dusfc(i) + utend*conwrc*del(i,k) - dvsfc(i) = dvsfc(i) + vtend*conwrc*del(i,k) - enddo - enddo -! -!---- end of vertical diffusion -! - do i = 1,im - kpbl1d(i) = kpbl(i) - enddo -! -! - end subroutine ysuvdif_run -!------------------------------------------------------------------------------- -! -!------------------------------------------------------------------------------- - subroutine tridi1n(cl,cm,cu,r1,r2,au,f1,f2,im,km,nt) - use machine , only : kind_phys -!------------------------------------------------------------------------------- - implicit none -!------------------------------------------------------------------------------- -! - integer, intent(in ) :: im, km, nt -! - real(kind=kind_phys), dimension( im, 2:km+1 ) , & - intent(in ) :: cl -! - real(kind=kind_phys), dimension( im, km ) , & - intent(in ) :: cm, & - r1 - real(kind=kind_phys), dimension( im, km,nt ) , & - intent(in ) :: r2 -! - real(kind=kind_phys), dimension( im, km ) , & - intent(inout) :: au, & - cu, & - f1 - real(kind=kind_phys), dimension( im, km,nt ) , & - intent(inout) :: f2 -! - real(kind=kind_phys) :: fk - integer :: i,k,l,n,it -! -!------------------------------------------------------------------------------- -! - l = im - n = km -! - do i = 1,l - fk = 1./cm(i,1) - au(i,1) = fk*cu(i,1) - f1(i,1) = fk*r1(i,1) - enddo -! - do it = 1,nt - do i = 1,l - fk = 1./cm(i,1) - f2(i,1,it) = fk*r2(i,1,it) - enddo - enddo -! - do k = 2,n-1 - do i = 1,l - fk = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) - au(i,k) = fk*cu(i,k) - f1(i,k) = fk*(r1(i,k)-cl(i,k)*f1(i,k-1)) - enddo - enddo -! - do it = 1,nt - do k = 2,n-1 - do i = 1,l - fk = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) - f2(i,k,it) = fk*(r2(i,k,it)-cl(i,k)*f2(i,k-1,it)) - enddo - enddo - enddo -! - do i = 1,l - fk = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) - f1(i,n) = fk*(r1(i,n)-cl(i,n)*f1(i,n-1)) - enddo -! - do it = 1,nt - do i = 1,l - fk = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) - f2(i,n,it) = fk*(r2(i,n,it)-cl(i,n)*f2(i,n-1,it)) - enddo - enddo -! - do k = n-1,1,-1 - do i = 1,l - f1(i,k) = f1(i,k)-au(i,k)*f1(i,k+1) - enddo - enddo -! - do it = 1,nt - do k = n-1,1,-1 - do i = 1,l - f2(i,k,it) = f2(i,k,it)-au(i,k)*f2(i,k+1,it) - enddo - enddo - enddo -! - end subroutine tridi1n -!------------------------------------------------------------------------------- -! -!------------------------------------------------------------------------------- - subroutine tridin_ysu(cl,cm,cu,r2,au,f2,im,km,nt) - use machine , only : kind_phys -!------------------------------------------------------------------------------- - implicit none -!------------------------------------------------------------------------------- -! - integer, intent(in ) :: im, km, nt -! - real(kind=kind_phys), dimension( im, 2:km+1 ) , & - intent(in ) :: cl -! - real(kind=kind_phys), dimension( im, km ) , & - intent(in ) :: cm - real(kind=kind_phys), dimension( im, km,nt ) , & - intent(in ) :: r2 -! - real(kind=kind_phys), dimension( im, km ) , & - intent(inout) :: au, & - cu - real(kind=kind_phys), dimension( im, km,nt ) , & - intent(inout) :: f2 -! - real(kind=kind_phys) :: fk - integer :: i,k,l,n,it -! -!------------------------------------------------------------------------------- -! - l = im - n = km -! - do it = 1,nt - do i = 1,l - fk = 1./cm(i,1) - au(i,1) = fk*cu(i,1) - f2(i,1,it) = fk*r2(i,1,it) - enddo - enddo -! - do it = 1,nt - do k = 2,n-1 - do i = 1,l - fk = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) - au(i,k) = fk*cu(i,k) - f2(i,k,it) = fk*(r2(i,k,it)-cl(i,k)*f2(i,k-1,it)) - enddo - enddo - enddo -! - do it = 1,nt - do i = 1,l - fk = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) - f2(i,n,it) = fk*(r2(i,n,it)-cl(i,n)*f2(i,n-1,it)) - enddo - enddo -! - do it = 1,nt - do k = n-1,1,-1 - do i = 1,l - f2(i,k,it) = f2(i,k,it)-au(i,k)*f2(i,k+1,it) - enddo - enddo - enddo -! - end subroutine tridin_ysu -!------------------------------------------------------------------------------- -end module ysuvdif -!------------------------------------------------------------------------------- From 4086ec97e7feae9a83fb29d122e6bde504a45d37 Mon Sep 17 00:00:00 2001 From: Man Zhang Date: Fri, 7 Jun 2019 13:49:50 -0600 Subject: [PATCH 04/89] scidoc update --- physics/GFS_MP_generic.F90 | 2 +- physics/cnvc90.f | 2 +- physics/cs_conv.F90 | 67 +++++------ physics/cs_conv_aw_adj.F90 | 2 +- physics/docs/library.bib | 12 +- physics/docs/pdftxt/CPT_CSAW.txt | 11 +- physics/docs/pdftxt/CPT_adv_suite.txt | 24 ++-- physics/docs/pdftxt/GFSv15_suite.txt | 111 +++++++++--------- physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt | 113 +++++++++---------- physics/docs/pdftxt/GSD_THOMPSON.txt | 4 +- physics/docs/pdftxt/GSD_adv_suite.txt | 16 +-- physics/gfdl_fv_sat_adj.F90 | 2 +- physics/gwdc.f | 3 +- physics/gwdps.f | 2 +- physics/h2ophys.f | 2 +- physics/m_micro.F90 | 21 ++-- physics/module_bl_mynn.F90 | 82 ++++++++------ physics/module_mp_thompson.F90 | 75 ++++++------ physics/module_sf_ruclsm.F90 | 8 +- physics/moninedmf.f | 2 +- physics/mp_thompson.F90 | 9 +- physics/ozphys_2015.f | 2 +- physics/radiation_aerosols.f | 14 --- physics/radlw_main.f | 2 +- physics/radsw_main.f | 2 +- physics/rayleigh_damp.f | 2 +- physics/samfdeepcnv.f | 2 +- physics/samfshalcnv.f | 2 +- physics/satmedmfvdif.F | 2 +- physics/sfc_diff.f | 2 +- physics/sfc_drv_ruc.F90 | 3 +- physics/sfc_nst.f | 2 +- physics/sfc_sice.f | 2 +- 33 files changed, 294 insertions(+), 313 deletions(-) diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 0aeada850..ea3466261 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -84,7 +84,7 @@ module GFS_MP_generic_post subroutine GFS_MP_generic_post_init end subroutine GFS_MP_generic_post_init -!>\defgroup gfs_calpreciptype GFS/GFDL calpreciptype Main +!>\defgroup gfs_calpreciptype GFS Precipitation Type Diagnostics Module !! \brief If dominant precip type is requested (i.e., Zhao-Carr MP scheme), 4 more algorithms in calpreciptype() !! will be called. the tallies are then summed in calwxt_dominant(). For GFDL cloud MP scheme, determine convective !! rain/snow by surface temperature; and determine explicit rain/snow by rain/snow coming out directly from MP. diff --git a/physics/cnvc90.f b/physics/cnvc90.f index 08dbbbc9d..800ccb5dc 100644 --- a/physics/cnvc90.f +++ b/physics/cnvc90.f @@ -12,7 +12,7 @@ module cnvc90 subroutine cnvc90_init() end subroutine cnvc90_init -!>\defgroup GFS_cnvc90 GFS cnvc90 Main +!>\defgroup GFS_cnvc90 GFS Convective Cloud Diagnostics Module !> @{ !! This module contains the calculation of fraction of convective cloud, !! pressure at bottom of convective cloud and at top of convective diff --git a/physics/cs_conv.F90 b/physics/cs_conv.F90 index d5c2e1011..cb0c0b98b 100644 --- a/physics/cs_conv.F90 +++ b/physics/cs_conv.F90 @@ -256,7 +256,7 @@ end subroutine cs_conv_init subroutine cs_conv_finalize() end subroutine cs_conv_finalize -!>\defgroup cs_scheme CPT Chikira-Sugiyama Cumulus Scheme Module +!>\defgroup cs_scheme Chikira-Sugiyama Cumulus Scheme Module !> \brief The subroutine contains the main driver for Chikira-Sugiyama convective scheme. !! !! \author Minoru Chikira @@ -531,13 +531,15 @@ subroutine cs_conv_run(IM , IJSDIM , KMAX , ntracp1 , NN, & enddo !DD following adapted from ras -!> -# Following RAS, separate total condensate to ice/water separately -!! - The ratio of ice cloud to cloud water is determined by a linear function +!> -# Following the Relaxed Arakawa Schubert Scheme (RAS; +!! Moorthi and Suarez 1992 \cite moorthi_and_suarez_1992 ), +!! separate total condensate between ice and water. +!! The ratio of cloud ice to cloud water is determined by a linear function !! of temperature: !!\f[ !! F_i(T)= (T_2-T)/(T_2-T_1) !!\f] -!! where T is temperature; \f$T_1\f$ and \f$T_2\f$ are set as tcf=263.16 +!! where T is temperature, and\f$T_1\f$ and \f$T_2\f$ are set as tcf=263.16 !! and tf= 233.16 if (clw(1,1,2) <= -999.0) then ! input ice/water are together do k=1,kmax @@ -572,7 +574,7 @@ subroutine cs_conv_run(IM , IJSDIM , KMAX , ntracp1 , NN, & ! !*************************************************************************************** ! -!> -# Calculate temperature at interfaces. +!> -# Calculate temperature at interfaces ! DO K=2,KMAX @@ -589,7 +591,7 @@ subroutine cs_conv_run(IM , IJSDIM , KMAX , ntracp1 , NN, & GDTM(I,1) = GDT(I,1) ! Is this a good approximation ? - Moorthi ENDDO -!> -# Initialize the sigma diagnostics. +!> -# Initialize the sigma diagnostics do n=1,nctp do k=1,kmax do i=ists,iens @@ -603,7 +605,7 @@ subroutine cs_conv_run(IM , IJSDIM , KMAX , ntracp1 , NN, & enddo enddo ! -!> -# Call cs_cumlus() for CS cumulus parameterization. +!> -# Call cs_cumlus() for the main CS cumulus parameterization call CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions otspt(1:ntr,1), otspt(1:ntr,2), & lprnt , ipr , & @@ -736,7 +738,7 @@ subroutine cs_conv_run(IM , IJSDIM , KMAX , ntracp1 , NN, & endif enddo -!> -# Multiplying mass fluxes by the time step +!> -# Multiply mass fluxes by the time step do k=1,kmax do i=1,ijsdim @@ -768,7 +770,7 @@ end subroutine cs_conv_run !************************************************************************ !>\ingroup cs_scheme -!! This subroutine includes cumulus parameterization with +!! Main subroutine for the cumulus parameterization with !! state-dependent entrainment rate developed by Minoru Chikira. !! !! - This routine works as the prognostic Arakawa-Schubert scheme @@ -777,7 +779,7 @@ end subroutine cs_conv_run !! - Specify OPT_CUMBGT to check water and energy budget. !! - Specify OPT_CUMCHK to check range of output values. !! -!! History: +!! History(yy/mm/dd): !! - 08/09/19(chikira) MIROC4.1 !! - 08/10/30(hiro) CMT modified !! - 08/11/11(chikira) Neggers et al. (2002) @@ -1102,8 +1104,8 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions enddo enddo !> -# Compute layer saturate moisture \f$Q_i\f$(GDQS) and -!! saturate moist static energy GDHS (see appendix B in -!! Chirika and Sugiyama (2010) \cite Chikira_2010) +!! saturate moist static energy (GDHS; see Appendix B in +!! Chikira and Sugiyama (2010) \cite Chikira_2010) DO K=1,KMAX DO I=ISTS,IENS esat = min(gdp(i,k), fpvs(gdt(i,k))) @@ -1137,7 +1139,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions !DDsigma - arguments added to get subcloud profiles in updraft ! so AW eddy flux tendencies can be computed -!> -# Call cumbas() to compute cloud base properties. +!> -# Call cumbas() to compute cloud base properties CALL CUMBAS(IJSDIM, KMAX , & !DD dimensions KB , GCYM(1,1,1) , KBMX , & ! output ntr , ntrq , & @@ -1150,7 +1152,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions ISTS , IENS , & !) ! input gctbl, gcqbl,gdq,gcwbl, gcqlbl, gcqibl, gctrbl) ! sub cloud tendencies ! -!> -# Compute CAPE and CIN. +!> -# Compute CAPE and CIN ! DO I=ISTS,IENS CAPE(i) = zero @@ -1181,7 +1183,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions ENDDO !DDsigma some initialization before summing over cloud type -!> -# Initialization before summing over cloud type +!> -# Initialize variables before summing over cloud types do k=1,kmax ! Moorthi do i=1,ijsdim lamdaprod(i,k) = one @@ -1221,7 +1223,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions ! before and after CUMUP (i.e. here), and inside the routine, in ! particular: gctm, gcqm, gcwm, gchm, gcwt, gclm, gcim,gctrm ! also, inside, check that no reads/writes out of bounds occur *DH -!> -# Call cumup() to compute in-cloud properties. +!> -# Call cumup() to compute in-cloud properties CALL CUMUP(IJSDIM, KMAX, NTR, ntrq, & !DD dimensions ACWF , & ! output GCLZ , GCIZ , GPRCIZ , GSNWIZ, & ! output @@ -1242,7 +1244,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions gctm , gcqm, gcwm, gchm, gcwt, gclm, gcim, gctrm, & ! additional incloud profiles and cloud top total water lprnt , ipr ) ! -!> -# Call cumbmx() to compute cloud base mass flux. +!> -# Call cumbmx() to compute cloud base mass flux CALL CUMBMX(IJSDIM, KMAX, & !DD dimensions CBMFX(1,CTP), & ! modified ACWF , GCYT(1,CTP), GDZM , & ! input @@ -1255,7 +1257,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions do i=ISTS,IENS if (flx_form) then -!> -# Initialize eddy fluxes for cloud type ctp +!> -# Initialize eddy fluxes for cloud types do k=1,kmax+1 sfluxtem(k) = zero qvfluxtem(k) = zero @@ -1278,7 +1280,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions km1 = k - 1 rhs_h = zero rhs_q = zero -!> -# Get environment variables interpolated to layer interface +!> -# Interpolate environment variables to layer interface GDQM = half * (GDQ(I,K,1) + GDQ(I,KM1,1)) ! as computed in cumup ! GDwM = half * (GDw(I,K) + GDw(I,KM1 )) GDlM = half * (GDQ(I,K,3) + GDQ(I,KM1,3)) @@ -1290,9 +1292,9 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions if (do_aw) then -!> -# Compute lamda for a cloud type (eqn 23 of Arakawa and Wu (2013)), -!! and then updraft area fraction -!! (sigmai, eqn 12 of Arakawa and We (2013)) +!> -# Compute lamda for a cloud type and then updraft area fraction +!! (sigmai) following Equations 23 and 12 of +!! Arakawa and Wu (2013) \cite arakawa_and_wu_2013 , respectively lamdai = mflx_e * rair * gdtm(i,k)*(one+epsvt*gdqm) & / (gdpm(i,k)*wcv(i,k)) @@ -1314,7 +1316,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions ! fsigma = 1.0 ! no aw effect, comment following lines to undo AW fsigma = one - sigma(i,k) -!> -# Compute tendencies based on mass flux, and tendencies based on condensation +!> -# Compute tendencies based on mass flux and condensation ! fsigma is the AW reduction of flux tendencies if(k == kbi) then @@ -1424,8 +1426,8 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions ! rhs_q = cbmfl*((gcwt(i)-gcqt(i,ctp)) - (gcym(i,k-1)*(gcwm(i,k-1)-gcqm(i,k-1)) + (GDw( I,K-1 )-gdq(i,k-1,1))*(gcyt(i,ctp)-gcym(i,k-1))) ) ! endif -!> -# Compute condesation, total precip production, frozen precip production, -!! heating due to freezing and total temperature tendency due to in cloud microphysics +!> -# Compute condensation, total precipitation production, frozen precipitation production, +!! heating due to freezing, and total temperature tendency due to in-cloud microphysics dqcondtem(i,km1) = -rhs_q ! condensation ! dqprectem(i,km1) = cbmfl * (GPRCIZ(i,k) + GSNWIZ(i,k)) dqprectem(i,km1) = tem * (GPRCIZ(i,k) + GSNWIZ(i,k)) ! total precip production @@ -1453,7 +1455,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions prectermfrz(i,k) = prectermfrz(i,k) + dfrzprectem(i,k) * delpinv frzterm(i,k) = frzterm(i,k) + dtfrztem(i,k) * delpinv -!> -# Compute flux tendencies - compute the vertical flux divergence +!> -# Compute flux tendencies and vertical flux divergence sfluxterm(i,k) = sfluxterm(i,k) - (sfluxtem(k+1) - sfluxtem(k)) * delpinv qvfluxterm(i,k) = qvfluxterm(i,k) - (qvfluxtem(k+1) - qvfluxtem(k)) * delpinv qlfluxterm(i,k) = qlfluxterm(i,k) - (qlfluxtem(k+1) - qlfluxtem(k)) * delpinv @@ -1501,7 +1503,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions enddo ! -!> -# Call cumflx() to compute Cloud Mass Flux & Precip. +!> -# Call cumflx() to compute cloud mass flux and precipitation CALL CUMFLX(IM , IJSDIM, KMAX , & !DD dimensions GMFX0 , GPRCI , GSNWI , CMDET, & ! output QLIQ , QICE , GTPRC0, & ! output @@ -1561,7 +1563,8 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions enddo enddo -!> -# Call cumdwn() to compute cumulus downdraft - Melt & Freeze & Evaporation. +!> -# Call cumdwn() to compute cumulus downdraft and assocated melt, freeze +!! and evaporation CALL CUMDWN(IM , IJSDIM, KMAX , NTR , ntrq , & ! DD dimensions GTT , GTQ , GTU , GTV , & ! modified GMFLX , & ! modified updraft+downdraft flux @@ -1585,7 +1588,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions ! enddo ! enddo -!> -# Call cumsbw() to compute cloud subsidence heating. +!> -# Call cumsbw() to compute cloud subsidence heating if (.not. flx_form) then ! Cloud Subsidence Heating ! -----------------------= @@ -1655,7 +1658,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions ENDDO ! if(do_aw .and. flx_form) then ! compute AW tendencies -!> -# Compute AW tendencies of T/ql/qi +!> -# Compute AW tendencies of T, ql and qi if(flx_form) then ! compute AW tendencies ! AW lump all heating together, compute qv term do k=1,kmax @@ -1733,7 +1736,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions ! enddo ! enddo ! -!> -# Call cumfxr() for tracer mass fixer without detrainment. +!> -# Call cumfxr() for tracer mass fixer without detrainment CALL CUMFXR(IM , IJSDIM, KMAX , NTR , & !DD dimensions GTQ , & ! modified GDQ , DELP , DELTA , KTMXT , IMFXR, & ! input @@ -3932,7 +3935,7 @@ SUBROUTINE CUMSBR & !! Tracer Subsidence END SUBROUTINE CUMSBR !********************************************************************* !>\ingroup cs_scheme -!! This subroutine calculates tracer mass fixer without deterainment +!! This subroutine calculates tracer mass fixer without detrainment. SUBROUTINE CUMFXR & ! Tracer mass fixer ( IM , IJSDIM, KMAX , NTR , & !DD dimensions GTR , & ! modified diff --git a/physics/cs_conv_aw_adj.F90 b/physics/cs_conv_aw_adj.F90 index 08d3f4516..871fbe213 100644 --- a/physics/cs_conv_aw_adj.F90 +++ b/physics/cs_conv_aw_adj.F90 @@ -1,7 +1,7 @@ !> \file cs_conv_aw_adj.F90 !! This file contains a subroutine to adjusts surface rainrate for conservation for CSAW. -!>\defgroup mod_cs_conv_aw_adj CPT cs_conv_aw_adj Module +!>\defgroup mod_cs_conv_aw_adj CSAW adjustment Module !! This module adjusts surface rainrate for conservation. !> @{ module cs_conv_aw_adj diff --git a/physics/docs/library.bib b/physics/docs/library.bib index dbc820d07..96f57cef5 100644 --- a/physics/docs/library.bib +++ b/physics/docs/library.bib @@ -1,13 +1,23 @@ %% This BibTeX bibliography file was created using BibDesk. %% http://bibdesk.sourceforge.net/ -%% Created for Man Zhang at 2019-06-05 10:35:17 -0600 +%% Created for Man Zhang at 2019-06-06 11:56:03 -0600 %% Saved with string encoding Unicode (UTF-8) +@article{moorthi_and_suarez_1992, + Author = {S. Moorthi and M.J. Suarez }, + Date-Added = {2019-06-06 17:51:50 +0000}, + Date-Modified = {2019-06-06 17:56:00 +0000}, + Journal = {Monthly Weather Review}, + Pages = {978-1002}, + Title = {Relaxed Arakawa-Schubert. A parameterization of moist convection for general circulation models}, + Volume = {120}, + Year = {1992}} + @article{Gettelman_et_al_2019, Author = {A. Gettelman and H. Morrison and K. Thayer-Calder and C. M. Zarzycki}, Date-Added = {2019-06-05 16:32:22 +0000}, diff --git a/physics/docs/pdftxt/CPT_CSAW.txt b/physics/docs/pdftxt/CPT_CSAW.txt index 781c9937a..b7e178f82 100644 --- a/physics/docs/pdftxt/CPT_CSAW.txt +++ b/physics/docs/pdftxt/CPT_CSAW.txt @@ -2,12 +2,13 @@ \page CSAW_scheme Scale-Aware Chikira-Sugiyama Scale-aware Convection Scheme with Arakawa-Wu Extension \section cs_descrip Description -Chikira-Sugiyama cumulus scheme (Chikira and Sugiyama (2010) \cite Chikira_2010) with prognostic closure and +The Chikira-Sugiyama cumulus scheme (Chikira and Sugiyama (2010) \cite Chikira_2010) with prognostic closure and Arakawa-Wu Scale-Aware extension \cite Arakawa_2013 is an offshoot of the prognostic Arakawa-Schubert scheme. -It is characterized by lateral entrainment rates that vertically varies depending on buoyancy and vertical -velocity of updraft air parcel following Gregory (2001) \cite Gregory_2001 and spectral representation of -cloud types according to updraft velocity at cloud base. Cloud base mass flux is determined by convective -kinetic energy closure. The entrainment rate tends to be large near cloud base because of the small updraft +It is characterized by a spectral representation of cloud types according to updraft velocity at cloud base, a level +at which the mass flux is determined by a convective kinetic energy closure. The +lateral entrainment rate vertically varies depending on the buoyancy and vertical +velocity of the updraft air parcel following Gregory (2001) \cite Gregory_2001 . + The entrainment rate tends to be large near cloud base because of the small updraft velocity near that level. Deep convection tends to be suppressed when convective available potential energy is small because of upward reduction of in-cloud moist static energy. Dry environment air significantly reduces in-cloud humidity mainly because of the large entrainment rate in the lower troposphere, which leads to suppression diff --git a/physics/docs/pdftxt/CPT_adv_suite.txt b/physics/docs/pdftxt/CPT_adv_suite.txt index fb4fb8c0a..53887139f 100644 --- a/physics/docs/pdftxt/CPT_adv_suite.txt +++ b/physics/docs/pdftxt/CPT_adv_suite.txt @@ -25,25 +25,18 @@ The advanced MGCSAW physics suite uses the parameterizations in the following or \section sdf_cpt_suite Suite Definition File -The advanced MGCSAW physics suite uses the parameterizations in the following order, as defined in \c FV3_CPT : +The advanced MGCSAW physics suite uses the parameterizations in the following order, as defined in \c suite_SCM_MGCSAW.xml : \code - + - - - fv_sat_adj - - GFS_time_vary_pre GFS_rrtmg_setup GFS_rad_time_vary GFS_phys_time_vary - stochastic_physics - stochastic_physics_sfc @@ -67,11 +60,12 @@ The advanced MGCSAW physics suite uses the parameterizations in the following or GFS_suite_interstitial_1 dcyc2t3 GFS_surface_generic_pre + GFS_surface_composites_pre GFS_suite_interstitial_2 - sfc_ex_coef + sfc_diff GFS_surface_loop_control_part1 sfc_nst_pre sfc_nst @@ -82,6 +76,7 @@ The advanced MGCSAW physics suite uses the parameterizations in the following or + GFS_surface_composites_post dcyc2t3_post sfc_diag sfc_diag_post @@ -119,15 +114,12 @@ The advanced MGCSAW physics suite uses the parameterizations in the following or cs_conv_aw_adj GFS_MP_generic_post sfc_sice_post - - - - - GFS_stochastics + maximum_hourly_diagnostics + \endcode \section cpt_nml_option Namelist Option @@ -160,7 +152,7 @@ The advanced MGCSAW physics suite uses the parameterizations in the following or dspheat = .true. hybedmf = .true. satmedmf = .false. - lheatstrg = .false. + lheatstrg = .true. random_clds = .true. trans_trac = .true. cnvcld = .true. diff --git a/physics/docs/pdftxt/GFSv15_suite.txt b/physics/docs/pdftxt/GFSv15_suite.txt index 428c1c4e7..ca931d614 100644 --- a/physics/docs/pdftxt/GFSv15_suite.txt +++ b/physics/docs/pdftxt/GFSv15_suite.txt @@ -36,25 +36,18 @@ The GFSv15 physics suite uses the parameterizations in the following order: \section sdf_gfsv15 Suite Definition File -The GFSv15 suite uses the parameterizations in the following order, as defined in \c FV3_GFS_v15 : +The GFSv15 suite uses the parameterizations in the following order, as defined in \c suite_SCM_GFS_v15.xml: \code - + - - - fv_sat_adj - - GFS_time_vary_pre GFS_rrtmg_setup GFS_rad_time_vary GFS_phys_time_vary - stochastic_physics - stochastic_physics_sfc @@ -78,11 +71,12 @@ The GFSv15 suite uses the parameterizations in the following order, as defined i GFS_suite_interstitial_1 dcyc2t3 GFS_surface_generic_pre + GFS_surface_composites_pre GFS_suite_interstitial_2 - sfc_ex_coef + sfc_diff GFS_surface_loop_control_part1 sfc_nst_pre sfc_nst @@ -93,6 +87,7 @@ The GFSv15 suite uses the parameterizations in the following order, as defined i + GFS_surface_composites_post dcyc2t3_post sfc_diag sfc_diag_post @@ -106,6 +101,7 @@ The GFSv15 suite uses the parameterizations in the following order, as defined i rayleigh_damp GFS_suite_stateout_update ozphys_2015 + h2ophys GFS_DCNV_generic_pre get_phi_fv3 GFS_suite_interstitial_3 @@ -127,11 +123,6 @@ The GFSv15 suite uses the parameterizations in the following order, as defined i maximum_hourly_diagnostics - - - GFS_stochastics - - \endcode @@ -196,51 +187,51 @@ The GFSv15 suite uses the parameterizations in the following order, as defined i &gfdl_cloud_microphysics_nml sedi_transport = .true. - do_sedi_heat = .false. - rad_snow = .true. - rad_graupel = .true. - rad_rain = .true. - const_vi = .F. - const_vs = .F. - const_vg = .F. - const_vr = .F. - vi_max = 1. - vs_max = 2. - vg_max = 12. - vr_max = 12. - qi_lim = 1. - prog_ccn = .false. - do_qa = .false. - fast_sat_adj = .false. - tau_l2v = 225. - tau_v2l = 150. - tau_g2v = 900. - rthresh = 10.e-6 - dw_land = 0.16 - dw_ocean = 0.10 - ql_gen = 1.0e-3 - ql_mlt = 1.0e-3 - qi0_crt = 8.0E-5 - qs0_crt = 1.0e-3 - tau_i2s = 1000. - c_psaci = 0.05 - c_pgacs = 0.01 - rh_inc = 0.30 - rh_inr = 0.30 - rh_ins = 0.30 - ccn_l = 300. - ccn_o = 100. - c_paut = 0.5 - c_cracw = 0.8 - use_ppm = .false. - use_ccn = .true. - mono_prof = .true. - z_slope_liq = .true. - z_slope_ice = .true. - de_ice = .false. - fix_negative = .true. - icloud_f = 1 - mp_time = 150. + do_sedi_heat = .false. + rad_snow = .true. + rad_graupel = .true. + rad_rain = .true. + const_vi = .F. + const_vs = .F. + const_vg = .F. + const_vr = .F. + vi_max = 1. + vs_max = 2. + vg_max = 12. + vr_max = 12. + qi_lim = 1. + prog_ccn = .false. + do_qa = .false. + fast_sat_adj = .false. + tau_l2v = 225. + tau_v2l = 150. + tau_g2v = 900. + rthresh = 10.e-6 + dw_land = 0.16 + dw_ocean = 0.10 + ql_gen = 1.0e-3 + ql_mlt = 1.0e-3 + qi0_crt = 8.0E-5 + qs0_crt = 1.0e-3 + tau_i2s = 1000. + c_psaci = 0.05 + c_pgacs = 0.01 + rh_inc = 0.30 + rh_inr = 0.30 + rh_ins = 0.30 + ccn_l = 300. + ccn_o = 100. + c_paut = 0.5 + c_cracw = 0.8 + use_ppm = .false. + use_ccn = .true. + mono_prof = .true. + z_slope_liq = .true. + z_slope_ice = .true. + de_ice = .false. + fix_negative = .true. + icloud_f = 1 + mp_time = 150. / \endcode diff --git a/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt b/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt index cbcf6d849..dab159d71 100644 --- a/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt +++ b/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt @@ -26,25 +26,18 @@ This physics suite is the same as GFSv15 physics suite with \ref GFS_SATMEDMF r \section sdf_gfsv15p Suite Definition File -The GFSv15plus suite uses the parameterizations in the following order, as defined in \c FV3_GFS_v15plus : +The GFSv15plus suite uses the parameterizations in the following order, as defined in \c suite_SCM_GFS_v15plus.xml : \code - + - - - fv_sat_adj - - GFS_time_vary_pre GFS_rrtmg_setup GFS_rad_time_vary GFS_phys_time_vary - stochastic_physics - stochastic_physics_sfc @@ -68,11 +61,12 @@ The GFSv15plus suite uses the parameterizations in the following order, as defin GFS_suite_interstitial_1 dcyc2t3 GFS_surface_generic_pre + GFS_surface_composites_pre GFS_suite_interstitial_2 - sfc_ex_coef + sfc_diff GFS_surface_loop_control_part1 sfc_nst_pre sfc_nst @@ -83,12 +77,13 @@ The GFSv15plus suite uses the parameterizations in the following order, as defin + GFS_surface_composites_post dcyc2t3_post sfc_diag sfc_diag_post GFS_surface_generic_post GFS_PBL_generic_pre - hedmf + satmedmfvdif GFS_PBL_generic_post gwdps_pre gwdps @@ -96,6 +91,7 @@ The GFSv15plus suite uses the parameterizations in the following order, as defin rayleigh_damp GFS_suite_stateout_update ozphys_2015 + h2ophys GFS_DCNV_generic_pre get_phi_fv3 GFS_suite_interstitial_3 @@ -117,11 +113,6 @@ The GFSv15plus suite uses the parameterizations in the following order, as defin maximum_hourly_diagnostics - - - GFS_stochastics - - \endcode @@ -186,51 +177,51 @@ The GFSv15plus suite uses the parameterizations in the following order, as defin &gfdl_cloud_microphysics_nml sedi_transport = .true. - do_sedi_heat = .false. - rad_snow = .true. - rad_graupel = .true. - rad_rain = .true. - const_vi = .F. - const_vs = .F. - const_vg = .F. - const_vr = .F. - vi_max = 1. - vs_max = 2. - vg_max = 12. - vr_max = 12. - qi_lim = 1. - prog_ccn = .false. - do_qa = .false. - fast_sat_adj = .false. - tau_l2v = 225. - tau_v2l = 150. - tau_g2v = 900. - rthresh = 10.e-6 - dw_land = 0.16 - dw_ocean = 0.10 - ql_gen = 1.0e-3 - ql_mlt = 1.0e-3 - qi0_crt = 8.0E-5 - qs0_crt = 1.0e-3 - tau_i2s = 1000. - c_psaci = 0.05 - c_pgacs = 0.01 - rh_inc = 0.30 - rh_inr = 0.30 - rh_ins = 0.30 - ccn_l = 300. - ccn_o = 100. - c_paut = 0.5 - c_cracw = 0.8 - use_ppm = .false. - use_ccn = .true. - mono_prof = .true. - z_slope_liq = .true. - z_slope_ice = .true. - de_ice = .false. - fix_negative = .true. - icloud_f = 1 - mp_time = 150. + do_sedi_heat = .false. + rad_snow = .true. + rad_graupel = .true. + rad_rain = .true. + const_vi = .F. + const_vs = .F. + const_vg = .F. + const_vr = .F. + vi_max = 1. + vs_max = 2. + vg_max = 12. + vr_max = 12. + qi_lim = 1. + prog_ccn = .false. + do_qa = .false. + fast_sat_adj = .false. + tau_l2v = 225. + tau_v2l = 150. + tau_g2v = 900. + rthresh = 10.e-6 + dw_land = 0.16 + dw_ocean = 0.10 + ql_gen = 1.0e-3 + ql_mlt = 1.0e-3 + qi0_crt = 8.0E-5 + qs0_crt = 1.0e-3 + tau_i2s = 1000. + c_psaci = 0.05 + c_pgacs = 0.01 + rh_inc = 0.30 + rh_inr = 0.30 + rh_ins = 0.30 + ccn_l = 300. + ccn_o = 100. + c_paut = 0.5 + c_cracw = 0.8 + use_ppm = .false. + use_ccn = .true. + mono_prof = .true. + z_slope_liq = .true. + z_slope_ice = .true. + de_ice = .false. + fix_negative = .true. + icloud_f = 1 + mp_time = 150. / \endcode diff --git a/physics/docs/pdftxt/GSD_THOMPSON.txt b/physics/docs/pdftxt/GSD_THOMPSON.txt index d3ef00dd4..2598d3174 100644 --- a/physics/docs/pdftxt/GSD_THOMPSON.txt +++ b/physics/docs/pdftxt/GSD_THOMPSON.txt @@ -1,6 +1,6 @@ /** -\page GSD_THOMPSON Thompson Aerosol-Aware Microphysics Scheme -\section thompson_descrp Description +\page GSD_THOMPSON Aerosol-Aware Thompson Microphysics Scheme +\section thompson_descrp Description The GSD RAP/HRRR microphysics implementation represents the most aggressive attempt to include explicit prediction of diff --git a/physics/docs/pdftxt/GSD_adv_suite.txt b/physics/docs/pdftxt/GSD_adv_suite.txt index 3d1b79f1d..16de26c63 100644 --- a/physics/docs/pdftxt/GSD_adv_suite.txt +++ b/physics/docs/pdftxt/GSD_adv_suite.txt @@ -40,11 +40,11 @@ The advanced GSD RAP/HRRR physics suite uses the parameterizations in the follow \section sdf_gsdsuite Suite Definition File -The GSD RAP/HRRR physics suite uses the parameterizations in the following order, as defined in \c FV3_GSD: +The GSD RAP/HRRR physics suite uses the parameterizations in the following order, as defined in \c suite_SCM_GSD_v0.xml : \code - + @@ -52,8 +52,6 @@ The GSD RAP/HRRR physics suite uses the parameterizations in the following order GFS_rrtmg_setup GFS_rad_time_vary GFS_phys_time_vary - stochastic_physics - stochastic_physics_sfc @@ -79,11 +77,12 @@ The GSD RAP/HRRR physics suite uses the parameterizations in the following order GFS_suite_interstitial_1 dcyc2t3 GFS_surface_generic_pre + GFS_surface_composites_pre GFS_suite_interstitial_2 - sfc_ex_coef + sfc_diff GFS_surface_loop_control_part1 sfc_nst_pre sfc_nst @@ -93,6 +92,7 @@ The GSD RAP/HRRR physics suite uses the parameterizations in the following order + GFS_surface_composites_post dcyc2t3_post sfc_diag sfc_diag_post @@ -124,11 +124,7 @@ The GSD RAP/HRRR physics suite uses the parameterizations in the following order mp_thompson_post GFS_MP_generic_post cu_gf_driver_post - - - - - GFS_stochastics + maximum_hourly_diagnostics diff --git a/physics/gfdl_fv_sat_adj.F90 b/physics/gfdl_fv_sat_adj.F90 index b4b273595..32f360034 100644 --- a/physics/gfdl_fv_sat_adj.F90 +++ b/physics/gfdl_fv_sat_adj.F90 @@ -227,7 +227,7 @@ subroutine fv_sat_adj_finalize (errmsg, errflg) end subroutine fv_sat_adj_finalize -!>\defgroup fast_sat_adj GFDL In-Core Fast Saturation Adjustment +!>\defgroup fast_sat_adj GFDL In-Core Fast Saturation Adjustment Module !> @{ !! The subroutine 'fv_sat_adj' implements the fast processes in the GFDL !! Cloud MP. It is part of the GFDL Cloud MP. diff --git a/physics/gwdc.f b/physics/gwdc.f index d25e8b533..48e78cb44 100644 --- a/physics/gwdc.f +++ b/physics/gwdc.f @@ -116,8 +116,7 @@ module gwdc subroutine gwdc_init() end subroutine gwdc_init -! \defgroup GFS_cgwd GFS Convective Gravity Wave Drag -!> \defgroup GFS_gwdc_run GFS gwdc Main +!> \defgroup GFS_gwdc_run GFS Convective Gravity Wave Drag Scheme Module !! \brief This subroutine is the parameterization of convective gravity wave !! drag based on the theory given by Chun and Baik (1998) !! \cite chun_and_baik_1998 modified for implementation into the diff --git a/physics/gwdps.f b/physics/gwdps.f index 8784a2f6d..ab81603e6 100644 --- a/physics/gwdps.f +++ b/physics/gwdps.f @@ -150,7 +150,7 @@ module gwdps subroutine gwdps_init() end subroutine gwdps_init -!> \defgroup gfs_gwdps GFS gwdps Main +!> \defgroup gfs_gwdps GFS Orographic Gravity Wave Drag and Mountain Blocking Scheme Module !! \brief This subroutine includes orographic gravity wave drag and mountain !! blocking. !! diff --git a/physics/h2ophys.f b/physics/h2ophys.f index 51e3a6051..287cfa3d3 100644 --- a/physics/h2ophys.f +++ b/physics/h2ophys.f @@ -19,7 +19,7 @@ module h2ophys subroutine h2ophys_init() end subroutine h2ophys_init -!>\defgroup GFS_h2ophys GFS h2ophys Main +!>\defgroup GFS_h2ophys GFS Water Vapor Photochemical Production and Loss Module !> This subroutine is NRL H2O physics for stratosphere and mesosphere. !! \section arg_table_h2ophys_run Argument Table !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | diff --git a/physics/m_micro.F90 b/physics/m_micro.F90 index f973842f0..4edeec95e 100644 --- a/physics/m_micro.F90 +++ b/physics/m_micro.F90 @@ -137,7 +137,7 @@ end subroutine m_micro_init subroutine m_micro_finalize end subroutine m_micro_finalize -!> \defgroup mg2mg3 CPT Morrison-Gettelman MP scheme Module +!> \defgroup mg2mg3 Morrison-Gettelman MP scheme Module !! This module contains the the entity of MG2 and MG3 schemes. !> @{ !> \defgroup mg_driver Morrison-Gettelman MP Driver Module @@ -764,7 +764,7 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & !======================================================================================================================= !======================================================================================================================= !> -# Nucleation of cloud droplets and ice crystals -!! Aerosol cloud interactions. Calculate maxCCN tendency using Fountoukis and nenes (2005) or Abdul Razzak and Ghan (2002) +!! Aerosol cloud interactions. Calculate maxCCN tendency using Fountoukis and Nenes (2005) or Abdul Razzak and Ghan (2002) !! liquid Activation Parameterization !! Ice activation follows the Barahona & Nenes ice activation scheme, ACP, (2008, 2009). !! Written by Donifan Barahona and described in Barahona et al. (2013) @@ -794,7 +794,7 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & AERMASSMIX(:,:,1:5) = 1.e-6 AERMASSMIX(:,:,6:15) = 2.e-14 end if -!> - Call aerConversion1() +!> - Call aerconversion1() call AerConversion1 (AERMASSMIX, AeroProps) deallocate(AERMASSMIX) @@ -866,7 +866,7 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & ! ==================================================================== -!> -# Call gw_prof() to Calculate subgrid scale distribution in vertical velocity +!> -# Call gw_prof() to calculate subgrid scale distribution in vertical velocity ! ==================================================================== @@ -885,7 +885,7 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & wparc_cgw(k) = 0.0 end do -!> - Subgrid variability from Convective Sources According to Barahona et al. 2014 in prep +!> - Subgrid variability from convective sources according to Barahona et al. 2014 (in preparation) if (kcldtopcvn > 20) then @@ -946,7 +946,7 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & -!> - Compute Total variance +!> - Compute total variance do K = 1, LM swparc(k) = sqrt(wparc_gw(k) * wparc_gw(k) & @@ -986,7 +986,7 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & ! &,' ccn_param=',ccn_param,' in_param=',in_param & ! &,' AeroAux%kap=',AeroAux%kap -!> -# Call aerosol_activate() to activate the aerosols. +!> -# Call aerosol_activate() to activate the aerosols call aerosol_activate(tauxr8, plevr8(K), swparc(K), & & wparc_ls(K), AeroAux, npre8(k), dpre8(k), ccn_diag, & & ndropr8(k), npccninr8(K), smaxliq(K), & @@ -1081,7 +1081,7 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & !===========================End cloud particle nucleation======================= ! ----------------------------- ! -!> -# Begin Cloud Macrophysics +!> -# Begin cloud macrophysics ! do k=1,lm ! do i=1,im @@ -1145,7 +1145,7 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & ! call macro_cloud (IM, LM, DT_MOIST, PLO, PLE, PK, FRLAND, & ! call macro_cloud (IM, LM, DT_MOIST, PLO, PLE, FRLAND, & -!> - Call macro_cloud() for cloud macrophysics. +!> - Call macro_cloud() for cloud macrophysics call macro_cloud (IM, LM, DT_MOIST, alf_fac, PLO, PLE, & & CNV_DQLDT, & ! & CNV_MFD, CNV_DQLDT, & @@ -1215,7 +1215,7 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & !============ Put cloud fraction back in contact with the PDF (Barahona et al., GMD, 2014)============ !make sure QI , NI stay within T limits -!> - Call meltfrz_inst() to calculate instantaneous freezing or condensate. +!> - Call meltfrz_inst() to calculate instantaneous freezing or condensate call meltfrz_inst(IM, LM, TEMP, QLLS, QLCN, QILS, QICN, NCPL, NCPI) @@ -1345,6 +1345,7 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & ! else ! call init_Aer(AeroAux) ! end if +!> - Call getinsubset() to extract dust properties call getINsubset(1, AeroAux, AeroAux_b) naux = AeroAux_b%nmods if (nbincontactdust < naux) then diff --git a/physics/module_bl_mynn.F90 b/physics/module_bl_mynn.F90 index 3638dcf1b..46ee57d3d 100644 --- a/physics/module_bl_mynn.F90 +++ b/physics/module_bl_mynn.F90 @@ -4,27 +4,35 @@ !WRF:MODEL_LAYER:PHYSICS ! -!>\defgroup gsd_mynn_edmf GSD MYNN-EDMF PBL Scheme -!! This module is translated from Nakanishi and Niino (2009) \cite NAKANISHI_2009 -!! f77 to F90 and put into WRF by Mariusz Pagowski -!! NOAA/GSD & CIRA/CSU, Feb 2008. -!! Changes to original code: -!! -# code is 1D (in z) -!! -# no advection of TKE, covariances and variances +!>\defgroup gsd_mynn_edmf GSD MYNN-EDMF PBL Scheme Module +!! The MYNN-EDMF scheme (Olson et al. 2019 \cite olson_et_al_2019) represents the local +!! mixing using an eddy-diffusivity approach tied to turbulent kinetic energy (TKE). +!! The nonlocal mixing, important for convective boundary layers, is represented using +!! a mass-flux approach. The scheme can be run with either a 2.5 or 3.0 closure and includes +!! a partial-condensation scheme, commonly referred to as a cloud PDF or statistical-cloud +!! scheme, to represent the effects of subgrid-scale (SGS) clouds on buoyancy. +!! This module was originally translated from Nakanishi and Niino (2009) \cite NAKANISHI_2009 +!! and put into the WRF model by Mariusz Pagowski NOAA/GSD and CIRA/CSU in 2008. It was +!! extensively modified by Joseph Olson and Jaymes Kenyon of NOAA/GSD and CU/CIRES. +!! +!! Changes to original code introduced by M. Pagowski in 2008: +!! -# Code is 1D (in z) +!! -# No advection of TKE, covariances and variances !! -# Cranck-Nicholson replaced with the implicit scheme -!! -# removed terrain dependent grid since input in WRF in actual distances in z[m] -!! -# cosmetic changes to adhere to WRF standard (remove common blocks, intent etc) +!! -# Removed terrain dependent grid since input in WRF in actual distances in z[m] +!! -# Cosmetic changes to adhere to WRF standard (remove common blocks, intent etc) !! -!!Modifications implemented by Joseph Olson and Jaymes Kenyon NOAA/GSD/MDB - CU/CIRES +!! Further modifications implemented by J. Olson and J. Kenyon: !! !! Departures from original MYNN (Nakanish and Niino (2009) \cite NAKANISHI_2009) -!! -# Addition of BouLac mixing length in the free atmosphere. +!! -# Added the of BouLac mixing length in the free atmosphere. !! -# Changed the turbulent mixing length to be integrated from the -!! surface to the top of the BL + a transition layer depth. +!! surface to the top of the BL plus a transition layer depth. !! +!! Changes made in various versions of the WRF model: !!\version v3.4.1: !! - Option to use Kitamura/Canuto modification which removes -!! the critical Richardson number and negative TKE (default). +!! the critical Richardson number and negative TKE (default) !! - Hybrid PBL height diagnostic, which blends a theta-v-based !! definition in neutral/convective BL and a TKE-based definition !! in stable conditions. @@ -32,7 +40,7 @@ !!\version v3.5.0: !! - TKE advection option (bl_mynn_tkeadvect) !!\version v3.5.1: -!! - Fog deposition related changes. +!! - Fog deposition related changes !!\version v3.6.0: !! - Removed fog deposition from the calculation of tendencies !! - Added mixing of qc, qi, qni @@ -40,10 +48,10 @@ !! coupling to shcu schemes !!\version v3.8.0: !! - Added subgrid scale cloud output for coupling to radiation -!! schemes (activated by setting icloud_bl =1 in phys namelist). +!! schemes (activated by setting icloud_bl =1 in phys namelist) !! - Added WRF_DEBUG prints (at level 3000) -!! - Added Tripoli and Cotton (1981) \cite Tripoli_1981 correction. -!! - Added namelist option bl_mynn_cloudmix to test effect of mixing cloud species (default = 1: on). +!! - Added Tripoli and Cotton (1981) \cite Tripoli_1981 correction +!! - Added namelist option bl_mynn_cloudmix to test effect of mixing cloud species (default = 1: on) !! - Added mass-flux option (bl_mynn_edmf, = 1 for DMP mass-flux, 0: off). Related options: !! - bl_mynn_edmf_mom = 1 : activate momentum transport in MF scheme !! - bl_mynn_edmf_tke = 1 : activate TKE transport in MF scheme @@ -52,56 +60,56 @@ !! - Added new cloud PDF option (bl_mynn_cloudpdf = 2) from Chaboureau !! and Bechtold (2002) \cite Chaboureau_2002 with modifications !! - Added capability to mix chemical species when env variable -!! WRF_CHEM = 1, thanks to Wayne Angevine. +!! WRF_CHEM = 1, thanks to Wayne Angevine !! - Added scale-aware mixing length, following Junshi Ito's work -!! Ito et al. (2015, BLM) \cite Ito_2015. +!! Ito et al. (2015, BLM) \cite Ito_2015 !!\version v3.9.0: !! - Improvement to the mass-flux scheme (dynamic number of plumes, -!! better plume/cloud depth, significant speed up, better cloud fraction). -!! - Added Stochastic Parameter Perturbation (SPP) implementation. +!! better plume/cloud depth, significant speed up, better cloud fraction) +!! - Added Stochastic Parameter Perturbation (SPP) implementation !! - Many miscellaneous tweaks to the mixing lengths and stratus -!! component of the subgrid clouds. +!! component of the subgrid clouds !!\version v4.0: !! - Removed or added alternatives to WRF-specific functions/modules -!! for the sake of portability to other models. +!! for the sake of portability to other models !! - Further refinement of mass-flux scheme from SCM experiments with !! Wayne Angevine: switch to linear entrainment and back to -!! Simpson and Wiggert-type w-equation. +!! Simpson and Wiggert-type w-equation !! - Addition of TKE production due to radiation cooling at top of -!! clouds (proto-version); not activated by default. +!! clouds (proto-version); not activated by default !! - Some code rewrites to move if-thens out of loops in an attempt to -!! improve computational efficiency. +!! improve computational efficiency !! - New tridiagonal solver, which is supposedly 14% faster and more -!! conservative. Impact seems very small. +!! conservative. Impact seems very small !! - Many miscellaneous tweaks to the mixing lengths and stratus -!! component of the subgrid-scale (SGS) clouds. +!! component of the subgrid-scale (SGS) clouds !!\version v4.1: !! - Big improvements in downward SW radiation due to revision of subgrid clouds -!! - better cloud fraction and subgrid scale mixing ratios. +!! - better cloud fraction and subgrid scale mixing ratios !! - may experience a small cool bias during the daytime now that high -!! SW-down bias is greatly reduced... +!! SW-down bias is greatly reduced !! - Some tweaks to increase the turbulent mixing during the daytime for -!! bl_mynn_mixlength option 2 to alleviate cool bias (very small impact). -!! - Improved ensemble spread from changes to SPP in MYNN +!! bl_mynn_mixlength option 2 to alleviate cool bias (very small impact) +!! - Improved ensemble spread from changes to Stochastic Parameter Perturbation (SPP) in MYNN !! - now perturbing eddy diffusivity and eddy viscosity directly !! - now perturbing background rh (in SGS cloud calc only) !! - now perturbing entrainment rates in mass-flux scheme !! - Added IF checks (within IFDEFS) to protect mixchem code from being used -!! when HRRR smoke is used (no impact on regular non-wrf chem use) -!! - Important bug fix for wrf chem when transporting chemical species in MF scheme +!! when HRRR smoke is used (no impact when WRF-CHEM is not used) +!! - Important bug fix for WRF-CHEM when transporting chemical species in MF scheme !! - Removed 2nd mass-flux scheme (no only bl_mynn_edmf = 1, no option 2) !! - Removed unused stochastic code for mass-flux scheme !! - Changed mass-flux scheme to be integrated on interface levels instead of !! mass levels - impact is small -!! - Added option to mix 2nd moments in MYNN as opposed to the scalar_pblmix option. +!! - Added option to mix second moments in MYNN as opposed to the scalar_pblmix option. !! - activated with bl_mynn_mixscalars = 1; this sets scalar_pblmix = 0 !! - added tridagonal solver used in scalar_pblmix option to duplicate tendencies -!! - this alone changes the interface call considerably from v4.0. +!! - this alone changes the interface call considerably from v4.0 !! - Slight revision to TKE production due to radiation cooling at top of clouds !! - Added the non-Guassian buoyancy flux function of Bechtold and Siebesma (1998) \cite Bechtold_1998 !! - improves TKE in SGS clouds !! - Added heating due to dissipation of TKE (small impact, maybe + 0.1 C daytime PBL temp) -!! - Misc changes made for FV3/MPAS compatibility +!! - Miscellaneous changes made for FV3/MPAS compatibility !! !!Many of these changes are now documented in Olson et al. (2019, !! NOAA Technical Memorandum) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index 1113377ba..da5cd2c2a 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -501,22 +501,22 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & !> - From Martin et al. (1994), assign gamma shape parameter mu for cloud !! drops according to general dispersion characteristics (disp=~0.25 -!! for Maritime and 0.45 for Continental). +!! for maritime and 0.45 for continental) !.. disp=SQRT((mu+2)/(mu+1) - 1) so mu varies from 15 for Maritime !.. to 2 for really dirty air. This not used in 2-moment cloud water !.. scheme and nu_c used instead and varies from 2 to 15 (integer-only). mu_c = MIN(15., (1000.E6/Nt_c + 2.)) -!> - Compute Schmidt number to one-third used numerous times. +!> - Compute Schmidt number to one-third used numerous times Sc3 = Sc**(1./3.) -!> - Compute min ice diam from mass, min snow/graupel mass from diam. +!> - Compute minimum ice diam from mass, min snow/graupel mass from diam D0i = (xm0i/am_i)**(1./bm_i) xm0s = am_s * D0s**bm_s xm0g = am_g * D0g**bm_g -!> - Compute constants various exponents and gamma() assoc with cloud, -!! rain, snow, and graupel. +!> - Compute constants various exponents and gamma() associated with cloud, +!! rain, snow, and graupel do n = 1, 15 cce(1,n) = n + 1. cce(2,n) = bm_r + n + 1. @@ -621,7 +621,7 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & ogg3 = 1./cgg(3) !+---+-----------------------------------------------------------------+ -!> - Simplify various rate eqns the best we can now. +!> - Simplify various rate equations !+---+-----------------------------------------------------------------+ !> - Compute rain collecting cloud water and cloud ice @@ -629,36 +629,36 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & t1_qr_qi = PI*.25*av_r * crg(9) t2_qr_qi = PI*.25*am_r*av_r * crg(8) -!> - Compute Graupel collecting cloud water +!> - Compute graupel collecting cloud water t1_qg_qc = PI*.25*av_g * cgg(9) -!> - Compute Snow collecting cloud water +!> - Compute snow collecting cloud water t1_qs_qc = PI*.25*av_s -!> - Compute Snow collecting cloud ice +!> - Compute snow collecting cloud ice t1_qs_qi = PI*.25*av_s -!> - Compute Evaporation of rain; ignore depositional growth of rain. +!> - Compute evaporation of rain; ignore depositional growth of rain t1_qr_ev = 0.78 * crg(10) t2_qr_ev = 0.308*Sc3*SQRT(av_r) * crg(11) -!> - Compute Sublimation/depositional growth of snow +!> - Compute sublimation/depositional growth of snow t1_qs_sd = 0.86 t2_qs_sd = 0.28*Sc3*SQRT(av_s) -!> - Compute Melting of snow +!> - Compute melting of snow t1_qs_me = PI*4.*C_sqrd*olfus * 0.86 t2_qs_me = PI*4.*C_sqrd*olfus * 0.28*Sc3*SQRT(av_s) -!> - Compute Sublimation/depositional growth of graupel +!> - Compute sublimation/depositional growth of graupel t1_qg_sd = 0.86 * cgg(10) t2_qg_sd = 0.28*Sc3*SQRT(av_g) * cgg(11) -!> - Compute Melting of graupel +!> - Compute melting of graupel t1_qg_me = PI*4.*C_cube*olfus * 0.86 * cgg(10) t2_qg_me = PI*4.*C_cube*olfus * 0.28*Sc3*SQRT(av_g) * cgg(11) -!> - Compute Constants for helping find lookup table indexes. +!> - Compute constants for helping find lookup table indexes nic2 = NINT(ALOG10(r_c(1))) nii2 = NINT(ALOG10(r_i(1))) nii3 = NINT(ALOG10(Nt_i(1))) @@ -669,7 +669,7 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & nig3 = NINT(ALOG10(N0g_exp(1))) niIN2 = NINT(ALOG10(Nt_IN(1))) -!> - Create bins of cloud water (from min diameter up to 100 microns). +!> - Create bins of cloud water (from min diameter up to 100 microns) Dc(1) = D0c*1.0d0 dtc(1) = D0c*1.0d0 do n = 2, nbc @@ -677,7 +677,7 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & dtc(n) = (Dc(n) - Dc(n-1)) enddo -!> - Create bins of cloud ice (from min diameter up to 5x min snow size). +!> - Create bins of cloud ice (from min diameter up to 5x min snow size) xDx(1) = D0i*1.0d0 xDx(nbi+1) = 5.0d0*D0s do n = 2, nbi @@ -689,7 +689,7 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & dti(n) = xDx(n+1) - xDx(n) enddo -!> - Create bins of rain (from min diameter up to 5 mm). +!> - Create bins of rain (from min diameter up to 5 mm) xDx(1) = D0r*1.0d0 xDx(nbr+1) = 0.005d0 do n = 2, nbr @@ -701,7 +701,7 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & dtr(n) = xDx(n+1) - xDx(n) enddo -!> - Create bins of snow (from min diameter up to 2 cm). +!> - Create bins of snow (from min diameter up to 2 cm) xDx(1) = D0s*1.0d0 xDx(nbs+1) = 0.02d0 do n = 2, nbs @@ -713,7 +713,7 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & dts(n) = xDx(n+1) - xDx(n) enddo -!> - Create bins of graupel (from min diameter up to 5 cm). +!> - Create bins of graupel (from min diameter up to 5 cm) xDx(1) = D0g*1.0d0 xDx(nbg+1) = 0.05d0 do n = 2, nbg @@ -725,7 +725,7 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & dtg(n) = xDx(n+1) - xDx(n) enddo -!> - Create bins of cloud droplet number concentration (1 to 3000 per cc). +!> - Create bins of cloud droplet number concentration (1 to 3000 per cc) xDx(1) = 1.0d0 xDx(nbc+1) = 3000.0d0 do n = 2, nbc @@ -738,7 +738,7 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & nic1 = DLOG(t_Nc(nbc)/t_Nc(1)) !+---+-----------------------------------------------------------------+ -!> - Create lookup tables for most costly calculations. +!> - Create lookup tables for most costly calculations !+---+-----------------------------------------------------------------+ ! Assign mpicomm to module variable @@ -876,20 +876,20 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & !> - Call table_ccnact() to read a static file containing CCN activation of aerosols. The !! data were created from a parcel model by Feingold & Heymsfield with -!! further changes by Eidhammer and Kriedenweis. +!! further changes by Eidhammer and Kriedenweis ! This computation is cheap compared to the others below, and ! doing it always ensures that the correct data is in the SIONlib ! file containing the precomputed tables *DH WRITE (*,*) ' calling table_ccnAct routine' call table_ccnAct -!> - Call table_efrw() and table_Efsw() to creat collision efficiency table -!! between rain/snow and cloud water. +!> - Call table_efrw() and table_efsw() to creat collision efficiency table +!! between rain/snow and cloud water WRITE (*,*)' creating qc collision eff tables' call table_Efrw call table_Efsw -!> - Call table_dropevap() to creat rain drop evaporation table. +!> - Call table_dropevap() to creat rain drop evaporation table WRITE(*,*) ' creating rain evap table' call table_dropEvap @@ -898,7 +898,7 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & end if precomputed_tables_1 -!> - Call radar_init() to initialize various constants for computing radar reflectivity. +!> - Call radar_init() to initialize various constants for computing radar reflectivity call cpu_time(stime) xam_r = am_r xbm_r = bm_r @@ -925,7 +925,7 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & !$OMP sections !$OMP section -!> - Call qr_acr_qg() to create rain collecting graupel & graupel collecting rain table. +!> - Call qr_acr_qg() to create rain collecting graupel & graupel collecting rain table WRITE (*,*) ' creating rain collecting graupel table' call cpu_time(stime) call qr_acr_qg @@ -933,7 +933,7 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & if (mpirank==mpiroot) print '("Computing rain collecting graupel table took ",f10.3," seconds.")', etime-stime !$OMP section -!> - Call qr_acr_qs() to create rain collecting snow & snow collecting rain table. +!> - Call qr_acr_qs() to create rain collecting snow & snow collecting rain table WRITE (*,*) ' creating rain collecting snow table' call cpu_time(stime) call qr_acr_qs @@ -944,14 +944,14 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & !$OMP end parallel -!> - Call freezeh2o() to create cloud water and rain freezing (Bigg, 1953) table. +!> - Call freezeh2o() to create cloud water and rain freezing (Bigg, 1953) table WRITE (*,*) ' creating freezing of water drops table' call cpu_time(stime) call freezeH2O(threads) call cpu_time(etime) if (mpirank==mpiroot) print '("Computing freezing of water drops table took ",f10.3," seconds.")', etime-stime -!> - Call qi_aut_qs() to create conversion of some ice mass into snow category. +!> - Call qi_aut_qs() to create conversion of some ice mass into snow category WRITE (*,*) ' creating ice converting to snow table' call cpu_time(stime) call qi_aut_qs @@ -989,7 +989,6 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & endif if_micro_init END SUBROUTINE thompson_init - !> @} !>\ingroup aathompson @@ -3697,7 +3696,8 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & enddo end subroutine mp_thompson -! >@} +!>@} + !+---+-----------------------------------------------------------------+ !ctrlL !+---+-----------------------------------------------------------------+ @@ -4757,9 +4757,11 @@ end function activ_ncloud !+---+-----------------------------------------------------------------+ !+---+-----------------------------------------------------------------+ !>\ingroup aathompson +!! Returns the incomplete gamma function q(a,x) evaluated by its +!! continued fraction representation as gammcf. SUBROUTINE GCF(GAMMCF,A,X,GLN) -!> RETURNS THE INCOMPLETE GAMMA FUNCTION Q(A,X) EVALUATED BY ITS -!! CONTINUED FRACTION REPRESENTATION AS GAMMCF. ALSO RETURNS +! RETURNS THE INCOMPLETE GAMMA FUNCTION Q(A,X) EVALUATED BY ITS +! CONTINUED FRACTION REPRESENTATION AS GAMMCF. ALSO RETURNS ! --- LN(GAMMA(A)) AS GLN. THE CONTINUED FRACTION IS EVALUATED BY ! --- A MODIFIED LENTZ METHOD. ! --- USES GAMMLN @@ -4794,6 +4796,8 @@ END SUBROUTINE GCF ! (C) Copr. 1986-92 Numerical Recipes Software 2.02 !>\ingroup aathompson +!! Returns the incomplete gamma function p(a,x) evaluated by +!! its series representation as gamser. SUBROUTINE GSER(GAMSER,A,X,GLN) ! --- RETURNS THE INCOMPLETE GAMMA FUNCTION P(A,X) EVALUATED BY ITS ! --- ITS SERIES REPRESENTATION AS GAMSER. ALSO RETURNS LN(GAMMA(A)) @@ -4827,6 +4831,7 @@ END SUBROUTINE GSER ! (C) Copr. 1986-92 Numerical Recipes Software 2.02 !>\ingroup aathompson +!! Returns the value ln(gamma(xx)) for xx > 0. REAL FUNCTION GAMMLN(XX) ! --- RETURNS THE VALUE LN(GAMMA(XX)) FOR XX > 0. IMPLICIT NONE diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 37a574495..be2a74957 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -2,8 +2,8 @@ !! This file is the entity of NOAA/ESRL/GSD RUC LSM Model(WRF version 4.0). !>\ingroup lsm_ruc_group -!!\brief This is the entity of RUC LSM model of physics subroutines. -!! It is a soil/veg/snowpack and ice/snowpack/land-surface model to update soil +!! This module contains the entity of the RUC LSM model, which is a +!! soil/veg/snowpack and ice/snowpack/land-surface model to update soil !! moisture, soil temperature, skin temperature, snowpack water content, snowdepth, !! and all terms of the surface energy balance and surface water balance. MODULE module_sf_ruclsm @@ -7678,8 +7678,8 @@ END SUBROUTINE SOILIN !+---+-----------------------------------------------------------------+ !>\ingroup lsm_ruc_group -!> THIS FUNCTION CALCULATES THE LIQUID SATURATION VAPOR MIXING RATIO AS -!! A FUNCTION OF TEMPERATURE AND PRESSURE (from Thompson scheme) +!> This function calculates the liquid saturation vapor mixing ratio as +!! a function of temperature and pressure (from Thompson scheme). REAL FUNCTION RSLF(P,T) IMPLICIT NONE diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 918255a12..363484457 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -16,7 +16,7 @@ subroutine hedmf_finalize () end subroutine hedmf_finalize -!> \defgroup HEDMF GFS moninedmf Main +!> \defgroup HEDMF GFS Hybrid Eddy-Diffusivity Mass-Flux (HEDMF) Scheme Module !! @{ !! \brief This subroutine contains all of logic for the !! Hybrid EDMF PBL scheme except for the calculation of diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index f54cee0e5..df4a5de73 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -1,11 +1,9 @@ !>\file mp_thompson.F90 -!! This file contains NOAA/GSD's Thompson MP scheme. +!! This file contains aerosol-aware Thompson MP scheme. -!>\defgroup aathompson GSD Aerosol-Aware Thompson MP Module -!! -!! Last modified 4 Apr 2019: remove legacy debugging code D. Heinzeller -!> @{ +!>\defgroup aathompson Aerosol-Aware Thompson MP Module +!! This module contains the aerosol-aware Thompson microphysics scheme. module mp_thompson use machine, only : kind_phys @@ -496,4 +494,3 @@ subroutine mp_thompson_finalize(errmsg, errflg) end subroutine mp_thompson_finalize end module mp_thompson -!> @} diff --git a/physics/ozphys_2015.f b/physics/ozphys_2015.f index 6eceaf203..0e7e11484 100644 --- a/physics/ozphys_2015.f +++ b/physics/ozphys_2015.f @@ -20,7 +20,7 @@ subroutine ozphys_2015_finalize() end subroutine ozphys_2015_finalize -!>\defgroup GFS_ozphys_2015 GFS ozphys_2015 Main +!>\defgroup GFS_ozphys_2015 GFS Ozone Photochemistry (2015) Scheme Module !! \brief The operational GFS currently parameterizes ozone production and !! destruction based on monthly mean coefficients ( !! \c ozprdlos_2015_new_sbuvO3_tclm15_nuchem.f77) provided by Naval diff --git a/physics/radiation_aerosols.f b/physics/radiation_aerosols.f index a6afff5d3..60bb50d34 100644 --- a/physics/radiation_aerosols.f +++ b/physics/radiation_aerosols.f @@ -123,20 +123,6 @@ !! \brief This module contains climatological atmospheric aerosol schemes for !! radiation computations. !! -!! GFS selection for Aerosol distribution (namelist control paramter - \b IAER = 111 -!! and \b IAERMDL =0; not available for the current operational GFS) -!! \n IAERMDL=0: OPAC-climatology tropospheric model (monthly mean, \f$15^o\f$ horizontal resolution) -!! \n IAERMDL=1: GOCART-climatology tropospheric aerosol model -!! \n IAERMDL=2: GOCART-climatology prognostic aerosol model -!! -!!\n \b Stratosphere: historical recorded volcanic forcing in four zonal mean bands (1850-2000) -!!\n \b IAER = abc of 3-digit integer flags: a-volcanic; b-LW; c-SW -!!\n a=0: include background stratospheric volcanic aerosol effect (if both b&c /=0) -!!\n a=1: include recorded stratospheric volcanic aerosol effect -!!\n b=0: no LW tropospheric aerosol effect -!!\n b=1: include LW tropospheric aerosol effect -!!\n c=0: no SW tropospheric aerosol effect -!!\n c=1: include SW tropospheric aerosol effect !! !!\version NCEP-Radiation_aerosols v5.2 Jan 2013 !! diff --git a/physics/radlw_main.f b/physics/radlw_main.f index 23ed429e6..961f92a78 100644 --- a/physics/radlw_main.f +++ b/physics/radlw_main.f @@ -356,7 +356,7 @@ module rrtmg_lw subroutine rrtmg_lw_init () end subroutine rrtmg_lw_init -!> \defgroup module_radlw_main GFS radlw Main +!> \defgroup module_radlw_main GFS RRTMG Longwave Module !! \brief This module includes NCEP's modifications of the RRTMG-LW radiation !! code from AER. !! diff --git a/physics/radsw_main.f b/physics/radsw_main.f index 06c60bac8..628450e06 100644 --- a/physics/radsw_main.f +++ b/physics/radsw_main.f @@ -376,7 +376,7 @@ module rrtmg_sw subroutine rrtmg_sw_init () end subroutine rrtmg_sw_init -!> \defgroup module_radsw_main GFS radsw Main +!> \defgroup module_radsw_main GFS RRTMG Shortwave Module !! This module includes NCEP's modifications of the RRTMG-SW radiation !! code from AER. !! diff --git a/physics/rayleigh_damp.f b/physics/rayleigh_damp.f index 1e5711347..6c2806668 100644 --- a/physics/rayleigh_damp.f +++ b/physics/rayleigh_damp.f @@ -11,7 +11,7 @@ module rayleigh_damp subroutine rayleigh_damp_init () end subroutine rayleigh_damp_init -!>\defgroup rayleigh_main GFS Rayleigh Damping Main +!>\defgroup rayleigh_main GFS Rayleigh Damping Module !!\brief This is the Rayleigh friction calculation with total energy conservation. !! !! Role of Rayleigh friction, it attempts to resolve two issues: diff --git a/physics/samfdeepcnv.f b/physics/samfdeepcnv.f index 4577d96d3..2d444a01e 100644 --- a/physics/samfdeepcnv.f +++ b/physics/samfdeepcnv.f @@ -23,7 +23,7 @@ end subroutine samfdeepcnv_init subroutine samfdeepcnv_finalize() end subroutine samfdeepcnv_finalize -!> \defgroup SAMFdeep GFS samfdeepcnv Main +!> \defgroup SAMFdeep GFS Scale-Aware Mass-Flux Deep Convection Scheme Module !! @{ !> \brief This subroutine contains the entirety of the SAMF deep convection !! scheme. diff --git a/physics/samfshalcnv.f b/physics/samfshalcnv.f index de64cf211..3f5bc2c0f 100644 --- a/physics/samfshalcnv.f +++ b/physics/samfshalcnv.f @@ -23,7 +23,7 @@ subroutine samfshalcnv_finalize() end subroutine samfshalcnv_finalize -!> \defgroup SAMF_shal GFS samfshalcnv Main +!> \defgroup SAMF_shal GFS Scale-Aware Mass-Flux Shallow Convection Scheme Module !! @{ !> \brief This subroutine contains the entirety of the SAMF shallow convection !! scheme. diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F index 4bf4e2251..0dc7cc0ee 100644 --- a/physics/satmedmfvdif.F +++ b/physics/satmedmfvdif.F @@ -12,7 +12,7 @@ end subroutine satmedmfvdif_init subroutine satmedmfvdif_finalize () end subroutine satmedmfvdif_finalize -!> \defgroup satmedmf GFS satmedmfvdif Main +!> \defgroup satmedmf GFS Scale-aware TKE-based Moist Eddy-Diffusivity Mass-flux (TKE-EDMF) Scheme Module !! @{ !! \brief This subroutine contains all of the logic for the !! scale-aware TKE-based moist eddy-diffusion mass-flux (TKE-EDMF) scheme. diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index ff503d3b2..fe53292c0 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -24,7 +24,7 @@ end subroutine sfc_diff_init subroutine sfc_diff_finalize end subroutine sfc_diff_finalize -!> \defgroup GFS_diff_main GFS sfc_diff Main +!> \defgroup GFS_diff_main GFS Surface Layer Scheme Module !> @{ !> \brief This subroutine calculates surface roughness length. !! diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index f7899a75d..74a57f291 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -139,7 +139,8 @@ end subroutine lsm_ruc_finalize ! ==================== end of description ===================== ! !> \defgroup lsm_ruc_group GSD RUC LSM Model -!! This module contains GSD RUC Land Surface Model +!! This module contains the RUC Land Surface Model developed by NOAA/GSD +!! (Smirnova et al. 2016 \cite Smirnova_2016). #if 0 !> \section arg_table_lsm_ruc_run Argument Table !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f index a0e60f380..5dfb71048 100644 --- a/physics/sfc_nst.f +++ b/physics/sfc_nst.f @@ -21,7 +21,7 @@ end subroutine sfc_nst_init subroutine sfc_nst_finalize end subroutine sfc_nst_finalize -!>\defgroup gfs_nst_main GFS sfc_nst Main +!>\defgroup gfs_nst_main GFS Near-Surface Sea Temperature Scheme Module !> \brief This subroutine calls the Thermal Skin-layer and Diurnal Thermocline models to update the NSST profile. !! \section arg_table_sfc_nst_run Argument Table !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index 19b05f789..ed3581e3f 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -88,7 +88,7 @@ end subroutine sfc_sice_init subroutine sfc_sice_finalize end subroutine sfc_sice_finalize -!>\defgroup gfs_sice_main GFS sfc_sice Main +!>\defgroup gfs_sice_main GFS Three-layer Thermodynomics Sea-Ice Scheme Module !! \brief This is three-layer thermodynomics sea-ice model based on Winton (2000) \cite winton_2000. !! \section arg_table_sfc_sice_run Argument Table !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | From a6b84bc0581a0f262681c676cf0215c6fbf4627a Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Mon, 10 Jun 2019 13:08:42 -0600 Subject: [PATCH 05/89] add calculation of cumulative_change_in_X_due_to_PBL to MYNN PBL wrapper --- physics/module_MYNNPBL_wrapper.F90 | 51 +++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index 740948695..4d97c6f24 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -26,7 +26,11 @@ end subroutine mynnedmf_wrapper_finalize !! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | !! | flag_init | flag_for_first_time_step | flag signaling first time step for time integration loop | flag | 0 | logical | | in | F | !! | flag_restart | flag_for_restart | flag for restart (warmstart) or coldstart | flag | 0 | logical | | in | F | +!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | +!! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | +!! | lsidea | flag_idealized_physics | flag for idealized physics | flag | 0 | logical | | in | F | !! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | +!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | !! | dx | cell_size | size of the grid cell | m | 1 | real | kind_phys | in | F | !! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | !! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | @@ -95,6 +99,14 @@ end subroutine mynnedmf_wrapper_finalize !! | dqdt_ice_num_conc | tendency_of_ice_number_concentration_due_to_model_physics | number conc. of ice tendency due to model physics | kg-1 s-1 | 2 | real | kind_phys | inout | F | !! | dqdt_water_aer_num_conc | tendency_of_water_friendly_aerosol_number_concentration_due_to_model_physics | number conc. of water-friendly aerosols tendency due to model physics | kg-1 s-1 | 2 | real | kind_phys | inout | F | !! | dqdt_ice_aer_num_conc | tendency_of_ice_friendly_aerosol_number_concentration_due_to_model_physics | number conc. of ice-friendly aerosols tendency due to model physics | kg-1 s-1 | 2 | real | kind_phys | inout | F | +!! | dt3dt | cumulative_change_in_temperature_due_to_PBL | cumulative change in temperature due to PBL | K | 2 | real | kind_phys | inout | F | +!! | du3dt_PBL | cumulative_change_in_x_wind_due_to_PBL | cumulative change in x wind due to PBL | m s-1 | 2 | real | kind_phys | inout | F | +!! | du3dt_OGWD | cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag | cumulative change in x wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | +!! | dv3dt_PBL | cumulative_change_in_y_wind_due_to_PBL | cumulative change in y wind due to PBL | m s-1 | 2 | real | kind_phys | inout | F | +!! | dv3dt_OGWD | cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag | cumulative change in y wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | +!! | htrsw | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep | total sky sw heating rate | K s-1 | 2 | real | kind_phys | in | F | +!! | htrlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep | total sky lw heating rate | K s-1 | 2 | real | kind_phys | in | F | +!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave | none | 1 | real | kind_phys | in | F | !! | grav_settling | grav_settling | flag to activate gravitational setting of fog | flag | 0 | integer | | in | F | !! | bl_mynn_tkebudget | tke_budget | flag for activating TKE budget | flag | 0 | integer | | in | F | !! | bl_mynn_tkeadvect | tke_advect | flag for activating TKE advect | flag | 0 | logical | | in | F | @@ -121,7 +133,8 @@ end subroutine mynnedmf_wrapper_finalize SUBROUTINE mynnedmf_wrapper_run( & & ix,im,levs, & & flag_init,flag_restart, & - & delt,dx,zorl, & + & lssav, ldiag3d, lsidea, & + & delt,dtf,dx,zorl, & & phii,u,v,omega,t3d, & & qgrs_water_vapor, & & qgrs_liquid_cloud, & @@ -151,6 +164,8 @@ SUBROUTINE mynnedmf_wrapper_run( & & dqdt_ice_cloud, dqdt_ozone, & & dqdt_cloud_droplet_num_conc, dqdt_ice_num_conc, & & dqdt_water_aer_num_conc, dqdt_ice_aer_num_conc, & + & dt3dt, du3dt_PBL, du3dt_OGWD, dv3dt_PBL, dv3dt_OGWD, & + & htrsw, htrlw, xmu, & & grav_settling, bl_mynn_tkebudget, bl_mynn_tkeadvect, & & bl_mynn_cloudpdf, bl_mynn_mixlength, & & bl_mynn_edmf, bl_mynn_edmf_mom, bl_mynn_edmf_tke, & @@ -246,7 +261,8 @@ SUBROUTINE mynnedmf_wrapper_run( & character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - + + LOGICAL, INTENT(IN) :: lssav, ldiag3d, lsidea ! NAMELIST OPTIONS (INPUT): LOGICAL, INTENT(IN) :: bl_mynn_tkeadvect, ltaerosol, & lprnt, do_mynnsfclay @@ -278,7 +294,7 @@ SUBROUTINE mynnedmf_wrapper_run( & & p_qc, p_qr, p_qi, p_qs, p_qg, p_qnc, p_qni !MYNN-1D - REAL(kind=kind_phys), intent(in) :: delt + REAL(kind=kind_phys), intent(in) :: delt, dtf INTEGER, intent(in) :: im, ix, levs LOGICAL, intent(in) :: flag_init, flag_restart INTEGER :: initflag, k, i @@ -287,6 +303,7 @@ SUBROUTINE mynnedmf_wrapper_run( & & ITS,ITE,JTS,JTE,KTS,KTE INTEGER :: kdvel, num_vert_mix INTEGER, PARAMETER :: nchem=1, ndvel=1 + REAL(kind=kind_phys) :: tem !MYNN-3D real(kind=kind_phys), dimension(im,levs+1), intent(in) :: phii @@ -315,7 +332,10 @@ SUBROUTINE mynnedmf_wrapper_run( & & RTHRATEN real(kind=kind_phys), dimension(im,levs), intent(out) :: & & Tsq, Qsq, Cov, exch_h, exch_m - + real(kind=kind_phys), dimension(:,:), intent(inout) :: dt3dt, & + & du3dt_PBL, du3dt_OGWD, dv3dt_PBL, dv3dt_OGWD + real(kind=kind_phys), dimension(im), intent(in) :: xmu + real(kind=kind_phys), dimension(im, levs), intent(in) :: htrsw, htrlw !LOCAL real(kind=kind_phys), dimension(im,levs) :: & & qvsh,qc,qi,qnc,qni,ozone,qnwfa,qnifa, & @@ -791,7 +811,28 @@ SUBROUTINE mynnedmf_wrapper_run( & enddo enddo endif - + + if (lssav .and. ldiag3d) then + if (lsidea) then + dt3dt(1:im,:) = dt3dt(1:im,:) + dtdt(1:im,:)*dtf + else + do k=1,levs + do i=1,im + tem = dtdt(i,k) - (htrlw(i,k)+htrsw(i,k)*xmu(i)) + dt3dt(i,k) = dt3dt(i,k) + tem*dtf + enddo + enddo + endif + do k=1,levs + do i=1,im + du3dt_PBL(i,k) = du3dt_PBL(i,k) + dudt(i,k) * dtf + du3dt_OGWD(i,k) = du3dt_OGWD(i,k) - dudt(i,k) * dtf + dv3dt_PBL(i,k) = dv3dt_PBL(i,k) + dvdt(i,k) * dtf + dv3dt_OGWD(i,k) = dv3dt_OGWD(i,k) - dvdt(i,k) * dtf + enddo + enddo + endif + if (lprnt) then print* print*,"===Finished with mynn_bl_driver; output:" From 55d46a1eeccadf9a4acffcb6fddafae74a84d8e5 Mon Sep 17 00:00:00 2001 From: "Grant.Firl" Date: Tue, 11 Jun 2019 13:12:40 -0600 Subject: [PATCH 06/89] add calculation of cumulative_change_in_X_due_to_PBL to MYNN PBL wrapper --- physics/module_MYNNPBL_wrapper.F90 | 51 +++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index 740948695..4d97c6f24 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -26,7 +26,11 @@ end subroutine mynnedmf_wrapper_finalize !! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | !! | flag_init | flag_for_first_time_step | flag signaling first time step for time integration loop | flag | 0 | logical | | in | F | !! | flag_restart | flag_for_restart | flag for restart (warmstart) or coldstart | flag | 0 | logical | | in | F | +!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | +!! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | +!! | lsidea | flag_idealized_physics | flag for idealized physics | flag | 0 | logical | | in | F | !! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | +!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | !! | dx | cell_size | size of the grid cell | m | 1 | real | kind_phys | in | F | !! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | !! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | @@ -95,6 +99,14 @@ end subroutine mynnedmf_wrapper_finalize !! | dqdt_ice_num_conc | tendency_of_ice_number_concentration_due_to_model_physics | number conc. of ice tendency due to model physics | kg-1 s-1 | 2 | real | kind_phys | inout | F | !! | dqdt_water_aer_num_conc | tendency_of_water_friendly_aerosol_number_concentration_due_to_model_physics | number conc. of water-friendly aerosols tendency due to model physics | kg-1 s-1 | 2 | real | kind_phys | inout | F | !! | dqdt_ice_aer_num_conc | tendency_of_ice_friendly_aerosol_number_concentration_due_to_model_physics | number conc. of ice-friendly aerosols tendency due to model physics | kg-1 s-1 | 2 | real | kind_phys | inout | F | +!! | dt3dt | cumulative_change_in_temperature_due_to_PBL | cumulative change in temperature due to PBL | K | 2 | real | kind_phys | inout | F | +!! | du3dt_PBL | cumulative_change_in_x_wind_due_to_PBL | cumulative change in x wind due to PBL | m s-1 | 2 | real | kind_phys | inout | F | +!! | du3dt_OGWD | cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag | cumulative change in x wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | +!! | dv3dt_PBL | cumulative_change_in_y_wind_due_to_PBL | cumulative change in y wind due to PBL | m s-1 | 2 | real | kind_phys | inout | F | +!! | dv3dt_OGWD | cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag | cumulative change in y wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | +!! | htrsw | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep | total sky sw heating rate | K s-1 | 2 | real | kind_phys | in | F | +!! | htrlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep | total sky lw heating rate | K s-1 | 2 | real | kind_phys | in | F | +!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave | none | 1 | real | kind_phys | in | F | !! | grav_settling | grav_settling | flag to activate gravitational setting of fog | flag | 0 | integer | | in | F | !! | bl_mynn_tkebudget | tke_budget | flag for activating TKE budget | flag | 0 | integer | | in | F | !! | bl_mynn_tkeadvect | tke_advect | flag for activating TKE advect | flag | 0 | logical | | in | F | @@ -121,7 +133,8 @@ end subroutine mynnedmf_wrapper_finalize SUBROUTINE mynnedmf_wrapper_run( & & ix,im,levs, & & flag_init,flag_restart, & - & delt,dx,zorl, & + & lssav, ldiag3d, lsidea, & + & delt,dtf,dx,zorl, & & phii,u,v,omega,t3d, & & qgrs_water_vapor, & & qgrs_liquid_cloud, & @@ -151,6 +164,8 @@ SUBROUTINE mynnedmf_wrapper_run( & & dqdt_ice_cloud, dqdt_ozone, & & dqdt_cloud_droplet_num_conc, dqdt_ice_num_conc, & & dqdt_water_aer_num_conc, dqdt_ice_aer_num_conc, & + & dt3dt, du3dt_PBL, du3dt_OGWD, dv3dt_PBL, dv3dt_OGWD, & + & htrsw, htrlw, xmu, & & grav_settling, bl_mynn_tkebudget, bl_mynn_tkeadvect, & & bl_mynn_cloudpdf, bl_mynn_mixlength, & & bl_mynn_edmf, bl_mynn_edmf_mom, bl_mynn_edmf_tke, & @@ -246,7 +261,8 @@ SUBROUTINE mynnedmf_wrapper_run( & character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - + + LOGICAL, INTENT(IN) :: lssav, ldiag3d, lsidea ! NAMELIST OPTIONS (INPUT): LOGICAL, INTENT(IN) :: bl_mynn_tkeadvect, ltaerosol, & lprnt, do_mynnsfclay @@ -278,7 +294,7 @@ SUBROUTINE mynnedmf_wrapper_run( & & p_qc, p_qr, p_qi, p_qs, p_qg, p_qnc, p_qni !MYNN-1D - REAL(kind=kind_phys), intent(in) :: delt + REAL(kind=kind_phys), intent(in) :: delt, dtf INTEGER, intent(in) :: im, ix, levs LOGICAL, intent(in) :: flag_init, flag_restart INTEGER :: initflag, k, i @@ -287,6 +303,7 @@ SUBROUTINE mynnedmf_wrapper_run( & & ITS,ITE,JTS,JTE,KTS,KTE INTEGER :: kdvel, num_vert_mix INTEGER, PARAMETER :: nchem=1, ndvel=1 + REAL(kind=kind_phys) :: tem !MYNN-3D real(kind=kind_phys), dimension(im,levs+1), intent(in) :: phii @@ -315,7 +332,10 @@ SUBROUTINE mynnedmf_wrapper_run( & & RTHRATEN real(kind=kind_phys), dimension(im,levs), intent(out) :: & & Tsq, Qsq, Cov, exch_h, exch_m - + real(kind=kind_phys), dimension(:,:), intent(inout) :: dt3dt, & + & du3dt_PBL, du3dt_OGWD, dv3dt_PBL, dv3dt_OGWD + real(kind=kind_phys), dimension(im), intent(in) :: xmu + real(kind=kind_phys), dimension(im, levs), intent(in) :: htrsw, htrlw !LOCAL real(kind=kind_phys), dimension(im,levs) :: & & qvsh,qc,qi,qnc,qni,ozone,qnwfa,qnifa, & @@ -791,7 +811,28 @@ SUBROUTINE mynnedmf_wrapper_run( & enddo enddo endif - + + if (lssav .and. ldiag3d) then + if (lsidea) then + dt3dt(1:im,:) = dt3dt(1:im,:) + dtdt(1:im,:)*dtf + else + do k=1,levs + do i=1,im + tem = dtdt(i,k) - (htrlw(i,k)+htrsw(i,k)*xmu(i)) + dt3dt(i,k) = dt3dt(i,k) + tem*dtf + enddo + enddo + endif + do k=1,levs + do i=1,im + du3dt_PBL(i,k) = du3dt_PBL(i,k) + dudt(i,k) * dtf + du3dt_OGWD(i,k) = du3dt_OGWD(i,k) - dudt(i,k) * dtf + dv3dt_PBL(i,k) = dv3dt_PBL(i,k) + dvdt(i,k) * dtf + dv3dt_OGWD(i,k) = dv3dt_OGWD(i,k) - dvdt(i,k) * dtf + enddo + enddo + endif + if (lprnt) then print* print*,"===Finished with mynn_bl_driver; output:" From db66c394d0cfa21d85af4c859212f7e65bcf2117 Mon Sep 17 00:00:00 2001 From: Man Zhang Date: Tue, 11 Jun 2019 15:12:24 -0600 Subject: [PATCH 07/89] scidoc updates --- physics/cu_gf_deep.F90 | 218 +++++++++---------- physics/cu_gf_driver.F90 | 7 +- physics/docs/ccppv3_doxyfile | 12 +- physics/docs/library.bib | 72 +++--- physics/docs/pdftxt/CPT_CSAW.txt | 2 +- physics/docs/pdftxt/CPT_MG3.txt | 2 +- physics/docs/pdftxt/CPT_adv_suite.txt | 6 +- physics/docs/pdftxt/GFDL_cloud.txt | 6 +- physics/docs/pdftxt/GFS_GWDC.txt | 6 +- physics/docs/pdftxt/GFS_H2OPHYS.txt | 2 +- physics/docs/pdftxt/GFS_NOAH.txt | 10 +- physics/docs/pdftxt/GFS_SFCLYR.txt | 12 +- physics/docs/pdftxt/GFS_SFCSICE.txt | 4 +- physics/docs/pdftxt/GFS_SURFACE_PERT.txt | 20 +- physics/docs/pdftxt/GFSv15_suite.txt | 19 +- physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt | 8 +- physics/docs/pdftxt/GSD_CU_GF_deep.txt | 21 +- physics/docs/pdftxt/GSD_THOMPSON.txt | 2 +- physics/docs/pdftxt/GSD_adv_suite.txt | 7 +- physics/docs/pdftxt/all_shemes_list.txt | 30 +-- physics/docs/pdftxt/all_shemes_list.txt.FV3 | 110 ++++++++++ physics/docs/pdftxt/suite_input.nml.txt | 12 +- physics/module_sf_ruclsm.F90 | 101 --------- 23 files changed, 347 insertions(+), 342 deletions(-) create mode 100644 physics/docs/pdftxt/all_shemes_list.txt.FV3 diff --git a/physics/cu_gf_deep.F90 b/physics/cu_gf_deep.F90 index 338bf4cb1..7bf08e6b7 100644 --- a/physics/cu_gf_deep.F90 +++ b/physics/cu_gf_deep.F90 @@ -51,57 +51,57 @@ module cu_gf_deep !> @{ subroutine cu_gf_deep_run( & itf,ktf,its,ite, kts,kte & - ,dicycle & !< diurnal cycle flag - ,ichoice & !< choice of closure, use "0" for ensemble average - ,ipr & !< this flag can be used for debugging prints - ,ccn & !< not well tested yet - ,dtime & !< - ,imid & !< flag to turn on mid level convection - ,kpbl & !< level of boundary layer height - ,dhdt & !< boundary layer forcing (one closure for shallow) - ,xland & !< land mask - ,zo & !< heights above surface - ,forcing & !< only diagnostic - ,t & !< t before forcing - ,q & !< q before forcing - ,z1 & !< terrain - ,tn & !< t including forcing - ,qo & !< q including forcing - ,po & !< pressure (mb) - ,psur & !< surface pressure (mb) - ,us & !< u on mass points - ,vs & !< v on mass points - ,rho & !< density - ,hfx & !< w/m2, positive upward - ,qfx & !< w/m2, positive upward - ,dx & !< dx is grid point dependent here - ,mconv & !< integrated vertical advection of moisture - ,omeg & !< omega (pa/s) - ,csum & !< used to implement memory, set to zero if not avail - ,cnvwt & !< gfs needs this - ,zuo & !< nomalized updraft mass flux - ,zdo & !< nomalized downdraft mass flux - ,zdm & !< nomalized downdraft mass flux from mid scheme - ,edto & !< - ,edtm & !< - ,xmb_out & !< the xmb's may be needed for dicycle - ,xmbm_in & !< - ,xmbs_in & !< - ,pre & !< - ,outu & !< momentum tendencies at mass points - ,outv & !< - ,outt & !< temperature tendencies - ,outq & !< q tendencies - ,outqc & !< ql/qice tendencies - ,kbcon & !< - ,ktop & !< - ,cupclw & !< used for direct coupling to radiation, but with tuning factors - ,ierr & !< ierr flags are error flags, used for debugging - ,ierrc & ! - Call cup_env() to calculate moist static energy, heights, qes ! call cup_env(z,qes,he,hes,t,q,po,z1, & psur,ierr,tcrit,-1, & @@ -558,7 +558,7 @@ subroutine cu_gf_deep_run( & its,ite, kts,kte) ! -!--- environmental values on cloud levels +!> - Call cup_env_clev() to calculate environmental values on cloud levels ! call cup_env_clev(t,qes,q,he,hes,z,po,qes_cup,q_cup,he_cup, & hes_cup,z_cup,p_cup,gamma_cup,t_cup,psur, & @@ -571,7 +571,7 @@ subroutine cu_gf_deep_run( & itf,ktf, & its,ite, kts,kte) !---meltglac------------------------------------------------- -!--- partition between liq/ice cloud contents +!> - Call get_partition_liq_ice() to calculate partition between liq/ice cloud contents call get_partition_liq_ice(ierr,tn,po_cup,p_liq_ice,melting_layer,& itf,ktf,its,ite,kts,kte,cumulus) !---meltglac------------------------------------------------- @@ -596,7 +596,7 @@ subroutine cu_gf_deep_run( & enddo 25 continue ! -!--- level where detrainment for downdraft starts +!> - Compute the level where detrainment for downdraft starts (\p kdet) ! do k=kts,ktf if(zo_cup(i,k).gt.z_detr+z1(i))then @@ -611,7 +611,7 @@ subroutine cu_gf_deep_run( & ! ! ! -!------- determine level with highest moist static energy content - k22 +!> - Determine level with highest moist static energy content (\p k22) ! start_k22=2 do 36 i=its,itf @@ -627,7 +627,8 @@ subroutine cu_gf_deep_run( & endif 36 continue ! -!--- determine the level of convective cloud base - kbcon +!> - call get_cloud_bc() and cup_kbcon() to determine the +!! level of convective cloud base (\p kbcon) ! do i=its,itf @@ -720,7 +721,7 @@ subroutine cu_gf_deep_run( & endif enddo ! -!-- get normalized mass flux, entrainment and detrainmentrates for updraft +!> - Call rates_up_pdf() to get normalized mass flux, entrainment and detrainmentrates for updraft ! i=0 !- for mid level clouds we do not allow clouds taller than where stability @@ -757,7 +758,7 @@ subroutine cu_gf_deep_run( & endif enddo ! -! calculate mass entrainment and detrainment +!> - Call get_lateral_massflux() to calculate mass entrainment and detrainment ! if(imid.eq.1)then call get_lateral_massflux(itf,ktf, its,ite, kts,kte & @@ -930,7 +931,7 @@ subroutine cu_gf_deep_run( & enddo enddo ! - !--- calculate moisture properties of updraft +!> - Call cup_up_moisture() to calculate moisture properties of updraft ! if(imid.eq.1)then call cup_up_moisture('mid',ierr,zo_cup,qco,qrco,pwo,pwavo, & @@ -1250,7 +1251,7 @@ subroutine cu_gf_deep_run( & endif enddo ! -!--- calculate moisture properties of downdraft +!> - Call cup_dd_moisture() to calculate moisture properties of downdraft ! call cup_dd_moisture(ierrc,zdo,hcdo,heso_cup,qcdo,qeso_cup, & pwdo,qo_cup,zo_cup,dd_massentro,dd_massdetro,jmin,ierr,gammao_cup, & @@ -1286,7 +1287,7 @@ subroutine cu_gf_deep_run( & enddo enddo ! -!--- calculate workfunctions for updrafts +!> - Call cup_up_aa0() to calculate workfunctions for updrafts ! call cup_up_aa0(aa0,z,zu,dby,gamma_cup,t_cup, & kbcon,ktop,ierr, & @@ -1353,6 +1354,7 @@ subroutine cu_gf_deep_run( & t_star=1. !-- calculate pcape from bl forcing only +!> - Call cup_up_aa1bl() to calculate ECMWF version diurnal cycle closure call cup_up_aa1bl(aa1_bl,t,tn,q,qo,dtime, & zo_cup,zuo,dbyo_bl,gammao_cup_bl,tn_cup_bl, & kbcon,ktop,ierr, & @@ -1463,7 +1465,7 @@ subroutine cu_gf_deep_run( & axx(:)=aa1(:) ! -!--- determine downdraft strength in terms of windshear +!> - Call cup_dd_edt() to determine downdraft strength in terms of windshear ! call cup_dd_edt(ierr,us,vs,zo,ktop,kbcon,edt,po,pwavo, & pwo,ccn,pwevo,edtmax,edtmin,edtc,psum,psumh, & @@ -1473,7 +1475,8 @@ subroutine cu_gf_deep_run( & if(ierr(i)/=0)cycle edto(i)=edtc(i,1) enddo - !--- get melting profile + +!> - Call get_melting_profile() to get melting profile call get_melting_profile(ierr,tn_cup,po_cup, p_liq_ice,melting_layer,qrco & ,pwo,edto,pwdo,melting & ,itf,ktf,its,ite, kts,kte, cumulus ) @@ -2031,7 +2034,6 @@ end subroutine cu_gf_deep_run !> @} !>\ingroup cu_gf_deep_group -!> This subroutine calculates subroutine cup_dd_edt(ierr,us,vs,z,ktop,kbcon,edt,p,pwav, & pw,ccn,pwev,edtmax,edtmin,edtc,psum2,psumh, & rho,aeroevap,itf,ktf, & @@ -2157,9 +2159,6 @@ subroutine cup_dd_edt(ierr,us,vs,z,ktop,kbcon,edt,p,pwav, & end subroutine cup_dd_edt !>\ingroup cu_gf_deep_group -!> This subroutine calculates -!!\param ierrc -!!\param zd subroutine cup_dd_moisture(ierrc,zd,hcd,hes_cup,qcd,qes_cup, & pwd,q_cup,z_cup,dd_massentr,dd_massdetr,jmin,ierr, & gamma_cup,pwev,bu,qrcd, & @@ -2306,8 +2305,17 @@ subroutine cup_dd_moisture(ierrc,zd,hcd,hes_cup,qcd,qes_cup, & end subroutine cup_dd_moisture !>\ingroup cu_gf_deep_group -!> This subroutine calculates -!!\param +!!\param z environmental heights +!!\param qes environmental saturation mixing ratio +!!\param he environmental moist static energy +!!\param hes environmental saturation moist static energy +!!\param t environmental temperature +!!\param q environmental mixing ratio +!!\param p environmental pressure +!!\param z1 terrain elevation +!!\param psur surface pressure +!!\param ierr error value, maybe modified in this routine +!!\param tcrit 258.K subroutine cup_env(z,qes,he,hes,t,q,p,z1, & psur,ierr,tcrit,itest, & itf,ktf, & @@ -2320,18 +2328,6 @@ subroutine cup_env(z,qes,he,hes,t,q,p,z1, & itf,ktf, & its,ite, kts,kte ! - ! ierr error value, maybe modified in this routine - ! q = environmental mixing ratio - ! qes = environmental saturation mixing ratio - ! t = environmental temp - ! tv = environmental virtual temp - ! p = environmental pressure - ! z = environmental heights - ! he = environmental moist static energy - ! hes = environmental saturation moist static energy - ! psur = surface pressure - ! z1 = terrain elevation - ! ! real(kind=kind_phys), dimension (its:ite,kts:kte) & ,intent (in ) :: & @@ -2439,8 +2435,24 @@ subroutine cup_env(z,qes,he,hes,t,q,p,z1, & end subroutine cup_env !>\ingroup cu_gf_deep_group -!> This subroutine calculates -!>\param +!!\param t environmental temperature +!!\param qes environmental saturation mixing ratio +!!\param q environmental mixing ratio +!!\param he environmental moist static energy +!!\param hes environmental saturation moist static energy +!!\param z environmental heights +!!\param p environmental pressure +!!\param qes_cup environmental saturation mixing ratio on cloud levels +!!\param q_cup environmental mixing ratio on cloud levels +!!\param he_cup environmental moist static energy on cloud levels +!!\param hes_cup environmental saturation moist static energy on cloud levels +!!\param z_cup environmental heights on cloud levels +!!\param p_cup environmental pressure on cloud levels +!!\param gamma_cup gamma on cloud levels +!!\param t_cup environmental temperature on cloud levels +!!\param psur surface pressure +!!\param ierr error value, maybe modified in this routine +!!\param z1 terrain elevation subroutine cup_env_clev(t,qes,q,he,hes,z,p,qes_cup,q_cup, & he_cup,hes_cup,z_cup,p_cup,gamma_cup,t_cup,psur, & ierr,z1, & @@ -2453,26 +2465,6 @@ subroutine cup_env_clev(t,qes,q,he,hes,z,p,qes_cup,q_cup, & ,intent (in ) :: & itf,ktf, & its,ite, kts,kte - ! - ! ierr error value, maybe modified in this routine - ! q = environmental mixing ratio - ! q_cup = environmental mixing ratio on cloud levels - ! qes = environmental saturation mixing ratio - ! qes_cup = environmental saturation mixing ratio on cloud levels - ! t = environmental temp - ! t_cup = environmental temp on cloud levels - ! p = environmental pressure - ! p_cup = environmental pressure on cloud levels - ! z = environmental heights - ! z_cup = environmental heights on cloud levels - ! he = environmental moist static energy - ! he_cup = environmental moist static energy on cloud levels - ! hes = environmental saturation moist static energy - ! hes_cup = environmental saturation moist static energy on cloud levels - ! gamma_cup = gamma on cloud levels - ! psur = surface pressure - ! z1 = terrain elevation - ! ! real(kind=kind_phys), dimension (its:ite,kts:kte) & ,intent (in ) :: & @@ -2543,8 +2535,6 @@ subroutine cup_env_clev(t,qes,q,he,hes,z,p,qes_cup,q_cup, & end subroutine cup_env_clev !>\ingroup cu_gf_deep_group -!> This subroutine calculates -!>\param subroutine cup_forcing_ens_3d(closure_n,xland,aa0,aa1,xaa0,mbdt,dtime,ierr,ierr2,ierr3,& xf_ens,axx,forcing,maxens3,mconv,rand_clos, & p_cup,ktop,omeg,zd,zdm,k22,zu,pr_ens,edt,edtm,kbcon, & @@ -2927,8 +2917,6 @@ subroutine cup_forcing_ens_3d(closure_n,xland,aa0,aa1,xaa0,mbdt,dtime,ierr,ierr2 end subroutine cup_forcing_ens_3d !>\ingroup cu_gf_deep_group -!> This subroutine calculates -!>\param subroutine cup_kbcon(ierrc,cap_inc,iloop_in,k22,kbcon,he_cup,hes_cup, & hkb,ierr,kbmax,p_cup,cap_max, & ztexec,zqexec, & @@ -3068,8 +3056,6 @@ subroutine cup_kbcon(ierrc,cap_inc,iloop_in,k22,kbcon,he_cup,hes_cup, & end subroutine cup_kbcon !>\ingroup cu_gf_deep_group -!> This subroutine calculates -!>\param subroutine cup_maximi(array,ks,ke,maxx,ierr, & itf,ktf, & its,ite, kts,kte ) @@ -3126,8 +3112,6 @@ subroutine cup_maximi(array,ks,ke,maxx,ierr, & end subroutine cup_maximi !>\ingroup cu_gf_deep_group -!> This subroutine calculates -!>\param subroutine cup_minimi(array,ks,kend,kt,ierr, & itf,ktf, & its,ite, kts,kte ) @@ -3943,8 +3927,6 @@ real function satvap(temp2) end function !-------------------------------------------------------------------- !>\ingroup cu_gf_deep_group -!> This subroutine calcualtes -!>\param subroutine get_cloud_bc(mzp,array,x_aver,k22,add) implicit none integer, intent(in) :: mzp,k22 @@ -3971,8 +3953,6 @@ subroutine get_cloud_bc(mzp,array,x_aver,k22,add) end subroutine get_cloud_bc !======================================================================================== !>\ingroup cu_gf_deep_group -!> This subroutine calculates -!>\param subroutine rates_up_pdf(rand_vmas,ipr,name,ktop,ierr,p_cup,entr_rate_2d,hkbo,heo,heso_cup,z_cup, & xland,kstabi,k22,kbcon,its,ite,itf,kts,kte,ktf,zuo,kpbl,ktopdby,csum,pmin_lev) implicit none diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 30fe5b8f5..1265a7112 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -1,5 +1,5 @@ !>\file cu_gf_driver.F90 -!! This file is Grell-Freitas cumulus scheme driver. +!! This file is scale-aware Grell-Freitas cumulus scheme driver. module cu_gf_driver @@ -267,7 +267,7 @@ subroutine cu_gf_driver_run(tottracer,ntrac,garea,im,ix,km,dt,cactiv, & ! tropics(:)=0 ! -!> - tuning constants for radiation coupling +!> - Set tuning constants for radiation coupling ! tun_rad_shall(:)=.02 tun_rad_mid(:)=.15 @@ -556,6 +556,7 @@ subroutine cu_gf_driver_run(tottracer,ntrac,garea,im,ix,km,dt,cactiv, & do i=its,itf if(xmbs(i).gt.0.)cutens(i)=1. enddo +!> - Call neg_check() for GF shallow convection call neg_check('shallow',ipn,dt,qcheck,outqs,outts,outus,outvs, & outqcs,prets,its,ite,kts,kte,itf,ktf,ktops) endif @@ -637,6 +638,7 @@ subroutine cu_gf_driver_run(tottracer,ntrac,garea,im,ix,km,dt,cactiv, & qcheck(i,k)=qv(i,k) +outqs(i,k)*dt enddo enddo +!> - Call neg_check() for middle GF convection call neg_check('mid',ipn,dt,qcheck,outqm,outtm,outum,outvm, & outqcm,pretm,its,ite,kts,kte,itf,ktf,ktopm) endif @@ -718,6 +720,7 @@ subroutine cu_gf_driver_run(tottracer,ntrac,garea,im,ix,km,dt,cactiv, & qcheck(i,k)=qv(i,k) +(outqs(i,k)+outqm(i,k))*dt enddo enddo +!> - Call neg_check() for deep GF convection call neg_check('deep',ipn,dt,qcheck,outq,outt,outu,outv, & outqc,pret,its,ite,kts,kte,itf,ktf,ktop) ! diff --git a/physics/docs/ccppv3_doxyfile b/physics/docs/ccppv3_doxyfile index fbd18f515..be9bfe1f2 100644 --- a/physics/docs/ccppv3_doxyfile +++ b/physics/docs/ccppv3_doxyfile @@ -120,7 +120,7 @@ INPUT = pdftxt/mainpage.txt \ pdftxt/GFS_GWDC.txt \ pdftxt/GFS_SAMFshal.txt \ pdftxt/GFDL_cloud.txt \ - pdftxt/GFS_SURFACE_PERT.txt \ +### pdftxt/GFS_SURFACE_PERT.txt \ pdftxt/GFS_CALPRECIPTYPE.txt \ ### pdftxt/rad_cld.txt \ pdftxt/CPT_CSAW.txt \ @@ -130,10 +130,10 @@ INPUT = pdftxt/mainpage.txt \ pdftxt/GSD_RUCLSM.txt \ pdftxt/GSD_THOMPSON.txt \ ### pdftxt/GFSphys_namelist.txt \ - pdftxt/GFS_STOCHY_PHYS.txt \ +### pdftxt/GFS_STOCHY_PHYS.txt \ pdftxt/suite_input.nml.txt \ ### in-core MP - ../gfdl_fv_sat_adj.F90 \ +### ../gfdl_fv_sat_adj.F90 \ ### time_vary ../GFS_phys_time_vary.fv3.F90 \ ../ozne_def.f \ @@ -207,12 +207,12 @@ INPUT = pdftxt/mainpage.txt \ ../GFS_MP_generic.F90 \ ../calpreciptype.f90 \ ### stochy - ../GFS_stochastics.F90 \ - ../surface_perturbation.F90 \ +### ../GFS_stochastics.F90 \ +### ../surface_perturbation.F90 \ ### ../../stochastic_physics/stochastic_physics.F90 \ ### CPT ../m_micro.F90 \ - ../micro_mg2_0.F90 \ +### ../micro_mg2_0.F90 \ ../micro_mg3_0.F90 \ ../micro_mg_utils.F90 \ ../cldmacro.F \ diff --git a/physics/docs/library.bib b/physics/docs/library.bib index 96f57cef5..5775c6b7b 100644 --- a/physics/docs/library.bib +++ b/physics/docs/library.bib @@ -1,15 +1,35 @@ %% This BibTeX bibliography file was created using BibDesk. %% http://bibdesk.sourceforge.net/ -%% Created for Man Zhang at 2019-06-06 11:56:03 -0600 +%% Created for Man Zhang at 2019-06-10 16:42:57 -0600 %% Saved with string encoding Unicode (UTF-8) +@article{qu_and_hall_2005, + Author = {X. Qu and A. Hall}, + Date-Added = {2019-06-10 16:41:01 -0600}, + Date-Modified = {2019-06-10 16:42:55 -0600}, + Journal = {J. Climate}, + Pages = {5239-5252}, + Title = {Surface contribution to planetary albedo variability in cryosphere regions}, + Volume = {18}, + Year = {2005}} + +@article{grant_et_al_2000, + Author = {I.F. Grant and A. J. Prata and R. P.Cechet}, + Date-Added = {2019-06-10 16:30:06 -0600}, + Date-Modified = {2019-06-10 16:33:28 -0600}, + Journal = {Journal of Applied Meteorology}, + Pages = {231-244}, + Title = {The impact of the diurnal variation of albedo on the remote sensing of the daily mean albedo of grassland}, + Volume = {39}, + Year = {2000}} + @article{moorthi_and_suarez_1992, - Author = {S. Moorthi and M.J. Suarez }, + Author = {S. Moorthi and M.J. Suarez}, Date-Added = {2019-06-06 17:51:50 +0000}, Date-Modified = {2019-06-06 17:56:00 +0000}, Journal = {Monthly Weather Review}, @@ -1773,12 +1793,12 @@ @article{zeng_and_dickinson_1998 @conference{zheng_et_al_2009, Address = {Omaha, Nebraska}, Author = {W. Zheng and H. Wei and J. Meng and M. Ek and K. Mitchell and J. Derber and X. Zeng and Z. Wang}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBWLi4vLi4vLi4vLi4vLi4vRGVza3RvcC9OT0FIX0xTTS9JbXByb3ZlbWVudF9vZl9MYW5kX1N1cmZhY2VfU2tpbl9UZW1wZXJhdHVyZV9pbl9OQy5wZGZPEQIgAAAAAAIgAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADT4djXSCsAAANl5rUfSW1wcm92ZW1lbnRfb2ZfTGFuZCMzNjVGRjBGLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2X/D9aQ780AAAAAAAAAAAAFAAMAAAkgAAAAAAAAAAAAAAAAAAAACE5PQUhfTFNNABAACAAA0+ItNwAAABEACAAA1pFSPQAAAAEAEANl5rUAD8YgAA/GDwAGL94AAgBRTWFjaW50b3NoIEhEOlVzZXJzOgBtYW4uemhhbmc6AERlc2t0b3A6AE5PQUhfTFNNOgBJbXByb3ZlbWVudF9vZl9MYW5kIzM2NUZGMEYucGRmAAAOAG4ANgBJAG0AcAByAG8AdgBlAG0AZQBuAHQAXwBvAGYAXwBMAGEAbgBkAF8AUwB1AHIAZgBhAGMAZQBfAFMAawBpAG4AXwBUAGUAbQBwAGUAcgBhAHQAdQByAGUAXwBpAG4AXwBOAEMALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAFdVc2Vycy9tYW4uemhhbmcvRGVza3RvcC9OT0FIX0xTTS9JbXByb3ZlbWVudF9vZl9MYW5kX1N1cmZhY2VfU2tpbl9UZW1wZXJhdHVyZV9pbl9OQy5wZGYAABMAAS8AABUAAgAQ//8AAAAIAA0AGgAkAH0AAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACoQ==}, Date-Added = {2018-01-26 22:19:06 +0000}, Date-Modified = {2018-01-29 23:51:37 +0000}, Organization = {The 23rd Conference on Weather Analysis and Forecasting (WAF)/19th Conference on Numerical Weather Prediction(NWP)}, Title = {Improvement of land surface skin temperature in NCEP Operational NWP models and its impact on satellite Data Assimilation}, - Year = {2009}} + Year = {2009}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBWLi4vLi4vLi4vLi4vLi4vRGVza3RvcC9OT0FIX0xTTS9JbXByb3ZlbWVudF9vZl9MYW5kX1N1cmZhY2VfU2tpbl9UZW1wZXJhdHVyZV9pbl9OQy5wZGZPEQIgAAAAAAIgAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADT4djXSCsAAANl5rUfSW1wcm92ZW1lbnRfb2ZfTGFuZCMzNjVGRjBGLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA2X/D9aQ780AAAAAAAAAAAAFAAMAAAkgAAAAAAAAAAAAAAAAAAAACE5PQUhfTFNNABAACAAA0+ItNwAAABEACAAA1pFSPQAAAAEAEANl5rUAD8YgAA/GDwAGL94AAgBRTWFjaW50b3NoIEhEOlVzZXJzOgBtYW4uemhhbmc6AERlc2t0b3A6AE5PQUhfTFNNOgBJbXByb3ZlbWVudF9vZl9MYW5kIzM2NUZGMEYucGRmAAAOAG4ANgBJAG0AcAByAG8AdgBlAG0AZQBuAHQAXwBvAGYAXwBMAGEAbgBkAF8AUwB1AHIAZgBhAGMAZQBfAFMAawBpAG4AXwBUAGUAbQBwAGUAcgBhAHQAdQByAGUAXwBpAG4AXwBOAEMALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAFdVc2Vycy9tYW4uemhhbmcvRGVza3RvcC9OT0FIX0xTTS9JbXByb3ZlbWVudF9vZl9MYW5kX1N1cmZhY2VfU2tpbl9UZW1wZXJhdHVyZV9pbl9OQy5wZGYAABMAAS8AABUAAgAQ//8AAAAIAA0AGgAkAH0AAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACoQ==}} @article{chen_et_al_1997, Author = {F. Chen and Z. Janjic and K. Mitchell}, @@ -2017,7 +2037,6 @@ @article{iacono_et_al_2008 @article{grant_2001, Abstract = {A closure for the fluxes of mass, heat, and moisture at cloud base in the cumulus-capped boundary layer is developed. The cloud-base mass flux is obtained from a simplifed turbulence kinetic energy (TKE) budget for the sub-cloud layer, in which cumulus convection is assumed to be associated with a transport of TKE from the sub-cloud layer to the cloud layer.The heat and moisture fluxes are obtained from a jump model based on the virtual-potential-temperature equation. A key part of this parametrization is the parametrization of the virtual-temperature flux at the top of the transition zone between the sub-cloud and cloud layers.It is argued that pressure fluctuations must be responsible for the transport of TKE from the cloud layer to the sub-cloud layer.}, Author = {A. L. M. Grant}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvR3JhbnQvMjAwMS5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAoiV4IMjAwMS5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARgJuNOHLk4AAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAABUdyYW50AAAQAAgAANHneLIAAAARAAgAANOHgq4AAAABABgAKIleAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AEdyYW50OgAyMDAxLnBkZgAADgASAAgAMgAwADAAMQAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9HcmFudC8yMDAxLnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Date-Added = {2016-06-15 22:11:22 +0000}, Date-Modified = {2018-07-06 19:02:34 +0000}, Doi = {10.1002/qj.49712757209}, @@ -2031,13 +2050,13 @@ @article{grant_2001 Url = {http://dx.doi.org/10.1002/qj.49712757209}, Volume = {127}, Year = {2001}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvR3JhbnQvMjAwMS5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAoiV4IMjAwMS5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARgJuNOHLk4AAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAABUdyYW50AAAQAAgAANHneLIAAAARAAgAANOHgq4AAAABABgAKIleAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AEdyYW50OgAyMDAxLnBkZgAADgASAAgAMgAwADAAMQAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9HcmFudC8yMDAxLnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Bdsk-Url-1 = {http://dx.doi.org/10.1002/qj.49712757209}} @article{zhang_and_wu_2003, Abstract = {Abstract This study uses a 2D cloud-resolving model to investigate the vertical transport of horizontal momentum and to understand the role of a convection-generated perturbation pressure field in the momentum transport by convective systems during part of the Tropical Ocean and Global Atmosphere Coupled Ocean?Atmosphere Response Experiment (TOGA COARE) Intensive Observation Period. It shows that convective updrafts transport a significant amount of momentum vertically. This transport is downgradient in the easterly wind regime, but upgradient during a westerly wind burst. The differences in convective momentum transport between easterly and westerly wind regimes are examined. The perturbation pressure gradient accounts for an important part of the apparent momentum source. In general it is opposite in sign to the product of cloud mass flux and the vertical wind shear, with smaller magnitude. Examination of the dynamic forcing to the pressure field demonstrates that the linear forcing representing the interaction between the convective updrafts and the large-scale wind shear is the dominant term, while the nonlinear forcing is of secondary importance. Thus, parameterization schemes taking into account the linear interaction between the convective updrafts and the large-scale wind shear can capture the essential features of the perturbation pressure field. The parameterization scheme for momentum transport by Zhang and Cho is evaluated using the model simulation data. The parameterized pressure gradient force using the scheme is in excellent agreement with the simulated one. The parameterized apparent momentum source is also in good agreement with the model simulation. Other parameterization methods for the pressure gradient are also discussed.}, Annote = {doi: 10.1175/1520-0469(2003)060<1120:CMTAPP>2.0.CO;2}, Author = {Zhang, Guang J. and Wu, Xiaoqing}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvWmhhbmcvMjAwMy5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAqjuYIMjAwMy5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFrUP9K0L8MAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAABVpoYW5nAAAQAAgAANHneLIAAAARAAgAANK0kjMAAAABABgAKo7mAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AFpoYW5nOgAyMDAzLnBkZgAADgASAAgAMgAwADAAMwAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9aaGFuZy8yMDAzLnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Booktitle = {Journal of the Atmospheric Sciences}, Da = {2003/05/01}, Date-Added = {2016-06-14 23:39:50 +0000}, @@ -2056,13 +2075,13 @@ @article{zhang_and_wu_2003 Url = {http://dx.doi.org/10.1175/1520-0469(2003)060<1120:CMTAPP>2.0.CO;2}, Volume = {60}, Year = {2003}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvWmhhbmcvMjAwMy5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAqjuYIMjAwMy5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFrUP9K0L8MAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAABVpoYW5nAAAQAAgAANHneLIAAAARAAgAANK0kjMAAAABABgAKo7mAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AFpoYW5nOgAyMDAzLnBkZgAADgASAAgAMgAwADAAMwAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9aaGFuZy8yMDAzLnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/1520-0469(2003)060%3C1120:CMTAPP%3E2.0.CO;2}} @article{fritsch_and_chappell_1980, Abstract = {Abstract A parameterization formulation for incorporating the effects of midlatitude deep convection into mesoscale-numerical models is presented. The formulation is based on the hypothesis that the buoyant energy available to a parcel, in combination with a prescribed period of time for the convection to remove that energy, can be used to regulate the amount of convection in a mesoscale numerical model grid element. Individual clouds are represented as entraining moist updraft and downdraft plumes. The fraction of updraft condensate evaporated in moist downdrafts is determined from an empirical relationship between the vertical shear of the horizontal wind and precipitation efficiency. Vertical transports of horizontal momentum and warming by compensating subsidence are included in the parameterization. Since updraft and downdraft areas are sometimes a substantial fraction of mesoscale model grid-element areas, grid-point temperatures (adjusted for convection) are an area-weighted mean of updraft, downdraft and environmental temperatures.}, Annote = {doi: 10.1175/1520-0469(1980)037<1722:NPOCDM>2.0.CO;2}, Author = {Fritsch, J. M. and Chappell, C. F.}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBDLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvRnJpdHNjaC8xOTgwLnBkZk8RAcoAAAAAAcoAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAARCuMwgxOTgwLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEKs103xvpgAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAHRnJpdHNjaAAAEAAIAADR53iyAAAAEQAIAADTfMQGAAAAAQAYARCuMwAobJYAKGyLAChnewAbXgcAAphcAAIAXU1hY2ludG9zaCBIRDpVc2VyczoAZ3JhbnRmOgBDbG91ZFN0YXRpb246AGZpcmxfbGlicmFyeToAZmlybF9saWJyYXJ5X2ZpbGVzOgBGcml0c2NoOgAxOTgwLnBkZgAADgASAAgAMQA5ADgAMAAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9Gcml0c2NoLzE5ODAucGRmABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGoAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOA==}, Booktitle = {Journal of the Atmospheric Sciences}, Da = {1980/08/01}, Date = {1980/08/01}, @@ -2083,12 +2102,12 @@ @article{fritsch_and_chappell_1980 Volume = {37}, Year = {1980}, Year1 = {1980}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBDLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvRnJpdHNjaC8xOTgwLnBkZk8RAcoAAAAAAcoAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAARCuMwgxOTgwLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEKs103xvpgAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAHRnJpdHNjaAAAEAAIAADR53iyAAAAEQAIAADTfMQGAAAAAQAYARCuMwAobJYAKGyLAChnewAbXgcAAphcAAIAXU1hY2ludG9zaCBIRDpVc2VyczoAZ3JhbnRmOgBDbG91ZFN0YXRpb246AGZpcmxfbGlicmFyeToAZmlybF9saWJyYXJ5X2ZpbGVzOgBGcml0c2NoOgAxOTgwLnBkZgAADgASAAgAMQA5ADgAMAAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9Gcml0c2NoLzE5ODAucGRmABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGoAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOA==}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/1520-0469(1980)037%3C1722:NPOCDM%3E2.0.CO;2}} @article{bechtold_et_al_2008, Abstract = {Advances in simulating atmospheric variability with the ECMWF model are presented that stem from revisions of the convection and diffusion parametrizations. The revisions concern in particular the introduction of a variable convective adjustment time-scale, a convective entrainment rate proportional to the environmental relative humidity, as well as free tropospheric diffusion coefficients for heat and momentum based on Monin--Obukhov functional dependencies.The forecasting system is evaluated against analyses and observations using high-resolution medium-range deterministic and ensemble forecasts, monthly and seasonal integrations, and decadal integrations with coupled atmosphere-ocean models. The results show a significantly higher and more realistic level of model activity in terms of the amplitude of tropical and extratropical mesoscale, synoptic and planetary perturbations. Importantly, with the higher variability and reduced bias not only the probabilistic scores are improved, but also the midlatitude deterministic scores in the short and medium ranges. Furthermore, for the first time the model is able to represent a realistic spectrum of convectively coupled equatorial Kelvin and Rossby waves, and maintains a realistic amplitude of the Madden--Julian oscillation (MJO) during monthly forecasts. However, the propagation speed of the MJO is slower than observed. The higher tropical tropospheric wave activity also results in better stratospheric temperatures and winds through the deposition of momentum.The partitioning between convective and resolved precipitation is unaffected by the model changes with roughly 62% of the total global precipitation being of the convective type. Finally, the changes in convection and diffusion parametrizations resulted in a larger spread of the ensemble forecasts, which allowed the amplitude of the initial perturbations in the ensemble prediction system to decrease by 30%. Copyright {\copyright} 2008 Royal Meteorological Society}, Author = {Bechtold, Peter and K{\"o}hler, Martin and Jung, Thomas and Doblas-Reyes, Francisco and Leutbecher, Martin and Rodwell, Mark J. and Vitart, Frederic and Balsamo, Gianpaolo}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBELi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQmVjaHRvbGQvMjAwOC5wZGZPEQHMAAAAAAHMAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAobfkIMjAwOC5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARZce9OEjEwAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAACEJlY2h0b2xkABAACAAA0ed4sgAAABEACAAA04TgrAAAAAEAGAAobfkAKGyWAChsiwAoZ3sAG14HAAKYXAACAF5NYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoAQmVjaHRvbGQ6ADIwMDgucGRmAA4AEgAIADIAMAAwADgALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEtVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQmVjaHRvbGQvMjAwOC5wZGYAABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGsAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOw==}, Date-Added = {2016-06-14 23:11:58 +0000}, Date-Modified = {2016-06-14 23:11:58 +0000}, Doi = {10.1002/qj.289}, @@ -2102,12 +2121,12 @@ @article{bechtold_et_al_2008 Url = {http://dx.doi.org/10.1002/qj.289}, Volume = {134}, Year = {2008}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBELi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQmVjaHRvbGQvMjAwOC5wZGZPEQHMAAAAAAHMAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAobfkIMjAwOC5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARZce9OEjEwAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAACEJlY2h0b2xkABAACAAA0ed4sgAAABEACAAA04TgrAAAAAEAGAAobfkAKGyWAChsiwAoZ3sAG14HAAKYXAACAF5NYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoAQmVjaHRvbGQ6ADIwMDgucGRmAA4AEgAIADIAMAAwADgALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEtVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQmVjaHRvbGQvMjAwOC5wZGYAABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGsAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOw==}, Bdsk-Url-1 = {http://dx.doi.org/10.1002/qj.289}} @article{han_and_pan_2011, Annote = {doi: 10.1175/WAF-D-10-05038.1}, Author = {Han, Jongil and Pan, Hua-Lu}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxA/Li4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvSGFuLzIwMTEucGRmTxEBvgAAAAABvgACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAA0eckUkgrAAAAWsT5CDIwMTEucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADC1cfTGvlvAAAAAAAAAAAAAgAFAAAJIAAAAAAAAAAAAAAAAAAAAANIYW4AABAACAAA0ed4sgAAABEACAAA0xtNzwAAAAEAGABaxPkAKGyWAChsiwAoZ3sAG14HAAKYXAACAFlNYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoASGFuOgAyMDExLnBkZgAADgASAAgAMgAwADEAMQAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIARlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9IYW4vMjAxMS5wZGYAEwABLwAAFQACAA3//wAAAAgADQAaACQAZgAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIo}, Booktitle = {Weather and Forecasting}, Da = {2011/08/01}, Date = {2011/08/01}, @@ -2128,22 +2147,22 @@ @article{han_and_pan_2011 Volume = {26}, Year = {2011}, Year1 = {2011}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxA/Li4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvSGFuLzIwMTEucGRmTxEBvgAAAAABvgACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAA0eckUkgrAAAAWsT5CDIwMTEucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADC1cfTGvlvAAAAAAAAAAAAAgAFAAAJIAAAAAAAAAAAAAAAAAAAAANIYW4AABAACAAA0ed4sgAAABEACAAA0xtNzwAAAAEAGABaxPkAKGyWAChsiwAoZ3sAG14HAAKYXAACAFlNYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoASGFuOgAyMDExLnBkZgAADgASAAgAMgAwADEAMQAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIARlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9IYW4vMjAxMS5wZGYAEwABLwAAFQACAA3//wAAAAgADQAaACQAZgAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIo}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/WAF-D-10-05038.1}} @article{pan_and_wu_1995, Author = {Pan, H. -L. and W.-S. Wu}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxA/Li4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvUGFuLzE5OTUucGRmTxEBvgAAAAABvgACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAA0eckUkgrAAAAwtTNCDE5OTUucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADCtU/TGvMJAAAAAAAAAAAAAgAFAAAJIAAAAAAAAAAAAAAAAAAAAANQYW4AABAACAAA0ed4sgAAABEACAAA0xtHaQAAAAEAGADC1M0AKGyWAChsiwAoZ3sAG14HAAKYXAACAFlNYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoAUGFuOgAxOTk1LnBkZgAADgASAAgAMQA5ADkANQAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIARlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9QYW4vMTk5NS5wZGYAEwABLwAAFQACAA3//wAAAAgADQAaACQAZgAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIo}, Date-Added = {2016-06-14 23:06:41 +0000}, Date-Modified = {2016-06-14 23:06:41 +0000}, Journal = {NMC Office Note, No. 409}, Pages = {40pp}, Title = {Implementing a Mass Flux Convection Parameterization Package for the NMC Medium-Range Forecast Model}, - Year = {1995}} + Year = {1995}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxA/Li4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvUGFuLzE5OTUucGRmTxEBvgAAAAABvgACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAA0eckUkgrAAAAwtTNCDE5OTUucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADCtU/TGvMJAAAAAAAAAAAAAgAFAAAJIAAAAAAAAAAAAAAAAAAAAANQYW4AABAACAAA0ed4sgAAABEACAAA0xtHaQAAAAEAGADC1M0AKGyWAChsiwAoZ3sAG14HAAKYXAACAFlNYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoAUGFuOgAxOTk1LnBkZgAADgASAAgAMQA5ADkANQAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIARlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9QYW4vMTk5NS5wZGYAEwABLwAAFQACAA3//wAAAAgADQAaACQAZgAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIo}} @article{grell_1993, Annote = {doi: 10.1175/1520-0493(1993)121<0764:PEOAUB>2.0.CO;2}, Author = {Grell, Georg A.}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvR3JlbGwvMTk5My5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAoie0IMTk5My5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMK4dtMa9LMAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAABUdyZWxsAAAQAAgAANHneLIAAAARAAgAANMbSRMAAAABABgAKIntAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AEdyZWxsOgAxOTkzLnBkZgAADgASAAgAMQA5ADkAMwAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9HcmVsbC8xOTkzLnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Booktitle = {Monthly Weather Review}, Da = {1993/03/01}, Date = {1993/03/01}, @@ -2164,11 +2183,11 @@ @article{grell_1993 Volume = {121}, Year = {1993}, Year1 = {1993}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvR3JlbGwvMTk5My5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAoie0IMTk5My5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMK4dtMa9LMAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAABUdyZWxsAAAQAAgAANHneLIAAAARAAgAANMbSRMAAAABABgAKIntAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AEdyZWxsOgAxOTkzLnBkZgAADgASAAgAMQA5ADkAMwAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9HcmVsbC8xOTkzLnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/1520-0493(1993)121%3C0764:PEOAUB%3E2.0.CO;2}} @article{arakawa_and_schubert_1974, Author = {Arakawa, A and Schubert, WH}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBDLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQXJha2F3YS8xOTc0LnBkZk8RAcoAAAAAAcoAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAAChtVQgxOTc0LnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKG1ctM8h9AAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAHQXJha2F3YQAAEAAIAADR53iyAAAAEQAIAAC0z4RkAAAAAQAYAChtVQAobJYAKGyLAChnewAbXgcAAphcAAIAXU1hY2ludG9zaCBIRDpVc2VyczoAZ3JhbnRmOgBDbG91ZFN0YXRpb246AGZpcmxfbGlicmFyeToAZmlybF9saWJyYXJ5X2ZpbGVzOgBBcmFrYXdhOgAxOTc0LnBkZgAADgASAAgAMQA5ADcANAAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9BcmFrYXdhLzE5NzQucGRmABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGoAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOA==}, Date-Added = {2016-06-14 23:04:30 +0000}, Date-Modified = {2018-07-18 19:00:17 +0000}, Isi = {A1974S778800004}, @@ -2181,6 +2200,7 @@ @article{arakawa_and_schubert_1974 Title = {Interaction of a cumulus cloud ensemble with the large-scale environment, Part I}, Volume = {31}, Year = {1974}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBDLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQXJha2F3YS8xOTc0LnBkZk8RAcoAAAAAAcoAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAAChtVQgxOTc0LnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKG1ctM8h9AAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAHQXJha2F3YQAAEAAIAADR53iyAAAAEQAIAAC0z4RkAAAAAQAYAChtVQAobJYAKGyLAChnewAbXgcAAphcAAIAXU1hY2ludG9zaCBIRDpVc2VyczoAZ3JhbnRmOgBDbG91ZFN0YXRpb246AGZpcmxfbGlicmFyeToAZmlybF9saWJyYXJ5X2ZpbGVzOgBBcmFrYXdhOgAxOTc0LnBkZgAADgASAAgAMQA5ADcANAAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9BcmFrYXdhLzE5NzQucGRmABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGoAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOA==}, Bdsk-Url-1 = {http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/A1974S778800004}} @article{harshvardhan_et_al_1989, @@ -2414,7 +2434,6 @@ @article{akmaev_1991 @article{siebesma_et_al_2007, Abstract = {A better conceptual understanding and more realistic parameterizations of convective boundary layers in climate and weather prediction models have been major challenges in meteorological research. In particular, parameterizations of the dry convective boundary layer, in spite of the absence of water phase-changes and its consequent simplicity as compared to moist convection, typically suffer from problems in attempting to represent realistically the boundary layer growth and what is often referred to as countergradient fluxes. The eddy-diffusivity (ED) approach has been relatively successful in representing some characteristics of neutral boundary layers and surface layers in general. The mass-flux (MF) approach, on the other hand, has been used for the parameterization of shallow and deep moist convection. In this paper, a new approach that relies on a combination of the ED and MF parameterizations (EDMF) is proposed for the dry convective boundary layer. It is shown that the EDMF approach follows naturally from a decomposition of the turbulent fluxes into 1) a part that includes strong organized updrafts, and 2) a remaining turbulent field. At the basis of the EDMF approach is the concept that nonlocal subgrid transport due to the strong updrafts is taken into account by the MF approach, while the remaining transport is taken into account by an ED closure. Large-eddy simulation (LES) results of the dry convective boundary layer are used to support the theoretical framework of this new approach and to determine the parameters of the EDMF model. The performance of the new formulation is evaluated against LES results, and it is shown that the EDMF closure is able to reproduce the main properties of dry convective boundary layers in a realistic manner. Furthermore, it will be shown that this approach has strong advantages over the more traditional countergradient approach, especially in the entrainment layer. As a result, this EDMF approach opens the way to parameterize the clear and cumulus-topped boundary layer in a simple and unified way.}, Author = {Siebesma, A. Pier and Soares, Pedro M. M. and Teixeira, Joao}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBELi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvU2llYmVzbWEvMjAwNy5wZGZPEQHMAAAAAAHMAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAqYEwIMjAwNy5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACphyMc7+4hQREYgQ0FSTwACAAUAAAkgAAAAAAAAAAAAAAAAAAAACFNpZWJlc21hABAACAAA0ed4sgAAABEACAAAxzxd+AAAAAEAGAAqYEwAKGyWAChsiwAoZ3sAG14HAAKYXAACAF5NYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoAU2llYmVzbWE6ADIwMDcucGRmAA4AEgAIADIAMAAwADcALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEtVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvU2llYmVzbWEvMjAwNy5wZGYAABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGsAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOw==}, Date-Added = {2016-05-20 17:17:49 +0000}, Date-Modified = {2016-05-20 17:17:49 +0000}, Doi = {DOI 10.1175/JAS3888.1}, @@ -2428,12 +2447,12 @@ @article{siebesma_et_al_2007 Title = {A combined eddy-diffusivity mass-flux approach for the convective boundary layer}, Volume = {64}, Year = {2007}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBELi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvU2llYmVzbWEvMjAwNy5wZGZPEQHMAAAAAAHMAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAqYEwIMjAwNy5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACphyMc7+4hQREYgQ0FSTwACAAUAAAkgAAAAAAAAAAAAAAAAAAAACFNpZWJlc21hABAACAAA0ed4sgAAABEACAAAxzxd+AAAAAEAGAAqYEwAKGyWAChsiwAoZ3sAG14HAAKYXAACAF5NYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoAU2llYmVzbWE6ADIwMDcucGRmAA4AEgAIADIAMAAwADcALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEtVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvU2llYmVzbWEvMjAwNy5wZGYAABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGsAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOw==}, Bdsk-Url-1 = {http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/000245742600011}} @article{soares_et_al_2004, Abstract = {Recently, a new consistent way of parametrizing simultaneously local and non-local turbulent transport for the convective atmospheric boundary layer has been proposed and tested for the clear boundary layer. This approach assumes that in the convective boundary layer the subgrid-scale fluxes result from two different mixing scales: small eddies, that are parametrized by an eddy-diffusivity approach, and thermals, which are represented by a mass-flux contribution. Since the interaction between the cloud layer and the underlying sub-cloud layer predominantly takes place through strong updraughts, this approach offers an interesting avenue of establishing a unified description of the turbulent transport in the cumulus-topped boundary layer. This paper explores the possibility of such a new approach for the cumulus-topped boundary layer. In the sub-cloud and cloud layers, the mass-flux term represents the effect of strong updraughts. These are modelled by a simple entraining parcel, which determines the mean properties of the strong updraughts, the boundary-layer height, the lifting condensation level and cloud top. The residual smaller-scale turbulent transport is parametrized with an eddy-diffusivity approach that uses a turbulent kinetic energy closure. The new scheme is implemented and tested in the research model MesoNH. Copyright {\copyright} 2004 Royal Meteorological Society}, Author = {Soares, P. M. M. and Miranda, P. M. A. and Siebesma, A. P. and Teixeira, J.}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBCLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvU29hcmVzLzIwMDQucGRmTxEBxgAAAAABxgACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAA0eckUkgrAAAAWIC2CDIwMDQucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYf6DSsqNwAAAAAAAAAAAAAgAFAAAJIAAAAAAAAAAAAAAAAAAAAAZTb2FyZXMAEAAIAADR53iyAAAAEQAIAADSswXgAAAAAQAYAFiAtgAobJYAKGyLAChnewAbXgcAAphcAAIAXE1hY2ludG9zaCBIRDpVc2VyczoAZ3JhbnRmOgBDbG91ZFN0YXRpb246AGZpcmxfbGlicmFyeToAZmlybF9saWJyYXJ5X2ZpbGVzOgBTb2FyZXM6ADIwMDQucGRmAA4AEgAIADIAMAAwADQALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAElVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvU29hcmVzLzIwMDQucGRmAAATAAEvAAAVAAIADf//AAAACAANABoAJABpAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjM=}, Date-Added = {2016-05-20 17:17:49 +0000}, Date-Modified = {2016-05-20 17:17:49 +0000}, Doi = {10.1256/qj.03.223}, @@ -2447,11 +2466,11 @@ @article{soares_et_al_2004 Url = {http://dx.doi.org/10.1256/qj.03.223}, Volume = {130}, Year = {2004}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBCLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvU29hcmVzLzIwMDQucGRmTxEBxgAAAAABxgACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAA0eckUkgrAAAAWIC2CDIwMDQucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYf6DSsqNwAAAAAAAAAAAAAgAFAAAJIAAAAAAAAAAAAAAAAAAAAAZTb2FyZXMAEAAIAADR53iyAAAAEQAIAADSswXgAAAAAQAYAFiAtgAobJYAKGyLAChnewAbXgcAAphcAAIAXE1hY2ludG9zaCBIRDpVc2VyczoAZ3JhbnRmOgBDbG91ZFN0YXRpb246AGZpcmxfbGlicmFyeToAZmlybF9saWJyYXJ5X2ZpbGVzOgBTb2FyZXM6ADIwMDQucGRmAA4AEgAIADIAMAAwADQALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAElVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvU29hcmVzLzIwMDQucGRmAAATAAEvAAAVAAIADf//AAAACAANABoAJABpAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjM=}, Bdsk-Url-1 = {http://dx.doi.org/10.1256/qj.03.223}} @article{troen_and_mahrt_1986, Author = {Troen, IB and Mahrt, L.}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvVHJvZW4vMTk4Ni5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAABNeegIMTk4Ni5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE13kNKUWwUAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAABVRyb2VuAAAQAAgAANHneLIAAAARAAgAANKUvXUAAAABABgATXnoAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AFRyb2VuOgAxOTg2LnBkZgAADgASAAgAMQA5ADgANgAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9Ucm9lbi8xOTg2LnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Date-Added = {2016-05-20 17:17:49 +0000}, Date-Modified = {2016-05-20 17:17:49 +0000}, Doi = {10.1007/BF00122760}, @@ -2465,13 +2484,13 @@ @article{troen_and_mahrt_1986 Url = {http://dx.doi.org/10.1007/BF00122760}, Volume = {37}, Year = {1986}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvVHJvZW4vMTk4Ni5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAABNeegIMTk4Ni5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE13kNKUWwUAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAABVRyb2VuAAAQAAgAANHneLIAAAARAAgAANKUvXUAAAABABgATXnoAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AFRyb2VuOgAxOTg2LnBkZgAADgASAAgAMQA5ADgANgAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9Ucm9lbi8xOTg2LnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Bdsk-Url-1 = {http://dx.doi.org/10.1007/BF00122760}} @article{macvean_and_mason_1990, Abstract = {Abstract In a recent paper, Kuo and Schubert demonstrated the lack of observational support for the relevance of the criterion for cloud-top entrainment instability proposed by Randall and by Deardorff. Here we derive a new criterion, based on a model of the instability as resulting from the energy released close to cloud top, by Mixing between saturated boundary-layer air and unsaturated air from above the capping inversion. The condition is derived by considering the net conversion from potential to kinetic energy in a system consisting of two layers of fluid straddling cloud-top, when a small amount of mixing occurs between these layers. This contrasts with previous analyses, which only considered the change in buoyancy of the cloud layer when unsaturated air is mixed into it. In its most general form, this new criterion depends on the ratio of the depths of the layers involved in the mixing. It is argued that, for a self-sustaining instability, there must be a net release of kinetic energy on the same depth and time scales as the entrainment process itself. There are two plausible ways in which this requirement may be satisfied. Either one takes the depths of the layers involved in the mixing to each be comparable to the vertical scale of the entrainment process, which is typically of order tens of meters or less, or alternatively, one must allow for the efficiency with which energy released by mixing through a much deeper lower layer becomes available to initiate further entrainment. In both cases the same criterion for instability results. This criterion is much more restrictive than that proposed by Randall and by Deardorff; furthermore, the observational data is then consistent with the predictions of the current theory. Further analysis provides estimates of the turbulent fluxes associated with cloud-top entrainment instability. This analysis effectively constitutes an energetically consistent turbulence closure for models of boundary layers with cloud. The implications for such numerical models are discussed. Comparisons are also made with other possible criteria for cloud-top entrainment instability which have recently been suggested.}, Annote = {doi: 10.1175/1520-0469(1990)047<1012:CTEITS>2.0.CO;2}, Author = {MacVean, M. K. and Mason, P. J.}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBDLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvTWFjVmVhbi8xOTkwLnBkZk8RAcoAAAAAAcoAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAAFx8zwgxOTkwLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXHyn0rkkRQAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAHTWFjVmVhbgAAEAAIAADR53iyAAAAEQAIAADSuYa1AAAAAQAYAFx8zwAobJYAKGyLAChnewAbXgcAAphcAAIAXU1hY2ludG9zaCBIRDpVc2VyczoAZ3JhbnRmOgBDbG91ZFN0YXRpb246AGZpcmxfbGlicmFyeToAZmlybF9saWJyYXJ5X2ZpbGVzOgBNYWNWZWFuOgAxOTkwLnBkZgAADgASAAgAMQA5ADkAMAAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9NYWNWZWFuLzE5OTAucGRmABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGoAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOA==}, Booktitle = {Journal of the Atmospheric Sciences}, Da = {1990/04/01}, Date-Added = {2016-05-20 17:16:05 +0000}, @@ -2490,11 +2509,11 @@ @article{macvean_and_mason_1990 Url = {http://dx.doi.org/10.1175/1520-0469(1990)047<1012:CTEITS>2.0.CO;2}, Volume = {47}, Year = {1990}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBDLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvTWFjVmVhbi8xOTkwLnBkZk8RAcoAAAAAAcoAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAAFx8zwgxOTkwLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXHyn0rkkRQAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAHTWFjVmVhbgAAEAAIAADR53iyAAAAEQAIAADSuYa1AAAAAQAYAFx8zwAobJYAKGyLAChnewAbXgcAAphcAAIAXU1hY2ludG9zaCBIRDpVc2VyczoAZ3JhbnRmOgBDbG91ZFN0YXRpb246AGZpcmxfbGlicmFyeToAZmlybF9saWJyYXJ5X2ZpbGVzOgBNYWNWZWFuOgAxOTkwLnBkZgAADgASAAgAMQA5ADkAMAAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9NYWNWZWFuLzE5OTAucGRmABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGoAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOA==}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/1520-0469(1990)047%3C1012:CTEITS%3E2.0.CO;2}} @article{louis_1979, Author = {Louis, JF}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvTG91aXMvMTk3OS5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAonogIMTk3OS5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACiej8FuU4pQREYgQ0FSTwACAAUAAAkgAAAAAAAAAAAAAAAAAAAABUxvdWlzAAAQAAgAANHneLIAAAARAAgAAMFutfoAAAABABgAKJ6IAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AExvdWlzOgAxOTc5LnBkZgAADgASAAgAMQA5ADcAOQAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9Mb3Vpcy8xOTc5LnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Date-Added = {2016-05-20 17:15:52 +0000}, Date-Modified = {2016-05-20 17:15:52 +0000}, Isi = {A1979HT69700004}, @@ -2507,12 +2526,12 @@ @article{louis_1979 Title = {A PARAMETRIC MODEL OF VERTICAL EDDY FLUXES IN THE ATMOSPHERE}, Volume = {17}, Year = {1979}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBBLi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvTG91aXMvMTk3OS5wZGZPEQHEAAAAAAHEAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAonogIMTk3OS5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACiej8FuU4pQREYgQ0FSTwACAAUAAAkgAAAAAAAAAAAAAAAAAAAABUxvdWlzAAAQAAgAANHneLIAAAARAAgAAMFutfoAAAABABgAKJ6IAChslgAobIsAKGd7ABteBwACmFwAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AExvdWlzOgAxOTc5LnBkZgAADgASAAgAMQA5ADcAOQAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIASFVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9Mb3Vpcy8xOTc5LnBkZgATAAEvAAAVAAIADf//AAAACAANABoAJABoAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAjA=}, Bdsk-Url-1 = {http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/A1979HT69700004}} @article{lock_et_al_2000, Abstract = {A new boundary layer turbulent mixing scheme has been developed for use in the UKMO weather forecasting and climate prediction models. This includes a representation of nonlocal mixing (driven by both surface fluxes and cloud-top processes) in unstable layers, either coupled to or decoupled from the surface, and an explicit entrainment parameterization. The scheme is formulated in moist conserved variables so that it can treat both dry and cloudy layers. Details of the scheme and examples of its performance in single-column model tests are presented.}, Author = {Lock, AP and Brown, AR and Bush, MR and Martin, GM and Smith, RNB}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBALi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvTG9jay8yMDAwLnBkZk8RAcAAAAAAAcAAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAACibewgyMDAwLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKJuLywPrPAAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAETG9jawAQAAgAANHneLIAAAARAAgAAMsETawAAAABABgAKJt7AChslgAobIsAKGd7ABteBwACmFwAAgBaTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AExvY2s6ADIwMDAucGRmAA4AEgAIADIAMAAwADAALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEdVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvTG9jay8yMDAwLnBkZgAAEwABLwAAFQACAA3//wAAAAgADQAaACQAZwAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIr}, Date-Added = {2016-05-20 17:15:36 +0000}, Date-Modified = {2016-05-20 17:15:36 +0000}, Isi = {000089461100008}, @@ -2525,13 +2544,13 @@ @article{lock_et_al_2000 Title = {A new boundary layer mixing scheme. {P}art {I}: Scheme description and single-column model tests}, Volume = {128}, Year = {2000}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBALi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvTG9jay8yMDAwLnBkZk8RAcAAAAAAAcAAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAACibewgyMDAwLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKJuLywPrPAAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAETG9jawAQAAgAANHneLIAAAARAAgAAMsETawAAAABABgAKJt7AChslgAobIsAKGd7ABteBwACmFwAAgBaTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AExvY2s6ADIwMDAucGRmAA4AEgAIADIAMAAwADAALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEdVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvTG9jay8yMDAwLnBkZgAAEwABLwAAFQACAA3//wAAAAgADQAaACQAZwAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIr}, Bdsk-Url-1 = {http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/000089461100008}} @article{hong_and_pan_1996, Abstract = {Abstract In this paper, the incorporation of a simple atmospheric boundary layer diffusion scheme into the NCEP Medium-Range Forecast Model is described. A boundary layer diffusion package based on the Troen and Mahrt nonlocal diffusion concept has been tested for possible operational implementation. The results from this approach are compared with those from the local diffusion approach, which is the current operational scheme, and verified against FIFE observations during 9?10 August 1987. The comparisons between local and nonlocal approaches are extended to the forecast for a heavy rain case of 15?17 May 1995. The sensitivity of both the boundary layer development and the precipitation forecast to the tuning parameters in the nonlocal diffusion scheme is also investigated. Special attention is given to the interaction of boundary layer processes with precipitation physics. Some results of parallel runs during August 1995 are also presented.}, Annote = {doi: 10.1175/1520-0493(1996)124<2322:NBLVDI>2.0.CO;2}, Author = {Hong, Song-You and Pan, Hua-Lu}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBALi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvSG9uZy8xOTk2LnBkZk8RAcAAAAAAAcAAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAAE18FggxOTk2LnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATXvY0pRb8QAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAESG9uZwAQAAgAANHneLIAAAARAAgAANKUvmEAAAABABgATXwWAChslgAobIsAKGd7ABteBwACmFwAAgBaTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AEhvbmc6ADE5OTYucGRmAA4AEgAIADEAOQA5ADYALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEdVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvSG9uZy8xOTk2LnBkZgAAEwABLwAAFQACAA3//wAAAAgADQAaACQAZwAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIr}, Booktitle = {Monthly Weather Review}, Da = {1996/10/01}, Date = {1996/10/01}, @@ -2552,13 +2571,13 @@ @article{hong_and_pan_1996 Volume = {124}, Year = {1996}, Year1 = {1996}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBALi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvSG9uZy8xOTk2LnBkZk8RAcAAAAAAAcAAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAANHnJFJIKwAAAE18FggxOTk2LnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATXvY0pRb8QAAAAAAAAAAAAIABQAACSAAAAAAAAAAAAAAAAAAAAAESG9uZwAQAAgAANHneLIAAAARAAgAANKUvmEAAAABABgATXwWAChslgAobIsAKGd7ABteBwACmFwAAgBaTWFjaW50b3NoIEhEOlVzZXJzOgBncmFudGY6AENsb3VkU3RhdGlvbjoAZmlybF9saWJyYXJ5OgBmaXJsX2xpYnJhcnlfZmlsZXM6AEhvbmc6ADE5OTYucGRmAA4AEgAIADEAOQA5ADYALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEdVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvSG9uZy8xOTk2LnBkZgAAEwABLwAAFQACAA3//wAAAAgADQAaACQAZwAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIr}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/1520-0493(1996)124%3C2322:NBLVDI%3E2.0.CO;2}} @article{han_and_pan_2006, Abstract = {Abstract A parameterization of the convection-induced pressure gradient force (PGF) in convective momentum transport (CMT) is tested for hurricane intensity forecasting using NCEP's operational Global Forecast System (GFS) and its nested Regional Spectral Model (RSM). In the parameterization the PGF is assumed to be proportional to the product of the cloud mass flux and vertical wind shear. Compared to control forecasts using the present operational GFS and RSM where the PGF effect in CMT is taken into account empirically, the new PGF parameterization helps increase hurricane intensity by reducing the vertical momentum exchange, giving rise to a closer comparison to the observations. In addition, the new PGF parameterization forecasts not only show more realistically organized precipitation patterns with enhanced hurricane intensity but also reduce the forecast track error. Nevertheless, the model forecasts with the new PGF parameterization still largely underpredict the observed intensity. One of the many possible reasons for the large underprediction may be the absence of hurricane initialization in the models.}, Annote = {doi: 10.1175/MWR3090.1}, Author = {Han, Jongil and Pan, Hua-Lu}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxA/Li4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvSGFuLzIwMDYucGRmTxEBvgAAAAABvgACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAA0eckUkgrAAAAWsT5CDIwMDYucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABazFjStCvVAAAAAAAAAAAAAgAFAAAJIAAAAAAAAAAAAAAAAAAAAANIYW4AABAACAAA0ed4sgAAABEACAAA0rSORQAAAAEAGABaxPkAKGyWAChsiwAoZ3sAG14HAAKYXAACAFlNYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoASGFuOgAyMDA2LnBkZgAADgASAAgAMgAwADAANgAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIARlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9IYW4vMjAwNi5wZGYAEwABLwAAFQACAA3//wAAAAgADQAaACQAZgAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIo}, Booktitle = {Monthly Weather Review}, Da = {2006/02/01}, Date-Added = {2016-05-20 17:11:17 +0000}, @@ -2577,11 +2596,11 @@ @article{han_and_pan_2006 Url = {http://dx.doi.org/10.1175/MWR3090.1}, Volume = {134}, Year = {2006}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxA/Li4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvSGFuLzIwMDYucGRmTxEBvgAAAAABvgACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAA0eckUkgrAAAAWsT5CDIwMDYucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABazFjStCvVAAAAAAAAAAAAAgAFAAAJIAAAAAAAAAAAAAAAAAAAAANIYW4AABAACAAA0ed4sgAAABEACAAA0rSORQAAAAEAGABaxPkAKGyWAChsiwAoZ3sAG14HAAKYXAACAFlNYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoASGFuOgAyMDA2LnBkZgAADgASAAgAMgAwADAANgAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIARlVzZXJzL2dyYW50Zi9DbG91ZFN0YXRpb24vZmlybF9saWJyYXJ5L2ZpcmxfbGlicmFyeV9maWxlcy9IYW4vMjAwNi5wZGYAEwABLwAAFQACAA3//wAAAAgADQAaACQAZgAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAIo}, Bdsk-Url-1 = {http://dx.doi.org/10.1175/MWR3090.1}} @article{businger_et_al_1971, Author = {Businger, JA and Wyngaard, JC and Izumi, Y and Bradley, EF}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBELi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQnVzaW5nZXIvMTk3MS5wZGZPEQHMAAAAAAHMAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAodUUIMTk3MS5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACh1cbTPIxwAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAACEJ1c2luZ2VyABAACAAA0ed4sgAAABEACAAAtM+FjAAAAAEAGAAodUUAKGyWAChsiwAoZ3sAG14HAAKYXAACAF5NYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoAQnVzaW5nZXI6ADE5NzEucGRmAA4AEgAIADEAOQA3ADEALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEtVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQnVzaW5nZXIvMTk3MS5wZGYAABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGsAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOw==}, Date-Added = {2016-05-20 17:10:50 +0000}, Date-Modified = {2018-07-18 18:58:08 +0000}, Isi = {A1971I822800004}, @@ -2594,6 +2613,7 @@ @article{businger_et_al_1971 Title = {Flux-profile relationships in the atmospheric surface layer}, Volume = {28}, Year = {1971}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxBELi4vLi4vQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQnVzaW5nZXIvMTk3MS5wZGZPEQHMAAAAAAHMAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAADR5yRSSCsAAAAodUUIMTk3MS5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACh1cbTPIxwAAAAAAAAAAAACAAUAAAkgAAAAAAAAAAAAAAAAAAAACEJ1c2luZ2VyABAACAAA0ed4sgAAABEACAAAtM+FjAAAAAEAGAAodUUAKGyWAChsiwAoZ3sAG14HAAKYXAACAF5NYWNpbnRvc2ggSEQ6VXNlcnM6AGdyYW50ZjoAQ2xvdWRTdGF0aW9uOgBmaXJsX2xpYnJhcnk6AGZpcmxfbGlicmFyeV9maWxlczoAQnVzaW5nZXI6ADE5NzEucGRmAA4AEgAIADEAOQA3ADEALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAEtVc2Vycy9ncmFudGYvQ2xvdWRTdGF0aW9uL2ZpcmxfbGlicmFyeS9maXJsX2xpYnJhcnlfZmlsZXMvQnVzaW5nZXIvMTk3MS5wZGYAABMAAS8AABUAAgAN//8AAAAIAA0AGgAkAGsAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACOw==}, Bdsk-Url-1 = {http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:ut/A1971I822800004}} @article{xu_and_randall_1996, @@ -2784,18 +2804,17 @@ @article{kim_and_arakawa_1995 @techreport{hou_et_al_2002, Author = {Y. Hou and S. Moorthi and K. Campana}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxAiLi4vLi4vemhhbmctbGliL2hvdV9ldF9hbF8yMDAyLnBkZk8RAdwAAAAAAdwAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAAM/T1mZIKwAAAFKkjRJob3VfZXRfYWxfMjAwMi5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUqai02OGCgAAAAAAAAAAAAIAAgAACSAAAAAAAAAAAAAAAAAAAAAJemhhbmctbGliAAAQAAgAAM/UKsYAAAARAAgAANNj2moAAAABABgAUqSNAE1lSgAj19QACTbFAAk2xAACZvkAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBtYW56aGFuZzoARG9jdW1lbnRzOgBNYW4uWmhhbmc6AGdtdGItZG9jOgB6aGFuZy1saWI6AGhvdV9ldF9hbF8yMDAyLnBkZgAADgAmABIAaABvAHUAXwBlAHQAXwBhAGwAXwAyADAAMAAyAC4AcABkAGYADwAaAAwATQBhAGMAaQBuAHQAbwBzAGgAIABIAEQAEgBIVXNlcnMvbWFuemhhbmcvRG9jdW1lbnRzL01hbi5aaGFuZy9nbXRiLWRvYy96aGFuZy1saWIvaG91X2V0X2FsXzIwMDIucGRmABMAAS8AABUAAgAP//8AAAAIAA0AGgAkAEkAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACKQ==}, Date-Added = {2016-05-19 19:52:22 +0000}, Date-Modified = {2016-05-20 15:14:59 +0000}, Institution = {NCEP}, Number = {441}, Title = {Parameterization of Solar Radiation Transfer}, Type = {office note}, - Year = {2002}} + Year = {2002}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxAiLi4vLi4vemhhbmctbGliL2hvdV9ldF9hbF8yMDAyLnBkZk8RAdwAAAAAAdwAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAAM/T1mZIKwAAAFKkjRJob3VfZXRfYWxfMjAwMi5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUqai02OGCgAAAAAAAAAAAAIAAgAACSAAAAAAAAAAAAAAAAAAAAAJemhhbmctbGliAAAQAAgAAM/UKsYAAAARAAgAANNj2moAAAABABgAUqSNAE1lSgAj19QACTbFAAk2xAACZvkAAgBbTWFjaW50b3NoIEhEOlVzZXJzOgBtYW56aGFuZzoARG9jdW1lbnRzOgBNYW4uWmhhbmc6AGdtdGItZG9jOgB6aGFuZy1saWI6AGhvdV9ldF9hbF8yMDAyLnBkZgAADgAmABIAaABvAHUAXwBlAHQAXwBhAGwAXwAyADAAMAAyAC4AcABkAGYADwAaAAwATQBhAGMAaQBuAHQAbwBzAGgAIABIAEQAEgBIVXNlcnMvbWFuemhhbmcvRG9jdW1lbnRzL01hbi5aaGFuZy9nbXRiLWRvYy96aGFuZy1saWIvaG91X2V0X2FsXzIwMDIucGRmABMAAS8AABUAAgAP//8AAAAIAA0AGgAkAEkAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAACKQ==}} @article{hu_and_stamnes_1993, Author = {Y.X. Hu and K. Stamnes}, - Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxAnLi4vLi4vemhhbmctbGliL2h1X2FuZF9zdGFtbmVzXzE5OTMucGRmTxEB8AAAAAAB8AACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAAz9PWZkgrAAAAUqSNF2h1X2FuZF9zdGFtbmVzXzE5OTMucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSpJHTY3R+AAAAAAAAAAAAAgACAAAJIAAAAAAAAAAAAAAAAAAAAAl6aGFuZy1saWIAABAACAAAz9QqxgAAABEACAAA02PI3gAAAAEAGABSpI0ATWVKACPX1AAJNsUACTbEAAJm+QACAGBNYWNpbnRvc2ggSEQ6VXNlcnM6AG1hbnpoYW5nOgBEb2N1bWVudHM6AE1hbi5aaGFuZzoAZ210Yi1kb2M6AHpoYW5nLWxpYjoAaHVfYW5kX3N0YW1uZXNfMTk5My5wZGYADgAwABcAaAB1AF8AYQBuAGQAXwBzAHQAYQBtAG4AZQBzAF8AMQA5ADkAMwAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIATVVzZXJzL21hbnpoYW5nL0RvY3VtZW50cy9NYW4uWmhhbmcvZ210Yi1kb2MvemhhbmctbGliL2h1X2FuZF9zdGFtbmVzXzE5OTMucGRmAAATAAEvAAAVAAIAD///AAAACAANABoAJABOAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAkI=}, Date-Added = {2016-05-19 19:31:56 +0000}, Date-Modified = {2016-05-20 15:13:12 +0000}, Journal = {J. Climate}, @@ -2803,4 +2822,5 @@ @article{hu_and_stamnes_1993 Pages = {728-742}, Title = {An accurate parameterization of the radiative properties of water clouds suitable for use in climate models}, Volume = {6}, - Year = {1993}} + Year = {1993}, + Bdsk-File-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxAnLi4vLi4vemhhbmctbGliL2h1X2FuZF9zdGFtbmVzXzE5OTMucGRmTxEB8AAAAAAB8AACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAAz9PWZkgrAAAAUqSNF2h1X2FuZF9zdGFtbmVzXzE5OTMucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSpJHTY3R+AAAAAAAAAAAAAgACAAAJIAAAAAAAAAAAAAAAAAAAAAl6aGFuZy1saWIAABAACAAAz9QqxgAAABEACAAA02PI3gAAAAEAGABSpI0ATWVKACPX1AAJNsUACTbEAAJm+QACAGBNYWNpbnRvc2ggSEQ6VXNlcnM6AG1hbnpoYW5nOgBEb2N1bWVudHM6AE1hbi5aaGFuZzoAZ210Yi1kb2M6AHpoYW5nLWxpYjoAaHVfYW5kX3N0YW1uZXNfMTk5My5wZGYADgAwABcAaAB1AF8AYQBuAGQAXwBzAHQAYQBtAG4AZQBzAF8AMQA5ADkAMwAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIATVVzZXJzL21hbnpoYW5nL0RvY3VtZW50cy9NYW4uWmhhbmcvZ210Yi1kb2MvemhhbmctbGliL2h1X2FuZF9zdGFtbmVzXzE5OTMucGRmAAATAAEvAAAVAAIAD///AAAACAANABoAJABOAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAkI=}} diff --git a/physics/docs/pdftxt/CPT_CSAW.txt b/physics/docs/pdftxt/CPT_CSAW.txt index b7e178f82..723e65b20 100644 --- a/physics/docs/pdftxt/CPT_CSAW.txt +++ b/physics/docs/pdftxt/CPT_CSAW.txt @@ -1,5 +1,5 @@ /** -\page CSAW_scheme Scale-Aware Chikira-Sugiyama Scale-aware Convection Scheme with Arakawa-Wu Extension +\page CSAW_scheme Chikira-Sugiyama Scale-Aware Convection Scheme with Arakawa-Wu Extension \section cs_descrip Description The Chikira-Sugiyama cumulus scheme (Chikira and Sugiyama (2010) \cite Chikira_2010) with prognostic closure and diff --git a/physics/docs/pdftxt/CPT_MG3.txt b/physics/docs/pdftxt/CPT_MG3.txt index c6d169dc1..3dc3fece4 100644 --- a/physics/docs/pdftxt/CPT_MG3.txt +++ b/physics/docs/pdftxt/CPT_MG3.txt @@ -12,7 +12,7 @@ and number concentration of five hydrometeors (cloud water, cloud ice, rain, sno - MG2: Gettelman and Morrison (2015) \cite Gettelman_2015_1 \cite Gettelman_2015_2 (CESM2, CAM6) - Prognostic precipitation (rain and snow) - Sub-stepping and sub-column capable -- MG3: Gettelman et al. 2019 \cite Gettelman_et_al_2019 +- MG3: Gettelman et al. (2019) \cite Gettelman_et_al_2019 - Rimed hydrometeors (graupel or hail) are added to stratiform cloud scheme for global models - Global climate impacts are limited to small increased in ice mass - High (14 km) resolution simulations show local production of rimed ice (graupel) can affect regional diff --git a/physics/docs/pdftxt/CPT_adv_suite.txt b/physics/docs/pdftxt/CPT_adv_suite.txt index 53887139f..bca25db96 100644 --- a/physics/docs/pdftxt/CPT_adv_suite.txt +++ b/physics/docs/pdftxt/CPT_adv_suite.txt @@ -1,10 +1,9 @@ /** -\page MGCSAW_page MGCSAW +\page MGCSAW_page MGCSAW Suite \section MGCSAW_suite_overview Overview The advanced MGCSAW physics suite uses the parameterizations in the following order: - - \ref fast_sat_adj - \ref GFS_RRTMG - \ref GFS_SFCLYR - \ref GFS_NSST @@ -21,11 +20,10 @@ The advanced MGCSAW physics suite uses the parameterizations in the following or - \ref CPT_MG3 - \ref mod_cs_conv_aw_adj - \ref GFS_CALPRECIPTYPE - - \ref STOCHY_PHYS \section sdf_cpt_suite Suite Definition File -The advanced MGCSAW physics suite uses the parameterizations in the following order, as defined in \c suite_SCM_MGCSAW.xml : +The advanced MGCSAW physics suite uses the parameterizations in the following order, as defined in \c SCM_MGCSAW : \code diff --git a/physics/docs/pdftxt/GFDL_cloud.txt b/physics/docs/pdftxt/GFDL_cloud.txt index c3933f156..414d41374 100644 --- a/physics/docs/pdftxt/GFDL_cloud.txt +++ b/physics/docs/pdftxt/GFDL_cloud.txt @@ -4,8 +4,8 @@ GFDL cloud microphysics (MP) scheme is a six-category MP scheme to replace Zhao-Carr MP scheme, and moves the GFS from a total cloud water variable to five predicted hydrometeors (cloud water, cloud ice, rain, snow and graupel). This scheme utilizes the "bulk water" microphysical parameterization technique in Lin et al. (1983) \cite lin_et_al_1983 -and has been significantly improved over years at GFDL (Lord et al.(1984) \cite lord_et_al_1984, -Krueger et al.(1995) \cite krueger_et_al_1995, Chen and Lin (2011) \cite chen_and_lin_2011, Chen and Lin (2013) \cite chen_and_lin_2013). +and has been significantly improved over years at GFDL (Lord et al. (1984) \cite lord_et_al_1984, +Krueger et al. (1995) \cite krueger_et_al_1995, Chen and Lin (2011) \cite chen_and_lin_2011, Chen and Lin (2013) \cite chen_and_lin_2013). Physics processes of GFDL cloud MP are described in Figure 1 (also see warm_rain() and icloud()) and are feature with time-split between warm-rain (faster) and ice-phase (slower) processes (see 'conversion time scale' in gfdl_cloud_microphys.F90 for default values). \image html gfdl_cloud_mp_diagram.png "Figure 1: GFDL MP at a glance (Courtesy of S.J. Lin at GFDL)" width=10cm @@ -43,7 +43,7 @@ h_{var}=\min \left\{0.2,\max\left[0.01, D_{ocean}(\frac{A_{r}}{10^{10}})^{0.25}\ Where \f$A_{r}\f$ is cell area, \f$D_{land}\f$ and \f$D_{ocean}\f$ are base values for sub-grid variability over land and ocean (larger sub-grid variability appears in larger area). Horizontal sub-grid variability is used in cloud fraction, relative humidity calculation, evaporation and condensation processes. Scale-awareness is achieved by this horizontal subgrid variability and a \f$2^{nd}\f$ -order FV-type vertical reconstruction (Lin et al.(1994) \cite lin_et_al_1994). +order FV-type vertical reconstruction (Lin et al. (1994) \cite lin_et_al_1994). \section nml_opt Namelist Option \ref gfdl_cloud_microphysics_nml diff --git a/physics/docs/pdftxt/GFS_GWDC.txt b/physics/docs/pdftxt/GFS_GWDC.txt index 53e9cc1cb..c8fb70afa 100644 --- a/physics/docs/pdftxt/GFS_GWDC.txt +++ b/physics/docs/pdftxt/GFS_GWDC.txt @@ -13,7 +13,7 @@ The importance of convectively-generated tropical waves in driving the equatorial stratospheric semi-annual oscillation (SAO) and quasi-biennial oscillation (QBO) has been appreciated for many years. - In a review paper on gravity waves in the middle atmosphere, Fritts(1984) \cite fritts_1984 + In a review paper on gravity waves in the middle atmosphere, Fritts (1984) \cite fritts_1984 showed that a large portion of observed gravity wave momentum flux has higher frequencies than those of stationary mountain waves. This phenomenon was explained by cumulus @@ -22,7 +22,7 @@ wind and stability are weak, the magnitude of the surface drag and the resultant influence of orographically-induced gravity wave drag on the large-scale flow are relatively small compared with those in - wintertime (Palmer et al.(1986) \cite palmer_et_al_1986). In this + wintertime (Palmer et al. (1986) \cite palmer_et_al_1986). In this situation, the relative importance of cumulus convection as a source of gravity waves is larger. In addition, in the tropical regions where persistent convection exists, deep cumulus clouds impinging on @@ -34,7 +34,7 @@ Compared with orographic gravitity waves, it has proven more difficult to model the way in which gravity waves are generated by various convective sources; The simplest situation is depicted in Figure 1. There are several proposed generation mechanisms in the literature (see section 3b in - Kim et al.(2003) \cite kim_et_al_2003). Amongst, Chun and Baik (1998) \cite chun_and_baik_1998 + Kim et al. (2003) \cite kim_et_al_2003). Amongst, Chun and Baik (1998) \cite chun_and_baik_1998 proposed a way for parameterizing convection-induced subgrid-scale gravity wave momentum flux in large-scale models. For the momentum flux profile up to the cloud-top height, use of the linear diff --git a/physics/docs/pdftxt/GFS_H2OPHYS.txt b/physics/docs/pdftxt/GFS_H2OPHYS.txt index ca3cd2041..efd38065f 100644 --- a/physics/docs/pdftxt/GFS_H2OPHYS.txt +++ b/physics/docs/pdftxt/GFS_H2OPHYS.txt @@ -3,7 +3,7 @@ \section des_h2o Description To improve the treatment of stratospheric water vapor in the global model, NCEP implemented a parameterization of photochemical production and loss (P-L) of water vapor through methane oxidation and photolysis of H2O in the upper mesosphere due to solar Lyman alpha absorption is implemented in GFS. -The Navy Research Laboratory (NRL) linearized parameterization of stratospheric and mesospheric water vapor photochemistry (McCormack at al.(2008) +The Navy Research Laboratory (NRL) linearized parameterization of stratospheric and mesospheric water vapor photochemistry (McCormack at al. (2008) \cite mccormack_et_al_2008) applies a linearized photochemical tendency to specific humidity q in the form \f[ \frac{dq}{dt}=(P-L)_{0}+\frac{\partial (P-L)}{\partial q}\mid_{0}(q-q_{0}) diff --git a/physics/docs/pdftxt/GFS_NOAH.txt b/physics/docs/pdftxt/GFS_NOAH.txt index d6928b38a..19360d092 100644 --- a/physics/docs/pdftxt/GFS_NOAH.txt +++ b/physics/docs/pdftxt/GFS_NOAH.txt @@ -7,26 +7,26 @@ predictability on daily to seasonal timescale (Betts et al. (2017) \cite betts_et_al_2017), but also in terms of influencing extremes such as drought and heatwaves (Paimazumder and Done (2016) \cite paimazumder_and_done_2016), PBL evolution and cloud - formation (Milovac et al.(2016) \cite milovac_et_al_2016) and afternoon + formation (Milovac et al. (2016) \cite milovac_et_al_2016) and afternoon convection (Guillod et al. (2015) \cite guillod_et_al_2015), and tropical cyclone re-intensification (Andersen and Shepherd (2014) \cite andersen_and_shepherd_2014). Other linkages, such as the role of soil moisture (SM) or vegetation heterogeneity in mesoscale circulation - (Hsu et al.(2017) \cite hsu_et_al_2017) and planetary waves (Koster et al.(2014) \cite koster_et_al_2014), + (Hsu et al. (2017) \cite hsu_et_al_2017) and planetary waves (Koster et al. (2014) \cite koster_et_al_2014), and those driven by land use and land cover change or management (Hirsch et al. (2015) \cite hirsch_et_al_2015; - Findell et al.(2017) \cite findell_et_al_2017) are topics of active research. + Findell et al. (2017) \cite findell_et_al_2017) are topics of active research. Figure 1 is a schematic of local land-atmosphere interactions in a quiescent synoptic regime, including the soil moisture-precipitation - (SM-P) feedback pathways. Solid arrows indicate a positive feedback + (SM-P) feedback pathways (Ek and Mahrt (1994) \cite ek_and_mahrt_1994; Ek and Holtslag (2004) \cite ek_and_holtslag_2004 ). Solid arrows indicate a positive feedback pathway, and large dashed arrows represent a negative feedback, while red indicates radiative, black indicates surface layer and PBL, and brown indicates land surface processes. Thin red and grey dashed lines with arrows also represent positive feedbacks. The single horizontal gay-dotted line (no arrows) indicates the top of the PBL, and the seven small vertical dashed lines (no arrows) represent precipitation - \image html Noah_LA_interaction.png "Figure 1: Local Land-atmosphere Interaction (courtesy of Michael Ek, Ek and Mahrt (1994), Ek and Holtslag (2004))" width=10cm + \image html Noah_LA_interaction.png "Figure 1: Local Land-atmosphere Interaction (courtesy of Michael Ek)" width=10cm Recently, the land surface updates in 2017 GFS operational physics includes: - IGBP 20-type 1-km land classification - STASGO 19-type 1-km soil classification diff --git a/physics/docs/pdftxt/GFS_SFCLYR.txt b/physics/docs/pdftxt/GFS_SFCLYR.txt index 6ed7ed3c2..60d804a01 100644 --- a/physics/docs/pdftxt/GFS_SFCLYR.txt +++ b/physics/docs/pdftxt/GFS_SFCLYR.txt @@ -12,7 +12,7 @@ in the very stable and very unstable situations. \ref Noah_LSM are largely responsible for the quality of model forecasts produced for near-surface weather parameters, such as 2-meter air temperature (\f$T_{2m}\f$) and surface skin temperature - (\f$LST\f$). \f$LST\f$ is derived from the surface energy budget, and is + (\f$LST\f$). \f$LST\f$ is derived from the surface energy budget, and is particularly important to remote sensing and data assimilation. How precise these two parameters can be simulated by the model strongly depends on how accurate the surface heat fluxes are parameterized, @@ -31,10 +31,10 @@ in the very stable and very unstable situations. In May 2011, the new vegetation-dependent formulations of thermal roughness formulation ( - Zheng et al.(2012) \cite zheng_et_al_2012) + Zheng et al. (2012) \cite zheng_et_al_2012) was implemented to deal with the cold \f$LST\f$ bias over the arid western continental United States - (CONUS) during daytime. The thermal roughness length \f$Z_{0H}\f$ is derived by a + (CONUS) during daytime. The thermal roughness length \f$Z_{0H}\f$ is derived by a seasonlly varying formulation dependent on the seasonal cycle of green vegetation fraction. In this \f$Z_{0H}\f$ formulation, a key parameter known as \f$C_{zil}\f$ is specified according to a dependence on canopy height. @@ -43,7 +43,7 @@ The NCEP GFS global prediction model has experienced a longstanding problem of s cold bias in the \f$T_{2m}\f$ forecasts over land in the late afternoon and nighttime during moist seasons. This cold bias is closely associated with the nocturnal stable boundary layer and is accompanied by a corresponding warm air temperature bias in the first -model level above the ground. In 2017, Zheng et al.(2017) \cite zheng_et_al_2017 identified the +model level above the ground. In 2017, Zheng et al. (2017) \cite zheng_et_al_2017 identified the bias and introduced a stability parameter constraint \f$(z/L)_{lim}\f$ to prevent the land-atmosphere system from fully decoupling: \f[ (z/L)_{lim}=\frac{ln(\frac{z}{z_{0M}})}{2\alpha(1-\frac{z_{0M}}{z})} @@ -51,11 +51,11 @@ bias and introduced a stability parameter constraint \f$(z/L)_{lim}\f$ to preven Here \f$z\f$ is the height, \f$L\f$ is the Obukhov length, \f$z_{0M}\f$ is the momentum roughness length, and \f$\alpha = 5\f$. -The pertinent features of the GFS stable surface layer parameterization scheme are described in the appendix of Zheng et al.(2017) +The pertinent features of the GFS stable surface layer parameterization scheme are described in the appendix of Zheng et al. (2017) \cite zheng_et_al_2017. \section intra_rough Intraphysics Communication -\ref arg_table_sfc_ex_coef_run +\ref arg_table_sfc_diff_run \section gen_rough General Algorithm \ref general_diff diff --git a/physics/docs/pdftxt/GFS_SFCSICE.txt b/physics/docs/pdftxt/GFS_SFCSICE.txt index 8f39c5eef..b7b3c38f3 100644 --- a/physics/docs/pdftxt/GFS_SFCSICE.txt +++ b/physics/docs/pdftxt/GFS_SFCSICE.txt @@ -25,13 +25,13 @@ A sea ice model, in general, may contain subcomponents treating 1) dynamics (ice motion), 2) ice transport, 3) multiple ice thickness categories (including leads), 4) surface albedo, and 5) vertical thermodynamics. GFS sea ice scheme is concerned with a scheme for the - last of these processes. A three-layer thermodynamic sea ice model (Winton(2000) \cite winton_2000) + last of these processes. A three-layer thermodynamic sea ice model (Winton (2000) \cite winton_2000) has been coupled to GFS. It predicts sea ice/snow thickness, the surface temperature and ice temperature structure. In each model grid box, the heat and moisture fluxes and albedo are treated separately for the ice and the open water. \section intra_sice Intraphysics Communication -+ GFS Sea Ice Driver(\ref arg_table_sfc_sice_run) ++ GFS Sea Ice Driver (\ref arg_table_sfc_sice_run) + Three-layer Thermodynamics Sea Ice Model (ice3lay()) \cite winton_2000 \section gen_sice General Algorithm diff --git a/physics/docs/pdftxt/GFS_SURFACE_PERT.txt b/physics/docs/pdftxt/GFS_SURFACE_PERT.txt index 480946b57..1ecdfaa34 100644 --- a/physics/docs/pdftxt/GFS_SURFACE_PERT.txt +++ b/physics/docs/pdftxt/GFS_SURFACE_PERT.txt @@ -1,16 +1,28 @@ /** \page surf_pert GFS Surface Parameter Perturbation \section des_sfcpert Description -Parameterizations of physical process include a number of tunable -Land surface perturbation (Gehne et al.(2019) \cite Gehne_2019) has been recently introduced +Land surface perturbation (Gehne et al. (2019) \cite Gehne_2019) has been recently introduced into FV3GFS. This treatment is based on the hypothesis that one of the major causes of the insufficient spread in current global NWP model,especially near the surface, is a lack of treatment of uncertainty in the soil state and in the associated model parameters. It allows for land surface parameters such as surface albedo, -vegetation fraction,soil hydraulic conductivity,leaf area index (LAI),surface roughness lengths for heat and momentom to vary in space. -These parameters and variables have been shown to impact forecasts of 2m temperature,10m wind and precipitation.Based on the parameter +vegetation fraction, soil hydraulic conductivity, leaf area index (LAI), surface roughness lengths for heat and momentom to vary in space. +These parameters and variables have been shown to impact forecasts of 2m temperature, 10m wind and precipitation. Based on the parameter or variable,different strategies to perturb are necessary. +Table 1 presents a summary of the uncertainty or range of values associated with the parameters and variables that are considered. + +\section table Uncertainty or range of values identified for the perturbed parameters (Gehne et al. (2019)) +| Parameter or variable | Estimated uncertainty or range | Reference | +|-----------------------------------|---------------------------------------|------------------------------------| +| Albedo | 2\%-12\% of Albedo | Grant et al. (2000) \cite grant_et_al_2000 ; Qu and Hall (2005) \cite qu_and_hall_2005 | +| Vegetation fraction | 20\%-30\% of Vegetation fraction | Computed from MODIS vegetation fraction data | +| Momentum roughness length + + + + + Momentum roughness length (\f$Z_{0}\f$),heat/momentum roughness length ratio (\f$Z_{t}/Z_{0}\f$), Albedo and vegetation fraction perturbation are applied by percentile matching of the normal distribution with the beta distribution diff --git a/physics/docs/pdftxt/GFSv15_suite.txt b/physics/docs/pdftxt/GFSv15_suite.txt index ca931d614..306213a7f 100644 --- a/physics/docs/pdftxt/GFSv15_suite.txt +++ b/physics/docs/pdftxt/GFSv15_suite.txt @@ -1,22 +1,20 @@ /** -\page GFS_v15_page GFS_v15 +\page GFS_v15_page GFS_v15 Suite \section gfs1_suite_overview Overview -Effective on or about Wednesday, June 12, 2019, beginning with the 1200 -Coordinated Universal Time (UTC) run, the National Centers for Environmental -Prediction (NCEP) will upgrade the Global Forecast Systems (GFS) from version 14 to 15. - -GFS v15 will use the Finite-Volume Cubed-Sphere (FV3) dynamical core +Version 15 of the Global Forecast System (GFS) was implemented operationally by the NOAA +National Centers for Environmental Prediction (NCEP) on June 12, 2019. +GFS v15 uses the Finite-Volume Cubed-Sphere (FV3) dynamical core and a revised physics suite when compared to GFS v14. + - Replacement of the Zhao-Carr microphysics with the more advanced \ref GFDL_cloud - Updated parameterization of ozone photochemistry with additional production and loss terms -- Newly introduced parameterization of middle atmospheric water vapor photochemistry (\ref GFS_H2OPHYS) +- Newly introduced parameterization of middle atmospheric water vapor photochemistry - Revised bare soil evaporation scheme - Modified convective parameterization scheme to reduce excessive cloud top cooling -The GFSv15 physics suite uses the parameterizations in the following order: - - \ref fast_sat_adj +The GFS v15 physics suite uses the parameterizations in the following order: - \ref GFS_RRTMG - \ref GFS_SFCLYR - \ref GFS_NSST @@ -32,11 +30,10 @@ The GFSv15 physics suite uses the parameterizations in the following order: - \ref GFS_SAMFshal - \ref GFDL_cloud - \ref GFS_CALPRECIPTYPE - - \ref STOCHY_PHYS \section sdf_gfsv15 Suite Definition File -The GFSv15 suite uses the parameterizations in the following order, as defined in \c suite_SCM_GFS_v15.xml: +The GFS v15 suite uses the parameterizations in the following order, as defined in \c SCM_GFS_v15: \code diff --git a/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt b/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt index dab159d71..6acbf03ab 100644 --- a/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt +++ b/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt @@ -1,11 +1,10 @@ /** -\page GFS_v15plus_page GFS_v15plus +\page GFS_v15plus_page GFS_v15plus Suite \section gfs2p_suite_overview Overview -This physics suite is the same as GFSv15 physics suite with \ref GFS_SATMEDMF replace of \ref GFS_HEDMF . +This physics suite is the same as GFS v15 physics suite with \ref GFS_SATMEDMF replace of \ref GFS_HEDMF . - - \ref fast_sat_adj - \ref GFS_RRTMG - \ref GFS_SFCLYR - \ref GFS_NSST @@ -21,12 +20,11 @@ This physics suite is the same as GFSv15 physics suite with \ref GFS_SATMEDMF r - \ref GFS_SAMFshal - \ref GFDL_cloud - \ref GFS_CALPRECIPTYPE - - \ref STOCHY_PHYS \section sdf_gfsv15p Suite Definition File -The GFSv15plus suite uses the parameterizations in the following order, as defined in \c suite_SCM_GFS_v15plus.xml : +The GFS v15plus suite uses the parameterizations in the following order, as defined in \c SCM_GFS_v15plus : \code diff --git a/physics/docs/pdftxt/GSD_CU_GF_deep.txt b/physics/docs/pdftxt/GSD_CU_GF_deep.txt index 6d97a716c..041e92692 100644 --- a/physics/docs/pdftxt/GSD_CU_GF_deep.txt +++ b/physics/docs/pdftxt/GSD_CU_GF_deep.txt @@ -1,25 +1,22 @@ /** -\page GSD_CU_GF GSD Grell-Freitas Scale and Aerosol Aware Convection Scheme +\page GSD_CU_GF Grell-Freitas Scale and Aerosol Aware Convection Scheme \section gfcu_descrip Description -The Rapid Refresh (RAP) uses the Grell-Freitas (GF) convective scheme, while the HRRR allows direct prediction -of convection at its 3-km horizontal scale. In the RAP, the Grell-Freitas parameterization removes convective -instability so that the gridscale precipitation scheme does not "convect", convective precipitation is a scheme -byproduct. Grell-Freitas is an Arakawa-Schubert mass flux type scheme, and is both aerosol and model scale aware. +The Grell-Freitas scale and aerosol aware convection scheme is an Arakawa-Schubert mass flux type scheme, and is both aerosol and scale aware. Aerosol awareness (emulating the impact of aerosols on precipitation processes) is obtained through changing the rate of -converstion from cloud droplets to raindrops (Berry 1968 \cite berry_1968 ), and by modifying the precipitation efficiency of the -raindrops (the fraction of total condensed water volume in the cloud's lifetime reaching the ground (Jiang et al.(2010) \cite Jiang_2010) ) +conversion from cloud droplets to raindrops (Berry (1968) \cite berry_1968 ), and by modifying the precipitation efficiency of the +raindrops (the fraction of total condensed water volume in the cloud's lifetime reaching the ground (Jiang et al. (2010) \cite Jiang_2010) ) Scale awareness comes through the use of an empirical formula for the fractional area (\f$\sigma\f$) of the model grid column containing updrafts and downdrafts (Arakawa et al. (2011) \cite Arakawa_2011 ). The entrainment rate for the updrafts is an inverse function -of \f$\sigma\f$. As the fractional coverage become large, the resolved motion takes over convective processes (why the HRRR is called -"convection allowing") and the Grell-Freitas scheme becomes a shallow convection scheme, simulating the effects of unresolved fair weather +of \f$\sigma\f$. As the fractional coverage become large, the resolved motion takes over convective processes +and the Grell-Freitas scheme becomes a shallow convection scheme, simulating the effects of unresolved fair weather and towering cumulus on the forecast variables. -The GF scheme still uses an ensemble of convective schemes, but is now limited to options that modulate closure and capping +The GF scheme uses an ensemble of convective schemes, with options that modulate closure and capping inversion thresholds for convection. After calculations for each member of the cloud ensemble in the convective scheme, the ensemble mean time tendency for temperature, moisture, and cloud and precipitation hydrometeors is passed to the rest of the model -(Grell and \f$D\acute{e}v\acute{e}nyi\f$, 2002 \cite Grell_2002 ). Additionally, the upward mass flux from parameterized convective updrafts is balanced by -subsidence in adjacent grid columns, if horizontal resolution of the model using the parameterization is less than 10 km. +(Grell and \f$D\acute{e}v\acute{e}nyi\f$ (2002) \cite Grell_2002 ). Additionally, the upward mass flux from parameterized convective updrafts is balanced by +subsidence in adjacent grid columns, if the horizontal grid spacing of the model using the parameterization is less than 10 km. # Operational Impacts in RAP/HRRR diff --git a/physics/docs/pdftxt/GSD_THOMPSON.txt b/physics/docs/pdftxt/GSD_THOMPSON.txt index 2598d3174..525d3bedc 100644 --- a/physics/docs/pdftxt/GSD_THOMPSON.txt +++ b/physics/docs/pdftxt/GSD_THOMPSON.txt @@ -1,5 +1,5 @@ /** -\page GSD_THOMPSON Aerosol-Aware Thompson Microphysics Scheme +\page GSD_THOMPSON Thompson Aerosol-Aware Microphysics Scheme \section thompson_descrp Description diff --git a/physics/docs/pdftxt/GSD_adv_suite.txt b/physics/docs/pdftxt/GSD_adv_suite.txt index 16de26c63..0db91ede1 100644 --- a/physics/docs/pdftxt/GSD_adv_suite.txt +++ b/physics/docs/pdftxt/GSD_adv_suite.txt @@ -1,10 +1,8 @@ /** -\page GSD_v0_page GSD_v0 +\page GSD_v0_page GSD_v0 Suite \section gsd_suite_overview Overview -# History of RUC, RAP/HRRR model development at NOAA/GSD - The original Rapid Update Cycle (RUC), implemented in 1994, was designed to provide accurate short-range (0 to 12-hr) numerical forecast guidance for weather-sensitive users, including those in the U.S. aviation community. The RUC started to run every hour starting in 1998. Significant weather forecasting problems that occur in the 0- to @@ -36,11 +34,10 @@ The advanced GSD RAP/HRRR physics suite uses the parameterizations in the follow - \ref GFS_GWDC - \ref GSD_THOMPSON - \ref GFS_CALPRECIPTYPE - - \ref STOCHY_PHYS \section sdf_gsdsuite Suite Definition File -The GSD RAP/HRRR physics suite uses the parameterizations in the following order, as defined in \c suite_SCM_GSD_v0.xml : +The GSD RAP/HRRR physics suite uses the parameterizations in the following order, as defined in \c SCM_GSD_v0: \code diff --git a/physics/docs/pdftxt/all_shemes_list.txt b/physics/docs/pdftxt/all_shemes_list.txt index 3d57b41ea..39b4917ef 100644 --- a/physics/docs/pdftxt/all_shemes_list.txt +++ b/physics/docs/pdftxt/all_shemes_list.txt @@ -8,20 +8,19 @@ In the CCPP-Physics v3.0 release, each parameterization is in its own modern For code maintenance. While some individual parameterization can be invoked for the GMTB SCM, most users will assemble the parameterizations in suites. -- Radiation: +- \b Radiation - \subpage GFS_RRTMG -- PBL and Turbulence: +- \b PBL \b and \b Turbulence - \subpage GFS_HEDMF - \subpage GFS_SATMEDMF - \subpage GSD_MYNNEDMF -- Land Surface Model: +- \b Land \b Surface \b Model - \subpage GFS_NOAH - - \subpage surf_pert - \subpage GSD_RUCLSM -- Cumulus Parameterizations: +- \b Cumulus \b Parameterizations - GFS Scale-Aware Arakawa Schubert (SAS) Scheme - \subpage GFS_SAMFdeep - \subpage GFS_SAMFshal @@ -30,33 +29,28 @@ parameterizations in suites. - \ref cu_gf_deep_group - \ref cu_gf_sh_group -- Microphysics: +- \b Microphysics - \subpage GFDL_cloud - - \subpage fast_sat_adj - \subpage CPT_MG3 - \subpage GSD_THOMPSON -- Stochastic: - - \subpage STOCHY_PHYS - - \subpage surf_pert - -- Ozone: +- \b Ozone \b Photochemical \b Production \b and \b Loss - \subpage GFS_OZPHYS - \ref GFS_ozphys_2015 -- Water Vapor Photochemical Production and Loss: +- \b Water \b Vapor \b Photochemical \b Production \b and \b Loss - \subpage GFS_H2OPHYS -- Gravity Wave Drag: +- \b Gravity \b Wave \b Drag - \subpage GFS_GWDPS - \subpage GFS_GWDC -- Surface Layer and Simplified Ocean and Sea Ice Representation: +- \b Surface \b Layer \b and \b Simplified \b Ocean \b and \b Sea \b Ice \b Representation - \subpage GFS_SFCLYR - \subpage GFS_NSST - \subpage GFS_SFCSICE -- Others: +- \b Others - \subpage GFS_RAYLEIGH - \subpage GFS_CALPRECIPTYPE @@ -86,10 +80,10 @@ to the parameterization. \section allsuite_overview Physics Suites The CCPP v3 includes the suite used in the GFS v15 implemented operationally in June 2019 (suite GFS_v15). Additionally, it includes three -developmental suites which are undergoing testing for possible future implementation in the UFS. Suite GFS_v15 plus is identical to suite +developmental suites which are undergoing testing for possible future implementation in the UFS. Suite GFS_v15plus is identical to suite GFS_v15 except for a replacement in the PBL parameterization (Han et al. 2019 \cite Han_2019 ). Suite MGCSAW differs from GFS_v15 as it contains different convection and microphysics schemes made available through a NOAA Climate Process Team (CPT) with components developed -at multiple research centers and universities, including Colorado State, Utah, NASA, NCAR, and EMC. Suite GSD_v0 differs from v15 as it +at multiple research centers and universities, including Colorado State, Utah, NASA, NCAR, and EMC. Suite GSD_v0 differs from GFS_v15 as it uses the convection, microphysics, and boundary layer schemes employed in the Rapid Refresh (RAP) and High-Resolution Rapid Refresh (HRRR \cite Benjamin_2016 ) operational models and was assembled by NOAA/GSD. An assessment of an earlier version of these suites can be found in the UFS portal diff --git a/physics/docs/pdftxt/all_shemes_list.txt.FV3 b/physics/docs/pdftxt/all_shemes_list.txt.FV3 new file mode 100644 index 000000000..9294027dd --- /dev/null +++ b/physics/docs/pdftxt/all_shemes_list.txt.FV3 @@ -0,0 +1,110 @@ +/** +\page allscheme_page Parameterizations and Suites Overview + +\section allscheme_overview Physics Parameterizations + +In the CCPP-Physics v3.0 release, each parameterization is in its own modern Fortran module, + which facilitates model development and +code maintenance. While some individual parameterization can be invoked for the GMTB SCM, most users will assemble the +parameterizations in suites. + +- Radiation + - \subpage GFS_RRTMG + +- PBL and Turbulence + - \subpage GFS_HEDMF + - \subpage GFS_SATMEDMF + - \subpage GSD_MYNNEDMF + +- Land Surface Model + - \subpage GFS_NOAH + - \subpage surf_pert + - \subpage GSD_RUCLSM + +- Cumulus Parameterizations + - GFS Scale-Aware Arakawa Schubert (SAS) Scheme + - \subpage GFS_SAMFdeep + - \subpage GFS_SAMFshal + - \subpage CSAW_scheme + - \subpage GSD_CU_GF + - \ref cu_gf_deep_group + - \ref cu_gf_sh_group + +- Microphysics + - \subpage GFDL_cloud + - \subpage fast_sat_adj (not available for the GMTB SCM) + - \subpage CPT_MG3 + - \subpage GSD_THOMPSON + +- Stochastic (not available for the GMTB SCM) + - \subpage STOCHY_PHYS + - \subpage surf_pert (only applicable to \ref GFS_NOAH ) + +- Ozone + - \subpage GFS_OZPHYS + - \ref GFS_ozphys_2015 + +- Water Vapor Photochemical Production and Loss + - \subpage GFS_H2OPHYS + +- Gravity Wave Drag + - \subpage GFS_GWDPS + - \subpage GFS_GWDC + +- Surface Layer and Simplified Ocean and Sea Ice Representation + - \subpage GFS_SFCLYR + - \subpage GFS_NSST + - \subpage GFS_SFCSICE + +- Others + - \subpage GFS_RAYLEIGH + - \subpage GFS_CALPRECIPTYPE + +In addition to the physical schemes themselves, this scientific documentation also covers four modules that define physics/radiation functions, parameters and constants: + - \ref func_phys + - \ref phy_sparam + - \ref physcons + - \ref radcons + +The input information for the physics include the values of the gridbox mean prognostic variables (wind components, temperature, +specific humidity, cloud fraction, water contents for cloud liquid, cloud ice, rain, snow, graupel, and ozone concentration), the provisional + dynamical tendencies for the same variables and various surface fields, both fixed and variable. + +The time integration of the physics suites is based on the following: +- The tendencies from the different physical processes are computed by the parameterizations or derived in separate interstitial routines +- The first part of the suite, comprised of the parameterizations for radiation, surface layer, surface (land, ocean, and sea ice), boundary layer, +orographic gravity wave drag, and Rayleigh damping, is computed using a hybrid of parallel and sequential splitting described in Donahue and Caldwell(2018) +\cite donahue_and_caldwell_2018, a method in which the various parameterizations use the same model state as input but are impacted by the preceding +parameterizations. The tendencies from the various parameterizations are then added together and used to update the model state. +- The surface parameterizations (land, ocean and sea ice) are invoked twice in a loop, with the first time to create a guess, and the second time to +produce the tendencies. +- The second part of the physics suite, comprised of the parameterizations of ozone, stratospheric water vapor, deep convection, convective gravity wave drag, +shallow convection, and microphysics, is computed using sequential splitting in the order listed above, in which the model state is updated between calls +to the parameterization. +- If the in-core saturation adjustment is used (\p do_sat_adj=.true.), it is invoked at shorter timesteps along with the dynamical solver. + +\section allsuite_overview Physics Suites + +The CCPP v3 includes the suite used in the GFS v15 implemented operationally in June 2019 (suite GFS_v15). Additionally, it includes three +developmental suites which are undergoing testing for possible future implementation in the UFS. Suite GFS_v15plus is identical to suite +GFS_v15 except for a replacement in the PBL parameterization (Han et al. 2019 \cite Han_2019 ). Suite MGCSAW differs from GFS_v15 as it +contains different convection and microphysics schemes made available through a NOAA Climate Process Team (CPT) with components developed +at multiple research centers and universities, including Colorado State, Utah, NASA, NCAR, and EMC. Suite GSD_v0 differs from GFS_v15 as it +uses the convection, microphysics, and boundary layer schemes employed in the Rapid Refresh (RAP) and High-Resolution Rapid Refresh (HRRR \cite Benjamin_2016 ) +operational models and was assembled by NOAA/GSD. An assessment of an earlier version of these suites can be found in + the UFS portal +and in the GMTB website . + +Table 1. Physics suite options included in this documentation. +\tableofcontents +| Phys suites | GFS_v15 | GFS_v15plus | MGCSAW | GSD_v0 | +|------------------|----------------------|----------------------|---------------------|----------------------| +| Deep Cu | \ref GFS_SAMFdeep | \ref GFS_SAMFdeep | \ref CSAW_scheme | \ref GSD_CU_GF | +| Shallow Cu | \ref GFS_SAMFshal | \ref GFS_SAMFshal | \ref GFS_SAMFshal | \ref GSD_MYNNEDMF and \ref cu_gf_sh_group | +| Microphysics | \ref GFDL_cloud | \ref GFDL_cloud | \ref CPT_MG3 | \ref GSD_THOMPSON | +| PBL/TURB | \ref GFS_HEDMF | \ref GFS_SATMEDMF | \ref GFS_HEDMF | \ref GSD_MYNNEDMF | +| Land | \ref GFS_NOAH | \ref GFS_NOAH | \ref GFS_NOAH | \ref GSD_RUCLSM | +\tableofcontents + + +*/ diff --git a/physics/docs/pdftxt/suite_input.nml.txt b/physics/docs/pdftxt/suite_input.nml.txt index 0444044cf..75e5c09f9 100644 --- a/physics/docs/pdftxt/suite_input.nml.txt +++ b/physics/docs/pdftxt/suite_input.nml.txt @@ -3,17 +3,17 @@ At runtime, the SCM and the UFS Atmosphere access runtime configurations from file \c input.nml. This file contains various namelists that control aspects of the I/O, dynamics, physics etc. Most physics-related options are grouped into -two namelists:&gfs_physics_nml and &gfdl_cloud_microphysics_nml, with additional specifications for stochastic physics in -namelists &stochy_nam and &nam_sfcperts. +two namelists:\b &gfs_physics_nml and \b &gfdl_cloud_microphysics_nml, with additional specifications for stochastic physics in +namelists \b &stochy_nam and \b &nam_sfcperts. -Namelist &gfdl_cloud_microphysics_nml is only relevant when the GFDL microphysics is used, and its variables are defined in +Namelist \b &gfdl_cloud_microphysics_nml is only relevant when the GFDL microphysics is used, and its variables are defined in module_gfdl_cloud_microphys.F90. -Namelist &gfs_physics_nml pertains to all of the suites used, but some of the variables are only relevant for specific +Namelist \b &gfs_physics_nml pertains to all of the suites used, but some of the variables are only relevant for specific parameterizations. Its variables are defined in file GFS_typedefs.F90 in the host model. -Namelist &stochy_nam specifies options for the use of SPPT, SKEB and SHUM, while namelist &nam_sfcperts specifies whether -and how stochastic perturbations are used in the loah Land surface model. +Namelist \b &stochy_nam specifies options for the use of SPPT, SKEB and SHUM, while namelist \b &nam_sfcperts specifies whether +and how stochastic perturbations are used in the Noah Land Surface Model. diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index be2a74957..9ffc8f49b 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -57,107 +57,6 @@ MODULE module_sf_ruclsm !>\ingroup lsm_ruc_group !> The RUN LSM model is described in Smirnova et al.(1997) !! \cite Smirnova_1997 and Smirnova et al.(2000) \cite Smirnova_2000 -!>\param dt time step(second) -!>\param ktau number of time step -!>\param nsl number of soil layers -!>\param graupelncv. -!>\param snowncv -!>\param rainncv one time step grid scale precipitation (mm/step) -!>\param raincv one time step convective precipitation (mm/step) -!>\param zs depth of soil levels (\f$m\f$) -!>\param rainbl accumulated rain in mm between the PBL calls -!>\param snow snow water equivalent (\f$mm\f$) -!>\param snowh -!>\param snowc flag indicating snow coverage (1 for snow cover) -!>\param frzfrac fraction of frozen precipitation -!>\param frpcpn -!>\param rhosnf -!>\param precipfr time step frozen precipitation (\f$mm\f$) -!>\param z3d height(\f$m\f$) -!>\param p8w 3D pressure (\f$Pa\f$) -!>\param t3d temperature (\f$K\f$) -!>\param qv3d 3D water vapor mixing ratio (\f$Kg Kg^{-1}\f$) -!>\param qc3d 3D cloud water mixing ratio (\f$Kg Kg^{-1}\f$) -!>\param rho3d 3D air density (\f$Kg m^{-3}\f$) -!>\param glw downward longwave flux at ground surface (\f$Wm^{-2}\f$) -!>\param gsw absorbed shortwave flux at ground surface (\f$Wm^{-2}\f$) -!>\param emiss surface emissivity (between 0 and 1) -!>\param chklowq is either 0 or 1 (so far set equal to 1).used only in MYJPBL -!>\param chs -!>\param flqc surface exchange coefficient for moisture(\f$Kg m^{-2} s^{-1}\f$) -!>\param flhc surface exchange coefficient for heat(\f$Wm^{-2}s^{-1}K^{-1}\f$) -!>\param mavail -!>\param canwat canopy moisture content (\f$mm\f$) -!>\param vegfra vegetation fraction (between 0 and 100) -!>\param alb surface albedo (between 0 and 1) -!>\param znt roughness length (\f$m\f$) -!>\param z0 -!>\param snoalb maximum snow albedo (between 0 and 1) -!>\param albbck snow-free albedo (between 0 and 1) -!>\param landusef -!>\param nlcat -!>\param soilctop -!>\param nscat -!>\param qsfc -!>\param qsg -!>\param qvg -!>\param qcg -!>\param dew -!>\param soilt1 -!>\param tsnav -!>\param tbot soil temperature at lower boundary (\f$K\f$) -!>\param ivgtyp USGS vegetation type (24 classes) -!>\param isltyp STASGO soil type (16 classes) -!>\param xland land mask (1 for land, 2 for water) -!>\param iswater -!>\param isice -!>\param xice -!>\param xice_threshold -!>\param cp heat capacity at constant pressure for dry air (\f$J Kg^{-1} K^{-1}\f$) -!>\param rv -!>\param rd -!>\param g0 acceleration due to gravity (\f$m s^{-2}\f$) -!>\param pi -!>\param lv latent heat of melting (\f$J Kg^{-1}\f$) -!>\param stbolt Stefan-Boltzmann constant (\f$W m^{-2} K^{-4}\f$) -!>\param soilmois soil moisture content (volumetric fraction) -!>\param sh2o -!>\param smavail -!>\param smmax -!>\param tso soil temperature (\f$K\f$) -!>\param soilt surface temperature (\f$K\f$) -!>\param hfx upward heat flux at the surface (\f$W m^{-2}\f$) -!>\param qfx upward moisture flux at the surface (\f$Kg m^{-2} s^{-1}\f$) -!>\param lh upward latent heat flux (\f$W m^{-2}\f$) -!>\param infiltr -!>\param runoff1 -!>\param runoff2 -!>\param acrunoff run-total surface runoff (\f$mm\f$) -!>\param sfcexc -!>\param sfcevp -!>\param grdflx soil heat flux (\f$W m^{-2}\f$; negative, if downward from surface) -!>\param snowfallac run-total snowfall accumulation (\f$m\f$) -!>\param acsnow run-total SWE of snowfall (\f$mm\f$) -!>\param snom -!>\param smfr3d -!>\param keepfr3dflag -!>\param myj -!>\param shdmin -!>\param shdmax -!>\param rdlai2d -!>\param ims start index for i in memory -!>\param ime end index for i in memory -!>\param jms start index for j in memory -!>\param jme end index for j in memory -!>\param kms start index for k in memory -!>\param kme end index for k in memory -!>\param its -!>\param ite -!>\param jts -!>\param jte -!>\param kts -!>\param kte -!! !>\section gen_lsmruc GSD RUC LSM General Algorithm !! @{ SUBROUTINE LSMRUC( & From 2bb243daf1afea6f1beee35d56ad67b8c9fd53ab Mon Sep 17 00:00:00 2001 From: Man Zhang Date: Thu, 13 Jun 2019 13:38:32 -0600 Subject: [PATCH 08/89] scidoc updates --- physics/aer_cloud.F | 20 ++++----- physics/cnvc90.f | 2 +- physics/cs_conv.F90 | 40 +++++++++--------- physics/cs_conv_aw_adj.F90 | 2 +- physics/cu_gf_deep.F90 | 26 +++++------- physics/cu_gf_driver.F90 | 4 +- physics/cu_gf_sh.F90 | 44 +++++++++++--------- physics/docs/ccppv3_doxyfile | 5 ++- physics/docs/pdftxt/CPT_adv_suite.txt | 10 ++--- physics/docs/pdftxt/GFDL_cloud.txt | 3 -- physics/docs/pdftxt/all_shemes_list.txt | 4 +- physics/docs/pdftxt/suite_input.nml.txt | 4 +- physics/funcphys.f90 | 4 +- physics/gfdl_fv_sat_adj.F90 | 6 +-- physics/micro_mg3_0.F90 | 54 ++++++++++++------------- physics/micro_mg_utils.F90 | 14 +++---- physics/moninedmf.f | 2 +- physics/mp_thompson.F90 | 2 +- physics/radiation_clouds.f | 19 ++++++--- physics/radlw_main.f | 10 +++-- physics/radsw_main.f | 12 ++++-- physics/satmedmfvdif.F | 1 - physics/sflx.f | 3 +- 23 files changed, 153 insertions(+), 138 deletions(-) diff --git a/physics/aer_cloud.F b/physics/aer_cloud.F index 1c6e27442..60df592b6 100644 --- a/physics/aer_cloud.F +++ b/physics/aer_cloud.F @@ -158,10 +158,6 @@ end subroutine aer_cloud_init !!\param dpre_in mass-weighted diameter of prexisting ice crystals (m) !!\param ccn_diagr8 array of supersaturations for CCN diagnostics (in-out) !!\param Ndropr8 Current droplet number concentration (\f$Kg^{-1}\f$) -!!\param qc Liquid water mixing ratio (Kg/Kg) -!!\param use_average_v .false. integrate over the updraft distribution. True: use the mean vertical velocity -!!\param CCN_param CCN activation parameterization. 1- Fountoukis and Nenes (2005), 2-Abdul_Razzak and Ghan (2002) (def = 2) -!!\param IN_param IN activation spectrum (default is 5) !!\param cdncr8 Activated cloud droplet number concentration (Kg-1) !!\param smaxliqr8 Maximum supersaturation w.r.t liquid during droplet activation !!\param incr8 Nucleated ice crystal concentration (Kg-1) @@ -172,14 +168,20 @@ end subroutine aer_cloud_init !!\param Ncdepr8 Nucleated nc by deposition ice nucleation (Kg-1) !!\param Ncdhfr8 Nucleated nc by immersion in aerosol (Kg -1) !!\param sc_icer8 Critical saturation ratio in cirrus -!!\param fdust_depr8 Fraction of deposition ice nuclei that are dust !!\param fdust_immr8 Fraction of immersion mixed-phase ice nuclei that are dust +!!\param fdust_depr8 Fraction of deposition ice nuclei that are dust !!\param fdust_dhfr8 Fraction of immersion ice nuclei that are dust (not mixed-phase) !!\param nlimr8 Limiting ice nuclei concentration (m-3) - -!=================================================================================== - - +!!\param use_average_v .false. integrate over the updraft distribution. True: use the mean vertical velocity +!!\param CCN_param CCN activation parameterization. 1- Fountoukis and Nenes (2005), 2-Abdul_Razzak and Ghan (2002) (def = 2) +!!\param IN_param IN activation spectrum (default is 5) +!!\param fd_dust +!!\param fd_soot +!!\param pfrz_inc_r8 +!!\param sigma_nuc +!!\param rhi_cell +!!\param nccn +!! subroutine aerosol_activate(tparc_in, pparc_in, sigwparc_in, & & wparc_ls, Aer_Props, npre_in, dpre_in, ccn_diagr8, Ndropr8, & & cdncr8, smaxliqr8, incr8, smaxicer8, nheticer8, INimmr8, & diff --git a/physics/cnvc90.f b/physics/cnvc90.f index 800ccb5dc..1e95148be 100644 --- a/physics/cnvc90.f +++ b/physics/cnvc90.f @@ -37,7 +37,7 @@ end subroutine cnvc90_init !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! -!>\section gen_cnvc90_run GFS cnvc90_run General Algorithm +! \section gen_cnvc_run GFS cnvc90_run General Algorithm SUBROUTINE cnvc90_run(CLSTP,IM,IX,RN,KBOT,KTOP,KM,PRSI, & & ACV,ACVB,ACVT,CV,CVB,CVT,errmsg,errflg) diff --git a/physics/cs_conv.F90 b/physics/cs_conv.F90 index cb0c0b98b..eeda5fa1f 100644 --- a/physics/cs_conv.F90 +++ b/physics/cs_conv.F90 @@ -1859,7 +1859,7 @@ END SUBROUTINE CS_CUMLUS !*********************************************************************** !>\ingroup cs_scheme !! This subroutine calculates cloud base properties. - SUBROUTINE CUMBAS & !< cloud base + SUBROUTINE CUMBAS & ! cloud base ( IJSDIM, KMAX , & !DD dimensions KB , GCYM , KBMX , & ! output ntr , ntrq , & @@ -1881,15 +1881,15 @@ SUBROUTINE CUMBAS & !< cloud base logical lprnt ! ! [OUTPUT] - INTEGER KB (IJSDIM) !< cloud base - REAL(r8) GCYM (IJSDIM, KMAX) !< norm. mass flux (half lev) + INTEGER KB (IJSDIM) ! cloud base + REAL(r8) GCYM (IJSDIM, KMAX) ! norm. mass flux (half lev) INTEGER KBMX - REAL(r8) GCHB (IJSDIM) !< cloud base MSE - REAL(r8) GCWB (IJSDIM) !< cloud base total water - REAL(r8) GCUB (IJSDIM) !< cloud base U - REAL(r8) GCVB (IJSDIM) !< cloud base V - REAL(r8) GCIB (IJSDIM) !< cloud base ice - REAL(r8) GCtrB (IJSDIM,ntrq:ntr) !< cloud base tracer + REAL(r8) GCHB (IJSDIM) ! cloud base MSE + REAL(r8) GCWB (IJSDIM) ! cloud base total water + REAL(r8) GCUB (IJSDIM) ! cloud base U + REAL(r8) GCVB (IJSDIM) ! cloud base V + REAL(r8) GCIB (IJSDIM) ! cloud base ice + REAL(r8) GCtrB (IJSDIM,ntrq:ntr) ! cloud base tracer !DDsigma added to arglist for AW, subcloud updraft profiles: temperature, water vapor ! total water, cloud water, and cloud ice respectively @@ -1897,22 +1897,22 @@ SUBROUTINE CUMBAS & !< cloud base REAL(r8), dimension(ijsdim,kmax,ntrq:ntr) :: gctrbl !DDsigmadiag ! ! [INPUT] - REAL(r8) GDH (IJSDIM, KMAX) !< moist static energy - REAL(r8) GDW (IJSDIM, KMAX) !< total water - REAL(r8) GDq (IJSDIM, KMAX, ntr) !< water vapor and tracer - REAL(r8) GDHS (IJSDIM, KMAX) !< saturate MSE - REAL(r8) GDQS (IJSDIM, KMAX) !< saturate humidity - REAL(r8) GDQI (IJSDIM, KMAX) !< cloud ice - REAL(r8) GDU (IJSDIM, KMAX) !< u-velocity - REAL(r8) GDV (IJSDIM, KMAX) !< v-velocity - REAL(r8) GDZM (IJSDIM, KMAX+1) !< Altitude (half lev) - REAL(r8) GDPM (IJSDIM, KMAX+1) !< pressure (half lev) + REAL(r8) GDH (IJSDIM, KMAX) ! moist static energy + REAL(r8) GDW (IJSDIM, KMAX) ! total water + REAL(r8) GDq (IJSDIM, KMAX, ntr) ! water vapor and tracer + REAL(r8) GDHS (IJSDIM, KMAX) ! saturate MSE + REAL(r8) GDQS (IJSDIM, KMAX) ! saturate humidity + REAL(r8) GDQI (IJSDIM, KMAX) ! cloud ice + REAL(r8) GDU (IJSDIM, KMAX) ! u-velocity + REAL(r8) GDV (IJSDIM, KMAX) ! v-velocity + REAL(r8) GDZM (IJSDIM, KMAX+1) ! Altitude (half lev) + REAL(r8) GDPM (IJSDIM, KMAX+1) ! pressure (half lev) REAL(r8) FDQS (IJSDIM, KMAX) REAL(r8) GAM (IJSDIM, KMAX) INTEGER ISTS, IENS ! ! [INTERNAL WORK] - REAL(r8) CBASE (IJSDIM) !< one over cloud base height + REAL(r8) CBASE (IJSDIM) ! one over cloud base height ! REAL(r8) CBASEP(IJSDIM) ! cloud base pressure REAL(r8) DELZ, GAMX, wrk ! REAL(r8) DELZ, QSL, GAMX, wrk diff --git a/physics/cs_conv_aw_adj.F90 b/physics/cs_conv_aw_adj.F90 index 871fbe213..4e84911b3 100644 --- a/physics/cs_conv_aw_adj.F90 +++ b/physics/cs_conv_aw_adj.F90 @@ -48,7 +48,7 @@ end subroutine cs_conv_aw_adj_finalize !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! -!>\section gen_cs_conv_aw_adj_run CPT cs_conv_aw_adj_run General Algorithm +!\section gen_cs_conv_aw_adj_run CPT cs_conv_aw_adj_run General Algorithm subroutine cs_conv_aw_adj_run(im, levs, do_cscnv, do_aw, do_shoc, & ntrac, ncld, ntcw, ntclamt, nncl, con_g, sigmafrac, & gt0, gq0, save_t, save_q, prsi, cldfrac, subcldfrac, & diff --git a/physics/cu_gf_deep.F90 b/physics/cu_gf_deep.F90 index 7bf08e6b7..24d57ca8c 100644 --- a/physics/cu_gf_deep.F90 +++ b/physics/cu_gf_deep.F90 @@ -1,7 +1,7 @@ !>\file cu_gf_deep.F90 !! This file is the Grell-Freitas deep convection scheme. -!>\defgroup cu_gf_deep_group GSD Grell-Freitas Deep Convection Main +!>\defgroup cu_gf_deep_group Grell-Freitas Deep Convection Module !>\ingroup cu_gf_group module cu_gf_deep use machine , only : kind_phys @@ -55,7 +55,7 @@ subroutine cu_gf_deep_run( & ,ichoice & ! choice of closure, use "0" for ensemble average ,ipr & ! this flag can be used for debugging prints ,ccn & ! not well tested yet - ,dtime & ! + ,dtime & ! dt over which forcing is applied ,imid & ! flag to turn on mid level convection ,kpbl & ! level of boundary layer height ,dhdt & ! boundary layer forcing (one closure for shallow) @@ -2316,6 +2316,13 @@ end subroutine cup_dd_moisture !!\param psur surface pressure !!\param ierr error value, maybe modified in this routine !!\param tcrit 258.K +!!\param itest +!!\param itf +!!\param ktf +!!\param its +!!\param ite +!!\param kts +!!\param kte subroutine cup_env(z,qes,he,hes,t,q,p,z1, & psur,ierr,tcrit,itest, & itf,ktf, & @@ -2453,6 +2460,7 @@ end subroutine cup_env !!\param psur surface pressure !!\param ierr error value, maybe modified in this routine !!\param z1 terrain elevation +!!\param itf,ktf,its,ite,kts,kte horizontal and vertical dimension subroutine cup_env_clev(t,qes,q,he,hes,z,p,qes_cup,q_cup, & he_cup,hes_cup,z_cup,p_cup,gamma_cup,t_cup,psur, & ierr,z1, & @@ -3163,8 +3171,6 @@ subroutine cup_minimi(array,ks,kend,kt,ierr, & end subroutine cup_minimi !>\ingroup cu_gf_deep_group -!> This subroutine calculates -!>\param subroutine cup_up_aa0(aa0,z,zu,dby,gamma_cup,t_cup, & kbcon,ktop,ierr, & itf,ktf, & @@ -3237,8 +3243,6 @@ end subroutine cup_up_aa0 !==================================================================== !>\ingroup cu_gf_deep_group -!> This subroutine calculates -!>\param subroutine neg_check(name,j,dt,q,outq,outt,outu,outv, & outqc,pret,its,ite,kts,kte,itf,ktf,ktop) @@ -3587,8 +3591,6 @@ subroutine cup_output_ens_3d(xff_mid,xf_ens,ierr,dellat,dellaq,dellaqc, & end subroutine cup_output_ens_3d !------------------------------------------------------- !>\ingroup cu_gf_deep_group -!> This subroutine calculates -!>\param subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & p_cup,kbcon,ktop,dby,clw_all,xland1, & q,gamma_cup,zu,qes_cup,k22,qe_cup, & @@ -3900,8 +3902,6 @@ end subroutine cup_up_moisture !-------------------------------------------------------------------- !>\ingroup cu_gf_deep_group -!> This function calculates -!>\param real function satvap(temp2) implicit none real(kind=kind_phys) :: temp2, temp, toot, toto, eilog, tsot, & @@ -4066,8 +4066,6 @@ subroutine rates_up_pdf(rand_vmas,ipr,name,ktop,ierr,p_cup,entr_rate_2d,hkbo,heo end subroutine rates_up_pdf !------------------------------------------------------------------------- !>\ingroup cu_gf_deep_group -!> This subroutine calculates -!>\param subroutine get_zu_zd_pdf_fim(kklev,p,rand_vmas,zubeg,ipr,xland,zuh2,draft,ierr,kb,kt,zu,kts,kte,ktf,max_mass,kpbli,csum,pmin_lev) implicit none @@ -4575,7 +4573,6 @@ function deriv3(xx, xi, yi, ni, m) end function deriv3 !============================================================================================= !>\ingroup cu_gf_deep_group -!> This subroutine calcualtes subroutine get_lateral_massflux(itf,ktf, its,ite, kts,kte & ,ierr,ktop,zo_cup,zuo,cd,entr_rate_2d & ,up_massentro, up_massdetro ,up_massentr, up_massdetr & @@ -4693,7 +4690,6 @@ end subroutine get_lateral_massflux !---meltglac------------------------------------------------- !------------------------------------------------------------------------------------ !>\ingroup cu_gf_deep_group -!> This subroutine calculates subroutine get_partition_liq_ice(ierr,tn,po_cup, p_liq_ice,melting_layer & ,itf,ktf,its,ite, kts,kte, cumulus ) implicit none @@ -4785,7 +4781,6 @@ end subroutine get_partition_liq_ice !------------------------------------------------------------------------------------ !>\ingroup cu_gf_deep_group -!> This subroutine calculates subroutine get_melting_profile(ierr,tn_cup,po_cup, p_liq_ice,melting_layer,qrco & ,pwo,edto,pwdo,melting & ,itf,ktf,its,ite, kts,kte, cumulus ) @@ -4860,7 +4855,6 @@ end subroutine get_melting_profile !---meltglac------------------------------------------------- !-----srf-08aug2017-----begin !>\ingroup cu_gf_deep_group -!> This subroutine calculates subroutine get_cloud_top(name,ktop,ierr,p_cup,entr_rate_2d,hkbo,heo,heso_cup,z_cup, & kstabi,k22,kbcon,its,ite,itf,kts,kte,ktf,zuo,kpbl,klcl,hcot) implicit none diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 1265a7112..2695ace2d 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -62,8 +62,8 @@ end subroutine cu_gf_driver_finalize ! t = current temp (t2di + physics up to now) !=================== -!> \defgroup cu_gf_group GSD Scale-Aware Grell-Freitas Convection Scheme Module -!>\defgroup cu_gf_driver GSD Grell-Freitas Convection Scheme Driver +!> \defgroup cu_gf_group Grell-Freitas Convection Scheme Module +!>\defgroup cu_gf_driver Grell-Freitas Convection Scheme Driver Module !> \ingroup cu_gf_group !! \section arg_table_cu_gf_driver_run Argument Table !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | diff --git a/physics/cu_gf_sh.F90 b/physics/cu_gf_sh.F90 index faca8839f..5eb582f2d 100644 --- a/physics/cu_gf_sh.F90 +++ b/physics/cu_gf_sh.F90 @@ -1,21 +1,37 @@ !>\file cu_gf_sh.F90 !! This file contains -!>\defgroup cu_gf_sh_group GSD Grell-Freitas Shallow Convection Main +!>\defgroup cu_gf_sh_group Grell-Freitas Shallow Convection Module !> \ingroup cu_gf_group -!! module cup_gf_sh will call shallow convection as described in Grell and +module cu_gf_sh + use machine , only : kind_phys + !real(kind=kind_phys), parameter:: c1_shal=0.0015! .0005 + real(kind=kind_phys), parameter:: c1_shal=0. !0.005! .0005 + real(kind=kind_phys), parameter:: g =9.81 + real(kind=kind_phys), parameter:: cp =1004. + real(kind=kind_phys), parameter:: xlv=2.5e6 + real(kind=kind_phys), parameter:: r_v=461. + real(kind=kind_phys), parameter:: c0_shal=.001 + real(kind=kind_phys), parameter:: fluxtune=1.5 + +contains + +!>\ingroup cu_gf_sh_group +!> GF shallow convection as described in Grell and !! Freitas (2014) \cite grell_and_freitas_2014. input variables are: +!!\param us x wind updated by physics +!!\param vs y wind updated by physics !!\param zo height at model levels !!\param t,tn temperature without and with forcing at model levels !!\param q,qo mixing ratio without and with forcing at model levels !!\param po pressure at model levels (mb) !!\param psur surface pressure (mb) !!\param z1 surface height -!!\param dhdt forcing for boundary layer equilibrium +!!\param dhdt forcing for boundary layer equilibrium !!\param hfx,qfx in w/m2 (positive, if upward from sfc) !!\param kpbl level of boundaty layer height !!\param xland land mask (1. for land) -!!\param ichoice which closure to choose +!!\param ichoice which closure to choose !!\n 1: old g !!\n 2: zws !!\n 3: dhdt @@ -37,21 +53,10 @@ !! not included (kg/kg) !!\param cnvwt required for gfs physics !!\param itf,ktf,its,ite, kts,kte are dimensions -!!\param ztexec,zqexec excess temperature and moisture for updraft -module cu_gf_sh - use machine , only : kind_phys - !real(kind=kind_phys), parameter:: c1_shal=0.0015! .0005 - real(kind=kind_phys), parameter:: c1_shal=0. !0.005! .0005 - real(kind=kind_phys), parameter:: g =9.81 - real(kind=kind_phys), parameter:: cp =1004. - real(kind=kind_phys), parameter:: xlv=2.5e6 - real(kind=kind_phys), parameter:: r_v=461. - real(kind=kind_phys), parameter:: c0_shal=.001 - real(kind=kind_phys), parameter:: fluxtune=1.5 - -contains - +!!\param ipr horizontal index of printed column +!!\param tropics =0 !>\section gen_cu_gf_sh_run GSD cu_gf_sh_run General Algorithm +!> @{ subroutine cu_gf_sh_run ( & us,vs,zo,t,q,z1,tn,qo,po,psur,dhdt,kpbl,rho, & ! input variables, must be supplied hfx,qfx,xland,ichoice,tcrit,dtime, & @@ -276,7 +281,7 @@ subroutine cu_gf_sh_run ( & !- moisture excess zqexec(i) = max(flux_tun(i)*qfx(i)/xlv/(rho(i,1)*zws(i)),0.) endif - !- zws for shallow convection closure (grant 2001) + !> - Calculate zws for shallow convection closure (grant 2001) !- height of the pbl zws(i) = max(0.,flux_tun(i)*0.41*buo_flux*zo(i,kpbl(i))*g/t(i,kpbl(i))) zws(i) = 1.2*zws(i)**.3333 @@ -929,4 +934,5 @@ subroutine cu_gf_sh_run ( & ! enddo end subroutine cu_gf_sh_run +!> @} end module cu_gf_sh diff --git a/physics/docs/ccppv3_doxyfile b/physics/docs/ccppv3_doxyfile index be9bfe1f2..6933751a4 100644 --- a/physics/docs/ccppv3_doxyfile +++ b/physics/docs/ccppv3_doxyfile @@ -133,7 +133,7 @@ INPUT = pdftxt/mainpage.txt \ ### pdftxt/GFS_STOCHY_PHYS.txt \ pdftxt/suite_input.nml.txt \ ### in-core MP -### ../gfdl_fv_sat_adj.F90 \ + ../gfdl_fv_sat_adj.F90 \ ### time_vary ../GFS_phys_time_vary.fv3.F90 \ ../ozne_def.f \ @@ -392,7 +392,8 @@ SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = CCPP \ - GEOS5 + MULTI_GASES \ + 0 EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES TAGFILES = diff --git a/physics/docs/pdftxt/CPT_adv_suite.txt b/physics/docs/pdftxt/CPT_adv_suite.txt index bca25db96..7617d9df3 100644 --- a/physics/docs/pdftxt/CPT_adv_suite.txt +++ b/physics/docs/pdftxt/CPT_adv_suite.txt @@ -1,9 +1,9 @@ /** -\page MGCSAW_page MGCSAW Suite +\page csawmg_page csawmg Suite -\section MGCSAW_suite_overview Overview +\section csawmg_suite_overview Overview -The advanced MGCSAW physics suite uses the parameterizations in the following order: +The advanced csawmg physics suite uses the parameterizations in the following order: - \ref GFS_RRTMG - \ref GFS_SFCLYR - \ref GFS_NSST @@ -23,11 +23,11 @@ The advanced MGCSAW physics suite uses the parameterizations in the following or \section sdf_cpt_suite Suite Definition File -The advanced MGCSAW physics suite uses the parameterizations in the following order, as defined in \c SCM_MGCSAW : +The advanced csawmg physics suite uses the parameterizations in the following order, as defined in \c SCM_csawmg : \code - + diff --git a/physics/docs/pdftxt/GFDL_cloud.txt b/physics/docs/pdftxt/GFDL_cloud.txt index 414d41374..200497f89 100644 --- a/physics/docs/pdftxt/GFDL_cloud.txt +++ b/physics/docs/pdftxt/GFDL_cloud.txt @@ -45,9 +45,6 @@ and ocean (larger sub-grid variability appears in larger area). Horizontal sub-g relative humidity calculation, evaporation and condensation processes. Scale-awareness is achieved by this horizontal subgrid variability and a \f$2^{nd}\f$ order FV-type vertical reconstruction (Lin et al. (1994) \cite lin_et_al_1994). -\section nml_opt Namelist Option -\ref gfdl_cloud_microphysics_nml - \section intro_GFDL_cloud Intraphysics Communication + For GFDL Cloud MP: \ref arg_table_gfdl_cloud_microphys_run + For GFDL Fast Physics: \ref arg_table_fv_sat_adj_run diff --git a/physics/docs/pdftxt/all_shemes_list.txt b/physics/docs/pdftxt/all_shemes_list.txt index 39b4917ef..8762cf0d1 100644 --- a/physics/docs/pdftxt/all_shemes_list.txt +++ b/physics/docs/pdftxt/all_shemes_list.txt @@ -81,7 +81,7 @@ to the parameterization. The CCPP v3 includes the suite used in the GFS v15 implemented operationally in June 2019 (suite GFS_v15). Additionally, it includes three developmental suites which are undergoing testing for possible future implementation in the UFS. Suite GFS_v15plus is identical to suite -GFS_v15 except for a replacement in the PBL parameterization (Han et al. 2019 \cite Han_2019 ). Suite MGCSAW differs from GFS_v15 as it +GFS_v15 except for a replacement in the PBL parameterization (Han et al. 2019 \cite Han_2019 ). Suite csawmg differs from GFS_v15 as it contains different convection and microphysics schemes made available through a NOAA Climate Process Team (CPT) with components developed at multiple research centers and universities, including Colorado State, Utah, NASA, NCAR, and EMC. Suite GSD_v0 differs from GFS_v15 as it uses the convection, microphysics, and boundary layer schemes employed in the Rapid Refresh (RAP) and High-Resolution Rapid Refresh (HRRR \cite Benjamin_2016 ) @@ -91,7 +91,7 @@ and in the GMTB website < Table 1. Physics suite options included in this documentation. \tableofcontents -| Phys suites | GFS_v15 | GFS_v15plus | MGCSAW | GSD_v0 | +| Phys suites | GFS_v15 | GFS_v15plus | csawmg | GSD_v0 | |------------------|----------------------|----------------------|---------------------|----------------------| | Deep Cu | \ref GFS_SAMFdeep | \ref GFS_SAMFdeep | \ref CSAW_scheme | \ref GSD_CU_GF | | Shallow Cu | \ref GFS_SAMFshal | \ref GFS_SAMFshal | \ref GFS_SAMFshal | \ref GSD_MYNNEDMF and \ref cu_gf_sh_group | diff --git a/physics/docs/pdftxt/suite_input.nml.txt b/physics/docs/pdftxt/suite_input.nml.txt index 75e5c09f9..a9b6734ed 100644 --- a/physics/docs/pdftxt/suite_input.nml.txt +++ b/physics/docs/pdftxt/suite_input.nml.txt @@ -234,7 +234,7 @@ and how stochastic perturbations are used in the Noah Land Surface Model. !
NML Description
aero_in gfs_control_type logical flag for using aerosols in Morrison-Gettelman microphysics .false.
iau_delthrs gfs_control_type incremental analysis update (IAU) time interval in hours 6
iaufhrs gfs_control_type forecast hours associated with increment files -1 -
\b Parameters \b Specific \b to \b MGCSAW \b Suite +
\b Parameters \b Specific \b to \b csawmg \b Suite
crtrh(3) gfs_control_type critical relative humidity at the surface, PBL top and at the top of the atmosphere 0.90,0.90,0.90
cscnv gfs_control_type logical flag for Chikira-Sugiyama deep convection .false.
do_aw gfs_control_type flag for Arakawa-Wu scale-awere adjustment .false. @@ -344,7 +344,7 @@ and how stochastic perturbations are used in the Noah Land Surface Model. 1
lsoil_lsm gfs_control_type number of soil layers internal to land surface model -1 -
\b Stochastic \Physics \b Specific \b Parameters +
\b Stochastic \b Physics \b Specific \b Parameters
do_sppt gfs_control_type flag for stochastic SPPT option .false.
do_shum gfs_control_type flag for stochastic SHUM option .false.
do_skeb gfs_control_type flag for stochastic SKEB option .false. diff --git a/physics/funcphys.f90 b/physics/funcphys.f90 index 1b50ad185..950698c97 100644 --- a/physics/funcphys.f90 +++ b/physics/funcphys.f90 @@ -788,7 +788,7 @@ subroutine gpvs !! computed in gpvs(). See documentation for fpvsx() for details. !! Input values outside table range are reset to table extrema. !>\param[in] t real, temperature in Kelvin -!>\param[out] fpvs real, saturation vapor pressure in Pascals +!\param[out] fpvs real, saturation vapor pressure in Pascals elemental function fpvs(t) !$$$ Subprogram Documentation Block ! @@ -838,7 +838,7 @@ elemental function fpvs(t) !! computed in gpvs(). See documentation for fpvsx() for details. !! Input values outside table range are reset to table extrema. !>\param[in] t real, temperatue in Kelvin -!>\param[out] fpvsq real, saturation vapor pressure in Pascals +!\param[out] fpvsq real, saturation vapor pressure in Pascals elemental function fpvsq(t) !$$$ Subprogram Documentation Block ! diff --git a/physics/gfdl_fv_sat_adj.F90 b/physics/gfdl_fv_sat_adj.F90 index 32f360034..90ed65e19 100644 --- a/physics/gfdl_fv_sat_adj.F90 +++ b/physics/gfdl_fv_sat_adj.F90 @@ -1,5 +1,5 @@ !>\file gfdl_fv_sat_adj.F90 -!! This file contains the fast saturation adjustment in the GFDL cloud microphysics. +!! This file contains the GFDL in-core fast saturation adjustment. !! and it is an "intermediate physics" implemented in the remapping Lagrangian to !! Eulerian loop of FV3 solver. !*********************************************************************** @@ -23,8 +23,8 @@ !* If not, see . !*********************************************************************** -!> This module is part of the GFDL Cloud MP and it is the CCPP-compliant -!! fast phyiscs called in FV3 dynamics solver. +!> This module contains the GFDL in-core fast saturation adjustment +!! called in FV3 dynamics solver. module fv_sat_adj ! Modules Included: ! diff --git a/physics/micro_mg3_0.F90 b/physics/micro_mg3_0.F90 index fc2d4733b..671290749 100644 --- a/physics/micro_mg3_0.F90 +++ b/physics/micro_mg3_0.F90 @@ -272,37 +272,37 @@ subroutine micro_mg_init( & ! !----------------------------------------------------------------------- - integer, intent(in) :: kind !< Kind used for reals + integer, intent(in) :: kind ! Kind used for reals real(r8), intent(in) :: gravit real(r8), intent(in) :: rair real(r8), intent(in) :: rh2o real(r8), intent(in) :: cpair - real(r8), intent(in) :: tmelt_in !< Freezing point of water (K) + real(r8), intent(in) :: tmelt_in ! Freezing point of water (K) real(r8), intent(in) :: latvap real(r8), intent(in) :: latice - real(r8), intent(in) :: rhmini_in !< Minimum rh for ice cloud fraction > 0. + real(r8), intent(in) :: rhmini_in ! Minimum rh for ice cloud fraction > 0. real(r8), intent(in) :: micro_mg_dcs real(r8), intent(in) :: ts_auto(2) real(r8), intent(in) :: mg_qcvar !++ag !MG3 dense precipitating ice. Note, only 1 can be true, or both false. - logical, intent(in) :: micro_mg_do_graupel_in !< .true. = configure with graupel - !< .false. = no graupel (hail possible) - logical, intent(in) :: micro_mg_do_hail_in !< .true. = configure with hail - !< .false. = no hail (graupel possible) + logical, intent(in) :: micro_mg_do_graupel_in ! .true. = configure with graupel + ! .false. = no graupel (hail possible) + logical, intent(in) :: micro_mg_do_hail_in ! .true. = configure with hail + ! .false. = no hail (graupel possible) !--ag - logical, intent(in) :: microp_uniform_in !< .true. = configure uniform for sub-columns - !< .false. = use w/o sub-columns (standard) - logical, intent(in) :: do_cldice_in !< .true. = do all processes (standard) - !< .false. = skip all processes affecting cloud ice - logical, intent(in) :: use_hetfrz_classnuc_in !< use heterogeneous freezing + logical, intent(in) :: microp_uniform_in ! .true. = configure uniform for sub-columns + ! .false. = use w/o sub-columns (standard) + logical, intent(in) :: do_cldice_in ! .true. = do all processes (standard) + ! .false. = skip all processes affecting cloud ice + logical, intent(in) :: use_hetfrz_classnuc_in ! use heterogeneous freezing - character(len=16),intent(in) :: micro_mg_precip_frac_method_in !< type of precipitation fraction method - real(r8), intent(in) :: micro_mg_berg_eff_factor_in !< berg efficiency factor - logical, intent(in) :: allow_sed_supersat_in !< allow supersaturated conditions after sedimentation loop - logical, intent(in) :: do_sb_physics_in !< do SB autoconversion and accretion physics + character(len=16),intent(in) :: micro_mg_precip_frac_method_in ! type of precipitation fraction method + real(r8), intent(in) :: micro_mg_berg_eff_factor_in ! berg efficiency factor + logical, intent(in) :: allow_sed_supersat_in ! allow supersaturated conditions after sedimentation loop + logical, intent(in) :: do_sb_physics_in ! do SB autoconversion and accretion physics logical, intent(in) :: do_ice_gmao_in logical, intent(in) :: do_liq_liu_in @@ -4444,18 +4444,18 @@ end subroutine micro_mg_tend !======================================================================== !>\ingroup mg3_mp -!! This subroutine calculates effective radius for rain + cloud. +!! This subroutine calculates effective radius for rain and cloud. subroutine calc_rercld(lamr, n0r, lamc, pgam, qric, qcic, ncic, rercld, mgncol,nlev) - integer, intent(in) :: mgncol, nlev - real(r8), dimension(mgncol,nlev), intent(in) :: lamr !< rain size parameter (slope) - real(r8), dimension(mgncol,nlev), intent(in) :: n0r !< rain size parameter (intercept) - real(r8), dimension(mgncol,nlev), intent(in) :: lamc !< size distribution parameter (slope) - real(r8), dimension(mgncol,nlev), intent(in) :: pgam !< droplet size parameter - real(r8), dimension(mgncol,nlev), intent(in) :: qric !< in-cloud rain mass mixing ratio - real(r8), dimension(mgncol,nlev), intent(in) :: qcic !< in-cloud cloud liquid - real(r8), dimension(mgncol,nlev), intent(in) :: ncic !< in-cloud droplet number concentration - - real(r8), dimension(mgncol,nlev), intent(inout) :: rercld !< effective radius calculation for rain + cloud + integer, intent(in) :: mgncol, nlev ! horizontal and vertical dimension + real(r8), dimension(mgncol,nlev), intent(in) :: lamr ! rain size parameter (slope) + real(r8), dimension(mgncol,nlev), intent(in) :: n0r ! rain size parameter (intercept) + real(r8), dimension(mgncol,nlev), intent(in) :: lamc ! size distribution parameter (slope) + real(r8), dimension(mgncol,nlev), intent(in) :: pgam ! droplet size parameter + real(r8), dimension(mgncol,nlev), intent(in) :: qric ! in-cloud rain mass mixing ratio + real(r8), dimension(mgncol,nlev), intent(in) :: qcic ! in-cloud cloud liquid + real(r8), dimension(mgncol,nlev), intent(in) :: ncic ! in-cloud droplet number concentration + + real(r8), dimension(mgncol,nlev), intent(inout) :: rercld ! effective radius calculation for rain + cloud ! combined size of precip & cloud drops real(r8) :: Atmp diff --git a/physics/micro_mg_utils.F90 b/physics/micro_mg_utils.F90 index fe1c8c8b0..7da528143 100644 --- a/physics/micro_mg_utils.F90 +++ b/physics/micro_mg_utils.F90 @@ -793,10 +793,10 @@ subroutine size_dist_param_ice_vect(props, qic, nic, lam, mgncol, n0) end subroutine size_dist_param_ice_vect !>\ingroup micro_mg_utils_mod +!> Finds the average diameter of particles given their density, and +!! mass/number concentrations in the air. +!! Assumes that diameter follows an exponential distribution. real(r8) elemental function avg_diameter(q, n, rho_air, rho_sub) - !> Finds the average diameter of particles given their density, and - !! mass/number concentrations in the air. - !! Assumes that diameter follows an exponential distribution. real(r8), intent(in) :: q !< mass mixing ratio real(r8), intent(in) :: n !< number concentration (per volume) real(r8), intent(in) :: rho_air !< local density of the air @@ -807,9 +807,9 @@ real(r8) elemental function avg_diameter(q, n, rho_air, rho_sub) end function avg_diameter !>\ingroup mg2mg3 +!> Finds a coefficient for process rates based on the relative variance +!! of cloud water. elemental function var_coef_r8(relvar, a) result(res) - !> Finds a coefficient for process rates based on the relative variance - !! of cloud water. real(r8), intent(in) :: relvar real(r8), intent(in) :: a real(r8) :: res @@ -819,9 +819,9 @@ elemental function var_coef_r8(relvar, a) result(res) end function var_coef_r8 !>\ingroup mg2mg3 +!> Finds a coefficient for process rates based on the relative variance +!! of cloud water. elemental function var_coef_integer(relvar, a) result(res) - !> Finds a coefficient for process rates based on the relative variance - !! of cloud water. real(r8), intent(in) :: relvar integer, intent(in) :: a real(r8) :: res diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 363484457..76bc62298 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -1094,7 +1094,7 @@ subroutine hedmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & ! compute tke dissipation rate ! !> ## Calculate heating due to TKE dissipation and add to the tendency for temperature -!! Following Han et al. (2015) \cite han_et_al_2015 , turbulence dissipation contributes to the tendency of temperature in the following way. First, turbulence dissipation is calculated by equation 17 of Han et al. (2015) \cite han_et_al_2015 for the PBL and equation 16 for the surface layer. +!! Following Han et al. (2016) \cite Han_2016 , turbulence dissipation contributes to the tendency of temperature in the following way. First, turbulence dissipation is calculated by equation 17 of Han et al. (2016) \cite Han_2016 for the PBL and equation 16 for the surface layer. if(dspheat) then ! do k = 1,km1 diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index df4a5de73..fb4d3d4cb 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -147,7 +147,7 @@ end subroutine mp_thompson_init #if 0 -!! \section arg_table_mp_thompson_run Argument Table +!> \section arg_table_mp_thompson_run Argument Table !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |-----------------|-----------------------------------------------------------------------|-----------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| !! | ncol | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | diff --git a/physics/radiation_clouds.f b/physics/radiation_clouds.f index 7f8d49c23..abc063953 100644 --- a/physics/radiation_clouds.f +++ b/physics/radiation_clouds.f @@ -845,6 +845,8 @@ end subroutine progcld1 !!\param delp (IX,NLAY), model layer pressure thickness in mb (100Pa) !!\param IX horizontal dimention !!\param NLAY,NLP1 vertical layer/level dimensions +!!\param lmfshal flag for mass-flux shallow convection scheme in the cloud fraction calculation +!!\param lmfdeep2 flag for mass-flux deep convection scheme in the cloud fraction calculation !!\param clouds (IX,NLAY,NF_CLDS), cloud profiles !!\n (:,:,1) - layer total cloud fraction !!\n (:,:,2) - layer cloud liq water path \f$(g/m^2)\f$ @@ -860,7 +862,7 @@ end subroutine progcld1 !!\param mbot (IX,3), vertical indices for low, mid, hi cloud bases !!\param de_lgth (IX), clouds decorrelation length (km) !>\section gen_progcld2 progcld2 General Algorithm -!! @{ +!> @{ subroutine progcld2 & & ( plyr,plvl,tlyr,tvly,qlyr,qstl,rhly,clw, & ! --- inputs: & xlat,xlon,slmsk,dz,delp, f_ice,f_rain,r_rime,flgmin, & @@ -1265,7 +1267,7 @@ subroutine progcld2 & return !................................... end subroutine progcld2 -!! @} +!> @} !----------------------------------- !> \ingroup module_radiation_clouds @@ -1279,6 +1281,8 @@ end subroutine progcld2 !!\param qstl (ix,nlay), layer saturate humidity in gm/gm !!\param rhly (ix,nlay), layer relative humidity (=qlyr/qstl) !!\param clw (ix,nlay), layer cloud condensate amount +!!\param cnvw (ix,nlay), layer convective cloud condensate +!!\param cnvc (ix,nlay), layer convective cloud cover !!\param xlat (ix), grid latitude in radians, default to pi/2 -> !! -pi/2 range, otherwise see in-line comment !!\param xlon (ix), grid longitude in radians (not used) @@ -1684,6 +1688,8 @@ end subroutine progcld3 !!\param xlon (ix), grid longitude in radians (not used) !!\param slmsk (ix), sea/land mask array (sea:0, land:1, sea-ice:2) !!\param cldtot (ix,nlay), layer total cloud fraction +!!\param dz (ix,nlay), layer thickness (km) +!!\param delp (ix,nlay), model layer pressure thickness in mb (100Pa) !!\param ix horizontal dimension !!\param nlay vertical layer dimension !!\param nlp1 vertical level dimension @@ -1700,6 +1706,7 @@ end subroutine progcld3 !!\param clds fraction of clouds for low, mid, hi cloud tops !!\param mtop vertical indices for low, mid, hi cloud tops !!\param mbot vertical indices for low, mid, hi cloud bases +!!\param de_lgth clouds decorrelation length (km) !>\section gen_progcld4 progcld4 General Algorithm !! @{ subroutine progcld4 & @@ -2014,6 +2021,8 @@ end subroutine progcld4 !! range, otherwise see in-line comment !>\param xlon (ix), grid longitude in radians (not used) !>\param slmsk (ix), sea/land mask array (sea:0, land:1, sea-ice:2) +!>\param dz layer thickness (km) +!>\param delp model layer pressure thickness in mb (100Pa) !>\param ntrac number of tracers minus one (Model%ntrac-1) !>\param ntcw tracer index for cloud liquid water minus one (Model%ntcw-1) !>\param ntiw tracer index for cloud ice water minus one (Model%ntiw-1) @@ -2037,6 +2046,7 @@ end subroutine progcld4 !>\param clds (ix,5), fraction of clouds for low, mid, hi, tot, bl !>\param mtop (ix,3), vertical indices for low, mid, hi cloud tops !>\param mbot (ix,3), vertical indices for low, mid, hi cloud bases +!>\param de_lgth clouds decorrelation length (km) !>\section gen_progcld4o progcld4o General Algorithm !! @{ subroutine progcld4o & @@ -2677,9 +2687,8 @@ end subroutine progcld5 !!\param plvl (IX,NLP1), model level pressure in mb (100Pa) !!\param tlyr (IX,NLAY), model layer mean temperature in K !!\param tvly (IX,NLAY), model layer virtual temperature in K -!!\param qlyr (IX,NLAY), layer specific humidity in gm/gm -!!\param clw (IX,NLAY), layer cloud liquid water amount -!!\param ciw (IX,NLAY), layer cloud ice water amount +!!\param ccnd (IX,NLAY), layer cloud condensate amount +!!\param ncnd number of layer cloud condensate types !!\param xlat (IX), grid latitude in radians, default to pi/2 -> !! -pi/2 range, otherwise see in-line comment !!\param xlon (IX), grid longitude in radians (not used) diff --git a/physics/radlw_main.f b/physics/radlw_main.f index 961f92a78..4d560b7b2 100644 --- a/physics/radlw_main.f +++ b/physics/radlw_main.f @@ -1848,6 +1848,8 @@ end subroutine cldprop !!\param cldf layer cloud fraction !!\param nlay number of model vertical layers !!\param ipseed permute seed for random num generator +!!\param dz layer thickness +!!\param de_lgth layer cloud decorrelation length (km) !!\param lcloudy sub-colum cloud profile flag array !!\section mcica_subcol_gen mcica_subcol General Algorithm !! @{ @@ -2086,7 +2088,7 @@ end subroutine mcica_subcol !! 4-h2o/ch4,5-n2o/co2,6-o3/co2 !!\n (:,:,n)n=1,2: the rates of ref press at !! the 2 sides of the layer -!!\param facij factors multiply the reference ks, i,j=0/1 for +!!\param fac00,fac01,fac10,fac11 factors multiply the reference ks, i,j=0/1 for !! lower/higher of the 2 appropriate temperatures !! and altitudes. !!\param selffac scale factor for w. v. self-continuum equals @@ -2102,8 +2104,7 @@ end subroutine mcica_subcol !!\param scaleminor,scaleminorn2 scale factors for minor gases !!\param indminor index of lower ref temp for minor gases !>\section setcoef_gen setcoef General Algorithm -!! -! ---------------------------------- +!> @{ subroutine setcoef & & ( pavel,tavel,tz,stemp,h2ovmr,colamt,coldry,colbrd, & ! --- inputs: & nlay, nlp1, & @@ -2360,6 +2361,7 @@ subroutine setcoef & return ! .................................. end subroutine setcoef +!> @} ! ---------------------------------- !>\ingroup module_radlw_main @@ -3768,7 +3770,7 @@ end subroutine rtrnmc !! 5-n2o/co2,6-o3/co2 !!\n (:,:,n)n=1,2: the rates of ref press at the 2 !! sides of the layer -!!\param facij factors multiply the reference ks, i,j of 0/1 +!!\param fac00,fac01,fac10,fac11 factors multiply the reference ks, i,j of 0/1 !! for lower/higher of the 2 appropriate !! temperatures and altitudes !!\param jp index of lower reference pressure diff --git a/physics/radsw_main.f b/physics/radsw_main.f index 628450e06..23bfdaa8a 100644 --- a/physics/radsw_main.f +++ b/physics/radsw_main.f @@ -1586,6 +1586,8 @@ end subroutine rswinit !!\param nlay vertical layer number !!\param ipseed permutation seed for generating random numbers !! (isubcsw>0) +!!\param dz layer thickness (km) +!!\param delgth layer cloud decorrelation length (km) !!\param taucw cloud optical depth, w/o delta scaled !!\param ssacw weighted cloud single scattering albedo !! (ssa = ssacw / taucw) @@ -1974,9 +1976,11 @@ end subroutine cldprop !!\param cldf layer cloud fraction !!\param nlay number of model vertical layers !!\param ipseed permute seed for random num generator +!!\param dz layer thickness (km) +!!\param de_lgth layer cloud decorrelation length (km) !!\param lcloudy sub-colum cloud profile flag array !!\section mcica_sw_gen mcica_subcol General Algorithm -!! @{ +!> @{ ! ---------------------------------- subroutine mcica_subcol & & ( cldf, nlay, ipseed, dz, de_lgth, & ! --- inputs @@ -2184,7 +2188,7 @@ subroutine mcica_subcol & return ! .................................. end subroutine mcica_subcol -!! @} +!> @} ! ---------------------------------- !>\ingroup module_radsw_main @@ -2199,7 +2203,7 @@ end subroutine mcica_subcol !!\param jp indices of lower reference pressure !!\param jt,jt1 indices of lower reference temperatures at !! levels of jp and jp+1 -!!\param facij factors mltiply the reference ks,i,j=0/1 for +!!\param fac00,fac01,fac10,fac11 factors mltiply the reference ks,i,j=0/1 for !! lower/higher of the 2 appropriate temperature !! and altitudes. !!\param selffac scale factor for w. v. self-continuum equals @@ -4004,7 +4008,7 @@ end subroutine vrtqdr !! are for h2o, co2, o3, n2o, ch4, and o2, !! respectively \f$(mol/cm^2)\f$ !!\param colmol total column amount (dry air+water vapor) -!!\param facij for each layer, these are factors that are +!!\param fac00,fac01,fac10,fac11 for each layer, these are factors that are !! needed to compute the interpolation factors !! that multiply the appropriate reference !! k-values. a value of 0/1 for i,j indicates diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F index 0dc7cc0ee..9c0e9d915 100644 --- a/physics/satmedmfvdif.F +++ b/physics/satmedmfvdif.F @@ -448,7 +448,6 @@ subroutine satmedmfvdif_run(ix,im,km,ntrac,ntcw,ntiw,ntke, & ! !> - Compute an empirical cloud fraction based on !! Xu and Randall (1996) \cite xu_and_randall_1996 -!! (see \ref cld_fra). do k = 1, km do i = 1, im plyr(i,k) = 0.01 * prsl(i,k) ! pa to mb (hpa) diff --git a/physics/sflx.f b/physics/sflx.f index 926115f13..c41334c91 100644 --- a/physics/sflx.f +++ b/physics/sflx.f @@ -57,6 +57,7 @@ !!\param[in] snoalb real, max albedo over deep snow (fraction) !!\param[in] bexpp real, perturbation of soil type "b" parameter (perturbation) !!\param[in] xlaip real, perturbation of leave area index (perturbation) +!!\param[in] lheatstrg logical, flag for canopy heat storage parameterization !!\param[in,out] tbot real, bottom soil temp (\f$K\f$) (local yearly-mean sfc air temp) !!\param[in,out] cmc real, canopy moisture content (\f$m\f$) !!\param[in,out] t1 real, ground/canopy/snowpack eff skin temp (\f$K\f$) @@ -440,7 +441,7 @@ subroutine gfssflx &! --- input ! --- ... bexp sfc-perts, mgehne !> - Calculate perturbated soil type "b" parameter. -!! Following Gehne et al. (2018) \cite gehne_et_al_2018, a perturbation of LAI +!! Following Gehne et al. (2019) \cite Gehne_2019 , a perturbation of LAI !! "leaf area index" (xlaip) and a perturbation of the empirical exponent parameter !! b in the soil hydraulic conductivity calculation (bexpp) are added to account for !! the uncertainties of LAI and b associated with different vegetation types and soil From 42b442a0c2b2a3403a1ff5602972aaa4bde984a1 Mon Sep 17 00:00:00 2001 From: Man Zhang Date: Fri, 14 Jun 2019 09:29:00 -0600 Subject: [PATCH 09/89] scidoc update --- physics/cu_gf_deep.F90 | 1 + physics/cu_gf_driver.F90 | 3 ++ physics/cu_gf_sh.F90 | 26 ++++++---- physics/docs/library.bib | 22 +++++++- physics/docs/pdftxt/GSD_CU_GF_deep.txt | 46 +++++++++-------- physics/docs/pdftxt/suite_input.nml.txt | 6 +-- physics/funcphys.f90 | 68 ++++++++++++------------- physics/micro_mg3_0.F90 | 4 +- physics/module_bl_mynn.F90 | 10 ++-- 9 files changed, 110 insertions(+), 76 deletions(-) diff --git a/physics/cu_gf_deep.F90 b/physics/cu_gf_deep.F90 index 24d57ca8c..4c357d787 100644 --- a/physics/cu_gf_deep.F90 +++ b/physics/cu_gf_deep.F90 @@ -3,6 +3,7 @@ !>\defgroup cu_gf_deep_group Grell-Freitas Deep Convection Module !>\ingroup cu_gf_group +!! This is Grell-Freitas deep convection scheme module module cu_gf_deep use machine , only : kind_phys real(kind=kind_phys), parameter::g=9.81 diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 2695ace2d..cdd7855d0 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -1,6 +1,7 @@ !>\file cu_gf_driver.F90 !! This file is scale-aware Grell-Freitas cumulus scheme driver. + module cu_gf_driver ! DH* TODO: replace constants with arguments to cu_gf_driver_run @@ -63,8 +64,10 @@ end subroutine cu_gf_driver_finalize !=================== !> \defgroup cu_gf_group Grell-Freitas Convection Scheme Module +!! This is the Grell-Freitas scale and aerosol aware scheme. !>\defgroup cu_gf_driver Grell-Freitas Convection Scheme Driver Module !> \ingroup cu_gf_group +!! This is the Grell-Freitas convection scheme driver module. !! \section arg_table_cu_gf_driver_run Argument Table !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |----------------|-----------------------------------------------------------|-----------------------------------------------------|---------------|------|-----------|-----------|--------|----------| diff --git a/physics/cu_gf_sh.F90 b/physics/cu_gf_sh.F90 index 5eb582f2d..7f88d0c14 100644 --- a/physics/cu_gf_sh.F90 +++ b/physics/cu_gf_sh.F90 @@ -1,5 +1,5 @@ !>\file cu_gf_sh.F90 -!! This file contains +!! This file contains Grell-Freitas shallow convection scheme. !>\defgroup cu_gf_sh_group Grell-Freitas Shallow Convection Module !> \ingroup cu_gf_group @@ -30,6 +30,7 @@ module cu_gf_sh !!\param dhdt forcing for boundary layer equilibrium !!\param hfx,qfx in w/m2 (positive, if upward from sfc) !!\param kpbl level of boundaty layer height +!!\param rho moist air density !!\param xland land mask (1. for land) !!\param ichoice which closure to choose !!\n 1: old g @@ -37,6 +38,7 @@ module cu_gf_sh !!\n 3: dhdt !!\n 0: average !!\param tcrit parameter for water/ice conversion (258) +!!\param dtime physics time step !!\param zuo normalized mass flux profile !!\param xmb_out base mass flux !!\param kbcon convective cloud base @@ -47,10 +49,12 @@ module cu_gf_sh !!\param outt temperature tendency (k/s) !!\param outq mixing ratio tendency (kg/kg/s) !!\param outqc cloud water/ice tendency (kg/kg/s) +!!\param outu x wind tendency +!!\param outv y wind tendency !!\param pre precip rate (mm/s) !!\param cupclw incloud mixing ratio of cloudwater/ice (for radiation) !! this needs heavy tuning factors, since cloud fraction is -!! not included (kg/kg) +!! not included (kg/kg) !!\param cnvwt required for gfs physics !!\param itf,ktf,its,ite, kts,kte are dimensions !!\param ipr horizontal index of printed column @@ -290,11 +294,11 @@ subroutine cu_gf_sh_run ( & enddo ! -!--- max height(m) above ground where updraft air can originate +!> - Determin max height(m) above ground where updraft air can originate ! zkbmax=3000. ! -!--- calculate moist static energy, heights, qes +!> - Call cup_env() to calculate moist static energy, heights, qes ! call cup_env(z,qes,he,hes,t,q,po,z1, & psur,ierr,tcrit,-1, & @@ -306,7 +310,7 @@ subroutine cu_gf_sh_run ( & its,ite, kts,kte) ! -!--- environmental values on cloud levels +!> - Call cup_env_clev() to calculate environmental values on cloud levels ! call cup_env_clev(t,qes,q,he,hes,z,po,qes_cup,q_cup,he_cup, & hes_cup,z_cup,p_cup,gamma_cup,t_cup,psur, & @@ -347,7 +351,7 @@ subroutine cu_gf_sh_run ( & ! ! ! -!------- determine level with highest moist static energy content - k22 +!> - Determine level with highest moist static energy content (\p k22) ! do 36 i=its,itf if(kpbl(i).gt.3)cap_max(i)=po_cup(i,kpbl(i)) @@ -364,7 +368,8 @@ subroutine cu_gf_sh_run ( & endif 36 continue ! -!--- determine the level of convective cloud base - kbcon +!> - Call get_cloud_bc() and cup_kbcon() to determine the level of +!! convective cloud base (\p kbcon) ! do i=its,itf if(ierr(i).eq.0)then @@ -388,7 +393,8 @@ subroutine cu_gf_sh_run ( & 0,itf,ktf, & its,ite, kts,kte, & z_cup,entr_rate,heo,0) -!--- get inversion layers for cloud tops + +!> - Call cup_minimi() and get_inversion_layers() to get inversion layers for cloud tops call cup_minimi(heso_cup,kbcon,kbmax,kstabi,ierr, & itf,ktf, & its,ite, kts,kte) @@ -432,7 +438,7 @@ subroutine cu_gf_sh_run ( & endif endif enddo -! get normalized mass flux profile +!> - Call rates_up_pdf() to get normalized mass flux profile call rates_up_pdf(rand_vmas,ipr,'shallow',ktop,ierr,po_cup,entr_rate_2d,hkbo,heo,heso_cup,zo_cup, & xland1,kstabi,k22,kbcon,its,ite,itf,kts,kte,ktf,zuo,kpbl,ktopx,kbcon,pmin_lev) do i=its,itf @@ -470,7 +476,7 @@ subroutine cu_gf_sh_run ( & endif enddo ! -! calculate mass entrainment and detrainment +!> - Call get_lateral_massflux() to calculate mass entrainment and detrainment ! call get_lateral_massflux(itf,ktf, its,ite, kts,kte & ,ierr,ktop,zo_cup,zuo,cd,entr_rate_2d & diff --git a/physics/docs/library.bib b/physics/docs/library.bib index 5775c6b7b..223c34395 100644 --- a/physics/docs/library.bib +++ b/physics/docs/library.bib @@ -1,13 +1,33 @@ %% This BibTeX bibliography file was created using BibDesk. %% http://bibdesk.sourceforge.net/ -%% Created for Man Zhang at 2019-06-10 16:42:57 -0600 +%% Created for Man Zhang at 2019-06-13 14:38:54 -0600 %% Saved with string encoding Unicode (UTF-8) +@article{bechtold_et_al_2014, + Author = {P. Bechtold and N. Semane and P. Lopez and J-P Chaboureau and A. Beljaars and N. Bormann}, + Date-Added = {2019-06-13 14:29:21 -0600}, + Date-Modified = {2019-06-13 14:38:38 -0600}, + Journal = {J. Atmos. Sci.}, + Pages = {734-753}, + Title = {Representing equilibrium and nonequilibrium convection in large-scale models}, + Volume = {71}, + Year = {2014}} + +@article{freitas_et_al_2018, + Author = {S.R. Freitas and G.A. Grell and A. Molod and M. A. Thompson and W.M. Putman and C. M. Santos e Silva and E. P. Souza}, + Date-Added = {2019-06-13 13:51:50 -0600}, + Date-Modified = {2019-06-13 14:07:37 -0600}, + Journal = {Journal of Advances in Modeling Earth Systems}, + Pages = {1266-1289}, + Title = {Assessing the Grell-Freitas convection parameterization in the NASA GEOS modeling system}, + Volume = {10}, + Year = {2018}} + @article{qu_and_hall_2005, Author = {X. Qu and A. Hall}, Date-Added = {2019-06-10 16:41:01 -0600}, diff --git a/physics/docs/pdftxt/GSD_CU_GF_deep.txt b/physics/docs/pdftxt/GSD_CU_GF_deep.txt index 041e92692..05e3cf39e 100644 --- a/physics/docs/pdftxt/GSD_CU_GF_deep.txt +++ b/physics/docs/pdftxt/GSD_CU_GF_deep.txt @@ -2,31 +2,33 @@ \page GSD_CU_GF Grell-Freitas Scale and Aerosol Aware Convection Scheme \section gfcu_descrip Description -The Grell-Freitas scale and aerosol aware convection scheme is an Arakawa-Schubert mass flux type scheme, and is both aerosol and scale aware. -Aerosol awareness (emulating the impact of aerosols on precipitation processes) is obtained through changing the rate of -conversion from cloud droplets to raindrops (Berry (1968) \cite berry_1968 ), and by modifying the precipitation efficiency of the -raindrops (the fraction of total condensed water volume in the cloud's lifetime reaching the ground (Jiang et al. (2010) \cite Jiang_2010) ) -Scale awareness comes through the use of an empirical formula for the fractional area (\f$\sigma\f$) of the model grid column -containing updrafts and downdrafts (Arakawa et al. (2011) \cite Arakawa_2011 ). The entrainment rate for the updrafts is an inverse function -of \f$\sigma\f$. As the fractional coverage become large, the resolved motion takes over convective processes -and the Grell-Freitas scheme becomes a shallow convection scheme, simulating the effects of unresolved fair weather -and towering cumulus on the forecast variables. - -The GF scheme uses an ensemble of convective schemes, with options that modulate closure and capping -inversion thresholds for convection. After calculations for each member of the cloud ensemble in the convective scheme, the ensemble -mean time tendency for temperature, moisture, and cloud and precipitation hydrometeors is passed to the rest of the model -(Grell and \f$D\acute{e}v\acute{e}nyi\f$ (2002) \cite Grell_2002 ). Additionally, the upward mass flux from parameterized convective updrafts is balanced by -subsidence in adjacent grid columns, if the horizontal grid spacing of the model using the parameterization is less than 10 km. - -# Operational Impacts in RAP/HRRR +The Grell-Freitas (GF) scheme as described in Grell and Freitas (2014, GF1) \cite grell_and_freitas_2014 and +Freitas et al. (2018, FG) \cite freitas_et_al_2018 follow the mass flux approach published by Grell (1993) \cite grell_1993. +Further developments by Grell and \f$D\acute{e}v\acute{e}nyi\f$ (2002) \cite Grell_2002 included implementing +stochastics through allowing parameter perturbations. In GF1 scale awareness, and the aerosol dependence through rain generation (following +Berry (1968) \cite berry_1968 and evaporation formulations (following Jiang et al. (2010) \cite Jiang_2010 ), depending on the +cloud concentration nuclei at cloud base were added. FG included mixed phase physics impact, momentum transport (as in ECMWF), + a diurnal cycle closure (Bechtold et al. (2014) \cite bechtold_et_al_2014 ), and a trimodal spectral size to simulate the interaction +and transition from shallow, congestus and deep convection regimes. The vertical massflux distribution of shallow, congestus and +deep convection regimes is characterized by Probability Density Functions (PDF's). The three PDF's are meant to represent the average +statistical mass flux characteristic of deep, congestus, and shallow (respectively) plumes in the grid area. Each PDF therefore represents +a spectrum of plumes within the grid box. Forcing is different for each characteristic type. Entrainment and detrainment are derived +from the PDF's. The deep convection considers scale awareness (Arakawa et al. (2011) \cite Arakawa_2011 ), the congestus type convection +as well as the shallow convection are not scale-aware. Aerosol dependence is implemented through dependence of rain generation and +evaporation formulations depending on the cloud concentration nuclei at cloud base. Aerosol dependence is considered experimental and +is turned off at this point. GF is able to transport tracers. + +A paper describing the latest changes and modifications is in progress and will be submitted to GMD. + +\b Operational \b Impacts \b in \b RAP/HRRR - Uses mass-flux schemes, which are more physically realistic than (sounding) adjustment schemes - - Takes parameterization uncertainty into account by using multiple convective schemes, using variations on scheme parameters - - For higher resolutions (less than 10 km), transitions as grid spacing decreases into a shallow convection scheme, as the grid scale motions begin to handle convective processes. This makes the scheme "scale aware". - - Scheme is aerosol-aware, driven by aerosol relationship to concentration of condensation nuclei. + - Takes parameterization uncertainty into account by allowing parameters from multiple convective schemes which can be perturbed +internally or with temporal and spatial correlation patterns + - For higher resolutions (less than 10 km), in addition to scale awareness as in Arakawa et al. (2011) \cite Arakawa_2011 GF can +transition as grid spacing decreases into a shallow convection scheme - Coupled to the grid scale precipitation and radiation schemes through passing of diagnosed cloud liquid and ice from simulated -precipitating convective cloud and shallow convective clouds, - +precipitating convective cloud and shallow convective clouds \section intra_rough_gf Intraphysics Communication The GF scheme passes cloud hydrometeors to the grid-scale microphysics scheme (\ref GSD_THOMPSON ) through detrainment from each diff --git a/physics/docs/pdftxt/suite_input.nml.txt b/physics/docs/pdftxt/suite_input.nml.txt index a9b6734ed..8817d5590 100644 --- a/physics/docs/pdftxt/suite_input.nml.txt +++ b/physics/docs/pdftxt/suite_input.nml.txt @@ -6,13 +6,13 @@ various namelists that control aspects of the I/O, dynamics, physics etc. Most p two namelists:\b &gfs_physics_nml and \b &gfdl_cloud_microphysics_nml, with additional specifications for stochastic physics in namelists \b &stochy_nam and \b &nam_sfcperts. -Namelist \b &gfdl_cloud_microphysics_nml is only relevant when the GFDL microphysics is used, and its variables are defined in +- Namelist \b &gfdl_cloud_microphysics_nml is only relevant when the GFDL microphysics is used, and its variables are defined in module_gfdl_cloud_microphys.F90. -Namelist \b &gfs_physics_nml pertains to all of the suites used, but some of the variables are only relevant for specific +- Namelist \b &gfs_physics_nml pertains to all of the suites used, but some of the variables are only relevant for specific parameterizations. Its variables are defined in file GFS_typedefs.F90 in the host model. -Namelist \b &stochy_nam specifies options for the use of SPPT, SKEB and SHUM, while namelist \b &nam_sfcperts specifies whether +- Namelist \b &stochy_nam specifies options for the use of SPPT, SKEB and SHUM, while namelist \b &nam_sfcperts specifies whether and how stochastic perturbations are used in the Noah Land Surface Model.
diff --git a/physics/funcphys.f90 b/physics/funcphys.f90 index 950698c97..8cb4b1b15 100644 --- a/physics/funcphys.f90 +++ b/physics/funcphys.f90 @@ -471,7 +471,7 @@ elemental function fpvslq(t) !! This function should be expanded inline in the calling routine. !>\author N Phillips !>\param[in] t real, temperature in Kelvin -!>\param[out] fpvslx real, saturation vapor pressure in Pascals +!\param[out] fpvslx real, saturation vapor pressure in Pascals elemental function fpvslx(t) !$$$ Subprogram Documentation Block ! @@ -683,7 +683,7 @@ elemental function fpvsiq(t) !!\n where tr is ttp/t and other values are physical constants. !! This function should be expanded inline in the calling routine. !>\param[in] t real, temperature in Kelvin -!>\param[out] fpvsix real, saturation vapor pressure in Pascals +!\param[out] fpvsix real, saturation vapor pressure in Pascals elemental function fpvsix(t) !$$$ Subprogram Documentation Block ! @@ -902,8 +902,8 @@ elemental function fpvsq(t) !!\n where tr is ttp/t and other values are physical constants. !! The reference for this computation is Emanuel(1994), pages 116-117. !! This function should be expanded inline in the calling routine. -!>\param[in] t real, temperature in Kelvin -!>\param[out] fpvsx real, saturation vapor pressure in Pascals +!!\param[in] t real, temperature in Kelvin +!\param[out] fpvsx real, saturation vapor pressure in Pascals elemental function fpvsx(t) !$$$ Subprogram Documentation Block ! @@ -1078,8 +1078,8 @@ elemental function ftdpl(pv) !! A quadratic interpolation is done between values in a lookup table !! computed in gtdpl(). See documentation for ftdplxg() for details. !! Input values outside table range are reset to table extrema. -!>\param[in] pv real, vapor pressure in Pascals -!>\param[out] ftdplq real, dewpoint temperature in Kelvin +!!\param[in] pv real, vapor pressure in Pascals +!\param[out] ftdplq real, dewpoint temperature in Kelvin elemental function ftdplq(pv) !$$$ Subprogram Documentation Block ! @@ -1133,8 +1133,8 @@ elemental function ftdplq(pv) !! An approximate dewpoint temperature for function ftdplxg() !! is obtained using ftdpl() so gtdpl() must be already called. !! See documentation for ftdplxg() for details. -!>\param[in] pv real, vapor pressure in Pascals -!>\param[out] ftdplx real, dewpoint temperature in Kelvin +!!\param[in] pv real, vapor pressure in Pascals +!\param[out] ftdplx real, dewpoint temperature in Kelvin elemental function ftdplx(pv) !$$$ Subprogram Documentation Block ! @@ -1190,9 +1190,9 @@ elemental function ftdplx(pv) !!\n The formula is inverted by iterating Newtonian approximations !! for each pvs until t is found to within 1.e-6 Kelvin. !! This function can be expanded inline in the calling routine. -!>\param[in] tg real, guess dewpoint temperature in Kelvin -!>\param[in] pv real, vapor pressure in Pascals -!>\param[out] ftdplxg real, dewpoint temperature in Kelvin +!!\param[in] tg real, guess dewpoint temperature in Kelvin +!!\param[in] pv real, vapor pressure in Pascals +!\param[out] ftdplxg real, dewpoint temperature in Kelvin elemental function ftdplxg(tg,pv) !$$$ Subprogram Documentation Block ! @@ -1314,7 +1314,7 @@ subroutine gtdpi !! computed in gtdpi(). See documentation for ftdpixg for details. !! Input values outside table range are reset to table extrema. !>\param[in] pv real, vapor pressure in Pascals -!>\param[out] ftdpi real, dewpoint temperature in Kelvin +!\param[out] ftdpi real, dewpoint temperature in Kelvin elemental function ftdpi(pv) !$$$ Subprogram Documentation Block ! @@ -1366,7 +1366,7 @@ elemental function ftdpi(pv) !! computed in gtdpi(). see documentation for ftdpixg() for details. !! Input values outside table range are reset to table extrema. !>\param[in] pv real, vapor pressure in Pascals -!>\param[out] ftdpiq real, dewpoint temperature in Kelvin +!\param[out] ftdpiq real, dewpoint temperature in Kelvin elemental function ftdpiq(pv) !$$$ Subprogram Documentation Block ! @@ -1422,7 +1422,7 @@ elemental function ftdpiq(pv) !! is obtained using ftdpi() so gtdpi() must be already called. !! See documentation for ftdpixg() for details. !>\param[in] pv real, vapor pressure in Pascals -!>\param[out] ftdpix real, dewpoint temperature in Kelvin +!\param[out] ftdpix real, dewpoint temperature in Kelvin elemental function ftdpix(pv) !$$$ Subprogram Documentation Block ! @@ -1481,7 +1481,7 @@ elemental function ftdpix(pv) !! This function can be expanded inline in the calling routine. !>\param[in] tg real, guess dewpoint temperature in Kelvin !>\param[in] pv real, vapor pressure in Pascals -!>\param[out] ftdpixg real, dewpoint temperature in Kelvin +!\param[out] ftdpixg real, dewpoint temperature in Kelvin elemental function ftdpixg(tg,pv) !$$$ Subprogram Documentation Block ! @@ -1604,7 +1604,7 @@ subroutine gtdp !! computed in gtdp(). See documentation for ftdpxg() for details. !! Input values outside table range are reset to table extrema. !>\param[in] pv real, vapor pressure in Pascals -!>\param[out] ftdp real, dewpoint temperature in Kelvin +!\param[out] ftdp real, dewpoint temperature in Kelvin elemental function ftdp(pv) !$$$ Subprogram Documentation Block ! @@ -1656,7 +1656,7 @@ elemental function ftdp(pv) !! computed in gtdp(). See documentation for ftdpxg() for details. !! Input values outside table range are reset to table extrema. !>\param[in] pv real, vapor pressure in Pascals -!>\param[out] ftdpq real, dewpoint temperature in Kelvin +!\param[out] ftdpq real, dewpoint temperature in Kelvin elemental function ftdpq(pv) !$$$ Subprogram Documentation Block ! @@ -1712,7 +1712,7 @@ elemental function ftdpq(pv) !! is obtained using ftdp() so gtdp() must be already called. !! See documentation for ftdpxg() for details. !>\param[in] pv real, vapor pressure in Pascals -!>\param[out] ftdpx real, dewpoint temperature in Kelvin +!\param[out] ftdpx real, dewpoint temperature in Kelvin elemental function ftdpx(pv) !$$$ Subprogram Documentation Block ! @@ -1776,7 +1776,7 @@ elemental function ftdpx(pv) !! This function can be expanded inline in the calling routine. !>\param[in] tg real, guess dewpoint temperature in Kelvin !>\param[in] pv real, vapor pressure in Pascals -!>\param[out] ftdpxg real, dewpoint temperature in Kelvin +!\param[out] ftdpxg real, dewpoint temperature in Kelvin elemental function ftdpxg(tg,pv) !$$$ Subprogram Documentation Block ! @@ -1937,7 +1937,7 @@ subroutine gthe !! except zero is returned for too cold or high LCLs. !>\param[in] t real, LCL temperature in Kelvin !>\param[in] pk real, LCL pressure over 1e5 Pa to the kappa power -!>\param[out] fthe real, equivalent potential temperature in Kelvin +!\param[out] fthe real, equivalent potential temperature in Kelvin elemental function fthe(t,pk) !$$$ Subprogram Documentation Block ! @@ -2000,7 +2000,7 @@ elemental function fthe(t,pk) !! except zero is returned for too cold or high LCLs. !>\param[in] t real, LCL temperature in Kelvin !>\param[in] pk real, LCL pressure over 1e5 Pa to the kappa power -!>\param[out] ftheq real, equivalent potential temperature in Kelvin +!\param[out] ftheq real, equivalent potential temperature in Kelvin elemental function ftheq(t,pk) !$$$ Subprogram Documentation Block ! @@ -2085,7 +2085,7 @@ elemental function ftheq(t,pk) !! This function should be expanded inline in the calling routine. !>\param[in] t real, LCL temperature in Kelvin !>\param[in] pk real, LCL pressure over 1e5 Pa to the kappa power -!>\param[out] fthex real, equivalent potential temperature in Kelvin +!\param[out] fthex real, equivalent potential temperature in Kelvin function fthex(t,pk) !$$$ Subprogram Documentation Block ! @@ -2283,7 +2283,7 @@ elemental subroutine stma(the,pk,tma,qma) !! Input values outside table range are reset to table extrema. !>\param[in] the real, equivalent potential temperature in Kelvin !>\param[in] pk real, pressure over 1e5 Pa to the kappa power -!>\param[out] tmaq real, parcel temperature in Kelvin +!>\param[out] tma real, parcel temperature in Kelvin !>\param[out] qma real, parcel specific humidity in kg/kg elemental subroutine stmaq(the,pk,tma,qma) !$$$ Subprogram Documentation Block @@ -2569,7 +2569,7 @@ subroutine gpkap !! computed in gpkap(). See documentation for fpkapx() for details. !! Input values outside table range are reset to table extrema. !>\param[in] p real, pressure in Pascals -!>\param[out] fpkap real, p over 1e5 Pa to the kappa power +!\param[out] fpkap real, p over 1e5 Pa to the kappa power elemental function fpkap(p) !$$$ Subprogram Documentation Block ! @@ -2621,7 +2621,7 @@ elemental function fpkap(p) !! computed in gpkap(). see documentation for fpkapx() for details. !! Input values outside table range are reset to table extrema. !>\param[in] p real, pressure in Pascals -!>\param[out] fpkapq real, p over 1e5 Pa to the kappa power +!\param[out] fpkapq real, p over 1e5 Pa to the kappa power elemental function fpkapq(p) !$$$ Subprogram Documentation Block ! @@ -2678,7 +2678,7 @@ elemental function fpkapq(p) !! The pressure range is 40000-110000 Pa and kappa is defined in fpkapx(). !>\param[in] p real, surface pressure in Pascals p should be in the !! range 40000 to 110000 -!>\param[out] fpkapo real, p over 1e5 Pa to the kappa power +!\param[out] fpkapo real, p over 1e5 Pa to the kappa power function fpkapo(p) !$$$ Subprogram documentation block ! @@ -2739,7 +2739,7 @@ function fpkapo(p) !> This function raises pressure over 1e5 Pa to the kappa power. !! Kappa is equal to rd/cp where rd and cp are physical constants. !>\param[in] p real, pressure in Pascals -!>\param[out] fpkapx real, p over 1e5 Pa to the kappa power +!\param[out] fpkapx real, p over 1e5 Pa to the kappa power elemental function fpkapx(p) !$$$ Subprogram documentation block ! @@ -2827,7 +2827,7 @@ subroutine grkap !! computed in grkap(). See documentation for frkapx() for details. !! Input values outside table range are reset to table extrema. !>\param[in] pkap real, p over 1e5 Pa to the kappa power -!>\param[out] frkap real, pressure in Pascals +!\param[out] frkap real, pressure in Pascals elemental function frkap(pkap) !$$$ Subprogram Documentation Block ! @@ -2878,7 +2878,7 @@ elemental function frkap(pkap) !! computed in grkap(). see documentation for frkapx() for details. !! Input values outside table range are reset to table extrema. !>\param[in] pkap real, p over 1e5 Pa to the kappa power -!>\param[out] frkapq real, pressure in Pascals +!\param[out] frkapq real, pressure in Pascals elemental function frkapq(pkap) !$$$ Subprogram Documentation Block ! @@ -2931,7 +2931,7 @@ elemental function frkapq(pkap) !> This function raise pressure over 1e5 Pa to the 1/kappa power. !! Kappa is equal to rd/cp where rd and cp are physical constants. !>\param[in] pkap real, p over 1e5 Pa to the kappa power -!>\param[out] frkapx real, pressure in Pascals +!\param[out] frkapx real, pressure in Pascals elemental function frkapx(pkap) !$$$ Subprogram documentation block ! @@ -3032,7 +3032,7 @@ subroutine gtlcl !! Input values outside table range are reset to table extrema. !>\param[in] t real, LCL temperature in Kelvin !>\param[in] tdpd real, dewpoint depression in Kelvin -!>\param[out] ftlcl real, temperature at the LCL in Kelvin +!\param[out] ftlcl real, temperature at the LCL in Kelvin elemental function ftlcl(t,tdpd) !$$$ Subprogram Documentation Block ! @@ -3087,7 +3087,7 @@ elemental function ftlcl(t,tdpd) !! Input values outside table range are reset to table extrema. !>\param[in] t real, LCL temperature in Kelvin !>\param[in] tdpd real, dowpoint depression in Kelvin -!>\param[out] ftlcl real, temperature at the LCL in Kelvin +!\param[out] ftlcl real, temperature at the LCL in Kelvin elemental function ftlclq(t,tdpd) !$$$ Subprogram Documentation Block ! @@ -3155,7 +3155,7 @@ elemental function ftlclq(t,tdpd) !! approximates the original exact implicit relationship. !>\param[in] t real, temperature in Kelvin !>\param[in] tdpd real, dewpoint depression in Kelvin -!>\param[out] ftlclo real, temperature at the LCL in Kelvin +!\param[out] ftlclo real, temperature at the LCL in Kelvin function ftlclo(t,tdpd) !$$$ Subprogram documentation block ! @@ -3219,7 +3219,7 @@ function ftlclo(t,tdpd) !! returned temperature is 180 Kelvin. !>\param[in] t real, temperature in Kelvin !>\param[in] tdpd real, dewpoint depression in Kelvin -!>\param[out] ftlclx real, temperature at the LCL in Kelvin +!\param[out] ftlclx real, temperature at the LCL in Kelvin elemental function ftlclx(t,tdpd) !$$$ Subprogram documentation block ! diff --git a/physics/micro_mg3_0.F90 b/physics/micro_mg3_0.F90 index 671290749..d9d47a347 100644 --- a/physics/micro_mg3_0.F90 +++ b/physics/micro_mg3_0.F90 @@ -582,7 +582,9 @@ subroutine micro_mg_tend ( & real(r8), intent(in) :: liqcldf(mgncol,nlev) !< liquid cloud fraction (no units) real(r8), intent(in) :: icecldf(mgncol,nlev) !< ice cloud fraction (no units) real(r8), intent(in) :: qsatfac(mgncol,nlev) !< subgrid cloud water saturation scaling factor (no units) - logical, intent(in) :: lprnt, iccn, aero_in + logical, intent(in) :: lprnt !< control flag for diagnostic print out + logical, intent(in) :: iccn !< flag for IN and CCN forcing for Morrison-Gettelman microphysics + logical, intent(in) :: aero_in !< flag for using aerosols in Morrison-Gettelman microphysics ! used for scavenging diff --git a/physics/module_bl_mynn.F90 b/physics/module_bl_mynn.F90 index 44a5156c1..183d4bb5a 100644 --- a/physics/module_bl_mynn.F90 +++ b/physics/module_bl_mynn.F90 @@ -1134,12 +1134,12 @@ END SUBROUTINE mym_length !! computational expense. This subroutine computes the length scales up and down !! and then computes the min, average of the up/down length scales, and also !! considers the distance to the surface. -!!\param dlu the distance a parcel can be lifted upwards give a finite -!! amount of TKE. +!\param dlu the distance a parcel can be lifted upwards give a finite +! amount of TKE. !\param dld the distance a parcel can be displaced downwards given a -!! finite amount of TKE. -!!\param lb1 the minimum of the length up and length down -!!\param lb2 the average of the length up and length down +! finite amount of TKE. +!\param lb1 the minimum of the length up and length down +!\param lb2 the average of the length up and length down SUBROUTINE boulac_length0(k,kts,kte,zw,dz,qtke,theta,lb1,lb2) INTEGER, INTENT(IN) :: k,kts,kte From 611930c00bd87a687e4611a28d55451752378ffb Mon Sep 17 00:00:00 2001 From: Man Zhang Date: Fri, 14 Jun 2019 09:44:58 -0600 Subject: [PATCH 10/89] scidoc update --- physics/docs/pdftxt/suite_input.nml.txt | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/physics/docs/pdftxt/suite_input.nml.txt b/physics/docs/pdftxt/suite_input.nml.txt index 8817d5590..bc904bfac 100644 --- a/physics/docs/pdftxt/suite_input.nml.txt +++ b/physics/docs/pdftxt/suite_input.nml.txt @@ -181,7 +181,7 @@ and how stochastic perturbations are used in the Noah Land Surface Model.
  • 1:July 2010 version of mass-flux shallow convective scheme (operational as of 2016)
  • 2: scale- & aerosol-aware mass-flux shallow convective scheme (2017)
  • 3: scale- & aerosol-aware Grell-Freitas scheme (GSD) -
  • 4: New Tiedtke scheme (CAPS) +
  • 4: new Tiedtke scheme (CAPS)
  • 0: modified Tiedtke's eddy-diffusion shallow convective scheme
  • -1: no shallow convection used @@ -191,7 +191,7 @@ and how stochastic perturbations are used in the Noah Land Surface Model.
  • 1: July 2010 version of SAS convective scheme (operational version as of 2016)
  • 2: scale- & aerosol-aware mass-flux deep convective scheme (2017)
  • 3: scale- & aerosol-aware Grell-Freitas scheme (GSD) -
  • 4: New Tiedtke scheme (CAPS) +
  • 4: new Tiedtke scheme (CAPS)
  • !
    1
    lgfdlmprad gfs_control_type flag for GFDL mp scheme and radiation consistency .false. @@ -294,27 +294,27 @@ and how stochastic perturbations are used in the Noah Land Surface Model. 2
    bl_mynn_edmf gfs_control_type flag to activate the mass-flux scheme \n
      -
    • 0: Deactivate mass-flux scheme -
    • 1: Activate dynamic multiplume mass-flux scheme +
    • 0: deactivate mass-flux scheme +
    • 1: activate dynamic multiplume mass-flux scheme
    0
    bl_mynn_edmf_mom gfs_control_type flag to activate the transport of momentum \n
      -
    • 0: Deactivate momentum transport in mass-flux scheme -
    • 1: Activate momentum transport in dynamic multiplume mass-flux scheme. \p bl_mynn_edmf must be set to 1 +
    • 0: deactivate momentum transport in mass-flux scheme +
    • 1: activate momentum transport in dynamic multiplume mass-flux scheme. \p bl_mynn_edmf must be set to 1
    1
    bl_mynn_edmf_tke gfs_control_type flag to activate the transport of TKE \n
      -
    • 0: Deactivate TKE transport in mass-flux scheme -
    • 1: Activate TKE transport in dynamic multiplume mass-flux scheme. \p bl_mynn_edmf must be set to 1 +
    • 0: deactivate TKE transport in mass-flux scheme +
    • 1: activate TKE transport in dynamic multiplume mass-flux scheme. \p bl_mynn_edmf must be set to 1
    0
    bl_mynn_edmf_part gfs_control_type flag to partitioning the MF and ED areas 0
    bl_mynn_edmf_tkeadvect gfs_control_type activate computation of TKE advection (not yet in use for FV3) \n
      -
    • False: Deactivate TKE advection -
    • True: Activate TKE advection +
    • false: deactivate TKE advection +
    • true: activate TKE advection
    .false.
    bl_mynn_edmf_tkebudget gfs_control_type flag to activate TKE budget 0 @@ -327,20 +327,20 @@ and how stochastic perturbations are used in the Noah Land Surface Model. 2
    bl_mynn_edmf_cloudmix gfs_control_type flag to activate mixing of cloud species \n
      -
    • 0: Deactivate the mixing of any water species mixing ratios +
    • 0: deactivate the mixing of any water species mixing ratios
    • 1: activate the mixing of all water species mixing ratios
    1
    bl_mynn_mixqt gfs_control_type flag to mix total water or individual species \n
      -
    • 0: Mix individual water species separately +
    • 0: mix individual water species separately
    • 1: DO NOT USE
    0
    icloud_bl gfs_control_type flag to coupling SGS clouds to radiation \n
      -
    • 0: Deactivate coupling subgrid clouds to radiation -
    • 1: Activate subgrid cloud coupling to radiation (highly suggested) +
    • 0: deactivate coupling subgrid clouds to radiation +
    • 1: activate subgrid cloud coupling to radiation (highly suggested)
    1
    lsoil_lsm gfs_control_type number of soil layers internal to land surface model -1 From 170a31569f6d8965f6a5917666188dad33d0581d Mon Sep 17 00:00:00 2001 From: Man Zhang Date: Tue, 18 Jun 2019 10:41:49 -0600 Subject: [PATCH 11/89] doc update --- physics/docs/pdftxt/GFS_SATMEDMF.txt | 2 +- physics/satmedmfvdif.F | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/physics/docs/pdftxt/GFS_SATMEDMF.txt b/physics/docs/pdftxt/GFS_SATMEDMF.txt index 3dd9eb17e..22e73a458 100644 --- a/physics/docs/pdftxt/GFS_SATMEDMF.txt +++ b/physics/docs/pdftxt/GFS_SATMEDMF.txt @@ -8,7 +8,7 @@ counter-gradient(EDCG) scheme is used for the weakly unstable PBL. The new TKE-E -# Eddy diffusivity (K) is now a function of TKE which is prognostically predicted --# EDMF approach is appled for all the unstable PBL +-# EDMF approach is applied for all the unstable PBL -# EDMF approach is also applied to the stratocumulus-top-driven turbulence mixing diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F index 9c0e9d915..fc3cc9d98 100644 --- a/physics/satmedmfvdif.F +++ b/physics/satmedmfvdif.F @@ -286,7 +286,7 @@ subroutine satmedmfvdif_run(ix,im,km,ntrac,ntcw,ntiw,ntke, & kmpbl = km / 2 kmscu = km / 2 !> - Compute physical height of the layer centers and interfaces from -!! the geopotential height (zi and zl) +!! the geopotential height (\p zi and \p zl) do k=1,km do i=1,im zi(i,k) = phii(i,k) * gravi @@ -307,12 +307,12 @@ subroutine satmedmfvdif_run(ix,im,km,ntrac,ntcw,ntiw,ntke, & zm(i,k) = zi(i,k+1) enddo enddo -!> - Compute horizontal grid size (gdx) +!> - Compute horizontal grid size (\p gdx) do i=1,im gdx(i) = sqrt(garea(i)) enddo !> - Initialize tke value at vertical layer centers and interfaces -!! from tracer (tke and tkeh) +!! from tracer (\p tke and \p tkeh) do k=1,km do i=1,im tke(i,k) = max(q1(i,k,ntke), tkmin) From db455de9cd0a061050c640e52bb274751b00fbfe Mon Sep 17 00:00:00 2001 From: climbfuji Date: Sat, 15 Jun 2019 19:26:22 -0600 Subject: [PATCH 12/89] This commit updates CCPP physics to reflect changes in three commits to Vlab master: commit ee9977192f6782df21d2af23979ec67683ac020e Author: Dusan Jovic Date: Mon Jun 10 14:20:34 2019 +0000 NEMSfv3gfs: this commits #refs 56264: support fractional landmask on FV3 grid, and #refs 64400: bug fix for UGW and in CSAW Change-Id: Id42e31a8b32ba52dd810e98dff059b14135884ec commit a0fca321ffd9fff1e929c00f3e6d467154610065 Author: Dusan Jovic Date: Thu Jun 6 13:54:04 2019 +0000 NEMSfv3gfs: this commits #refs 64015 Add updated scale-aware TKE-based moist EDMF scheme. Updated fv3_cap #refs 62862 Change-Id: Ic6a04044bd2826a3a4be700e77067ff435fadc56 commit a2c9fdabf3aa1e99ab8037c319820c9e440fb894 Author: Jun Wang Date: Tue Jun 4 01:26:37 2019 +0000 NEMSfv3gfs: this commits #refs 61507, coupling Noah MP to fv3gfs Change-Id: Ia3b86d247d98ee143e47b5e41fce3ae92dde0564 --- physics/GFS_DCNV_generic.F90 | 8 +- physics/GFS_MP_generic.F90 | 87 ++- physics/GFS_PBL_generic.F90 | 189 ++++-- physics/GFS_phys_time_vary.fv3.F90 | 30 +- physics/GFS_phys_time_vary.scm.F90 | 29 +- physics/GFS_rrtmg_pre.F90 | 11 +- physics/GFS_suite_interstitial.F90 | 73 +- physics/GFS_surface_composites.F90 | 675 ++++++++++--------- physics/GFS_surface_generic.F90 | 18 +- physics/cldmacro.F | 8 +- physics/cs_conv.F90 | 20 +- physics/cs_conv_aw_adj.F90 | 13 +- physics/dcyc2.f | 67 +- physics/docs/pdftxt/CPT_adv_suite.txt | 1 - physics/docs/pdftxt/GFSv14_suite.txt | 1 - physics/docs/pdftxt/GFSv15_suite.txt | 1 - physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt | 1 - physics/gcm_shoc.F90 | 32 +- physics/gfdl_cloud_microphys.F90 | 15 +- physics/m_micro.F90 | 105 ++- physics/m_micro_interstitial.F90 | 60 +- physics/maximum_hourly_diagnostics.F90 | 49 +- physics/micro_mg_utils.F90 | 21 +- physics/module_gfdl_cloud_microphys.F90 | 6 +- physics/module_nst_water_prop.f90 | 2 +- physics/moninshoc.f | 33 +- physics/physcons.F90 | 117 ++-- physics/radiation_astronomy.f | 13 +- physics/radiation_clouds.f | 214 +++--- physics/samfdeepcnv.f | 2 +- physics/samfshalcnv.f | 10 +- physics/sfc_diag.f | 20 +- physics/sfc_diff.f | 26 +- physics/sfc_drv.f | 5 +- physics/sfc_drv_ruc.F90 | 8 +- physics/sfc_nst.f | 33 +- physics/sfc_ocean.F | 10 +- physics/sfc_sice.f | 271 +++----- physics/sflx.f | 34 +- 39 files changed, 1251 insertions(+), 1067 deletions(-) diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 index 8f52fb550..0784e921f 100644 --- a/physics/GFS_DCNV_generic.F90 +++ b/physics/GFS_DCNV_generic.F90 @@ -139,8 +139,6 @@ end subroutine GFS_DCNV_generic_post_finalize !! | ncnvcld3d | number_of_convective_3d_cloud_fields | number of convective 3d clouds fields | count | 0 | integer | | in | F | !! | rainc | lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep | convective rain at this time step | m | 1 | real | kind_phys | inout | F | !! | cldwrk | cumulative_cloud_work_function | cumulative cloud work function (valid only with sas) | m2 s-1 | 1 | real | kind_phys | inout | F | -!! | cnvprcp | cumulative_lwe_thickness_of_convective_precipitation_amount | cumulative convective precipitation | m | 1 | real | kind_phys | inout | F | -!! | cnvprcpb | cumulative_lwe_thickness_of_convective_precipitation_amount_in_bucket | cumulative convective precipitation in bucket | m | 1 | real | kind_phys | inout | F | !! | dt3dt | cumulative_change_in_temperature_due_to_deep_convection | cumulative change in temperature due to deep conv. | K | 2 | real | kind_phys | inout | F | !! | dq3dt | cumulative_change_in_water_vapor_specific_humidity_due_to_deep_convection | cumulative change in water vapor specific humidity due to deep conv. | kg kg-1 | 2 | real | kind_phys | inout | F | !! | du3dt | cumulative_change_in_x_wind_due_to_deep_convection | cumulative change in x wind due to deep convection | m s-1 | 2 | real | kind_phys | inout | F | @@ -169,7 +167,7 @@ end subroutine GFS_DCNV_generic_post_finalize subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, lgocart, ras, cscnv, do_ca, & isppt_deep, frain, rain1, dtf, cld1d, save_u, save_v, save_t, save_qv, gu0, gv0, gt0, & gq0_water_vapor, ud_mf, dd_mf, dt_mf, con_g, clw_ice, clw_liquid, npdf3d, num_p3d, ncnvcld3d, & - rainc, cldwrk, cnvprcp, cnvprcpb, dt3dt, dq3dt, du3dt, dv3dt, upd_mf, dwn_mf, det_mf, dqdti, & + rainc, cldwrk, dt3dt, dq3dt, du3dt, dv3dt, upd_mf, dwn_mf, det_mf, dqdti, & cnvqci, upd_mfi, dwn_mfi, det_mfi, cnvw, cnvc, cnvw_phy_f3d, cnvc_phy_f3d, & cape, tconvtend, qconvtend, uconvtend, vconvtend, errmsg, errflg) @@ -189,7 +187,7 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, lgocart, ras, cs real(kind=kind_phys), dimension(im,levs), intent(in) :: clw_ice, clw_liquid integer, intent(in) :: npdf3d, num_p3d, ncnvcld3d - real(kind=kind_phys), dimension(im), intent(inout) :: rainc, cldwrk, cnvprcp, cnvprcpb + real(kind=kind_phys), dimension(im), intent(inout) :: rainc, cldwrk ! dt3dt, dq3dt, du3dt, dv3dt upd_mf, dwn_mf, det_mf only allocated if ldiag3d == .true. real(kind=kind_phys), dimension(:,:), intent(inout) :: dt3dt, dq3dt, du3dt, dv3dt real(kind=kind_phys), dimension(:,:), intent(inout) :: upd_mf, dwn_mf, det_mf @@ -246,8 +244,6 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, lgocart, ras, cs if (lssav) then do i=1,im cldwrk (i) = cldwrk (i) + cld1d(i) * dtf - cnvprcp(i) = cnvprcp(i) + rainc(i) - cnvprcpb(i) = cnvprcpb(i) + rainc(i) enddo if (ldiag3d) then diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 0aeada850..8021f0801 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -104,6 +104,7 @@ end subroutine GFS_MP_generic_post_init !! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | !! | cal_pre | flag_for_precipitation_type_algorithm | flag controls precip type algorithm | flag | 0 | logical | | in | F | !! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | !! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | @@ -140,10 +141,13 @@ end subroutine GFS_MP_generic_post_init !! | doms_diag | dominant_snow_type | dominant snow type | none | 1 | real | kind_phys | inout | F | !! | tprcp | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total precipitation amount in each time step | m | 1 | real | kind_phys | inout | F | !! | srflag | flag_for_precipitation_type | snow/rain flag for precipitation | flag | 1 | real | kind_phys | inout | F | +!! | sr | ratio_of_snowfall_to_rainfall | snow ratio: ratio of snow to total precipitation | frac | 1 | real | kind_phys | in | F | +!! | cnvprcp | cumulative_lwe_thickness_of_convective_precipitation_amount | cumulative convective precipitation | m | 1 | real | kind_phys | inout | F | !! | totprcp | accumulated_lwe_thickness_of_precipitation_amount | accumulated total precipitation | m | 1 | real | kind_phys | inout | F | !! | totice | accumulated_lwe_thickness_of_ice_amount | accumulated ice precipitation | kg m-2 | 1 | real | kind_phys | inout | F | !! | totsnw | accumulated_lwe_thickness_of_snow_amount | accumulated snow precipitation | kg m-2 | 1 | real | kind_phys | inout | F | !! | totgrp | accumulated_lwe_thickness_of_graupel_amount | accumulated graupel precipitation | kg m-2 | 1 | real | kind_phys | inout | F | +!! | cnvprcpb | cumulative_lwe_thickness_of_convective_precipitation_amount_in_bucket | cumulative convective precipitation in bucket | m | 1 | real | kind_phys | inout | F | !! | totprcpb | accumulated_lwe_thickness_of_precipitation_amount_in_bucket | accumulated total precipitation in bucket | m | 1 | real | kind_phys | inout | F | !! | toticeb | accumulated_lwe_thickness_of_ice_amount_in_bucket | accumulated ice precipitation in bucket | kg m-2 | 1 | real | kind_phys | inout | F | !! | totsnwb | accumulated_lwe_thickness_of_snow_amount_in_bucket | accumulated snow precipitation in bucket | kg m-2 | 1 | real | kind_phys | inout | F | @@ -173,10 +177,10 @@ end subroutine GFS_MP_generic_post_init !> \section gfs_mp_gen GFS MP Generic Post General Algorithm !> @{ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, & - imp_physics_thompson, cal_pre, lssav, ldiag3d, cplflx, cplchm, con_g, dtf, frain, rainc, rain1, rann, xlat, xlon, & - gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_qv, rain0, ice0, snow0, graupel0, del, & - rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, totprcp, totice, totsnw, & - totgrp, totprcpb, toticeb, totsnwb, totgrpb, dt3dt, dq3dt, rain_cpl, rainc_cpl, snow_cpl, pwat, & + imp_physics_thompson, imp_physics_mg, cal_pre, lssav, ldiag3d, cplflx, cplchm, con_g, dtf, frain, rainc, rain1, & + rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_qv, rain0, ice0, snow0, & + graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp, totprcp, totice, & + totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, dt3dt, dq3dt, rain_cpl, rainc_cpl, snow_cpl, pwat, & do_sppt, dtdtr, dtdtc, drain_cpl, dsnow_cpl, lsm, lsm_ruc, raincprv, rainncprv, iceprv, snowprv, graupelprv, & dtp, errmsg, errflg) ! @@ -184,7 +188,8 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt implicit none - integer, intent(in) :: im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, imp_physics_thompson + integer, intent(in) :: im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac + integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg logical, intent(in) :: cal_pre, lssav, ldiag3d, cplflx, cplchm real(kind=kind_phys), intent(in) :: dtf, frain, con_g @@ -196,8 +201,11 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt real(kind=kind_phys), dimension(im,levs+1), intent(in) :: prsi, phii real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: gq0 - real(kind=kind_phys), dimension(im), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, & - srflag, totprcp, totice, totsnw, totgrp, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, pwat + real(kind=kind_phys), dimension(im), intent(in ) :: sr + real(kind=kind_phys), dimension(im), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, & + srflag, cnvprcp, totprcp, totice, totsnw, totgrp, cnvprcpb, & + totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, & + snow_cpl, pwat real(kind=kind_phys), dimension(im,levs), intent(inout) :: dt3dt, dq3dt ! Stochastic physics / surface perturbations @@ -223,16 +231,14 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt ! DH* TODO: CLEANUP, all of these should be coming in through the argument list real(kind=kind_phys), parameter :: con_p001= 0.001d0 - real(kind=kind_phys), parameter :: con_day = 86400.d0 -#ifdef TRANSITION + real(kind=kind_phys), parameter :: con_day = 86400.0d0 real(kind=kind_phys), parameter :: rainmin = 1.0d-13 -#else - real(kind=kind_phys), parameter :: rainmin = 1.0e-13 -#endif - real(kind=kind_phys), parameter :: p850 = 85000.0 + real(kind=kind_phys), parameter :: p850 = 85000.0d0 ! *DH integer :: i, k, ic + + real(kind=kind_phys), parameter :: zero = 0.0d0, one = 1.0d0 real(kind=kind_phys) :: crain, csnow, onebg, tem, total_precip real(kind=kind_phys), dimension(im) :: domr, domzr, domip, doms, t850, work1 @@ -240,7 +246,7 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt errmsg = '' errflg = 0 - onebg = 1.0d0/con_g + onebg = one/con_g do i = 1, im rain(i) = rainc(i) + frain * rain1(i) ! time-step convective plus explicit @@ -308,6 +314,14 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt end if enddo endif + if (lssav) then + do i=1,im + domr_diag(i) = domr_diag(i) + domr(i) * dtf + domzr_diag(i) = domzr_diag(i) + domzr(i) * dtf + domip_diag(i) = domip_diag(i) + domip(i) * dtf + doms_diag(i) = doms_diag(i) + doms(i) * dtf + enddo + endif endif @@ -316,21 +330,17 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt ! 'totprcpb=', Diag%totprcpb(1),'totprcp=',Diag%totprcp(1), & ! 'rain=',Diag%rain(1) do i=1,im + cnvprcp (i) = cnvprcp (i) + rainc(i) totprcp (i) = totprcp (i) + rain(i) totice (i) = totice (i) + ice(i) totsnw (i) = totsnw (i) + snow(i) totgrp (i) = totgrp (i) + graupel(i) + + cnvprcpb(i) = cnvprcpb(i) + rainc(i) totprcpb(i) = totprcpb(i) + rain(i) toticeb (i) = toticeb (i) + ice(i) totsnwb (i) = totsnwb (i) + snow(i) totgrpb (i) = totgrpb (i) + graupel(i) -! - if (cal_pre) then - domr_diag(i) = domr_diag(i) + domr(i) * dtf - domzr_diag(i) = domzr_diag(i) + domzr(i) * dtf - domip_diag(i) = domip_diag(i) + domip(i) * dtf - doms_diag(i) = doms_diag(i) + doms(i) * dtf - endif enddo if (ldiag3d) then @@ -355,6 +365,9 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt enddo enddo + ! Conversion factor mm per physics timestep to m per day + tem = dtp * con_p001 / con_day + !> - For GFDL and Thompson MP scheme, determine convective snow by surface temperature; !! and determine explicit rain/snow by snow/ice/graupel coming out directly from MP !! and convective rainfall from the cumulus scheme if the surface temperature is below @@ -362,7 +375,6 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt if (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson) then ! determine convective rain/snow by surface temperature ! determine large-scale rain/snow by rain/snow coming out directly from MP - tem = dtp * con_p001 / con_day do i = 1, im !tprcp(i) = max(0.0, rain(i) )! clu: rain -> tprcp ! DH now lines 245-250 srflag(i) = 0. ! clu: default srflag as 'rain' (i.e. 0) @@ -384,22 +396,29 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt endif enddo elseif( .not. cal_pre) then - do i = 1, im - tprcp(i) = max(0.0, rain(i) )! clu: rain -> tprcp - srflag(i) = 0. ! clu: default srflag as 'rain' (i.e. 0) - if (t850(i) <= 273.16) then - srflag(i) = 1. ! clu: set srflag to 'snow' (i.e. 1) - endif - enddo + if (imp_physics == imp_physics_mg) then ! MG microphysics + do i=1,im + if (rain(i)*tem > rainmin) then + srflag(i) = max(zero, min(one, (rain(i)-rainc(i))*sr(i)/rain(i))) + else + srflag(i) = 0.0 + endif + enddo + else + do i = 1, im + tprcp(i) = max(0.0, rain(i) )! clu: rain -> tprcp + srflag(i) = 0.0 ! clu: default srflag as 'rain' (i.e. 0) + if (t850(i) <= 273.16) then + srflag(i) = 1.0 ! clu: set srflag to 'snow' (i.e. 1) + endif + enddo + endif endif if (cplflx .or. cplchm) then do i = 1, im - if (t850(i) > 273.16) then - rain_cpl(i) = rain_cpl(i) + rain(i) - else - snow_cpl(i) = snow_cpl(i) + rain(i) - endif + rain_cpl(i) = rain_cpl(i) + rain(i) * (one-srflag(i)) + snow_cpl(i) = snow_cpl(i) + rain(i) * srflag(i) enddo endif diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index 9731a6309..127de28e4 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -27,6 +27,9 @@ end subroutine GFS_PBL_generic_pre_finalize !! | ntsw | index_for_snow_water | tracer index for snow water | index | 0 | integer | | in | F | !! | ntlnc | index_for_liquid_cloud_number_concentration | tracer index for liquid number concentration | index | 0 | integer | | in | F | !! | ntinc | index_for_ice_cloud_number_concentration | tracer index for ice number concentration | index | 0 | integer | | in | F | +!! | ntrnc | index_for_rain_number_concentration | tracer index for rain number concentration | index | 0 | integer | | in | F | +!! | ntsnc | index_for_snow_number_concentration | tracer index for snow number concentration | index | 0 | integer | | in | F | +!! | ntgnc | index_for_graupel_number_concentration | tracer index for graupel number concentration | index | 0 | integer | | in | F | !! | ntwa | index_for_water_friendly_aerosols | tracer index for water friendly aerosol | index | 0 | integer | | in | F | !! | ntia | index_for_ice_friendly_aerosols | tracer index for ice friendly aerosol | index | 0 | integer | | in | F | !! | ntgl | index_for_graupel | tracer index for graupel | index | 0 | integer | | in | F | @@ -38,6 +41,7 @@ end subroutine GFS_PBL_generic_pre_finalize !! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_wsm6 | flag_for_wsm6_microphysics_scheme | choice of WSM6 microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_zhao_carr | flag_for_zhao_carr_microphysics_scheme | choice of Zhao-Carr microphysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | !! | cplchm | flag_for_chemistry_coupling | flag controlling cplchm collection (default off) | flag | 0 | logical | | in | F | !! | ltaerosol | flag_for_aerosol_physics | flag for aerosol physics | flag | 0 | logical | | in | F | !! | hybedmf | flag_for_hedmf | flag for hybrid edmf pbl scheme (moninedmf) | flag | 0 | logical | | in | F | @@ -50,19 +54,21 @@ end subroutine GFS_PBL_generic_pre_finalize !! #endif subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, & - ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntwa, ntia, ntgl, ntoz, ntke, ntkev, & + ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, & + ntwa, ntia, ntgl, ntoz, ntke, ntkev, & imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, & - imp_physics_zhao_carr, cplchm, ltaerosol, hybedmf, do_shoc, satmedmf, & - qgrs, vdftra, errmsg, errflg) + imp_physics_zhao_carr, imp_physics_mg, cplchm, ltaerosol, hybedmf, do_shoc, & + satmedmf, qgrs, vdftra, errmsg, errflg) use machine, only : kind_phys implicit none integer, intent(in) :: im, levs, nvdiff, ntrac - integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntwa, ntia, ntgl, ntoz, ntke, ntkev + integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc + integer, intent(in) :: ntwa, ntia, ntgl, ntoz, ntke, ntkev integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6 - integer, intent(in) :: imp_physics_zhao_carr + integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg logical, intent(in) :: cplchm, ltaerosol, hybedmf, do_shoc, satmedmf real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: qgrs @@ -119,7 +125,41 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, enddo enddo endif - ! + ! MG + elseif (imp_physics == imp_physics_mg) then ! MG3/2 + if (ntgl > 0) then ! MG3 + do k=1,levs + do i=1,im + vdftra(i,k,1) = qgrs(i,k,ntqv) + vdftra(i,k,2) = qgrs(i,k,ntcw) + vdftra(i,k,3) = qgrs(i,k,ntiw) + vdftra(i,k,4) = qgrs(i,k,ntrw) + vdftra(i,k,5) = qgrs(i,k,ntsw) + vdftra(i,k,6) = qgrs(i,k,ntgl) + vdftra(i,k,7) = qgrs(i,k,ntlnc) + vdftra(i,k,8) = qgrs(i,k,ntinc) + vdftra(i,k,9) = qgrs(i,k,ntrnc) + vdftra(i,k,10) = qgrs(i,k,ntsnc) + vdftra(i,k,11) = qgrs(i,k,ntgnc) + vdftra(i,k,12) = qgrs(i,k,ntoz) + enddo + enddo + else ! MG2 + do k=1,levs + do i=1,im + vdftra(i,k,1) = qgrs(i,k,ntqv) + vdftra(i,k,2) = qgrs(i,k,ntcw) + vdftra(i,k,3) = qgrs(i,k,ntiw) + vdftra(i,k,4) = qgrs(i,k,ntrw) + vdftra(i,k,5) = qgrs(i,k,ntsw) + vdftra(i,k,6) = qgrs(i,k,ntlnc) + vdftra(i,k,7) = qgrs(i,k,ntinc) + vdftra(i,k,8) = qgrs(i,k,ntrnc) + vdftra(i,k,9) = qgrs(i,k,ntsnc) + vdftra(i,k,10) = qgrs(i,k,ntoz) + enddo + enddo + endif elseif (imp_physics == imp_physics_gfdl) then ! GFDL MP do k=1,levs @@ -146,7 +186,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, endif endif - if (satmedmf) then + if (ntke>0) then do k=1,levs do i=1,im vdftra(i,k,ntkev) = qgrs(i,k,ntke) @@ -186,6 +226,9 @@ end subroutine GFS_PBL_generic_post_finalize !! | ntsw | index_for_snow_water | tracer index for snow water | index | 0 | integer | | in | F | !! | ntlnc | index_for_liquid_cloud_number_concentration | tracer index for liquid number concentration | index | 0 | integer | | in | F | !! | ntinc | index_for_ice_cloud_number_concentration | tracer index for ice number concentration | index | 0 | integer | | in | F | +!! | ntrnc | index_for_rain_number_concentration | tracer index for rain number concentration | index | 0 | integer | | in | F | +!! | ntsnc | index_for_snow_number_concentration | tracer index for snow number concentration | index | 0 | integer | | in | F | +!! | ntgnc | index_for_graupel_number_concentration | tracer index for graupel number concentration | index | 0 | integer | | in | F | !! | ntwa | index_for_water_friendly_aerosols | tracer index for water friendly aerosol | index | 0 | integer | | in | F | !! | ntia | index_for_ice_friendly_aerosols | tracer index for ice friendly aerosol | index | 0 | integer | | in | F | !! | ntgl | index_for_graupel | tracer index for graupel | index | 0 | integer | | in | F | @@ -197,6 +240,7 @@ end subroutine GFS_PBL_generic_post_finalize !! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_wsm6 | flag_for_wsm6_microphysics_scheme | choice of WSM6 microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_zhao_carr | flag_for_zhao_carr_microphysics_scheme | choice of Zhao-Carr microphysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | !! | ltaerosol | flag_for_aerosol_physics | flag for aerosol physics | flag | 0 | logical | | in | F | !! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | !! | cplchm | flag_for_chemistry_coupling | flag controlling cplchm collection (default off) | flag | 0 | logical | | in | F | @@ -249,8 +293,8 @@ end subroutine GFS_PBL_generic_post_finalize !! #endif subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, & - ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntwa, ntia, ntgl, ntoz, ntke, ntkev, & - imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_zhao_carr, & + ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, ntwa, ntia, ntgl, ntoz, ntke, ntkev, & + imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_zhao_carr, imp_physics_mg, & ltaerosol, cplflx, cplchm, lssav, ldiag3d, lsidea, hybedmf, do_shoc, satmedmf, shinhong, do_ysu, & dvdftra, dusfc1, dvsfc1, dtsfc1, dqsfc1, dtf, dudt, dvdt, dtdt, htrsw, htrlw, xmu, & dqdt, dusfc_cpl, dvsfc_cpl, dtsfc_cpl, & @@ -263,9 +307,9 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, implicit none integer, intent(in) :: im, levs, nvdiff, ntrac - integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntwa, ntia, ntgl, ntoz, ntke, ntkev + integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, ntwa, ntia, ntgl, ntoz, ntke, ntkev integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6 - integer, intent(in) :: imp_physics_zhao_carr + integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg logical, intent(in) :: ltaerosol, cplflx, cplchm, lssav, ldiag3d, lsidea logical, intent(in) :: hybedmf, do_shoc, satmedmf, shinhong, do_ysu @@ -298,6 +342,15 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, if (nvdiff == ntrac .and. (hybedmf .or. do_shoc .or. satmedmf)) then dqdt = dvdftra elseif (nvdiff /= ntrac .and. .not. shinhong .and. .not. do_ysu) then + + if (ntke>0) then + do k=1,levs + do i=1,im + dqdt(i,k,ntke) = dvdftra(i,k,ntkev) + enddo + enddo + endif + if (imp_physics == imp_physics_wsm6) then ! WSM6 do k=1,levs @@ -335,6 +388,40 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, enddo enddo endif + elseif (imp_physics == imp_physics_mg) then ! MG3/2 + if (ntgl > 0) then ! MG + do k=1,levs + do i=1,im + dqdt(i,k,1) = dvdftra(i,k,1) + dqdt(i,k,ntcw) = dvdftra(i,k,2) + dqdt(i,k,ntiw) = dvdftra(i,k,3) + dqdt(i,k,ntrw) = dvdftra(i,k,4) + dqdt(i,k,ntsw) = dvdftra(i,k,5) + dqdt(i,k,ntgl) = dvdftra(i,k,6) + dqdt(i,k,ntlnc) = dvdftra(i,k,7) + dqdt(i,k,ntinc) = dvdftra(i,k,8) + dqdt(i,k,ntrnc) = dvdftra(i,k,9) + dqdt(i,k,ntsnc) = dvdftra(i,k,10) + dqdt(i,k,ntgnc) = dvdftra(i,k,11) + dqdt(i,k,ntoz) = dvdftra(i,k,12) + enddo + enddo + else ! MG2 + do k=1,levs + do i=1,im + dqdt(i,k,1) = dvdftra(i,k,1) + dqdt(i,k,ntcw) = dvdftra(i,k,2) + dqdt(i,k,ntiw) = dvdftra(i,k,3) + dqdt(i,k,ntrw) = dvdftra(i,k,4) + dqdt(i,k,ntsw) = dvdftra(i,k,5) + dqdt(i,k,ntlnc) = dvdftra(i,k,6) + dqdt(i,k,ntinc) = dvdftra(i,k,7) + dqdt(i,k,ntrnc) = dvdftra(i,k,8) + dqdt(i,k,ntsnc) = dvdftra(i,k,9) + dqdt(i,k,ntoz) = dvdftra(i,k,10) + enddo + enddo + endif elseif (imp_physics == imp_physics_gfdl) then ! GFDL MP do k=1,levs @@ -360,55 +447,47 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, endif endif - if (satmedmf) then - do k=1,levs - do i=1,im - dqdt(i,k,ntke) = dvdftra(i,k,ntkev) - enddo - enddo - endif - endif ! nvdiff == ntrac ! --- ... coupling insertion ! ### GJF ### the following section needs to be made CCPP-compliant when cplflx = T -! if (cplflx) then -! do i=1,im -! if (ocean(i)) then ! Ocean only, NO LAKES -! if (flag_cice(i)) cice(i) = fice_cice(i) -! if (cice(i) == 1.) then ! use results from CICE -! Coupling%dusfci_cpl(i) = dusfc_cice(i) -! Coupling%dvsfci_cpl(i) = dvsfc_cice(i) -! Coupling%dtsfci_cpl(i) = dtsfc_cice(i) -! Coupling%dqsfci_cpl(i) = dqsfc_cice(i) -! elseif (dry(i) .or. icy(i)) then ! use stress_ocean from sfc_diff for opw component at mixed point -! tem1 = max(Diag%q1(i), 1.e-8) -! rho = Statein%prsl(i,1) / (con_rd*Diag%t1(i)*(1.0+con_fvirt*tem1)) -! if (wind(i) > 0.) then -! Coupling%dusfci_cpl(i) = -rho * stress_ocean(i) * Statein%ugrs(i,1) / wind(i) ! U-momentum flux -! Coupling%dvsfci_cpl(i) = -rho * stress_ocean(i) * Statein%vgrs(i,1) / wind(i) ! V-momentum flux -! else -! Coupling%dusfci_cpl(i) = 0. -! Coupling%dvsfci_cpl(i) = 0. -! end if -! Coupling%dtsfci_cpl(i) = con_cp * rho * hflx_ocean(i) !sensible heat flux over open ocean -! Coupling%dqsfci_cpl(i) = con_hvap * rho * evap_ocean(i) ! latent heat flux over open ocean -! else ! use results from PBL scheme for 100% open ocean -! Coupling%dusfci_cpl(i) = dusfc1(i) -! Coupling%dvsfci_cpl(i) = dvsfc1(i) -! Coupling%dtsfci_cpl(i) = dtsfc1(i) -! Coupling%dqsfci_cpl(i) = dqsfc1(i) -! endif -! -! Coupling%dusfc_cpl (i) = Coupling%dusfc_cpl(i) + Coupling%dusfci_cpl(i) * dtf -! Coupling%dvsfc_cpl (i) = Coupling%dvsfc_cpl(i) + Coupling%dvsfci_cpl(i) * dtf -! Coupling%dtsfc_cpl (i) = Coupling%dtsfc_cpl(i) + Coupling%dtsfci_cpl(i) * dtf -! Coupling%dqsfc_cpl (i) = Coupling%dqsfc_cpl(i) + Coupling%dqsfci_cpl(i) * dtf -! ! -! endif ! Ocean only, NO LAKES -! enddo -! endif +! if (Model%cplflx) then +! do i=1,im +! if (Sfcprop%oceanfrac(i) > 0.0) then ! Ocean only, NO LAKES +! if (fice(i) == 1.0) then ! use results from CICE +! Coupling%dusfci_cpl(i) = dusfc_cice(i) +! Coupling%dvsfci_cpl(i) = dvsfc_cice(i) +! Coupling%dtsfci_cpl(i) = dtsfc_cice(i) +! Coupling%dqsfci_cpl(i) = dqsfc_cice(i) +! elseif (dry(i) .or. icy(i)) then ! use stress_ocean from sfc_diff for opw component at mixed point +! tem1 = max(Diag%q1(i), 1.e-8) +! rho = Statein%prsl(i,1) / (con_rd*Diag%t1(i)*(1.0+con_fvirt*tem1)) +! if (wind(i) > 0.0) then +! tem = - rho * stress_ocn(i) / wind(i) +! Coupling%dusfci_cpl(i) = tem * Statein%ugrs(i,1) ! U-momentum flux +! Coupling%dvsfci_cpl(i) = tem * Statein%vgrs(i,1) ! V-momentum flux +! else +! Coupling%dusfci_cpl(i) = 0.0 +! Coupling%dvsfci_cpl(i) = 0.0 +! endif +! Coupling%dtsfci_cpl(i) = con_cp * rho * hflx_ocn(i) ! sensible heat flux over open ocean +! Coupling%dqsfci_cpl(i) = con_hvap * rho * evap_ocn(i) ! latent heat flux over open ocean +! else ! use results from PBL scheme for 100% open ocean +! Coupling%dusfci_cpl(i) = dusfc1(i) +! Coupling%dvsfci_cpl(i) = dvsfc1(i) +! Coupling%dtsfci_cpl(i) = dtsfc1(i) +! Coupling%dqsfci_cpl(i) = dqsfc1(i) +! endif +! +! Coupling%dusfc_cpl (i) = Coupling%dusfc_cpl(i) + Coupling%dusfci_cpl(i) * dtf +! Coupling%dvsfc_cpl (i) = Coupling%dvsfc_cpl(i) + Coupling%dvsfci_cpl(i) * dtf +! Coupling%dtsfc_cpl (i) = Coupling%dtsfc_cpl(i) + Coupling%dtsfci_cpl(i) * dtf +! Coupling%dqsfc_cpl (i) = Coupling%dqsfc_cpl(i) + Coupling%dqsfci_cpl(i) * dtf +!! +! endif ! Ocean only, NO LAKES +! enddo +! endif !-------------------------------------------------------lssav if loop ---------- if (lssav) then do i=1,im diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index b8823fac6..76b4eead2 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -344,7 +344,8 @@ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg) real(kind=kind_phys), parameter :: con_99 = 99.0_kind_phys real(kind=kind_phys), parameter :: con_100 = 100.0_kind_phys - integer :: i, j, k, iseed, iskip, ix, nb, nblks + integer :: i, j, k, iseed, iskip, ix, nb, nblks, kdt_rad + real(kind=kind_phys) :: sec_zero real(kind=kind_phys) :: wrk(1) real(kind=kind_phys) :: rannie(Model%cny) real(kind=kind_phys) :: rndval(Model%cnx*Model%cny*Model%nrcm) @@ -473,12 +474,29 @@ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg) endif !--- determine if diagnostics buckets need to be cleared - if (mod(Model%kdt,Model%nszero) == 1) then - do nb = 1,nblks - call Data(nb)%Intdiag%rad_zero (Model) - call Data(nb)%Intdiag%phys_zero (Model) + sec_zero = nint(Model%fhzero*con_hr) + if (sec_zero >= nint(max(Model%fhswr,Model%fhlwr))) then + if (mod(Model%kdt,Model%nszero) == 1) then + do nb = 1,nblks + call Data(nb)%Intdiag%rad_zero (Model) + call Data(nb)%Intdiag%phys_zero (Model) !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED - enddo + enddo + endif + else + if (mod(Model%kdt,Model%nszero) == 1) then + do nb = 1,nblks + call Data(nb)%Intdiag%phys_zero (Model) + !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED + enddo + endif + kdt_rad = nint(min(Model%fhswr,Model%fhlwr)/Model%dtp) + if (mod(Model%kdt, kdt_rad) == 1) then + do nb = 1,nblks + call Data(nb)%Intdiag%rad_zero (Model) + !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED + enddo + endif endif end subroutine GFS_phys_time_vary_run diff --git a/physics/GFS_phys_time_vary.scm.F90 b/physics/GFS_phys_time_vary.scm.F90 index 714713f78..200881d2c 100644 --- a/physics/GFS_phys_time_vary.scm.F90 +++ b/physics/GFS_phys_time_vary.scm.F90 @@ -224,6 +224,7 @@ subroutine GFS_phys_time_vary_finalize(errmsg, errflg) if (allocated(ci_pres) ) deallocate(ci_pres) is_initialized = .false. + end subroutine GFS_phys_time_vary_finalize !> \section arg_table_GFS_phys_time_vary_run Argument Table @@ -264,7 +265,8 @@ subroutine GFS_phys_time_vary_run (Grid, Statein, Model, Tbd, Sfcprop, Cldprop, real(kind=kind_phys), parameter :: con_99 = 99.0_kind_phys real(kind=kind_phys), parameter :: con_100 = 100.0_kind_phys - integer :: i, j, k, iseed, iskip, ix, nb + integer :: i, j, k, iseed, iskip, ix, nb, kdt_rad + real(kind=kind_phys) :: sec_zero real(kind=kind_phys) :: wrk(1) real(kind=kind_phys) :: rannie(Model%cny) real(kind=kind_phys) :: rndval(Model%cnx*Model%cny*Model%nrcm) @@ -362,10 +364,29 @@ subroutine GFS_phys_time_vary_run (Grid, Statein, Model, Tbd, Sfcprop, Cldprop, !endif !--- determine if diagnostics buckets need to be cleared - if (mod(Model%kdt,Model%nszero) == 1) then - call Diag%rad_zero (Model) - call Diag%phys_zero (Model) + sec_zero = nint(Model%fhzero*con_hr) + if (sec_zero >= nint(max(Model%fhswr,Model%fhlwr))) then + if (mod(Model%kdt,Model%nszero) == 1) then + do nb = 1,nblks + call Diag%rad_zero (Model) + call Diag%phys_zero (Model) + !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED + enddo + endif + else + if (mod(Model%kdt,Model%nszero) == 1) then + do nb = 1,nblks + call Diag%phys_zero (Model) + !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED + enddo + endif + kdt_rad = nint(min(Model%fhswr,Model%fhlwr)/Model%dtp) + if (mod(Model%kdt, kdt_rad) == 1) then + do nb = 1,nblks + call Diag%rad_zero (Model) !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED + enddo + endif endif end subroutine GFS_phys_time_vary_run diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index 137d14576..0c7dc14a0 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -192,7 +192,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input integer, intent(out) :: errflg ! Local variables - integer :: me, nfxr, ntrac, ntcw, ntiw, ncld, ntrw, ntsw, ntgl + integer :: me, nfxr, ntrac, ntcw, ntiw, ncld, ntrw, ntsw, ntgl, ncndl integer :: i, j, k, k1, k2, lsk, lv, n, itop, ibtc, LP1, lla, llb, lya, lyb @@ -209,7 +209,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP+1) :: tem2db ! real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP+1) :: hz - real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP,Model%ncnd) :: ccnd + real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP,min(4,Model%ncnd)) :: ccnd real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP,2:Model%ntrac) :: tracer1 real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP,NF_CLDS) :: clouds real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP,NF_VGAS) :: gasvmr @@ -234,6 +234,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input ntrw = Model%ntrw ntsw = Model%ntsw ntgl = Model%ntgl + ncndl = min(Model%ncnd,4) LP1 = LM + 1 ! num of in/out levels @@ -604,7 +605,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input enddo enddo endif - do n=1,Model%ncnd + do n=1,ncndl do k=1,LMK do i=1,IM if (ccnd(i,k,n) < epsq) ccnd(i,k,n) = 0.0 @@ -748,7 +749,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input ! or unified cloud and/or with MG microphysics if (Model%uni_cld .and. Model%ncld >= 2) then - call progclduni (plyr, plvl, tlyr, tvly, ccnd, Model%ncnd, & ! --- inputs + call progclduni (plyr, plvl, tlyr, tvly, ccnd, ncndl, & ! --- inputs Grid%xlat, Grid%xlon, Sfcprop%slmsk,dz,delp, & IM, LMK, LMP, cldcov, & effrl, effri, effrr, effrs, Model%effr_in, & @@ -782,7 +783,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input clouds, cldsa, mtopa, mbota, de_lgth) ! --- outputs else - call progclduni (plyr, plvl, tlyr, tvly, ccnd, Model%ncnd, & ! --- inputs + call progclduni (plyr, plvl, tlyr, tvly, ccnd, ncndl, & ! --- inputs Grid%xlat, Grid%xlon, Sfcprop%slmsk, dz,delp, & IM, LMK, LMP, cldcov, & effrl, effri, effrr, effrs, Model%effr_in, & diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index eb1e2e2b4..262454f15 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -95,7 +95,6 @@ end subroutine GFS_suite_interstitial_1_finalize !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | !! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | !! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | crtrh | critical_relative_humidity_at_sfc_pbltop_toa | critical relative humidity at SFC, PBL top and TOA | frac | 1 | real | kind_phys | in | F | !! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | !! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | !! | slmsk | sea_land_ice_mask_real | landmask: sea/land/ice=0/1/2 | flag | 1 | real | kind_phys | in | F | @@ -103,12 +102,8 @@ end subroutine GFS_suite_interstitial_1_finalize !! | dxmin | minimum_scaling_factor_for_critical_relative_humidity | minimum scaling factor for critical relative humidity | m2 rad-2 | 0 | real | kind_phys | in | F | !! | dxinv | inverse_scaling_factor_for_critical_relative_humidity | inverse scaling factor for critical relative humidity | rad2 m-2 | 0 | real | kind_phys | in | F | !! | pgr | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | rhbbot | critical_relative_humidity_at_surface | critical relative humidity at the surface | frac | 0 | real | kind_phys | out | F | -!! | rhpbl | critical_relative_humidity_at_PBL_top | critical relative humidity at the PBL top | frac | 0 | real | kind_phys | out | F | -!! | rhbtop | critical_relative_humidity_at_top_of_atmosphere | critical relative humidity at the top of atmosphere | frac | 0 | real | kind_phys | out | F | !! | frain | dynamics_to_physics_timestep_ratio | ratio of dynamics timestep to physics timestep | none | 0 | real | kind_phys | out | F | !! | islmsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | out | F | -!! | frland | land_area_fraction_for_microphysics | land area fraction used in microphysics schemes | frac | 1 | real | kind_phys | out | F | !! | work1 | grid_size_related_coefficient_used_in_scale-sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | out | F | !! | work2 | grid_size_related_coefficient_used_in_scale-sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | out | F | !! | psurf | surface_air_pressure_diag | surface air pressure diagnostic | Pa | 1 | real | kind_phys | out | F | @@ -117,14 +112,11 @@ end subroutine GFS_suite_interstitial_1_finalize !! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | out | F | !! | dtdtc | tendency_of_air_temperature_due_to_radiative_heating_assuming_clear_sky | clear sky radiative (shortwave + longwave) heating rate at current time | K s-1 | 2 | real | kind_phys | out | F | !! | dqdt | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers | kg kg-1 s-1 | 3 | real | kind_phys | out | F | -!! | tisfc | sea_ice_temperature | sea ice surface skin temperature | K | 1 | real | kind_phys | in | F | -!! | tice | sea_ice_temperature_interstitial | sea ice surface skin temperature use as interstitial | K | 1 | real | kind_phys | out | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! - subroutine GFS_suite_interstitial_1_run (im, levs, ntrac, crtrh, dtf, dtp, slmsk, area, dxmin, dxinv, pgr, & - rhbbot, rhpbl, rhbtop, frain, islmsk, frland, work1, work2, psurf, dudt, dvdt, dtdt, dtdtc, dqdt, & - tisfc, tice, errmsg, errflg) + subroutine GFS_suite_interstitial_1_run (im, levs, ntrac, dtf, dtp, slmsk, area, dxmin, dxinv, pgr, & + frain, islmsk, work1, work2, psurf, dudt, dvdt, dtdt, dtdtc, dqdt, errmsg, errflg) use machine, only: kind_phys @@ -133,16 +125,13 @@ subroutine GFS_suite_interstitial_1_run (im, levs, ntrac, crtrh, dtf, dtp, slmsk ! interface variables integer, intent(in) :: im, levs, ntrac real(kind=kind_phys), intent(in) :: dtf, dtp, dxmin, dxinv - real(kind=kind_phys), intent(in), dimension(3) :: crtrh real(kind=kind_phys), intent(in), dimension(im) :: slmsk, area, pgr - real(kind=kind_phys), intent(out) :: rhbbot, rhpbl, rhbtop, frain + real(kind=kind_phys), intent(out) :: frain integer, intent(out), dimension(im) :: islmsk - real(kind=kind_phys), intent(out), dimension(im) :: frland, work1, work2, psurf + real(kind=kind_phys), intent(out), dimension(im) :: work1, work2, psurf real(kind=kind_phys), intent(out), dimension(im,levs) :: dudt, dvdt, dtdt, dtdtc real(kind=kind_phys), intent(out), dimension(im,levs,ntrac) :: dqdt - real(kind=kind_phys), intent(in), dimension(im) :: tisfc - real(kind=kind_phys), intent(out), dimension(im) :: tice character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -153,26 +142,15 @@ subroutine GFS_suite_interstitial_1_run (im, levs, ntrac, crtrh, dtf, dtp, slmsk errmsg = '' errflg = 0 - rhbbot = crtrh(1) - rhpbl = crtrh(2) - rhbtop = crtrh(3) - frain = dtf / dtp do i = 1, im islmsk(i) = nint(slmsk(i)) - if (islmsk(i) == 1) then - frland(i) = 1.0 - else - frland(i) = 0.0 - endif + work1(i) = (log(area(i)) - dxmin) * dxinv work1(i) = max(0.0, min(1.0,work1(i))) work2(i) = 1.0 - work1(i) psurf(i) = pgr(i) - ! DH* 20190507 - assign sea ice temperature to interstitial variable - tice(i) = tisfc(i) - ! *DH end do do k=1,levs @@ -296,7 +274,7 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplfl logical, dimension(im) :: invrsn real(kind=kind_phys), dimension(im) :: tx1, tx2 - real(kind=kind_phys), parameter :: qmin = 1.0e-10 + real(kind=kind_phys), parameter :: qmin = 1.0d-10 ! Initialize CCPP error handling variables errmsg = '' @@ -529,6 +507,7 @@ subroutine GFS_suite_stateout_update_run (im, levs, ntrac, dtp, & errmsg = '' errflg = 0 + ! DH* add gw_dXdt terms here gt0(:,:) = tgrs(:,:) + dtdt(:,:) * dtp gu0(:,:) = ugrs(:,:) + dudt(:,:) * dtp gv0(:,:) = vgrs(:,:) + dvdt(:,:) * dtp @@ -574,7 +553,7 @@ end subroutine GFS_suite_interstitial_3_finalize !! | xlat | latitude | latitude | radians | 1 | real | kind_phys | in | F | !! | gq0 | tracer_concentration_updated_by_physics | tracer concentration updated by physics | kg kg-1 | 3 | real | kind_phys | in | F | !! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman rmicrophysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_zhao_carr | flag_for_zhao_carr_microphysics_scheme | choice of Zhao-Carr microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_zhao_carr_pdf | flag_for_zhao_carr_pdf_microphysics_scheme | choice of Zhao-Carr microphysics scheme with PDF clouds | flag | 0 | integer | | in | F | !! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | @@ -591,6 +570,7 @@ end subroutine GFS_suite_interstitial_3_finalize !! | work1 | grid_size_related_coefficient_used_in_scale-sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | !! | work2 | grid_size_related_coefficient_used_in_scale-sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | in | F | !! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | vertical index at top atmospheric boundary layer | index | 1 | integer | | in | F | +!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | in | F | !! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | inout | F | !! | rhc | critical_relative_humidity | critical relative humidity | frac | 2 | real | kind_phys | inout | F | !! | save_qc | cloud_condensed_water_mixing_ratio_save | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | inout | F | @@ -602,7 +582,7 @@ end subroutine GFS_suite_interstitial_3_finalize subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, satmedmf, trans_trac, do_shoc, ltaerosol, ntrac, ntcw, & ntiw, ntclamt, ntrw, ntsw, ntrnc, ntsnc, ntgl, ntgnc, xlat, gq0, imp_physics, imp_physics_mg, imp_physics_zhao_carr,& imp_physics_zhao_carr_pdf, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, prsi, prsl, prslk, rhcbot, & - rhcpbl, rhctop, rhcmax, islmsk, work1, work2, kpbl, & + rhcpbl, rhctop, rhcmax, islmsk, work1, work2, kpbl, kinver, & clw, rhc, save_qc, save_qi, errmsg, errflg) use machine, only: kind_phys @@ -613,7 +593,7 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, satmedmf, trans_tr integer, intent(in) :: im, levs, nn, ntrac, ntcw, ntiw, ntclamt, ntrw, & ntsw, ntrnc, ntsnc, ntgl, ntgnc, imp_physics, imp_physics_mg, imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, & imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6 - integer, dimension(im), intent(in) :: islmsk, kpbl + integer, dimension(im), intent(in) :: islmsk, kpbl, kinver logical, intent(in) :: cscnv, satmedmf, trans_trac, do_shoc, ltaerosol real(kind=kind_phys), intent(in) :: rhcbot, rhcmax, rhcpbl, rhctop @@ -634,10 +614,13 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, satmedmf, trans_tr ! local variables integer :: i,k,n,tracers,kk real(kind=kind_phys) :: tem, tem1, tem2 - real(kind=kind_phys), dimension(im) :: tx1, tx2 + real(kind=kind_phys), dimension(im) :: tx1, tx2, tx3, tx4 - real(kind=kind_phys),parameter :: slope_mg = 0.02, slope_upmg = 0.04, & - turnrhcrit = 0.900, turnrhcrit_upper = 0.150 + !real(kind=kind_phys),parameter :: slope_mg = 0.02, slope_upmg = 0.04, & + ! turnrhcrit = 0.900, turnrhcrit_upper = 0.150 + ! in the following inverse of slope_mg and slope_upmg are specified + real(kind=kind_phys),parameter :: slope_mg = 50.0_kind_phys, & + slope_upmg = 25.0_kind_phys ! Initialize CCPP error handling variables errmsg = '' @@ -687,17 +670,22 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, satmedmf, trans_tr endif ! end if_ras or cfscnv or samf if (ntcw > 0) then - if (imp_physics == imp_physics_mg) then ! compute rhc for GMAO macro physics cloud pdf + if (imp_physics == imp_physics_mg .and. rhcpbl < 0.5) then ! compute rhc for GMAO macro physics cloud pdf do i=1,im tx1(i) = 1.0 / prsi(i,1) - tx2(i) = 1.0 - rhcmax * work1(i)-rhcbot*work2(i) + tx2(i) = 1.0 - rhcmax*work1(i)-rhcbot*work2(i) + + kk = min(kinver(i), max(2,kpbl(i))) + tx3(i) = prsi(i,kk)*tx1(i) + tx4(i) = rhcpbl - rhctop*abs(cos(xlat(i))) enddo do k = 1, levs do i = 1, im - kk = max(2,kpbl(i)) tem = prsl(i,k) * tx1(i) - tem1 = min(max((tem-prsi(i,kk)*tx1(i))/slope_mg, -20.0), 20.0) - tem2 = min(max((0.3-0.2*abs(cos(xlat(i)))-tem)/slope_upmg, -20.0), 20.0) ! Anning + tem1 = min(max((tem-tx3(i))*slope_mg, -20.0), 20.0) + ! Using rhcpbl and rhctop from the namelist instead of 0.3 and 0.2 + ! and rhcbot represents pbl top critical relative humidity + tem2 = min(max((tx4(i)-tem)*slope_upmg, -20.0), 20.0) ! Anning if (islmsk(i) > 0) then tem1 = 1.0 / (1.0+exp(tem1+tem1)) else @@ -706,7 +694,6 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, satmedmf, trans_tr tem2 = 1.0 / (1.0+exp(tem2)) rhc(i,k) = min(rhcmax, max(0.7, 1.0-tx2(i)*tem1*tem2)) -! rhc(i,k) = min(rhcmax, rhcmax*work1(i) + (1.0-tx2(i)*tem1*tem2)*work2(i)) enddo enddo else @@ -714,11 +701,9 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, satmedmf, trans_tr do i=1,im kk = max(10,kpbl(i)) if (k < kk) then - tem = rhcbot - (rhcbot-rhcpbl) * (1.0-prslk(i,k)) & - / (1.0-prslk(i,kk)) + tem = rhcbot - (rhcbot-rhcpbl) * (1.0-prslk(i,k)) / (1.0-prslk(i,kk)) else - tem = rhcpbl - (rhcpbl-rhctop) * (prslk(i,kk)-prslk(i,k)) & - / prslk(i,kk) + tem = rhcpbl - (rhcpbl-rhctop) * (prslk(i,kk)-prslk(i,k)) / prslk(i,kk) endif tem = rhcmax * work1(i) + tem * work2(i) rhc(i,k) = max(0.0, min(1.0,tem)) diff --git a/physics/GFS_surface_composites.F90 b/physics/GFS_surface_composites.F90 index e5ca18683..df99b68dc 100644 --- a/physics/GFS_surface_composites.F90 +++ b/physics/GFS_surface_composites.F90 @@ -24,16 +24,19 @@ end subroutine GFS_surface_composites_pre_finalize !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |----------------|-----------------------------------------------------------------------------------|----------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | frac_grid | flag_for_fractional_grid | flag for fractional grid | flag | 0 | logical | | in | F | +!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | in | F | !! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | !! | landfrac | land_area_fraction | fraction of horizontal grid area occupied by land | frac | 1 | real | kind_phys | in | F | !! | lakefrac | lake_area_fraction | fraction of horizontal grid area occupied by lake | frac | 1 | real | kind_phys | in | F | !! | oceanfrac | sea_area_fraction | fraction of horizontal grid area occupied by ocean | frac | 1 | real | kind_phys | in | F | +!! | frland | land_area_fraction_for_microphysics | land area fraction used in microphysics schemes | frac | 1 | real | kind_phys | out | F | !! | dry | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | inout | F | !! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | inout | F | !! | lake | flag_nonzero_lake_surface_fraction | flag indicating presence of some lake surface area fraction | flag | 1 | logical | | inout | F | !! | ocean | flag_nonzero_ocean_surface_fraction | flag indicating presence of some ocean surface area fraction | flag | 1 | logical | | inout | F | !! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | inout | F | -!! | fice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | +!! | cice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | !! | cimin | minimum_sea_ice_concentration | minimum sea ice concentration | frac | 0 | real | kind_phys | in | F | !! | zorl | surface_roughness_length | surface roughness length | cm | 1 | real | kind_phys | in | F | !! | zorlo | surface_roughness_length_over_ocean | surface roughness length over ocean | cm | 1 | real | kind_phys | inout | F | @@ -53,103 +56,140 @@ end subroutine GFS_surface_composites_pre_finalize !! | uustar_lnd | surface_friction_velocity_over_land | surface friction velocity over land | m s-1 | 1 | real | kind_phys | inout | F | !! | uustar_ice | surface_friction_velocity_over_ice | surface friction velocity over ice | m s-1 | 1 | real | kind_phys | inout | F | !! | weasd | water_equivalent_accumulated_snow_depth | water equiv of acc snow depth over land and sea ice | mm | 1 | real | kind_phys | in | F | +!! | weasd_ocn | water_equivalent_accumulated_snow_depth_over_ocean | water equiv of acc snow depth over ocean | mm | 1 | real | kind_phys | inout | F | !! | weasd_lnd | water_equivalent_accumulated_snow_depth_over_land | water equiv of acc snow depth over land | mm | 1 | real | kind_phys | inout | F | !! | weasd_ice | water_equivalent_accumulated_snow_depth_over_ice | water equiv of acc snow depth over ice | mm | 1 | real | kind_phys | inout | F | !! | ep1d_ice | surface_upward_potential_latent_heat_flux_over_ice | surface upward potential latent heat flux over ice | W m-2 | 1 | real | kind_phys | inout | F | -!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | +!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | inout | F | !! | tsfco | sea_surface_temperature | sea surface temperature | K | 1 | real | kind_phys | inout | F | !! | tsfcl | surface_skin_temperature_over_land | surface skin temperature over land | K | 1 | real | kind_phys | inout | F | !! | tsfc_ocn | surface_skin_temperature_over_ocean_interstitial | surface skin temperature over ocean (temporary use as interstitial) | K | 1 | real | kind_phys | inout | F | !! | tsfc_lnd | surface_skin_temperature_over_land_interstitial | surface skin temperature over land (temporary use as interstitial) | K | 1 | real | kind_phys | inout | F | !! | tsfc_ice | surface_skin_temperature_over_ice_interstitial | surface skin temperature over ice (temporary use as interstitial) | K | 1 | real | kind_phys | inout | F | !! | tisfc | sea_ice_temperature | sea ice surface skin temperature | K | 1 | real | kind_phys | inout | F | +!! | tice | sea_ice_temperature_interstitial | sea ice surface skin temperature use as interstitial | K | 1 | real | kind_phys | out | F | !! | tsurf | surface_skin_temperature_after_iteration | surface skin temperature after iteration | K | 1 | real | kind_phys | inout | F | !! | tsurf_ocn | surface_skin_temperature_after_iteration_over_ocean | surface skin temperature after iteration over ocean | K | 1 | real | kind_phys | inout | F | !! | tsurf_lnd | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | inout | F | !! | tsurf_ice | surface_skin_temperature_after_iteration_over_ice | surface skin temperature after iteration over ice | K | 1 | real | kind_phys | inout | F | +!! | gflx_ice | upward_heat_flux_in_soil_over_ice | soil heat flux over ice | W m-2 | 1 | real | kind_phys | inout | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! #endif - subroutine GFS_surface_composites_pre_run (im, cplflx, landfrac, lakefrac, oceanfrac, & - dry, icy, lake, ocean, wet, fice, cimin, zorl, zorlo, zorll, zorl_ocn, & - zorl_lnd, zorl_ice, snowd, snowd_ocn, snowd_lnd, snowd_ice, tprcp, tprcp_ocn, & - tprcp_lnd, tprcp_ice, uustar, uustar_lnd, uustar_ice, weasd, weasd_lnd, & - weasd_ice, ep1d_ice, tsfc, tsfco, tsfcl, tsfc_ocn, tsfc_lnd, tsfc_ice, tisfc, & - tsurf, tsurf_ocn, tsurf_lnd, tsurf_ice, errmsg, errflg) + subroutine GFS_surface_composites_pre_run (im, frac_grid, flag_cice, cplflx, landfrac, lakefrac, oceanfrac, & + frland, dry, icy, lake, ocean, wet, cice, cimin, zorl, zorlo, zorll, zorl_ocn, & + zorl_lnd, zorl_ice, snowd, snowd_ocn, snowd_lnd, snowd_ice, tprcp, tprcp_ocn, & + tprcp_lnd, tprcp_ice, uustar, uustar_lnd, uustar_ice, weasd, weasd_ocn, & + weasd_lnd, weasd_ice, ep1d_ice, tsfc, tsfco, tsfcl, tsfc_ocn, tsfc_lnd, & + tsfc_ice, tisfc, tice, tsurf, tsurf_ocn, tsurf_lnd, tsurf_ice, gflx_ice, & + errmsg, errflg) use machine, only: kind_phys implicit none ! Interface variables - integer, intent(in) :: im - logical, intent(in) :: cplflx + integer, intent(in ) :: im + logical, intent(in ) :: frac_grid, cplflx + logical, dimension(im), intent(in ) :: flag_cice logical, dimension(im), intent(inout) :: dry, icy, lake, ocean, wet - real(kind=kind_phys), intent(in) :: cimin - real(kind=kind_phys), dimension(im), intent(in) :: landfrac, lakefrac, oceanfrac, fice - real(kind=kind_phys), dimension(im), intent(in) :: zorl, snowd, tprcp, uustar, weasd, tsfc + real(kind=kind_phys), intent(in ) :: cimin + real(kind=kind_phys), dimension(im), intent(in ) :: landfrac, lakefrac, oceanfrac, cice + real(kind=kind_phys), dimension(im), intent( out) :: frland + real(kind=kind_phys), dimension(im), intent(in ) :: zorl, snowd, tprcp, uustar, weasd - real(kind=kind_phys), dimension(im), intent(inout) :: zorlo, zorll, tsfco, tsfcl, tisfc, tsurf + real(kind=kind_phys), dimension(im), intent(inout) :: zorlo, zorll, tsfc, tsfco, tsfcl, tisfc, tsurf real(kind=kind_phys), dimension(im), intent(inout) :: snowd_ocn, snowd_lnd, snowd_ice, tprcp_ocn, & tprcp_lnd, tprcp_ice, zorl_ocn, zorl_lnd, zorl_ice, tsfc_ocn, tsfc_lnd, tsfc_ice, tsurf_ocn, & - tsurf_lnd, tsurf_ice, uustar_lnd, uustar_ice, weasd_lnd, weasd_ice, ep1d_ice + tsurf_lnd, tsurf_ice, uustar_lnd, uustar_ice, weasd_ocn, weasd_lnd, weasd_ice, ep1d_ice, gflx_ice + real(kind=kind_phys), dimension(im), intent( out) :: tice ! CCPP error handling character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg ! Local variables + real(kind=kind_phys), parameter :: one = 1.0d0 integer :: i ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - do i = 1, im - if(oceanfrac(i)>0.) ocean(i) = .true. - if(landfrac(i) >0.) dry(i) = .true. - if(lakefrac(i) >0.) lake(i) = .true. - if(ocean(i) .or. lake(i)) wet(i) = .true. - if(wet(i) .and. fice(i) >= cimin*max(oceanfrac(i),lakefrac(i))) icy(i) = .true. - enddo - do i=1,im - if (.not. cplflx) then + frland(i) = landfrac(i) + if (frland(i) > 0.0) dry(i) = .true. + if (cice(i) >= cimin*(1.-frland(i)) .and. frland(i)<1.) icy(i) = .true. + if (frland(i)+cice(i) < 1.0 ) wet(i) = .true. ! there is some open water! + enddo + + if (frac_grid) then + do i=1,im + tsfc(i) = tsfcl(i) * frland(i) & + + tisfc(i) * cice(i) & + + tsfco(i) * (one-cice(i)-frland(i)) + enddo + elseif (cplflx) then + do i=1,im + if (flag_cice(i)) then + tsfc(i) = tisfc(i) * cice(i) & + + tsfc (i) * (one-cice(i)) + icy(i) = .true. + endif + enddo + endif + + if (.not. cplflx .or. .not. frac_grid) then + do i=1,im zorll(i) = zorl(i) zorlo(i) = zorl(i) tsfcl(i) = tsfc(i) tsfco(i) = tsfc(i) - tisfc(i) = tsfc(i) - end if - if(wet(i)) then - snowd_ocn(i) = snowd(i) - tprcp_ocn(i) = tprcp(i) - zorl_ocn(i) = zorlo(i) - tsfc_ocn(i) = tsfco(i) - tsurf_ocn(i)= tsfco(i) + !tisfc(i) = tsfc(i) + enddo + endif + + do i=1,im + if (wet(i)) then ! Water + tprcp_ocn(i) = tprcp(i) + zorl_ocn(i) = zorlo(i) + tsfc_ocn(i) = tsfco(i) + tsurf_ocn(i) = tsfco(i) +! weasd_ocn(i) = weasd(i) +! snowd_ocn(i) = snowd(i) + weasd_ocn(i) = 0.0 + snowd_ocn(i) = 0.0 endif - if (dry(i)) then + if (dry(i)) then ! Land uustar_lnd(i) = uustar(i) - weasd_lnd(i) = weasd(i) - tprcp_lnd(i) = tprcp(i) - zorl_lnd(i) = zorll(i) - tsfc_lnd(i) = tsfcl(i) - tsurf_lnd(i) = tsfcl(i) - snowd_lnd(i) = snowd(i) + weasd_lnd(i) = weasd(i) + tprcp_lnd(i) = tprcp(i) + zorl_lnd(i) = zorll(i) + tsfc_lnd(i) = tsfcl(i) + tsurf_lnd(i) = tsfcl(i) + snowd_lnd(i) = snowd(i) end if - if (icy(i)) then + if (icy(i)) then ! Ice uustar_ice(i) = uustar(i) - weasd_ice(i) = weasd(i) - tprcp_ice(i) = tprcp(i) - zorl_ice(i) = zorll(i) - tsfc_ice(i) = tisfc(i) - tsurf_ice(i)= tisfc(i) - snowd_ice(i) = snowd(i) - ep1d_ice(i) = 0. + weasd_ice(i) = weasd(i) + tprcp_ice(i) = tprcp(i) + zorl_ice(i) = zorll(i) +! tsfc_ice(i) = tisfc(i) +! tsurf_ice(i) = tisfc(i) + tsfc_ice(i) = tsfc(i) + tsurf_ice(i) = tsfc(i) + snowd_ice(i) = snowd(i) + ep1d_ice(i) = 0. + gflx_ice(i) = 0. end if enddo + ! Assign sea ice temperature to interstitial variable + do i = 1, im + tice(i) = tisfc(i) + end do + end subroutine GFS_surface_composites_pre_run end module GFS_surface_composites_pre @@ -175,147 +215,155 @@ end subroutine GFS_surface_composites_post_finalize #if 0 !> \section arg_table_GFS_surface_composites_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|---------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|-------------|------|------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | -!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | in | F | -!! | dry | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | -!! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | -!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | -!! | lndfrac | land_area_fraction | fraction of horizontal grid area occupied by land | frac | 1 | real | kind_phys | in | F | -!! | lakfrac | lake_area_fraction | fraction of horizontal grid area occupied by lake | frac | 1 | real | kind_phys | in | F | -!! | ocnfrac | sea_area_fraction | fraction of horizontal grid area occupied by ocean | frac | 1 | real | kind_phys | in | F | -!! | cice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length | cm | 1 | real | kind_phys | inout | F | -!! | zorlo | surface_roughness_length_over_ocean | surface roughness length over ocean | cm | 1 | real | kind_phys | inout | F | -!! | zorll | surface_roughness_length_over_land | surface roughness length over land | cm | 1 | real | kind_phys | inout | F | -!! | zorl_ocn | surface_roughness_length_over_ocean_interstitial | surface roughness length over ocean (temporary use as interstitial) | cm | 1 | real | kind_phys | in | F | -!! | zorl_lnd | surface_roughness_length_over_land_interstitial | surface roughness length over land (temporary use as interstitial) | cm | 1 | real | kind_phys | in | F | -!! | zorl_ice | surface_roughness_length_over_ice_interstitial | surface roughness length over ice (temporary use as interstitial) | cm | 1 | real | kind_phys | in | F | -!! | cd | surface_drag_coefficient_for_momentum_in_air | surface exchange coeff for momentum | none | 1 | real | kind_phys | inout | F | -!! | cd_ocn | surface_drag_coefficient_for_momentum_in_air_over_ocean | surface exchange coeff for momentum over ocean | none | 1 | real | kind_phys | in | F | -!! | cd_lnd | surface_drag_coefficient_for_momentum_in_air_over_land | surface exchange coeff for momentum over land | none | 1 | real | kind_phys | in | F | -!! | cd_ice | surface_drag_coefficient_for_momentum_in_air_over_ice | surface exchange coeff for momentum over ice | none | 1 | real | kind_phys | in | F | -!! | cdq | surface_drag_coefficient_for_heat_and_moisture_in_air | surface exchange coeff heat & moisture | none | 1 | real | kind_phys | inout | F | -!! | cdq_ocn | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ocean | surface exchange coeff heat & moisture over ocean | none | 1 | real | kind_phys | in | F | -!! | cdq_lnd | surface_drag_coefficient_for_heat_and_moisture_in_air_over_land | surface exchange coeff heat & moisture over land | none | 1 | real | kind_phys | in | F | -!! | cdq_ice | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice | surface exchange coeff heat & moisture over ice | none | 1 | real | kind_phys | in | F | -!! | rb | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | inout | F | -!! | rb_ocn | bulk_richardson_number_at_lowest_model_level_over_ocean | bulk Richardson number at the surface over ocean | none | 1 | real | kind_phys | in | F | -!! | rb_lnd | bulk_richardson_number_at_lowest_model_level_over_land | bulk Richardson number at the surface over land | none | 1 | real | kind_phys | in | F | -!! | rb_ice | bulk_richardson_number_at_lowest_model_level_over_ice | bulk Richardson number at the surface over ice | none | 1 | real | kind_phys | in | F | -!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | inout | F | -!! | stress_ocn | surface_wind_stress_over_ocean | surface wind stress over ocean | m2 s-2 | 1 | real | kind_phys | in | F | -!! | stress_lnd | surface_wind_stress_over_land | surface wind stress over land | m2 s-2 | 1 | real | kind_phys | in | F | -!! | stress_ice | surface_wind_stress_over_ice | surface wind stress over ice | m2 s-2 | 1 | real | kind_phys | in | F | -!! | ffmm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | inout | F | -!! | ffmm_ocn | Monin-Obukhov_similarity_function_for_momentum_over_ocean | Monin-Obukhov similarity function for momentum over ocean | none | 1 | real | kind_phys | in | F | -!! | ffmm_lnd | Monin-Obukhov_similarity_function_for_momentum_over_land | Monin-Obukhov similarity function for momentum over land | none | 1 | real | kind_phys | in | F | -!! | ffmm_ice | Monin-Obukhov_similarity_function_for_momentum_over_ice | Monin-Obukhov similarity function for momentum over ice | none | 1 | real | kind_phys | in | F | -!! | ffhh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | inout | F | -!! | ffhh_ocn | Monin-Obukhov_similarity_function_for_heat_over_ocean | Monin-Obukhov similarity function for heat over ocean | none | 1 | real | kind_phys | in | F | -!! | ffhh_lnd | Monin-Obukhov_similarity_function_for_heat_over_land | Monin-Obukhov similarity function for heat over land | none | 1 | real | kind_phys | in | F | -!! | ffhh_ice | Monin-Obukhov_similarity_function_for_heat_over_ice | Monin-Obukhov similarity function for heat over ice | none | 1 | real | kind_phys | in | F | -!! | uustar | surface_friction_velocity | boundary layer parameter | m s-1 | 1 | real | kind_phys | inout | F | -!! | uustar_ocn | surface_friction_velocity_over_ocean | surface friction velocity over ocean | m s-1 | 1 | real | kind_phys | in | F | -!! | uustar_lnd | surface_friction_velocity_over_land | surface friction velocity over land | m s-1 | 1 | real | kind_phys | in | F | -!! | uustar_ice | surface_friction_velocity_over_ice | surface friction velocity over ice | m s-1 | 1 | real | kind_phys | in | F | -!! | fm10 | Monin-Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum at 10m | none | 1 | real | kind_phys | inout | F | -!! | fm10_ocn | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_ocean | Monin-Obukhov similarity parameter for momentum at 10m over ocean | none | 1 | real | kind_phys | in | F | -!! | fm10_lnd | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_land | Monin-Obukhov similarity parameter for momentum at 10m over land | none | 1 | real | kind_phys | in | F | -!! | fm10_ice | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_ice | Monin-Obukhov similarity parameter for momentum at 10m over ice | none | 1 | real | kind_phys | in | F | -!! | fh2 | Monin-Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat at 2m | none | 1 | real | kind_phys | inout | F | -!! | fh2_ocn | Monin-Obukhov_similarity_function_for_heat_at_2m_over_ocean | Monin-Obukhov similarity parameter for heat at 2m over ocean | none | 1 | real | kind_phys | in | F | -!! | fh2_lnd | Monin-Obukhov_similarity_function_for_heat_at_2m_over_land | Monin-Obukhov similarity parameter for heat at 2m over land | none | 1 | real | kind_phys | in | F | -!! | fh2_ice | Monin-Obukhov_similarity_function_for_heat_at_2m_over_ice | Monin-Obukhov similarity parameter for heat at 2m over ice | none | 1 | real | kind_phys | in | F | -!! | tsurf | surface_skin_temperature_after_iteration | surface skin temperature after iteration | K | 1 | real | kind_phys | inout | F | -!! | tsurf_ocn | surface_skin_temperature_after_iteration_over_ocean | surface skin temperature after iteration over ocean | K | 1 | real | kind_phys | in | F | -!! | tsurf_lnd | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | in | F | -!! | tsurf_ice | surface_skin_temperature_after_iteration_over_ice | surface skin temperature after iteration over ice | K | 1 | real | kind_phys | in | F | -!! | cmm | surface_drag_wind_speed_for_momentum_in_air | momentum exchange coefficient | m s-1 | 1 | real | kind_phys | inout | F | -!! | cmm_ocn | surface_drag_wind_speed_for_momentum_in_air_over_ocean | momentum exchange coefficient over ocean | m s-1 | 1 | real | kind_phys | in | F | -!! | cmm_lnd | surface_drag_wind_speed_for_momentum_in_air_over_land | momentum exchange coefficient over land | m s-1 | 1 | real | kind_phys | in | F | -!! | cmm_ice | surface_drag_wind_speed_for_momentum_in_air_over_ice | momentum exchange coefficient over ice | m s-1 | 1 | real | kind_phys | in | F | -!! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air | thermal exchange coefficient | kg m-2 s-1 | 1 | real | kind_phys | inout | F | -!! | chh_ocn | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ocean | thermal exchange coefficient over ocean | kg m-2 s-1 | 1 | real | kind_phys | in | F | -!! | chh_lnd | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land | thermal exchange coefficient over land | kg m-2 s-1 | 1 | real | kind_phys | in | F | -!! | chh_ice | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ice | thermal exchange coefficient over ice | kg m-2 s-1 | 1 | real | kind_phys | in | F | -!! | gflx | upward_heat_flux_in_soil | soil heat flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | gflx_ocn | upward_heat_flux_in_soil_over_ocean | soil heat flux over ocean | W m-2 | 1 | real | kind_phys | in | F | -!! | gflx_lnd | upward_heat_flux_in_soil_over_land | soil heat flux over land | W m-2 | 1 | real | kind_phys | in | F | -!! | gflx_ice | upward_heat_flux_in_soil_over_ice | soil heat flux over ice | W m-2 | 1 | real | kind_phys | in | F | -!! | ep1d | surface_upward_potential_latent_heat_flux | surface upward potential latent heat flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | ep1d_ocn | surface_upward_potential_latent_heat_flux_over_ocean | surface upward potential latent heat flux over ocean | W m-2 | 1 | real | kind_phys | in | F | -!! | ep1d_lnd | surface_upward_potential_latent_heat_flux_over_land | surface upward potential latent heat flux over land | W m-2 | 1 | real | kind_phys | in | F | -!! | ep1d_ice | surface_upward_potential_latent_heat_flux_over_ice | surface upward potential latent heat flux over ice | W m-2 | 1 | real | kind_phys | in | F | -!! | weasd | water_equivalent_accumulated_snow_depth | water equiv of acc snow depth over land and sea ice | mm | 1 | real | kind_phys | inout | F | -!! | weasd_lnd | water_equivalent_accumulated_snow_depth_over_land | water equiv of acc snow depth over land | mm | 1 | real | kind_phys | in | F | -!! | weasd_ice | water_equivalent_accumulated_snow_depth_over_ice | water equiv of acc snow depth over ice | mm | 1 | real | kind_phys | in | F | -!! | snowd | surface_snow_thickness_water_equivalent | water equivalent snow depth | mm | 1 | real | kind_phys | inout | F | -!! | snowd_ocn | surface_snow_thickness_water_equivalent_over_ocean | water equivalent snow depth over ocean | mm | 1 | real | kind_phys | in | F | -!! | snowd_lnd | surface_snow_thickness_water_equivalent_over_land | water equivalent snow depth over land | mm | 1 | real | kind_phys | in | F | -!! | snowd_ice | surface_snow_thickness_water_equivalent_over_ice | water equivalent snow depth over ice | mm | 1 | real | kind_phys | in | F | -!! | tprcp | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total precipitation amount in each time step | m | 1 | real | kind_phys | inout | F | -!! | tprcp_ocn | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ocean | total precipitation amount in each time step over ocean | m | 1 | real | kind_phys | in | F | -!! | tprcp_lnd | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_land | total precipitation amount in each time step over land | m | 1 | real | kind_phys | in | F | -!! | tprcp_ice | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ice | total precipitation amount in each time step over ice | m | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | inout | F | -!! | evap_ocn | kinematic_surface_upward_latent_heat_flux_over_ocean | kinematic surface upward latent heat flux over ocean | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | evap_lnd | kinematic_surface_upward_latent_heat_flux_over_land | kinematic surface upward latent heat flux over land | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | evap_ice | kinematic_surface_upward_latent_heat_flux_over_ice | kinematic surface upward latent heat flux over ice | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | hflx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | inout | F | -!! | hflx_ocn | kinematic_surface_upward_sensible_heat_flux_over_ocean | kinematic surface upward sensible heat flux over ocean | K m s-1 | 1 | real | kind_phys | in | F | -!! | hflx_lnd | kinematic_surface_upward_sensible_heat_flux_over_land | kinematic surface upward sensible heat flux over land | K m s-1 | 1 | real | kind_phys | in | F | -!! | hflx_ice | kinematic_surface_upward_sensible_heat_flux_over_ice | kinematic surface upward sensible heat flux over ice | K m s-1 | 1 | real | kind_phys | in | F | -!! | qss | surface_specific_humidity | surface air saturation specific humidity | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | qss_ocn | surface_specific_humidity_over_ocean | surface air saturation specific humidity over ocean | kg kg-1 | 1 | real | kind_phys | in | F | -!! | qss_lnd | surface_specific_humidity_over_land | surface air saturation specific humidity over land | kg kg-1 | 1 | real | kind_phys | in | F | -!! | qss_ice | surface_specific_humidity_over_ice | surface air saturation specific humidity over ice | kg kg-1 | 1 | real | kind_phys | in | F | -!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | inout | F | -!! | tsfco | sea_surface_temperature | sea surface temperature | K | 1 | real | kind_phys | inout | F | -!! | tsfcl | surface_skin_temperature_over_land | surface skin temperature over land | K | 1 | real | kind_phys | inout | F | -!! | tsfc_ocn | surface_skin_temperature_over_ocean_interstitial | surface skin temperature over ocean (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | -!! | tsfc_lnd | surface_skin_temperature_over_land_interstitial | surface skin temperature over land (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | -!! | tsfc_ice | surface_skin_temperature_over_ice_interstitial | surface skin temperature over ice (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | -!! | tisfc | sea_ice_temperature | sea ice surface skin temperature | K | 1 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|-------------|------|------------|-----------|--------|----------| +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | +!! | frac_grid | flag_for_fractional_grid | flag for fractional grid | flag | 0 | logical | | in | F | +!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | in | F | +!! | islmsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | in | F | +!! | dry | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | +!! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | +!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | +!! | landfrac | land_area_fraction | fraction of horizontal grid area occupied by land | frac | 1 | real | kind_phys | in | F | +!! | zorl | surface_roughness_length | surface roughness length | cm | 1 | real | kind_phys | inout | F | +!! | zorlo | surface_roughness_length_over_ocean | surface roughness length over ocean | cm | 1 | real | kind_phys | inout | F | +!! | zorll | surface_roughness_length_over_land | surface roughness length over land | cm | 1 | real | kind_phys | inout | F | +!! | zorl_ocn | surface_roughness_length_over_ocean_interstitial | surface roughness length over ocean (temporary use as interstitial) | cm | 1 | real | kind_phys | in | F | +!! | zorl_lnd | surface_roughness_length_over_land_interstitial | surface roughness length over land (temporary use as interstitial) | cm | 1 | real | kind_phys | in | F | +!! | zorl_ice | surface_roughness_length_over_ice_interstitial | surface roughness length over ice (temporary use as interstitial) | cm | 1 | real | kind_phys | in | F | +!! | cd | surface_drag_coefficient_for_momentum_in_air | surface exchange coeff for momentum | none | 1 | real | kind_phys | inout | F | +!! | cd_ocn | surface_drag_coefficient_for_momentum_in_air_over_ocean | surface exchange coeff for momentum over ocean | none | 1 | real | kind_phys | in | F | +!! | cd_lnd | surface_drag_coefficient_for_momentum_in_air_over_land | surface exchange coeff for momentum over land | none | 1 | real | kind_phys | in | F | +!! | cd_ice | surface_drag_coefficient_for_momentum_in_air_over_ice | surface exchange coeff for momentum over ice | none | 1 | real | kind_phys | in | F | +!! | cdq | surface_drag_coefficient_for_heat_and_moisture_in_air | surface exchange coeff heat & moisture | none | 1 | real | kind_phys | inout | F | +!! | cdq_ocn | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ocean | surface exchange coeff heat & moisture over ocean | none | 1 | real | kind_phys | in | F | +!! | cdq_lnd | surface_drag_coefficient_for_heat_and_moisture_in_air_over_land | surface exchange coeff heat & moisture over land | none | 1 | real | kind_phys | in | F | +!! | cdq_ice | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice | surface exchange coeff heat & moisture over ice | none | 1 | real | kind_phys | in | F | +!! | rb | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | inout | F | +!! | rb_ocn | bulk_richardson_number_at_lowest_model_level_over_ocean | bulk Richardson number at the surface over ocean | none | 1 | real | kind_phys | in | F | +!! | rb_lnd | bulk_richardson_number_at_lowest_model_level_over_land | bulk Richardson number at the surface over land | none | 1 | real | kind_phys | in | F | +!! | rb_ice | bulk_richardson_number_at_lowest_model_level_over_ice | bulk Richardson number at the surface over ice | none | 1 | real | kind_phys | in | F | +!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | inout | F | +!! | stress_ocn | surface_wind_stress_over_ocean | surface wind stress over ocean | m2 s-2 | 1 | real | kind_phys | in | F | +!! | stress_lnd | surface_wind_stress_over_land | surface wind stress over land | m2 s-2 | 1 | real | kind_phys | in | F | +!! | stress_ice | surface_wind_stress_over_ice | surface wind stress over ice | m2 s-2 | 1 | real | kind_phys | in | F | +!! | ffmm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | inout | F | +!! | ffmm_ocn | Monin-Obukhov_similarity_function_for_momentum_over_ocean | Monin-Obukhov similarity function for momentum over ocean | none | 1 | real | kind_phys | in | F | +!! | ffmm_lnd | Monin-Obukhov_similarity_function_for_momentum_over_land | Monin-Obukhov similarity function for momentum over land | none | 1 | real | kind_phys | in | F | +!! | ffmm_ice | Monin-Obukhov_similarity_function_for_momentum_over_ice | Monin-Obukhov similarity function for momentum over ice | none | 1 | real | kind_phys | in | F | +!! | ffhh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | inout | F | +!! | ffhh_ocn | Monin-Obukhov_similarity_function_for_heat_over_ocean | Monin-Obukhov similarity function for heat over ocean | none | 1 | real | kind_phys | in | F | +!! | ffhh_lnd | Monin-Obukhov_similarity_function_for_heat_over_land | Monin-Obukhov similarity function for heat over land | none | 1 | real | kind_phys | in | F | +!! | ffhh_ice | Monin-Obukhov_similarity_function_for_heat_over_ice | Monin-Obukhov similarity function for heat over ice | none | 1 | real | kind_phys | in | F | +!! | uustar | surface_friction_velocity | boundary layer parameter | m s-1 | 1 | real | kind_phys | inout | F | +!! | uustar_ocn | surface_friction_velocity_over_ocean | surface friction velocity over ocean | m s-1 | 1 | real | kind_phys | in | F | +!! | uustar_lnd | surface_friction_velocity_over_land | surface friction velocity over land | m s-1 | 1 | real | kind_phys | in | F | +!! | uustar_ice | surface_friction_velocity_over_ice | surface friction velocity over ice | m s-1 | 1 | real | kind_phys | in | F | +!! | fm10 | Monin-Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum at 10m | none | 1 | real | kind_phys | inout | F | +!! | fm10_ocn | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_ocean | Monin-Obukhov similarity parameter for momentum at 10m over ocean | none | 1 | real | kind_phys | in | F | +!! | fm10_lnd | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_land | Monin-Obukhov similarity parameter for momentum at 10m over land | none | 1 | real | kind_phys | in | F | +!! | fm10_ice | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_ice | Monin-Obukhov similarity parameter for momentum at 10m over ice | none | 1 | real | kind_phys | in | F | +!! | fh2 | Monin-Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat at 2m | none | 1 | real | kind_phys | inout | F | +!! | fh2_ocn | Monin-Obukhov_similarity_function_for_heat_at_2m_over_ocean | Monin-Obukhov similarity parameter for heat at 2m over ocean | none | 1 | real | kind_phys | in | F | +!! | fh2_lnd | Monin-Obukhov_similarity_function_for_heat_at_2m_over_land | Monin-Obukhov similarity parameter for heat at 2m over land | none | 1 | real | kind_phys | in | F | +!! | fh2_ice | Monin-Obukhov_similarity_function_for_heat_at_2m_over_ice | Monin-Obukhov similarity parameter for heat at 2m over ice | none | 1 | real | kind_phys | in | F | +!! | tsurf | surface_skin_temperature_after_iteration | surface skin temperature after iteration | K | 1 | real | kind_phys | inout | F | +!! | tsurf_ocn | surface_skin_temperature_after_iteration_over_ocean | surface skin temperature after iteration over ocean | K | 1 | real | kind_phys | in | F | +!! | tsurf_lnd | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | in | F | +!! | tsurf_ice | surface_skin_temperature_after_iteration_over_ice | surface skin temperature after iteration over ice | K | 1 | real | kind_phys | in | F | +!! | cmm | surface_drag_wind_speed_for_momentum_in_air | momentum exchange coefficient | m s-1 | 1 | real | kind_phys | inout | F | +!! | cmm_ocn | surface_drag_wind_speed_for_momentum_in_air_over_ocean | momentum exchange coefficient over ocean | m s-1 | 1 | real | kind_phys | in | F | +!! | cmm_lnd | surface_drag_wind_speed_for_momentum_in_air_over_land | momentum exchange coefficient over land | m s-1 | 1 | real | kind_phys | in | F | +!! | cmm_ice | surface_drag_wind_speed_for_momentum_in_air_over_ice | momentum exchange coefficient over ice | m s-1 | 1 | real | kind_phys | in | F | +!! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air | thermal exchange coefficient | kg m-2 s-1 | 1 | real | kind_phys | inout | F | +!! | chh_ocn | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ocean | thermal exchange coefficient over ocean | kg m-2 s-1 | 1 | real | kind_phys | in | F | +!! | chh_lnd | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land | thermal exchange coefficient over land | kg m-2 s-1 | 1 | real | kind_phys | in | F | +!! | chh_ice | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ice | thermal exchange coefficient over ice | kg m-2 s-1 | 1 | real | kind_phys | in | F | +!! | gflx | upward_heat_flux_in_soil | soil heat flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | gflx_ocn | upward_heat_flux_in_soil_over_ocean | soil heat flux over ocean | W m-2 | 1 | real | kind_phys | in | F | +!! | gflx_lnd | upward_heat_flux_in_soil_over_land | soil heat flux over land | W m-2 | 1 | real | kind_phys | in | F | +!! | gflx_ice | upward_heat_flux_in_soil_over_ice | soil heat flux over ice | W m-2 | 1 | real | kind_phys | in | F | +!! | ep1d | surface_upward_potential_latent_heat_flux | surface upward potential latent heat flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | ep1d_ocn | surface_upward_potential_latent_heat_flux_over_ocean | surface upward potential latent heat flux over ocean | W m-2 | 1 | real | kind_phys | in | F | +!! | ep1d_lnd | surface_upward_potential_latent_heat_flux_over_land | surface upward potential latent heat flux over land | W m-2 | 1 | real | kind_phys | in | F | +!! | ep1d_ice | surface_upward_potential_latent_heat_flux_over_ice | surface upward potential latent heat flux over ice | W m-2 | 1 | real | kind_phys | in | F | +!! | weasd | water_equivalent_accumulated_snow_depth | water equiv of acc snow depth over land and sea ice | mm | 1 | real | kind_phys | inout | F | +!! | weasd_ocn | water_equivalent_accumulated_snow_depth_over_ocean | water equiv of acc snow depth over ocean | mm | 1 | real | kind_phys | in | F | +!! | weasd_lnd | water_equivalent_accumulated_snow_depth_over_land | water equiv of acc snow depth over land | mm | 1 | real | kind_phys | in | F | +!! | weasd_ice | water_equivalent_accumulated_snow_depth_over_ice | water equiv of acc snow depth over ice | mm | 1 | real | kind_phys | in | F | +!! | snowd | surface_snow_thickness_water_equivalent | water equivalent snow depth | mm | 1 | real | kind_phys | inout | F | +!! | snowd_ocn | surface_snow_thickness_water_equivalent_over_ocean | water equivalent snow depth over ocean | mm | 1 | real | kind_phys | in | F | +!! | snowd_lnd | surface_snow_thickness_water_equivalent_over_land | water equivalent snow depth over land | mm | 1 | real | kind_phys | in | F | +!! | snowd_ice | surface_snow_thickness_water_equivalent_over_ice | water equivalent snow depth over ice | mm | 1 | real | kind_phys | in | F | +!! | tprcp | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total precipitation amount in each time step | m | 1 | real | kind_phys | inout | F | +!! | tprcp_ocn | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ocean | total precipitation amount in each time step over ocean | m | 1 | real | kind_phys | in | F | +!! | tprcp_lnd | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_land | total precipitation amount in each time step over land | m | 1 | real | kind_phys | in | F | +!! | tprcp_ice | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ice | total precipitation amount in each time step over ice | m | 1 | real | kind_phys | in | F | +!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | inout | F | +!! | evap_ocn | kinematic_surface_upward_latent_heat_flux_over_ocean | kinematic surface upward latent heat flux over ocean | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | evap_lnd | kinematic_surface_upward_latent_heat_flux_over_land | kinematic surface upward latent heat flux over land | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | evap_ice | kinematic_surface_upward_latent_heat_flux_over_ice | kinematic surface upward latent heat flux over ice | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | hflx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | inout | F | +!! | hflx_ocn | kinematic_surface_upward_sensible_heat_flux_over_ocean | kinematic surface upward sensible heat flux over ocean | K m s-1 | 1 | real | kind_phys | in | F | +!! | hflx_lnd | kinematic_surface_upward_sensible_heat_flux_over_land | kinematic surface upward sensible heat flux over land | K m s-1 | 1 | real | kind_phys | in | F | +!! | hflx_ice | kinematic_surface_upward_sensible_heat_flux_over_ice | kinematic surface upward sensible heat flux over ice | K m s-1 | 1 | real | kind_phys | in | F | +!! | qss | surface_specific_humidity | surface air saturation specific humidity | kg kg-1 | 1 | real | kind_phys | inout | F | +!! | qss_ocn | surface_specific_humidity_over_ocean | surface air saturation specific humidity over ocean | kg kg-1 | 1 | real | kind_phys | in | F | +!! | qss_lnd | surface_specific_humidity_over_land | surface air saturation specific humidity over land | kg kg-1 | 1 | real | kind_phys | in | F | +!! | qss_ice | surface_specific_humidity_over_ice | surface air saturation specific humidity over ice | kg kg-1 | 1 | real | kind_phys | in | F | +!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | inout | F | +!! | tsfco | sea_surface_temperature | sea surface temperature | K | 1 | real | kind_phys | inout | F | +!! | tsfcl | surface_skin_temperature_over_land | surface skin temperature over land | K | 1 | real | kind_phys | inout | F | +!! | tsfc_ocn | surface_skin_temperature_over_ocean_interstitial | surface skin temperature over ocean (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | +!! | tsfc_lnd | surface_skin_temperature_over_land_interstitial | surface skin temperature over land (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | +!! | tsfc_ice | surface_skin_temperature_over_ice_interstitial | surface skin temperature over ice (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | +!! | tisfc | sea_ice_temperature | sea ice surface skin temperature | K | 1 | real | kind_phys | inout | F | +!! | tice | sea_ice_temperature_interstitial | sea ice surface skin temperature use as interstitial | K | 1 | real | kind_phys | in | F | +!! | hice | sea_ice_thickness | sea ice thickness | m | 1 | real | kind_phys | inout | F | +!! | cice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | inout | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! #endif - subroutine GFS_surface_composites_post_run ( & - im, cplflx, flag_cice, dry, wet, icy, lndfrac, lakfrac, ocnfrac, cice, zorl, zorlo, zorll, zorl_ocn, zorl_lnd, zorl_ice, & + subroutine GFS_surface_composites_post_run ( & + im, cplflx, frac_grid, flag_cice, islmsk, dry, wet, icy, landfrac, zorl, zorlo, zorll, zorl_ocn, zorl_lnd, zorl_ice, & cd, cd_ocn, cd_lnd, cd_ice, cdq, cdq_ocn, cdq_lnd, cdq_ice, rb, rb_ocn, rb_lnd, rb_ice, stress, stress_ocn, stress_lnd, & stress_ice, ffmm, ffmm_ocn, ffmm_lnd, ffmm_ice, ffhh, ffhh_ocn, ffhh_lnd, ffhh_ice, uustar, uustar_ocn, uustar_lnd, & uustar_ice, fm10, fm10_ocn, fm10_lnd, fm10_ice, fh2, fh2_ocn, fh2_lnd, fh2_ice, tsurf, tsurf_ocn, tsurf_lnd, tsurf_ice, & cmm, cmm_ocn, cmm_lnd, cmm_ice, chh, chh_ocn, chh_lnd, chh_ice, gflx, gflx_ocn, gflx_lnd, gflx_ice, ep1d, ep1d_ocn, & - ep1d_lnd, ep1d_ice, weasd, weasd_lnd, weasd_ice, snowd, snowd_ocn, snowd_lnd, snowd_ice, tprcp, tprcp_ocn, tprcp_lnd, & - tprcp_ice, evap, evap_ocn, evap_lnd, evap_ice, hflx, hflx_ocn, hflx_lnd, hflx_ice, qss, qss_ocn, qss_lnd, qss_ice, & - tsfc, tsfco, tsfcl, tsfc_ocn, tsfc_lnd, tsfc_ice, tisfc, errmsg, errflg) + ep1d_lnd, ep1d_ice, weasd, weasd_ocn, weasd_lnd, weasd_ice, snowd, snowd_ocn, snowd_lnd, snowd_ice, tprcp, tprcp_ocn, & + tprcp_lnd, tprcp_ice, evap, evap_ocn, evap_lnd, evap_ice, hflx, hflx_ocn, hflx_lnd, hflx_ice, qss, qss_ocn, qss_lnd, & + qss_ice, tsfc, tsfco, tsfcl, tsfc_ocn, tsfc_lnd, tsfc_ice, tisfc, tice, hice, cice, errmsg, errflg) use machine, only: kind_phys implicit none integer, intent(in) :: im - logical, intent(in) :: cplflx + logical, intent(in) :: cplflx, frac_grid logical, dimension(im), intent(in) :: flag_cice, dry, wet, icy - - real(kind=kind_phys), dimension(im), intent(in) :: lndfrac, lakfrac, ocnfrac, cice, & + integer, dimension(im), intent(in) :: islmsk + real(kind=kind_phys), dimension(im), intent(in) :: landfrac, & zorl_ocn, zorl_lnd, zorl_ice, cd_ocn, cd_lnd, cd_ice, cdq_ocn, cdq_lnd, cdq_ice, rb_ocn, rb_lnd, rb_ice, stress_ocn, & stress_lnd, stress_ice, ffmm_ocn, ffmm_lnd, ffmm_ice, ffhh_ocn, ffhh_lnd, ffhh_ice, uustar_ocn, uustar_lnd, uustar_ice, & fm10_ocn, fm10_lnd, fm10_ice, fh2_ocn, fh2_lnd, fh2_ice, tsurf_ocn, tsurf_lnd, tsurf_ice, cmm_ocn, cmm_lnd, cmm_ice, & - chh_ocn, chh_lnd, chh_ice, gflx_ocn, gflx_lnd, gflx_ice, ep1d_ocn, ep1d_lnd, ep1d_ice, weasd_lnd, weasd_ice, snowd_ocn, & - snowd_lnd, snowd_ice,tprcp_ocn, tprcp_lnd, tprcp_ice, evap_ocn, evap_lnd, evap_ice, hflx_ocn, hflx_lnd, hflx_ice, & - qss_ocn, qss_lnd, qss_ice, tsfc_ocn, tsfc_lnd, tsfc_ice + chh_ocn, chh_lnd, chh_ice, gflx_ocn, gflx_lnd, gflx_ice, ep1d_ocn, ep1d_lnd, ep1d_ice, weasd_ocn, weasd_lnd, weasd_ice, & + snowd_ocn, snowd_lnd, snowd_ice,tprcp_ocn, tprcp_lnd, tprcp_ice, evap_ocn, evap_lnd, evap_ice, hflx_ocn, hflx_lnd, & + hflx_ice, qss_ocn, qss_lnd, qss_ice, tsfc_ocn, tsfc_lnd, tsfc_ice real(kind=kind_phys), dimension(im), intent(inout) :: zorl, zorlo, zorll, cd, cdq, rb, stress, ffmm, ffhh, uustar, fm10, & fh2, tsurf, cmm, chh, gflx, ep1d, weasd, snowd, tprcp, evap, hflx, qss, tsfc, tsfco, tsfcl, tisfc + real(kind=kind_phys), dimension(im), intent(in ) :: tice ! interstitial sea ice temperature + real(kind=kind_phys), dimension(im), intent(inout) :: hice, cice + character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg + ! Local variables integer :: i + real(kind=kind_phys) :: txl, txi, txo ! Initialize CCPP error handling variables errmsg = '' @@ -323,155 +371,174 @@ subroutine GFS_surface_composites_post_run ( ! --- generate ocean/land/ice composites - ! DH* - !write(0,*) "DH DEBUG composites: i, cplflx, flag_cice, dry, wet, icy, ocnfrac, lndfrac, lakfrac, cice, tsfc_{lnd,ocn,ice}, tsfc, tsfcl, tsfco, tisfc" - ! *DH - - do i=1, im - - ! --- three-way composites (fields from sfc_diff) - zorl(i) = cmposit3(ocnfrac(i), lndfrac(i), & - lakfrac(i),cice(i), & - zorl_ocn(i), zorl_lnd(i), zorl_ice(i)) - cd(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - cd_ocn(i), cd_lnd(i), cd_ice(i)) - cdq(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - cdq_ocn(i), cdq_lnd(i), cdq_ice(i)) - rb(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - rb_ocn(i), rb_lnd(i), rb_ice(i)) - stress(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - stress_ocn(i),stress_lnd(i),stress_ice(i)) - ffmm(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - ffmm_ocn(i), ffmm_lnd(i), ffmm_ice(i)) - ffhh(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - ffhh_ocn(i), ffhh_lnd(i), ffhh_ice(i)) - uustar(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - uustar_ocn(i),uustar_lnd(i),uustar_ice(i)) - fm10(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - fm10_ocn(i), fm10_lnd(i), fm10_ice(i)) - fh2(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - fh2_ocn(i), fh2_lnd(i), fh2_ice(i)) - tsurf(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - tsurf_ocn(i), tsurf_lnd(i), tsurf_ice(i)) - cmm(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - cmm_ocn(i), cmm_lnd(i), cmm_ice(i)) - chh(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - chh_ocn(i), chh_lnd(i), chh_ice(i)) - gflx(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - gflx_ocn(i), gflx_lnd(i), gflx_ice(i)) - ep1d(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - ep1d_ocn(i), ep1d_lnd(i), ep1d_ice(i)) - weasd(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - weasd(i), weasd_lnd(i), weasd_ice(i)) - snowd(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - snowd_ocn(i), snowd_lnd(i), snowd_ice(i)) - tprcp(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - tprcp_ocn(i), tprcp_lnd(i), tprcp_ice(i)) - - if(cplflx .and. flag_cice(i)) then ! 3-way when sfc_cice is used - evap(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - evap_ocn(i), evap_lnd(i), evap_ice(i)) - hflx(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - hflx_ocn(i), hflx_lnd(i), hflx_ice(i)) - qss(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - qss_ocn(i), qss_lnd(i), qss_ice(i)) - tsfc(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - tsfc_ocn(i), tsfc_lnd(i), tsfc_ice(i)) - else ! 2-way when sfc_sice used (fields already composited in sfc_sice) - evap(i) = cmposit2(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - evap_ocn(i), evap_lnd(i), evap_ice(i)) - hflx(i) = cmposit2(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - hflx_ocn(i), hflx_lnd(i), hflx_ice(i)) - qss(i) = cmposit2(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - qss_ocn(i), qss_lnd(i), qss_ice(i)) - tsfc(i) = cmposit2(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - tsfc_ocn(i), tsfc_lnd(i), tsfc_ice(i)) - if(icy(i)) then - cmm(i) = cmm_ice(i) - chh(i) = chh_ice(i) - gflx(i) = gflx_ice(i) - ep1d(i) = ep1d_ice(i) - weasd(i) = weasd_ice(i) - snowd(i) = snowd_ice(i) + if (frac_grid) then + + do i=1, im + + ! Three-way composites (fields from sfc_diff) + txl = landfrac(i) + txi = cice(i) ! here cice is grid fraction that is ice + txo = 1.0 - txl - txi + + zorl(i) = txl*zorl_lnd(i) + txi*zorl_ice(i) + txo*zorl_ocn(i) + cd(i) = txl*cd_lnd(i) + txi*cd_ice(i) + txo*cd_ocn(i) + cdq(i) = txl*cdq_lnd(i) + txi*cdq_ice(i) + txo*cdq_ocn(i) + rb(i) = txl*rb_lnd(i) + txi*rb_ice(i) + txo*rb_ocn(i) + stress(i) = txl*stress_lnd(i) + txi*stress_ice(i) + txo*stress_ocn(i) + ffmm(i) = txl*ffmm_lnd(i) + txi*ffmm_ice(i) + txo*ffmm_ocn(i) + ffhh(i) = txl*ffhh_lnd(i) + txi*ffhh_ice(i) + txo*ffhh_ocn(i) + uustar(i) = txl*uustar_lnd(i) + txi*uustar_ice(i) + txo*uustar_ocn(i) + fm10(i) = txl*fm10_lnd(i) + txi*fm10_ice(i) + txo*fm10_ocn(i) + fh2(i) = txl*fh2_lnd(i) + txi*fh2_ice(i) + txo*fh2_ocn(i) + !tsurf(i) = txl*tsurf_lnd(i) + txi*tice(i) + txo*tsurf_ocn(i) + !tsurf(i) = txl*tsurf_lnd(i) + txi*tsurf_ice(i) + txo*tsurf_ocn(i) ! not used again! Moorthi + cmm(i) = txl*cmm_lnd(i) + txi*cmm_ice(i) + txo*cmm_ocn(i) + chh(i) = txl*chh_lnd(i) + txi*chh_ice(i) + txo*chh_ocn(i) + gflx(i) = txl*gflx_lnd(i) + txi*gflx_ice(i) + txo*gflx_ocn(i) + ep1d(i) = txl*ep1d_lnd(i) + txi*ep1d_ice(i) + txo*ep1d_ocn(i) + !weasd(i) = txl*weasd_lnd(i) + txi*weasd_ice(i) + txo*weasd_ocn(i) + !snowd(i) = txl*snowd_lnd(i) + txi*snowd_ice(i) + txo*snowd_ocn(i) + weasd(i) = txl*weasd_lnd(i) + txi*weasd_ice(i) + snowd(i) = txl*snowd_lnd(i) + txi*snowd_ice(i) + tprcp(i) = txl*tprcp_lnd(i) + txi*tprcp_ice(i) + txo*tprcp_ocn(i) + evap(i) = txl*evap_lnd(i) + txi*evap_ice(i) + txo*evap_ocn(i) + hflx(i) = txl*hflx_lnd(i) + txi*hflx_ice(i) + txo*hflx_ocn(i) + qss(i) = txl*qss_lnd(i) + txi*qss_ice(i) + txo*qss_ocn(i) + tsfc(i) = txl*tsfc_lnd(i) + txi*tice(i) + txo*tsfc_ocn(i) + !tsfc(i) = txl*tsfc_lnd(i) + txi*tsfc_ice(i) + txo*tsfc_ocn(i) + + zorll(i) = zorl_lnd(i) + zorlo(i) = zorl_ocn(i) + + if (dry(i)) tsfcl(i) = tsfc_lnd(i) ! over land + if (wet(i)) tsfco(i) = tsfc_ocn(i) ! over lake or ocean when uncoupled + tisfc(i) = tsfc(i) ! assume bitwise identical on non-icy points + if (icy(i)) then + tisfc(i) = tsfc_ice(i) ! over ice when uncoupled +! tisfc(i) = tice(i) ! over ice when uncoupled + else + hice(i) = 0.0 + cice(i) = 0.0 end if - endif ! cplflx .and. flag_cice - - zorll(i) = zorl_lnd(i) - zorlo(i) = zorl_ocn(i) - if (dry(i)) tsfcl(i) = tsfc_lnd(i) - if (wet(i)) then - tsfco(i) = tsfc_ocn(i) - tisfc(i) = tsfc_ice(i) - end if - - ! DH* - !write(0,'(i5,5(1x,l),11e16.7)') i, cplflx, flag_cice(i), dry(i), wet(i), icy(i), & - ! ocnfrac(i), lndfrac(i), lakfrac(i), & - ! cice(i), tsfc_lnd(i), tsfc_ocn(i), tsfc_ice(i), & - ! tsfc(i), tsfcl(i), tsfco(i), tisfc(i) - ! *DH - - end do +! if (wet(i) .and. .not. cplflx) then +! tsfco(i) = tsfc3_ocn(i) ! over lake or ocean when uncoupled +! tisfc(i) = tsfc3_ice(i) ! over ice when uncoupled +! endif - ! --- compositing done - - end subroutine GFS_surface_composites_post_run + end do + else - real function cmposit2(frac_ocean,frac_dry,frac_lake,frac_ice,oceanval,landval,iceval) -! --- 2-way compositing (use with ice/non-ice composited variables) - implicit none - real(kind=kind_phys),intent(IN) :: frac_ocean,frac_dry,frac_lake,frac_ice,oceanval,landval,iceval - real(kind=kind_phys) :: frac_wet + do i=1,im + if (islmsk(i) == 1) then + zorl(i) = zorl_lnd(i) + cd(i) = cd_lnd(i) + cdq(i) = cdq_lnd(i) + rb(i) = rb_lnd(i) + stress(i) = stress_lnd(i) + ffmm(i) = ffmm_lnd(i) + ffhh(i) = ffhh_lnd(i) + uustar(i) = uustar_lnd(i) + fm10(i) = fm10_lnd(i) + fh2(i) = fh2_lnd(i) + !tsurf(i) = tsurf_lnd(i) + cmm(i) = cmm_lnd(i) + chh(i) = chh_lnd(i) + gflx(i) = gflx_lnd(i) + ep1d(i) = ep1d_lnd(i) + weasd(i) = weasd_lnd(i) + snowd(i) = snowd_lnd(i) + tprcp(i) = tprcp_lnd(i) + evap(i) = evap_lnd(i) + hflx(i) = hflx_lnd(i) + qss(i) = qss_lnd(i) + tsfc(i) = tsfc_lnd(i) + cmm(i) = cmm_lnd(i) + chh(i) = chh_lnd(i) + elseif (islmsk(i) == 0) then + zorl(i) = zorl_ocn(i) + cd(i) = cd_ocn(i) + cdq(i) = cdq_ocn(i) + rb(i) = rb_ocn(i) + stress(i) = stress_ocn(i) + ffmm(i) = ffmm_ocn(i) + ffhh(i) = ffhh_ocn(i) + uustar(i) = uustar_ocn(i) + fm10(i) = fm10_ocn(i) + fh2(i) = fh2_ocn(i) + !tsurf(i) = tsurf_ocn(i) + cmm(i) = cmm_ocn(i) + chh(i) = chh_ocn(i) + gflx(i) = gflx_ocn(i) + ep1d(i) = ep1d_ocn(i) + weasd(i) = weasd_ocn(i) + snowd(i) = snowd_ocn(i) + tprcp(i) = tprcp_ocn(i) + evap(i) = evap_ocn(i) + hflx(i) = hflx_ocn(i) + qss(i) = qss_ocn(i) + tsfc(i) = tsfc_ocn(i) + cmm(i) = cmm_ocn(i) + chh(i) = chh_ocn(i) + else + zorl(i) = zorl_ice(i) + cd(i) = cd_ice(i) + cdq(i) = cdq_ice(i) + rb(i) = rb_ice(i) + stress(i) = stress_ice(i) + ffmm(i) = ffmm_ice(i) + ffhh(i) = ffhh_ice(i) + uustar(i) = uustar_ice(i) + fm10(i) = fm10_ice(i) + fh2(i) = fh2_ice(i) + !tsurf(i) = tsurf_ice(i) + cmm(i) = cmm_ice(i) + chh(i) = chh_ice(i) + gflx(i) = gflx_ice(i) + ep1d(i) = ep1d_ice(i) + weasd(i) = weasd_ice(i) + snowd(i) = snowd_ice(i) + tprcp(i) = tprcp_ice(i) + evap(i) = evap_ice(i) + hflx(i) = hflx_ice(i) + qss(i) = qss_ice(i) + tsfc(i) = tsfc_ice(i) + cmm(i) = cmm_ice(i) + chh(i) = chh_ice(i) + endif + + zorll(i) = zorl_lnd(i) + zorlo(i) = zorl_ocn(i) + + if (flag_cice(i)) then + evap(i) = cice(i) * evap_ice(i) + (1.0-cice(i)) * evap_ocn(i) + hflx(i) = cice(i) * hflx_ice(i) + (1.0-cice(i)) * hflx_ocn(i) + tsfc(i) = cice(i) * tsfc_ice(i) + (1.0-cice(i)) * tsfc_ocn(i) + endif + + if (dry(i)) tsfcl(i) = tsfc_lnd(i) ! over land + if (wet(i)) tsfco(i) = tsfc_ocn(i) ! over lake or ocean when uncoupled + tisfc(i) = tsfc(i) ! assume bitwise identical on non-icy points + if (icy(i)) then +! tisfc(i) = tsfc_ice(i) ! over ice when uncoupled + tisfc(i) = tice(i) ! over ice when uncoupled + else + hice(i) = 0.0 + cice(i) = 0.0 + end if - frac_wet=max(frac_lake,frac_ocean) - if (frac_ice.eq.0.) then - cmposit2 = frac_dry*landval + frac_wet*oceanval - else - cmposit2 = frac_dry*landval + frac_wet*iceval - end if - return - end function cmposit2 +! if (wet(i) .and. .not. cplflx) then +! tsfco(i) = tsfc_ocn(i) ! over lake or ocean when uncoupled +! tisfc(i) = tsfc_ice(i) ! over ice when uncoupled +! endif + end do - real function cmposit3(frac_ocean,frac_dry,frac_lake,frac_ice,oceanval,landval,iceval) -! --- 3-way compositing - implicit none - real(kind=kind_phys),intent(IN) :: frac_ocean,frac_dry,frac_lake,frac_ice,oceanval,landval,iceval + end if ! if (frac_grid) - if (frac_dry == 0.0 .and. iceval == oceanval) then - cmposit3 = oceanval - else - cmposit3 = frac_dry*landval + frac_ice*iceval + (1.-frac_dry-frac_ice)*oceanval - endif + ! --- compositing done - return - end function cmposit3 + end subroutine GFS_surface_composites_post_run end module GFS_surface_composites_post diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index 42fe8c646..5504eb7cd 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -243,7 +243,8 @@ end subroutine GFS_surface_generic_post_finalize !! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | !! | cplwav | flag_for_wave_coupling | flag controlling cplwav collection (default off) | flag | 0 | logical | | in | F | !! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | -!! | lndfrac | land_area_fraction | fraction of horizontal grid area occupied by land | frac | 1 | real | kind_phys | in | F | +!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | +!! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | !! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | !! | ep1d | surface_upward_potential_latent_heat_flux | surface upward potential latent heat flux | W m-2 | 1 | real | kind_phys | in | F | !! | gflx | upward_heat_flux_in_soil | upward soil heat flux | W m-2 | 1 | real | kind_phys | in | F | @@ -327,7 +328,7 @@ end subroutine GFS_surface_generic_post_finalize !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! #endif - subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, lndfrac, dtf, ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, & + subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, icy, wet, dtf, ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1,& adjsfcdlw, adjsfcdsw, adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & t2m, q2m, u10m, v10m, tsfc, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf, & epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, & @@ -340,11 +341,10 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, lndfrac, dtf implicit none - integer, intent(in) :: im - logical, intent(in) :: cplflx, cplwav, lssav - real(kind=kind_phys), dimension(im), intent(in) :: lndfrac - - real(kind=kind_phys), intent(in) :: dtf + integer, intent(in) :: im + logical, intent(in) :: cplflx, cplwav, lssav + logical, dimension(im), intent(in) :: icy, wet + real(kind=kind_phys), intent(in) :: dtf real(kind=kind_phys), dimension(im), intent(in) :: ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, adjsfcdlw, adjsfcdsw, & adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & @@ -362,7 +362,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, lndfrac, dtf character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - real(kind=kind_phys), parameter :: albdf = 0.06 + real(kind=kind_phys), parameter :: albdf = 0.06d0 integer :: i real(kind=kind_phys) :: tem, xcosz_loc, ocalnirdf_cpl, ocalnirbm_cpl, ocalvisdf_cpl, ocalvisbm_cpl @@ -413,7 +413,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, lndfrac, dtf ! them to net SW heat fluxes do i=1,im - if(lndfrac(i) < 1.) then ! Not 100% land + if (wet(i) .or. icy(i)) then ! not 100% land ! --- compute open water albedo xcosz_loc = max( 0.0, min( 1.0, xcosz(i) )) ocalnirdf_cpl = 0.06 diff --git a/physics/cldmacro.F b/physics/cldmacro.F index 086277f0e..a2d5aeb70 100644 --- a/physics/cldmacro.F +++ b/physics/cldmacro.F @@ -625,8 +625,10 @@ subroutine fix_up_clouds_2M(QV, TE, QLC, QIC, CF, QLA, QIA, AF, & real, intent(inout) :: TE,QV,QLC,CF,QLA,AF,QIC,QIA, NL, NI ! real, parameter :: qmin = 1.0e-8, qmini = 1.0e-7 - real, parameter :: nmin = 1.0e-3, cfmin = 1.0e-5 +! real, parameter :: nmin = 1.0e-3, cfmin = 1.0e-5 + real, parameter :: nmin = 1.0, cfmin = 1.0e-5 &, RI_cub = 6.4e-14, RL_cub = 1.0e-15 + &, fourb3 = 4.0/3.0 if (AF <= cfmin) then ! Fix if Anvil cloud fraction too small QV = QV + QLA + QIA @@ -687,13 +689,13 @@ subroutine fix_up_clouds_2M(QV, TE, QLC, QIC, CF, QLA, QIA, AF, & if (QLA+QLC <= qc_min(1)) then NL = 0.0 elseif (NL <= nmin) then ! make sure NL > 0 if Q >0 - NL = max((QLA+QLC)/( 1.333 * MAPL_PI *RL_cub*997.0), nmin) + NL = max((QLA+QLC)/( fourb3 * MAPL_PI *RL_cub*997.0), nmin) endif if (QIA+QIC <= qc_min(2)) then NI = 0.0 elseif (NI <= nmin) then ! make sure NI > 0 if Q >0 - NI = max((QIA+QIC)/( 1.333 * MAPL_PI *RI_cub*500.0), nmin) + NI = max((QIA+QIC)/( fourb3 * MAPL_PI *RI_cub*500.0), nmin) endif end subroutine fix_up_clouds_2M diff --git a/physics/cs_conv.F90 b/physics/cs_conv.F90 index d5c2e1011..2d88200c3 100644 --- a/physics/cs_conv.F90 +++ b/physics/cs_conv.F90 @@ -209,9 +209,9 @@ module cs_conv ! spblcrit=0.03, & !< minimum cloudbase height in p/ps ! spblcrit=0.035,& !< minimum cloudbase height in p/ps ! spblcrit=0.025,& !< minimum cloudbase height in p/ps - cincrit=-150.0 -! cincrit=-120.0 -! cincrit=-100.0 + cincrit= 150.0 +! cincrit= 120.0 +! cincrit= 100.0 !DD precz0 and preczh control partitioning of water between detrainment !DD and precipitation. Decrease for more precip @@ -390,15 +390,15 @@ subroutine cs_conv_run(IM , IJSDIM , KMAX , ntracp1 , NN, & ! ! input arguments ! - INTEGER, INTENT(IN) :: IM,IJSDIM, KMAX, ntracp1, NN, NTR, mype, nctp, mp_phys, kdt, lat !! DD, for GFS, pass in - logical, intent(in) :: otspt(ntracp1,2) ! otspt(:,1) - on/off switch for tracer transport by updraft and - ! downdraft. should not include subgrid PDF and turbulence - ! otspt(:,2) - on/off switch for tracer transport by subsidence - ! should include subgrid PDF and turbulence + INTEGER, INTENT(IN) :: IM,IJSDIM, KMAX, ntracp1, nn, NTR, mype, nctp, mp_phys, kdt, lat !! DD, for GFS, pass in + logical, intent(in) :: otspt(1:ntracp1,1:2)! otspt(:,1) - on/off switch for tracer transport by updraft and + ! downdraft. should not include subgrid PDF and turbulence + ! otspt(:,2) - on/off switch for tracer transport by subsidence + ! should include subgrid PDF and turbulence real(r8), intent(inout) :: t(IM,KMAX) ! temperature at mid-layer (K) real(r8), intent(inout) :: q(IM,KMAX) ! water vapor array including moisture (kg/kg) - real(r8), intent(inout) :: clw(IM,KMAX,NN) ! tracer array including cloud condensate (kg/kg) + real(r8), intent(inout) :: clw(IM,KMAX,nn) ! tracer array including cloud condensate (kg/kg) real(r8), intent(in) :: pap(IM,KMAX) ! pressure at mid-layer (Pa) real(r8), intent(in) :: paph(IM,KMAX+1) ! pressure at boundaries (Pa) real(r8), intent(in) :: zm(IM,KMAX) ! geopotential at mid-layer (m) @@ -1177,7 +1177,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions ENDDO DO I=ISTS,IENS IF (JBUOY(I) /= 2) CIN(I) = -999.D0 - if (cin(i) < cincrit) kb(i) = -1 + if (cin(i) > cincrit) kb(i) = -1 ENDDO !DDsigma some initialization before summing over cloud type diff --git a/physics/cs_conv_aw_adj.F90 b/physics/cs_conv_aw_adj.F90 index 08d3f4516..82807dbdd 100644 --- a/physics/cs_conv_aw_adj.F90 +++ b/physics/cs_conv_aw_adj.F90 @@ -45,6 +45,8 @@ end subroutine cs_conv_aw_adj_finalize !! | cldfrac | cloud_fraction_for_MG | cloud fraction used by Morrison-Gettelman MP | frac | 2 | real | kind_phys | inout | F | !! | subcldfrac | subgrid_scale_cloud_fraction_from_shoc | subgrid-scale cloud fraction from the SHOC scheme | frac | 2 | real | kind_phys | inout | F | !! | prcp | lwe_thickness_of_explicit_precipitation_amount | explicit precipitation (rain, ice, snow, graupel, ...) on physics timestep | m | 1 | real | kind_phys | inout | F | +!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! @@ -52,7 +54,7 @@ end subroutine cs_conv_aw_adj_finalize subroutine cs_conv_aw_adj_run(im, levs, do_cscnv, do_aw, do_shoc, & ntrac, ncld, ntcw, ntclamt, nncl, con_g, sigmafrac, & gt0, gq0, save_t, save_q, prsi, cldfrac, subcldfrac, & - prcp, errmsg, errflg) + prcp, imp_physics, imp_physics_mg, errmsg, errflg) use machine, only: kind_phys @@ -72,6 +74,7 @@ subroutine cs_conv_aw_adj_run(im, levs, do_cscnv, do_aw, do_shoc, & real(kind_phys), dimension(im,levs), intent(inout) :: cldfrac real(kind_phys), dimension(im,levs), intent(inout) :: subcldfrac real(kind_phys), dimension(im), intent(inout) :: prcp + integer, intent(in ) :: imp_physics, imp_physics_mg character(len=*), intent( out) :: errmsg integer, intent( out) :: errflg @@ -109,6 +112,14 @@ subroutine cs_conv_aw_adj_run(im, levs, do_cscnv, do_aw, do_shoc, & temrain1(i) = temrain1(i) - (prsi(i,k)-prsi(i,k+1)) * tem2 * onebg enddo enddo +! add convective clouds if shoc is true and not MG microphysics + if (do_shoc .and. imp_physics /= imp_physics_mg) then + do k = 1,levs + do i = 1,im + subcldfrac(i,k) = min(1.0, subcldfrac(i,k) + sigmafrac(i,k)) + enddo + enddo + endif ! do n=ntcw,ntcw+nncl-1 do k = 1,levs diff --git a/physics/dcyc2.f b/physics/dcyc2.f index a6f699fa2..5844e7371 100644 --- a/physics/dcyc2.f +++ b/physics/dcyc2.f @@ -51,7 +51,7 @@ end subroutine dcyc2t3_finalize ! sfcdsw,sfcnsw,sfcdlw,swh,swhc,hlw,hlwc, ! ! sfcnirbmu,sfcnirdfu,sfcvisbmu,sfcvisdfu, ! ! sfcnirbmd,sfcnirdfd,sfcvisbmd,sfcvisdfd, ! -! ix, im, levs, ! +! ix, im, levs, deltim, fhswr, ! ! input/output: ! ! dtdt,dtdtc, ! ! outputs: ! @@ -90,6 +90,8 @@ end subroutine dcyc2t3_finalize ! sfcvisdfd(im)- real, tot sky sfc uv+vis-diff sw dnward flux (w/m2)! ! ix, im - integer, horiz. dimention and num of used points ! ! levs - integer, vertical layer dimension ! +! deltim - real, physics time step in seconds ! +! fhswr - real, Short wave radiation time step in seconds ! ! ! ! input/output: ! ! dtdt(im,levs)- real, model time step adjusted total radiation ! @@ -154,6 +156,9 @@ end subroutine dcyc2t3_finalize !! spectral component fluxes !!- Oct 2014 y. hous s. moorthi - add emissivity contribution to !! upward longwave flux +!!- Mar 2019 s. moorthi - modify xmu calculation in a time centered +!! way and add more accuracy when physics +!! time step is close to radiation time step !> \section arg_table_dcyc2t3_run Argument Table !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |----------------|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| @@ -188,6 +193,7 @@ end subroutine dcyc2t3_finalize !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | !! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | !! | deltim | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | +!! | fhswr | frequency_for_shortwave_radiation | frequency for shortwave radiation | s | 0 | real | kind_phys | in | F | !! | dtdt | tendency_of_air_temperature_due_to_model_physics | total radiative heating rate at current time | K s-1 | 2 | real | kind_phys | inout | F | !! | dtdtc | tendency_of_air_temperature_due_to_radiative_heating_assuming_clear_sky | clear sky radiative (shortwave + longwave) heating rate at current time | K s-1 | 2 | real | kind_phys | inout | F | !! | adjsfcdsw | surface_downwelling_shortwave_flux | surface downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | out | F | @@ -215,7 +221,7 @@ subroutine dcyc2t3_run & & sfcdsw,sfcnsw,sfcdlw,swh,swhc,hlw,hlwc, & & sfcnirbmu,sfcnirdfu,sfcvisbmu,sfcvisdfu, & & sfcnirbmd,sfcnirdfd,sfcvisbmd,sfcvisdfd, & - & ix, im, levs, deltim, & + & ix, im, levs, deltim, fhswr, & & dtdt,dtdtc, & ! --- input/output: & adjsfcdsw,adjsfcnsw,adjsfcdlw,adjsfculw,xmu,xcosz, & ! --- outputs: & adjnirbmu,adjnirdfu,adjvisbmu,adjvisdfu, & @@ -229,15 +235,18 @@ subroutine dcyc2t3_run & implicit none ! ! --- constant parameters: - real(kind=kind_phys), parameter :: f_eps = 0.0001, hour12 = 12.0,& - & f7200 = 1.0/7200.0, & + real(kind=kind_phys), parameter :: f_eps = 0.0001_kind_phys, & + & hour12 = 12.0_kind_phys, & + & f3600 = 1.0/3600.0_kind_phys, & + & f7200 = 1.0/7200.0_kind_phys, & + & czlimt = 0.0001_kind_phys, & ! ~ cos(89.99427) & pid12 = con_pi / hour12 ! --- inputs: integer, intent(in) :: ix, im, levs real(kind=kind_phys), intent(in) :: solhr, slag, cdec, sdec, & - & deltim + & deltim, fhswr real(kind=kind_phys), dimension(im), intent(in) :: & & sinlat, coslat, xlon, coszen, tsea, tf, tsflw, sfcdlw, & @@ -262,16 +271,51 @@ subroutine dcyc2t3_run & integer, intent(out) :: errflg ! --- locals: - integer :: i, k - real(kind=kind_phys) :: cns, ss, cc, ch, tem1, tem2 + integer :: i, k, nstp, nstl, it, istsun(im) + real(kind=kind_phys) :: cns, coszn, tem1, tem2, anginc, & + & rstl, solang ! !===> ... begin here ! ! Initialize CCPP error handling variables errmsg = '' errflg = 0 + + tem1 = fhswr / deltim + nstp = max(6, nint(tem1)) + nstl = max(1, nint(nstp/tem1)) ! - cns = pid12 * (solhr + deltim*f7200 - hour12) + slag +! --- ... sw time-step adjustment for current cosine of zenith angle +! ---------------------------------------------------------- + if (nstl == 1) then + cns = pid12 * (solhr + deltim*f7200 - hour12) + slag + do i = 1, IM + xcosz(i) = sdec*sinlat(i) + cdec*coslat(i)*cos(cns+xlon(i)) + enddo + elseif (nstl == nstp) then + do i = 1, IM + xcosz(i) = coszen(i) + enddo + else + rstl = 1.0 / float(nstl) + solang = pid12 * (solhr - hour12) + anginc = pid12 * deltim * f3600 * rstl + do i = 1, im + xcosz(i) = 0.0 + istsun(i) = 0.0 + enddo + do it=1,nstl + cns = solang + (float(it)-0.5)*anginc + slag + do i = 1, IM + coszn = sdec*sinlat(i) + cdec*coslat(i)*cos(cns+xlon(i)) + xcosz(i) = xcosz(i) + max(0.0, coszn) + if (coszn > czlimt) istsun(i) = istsun(i) + 1 + enddo + enddo + do i = 1, IM + if (istsun(i) > 0) xcosz(i) = xcosz(i) / istsun(i) ! mean cosine of solar zenith angle at current time + enddo + endif ! do i = 1, im @@ -289,15 +333,8 @@ subroutine dcyc2t3_run & adjsfculw(i) = sfcemis(i) * con_sbc * tem2 * tem2 & + (1.0 - sfcemis(i)) * adjsfcdlw(i) ! -!> - SW time-step adjustment: - - ss = sinlat(i) * sdec - cc = coslat(i) * cdec - ch = cc * cos( xlon(i)+cns ) - xcosz(i) = ch + ss ! cosine of solar zenith angle at current time !> - normalize by average value over radiation period for daytime. - if ( xcosz(i) > f_eps .and. coszen(i) > f_eps ) then xmu(i) = xcosz(i) / coszen(i) else diff --git a/physics/docs/pdftxt/CPT_adv_suite.txt b/physics/docs/pdftxt/CPT_adv_suite.txt index fa9801e07..1edb934a2 100644 --- a/physics/docs/pdftxt/CPT_adv_suite.txt +++ b/physics/docs/pdftxt/CPT_adv_suite.txt @@ -118,7 +118,6 @@ The advanced CPT physics suite uses the parameterizations in the following order m_micro_post cs_conv_aw_adj GFS_MP_generic_post - sfc_sice_post diff --git a/physics/docs/pdftxt/GFSv14_suite.txt b/physics/docs/pdftxt/GFSv14_suite.txt index 138de59e6..25e03e7fd 100644 --- a/physics/docs/pdftxt/GFSv14_suite.txt +++ b/physics/docs/pdftxt/GFSv14_suite.txt @@ -106,7 +106,6 @@ The GFS v14 suite uses the parameterizations in the following order, as defined zhaocarr_gscond zhaocarr_precpd GFS_MP_generic_post - sfc_sice_post maximum_hourly_diagnostics diff --git a/physics/docs/pdftxt/GFSv15_suite.txt b/physics/docs/pdftxt/GFSv15_suite.txt index cf7e68068..821ca9680 100644 --- a/physics/docs/pdftxt/GFSv15_suite.txt +++ b/physics/docs/pdftxt/GFSv15_suite.txt @@ -126,7 +126,6 @@ The GFSv15 suite uses the parameterizations in the following order, as defined i GFS_MP_generic_pre gfdl_cloud_microphys GFS_MP_generic_post - sfc_sice_post maximum_hourly_diagnostics diff --git a/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt b/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt index 3b0868cec..a60f3b3b6 100644 --- a/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt +++ b/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt @@ -113,7 +113,6 @@ The GFSv15plus suite uses the parameterizations in the following order, as defin GFS_MP_generic_pre gfdl_cloud_microphys GFS_MP_generic_post - sfc_sice_post maximum_hourly_diagnostics diff --git a/physics/gcm_shoc.F90 b/physics/gcm_shoc.F90 index f2c9b7a7b..dff067893 100644 --- a/physics/gcm_shoc.F90 +++ b/physics/gcm_shoc.F90 @@ -33,7 +33,7 @@ end subroutine shoc_finalize !! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_zhao_carr | flag_for_zhao_carr_microphysics_scheme | choice of Zhao-Carr microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_zhao_carr_pdf | flag_for_zhao_carr_pdf_microphysics_scheme | choice of Zhao-Carr microphysics scheme with PDF clouds | flag | 0 | integer | | in | F | -!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman rmicrophysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | !! | fprcp | number_of_frozen_precipitation_species | number of frozen precipitation species | count | 0 | integer | | in | F | !! | tcr | cloud_phase_transition_threshold_temperature | threshold temperature below which cloud starts to freeze | K | 0 | real | kind_phys | in | F | !! | tcrf | cloud_phase_transition_denominator | denominator in cloud phase transition = 1/(tcr-tf) | K-1 | 0 | real | kind_phys | in | F | @@ -110,7 +110,7 @@ subroutine shoc_run (ix, nx, nzm, do_shoc, shocaftcnv, mg3_as_mg2, imp_physics, character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - real(kind=kind_phys), parameter :: epsq = 1.e-20 + real(kind=kind_phys), parameter :: epsq = 1.d-20 integer :: i, k @@ -125,7 +125,6 @@ subroutine shoc_run (ix, nx, nzm, do_shoc, shocaftcnv, mg3_as_mg2, imp_physics, if (shocaftcnv) then if (imp_physics == imp_physics_mg) then - skip_macro = do_shoc if (abs(fprcp) == 1 .or. mg3_as_mg2) then do k=1,nzm do i=1,nx @@ -147,11 +146,10 @@ subroutine shoc_run (ix, nx, nzm, do_shoc, shocaftcnv, mg3_as_mg2, imp_physics, endif else if (imp_physics == imp_physics_mg) then - skip_macro = do_shoc do k=1,nzm do i=1,nx - ! DH* THESE ARE NOT IN THE ORIGINAL CODE (AND THEY WERE NEVER) ::: clw_ice(i,k) = gq0_cloud_ice(i,k) ! ice - ! DH* THESE ARE NOT IN THE ORIGINAL CODE (AND THEY WERE NEVER) ::: clw_liquid(i,k) = gq0_cloud_liquid(i,k) ! water + !clw_ice(i,k) = gq0_cloud_ice(i,k) ! ice + !clw_liquid(i,k) = gq0_cloud_liquid(i,k) ! water !GF - since gq0(ntlnc/ntinc) are passed in directly, no need to copy !ncpl(i,k) = Stateout%gq0(i,k,ntlnc) !ncpi(i,k) = Stateout%gq0(i,k,ntinc) @@ -172,7 +170,7 @@ subroutine shoc_run (ix, nx, nzm, do_shoc, shocaftcnv, mg3_as_mg2, imp_physics, !qrn(i,k) = gq0_rain(i,k) qsnw(i,k) = gq0_snow(i,k) + gq0_graupel(i,k) qgl(i,k) = 0.0 - clw_ice(i,k) = clw_ice(i,k) + gq0_graupel(i,k) + !clw_ice(i,k) = clw_ice(i,k) + gq0_graupel(i,k) enddo enddo endif @@ -221,18 +219,18 @@ subroutine shoc_run (ix, nx, nzm, do_shoc, shocaftcnv, mg3_as_mg2, imp_physics, cld_sgs, tke, hflx, evap, prnum, tkh, wthv_sec, .false., 1, ncpl, ncpi, & con_cp, con_g, con_hvap, con_hfus, con_rv, con_rd, con_pi, con_fvirt) - if (.not.shocaftcnv) then - if (imp_physics == imp_physics_mg .and. fprcp > 1) then - do k=1,nzm - do i=1,nx - clw_ice(i,k) = clw_ice(i,k) - gq0_graupel(i,k) - enddo - enddo - endif - endif ! .not. shocaftcnv + !if (.not.shocaftcnv) then + ! if (imp_physics == imp_physics_mg .and. fprcp > 1) then + ! do k=1,nzm + ! do i=1,nx + ! clw_ice(i,k) = clw_ice(i,k) - gq0_graupel(i,k) + ! enddo + ! enddo + ! endif + !endif ! .not. shocaftcnv !GF since gq0(ntlnc/ntinc) are passed in directly, no need to copy back - ! if (ntlnc > 0 .and. ntinc > 0 .and. ncld >= 2) then + ! if (imp_physics == Model%imp_physics_mg) then ! do k=1,nzm ! do i=1,nx ! Stateout%gq0(i,k,ntlnc) = ncpl(i,k) diff --git a/physics/gfdl_cloud_microphys.F90 b/physics/gfdl_cloud_microphys.F90 index 3fd83210f..8e6f645ca 100644 --- a/physics/gfdl_cloud_microphys.F90 +++ b/physics/gfdl_cloud_microphys.F90 @@ -159,8 +159,7 @@ end subroutine gfdl_cloud_microphys_finalize !! | phys_hydrostatic | flag_for_hydrostatic_heating_from_physics | flag indicating hydrostatic heating from physics | flag | 0 | logical | | in | F | !! | lradar | flag_for_radar_reflectivity | flag for radar reflectivity | flag | 0 | logical | | in | F | !! | refl_10cm | radar_reflectivity_10cm | instantaneous refl_10cm | dBZ | 2 | real | kind_phys | inout | F | -!! | kdt | index_of_time_step | current forecast iteration | index | 0 | integer | | in | F | -!! | nsteps_per_reset | number_of_time_steps_per_maximum_hourly_time_interval | number_of_time_steps_per_maximum_hourly_time_interval | count | 0 | integer | | in | F | +!! | reset | flag_reset_maximum_hourly_fields | flag for resetting maximum hourly fields | flag | 0 | logical | | in | F | !! | effr_in | flag_for_cloud_effective_radii | flag for cloud effective radii calculations in microphysics | | 0 | logical | | in | F | !! | rew | effective_radius_of_stratiform_cloud_liquid_water_particle_in_um | eff. radius of cloud liquid water particle in micrometer | um | 2 | real | kind_phys | inout | F | !! | rei | effective_radius_of_stratiform_cloud_ice_particle_in_um | eff. radius of cloud ice water particle in micrometer | um | 2 | real | kind_phys | inout | F | @@ -176,7 +175,7 @@ subroutine gfdl_cloud_microphys_run( & gt0, gu0, gv0, vvl, prsl, phii, del, & rain0, ice0, snow0, graupel0, prcp0, sr, & dtp, hydrostatic, phys_hydrostatic, lradar, refl_10cm, & - kdt, nsteps_per_reset, effr_in, rew, rei, rer, res, reg, errmsg, errflg) + reset, effr_in, rew, rei, rer, res, reg, errmsg, errflg) use machine, only: kind_phys @@ -187,11 +186,7 @@ subroutine gfdl_cloud_microphys_run( & real(kind=kind_phys), parameter :: one = 1.0d0 real(kind=kind_phys), parameter :: con_p001= 0.001d0 real(kind=kind_phys), parameter :: con_day = 86400.d0 -#ifdef TRANSITION real(kind=kind_phys), parameter :: rainmin = 1.0d-13 -#else - real(kind=kind_phys), parameter :: rainmin = 1.0e-13 -#endif ! *DH ! interface variables @@ -217,8 +212,7 @@ subroutine gfdl_cloud_microphys_run( & logical, intent (in) :: lradar real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: refl_10cm - integer, intent (in) :: kdt, nsteps_per_reset - logical, intent (in) :: effr_in + logical, intent (in) :: reset, effr_in real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: rew, rei, rer, res, reg character(len=*), intent(out) :: errmsg @@ -237,7 +231,6 @@ subroutine gfdl_cloud_microphys_run( & real(kind=kind_phys), volatile :: volatile_var1, volatile_var2 #endif - ! Initialize CCPP error handling variables errmsg = '' errflg = 0 @@ -298,7 +291,7 @@ subroutine gfdl_cloud_microphys_run( & qv1, ql1, qr1, qi1, qs1, qg1, qa1, qn1, qv_dt, ql_dt, qr_dt, qi_dt, & qs_dt, qg_dt, qa_dt, pt_dt, pt, w, uin, vin, u_dt, v_dt, dz, delp, & garea, dtp, frland, rain0, snow0, ice0, graupel0, hydrostatic, & - phys_hydrostatic, p123, lradar, refl, kdt, nsteps_per_reset) + phys_hydrostatic, p123, lradar, refl, reset) tem = dtp*con_p001/con_day ! fix negative values diff --git a/physics/m_micro.F90 b/physics/m_micro.F90 index f973842f0..2e33ce542 100644 --- a/physics/m_micro.F90 +++ b/physics/m_micro.F90 @@ -20,7 +20,7 @@ module m_micro !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |------------------------|-------------------------------------------------|---------------------------------------------------------------------------------------------|-------------|------|------------|-----------|--------|----------| !! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman rmicrophysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | !! | fprcp | number_of_frozen_precipitation_species | number of frozen precipitation species | count | 0 | integer | | in | F | !! | gravit | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | !! | rair | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | @@ -260,7 +260,7 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & use aer_cloud, only: AerProps, getINsubset,init_aer, & & aerosol_activate,AerConversion1 use cldmacro, only: macro_cloud,meltfrz_inst,update_cld, & - & meltfrz_inst + & meltfrz_inst, fix_up_clouds_2M use cldwat2m_micro,only: mmicro_pcond use micro_mg2_0, only: micro_mg_tend2_0 => micro_mg_tend, qcvar2 => qcvar use micro_mg3_0, only: micro_mg_tend3_0 => micro_mg_tend, qcvar3 => qcvar @@ -284,7 +284,8 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & real, parameter :: one=1.0, oneb3=one/3.0, onebcp=one/cp, & & kapa=rgas*onebcp, cpbg=cp/grav, & & lvbcp=hvap*onebcp, lsbcp=(hvap+hfus)*onebcp,& - qsmall=1.e-14, rainmin = 1.0e-13 + & qsmall=1.e-14, rainmin = 1.0e-13, & + & fourb3=4.0/3.0, RL_cub=1.0e-15, nmin=1.0 integer, parameter :: ncolmicro = 1 integer,intent(in) :: im, ix,lm, ipr, kdt, fprcp, pdfflag @@ -627,6 +628,32 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & DT_MOIST = dt_i dt_r8 = dt_i + if (kdt == 1) then + DO K=1, LM + DO I = 1,IM + CALL fix_up_clouds_2M(Q1(I,K), TEMP(i,k), QLLS(I,K), & + & QILS(I,K), CLLS(I,K), QLCN(I,K), & + & QICN(I,K), CLCN(I,K), NCPL(I,K), & + & NCPI(I,K), qc_min) + if (rnw(i,k) <= qc_min(1)) then + ncpl(i,k) = 0.0 + elseif (ncpl(i,k) <= nmin) then ! make sure NL > 0 if Q >0 + ncpl(i,k) = max(rnw(i,k) / (fourb3 * PI *RL_cub*997.0), nmin) + endif + if (snw(i,k) <= qc_min(2)) then + ncpl(i,k) = 0.0 + elseif (ncps(i,k) <= nmin) then + ncps(i,k) = max(snw(i,k) / (fourb3 * PI *RL_cub*500.0), nmin) + endif + if (qgl(i,k) <= qc_min(2)) then + ncgl(i,k) = 0.0 + elseif (ncgl(i,k) <= nmin) then + ncgl(i,k) = max(qgl(i,k) / (fourb3 * PI *RL_cub*500.0), nmin) + endif + + enddo + enddo + endif do i=1,im KCBL(i) = max(LM-KCBL(i),10) KCT(i) = 10 @@ -1743,15 +1770,39 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & !TVQX1 = SUM( ( Q1 + QL_TOT + QI_TOT(1:im,:,:))*DM, 3) & - if (.not. skip_macro) then + if (skip_macro) then + do k=1,lm + do i=1,im + CALL fix_up_clouds_2M(Q1(I,K), TEMP(i,k), QLLS(I,K), & + & QILS(I,K), CLLS(I,K), QLCN(I,K), & + & QICN(I,K), CLCN(I,K), NCPL(I,K), & + & NCPI(I,K), qc_min) + if (rnw(i,k) <= qc_min(1)) then + ncpl(i,k) = 0.0 + elseif (ncpl(i,k) <= nmin) then ! make sure NL > 0 if Q >0 + ncpl(i,k) = max(rnw(i,k) / (fourb3 * PI *RL_cub*997.0), nmin) + endif + if (snw(i,k) <= qc_min(2)) then + ncpl(i,k) = 0.0 + elseif (ncps(i,k) <= nmin) then + ncps(i,k) = max(snw(i,k) / (fourb3 * PI *RL_cub*500.0), nmin) + endif + if (qgl(i,k) <= qc_min(2)) then + ncgl(i,k) = 0.0 + elseif (ncgl(i,k) <= nmin) then + ncgl(i,k) = max(qgl(i,k) / (fourb3 * PI *RL_cub*500.0), nmin) + endif + enddo + enddo + else do k=1,lm do i=1,im QLCN(i,k) = QL_TOT(i,k) * FQA(i,k) QLLS(i,k) = QL_TOT(i,k) - QLCN(i,k) QICN(i,k) = QI_TOT(i,k) * FQA(i,k) QILS(i,k) = QI_TOT(i,k) - QICN(i,k) - end do - end do + enddo + enddo !> - Call update_cld() call update_cld(im, lm, DT_MOIST, ALPHT_X, qc_min & @@ -1765,8 +1816,24 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & do i=1,im QL_TOT(I,K) = QLLS(I,K) + QLCN(I,K) QI_TOT(I,K) = QILS(I,K) + QICN(I,K) - end do - end do +! + if (rnw(i,k) <= qc_min(1)) then + ncpl(i,k) = 0.0 + elseif (ncpl(i,k) <= nmin) then ! make sure NL > 0 if Q >0 + ncpl(i,k) = max(rnw(i,k) / (fourb3 * PI *RL_cub*997.0), nmin) + endif + if (snw(i,k) <= qc_min(2)) then + ncpl(i,k) = 0.0 + elseif (ncps(i,k) <= nmin) then + ncps(i,k) = max(snw(i,k) / (fourb3 * PI *RL_cub*500.0), nmin) + endif + if (qgl(i,k) <= qc_min(2)) then + ncgl(i,k) = 0.0 + elseif (ncgl(i,k) <= nmin) then + ncgl(i,k) = max(qgl(i,k) / (fourb3 * PI *RL_cub*500.0), nmin) + endif + enddo + enddo deallocate(CNV_MFD,CNV_FICE,CNV_NDROP,CNV_NICE) ! deallocate(CNV_MFD,CNV_PRC3,CNV_FICE,CNV_NDROP,CNV_NICE) endif @@ -1806,11 +1873,17 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & qi_o(i,k) = QI_TOT(i,ll) END DO END DO - if (.not. skip_macro) then + if (skip_macro) then + DO K=1, LM + ll = lm-k+1 + DO I = 1,IM + CLLS_io(i,k) = max(0.0, min(CLLS(i,ll)+CLCN(i,ll),1.0)) + enddo + enddo + else DO K=1, LM ll = lm-k+1 DO I = 1,IM -! CLLS_io(i,k) = max(0.0, min(CLLS(i,ll)+CLCN(i,ll),1.0)) CLLS_io(i,k) = CLLS(i,ll) enddo enddo @@ -1832,15 +1905,21 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & qi_o(i,k) = QI_TOT(i,k) END DO END DO - if (.not. skip_macro) then + if (skip_macro) then + DO K=1, LM + DO I = 1,IM + CLLS_io(i,k) = max(0.0, min(CLLS(i,k)+CLCN(i,k),1.0)) + enddo + enddo + else DO K=1, LM DO I = 1,IM -! CLLS_io(i,k) = max(0.0, min(CLLS(i,k)+CLCN(i,k),1.0)) CLLS_io(i,k) = CLLS(i,k) enddo enddo endif - endif + endif ! end of flipv if + DO I = 1,IM tx1 = LS_PRC2(i) + LS_SNR(i) rn_o(i) = tx1 * dt_i * 0.001 diff --git a/physics/m_micro_interstitial.F90 b/physics/m_micro_interstitial.F90 index 259c82519..c40740e63 100644 --- a/physics/m_micro_interstitial.F90 +++ b/physics/m_micro_interstitial.F90 @@ -23,6 +23,7 @@ end subroutine m_micro_pre_init !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | !! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | !! | do_shoc | flag_for_shoc | flag for SHOC | flag | 0 | logical | | in | F | +!! | skip_macro | flag_skip_macro | flag to skip cloud macrophysics in Morrison scheme | flag | 0 | logical | | inout | F | !! | fprcp | number_of_frozen_precipitation_species | number of frozen precipitation species | count | 0 | integer | | in | F | !! | mg3_as_mg2 | flag_mg3_as_mg2 | flag for controlling prep for Morrison-Gettelman microphysics | flag | 0 | logical | | in | F | !! | gq0_ice | ice_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of ice water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | @@ -56,8 +57,8 @@ end subroutine m_micro_pre_init !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! #endif - subroutine m_micro_pre_run (im, levs, do_shoc, fprcp, mg3_as_mg2, gq0_ice, gq0_water, gq0_rain, & - gq0_snow, gq0_graupel, gq0_rain_nc, gq0_snow_nc, gq0_graupel_nc, cld_shoc, cnvc, cnvw, tcr, tcrf, gt0, & + subroutine m_micro_pre_run (im, levs, do_shoc, skip_macro, fprcp, mg3_as_mg2, gq0_ice, gq0_water, gq0_rain, & + gq0_snow, gq0_graupel, gq0_rain_nc, gq0_snow_nc, gq0_graupel_nc, cld_shoc, cnvc, cnvw, tcr, tcrf, gt0, & qrn, qsnw, qgl, ncpr, ncps, ncgl, cld_frc_MG, qlcn, qicn, cf_upi, clw_water, clw_ice, clcn, errmsg, errflg ) use machine, only : kind_phys @@ -65,6 +66,7 @@ subroutine m_micro_pre_run (im, levs, do_shoc, fprcp, mg3_as_mg2, gq0_ice, gq0_w integer, intent(in) :: im, levs, fprcp logical, intent(in) :: do_shoc, mg3_as_mg2 + logical, intent(inout) :: skip_macro real(kind=kind_phys), intent(in) :: tcr, tcrf real(kind=kind_phys), intent(in) :: & @@ -97,6 +99,7 @@ subroutine m_micro_pre_run (im, levs, do_shoc, fprcp, mg3_as_mg2, gq0_ice, gq0_w ! year. I believe this will make the physical interaction more reasonable ! Anning 12/5/2015 changed ntcw hold liquid only if (do_shoc) then + skip_macro = do_shoc if (fprcp == 0) then do k=1,levs do i=1,im @@ -215,19 +218,24 @@ end subroutine m_micro_post_init !! | qrn | local_rain_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of rain water local to physics | kg kg-1 | 2 | real | kind_phys | inout | F | !! | qsnw | local_snow_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of snow water local to physics | kg kg-1 | 2 | real | kind_phys | inout | F | !! | qgl | local_graupel_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of graupel local to physics | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | gq0_ice | ice_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of ice water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | !! | gq0_rain | rain_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of rain water updated by physics | kg kg-1 | 2 | real | kind_phys | out | F | !! | gq0_snow | snow_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of snow water updated by physics | kg kg-1 | 2 | real | kind_phys | out | F | !! | gq0_graupel | graupel_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of graupel updated by physics | kg kg-1 | 2 | real | kind_phys | out | F | !! | gq0_rain_nc | rain_number_concentration_updated_by_physics | number concentration of rain updated by physics | kg-1 | 2 | real | kind_phys | out | F | !! | gq0_snow_nc | snow_number_concentration_updated_by_physics | number concentration of snow updated by physics | kg-1 | 2 | real | kind_phys | out | F | !! | gq0_graupel_nc | graupel_number_concentration_updated_by_physics | number concentration of graupel updated by physics | kg-1 | 2 | real | kind_phys | out | F | +!! | ice | lwe_thickness_of_ice_amount_on_dynamics_timestep | ice fall at this time step | m | 1 | real | kind_phys | out | F | +!! | snow | lwe_thickness_of_snow_amount_on_dynamics_timestep | snow fall at this time step | m | 1 | real | kind_phys | out | F | +!! | graupel | lwe_thickness_of_graupel_amount_on_dynamics_timestep | graupel fall at this time step | m | 1 | real | kind_phys | out | F | +!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! - subroutine m_micro_post_run( & - im, levs, fprcp, mg3_as_mg2, ncpr, ncps, ncgl, qrn, qsnw, qgl, & - gq0_rain, gq0_snow, gq0_graupel, gq0_rain_nc, gq0_snow_nc, & - gq0_graupel_nc, errmsg, errflg) + subroutine m_micro_post_run( & + im, levs, fprcp, mg3_as_mg2, ncpr, ncps, ncgl, qrn, qsnw, qgl, & + gq0_ice, gq0_rain, gq0_snow, gq0_graupel, gq0_rain_nc, gq0_snow_nc, & + gq0_graupel_nc, ice, snow, graupel, dtp, errmsg, errflg) use machine, only : kind_phys implicit none @@ -235,17 +243,33 @@ subroutine m_micro_post_run( & integer, intent(in) :: im, levs, fprcp logical, intent(in) :: mg3_as_mg2 - real(kind=kind_phys), intent(in) :: ncpr(:,:), ncps(:,:), ncgl(:,:) - real(kind=kind_phys), intent(inout) :: qrn(:,:), qsnw(:,:), qgl(:,:) - real(kind=kind_phys), intent(inout) :: gq0_rain(:,:), gq0_snow(:,:), & - gq0_graupel(:,:), gq0_rain_nc(:,:), gq0_snow_nc(:,:), gq0_graupel_nc(:,:) + real(kind=kind_phys), intent(in ) :: ncpr(1:im,1:levs) + real(kind=kind_phys), intent(in ) :: ncps(1:im,1:levs) + real(kind=kind_phys), intent(in ) :: ncgl(1:im,1:levs) + real(kind=kind_phys), intent(inout) :: qrn(1:im,1:levs) + real(kind=kind_phys), intent(inout) :: qsnw(1:im,1:levs) + real(kind=kind_phys), intent(inout) :: qgl(1:im,1:levs) + real(kind=kind_phys), intent(inout) :: gq0_ice(1:im,1:levs) + real(kind=kind_phys), intent(inout) :: gq0_rain(1:im,1:levs) + real(kind=kind_phys), intent(inout) :: gq0_snow(1:im,1:levs) + real(kind=kind_phys), intent(inout) :: gq0_graupel(1:im,1:levs) + real(kind=kind_phys), intent(inout) :: gq0_rain_nc(1:im,1:levs) + real(kind=kind_phys), intent(inout) :: gq0_snow_nc(1:im,1:levs) + real(kind=kind_phys), intent(inout) :: gq0_graupel_nc(1:im,1:levs) + real(kind=kind_phys), intent( out) :: ice(1:im) + real(kind=kind_phys), intent( out) :: snow(1:im) + real(kind=kind_phys), intent( out) :: graupel(1:im) + real(kind=kind_phys), intent(in ) :: dtp character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg + ! Local variables + real(kind=kind_phys), parameter :: qsmall = 1.0d-20 + real(kind=kind_phys), parameter :: con_p001 = 0.001d0 + real(kind=kind_phys), parameter :: con_day = 86400.0d0 integer :: i, k - - real(kind=kind_phys), parameter :: qsmall = 1.0e-20 + real(kind=kind_phys) :: tem ! Initialize CCPP error handling variables errmsg = '' @@ -260,7 +284,7 @@ subroutine m_micro_post_run( & ! &, gq0(1,1,1),gq0(1,1,ntcw),gq0(1,1,ntcw+1),' m_micro ') ! if (lprnt) write(0,*) ' rain1=',rain1(ipr)*86400.0, & -! &' rainc=',diag%rainc(ipr)*86400.0 & +! &' rainc=',diag%rainc(ipr)*86400.0 ! &,' cn_prc=',cn_prc(ipr),' cn_snr=',cn_snr(ipr) ! if(lprnt) write(0,*) ' aftgt0=',Stateout%gt0(ipr,:),' kdt=',kdt ! if (lprnt) write(0,*) ' aftlsgq0=',stateout%gq0(ipr,:,1),' kdt=',kdt @@ -273,6 +297,7 @@ subroutine m_micro_post_run( & ! if (lprnt) write(0,*)' qsnwa=',qsnw(ipr,:),' kdt=',kdt ! if (lprnt) write(0,*)' qglba',qgl(ipr,:),' kdt=',kdt + tem = dtp * con_p001 / con_day if (abs(fprcp) == 1 .or. mg3_as_mg2) then do k=1,levs do i=1,im @@ -284,6 +309,10 @@ subroutine m_micro_post_run( & gq0_snow_nc(i,k) = ncps(i,k) enddo enddo + do i=1,im + ice(i) = tem * gq0_ice(i,1) + snow(i) = tem * qsnw(i,1) + enddo elseif (fprcp > 1) then do k=1,levs do i=1,im @@ -298,6 +327,11 @@ subroutine m_micro_post_run( & gq0_graupel_nc(i,k) = ncgl(i,k) enddo enddo + do i=1,im + ice(i) = tem * gq0_ice(i,1) + snow(i) = tem * qsnw(i,1) + graupel(i) = tem * qgl(i,1) + enddo endif diff --git a/physics/maximum_hourly_diagnostics.F90 b/physics/maximum_hourly_diagnostics.F90 index 545f393b9..62c68c937 100644 --- a/physics/maximum_hourly_diagnostics.F90 +++ b/physics/maximum_hourly_diagnostics.F90 @@ -26,8 +26,7 @@ end subroutine maximum_hourly_diagnostics_finalize !! |----------------------|--------------------------------------------------------------------|--------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | !! | levs | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | kdt | index_of_time_step | current forecast iteration | index | 0 | integer | | in | F | -!! | nsteps_per_reset | number_of_time_steps_per_maximum_hourly_time_interval | number_of_time_steps_per_maximum_hourly_time_interval | count | 0 | integer | | in | F | +!! | reset | flag_reset_maximum_hourly_fields | flag for resetting maximum hourly fields | flag | 0 | logical | | in | F | !! | lradar | flag_for_radar_reflectivity | flag for radar reflectivity | flag | 0 | logical | | in | F | !! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | @@ -54,15 +53,15 @@ end subroutine maximum_hourly_diagnostics_finalize !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! #endif - subroutine maximum_hourly_diagnostics_run(im, levs, kdt, nsteps_per_reset, lradar, imp_physics, & + subroutine maximum_hourly_diagnostics_run(im, levs, reset, lradar, imp_physics, & imp_physics_gfdl, imp_physics_thompson, con_g, phil, & gt0, refl_10cm, refdmax, refdmax263k, u10m, v10m, & u10max, v10max, spd10max, pgr, t2m, q2m, t02max, & t02min, rh02max, rh02min, errmsg, errflg) ! Interface variables - integer, intent(in) :: im, levs, kdt, nsteps_per_reset - logical, intent(in) :: lradar + integer, intent(in) :: im, levs + logical, intent(in) :: reset, lradar integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson real(kind_phys), intent(in ) :: con_g real(kind_phys), intent(in ) :: phil(im,levs) @@ -88,30 +87,24 @@ subroutine maximum_hourly_diagnostics_run(im, levs, kdt, nsteps_per_reset, lrada ! Local variables real(kind_phys), dimension(:), allocatable :: refd, refd263k real(kind_phys) :: tem, pshltr, QCQ, rh02 - integer :: kdtminus1, i + integer :: i ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - kdtminus1 = kdt-1 - !Calculate hourly max 1-km agl and -10C reflectivity if (lradar .and. (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson)) then allocate(refd(im)) allocate(refd263k(im)) call max_fields(phil,refl_10cm,con_g,im,levs,refd,gt0,refd263k) - if(mod(kdtminus1,nsteps_per_reset)==0)then + if (reset) then do i=1,im refdmax(i) = -35. refdmax263k(i) = -35. enddo endif do i=1,im - !if(mod(kdtminus1,nsteps_per_reset)==0)then - ! refdmax(I) = -35. - ! refdmax263k(I) = -35. - !endif refdmax(i) = max(refdmax(i),refd(i)) refdmax263k(i) = max(refdmax263k(i),refd263k(i)) enddo @@ -119,7 +112,7 @@ subroutine maximum_hourly_diagnostics_run(im, levs, kdt, nsteps_per_reset, lrada deallocate (refd263k) endif ! - if(mod(kdtminus1,nsteps_per_reset)==0)then + if (reset) then do i=1,im spd10max(i) = -999. u10max(i) = -999. @@ -133,15 +126,6 @@ subroutine maximum_hourly_diagnostics_run(im, levs, kdt, nsteps_per_reset, lrada do i=1,im ! find max hourly wind speed then decompose tem = sqrt(u10m(i)*u10m(i) + v10m(i)*v10m(i)) - !if(mod(kdtminus1,nsteps_per_reset)==0)then - ! spd10max(i) = -999. - ! u10max(i) = -999. - ! v10max(i) = -999. - ! t02max(i) = -999. - ! t02min(i) = 999. - ! rh02max(i) = -999. - ! rh02min(i) = 999. - !endif if (tem > spd10max(i)) then spd10max(i) = tem u10max(i) = u10m(i) @@ -150,16 +134,16 @@ subroutine maximum_hourly_diagnostics_run(im, levs, kdt, nsteps_per_reset, lrada pshltr=pgr(i)*exp(-0.068283/gt0(i,1)) QCQ=PQ0/pshltr*EXP(A2A*(t2m(i)-A3)/(t2m(i)-A4)) rh02=q2m(i)/QCQ - IF (rh02.GT.1.0) THEN - rh02=1.0 + IF (rh02 > 1.0) THEN + rh02 = 1.0 ENDIF - IF (rh02.LT.RHmin) THEN !use smaller RH limit for stratosphere - rh02=RHmin + IF (rh02 < RHmin) THEN !use smaller RH limit for stratosphere + rh02 = RHmin ENDIF - rh02max(i)=max(rh02max(i),rh02) - rh02min(i)=min(rh02min(i),rh02) - t02max(i)=max(t02max(i),t2m(i)) !<--- hourly max 2m t - t02min(i)=min(t02min(i),t2m(i)) !<--- hourly min 2m t + rh02max(i) = max(rh02max(i),rh02) + rh02min(i) = min(rh02min(i),rh02) + t02max(i) = max(t02max(i),t2m(i)) !<--- hourly max 2m t + t02min(i) = min(t02min(i),t2m(i)) !<--- hourly min 2m t enddo end subroutine maximum_hourly_diagnostics_run @@ -183,8 +167,7 @@ subroutine max_fields(phil,ref3D,grav,im,levs,refd,tk,refd263k) do i=1,im refd(I) = -35. vloop: do k=1,levs-1 - if ( (z(i,k+1)) .ge. 1000. & - .and.(z(i,k)) .le. 1000.) then + if ( z(i,k+1) >= 1000. .and. z(i,k) <= 1000.) then zmidp1=z(i,k+1) zmidLOC=z(i,k) dbz1(1)=ref3d(i,k+1) !- dBZ (not Z) values diff --git a/physics/micro_mg_utils.F90 b/physics/micro_mg_utils.F90 index fe1c8c8b0..46985c46c 100644 --- a/physics/micro_mg_utils.F90 +++ b/physics/micro_mg_utils.F90 @@ -253,7 +253,8 @@ module micro_mg_utils ! Mass of each raindrop created from autoconversion. real(r8), parameter :: droplet_mass_25um = 4._r8/3._r8*pi*rhow*(25.e-6_r8)**3 -real(r8), parameter :: droplet_mass_40um = 4._r8/3._r8*pi*rhow*(40.e-6_r8)**3 +real(r8), parameter :: droplet_mass_40um = 4._r8/3._r8*pi*rhow*(40.e-6_r8)**3, & + droplet_mass_40umi = 1._r8/droplet_mass_40um !========================================================= ! Constants set in initialization @@ -1014,7 +1015,8 @@ subroutine sb2001v2_liq_autoconversion(pgam,qc,nc,qr,rho,relvar,au,nprc,nprc1,mg ! parameters for Seifert and Beheng (2001) autoconversion/accretion real(r8), parameter :: kc = 9.44e9_r8 real(r8), parameter :: kr = 5.78e3_r8 - real(r8), parameter :: auf = kc / (20._r8*2.6e-7_r8) * 1000._r8 + real(r8), parameter :: auf = kc / (20._r8*2.6e-7_r8) * 1000._r8, & + con_nprc1 = two/2.6e-7_r8*1000._r8 real(r8) :: dum, dum1, nu, pra_coef, tx1, tx2, tx3, tx4 integer :: dumi, i @@ -1045,8 +1047,10 @@ subroutine sb2001v2_liq_autoconversion(pgam,qc,nc,qr,rho,relvar,au,nprc,nprc1,mg ! (rho(i)*qc(i)/1000._r8)**4._r8/(rho(i)*nc(i)/1.e6_r8)**2._r8* & ! (1._r8+dum1/(1._r8-dum)**2)*1000._r8 / rho(i) - nprc1(i) = au(i) * two / 2.6e-7_r8 * 1000._r8 - nprc(i) = au(i) / droplet_mass_40um +! nprc1(i) = au(i) * two / 2.6e-7_r8 * 1000._r8 +! nprc(i) = au(i) / droplet_mass_40um + nprc1(i) = au(i) * con_nprc1 + nprc(i) = au(i) * droplet_mass_40umi else au(i) = zero nprc1(i) = zero @@ -1080,7 +1084,8 @@ subroutine liu_liq_autoconversion(pgam,qc,nc,qr,rho,relvar, & real(r8) :: xs,lw, nw, beta6 ! real(r8), parameter :: dcrit=1.0e-6, miu_disp=1. ! real(r8), parameter :: dcrit=1.0e-3, miu_disp=1. - real(r8), parameter :: dcrit=2.0e-3, miu_disp=0.8 + real(r8), parameter :: dcrit = 2.0e-3, miu_disp = 0.8, & + con_nprc1 = two/2.6e-7_r8*1000._r8 integer :: i do i=1,mgncol @@ -1099,8 +1104,10 @@ subroutine liu_liq_autoconversion(pgam,qc,nc,qr,rho,relvar, & / (gamma(relvar(i))*(relvar(i)*relvar(i))) au(i) = au(i) * dcrit - nprc1(i)= au(i) * (two/2.6e-7_r8*1000._r8) - nprc(i) = au(i) / droplet_mass_40um +! nprc1(i)= au(i) * (two/2.6e-7_r8*1000._r8) +! nprc(i) = au(i) / droplet_mass_40um + nprc1(i)= au(i) * con_nprc1 + nprc(i) = au(i) * droplet_mass_40umi else au(i) = zero nprc1(i) = zero diff --git a/physics/module_gfdl_cloud_microphys.F90 b/physics/module_gfdl_cloud_microphys.F90 index 23acefb9b..ac3795566 100644 --- a/physics/module_gfdl_cloud_microphys.F90 +++ b/physics/module_gfdl_cloud_microphys.F90 @@ -327,7 +327,7 @@ subroutine gfdl_cloud_microphys_mod_driver ( qv_dt, ql_dt, qr_dt, qi_dt, qs_dt, qg_dt, qa_dt, pt_dt, pt, w, & uin, vin, udt, vdt, dz, delp, area, dt_in, land, & rain, snow, ice, graupel, hydrostatic, phys_hydrostatic, & - p, lradar, refl_10cm, kdt, nsteps_per_reset) + p, lradar, refl_10cm,reset) implicit none @@ -357,7 +357,7 @@ subroutine gfdl_cloud_microphys_mod_driver ( real, intent (in), dimension (iis:iie, jjs:jje, kks:kke) :: p logical, intent (in) :: lradar real, intent (out), dimension (iis:iie, jjs:jje, kks:kke) :: refl_10cm - integer, intent (in) :: kdt, nsteps_per_reset + logical, intent (in) :: reset ! Local variables logical :: melti = .false. @@ -595,7 +595,7 @@ subroutine gfdl_cloud_microphys_mod_driver ( ! call mpp_clock_end (gfdl_mp_clock) if(lradar) then ! Only set melti to true at the output times - if(mod(kdt,nsteps_per_reset)==0)then + if (reset) then melti=.true. else melti=.false. diff --git a/physics/module_nst_water_prop.f90 b/physics/module_nst_water_prop.f90 index 8b38ffb18..20c4dff88 100644 --- a/physics/module_nst_water_prop.f90 +++ b/physics/module_nst_water_prop.f90 @@ -746,7 +746,7 @@ subroutine get_dtzm_2d(xt,xz,dt_cool,zc,wet,icy,z1,z2,nx,ny,dtm) endif endif endif - endif ! if ( wet(i,j) .and. .not.icy(i,j) ) then + endif ! if wet(i,j) .and. .not.icy(i,j) enddo enddo ! diff --git a/physics/moninshoc.f b/physics/moninshoc.f index 05473db6c..96b294824 100644 --- a/physics/moninshoc.f +++ b/physics/moninshoc.f @@ -40,7 +40,7 @@ end subroutine moninshoc_finalize !! | q1 | vertically_diffused_tracer_concentration | tracer concentration diffused by PBL scheme | kg kg-1 | 3 | real | kind_phys | in | F | !! | tkh | atmosphere_heat_diffusivity_from_shoc | diffusivity for heat from the SHOC scheme | m2 s-1 | 2 | real | kind_phys | in | F | !! | prnum | prandtl_number | turbulent Prandtl number | none | 2 | real | kind_phys | inout | F | -!! | ntke | index_for_turbulent_kinetic_energy | tracer index for turbulent kinetic energy | index | 0 | integer | | in | F | +!! | ntke | index_for_turbulent_kinetic_energy_vertical_diffusion_tracer | index for turbulent kinetic energy in the vertically diffused tracer array | index | 0 | integer | | in | F | !! | psk | dimensionless_exner_function_at_lowest_model_interface | dimensionless Exner function at the surface interface | none | 1 | real | kind_phys | in | F | !! | rbsoil | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | !! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | @@ -71,6 +71,7 @@ end subroutine moninshoc_finalize !! | xkzm_m | atmosphere_momentum_diffusivity_background | background value of momentum diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | !! | xkzm_h | atmosphere_heat_diffusivity_background | background value of heat diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | !! | xkzm_s | diffusivity_background_sigma_level | sigma level threshold for background diffusivity | none | 0 | real | kind_phys | in | F | +!! | xkzminv | atmosphere_heat_diffusivity_background_maximum | max. background val. diffusivity in inversion layers | m2 s-1 | 0 | real | kind_phys | in | F | !! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | !! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | !! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | @@ -88,7 +89,8 @@ subroutine moninshoc_run (ix,im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, & tsea,heat,evap,stress,spd1,kpbl, & prsi,del,prsl,prslk,phii,phil,delt, & dusfc,dvsfc,dtsfc,dqsfc,dkt,hpbl, - & kinver,xkzm_m,xkzm_h,xkzm_s,lprnt,ipr,me, + & kinver,xkzm_m,xkzm_h,xkzm_s,xkzminv, + & lprnt,ipr,me, & grav, rd, cp, hvap, fv, & errmsg,errflg) ! @@ -105,7 +107,7 @@ subroutine moninshoc_run (ix,im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, integer, dimension(im), intent(in) :: kinver real(kind=kind_phys), intent(in) :: delt, - & xkzm_m, xkzm_h, xkzm_s + & xkzm_m, xkzm_h, xkzm_s, xkzminv real(kind=kind_phys), intent(in) :: grav, & rd, cp, hvap, fv real(kind=kind_phys), dimension(im), intent(in) :: psk, @@ -208,7 +210,8 @@ subroutine moninshoc_run (ix,im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, do i=1,im xkzo(i,k) = 0.0 xkzmo(i,k) = 0.0 - if (k < kinver(i)) then +! if (k < kinver(i)) then + if (k <= kinver(i)) then ! vertical background diffusivity for heat and momentum tem1 = 1.0 - prsi(i,k+1) * tx1(i) tem1 = min(1.0, exp(-tem1 * tem1 * 10.0)) @@ -224,16 +227,16 @@ subroutine moninshoc_run (ix,im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, ! ! diffusivity in the inversion layer is set to be xkzminv (m^2/s) ! -! do k = 1,kmpbl -! do i=1,im -! if(zi(i,k+1) > 250.) then -! tem1 = (t1(i,k+1)-t1(i,k)) * rdzt(i,k) -! if(tem1 > 1.e-5) then -! xkzo(i,k) = min(xkzo(i,k),xkzminv) -! endif -! endif -! enddo -! enddo + do k = 1,kmpbl + do i=1,im + if(zi(i,k+1) > 250.) then + tem1 = (t1(i,k+1)-t1(i,k)) * rdzt(i,k) + if(tem1 > 1.e-5) then + xkzo(i,k) = min(xkzo(i,k),xkzminv) + endif + endif + enddo + enddo ! ! do i = 1,im @@ -499,8 +502,6 @@ subroutine moninshoc_run (ix,im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, ttend = (a1(i,k)-t1(i,k)) * rdt qtend = (a2(i,k)-q1(i,k,1)) * rdt tau(i,k) = tau(i,k) + ttend -! if(lprnt .and. i==ipr .and. k<11) write(0,*)' tau=',tau(ipr,k) -! &,' ttend=',ttend,' a1=',a1(ipr,k),' t1=',t1(ipr,k) rtg(i,k,1) = rtg(i,k,1) + qtend dtsfc(i) = dtsfc(i) + cont*del(i,k)*ttend dqsfc(i) = dqsfc(i) + conq*del(i,k)*qtend diff --git a/physics/physcons.F90 b/physics/physcons.F90 index 9027f4cba..0a95bc679 100644 --- a/physics/physcons.F90 +++ b/physics/physcons.F90 @@ -44,45 +44,47 @@ module physcons !> \name Math constants ! real(kind=kind_phys),parameter:: con_pi =3.1415926535897931 !< pi real(kind=kind_phys),parameter:: con_pi =4.0d0*atan(1.0d0) !< pi - real(kind=kind_phys),parameter:: con_sqrt2 =1.414214e+0 !< square root of 2 - real(kind=kind_phys),parameter:: con_sqrt3 =1.732051e+0 !< quare root of 3 + real(kind=kind_phys),parameter:: con_sqrt2 =1.414214e+0_kind_phys !< square root of 2 + real(kind=kind_phys),parameter:: con_sqrt3 =1.732051e+0_kind_phys !< quare root of 3 !> \name Geophysics/Astronomy constants - real(kind=kind_phys),parameter:: con_rerth =6.3712e+6 !< radius of earth (\f$m\f$) - real(kind=kind_phys),parameter:: con_g =9.80665e+0 !< gravity (\f$m/s^{2}\f$) - real(kind=kind_phys),parameter:: con_omega =7.2921e-5 !< ang vel of earth (\f$s^{-1}\f$) - real(kind=kind_phys),parameter:: con_p0 =1.01325e5 !< standard atmospheric pressure (\f$Pa\f$) -! real(kind=kind_phys),parameter:: con_solr =1.36822e+3 ! solar constant (W/m2)-aer(2001) - real(kind=kind_phys),parameter:: con_solr_old =1.3660e+3 !< solar constant (\f$W/m^{2}\f$)-Liu(2002) - real(kind=kind_phys),parameter:: con_solr =1.3608e+3 !< solar constant (\f$W/m^{2}\f$)-nasa-sorce Tim(2008) -! real(kind=kind_phys),parameter:: con_solr =1.36742732e+3 ! solar constant (W/m2)-gfdl(1989) - OPR as of Jan 2006 - ! Selected geophysics/astronomy constants with kind=kind_dyn - real(kind=kind_dyn), parameter:: con_g_dyn =9.80665e+0 !< gravity (\f$m/s^{2}\f$) + real(kind=kind_phys),parameter:: con_rerth =6.3712e+6_kind_phys !< radius of earth (\f$m\f$) + real(kind=kind_phys),parameter:: con_g =9.80665e+0_kind_phys !< gravity (\f$m/s^{2}\f$) + real(kind=kind_phys),parameter:: con_omega =7.2921e-5_kind_phys !< ang vel of earth (\f$s^{-1}\f$) + real(kind=kind_phys),parameter:: con_p0 =1.01325e5_kind_phys !< standard atmospheric pressure (\f$Pa\f$) +! real(kind=kind_phys),parameter:: con_solr =1.36822e+3_kind_phys ! solar constant (W/m2)-aer(2001) + real(kind=kind_phys),parameter:: con_solr_old =1.3660e+3_kind_phys !< solar constant (\f$W/m^{2}\f$)-Liu(2002) + real(kind=kind_phys),parameter:: con_solr =1.3608e+3_kind_phys !< solar constant (\f$W/m^{2}\f$)-nasa-sorce Tim(2008) +! real(kind=kind_phys),parameter:: con_solr =1.36742732e+3_kind_phys ! solar constant (W/m2)-gfdl(1989) - OPR as of Jan 2006 + ! Selected geophysics/astronomy constants with kind=kind_dyn DH* CHECK IF THIS BREAKS B4B AND IF SO REMOVE _kind_dyn + real(kind=kind_dyn), parameter:: con_g_dyn =9.80665e+0_kind_dyn !< gravity (\f$m/s^{2}\f$) !> \name Thermodynamics constants - real(kind=kind_phys),parameter:: con_rgas =8.314472 !< molar gas constant (\f$J/mol/K\f$) - real(kind=kind_phys),parameter:: con_rd =2.8705e+2 !< gas constant air (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_rv =4.6150e+2 !< gas constant H2O (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_cp =1.0046e+3 !< spec heat air at p (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_cv =7.1760e+2 !< spec heat air at v (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_cvap =1.8460e+3 !< spec heat H2O gas (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_cliq =4.1855e+3 !< spec heat H2O liq (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_csol =2.1060e+3 !< spec heat H2O ice (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_hvap =2.5000e+6 !< lat heat H2O cond (\f$J/kg\f$) - real(kind=kind_phys),parameter:: con_hfus =3.3358e+5 !< lat heat H2O fusion (\f$J/kg\f$) - real(kind=kind_phys),parameter:: con_psat =6.1078e+2 !< pres at H2O 3pt (\f$Pa\f$) - real(kind=kind_phys),parameter:: con_t0c =2.7315e+2 !< temp at 0C (K) - real(kind=kind_phys),parameter:: con_ttp =2.7316e+2 !< temp at H2O 3pt (K) - real(kind=kind_phys),parameter:: con_tice =2.7120e+2 !< temp freezing sea (K) - real(kind=kind_phys),parameter:: con_jcal =4.1855E+0 !< joules per calorie - real(kind=kind_phys),parameter:: con_rhw0 =1022.0 !< sea water reference density (\f$kg/m^{3}\f$) - real(kind=kind_phys),parameter:: con_epsq =1.0E-12 !< min q for computing precip type - ! Selected thermodynamics constants with kind=kind_dyn - real(kind=kind_dyn), parameter:: con_rd_dyn =2.8705e+2 !< gas constant air (\f$J/kg/K\f$) - real(kind=kind_dyn), parameter:: con_rv_dyn =4.6150e+2 !< gas constant H2O (\f$J/kg/K\f$) - real(kind=kind_dyn), parameter:: con_cp_dyn =1.0046e+3 !< spec heat air at p (\f$J/kg/K\f$) - real(kind=kind_dyn), parameter:: con_hvap_dyn =2.5000e+6 !< lat heat H2O cond (\f$J/kg\f$) - real(kind=kind_dyn), parameter:: con_hfus_dyn =3.3358e+5 !< lat heat H2O fusion (\f$J/kg\f$) + real(kind=kind_phys),parameter:: con_rgas =8.314472_kind_phys !< molar gas constant (\f$J/mol/K\f$) + real(kind=kind_phys),parameter:: con_rd =2.8705e+2_kind_phys !< gas constant air (\f$J/kg/K\f$) + real(kind=kind_phys),parameter:: con_rv =4.6150e+2_kind_phys !< gas constant H2O (\f$J/kg/K\f$) + real(kind=kind_phys),parameter:: con_cp =1.0046e+3_kind_phys !< spec heat air at p (\f$J/kg/K\f$) + real(kind=kind_phys),parameter:: con_cv =7.1760e+2_kind_phys !< spec heat air at v (\f$J/kg/K\f$) + real(kind=kind_phys),parameter:: con_cvap =1.8460e+3_kind_phys !< spec heat H2O gas (\f$J/kg/K\f$) + real(kind=kind_phys),parameter:: con_cliq =4.1855e+3_kind_phys !< spec heat H2O liq (\f$J/kg/K\f$) + real(kind=kind_phys),parameter:: con_csol =2.1060e+3_kind_phys !< spec heat H2O ice (\f$J/kg/K\f$) + real(kind=kind_phys),parameter:: con_hvap =2.5000e+6_kind_phys !< lat heat H2O cond (\f$J/kg\f$) +! real(kind=kind_phys),parameter:: con_hvap =2.5010e+6_kind_phys ! from AMS + real(kind=kind_phys),parameter:: con_hfus =3.3358e+5_kind_phys !< lat heat H2O fusion (\f$J/kg\f$) +! real(kind=kind_phys),parameter:: con_hfus =3.3370e+5_kind_phys ! from AMS + real(kind=kind_phys),parameter:: con_psat =6.1078e+2_kind_phys !< pres at H2O 3pt (\f$Pa\f$) + real(kind=kind_phys),parameter:: con_t0c =2.7315e+2_kind_phys !< temp at 0C (K) + real(kind=kind_phys),parameter:: con_ttp =2.7316e+2_kind_phys !< temp at H2O 3pt (K) + real(kind=kind_phys),parameter:: con_tice =2.7120e+2_kind_phys !< temp freezing sea (K) + real(kind=kind_phys),parameter:: con_jcal =4.1855E+0_kind_phys !< joules per calorie + real(kind=kind_phys),parameter:: con_rhw0 =1022.0_kind_phys !< sea water reference density (\f$kg/m^{3}\f$) + real(kind=kind_phys),parameter:: con_epsq =1.0E-12_kind_phys !< min q for computing precip type + ! Selected thermodynamics constants with kind=kind_dyn DH* CHECK IF THIS BREAKS B4B AND IF SO REMOVE _kind_dyn + real(kind=kind_dyn), parameter:: con_rd_dyn =2.8705e+2_kind_dyn !< gas constant air (\f$J/kg/K\f$) + real(kind=kind_dyn), parameter:: con_rv_dyn =4.6150e+2_kind_dyn !< gas constant H2O (\f$J/kg/K\f$) + real(kind=kind_dyn), parameter:: con_cp_dyn =1.0046e+3_kind_dyn !< spec heat air at p (\f$J/kg/K\f$) + real(kind=kind_dyn), parameter:: con_hvap_dyn =2.5000e+6_kind_dyn !< lat heat H2O cond (\f$J/kg\f$) + real(kind=kind_dyn), parameter:: con_hfus_dyn =3.3358e+5_kind_dyn !< lat heat H2O fusion (\f$J/kg\f$) !> \name Secondary constants real(kind=kind_phys),parameter:: con_rocp =con_rd/con_cp @@ -96,23 +98,24 @@ module physcons real(kind=kind_phys),parameter:: con_xponb =-con_dldt/con_rv+con_hvap/(con_rv*con_ttp) !> \name Other Physics/Chemistry constants (source: 2002 CODATA) - real(kind=kind_phys),parameter:: con_c =2.99792458e+8 !< speed of light (\f$m/s\f$) - real(kind=kind_phys),parameter:: con_plnk =6.6260693e-34 !< planck constant (\f$J/s\f$) - real(kind=kind_phys),parameter:: con_boltz =1.3806505e-23 !< boltzmann constant (\f$J/K\f$) - real(kind=kind_phys),parameter:: con_sbc =5.670400e-8 !< stefan-boltzmann (\f$W/m^{2}/K^{4}\f$) - real(kind=kind_phys),parameter:: con_avgd =6.0221415e23 !< avogadro constant (\f$mol^{-1}\f$) - real(kind=kind_phys),parameter:: con_gasv =22413.996e-6 !< vol of ideal gas at 273.15K, 101.325kPa (\f$m^{3}/mol\f$) -! real(kind=kind_phys),parameter:: con_amd =28.970 !< molecular wght of dry air (g/mol) - real(kind=kind_phys),parameter:: con_amd =28.9644 !< molecular wght of dry air (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amw =18.0154 !< molecular wght of water vapor (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amo3 =47.9982 !< molecular wght of o3 (\f$g/mol\f$) -! real(kind=kind_phys),parameter:: con_amo3 =48.0 !< molecular wght of o3 (g/mol) - real(kind=kind_phys),parameter:: con_amco2 =44.011 !< molecular wght of co2 (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amo2 =31.9999 !< molecular wght of o2 (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amch4 =16.043 !< molecular wght of ch4 (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amn2o =44.013 !< molecular wght of n2o (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_thgni =-38.15 !< temperature the H.G.Nuc. ice starts - real(kind=kind_phys),parameter:: cimin =0.15 !< minimum ice concentration + real(kind=kind_phys),parameter:: con_c =2.99792458e+8_kind_phys !< speed of light (\f$m/s\f$) + real(kind=kind_phys),parameter:: con_plnk =6.6260693e-34_kind_phys !< planck constant (\f$J/s\f$) + real(kind=kind_phys),parameter:: con_boltz =1.3806505e-23_kind_phys !< boltzmann constant (\f$J/K\f$) + real(kind=kind_phys),parameter:: con_sbc =5.670400e-8_kind_phys !< stefan-boltzmann (\f$W/m^{2}/K^{4}\f$) + real(kind=kind_phys),parameter:: con_avgd =6.0221415e23_kind_phys !< avogadro constant (\f$mol^{-1}\f$) + real(kind=kind_phys),parameter:: con_gasv =22413.996e-6_kind_phys !< vol of ideal gas at 273.15K, 101.325kPa (\f$m^{3}/mol\f$) +! real(kind=kind_phys),parameter:: con_amd =28.970_kind_phys !< molecular wght of dry air (g/mol) + real(kind=kind_phys),parameter:: con_amd =28.9644_kind_phys !< molecular wght of dry air (\f$g/mol\f$) + real(kind=kind_phys),parameter:: con_amw =18.0154_kind_phys !< molecular wght of water vapor (\f$g/mol\f$) + real(kind=kind_phys),parameter:: con_amo3 =47.9982_kind_phys !< molecular wght of o3 (\f$g/mol\f$) +! real(kind=kind_phys),parameter:: con_amo3 =48.0_kind_phys !< molecular wght of o3 (g/mol) + real(kind=kind_phys),parameter:: con_amco2 =44.011_kind_phys !< molecular wght of co2 (\f$g/mol\f$) + real(kind=kind_phys),parameter:: con_amo2 =31.9999_kind_phys !< molecular wght of o2 (\f$g/mol\f$) + real(kind=kind_phys),parameter:: con_amch4 =16.043_kind_phys !< molecular wght of ch4 (\f$g/mol\f$) + real(kind=kind_phys),parameter:: con_amn2o =44.013_kind_phys !< molecular wght of n2o (\f$g/mol\f$) + real(kind=kind_phys),parameter:: con_thgni =-38.15_kind_phys !< temperature the H.G.Nuc. ice starts + + real(kind=kind_phys),parameter:: cimin =0.15 !< minimum ice concentration !> \name Miscellaneous physics related constants (For WSM6; Moorthi - Jul 2014) ! integer, parameter :: max_lon=16000, max_lat=8000, min_lon=192, min_lat=94 @@ -123,12 +126,12 @@ module physcons ! real(kind=kind_phys), parameter:: rlapse = 0.65e-2, rhc_max = 0.9999999 ! new ! real(kind=kind_phys), parameter:: rlapse = 0.65e-2, rhc_max = 0.9900 - real(kind=kind_phys), parameter:: rlapse = 0.65e-2 - real(kind=kind_phys), parameter:: cb2mb = 10.0, pa2mb = 0.01 + real(kind=kind_phys), parameter:: rlapse = 0.65e-2_kind_phys + real(kind=kind_phys), parameter:: cb2mb = 10.0_kind_phys, pa2mb = 0.01_kind_phys ! for wsm6 - real(kind=kind_phys),parameter:: rhowater = 1000. !< density of water (kg/m^3) - real(kind=kind_phys),parameter:: rhosnow = 100. !< density of snow (kg/m^3) - real(kind=kind_phys),parameter:: rhoair = 1.28 !< density of air near surface (kg/m^3) + real(kind=kind_phys),parameter:: rhowater = 1000._kind_phys !< density of water (kg/m^3) + real(kind=kind_phys),parameter:: rhosnow = 100._kind_phys !< density of snow (kg/m^3) + real(kind=kind_phys),parameter:: rhoair = 1.28_kind_phys !< density of air near surface (kg/m^3) !........................................! end module physcons ! diff --git a/physics/radiation_astronomy.f b/physics/radiation_astronomy.f index 8a788b257..f1651ca84 100644 --- a/physics/radiation_astronomy.f +++ b/physics/radiation_astronomy.f @@ -611,7 +611,7 @@ subroutine sol_update & ! --- ... setting up calculation parameters used by subr coszmn - nswr = nint(deltsw / deltim) ! number of mdl t-step per sw call + nswr = max(1, nint(deltsw/deltim)) ! number of mdl t-step per sw call dtswh = deltsw / f3600 ! time length in hours ! if ( deltsw >= f3600 ) then ! for longer sw call interval @@ -624,7 +624,7 @@ subroutine sol_update & ! anginc = pid12 * dtswh / float(nstp-1) ! solar angle inc during each calc step - nstp = nswr + nstp = max(6, nswr) anginc = pid12 * dtswh / float(nstp) if ( me == 0 ) then @@ -870,7 +870,7 @@ subroutine coszmn & real (kind=kind_phys), intent(out) :: coszen(:), coszdg(:) ! --- locals: - real (kind=kind_phys) :: coszn, cns, ss, cc, solang, rstp + real (kind=kind_phys) :: coszn, cns, solang, rstp integer :: istsun(IM), i, it, j, lat @@ -886,12 +886,9 @@ subroutine coszmn & do it = 1, nstp cns = solang + (float(it)-0.5)*anginc + sollag - do i = 1, IM - ss = sinlat(i) * sindec - cc = coslat(i) * cosdec - - coszn = ss + cc * cos(cns + xlon(i)) + coszn = sindec * sinlat(i) + cosdec * coslat(i) & + & * cos(cns+xlon(i)) coszen(i) = coszen(i) + max(0.0, coszn) if (coszn > czlimt) istsun(i) = istsun(i) + 1 enddo diff --git a/physics/radiation_clouds.f b/physics/radiation_clouds.f index 7f8d49c23..66da419bf 100644 --- a/physics/radiation_clouds.f +++ b/physics/radiation_clouds.f @@ -2741,26 +2741,27 @@ subroutine progclduni & ! ==================== definition of variables ==================== ! ! ! ! input variables: ! -! plyr (IX,NLAY) : model layer mean pressure in mb (100Pa) ! -! plvl (IX,NLP1) : model level pressure in mb (100Pa) ! -! tlyr (IX,NLAY) : model layer mean temperature in k ! -! tvly (IX,NLAY) : model layer virtual temperature in k ! -! ccnd (IX,NLAY) : layer cloud condensate amount ! -! ncnd : number of layer cloud condensate types ! -! xlat (IX) : grid latitude in radians, default to pi/2 -> -pi/2! -! range, otherwise see in-line comment ! -! xlon (IX) : grid longitude in radians (not used) ! -! slmsk (IX) : sea/land mask array (sea:0,land:1,sea-ice:2) ! -! IX : horizontal dimention ! -! NLAY,NLP1 : vertical layer/level dimensions ! -! cldtot : unified cloud fracrion from moist physics ! -! effrl (ix,nlay) : effective radius for liquid water ! -! effri (ix,nlay) : effective radius for ice water ! -! effrr (ix,nlay) : effective radius for rain water ! -! effrs (ix,nlay) : effective radius for snow water ! -! effr_in : logical - if .true. use input effective radii ! -! dz (ix,nlay) : layer thickness (km) ! -! delp (ix,nlay) : model layer pressure thickness in mb (100Pa) ! +! plyr (IX,NLAY) : model layer mean pressure in mb (100Pa) ! +! plvl (IX,NLP1) : model level pressure in mb (100Pa) ! +! tlyr (IX,NLAY) : model layer mean temperature in k ! +! tvly (IX,NLAY) : model layer virtual temperature in k ! +! ccnd (IX,NLAY,ncnd) : layer cloud condensate amount ! +! water, ice, rain, snow (+ graupel) ! +! ncnd : number of layer cloud condensate types (max of 4) ! +! xlat (IX) : grid latitude in radians, default to pi/2 -> -pi/2! +! range, otherwise see in-line comment ! +! xlon (IX) : grid longitude in radians (not used) ! +! slmsk (IX) : sea/land mask array (sea:0,land:1,sea-ice:2) ! +! IX : horizontal dimention ! +! NLAY,NLP1 : vertical layer/level dimensions ! +! cldtot : unified cloud fracrion from moist physics ! +! effrl (ix,nlay) : effective radius for liquid water ! +! effri (ix,nlay) : effective radius for ice water ! +! effrr (ix,nlay) : effective radius for rain water ! +! effrs (ix,nlay) : effective radius for snow water ! +! effr_in : logical - if .true. use input effective radii ! +! dz (ix,nlay) : layer thickness (km) ! +! delp (ix,nlay) : model layer pressure thickness in mb (100Pa) ! ! ! ! output variables: ! ! clouds(IX,NLAY,NF_CLDS) : cloud profiles ! @@ -2818,7 +2819,7 @@ subroutine progclduni & ! --- local variables: real (kind=kind_phys), dimension(IX,NLAY) :: cldcnv, cwp, cip, & - & crp, csp, rew, rei, res, rer, tem2d + & crp, csp, rew, rei, res, rer real (kind=kind_phys), dimension(IX,NLAY,ncnd) :: cndf real (kind=kind_phys) :: ptop1(IX,NK_CLDS+1), rxlat(ix) @@ -2830,47 +2831,23 @@ subroutine progclduni & ! !===> ... begin here ! - do nf=1,nf_clds - do k=1,nlay - do i=1,ix - clouds(i,k,nf) = 0.0 - enddo +! do nf=1,nf_clds +! do k=1,nlay +! do i=1,ix +! clouds(i,k,nf) = 0.0 +! enddo +! enddo +! enddo +! + do k = 1, NLAY + do i = 1, IX + cldcnv(i,k) = 0.0 + cwp(i,k) = 0.0 + cip(i,k) = 0.0 + crp(i,k) = 0.0 + csp(i,k) = 0.0 enddo enddo -! clouds(:,:,:) = 0.0 - - if (effr_in) then - do k = 1, NLAY - do i = 1, IX - cldcnv(i,k) = 0.0 - cwp (i,k) = 0.0 - cip (i,k) = 0.0 - crp (i,k) = 0.0 - csp (i,k) = 0.0 - rew (i,k) = effrl (i,k) - rei (i,k) = max(10.0, min(150.0,effri (i,k))) - rer (i,k) = effrr (i,k) - res (i,k) = effrs (i,k) - tem2d (i,k) = min( 1.0, max( 0.0,(con_ttp-tlyr(i,k))*0.05)) - enddo - enddo - else - do k = 1, NLAY - do i = 1, IX - cldcnv(i,k) = 0.0 - cwp (i,k) = 0.0 - cip (i,k) = 0.0 - crp (i,k) = 0.0 - csp (i,k) = 0.0 - rew (i,k) = reliq_def ! default liq radius to 10 micron - rei (i,k) = reice_def ! default ice radius to 50 micron - rer (i,k) = rrain_def ! default rain radius to 1000 micron - res (i,k) = rsnow_def ! default snow radius to 250 micron - tem2d (i,k) = min(1.0, max(0.0, (con_ttp-tlyr(i,k))*0.05)) - enddo - enddo - endif -! do n=1,ncnd do k = 1, NLAY do i = 1, IX @@ -2878,7 +2855,7 @@ subroutine progclduni & enddo enddo enddo - if ( lcrick ) then + if ( lcrick ) then ! vertical smoorthing do n=1,ncnd do i = 1, IX cndf(i,1,n) = 0.75*ccnd(i,1,n) + 0.25*ccnd(i,2,n) @@ -2893,54 +2870,25 @@ subroutine progclduni & enddo endif -!> - Find top pressure for each cloud domain for given latitude. -! ptopc(k,i): top presure of each cld domain (k=1-4 are sfc,L,m,h; -! --- i=1,2 are low-lat (<45 degree) and pole regions) - - do i =1, IX - rxlat(i) = abs( xlat(i) / con_pi ) ! if xlat in pi/2 -> -pi/2 range -! rxlat(i) = abs(0.5 - xlat(i)/con_pi) ! if xlat in 0 -> pi range - enddo - - do id = 1, 4 - tem1 = ptopc(id,2) - ptopc(id,1) - - do i =1, IX - ptop1(i,id) = ptopc(id,1) + tem1*max( 0.0, 4.0*rxlat(i)-1.0 ) - enddo - enddo - !> -# Compute cloud liquid/ice condensate path in \f$ g/m^2 \f$ . - if (ncnd == 2) then - do k = 1, NLAY - do i = 1, IX - tem1 = gfac * delp(i,k) - cwp(i,k) = cndf(i,k,1) * tem1 - cip(i,k) = cndf(i,k,2) * tem1 - enddo + if (ncnd == 2) then + do k = 1, NLAY + do i = 1, IX + tem1 = gfac * delp(i,k) + cwp(i,k) = cndf(i,k,1) * tem1 + cip(i,k) = cndf(i,k,2) * tem1 enddo - elseif (ncnd == 4 .or. ncnd == 5) then - do k = 1, NLAY - do i = 1, IX - tem1 = gfac * delp(i,k) - cwp(i,k) = cndf(i,k,1) * tem1 - cip(i,k) = cndf(i,k,2) * tem1 - crp(i,k) = cndf(i,k,3) * tem1 - csp(i,k) = cndf(i,k,4) * tem1 - enddo + enddo + elseif (ncnd == 4) then + do k = 1, NLAY + do i = 1, IX + tem1 = gfac * delp(i,k) + cwp(i,k) = cndf(i,k,1) * tem1 + cip(i,k) = cndf(i,k,2) * tem1 + crp(i,k) = cndf(i,k,3) * tem1 + csp(i,k) = cndf(i,k,4) * tem1 enddo - endif - -!> -# Compute effective liquid cloud droplet radius over land. - - if(.not. effr_in) then - do i = 1, IX - if (nint(slmsk(i)) == 1) then - do k = 1, NLAY - rew(i,k) = 5.0 + 5.0 * tem2d(i,k) - enddo - endif enddo endif @@ -2969,10 +2917,39 @@ subroutine progclduni & enddo endif -!> - Compute effective ice cloud droplet radius following -!! Heymsfield and McFarquhar (1996) \cite heymsfield_and_mcfarquhar_1996. +! assign/calculate efective radii for cloud water, ice, rain, snow + + if (effr_in) then + do k = 1, NLAY + do i = 1, IX + rew(i,k) = effrl (i,k) + rei(i,k) = max(10.0, min(150.0,effri (i,k))) + rer(i,k) = effrr (i,k) + res(i,k) = effrs (i,k) + enddo + enddo + else + do k = 1, NLAY + do i = 1, IX + rew(i,k) = reliq_def ! default liq radius to 10 micron + rei(i,k) = reice_def ! default ice radius to 50 micron + rer(i,k) = rrain_def ! default rain radius to 1000 micron + res(i,k) = rsnow_def ! default snow radius to 250 micron + enddo + enddo +!> -# Compute effective liquid cloud droplet radius over land. + do i = 1, IX + if (nint(slmsk(i)) == 1) then + do k = 1, NLAY + tem1 = min(1.0, max(0.0, (con_ttp-tlyr(i,k))*0.05)) + rew(i,k) = 5.0 + 5.0 * tem1 + enddo + endif + enddo + +!> -# Compute effective ice cloud droplet radius following Heymsfield +!! and McFarquhar (1996) \cite heymsfield_and_mcfarquhar_1996. - if(.not. effr_in) then do k = 1, NLAY do i = 1, IX tem2 = tlyr(i,k) - con_ttp @@ -2997,7 +2974,6 @@ subroutine progclduni & enddo enddo endif - ! do k = 1, NLAY do i = 1, IX @@ -3013,8 +2989,24 @@ subroutine progclduni & enddo enddo -! --- ... estimate clouds decorrelation length in km -! this is only a tentative test, need to consider change later +!> -# Find top pressure for each cloud domain for given latitude. +! ptopc(k,i): top presure of each cld domain (k=1-4 are sfc,L,m,h; +! --- i=1,2 are low-lat (<45 degree) and pole regions) + + do i =1, IX + rxlat(i) = abs( xlat(i) / con_pi ) ! if xlat in pi/2 -> -pi/2 range +! rxlat(i) = abs(0.5 - xlat(i)/con_pi) ! if xlat in 0 -> pi range + enddo + + do id = 1, 4 + tem1 = ptopc(id,2) - ptopc(id,1) + do i =1, IX + ptop1(i,id) = ptopc(id,1) + tem1*max( 0.0, 4.0*rxlat(i)-1.0 ) + enddo + enddo + +!> -# Estimate clouds decorrelation length in km +! this is only a tentative test, need to consider change later if ( iovr == 3 ) then do i = 1, ix diff --git a/physics/samfdeepcnv.f b/physics/samfdeepcnv.f index 4577d96d3..d4b48af35 100644 --- a/physics/samfdeepcnv.f +++ b/physics/samfdeepcnv.f @@ -104,7 +104,7 @@ end subroutine samfdeepcnv_finalize !! | cnv_ndrop | number_concentration_of_cloud_liquid_water_particles_for_detrainment | droplet number concentration in convective detrainment | m-3 | 2 | real | kind_phys | inout | F | !! | cnv_nice | number_concentration_of_ice_crystals_for_detrainment | crystal number concentration in convective detrainment | m-3 | 2 | real | kind_phys | inout | F | !! | mp_phys | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | mp_phys_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman rmicrophysics scheme | flag | 0 | integer | | in | F | +!! | mp_phys_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | !! | clam | entrainment_rate_coefficient_deep_convection | entrainment rate coefficient for deep conv. | none | 0 | real | kind_phys | in | F | !! | c0s | rain_conversion_parameter_deep_convection | convective rain conversion parameter for deep conv. | m-1 | 0 | real | kind_phys | in | F | !! | c1 | detrainment_conversion_parameter_deep_convection | convective detrainment conversion parameter for deep conv. | m-1 | 0 | real | kind_phys | in | F | diff --git a/physics/samfshalcnv.f b/physics/samfshalcnv.f index de64cf211..183467d4b 100644 --- a/physics/samfshalcnv.f +++ b/physics/samfshalcnv.f @@ -1880,7 +1880,6 @@ subroutine samfshalcnv_post_run (im, levs, lssav, shcnvcw, frain, character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - real(kind=kind_phys), dimension(im) :: raincs integer :: i, k ! Initialize CCPP error handling variables @@ -1888,15 +1887,8 @@ subroutine samfshalcnv_post_run (im, levs, lssav, shcnvcw, frain, errflg = 0 do i=1,im - raincs(i) = frain * rain1(i) - rainc(i) = rainc(i) + raincs(i) + rainc(i) = rainc(i) + frain * rain1(i) enddo - if (lssav) then - do i=1,im - cnvprcp(i) = cnvprcp(i) + raincs(i) - cnvprcpb(i) = cnvprcpb(i) + raincs(i) - enddo - endif ! in mfshalcnv, 'cnvw' and 'cnvc' are set to zero before computation starts: if (shcnvcw .and. num_p3d == 4 .and. npdf3d == 3) then do k=1,levs diff --git a/physics/sfc_diag.f b/physics/sfc_diag.f index 86fb9f39b..7200e9231 100644 --- a/physics/sfc_diag.f +++ b/physics/sfc_diag.f @@ -28,6 +28,12 @@ end subroutine sfc_diag_finalize !! | v1 | y_wind_at_lowest_model_layer_updated_by_physics | y component of 1st model layer wind | m s-1 | 1 | real | kind_phys | in | F | !! | t1 | air_temperature_at_lowest_model_layer_updated_by_physics | 1st model layer air temperature | K | 1 | real | kind_phys | in | F | !! | q1 | water_vapor_specific_humidity_at_lowest_model_layer_updated_by_physics | 1st model layer specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | +!! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | +!! | evap | kinematic_surface_upward_latent_heat_flux | surface upward evaporation flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | +!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | +!! | fm10 | Monin-Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | +!! | fh2 | Monin-Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | !! | tskin | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | !! | qsurf | surface_specific_humidity | surface specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | !! | f10m | ratio_of_wind_at_lowest_model_layer_and_wind_at_10m | ratio of fm10 and fm | ratio | 1 | real | kind_phys | out | F | @@ -35,12 +41,6 @@ end subroutine sfc_diag_finalize !! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | out | F | !! | t2m | temperature_at_2m | temperature at 2 m | K | 1 | real | kind_phys | out | F | !! | q2m | specific_humidity_at_2m | specific humidity at 2 m | kg kg-1 | 1 | real | kind_phys | out | F | -!! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | surface upward evaporation flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | -!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | -!! | fm10 | Monin-Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | -!! | fh2 | Monin-Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! @@ -48,9 +48,9 @@ end subroutine sfc_diag_finalize !! \section detailed Detailed Algorithm !! @{ subroutine sfc_diag_run & - & (im,grav,cp,eps,epsm1,ps,u1,v1,t1,q1, & - & tskin,qsurf,f10m,u10m,v10m,t2m,q2m, & - & prslki,evap,fm,fh,fm10,fh2,errmsg,errflg & + & (im,grav,cp,eps,epsm1,ps,u1,v1,t1,q1,prslki, & + & evap,fm,fh,fm10,fh2,tskin,qsurf, & + & f10m,u10m,v10m,t2m,q2m,errmsg,errflg & & ) ! use machine , only : kind_phys @@ -70,7 +70,7 @@ subroutine sfc_diag_run & ! locals ! real(kind=kind_phys), parameter :: qmin=1.0e-8 - integer ::k,i + integer :: k,i ! real(kind=kind_phys) :: fhi, qss, wrk ! real(kind=kind_phys) sig2k, fhi, qss diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index ff503d3b2..5361b6355 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -59,7 +59,6 @@ end subroutine sfc_diff_finalize !! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | !! | dry | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | !! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | -!! | fice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | !! | tskin_ocn | surface_skin_temperature_over_ocean_interstitial | surface skin temperature over ocean (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | !! | tskin_lnd | surface_skin_temperature_over_land_interstitial | surface skin temperature over land (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | !! | tskin_ice | surface_skin_temperature_over_ice_interstitial | surface skin temperature over ice (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | @@ -135,7 +134,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) & sigmaf,vegtype,shdmax,ivegsrc, & !intent(in) & z0pert,ztpert, & ! mg, sfc-perts !intent(in) & flag_iter,redrag, & !intent(in) - & wet,dry,icy,fice, & !intent(in) + & wet,dry,icy, & !intent(in) & tskin_ocn, tskin_lnd, tskin_ice, & !intent(in) & tsurf_ocn, tsurf_lnd, tsurf_ice, & !intent(in) & snwdph_ocn,snwdph_lnd,snwdph_ice, & !intent(in) @@ -170,8 +169,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) real(kind=kind_phys), dimension(im), intent(in) :: & & tskin_ocn, tskin_lnd, tskin_ice, & & tsurf_ocn, tsurf_lnd, tsurf_ice, & - & snwdph_ocn,snwdph_lnd,snwdph_ice, & - & fice + & snwdph_ocn,snwdph_lnd,snwdph_ice real(kind=kind_phys), dimension(im), intent(inout) :: & & z0rl_ocn, z0rl_lnd, z0rl_ice, & @@ -237,24 +235,24 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) & + max(0.0, min(ddvel(i), 30.0)), 1.0) tem1 = 1.0 + rvrdm1 * max(q1(i),1.e-8) thv1 = t1(i) * prslki(i) * tem1 - tvs_ocn = 0.5 * (tsurf_ocn(i)+tskin_ocn(i)) * tem1 tvs_lnd = 0.5 * (tsurf_lnd(i)+tskin_lnd(i)) * tem1 tvs_ice = 0.5 * (tsurf_ice(i)+tskin_ice(i)) * tem1 + tvs_ocn = 0.5 * (tsurf_ocn(i)+tskin_ocn(i)) * tem1 qs1 = fpvs(t1(i)) qs1 = max(1.0e-8, eps * qs1 / (prsl1(i) + epsm1 * qs1)) - z0_ocn = 0.01 * z0rl_ocn(i) - z0max_ocn = max(1.0e-6, min(z0_ocn,z1(i))) - z0_lnd = 0.01 * z0rl_lnd(i) - z0max_lnd = max(1.0e-6, min(z0_lnd,z1(i))) - z0_ice = 0.01 * z0rl_ice(i) - z0max_ice = max(1.0e-6, min(z0_ice,z1(i))) + z0_lnd = 0.01 * z0rl_lnd(i) + z0max_lnd = max(1.0e-6, min(z0_lnd,z1(i))) + z0_ice = 0.01 * z0rl_ice(i) + z0max_ice = max(1.0e-6, min(z0_ice,z1(i))) + z0_ocn = 0.01 * z0rl_ocn(i) + z0max_ocn = max(1.0e-6, min(z0_ocn,z1(i))) ! compute stability dependent exchange coefficients ! this portion of the code is presently suppressed ! - if (wet(i) .and. fice(i) < 1.) then ! some open ocean + if (wet(i)) then ! some open ocean ustar_ocn(i) = sqrt(grav * z0_ocn / charnock) !** test xubin's new z0 @@ -346,7 +344,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ztmax_ice = max(ztmax_ice,1.0e-6) ! BWG begin "stability" block, 2019-03-23 - if (wet(i) .and. fice(i) < 1.) then ! Some open ocean + if (wet(i)) then ! Some open ocean call stability ! --- inputs: & (z1(i),snwdph_ocn(i),thv1,wind(i), @@ -382,7 +380,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! ! update z0 over ocean ! - if (wet(i) .and. fice(i) < 1.) then + if (wet(i)) then z0_ocn = (charnock / grav) * ustar_ocn(i) * ustar_ocn(i) ! mbek -- toga-coare flux algorithm diff --git a/physics/sfc_drv.f b/physics/sfc_drv.f index 51ed2fe98..ffe47ee17 100644 --- a/physics/sfc_drv.f +++ b/physics/sfc_drv.f @@ -514,13 +514,12 @@ subroutine lsm_noah_run & !! 0.5 and the perturbations go to zero as vegetation fraction approaches its upper !! or lower bound. vegfp = vegfpert(i) ! sfc-perts, mgehne - ! sfc perts, mgehne if (pertvegf(1)>0.0) then ! compute beta distribution parameters for vegetation fraction mv = shdfac sv = pertvegf(1)*mv*(1.-mv) - alphav = mv*mv*(1.-mv)/(sv*sv)-mv - betav = alphav*(1.-mv)/mv + alphav = mv*mv*(1.0-mv)/(sv*sv)-mv + betav = alphav*(1.0-mv)/mv ! compute beta distribution value corresponding ! to the given percentile albPpert to use as new albedo call ppfbet(vegfp,alphav,betav,iflag,vegftmp) diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index f7899a75d..0dd2cf286 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -189,8 +189,8 @@ end subroutine lsm_ruc_finalize !! | snet | surface_net_downwelling_shortwave_flux | surface net downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | !! | sfcemis | surface_longwave_emissivity | surface lw emissivity in fraction | frac | 1 | real | kind_phys | inout | F | !! | wspd | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | inout | F | -!! | cm | surface_drag_coefficient_for_momentum_in_air | surface exchange coeff for momentum | none | 1 | real | kind_phys | in | F | -!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air | surface exchange coeff heat & moisture | none | 1 | real | kind_phys | in | F | +!! | cm | surface_drag_coefficient_for_momentum_in_air_over_land | surface exchange coeff for momentum over land | none | 1 | real | kind_phys | in | F | +!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_land | surface exchange coeff heat & moisture over land | none | 1 | real | kind_phys | in | F | !! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land | thermal exchange coefficient over land | kg m-2 s-1 | 1 | real | kind_phys | inout | F | !! | cmm | surface_drag_wind_speed_for_momentum_in_air_over_land | momentum exchange coefficient over land | m s-1 | 1 | real | kind_phys | inout | F | !! | wet1 | normalized_soil_wetness | normalized soil wetness | frac | 1 | real | kind_phys | inout | F | @@ -222,9 +222,9 @@ end subroutine lsm_ruc_finalize !! | smfrkeep | volume_fraction_of_frozen_soil_moisture_for_land_surface_model | volume fraction of frozen soil moisture for lsm | frac | 2 | real | kind_phys | inout | F | !! | tslb | soil_temperature_for_land_surface_model | soil temperature for land surface model | K | 2 | real | kind_phys | inout | F | !! | stm | soil_moisture_content | soil moisture content | kg m-2 | 1 | real | kind_phys | inout | F | -!! | tskin | surface_skin_temperature_over_land_interstitial | surface skin temperature over land (temporary use as interstitial)| K | 1 | real | kind_phys | inout | F | +!! | tskin | surface_skin_temperature_over_land_interstitial | surface skin temperature over land use as interstitial | K | 1 | real | kind_phys | inout | F | !! | tsurf | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | inout | F | -!! | tice | sea_ice_temperature | sea ice surface skin temperature | K | 1 | real | kind_phys | inout | F | +!! | tice | sea_ice_temperature_interstitial | sea ice surface skin temperature use as interstitial | K | 1 | real | kind_phys | inout | F | !! | tsnow | snow_temperature_bottom_first_layer | snow temperature at the bottom of first snow layer | K | 1 | real | kind_phys | inout | F | !! | snowfallac | total_accumulated_snowfall | run-total snow accumulation on the ground | kg m-2 | 1 | real | kind_phys | inout | F | !! | acsnow | accumulated_water_equivalent_of_frozen_precip | snow water equivalent of run-total frozen precip | kg m-2 | 1 | real | kind_phys | inout | F | diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f index a0e60f380..1e2eeb3e0 100644 --- a/physics/sfc_nst.f +++ b/physics/sfc_nst.f @@ -165,8 +165,8 @@ subroutine sfc_nst_run & ! ch - real, surface exchange coeff heat & moisture(m/s) im ! ! prsl1 - real, surface layer mean pressure (pa) im ! ! prslki - real, im ! -! wet - logical, =T if any ocn/lak water (F otherwise) im ! -! icy - logical, =T if "enough" ice (F otherwise) im ! +! wet - logical, =T if any ocn/lake water (F otherwise) im ! +! icy - logical, =T if any ice im ! ! xlon - real, longitude (radians) im ! ! sinlat - real, sin of latitude im ! ! stress - real, wind stress (n/m**2) im ! @@ -620,8 +620,8 @@ subroutine sfc_nst_run & & zsea1,zsea2,dtz) tsurf(i) = max(271.2, tref(i) + dtz ) - if (lprnt .and. i == ipr) print *,' tsurf=',tsurf(i),' tref=', - &tref(i),' xz=',xz(i),' dt_cool=',dt_cool(i) +! if (lprnt .and. i == ipr) print *,' tsurf=',tsurf(i),' tref=', +! &tref(i),' xz=',xz(i),' dt_cool=',dt_cool(i) !> - Call cal_w() to calculate \a w_0 and \a w_d. if ( xt(i) > 0.0 ) then @@ -667,9 +667,9 @@ subroutine sfc_nst_run & ! if ( nstf_name1 > 1 ) then tskin(i) = tsurf(i) - endif ! if ( nstf_name1 > 1 then - endif ! if(flag_guess(i)) then - endif ! if(wet(i) .and. .not.icy(i)) then + endif ! if nstf_name1 > 1 + endif ! if flag_guess(i) + endif ! if wet(i) .and. .not.icy(i) enddo ! if (lprnt .and. i == ipr) print *,' beg xz8=',xz(i) @@ -799,21 +799,6 @@ subroutine sfc_nst_pre_run errmsg = '' errflg = 0 - do i=1,im - if(icy(i)) then - zorl_ocn(i) = zorl_ice(i) - cd_ocn(i) = cd_ice(i) - cdq_ocn(i) = cdq_ice(i) - rb_ocn(i) = rb_ice(i) - stress_ocn(i) = stress_ice(i) - ffmm_ocn(i) = ffmm_ice(i) - ffhh_ocn(i) = ffhh_ice(i) - uustar_ocn(i) = uustar_ice(i) - fm10_ocn(i) = fm10_ice(i) - fh2_ocn(i) = fh2_ice(i) - endif - enddo - do i=1,im if (wet(i) .and. .not. icy(i)) then tem = (oro(i)-oro_uf(i)) * rlapse @@ -923,7 +908,7 @@ subroutine sfc_nst_post_run & do i = 1, im if (wet(i) .and. .not. icy(i)) then - tsurf_ocn(i) = tsurf_ocn(i) - (oro(i)-oro_uf(i)) * rlapse + tsurf_ocn(i) = tsurf_ocn(i) - (oro(i)-oro_uf(i)) * rlapse endif enddo @@ -938,7 +923,7 @@ subroutine sfc_nst_post_run & & im, 1, dtzm) do i = 1, im if ( wet(i) .and. .not. icy(i) ) then - tsfc_ocn(i) = max(271.2,tref(i) + dtzm(i)) - & + tsfc_ocn(i) = max(271.2,tref(i) + dtzm(i)) - & & (oro(i)-oro_uf(i))*rlapse endif enddo diff --git a/physics/sfc_ocean.F b/physics/sfc_ocean.F index a0a835555..e5cb95232 100644 --- a/physics/sfc_ocean.F +++ b/physics/sfc_ocean.F @@ -37,7 +37,6 @@ end subroutine sfc_ocean_finalize !! | prsl1 | air_pressure_at_lowest_model_layer | surface layer mean pressure | Pa | 1 | real | kind_phys | in | F | !! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | !! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | -!! | fice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | !! | ddvel | surface_wind_enhancement_due_to_convection | wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | !! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | !! | qsurf | surface_specific_humidity_over_ocean | surface air saturation specific humidity over ocean | kg kg-1 | 1 | real | kind_phys | inout | F | @@ -55,7 +54,7 @@ subroutine sfc_ocean_run & !................................... ! --- inputs: & ( im, cp, rd, eps, epsm1, hvap, rvrdm1, ps, u1, v1, t1, q1, & - & tskin, cm, ch, prsl1, prslki, wet, fice, ddvel, & + & tskin, cm, ch, prsl1, prslki, wet, ddvel, & & flag_iter, & ! --- outputs: & qsurf, cmm, chh, gflux, evap, hflx, ep, & @@ -70,7 +69,7 @@ subroutine sfc_ocean_run & ! call sfc_ocean ! ! inputs: ! ! ( im, ps, u1, v1, t1, q1, tskin, cm, ch, ! -! prsl1, prslki, wet, fice, ddvel, flag_iter, ! +! prsl1, prslki, wet, ddvel, flag_iter, ! ! outputs: ! ! qsurf, cmm, chh, gflux, evap, hflx, ep ) ! ! ! @@ -102,7 +101,6 @@ subroutine sfc_ocean_run & ! prsl1 - real, surface layer mean pressure im ! ! prslki - real, im ! ! wet - logical, =T if any ocean/lak, =F otherwise im ! -! fice - real, ice fraction im ! ! ddvel - real, wind enhancement due to convection (m/s) im ! ! flag_iter- logical, im ! ! ! @@ -128,7 +126,7 @@ subroutine sfc_ocean_run & & rvrdm1 real (kind=kind_phys), dimension(im), intent(in) :: ps, u1, v1, & - & t1, q1, tskin, cm, ch, prsl1, prslki, ddvel, fice + & t1, q1, tskin, cm, ch, prsl1, prslki, ddvel logical, dimension(im), intent(in) :: flag_iter, wet @@ -159,7 +157,7 @@ subroutine sfc_ocean_run & ! ! --- ... flag for open water do i = 1, im - flag(i) = (wet(i) .and. fice(i)<1. .and. flag_iter(i)) + flag(i) = (wet(i) .and. flag_iter(i)) ! --- ... initialize variables. all units are supposedly m.k.s. unless specified ! ps is in pascals, wind is wind speed, diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index 19b05f789..58f1c0549 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -1,82 +1,6 @@ !> \file sfc_sice.f !! This file contains the GFS three level thermodynamic sea ice model. -!> This module comtains the CCPP-compliant GFS sea ice post interstitial codes, which returns -!! updated ice thickness and concentration to global arrays -!! where there is no ice, and set temperature to surface skin temperature. - module sfc_sice_post - - contains - -!! \section arg_table_sfc_sice_post_init Argument Table -!! - subroutine sfc_sice_post_init - end subroutine sfc_sice_post_init - -!! \section arg_table_sfc_sice_post_finalize Argument Table -!! - subroutine sfc_sice_post_finalize - end subroutine sfc_sice_post_finalize - -!! \section arg_table_sfc_sice_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-------------------------------------------------------|---------------------------------------------------|-------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | -!! | islmsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | in | F | -!! | tice | sea_ice_temperature_interstitial | sea-ice surface temperature use as interstitial | K | 1 | real | kind_phys | in | F | -!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | -!! | fice | sea_ice_concentration | sea-ice concentration [0,1] | frac | 1 | real | kind_phys | inout | F | -!! | hice | sea_ice_thickness | sea-ice thickness | m | 1 | real | kind_phys | inout | F | -!! | tisfc | sea_ice_temperature | sea-ice surface temperature | K | 1 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine sfc_sice_post_run(im, cplflx, islmsk, tice, tsfc, & - & fice, hice, tisfc, errmsg, errflg) - - use machine, only : kind_phys - - implicit none - -! --- input - integer, intent(in) :: im - logical, intent(in) :: cplflx - integer, dimension(im), intent(in) :: islmsk - real(kind=kind_phys), dimension(im), intent(in) :: tice, tsfc - -! --- input/output - real(kind=kind_phys), dimension(im), intent(inout) :: fice, hice, & - & tisfc - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -! --- locals - integer :: i - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - -!--- return updated ice thickness & concentration to global arrays -! where there is no ice, set temperature to surface skin temperature. - if(.not. cplflx) then - do i = 1, im - if (islmsk(i) == 2) then - tisfc(i) = tice(i) - else - hice(i) = 0.0 - fice(i) = 0.0 - tisfc(i) = tsfc(i) - endif - enddo - endif - - end subroutine sfc_sice_post_run - - end module sfc_sice_post - !> This module contains the CCPP-compliant GFS sea ice scheme. module sfc_sice @@ -124,8 +48,6 @@ end subroutine sfc_sice_finalize !! | islimsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | in | F | !! | ddvel | surface_wind_enhancement_due_to_convection | wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | !! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | -!! | mom4ice | flag_for_mom4_coupling | flag for Mom4 coupling | flag | 0 | logical | | in | F | -!! | lsm | flag_for_land_surface_scheme | flag for land sfc scheme =0: osu; =1: noah | flag | 0 | integer | | in | F | !! | lprnt | flag_print | switch for printing sample column to stdout | flag | 0 | logical | | in | F | !! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | !! | hice | sea_ice_thickness | sea-ice thickness | m | 1 | real | kind_phys | inout | F | @@ -174,7 +96,7 @@ subroutine sfc_sice_run & & t0c, rd, cimin, ps, u1, v1, t1, q1, delt, & & sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, & & cm, ch, prsl1, prslki, islimsk, ddvel, & - & flag_iter, mom4ice, lsm, lprnt, ipr, & + & flag_iter, lprnt, ipr, & & hice, fice, tice, weasd, tskin, tprcp, stc, ep, & ! --- input/outputs: & snwdph, qsurf, snowmt, gflux, cmm, chh, evap, hflx, & ! --- outputs: & errmsg, errflg @@ -190,7 +112,7 @@ subroutine sfc_sice_run & ! ( im, km, ps, u1, v1, t1, q1, delt, ! ! sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, ! ! cm, ch, prsl1, prslki, islimsk, ddvel, ! -! flag_iter, mom4ice, lsm, ! +! flag_iter, ! ! input/outputs: ! ! hice, fice, tice, weasd, tskin, tprcp, stc, ep, ! ! outputs: ! @@ -203,7 +125,8 @@ subroutine sfc_sice_run & !! two-layer ice model !!- 200x -- sarah lu added flag_iter !!- oct 2006 -- h. wei added cmm and chh to output -!!- 2007 -- x. wu modified for mom4 coupling (i.e. mom4ice) +!!- 2007 -- x. wu modified for mom4 coupling (i.e. cpldice) +!! (not used anymore) !!- 2007 -- s. moorthi micellaneous changes !!- may 2009 -- y.-t. hou modified to include surface emissivity !! effect on lw radiation. replaced the confusing @@ -236,9 +159,6 @@ subroutine sfc_sice_run & ! islimsk - integer, sea/land/ice mask (=0/1/2) im ! ! ddvel - real, im ! ! flag_iter- logical, im ! -! mom4ice - logical, im ! -! lsm - integer, flag for land surface model scheme 1 ! -! =0: use osu scheme; =1: use noah scheme ! ! ! ! input/outputs: ! ! hice - real, sea-ice thickness im ! @@ -268,16 +188,17 @@ subroutine sfc_sice_run & implicit none ! ! - Define constant parameters - integer, parameter :: kmi = 2 !< 2-layer of ice - real(kind=kind_phys), parameter :: himax = 8.0 !< maximum ice thickness allowed - real(kind=kind_phys), parameter :: himin = 0.1 !< minimum ice thickness required - real(kind=kind_phys), parameter :: hsmax = 2.0 !< maximum snow depth allowed - real(kind=kind_phys), parameter :: timin = 173.0 !< minimum temperature allowed for snow/ice - real(kind=kind_phys), parameter :: albfw = 0.06 !< albedo for lead - real(kind=kind_phys), parameter :: dsi = 1.0/0.33 + integer, parameter :: kmi = 2 !< 2-layer of ice + real(kind=kind_phys), parameter :: zero = 0.0d0, one = 1.0d0 + real(kind=kind_phys), parameter :: himax = 8.0d0 !< maximum ice thickness allowed + real(kind=kind_phys), parameter :: himin = 0.1d0 !< minimum ice thickness required + real(kind=kind_phys), parameter :: hsmax = 2.0d0 !< maximum snow depth allowed + real(kind=kind_phys), parameter :: timin = 173.0d0 !< minimum temperature allowed for snow/ice + real(kind=kind_phys), parameter :: albfw = 0.06d0 !< albedo for lead + real(kind=kind_phys), parameter :: dsi = one/0.33d0 ! --- inputs: - integer, intent(in) :: im, km, lsm, ipr + integer, intent(in) :: im, km, ipr logical, intent(in) :: lprnt real (kind=kind_phys), intent(in) :: sbc, hvap, tgice, cp, eps, & @@ -291,7 +212,6 @@ subroutine sfc_sice_run & real (kind=kind_phys), intent(in) :: delt logical, dimension(im), intent(in) :: flag_iter - logical, intent(in) :: mom4ice ! --- input/outputs: real (kind=kind_phys), dimension(im), intent(inout) :: hice, & @@ -310,7 +230,7 @@ subroutine sfc_sice_run & real (kind=kind_phys), dimension(im) :: ffw, evapi, evapw, & & sneti, snetw, hfd, hfi, & ! & hflxi, hflxw, sneti, snetw, qssi, qssw, hfd, hfi, hfw, & - & focn, snof, hi_save, hs_save, rch, rho, & + & focn, snof, rch, rho, & & snowd, theta1 real (kind=kind_phys) :: t12, t14, tem, stsice(im,kmi) @@ -323,8 +243,8 @@ subroutine sfc_sice_run & ! !===> ... begin here ! - cpinv = 1.0/cp - hvapi = 1.0/hvap + cpinv = one/cp + hvapi = one/hvap elocp = hvap/cp ! Initialize CCPP error handling variables @@ -336,11 +256,20 @@ subroutine sfc_sice_run & do i = 1, im flag(i) = (islimsk(i) == 2) .and. flag_iter(i) if (flag_iter(i) .and. islimsk(i) < 2) then - hice(i) = 0.0 - fice(i) = 0.0 + hice(i) = zero + fice(i) = zero + endif + enddo +! + do i = 1, im + if (flag(i)) then + if (srflag(i) > zero) then + ep(i) = ep(i)*(one-srflag(i)) + weasd(i) = weasd(i) + 1.e3*tprcp(i)*srflag(i) + tprcp(i) = tprcp(i)*(one-srflag(i)) + endif endif enddo - !> - Update/read sea ice temperature from soil temperature and initialize variables. do k = 1, kmi @@ -350,25 +279,6 @@ subroutine sfc_sice_run & endif enddo enddo -! - if (mom4ice) then - do i = 1, im - if (flag(i)) then ! sea ice - hi_save(i) = hice(i) - hs_save(i) = weasd(i) * 0.001 - endif - enddo - elseif (lsm > 0) then ! --- ... snow-rain detection - do i = 1, im - if (flag(i)) then - if (srflag(i) > 0) then - ep(i) = ep(i)*(1.-srflag(i)) - weasd(i) = weasd(i) + 1.e3*tprcp(i)*srflag(i) - tprcp(i) = tprcp(i)*(1.-srflag(i)) - endif - endif - enddo - endif ! --- ... initialize variables. all units are supposedly m.k.s. unless specifie ! psurf is in pascals, wind is wind speed, theta1 is adiabatic surface @@ -385,25 +295,24 @@ subroutine sfc_sice_run & ! sfcnsw is the net shortwave flux (direction: dn-up) wind = max(sqrt(u1(i)*u1(i) + v1(i)*v1(i)) & - & + max(0.0, min(ddvel(i), 30.0)), 1.0) + & + max(zero, min(ddvel(i), 30.0d0)), one) q0 = max(q1(i), 1.0e-8) ! tsurf(i) = tskin(i) theta1(i) = t1(i) * prslki(i) - rho(i) = prsl1(i) / (rd*t1(i)*(1.0+rvrdm1*q0)) + rho(i) = prsl1(i) / (rd*t1(i)*(one+rvrdm1*q0)) qs1 = fpvs(t1(i)) qs1 = max(eps*qs1 / (prsl1(i) + epsm1*qs1), 1.e-8) q0 = min(qs1, q0) - ffw(i) = 1.0 - fice(i) if (fice(i) < cimin) then print *,'warning: ice fraction is low:', fice(i) fice(i) = cimin - ffw (i) = 1.0 - fice(i) tice(i) = tgice tskin(i)= tgice print *,'fix ice fraction: reset it to:', fice(i) endif + ffw(i) = 1.0 - fice(i) qssi = fpvs(tice(i)) qssi = eps*qssi / (ps(i) + epsm1*qssi) @@ -412,11 +321,7 @@ subroutine sfc_sice_run & !> - Convert snow depth in water equivalent from mm to m unit. - if (mom4ice) then - snowd(i) = weasd(i) * 0.001 / fice(i) - else - snowd(i) = weasd(i) * 0.001 - endif + snowd(i) = weasd(i) * 0.001d0 ! flagsnw(i) = .false. ! --- ... when snow depth is less than 1 mm, a patchy snow is assumed and @@ -436,10 +341,8 @@ subroutine sfc_sice_run & evapw(i) = elocp * rch(i) * (qssw - q0) ! evap(i) = fice(i)*evapi(i) + ffw(i)*evapw(i) -! if (lprnt) write(0,*)' tice=',tice(ipr) - - snetw(i) = sfcdsw(i) * (1.0 - albfw) - snetw(i) = min(3.0*sfcnsw(i)/(1.0+2.0*ffw(i)), snetw(i)) + snetw(i) = sfcdsw(i) * (one - albfw) + snetw(i) = min(3.0*sfcnsw(i)/(one+2.0d0*ffw(i)), snetw(i)) !> - Calculate net solar incoming at top \a sneti. sneti(i) = (sfcnsw(i) - ffw(i)*snetw(i)) / fice(i) @@ -451,8 +354,8 @@ subroutine sfc_sice_run & hfi(i) = -dlwflx(i) + sfcemis(i)*sbc*t14 + evapi(i) & & + rch(i)*(tice(i) - theta1(i)) !> - Calculate heat flux derivative at surface \a hfd. - hfd(i) = 4.0*sfcemis(i)*sbc*tice(i)*t12 & - & + (1.0 + elocp*eps*hvap*qs1/(rd*t12)) * rch(i) + hfd(i) = 4.0d0*sfcemis(i)*sbc*tice(i)*t12 & + & + (one + elocp*eps*hvap*qs1/(rd*t12)) * rch(i) t12 = tgice * tgice t14 = t12 * t12 @@ -464,14 +367,14 @@ subroutine sfc_sice_run & !> - Assigin heat flux from ocean \a focn and snowfall rate as constants, which !! should be from ocean model and other physics. - focn(i) = 2.0 ! heat flux from ocean - should be from ocn model - snof(i) = 0.0 ! snowfall rate - snow accumulates in gbphys + focn(i) = 2.0d0 ! heat flux from ocean - should be from ocn model + snof(i) = zero ! snowfall rate - snow accumulates in gbphys !> - Initialize snow depth \a snowd. hice(i) = max( min( hice(i), himax ), himin ) snowd(i) = min( snowd(i), hsmax ) - if (snowd(i) > (2.0*hice(i))) then + if (snowd(i) > (2.0d0*hice(i))) then print *, 'warning: too much snow :',snowd(i) snowd(i) = hice(i) + hice(i) print *,'fix: decrease snow depth to:',snowd(i) @@ -480,23 +383,13 @@ subroutine sfc_sice_run & enddo !> - Call the three-layer thermodynamics sea ice model ice3lay(). -! if (lprnt) write(0,*)' tice2=',tice(ipr) call ice3lay ! --- inputs: ! & ( im, kmi, fice, flag, hfi, hfd, sneti, focn, delt, ! + & lprnt, ipr, ! --- outputs: ! & snowd, hice, stsice, tice, snof, snowmt, gflux ) ! -! if (lprnt) write(0,*)' tice3=',tice(ipr) - if (mom4ice) then - do i = 1, im - if (flag(i)) then - hice(i) = hi_save(i) - snowd(i) = hs_save(i) - endif - enddo - endif - do i = 1, im if (flag(i)) then if (tice(i) < timin) then @@ -589,6 +482,7 @@ subroutine ice3lay !................................... ! --- inputs: & ( im, kmi, fice, flag, hfi, hfd, sneti, focn, delt, & + & lprnt, ipr, ! --- input/outputs: & snowd, hice, stsice, tice, snof, & ! --- outputs: @@ -648,31 +542,32 @@ subroutine ice3lay ! ! --- constant parameters: (properties of ice, snow, and seawater) - real (kind=kind_phys), parameter :: ds = 330.0 !< snow (ov sea ice) density (kg/m^3) - real (kind=kind_phys), parameter :: dw =1000.0 !< fresh water density (kg/m^3) + real (kind=kind_phys), parameter :: ds = 330.0d0 !< snow (ov sea ice) density (kg/m^3) + real (kind=kind_phys), parameter :: dw =1000.0d0 !< fresh water density (kg/m^3) real (kind=kind_phys), parameter :: dsdw = ds/dw real (kind=kind_phys), parameter :: dwds = dw/ds - real (kind=kind_phys), parameter :: t0c =273.15 !< freezing temp of fresh ice (k) - real (kind=kind_phys), parameter :: ks = 0.31 !< conductivity of snow (w/mk) - real (kind=kind_phys), parameter :: i0 = 0.3 !< ice surface penetrating solar fraction - real (kind=kind_phys), parameter :: ki = 2.03 !< conductivity of ice (w/mk) - real (kind=kind_phys), parameter :: di = 917.0 !< density of ice (kg/m^3) + real (kind=kind_phys), parameter :: ks = 0.31d0 !< conductivity of snow (w/mk) + real (kind=kind_phys), parameter :: i0 = 0.3d0 !< ice surface penetrating solar fraction + real (kind=kind_phys), parameter :: ki = 2.03d0 !< conductivity of ice (w/mk) + real (kind=kind_phys), parameter :: di = 917.0d0 !< density of ice (kg/m^3) real (kind=kind_phys), parameter :: didw = di/dw real (kind=kind_phys), parameter :: dsdi = ds/di - real (kind=kind_phys), parameter :: ci = 2054.0 !< heat capacity of fresh ice (j/kg/k) - real (kind=kind_phys), parameter :: li = 3.34e5 !< latent heat of fusion (j/kg-ice) - real (kind=kind_phys), parameter :: si = 1.0 !< salinity of sea ice - real (kind=kind_phys), parameter :: mu = 0.054 !< relates freezing temp to salinity - real (kind=kind_phys), parameter :: tfi = -mu*si !< sea ice freezing temp = -mu*salinity - real (kind=kind_phys), parameter :: tfw = -1.8 !< tfw - seawater freezing temp (c) - real (kind=kind_phys), parameter :: tfi0 = tfi-0.0001 + real (kind=kind_phys), parameter :: ci = 2054.0d0 !< heat capacity of fresh ice (j/kg/k) + real (kind=kind_phys), parameter :: li = 3.34e5 !< latent heat of fusion (j/kg-ice) + real (kind=kind_phys), parameter :: si = 1.0d0 !< salinity of sea ice + real (kind=kind_phys), parameter :: mu = 0.054d0 !< relates freezing temp to salinity + real (kind=kind_phys), parameter :: tfi = -mu*si !< sea ice freezing temp = -mu*salinity + real (kind=kind_phys), parameter :: tfw = -1.8d0 !< tfw - seawater freezing temp (c) + real (kind=kind_phys), parameter :: tfi0 = tfi-0.0001d0 real (kind=kind_phys), parameter :: dici = di*ci real (kind=kind_phys), parameter :: dili = di*li real (kind=kind_phys), parameter :: dsli = ds*li - real (kind=kind_phys), parameter :: ki4 = ki*4.0 + real (kind=kind_phys), parameter :: ki4 = ki*4.0d0 + real (kind=kind_phys), parameter :: zero = 0.0d0, one = 1.0d0 ! --- inputs: - integer, intent(in) :: im, kmi + integer, intent(in) :: im, kmi, ipr + logical :: lprnt real (kind=kind_phys), dimension(im), intent(in) :: fice, hfi, & & hfd, sneti, focn @@ -701,10 +596,10 @@ subroutine ice3lay ! !===> ... begin here ! - dt2 = 2.0 * delt - dt4 = 4.0 * delt - dt6 = 6.0 * delt - dt2i = 1.0 / dt2 + dt2 = 2.0d0 * delt + dt4 = 4.0d0 * delt + dt6 = 6.0d0 * delt + dt2i = one / dt2 do i = 1, im if (flag(i)) then @@ -723,9 +618,9 @@ subroutine ice3lay stsice(i,2) = min(stsice(i,2)-t0c, tfi0) ! degc ip = i0 * sneti(i) ! ip +v (in winton ip=-i0*sneti as sol -v) - if (snowd(i) > 0.0) then - tsf = 0.0 - ip = 0.0 + if (snowd(i) > zero) then + tsf = zero + ip = zero else tsf = tfi ip = i0 * sneti(i) ! ip +v here (in winton ip=-i0*sneti) @@ -745,7 +640,7 @@ subroutine ice3lay !! points (see \a eq.(10) in Winton (2000) \cite winton_2000). k32 = (ki+ki) / hice(i) - wrk = 1.0 / (dt6*k32 + dici*hice(i)) + wrk = one / (dt6*k32 + dici*hice(i)) a10 = dici*hice(i)*dt2i + k32*(dt4*k32 + dici*hice(i))*wrk b10 = -di*hice(i) * (ci*stsice(i,1) + li*tfi/stsice(i,1)) & & * dt2i - ip & @@ -758,7 +653,7 @@ subroutine ice3lay !> - Calculate the new upper ice temperature following \a eq.(21) !! in Winton (2000) \cite winton_2000. - stsice(i,1) = -(sqrt(b1*b1 - 4.0*a1*c1) + b1)/(a1+a1) + stsice(i,1) = -(sqrt(b1*b1 - 4.0d0*a1*c1) + b1)/(a1+a1) tice(i) = (k12*stsice(i,1) - ai) / (k12 + bi) !> - If the surface temperature is greater than the freezing temperature @@ -771,11 +666,11 @@ subroutine ice3lay if (tice(i) > tsf) then a1 = a10 + k12 b1 = b10 - k12*tsf - stsice(i,1) = -(sqrt(b1*b1 - 4.0*a1*c1) + b1)/(a1+a1) + stsice(i,1) = -(sqrt(b1*b1 - 4.0d0*a1*c1) + b1)/(a1+a1) tice(i) = tsf tmelt = (k12*(stsice(i,1)-tsf) - (ai+bi*tsf)) * delt else - tmelt = 0.0 + tmelt =zero snowd(i) = snowd(i) + snof(i)*delt endif !> - Calculate the new lower ice temperature following \a eq.(15) @@ -791,8 +686,8 @@ subroutine ice3lay !> - Calculation of ice and snow mass changes. - h1 = 0.5 * hice(i) - h2 = 0.5 * hice(i) + h1 = 0.5d0 * hice(i) + h2 = 0.5d0 * hice(i) !> - Calculate the top layer thickness. @@ -803,14 +698,14 @@ subroutine ice3lay snowmt(i) = snowd(i) h1 = h1 - (tmelt - snowd(i)*dsli) & & / (di * (ci - li/stsice(i,1)) * (tfi - stsice(i,1))) - snowd(i) = 0.0 + snowd(i) = zero endif ! --- ... and bottom !> - When the energy for bottem melting \f$M_b\f$ is negative (i.e., freezing !! is happening),calculate the bottom layer thickness \f$h_2\f$ and the new !! lower layer temperature (see \a eqs.(24)-(26)). - if (bmelt < 0.0) then + if (bmelt < zero) then dh = -bmelt / (dili + dici*(tfi - tfw)) stsice(i,2) = (h2*stsice(i,2) + dh*tfw) / (h2 + dh) h2 = h2 + dh @@ -823,11 +718,11 @@ subroutine ice3lay hice(i) = h1 + h2 - if (hice(i) > 0.0) then - if (h1 > 0.5*hice(i)) then - f1 = 1.0 - (h2+h2) / hice(i) + if (hice(i) > zero) then + if (h1 > 0.5d0*hice(i)) then + f1 = one - (h2+h2) / hice(i) stsice(i,2) = f1 * (stsice(i,1) + li*tfi/(ci*stsice(i,1)))& - & + (1.0 - f1)*stsice(i,2) + & + (one - f1)*stsice(i,2) if (stsice(i,2) > tfi) then hice(i) = hice(i) - h2*ci*(stsice(i,2) - tfi)/ (li*delt) @@ -836,23 +731,23 @@ subroutine ice3lay else f1 = (h1+h1) / hice(i) stsice(i,1) = f1 * (stsice(i,1) + li*tfi/(ci*stsice(i,1)))& - & + (1.0 - f1)*stsice(i,2) + & + (one - f1)*stsice(i,2) stsice(i,1) = (stsice(i,1) - sqrt(stsice(i,1)*stsice(i,1) & - & - 4.0*tfi*li/ci)) * 0.5 + & - 4.0d0*tfi*li/ci)) * 0.5d0 endif k12 = ki4*ks / (ks*hice(i) + ki4*snowd(i)) gflux(i) = k12 * (stsice(i,1) - tice(i)) else snowd(i) = snowd(i) + (h1*(ci*(stsice(i,1) - tfi) & - & - li*(1.0 - tfi/stsice(i,1))) & + & - li*(one - tfi/stsice(i,1))) & & + h2*(ci*(stsice(i,2) - tfi) - li)) / li - hice(i) = max(0.0, snowd(i)*dsdi) - snowd(i) = 0.0 + hice(i) = max(zero, snowd(i)*dsdi) + snowd(i) = zero stsice(i,1) = tfw stsice(i,2) = tfw - gflux(i) = 0.0 + gflux(i) = zero endif ! end if_hice_block gflux(i) = fice(i) * gflux(i) diff --git a/physics/sflx.f b/physics/sflx.f index 926115f13..102d25fcd 100644 --- a/physics/sflx.f +++ b/physics/sflx.f @@ -345,10 +345,9 @@ subroutine gfssflx &! --- input ! ! --- parameters for heat storage parametrization ! - real (kind=kind_phys) :: cpx, cpx1, cpfac, xx1, xx2, xx3 - real (kind=kind_phys), parameter :: z0min=0.2 - real (kind=kind_phys), parameter :: z0max=1.0 - + real (kind=kind_phys) :: cpx, cpx1, cpfac, xx1, xx2 + real (kind=kind_phys), parameter :: z0min=0.2_kind_phys, & + & z0max=1.0_kind_phys ! !===> ... begin here ! @@ -802,19 +801,18 @@ subroutine gfssflx &! --- input ! ! --- enhance cp as a function of z0 to mimic heat storage ! - cpx = cp - cpx1 = cp1 - cpfac = 1. - if(lheatstrg) then - if((ivegsrc == 1 .and. vegtyp /= 13) - & .or. ivegsrc == 2) then - xx1 = (z0 - z0min) / (z0max - z0min) - xx2 = min(max(xx1, 0.), 1.) - xx3 = 1. + xx2 - cpx = cp * xx3 - cpx1 = cp1 * xx3 - cpfac = cp / cpx - endif + cpx = cp + cpx1 = cp1 + cpfac = 1.0 + if (lheatstrg) then + if ((ivegsrc == 1 .and. vegtyp /= 13) + & .or. ivegsrc == 2) then + xx1 = (z0 - z0min) / (z0max - z0min) + xx2 = 1.0 + min(max(xx1, 0.0), 1.0) + cpx = cp * xx2 + cpx1 = cp1 * xx2 + cpfac = cp / cpx + endif endif !> - Call penman() to calculate potential evaporation (\a etp), @@ -2724,7 +2722,7 @@ subroutine snopac ! --- ... before call shflx in this snowpack case, set zz1 and yy arguments to ! special values that ensure that ground heat flux calculated in shflx -! matches that already computer for below the snowpack, thus the sfc +! matches that already computed for below the snowpack, thus the sfc ! heat flux to be computed in shflx will effectively be the flux at the ! snow top surface. t11 is a dummy arguement so we will not use the ! skin temp value as revised by shflx. From 5be49aefed27221b024237f13086c88e0b483728 Mon Sep 17 00:00:00 2001 From: "Man.Zhang" Date: Tue, 18 Jun 2019 15:08:51 -0600 Subject: [PATCH 13/89] restore schemes deleted in CCPP-SCM v3 release --- physics/GFS_phys_time_vary.fv3.F90 | 486 +++ physics/GFS_rad_time_vary.fv3.F90 | 114 + physics/GFS_stochastics.F90 | 249 ++ physics/GFS_suite_init_finalize_test.F90 | 68 + physics/GFS_time_vary_pre.fv3.F90 | 141 + physics/cu_ntiedtke.F90 | 3840 ++++++++++++++++++++++ physics/cu_ntiedtke_post.F90 | 53 + physics/cu_ntiedtke_pre.F90 | 84 + physics/gcm_shoc.F90 | 2040 ++++++++++++ physics/gscond.f | 526 +++ physics/module_MYNNSFC_wrapper.F90 | 362 ++ physics/moninshoc.f | 607 ++++ physics/ozphys.f | 202 ++ physics/precpd.f | 735 +++++ physics/shinhongvdif.F90 | 2106 ++++++++++++ physics/ysuvdif.F90 | 1271 +++++++ 16 files changed, 12884 insertions(+) create mode 100644 physics/GFS_phys_time_vary.fv3.F90 create mode 100644 physics/GFS_rad_time_vary.fv3.F90 create mode 100644 physics/GFS_stochastics.F90 create mode 100644 physics/GFS_suite_init_finalize_test.F90 create mode 100644 physics/GFS_time_vary_pre.fv3.F90 create mode 100644 physics/cu_ntiedtke.F90 create mode 100644 physics/cu_ntiedtke_post.F90 create mode 100644 physics/cu_ntiedtke_pre.F90 create mode 100644 physics/gcm_shoc.F90 create mode 100644 physics/gscond.f create mode 100644 physics/module_MYNNSFC_wrapper.F90 create mode 100644 physics/moninshoc.f create mode 100644 physics/ozphys.f create mode 100644 physics/precpd.f create mode 100644 physics/shinhongvdif.F90 create mode 100644 physics/ysuvdif.F90 diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 new file mode 100644 index 000000000..b8823fac6 --- /dev/null +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -0,0 +1,486 @@ +!> \file GFS_phys_time_vary.fv3.F90 +!! Contains code related to GFS physics suite setup (physics part of time_vary_step) + +!>\defgroup mod_GFS_phys_time_vary GFS Physics Time Update +!! This module contains GFS physics time vary subroutines including ozone, h2o, i +!! aerosol and IN&CCN updates. + module GFS_phys_time_vary + +#ifdef OPENMP + use omp_lib +#endif + + use ozne_def, only : levozp, oz_coeff, oz_lat, oz_pres, oz_time, ozplin + use ozinterp, only : read_o3data, setindxoz, ozinterpol + + use h2o_def, only : levh2o, h2o_coeff, h2o_lat, h2o_pres, h2o_time, h2oplin + use h2ointerp, only : read_h2odata, setindxh2o, h2ointerpol + + use aerclm_def, only : aerin, aer_pres, ntrcaer, ntrcaerm + use aerinterp, only : read_aerdata, setindxaer, aerinterpol + + use iccn_def, only : ciplin, ccnin, ci_pres + use iccninterp, only : read_cidata, setindxci, ciinterpol + + implicit none + + private + + public GFS_phys_time_vary_init, GFS_phys_time_vary_run, GFS_phys_time_vary_finalize + + logical :: is_initialized = .false. + + contains + +!> \section arg_table_GFS_phys_time_vary_init Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| +!! | Data | GFS_data_type_instance_all_blocks | Fortran DDT containing FV3-GFS data | DDT | 1 | GFS_data_type | | inout | F | +!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | +!! | Interstitial | GFS_interstitial_type_instance_all_threads | Fortran DDT containing FV3-GFS interstitial data | DDT | 1 | GFS_interstitial_type | | inout | F | +!! | nthrds | omp_threads | number of OpenMP threads available for physics schemes | count | 0 | integer | | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, errflg) + + use GFS_typedefs, only: GFS_control_type, GFS_data_type, GFS_interstitial_type + + implicit none + + ! Interface variables + type(GFS_data_type), intent(inout) :: Data(:) + type(GFS_control_type), intent(inout) :: Model + type(GFS_interstitial_type), intent(inout) :: Interstitial(:) + integer, intent(in) :: nthrds + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Local variables + integer :: nb, nblks, nt + integer :: i, j, ix + logical :: non_uniform_blocks + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (is_initialized) return + + nblks = size(Model%blksz) + + ! Non-uniform blocks require special handling: instead + ! of nthrds elements of the Interstitial array, there are + ! nthrds+1 elements. The extra Interstitial(nthrds+1) is + ! allocated for the smaller block length of the last block, + ! while all other elements are allocated to the maximum + ! block length (which is the same for all blocks except + ! the last block). + if (minval(Model%blksz)==maxval(Model%blksz)) then + non_uniform_blocks = .false. + else + non_uniform_blocks = .true. + end if + + ! Consistency check - number of threads passed in via the argument list + ! has to match the size of the Interstitial data type. + if (.not. non_uniform_blocks .and. nthrds/=size(Interstitial)) then + write(errmsg,'(*(a))') 'Logic error: nthrds does not match size of Interstitial variable' + errflg = 1 + return + else if (non_uniform_blocks .and. nthrds+1/=size(Interstitial)) then + write(errmsg,'(*(a))') 'Logic error: nthrds+1 does not match size of Interstitial variable ' // & + '(including extra last element for shorter blocksizes)' + errflg = 1 + return + end if + +!$OMP parallel num_threads(nthrds) default(none) & +!$OMP private (nt,nb) & +!$OMP shared (Model,Data,Interstitial,errmsg,errflg) & +!$OMP shared (levozp,oz_coeff,oz_pres) & +!$OMP shared (levh2o,h2o_coeff,h2o_pres) & +!$OMP shared (ntrcaer,nblks,nthrds,non_uniform_blocks) + +#ifdef OPENMP + nt = omp_get_thread_num()+1 +#else + nt = 1 +#endif + +!$OMP sections + +!$OMP section + call read_o3data (Model%ntoz, Model%me, Model%master) + + ! Consistency check that the hardcoded values for levozp and + ! oz_coeff in GFS_typedefs.F90 match what is set by read_o3data + ! in GFS_typedefs.F90: allocate (Tbd%ozpl (IM,levozp,oz_coeff)) + if (size(Data(1)%Tbd%ozpl, dim=2).ne.levozp) then + write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & + "levozp from read_o3data does not match value in GFS_typedefs.F90: ", & + levozp, " /= ", size(Data(1)%Tbd%ozpl, dim=2) + errflg = 1 + end if + if (size(Data(1)%Tbd%ozpl, dim=3).ne.oz_coeff) then + write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & + "oz_coeff from read_o3data does not match value in GFS_typedefs.F90: ", & + oz_coeff, " /= ", size(Data(1)%Tbd%ozpl, dim=3) + errflg = 1 + end if + +!$OMP section + call read_h2odata (Model%h2o_phys, Model%me, Model%master) + + ! Consistency check that the hardcoded values for levh2o and + ! h2o_coeff in GFS_typedefs.F90 match what is set by read_o3data + ! in GFS_typedefs.F90: allocate (Tbd%h2opl (IM,levh2o,h2o_coeff)) + if (size(Data(1)%Tbd%h2opl, dim=2).ne.levh2o) then + write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & + "levh2o from read_h2odata does not match value in GFS_typedefs.F90: ", & + levh2o, " /= ", size(Data(1)%Tbd%h2opl, dim=2) + errflg = 1 + end if + if (size(Data(1)%Tbd%h2opl, dim=3).ne.h2o_coeff) then + write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & + "h2o_coeff from read_h2odata does not match value in GFS_typedefs.F90: ", & + h2o_coeff, " /= ", size(Data(1)%Tbd%h2opl, dim=3) + errflg = 1 + end if + +!$OMP section + if (Model%aero_in) then + ! Consistency check that the value for ntrcaerm set in GFS_typedefs.F90 + ! and used to allocate Tbd%aer_nm matches the value defined in aerclm_def + if (size(Data(1)%Tbd%aer_nm, dim=3).ne.ntrcaerm) then + write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & + "ntrcaerm from aerclm_def does not match value in GFS_typedefs.F90: ", & + ntrcaerm, " /= ", size(Data(1)%Tbd%aer_nm, dim=3) + errflg = 1 + else + ! Update the value of ntrcaer in aerclm_def with the value defined + ! in GFS_typedefs.F90 that is used to allocate the Tbd DDT. + ! If Model%aero_in is .true., then ntrcaer == ntrcaerm + ntrcaer = size(Data(1)%Tbd%aer_nm, dim=3) + ! Read aerosol climatology + call read_aerdata (Model%me,Model%master,Model%iflip,Model%idate) + endif + else + ! Update the value of ntrcaer in aerclm_def with the value defined + ! in GFS_typedefs.F90 that is used to allocate the Tbd DDT. + ! If Model%aero_in is .false., then ntrcaer == 1 + ntrcaer = size(Data(1)%Tbd%aer_nm, dim=3) + endif + +!$OMP section + if (Model%iccn) then + call read_cidata ( Model%me, Model%master) + ! No consistency check needed for in/ccn data, all values are + ! hardcoded in module iccn_def.F and GFS_typedefs.F90 + endif + +!$OMP end sections + + ! Update values of oz_pres in Interstitial data type for all threads + if (Model%ntoz > 0) then + Interstitial(nt)%oz_pres = oz_pres +!$OMP single + if (non_uniform_blocks) then + ! For non-uniform block sizes, set Interstitial(nthrds+1)%oz_pres + Interstitial(nthrds+1)%oz_pres = oz_pres + end if +!$OMP end single nowait + end if + + ! Update values of h2o_pres in Interstitial data type for all threads + if (Model%h2o_phys) then + Interstitial(nt)%h2o_pres = h2o_pres +!$OMP single + if (non_uniform_blocks) then + ! For non-uniform block sizes, set Interstitial(nthrds+1)%oz_pres + Interstitial(nthrds+1)%h2o_pres = h2o_pres + end if +!$OMP end single nowait + end if + + + !--- read in and initialize ozone + if (Model%ntoz > 0) then +!$OMP do schedule (dynamic,1) + do nb = 1, nblks + call setindxoz (Model%blksz(nb), Data(nb)%Grid%xlat_d, Data(nb)%Grid%jindx1_o3, & + Data(nb)%Grid%jindx2_o3, Data(nb)%Grid%ddy_o3) + enddo +!$OMP end do + endif + + !--- read in and initialize stratospheric water + if (Model%h2o_phys) then +!$OMP do schedule (dynamic,1) + do nb = 1, nblks + call setindxh2o (Model%blksz(nb), Data(nb)%Grid%xlat_d, Data(nb)%Grid%jindx1_h, & + Data(nb)%Grid%jindx2_h, Data(nb)%Grid%ddy_h) + enddo +!$OMP end do + endif + + !--- read in and initialize aerosols + if (Model%aero_in) then +!$OMP do schedule (dynamic,1) + do nb = 1, nblks + call setindxaer (Model%blksz(nb), Data(nb)%Grid%xlat_d, Data(nb)%Grid%jindx1_aer, & + Data(nb)%Grid%jindx2_aer, Data(nb)%Grid%ddy_aer, Data(nb)%Grid%xlon_d, & + Data(nb)%Grid%iindx1_aer, Data(nb)%Grid%iindx2_aer, Data(nb)%Grid%ddx_aer, & + Model%me, Model%master) + enddo +!$OMP end do + endif + + !--- read in and initialize IN and CCN + if (Model%iccn) then +!$OMP do schedule (dynamic,1) + do nb = 1, nblks + call setindxci (Model%blksz(nb), Data(nb)%Grid%xlat_d, Data(nb)%Grid%jindx1_ci, & + Data(nb)%Grid%jindx2_ci, Data(nb)%Grid%ddy_ci, Data(nb)%Grid%xlon_d, & + Data(nb)%Grid%iindx1_ci, Data(nb)%Grid%iindx2_ci, Data(nb)%Grid%ddx_ci) + enddo +!$OMP end do + endif + +!$OMP end parallel + + !--- initial calculation of maps local ix -> global i and j, store in Tbd + ix = 0 + nb = 1 + do j = 1,Model%ny + do i = 1,Model%nx + ix = ix + 1 + if (ix .gt. Model%blksz(nb)) then + ix = 1 + nb = nb + 1 + endif + Data(nb)%Tbd%jmap(ix) = j + Data(nb)%Tbd%imap(ix) = i + enddo + enddo + + is_initialized = .true. + + end subroutine GFS_phys_time_vary_init + + +!> \section arg_table_GFS_phys_time_vary_finalize Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine GFS_phys_time_vary_finalize(errmsg, errflg) + + implicit none + + ! Interface variables + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (.not.is_initialized) return + + ! Deallocate ozone arrays + if (allocated(oz_lat) ) deallocate(oz_lat) + if (allocated(oz_pres) ) deallocate(oz_pres) + if (allocated(oz_time) ) deallocate(oz_time) + if (allocated(ozplin) ) deallocate(ozplin) + + ! Deallocate h2o arrays + if (allocated(h2o_lat) ) deallocate(h2o_lat) + if (allocated(h2o_pres)) deallocate(h2o_pres) + if (allocated(h2o_time)) deallocate(h2o_time) + if (allocated(h2oplin) ) deallocate(h2oplin) + + ! Deallocate aerosol arrays + if (allocated(aerin) ) deallocate(aerin) + if (allocated(aer_pres)) deallocate(aer_pres) + + ! Deallocate IN and CCN arrays + if (allocated(ciplin) ) deallocate(ciplin) + if (allocated(ccnin) ) deallocate(ccnin) + if (allocated(ci_pres) ) deallocate(ci_pres) + + is_initialized = .false. + + end subroutine GFS_phys_time_vary_finalize + + +!> \section arg_table_GFS_phys_time_vary_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| +!! | Data | GFS_data_type_instance_all_blocks | Fortran DDT containing FV3-GFS data | DDT | 1 | GFS_data_type | | inout | F | +!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | +!! | nthrds | omp_threads | number of OpenMP threads available for physics schemes | count | 0 | integer | | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg) + + use mersenne_twister, only: random_setseed, random_number + use machine, only: kind_phys + use GFS_typedefs, only: GFS_control_type, GFS_data_type + + implicit none + + ! Interface variables + type(GFS_data_type), intent(in) :: Data(:) + type(GFS_control_type), intent(inout) :: Model + integer, intent(in) :: nthrds + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Local variables + real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys + real(kind=kind_phys), parameter :: con_99 = 99.0_kind_phys + real(kind=kind_phys), parameter :: con_100 = 100.0_kind_phys + + integer :: i, j, k, iseed, iskip, ix, nb, nblks + real(kind=kind_phys) :: wrk(1) + real(kind=kind_phys) :: rannie(Model%cny) + real(kind=kind_phys) :: rndval(Model%cnx*Model%cny*Model%nrcm) + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Check initialization status + if (.not.is_initialized) then + write(errmsg,'(*(a))') "Logic error: GFS_phys_time_vary_run called before GFS_phys_time_vary_init" + errflg = 1 + return + end if + + nblks = size(Model%blksz) + + !--- switch for saving convective clouds - cnvc90.f + !--- aka Ken Campana/Yu-Tai Hou legacy + if ((mod(Model%kdt,Model%nsswr) == 0) .and. (Model%lsswr)) then + !--- initialize,accumulate,convert + Model%clstp = 1100 + min(Model%fhswr/con_hr,Model%fhour,con_99) + elseif (mod(Model%kdt,Model%nsswr) == 0) then + !--- accumulate,convert + Model%clstp = 0100 + min(Model%fhswr/con_hr,Model%fhour,con_99) + elseif (Model%lsswr) then + !--- initialize,accumulate + Model%clstp = 1100 + else + !--- accumulate + Model%clstp = 0100 + endif + +!$OMP parallel num_threads(nthrds) default(none) & +!$OMP private (nb,iskip,ix,i,j,k) & +!$OMP shared (Model,Data,iseed,wrk,rannie,rndval) & +!$OMP shared (nblks) + + !--- random number needed for RAS and old SAS and when cal_pre=.true. + ! Model%imfdeepcnv < 0 when Model%ras = .true. + if ( (Model%imfdeepcnv <= 0 .or. Model%cal_pre) .and. Model%random_clds ) then +!$OMP single + iseed = mod(con_100*sqrt(Model%fhour*con_hr),1.0d9) + Model%seed0 + call random_setseed(iseed) + call random_number(wrk) + do i = 1,Model%cnx*Model%nrcm + iseed = iseed + nint(wrk(1)*1000.0) * i + call random_setseed(iseed) + call random_number(rannie) + rndval(1+(i-1)*Model%cny:i*Model%cny) = rannie(1:Model%cny) + enddo +!$OMP end single + + do k = 1,Model%nrcm + iskip = (k-1)*Model%cnx*Model%cny +!$OMP do schedule (dynamic,1) + do nb=1,nblks + do ix=1,Model%blksz(nb) + j = Data(nb)%Tbd%jmap(ix) + i = Data(nb)%Tbd%imap(ix) + Data(nb)%Tbd%rann(ix,k) = rndval(i+Model%isc-1 + (j+Model%jsc-2)*Model%cnx + iskip) + enddo + enddo +!$OMP end do + enddo + endif ! imfdeepcnv, cal_re, random_clds + + !--- o3 interpolation + if (Model%ntoz > 0) then +!$OMP do schedule (dynamic,1) + do nb = 1, nblks + call ozinterpol (Model%me, Model%blksz(nb), Model%idate, Model%fhour, & + Data(nb)%Grid%jindx1_o3, Data(nb)%Grid%jindx2_o3, & + Data(nb)%Tbd%ozpl, Data(nb)%Grid%ddy_o3) + enddo +!$OMP end do + endif + + !--- h2o interpolation + if (Model%h2o_phys) then +!$OMP do schedule (dynamic,1) + do nb = 1, nblks + call h2ointerpol (Model%me, Model%blksz(nb), Model%idate, Model%fhour, & + Data(nb)%Grid%jindx1_h, Data(nb)%Grid%jindx2_h, & + Data(nb)%Tbd%h2opl, Data(nb)%Grid%ddy_h) + enddo +!$OMP end do + endif + + !--- aerosol interpolation + if (Model%aero_in) then +!$OMP do schedule (dynamic,1) + do nb = 1, nblks + call aerinterpol (Model%me, Model%master, Model%blksz(nb), & + Model%idate, Model%fhour, & + Data(nb)%Grid%jindx1_aer, Data(nb)%Grid%jindx2_aer, & + Data(nb)%Grid%ddy_aer,Data(nb)%Grid%iindx1_aer, & + Data(nb)%Grid%iindx2_aer,Data(nb)%Grid%ddx_aer, & + Model%levs,Data(nb)%Statein%prsl, & + Data(nb)%Tbd%aer_nm) + enddo +!$OMP end do + endif + + !--- ICCN interpolation + if (Model%iccn) then +!$OMP do schedule (dynamic,1) + do nb = 1, nblks + call ciinterpol (Model%me, Model%blksz(nb), Model%idate, Model%fhour, & + Data(nb)%Grid%jindx1_ci, Data(nb)%Grid%jindx2_ci, & + Data(nb)%Grid%ddy_ci,Data(nb)%Grid%iindx1_ci, & + Data(nb)%Grid%iindx2_ci,Data(nb)%Grid%ddx_ci, & + Model%levs,Data(nb)%Statein%prsl, & + Data(nb)%Tbd%in_nm, Data(nb)%Tbd%ccn_nm) + enddo +!$OMP end do + endif + +!$OMP end parallel + + !--- repopulate specific time-varying sfc properties for AMIP/forecast runs + if (Model%nscyc > 0) then + if (mod(Model%kdt,Model%nscyc) == 1) THEN + call gcycle (nblks, Model, Data(:)%Grid, Data(:)%Sfcprop, Data(:)%Cldprop) + endif + endif + + !--- determine if diagnostics buckets need to be cleared + if (mod(Model%kdt,Model%nszero) == 1) then + do nb = 1,nblks + call Data(nb)%Intdiag%rad_zero (Model) + call Data(nb)%Intdiag%phys_zero (Model) + !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED + enddo + endif + + end subroutine GFS_phys_time_vary_run + + end module GFS_phys_time_vary diff --git a/physics/GFS_rad_time_vary.fv3.F90 b/physics/GFS_rad_time_vary.fv3.F90 new file mode 100644 index 000000000..ac96e78d0 --- /dev/null +++ b/physics/GFS_rad_time_vary.fv3.F90 @@ -0,0 +1,114 @@ +!>\file GFS_rad_time_vary.F90 +!! Contains code related to GFS physics suite setup (radiation part of time_vary_step) + module GFS_rad_time_vary + + implicit none + + private + + public GFS_rad_time_vary_init, GFS_rad_time_vary_run, GFS_rad_time_vary_finalize + + contains + +!>\defgroup GFS_rad_time_vary GFS RRTMG Update +!!\ingroup RRTMG +!! @{ +!! \section arg_table_GFS_rad_time_vary_init Argument Table +!! + subroutine GFS_rad_time_vary_init + end subroutine GFS_rad_time_vary_init + +!> \section arg_table_GFS_rad_time_vary_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |-------------------|--------------------------------------------------------|-------------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| +!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | +!! | Data | GFS_data_type_instance_all_blocks | Fortran DDT containing FV3-GFS data | DDT | 1 | GFS_data_type | | inout | F | +!! | nthrds | omp_threads | number of OpenMP threads available for physics schemes | count | 0 | integer | | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine GFS_rad_time_vary_run (Model, Data, nthrds, errmsg, errflg) + + use physparam, only: ipsd0, ipsdlim, iaerflg + use mersenne_twister, only: random_setseed, random_index, random_stat + use machine, only: kind_phys + use GFS_typedefs, only: GFS_control_type, & + GFS_data_type + use radcons, only: qmin, con_100 + + implicit none + + type(GFS_control_type), intent(inout) :: Model + type(GFS_data_type), intent(inout) :: Data(:) + integer, intent(in) :: nthrds + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + !--- local variables + type (random_stat) :: stat + integer :: ix, nb, j, i, nblks, ipseed + integer :: numrdm(Model%cnx*Model%cny*2) + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (Model%lsswr .or. Model%lslwr) then + + nblks = size(Model%blksz) + + !--- call to GFS_radupdate_run is now in GFS_rrtmg_setup_run + +!$OMP parallel num_threads(nthrds) default(none) & +!$OMP private (nb,ix,i,j) & +!$OMP shared (Model,Data,ipsdlim,ipsd0,ipseed) & +!$OMP shared (numrdm,stat,nblks) + + !--- set up random seed index in a reproducible way for entire cubed-sphere face (lat-lon grid) + if ((Model%isubc_lw==2) .or. (Model%isubc_sw==2)) then +!$OMP single + ipseed = mod(nint(con_100*sqrt(Model%sec)), ipsdlim) + 1 + ipsd0 + call random_setseed (ipseed, stat) + call random_index (ipsdlim, numrdm, stat) +!$OMP end single + +!$OMP do schedule (dynamic,1) + do nb=1,nblks + do ix=1,Model%blksz(nb) + j = Data(nb)%Tbd%jmap(ix) + i = Data(nb)%Tbd%imap(ix) + !--- for testing purposes, replace numrdm with '100' + Data(nb)%Tbd%icsdsw(ix) = numrdm(i+Model%isc-1 + (j+Model%jsc-2)*Model%cnx) + Data(nb)%Tbd%icsdlw(ix) = numrdm(i+Model%isc-1 + (j+Model%jsc-2)*Model%cnx + Model%cnx*Model%cny) + enddo + enddo +!$OMP end do + endif ! isubc_lw and isubc_sw + + if (Model%imp_physics == 99) then + if (Model%kdt == 1) then +!$OMP do schedule (dynamic,1) + do nb = 1,nblks + Data(nb)%Tbd%phy_f3d(:,:,1) = Data(nb)%Statein%tgrs + Data(nb)%Tbd%phy_f3d(:,:,2) = max(qmin,Data(nb)%Statein%qgrs(:,:,1)) + Data(nb)%Tbd%phy_f3d(:,:,3) = Data(nb)%Statein%tgrs + Data(nb)%Tbd%phy_f3d(:,:,4) = max(qmin,Data(nb)%Statein%qgrs(:,:,1)) + Data(nb)%Tbd%phy_f2d(:,1) = Data(nb)%Statein%prsi(:,1) + Data(nb)%Tbd%phy_f2d(:,2) = Data(nb)%Statein%prsi(:,1) + enddo +!$OMP end do + endif + endif + +!$OMP end parallel + + endif + + end subroutine GFS_rad_time_vary_run + +!> \section arg_table_GFS_rad_time_vary_finalize Argument Table +!! + subroutine GFS_rad_time_vary_finalize() + end subroutine GFS_rad_time_vary_finalize +!! @} + end module GFS_rad_time_vary diff --git a/physics/GFS_stochastics.F90 b/physics/GFS_stochastics.F90 new file mode 100644 index 000000000..7fa2e256b --- /dev/null +++ b/physics/GFS_stochastics.F90 @@ -0,0 +1,249 @@ +!> \file GFS_stochastics.f90 +!! This file contains code previously in GFS_stochastics_driver. + + module GFS_stochastics + + contains + + subroutine GFS_stochastics_init () + end subroutine GFS_stochastics_init + + subroutine GFS_stochastics_finalize() + end subroutine GFS_stochastics_finalize + + +!>\defgroup gfs_stoch GFS Stochastics Physics Module +!! This module +!> @{ +!> \section arg_table_GFS_stochastics_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|---------------------------------------------------------------------------|--------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | km | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | +!! | do_sppt | flag_for_stochastic_surface_physics_perturbations | flag for stochastic surface physics perturbations | flag | 0 | logical | | in | F | +!! | use_zmtnblck | flag_for_mountain_blocking | flag for mountain blocking | flag | 0 | logical | | in | F | +!! | do_shum | flag_for_stochastic_shum_option | flag for stochastic shum option | flag | 0 | logical | | in | F | +!! | do_skeb | flag_for_stochastic_skeb_option | flag for stochastic skeb option | flag | 0 | logical | | in | F | +!! | zmtnblck | level_of_dividing_streamline | level of the dividing streamline | none | 1 | real | kind_phys | in | F | +!! | sppt_wts | weights_for_stochastic_sppt_perturbation | weights for stochastic sppt perturbation | none | 2 | real | kind_phys | inout | F | +!! | skebu_wts | weights_for_stochastic_skeb_perturbation_of_x_wind | weights for stochastic skeb perturbation of x wind | none | 2 | real | kind_phys | in | F | +!! | skebv_wts | weights_for_stochastic_skeb_perturbation_of_y_wind | weights for stochastic skeb perturbation of y wind | none | 2 | real | kind_phys | in | F | +!! | shum_wts | weights_for_stochastic_shum_perturbation | weights for stochastic shum perturbation | none | 2 | real | kind_phys | in | F | +!! | sppt_wts_inv | weights_for_stochastic_sppt_perturbation_flipped | weights for stochastic sppt perturbation, flipped | none | 2 | real | kind_phys | inout | F | +!! | skebu_wts_inv | weights_for_stochastic_skeb_perturbation_of_x_wind_flipped | weights for stochastic skeb perturbation of x wind, flipped | none | 2 | real | kind_phys | inout | F | +!! | skebv_wts_inv | weights_for_stochastic_skeb_perturbation_of_y_wind_flipped | weights for stochastic skeb perturbation of y wind, flipped | none | 2 | real | kind_phys | inout | F | +!! | shum_wts_inv | weights_for_stochastic_shum_perturbation_flipped | weights for stochastic shum perturbation, flipped | none | 2 | real | kind_phys | inout | F | +!! | diss_est | dissipation_estimate_of_air_temperature_at_model_layers | dissipation estimate model layer mean temperature | K | 2 | real | kind_phys | in | F | +!! | ugrs | x_wind | zonal wind | m s-1 | 2 | real | kind_phys | in | F | +!! | vgrs | y_wind | meridional wind | m s-1 | 2 | real | kind_phys | in | F | +!! | tgrs | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | in | F | +!! | qgrs | water_vapor_specific_humidity | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | in | F | +!! | gu0 | x_wind_updated_by_physics | zonal wind updated by physics | m s-1 | 2 | real | kind_phys | inout | F | +!! | gv0 | y_wind_updated_by_physics | meridional wind updated by physics | m s-1 | 2 | real | kind_phys | inout | F | +!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | inout | F | +!! | gq0 | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | dtdtr | tendency_of_air_temperature_due_to_radiative_heating_on_physics_time_step | temp. change due to radiative heating per time step | K | 2 | real | kind_phys | in | F | +!! | rain | lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total rain at this time step | m | 1 | real | kind_phys | in | F | +!! | rainc | lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep | convective rain at this time step | m | 1 | real | kind_phys | in | F | +!! | tprcp | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total precipitation amount in each time step | m | 1 | real | kind_phys | inout | F | +!! | totprcp | accumulated_lwe_thickness_of_precipitation_amount | accumulated total precipitation | m | 1 | real | kind_phys | inout | F | +!! | cnvprcp | cumulative_lwe_thickness_of_convective_precipitation_amount | cumulative convective precipitation | m | 1 | real | kind_phys | inout | F | +!! | totprcpb | accumulated_lwe_thickness_of_precipitation_amount_in_bucket | accumulated total precipitation in bucket | m | 1 | real | kind_phys | inout | F | +!! | cnvprcpb | cumulative_lwe_thickness_of_convective_precipitation_amount_in_bucket | cumulative convective precipitation in bucket | m | 1 | real | kind_phys | inout | F | +!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | +!! | rain_cpl | lwe_thickness_of_precipitation_amount_for_coupling | total rain precipitation | m | 1 | real | kind_phys | inout | F | +!! | snow_cpl | lwe_thickness_of_snow_amount_for_coupling | total snow precipitation | m | 1 | real | kind_phys | inout | F | +!! | drain_cpl | tendency_of_lwe_thickness_of_precipitation_amount_for_coupling | change in rain_cpl (coupling_type) | m | 1 | real | kind_phys | in | F | +!! | dsnow_cpl | tendency_of_lwe_thickness_of_snow_amount_for_coupling | change in show_cpl (coupling_type) | m | 1 | real | kind_phys | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +!>\section gfs_stochy_general GFS_stochastics_run General Algorithm +!! This is the GFS stochastic physics driver. +!! Routines are called prior to radiation and physics steps to handle: +!! -# sets up various time/date variables +!! -# sets up various triggers +!! -# defines random seed indices for radiation (in a reproducible way) +!! -# interpolates coefficients for prognostic ozone calculation +!! -# performs surface data cycling via the GFS gcycle routine + subroutine GFS_stochastics_run (im, km, do_sppt, use_zmtnblck, do_shum, do_skeb, & + zmtnblck, sppt_wts, skebu_wts, skebv_wts, shum_wts,& + sppt_wts_inv, skebu_wts_inv, skebv_wts_inv, & + shum_wts_inv, diss_est, & + ugrs, vgrs, tgrs, qgrs, gu0, gv0, gt0, gq0, dtdtr, & + rain, rainc, tprcp, totprcp, cnvprcp, & + totprcpb, cnvprcpb, cplflx, & + rain_cpl, snow_cpl, drain_cpl, dsnow_cpl, & + errmsg, errflg) + + use machine, only: kind_phys + + implicit none + + integer, intent(in) :: im + integer, intent(in) :: km + logical, intent(in) :: do_sppt + logical, intent(in) :: use_zmtnblck + logical, intent(in) :: do_shum + logical, intent(in) :: do_skeb + !logical, intent(in) :: isppt_deep + real(kind_phys), dimension(1:im), intent(in) :: zmtnblck + ! sppt_wts only allocated if do_sppt == .true. + real(kind_phys), dimension(:,:), intent(inout) :: sppt_wts + ! skebu_wts, skebv_wts only allocated if do_skeb == .true. + real(kind_phys), dimension(:,:), intent(in) :: skebu_wts + real(kind_phys), dimension(:,:), intent(in) :: skebv_wts + ! shum_wts only allocated if do_shum == .true. + real(kind_phys), dimension(:,:), intent(in) :: shum_wts + ! inverse/flipped weights are always allocated + real(kind_phys), dimension(1:im,1:km), intent(inout) :: sppt_wts_inv + real(kind_phys), dimension(1:im,1:km), intent(inout) :: skebu_wts_inv + real(kind_phys), dimension(1:im,1:km), intent(inout) :: skebv_wts_inv + real(kind_phys), dimension(1:im,1:km), intent(inout) :: shum_wts_inv + real(kind_phys), dimension(1:im,1:km), intent(in) :: diss_est + real(kind_phys), dimension(1:im,1:km), intent(in) :: ugrs + real(kind_phys), dimension(1:im,1:km), intent(in) :: vgrs + real(kind_phys), dimension(1:im,1:km), intent(in) :: tgrs + real(kind_phys), dimension(1:im,1:km), intent(in) :: qgrs + real(kind_phys), dimension(1:im,1:km), intent(inout) :: gu0 + real(kind_phys), dimension(1:im,1:km), intent(inout) :: gv0 + real(kind_phys), dimension(1:im,1:km), intent(inout) :: gt0 + real(kind_phys), dimension(1:im,1:km), intent(inout) :: gq0 + ! dtdtr only allocated if do_sppt == .true. + real(kind_phys), dimension(:,:), intent(in) :: dtdtr + real(kind_phys), dimension(1:im), intent(in) :: rain + real(kind_phys), dimension(1:im), intent(in) :: rainc + real(kind_phys), dimension(1:im), intent(inout) :: tprcp + real(kind_phys), dimension(1:im), intent(inout) :: totprcp + real(kind_phys), dimension(1:im), intent(inout) :: cnvprcp + real(kind_phys), dimension(1:im), intent(inout) :: totprcpb + real(kind_phys), dimension(1:im), intent(inout) :: cnvprcpb + logical, intent(in) :: cplflx + ! rain_cpl, snow_cpl only allocated if cplflx == .true. or do_sppt == .true. + real(kind_phys), dimension(:), intent(inout) :: rain_cpl + real(kind_phys), dimension(:), intent(inout) :: snow_cpl + ! drain_cpl, dsnow_cpl only allocated if do_sppt == .true. + real(kind_phys), dimension(:), intent(in) :: drain_cpl + real(kind_phys), dimension(:), intent(in) :: dsnow_cpl + ! tconvtend ... vconvtend only allocated if isppt_deep == .true. + !real(kind_phys), dimension(:,:), intent(in) :: tconvtend + !real(kind_phys), dimension(:,:), intent(in) :: qconvtend + !real(kind_phys), dimension(:,:), intent(in) :: uconvtend + !real(kind_phys), dimension(:,:), intent(in) :: vconvtend + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + !--- local variables + integer :: k, i + real(kind=kind_phys) :: upert, vpert, tpert, qpert, qnew, sppt_vwt + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (do_sppt) then + do k=1,km + do i=1,im + sppt_vwt=1.0 + if (zmtnblck(i).EQ.0.0) then + sppt_vwt=1.0 + else + if (k.GT.zmtnblck(i)+2) then + sppt_vwt=1.0 + endif + if (k.LE.zmtnblck(i)) then + sppt_vwt=0.0 + endif + if (k.EQ.zmtnblck(i)+1) then + sppt_vwt=0.333333 + endif + if (k.EQ.zmtnblck(i)+2) then + sppt_vwt=0.666667 + endif + endif + if (use_zmtnblck)then + sppt_wts(i,k)=(sppt_wts(i,k)-1)*sppt_vwt+1.0 + endif + sppt_wts_inv(i,km-k+1)=sppt_wts(i,k) + + !if(isppt_deep)then + + ! upert = (gu0(i,k) - ugrs(i,k) - uconvtend(i,k)) + uconvtend(i,k) * sppt_wts(i,k) + ! vpert = (gv0(i,k) - vgrs(i,k) - vconvtend(i,k)) + vconvtend(i,k) * sppt_wts(i,k) + ! tpert = (gt0(i,k) - tgrs(i,k) - dtdtr(i,k) - tconvtend(i,k)) + tconvtend(i,k) * sppt_wts(i,k) + ! qpert = (gq0(i,k) - qgrs(i,k) - qconvtend(i,k)) + qconvtend(i,k) * sppt_wts(i,k) + + !else + + upert = (gu0(i,k) - ugrs(i,k)) * sppt_wts(i,k) + vpert = (gv0(i,k) - vgrs(i,k)) * sppt_wts(i,k) + tpert = (gt0(i,k) - tgrs(i,k) - dtdtr(i,k)) * sppt_wts(i,k) + qpert = (gq0(i,k) - qgrs(i,k)) * sppt_wts(i,k) + + !endif + + gu0(i,k) = ugrs(i,k)+upert + gv0(i,k) = vgrs(i,k)+vpert + + !negative humidity check + qnew = qgrs(i,k)+qpert + if (qnew >= 1.0e-10) then + gq0(i,k) = qnew + gt0(i,k) = tgrs(i,k) + tpert + dtdtr(i,k) + endif + enddo + enddo + + !if(isppt_deep)then + ! tprcp(:) = tprcp(:) + (sppt_wts(:,15) - 1 )*rainc(:) + ! totprcp(:) = totprcp(:) + (sppt_wts(:,15) - 1 )*rainc(:) + ! cnvprcp(:) = cnvprcp(:) + (sppt_wts(:,15) - 1 )*rainc(:) + !! ! bucket precipitation adjustment due to sppt + ! totprcpb(:) = totprcpb(:) + (sppt_wts(:,15) - 1 )*rainc(:) + ! cnvprcpb(:) = cnvprcpb(:) + (sppt_wts(:,15) - 1 )*rainc(:) + + ! if (cplflx) then !Need to make proper adjustments for deep convection only perturbations + ! rain_cpl(:) = rain_cpl(:) + (sppt_wts(:,15) - 1.0)*drain_cpl(:) + ! snow_cpl(:) = snow_cpl(:) + (sppt_wts(:,15) - 1.0)*dsnow_cpl(:) + ! endif + + !else + + ! instantaneous precip rate going into land model at the next time step + tprcp(:) = sppt_wts(:,15)*tprcp(:) + totprcp(:) = totprcp(:) + (sppt_wts(:,15) - 1 )*rain(:) + ! acccumulated total and convective preciptiation + cnvprcp(:) = cnvprcp(:) + (sppt_wts(:,15) - 1 )*rainc(:) + ! bucket precipitation adjustment due to sppt + totprcpb(:) = totprcpb(:) + (sppt_wts(:,15) - 1 )*rain(:) + cnvprcpb(:) = cnvprcpb(:) + (sppt_wts(:,15) - 1 )*rainc(:) + + if (cplflx) then + rain_cpl(:) = rain_cpl(:) + (sppt_wts(:,15) - 1.0)*drain_cpl(:) + snow_cpl(:) = snow_cpl(:) + (sppt_wts(:,15) - 1.0)*dsnow_cpl(:) + endif + + !endif + + endif + + if (do_shum) then + do k=1,km + gq0(:,k) = gq0(:,k)*(1.0 + shum_wts(:,k)) + shum_wts_inv(:,km-k+1) = shum_wts(:,k) + end do + endif + + if (do_skeb) then + do k=1,km + gu0(:,k) = gu0(:,k)+skebu_wts(:,k)*(diss_est(:,k)) + gv0(:,k) = gv0(:,k)+skebv_wts(:,k)*(diss_est(:,k)) + skebu_wts_inv(:,km-k+1) = skebu_wts(:,k) + skebv_wts_inv(:,km-k+1) = skebv_wts(:,k) + enddo + endif + + end subroutine GFS_stochastics_run + + end module GFS_stochastics +!> @} diff --git a/physics/GFS_suite_init_finalize_test.F90 b/physics/GFS_suite_init_finalize_test.F90 new file mode 100644 index 000000000..efd0530e2 --- /dev/null +++ b/physics/GFS_suite_init_finalize_test.F90 @@ -0,0 +1,68 @@ + module GFS_suite_ini_fini_test + + contains + +!> \section arg_table_GFS_suite_ini_fini_test_init Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------| +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine GFS_suite_ini_fini_test_init (errmsg, errflg) + + implicit none + + ! interface variables + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + errmsg = '' + errflg = 0 + + write(0,*) "DH DEBUG: IN GFS_suite_ini_fini_test_init" + + end subroutine GFS_suite_ini_fini_test_init + +!> \section arg_table_GFS_suite_ini_fini_test_finalize Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------| +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine GFS_suite_ini_fini_test_finalize(errmsg, errflg) + + implicit none + + ! interface variables + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + errmsg = '' + errflg = 0 + + write(0,*) "DH DEBUG: IN GFS_suite_ini_fini_test_finalize" + + end subroutine GFS_suite_ini_fini_test_finalize + +!> \section arg_table_GFS_suite_ini_fini_test_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------| +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine GFS_suite_ini_fini_test_run (errmsg, errflg) + + use GFS_typedefs, only: GFS_interstitial_type + + implicit none + + ! interface variables + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + write(errmsg,'(a)') "DH ERROR: GFS_suite_ini_fini_test_run should not be called" + errflg = 1 + + end subroutine GFS_suite_ini_fini_test_run + + end module GFS_suite_ini_fini_test diff --git a/physics/GFS_time_vary_pre.fv3.F90 b/physics/GFS_time_vary_pre.fv3.F90 new file mode 100644 index 000000000..4fecabad5 --- /dev/null +++ b/physics/GFS_time_vary_pre.fv3.F90 @@ -0,0 +1,141 @@ +!> \file GFS_time_vary_pre.F90 +!! Contains code related to GFS physics suite setup (generic part of time_vary_step) + + module GFS_time_vary_pre + + use funcphys, only: gfuncphys + + implicit none + + private + + public GFS_time_vary_pre_init, GFS_time_vary_pre_run, GFS_time_vary_pre_finalize + + logical :: is_initialized = .false. + + contains + +!> \section arg_table_GFS_time_vary_pre_init Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine GFS_time_vary_pre_init (errmsg, errflg) + + implicit none + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (is_initialized) return + + !--- Call gfuncphys (funcphys.f) to compute all physics function tables. + call gfuncphys () + + is_initialized = .true. + + end subroutine GFS_time_vary_pre_init + + +!> \section arg_table_GFS_time_vary_pre_finalize Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine GFS_time_vary_pre_finalize(errmsg, errflg) + + implicit none + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (.not. is_initialized) return + + ! DH* this is the place to deallocate whatever is allocated by gfuncphys() in GFS_time_vary_pre_init + + is_initialized = .false. + + end subroutine GFS_time_vary_pre_finalize + + +!> \section arg_table_GFS_time_vary_pre_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| +!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine GFS_time_vary_pre_run (Model, errmsg, errflg) + + use machine, only: kind_phys + use GFS_typedefs, only: GFS_control_type + + implicit none + + type(GFS_control_type), intent(inout) :: Model + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + real(kind=kind_phys), parameter :: con_24 = 24.0_kind_phys + real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys + real(kind=kind_phys) :: rinc(5) + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Check initialization status + if (.not.is_initialized) then + write(errmsg,'(*(a))') "Logic error: GFS_time_vary_pre_run called before GFS_time_vary_pre_init" + errflg = 1 + return + end if + + !--- Model%jdat is being updated directly inside of FV3GFS_cap.F90 + !--- update calendars and triggers + rinc(1:5) = 0 + call w3difdat(Model%jdat,Model%idat,4,rinc) + Model%sec = rinc(4) + Model%phour = Model%sec/con_hr + !--- set current bucket hour + Model%zhour = Model%phour + Model%fhour = (Model%sec + Model%dtp)/con_hr + Model%kdt = nint((Model%sec + Model%dtp)/Model%dtp) + + Model%ipt = 1 + Model%lprnt = .false. + Model%lssav = .true. + + !--- radiation triggers + Model%lsswr = (mod(Model%kdt, Model%nsswr) == 1) + Model%lslwr = (mod(Model%kdt, Model%nslwr) == 1) + + !--- set the solar hour based on a combination of phour and time initial hour + Model%solhr = mod(Model%phour+Model%idate(1),con_24) + + if ((Model%debug) .and. (Model%me == Model%master)) then + print *,' sec ', Model%sec + print *,' kdt ', Model%kdt + print *,' nsswr ', Model%nsswr + print *,' nslwr ', Model%nslwr + print *,' nscyc ', Model%nscyc + print *,' lsswr ', Model%lsswr + print *,' lslwr ', Model%lslwr + print *,' fhour ', Model%fhour + print *,' phour ', Model%phour + print *,' solhr ', Model%solhr + endif + + end subroutine GFS_time_vary_pre_run + + end module GFS_time_vary_pre diff --git a/physics/cu_ntiedtke.F90 b/physics/cu_ntiedtke.F90 new file mode 100644 index 000000000..954c4a65f --- /dev/null +++ b/physics/cu_ntiedtke.F90 @@ -0,0 +1,3840 @@ +!> \file cu_ntiedtke.F90 +!! This file contains the CCPP-compliant new Tiedtke scheme which parameterize +!! Shallow, deep, and mid-level convections in the model +!! Please refer to Tiedtke (1989), Bechtold et al. (2004,2008, 2014), +!! Zhang et al. (2011), Zhang and Wang (2017, 2018) +!! +!########################################################### + +module cu_ntiedtke + +!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + use machine , only : kind_phys + ! DH* TODO - replace with arguments to subroutine calls, + ! this also requires redefining derived constants in the + ! parameter section below + use physcons, only:rd=>con_rd, rv=>con_rv, g=>con_g, & + & cpd=>con_cp, alv=>con_hvap, alf=>con_hfus + + implicit none + real(kind=kind_phys),private :: rcpd,vtmpc1,tmelt,als,t13, & + c1es,c2es,c3les,c3ies,c4les,c4ies,c5les,c5ies,zrg + + real(kind=kind_phys),private :: rovcp,r5alvcp,r5alscp,ralvdcp,ralsdcp,ralfdcp,rtwat,rtber,rtice + real(kind=kind_phys),private :: entrdd,cmfcmax,cmfcmin,cmfdeps,zdnoprc,cprcon + integer,private :: momtrans,p650 + + parameter( & + t13 = 0.333333333,& + rcpd=1.0/cpd, & + tmelt=273.16, & + zrg=1.0/g, & + c1es=610.78, & + c2es=c1es*rd/rv, & + c3les=17.2693882, & + c3ies=21.875, & + c4les=35.86, & + c4ies=7.66, & + als = alv+alf, & + c5les=c3les*(tmelt-c4les), & + c5ies=c3ies*(tmelt-c4ies), & + r5alvcp=c5les*alv*rcpd, & + r5alscp=c5ies*als*rcpd, & + ralvdcp=alv*rcpd, & + ralsdcp=als*rcpd, & + ralfdcp=alf*rcpd, & + rtwat=tmelt, & + rtber=tmelt-5., & + rtice=tmelt-23., & + vtmpc1=rv/rd-1.0, & + rovcp = rd*rcpd ) +! +! entrdd: average entrainment & detrainment rate for downdrafts +! ------ +! + parameter(entrdd = 2.0e-4) +! +! cmfcmax: maximum massflux value allowed for updrafts etc +! ------- +! + parameter(cmfcmax = 1.0) +! +! cmfcmin: minimum massflux value (for safety) +! ------- +! + parameter(cmfcmin = 1.e-10) +! +! cmfdeps: fractional massflux for downdrafts at lfs +! ------- +! + parameter(cmfdeps = 0.30) + +! zdnoprc: deep cloud is thicker than this height (Unit:Pa) +! + parameter(zdnoprc = 2.0e4) +! ------- +! +! cprcon: coefficient from cloud water to rain water +! + parameter(cprcon = 1.4e-3) +! ------- +! +! momtrans: momentum transport method +! ( 1 = IFS40r1 method; 2 = new method ) +! + parameter(momtrans = 2 ) +! ------- +! + logical :: isequil +! isequil: representing equilibrium and nonequilibrium convection +! ( .false. [default]; .true. [experimental]. Ref. Bechtold et al. 2014 JAS ) +! + parameter(isequil = .false. ) +! +!-------------------- +! switches for deep, mid, shallow convections, downdraft, and momemtum transport +! ------------------ + logical :: lmfpen,lmfmid,lmfscv,lmfdd,lmfdudv + parameter(lmfpen=.true.,lmfmid=.true.,lmfscv=.true.,lmfdd=.true.,lmfdudv=.true.) +!-------------------- +!#################### end of variables definition########################## +!----------------------------------------------------------------------- +! +contains +!> \brief Brief description of the subroutine +!! +!! \section arg_table_cu_ntiedtke_init Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------------|--------------------|------------------------------------------|-------|------|-----------|-----------|--------|----------| +!! | mpirank | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | +!! | mpiroot | mpi_root | master MPI-rank | index | 0 | integer | | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine cu_ntiedtke_init(mpirank, mpiroot, errmsg, errflg) + + implicit none + + integer, intent(in) :: mpirank + integer, intent(in) :: mpiroot + character(len=*), intent( out) :: errmsg + integer, intent( out) :: errflg + + ! initialize ccpp error handling variables + errmsg = '' + errflg = 0 + + ! DH* temporary + if (mpirank==mpiroot) then + write(0,*) ' -----------------------------------------------------------------------------------------------------------------------------' + write(0,*) ' --- WARNING --- the CCPP New Tiedtke convection scheme is currently under development, use at your own risk --- WARNING ---' + write(0,*) ' -----------------------------------------------------------------------------------------------------------------------------' + end if + ! *DH temporary + + end subroutine cu_ntiedtke_init + + +!> \brief Brief description of the subroutine +!! +!! \section arg_table_cu_ntiedtke_finalize Argument Table +!! + subroutine cu_ntiedtke_finalize() + end subroutine cu_ntiedtke_finalize +! +! Tiedtke cumulus scheme from WRF with small modifications +! This scheme includes both deep and shallow convections +!=================== +! +!! +!! \section arg_table_cu_ntiedtke_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|-----------------------------------------------------------|----------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| +!! | pu | x_wind_updated_by_physics | updated x-direction wind | m s-1 | 2 | real | kind_phys | inout | F | +!! | pv | y_wind_updated_by_physics | updated y-direction wind | m s-1 | 2 | real | kind_phys | inout | F | +!! | pt | air_temperature_updated_by_physics | updated temperature | K | 2 | real | kind_phys | inout | F | +!! | pqv | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | pqvf | moisture_tendency_due_to_dynamics | moisture tendency due to dynamics only | kg kg-1 s-1 | 2 | real | kind_phys | in | F | +!! | ptf | temperature_tendency_due_to_dynamics | temperature tendency due to dynamics only | K s-1 | 2 | real | kind_phys | in | F | +!! | clw | convective_transportable_tracers | array to contain cloud water and other tracers | kg kg-1 | 3 | real | kind_phys | inout | F | +!! | poz | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | +!! | pzz | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | +!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | +!! | pomg | omega | layer mean vertical velocity | Pa s-1 | 2 | real | kind_phys | in | F | +!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | hfx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | +!! | zprecc | lwe_thickness_of_deep_convective_precipitation_amount | deep convective rainfall amount on physics timestep | m | 1 | real | kind_phys | out | F | +!! | lmask | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | +!! | lq | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | +!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | +!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | +!! | dx | cell_size | size of the grid cell | m | 1 | real | kind_phys | in | F | +!! | kbot | vertical_index_at_cloud_base | index for cloud base | index | 1 | integer | | out | F | +!! | ktop | vertical_index_at_cloud_top | index for cloud top | index | 1 | integer | | out | F | +!! | kcnv | flag_deep_convection | deep convection: 0=no, 1=yes | flag | 1 | integer | | out | F | +!! | ktrac | number_of_total_tracers | number of total tracers | count | 0 | integer | | in | F | +!! | ud_mf | instantaneous_atmosphere_updraft_convective_mass_flux | (updraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | +!! | dd_mf | instantaneous_atmosphere_downdraft_convective_mass_flux | (downdraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | +!! | dt_mf | instantaneous_atmosphere_detrainment_convective_mass_flux | (detrainment mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | +!! | cnvw | convective_cloud_water_mixing_ratio | convective cloud water | kg kg-1 | 2 | real | kind_phys | out | F | +!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | out | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +!----------------------------------------------------------------------- +! level 1 subroutine 'tiecnvn' +!----------------------------------------------------------------- + subroutine cu_ntiedtke_run(pu,pv,pt,pqv,pqvf,ptf,clw,poz,pzz,prsl,prsi,pomg, & + evap,hfx,zprecc,lmask,lq,ix,km,dt,dx,kbot,ktop,kcnv,& + ktrac,ud_mf,dd_mf,dt_mf,cnvw,cnvc,errmsg,errflg) +!----------------------------------------------------------------- +! this is the interface between the model and the mass +! flux convection module +!----------------------------------------------------------------- + implicit none +! in&out variables + integer, intent(in) :: lq, ix, km, ktrac + real(kind=kind_phys), intent(in ) :: dt + integer, dimension( lq ), intent(in) :: lmask + real(kind=kind_phys), dimension( lq ), intent(in ) :: evap, hfx, dx + real(kind=kind_phys), dimension( ix , km ), intent(inout) :: pu, pv, pt, pqv + real(kind=kind_phys), dimension( ix , km ), intent(in ) :: poz, prsl, pomg, pqvf, ptf + real(kind=kind_phys), dimension( ix , km+1 ), intent(in ) :: pzz, prsi + real(kind=kind_phys), dimension( ix , km, ktrac+2 ), intent(inout ) :: clw + + integer, dimension( lq ), intent(out) :: kbot, ktop, kcnv + real(kind=kind_phys), dimension( lq ), intent(out) :: zprecc + real(kind=kind_phys), dimension (lq,km), intent(out) :: ud_mf, dd_mf, dt_mf, cnvw, cnvc + +! error messages + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + +! local variables + real(kind=kind_phys) pum1(lq,km), pvm1(lq,km), ztt(lq,km), & + & ptte(lq,km), pqte(lq,km), pvom(lq,km), pvol(lq,km), & + & pverv(lq,km), pgeo(lq,km), pap(lq,km), paph(lq,km+1) + real(kind=kind_phys) pqhfl(lq), zqq(lq,km), & + & prsfc(lq), pssfc(lq), pcte(lq,km), & + & phhfl(lq), pgeoh(lq,km+1) + real(kind=kind_phys) ztp1(lq,km), zqp1(lq,km), ztu(lq,km), zqu(lq,km),& + & zlu(lq,km), zlude(lq,km), zmfu(lq,km), zmfd(lq,km), zmfude_rate(lq,km),& + & zqsat(lq,km), zrain(lq) + real(kind=kind_phys) pcen(lq,km,ktrac),ptenc(lq,km,ktrac) + + integer icbot(lq), ictop(lq), ktype(lq), lndj(lq) + logical locum(lq) +! + real(kind=kind_phys) ztmst,fliq,fice,ztc,zalf,tt + integer i,j,k,k1,n,km1 + real(kind=kind_phys) ztpp1 + real(kind=kind_phys) zew,zqs,zcor +! +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + km1 = km + 1 + ztmst=dt +! +! masv flux diagnostics. +! + do j=1,lq + zrain(j)=0.0 + locum(j)=.false. + prsfc(j)=0.0 + pssfc(j)=0.0 + pqhfl(j)=evap(j) + phhfl(j)=hfx(j) + pgeoh(j,km1)=pzz(j,1) + paph(j,km1)=prsi(j,1) + if(lmask(j).eq.1) then + lndj(j)=1 + else + lndj(j)=0 + end if + end do +! +! convert model variables for mflux scheme +! + do k=1,km + k1=km-k+1 + do j=1,lq + pcte(j,k1)=0.0 + pvom(j,k1)=0.0 + pvol(j,k1)=0.0 + ztp1(j,k1)=pt(j,k) + zqp1(j,k1)=pqv(j,k) + pum1(j,k1)=pu(j,k) + pvm1(j,k1)=pv(j,k) + pverv(j,k1)=pomg(j,k) + pgeo(j,k1)=poz(j,k) + pgeoh(j,k1)=pzz(j,k+1) + pap(j,k1)=prsl(j,k) + paph(j,k1)=prsi(j,k+1) + tt=ztp1(j,k1) + zew = foeewm(tt) + zqs = zew/pap(j,k1) + zqs = min(0.5,zqs) + zcor = 1./(1.-vtmpc1*zqs) + zqsat(j,k1)=zqs*zcor + pqte(j,k1)=pqvf(j,k) + zqq(j,k1) =pqte(j,k1) + ptte(j,k1)=ptf(j,k) + ztt(j,k1) =ptte(j,k1) + ud_mf(j,k1)=0. + dd_mf(j,k1)=0. + dt_mf(j,k1)=0. + cnvw(j,k1)=0. + cnvc(j,k1)=0. + end do + end do + + do n=1,ktrac + do k=1,km + k1=km-k+1 + do j=1,lq + pcen(j,k1,n) = clw(j,k,n+2) + ptenc(j,k1,n)= 0. + end do + end do + end do + +! print *, "pgeo=",pgeo(1,:) +! print *, "pgeoh=",pgeoh(1,:) +! print *, "pap=",pap(1,:) +! print *, "paph=",paph(1,:) +! print *, "ztp1=",ztp1(1,:) +! print *, "zqp1=",zqp1(1,:) +! print *, "pum1=",pum1(1,:) +! print *, "pvm1=",pvm1(1,:) +! print *, "pverv=",pverv(1,:) +! print *, "pqte=",pqte(1,:) +! print *, "ptte=",ptte(1,:) +! print *, "hfx=", pqhfl(1),phhfl(1),dx(1) +! +!----------------------------------------------------------------------- +!* 2. call 'cumastrn'(master-routine for cumulus parameterization) +! + call cumastrn & + & (lq, km, km1, km-1, ztp1, & + & zqp1, pum1, pvm1, pverv, zqsat,& + & pqhfl, ztmst, pap, paph, pgeo, & + & ptte, pqte, pvom, pvol, prsfc,& + & pssfc, locum, ktrac, pcen, ptenc,& + & ktype, icbot, ictop, ztu, zqu, & + & zlu, zlude, zmfu, zmfd, zrain,& + & pcte, phhfl, lndj, pgeoh, zmfude_rate, dx) +! +! to include the cloud water and cloud ice detrained from convection +! + do k=1,km + k1=km-k+1 + do j=1,lq + if(pcte(j,k1).gt.0.) then + fliq=foealfa(ztp1(j,k1)) + fice=1.0-fliq + clw(j,k,2)=clw(j,k,2)+fliq*pcte(j,k1)*ztmst + clw(j,k,1)=clw(j,k,1)+fice*pcte(j,k1)*ztmst + endif + end do + end do +! + do k=1,km + k1 = km-k+1 + do j=1,lq + pt(j,k) = ztp1(j,k1)+(ptte(j,k1)-ztt(j,k1))*ztmst + pqv(j,k)= zqp1(j,k1)+(pqte(j,k1)-zqq(j,k1))*ztmst + ud_mf(j,k)= zmfu(j,k1)*ztmst + dd_mf(j,k)= zmfd(j,k1)*ztmst + dt_mf(j,k)= zmfude_rate(j,k1)*ztmst + cnvw(j,k) = zlude(j,k1)*ztmst*g/(prsi(j,k)-prsi(j,k+1)) + cnvc(j,k) = 0.04 * log(1. + 675. * ud_mf(j,k)) + cnvc(j,k) = min(cnvc(j,k), 0.6) + cnvc(j,k) = max(cnvc(j,k), 0.0) + end do + end do + + do j=1,lq + zprecc(j)=amax1(0.0,(prsfc(j)+pssfc(j))*ztmst*0.001) + kbot(j) = km-icbot(j)+1 + ktop(j) = km-ictop(j)+1 + if(ktype(j).eq.1 .or. ktype(j).eq.3) then + kcnv(j)=1 + else + kcnv(j)=0 + end if + end do + + if (lmfdudv) then + do k=1,km + k1=km-k+1 + do j=1,lq + pu(j,k)=pu(j,k)+pvom(j,k1)*ztmst + pv(j,k)=pv(j,k)+pvol(j,k1)*ztmst + end do + end do + endif +! + if (ktrac > 0) then + do n=1,ktrac + do k=1,km + k1=km-k+1 + do j=1,lq + clw(j,k,n+2)=pcen(j,k,n)+ptenc(j,k1,n)*ztmst + end do + end do + end do + end if +! + return + end subroutine cu_ntiedtke_run + +!############################################################# +! +! level 2 subroutines +! +!############################################################# +!*********************************************************** +! subroutine cumastrn +!*********************************************************** + subroutine cumastrn & + & (klon, klev, klevp1, klevm1, pten, & + & pqen, puen, pven, pverv, pqsen,& + & pqhfl, ztmst, pap, paph, pgeo, & + & ptte, pqte, pvom, pvol, prsfc,& + & pssfc, ldcum, ktrac, pcen, ptenc,& + & ktype, kcbot, kctop, ptu, pqu,& + & plu, plude, pmfu, pmfd, prain,& + & pcte, phhfl, lndj, zgeoh, pmfude_rate, dx) + implicit none +! +!***cumastrn* master routine for cumulus massflux-scheme +! m.tiedtke e.c.m.w.f. 1986/1987/1989 +! modifications +! y.wang i.p.r.c 2001 +! c.zhang 2012 +!***purpose +! ------- +! this routine computes the physical tendencies of the +! prognostic variables t,q,u and v due to convective processes. +! processes considered are: convective fluxes, formation of +! precipitation, evaporation of falling rain below cloud base, +! saturated cumulus downdrafts. +!***method +! ------ +! parameterization is done using a massflux-scheme. +! (1) define constants and parameters +! (2) specify values (t,q,qs...) at half levels and +! initialize updraft- and downdraft-values in 'cuinin' +! (3) calculate cloud base in 'cutypen', calculate cloud types in cutypen, +! and specify cloud base massflux +! (4) do cloud ascent in 'cuascn' in absence of downdrafts +! (5) do downdraft calculations: +! (a) determine values at lfs in 'cudlfsn' +! (b) determine moist descent in 'cuddrafn' +! (c) recalculate cloud base massflux considering the +! effect of cu-downdrafts +! (6) do final adjusments to convective fluxes in 'cuflxn', +! do evaporation in subcloud layer +! (7) calculate increments of t and q in 'cudtdqn' +! (8) calculate increments of u and v in 'cududvn' +!***externals. +! ---------- +! cuinin: initializes values at vertical grid used in cu-parametr. +! cutypen: cloud bypes, 1: deep cumulus 2: shallow cumulus +! cuascn: cloud ascent for entraining plume +! cudlfsn: determines values at lfs for downdrafts +! cuddrafn:does moist descent for cumulus downdrafts +! cuflxn: final adjustments to convective fluxes (also in pbl) +! cudqdtn: updates tendencies for t and q +! cududvn: updates tendencies for u and v +!***switches. +! -------- +! lmfmid=.t. midlevel convection is switched on +! lmfdd=.t. cumulus downdrafts switched on +! lmfdudv=.t. cumulus friction switched on +!*** +! model parameters (defined in subroutine cuparam) +! ------------------------------------------------ +! entrdd entrainment rate for cumulus downdrafts +! cmfcmax maximum massflux value allowed for +! cmfcmin minimum massflux value (for safety) +! cmfdeps fractional massflux for downdrafts at lfs +! cprcon coefficient for conversion from cloud water to rain +!***reference. +! ---------- +! paper on massflux scheme (tiedtke,1989) +!----------------------------------------------------------------- + integer klev,klon,ktrac,klevp1,klevm1 + real(kind=kind_phys) pten(klon,klev), pqen(klon,klev),& + & puen(klon,klev), pven(klon,klev),& + & ptte(klon,klev), pqte(klon,klev),& + & pvom(klon,klev), pvol(klon,klev),& + & pqsen(klon,klev), pgeo(klon,klev),& + & pap(klon,klev), paph(klon,klevp1),& + & pverv(klon,klev), pqhfl(klon),& + & phhfl(klon) + real(kind=kind_phys) ptu(klon,klev), pqu(klon,klev),& + & plu(klon,klev), plude(klon,klev),& + & pmfu(klon,klev), pmfd(klon,klev),& + & prain(klon),& + & prsfc(klon), pssfc(klon) + real(kind=kind_phys) ztenh(klon,klev), zqenh(klon,klev),& + & zgeoh(klon,klevp1), zqsenh(klon,klev),& + & ztd(klon,klev), zqd(klon,klev),& + & zmfus(klon,klev), zmfds(klon,klev),& + & zmfuq(klon,klev), zmfdq(klon,klev),& + & zdmfup(klon,klev), zdmfdp(klon,klev),& + & zmful(klon,klev), zrfl(klon),& + & zuu(klon,klev), zvu(klon,klev),& + & zud(klon,klev), zvd(klon,klev),& + & zlglac(klon,klev) + real(kind=kind_phys) pmflxr(klon,klevp1), pmflxs(klon,klevp1) + real(kind=kind_phys) zhcbase(klon),& + & zmfub(klon), zmfub1(klon),& + & zdhpbl(klon) + real(kind=kind_phys) zsfl(klon), zdpmel(klon,klev),& + & pcte(klon,klev), zcape(klon),& + & zcape1(klon), zcape2(klon),& + & ztauc(klon), ztaubl(klon),& + & zheat(klon) + real(kind=kind_phys) pcen(klon,klev,ktrac), ptenc(klon,klev,ktrac) + real(kind=kind_phys) wup(klon), zdqcv(klon) + real(kind=kind_phys) wbase(klon), zmfuub(klon) + real(kind=kind_phys) upbl(klon) + real(kind=kind_phys) dx(klon) + real(kind=kind_phys) pmfude_rate(klon,klev), pmfdde_rate(klon,klev) + real(kind=kind_phys) zmfuus(klon,klev), zmfdus(klon,klev) + real(kind=kind_phys) zmfudr(klon,klev), zmfddr(klon,klev) + real(kind=kind_phys) zuv2(klon,klev),ztenu(klon,klev),ztenv(klon,klev) + real(kind=kind_phys) zmfuvb(klon),zsum12(klon),zsum22(klon) + integer ilab(klon,klev), idtop(klon),& + & ictop0(klon), ilwmin(klon) + integer kdpl(klon) + integer kcbot(klon), kctop(klon),& + & ktype(klon), lndj(klon) + logical ldcum(klon), lldcum(klon) + logical loddraf(klon), llddraf3(klon), llo1, llo2(klon) + +! local varaiables + real(kind=kind_phys) zcons,zcons2,zqumqe,zdqmin,zdh,zmfmax + real(kind=kind_phys) zalfaw,zalv,zqalv,zc5ldcp,zc4les,zhsat,zgam,zzz,zhhat + real(kind=kind_phys) zpbmpt,zro,zdz,zdp,zeps,zfac,wspeed + integer jl,jk,ik + integer ikb,ikt,icum,itopm2 + real(kind=kind_phys) ztmst,ztau,zerate,zderate,zmfa + real(kind=kind_phys) zmfs(klon),pmean(klev),zlon + real(kind=kind_phys) zduten,zdvten,ztdis,pgf_u,pgf_v +!------------------------------------------- +! 1. specify constants and parameters +!------------------------------------------- + zcons=1./(g*ztmst) + zcons2=3./(g*ztmst) + + zlon = real(klon) + do jk = klev , 1 , -1 + pmean(jk) = sum(pap(:,jk))/zlon + end do + p650 = klev-2 + do jk = klev , 3 , -1 + if ( pmean(jk)/pmean(klev)*1.013250e5 > 650.e2 ) p650 = jk + end do + +!-------------------------------------------------------------- +!* 2. initialize values at vertical grid points in 'cuini' +!-------------------------------------------------------------- + call cuinin & + & (klon, klev, klevp1, klevm1, pten, & + & pqen, pqsen, puen, pven, pverv,& + & pgeo, paph, zgeoh, ztenh, zqenh,& + & zqsenh, ilwmin, ptu, pqu, ztd, & + & zqd, zuu, zvu, zud, zvd, & + & pmfu, pmfd, zmfus, zmfds, zmfuq,& + & zmfdq, zdmfup, zdmfdp, zdpmel, plu, & + & plude, ilab) + +!---------------------------------- +!* 3.0 cloud base calculations +!---------------------------------- +!* (a) determine cloud base values in 'cutypen', +! and the cumulus type 1 or 2 +! ------------------------------------------- + call cutypen & + & ( klon, klev, klevp1, klevm1, pqen,& + & ztenh, zqenh, zqsenh, zgeoh, paph,& + & phhfl, pqhfl, pgeo, pqsen, pap,& + & pten, lndj, ptu, pqu, ilab,& + & ldcum, kcbot, ictop0, ktype, wbase, plu, kdpl) + +!* (b) assign the first guess mass flux at cloud base +! ------------------------------------------ + do jl=1,klon + zdhpbl(jl)=0.0 + upbl(jl) = 0.0 + idtop(jl)=0 + end do + + do jk=2,klev + do jl=1,klon + if(jk.ge.kcbot(jl) .and. ldcum(jl)) then + zdhpbl(jl)=zdhpbl(jl)+(alv*pqte(jl,jk)+cpd*ptte(jl,jk))& + & *(paph(jl,jk+1)-paph(jl,jk)) + if(lndj(jl) .eq. 0) then + wspeed = sqrt(puen(jl,jk)**2 + pven(jl,jk)**2) + upbl(jl) = upbl(jl) + wspeed*(paph(jl,jk+1)-paph(jl,jk)) + end if + end if + end do + end do + + do jl=1,klon + if(ldcum(jl)) then + ikb=kcbot(jl) + zmfmax = (paph(jl,ikb)-paph(jl,ikb-1))*zcons2 + if(ktype(jl) == 1) then + zmfub(jl)= 0.1*zmfmax + else if ( ktype(jl) == 2 ) then + zqumqe = pqu(jl,ikb) + plu(jl,ikb) - zqenh(jl,ikb) + zdqmin = max(0.01*zqenh(jl,ikb),1.e-10) + zdh = cpd*(ptu(jl,ikb)-ztenh(jl,ikb)) + alv*zqumqe + zdh = g*max(zdh,1.e5*zdqmin) + if ( zdhpbl(jl) > 0. ) then + zmfub(jl) = zdhpbl(jl)/zdh + zmfub(jl) = min(zmfub(jl),zmfmax) + else + zmfub(jl) = 0.1*zmfmax + ldcum(jl) = .false. + end if + end if + else + zmfub(jl) = 0. + end if + end do +!------------------------------------------------------ +!* 4.0 determine cloud ascent for entraining plume +!------------------------------------------------------ +!* (a) do ascent in 'cuasc'in absence of downdrafts +!---------------------------------------------------------- + call cuascn & + & (klon, klev, klevp1, klevm1, ztenh,& + & zqenh, puen, pven, pten, pqen,& + & pqsen, pgeo, zgeoh, pap, paph,& + & pqte, pverv, ilwmin, ldcum, zhcbase,& + & ktype, ilab, ptu, pqu, plu,& + & zuu, zvu, pmfu, zmfub,& + & zmfus, zmfuq, zmful, plude, zdmfup,& + & kcbot, kctop, ictop0, icum, ztmst,& + & zqsenh, zlglac, lndj, wup, wbase, kdpl, pmfude_rate ) + +!* (b) check cloud depth and change entrainment rate accordingly +! calculate precipitation rate (for downdraft calculation) +!------------------------------------------------------------------ + do jl=1,klon + if ( ldcum(jl) ) then + ikb = kcbot(jl) + itopm2 = kctop(jl) + zpbmpt = paph(jl,ikb) - paph(jl,itopm2) + if ( ktype(jl) == 1 .and. zpbmpt < zdnoprc ) ktype(jl) = 2 + if ( ktype(jl) == 2 .and. zpbmpt >= zdnoprc ) ktype(jl) = 1 + ictop0(jl) = kctop(jl) + end if + zrfl(jl)=zdmfup(jl,1) + end do + + do jk=2,klev + do jl=1,klon + zrfl(jl)=zrfl(jl)+zdmfup(jl,jk) + end do + end do + + do jk = 1,klev + do jl = 1,klon + pmfd(jl,jk) = 0. + zmfds(jl,jk) = 0. + zmfdq(jl,jk) = 0. + zdmfdp(jl,jk) = 0. + zdpmel(jl,jk) = 0. + end do + end do + +!----------------------------------------- +!* 6.0 cumulus downdraft calculations +!----------------------------------------- + if(lmfdd) then +!* (a) determine lfs in 'cudlfsn' +!-------------------------------------- + call cudlfsn & + & (klon, klev,& + & kcbot, kctop, lndj, ldcum, & + & ztenh, zqenh, puen, pven, & + & pten, pqsen, pgeo, & + & zgeoh, paph, ptu, pqu, plu, & + & zuu, zvu, zmfub, zrfl, & + & ztd, zqd, zud, zvd, & + & pmfd, zmfds, zmfdq, zdmfdp, & + & idtop, loddraf) +!* (b) determine downdraft t,q and fluxes in 'cuddrafn' +!------------------------------------------------------------ + call cuddrafn & + & ( klon, klev, loddraf, & + & ztenh, zqenh, puen, pven, & + & pgeo, zgeoh, paph, zrfl, & + & ztd, zqd, zud, zvd, pmfu, & + & pmfd, zmfds, zmfdq, zdmfdp, pmfdde_rate ) +!----------------------------------------------------------- + end if +! +!----------------------------------------------------------------------- +!* 6.0 closure and clean work +! ------ +!-- 6.1 recalculate cloud base massflux from a cape closure +! for deep convection (ktype=1) +! + do jl=1,klon + if(ldcum(jl) .and. ktype(jl) .eq. 1) then + ikb = kcbot(jl) + ikt = kctop(jl) + zheat(jl)=0.0 + zcape(jl)=0.0 + zcape1(jl)=0.0 + zcape2(jl)=0.0 + zmfub1(jl)=zmfub(jl) + + ztauc(jl) = (zgeoh(jl,ikt)-zgeoh(jl,ikb)) / & + ((2.+ min(15.0,wup(jl)))*g) + if(lndj(jl) .eq. 0) then + upbl(jl) = 2.+ upbl(jl)/(paph(jl,klev+1)-paph(jl,ikb)) + ztaubl(jl) = (zgeoh(jl,ikb)-zgeoh(jl,klev+1))/(g*upbl(jl)) + ztaubl(jl) = min(300., ztaubl(jl)) + else + ztaubl(jl) = ztauc(jl) + end if + end if + end do +! + do jk = 1 , klev + do jl = 1 , klon + llo1 = ldcum(jl) .and. ktype(jl) .eq. 1 + if ( llo1 .and. jk <= kcbot(jl) .and. jk > kctop(jl) ) then + ikb = kcbot(jl) + zdz = pgeo(jl,jk-1)-pgeo(jl,jk) + zdp = pap(jl,jk)-pap(jl,jk-1) + zheat(jl) = zheat(jl) + ((pten(jl,jk-1)-pten(jl,jk)+zdz*rcpd) / & + ztenh(jl,jk)+vtmpc1*(pqen(jl,jk-1)-pqen(jl,jk))) * & + (g*(pmfu(jl,jk)+pmfd(jl,jk))) + zcape1(jl) = zcape1(jl) + ((ptu(jl,jk)-ztenh(jl,jk))/ztenh(jl,jk) + & + vtmpc1*(pqu(jl,jk)-zqenh(jl,jk))-plu(jl,jk))*zdp + end if + + if ( llo1 .and. jk >= kcbot(jl) ) then + if((paph(jl,klev+1)-paph(jl,kdpl(jl)))<50.e2) then + zdp = paph(jl,jk+1)-paph(jl,jk) + zcape2(jl) = zcape2(jl) + ztaubl(jl)* & + ((1.+vtmpc1*pqen(jl,jk))*ptte(jl,jk)+vtmpc1*pten(jl,jk)*pqte(jl,jk))*zdp + end if + end if + end do + end do + + do jl=1,klon + if(ldcum(jl).and.ktype(jl).eq.1) then + ikb = kcbot(jl) + ikt = kctop(jl) + ztau = ztauc(jl) * (1.+1.33e-5*dx(jl)) + ztau = max(ztmst,ztau) + ztau = max(720.,ztau) + ztau = min(10800.,ztau) + if(isequil) then + zcape2(jl)= max(0.,zcape2(jl)) + zcape(jl) = max(0.,min(zcape1(jl)-zcape2(jl),5000.)) + else + zcape(jl) = max(0.,min(zcape1(jl),5000.)) + end if + zheat(jl) = max(1.e-4,zheat(jl)) + zmfub1(jl) = (zcape(jl)*zmfub(jl))/(zheat(jl)*ztau) + zmfub1(jl) = max(zmfub1(jl),0.001) + zmfmax=(paph(jl,ikb)-paph(jl,ikb-1))*zcons2 + zmfub1(jl)=min(zmfub1(jl),zmfmax) + end if + end do +! +!* 6.2 recalculate convective fluxes due to effect of +! downdrafts on boundary layer moist static energy budget (ktype=2) +!-------------------------------------------------------- + do jl=1,klon + if(ldcum(jl) .and. ktype(jl) .eq. 2) then + ikb=kcbot(jl) + if(pmfd(jl,ikb).lt.0.0 .and. loddraf(jl)) then + zeps=-pmfd(jl,ikb)/max(zmfub(jl),cmfcmin) + else + zeps=0. + endif + zqumqe=pqu(jl,ikb)+plu(jl,ikb)- & + & zeps*zqd(jl,ikb)-(1.-zeps)*zqenh(jl,ikb) + zdqmin=max(0.01*zqenh(jl,ikb),cmfcmin) + zmfmax=(paph(jl,ikb)-paph(jl,ikb-1))*zcons2 +! using moist static engergy closure instead of moisture closure + zdh=cpd*(ptu(jl,ikb)-zeps*ztd(jl,ikb)- & + & (1.-zeps)*ztenh(jl,ikb))+alv*zqumqe + zdh=g*max(zdh,1.e5*zdqmin) + if(zdhpbl(jl).gt.0.)then + zmfub1(jl)=zdhpbl(jl)/zdh + else + zmfub1(jl) = zmfub(jl) + end if + zmfub1(jl) = min(zmfub1(jl),zmfmax) + end if + +!* 6.3 mid-level convection - nothing special +!--------------------------------------------------------- + if(ldcum(jl) .and. ktype(jl) .eq. 3 ) then + zmfub1(jl) = zmfub(jl) + end if + + end do + +!* 6.4 scaling the downdraft mass flux +!--------------------------------------------------------- + do jk=1,klev + do jl=1,klon + if( ldcum(jl) ) then + zfac=zmfub1(jl)/max(zmfub(jl),cmfcmin) + pmfd(jl,jk)=pmfd(jl,jk)*zfac + zmfds(jl,jk)=zmfds(jl,jk)*zfac + zmfdq(jl,jk)=zmfdq(jl,jk)*zfac + zdmfdp(jl,jk)=zdmfdp(jl,jk)*zfac + pmfdde_rate(jl,jk) = pmfdde_rate(jl,jk)*zfac + end if + end do + end do + +!* 6.5 scaling the updraft mass flux +! -------------------------------------------------------- + do jl = 1,klon + if ( ldcum(jl) ) zmfs(jl) = zmfub1(jl)/max(cmfcmin,zmfub(jl)) + end do + do jk = 2 , klev + do jl = 1,klon + if ( ldcum(jl) .and. jk >= kctop(jl)-1 ) then + ikb = kcbot(jl) + if ( jk>ikb ) then + zdz = ((paph(jl,klev+1)-paph(jl,jk))/(paph(jl,klev+1)-paph(jl,ikb))) + pmfu(jl,jk) = pmfu(jl,ikb)*zdz + end if + zmfmax = (paph(jl,jk)-paph(jl,jk-1))*zcons2 + if ( pmfu(jl,jk)*zmfs(jl) > zmfmax ) then + zmfs(jl) = min(zmfs(jl),zmfmax/pmfu(jl,jk)) + end if + end if + end do + end do + do jk = 2 , klev + do jl = 1,klon + if ( ldcum(jl) .and. jk <= kcbot(jl) .and. jk >= kctop(jl)-1 ) then + pmfu(jl,jk) = pmfu(jl,jk)*zmfs(jl) + zmfus(jl,jk) = zmfus(jl,jk)*zmfs(jl) + zmfuq(jl,jk) = zmfuq(jl,jk)*zmfs(jl) + zmful(jl,jk) = zmful(jl,jk)*zmfs(jl) + zdmfup(jl,jk) = zdmfup(jl,jk)*zmfs(jl) + plude(jl,jk) = plude(jl,jk)*zmfs(jl) + pmfude_rate(jl,jk) = pmfude_rate(jl,jk)*zmfs(jl) + end if + end do + end do + +!* 6.6 if ktype = 2, kcbot=kctop is not allowed +! --------------------------------------------------- + do jl = 1,klon + if ( ktype(jl) == 2 .and. & + kcbot(jl) == kctop(jl) .and. kcbot(jl) >= klev-1 ) then + ldcum(jl) = .false. + ktype(jl) = 0 + end if + end do + + if ( .not. lmfscv .or. .not. lmfpen ) then + do jl = 1,klon + llo2(jl) = .false. + if ( (.not. lmfscv .and. ktype(jl) == 2) .or. & + (.not. lmfpen .and. ktype(jl) == 1) ) then + llo2(jl) = .true. + ldcum(jl) = .false. + end if + end do + end if + +!* 6.7 set downdraft mass fluxes to zero above cloud top +!---------------------------------------------------- + do jl = 1,klon + if ( loddraf(jl) .and. idtop(jl) <= kctop(jl) ) then + idtop(jl) = kctop(jl) + 1 + end if + end do + do jk = 2 , klev + do jl = 1,klon + if ( loddraf(jl) ) then + if ( jk < idtop(jl) ) then + pmfd(jl,jk) = 0. + zmfds(jl,jk) = 0. + zmfdq(jl,jk) = 0. + pmfdde_rate(jl,jk) = 0. + zdmfdp(jl,jk) = 0. + else if ( jk == idtop(jl) ) then + pmfdde_rate(jl,jk) = 0. + end if + end if + end do + end do + + itopm2 = 2 +!---------------------------------------------------------- +!* 7.0 determine final convective fluxes in 'cuflx' +!---------------------------------------------------------- + call cuflxn & + & ( klon, klev, ztmst & + & , pten, pqen, pqsen, ztenh, zqenh & + & , paph, pap, zgeoh, lndj, ldcum & + & , kcbot, kctop, idtop, itopm2 & + & , ktype, loddraf & + & , pmfu, pmfd, zmfus, zmfds & + & , zmfuq, zmfdq, zmful, plude & + & , zdmfup, zdmfdp, zdpmel, zlglac & + & , prain, pmfdde_rate, pmflxr, pmflxs ) + +! some adjustments needed + do jl=1,klon + zmfs(jl) = 1. + zmfuub(jl)=0. + end do + do jk = 2 , klev + do jl = 1,klon + if ( loddraf(jl) .and. jk >= idtop(jl)-1 ) then + zmfmax = pmfu(jl,jk)*0.98 + if ( pmfd(jl,jk)+zmfmax+1.e-15 < 0. ) then + zmfs(jl) = min(zmfs(jl),-zmfmax/pmfd(jl,jk)) + end if + end if + end do + end do + + do jk = 2 , klev + do jl = 1 , klon + if ( zmfs(jl) < 1. .and. jk >= idtop(jl)-1 ) then + pmfd(jl,jk) = pmfd(jl,jk)*zmfs(jl) + zmfds(jl,jk) = zmfds(jl,jk)*zmfs(jl) + zmfdq(jl,jk) = zmfdq(jl,jk)*zmfs(jl) + pmfdde_rate(jl,jk) = pmfdde_rate(jl,jk)*zmfs(jl) + zmfuub(jl) = zmfuub(jl) - (1.-zmfs(jl))*zdmfdp(jl,jk) + pmflxr(jl,jk+1) = pmflxr(jl,jk+1) + zmfuub(jl) + zdmfdp(jl,jk) = zdmfdp(jl,jk)*zmfs(jl) + end if + end do + end do + + do jk = 2 , klev - 1 + do jl = 1, klon + if ( loddraf(jl) .and. jk >= idtop(jl)-1 ) then + zerate = -pmfd(jl,jk) + pmfd(jl,jk-1) + pmfdde_rate(jl,jk) + if ( zerate < 0. ) then + pmfdde_rate(jl,jk) = pmfdde_rate(jl,jk) - zerate + end if + end if + if ( ldcum(jl) .and. jk >= kctop(jl)-1 ) then + zerate = pmfu(jl,jk) - pmfu(jl,jk+1) + pmfude_rate(jl,jk) + if ( zerate < 0. ) then + pmfude_rate(jl,jk) = pmfude_rate(jl,jk) - zerate + end if + zdmfup(jl,jk) = pmflxr(jl,jk+1) + pmflxs(jl,jk+1) - & + pmflxr(jl,jk) - pmflxs(jl,jk) + zdmfdp(jl,jk) = 0. + end if + end do + end do + +! avoid negative humidities at ddraught top + do jl = 1,klon + if ( loddraf(jl) ) then + jk = idtop(jl) + ik = min(jk+1,klev) + if ( zmfdq(jl,jk) < 0.3*zmfdq(jl,ik) ) then + zmfdq(jl,jk) = 0.3*zmfdq(jl,ik) + end if + end if + end do + +! avoid negative humidities near cloud top because gradient of precip flux +! and detrainment / liquid water flux are too large + do jk = 2 , klev + do jl = 1, klon + if ( ldcum(jl) .and. jk >= kctop(jl)-1 .and. jk < kcbot(jl) ) then + zdz = ztmst*g/(paph(jl,jk+1)-paph(jl,jk)) + zmfa = zmfuq(jl,jk+1) + zmfdq(jl,jk+1) - & + zmfuq(jl,jk) - zmfdq(jl,jk) + & + zmful(jl,jk+1) - zmful(jl,jk) + zdmfup(jl,jk) + zmfa = (zmfa-plude(jl,jk))*zdz + if ( pqen(jl,jk)+zmfa < 0. ) then + plude(jl,jk) = plude(jl,jk) + 2.*(pqen(jl,jk)+zmfa)/zdz + end if + if ( plude(jl,jk) < 0. ) plude(jl,jk) = 0. + end if + if ( .not. ldcum(jl) ) pmfude_rate(jl,jk) = 0. + if ( abs(pmfd(jl,jk-1)) < 1.0e-20 ) pmfdde_rate(jl,jk) = 0. + end do + end do + + do jl=1,klon + prsfc(jl) = pmflxr(jl,klev+1) + pssfc(jl) = pmflxs(jl,klev+1) + end do + +!---------------------------------------------------------------- +!* 8.0 update tendencies for t and q in subroutine cudtdq +!---------------------------------------------------------------- + call cudtdqn(klon,klev,itopm2,kctop,idtop,ldcum,loddraf, & + ztmst,paph,zgeoh,pgeo,pten,ztenh,pqen,zqenh,pqsen, & + zlglac,plude,pmfu,pmfd,zmfus,zmfds,zmfuq,zmfdq,zmful, & + zdmfup,zdmfdp,zdpmel,ptte,pqte,pcte) +!---------------------------------------------------------------- +!* 9.0 update tendencies for u and u in subroutine cududv +!---------------------------------------------------------------- + if(lmfdudv) then + do jk = klev-1 , 2 , -1 + ik = jk + 1 + do jl = 1,klon + if ( ldcum(jl) ) then + if ( jk == kcbot(jl) .and. ktype(jl) < 3 ) then + ikb = kdpl(jl) + zuu(jl,jk) = puen(jl,ikb-1) + zvu(jl,jk) = pven(jl,ikb-1) + else if ( jk == kcbot(jl) .and. ktype(jl) == 3 ) then + zuu(jl,jk) = puen(jl,jk-1) + zvu(jl,jk) = pven(jl,jk-1) + end if + if ( jk < kcbot(jl) .and. jk >= kctop(jl) ) then + if(momtrans .eq. 1)then + zfac = 0. + if ( ktype(jl) == 1 .or. ktype(jl) == 3 ) zfac = 2. + if ( ktype(jl) == 1 .and. jk <= kctop(jl)+2 ) zfac = 3. + zerate = pmfu(jl,jk) - pmfu(jl,ik) + & + (1.+zfac)*pmfude_rate(jl,jk) + zderate = (1.+zfac)*pmfude_rate(jl,jk) + zmfa = 1./max(cmfcmin,pmfu(jl,jk)) + zuu(jl,jk) = (zuu(jl,ik)*pmfu(jl,ik) + & + zerate*puen(jl,jk)-zderate*zuu(jl,ik))*zmfa + zvu(jl,jk) = (zvu(jl,ik)*pmfu(jl,ik) + & + zerate*pven(jl,jk)-zderate*zvu(jl,ik))*zmfa + else + if(ktype(jl) == 1 .or. ktype(jl) == 3) then + pgf_u = -0.7*0.5*(pmfu(jl,ik)*(puen(jl,ik)-puen(jl,jk))+& + pmfu(jl,jk)*(puen(jl,jk)-puen(jl,jk-1))) + pgf_v = -0.7*0.5*(pmfu(jl,ik)*(pven(jl,ik)-pven(jl,jk))+& + pmfu(jl,jk)*(pven(jl,jk)-pven(jl,jk-1))) + else + pgf_u = 0. + pgf_v = 0. + end if + zerate = pmfu(jl,jk) - pmfu(jl,ik) + pmfude_rate(jl,jk) + zderate = pmfude_rate(jl,jk) + zmfa = 1./max(cmfcmin,pmfu(jl,jk)) + zuu(jl,jk) = (zuu(jl,ik)*pmfu(jl,ik) + & + zerate*puen(jl,jk)-zderate*zuu(jl,ik)+pgf_u)*zmfa + zvu(jl,jk) = (zvu(jl,ik)*pmfu(jl,ik) + & + zerate*pven(jl,jk)-zderate*zvu(jl,ik)+pgf_v)*zmfa + end if + end if + end if + end do + end do + + if(lmfdd) then + do jk = 3 , klev + ik = jk - 1 + do jl = 1,klon + if ( ldcum(jl) ) then + if ( jk == idtop(jl) ) then + zud(jl,jk) = 0.5*(zuu(jl,jk)+puen(jl,ik)) + zvd(jl,jk) = 0.5*(zvu(jl,jk)+pven(jl,ik)) + else if ( jk > idtop(jl) ) then + zerate = -pmfd(jl,jk) + pmfd(jl,ik) + pmfdde_rate(jl,jk) + zmfa = 1./min(-cmfcmin,pmfd(jl,jk)) + zud(jl,jk) = (zud(jl,ik)*pmfd(jl,ik) - & + zerate*puen(jl,ik)+pmfdde_rate(jl,jk)*zud(jl,ik))*zmfa + zvd(jl,jk) = (zvd(jl,ik)*pmfd(jl,ik) - & + zerate*pven(jl,ik)+pmfdde_rate(jl,jk)*zvd(jl,ik))*zmfa + end if + end if + end do + end do + end if +! -------------------------------------------------- +! rescale massfluxes for stability in Momentum +!------------------------------------------------------------------------ + zmfs(:) = 1. + do jk = 2 , klev + do jl = 1, klon + if ( ldcum(jl) .and. jk >= kctop(jl)-1 ) then + zmfmax = (paph(jl,jk)-paph(jl,jk-1))*zcons + if ( pmfu(jl,jk) > zmfmax .and. jk >= kctop(jl) ) then + zmfs(jl) = min(zmfs(jl),zmfmax/pmfu(jl,jk)) + end if + end if + end do + end do + do jk = 1 , klev + do jl = 1, klon + zmfuus(jl,jk) = pmfu(jl,jk) + zmfdus(jl,jk) = pmfd(jl,jk) + if ( ldcum(jl) .and. jk >= kctop(jl)-1 ) then + zmfuus(jl,jk) = pmfu(jl,jk)*zmfs(jl) + zmfdus(jl,jk) = pmfd(jl,jk)*zmfs(jl) + end if + end do + end do +!* 9.1 update u and v in subroutine cududvn +!------------------------------------------------------------------- + do jk = 1 , klev + do jl = 1, klon + ztenu(jl,jk) = pvom(jl,jk) + ztenv(jl,jk) = pvol(jl,jk) + end do + end do + + call cududvn(klon,klev,itopm2,ktype,kcbot,kctop, & + ldcum,ztmst,paph,puen,pven,zmfuus,zmfdus,zuu, & + zud,zvu,zvd,pvom,pvol) + +! calculate KE dissipation + do jl = 1, klon + zsum12(jl) = 0. + zsum22(jl) = 0. + end do + do jk = 1 , klev + do jl = 1, klon + zuv2(jl,jk) = 0. + if ( ldcum(jl) .and. jk >= kctop(jl)-1 ) then + zdz = (paph(jl,jk+1)-paph(jl,jk)) + zduten = pvom(jl,jk) - ztenu(jl,jk) + zdvten = pvol(jl,jk) - ztenv(jl,jk) + zuv2(jl,jk) = sqrt(zduten**2+zdvten**2) + zsum22(jl) = zsum22(jl) + zuv2(jl,jk)*zdz + zsum12(jl) = zsum12(jl) - & + (puen(jl,jk)*zduten+pven(jl,jk)*zdvten)*zdz + end if + end do + end do + do jk = 1 , klev + do jl = 1, klon + if ( ldcum(jl) .and. jk>=kctop(jl)-1 ) then + ztdis = rcpd*zsum12(jl)*zuv2(jl,jk)/max(1.e-15,zsum22(jl)) + ptte(jl,jk) = ptte(jl,jk) + ztdis + end if + end do + end do + + end if + +!---------------------------------------------------------------------- +!* 10. IN CASE THAT EITHER DEEP OR SHALLOW IS SWITCHED OFF +! NEED TO SET SOME VARIABLES A POSTERIORI TO ZERO +! --------------------------------------------------- + if ( .not. lmfscv .or. .not. lmfpen ) then + do jk = 2 , klev + do jl = 1, klon + if ( llo2(jl) .and. jk >= kctop(jl)-1 ) then + ptu(jl,jk) = pten(jl,jk) + pqu(jl,jk) = pqen(jl,jk) + plu(jl,jk) = 0. + pmfude_rate(jl,jk) = 0. + pmfdde_rate(jl,jk) = 0. + end if + end do + end do + do jl = 1, klon + if ( llo2(jl) ) then + kctop(jl) = klev - 1 + kcbot(jl) = klev - 1 + end if + end do + end if + + !---------------------------------------------------------------------- + !* 11.0 CHEMICAL TRACER TRANSPORT + ! ------------------------- + + if ( ktrac > 0 ) then + ! transport switched off for mid-level convection + do jl = 1, klon + if ( ldcum(jl) .and. ktype(jl) /= 3 .and. & + kcbot(jl)-kctop(jl) >= 1 ) then + lldcum(jl) = .true. + llddraf3(jl) = loddraf(jl) + else + lldcum(jl) = .false. + llddraf3(jl) = .false. + end if + end do + ! check and correct mass fluxes for CFL criterium + zmfs(:) = 1. + do jk = 2 , klev + do jl = 1, klon + if ( lldcum(jl) .and. jk >= kctop(jl) ) then + zmfmax = (paph(jl,jk)-paph(jl,jk-1))*0.8*zcons + if ( pmfu(jl,jk) > zmfmax ) then + zmfs(jl) = min(zmfs(jl),zmfmax/pmfu(jl,jk)) + end if + end if + end do + end do + + do jk = 1, klev + do jl = 1, klon + if ( lldcum(jl) .and. jk >= kctop(jl)-1 ) then + zmfuus(jl,jk) = pmfu(jl,jk)*zmfs(jl) + zmfudr(jl,jk) = pmfude_rate(jl,jk)*zmfs(jl) + else + zmfuus(jl,jk) = 0. + zmfudr(jl,jk) = 0. + end if + if ( llddraf3(jl) .and. jk >= idtop(jl)-1 ) then + zmfdus(jl,jk) = pmfd(jl,jk)*zmfs(jl) + zmfddr(jl,jk) = pmfdde_rate(jl,jk)*zmfs(jl) + else + zmfdus(jl,jk) = 0. + zmfddr(jl,jk) = 0. + end if + end do + end do + + call cuctracer(klon,klev,ktrac,kctop,idtop, & + lldcum,llddraf3,ztmst,paph,zmfuus,zmfdus, & + zmfudr,zmfddr,pcen,ptenc) + end if + + return + end subroutine cumastrn + +!********************************************** +! level 3 subroutine cuinin +!********************************************** +! + subroutine cuinin & + & (klon, klev, klevp1, klevm1, pten,& + & pqen, pqsen, puen, pven, pverv,& + & pgeo, paph, pgeoh, ptenh, pqenh,& + & pqsenh, klwmin, ptu, pqu, ptd,& + & pqd, puu, pvu, pud, pvd,& + & pmfu, pmfd, pmfus, pmfds, pmfuq,& + & pmfdq, pdmfup, pdmfdp, pdpmel, plu,& + & plude, klab) + implicit none +! m.tiedtke e.c.m.w.f. 12/89 +!***purpose +! ------- +! this routine interpolates large-scale fields of t,q etc. +! to half levels (i.e. grid for massflux scheme), +! and initializes values for updrafts and downdrafts +!***interface +! --------- +! this routine is called from *cumastr*. +!***method. +! -------- +! for extrapolation to half levels see tiedtke(1989) +!***externals +! --------- +! *cuadjtq* to specify qs at half levels +! ---------------------------------------------------------------- + integer klon,klev,klevp1,klevm1 + real(kind=kind_phys) pten(klon,klev), pqen(klon,klev),& + & puen(klon,klev), pven(klon,klev),& + & pqsen(klon,klev), pverv(klon,klev),& + & pgeo(klon,klev), pgeoh(klon,klevp1),& + & paph(klon,klevp1), ptenh(klon,klev),& + & pqenh(klon,klev), pqsenh(klon,klev) + real(kind=kind_phys) ptu(klon,klev), pqu(klon,klev),& + & ptd(klon,klev), pqd(klon,klev),& + & puu(klon,klev), pud(klon,klev),& + & pvu(klon,klev), pvd(klon,klev),& + & pmfu(klon,klev), pmfd(klon,klev),& + & pmfus(klon,klev), pmfds(klon,klev),& + & pmfuq(klon,klev), pmfdq(klon,klev),& + & pdmfup(klon,klev), pdmfdp(klon,klev),& + & plu(klon,klev), plude(klon,klev) + real(kind=kind_phys) zwmax(klon), zph(klon), & + & pdpmel(klon,klev) + integer klab(klon,klev), klwmin(klon) + logical loflag(klon) +! local variables + integer jl,jk + integer icall,ik + real(kind=kind_phys) zzs +!------------------------------------------------------------ +!* 1. specify large scale parameters at half levels +!* adjust temperature fields if staticly unstable +!* find level of maximum vertical velocity +! ----------------------------------------------------------- + do jk=2,klev + do jl=1,klon + ptenh(jl,jk)=(max(cpd*pten(jl,jk-1)+pgeo(jl,jk-1), & + & cpd*pten(jl,jk)+pgeo(jl,jk))-pgeoh(jl,jk))*rcpd + pqenh(jl,jk) = pqen(jl,jk-1) + pqsenh(jl,jk)= pqsen(jl,jk-1) + zph(jl)=paph(jl,jk) + loflag(jl)=.true. + end do + + if ( jk >= klev-1 .or. jk < 2 ) cycle + ik=jk + icall=0 + call cuadjtqn(klon,klev,ik,zph,ptenh,pqsenh,loflag,icall) + do jl=1,klon + pqenh(jl,jk)=min(pqen(jl,jk-1),pqsen(jl,jk-1)) & + & +(pqsenh(jl,jk)-pqsen(jl,jk-1)) + pqenh(jl,jk)=max(pqenh(jl,jk),0.) + end do + end do + + do jl=1,klon + ptenh(jl,klev)=(cpd*pten(jl,klev)+pgeo(jl,klev)- & + & pgeoh(jl,klev))*rcpd + pqenh(jl,klev)=pqen(jl,klev) + ptenh(jl,1)=pten(jl,1) + pqenh(jl,1)=pqen(jl,1) + klwmin(jl)=klev + zwmax(jl)=0. + end do + + do jk=klevm1,2,-1 + do jl=1,klon + zzs=max(cpd*ptenh(jl,jk)+pgeoh(jl,jk), & + & cpd*ptenh(jl,jk+1)+pgeoh(jl,jk+1)) + ptenh(jl,jk)=(zzs-pgeoh(jl,jk))*rcpd + end do + end do + + do jk=klev,3,-1 + do jl=1,klon + if(pverv(jl,jk).lt.zwmax(jl)) then + zwmax(jl)=pverv(jl,jk) + klwmin(jl)=jk + end if + end do + end do +!----------------------------------------------------------- +!* 2.0 initialize values for updrafts and downdrafts +!----------------------------------------------------------- + do jk=1,klev + ik=jk-1 + if(jk.eq.1) ik=1 + do jl=1,klon + ptu(jl,jk)=ptenh(jl,jk) + ptd(jl,jk)=ptenh(jl,jk) + pqu(jl,jk)=pqenh(jl,jk) + pqd(jl,jk)=pqenh(jl,jk) + plu(jl,jk)=0. + puu(jl,jk)=puen(jl,ik) + pud(jl,jk)=puen(jl,ik) + pvu(jl,jk)=pven(jl,ik) + pvd(jl,jk)=pven(jl,ik) + klab(jl,jk)=0 + end do + end do + return + end subroutine cuinin + +!--------------------------------------------------------- +! level 3 souroutines +!-------------------------------------------------------- + subroutine cutypen & + & ( klon, klev, klevp1, klevm1, pqen,& + & ptenh, pqenh, pqsenh, pgeoh, paph,& + & hfx, qfx, pgeo, pqsen, pap,& + & pten, lndj, cutu, cuqu, culab,& + & ldcum, cubot, cutop, ktype, wbase, culu, kdpl ) +! zhang & wang iprc 2011-2013 +!***purpose. +! -------- +! to produce first guess updraught for cu-parameterizations +! calculates condensation level, and sets updraught base variables and +! first guess cloud type +!***interface +! --------- +! this routine is called from *cumastr*. +! input are environm. values of t,q,p,phi at half levels. +! it returns cloud types as follows; +! ktype=1 for deep cumulus +! ktype=2 for shallow cumulus +!***method. +! -------- +! based on a simplified updraught equation +! partial(hup)/partial(z)=eta(h - hup) +! eta is the entrainment rate for test parcel +! h stands for dry static energy or the total water specific humidity +! references: christian jakob, 2003: a new subcloud model for +! mass-flux convection schemes +! influence on triggering, updraft properties, and model +! climate, mon.wea.rev. +! 131, 2765-2778 +! and +! ifs documentation - cy36r1,cy38r1 +!***input variables: +! ptenh [ztenh] - environment temperature on half levels. (cuini) +! pqenh [zqenh] - env. specific humidity on half levels. (cuini) +! pgeoh [zgeoh] - geopotential on half levels, (mssflx) +! paph - pressure of half levels. (mssflx) +! rho - density of the lowest model level +! qfx - net upward moisture flux at the surface (kg/m^2/s) +! hfx - net upward heat flux at the surface (w/m^2) +!***variables output by cutype: +! ktype - convection type - 1: penetrative (cumastr) +! 2: stratocumulus (cumastr) +! 3: mid-level (cuasc) +! information for updraft parcel (ptu,pqu,plu,kcbot,klab,kdpl...) +! ---------------------------------------------------------------- +!------------------------------------------------------------------- + implicit none +!------------------------------------------------------------------- + integer klon, klev, klevp1, klevm1 + real(kind=kind_phys) ptenh(klon,klev), pqenh(klon,klev),& + & pqsen(klon,klev), pqsenh(klon,klev),& + & pgeoh(klon,klevp1), paph(klon,klevp1),& + & pap(klon,klev), pqen(klon,klev) + real(kind=kind_phys) pten(klon,klev) + real(kind=kind_phys) ptu(klon,klev),pqu(klon,klev),plu(klon,klev) + real(kind=kind_phys) pgeo(klon,klev) + integer klab(klon,klev) + integer kctop(klon),kcbot(klon) + + real(kind=kind_phys) qfx(klon),hfx(klon) + real(kind=kind_phys) zph(klon) + integer lndj(klon) + logical loflag(klon), deepflag(klon), resetflag(klon) + +! output variables + real(kind=kind_phys) cutu(klon,klev), cuqu(klon,klev), culu(klon,klev) + integer culab(klon,klev) + real(kind=kind_phys) wbase(klon) + integer ktype(klon),cubot(klon),cutop(klon),kdpl(klon) + logical ldcum(klon) + +! local variables + real(kind=kind_phys) zqold(klon) + real(kind=kind_phys) rho, part1, part2, root, conw, deltt, deltq + real(kind=kind_phys) eta(klon),dz(klon),coef(klon) + real(kind=kind_phys) dhen(klon,klev), dh(klon,klev) + real(kind=kind_phys) plude(klon,klev) + real(kind=kind_phys) kup(klon,klev) + real(kind=kind_phys) vptu(klon,klev),vten(klon,klev) + real(kind=kind_phys) zbuo(klon,klev),abuoy(klon,klev) + + real(kind=kind_phys) zz,zdken,zdq + real(kind=kind_phys) fscale,crirh1,pp + real(kind=kind_phys) atop1,atop2,abot + real(kind=kind_phys) tmix,zmix,qmix,pmix + real(kind=kind_phys) zlglac,dp + integer nk,is,ikb,ikt + + real(kind=kind_phys) zqsu,zcor,zdp,zesdp,zalfaw,zfacw,zfaci,zfac,zdsdp,zdqsdt,zdtdp + real(kind=kind_phys) zpdifftop, zpdiffbot + integer zcbase(klon), itoppacel(klon) + integer jl,jk,ik,icall,levels + logical needreset, lldcum(klon) +!-------------------------------------------------------------- + do jl=1,klon + kcbot(jl)=klev + kctop(jl)=klev + kdpl(jl) =klev + ktype(jl)=0 + wbase(jl)=0. + ldcum(jl)=.false. + end do + +!----------------------------------------------------------- +! let's do test,and check the shallow convection first +! the first level is klev +! define deltat and deltaq +!----------------------------------------------------------- + do jk=1,klev + do jl=1,klon + plu(jl,jk)=culu(jl,jk) ! parcel liquid water + ptu(jl,jk)=cutu(jl,jk) ! parcel temperature + pqu(jl,jk)=cuqu(jl,jk) ! parcel specific humidity + klab(jl,jk)=culab(jl,jk) + dh(jl,jk)=0.0 ! parcel dry static energy + dhen(jl,jk)=0.0 ! environment dry static energy + kup(jl,jk)=0.0 ! updraught kinetic energy for parcel + vptu(jl,jk)=0.0 ! parcel virtual temperature considering water-loading + vten(jl,jk)=0.0 ! environment virtual temperature + zbuo(jl,jk)=0.0 ! parcel buoyancy + abuoy(jl,jk)=0.0 + end do + end do + + do jl=1,klon + zqold(jl) = 0. + lldcum(jl) = .false. + loflag(jl) = .true. + end do + +! check the levels from lowest level to second top level + do jk=klevm1,2,-1 + +! define the variables at the first level + if(jk .eq. klevm1) then + do jl=1,klon + rho=pap(jl,klev)/ & + & (rd*(pten(jl,klev)*(1.+vtmpc1*pqen(jl,klev)))) + hfx(jl) = hfx(jl)*rho*cpd + qfx(jl) = qfx(jl)*rho + part1 = 1.5*0.4*pgeo(jl,klev)/ & + & (rho*pten(jl,klev)) + part2 = -hfx(jl)*rcpd-vtmpc1*pten(jl,klev)*qfx(jl) + root = 0.001-part1*part2 + if(part2 .lt. 0.) then + conw = 1.2*(root)**t13 + deltt = max(1.5*hfx(jl)/(rho*cpd*conw),0.) + deltq = max(1.5*qfx(jl)/(rho*conw),0.) + kup(jl,klev) = 0.5*(conw**2) + pqu(jl,klev)= pqenh(jl,klev) + deltq + dhen(jl,klev)= pgeoh(jl,klev) + ptenh(jl,klev)*cpd + dh(jl,klev) = dhen(jl,klev) + deltt*cpd + ptu(jl,klev) = (dh(jl,klev)-pgeoh(jl,klev))*rcpd + vptu(jl,klev)=ptu(jl,klev)*(1.+vtmpc1*pqu(jl,klev)) + vten(jl,klev)=ptenh(jl,klev)*(1.+vtmpc1*pqenh(jl,klev)) + zbuo(jl,klev)=(vptu(jl,klev)-vten(jl,klev))/vten(jl,klev) + klab(jl,klev) = 1 + else + loflag(jl) = .false. + end if + end do + end if + + is=0 + do jl=1,klon + if(loflag(jl))then + is=is+1 + endif + enddo + if(is.eq.0) exit + +! the next levels, we use the variables at the first level as initial values + do jl=1,klon + if(loflag(jl)) then + eta(jl) = 0.55/(pgeo(jl,jk)*zrg)+1.e-4 + dz(jl) = (pgeoh(jl,jk)-pgeoh(jl,jk+1))*zrg + coef(jl)= 0.5*eta(jl)*dz(jl) + dhen(jl,jk) = pgeoh(jl,jk) + cpd*ptenh(jl,jk) + dh(jl,jk) = (coef(jl)*(dhen(jl,jk+1)+dhen(jl,jk))& + & +(1.-coef(jl))*dh(jl,jk+1))/(1.+coef(jl)) + pqu(jl,jk) =(coef(jl)*(pqenh(jl,jk+1)+pqenh(jl,jk))& + & +(1.-coef(jl))*pqu(jl,jk+1))/(1.+coef(jl)) + ptu(jl,jk) = (dh(jl,jk)-pgeoh(jl,jk))*rcpd + zqold(jl) = pqu(jl,jk) + zph(jl)=paph(jl,jk) + end if + end do +! check if the parcel is saturated + ik=jk + icall=1 + call cuadjtqn(klon,klev,ik,zph,ptu,pqu,loflag,icall) + do jl=1,klon + if( loflag(jl) ) then + zdq = max((zqold(jl) - pqu(jl,jk)),0.) + plu(jl,jk) = plu(jl,jk+1) + zdq + zlglac=zdq*((1.-foealfa(ptu(jl,jk))) - & + (1.-foealfa(ptu(jl,jk+1)))) + plu(jl,jk) = min(plu(jl,jk),5.e-3) + dh(jl,jk) = pgeoh(jl,jk) + cpd*(ptu(jl,jk)+ralfdcp*zlglac) +! compute the updraft speed + vptu(jl,jk) = ptu(jl,jk)*(1.+vtmpc1*pqu(jl,jk)-plu(jl,jk))+& + ralfdcp*zlglac + vten(jl,jk) = ptenh(jl,jk)*(1.+vtmpc1*pqenh(jl,jk)) + zbuo(jl,jk) = (vptu(jl,jk) - vten(jl,jk))/vten(jl,jk) + abuoy(jl,jk)=(zbuo(jl,jk)+zbuo(jl,jk+1))*0.5*g + atop1 = 1.0 - 2.*coef(jl) + atop2 = 2.0*dz(jl)*abuoy(jl,jk) + abot = 1.0 + 2.*coef(jl) + kup(jl,jk) = (atop1*kup(jl,jk+1) + atop2) / abot + +! let's find the exact cloud base + if ( plu(jl,jk) > 0. .and. klab(jl,jk+1) == 1 ) then + ik = jk + 1 + zqsu = foeewm(ptu(jl,ik))/paph(jl,ik) + zqsu = min(0.5,zqsu) + zcor = 1./(1.-vtmpc1*zqsu) + zqsu = zqsu*zcor + zdq = min(0.,pqu(jl,ik)-zqsu) + zalfaw = foealfa(ptu(jl,ik)) + zfacw = c5les/((ptu(jl,ik)-c4les)**2) + zfaci = c5ies/((ptu(jl,ik)-c4ies)**2) + zfac = zalfaw*zfacw + (1.-zalfaw)*zfaci + zesdp = foeewm(ptu(jl,ik))/paph(jl,ik) + zcor = 1./(1.-vtmpc1*zesdp) + zdqsdt = zfac*zcor*zqsu + zdtdp = rd*ptu(jl,ik)/(cpd*paph(jl,ik)) + zdp = zdq/(zdqsdt*zdtdp) + zcbase(jl) = paph(jl,ik) + zdp +! chose nearest half level as cloud base (jk or jk+1) + zpdifftop = zcbase(jl) - paph(jl,jk) + zpdiffbot = paph(jl,jk+1) - zcbase(jl) + if ( zpdifftop > zpdiffbot .and. kup(jl,jk+1) > 0. ) then + ikb = min(klev-1,jk+1) + klab(jl,ikb) = 2 + klab(jl,jk) = 2 + kcbot(jl) = ikb + plu(jl,jk+1) = 1.0e-8 + else if ( zpdifftop <= zpdiffbot .and.kup(jl,jk) > 0. ) then + klab(jl,jk) = 2 + kcbot(jl) = jk + end if + end if + + if(kup(jl,jk) .lt. 0.)then + loflag(jl) = .false. + if(plu(jl,jk+1) .gt. 0.) then + kctop(jl) = jk + lldcum(jl) = .true. + else + lldcum(jl) = .false. + end if + else + if(plu(jl,jk) .gt. 0.)then + klab(jl,jk)=2 + else + klab(jl,jk)=1 + end if + end if + end if + end do + + end do ! end all the levels + + do jl=1,klon + ikb = kcbot(jl) + ikt = kctop(jl) + if(paph(jl,ikb) - paph(jl,ikt) > zdnoprc) lldcum(jl) = .false. + if(lldcum(jl)) then + ktype(jl) = 2 + ldcum(jl) = .true. + wbase(jl) = sqrt(max(2.*kup(jl,ikb),0.)) + cubot(jl) = ikb + cutop(jl) = ikt + kdpl(jl) = klev + else + cutop(jl) = -1 + cubot(jl) = -1 + kdpl(jl) = klev - 1 + ldcum(jl) = .false. + wbase(jl) = 0. + end if + end do + + do jk=klev,1,-1 + do jl=1,klon + ikt = kctop(jl) + if(jk .ge. ikt)then + culab(jl,jk) = klab(jl,jk) + cutu(jl,jk) = ptu(jl,jk) + cuqu(jl,jk) = pqu(jl,jk) + culu(jl,jk) = plu(jl,jk) + end if + end do + end do + +!----------------------------------------------------------- +! next, let's check the deep convection +! the first level is klevm1-1 +! define deltat and deltaq +!---------------------------------------------------------- +! we check the parcel starting level by level +! assume the mix-layer is 60hPa + deltt = 0.2 + deltq = 1.0e-4 + do jl=1,klon + deepflag(jl) = .false. + end do + + do jk=klev,1,-1 + do jl=1,klon + if((paph(jl,klev+1)-paph(jl,jk)) .lt. 350.e2) itoppacel(jl) = jk + end do + end do + + do levels=klevm1-1,klevm1-20,-1 ! loop starts + do jk=1,klev + do jl=1,klon + plu(jl,jk)=0.0 ! parcel liquid water + ptu(jl,jk)=0.0 ! parcel temperature + pqu(jl,jk)=0.0 ! parcel specific humidity + dh(jl,jk)=0.0 ! parcel dry static energy + dhen(jl,jk)=0.0 ! environment dry static energy + kup(jl,jk)=0.0 ! updraught kinetic energy for parcel + vptu(jl,jk)=0.0 ! parcel virtual temperature consideringwater-loading + vten(jl,jk)=0.0 ! environment virtual temperature + abuoy(jl,jk)=0.0 + zbuo(jl,jk)=0.0 + klab(jl,jk)=0 + end do + end do + + do jl=1,klon + kcbot(jl) = levels + kctop(jl) = levels + zqold(jl) = 0. + lldcum(jl) = .false. + resetflag(jl)= .false. + loflag(jl) = (.not. deepflag(jl)) .and. (levels.ge.itoppacel(jl)) + end do + +! start the inner loop to search the deep convection points + do jk=levels,2,-1 + is=0 + do jl=1,klon + if(loflag(jl))then + is=is+1 + endif + enddo + if(is.eq.0) exit + +! define the variables at the departure level + if(jk .eq. levels) then + do jl=1,klon + if(loflag(jl)) then + if((paph(jl,klev+1)-paph(jl,jk)) < 60.e2) then + tmix=0. + qmix=0. + zmix=0. + pmix=0. + do nk=jk+2,jk,-1 + if(pmix < 50.e2) then + dp = paph(jl,nk) - paph(jl,nk-1) + tmix=tmix+dp*ptenh(jl,nk) + qmix=qmix+dp*pqenh(jl,nk) + zmix=zmix+dp*pgeoh(jl,nk) + pmix=pmix+dp + end if + end do + tmix=tmix/pmix + qmix=qmix/pmix + zmix=zmix/pmix + else + tmix=ptenh(jl,jk+1) + qmix=pqenh(jl,jk+1) + zmix=pgeoh(jl,jk+1) + end if + + pqu(jl,jk+1) = qmix + deltq + dhen(jl,jk+1)= zmix + tmix*cpd + dh(jl,jk+1) = dhen(jl,jk+1) + deltt*cpd + ptu(jl,jk+1) = (dh(jl,jk+1)-pgeoh(jl,jk+1))*rcpd + kup(jl,jk+1) = 0.5 + klab(jl,jk+1)= 1 + vptu(jl,jk+1)=ptu(jl,jk+1)*(1.+vtmpc1*pqu(jl,jk+1)) + vten(jl,jk+1)=ptenh(jl,jk+1)*(1.+vtmpc1*pqenh(jl,jk+1)) + zbuo(jl,jk+1)=(vptu(jl,jk+1)-vten(jl,jk+1))/vten(jl,jk+1) + end if + end do + end if + +! the next levels, we use the variables at the first level as initial values + do jl=1,klon + if(loflag(jl)) then +! define the fscale + fscale = min(1.,(pqsen(jl,jk)/pqsen(jl,levels))**3) + eta(jl) = 1.75e-3*fscale + dz(jl) = (pgeoh(jl,jk)-pgeoh(jl,jk+1))*zrg + coef(jl)= 0.5*eta(jl)*dz(jl) + dhen(jl,jk) = pgeoh(jl,jk) + cpd*ptenh(jl,jk) + dh(jl,jk) = (coef(jl)*(dhen(jl,jk+1)+dhen(jl,jk))& + & +(1.-coef(jl))*dh(jl,jk+1))/(1.+coef(jl)) + pqu(jl,jk) =(coef(jl)*(pqenh(jl,jk+1)+pqenh(jl,jk))& + & +(1.-coef(jl))*pqu(jl,jk+1))/(1.+coef(jl)) + ptu(jl,jk) = (dh(jl,jk)-pgeoh(jl,jk))*rcpd + zqold(jl) = pqu(jl,jk) + zph(jl)=paph(jl,jk) + end if + end do +! check if the parcel is saturated + ik=jk + icall=1 + call cuadjtqn(klon,klev,ik,zph,ptu,pqu,loflag,icall) + + do jl=1,klon + if( loflag(jl) ) then + zdq = max((zqold(jl) - pqu(jl,jk)),0.) + plu(jl,jk) = plu(jl,jk+1) + zdq + zlglac=zdq*((1.-foealfa(ptu(jl,jk))) - & + (1.-foealfa(ptu(jl,jk+1)))) + plu(jl,jk) = 0.5*plu(jl,jk) + dh(jl,jk) = pgeoh(jl,jk) + cpd*(ptu(jl,jk)+ralfdcp*zlglac) +! compute the updraft speed + vptu(jl,jk) = ptu(jl,jk)*(1.+vtmpc1*pqu(jl,jk)-plu(jl,jk))+& + ralfdcp*zlglac + vten(jl,jk) = ptenh(jl,jk)*(1.+vtmpc1*pqenh(jl,jk)) + zbuo(jl,jk) = (vptu(jl,jk) - vten(jl,jk))/vten(jl,jk) + abuoy(jl,jk)=(zbuo(jl,jk)+zbuo(jl,jk+1))*0.5*g + atop1 = 1.0 - 2.*coef(jl) + atop2 = 2.0*dz(jl)*abuoy(jl,jk) + abot = 1.0 + 2.*coef(jl) + kup(jl,jk) = (atop1*kup(jl,jk+1) + atop2) / abot +! let's find the exact cloud base + if ( plu(jl,jk) > 0. .and. klab(jl,jk+1) == 1 ) then + ik = jk + 1 + zqsu = foeewm(ptu(jl,ik))/paph(jl,ik) + zqsu = min(0.5,zqsu) + zcor = 1./(1.-vtmpc1*zqsu) + zqsu = zqsu*zcor + zdq = min(0.,pqu(jl,ik)-zqsu) + zalfaw = foealfa(ptu(jl,ik)) + zfacw = c5les/((ptu(jl,ik)-c4les)**2) + zfaci = c5ies/((ptu(jl,ik)-c4ies)**2) + zfac = zalfaw*zfacw + (1.-zalfaw)*zfaci + zesdp = foeewm(ptu(jl,ik))/paph(jl,ik) + zcor = 1./(1.-vtmpc1*zesdp) + zdqsdt = zfac*zcor*zqsu + zdtdp = rd*ptu(jl,ik)/(cpd*paph(jl,ik)) + zdp = zdq/(zdqsdt*zdtdp) + zcbase(jl) = paph(jl,ik) + zdp +! chose nearest half level as cloud base (jk or jk+1) + zpdifftop = zcbase(jl) - paph(jl,jk) + zpdiffbot = paph(jl,jk+1) - zcbase(jl) + if ( zpdifftop > zpdiffbot .and. kup(jl,jk+1) > 0. ) then + ikb = min(klev-1,jk+1) + klab(jl,ikb) = 2 + klab(jl,jk) = 2 + kcbot(jl) = ikb + plu(jl,jk+1) = 1.0e-8 + else if ( zpdifftop <= zpdiffbot .and.kup(jl,jk) > 0. ) then + klab(jl,jk) = 2 + kcbot(jl) = jk + end if + end if + + if(kup(jl,jk) .lt. 0.)then + loflag(jl) = .false. + if(plu(jl,jk+1) .gt. 0.) then + kctop(jl) = jk + lldcum(jl) = .true. + else + lldcum(jl) = .false. + end if + else + if(plu(jl,jk) .gt. 0.)then + klab(jl,jk)=2 + else + klab(jl,jk)=1 + end if + end if + end if + end do + + end do ! end all the levels + + needreset = .false. + do jl=1,klon + ikb = kcbot(jl) + ikt = kctop(jl) + if(paph(jl,ikb) - paph(jl,ikt) < zdnoprc) lldcum(jl) = .false. + if(lldcum(jl)) then + ktype(jl) = 1 + ldcum(jl) = .true. + deepflag(jl) = .true. + wbase(jl) = sqrt(max(2.*kup(jl,ikb),0.)) + cubot(jl) = ikb + cutop(jl) = ikt + kdpl(jl) = levels+1 + needreset = .true. + resetflag(jl)= .true. + end if + end do + + if(needreset) then + do jk=klev,1,-1 + do jl=1,klon + if(resetflag(jl)) then + ikt = kctop(jl) + ikb = kdpl(jl) + if(jk .le. ikb .and. jk .ge. ikt )then + culab(jl,jk) = klab(jl,jk) + cutu(jl,jk) = ptu(jl,jk) + cuqu(jl,jk) = pqu(jl,jk) + culu(jl,jk) = plu(jl,jk) + else + culab(jl,jk) = 1 + cutu(jl,jk) = ptenh(jl,jk) + cuqu(jl,jk) = pqenh(jl,jk) + culu(jl,jk) = 0. + end if + if ( jk .lt. ikt ) culab(jl,jk) = 0 + end if + end do + end do + end if + + end do ! end all cycles + + return + end subroutine cutypen + +!----------------------------------------------------------------- +! level 3 subroutines 'cuascn' +!----------------------------------------------------------------- + subroutine cuascn & + & (klon, klev, klevp1, klevm1, ptenh,& + & pqenh, puen, pven, pten, pqen,& + & pqsen, pgeo, pgeoh, pap, paph,& + & pqte, pverv, klwmin, ldcum, phcbase,& + & ktype, klab, ptu, pqu, plu,& + & puu, pvu, pmfu, pmfub, & + & pmfus, pmfuq, pmful, plude, pdmfup,& + & kcbot, kctop, kctop0, kcum, ztmst,& + & pqsenh, plglac, lndj, wup, wbase, kdpl, pmfude_rate) + implicit none +! this routine does the calculations for cloud ascents +! for cumulus parameterization +! m.tiedtke e.c.m.w.f. 7/86 modif. 12/89 +! y.wang iprc 11/01 modif. +! c.zhang iprc 05/12 modif. +!***purpose. +! -------- +! to produce cloud ascents for cu-parametrization +! (vertical profiles of t,q,l,u and v and corresponding +! fluxes as well as precipitation rates) +!***interface +! --------- +! this routine is called from *cumastr*. +!***method. +! -------- +! lift surface air dry-adiabatically to cloud base +! and then calculate moist ascent for +! entraining/detraining plume. +! entrainment and detrainment rates differ for +! shallow and deep cumulus convection. +! in case there is no penetrative or shallow convection +! check for possibility of mid level convection +! (cloud base values calculated in *cubasmc*) +!***externals +! --------- +! *cuadjtqn* adjust t and q due to condensation in ascent +! *cuentrn* calculate entrainment/detrainment rates +! *cubasmcn* calculate cloud base values for midlevel convection +!***reference +! --------- +! (tiedtke,1989) +!***input variables: +! ptenh [ztenh] - environ temperature on half levels. (cuini) +! pqenh [zqenh] - env. specific humidity on half levels. (cuini) +! puen - environment wind u-component. (mssflx) +! pven - environment wind v-component. (mssflx) +! pten - environment temperature. (mssflx) +! pqen - environment specific humidity. (mssflx) +! pqsen - environment saturation specific humidity. (mssflx) +! pgeo - geopotential. (mssflx) +! pgeoh [zgeoh] - geopotential on half levels, (mssflx) +! pap - pressure in pa. (mssflx) +! paph - pressure of half levels. (mssflx) +! pqte - moisture convergence (delta q/delta t). (mssflx) +! pverv - large scale vertical velocity (omega). (mssflx) +! klwmin [ilwmin] - level of minimum omega. (cuini) +! klab [ilab] - level label - 1: sub-cloud layer. +! 2: condensation level (cloud base) +! pmfub [zmfub] - updraft mass flux at cloud base. (cumastr) +!***variables modified by cuasc: +! ldcum - logical denoting profiles. (cubase) +! ktype - convection type - 1: penetrative (cumastr) +! 2: stratocumulus (cumastr) +! 3: mid-level (cuasc) +! ptu - cloud temperature. +! pqu - cloud specific humidity. +! plu - cloud liquid water (moisture condensed out) +! puu [zuu] - cloud momentum u-component. +! pvu [zvu] - cloud momentum v-component. +! pmfu - updraft mass flux. +! pmfus [zmfus] - updraft flux of dry static energy. (cubasmc) +! pmfuq [zmfuq] - updraft flux of specific humidity. +! pmful [zmful] - updraft flux of cloud liquid water. +! plude - liquid water returned to environment by detrainment. +! pdmfup [zmfup] - +! kcbot - cloud base level. (cubase) +! kctop - cloud top level +! kctop0 [ictop0] - estimate of cloud top. (cumastr) +! kcum [icum] - flag to control the call + + integer klev,klon,klevp1,klevm1 + real(kind=kind_phys) ptenh(klon,klev), pqenh(klon,klev), & + & puen(klon,klev), pven(klon,klev),& + & pten(klon,klev), pqen(klon,klev),& + & pgeo(klon,klev), pgeoh(klon,klevp1),& + & pap(klon,klev), paph(klon,klevp1),& + & pqsen(klon,klev), pqte(klon,klev),& + & pverv(klon,klev), pqsenh(klon,klev) + real(kind=kind_phys) ptu(klon,klev), pqu(klon,klev),& + & puu(klon,klev), pvu(klon,klev),& + & pmfu(klon,klev), zph(klon),& + & pmfub(klon), & + & pmfus(klon,klev), pmfuq(klon,klev),& + & plu(klon,klev), plude(klon,klev),& + & pmful(klon,klev), pdmfup(klon,klev) + real(kind=kind_phys) zdmfen(klon), zdmfde(klon),& + & zmfuu(klon), zmfuv(klon),& + & zpbase(klon), zqold(klon) + real(kind=kind_phys) phcbase(klon), zluold(klon) + real(kind=kind_phys) zprecip(klon), zlrain(klon,klev) + real(kind=kind_phys) zbuo(klon,klev), kup(klon,klev) + real(kind=kind_phys) wup(klon) + real(kind=kind_phys) wbase(klon), zodetr(klon,klev) + real(kind=kind_phys) plglac(klon,klev) + + real(kind=kind_phys) eta(klon),dz(klon) + + integer klwmin(klon), ktype(klon),& + & klab(klon,klev), kcbot(klon),& + & kctop(klon), kctop0(klon) + integer lndj(klon) + logical ldcum(klon), loflag(klon) + logical llo2,llo3, llo1(klon) + + integer kdpl(klon) + real(kind=kind_phys) zoentr(klon), zdpmean(klon) + real(kind=kind_phys) pdmfen(klon,klev), pmfude_rate(klon,klev) +! local variables + integer jl,jk + integer ikb,icum,itopm2,ik,icall,is,kcum,jlm,jll + integer jlx(klon) + real(kind=kind_phys) ztmst,zcons2,zfacbuo,zprcdgw,z_cwdrag,z_cldmax,z_cwifrac,z_cprc2 + real(kind=kind_phys) zmftest,zmfmax,zqeen,zseen,zscde,zqude + real(kind=kind_phys) zmfusk,zmfuqk,zmfulk + real(kind=kind_phys) zbc,zbe,zkedke,zmfun,zwu,zprcon,zdt,zcbf,zzco + real(kind=kind_phys) zlcrit,zdfi,zc,zd,zint,zlnew,zvw,zvi,zalfaw,zrold + real(kind=kind_phys) zrnew,zz,zdmfeu,zdmfdu,dp + real(kind=kind_phys) zfac,zbuoc,zdkbuo,zdken,zvv,zarg,zchange,zxe,zxs,zdshrd + real(kind=kind_phys) atop1,atop2,abot +!-------------------------------- +!* 1. specify parameters +!-------------------------------- + zcons2=3./(g*ztmst) + zfacbuo = 0.5/(1.+0.5) + zprcdgw = cprcon*zrg + z_cldmax = 5.e-3 + z_cwifrac = 0.5 + z_cprc2 = 0.5 + z_cwdrag = (3.0/8.0)*0.506/0.2 +!--------------------------------- +! 2. set default values +!--------------------------------- + llo3 = .false. + do jl=1,klon + zluold(jl)=0. + wup(jl)=0. + zdpmean(jl)=0. + zoentr(jl)=0. + if(.not.ldcum(jl)) then + ktype(jl)=0 + kcbot(jl) = -1 + pmfub(jl) = 0. + pqu(jl,klev) = 0. + end if + end do + + ! initialize variout quantities + do jk=1,klev + do jl=1,klon + if(jk.ne.kcbot(jl)) plu(jl,jk)=0. + pmfu(jl,jk)=0. + pmfus(jl,jk)=0. + pmfuq(jl,jk)=0. + pmful(jl,jk)=0. + plude(jl,jk)=0. + plglac(jl,jk)=0. + pdmfup(jl,jk)=0. + zlrain(jl,jk)=0. + zbuo(jl,jk)=0. + kup(jl,jk)=0. + pdmfen(jl,jk) = 0. + pmfude_rate(jl,jk) = 0. + if(.not.ldcum(jl).or.ktype(jl).eq.3) klab(jl,jk)=0 + if(.not.ldcum(jl).and.paph(jl,jk).lt.4.e4) kctop0(jl)=jk + end do + end do + + do jl = 1,klon + if ( ktype(jl) == 3 ) ldcum(jl) = .false. + end do +!------------------------------------------------ +! 3.0 initialize values at cloud base level +!------------------------------------------------ + do jl=1,klon + kctop(jl)=kcbot(jl) + if(ldcum(jl)) then + ikb = kcbot(jl) + kup(jl,ikb) = 0.5*wbase(jl)**2 + pmfu(jl,ikb) = pmfub(jl) + pmfus(jl,ikb) = pmfub(jl)*(cpd*ptu(jl,ikb)+pgeoh(jl,ikb)) + pmfuq(jl,ikb) = pmfub(jl)*pqu(jl,ikb) + pmful(jl,ikb) = pmfub(jl)*plu(jl,ikb) + end if + end do +! +!----------------------------------------------------------------- +! 4. do ascent: subcloud layer (klab=1) ,clouds (klab=2) +! by doing first dry-adiabatic ascent and then +! by adjusting t,q and l accordingly in *cuadjtqn*, +! then check for buoyancy and set flags accordingly +!----------------------------------------------------------------- +! + do jk=klevm1,3,-1 +! specify cloud base values for midlevel convection +! in *cubasmc* in case there is not already convection +! --------------------------------------------------------------------- + ik=jk + call cubasmcn& + & (klon, klev, klevm1, ik, pten,& + & pqen, pqsen, puen, pven, pverv,& + & pgeo, pgeoh, ldcum, ktype, klab, zlrain,& + & pmfu, pmfub, kcbot, ptu,& + & pqu, plu, puu, pvu, pmfus,& + & pmfuq, pmful, pdmfup) + is = 0 + jlm = 0 + do jl = 1,klon + loflag(jl) = .false. + zprecip(jl) = 0. + llo1(jl) = .false. + is = is + klab(jl,jk+1) + if ( klab(jl,jk+1) == 0 ) klab(jl,jk) = 0 + if ( (ldcum(jl) .and. klab(jl,jk+1) == 2) .or. & + (ktype(jl) == 3 .and. klab(jl,jk+1) == 1) ) then + loflag(jl) = .true. + jlm = jlm + 1 + jlx(jlm) = jl + end if + zph(jl) = paph(jl,jk) + if ( ktype(jl) == 3 .and. jk == kcbot(jl) ) then + zmfmax = (paph(jl,jk)-paph(jl,jk-1))*zcons2 + if ( pmfub(jl) > zmfmax ) then + zfac = zmfmax/pmfub(jl) + pmfu(jl,jk+1) = pmfu(jl,jk+1)*zfac + pmfus(jl,jk+1) = pmfus(jl,jk+1)*zfac + pmfuq(jl,jk+1) = pmfuq(jl,jk+1)*zfac + pmfub(jl) = zmfmax + end if + pmfub(jl)=min(pmfub(jl),zmfmax) + end if + end do + + if(is.gt.0) llo3 = .true. +! +!* specify entrainment rates in *cuentr* +! ------------------------------------- + ik=jk + call cuentrn(klon,klev,ik,kcbot,ldcum,llo3, & + pgeoh,pmfu,zdmfen,zdmfde) +! +! do adiabatic ascent for entraining/detraining plume + if(llo3) then +! ------------------------------------------------------- +! + do jl = 1,klon + zqold(jl) = 0. + end do + do jll = 1 , jlm + jl = jlx(jll) + zdmfde(jl) = min(zdmfde(jl),0.75*pmfu(jl,jk+1)) + if ( jk == kcbot(jl) ) then + zoentr(jl) = -1.75e-3*(min(1.,pqen(jl,jk)/pqsen(jl,jk)) - & + 1.)*(pgeoh(jl,jk)-pgeoh(jl,jk+1))*zrg + zoentr(jl) = min(0.4,zoentr(jl))*pmfu(jl,jk+1) + end if + if ( jk < kcbot(jl) ) then + zmfmax = (paph(jl,jk)-paph(jl,jk-1))*zcons2 + zxs = max(pmfu(jl,jk+1)-zmfmax,0.) + wup(jl) = wup(jl) + kup(jl,jk+1)*(pap(jl,jk+1)-pap(jl,jk)) + zdpmean(jl) = zdpmean(jl) + pap(jl,jk+1) - pap(jl,jk) + zdmfen(jl) = zoentr(jl) + if ( ktype(jl) >= 2 ) then + zdmfen(jl) = 2.0*zdmfen(jl) + zdmfde(jl) = zdmfen(jl) + end if + zdmfde(jl) = zdmfde(jl) * & + (1.6-min(1.,pqen(jl,jk)/pqsen(jl,jk))) + zmftest = pmfu(jl,jk+1) + zdmfen(jl) - zdmfde(jl) + zchange = max(zmftest-zmfmax,0.) + zxe = max(zchange-zxs,0.) + zdmfen(jl) = zdmfen(jl) - zxe + zchange = zchange - zxe + zdmfde(jl) = zdmfde(jl) + zchange + end if + pdmfen(jl,jk) = zdmfen(jl) - zdmfde(jl) + pmfu(jl,jk) = pmfu(jl,jk+1) + zdmfen(jl) - zdmfde(jl) + zqeen = pqenh(jl,jk+1)*zdmfen(jl) + zseen = (cpd*ptenh(jl,jk+1)+pgeoh(jl,jk+1))*zdmfen(jl) + zscde = (cpd*ptu(jl,jk+1)+pgeoh(jl,jk+1))*zdmfde(jl) + zqude = pqu(jl,jk+1)*zdmfde(jl) + plude(jl,jk) = plu(jl,jk+1)*zdmfde(jl) + zmfusk = pmfus(jl,jk+1) + zseen - zscde + zmfuqk = pmfuq(jl,jk+1) + zqeen - zqude + zmfulk = pmful(jl,jk+1) - plude(jl,jk) + plu(jl,jk) = zmfulk*(1./max(cmfcmin,pmfu(jl,jk))) + pqu(jl,jk) = zmfuqk*(1./max(cmfcmin,pmfu(jl,jk))) + ptu(jl,jk) = (zmfusk * & + (1./max(cmfcmin,pmfu(jl,jk)))-pgeoh(jl,jk))*rcpd + ptu(jl,jk) = max(100.,ptu(jl,jk)) + ptu(jl,jk) = min(400.,ptu(jl,jk)) + zqold(jl) = pqu(jl,jk) + zlrain(jl,jk) = zlrain(jl,jk+1)*(pmfu(jl,jk+1)-zdmfde(jl)) * & + (1./max(cmfcmin,pmfu(jl,jk))) + zluold(jl) = plu(jl,jk) + end do +! reset to environmental values if below departure level + do jl = 1,klon + if ( jk > kdpl(jl) ) then + ptu(jl,jk) = ptenh(jl,jk) + pqu(jl,jk) = pqenh(jl,jk) + plu(jl,jk) = 0. + zluold(jl) = plu(jl,jk) + end if + end do +!* do corrections for moist ascent +!* by adjusting t,q and l in *cuadjtq* +!------------------------------------------------ + ik=jk + icall=1 +! + if ( jlm > 0 ) then + call cuadjtqn(klon,klev,ik,zph,ptu,pqu,loflag,icall) + end if +! compute the upfraft speed in cloud layer + do jll = 1 , jlm + jl = jlx(jll) + if ( pqu(jl,jk) /= zqold(jl) ) then + plglac(jl,jk) = plu(jl,jk) * & + ((1.-foealfa(ptu(jl,jk)))- & + (1.-foealfa(ptu(jl,jk+1)))) + ptu(jl,jk) = ptu(jl,jk) + ralfdcp*plglac(jl,jk) + end if + end do + do jll = 1 , jlm + jl = jlx(jll) + if ( pqu(jl,jk) /= zqold(jl) ) then + klab(jl,jk) = 2 + plu(jl,jk) = plu(jl,jk) + zqold(jl) - pqu(jl,jk) + zbc = ptu(jl,jk)*(1.+vtmpc1*pqu(jl,jk)-plu(jl,jk+1) - & + zlrain(jl,jk+1)) + zbe = ptenh(jl,jk)*(1.+vtmpc1*pqenh(jl,jk)) + zbuo(jl,jk) = zbc - zbe +! set flags for the case of midlevel convection + if ( ktype(jl) == 3 .and. klab(jl,jk+1) == 1 ) then + if ( zbuo(jl,jk) > -0.5 ) then + ldcum(jl) = .true. + kctop(jl) = jk + kup(jl,jk) = 0.5 + else + klab(jl,jk) = 0 + pmfu(jl,jk) = 0. + plude(jl,jk) = 0. + plu(jl,jk) = 0. + end if + end if + if ( klab(jl,jk+1) == 2 ) then + if ( zbuo(jl,jk) < 0. ) then + ptenh(jl,jk) = 0.5*(pten(jl,jk)+pten(jl,jk-1)) + pqenh(jl,jk) = 0.5*(pqen(jl,jk)+pqen(jl,jk-1)) + zbuo(jl,jk) = zbc - ptenh(jl,jk)*(1.+vtmpc1*pqenh(jl,jk)) + end if + zbuoc = (zbuo(jl,jk) / & + (ptenh(jl,jk)*(1.+vtmpc1*pqenh(jl,jk)))+zbuo(jl,jk+1) / & + (ptenh(jl,jk+1)*(1.+vtmpc1*pqenh(jl,jk+1))))*0.5 + zdkbuo = (pgeoh(jl,jk)-pgeoh(jl,jk+1))*zfacbuo*zbuoc +! mixing and "pressure" gradient term in upper troposphere + if ( zdmfen(jl) > 0. ) then + zdken = min(1.,(1.+z_cwdrag)*zdmfen(jl) / & + max(cmfcmin,pmfu(jl,jk+1))) + else + zdken = min(1.,(1.+z_cwdrag)*zdmfde(jl) / & + max(cmfcmin,pmfu(jl,jk+1))) + end if + kup(jl,jk) = (kup(jl,jk+1)*(1.-zdken)+zdkbuo) / & + (1.+zdken) + if ( zbuo(jl,jk) < 0. ) then + zkedke = kup(jl,jk)/max(1.e-10,kup(jl,jk+1)) + zkedke = max(0.,min(1.,zkedke)) + zmfun = sqrt(zkedke)*pmfu(jl,jk+1) !* (1.6-min(1.,pqen(jl,jk) / & + ! pqsen(jl,jk))) + zdmfde(jl) = max(zdmfde(jl),pmfu(jl,jk+1)-zmfun) + plude(jl,jk) = plu(jl,jk+1)*zdmfde(jl) + pmfu(jl,jk) = pmfu(jl,jk+1) + zdmfen(jl) - zdmfde(jl) + end if + if ( zbuo(jl,jk) > -0.2 ) then + ikb = kcbot(jl) + zoentr(jl) = 1.75e-3*(0.3-(min(1.,pqen(jl,jk-1) / & + pqsen(jl,jk-1))-1.))*(pgeoh(jl,jk-1)-pgeoh(jl,jk)) * & + zrg*min(1.,pqsen(jl,jk)/pqsen(jl,ikb))**3 + zoentr(jl) = min(0.4,zoentr(jl))*pmfu(jl,jk) + else + zoentr(jl) = 0. + end if +! erase values if below departure level + if ( jk > kdpl(jl) ) then + pmfu(jl,jk) = pmfu(jl,jk+1) + kup(jl,jk) = 0.5 + end if + if ( kup(jl,jk) > 0. .and. pmfu(jl,jk) > 0. ) then + kctop(jl) = jk + llo1(jl) = .true. + else + klab(jl,jk) = 0 + pmfu(jl,jk) = 0. + kup(jl,jk) = 0. + zdmfde(jl) = pmfu(jl,jk+1) + plude(jl,jk) = plu(jl,jk+1)*zdmfde(jl) + end if +! save detrainment rates for updraught + if ( pmfu(jl,jk+1) > 0. ) pmfude_rate(jl,jk) = zdmfde(jl) + end if + else if ( ktype(jl) == 2 .and. pqu(jl,jk) == zqold(jl) ) then + klab(jl,jk) = 0 + pmfu(jl,jk) = 0. + kup(jl,jk) = 0. + zdmfde(jl) = pmfu(jl,jk+1) + plude(jl,jk) = plu(jl,jk+1)*zdmfde(jl) + pmfude_rate(jl,jk) = zdmfde(jl) + end if + end do + + do jl = 1,klon + if ( llo1(jl) ) then +! conversions only proceeds if plu is greater than a threshold liquid water +! content of 0.3 g/kg over water and 0.5 g/kg over land to prevent precipitation +! generation from small water contents. + if ( lndj(jl).eq.1 ) then + zdshrd = 5.e-4 + else + zdshrd = 3.e-4 + end if + ikb=kcbot(jl) + if ( plu(jl,jk) > zdshrd )then +! if ((paph(jl,ikb)-paph(jl,jk))>zdnoprc) then + zwu = min(15.0,sqrt(2.*max(0.1,kup(jl,jk+1)))) + zprcon = zprcdgw/(0.75*zwu) +! PARAMETERS FOR BERGERON-FINDEISEN PROCESS (T < -5C) + zdt = min(rtber-rtice,max(rtber-ptu(jl,jk),0.)) + zcbf = 1. + z_cprc2*sqrt(zdt) + zzco = zprcon*zcbf + zlcrit = zdshrd/zcbf + zdfi = pgeoh(jl,jk) - pgeoh(jl,jk+1) + zc = (plu(jl,jk)-zluold(jl)) + zarg = (plu(jl,jk)/zlcrit)**2 + if ( zarg < 25.0 ) then + zd = zzco*(1.-exp(-zarg))*zdfi + else + zd = zzco*zdfi + end if + zint = exp(-zd) + zlnew = zluold(jl)*zint + zc/zd*(1.-zint) + zlnew = max(0.,min(plu(jl,jk),zlnew)) + zlnew = min(z_cldmax,zlnew) + zprecip(jl) = max(0.,zluold(jl)+zc-zlnew) + pdmfup(jl,jk) = zprecip(jl)*pmfu(jl,jk) + zlrain(jl,jk) = zlrain(jl,jk) + zprecip(jl) + plu(jl,jk) = zlnew + end if + end if + end do + do jl = 1, klon + if ( llo1(jl) ) then + if ( zlrain(jl,jk) > 0. ) then + zvw = 21.18*zlrain(jl,jk)**0.2 + zvi = z_cwifrac*zvw + zalfaw = foealfa(ptu(jl,jk)) + zvv = zalfaw*zvw + (1.-zalfaw)*zvi + zrold = zlrain(jl,jk) - zprecip(jl) + zc = zprecip(jl) + zwu = min(15.0,sqrt(2.*max(0.1,kup(jl,jk)))) + zd = zvv/zwu + zint = exp(-zd) + zrnew = zrold*zint + zc/zd*(1.-zint) + zrnew = max(0.,min(zlrain(jl,jk),zrnew)) + zlrain(jl,jk) = zrnew + end if + end if + end do + do jll = 1 , jlm + jl = jlx(jll) + pmful(jl,jk) = plu(jl,jk)*pmfu(jl,jk) + pmfus(jl,jk) = (cpd*ptu(jl,jk)+pgeoh(jl,jk))*pmfu(jl,jk) + pmfuq(jl,jk) = pqu(jl,jk)*pmfu(jl,jk) + end do + end if + end do +!---------------------------------------------------------------------- +! 5. final calculations +! ------------------ + do jl = 1,klon + if ( kctop(jl) == -1 ) ldcum(jl) = .false. + kcbot(jl) = max(kcbot(jl),kctop(jl)) + if ( ldcum(jl) ) then + wup(jl) = max(1.e-2,wup(jl)/max(1.,zdpmean(jl))) + wup(jl) = sqrt(2.*wup(jl)) + end if + end do + + return + end subroutine cuascn +!--------------------------------------------------------- +! level 3 souroutines +!-------------------------------------------------------- + subroutine cudlfsn & + & (klon, klev, & + & kcbot, kctop, lndj, ldcum, & + & ptenh, pqenh, puen, pven, & + & pten, pqsen, pgeo, & + & pgeoh, paph, ptu, pqu, plu,& + & puu, pvu, pmfub, prfl, & + & ptd, pqd, pud, pvd, & + & pmfd, pmfds, pmfdq, pdmfdp, & + & kdtop, lddraf) + +! this routine calculates level of free sinking for +! cumulus downdrafts and specifies t,q,u and v values + +! m.tiedtke e.c.m.w.f. 12/86 modif. 12/89 + +! purpose. +! -------- +! to produce lfs-values for cumulus downdrafts +! for massflux cumulus parameterization + +! interface +! --------- +! this routine is called from *cumastr*. +! input are environmental values of t,q,u,v,p,phi +! and updraft values t,q,u and v and also +! cloud base massflux and cu-precipitation rate. +! it returns t,q,u and v values and massflux at lfs. + +! method. + +! check for negative buoyancy of air of equal parts of +! moist environmental air and cloud air. + +! parameter description units +! --------- ----------- ----- +! input parameters (integer): + +! *klon* number of grid points per packet +! *klev* number of levels +! *kcbot* cloud base level +! *kctop* cloud top level + +! input parameters (logical): + +! *lndj* land sea mask (1 for land) +! *ldcum* flag: .true. for convective points + +! input parameters (real(kind=kind_phys)): + +! *ptenh* env. temperature (t+1) on half levels k +! *pqenh* env. spec. humidity (t+1) on half levels kg/kg +! *puen* provisional environment u-velocity (t+1) m/s +! *pven* provisional environment v-velocity (t+1) m/s +! *pten* provisional environment temperature (t+1) k +! *pqsen* environment spec. saturation humidity (t+1) kg/kg +! *pgeo* geopotential m2/s2 +! *pgeoh* geopotential on half levels m2/s2 +! *paph* provisional pressure on half levels pa +! *ptu* temperature in updrafts k +! *pqu* spec. humidity in updrafts kg/kg +! *plu* liquid water content in updrafts kg/kg +! *puu* u-velocity in updrafts m/s +! *pvu* v-velocity in updrafts m/s +! *pmfub* massflux in updrafts at cloud base kg/(m2*s) + +! updated parameters (real(kind=kind_phys)): + +! *prfl* precipitation rate kg/(m2*s) + +! output parameters (real(kind=kind_phys)): + +! *ptd* temperature in downdrafts k +! *pqd* spec. humidity in downdrafts kg/kg +! *pud* u-velocity in downdrafts m/s +! *pvd* v-velocity in downdrafts m/s +! *pmfd* massflux in downdrafts kg/(m2*s) +! *pmfds* flux of dry static energy in downdrafts j/(m2*s) +! *pmfdq* flux of spec. humidity in downdrafts kg/(m2*s) +! *pdmfdp* flux difference of precip. in downdrafts kg/(m2*s) + +! output parameters (integer): + +! *kdtop* top level of downdrafts + +! output parameters (logical): + +! *lddraf* .true. if downdrafts exist + +! externals +! --------- +! *cuadjtq* for calculating wet bulb t and q at lfs +!---------------------------------------------------------------------- + implicit none + + integer klev,klon + real(kind=kind_phys) ptenh(klon,klev), pqenh(klon,klev), & + & puen(klon,klev), pven(klon,klev), & + & pten(klon,klev), pqsen(klon,klev), & + & pgeo(klon,klev), & + & pgeoh(klon,klev+1), paph(klon,klev+1),& + & ptu(klon,klev), pqu(klon,klev), & + & puu(klon,klev), pvu(klon,klev), & + & plu(klon,klev), & + & pmfub(klon), prfl(klon) + + real(kind=kind_phys) ptd(klon,klev), pqd(klon,klev), & + & pud(klon,klev), pvd(klon,klev), & + & pmfd(klon,klev), pmfds(klon,klev), & + & pmfdq(klon,klev), pdmfdp(klon,klev) + integer kcbot(klon), kctop(klon), & + & kdtop(klon), ikhsmin(klon) + logical ldcum(klon), & + & lddraf(klon) + integer lndj(klon) + + real(kind=kind_phys) ztenwb(klon,klev), zqenwb(klon,klev), & + & zcond(klon), zph(klon), & + & zhsmin(klon) + logical llo2(klon) +! local variables + integer jl,jk + integer is,ik,icall,ike + real(kind=kind_phys) zhsk,zttest,zqtest,zbuo,zmftop + +!---------------------------------------------------------------------- + +! 1. set default values for downdrafts +! --------------------------------- + do jl=1,klon + lddraf(jl)=.false. + kdtop(jl)=klev+1 + ikhsmin(jl)=klev+1 + zhsmin(jl)=1.e8 + enddo +!---------------------------------------------------------------------- + +! 2. determine level of free sinking: +! downdrafts shall start at model level of minimum +! of saturation moist static energy or below +! respectively + +! for every point and proceed as follows: + +! (1) determine level of minimum of hs +! (2) determine wet bulb environmental t and q +! (3) do mixing with cumulus cloud air +! (4) check for negative buoyancy +! (5) if buoyancy>0 repeat (2) to (4) for next +! level below + +! the assumption is that air of downdrafts is mixture +! of 50% cloud air + 50% environmental air at wet bulb +! temperature (i.e. which became saturated due to +! evaporation of rain and cloud water) +! ---------------------------------------------------- + do jk=3,klev-2 + do jl=1,klon + zhsk=cpd*pten(jl,jk)+pgeo(jl,jk) + & + & foelhm(pten(jl,jk))*pqsen(jl,jk) + if(zhsk .lt. zhsmin(jl)) then + zhsmin(jl) = zhsk + ikhsmin(jl)= jk + end if + end do + end do + + + ike=klev-3 + do jk=3,ike + +! 2.1 calculate wet-bulb temperature and moisture +! for environmental air in *cuadjtq* +! ------------------------------------------- + is=0 + do jl=1,klon + ztenwb(jl,jk)=ptenh(jl,jk) + zqenwb(jl,jk)=pqenh(jl,jk) + zph(jl)=paph(jl,jk) + llo2(jl)=ldcum(jl).and.prfl(jl).gt.0..and..not.lddraf(jl).and. & + & (jk.lt.kcbot(jl).and.jk.gt.kctop(jl)).and. jk.ge.ikhsmin(jl) + if(llo2(jl))then + is=is+1 + endif + enddo + if(is.eq.0) cycle + + ik=jk + icall=2 + call cuadjtqn & + & ( klon, klev, ik, zph, ztenwb, zqenwb, llo2, icall) + +! 2.2 do mixing of cumulus and environmental air +! and check for negative buoyancy. +! then set values for downdraft at lfs. +! ---------------------------------------- + do jl=1,klon + if(llo2(jl)) then + zttest=0.5*(ptu(jl,jk)+ztenwb(jl,jk)) + zqtest=0.5*(pqu(jl,jk)+zqenwb(jl,jk)) + zbuo=zttest*(1.+vtmpc1 *zqtest)- & + & ptenh(jl,jk)*(1.+vtmpc1 *pqenh(jl,jk)) + zcond(jl)=pqenh(jl,jk)-zqenwb(jl,jk) + zmftop=-cmfdeps*pmfub(jl) + if(zbuo.lt.0..and.prfl(jl).gt.10.*zmftop*zcond(jl)) then + kdtop(jl)=jk + lddraf(jl)=.true. + ptd(jl,jk)=zttest + pqd(jl,jk)=zqtest + pmfd(jl,jk)=zmftop + pmfds(jl,jk)=pmfd(jl,jk)*(cpd*ptd(jl,jk)+pgeoh(jl,jk)) + pmfdq(jl,jk)=pmfd(jl,jk)*pqd(jl,jk) + pdmfdp(jl,jk-1)=-0.5*pmfd(jl,jk)*zcond(jl) + prfl(jl)=prfl(jl)+pdmfdp(jl,jk-1) + endif + endif + enddo + + enddo + + return + end subroutine cudlfsn + +!--------------------------------------------------------- +! level 3 souroutines +!-------------------------------------------------------- +!********************************************** +! subroutine cuddrafn +!********************************************** + subroutine cuddrafn & + & ( klon, klev, lddraf & + & , ptenh, pqenh, puen, pven & + & , pgeo, pgeoh, paph, prfl & + & , ptd, pqd, pud, pvd, pmfu & + & , pmfd, pmfds, pmfdq, pdmfdp, pmfdde_rate ) + +! this routine calculates cumulus downdraft descent + +! m.tiedtke e.c.m.w.f. 12/86 modif. 12/89 + +! purpose. +! -------- +! to produce the vertical profiles for cumulus downdrafts +! (i.e. t,q,u and v and fluxes) + +! interface +! --------- + +! this routine is called from *cumastr*. +! input is t,q,p,phi,u,v at half levels. +! it returns fluxes of s,q and evaporation rate +! and u,v at levels where downdraft occurs + +! method. +! -------- +! calculate moist descent for entraining/detraining plume by +! a) moving air dry-adiabatically to next level below and +! b) correcting for evaporation to obtain saturated state. + +! parameter description units +! --------- ----------- ----- +! input parameters (integer): + +! *klon* number of grid points per packet +! *klev* number of levels + +! input parameters (logical): + +! *lddraf* .true. if downdrafts exist + +! input parameters (real(kind=kind_phys)): + +! *ptenh* env. temperature (t+1) on half levels k +! *pqenh* env. spec. humidity (t+1) on half levels kg/kg +! *puen* provisional environment u-velocity (t+1) m/s +! *pven* provisional environment v-velocity (t+1) m/s +! *pgeo* geopotential m2/s2 +! *pgeoh* geopotential on half levels m2/s2 +! *paph* provisional pressure on half levels pa +! *pmfu* massflux updrafts kg/(m2*s) + +! updated parameters (real(kind=kind_phys)): + +! *prfl* precipitation rate kg/(m2*s) + +! output parameters (real(kind=kind_phys)): + +! *ptd* temperature in downdrafts k +! *pqd* spec. humidity in downdrafts kg/kg +! *pud* u-velocity in downdrafts m/s +! *pvd* v-velocity in downdrafts m/s +! *pmfd* massflux in downdrafts kg/(m2*s) +! *pmfds* flux of dry static energy in downdrafts j/(m2*s) +! *pmfdq* flux of spec. humidity in downdrafts kg/(m2*s) +! *pdmfdp* flux difference of precip. in downdrafts kg/(m2*s) + +! externals +! --------- +! *cuadjtq* for adjusting t and q due to evaporation in +! saturated descent +!---------------------------------------------------------------------- + implicit none + + integer klev,klon + real(kind=kind_phys) ptenh(klon,klev), pqenh(klon,klev), & + & puen(klon,klev), pven(klon,klev), & + & pgeoh(klon,klev+1), paph(klon,klev+1), & + & pgeo(klon,klev), pmfu(klon,klev) + + real(kind=kind_phys) ptd(klon,klev), pqd(klon,klev), & + & pud(klon,klev), pvd(klon,klev), & + & pmfd(klon,klev), pmfds(klon,klev), & + & pmfdq(klon,klev), pdmfdp(klon,klev), & + & prfl(klon) + real(kind=kind_phys) pmfdde_rate(klon,klev) + logical lddraf(klon) + + real(kind=kind_phys) zdmfen(klon), zdmfde(klon), & + & zcond(klon), zoentr(klon), & + & zbuoy(klon) + real(kind=kind_phys) zph(klon) + logical llo2(klon) + logical llo1 +! local variables + integer jl,jk + integer is,ik,icall,ike, itopde(klon) + real(kind=kind_phys) zentr,zdz,zzentr,zseen,zqeen,zsdde,zqdde,zdmfdp + real(kind=kind_phys) zmfdsk,zmfdqk,zbuo,zrain,zbuoyz,zmfduk,zmfdvk + +!---------------------------------------------------------------------- +! 1. calculate moist descent for cumulus downdraft by +! (a) calculating entrainment/detrainment rates, +! including organized entrainment dependent on +! negative buoyancy and assuming +! linear decrease of massflux in pbl +! (b) doing moist descent - evaporative cooling +! and moistening is calculated in *cuadjtq* +! (c) checking for negative buoyancy and +! specifying final t,q,u,v and downward fluxes +! ------------------------------------------------- + do jl=1,klon + zoentr(jl)=0. + zbuoy(jl)=0. + zdmfen(jl)=0. + zdmfde(jl)=0. + enddo + + do jk=klev,1,-1 + do jl=1,klon + pmfdde_rate(jl,jk) = 0. + if((paph(jl,klev+1)-paph(jl,jk)).lt. 60.e2) itopde(jl) = jk + end do + end do + + do jk=3,klev + is=0 + do jl=1,klon + zph(jl)=paph(jl,jk) + llo2(jl)=lddraf(jl).and.pmfd(jl,jk-1).lt.0. + if(llo2(jl)) then + is=is+1 + endif + enddo + if(is.eq.0) cycle + + do jl=1,klon + if(llo2(jl)) then + zentr = entrdd*pmfd(jl,jk-1)*(pgeoh(jl,jk-1)-pgeoh(jl,jk))*zrg + zdmfen(jl)=zentr + zdmfde(jl)=zentr + endif + enddo + + do jl=1,klon + if(llo2(jl)) then + if(jk.gt.itopde(jl)) then + zdmfen(jl)=0. + zdmfde(jl)=pmfd(jl,itopde(jl))* & + & (paph(jl,jk)-paph(jl,jk-1))/ & + & (paph(jl,klev+1)-paph(jl,itopde(jl))) + endif + endif + enddo + + do jl=1,klon + if(llo2(jl)) then + if(jk.le.itopde(jl)) then + zdz=-(pgeoh(jl,jk-1)-pgeoh(jl,jk))*zrg + zzentr=zoentr(jl)*zdz*pmfd(jl,jk-1) + zdmfen(jl)=zdmfen(jl)+zzentr + zdmfen(jl)=max(zdmfen(jl),0.3*pmfd(jl,jk-1)) + zdmfen(jl)=max(zdmfen(jl),-0.75*pmfu(jl,jk)- & + & (pmfd(jl,jk-1)-zdmfde(jl))) + zdmfen(jl)=min(zdmfen(jl),0.) + endif + endif + enddo + + do jl=1,klon + if(llo2(jl)) then + pmfd(jl,jk)=pmfd(jl,jk-1)+zdmfen(jl)-zdmfde(jl) + zseen=(cpd*ptenh(jl,jk-1)+pgeoh(jl,jk-1))*zdmfen(jl) + zqeen=pqenh(jl,jk-1)*zdmfen(jl) + zsdde=(cpd*ptd(jl,jk-1)+pgeoh(jl,jk-1))*zdmfde(jl) + zqdde=pqd(jl,jk-1)*zdmfde(jl) + zmfdsk=pmfds(jl,jk-1)+zseen-zsdde + zmfdqk=pmfdq(jl,jk-1)+zqeen-zqdde + pqd(jl,jk)=zmfdqk*(1./min(-cmfcmin,pmfd(jl,jk))) + ptd(jl,jk)=(zmfdsk*(1./min(-cmfcmin,pmfd(jl,jk)))-& + & pgeoh(jl,jk))*rcpd + ptd(jl,jk)=min(400.,ptd(jl,jk)) + ptd(jl,jk)=max(100.,ptd(jl,jk)) + zcond(jl)=pqd(jl,jk) + endif + enddo + + ik=jk + icall=2 + call cuadjtqn(klon, klev, ik, zph, ptd, pqd, llo2, icall ) + + do jl=1,klon + if(llo2(jl)) then + zcond(jl)=zcond(jl)-pqd(jl,jk) + zbuo=ptd(jl,jk)*(1.+vtmpc1 *pqd(jl,jk))- & + & ptenh(jl,jk)*(1.+vtmpc1 *pqenh(jl,jk)) + if(prfl(jl).gt.0..and.pmfu(jl,jk).gt.0.) then + zrain=prfl(jl)/pmfu(jl,jk) + zbuo=zbuo-ptd(jl,jk)*zrain + endif + if(zbuo.ge.0 .or. prfl(jl).le.(pmfd(jl,jk)*zcond(jl))) then + pmfd(jl,jk)=0. + zbuo=0. + endif + pmfds(jl,jk)=(cpd*ptd(jl,jk)+pgeoh(jl,jk))*pmfd(jl,jk) + pmfdq(jl,jk)=pqd(jl,jk)*pmfd(jl,jk) + zdmfdp=-pmfd(jl,jk)*zcond(jl) + pdmfdp(jl,jk-1)=zdmfdp + prfl(jl)=prfl(jl)+zdmfdp + +! compute organized entrainment for use at next level + zbuoyz=zbuo/ptenh(jl,jk) + zbuoyz=min(zbuoyz,0.0) + zdz=-(pgeo(jl,jk-1)-pgeo(jl,jk)) + zbuoy(jl)=zbuoy(jl)+zbuoyz*zdz + zoentr(jl)=g*zbuoyz*0.5/(1.+zbuoy(jl)) + pmfdde_rate(jl,jk) = -zdmfde(jl) + endif + enddo + + enddo + + return + end subroutine cuddrafn +!--------------------------------------------------------- +! level 3 souroutines +!-------------------------------------------------------- + subroutine cuflxn & + & ( klon, klev, ztmst & + & , pten, pqen, pqsen, ptenh, pqenh & + & , paph, pap, pgeoh, lndj, ldcum & + & , kcbot, kctop, kdtop, ktopm2 & + & , ktype, lddraf & + & , pmfu, pmfd, pmfus, pmfds & + & , pmfuq, pmfdq, pmful, plude & + & , pdmfup, pdmfdp, pdpmel, plglac & + & , prain, pmfdde_rate, pmflxr, pmflxs ) + +! m.tiedtke e.c.m.w.f. 7/86 modif. 12/89 + +! purpose +! ------- + +! this routine does the final calculation of convective +! fluxes in the cloud layer and in the subcloud layer + +! interface +! --------- +! this routine is called from *cumastr*. + + +! parameter description units +! --------- ----------- ----- +! input parameters (integer): + +! *klon* number of grid points per packet +! *klev* number of levels +! *kcbot* cloud base level +! *kctop* cloud top level +! *kdtop* top level of downdrafts + +! input parameters (logical): + +! *lndj* land sea mask (1 for land) +! *ldcum* flag: .true. for convective points + +! input parameters (real(kind=kind_phys)): + +! *ztmst* time step for the physics s +! *pten* provisional environment temperature (t+1) k +! *pqen* provisional environment spec. humidity (t+1) kg/kg +! *pqsen* environment spec. saturation humidity (t+1) kg/kg +! *ptenh* env. temperature (t+1) on half levels k +! *pqenh* env. spec. humidity (t+1) on half levels kg/kg +! *paph* provisional pressure on half levels pa +! *pap* provisional pressure on full levels pa +! *pgeoh* geopotential on half levels m2/s2 + +! updated parameters (integer): + +! *ktype* set to zero if ldcum=.false. + +! updated parameters (logical): + +! *lddraf* set to .false. if ldcum=.false. or kdtop= kdtop(jl) + if ( llddraf .and.jk.ge.kdtop(jl)) then + pmfds(jl,jk) = pmfds(jl,jk)-pmfd(jl,jk) * & + (cpd*ptenh(jl,jk)+pgeoh(jl,jk)) + pmfdq(jl,jk) = pmfdq(jl,jk)-pmfd(jl,jk)*pqenh(jl,jk) + else + pmfd(jl,jk) = 0. + pmfds(jl,jk) = 0. + pmfdq(jl,jk) = 0. + pdmfdp(jl,jk-1) = 0. + end if + if ( llddraf .and. pmfd(jl,jk) < 0. .and. & + abs(pmfd(jl,ikb)) < 1.e-20 ) then + idbas(jl) = jk + end if + else + pmfu(jl,jk)=0. + pmfd(jl,jk)=0. + pmfus(jl,jk)=0. + pmfds(jl,jk)=0. + pmfuq(jl,jk)=0. + pmfdq(jl,jk)=0. + pmful(jl,jk)=0. + plglac(jl,jk)=0. + pdmfup(jl,jk-1)=0. + pdmfdp(jl,jk-1)=0. + plude(jl,jk-1)=0. + endif + enddo + enddo + + do jl=1,klon + pmflxr(jl,klev+1) = 0. + pmflxs(jl,klev+1) = 0. + end do + do jl=1,klon + if(ldcum(jl)) then + ikb=kcbot(jl) + ik=ikb+1 + zzp=((paph(jl,klev+1)-paph(jl,ik))/ & + & (paph(jl,klev+1)-paph(jl,ikb))) + if(ktype(jl).eq.3) then + zzp=zzp**2 + endif + pmfu(jl,ik)=pmfu(jl,ikb)*zzp + pmfus(jl,ik)=(pmfus(jl,ikb)- & + & foelhm(ptenh(jl,ikb))*pmful(jl,ikb))*zzp + pmfuq(jl,ik)=(pmfuq(jl,ikb)+pmful(jl,ikb))*zzp + pmful(jl,ik)=0. + endif + enddo + + do jk=ktopm2,klev + do jl=1,klon + if(ldcum(jl).and.jk.gt.kcbot(jl)+1) then + ikb=kcbot(jl)+1 + zzp=((paph(jl,klev+1)-paph(jl,jk))/ & + & (paph(jl,klev+1)-paph(jl,ikb))) + if(ktype(jl).eq.3) then + zzp=zzp**2 + endif + pmfu(jl,jk)=pmfu(jl,ikb)*zzp + pmfus(jl,jk)=pmfus(jl,ikb)*zzp + pmfuq(jl,jk)=pmfuq(jl,ikb)*zzp + pmful(jl,jk)=0. + endif + ik = idbas(jl) + llddraf = lddraf(jl) .and. jk > ik .and. ik < klev + if ( llddraf .and. ik == kcbot(jl)+1 ) then + zzp = ((paph(jl,klev+1)-paph(jl,jk))/(paph(jl,klev+1)-paph(jl,ik))) + if ( ktype(jl) == 3 ) zzp = zzp*zzp + pmfd(jl,jk) = pmfd(jl,ik)*zzp + pmfds(jl,jk) = pmfds(jl,ik)*zzp + pmfdq(jl,jk) = pmfdq(jl,ik)*zzp + pmfdde_rate(jl,jk) = -(pmfd(jl,jk-1)-pmfd(jl,jk)) + else if ( llddraf .and. ik /= kcbot(jl)+1 .and. jk == ik+1 ) then + pmfdde_rate(jl,jk) = -(pmfd(jl,jk-1)-pmfd(jl,jk)) + end if + enddo + enddo +!* 2. calculate rain/snow fall rates +!* calculate melting of snow +!* calculate evaporation of precip +! ------------------------------- + + do jk=ktopm2,klev + do jl=1,klon + if(ldcum(jl) .and. jk >=kctop(jl)-1 ) then + prain(jl)=prain(jl)+pdmfup(jl,jk) + if(pmflxs(jl,jk).gt.0..and.pten(jl,jk).gt.tmelt) then + zcons1=zcons1a*(1.+0.5*(pten(jl,jk)-tmelt)) + zfac=zcons1*(paph(jl,jk+1)-paph(jl,jk)) + zsnmlt=min(pmflxs(jl,jk),zfac*(pten(jl,jk)-tmelt)) + pdpmel(jl,jk)=zsnmlt + pqsen(jl,jk)=foeewm(pten(jl,jk)-zsnmlt/zfac)/pap(jl,jk) + endif + zalfaw=foealfa(pten(jl,jk)) + ! + ! No liquid precipitation above melting level + ! + if ( pten(jl,jk) < tmelt .and. zalfaw > 0. ) then + plglac(jl,jk) = plglac(jl,jk)+zalfaw*(pdmfup(jl,jk)+pdmfdp(jl,jk)) + zalfaw = 0. + end if + pmflxr(jl,jk+1)=pmflxr(jl,jk)+zalfaw* & + & (pdmfup(jl,jk)+pdmfdp(jl,jk))+pdpmel(jl,jk) + pmflxs(jl,jk+1)=pmflxs(jl,jk)+(1.-zalfaw)* & + & (pdmfup(jl,jk)+pdmfdp(jl,jk))-pdpmel(jl,jk) + if(pmflxr(jl,jk+1)+pmflxs(jl,jk+1).lt.0.0) then + pdmfdp(jl,jk)=-(pmflxr(jl,jk)+pmflxs(jl,jk)+pdmfup(jl,jk)) + pmflxr(jl,jk+1)=0.0 + pmflxs(jl,jk+1)=0.0 + pdpmel(jl,jk) =0.0 + else if ( pmflxr(jl,jk+1) < 0. ) then + pmflxs(jl,jk+1) = pmflxs(jl,jk+1)+pmflxr(jl,jk+1) + pmflxr(jl,jk+1) = 0. + else if ( pmflxs(jl,jk+1) < 0. ) then + pmflxr(jl,jk+1) = pmflxr(jl,jk+1)+pmflxs(jl,jk+1) + pmflxs(jl,jk+1) = 0. + end if + endif + enddo + enddo + do jk=ktopm2,klev + do jl=1,klon + if(ldcum(jl).and.jk.ge.kcbot(jl)) then + zrfl=pmflxr(jl,jk)+pmflxs(jl,jk) + if(zrfl.gt.1.e-20) then + zdrfl1=zcpecons*max(0.,pqsen(jl,jk)-pqen(jl,jk))*zcucov* & + & (sqrt(paph(jl,jk)/paph(jl,klev+1))/5.09e-3* & + & zrfl/zcucov)**0.5777* & + & (paph(jl,jk+1)-paph(jl,jk)) + zrnew=zrfl-zdrfl1 + zrmin=zrfl-zcucov*max(0.,rhevap(jl)*pqsen(jl,jk) & + & -pqen(jl,jk)) *zcons2*(paph(jl,jk+1)-paph(jl,jk)) + zrnew=max(zrnew,zrmin) + zrfln=max(zrnew,0.) + zdrfl=min(0.,zrfln-zrfl) + zdenom=1./max(1.e-20,pmflxr(jl,jk)+pmflxs(jl,jk)) + zalfaw=foealfa(pten(jl,jk)) + if ( pten(jl,jk) < tmelt ) zalfaw = 0. + zpdr=zalfaw*pdmfdp(jl,jk) + zpds=(1.-zalfaw)*pdmfdp(jl,jk) + pmflxr(jl,jk+1)=pmflxr(jl,jk)+zpdr & + & +pdpmel(jl,jk)+zdrfl*pmflxr(jl,jk)*zdenom + pmflxs(jl,jk+1)=pmflxs(jl,jk)+zpds & + & -pdpmel(jl,jk)+zdrfl*pmflxs(jl,jk)*zdenom + pdmfup(jl,jk)=pdmfup(jl,jk)+zdrfl + if ( pmflxr(jl,jk+1)+pmflxs(jl,jk+1) < 0. ) then + pdmfup(jl,jk) = pdmfup(jl,jk)-(pmflxr(jl,jk+1)+pmflxs(jl,jk+1)) + pmflxr(jl,jk+1) = 0. + pmflxs(jl,jk+1) = 0. + pdpmel(jl,jk) = 0. + else if ( pmflxr(jl,jk+1) < 0. ) then + pmflxs(jl,jk+1) = pmflxs(jl,jk+1)+pmflxr(jl,jk+1) + pmflxr(jl,jk+1) = 0. + else if ( pmflxs(jl,jk+1) < 0. ) then + pmflxr(jl,jk+1) = pmflxr(jl,jk+1)+pmflxs(jl,jk+1) + pmflxs(jl,jk+1) = 0. + end if + else + pmflxr(jl,jk+1)=0.0 + pmflxs(jl,jk+1)=0.0 + pdmfdp(jl,jk)=0.0 + pdpmel(jl,jk)=0.0 + endif + endif + enddo + enddo + + return + end subroutine cuflxn +!--------------------------------------------------------- +! level 3 souroutines +!-------------------------------------------------------- + subroutine cudtdqn(klon,klev,ktopm2,kctop,kdtop,ldcum, & + lddraf,ztmst,paph,pgeoh,pgeo,pten,ptenh,pqen, & + pqenh,pqsen,plglac,plude,pmfu,pmfd,pmfus,pmfds, & + pmfuq,pmfdq,pmful,pdmfup,pdmfdp,pdpmel,ptent,ptenq,pcte) + implicit none + integer klon,klev,ktopm2 + integer kctop(klon), kdtop(klon) + logical ldcum(klon), lddraf(klon) + real(kind=kind_phys) ztmst + real(kind=kind_phys) paph(klon,klev+1), pgeoh(klon,klev+1) + real(kind=kind_phys) pgeo(klon,klev), pten(klon,klev), & + pqen(klon,klev), ptenh(klon,klev),& + pqenh(klon,klev), pqsen(klon,klev),& + plglac(klon,klev), plude(klon,klev) + real(kind=kind_phys) pmfu(klon,klev), pmfd(klon,klev),& + pmfus(klon,klev), pmfds(klon,klev),& + pmfuq(klon,klev), pmfdq(klon,klev),& + pmful(klon,klev), pdmfup(klon,klev),& + pdpmel(klon,klev), pdmfdp(klon,klev) + real(kind=kind_phys) ptent(klon,klev), ptenq(klon,klev) + real(kind=kind_phys) pcte(klon,klev) + +! local variables + integer jk , ik , jl + real(kind=kind_phys) zalv , zzp + real(kind=kind_phys) zdtdt(klon,klev) , zdqdt(klon,klev) , zdp(klon,klev) + !* 1.0 SETUP AND INITIALIZATIONS + ! ------------------------- + do jk = 1 , klev + do jl = 1, klon + if ( ldcum(jl) ) then + zdp(jl,jk) = g/(paph(jl,jk+1)-paph(jl,jk)) + end if + end do + end do + + !----------------------------------------------------------------------- + !* 2.0 COMPUTE TENDENCIES + ! ------------------ + do jk = ktopm2 , klev + if ( jk < klev ) then + do jl = 1,klon + if ( ldcum(jl) ) then + zalv = foelhm(pten(jl,jk)) + zdtdt(jl,jk) = zdp(jl,jk)*rcpd * & + (pmfus(jl,jk+1)-pmfus(jl,jk)+pmfds(jl,jk+1) - & + pmfds(jl,jk)+alf*plglac(jl,jk)-alf*pdpmel(jl,jk) - & + zalv*(pmful(jl,jk+1)-pmful(jl,jk)-plude(jl,jk)-pdmfup(jl,jk)-pdmfdp(jl,jk))) + zdqdt(jl,jk) = zdp(jl,jk)*(pmfuq(jl,jk+1) - & + pmfuq(jl,jk)+pmfdq(jl,jk+1)-pmfdq(jl,jk)+pmful(jl,jk+1) - & + pmful(jl,jk)-plude(jl,jk)-pdmfup(jl,jk)-pdmfdp(jl,jk)) + end if + end do + else + do jl = 1,klon + if ( ldcum(jl) ) then + zalv = foelhm(pten(jl,jk)) + zdtdt(jl,jk) = -zdp(jl,jk)*rcpd * & + (pmfus(jl,jk)+pmfds(jl,jk)+alf*pdpmel(jl,jk) - & + zalv*(pmful(jl,jk)+pdmfup(jl,jk)+pdmfdp(jl,jk)+plude(jl,jk))) + zdqdt(jl,jk) = -zdp(jl,jk)*(pmfuq(jl,jk) + plude(jl,jk) + & + pmfdq(jl,jk)+(pmful(jl,jk)+pdmfup(jl,jk)+pdmfdp(jl,jk))) + end if + end do + end if + end do + !--------------------------------------------------------------- + !* 3.0 UPDATE TENDENCIES + ! ----------------- + do jk = ktopm2 , klev + do jl = 1, klon + if ( ldcum(jl) ) then + ptent(jl,jk) = ptent(jl,jk) + zdtdt(jl,jk) + ptenq(jl,jk) = ptenq(jl,jk) + zdqdt(jl,jk) + pcte(jl,jk) = zdp(jl,jk)*plude(jl,jk) + end if + end do + end do + + return + end subroutine cudtdqn +!--------------------------------------------------------- +! level 3 souroutines +!-------------------------------------------------------- + subroutine cududvn(klon,klev,ktopm2,ktype,kcbot,kctop,ldcum, & + ztmst,paph,puen,pven,pmfu,pmfd,puu,pud,pvu,pvd,ptenu, & + ptenv) + implicit none + integer klon,klev,ktopm2 + integer ktype(klon), kcbot(klon), kctop(klon) + logical ldcum(klon) + real(kind=kind_phys) ztmst + real(kind=kind_phys) paph(klon,klev+1) + real(kind=kind_phys) puen(klon,klev), pven(klon,klev),& + pmfu(klon,klev), pmfd(klon,klev),& + puu(klon,klev), pud(klon,klev),& + pvu(klon,klev), pvd(klon,klev) + real(kind=kind_phys) ptenu(klon,klev), ptenv(klon,klev) + +!local variables + real(kind=kind_phys) zuen(klon,klev) , zven(klon,klev) , zmfuu(klon,klev), & + zmfdu(klon,klev), zmfuv(klon,klev), zmfdv(klon,klev) + + integer ik , ikb , jk , jl + real(kind=kind_phys) zzp, zdtdt + + real(kind=kind_phys) zdudt(klon,klev), zdvdt(klon,klev), zdp(klon,klev) +! + do jk = 1 , klev + do jl = 1, klon + if ( ldcum(jl) ) then + zuen(jl,jk) = puen(jl,jk) + zven(jl,jk) = pven(jl,jk) + zdp(jl,jk) = g/(paph(jl,jk+1)-paph(jl,jk)) + end if + end do + end do +!---------------------------------------------------------------------- +!* 1.0 CALCULATE FLUXES AND UPDATE U AND V TENDENCIES +! ---------------------------------------------- + do jk = ktopm2 , klev + ik = jk - 1 + do jl = 1,klon + if ( ldcum(jl) ) then + zmfuu(jl,jk) = pmfu(jl,jk)*(puu(jl,jk)-zuen(jl,ik)) + zmfuv(jl,jk) = pmfu(jl,jk)*(pvu(jl,jk)-zven(jl,ik)) + zmfdu(jl,jk) = pmfd(jl,jk)*(pud(jl,jk)-zuen(jl,ik)) + zmfdv(jl,jk) = pmfd(jl,jk)*(pvd(jl,jk)-zven(jl,ik)) + end if + end do + end do + ! linear fluxes below cloud + do jk = ktopm2 , klev + do jl = 1, klon + if ( ldcum(jl) .and. jk > kcbot(jl) ) then + ikb = kcbot(jl) + zzp = ((paph(jl,klev+1)-paph(jl,jk))/(paph(jl,klev+1)-paph(jl,ikb))) + if ( ktype(jl) == 3 ) zzp = zzp*zzp + zmfuu(jl,jk) = zmfuu(jl,ikb)*zzp + zmfuv(jl,jk) = zmfuv(jl,ikb)*zzp + zmfdu(jl,jk) = zmfdu(jl,ikb)*zzp + zmfdv(jl,jk) = zmfdv(jl,ikb)*zzp + end if + end do + end do +!---------------------------------------------------------------------- +!* 2.0 COMPUTE TENDENCIES +! ------------------ + do jk = ktopm2 , klev + if ( jk < klev ) then + ik = jk + 1 + do jl = 1,klon + if ( ldcum(jl) ) then + zdudt(jl,jk) = zdp(jl,jk) * & + (zmfuu(jl,ik)-zmfuu(jl,jk)+zmfdu(jl,ik)-zmfdu(jl,jk)) + zdvdt(jl,jk) = zdp(jl,jk) * & + (zmfuv(jl,ik)-zmfuv(jl,jk)+zmfdv(jl,ik)-zmfdv(jl,jk)) + end if + end do + else + do jl = 1,klon + if ( ldcum(jl) ) then + zdudt(jl,jk) = -zdp(jl,jk)*(zmfuu(jl,jk)+zmfdu(jl,jk)) + zdvdt(jl,jk) = -zdp(jl,jk)*(zmfuv(jl,jk)+zmfdv(jl,jk)) + end if + end do + end if + end do +!--------------------------------------------------------------------- +!* 3.0 UPDATE TENDENCIES +! ----------------- + do jk = ktopm2 , klev + do jl = 1, klon + if ( ldcum(jl) ) then + ptenu(jl,jk) = ptenu(jl,jk) + zdudt(jl,jk) + ptenv(jl,jk) = ptenv(jl,jk) + zdvdt(jl,jk) + end if + end do + end do +!---------------------------------------------------------------------- + return + end subroutine cududvn + +!--------------------------------------------------------- +! level 3 souroutines +!-------------------------------------------------------- + subroutine cuctracer(klon,klev,ktrac,kctop,kdtop, & + ldcum,lddraf,ztmst,paph,pmfu,pmfd, & + pudrate,pddrate,pcen,ptenc) + implicit none + integer klon,klev,ktrac + integer kctop(klon), kdtop(klon) + logical ldcum(klon), lddraf(klon) + real(kind=kind_phys) ztmst + real(kind=kind_phys) paph(klon,klev+1) + real(kind=kind_phys) pmfu(klon,klev) + real(kind=kind_phys) pmfd(klon,klev) + real(kind=kind_phys) pudrate(klon,klev) + real(kind=kind_phys) pddrate(klon,klev) + real(kind=kind_phys) pcen(klon,klev,ktrac) + real(kind=kind_phys) ptenc(klon,klev,ktrac) + !---------------------------------------------------------------------- + integer ik , jk , jl , jn + real(kind=kind_phys) zzp , zmfa , zerate , zposi + ! ALLOCATABLE ARAYS + real(kind=kind_phys) , dimension(:,:,:) , allocatable :: zcen , zcu , zcd , & + ztenc , zmfc + real(kind=kind_phys) , dimension(:,:) , allocatable :: zdp + logical , dimension(:,:) , allocatable :: llcumask , llcumbas + !---------------------------------------------------------------------- + allocate (zcen(klon,klev,ktrac)) ! Half-level environmental values + allocate (zcu(klon,klev,ktrac)) ! Updraft values + allocate (zcd(klon,klev,ktrac)) ! Downdraft values + allocate (ztenc(klon,klev,ktrac)) ! Tendency + allocate (zmfc(klon,klev,ktrac)) ! Fluxes + allocate (zdp(klon,klev)) ! Pressure difference + allocate (llcumask(klon,klev)) ! Mask for convection + ! Initialize Cumulus mask + some setups + do jk = 2, klev + do jl = 1, klon + llcumask(jl,jk) = .false. + if ( ldcum(jl) ) then + zdp(jl,jk) = g/(paph(jl,jk+1)-paph(jl,jk)) + if ( jk >= kctop(jl)-1 ) llcumask(jl,jk) = .true. + end if + end do + end do + !---------------------------------------------------------------------- + do jn = 1 , ktrac + !* 1.0 DEFINE TRACERS AT HALF LEVELS + ! ----------------------------- + do jk = 2 , klev + ik = jk - 1 + do jl = 1, klon + zcen(jl,jk,jn) = pcen(jl,jk,jn) + zcd(jl,jk,jn) = pcen(jl,ik,jn) + zcu(jl,jk,jn) = pcen(jl,ik,jn) + zmfc(jl,jk,jn) = 0. + ztenc(jl,jk,jn)= 0. + end do + end do + + do jl = 1, klon + zcu(jl,klev,jn) = pcen(jl,klev,jn) + end do + !* 2.0 COMPUTE UPDRAFT VALUES + ! ---------------------- + do jk = klev - 1 , 3 , -1 + ik = jk + 1 + do jl = 1, klon + if ( llcumask(jl,jk) ) then + zerate = pmfu(jl,jk) - pmfu(jl,ik) + pudrate(jl,jk) + zmfa = 1./max(cmfcmin,pmfu(jl,jk)) + if ( jk >= kctop(jl) ) then + zcu(jl,jk,jn) = (pmfu(jl,ik)*zcu(jl,ik,jn) + & + zerate*pcen(jl,jk,jn)-pudrate(jl,jk)*zcu(jl,ik,jn))*zmfa + end if + end if + end do + end do + !* 3.0 COMPUTE DOWNDRAFT VALUES + ! ------------------------ + do jk = 3 , klev + ik = jk - 1 + do jl = 1, klon + if ( lddraf(jl) .and. jk == kdtop(jl) ) then + ! Nota: in order to avoid final negative Tracer values at LFS + ! the allowed value of ZCD depends on the jump in mass flux + ! at the LFS + zcd(jl,jk,jn) = 0.1*zcu(jl,jk,jn) + 0.9*pcen(jl,ik,jn) + else if ( lddraf(jl).and.jk>kdtop(jl) ) then + zerate = -pmfd(jl,jk) + pmfd(jl,ik) + pddrate(jl,jk) + zmfa = 1./min(-cmfcmin,pmfd(jl,jk)) + zcd(jl,jk,jn) = (pmfd(jl,ik)*zcd(jl,ik,jn) - & + zerate*pcen(jl,ik,jn)+pddrate(jl,jk)*zcd(jl,ik,jn))*zmfa + end if + end do + end do + ! In order to avoid negative Tracer at KLEV adjust ZCD + jk = klev + ik = jk - 1 + do jl = 1, klon + if ( lddraf(jl) ) then + zposi = -zdp(jl,jk) *(pmfu(jl,jk)*zcu(jl,jk,jn) + & + pmfd(jl,jk)*zcd(jl,jk,jn)-(pmfu(jl,jk)+pmfd(jl,jk))*pcen(jl,ik,jn)) + if ( pcen(jl,jk,jn)+zposi*ztmst < 0. ) then + zmfa = 1./min(-cmfcmin,pmfd(jl,jk)) + zcd(jl,jk,jn) = ((pmfu(jl,jk)+pmfd(jl,jk))*pcen(jl,ik,jn) - & + pmfu(jl,jk)*zcu(jl,jk,jn)+pcen(jl,jk,jn) / & + (ztmst*zdp(jl,jk)))*zmfa + end if + end if + end do + end do + !---------------------------------------------------------------------- + do jn = 1 , ktrac + !* 4.0 COMPUTE FLUXES + ! -------------- + do jk = 2 , klev + ik = jk - 1 + do jl = 1, klon + if ( llcumask(jl,jk) ) then + zmfa = pmfu(jl,jk) + pmfd(jl,jk) + zmfc(jl,jk,jn) = pmfu(jl,jk)*zcu(jl,jk,jn) + & + pmfd(jl,jk)*zcd(jl,jk,jn) - zmfa*zcen(jl,ik,jn) + end if + end do + end do + !* 5.0 COMPUTE TENDENCIES = RHS + ! ------------------------ + do jk = 2 , klev - 1 + ik = jk + 1 + do jl = 1, klon + if ( llcumask(jl,jk) ) then + ztenc(jl,jk,jn) = zdp(jl,jk)*(zmfc(jl,ik,jn)-zmfc(jl,jk,jn)) + end if + end do + end do + jk = klev + do jl = 1, klon + if ( ldcum(jl) ) ztenc(jl,jk,jn) = -zdp(jl,jk)*zmfc(jl,jk,jn) + end do + end do + !* 6.0 UPDATE TENDENCIES + ! ----------------- + do jn = 1, ktrac + do jk = 2, klev + do jl = 1, klon + if ( llcumask(jl,jk) ) then + ptenc(jl,jk,jn) = ptenc(jl,jk,jn)+ztenc(jl,jk,jn) + end if + end do + end do + end do + !--------------------------------------------------------------------------- + deallocate (llcumask) + deallocate (zdp) + deallocate (zmfc) + deallocate (ztenc) + deallocate (zcd) + deallocate (zcu) + deallocate (zcen) + end subroutine cuctracer + +!--------------------------------------------------------- +! level 4 souroutines +!-------------------------------------------------------- + subroutine cuadjtqn & + & (klon, klev, kk, psp, pt, pq, ldflag, kcall) +! m.tiedtke e.c.m.w.f. 12/89 +! purpose. +! -------- +! to produce t,q and l values for cloud ascent + +! interface +! --------- +! this routine is called from subroutines: +! *cond* (t and q at condensation level) +! *cubase* (t and q at condensation level) +! *cuasc* (t and q at cloud levels) +! *cuini* (environmental t and qs values at half levels) +! input are unadjusted t and q values, +! it returns adjusted values of t and q + +! parameter description units +! --------- ----------- ----- +! input parameters (integer): + +! *klon* number of grid points per packet +! *klev* number of levels +! *kk* level +! *kcall* defines calculation as +! kcall=0 env. t and qs in*cuini* +! kcall=1 condensation in updrafts (e.g. cubase, cuasc) +! kcall=2 evaporation in downdrafts (e.g. cudlfs,cuddraf) +! input parameters (real(kind=kind_phys)): + +! *psp* pressure pa + +! updated parameters (real(kind=kind_phys)): + +! *pt* temperature k +! *pq* specific humidity kg/kg +! externals +! --------- +! for condensation calculations. +! the tables are initialised in *suphec*. + +!---------------------------------------------------------------------- + + implicit none + + integer klev,klon + real(kind=kind_phys) pt(klon,klev), pq(klon,klev), & + & psp(klon) + logical ldflag(klon) +! local variables + integer jl,jk + integer isum,kcall,kk + real(kind=kind_phys) zqmax,zqsat,zcor,zqp,zcond,zcond1,zl,zi,zf +!---------------------------------------------------------------------- +! 1. define constants +! ---------------- + zqmax=0.5 + +! 2. calculate condensation and adjust t and q accordingly +! ----------------------------------------------------- + + if ( kcall == 1 ) then + do jl = 1,klon + if ( ldflag(jl) ) then + zqp = 1./psp(jl) + zl = 1./(pt(jl,kk)-c4les) + zi = 1./(pt(jl,kk)-c4ies) + zqsat = c2es*(foealfa(pt(jl,kk))*exp(c3les*(pt(jl,kk)-tmelt)*zl) + & + (1.-foealfa(pt(jl,kk)))*exp(c3ies*(pt(jl,kk)-tmelt)*zi)) + zqsat = zqsat*zqp + zqsat = min(0.5,zqsat) + zcor = 1. - vtmpc1*zqsat + zf = foealfa(pt(jl,kk))*r5alvcp*zl**2 + & + (1.-foealfa(pt(jl,kk)))*r5alscp*zi**2 + zcond = (pq(jl,kk)*zcor**2-zqsat*zcor)/(zcor**2+zqsat*zf) + if ( zcond > 0. ) then + pt(jl,kk) = pt(jl,kk) + foeldcpm(pt(jl,kk))*zcond + pq(jl,kk) = pq(jl,kk) - zcond + zl = 1./(pt(jl,kk)-c4les) + zi = 1./(pt(jl,kk)-c4ies) + zqsat = c2es*(foealfa(pt(jl,kk)) * & + exp(c3les*(pt(jl,kk)-tmelt)*zl)+(1.-foealfa(pt(jl,kk))) * & + exp(c3ies*(pt(jl,kk)-tmelt)*zi)) + zqsat = zqsat*zqp + zqsat = min(0.5,zqsat) + zcor = 1. - vtmpc1*zqsat + zf = foealfa(pt(jl,kk))*r5alvcp*zl**2 + & + (1.-foealfa(pt(jl,kk)))*r5alscp*zi**2 + zcond1 = (pq(jl,kk)*zcor**2-zqsat*zcor)/(zcor**2+zqsat*zf) + if ( abs(zcond) < 1.e-20 ) zcond1 = 0. + pt(jl,kk) = pt(jl,kk) + foeldcpm(pt(jl,kk))*zcond1 + pq(jl,kk) = pq(jl,kk) - zcond1 + end if + end if + end do + elseif ( kcall == 2 ) then + do jl = 1,klon + if ( ldflag(jl) ) then + zqp = 1./psp(jl) + zqsat = foeewm(pt(jl,kk))*zqp + zqsat = min(0.5,zqsat) + zcor = 1./(1.-vtmpc1*zqsat) + zqsat = zqsat*zcor + zcond = (pq(jl,kk)-zqsat)/(1.+zqsat*zcor*foedem(pt(jl,kk))) + zcond = min(zcond,0.) + pt(jl,kk) = pt(jl,kk) + foeldcpm(pt(jl,kk))*zcond + pq(jl,kk) = pq(jl,kk) - zcond + zqsat = foeewm(pt(jl,kk))*zqp + zqsat = min(0.5,zqsat) + zcor = 1./(1.-vtmpc1*zqsat) + zqsat = zqsat*zcor + zcond1 = (pq(jl,kk)-zqsat)/(1.+zqsat*zcor*foedem(pt(jl,kk))) + if ( abs(zcond) < 1.e-20 ) zcond1 = min(zcond1,0.) + pt(jl,kk) = pt(jl,kk) + foeldcpm(pt(jl,kk))*zcond1 + pq(jl,kk) = pq(jl,kk) - zcond1 + end if + end do + else if ( kcall == 0 ) then + do jl = 1,klon + zqp = 1./psp(jl) + zqsat = foeewm(pt(jl,kk))*zqp + zqsat = min(0.5,zqsat) + zcor = 1./(1.-vtmpc1*zqsat) + zqsat = zqsat*zcor + zcond1 = (pq(jl,kk)-zqsat)/(1.+zqsat*zcor*foedem(pt(jl,kk))) + pt(jl,kk) = pt(jl,kk) + foeldcpm(pt(jl,kk))*zcond1 + pq(jl,kk) = pq(jl,kk) - zcond1 + zqsat = foeewm(pt(jl,kk))*zqp + zqsat = min(0.5,zqsat) + zcor = 1./(1.-vtmpc1*zqsat) + zqsat = zqsat*zcor + zcond1 = (pq(jl,kk)-zqsat)/(1.+zqsat*zcor*foedem(pt(jl,kk))) + pt(jl,kk) = pt(jl,kk) + foeldcpm(pt(jl,kk))*zcond1 + pq(jl,kk) = pq(jl,kk) - zcond1 + end do + end if + + return + end subroutine cuadjtqn +!--------------------------------------------------------- +! level 4 souroutines +!-------------------------------------------------------- + subroutine cubasmcn & + & (klon, klev, klevm1, kk, pten,& + & pqen, pqsen, puen, pven, pverv,& + & pgeo, pgeoh, ldcum, ktype, klab, plrain,& + & pmfu, pmfub, kcbot, ptu,& + & pqu, plu, puu, pvu, pmfus,& + & pmfuq, pmful, pdmfup) + implicit none +! m.tiedtke e.c.m.w.f. 12/89 +! c.zhang iprc 05/2012 +!***purpose. +! -------- +! this routine calculates cloud base values +! for midlevel convection +!***interface +! --------- +! this routine is called from *cuasc*. +! input are environmental values t,q etc +! it returns cloudbase values for midlevel convection +!***method. +! ------- +! s. tiedtke (1989) +!***externals +! --------- +! none +! ---------------------------------------------------------------- + real(kind=kind_phys) pten(klon,klev), pqen(klon,klev),& + & puen(klon,klev), pven(klon,klev),& + & pqsen(klon,klev), pverv(klon,klev),& + & pgeo(klon,klev), pgeoh(klon,klev+1) + real(kind=kind_phys) ptu(klon,klev), pqu(klon,klev),& + & puu(klon,klev), pvu(klon,klev),& + & plu(klon,klev), pmfu(klon,klev),& + & pmfub(klon), & + & pmfus(klon,klev), pmfuq(klon,klev),& + & pmful(klon,klev), pdmfup(klon,klev),& + & plrain(klon,klev) + integer ktype(klon), kcbot(klon),& + & klab(klon,klev) + logical ldcum(klon) +! local variabels + integer jl,kk,klev,klon,klevp1,klevm1 + real(kind=kind_phys) zzzmb +!-------------------------------------------------------- +!* 1. calculate entrainment and detrainment rates +! ------------------------------------------------------- + do jl=1,klon + if(.not.ldcum(jl) .and. klab(jl,kk+1).eq.0) then + if(lmfmid .and. pqen(jl,kk) .gt. 0.80*pqsen(jl,kk).and. & + pgeo(jl,kk)*zrg .gt. 5.0e2 .and. & + & pgeo(jl,kk)*zrg .lt. 1.0e4 ) then + ptu(jl,kk+1)=(cpd*pten(jl,kk)+pgeo(jl,kk)-pgeoh(jl,kk+1))& + & *rcpd + pqu(jl,kk+1)=pqen(jl,kk) + plu(jl,kk+1)=0. + zzzmb=max(cmfcmin,-pverv(jl,kk)*zrg) + zzzmb=min(zzzmb,cmfcmax) + pmfub(jl)=zzzmb + pmfu(jl,kk+1)=pmfub(jl) + pmfus(jl,kk+1)=pmfub(jl)*(cpd*ptu(jl,kk+1)+pgeoh(jl,kk+1)) + pmfuq(jl,kk+1)=pmfub(jl)*pqu(jl,kk+1) + pmful(jl,kk+1)=0. + pdmfup(jl,kk+1)=0. + kcbot(jl)=kk + klab(jl,kk+1)=1 + plrain(jl,kk+1)=0.0 + ktype(jl)=3 + end if + end if + end do + return + end subroutine cubasmcn +! +!--------------------------------------------------------- +! level 4 souroutines +!--------------------------------------------------------- + subroutine cuentrn(klon,klev,kk,kcbot,ldcum,ldwork, & + pgeoh,pmfu,pdmfen,pdmfde) + implicit none + integer klon,klev,kk + integer kcbot(klon) + logical ldcum(klon) + logical ldwork + real(kind=kind_phys) pgeoh(klon,klev+1) + real(kind=kind_phys) pmfu(klon,klev) + real(kind=kind_phys) pdmfen(klon) + real(kind=kind_phys) pdmfde(klon) + logical llo1 + integer jl + real(kind=kind_phys) zdz , zmf + real(kind=kind_phys) zentr(klon) + ! + !* 1. CALCULATE ENTRAINMENT AND DETRAINMENT RATES + ! ------------------------------------------- + if ( ldwork ) then + do jl = 1,klon + pdmfen(jl) = 0. + pdmfde(jl) = 0. + zentr(jl) = 0. + end do + ! + !* 1.1 SPECIFY ENTRAINMENT RATES + ! ------------------------- + do jl = 1, klon + if ( ldcum(jl) ) then + zdz = (pgeoh(jl,kk)-pgeoh(jl,kk+1))*zrg + zmf = pmfu(jl,kk+1)*zdz + llo1 = kk < kcbot(jl) + if ( llo1 ) then + pdmfen(jl) = zentr(jl)*zmf + pdmfde(jl) = 0.75e-4*zmf + end if + end if + end do + end if + end subroutine cuentrn +! +!-------------------------------------------------------- +! external functions +!------------------------------------------------------ + real(kind=kind_phys) function foealfa(tt) +! foealfa is calculated to distinguish the three cases: +! +! foealfa=1 water phase +! foealfa=0 ice phase +! 0 < foealfa < 1 mixed phase +! +! input : tt = temperature +! + implicit none + real(kind=kind_phys) tt + foealfa = min(1.,((max(rtice,min(rtwat,tt))-rtice) & + & /(rtwat-rtice))**2) + + return + end function foealfa + + real(kind=kind_phys) function foelhm(tt) + implicit none + real(kind=kind_phys) tt + foelhm = foealfa(tt)*alv + (1.-foealfa(tt))*als + return + end function foelhm + + real(kind=kind_phys) function foeewm(tt) + implicit none + real(kind=kind_phys) tt + foeewm = c2es * & + & (foealfa(tt)*exp(c3les*(tt-tmelt)/(tt-c4les))+ & + & (1.-foealfa(tt))*exp(c3ies*(tt-tmelt)/(tt-c4ies))) + return + end function foeewm + + real(kind=kind_phys) function foedem(tt) + implicit none + real(kind=kind_phys) tt + foedem = foealfa(tt)*r5alvcp*(1./(tt-c4les)**2)+ & + & (1.-foealfa(tt))*r5alscp*(1./(tt-c4ies)**2) + return + end function foedem + + real(kind=kind_phys) function foeldcpm(tt) + implicit none + real(kind=kind_phys) tt + foeldcpm = foealfa(tt)*ralvdcp+ & + & (1.-foealfa(tt))*ralsdcp + return + end function foeldcpm + + real(kind=kind_phys) function foeldcp(tt) + implicit none + real(kind=kind_phys) tt + foeldcp = foedelta(tt)*ralvdcp + (1.-foedelta(tt))*ralsdcp + end function foeldcp + + real(kind=kind_phys) function foedelta(tt) + implicit none + real(kind=kind_phys) tt + foedelta = max(0.,sign(1.,tt-tmelt)) + end function foedelta + +end module cu_ntiedtke + diff --git a/physics/cu_ntiedtke_post.F90 b/physics/cu_ntiedtke_post.F90 new file mode 100644 index 000000000..fdc0b8b0f --- /dev/null +++ b/physics/cu_ntiedtke_post.F90 @@ -0,0 +1,53 @@ +!> \file cu_ntiedtke_post.F90 +!! Contains code related to New Tiedtke convective scheme + +module cu_ntiedtke_post + + implicit none + + private + + public :: cu_ntiedtke_post_init, cu_ntiedtke_post_run, cu_ntiedtke_post_finalize + + contains + + subroutine cu_ntiedtke_post_init () + end subroutine cu_ntiedtke_post_init + + subroutine cu_ntiedtke_post_finalize() + end subroutine cu_ntiedtke_post_finalize + +!> \section arg_table_cu_ntiedtke_post_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|--------------------------------------------------|---------|------|-----------|-----------|--------|----------| +!! | t | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | in | F | +!! | q | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | +!! | prevst | temperature_from_previous_timestep | temperature from previous time step | K | 2 | real | kind_phys | out | F | +!! | prevsq | moisture_from_previous_timestep | moisture from previous time step | kg kg-1 | 2 | real | kind_phys | out | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine cu_ntiedtke_post_run (t, q, prevst, prevsq, errmsg, errflg) + + use machine, only: kind_phys + + implicit none + + ! Interface variables + real(kind_phys), intent(in) :: t(:,:) + real(kind_phys), intent(in) :: q(:,:) + real(kind_phys), intent(out) :: prevst(:,:) + real(kind_phys), intent(out) :: prevsq(:,:) + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + prevst(:,:) = t(:,:) + prevsq(:,:) = q(:,:) + + end subroutine cu_ntiedtke_post_run + +end module cu_ntiedtke_post diff --git a/physics/cu_ntiedtke_pre.F90 b/physics/cu_ntiedtke_pre.F90 new file mode 100644 index 000000000..725b4a351 --- /dev/null +++ b/physics/cu_ntiedtke_pre.F90 @@ -0,0 +1,84 @@ +!> \file cu_ntiedtke_pre.F90 +!! Contains code related to New Tiedtke convective scheme + +module cu_ntiedtke_pre + + implicit none + + private + + public :: cu_ntiedtke_pre_init, cu_ntiedtke_pre_run, cu_ntiedtke_pre_finalize + + contains + + subroutine cu_ntiedtke_pre_init () + end subroutine cu_ntiedtke_pre_init + + subroutine cu_ntiedtke_pre_finalize() + end subroutine cu_ntiedtke_pre_finalize + +!> \section arg_table_cu_ntiedtke_pre_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|--------------------------------------------------------|--------------------------------------------------|---------------|------|-----------|-----------|--------|----------| +!! | flag_init | flag_for_first_time_step | flag signaling first time step for time integration loop | flag | 0 | logical | | in | F | +!! | flag_restart | flag_for_restart | flag for restart (warmstart) or coldstart | flag | 0 | logical | | in | F | +!! | kdt | index_of_time_step | current forecast iteration | index | 0 | integer | | in | F | +!! | fhour | forecast_time | curent forecast time | h | 0 | real | kind_phys | in | F | +!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | +!! | t | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | in | F | +!! | q | water_vapor_specific_humidity | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | in | F | +!! | prevst | temperature_from_previous_timestep | temperature from previous time step | K | 2 | real | kind_phys | in | F | +!! | prevsq | moisture_from_previous_timestep | moisture from previous time step | kg kg-1 | 2 | real | kind_phys | in | F | +!! | forcet | temperature_tendency_due_to_dynamics | temperature tendency due to dynamics only | K s-1 | 2 | real | kind_phys | out | F | +!! | forceq | moisture_tendency_due_to_dynamics | moisture tendency due to dynamics only | kg kg-1 s-1 | 2 | real | kind_phys | out | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine cu_ntiedtke_pre_run (flag_init, flag_restart, kdt, fhour, dtp, t, q, prevst, prevsq, & + forcet, forceq, errmsg, errflg) + + use machine, only: kind_phys + + implicit none + + logical, intent(in) :: flag_init + logical, intent(in) :: flag_restart + integer, intent(in) :: kdt + real(kind_phys), intent(in) :: fhour + real(kind_phys), intent(in) :: dtp + real(kind_phys), intent(in) :: t(:,:) + real(kind_phys), intent(in) :: q(:,:) + real(kind_phys), intent(in) :: prevst(:,:) + real(kind_phys), intent(in) :: prevsq(:,:) + real(kind_phys), intent(out) :: forcet(:,:) + real(kind_phys), intent(out) :: forceq(:,:) + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! local variables + real(kind=kind_phys) :: dtdyn + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! For restart runs, can assume that prevst and prevsq + ! are read from the restart files beforehand, same + ! for conv_act. + if(flag_init .and. .not.flag_restart) then + forcet(:,:)=0.0 + forceq(:,:)=0.0 + else + dtdyn=3600.0*(fhour)/kdt + if(dtp > dtdyn) then + forcet(:,:)=(t(:,:) - prevst(:,:))/dtp + forceq(:,:)=(q(:,:) - prevsq(:,:))/dtp + else + forcet(:,:)=(t(:,:) - prevst(:,:))/dtdyn + forceq(:,:)=(q(:,:) - prevsq(:,:))/dtdyn + endif + endif + + end subroutine cu_ntiedtke_pre_run + +end module cu_ntiedtke_pre diff --git a/physics/gcm_shoc.F90 b/physics/gcm_shoc.F90 new file mode 100644 index 000000000..f2c9b7a7b --- /dev/null +++ b/physics/gcm_shoc.F90 @@ -0,0 +1,2040 @@ +!> \file gcm_shoc.F90 +!! Contains the Simplified Higher-Order Closure (SHOC) scheme. + +!> This module contains the CCPP-compliant SHOC scheme. +module shoc + use machine, only: kind_phys + + implicit none + + private + + public shoc_run, shoc_init, shoc_finalize + +contains + +subroutine shoc_init () +end subroutine shoc_init + +subroutine shoc_finalize () +end subroutine shoc_finalize + +#if 0 +!> \section arg_table_shoc_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------------------|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|---------------|------|------------|-----------|--------|----------| +!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | +!! | nx | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | nzm | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | +!! | do_shoc | flag_for_shoc | flag for SHOC | flag | 0 | logical | | in | F | +!! | shocaftcnv | flag_for_shoc_after_convection | flag to execute SHOC after convection | flag | 0 | logical | | in | F | +!! | mg3_as_mg2 | flag_mg3_as_mg2 | flag for controlling prep for Morrison-Gettelman microphysics | flag | 0 | logical | | in | F | +!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_zhao_carr | flag_for_zhao_carr_microphysics_scheme | choice of Zhao-Carr microphysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_zhao_carr_pdf | flag_for_zhao_carr_pdf_microphysics_scheme | choice of Zhao-Carr microphysics scheme with PDF clouds | flag | 0 | integer | | in | F | +!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman rmicrophysics scheme | flag | 0 | integer | | in | F | +!! | fprcp | number_of_frozen_precipitation_species | number of frozen precipitation species | count | 0 | integer | | in | F | +!! | tcr | cloud_phase_transition_threshold_temperature | threshold temperature below which cloud starts to freeze | K | 0 | real | kind_phys | in | F | +!! | tcrf | cloud_phase_transition_denominator | denominator in cloud phase transition = 1/(tcr-tf) | K-1 | 0 | real | kind_phys | in | F | +!! | con_cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | +!! | con_hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | +!! | con_hfus | latent_heat_of_fusion_of_water_at_0C | latent heat of fusion | J kg-1 | 0 | real | kind_phys | in | F | +!! | con_rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | con_rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | con_pi | pi | ratio of a circle's circumference to its diameter | radians | 0 | real | kind_phys | in | F | +!! | con_fvirt | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | +!! | gq0_cloud_ice | ice_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of ice water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | +!! | gq0_rain | rain_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of rain water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | +!! | gq0_snow | snow_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of snow water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | +!! | gq0_graupel | graupel_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of graupel updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | +!! | dtp | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | +!! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | +!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | +!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | +!! | u | x_wind_updated_by_physics | zonal wind updated by physics | m s-1 | 2 | real | kind_phys | in | F | +!! | v | y_wind_updated_by_physics | meridional wind updated by physics | m s-1 | 2 | real | kind_phys | in | F | +!! | omega | omega | layer mean vertical velocity | Pa s-1 | 2 | real | kind_phys | in | F | +!! | rhc | critical_relative_humidity | critical relative humidity | frac | 2 | real | kind_phys | in | F | +!! | supice | ice_supersaturation_threshold | ice supersaturation parameter for PDF clouds | none | 0 | real | kind_phys | in | F | +!! | pcrit | shoc_tke_dissipatation_pressure_threshold | pressure below which extra TKE diss. is applied in SHOC | Pa | 0 | real | kind_phys | in | F | +!! | cefac | shoc_tke_dissipation_tunable_parameter | mult. tuning parameter for TKE diss. in SHOC | none | 0 | real | kind_phys | in | F | +!! | cesfac | shoc_tke_dissipation_tunable_parameter_near_surface | mult. tuning parameter for TKE diss. at surface in SHOC | none | 0 | real | kind_phys | in | F | +!! | tkef1 | shoc_implicit_TKE_integration_uncentering_term | uncentering term for TKE integration in SHOC | none | 0 | real | kind_phys | in | F | +!! | dis_opt | shoc_flag_for_optional_surface_TKE_dissipation | flag for alt. TKE diss. near surface in SHOC (>0 = ON) | none | 0 | real | kind_phys | in | F | +!! | hflx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | +!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | prnum | prandtl_number | turbulent Prandtl number | none | 2 | real | kind_phys | in | F | +!! | skip_macro | flag_skip_macro | flag to skip cloud macrophysics in Morrison scheme | flag | 0 | logical | | inout | F | +!! | clw_ice | ice_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | clw_liquid | cloud_condensed_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | gq0_cloud_liquid | cloud_condensed_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of cloud condensed water updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | ncpl | cloud_droplet_number_concentration_updated_by_physics | number concentration of cloud droplets updated by physics | kg-1 | 2 | real | kind_phys | inout | F | +!! | ncpi | ice_number_concentration_updated_by_physics | number concentration of ice updated by physics | kg-1 | 2 | real | kind_phys | inout | F | +!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | inout | F | +!! | gq0_water_vapor | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | cld_sgs | subgrid_scale_cloud_fraction_from_shoc | subgrid-scale cloud fraction from the SHOC scheme | frac | 2 | real | kind_phys | inout | F | +!! | tke | turbulent_kinetic_energy_convective_transport_tracer | turbulent kinetic energy in the convectively transported tracer array | m2 s-2 | 2 | real | kind_phys | inout | F | +!! | tkh | atmosphere_heat_diffusivity_from_shoc | diffusivity for heat from the SHOC scheme | m2 s-1 | 2 | real | kind_phys | inout | F | +!! | wthv_sec | kinematic_buoyancy_flux_from_shoc | upward kinematic buoyancy flux from the SHOC scheme | K m s-1 | 2 | real | kind_phys | inout | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +#endif +subroutine shoc_run (ix, nx, nzm, do_shoc, shocaftcnv, mg3_as_mg2, imp_physics, imp_physics_gfdl, imp_physics_zhao_carr, & + imp_physics_zhao_carr_pdf, imp_physics_mg, fprcp, tcr, tcrf, con_cp, con_g, con_hvap, con_hfus, con_rv, con_rd, con_pi, & + con_fvirt, gq0_cloud_ice, gq0_rain, gq0_snow, gq0_graupel, dtp, me, prsl, phii, phil, u, v, omega, rhc, supice, pcrit, & + cefac, cesfac, tkef1, dis_opt, hflx, evap, prnum, & + skip_macro, clw_ice, clw_liquid, gq0_cloud_liquid, ncpl, ncpi, gt0, gq0_water_vapor, cld_sgs, tke, tkh, wthv_sec, & + errmsg, errflg) + + implicit none + + integer, intent(in) :: ix, nx, nzm, imp_physics, imp_physics_gfdl, imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, & + imp_physics_mg, fprcp, me + logical, intent(in) :: do_shoc, shocaftcnv, mg3_as_mg2 + real(kind=kind_phys), intent(in) :: tcr, tcrf, con_cp, con_g, con_hvap, con_hfus, con_rv, con_rd, con_pi, con_fvirt, & + dtp, supice, pcrit, cefac, cesfac, tkef1, dis_opt + ! + real(kind=kind_phys), intent(in), dimension(nx) :: hflx, evap + real(kind=kind_phys), intent(in), dimension(nx,nzm) :: gq0_cloud_ice, gq0_rain, gq0_snow, gq0_graupel, prsl, phil, & + u, v, omega, rhc, prnum + real(kind=kind_phys), intent(in), dimension(nx,nzm+1) :: phii + ! + logical, intent(inout) :: skip_macro + real(kind=kind_phys), intent(inout), dimension(nx,nzm) :: clw_ice, clw_liquid, gq0_cloud_liquid, ncpl, ncpi, gt0, & + gq0_water_vapor, cld_sgs, tke, tkh, wthv_sec + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + real(kind=kind_phys), parameter :: epsq = 1.e-20 + + integer :: i, k + + real(kind=kind_phys) :: tem + real(kind=kind_phys), dimension(nx,nzm) :: qsnw ! qsnw can be local to this routine + real(kind=kind_phys), dimension(nx,nzm) :: qgl ! qgl can be local to this routine + +! Initialize CCPP error handling variables + + errmsg = '' + errflg = 0 + + if (shocaftcnv) then + if (imp_physics == imp_physics_mg) then + skip_macro = do_shoc + if (abs(fprcp) == 1 .or. mg3_as_mg2) then + do k=1,nzm + do i=1,nx + !GF - gq0(ntrw) is passed in directly, no need to copy + !qrn(i,k) = gq0_rain(i,k) + qsnw(i,k) = gq0_snow(i,k) + qgl(i,k) = 0.0 + enddo + enddo + elseif (fprcp > 1) then + do k=1,nzm + do i=1,nx + !qrn(i,k) = gq0_rain(i,k) + qsnw(i,k) = gq0_snow(i,k) + gq0_graupel(i,k) + qgl(i,k) = 0.0 + enddo + enddo + endif + endif + else + if (imp_physics == imp_physics_mg) then + skip_macro = do_shoc + do k=1,nzm + do i=1,nx + ! DH* THESE ARE NOT IN THE ORIGINAL CODE (AND THEY WERE NEVER) ::: clw_ice(i,k) = gq0_cloud_ice(i,k) ! ice + ! DH* THESE ARE NOT IN THE ORIGINAL CODE (AND THEY WERE NEVER) ::: clw_liquid(i,k) = gq0_cloud_liquid(i,k) ! water + !GF - since gq0(ntlnc/ntinc) are passed in directly, no need to copy + !ncpl(i,k) = Stateout%gq0(i,k,ntlnc) + !ncpi(i,k) = Stateout%gq0(i,k,ntinc) + enddo + enddo + if (abs(fprcp) == 1 .or. mg3_as_mg2) then + do k=1,nzm + do i=1,nx + !GF - gq0(ntrw) is passed in directly, no need to copy + !qrn(i,k) = gq0_rain(i,k) + qsnw(i,k) = gq0_snow(i,k) + qgl(i,k) = 0.0 + enddo + enddo + elseif (fprcp > 1) then + do k=1,nzm + do i=1,nx + !qrn(i,k) = gq0_rain(i,k) + qsnw(i,k) = gq0_snow(i,k) + gq0_graupel(i,k) + qgl(i,k) = 0.0 + clw_ice(i,k) = clw_ice(i,k) + gq0_graupel(i,k) + enddo + enddo + endif + elseif (imp_physics == imp_physics_gfdl) then ! GFDL MP - needs modify for condensation + do k=1,nzm + do i=1,nx + clw_ice(i,k) = gq0_cloud_ice(i,k) ! ice + clw_liquid(i,k) = gq0_cloud_liquid(i,k) ! water + !qrn(i,k) = gq0_rain(i,k) + qsnw(i,k) = gq0_snow(i,k) + qgl(i,k) = 0.0 + enddo + enddo + elseif (imp_physics == imp_physics_zhao_carr .or. imp_physics == imp_physics_zhao_carr_pdf) then + do k=1,nzm + do i=1,nx + if (abs(gq0_cloud_liquid(i,k)) < epsq) then + gq0_cloud_liquid(i,k) = 0.0 + endif + tem = gq0_cloud_liquid(i,k) * max(0.0, MIN(1.0, (tcr-gt0(i,k))*tcrf)) + clw_ice(i,k) = tem ! ice + clw_liquid(i,k) = gq0_cloud_liquid(i,k) - tem ! water + qsnw(i,k) = 0.0 + qgl(i,k) = 0.0 + enddo + enddo + endif + endif !shocaftcnv + + ! phy_f3d(1,1,ntot3d-2) - shoc determined sgs clouds + ! phy_f3d(1,1,ntot3d-1) - shoc determined diffusion coefficients + ! phy_f3d(1,1,ntot3d ) - shoc determined w'theta' + + !GFDL lat has no meaning inside of shoc - changed to "1" + + + ! DH* can we pass in gq0_graupel? is that zero? the original code + ! passes in qgl which is zero (always? sometimes?), in shoc_work + ! this qgl gets added to qpi, qpi = qpi_i + qgl with qpi_i = qsnw; + ! - with the above qsnw(i,k) = gq0_snow(i,k) + gq0_graupel(i,k), + ! would that be double counting? *DH + call shoc_work (ix, nx, 1, nzm, nzm+1, dtp, me, 1, prsl, & + phii, phil, u, v, omega, gt0, & + gq0_water_vapor, clw_ice, clw_liquid, qsnw, gq0_rain, & + qgl, rhc, supice, pcrit, cefac, cesfac, tkef1, dis_opt, & + cld_sgs, tke, hflx, evap, prnum, tkh, wthv_sec, .false., 1, ncpl, ncpi, & + con_cp, con_g, con_hvap, con_hfus, con_rv, con_rd, con_pi, con_fvirt) + + if (.not.shocaftcnv) then + if (imp_physics == imp_physics_mg .and. fprcp > 1) then + do k=1,nzm + do i=1,nx + clw_ice(i,k) = clw_ice(i,k) - gq0_graupel(i,k) + enddo + enddo + endif + endif ! .not. shocaftcnv + + !GF since gq0(ntlnc/ntinc) are passed in directly, no need to copy back + ! if (ntlnc > 0 .and. ntinc > 0 .and. ncld >= 2) then + ! do k=1,nzm + ! do i=1,nx + ! Stateout%gq0(i,k,ntlnc) = ncpl(i,k) + ! Stateout%gq0(i,k,ntinc) = ncpi(i,k) + ! enddo + ! enddo + ! endif + +end subroutine shoc_run + + ! Implementation of the Simplified High Order Closure (SHOC) scheme + ! of Bogenschutz and Krueger (2013), J. Adv. Model. Earth Syst, 5, 195-211, + ! doi: 10.1002/jame.200118. (further referred to as BK13) + ! in a single column form suitable for use in a GCM physics package. + ! Alex Belochitski, heavily based on the code of Peter Bogenschutz. + ! S Moorthi - optimization, cleanup, improve and customize for gsm + ! - improved solution for sgs-tke equation + ! S Moorthi - 05-11-17 - modified shear production term to eliminate + ! spurious tke ove Antarctica. + ! S Moorthi - 01-12-17 - added extra pressure dependent tke dissipation at + ! pressures below a critical value pcrit + ! S Moorthi - 04-12-17 - fixed a bug in the definition of hl on input + ! replacing fac_fus by fac_sub + ! S.Moorthi - 00-00-17 - added an alternate option for near boundary cek following + ! Scipion et. al., from U. Oklahoma. + subroutine shoc_work (ix, nx, ny, nzm, nz, dtn, me, lat, & + prsl, phii, phil, u, v, omega, tabs, & + qwv, qi, qc, qpi_i, qpl, qgl, rhc, supice, & + pcrit, cefac, cesfac, tkef1, dis_opt, & + cld_sgs, tke, hflx, evap, prnum, tkh, & + wthv_sec, lprnt, ipr, ncpl, ncpi, & + cp, ggr, lcond, lfus, rv, rgas, pi, epsv) + + use funcphys , only : fpvsl, fpvsi, fpvs ! saturation vapor pressure for water & ice + + implicit none + + real, intent(in) :: cp, ggr, lcond, lfus, rv, rgas, pi, epsv + integer, intent(in) :: ix ! max number of points in the physics window in the x + integer, intent(in) :: nx ! Number of points in the physics window in the x + integer, intent(in) :: ny ! and y directions + integer, intent(in) :: me ! MPI rank + integer, intent(in) :: lat ! latitude + + integer, intent(in) :: nzm ! Number of vertical layers + integer, intent(in) :: nz ! Number of layer interfaces (= nzm + 1) + real, intent(in) :: dtn ! Physics time step, s + + real, intent(in) :: pcrit ! pressure in Pa below which additional tke dissipation is applied + real, intent(in) :: cefac ! tunable multiplier to dissipation term + real, intent(in) :: cesfac ! tunable multiplier to dissipation term for bottom level + real, intent(in) :: tkef1 ! uncentering terms in implicit tke integration + real, intent(in) :: dis_opt ! when > 0 use different formula for near surface dissipation + + real, intent(in) :: hflx(nx) + real, intent(in) :: evap(nx) + +! The interface is talored to GFS in a sense that input variables are 2D + + real, intent(in) :: prsl (ix,ny,nzm) ! mean layer presure + real, intent(in) :: phii (ix,ny,nz ) ! interface geopotential height + real, intent(in) :: phil (ix,ny,nzm) ! layer geopotential height + real, intent(in) :: u (ix,ny,nzm) ! u-wind, m/s + real, intent(in) :: v (ix,ny,nzm) ! v-wind, m/s + real, intent(in) :: omega (ix,ny,nzm) ! omega, Pa/s + real, intent(inout) :: tabs (ix,ny,nzm) ! temperature, K + real, intent(inout) :: qwv (ix,ny,nzm) ! water vapor mixing ratio, kg/kg + real, intent(inout) :: qc (ix,ny,nzm) ! cloud water mixing ratio, kg/kg + real, intent(inout) :: qi (ix,ny,nzm) ! cloud ice mixing ratio, kg/kg +! Anning Cheng 03/11/2016 SHOC feedback to number concentration + real, intent(inout) :: ncpl (nx,ny,nzm) ! cloud water number concentration,/m^3 + real, intent(inout) :: ncpi (nx,ny,nzm) ! cloud ice number concentration,/m^3 + real, intent(in) :: qpl (nx,ny,nzm) ! rain mixing ratio, kg/kg - not used at this time + real, intent(in) :: qpi_i (nx,ny,nzm) ! snow mixing ratio, kg/kg - not used at this time + real, intent(in) :: qgl (nx,ny,nzm) ! graupel mixing ratio, kg/kg - not used at this time + real, intent(in) :: rhc (nx,ny,nzm) ! critical relative humidity + real, intent(in) :: supice ! ice supersaturation parameter + real, intent(inout) :: cld_sgs(ix,ny,nzm) ! sgs cloud fraction +! real, intent(inout) :: cld_sgs(nx,ny,nzm) ! sgs cloud fraction + real, intent(inout) :: tke (ix,ny,nzm) ! turbulent kinetic energy. m**2/s**2 +! real, intent(inout) :: tk (nx,ny,nzm) ! eddy viscosity + real, intent(inout) :: tkh (ix,ny,nzm) ! eddy diffusivity + real, intent(in) :: prnum (nx,ny,nzm) ! turbulent Prandtl number + real, intent(inout) :: wthv_sec (ix,ny,nzm) ! Buoyancy flux, K*m/s + + real, parameter :: zero=0.0, one=1.0, half=0.5, two=2.0, eps=0.622, & + three=3.0, oneb3=one/three, twoby3=two/three + real, parameter :: sqrt2 = sqrt(two), twoby15 = two / 15.0, & + skew_facw=1.2, skew_fact=0.0, & + tkhmax=300.0 + real :: lsub, fac_cond, fac_fus, cpolv, fac_sub, ggri, kapa, gocp, rog, sqrtpii, & + epsterm, onebeps, onebrvcp + +! SHOC tunable parameters + + real, parameter :: lambda = 0.04 +! real, parameter :: min_tke = 1e-6 ! Minumum TKE value, m**2/s**2 + real, parameter :: min_tke = 1e-4 ! Minumum TKE value, m**2/s**2 +! real, parameter :: max_tke = 100.0 ! Maximum TKE value, m**2/s**2 + real, parameter :: max_tke = 40.0 ! Maximum TKE value, m**2/s**2 +! Maximum turbulent eddy length scale, m +! real, parameter :: max_eddy_length_scale = 2000. + real, parameter :: max_eddy_length_scale = 1000. +! Maximum "return-to-isotropy" time scale, s + real, parameter :: max_eddy_dissipation_time_scale = 2000. + real, parameter :: Pr = 1.0 ! Prandtl number + +! Constants for the TKE dissipation term based on Deardorff (1980) + real, parameter :: pt19=0.19, pt51=0.51, pt01=0.01, atmin=0.01, atmax=one-atmin + real, parameter :: Cs = 0.15, epsln=1.0e-6 + real, parameter :: Ck = 0.1 ! Coeff in the eddy diffusivity - TKE relationship, see Eq. 7 in BK13 + +! real, parameter :: Ce = Ck**3/(0.7*Cs**4) +! real, parameter :: Ce = Ck**3/(0.7*Cs**4) * 2.2 +! real, parameter :: Ce = Ck**3/(0.7*Cs**4) * 3.0 , Ces = Ce +! real, parameter :: Ce = Ck**3/(0.7*Cs**4) * 2.5 , Ces = Ce * 3.0 / 2.5 +! real, parameter :: Ces = Ce/0.7*3.0 + +! real, parameter :: Ce = Ck**3/(0.7*Cs**4), Ces = Ce*3.0/0.7 ! Commented Moor + + real, parameter :: Ce = Ck**3/Cs**4, Ces = Ce +! real, parameter :: Ce = Ck**3/Cs**4, Ces = Ce*3.0/0.7 + +! real, parameter :: vonk=0.35 ! Von Karman constant + real, parameter :: vonk=0.4 ! Von Karman constant Moorthi - as in GFS + real, parameter :: tscale=400.! time scale set based off of similarity results of BK13, s + real, parameter :: w_tol_sqd = 4.0e-04 ! Min vlaue of second moment of w +! real, parameter :: w_tol_sqd = 1.0e-04 ! Min vlaue of second moment of w + real, parameter :: w_thresh = 0.0, thresh = 0.0 + real, parameter :: w3_tol = 1.0e-20 ! Min vlaue of third moment of w + + +! These parameters are a tie-in with a microphysical scheme +! Double check their values for the Zhao-Carr scheme. + real, parameter :: tbgmin = 233.16 ! Minimum temperature for cloud water., K (ZC) +! real, parameter :: tbgmin = 258.16 ! Minimum temperature for cloud water., K (ZC) +! real, parameter :: tbgmin = 253.16 ! Minimum temperature for cloud water., K + real, parameter :: tbgmax = 273.16 ! Maximum temperature for cloud ice, K + real, parameter :: a_bg = one/(tbgmax-tbgmin) +! +! Parameters to tune the second order moments- No tuning is performed currently + + real, parameter :: thl2tune = 1.0, qw2tune = 1.0, qwthl2tune = 1.0, & +! thl_tol = 1.e-4, rt_tol = 1.e-8, basetemp = 300.0 + thl_tol = 1.e-2, rt_tol = 1.e-4, basetemp = 300.0 + + integer, parameter :: nitr=6 + +! Local variables. Note that pressure is in millibars in the SHOC code. + + logical lprnt + integer ipr + + real zl (nx,ny,nzm) ! height of the pressure levels above surface, m + real zi (nx,ny,nz) ! height of the interface levels, m + real adzl (nx,ny,nzm) ! layer thickness i.e. zi(k+1)-zi(k) - defined at levels + real adzi (nx,ny,nz) ! level thickness i.e. zl(k)-zl(k-1) - defined at interface + + real hl (nx,ny,nzm) ! liquid/ice water static energy , K + real qv (nx,ny,nzm) ! water vapor, kg/kg + real qcl (nx,ny,nzm) ! liquid water (condensate), kg/kg + real qci (nx,ny,nzm) ! ice water (condensate), kg/kg + real w (nx,ny,nzm) ! z-wind, m/s + real bet (nx,ny,nzm) ! ggr/tv0 + real gamaz (nx,ny,nzm) ! ggr/cp*z + real qpi (nx,ny,nzm) ! snow + graupel mixing ratio, kg/kg +! real qpl (nx,ny,nzm) ! rain mixing ratio, kg/kg + +! Moments of the trivariate double Gaussian PDF for the SGS total water mixing ratio +! SGS liquid/ice static energy, and vertical velocity + + real qw_sec (nx,ny,nzm) ! Second moment total water mixing ratio, kg^2/kg^2 + real thl_sec (nx,ny,nzm) ! Second moment liquid/ice static energy, K^2 + real qwthl_sec(nx,ny,nzm) ! Covariance tot. wat. mix. ratio and static energy, K*kg/kg + real wqw_sec (nx,ny,nzm) ! Turbulent flux of tot. wat. mix., kg/kg*m/s + real wthl_sec (nx,ny,nzm) ! Turbulent flux of liquid/ice static energy, K*m/s + real w_sec (nx,ny,nzm) ! Second moment of vertical velocity, m**2/s**2 + real w3 (nx,ny,nzm) ! Third moment of vertical velocity, m**3/s**3 + real wqp_sec (nx,ny,nzm) ! Turbulent flux of precipitation, kg/kg*m/s + +! Eddy length formulation + real smixt (nx,ny,nzm) ! Turbulent length scale, m + real isotropy (nx,ny,nzm) ! "Return-to-isotropy" eddy dissipation time scale, s +! real isotropy_debug (nx,ny,nzm) ! Return to isotropy scale, s without artificial limits + real brunt (nx,ny,nzm) ! Moist Brunt-Vaisalla frequency, s^-1 + real conv_vel2(nx,ny,nzm) ! Convective velocity scale cubed, m^3/s^3 + + real cek(nx,ny) + +! Output of SHOC + real diag_frac, diag_qn, diag_qi, diag_ql + +! real diag_frac(nx,ny,nzm) ! SGS cloud fraction +! real diag_qn (nx,ny,nzm) ! SGS cloud+ice condensate, kg/kg +! real diag_qi (nx,ny,nzm) ! SGS ice condensate, kg/kg +! real diag_ql (nx,ny,nzm) ! SGS liquid condensate, kg/kg + + +! Horizontally averaged variables +! real conv_vel(nzm) ! Convective velocity scale cubed, m^3/s^3 + real wqlsb (nzm) ! liquid water flux, kg/kg/ m/s + real wqisb (nzm) ! ice flux, kg/kg m/s +! real thlv (nzm) ! Grid-scale level-average virtual potential temperature +! (not used) + + +! Local variables + +! real, dimension(nx,ny,nzm) :: tkesbbuoy, tkesbshear, tkesbdiss, tkesbbuoy_debug & +! tkebuoy_sgs, total_water, tscale1_debug, brunt2 + + real, dimension(nx,ny,nzm) :: total_water, brunt2, thv, tkesbdiss + real, dimension(nx,ny,nzm) :: def2 + real, dimension(nx,ny) :: denom, numer, l_inf, cldarr, thedz, thedz2 + + real lstarn, depth, omn, betdz, bbb, term, qsatt, dqsat, & + conv_var, tkes, skew_w, skew_qw, aterm, w1_1, w1_2, w2_1, & + w2_2, w3var, thl1_1, thl1_2, thl2_1, thl2_2, qw1_1, qw1_2, qw2_1, & + qw2_2, ql1, ql2, w_ql1, w_ql2, & + r_qwthl_1, r_wqw_1, r_wthl_1, testvar, s1, s2, std_s1, std_s2, C1, C2, & + thl_first, qw_first, w_first, Tl1_1, Tl1_2, betatest, pval, pkap, & + w2thl, w2qw,w2ql, w2ql_1, w2ql_2, & + thec, thlsec, qwsec, qwthlsec, wqwsec, wthlsec, thestd,dum, & + cqt1, cthl1, cqt2, cthl2, qn1, qn2, qi1, qi2, omn1, omn2, & + basetemp2, beta1, beta2, qs1, qs2, & + esval1_1, esval2_1, esval1_2, esval2_2, om1, om2, & + lstarn1, lstarn2, sqrtw2, sqrtthl, sqrtqt, & + sqrtstd1, sqrtstd2, tsign, tvar, sqrtw2t, wqls, wqis, & + sqrtqw2_1, sqrtqw2_2, sqrtthl2_1, sqrtthl2_2, sm, prespot, & + corrtest1, corrtest2, wrk, wrk1, wrk2, wrk3, onema, pfac + + + integer i,j,k,km1,ku,kd,ka,kb + +!calculate derived constants + lsub = lcond+lfus + fac_cond = lcond/cp + fac_fus = lfus/cp + cpolv = cp/lcond + fac_sub = lsub/cp + ggri = 1.0/ggr + kapa = rgas/cp + gocp = ggr/cp + rog = rgas*ggri + sqrtpii = one/sqrt(pi+pi) + epsterm = rgas/rv + onebeps = one/epsterm + onebrvcp= one/(rv*cp) + +! Map GFS variables to those of SHOC - SHOC operates on 3D fields +! Here a Y-dimension is added to the input variables, along with some unit conversions + + do k=1,nz + do j=1,ny + do i=1,nx + zi(i,j,k) = phii(i,j,k) * ggri + enddo + enddo + enddo + +! if (lprnt) write(0,*)' tabsin=',tabs(ipr,1,1:40) +! if (lprnt) write(0,*)' qcin=',qc(ipr,1,1:40) +! if (lprnt) write(0,*)' qwvin=',qwv(ipr,1,1:40) +! if (lprnt) write(0,*)' qiin=',qi(ipr,1,1:40) +! if (lprnt) write(0,*)' qplin=',qpl(ipr,1,1:40) +! if (lprnt) write(0,*)' qpiin=',qpi(ipr,1,1:40) +! +! move water from vapor to condensate if the condensate is negative +! + do k=1,nzm + do j=1,ny + do i=1,nx + if (qc(i,j,k) < zero) then + wrk = qwv(i,j,k) + qc(i,j,k) + if (wrk >= zero) then + qwv(i,j,k) = wrk + tabs(i,j,k) = tabs(i,j,k) - fac_cond * qc(i,j,k) + qc(i,j,k) = zero + else + qc(i,j,k) = zero + tabs(i,j,k) = tabs(i,j,k) + fac_cond * qwv(i,j,k) + qwv(i,j,k) = zero + endif + endif + if (qi(i,j,k) < zero) then + wrk = qwv(i,j,k) + qi(i,j,k) + if (wrk >= zero) then + qwv(i,j,k) = wrk + tabs(i,j,k) = tabs(i,j,k) - fac_sub * qi(i,j,k) + qi(i,j,k) = zero + else + qi(i,j,k) = zero + tabs(i,j,k) = tabs(i,j,k) + fac_sub * qwv(i,j,k) + qwv(i,j,k) = zero + endif + endif + enddo + enddo + enddo + +! if (lprnt) write(0,*)' tabsin2=',tabs(ipr,1,1:40) + + do k=1,nzm + do j=1,ny + do i=1,nx + zl(i,j,k) = phil(i,j,k) * ggri + wrk = one / prsl(i,j,k) + qv(i,j,k) = max(qwv(i,j,k), zero) + thv(i,j,k) = tabs(i,j,k) * (one+epsv*qv(i,j,k)) + w(i,j,k) = - rog * omega(i,j,k) * thv(i,j,k) * wrk + qcl(i,j,k) = max(qc(i,j,k), zero) + qci(i,j,k) = max(qi(i,j,k), zero) + qpi(i,j,k) = qpi_i(i,j,k) + qgl(i,j,k) ! add snow and graupel together +! +! qpl(i,j,k) = zero ! comment or remove when using with prognostic rain/snow +! qpi(i,j,k) = zero ! comment or remove when using with prognostic rain/snow + + wqp_sec(i,j,k) = zero ! Turbulent flux of precipiation +! + total_water(i,j,k) = qcl(i,j,k) + qci(i,j,k) + qv(i,j,k) + + prespot = (100000.0*wrk) ** kapa ! Exner function + bet(i,j,k) = ggr/(tabs(i,j,k)*prespot) ! Moorthi + thv(i,j,k) = thv(i,j,k)*prespot ! Moorthi +! +! Lapse rate * height = reference temperature + gamaz(i,j,k) = gocp * zl(i,j,k) + +! Liquid/ice water static energy - ! Note the the units are degrees K + hl(i,j,k) = tabs(i,j,k) + gamaz(i,j,k) - fac_cond*(qcl(i,j,k)+qpl(i,j,k)) & + - fac_sub *(qci(i,j,k)+qpi(i,j,k)) + w3(i,j,k) = zero + enddo + enddo + enddo + +! if (lprnt) write(0,*)' hlin=',hl(ipr,1,1:40) + +! Define vertical grid increments for later use in the vertical differentiation + + do k=2,nzm + km1 = k - 1 + do j=1,ny + do i=1,nx + adzi(i,j,k) = zl(i,j,k) - zl(i,j,km1) + adzl(i,j,km1) = zi(i,j,k) - zi(i,j,km1) + enddo + enddo + enddo + do j=1,ny + do i=1,nx + adzi(i,j,1) = (zl(i,j,1)-zi(i,j,1)) ! unused in the code + adzi(i,j,nz) = adzi(i,j,nzm) ! at the top - probably unused + adzl(i,j,nzm) = zi(i,j,nz) - zi(i,j,nzm) +! + wthl_sec(i,j,1) = hflx(i) + wqw_sec(i,j,1) = evap(i) + enddo + enddo + + + call tke_shoc() ! Integrate prognostic TKE equation forward in time + + +! diagnose second order moments of the subgrid PDF following +! Redelsperger J.L., and G. Sommeria, 1986, JAS, 43, 2619-2635 sans the use of stabilty +! weighting functions - Result is in global variables w_sec, thl_sec, qw_sec, and qwthl_sec + +! call diag_moments(total_water,tke,tkh) + +! Second moment of vertical velocity. +! Note that Eq 6 in BK13 gives a different expression that is dependent on +! vertical gradient of grid scale vertical velocity + + do k=1,nzm + ku = k+1 + kd = k-1 + ka = ku + kb = k + if (k == 1) then + kd = k + kb = ka + elseif (k == nzm) then + ku = k + ka = kb + endif + do j=1,ny + do i=1,nx + if (tke(i,j,k) > zero) then +! wrk = half*(tkh(i,j,ka)+tkh(i,j,kb))*(w(i,j,ku) - w(i,j,kd)) & + wrk = half*(tkh(i,j,ka)*prnum(i,j,ka)+tkh(i,j,kb)*prnum(i,j,kb))*(w(i,j,ku) - w(i,j,kd)) & + * sqrt(tke(i,j,k)) / (zl(i,j,ku) - zl(i,j,kd)) + w_sec(i,j,k) = max(twoby3 * tke(i,j,k) - twoby15 * wrk, zero) +! w_sec(i,j,k) = max(twoby3 * tke(i,j,k), zero) +! if(lprnt .and. i == ipr .and. k <40) write(0,*)' w_sec=',w_sec(i,j,k),' tke=r',tke(i,j,k),& +! ' tkh=',tkh(i,j,ka),tkh(i,j,kb),' w=',w(i,j,ku),w(i,j,kd),' prnum=',prnum(i,j,ka),prnum(i,j,kb) + else + w_sec(i,j,k) = zero + endif + enddo + enddo + enddo + + do k=2,nzm + + km1 = k - 1 + do j=1,ny + do i=1,nx + +! Use backward difference in the vertical, use averaged values of "return-to-isotropy" +! time scale and diffusion coefficient + + wrk1 = one / adzi(i,j,k) ! adzi(k) = (zl(k)-zl(km1)) +! wrk3 = max(tkh(i,j,k),pt01) * wrk1 + wrk3 = max(tkh(i,j,k),epsln) * wrk1 + + sm = half*(isotropy(i,j,k)+isotropy(i,j,km1))*wrk1*wrk3 ! Tau*Kh/dz^2 + +! SGS vertical flux liquid/ice water static energy. Eq 1 in BK13 +! No rain, snow or graupel in pdf (Annig, 08/29/2018) + + wrk1 = hl(i,j,k) - hl(i,j,km1) & + + (qpl(i,j,k) - qpl(i,j,km1)) * fac_cond & + + (qpi(i,j,k) - qpi(i,j,km1)) * fac_sub + wthl_sec(i,j,k) = - wrk3 * wrk1 + +! SGS vertical flux of total water. Eq 2 in BK13 + + wrk2 = total_water(i,j,k) - total_water(i,j,km1) + wqw_sec(i,j,k) = - wrk3 * wrk2 + +! Second moment of liquid/ice water static energy. Eq 4 in BK13 + + thl_sec(i,j,k) = thl2tune * sm * wrk1 * wrk1 + +! Second moment of total water mixing ratio. Eq 3 in BK13 + + qw_sec(i,j,k) = qw2tune * sm * wrk2 * wrk2 + +! Covariance of total water mixing ratio and liquid/ice water static energy. +! Eq 5 in BK13 + + qwthl_sec(i,j,k) = qwthl2tune * sm * wrk1 * wrk2 + + enddo ! i loop + enddo ! j loop + enddo ! k loop + +! These would be at the surface - do we need them? + do j=1,ny + do i=1,nx +! wthl_sec(i,j,1) = wthl_sec(i,j,2) +! wqw_sec(i,j,1) = wqw_sec(i,j,2) + thl_sec(i,j,1) = thl_sec(i,j,2) + qw_sec(i,j,1) = qw_sec(i,j,2) + qwthl_sec(i,j,1) = qwthl_sec(i,j,2) + enddo + enddo + +! Diagnose the third moment of SGS vertical velocity + + call canuto() + +! Recover parameters of the subgrid PDF using diagnosed moments +! and calculate SGS cloudiness, condensation and it's effects on temeperature +! and moisture variables + + call assumed_pdf() + +contains + + subroutine tke_shoc() + +! This subroutine solves the TKE equation, +! Heavily based on SAM's tke_full.f90 by Marat Khairoutdinov + + real grd,betdz,Cee,lstarn, lstarp, bbb, omn, omp,qsatt,dqsat, smix, & + buoy_sgs,ratio,a_prod_sh,a_prod_bu,a_diss,a_prod_bu_debug, buoy_sgs_debug, & + tscale1, wrk, wrk1, wtke, wtk2, rdtn, tkef2 + integer i,j,k,ku,kd,itr,k1 + + rdtn = one / dtn + + call tke_shear_prod(def2) ! Calculate shear production of TKE + +! Ensure values of TKE are reasonable + + do k=1,nzm + do j=1,ny + do i=1,nx + tke(i,j,k) = max(min_tke,tke(i,j,k)) + tkesbdiss(i,j,k) = zero +! tkesbshear(i,j,k) = zero +! tkesbbuoy(i,j,k) = zero + enddo + enddo + enddo + + call eddy_length() ! Find turbulent mixing length + call check_eddy() ! Make sure it's reasonable + + tkef2 = 1.0 - tkef1 + do k=1,nzm + ku = k+1 + kd = k + +! Cek = Ce * cefac + + if(k == 1) then + ku = 2 + kd = 2 +! Cek = Ces + elseif(k == nzm) then + ku = k + kd = k +! Cek = Ces + endif + + if (dis_opt > 0) then + do j=1,ny + do i=1,nx + wrk = (zl(i,j,k)-zi(i,j,1)) / adzl(i,j,1) + 1.5 + cek(i,j) = 1.0 + 2.0 / max((wrk*wrk - 3.3), 0.5) + enddo + enddo + else + if (k == 1) then + cek = ces * cesfac + else + cek = ce * cefac + endif + endif + + do j=1,ny + do i=1,nx + grd = adzl(i,j,k) ! adzl(k) = zi(k+1)-zi(k) + + +! TKE boyancy production term. wthv_sec (buoyancy flux) is calculated in +! assumed_pdf(). The value used here is from the previous time step + + a_prod_bu = ggr / thv(i,j,k) * wthv_sec(i,j,k) + +! If wthv_sec from subgrid PDF is not available use Brunt-Vaisalla frequency from eddy_length() + +!Obtain Brunt-Vaisalla frequency from diagnosed SGS buoyancy flux +!Presumably it is more precise than BV freq. calculated in eddy_length()? + + buoy_sgs = - (a_prod_bu+a_prod_bu) / (tkh(i,j,ku)+tkh(i,j,kd) + 0.0001) ! tkh is eddy thermal diffussivity + + +!Compute $c_k$ (variable Cee) for the TKE dissipation term following Deardorff (1980) + + if (buoy_sgs <= zero) then + smix = grd + else + smix = min(grd,max(0.1*grd, 0.76*sqrt(tke(i,j,k)/(buoy_sgs+1.e-10)))) + endif + + ratio = smix/grd + Cee = Cek(i,j) * (pt19 + pt51*ratio) * max(one, sqrt(pcrit/prsl(i,j,k))) + +! TKE shear production term + a_prod_sh = half*(def2(i,j,ku)*tkh(i,j,ku)*prnum(i,j,ku) & + + def2(i,j,kd)*tkh(i,j,kd)*prnum(i,j,kd)) + + +! smixt (turb. mixing lenght) is calculated in eddy_length() +! Explicitly integrate TKE equation forward in time +! a_diss = Cee/smixt(i,j,k)*tke(i,j,k)**1.5 ! TKE dissipation term +! tke(i,j,k) = max(zero,tke(i,j,k)+dtn*(max(zero,a_prod_sh+a_prod_bu)-a_diss)) + +! Semi-implicitly integrate TKE equation forward in time + + wtke = tke(i,j,k) + wtk2 = wtke +! wrk = (dtn*Cee)/smixt(i,j,k) + wrk = (dtn*Cee) / smixt(i,j,k) + wrk1 = wtke + dtn*(a_prod_sh+a_prod_bu) + +! if (lprnt .and. i == ipr .and. k<40) write(0,*)' wtke=',wtke,' wrk1=',wrk1,& +! ' a_prod_sh=',a_prod_sh,' a_prod_bu=',a_prod_bu,' dtn=',dtn,' smixt=',& +! smixt(i,j,k),' tkh=',tkh(i,j,ku),tkh(i,j,kd),' def2=',def2(i,j,ku),def2(i,j,kd)& +! ,' prnum=',prnum(i,j,ku),prnum(i,j,kd),' wthv_sec=',wthv_sec(i,j,k),' thv=',thv(i,j,k) + + do itr=1,nitr ! iterate for implicit solution + wtke = min(max(min_tke, wtke), max_tke) + a_diss = wrk*sqrt(wtke) ! Coefficient in the TKE dissipation term + wtke = wrk1 / (one+a_diss) + wtke = tkef1*wtke + tkef2*wtk2 ! tkef1+tkef2 = 1.0 + +! if (lprnt .and. i == ipr .and. k<40) write(0,*)' wtke=',wtke,' wtk2=',wtk2,& +! ' a_diss=',a_diss,' a_prod_sh=',a_prod_sh,' a_prod_bu=',a_prod_bu,& +! ' wrk1=',wrk1,' itr=',itr,' k=',k + + wtk2 = wtke + + enddo + + tke(i,j,k) = min(max(min_tke, wtke), max_tke) + a_diss = wrk*sqrt(tke(i,j,k)) + + tscale1 = (dtn+dtn) / a_diss ! corrected Eq 8 in BK13 -- tau = 2*tke/eps + + tkesbdiss(i,j,k) = rdtn*a_diss*tke(i,j,k) ! TKE dissipation term, epsilon + + +! Calculate "return-to-isotropy" eddy dissipation time scale, see Eq. 8 in BK13 + + if (buoy_sgs <= zero) then + isotropy(i,j,k) = min(max_eddy_dissipation_time_scale,tscale1) + else + isotropy(i,j,k) = min(max_eddy_dissipation_time_scale, & + tscale1/(one+lambda*buoy_sgs*tscale1*tscale1)) + endif + +! TKE budget terms + +! tkesbdiss(i,j,k) = a_diss +! tkesbshear(i,j,k) = a_prod_sh +! tkesbbuoy(i,j,k) = a_prod_bu +! tkesbbuoy_debug(i,j,k) = a_prod_bu_debug +! tkebuoy_sgs(i,j,k) = buoy_sgs + + enddo ! i loop + enddo ! j loop + enddo ! k +! + wrk = half * ck + do k=2,nzm + k1 = k - 1 + do j=1,ny + do i=1,nx + tkh(i,j,k) = min(tkhmax, wrk * (isotropy(i,j,k) * tke(i,j,k) & + + isotropy(i,j,k1) * tke(i,j,k1))) ! Eddy thermal diffusivity + enddo ! i + enddo ! j + enddo ! k + + + end subroutine tke_shoc + + + subroutine tke_shear_prod(def2) + +! Calculate TKE shear production term + + real, intent(out) :: def2(nx,ny,nzm) + + real rdzw, wrku, wrkv, wrkw + integer i,j,k,k1 + +! Calculate TKE shear production term at layer interface + + do k=2,nzm + k1 = k - 1 + do j=1,ny + do i=1,nx + rdzw = one / adzi(i,j,k) + wrku = (u(i,j,k)-u(i,j,k1)) * rdzw + wrkv = (v(i,j,k)-v(i,j,k1)) * rdzw +! wrkw = (w(i,j,k)-w(i,j,k1)) * rdzw + def2(i,j,k) = wrku*wrku + wrkv*wrkv !+ 2*wrkw(1) * wrkw(1) + enddo + enddo + enddo ! k loop + do j=1,ny + do i=1,nx +! def2(i,j,1) = def2(i,j,2) + def2(i,j,1) = (u(i,j,1)*u(i,j,1) + v(i,j,1)*v(i,j,1)) & + / (zl(i,j,1)*zl(i,j,1)) + enddo + enddo + + end subroutine tke_shear_prod + + subroutine eddy_length() + +! This subroutine computes the turbulent length scale based on a new +! formulation described in BK13 + +! Local variables + real wrk, wrk1, wrk2, wrk3 + integer i, j, k, kk, kl, ku, kb, kc, kli, kui + + do j=1,ny + do i=1,nx + cldarr(i,j) = zero + numer(i,j) = zero + denom(i,j) = zero + enddo + enddo + +! Find the length scale outside of clouds, that includes boundary layers. + + do k=1,nzm + do j=1,ny + do i=1,nx + +! Reinitialize the mixing length related arrays to zero +! smixt(i,j,k) = one ! shoc_mod module variable smixt + smixt(i,j,k) = epsln ! shoc_mod module variable smixt + brunt(i,j,k) = zero + +!Eq. 11 in BK13 (Eq. 4.13 in Pete's dissertation) +!Outside of cloud, integrate from the surface to the cloud base +!Should the 'if' below check if the cloud liquid < a small constant instead? + + if (qcl(i,j,k)+qci(i,j,k) <= zero) then + tkes = sqrt(tke(i,j,k)) * adzl(i,j,k) + numer(i,j) = numer(i,j) + tkes*zl(i,j,k) ! Numerator in Eq. 11 in BK13 + denom(i,j) = denom(i,j) + tkes ! Denominator in Eq. 11 in BK13 + else + cldarr(i,j) = one ! Take note of columns containing cloud. + endif + enddo + enddo + enddo + +! Calculate the measure of PBL depth, Eq. 11 in BK13 (Is this really PBL depth?) + do j=1,ny + do i=1,nx + if (denom(i,j) > zero .and. numer(i,j) > zero) then + l_inf(i,j) = min(0.1 * (numer(i,j)/denom(i,j)), 100.0) + else + l_inf(i,j) = 100.0 + endif + enddo + enddo + +!Calculate length scale outside of cloud, Eq. 10 in BK13 (Eq. 4.12 in Pete's dissertation) + do k=1,nzm + + kb = k-1 + kc = k+1 + if (k == 1) then + kb = 1 + kc = 2 + thedz(:,:) = adzi(:,:,kc) + elseif (k == nzm) then + kb = nzm-1 + kc = nzm + thedz(:,:) = adzi(:,:,k) + else + thedz(:,:) = adzi(:,:,kc) + adzi(:,:,k) ! = (z(k+1)-z(k-1)) + endif + + do j=1,ny + do i=1,nx + +! vars module variable bet (=ggr/tv0) ; grid module variable adzi + + betdz = bet(i,j,k) / thedz(i,j) + + tkes = sqrt(tke(i,j,k)) + +! Compute local Brunt-Vaisalla frequency + + wrk = qcl(i,j,k) + qci(i,j,k) + if (wrk > zero) then ! If in the cloud + +! Find the in-cloud Brunt-Vaisalla frequency + + omn = qcl(i,j,k) / (wrk+1.e-20) ! Ratio of liquid water to total water + +! Latent heat of phase transformation based on relative water phase content +! fac_cond = lcond/cp, fac_fus = lfus/cp + + lstarn = fac_cond + (one-omn)*fac_fus + +! Derivative of saturation mixing ratio over water/ice wrt temp. based on relative water phase content + dqsat = omn * dtqsatw(tabs(i,j,k),prsl(i,j,k)) & + + (one-omn) * dtqsati(tabs(i,j,k),prsl(i,j,k)) + +! Saturation mixing ratio over water/ice wrt temp based on relative water phase content + + qsatt = omn * qsatw(tabs(i,j,k),prsl(i,j,k)) & + + (one-omn) * qsati(tabs(i,j,k),prsl(i,j,k)) + +! liquid/ice moist static energy static energy divided by cp? + + bbb = (one + epsv*qsatt-wrk-qpl(i,j,k)-qpi(i,j,k) & + + 1.61*tabs(i,j,k)*dqsat) / (one+lstarn*dqsat) + +! Calculate Brunt-Vaisalla frequency using centered differences in the vertical + + brunt(i,j,k) = betdz*(bbb*(hl(i,j,kc)-hl(i,j,kb)) & + + (bbb*lstarn - (one+lstarn*dqsat)*tabs(i,j,k)) & + * (total_water(i,j,kc)-total_water(i,j,kb)) & + + (bbb*fac_cond - (one+fac_cond*dqsat)*tabs(i,j,k))*(qpl(i,j,kc)-qpl(i,j,kb)) & + + (bbb*fac_sub - (one+fac_sub*dqsat)*tabs(i,j,k))*(qpi(i,j,kc)-qpi(i,j,kb)) ) + + else ! outside of cloud + +! Find outside-of-cloud Brunt-Vaisalla frequency +! Only unsaturated air, rain and snow contribute to virt. pot. temp. +! liquid/ice moist static energy divided by cp? + + bbb = one + epsv*qv(i,j,k) - qpl(i,j,k) - qpi(i,j,k) + brunt(i,j,k) = betdz*( bbb*(hl(i,j,kc)-hl(i,j,kb)) & + + epsv*tabs(i,j,k)*(total_water(i,j,kc)-total_water(i,j,kb)) & + + (bbb*fac_cond-tabs(i,j,k))*(qpl(i,j,kc)-qpl(i,j,kb)) & + + (bbb*fac_sub -tabs(i,j,k))*(qpi(i,j,kc)-qpi(i,j,kb)) ) + endif + +! Reduction of mixing length in the stable regions (where B.-V. freq. > 0) is required. +! Here we find regions of Brunt-Vaisalla freq. > 0 for later use. + + if (brunt(i,j,k) >= zero) then + brunt2(i,j,k) = brunt(i,j,k) + else + brunt2(i,j,k) = zero + endif + +! Calculate turbulent length scale in the boundary layer. +! See Eq. 10 in BK13 (Eq. 4.12 in Pete's dissertation) + +! Keep the length scale adequately small near the surface following Blackadar (1984) +! Note that this is not documented in BK13 and was added later for SP-CAM runs + +! if (k == 1) then +! term = 600.*tkes +! smixt(i,j,k) = term + (0.4*zl(i,j,k)-term)*exp(-zl(i,j,k)*0.01) +! else + +! tscale is the eddy turnover time scale in the boundary layer and is +! an empirically derived constant + + if (tkes > zero .and. l_inf(i,j) > zero) then + wrk1 = one / (tscale*tkes*vonk*zl(i,j,k)) + wrk2 = one / (tscale*tkes*l_inf(i,j)) + wrk1 = wrk1 + wrk2 + pt01 * brunt2(i,j,k) / tke(i,j,k) + wrk1 = sqrt(one / max(wrk1,1.0e-8)) * (one/0.3) +! smixt(i,j,k) = min(max_eddy_length_scale, 2.8284*sqrt(wrk1)/0.3) + smixt(i,j,k) = min(max_eddy_length_scale, wrk1) + +! smixt(i,j,k) = min(max_eddy_length_scale,(2.8284*sqrt(1./((1./(tscale*tkes*vonk*zl(i,j,k))) & +! + (1./(tscale*tkes*l_inf(i,j)))+0.01*(brunt2(i,j,k)/tke(i,j,k)))))/0.3) +! else +! smixt(i,j,k) = zero + endif + +! endif + + enddo + + enddo + enddo + + +! Now find the in-cloud turbulence length scale +! See Eq. 13 in BK13 (Eq. 4.18 in Pete's disseration) + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! Remove after coupling to subgrid PDF. +!wthv_sec = -300/ggr*brunt*tk +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +! determine cubed convective velocity scale (conv_vel2) inside the cloud + +! call conv_scale() ! inlining the relevant code + +! do j=1,ny +! do i=1,nx +! conv_vel2(i,j,1) = zero ! Convective velocity scale cubed +! enddo +! enddo + ! Integrate velocity scale in the vertical +! do k=2,nzm +! do j=1,ny +! do i=1,nx +! conv_vel2(i,j,k) = conv_vel2(i,j,k-1) & +! + 2.5*adzi(i,j,k)*bet(i,j,k)*wthv_sec(i,j,k) +! enddo +! enddo +! enddo + + do j=1,ny + do i=1,nx + + if (cldarr(i,j) == 1) then ! If there's a cloud in this column + + kl = 0 + ku = 0 + do k=2,nzm-3 + +! Look for the cloud base in this column +! thresh (=0) is a variable local to eddy_length(). Should be a module constant. + wrk = qcl(i,j,k) + qci(i,j,k) + if (wrk > thresh .and. kl == 0) then + kl = k + endif + +! Look for the cloud top in this column + if (wrk > thresh .and. qcl(i,j,k+1)+qci(i,j,k+1) <= thresh) then + ku = k +! conv_vel2 (Cubed convective velocity scale) is calculated in conv_scale() +! Use the value of conv_vel2 at the top of the cloud. +! conv_var = conv_vel2(i,j,k)**(oneb3) + endif + +! Compute the mixing length scale for the cloud layer that we just found +! if (kl > 0 .and. ku > 0 .and. ku-kl > 1) then + if (kl > 0 .and. ku > 0 .and. ku-kl > 0) then + +! The calculation below finds the integral in the Eq. 10 in BK13 for the current cloud + conv_var = zero + do kk=kl,ku + conv_var = conv_var+ 2.5*adzi(i,j,kk)*bet(i,j,kk)*wthv_sec(i,j,kk) + enddo + conv_var = conv_var ** oneb3 + + if (conv_var > 0) then ! If convective vertical velocity scale > 0 + + depth = (zl(i,j,ku)-zl(i,j,kl)) + adzl(i,j,kl) + + + do kk=kl,ku +! in-cloud turbulence length scale, Eq. 13 in BK13 (Eq. 4.18) + +! wrk = conv_var/(depth*sqrt(tke(i,j,kk))) +! wrk = wrk * wrk + pt01*brunt2(i,j,kk)/tke(i,j,kk) + + wrk = conv_var/(depth*depth*sqrt(tke(i,j,kk))) & + + pt01*brunt2(i,j,kk)/tke(i,j,kk) + + smixt(i,j,kk) = min(max_eddy_length_scale, (one/0.3)*sqrt(one/wrk)) + + enddo + + endif ! If convective vertical velocity scale > 0 + kl = zero + ku = zero + endif ! if inside the cloud layer + + enddo ! k=2,nzm-3 + endif ! if in the cloudy column + enddo ! i=1,nx + enddo ! j=1,ny + + + end subroutine eddy_length + + + subroutine conv_scale() + +! This subroutine calculates the cubed convective velocity scale needed +! for the definition of the length scale in clouds +! See Eq. 16 in BK13 (Eq. 4.21 in Pete's dissertation) + + integer i, j, k + +!!!!!!!!! +!! A bug in formulation of conv_vel +! Obtain it by averaging conv_vel2 in the horizontal +!!!!!!!!!! + +! conv_vel(1)=zero ! Horizontally averaged convective velocity scale cubed + do j=1,ny + do i=1,nx + conv_vel2(i,j,1) = zero ! Convective velocity scale cubed + enddo + enddo +! Integrate velocity scale in the vertical + do k=2,nzm +! conv_vel(k)=conv_vel(k-1) + do j=1,ny + do i=1,nx +!********************************************************************** +!Do not include grid-scale contribution to convective velocity scale in GCM applications +! conv_vel(k)=conv_vel(k-1)+2.5*adzi(k)*bet(k)*(tvwle(k)+tvws(k)) +! conv_vel(k)=conv_vel(k)+2.5*adzi(i,j,k)*bet(i,j,k)*(tvws(k)) +!Do not include grid-scale contribution to convective velocity scale in GCM applications +! conv_vel2(i,j,k)=conv_vel2(i,j,k-1)+2.5*adzi(k)*bet(k)*(tvwle(k)+wthv_sec(i,j,k)) +!********************************************************************** + + conv_vel2(i,j,k) = conv_vel2(i,j,k-1) & + + 2.5*adzi(i,j,k)*bet(i,j,k)*wthv_sec(i,j,k) + enddo + enddo + enddo + + end subroutine conv_scale + + + subroutine check_eddy() + +! This subroutine checks eddy length values + + integer i, j, k, kb, ks, zend + real wrk +! real zstart, zthresh, qthresh + +! Temporary kludge for marine stratocumulus under very strong inversions at coarse resolution +! Placement until some explicity PBL top is put in +! Not used. +! zthresh = 100. +! qthresh = -6.0 + + do k=1,nzm + + if (k == nzm) then + kb = k + else + kb = k+1 + endif + + do j=1,ny + do i=1,nx + + wrk = 0.1*adzl(i,j,k) + ! Minimum 0.1 of local dz + smixt(i,j,k) = max(wrk, min(max_eddy_length_scale,smixt(i,j,k))) + +! If chracteristic grid dimension in the horizontal< 1000m, set lengthscale to +! be not larger that that. +! if (sqrt(dx*dy) .le. 1000.) smixt(i,j,k)=min(sqrt(dx*dy),smixt(i,j,k)) + + if (qcl(i,j,kb) == 0 .and. qcl(i,j,k) > 0 .and. brunt(i,j,k) > 1.e-4) then +!If just above the cloud top and atmosphere is stable, set to 0.1 of local dz + smixt(i,j,k) = wrk + endif + + enddo ! i + enddo ! j + enddo ! k + + end subroutine check_eddy + + subroutine canuto() + +! Subroutine impements an analytic expression for the third moment of SGS vertical velocity +! based on Canuto et at, 2001, JAS, 58, 1169-1172 (further referred to as C01) +! This allows to avoid having a prognostic equation for the third moment. +! Result is returned in a global variable w3 defined at the interface levels. + +! Local variables + integer i, j, k, kb, kc + + real bet2, f0, f1, f2, f3, f4, f5, iso, isosqr, & + omega0, omega1, omega2, X0, Y0, X1, Y1, AA0, AA1, buoy_sgs2, & + wrk, wrk1, wrk2, wrk3, avew +! cond, wrk, wrk1, wrk2, wrk3, avew +! +! See Eq. 7 in C01 (B.7 in Pete's dissertation) + real, parameter :: c=7.0, a0=0.52/(c*c*(c-2.)), a1=0.87/(c*c), & + a2=0.5/c, a3=0.6/(c*(c-2.)), a4=2.4/(3.*c+5.), & + a5=0.6/(c*(3.*c+5)) +!Moorthi a5=0.6/(c*(3.+5.*c)) + +! do k=1,nzm + do k=2,nzm + + kb = k-1 + kc = k+1 + +! if(k == 1) then +! kb = 1 +! kc = 2 +! do j=1,ny +! do i=1,nx +! thedz(i,j) = one / adzl(i,j,kc) +! thedz2(i,j) = thedz(i,j) +! enddo +! enddo +! elseif(k == nzm) then + if (k == nzm) then + kb = nzm-1 + kc = nzm + do j=1,ny + do i=1,nx + thedz(i,j) = one / adzi(i,j,k) + thedz2(i,j) = one / adzl(i,j,kb) + enddo + enddo + else + do j=1,ny + do i=1,nx + thedz(i,j) = one / adzi(i,j,k) + thedz2(i,j) = one / (adzl(i,j,k)+adzl(i,j,kb)) + enddo + enddo + endif + + + do j=1,ny + do i=1,nx + + iso = half*(isotropy(i,j,k)+isotropy(i,j,kb)) + isosqr = iso*iso ! Two-level average of "return-to-isotropy" time scale squared + buoy_sgs2 = isosqr*half*(brunt(i,j,k)+brunt(i,j,kb)) + bet2 = half*(bet(i,j,k)+bet(i,j,kb)) !Two-level average of BV frequency squared + + +! Compute functions f0-f5, see Eq, 8 in C01 (B.8 in Pete's dissertation) + + + avew = half*(w_sec(i,j,k)+w_sec(i,j,kb)) +!aab +! + wrk1 = bet2*iso + wrk2 = thedz2(i,j)*wrk1*wrk1*iso + wrk3 = thl_sec(i,j,kc) - thl_sec(i,j,kb) + + f0 = wrk2 * wrk1 * wthl_sec(i,j,k) * wrk3 + + wrk = wthl_sec(i,j,kc) - wthl_sec(i,j,kb) + + f1 = wrk2 * (wrk*wthl_sec(i,j,k) + half*avew*wrk3) + + wrk1 = bet2*isosqr + f2 = thedz(i,j)*wrk1*wthl_sec(i,j,k)*(w_sec(i,j,k)-w_sec(i,j,kb)) & + + (thedz2(i,j)+thedz2(i,j))*bet(i,j,k)*isosqr*wrk + + f3 = thedz2(i,j)*wrk1*wrk + thedz(i,j)*bet2*isosqr*(wthl_sec(i,j,k)*(tke(i,j,k)-tke(i,j,kb))) + + wrk1 = thedz(i,j)*iso*avew + f4 = wrk1*(w_sec(i,j,k)-w_sec(i,j,kb) + tke(i,j,k)-tke(i,j,kb)) + + f5 = wrk1*(w_sec(i,j,k)-w_sec(i,j,kb)) + + +! Compute the "omega" terms, see Eq. 6 in C01 (B.6 in Pete's dissertation) + + omega0 = a4 / (one-a5*buoy_sgs2) + omega1 = omega0 / (c+c) + omega2 = omega1*f3+(5./4.)*omega0*f4 + +! Compute the X0, Y0, X1, Y1 terms, see Eq. 5 a-b in C01 (B.5 in Pete's dissertation) + + wrk1 = one / (one-(a1+a3)*buoy_sgs2) + wrk2 = one / (one-a3*buoy_sgs2) + X0 = wrk1 * (a2*buoy_sgs2*(one-a3*buoy_sgs2)) + Y0 = wrk2 * (two*a2*buoy_sgs2*X0) + X1 = wrk1 * (a0*f0+a1*f1+a2*(one-a3*buoy_sgs2)*f2) + Y1 = wrk2 * (two*a2*(buoy_sgs2*X1+(a0/a1)*f0+f1)) + +! Compute the A0, A1 terms, see Eq. 5d in C01 (B.5 in Pete's dissertation) + + AA0 = omega0*X0 + omega1*Y0 + AA1 = omega0*X1 + omega1*Y1 + omega2 + +! Finally, we have the third moment of w, see Eq. 4c in C01 (B.4 in Pete's dissertation) +! cond is an estimate of third moment from second oment - If the third moment is larger +! than the estimate - limit w3. + +!aab + +! Implemetation of the C01 approach in this subroutine is nearly complete +! (the missing part are Eqs. 5c and 5e which are very simple) +! therefore it's easy to diagnose other third order moments obtained in C01 using this code. + + enddo + enddo + enddo + do j=1,ny + do i=1,nx + w3(i,j,1) = w3(i,j,2) + enddo + enddo + + end subroutine canuto + + subroutine assumed_pdf() + +! Compute SGS buoyancy flux, SGS cloud fraction, and SGS condensation +! using assumed analytic double-gaussian PDF for SGS vertical velocity, +! moisture, and liquid/ice water static energy, based on the +! general approach of Larson et al 2002, JAS, 59, 3519-3539, +! and Golaz et al 2002, JAS, 59, 3540-3551 +! References in the comments in this code are given to +! the Appendix A of Pete Bogenschutz's dissertation. + +! Local variables + + integer i,j,k,ku,kd + real wrk, wrk1, wrk2, wrk3, wrk4, bastoeps, eps_ss1, eps_ss2, cond_w + +! bastoeps = basetemp / epsterm + + +! Initialize for statistics + do k=1,nzm + wqlsb(k) = zero + wqisb(k) = zero + enddo + + DO k=1,nzm + + kd = k + ku = k + 1 +! if (k == nzm) ku = k + + DO j=1,ny + DO i=1,nx + +! Initialize cloud variables to zero + diag_qn = zero + diag_frac = zero + diag_ql = zero + diag_qi = zero + + pval = prsl(i,j,k) + pfac = pval * 1.0e-5 + pkap = pfac ** kapa + +! Read in liquid/ice static energy, total water mixing ratio, +! and vertical velocity to variables PDF needs + + thl_first = hl(i,j,k) + fac_cond*qpl(i,j,k) & + + fac_sub*qpi(i,j,k) + + qw_first = total_water(i,j,k) +! w_first = half*(w(i,j,kd)+w(i,j,ku)) + w_first = w(i,j,k) + + +! GET ALL INPUT VARIABLES ON THE SAME GRID +! Points to be computed with relation to thermo point +! Read in points that need to be averaged + + if (k < nzm) then + w3var = half*(w3(i,j,kd)+w3(i,j,ku)) + thlsec = max(zero, half*(thl_sec(i,j,kd)+thl_sec(i,j,ku)) ) + qwsec = max(zero, half*(qw_sec(i,j,kd)+qw_sec(i,j,ku)) ) + qwthlsec = half * (qwthl_sec(i,j,kd) + qwthl_sec(i,j,ku)) + wqwsec = half * (wqw_sec(i,j,kd) + wqw_sec(i,j,ku)) + wthlsec = half * (wthl_sec(i,j,kd) + wthl_sec(i,j,ku)) + else ! at the model top assuming zeros + w3var = half*w3(i,j,k) + thlsec = max(zero, half*thl_sec(i,j,k)) + qwsec = max(zero, half*qw_sec(i,j,k)) + qwthlsec = half * qwthl_sec(i,j,k) + wqwsec = half * wqw_sec(i,j,k) + wthlsec = half * wthl_sec(i,j,k) + endif + +! w3var = w3(i,j,k) +! thlsec = max(zero,thl_sec(i,j,k)) +! qwsec = max(zero,qw_sec(i,j,k)) +! qwthlsec = qwthl_sec(i,j,k) +! wqwsec = wqw_sec(i,j,k) +! wthlsec = wthl_sec(i,j,k) + +! Compute square roots of some variables so we don't have to do it again +! if (lprnt .and. i == ipr .and. k<40) write(0,*)' w_sec=',w_sec(i,j,k),' k=',k + if (w_sec(i,j,k) > zero) then + sqrtw2 = sqrt(w_sec(i,j,k)) + else + sqrtw2 = zero + endif + if (thlsec > zero) then + sqrtthl = sqrt(thlsec) + else + sqrtthl = zero + endif + if (qwsec > zero) then + sqrtqt = sqrt(qwsec) + else + sqrtqt = zero + endif + + +! Find parameters of the double Gaussian PDF of vertical velocity + +! Skewness of vertical velocity +! Skew_w = w3var / w_sec(i,j,k)**(3./2.) +! Skew_w = w3var / (sqrtw2*sqrtw2*sqrtw2) ! Moorthi + + IF (w_sec(i,j,k) <= w_tol_sqd) THEN ! If variance of w is too small then + ! PDF is a sum of two delta functions + Skew_w = zero + w1_1 = w_first + w1_2 = w_first + w2_1 = zero + w2_2 = zero + aterm = half + onema = half + ELSE + +!aab + + Skew_w = w3var / (sqrtw2*sqrtw2*sqrtw2) ! Moorthi +! Proportionality coefficients between widths of each vertical velocity +! gaussian and the sqrt of the second moment of w + w2_1 = 0.4 + w2_2 = 0.4 + +! Compute realtive weight of the first PDF "plume" +! See Eq A4 in Pete's dissertaion - Ensure 0.01 < a < 0.99 + + wrk = one - w2_1 + aterm = max(atmin,min(half*(one-Skew_w*sqrt(one/(4.*wrk*wrk*wrk+Skew_w*Skew_w))),atmax)) + onema = one - aterm + + sqrtw2t = sqrt(wrk) + +! Eq. A.5-A.6 + wrk = sqrt(onema/aterm) + w1_1 = sqrtw2t * wrk + w1_2 = - sqrtw2t / wrk + + w2_1 = w2_1 * w_sec(i,j,k) + w2_2 = w2_2 * w_sec(i,j,k) + + ENDIF + +! Find parameters of the PDF of liquid/ice static energy + +! if (lprnt .and. i == ipr .and. k<40) write(0,*)' thlsec=',thlsec,' w1_2=',w1_2,' w1_1=',w1_1,& +! ' thl_first=',thl_first,' k=',k,' wthlsec=',wthlsec,sqrtw2,sqrtthl + IF (thlsec <= thl_tol*thl_tol .or. abs(w1_2-w1_1) <= w_thresh) THEN + thl1_1 = thl_first + thl1_2 = thl_first + thl2_1 = zero + thl2_2 = zero + sqrtthl2_1 = zero + sqrtthl2_2 = zero + ELSE + + corrtest1 = max(-one,min(one,wthlsec/(sqrtw2*sqrtthl))) + + thl1_1 = -corrtest1 / w1_2 ! A.7 + thl1_2 = -corrtest1 / w1_1 ! A.8 + + wrk1 = thl1_1 * thl1_1 + wrk2 = thl1_2 * thl1_2 + wrk3 = three * (one - aterm*wrk1 - onema*wrk2) + wrk4 = -skew_facw*Skew_w - aterm*wrk1*thl1_1 - onema*wrk2*thl1_2 ! testing - Moorthi +! wrk4 = -skew_fact*Skew_w - aterm*wrk1*thl1_1 - onema*wrk2*thl1_2 ! testing - Moorthi +! wrk4 = - aterm*wrk1*thl1_1 - onema*wrk2*thl1_2 + wrk = three * (thl1_2-thl1_1) + if (wrk /= zero) then + thl2_1 = thlsec * min(100.,max(zero,( thl1_2*wrk3-wrk4)/(aterm*wrk))) ! A.10 + thl2_2 = thlsec * min(100.,max(zero,(-thl1_1*wrk3+wrk4)/(onema*wrk))) ! A.11 + else + thl2_1 = zero + thl2_2 = zero + endif +! +! if (lprnt .and. i == ipr .and. k<40) write(0,*)' thl1_1=',thl1_1,' sqrtthl=',sqrtthl,' thl_first=',thl_first,& +! ' thl1_2=',thl1_2,' corrtest1=',corrtest1,' w1_2=',w1_2,' w1_1=',w1_1 + + thl1_1 = thl1_1*sqrtthl + thl_first + thl1_2 = thl1_2*sqrtthl + thl_first + +! if (lprnt .and. i == ipr .and. k<40) write(0,*)' thl1_1=',thl1_1,' thl1_2=',thl1_2 + + sqrtthl2_1 = sqrt(thl2_1) + sqrtthl2_2 = sqrt(thl2_2) + + ENDIF + +! FIND PARAMETERS FOR TOTAL WATER MIXING RATIO + + IF (qwsec <= rt_tol*rt_tol .or. abs(w1_2-w1_1) <= w_thresh) THEN + qw1_1 = qw_first + qw1_2 = qw_first + qw2_1 = zero + qw2_2 = zero + sqrtqw2_1 = zero + sqrtqw2_2 = zero + ELSE + + corrtest2 = max(-one,min(one,wqwsec/(sqrtw2*sqrtqt))) + + qw1_1 = - corrtest2 / w1_2 ! A.7 + qw1_2 = - corrtest2 / w1_1 ! A.8 + + tsign = abs(qw1_2-qw1_1) + +! Skew_qw = skew_facw*Skew_w + + IF (tsign > 0.4) THEN + Skew_qw = skew_facw*Skew_w + ELSEIF (tsign <= 0.2) THEN + Skew_qw = zero + ELSE + Skew_qw = (skew_facw/0.2) * Skew_w * (tsign-0.2) + ENDIF + + wrk1 = qw1_1 * qw1_1 + wrk2 = qw1_2 * qw1_2 + wrk3 = three * (one - aterm*wrk1 - onema*wrk2) + wrk4 = Skew_qw - aterm*wrk1*qw1_1 - onema*wrk2*qw1_2 + wrk = three * (qw1_2-qw1_1) + + if (wrk /= zero) then + qw2_1 = qwsec * min(100.,max(zero,( qw1_2*wrk3-wrk4)/(aterm*wrk))) ! A.10 + qw2_2 = qwsec * min(100.,max(zero,(-qw1_1*wrk3+wrk4)/(onema*wrk))) ! A.11 + else + qw2_1 = zero + qw2_2 = zero + endif +! + qw1_1 = qw1_1*sqrtqt + qw_first + qw1_2 = qw1_2*sqrtqt + qw_first + + sqrtqw2_1 = sqrt(qw2_1) + sqrtqw2_2 = sqrt(qw2_2) + + ENDIF + +! CONVERT FROM TILDA VARIABLES TO "REAL" VARIABLES + + w1_1 = w1_1*sqrtw2 + w_first + w1_2 = w1_2*sqrtw2 + w_first + +! FIND WITHIN-PLUME CORRELATIONS + + testvar = aterm*sqrtqw2_1*sqrtthl2_1 + onema*sqrtqw2_2*sqrtthl2_2 + + IF (testvar == 0) THEN + r_qwthl_1 = zero + ELSE + r_qwthl_1 = max(-one,min(one,(qwthlsec-aterm*(qw1_1-qw_first)*(thl1_1-thl_first) & + -onema*(qw1_2-qw_first)*(thl1_2-thl_first))/testvar)) ! A.12 + ENDIF + +! BEGIN TO COMPUTE CLOUD PROPERTY STATISTICS + +! wrk1 = gamaz(i,j,k) - fac_cond * qpl(i,j,k) - fac_sub * qpi(i,j,k) +! Tl1_1 = thl1_1 - wrk1 +! Tl1_2 = thl1_2 - wrk1 + + Tl1_1 = thl1_1 - gamaz(i,j,k) + Tl1_2 = thl1_2 - gamaz(i,j,k) + +! if (lprnt .and. i == ipr .and. k<40) write(0,*)' Tl1_1=',Tl1_1,' Tl1_2=',Tl1_2,& +! ' wrk1=',wrk1,' thl1_1=',thl1_1,' thl1_2=',thl1_2,' qpl=',qpl(i,j,k),' qpi=',qpi(i,j,k) + +! Now compute qs + + esval1_1 = zero + esval2_1 = zero + eps_ss1 = eps + eps_ss2 = eps + om1 = one + +! Partition based on temperature for the first plume + + IF (Tl1_1 >= tbgmax) THEN + esval1_1 = min(fpvsl(Tl1_1), pval) +! esval1_1 = esatw(Tl1_1) + lstarn1 = lcond + ELSE IF (Tl1_1 <= tbgmin) THEN + esval1_1 = min(fpvsi(Tl1_1), pval) +! esval1_1 = esati(Tl1_1) + lstarn1 = lsub + eps_ss1 = eps * supice + ELSE + esval1_1 = min(fpvsl(Tl1_1), pval) + esval2_1 = min(fpvsi(Tl1_1), pval) +! esval1_1 = esatw(Tl1_1) +! esval2_1 = esati(Tl1_1) + om1 = max(zero, min(one, a_bg*(Tl1_1-tbgmin))) + lstarn1 = lcond + (one-om1)*lfus + eps_ss2 = eps * supice + + ENDIF + qs1 = om1 * eps_ss1*esval1_1/(pval-0.378*esval1_1) & + + (one-om1) * eps_ss2*esval2_1/(pval-0.378*esval2_1) + +! beta1 = (rgas/rv)*(lstarn1/(rgas*Tl1_1))*(lstarn1/(cp*Tl1_1)) + beta1 = (lstarn1*lstarn1*onebrvcp) / (Tl1_1*Tl1_1) ! A.18 + + +! Are the two plumes equal? If so then set qs and beta +! in each column to each other to save computation + IF (Tl1_1 == Tl1_2) THEN + qs2 = qs1 + beta2 = beta1 + ELSE + + esval1_2 = zero + esval2_2 = zero + eps_ss1 = eps + eps_ss2 = eps + om2 = one + + IF (Tl1_2 >= tbgmax) THEN + esval1_2 = min(fpvsl(Tl1_2), pval) +! esval1_2 = esatw(Tl1_2) + lstarn2 = lcond + ELSE IF (Tl1_2 <= tbgmin) THEN + esval1_2 = min(fpvsi(Tl1_2), pval) +! esval1_2 = esati(Tl1_2) + lstarn2 = lsub + eps_ss1 = eps * supice + ELSE + esval1_2 = min(fpvsl(Tl1_2), pval) + esval2_2 = min(fpvsi(Tl1_2), pval) +! esval1_2 = esatw(Tl1_2) +! esval2_2 = esati(Tl1_2) + om2 = max(zero, min(one, a_bg*(Tl1_2-tbgmin))) + lstarn2 = lcond + (one-om2)*lfus + eps_ss2 = eps * supice + ENDIF + + qs2 = om2 * eps_ss1*esval1_2/(pval-0.378*esval1_2) & + + (one-om2) * eps_ss2*esval2_2/(pval-0.378*esval2_2) + +! beta2 = (rgas/rv)*(lstarn2/(rgas*Tl1_2))*(lstarn2/(cp*Tl1_2)) ! A.18 + beta2 = (lstarn2*lstarn2*onebrvcp) / (Tl1_2*Tl1_2) ! A.18 + + ENDIF + + qs1 = qs1 * rhc(i,j,k) + qs2 = qs2 * rhc(i,j,k) + +! Now compute cloud stuff - compute s term + + cqt1 = one / (one+beta1*qs1) ! A.19 + wrk = qs1 * (one+beta1*qw1_1) * cqt1 + s1 = qw1_1 - wrk ! A.17 + cthl1 = cqt1*wrk*cpolv*beta1*pkap ! A.20 + + wrk1 = cthl1 * cthl1 + wrk2 = cqt1 * cqt1 +! std_s1 = sqrt(max(zero,wrk1*thl2_1+wrk2*qw2_1-2.*cthl1*sqrtthl2_1*cqt1*sqrtqw2_1*r_qwthl_1)) + std_s1 = sqrt(max(zero, wrk1*thl2_1+wrk2*qw2_1 & + - two*cthl1*sqrtthl2_1*cqt1*sqrtqw2_1*r_qwthl_1)) + + qn1 = zero + C1 = zero + + IF (std_s1 > zero) THEN + wrk = s1 / (std_s1*sqrt2) + C1 = max(zero, min(one, half*(one+erf(wrk)))) ! A.15 + +! if (lprnt .and. i == ipr .and. k<40) write(0,*)' in shoc wrk=',wrk,' s1=','std=',std_s1,& +! ' c1=',c1*100,' qs1=',qs1,' qw1_1=',qw1_1,' k=',k + +! IF (C1 > zero) qn1 = s1*C1 + (std_s1*sqrtpii)*exp(-wrk*wrk) ! A.16 + qn1 = max(zero, s1*C1 + (std_s1*sqrtpii)*exp(-wrk*wrk)) ! A.16 + ELSEIF (s1 > zero) THEN + C1 = one + qn1 = s1 + ENDIF + +! now compute non-precipitating cloud condensate + +! If two plumes exactly equal, then just set many of these +! variables to themselves to save on computation. + IF (qw1_1 == qw1_2 .and. thl2_1 == thl2_2 .and. qs1 == qs2) THEN + s2 = s1 + cthl2 = cthl1 + cqt2 = cqt1 + std_s2 = std_s1 + C2 = C1 + qn2 = qn1 + ELSE + + cqt2 = one / (one+beta2*qs2) + wrk = qs2 * (one+beta2*qw1_2) * cqt2 + s2 = qw1_2 - wrk + cthl2 = wrk*cqt2*cpolv*beta2*pkap + wrk1 = cthl2 * cthl2 + wrk2 = cqt2 * cqt2 +! std_s2 = sqrt(max(zero,wrk1*thl2_2+wrk2*qw2_2-2.*cthl2*sqrtthl2_2*cqt2*sqrtqw2_2*r_qwthl_1)) + std_s2 = sqrt(max(zero, wrk1*thl2_2+wrk2*qw2_2 & + - two*cthl2*sqrtthl2_2*cqt2*sqrtqw2_2*r_qwthl_1)) + + qn2 = zero + C2 = zero + + IF (std_s2 > zero) THEN + wrk = s2 / (std_s2*sqrt2) + C2 = max(zero, min(one, half*(one+erf(wrk)))) +! IF (C2 > zero) qn2 = s2*C2 + (std_s2*sqrtpii)*exp(-wrk*wrk) + qn2 = max(zero, s2*C2 + (std_s2*sqrtpii)*exp(-wrk*wrk)) + ELSEIF (s2 > zero) THEN + C2 = one + qn2 = s2 + ENDIF + + ENDIF + +! finally, compute the SGS cloud fraction + diag_frac = aterm*C1 + onema*C2 + + om1 = max(zero, min(one, (Tl1_1-tbgmin)*a_bg)) + om2 = max(zero, min(one, (Tl1_2-tbgmin)*a_bg)) + + qn1 = min(qn1,qw1_1) + qn2 = min(qn2,qw1_2) + + ql1 = qn1*om1 + ql2 = qn2*om2 + + qi1 = qn1 - ql1 + qi2 = qn2 - ql2 + +! if (lprnt .and. i == ipr .and. k<40) write(0,*)' in shoc qi=',qi1,qi2,' ql=',ql1,ql2,& +! ' c1=',c1,' c2=',c2,' s1=',s1,' s2=',s2,' k=',k,' tl1=',tl1_1,tl1_2,' om1=',om1,'om2=',om2& +! ,' tbgmin=',tbgmin,'a_bg=',a_bg + + + diag_qn = min(max(zero, aterm*qn1 + onema*qn2), total_water(i,j,k)) + diag_ql = min(max(zero, aterm*ql1 + onema*ql2), diag_qn) + diag_qi = diag_qn - diag_ql + + +! Update temperature variable based on diagnosed cloud properties + om1 = max(zero, min(one, (tabs(i,j,k)-tbgmin)*a_bg)) + lstarn1 = lcond + (one-om1)*lfus + tabs(i,j,k) = hl(i,j,k) - gamaz(i,j,k) + fac_cond*(diag_ql+qpl(i,j,k)) & + + fac_sub *(diag_qi+qpi(i,j,k)) & + + tkesbdiss(i,j,k) * (dtn/cp) ! tke dissipative heating + +! if (lprnt .and. i == ipr .and. k < 40) write(0,*)' tabsout=',tabs(ipr,1,k),' k=',k& +! ,' hl=',hl(i,j,k),' gamaz=',gamaz(i,j,k),' diag_ql=',diag_ql,' qpl=',qpl(i,j,k)& +! ,' diag_qi=',diag_qi,' qpi=',qpi(i,j,k),' diag_qn =',diag_qn ,' aterm=',aterm,' onema=',onema& +! ,' qn1=',qn1 ,' qn2=',qn2,' ql1=',ql1,' ql2=',ql2 +! Update moisture fields + +! Update ncpl and ncpi Anning Cheng 03/11/2016 +! ncpl(i,j,k) = diag_ql/max(qc(i,j,k),1.e-10)*ncpl(i,j,k) +! The following commneted by Moorthi on April 26, 2017 to test blowing up +! ncpl(i,j,k) = (1.0-diag_ql/max(qc(i,j,k),1.e-10)) * ncpl(i,j,k) +! ncpi(i,j,k) = (1.0-diag_qi/max(qi(i,j,k),1.e-10)) * ncpi(i,j,k) + qc(i,j,k) = diag_ql + qi(i,j,k) = diag_qi + qwv(i,j,k) = total_water(i,j,k) - diag_qn + cld_sgs(i,j,k) = diag_frac + + +! Compute the liquid water flux + wqls = aterm * ((w1_1-w_first)*ql1) + onema * ((w1_2-w_first)*ql2) + wqis = aterm * ((w1_1-w_first)*qi1) + onema * ((w1_2-w_first)*qi2) + +! Compute statistics for the fluxes so we don't have to save these variables + wqlsb(k) = wqlsb(k) + wqls + wqisb(k) = wqisb(k) + wqis + +! diagnostic buoyancy flux. Includes effects from liquid water, ice +! condensate, liquid & ice precipitation +! wrk = epsv * basetemp + wrk = epsv * thv(i,j,k) + + bastoeps = onebeps * thv(i,j,k) + + if (k < nzm) then + wthv_sec(i,j,k) = wthlsec + wrk*wqwsec & + + (fac_cond-bastoeps)*wqls & + + (fac_sub-bastoeps) *wqis & + + ((lstarn1/cp)-thv(i,j,k))*half*(wqp_sec(i,j,kd)+wqp_sec(i,j,ku)) + else + wthv_sec(i,j,k) = wthlsec + wrk*wqwsec & + + (fac_cond-bastoeps)*wqls & + + (fac_sub-bastoeps) *wqis & + + ((lstarn1/cp)-thv(i,j,k))*half*wqp_sec(i,j,k) + endif + +! wthv_sec(i,j,k) = wthlsec + wrk*wqwsec & +! + (fac_cond-bastoeps)*wqls & +! + (fac_sub-bastoeps)*wqis & +! + ((lstarn1/cp)-basetemp)*half*(wqp_sec(i,j,kd)+wqp_sec(i,j,ku)) + + ENDDO + ENDDO + ENDDO + + + end subroutine assumed_pdf + + +! Saturation vapor pressure and mixing ratio subroutines +! Based on Flatau et al (1992), J. App. Met., 31, 1507-1513 +! Code by Marat Khairoutdinov + + + real function esatw(t) + real t ! temperature (K) + real a0,a1,a2,a3,a4,a5,a6,a7,a8 + data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & + 6.11239921, 0.443987641, 0.142986287e-1, & + 0.264847430e-3, 0.302950461e-5, 0.206739458e-7, & + 0.640689451e-10, -0.952447341e-13,-0.976195544e-15/ + real dt + dt = max(-80.,t-273.16) + esatw = a0 + dt*(a1+dt*(a2+dt*(a3+dt*(a4+dt*(a5+dt*(a6+dt*(a7+a8*dt))))))) + end function esatw + + real function qsatw(t,p) +! implicit none + real t ! temperature (K) + real p ! pressure (Pa) + real esat +! esat = fpvs(t) + esat = fpvsl(t) + qsatw = 0.622 * esat/max(esat,p-0.378*esat) +! esat = esatw(t) +! qsatw = 0.622 * esat/max(esat,p-esat) + end function qsatw + + + real function esati(t) + real t ! temperature (K) + real a0,a1,a2,a3,a4,a5,a6,a7,a8 + data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & + 6.11147274, 0.503160820, 0.188439774e-1, & + 0.420895665e-3, 0.615021634e-5, 0.602588177e-7, & + 0.385852041e-9, 0.146898966e-11, 0.252751365e-14/ + real dt +! real esatw + if(t > 273.15) then + esati = esatw(t) + else if(t.gt.185.) then + dt = t-273.16 + esati = a0 + dt*(a1+dt*(a2+dt*(a3+dt*(a4+dt*(a5+dt*(a6+dt*(a7+a8*dt))))))) + else ! use some additional interpolation below 184K + dt = max(-100.,t-273.16) + esati = 0.00763685 + dt*(0.000151069+dt*7.48215e-07) + endif + end function esati + + real function qsati(t,p) + real t ! temperature (K) + real p ! pressure (Pa) + real esat !,esati +! esat = fpvs(t) + esat = fpvsi(t) + qsati = 0.622 * esat/max(esat,p-0.378*esat) +! esat = esati(t) +! qsati = 0.622 * esat/max(esat,p-esat) + end function qsati + + real function dtesatw(t) + real t ! temperature (K) + real a0,a1,a2,a3,a4,a5,a6,a7,a8 + data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & + 0.443956472, 0.285976452e-1, 0.794747212e-3, & + 0.121167162e-4, 0.103167413e-6, 0.385208005e-9, & + -0.604119582e-12, -0.792933209e-14, -0.599634321e-17/ + real dt + dt = max(-80.,t-273.16) + dtesatw = a0 + dt* (a1+dt*(a2+dt*(a3+dt*(a4+dt*(a5+dt*(a6+dt*(a7+a8*dt))))))) + end function dtesatw + + real function dtqsatw(t,p) + real t ! temperature (K) + real p ! pressure (Pa) +! real dtesatw + dtqsatw = 100.0*0.622*dtesatw(t)/p + end function dtqsatw + + real function dtesati(t) + real t ! temperature (K) + real a0,a1,a2,a3,a4,a5,a6,a7,a8 + data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & + 0.503223089, 0.377174432e-1, 0.126710138e-2, & + 0.249065913e-4, 0.312668753e-6, 0.255653718e-8, & + 0.132073448e-10, 0.390204672e-13, 0.497275778e-16/ + real dt +! real dtesatw + if(t > 273.15) then + dtesati = dtesatw(t) + else if(t > 185.) then + dt = t-273.16 + dtesati = a0 + dt*(a1+dt*(a2+dt*(a3+dt*(a4+dt*(a5+dt*(a6+dt*(a7+a8*dt))))))) + else ! use additional interpolation below 185K + dt = max(-100.,t-273.16) + dtesati = 0.0013186 + dt*(2.60269e-05+dt*1.28676e-07) + endif + end function dtesati + + + real function dtqsati(t,p) + real t ! temperature (K) + real p ! pressure (Pa) +! real dtesati + dtqsati = 100.0*0.622*dtesati(t)/p + end function dtqsati + +end subroutine shoc_work + +end module shoc diff --git a/physics/gscond.f b/physics/gscond.f new file mode 100644 index 000000000..bfc6115fa --- /dev/null +++ b/physics/gscond.f @@ -0,0 +1,526 @@ +!> \file gscond.f +!! This file contains the subroutine that calculates grid-scale +!! condensation and evaporation for use in Zhao and Carr (1997) +!! \cite zhao_and_carr_1997 scheme. + +!> This module contains the CCPP-compliant zhao_carr_gscond scheme. + module zhaocarr_gscond + contains + + +! \brief Brief description of the subroutine +! +!> \section arg_table_gscond_init Argument Table +!! + subroutine zhaocarr_gscond_init + end subroutine zhaocarr_gscond_init + +! \brief Brief description of the subroutine +! +!> \section arg_table_gscond_finalize Argument Table +!! + subroutine zhaocarr_gscond_finalize + end subroutine zhaocarr_gscond_finalize + +!> \defgroup condense GFS gscond Main +!> @{ +!! This subroutine computes grid-scale condensation and evaporation of +!! cloud condensate. +!! +#if 0 +!> \section arg_table_zhaocarr_gscond_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|----------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | +!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | +!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | +!! | dtf | time_step_for_dynamics | dynamics time step | s | 0 | real | kind_phys | in | F | +!! | prsl | air_pressure | layer mean air pressure | Pa | 2 | real | kind_phys | in | F | +!! | ps | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | +!! | q | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | clw1 | ice_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | in | F | +!! | clw2 | cloud_condensed_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | in | F | +!! | cwm | cloud_condensed_water_mixing_ratio_updated_by_physics | moist cloud condensed water mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | +!! | t | air_temperature_updated_by_physics | layer mean air temperature | K | 2 | real | kind_phys | inout | F | +!! | tp | air_temperature_two_time_steps_back | air temperature two time steps back | K | 2 | real | kind_phys | inout | F | +!! | qp | water_vapor_specific_humidity_two_time_steps_back | water vapor specific humidity two time steps back | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | psp | surface_air_pressure_two_time_steps_back | surface air pressure two time steps back | Pa | 1 | real | kind_phys | inout | F | +!! | tp1 | air_temperature_at_previous_time_step | air temperature at previous time step | K | 2 | real | kind_phys | inout | F | +!! | qp1 | water_vapor_specific_humidity_at_previous_time_step | water vapor specific humidity at previous time step | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | psp1 | surface_air_pressure_at_previous_time_step | surface air surface pressure at previous time step | Pa | 1 | real | kind_phys | inout | F | +!! | u | critical_relative_humidity | critical relative humidity | frac | 2 | real | kind_phys | in | F | +!! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | +!! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +#endif +!> \section general_gscond GFS gscond Scheme General Algorithm +!! -# Calculate ice-water identification number \f$IW\f$ in order to make a distinction between +!! cloud water and cloud ice (table2 of Zhao and Carr (1997) \cite zhao_and_carr_1997). +!! -# Calculate the changes in \f$t\f$, \f$q\f$ and \f$p\f$ due to all the processes except microphysics. +!! -# Calculate cloud evaporation rate (\f$E_c\f$, eq. 19 of Zhao and Carr (1997)\cite zhao_and_carr_1997). +!! -# Calculate cloud condensation rate (\f$C_g\f$, eq.8 of Zhao and Carr (1997)\cite zhao_and_carr_1997). +!! -# Update \f$t\f$, \f$q\f$, \f$cwm\f$ due to cloud evaporation and condensation processes. +!> \section Zhao-Carr_cond_detailed GFS gscond Scheme Detailed Algorithm +!> @{ + subroutine zhaocarr_gscond_run (im,ix,km,dt,dtf,prsl,ps,q,clw1 & + &, clw2, cwm, t, tp, qp, psp & + &, tp1, qp1, psp1, u, lprnt, ipr, errmsg, errflg) + +! +! ****************************************************************** +! * * +! * subroutine for grid-scale condensation & evaporation * +! * for the mrf model at ncep. * +! * * +! ****************************************************************** +! * * +! * created by: q. zhao jan. 1995 * +! * modified by: h.-l. pan sep. 1998 * +! * modified by: s. moorthi aug. 1998, 1999, 2000 * +! * * +! * references: * +! * * +! ****************************************************************** +! + use machine , only : kind_phys + use funcphys , only : fpvs + use physcons, psat => con_psat, hvap => con_hvap, grav => con_g + &, hfus => con_hfus, ttp => con_ttp, rd => con_rd + &, cp => con_cp, eps => con_eps, epsm1 => con_epsm1 + &, rv => con_rv +! use namelist_def, only: nsdfi,fhdfi + implicit none +! +! Interface variables + integer, intent(in) :: im, ix, km, ipr + real(kind=kind_phys), intent(in) :: dt, dtf + real(kind=kind_phys), intent(in) :: prsl(ix,km), ps(im) + real(kind=kind_phys), intent(inout) :: q(ix,km) + real(kind=kind_phys), intent(in) :: clw1(ix,km), clw2(ix,km) + real(kind=kind_phys), intent(out) :: cwm(ix,km) + real(kind=kind_phys), intent(inout) :: t(ix,km) & + &, tp(ix,km), qp(ix,km), psp(im) & + &, tp1(ix,km), qp1(ix,km), psp1(im) + real(kind=kind_phys), intent(in) :: u(im,km) + logical, intent(in) :: lprnt +! + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +! +! Local variables + real (kind=kind_phys) h1 + &, d00, elwv, eliv + &, epsq + &, r, cpr, rcp + parameter (h1=1.e0, d00=0.e0 + &, elwv=hvap, eliv=hvap+hfus + &, epsq=2.e-12, r=rd + &, cpr=cp*r, rcp=h1/cp) +! + real(kind=kind_phys), parameter :: cons_0=0.0, cons_m15=-15.0 +! + real (kind=kind_phys) qi(im), qint(im), ccrik, e0 + &, cond, rdt, us, cclimit, climit + &, tmt0, tmt15, qik, cwmik + &, ai, qw, u00ik, tik, pres, pp0, fi + &, at, aq, ap, fiw, elv, qc, rqik + &, rqikk, tx1, tx2, tx3, es, qs + &, tsq, delq, condi, cone0, us00, ccrik1 + &, aa, ab, ac, ad, ae, af, ag + &, el2orc, albycp +! real (kind=kind_phys) vprs(im) + integer iw(im,km), i, k, iwik +! + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 +! +!-----------------GFS interstitial in driver ---------------------------- + do i = 1,im + do k= 1,km + cwm(i,k) = clw1(i,k)+clw2(i,k) + enddo + enddo +!-----------------prepare constants for later uses----------------- +! + el2orc = hvap*hvap / (rv*cp) + albycp = hvap / cp +! write(0,*)' in gscond im=',im,' ix=',ix +! + rdt = h1/dt + us = h1 + cclimit = 1.0e-3 + climit = 1.0e-20 +! + do i = 1, im + iw(i,km) = d00 + enddo +! +! check for first time step +! +! if (tp(1,1) < 1.) then +! do k = 1, km +! do i = 1, im +! tp(i,k) = t(i,k) +! qp(i,k) = max(q(i,k),epsq) +! tp1(i,k) = t(i,k) +! qp1(i,k) = max(q(i,k),epsq) +! enddo +! enddo +! do i = 1, im +! psp(i) = ps(i) +! psp1(i) = ps(i) +! enddo +! endif +! +!************************************************************* +!> -# Begining of grid-scale condensation/evaporation loop (start of +!! k-loop, i-loop) +!************************************************************* +! +! do k = km-1,2,-1 + do k = km,1,-1 +! vprs(:) = 0.001 * fpvs(t(:,k)) ! fpvs in pa +!----------------------------------------------------------------------- +!------------------qw, qi and qint-------------------------------------- + do i = 1, im + tmt0 = t(i,k)-273.16 + tmt15 = min(tmt0,cons_m15) + qik = max(q(i,k),epsq) + cwmik = max(cwm(i,k),climit) +! +! ai = 0.008855 +! bi = 1.0 +! if (tmt0 .lt. -20.0) then +! ai = 0.007225 +! bi = 0.9674 +! end if +! +! the global qsat computation is done in pa + pres = prsl(i,k) +! +! qw = vprs(i) + qw = min(pres, fpvs(t(i,k))) +! + qw = eps * qw / (pres + epsm1 * qw) + qw = max(qw,epsq) +! qi(i) = qw *(bi+ai*min(tmt0,cons_0)) +! qint(i) = qw *(1.-0.00032*tmt15*(tmt15+15.)) + qi(i) = qw + qint(i) = qw +! if (tmt0 .le. -40.) qint(i) = qi(i) + +!> -# Compute ice-water identification number IW. +!!\n The distinction between cloud water and cloud ice is made by the +!! cloud identification number IW, which is zero for cloud water and +!! unity for cloud ice (Table 2 in Zhao and Carr (1997) +!! \cite zhao_and_carr_1997): +!! - All clouds are defined to consist of liquid water below the +!! freezing level (\f$T\geq 0^oC\f$) and of ice particles above the +!! \f$T=-15^oC\f$ level. +!! - In the temperature region between \f$-15^oC\f$ and \f$0^oC\f$, +!! clouds may be composed of liquid water or ice. If there are cloud +!! ice particles above this point at the previous or current time step, +!! or if the cloud at this point at the previous time step consists of +!! ice particles, then the cloud substance at this point is considered +!! to be ice particles because of the cloud seeding effect and the +!! memory of its content. Otherwise, all clouds in this region are +!! considered to contain supercooled cloud water. + +!-------------------ice-water id number iw------------------------------ + if(tmt0.lt.-15.0) then + u00ik = u(i,k) + fi = qik - u00ik*qi(i) + if(fi > d00.or.cwmik > climit) then + iw(i,k) = 1 + else + iw(i,k) = 0 + end if + end if +! + if(tmt0.ge.0.0) then + iw(i,k) = 0 + end if +! + if (tmt0 < 0.0 .and. tmt0 >= -15.0) then + iw(i,k) = 0 + if (k < km) then + if (iw(i,k+1) == 1 .and. cwmik > climit) iw(i,k) = 1 + endif + end if + enddo +!> -# Condensation and evaporation of cloud +!--------------condensation and evaporation of cloud-------------------- + do i = 1, im +!> - Compute the changes in t, q and p (\f$A_{t}\f$,\f$A_{q}\f$ and +!! \f$A_{p}\f$) caused by all the processes except grid-scale +!! condensation and evaporation. +!!\f[ +!! A_{t}=(t-tp)/dt +!!\f] +!!\f[ +!! A_{q}=(q-qp)/dt +!!\f] +!!\f[ +!! A_{p}=(prsl-\frac{prsl}{ps} \times psp)/dt +!!\f] +!------------------------at, aq and dp/dt------------------------------- + qik = max(q(i,k),epsq) + cwmik = max(cwm(i,k),climit) + iwik = iw(i,k) + u00ik = u(i,k) + tik = t(i,k) + pres = prsl(i,k) + pp0 = (pres / ps(i)) * psp(i) + at = (tik-tp(i,k)) * rdt + aq = (qik-qp(i,k)) * rdt + ap = (pres-pp0) * rdt +!> - Calculate the saturation specific humidity \f$q_{s}\f$ and the +!! relative humidity \f$f\f$ using IW. +!----------------the satuation specific humidity------------------------ + fiw = float(iwik) + elv = (h1-fiw)*elwv + fiw*eliv + qc = (h1-fiw)*qint(i) + fiw*qi(i) +! if (lprnt) print *,' qc=',qc,' qint=',qint(i),' qi=',qi(i) +!----------------the relative humidity---------------------------------- + if(qc.le.1.0e-10) then + rqik=d00 + else + rqik = qik/qc + endif + +!> - According to Sundqvist et al. (1989) \cite sundqvist_et_al_1989, +!! estimate cloud fraction \f$b\f$ at a grid point from relative +!! humidity \f$f\f$ using the equation +!!\f[ +!! b=1-\left ( \frac{f_{s}-f}{f_{s}-u} \right )^{1/2} +!!\f] +!! for \f$f>u\f$; and \f$b=0\f$ for \f$f1.0\times10^{-3}\f$, condense water vapor +!! into cloud condensate (\f$C_{g}\f$). +!!\n Using \f$q=fq_{s}\f$, \f$q_{s}=\epsilon e_{s}/p\f$, and the +!! Clausius-Clapeyron equation \f$de_{s}/dT=\epsilon Le_{s}/RT^{2}\f$, +!! where \f$q_{s}\f$ is the saturation specific humidity,\f$e_{s}\f$ +!! is the saturation vapor pressure, \f$R\f$ is the specific gas +!! constant for dry air, \f$f\f$ is the relative humidity, and +!! \f$\epsilon=0.622\f$, the expression for \f$C_{g}\f$ has the form +!!\f[ +!! C_{g}=\frac{M-q_{s}f_{t}}{1+(f\epsilon L^{2}q_{s}/RC_{p}T^{2})}+E_{c} +!!\f] +!! where +!!\f[ +!! M=A_{q}-\frac{f\epsilon Lq_{s}}{RT^{2}}A_{t}+\frac{fq_{s}}{p}A_{p} +!!\f] +!! To close the system, an equation for the relative humidity tendency +!! \f$f_{t}\f$ was derived by Sundqvist et al.(1989) +!! \cite sundqvist_et_al_1989 using the hypothesis that the quantity +!! \f$M+E_{c}\f$ is divided into one part,\f$bM\f$,which condenses +!! in the already cloudy portion of a grid square, and another part, +!! \f$(1-b)M+E_{c}\f$,which is used to increase the relative humidity +!! of the cloud-free portion and the cloudiness in the square. The +!! equation is written as +!!\f[ +!! f_{t}=\frac{2(1-b)(f_{s}-u)[(1-b)M+E_{c}]}{2q_{s}(1-b)(f_{s}-u)+cwm/b} +!!\f] +!! - Check and correct if over condensation occurs. +!! - Update t, q and cwm (according to Eqs(6) and (7) in Zhao and Carr (1997) +!! \cite zhao_and_carr_1997) +!!\f[ +!! cwm=cwm+(C_{g}-E_{c})\times dt +!!\f] +!!\f[ +!! q=q-(C_{g}-E_{c})\times dt +!!\f] +!!\f[ +!! t=t+\frac{L}{C_{p}}(C_{g}-E_{c})\times dt +!!\f] +!!\n where \f$L\f$ is the latent heat of condensation/deposition, and +!! \f$C_{p}\f$ is the specific heat of air at constant pressure. + +!----------------cloud cover ratio ccrik-------------------------------- + if (rqik .lt. u00ik) then + ccrik = d00 + elseif(rqik.ge.us) then + ccrik = us + else + rqikk = min(us,rqik) + ccrik = h1-sqrt((us-rqikk)/(us-u00ik)) + endif +!-----------correct ccr if it is too small in large cwm regions-------- +! if(ccrik.ge.0.01.and.ccrik.le.0.2.and +! & .cwmik.ge.0.2e-3) then +! ccrik=min(1.0,cwmik*1.0e3) +! end if +!---------------------------------------------------------------------- +! if no cloud exists then evaporate any existing cloud condensate +!----------------evaporation of cloud water----------------------------- + e0 = d00 + if (ccrik <= cclimit.and. cwmik > climit) then +! +! first iteration - increment halved +! + tx1 = tik + tx3 = qik +! + es = min(pres, fpvs(tx1)) + qs = u00ik * eps * es / (pres + epsm1*es) + tsq = tx1 * tx1 + delq = 0.5 * (qs - tx3) * tsq / (tsq + el2orc * qs) +! + tx2 = delq + tx1 = tx1 - delq * albycp + tx3 = tx3 + delq +! +! second iteration +! + es = min(pres, fpvs(tx1)) + qs = u00ik * eps * es / (pres + epsm1*es) + tsq = tx1 * tx1 + delq = (qs - tx3) * tsq / (tsq + el2orc * qs) +! + tx2 = tx2 + delq + tx1 = tx1 - delq * albycp + tx3 = tx3 + delq +! +! third iteration +! + es = min(pres, fpvs(tx1)) + qs = u00ik * eps * es / (pres + epsm1*es) + tsq = tx1 * tx1 + delq = (qs - tx3) * tsq / (tsq + el2orc * qs) + tx2 = tx2 + delq +! + e0 = max(tx2*rdt, cons_0) +! if (lprnt .and. i .eq. ipr .and. k .eq. 34) +! & print *,' tx2=',tx2,' qc=',qc,' u00ik=',u00ik,' rqik=',rqik +! &,' cwmik=',cwmik,' e0',e0 + +! e0 = max(qc*(u00ik-rqik)*rdt, cons_0) + e0 = min(cwmik*rdt, e0) + e0 = max(cons_0,e0) + end if +! if cloud cover > 0.2 condense water vapor in to cloud condensate +!-----------the eqs. for cond. has been reorganized to reduce cpu------ + cond = d00 +! if (ccrik .gt. 0.20 .and. qc .gt. epsq) then + if (ccrik .gt. cclimit .and. qc .gt. epsq) then + us00 = us - u00ik + ccrik1 = 1.0 - ccrik + aa = eps*elv*pres*qik + ab = ccrik*ccrik1*qc*us00 + ac = ab + 0.5*cwmik + ad = ab * ccrik1 + ae = cpr*tik*tik + af = ae * pres + ag = aa * elv + ai = cp * aa + cond = (ac-ad)*(af*aq-ai*at+ae*qik*ap)/(ac*(af+ag)) +!-----------check & correct if over condensation occurs----------------- + condi = (qik -u00ik *qc*1.0)*rdt + cond = min(cond, condi) +!----------check & correct if supersatuation is too high---------------- +! qtemp=qik-max(0.,(cond-e0))*dt +! if(qc.le.1.0e-10) then +! rqtmp=0.0 +! else +! rqtmp=qtemp/qc +! end if +! if(rqtmp.ge.1.10) then +! cond=(qik-1.10*qc)*rdt +! end if +!----------------------------------------------------------------------- + cond = max(cond, d00) +!-------------------update of t, q and cwm------------------------------ + end if + cone0 = (cond-e0) * dt + cwm(i,k) = cwm(i,k) + cone0 +! if (lprnt .and. i .eq. ipr) print *,' t=',t(i,k),' cone0',cone0 +! &,' cond=',cond,' e0=',e0,' elv=',elv,' rcp=',rcp,' k=',k +! &,' cwm=',cwm(i,k) + t(i,k) = t(i,k) + elv*rcp*cone0 + q(i,k) = q(i,k) - cone0 + enddo ! end of i-loop! + enddo ! end of k-loop! +! +!********************************************************************* +!> -# End of the condensation/evaporation loop (end of i-loop,k-loop). +!********************************************************************* +! +!> -# Store \f$t\f$, \f$q\f$, \f$ps\f$ for next time step. + + if (dt > dtf+0.001) then ! three time level + do k = 1, km + do i = 1, im + tp(i,k) = tp1(i,k) + qp(i,k) = qp1(i,k) +! + tp1(i,k) = t(i,k) + qp1(i,k) = max(q(i,k),epsq) + enddo + enddo + do i = 1, im + psp(i) = psp1(i) + psp1(i) = ps(i) + enddo + else ! two time level scheme - tp1, qp1, psp1 not used + do k = 1, km +! write(0,*)' in gscond k=',k,' im=',im,' km=',km + do i = 1, im +! write(0,*)' in gscond i=',i + tp(i,k) = t(i,k) + qp(i,k) = max(q(i,k),epsq) +! qp(i,k) = q(i,k) + tp1(i,k) = tp(i,k) + qp1(i,k) = qp(i,k) + enddo + enddo + do i = 1, im + psp(i) = ps(i) + psp1(i) = ps(i) + enddo + endif +!----------------------------------------------------------------------- + return + end subroutine zhaocarr_gscond_run +!> @} +!> @} + end module zhaocarr_gscond diff --git a/physics/module_MYNNSFC_wrapper.F90 b/physics/module_MYNNSFC_wrapper.F90 new file mode 100644 index 000000000..554a00e74 --- /dev/null +++ b/physics/module_MYNNSFC_wrapper.F90 @@ -0,0 +1,362 @@ +!> \file module_mynnsfc_wrapper.F90 +!! Contains all of the code related to running the MYNN surface layer scheme + + MODULE mynnsfc_wrapper + + contains + + subroutine mynnsfc_wrapper_init () + end subroutine mynnsfc_wrapper_init + + subroutine mynnsfc_wrapper_finalize () + end subroutine mynnsfc_wrapper_finalize + +!>\defgroup gsd_mynn_sfc GSD MYNN Surface Layer Scheme Module +!> \brief This scheme (1) performs pre-mynnsfc work, (2) runs the mynn sfc layer scheme, and (3) performs post-mynnsfc work +#if 0 +!! \section arg_table_mynnsfc_wrapper_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |---------------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| +!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | +!! | iter | ccpp_loop_counter | loop counter for subcycling loops in CCPP | index | 0 | integer | | in | F | +!! | flag_init | flag_for_first_time_step | flag signaling first time step for time integration loop | flag | 0 | logical | | in | F | +!! | flag_restart | flag_for_restart | flag for restart (warmstart) or coldstart | flag | 0 | logical | | in | F | +!! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | +!! | dx | cell_size | size of the grid cell | m | 1 | real | kind_phys | in | F | +!! | u | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | +!! | v | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | +!! | t3d | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | +!! | qvsh | water_vapor_specific_humidity | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | in | F | +!! | qc | cloud_condensed_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) | kg kg-1 | 2 | real | kind_phys | in | F | +!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | +!! | exner | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | +!! | tsq | t_prime_squared | temperature fluctuation squared | K2 | 2 | real | kind_phys | in | F | +!! | qsq | q_prime_squared | water vapor fluctuation squared | kg2 kg-2 | 2 | real | kind_phys | in | F | +!! | cov | t_prime_q_prime | covariance of temperature and moisture | K kg kg-1 | 2 | real | kind_phys | in | F | +!! | el_pbl | mixing_length | mixing length in meters | m | 2 | real | kind_phys | in | F | +!! | Sh3D | stability_function_for_heat | stability function for heat | none | 2 | real | kind_phys | in | F | +!! | QC_BL | subgrid_cloud_mixing_ratio_pbl | subgrid cloud cloud mixing ratio from PBL scheme | kg kg-1 | 2 | real | kind_phys | in | F | +!! | CLDFRA_BL | subgrid_cloud_fraction_pbl | subgrid cloud fraction from PBL scheme | frac | 2 | real | kind_phys | in | F | +!! | ps | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | +!! | PBLH | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | in | F | +!! | slmsk | sea_land_ice_mask_real | landmask: sea/land/ice=0/1/2 | flag | 1 | real | kind_phys | in | F | +!! | tsk | surface_skin_temperature | surface temperature | K | 1 | real | kind_phys | in | F | +!! | qsfc | surface_specific_humidity | surface air saturation specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | +!! | snowd | surface_snow_thickness_water_equivalent | water equivalent snow depth over land | mm | 1 | real | kind_phys | in | F | +!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | inout | F | +!! | ust | surface_friction_velocity | boundary layer parameter | m s-1 | 1 | real | kind_phys | inout | F | +!! | ustm | surface_friction_velocity_drag | friction velocity isolated for momentum only | m s-1 | 1 | real | kind_phys | inout | F | +!! | zol | surface_stability_parameter | monin obukhov surface stability parameter | none | 1 | real | kind_phys | inout | F | +!! | mol | theta_star | temperature flux divided by ustar (temperature scale) | K | 1 | real | kind_phys | inout | F | +!! | rmol | reciprocal_of_obukhov_length | one over obukhov length | m-1 | 1 | real | kind_phys | inout | F | +!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | inout | F | +!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | inout | F | +!! | fm10 | Monin-Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | inout | F | +!! | fh2 | Monin-Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | inout | F | +!! | wspd | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | inout | F | +!! | br | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | inout | F | +!! | ch | surface_drag_wind_speed_for_momentum_in_air | momentum exchange coefficient | m s-1 | 1 | real | kind_phys | inout | F | +!! | hflx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | inout | F | +!! | QFX | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | inout | F | +!! | lh | surface_latent_heat | latent heating at the surface (pos = up) | W m-2 | 1 | real | kind_phys | inout | F | +!! | flhc | surface_exchange_coefficient_for_heat | surface exchange coefficient for heat | W m-2 K-1 | 1 | real | kind_phys | inout | F | +!! | flqc | surface_exchange_coefficient_for_moisture | surface exchange coefficient for moisture | kg m-2 s-1 | 1 | real | kind_phys | inout | F | +!! | u10 | x_wind_at_10m | 10 meter u wind speed | m s-1 | 1 | real | kind_phys | inout | F | +!! | v10 | y_wind_at_10m | 10 meter v wind speed | m s-1 | 1 | real | kind_phys | inout | F | +!! | th2 | potential_temperature_at_2m | 2 meter potential temperature | K | 1 | real | kind_phys | inout | F | +!! | t2 | temperature_at_2m | 2 meter temperature | K | 1 | real | kind_phys | inout | F | +!! | q2 | specific_humidity_at_2m | 2 meter specific humidity | kg kg-1 | 1 | real | kind_phys | inout | F | +!! | wstar | surface_wind_enhancement_due_to_convection | surface wind enhancement due to convection | m s-1 | 1 | real | kind_phys | inout | F | +!! | chs2 | surface_exchange_coefficient_for_heat_at_2m | exchange coefficient for heat at 2 meters | m s-1 | 1 | real | kind_phys | inout | F | +!! | cqs2 | surface_exchange_coefficient_for_moisture_at_2m | exchange coefficient for moisture at 2 meters | m s-1 | 1 | real | kind_phys | inout | F | +!! | cda | surface_drag_coefficient_for_momentum_in_air | surface exchange coeff for momentum | none | 1 | real | kind_phys | inout | F | +!! | cka | surface_drag_coefficient_for_heat_and_moisture_in_air | surface exchange coeff heat & moisture | none | 1 | real | kind_phys | inout | F | +!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | inout | F | +!! | bl_mynn_cloudpdf | cloudpdf | flag to determine which cloud PDF to use | flag | 0 | integer | | in | F | +!! | icloud_bl | couple_sgs_clouds_to_radiation_flag | flag for coupling sgs clouds to radiation | flag | 0 | integer | | in | F | +!! | lprnt | flag_print | control flag for diagnostic print out | flag | 0 | logical | | none | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +#endif +!###=================================================================== +SUBROUTINE mynnsfc_wrapper_run( & + & ix,im,levs, & + & iter,flag_init,flag_restart, & + & delt,dx, & + & u, v, t3d, qvsh, qc, prsl, phii,& + & exner, tsq, qsq, cov, sh3d, & + & el_pbl, qc_bl, cldfra_bl, & + & ps, PBLH, slmsk, TSK, & + & QSFC, snowd, & + & zorl,UST,USTM, ZOL,MOL,RMOL, & + & fm, fh, fm10, fh2, WSPD, br, ch,& + & HFLX, QFX, LH, FLHC, FLQC, & + & U10, V10, TH2, T2, Q2, & + & wstar, CHS2, CQS2, & + & cda, cka, stress, & +! & CP, G, ROVCP, R, XLV, & +! & SVP1, SVP2, SVP3, SVPT0, & +! & EP1,EP2,KARMAN, & + & icloud_bl, bl_mynn_cloudpdf, & + & lprnt, errmsg, errflg ) + + +! should be moved to inside the mynn: + use machine , only : kind_phys +! use funcphys, only : fpvs + + use physcons, only : cp => con_cp, & + & g => con_g, & + & r_d => con_rd, & + & r_v => con_rv, & + & cpv => con_cvap, & + & cliq => con_cliq, & + & Cice => con_csol, & + & rcp => con_rocp, & + & XLV => con_hvap, & + & XLF => con_hfus, & + & EP_1 => con_fvirt, & + & EP_2 => con_eps + + USE module_sf_mynn, only : SFCLAY_mynn + +!------------------------------------------------------------------- + implicit none +!------------------------------------------------------------------- +! --- constant parameters: +! real(kind=kind_phys), parameter :: rvovrd = r_v/r_d + real(kind=kind_phys), parameter :: karman = 0.4 +! real(kind=kind_phys), parameter :: XLS = 2.85E6 +! real(kind=kind_phys), parameter :: p1000mb = 100000. + real(kind=kind_phys), parameter :: SVP1 = 0.6112 + real(kind=kind_phys), parameter :: SVP2 = 17.67 + real(kind=kind_phys), parameter :: SVP3 = 29.65 + real(kind=kind_phys), parameter :: SVPT0 = 273.15 + +!------------------------------------------------------------------- +!For WRF: +!------------------------------------------------------------------- +! USE module_model_constants, only: & +! &karman, g, p1000mb, & +! &cp, r_d, r_v, rcp, xlv, xlf, xls, & +! &svp1, svp2, svp3, svpt0, ep_1, ep_2, rvovrd, & +! &cpv, cliq, cice + +!------------------------------------------------------------------- +!For reference +! REAL , PARAMETER :: karman = 0.4 +! REAL , PARAMETER :: g = 9.81 +! REAL , PARAMETER :: r_d = 287. +! REAL , PARAMETER :: cp = 7.*r_d/2. +! REAL , PARAMETER :: r_v = 461.6 +! REAL , PARAMETER :: cpv = 4.*r_v +! REAL , PARAMETER :: cliq = 4190. +! REAL , PARAMETER :: Cice = 2106. +! REAL , PARAMETER :: rcp = r_d/cp +! REAL , PARAMETER :: XLS = 2.85E6 +! REAL , PARAMETER :: XLV = 2.5E6 +! REAL , PARAMETER :: XLF = 3.50E5 +! REAL , PARAMETER :: p1000mb = 100000. +! REAL , PARAMETER :: rvovrd = r_v/r_d +! REAL , PARAMETER :: SVP1 = 0.6112 +! REAL , PARAMETER :: SVP2 = 17.67 +! REAL , PARAMETER :: SVP3 = 29.65 +! REAL , PARAMETER :: SVPT0 = 273.15 +! REAL , PARAMETER :: EP_1 = R_v/R_d-1. +! REAL , PARAMETER :: EP_2 = R_d/R_v + + REAL, PARAMETER :: xlvcp=xlv/cp, xlscp=(xlv+xlf)/cp, ev=xlv, rd=r_d, & + &rk=cp/rd, svp11=svp1*1.e3, p608=ep_1, ep_3=1.-ep_2, g_inv=1/g + + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + +! NAMELIST OPTIONS (INPUT): + INTEGER, INTENT(IN) :: & + & bl_mynn_cloudpdf, & + & icloud_bl + +!MISC CONFIGURATION OPTIONS + INTEGER, PARAMETER :: & + & spp_pbl = 0, & + & isftcflx = 0, & + & iz0tlnd = 0, & + & isfflx = 1 + +!MYNN-1D + REAL :: delt + INTEGER :: im, ix, levs + INTEGER :: iter, k, i, itimestep + LOGICAL :: flag_init,flag_restart,lprnt + INTEGER :: IDS,IDE,JDS,JDE,KDS,KDE, & + & IMS,IME,JMS,JME,KMS,KME, & + & ITS,ITE,JTS,JTE,KTS,KTE + +!MYNN-3D + real(kind=kind_phys), dimension(im,levs+1) :: phii + real(kind=kind_phys), dimension(im,levs) :: & + & exner, PRSL, & + & u, v, t3d, qvsh, qc, & + & Sh3D, EL_PBL, EXCH_H, & + & qc_bl, cldfra_bl, & + & Tsq, Qsq, Cov + !LOCAL + real(kind=kind_phys), dimension(im,levs) :: & + & dz, rho, th, qv, & + & pattern_spp_pbl + +!MYNN-2D + real(kind=kind_phys), dimension(im) :: & + & dx, pblh, slmsk, tsk, qsfc, ps, & + & zorl, ust, ustm, hflx, qfx, br, wspd, snowd, & + & FLHC, FLQC, U10, V10, TH2, T2, Q2, & + & CHS2, CQS2, rmol, zol, mol, ch, & + & fm, fh, fm10, fh2, & + & lh, cda, cka, stress, wstar + !LOCAL + real, dimension(im) :: & + & qcg, hfx, znt, ts, snowh, psim, psih, & + & chs, ck, cd, mavail, regime, xland, GZ1OZ0 + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (lprnt) then + write(0,*)"==============================================" + write(0,*)"in mynn surface layer wrapper..." + write(0,*)"flag_init=",flag_init + write(0,*)"flag_restart=",flag_restart + write(0,*)"iter=",iter + endif + + ! If initialization is needed and mynnsfc_wrapper is called + ! in a subcycling loop, then test for (flag_init==.T. .and. iter==1); + ! initialization in sfclay_mynn is triggered by itimestep == 1 + ! DH* TODO: Use flag_restart to distinguish which fields need + ! to be initialized and which are read from restart files + if (flag_init.and.iter==1) then + itimestep = 1 + else + itimestep = 2 + endif + + !prep MYNN-only variables + do k=1,levs + do i=1,im + dz(i,k)=(phii(i,k+1) - phii(i,k))*g_inv + th(i,k)=t3d(i,k)/exner(i,k) + !qc(i,k)=MAX(qgrs(i,k,ntcw),0.0) + qv(i,k)=qvsh(i,k)/(1.0 - qvsh(i,k)) + rho(i,k)=prsl(i,k)/(r_d*t3d(i,k)) !gt0(i,k)) + pattern_spp_pbl(i,k)=0.0 + enddo + enddo + do i=1,im + if (slmsk(i)==1. .or. slmsk(i)==2.)then !sea/land/ice mask (=0/1/2) in FV3 + xland(i)=1.0 !but land/water = (1/2) in SFCLAY_mynn + else + xland(i)=2.0 + endif +! ust(i) = sqrt(stress(i)) + !ch(i)=0.0 + HFX(i)=hflx(i)*rho(i,1)*cp + !QFX(i)=evap(i) + !wstar(i)=0.0 + qcg(i)=0.0 + snowh(i)=snowd(i)*800. !mm -> m + znt(i)=zorl(i)*0.01 !cm -> m? + ts(i)=tsk(i)/exner(i,1) !theta +! qsfc(i)=qss(i) +! ps(i)=pgr(i) +! wspd(i)=wind(i) + mavail(i)=1.0 !???? + enddo + + if (lprnt) then + write(0,*)"CALLING SFCLAY_mynn; input:" + print*,"T:",t3d(1,1),t3d(1,2),t3d(1,3) + print*,"TH:",th(1,1),th(1,2),th(1,3) + print*,"rho:",rho(1,1),rho(1,2),rho(1,3) + print*,"u:",u(1,1:3) + !print*,"qv:",qv(1,1:3,1) + print*,"p:",prsl(1,1)," snowh=",snowh(1) + print*,"dz:",dz(1,1)," qsfc=",qsfc(1) + print*,"rmol:",rmol(1)," ust:",ust(1) + print*,"Tsk:",tsk(1)," Thetasurf:",ts(1) + print*,"HFX:",hfx(1)," qfx",qfx(1) + print*,"qsfc:",qsfc(1)," ps:",ps(1) + print*,"wspd:",wspd(1),"br=",br(1) + print*,"znt:",znt(1)," delt=",delt + print*,"im=",im," levs=",levs + print*,"flag_init=",flag_init !," ntcw=",ntcw!," ntk=",ntk + print*,"flag_restart=",flag_restart !," ntcw=",ntcw!," ntk=",ntk + print*,"iter=",iter + !print*,"ncld=",ncld," ntrac(gq0)=",ntrac + print*,"zlvl(1)=",dz(1,1)*0.5 + print*,"PBLH=",pblh(1)," xland=",xland(1) + endif + + + CALL SFCLAY_mynn( & + u3d=u,v3d=v,t3d=t3d,qv3d=qv,p3d=prsl,dz8w=dz, & + CP=cp,G=g,ROVCP=rcp,R=r_d,XLV=xlv, & + PSFCPA=ps,CHS=chs,CHS2=chs2,CQS2=cqs2, & + ZNT=znt,UST=ust,PBLH=pblh,MAVAIL=mavail, & + ZOL=zol,MOL=mol,REGIME=regime,psim=psim,psih=psih, & + psix=fm,psit=fh,psix10=fm10,psit2=fh2, & +! fm=psix,fh=psit,fm10=psix10,fh2=psit2, & + XLAND=xland,HFX=hfx,QFX=qfx,LH=lh,TSK=tsk, & + FLHC=flhc,FLQC=flqc,QSFC=qsfc,RMOL=rmol, & + U10=u10,V10=v10,TH2=th2,T2=t2,Q2=q2,SNOWH=snowh, & + GZ1OZ0=GZ1OZ0,WSPD=wspd,BR=br,ISFFLX=isfflx,DX=dx, & + SVP1=svp1,SVP2=svp2,SVP3=svp3,SVPT0=svpt0, & + EP1=ep_1,EP2=ep_2,KARMAN=karman, & + itimestep=itimestep,ch=ch, & + th3d=th,pi3d=exner,qc3d=qc,rho3d=rho, & + tsq=tsq,qsq=qsq,cov=cov,sh3d=sh3d,el_pbl=el_pbl, & + qcg=qcg,wstar=wstar, & + icloud_bl=icloud_bl,qc_bl=qc_bl,cldfra_bl=cldfra_bl, & + spp_pbl=spp_pbl,pattern_spp_pbl=pattern_spp_pbl, & + ids=1,ide=im, jds=1,jde=1, kds=1,kde=levs, & + ims=1,ime=im, jms=1,jme=1, kms=1,kme=levs, & + its=1,ite=im, jts=1,jte=1, kts=1,kte=levs, & + ustm=ustm, ck=ck, cka=cka, cd=cd, cda=cda, & + isftcflx=isftcflx, iz0tlnd=iz0tlnd, & + bl_mynn_cloudpdf=bl_mynn_cloudpdf ) + + + ! POST MYNN SURFACE LAYER (INTERSTITIAL) WORK: + do i = 1, im + hflx(i)=hfx(i)/(rho(i,1)*cp) + !QFX(i)=evap(i) + zorl(i)=znt(i)*100. !m -> cm + stress(i) = ust(i)**2 + enddo + + + if (lprnt) then + print* + print*,"finished with mynn_surface layer; output:" + print*,"xland=",xland(1)," cda=",cda(1) + print*,"rmol:",rmol(1)," ust:",ust(1) + print*,"Tsk:",tsk(1)," Thetasurf:",ts(1) + print*,"HFX:",hfx(1)," qfx",qfx(1) + print*,"qsfc:",qsfc(1)," ps:",ps(1) + print*,"wspd:",wspd(1)," br=",br(1) + print*,"znt:",znt(1),"pblh:",pblh(1) + print*,"FLHC=",FLHC(1)," CHS=",CHS(1) + print* + endif + + + END SUBROUTINE mynnsfc_wrapper_run + +!###================================================================= + +END MODULE mynnsfc_wrapper diff --git a/physics/moninshoc.f b/physics/moninshoc.f new file mode 100644 index 000000000..05473db6c --- /dev/null +++ b/physics/moninshoc.f @@ -0,0 +1,607 @@ +!> \file moninshoc.f +!! Contains most of the SHOC PBL/shallow convection scheme. + +!> This module contains the CCPP-compliant SHOC scheme. + module moninshoc + + contains + + subroutine moninshoc_init () + end subroutine moninshoc_init + + subroutine moninshoc_finalize () + end subroutine moninshoc_finalize + +!!!!! ========================================================== !!!!! +! subroutine 'moninshoc' computes pbl height and applies vertical diffusion +! using the coefficient provided by the SHOC scheme (from previous step) +! 2015-05-04 - Shrinivas Moorthi - original version based on monin +! 2018-03-21 - Shrinivas Moorthi - fixed a bug related to tke vertical diffusion +! and gneralized the tke location in tracer array +! 2018-03-23 - Shrinivas Moorthi - used twice the momentum diffusion coefficient +! for tke as in Deardorff (1980) - added tridi1 +! +!> \section arg_table_moninshoc_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| +!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | +!! | ntrac | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | +!! | ntcw | index_for_liquid_cloud_condensate | cloud condensate index in tracer array | index | 0 | integer | | in | F | +!! | ncnd | number_of_tracers_for_cloud_condensate | number of tracers for cloud condensate | count | 0 | integer | | in | F | +!! | dv | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | +!! | du | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | +!! | tau | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | +!! | rtg | tendency_of_vertically_diffused_tracer_concentration | updated tendency of the tracers due to vertical diffusion in PBL scheme | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | +!! | u1 | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | +!! | v1 | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | +!! | t1 | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | +!! | q1 | vertically_diffused_tracer_concentration | tracer concentration diffused by PBL scheme | kg kg-1 | 3 | real | kind_phys | in | F | +!! | tkh | atmosphere_heat_diffusivity_from_shoc | diffusivity for heat from the SHOC scheme | m2 s-1 | 2 | real | kind_phys | in | F | +!! | prnum | prandtl_number | turbulent Prandtl number | none | 2 | real | kind_phys | inout | F | +!! | ntke | index_for_turbulent_kinetic_energy | tracer index for turbulent kinetic energy | index | 0 | integer | | in | F | +!! | psk | dimensionless_exner_function_at_lowest_model_interface | dimensionless Exner function at the surface interface | none | 1 | real | kind_phys | in | F | +!! | rbsoil | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | +!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | +!! | u10m | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | +!! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | +!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | +!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | +!! | tsea | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | +!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | +!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | +!! | spd1 | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | +!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | +!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | +!! | del | air_pressure_difference_between_midlayers | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | +!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | prslk | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | +!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | +!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | +!! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | +!! | dusfc | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | +!! | dvsfc | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | +!! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | dkt | atmosphere_heat_diffusivity | diffusivity for heat | m2 s-1 | 2 | real | kind_phys | out | F | +!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | +!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | in | F | +!! | xkzm_m | atmosphere_momentum_diffusivity_background | background value of momentum diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | +!! | xkzm_h | atmosphere_heat_diffusivity_background | background value of heat diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | +!! | xkzm_s | diffusivity_background_sigma_level | sigma level threshold for background diffusivity | none | 0 | real | kind_phys | in | F | +!! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | +!! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | +!! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | +!! | grav | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | +!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | +!! | fv | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine moninshoc_run (ix,im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, + & u1,v1,t1,q1,tkh,prnum,ntke, + & psk,rbsoil,zorl,u10m,v10m,fm,fh, + & tsea,heat,evap,stress,spd1,kpbl, + & prsi,del,prsl,prslk,phii,phil,delt, + & dusfc,dvsfc,dtsfc,dqsfc,dkt,hpbl, + & kinver,xkzm_m,xkzm_h,xkzm_s,lprnt,ipr,me, + & grav, rd, cp, hvap, fv, + & errmsg,errflg) +! + use machine , only : kind_phys + use funcphys , only : fpvs + + implicit none +! +! arguments +! + logical, intent(in) :: lprnt + integer, intent(in) :: ix, im, + & km, ntrac, ntcw, ncnd, ntke, ipr, me + integer, dimension(im), intent(in) :: kinver + + real(kind=kind_phys), intent(in) :: delt, + & xkzm_m, xkzm_h, xkzm_s + real(kind=kind_phys), intent(in) :: grav, + & rd, cp, hvap, fv + real(kind=kind_phys), dimension(im), intent(in) :: psk, + & rbsoil, zorl, u10m, v10m, fm, fh, tsea, heat, evap, stress, spd1 + real(kind=kind_phys), dimension(ix,km), intent(in) :: u1, v1, + & t1, tkh, del, prsl, phil, prslk + real(kind=kind_phys), dimension(ix,km+1), intent(in) :: prsi, phii + real(kind=kind_phys), dimension(ix,km,ntrac), intent(in) :: q1 + + real(kind=kind_phys), dimension(im,km), intent(inout) :: du, dv, + & tau, prnum + real(kind=kind_phys), dimension(im,km,ntrac), intent(inout) :: rtg + + integer, dimension(im), intent(out) :: kpbl + real(kind=kind_phys), dimension(im), intent(out) :: dusfc, + & dvsfc, dtsfc, dqsfc, hpbl + real(kind=kind_phys), dimension(im,km-1), intent(out) :: dkt + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +! +! locals +! + integer i,is,k,kk,km1,kmpbl,kp1, ntloc +! + logical pblflg(im), sfcflg(im), flg(im) + + real(kind=kind_phys), dimension(im) :: phih, phim + &, rbdn, rbup, sflux, z0, crb, zol, thermal + &, beta, tx1 +! + real(kind=kind_phys), dimension(im,km) :: theta, thvx, zl, a1, ad + &, dt2odel + real(kind=kind_phys), dimension(im,km-1):: xkzo, xkzmo, al, au + &, dku, rdzt +! + real(kind=kind_phys) zi(im,km+1), a2(im,km*(ntrac+1)) +! + real(kind=kind_phys) dsdz2, dsdzq, dsdzt, dsig, dt2, rdt + &, dtodsd, dtodsu, rdz, tem, tem1 + &, ttend, utend, vtend, qtend + &, spdk2, rbint, ri, zol1, robn, bvf2 +! + real(kind=kind_phys), parameter :: zolcr=0.2, + & zolcru=-0.5, rimin=-100., sfcfrac=0.1, + & crbcon=0.25, crbmin=0.15, crbmax=0.35, + & qmin=1.e-8, zfmin=1.e-8, qlmin=1.e-12, + & aphi5=5., aphi16=16., f0=1.e-4 + &, dkmin=0.0, dkmax=1000. +! &, dkmin=0.0, dkmax=1000., xkzminv=0.3 + &, prmin=0.25, prmax=4.0 + &, vk=0.4, cfac=6.5 + real(kind=kind_phys) :: gravi, cont, conq, conw, gocp + + gravi = 1.0/grav + cont = cp/grav + conq = hvap/grav + conw = 1.0/grav + gocp = grav/cp + +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 +! +!----------------------------------------------------------------------- +! +! compute preliminary variables +! + if (ix < im) stop +! +! if (lprnt) write(0,*)' in moninshoc tsea=',tsea(ipr) + dt2 = delt + rdt = 1. / dt2 + km1 = km - 1 + kmpbl = km / 2 +! + do k=1,km + do i=1,im + zi(i,k) = phii(i,k) * gravi + zl(i,k) = phil(i,k) * gravi + dt2odel(i,k) = dt2 / del(i,k) + enddo + enddo + do i=1,im + zi(i,km+1) = phii(i,km+1) * gravi + enddo +! + do k = 1,km1 + do i=1,im + rdzt(i,k) = 1.0 / (zl(i,k+1) - zl(i,k)) + prnum(i,k) = 1.0 + enddo + enddo +! Setup backgrond diffision + do i=1,im + prnum(i,km) = 1.0 + tx1(i) = 1.0 / prsi(i,1) + enddo + do k = 1,km1 + do i=1,im + xkzo(i,k) = 0.0 + xkzmo(i,k) = 0.0 + if (k < kinver(i)) then +! vertical background diffusivity for heat and momentum + tem1 = 1.0 - prsi(i,k+1) * tx1(i) + tem1 = min(1.0, exp(-tem1 * tem1 * 10.0)) + xkzo(i,k) = xkzm_h * tem1 + xkzmo(i,k) = xkzm_m * tem1 + endif + enddo + enddo +! if (lprnt) then +! print *,' xkzo=',(xkzo(ipr,k),k=1,km1) +! print *,' xkzmo=',(xkzmo(ipr,k),k=1,km1) +! endif +! +! diffusivity in the inversion layer is set to be xkzminv (m^2/s) +! +! do k = 1,kmpbl +! do i=1,im +! if(zi(i,k+1) > 250.) then +! tem1 = (t1(i,k+1)-t1(i,k)) * rdzt(i,k) +! if(tem1 > 1.e-5) then +! xkzo(i,k) = min(xkzo(i,k),xkzminv) +! endif +! endif +! enddo +! enddo +! +! + do i = 1,im + z0(i) = 0.01 * zorl(i) + kpbl(i) = 1 + hpbl(i) = zi(i,1) + pblflg(i) = .true. + sfcflg(i) = .true. + if(rbsoil(i) > 0.) sfcflg(i) = .false. + dusfc(i) = 0. + dvsfc(i) = 0. + dtsfc(i) = 0. + dqsfc(i) = 0. + enddo +! + do k = 1,km + do i=1,im + tx1(i) = 0.0 + enddo + do kk=1,ncnd + do i=1,im + tx1(i) = tx1(i) + max(q1(i,k,ntcw+kk-1), qlmin) + enddo + enddo + do i = 1,im + theta(i,k) = t1(i,k) * psk(i) / prslk(i,k) + thvx(i,k) = theta(i,k)*(1.+fv*max(q1(i,k,1),qmin)-tx1(i)) + enddo + enddo +! +! if (lprnt) write(0,*)' heat=',heat(ipr),' evap=',evap(ipr) + do i = 1,im + sflux(i) = heat(i) + evap(i)*fv*theta(i,1) + if(.not.sfcflg(i) .or. sflux(i) <= 0.) pblflg(i)=.false. + beta(i) = dt2 / (zi(i,2)-zi(i,1)) + enddo +! +! compute the pbl height +! +! write(0,*)' IN moninbl u10=',u10m(1:5),' v10=',v10m(1:5) + do i=1,im + flg(i) = .false. + rbup(i) = rbsoil(i) +! + if(pblflg(i)) then + thermal(i) = thvx(i,1) + crb(i) = crbcon + else + thermal(i) = tsea(i)*(1.+fv*max(q1(i,1,1),qmin)) + tem = max(1.0, sqrt(u10m(i)*u10m(i) + v10m(i)*v10m(i))) + robn = tem / (f0 * z0(i)) + tem1 = 1.e-7 * robn + crb(i) = max(min(0.16 * (tem1 ** (-0.18)), crbmax), crbmin) + endif + enddo + do k = 1, kmpbl + do i = 1, im + if(.not.flg(i)) then + rbdn(i) = rbup(i) + spdk2 = max((u1(i,k)*u1(i,k)+v1(i,k)*v1(i,k)), 1.) + rbup(i) = (thvx(i,k)-thermal(i))*phil(i,k) + & / (thvx(i,1)*spdk2) + kpbl(i) = k + flg(i) = rbup(i) > crb(i) + endif + enddo + enddo + do i = 1,im + if(kpbl(i) > 1) then + k = kpbl(i) + if(rbdn(i) >= crb(i)) then + rbint = 0. + elseif(rbup(i) <= crb(i)) then + rbint = 1. + else + rbint = (crb(i)-rbdn(i)) / (rbup(i)-rbdn(i)) + endif + hpbl(i) = zl(i,k-1) + rbint*(zl(i,k)-zl(i,k-1)) + if(hpbl(i) < zi(i,kpbl(i))) kpbl(i) = kpbl(i) - 1 + else + hpbl(i) = zl(i,1) + kpbl(i) = 1 + endif + enddo +! +! compute similarity parameters +! + do i=1,im + zol(i) = max(rbsoil(i)*fm(i)*fm(i)/fh(i),rimin) + if(sfcflg(i)) then + zol(i) = min(zol(i),-zfmin) + else + zol(i) = max(zol(i),zfmin) + endif + zol1 = zol(i)*sfcfrac*hpbl(i)/zl(i,1) + if(sfcflg(i)) then +! phim(i) = (1.-aphi16*zol1)**(-1./4.) +! phih(i) = (1.-aphi16*zol1)**(-1./2.) + tem = 1.0 / max(1. - aphi16*zol1, 1.0e-8) + phih(i) = sqrt(tem) + phim(i) = sqrt(phih(i)) + else + phim(i) = 1. + aphi5*zol1 + phih(i) = phim(i) + endif + enddo +! +! enhance the pbl height by considering the thermal excess +! + do i=1,im + flg(i) = .true. + if (pblflg(i)) then + flg(i) = .false. + rbup(i) = rbsoil(i) + endif + enddo + do k = 2, kmpbl + do i = 1, im + if(.not.flg(i)) then + rbdn(i) = rbup(i) + spdk2 = max((u1(i,k)*u1(i,k)+v1(i,k)*v1(i,k)), 1.) + rbup(i) = (thvx(i,k)-thermal(i)) * phil(i,k) + & / (thvx(i,1)*spdk2) + kpbl(i) = k + flg(i) = rbup(i) > crb(i) + endif + enddo + enddo + do i = 1,im + if (pblflg(i)) then + k = kpbl(i) + if(rbdn(i) >= crb(i)) then + rbint = 0. + elseif(rbup(i) <= crb(i)) then + rbint = 1. + else + rbint = (crb(i)-rbdn(i)) / (rbup(i)-rbdn(i)) + endif + if (k > 1) then + hpbl(i) = zl(i,k-1) + rbint*(zl(i,k)-zl(i,k-1)) + if(hpbl(i) < zi(i,kpbl(i))) kpbl(i) = kpbl(i) - 1 + if(kpbl(i) <= 1) then + pblflg(i) = .false. + endif + else + pblflg(i) = .false. + endif + endif + if (pblflg(i)) then + tem = phih(i)/phim(i) + cfac*vk*sfcfrac + else + tem = phih(i)/phim(i) + endif + prnum(i,1) = min(prmin,max(prmax,tem)) + enddo +! + do i = 1, im + if(zol(i) > zolcr) then + kpbl(i) = 1 + endif + enddo +! +! compute Prandtl number above boundary layer +! + do k = 1, km1 + kp1 = k + 1 + do i=1,im + if(k >= kpbl(i)) then + rdz = rdzt(i,k) + tem = u1(i,k) - u1(i,kp1) + tem1 = v1(i,k) - v1(i,kp1) + tem = (tem*tem + tem1*tem1) * rdz * rdz + bvf2 = (0.5*grav)*(thvx(i,kp1)-thvx(i,k))*rdz + & / (t1(i,k)+t1(i,kp1)) + ri = max(bvf2/tem,rimin) + if(ri < 0.) then ! unstable regime + prnum(i,kp1) = 1.0 + else + prnum(i,kp1) = min(1.0 + 2.1*ri, prmax) + endif + elseif (k > 1) then + prnum(i,kp1) = prnum(i,1) + endif +! +! prnum(i,kp1) = 1.0 + prnum(i,kp1) = max(prmin, min(prmax, prnum(i,kp1))) + tem = tkh(i,kp1) * prnum(i,kp1) + dku(i,k) = max(min(tem+xkzmo(i,k), dkmax), xkzmo(i,k)) + dkt(i,k) = max(min(tkh(i,kp1)+xkzo(i,k), dkmax), xkzo(i,k)) + enddo + enddo +! +! compute tridiagonal matrix elements for heat and moisture +! + do i=1,im + ad(i,1) = 1. + a1(i,1) = t1(i,1) + beta(i) * heat(i) + a2(i,1) = q1(i,1,1) + beta(i) * evap(i) + enddo +! if (lprnt) write(0,*)' a1=',a1(ipr,1),' beta=',beta(ipr) +! &,' heat=',heat(ipr), ' t1=',t1(ipr,1) + + ntloc = 1 + if(ntrac > 1) then + is = 0 + do k = 2, ntrac + if (k /= ntke) then + ntloc = ntloc + 1 + is = is + km + do i = 1, im + a2(i,1+is) = q1(i,1,k) + enddo + endif + enddo + endif +! + do k = 1,km1 + kp1 = k + 1 + do i = 1,im + dtodsd = dt2odel(i,k) + dtodsu = dt2odel(i,kp1) + dsig = prsl(i,k)-prsl(i,kp1) + rdz = rdzt(i,k) + tem1 = dsig * dkt(i,k) * rdz + dsdz2 = tem1 * rdz + au(i,k) = -dtodsd*dsdz2 + al(i,k) = -dtodsu*dsdz2 +! + ad(i,k) = ad(i,k)-au(i,k) + ad(i,kp1) = 1.-al(i,k) + dsdzt = tem1 * gocp + a1(i,k) = a1(i,k) + dtodsd*dsdzt + a1(i,kp1) = t1(i,kp1) - dtodsu*dsdzt + a2(i,kp1) = q1(i,kp1,1) +! + enddo + enddo +! + if(ntrac > 1) then + is = 0 + do kk = 2, ntrac + if (kk /= ntke) then + is = is + km + do k = 1, km1 + kp1 = k + 1 + do i = 1, im + a2(i,kp1+is) = q1(i,kp1,kk) + enddo + enddo + endif + enddo + endif +! +! solve tridiagonal problem for heat and moisture +! + call tridin(im,km,ntloc,al,ad,au,a1,a2,au,a1,a2) + +! +! recover tendencies of heat and moisture +! + do k = 1,km + do i = 1,im + ttend = (a1(i,k)-t1(i,k)) * rdt + qtend = (a2(i,k)-q1(i,k,1)) * rdt + tau(i,k) = tau(i,k) + ttend +! if(lprnt .and. i==ipr .and. k<11) write(0,*)' tau=',tau(ipr,k) +! &,' ttend=',ttend,' a1=',a1(ipr,k),' t1=',t1(ipr,k) + rtg(i,k,1) = rtg(i,k,1) + qtend + dtsfc(i) = dtsfc(i) + cont*del(i,k)*ttend + dqsfc(i) = dqsfc(i) + conq*del(i,k)*qtend + enddo + enddo + if(ntrac > 1) then + is = 0 + do kk = 2, ntrac + if (kk /= ntke) then + is = is + km + do k = 1, km + do i = 1, im + qtend = (a2(i,k+is)-q1(i,k,kk))*rdt + rtg(i,k,kk) = rtg(i,k,kk) + qtend + enddo + enddo + endif + enddo + endif +! +! compute tridiagonal matrix elements for momentum +! + do i=1,im + ad(i,1) = 1.0 + beta(i) * stress(i) / spd1(i) + a1(i,1) = u1(i,1) + a2(i,1) = v1(i,1) + enddo +! + do k = 1,km1 + kp1 = k + 1 + do i=1,im + dtodsd = dt2odel(i,k) + dtodsu = dt2odel(i,kp1) + dsig = prsl(i,k)-prsl(i,kp1) + rdz = rdzt(i,k) + tem1 = dsig*dku(i,k)*rdz + dsdz2 = tem1 * rdz + au(i,k) = -dtodsd*dsdz2 + al(i,k) = -dtodsu*dsdz2 +! + ad(i,k) = ad(i,k) - au(i,k) + ad(i,kp1) = 1.0 - al(i,k) + a1(i,kp1) = u1(i,kp1) + a2(i,kp1) = v1(i,kp1) +! + enddo + enddo + + call tridi2(im,km,al,ad,au,a1,a2,au,a1,a2) +! +! recover tendencies of momentum +! + do k = 1,km + do i = 1,im + utend = (a1(i,k)-u1(i,k))*rdt + vtend = (a2(i,k)-v1(i,k))*rdt + du(i,k) = du(i,k) + utend + dv(i,k) = dv(i,k) + vtend + dusfc(i) = dusfc(i) + conw*del(i,k)*utend + dvsfc(i) = dvsfc(i) + conw*del(i,k)*vtend + enddo + enddo +! + if (ntke > 0) then ! solve tridiagonal problem for momentum and tke +! +! compute tridiagonal matrix elements for tke +! + do i=1,im + ad(i,1) = 1.0 + a1(i,1) = q1(i,1,ntke) + enddo +! + do k = 1,km1 + kp1 = k + 1 + do i=1,im + dtodsd = dt2odel(i,k) + dtodsu = dt2odel(i,kp1) + dsig = prsl(i,k)-prsl(i,kp1) + rdz = rdzt(i,k) + tem1 = dsig*dku(i,k)*(rdz+rdz) + dsdz2 = tem1 * rdz + au(i,k) = -dtodsd*dsdz2 + al(i,k) = -dtodsu*dsdz2 +! + ad(i,k) = ad(i,k) - au(i,k) + ad(i,kp1) = 1.0 - al(i,k) + a1(i,kp1) = q1(i,kp1,ntke) + enddo + enddo + + call tridi1(im,km,al,ad,au,a1,au,a1) +! + do k = 1, km ! recover tendencies of tke + do i = 1, im + qtend = (a1(i,k)-q1(i,k,ntke))*rdt + rtg(i,k,ntke) = rtg(i,k,ntke) + qtend + enddo + enddo + endif +! + return + end subroutine moninshoc_run + + end module moninshoc diff --git a/physics/ozphys.f b/physics/ozphys.f new file mode 100644 index 000000000..4acf87107 --- /dev/null +++ b/physics/ozphys.f @@ -0,0 +1,202 @@ +!> \file ozphys.f +!! This file is ozone sources and sinks (previous version). + + +!> This module contains the CCPP-compliant Ozone photochemistry scheme. + module ozphys + + contains + +! \brief Brief description of the subroutine +! +!> \section arg_table_ozphys_init Argument Table +!! + subroutine ozphys_init() + end subroutine ozphys_init + +! \brief Brief description of the subroutine +! +!> \section arg_table_ozphys_finalize Argument Table +!! + subroutine ozphys_finalize() + end subroutine ozphys_finalize + + +!>\defgroup GFS_ozphys GFS ozphys Main +!! \brief The operational GFS currently parameterizes ozone production and +!! destruction based on monthly mean coefficients (\c global_o3prdlos.f77) provided by Naval +!! Research Laboratory through CHEM2D chemistry model +!! (McCormack et al. (2006) \cite mccormack_et_al_2006). +!! \section arg_table_ozphys_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|---------------------------------------------------------------------------|----------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| +!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | +!! | ko3 | vertical_dimension_of_ozone_forcing_data | number of vertical layers in ozone forcing data | count | 0 | integer | | in | F | +!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | +!! | oz | ozone_concentration_updated_by_physics | ozone concentration updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | tin | air_temperature_updated_by_physics | updated air temperature | K | 2 | real | kind_phys | in | F | +!! | po3 | natural_log_of_ozone_forcing_data_pressure_levels | natural log of ozone forcing data pressure levels | log(Pa) | 1 | real | kind_phys | in | F | +!! | prsl | air_pressure | mid-layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | prdout | ozone_forcing | ozone forcing coefficients | various | 3 | real | kind_phys | in | F | +!! | oz_coeff | number_of_coefficients_in_ozone_forcing_data | number of coefficients in ozone forcing data | index | 0 | integer | | in | F | +!! | delp | air_pressure_difference_between_midlayers | difference between mid-layer pressures | Pa | 2 | real | kind_phys | in | F | +!! | ldiag3d | flag_diagnostics_3D | flag for calculating 3-D diagnostic fields | flag | 0 | logical | | in | F | +!! | ozp1 | cumulative_change_in_ozone_concentration_due_to_production_and_loss_rate | cumulative change in ozone concentration due to production and loss rate | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | ozp2 | cumulative_change_in_ozone_concentration_due_to_ozone_mixing_ratio | cumulative change in ozone concentration due to ozone mixing ratio | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | ozp3 | cumulative_change_in_ozone_concentration_due_to_temperature | cumulative change in ozone concentration due to temperature | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | ozp4 | cumulative_change_in_ozone_concentration_due_to_overhead_ozone_column | cumulative change in ozone concentration due to overhead ozone column | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | +!! | me | mpi_rank | rank of the current MPI task | index | 0 | integer | | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +!> \section genal_ozphys GFS ozphys_run General Algorithm +!> @{ + subroutine ozphys_run ( & + & ix, im, levs, ko3, dt, oz, tin, po3, & + & prsl, prdout, oz_coeff, delp, ldiag3d, & + & ozp1, ozp2, ozp3, ozp4, con_g, me, errmsg, errflg) +! +! this code assumes that both prsl and po3 are from bottom to top +! as are all other variables +! + use machine , only : kind_phys + implicit none +! + ! Interface variables + integer, intent(in) :: im, ix, levs, ko3, oz_coeff, me + real(kind=kind_phys), intent(inout) :: & + & oz(ix,levs) + ! These arrays may not be allocated and need assumed array sizes + real(kind=kind_phys), intent(inout) :: & + & ozp1(:,:), ozp2(:,:), ozp3(:,:), ozp4(:,:) + real(kind=kind_phys), intent(in) :: & + & dt, po3(ko3), prdout(ix,ko3,oz_coeff), & + & prsl(ix,levs), tin(ix,levs), delp(ix,levs), & + & con_g + real :: gravi + logical, intent(in) :: ldiag3d + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +! + ! Local variables + integer k,kmax,kmin,l,i,j + logical flg(im) + real(kind=kind_phys) pmax, pmin, tem, temp + real(kind=kind_phys) wk1(im), wk2(im), wk3(im), prod(im,oz_coeff), + & ozib(im), colo3(im,levs+1), ozi(ix,levs) +! + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 +! +! save input oz in ozi + ozi = oz + gravi=1.0/con_g +! +!> - Calculate vertical integrated column ozone values. + if (oz_coeff > 2) then + colo3(:,levs+1) = 0.0 + do l=levs,1,-1 + do i=1,im + colo3(i,l) = colo3(i,l+1) + ozi(i,l) * delp(i,l) * gravi + enddo + enddo + endif +! +!> - Apply vertically linear interpolation to the ozone coefficients. + do l=1,levs + pmin = 1.0e10 + pmax = -1.0e10 +! + do i=1,im + wk1(i) = log(prsl(i,l)) + pmin = min(wk1(i), pmin) + pmax = max(wk1(i), pmax) + prod(i,:) = 0.0 + enddo + kmax = 1 + kmin = 1 + do k=1,ko3-1 + if (pmin < po3(k)) kmax = k + if (pmax < po3(k)) kmin = k + enddo +! + do k=kmin,kmax + temp = 1.0 / (po3(k) - po3(k+1)) + do i=1,im + flg(i) = .false. + if (wk1(i) < po3(k) .and. wk1(i) >= po3(k+1)) then + flg(i) = .true. + wk2(i) = (wk1(i) - po3(k+1)) * temp + wk3(i) = 1.0 - wk2(i) + endif + enddo + do j=1,oz_coeff + do i=1,im + if (flg(i)) then + prod(i,j) = wk2(i) * prdout(i,k,j) + & + wk3(i) * prdout(i,k+1,j) + endif + enddo + enddo + enddo +! + do j=1,oz_coeff + do i=1,im + if (wk1(i) < po3(ko3)) then + prod(i,j) = prdout(i,ko3,j) + endif + if (wk1(i) >= po3(1)) then + prod(i,j) = prdout(i,1,j) + endif + enddo + enddo + + if (oz_coeff == 2) then + do i=1,im + ozib(i) = ozi(i,l) ! no filling + oz(i,l) = (ozib(i) + prod(i,1)*dt) / (1.0 + prod(i,2)*dt) + enddo +! + !if (ldiag3d) then ! ozone change diagnostics + ! do i=1,im + ! ozp1(i,l) = ozp1(i,l) + prod(i,1)*dt + ! ozp2(i,l) = ozp2(i,l) + (oz(i,l) - ozib(i)) + ! enddo + !endif + endif +!> - Calculate the 4 terms of prognostic ozone change during time \a dt: +!! - ozp1(:,:) - Ozone production from production/loss ratio +!! - ozp2(:,:) - Ozone production from ozone mixing ratio +!! - ozp3(:,:) - Ozone production from temperature term at model layers +!! - ozp4(:,:) - Ozone production from column ozone term at model layers + if (oz_coeff == 4) then + do i=1,im + ozib(i) = ozi(i,l) ! no filling + tem = prod(i,1) + prod(i,3)*tin(i,l) + & + prod(i,4)*colo3(i,l+1) +! if (me .eq. 0) print *,'ozphys tem=',tem,' prod=',prod(i,:) +! &,' ozib=',ozib(i),' l=',l,' tin=',tin(i,l),'colo3=',colo3(i,l+1) + oz(i,l) = (ozib(i) + tem*dt) / (1.0 + prod(i,2)*dt) + enddo + !if (ldiag3d) then ! ozone change diagnostics + ! do i=1,im + ! ozp1(i,l) = ozp1(i,l) + prod(i,1)*dt + ! ozp2(i,l) = ozp2(i,l) + (oz(i,l) - ozib(i)) + ! ozp3(i,l) = ozp3(i,l) + prod(i,3)*tin(i,l)*dt + ! ozp4(i,l) = ozp4(i,l) + prod(i,4)*colo3(i,l+1)*dt + ! enddo + !endif + endif + + enddo ! vertical loop +! + return + end subroutine ozphys_run +!> @} + + end module ozphys diff --git a/physics/precpd.f b/physics/precpd.f new file mode 100644 index 000000000..9e8f5b696 --- /dev/null +++ b/physics/precpd.f @@ -0,0 +1,735 @@ +!> \file precpd.f +!! This file contains the subroutine that calculates precipitation +!! processes from suspended cloud water/ice. + +!> This module contains the CCPP-compliant zhao_carr_precpd scheme. + module zhaocarr_precpd + contains + +!! \brief Brief description of the subroutine +!! +!! \section arg_table_zhaocarr_precpd_init Argument Table +!! + subroutine zhaocarr_precpd_init () + end subroutine zhaocarr_precpd_init + +!> \defgroup precip GFS precpd Main +!! \brief This subroutine computes the conversion from condensation to +!! precipitation (snow or rain) or evaporation of rain. +!! +!! \section arg_table_zhaocarr_precpd_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|---------------------------------------------------------------|-------------------------------------------------------------------|-------------|------|-----------|-----------|--------|----------| +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | +!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | +!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | +!! | del | air_pressure_difference_between_midlayers | pressure level thickness | Pa | 2 | real | kind_phys | in | F | +!! | prsl | air_pressure | layer mean pressure | Pa | 2 | real | kind_phys | in | F | +!! | q | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | cwm | cloud_condensed_water_mixing_ratio_updated_by_physics | moist cloud condensed water mixing ratio | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | t | air_temperature_updated_by_physics | layer mean air temperature | K | 2 | real | kind_phys | inout | F | +!! | rn | lwe_thickness_of_explicit_precipitation_amount | explicit precipitation amount on physics timestep | m | 1 | real | kind_phys | out | F | +!! | sr | ratio_of_snowfall_to_rainfall | ratio of snowfall to large-scale rainfall | frac | 1 | real | kind_phys | out | F | +!! | rainp | tendency_of_rain_water_mixing_ratio_due_to_microphysics | tendency of rain water mixing ratio due to microphysics | kg kg-1 s-1 | 2 | real | kind_phys | out | F | +!! | u00k | critical_relative_humidity | critical relative humidity | frac | 2 | real | kind_phys | in | F | +!! | psautco | coefficient_from_cloud_ice_to_snow | conversion coefficient from cloud ice to snow | none | 1 | real | kind_phys | in | F | +!! | prautco | coefficient_from_cloud_water_to_rain | conversion coefficient from cloud water to rain | none | 1 | real | kind_phys | in | F | +!! | evpco | coefficient_for_evaporation_of_rainfall | coefficient for evaporation of rainfall | none | 0 | real | kind_phys | in | F | +!! | wminco | cloud_condensed_water_conversion_threshold | conversion coefficient from cloud liquid and ice to precipitation | none | 1 | real | kind_phys | in | F | +!! | wk1 | grid_size_related_coefficient_used_in_scale-sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | +!! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | +!! | jpr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +!> \section general_precpd GFS precpd Scheme General Algorithm +!! The following two equations can be used to calculate the +!! precipitation rates of rain and snow at each model level: +!!\f[ +!! P_{r}(\eta)=\frac{p_{s}-p_{t}}{g\eta_{s}}\int_{\eta}^{\eta_{t}}(P_{raut}+P_{racw}+P_{sacw}+P_{sm1}+P_{sm2}-E_{rr})d\eta +!! \f] +!! and +!! \f[ +!! P_{s}(\eta)=\frac{p_{s}-p_{t}}{g\eta_{s}}\int_{\eta}^{\eta_{t}}(P_{saut}+P_{saci}-P_{sm1}-P_{sm2}-E_{rs})d\eta +!! \f] +!! where \f$p_{s}\f$ and\f$p_{t}\f$ are the surface pressure and the +!! pressure at the top of model domain, respectively, and \f$g\f$ is +!! gravity. The implementation of the precipitation scheme also +!! includes a simplified procedure of computing \f$P_{r}\f$ +!! and \f$P_{s}\f$ (Zhao and Carr (1997) \cite zhao_and_carr_1997). +!! +!! The calculation is as follows: +!! -# Calculate precipitation production by auto conversion and accretion (\f$P_{saut}\f$, \f$P_{saci}\f$, \f$P_{raut}\f$). +!! - The accretion of cloud water by rain, \f$P_{racw}\f$, is not included in the current operational scheme. +!! -# Calculate evaporation of precipitation (\f$E_{rr}\f$ and \f$E_{rs}\f$). +!! -# Calculate melting of snow (\f$P_{sm1}\f$ and \f$P_{sm2}\f$, \f$P_{sacw}\f$). +!! -# Update t and q due to precipitation (snow or rain) production. +!! -# Calculate precipitation at surface (\f$rn\f$) and fraction of frozen precipitation (\f$sr\f$). +!! \section Zhao-Carr_precip_detailed GFS precpd Scheme Detailed Algorithm +!> @{ + subroutine zhaocarr_precpd_run (im,ix,km,dt,del,prsl,q,cwm,t,rn & + &, sr,rainp,u00k,psautco,prautco,evpco,wminco & + &, wk1,lprnt,jpr,errmsg,errflg) + +! +! ****************************************************************** +! * * +! * subroutine for precipitation processes * +! * from suspended cloud water/ice * +! * * +! ****************************************************************** +! * * +! * originally created by q. zhao jan. 1995 * +! * ------- * +! * modified and rewritten by shrinivas moorthi oct. 1998 * +! * ----------------- * +! * and hua-lu pan * +! * ---------- * +! * * +! * references: * +! * * +! * zhao and carr (1997), monthly weather review (august) * +! * sundqvist et al., (1989) monthly weather review. (august) * +! * chuang 2013, modify sr to define frozen precipitation fraction* +! ****************************************************************** +! +! in this code vertical indexing runs from surface to top of the +! model +! +! argument list: +! -------------- +! im : inner dimension over which calculation is made +! ix : maximum inner dimension +! km : number of vertical levels +! dt : time step in seconds +! del(km) : pressure layer thickness (bottom to top) +! prsl(km) : pressure values for model layers (bottom to top) +! q(ix,km) : specific humidity (updated in the code) +! cwm(ix,km) : condensate mixing ratio (updated in the code) +! t(ix,km) : temperature (updated in the code) +! rn(im) : precipitation over one time-step dt (m/dt) +!old sr(im) : index (=-1 snow, =0 rain/snow, =1 rain) +!new sr(im) : "snow ratio", ratio of snow to total precipitation +! cll(ix,km) : cloud cover +!hchuang rn(im) unit in m per time step +! precipitation rate conversion 1 mm/s = 1 kg/m2/s +! + use machine , only : kind_phys + use funcphys , only : fpvs + use physcons, grav => con_g, hvap => con_hvap, hfus => con_hfus + &, ttp => con_ttp, cp => con_cp + &, eps => con_eps, epsm1 => con_epsm1 + implicit none +! include 'constant.h' +! +! Interface variables + integer, intent(in) :: im, ix, km, jpr + real (kind=kind_phys), intent(in) :: dt + real (kind=kind_phys), intent(in) :: del(ix,km), prsl(ix,km) + real (kind=kind_phys), intent(inout) :: q(ix,km), t(ix,km), & + & cwm(ix,km) + real (kind=kind_phys), intent(out) :: rn(im), sr(im), rainp(im,km) + real (kind=kind_phys), intent(in) :: u00k(im,km) + real (kind=kind_phys), intent(in) :: psautco(2), prautco(2), & + & evpco, wminco(2), wk1(im) + logical, intent(in) :: lprnt + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +! +! Local variables + real (kind=kind_phys) g, h1, h1000 + &, d00 + &, elwv, eliv, row + &, epsq, eliw + &, rcp, rrow + parameter (g=grav, h1=1.e0, h1000=1000.0 + &, d00=0.e0 + &, elwv=hvap, eliv=hvap+hfus, row=1.e3 + &, epsq=2.e-12 + &, eliw=eliv-elwv, rcp=h1/cp, rrow=h1/row) +! + real(kind=kind_phys), parameter :: cons_0=0.0, cons_p01=0.01 + &, cons_20=20.0 + &, cons_m30=-30.0, cons_50=50.0 +! + real (kind=kind_phys) rnp(im), psautco_l(im), prautco_l(im) & + &, wk2(im) +! + real (kind=kind_phys) err(im), ers(im), precrl(im) & + &, precsl(im), precrl1(im), precsl1(im) & + &, rq(im), condt(im) & + &, conde(im), rconde(im), tmt0(im) & + &, wmin(im,km), wmink(im), pres(im) & + &, wmini(im,km), ccr(im) & + &, tt(im), qq(im), ww(im) & + &, zaodt + real (kind=kind_phys) cclim(km) +! + integer iw(im,km), ipr(im), iwl(im), iwl1(im) +! + logical comput(im) +! + real (kind=kind_phys) ke, rdt, us, climit, cws, csm1 + &, crs1, crs2, cr, aa2, dtcp, c00, cmr + &, tem, c1, c2, wwn +! &, tem, c1, c2, u00b, u00t, wwn + &, precrk, precsk, pres1, qk, qw, qi + &, qint, fiw, wws, cwmk, expf + &, psaut, psaci, amaxcm, tem1, tem2 + &, tmt0k, psm1, psm2, ppr + &, rprs, erk, pps, sid, rid, amaxps + &, praut, fi, qc, amaxrq, rqkll + integer i, k, ihpr, n +! + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 +!-------------- GFS psautco/prautco interstitial ---------------- + do i=1, im + wk2(i) = 1.0-wk1(i) + psautco_l(i) = psautco(1)*wk1(i) + psautco(2)*wk2(i) + prautco_l(i) = prautco(1)*wk1(i) + prautco(2)*wk2(i) + enddo +!-----------------------preliminaries --------------------------------- +! +! do k=1,km +! do i=1,im +! cll(i,k) = 0.0 +! enddo +! enddo +! + rdt = h1 / dt +! ke = 2.0e-5 ! commented on 09/10/99 -- opr value +! ke = 2.0e-6 +! ke = 1.0e-5 +!!! ke = 5.0e-5 +!! ke = 7.0e-5 + ke = evpco +! ke = 7.0e-5 + us = h1 + climit = 1.0e-20 + cws = 0.025 +! + zaodt = 800.0 * rdt +! + csm1 = 5.0000e-8 * zaodt + crs1 = 5.00000e-6 * zaodt + crs2 = 6.66600e-10 * zaodt + cr = 5.0e-4 * zaodt + aa2 = 1.25e-3 * zaodt +! + ke = ke * sqrt(rdt) +! ke = ke * sqrt(zaodt) +! + dtcp = dt * rcp +! +! c00 = 1.5e-1 * dt +! c00 = 10.0e-1 * dt +! c00 = 3.0e-1 * dt !05/09/2000 +! c00 = 1.0e-4 * dt !05/09/2000 +! c00 = prautco * dt !05/09/2000 + cmr = 1.0 / 3.0e-4 +! cmr = 1.0 / 5.0e-4 +! c1 = 100.0 + c1 = 300.0 + c2 = 0.5 +! +! +!--------calculate c0 and cmr using lc at previous step----------------- +! + do k=1,km + do i=1,im + tem = (prsl(i,k)*0.00001) +! tem = sqrt(tem) + iw(i,k) = 0.0 +! wmin(i,k) = 1.0e-5 * tem +! wmini(i,k) = 1.0e-5 * tem ! testing for ras +! + + wmin(i,k) = wminco(1) * tem + wmini(i,k) = wminco(2) * tem + + + rainp(i,k) = 0.0 + + enddo + enddo + do i=1,im +! c0(i) = 1.5e-1 +! cmr(i) = 3.0e-4 +! + iwl1(i) = 0 + precrl1(i) = d00 + precsl1(i) = d00 + comput(i) = .false. + rn(i) = d00 + sr(i) = d00 + ccr(i) = d00 +! + rnp(i) = d00 + enddo +!> -# Select columns where rain can be produced, where +!!\f[ +!! cwm > \min (wmin, wmini) +!!\f] +!! where the cloud water and ice conversion threshold: +!! \f[ +!! wmin=wminco(1)\times prsl\times 10^{-5} +!! \f] +!! \f[ +!! wmini=wminco(2)\times prsl\times 10^{-5} +!! \f] + +!------------select columns where rain can be produced-------------- + do k=1, km-1 + do i=1,im + tem = min(wmin(i,k), wmini(i,k)) + if (cwm(i,k) > tem) comput(i) = .true. + enddo + enddo + ihpr = 0 + do i=1,im + if (comput(i)) then + ihpr = ihpr + 1 + ipr(ihpr) = i + endif + enddo +!*********************************************************************** +!-----------------begining of precipitation calculation----------------- +!*********************************************************************** +! do k=km-1,2,-1 + do k=km,1,-1 + do n=1,ihpr + precrl(n) = precrl1(n) + precsl(n) = precsl1(n) + err (n) = d00 + ers (n) = d00 + iwl (n) = 0 +! + i = ipr(n) + tt(n) = t(i,k) + qq(n) = q(i,k) + ww(n) = cwm(i,k) + wmink(n) = wmin(i,k) + pres(n) = prsl(i,k) +! + precrk = max(cons_0, precrl1(n)) + precsk = max(cons_0, precsl1(n)) + wwn = max(ww(n), climit) +! if (wwn .gt. wmink(n) .or. (precrk+precsk) .gt. d00) then + if (wwn > climit .or. (precrk+precsk) > d00) then + comput(n) = .true. + else + comput(n) = .false. + endif + enddo +! +! es(1:ihpr) = fpvs(tt(1:ihpr)) + do n=1,ihpr + if (comput(n)) then + i = ipr(n) + conde(n) = (dt/g) * del(i,k) + condt(n) = conde(n) * rdt + rconde(n) = h1 / conde(n) + qk = max(epsq, qq(n)) + tmt0(n) = tt(n) - 273.16 + wwn = max(ww(n), climit) +! +! pl = pres(n) * 0.01 +! call qsatd(tt(n), pl, qc) +! rq(n) = max(qq(n), epsq) / max(qc, 1.0e-10) +! rq(n) = max(1.0e-10, rq(n)) ! -- relative humidity--- +! +! the global qsat computation is done in pa + pres1 = pres(n) +! qw = es(n) + qw = min(pres1, fpvs(tt(n))) + qw = eps * qw / (pres1 + epsm1 * qw) + qw = max(qw,epsq) +! +! tmt15 = min(tmt0(n), cons_m15) +! ai = 0.008855 +! bi = 1.0 +! if (tmt0(n) .lt. -20.0) then +! ai = 0.007225 +! bi = 0.9674 +! endif +! qi = qw * (bi + ai*min(tmt0(n),cons_0)) +! qint = qw * (1.-0.00032*tmt15*(tmt15+15.)) +! + qi = qw + qint = qw +! if (tmt0(n).le.-40.) qint = qi +! +!-------------------ice-water id number iw------------------------------ +!> -# Calculate ice-water identification number IW (see algorithm in +!! \ref condense). + if(tmt0(n) < -15.) then + fi = qk - u00k(i,k)*qi + if(fi > d00 .or. wwn > climit) then + iwl(n) = 1 + else + iwl(n) = 0 + endif +! endif + elseif (tmt0(n) >= 0.) then + iwl(n) = 0 +! +! if(tmt0(n).lt.0.0.and.tmt0(n).ge.-15.0) then + else + iwl(n) = 0 + if(iwl1(n) == 1 .and. wwn > climit) iwl(n) = 1 + endif +! +! if(tmt0(n).ge.0.) then +! iwl(n) = 0 +! endif +!----------------the satuation specific humidity------------------------ + fiw = float(iwl(n)) + qc = (h1-fiw)*qint + fiw*qi +!----------------the relative humidity---------------------------------- + if(qc <= 1.0e-10) then + rq(n) = d00 + else + rq(n) = qk / qc + endif +!----------------cloud cover ratio ccr---------------------------------- +!> -# Calculate cloud fraction \f$b\f$ (see algorithm in \ref condense) + if(rq(n) < u00k(i,k)) then + ccr(n) = d00 + elseif(rq(n) >= us) then + ccr(n) = us + else + rqkll = min(us,rq(n)) + ccr(n) = h1-sqrt((us-rqkll)/(us-u00k(i,k))) + endif +! + endif + enddo +!-------------------ice-water id number iwl------------------------------ +! do n=1,ihpr +! if (comput(n) .and. (ww(n) .gt. climit)) then +! if (tmt0(n) .lt. -15.0 +! * .or. (tmt0(n) .lt. 0.0 .and. iwl1(n) .eq. 1)) +! * iwl(n) = 1 +! cll(ipr(n),k) = 1.0 ! cloud cover! +! cll(ipr(n),k) = min(1.0, ww(n)*cclim(k)) ! cloud cover! +! endif +! enddo +! +!> -# Precipitation production by auto conversion and accretion +!! - The autoconversion of cloud ice to snow (\f$P_{saut}\f$) is simulated +!! using the equation from Lin et al.(1983)\cite lin_et_al_1983 +!!\f[ +!! P_{saut}=a_{1}(cwm-wmini) +!!\f] +!! Since snow production in this process is caused by the increase in +!! size of cloud ice particles due to depositional growth and +!! aggregation of small ice particles, \f$P_{saut}\f$ is a function of +!! temperature as determined by coefficient \f$a_{1}\f$, given by +!! \f[ +!! a_{1}=psautco \times dt \times exp\left[ 0.025\left(T-273.15\right)\right] +!! \f] +!! +!! - The accretion of cloud ice by snow (\f$P_{saci}\f$) in the +!! regions where cloud ice exists is simulated by +!!\f[ +!! P_{saci}=C_{s}cwm P_{s} +!!\f] +!! where \f$P_{s}\f$ is the precipitation rate of snow. The collection +!! coefficient \f$C_{s}\f$ is a function of temperature since the open +!! structures of ice crystals at relative warm temperatures are more +!! likely to stick, given a collision, than crystals of other shapes +!! (Rogers (1979) \cite rogers_1979). Above the freezing level, +!! \f$C_{s}\f$ is expressed by +!!\f[ +!! C_{s}=c_{1}exp\left[ 0.025\left(T-273.15\right)\right] +!!\f] +!! where \f$c_{1}=1.25\times 10^{-3} m^{2}kg^{-1}s^{-1}\f$ are used. +!! \f$C_{s}\f$ is set to zero below the freezing level. +!! +!--- precipitation production -- auto conversion and accretion +! + do n=1,ihpr + if (comput(n) .and. ccr(n) > 0.0) then + wws = ww(n) + cwmk = max(cons_0, wws) + i = ipr(n) +! amaxcm = max(cons_0, cwmk - wmink(n)) + if (iwl(n) == 1) then ! ice phase + amaxcm = max(cons_0, cwmk - wmini(i,k)) + expf = dt * exp(0.025*tmt0(n)) + psaut = min(cwmk, psautco_l(i)*expf*amaxcm) + ww(n) = ww(n) - psaut + cwmk = max(cons_0, ww(n)) +! cwmk = max(cons_0, ww(n)-wmini(i,k)) + psaci = min(cwmk, aa2*expf*precsl1(n)*cwmk) + + ww(n) = ww(n) - psaci + precsl(n) = precsl(n) + (wws - ww(n)) * condt(n) + else ! liquid water +! +!> - Following Sundqvist et al. (1989)\cite sundqvist_et_al_1989, +!! the autoconversion of cloud water to rain (\f$P_{raut}\f$) can be +!! parameterized from the cloud water mixing ratio \f$m\f$ and cloud +!! coverage \f$b\f$, that is, +!!\f[ +!! P_{raut}=(prautco \times dt )\times (cwm-wmin)\left\{1-exp[-(\frac{cwm-wmin}{m_{r}b})^{2}]\right\} +!!\f] +!! where \f$m_{r}\f$ is \f$3.0\times 10^{-4}\f$. +! for using sundqvist precip formulation of rain +! + amaxcm = max(cons_0, cwmk - wmink(n)) +!! amaxcm = cwmk + tem1 = precsl1(n) + precrl1(n) + tem2 = min(max(cons_0, 268.0-tt(n)), cons_20) + tem = (1.0+c1*sqrt(tem1*rdt)) * (1+c2*sqrt(tem2)) +! + tem2 = amaxcm * cmr * tem / max(ccr(n),cons_p01) + tem2 = min(cons_50, tem2*tem2) +! praut = c00 * tem * amaxcm * (1.0-exp(-tem2)) + praut = (prautco_l(i)*dt) * tem * amaxcm + & * (1.0-exp(-tem2)) + praut = min(praut, cwmk) + ww(n) = ww(n) - praut +! +! - Calculate the accretion of cloud water by rain \f$P_{racw}\f$, +! can be expressed using the cloud mixing ratio \f$cwm\f$ and rainfall +! rate \f$P_{r}\f$: +!\f[ +! P_{racw}=C_{r}cwmP_{r} +!\f] +! where \f$C_{r}=5.0\times10^{-4}m^{2}kg^{-1}s^{-1}\f$ is the +! collection coeffiecient. Note that this process is not included in +! current operational physcics. +! below is for zhao's precip formulation (water) +! +! amaxcm = max(cons_0, cwmk - wmink(n)) +! praut = min(cwmk, c00*amaxcm*amaxcm) +! ww(n) = ww(n) - praut +! +! cwmk = max(cons_0, ww(n)) +! tem1 = precsl1(n) + precrl1(n) +! pracw = min(cwmk, cr*dt*tem1*cwmk) +! ww(n) = ww(n) - pracw +! + precrl(n) = precrl(n) + (wws - ww(n)) * condt(n) +! +!hchuang code change [+1l] : add record to record information in vertical +! turn rnp in unit of ww (cwm and q, kg/kg ???) + rnp(n) = rnp(n) + (wws - ww(n)) + endif + endif + enddo +!> -# Evaporation of precipitation (\f$E_{rr}\f$ and \f$E_{rs}\f$) +!!\n Evaporation of precipitation is an important process that moistens +!! the layers below cloud base. Through this process, some of the +!! precipitating water is evaporated back to the atmosphere and the +!! precipitation efficiency is reduced. +!! - Evaporation of rain is calculated using the equation (Sundqvist(1988)\cite sundqvist_1988): +!!\f[ +!! E_{rr}= evpco \times (u-f)(P_{r})^{\beta} +!!\f] +!! where \f$u\f$ is u00k, \f$f\f$ is the relative humidity. +!! \f$\beta = 0.5\f$ are empirical parameter. +!! - Evaporation of snow is calculated using the equation: +!!\f[ +!! E_{rs}=[C_{rs1}+C_{rs2}(T-273.15)](\frac{u-f}{u})P_{s} +!!\f] +!! where \f$C_{rs1}=5\times 10^{-6}m^{2}kg^{-1}s^{-1}\f$ and +!! \f$C_{rs2}=6.67\times 10^{-10}m^{2}kg^{-1}K^{-1}s^{-1}\f$. The +!! evaporation of melting snow below the freezing level is ignored in +!! this scheme because of the difficulty in the latent heat treatment +!! since the surface of a melting snowflake is usually covered by a +!! thin layer of liquid water. +! +!-----evaporation of precipitation------------------------- +!**** err & ers positive--->evaporation-- negtive--->condensation +! + do n=1,ihpr + if (comput(n)) then + i = ipr(n) + qk = max(epsq, qq(n)) + tmt0k = max(cons_m30, tmt0(n)) + precrk = max(cons_0, precrl(n)) + precsk = max(cons_0, precsl(n)) + amaxrq = max(cons_0, u00k(i,k)-rq(n)) * conde(n) +!---------------------------------------------------------------------- +! increase the evaporation for strong/light prec +!---------------------------------------------------------------------- + ppr = ke * amaxrq * sqrt(precrk) +! ppr = ke * amaxrq * sqrt(precrk*rdt) + if (tmt0(n) .ge. 0.) then + pps = 0. + else + pps = (crs1+crs2*tmt0k) * amaxrq * precsk / u00k(i,k) + end if +!---------------correct if over-evapo./cond. occurs-------------------- + erk=precrk+precsk + if(rq(n).ge.1.0e-10) erk = amaxrq * qk * rdt / rq(n) + if (ppr+pps .gt. abs(erk)) then + rprs = erk / (precrk+precsk) + ppr = precrk * rprs + pps = precsk * rprs + endif + ppr = min(ppr, precrk) + pps = min(pps, precsk) + err(n) = ppr * rconde(n) + ers(n) = pps * rconde(n) + precrl(n) = precrl(n) - ppr +!hchuang code change [+1l] : add record to record information in vertical +! use err for kg/kg/dt not the ppr (mm/dt=kg/m2/dt) +! + rnp(n) = rnp(n) - err(n) +! + precsl(n) = precsl(n) - pps + endif + enddo +!> -# Melting of snow (\f$P_{sm1}\f$ and \f$P_{sm2}\f$) +!!\n In this scheme, we allow snow melting to take place in certain +!! temperature regions below the freezing level in two ways. In both +!! cases, the melted snow is assumed to become raindrops. +!! - One is the continuous melting of snow due to the increase in +!! temperature as it falls down through the freezing level. This +!! process is parameterized as a function of temperature and snow +!! precipitation rate, that is, +!!\f[ +!! P_{sm1}=C_{sm}(T-273.15)^{2}P_{s} +!!\f] +!! where \f$C_{sm}=5\times 10^{-8}m^{2}kg^{-1}K^{-2}s^{-1}\f$ +!! cause the falling snow to melt almost completely before it reaches +!! the \f$T=278.15 K\f$ level. +!! - Another is the immediate melting of melting snow by collection of +!! the cloud water below the freezing level. In order to calculate the +!! melting rate, the collection rate of cloud water by melting snow is +!! computed first. Similar to the collection of cloud water by rain, +!! the collection of cloud water by melting snow can be parameterized +!! to be proportional to the cloud water mixing ratio \f$m\f$ and the +!! precipitation rate of snow \f$P_{s}\f$: +!!\f[ +!! P_{sacw}=C_{r}cwmP_{s} +!!\f] +!! where \f$C_{r}\f$ is the collection coefficient, +!! \f$C_{r}=5.0\times 10^{-4}m^{2}kg^{-1}s^{-1}\f$ . The melting rate +!! of snow then can be computed from +!!\f[ +!! P_{sm2}=C_{ws}P_{sacw} +!!\f] +!! where \f$C_{ws}=0.025\f$. +!--------------------melting of the snow-------------------------------- + do n=1,ihpr + if (comput(n)) then + if (tmt0(n) .gt. 0.) then + amaxps = max(cons_0, precsl(n)) + psm1 = csm1 * tmt0(n) * tmt0(n) * amaxps + psm2 = cws * cr * max(cons_0, ww(n)) * amaxps + ppr = (psm1 + psm2) * conde(n) + if (ppr .gt. amaxps) then + ppr = amaxps + psm1 = amaxps * rconde(n) + endif + precrl(n) = precrl(n) + ppr +! +!hchuang code change [+1l] : add record to record information in vertical +! turn ppr (mm/dt=kg/m2/dt) to kg/kg/dt -> ppr/air density (kg/m3) + rnp(n) = rnp(n) + ppr * rconde(n) +! + precsl(n) = precsl(n) - ppr + else + psm1 = d00 + endif +! +!---------------update t and q------------------------------------------ +!> - Update t and q. +!!\f[ +!! t=t-\frac{L}{C_{p}}(E_{rr}+E_{rs}+P_{sm1})\times dt +!!\f] +!!\f[ +!! q=q+(E_{rr}+E_{rs})\times dt +!!\f] + + tt(n) = tt(n) - dtcp * (elwv*err(n)+eliv*ers(n)+eliw*psm1) + qq(n) = qq(n) + dt * (err(n)+ers(n)) + endif + enddo +! + do n=1,ihpr + iwl1(n) = iwl(n) + precrl1(n) = max(cons_0, precrl(n)) + precsl1(n) = max(cons_0, precsl(n)) + i = ipr(n) + t(i,k) = tt(n) + q(i,k) = qq(n) + cwm(i,k) = ww(n) + iw(i,k) = iwl(n) +!hchuang code change [+1l] : add record to record information in vertical +! rnp = precrl1*rconde(n) unit in kg/kg/dt +! + rainp(i,k) = rnp(n) + enddo +! +! move water from vapor to liquid should the liquid amount be negative +! + do i = 1, im + if (cwm(i,k) < 0.) then + tem = q(i,k) + cwm(i,k) + if (tem >= 0.0) then + q(i,k) = tem + t(i,k) = t(i,k) - elwv * rcp * cwm(i,k) + cwm(i,k) = 0. + elseif (q(i,k) > 0.0) then + cwm(i,k) = tem + t(i,k) = t(i,k) + elwv * rcp * q(i,k) + q(i,k) = 0.0 + endif + endif + enddo +! + enddo ! k loop ends here! +!********************************************************************** +!-----------------------end of precipitation processes----------------- +!********************************************************************** +! +!> -# Calculate precipitation at surface (\f$rn\f$)and determine +!! fraction of frozen precipitation (\f$sr\f$). +!!\f[ +!! rn= (P_{r}(\eta_{sfc})+P_{s}(\eta_{sfc}))/10^3 +!!\f] +!!\f[ +!! sr=\frac{P_{s}(\eta_{sfc})}{P_{s}(\eta_{sfc})+P_{r}(\eta_{sfc})} +!!\f] + do n=1,ihpr + i = ipr(n) + rn(i) = (precrl1(n) + precsl1(n)) * rrow ! precip at surface +! +!----sr=1 if sfc prec is rain ; ----sr=-1 if sfc prec is snow +!----sr=0 for both of them or no sfc prec +! +! rid = 0. +! sid = 0. +! if (precrl1(n) .ge. 1.e-13) rid = 1. +! if (precsl1(n) .ge. 1.e-13) sid = -1. +! sr(i) = rid + sid ! sr=1 --> rain, sr=-1 -->snow, sr=0 -->both +! chuang, june 2013: change sr to define fraction of frozen precipitation instead +! because wpc uses it in their winter experiment + + rid = precrl1(n) + precsl1(n) + if (rid < 1.e-13) then + sr(i) = 0. + else + sr(i) = precsl1(n)/rid + endif + enddo +! + return + end subroutine zhaocarr_precpd_run +!> @} + +!! \section arg_table_zhaocarr_precpd_finalize Argument Table +!! + subroutine zhaocarr_precpd_finalize + end subroutine zhaocarr_precpd_finalize + + + end module zhaocarr_precpd diff --git a/physics/shinhongvdif.F90 b/physics/shinhongvdif.F90 new file mode 100644 index 000000000..c5011218b --- /dev/null +++ b/physics/shinhongvdif.F90 @@ -0,0 +1,2106 @@ +!> \file shinhongvdif.F90 +!! This file contains the CCPP-compliant Shinhong (saYSU) scheme which computes +!! subgrid vertical turbulence mixing using traditional K-profile method +!! Please refer to (Shin and Hong, 2013,2015). +!! +!! Subroutine 'shinhongvdif_run' computes subgrid vertical turbulence mixing +!! using scale-aware YSU K-profile method +!! +!---------------------------------------------------------------------- + + module shinhongvdif + contains + + subroutine shinhongvdif_init () + end subroutine shinhongvdif_init + + subroutine shinhongvdif_finalize () + end subroutine shinhongvdif_finalize + +!> \defgroup SHINHONG FV3GFS shinhongvdif_run Main +!! \brief This subroutine contains all of the logic for the +!! scale-aware Shinhong scheme. +!! +!> \section arg_table_shinhongvdif_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| +!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | +!! | ux | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | +!! | vx | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | +!! | tx | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | +!! | qx | tracer_concentration | model layer mean tracer concentration | kg kg-1 | 3 | real | kind_phys | in | F | +!! | p2d | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | p2di | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | +!! | pi2d | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | +!! | vtnp | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | +!! | utnp | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | +!! | ttnp | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | +!! | qtnp | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers due to model physics | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | +!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | +!! | ndiff | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | +!! | ntcw | index_for_liquid_cloud_condensate | tracer index for cloud condensate (or liquid water) | index | 0 | integer | | in | F | +!! | ntiw | index_for_ice_cloud_condensate | tracer index for ice water | index | 0 | integer | | in | F | +!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | +!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | +!! | psfcpa | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | +!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | +!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | +!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | +!! | psim | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | +!! | psih | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | +!! | landmask | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | +!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | +!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | wspd | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | +!! | br | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | +!! | g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | +!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | ep1 | ratio_of_vapor_to_dry_air_gas_constants_minus_one | rv/rd - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | +!! | ep2 | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | +!! | xlv | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | +!! | dusfc | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | +!! | dvsfc | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | +!! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | dt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | +!! | kpbl1d | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | +!! | u10 | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | +!! | v10 | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | +!! | dx | cell_size | size of the grid cell | m | 1 | real | kind_phys | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +!------------------------------------------------------------------------------- + subroutine shinhongvdif_run(ix,im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & + utnp,vtnp,ttnp,qtnp,ntrac,ndiff,ntcw,ntiw, & + phii,phil,psfcpa, & + zorl,stress,hpbl,psim,psih, & + landmask,heat,evap,wspd,br, & + g,rd,cp,rv,ep1,ep2,xlv, & + dusfc,dvsfc,dtsfc,dqsfc, & + dt,kpbl1d, & + u10,v10, & + dx,errmsg,errflg ) + + use machine , only : kind_phys +! +!------------------------------------------------------------------------------- + implicit none +!------------------------------------------------------------------------------- +! +! the shinhongpbl (shin and hong 2015) is based on the les study of shin +! and hong (2013). the major ingredients of the shinhongpbl are +! 1) the prescribed nonlocal heat transport profile fit to the les and +! 2) inclusion of explicit scale dependency functions for vertical +! transport in convective pbl. +! so, the shinhongpbl works at the gray zone resolution of convective pbl. +! note that honnert et al. (2011) first suggested explicit scale dependency +! function, and shin and hong (2013) further classified the function by +! stability (u*/w*) in convective pbl and calculated the function for +! nonlocal and local transport separately. +! vertical mixing in the stable boundary layer and free atmosphere follows +! hong (2010) and hong et al. (2006), same as the ysupbl scheme. +! +! shinhongpbl: +! coded and implemented by hyeyum hailey shin (ncar) +! summer 2014 +! +! ysupbl: +! coded by song-you hong (yonsei university) and implemented by +! song-you hong (yonsei university) and jimy dudhia (ncar) +! summer 2002 +! +! references: +! shin and hong (2015) mon. wea. rev. +! shin and hong (2013) j. atmos. sci. +! honnert, masson, and couvreux (2011) j. atmos. sci. +! hong (2010) quart. j. roy. met. soc +! hong, noh, and dudhia (2006), mon. wea. rev. +! +!------------------------------------------------------------------------------- +! + real(kind=kind_phys),parameter :: xkzminm = 0.1,xkzminh = 0.01 + real(kind=kind_phys),parameter :: xkzmax = 1000.,rimin = -100. + real(kind=kind_phys),parameter :: rlam = 30.,prmin = 0.25,prmax = 4. + real(kind=kind_phys),parameter :: brcr_ub = 0.0,brcr_sb = 0.25,cori = 1.e-4 + real(kind=kind_phys),parameter :: afac = 6.8,bfac = 6.8,pfac = 2.0,pfac_q = 2.0 + real(kind=kind_phys),parameter :: phifac = 8.,sfcfrac = 0.1 + real(kind=kind_phys),parameter :: d1 = 0.02, d2 = 0.05, d3 = 0.001 + real(kind=kind_phys),parameter :: h1 = 0.33333335, h2 = 0.6666667 + real(kind=kind_phys),parameter :: ckz = 0.001,zfmin = 1.e-8,aphi5 = 5.,aphi16 = 16. + real(kind=kind_phys),parameter :: tmin=1.e-2 + real(kind=kind_phys),parameter :: gamcrt = 3.,gamcrq = 2.e-3 + real(kind=kind_phys),parameter :: xka = 2.4e-5 + real(kind=kind_phys),parameter :: karman = 0.4 + real(kind=kind_phys),parameter :: corf=0.000073 + real(kind=kind_phys),parameter :: rcl = 1.0 + integer,parameter :: imvdif = 1 + integer,parameter :: shinhong_tke_diag = 0 +! +! tunable parameters for tke +! + real(kind=kind_phys),parameter :: epsq2l = 0.01,c_1 = 1.0,gamcre = 0.224 +! +! tunable parameters for prescribed nonlocal transport profile +! + real(kind=kind_phys),parameter :: mltop = 1.0,sfcfracn1 = 0.075 + real(kind=kind_phys),parameter :: nlfrac = 0.7,enlfrac = -0.4 + real(kind=kind_phys),parameter :: a11 = 1.0,a12 = -1.15 + real(kind=kind_phys),parameter :: ezfac = 1.5 + real(kind=kind_phys),parameter :: cpent = -0.4,rigsmax = 100. + real(kind=kind_phys),parameter :: entfmin = 1.0, entfmax = 5.0 +! 1D in + integer, intent(in ) :: ix,im,km,ntrac,ndiff,ntcw,ntiw + real(kind=kind_phys), intent(in ) :: g,cp,rd,rv,ep1,ep2,xlv,dt +! 3D in + real(kind=kind_phys), dimension(ix, km) , & + intent(in ) :: phil, & + pi2d, & + p2d, & + ux, & + vx, & + tx + real(kind=kind_phys), dimension( ix, km, ntrac ) , & + intent(in ) :: qx + + real(kind=kind_phys), dimension( ix, km+1 ) , & + intent(in ) :: p2di, & + phii +! 3D in&out + real(kind=kind_phys), dimension(im, km) , & + intent(inout) :: utnp, & + vtnp, & + ttnp + real(kind=kind_phys), dimension(im, km, ntrac ) , & + intent(inout) :: qtnp +! 2D in + integer, dimension(im) , & + intent(in ) :: landmask + + real(kind=kind_phys), dimension(im) , & + intent(in ) :: heat, & + evap, & + br, & + psim, & + psih, & + psfcpa, & + stress, & + zorl, & + wspd, & + u10, & + v10, & + dx +! 2D: out + integer, dimension(im) , & + intent(out ) :: kpbl1d + + real(kind=kind_phys), dimension(im) , & + intent(out ) :: hpbl, & + dusfc, & + dvsfc, & + dtsfc, & + dqsfc + +! error messages + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +! +! local vars +! + integer :: n,i,k,l,ic + integer :: klpbl + integer :: lmh,lmxl,kts,kte,its,ite +! + real(kind=kind_phys) :: dt2,rdt,spdk2,fm,fh,hol1,gamfac,vpert,prnum,prnum0 + real(kind=kind_phys) :: ss,ri,qmean,tmean,alpha,chi,zk,rl2,dk,sri + real(kind=kind_phys) :: brint,dtodsd,dtodsu,rdz,dsdzt,dsdzq,dsdz2,rlamdz + real(kind=kind_phys) :: utend,vtend,ttend,qtend + real(kind=kind_phys) :: dtstep,govrthv + real(kind=kind_phys) :: cont, conq, conw, conwrc + real(kind=kind_phys) :: delxy,pu1,pth1,pq1 + real(kind=kind_phys) :: dex,hgame_c + real(kind=kind_phys) :: zfacdx + real(kind=kind_phys) :: amf1,amf2,bmf2,amf3,bmf3,amf4,bmf4,sflux0,snlflux0 + real(kind=kind_phys) :: mlfrac,ezfrac,sfcfracn + real(kind=kind_phys) :: uwst,uwstx,csfac + real(kind=kind_phys) :: prnumfac,bfx0,hfx0,qfx0,delb,dux,dvx, & + dsdzu,dsdzv,wm3,dthx,dqx,wspd10,ross,tem1,dsig,tvcon,conpr, & + prfac,prfac2,phim8z +! + integer, dimension(im) :: kpbl + real(kind=kind_phys), dimension(im) :: hol + real(kind=kind_phys), dimension(im) :: deltaoh + real(kind=kind_phys), dimension(im) :: rigs, & + enlfrac2, & + cslen + real(kind=kind_phys), dimension(im) :: & + rhox, & + govrth, & + zl1,thermal, & + wscale, & + hgamt,hgamq, & + brdn,brup, & + phim,phih, & + prpbl, & + wspd1, & + ust,hfx,qfx,znt, & + xland + real(kind=kind_phys), dimension(im) :: & + ust3, & + wstar3, & + wstar,delta, & + hgamu,hgamv, & + wm2, we, & + bfxpbl, & + hfxpbl,qfxpbl, & + ufxpbl,vfxpbl, & + dthvx + real(kind=kind_phys), dimension(im) :: & + brcr, & + sflux, & + zol1, & + brcr_sbro + real(kind=kind_phys), dimension(im) :: & + efxpbl, & + hpbl_cbl, & + epshol, & + ct +! + real(kind=kind_phys), dimension(im,km) :: & + xkzm,xkzh, & + f1,f2, & + r1,r2, & + ad,au, & + cu, & + al, & + xkzq, & + zfac + real(kind=kind_phys), dimension(im,km) :: & + thx,thvx, & + del, & + dza, & + dzq, & + xkzom, & + xkzoh, & + za + real(kind=kind_phys), dimension(im,km) :: & + wscalek + real(kind=kind_phys), dimension(im,km) :: & + xkzml,xkzhl, & + zfacent,entfac + real(kind=kind_phys), dimension(im,km) :: & + mf, & + zfacmf, & + entfacmf + real(kind=kind_phys), dimension(im,km) :: & + q2x, & + hgame2d, & + tflux_e, & + qflux_e, & + tvflux_e + real(kind=kind_phys), dimension( im, km+1 ) :: zq + real(kind=kind_phys), dimension( im, km, ndiff ) :: r3,f3 +! + real(kind=kind_phys), dimension( km ) :: & + uxk,vxk, & + txk,thxk,thvxk, & + q2xk, & + hgame + real(kind=kind_phys), dimension( km ) :: & + ps1d,pb1d,eps1d,pt1d, & + xkze1d,eflx_l1d,eflx_nl1d, & + ptke1 + real(kind=kind_phys), dimension( 2:km ) :: & + s2,gh,rig,el, & + akmk,akhk, & + mfk,ufxpblk,vfxpblk,qfxpblk + real(kind=kind_phys), dimension( km+1 ) :: zqk + + real(kind=kind_phys), dimension(im,km) :: dz8w2d +! + logical, dimension(im) :: pblflg, & + sfcflg, & + stable + logical, dimension( ndiff ) :: ifvmix +! +!------------------------------------------------------------------------------- +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + its = 1 + ite = im + kts = 1 + kte = km + + klpbl = kte + lmh = 1 + lmxl = 1 +! + cont=cp/g + conq=xlv/g + conw=1./g + conwrc = conw*sqrt(rcl) + conpr = bfac*karman*sfcfrac +! change xland values + do i=its,ite + if(landmask(i).eq.0) then !ocean + xland(i) = 2 + else + xland(i) = 1 !land + end if + end do +! +! k-start index for cloud and rain +! + ifvmix(:) = .true. +! + do k = kts,kte + do i = its,ite + thx(i,k) = tx(i,k)/pi2d(i,k) + enddo + enddo +! + do k = kts,kte + do i = its,ite + tvcon = (1.+ep1*qx(i,k,1)) + thvx(i,k) = thx(i,k)*tvcon + enddo + enddo +! + do i = its,ite + tvcon = (1.+ep1*qx(i,1,1)) + rhox(i) = psfcpa(i)/(rd*tx(i,1)*tvcon) + govrth(i) = g/thx(i,1) + hfx(i) = heat(i)*rhox(i)*cp ! reset to the variable in WRF + qfx(i) = evap(i)*rhox(i) ! reset to the variable in WRF + ust(i) = sqrt(stress(i)) ! reset to the variable in WRF + znt(i) = 0.01*zorl(i) ! reset to the variable in WRF + enddo +! +!-----compute the height of full- and half-sigma levels above ground +! level, and the layer thicknesses. +! + do i = its,ite + zq(i,1) = 0. + enddo +! + do k = kts,kte + do i = its,ite + zq(i,k+1) = phii(i,k+1)*conw + za(i,k) = phil(i,k)*conw + enddo + enddo +! + do k = kts,kte + do i = its,ite + dzq(i,k) = zq(i,k+1)-zq(i,k) + del(i,k) = p2di(i,k)-p2di(i,k+1) + dz8w2d(i,k)=dzq(i,k) + enddo + enddo +! + do i = its,ite + dza(i,1) = za(i,1) + enddo +! + do k = kts+1,kte + do i = its,ite + dza(i,k) = za(i,k)-za(i,k-1) + enddo + enddo +! + do i = its,ite + wspd1(i) = sqrt(ux(i,1)*ux(i,1)+vx(i,1)*vx(i,1))+1.e-9 + enddo + +! write(0,*)"===CALLING shinhong; input:" +! print*,"t:",tx(1,1),tx(1,2),tx(1,km) +! print*,"u:",ux(1,1),ux(1,2),ux(1,km) +! print*,"v:",vx(1,1),vx(1,2),vx(1,km) +! print*,"q:",qx(1,1,1),qx(1,2,1),qx(1,km,1) +! print*,"exner:",pi2d(1,1),pi2d(1,2),pi2d(1,km) +! print*,"dz8w2d:",dz8w2d(1,1),dz8w2d(1,2),dz8w2d(1,km) +! print *,"del:",del(1,1),del(1,2),del(1,km) +! print*,"phii:",zq(1,1),zq(1,2),zq(1,km+1) +! print*,"phil:",za(1,1),za(1,2),za(1,km) +! print*,"p2d:",p2d(1,1),p2d(1,2),p2d(1,km) +! print*,"p2di:",p2di(1,1),p2di(1,2),p2di(1,km+1) +! print*,"znt,ust,wspd:",znt(1),ust(1),wspd(1) +! print*,"hfx,qfx,xland:",hfx(1),qfx(1),xland(1) +! print*,"rd,rv,g:",rd,rv,g +! print*,"ep1,ep2,xlv:",ep1,ep2,xlv +! print*,"br,psim,psih:",br(1),psim(1),psih(1) +! print*,"dx,u10,v10:",dx(1),u10(1),v10(1) +! print*,"psfcpa,cp:",psfcpa(1),cp +! print*,"ntrac,ndiff,ntcw,ntiw:",ntrac,ndiff,ntcw,ntiw +! +!---- compute vertical diffusion +! +! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +! compute preliminary variables +! + dtstep = dt + dt2 = 2.*dtstep + rdt = 1./dt2 +! + do i = its,ite + bfxpbl(i) = 0.0 + hfxpbl(i) = 0.0 + qfxpbl(i) = 0.0 + ufxpbl(i) = 0.0 + vfxpbl(i) = 0.0 + hgamu(i) = 0.0 + hgamv(i) = 0.0 + delta(i) = 0.0 + enddo +! + do i = its,ite + efxpbl(i) = 0.0 + hpbl_cbl(i) = 0.0 + epshol(i) = 0.0 + ct(i) = 0.0 + enddo +! + do i = its,ite + deltaoh(i) = 0.0 + rigs(i) = 0.0 + enlfrac2(i) = 0.0 + cslen(i) = 0.0 + enddo +! + do k = kts,klpbl + do i = its,ite + wscalek(i,k) = 0.0 + enddo + enddo +! + do k = kts,klpbl + do i = its,ite + zfac(i,k) = 0.0 + enddo + enddo +! + do k = kts,kte + do i = its,ite + q2x(i,k) = 1.e-4 + enddo + enddo +! + do k = kts,kte + do i = its,ite + hgame2d(i,k) = 0.0 + tflux_e(i,k) = 0.0 + qflux_e(i,k) = 0.0 + tvflux_e(i,k) = 0.0 + enddo + enddo +! + do k = kts,kte + do i = its,ite + mf(i,k) = 0.0 + zfacmf(i,k) = 0.0 + enddo + enddo +! + do k = kts,klpbl-1 + do i = its,ite + xkzom(i,k) = xkzminm + xkzoh(i,k) = xkzminh + enddo + enddo +! + do i = its,ite + dusfc(i) = 0. + dvsfc(i) = 0. + dtsfc(i) = 0. + dqsfc(i) = 0. + enddo +! + do i = its,ite + hgamt(i) = 0. + hgamq(i) = 0. + wscale(i) = 0. + kpbl(i) = 1 + hpbl(i) = zq(i,1) + hpbl_cbl(i) = zq(i,1) + zl1(i) = za(i,1) + thermal(i)= thvx(i,1) + pblflg(i) = .true. + sfcflg(i) = .true. + sflux(i) = hfx(i)/rhox(i)/cp + qfx(i)/rhox(i)*ep1*thx(i,1) + if(br(i).gt.0.0) sfcflg(i) = .false. + enddo +! +! compute the first guess of pbl height +! + do i = its,ite + stable(i) = .false. + brup(i) = br(i) + brcr(i) = brcr_ub + enddo +! + do k = 2,klpbl + do i = its,ite + if(.not.stable(i))then + brdn(i) = brup(i) + spdk2 = max(ux(i,k)**2+vx(i,k)**2,1.) + brup(i) = (thvx(i,k)-thermal(i))*(g*za(i,k)/thvx(i,1))/spdk2 + kpbl(i) = k + stable(i) = brup(i).gt.brcr(i) + endif + enddo + enddo +! + do i = its,ite + k = kpbl(i) + if(brdn(i).ge.brcr(i))then + brint = 0. + elseif(brup(i).le.brcr(i))then + brint = 1. + else + brint = (brcr(i)-brdn(i))/(brup(i)-brdn(i)) + endif + hpbl(i) = za(i,k-1)+brint*(za(i,k)-za(i,k-1)) + if(hpbl(i).lt.zq(i,2)) kpbl(i) = 1 + if(kpbl(i).le.1) pblflg(i) = .false. + enddo +! + do i = its,ite + fm = psim(i) + fh = psih(i) + zol1(i) = max(br(i)*fm*fm/fh,rimin) + if(sfcflg(i))then + zol1(i) = min(zol1(i),-zfmin) + else + zol1(i) = max(zol1(i),zfmin) + endif + hol1 = zol1(i)*hpbl(i)/zl1(i)*sfcfrac + epshol(i) = hol1 + if(sfcflg(i))then + phim(i) = (1.-aphi16*hol1)**(-1./4.) + phih(i) = (1.-aphi16*hol1)**(-1./2.) + bfx0 = max(sflux(i),0.) + hfx0 = max(hfx(i)/rhox(i)/cp,0.) + qfx0 = max(ep1*thx(i,1)*qfx(i)/rhox(i),0.) + wstar3(i) = (govrth(i)*bfx0*hpbl(i)) + wstar(i) = (wstar3(i))**h1 + else + phim(i) = (1.+aphi5*hol1) + phih(i) = phim(i) + wstar(i) = 0. + wstar3(i) = 0. + endif + ust3(i) = ust(i)**3. + wscale(i) = (ust3(i)+phifac*karman*wstar3(i)*0.5)**h1 + wscale(i) = min(wscale(i),ust(i)*aphi16) + wscale(i) = max(wscale(i),ust(i)/aphi5) + enddo +! +! compute the surface variables for pbl height estimation +! under unstable conditions +! + do i = its,ite + if(sfcflg(i).and.sflux(i).gt.0.0)then + gamfac = bfac/rhox(i)/wscale(i) + hgamt(i) = min(gamfac*hfx(i)/cp,gamcrt) + hgamq(i) = min(gamfac*qfx(i),gamcrq) + vpert = (hgamt(i)+ep1*thx(i,1)*hgamq(i))/bfac*afac + thermal(i) = thermal(i)+max(vpert,0.)*min(za(i,1)/(sfcfrac*hpbl(i)),1.0) + hgamt(i) = max(hgamt(i),0.0) + hgamq(i) = max(hgamq(i),0.0) + brint = -15.9*ust(i)*ust(i)/wspd(i)*wstar3(i)/(wscale(i)**4.) + hgamu(i) = brint*ux(i,1) + hgamv(i) = brint*vx(i,1) + else + pblflg(i) = .false. + endif + enddo +! +! enhance the pbl height by considering the thermal +! + do i = its,ite + if(pblflg(i))then + kpbl(i) = 1 + hpbl(i) = zq(i,1) + endif + enddo +! + do i = its,ite + if(pblflg(i))then + stable(i) = .false. + brup(i) = br(i) + brcr(i) = brcr_ub + endif + enddo +! + do k = 2,klpbl + do i = its,ite + if(.not.stable(i).and.pblflg(i))then + brdn(i) = brup(i) + spdk2 = max(ux(i,k)**2+vx(i,k)**2,1.) + brup(i) = (thvx(i,k)-thermal(i))*(g*za(i,k)/thvx(i,1))/spdk2 + kpbl(i) = k + stable(i) = brup(i).gt.brcr(i) + endif + enddo + enddo +! + do i = its,ite + if(pblflg(i)) then + k = kpbl(i) + if(brdn(i).ge.brcr(i))then + brint = 0. + elseif(brup(i).le.brcr(i))then + brint = 1. + else + brint = (brcr(i)-brdn(i))/(brup(i)-brdn(i)) + endif + hpbl(i) = za(i,k-1)+brint*(za(i,k)-za(i,k-1)) + if(hpbl(i).lt.zq(i,2)) kpbl(i) = 1 + if(kpbl(i).le.1) pblflg(i) = .false. + uwst = abs(ust(i)/wstar(i)-0.5) + uwstx = -80.*uwst+14. + csfac = 0.5*(tanh(uwstx)+3.) + cslen(i) = csfac*hpbl(i) + endif + enddo +! +! stable boundary layer +! + do i = its,ite + hpbl_cbl(i) = hpbl(i) + if((.not.sfcflg(i)).and.hpbl(i).lt.zq(i,2)) then + brup(i) = br(i) + stable(i) = .false. + else + stable(i) = .true. + endif + enddo +! + do i = its,ite + if((.not.stable(i)).and.((xland(i)-1.5).ge.0))then + wspd10 = u10(i)*u10(i) + v10(i)*v10(i) + wspd10 = sqrt(wspd10) + ross = wspd10 / (cori*znt(i)) + brcr_sbro(i) = min(0.16*(1.e-7*ross)**(-0.18),.3) + endif + enddo +! + do i = its,ite + if(.not.stable(i))then + if((xland(i)-1.5).ge.0)then + brcr(i) = brcr_sbro(i) + else + brcr(i) = brcr_sb + endif + endif + enddo +! + do k = 2,klpbl + do i = its,ite + if(.not.stable(i))then + brdn(i) = brup(i) + spdk2 = max(ux(i,k)**2+vx(i,k)**2,1.) + brup(i) = (thvx(i,k)-thermal(i))*(g*za(i,k)/thvx(i,1))/spdk2 + kpbl(i) = k + stable(i) = brup(i).gt.brcr(i) + endif + enddo + enddo +! + do i = its,ite + if((.not.sfcflg(i)).and.hpbl(i).lt.zq(i,2)) then + k = kpbl(i) + if(brdn(i).ge.brcr(i))then + brint = 0. + elseif(brup(i).le.brcr(i))then + brint = 1. + else + brint = (brcr(i)-brdn(i))/(brup(i)-brdn(i)) + endif + hpbl(i) = za(i,k-1)+brint*(za(i,k)-za(i,k-1)) + if(hpbl(i).lt.zq(i,2)) kpbl(i) = 1 + if(kpbl(i).le.1) pblflg(i) = .false. + endif + enddo +! +! scale dependency for nonlocal momentum and moisture transport +! + do i = its,ite + pu1=pu(dx(i),cslen(i)) + pq1=pq(dx(i),cslen(i)) + if(pblflg(i)) then + hgamu(i) = hgamu(i)*pu1 + hgamv(i) = hgamv(i)*pu1 + hgamq(i) = hgamq(i)*pq1 + endif + enddo +! +! estimate the entrainment parameters +! + do i = its,ite + if(pblflg(i)) then + k = kpbl(i) - 1 + prpbl(i) = 1.0 + wm3 = wstar3(i) + 5. * ust3(i) + wm2(i) = wm3**h2 + bfxpbl(i) = -0.15*thvx(i,1)/g*wm3/hpbl(i) + dthvx(i) = max(thvx(i,k+1)-thvx(i,k),tmin) + dthx = max(thx(i,k+1)-thx(i,k),tmin) + dqx = min(qx(i,k+1,1)-qx(i,k,1),0.0) + we(i) = max(bfxpbl(i)/dthvx(i),-sqrt(wm2(i))) + hfxpbl(i) = we(i)*dthx + pq1=pq(dx(i),cslen(i)) + qfxpbl(i) = we(i)*dqx*pq1 +! + pu1=pu(dx(i),cslen(i)) + dux = ux(i,k+1)-ux(i,k) + dvx = vx(i,k+1)-vx(i,k) + if(dux.gt.tmin) then + ufxpbl(i) = max(prpbl(i)*we(i)*dux*pu1,-ust(i)*ust(i)) + elseif(dux.lt.-tmin) then + ufxpbl(i) = min(prpbl(i)*we(i)*dux*pu1,ust(i)*ust(i)) + else + ufxpbl(i) = 0.0 + endif + if(dvx.gt.tmin) then + vfxpbl(i) = max(prpbl(i)*we(i)*dvx*pu1,-ust(i)*ust(i)) + elseif(dvx.lt.-tmin) then + vfxpbl(i) = min(prpbl(i)*we(i)*dvx*pu1,ust(i)*ust(i)) + else + vfxpbl(i) = 0.0 + endif + delb = govrth(i)*d3*hpbl(i) + delta(i) = min(d1*hpbl(i) + d2*wm2(i)/delb,100.) + delb = govrth(i)*dthvx(i) + deltaoh(i) = d1*hpbl(i) + d2*wm2(i)/delb + deltaoh(i) = max(ezfac*deltaoh(i),hpbl(i)-za(i,kpbl(i)-1)-1.) + deltaoh(i) = min(deltaoh(i) ,hpbl(i)) + rigs(i) = govrth(i)*dthvx(i)*deltaoh(i)/(dux**2.+dvx**2.) + rigs(i) = max(min(rigs(i), rigsmax),rimin) + enlfrac2(i) = max(min(wm3/wstar3(i)/(1.+cpent/rigs(i)),entfmax), entfmin) + enlfrac2(i) = enlfrac2(i)*enlfrac + endif + enddo +! + do k = kts,klpbl + do i = its,ite + if(pblflg(i))then + entfacmf(i,k) = sqrt(((zq(i,k+1)-hpbl(i))/deltaoh(i))**2.) + endif + if(pblflg(i).and.k.ge.kpbl(i))then + entfac(i,k) = ((zq(i,k+1)-hpbl(i))/deltaoh(i))**2. + else + entfac(i,k) = 1.e30 + endif + enddo + enddo +! +! compute diffusion coefficients below pbl +! + do k = kts,klpbl + do i = its,ite + if(k.lt.kpbl(i)) then + zfac(i,k) = min(max((1.-(zq(i,k+1)-zl1(i))/(hpbl(i)-zl1(i))),zfmin),1.) + zfacent(i,k) = (1.-zfac(i,k))**3. + wscalek(i,k) = (ust3(i)+phifac*karman*wstar3(i)*(1.-zfac(i,k)))**h1 + if(sfcflg(i)) then + prfac = conpr + prfac2 = 15.9*wstar3(i)/ust3(i)/(1.+4.*karman*wstar3(i)/ust3(i)) + prnumfac = -3.*(max(zq(i,k+1)-sfcfrac*hpbl(i),0.))**2./hpbl(i)**2. + else + prfac = 0. + prfac2 = 0. + prnumfac = 0. + phim8z = 1.+aphi5*zol1(i)*zq(i,k+1)/zl1(i) + wscalek(i,k) = ust(i)/phim8z + wscalek(i,k) = max(wscalek(i,k),0.001) + endif + prnum0 = (phih(i)/phim(i)+prfac) + prnum0 = max(min(prnum0,prmax),prmin) + xkzm(i,k) = wscalek(i,k)*karman*zq(i,k+1)*zfac(i,k)**pfac + prnum = 1. + (prnum0-1.)*exp(prnumfac) + xkzq(i,k) = xkzm(i,k)/prnum*zfac(i,k)**(pfac_q-pfac) + prnum0 = prnum0/(1.+prfac2*karman*sfcfrac) + prnum = 1. + (prnum0-1.)*exp(prnumfac) + xkzh(i,k) = xkzm(i,k)/prnum + xkzm(i,k) = xkzm(i,k)+xkzom(i,k) + xkzh(i,k) = xkzh(i,k)+xkzoh(i,k) + xkzq(i,k) = xkzq(i,k)+xkzoh(i,k) + xkzm(i,k) = min(xkzm(i,k),xkzmax) + xkzh(i,k) = min(xkzh(i,k),xkzmax) + xkzq(i,k) = min(xkzq(i,k),xkzmax) + endif + enddo + enddo +! +! compute diffusion coefficients over pbl (free atmosphere) +! + do k = kts,kte-1 + do i = its,ite + if(k.ge.kpbl(i)) then + ss = ((ux(i,k+1)-ux(i,k))*(ux(i,k+1)-ux(i,k)) & + +(vx(i,k+1)-vx(i,k))*(vx(i,k+1)-vx(i,k))) & + /(dza(i,k+1)*dza(i,k+1))+1.e-9 + govrthv = g/(0.5*(thvx(i,k+1)+thvx(i,k))) + ri = govrthv*(thvx(i,k+1)-thvx(i,k))/(ss*dza(i,k+1)) +! in cloud + if(imvdif.eq.1.and.ntcw.ge.2.and.ntiw.ge.2)then + if((qx(i,k,ntcw)+qx(i,k,ntiw)).gt.0.01e-3 & + .and.(qx(i,k+1,ntcw)+qx(i,k+1,ntiw)).gt.0.01e-3) then + qmean = 0.5*(qx(i,k,1)+qx(i,k+1,1)) + tmean = 0.5*(tx(i,k)+tx(i,k+1)) + alpha = xlv*qmean/rd/tmean + chi = xlv*xlv*qmean/cp/rv/tmean/tmean + ri = (1.+alpha)*(ri-g*g/ss/tmean/cp*((chi-alpha)/(1.+chi))) + endif + endif + zk = karman*zq(i,k+1) + rlamdz = min(max(0.1*dza(i,k+1),rlam),300.) + rlamdz = min(dza(i,k+1),rlamdz) + rl2 = (zk*rlamdz/(rlamdz+zk))**2 + dk = rl2*sqrt(ss) + if(ri.lt.0.)then +! unstable regime + ri = max(ri, rimin) + sri = sqrt(-ri) + xkzm(i,k) = dk*(1+8.*(-ri)/(1+1.746*sri)) + xkzh(i,k) = dk*(1+8.*(-ri)/(1+1.286*sri)) + else +! stable regime + xkzh(i,k) = dk/(1+5.*ri)**2 + prnum = 1.0+2.1*ri + prnum = min(prnum,prmax) + xkzm(i,k) = xkzh(i,k)*prnum + endif +! + xkzm(i,k) = xkzm(i,k)+xkzom(i,k) + xkzh(i,k) = xkzh(i,k)+xkzoh(i,k) + xkzm(i,k) = min(xkzm(i,k),xkzmax) + xkzh(i,k) = min(xkzh(i,k),xkzmax) + xkzml(i,k) = xkzm(i,k) + xkzhl(i,k) = xkzh(i,k) + endif + enddo + enddo +! +! prescribe nonlocal heat transport below pbl +! + do i = its,ite + deltaoh(i) = deltaoh(i)/hpbl(i) + enddo +! + do i = its,ite + mlfrac = mltop-deltaoh(i) + ezfrac = mltop+deltaoh(i) + zfacmf(i,1) = min(max((zq(i,2)/hpbl(i)),zfmin),1.) + sfcfracn = max(sfcfracn1,zfacmf(i,1)) +! + sflux0 = (a11+a12*sfcfracn)*sflux(i) + snlflux0 = nlfrac*sflux0 + amf1 = snlflux0/sfcfracn + amf2 = -snlflux0/(mlfrac-sfcfracn) + bmf2 = -mlfrac*amf2 + amf3 = snlflux0*enlfrac2(i)/deltaoh(i) + bmf3 = -amf3*mlfrac + hfxpbl(i) = amf3+bmf3 + pth1=pthnl(dx(i),cslen(i)) + hfxpbl(i) = hfxpbl(i)*pth1 +! + do k = kts,klpbl + zfacmf(i,k) = max((zq(i,k+1)/hpbl(i)),zfmin) + if(pblflg(i).and.k.lt.kpbl(i)) then + if(zfacmf(i,k).le.sfcfracn) then + mf(i,k) = amf1*zfacmf(i,k) + else if (zfacmf(i,k).le.mlfrac) then + mf(i,k) = amf2*zfacmf(i,k)+bmf2 + endif + mf(i,k) = mf(i,k)+hfxpbl(i)*exp(-entfacmf(i,k)) + mf(i,k) = mf(i,k)*pth1 + endif + enddo + enddo +! +! compute tridiagonal matrix elements for heat +! + do k = kts,kte + do i = its,ite + au(i,k) = 0. + al(i,k) = 0. + ad(i,k) = 0. + f1(i,k) = 0. + enddo + enddo +! + do i = its,ite + ad(i,1) = 1. + f1(i,1) = thx(i,1)-300.+hfx(i)/cont/del(i,1)*dt2 + enddo +! + do k = kts,kte-1 + do i = its,ite + dtodsd = dt2/del(i,k) + dtodsu = dt2/del(i,k+1) + dsig = p2d(i,k)-p2d(i,k+1) + rdz = 1./dza(i,k+1) + tem1 = dsig*xkzh(i,k)*rdz + if(pblflg(i).and.k.lt.kpbl(i)) then + dsdzt = tem1*(-mf(i,k)/xkzh(i,k)) + f1(i,k) = f1(i,k)+dtodsd*dsdzt + f1(i,k+1) = thx(i,k+1)-300.-dtodsu*dsdzt + elseif(pblflg(i).and.k.ge.kpbl(i).and.entfac(i,k).lt.4.6) then + xkzh(i,k) = -we(i)*dza(i,kpbl(i))*exp(-entfac(i,k)) + xkzh(i,k) = sqrt(xkzh(i,k)*xkzhl(i,k)) + xkzh(i,k) = max(xkzh(i,k),xkzoh(i,k)) + xkzh(i,k) = min(xkzh(i,k),xkzmax) + f1(i,k+1) = thx(i,k+1)-300. + else + f1(i,k+1) = thx(i,k+1)-300. + endif + tem1 = dsig*xkzh(i,k)*rdz + dsdz2 = tem1*rdz + au(i,k) = -dtodsd*dsdz2 + al(i,k) = -dtodsu*dsdz2 +! +! scale dependency for local heat transport +! + zfacdx=0.2*hpbl(i)/zq(i,k+1) + delxy=dx(i)*max(zfacdx,1.0) + pth1=pthl(delxy,hpbl(i)) + if(pblflg(i).and.k.lt.kpbl(i)) then + au(i,k) = au(i,k)*pth1 + al(i,k) = al(i,k)*pth1 + endif + ad(i,k) = ad(i,k)-au(i,k) + ad(i,k+1) = 1.-al(i,k) + enddo + enddo +! +! copies here to avoid duplicate input args for tridin +! + do k = kts,kte + do i = its,ite + cu(i,k) = au(i,k) + r1(i,k) = f1(i,k) + enddo + enddo +! + call tridin_ysu(al,ad,cu,r1,au,f1,its,ite,kts,kte,1) +! +! recover tendencies of heat +! + do k = kte,kts,-1 + do i = its,ite + ttend = (f1(i,k)-thx(i,k)+300.)*rdt*pi2d(i,k) + ttnp(i,k) = ttnp(i,k)+ttend + dtsfc(i) = dtsfc(i)+ttend*cont*del(i,k) + if(k.eq.kte) then + tflux_e(i,k) = ttend*dz8w2d(i,k) + else + tflux_e(i,k) = tflux_e(i,k+1) + ttend*dz8w2d(i,k) + endif + enddo + enddo +! +! compute tridiagonal matrix elements for moisture, clouds, and gases +! + do k = kts,kte + do i = its,ite + au(i,k) = 0. + al(i,k) = 0. + ad(i,k) = 0. + enddo + enddo +! + do ic = 1,ndiff + do i = its,ite + do k = kts,kte + f3(i,k,ic) = 0. + enddo + enddo + enddo +! + do i = its,ite + ad(i,1) = 1. + f3(i,1,1) = qx(i,1,1)+qfx(i)*g/del(i,1)*dt2 + enddo +! + if(ndiff.ge.2) then + do ic = 2,ndiff + do i = its,ite + f3(i,1,ic) = qx(i,1,ic) + enddo + enddo + endif +! + do k = kts,kte-1 + do i = its,ite + if(k.ge.kpbl(i)) then + xkzq(i,k) = xkzh(i,k) + endif + enddo + enddo +! + do k = kts,kte-1 + do i = its,ite + dtodsd = dt2/del(i,k) + dtodsu = dt2/del(i,k+1) + dsig = p2d(i,k)-p2d(i,k+1) + rdz = 1./dza(i,k+1) + tem1 = dsig*xkzq(i,k)*rdz + if(pblflg(i).and.k.lt.kpbl(i)) then + dsdzq = tem1*(-qfxpbl(i)*zfacent(i,k)/xkzq(i,k)) + f3(i,k,1) = f3(i,k,1)+dtodsd*dsdzq + f3(i,k+1,1) = qx(i,k+1,1)-dtodsu*dsdzq + elseif(pblflg(i).and.k.ge.kpbl(i).and.entfac(i,k).lt.4.6) then + xkzq(i,k) = -we(i)*dza(i,kpbl(i))*exp(-entfac(i,k)) + xkzq(i,k) = sqrt(xkzq(i,k)*xkzhl(i,k)) + xkzq(i,k) = max(xkzq(i,k),xkzoh(i,k)) + xkzq(i,k) = min(xkzq(i,k),xkzmax) + f3(i,k+1,1) = qx(i,k+1,1) + else + f3(i,k+1,1) = qx(i,k+1,1) + endif + tem1 = dsig*xkzq(i,k)*rdz + dsdz2 = tem1*rdz + au(i,k) = -dtodsd*dsdz2 + al(i,k) = -dtodsu*dsdz2 +! +! scale dependency for local moisture transport +! + zfacdx=0.2*hpbl(i)/zq(i,k+1) + delxy=dx(i)*max(zfacdx,1.0) + pq1=pq(delxy,hpbl(i)) + if(pblflg(i).and.k.lt.kpbl(i)) then + au(i,k) = au(i,k)*pq1 + al(i,k) = al(i,k)*pq1 + endif + ad(i,k) = ad(i,k)-au(i,k) + ad(i,k+1) = 1.-al(i,k) + enddo + enddo +! + if(ndiff.ge.2) then + do ic = 2,ndiff + do k = kts,kte-1 + do i = its,ite + f3(i,k+1,ic) = qx(i,k+1,ic) + enddo + enddo + enddo + endif +! +! copies here to avoid duplicate input args for tridin +! + do k = kts,kte + do i = its,ite + cu(i,k) = au(i,k) + enddo + enddo +! + do ic = 1,ndiff + do k = kts,kte + do i = its,ite + r3(i,k,ic) = f3(i,k,ic) + enddo + enddo + enddo +! +! solve tridiagonal problem for moisture, clouds, and gases +! + call tridin_ysu(al,ad,cu,r3,au,f3,its,ite,kts,kte,ndiff) +! +! recover tendencies of heat and moisture +! + do k = kte,kts,-1 + do i = its,ite + qtend = (f3(i,k,1)-qx(i,k,1))*rdt + qtnp(i,k,1) = qtnp(i,k,1)+qtend + dqsfc(i) = dqsfc(i)+qtend*conq*del(i,k) + if(k.eq.kte) then + qflux_e(i,k) = qtend*dz8w2d(i,k) + else + qflux_e(i,k) = qflux_e(i,k+1) + qtend*dz8w2d(i,k) + endif + tvflux_e(i,k) = tflux_e(i,k) + qflux_e(i,k)*ep1*thx(i,k) + enddo + enddo +! print*,"qtnp:",maxval(qtnp(:,:,1)),minval(qtnp(:,:,1)) +! + do k = kts,kte + do i = its,ite + if(pblflg(i).and.k.lt.kpbl(i)) then + hgame_c=c_1*0.2*2.5*(g/thvx(i,k))*wstar(i)/(0.25*(q2x(i,k+1)+q2x(i,k))) + hgame_c=min(hgame_c,gamcre) + if(k.eq.kte)then + hgame2d(i,k)=hgame_c*0.5*tvflux_e(i,k)*hpbl(i) + hgame2d(i,k)=max(hgame2d(i,k),0.0) + else + hgame2d(i,k)=hgame_c*0.5*(tvflux_e(i,k)+tvflux_e(i,k+1))*hpbl(i) + hgame2d(i,k)=max(hgame2d(i,k),0.0) + endif + endif + enddo + enddo +! + if(ndiff.ge.2) then + do ic = 2,ndiff + if(ifvmix(ic)) then + do k = kte,kts,-1 + do i = its,ite + qtend = (f3(i,k,ic)-qx(i,k,ic))*rdt + qtnp(i,k,ic) = qtnp(i,k,ic)+qtend + enddo + enddo + endif + enddo + endif +! +! compute tridiagonal matrix elements for momentum +! + do i = its,ite + do k = kts,kte + au(i,k) = 0. + al(i,k) = 0. + ad(i,k) = 0. + f1(i,k) = 0. + f2(i,k) = 0. + enddo + enddo +! + do i = its,ite + ad(i,1) = 1.+ust(i)**2/wspd1(i)*rhox(i)*g/del(i,1)*dt2 & + *(wspd1(i)/wspd(i))**2 + f1(i,1) = ux(i,1) + f2(i,1) = vx(i,1) + enddo +! + do k = kts,kte-1 + do i = its,ite + dtodsd = dt2/del(i,k) + dtodsu = dt2/del(i,k+1) + dsig = p2d(i,k)-p2d(i,k+1) + rdz = 1./dza(i,k+1) + tem1 = dsig*xkzm(i,k)*rdz + if(pblflg(i).and.k.lt.kpbl(i))then + dsdzu = tem1*(-hgamu(i)/hpbl(i)-ufxpbl(i)*zfacent(i,k)/xkzm(i,k)) + dsdzv = tem1*(-hgamv(i)/hpbl(i)-vfxpbl(i)*zfacent(i,k)/xkzm(i,k)) + f1(i,k) = f1(i,k)+dtodsd*dsdzu + f1(i,k+1) = ux(i,k+1)-dtodsu*dsdzu + f2(i,k) = f2(i,k)+dtodsd*dsdzv + f2(i,k+1) = vx(i,k+1)-dtodsu*dsdzv + elseif(pblflg(i).and.k.ge.kpbl(i).and.entfac(i,k).lt.4.6) then + xkzm(i,k) = prpbl(i)*xkzh(i,k) + xkzm(i,k) = sqrt(xkzm(i,k)*xkzml(i,k)) + xkzm(i,k) = max(xkzm(i,k),xkzom(i,k)) + xkzm(i,k) = min(xkzm(i,k),xkzmax) + f1(i,k+1) = ux(i,k+1) + f2(i,k+1) = vx(i,k+1) + else + f1(i,k+1) = ux(i,k+1) + f2(i,k+1) = vx(i,k+1) + endif + tem1 = dsig*xkzm(i,k)*rdz + dsdz2 = tem1*rdz + au(i,k) = -dtodsd*dsdz2 + al(i,k) = -dtodsu*dsdz2 +! +! scale dependency for local momentum transport +! + zfacdx=0.2*hpbl(i)/zq(i,k+1) + delxy=dx(i)*max(zfacdx,1.0) + pu1=pu(delxy,hpbl(i)) + if(pblflg(i).and.k.lt.kpbl(i)) then + au(i,k) = au(i,k)*pu1 + al(i,k) = al(i,k)*pu1 + endif + ad(i,k) = ad(i,k)-au(i,k) + ad(i,k+1) = 1.-al(i,k) + enddo + enddo +! +! copies here to avoid duplicate input args for tridin +! + do k = kts,kte + do i = its,ite + cu(i,k) = au(i,k) + r1(i,k) = f1(i,k) + r2(i,k) = f2(i,k) + enddo + enddo +! +! solve tridiagonal problem for momentum +! + call tridi1n(al,ad,cu,r1,r2,au,f1,f2,its,ite,kts,kte,1) +! +! recover tendencies of momentum +! + do k = kte,kts,-1 + do i = its,ite + utend = (f1(i,k)-ux(i,k))*rdt + vtend = (f2(i,k)-vx(i,k))*rdt + utnp(i,k) = utnp(i,k)+utend + vtnp(i,k) = vtnp(i,k)+vtend + dusfc(i) = dusfc(i) + utend*conwrc*del(i,k) + dvsfc(i) = dvsfc(i) + vtend*conwrc*del(i,k) + enddo + enddo +! + do i = its,ite + kpbl1d(i) = kpbl(i) + enddo +! +!---- calculate sgs tke which is consistent with shinhongpbl algorithm +! + if (shinhong_tke_diag.eq.1) then +! + tke_calculation: do i = its,ite + do k = kts+1,kte + s2(k) = 0.0 + gh(k) = 0.0 + rig(k) = 0.0 + el(k) = 0.0 + akmk(k) = 0.0 + akhk(k) = 0.0 + mfk(k) = 0.0 + ufxpblk(k) = 0.0 + vfxpblk(k) = 0.0 + qfxpblk(k) = 0.0 + enddo +! + do k = kts,kte + uxk(k) = 0.0 + vxk(k) = 0.0 + txk(k) = 0.0 + thxk(k) = 0.0 + thvxk(k) = 0.0 + q2xk(k) = 0.0 + hgame(k) = 0.0 + ps1d(k) = 0.0 + pb1d(k) = 0.0 + eps1d(k) = 0.0 + pt1d(k) = 0.0 + xkze1d(k) = 0.0 + eflx_l1d(k) = 0.0 + eflx_nl1d(k) = 0.0 + ptke1(k) = 1.0 + enddo +! + do k = kts,kte+1 + zqk(k) = 0.0 + enddo +! + do k = kts,kte + uxk(k) = ux(i,k) + vxk(k) = vx(i,k) + txk(k) = tx(i,k) + thxk(k) = thx(i,k) + thvxk(k) = thvx(i,k) + q2xk(k) = q2x(i,k) + hgame(k) = hgame2d(i,k) + enddo +! + do k = kts,kte-1 + if(pblflg(i).and.k.le.kpbl(i)) then + zfacdx = 0.2*hpbl(i)/za(i,k) + delxy = dx(i)*max(zfacdx,1.0) + ptke1(k+1) = ptke(delxy,hpbl(i)) + endif + enddo +! + do k = kts,kte+1 + zqk(k) = zq(i,k) + enddo +! + do k = kts+1,kte + akmk(k) = xkzm(i,k-1) + akhk(k) = xkzh(i,k-1) + mfk(k) = mf(i,k-1)/xkzh(i,k-1) + ufxpblk(k) = ufxpbl(i)*zfacent(i,k-1)/xkzm(i,k-1) + vfxpblk(k) = vfxpbl(i)*zfacent(i,k-1)/xkzm(i,k-1) + qfxpblk(k) = qfxpbl(i)*zfacent(i,k-1)/xkzq(i,k-1) + enddo +! + if(pblflg(i)) then + k = kpbl(i) - 1 + dex = 0.25*(q2xk(k+2)-q2xk(k)) + efxpbl(i) = we(i)*dex + endif +! +!---- find the mixing length +! + call mixlen(lmh,uxk,vxk,txk,thxk,qx(i,kts,1),qx(i,kts,ntcw) & + ,q2xk,zqk,ust(i),corf,epshol(i) & + ,s2,gh,rig,el & + ,hpbl(i),kpbl(i),lmxl,ct(i) & + ,hgamu(i),hgamv(i),hgamq(i),pblflg(i) & + ,mfk,ufxpblk,vfxpblk,qfxpblk & + ,ep1,karman,cp & + ,kts,kte ) +! +!---- solve for the production/dissipation of the turbulent kinetic energy +! + call prodq2(lmh,dt,ust(i),s2,rig,q2xk,el,zqk,akmk,akhk & + ,uxk,vxk,thxk,thvxk & + ,hgamu(i),hgamv(i),hgamq(i),dx(i) & + ,hpbl(i),pblflg(i),kpbl(i) & + ,mfk,ufxpblk,vfxpblk,qfxpblk & + ,ep1 & + ,kts,kte ) +! +! +!---- carry out the vertical diffusion of turbulent kinetic energy +! + call vdifq(lmh,dt,q2xk,el,zqk & + ,akhk,ptke1 & + ,hgame,hpbl(i),pblflg(i),kpbl(i) & + ,efxpbl(i) & + ,kts,kte ) +! +!---- save the new tke and mixing length. +! + do k = kts,kte + q2x(i,k) = amax1(q2xk(k),epsq2l) + enddo +! + enddo tke_calculation + endif +! +!---- end of tke calculation +! +! +!---- end of vertical diffusion +! + end subroutine shinhongvdif_run +!------------------------------------------------------------------------------- +! +!------------------------------------------------------------------------------- + subroutine tridi1n(cl,cm,cu,r1,r2,au,f1,f2,its,ite,kts,kte,nt) +!------------------------------------------------------------------------------- + use machine , only : kind_phys + implicit none +!------------------------------------------------------------------------------- +! + integer, intent(in ) :: its,ite, kts,kte, nt +! + real(kind=kind_phys), dimension( its:ite, kts+1:kte+1 ) , & + intent(in ) :: cl +! + real(kind=kind_phys), dimension( its:ite, kts:kte ) , & + intent(in ) :: cm, & + r1 + real(kind=kind_phys), dimension( its:ite, kts:kte,nt ) , & + intent(in ) :: r2 +! + real(kind=kind_phys), dimension( its:ite, kts:kte ) , & + intent(inout) :: au, & + cu, & + f1 + real(kind=kind_phys), dimension( its:ite, kts:kte,nt ) , & + intent(inout) :: f2 +! + real(kind=kind_phys) :: fk + integer :: i,k,l,n,it +! +!------------------------------------------------------------------------------- +! + l = ite + n = kte +! + do i = its,l + fk = 1./cm(i,1) + au(i,1) = fk*cu(i,1) + f1(i,1) = fk*r1(i,1) + enddo +! + do it = 1,nt + do i = its,l + fk = 1./cm(i,1) + f2(i,1,it) = fk*r2(i,1,it) + enddo + enddo +! + do k = kts+1,n-1 + do i = its,l + fk = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) + au(i,k) = fk*cu(i,k) + f1(i,k) = fk*(r1(i,k)-cl(i,k)*f1(i,k-1)) + enddo + enddo +! + do it = 1,nt + do k = kts+1,n-1 + do i = its,l + fk = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) + f2(i,k,it) = fk*(r2(i,k,it)-cl(i,k)*f2(i,k-1,it)) + enddo + enddo + enddo +! + do i = its,l + fk = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) + f1(i,n) = fk*(r1(i,n)-cl(i,n)*f1(i,n-1)) + enddo +! + do it = 1,nt + do i = its,l + fk = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) + f2(i,n,it) = fk*(r2(i,n,it)-cl(i,n)*f2(i,n-1,it)) + enddo + enddo +! + do k = n-1,kts,-1 + do i = its,l + f1(i,k) = f1(i,k)-au(i,k)*f1(i,k+1) + enddo + enddo +! + do it = 1,nt + do k = n-1,kts,-1 + do i = its,l + f2(i,k,it) = f2(i,k,it)-au(i,k)*f2(i,k+1,it) + enddo + enddo + enddo +! + end subroutine tridi1n +!------------------------------------------------------------------------------- +! +!------------------------------------------------------------------------------- + subroutine tridin_ysu(cl,cm,cu,r2,au,f2,its,ite,kts,kte,nt) +!------------------------------------------------------------------------------- + use machine , only : kind_phys + implicit none +!------------------------------------------------------------------------------- +! + integer, intent(in ) :: its,ite, kts,kte, nt +! + real(kind=kind_phys), dimension( its:ite, kts+1:kte+1 ) , & + intent(in ) :: cl +! + real(kind=kind_phys), dimension( its:ite, kts:kte ) , & + intent(in ) :: cm + real(kind=kind_phys), dimension( its:ite, kts:kte,nt ) , & + intent(in ) :: r2 +! + real(kind=kind_phys), dimension( its:ite, kts:kte ) , & + intent(inout) :: au, & + cu + real(kind=kind_phys), dimension( its:ite, kts:kte,nt ) , & + intent(inout) :: f2 +! + real(kind=kind_phys) :: fk + integer :: i,k,l,n,it +! +!------------------------------------------------------------------------------- +! + l = ite + n = kte +! + do it = 1,nt + do i = its,l + fk = 1./cm(i,1) + au(i,1) = fk*cu(i,1) + f2(i,1,it) = fk*r2(i,1,it) + enddo + enddo +! + do it = 1,nt + do k = kts+1,n-1 + do i = its,l + fk = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) + au(i,k) = fk*cu(i,k) + f2(i,k,it) = fk*(r2(i,k,it)-cl(i,k)*f2(i,k-1,it)) + enddo + enddo + enddo +! + do it = 1,nt + do i = its,l + fk = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) + f2(i,n,it) = fk*(r2(i,n,it)-cl(i,n)*f2(i,n-1,it)) + enddo + enddo +! + do it = 1,nt + do k = n-1,kts,-1 + do i = its,l + f2(i,k,it) = f2(i,k,it)-au(i,k)*f2(i,k+1,it) + enddo + enddo + enddo +! + end subroutine tridin_ysu +!------------------------------------------------------------------------------- +! +!------------------------------------------------------------------------------- + subroutine mixlen(lmh,u,v,t,the,q,cwm,q2,z,ustar,corf,epshol, & + s2,gh,ri,el,hpbl,lpbl,lmxl,ct, & + hgamu,hgamv,hgamq,pblflg, & + mf,ufxpbl,vfxpbl,qfxpbl, & + p608,vkarman,cp, & + kts,kte) +!------------------------------------------------------------------------------- + use machine , only : kind_phys + implicit none +!------------------------------------------------------------------------------- +! qnse model constants +!------------------------------------------------------------------------------- + real(kind=kind_phys),parameter :: blckdr=0.0063,cn=0.75 + real(kind=kind_phys),parameter :: eps1=1.e-12,epsl=0.32,epsru=1.e-7,epsrs=1.e-7 + real(kind=kind_phys),parameter :: el0max=1000.,el0min=1.,elfc=0.23*0.5 + real(kind=kind_phys),parameter :: alph=0.30,beta=1./273.,g=9.81,btg=beta*g + real(kind=kind_phys),parameter :: a1=0.659888514560862645,a2x=0.6574209922667784586 + real(kind=kind_phys),parameter :: b1=11.87799326209552761,b2=7.226971804046074028 + real(kind=kind_phys),parameter :: c1=0.000830955950095854396 + real(kind=kind_phys),parameter :: adnh= 9.*a1*a2x*a2x*(12.*a1+3.*b2)*btg*btg + real(kind=kind_phys),parameter :: adnm=18.*a1*a1*a2x*(b2-3.*a2x)*btg + real(kind=kind_phys),parameter :: bdnh= 3.*a2x*(7.*a1+b2)*btg,bdnm= 6.*a1*a1 +!------------------------------------------------------------------------------- +! free term in the equilibrium equation for (l/q)**2 +!------------------------------------------------------------------------------- + real(kind=kind_phys),parameter :: aeqh=9.*a1*a2x*a2x*b1*btg*btg & + +9.*a1*a2x*a2x*(12.*a1+3.*b2)*btg*btg + real(kind=kind_phys),parameter :: aeqm=3.*a1*a2x*b1*(3.*a2x+3.*b2*c1+18.*a1*c1-b2) & + *btg+18.*a1*a1*a2x*(b2-3.*a2x)*btg +!------------------------------------------------------------------------------- +! forbidden turbulence area +!------------------------------------------------------------------------------- + real(kind=kind_phys),parameter :: requ=-aeqh/aeqm + real(kind=kind_phys),parameter :: epsgh=1.e-9,epsgm=requ*epsgh +!------------------------------------------------------------------------------- +! near isotropy for shear turbulence, ww/q2 lower limit +!------------------------------------------------------------------------------- + real(kind=kind_phys),parameter :: ubryl=(18.*requ*a1*a1*a2x*b2*c1*btg & + +9.*a1*a2x*a2x*b2*btg*btg) & + /(requ*adnm+adnh) + real(kind=kind_phys),parameter :: ubry=(1.+epsrs)*ubryl,ubry3=3.*ubry + real(kind=kind_phys),parameter :: aubh=27.*a1*a2x*a2x*b2*btg*btg-adnh*ubry3 + real(kind=kind_phys),parameter :: aubm=54.*a1*a1*a2x*b2*c1*btg -adnm*ubry3 + real(kind=kind_phys),parameter :: bubh=(9.*a1*a2x+3.*a2x*b2)*btg-bdnh*ubry3 + real(kind=kind_phys),parameter :: bubm=18.*a1*a1*c1 -bdnm*ubry3 + real(kind=kind_phys),parameter :: cubr=1.-ubry3,rcubr=1./cubr +!------------------------------------------------------------------------------- +! k profile constants +!------------------------------------------------------------------------------- + real(kind=kind_phys),parameter :: elcbl=0.77 +!------------------------------------------------------------------------------- +! + integer, intent(in ) :: kts,kte + integer, intent(in ) :: lmh,lmxl,lpbl +! + real(kind=kind_phys), intent(in ) :: p608,vkarman,cp + real(kind=kind_phys), intent(in ) :: hpbl,corf,ustar,hgamu,hgamv,hgamq + real(kind=kind_phys), intent(inout) :: ct,epshol +! + real(kind=kind_phys), dimension( kts:kte ) , & + intent(in ) :: cwm, & + q, & + q2, & + t, & + the, & + u, & + v +! + real(kind=kind_phys), dimension( kts+1:kte ) , & + intent(in ) :: mf, & + ufxpbl, & + vfxpbl, & + qfxpbl +! + real(kind=kind_phys), dimension( kts:kte+1 ) , & + intent(in ) :: z +! + real(kind=kind_phys), dimension( kts+1:kte ) , & + intent(out ) :: el, & + ri, & + gh, & + s2 +! + logical,intent(in) :: pblflg +! +! local vars +! + integer :: k,lpblm + real(kind=kind_phys) :: suk,svk,elocp + real(kind=kind_phys) :: a,aden,b,bden,aubr,bubr,blmx,el0,eloq2x,ghl,s2l, & + qol2st,qol2un,qdzl,rdz,sq,srel,szq,tem,thm,vkrmz,rlambda, & + rlb,rln,f + real(kind=kind_phys) :: ckp + real(kind=kind_phys), dimension( kts:kte ) :: q1, & + en2 + real(kind=kind_phys), dimension( kts+1:kte ) :: dth, & + elm, & + rel +! +!------------------------------------------------------------------------------- +! + elocp=2.72e6/cp + ct=0. +! + do k = kts,kte + q1(k) = 0. + enddo +! + do k = kts+1,kte + dth(k) = the(k)-the(k-1) + enddo +! + do k = kts+2,kte + if(dth(k)>0..and.dth(k-1)<=0.)then + dth(k)=dth(k)+ct + exit + endif + enddo +! +! compute local gradient richardson number +! + do k = kte,kts+1,-1 + rdz=2./(z(k+1)-z(k-1)) + s2l=((u(k)-u(k-1))**2+(v(k)-v(k-1))**2)*rdz*rdz ! s**2 + if(pblflg.and.k.le.lpbl)then + suk=(u(k)-u(k-1))*rdz + svk=(v(k)-v(k-1))*rdz + s2l=(suk-hgamu/hpbl-ufxpbl(k))*suk+(svk-hgamv/hpbl-vfxpbl(k))*svk + endif + s2l=max(s2l,epsgm) + s2(k)=s2l +! + tem=(t(k)+t(k-1))*0.5 + thm=(the(k)+the(k-1))*0.5 + a=thm*p608 + b=(elocp/tem-1.-p608)*thm + ghl=(dth(k)*((q(k)+q(k-1)+cwm(k)+cwm(k-1))*(0.5*p608)+1.) & + +(q(k)-q(k-1)+cwm(k)-cwm(k-1))*a & + +(cwm(k)-cwm(k-1))*b)*rdz ! dtheta/dz + if(pblflg.and.k.le.lpbl)then + ghl=ghl-mf(k)-(hgamq/hpbl+qfxpbl(k))*a + endif + if(abs(ghl)<=epsgh)ghl=epsgh +! + en2(k)=ghl*g/thm ! n**2 + gh(k)=ghl + ri(k)=en2(k)/s2l + enddo +! +! find maximum mixing lengths and the level of the pbl top +! + do k = kte,kts+1,-1 + s2l=s2(k) + ghl=gh(k) + if(ghl>=epsgh)then + if(s2l/ghl<=requ)then + elm(k)=epsl + else + aubr=(aubm*s2l+aubh*ghl)*ghl + bubr= bubm*s2l+bubh*ghl + qol2st=(-0.5*bubr+sqrt(bubr*bubr*0.25-aubr*cubr))*rcubr + eloq2x=1./qol2st + elm(k)=max(sqrt(eloq2x*q2(k)),epsl) + endif + else + aden=(adnm*s2l+adnh*ghl)*ghl + bden= bdnm*s2l+bdnh*ghl + qol2un=-0.5*bden+sqrt(bden*bden*0.25-aden) + eloq2x=1./(qol2un+epsru) ! repsr1/qol2un + elm(k)=max(sqrt(eloq2x*q2(k)),epsl) + endif + enddo +! + do k = lpbl,lmh,-1 + q1(k)=sqrt(q2(k)) + enddo +! + szq=0. + sq =0. + do k = kte,kts+1,-1 + qdzl=(q1(k)+q1(k-1))*(z(k)-z(k-1)) + szq=(z(k)+z(k-1)-z(lmh)-z(lmh))*qdzl+szq + sq=qdzl+sq + enddo +! +! computation of asymptotic l in blackadar formula +! + el0=min(alph*szq*0.5/sq,el0max) + el0=max(el0 ,el0min) +! +! above the pbl top +! + lpblm=min(lpbl+1,kte) + do k = kte,lpblm,-1 + el(k)=(z(k+1)-z(k-1))*elfc + rel(k)=el(k)/elm(k) + enddo +! +! inside the pbl +! + epshol=min(epshol,0.0) + ckp=elcbl*((1.0-8.0*epshol)**(1./3.)) + if(lpbl>lmh)then + do k = lpbl,lmh+1,-1 + vkrmz=(z(k)-z(lmh))*vkarman + if(pblflg) then + vkrmz=ckp*(z(k)-z(lmh))*vkarman + el(k)=vkrmz/(vkrmz/el0+1.) + else + el(k)=vkrmz/(vkrmz/el0+1.) + endif + rel(k)=el(k)/elm(k) + enddo + endif +! + do k = lpbl-1,lmh+2,-1 + srel=min(((rel(k-1)+rel(k+1))*0.5+rel(k))*0.5,rel(k)) + el(k)=max(srel*elm(k),epsl) + enddo +! +! mixing length for the qnse model in stable case +! + f=max(corf,eps1) + rlambda=f/(blckdr*ustar) + do k = kte,kts+1,-1 + if(en2(k)>=0.0)then ! stable case + vkrmz=(z(k)-z(lmh))*vkarman + rlb=rlambda+1./vkrmz + rln=sqrt(2.*en2(k)/q2(k))/cn + el(k)=1./(rlb+rln) + endif + enddo +! + end subroutine mixlen +!------------------------------------------------------------------------------- +! +!------------------------------------------------------------------------------- + subroutine prodq2(lmh,dtturbl,ustar,s2,ri,q2,el,z,akm,akh, & + uxk,vxk,thxk,thvxk, & + hgamu,hgamv,hgamq,delxy, & + hpbl,pblflg,kpbl, & + mf,ufxpbl,vfxpbl,qfxpbl, & + p608, & + kts,kte) +!------------------------------------------------------------------------------- + use machine , only : kind_phys + implicit none +!------------------------------------------------------------------------------- +! + real(kind=kind_phys),parameter :: epsq2l = 0.01,c0 = 0.55,ceps = 16.6,g = 9.81 +! + integer, intent(in ) :: kts,kte + integer, intent(in ) :: lmh,kpbl +! + real(kind=kind_phys), intent(in ) :: p608,dtturbl,ustar + real(kind=kind_phys), intent(in ) :: hgamu,hgamv,hgamq,delxy,hpbl +! + logical, intent(in ) :: pblflg +! + real(kind=kind_phys), dimension( kts:kte ) , & + intent(in ) :: uxk, & + vxk, & + thxk, & + thvxk + real(kind=kind_phys), dimension( kts+1:kte ) , & + intent(in ) :: s2, & + ri, & + akm, & + akh, & + el, & + mf, & + ufxpbl, & + vfxpbl, & + qfxpbl +! + real(kind=kind_phys), dimension( kts:kte+1 ) , & + intent(in ) :: z +! + real(kind=kind_phys), dimension( kts:kte ) , & + intent(inout) :: q2 +! +! local vars +! + integer :: k +! + real(kind=kind_phys) :: s2l,q2l,deltaz,akml,akhl,en2,pr,bpr,dis,rc02 + real(kind=kind_phys) :: suk,svk,gthvk,govrthvk,pru,prv + real(kind=kind_phys) :: thm,disel +! +!------------------------------------------------------------------------------- +! + rc02=2.0/(c0*c0) +! +! start of production/dissipation loop +! + main_integration: do k = kts+1,kte + deltaz=0.5*(z(k+1)-z(k-1)) + s2l=s2(k) + q2l=q2(k) + suk=(uxk(k)-uxk(k-1))/deltaz + svk=(vxk(k)-vxk(k-1))/deltaz + gthvk=(thvxk(k)-thvxk(k-1))/deltaz + govrthvk=g/(0.5*(thvxk(k)+thvxk(k-1))) + akml=akm(k) + akhl=akh(k) + en2=ri(k)*s2l !n**2 + thm=(thxk(k)+thxk(k-1))*0.5 +! +! turbulence production term +! + if(pblflg.and.k.le.kpbl)then + pru=(akml*(suk-hgamu/hpbl-ufxpbl(k)))*suk + prv=(akml*(svk-hgamv/hpbl-vfxpbl(k)))*svk + else + pru=akml*suk*suk + prv=akml*svk*svk + endif + pr=pru+prv +! +! buoyancy production +! + if(pblflg.and.k.le.kpbl)then + bpr=(akhl*(gthvk-mf(k)-(hgamq/hpbl+qfxpbl(k))*p608*thm))*govrthvk + else + bpr=akhl*gthvk*govrthvk + endif +! +! dissipation +! + disel=min(delxy,ceps*el(k)) + dis=(q2l)**1.5/disel +! + q2l=q2l+2.0*(pr-bpr-dis)*dtturbl + q2(k)=amax1(q2l,epsq2l) +! +! end of production/dissipation loop +! + enddo main_integration +! +! lower boundary condition for q2 +! + q2(kts)=amax1(rc02*ustar*ustar,epsq2l) +! + end subroutine prodq2 +!------------------------------------------------------------------------------- +! +!------------------------------------------------------------------------------- + subroutine vdifq(lmh,dtdif,q2,el,z, & + akhk,ptke1, & + hgame,hpbl,pblflg,kpbl, & + efxpbl, & + kts,kte) +!------------------------------------------------------------------------------- + use machine , only : kind_phys + implicit none +!------------------------------------------------------------------------------- +! + real(kind=kind_phys),parameter :: c_k=1.0,esq=5.0 +! + integer, intent(in ) :: kts,kte + integer, intent(in ) :: lmh,kpbl +! + real(kind=kind_phys), intent(in ) :: dtdif,hpbl,efxpbl +! + logical, intent(in ) :: pblflg +! + real(kind=kind_phys), dimension( kts:kte ) , & + intent(in ) :: hgame, & + ptke1 + real(kind=kind_phys), dimension( kts+1:kte ) , & + intent(in ) :: el, & + akhk + real(kind=kind_phys), dimension( kts:kte+1 ) , & + intent(in ) :: z +! + real(kind=kind_phys), dimension( kts:kte ) , & + intent(inout) :: q2 +! +! local vars +! + integer :: k +! + real(kind=kind_phys) :: aden,akqs,bden,besh,besm,cden,cf,dtozs,ell,eloq2,eloq4 + real(kind=kind_phys) :: elqdz,esh,esm,esqhf,ghl,gml,q1l,rden,rdz + real(kind=kind_phys) :: zak +! + real(kind=kind_phys), dimension( kts+1:kte ) :: zfacentk + real(kind=kind_phys), dimension( kts+2:kte ) :: akq, & + cm, & + cr, & + dtoz, & + rsq2 +! +!------------------------------------------------------------------------------- +! +! vertical turbulent diffusion +! + esqhf=0.5*esq + do k = kts+1,kte + zak=0.5*(z(k)+z(k-1)) !zak of vdifq = za(k-1) of shinhong2d + zfacentk(k)=(zak/hpbl)**3.0 + enddo +! + do k = kte,kts+2,-1 + dtoz(k)=(dtdif+dtdif)/(z(k+1)-z(k-1)) + akq(k)=c_k*(akhk(k)/(z(k+1)-z(k-1))+akhk(k-1)/(z(k)-z(k-2))) + akq(k)=akq(k)*ptke1(k) + cr(k)=-dtoz(k)*akq(k) + enddo +! + akqs=c_k*akhk(kts+1)/(z(kts+2)-z(kts)) + akqs=akqs*ptke1(kts+1) + cm(kte)=dtoz(kte)*akq(kte)+1. + rsq2(kte)=q2(kte) +! + do k = kte-1,kts+2,-1 + cf=-dtoz(k)*akq(k+1)/cm(k+1) + cm(k)=-cr(k+1)*cf+(akq(k+1)+akq(k))*dtoz(k)+1. + rsq2(k)=-rsq2(k+1)*cf+q2(k) + if(pblflg.and.k.lt.kpbl) then + rsq2(k)=rsq2(k)-dtoz(k)*(2.0*hgame(k)/hpbl)*akq(k+1)*(z(k+1)-z(k)) & + +dtoz(k)*(2.0*hgame(k-1)/hpbl)*akq(k)*(z(k)-z(k-1)) + rsq2(k)=rsq2(k)-dtoz(k)*2.0*efxpbl*zfacentk(k+1) & + +dtoz(k)*2.0*efxpbl*zfacentk(k) + endif + enddo +! + dtozs=(dtdif+dtdif)/(z(kts+2)-z(kts)) + cf=-dtozs*akq(lmh+2)/cm(lmh+2) +! + if(pblflg.and.((lmh+1).lt.kpbl)) then + q2(lmh+1)=(dtozs*akqs*q2(lmh)-rsq2(lmh+2)*cf+q2(lmh+1) & + -dtozs*(2.0*hgame(lmh+1)/hpbl)*akq(lmh+2)*(z(lmh+2)-z(lmh+1)) & + +dtozs*(2.0*hgame(lmh)/hpbl)*akqs*(z(lmh+1)-z(lmh))) + q2(lmh+1)=q2(lmh+1)-dtozs*2.0*efxpbl*zfacentk(lmh+2) & + +dtozs*2.0*efxpbl*zfacentk(lmh+1) + q2(lmh+1)=q2(lmh+1)/((akq(lmh+2)+akqs)*dtozs-cr(lmh+2)*cf+1.) + else + q2(lmh+1)=(dtozs*akqs*q2(lmh)-rsq2(lmh+2)*cf+q2(lmh+1)) & + /((akq(lmh+2)+akqs)*dtozs-cr(lmh+2)*cf+1.) + endif +! + do k = lmh+2,kte + q2(k)=(-cr(k)*q2(k-1)+rsq2(k))/cm(k) + enddo +! + end subroutine vdifq +!------------------------------------------------------------------------------- + function pu(d,h) +!------------------------------------------------------------------------------- + use machine , only : kind_phys + implicit none +!------------------------------------------------------------------------------- + real(kind=kind_phys) :: pu + real(kind=kind_phys),parameter :: pmin = 0.0,pmax = 1.0 + real(kind=kind_phys),parameter :: a1 = 1.0, a2 = 0.070, a3 = 1.0, a4 = 0.142, a5 = 0.071 + real(kind=kind_phys),parameter :: b1 = 2.0, b2 = 0.6666667 + real(kind=kind_phys) :: d,h,doh,num,den +! + doh=d/h + num=a1*(doh)**b1+a2*(doh)**b2 + den=a3*(doh)**b1+a4*(doh)**b2+a5 + pu=num/den + pu=max(pu,pmin) + pu=min(pu,pmax) +! + return + end function +!------------------------------------------------------------------------------- +! +!------------------------------------------------------------------------------- + function pq(d,h) +!------------------------------------------------------------------------------- + use machine , only : kind_phys + implicit none +!------------------------------------------------------------------------------- + real(kind=kind_phys) :: pq + real(kind=kind_phys),parameter :: pmin = 0.0,pmax = 1.0 + real(kind=kind_phys),parameter :: a1 = 1.0, a2 = -0.098, a3 = 1.0, a4 = 0.106, a5 = 0.5 + real(kind=kind_phys),parameter :: b1 = 2.0 + real(kind=kind_phys) :: d,h,doh,num,den +! + doh=d/h + num=a1*(doh)**b1+a2 + den=a3*(doh)**b1+a4 + pq=a5*num/den+(1.-a5) + pq=max(pq,pmin) + pq=min(pq,pmax) +! + return + end function +!------------------------------------------------------------------------------- +! +!------------------------------------------------------------------------------- + function pthnl(d,h) +!------------------------------------------------------------------------------- + use machine , only : kind_phys + implicit none +!------------------------------------------------------------------------------- + real(kind=kind_phys) :: pthnl + real(kind=kind_phys),parameter :: pmin = 0.0,pmax = 1.0 + real(kind=kind_phys),parameter :: a1 = 1.000, a2 = 0.936, a3 = -1.110, & + a4 = 1.000, a5 = 0.312, a6 = 0.329, a7 = 0.243 + real(kind=kind_phys),parameter :: b1 = 2.0, b2 = 0.875 + real(kind=kind_phys) :: d,h,doh,num,den +! + doh=d/h + num=a1*(doh)**b1+a2*(doh)**b2+a3 + den=a4*(doh)**b1+a5*(doh)**b2+a6 + pthnl=a7*num/den+(1.-a7) + pthnl=max(pthnl,pmin) + pthnl=min(pthnl,pmax) +! + return + end function +!------------------------------------------------------------------------------- +! +!------------------------------------------------------------------------------- + function pthl(d,h) +!------------------------------------------------------------------------------- + use machine , only : kind_phys + implicit none +!------------------------------------------------------------------------------- + real(kind=kind_phys) :: pthl + real(kind=kind_phys),parameter :: pmin = 0.0,pmax = 1.0 + real(kind=kind_phys),parameter :: a1 = 1.000, a2 = 0.870, a3 = -0.913, & + a4 = 1.000, a5 = 0.153, a6 = 0.278, a7 = 0.280 + real(kind=kind_phys),parameter :: b1 = 2.0, b2 = 0.5 + real(kind=kind_phys) :: d,h,doh,num,den +! + doh=d/h + num=a1*(doh)**b1+a2*(doh)**b2+a3 + den=a4*(doh)**b1+a5*(doh)**b2+a6 + pthl=a7*num/den+(1.-a7) + pthl=max(pthl,pmin) + pthl=min(pthl,pmax) +! + return + end function +!------------------------------------------------------------------------------- +! +!------------------------------------------------------------------------------- + function ptke(d,h) +!------------------------------------------------------------------------------- + use machine , only : kind_phys + implicit none +!------------------------------------------------------------------------------- + real(kind=kind_phys) :: ptke + real(kind=kind_phys),parameter :: pmin = 0.0,pmax = 1.0 + real(kind=kind_phys),parameter :: a1 = 1.000, a2 = 0.070, & + a3 = 1.000, a4 = 0.142, a5 = 0.071 + real(kind=kind_phys),parameter :: b1 = 2.0, b2 = 0.6666667 + real(kind=kind_phys) :: d,h,doh,num,den +! + doh=d/h + num=a1*(doh)**b1+a2*(doh)**b2 + den=a3*(doh)**b1+a4*(doh)**b2+a5 + ptke=num/den + ptke=max(ptke,pmin) + ptke=min(ptke,pmax) +! + return + end function +!------------------------------------------------------------------------------- + end module shinhongvdif diff --git a/physics/ysuvdif.F90 b/physics/ysuvdif.F90 new file mode 100644 index 000000000..e76f2120b --- /dev/null +++ b/physics/ysuvdif.F90 @@ -0,0 +1,1271 @@ +!> \file ysuvdif.F90 +!! This file contains the CCPP-compliant YSU scheme which computes +!! subgrid vertical turbulence mixing using traditional K-profile method +!! Please refer to (Hong, Noh and Dudhia, 2006, MWR). +!! +!! Subroutine 'ysuvdif_run' computes subgrid vertical turbulence mixing +!! using YSU K-profile method +!! +!---------------------------------------------------------------------- + + module ysuvdif + contains + + subroutine ysuvdif_init () + end subroutine ysuvdif_init + + subroutine ysuvdif_finalize () + end subroutine ysuvdif_finalize + +!> \defgroup YSU FV3GFS ysuvdif_run Main +!! \brief This subroutine contains all of the logic for the +!! YSU scheme. +!! +!> \section arg_table_ysuvdif_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| +!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | +!! | ux | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | +!! | vx | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | +!! | tx | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | +!! | qx | tracer_concentration | model layer mean tracer concentration | kg kg-1 | 3 | real | kind_phys | in | F | +!! | p2d | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | p2di | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | +!! | pi2d | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | +!! | vtnp | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | +!! | utnp | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | +!! | ttnp | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | +!! | qtnp | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers due to model physics | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | +!! | swh | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step | total sky shortwave heating rate | K s-1 | 2 | real | kind_phys | in | F | +!! | hlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step | total sky longwave heating rate | K s-1 | 2 | real | kind_phys | in | F | +!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave | none | 1 | real | kind_phys | in | F | +!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | +!! | ndiff | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | +!! | ntcw | index_for_liquid_cloud_condensate | tracer index for cloud condensate (or liquid water) | index | 0 | integer | | in | F | +!! | ntiw | index_for_ice_cloud_condensate | tracer index for ice water | index | 0 | integer | | in | F | +!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | +!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | +!! | psfcpa | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | +!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | +!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | +!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | +!! | psim | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | +!! | psih | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | +!! | landmask | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | +!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | +!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | wspd | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | +!! | br | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | +!! | g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | +!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | ep1 | ratio_of_vapor_to_dry_air_gas_constants_minus_one | rv/rd - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | +!! | ep2 | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | +!! | xlv | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | +!! | dusfc | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | +!! | dvsfc | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | +!! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | dt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | +!! | kpbl1d | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | +!! | u10 | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | +!! | v10 | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +!------------------------------------------------------------------------------- + subroutine ysuvdif_run(ix,im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & + utnp,vtnp,ttnp,qtnp, & + swh,hlw,xmu,ntrac,ndiff,ntcw,ntiw, & + phii,phil,psfcpa, & + zorl,stress,hpbl,psim,psih, & + landmask,heat,evap,wspd,br, & + g,rd,cp,rv,ep1,ep2,xlv, & + dusfc,dvsfc,dtsfc,dqsfc, & + dt,kpbl1d,u10,v10,errmsg,errflg ) + + use machine , only : kind_phys +! +!------------------------------------------------------------------------------- + implicit none +!------------------------------------------------------------------------------- + real(kind=kind_phys),parameter :: xkzminm = 0.1,xkzminh = 0.01 + real(kind=kind_phys),parameter :: xkzmin = 0.01,xkzmax = 1000.,rimin = -100. + real(kind=kind_phys),parameter :: rlam = 30.,prmin = 0.25,prmax = 4. + real(kind=kind_phys),parameter :: brcr_ub = 0.0,brcr_sb = 0.25,cori = 1.e-4 + real(kind=kind_phys),parameter :: afac = 6.8,bfac = 6.8,pfac = 2.0,pfac_q = 2.0 + real(kind=kind_phys),parameter :: phifac = 8.,sfcfrac = 0.1 + real(kind=kind_phys),parameter :: d1 = 0.02, d2 = 0.05, d3 = 0.001 + real(kind=kind_phys),parameter :: h1 = 0.33333335, h2 = 0.6666667 + real(kind=kind_phys),parameter :: zfmin = 1.e-8,aphi5 = 5.,aphi16 = 16. + real(kind=kind_phys),parameter :: tmin=1.e-2 + real(kind=kind_phys),parameter :: gamcrt = 3.,gamcrq = 2.e-3 + real(kind=kind_phys),parameter :: xka = 2.4e-5 + real(kind=kind_phys),parameter :: rcl = 1.0 + real(kind=kind_phys),parameter :: karman = 0.4 + integer,parameter :: imvdif = 1 + integer,parameter :: ysu_topdown_pblmix = 1 +! +!------------------------------------------------------------------------------------- +! input variables + integer, intent(in ) :: ix,im,km,ntrac,ndiff,ntcw,ntiw + real(kind=kind_phys), intent(in ) :: g,cp,rd,rv,ep1,ep2,xlv,dt + + real(kind=kind_phys), dimension( ix,km ), & + intent(in) :: pi2d,p2d,phil,ux,vx,swh,hlw,tx + + real(kind=kind_phys), dimension( ix,km,ntrac ) , & + intent(in ) :: qx + + real(kind=kind_phys), dimension( ix, km+1 ) , & + intent(in ) :: p2di,phii + + real(kind=kind_phys), dimension( im ) , & + intent(in) :: stress,zorl,heat,evap,wspd,br,psim,psih,psfcpa, & + u10,v10,xmu + integer, dimension(im) ,& + intent(in ) :: landmask +! +!---------------------------------------------------------------------------------- +! input/output variables +! + real(kind=kind_phys), dimension( im,km ) , & + intent(inout) :: utnp,vtnp,ttnp + real(kind=kind_phys), dimension( im,km,ntrac ) , & + intent(inout) :: qtnp +! +!--------------------------------------------------------------------------------- +! output variables + integer, dimension( im ), intent(out ) :: kpbl1d + real(kind=kind_phys), dimension( im ), & + intent(out) :: hpbl + + ! error messages + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +! +!-------------------------------------------------------------------------------- +! +! local vars +! + real(kind=kind_phys), dimension( im ) :: hol + real(kind=kind_phys), dimension( im, km+1 ) :: zq +! + real(kind=kind_phys), dimension( im, km ) :: & + thx,thvx,thlix, & + del, & + dza, & + dzq, & + xkzom, & + xkzoh, & + za +! + real(kind=kind_phys), dimension( im ) :: & + rhox, & + govrth, & + zl1,thermal, & + wscale, & + hgamt,hgamq, & + brdn,brup, & + phim,phih, & + dusfc,dvsfc, & + dtsfc,dqsfc, & + prpbl, & + wspd1,thermalli +! + real(kind=kind_phys), dimension( im, km ) :: xkzm,xkzh, & + f1,f2, & + r1,r2, & + ad,au, & + cu, & + al, & + xkzq, & + zfac, & + rhox2, & + hgamt2 +! + real(kind=kind_phys), dimension( im ) :: & + brcr, & + sflux, & + zol1, & + brcr_sbro +! + real(kind=kind_phys), dimension( im ) :: xland + real(kind=kind_phys), dimension( im ) :: ust + real(kind=kind_phys), dimension( im ) :: hfx + real(kind=kind_phys), dimension( im ) :: qfx + real(kind=kind_phys), dimension( im ) :: znt + real(kind=kind_phys), dimension( im ) :: uox + real(kind=kind_phys), dimension( im ) :: vox +! + real(kind=kind_phys), dimension( im, km, ndiff) :: r3,f3 + integer, dimension( im ) :: kpbl,kpblold +! + logical, dimension( im ) :: pblflg, & + sfcflg, & + stable, & + cloudflg + + logical :: definebrup +! + integer :: n,i,k,l,ic,is,kk + integer :: klpbl, ktrace1, ktrace2, ktrace3 +! +! + real(kind=kind_phys) :: dt2,rdt,spdk2,fm,fh,hol1,gamfac,vpert,prnum,prnum0 + real(kind=kind_phys) :: ss,ri,qmean,tmean,alph,chi,zk,rl2,dk,sri + real(kind=kind_phys) :: brint,dtodsd,dtodsu,rdz,dsdzt,dsdzq,dsdz2,rlamdz + real(kind=kind_phys) :: utend,vtend,ttend,qtend + real(kind=kind_phys) :: dtstep,govrthv + real(kind=kind_phys) :: cont, conq, conw, conwrc, rovcp +! + + real(kind=kind_phys), dimension( im, km ) :: wscalek,wscalek2 + real(kind=kind_phys), dimension( im ) :: wstar + real(kind=kind_phys), dimension( im ) :: delta + real(kind=kind_phys), dimension( im, km ) :: xkzml,xkzhl, & + zfacent,entfac + real(kind=kind_phys), dimension( im ) :: ust3, & + wstar3, & + wstar3_2, & + hgamu,hgamv, & + wm2, we, & + bfxpbl, & + hfxpbl,qfxpbl, & + ufxpbl,vfxpbl, & + dthvx + real(kind=kind_phys) :: prnumfac,bfx0,hfx0,qfx0,delb,dux,dvx, & + dsdzu,dsdzv,wm3,dthx,dqx,wspd10,ross,tem1,dsig,tvcon,conpr, & + prfac,prfac2,phim8z,radsum,tmp1,templ,rvls,temps,ent_eff, & + rcldb,bruptmp,radflux +! +!------------------------------------------------------------------------------- +! +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + klpbl = km +! + rovcp=rd/cp + cont=cp/g + conq=xlv/g + conw=1./g + conwrc = conw*sqrt(rcl) + conpr = bfac*karman*sfcfrac +! +! change xland values + do i=1,im + if(landmask(i).eq.0) then !ocean + xland(i) = 2 + else + xland(i) = 1 !land + end if + end do +! + do k = 1,km + do i = 1,im + thx(i,k) = tx(i,k)/pi2d(i,k) + thlix(i,k) = (tx(i,k)-xlv*qx(i,k,ntcw)/cp-2.834E6*qx(i,k,ntiw)/cp)/pi2d(i,k) + enddo + enddo +! + do k = 1,km + do i = 1,im + tvcon = (1.+ep1*qx(i,k,1)) + thvx(i,k) = thx(i,k)*tvcon + enddo + enddo +! + do i = 1,im + tvcon = (1.+ep1*qx(i,1,1)) + rhox(i) = psfcpa(i)/(rd*tx(i,1)*tvcon) + govrth(i) = g/thx(i,1) + hfx(i) = heat(i)*rhox(i)*cp ! reset to the variable in WRF + qfx(i) = evap(i)*rhox(i) ! reset to the variable in WRF + ust(i) = sqrt(stress(i)) ! reset to the variable in WRF + znt(i) = 0.01*zorl(i) ! reset to the variable in WRF + uox(i) = 0.0 + vox(i) = 0.0 + enddo +! +!-----compute the height of full- and half-sigma levels above ground +! level, and the layer thicknesses. +! + do i = 1,im + zq(i,1) = 0. + enddo +! + do k = 1,km + do i = 1,im + zq(i,k+1) = phii(i,k+1)*conw + tvcon = (1.+ep1*qx(i,k,1)) + rhox2(i,k) = p2d(i,k)/(rd*tx(i,k)*tvcon) + enddo + enddo +! + do k = 1,km + do i = 1,im + za(i,k) = phil(i,k)*conw + dzq(i,k) = zq(i,k+1)-zq(i,k) + del(i,k) = p2di(i,k)-p2di(i,k+1) + enddo + enddo +! + do i = 1,im + dza(i,1) = za(i,1) + enddo +! + do k = 2,km + do i = 1,im + dza(i,k) = za(i,k)-za(i,k-1) + enddo + enddo + +! write(0,*)"===CALLING ysu; input:" +! print*,"t:",tx(1,1),tx(1,2),tx(1,km) +! print*,"u:",ux(1,1),ux(1,2),ux(1,km) +! print*,"v:",vx(1,1),vx(1,2),vx(1,km) +! print*,"q:",qx(1,1,1),qx(1,2,1),qx(1,km,1) +! print*,"exner:",pi2d(1,1),pi2d(1,2),pi2d(1,km) +! print*,"phii:",zq(1,1),zq(1,2),zq(1,km+1) +! print*,"phil:",za(1,1),za(1,2),za(1,km) +! print*,"p2d:",p2d(1,1),p2d(1,2),p2d(1,km) +! print*,"p2di:",p2di(1,1),p2di(1,2),p2di(1,km+1) +! print *,"del:",del(1,1),del(1,2),del(1,km) +! print*,"znt,ust,wspd:",znt(1),ust(1),wspd(1) +! print*,"hfx,qfx,xland:",hfx(1),qfx(1),xland(1) +! print*,"rd,rv,g:",rd,rv,g +! print*,"ep1,ep2,xlv:",ep1,ep2,xlv +! print*,"br,psim,psih:",br(1),psim(1),psih(1) +! print*,"u10,v10:",u10(1),v10(1) +! print*,"psfcpa,cp:",psfcpa(1),cp +! print*,"ntrac,ndiff,ntcw,ntiw:",ntrac,ndiff,ntcw,ntiw +! +! +!-----initialize vertical tendencies and +! +! utnp(:,:) = 0. +! vtnp(:,:) = 0. +! ttnp(:,:) = 0. +! qtnp(:,:,:) = 0. +! + do i = 1,im + wspd1(i) = sqrt( (ux(i,1)-uox(i))*(ux(i,1)-uox(i)) + (vx(i,1)-vox(i))*(vx(i,1)-vox(i)) )+1.e-9 + enddo +! +!---- compute vertical diffusion +! +! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +! compute preliminary variables +! + dtstep = dt + dt2 = 2.*dtstep + rdt = 1./dt2 +! + do i = 1,im + bfxpbl(i) = 0.0 + hfxpbl(i) = 0.0 + qfxpbl(i) = 0.0 + ufxpbl(i) = 0.0 + vfxpbl(i) = 0.0 + hgamu(i) = 0.0 + hgamv(i) = 0.0 + delta(i) = 0.0 + wstar3_2(i) = 0.0 + enddo +! + do k = 1,klpbl + do i = 1,im + wscalek(i,k) = 0.0 + wscalek2(i,k) = 0.0 + enddo + enddo +! + do k = 1,klpbl + do i = 1,im + zfac(i,k) = 0.0 + enddo + enddo + do k = 1,klpbl-1 + do i = 1,im + xkzom(i,k) = xkzminm + xkzoh(i,k) = xkzminh + enddo + enddo +! + do i = 1,im + dusfc(i) = 0. + dvsfc(i) = 0. + dtsfc(i) = 0. + dqsfc(i) = 0. + enddo +! + do i = 1,im + hgamt(i) = 0. + hgamq(i) = 0. + wscale(i) = 0. + kpbl(i) = 1 + hpbl(i) = zq(i,1) + zl1(i) = za(i,1) + thermal(i)= thvx(i,1) + thermalli(i) = thlix(i,1) + pblflg(i) = .true. + sfcflg(i) = .true. + sflux(i) = hfx(i)/rhox(i)/cp + qfx(i)/rhox(i)*ep1*thx(i,1) + if(br(i).gt.0.0) sfcflg(i) = .false. + enddo +! +! compute the first guess of pbl height +! + do i = 1,im + stable(i) = .false. + brup(i) = br(i) + brcr(i) = brcr_ub + enddo +! + do k = 2,klpbl + do i = 1,im + if(.not.stable(i))then + brdn(i) = brup(i) + spdk2 = max(ux(i,k)**2+vx(i,k)**2,1.) + brup(i) = (thvx(i,k)-thermal(i))*(g*za(i,k)/thvx(i,1))/spdk2 + kpbl(i) = k + stable(i) = brup(i).gt.brcr(i) + endif + enddo + enddo +! + do i = 1,im + k = kpbl(i) + if(brdn(i).ge.brcr(i))then + brint = 0. + elseif(brup(i).le.brcr(i))then + brint = 1. + else + brint = (brcr(i)-brdn(i))/(brup(i)-brdn(i)) + endif + hpbl(i) = za(i,k-1)+brint*(za(i,k)-za(i,k-1)) + if(hpbl(i).lt.zq(i,2)) kpbl(i) = 1 + if(kpbl(i).le.1) pblflg(i) = .false. + enddo +! + do i = 1,im + fm = psim(i) + fh = psih(i) + zol1(i) = max(br(i)*fm*fm/fh,rimin) + if(sfcflg(i))then + zol1(i) = min(zol1(i),-zfmin) + else + zol1(i) = max(zol1(i),zfmin) + endif + hol1 = zol1(i)*hpbl(i)/zl1(i)*sfcfrac + if(sfcflg(i))then + phim(i) = (1.-aphi16*hol1)**(-1./4.) + phih(i) = (1.-aphi16*hol1)**(-1./2.) + bfx0 = max(sflux(i),0.) + hfx0 = max(hfx(i)/rhox(i)/cp,0.) + qfx0 = max(ep1*thx(i,1)*qfx(i)/rhox(i),0.) + wstar3(i) = (govrth(i)*bfx0*hpbl(i)) + wstar(i) = (wstar3(i))**h1 + else + phim(i) = (1.+aphi5*hol1) + phih(i) = phim(i) + wstar(i) = 0. + wstar3(i) = 0. + endif + ust3(i) = ust(i)**3. + wscale(i) = (ust3(i)+phifac*karman*wstar3(i)*0.5)**h1 + wscale(i) = min(wscale(i),ust(i)*aphi16) + wscale(i) = max(wscale(i),ust(i)/aphi5) + enddo +! +! compute the surface variables for pbl height estimation +! under unstable conditions +! + do i = 1,im + if(sfcflg(i).and.sflux(i).gt.0.0)then + gamfac = bfac/rhox(i)/wscale(i) + hgamt(i) = min(gamfac*hfx(i)/cp,gamcrt) + hgamq(i) = min(gamfac*qfx(i),gamcrq) + vpert = (hgamt(i)+ep1*thx(i,1)*hgamq(i))/bfac*afac + thermal(i) = thermal(i)+max(vpert,0.)*min(za(i,1)/(sfcfrac*hpbl(i)),1.0) + thermalli(i)= thermalli(i)+max(vpert,0.)*min(za(i,1)/(sfcfrac*hpbl(i)),1.0) + hgamt(i) = max(hgamt(i),0.0) + hgamq(i) = max(hgamq(i),0.0) + brint = -15.9*ust(i)*ust(i)/wspd(i)*wstar3(i)/(wscale(i)**4.) + hgamu(i) = brint*ux(i,1) + hgamv(i) = brint*vx(i,1) + else + pblflg(i) = .false. + endif + enddo +! +! enhance the pbl height by considering the thermal +! + do i = 1,im + if(pblflg(i))then + kpbl(i) = 1 + hpbl(i) = zq(i,1) + endif + enddo +! + do i = 1,im + if(pblflg(i))then + stable(i) = .false. + brup(i) = br(i) + brcr(i) = brcr_ub + endif + enddo +! + do k = 2,klpbl + do i = 1,im + if(.not.stable(i).and.pblflg(i))then + brdn(i) = brup(i) + spdk2 = max(ux(i,k)**2+vx(i,k)**2,1.) + brup(i) = (thvx(i,k)-thermal(i))*(g*za(i,k)/thvx(i,1))/spdk2 + kpbl(i) = k + stable(i) = brup(i).gt.brcr(i) + endif + enddo + enddo +! +! enhance pbl by theta-li +! + if (ysu_topdown_pblmix.eq.1)then + do i = 1,im + kpblold(i) = kpbl(i) + definebrup=.false. + do k = kpblold(i), km-1 + spdk2 = max(ux(i,k)**2+vx(i,k)**2,1.) + bruptmp = (thlix(i,k)-thermalli(i))*(g*za(i,k)/thlix(i,1))/spdk2 + stable(i) = bruptmp.ge.brcr(i) + if (definebrup) then + kpbl(i) = k + brup(i) = bruptmp + definebrup=.false. + endif + if (.not.stable(i)) then !overwrite brup brdn values + brdn(i)=bruptmp + definebrup=.true. + pblflg(i)=.true. + endif + enddo + enddo + endif + + do i = 1,im + if(pblflg(i)) then + k = kpbl(i) + if(brdn(i).ge.brcr(i))then + brint = 0. + elseif(brup(i).le.brcr(i))then + brint = 1. + else + brint = (brcr(i)-brdn(i))/(brup(i)-brdn(i)) + endif + hpbl(i) = za(i,k-1)+brint*(za(i,k)-za(i,k-1)) + if(hpbl(i).lt.zq(i,2)) kpbl(i) = 1 + if(kpbl(i).le.1) pblflg(i) = .false. + endif + enddo +! +! stable boundary layer +! + do i = 1,im + if((.not.sfcflg(i)).and.hpbl(i).lt.zq(i,2)) then + brup(i) = br(i) + stable(i) = .false. + else + stable(i) = .true. + endif + enddo +! + do i = 1,im + if((.not.stable(i)).and.((xland(i)-1.5).ge.0))then + wspd10 = u10(i)*u10(i) + v10(i)*v10(i) + wspd10 = sqrt(wspd10) + ross = wspd10 / (cori*znt(i)) + brcr_sbro(i) = min(0.16*(1.e-7*ross)**(-0.18),.3) + endif + enddo +! + do i = 1,im + if(.not.stable(i))then + if((xland(i)-1.5).ge.0)then + brcr(i) = brcr_sbro(i) + else + brcr(i) = brcr_sb + endif + endif + enddo +! + do k = 2,klpbl + do i = 1,im + if(.not.stable(i))then + brdn(i) = brup(i) + spdk2 = max(ux(i,k)**2+vx(i,k)**2,1.) + brup(i) = (thvx(i,k)-thermal(i))*(g*za(i,k)/thvx(i,1))/spdk2 + kpbl(i) = k + stable(i) = brup(i).gt.brcr(i) + endif + enddo + enddo +! + do i = 1,im + if((.not.sfcflg(i)).and.hpbl(i).lt.zq(i,2)) then + k = kpbl(i) + if(brdn(i).ge.brcr(i))then + brint = 0. + elseif(brup(i).le.brcr(i))then + brint = 1. + else + brint = (brcr(i)-brdn(i))/(brup(i)-brdn(i)) + endif + hpbl(i) = za(i,k-1)+brint*(za(i,k)-za(i,k-1)) + if(hpbl(i).lt.zq(i,2)) kpbl(i) = 1 + if(kpbl(i).le.1) pblflg(i) = .false. + endif + enddo +! +! estimate the entrainment parameters +! + do i = 1,im + cloudflg(i)=.false. + if(pblflg(i)) then + k = kpbl(i) - 1 + wm3 = wstar3(i) + 5. * ust3(i) + wm2(i) = wm3**h2 + bfxpbl(i) = -0.15*thvx(i,1)/g*wm3/hpbl(i) + dthvx(i) = max(thvx(i,k+1)-thvx(i,k),tmin) + we(i) = max(bfxpbl(i)/dthvx(i),-sqrt(wm2(i))) + if((qx(i,k,ntcw)+qx(i,k,ntiw)).gt.0.01e-3.and.ysu_topdown_pblmix.eq.1)then + if ( kpbl(i) .ge. 2) then + cloudflg(i)=.true. + templ=thlix(i,k)*(p2di(i,k+1)/100000)**rovcp + !rvls is ws at full level + rvls=100.*6.112*EXP(17.67*(templ-273.16)/(templ-29.65))*(ep2/p2di(i,k+1)) + temps=templ + ((qx(i,k,1)+qx(i,k,ntcw))-rvls)/(cp/xlv + & + ep2*xlv*rvls/(rd*templ**2)) + rvls=100.*6.112*EXP(17.67*(temps-273.15)/(temps-29.65))*(ep2/p2di(i,k+1)) + rcldb=max((qx(i,k,1)+qx(i,k,ntcw))-rvls,0.) + !entrainment efficiency + dthvx(i) = (thlix(i,k+2)+thx(i,k+2)*ep1*(qx(i,k+2,1)+qx(i,k+2,ntcw))) & + - (thlix(i,k) + thx(i,k) *ep1*(qx(i,k,1) +qx(i,k,ntcw))) + dthvx(i) = max(dthvx(i),0.1) + tmp1 = xlv/cp * rcldb/(pi2d(i,k)*dthvx(i)) + ent_eff = 0.2 * 8. * tmp1 +0.2 + + radsum=0. + do kk = 1,kpbl(i)-1 + radflux=swh(i,kk)*xmu(i)+hlw(i,kk) !radiative heating rate temp/s + radflux=radflux*cp/g*(p2di(i,kk)-p2di(i,kk+1)) ! converts temp/s to W/m^2 + if (radflux < 0.0 ) radsum=abs(radflux)+radsum + enddo + radsum=max(radsum,0.0) + + !recompute entrainment from sfc thermals + bfx0 = max(max(sflux(i),0.0)-radsum/rhox2(i,k)/cp,0.) + bfx0 = max(sflux(i),0.0) + wm3 = (govrth(i)*bfx0*hpbl(i))+5. * ust3(i) + wm2(i) = wm3**h2 + bfxpbl(i) = -0.15*thvx(i,1)/g*wm3/hpbl(i) + dthvx(i) = max(thvx(i,k+1)-thvx(i,k),tmin) + we(i) = max(bfxpbl(i)/dthvx(i),-sqrt(wm2(i))) + + !entrainment from PBL top thermals + bfx0 = max(radsum/rhox2(i,k)/cp-max(sflux(i),0.0),0.) + bfx0 = max(radsum/rhox2(i,k)/cp,0.) + wm3 = (g/thvx(i,k)*bfx0*hpbl(i)) ! this is wstar3(i) + wm2(i) = wm2(i)+wm3**h2 + bfxpbl(i) = - ent_eff * bfx0 + dthvx(i) = max(thvx(i,k+1)-thvx(i,k),0.1) + we(i) = we(i) + max(bfxpbl(i)/dthvx(i),-sqrt(wm3**h2)) + + !wstar3_2 + bfx0 = max(radsum/rhox2(i,k)/cp,0.) + wstar3_2(i) = (g/thvx(i,k)*bfx0*hpbl(i)) + !recompute hgamt + wscale(i) = (ust3(i)+phifac*karman*(wstar3(i)+wstar3_2(i))*0.5)**h1 + wscale(i) = min(wscale(i),ust(i)*aphi16) + wscale(i) = max(wscale(i),ust(i)/aphi5) + gamfac = bfac/rhox(i)/wscale(i) + hgamt(i) = min(gamfac*hfx(i)/cp,gamcrt) + hgamq(i) = min(gamfac*qfx(i),gamcrq) + gamfac = bfac/rhox2(i,k)/wscale(i) + hgamt2(i,k) = min(gamfac*radsum/cp,gamcrt) + hgamt(i) = max(hgamt(i),0.0) + max(hgamt2(i,k),0.0) + brint = -15.9*ust(i)*ust(i)/wspd(i)*(wstar3(i)+wstar3_2(i))/(wscale(i)**4.) + hgamu(i) = brint*ux(i,1) + hgamv(i) = brint*vx(i,1) + endif + endif + prpbl(i) = 1.0 + dthx = max(thx(i,k+1)-thx(i,k),tmin) + dqx = min(qx(i,k+1,1)-qx(i,k,1),0.0) + hfxpbl(i) = we(i)*dthx + qfxpbl(i) = we(i)*dqx +! + dux = ux(i,k+1)-ux(i,k) + dvx = vx(i,k+1)-vx(i,k) + if(dux.gt.tmin) then + ufxpbl(i) = max(prpbl(i)*we(i)*dux,-ust(i)*ust(i)) + elseif(dux.lt.-tmin) then + ufxpbl(i) = min(prpbl(i)*we(i)*dux,ust(i)*ust(i)) + else + ufxpbl(i) = 0.0 + endif + if(dvx.gt.tmin) then + vfxpbl(i) = max(prpbl(i)*we(i)*dvx,-ust(i)*ust(i)) + elseif(dvx.lt.-tmin) then + vfxpbl(i) = min(prpbl(i)*we(i)*dvx,ust(i)*ust(i)) + else + vfxpbl(i) = 0.0 + endif + delb = govrth(i)*d3*hpbl(i) + delta(i) = min(d1*hpbl(i) + d2*wm2(i)/delb,100.) + endif + enddo +! + do k = 1,klpbl + do i = 1,im + if(pblflg(i).and.k.ge.kpbl(i))then + entfac(i,k) = ((zq(i,k+1)-hpbl(i))/delta(i))**2. + else + entfac(i,k) = 1.e30 + endif + enddo + enddo +! +! compute diffusion coefficients below pbl +! + do k = 1,klpbl + do i = 1,im + if(k.lt.kpbl(i)) then + zfac(i,k) = min(max((1.-(zq(i,k+1)-zl1(i))/(hpbl(i)-zl1(i))),zfmin),1.) + zfacent(i,k) = (1.-zfac(i,k))**3. + wscalek(i,k) = (ust3(i)+phifac*karman*wstar3(i)*(1.-zfac(i,k)))**h1 + wscalek2(i,k) = (phifac*karman*wstar3_2(i)*(zfac(i,k)))**h1 + if(sfcflg(i)) then + prfac = conpr + prfac2 = 15.9*(wstar3(i)+wstar3_2(i))/ust3(i)/(1.+4.*karman*(wstar3(i)+wstar3_2(i))/ust3(i)) + prnumfac = -3.*(max(zq(i,k+1)-sfcfrac*hpbl(i),0.))**2./hpbl(i)**2. + else + prfac = 0. + prfac2 = 0. + prnumfac = 0. + phim8z = 1.+aphi5*zol1(i)*zq(i,k+1)/zl1(i) + wscalek(i,k) = ust(i)/phim8z + wscalek(i,k) = max(wscalek(i,k),0.001) + endif + prnum0 = (phih(i)/phim(i)+prfac) + prnum0 = max(min(prnum0,prmax),prmin) + xkzm(i,k) = wscalek(i,k) *karman* zq(i,k+1) * zfac(i,k)**pfac+ & + wscalek2(i,k)*karman*(hpbl(i)-zq(i,k+1))*(1-zfac(i,k))**pfac + !Do not include xkzm at kpbl-1 since it changes entrainment + if (k.eq.kpbl(i)-1.and.cloudflg(i).and.we(i).lt.0.0) then + xkzm(i,k) = 0.0 + endif + prnum = 1. + (prnum0-1.)*exp(prnumfac) + xkzq(i,k) = xkzm(i,k)/prnum*zfac(i,k)**(pfac_q-pfac) + prnum0 = prnum0/(1.+prfac2*karman*sfcfrac) + prnum = 1. + (prnum0-1.)*exp(prnumfac) + xkzh(i,k) = xkzm(i,k)/prnum + xkzm(i,k) = xkzm(i,k)+xkzom(i,k) + xkzh(i,k) = xkzh(i,k)+xkzoh(i,k) + xkzq(i,k) = xkzq(i,k)+xkzoh(i,k) + xkzm(i,k) = min(xkzm(i,k),xkzmax) + xkzh(i,k) = min(xkzh(i,k),xkzmax) + xkzq(i,k) = min(xkzq(i,k),xkzmax) + endif + enddo + enddo +! +! compute diffusion coefficients over pbl (free atmosphere) +! + do k = 1,km-1 + do i = 1,im + if(k.ge.kpbl(i)) then + ss = ((ux(i,k+1)-ux(i,k))*(ux(i,k+1)-ux(i,k)) & + +(vx(i,k+1)-vx(i,k))*(vx(i,k+1)-vx(i,k))) & + /(dza(i,k+1)*dza(i,k+1))+1.e-9 + govrthv = g/(0.5*(thvx(i,k+1)+thvx(i,k))) + ri = govrthv*(thvx(i,k+1)-thvx(i,k))/(ss*dza(i,k+1)) + if(imvdif.eq.1.and.ntcw.ge.2.and.ntiw.ge.2)then + if((qx(i,k,ntcw)+qx(i,k,ntiw)).gt.0.01e-3.and.(qx(i & + ,k+1,ntcw)+qx(i,k+1,ntiw)).gt.0.01e-3)then +! in cloud + qmean = 0.5*(qx(i,k,1)+qx(i,k+1,1)) + tmean = 0.5*(tx(i,k)+tx(i,k+1)) + alph = xlv*qmean/rd/tmean + chi = xlv*xlv*qmean/cp/rv/tmean/tmean + ri = (1.+alph)*(ri-g*g/ss/tmean/cp*((chi-alph)/(1.+chi))) + endif + endif + zk = karman*zq(i,k+1) + rlamdz = min(max(0.1*dza(i,k+1),rlam),300.) + rlamdz = min(dza(i,k+1),rlamdz) + rl2 = (zk*rlamdz/(rlamdz+zk))**2 + dk = rl2*sqrt(ss) + if(ri.lt.0.)then +! unstable regime + ri = max(ri, rimin) + sri = sqrt(-ri) + xkzm(i,k) = dk*(1+8.*(-ri)/(1+1.746*sri)) + xkzh(i,k) = dk*(1+8.*(-ri)/(1+1.286*sri)) + else +! stable regime + xkzh(i,k) = dk/(1+5.*ri)**2 + prnum = 1.0+2.1*ri + prnum = min(prnum,prmax) + xkzm(i,k) = xkzh(i,k)*prnum + endif +! + xkzm(i,k) = xkzm(i,k)+xkzom(i,k) + xkzh(i,k) = xkzh(i,k)+xkzoh(i,k) + xkzm(i,k) = min(xkzm(i,k),xkzmax) + xkzh(i,k) = min(xkzh(i,k),xkzmax) + xkzml(i,k) = xkzm(i,k) + xkzhl(i,k) = xkzh(i,k) + endif + enddo + enddo +! +! compute tridiagonal matrix elements for heat +! + do k = 1,km + do i = 1,im + au(i,k) = 0. + al(i,k) = 0. + ad(i,k) = 0. + f1(i,k) = 0. + enddo + enddo +! + do i = 1,im + ad(i,1) = 1. + f1(i,1) = thx(i,1)-300.+hfx(i)/cont/del(i,1)*dt2 + enddo +! + do k = 1,km-1 + do i = 1,im + dtodsd = dt2/del(i,k) + dtodsu = dt2/del(i,k+1) + dsig = p2d(i,k)-p2d(i,k+1) + rdz = 1./dza(i,k+1) + tem1 = dsig*xkzh(i,k)*rdz + if(pblflg(i).and.k.lt.kpbl(i)) then + dsdzt = tem1*(-hgamt(i)/hpbl(i)-hfxpbl(i)*zfacent(i,k)/xkzh(i,k)) + f1(i,k) = f1(i,k)+dtodsd*dsdzt + f1(i,k+1) = thx(i,k+1)-300.-dtodsu*dsdzt + elseif(pblflg(i).and.k.ge.kpbl(i).and.entfac(i,k).lt.4.6) then + xkzh(i,k) = -we(i)*dza(i,kpbl(i))*exp(-entfac(i,k)) + xkzh(i,k) = sqrt(xkzh(i,k)*xkzhl(i,k)) + xkzh(i,k) = max(xkzh(i,k),xkzoh(i,k)) + xkzh(i,k) = min(xkzh(i,k),xkzmax) + f1(i,k+1) = thx(i,k+1)-300. + else + f1(i,k+1) = thx(i,k+1)-300. + endif + tem1 = dsig*xkzh(i,k)*rdz + dsdz2 = tem1*rdz + au(i,k) = -dtodsd*dsdz2 + al(i,k) = -dtodsu*dsdz2 + ad(i,k) = ad(i,k)-au(i,k) + ad(i,k+1) = 1.-al(i,k) + enddo + enddo +! +! copies here to avoid duplicate input args for tridin +! + do k = 1,km + do i = 1,im + cu(i,k) = au(i,k) + r1(i,k) = f1(i,k) + enddo + enddo +! + call tridin_ysu(al,ad,cu,r1,au,f1,im,km,1) +! +! recover tendencies of heat +! + do k = km,1,-1 + do i = 1,im + ttend = (f1(i,k)-thx(i,k)+300.)*rdt*pi2d(i,k) + ttnp(i,k) = ttnp(i,k)+ttend + dtsfc(i) = dtsfc(i)+ttend*cont*del(i,k) + enddo + enddo +! +! compute tridiagonal matrix elements for moisture, clouds, and gases +! + do k = 1,km + do i = 1,im + au(i,k) = 0. + al(i,k) = 0. + ad(i,k) = 0. + enddo + enddo +! + do ic = 1,ndiff + do i = 1,im + do k = 1,km + f3(i,k,ic) = 0. + enddo + enddo + enddo +! + do i = 1,im + ad(i,1) = 1. + f3(i,1,1) = qx(i,1,1)+qfx(i)*g/del(i,1)*dt2 + enddo +! + if(ndiff.ge.2) then + do ic = 2,ndiff + do i = 1,im + f3(i,1,ic) = qx(i,1,ic) + enddo + enddo + endif +! + do k = 1,km-1 + do i = 1,im + if(k.ge.kpbl(i)) then + xkzq(i,k) = xkzh(i,k) + endif + enddo + enddo +! + do k = 1,km-1 + do i = 1,im + dtodsd = dt2/del(i,k) + dtodsu = dt2/del(i,k+1) + dsig = p2d(i,k)-p2d(i,k+1) + rdz = 1./dza(i,k+1) + tem1 = dsig*xkzq(i,k)*rdz + if(pblflg(i).and.k.lt.kpbl(i)) then + dsdzq = tem1*(-qfxpbl(i)*zfacent(i,k)/xkzq(i,k)) + f3(i,k,1) = f3(i,k,1)+dtodsd*dsdzq + f3(i,k+1,1) = qx(i,k+1,1)-dtodsu*dsdzq + elseif(pblflg(i).and.k.ge.kpbl(i).and.entfac(i,k).lt.4.6) then + xkzq(i,k) = -we(i)*dza(i,kpbl(i))*exp(-entfac(i,k)) + xkzq(i,k) = sqrt(xkzq(i,k)*xkzhl(i,k)) + xkzq(i,k) = max(xkzq(i,k),xkzoh(i,k)) + xkzq(i,k) = min(xkzq(i,k),xkzmax) + f3(i,k+1,1) = qx(i,k+1,1) + else + f3(i,k+1,1) = qx(i,k+1,1) + endif + tem1 = dsig*xkzq(i,k)*rdz + dsdz2 = tem1*rdz + au(i,k) = -dtodsd*dsdz2 + al(i,k) = -dtodsu*dsdz2 + ad(i,k) = ad(i,k)-au(i,k) + ad(i,k+1) = 1.-al(i,k) + enddo + enddo +! + if(ndiff.ge.2) then + do ic = 2,ndiff + do k = 1,km-1 + do i = 1,im + f3(i,k+1,ic) = qx(i,k+1,ic) + enddo + enddo + enddo + endif +! +! copies here to avoid duplicate input args for tridin +! + do k = 1,km + do i = 1,im + cu(i,k) = au(i,k) + enddo + enddo +! + do ic = 1,ndiff + do k = 1,km + do i = 1,im + r3(i,k,ic) = f3(i,k,ic) + enddo + enddo + enddo +! +! solve tridiagonal problem for moisture, clouds, and gases +! + call tridin_ysu(al,ad,cu,r3,au,f3,im,km,ndiff) +! +! recover tendencies of heat and moisture +! + do k = km,1,-1 + do i = 1,im + qtend = (f3(i,k,1)-qx(i,k,1))*rdt + qtnp(i,k,1) = qtnp(i,k,1)+qtend + dqsfc(i) = dqsfc(i)+qtend*conq*del(i,k) + enddo + enddo +! + if(ndiff.ge.2) then + do ic = 2,ndiff + do k = km,1,-1 + do i = 1,im + qtend = (f3(i,k,ic)-qx(i,k,ic))*rdt + qtnp(i,k,ic) = qtnp(i,k,ic)+qtend + enddo + enddo + enddo + endif +! +! compute tridiagonal matrix elements for momentum +! + do i = 1,im + do k = 1,km + au(i,k) = 0. + al(i,k) = 0. + ad(i,k) = 0. + f1(i,k) = 0. + f2(i,k) = 0. + enddo + enddo +! + do i = 1,im + ad(i,1) = 1.+ust(i)**2/wspd1(i)*rhox(i)*g/del(i,1)*dt2 & + *(wspd1(i)/wspd(i))**2 + f1(i,1) = ux(i,1)+uox(i)*ust(i)**2*g/del(i,1)*dt2/wspd1(i) + f2(i,1) = vx(i,1)+vox(i)*ust(i)**2*g/del(i,1)*dt2/wspd1(i) + enddo +! + do k = 1,km-1 + do i = 1,im + dtodsd = dt2/del(i,k) + dtodsu = dt2/del(i,k+1) + dsig = p2d(i,k)-p2d(i,k+1) + rdz = 1./dza(i,k+1) + tem1 = dsig*xkzm(i,k)*rdz + if(pblflg(i).and.k.lt.kpbl(i))then + dsdzu = tem1*(-hgamu(i)/hpbl(i)-ufxpbl(i)*zfacent(i,k)/xkzm(i,k)) + dsdzv = tem1*(-hgamv(i)/hpbl(i)-vfxpbl(i)*zfacent(i,k)/xkzm(i,k)) + f1(i,k) = f1(i,k)+dtodsd*dsdzu + f1(i,k+1) = ux(i,k+1)-dtodsu*dsdzu + f2(i,k) = f2(i,k)+dtodsd*dsdzv + f2(i,k+1) = vx(i,k+1)-dtodsu*dsdzv + elseif(pblflg(i).and.k.ge.kpbl(i).and.entfac(i,k).lt.4.6) then + xkzm(i,k) = prpbl(i)*xkzh(i,k) + xkzm(i,k) = sqrt(xkzm(i,k)*xkzml(i,k)) + xkzm(i,k) = max(xkzm(i,k),xkzom(i,k)) + xkzm(i,k) = min(xkzm(i,k),xkzmax) + f1(i,k+1) = ux(i,k+1) + f2(i,k+1) = vx(i,k+1) + else + f1(i,k+1) = ux(i,k+1) + f2(i,k+1) = vx(i,k+1) + endif + tem1 = dsig*xkzm(i,k)*rdz + dsdz2 = tem1*rdz + au(i,k) = -dtodsd*dsdz2 + al(i,k) = -dtodsu*dsdz2 + ad(i,k) = ad(i,k)-au(i,k) + ad(i,k+1) = 1.-al(i,k) + enddo + enddo +! +! copies here to avoid duplicate input args for tridin +! + do k = 1,km + do i = 1,im + cu(i,k) = au(i,k) + r1(i,k) = f1(i,k) + r2(i,k) = f2(i,k) + enddo + enddo +! +! solve tridiagonal problem for momentum +! + call tridi1n(al,ad,cu,r1,r2,au,f1,f2,im,km,1) +! +! recover tendencies of momentum +! + do k = km,1,-1 + do i = 1,im + utend = (f1(i,k)-ux(i,k))*rdt + vtend = (f2(i,k)-vx(i,k))*rdt + utnp(i,k) = utnp(i,k)+utend + vtnp(i,k) = vtnp(i,k)+vtend + dusfc(i) = dusfc(i) + utend*conwrc*del(i,k) + dvsfc(i) = dvsfc(i) + vtend*conwrc*del(i,k) + enddo + enddo +! +!---- end of vertical diffusion +! + do i = 1,im + kpbl1d(i) = kpbl(i) + enddo +! +! + end subroutine ysuvdif_run +!------------------------------------------------------------------------------- +! +!------------------------------------------------------------------------------- + subroutine tridi1n(cl,cm,cu,r1,r2,au,f1,f2,im,km,nt) + use machine , only : kind_phys +!------------------------------------------------------------------------------- + implicit none +!------------------------------------------------------------------------------- +! + integer, intent(in ) :: im, km, nt +! + real(kind=kind_phys), dimension( im, 2:km+1 ) , & + intent(in ) :: cl +! + real(kind=kind_phys), dimension( im, km ) , & + intent(in ) :: cm, & + r1 + real(kind=kind_phys), dimension( im, km,nt ) , & + intent(in ) :: r2 +! + real(kind=kind_phys), dimension( im, km ) , & + intent(inout) :: au, & + cu, & + f1 + real(kind=kind_phys), dimension( im, km,nt ) , & + intent(inout) :: f2 +! + real(kind=kind_phys) :: fk + integer :: i,k,l,n,it +! +!------------------------------------------------------------------------------- +! + l = im + n = km +! + do i = 1,l + fk = 1./cm(i,1) + au(i,1) = fk*cu(i,1) + f1(i,1) = fk*r1(i,1) + enddo +! + do it = 1,nt + do i = 1,l + fk = 1./cm(i,1) + f2(i,1,it) = fk*r2(i,1,it) + enddo + enddo +! + do k = 2,n-1 + do i = 1,l + fk = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) + au(i,k) = fk*cu(i,k) + f1(i,k) = fk*(r1(i,k)-cl(i,k)*f1(i,k-1)) + enddo + enddo +! + do it = 1,nt + do k = 2,n-1 + do i = 1,l + fk = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) + f2(i,k,it) = fk*(r2(i,k,it)-cl(i,k)*f2(i,k-1,it)) + enddo + enddo + enddo +! + do i = 1,l + fk = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) + f1(i,n) = fk*(r1(i,n)-cl(i,n)*f1(i,n-1)) + enddo +! + do it = 1,nt + do i = 1,l + fk = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) + f2(i,n,it) = fk*(r2(i,n,it)-cl(i,n)*f2(i,n-1,it)) + enddo + enddo +! + do k = n-1,1,-1 + do i = 1,l + f1(i,k) = f1(i,k)-au(i,k)*f1(i,k+1) + enddo + enddo +! + do it = 1,nt + do k = n-1,1,-1 + do i = 1,l + f2(i,k,it) = f2(i,k,it)-au(i,k)*f2(i,k+1,it) + enddo + enddo + enddo +! + end subroutine tridi1n +!------------------------------------------------------------------------------- +! +!------------------------------------------------------------------------------- + subroutine tridin_ysu(cl,cm,cu,r2,au,f2,im,km,nt) + use machine , only : kind_phys +!------------------------------------------------------------------------------- + implicit none +!------------------------------------------------------------------------------- +! + integer, intent(in ) :: im, km, nt +! + real(kind=kind_phys), dimension( im, 2:km+1 ) , & + intent(in ) :: cl +! + real(kind=kind_phys), dimension( im, km ) , & + intent(in ) :: cm + real(kind=kind_phys), dimension( im, km,nt ) , & + intent(in ) :: r2 +! + real(kind=kind_phys), dimension( im, km ) , & + intent(inout) :: au, & + cu + real(kind=kind_phys), dimension( im, km,nt ) , & + intent(inout) :: f2 +! + real(kind=kind_phys) :: fk + integer :: i,k,l,n,it +! +!------------------------------------------------------------------------------- +! + l = im + n = km +! + do it = 1,nt + do i = 1,l + fk = 1./cm(i,1) + au(i,1) = fk*cu(i,1) + f2(i,1,it) = fk*r2(i,1,it) + enddo + enddo +! + do it = 1,nt + do k = 2,n-1 + do i = 1,l + fk = 1./(cm(i,k)-cl(i,k)*au(i,k-1)) + au(i,k) = fk*cu(i,k) + f2(i,k,it) = fk*(r2(i,k,it)-cl(i,k)*f2(i,k-1,it)) + enddo + enddo + enddo +! + do it = 1,nt + do i = 1,l + fk = 1./(cm(i,n)-cl(i,n)*au(i,n-1)) + f2(i,n,it) = fk*(r2(i,n,it)-cl(i,n)*f2(i,n-1,it)) + enddo + enddo +! + do it = 1,nt + do k = n-1,1,-1 + do i = 1,l + f2(i,k,it) = f2(i,k,it)-au(i,k)*f2(i,k+1,it) + enddo + enddo + enddo +! + end subroutine tridin_ysu +!------------------------------------------------------------------------------- +end module ysuvdif +!------------------------------------------------------------------------------- From a4620255a9d694b1f38165dbbb44ba4ea2c58528 Mon Sep 17 00:00:00 2001 From: Man Zhang Date: Wed, 19 Jun 2019 15:36:07 -0600 Subject: [PATCH 14/89] scidoc update --- physics/docs/ccppv3_fv3_doxyfile | 441 ++ physics/docs/pdftxt/GFDL_cloud.txt | 23 +- physics/docs/pdftxt/GFS_SAMF.txt | 8 + physics/docs/pdftxt/all_shemes_list.txt | 2 +- physics/gcycle.F90 | 245 + physics/module_sf_mynn.F90 | 2446 +++++++ physics/sfcsub.F | 8745 +++++++++++++++++++++++ 7 files changed, 11902 insertions(+), 8 deletions(-) create mode 100644 physics/docs/ccppv3_fv3_doxyfile create mode 100644 physics/docs/pdftxt/GFS_SAMF.txt create mode 100644 physics/gcycle.F90 create mode 100644 physics/module_sf_mynn.F90 create mode 100644 physics/sfcsub.F diff --git a/physics/docs/ccppv3_fv3_doxyfile b/physics/docs/ccppv3_fv3_doxyfile new file mode 100644 index 000000000..f92aa9b18 --- /dev/null +++ b/physics/docs/ccppv3_fv3_doxyfile @@ -0,0 +1,441 @@ +# Doxyfile 1.8.11 +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = "Common Community Physics Package (CCPP) Scientific Documentation" +PROJECT_NUMBER = "Version 3.0" +PROJECT_BRIEF = " " +PROJECT_LOGO = img/dtc_logo.png +OUTPUT_DIRECTORY = doc +CREATE_SUBDIRS = NO +ALLOW_UNICODE_NAMES = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = NO +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = YES +TAB_SIZE = 4 +ALIASES = +TCL_SUBST = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = YES +OPTIMIZE_OUTPUT_VHDL = NO +EXTENSION_MAPPING = .f=FortranFree \ + .F90=FortranFree \ + .f90=FortranFree +MARKDOWN_SUPPORT = YES +AUTOLINK_SUPPORT = YES +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = YES +GROUP_NESTED_COMPOUNDS = NO +SUBGROUPING = YES +INLINE_GROUPED_CLASSES = NO +INLINE_SIMPLE_STRUCTS = NO +TYPEDEF_HIDES_STRUCT = YES +LOOKUP_CACHE_SIZE = 0 +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_PACKAGE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = YES +EXTRACT_ANON_NSPACES = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = YES + +CASE_SENSE_NAMES = NO + +HIDE_SCOPE_NAMES = NO + +HIDE_COMPOUND_REFERENCE= NO + +SHOW_INCLUDE_FILES = NO + +SHOW_GROUPED_MEMB_INC = NO + +FORCE_LOCAL_INCLUDES = NO + +INLINE_INFO = YES + +SORT_MEMBER_DOCS = NO + +SORT_BRIEF_DOCS = NO +SORT_MEMBERS_CTORS_1ST = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +STRICT_PROTO_MATCHING = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = YES +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_FILES = YES +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = ccpp_dox_layout.xml +CITE_BIB_FILES = library.bib +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = NO +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_AS_ERROR = NO +WARN_FORMAT = +WARN_LOGFILE = +INPUT = pdftxt/mainpage.txt \ + pdftxt/all_shemes_list.txt \ + pdftxt/GFSv15_suite.txt \ + pdftxt/GFSv15_suite_TKEEDMF.txt \ + pdftxt/CPT_adv_suite.txt \ + pdftxt/GSD_adv_suite.txt \ + pdftxt/GFS_RRTMG.txt \ + pdftxt/GFS_SFCLYR.txt \ + pdftxt/GFS_NSST.txt \ + pdftxt/GFS_NOAH.txt \ + pdftxt/GFS_SFCSICE.txt \ + pdftxt/GFS_HEDMF.txt \ + pdftxt/GFS_SATMEDMF.txt \ + pdftxt/GFS_GWDPS.txt \ + pdftxt/GFS_OZPHYS.txt \ + pdftxt/GFS_H2OPHYS.txt \ + pdftxt/GFS_RAYLEIGH.txt \ + pgftxt/GFS_SAMF.txt \ + pdftxt/GFS_SAMFdeep.txt \ + pdftxt/GFS_GWDC.txt \ + pdftxt/GFS_SAMFshal.txt \ + pdftxt/GFDL_cloud.txt \ +### pdftxt/GFS_SURFACE_PERT.txt \ + pdftxt/GFS_CALPRECIPTYPE.txt \ +### pdftxt/rad_cld.txt \ + pdftxt/CPT_CSAW.txt \ + pdftxt/CPT_MG3.txt \ + pdftxt/GSD_MYNN_EDMF.txt \ + pdftxt/GSD_CU_GF_deep.txt \ + pdftxt/GSD_RUCLSM.txt \ + pdftxt/GSD_THOMPSON.txt \ +### pdftxt/GFSphys_namelist.txt \ +### pdftxt/GFS_STOCHY_PHYS.txt \ + pdftxt/suite_input.nml.txt \ +### in-core MP + ../gfdl_fv_sat_adj.F90 \ +### time_vary + ../GFS_phys_time_vary.fv3.F90 \ + ../ozne_def.f \ + ../ozinterp.f90 \ + ../h2o_def.f \ + ../h2ointerp.f90 \ + ../aerclm_def.F \ + ../aerinterp.F90 \ + ../iccn_def.F \ + ../iccninterp.F90 \ + ../sfcsub.F \ + ../gcycle.F90 \ + +### Radiation + ../radlw_main.f \ + ../radsw_main.f \ + ../radiation_aerosols.f \ + ../radiation_astronomy.f \ + ../radiation_clouds.f \ + ../radiation_gases.f \ + ../radiation_surface.f \ + ../radlw_param.f \ + ../radlw_datatb.f \ + ../radsw_param.f \ + ../radsw_datatb.f \ + ../dcyc2.f \ +### Land Surface + ../sfc_diff.f \ + ../sfc_nst.f \ + ../module_nst_model.f90 \ + ../module_nst_parameters.f90 \ + ../module_nst_water_prop.f90 \ + ../sfc_drv.f \ + ../sflx.f \ + ../namelist_soilveg.f \ + ../set_soilveg.f \ +### Sea Ice Surface + ../sfc_sice.f \ +### PBL + ../moninedmf.f \ + ../mfpbl.f \ + ../tridi.f \ +### satmedmf + ../satmedmfvdif.F \ + ../mfpblt.f \ + ../mfscu.f \ + ../tridi.f \ +### Orographic Gravity Wave + ../gwdps.f \ +### Rayleigh Dampling + ../rayleigh_damp.f \ +### Prognostic Ozone + ../ozphys_2015.f \ +### ../ozphys.f \ +### stratospheric h2o + ../h2ophys.f \ +### Deep Convection + ../samfdeepcnv.f \ +### Convective Gravity Wave + ../gwdc.f \ +### Shallow Convection + ../samfshalcnv.f \ + ../cnvc90.f \ +### Microphysics +### ../gscond.f \ +### ../precpd.f \ + ../module_bfmicrophysics.f \ +### GFDL cloud MP + ../gfdl_cloud_microphys.F90 \ + ../module_gfdl_cloud_microphys.F90 \ +### + ../GFS_MP_generic.F90 \ + ../calpreciptype.f90 \ +### stochy +### ../GFS_stochastics.F90 \ +### ../surface_perturbation.F90 \ +### ../../stochastic_physics/stochastic_physics.F90 \ +### CPT + ../m_micro.F90 \ +### ../micro_mg2_0.F90 \ + ../micro_mg3_0.F90 \ + ../micro_mg_utils.F90 \ + ../cldmacro.F \ + ../aer_cloud.F \ + ../cldwat2m_micro.F \ + ../wv_saturation.F \ + ../cs_conv_aw_adj.F90 \ + ../cs_conv.F90 \ +### GSD + ../cu_gf_driver.F90 \ + ../cu_gf_deep.F90 \ + ../cu_gf_sh.F90 \ + ../module_MYNNrad_pre.F90 \ + ../module_MYNNrad_post.F90 \ + ../module_MYNNPBL_wrapper.F90 \ + ../module_bl_mynn.F90 \ +### ../module_MYNNSFC_wrapper.F90 \ +### ../module_sf_mynn.F90 \ + ../sfc_drv_ruc.F90 \ + ../module_sf_ruclsm.F90 \ + ../namelist_soilveg_ruc.F90 \ + ../set_soilveg_ruc.F90 \ + ../module_soil_pre.F90 \ + ../mp_thompson_pre.F90 \ + ../module_mp_thompson_make_number_concentrations.F90 \ + ../mp_thompson.F90 \ + ../module_mp_thompson.F90 \ + ../module_mp_radar.F90 \ + ../mp_thompson_post.F90 \ +### utils + ../funcphys.f90 \ + ../physparam.f \ + ../physcons.F90 \ + ../radcons.f90 \ + ../mersenne_twister.f \ + compns_stochy.F90 + + +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.f \ + *.F90 \ + *.f90 \ + *.nml \ + *.txt +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = img +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +FILTER_SOURCE_PATTERNS = +USE_MDFILE_AS_MAINPAGE = +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#CLANG_ASSISTED_PARSING = NO +#CLANG_OPTIONS = +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_EXTRA_STYLESHEET = ccpp_dox_extra_style.css +HTML_EXTRA_FILES = +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_TIMESTAMP = NO +HTML_DYNAMIC_SECTIONS = NO +HTML_INDEX_NUM_ENTRIES = 100 +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_NAME = Publisher +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +GENERATE_ECLIPSEHELP = NO +ECLIPSE_DOC_ID = org.doxygen.Project +DISABLE_INDEX = YES +GENERATE_TREEVIEW = YES +ENUM_VALUES_PER_LINE = 4 +TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = NO +FORMULA_FONTSIZE = 10 +FORMULA_TRANSPARENT = YES +USE_MATHJAX = YES +MATHJAX_FORMAT = HTML-CSS +MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2 +MATHJAX_EXTENSIONS = +MATHJAX_CODEFILE = +SEARCHENGINE = YES +SERVER_BASED_SEARCH = NO +EXTERNAL_SEARCH = NO +SEARCHENGINE_URL = +SEARCHDATA_FILE = searchdata.xml +EXTERNAL_SEARCH_ID = +EXTRA_SEARCH_MAPPINGS = +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = YES +PAPER_TYPE = a4 +EXTRA_PACKAGES = amsmath +LATEX_HEADER = +LATEX_FOOTER = +LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_FILES = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = YES +LATEX_SOURCE_CODE = NO + +LATEX_BIB_STYLE = plainnat + +LATEX_TIMESTAMP = NO + +GENERATE_RTF = NO + +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +RTF_SOURCE_CODE = NO +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_SUBDIR = +MAN_LINKS = NO +GENERATE_XML = NO +XML_OUTPUT = xml +XML_PROGRAMLISTING = YES +GENERATE_DOCBOOK = NO +DOCBOOK_OUTPUT = docbook +DOCBOOK_PROGRAMLISTING = NO +GENERATE_AUTOGEN_DEF = NO +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +ENABLE_PREPROCESSING = NO +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = CCPP \ + MULTI_GASES \ + 0 +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +EXTERNAL_PAGES = YES +PERL_PATH = /usr/bin/perl +CLASS_DIAGRAMS = YES +MSCGEN_PATH = +DIA_PATH = +HIDE_UNDOC_RELATIONS = NO +HAVE_DOT = YES +DOT_NUM_THREADS = 0 +DOT_FONTNAME = Helvetica +DOT_FONTSIZE = 10 +DOT_FONTPATH = +CLASS_GRAPH = NO +COLLABORATION_GRAPH = NO +GROUP_GRAPHS = YES +UML_LOOK = YES +UML_LIMIT_NUM_FIELDS = 10 +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = NO +CALL_GRAPH = YES +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = svg +INTERACTIVE_SVG = NO +DOT_PATH = +DOTFILE_DIRS = +MSCFILE_DIRS = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_INCLUDE_PATH = +DOT_GRAPH_MAX_NODES = 200 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = YES +GENERATE_LEGEND = YES +DOT_CLEANUP = YES diff --git a/physics/docs/pdftxt/GFDL_cloud.txt b/physics/docs/pdftxt/GFDL_cloud.txt index 200497f89..6240a259e 100644 --- a/physics/docs/pdftxt/GFDL_cloud.txt +++ b/physics/docs/pdftxt/GFDL_cloud.txt @@ -12,7 +12,8 @@ Physics processes of GFDL cloud MP are described in Figure 1 (also see warm_rain Some unique attributes of GFDL cloud microphysics include: -\section fast_phys Fast Physics in FV3 Dynamical Solver +# Precipitation and Cloud Effects on Dynamics + \image html FV3_structure.png "Figure 1: FV3 structure; Yellow represents external API routines, called once per physics time step; Green are called once per remapping time step; Blue are called once per acoustic time step. " width=10cm The leftmost column of Figure 1 shows the external API calls used during a typical process-split model integration procedure. First, the solver is called, which advances the solver a full "physics" time step. This updated state is then passed to the physical parameterization @@ -27,9 +28,17 @@ done independently within each layer to maintain local (within each layer) stabi This loop is typically performed once per call to the solver, although it is possible to improve the model's stability by executing the loop (and thereby the vertical remapping) multiple times per solver call. -In current fv3gfs, the fast physics (phase-changes only) is called after the "Lagrangian-to-Eulerain" remapping. When \ref fast_sat_adj is activated (do_sat_adj=.true. in \b fv_core_nml block), it adjusts cloud water evaporation (cloud water\f$\rightarrow\f$water vapor), cloud water freezing (cloud water\f$\rightarrow\f$cloud ice), and cloud ice deposition (water vapor\f$\rightarrow\f$cloud ice). The process of condensation is an interesting and well known example. Say dynamics lifts a column of air above saturation, then an adjustment is made to temperature and moisture in order to reach saturation. The tendency of the dynamics has been included in this procedure in order to have the correct balance. -\section gfdl_fast Horizontal Sub-grid Variability ("Scale-aware") +At grid spacing of less than ~10 km, model dynamics should be able to "see" and "feel" the cloud and precipitation condensate; heat content, +heat exchange with the environment, and momentum of condensate should be accounted for. The GFDL microphysics scheme is formulated to +accomplish this through strict moist energy conservation during phase changes, and keeping heat and momentum budgets for all condensate. +This results in thermodynamic consistency between the FV3 microphysics scheme and FV3 dyanmics. + +In current fv3gfs, GFDL in-core fast saturation adjustment (phase-changes only) is called after the "Lagrangian-to-Eulerain" remapping. When \ref fast_sat_adj is activated (do_sat_adj=.true. in \b fv_core_nml block), it adjusts cloud water evaporation (cloud water\f$\rightarrow\f$water vapor), cloud water freezing (cloud water\f$\rightarrow\f$cloud ice), and cloud ice deposition (water vapor\f$\rightarrow\f$cloud ice). The process of condensation is an interesting and well known example. Say dynamics lifts a column of air above saturation, then an adjustment is made to temperature and moisture in order to reach saturation. The tendency of the dynamics has been included in this procedure in order to have the correct balance. + +# Scale-awareness + +Scale-awareness provided by assumed subgrid variability that is directly proportional to grid spacing. Horizontal sub-grid variability is a function of cell area: - Over land: \f[ @@ -46,12 +55,12 @@ relative humidity calculation, evaporation and condensation processes. Scale-aw order FV-type vertical reconstruction (Lin et al. (1994) \cite lin_et_al_1994). \section intro_GFDL_cloud Intraphysics Communication - + For GFDL Cloud MP: \ref arg_table_gfdl_cloud_microphys_run - + For GFDL Fast Physics: \ref arg_table_fv_sat_adj_run + + GFDL Cloud MP: \ref arg_table_gfdl_cloud_microphys_run + + GFDL In-core Fast Saturation Adjustment: \ref arg_table_fv_sat_adj_run \section Gen_GFDL_cloud General Algorithm - + For GFDL Cloud MP: mpdrv() - + For GFDL Fast Physics: fv_sat_adj_work() + + GFDL Cloud MP: mpdrv() + + GFDL In-core Fast Saturation Ajustment: fv_sat_adj_work() */ diff --git a/physics/docs/pdftxt/GFS_SAMF.txt b/physics/docs/pdftxt/GFS_SAMF.txt new file mode 100644 index 000000000..870599652 --- /dev/null +++ b/physics/docs/pdftxt/GFS_SAMF.txt @@ -0,0 +1,8 @@ +/** +\page GFS_SAMF GFS Scale-Aware Simplified Arakawa-Schubert (sa-SAS) Convection Scheme +\section des_samf Description + +\section intra_samf Intraphysics Communication + + +*/ diff --git a/physics/docs/pdftxt/all_shemes_list.txt b/physics/docs/pdftxt/all_shemes_list.txt index 8762cf0d1..702c22256 100644 --- a/physics/docs/pdftxt/all_shemes_list.txt +++ b/physics/docs/pdftxt/all_shemes_list.txt @@ -21,7 +21,7 @@ parameterizations in suites. - \subpage GSD_RUCLSM - \b Cumulus \b Parameterizations - - GFS Scale-Aware Arakawa Schubert (SAS) Scheme + - \subpage GFS_SAMF - \subpage GFS_SAMFdeep - \subpage GFS_SAMFshal - \subpage CSAW_scheme diff --git a/physics/gcycle.F90 b/physics/gcycle.F90 new file mode 100644 index 000000000..411d41004 --- /dev/null +++ b/physics/gcycle.F90 @@ -0,0 +1,245 @@ +!>\file gcycle.F90 +!! This file repopulates specific time-varying surface properties for +!! atmospheric forecast runs. + +!>\ingroup mod_GFS_phys_time_vary +!! This subroutine repopulates specific time-varying surface properties for +!! atmospheric forecast runs. +# 1 "physics/gcycle.F90" + SUBROUTINE GCYCLE (nblks, Model, Grid, Sfcprop, Cldprop) +! +! + USE MACHINE, only: kind_phys + USE PHYSCONS, only: PI => con_PI + USE GFS_typedefs, only: GFS_control_type, GFS_grid_type, & + GFS_sfcprop_type, GFS_cldprop_type + implicit none + + integer, intent(in) :: nblks + type(GFS_control_type), intent(in) :: Model + type(GFS_grid_type), intent(in) :: Grid(nblks) + type(GFS_sfcprop_type), intent(inout) :: Sfcprop(nblks) + type(GFS_cldprop_type), intent(inout) :: Cldprop(nblks) + +! +! Local variables +! --------------- + integer :: & + I_INDEX(Model%nx*Model%ny), & + J_INDEX(Model%nx*Model%ny) + + real(kind=kind_phys) :: & + RLA (Model%nx*Model%ny), & + RLO (Model%nx*Model%ny), & + SLMASK (Model%nx*Model%ny), & + OROG (Model%nx*Model%ny), & + OROG_UF (Model%nx*Model%ny), & + SLIFCS (Model%nx*Model%ny), & + TSFFCS (Model%nx*Model%ny), & + SNOFCS (Model%nx*Model%ny), & + ZORFCS (Model%nx*Model%ny), & + TG3FCS (Model%nx*Model%ny), & + CNPFCS (Model%nx*Model%ny), & + AISFCS (Model%nx*Model%ny), & +! F10MFCS(Model%nx*Model%ny), & + VEGFCS (Model%nx*Model%ny), & + VETFCS (Model%nx*Model%ny), & + SOTFCS (Model%nx*Model%ny), & + CVFCS (Model%nx*Model%ny), & + CVBFCS (Model%nx*Model%ny), & + CVTFCS (Model%nx*Model%ny), & + SWDFCS (Model%nx*Model%ny), & + SIHFCS (Model%nx*Model%ny), & + SICFCS (Model%nx*Model%ny), & + SITFCS (Model%nx*Model%ny), & + VMNFCS (Model%nx*Model%ny), & + VMXFCS (Model%nx*Model%ny), & + SLPFCS (Model%nx*Model%ny), & + ABSFCS (Model%nx*Model%ny), & + ALFFC1 (Model%nx*Model%ny*2), & + ALBFC1 (Model%nx*Model%ny*4), & + SMCFC1 (Model%nx*Model%ny*Model%lsoil), & + STCFC1 (Model%nx*Model%ny*Model%lsoil), & + SLCFC1 (Model%nx*Model%ny*Model%lsoil) + + character(len=6) :: tile_num_ch + real(kind=kind_phys), parameter :: pifac=180.0/pi + real(kind=kind_phys) :: sig1t + integer :: npts, len, nb, ix, jx, ls, ios + logical :: exists +! +!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +! +! if (Model%me .eq. 0) print *,' nlats=',nlats,' lonsinpe=' +! *,lonsinpe(0,1) + + tile_num_ch = " " + if (Model%tile_num < 10) then + write(tile_num_ch, "(a4,i1)") "tile", Model%tile_num + else + write(tile_num_ch, "(a4,i2)") "tile", Model%tile_num + endif + + len = 0 + do jx = Model%jsc, (Model%jsc+Model%ny-1) + do ix = Model%isc, (Model%isc+Model%nx-1) + len = len + 1 + i_index(len) = ix + j_index(len) = jx + enddo + enddo + + sig1t = 0.0 + npts = Model%nx*Model%ny +! + len = 0 + do nb = 1,nblks + do ix = 1,size(Grid(nb)%xlat,1) + len = len + 1 + RLA (len) = Grid(nb)%xlat (ix) * pifac + RLO (len) = Grid(nb)%xlon (ix) * pifac + OROG (len) = Sfcprop(nb)%oro (ix) + OROG_UF (len) = Sfcprop(nb)%oro_uf (ix) + SLIFCS (len) = Sfcprop(nb)%slmsk (ix) + if ( Model%nstf_name(1) > 0 ) then + TSFFCS(len) = Sfcprop(nb)%tref (ix) + else + TSFFCS(len) = Sfcprop(nb)%tsfc (ix) + endif + SNOFCS (len) = Sfcprop(nb)%weasd (ix) + ZORFCS (len) = Sfcprop(nb)%zorl (ix) + TG3FCS (len) = Sfcprop(nb)%tg3 (ix) + CNPFCS (len) = Sfcprop(nb)%canopy (ix) +! F10MFCS (len) = Sfcprop(nb)%f10m (ix) + VEGFCS (len) = Sfcprop(nb)%vfrac (ix) + VETFCS (len) = Sfcprop(nb)%vtype (ix) + SOTFCS (len) = Sfcprop(nb)%stype (ix) + CVFCS (len) = Cldprop(nb)%cv (ix) + CVBFCS (len) = Cldprop(nb)%cvb (ix) + CVTFCS (len) = Cldprop(nb)%cvt (ix) + SWDFCS (len) = Sfcprop(nb)%snowd (ix) + SIHFCS (len) = Sfcprop(nb)%hice (ix) + SICFCS (len) = Sfcprop(nb)%fice (ix) + SITFCS (len) = Sfcprop(nb)%tisfc (ix) + VMNFCS (len) = Sfcprop(nb)%shdmin (ix) + VMXFCS (len) = Sfcprop(nb)%shdmax (ix) + SLPFCS (len) = Sfcprop(nb)%slope (ix) + ABSFCS (len) = Sfcprop(nb)%snoalb (ix) + + ALFFC1 (len ) = Sfcprop(nb)%facsf (ix) + ALFFC1 (len + npts) = Sfcprop(nb)%facwf (ix) + + ALBFC1 (len ) = Sfcprop(nb)%alvsf (ix) + ALBFC1 (len + npts ) = Sfcprop(nb)%alvwf (ix) + ALBFC1 (len + npts*2) = Sfcprop(nb)%alnsf (ix) + ALBFC1 (len + npts*3) = Sfcprop(nb)%alnwf (ix) + + do ls = 1,Model%lsoil + SMCFC1 (len + (ls-1)*npts) = Sfcprop(nb)%smc (ix,ls) + STCFC1 (len + (ls-1)*npts) = Sfcprop(nb)%stc (ix,ls) + SLCFC1 (len + (ls-1)*npts) = Sfcprop(nb)%slc (ix,ls) + enddo + + IF (SLIFCS(len) .LT. 0.1 .OR. SLIFCS(len) .GT. 1.5) THEN + SLMASK(len) = 0 + ELSE + SLMASK(len) = 1 + ENDIF + + IF (SLIFCS(len) .EQ. 2) THEN + AISFCS(len) = 1. + ELSE + AISFCS(len) = 0. + ENDIF + +! if (Model%me .eq. 0) +! & print *,' len=',len,' rla=',rla(len),' rlo=',rlo(len) + ENDDO !-----END BLOCK SIZE LOOP------------------------------ + ENDDO !-----END BLOCK LOOP------------------------------- + +! check +! call mymaxmin(slifcs,len,len,1,'slifcs') +! call mymaxmin(slmask,len,len,1,'slmsk') +! +#ifndef INTERNAL_FILE_NML + inquire (file=trim(Model%fn_nml),exist=exists) + if (.not. exists) then + write(6,*) 'gcycle:: namelist file: ',trim(Model%fn_nml),' does not exist' + stop + else + open (unit=Model%nlunit, file=trim(Model%fn_nml), action='READ', status='OLD', iostat=ios) + rewind (Model%nlunit) + endif +#endif + CALL SFCCYCLE (9998, npts, Model%lsoil, SIG1T, Model%fhcyc, & + Model%idate(4), Model%idate(2), & + Model%idate(3), Model%idate(1), & + Model%phour, RLA, RLO, SLMASK, & +! Model%fhour, RLA, RLO, SLMASK, & + OROG, OROG_UF, Model%USE_UFO, Model%nst_anl, & + SIHFCS, SICFCS, SITFCS, SWDFCS, SLCFC1, & + VMNFCS, VMXFCS, SLPFCS, ABSFCS, TSFFCS, & + SNOFCS, ZORFCS, ALBFC1, TG3FCS, CNPFCS, & + SMCFC1, STCFC1, SLIFCS, AISFCS, & + VEGFCS, VETFCS, SOTFCS, ALFFC1, CVFCS, & + CVBFCS, CVTFCS, Model%me, Model%nlunit, & + size(Model%input_nml_file), & + Model%input_nml_file, & + Model%ialb, Model%isot, Model%ivegsrc, & + trim(tile_num_ch), i_index, j_index) +#ifndef INTERNAL_FILE_NML + close (Model%nlunit) +#endif + + len = 0 + do nb = 1,nblks + do ix = 1,size(Grid(nb)%xlat,1) + len = len + 1 + Sfcprop(nb)%slmsk (ix) = SLIFCS (len) + if ( Model%nstf_name(1) > 0 ) then + Sfcprop(nb)%tref(ix) = TSFFCS (len) + else + Sfcprop(nb)%tsfc(ix) = TSFFCS (len) + endif + Sfcprop(nb)%weasd (ix) = SNOFCS (len) + Sfcprop(nb)%zorl (ix) = ZORFCS (len) + Sfcprop(nb)%tg3 (ix) = TG3FCS (len) + Sfcprop(nb)%canopy (ix) = CNPFCS (len) +! Sfcprop(nb)%f10m (ix) = F10MFCS (len) + Sfcprop(nb)%vfrac (ix) = VEGFCS (len) + Sfcprop(nb)%vtype (ix) = VETFCS (len) + Sfcprop(nb)%stype (ix) = SOTFCS (len) + Cldprop(nb)%cv (ix) = CVFCS (len) + Cldprop(nb)%cvb (ix) = CVBFCS (len) + Cldprop(nb)%cvt (ix) = CVTFCS (len) + Sfcprop(nb)%snowd (ix) = SWDFCS (len) + Sfcprop(nb)%hice (ix) = SIHFCS (len) + Sfcprop(nb)%fice (ix) = SICFCS (len) + Sfcprop(nb)%tisfc (ix) = SITFCS (len) + Sfcprop(nb)%shdmin (ix) = VMNFCS (len) + Sfcprop(nb)%shdmax (ix) = VMXFCS (len) + Sfcprop(nb)%slope (ix) = SLPFCS (len) + Sfcprop(nb)%snoalb (ix) = ABSFCS (len) + + Sfcprop(nb)%facsf (ix) = ALFFC1 (len ) + Sfcprop(nb)%facwf (ix) = ALFFC1 (len + npts) + + Sfcprop(nb)%alvsf (ix) = ALBFC1 (len ) + Sfcprop(nb)%alvwf (ix) = ALBFC1 (len + npts ) + Sfcprop(nb)%alnsf (ix) = ALBFC1 (len + npts*2) + Sfcprop(nb)%alnwf (ix) = ALBFC1 (len + npts*3) + do ls = 1,Model%lsoil + Sfcprop(nb)%smc (ix,ls) = SMCFC1 (len + (ls-1)*npts) + Sfcprop(nb)%stc (ix,ls) = STCFC1 (len + (ls-1)*npts) + Sfcprop(nb)%slc (ix,ls) = SLCFC1 (len + (ls-1)*npts) + enddo + ENDDO !-----END BLOCK SIZE LOOP------------------------------ + ENDDO !-----END BLOCK LOOP------------------------------- + +! check +! call mymaxmin(slifcs,len,len,1,'slifcs') +! +! if (Model%me .eq. 0) print*,'executed gcycle during hour=',fhour + + RETURN + END diff --git a/physics/module_sf_mynn.F90 b/physics/module_sf_mynn.F90 new file mode 100644 index 000000000..70b98363d --- /dev/null +++ b/physics/module_sf_mynn.F90 @@ -0,0 +1,2446 @@ +!>\file module_sf_mynn.F90 +!! This file contains +!WRF:MODEL_LAYER:PHYSICS +! +!>\ingroup gsd_mynn_sfc +!>\defgroup module_sf_mynn_mod GSD MYNN SFC Module +MODULE module_sf_mynn + +!------------------------------------------------------------------- +!Modifications implemented by Joseph Olson NOAA/GSD/AMB - CU/CIRES +!for WRFv3.4, v3.4.1, v3.5.1, v3.6, v3.7.1, and v3.9: +! +! BOTH LAND AND WATER: +!1) Calculation of stability parameter (z/L) taken from Li et al. (2010 BLM) +! for first iteration of first time step; afterwards, exact calculation. +!2) Fixed isfflx=0 option to turn off scalar fluxes, but keep momentum +! fluxes for idealized studies (credit: Anna Fitch). +!3) Kinematic viscosity now varies with temperature +!4) Uses Monin-Obukhov flux-profile relationships more consistent with +! those used in the MYNN PBL code. +!5) Allows negative QFX, similar to MYJ scheme +! +! LAND only: +!1) iz0tlnd option is now available with the following options: +! (default) =0: Zilitinkevich (1995) +! =1: Czil_new (modified according to Chen & Zhang 2008) +! =2: Modified Yang et al (2002, 2008) - generalized for all landuse +! =3: constant zt = z0/7.4 (original form; Garratt 1992) +! =4: Pan et al. (1994) with RUC mods for z_q, zili for z_t +!2) Relaxed u* minimum from 0.1 to 0.01 +! +! WATER only: +!1) isftcflx option is now available with the following options: +! (default) =0: z0, zt, and zq from the COARE algorithm. Set COARE_OPT (below) to +! 3.0 (Fairall et al. 2003, default) +! 3.5 (Edson et al 2013) +! =1: z0 from Davis et al (2008), zt & zq from COARE 3.0/3.5 +! =2: z0 from Davis et al (2008), zt & zq from Garratt (1992) +! =3: z0 from Taylor and Yelland (2004), zt and zq from COARE 3.0/3.5 +! =4: z0 from Zilitinkevich (2001), zt & zq from COARE 3.0/3.5 +! +! SNOW/ICE only: +!1) Added Andreas (2002) snow/ice parameterization for thermal and +! moisture roughness to help reduce the cool/moist bias in the arctic +! region. Also added a z0 mod for snow (Andreas et al. 2005, BLM), which +! +! Misc: +! 2) added a more elaborate diagnostic for u10 & V10 for high vertical resolution +! model configurations. +! +! New for v3.9: +! - option for stochastic parameter perturbations (SPP) +! +!NOTE: This code was primarily tested in combination with the RUC LSM. +! Performance with the Noah (or other) LSM is relatively unknown. +!------------------------------------------------------------------- +!For WRF +! USE module_model_constants, only: & +! &g, p1000mb, cp, xlv, ep_2, r_d, r_v, rcp, cpv +! + USE module_bl_mynn, only: tv0, b1, b2, p608, ev, rd, & !, mym_condensation + &esat_blend, xl_blend, qsat_blend + + use physcons, only : cp => con_cp, & + & g => con_g, & + & r_d => con_rd, & + & r_v => con_rv, & + & cpv => con_cvap, & + & cliq => con_cliq, & + & Cice => con_csol, & + & rcp => con_rocp, & + & XLV => con_hvap, & + & XLF => con_hfus, & + & EP_1 => con_fvirt, & + & EP_2 => con_eps + +!------------------------------------------------------------------- + IMPLICIT NONE +!------------------------------------------------------------------- +!For non-WRF +! REAL , PARAMETER :: g = 9.81 +! REAL , PARAMETER :: r_d = 287. +! REAL , PARAMETER :: cp = 7.*r_d/2. +! REAL , PARAMETER :: r_v = 461.6 +! REAL , PARAMETER :: cpv = 4.*r_v +! REAL , PARAMETER :: rcp = r_d/cp +! REAL , PARAMETER :: XLV = 2.5E6 +! REAL , PARAMETER :: XLF = 3.50E5 + REAL , PARAMETER :: p1000mb = 100000. +! REAL , PARAMETER :: EP_2 = r_d/r_v + + + + REAL, PARAMETER :: xlvcp=xlv/cp, ep_3=1.-ep_2 + REAL, PARAMETER :: wmin=0.1 ! Minimum wind speed + REAL, PARAMETER :: VCONVC=1.25 + REAL, PARAMETER :: SNOWZ0=0.011 + REAL, PARAMETER :: COARE_OPT=3.0 ! 3.0 or 3.5 + !For debugging purposes: + LOGICAL, PARAMETER :: debug_code = .false. + +CONTAINS + +!------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!> Fill the PSIM and PSIH tables. The subroutine "sfclayinit". +!! can be found in module_sf_sfclay.F. This subroutine returns +!! the forms from Dyer and Hicks (1974). + SUBROUTINE mynn_sf_init_driver(allowed_to_read) + + LOGICAL, INTENT(in) :: allowed_to_read + +! CALL sfclayinit(allowed_to_read) + + END SUBROUTINE mynn_sf_init_driver + +!------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!! This subroutine + SUBROUTINE SFCLAY_mynn( & + U3D,V3D,T3D,QV3D,P3D,dz8w, & + CP,G,ROVCP,R,XLV,PSFCPA,CHS,CHS2,CQS2, & + ZNT,UST,PBLH,MAVAIL,ZOL,MOL,REGIME, & + PSIM,PSIH,PSIX,PSIX10,PSIT,PSIT2, & + XLAND,HFX,QFX,LH,TSK,FLHC,FLQC,QSFC,RMOL, & + U10,V10,TH2,T2,Q2,SNOWH, & + GZ1OZ0,WSPD,BR,ISFFLX,DX, & + SVP1,SVP2,SVP3,SVPT0,EP1,EP2, & + KARMAN,itimestep,ch,th3d,pi3d,qc3d,rho3d, & + tsq,qsq,cov,sh3d,el_pbl,qcg,wstar, & + icloud_bl,qc_bl,cldfra_bl, & + spp_pbl,pattern_spp_pbl, & + ids,ide, jds,jde, kds,kde, & + ims,ime, jms,jme, kms,kme, & + its,ite, jts,jte, kts,kte, & + ustm,ck,cka,cd,cda,isftcflx,iz0tlnd, & + bl_mynn_cloudpdf) +!------------------------------------------------------------------- + IMPLICIT NONE +!------------------------------------------------------------------- +!-- U3D 3D u-velocity interpolated to theta points (m/s) +!-- V3D 3D v-velocity interpolated to theta points (m/s) +!-- T3D 3D temperature (K) +!-- QV3D 3D water vapor mixing ratio (Kg/Kg) +!-- P3D 3D pressure (Pa) +!-- RHO3D 3D density (kg/m3) +!-- dz8w 3D dz between full levels (m) +!-- CP heat capacity at constant pressure for dry air (J/kg/K) +!-- G acceleration due to gravity (m/s^2) +!-- ROVCP R/CP +!-- R gas constant for dry air (J/kg/K) +!-- XLV latent heat of vaporization for water (J/kg) +!-- PSFCPA surface pressure (Pa) +!-- ZNT roughness length (m) +!-- UST u* in similarity theory (m/s) +!-- USTM u* in similarity theory (m/s) w* added to WSPD. This is +! used to couple with TKE scheme but not in MYNN. +! (as of now, USTM = UST in this version) +!-- PBLH PBL height from previous time (m) +!-- MAVAIL surface moisture availability (between 0 and 1) +!-- ZOL z/L height over Monin-Obukhov length +!-- MOL T* (similarity theory) (K) +!-- RMOL Reciprocal of M-O length (/m) +!-- REGIME flag indicating PBL regime (stable, unstable, etc.) +!-- PSIM similarity stability function for momentum +!-- PSIH similarity stability function for heat +!-- XLAND land mask (1 for land, 2 for water) +!-- HFX upward heat flux at the surface (W/m^2) +!-- QFX upward moisture flux at the surface (kg/m^2/s) +!-- LH net upward latent heat flux at surface (W/m^2) +!-- TSK surface temperature (K) +!-- FLHC exchange coefficient for heat (W/m^2/K) +!-- FLQC exchange coefficient for moisture (kg/m^2/s) +!-- CHS heat/moisture exchange coefficient for LSM (m/s) +!-- QGH lowest-level saturated mixing ratio +!-- QSFC qv (specific humidity) at the surface +!-- QSFCMR qv (mixing ratio) at the surface +!-- U10 diagnostic 10m u wind +!-- V10 diagnostic 10m v wind +!-- TH2 diagnostic 2m theta (K) +!-- T2 diagnostic 2m temperature (K) +!-- Q2 diagnostic 2m mixing ratio (kg/kg) +!-- SNOWH Snow height (m) +!-- GZ1OZ0 log((z1+ZNT)/ZNT) where ZNT is roughness length +!-- WSPD wind speed at lowest model level (m/s) +!-- BR bulk Richardson number in surface layer +!-- ISFFLX isfflx=1 for surface heat and moisture fluxes +!-- DX horizontal grid size (m) +!-- SVP1 constant for saturation vapor pressure (=0.6112 kPa) +!-- SVP2 constant for saturation vapor pressure (=17.67 dimensionless) +!-- SVP3 constant for saturation vapor pressure (=29.65 K) +!-- SVPT0 constant for saturation vapor pressure (=273.15 K) +!-- EP1 constant for virtual temperature (Rv/Rd - 1) (dimensionless) +!-- EP2 constant for spec. hum. calc (Rd/Rv = 0.622) (dimensionless) +!-- EP3 constant for spec. hum. calc (1 - Rd/Rv = 0.378 ) (dimensionless) +!-- KARMAN Von Karman constant +!-- ck enthalpy exchange coeff at 10 meters +!-- cd momentum exchange coeff at 10 meters +!-- cka enthalpy exchange coeff at the lowest model level +!-- cda momentum exchange coeff at the lowest model level +!-- isftcflx =0: z0, zt, and zq from COARE3.0/3.5 (Fairall et al 2003/Edson et al 2013) +! (water =1: z0 from Davis et al (2008), zt & zq from COARE3.0/3.5 +! only) =2: z0 from Davis et al (2008), zt & zq from Garratt (1992) +! =3: z0 from Taylor and Yelland (2004), zt and zq from COARE 3.0/3.5 +! =4: z0 from Zilitinkevich (2001), zt & zq from COARE 3.0/3.5 +!-- iz0tlnd =0: Zilitinkevich (1995) with Czil=0.10, +! (land =1: Czil_new (modified according to Chen & Zhang 2008) +! only) =2: Modified Yang et al (2002, 2008) - generalized for all landuse +! =3: constant zt = z0/7.4 (Garratt 1992) +! =4: Pan et al (1994) for zq; ZIlitintevich for zt +!-- bl_mynn_cloudpdf =0: Mellor & Yamada +! =1: Kuwano et al. +!-- el_pbl = mixing length from PBL scheme (meters) +!-- Sh3d = Stability finction for heat (unitless) +!-- cov = T'q' from PBL scheme +!-- tsq = T'T' from PBL scheme +!-- qsq = q'q' from PBL scheme +!-- icloud_bl = namelist option for subgrid scale cloud/radiation feedback +!-- qc_bl = subgrid scale (bloundary layer) clouds +!-- cldfra_bl = subgridscale cloud fraction +! +!-- ids start index for i in domain +!-- ide end index for i in domain +!-- jds start index for j in domain +!-- jde end index for j in domain +!-- kds start index for k in domain +!-- kde end index for k in domain +!-- ims start index for i in memory +!-- ime end index for i in memory +!-- jms start index for j in memory +!-- jme end index for j in memory +!-- kms start index for k in memory +!-- kme end index for k in memory +!-- its start index for i in tile +!-- ite end index for i in tile +!-- jts start index for j in tile +!-- jte end index for j in tile +!-- kts start index for k in tile +!-- kte end index for k in tile +!================================================================= +! SCALARS +!=================================== + INTEGER, INTENT(IN) :: ids,ide, jds,jde, kds,kde, & + ims,ime, jms,jme, kms,kme, & + its,ite, jts,jte, kts,kte + INTEGER, INTENT(IN) :: itimestep + REAL, INTENT(IN) :: SVP1,SVP2,SVP3,SVPT0 + REAL, INTENT(IN) :: EP1,EP2,KARMAN + REAL, INTENT(IN) :: CP,G,ROVCP,R,XLV !,DX +!NAMELIST OPTIONS: + INTEGER, INTENT(IN) :: ISFFLX + INTEGER, OPTIONAL, INTENT(IN) :: ISFTCFLX, IZ0TLND,& + bl_mynn_cloudpdf,& + icloud_bl + INTEGER, INTENT(IN),OPTIONAL :: spp_pbl + +!=================================== +! 3D VARIABLES +!=================================== + REAL, DIMENSION( ims:ime, kms:kme, jms:jme ) , & + INTENT(IN ) :: dz8w, & + QV3D, & + P3D, & + T3D, & + QC3D, & + U3D,V3D, & + RHO3D,th3d,pi3d,tsq,qsq,cov,sh3d,el_pbl + + REAL, DIMENSION( ims:ime, kms:kme, jms:jme ) :: qc_bl, & + cldfra_bl + REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(IN),OPTIONAL ::pattern_spp_pbl +!=================================== +! 2D VARIABLES +!=================================== + REAL, DIMENSION( ims:ime, jms:jme ) , & + INTENT(IN ) :: MAVAIL, & + PBLH, & + XLAND, & + TSK, & + QCG, & + PSFCPA, & + SNOWH, & + DX + + REAL, DIMENSION( ims:ime, jms:jme ) , & + INTENT(OUT ) :: U10,V10, & + TH2,T2,Q2 + + REAL, OPTIONAL, DIMENSION( ims:ime, jms:jme ) , & + INTENT(OUT) :: ck,cka,cd,cda,ustm +! + REAL, DIMENSION( ims:ime, jms:jme ) , & + INTENT(INOUT) :: REGIME, & + HFX, & + QFX, & + LH, & + MOL,RMOL, & + QSFC, & + ZNT, & + ZOL, & + UST, & + CHS2, & + CQS2, & + CHS, & + CH, & + FLHC,FLQC, & + GZ1OZ0,WSPD,BR, & + PSIM,PSIH, & + WSTAR, & + PSIX,PSIX10,PSIT,PSIT2 + +!ADDITIONAL OUTPUT +!JOE-begin + REAL, DIMENSION( ims:ime, jms:jme ) :: z0zt_ratio, & + BulkRi,qstar,resist,logres +!JOE-end +!=================================== +! 1D LOCAL ARRAYS +!=================================== + REAL, DIMENSION( its:ite ) :: U1D, & + V1D, & + U1D2,V1D2, & !level2 winds + QV1D, & + P1D, & + T1D,QC1D, & + RHO1D, & + dz8w1d, & !level 1 height + dz2w1d !level 2 height + + REAL, DIMENSION( its:ite ) :: rstoch1D + + ! VARIABLE FOR PASSING TO MYM_CONDENSATION + REAL, DIMENSION(kts:kts+1 ) :: dummy1,dummy2,dummy3,dummy4, & + dummy5,dummy6,dummy7,dummy8, & + dummy9,dummy10,dummy11, & + dummy12,dummy13,dummy14 + + REAL, DIMENSION( its:ite ) :: vt1,vq1 + REAL, DIMENSION(kts:kts+1) :: thl, qw, vt, vq + REAL :: ql + + INTEGER :: I,J,K,itf,jtf,ktf +!----------------------------------------------------------- +!joe -test printing of constants: +! print*,"cp=", cp +! print*,"g=", g +! print*,"Rd=", r_d +! print*,"Rv=", r_v +! print*,"cpc=", cpv +! print*,"cliq=", cliq +! print*,"cice=", Cice +! print*,"rcp=", rcp +! print*,"xlv=", XLV +! print*,"xlf=", XLF +! print*,"ep1=", EP_1 +! print*,"ep2=", EP_2 + + + itf=ite !MIN0(ite,ide-1) + jtf=jte !MIN0(jte,jde-1) + ktf=kte !MIN0(kte,kde-1) + + DO J=jts,jte + DO i=its,ite + dz8w1d(I) = dz8w(i,kts,j) + dz2w1d(I) = dz8w(i,kts+1,j) + U1D(i) =U3D(i,kts,j) + V1D(i) =V3D(i,kts,j) + !2nd model level winds - for diags with high-res grids + U1D2(i) =U3D(i,kts+1,j) + V1D2(i) =V3D(i,kts+1,j) + QV1D(i)=QV3D(i,kts,j) + QC1D(i)=QC3D(i,kts,j) + P1D(i) =P3D(i,kts,j) + T1D(i) =T3D(i,kts,j) + RHO1D(i)=RHO3D(i,kts,j) + if (spp_pbl==1) then + rstoch1D(i)=pattern_spp_pbl(i,kts,j) + else + rstoch1D(i)=0.0 + endif + ENDDO + + IF (itimestep==1) THEN + DO i=its,ite + vt1(i)=0. + vq1(i)=0. + UST(i,j)=MAX(0.025*SQRT(U1D(i)*U1D(i) + V1D(i)*V1D(i)),0.001) + MOL(i,j)=0. ! Tstar + QSFC(i,j)=QV3D(i,kts,j)/(1.+QV3D(i,kts,j)) + qstar(i,j)=0.0 + ENDDO + ELSE + DO i=its,ite + DO k = kts,kts+1 + ql = qc3d(i,k,j)/(1.+qc3d(i,k,j)) + qw(k) = qv3d(i,k,j)/(1.+qv3d(i,k,j)) + ql + thl(k) = th3d(i,k,j)-xlvcp*ql/pi3d(i,k,j) + dummy1(k)=dz8w(i,k,j) + dummy2(k)=thl(k) + dummy3(k)=qw(k) + dummy4(k)=p3d(i,k,j) + dummy5(k)=pi3d(i,k,j) + dummy6(k)=tsq(i,k,j) + dummy7(k)=qsq(i,k,j) + dummy8(k)=cov(i,k,j) + dummy9(k)=Sh3d(i,k,j) + dummy10(k)=el_pbl(i,k,j) + dummy14(k)=th3d(i,k,j) + if(icloud_bl > 0) then + dummy11(k)=qc_bl(i,k,j) + dummy12(k)=cldfra_bl(i,k,j) + else + dummy11(k)=0.0 + dummy12(k)=0.0 + endif + dummy13(k)=0.0 !sgm + ENDDO + + ! NOTE: The last grid number is kts+1 instead of kte. + CALL mym_condensation (kts,kts+1, dx(i,j),& + & dummy1,dummy2,dummy3, & + & dummy4,dummy5,dummy6, & + & dummy7,dummy8,dummy9, & + & dummy10,bl_mynn_cloudpdf,& + & dummy11,dummy12, & + & PBLH(i,j),HFX(i,j), & + & vt(kts:kts+1), vq(kts:kts+1), & + & dummy14,dummy13) + +! ! NOTE: The last grid number is kts+1 instead of kte. +! CALL mym_condensation (kts,kts+1, dx, & +! & dz8w(i,kts:kts+1,j), & +! & thl(kts:kts+1), & +! & qw(kts:kts+1), & +! & p3d(i,kts:kts+1,j), & +! & pi3d(i,kts:kts+1,j), & +! & tsq(i,kts:kts+1,j), & +! & qsq(i,kts:kts+1,j), & +! & cov(i,kts:kts+1,j), & +! & Sh3d(i,kts:kts+1,j), & !JOE - cloud PDF testing +! & el_pbl(i,kts:kts+1,j), & !JOE - cloud PDF testing +! & bl_mynn_cloudpdf, & !JOE - cloud PDF testing +! & qc_bl2D(i,kts:kts+1), & !JOE-subgrid BL clouds +! & cldfra_bl2D(i,kts:kts+1),& !JOE-subgrid BL clouds +! & PBLH(i,j),HFX(i,j), & !JOE-subgrid BL clouds +! & vt(kts:kts+1), vq(kts:kts+1), & + ! & th,sgm) + vt1(i) = vt(kts) + vq1(i) = vq(kts) + ENDDO + ENDIF + + CALL SFCLAY1D_mynn( & + J,U1D,V1D,T1D,QV1D,P1D,dz8w1d,rho1d, & + U1D2,V1D2,dz2w1d, & + CP,G,ROVCP,R,XLV,PSFCPA(ims,j),CHS(ims,j),CHS2(ims,j),& + CQS2(ims,j), PBLH(ims,j), RMOL(ims,j), & + ZNT(ims,j),UST(ims,j),MAVAIL(ims,j),ZOL(ims,j), & + MOL(ims,j),REGIME(ims,j),PSIM(ims,j),PSIH(ims,j), & + PSIX(ims,j),PSIX10(ims,j),PSIT(ims,j),PSIT2(ims,j),& + XLAND(ims,j),HFX(ims,j),QFX(ims,j),TSK(ims,j), & + U10(ims,j),V10(ims,j),TH2(ims,j),T2(ims,j), & + Q2(ims,j),FLHC(ims,j),FLQC(ims,j),SNOWH(ims,j), & + QSFC(ims,j),LH(ims,j), & + GZ1OZ0(ims,j),WSPD(ims,j),BR(ims,j),ISFFLX,DX(ims,j),& + SVP1,SVP2,SVP3,SVPT0,EP1,EP2,KARMAN, & + ch(ims,j),vt1,vq1,qc1d,qcg(ims,j), & + itimestep, & +!JOE-begin additional output + z0zt_ratio(ims,j),wstar(ims,j), & + qstar(ims,j),resist(ims,j),logres(ims,j), & +!JOE-end + spp_pbl,rstoch1D, & + ids,ide, jds,jde, kds,kde, & + ims,ime, jms,jme, kms,kme, & + its,ite, jts,jte, kts,kte & + ,isftcflx,iz0tlnd, & + USTM(ims,j),CK(ims,j),CKA(ims,j), & + CD(ims,j),CDA(ims,j) & + ) + + ENDDO + + END SUBROUTINE SFCLAY_MYNN + +!------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!! This subroutine calculates + SUBROUTINE SFCLAY1D_mynn( & + J,U1D,V1D,T1D,QV1D,P1D,dz8w1d,rho1d, & + U1D2,V1D2,dz2w1d, & + CP,G,ROVCP,R,XLV,PSFCPA,CHS,CHS2,CQS2, & + PBLH,RMOL,ZNT,UST,MAVAIL,ZOL,MOL,REGIME, & + PSIM,PSIH,PSIX,PSIX10,PSIT,PSIT2, & + XLAND,HFX,QFX,TSK, & + U10,V10,TH2,T2,Q2,FLHC,FLQC,SNOWH, & + QSFC,LH,GZ1OZ0,WSPD,BR,ISFFLX,DX, & + SVP1,SVP2,SVP3,SVPT0,EP1,EP2, & + KARMAN,ch,vt1,vq1,qc1d,qcg, & + itimestep, & +!JOE-additional output + zratio,wstar,qstar,resist,logres, & +!JOE-end + spp_pbl,rstoch1D, & + ids,ide, jds,jde, kds,kde, & + ims,ime, jms,jme, kms,kme, & + its,ite, jts,jte, kts,kte & + ,isftcflx, iz0tlnd, & + ustm,ck,cka,cd,cda & + ) + +!------------------------------------------------------------------- + IMPLICIT NONE +!------------------------------------------------------------------- +! SCALARS +!----------------------------- + INTEGER, INTENT(IN) :: ids,ide, jds,jde, kds,kde, & + ims,ime, jms,jme, kms,kme, & + its,ite, jts,jte, kts,kte, & + J, itimestep + + REAL, PARAMETER :: XKA=2.4E-5 !molecular diffusivity + REAL, PARAMETER :: PRT=1. !prandlt number + REAL, INTENT(IN) :: SVP1,SVP2,SVP3,SVPT0,EP1,EP2 + REAL, INTENT(IN) :: KARMAN,CP,G,ROVCP,R,XLV !,DX + +!----------------------------- +! NAMELIST OPTIONS +!----------------------------- + INTEGER, INTENT(IN) :: ISFFLX + INTEGER, OPTIONAL, INTENT(IN ) :: ISFTCFLX, IZ0TLND + INTEGER, INTENT(IN) :: spp_pbl + +!----------------------------- +! 1D ARRAYS +!----------------------------- + REAL, DIMENSION( ims:ime ), INTENT(IN) :: MAVAIL, & + PBLH, & + XLAND, & + TSK, & + PSFCPA, & + QCG, & + SNOWH, DX + + REAL, DIMENSION( its:ite ), INTENT(IN) :: U1D,V1D, & + U1D2,V1D2, & + QV1D,P1D, & + T1D,QC1d, & + dz8w1d,dz2w1d, & + RHO1D, & + vt1,vq1 + + REAL, DIMENSION( ims:ime ), INTENT(INOUT) :: REGIME, & + HFX,QFX,LH, & + MOL,RMOL, & + QSFC, & + ZNT, & + ZOL, & + UST, & + CHS2,CQS2, & + CHS,CH, & + FLHC,FLQC, & + GZ1OZ0, & + WSPD, & + BR, & + PSIM,PSIH, & + PSIX,PSIX10,PSIT,PSIT2 + + REAL, DIMENSION( its:ite ), INTENT(IN) :: rstoch1D + + ! DIAGNOSTIC OUTPUT + REAL, DIMENSION( ims:ime ), INTENT(OUT) :: U10,V10, & + TH2,T2,Q2 + + REAL, OPTIONAL, DIMENSION( ims:ime ) , & + INTENT(OUT) :: ck,cka,cd,cda,ustm +!-------------------------------------------- +!JOE-additinal output + REAL, DIMENSION( ims:ime ) :: zratio,wstar,qstar, & + resist,logres +!JOE-end +!---------------------------------------------------------------- +! LOCAL VARS +!---------------------------------------------------------------- + REAL :: thl1,sqv1,sqc1,exner1,sqvg,sqcg,vv,ww + + REAL, DIMENSION(its:ite) :: & + ZA, & !Height of lowest 1/2 sigma level(m) + ZA2, & !Height of 2nd lowest 1/2 sigma level(m) + THV1D, & !Theta-v at lowest 1/2 sigma (K) + TH1D, & !Theta at lowest 1/2 sigma (K) + TC1D, & !T at lowest 1/2 sigma (Celsius) + TV1D, & !Tv at lowest 1/2 sigma (K) + QVSH, & !qv at lowest 1/2 sigma (spec humidity) + PSIH2,PSIM2, & !M-O stability functions at z=2 m + PSIH10,PSIM10, & !M-O stability functions at z=10 m + WSPDI, & + CPM, & + z_t,z_q, & !thermal & moisture roughness lengths + ZNTstoch, & + GOVRTH, & !g/theta + THGB, & !theta at ground + THVGB, & !theta-v at ground + PSFC, & !press at surface (Pa/1000) + QSFCMR, & !qv at surface (mixing ratio, kg/kg) + GZ2OZ0, & !LOG((2.0+ZNT(I))/ZNT(I)) + GZ10OZ0, & !LOG((10.+ZNT(I))/ZNT(I)) + GZ2OZt, & !LOG((2.0+z_t(i))/z_t(i)) + GZ10OZt, & !LOG((10.+z_t(i))/z_t(i)) + GZ1OZt !LOG((ZA(I)+z_t(i))/z_t(i)) + + INTEGER :: N,I,K,L,NZOL,NK,NZOL2,NZOL10, ITER, yesno + INTEGER, PARAMETER :: ITMAX=1 + + REAL :: PL,THCON,TVCON,E1 + REAL :: DTHVDZ,DTHVM,VCONV,RZOL,RZOL2,RZOL10,ZOL2,ZOL10 + REAL :: DTG,DTTHX,DTHDZ,PSIT10,PSIQ,PSIQ2,PSIQ10 + REAL :: FLUXC,VSGD + REAL :: restar,VISC,DQG,OLDUST,OLDTST + REAL, PARAMETER :: psilim = -10. ! ONLY AFFECTS z/L > 2.0 +!------------------------------------------------------------------- + + DO I=its,ite + ! CONVERT GROUND & LOWEST LAYER TEMPERATURE TO POTENTIAL TEMPERATURE: + ! PSFC cmb + PSFC(I)=PSFCPA(I)/1000. + THGB(I)=TSK(I)*(100./PSFC(I))**ROVCP !(K) + ! PL cmb + PL=P1D(I)/1000. + THCON=(100./PL)**ROVCP + TH1D(I)=T1D(I)*THCON !(Theta, K) + TC1D(I)=T1D(I)-273.15 !(T, Celsius) + + ! CONVERT TO VIRTUAL TEMPERATURE + QVSH(I)=QV1D(I)/(1.+QV1D(I)) !CONVERT TO SPEC HUM (kg/kg) + TVCON=(1.+EP1*QVSH(I)) + THV1D(I)=TH1D(I)*TVCON !(K) + TV1D(I)=T1D(I)*TVCON !(K) + + !RHO1D(I)=PSFCPA(I)/(R*TV1D(I)) !now using value calculated in sfc driver + ZA(I)=0.5*dz8w1d(I) !height of first half-sigma level + ZA2(I)=dz8w1d(I) + 0.5*dz2w1d(I) !height of 2nd half-sigma level + GOVRTH(I)=G/TH1D(I) + ENDDO + + DO I=its,ite + IF (TSK(I) .LT. 273.15) THEN + !SATURATION VAPOR PRESSURE WRT ICE (SVP1=.6112; 10*mb) + E1=SVP1*EXP(4648*(1./273.15 - 1./TSK(I)) - & + & 11.64*LOG(273.15/TSK(I)) + 0.02265*(273.15 - TSK(I))) + ELSE + !SATURATION VAPOR PRESSURE WRT WATER (Bolton 1980) + E1=SVP1*EXP(SVP2*(TSK(I)-SVPT0)/(TSK(I)-SVP3)) + ENDIF + !FOR LAND POINTS, QSFC can come from LSM, ONLY RECOMPUTE OVER WATER + IF (xland(i).gt.1.5 .or. QSFC(i).le.0.0) THEN !WATER + QSFC(I)=EP2*E1/(PSFC(I)-ep_3*E1) !specific humidity + QSFCMR(I)=EP2*E1/(PSFC(I)-E1) !mixing ratio + ELSE !LAND + QSFCMR(I)=QSFC(I)/(1.-QSFC(I)) + ENDIF + + IF (TSK(I) .LT. 273.15) THEN + !SATURATION VAPOR PRESSURE WRT ICE + E1=SVP1*EXP(4648*(1./273.15 - 1./T1D(I)) - & + & 11.64*LOG(273.15/T1D(I)) + 0.02265*(273.15 - T1D(I))) + ELSE + !SATURATION VAPOR PRESSURE WRT WATER (Bolton 1980) + E1=SVP1*EXP(SVP2*(T1D(I)-SVPT0)/(T1D(I)-SVP3)) + ENDIF + PL=P1D(I)/1000. + CPM(I)=CP*(1.+0.84*QV1D(I)) + ENDDO + + DO I=its,ite + WSPD(I)=SQRT(U1D(I)*U1D(I)+V1D(I)*V1D(I)) + + !account for partial condensation + exner1=(p1d(I)/p1000mb)**ROVCP + sqc1=qc1d(I)/(1.+qc1d(I)) !lowest mod level cloud water spec hum + sqv1=QVSH(I) !lowest mod level water vapor spec hum + thl1=TH1D(I)-xlvcp/exner1*sqc1 + sqvg=qsfc(I) !sfc water vapor spec hum + sqcg=qcg(I)/(1.+qcg(I)) !sfc cloud water spec hum + + vv = thl1-THGB(I) + !TGS:ww = mavail(I)*(sqv1-sqvg) + (sqc1-sqcg) + ww = (sqv1-sqvg) + (sqc1-sqcg) + + !TGS:THVGB(I)=THGB(I)*(1.+EP1*QSFC(I)*MAVAIL(I)) + THVGB(I)=THGB(I)*(1.+EP1*QSFC(I)) + + DTHDZ=(TH1D(I)-THGB(I)) + DTHVDZ=(THV1D(I)-THVGB(I)) + !DTHVDZ= (vt1(i) + 1.0)*vv + (vq1(i) + tv0)*ww + + !-------------------------------------------------------- + ! Calculate the convective velocity scale (WSTAR) and + ! subgrid-scale velocity (VSGD) following Beljaars (1995, QJRMS) + ! and Mahrt and Sun (1995, MWR), respectively + !------------------------------------------------------- + ! Use Beljaars over land and water + fluxc = max(hfx(i)/RHO1D(i)/cp & + & + ep1*THVGB(I)*qfx(i)/RHO1D(i),0.) + WSTAR(I) = vconvc*(g/TSK(i)*pblh(i)*fluxc)**.33 + + !-------------------------------------------------------- + ! Mahrt and Sun low-res correction + ! (for 13 km ~ 0.37 m/s; for 3 km == 0 m/s) + !-------------------------------------------------------- + VSGD = 0.32 * (max(dx(i)/5000.-1.,0.))**.33 + WSPD(I)=SQRT(WSPD(I)*WSPD(I)+WSTAR(I)*WSTAR(I)+vsgd*vsgd) + WSPD(I)=MAX(WSPD(I),wmin) + + !-------------------------------------------------------- + ! CALCULATE THE BULK RICHARDSON NUMBER OF SURFACE LAYER, + ! ACCORDING TO AKB(1976), EQ(12). + !-------------------------------------------------------- + BR(I)=GOVRTH(I)*ZA(I)*DTHVDZ/(WSPD(I)*WSPD(I)) + !SET LIMITS ACCORDING TO Li et al. (2010) Boundary-Layer Meteorol (p.158) + BR(I)=MAX(BR(I),-20.0) + BR(I)=MIN(BR(I),2.0) + + ! IF PREVIOUSLY UNSTABLE, DO NOT LET INTO REGIMES 1 AND 2 (STABLE) + !if (itimestep .GT. 1) THEN + ! IF(MOL(I).LT.0.)BR(I)=MIN(BR(I),0.0) + !ENDIF + + !IF(I .eq. 2)THEN + ! write(*,1006)"BR:",BR(I)," fluxc:",fluxc," vt1:",vt1(i)," vq1:",vq1(i) + ! write(*,1007)"XLAND:",XLAND(I)," WSPD:",WSPD(I)," DTHVDZ:",DTHVDZ," WSTAR:",WSTAR(I) + !ENDIF + + ENDDO + + 1006 format(A,F7.3,A,f9.4,A,f9.5,A,f9.4) + 1007 format(A,F2.0,A,f6.2,A,f7.3,A,f7.2) + +!-------------------------------------------------------------------- +!-------------------------------------------------------------------- +!--- BEGIN ITERATION LOOP (ITMAX=5); USUALLY CONVERGES IN TWO PASSES +!-------------------------------------------------------------------- +!-------------------------------------------------------------------- + + DO I=its,ite + + ITER = 1 + DO WHILE (ITER .LE. ITMAX) + + !COMPUTE KINEMATIC VISCOSITY (m2/s) Andreas (1989) CRREL Rep. 89-11 + !valid between -173 and 277 degrees C. + VISC=1.326e-5*(1. + 6.542e-3*TC1D(I) + 8.301e-6*TC1D(I)*TC1D(I) & + - 4.84e-9*TC1D(I)*TC1D(I)*TC1D(I)) + + IF((XLAND(I)-1.5).GE.0)THEN + !-------------------------------------- + ! WATER + !-------------------------------------- + ! CALCULATE z0 (znt) + !-------------------------------------- + IF ( PRESENT(ISFTCFLX) ) THEN + IF ( ISFTCFLX .EQ. 0 ) THEN + IF (COARE_OPT .EQ. 3.0) THEN + !COARE 3.0 (MISLEADING SUBROUTINE NAME) + CALL charnock_1955(ZNT(i),UST(i),WSPD(i),visc,ZA(I)) + ELSE + !COARE 3.5 + CALL edson_etal_2013(ZNT(i),UST(i),WSPD(i),visc,ZA(I)) + ENDIF + ELSEIF ( ISFTCFLX .EQ. 1 .OR. ISFTCFLX .EQ. 2 ) THEN + CALL davis_etal_2008(ZNT(i),UST(i)) + ELSEIF ( ISFTCFLX .EQ. 3 ) THEN + CALL Taylor_Yelland_2001(ZNT(i),UST(i),WSPD(i)) + ELSEIF ( ISFTCFLX .EQ. 4 ) THEN + IF (COARE_OPT .EQ. 3.0) THEN + !COARE 3.0 (MISLEADING SUBROUTINE NAME) + CALL charnock_1955(ZNT(i),UST(i),WSPD(i),visc,ZA(I)) + ELSE + !COARE 3.5 + CALL edson_etal_2013(ZNT(i),UST(i),WSPD(i),visc,ZA(I)) + ENDIF + ENDIF + ELSE + !DEFAULT TO COARE 3.0/3.5 + IF (COARE_OPT .EQ. 3.0) THEN + !COARE 3.0 + CALL charnock_1955(ZNT(i),UST(i),WSPD(i),visc,ZA(I)) + ELSE + !COARE 3.5 + CALL edson_etal_2013(ZNT(i),UST(i),WSPD(i),visc,ZA(I)) + ENDIF + ENDIF + + ! add stochastic perturbaction of ZNT + if (spp_pbl==1) then + ZNTstoch(I) = MAX(ZNT(I) + 1.5 * ZNT(I) * rstoch1D(i), 1e-6) + else + ZNTstoch(I) = ZNT(I) + endif + + !COMPUTE ROUGHNESS REYNOLDS NUMBER (restar) USING NEW ZNT + ! AHW: Garrattt formula: Calculate roughness Reynolds number + ! Kinematic viscosity of air (linear approx to + ! temp dependence at sea level) + restar=MAX(ust(i)*ZNTstoch(i)/visc, 0.1) + + !-------------------------------------- + !CALCULATE z_t and z_q + !-------------------------------------- + IF ( PRESENT(ISFTCFLX) ) THEN + IF ( ISFTCFLX .EQ. 0 ) THEN + IF (COARE_OPT .EQ. 3.0) THEN + CALL fairall_etal_2003(z_t(i),z_q(i),restar,UST(i),visc) + ELSE + !presumably, this will be published soon, but hasn't yet + CALL fairall_etal_2014(z_t(i),z_q(i),restar,UST(i),visc,rstoch1D(i),spp_pbl) + ENDIF + ELSEIF ( ISFTCFLX .EQ. 1 ) THEN + IF (COARE_OPT .EQ. 3.0) THEN + CALL fairall_etal_2003(z_t(i),z_q(i),restar,UST(i),visc) + ELSE + CALL fairall_etal_2014(z_t(i),z_q(i),restar,UST(i),visc,rstoch1D(i),spp_pbl) + ENDIF + ELSEIF ( ISFTCFLX .EQ. 2 ) THEN + CALL garratt_1992(z_t(i),z_q(i),ZNTstoch(i),restar,XLAND(I)) + ELSEIF ( ISFTCFLX .EQ. 3 ) THEN + IF (COARE_OPT .EQ. 3.0) THEN + CALL fairall_etal_2003(z_t(i),z_q(i),restar,UST(i),visc) + ELSE + CALL fairall_etal_2014(z_t(i),z_q(i),restar,UST(i),visc,rstoch1D(i),spp_pbl) + ENDIF + ELSEIF ( ISFTCFLX .EQ. 4 ) THEN + CALL zilitinkevich_1995(ZNTstoch(i),z_t(i),z_q(i),restar,& + UST(I),KARMAN,XLAND(I),IZ0TLND,spp_pbl,rstoch1D(i)) + ENDIF + ELSE + !DEFAULT TO COARE 3.0/3.5 + IF (COARE_OPT .EQ. 3.0) THEN + CALL fairall_etal_2003(z_t(i),z_q(i),restar,UST(i),visc) + ELSE + CALL fairall_etal_2014(z_t(i),z_q(i),restar,UST(i),visc,rstoch1D(i),spp_pbl) + ENDIF + ENDIF + + ELSE + + ! add stochastic perturbaction of ZNT + if (spp_pbl==1) then + ZNTstoch(I) = MAX(ZNT(I) + 1.5 * ZNT(I) * rstoch1D(i), 1e-6) + else + ZNTstoch(I) = ZNT(I) + endif + + !-------------------------------------- + ! LAND + !-------------------------------------- + !COMPUTE ROUGHNESS REYNOLDS NUMBER (restar) USING DEFAULT ZNT + restar=MAX(ust(i)*ZNTstoch(i)/visc, 0.1) + + !-------------------------------------- + !GET z_t and z_q + !-------------------------------------- + !CHECK FOR SNOW/ICE POINTS OVER LAND + !IF ( ZNTSTOCH(i) .LE. SNOWZ0 .AND. TSK(I) .LE. 273.15 ) THEN + IF ( SNOWH(i) .GE. 0.1) THEN + CALL Andreas_2002(ZNTSTOCH(i),visc,ust(i),z_t(i),z_q(i)) + ELSE + IF ( PRESENT(IZ0TLND) ) THEN + IF ( IZ0TLND .LE. 1 .OR. IZ0TLND .EQ. 4) THEN + !IF IZ0TLND==4, THEN PSIQ WILL BE RECALCULATED USING + !PAN ET AL (1994), but PSIT FROM ZILI WILL BE USED. + CALL zilitinkevich_1995(ZNTSTOCH(i),z_t(i),z_q(i),restar,& + UST(I),KARMAN,XLAND(I),IZ0TLND,spp_pbl,rstoch1D(i)) + ELSEIF ( IZ0TLND .EQ. 2 ) THEN + CALL Yang_2008(ZNTSTOCH(i),z_t(i),z_q(i),UST(i),MOL(I),& + qstar(I),restar,visc,XLAND(I)) + ELSEIF ( IZ0TLND .EQ. 3 ) THEN + !Original MYNN in WRF-ARW used this form: + CALL garratt_1992(z_t(i),z_q(i),ZNTSTOCH(i),restar,XLAND(I)) + ENDIF + ELSE + !DEFAULT TO ZILITINKEVICH + CALL zilitinkevich_1995(ZNTSTOCH(i),z_t(i),z_q(i),restar,& + UST(I),KARMAN,XLAND(I),0,spp_pbl,rstoch1D(i)) + ENDIF + ENDIF + + ENDIF + zratio(i)=zntstoch(i)/z_t(i) + + !ADD RESISTANCE (SOMEWHAT FOLLOWING JIMENEZ ET AL. (2012)) TO PROTECT AGAINST + !EXCESSIVE FLUXES WHEN USING A LOW FIRST MODEL LEVEL (ZA < 10 m). + !Formerly: GZ1OZ0(I)= LOG(ZA(I)/ZNTstoch(I)) + GZ1OZ0(I)= LOG((ZA(I)+ZNTstoch(I))/ZNTstoch(I)) + GZ1OZt(I)= LOG((ZA(I)+z_t(i))/z_t(i)) + GZ2OZ0(I)= LOG((2.0+ZNTstoch(I))/ZNTstoch(I)) + GZ2OZt(I)= LOG((2.0+z_t(i))/z_t(i)) + GZ10OZ0(I)=LOG((10.+ZNTstoch(I))/ZNTstoch(I)) + GZ10OZt(I)=LOG((10.+z_t(i))/z_t(i)) + + !-------------------------------------------------------------------- + !--- DIAGNOSE BASIC PARAMETERS FOR THE APPROPRIATE STABILITY CLASS: + ! + ! THE STABILITY CLASSES ARE DETERMINED BY BR (BULK RICHARDSON NO.). + ! + ! CRITERIA FOR THE CLASSES ARE AS FOLLOWS: + ! + ! 1. BR .GE. 0.2; + ! REPRESENTS NIGHTTIME STABLE CONDITIONS (REGIME=1), + ! + ! 2. BR .LT. 0.2 .AND. BR .GT. 0.0; + ! REPRESENTS DAMPED MECHANICAL TURBULENT CONDITIONS + ! (REGIME=2), + ! + ! 3. BR .EQ. 0.0 + ! REPRESENTS FORCED CONVECTION CONDITIONS (REGIME=3), + ! + ! 4. BR .LT. 0.0 + ! REPRESENTS FREE CONVECTION CONDITIONS (REGIME=4). + ! + !-------------------------------------------------------------------- + IF (BR(I) .GT. 0.0) THEN + IF (BR(I) .GT. 0.2) THEN + !---CLASS 1; STABLE (NIGHTTIME) CONDITIONS: + REGIME(I)=1. + ELSE + !---CLASS 2; DAMPED MECHANICAL TURBULENCE: + REGIME(I)=2. + ENDIF + + !COMPUTE z/L + !CALL Li_etal_2010(ZOL(I),BR(I),ZA(I)/ZNTstoch(I),zratio(I)) +! IF (ITER .EQ. 1 .AND. itimestep .LE. 1) THEN + CALL Li_etal_2010(ZOL(I),BR(I),ZA(I)/ZNTstoch(I),zratio(I)) +! ELSE +! ZOL(I)=ZA(I)*KARMAN*G*MOL(I)/(TH1D(I)*MAX(UST(I)*UST(I),0.0001)) +! ZOL(I)=MAX(ZOL(I),0.0) +! ZOL(I)=MIN(ZOL(I),2.) +! ENDIF + + !COMPUTE PSIM and PSIH + IF((XLAND(I)-1.5).GE.0)THEN + ! WATER + !CALL PSI_Suselj_Sood_2010(PSIM(I),PSIH(I),ZOL(I)) + !CALL PSI_Beljaars_Holtslag_1991(PSIM(I),PSIH(I),ZOL(I)) + !CALL PSI_Businger_1971(PSIM(I),PSIH(I),ZOL(I)) + CALL PSI_DyerHicks(PSIM(I),PSIH(I),ZOL(I),z_t(I),ZNTstoch(I),ZA(I)) + ELSE + ! LAND + !CALL PSI_Beljaars_Holtslag_1991(PSIM(I),PSIH(I),ZOL(I)) + !CALL PSI_Businger_1971(PSIM(I),PSIH(I),ZOL(I)) + !CALL PSI_Zilitinkevich_Esau_2007(PSIM(I),PSIH(I),ZOL(I)) + CALL PSI_DyerHicks(PSIM(I),PSIH(I),ZOL(I),z_t(I),ZNTstoch(I),ZA(I)) + ENDIF + + ! LOWER LIMIT ON PSI IN STABLE CONDITIONS + PSIM(I)=MAX(PSIM(I),psilim) + PSIH(I)=MAX(PSIH(I),psilim) + PSIM10(I)=MAX(10./ZA(I)*PSIM(I), psilim) + PSIH10(I)=MAX(10./ZA(I)*PSIH(I), psilim) + PSIM2(I)=MAX(2./ZA(I)*PSIM(I), psilim) + PSIH2(I)=MAX(2./ZA(I)*PSIH(I), psilim) + ! 1.0 over Monin-Obukhov length + RMOL(I)= ZOL(I)/ZA(I) + + ELSEIF(BR(I) .EQ. 0.) THEN + !========================================================= + !-----CLASS 3; FORCED CONVECTION/NEUTRAL: + !========================================================= + REGIME(I)=3. + + PSIM(I)=0.0 + PSIH(I)=PSIM(I) + PSIM10(I)=0. + PSIH10(I)=PSIM10(I) + PSIM2(I)=0. + PSIH2(I)=PSIM2(I) + + !ZOL(I)=0. + IF(UST(I) .LT. 0.01)THEN + ZOL(I)=BR(I)*GZ1OZ0(I) + ELSE + ZOL(I)=KARMAN*GOVRTH(I)*ZA(I)*MOL(I)/(MAX(UST(I)*UST(I),0.001)) + ENDIF + RMOL(I) = ZOL(I)/ZA(I) + + ELSEIF(BR(I) .LT. 0.)THEN + !========================================================== + !-----CLASS 4; FREE CONVECTION: + !========================================================== + REGIME(I)=4. + + !COMPUTE z/L + !CALL Li_etal_2010(ZOL(I),BR(I),ZA(I)/ZNTstoch(I),zratio(I)) + !IF (ITER .EQ. 1 .AND. itimestep .LE. 1) THEN + CALL Li_etal_2010(ZOL(I),BR(I),ZA(I)/ZNTstoch(I),zratio(I)) + !ELSE + ! ZOL(I)=ZA(I)*KARMAN*G*MOL(I)/(TH1D(I)*MAX(UST(I)*UST(I),0.001)) + ! ZOL(I)=MAX(ZOL(I),-19.999) + ! ZOL(I)=MIN(ZOL(I),0.0) + !ENDIF + + ZOL10=10./ZA(I)*ZOL(I) + ZOL2=2./ZA(I)*ZOL(I) + ZOL(I)=MIN(ZOL(I),0.) + ZOL(I)=MAX(ZOL(I),-19.9999) + ZOL10=MIN(ZOL10,0.) + ZOL10=MAX(ZOL10,-19.9999) + ZOL2=MIN(ZOL2,0.) + ZOL2=MAX(ZOL2,-19.9999) + NZOL=INT(-ZOL(I)*100.) + RZOL=-ZOL(I)*100.-NZOL + NZOL10=INT(-ZOL10*100.) + RZOL10=-ZOL10*100.-NZOL10 + NZOL2=INT(-ZOL2*100.) + RZOL2=-ZOL2*100.-NZOL2 + + !COMPUTE PSIM and PSIH + IF((XLAND(I)-1.5).GE.0)THEN + ! WATER + !CALL PSI_Suselj_Sood_2010(PSIM(I),PSIH(I),ZOL(I)) + !CALL PSI_Hogstrom_1996(PSIM(I),PSIH(I),ZOL(I), z_t(I), ZNTstoch(I), ZA(I)) + !CALL PSI_Businger_1971(PSIM(I),PSIH(I),ZOL(I)) + CALL PSI_DyerHicks(PSIM(I),PSIH(I),ZOL(I),z_t(I),ZNTstoch(I),ZA(I)) + ELSE + ! LAND + !CALL PSI_Hogstrom_1996(PSIM(I),PSIH(I),ZOL(I), z_t(I), ZNTstoch(I), ZA(I)) + !CALL PSI_Businger_1971(PSIM(I),PSIH(I),ZOL(I)) + CALL PSI_DyerHicks(PSIM(I),PSIH(I),ZOL(I),z_t(I),ZNTstoch(I),ZA(I)) + ENDIF + + PSIM10(I)=10./ZA(I)*PSIM(I) + PSIH10(I)=10./ZA(I)*PSIH(I) + PSIM2(I)=2./ZA(I)*PSIM(I) + PSIH2(I)=2./ZA(I)*PSIH(I) + + !---LIMIT PSIH AND PSIM IN THE CASE OF THIN LAYERS AND + !---HIGH ROUGHNESS. THIS PREVENTS DENOMINATOR IN FLUXES + !---FROM GETTING TOO SMALL + !PSIH(I)=MIN(PSIH(I),0.9*GZ1OZt(I)) !JOE: less restricitive over forest/urban. + PSIH(I)=MIN(PSIH(I),0.9*GZ1OZ0(I)) + PSIM(I)=MIN(PSIM(I),0.9*GZ1OZ0(I)) + !PSIH2(I)=MIN(PSIH2(I),0.9*GZ2OZt(I)) !JOE: less restricitive over forest/urban. + PSIH2(I)=MIN(PSIH2(I),0.9*GZ2OZ0(I)) + PSIM2(I)=MIN(PSIM2(I),0.9*GZ2OZ0(I)) + PSIM10(I)=MIN(PSIM10(I),0.9*GZ10OZ0(I)) + PSIH10(I)=MIN(PSIH10(I),0.9*GZ10OZ0(I)) + + RMOL(I) = ZOL(I)/ZA(I) + + ENDIF + + !------------------------------------------------------------ + !-----COMPUTE THE FRICTIONAL VELOCITY: + !------------------------------------------------------------ + ! ZA(1982) EQS(2.60),(2.61). + PSIX(I)=GZ1OZ0(I)-PSIM(I) + PSIX10(I)=GZ10OZ0(I)-PSIM10(I) + ! TO PREVENT OSCILLATIONS AVERAGE WITH OLD VALUE + OLDUST = UST(I) + UST(I)=0.5*UST(I)+0.5*KARMAN*WSPD(I)/PSIX(I) + !NON-AVERAGED: UST(I)=KARMAN*WSPD(I)/PSIX(I) + + ! Compute u* without vconv for use in HFX calc when isftcflx > 0 + WSPDI(I)=MAX(SQRT(U1D(I)*U1D(I)+V1D(I)*V1D(I)), wmin) + IF ( PRESENT(USTM) ) THEN + USTM(I)=0.5*USTM(I)+0.5*KARMAN*WSPDI(I)/PSIX(I) + ENDIF + + IF ((XLAND(I)-1.5).LT.0.) THEN !LAND + UST(I)=MAX(UST(I),0.005) !Further relaxing this limit - no need to go lower + !Keep ustm = ust over land. + IF ( PRESENT(USTM) ) USTM(I)=UST(I) + ENDIF + + !------------------------------------------------------------ + !-----COMPUTE THE THERMAL AND MOISTURE RESISTANCE (PSIQ AND PSIT): + !------------------------------------------------------------ + ! LOWER LIMIT ADDED TO PREVENT LARGE FLHC IN SOIL MODEL + ! ACTIVATES IN UNSTABLE CONDITIONS WITH THIN LAYERS OR HIGH Z0 + GZ1OZt(I)= LOG((ZA(I)+z_t(i))/z_t(i)) + GZ2OZt(I)= LOG((2.0+z_t(i))/z_t(i)) + + PSIT(I) =MAX(GZ1OZt(I)-PSIH(I) ,1.) + PSIT2(I)=MAX(GZ2OZt(I)-PSIH2(I),1.) + resist(I)=PSIT(I) + logres(I)=GZ1OZt(I) + + PSIQ=MAX(LOG((ZA(I)+z_q(i))/z_q(I))-PSIH(I) ,1.0) + PSIQ2=MAX(LOG((2.0+z_q(i))/z_q(I))-PSIH2(I) ,1.0) + + IF((XLAND(I)-1.5).LT.0)THEN !Land only + IF ( IZ0TLND .EQ. 4 ) THEN + CALL Pan_etal_1994(PSIQ,PSIQ2,UST(I),PSIH(I),PSIH2(I),& + & KARMAN,ZA(I)) + ENDIF + ENDIF + + !---------------------------------------------------- + !COMPUTE THE TEMPERATURE SCALE (or FRICTION TEMPERATURE, T*) + !---------------------------------------------------- + !DTG=TH1D(I)-THGB(I) !SWITCH TO THETA-V + DTG=THV1D(I)-THVGB(I) + OLDTST=MOL(I) + MOL(I)=KARMAN*DTG/PSIT(I)/PRT + !t_star(I) = -HFX(I)/(UST(I)*CPM(I)*RHO1D(I)) + !t_star(I) = MOL(I) + !---------------------------------------------------- + !COMPUTE THE MOISTURE SCALE (or q*) + DQG=(QVSH(i)-qsfc(i))*1000. !(kg/kg -> g/kg) + qstar(I)=KARMAN*DQG/PSIQ/PRT + + !CHECK FOR CONVERGENCE + IF (ITER .GE. 2) THEN + !IF (ABS(OLDUST-UST(I)) .lt. 0.01) THEN + IF (ABS(OLDTST-MOL(I)) .lt. 0.01) THEN + ITER = ITER+ITMAX + ENDIF + + !IF () THEN + ! print*,"ITER:",ITER + ! write(*,1001)"REGIME:",REGIME(I)," z/L:",ZOL(I)," U*:",UST(I)," Tstar:",MOL(I) + ! write(*,1002)"PSIM:",PSIM(I)," PSIH:",PSIH(I)," W*:",WSTAR(I)," DTHV:",THV1D(I)-THVGB(I) + ! write(*,1003)"CPM:",CPM(I)," RHO1D:",RHO1D(I)," L:",ZOL(I)/ZA(I)," DTH:",TH1D(I)-THGB(I) + ! write(*,1004)"Z0/Zt:",zratio(I)," Z0:",ZNTstoch(I)," Zt:",z_t(I)," za:",za(I) + ! write(*,1005)"Re:",restar," MAVAIL:",MAVAIL(I)," QSFC(I):",QSFC(I)," QVSH(I):",QVSH(I) + ! print*,"VISC=",VISC," Z0:",ZNTstoch(I)," T1D(i):",T1D(i) + ! write(*,*)"=============================================" + !ENDIF + ENDIF + + ITER = ITER + 1 + + ENDDO ! end ITERATION-loop + + ENDDO ! end i-loop + + 1000 format(A,F6.1, A,f6.1, A,f5.1, A,f7.1) + 1001 format(A,F2.0, A,f10.4,A,f5.3, A,f11.5) + 1002 format(A,f7.2, A,f7.2, A,f7.2, A,f10.3) + 1003 format(A,f7.2, A,f7.2, A,f10.3,A,f10.3) + 1004 format(A,f11.3,A,f9.7, A,f9.7, A,f6.2, A,f10.3) + 1005 format(A,f9.2,A,f6.4,A,f7.4,A,f7.4) + + !---------------------------------------------------------- + ! COMPUTE SURFACE HEAT AND MOISTURE FLUXES + !---------------------------------------------------------- + DO I=its,ite + + !For computing the diagnostics and fluxes (below), whether the fluxes + !are turned off or on, we need the following: + PSIX(I)=GZ1OZ0(I)-PSIM(I) + PSIX10(I)=GZ10OZ0(I)-PSIM10(I) + + PSIT(I) =MAX(GZ1OZt(I)-PSIH(I), 1.0) + PSIT2(I)=MAX(GZ2OZt(I)-PSIH2(I),1.0) + PSIT10=MAX(GZ10OZ0(I)-PSIH10(I), 1.0) + + PSIQ=MAX(LOG((ZA(I)+z_q(i))/z_q(I))-PSIH(I) ,1.0) + PSIQ2=MAX(LOG((2.0+z_q(i))/z_q(I))-PSIH2(I) ,1.0) + PSIQ10=MAX(GZ10OZ0(I)-PSIH10(I),1.0) + + IF (ISFFLX .LT. 1) THEN + + QFX(i) = 0. + HFX(i) = 0. + FLHC(I) = 0. + FLQC(I) = 0. + LH(I) = 0. + CHS(I) = 0. + CH(I) = 0. + CHS2(i) = 0. + CQS2(i) = 0. + IF(PRESENT(ck) .and. PRESENT(cd) .and. & + &PRESENT(cka) .and. PRESENT(cda)) THEN + Ck(I) = 0. + Cd(I) = 0. + Cka(I)= 0. + Cda(I)= 0. + ENDIF + ELSE + + IF((XLAND(I)-1.5).LT.0)THEN !LAND Only + IF ( IZ0TLND .EQ. 4 ) THEN + CALL Pan_etal_1994(PSIQ,PSIQ2,UST(I),PSIH(I),PSIH2(I),& + & KARMAN,ZA(I)) + ENDIF + ENDIF + + !------------------------------------------ + ! CALCULATE THE EXCHANGE COEFFICIENTS FOR HEAT (FLHC) + ! AND MOISTURE (FLQC) + !------------------------------------------ + FLQC(I)=RHO1D(I)*MAVAIL(I)*UST(I)*KARMAN/PSIQ + FLHC(I)=RHO1D(I)*CPM(I)*UST(I)*KARMAN/PSIT(I) + !OLD WAY: + !DTTHX=ABS(TH1D(I)-THGB(I)) + !IF(DTTHX.GT.1.E-5)THEN + ! FLHC(I)=CPM(I)*RHO1D(I)*UST(I)*MOL(I)/(TH1D(I)-THGB(I)) + !ELSE + ! FLHC(I)=0. + !ENDIF + + !---------------------------------- + ! COMPUTE SURFACE MOISTURE FLUX: + !---------------------------------- + QFX(I)=FLQC(I)*(QSFCMR(I)-QV1D(I)) + !JOE: QFX(I)=MAX(QFX(I),0.) !originally did not allow neg QFX + QFX(I)=MAX(QFX(I),-0.02) !allows small neg QFX, like MYJ + LH(I)=XLV*QFX(I) + + !---------------------------------- + ! COMPUTE SURFACE HEAT FLUX: + !---------------------------------- + IF(XLAND(I)-1.5.GT.0.)THEN !WATER + HFX(I)=FLHC(I)*(THGB(I)-TH1D(I)) + IF ( PRESENT(ISFTCFLX) ) THEN + IF ( ISFTCFLX.NE.0 ) THEN + ! AHW: add dissipative heating term + HFX(I)=HFX(I)+RHO1D(I)*USTM(I)*USTM(I)*WSPDI(I) + ENDIF + ENDIF + ELSEIF(XLAND(I)-1.5.LT.0.)THEN !LAND + HFX(I)=FLHC(I)*(THGB(I)-TH1D(I)) + HFX(I)=MAX(HFX(I),-250.) + ENDIF + + !CHS(I)=UST(I)*KARMAN/(ALOG(KARMAN*UST(I)*ZA(I) & + ! /XKA+ZA(I)/ZL)-PSIH(I)) + + CHS(I)=UST(I)*KARMAN/PSIT(I) + + ! The exchange coefficient for cloud water is assumed to be the + ! same as that for heat. CH is multiplied by WSPD. + + !ch(i)=chs(i) + ch(i)=flhc(i)/( cpm(i)*RHO1D(i) ) + + !THESE ARE USED FOR 2-M DIAGNOSTICS ONLY + CQS2(I)=UST(I)*KARMAN/PSIQ2 + CHS2(I)=UST(I)*KARMAN/PSIT2(I) + + IF(PRESENT(ck) .and. PRESENT(cd) .and. & + &PRESENT(cka) .and. PRESENT(cda)) THEN + Ck(I)=(karman/psix10(I))*(karman/psiq10) + Cd(I)=(karman/psix10(I))*(karman/psix10(I)) + Cka(I)=(karman/psix(I))*(karman/psiq) + Cda(I)=(karman/psix(I))*(karman/psix(I)) + ENDIF + + ENDIF !end ISFFLX option + + !----------------------------------------------------- + !COMPUTE DIAGNOSTICS + !----------------------------------------------------- + !COMPUTE 10 M WNDS + !----------------------------------------------------- + ! If the lowest model level is close to 10-m, use it + ! instead of the flux-based diagnostic formula. + if (ZA(i) .le. 7.0) then + ! high vertical resolution + if(ZA2(i) .gt. 7.0 .and. ZA2(i) .lt. 13.0) then + !use 2nd model level + U10(I)=U1D2(I) + V10(I)=V1D2(I) + else + U10(I)=U1D(I)*log(10./ZNTstoch(I))/log(ZA(I)/ZNTstoch(I)) + V10(I)=V1D(I)*log(10./ZNTstoch(I))/log(ZA(I)/ZNTstoch(I)) + endif + elseif(ZA(i) .gt. 7.0 .and. ZA(i) .lt. 13.0) then + !moderate vertical resolution + !U10(I)=U1D(I)*PSIX10(I)/PSIX(I) + !V10(I)=V1D(I)*PSIX10(I)/PSIX(I) + !use neutral-log: + U10(I)=U1D(I)*log(10./ZNTstoch(I))/log(ZA(I)/ZNTstoch(I)) + V10(I)=V1D(I)*log(10./ZNTstoch(I))/log(ZA(I)/ZNTstoch(I)) + else + ! very coarse vertical resolution + U10(I)=U1D(I)*PSIX10(I)/PSIX(I) + V10(I)=V1D(I)*PSIX10(I)/PSIX(I) + endif + + !----------------------------------------------------- + !COMPUTE 2m T, TH, AND Q + !THESE WILL BE OVERWRITTEN FOR LAND POINTS IN THE LSM + !----------------------------------------------------- + DTG=TH1D(I)-THGB(I) + TH2(I)=THGB(I)+DTG*PSIT2(I)/PSIT(I) + !*** BE CERTAIN THAT THE 2-M THETA IS BRACKETED BY + !*** THE VALUES AT THE SURFACE AND LOWEST MODEL LEVEL. + IF ((TH1D(I)>THGB(I) .AND. (TH2(I)TH1D(I))) .OR. & + (TH1D(I)THGB(I) .OR. TH2(I)QSFCMR(I) .AND. (Q2(I)QV1D(I))) .OR. & + (QV1D(I)QSFCMR(I) .OR. Q2(I) 1200. .OR. HFX(I) < -700.)THEN + print*,"SUSPICIOUS VALUES IN MYNN SFCLAYER",& + ITER-ITMAX," ITERATIONS",I,J, "HFX: ",HFX(I) + yesno = 1 + ENDIF + IF (LH(I) > 1200. .OR. LH(I) < -700.)THEN + print*,"SUSPICIOUS VALUES IN MYNN SFCLAYER",& + ITER-ITMAX," ITERATIONS",I,J, "LH: ",LH(I) + yesno = 1 + ENDIF + IF (UST(I) < 0.0 .OR. UST(I) > 4.0 )THEN + print*,"SUSPICIOUS VALUES IN MYNN SFCLAYER",& + ITER-ITMAX," ITERATIONS",I,J, "UST: ",UST(I) + yesno = 1 + ENDIF + IF (WSTAR(I)<0.0 .OR. WSTAR(I) > 6.0)THEN + print*,"SUSPICIOUS VALUES IN MYNN SFCLAYER",& + ITER-ITMAX," ITERATIONS",I,J, "WSTAR: ",WSTAR(I) + yesno = 1 + ENDIF + IF (RHO1D(I)<0.0 .OR. RHO1D(I) > 1.6 )THEN + print*,"SUSPICIOUS VALUES IN MYNN SFCLAYER",& + ITER-ITMAX," ITERATIONS",I,J, "rho: ",RHO1D(I) + yesno = 1 + ENDIF + IF (QSFC(I)*1000. <0.0 .OR. QSFC(I)*1000. >40.)THEN + print*,"SUSPICIOUS VALUES IN MYNN SFCLAYER",& + ITER-ITMAX," ITERATIONS",I,J, "QSFC: ",QSFC(I) + yesno = 1 + ENDIF + IF (PBLH(I)<0. .OR. PBLH(I)>6000.)THEN + print*,"SUSPICIOUS VALUES IN MYNN SFCLAYER",& + ITER-ITMAX," ITERATIONS",I,J, "PBLH: ",PBLH(I) + yesno = 1 + ENDIF + + IF (yesno == 1) THEN + print*," OTHER INFO:" + write(*,1001)"REGIME:",REGIME(I)," z/L:",ZOL(I)," U*:",UST(I),& + " Tstar:",MOL(I) + write(*,1002)"PSIM:",PSIM(I)," PSIH:",PSIH(I)," W*:",WSTAR(I),& + " DTHV:",THV1D(I)-THVGB(I) + write(*,1003)"CPM:",CPM(I)," RHO1D:",RHO1D(I)," L:",& + ZOL(I)/ZA(I)," DTH:",TH1D(I)-THGB(I) + write(*,1004)"Z0/Zt:",zratio(I)," Z0:",ZNTstoch(I)," Zt:",z_t(I),& + " za:",za(I) + write(*,1005)"Re:",restar," MAVAIL:",MAVAIL(I)," QSFC(I):",& + QSFC(I)," QVSH(I):",QVSH(I) + print*,"PSIX=",PSIX(I)," Z0:",ZNTstoch(I)," T1D(i):",T1D(i) + write(*,*)"=============================================" + ENDIF + ENDIF + + ENDDO !end i-loop + +END SUBROUTINE SFCLAY1D_mynn +!------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!> This subroutine returns the thermal and moisture roughness lengths +!! from Zilitinkevich (1995) and Zilitinkevich et al. (2001) over +!! land and water, respectively. +!! +!! MODS: +!! 20120705 : added IZ0TLND option. Note: This option was designed +!! to work with the Noah LSM and may be specific for that +!! LSM only. Tests with RUC LSM showed no improvements. + SUBROUTINE zilitinkevich_1995(Z_0,Zt,Zq,restar,ustar,KARMAN,& + & landsea,IZ0TLND2,spp_pbl,rstoch) + + IMPLICIT NONE + REAL, INTENT(IN) :: Z_0,restar,ustar,KARMAN,landsea + INTEGER, OPTIONAL, INTENT(IN):: IZ0TLND2 + REAL, INTENT(OUT) :: Zt,Zq + REAL :: CZIL !=0.100 in Chen et al. (1997) + !=0.075 in Zilitinkevich (1995) + !=0.500 in Lemone et al. (2008) + INTEGER, INTENT(IN) :: spp_pbl + REAL, INTENT(IN) :: rstoch + + + IF (landsea-1.5 .GT. 0) THEN !WATER + + !THIS IS BASED ON Zilitinkevich, Grachev, and Fairall (2001; + !Their equations 15 and 16). + IF (restar .LT. 0.1) THEN + Zt = Z_0*EXP(KARMAN*2.0) + Zt = MIN( Zt, 6.0e-5) + Zt = MAX( Zt, 2.0e-9) + Zq = Z_0*EXP(KARMAN*3.0) + Zq = MIN( Zq, 6.0e-5) + Zq = MAX( Zq, 2.0e-9) + ELSE + Zt = Z_0*EXP(-KARMAN*(4.0*SQRT(restar)-3.2)) + Zt = MIN( Zt, 6.0e-5) + Zt = MAX( Zt, 2.0e-9) + Zq = Z_0*EXP(-KARMAN*(4.0*SQRT(restar)-4.2)) + Zq = MIN( Zt, 6.0e-5) + Zq = MAX( Zt, 2.0e-9) + ENDIF + + ELSE !LAND + + !Option to modify CZIL according to Chen & Zhang, 2009 + IF ( IZ0TLND2 .EQ. 1 ) THEN + CZIL = 10.0 ** ( -0.40 * ( Z_0 / 0.07 ) ) + ELSE + CZIL = 0.075 !0.10 + END IF + + Zt = Z_0*EXP(-KARMAN*CZIL*SQRT(restar)) + Zt = MIN( Zt, Z_0/2.) + + Zq = Z_0*EXP(-KARMAN*CZIL*SQRT(restar)) + Zq = MIN( Zq, Z_0/2.) + +! perturb thermal and moisture roughness lenth by +/-50% +! uses same perturbation pattern for perturbing cloud fraction +! and turbulent mixing length (module_sf_mynn.F), but +! twice the amplitude; +! multiplication with -1.0 anticorrelates patterns + if (spp_pbl==1) then + Zt = Zt + Zt * 2.0 * rstoch + Zt = MAX(Zt, 0.001) + Zq = Zt + endif + + ENDIF + + return + + END SUBROUTINE zilitinkevich_1995 +!-------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!! This subroutine returns the resistance (PSIQ) for moisture +!! exchange. This is a modified form originating from Pan et al.. +!! (1994) but modified according to tests in both the RUC model. +!! and WRF-ARW. Note that it is very similar to Carlson and +!! Boland (1978) model (include below in comments) but has an +!! extra molecular layer (a third layer) instead of two layers. + SUBROUTINE Pan_etal_1994(PSIQ,PSIQ2,ustar,psih,psih2,KARMAN,Z1) + + IMPLICIT NONE + REAL, INTENT(IN) :: Z1,ustar,KARMAN,psih,psih2 + REAL, INTENT(OUT) :: psiq,psiq2 + REAL, PARAMETER :: Cpan=1.0 !was 20.8 in Pan et al 1994 + REAL, PARAMETER :: ZL=0.01 + REAL, PARAMETER :: ZMUs=0.2E-3 + REAL, PARAMETER :: XKA = 2.4E-5 + + !PAN et al. (1994): 3-layer model, as in paper: + !ZMU = Cpan*XKA/(KARMAN*UST(I)) + !PSIQ =MAX(KARMAN*ustar*ZMU/XKA + LOG((KARMAN*ustar*ZL + XKA)/XKA + & + ! & Z1/ZL) - PSIH,2.0) + !PSIQ2=MAX(KARMAN*ustar*ZMU/XKA + LOG((KARMAN*ustar*ZL + XKA)/XKA + & + ! & 2./ZL) - PSIH2,2.0) + !MODIFIED FORM: + PSIQ =MAX(KARMAN*ustar*ZMUs/XKA + LOG((KARMAN*ustar*Z1)/XKA + & + & Z1/ZL) - PSIH,2.0) + PSIQ2=MAX(KARMAN*ustar*ZMUs/XKA + LOG((KARMAN*ustar*2.0)/XKA + & + & 2./ZL) - PSIH2,2.0) + + !CARLSON AND BOLAND (1978): 2-layer model + !PSIQ =MAX(LOG(KARMAN*ustar*Z1/XKA + Z1/ZL)-PSIH ,2.0) + !PSIQ2=MAX(LOG(KARMAN*ustar*2./XKA + 2./ZL)-PSIH2 ,2.0) + + END SUBROUTINE Pan_etal_1994 +!-------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!! This formulation for roughness length was designed to match. +!! the labratory experiments of Donelan et al. (2004). +!! This is an update version from Davis et al. 2008, which +!! corrects a small-bias in Z_0 (AHW real-time 2012). + SUBROUTINE davis_etal_2008(Z_0,ustar) + + IMPLICIT NONE + REAL, INTENT(IN) :: ustar + REAL, INTENT(OUT) :: Z_0 + REAL :: ZW, ZN1, ZN2 + REAL, PARAMETER :: G=9.81, OZO=1.59E-5 + + !OLD FORM: Z_0 = 10.*EXP(-10./(ustar**(1./3.))) + !NEW FORM: + + ZW = MIN((ustar/1.06)**(0.3),1.0) + ZN1 = 0.011*ustar*ustar/G + OZO + ZN2 = 10.*exp(-9.5*ustar**(-.3333)) + & + 0.11*1.5E-5/AMAX1(ustar,0.01) + Z_0 = (1.0-ZW) * ZN1 + ZW * ZN2 + + Z_0 = MAX( Z_0, 1.27e-7) !These max/mins were suggested by + Z_0 = MIN( Z_0, 2.85e-3) !Davis et al. (2008) + + return + + END SUBROUTINE davis_etal_2008 +!-------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!>This formulation for roughness length was designed account for. +!!wave steepness. + SUBROUTINE Taylor_Yelland_2001(Z_0,ustar,wsp10) + + IMPLICIT NONE + REAL, INTENT(IN) :: ustar,wsp10 + REAL, INTENT(OUT) :: Z_0 + REAL, parameter :: g=9.81, pi=3.14159265 + REAL :: hs, Tp, Lp + + !hs is the significant wave height + hs = 0.0248*(wsp10**2.) + !Tp dominant wave period + Tp = 0.729*MAX(wsp10,0.1) + !Lp is the wavelength of the dominant wave + Lp = g*Tp**2/(2*pi) + + Z_0 = 1200.*hs*(hs/Lp)**4.5 + Z_0 = MAX( Z_0, 1.27e-7) !These max/mins were suggested by + Z_0 = MIN( Z_0, 2.85e-3) !Davis et al. (2008) + + return + + END SUBROUTINE Taylor_Yelland_2001 +!-------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!>This version of Charnock's relation employs a varying +!! Charnock parameter, similar to COARE3.0 [Fairall et al. (2003)]. +!! The Charnock parameter CZC is varied from .011 to .018. +!! between 10-m wsp = 10 and 18.. + SUBROUTINE charnock_1955(Z_0,ustar,wsp10,visc,zu) + + IMPLICIT NONE + REAL, INTENT(IN) :: ustar, visc, wsp10, zu + REAL, INTENT(OUT) :: Z_0 + REAL, PARAMETER :: G=9.81, CZO2=0.011 + REAL :: CZC !variable charnock "constant" + REAL :: wsp10m ! logarithmically calculated 10 m + + wsp10m = wsp10*log(10./1e-4)/log(zu/1e-4) + CZC = CZO2 + 0.007*MIN(MAX((wsp10m-10.)/8., 0.), 1.0) + + Z_0 = CZC*ustar*ustar/G + (0.11*visc/MAX(ustar,0.05)) + Z_0 = MAX( Z_0, 1.27e-7) !These max/mins were suggested by + Z_0 = MIN( Z_0, 2.85e-3) !Davis et al. (2008) + + return + + END SUBROUTINE charnock_1955 +!-------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!> This version of Charnock's relation employs a varying +!!Charnock parameter, taken from COARE 3.5 [Edson et al. (2001, JPO)]. +!!The Charnock parameter CZC is varied from about .005 to .028 +!!between 10-m wind speeds of 6 and 19 m/s. + SUBROUTINE edson_etal_2013(Z_0,ustar,wsp10,visc,zu) + + IMPLICIT NONE + REAL, INTENT(IN) :: ustar, visc, wsp10, zu + REAL, INTENT(OUT) :: Z_0 + REAL, PARAMETER :: G=9.81 + REAL, PARAMETER :: m=0.017, b=-0.005 + REAL :: CZC ! variable charnock "constant" + REAL :: wsp10m ! logarithmically calculated 10 m + + wsp10m = wsp10*log(10/1e-4)/log(zu/1e-4) + wsp10m = MIN(19., wsp10m) + CZC = m*wsp10m + b + CZC = MAX(CZC, 0.0) + + Z_0 = CZC*ustar*ustar/G + (0.11*visc/MAX(ustar,0.07)) + Z_0 = MAX( Z_0, 1.27e-7) !These max/mins were suggested by + Z_0 = MIN( Z_0, 2.85e-3) !Davis et al. (2008) + + return + + END SUBROUTINE edson_etal_2013 +!-------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!> This formulation for the thermal and moisture roughness lengths +!! (Zt and Zq) relates them to Z0 via the roughness Reynolds number (Ren). +!!This formula comes from Fairall et al. (2003). It is modified from +!!the original Garratt-Brutsaert model to better fit the COARE/HEXMAX +!!data. The formula for land uses a constant ratio (Z_0/7.4) taken +!!from Garratt (1992). + SUBROUTINE garratt_1992(Zt,Zq,Z_0,Ren,landsea) + + IMPLICIT NONE + REAL, INTENT(IN) :: Ren, Z_0,landsea + REAL, INTENT(OUT) :: Zt,Zq + REAL :: Rq + REAL, PARAMETER :: e=2.71828183 + + IF (landsea-1.5 .GT. 0) THEN !WATER + + Zt = Z_0*EXP(2.0 - (2.48*(Ren**0.25))) + Zq = Z_0*EXP(2.0 - (2.28*(Ren**0.25))) + + Zq = MIN( Zq, 5.5e-5) + Zq = MAX( Zq, 2.0e-9) + Zt = MIN( Zt, 5.5e-5) + Zt = MAX( Zt, 2.0e-9) !same lower limit as ECMWF + ELSE !LAND + Zq = Z_0/(e**2.) !taken from Garratt (1980,1992) + Zt = Zq + ENDIF + + return + + END SUBROUTINE garratt_1992 +!-------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!>This formulation for thermal and moisture roughness length (Zt and Zq) +!! as a function of the roughness Reynolds number (Ren) comes from the +!! COARE3.0 formulation, empirically derived from COARE and HEXMAX data +!! [Fairall et al. (2003)]. Edson et al. (2004; JGR) suspected that this +!!relationship overestimated the scalar roughness lengths for low Reynolds +!!number flows, so an optional smooth flow relationship, taken from Garratt +!!(1992, p. 102), is available for flows with Ren < 2. +!! +!!This is for use over water only. + SUBROUTINE fairall_etal_2003(Zt,Zq,Ren,ustar,visc) + + IMPLICIT NONE + REAL, INTENT(IN) :: Ren,ustar,visc + REAL, INTENT(OUT) :: Zt,Zq + + IF (Ren .le. 2.) then + + Zt = (5.5e-5)*(Ren**(-0.60)) + Zq = Zt + !FOR SMOOTH SEAS, CAN USE GARRATT + !Zq = 0.2*visc/MAX(ustar,0.1) + !Zq = 0.3*visc/MAX(ustar,0.1) + + ELSE + + !FOR ROUGH SEAS, USE COARE + Zt = (5.5e-5)*(Ren**(-0.60)) + Zq = Zt + + ENDIF + + Zt = MIN(Zt,1.0e-4) + Zt = MAX(Zt,2.0e-9) + + Zq = MIN(Zt,1.0e-4) + Zq = MAX(Zt,2.0e-9) + + return + + END SUBROUTINE fairall_etal_2003 +!-------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!> This formulation for thermal and moisture roughness length (Zt and Zq) +!! as a function of the roughness Reynolds number (Ren) comes from the +!! COARE 3.5/4.0 formulation, empirically derived from COARE and HEXMAX data +!! [Fairall et al. (2014? coming soon, not yet published as of July 2014)]. +!! This is for use over water only. + SUBROUTINE fairall_etal_2014(Zt,Zq,Ren,ustar,visc,rstoch,spp_pbl) + + IMPLICIT NONE + REAL, INTENT(IN) :: Ren,ustar,visc,rstoch + INTEGER, INTENT(IN):: spp_pbl + REAL, INTENT(OUT) :: Zt,Zq + + !Zt = (5.5e-5)*(Ren**(-0.60)) + Zt = MIN(1.6E-4, 5.8E-5/(Ren**0.72)) + Zq = Zt + + IF (spp_pbl ==1) THEN + Zt = MAX(Zt + Zt*2.0*rstoch,2.0e-9) + Zq = MAX(Zt + Zt*2.0*rstoch,2.0e-9) + ELSE + Zt = MAX(Zt,2.0e-9) + Zq = MAX(Zt,2.0e-9) + ENDIF + + return + + END SUBROUTINE fairall_etal_2014 +!-------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!> This is a modified version of Yang et al (2002 QJRMS, 2008 JAMC) +!! and Chen et al (2010, J of Hydromet). Although it was originally +!! designed for arid regions with bare soil, it is modified +!! here to perform over a broader spectrum of vegetation. +!! +!!The original formulation relates the thermal roughness length (Zt) +!!to u* and T*: +!! +!! Zt = ht * EXP(-beta*(ustar**0.5)*(ABS(tstar)**0.25)) +!! +!!where ht = Renc*visc/ustar and the critical Reynolds number +!!(Renc) = 70. Beta was originally = 10 (2002 paper) but was revised +!!to 7.2 (in 2008 paper). Their form typically varies the +!!ratio Z0/Zt by a few orders of magnitude (1-1E4). +!! +!!This modified form uses beta = 1.5 and a variable Renc (function of Z_0), +!!so zt generally varies similarly to the Zilitinkevich form (with Czil = 0.1) +!!for very small or negative surface heat fluxes but can become close to the +!!Zilitinkevich with Czil = 0.2 for very large HFX (large negative T*). +!!Also, the exponent (0.25) on tstar was changed to 1.0, since we found +!!Zt was reduced too much for low-moderate positive heat fluxes. +!! +!!This should only be used over land! + SUBROUTINE Yang_2008(Z_0,Zt,Zq,ustar,tstar,qst,Ren,visc,landsea) + + IMPLICIT NONE + REAL, INTENT(IN) :: Z_0, Ren, ustar, tstar, qst, visc, landsea + REAL :: ht, &! roughness height at critical Reynolds number + tstar2, &! bounded T*, forced to be non-positive + qstar2, &! bounded q*, forced to be non-positive + Z_02, &! bounded Z_0 for variable Renc2 calc + Renc2 ! variable Renc, function of Z_0 + REAL, INTENT(OUT) :: Zt,Zq + REAL, PARAMETER :: Renc=300., & !old constant Renc + beta=1.5, & !important for diurnal variation + m=170., & !slope for Renc2 function + b=691. !y-intercept for Renc2 function + + Z_02 = MIN(Z_0,0.5) + Z_02 = MAX(Z_02,0.04) + Renc2= b + m*log(Z_02) + ht = Renc2*visc/MAX(ustar,0.01) + tstar2 = MIN(tstar, 0.0) + qstar2 = MIN(qst,0.0) + + Zt = ht * EXP(-beta*(ustar**0.5)*(ABS(tstar2)**1.0)) + Zq = ht * EXP(-beta*(ustar**0.5)*(ABS(qstar2)**1.0)) + !Zq = Zt + + Zt = MIN(Zt, Z_0/2.0) + Zq = MIN(Zq, Z_0/2.0) + + return + + END SUBROUTINE Yang_2008 +!-------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!> This is taken from Andreas (2002; J. of Hydromet) and +!! Andreas et al. (2005; BLM). +!! +!! This should only be used over snow/ice! + SUBROUTINE Andreas_2002(Z_0,bvisc,ustar,Zt,Zq) + + IMPLICIT NONE + REAL, INTENT(IN) :: Z_0, bvisc, ustar + REAL, INTENT(OUT) :: Zt, Zq + REAL :: Ren2, zntsno + + REAL, PARAMETER :: bt0_s=1.25, bt0_t=0.149, bt0_r=0.317, & + bt1_s=0.0, bt1_t=-0.55, bt1_r=-0.565, & + bt2_s=0.0, bt2_t=0.0, bt2_r=-0.183 + + REAL, PARAMETER :: bq0_s=1.61, bq0_t=0.351, bq0_r=0.396, & + bq1_s=0.0, bq1_t=-0.628, bq1_r=-0.512, & + bq2_s=0.0, bq2_t=0.0, bq2_r=-0.180 + + !Calculate zo for snow (Andreas et al. 2005, BLM) + zntsno = 0.135*bvisc/ustar + & + (0.035*(ustar*ustar)/9.8) * & + (5.*exp(-1.*(((ustar - 0.18)/0.1)*((ustar - 0.18)/0.1))) + 1.) + Ren2 = ustar*zntsno/bvisc + + ! Make sure that Re is not outside of the range of validity + ! for using their equations + IF (Ren2 .gt. 1000.) Ren2 = 1000. + + IF (Ren2 .le. 0.135) then + + Zt = zntsno*EXP(bt0_s + bt1_s*LOG(Ren2) + bt2_s*LOG(Ren2)**2) + Zq = zntsno*EXP(bq0_s + bq1_s*LOG(Ren2) + bq2_s*LOG(Ren2)**2) + + ELSE IF (Ren2 .gt. 0.135 .AND. Ren2 .lt. 2.5) then + + Zt = zntsno*EXP(bt0_t + bt1_t*LOG(Ren2) + bt2_t*LOG(Ren2)**2) + Zq = zntsno*EXP(bq0_t + bq1_t*LOG(Ren2) + bq2_t*LOG(Ren2)**2) + + ELSE + + Zt = zntsno*EXP(bt0_r + bt1_r*LOG(Ren2) + bt2_r*LOG(Ren2)**2) + Zq = zntsno*EXP(bq0_r + bq1_r*LOG(Ren2) + bq2_r*LOG(Ren2)**2) + + ENDIF + + return + + END SUBROUTINE Andreas_2002 +!-------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!> This subroutine returns the stability functions based off +!! of Hogstrom (1996). + SUBROUTINE PSI_Hogstrom_1996(psi_m, psi_h, zL, Zt, Z_0, Za) + + IMPLICIT NONE + REAL, INTENT(IN) :: zL, Zt, Z_0, Za + REAL, INTENT(OUT) :: psi_m, psi_h + REAL :: x, x0, y, y0, zmL, zhL + + zmL = Z_0*zL/Za + zhL = Zt*zL/Za + + IF (zL .gt. 0.) THEN !STABLE (not well tested - seem large) + + psi_m = -5.3*(zL - zmL) + psi_h = -8.0*(zL - zhL) + + ELSE !UNSTABLE + + x = (1.-19.0*zL)**0.25 + x0= (1.-19.0*zmL)**0.25 + y = (1.-11.6*zL)**0.5 + y0= (1.-11.6*zhL)**0.5 + + psi_m = 2.*LOG((1.+x)/(1.+x0)) + & + &LOG((1.+x**2.)/(1.+x0**2.)) - & + &2.0*ATAN(x) + 2.0*ATAN(x0) + psi_h = 2.*LOG((1.+y)/(1.+y0)) + + ENDIF + + return + + END SUBROUTINE PSI_Hogstrom_1996 +!-------------------------------------------------------------------- +!> \ingroup module_sf_mynn_mod +!> This subroutine returns the stability functions based off +!! of Hogstrom (1996), but with different constants compatible +!! with Dyer and Hicks (1970/74?). This formulation is used for +!! testing/development by Nakanishi (personal communication). + SUBROUTINE PSI_DyerHicks(psi_m, psi_h, zL, Zt, Z_0, Za) + + IMPLICIT NONE + REAL, INTENT(IN) :: zL, Zt, Z_0, Za + REAL, INTENT(OUT) :: psi_m, psi_h + REAL :: x, x0, y, y0, zmL, zhL + + zmL = Z_0*zL/Za !Zo/L + zhL = Zt*zL/Za !Zt/L + + IF (zL .gt. 0.) THEN !STABLE + + psi_m = -5.0*(zL - zmL) + psi_h = -5.0*(zL - zhL) + + ELSE !UNSTABLE + + x = (1.-16.*zL)**0.25 + x0= (1.-16.*zmL)**0.25 + + y = (1.-16.*zL)**0.5 + y0= (1.-16.*zhL)**0.5 + + psi_m = 2.*LOG((1.+x)/(1.+x0)) + & + &LOG((1.+x**2.)/(1.+x0**2.)) - & + &2.0*ATAN(x) + 2.0*ATAN(x0) + psi_h = 2.*LOG((1.+y)/(1.+y0)) + + ENDIF + + return + + END SUBROUTINE PSI_DyerHicks +!-------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!> This subroutine returns the stability functions based off +!! of Beljaar and Holtslag 1991, which is an extension of Holtslag +!! and Debruin 1989. + SUBROUTINE PSI_Beljaars_Holtslag_1991(psi_m, psi_h, zL) + + IMPLICIT NONE + REAL, INTENT(IN) :: zL + REAL, INTENT(OUT) :: psi_m, psi_h + REAL, PARAMETER :: a=1., b=0.666, c=5., d=0.35 + + IF (zL .lt. 0.) THEN !UNSTABLE + + WRITE(*,*)"WARNING: Universal stability functions from" + WRITE(*,*)" Beljaars and Holtslag (1991) should only" + WRITE(*,*)" be used in the stable regime!" + psi_m = 0. + psi_h = 0. + + ELSE !STABLE + + psi_m = -(a*zL + b*(zL -(c/d))*exp(-d*zL) + (b*c/d)) + psi_h = -((1.+.666*a*zL)**1.5 + & + b*(zL - (c/d))*exp(-d*zL) + (b*c/d) -1.) + + ENDIF + + return + + END SUBROUTINE PSI_Beljaars_Holtslag_1991 +!-------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!> This subroutine returns the stability functions come from +!! Zilitinkevich and Esau (2007, BM), which are formulatioed from the +!! "generalized similarity theory" and tuned to the LES DATABASE64 +!! to determine their dependence on z/L. + SUBROUTINE PSI_Zilitinkevich_Esau_2007(psi_m, psi_h, zL) + + IMPLICIT NONE + REAL, INTENT(IN) :: zL + REAL, INTENT(OUT) :: psi_m, psi_h + REAL, PARAMETER :: Cm=3.0, Ct=2.5 + + IF (zL .lt. 0.) THEN !UNSTABLE + + WRITE(*,*)"WARNING: Universal stability function from" + WRITE(*,*)" Zilitinkevich and Esau (2007) should only" + WRITE(*,*)" be used in the stable regime!" + psi_m = 0. + psi_h = 0. + + ELSE !STABLE + + psi_m = -Cm*(zL**(5./6.)) + psi_h = -Ct*(zL**(4./5.)) + + ENDIF + + return + + END SUBROUTINE PSI_Zilitinkevich_Esau_2007 +!-------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!> This subroutine returns the flux-profile relationships +!! of Businger el al. 1971. + SUBROUTINE PSI_Businger_1971(psi_m, psi_h, zL) + + IMPLICIT NONE + REAL, INTENT(IN) :: zL + REAL, INTENT(OUT) :: psi_m, psi_h + REAL :: x, y + REAL, PARAMETER :: Pi180 = 3.14159265/180. + + IF (zL .lt. 0.) THEN !UNSTABLE + + x = (1. - 15.0*zL)**0.25 + y = (1. - 9.0*zL)**0.5 + + psi_m = LOG(((1.+x)/2.)**2.) + & + &LOG((1.+x**2.)/2.) - & + &2.0*ATAN(x) + Pi180*90. + psi_h = 2.*LOG((1.+y)/2.) + + ELSE !STABLE + + psi_m = -4.7*zL + psi_h = -(4.7/0.74)*zL + + ENDIF + + return + + END SUBROUTINE PSI_Businger_1971 +!-------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!> This subroutine returns flux-profile relatioships based off +!!of Lobocki (1993), which is derived from the MY-level 2 model. +!!Suselj and Sood (2010) applied the surface layer length scales +!!from Nakanishi (2001) to get this new relationship. These functions +!!are more agressive (larger magnitude) than most formulations. They +!!showed improvement over water, but untested over land. + SUBROUTINE PSI_Suselj_Sood_2010(psi_m, psi_h, zL) + + IMPLICIT NONE + REAL, INTENT(IN) :: zL + REAL, INTENT(OUT) :: psi_m, psi_h + REAL, PARAMETER :: Rfc=0.19, Ric=0.183, PHIT=0.8 + + IF (zL .gt. 0.) THEN !STABLE + + psi_m = -(zL/Rfc + 1.1223*EXP(1.-1.6666/zL)) + !psi_h = -zL*Ric/((Rfc**2.)*PHIT) + 8.209*(zL**1.1091) + !THEIR EQ FOR PSI_H CRASHES THE MODEL AND DOES NOT MATCH + !THEIR FIG 1. THIS EQ (BELOW) MATCHES THEIR FIG 1 BETTER: + psi_h = -(zL*Ric/((Rfc**2.)*5.) + 7.09*(zL**1.1091)) + + ELSE !UNSTABLE + + psi_m = 0.9904*LOG(1. - 14.264*zL) + psi_h = 1.0103*LOG(1. - 16.3066*zL) + + ENDIF + + return + + END SUBROUTINE PSI_Suselj_Sood_2010 +!-------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!>This subroutine returns a more robust z/L that best matches +!! the z/L from Hogstrom (1996) for unstable conditions and Beljaars +!! and Holtslag (1991) for stable conditions. + SUBROUTINE Li_etal_2010(zL, Rib, zaz0, z0zt) + + IMPLICIT NONE + REAL, INTENT(OUT) :: zL + REAL, INTENT(IN) :: Rib, zaz0, z0zt + REAL :: alfa, beta, zaz02, z0zt2 + REAL, PARAMETER :: au11=0.045, bu11=0.003, bu12=0.0059, & + &bu21=-0.0828, bu22=0.8845, bu31=0.1739, & + &bu32=-0.9213, bu33=-0.1057 + REAL, PARAMETER :: aw11=0.5738, aw12=-0.4399, aw21=-4.901,& + &aw22=52.50, bw11=-0.0539, bw12=1.540, & + &bw21=-0.669, bw22=-3.282 + REAL, PARAMETER :: as11=0.7529, as21=14.94, bs11=0.1569,& + &bs21=-0.3091, bs22=-1.303 + + !set limits according to Li et al (2010), p 157. + zaz02=zaz0 + IF (zaz0 .lt. 100.0) zaz02=100. + IF (zaz0 .gt. 100000.0) zaz02=100000. + + !set more limits according to Li et al (2010) + z0zt2=z0zt + IF (z0zt .lt. 0.5) z0zt2=0.5 + IF (z0zt .gt. 100.0) z0zt2=100. + + alfa = LOG(zaz02) + beta = LOG(z0zt2) + + IF (Rib .le. 0.0) THEN + zL = au11*alfa*Rib**2 + ( & + & (bu11*beta + bu12)*alfa**2 + & + & (bu21*beta + bu22)*alfa + & + & (bu31*beta**2 + bu32*beta + bu33))*Rib + !if(zL .LT. -15 .OR. zl .GT. 0.)print*,"VIOLATION Rib<0:",zL + zL = MAX(zL,-15.) !LIMITS SET ACCORDING TO Li et al (2010) + zL = MIN(zL,0.) !Figure 1. + ELSEIF (Rib .gt. 0.0 .AND. Rib .le. 0.2) THEN + zL = ((aw11*beta + aw12)*alfa + & + & (aw21*beta + aw22))*Rib**2 + & + & ((bw11*beta + bw12)*alfa + & + & (bw21*beta + bw22))*Rib + !if(zL .LT. 0 .OR. zl .GT. 4)print*,"VIOLATION 00.2:",zL + zL = MIN(zL,20.) !LIMITS ACCORDING TO Li et al (2010), THIER + !FIGUE 1C. + zL = MAX(zL,1.) + ENDIF + + return + + END SUBROUTINE Li_etal_2010 + +!------------------------------------------------------------------- +!>\ingroup module_sf_mynn_mod +!! This subroutine adds pbl modules so they can be optimized in pbl code + SUBROUTINE mym_condensation (kts,kte, & + & dx, dz, & + & thl, qw, & + & p,exner, & + & tsq, qsq, cov, & + & Sh, el, bl_mynn_cloudpdf,& + & qc_bl1D, cldfra_bl1D, & + & PBLH1,HFX1, & + & Vt, Vq, th, sgm) + +!------------------------------------------------------------------- + + INTEGER, INTENT(IN) :: kts,kte, bl_mynn_cloudpdf + REAL, INTENT(IN) :: dx,PBLH1,HFX1 + REAL, DIMENSION(kts:kte), INTENT(IN) :: dz + REAL, DIMENSION(kts:kte), INTENT(IN) :: p,exner, thl, qw, & + &tsq, qsq, cov, th + + REAL, DIMENSION(kts:kte), INTENT(INOUT) :: vt,vq,sgm + + REAL, DIMENSION(kts:kte) :: qmq,alp,a,bet,b,ql,q1,cld,RH + REAL, DIMENSION(kts:kte), INTENT(OUT) :: qc_bl1D,cldfra_bl1D + DOUBLE PRECISION :: t3sq, r3sq, c3sq + + REAL :: qsl,esat,qsat,tlk,qsat_tl,dqsl,cld0,q1k,eq1,qll,& + &q2p,pt,rac,qt,t,xl,rsl,cpm,cdhdz,Fng,qww,alpha,beta,bb,ls_min,ls,wt + INTEGER :: i,j,k + + REAL :: erf + + !JOE: NEW VARIABLES FOR ALTERNATE SIGMA + REAL::dth,dtl,dqw,dzk + REAL, DIMENSION(kts:kte), INTENT(IN) :: Sh,el + + !JOE: variables for BL clouds + REAL::zagl,cld9,damp,edown,RHcrit,RHmean,RHsum,RHnum,Hshcu,PBLH2,ql_limit + REAL, PARAMETER :: Hfac = 3.0 !cloud depth factor for HFX (m^3/W) + REAL, PARAMETER :: HFXmin = 50.0 !min W/m^2 for BL clouds + REAL :: RH_00L, RH_00O, phi_dz, lfac + REAL, PARAMETER :: cdz = 2.0 + REAL, PARAMETER :: mdz = 1.5 + + !JAYMES: variables for tropopause-height estimation + REAL :: theta1, theta2, ht1, ht2 + INTEGER :: k_tropo + + REAL, PARAMETER :: rr2=0.7071068, rrp=0.3989423 + + k_tropo=5 + + zagl = 0. + + SELECT CASE(bl_mynn_cloudpdf) + + CASE (0) ! ORIGINAL MYNN PARTIAL-CONDENSATION SCHEME + + DO k = kts,kte-1 + t = th(k)*exner(k) + + !SATURATED VAPOR PRESSURE + esat = esat_blend(t) + !SATURATED SPECIFIC HUMIDITY + qsl=ep_2*esat/(p(k)-ep_3*esat) + !dqw/dT: Clausius-Clapeyron + dqsl = qsl*ep_2*ev/( rd*t**2 ) + !RH (0 to 1.0) + RH(k)=MAX(MIN(1.0,qw(k)/MAX(1.E-8,qsl)),0.001) + + alp(k) = 1.0/( 1.0+dqsl*xlvcp ) + bet(k) = dqsl*exner(k) + + !NOTE: negative bl_mynn_cloudpdf will zero-out the stratus subgrid clouds + ! at the end of this subroutine. + !Sommeria and Deardorff (1977) scheme, as implemented + !in Nakanishi and Niino (2009), Appendix B + t3sq = MAX( tsq(k), 0.0 ) + r3sq = MAX( qsq(k), 0.0 ) + c3sq = cov(k) + c3sq = SIGN( MIN( ABS(c3sq), SQRT(t3sq*r3sq) ), c3sq ) + r3sq = r3sq +bet(k)**2*t3sq -2.0*bet(k)*c3sq + !DEFICIT/EXCESS WATER CONTENT + qmq(k) = qw(k) -qsl + !ORIGINAL STANDARD DEVIATION: limit e-6 produces ~10% more BL clouds + !than e-10 + sgm(k) = SQRT( MAX( r3sq, 1.0d-10 )) + !NORMALIZED DEPARTURE FROM SATURATION + q1(k) = qmq(k) / sgm(k) + !CLOUD FRACTION. rr2 = 1/SQRT(2) = 0.707 + cld(k) = 0.5*( 1.0+erf( q1(k)*rr2 ) ) + + END DO + + CASE (1, -1) !ALTERNATIVE FORM (Nakanishi & Niino 2004 BLM, eq. B6, and + !Kuwano-Yoshida et al. 2010 QJRMS, eq. 7): + DO k = kts,kte-1 + t = th(k)*exner(k) + !SATURATED VAPOR PRESSURE + esat = esat_blend(t) + !SATURATED SPECIFIC HUMIDITY + qsl=ep_2*esat/(p(k)-ep_3*esat) + !dqw/dT: Clausius-Clapeyron + dqsl = qsl*ep_2*ev/( rd*t**2 ) + !RH (0 to 1.0) + RH(k)=MAX(MIN(1.0,qw(k)/MAX(1.E-8,qsl)),0.001) + + alp(k) = 1.0/( 1.0+dqsl*xlvcp ) + bet(k) = dqsl*exner(k) + + if (k .eq. kts) then + dzk = 0.5*dz(k) + else + dzk = 0.5*( dz(k) + dz(k-1) ) + end if + dth = 0.5*(thl(k+1)+thl(k)) - 0.5*(thl(k)+thl(MAX(k-1,kts))) + dqw = 0.5*(qw(k+1) + qw(k)) - 0.5*(qw(k) + qw(MAX(k-1,kts))) + sgm(k) = SQRT( MAX( (alp(k)**2 * MAX(el(k)**2,0.1) * & + b2 * MAX(Sh(k),0.03))/4. * & + (dqw/dzk - bet(k)*(dth/dzk ))**2 , 1.0e-10) ) + qmq(k) = qw(k) -qsl + q1(k) = qmq(k) / sgm(k) + cld(k) = 0.5*( 1.0+erf( q1(k)*rr2 ) ) + END DO + + CASE (2, -2) + !Diagnostic statistical scheme of Chaboureau and Bechtold (2002), JAS + !JAYMES- this added 27 Apr 2015 + DO k = kts,kte-1 + t = th(k)*exner(k) + !SATURATED VAPOR PRESSURE + esat = esat_blend(t) + !SATURATED SPECIFIC HUMIDITY + qsl=ep_2*esat/(p(k)-ep_3*esat) + !dqw/dT: Clausius-Clapeyron + dqsl = qsl*ep_2*ev/( rd*t**2 ) + !RH (0 to 1.0) + RH(k)=MAX(MIN(1.0,qw(k)/MAX(1.E-8,qsl)),0.001) + + alp(k) = 1.0/( 1.0+dqsl*xlvcp ) + bet(k) = dqsl*exner(k) + + xl = xl_blend(t) ! obtain latent heat + + tlk = thl(k)*(p(k)/p1000mb)**rcp ! recover liquid temp (tl) from thl + qsat_tl = qsat_blend(tlk,p(k)) ! get saturation water vapor mixing ratio + ! at tl and p + + rsl = xl*qsat_tl / (r_v*tlk**2) ! slope of C-C curve at t = tl + ! CB02, Eqn. 4 + + cpm = cp + qw(k)*cpv ! CB02, sec. 2, para. 1 + + a(k) = 1./(1. + xl*rsl/cpm) ! CB02 variable "a" + + qmq(k) = a(k) * (qw(k) - qsat_tl) ! saturation deficit/excess; + ! the numerator of Q1 + + b(k) = a(k)*rsl ! CB02 variable "b" + + dtl = 0.5*(thl(k+1)*(p(k+1)/p1000mb)**rcp + tlk) & + & - 0.5*(tlk + thl(MAX(k-1,kts))*(p(MAX(k-1,kts))/p1000mb)**rcp) + + dqw = 0.5*(qw(k+1) + qw(k)) - 0.5*(qw(k) + qw(MAX(k-1,kts))) + + if (k .eq. kts) then + dzk = 0.5*dz(k) + else + dzk = 0.5*( dz(k) + dz(k-1) ) + end if + + cdhdz = dtl/dzk + (g/cpm)*(1.+qw(k)) ! expression below Eq. 9 + ! in CB02 + zagl = zagl + dz(k) + ls_min = MIN(MAX(zagl,25.),300.) ! Let this be the minimum possible length scale: + ! 25 m < ls_min(=zagl) < 300 m + lfac=MIN(4.25+dx/4000.,6.) ! A dx-dependent multiplier for the master length scale: + ! lfac(750 m) = 4.4 + ! lfac(3 km) = 5.0 + ! lfac(13 km) = 6.0 + + ls = MAX(MIN(lfac*el(k),900.),ls_min) ! Bounded: ls_min < ls < 900 m + ! Note: CB02 use 900 m as a constant free-atmosphere length scale. + ! Above 300 m AGL, ls_min remains 300 m. For dx = 3 km, the + ! MYNN master length scale (el) must exceed 60 m before ls + ! becomes responsive to el, otherwise ls = ls_min = 300 m. + + sgm(k) = MAX(1.e-10, 0.225*ls*SQRT(MAX(0., & ! Eq. 9 in CB02: + & (a(k)*dqw/dzk)**2 & ! < 1st term in brackets, + & -2*a(k)*b(k)*cdhdz*dqw/dzk & ! < 2nd term, + & +b(k)**2 * cdhdz**2))) ! < 3rd term + ! CB02 use a multiplier of 0.2, but 0.225 is chosen + ! based on tests + + q1(k) = qmq(k) / sgm(k) ! Q1, the normalized saturation + + cld(k) = MAX(0., MIN(1., 0.5+0.36*ATAN(1.55*q1(k)))) ! Eq. 7 in CB02 + + END DO + END SELECT + + zagl = 0. + RHsum=0. + RHnum=0. + RHmean=0.1 !initialize with small value for small PBLH cases + damp =0 + PBLH2=MAX(10.,PBLH1) + + SELECT CASE(bl_mynn_cloudpdf) + + CASE (-1 : 1) ! ORIGINAL MYNN PARTIAL-CONDENSATION SCHEME + ! OR KUWANO ET AL. + DO k = kts,kte-1 + t = th(k)*exner(k) + q1k = q1(k) + zagl = zagl + dz(k) + !q1=0. + !cld(k)=0. + + !COMPUTE MEAN RH IN PBL (NOT PRESSURE WEIGHTED). + IF (zagl < PBLH2 .AND. PBLH2 > 400.) THEN + RHsum=RHsum+RH(k) + RHnum=RHnum+1.0 + RHmean=RHsum/RHnum + ENDIF + RHcrit = 1. - 0.35*(1.0 - (MAX(250.- MAX(HFX1,HFXmin),0.0)/200.)**2) + if (HFX1 > HFXmin) then + cld9=MIN(MAX(0., (rh(k)-RHcrit)/(1.1-RHcrit)), 1.)**2 + else + cld9=0.0 + endif + + edown=PBLH2*.1 + !Vary BL cloud depth (Hshcu) by mean RH in PBL and HFX + !(somewhat following results from Zhang and Klein (2013, JAS)) + Hshcu=200. + (RHmean+0.5)**1.5*MAX(HFX1,0.)*Hfac + if (zagl < PBLH2-edown) then + damp=MIN(1.0,exp(-ABS(((PBLH2-edown)-zagl)/edown))) + elseif(zagl >= PBLH2-edown .AND. zagl < PBLH2+Hshcu)then + damp=1. + elseif (zagl >= PBLH2+Hshcu)then + damp=MIN(1.0,exp(-ABS((zagl-(PBLH2+Hshcu))/500.))) + endif + cldfra_bl1D(k)=cld9*damp + !cldfra_bl1D(k)=cld(k) ! JAYMES: use this form to retain the Sommeria-Deardorff value + + !use alternate cloud fraction to estimate qc for use in BL clouds-radiation + eq1 = rrp*EXP( -0.5*q1k*q1k ) + qll = MAX( cldfra_bl1D(k)*q1k + eq1, 0.0 ) + !ESTIMATED LIQUID WATER CONTENT (UNNORMALIZED) + ql (k) = alp(k)*sgm(k)*qll + if(cldfra_bl1D(k)>0.01 .and. ql(k)<1.E-6)ql(k)=1.E-6 + qc_bl1D(k)=ql(k)*damp + !now recompute estimated lwc for PBL scheme's use + !qll IS THE NORMALIZED LIQUID WATER CONTENT (Sommeria and + !Deardorff (1977, eq 29a). rrp = 1/(sqrt(2*pi)) = 0.3989 + eq1 = rrp*EXP( -0.5*q1k*q1k ) + qll = MAX( cld(k)*q1k + eq1, 0.0 ) + !ESTIMATED LIQUID WATER CONTENT (UNNORMALIZED) + ql (k) = alp(k)*sgm(k)*qll + + q2p = xlvcp/exner(k) + pt = thl(k) +q2p*ql(k) ! potential temp + + !qt is a THETA-V CONVERSION FOR TOTAL WATER (i.e., THETA-V = qt*THETA) + qt = 1.0 +p608*qw(k) -(1.+p608)*ql(k) + rac = alp(k)*( cld(k)-qll*eq1 )*( q2p*qt-(1.+p608)*pt ) + + !BUOYANCY FACTORS: wherever vt and vq are used, there is a + !"+1" and "+tv0", respectively, so these are subtracted out here. + !vt is unitless and vq has units of K. + vt(k) = qt-1.0 -rac*bet(k) + vq(k) = p608*pt-tv0 +rac + + !To avoid FPE in radiation driver, when these two quantities are multiplied by eachother, + ! add limit to qc_bl and cldfra_bl: + IF (QC_BL1D(k) < 1E-6 .AND. ABS(CLDFRA_BL1D(k)) > 0.01) QC_BL1D(k)= 1E-6 + IF (CLDFRA_BL1D(k) < 1E-2)THEN + CLDFRA_BL1D(k)=0. + QC_BL1D(k)=0. + ENDIF + + END DO + CASE ( 2, -2) + ! JAYMES- this option added 8 May 2015 + ! The cloud water formulations are taken from CB02, Eq. 8. + ! "fng" represents the non-Gaussian contribution to the liquid + ! water flux; these formulations are from Cuijpers and Bechtold + ! (1995), Eq. 7. CB95 also draws from Bechtold et al. 1995, + ! hereafter BCMT95 + DO k = kts,kte-1 + t = th(k)*exner(k) + q1k = q1(k) + zagl = zagl + dz(k) + IF (q1k < 0.) THEN + ql (k) = sgm(k)*EXP(1.2*q1k-1) + ELSE IF (q1k > 2.) THEN + ql (k) = sgm(k)*q1k + ELSE + ql (k) = sgm(k)*(EXP(-1.) + 0.66*q1k + 0.086*q1k**2) + ENDIF + + !Next, adjust our initial estimates of cldfra and ql based + !on tropopause-height and PBLH considerations + !JAYMES: added 4 Nov 2016 + if ((cld(k) .gt. 0.) .or. (ql(k) .gt. 0.)) then + if (k .le. k_tropo) then + !At and below tropopause: impose an upper limit on ql; assume that + !a maximum of 0.5 percent supersaturation in water vapor can be + !available for cloud production + ql_limit = 0.005 * qsat_blend( th(k)*exner(k), p(k) ) + ql(k) = MIN( ql(k), ql_limit ) + else + !Above tropopause: eliminate subgrid clouds from CB scheme + cld(k) = 0. + ql(k) = 0. + endif + endif + + !Buoyancy-flux-related calculations follow... + ! "Fng" represents the non-Gaussian transport factor + ! (non-dimensional) from from Bechtold et al. 1995 + ! (hereafter BCMT95), section 3(c). Their suggested + ! forms for Fng (from their Eq. 20) are: + ! For purposes of the buoyancy flux in stratus, we will use Fng = 1 + Fng = 1. + + xl = xl_blend(t) + bb = b(k)*t/th(k) ! bb is "b" in BCMT95. Their "b" differs from + ! "b" in CB02 (i.e., b(k) above) by a factor + ! of T/theta. Strictly, b(k) above is formulated in + ! terms of sat. mixing ratio, but bb in BCMT95 is + ! cast in terms of sat. specific humidity. The + ! conversion is neglected here. + qww = 1.+0.61*qw(k) + alpha = 0.61*th(k) + beta = (th(k)/t)*(xl/cp) - 1.61*th(k) + + vt(k) = qww - cld(k)*beta*bb*Fng - 1. + vq(k) = alpha + cld(k)*beta*a(k)*Fng - tv0 + ! vt and vq correspond to beta-theta and beta-q, respectively, + ! in NN09, Eq. B8. They also correspond to the bracketed + ! expressions in BCMT95, Eq. 15, since (s*ql/sigma^2) = cldfra*Fng + ! The "-1" and "-tv0" terms are included for consistency with + ! the legacy vt and vq formulations (above). + + ! increase the cloud fraction estimate below PBLH+1km + if (zagl .lt. PBLH2+1000.) cld(k) = MIN( 1., 1.8*cld(k) ) + ! return a cloud condensate and cloud fraction for icloud_bl option: + cldfra_bl1D(k) = cld(k) + qc_bl1D(k) = ql(k) + + !To avoid FPE in radiation driver, when these two quantities are multiplied by eachother, + ! add limit to qc_bl and cldfra_bl: + IF (QC_BL1D(k) < 1E-6 .AND. ABS(CLDFRA_BL1D(k)) > 0.01) QC_BL1D(k)= 1E-6 + IF (CLDFRA_BL1D(k) < 1E-2)THEN + CLDFRA_BL1D(k)=0. + QC_BL1D(k)=0. + ENDIF + + END DO + + END SELECT !end cloudPDF option + + !FOR TESTING PURPOSES ONLY, ISOLATE ON THE MASS-CLOUDS. + IF (bl_mynn_cloudpdf .LT. 0) THEN + DO k = kts,kte-1 + cldfra_bl1D(k) = 0.0 + qc_bl1D(k) = 0.0 + END DO + ENDIF + + cld(kte) = cld(kte-1) + ql(kte) = ql(kte-1) + vt(kte) = vt(kte-1) + vq(kte) = vq(kte-1) + qc_bl1D(kte)=0. + cldfra_bl1D(kte)=0. + + RETURN + + END SUBROUTINE mym_condensation + +! ================================================================== + + +END MODULE module_sf_mynn + diff --git a/physics/sfcsub.F b/physics/sfcsub.F new file mode 100644 index 000000000..7c78707f5 --- /dev/null +++ b/physics/sfcsub.F @@ -0,0 +1,8745 @@ +!>\file sfcsub.F +!! This file contains gribcode for each parameter. + + +!>\defgroup mod_sfcsub_mod GFS sfcsub Module +!!\ingroup Noah_LSM +!> @{ +!>\ingroup mod_sfcsub +!! This module contains grib code for each parameter-used in subroutines sfccycle() +!! and setrmsk(). + module sfccyc_module + implicit none + save +! +! grib code for each parameter - used in subroutines sfccycle and setrmsk. +! + integer kpdtsf,kpdwet,kpdsno,kpdzor,kpdais,kpdtg3,kpdplr,kpdgla, + & kpdmxi,kpdscv,kpdsmc,kpdoro,kpdmsk,kpdstc,kpdacn,kpdveg, + & kpdvet,kpdsot + &, kpdvmn,kpdvmx,kpdslp,kpdabs + &, kpdsnd, kpdabs_0, kpdabs_1, kpdalb(4) + parameter(kpdtsf=11, kpdwet=86, kpdsno=65, kpdzor=83, +! 1 kpdalb=84, kpdais=91, kpdtg3=11, kpdplr=224, + 1 kpdais=91, kpdtg3=11, kpdplr=224, + 2 kpdgla=238, kpdmxi=91, kpdscv=238, kpdsmc=144, + 3 kpdoro=8, kpdmsk=81, kpdstc=11, kpdacn=91, kpdveg=87, +!cbosu max snow albedo uses a grib id number of 159, not 255. + & kpdvmn=255, kpdvmx=255,kpdslp=236, kpdabs_0=255, + & kpdvet=225, kpdsot=224,kpdabs_1=159, + & kpdsnd=66 ) +! + integer, parameter :: kpdalb_0(4)=(/212,215,213,216/) + integer, parameter :: kpdalb_1(4)=(/189,190,191,192/) + integer, parameter :: kpdalf(2)=(/214,217/) +! + integer, parameter :: xdata=5000, ydata=2500, mdata=xdata*ydata + integer :: veg_type_landice + integer :: soil_type_landice +! + end module sfccyc_module + +!>\ingroup mod_sfcsub + subroutine sfccycle(lugb,len,lsoil,sig1t,deltsfc + &, iy,im,id,ih,fh + &, rla, rlo, slmask,orog,orog_uf,use_ufo,nst_anl + &, sihfcs,sicfcs,sitfcs + &, swdfcs,slcfcs + &, vmnfcs,vmxfcs,slpfcs,absfcs + &, tsffcs,snofcs,zorfcs,albfcs,tg3fcs + &, cnpfcs,smcfcs,stcfcs,slifcs,aisfcs + &, vegfcs,vetfcs,sotfcs,alffcs + &, cvfcs,cvbfcs,cvtfcs,me,nlunit + &, sz_nml,input_nml_file + &, ialb,isot,ivegsrc,tile_num_ch,i_index,j_index) +! + use machine , only : kind_io8,kind_io4 + use sfccyc_module + implicit none + character(len=*), intent(in) :: tile_num_ch + integer,intent(in) :: i_index(len), j_index(len) + logical use_ufo, nst_anl + real (kind=kind_io8) sllnd,slsea,aicice,aicsea,tgice,rlapse, + & orolmx,orolmn,oroomx,oroomn,orosmx, + & orosmn,oroimx,oroimn,orojmx,orojmn, + & alblmx,alblmn,albomx,albomn,albsmx, + & albsmn,albimx,albimn,albjmx,albjmn, + & wetlmx,wetlmn,wetomx,wetomn,wetsmx, + & wetsmn,wetimx,wetimn,wetjmx,wetjmn, + & snolmx,snolmn,snoomx,snoomn,snosmx, + & snosmn,snoimx,snoimn,snojmx,snojmn, + & zorlmx,zorlmn,zoromx,zoromn,zorsmx, + & zorsmn,zorimx,zorimn,zorjmx, zorjmn, + & plrlmx,plrlmn,plromx,plromn,plrsmx, + & plrsmn,plrimx,plrimn,plrjmx,plrjmn, + & tsflmx,tsflmn,tsfomx,tsfomn,tsfsmx, + & tsfsmn,tsfimx,tsfimn,tsfjmx,tsfjmn, + & tg3lmx,tg3lmn,tg3omx,tg3omn,tg3smx, + & tg3smn,tg3imx,tg3imn,tg3jmx,tg3jmn, + & stclmx,stclmn,stcomx,stcomn,stcsmx, + & stcsmn,stcimx,stcimn,stcjmx,stcjmn, + & smclmx,smclmn,smcomx,smcomn,smcsmx, + & smcsmn,smcimx,smcimn,smcjmx,smcjmn, + & scvlmx,scvlmn,scvomx,scvomn,scvsmx, + & scvsmn,scvimx,scvimn,scvjmx,scvjmn, + & veglmx,veglmn,vegomx,vegomn,vegsmx, + & vegsmn,vegimx,vegimn,vegjmx,vegjmn, + & vetlmx,vetlmn,vetomx,vetomn,vetsmx, + & vetsmn,vetimx,vetimn,vetjmx,vetjmn, + & sotlmx,sotlmn,sotomx,sotomn,sotsmx, + & sotsmn,sotimx,sotimn,sotjmx,sotjmn, + & alslmx,alslmn,alsomx,alsomn,alssmx, + & alssmn,alsimx,alsimn,alsjmx,alsjmn, + & epstsf,epsalb,epssno,epswet,epszor, + & epsplr,epsoro,epssmc,epsscv,eptsfc, + & epstg3,epsais,epsacn,epsveg,epsvet, + & epssot,epsalf,qctsfs,qcsnos,qctsfi, + & aislim,snwmin,snwmax,cplrl,cplrs, + & cvegl,czors,csnol,csnos,czorl,csots, + & csotl,cvwgs,cvetl,cvets,calfs, + & fcalfl,fcalfs,ccvt,ccnp,ccv,ccvb, + & calbl,calfl,calbs,ctsfs,grboro, + & grbmsk,ctsfl,deltf,caisl,caiss, + & fsalfl,fsalfs,flalfs,falbl,ftsfl, + & ftsfs,fzorl,fzors,fplrl,fsnos,faisl, + & faiss,fsnol,bltmsk,falbs,cvegs,percrit, + & deltsfc,critp2,critp3,blnmsk,critp1, + & fcplrl,fcplrs,fczors,fvets,fsotl,fsots, + & fvetl,fplrs,fvegl,fvegs,fcsnol,fcsnos, + & fczorl,fcalbs,fctsfl,fctsfs,fcalbl, + & falfs,falfl,fh,crit,zsca,ztsfc,tem1,tem2 + &, fsihl,fsihs,fsicl,fsics, + & csihl,csihs,csicl,csics,epssih,epssic + &, fvmnl,fvmns,fvmxl,fvmxs,fslpl,fslps, + & fabsl,fabss,cvmnl,cvmns,cvmxl,cvmxs, + & cslpl,cslps,cabsl,cabss,epsvmn,epsvmx, + & epsslp,epsabs + &, sihlmx,sihlmn,sihomx,sihomn,sihsmx, + & sihsmn,sihimx,sihimn,sihjmx,sihjmn, + & siclmx,siclmn,sicomx,sicomn,sicsmx, + & sicsmn,sicimx,sicimn,sicjmx,sicjmn + &, glacir_hice + &, vmnlmx,vmnlmn,vmnomx,vmnomn,vmnsmx, + & vmnsmn,vmnimx,vmnimn,vmnjmx,vmnjmn, + & vmxlmx,vmxlmn,vmxomx,vmxomn,vmxsmx, + & vmxsmn,vmximx,vmximn,vmxjmx,vmxjmn, + & slplmx,slplmn,slpomx,slpomn,slpsmx, + & slpsmn,slpimx,slpimn,slpjmx,slpjmn, + & abslmx,abslmn,absomx,absomn,abssmx, + & abssmn,absimx,absimn,absjmx,absjmn + &, sihnew + + integer imsk,jmsk,ifp,irtscv,irtacn,irtais,irtsno,irtzor, + & irtalb,irtsot,irtalf,j,irtvet,irtsmc,irtstc,irtveg, + & irtwet,k,iprnt,kk,irttsf,iret,i,igrdbg,iy,im,id, + & icalbl,icalbs,icalfl,ictsfs,lugb,len,lsoil,ih, + & ictsfl,iczors,icplrl,icplrs,iczorl,icalfs,icsnol, + & icsnos,irttg3,me,kqcm,nlunit,sz_nml,ialb + &, irtvmn, irtvmx, irtslp, irtabs, isot, ivegsrc + logical gausm, deads, qcmsk, znlst, monclm, monanl, + & monfcs, monmer, mondif, landice + character(len=*), intent(in) :: input_nml_file(sz_nml) + + integer num_parthds +! +!> this is a limited point version of surface program. +!! +!! this program runs in two different modes: +!! +!! 1. analysis mode (fh=0.) +!! +!! this program merges climatology, analysis and forecast guess to create +!! new surface fields. if analysis file is given, the program +!! uses it if date of the analysis matches with iy,im,id,ih (see note +!! below). +!! +!! 2. forecast mode (fh.gt.0.) +!! +!! this program interpolates climatology to the date corresponding to the +!! forecast hour. if surface analysis file is given, for the corresponding +!! dates, the program will use it. +!! +!! note: +!! +!! if the date of the analysis does not match given iy,im,id,ih, (and fh), +!! the program searches an old analysis by going back 6 hours, then 12 hours, +!! then one day upto nrepmx days (parameter statement in the subrotine fixrd. +!! now defined as 8). this allows the user to provide non-daily analysis to +!! be used. if matching field is not found, the forecast guess will be used. +!! +!! use of a combined earlier surface analyses and current analysis is +!! not allowed (as was done in the old version for snow analysis in which +!! old snow analysis is used in combination with initial guess), except +!! for sea surface temperature. for sst anolmaly interpolation, you need to +!! set lanom=.true. and must provide sst analysis at initial time. +!! +!! if you want to do complex merging of past and present surface field analysis, +!! you need to create a separate file that contains daily surface field. +!! +!! for a dead start, do not supply fnbgsi or set fnbgsi=' ' +! +! lugb is the unit number used in this subprogram +! len ... number of points on which sfccyc operates +! lsoil .. number of soil layers (2 as of april, 1994) +! iy,im,id,ih .. year, month, day, and hour of initial state. +! fh .. forecast hour +! rla, rlo -- latitude and longitudes of the len points +! sig1t .. sigma level 1 temperature for dead start. should be on gaussian +! grid. if not dead start, no need for dimension but set to zero +! as in the example below. +! +! variable naming conventions: +! +! oro .. orography +! alb .. albedo +! wet .. soil wetness as defined for bucket model +! sno .. snow depth +! zor .. surface roughness length +! vet .. vegetation type +! plr .. plant evaporation resistance +! tsf .. surface skin temperature. sea surface temp. over ocean. +! tg3 .. deep soil temperature (at 500cm) +! stc .. soil temperature (lsoil layrs) +! smc .. soil moisture (lsoil layrs) +! scv .. snow cover (not snow depth) +! ais .. sea ice mask (0 or 1) +! acn .. sea ice concentration (fraction) +! gla .. glacier (permanent snow) mask (0 or 1) +! mxi .. maximum sea ice extent (0 or 1) +! msk .. land ocean mask (0=ocean 1=land) +! cnp .. canopy water content +! cv .. convective cloud cover +! cvb .. convective cloud base +! cvt .. convective cloud top +! sli .. land/sea/sea-ice mask. (1/0/2 respectively) +! veg .. vegetation cover +! sot .. soil type +!cwu [+2l] add sih & sic +! sih .. sea ice thickness +! sic .. sea ice concentration +!clu [+6l] add swd,slc,vmn,vmx,slp,abs +! swd .. actual snow depth +! slc .. liquid soil moisture (lsoil layers) +! vmn .. vegetation cover minimum +! vmx .. vegetation cover maximum +! slp .. slope type +! abs .. maximum snow albedo + +! +! definition of land/sea mask. sllnd for land and slsea for sea. +! definition of sea/ice mask. aicice for ice, aicsea for sea. +! tgice=max ice temperature +! rlapse=lapse rate for sst correction due to surface angulation +! + parameter(sllnd =1.0,slsea =0.0) + parameter(aicice=1.0,aicsea=0.0) + parameter(tgice=271.2) + parameter(rlapse=0.65e-2) +! +! max/min of fields for check and replace. +! +! ???lmx .. max over bare land +! ???lmn .. min over bare land +! ???omx .. max over open ocean +! ???omn .. min over open ocean +! ???smx .. max over snow surface (land and sea-ice) +! ???smn .. min over snow surface (land and sea-ice) +! ???imx .. max over bare sea ice +! ???imn .. min over bare sea ice +! ???jmx .. max over snow covered sea ice +! ???jmn .. min over snow covered sea ice +! + parameter(orolmx=8000.,orolmn=-1000.,oroomx=3000.,oroomn=-1000., + & orosmx=8000.,orosmn=-1000.,oroimx=3000.,oroimn=-1000., + & orojmx=3000.,orojmn=-1000.) +! parameter(alblmx=0.80,alblmn=0.06,albomx=0.06,albomn=0.06, +! & albsmx=0.80,albsmn=0.06,albimx=0.80,albimn=0.80, +! & albjmx=0.80,albjmn=0.80) +!cwu [-3l/+9l] change min/max for alb; add min/max for sih & sic +! parameter(alblmx=0.80,alblmn=0.01,albomx=0.01,albomn=0.01, +! & albsmx=0.80,albsmn=0.01,albimx=0.01,albimn=0.01, +! & albjmx=0.01,albjmn=0.01) +! note: the range values for bare land and snow covered land +! (alblmx, alblmn, albsmx, albsmn) are set below +! based on whether the old or new radiation is selected + parameter(albomx=0.06,albomn=0.06, + & albimx=0.80,albimn=0.06, + & albjmx=0.80,albjmn=0.06) + parameter(sihlmx=0.0,sihlmn=0.0,sihomx=5.0,sihomn=0.0, + & sihsmx=5.0,sihsmn=0.0,sihimx=5.0,sihimn=0.10, + & sihjmx=5.0,sihjmn=0.10,glacir_hice=3.0) +!cwu change sicimn & sicjmn Jan 2015 +! parameter(siclmx=0.0,siclmn=0.0,sicomx=1.0,sicomn=0.0, +! & sicsmx=1.0,sicsmn=0.0,sicimx=1.0,sicimn=0.50, +! & sicjmx=1.0,sicjmn=0.50) +! +! parameter(sihlmx=0.0,sihlmn=0.0,sihomx=8.0,sihomn=0.0, +! & sihsmx=8.0,sihsmn=0.0,sihimx=8.0,sihimn=0.10, +! & sihjmx=8.0,sihjmn=0.10,glacir_hice=3.0) + parameter(siclmx=0.0,siclmn=0.0,sicomx=1.0,sicomn=0.0, + & sicsmx=1.0,sicsmn=0.0,sicimx=1.0,sicimn=0.15, + & sicjmx=1.0,sicjmn=0.15) + + parameter(wetlmx=0.15,wetlmn=0.00,wetomx=0.15,wetomn=0.15, + & wetsmx=0.15,wetsmn=0.15,wetimx=0.15,wetimn=0.15, + & wetjmx=0.15,wetjmn=0.15) + parameter(snolmx=0.0,snolmn=0.0,snoomx=0.0,snoomn=0.0, + & snosmx=55000.,snosmn=0.001,snoimx=0.,snoimn=0.0, + & snojmx=10000.,snojmn=0.01) + parameter(zorlmx=300.,zorlmn=1.0,zoromx=1.0,zoromn=1.e-05, + & zorsmx=300.,zorsmn=1.0,zorimx=1.0,zorimn=1.0, + & zorjmx=1.0,zorjmn=1.0) + parameter(plrlmx=1000.,plrlmn=0.0,plromx=1000.0,plromn=0.0, + & plrsmx=1000.,plrsmn=0.0,plrimx=1000.,plrimn=0.0, + & plrjmx=1000.,plrjmn=0.0) +!clu [-1l/+1l] relax tsfsmx (for noah lsm) + parameter(tsflmx=353.,tsflmn=173.0,tsfomx=313.0,tsfomn=271.2, + & tsfsmx=305.0,tsfsmn=173.0,tsfimx=271.2,tsfimn=173.0, + & tsfjmx=273.16,tsfjmn=173.0) +! parameter(tsflmx=353.,tsflmn=173.0,tsfomx=313.0,tsfomn=271.21, +!* & tsfsmx=273.16,tsfsmn=173.0,tsfimx=271.21,tsfimn=173.0, +! & tsfsmx=305.0,tsfsmn=173.0,tsfimx=271.21,tsfimn=173.0, + parameter(tg3lmx=310.,tg3lmn=200.0,tg3omx=310.0,tg3omn=200.0, + & tg3smx=310.,tg3smn=200.0,tg3imx=310.0,tg3imn=200.0, + & tg3jmx=310.,tg3jmn=200.0) + parameter(stclmx=353.,stclmn=173.0,stcomx=313.0,stcomn=200.0, + & stcsmx=310.,stcsmn=200.0,stcimx=310.0,stcimn=200.0, + & stcjmx=310.,stcjmn=200.0) +!landice mods force a flag value of soil moisture of 1.0 +! at non-land points + parameter(smclmx=0.55,smclmn=0.0,smcomx=1.0,smcomn=1.0, + & smcsmx=0.55,smcsmn=0.0,smcimx=1.0,smcimn=1.0, + & smcjmx=1.0,smcjmn=1.0) + parameter(scvlmx=0.0,scvlmn=0.0,scvomx=0.0,scvomn=0.0, + & scvsmx=1.0,scvsmn=1.0,scvimx=0.0,scvimn=0.0, + & scvjmx=1.0,scvjmn=1.0) + parameter(veglmx=1.0,veglmn=0.0,vegomx=0.0,vegomn=0.0, + & vegsmx=1.0,vegsmn=0.0,vegimx=0.0,vegimn=0.0, + & vegjmx=0.0,vegjmn=0.0) + parameter(vmnlmx=1.0,vmnlmn=0.0,vmnomx=0.0,vmnomn=0.0, + & vmnsmx=1.0,vmnsmn=0.0,vmnimx=0.0,vmnimn=0.0, + & vmnjmx=0.0,vmnjmn=0.0) + parameter(vmxlmx=1.0,vmxlmn=0.0,vmxomx=0.0,vmxomn=0.0, + & vmxsmx=1.0,vmxsmn=0.0,vmximx=0.0,vmximn=0.0, + & vmxjmx=0.0,vmxjmn=0.0) + parameter(slplmx=9.0,slplmn=1.0,slpomx=0.0,slpomn=0.0, + & slpsmx=9.0,slpsmn=1.0,slpimx=0.,slpimn=0., + & slpjmx=0.,slpjmn=0.) +! note: the range values for bare land and snow covered land +! (alblmx, alblmn, albsmx, albsmn) are set below +! based on whether the old or new radiation is selected + parameter(absomx=0.0,absomn=0.0, + & absimx=0.0,absimn=0.0, + & absjmx=0.0,absjmn=0.0) +! vegetation type + parameter(vetlmx=20.,vetlmn=1.0,vetomx=0.0,vetomn=0.0, + & vetsmx=20.,vetsmn=1.0,vetimx=0.,vetimn=0., + & vetjmx=0.,vetjmn=0.) +! soil type + parameter(sotlmx=16.,sotlmn=1.0,sotomx=0.0,sotomn=0.0, + & sotsmx=16.,sotsmn=1.0,sotimx=0.,sotimn=0., + & sotjmx=0.,sotjmn=0.) +! fraction of vegetation for strongly and weakly zeneith angle dependent +! albedo + parameter(alslmx=1.0,alslmn=0.0,alsomx=0.0,alsomn=0.0, + & alssmx=1.0,alssmn=0.0,alsimx=0.0,alsimn=0.0, + & alsjmx=0.0,alsjmn=0.0) +! +! criteria used for monitoring +! + parameter(epstsf=0.01,epsalb=0.001,epssno=0.01, + & epswet=0.01,epszor=0.0000001,epsplr=1.,epsoro=0., + & epssmc=0.0001,epsscv=0.,eptsfc=0.01,epstg3=0.01, + & epsais=0.,epsacn=0.01,epsveg=0.01, + & epssih=0.001,epssic=0.001, + & epsvmn=0.01,epsvmx=0.01,epsabs=0.001,epsslp=0.01, + & epsvet=.01,epssot=.01,epsalf=.001) +! +! quality control of analysis snow and sea ice +! +! qctsfs .. surface temperature above which no snow allowed +! qcsnos .. snow depth above which snow must exist +! qctsfi .. sst above which sea-ice is not allowed +! +!clu relax qctsfs (for noah lsm) +!* parameter(qctsfs=283.16,qcsnos=100.,qctsfi=280.16) +!* parameter(qctsfs=288.16,qcsnos=100.,qctsfi=280.16) + parameter(qctsfs=293.16,qcsnos=100.,qctsfi=280.16) +! +!cwu [-2l] +!* ice concentration for ice limit (55 percent) +! +!* parameter(aislim=0.55) +! +! parameters to obtain snow depth from snow cover and temperature +! +! parameter(snwmin=25.,snwmax=100.) + parameter(snwmin=5.0,snwmax=100.) + real (kind=kind_io8), parameter :: ten=10.0, one=1.0 +! +! coeeficients of blending forecast and interpolated clim +! (or analyzed) fields over sea or land(l) (not for clouds) +! 1.0 = use of forecast +! 0.0 = replace with interpolated analysis +! +! these values are set for analysis mode. +! +! variables land sea +! --------------------------------------------------------- +! surface temperature forecast analysis +! surface temperature forecast forecast (over sea ice) +! albedo analysis analysis +! sea-ice analysis analysis +! snow analysis forecast (over sea ice) +! roughness analysis forecast +! plant resistance analysis analysis +! soil wetness (layer) weighted average analysis +! soil temperature forecast analysis +! canopy waver content forecast forecast +! convective cloud cover forecast forecast +! convective cloud bottm forecast forecast +! convective cloud top forecast forecast +! vegetation cover analysis analysis +! vegetation type analysis analysis +! soil type analysis analysis +! sea-ice thickness forecast forecast +! sea-ice concentration analysis analysis +! vegetation cover min analysis analysis +! vegetation cover max analysis analysis +! max snow albedo analysis analysis +! slope type analysis analysis +! liquid soil wetness analysis-weighted analysis +! actual snow depth analysis-weighted analysis +! +! note: if analysis file is not given, then time interpolated climatology +! is used. if analyiss file is given, it will be used as far as the +! date and time matches. if they do not match, it uses forecast. +! +! critical percentage value for aborting bad points when lgchek=.true. +! + logical lgchek + data lgchek/.true./ + data critp1,critp2,critp3/80.,80.,25./ +! +! integer kpdalb(4), kpdalf(2) +! data kpdalb/212,215,213,216/, kpdalf/214,217/ +! save kpdalb, kpdalf +! +! mask orography and variance on gaussian grid +! + real (kind=kind_io8) slmask(len),orog(len), orog_uf(len) + &, orogd(len) + real (kind=kind_io8) rla(len), rlo(len) +! +! permanent/extremes +! + character*500 fnglac,fnmxic + real (kind=kind_io8), allocatable :: glacir(:),amxice(:),tsfcl0(:) +! +! tsfcl0 is the climatological tsf at fh=0 +! +! climatology surface fields (last character 'c' or 'clm' indicate climatology) +! + character*500 fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, + & fnplrc,fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc, + & fnvegc,fnvetc,fnsotc + &, fnvmnc,fnvmxc,fnslpc,fnabsc, fnalbc2 + real (kind=kind_io8) tsfclm(len), wetclm(len), snoclm(len), + & zorclm(len), albclm(len,4), aisclm(len), + & tg3clm(len), acnclm(len), cnpclm(len), + & cvclm (len), cvbclm(len), cvtclm(len), + & scvclm(len), tsfcl2(len), vegclm(len), + & vetclm(len), sotclm(len), alfclm(len,2), sliclm(len), + & smcclm(len,lsoil), stcclm(len,lsoil) + &, sihclm(len), sicclm(len) + &, vmnclm(len), vmxclm(len), slpclm(len), absclm(len) +! +! analyzed surface fields (last character 'a' or 'anl' indicate analysis) +! + character*500 fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, + & fnplra,fntg3a,fnscva,fnsmca,fnstca,fnacna, + & fnvega,fnveta,fnsota + &, fnvmna,fnvmxa,fnslpa,fnabsa +! + real (kind=kind_io8) tsfanl(len), wetanl(len), snoanl(len), + & zoranl(len), albanl(len,4), aisanl(len), + & tg3anl(len), acnanl(len), cnpanl(len), + & cvanl (len), cvbanl(len), cvtanl(len), + & scvanl(len), tsfan2(len), veganl(len), + & vetanl(len), sotanl(len), alfanl(len,2), slianl(len), + & smcanl(len,lsoil), stcanl(len,lsoil) + &, sihanl(len), sicanl(len) + &, vmnanl(len), vmxanl(len), slpanl(len), absanl(len) +! + real (kind=kind_io8) tsfan0(len) ! sea surface temperature analysis at ft=0. +! +! predicted surface fields (last characters 'fcs' indicates forecast) +! + real (kind=kind_io8) tsffcs(len), wetfcs(len), snofcs(len), + & zorfcs(len), albfcs(len,4), aisfcs(len), + & tg3fcs(len), acnfcs(len), cnpfcs(len), + & cvfcs (len), cvbfcs(len), cvtfcs(len), + & slifcs(len), vegfcs(len), + & vetfcs(len), sotfcs(len), alffcs(len,2), + & smcfcs(len,lsoil), stcfcs(len,lsoil) + &, sihfcs(len), sicfcs(len), sitfcs(len) + &, vmnfcs(len), vmxfcs(len), slpfcs(len), absfcs(len) + &, swdfcs(len), slcfcs(len,lsoil) +! +! ratio of sigma level 1 wind and 10m wind (diagnozed by model and not touched +! in this program). +! + real (kind=kind_io8) f10m (len) + real (kind=kind_io8) fsmcl(25),fsmcs(25),fstcl(25),fstcs(25) + real (kind=kind_io8) fcsmcl(25),fcsmcs(25),fcstcl(25),fcstcs(25) + +!clu [+1l] add swratio (soil moisture liquid-to-total ratio) + real (kind=kind_io8) swratio(len,lsoil) +!clu [+1l] add fixratio (option to adjust slc from smc) + logical fixratio(lsoil) +! + integer icsmcl(25), icsmcs(25), icstcl(25), icstcs(25) +! + real (kind=kind_io8) csmcl(25), csmcs(25) + real (kind=kind_io8) cstcl(25), cstcs(25) +! + real (kind=kind_io8) slmskh(mdata) + character*500 fnmskh + integer kpd7, kpd9 +! + logical icefl1(len), icefl2(len) +! +! input and output surface fields (bges) file names +! +! +! sigma level 1 temperature for dead start +! + real (kind=kind_io8) sig1t(len) +! + character*32 label +! +! = 1 ==> forecast is used +! = 0 ==> analysis (or climatology) is used +! +! output file ... primary surface file for radiation and forecast +! +! rec. 1 label +! rec. 2 date record +! rec. 3 tsf +! rec. 4 soilm(two layers) ----> 4 layers +! rec. 5 snow +! rec. 6 soilt(two layers) ----> 4 layers +! rec. 7 tg3 +! rec. 8 zor +! rec. 9 cv +! rec. 10 cvb +! rec. 11 cvt +! rec. 12 albedo (four types) +! rec. 13 slimsk +! rec. 14 vegetation cover +! rec. 14 plantr -----> skip this record +! rec. 15 f10m -----> canopy +! rec. 16 canopy water content (cnpanl) -----> f10m +! rec. 17 vegetation type +! rec. 18 soil type +! rec. 19 zeneith angle dependent vegetation fraction (two types) +! rec. 20 uustar +! rec. 21 ffmm +! rec. 22 ffhh +!cwu add sih & sic +! rec. 23 sih(one category only) +! rec. 24 sic +!clu [+8l] add prcp, flag, swd, slc, vmn, vmx, slp, abs +! rec. 25 tprcp +! rec. 26 srflag +! rec. 27 swd +! rec. 28 slc (4 layers) +! rec. 29 vmn +! rec. 30 vmx +! rec. 31 slp +! rec. 32 abs + +! +! debug only +! ldebug=.true. creates bges files for climatology and analysis +! lqcbgs=.true. quality controls input bges file before merging (should have been +! qced in the forecast program) +! + logical ldebug,lqcbgs + logical lprnt +! +! debug only +! + character*500 fndclm,fndanl +! + logical lanom + +! + namelist/namsfc/fnglac,fnmxic, + & fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, + & fnplrc,fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc, + & fnvegc,fnvetc,fnsotc,fnalbc2, + & fnvmnc,fnvmxc,fnslpc,fnabsc, + & fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, + & fnplra,fntg3a,fnscva,fnsmca,fnstca,fnacna, + & fnvega,fnveta,fnsota, + & fnvmna,fnvmxa,fnslpa,fnabsa, + & fnmskh, + & ldebug,lgchek,lqcbgs,critp1,critp2,critp3, + & fndclm,fndanl, + & lanom, + & ftsfl,ftsfs,falbl,falbs,faisl,faiss,fsnol,fsnos, + & fzorl,fzors,fplrl,fplrs,fsmcl,fsmcs, + & fstcl,fstcs,fvegl,fvegs,fvetl,fvets,fsotl,fsots, + & fctsfl,fctsfs,fcalbl,fcalbs,fcsnol,fcsnos, + & fczorl,fczors,fcplrl,fcplrs,fcsmcl,fcsmcs, + & fcstcl,fcstcs,fsalfl,fsalfs,fcalfl,flalfs, + & fsihl,fsicl,fsihs,fsics,aislim,sihnew, + & fvmnl,fvmns,fvmxl,fvmxs,fslpl,fslps, + & fabsl,fabss, + & ictsfl,ictsfs,icalbl,icalbs,icsnol,icsnos, + & iczorl,iczors,icplrl,icplrs,icsmcl,icsmcs, + & icstcl,icstcs,icalfl,icalfs, + & gausm, deads, qcmsk, znlst, + & monclm, monanl, monfcs, monmer, mondif, igrdbg, + & blnmsk, bltmsk, landice +! + data gausm/.true./, deads/.false./, blnmsk/0.0/, bltmsk/90.0/ + &, qcmsk/.false./, znlst/.false./, igrdbg/-1/ + &, monclm/.false./, monanl/.false./, monfcs/.false./ + &, monmer/.false./, mondif/.false./, landice/.true./ +! +! defaults file names +! + data fnmskh/'global_slmask.t126.grb'/ + data fnalbc/'global_albedo4.1x1.grb'/ + data fnalbc2/'global_albedo4.1x1.grb'/ + data fntsfc/'global_sstclim.2x2.grb'/ + data fnsotc/'global_soiltype.1x1.grb'/ + data fnvegc/'global_vegfrac.1x1.grb'/ + data fnvetc/'global_vegtype.1x1.grb'/ + data fnglac/'global_glacier.2x2.grb'/ + data fnmxic/'global_maxice.2x2.grb'/ + data fnsnoc/'global_snoclim.1.875.grb'/ + data fnzorc/'global_zorclim.1x1.grb'/ + data fnaisc/'global_iceclim.2x2.grb'/ + data fntg3c/'global_tg3clim.2.6x1.5.grb'/ + data fnsmcc/'global_soilmcpc.1x1.grb'/ +!clu [+4l] add fn()c for vmn, vmx, abs, slp + data fnvmnc/'global_shdmin.0.144x0.144.grb'/ + data fnvmxc/'global_shdmax.0.144x0.144.grb'/ + data fnslpc/'global_slope.1x1.grb'/ + data fnabsc/'global_snoalb.1x1.grb'/ +! + data fnwetc/' '/ + data fnplrc/' '/ + data fnstcc/' '/ + data fnscvc/' '/ + data fnacnc/' '/ +! + data fntsfa/' '/ + data fnweta/' '/ + data fnsnoa/' '/ + data fnzora/' '/ + data fnalba/' '/ + data fnaisa/' '/ + data fnplra/' '/ + data fntg3a/' '/ + data fnsmca/' '/ + data fnstca/' '/ + data fnscva/' '/ + data fnacna/' '/ + data fnvega/' '/ + data fnveta/' '/ + data fnsota/' '/ +!clu [+4l] add fn()a for vmn, vmx, abs, slp + data fnvmna/' '/ + data fnvmxa/' '/ + data fnslpa/' '/ + data fnabsa/' '/ +! + data ldebug/.false./, lqcbgs/.true./ + data fndclm/' '/ + data fndanl/' '/ + data lanom/.false./ +! +! default relaxation time in hours to analysis or climatology + data ftsfl/99999.0/, ftsfs/0.0/ + data falbl/0.0/, falbs/0.0/ + data falfl/0.0/, falfs/0.0/ + data faisl/0.0/, faiss/0.0/ + data fsnol/0.0/, fsnos/99999.0/ + data fzorl/0.0/, fzors/99999.0/ + data fplrl/0.0/, fplrs/0.0/ + data fvetl/0.0/, fvets/99999.0/ + data fsotl/0.0/, fsots/99999.0/ + data fvegl/0.0/, fvegs/99999.0/ +!cwu [+4l] add f()l and f()s for sih, sic and aislim, sihlim + data fsihl/99999.0/, fsihs/99999.0/ +! data fsicl/99999.0/, fsics/99999.0/ + data fsicl/0.0/, fsics/0.0/ +! default ice concentration limit (50%), new ice thickness (20cm) +!cwu change ice concentration limit (15%) Jan 2015 +! data aislim/0.50/, sihnew/0.2/ + data aislim/0.15/, sihnew/0.2/ +!clu [+4l] add f()l and f()s for vmn, vmx, abs, slp + data fvmnl/0.0/, fvmns/99999.0/ + data fvmxl/0.0/, fvmxs/99999.0/ + data fslpl/0.0/, fslps/99999.0/ + data fabsl/0.0/, fabss/99999.0/ +! default relaxation time in hours to climatology if analysis missing + data fctsfl/99999.0/, fctsfs/99999.0/ + data fcalbl/99999.0/, fcalbs/99999.0/ + data fcsnol/99999.0/, fcsnos/99999.0/ + data fczorl/99999.0/, fczors/99999.0/ + data fcplrl/99999.0/, fcplrs/99999.0/ +! default flag to apply climatological annual cycle + data ictsfl/0/, ictsfs/1/ + data icalbl/1/, icalbs/1/ + data icalfl/1/, icalfs/1/ + data icsnol/0/, icsnos/0/ + data iczorl/1/, iczors/0/ + data icplrl/1/, icplrs/0/ +! + data ccnp/1.0/ + data ccv/1.0/, ccvb/1.0/, ccvt/1.0/ +! + data ifp/0/ +! + save ifp,fnglac,fnmxic, + & fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, + & fnplrc,fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,fnvegc, + & fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, + & fnplra,fntg3a,fnscva,fnsmca,fnstca,fnacna,fnvega, + & fnvetc,fnveta, + & fnsotc,fnsota, +!clu [+2l] add fn()c and fn()a for vmn, vmx, slp, abs + & fnvmnc,fnvmxc,fnabsc,fnslpc, + & fnvmna,fnvmxa,fnabsa,fnslpa, + & ldebug,lgchek,lqcbgs,critp1,critp2,critp3, + & fndclm,fndanl, + & lanom, + & ftsfl,ftsfs,falbl,falbs,faisl,faiss,fsnol,fsnos, + & fzorl,fzors,fplrl,fplrs,fsmcl,fsmcs,falfl,falfs, + & fstcl,fstcs,fvegl,fvegs,fvetl,fvets,fsotl,fsots, + & fctsfl,fctsfs,fcalbl,fcalbs,fcsnol,fcsnos, + & fczorl,fczors,fcplrl,fcplrs,fcsmcl,fcsmcs, + & fcstcl,fcstcs,fcalfl,fcalfs, +!cwu [+1l] add f()l and f()s for sih, sic and aislim, sihnew + & fsihl,fsihs,fsicl,fsics,aislim,sihnew, +!clu [+2l] add f()l and f()s for vmn, vmx, slp, abs + & fvmnl,fvmns,fvmxl,fvmxs,fslpl,fslps, + & fabsl,fabss, + & ictsfl,ictsfs,icalbl,icalbs,icsnol,icsnos, + & iczorl,iczors,icplrl,icplrs,icsmcl,icsmcs, + & icstcl,icstcs,icalfl,icalfs, + & gausm, deads, qcmsk, + & monclm, monanl, monfcs, monmer, mondif, igrdbg, + & grboro, grbmsk, +! + & ctsfl, ctsfs, calbl, calfl, calbs, calfs, csmcs, + & csnol, csnos, czorl, czors, cplrl, cplrs, cstcl, + & cstcs, cvegl, cvwgs, cvetl, cvets, csotl, csots, + & csmcl +!cwu [+1l] add c()l and c()s for sih, sic + &, csihl, csihs, csicl, csics +!clu [+2l] add c()l and c()s for vmn, vmx, slp, abs + &, cvmnl, cvmns, cvmxl, cvmxs, cslpl, cslps, + & cabsl, cabss + &, imsk, jmsk, slmskh, blnmsk, bltmsk + &, glacir, amxice, tsfcl0 + &, caisl, caiss, cvegs +! + lprnt = .false. + iprnt = 1 +! do i=1,len +! if (ifp .eq. 0 .and. rla(i) .gt. 80.0) print *,' rla=',rla(i) +! *,' rlo=',rlo(i) +! tem1 = abs(rla(i) - 48.75) +! tem2 = abs(rlo(i) - (-68.50)) +! if(tem1 .lt. 0.25 .and. tem2 .lt. 0.50) then +! lprnt = .true. +! iprnt = i +! print *,' lprnt=',lprnt,' iprnt=',iprnt +! print *,' rla(i)=',rla(i),' rlo(i)=',rlo(i) +! endif +! enddo + if (ialb == 1) then + kpdabs = kpdabs_1 + kpdalb = kpdalb_1 + alblmx = .99 + albsmx = .99 + alblmn = .01 + albsmn = .01 + abslmx = 1.0 + abssmx = 1.0 + abssmn = .01 + abslmn = .01 + else + kpdabs = kpdabs_0 + kpdalb = kpdalb_0 + alblmx = .80 + albsmx = .80 + alblmn = .06 + albsmn = .06 + abslmx = .80 + abssmx = .80 + abslmn = .01 + abssmn = .01 + endif + if(ifp.eq.0) then + ifp = 1 + do k=1,lsoil + fsmcl(k) = 99999. + fsmcs(k) = 0. + fstcl(k) = 99999. + fstcs(k) = 0. + enddo +#ifdef INTERNAL_FILE_NML + read(input_nml_file, nml=namsfc) +#else +! print *,' in sfcsub nlunit=',nlunit,' me=',me,' ialb=',ialb + rewind(nlunit) + read (nlunit,namsfc) +#endif +! write(6,namsfc) +! + if (me .eq. 0) then + print *,'ftsfl,falbl,faisl,fsnol,fzorl=', + & ftsfl,falbl,faisl,fsnol,fzorl + print *,'fsmcl=',fsmcl(1:lsoil) + print *,'fstcl=',fstcl(1:lsoil) + print *,'ftsfs,falbs,faiss,fsnos,fzors=', + & ftsfs,falbs,faiss,fsnos,fzors + print *,'fsmcs=',fsmcs(1:lsoil) + print *,'fstcs=',fstcs(1:lsoil) + print *,' aislim=',aislim,' sihnew=',sihnew + print *,' isot=', isot,' ivegsrc=',ivegsrc + endif + + if (ivegsrc == 2) then ! sib + veg_type_landice=13 + else + veg_type_landice=15 + endif + if (isot == 0) then + soil_type_landice=9 + else + soil_type_landice=16 + endif +! + deltf = deltsfc / 24.0 +! + ctsfl=0. !... tsfc over land + if(ftsfl.ge.99999.) ctsfl=1. + if((ftsfl.gt.0.).and.(ftsfl.lt.99999)) ctsfl=exp(-deltf/ftsfl) +! + ctsfs=0. !... tsfc over sea + if(ftsfs.ge.99999.) ctsfs=1. + if((ftsfs.gt.0.).and.(ftsfs.lt.99999)) ctsfs=exp(-deltf/ftsfs) +! + do k=1,lsoil + csmcl(k)=0. !... soilm over land + if(fsmcl(k).ge.99999.) csmcl(k)=1. + if((fsmcl(k).gt.0.).and.(fsmcl(k).lt.99999)) + & csmcl(k)=exp(-deltf/fsmcl(k)) + csmcs(k)=0. !... soilm over sea + if(fsmcs(k).ge.99999.) csmcs(k)=1. + if((fsmcs(k).gt.0.).and.(fsmcs(k).lt.99999)) + & csmcs(k)=exp(-deltf/fsmcs(k)) + enddo +! + calbl=0. !... albedo over land + if(falbl.ge.99999.) calbl=1. + if((falbl.gt.0.).and.(falbl.lt.99999)) calbl=exp(-deltf/falbl) +! + calfl=0. !... fraction field for albedo over land + if(falfl.ge.99999.) calfl=1. + if((falfl.gt.0.).and.(falfl.lt.99999)) calfl=exp(-deltf/falfl) +! + calbs=0. !... albedo over sea + if(falbs.ge.99999.) calbs=1. + if((falbs.gt.0.).and.(falbs.lt.99999)) calbs=exp(-deltf/falbs) +! + calfs=0. !... fraction field for albedo over sea + if(falfs.ge.99999.) calfs=1. + if((falfs.gt.0.).and.(falfs.lt.99999)) calfs=exp(-deltf/falfs) +! + caisl=0. !... sea ice over land + if(faisl.ge.99999.) caisl=1. + if((faisl.gt.0.).and.(faisl.lt.99999)) caisl=1. +! + caiss=0. !... sea ice over sea + if(faiss.ge.99999.) caiss=1. + if((faiss.gt.0.).and.(faiss.lt.99999)) caiss=1. +! + csnol=0. !... snow over land + if(fsnol.ge.99999.) csnol=1. + if((fsnol.gt.0.).and.(fsnol.lt.99999)) csnol=exp(-deltf/fsnol) +! using the same way to bending snow as narr when fsnol is the negative value +! the magnitude of fsnol is the thread to determine the lower and upper bound +! of final swe + if(fsnol.lt.0.)csnol=fsnol +! + csnos=0. !... snow over sea + if(fsnos.ge.99999.) csnos=1. + if((fsnos.gt.0.).and.(fsnos.lt.99999)) csnos=exp(-deltf/fsnos) +! + czorl=0. !... roughness length over land + if(fzorl.ge.99999.) czorl=1. + if((fzorl.gt.0.).and.(fzorl.lt.99999)) czorl=exp(-deltf/fzorl) +! + czors=0. !... roughness length over sea + if(fzors.ge.99999.) czors=1. + if((fzors.gt.0.).and.(fzors.lt.99999)) czors=exp(-deltf/fzors) +! +! cplrl=0. !... plant resistance over land +! if(fplrl.ge.99999.) cplrl=1. +! if((fplrl.gt.0.).and.(fplrl.lt.99999)) cplrl=exp(-deltf/fplrl) +! +! cplrs=0. !... plant resistance over sea +! if(fplrs.ge.99999.) cplrs=1. +! if((fplrs.gt.0.).and.(fplrs.lt.99999)) cplrs=exp(-deltf/fplrs) +! + do k=1,lsoil + cstcl(k)=0. !... soilt over land + if(fstcl(k).ge.99999.) cstcl(k)=1. + if((fstcl(k).gt.0.).and.(fstcl(k).lt.99999)) + & cstcl(k)=exp(-deltf/fstcl(k)) + cstcs(k)=0. !... soilt over sea + if(fstcs(k).ge.99999.) cstcs(k)=1. + if((fstcs(k).gt.0.).and.(fstcs(k).lt.99999)) + & cstcs(k)=exp(-deltf/fstcs(k)) + enddo +! + cvegl=0. !... vegetation fraction over land + if(fvegl.ge.99999.) cvegl=1. + if((fvegl.gt.0.).and.(fvegl.lt.99999)) cvegl=exp(-deltf/fvegl) +! + cvegs=0. !... vegetation fraction over sea + if(fvegs.ge.99999.) cvegs=1. + if((fvegs.gt.0.).and.(fvegs.lt.99999)) cvegs=exp(-deltf/fvegs) +! + cvetl=0. !... vegetation type over land + if(fvetl.ge.99999.) cvetl=1. + if((fvetl.gt.0.).and.(fvetl.lt.99999)) cvetl=exp(-deltf/fvetl) +! + cvets=0. !... vegetation type over sea + if(fvets.ge.99999.) cvets=1. + if((fvets.gt.0.).and.(fvets.lt.99999)) cvets=exp(-deltf/fvets) +! + csotl=0. !... soil type over land + if(fsotl.ge.99999.) csotl=1. + if((fsotl.gt.0.).and.(fsotl.lt.99999)) csotl=exp(-deltf/fsotl) +! + csots=0. !... soil type over sea + if(fsots.ge.99999.) csots=1. + if((fsots.gt.0.).and.(fsots.lt.99999)) csots=exp(-deltf/fsots) + +!cwu [+16l]--------------------------------------------------------------- +! + csihl=0. !... sea ice thickness over land + if(fsihl.ge.99999.) csihl=1. + if((fsihl.gt.0.).and.(fsihl.lt.99999)) csihl=exp(-deltf/fsihl) +! + csihs=0. !... sea ice thickness over sea + if(fsihs.ge.99999.) csihs=1. + if((fsihs.gt.0.).and.(fsihs.lt.99999)) csihs=exp(-deltf/fsihs) +! + csicl=0. !... sea ice concentration over land + if(fsicl.ge.99999.) csicl=1. + if((fsicl.gt.0.).and.(fsicl.lt.99999)) csicl=exp(-deltf/fsicl) +! + csics=0. !... sea ice concentration over sea + if(fsics.ge.99999.) csics=1. + if((fsics.gt.0.).and.(fsics.lt.99999)) csics=exp(-deltf/fsics) + +!clu [+32l]--------------------------------------------------------------- +! + cvmnl=0. !... min veg cover over land + if(fvmnl.ge.99999.) cvmnl=1. + if((fvmnl.gt.0.).and.(fvmnl.lt.99999)) cvmnl=exp(-deltf/fvmnl) +! + cvmns=0. !... min veg cover over sea + if(fvmns.ge.99999.) cvmns=1. + if((fvmns.gt.0.).and.(fvmns.lt.99999)) cvmns=exp(-deltf/fvmns) +! + cvmxl=0. !... max veg cover over land + if(fvmxl.ge.99999.) cvmxl=1. + if((fvmxl.gt.0.).and.(fvmxl.lt.99999)) cvmxl=exp(-deltf/fvmxl) +! + cvmxs=0. !... max veg cover over sea + if(fvmxs.ge.99999.) cvmxs=1. + if((fvmxs.gt.0.).and.(fvmxs.lt.99999)) cvmxs=exp(-deltf/fvmxs) +! + cslpl=0. !... slope type over land + if(fslpl.ge.99999.) cslpl=1. + if((fslpl.gt.0.).and.(fslpl.lt.99999)) cslpl=exp(-deltf/fslpl) +! + cslps=0. !... slope type over sea + if(fslps.ge.99999.) cslps=1. + if((fslps.gt.0.).and.(fslps.lt.99999)) cslps=exp(-deltf/fslps) +! + cabsl=0. !... snow albedo over land + if(fabsl.ge.99999.) cabsl=1. + if((fabsl.gt.0.).and.(fabsl.lt.99999)) cabsl=exp(-deltf/fabsl) +! + cabss=0. !... snow albedo over sea + if(fabss.ge.99999.) cabss=1. + if((fabss.gt.0.).and.(fabss.lt.99999)) cabss=exp(-deltf/fabss) +!clu ---------------------------------------------------------------------- +! +! read a high resolution mask field for use in grib interpolation +! + call hmskrd(lugb,imsk,jmsk,fnmskh, + & kpdmsk,slmskh,gausm,blnmsk,bltmsk,me) +! if (qcmsk) call qcmask(slmskh,sllnd,slsea,imsk,jmsk,rla,rlo) +! + if (me .eq. 0) then + write(6,*) ' ' + write(6,*) ' lugb=',lugb,' len=',len, ' lsoil=',lsoil + write(6,*) 'iy=',iy,' im=',im,' id=',id,' ih=',ih,' fh=',fh + &, ' sig1t(1)=',sig1t(1) + &, ' gausm=',gausm,' blnmsk=',blnmsk,' bltmsk=',bltmsk + write(6,*) ' ' + endif +! +! reading permanent/extreme features (glacier points and maximum ice extent) +! + allocate (tsfcl0(len)) + allocate (glacir(len)) + allocate (amxice(len)) +! +! read glacier +! + kpd9 = -1 + kpd7 = -1 + call fixrdc(lugb,fnglac,kpdgla,kpd7,kpd9,slmask, + & glacir,len,iret + &, imsk, jmsk, slmskh, gausm, blnmsk, bltmsk + &, rla, rlo, me) +! znnt=1. +! call nntprt(glacir,len,znnt) +! +! read maximum ice extent +! + kpd7 = -1 + call fixrdc(lugb,fnmxic,kpdmxi,kpd7,kpd9,slmask, + & amxice,len,iret + &, imsk, jmsk, slmskh, gausm, blnmsk, bltmsk + &, rla, rlo, me) +! znnt=1. +! call nntprt(amxice,len,znnt) +! + crit=0.5 + call rof01(glacir,len,'ge',crit) + call rof01(amxice,len,'ge',crit) +! +! quality control max ice limit based on glacier points +! + call qcmxice(glacir,amxice,len,me) +! + endif ! first time loop finished +! + do i=1,len + sliclm(i) = 1. + snoclm(i) = 0. + icefl1(i) = .true. + enddo +! if(lprnt) print *,' tsffcsin=',tsffcs(iprnt) +! +! read climatology fields +! + if (me .eq. 0) then + write(6,*) '==============' + write(6,*) 'climatology' + write(6,*) '==============' + endif +! + percrit=critp1 +! + call clima(lugb,iy,im,id,ih,fh,len,lsoil,slmask, + & fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, + & fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,fnvegc, + & fnvetc,fnsotc, + & fnvmnc,fnvmxc,fnslpc,fnabsc, + & tsfclm,tsfcl2,wetclm,snoclm,zorclm,albclm,aisclm, + & tg3clm,cvclm ,cvbclm,cvtclm, + & cnpclm,smcclm,stcclm,sliclm,scvclm,acnclm,vegclm, + & vetclm,sotclm,alfclm, + & vmnclm,vmxclm,slpclm,absclm, + & kpdtsf,kpdwet,kpdsno,kpdzor,kpdalb,kpdais, + & kpdtg3,kpdscv,kpdacn,kpdsmc,kpdstc,kpdveg, + & kpdvet,kpdsot,kpdalf,tsfcl0, + & kpdvmn,kpdvmx,kpdslp,kpdabs, + & deltsfc, lanom + &, imsk, jmsk, slmskh, rla, rlo, gausm, blnmsk, bltmsk,me + &, lprnt,iprnt,fnalbc2,ialb,tile_num_ch,i_index,j_index) +! if(lprnt) print *,'tsfclm=',tsfclm(iprnt),' tsfcl2=',tsfcl2(iprnt) +! +! scale surface roughness and albedo to model required units +! + zsca=100. + call scale(zorclm,len,zsca) + zsca=0.01 + call scale(albclm,len,zsca) + call scale(albclm(1,2),len,zsca) + call scale(albclm(1,3),len,zsca) + call scale(albclm(1,4),len,zsca) + call scale(alfclm,len,zsca) + call scale(alfclm(1,2),len,zsca) +!clu [+4l] scale vmn, vmx, abs from percent to fraction + zsca=0.01 + call scale(vmnclm,len,zsca) + call scale(vmxclm,len,zsca) + call scale(absclm,len,zsca) + +! +! set albedo over ocean to albomx +! + call albocn(albclm,slmask,albomx,len) +! +! make sure vegetation type and soil type are non zero over land +! + call landtyp(vetclm,sotclm,slpclm,slmask,len) +! +!cwu [-1l/+1l] +!* ice concentration or ice mask (only ice mask used in the model now) +! ice concentration and ice mask (both are used in the model now) +! + if(fnaisc(1:8).ne.' ') then +!cwu [+5l/-1l] update sihclm, sicclm + do i=1,len + sihclm(i) = 3.0*aisclm(i) + sicclm(i) = aisclm(i) + if(slmask(i).eq.0..and.glacir(i).eq.1..and. + & sicclm(i).ne.1.) then + sicclm(i) = sicimx + sihfcs(i) = glacir_hice + endif + enddo + crit=aislim +!* crit=0.5 + call rof01(aisclm,len,'ge',crit) + elseif(fnacnc(1:8).ne.' ') then +!cwu [+4l] update sihclm, sicclm + do i=1,len + sihclm(i) = 3.0*acnclm(i) + sicclm(i) = acnclm(i) + if(slmask(i).eq.0..and.glacir(i).eq.1..and. + & sicclm(i).ne.1.) then + sicclm(i) = sicimx + sihfcs(i) = glacir_hice + endif + enddo + call rof01(acnclm,len,'ge',aislim) + do i=1,len + aisclm(i) = acnclm(i) + enddo + endif +! +! quality control of sea ice mask +! + call qcsice(aisclm,glacir,amxice,aicice,aicsea,sllnd,slmask, + & rla,rlo,len,me) +! +! set ocean/land/sea-ice mask +! + call setlsi(slmask,aisclm,len,aicice,sliclm) +! if(lprnt) print *,' aisclm=',aisclm(iprnt),' sliclm=' +! *,sliclm(iprnt),' slmask=',slmask(iprnt) +! +! write(6,*) 'sliclm' +! znnt=1. +! call nntprt(sliclm,len,znnt) +! +! quality control of snow +! + call qcsnow(snoclm,slmask,aisclm,glacir,len,snosmx,landice,me) +! + call setzro(snoclm,epssno,len) +! +! snow cover handling (we assume climatological snow depth is available) +! quality control of snow depth (note that snow should be corrected first +! because it influences tsf +! + kqcm=1 + call qcmxmn('snow ',snoclm,sliclm,snoclm,icefl1, + & snolmx,snolmn,snoomx,snoomn,snoimx,snoimn, + & snojmx,snojmn,snosmx,snosmn,epssno, + & rla,rlo,len,kqcm,percrit,lgchek,me) +! write(6,*) 'snoclm' +! znnt=1. +! call nntprt(snoclm,len,znnt) +! +! get snow cover from snow depth array +! + if(fnscvc(1:8).eq.' ') then + call getscv(snoclm,scvclm,len) + endif +! +! set tsfc over snow to tsfsmx if greater +! + call snosfc(snoclm,tsfclm,tsfsmx,len,me) +! call snosfc(snoclm,tsfcl2,tsfsmx,len) + +! +! quality control +! + do i=1,len + icefl2(i) = sicclm(i) .gt. 0.99999 + enddo + kqcm=1 + call qcmxmn('tsfc ',tsfclm,sliclm,snoclm,icefl2, + & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn, + & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('tsf2 ',tsfcl2,sliclm,snoclm,icefl2, + & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn, + & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf, + & rla,rlo,len,kqcm,percrit,lgchek,me) + do kk = 1, 4 + call qcmxmn('albc ',albclm(1,kk),sliclm,snoclm,icefl1, + & alblmx,alblmn,albomx,albomn,albimx,albimn, + & albjmx,albjmn,albsmx,albsmn,epsalb, + & rla,rlo,len,kqcm,percrit,lgchek,me) + enddo + if(fnwetc(1:8).ne.' ') then + call qcmxmn('wetc ',wetclm,sliclm,snoclm,icefl1, + & wetlmx,wetlmn,wetomx,wetomn,wetimx,wetimn, + & wetjmx,wetjmn,wetsmx,wetsmn,epswet, + & rla,rlo,len,kqcm,percrit,lgchek,me) + endif + call qcmxmn('zorc ',zorclm,sliclm,snoclm,icefl1, + & zorlmx,zorlmn,zoromx,zoromn,zorimx,zorimn, + & zorjmx,zorjmn,zorsmx,zorsmn,epszor, + & rla,rlo,len,kqcm,percrit,lgchek,me) +! if(fnplrc(1:8).ne.' ') then +! call qcmxmn('plntc ',plrclm,sliclm,snoclm,icefl1, +! & plrlmx,plrlmn,plromx,plromn,plrimx,plrimn, +! & plrjmx,plrjmn,plrsmx,plrsmn,epsplr, +! & rla,rlo,len,kqcm,percrit,lgchek,me) +! endif + call qcmxmn('tg3c ',tg3clm,sliclm,snoclm,icefl1, + & tg3lmx,tg3lmn,tg3omx,tg3omn,tg3imx,tg3imn, + & tg3jmx,tg3jmn,tg3smx,tg3smn,epstg3, + & rla,rlo,len,kqcm,percrit,lgchek,me) +! +! get soil temp and moisture (after all the qcs are completed) +! + if(fnsmcc(1:8).eq.' ') then + call getsmc(wetclm,len,lsoil,smcclm,me) + endif + call qcmxmn('smc1c ',smcclm(1,1),sliclm,snoclm,icefl1, + & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, + & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('smc2c ',smcclm(1,2),sliclm,snoclm,icefl1, + & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, + & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!clu [+8l] add smcclm(3:4) + if(lsoil.gt.2) then + call qcmxmn('smc3c ',smcclm(1,3),sliclm,snoclm,icefl1, + & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, + & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('smc4c ',smcclm(1,4),sliclm,snoclm,icefl1, + & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, + & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + endif + if(fnstcc(1:8).eq.' ') then + call getstc(tsfclm,tg3clm,sliclm,len,lsoil,stcclm,tsfimx) + endif + call qcmxmn('stc1c ',stcclm(1,1),sliclm,snoclm,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('stc2c ',stcclm(1,2),sliclm,snoclm,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!clu [+8l] add stcclm(3:4) + if(lsoil.gt.2) then + call qcmxmn('stc3c ',stcclm(1,3),sliclm,snoclm,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('stc4c ',stcclm(1,4),sliclm,snoclm,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + endif + call qcmxmn('vegc ',vegclm,sliclm,snoclm,icefl1, + & veglmx,veglmn,vegomx,vegomn,vegimx,vegimn, + & vegjmx,vegjmn,vegsmx,vegsmn,epsveg, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('vetc ',vetclm,sliclm,snoclm,icefl1, + & vetlmx,vetlmn,vetomx,vetomn,vetimx,vetimn, + & vetjmx,vetjmn,vetsmx,vetsmn,epsvet, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('sotc ',sotclm,sliclm,snoclm,icefl1, + & sotlmx,sotlmn,sotomx,sotomn,sotimx,sotimn, + & sotjmx,sotjmn,sotsmx,sotsmn,epssot, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!cwu [+8l] --------------------------------------------------------------- + call qcmxmn('sihc ',sihclm,sliclm,snoclm,icefl1, + & sihlmx,sihlmn,sihomx,sihomn,sihimx,sihimn, + & sihjmx,sihjmn,sihsmx,sihsmn,epssih, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('sicc ',sicclm,sliclm,snoclm,icefl1, + & siclmx,siclmn,sicomx,sicomn,sicimx,sicimn, + & sicjmx,sicjmn,sicsmx,sicsmn,epssic, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!clu [+16l] --------------------------------------------------------------- + call qcmxmn('vmnc ',vmnclm,sliclm,snoclm,icefl1, + & vmnlmx,vmnlmn,vmnomx,vmnomn,vmnimx,vmnimn, + & vmnjmx,vmnjmn,vmnsmx,vmnsmn,epsvmn, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('vmxc ',vmxclm,sliclm,snoclm,icefl1, + & vmxlmx,vmxlmn,vmxomx,vmxomn,vmximx,vmximn, + & vmxjmx,vmxjmn,vmxsmx,vmxsmn,epsvmx, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('slpc ',slpclm,sliclm,snoclm,icefl1, + & slplmx,slplmn,slpomx,slpomn,slpimx,slpimn, + & slpjmx,slpjmn,slpsmx,slpsmn,epsslp, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('absc ',absclm,sliclm,snoclm,icefl1, + & abslmx,abslmn,absomx,absomn,absimx,absimn, + & absjmx,absjmn,abssmx,abssmn,epsabs, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!clu ---------------------------------------------------------------------- +! +! monitoring prints +! + if (monclm) then + if (me .eq. 0) then + print *,' ' + print *,'monitor of time and space interpolated climatology' + print *,' ' +! call count(sliclm,snoclm,len) + print *,' ' + call monitr('tsfclm',tsfclm,sliclm,snoclm,len) + call monitr('albclm',albclm(1,1),sliclm,snoclm,len) + call monitr('albclm',albclm(1,2),sliclm,snoclm,len) + call monitr('albclm',albclm(1,3),sliclm,snoclm,len) + call monitr('albclm',albclm(1,4),sliclm,snoclm,len) + call monitr('aisclm',aisclm,sliclm,snoclm,len) + call monitr('snoclm',snoclm,sliclm,snoclm,len) + call monitr('scvclm',scvclm,sliclm,snoclm,len) + call monitr('smcclm1',smcclm(1,1),sliclm,snoclm,len) + call monitr('smcclm2',smcclm(1,2),sliclm,snoclm,len) + call monitr('stcclm1',stcclm(1,1),sliclm,snoclm,len) + call monitr('stcclm2',stcclm(1,2),sliclm,snoclm,len) +!clu [+4l] add smcclm(3:4) and stcclm(3:4) + if(lsoil.gt.2) then + call monitr('smcclm3',smcclm(1,3),sliclm,snoclm,len) + call monitr('smcclm4',smcclm(1,4),sliclm,snoclm,len) + call monitr('stcclm3',stcclm(1,3),sliclm,snoclm,len) + call monitr('stcclm4',stcclm(1,4),sliclm,snoclm,len) + endif + call monitr('tg3clm',tg3clm,sliclm,snoclm,len) + call monitr('zorclm',zorclm,sliclm,snoclm,len) +! if (gaus) then + call monitr('cvaclm',cvclm ,sliclm,snoclm,len) + call monitr('cvbclm',cvbclm,sliclm,snoclm,len) + call monitr('cvtclm',cvtclm,sliclm,snoclm,len) +! endif + call monitr('sliclm',sliclm,sliclm,snoclm,len) +! call monitr('plrclm',plrclm,sliclm,snoclm,len) + call monitr('orog ',orog ,sliclm,snoclm,len) + call monitr('vegclm',vegclm,sliclm,snoclm,len) + call monitr('vetclm',vetclm,sliclm,snoclm,len) + call monitr('sotclm',sotclm,sliclm,snoclm,len) +!cwu [+2l] add sih, sic + call monitr('sihclm',sihclm,sliclm,snoclm,len) + call monitr('sicclm',sicclm,sliclm,snoclm,len) +!clu [+4l] add vmn, vmx, slp, abs + call monitr('vmnclm',vmnclm,sliclm,snoclm,len) + call monitr('vmxclm',vmxclm,sliclm,snoclm,len) + call monitr('slpclm',slpclm,sliclm,snoclm,len) + call monitr('absclm',absclm,sliclm,snoclm,len) + endif + endif +! +! + if (me .eq. 0) then + write(6,*) '==============' + write(6,*) ' analysis' + write(6,*) '==============' + endif +! +! fill in analysis array with climatology before reading analysis. +! + call filanl(tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl,aisanl, + & tg3anl,cvanl ,cvbanl,cvtanl, + & cnpanl,smcanl,stcanl,slianl,scvanl,veganl, + & vetanl,sotanl,alfanl, + & sihanl,sicanl, + & vmnanl,vmxanl,slpanl,absanl, + & tsfclm,tsfcl2,wetclm,snoclm,zorclm,albclm,aisclm, + & tg3clm,cvclm ,cvbclm,cvtclm, + & cnpclm,smcclm,stcclm,sliclm,scvclm,vegclm, + & vetclm,sotclm,alfclm, + & sihclm,sicclm, + & vmnclm,vmxclm,slpclm,absclm, + & len,lsoil) +! +! reverse scaling to match with grib analysis input +! + zsca=0.01 + call scale(zoranl,len, zsca) + zsca=100. + call scale(albanl,len,zsca) + call scale(albanl(1,2),len,zsca) + call scale(albanl(1,3),len,zsca) + call scale(albanl(1,4),len,zsca) + call scale(alfanl,len,zsca) + call scale(alfanl(1,2),len,zsca) +!clu [+4l] reverse scale for vmn, vmx, abs + zsca=100. + call scale(vmnanl,len,zsca) + call scale(vmxanl,len,zsca) + call scale(absanl,len,zsca) +! + percrit=critp2 +! +! read analysis fields +! + call analy(lugb,iy,im,id,ih,fh,len,lsoil,slmask, + & fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, + & fntg3a,fnscva,fnsmca,fnstca,fnacna,fnvega, + & fnveta,fnsota, + & fnvmna,fnvmxa,fnslpa,fnabsa, + & tsfanl,wetanl,snoanl,zoranl,albanl,aisanl, + & tg3anl,cvanl ,cvbanl,cvtanl, + & smcanl,stcanl,slianl,scvanl,acnanl,veganl, + & vetanl,sotanl,alfanl,tsfan0, + & vmnanl,vmxanl,slpanl,absanl, + & kpdtsf,kpdwet,kpdsno,kpdsnd,kpdzor,kpdalb,kpdais, + & kpdtg3,kpdscv,kpdacn,kpdsmc,kpdstc,kpdveg, + & kpdvet,kpdsot,kpdalf, + & kpdvmn,kpdvmx,kpdslp,kpdabs, + & irttsf,irtwet,irtsno,irtzor,irtalb,irtais, + & irttg3,irtscv,irtacn,irtsmc,irtstc,irtveg, + & irtvet,irtsot,irtalf + &, irtvmn,irtvmx,irtslp,irtabs, + & imsk, jmsk, slmskh, rla, rlo, gausm, blnmsk, bltmsk + &, me, lanom) +! if(lprnt) print *,' tsfanl=',tsfanl(iprnt) +! +! scale zor and alb to match forecast model units +! + zsca=100. + call scale(zoranl,len, zsca) + zsca=0.01 + call scale(albanl,len,zsca) + call scale(albanl(1,2),len,zsca) + call scale(albanl(1,3),len,zsca) + call scale(albanl(1,4),len,zsca) + call scale(alfanl,len,zsca) + call scale(alfanl(1,2),len,zsca) +!clu [+4] scale vmn, vmx, abs from percent to fraction + zsca=0.01 + call scale(vmnanl,len,zsca) + call scale(vmxanl,len,zsca) + call scale(absanl,len,zsca) +! +! interpolate climatology but fixing initial anomaly +! + if(fh > 0.0 .and. fntsfa(1:8) /= ' ' .and. lanom) then + call anomint(tsfan0,tsfclm,tsfcl0,tsfanl,len) + endif +! +! if the tsfanl is at sea level, then bring it to the surface using +! unfiltered orography (for lakes). if the analysis is at lake surface +! as in the nst model, then this call should be removed - moorthi 09/23/2011 +! + if (use_ufo .and. .not. nst_anl) then + ztsfc = 0.0 + call tsfcor(tsfanl,orog_uf,slmask,ztsfc,len,rlapse) + endif +! +! ice concentration or ice mask (only ice mask used in the model now) +! + if(fnaisa(1:8).ne.' ') then +!cwu [+5l/-1l] update sihanl, sicanl + do i=1,len + sihanl(i) = 3.0*aisanl(i) + sicanl(i) = aisanl(i) + if(slmask(i).eq.0..and.glacir(i).eq.1..and. + & sicanl(i).ne.1.) then + sicanl(i) = sicimx + sihfcs(i) = glacir_hice + endif + enddo + crit=aislim +!* crit=0.5 + call rof01(aisanl,len,'ge',crit) + elseif(fnacna(1:8).ne.' ') then +!cwu [+17l] update sihanl, sicanl + do i=1,len + sihanl(i) = 3.0*acnanl(i) + sicanl(i) = acnanl(i) + if(slmask(i).eq.0..and.glacir(i).eq.1..and. + & sicanl(i).ne.1.) then + sicanl(i) = sicimx + sihfcs(i) = glacir_hice + endif + enddo + crit=aislim + do i=1,len + if((slianl(i).eq.0.).and.(sicanl(i).ge.crit)) then + slianl(i)=2. +! print *,'cycle - new ice form: fice=',sicanl(i) + else if((slianl(i).ge.2.).and.(sicanl(i).lt.crit)) then + slianl(i)=0. +! print *,'cycle - ice free: fice=',sicanl(i) + else if((slianl(i).eq.1.).and.(sicanl(i).ge.sicimn)) then +! print *,'cycle - land covered by sea-ice: fice=',sicanl(i) + sicanl(i)=0. + endif + enddo +! znnt=10. +! call nntprt(acnanl,len,znnt) +! if(lprnt) print *,' acnanl=',acnanl(iprnt) +! do i=1,len +! if (acnanl(i) .gt. 0.3 .and. aisclm(i) .eq. 1.0 +! & .and. aisfcs(i) .ge. 0.75) acnanl(i) = aislim +! enddo +! if(lprnt) print *,' acnanl=',acnanl(iprnt) + call rof01(acnanl,len,'ge',aislim) + do i=1,len + aisanl(i)=acnanl(i) + enddo + endif +! if(lprnt) print *,' aisanl1=',aisanl(iprnt),' glacir=' +! &,glacir(iprnt),' slmask=',slmask(iprnt) +! + call qcsice(aisanl,glacir,amxice,aicice,aicsea,sllnd,slmask, + & rla,rlo,len,me) +! +! set ocean/land/sea-ice mask +! + call setlsi(slmask,aisanl,len,aicice,slianl) +! if(lprnt) print *,' aisanl=',aisanl(iprnt),' slianl=' +! *,slianl(iprnt),' slmask=',slmask(iprnt) +! +! + do k=1,lsoil + do i=1,len + if (slianl(i) .eq. 0) then + smcanl(i,k) = smcomx + stcanl(i,k) = tsfanl(i) + endif + enddo + enddo + +! write(6,*) 'slianl' +! znnt=1. +! call nntprt(slianl,len,znnt) +!cwu [+8l]---------------------------------------------------------------------- + call qcmxmn('siha ',sihanl,slianl,snoanl,icefl1, + & sihlmx,sihlmn,sihomx,sihomn,sihimx,sihimn, + & sihjmx,sihjmn,sihsmx,sihsmn,epssih, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('sica ',sicanl,slianl,snoanl,icefl1, + & siclmx,siclmn,sicomx,sicomn,sicimx,sicimn, + & sicjmx,sicjmn,sicsmx,sicsmn,epssic, + & rla,rlo,len,kqcm,percrit,lgchek,me) +! +! set albedo over ocean to albomx +! + call albocn(albanl,slmask,albomx,len) +! +! quality control of snow and sea-ice +! process snow depth or snow cover +! + if(fnsnoa(1:8).ne.' ') then + call setzro(snoanl,epssno,len) + call qcsnow(snoanl,slmask,aisanl,glacir,len,ten,landice,me) + if (.not.landice) then + call snodpth2(glacir,snosmx,snoanl, len, me) + endif + kqcm=1 + call snosfc(snoanl,tsfanl,tsfsmx,len,me) + call qcmxmn('snoa ',snoanl,slianl,snoanl,icefl1, + & snolmx,snolmn,snoomx,snoomn,snoimx,snoimn, + & snojmx,snojmn,snosmx,snosmn,epssno, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call getscv(snoanl,scvanl,len) + call qcmxmn('sncva ',scvanl,slianl,snoanl,icefl1, + & scvlmx,scvlmn,scvomx,scvomn,scvimx,scvimn, + & scvjmx,scvjmn,scvsmx,scvsmn,epsscv, + & rla,rlo,len,kqcm,percrit,lgchek,me) + else + crit=0.5 + call rof01(scvanl,len,'ge',crit) + call qcsnow(scvanl,slmask,aisanl,glacir,len,one,landice,me) + call qcmxmn('sncva ',scvanl,slianl,scvanl,icefl1, + & scvlmx,scvlmn,scvomx,scvomn,scvimx,scvimn, + & scvjmx,scvjmn,scvsmx,scvsmn,epsscv, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call snodpth(scvanl,slianl,tsfanl,snoclm, + & glacir,snwmax,snwmin,landice,len,snoanl,me) + call qcsnow(scvanl,slmask,aisanl,glacir,len,snosmx,landice,me) + call snosfc(snoanl,tsfanl,tsfsmx,len,me) + call qcmxmn('snowa ',snoanl,slianl,snoanl,icefl1, + & snolmx,snolmn,snoomx,snoomn,snoimx,snoimn, + & snojmx,snojmn,snosmx,snosmn,epssno, + & rla,rlo,len,kqcm,percrit,lgchek,me) + endif +! + do i=1,len + icefl2(i) = sicanl(i) .gt. 0.99999 + enddo + call qcmxmn('tsfa ',tsfanl,slianl,snoanl,icefl2, + & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn, + & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf, + & rla,rlo,len,kqcm,percrit,lgchek,me) + do kk = 1, 4 + call qcmxmn('alba ',albanl(1,kk),slianl,snoanl,icefl1, + & alblmx,alblmn,albomx,albomn,albimx,albimn, + & albjmx,albjmn,albsmx,albsmn,epsalb, + & rla,rlo,len,kqcm,percrit,lgchek,me) + enddo + if(fnwetc(1:8).ne.' ' .or. fnweta(1:8).ne.' ' ) then + call qcmxmn('weta ',wetanl,slianl,snoanl,icefl1, + & wetlmx,wetlmn,wetomx,wetomn,wetimx,wetimn, + & wetjmx,wetjmn,wetsmx,wetsmn,epswet, + & rla,rlo,len,kqcm,percrit,lgchek,me) + endif + call qcmxmn('zora ',zoranl,slianl,snoanl,icefl1, + & zorlmx,zorlmn,zoromx,zoromn,zorimx,zorimn, + & zorjmx,zorjmn,zorsmx,zorsmn,epszor, + & rla,rlo,len,kqcm,percrit,lgchek,me) +! if(fnplrc(1:8).ne.' ' .or. fnplra(1:8).ne.' ' ) then +! call qcmxmn('plna ',plranl,slianl,snoanl,icefl1, +! & plrlmx,plrlmn,plromx,plromn,plrimx,plrimn, +! & plrjmx,plrjmn,plrsmx,plrsmn,epsplr, +! & rla,rlo,len,kqcm,percrit,lgchek,me) +! endif + call qcmxmn('tg3a ',tg3anl,slianl,snoanl,icefl1, + & tg3lmx,tg3lmn,tg3omx,tg3omn,tg3imx,tg3imn, + & tg3jmx,tg3jmn,tg3smx,tg3smn,epstg3, + & rla,rlo,len,kqcm,percrit,lgchek,me) +! +! get soil temp and moisture +! + if(fnsmca(1:8).eq.' ' .and. fnsmcc(1:8).eq.' ') then + call getsmc(wetanl,len,lsoil,smcanl,me) + endif + call qcmxmn('smc1a ',smcanl(1,1),slianl,snoanl,icefl1, + & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, + & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('smc2a ',smcanl(1,2),slianl,snoanl,icefl1, + & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, + & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!clu [+8l] add smcanl(3:4) + if(lsoil.gt.2) then + call qcmxmn('smc3a ',smcanl(1,3),slianl,snoanl,icefl1, + & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, + & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('smc4a ',smcanl(1,4),slianl,snoanl,icefl1, + & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, + & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + endif + if(fnstca(1:8).eq.' ') then + call getstc(tsfanl,tg3anl,slianl,len,lsoil,stcanl,tsfimx) + endif + call qcmxmn('stc1a ',stcanl(1,1),slianl,snoanl,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('stc2a ',stcanl(1,2),slianl,snoanl,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!clu [+8l] add stcanl(3:4) + if(lsoil.gt.2) then + call qcmxmn('stc3a ',stcanl(1,3),slianl,snoanl,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('stc4a ',stcanl(1,4),slianl,snoanl,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + endif + call qcmxmn('vega ',veganl,slianl,snoanl,icefl1, + & veglmx,veglmn,vegomx,vegomn,vegimx,vegimn, + & vegjmx,vegjmn,vegsmx,vegsmn,epsveg, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('veta ',vetanl,slianl,snoanl,icefl1, + & vetlmx,vetlmn,vetomx,vetomn,vetimx,vetimn, + & vetjmx,vetjmn,vetsmx,vetsmn,epsvet, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('sota ',sotanl,slianl,snoanl,icefl1, + & sotlmx,sotlmn,sotomx,sotomn,sotimx,sotimn, + & sotjmx,sotjmn,sotsmx,sotsmn,epssot, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!clu [+16l]---------------------------------------------------------------------- + call qcmxmn('vmna ',vmnanl,slianl,snoanl,icefl1, + & vmnlmx,vmnlmn,vmnomx,vmnomn,vmnimx,vmnimn, + & vmnjmx,vmnjmn,vmnsmx,vmnsmn,epsvmn, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('vmxa ',vmxanl,slianl,snoanl,icefl1, + & vmxlmx,vmxlmn,vmxomx,vmxomn,vmximx,vmximn, + & vmxjmx,vmxjmn,vmxsmx,vmxsmn,epsvmx, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('slpa ',slpanl,slianl,snoanl,icefl1, + & slplmx,slplmn,slpomx,slpomn,slpimx,slpimn, + & slpjmx,slpjmn,slpsmx,slpsmn,epsslp, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('absa ',absanl,slianl,snoanl,icefl1, + & abslmx,abslmn,absomx,absomn,absimx,absimn, + & absjmx,absjmn,abssmx,abssmn,epsabs, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!clu ---------------------------------------------------------------------------- +! +! monitoring prints +! + if (monanl) then + if (me .eq. 0) then + print *,' ' + print *,'monitor of time and space interpolated analysis' + print *,' ' +! call count(slianl,snoanl,len) + print *,' ' + call monitr('tsfanl',tsfanl,slianl,snoanl,len) + call monitr('albanl',albanl,slianl,snoanl,len) + call monitr('aisanl',aisanl,slianl,snoanl,len) + call monitr('snoanl',snoanl,slianl,snoanl,len) + call monitr('scvanl',scvanl,slianl,snoanl,len) + call monitr('smcanl1',smcanl(1,1),slianl,snoanl,len) + call monitr('smcanl2',smcanl(1,2),slianl,snoanl,len) + call monitr('stcanl1',stcanl(1,1),slianl,snoanl,len) + call monitr('stcanl2',stcanl(1,2),slianl,snoanl,len) +!clu [+4l] add smcanl(3:4) and stcanl(3:4) + if(lsoil.gt.2) then + call monitr('smcanl3',smcanl(1,3),slianl,snoanl,len) + call monitr('smcanl4',smcanl(1,4),slianl,snoanl,len) + call monitr('stcanl3',stcanl(1,3),slianl,snoanl,len) + call monitr('stcanl4',stcanl(1,4),slianl,snoanl,len) + endif + call monitr('tg3anl',tg3anl,slianl,snoanl,len) + call monitr('zoranl',zoranl,slianl,snoanl,len) +! if (gaus) then + call monitr('cvaanl',cvanl ,slianl,snoanl,len) + call monitr('cvbanl',cvbanl,slianl,snoanl,len) + call monitr('cvtanl',cvtanl,slianl,snoanl,len) +! endif + call monitr('slianl',slianl,slianl,snoanl,len) +! call monitr('plranl',plranl,slianl,snoanl,len) + call monitr('orog ',orog ,slianl,snoanl,len) + call monitr('veganl',veganl,slianl,snoanl,len) + call monitr('vetanl',vetanl,slianl,snoanl,len) + call monitr('sotanl',sotanl,slianl,snoanl,len) +!cwu [+2l] add sih, sic + call monitr('sihanl',sihanl,slianl,snoanl,len) + call monitr('sicanl',sicanl,slianl,snoanl,len) +!clu [+4l] add vmn, vmx, slp, abs + call monitr('vmnanl',vmnanl,slianl,snoanl,len) + call monitr('vmxanl',vmxanl,slianl,snoanl,len) + call monitr('slpanl',slpanl,slianl,snoanl,len) + call monitr('absanl',absanl,slianl,snoanl,len) + endif + + endif +! +! read in forecast fields if needed +! + if (me .eq. 0) then + write(6,*) '==============' + write(6,*) ' fcst guess' + write(6,*) '==============' + endif +! + percrit=critp2 +! + if(deads) then +! +! fill in guess array with analysis if dead start. +! + percrit=critp3 + if (me .eq. 0) write(6,*) 'this run is dead start run' + call filfcs(tsffcs,wetfcs,snofcs,zorfcs,albfcs, + & tg3fcs,cvfcs ,cvbfcs,cvtfcs, + & cnpfcs,smcfcs,stcfcs,slifcs,aisfcs, + & vegfcs,vetfcs,sotfcs,alffcs, +!cwu [+1l] add ()fcs for sih, sic + & sihfcs,sicfcs, +!clu [+1l] add ()fcs for vmn, vmx, slp, abs + & vmnfcs,vmxfcs,slpfcs,absfcs, + & tsfanl,wetanl,snoanl,zoranl,albanl, + & tg3anl,cvanl ,cvbanl,cvtanl, + & cnpanl,smcanl,stcanl,slianl,aisanl, + & veganl,vetanl,sotanl,alfanl, +!cwu [+1l] add ()anl for sih, sic + & sihanl,sicanl, +!clu [+1l] add ()anl for vmn, vmx, slp, abs + & vmnanl,vmxanl,slpanl,absanl, + & len,lsoil) + if(sig1t(1).ne.0.) then + call usesgt(sig1t,slianl,tg3anl,len,lsoil,tsffcs,stcfcs, + & tsfimx) + do i=1,len + icefl2(i) = sicfcs(i) .gt. 0.99999 + enddo + kqcm=1 + call qcmxmn('tsff ',tsffcs,slifcs,snofcs,icefl2, + & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn, + & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('stc1f ',stcfcs(1,1),slifcs,snofcs,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('stc2f ',stcfcs(1,2),slifcs,snofcs,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + endif + else + percrit=critp2 +! +! make reverse angulation correction to tsf +! make reverse orography correction to tg3 +! + if (use_ufo) then + orogd = orog - orog_uf +! +! The tiled version of the substrate temperature is properly +! adjusted to the terrain. Only invoke when using the old +! global tg3 grib file. +! + if ( index(fntg3c, "tileX.nc") == 0) then ! global file + ztsfc = 1.0 + call tsfcor(tg3fcs,orogd,slmask,ztsfc,len,-rlapse) + endif + ztsfc = 0. + call tsfcor(tsffcs,orogd,slmask,ztsfc,len,-rlapse) + else + ztsfc = 0. + call tsfcor(tsffcs,orog,slmask,ztsfc,len,-rlapse) + endif + +!clu [+12l] -------------------------------------------------------------- +! +! compute soil moisture liquid-to-total ratio over land +! + do j=1, lsoil + do i=1, len + if(smcfcs(i,j) .ne. 0.) then + swratio(i,j) = slcfcs(i,j)/smcfcs(i,j) + else + swratio(i,j) = -999. + endif + enddo + enddo +!clu ----------------------------------------------------------------------- +! + if(lqcbgs .and. irtacn .eq. 0) then + call qcsli(slianl,slifcs,len,me) + call albocn(albfcs,slmask,albomx,len) + do i=1,len + icefl2(i) = sicfcs(i) .gt. 0.99999 + enddo + kqcm=1 + call qcmxmn('snof ',snofcs,slifcs,snofcs,icefl1, + & snolmx,snolmn,snoomx,snoomn,snoimx,snoimn, + & snojmx,snojmn,snosmx,snosmn,epssno, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('tsff ',tsffcs,slifcs,snofcs,icefl2, + & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn, + & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf, + & rla,rlo,len,kqcm,percrit,lgchek,me) + do kk = 1, 4 + call qcmxmn('albf ',albfcs(1,kk),slifcs,snofcs,icefl1, + & alblmx,alblmn,albomx,albomn,albimx,albimn, + & albjmx,albjmn,albsmx,albsmn,epsalb, + & rla,rlo,len,kqcm,percrit,lgchek,me) + enddo + if(fnwetc(1:8).ne.' ' .or. fnweta(1:8).ne.' ' ) + & then + call qcmxmn('wetf ',wetfcs,slifcs,snofcs,icefl1, + & wetlmx,wetlmn,wetomx,wetomn,wetimx,wetimn, + & wetjmx,wetjmn,wetsmx,wetsmn,epswet, + & rla,rlo,len,kqcm,percrit,lgchek,me) + endif + call qcmxmn('zorf ',zorfcs,slifcs,snofcs,icefl1, + & zorlmx,zorlmn,zoromx,zoromn,zorimx,zorimn, + & zorjmx,zorjmn,zorsmx,zorsmn,epszor, + & rla,rlo,len,kqcm,percrit,lgchek,me) +! if(fnplrc(1:8).ne.' ' .or. fnplra(1:8).ne.' ' ) +! call qcmxmn('plnf ',plrfcs,slifcs,snofcs,icefl1, +! & plrlmx,plrlmn,plromx,plromn,plrimx,plrimn, +! & plrjmx,plrjmn,plrsmx,plrsmn,epsplr, +! & rla,rlo,len,kqcm,percrit,lgchek,me) +! endif + call qcmxmn('tg3f ',tg3fcs,slifcs,snofcs,icefl1, + & tg3lmx,tg3lmn,tg3omx,tg3omn,tg3imx,tg3imn, + & tg3jmx,tg3jmn,tg3smx,tg3smn,epstg3, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!cwu [+8l] --------------------------------------------------------------- + call qcmxmn('sihf ',sihfcs,slifcs,snofcs,icefl1, + & sihlmx,sihlmn,sihomx,sihomn,sihimx,sihimn, + & sihjmx,sihjmn,sihsmx,sihsmn,epssih, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('sicf ',sicfcs,slifcs,snofcs,icefl1, + & siclmx,siclmn,sicomx,sicomn,sicimx,sicimn, + & sicjmx,sicjmn,sicsmx,sicsmn,epssic, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('smc1f ',smcfcs(1,1),slifcs,snofcs,icefl1, + & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, + & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('smc2f ',smcfcs(1,2),slifcs,snofcs,icefl1, + & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, + & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!clu [+8l] add smcfcs(3:4) + if(lsoil.gt.2) then + call qcmxmn('smc3f ',smcfcs(1,3),slifcs,snofcs,icefl1, + & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, + & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('smc4f ',smcfcs(1,4),slifcs,snofcs,icefl1, + & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, + & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + endif + call qcmxmn('stc1f ',stcfcs(1,1),slifcs,snofcs,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('stc2f ',stcfcs(1,2),slifcs,snofcs,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!clu [+8l] add stcfcs(3:4) + if(lsoil.gt.2) then + call qcmxmn('stc3f ',stcfcs(1,3),slifcs,snofcs,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('stc4f ',stcfcs(1,4),slifcs,snofcs,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + endif + call qcmxmn('vegf ',vegfcs,slifcs,snofcs,icefl1, + & veglmx,veglmn,vegomx,vegomn,vegimx,vegimn, + & vegjmx,vegjmn,vegsmx,vegsmn,epsveg, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('vetf ',vetfcs,slifcs,snofcs,icefl1, + & vetlmx,vetlmn,vetomx,vetomn,vetimx,vetimn, + & vetjmx,vetjmn,vetsmx,vetsmn,epsvet, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('sotf ',sotfcs,slifcs,snofcs,icefl1, + & sotlmx,sotlmn,sotomx,sotomn,sotimx,sotimn, + & sotjmx,sotjmn,sotsmx,sotsmn,epssot, + & rla,rlo,len,kqcm,percrit,lgchek,me) + +!clu [+16l] --------------------------------------------------------------- + call qcmxmn('vmnf ',vmnfcs,slifcs,snofcs,icefl1, + & vmnlmx,vmnlmn,vmnomx,vmnomn,vmnimx,vmnimn, + & vmnjmx,vmnjmn,vmnsmx,vmnsmn,epsvmn, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('vmxf ',vmxfcs,slifcs,snofcs,icefl1, + & vmxlmx,vmxlmn,vmxomx,vmxomn,vmximx,vmximn, + & vmxjmx,vmxjmn,vmxsmx,vmxsmn,epsvmx, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('slpf ',slpfcs,slifcs,snofcs,icefl1, + & slplmx,slplmn,slpomx,slpomn,slpimx,slpimn, + & slpjmx,slpjmn,slpsmx,slpsmn,epsslp, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('absf ',absfcs,slifcs,snofcs,icefl1, + & abslmx,abslmn,absomx,absomn,absimx,absimn, + & absjmx,absjmn,abssmx,abssmn,epsabs, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!clu ----------------------------------------------------------------------- + endif + endif +! + if (monfcs) then + if (me .eq. 0) then + print *,' ' + print *,'monitor of guess' + print *,' ' +! call count(slifcs,snofcs,len) + print *,' ' + call monitr('tsffcs',tsffcs,slifcs,snofcs,len) + call monitr('albfcs',albfcs,slifcs,snofcs,len) + call monitr('aisfcs',aisfcs,slifcs,snofcs,len) + call monitr('snofcs',snofcs,slifcs,snofcs,len) + call monitr('smcfcs1',smcfcs(1,1),slifcs,snofcs,len) + call monitr('smcfcs2',smcfcs(1,2),slifcs,snofcs,len) + call monitr('stcfcs1',stcfcs(1,1),slifcs,snofcs,len) + call monitr('stcfcs2',stcfcs(1,2),slifcs,snofcs,len) +!clu [+4l] add smcfcs(3:4) and stcfcs(3:4) + if(lsoil.gt.2) then + call monitr('smcfcs3',smcfcs(1,3),slifcs,snofcs,len) + call monitr('smcfcs4',smcfcs(1,4),slifcs,snofcs,len) + call monitr('stcfcs3',stcfcs(1,3),slifcs,snofcs,len) + call monitr('stcfcs4',stcfcs(1,4),slifcs,snofcs,len) + endif + call monitr('tg3fcs',tg3fcs,slifcs,snofcs,len) + call monitr('zorfcs',zorfcs,slifcs,snofcs,len) +! if (gaus) then + call monitr('cvafcs',cvfcs ,slifcs,snofcs,len) + call monitr('cvbfcs',cvbfcs,slifcs,snofcs,len) + call monitr('cvtfcs',cvtfcs,slifcs,snofcs,len) +! endif + call monitr('slifcs',slifcs,slifcs,snofcs,len) +! call monitr('plrfcs',plrfcs,slifcs,snofcs,len) + call monitr('orog ',orog ,slifcs,snofcs,len) + call monitr('vegfcs',vegfcs,slifcs,snofcs,len) + call monitr('vetfcs',vetfcs,slifcs,snofcs,len) + call monitr('sotfcs',sotfcs,slifcs,snofcs,len) +!cwu [+2l] add sih, sic + call monitr('sihfcs',sihfcs,slifcs,snofcs,len) + call monitr('sicfcs',sicfcs,slifcs,snofcs,len) +!clu [+4l] add vmn, vmx, slp, abs + call monitr('vmnfcs',vmnfcs,slifcs,snofcs,len) + call monitr('vmxfcs',vmxfcs,slifcs,snofcs,len) + call monitr('slpfcs',slpfcs,slifcs,snofcs,len) + call monitr('absfcs',absfcs,slifcs,snofcs,len) + endif + endif +! +!... update annual cycle in the sst guess.. +! +! if(lprnt) print *,'tsfclm=',tsfclm(iprnt),' tsfcl2=',tsfcl2(iprnt) +! *,' tsffcs=',tsffcs(iprnt),' slianl=',slianl(iprnt) + + if (fh-deltsfc > -0.001 ) then + do i=1,len + if(slianl(i) == 0.0) then + tsffcs(i) = tsffcs(i) + (tsfclm(i) - tsfcl2(i)) + endif + enddo + endif +! +! quality control analysis using forecast guess +! + call qcbyfc(tsffcs,snofcs,qctsfs,qcsnos,qctsfi,len,lsoil, + & snoanl,aisanl,slianl,tsfanl,albanl, + & zoranl,smcanl, + & smcclm,tsfsmx,albomx,zoromx,me) +! +! blend climatology and predicted fields +! + if(me .eq. 0) then + write(6,*) '==============' + write(6,*) ' merging' + write(6,*) '==============' + endif +! if(lprnt) print *,' tsffcs=',tsffcs(iprnt) +! + percrit=critp3 +! +! merge analysis and forecast. note tg3, ais are not merged +! + call merge(len,lsoil,iy,im,id,ih,fh,deltsfc, + & sihfcs,sicfcs, + & vmnfcs,vmxfcs,slpfcs,absfcs, + & tsffcs,wetfcs,snofcs,zorfcs,albfcs,aisfcs, + & cvfcs ,cvbfcs,cvtfcs, + & cnpfcs,smcfcs,stcfcs,slifcs,vegfcs, + & vetfcs,sotfcs,alffcs, + & sihanl,sicanl, + & vmnanl,vmxanl,slpanl,absanl, + & tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl,aisanl, + & cvanl ,cvbanl,cvtanl, + & cnpanl,smcanl,stcanl,slianl,veganl, + & vetanl,sotanl,alfanl, + & ctsfl,calbl,caisl,csnol,csmcl,czorl,cstcl,cvegl, + & ctsfs,calbs,caiss,csnos,csmcs,czors,cstcs,cvegs, + & ccv,ccvb,ccvt,ccnp,cvetl,cvets,csotl,csots, + & calfl,calfs, + & csihl,csihs,csicl,csics, + & cvmnl,cvmns,cvmxl,cvmxs,cslpl,cslps,cabsl,cabss, + & irttsf,irtwet,irtsno,irtzor,irtalb,irtais, + & irttg3,irtscv,irtacn,irtsmc,irtstc,irtveg, + & irtvmn,irtvmx,irtslp,irtabs, + & irtvet,irtsot,irtalf,landice,me) + + call setzro(snoanl,epssno,len) + +! if(lprnt) print *,' tanlm=',tsfanl(iprnt),' tfcsm=',tsffcs(iprnt) +! if(lprnt) print *,' sliam=',slianl(iprnt),' slifm=',slifcs(iprnt) + +! +! new ice/melted ice +! + call newice(slianl,slifcs,tsfanl,tsffcs,len,lsoil, +!cwu [+1l] add sihnew, aislim, sihanl & sicanl + & sihnew,aislim,sihanl,sicanl, + & albanl,snoanl,zoranl,smcanl,stcanl, + & albomx,snoomx,zoromx,smcomx,smcimx, +!cwu [-1l/+1l] change albimx to albimn - note albimx & albimn have been modified +! & tsfomn,tsfimx,albimx,zorimx,tgice, + & tsfomn,tsfimx,albimn,zorimx,tgice, + & rla,rlo,me) + +! if(lprnt) print *,'tsfanl=',tsfanl(iprnt),' tsffcs=',tsffcs(iprnt) +! if(lprnt) print *,' slian=',slianl(iprnt),' slifn=',slifcs(iprnt) +! +! set tsfc to tsnow over snow +! + call snosfc(snoanl,tsfanl,tsfsmx,len,me) +! + do i=1,len + icefl2(i) = sicanl(i) .gt. 0.99999 + enddo + kqcm=0 + call qcmxmn('snowm ',snoanl,slianl,snoanl,icefl1, + & snolmx,snolmn,snoomx,snoomn,snoimx,snoimn, + & snojmx,snojmn,snosmx,snosmn,epssno, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('tsfm ',tsfanl,slianl,snoanl,icefl2, + & tsflmx,tsflmn,tsfomx,tsfomn,tsfimx,tsfimn, + & tsfjmx,tsfjmn,tsfsmx,tsfsmn,epstsf, + & rla,rlo,len,kqcm,percrit,lgchek,me) + do kk = 1, 4 + call qcmxmn('albm ',albanl(1,kk),slianl,snoanl,icefl1, + & alblmx,alblmn,albomx,albomn,albimx,albimn, + & albjmx,albjmn,albsmx,albsmn,epsalb, + & rla,rlo,len,kqcm,percrit,lgchek,me) + enddo + if(fnwetc(1:8).ne.' ' .or. fnweta(1:8).ne.' ' ) + & then + call qcmxmn('wetm ',wetanl,slianl,snoanl,icefl1, + & wetlmx,wetlmn,wetomx,wetomn,wetimx,wetimn, + & wetjmx,wetjmn,wetsmx,wetsmn,epswet, + & rla,rlo,len,kqcm,percrit,lgchek,me) + endif + call qcmxmn('zorm ',zoranl,slianl,snoanl,icefl1, + & zorlmx,zorlmn,zoromx,zoromn,zorimx,zorimn, + & zorjmx,zorjmn,zorsmx,zorsmn,epszor, + & rla,rlo,len,kqcm,percrit,lgchek,me) +! if(fnplrc(1:8).ne.' ' .or. fnplra(1:8).ne.' ' ) +! & then +! call qcmxmn('plntm ',plranl,slianl,snoanl,icefl1, +! & plrlmx,plrlmn,plromx,plromn,plrimx,plrimn, +! & plrjmx,plrjmn,plrsmx,plrsmn,epsplr, +! & rla,rlo,len,kqcm,percrit,lgchek,me) +! endif + call qcmxmn('stc1m ',stcanl(1,1),slianl,snoanl,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('stc2m ',stcanl(1,2),slianl,snoanl,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!clu [+8l] add stcanl(3:4) + if(lsoil.gt.2) then + call qcmxmn('stc3m ',stcanl(1,3),slianl,snoanl,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('stc4m ',stcanl(1,4),slianl,snoanl,icefl1, + & stclmx,stclmn,stcomx,stcomn,stcimx,stcimn, + & stcjmx,stcjmn,stcsmx,stcsmn,eptsfc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + endif + call qcmxmn('smc1m ',smcanl(1,1),slianl,snoanl,icefl1, + & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, + & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('smc2m ',smcanl(1,2),slianl,snoanl,icefl1, + & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, + & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!clu [+8l] add smcanl(3:4) + if(lsoil.gt.2) then + call qcmxmn('smc3m ',smcanl(1,3),slianl,snoanl,icefl1, + & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, + & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('smc4m ',smcanl(1,4),slianl,snoanl,icefl1, + & smclmx,smclmn,smcomx,smcomn,smcimx,smcimn, + & smcjmx,smcjmn,smcsmx,smcsmn,epssmc, + & rla,rlo,len,kqcm,percrit,lgchek,me) + endif + kqcm=1 + call qcmxmn('vegm ',veganl,slianl,snoanl,icefl1, + & veglmx,veglmn,vegomx,vegomn,vegimx,vegimn, + & vegjmx,vegjmn,vegsmx,vegsmn,epsveg, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('vetm ',vetanl,slianl,snoanl,icefl1, + & vetlmx,vetlmn,vetomx,vetomn,vetimx,vetimn, + & vetjmx,vetjmn,vetsmx,vetsmn,epsvet, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('sotm ',sotanl,slianl,snoanl,icefl1, + & sotlmx,sotlmn,sotomx,sotomn,sotimx,sotimn, + & sotjmx,sotjmn,sotsmx,sotsmn,epssot, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!cwu [+8l] add sih, sic, + call qcmxmn('sihm ',sihanl,slianl,snoanl,icefl1, + & sihlmx,sihlmn,sihomx,sihomn,sihimx,sihimn, + & sihjmx,sihjmn,sihsmx,sihsmn,epssih, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('sicm ',sicanl,slianl,snoanl,icefl1, + & siclmx,siclmn,sicomx,sicomn,sicimx,sicimn, + & sicjmx,sicjmn,sicsmx,sicsmn,epssic, + & rla,rlo,len,kqcm,percrit,lgchek,me) +!clu [+16l] add vmn, vmx, slp, abs + call qcmxmn('vmnm ',vmnanl,slianl,snoanl,icefl1, + & vmnlmx,vmnlmn,vmnomx,vmnomn,vmnimx,vmnimn, + & vmnjmx,vmnjmn,vmnsmx,vmnsmn,epsvmn, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('vmxm ',vmxanl,slianl,snoanl,icefl1, + & vmxlmx,vmxlmn,vmxomx,vmxomn,vmximx,vmximn, + & vmxjmx,vmxjmn,vmxsmx,vmxsmn,epsvmx, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('slpm ',slpanl,slianl,snoanl,icefl1, + & slplmx,slplmn,slpomx,slpomn,slpimx,slpimn, + & slpjmx,slpjmn,slpsmx,slpsmn,epsslp, + & rla,rlo,len,kqcm,percrit,lgchek,me) + call qcmxmn('absm ',absanl,slianl,snoanl,icefl1, + & abslmx,abslmn,absomx,absomn,absimx,absimn, + & absjmx,absjmn,abssmx,abssmn,epsabs, + & rla,rlo,len,kqcm,percrit,lgchek,me) + +! + if(me .eq. 0) then + write(6,*) '==============' + write(6,*) 'final results' + write(6,*) '==============' + endif +! +! foreward correction to tg3 and tsf at the last stage +! +! if(lprnt) print *,' tsfbc=',tsfanl(iprnt) + if (use_ufo) then +! +! The tiled version of the substrate temperature is properly +! adjusted to the terrain. Only invoke when using the old +! global tg3 grib file. +! + if ( index(fntg3c, "tileX.nc") == 0) then ! global file + ztsfc = 1. + call tsfcor(tg3anl,orogd,slmask,ztsfc,len,rlapse) + endif + ztsfc = 0. + call tsfcor(tsfanl,orogd,slmask,ztsfc,len,rlapse) + else + ztsfc = 0. + call tsfcor(tsfanl,orog,slmask,ztsfc,len,rlapse) + endif +! if(lprnt) print *,' tsfaf=',tsfanl(iprnt) +! +! check the final merged product +! + if (monmer) then + if(me .eq. 0) then + print *,' ' + print *,'monitor of updated surface fields' + print *,' (includes angulation correction)' + print *,' ' +! call count(slianl,snoanl,len) + print *,' ' + call monitr('tsfanl',tsfanl,slianl,snoanl,len) + call monitr('albanl',albanl,slianl,snoanl,len) + call monitr('aisanl',aisanl,slianl,snoanl,len) + call monitr('snoanl',snoanl,slianl,snoanl,len) + call monitr('smcanl1',smcanl(1,1),slianl,snoanl,len) + call monitr('smcanl2',smcanl(1,2),slianl,snoanl,len) + call monitr('stcanl1',stcanl(1,1),slianl,snoanl,len) + call monitr('stcanl2',stcanl(1,2),slianl,snoanl,len) +!clu [+4l] add smcanl(3:4) and stcanl(3:4) + if(lsoil.gt.2) then + call monitr('smcanl3',smcanl(1,3),slianl,snoanl,len) + call monitr('smcanl4',smcanl(1,4),slianl,snoanl,len) + call monitr('stcanl3',stcanl(1,3),slianl,snoanl,len) + call monitr('stcanl4',stcanl(1,4),slianl,snoanl,len) + call monitr('tg3anl',tg3anl,slianl,snoanl,len) + call monitr('zoranl',zoranl,slianl,snoanl,len) + endif +! if (gaus) then + call monitr('cvaanl',cvanl ,slianl,snoanl,len) + call monitr('cvbanl',cvbanl,slianl,snoanl,len) + call monitr('cvtanl',cvtanl,slianl,snoanl,len) +! endif + call monitr('slianl',slianl,slianl,snoanl,len) +! call monitr('plranl',plranl,slianl,snoanl,len) + call monitr('orog ',orog ,slianl,snoanl,len) + call monitr('cnpanl',cnpanl,slianl,snoanl,len) + call monitr('veganl',veganl,slianl,snoanl,len) + call monitr('vetanl',vetanl,slianl,snoanl,len) + call monitr('sotanl',sotanl,slianl,snoanl,len) +!cwu [+2l] add sih, sic, + call monitr('sihanl',sihanl,slianl,snoanl,len) + call monitr('sicanl',sicanl,slianl,snoanl,len) +!clu [+4l] add vmn, vmx, slp, abs + call monitr('vmnanl',vmnanl,slianl,snoanl,len) + call monitr('vmxanl',vmxanl,slianl,snoanl,len) + call monitr('slpanl',slpanl,slianl,snoanl,len) + call monitr('absanl',absanl,slianl,snoanl,len) + endif + endif +! + if (mondif) then + do i=1,len + tsffcs(i) = tsfanl(i) - tsffcs(i) + snofcs(i) = snoanl(i) - snofcs(i) + tg3fcs(i) = tg3anl(i) - tg3fcs(i) + zorfcs(i) = zoranl(i) - zorfcs(i) +! plrfcs(i) = plranl(i) - plrfcs(i) +! albfcs(i) = albanl(i) - albfcs(i) + slifcs(i) = slianl(i) - slifcs(i) + aisfcs(i) = aisanl(i) - aisfcs(i) + cnpfcs(i) = cnpanl(i) - cnpfcs(i) + vegfcs(i) = veganl(i) - vegfcs(i) + vetfcs(i) = vetanl(i) - vetfcs(i) + sotfcs(i) = sotanl(i) - sotfcs(i) +!clu [+2l] add sih, sic + sihfcs(i) = sihanl(i) - sihfcs(i) + sicfcs(i) = sicanl(i) - sicfcs(i) +!clu [+4l] add vmn, vmx, slp, abs + vmnfcs(i) = vmnanl(i) - vmnfcs(i) + vmxfcs(i) = vmxanl(i) - vmxfcs(i) + slpfcs(i) = slpanl(i) - slpfcs(i) + absfcs(i) = absanl(i) - absfcs(i) + enddo + do j = 1,lsoil + do i = 1,len + smcfcs(i,j) = smcanl(i,j) - smcfcs(i,j) + stcfcs(i,j) = stcanl(i,j) - stcfcs(i,j) + enddo + enddo + do j = 1,4 + do i = 1,len + albfcs(i,j) = albanl(i,j) - albfcs(i,j) + enddo + enddo +! +! monitoring prints +! + if(me .eq. 0) then + print *,' ' + print *,'monitor of difference' + print *,' (includes angulation correction)' + print *,' ' + call monitr('tsfdif',tsffcs,slianl,snoanl,len) + call monitr('albdif',albfcs,slianl,snoanl,len) + call monitr('albdif1',albfcs,slianl,snoanl,len) + call monitr('albdif2',albfcs(1,2),slianl,snoanl,len) + call monitr('albdif3',albfcs(1,3),slianl,snoanl,len) + call monitr('albdif4',albfcs(1,4),slianl,snoanl,len) + call monitr('aisdif',aisfcs,slianl,snoanl,len) + call monitr('snodif',snofcs,slianl,snoanl,len) + call monitr('smcanl1',smcfcs(1,1),slianl,snoanl,len) + call monitr('smcanl2',smcfcs(1,2),slianl,snoanl,len) + call monitr('stcanl1',stcfcs(1,1),slianl,snoanl,len) + call monitr('stcanl2',stcfcs(1,2),slianl,snoanl,len) +!clu [+4l] add smcfcs(3:4) and stc(3:4) + if(lsoil.gt.2) then + call monitr('smcanl3',smcfcs(1,3),slianl,snoanl,len) + call monitr('smcanl4',smcfcs(1,4),slianl,snoanl,len) + call monitr('stcanl3',stcfcs(1,3),slianl,snoanl,len) + call monitr('stcanl4',stcfcs(1,4),slianl,snoanl,len) + endif + call monitr('tg3dif',tg3fcs,slianl,snoanl,len) + call monitr('zordif',zorfcs,slianl,snoanl,len) +! if (gaus) then + call monitr('cvadif',cvfcs ,slianl,snoanl,len) + call monitr('cvbdif',cvbfcs,slianl,snoanl,len) + call monitr('cvtdif',cvtfcs,slianl,snoanl,len) +! endif + call monitr('slidif',slifcs,slianl,snoanl,len) +! call monitr('plrdif',plrfcs,slianl,snoanl,len) + call monitr('cnpdif',cnpfcs,slianl,snoanl,len) + call monitr('vegdif',vegfcs,slianl,snoanl,len) + call monitr('vetdif',vetfcs,slianl,snoanl,len) + call monitr('sotdif',sotfcs,slianl,snoanl,len) +!cwu [+2l] add sih, sic + call monitr('sihdif',sihfcs,slianl,snoanl,len) + call monitr('sicdif',sicfcs,slianl,snoanl,len) +!clu [+4l] add vmn, vmx, slp, abs + call monitr('vmndif',vmnfcs,slianl,snoanl,len) + call monitr('vmxdif',vmxfcs,slianl,snoanl,len) + call monitr('slpdif',slpfcs,slianl,snoanl,len) + call monitr('absdif',absfcs,slianl,snoanl,len) + endif + endif +! +! + do i=1,len + tsffcs(i) = tsfanl(i) + snofcs(i) = snoanl(i) + tg3fcs(i) = tg3anl(i) + zorfcs(i) = zoranl(i) +! plrfcs(i) = plranl(i) +! albfcs(i) = albanl(i) + slifcs(i) = slianl(i) + aisfcs(i) = aisanl(i) + cvfcs(i) = cvanl(i) + cvbfcs(i) = cvbanl(i) + cvtfcs(i) = cvtanl(i) + cnpfcs(i) = cnpanl(i) + vegfcs(i) = veganl(i) + vetfcs(i) = vetanl(i) + sotfcs(i) = sotanl(i) +!clu [+4l] add vmn, vmx, slp, abs + vmnfcs(i) = vmnanl(i) + vmxfcs(i) = vmxanl(i) + slpfcs(i) = slpanl(i) + absfcs(i) = absanl(i) + enddo + do j = 1,lsoil + do i = 1,len + smcfcs(i,j) = smcanl(i,j) + if (slifcs(i) .gt. 0.0) then + stcfcs(i,j) = stcanl(i,j) + else + stcfcs(i,j) = tsffcs(i) + endif + enddo + enddo + do j = 1,4 + do i = 1,len + albfcs(i,j) = albanl(i,j) + enddo + enddo + do j = 1,2 + do i = 1,len + alffcs(i,j) = alfanl(i,j) + enddo + enddo + +!cwu [+20l] update sihfcs, sicfcs. remove sea ice over non-ice points + crit=aislim + do i=1,len + sihfcs(i) = sihanl(i) + sitfcs(i) = tsffcs(i) + if (slifcs(i).ge.2.) then + if (sicfcs(i).gt.crit) then + tsffcs(i) = (sicanl(i)*tsffcs(i) + & + (sicfcs(i)-sicanl(i))*tgice)/sicfcs(i) + sitfcs(i) = (tsffcs(i)-tgice*(1.0-sicfcs(i))) / sicfcs(i) + else + tsffcs(i) = tsfanl(i) +! tsffcs(i) = tgice + sihfcs(i) = sihnew + endif + endif + sicfcs(i) = sicanl(i) + enddo + do i=1,len + if (slifcs(i).lt.1.5) then + sihfcs(i) = 0. + sicfcs(i) = 0. + sitfcs(i) = tsffcs(i) + else if ((slifcs(i).ge.1.5).and.(sicfcs(i).lt.crit)) then + print *,'warning: check, slifcs and sicfcs', + & slifcs(i),sicfcs(i) + endif + enddo + +! +! ensure the consistency between slc and smc +! + do k=1, lsoil + fixratio(k) = .false. + if (fsmcl(k).lt.99999.) fixratio(k) = .true. + enddo + + if(me .eq. 0) then + print *,'dbgx --fixratio:',(fixratio(k),k=1,lsoil) + endif + + do k=1, lsoil + if(fixratio(k)) then + do i = 1, len + if(swratio(i,k) .eq. -999.) then + slcfcs(i,k) = smcfcs(i,k) + else + slcfcs(i,k) = swratio(i,k) * smcfcs(i,k) + endif + if (slifcs(i) .ne. 1.0) slcfcs(i,k) = 1.0 ! flag value for non-land points. + enddo + endif + enddo +! set liquid soil moisture to a flag value of 1.0 + if (landice) then + do i = 1, len + if (slifcs(i) .eq. 1.0 .and. + & nint(vetfcs(i)) == veg_type_landice) then + do k=1, lsoil + slcfcs(i,k) = 1.0 + enddo + endif + enddo + end if +! +! ensure the consistency between snwdph and sheleg +! + if(fsnol .lt. 99999.) then + if(me .eq. 0) then + print *,'dbgx -- scale snwdph from sheleg' + endif + do i = 1, len + if(slifcs(i).eq.1.) swdfcs(i) = 10.* snofcs(i) + enddo + endif + +! sea ice model only uses the liquid equivalent depth. +! so update the physical depth only for display purposes. +! use the same 3:1 ratio used by ice model. + + do i = 1, len + if (slifcs(i).ne.1) swdfcs(i) = 3.*snofcs(i) + enddo + + do i = 1, len + if(slifcs(i).eq.1.) then + if(snofcs(i).ne.0. .and. swdfcs(i).eq.0.) then + print *,'dbgx --scale snwdph from sheleg', + + i, swdfcs(i), snofcs(i) + swdfcs(i) = 10.* snofcs(i) + endif + endif + enddo +! landice mods - impose same minimum snow depth at +! landice as noah lsm. also ensure +! lower thermal boundary condition +! and skin t is no warmer than freezing +! after adjustment to terrain. + if (landice) then + do i = 1, len + if (slifcs(i) .eq. 1.0 .and. + & nint(vetfcs(i)) == veg_type_landice) then + snofcs(i) = max(snofcs(i),100.0) ! in mm + swdfcs(i) = max(swdfcs(i),1000.0) ! in mm + tg3fcs(i) = min(tg3fcs(i),273.15) + tsffcs(i) = min(tsffcs(i),273.15) + endif + enddo + end if +! +! if(lprnt) print *,' tsffcsf=',tsffcs(iprnt) + return + end subroutine sfccycle + +!>\ingroup mod_sfcsub +!! This subroutine counts number of points for the four surface +!! conditions. + subroutine count(slimsk,sno,ijmax) + use machine , only : kind_io8,kind_io4 + implicit none + real (kind=kind_io8) rl3,rl1,rl0,rl2,rl6,rl7,rl4,rl5 + integer l8,l7,l1,l2,ijmax,l0,l3,l5,l6,l4,ij +! + real (kind=kind_io8) slimsk(1),sno(1) +! +! count number of points for the four surface conditions +! + l0 = 0 + l1 = 0 + l2 = 0 + l3 = 0 + l4 = 0 + do ij=1,ijmax + if(slimsk(ij).eq.0.) l1 = l1 + 1 + if(slimsk(ij).eq.1. .and. sno(ij).le.0.) l0 = l0 + 1 + if(slimsk(ij).eq.2. .and. sno(ij).le.0.) l2 = l2 + 1 + if(slimsk(ij).eq.1. .and. sno(ij).gt.0.) l3 = l3 + 1 + if(slimsk(ij).eq.2. .and. sno(ij).gt.0.) l4 = l4 + 1 + enddo + l5 = l0 + l3 + l6 = l2 + l4 + l7 = l1 + l6 + l8 = l1 + l5 + l6 + rl0 = float(l0) / float(l8)*100. + rl3 = float(l3) / float(l8)*100. + rl1 = float(l1) / float(l8)*100. + rl2 = float(l2) / float(l8)*100. + rl4 = float(l4) / float(l8)*100. + rl5 = float(l5) / float(l8)*100. + rl6 = float(l6) / float(l8)*100. + rl7 = float(l7) / float(l8)*100. + print *,'1) no. of not snow-covered land points ',l0,' ',rl0,' ' + print *,'2) no. of snow covered land points ',l3,' ',rl3,' ' + print *,'3) no. of open sea points ',l1,' ',rl1,' ' + print *,'4) no. of not snow-covered seaice points ',l2,' ',rl2,' ' + print *,'5) no. of snow covered sea ice points ',l4,' ',rl4,' ' + print *,' ' + print *,'6) no. of land points ',l5,' ',rl5,' ' + print *,'7) no. sea points (including sea ice) ',l7,' ',rl7,' ' + print *,' (no. of sea ice points) (',l6,')',' ',rl6,' ' + print *,' ' + print *,'9) no. of total grid points ',l8 +! print *,' ' +! print *,' ' + +! +! if(lprnt) print *,' tsffcsf=',tsffcs(iprnt) + return + end + +!>\ingroup mod_sfcsub + subroutine monitr(lfld,fld,slimsk,sno,ijmax) + use machine , only : kind_io8,kind_io4 + implicit none + integer ij,n,ijmax +! + real (kind=kind_io8) fld(ijmax), slimsk(ijmax),sno(ijmax) +! + real (kind=kind_io8) rmax(5),rmin(5) + character(len=*) lfld +! +! find max/min +! + do n=1,5 + rmax(n) = -9.e20 + rmin(n) = 9.e20 + enddo +! + do ij=1,ijmax + if(slimsk(ij).eq.0.) then + rmax(1) = max(rmax(1), fld(ij)) + rmin(1) = min(rmin(1), fld(ij)) + elseif(slimsk(ij).eq.1.) then + if(sno(ij).le.0.) then + rmax(2) = max(rmax(2), fld(ij)) + rmin(2) = min(rmin(2), fld(ij)) + else + rmax(4) = max(rmax(4), fld(ij)) + rmin(4) = min(rmin(4), fld(ij)) + endif + else + if(sno(ij).le.0.) then + rmax(3) = max(rmax(3), fld(ij)) + rmin(3) = min(rmin(3), fld(ij)) + else + rmax(5) = max(rmax(5), fld(ij)) + rmin(5) = min(rmin(5), fld(ij)) + endif + endif + enddo +! + print 100,lfld + print 101,rmax(1),rmin(1) + print 102,rmax(2),rmin(2), rmax(4), rmin(4) + print 103,rmax(3),rmin(3), rmax(5), rmin(5) +! +! print 102,rmax(2),rmin(2) +! print 103,rmax(3),rmin(3) +! print 104,rmax(4),rmin(4) +! print 105,rmax(5),rmin(5) + 100 format('0 *** ',a8,' ***') + 101 format(' open sea ......... max=',e12.4,' min=',e12.4) + 102 format(' land nosnow/snow .. max=',e12.4,' min=',e12.4 + &, ' max=',e12.4,' min=',e12.4) + 103 format(' seaice nosnow/snow max=',e12.4,' min=',e12.4 + &, ' max=',e12.4,' min=',e12.4) +! +! 100 format('0',2x,'*** ',a8,' ***') +! 102 format(2x,' land without snow ..... max=',e12.4,' min=',e12.4) +! 103 format(2x,' seaice without snow ... max=',e12.4,' min=',e12.4) +! 104 format(2x,' land with snow ........ max=',e12.4,' min=',e12.4) +! 105 format(2x,' sea ice with snow ..... max=',e12.4,' min=',e12.4) +! + return + end + +!>\ingroup mod_sfcsub +!! This subroutine figures out the day of the year given imo and idy. + subroutine dayoyr(iyr,imo,idy,ldy) + implicit none + integer ldy,i,idy,iyr,imo +! +! this routine figures out the day of the year given imo and idy +! + integer month(13) + data month/0,31,28,31,30,31,30,31,31,30,31,30,31/ + if(mod(iyr,4).eq.0) month(3) = 29 + ldy = idy + do i = 1, imo + ldy = ldy + month(i) + enddo + return + end + +!>\ingroup mod_sfcsub + subroutine hmskrd(lugb,imsk,jmsk,fnmskh, + & kpds5,slmskh,gausm,blnmsk,bltmsk,me) + use machine , only : kind_io8,kind_io4 + use sfccyc_module, only : mdata, xdata, ydata + implicit none + integer kpds5,me,i,imsk,jmsk,lugb +! + character*500 fnmskh +! + real (kind=kind_io8) slmskh(mdata) + logical gausm + real (kind=kind_io8) blnmsk,bltmsk +! + imsk = xdata + jmsk = ydata + + if (me .eq. 0) then + write(6,*)' imsk=',imsk,' jmsk=',jmsk,' xdata=',xdata,' ydata=' + &, ydata + endif + + call fixrdg(lugb,imsk,jmsk,fnmskh, + & kpds5,slmskh,gausm,blnmsk,bltmsk,me) + +! print *,'in sfc_sub, aft fixrdg,slmskh=',maxval(slmskh), +! & minval(slmskh),'mdata=',mdata,'imsk*jmsk=',imsk*jmsk + + do i=1,imsk*jmsk + slmskh(i) = nint(slmskh(i)) + enddo +! + return + end + +!>\ingroup mod_sfcsub + subroutine fixrdg(lugb,idim,jdim,fngrib, + & kpds5,gdata,gaus,blno,blto,me) + use machine , only : kind_io8,kind_io4 + use sfccyc_module, only : mdata + implicit none + integer lgrib,n,lskip,jret,j,ndata,lugi,jdim,idim,lugb, + & iret, me,kpds5,kdata,i,w3kindreal,w3kindint +! + character*(*) fngrib +! + real (kind=kind_io8) gdata(idim*jdim) + logical gaus + real (kind=kind_io8) blno,blto + real (kind=kind_io8), allocatable :: data8(:) + real (kind=kind_io4), allocatable :: data4(:) +! + logical*1, allocatable :: lbms(:) +! + integer kpds(200),kgds(200) + integer jpds(200),jgds(200), kpds0(200) +! + allocate(data8(1:idim*jdim)) + allocate(lbms(1:mdata)) + kpds = 0 + kgds = 0 + jpds = 0 + jgds = 0 + kpds0 = 0 +! +! if(me .eq. 0) then +! write(6,*) ' ' +! write(6,*) '************************************************' +! endif +! + close(lugb) + call baopenr(lugb,fngrib,iret) + if (iret .ne. 0) then + write(6,*) ' error in opening file ',trim(fngrib) + print *,'error in opening file ',trim(fngrib) + call abort + endif + if (me .eq. 0) write(6,*) ' file ',trim(fngrib), + & ' opened. unit=',lugb + lugi = 0 + lskip = -1 + n = 0 + jpds = -1 + jgds = -1 + jpds(5) = kpds5 + kpds = jpds +! + call getgbh(lugb,lugi,lskip,jpds,jgds,lgrib,ndata, + & lskip,kpds,kgds,iret) +! + if(me .eq. 0) then + write(6,*) ' first grib record.' + write(6,*) ' kpds( 1-10)=',(kpds(j),j= 1,10) + write(6,*) ' kpds(11-20)=',(kpds(j),j=11,20) + write(6,*) ' kpds(21- )=',(kpds(j),j=21,22) + endif +! + kpds0=jpds + kpds0(4)=-1 + kpds0(18)=-1 + if(iret.ne.0) then + write(6,*) ' error in getgbh. iret: ', iret + if (iret == 99) write(6,*) ' field not found.' + call abort + endif +! + jpds = kpds0 + lskip = -1 + kdata=idim*jdim + call w3kind(w3kindreal,w3kindint) + if (w3kindreal == 8) then + call getgb(lugb,lugi,kdata,lskip,jpds,jgds,ndata,lskip, + & kpds,kgds,lbms,data8,jret) + else if (w3kindreal == 4) then + allocate(data4(1:idim*jdim)) + call getgb(lugb,lugi,kdata,lskip,jpds,jgds,ndata,lskip, + & kpds,kgds,lbms,data4,jret) + data8 = real(data4, kind=kind_io8) + deallocate(data4) + else + write(0,*)' Invalid w3kindreal --- aborting' + call abort + endif +! + if(jret == 0) then + if(ndata.eq.0) then + write(6,*) ' error in getgb' + write(6,*) ' kpds=',kpds + write(6,*) ' kgds=',kgds + call abort + endif + idim = kgds(2) + jdim = kgds(3) + gaus = kgds(1).eq.4 + blno = kgds(5)*1.d-3 + blto = kgds(4)*1.d-3 + gdata(1:idim*jdim) = data8(1:idim*jdim) + if (me == 0) write(6,*) 'idim,jdim=',idim,jdim + &, ' gaus=',gaus,' blno=',blno,' blto=',blto + else + if (me ==. 0) write(6,*) 'idim,jdim=',idim,jdim + &, ' gaus=',gaus,' blno=',blno,' blto=',blto + write(6,*) ' error in getgb : jret=',jret + write(6,*) ' kpds(13)=',kpds(13),' kpds(15)=',kpds(15) + call abort + endif +! + deallocate(data8) + deallocate(lbms) + return + end + +!>\ingroup mod_sfcsub +!! This subroutine get area of the grib record. + subroutine getarea(kgds,dlat,dlon,rslat,rnlat,wlon,elon,ijordr + &, me) + use machine , only : kind_io8,kind_io4 + implicit none + integer j,me,kgds11 + real (kind=kind_io8) f0lon,f0lat,elon,dlon,dlat,rslat,wlon,rnlat +! +! get area of the grib record +! + integer kgds(22) + logical ijordr +! + if (me .eq. 0) then + write(6,*) ' kgds( 1-12)=',(kgds(j),j= 1,12) + write(6,*) ' kgds(13-22)=',(kgds(j),j=13,22) + endif +! + if(kgds(1).eq.0) then ! lat/lon grid +! + if (me .eq. 0) write(6,*) 'lat/lon grid' + dlat = float(kgds(10)) * 0.001 + dlon = float(kgds( 9)) * 0.001 + f0lon = float(kgds(5)) * 0.001 + f0lat = float(kgds(4)) * 0.001 + kgds11 = kgds(11) + if(kgds11.ge.128) then + wlon = f0lon - dlon*(kgds(2)-1) + elon = f0lon + if(dlon*kgds(2).gt.359.99) then + wlon =f0lon - dlon*kgds(2) + endif + dlon = -dlon + kgds11 = kgds11 - 128 + else + wlon = f0lon + elon = f0lon + dlon*(kgds(2)-1) + if(dlon*kgds(2).gt.359.99) then + elon = f0lon + dlon*kgds(2) + endif + endif + if(kgds11.ge.64) then + rnlat = f0lat + dlat*(kgds(3)-1) + rslat = f0lat + kgds11 = kgds11 - 64 + else + rnlat = f0lat + rslat = f0lat - dlat*(kgds(3)-1) + dlat = -dlat + endif + if(kgds11.ge.32) then + ijordr = .false. + else + ijordr = .true. + endif + + if(wlon.gt.180.) wlon = wlon - 360. + if(elon.gt.180.) elon = elon - 360. + wlon = nint(wlon*1000.) * 0.001 + elon = nint(elon*1000.) * 0.001 + rslat = nint(rslat*1000.) * 0.001 + rnlat = nint(rnlat*1000.) * 0.001 + return +! + elseif(kgds(1).eq.1) then ! mercator projection + write(6,*) 'mercator grid' + write(6,*) 'cannot process' + call abort +! + elseif(kgds(1).eq.2) then ! gnomonic projection + write(6,*) 'gnomonic grid' + write(6,*) 'error!! gnomonic projection not coded' + call abort +! + elseif(kgds(1).eq.3) then ! lambert conformal + write(6,*) 'lambert conformal' + write(6,*) 'cannot process' + call abort + elseif(kgds(1).eq.4) then ! gaussian grid +! + if (me .eq. 0) write(6,*) 'gaussian grid' + dlat = 99. + dlon = float(kgds( 9)) / 1000.0 + f0lon = float(kgds(5)) / 1000.0 + f0lat = 99. + kgds11 = kgds(11) + if(kgds11.ge.128) then + wlon = f0lon + elon = f0lon + if(dlon*kgds(2).gt.359.99) then + wlon = f0lon - dlon*kgds(2) + endif + dlon = -dlon + kgds11 = kgds11-128 + else + wlon = f0lon + elon = f0lon + dlon*(kgds(2)-1) + if(dlon*kgds(2).gt.359.99) then + elon = f0lon + dlon*kgds(2) + endif + endif + if(kgds11.ge.64) then + rnlat = 99. + rslat = 99. + kgds11 = kgds11 - 64 + else + rnlat = 99. + rslat = 99. + dlat = -99. + endif + if(kgds11.ge.32) then + ijordr = .false. + else + ijordr = .true. + endif + return +! + elseif(kgds(1).eq.5) then ! polar strereographic + write(6,*) 'polar stereographic grid' + write(6,*) 'cannot process' + call abort + return +! + elseif(kgds(1).eq.13) then ! oblique lambert conformal + write(6,*) 'oblique lambert conformal grid' + write(6,*) 'cannot process' + call abort +! + elseif(kgds(1).eq.50) then ! spherical coefficient + write(6,*) 'spherical coefficient' + write(6,*) 'cannot process' + call abort + return +! + elseif(kgds(1).eq.90) then ! space view perspective +! (orthographic grid) + write(6,*) 'space view perspective grid' + write(6,*) 'cannot process' + call abort + return +! + else ! unknown projection. abort. + write(6,*) 'error!! unknown map projection' + write(6,*) 'kgds(1)=',kgds(1) + print *,'error!! unknown map projection' + print *,'kgds(1)=',kgds(1) + call abort + endif +! + return + end + +!>\ingroup mod_sfcsub + subroutine subst(data,imax,jmax,dlon,dlat,ijordr) + use machine , only : kind_io8,kind_io4 + implicit none + integer i,j,ii,jj,jmax,imax,iret + real (kind=kind_io8) dlat,dlon +! + logical ijordr +! + real (kind=kind_io8) data(imax,jmax) + real (kind=kind_io8), allocatable :: work(:,:) +! + if(.not.ijordr.or. + & (ijordr.and.(dlat.gt.0..or.dlon.lt.0.))) then + allocate (work(imax,jmax)) + + if(.not.ijordr) then + do j=1,jmax + do i=1,imax + work(i,j) = data(j,i) + enddo + enddo + else + do j=1,jmax + do i=1,imax + work(i,j) = data(i,j) + enddo + enddo + endif + if (dlat > 0.0) then + if (dlon > 0.0) then + do j=1,jmax + jj = jmax - j + 1 + do i=1,imax + data(i,jj) = work(i,j) + enddo + enddo + else + do i=1,imax + data(imax-i+1,jj) = work(i,j) + enddo + endif + else + if (dlon > 0.0) then + do j=1,jmax + do i=1,imax + data(i,j) = work(i,j) + enddo + enddo + else + do j=1,jmax + do i=1,imax + data(imax-i+1,j) = work(i,j) + enddo + enddo + endif + endif + deallocate (work, stat=iret) + endif + return + end + +!>\ingroup mod_sfcsub +!! This subroutine conducts interpolation from lat/lon to Gaussian +!! grid to other lat/lon grid. + subroutine la2ga(regin,imxin,jmxin,rinlon,rinlat,rlon,rlat,inttyp, + & gauout,len,lmask,rslmsk,slmask + &, outlat, outlon,me) + use machine , only : kind_io8,kind_io4 + implicit none + real (kind=kind_io8) wei4,wei3,wei2,sum2,sum1,sum3,wei1,sum4, + & wsum,tem,wsumiv,sums,sumn,wi2j2,x,y,wi1j1, + & wi1j2,wi2j1,rlat,rlon,aphi, + & rnume,alamd,denom + integer jy,ifills,ix,len,inttyp,me,i,j,jmxin,imxin,jq,jx,j1,j2, + & ii,i1,i2,kmami,it + integer nx,kxs,kxt + integer, allocatable, save :: imxnx(:) + integer, allocatable :: ifill(:) +! +! interpolation from lat/lon or gaussian grid to other lat/lon grid +! + real (kind=kind_io8) outlon(len),outlat(len),gauout(len), + & slmask(len) + real (kind=kind_io8) regin (imxin,jmxin),rslmsk(imxin,jmxin) +! + real (kind=kind_io8) rinlat(jmxin), rinlon(imxin) + integer iindx1(len), iindx2(len) + integer jindx1(len), jindx2(len) + real (kind=kind_io8) ddx(len), ddy(len), wrk(len) +! + logical lmask +! + logical first + integer num_threads + data first /.true./ + save num_threads, first +! + integer len_thread_m, len_thread, i1_t, i2_t + integer num_parthds +! + if (first) then + num_threads = num_parthds() + first = .false. + if (.not. allocated(imxnx)) allocate (imxnx(num_threads)) + endif +! +! if (me == 0) print *,' num_threads =',num_threads,' me=',me +! +! if(me .eq. 0) then +! print *,'rlon=',rlon,' me=',me +! print *,'rlat=',rlat,' me=',me,' imxin=',imxin,' jmxin=',jmxin +! endif +! +! do j=1,jmxin +! if(rlat.gt.0.) then +! rinlat(j) = rlat - float(j-1)*dlain +! else +! rinlat(j) = rlat + float(j-1)*dlain +! endif +! enddo +! +! if (me .eq. 0) then +! print *,'rinlat=' +! print *,(rinlat(j),j=1,jmxin) +! print *,'rinlon=' +! print *,(rinlon(i),i=1,imxin) +! +! print *,'outlat=' +! print *,(outlat(j),j=1,len) +! print *,(outlon(j),j=1,len) +! endif +! +! do i=1,imxin +! rinlon(i) = rlon + float(i-1)*dloin +! enddo +! +! print *,'rinlon=' +! print *,(rinlon(i),i=1,imxin) +! + len_thread_m = (len+num_threads-1) / num_threads + + if (inttyp /=1) allocate (ifill(num_threads)) +! +!$omp parallel do default(none) +!$omp+private(i1_t,i2_t,len_thread,it,i,ii,i1,i2) +!$omp+private(j,j1,j2,jq,ix,jy,nx,kxs,kxt,kmami) +!$omp+private(alamd,denom,rnume,aphi,x,y,wsum,wsumiv,sum1,sum2) +!$omp+private(sum3,sum4,wi1j1,wi2j1,wi1j2,wi2j2,wei1,wei2,wei3,wei4) +!$omp+private(sumn,sums) +!$omp+shared(imxin,jmxin,ifill) +!$omp+shared(outlon,outlat,wrk,iindx1,rinlon,jindx1,rinlat,ddx,ddy) +!$omp+shared(rlon,rlat,regin,gauout,imxnx) +!$omp+private(tem) +!$omp+shared(num_threads,len_thread_m,len,lmask,iindx2,jindx2,rslmsk) +!$omp+shared(inttyp,me,slmask) +! + do it=1,num_threads ! start of threaded loop ................... + i1_t = (it-1)*len_thread_m+1 + i2_t = min(i1_t+len_thread_m-1,len) + len_thread = i2_t-i1_t+1 +! +! find i-index for interpolation +! + do i=i1_t, i2_t + alamd = outlon(i) + if (alamd .lt. rlon) alamd = alamd + 360.0 + if (alamd .gt. 360.0+rlon) alamd = alamd - 360.0 + wrk(i) = alamd + iindx1(i) = imxin + enddo + do i=i1_t,i2_t + do ii=1,imxin + if(wrk(i) .ge. rinlon(ii)) iindx1(i) = ii + enddo + enddo + do i=i1_t,i2_t + i1 = iindx1(i) + if (i1 .lt. 1) i1 = imxin + i2 = i1 + 1 + if (i2 .gt. imxin) i2 = 1 + iindx1(i) = i1 + iindx2(i) = i2 + denom = rinlon(i2) - rinlon(i1) + if(denom.lt.0.) denom = denom + 360. + rnume = wrk(i) - rinlon(i1) + if(rnume.lt.0.) rnume = rnume + 360. + ddx(i) = rnume / denom + enddo +! +! find j-index for interplation +! + if(rlat.gt.0.) then + do j=i1_t,i2_t + jindx1(j)=0 + enddo + do jx=1,jmxin + do j=i1_t,i2_t + if(outlat(j).le.rinlat(jx)) jindx1(j) = jx + enddo + enddo + do j=i1_t,i2_t + jq = jindx1(j) + aphi=outlat(j) + if(jq.ge.1 .and. jq .lt. jmxin) then + j2=jq+1 + j1=jq + ddy(j)=(aphi-rinlat(j1))/(rinlat(j2)-rinlat(j1)) + elseif (jq .eq. 0) then + j2=1 + j1=1 + if(abs(90.-rinlat(j1)).gt.0.001) then + ddy(j)=(aphi-rinlat(j1))/(90.-rinlat(j1)) + else + ddy(j)=0.0 + endif + else + j2=jmxin + j1=jmxin + if(abs(-90.-rinlat(j1)).gt.0.001) then + ddy(j)=(aphi-rinlat(j1))/(-90.-rinlat(j1)) + else + ddy(j)=0.0 + endif + endif + jindx1(j)=j1 + jindx2(j)=j2 + enddo + else + do j=i1_t,i2_t + jindx1(j) = jmxin+1 + enddo + do jx=jmxin,1,-1 + do j=i1_t,i2_t + if(outlat(j).le.rinlat(jx)) jindx1(j) = jx + enddo + enddo + do j=i1_t,i2_t + jq = jindx1(j) + aphi=outlat(j) + if(jq.gt.1 .and. jq .le. jmxin) then + j2=jq + j1=jq-1 + ddy(j)=(aphi-rinlat(j1))/(rinlat(j2)-rinlat(j1)) + elseif (jq .eq. 1) then + j2=1 + j1=1 + if(abs(-90.-rinlat(j1)).gt.0.001) then + ddy(j)=(aphi-rinlat(j1))/(-90.-rinlat(j1)) + else + ddy(j)=0.0 + endif + else + j2=jmxin + j1=jmxin + if(abs(90.-rinlat(j1)).gt.0.001) then + ddy(j)=(aphi-rinlat(j1))/(90.-rinlat(j1)) + else + ddy(j)=0.0 + endif + endif + jindx1(j)=j1 + jindx2(j)=j2 + enddo + endif +! +! if (me .eq. 0 .and. inttyp .eq. 1) then +! print *,'la2ga' +! print *,'iindx1' +! print *,(iindx1(n),n=1,len) +! print *,'iindx2' +! print *,(iindx2(n),n=1,len) +! print *,'jindx1' +! print *,(jindx1(n),n=1,len) +! print *,'jindx2' +! print *,(jindx2(n),n=1,len) +! print *,'ddy' +! print *,(ddy(n),n=1,len) +! print *,'ddx' +! print *,(ddx(n),n=1,len) +! endif +! + sum1 = 0. + sum2 = 0. + sum3 = 0. + sum4 = 0. + if (lmask) then + wei1 = 0. + wei2 = 0. + wei3 = 0. + wei4 = 0. + do i=1,imxin + sum1 = sum1 + regin(i,1) * rslmsk(i,1) + sum2 = sum2 + regin(i,jmxin) * rslmsk(i,jmxin) + wei1 = wei1 + rslmsk(i,1) + wei2 = wei2 + rslmsk(i,jmxin) +! + sum3 = sum3 + regin(i,1) * (1.0-rslmsk(i,1)) + sum4 = sum4 + regin(i,jmxin) * (1.0-rslmsk(i,jmxin)) + wei3 = wei3 + (1.0-rslmsk(i,1)) + wei4 = wei4 + (1.0-rslmsk(i,jmxin)) + enddo +! + if(wei1.gt.0.) then + sum1 = sum1 / wei1 + else + sum1 = 0. + endif + if(wei2.gt.0.) then + sum2 = sum2 / wei2 + else + sum2 = 0. + endif + if(wei3.gt.0.) then + sum3 = sum3 / wei3 + else + sum3 = 0. + endif + if(wei4.gt.0.) then + sum4 = sum4 / wei4 + else + sum4 = 0. + endif + else + do i=1,imxin + sum1 = sum1 + regin(i,1) + sum2 = sum2 + regin(i,jmxin) + enddo + sum1 = sum1 / imxin + sum2 = sum2 / imxin + sum3 = sum1 + sum4 = sum2 + endif +! +! print *,' sum1=',sum1,' sum2=',sum2 +! *,' sum3=',sum3,' sum4=',sum4 +! print *,' rslmsk=',(rslmsk(i,1),i=1,imxin) +! print *,' slmask=',(slmask(i),i=1,imxout) +! *,' j1=',jindx1(1),' j2=',jindx2(1) +! +! +! inttyp=1 take the closest point value +! + if(inttyp.eq.1) then + + do i=i1_t,i2_t + jy = jindx1(i) + if(ddy(i) .ge. 0.5) jy = jindx2(i) + ix = iindx1(i) + if(ddx(i) .ge. 0.5) ix = iindx2(i) +! +!cggg start +! + if (.not. lmask) then + + gauout(i) = regin(ix,jy) + + else + + if(slmask(i).eq.rslmsk(ix,jy)) then + + gauout(i) = regin(ix,jy) + + else + + i1 = ix + j1 = jy + +! spiral around until matching mask is found. + do nx=1,jmxin*imxin/2 + kxs=sqrt(4*nx-2.5) + kxt=nx-int(kxs**2/4+1) + select case(mod(kxs,4)) + case(1) + ix=i1-kxs/4+kxt + jx=j1-kxs/4 + case(2) + ix=i1+1+kxs/4 + jx=j1-kxs/4+kxt + case(3) + ix=i1+1+kxs/4-kxt + jx=j1+1+kxs/4 + case default + ix=i1-kxs/4 + jx=j1+kxs/4-kxt + end select + if(jx.lt.1) then + ix=ix+imxin/2 + jx=2-jx + elseif(jx.gt.jmxin) then + ix=ix+imxin/2 + jx=2*jmxin-jx + endif + ix=modulo(ix-1,imxin)+1 + if(slmask(i).eq.rslmsk(ix,jx)) then + gauout(i) = regin(ix,jx) + go to 81 + endif + enddo + +!cggg here, set the gauout value to be 0, and let's sarah's land +!cggg routine assign a default. + + if (num_threads == 1) then + print*,'no matching mask found ',i,i1,j1,ix,jx + print*,'set to default value.' + endif + gauout(i) = 0.0 + + + 81 continue + + end if + + end if + +!cggg end + + enddo +! kmami=1 +! if (me == 0 .and. num_threads == 1) +! & call maxmin(gauout(i1_t),len_thread,kmami) + else ! nearest neighbor interpolation + +! +! quasi-bilinear interpolation +! + ifill(it) = 0 + imxnx(it) = 0 + do i=i1_t,i2_t + y = ddy(i) + j1 = jindx1(i) + j2 = jindx2(i) + x = ddx(i) + i1 = iindx1(i) + i2 = iindx2(i) +! + wi1j1 = (1.-x) * (1.-y) + wi2j1 = x *( 1.-y) + wi1j2 = (1.-x) * y + wi2j2 = x * y +! + tem = 4.*slmask(i) - rslmsk(i1,j1) - rslmsk(i2,j1) + & - rslmsk(i1,j2) - rslmsk(i2,j2) + if(lmask .and. abs(tem) .gt. 0.01) then + if(slmask(i).eq.1.) then + wi1j1 = wi1j1 * rslmsk(i1,j1) + wi2j1 = wi2j1 * rslmsk(i2,j1) + wi1j2 = wi1j2 * rslmsk(i1,j2) + wi2j2 = wi2j2 * rslmsk(i2,j2) + else + wi1j1 = wi1j1 * (1.0-rslmsk(i1,j1)) + wi2j1 = wi2j1 * (1.0-rslmsk(i2,j1)) + wi1j2 = wi1j2 * (1.0-rslmsk(i1,j2)) + wi2j2 = wi2j2 * (1.0-rslmsk(i2,j2)) + endif + endif +! + wsum = wi1j1 + wi2j1 + wi1j2 + wi2j2 + wrk(i) = wsum + if(wsum.ne.0.) then + wsumiv = 1./wsum +! + if(j1.ne.j2) then + gauout(i) = (wi1j1*regin(i1,j1) + wi2j1*regin(i2,j1) + + & wi1j2*regin(i1,j2) + wi2j2*regin(i2,j2)) + & *wsumiv + else +! + if (rlat .gt. 0.0) then + if (slmask(i) .eq. 1.0) then + sumn = sum1 + sums = sum2 + else + sumn = sum3 + sums = sum4 + endif + if( j1 .eq. 1) then + gauout(i) = (wi1j1*sumn +wi2j1*sumn + + & wi1j2*regin(i1,j2)+wi2j2*regin(i2,j2)) + & * wsumiv + elseif (j1 .eq. jmxin) then + gauout(i) = (wi1j1*regin(i1,j1)+wi2j1*regin(i2,j1)+ + & wi1j2*sums +wi2j2*sums ) + & * wsumiv + endif +! print *,' slmask=',slmask(i),' sums=',sums,' sumn=',sumn +! & ,' regin=',regin(i1,j2),regin(i2,j2),' j1=',j1,' j2=',j2 +! & ,' wij=',wi1j1, wi2j1, wi1j2, wi2j2,wsumiv + else + if (slmask(i) .eq. 1.0) then + sums = sum1 + sumn = sum2 + else + sums = sum3 + sumn = sum4 + endif + if( j1 .eq. 1) then + gauout(i) = (wi1j1*regin(i1,j1)+wi2j1*regin(i2,j1)+ + & wi1j2*sums +wi2j2*sums ) + & * wsumiv + elseif (j1 .eq. jmxin) then + gauout(i) = (wi1j1*sumn +wi2j1*sumn + + & wi1j2*regin(i1,j2)+wi2j2*regin(i2,j2)) + & * wsumiv + endif + endif + endif ! if j1 .ne. j2 + endif + enddo + do i=i1_t,i2_t + j1 = jindx1(i) + j2 = jindx2(i) + i1 = iindx1(i) + i2 = iindx2(i) + if(wrk(i) .eq. 0.0) then + if(.not.lmask) then + if (num_threads == 1) + & write(6,*) ' la2ga called with lmask=.true. but bad', + & ' rslmsk or slmask given' + call abort + endif + ifill(it) = ifill(it) + 1 + if(ifill(it) <= 2 ) then + if (me == 0 .and. num_threads == 1) then + write(6,*) 'i1,i2,j1,j2=',i1,i2,j1,j2 + write(6,*) 'rslmsk=',rslmsk(i1,j1),rslmsk(i1,j2), + & rslmsk(i2,j1),rslmsk(i2,j2) +! write(6,*) 'i,j=',i,j,' slmask(i)=',slmask(i) + write(6,*) 'i=',i,' slmask(i)=',slmask(i) + &, ' outlon=',outlon(i),' outlat=',outlat(i) + endif + endif +! spiral around until matching mask is found. + do nx=1,jmxin*imxin/2 + kxs=sqrt(4*nx-2.5) + kxt=nx-int(kxs**2/4+1) + select case(mod(kxs,4)) + case(1) + ix=i1-kxs/4+kxt + jx=j1-kxs/4 + case(2) + ix=i1+1+kxs/4 + jx=j1-kxs/4+kxt + case(3) + ix=i1+1+kxs/4-kxt + jx=j1+1+kxs/4 + case default + ix=i1-kxs/4 + jx=j1+kxs/4-kxt + end select + if(jx.lt.1) then + ix=ix+imxin/2 + jx=2-jx + elseif(jx.gt.jmxin) then + ix=ix+imxin/2 + jx=2*jmxin-jx + endif + ix=modulo(ix-1,imxin)+1 + if(slmask(i).eq.rslmsk(ix,jx)) then + gauout(i) = regin(ix,jx) + imxnx(it) = max(imxnx(it),nx) + go to 71 + endif + enddo +! + if (num_threads == 1) then + write(6,*) ' error!!! no filling value found in la2ga' +! write(6,*) ' i ix jx slmask(i) rslmsk ', +! & i,ix,jx,slmask(i),rslmsk(ix,jx) + endif + call abort +! + 71 continue + endif +! + enddo + endif + enddo ! end of threaded loop ................... +!$omp end parallel do +! + if(inttyp /= 1)then + ifills = 0 + do it=1,num_threads + ifills = ifills + ifill(it) + enddo + + if(ifills.gt.1) then + if (me .eq. 0) then + write(6,*) ' unable to interpolate. filled with nearest', + & ' point value at ',ifills,' points' +! & ' point value at ',ifills,' points imxnx=',imxnx(:) + endif + endif + deallocate (ifill) + endif +! +! kmami = 1 +! if (me == 0) call maxmin(gauout,len,kmami) +! + return + end subroutine la2ga + +!>\ingroup mod_sfcsub + subroutine maxmin(f,imax,kmax) + use machine , only : kind_io8,kind_io4 + implicit none + integer i,iimin,iimax,kmax,imax,k + real (kind=kind_io8) fmin,fmax +! + real (kind=kind_io8) f(imax,kmax) +! + do k=1,kmax +! + fmax = f(1,k) + fmin = f(1,k) +! + do i=1,imax + if(fmax.le.f(i,k)) then + fmax = f(i,k) + iimax = i + endif + if(fmin.ge.f(i,k)) then + fmin = f(i,k) + iimin = i + endif + enddo +! +! write(6,100) k,fmax,iimax,fmin,iimin +! 100 format(2x,'level=',i2,' max=',e11.4,' at i=',i7, +! & ' min=',e11.4,' at i=',i7) +! + enddo +! + return + end + +!>\ingroup mod_sfcsub + subroutine filanl(tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl, + & aisanl, + & tg3anl,cvanl ,cvbanl,cvtanl, + & cnpanl,smcanl,stcanl,slianl,scvanl,veganl, + & vetanl,sotanl,alfanl, +!cwu [+1l] add ()anl for sih, sic + & sihanl,sicanl, +!clu [+1l] add ()anl for vmn, vmx, slp, abs + & vmnanl,vmxanl,slpanl,absanl, + & tsfclm,tsfcl2,wetclm,snoclm,zorclm,albclm, + & aisclm, + & tg3clm,cvclm ,cvbclm,cvtclm, + & cnpclm,smcclm,stcclm,sliclm,scvclm,vegclm, + & vetclm,sotclm,alfclm, +!cwu [+1l] add ()clm for sih, sic + & sihclm,sicclm, +!clu [+1l] add ()clm for vmn, vmx, slp, abs + & vmnclm,vmxclm,slpclm,absclm, + & len,lsoil) + use machine , only : kind_io8,kind_io4 + implicit none + integer i,j,len,lsoil +! + real (kind=kind_io8) tsfanl(len),tsfan2(len),wetanl(len), + & snoanl(len), + & zoranl(len),albanl(len,4),aisanl(len), + & tg3anl(len), + & cvanl (len),cvbanl(len),cvtanl(len), + & cnpanl(len), + & smcanl(len,lsoil),stcanl(len,lsoil), + & slianl(len),scvanl(len),veganl(len), + & vetanl(len),sotanl(len),alfanl(len,2) +!cwu [+1l] add ()anl for sih, sic + &, sihanl(len),sicanl(len) +!clu [+1l] add ()anl for vmn, vmx, slp, abs + &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len) + real (kind=kind_io8) tsfclm(len),tsfcl2(len),wetclm(len), + & snoclm(len), + & zorclm(len),albclm(len,4),aisclm(len), + & tg3clm(len), + & cvclm (len),cvbclm(len),cvtclm(len), + & cnpclm(len), + & smcclm(len,lsoil),stcclm(len,lsoil), + & sliclm(len),scvclm(len),vegclm(len), + & vetclm(len),sotclm(len),alfclm(len,2) +!cwu [+1l] add ()clm for sih, sic + &, sihclm(len),sicclm(len) +!clu [+1l] add ()clm for vmn, vmx, slp, abs + &, vmnclm(len),vmxclm(len),slpclm(len),absclm(len) +! + do i=1,len + tsfanl(i) = tsfclm(i) ! tsf at t + tsfan2(i) = tsfcl2(i) ! tsf at t-deltsfc + wetanl(i) = wetclm(i) ! soil wetness + snoanl(i) = snoclm(i) ! snow + scvanl(i) = scvclm(i) ! snow cover + aisanl(i) = aisclm(i) ! seaice + slianl(i) = sliclm(i) ! land/sea/snow mask + zoranl(i) = zorclm(i) ! surface roughness +! plranl(i) = plrclm(i) ! maximum stomatal resistance + tg3anl(i) = tg3clm(i) ! deep soil temperature + cnpanl(i) = cnpclm(i) ! canopy water content + veganl(i) = vegclm(i) ! vegetation cover + vetanl(i) = vetclm(i) ! vegetation type + sotanl(i) = sotclm(i) ! soil type + cvanl(i) = cvclm(i) ! cv + cvbanl(i) = cvbclm(i) ! cvb + cvtanl(i) = cvtclm(i) ! cvt +!cwu [+4l] add sih, sic + sihanl(i) = sihclm(i) ! sea ice thickness + sicanl(i) = sicclm(i) ! sea ice concentration +!clu [+4l] add vmn, vmx, slp, abs + vmnanl(i) = vmnclm(i) ! min vegetation cover + vmxanl(i) = vmxclm(i) ! max vegetation cover + slpanl(i) = slpclm(i) ! slope type + absanl(i) = absclm(i) ! max snow albedo + enddo +! + do j=1,lsoil + do i=1,len + smcanl(i,j) = smcclm(i,j) ! layer soil wetness + stcanl(i,j) = stcclm(i,j) ! soil temperature + enddo + enddo + do j=1,4 + do i=1,len + albanl(i,j) = albclm(i,j) ! albedo + enddo + enddo + do j=1,2 + do i=1,len + alfanl(i,j) = alfclm(i,j) ! vegetation fraction for albedo + enddo + enddo +! + return + end + +!>\ingroup mod_sfcsub + subroutine analy(lugb,iy,im,id,ih,fh,len,lsoil, + & slmask,fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, + & fntg3a,fnscva,fnsmca,fnstca,fnacna,fnvega, + & fnveta,fnsota, +!clu [+1l] add fn()a for vmn, vmx, slp, abs + & fnvmna,fnvmxa,fnslpa,fnabsa, + & tsfanl,wetanl,snoanl,zoranl,albanl,aisanl, + & tg3anl,cvanl ,cvbanl,cvtanl, + & smcanl,stcanl,slianl,scvanl,acnanl,veganl, + & vetanl,sotanl,alfanl,tsfan0, +!clu [+1l] add ()anl for vmn, vmx, slp, abs + & vmnanl,vmxanl,slpanl,absanl, +!cggg snow mods start & kpdtsf,kpdwet,kpdsno,kpdzor,kpdalb,kpdais, + & kpdtsf,kpdwet,kpdsno,kpdsnd,kpdzor,kpdalb,kpdais, +!cggg snow mods end + & kpdtg3,kpdscv,kpdacn,kpdsmc,kpdstc,kpdveg, + & kprvet,kpdsot,kpdalf, +!clu [+1l] add kpd() for vmn, vmx, slp, abs + & kpdvmn,kpdvmx,kpdslp,kpdabs, + & irttsf,irtwet,irtsno,irtzor,irtalb,irtais, + & irttg3,irtscv,irtacn,irtsmc,irtstc,irtveg, + & irtvet,irtsot,irtalf +!clu [+1l] add irt() for vmn, vmx, slp, abs + &, irtvmn,irtvmx,irtslp,irtabs + &, imsk, jmsk, slmskh, outlat, outlon + &, gaus, blno, blto, me, lanom) + use machine , only : kind_io8,kind_io4 + implicit none + logical lanom + integer irtsmc,irtacn,irtstc,irtvet,irtveg,irtscv,irtzor,irtsno, + & irtalb,irttg3,irtais,iret,me,kk,kpdvet,i,irtalf,irtsot, +!cggg snow mods start & imsk,jmsk,irtwet,lsoil,len, kpdtsf,kpdsno,kpdwet,iy, + & imsk,jmsk,irtwet,lsoil,len,kpdtsf,kpdsno,kpdsnd,kpdwet,iy, +!cggg snow mods end + & lugb,im,ih,id,kpdveg,kpdstc,kprvet,irttsf,kpdsot,kpdsmc, + & kpdais,kpdzor,kpdtg3,kpdacn,kpdscv,j +!clu [+1l] add kpd() and irt() for vmn, vmx, slp, abs + &, kpdvmn,kpdvmx,kpdslp,kpdabs,irtvmn,irtvmx,irtslp,irtabs + real (kind=kind_io8) blto,blno,fh +! + real (kind=kind_io8) slmask(len) + real (kind=kind_io8) slmskh(imsk,jmsk) + real (kind=kind_io8) outlat(len), outlon(len) + integer kpdalb(4), kpdalf(2) +!cggg snow mods start + integer kpds(1000),kgds(1000),jpds(1000),jgds(1000) + integer lugi, lskip, lgrib, ndata +!cggg snow mods end +! + character*500 fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, + & fntg3a,fnscva,fnsmca,fnstca,fnacna,fnvega, + & fnveta,fnsota +!clu [+1l] add fn()a for vmn, vmx, slp, abs + &, fnvmna,fnvmxa,fnslpa,fnabsa + + real (kind=kind_io8) tsfanl(len), wetanl(len), snoanl(len), + & zoranl(len), albanl(len,4), aisanl(len), + & tg3anl(len), acnanl(len), + & cvanl (len), cvbanl(len), cvtanl(len), + & slianl(len), scvanl(len), veganl(len), + & vetanl(len), sotanl(len), alfanl(len,2), + & smcanl(len,lsoil), stcanl(len,lsoil), + & tsfan0(len) +!clu [+1l] add ()anl for vmn, vmx, slp, abs + &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len) +! + logical gaus +! +! tsf +! + irttsf = 1 + if(fntsfa(1:8).ne.' ') then + call fixrda(lugb,fntsfa,kpdtsf,slmask, + & iy,im,id,ih,fh,tsfanl,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irttsf = iret + if(iret == 1) then + write(6,*) 't surface analysis read error' + call abort + elseif(iret == -1) then + if (me == 0) then + print *,'old t surface analysis provided, indicating proper' + &, ' file name is given. no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me == 0) print *,'t surface analysis provided.' + endif + else + if (me == 0) then +! print *,'************************************************' + print *,'no tsf analysis available. climatology used' + endif + endif +! +! tsf0 +! + if(fntsfa(1:8).ne.' ' .and. lanom) then + call fixrda(lugb,fntsfa,kpdtsf,slmask, + & iy,im,id,ih,0.,tsfan0,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + if(iret == 1) then + write(6,*) 't surface at ft=0 analysis read error' + call abort + elseif(iret == -1) then + if (me == 0) then + write(6,*) 'could not find t surface analysis at ft=0' + endif + call abort + else + print *,'t surface analysis at ft=0 found.' + endif + else + do i=1,len + tsfan0(i)=-999.9 + enddo + endif +! +! albedo +! + irtalb=0 + if(fnalba(1:8).ne.' ') then + do kk = 1, 4 + call fixrda(lugb,fnalba,kpdalb(kk),slmask, + & iy,im,id,ih,fh,albanl(1,kk),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irtalb=iret + if(iret.eq.1) then + write(6,*) 'albedo analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old albedo analysis provided, indicating proper', + & ' file name is given. no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0 .and. kk .eq. 4) + & print *,'albedo analysis provided.' + endif + enddo + else + if (me .eq. 0) then +! print *,'************************************************' + print *,'no albedo analysis available. climatology used' + endif + endif +! +! vegetation fraction for albedo +! + irtalf=0 + if(fnalba(1:8).ne.' ') then + do kk = 1, 2 + call fixrda(lugb,fnalba,kpdalf(kk),slmask, + & iy,im,id,ih,fh,alfanl(1,kk),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irtalf=iret + if(iret.eq.1) then + write(6,*) 'albedo analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old albedo analysis provided, indicating proper', + & ' file name is given. no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0 .and. kk .eq. 4) + & print *,'albedo analysis provided.' + endif + enddo + else + if (me .eq. 0) then +! print *,'************************************************' + print *,'no vegfalbedo analysis available. climatology used' + endif + endif +! +! soil wetness +! + irtwet=0 + irtsmc=0 + if(fnweta(1:8).ne.' ') then + call fixrda(lugb,fnweta,kpdwet,slmask, + & iy,im,id,ih,fh,wetanl,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irtwet=iret + if(iret.eq.1) then + write(6,*) 'bucket wetness analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old wetness analysis provided, indicating proper', + & ' file name is given. no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0) print *,'bucket wetness analysis provided.' + endif + elseif(fnsmca(1:8).ne.' ') then + call fixrda(lugb,fnsmca,kpdsmc,slmask, + & iy,im,id,ih,fh,smcanl(1,1),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + call fixrda(lugb,fnsmca,kpdsmc,slmask, + & iy,im,id,ih,fh,smcanl(1,2),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irtsmc=iret + if(iret.eq.1) then + write(6,*) 'layer soil wetness analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old layer soil wetness analysis provided', + & ' indicating proper file name is given.' + print *,' no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0) print *,'layer soil wetness analysis provided.' + endif + else + if (me .eq. 0) then +! print *,'************************************************' + print *,'no soil wetness analysis available. climatology used' + endif + endif +! +! read in snow depth/snow cover +! + irtscv=0 + if(fnsnoa(1:8).ne.' ') then + do i=1,len + scvanl(i)=0. + enddo +!cggg snow mods start +!cggg need to determine if the snow data is on the gaussian grid +!cggg or not. if gaussian, then data is a depth, not liq equiv +!cggg depth. if not gaussian, then data is from hua-lu's +!cggg program and is a liquid equiv. need to communicate +!cggg this to routine fixrda via the 3rd argument which is +!cggg the grib parameter id number. + call baopenr(lugb,fnsnoa,iret) + if (iret .ne. 0) then + write(6,*) ' error in opening file ',trim(fnsnoa) + print *,'error in opening file ',trim(fnsnoa) + call abort + endif + lugi=0 + lskip=-1 + jpds=-1 + jgds=-1 + kpds=jpds + call getgbh(lugb,lugi,lskip,jpds,jgds,lgrib,ndata, + & lskip,kpds,kgds,iret) + close(lugb) + if (iret .ne. 0) then + write(6,*) ' error reading header of file: ',trim(fnsnoa) + print *,'error reading header of file: ',trim(fnsnoa) + call abort + endif + if (kgds(1) == 4) then ! gaussian data is depth + call fixrda(lugb,fnsnoa,kpdsnd,slmask, + & iy,im,id,ih,fh,snoanl,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + snoanl=snoanl*100. ! convert from meters to liq. eq. + ! depth in mm using 10:1 ratio + else ! lat/lon data is liq equv. depth + call fixrda(lugb,fnsnoa,kpdsno,slmask, + & iy,im,id,ih,fh,snoanl,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + endif +!cggg snow mods end + irtscv=iret + if(iret.eq.1) then + write(6,*) 'snow depth analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old snow depth analysis provided, indicating proper', + & ' file name is given. no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0) print *,'snow depth analysis provided.' + endif + irtsno=0 + elseif(fnscva(1:8).ne.' ') then + do i=1,len + snoanl(i)=0. + enddo + call fixrda(lugb,fnscva,kpdscv,slmask, + & iy,im,id,ih,fh,scvanl,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irtsno=iret + if(iret.eq.1) then + write(6,*) 'snow cover analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old snow cover analysis provided, indicating proper', + & ' file name is given. no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0) print *,'snow cover analysis provided.' + endif + else + if (me .eq. 0) then +! print *,'************************************************' + print *,'no snow/snocov analysis available. climatology used' + endif + endif +! +! sea ice mask +! + irtacn=0 + irtais=0 + if(fnacna(1:8).ne.' ') then + call fixrda(lugb,fnacna,kpdacn,slmask, + & iy,im,id,ih,fh,acnanl,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irtacn=iret + if(iret.eq.1) then + write(6,*) 'ice concentration analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old ice concentration analysis provided', + & ' indicating proper file name is given' + print *,' no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0) print *,'ice concentration analysis provided.' + endif + elseif(fnaisa(1:8).ne.' ') then + call fixrda(lugb,fnaisa,kpdais,slmask, + & iy,im,id,ih,fh,aisanl,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irtais=iret + if(iret.eq.1) then + write(6,*) 'ice mask analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old ice-mask analysis provided, indicating proper', + & ' file name is given. no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0) print *,'ice mask analysis provided.' + endif + else + if (me .eq. 0) then +! print *,'************************************************' + print *,'no sea-ice analysis available. climatology used' + endif + endif +! +! surface roughness +! + irtzor=0 + if(fnzora(1:8).ne.' ') then + call fixrda(lugb,fnzora,kpdzor,slmask, + & iy,im,id,ih,fh,zoranl,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irtzor=iret + if(iret.eq.1) then + write(6,*) 'roughness analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old roughness analysis provided, indicating proper', + & ' file name is given. no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0) print *,'roughness analysis provided.' + endif + else + if (me .eq. 0) then +! print *,'************************************************' + print *,'no srfc roughness analysis available. climatology used' + endif + endif +! +! deep soil temperature +! + irttg3=0 + irtstc=0 + if(fntg3a(1:8).ne.' ') then + call fixrda(lugb,fntg3a,kpdtg3,slmask, + & iy,im,id,ih,fh,tg3anl,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irttg3=iret + if(iret.eq.1) then + write(6,*) 'deep soil tmp analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old deep soil temp analysis provided', + & ' indicating proper file name is given.' + print *,' no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0) print *,'deep soil tmp analysis provided.' + endif + elseif(fnstca(1:8).ne.' ') then + call fixrda(lugb,fnstca,kpdstc,slmask, + & iy,im,id,ih,fh,stcanl(1,1),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + call fixrda(lugb,fnstca,kpdstc,slmask, + & iy,im,id,ih,fh,stcanl(1,2),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irtstc=iret + if(iret.eq.1) then + write(6,*) 'layer soil tmp analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old deep soil temp analysis provided', + & 'iindicating proper file name is given.' + print *,' no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0) print *,'layer soil tmp analysis provided.' + endif + else + if (me .eq. 0) then +! print *,'************************************************' + print *,'no deep soil temp analy available. climatology used' + endif + endif +! +! vegetation cover +! + irtveg=0 + if(fnvega(1:8).ne.' ') then + call fixrda(lugb,fnvega,kpdveg,slmask, + & iy,im,id,ih,fh,veganl,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irtveg=iret + if(iret.eq.1) then + write(6,*) 'vegetation cover analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old vegetation cover analysis provided', + & ' indicating proper file name is given.' + print *,' no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0) print *,'gegetation cover analysis provided.' + endif + else + if (me .eq. 0) then +! print *,'************************************************' + print *,'no vegetation cover anly available. climatology used' + endif + endif +! +! vegetation type +! + irtvet=0 + if(fnveta(1:8).ne.' ') then + call fixrda(lugb,fnveta,kpdvet,slmask, + & iy,im,id,ih,fh,vetanl,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irtvet=iret + if(iret.eq.1) then + write(6,*) 'vegetation type analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old vegetation type analysis provided', + & ' indicating proper file name is given.' + print *,' no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0) print *,'vegetation type analysis provided.' + endif + else + if (me .eq. 0) then +! print *,'************************************************' + print *,'no vegetation type anly available. climatology used' + endif + endif +! +! soil type +! + irtsot=0 + if(fnsota(1:8).ne.' ') then + call fixrda(lugb,fnsota,kpdsot,slmask, + & iy,im,id,ih,fh,sotanl,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irtsot=iret + if(iret.eq.1) then + write(6,*) 'soil type analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old soil type analysis provided', + & ' indicating proper file name is given.' + print *,' no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0) print *,'soil type analysis provided.' + endif + else + if (me .eq. 0) then +! print *,'************************************************' + print *,'no soil type anly available. climatology used' + endif + endif + +!clu [+120l]-------------------------------------------------------------- +! +! min vegetation cover +! + irtvmn=0 + if(fnvmna(1:8).ne.' ') then + call fixrda(lugb,fnvmna,kpdvmn,slmask, + & iy,im,id,ih,fh,vmnanl,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irtvmn=iret + if(iret.eq.1) then + write(6,*) 'shdmin analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old shdmin analysis provided', + & ' indicating proper file name is given.' + print *,' no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0) print *,'shdmin analysis provided.' + endif + else + if (me .eq. 0) then +! print *,'************************************************' + print *,'no shdmin anly available. climatology used' + endif + endif + +! +! max vegetation cover +! + irtvmx=0 + if(fnvmxa(1:8).ne.' ') then + call fixrda(lugb,fnvmxa,kpdvmx,slmask, + & iy,im,id,ih,fh,vmxanl,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irtvmx=iret + if(iret.eq.1) then + write(6,*) 'shdmax analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old shdmax analysis provided', + & ' indicating proper file name is given.' + print *,' no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0) print *,'shdmax analysis provided.' + endif + else + if (me .eq. 0) then +! print *,'************************************************' + print *,'no shdmax anly available. climatology used' + endif + endif + +! +! slope type +! + irtslp=0 + if(fnslpa(1:8).ne.' ') then + call fixrda(lugb,fnslpa,kpdslp,slmask, + & iy,im,id,ih,fh,slpanl,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irtslp=iret + if(iret.eq.1) then + write(6,*) 'slope type analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old slope type analysis provided', + & ' indicating proper file name is given.' + print *,' no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0) print *,'slope type analysis provided.' + endif + else + if (me .eq. 0) then +! print *,'************************************************' + print *,'no slope type anly available. climatology used' + endif + endif + +! +! max snow albedo +! + irtabs=0 + if(fnabsa(1:8).ne.' ') then + call fixrda(lugb,fnabsa,kpdabs,slmask, + & iy,im,id,ih,fh,absanl,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + irtabs=iret + if(iret.eq.1) then + write(6,*) 'snoalb analysis read error' + call abort + elseif(iret.eq.-1) then + if (me .eq. 0) then + print *,'old snoalb analysis provided', + & ' indicating proper file name is given.' + print *,' no error suspected.' + write(6,*) 'forecast guess will be used' + endif + else + if (me .eq. 0) print *,'snoalb analysis provided.' + endif + else + if (me .eq. 0) then +! print *,'************************************************' + print *,'no snoalb anly available. climatology used' + endif + endif + +!clu ---------------------------------------------------------------------- +! + return + end + +!>\ingroup mod_sfcsub + subroutine filfcs(tsffcs,wetfcs,snofcs,zorfcs,albfcs, + & tg3fcs,cvfcs ,cvbfcs,cvtfcs, + & cnpfcs,smcfcs,stcfcs,slifcs,aisfcs, + & vegfcs, vetfcs, sotfcs, alffcs, +!cwu [+1l] add ()fcs for sih, sic + & sihfcs,sicfcs, +!clu [+1l] add ()fcs for vmn, vmx, slp, abs + & vmnfcs,vmxfcs,slpfcs,absfcs, + & tsfanl,wetanl,snoanl,zoranl,albanl, + & tg3anl,cvanl ,cvbanl,cvtanl, + & cnpanl,smcanl,stcanl,slianl,aisanl, + & veganl, vetanl, sotanl, alfanl, +!cwu [+1l] add ()anl for sih, sic + & sihanl,sicanl, +!clu [+1l] add ()anl for vmn, vmx, slp, abs + & vmnanl,vmxanl,slpanl,absanl, + & len,lsoil) +! + use machine , only : kind_io8,kind_io4 + implicit none + integer i,j,len,lsoil + real (kind=kind_io8) tsffcs(len),wetfcs(len),snofcs(len), + & zorfcs(len),albfcs(len,4),aisfcs(len), + & tg3fcs(len), + & cvfcs (len),cvbfcs(len),cvtfcs(len), + & cnpfcs(len), + & smcfcs(len,lsoil),stcfcs(len,lsoil), + & slifcs(len),vegfcs(len), + & vetfcs(len),sotfcs(len),alffcs(len,2) +!cwu [+1l] add ()fcs for sih, sic + &, sihfcs(len),sicfcs(len) +!clu [+1l] add ()fcs for vmn, vmx, slp, abs + &, vmnfcs(len),vmxfcs(len),slpfcs(len),absfcs(len) + real (kind=kind_io8) tsfanl(len),wetanl(len),snoanl(len), + & zoranl(len),albanl(len,4),aisanl(len), + & tg3anl(len), + & cvanl (len),cvbanl(len),cvtanl(len), + & cnpanl(len), + & smcanl(len,lsoil),stcanl(len,lsoil), + & slianl(len),veganl(len), + & vetanl(len),sotanl(len),alfanl(len,2) +!cwu [+1l] add ()anl for sih, sic + &, sihanl(len),sicanl(len) +!clu [+1l] add ()anl for vmn, vmx, slp, abs + &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len) +! + write(6,*) ' this is a dead start run, tsfc over land is', + & ' set as lowest sigma level temperture if given.' + write(6,*) ' if not, set to climatological tsf over land is used' +! +! + do i=1,len + tsffcs(i) = tsfanl(i) ! tsf + albfcs(i,1) = albanl(i,1) ! albedo + albfcs(i,2) = albanl(i,2) ! albedo + albfcs(i,3) = albanl(i,3) ! albedo + albfcs(i,4) = albanl(i,4) ! albedo + wetfcs(i) = wetanl(i) ! soil wetness + snofcs(i) = snoanl(i) ! snow + aisfcs(i) = aisanl(i) ! seaice + slifcs(i) = slianl(i) ! land/sea/snow mask + zorfcs(i) = zoranl(i) ! surface roughness +! plrfcs(i) = plranl(i) ! maximum stomatal resistance + tg3fcs(i) = tg3anl(i) ! deep soil temperature + cnpfcs(i) = cnpanl(i) ! canopy water content + cvfcs(i) = cvanl(i) ! cv + cvbfcs(i) = cvbanl(i) ! cvb + cvtfcs(i) = cvtanl(i) ! cvt + vegfcs(i) = veganl(i) ! vegetation cover + vetfcs(i) = vetanl(i) ! vegetation type + sotfcs(i) = sotanl(i) ! soil type + alffcs(i,1) = alfanl(i,1) ! vegetation fraction for albedo + alffcs(i,2) = alfanl(i,2) ! vegetation fraction for albedo +!cwu [+2l] add sih, sic + sihfcs(i) = sihanl(i) ! sea ice thickness + sicfcs(i) = sicanl(i) ! sea ice concentration +!clu [+4l] add vmn, vmx, slp, abs + vmnfcs(i) = vmnanl(i) ! min vegetation cover + vmxfcs(i) = vmxanl(i) ! max vegetation cover + slpfcs(i) = slpanl(i) ! slope type + absfcs(i) = absanl(i) ! max snow albedo + enddo +! + do j=1,lsoil + do i=1,len + smcfcs(i,j) = smcanl(i,j) ! layer soil wetness + stcfcs(i,j) = stcanl(i,j) ! soil temperature + enddo + enddo +! + return + end + +!>\ingroup mod_sfcsub + subroutine bktges(smcfcs,slianl,stcfcs,len,lsoil) +! + use machine , only : kind_io8,kind_io4 + implicit none + integer i,j,len,lsoil,k + real (kind=kind_io8) smcfcs(len,lsoil), stcfcs(len,lsoil), + & slianl(len) +! +! note that smfcs comes in with the original unit (cm?) (not grib file) +! + do i = 1, len + smcfcs(i,1) = (smcfcs(i,1)/150.) * .37 + .1 + enddo + do k = 2, lsoil + do i = 1, len + smcfcs(i,k) = smcfcs(i,1) + enddo + enddo + if(lsoil.gt.2) then + do k = 3, lsoil + do i = 1, len + stcfcs(i,k) = stcfcs(i,2) + enddo + enddo + endif +! + return + end + +!>\ingroup mod_sfcsub + subroutine rof01(aisfld,len,op,crit) + use machine , only : kind_io8,kind_io4 + implicit none + integer i,len + real (kind=kind_io8) aisfld(len),crit + character*2 op +! + if(op.eq.'ge') then + do i=1,len + if(aisfld(i).ge.crit) then + aisfld(i)=1. + else + aisfld(i)=0. + endif + enddo + elseif(op.eq.'gt') then + do i=1,len + if(aisfld(i).gt.crit) then + aisfld(i)=1. + else + aisfld(i)=0. + endif + enddo + elseif(op.eq.'le') then + do i=1,len + if(aisfld(i).le.crit) then + aisfld(i)=1. + else + aisfld(i)=0. + endif + enddo + elseif(op.eq.'lt') then + do i=1,len + if(aisfld(i).lt.crit) then + aisfld(i)=1. + else + aisfld(i)=0. + endif + enddo + else + write(6,*) ' illegal operator in rof01. op=',op + call abort + endif +! + return + end + +!>\ingroup mod_sfcsub + subroutine tsfcor(tsfc,orog,slmask,umask,len,rlapse) +! + use machine , only : kind_io8,kind_io4 + implicit none + integer i,len + real (kind=kind_io8) rlapse,umask + real (kind=kind_io8) tsfc(len), orog(len), slmask(len) +! + do i=1,len + if(slmask(i).eq.umask) then + tsfc(i) = tsfc(i) - orog(i)*rlapse + endif + enddo + return + end + subroutine snodpth(scvanl,slianl,tsfanl,snoclm, + & glacir,snwmax,snwmin,landice,len,snoanl, me) + use machine , only : kind_io8,kind_io4 + implicit none + integer i,me,len + logical, intent(in) :: landice + real (kind=kind_io8) sno,snwmax,snwmin +! + real (kind=kind_io8) scvanl(len), slianl(len), tsfanl(len), + & snoclm(len), snoanl(len), glacir(len) +! + if (me .eq. 0) write(6,*) 'snodpth' +! +! use surface temperature to get snow depth estimate +! + do i=1,len + sno = 0.0 +! +! over land +! + if(slianl(i).eq.1.) then + if(scvanl(i).eq.1.0) then + if(tsfanl(i).lt.243.0) then + sno = snwmax + elseif(tsfanl(i).lt.273.0) then + sno = snwmin+(snwmax-snwmin)*(273.0-tsfanl(i))/30.0 + else + sno = snwmin + endif + endif +! +! if glacial points has snow in climatology, set sno to snomax +! + if (.not.landice) then + if(glacir(i).eq.1.0) then + sno = snoclm(i) + if(sno.eq.0.) sno=snwmax + endif + endif + endif +! +! over sea ice +! +! snow over sea ice is cycled as of 01/01/94.....hua-lu pan +! + if(slianl(i).eq.2.0) then + sno=snoclm(i) + if(sno.eq.0.) sno=snwmax + endif +! + snoanl(i) = sno + enddo + return + end subroutine snodpth + +!>\ingroup mod_sfcsub + subroutine merge(len,lsoil,iy,im,id,ih,fh,deltsfc, + & sihfcs,sicfcs, + & vmnfcs,vmxfcs,slpfcs,absfcs, + & tsffcs,wetfcs,snofcs,zorfcs,albfcs,aisfcs, + & cvfcs ,cvbfcs,cvtfcs, + & cnpfcs,smcfcs,stcfcs,slifcs,vegfcs, + & vetfcs,sotfcs,alffcs, + & sihanl,sicanl, + & vmnanl,vmxanl,slpanl,absanl, + & tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl,aisanl, + & cvanl ,cvbanl,cvtanl, + & cnpanl,smcanl,stcanl,slianl,veganl, + & vetanl,sotanl,alfanl, + & ctsfl,calbl,caisl,csnol,csmcl,czorl,cstcl,cvegl, + & ctsfs,calbs,caiss,csnos,csmcs,czors,cstcs,cvegs, + & ccv,ccvb,ccvt,ccnp,cvetl,cvets,csotl,csots, + & calfl,calfs, + & csihl,csihs,csicl,csics, + & cvmnl,cvmns,cvmxl,cvmxs,cslpl,cslps,cabsl,cabss, + & irttsf,irtwet,irtsno,irtzor,irtalb,irtais, + & irttg3,irtscv,irtacn,irtsmc,irtstc,irtveg, + & irtvmn,irtvmx,irtslp,irtabs, + & irtvet,irtsot,irtalf, landice, me) + use machine , only : kind_io8,kind_io4 + use sfccyc_module, only : veg_type_landice, soil_type_landice + implicit none + integer k,i,im,id,iy,len,lsoil,ih,irtacn,irtsmc,irtscv,irtais, + & irttg3,irtstc,irtalf,me,irtsot,irtveg,irtvet, irtzor, + & irtalb,irtsno,irttsf,irtwet,j + &, irtvmn,irtvmx,irtslp,irtabs + logical, intent(in) :: landice + real (kind=kind_io8) rvegs,rvets,rzors,raiss,rsnos,rsots,rcnp, + & rcvt,rcv,rcvb,rsnol,rzorl,raisl,ralbl, + & ralfl,rvegl,ralbs,ralfs,rtsfs,rvetl,rsotl, + & qzors,qvegs,qsnos,qalfs,qaiss,qvets,qcvt, + & qcnp,qcvb,qsots,qcv,qaisl,qsnol,qalfl, + & qtsfl,qalbl,qzorl,qtsfs,qalbs,qsotl,qvegl, + & qvetl,rtsfl,calbs,caiss,ctsfs,czorl,cvegl, + & csnos,ccvb,ccvt,ccv,czors,cvegs,caisl,csnol, + & calbl,fh,ctsfl,ccnp,csots,calfl,csotl,cvetl, + & cvets,calfs,deltsfc, + & csihl,csihs,csicl,csics, + & rsihl,rsihs,rsicl,rsics, + & qsihl,qsihs,qsicl,qsics + &, cvmnl,cvmns,cvmxl,cvmxs,cslpl,cslps + &, cabsl,cabss,rvmnl,rvmns,rvmxl,rvmxs + &, rslpl,rslps,rabsl,rabss,qvmnl,qvmns + &, qvmxl,qvmxs,qslpl,qslps,qabsl,qabss +! + real (kind=kind_io8) tsffcs(len), wetfcs(len), snofcs(len), + & zorfcs(len), albfcs(len,4), aisfcs(len), + & cvfcs (len), cvbfcs(len), cvtfcs(len), + & cnpfcs(len), + & smcfcs(len,lsoil),stcfcs(len,lsoil), + & slifcs(len), vegfcs(len), + & vetfcs(len), sotfcs(len), alffcs(len,2) + &, sihfcs(len), sicfcs(len) + &, vmnfcs(len),vmxfcs(len),slpfcs(len),absfcs(len) + real (kind=kind_io8) tsfanl(len),tsfan2(len), + & wetanl(len),snoanl(len), + & zoranl(len), albanl(len,4), aisanl(len), + & cvanl (len), cvbanl(len), cvtanl(len), + & cnpanl(len), + & smcanl(len,lsoil),stcanl(len,lsoil), + & slianl(len), veganl(len), + & vetanl(len), sotanl(len), alfanl(len,2) + &, sihanl(len),sicanl(len) + &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len) +! + real (kind=kind_io8) csmcl(lsoil), csmcs(lsoil), + & cstcl(lsoil), cstcs(lsoil) + real (kind=kind_io8) rsmcl(lsoil), rsmcs(lsoil), + & rstcl(lsoil), rstcs(lsoil) + real (kind=kind_io8) qsmcl(lsoil), qsmcs(lsoil), + & qstcl(lsoil), qstcs(lsoil) + logical first + integer num_threads + data first /.true./ + save num_threads, first +! + integer len_thread_m, i1_t, i2_t, it + integer num_parthds +! + if (first) then + num_threads = num_parthds() + first = .false. + endif +! +! coeeficients of blending forecast and interpolated clim +! (or analyzed) fields over sea or land(l) (not for clouds) +! 1.0 = use of forecast +! 0.0 = replace with interpolated analysis +! +! merging coefficients are defined by parameter statement in calling program +! and therefore they should not be modified in this program. +! + rtsfl = ctsfl + ralbl = calbl + ralfl = calfl + raisl = caisl + rsnol = csnol +!clu rsmcl = csmcl + rzorl = czorl + rvegl = cvegl + rvetl = cvetl + rsotl = csotl + rsihl = csihl + rsicl = csicl + rvmnl = cvmnl + rvmxl = cvmxl + rslpl = cslpl + rabsl = cabsl +! + rtsfs = ctsfs + ralbs = calbs + ralfs = calfs + raiss = caiss + rsnos = csnos +! rsmcs = csmcs + rzors = czors + rvegs = cvegs + rvets = cvets + rsots = csots + rsihs = csihs + rsics = csics + rvmns = cvmns + rvmxs = cvmxs + rslps = cslps + rabss = cabss +! + rcv = ccv + rcvb = ccvb + rcvt = ccvt + rcnp = ccnp +! + do k=1,lsoil + rsmcl(k) = csmcl(k) + rsmcs(k) = csmcs(k) + rstcl(k) = cstcl(k) + rstcs(k) = cstcs(k) + enddo + if (fh-deltsfc < -0.001 .and. irttsf == 1) then + rtsfs = 1.0 + rtsfl = 1.0 +! do k=1,lsoil +! rsmcl(k) = 1.0 +! rsmcs(k) = 1.0 +! rstcl(k) = 1.0 +! rstcs(k) = 1.0 +! enddo + endif +! +! if analysis file name is given but no matching analysis date found, +! use guess (these are flagged by irt???=1). +! + if(irttsf == -1) then + rtsfl = 1. + rtsfs = 1. + endif + if(irtalb == -1) then + ralbl = 1. + ralbs = 1. + ralfl = 1. + ralfs = 1. + endif + if(irtais == -1) then + raisl = 1. + raiss = 1. + endif + if(irtsno == -1 .or. irtscv == -1) then + rsnol = 1. + rsnos = 1. + endif + if(irtsmc == -1 .or. irtwet == -1) then +! rsmcl = 1. +! rsmcs = 1. + do k=1,lsoil + rsmcl(k) = 1. + rsmcs(k) = 1. + enddo + endif + if(irtstc.eq.-1) then + do k=1,lsoil + rstcl(k) = 1. + rstcs(k) = 1. + enddo + endif + if(irtzor == -1) then + rzorl = 1. + rzors = 1. + endif + if(irtveg == -1) then + rvegl = 1. + rvegs = 1. + endif + if(irtvet.eq.-1) then + rvetl = 1. + rvets = 1. + endif + if(irtsot == -1) then + rsotl = 1. + rsots = 1. + endif + + if(irtacn == -1) then + rsicl = 1. + rsics = 1. + endif + if(irtvmn == -1) then + rvmnl = 1. + rvmns = 1. + endif + if(irtvmx == -1) then + rvmxl = 1. + rvmxs = 1. + endif + if(irtslp == -1) then + rslpl = 1. + rslps = 1. + endif + if(irtabs == -1) then + rabsl = 1. + rabss = 1. + endif +! + if(raiss == 1. .or. irtacn == -1) then + if (me == 0) print *,'use forecast land-sea-ice mask' + do i = 1, len + aisanl(i) = aisfcs(i) + slianl(i) = slifcs(i) + enddo + endif +! + if (me == 0) then + write(6,100) rtsfl,ralbl,raisl,rsnol,rsmcl,rzorl,rvegl + 100 format('rtsfl,ralbl,raisl,rsnol,rsmcl,rzorl,rvegl=',10f7.3) + write(6,101) rtsfs,ralbs,raiss,rsnos,rsmcs,rzors,rvegs + 101 format('rtsfs,ralbs,raiss,rsnos,rsmcs,rzors,rvegs=',10f7.3) +! print *,' ralfl=',ralfl,' ralfs=',ralfs,' rsotl=',rsotl +! *,' rsots=',rsots,' rvetl=',rvetl,' rvets=',rvets + endif +! + qtsfl = 1. - rtsfl + qalbl = 1. - ralbl + qalfl = 1. - ralfl + qaisl = 1. - raisl + qsnol = 1. - rsnol +! qsmcl = 1. - rsmcl + qzorl = 1. - rzorl + qvegl = 1. - rvegl + qvetl = 1. - rvetl + qsotl = 1. - rsotl + qsihl = 1. - rsihl + qsicl = 1. - rsicl + qvmnl = 1. - rvmnl + qvmxl = 1. - rvmxl + qslpl = 1. - rslpl + qabsl = 1. - rabsl +! + qtsfs = 1. - rtsfs + qalbs = 1. - ralbs + qalfs = 1. - ralfs + qaiss = 1. - raiss + qsnos = 1. - rsnos +! qsmcs = 1. - rsmcs + qzors = 1. - rzors + qvegs = 1. - rvegs + qvets = 1. - rvets + qsots = 1. - rsots + qsihs = 1. - rsihs + qsics = 1. - rsics + qvmns = 1. - rvmns + qvmxs = 1. - rvmxs + qslps = 1. - rslps + qabss = 1. - rabss +! + qcv = 1. - rcv + qcvb = 1. - rcvb + qcvt = 1. - rcvt + qcnp = 1. - rcnp +! + do k=1,lsoil + qsmcl(k) = 1. - rsmcl(k) + qsmcs(k) = 1. - rsmcs(k) + qstcl(k) = 1. - rstcl(k) + qstcs(k) = 1. - rstcs(k) + enddo +! +! merging +! + if(me .eq. 0) then + print *, 'dbgx-- csmcl:', (csmcl(k),k=1,lsoil) + print *, 'dbgx-- rsmcl:', (rsmcl(k),k=1,lsoil) + print *, 'dbgx-- csnol, csnos:',csnol,csnos + print *, 'dbgx-- rsnol, rsnos:',rsnol,rsnos + endif + +! print *, rtsfs, qtsfs, raiss , qaiss +! *, rsnos , qsnos, rzors , qzors, rvegs , qvegs +! *, rvets , qvets, rsots , qsots +! *, rcv, rcvb, rcvt, qcv, qcvb, qcvt +! *, ralbs, qalbs, ralfs, qalfs +! print *, rtsfl, qtsfl, raisl , qaisl +! *, rsnol , qsnol, rzorl , qzorl, rvegl , qvegl +! *, rvetl , qvetl, rsotl , qsotl +! *, ralbl, qalbl, ralfl, qalfl +! +! + len_thread_m = (len+num_threads-1) / num_threads + +!$omp parallel do private(i1_t,i2_t,it,i) + do it=1,num_threads ! start of threaded loop ................... + i1_t = (it-1)*len_thread_m+1 + i2_t = min(i1_t+len_thread_m-1,len) + do i=i1_t,i2_t + if(slianl(i).eq.0.) then + vetanl(i) = vetfcs(i)*rvets + vetanl(i)*qvets + sotanl(i) = sotfcs(i)*rsots + sotanl(i)*qsots + else + vetanl(i) = vetfcs(i)*rvetl + vetanl(i)*qvetl + sotanl(i) = sotfcs(i)*rsotl + sotanl(i)*qsotl + endif + enddo + enddo +!$omp end parallel do +! +!$omp parallel do private(i1_t,i2_t,it,i,k) +! + do it=1,num_threads ! start of threaded loop ................... + i1_t = (it-1)*len_thread_m+1 + i2_t = min(i1_t+len_thread_m-1,len) +! + do i=i1_t,i2_t + if(slianl(i).eq.0.) then +!.... tsffc2 is the previous anomaly + today's climatology +! tsffc2 = (tsffcs(i)-tsfan2(i))+tsfanl(i) +! tsfanl(i) = tsffc2 *rtsfs+tsfanl(i)*qtsfs +! + tsfanl(i) = tsffcs(i)*rtsfs + tsfanl(i)*qtsfs +! albanl(i) = albfcs(i)*ralbs + albanl(i)*qalbs + aisanl(i) = aisfcs(i)*raiss + aisanl(i)*qaiss + snoanl(i) = snofcs(i)*rsnos + snoanl(i)*qsnos + + zoranl(i) = zorfcs(i)*rzors + zoranl(i)*qzors + veganl(i) = vegfcs(i)*rvegs + veganl(i)*qvegs + sihanl(i) = sihfcs(i)*rsihs + sihanl(i)*qsihs + sicanl(i) = sicfcs(i)*rsics + sicanl(i)*qsics + vmnanl(i) = vmnfcs(i)*rvmns + vmnanl(i)*qvmns + vmxanl(i) = vmxfcs(i)*rvmxs + vmxanl(i)*qvmxs + slpanl(i) = slpfcs(i)*rslps + slpanl(i)*qslps + absanl(i) = absfcs(i)*rabss + absanl(i)*qabss + else + tsfanl(i) = tsffcs(i)*rtsfl + tsfanl(i)*qtsfl +! albanl(i) = albfcs(i)*ralbl + albanl(i)*qalbl + aisanl(i) = aisfcs(i)*raisl + aisanl(i)*qaisl + if(rsnol.ge.0)then + snoanl(i) = snofcs(i)*rsnol + snoanl(i)*qsnol + else ! envelope method + if(snoanl(i).ne.0)then + snoanl(i) = max(-snoanl(i)/rsnol, + & min(-snoanl(i)*rsnol, snofcs(i))) + endif + endif + zoranl(i) = zorfcs(i)*rzorl + zoranl(i)*qzorl + veganl(i) = vegfcs(i)*rvegl + veganl(i)*qvegl + vmnanl(i) = vmnfcs(i)*rvmnl + vmnanl(i)*qvmnl + vmxanl(i) = vmxfcs(i)*rvmxl + vmxanl(i)*qvmxl + slpanl(i) = slpfcs(i)*rslpl + slpanl(i)*qslpl + absanl(i) = absfcs(i)*rabsl + absanl(i)*qabsl + sihanl(i) = sihfcs(i)*rsihl + sihanl(i)*qsihl + sicanl(i) = sicfcs(i)*rsicl + sicanl(i)*qsicl + endif + + cnpanl(i) = cnpfcs(i)*rcnp + cnpanl(i)*qcnp +! +! snow over sea ice is cycled +! + if(slianl(i).eq.2.) then + snoanl(i) = snofcs(i) + endif +! + enddo + +! at landice points, set the soil type, slope type and +! greenness fields to flag values. + + if (landice) then + do i=i1_t,i2_t + if (nint(slianl(i)) == 1) then + if (nint(vetanl(i)) == veg_type_landice) then + sotanl(i) = soil_type_landice + veganl(i) = 0.0 + slpanl(i) = 9.0 + vmnanl(i) = 0.0 + vmxanl(i) = 0.0 + endif + end if ! if land + enddo + endif + + do i=i1_t,i2_t + cvanl(i) = cvfcs(i)*rcv + cvanl(i)*qcv + cvbanl(i) = cvbfcs(i)*rcvb + cvbanl(i)*qcvb + cvtanl(i) = cvtfcs(i)*rcvt + cvtanl(i)*qcvt + enddo +! + do k = 1, 4 + do i=i1_t,i2_t + if(slianl(i).eq.0.) then + albanl(i,k) = albfcs(i,k)*ralbs + albanl(i,k)*qalbs + else + albanl(i,k) = albfcs(i,k)*ralbl + albanl(i,k)*qalbl + endif + enddo + enddo +! + do k = 1, 2 + do i=i1_t,i2_t + if(slianl(i).eq.0.) then + alfanl(i,k) = alffcs(i,k)*ralfs + alfanl(i,k)*qalfs + else + alfanl(i,k) = alffcs(i,k)*ralfl + alfanl(i,k)*qalfl + endif + enddo + enddo +! + do k = 1, lsoil + do i=i1_t,i2_t + if(slianl(i).eq.0.) then + smcanl(i,k) = smcfcs(i,k)*rsmcs(k) + smcanl(i,k)*qsmcs(k) + stcanl(i,k) = stcfcs(i,k)*rstcs(k) + stcanl(i,k)*qstcs(k) + else +! soil moisture not used at landice points, so +! don't bother merging it. also, for now don't allow nudging +! to raise subsurface temperature above freezing. + stcanl(i,k) = stcfcs(i,k)*rstcl(k) + stcanl(i,k)*qstcl(k) + if (landice .and. slianl(i) == 1.0 .and. + & nint(vetanl(i)) == veg_type_landice) then + smcanl(i,k) = 1.0 ! use value as flag + stcanl(i,k) = min(stcanl(i,k), 273.15) + else + smcanl(i,k) = smcfcs(i,k)*rsmcl(k) + smcanl(i,k)*qsmcl(k) + end if + endif + enddo + enddo +! + enddo ! end of threaded loop ................... +!$omp end parallel do + return + end subroutine merge + +!>\ingroup mod_sfcsub + subroutine newice(slianl,slifcs,tsfanl,tsffcs,len,lsoil, +!cwu [+1l] add sihnew,sicnew,sihanl,sicanl + & sihnew,sicnew,sihanl,sicanl, + & albanl,snoanl,zoranl,smcanl,stcanl, + & albsea,snosea,zorsea,smcsea,smcice, + & tsfmin,tsfice,albice,zorice,tgice, + & rla,rlo,me) +! + use machine , only : kind_io8,kind_io4 + implicit none + real (kind=kind_io8), parameter :: one=1.0 + real (kind=kind_io8) tgice,albice,zorice,tsfice,albsea,snosea, + & smcice,tsfmin,zorsea,smcsea +!cwu [+1l] add sicnew,sihnew + &, sicnew,sihnew + integer i,me,kount1,kount2,k,len,lsoil + real (kind=kind_io8) slianl(len), slifcs(len), + & tsffcs(len),tsfanl(len) + real (kind=kind_io8) albanl(len,4), snoanl(len), zoranl(len) + real (kind=kind_io8) smcanl(len,lsoil), stcanl(len,lsoil) +!cwu [+1l] add sihanl & sicanl + real (kind=kind_io8) sihanl(len), sicanl(len) +! + real (kind=kind_io8) rla(len), rlo(len) +! + if (me .eq. 0) write(6,*) 'newice' +! + kount1 = 0 + kount2 = 0 + do i=1,len + if(slifcs(i).ne.slianl(i)) then + if(slifcs(i).eq.1..or.slianl(i).eq.1.) then + print *,'inconsistency in slifcs or slianl' + print 910,rla(i),rlo(i),slifcs(i),slianl(i), + & tsffcs(i),tsfanl(i) + 910 format(2x,'at lat=',f5.1,' lon=',f5.1,' slifcs=',f4.1, + & ' slimsk=',f4.1,' tsffcs=',f5.1,' set to tsfanl=',f5.1) + call abort + endif +! +! interpolated climatology indicates melted sea ice +! + if(slianl(i).eq.0..and.slifcs(i).eq.2.) then + tsfanl(i) = tsfmin + albanl(i,1) = albsea + albanl(i,2) = albsea + albanl(i,3) = albsea + albanl(i,4) = albsea + snoanl(i) = snosea + zoranl(i) = zorsea + do k = 1, lsoil + smcanl(i,k) = smcsea +!cwu [+1l] set stcanl to tgice (over sea-ice) + stcanl(i,k) = tgice + enddo +!cwu [+2l] set siganl and sicanl + sihanl(i) = 0. + sicanl(i) = 0. + kount1 = kount1 + 1 + endif +! +! interplated climatoloyg/analysis indicates new sea ice +! + if(slianl(i).eq.2..and.slifcs(i).eq.0.) then + tsfanl(i) = tsfice + albanl(i,1) = albice + albanl(i,2) = albice + albanl(i,3) = albice + albanl(i,4) = albice + snoanl(i) = 0. + zoranl(i) = zorice + do k = 1, lsoil + smcanl(i,k) = smcice + stcanl(i,k) = tgice + enddo +!cwu [+2l] add sihanl & sicanl + sihanl(i) = sihnew + sicanl(i) = min(one, max(sicnew,sicanl(i))) + kount2 = kount2 + 1 + endif + endif + enddo +! + if (me .eq. 0) then + if(kount1.gt.0) then + write(6,*) 'sea ice melted. tsf,alb,zor are filled', + & ' at ',kount1,' points' + endif + if(kount2.gt.0) then + write(6,*) 'sea ice formed. tsf,alb,zor are filled', + & ' at ',kount2,' points' + endif + endif +! + return + end + +!>\ingroup mod_sfcsub + subroutine qcsnow(snoanl,slmask,aisanl,glacir,len,snoval, + & landice,me) + use machine , only : kind_io8,kind_io4 + implicit none + integer kount,i,len,me + logical, intent(in) :: landice + real (kind=kind_io8) per,snoval + real (kind=kind_io8) snoanl(len),slmask(len), + & aisanl(len),glacir(len) + if (me .eq. 0) then + write(6,*) ' ' + write(6,*) 'qc of snow' + endif + if (.not.landice) then + kount=0 + do i=1,len + if(glacir(i).ne.0..and.snoanl(i).eq.0.) then +! if(glacir(i).ne.0..and.snoanl(i).lt.snoval*0.5) then + snoanl(i) = snoval + kount = kount + 1 + endif + enddo + per = float(kount) / float(len)*100. + if(kount.gt.0) then + if (me .eq. 0) then + print *,'snow filled over glacier points at ',kount, + & ' points (',per,'percent)' + endif + endif + endif ! landice check + kount = 0 + do i=1,len + if(slmask(i).eq.0.and.aisanl(i).eq.0) then + snoanl(i) = 0. + kount = kount + 1 + endif + enddo + per = float(kount) / float(len)*100. + if(kount.gt.0) then + if (me .eq. 0) then + print *,'snow set to zero over open sea at ',kount, + & ' points (',per,'percent)' + endif + endif + return + end subroutine qcsnow + +!>\ingroup mod_sfcsub + subroutine qcsice(ais,glacir,amxice,aicice,aicsea,sllnd,slmask, + & rla,rlo,len,me) + use machine , only : kind_io8,kind_io4 + implicit none + integer kount1,kount,i,me,len + real (kind=kind_io8) per,aicsea,aicice,sllnd +! + real (kind=kind_io8) ais(len), glacir(len), + & amxice(len), slmask(len) + real (kind=kind_io8) rla(len), rlo(len) +! +! check sea-ice cover mask against land-sea mask +! + if (me .eq. 0) write(6,*) 'qc of sea ice' + kount = 0 + kount1 = 0 + do i=1,len + if(ais(i).ne.aicice.and.ais(i).ne.aicsea) then + print *,'sea ice mask not ',aicice,' or ',aicsea + print *,'ais(i),aicice,aicsea,rla(i),rlo(i,=', + & ais(i),aicice,aicsea,rla(i),rlo(i) + call abort + endif + if(slmask(i).eq.0..and.glacir(i).eq.1..and. +! if(slmask(i).eq.0..and.glacir(i).eq.2..and. + & ais(i).ne.1.) then + kount1 = kount1 + 1 + ais(i) = 1. + endif + if(slmask(i).eq.sllnd.and.ais(i).eq.aicice) then + kount = kount + 1 + ais(i) = aicsea + endif + enddo +! enddo + per = float(kount) / float(len)*100. + if(kount.gt.0) then + if(me .eq. 0) then + print *,' sea ice over land mask at ',kount,' points (',per, + & 'percent)' + endif + endif + per = float(kount1) / float(len)*100. + if(kount1.gt.0) then + if(me .eq. 0) then + print *,' sea ice set over glacier points over ocean at ', + & kount1,' points (',per,'percent)' + endif + endif +! kount=0 +! do j=1,jdim +! do i=1,idim +! if(amxice(i,j).ne.0..and.ais(i,j).eq.0.) then +! ais(i,j)=0. +! kount=kount+1 +! endif +! enddo +! enddo +! per=float(kount)/float(idim*jdim)*100. +! if(kount.gt.0) then +! print *,' sea ice exceeds maxice at ',kount,' points (',per, +! & 'percent)' +! endif +! +! remove isolated open ocean surrounded by sea ice and/or land +! +! remove isolated open ocean surrounded by sea ice and/or land +! +! ij = 0 +! do j=1,jdim +! do i=1,idim +! ij = ij + 1 +! ip = i + 1 +! im = i - 1 +! jp = j + 1 +! jm = j - 1 +! if(jp.gt.jdim) jp = jdim - 1 +! if(jm.lt.1) jm = 2 +! if(ip.gt.idim) ip = 1 +! if(im.lt.1) im = idim +! if(slmask(i,j).eq.0..and.ais(i,j).eq.0.) then +! if((slmask(ip,jp).eq.1..or.ais(ip,jp).eq.1.).and. +! & (slmask(i ,jp).eq.1..or.ais(i ,jp).eq.1.).and. +! & (slmask(im,jp).eq.1..or.ais(im,jp).eq.1.).and. +! & (slmask(ip,j ).eq.1..or.ais(ip,j ).eq.1.).and. +! & (slmask(im,j ).eq.1..or.ais(im,j ).eq.1.).and. +! & (slmask(ip,jm).eq.1..or.ais(ip,jm).eq.1.).and. +! & (slmask(i ,jm).eq.1..or.ais(i ,jm).eq.1.).and. +! & (slmask(im,jm).eq.1..or.ais(im,jm).eq.1.)) then +! ais(i,j) = 1. +! write(6,*) ' isolated open sea point surrounded by', +! & ' sea ice or land modified to sea ice', +! & ' at lat=',rla(i,j),' lon=',rlo(i,j) +! endif +! endif +! enddo +! enddo + return + end + +!>\ingroup mod_sfcsub + subroutine setlsi(slmask,aisfld,len,aicice,slifld) +! + use machine , only : kind_io8,kind_io4 + implicit none + integer i,len + real (kind=kind_io8) aicice + real (kind=kind_io8) slmask(len), slifld(len), aisfld(len) +! +! set surface condition indicator slimsk +! + do i=1,len + slifld(i) = slmask(i) +! if(aisfld(i).eq.aicice) slifld(i) = 2.0 + if(aisfld(i).eq.aicice .and. slmask(i) .eq. 0.0) + & slifld(i) = 2.0 + enddo + return + end +!>\ingroup mod_sfcsub + subroutine scale(fld,len,scl) +! + use machine , only : kind_io8,kind_io4 + implicit none + integer i,len + real (kind=kind_io8) fld(len),scl + do i=1,len + fld(i) = fld(i) * scl + enddo + return + end + +!>\ingroup mod_sfcsub + subroutine qcmxmn(ttl,fld,slimsk,sno,iceflg, + & fldlmx,fldlmn,fldomx,fldomn,fldimx,fldimn, + & fldjmx,fldjmn,fldsmx,fldsmn,epsfld, + & rla,rlo,len,mode,percrit,lgchek,me) +! + use machine , only : kind_io8,kind_io4 + implicit none + real (kind=kind_io8) permax,per,fldimx,fldimn,fldjmx,fldomn, + & fldlmx,fldlmn,fldomx,fldjmn,percrit, + & fldsmx,fldsmn,epsfld + integer kmaxi,kmini,kmaxj,kmino,kmaxl,kminl,kmaxo,mmprt,kminj, + & ij,nprt,kmaxs,kmins,i,me,len,mode + parameter(mmprt=2) +! + character*8 ttl + logical iceflg(len) + real (kind=kind_io8) fld(len),slimsk(len),sno(len), + & rla(len), rlo(len) + integer iwk(len) + logical lgchek +! + logical first + integer num_threads + data first /.true./ + save num_threads, first +! + integer len_thread_m, i1_t, i2_t, it + integer num_parthds +! + if (first) then + num_threads = num_parthds() + first = .false. + endif +! +! check against land-sea mask and ice cover mask +! + if(me .eq. 0) then +! print *,' ' + print *,'performing qc of ',ttl,' mode=',mode, + & '(0=count only, 1=replace)' + endif +! + len_thread_m = (len+num_threads-1) / num_threads + kmaxl = 0 + kminl = 0 + kmaxo = 0 + kmino = 0 + kmaxi = 0 + kmini = 0 + kmaxj = 0 + kminj = 0 + kmaxs = 0 + kmins = 0 +!$omp parallel do private(i1_t,i2_t,it,i) +!$omp+private(nprt,ij,iwk) +!$omp+reduction(+:kmaxs,kmins,kmaxl,kminl,kmaxo) +!$omp+reduction(+:kmino,kmaxi,kmini,kmaxj,kminj) +!$omp+shared(mode,epsfld) +!$omp+shared(fldlmx,fldlmn,fldomx,fldjmn,fldsmx,fldsmn) +!$omp+shared(fld,slimsk,sno,rla,rlo) + do it=1,num_threads ! start of threaded loop + i1_t = (it-1)*len_thread_m+1 + i2_t = min(i1_t+len_thread_m-1,len) +! +! +! +! lower bound check over bare land +! + if (fldlmn .ne. 999.0) then + do i=i1_t,i2_t + if(slimsk(i).eq.1..and.sno(i).le.0..and. + & fld(i).lt.fldlmn-epsfld) then + kminl=kminl+1 + iwk(kminl) = i + endif + enddo + if(me == 0 . and. it == 1 .and. num_threads == 1) then + nprt = min(mmprt,kminl) + do i=1,nprt + ij = iwk(i) + print 8001,rla(ij),rlo(ij),fld(ij),fldlmn + 8001 format(' bare land min. check. lat=',f5.1, + & ' lon=',f6.1,' fld=',e13.6, ' to ',e13.6) + enddo + endif + if (mode .eq. 1) then + do i=1,kminl + fld(iwk(i)) = fldlmn + enddo + endif + endif +! +! upper bound check over bare land +! + if (fldlmx .ne. 999.0) then + do i=i1_t,i2_t + if(slimsk(i).eq.1..and.sno(i).le.0..and. + & fld(i).gt.fldlmx+epsfld) then + kmaxl=kmaxl+1 + iwk(kmaxl) = i + endif + enddo + if(me == 0 . and. it == 1 .and. num_threads == 1) then + nprt = min(mmprt,kmaxl) + do i=1,nprt + ij = iwk(i) + print 8002,rla(ij),rlo(ij),fld(ij),fldlmx + 8002 format(' bare land max. check. lat=',f5.1, + & ' lon=',f6.1,' fld=',e13.6, ' to ',e13.6) + enddo + endif + if (mode .eq. 1) then + do i=1,kmaxl + fld(iwk(i)) = fldlmx + enddo + endif + endif +! +! lower bound check over snow covered land +! + if (fldsmn .ne. 999.0) then + do i=i1_t,i2_t + if(slimsk(i).eq.1..and.sno(i).gt.0..and. + & fld(i).lt.fldsmn-epsfld) then + kmins=kmins+1 + iwk(kmins) = i + endif + enddo + if(me == 0 . and. it == 1 .and. num_threads == 1) then + nprt = min(mmprt,kmins) + do i=1,nprt + ij = iwk(i) + print 8003,rla(ij),rlo(ij),fld(ij),fldsmn + 8003 format(' sno covrd land min. check. lat=',f5.1, + & ' lon=',f6.1,' fld=',e11.4, ' to ',e11.4) + enddo + endif + if (mode .eq. 1) then + do i=1,kmins + fld(iwk(i)) = fldsmn + enddo + endif + endif +! +! upper bound check over snow covered land +! + if (fldsmx .ne. 999.0) then + do i=i1_t,i2_t + if(slimsk(i).eq.1..and.sno(i).gt.0..and. + & fld(i).gt.fldsmx+epsfld) then + kmaxs=kmaxs+1 + iwk(kmaxs) = i + endif + enddo + if(me == 0 . and. it == 1 .and. num_threads == 1) then + nprt = min(mmprt,kmaxs) + do i=1,nprt + ij = iwk(i) + print 8004,rla(ij),rlo(ij),fld(ij),fldsmx + 8004 format(' snow land max. check. lat=',f5.1, + & ' lon=',f6.1,' fld=',e11.4, ' to ',e11.4) + enddo + endif + if (mode .eq. 1) then + do i=1,kmaxs + fld(iwk(i)) = fldsmx + enddo + endif + endif +! +! lower bound check over open ocean +! + if (fldomn .ne. 999.0) then + do i=i1_t,i2_t + if(slimsk(i).eq.0..and. + & fld(i).lt.fldomn-epsfld) then + kmino=kmino+1 + iwk(kmino) = i + endif + enddo + if(me == 0 . and. it == 1 .and. num_threads == 1) then + nprt = min(mmprt,kmino) + do i=1,nprt + ij = iwk(i) + print 8005,rla(ij),rlo(ij),fld(ij),fldomn + 8005 format(' open ocean min. check. lat=',f5.1, + & ' lon=',f6.1,' fld=',e11.4,' to ',e11.4) + enddo + endif + if (mode .eq. 1) then + do i=1,kmino + fld(iwk(i)) = fldomn + enddo + endif + endif +! +! upper bound check over open ocean +! + if (fldomx .ne. 999.0) then + do i=i1_t,i2_t + if(fldomx.ne.999..and.slimsk(i).eq.0..and. + & fld(i).gt.fldomx+epsfld) then + kmaxo=kmaxo+1 + iwk(kmaxo) = i + endif + enddo + if(me == 0 . and. it == 1 .and. num_threads == 1) then + nprt = min(mmprt,kmaxo) + do i=1,nprt + ij = iwk(i) + print 8006,rla(ij),rlo(ij),fld(ij),fldomx + 8006 format(' open ocean max. check. lat=',f5.1, + & ' lon=',f6.1,' fld=',e11.4, ' to ',e11.4) + enddo + endif + if (mode .eq. 1) then + do i=1,kmaxo + fld(iwk(i)) = fldomx + enddo + endif + endif +! +! lower bound check over sea ice without snow +! + if (fldimn .ne. 999.0) then + do i=i1_t,i2_t + if(slimsk(i).eq.2..and.sno(i).le.0..and. + & fld(i).lt.fldimn-epsfld) then + kmini=kmini+1 + iwk(kmini) = i + endif + enddo + if(me == 0 . and. it == 1 .and. num_threads == 1) then + nprt = min(mmprt,kmini) + do i=1,nprt + ij = iwk(i) + print 8007,rla(ij),rlo(ij),fld(ij),fldimn + 8007 format(' seaice no snow min. check lat=',f5.1, + & ' lon=',f6.1,' fld=',e11.4, ' to ',e11.4) + enddo + endif + if (mode .eq. 1) then + do i=1,kmini + fld(iwk(i)) = fldimn + enddo + endif + endif +! +! upper bound check over sea ice without snow +! + if (fldimx .ne. 999.0) then + do i=i1_t,i2_t + if(slimsk(i).eq.2..and.sno(i).le.0..and. + & fld(i).gt.fldimx+epsfld .and. iceflg(i)) then +! & fld(i).gt.fldimx+epsfld) then + kmaxi=kmaxi+1 + iwk(kmaxi) = i + endif + enddo + if(me == 0 . and. it == 1 .and. num_threads == 1) then + nprt = min(mmprt,kmaxi) + do i=1,nprt + ij = iwk(i) + print 8008,rla(ij),rlo(ij),fld(ij),fldimx + 8008 format(' seaice no snow max. check lat=',f5.1, + & ' lon=',f6.1,' fld=',e11.4, ' to ',e11.4) + enddo + endif + if (mode .eq. 1) then + do i=1,kmaxi + fld(iwk(i)) = fldimx + enddo + endif + endif +! +! lower bound check over sea ice with snow +! + if (fldjmn .ne. 999.0) then + do i=i1_t,i2_t + if(slimsk(i).eq.2..and.sno(i).gt.0..and. + & fld(i).lt.fldjmn-epsfld) then + kminj=kminj+1 + iwk(kminj) = i + endif + enddo + if(me == 0 . and. it == 1 .and. num_threads == 1) then + nprt = min(mmprt,kminj) + do i=1,nprt + ij = iwk(i) + print 8009,rla(ij),rlo(ij),fld(ij),fldjmn + 8009 format(' sea ice snow min. check lat=',f5.1, + & ' lon=',f6.1,' fld=',e11.4, ' to ',e11.4) + enddo + endif + if (mode .eq. 1) then + do i=1,kminj + fld(iwk(i)) = fldjmn + enddo + endif + endif +! +! upper bound check over sea ice with snow +! + if (fldjmx .ne. 999.0) then + do i=i1_t,i2_t + if(slimsk(i).eq.2..and.sno(i).gt.0..and. + & fld(i).gt.fldjmx+epsfld .and. iceflg(i)) then +! & fld(i).gt.fldjmx+epsfld) then + kmaxj=kmaxj+1 + iwk(kmaxj) = i + endif + enddo + if(me == 0 .and. it == 1 .and. num_threads == 1) then + nprt = min(mmprt,kmaxj) + do i=1,nprt + ij = iwk(i) + print 8010,rla(ij),rlo(ij),fld(ij),fldjmx + 8010 format(' seaice snow max check lat=',f5.1, + & ' lon=',f6.1,' fld=',e11.4, ' to ',e11.4) + enddo + endif + if (mode .eq. 1) then + do i=1,kmaxj + fld(iwk(i)) = fldjmx + enddo + endif + endif + enddo ! end of threaded loop +!$omp end parallel do +! +! print results +! + if(me .eq. 0) then +! write(6,*) 'summary of qc' + permax=0. + if(kminl.gt.0) then + per=float(kminl)/float(len)*100. + print 9001,fldlmn,kminl,per + 9001 format(' bare land min check. modified to ',f8.1, + & ' at ',i5,' points ',f8.1,'percent') + if(per.gt.permax) permax=per + endif + if(kmaxl.gt.0) then + per=float(kmaxl)/float(len)*100. + print 9002,fldlmx,kmaxl,per + 9002 format(' bare land max check. modified to ',f8.1, + & ' at ',i5,' points ',f4.1,'percent') + if(per.gt.permax) permax=per + endif + if(kmino.gt.0) then + per=float(kmino)/float(len)*100. + print 9003,fldomn,kmino,per + 9003 format(' open ocean min check. modified to ',f8.1, + & ' at ',i5,' points ',f4.1,'percent') + if(per.gt.permax) permax=per + endif + if(kmaxo.gt.0) then + per=float(kmaxo)/float(len)*100. + print 9004,fldomx,kmaxo,per + 9004 format(' open sea max check. modified to ',f8.1, + & ' at ',i5,' points ',f4.1,'percent') + if(per.gt.permax) permax=per + endif + if(kmins.gt.0) then + per=float(kmins)/float(len)*100. + print 9009,fldsmn,kmins,per + 9009 format(' snow covered land min check. modified to ',f8.1, + & ' at ',i5,' points ',f4.1,'percent') + if(per.gt.permax) permax=per + endif + if(kmaxs.gt.0) then + per=float(kmaxs)/float(len)*100. + print 9010,fldsmx,kmaxs,per + 9010 format(' snow covered land max check. modified to ',f8.1, + & ' at ',i5,' points ',f4.1,'percent') + if(per.gt.permax) permax=per + endif + if(kmini.gt.0) then + per=float(kmini)/float(len)*100. + print 9005,fldimn,kmini,per + 9005 format(' bare ice min check. modified to ',f8.1, + & ' at ',i5,' points ',f4.1,'percent') + if(per.gt.permax) permax=per + endif + if(kmaxi.gt.0) then + per=float(kmaxi)/float(len)*100. + print 9006,fldimx,kmaxi,per + 9006 format(' bare ice max check. modified to ',f8.1, + & ' at ',i5,' points ',f4.1,'percent') + if(per.gt.permax) permax=per + endif + if(kminj.gt.0) then + per=float(kminj)/float(len)*100. + print 9007,fldjmn,kminj,per + 9007 format(' snow covered ice min check. modified to ',f8.1, + & ' at ',i5,' points ',f4.1,'percent') + if(per.gt.permax) permax=per + endif + if(kmaxj.gt.0) then + per=float(kmaxj)/float(len)*100. + print 9008,fldjmx,kmaxj,per + 9008 format(' snow covered ice max check. modified to ',f8.1, + & ' at ',i5,' points ',f4.1,'percent') + if(per.gt.permax) permax=per + endif +! commented on 06/30/99 -- moorthi +! if(lgchek) then +! if(permax.gt.percrit) then +! write(6,*) ' too many bad points. aborting ....' +! call abort +! endif +! endif +! + endif +! + return + end + +!>\ingroup mod_sfcsub + subroutine setzro(fld,eps,len) +! + use machine , only : kind_io8,kind_io4 + implicit none + integer i,len + real (kind=kind_io8) fld(len),eps + do i=1,len + if(abs(fld(i)).lt.eps) fld(i) = 0. + enddo + return + end + +!>\ingroup mod_sfcsub + subroutine getscv(snofld,scvfld,len) +! + use machine , only : kind_io8,kind_io4 + implicit none + integer i,len + real (kind=kind_io8) snofld(len),scvfld(len) +! + do i=1,len + scvfld(i) = 0. + if(snofld(i).gt.0.) scvfld(i) = 1. + enddo + return + end + +!>\ingroup mod_sfcsub + subroutine getstc(tsffld,tg3fld,slifld,len,lsoil,stcfld,tsfimx) +! + use machine , only : kind_io8,kind_io4 + implicit none + integer k,i,len,lsoil + real (kind=kind_io8) factor,tsfimx + real (kind=kind_io8) tsffld(len), tg3fld(len), slifld(len) + real (kind=kind_io8) stcfld(len,lsoil) +! +! layer soil temperature +! + do k = 1, lsoil + do i = 1, len + if(slifld(i).eq.1.0) then + factor = ((k-1) * 2 + 1) / (2. * lsoil) + stcfld(i,k) = factor*tg3fld(i)+(1.-factor)*tsffld(i) + elseif(slifld(i).eq.2.0) then + factor = ((k-1) * 2 + 1) / (2. * lsoil) + stcfld(i,k) = factor*tsfimx+(1.-factor)*tsffld(i) + else + stcfld(i,k) = tg3fld(i) + endif + enddo + enddo + if(lsoil.gt.2) then + do k = 3, lsoil + do i = 1, len + stcfld(i,k) = stcfld(i,2) + enddo + enddo + endif + return + end + +!>\ingroup mod_sfcsub +!! This subroutine calculates layer soil wetness. + subroutine getsmc(wetfld,len,lsoil,smcfld,me) +! + use machine , only : kind_io8,kind_io4 + implicit none + integer k,i,len,lsoil,me + real (kind=kind_io8) wetfld(len), smcfld(len,lsoil) +! + if (me .eq. 0) write(6,*) 'getsmc' +! +! layer soil wetness +! + do k = 1, lsoil + do i = 1, len + smcfld(i,k) = (wetfld(i)*1000./150.)*.37 + .1 + enddo + enddo + return + end + +!>\ingroup mod_sfcsub + subroutine usesgt(sig1t,slianl,tg3anl,len,lsoil,tsfanl,stcanl, + & tsfimx) +! + use machine , only : kind_io8,kind_io4 + implicit none + integer i,len,lsoil + real (kind=kind_io8) tsfimx + real (kind=kind_io8) sig1t(len), slianl(len), tg3anl(len) + real (kind=kind_io8) tsfanl(len), stcanl(len,lsoil) +! +! soil temperature +! + if(sig1t(1).gt.0.) then + do i=1,len + if(slianl(i).ne.0.) then + tsfanl(i) = sig1t(i) + endif + enddo + endif + call getstc(tsfanl,tg3anl,slianl,len,lsoil,stcanl,tsfimx) +! + return + end + +!>\ingroup mod_sfcsub + subroutine snosfc(snoanl,tsfanl,tsfsmx,len,me) + use machine , only : kind_io8,kind_io4 + implicit none + integer kount,i,len,me + real (kind=kind_io8) per,tsfsmx + real (kind=kind_io8) snoanl(len), tsfanl(len) +! + if (me .eq. 0) write(6,*) 'set snow temp to tsfsmx if greater' + kount=0 + do i=1,len + if(snoanl(i).gt.0.) then + if(tsfanl(i).gt.tsfsmx) tsfanl(i)=tsfsmx + kount = kount + 1 + endif + enddo + if(kount.gt.0) then + if(me .eq. 0) then + per=float(kount)/float(len)*100. + write(6,*) 'snow sfc. tsf set to ',tsfsmx,' at ', + & kount, ' points ',per,'percent' + endif + endif + return + end + +!>\ingroup mod_sfcsub + subroutine albocn(albclm,slmask,albomx,len) + use machine , only : kind_io8,kind_io4 + implicit none + integer i,len + real (kind=kind_io8) albomx + real (kind=kind_io8) albclm(len,4), slmask(len) + do i=1,len + if(slmask(i).eq.0) then + albclm(i,1) = albomx + albclm(i,2) = albomx + albclm(i,3) = albomx + albclm(i,4) = albomx + endif + enddo + return + end + +!>\ingroup mod_sfcsub + subroutine qcmxice(glacir,amxice,len,me) + use machine , only : kind_io8,kind_io4 + implicit none + integer i,kount,len,me + real (kind=kind_io8) glacir(len),amxice(len),per + if (me .eq. 0) write(6,*) 'qc of maximum ice extent' + kount=0 + do i=1,len + if(glacir(i).eq.1..and.amxice(i).eq.0.) then + amxice(i) = 0. + kount = kount + 1 + endif + enddo + if(kount.gt.0) then + per = float(kount) / float(len)*100. + if(me .eq. 0) write(6,*) ' max ice limit less than glacier' + &, ' coverage at ', kount, ' points ',per,'percent' + endif + return + end + +!>\ingroup mod_sfcsub + subroutine qcsli(slianl,slifcs,len,me) + use machine , only : kind_io8,kind_io4 + implicit none + integer i,kount,len,me + real (kind=kind_io8) slianl(len), slifcs(len),per + if (me .eq. 0) then + write(6,*) ' ' + write(6,*) 'qcsli' + endif + kount=0 + do i=1,len + if(slianl(i).eq.1..and.slifcs(i).eq.0.) then + kount = kount + 1 + slifcs(i) = 1. + endif + if(slianl(i).eq.0..and.slifcs(i).eq.1.) then + kount = kount + 1 + slifcs(i) = 0. + endif + if(slianl(i).eq.2..and.slifcs(i).eq.1.) then + kount = kount + 1 + slifcs(i) = 0. + endif + if(slianl(i).eq.1..and.slifcs(i).eq.2.) then + kount = kount + 1 + slifcs(i) = 1. + endif + enddo + if(kount.gt.0) then + per=float(kount)/float(len)*100. + if(me .eq. 0) then + write(6,*) ' inconsistency of slmask between forecast and', + & ' analysis corrected at ',kount, ' points ',per, + & 'percent' + endif + endif + return + end +! subroutine nntprt(data,imax,fact) +! real (kind=kind_io8) data(imax) +! ilast=0 +! i1=1 +! i2=80 +!1112 continue +! if(i2.ge.imax) then +! ilast=1 +! i2=imax +! endif +! write(6,*) ' ' +! do j=1,jmax +! write(6,1111) (nint(data(imax*(j-1)+i)*fact),i=i1,i2) +! enddo +! if(ilast.eq.1) return +! i1=i1+80 +! i2=i1+79 +! if(i2.ge.imax) then +! ilast=1 +! i2=imax +! endif +! go to 1112 +!1111 format(80i1) +! return +! end + +!>\ingroup mod_sfcsub + subroutine qcbyfc(tsffcs,snofcs,qctsfs,qcsnos,qctsfi, + & len,lsoil,snoanl,aisanl,slianl,tsfanl,albanl, + & zoranl,smcanl, + & smcclm,tsfsmx,albomx,zoromx, me) +! + use machine , only : kind_io8,kind_io4 + implicit none + integer kount,me,k,i,lsoil,len + real (kind=kind_io8) zoromx,per,albomx,qctsfi,qcsnos,qctsfs,tsfsmx + real (kind=kind_io8) tsffcs(len), snofcs(len) + real (kind=kind_io8) snoanl(len), aisanl(len), + & slianl(len), zoranl(len), + & tsfanl(len), albanl(len,4), + & smcanl(len,lsoil) + real (kind=kind_io8) smcclm(len,lsoil) +! + if (me .eq. 0) write(6,*) 'qc of snow and sea-ice analysis' +! +! qc of snow analysis +! +! questionable snow cover +! + kount = 0 + do i=1,len + if(slianl(i).gt.0..and. + & tsffcs(i).gt.qctsfs.and.snoanl(i).gt.0.) then + kount = kount + 1 + snoanl(i) = 0. + tsfanl(i) = tsffcs(i) + endif + enddo + if(kount.gt.0) then + per=float(kount)/float(len)*100. + if (me .eq. 0) then + write(6,*) ' guess surface temp .gt. ',qctsfs, + & ' but snow analysis indicates snow cover' + write(6,*) ' snow analysis set to zero', + & ' at ',kount, ' points ',per,'percent' + endif + endif +! +! questionable no snow cover +! + kount = 0 + do i=1,len + if(slianl(i).gt.0..and. + & snofcs(i).gt.qcsnos.and.snoanl(i).lt.0.) then + kount = kount + 1 + snoanl(i) = snofcs(i) + tsfanl(i) = tsffcs(i) + endif + enddo + if(kount.gt.0) then + per=float(kount)/float(len)*100. + if (me .eq. 0) then + write(6,*) ' guess snow depth .gt. ',qcsnos, + & ' but snow analysis indicates no snow cover' + write(6,*) ' snow analysis set to guess value', + & ' at ',kount, ' points ',per,'percent' + endif + endif +! +! questionable sea ice cover ! this qc is disable to correct error in +! surface temparature over observed sea ice points +! +! kount = 0 +! do i=1,len +! if(slianl(i).eq.2..and. +! & tsffcs(i).gt.qctsfi.and.aisanl(i).eq.1.) then +! kount = kount + 1 +! aisanl(i) = 0. +! slianl(i) = 0. +! tsfanl(i) = tsffcs(i) +! snoanl(i) = 0. +! zoranl(i) = zoromx +! albanl(i,1) = albomx +! albanl(i,2) = albomx +! albanl(i,3) = albomx +! albanl(i,4) = albomx +! do k=1,lsoil +! smcanl(i,k) = smcclm(i,k) +! enddo +! endif +! enddo +! if(kount.gt.0) then +! per=float(kount)/float(len)*100. +! if (me .eq. 0) then +! write(6,*) ' guess surface temp .gt. ',qctsfi, +! & ' but sea-ice analysis indicates sea-ice' +! write(6,*) ' sea-ice analysis set to zero', +! & ' at ',kount, ' points ',per,'percent' +! endif +! endif +! + return + end + +!>\ingroup mod_sfcsub + subroutine setrmsk(kpds5,slmask,igaul,jgaul,wlon,rnlat, + & data,imax,jmax,rlnout,rltout,lmask,rslmsk + &, gaus,blno, blto, kgds1, kpds4, lbms) + use machine , only : kind_io8,kind_io4 + use sfccyc_module + implicit none + real (kind=kind_io8) blno,blto,wlon,rnlat,crit,data_max + integer i,j,ijmax,jgaul,igaul,kpds5,jmax,imax, kgds1, kspla + integer, intent(in) :: kpds4 + logical*1, intent(in) :: lbms(imax,jmax) + real*4 :: dummy(imax,jmax) + + real (kind=kind_io8) slmask(igaul,jgaul) + real (kind=kind_io8) data(imax,jmax),rslmsk(imax,jmax) + &, rlnout(imax), rltout(jmax) + real (kind=kind_io8) a(jmax), w(jmax), radi, dlat, dlon + logical lmask, gaus +! +! set the longitude and latitudes for the grib file +! + if (kgds1 .eq. 4) then ! grib file on gaussian grid + kspla=4 + call splat(kspla, jmax, a, w) +! + radi = 180.0 / (4.*atan(1.)) + do j=1,jmax + rltout(j) = acos(a(j)) * radi + enddo +! + if (rnlat .gt. 0.0) then + do j=1,jmax + rltout(j) = 90. - rltout(j) + enddo + else + do j=1,jmax + rltout(j) = -90. + rltout(j) + enddo + endif + elseif (kgds1 .eq. 0) then ! grib file on lat/lon grid + dlat = -(rnlat+rnlat) / float(jmax-1) + do j=1,jmax + rltout(j) = rnlat + (j-1) * dlat + enddo + else ! grib file on some other grid + call abort + endif + dlon = 360.0 / imax + do i=1,imax + rlnout(i) = wlon + (i-1)*dlon + enddo +! +! + ijmax = imax*jmax + rslmsk = 0. +! +! surface temperature +! + if(kpds5.eq.kpdtsf) then +! lmask=.false. + call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat + &, rlnout, rltout, gaus, blno, blto) +! &, dlon, dlat, gaus, blno, blto) + crit=0.5 + call rof01(rslmsk,ijmax,'ge',crit) + lmask=.true. +! +! bucket soil wetness +! + elseif(kpds5.eq.kpdwet) then + call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat + &, rlnout, rltout, gaus, blno, blto) +! &, dlon, dlat, gaus, blno, blto) + crit=0.5 + call rof01(rslmsk,ijmax,'ge',crit) + lmask=.true. +! write(6,*) 'wet rslmsk' +! znnt=1. +! call nntprt(rslmsk,ijmax,znnt) +! +! snow depth +! + elseif(kpds5.eq.kpdsnd) then + if(kpds4 == 192) then ! use the bitmap + rslmsk = 0. + do j = 1, jmax + do i = 1, imax + if (lbms(i,j)) then + rslmsk(i,j) = 1. + end if + enddo + enddo + lmask=.true. + else + lmask=.false. + end if +! +! snow liq equivalent depth +! + elseif(kpds5.eq.kpdsno) then + call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat + &, rlnout, rltout, gaus, blno, blto) +! &, dlon, dlat, gaus, blno, blto) + crit=0.5 + call rof01(rslmsk,ijmax,'ge',crit) + lmask=.true. +! write(6,*) 'sno rslmsk' +! znnt=1. +! call nntprt(rslmsk,ijmax,znnt) +! +! soil moisture +! + elseif(kpds5.eq.kpdsmc) then + if(kpds4 == 192) then ! use the bitmap + rslmsk = 0. + do j = 1, jmax + do i = 1, imax + if (lbms(i,j)) then + rslmsk(i,j) = 1. + end if + enddo + enddo + lmask=.true. + else + call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat + &, rlnout, rltout, gaus, blno, blto) + crit=0.5 + call rof01(rslmsk,ijmax,'ge',crit) + lmask=.true. + endif +! +! surface roughness +! + elseif(kpds5.eq.kpdzor) then + do j=1,jmax + do i=1,imax + rslmsk(i,j)=data(i,j) + enddo + enddo + crit=9.9 + call rof01(rslmsk,ijmax,'lt',crit) + lmask=.true. +! write(6,*) 'zor rslmsk' +! znnt=1. +! call nntprt(rslmsk,ijmax,znnt) +! +! albedo +! +! elseif(kpds5.eq.kpdalb) then +! do j=1,jmax +! do i=1,imax +! rslmsk(i,j)=data(i,j) +! enddo +! enddo +! crit=99. +! call rof01(rslmsk,ijmax,'lt',crit) +! lmask=.true. +! write(6,*) 'alb rslmsk' +! znnt=1. +! call nntprt(rslmsk,ijmax,znnt) +! +! albedo +! +!cbosu new snowfree albedo database has bitmap, use it. + elseif(kpds5.eq.kpdalb(1)) then + if (kpds4 == 192) then ! use the bitmap + rslmsk = 0. + do j = 1, jmax + do i = 1, imax + if (lbms(i,j)) then + rslmsk(i,j) = 1. + end if + enddo + enddo + lmask = .true. + else ! no bitmap. old database has no water flag. + lmask=.false. + end if + elseif(kpds5.eq.kpdalb(2)) then +!cbosu + if (kpds4 == 192) then ! use the bitmap + rslmsk = 0. + do j = 1, jmax + do i = 1, imax + if (lbms(i,j)) then + rslmsk(i,j) = 1. + end if + enddo + enddo + lmask = .true. + else ! no bitmap. old database has no water flag. + lmask=.false. + end if + elseif(kpds5.eq.kpdalb(3)) then +!cbosu + if (kpds4 == 192) then ! use the bitmap + rslmsk = 0. + do j = 1, jmax + do i = 1, imax + if (lbms(i,j)) then + rslmsk(i,j) = 1. + end if + enddo + enddo + lmask = .true. + else ! no bitmap. old database has no water flag. + lmask=.false. + end if + elseif(kpds5.eq.kpdalb(4)) then +!cbosu + if (kpds4 == 192) then ! use the bitmap + rslmsk = 0. + do j = 1, jmax + do i = 1, imax + if (lbms(i,j)) then + rslmsk(i,j) = 1. + end if + enddo + enddo + lmask = .true. + else ! no bitmap. old database has no water flag. + lmask=.false. + end if +! +! vegetation fraction for albedo +! + elseif(kpds5.eq.kpdalf(1)) then +! rslmsk=data +! crit=0. +! call rof01(rslmsk,ijmax,'gt',crit) +! lmask=.true. + lmask=.false. + elseif(kpds5.eq.kpdalf(2)) then +! rslmsk=data +! crit=0. +! call rof01(rslmsk,ijmax,'gt',crit) +! lmask=.true. + lmask=.false. +! +! sea ice +! + elseif(kpds5.eq.kpdais) then + lmask=.false. +! call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat +! &, dlon, dlat, gaus, blno, blto) +! crit=0.5 +! call rof01(rslmsk,ijmax,'ge',crit) +! + data_max = 0.0 + do j=1,jmax + do i=1,imax + rslmsk(i,j) = data(i,j) + data_max= max(data_max,data(i,j)) + enddo + enddo + crit=1.0 + if (data_max .gt. crit) then + call rof01(rslmsk,ijmax,'gt',crit) + lmask=.true. + else + lmask=.false. + endif +! write(6,*) 'acn rslmsk' +! znnt=1. +! call nntprt(rslmsk,ijmax,znnt) +! +! deep soil temperature +! + elseif(kpds5.eq.kpdtg3) then + lmask=.false. +! call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat +! &, rlnout, rltout, gaus, blno, blto) +! &, dlon, dlat, gaus, blno, blto) +! crit=0.5 +! call rof01(rslmsk,ijmax,'ge',crit) +! lmask=.true. +! +! plant resistance +! +! elseif(kpds5.eq.kpdplr) then +! call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat +! &, rlnout, rltout, gaus, blno, blto) +! &, dlon, dlat, gaus, blno, blto) +! crit=0.5 +! call rof01(rslmsk,ijmax,'ge',crit) +! lmask=.true. +! +! write(6,*) 'plr rslmsk' +! znnt=1. +! call nntprt(rslmsk,ijmax,znnt) +! +! glacier points +! + elseif(kpds5.eq.kpdgla) then + lmask=.false. +! +! max ice extent +! + elseif(kpds5.eq.kpdmxi) then + lmask=.false. +! +! snow cover +! + elseif(kpds5.eq.kpdscv) then + call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat + &, rlnout, rltout, gaus, blno, blto) +! &, dlon, dlat, gaus, blno, blto) + crit=0.5 + call rof01(rslmsk,ijmax,'ge',crit) + lmask=.true. +! write(6,*) 'scv rslmsk' +! znnt=1. +! call nntprt(rslmsk,ijmax,znnt) +! +! sea ice concentration +! + elseif(kpds5.eq.kpdacn) then + lmask=.false. + call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat + &, rlnout, rltout, gaus, blno, blto) +! &, dlon, dlat, gaus, blno, blto) + crit=0.5 + call rof01(rslmsk,ijmax,'ge',crit) + lmask=.true. +! write(6,*) 'acn rslmsk' +! znnt=1. +! call nntprt(rslmsk,ijmax,znnt) +! +! vegetation cover +! + elseif(kpds5.eq.kpdveg) then +!cggg + if (kpds4 == 192) then ! use the bitmap + rslmsk = 0. + do j = 1, jmax + do i = 1, imax + if (lbms(i,j)) then + rslmsk(i,jmax-j+1) = 1. ! need to flip grid in n/s direction + end if + enddo + enddo + lmask = .true. + else ! no bitmap, set mask the old way. + + call ga2la(slmask,igaul,jgaul,rslmsk,imax,jmax,wlon,rnlat + &, rlnout, rltout, gaus, blno, blto) + crit=0.5 + call rof01(rslmsk,ijmax,'ge',crit) + lmask=.true. + + end if +! +! soil type +! + elseif(kpds5.eq.kpdsot) then + + if (kpds4 == 192) then ! use the bitmap + rslmsk = 0. + do j = 1, jmax + do i = 1, imax + if (lbms(i,j)) then + rslmsk(i,j) = 1. + end if + enddo + enddo +! soil type is zero over water, use this to get a bitmap. + else + do j = 1, jmax + do i = 1, imax + rslmsk(i,j) = data(i,j) + enddo + enddo + crit=0.1 + call rof01(rslmsk,ijmax,'gt',crit) + endif + lmask=.true. +! +! vegetation type +! + elseif(kpds5.eq.kpdvet) then + + if (kpds4 == 192) then ! use the bitmap + rslmsk = 0. + do j = 1, jmax + do i = 1, imax + if (lbms(i,j)) then + rslmsk(i,j) = 1. + end if + enddo + enddo +! veg type is zero over water, use this to get a bitmap. + else + do j = 1, jmax + do i = 1, imax + rslmsk(i,j) = data(i,j) + enddo + enddo + crit=0.1 + call rof01(rslmsk,ijmax,'gt',crit) + endif + lmask=.true. +! +! these are for four new data type added by clu -- not sure its correct! +! + elseif(kpds5.eq.kpdvmn) then +! +!cggg greenness is zero over water, use this to get a bitmap. +! + do j = 1, jmax + do i = 1, imax + rslmsk(i,j) = data(i,j) + enddo + enddo +! + crit=0.1 + call rof01(rslmsk,ijmax,'gt',crit) + lmask=.true. +!cggg lmask=.false. +! + elseif(kpds5.eq.kpdvmx) then +! +!cggg greenness is zero over water, use this to get a bitmap. +! + do j = 1, jmax + do i = 1, imax + rslmsk(i,j) = data(i,j) + enddo + enddo +! + crit=0.1 + call rof01(rslmsk,ijmax,'gt',crit) + lmask=.true. +!cggg lmask=.false. +! + elseif(kpds5.eq.kpdslp) then +! +!cggg slope type is zero over water, use this to get a bitmap. +! + do j = 1, jmax + do i = 1, imax + rslmsk(i,j) = data(i,j) + enddo + enddo +! + crit=0.1 + call rof01(rslmsk,ijmax,'gt',crit) + lmask=.true. +!cggg lmask=.false. +! +!cbosu new maximum snow albedo database has bitmap + elseif(kpds5.eq.kpdabs) then + if (kpds4 == 192) then ! use the bitmap + rslmsk = 0. + do j = 1, jmax + do i = 1, imax + if (lbms(i,j)) then + rslmsk(i,j) = 1. + end if + enddo + enddo + lmask = .true. + else ! no bitmap. old database has zero over water + do j = 1, jmax + do i = 1, imax + rslmsk(i,j) = data(i,j) + enddo + enddo + crit=0.1 + call rof01(rslmsk,ijmax,'gt',crit) + lmask=.true. + end if + endif +! + return + end + +!>\ingroup mod_sfcsub + subroutine ga2la(gauin,imxin,jmxin,regout,imxout,jmxout, + & wlon,rnlat,rlnout,rltout,gaus,blno, blto) + use machine , only : kind_io8,kind_io4 + implicit none + integer i1,i2,j2,ishft,i,jj,j1,jtem,jmxout,imxin,jmxin,imxout, + & j,iret + real (kind=kind_io8) alamd,dxin,aphi,x,sum1,sum2,y,dlati,wlon, + & rnlat,dxout,dphi,dlat,facns,tem,blno, + & blto +! +! interpolation from lat/lon grid to other lat/lon grid +! + real (kind=kind_io8) gauin (imxin,jmxin), regout(imxout,jmxout) + &, rlnout(imxout), rltout(jmxout) + logical gaus +! + real, allocatable :: gaul(:) + real (kind=kind_io8) ddx(imxout),ddy(jmxout) + integer iindx1(imxout), iindx2(imxout), + & jindx1(jmxout), jindx2(jmxout) + integer jmxsav,n,kspla + data jmxsav/0/ + save jmxsav, gaul, dlati + real (kind=kind_io8) radi + real (kind=kind_io8) a(jmxin), w(jmxin) +! +! + logical first + integer num_threads + data first /.true./ + save num_threads, first +! + integer len_thread_m, j1_t, j2_t, it + integer num_parthds +! + if (first) then + num_threads = num_parthds() + first = .false. + endif +! + if (jmxin .ne. jmxsav) then + if (jmxsav .gt. 0) deallocate (gaul, stat=iret) + allocate (gaul(jmxin)) + jmxsav = jmxin + if (gaus) then +cjfe call gaulat(gaul,jmxin) +cjfe +! + kspla=4 + call splat(kspla, jmxin, a, w) +! + radi = 180.0 / (4.*atan(1.)) + do n=1,jmxin + gaul(n) = acos(a(n)) * radi + enddo +cjfe + do j=1,jmxin + gaul(j) = 90. - gaul(j) + enddo + else + dlat = -2*blto / float(jmxin-1) + dlati = 1 / dlat + do j=1,jmxin + gaul(j) = blto + (j-1) * dlat + enddo + endif + endif +! +! + dxin = 360. / float(imxin ) +! + do i=1,imxout + alamd = rlnout(i) + i1 = floor((alamd-blno)/dxin) + 1 + ddx(i) = (alamd-blno)/dxin-(i1-1) + iindx1(i) = modulo(i1-1,imxin) + 1 + iindx2(i) = modulo(i1 ,imxin) + 1 + enddo +! +! + len_thread_m = (jmxout+num_threads-1) / num_threads +! + if (gaus) then +! +!$omp parallel do private(j1_t,j2_t,it,j1,j2,jj) +!$omp+private(aphi) +!$omp+shared(num_threads,len_thread_m) +!$omp+shared(jmxin,jmxout,gaul,rltout,jindx1,ddy) +! + do it=1,num_threads ! start of threaded loop ................... + j1_t = (it-1)*len_thread_m+1 + j2_t = min(j1_t+len_thread_m-1,jmxout) +! + j2=1 + do 40 j=j1_t,j2_t + aphi=rltout(j) + do 50 jj=1,jmxin + if(aphi.lt.gaul(jj)) go to 50 + j2=jj + go to 42 + 50 continue + 42 continue + if(j2.gt.2) go to 43 + j1=1 + j2=2 + go to 44 + 43 continue + if(j2.le.jmxin) go to 45 + j1=jmxin-1 + j2=jmxin + go to 44 + 45 continue + j1=j2-1 + 44 continue + jindx1(j)=j1 + jindx2(j)=j2 + ddy(j)=(aphi-gaul(j1))/(gaul(j2)-gaul(j1)) + 40 continue + enddo ! end of threaded loop ................... +!$omp end parallel do +! + else +!$omp parallel do private(j1_t,j2_t,it,j1,j2,jtem) +!$omp+private(aphi) +!$omp+shared(num_threads,len_thread_m) +!$omp+shared(jmxin,jmxout,gaul,rltout,jindx1,ddy,dlati,blto) +! + do it=1,num_threads ! start of threaded loop ................... + j1_t = (it-1)*len_thread_m+1 + j2_t = min(j1_t+len_thread_m-1,jmxout) +! + j2=1 + do 400 j=j1_t,j2_t + aphi=rltout(j) + jtem = (aphi - blto) * dlati + 1 + if (jtem .ge. 1 .and. jtem .lt. jmxin) then + j1 = jtem + j2 = j1 + 1 + ddy(j)=(aphi-gaul(j1))/(gaul(j2)-gaul(j1)) + elseif (jtem .eq. jmxin) then + j1 = jmxin + j2 = jmxin + ddy(j)=1.0 + else + j1 = 1 + j2 = 1 + ddy(j)=1.0 + endif +! + jindx1(j) = j1 + jindx2(j) = j2 + 400 continue + enddo ! end of threaded loop ................... +!$omp end parallel do + endif +! +! write(6,*) 'ga2la' +! write(6,*) 'iindx1' +! write(6,*) (iindx1(n),n=1,imxout) +! write(6,*) 'iindx2' +! write(6,*) (iindx2(n),n=1,imxout) +! write(6,*) 'jindx1' +! write(6,*) (jindx1(n),n=1,jmxout) +! write(6,*) 'jindx2' +! write(6,*) (jindx2(n),n=1,jmxout) +! write(6,*) 'ddy' +! write(6,*) (ddy(n),n=1,jmxout) +! write(6,*) 'ddx' +! write(6,*) (ddx(n),n=1,jmxout) +! +! +!$omp parallel do private(j1_t,j2_t,it,i,i1,i2) +!$omp+private(j,j1,j2,x,y) +!$omp+shared(num_threads,len_thread_m) +!$omp+shared(imxout,iindx1,jindx1,ddx,ddy,gauin,regout) +! + do it=1,num_threads ! start of threaded loop ................... + j1_t = (it-1)*len_thread_m+1 + j2_t = min(j1_t+len_thread_m-1,jmxout) +! + do j=j1_t,j2_t + y = ddy(j) + j1 = jindx1(j) + j2 = jindx2(j) + do i=1,imxout + x = ddx(i) + i1 = iindx1(i) + i2 = iindx2(i) + regout(i,j) = (1.-x)*((1.-y)*gauin(i1,j1) + y*gauin(i1,j2)) + & + x *((1.-y)*gauin(i2,j1) + y*gauin(i2,j2)) + enddo + enddo + enddo ! end of threaded loop ................... +!$omp end parallel do +! + sum1 = 0. + sum2 = 0. + do i=1,imxin + sum1 = sum1 + gauin(i,1) + sum2 = sum2 + gauin(i,jmxin) + enddo + sum1 = sum1 / float(imxin) + sum2 = sum2 / float(imxin) +! + if (gaus) then + if (rnlat .gt. 0.0) then + do i=1,imxout + regout(i, 1) = sum1 + regout(i,jmxout) = sum2 + enddo + else + do i=1,imxout + regout(i, 1) = sum2 + regout(i,jmxout) = sum1 + enddo + endif + else + if (blto .lt. 0.0) then + if (rnlat .gt. 0.0) then + do i=1,imxout + regout(i, 1) = sum2 + regout(i,jmxout) = sum1 + enddo + else + do i=1,imxout + regout(i, 1) = sum1 + regout(i,jmxout) = sum2 + enddo + endif + else + if (rnlat .lt. 0.0) then + do i=1,imxout + regout(i, 1) = sum2 + regout(i,jmxout) = sum1 + enddo + else + do i=1,imxout + regout(i, 1) = sum1 + regout(i,jmxout) = sum2 + enddo + endif + endif + endif +! + return + end + +!>\ingroup mod_sfcsub + subroutine landtyp(vegtype,soiltype,slptype,slmask,len) + use machine , only : kind_io8,kind_io4 + implicit none + integer i,len + real (kind=kind_io8) vegtype(len),soiltype(len),slmask(len) + +, slptype(len) +! +! make sure that the soil type and veg type are non-zero over land +! + do i = 1, len + if (slmask(i) .eq. 1) then + if (vegtype(i) .eq. 0.) vegtype(i) = 7 + if (soiltype(i) .eq. 0.) soiltype(i) = 2 + if (slptype(i) .eq. 0.) slptype(i) = 1 + endif + enddo + return + +!>\ingroup mod_sfcsub + end subroutine landtyp + subroutine gaulat(gaul,k) +! + use machine , only : kind_io8,kind_io4 + implicit none + integer n,k + real (kind=kind_io8) radi + real (kind=kind_io8) a(k), w(k), gaul(k) +! + call splat(4, k, a, w) +! + radi = 180.0 / (4.*atan(1.)) + do n=1,k + gaul(n) = acos(a(n)) * radi + enddo +! +! print *,'gaussian lat (deg) for jmax=',k +! print *,(gaul(n),n=1,k) +! + return + 70 write(6,6000) + 6000 format(//5x,'error in gauaw'//) + stop + end +!----------------------------------------------------------------------- +!>\ingroup mod_sfcsub +!! The subroutine conducts time interpolation of anomalies, +!! and add initial anomaly to date interpolated climatology. + subroutine anomint(tsfan0,tsfclm,tsfcl0,tsfanl,len) +! + use machine , only : kind_io8,kind_io4 + implicit none + integer i,len + real (kind=kind_io8) tsfanl(len), tsfan0(len), + & tsfclm(len), tsfcl0(len) +! +! time interpolation of anomalies +! add initial anomaly to date interpolated climatology +! + write(6,*) 'anomint' + do i=1,len + tsfanl(i) = tsfan0(i) - tsfcl0(i) + tsfclm(i) + enddo + return + end + +!>\ingroup mod_sfcsub + subroutine clima(lugb,iy,im,id,ih,fh,len,lsoil, + & slmask,fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, + & fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,fnvegc, + & fnvetc,fnsotc, + & fnvmnc,fnvmxc,fnslpc,fnabsc, + & tsfclm,tsfcl2,wetclm,snoclm,zorclm,albclm,aisclm, + & tg3clm,cvclm ,cvbclm,cvtclm, + & cnpclm,smcclm,stcclm,sliclm,scvclm,acnclm,vegclm, + & vetclm,sotclm,alfclm, + & vmnclm,vmxclm,slpclm,absclm, + & kpdtsf,kpdwet,kpdsno,kpdzor,kpdalb,kpdais, + & kpdtg3,kpdscv,kpdacn,kpdsmc,kpdstc,kpdveg, + & kpdvet,kpdsot,kpdalf,tsfcl0, + & kpdvmn,kpdvmx,kpdslp,kpdabs, + & deltsfc, lanom + &, imsk, jmsk, slmskh, outlat, outlon + &, gaus, blno, blto, me,lprnt,iprnt, fnalbc2, ialb + &, tile_num_ch, i_index, j_index) +! + use machine , only : kind_io8,kind_io4 + implicit none + character(len=*), intent(in) :: tile_num_ch + integer, intent(in) :: i_index(len), j_index(len) + real (kind=kind_io8) rjday,wei1x,wei2x,rjdayh,wei2m,wei1m,wei1s, + & wei2s,fh,stcmon1s,blto,blno,deltsfc,rjdayh2 + real (kind=kind_io8) wei1y,wei2y + integer jdoy,jday,jh,jdow,mmm,mmp,mm,iret,monend,i,k,jm,jd,iy4, + & jy,mon1,is2,isx,kpd9,is1,l,nn,mon2,mon,is,kpdsno, + & kpdzor,kpdtsf,kpdwet,kpdscv,kpdacn,kpdais,kpdtg3,im,id, + & lugb,iy,len,lsoil,ih,kpdsmc,iprnt,me,m1,m2,k1,k2, + & kpdvet,kpdsot,kpdstc,kpdveg,jmsk,imsk,j,ialb + &, kpdvmn,kpdvmx,kpdslp,kpdabs,landice_cat + integer kpdalb(4), kpdalf(2) +! + character*500 fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, + & fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,fnvegc, + & fnvetc,fnsotc,fnalbc2 + &, fnvmnc,fnvmxc,fnslpc,fnabsc + real (kind=kind_io8) tsfclm(len),tsfcl2(len), + & wetclm(len),snoclm(len), + & zorclm(len),albclm(len,4),aisclm(len), + & tg3clm(len),acnclm(len), + & cvclm (len),cvbclm(len),cvtclm(len), + & cnpclm(len), + & smcclm(len,lsoil),stcclm(len,lsoil), + & sliclm(len),scvclm(len),vegclm(len), + & vetclm(len),sotclm(len),alfclm(len,2) + &, vmnclm(len),vmxclm(len),slpclm(len),absclm(len) + real (kind=kind_io8) slmskh(imsk,jmsk) + real (kind=kind_io8) outlat(len), outlon(len) +! + real (kind=kind_io8) slmask(len), tsfcl0(len) + real (kind=kind_io8), allocatable :: slmask_noice(:) +! + logical lanom, gaus, first +! +! set z0 based on sib vegetation type + real (kind=kind_io8) z0_sib(13) + data z0_sib /2.653, 0.826, 0.563, 1.089, 0.854, 0.856, + & 0.035, 0.238, 0.065, 0.076, 0.011, 0.125, + & 0.011 / +! set z0 based on igbp vegetation type + real (kind=kind_io8) z0_igbp_min(20), z0_igbp_max(20) + real (kind=kind_io8) z0_season(12) + data z0_igbp_min /1.089, 2.653, 0.854, 0.826, 0.800, 0.050, + & 0.030, 0.856, 0.856, 0.150, 0.040, 0.130, + & 1.000, 0.250, 0.011, 0.011, 0.001, 0.076, + & 0.050, 0.030/ + data z0_igbp_max /1.089, 2.653, 0.854, 0.826, 0.800, 0.050, + & 0.030, 0.856, 0.856, 0.150, 0.040, 0.130, + & 1.000, 0.250, 0.011, 0.011, 0.001, 0.076, + & 0.050, 0.030/ +! +! dayhf : julian day of the middle of each month +! + real (kind=kind_io8) dayhf(13) + data dayhf/ 15.5, 45.0, 74.5,105.0,135.5,166.0, + & 196.5,227.5,258.0,288.5,319.0,349.5,380.5/ +! + real (kind=kind_io8) fha(5) + real(4) fha4(5) + integer w3kindreal,w3kindint + integer ida(8),jda(8),ivtyp, kpd7 +! + real (kind=kind_io8), allocatable :: tsf(:,:),sno(:,:), + & zor(:,:),wet(:,:), + & ais(:,:), acn(:,:), scv(:,:), smc(:,:,:), + & tg3(:), alb(:,:,:), alf(:,:), + & vet(:), sot(:), tsf2(:), + & veg(:,:), stc(:,:,:) + &, vmn(:), vmx(:), slp(:), absm(:) +! + integer mon1s, mon2s, sea1s, sea2s, sea1, sea2, hyr1, hyr2 + data first/.true./ + data mon1s/0/, mon2s/0/, sea1s/0/, sea2s/0/ +! + save first, tsf, sno, zor, wet, ais, acn, scv, smc, tg3, + & alb, alf, vet, sot, tsf2, veg, stc, + & vmn, vmx, slp, absm, + & mon1s, mon2s, sea1s, sea2s, dayhf, k1, k2, m1, m2, + & landice_cat +! + logical lprnt +! + do i=1,len + tsfclm(i) = 0.0 + tsfcl2(i) = 0.0 + snoclm(i) = 0.0 + wetclm(i) = 0.0 + zorclm(i) = 0.0 + aisclm(i) = 0.0 + tg3clm(i) = 0.0 + acnclm(i) = 0.0 + cvclm(i) = 0.0 + cvbclm(i) = 0.0 + cvtclm(i) = 0.0 + cnpclm(i) = 0.0 + sliclm(i) = 0.0 + scvclm(i) = 0.0 + vmnclm(i) = 0.0 + vmxclm(i) = 0.0 + slpclm(i) = 0.0 + absclm(i) = 0.0 + enddo + do k=1,lsoil + do i=1,len + smcclm(i,k) = 0.0 + stcclm(i,k) = 0.0 + enddo + enddo + do k=1,4 + do i=1,len + albclm(i,k) = 0.0 + enddo + enddo + do k=1,2 + do i=1,len + alfclm(i,k) = 0.0 + enddo + enddo +! + iret = 0 + monend = 9999 +! + if (first) then +! +! allocate variables to be saved +! + allocate (tsf(len,2), sno(len,2), zor(len,2), + & wet(len,2), ais(len,2), acn(len,2), + & scv(len,2), smc(len,lsoil,2), + & tg3(len), alb(len,4,2), alf(len,2), + & vet(len), sot(len), tsf2(len), +!clu [+1l] add vmn, vmx, slp, abs + & vmn(len), vmx(len), slp(len), absm(len), + & veg(len,2), stc(len,lsoil,2)) +! +! get tsf climatology for the begining of the forecast +! + if (fh .gt. 0.0) then +!cbosu + if (me == 0) print*,'bosu fh gt 0' + + iy4=iy + if(iy.lt.101) iy4=1900+iy4 + fha=0 + ida=0 + jda=0 +! fha(2)=nint(fh) + ida(1)=iy + ida(2)=im + ida(3)=id + ida(5)=ih + call w3kind(w3kindreal,w3kindint) + if(w3kindreal == 4) then + fha4=fha + call w3movdat(fha4,ida,jda) + else + call w3movdat(fha,ida,jda) + endif + jy=jda(1) + jm=jda(2) + jd=jda(3) + jh=jda(5) + if (me .eq. 0) write(6,*) ' forecast jy,jm,jd,jh', + & jy,jm,jd,jh + jdow = 0 + jdoy = 0 + jday = 0 + call w3doxdat(jda,jdow,jdoy,jday) + rjday=jdoy+jda(5)/24. + if(rjday.lt.dayhf(1)) rjday=rjday+365. +! + if (me .eq. 0) write(6,*) 'forecast jy,jm,jd,jh=',jy,jm,jd,jh +! +! for monthly mean climatology +! + monend = 12 + do mm=1,monend + mmm=mm + mmp=mm+1 + if(rjday.ge.dayhf(mmm).and.rjday.lt.dayhf(mmp)) then + mon1=mmm + mon2=mmp + go to 10 + endif + enddo + print *,'wrong rjday',rjday + call abort + 10 continue + wei1m = (dayhf(mon2)-rjday)/(dayhf(mon2)-dayhf(mon1)) + wei2m = (rjday-dayhf(mon1))/(dayhf(mon2)-dayhf(mon1)) + if(mon2.eq.13) mon2=1 + if (me .eq. 0) print *,'rjday,mon1,mon2,wei1m,wei2m=', + & rjday,mon1,mon2,wei1m,wei2m +! +! read monthly mean climatology of tsf +! + kpd7 = -1 + do nn=1,2 + mon = mon1 + if (nn .eq. 2) mon = mon2 + call fixrdc(lugb,fntsfc,kpdtsf,kpd7,mon,slmask, + & tsf(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + enddo +! +! tsf at the begining of forecast i.e. fh=0 +! + do i=1,len + tsfcl0(i) = wei1m * tsf(i,1) + wei2m * tsf(i,2) + enddo + endif + endif +! +! compute current jy,jm,jd,jh of forecast and the day of the year +! + iy4=iy + if(iy.lt.101) iy4=1900+iy4 + fha = 0 + ida = 0 + jda = 0 + fha(2) = nint(fh) + ida(1) = iy + ida(2) = im + ida(3) = id + ida(5) = ih + call w3kind(w3kindreal,w3kindint) + if(w3kindreal==4) then + fha4=fha + call w3movdat(fha4,ida,jda) + else + call w3movdat(fha,ida,jda) + endif + jy = jda(1) + jm = jda(2) + jd = jda(3) + jh = jda(5) +! if (me .eq. 0) write(6,*) ' forecast jy,jm,jd,jh,rjday=', +! & jy,jm,jd,jh,rjday + jdow = 0 + jdoy = 0 + jday = 0 + call w3doxdat(jda,jdow,jdoy,jday) + rjday = jdoy+jda(5)/24. + if(rjday.lt.dayhf(1)) rjday=rjday+365. + + if (me .eq. 0) write(6,*) ' forecast jy,jm,jd,jh,rjday=', + & jy,jm,jd,jh,rjday +! + if (me .eq. 0) write(6,*) 'forecast jy,jm,jd,jh=',jy,jm,jd,jh +! +! for monthly mean climatology +! + monend = 12 + do mm=1,monend + mmm=mm + mmp=mm+1 + if(rjday.ge.dayhf(mmm).and.rjday.lt.dayhf(mmp)) then + mon1=mmm + mon2=mmp + go to 20 + endif + enddo + print *,'wrong rjday',rjday + call abort + 20 continue + wei1m=(dayhf(mon2)-rjday)/(dayhf(mon2)-dayhf(mon1)) + wei2m=(rjday-dayhf(mon1))/(dayhf(mon2)-dayhf(mon1)) + if(mon2.eq.13) mon2=1 + if (me .eq. 0) print *,'rjday,mon1,mon2,wei1m,wei2m=', + & rjday,mon1,mon2,wei1m,wei2m +! +! for seasonal mean climatology +! + monend = 4 + is = im/3 + 1 + if (is.eq.5) is = 1 + do mm=1,monend + mmm = mm*3 - 2 + mmp = (mm+1)*3 - 2 + if(rjday.ge.dayhf(mmm).and.rjday.lt.dayhf(mmp)) then + sea1 = mmm + sea2 = mmp + go to 30 + endif + enddo + print *,'wrong rjday',rjday + call abort + 30 continue + wei1s = (dayhf(sea2)-rjday)/(dayhf(sea2)-dayhf(sea1)) + wei2s = (rjday-dayhf(sea1))/(dayhf(sea2)-dayhf(sea1)) + if(sea2.eq.13) sea2=1 + if (me .eq. 0) print *,'rjday,sea1,sea2,wei1s,wei2s=', + & rjday,sea1,sea2,wei1s,wei2s +! +! for summer and winter values (maximum and minimum). +! + monend = 2 + is = im/6 + 1 + if (is.eq.3) is = 1 + do mm=1,monend + mmm = mm*6 - 5 + mmp = (mm+1)*6 - 5 + if(rjday.ge.dayhf(mmm).and.rjday.lt.dayhf(mmp)) then + hyr1 = mmm + hyr2 = mmp + go to 31 + endif + enddo + print *,'wrong rjday',rjday + call abort + 31 continue + wei1y = (dayhf(hyr2)-rjday)/(dayhf(hyr2)-dayhf(hyr1)) + wei2y = (rjday-dayhf(hyr1))/(dayhf(hyr2)-dayhf(hyr1)) + if(hyr2.eq.13) hyr2=1 + if (me .eq. 0) print *,'rjday,hyr1,hyr2,wei1y,wei2y=', + & rjday,hyr1,hyr2,wei1y,wei2y +! +! start reading in climatology and interpolate to the date +! + first_time : if (first) then +!cbosu + if (me == 0) print*,'bosu first time thru' +! +! annual mean climatology +! +! fraction of vegetation field for albedo -- there are two +! fraction fields in this version: strong zenith angle dependent +! and weak zenith angle dependent +! + kpd9 = -1 +cjfe + alf=0. +cjfe + + kpd7=-1 + if (ialb == 1) then +!cbosu still need facsf and facwf. read them from the production +!cbosu file + if ( index(fnalbc2, "tileX.nc") == 0) then ! grib file + call fixrdc(lugb,fnalbc2,kpdalf(1),kpd7,kpd9,slmask + &, alf,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + else + call fixrdc_tile(fnalbc2, tile_num_ch, i_index, j_index, + & kpdalf(1), alf(:,1), 1, len, me) + endif + else + call fixrdc(lugb,fnalbc,kpdalf(1),kpd7,kpd9,slmask + &, alf,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + endif + do i = 1, len + if(slmask(i).eq.1.) then + alf(i,2) = 100. - alf(i,1) + endif + enddo +! +! deep soil temperature +! + if(fntg3c(1:8).ne.' ') then + if ( index(fntg3c, "tileX.nc") == 0) then ! grib file + kpd7=-1 + call fixrdc(lugb,fntg3c,kpdtg3,kpd7,kpd9,slmask, + & tg3,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + else + call fixrdc_tile(fntg3c, tile_num_ch, i_index, j_index, + & kpdtg3, tg3, 1, len, me) + endif + endif +! +! vegetation type +! +! when using the new gldas soil moisture climatology, a veg type +! dataset must be selected. +! + if(fnvetc(1:8).ne.' ') then + if ( index(fnvetc, "tileX.nc") == 0) then ! grib file + kpd7=-1 + call fixrdc(lugb,fnvetc,kpdvet,kpd7,kpd9,slmask, + & vet,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + landice_cat=13 + if (maxval(vet)> 13.0) landice_cat=15 + else + call fixrdc_tile(fnvetc, tile_num_ch, i_index, j_index, + & kpdvet, vet, 1, len, me) + landice_cat=15 + endif + if (me .eq. 0) write(6,*) 'climatological vegetation', + & ' type read in.' + elseif(index(fnsmcc,'soilmgldas') /= 0) then ! new soil moisture climo + if (me .eq. 0) write(6,*) 'fatal error: must choose' + if (me .eq. 0) write(6,*) 'climatological veg type when' + if (me .eq. 0) write(6,*) 'using new gldas soil moisture.' + call abort + endif +! +! soil type +! + if(fnsotc(1:8).ne.' ') then + if ( index(fnsotc, "tileX.nc") == 0) then ! grib file + kpd7=-1 + call fixrdc(lugb,fnsotc,kpdsot,kpd7,kpd9,slmask, + & sot,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + else + call fixrdc_tile(fnsotc, tile_num_ch, i_index, j_index, + & kpdsot, sot, 1, len, me) + endif + if (me .eq. 0) write(6,*) 'climatological soil type read in.' + endif + +! +! min vegetation cover +! + if(fnvmnc(1:8).ne.' ') then + if ( index(fnvmnc, "tileX.nc") == 0) then ! grib file + kpd7=-1 + call fixrdc(lugb,fnvmnc,kpdvmn,kpd7,kpd9,slmask, + & vmn,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + else + call fixrdc_tile(fnvmnc, tile_num_ch, i_index, j_index, + & 257, vmn, 99, len, me) + + endif + if (me .eq. 0) write(6,*) 'climatological shdmin read in.' + endif +! +! max vegetation cover +! + if(fnvmxc(1:8).ne.' ') then + if ( index(fnvmxc, "tileX.nc") == 0) then ! grib file + kpd7=-1 + call fixrdc(lugb,fnvmxc,kpdvmx,kpd7,kpd9,slmask, + & vmx,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + else + call fixrdc_tile(fnvmxc, tile_num_ch, i_index, j_index, + & 256, vmx, 99, len, me) + endif + if (me .eq. 0) write(6,*) 'climatological shdmax read in.' + endif +! +! slope type +! + if(fnslpc(1:8).ne.' ') then + if ( index(fnslpc, "tileX.nc") == 0) then ! grib file + kpd7=-1 + call fixrdc(lugb,fnslpc,kpdslp,kpd7,kpd9,slmask, + & slp,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + else + call fixrdc_tile(fnslpc, tile_num_ch, i_index, j_index, + & kpdslp, slp, 1, len, me) + endif + if (me .eq. 0) write(6,*) 'climatological slope read in.' + endif +! +! max snow albeod +! + if(fnabsc(1:8).ne.' ') then + if ( index(fnabsc, "tileX.nc") == 0) then ! grib file + kpd7=-1 + call fixrdc(lugb,fnabsc,kpdabs,kpd7,kpd9,slmask, + & absm,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + else + call fixrdc_tile(fnabsc, tile_num_ch, i_index, j_index, + & kpdabs, absm, 1, len, me) + endif + if (me .eq. 0) write(6,*) 'climatological snoalb read in.' + endif +!clu ---------------------------------------------------------------------- +! + is1 = sea1/3 + 1 + is2 = sea2/3 + 1 + if (is1 .eq. 5) is1 = 1 + if (is2 .eq. 5) is2 = 1 + do nn=1,2 +! +! seasonal mean climatology + if(nn.eq.1) then + isx=is1 + else + isx=is2 + endif + if(isx.eq.1) kpd9 = 12 + if(isx.eq.2) kpd9 = 3 + if(isx.eq.3) kpd9 = 6 + if(isx.eq.4) kpd9 = 9 +! +! seasonal mean climatology +! +! albedo +! there are four albedo fields in this version: +! two for strong zeneith angle dependent (visible and near ir) +! and two for weak zeneith angle dependent (vis ans nir) +! + if (ialb == 0) then + kpd7=-1 + do k = 1, 4 + call fixrdc(lugb,fnalbc,kpdalb(k),kpd7,kpd9,slmask, + & alb(1,k,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + enddo + endif +! +! monthly mean climatology +! + mon = mon1 + if (nn .eq. 2) mon = mon2 +!cbosu +!cbosu new snowfree albedo database is monthly. + if (ialb == 1) then + if ( index(fnalbc, "tileX.nc") == 0) then ! grib file + kpd7=-1 + do k = 1, 4 + call fixrdc(lugb,fnalbc,kpdalb(k),kpd7,mon,slmask, + & alb(1,k,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + enddo + else + do k = 1, 4 + call fixrdc_tile(fnalbc, tile_num_ch, i_index, j_index, + & kpdalb(k), alb(:,k,nn), mon, len, me) + enddo + endif + endif + +! if(lprnt) print *,' mon1=',mon1,' mon2=',mon2 +! +! tsf at the current time t +! + kpd7=-1 + call fixrdc(lugb,fntsfc,kpdtsf,kpd7,mon,slmask, + & tsf(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) +! if(lprnt) print *,' tsf=',tsf(iprnt,nn),' nn=',nn +! +! tsf...at time t-deltsfc +! +! fh2 = fh - deltsfc +! if (fh2 .gt. 0.0) then +! call fixrd(lugb,fntsfc,kpdtsf,lclim,slmask, +! & iy,im,id,ih,fh2,tsfcl2,len,iret +! &, imsk, jmsk, slmskh, gaus,blno, blto +! &, outlat, outlon, me) +! else +! do i=1,len +! tsfcl2(i) = tsfclm(i) +! enddo +! endif +! +! soil wetness +! + if(fnwetc(1:8).ne.' ') then + kpd7=-1 + call fixrdc(lugb,fnwetc,kpdwet,kpd7,mon,slmask, + & wet(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + elseif(fnsmcc(1:8).ne.' ') then + if (index(fnsmcc,'global_soilmcpc.1x1.grb') /= 0) then ! the old climo data + kpd7=-1 + call fixrdc(lugb,fnsmcc,kpdsmc,kpd7,mon,slmask, + & smc(1,lsoil,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + do l=1,lsoil-1 + do i = 1, len + smc(i,l,nn) = smc(i,lsoil,nn) + enddo + enddo + else ! the new gldas data. it does not have data defined at landice + ! points. so for efficiency, don't have fixrdc try to + ! find a value at landice points as defined by the vet type (vet). + allocate(slmask_noice(len)) + slmask_noice=1.0 + do i = 1, len + if (nint(vet(i)) < 1 .or. + & nint(vet(i)) == landice_cat) then + slmask_noice(i) = 0.0 + endif + enddo + do k = 1, lsoil + if (k==1) kpd7=10 ! 0_10 cm (pds octs 11 and 12) + if (k==2) kpd7=2600 ! 10_40 cm + if (k==3) kpd7=10340 ! 40_100 cm + if (k==4) kpd7=25800 ! 100_200 cm + call fixrdc(lugb,fnsmcc,kpdsmc,kpd7,mon,slmask_noice, + & smc(1,k,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + enddo + deallocate(slmask_noice) + endif + else + write(6,*) 'climatological soil wetness file not given' + call abort + endif +! +! soil temperature +! + if(fnstcc(1:8).ne.' ') then + kpd7=-1 + call fixrdc(lugb,fnstcc,kpdstc,kpd7,mon,slmask, + & stc(1,lsoil,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + do l=1,lsoil-1 + do i = 1, len + stc(i,l,nn) = stc(i,lsoil,nn) + enddo + enddo + endif +! +! sea ice +! + kpd7=-1 + if(fnacnc(1:8).ne.' ') then + call fixrdc(lugb,fnacnc,kpdacn,kpd7,mon,slmask, + & acn(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + elseif(fnaisc(1:8).ne.' ') then + call fixrdc(lugb,fnaisc,kpdais,kpd7,mon,slmask, + & ais(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + else + write(6,*) 'climatological ice cover file not given' + call abort + endif +! +! snow depth +! + kpd7=-1 + call fixrdc(lugb,fnsnoc,kpdsno,kpd7,mon,slmask, + & sno(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) +! +! snow cover +! + if(fnscvc(1:8).ne.' ') then + kpd7=-1 + call fixrdc(lugb,fnscvc,kpdscv,kpd7,mon,slmask, + & scv(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + write(6,*) 'climatological snow cover read in.' + endif +! +! surface roughness +! + if(fnzorc(1:3) == 'sib') then + if (me == 0) then + write(6,*) 'roughness length to be set from sib veg type' + endif + elseif(fnzorc(1:4) == 'igbp') then + if (me == 0) then + write(6,*) 'roughness length to be set from igbp veg type' + endif + else + kpd7=-1 + call fixrdc(lugb,fnzorc,kpdzor,kpd7,mon,slmask, + & zor(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + endif +! + do i = 1, len +! set clouds climatology to zero + cvclm (i) = 0. + cvbclm(i) = 0. + cvtclm(i) = 0. +! + cnpclm(i) = 0. !set canopy water content climatology to zero + enddo +! +! vegetation cover +! + if(fnvegc(1:8).ne.' ') then + if ( index(fnvegc, "tileX.nc") == 0) then ! grib file + kpd7=-1 + call fixrdc(lugb,fnvegc,kpdveg,kpd7,mon,slmask, + & veg(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + else + call fixrdc_tile(fnvegc, tile_num_ch, i_index, j_index, + & kpdveg, veg(:,nn), mon, len, me) + endif + if (me .eq. 0) write(6,*) 'climatological vegetation', + & ' cover read in for mon=',mon + endif + + enddo +! + mon1s = mon1 ; mon2s = mon2 ; sea1s = sea1 ; sea2s = sea2 +! + if (me .eq. 0) print *,' mon1s=',mon1s,' mon2s=',mon2s + &,' sea1s=',sea1s,' sea2s=',sea2s +! + k1 = 1 ; k2 = 2 + m1 = 1 ; m2 = 2 +! + first = .false. + endif first_time +! +! to get tsf climatology at the previous call to sfccycle +! +! if (fh-deltsfc >= 0.0) then + rjdayh = rjday - deltsfc/24.0 +! else +! rjdayh = rjday +! endif +! if(lprnt) print *,' rjdayh=',rjdayh,' mon1=',mon1,' mon2=' +! &,mon2,' mon1s=',mon1s,' mon2s=',mon2s,' k1=',k1,' k2=',k2 + if (rjdayh .ge. dayhf(mon1)) then + if (mon2 .eq. 1) mon2 = 13 + wei1x = (dayhf(mon2)-rjdayh)/(dayhf(mon2)-dayhf(mon1)) + wei2x = 1.0 - wei1x + if (mon2 .eq. 13) mon2 = 1 + else + rjdayh2 = rjdayh + if (rjdayh .lt. dayhf(1)) rjdayh2 = rjdayh2 + 365.0 + if (mon1s .eq. mon1) then + mon1s = mon1 - 1 + if (mon1s .eq. 0) mon1s = 12 + k2 = k1 + k1 = mod(k2,2) + 1 + mon = mon1s + kpd7=-1 + call fixrdc(lugb,fntsfc,kpdtsf,kpd7,mon,slmask, + & tsf(1,k1),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + endif + mon2s = mon1s + 1 +! if (mon2s .eq. 1) mon2s = 13 + wei1x = (dayhf(mon2s)-rjdayh2)/(dayhf(mon2s)-dayhf(mon1s)) + wei2x = 1.0 - wei1x + if (mon2s .eq. 13) mon2s = 1 + do i=1,len + tsf2(i) = wei1x * tsf(i,k1) + wei2x * tsf(i,k2) + enddo + endif +! +!cbosu new albedo is monthly + if (sea1 .ne. sea1s) then + sea1s = sea1 + sea2s = sea2 + m1 = mod(m1,2) + 1 + m2 = mod(m1,2) + 1 +! +! seasonal mean climatology +! + isx = sea2/3 + 1 + if (isx .eq. 5) isx = 1 + if(isx.eq.1) kpd9 = 12 + if(isx.eq.2) kpd9 = 3 + if(isx.eq.3) kpd9 = 6 + if(isx.eq.4) kpd9 = 9 +! +! albedo +! there are four albedo fields in this version: +! two for strong zeneith angle dependent (visible and near ir) +! and two for weak zeneith angle dependent (vis ans nir) +! +!cbosu + if (ialb == 0) then + kpd7=-1 + do k = 1, 4 + call fixrdc(lugb,fnalbc,kpdalb(k),kpd7,kpd9,slmask + &, alb(1,k,m2),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + enddo + endif + + endif + + if (mon1 .ne. mon1s) then + + mon1s = mon1 + mon2s = mon2 + k1 = mod(k1,2) + 1 + k2 = mod(k1,2) + 1 +! +! monthly mean climatology +! + mon = mon2 + nn = k2 +!cbosu + if (ialb == 1) then + if (me == 0) print*,'bosu 2nd time in clima for month ', + & mon, k1,k2 + if ( index(fnalbc, "tileX.nc") == 0) then ! grib file + kpd7=-1 + do k = 1, 4 + call fixrdc(lugb,fnalbc,kpdalb(k),kpd7,mon,slmask, + & alb(1,k,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + enddo + else + do k = 1, 4 + call fixrdc_tile(fnalbc, tile_num_ch, i_index, j_index, + & kpdalb(k), alb(:,k,nn), mon, len, me) + enddo + endif + endif +! +! tsf at the current time t +! + kpd7=-1 + call fixrdc(lugb,fntsfc,kpdtsf,kpd7,mon,slmask, + & tsf(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) +! +! soil wetness +! + if(fnwetc(1:8).ne.' ') then + kpd7=-1 + call fixrdc(lugb,fnwetc,kpdwet,kpd7,mon,slmask, + & wet(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + elseif(fnsmcc(1:8).ne.' ') then + if (index(fnsmcc,'global_soilmcpc.1x1.grb') /= 0) then ! the old climo data + kpd7=-1 + call fixrdc(lugb,fnsmcc,kpdsmc,kpd7,mon,slmask, + & smc(1,lsoil,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + do l=1,lsoil-1 + do i = 1, len + smc(i,l,nn) = smc(i,lsoil,nn) + enddo + enddo + else ! the new gldas data. it does not have data defined at landice + ! points. so for efficiency, don't have fixrdc try to + ! find a value at landice points as defined by the vet type (vet). + allocate(slmask_noice(len)) + slmask_noice=1.0 + do i = 1, len + if (nint(vet(i)) < 1 .or. + & nint(vet(i)) == landice_cat) then + slmask_noice(i) = 0.0 + endif + enddo + do k = 1, lsoil + if (k==1) kpd7=10 ! 0_10 cm (pds octs 11 and 12) + if (k==2) kpd7=2600 ! 10_40 cm + if (k==3) kpd7=10340 ! 40_100 cm + if (k==4) kpd7=25800 ! 100_200 cm + call fixrdc(lugb,fnsmcc,kpdsmc,kpd7,mon,slmask_noice, + & smc(1,k,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + enddo + deallocate(slmask_noice) + endif + else + write(6,*) 'climatological soil wetness file not given' + call abort + endif +! +! sea ice +! + kpd7=-1 + if(fnacnc(1:8).ne.' ') then + call fixrdc(lugb,fnacnc,kpdacn,kpd7,mon,slmask, + & acn(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + elseif(fnaisc(1:8).ne.' ') then + call fixrdc(lugb,fnaisc,kpdais,kpd7,mon,slmask, + & ais(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + else + write(6,*) 'climatological ice cover file not given' + call abort + endif +! +! snow depth +! + kpd7=-1 + call fixrdc(lugb,fnsnoc,kpdsno,kpd7,mon,slmask, + & sno(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) +! +! snow cover +! + if(fnscvc(1:8).ne.' ') then + kpd7=-1 + call fixrdc(lugb,fnscvc,kpdscv,kpd7,mon,slmask, + & scv(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + write(6,*) 'climatological snow cover read in.' + endif +! +! surface roughness +! + if(fnzorc(1:3) == 'sib') then + if (me == 0) then + write(6,*) 'roughness length to be set from sib veg type' + endif + elseif(fnzorc(1:4) == 'igbp') then + if (me == 0) then + write(6,*) 'roughness length to be set from igbp veg type' + endif + else + kpd7=-1 + call fixrdc(lugb,fnzorc,kpdzor,kpd7,mon,slmask, + & zor(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + endif +! +! vegetation cover +! + if(fnvegc(1:8).ne.' ') then + if ( index(fnvegc, "tileX.nc") == 0) then ! grib file + kpd7=-1 + call fixrdc(lugb,fnvegc,kpdveg,kpd7,mon,slmask, + & veg(1,nn),len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + else + call fixrdc_tile(fnvegc, tile_num_ch, i_index, j_index, + & kpdveg, veg(:,nn), mon, len, me) + endif +! if (me .eq. 0) write(6,*) 'climatological vegetation', +! & ' cover read in for mon=',mon + endif +! + endif +! +! now perform the time interpolation +! +! when chosen, set the z0 based on the vegetation type. +! for this option to work, namelist variable fnvetc must be +! set to point at the proper vegetation type file. + if(fnzorc(1:3) == 'sib') then + if(fnvetc(1:4) == ' ') then + if (me==0) write(6,*) "must choose sib veg type climo file" + call abort + endif + zorclm = 0.0 + do i=1,len + ivtyp=nint(vet(i)) + if (ivtyp >= 1 .and. ivtyp <= 13) then + zorclm(i) = z0_sib(ivtyp) + endif + enddo + elseif(fnzorc(1:4) == 'igbp') then + if(fnvetc(1:4) == ' ') then + if (me==0) write(6,*) "must choose igbp veg type climo file" + call abort + endif + zorclm = 0.0 + do i=1,len + ivtyp=nint(vet(i)) + if (ivtyp >= 1 .and. ivtyp <= 20) then + z0_season(1) = z0_igbp_min(ivtyp) + z0_season(7) = z0_igbp_max(ivtyp) + if(outlat(i) < 0.0)then + zorclm(i) = wei1y * z0_season(hyr2) + + & wei2y *z0_season(hyr1) + else + zorclm(i) = wei1y * z0_season(hyr1) + + & wei2y *z0_season(hyr2) + endif + endif + enddo + else + do i=1,len + zorclm(i) = wei1m * zor(i,k1) + wei2m * zor(i,k2) + enddo + endif +! + do i=1,len + tsfclm(i) = wei1m * tsf(i,k1) + wei2m * tsf(i,k2) + snoclm(i) = wei1m * sno(i,k1) + wei2m * sno(i,k2) + cvclm(i) = 0.0 + cvbclm(i) = 0.0 + cvtclm(i) = 0.0 + cnpclm(i) = 0.0 + tsfcl2(i) = tsf2(i) + enddo +! if(lprnt) print *,' tsfclm=',tsfclm(iprnt),' wei1m=',wei1m +! &,' wei2m=',wei2m,' tsfk12=',tsf(iprnt,k1),tsf(iprnt,k2) +! + if (fh .eq. 0.0) then + do i=1,len + tsfcl0(i) = tsfclm(i) + enddo + endif + if (rjdayh .ge. dayhf(mon1)) then + do i=1,len + tsf2(i) = wei1x * tsf(i,k1) + wei2x * tsf(i,k2) + tsfcl2(i) = tsf2(i) + enddo + endif +! if(lprnt) print *,' tsf2=',tsf2(iprnt),' wei1x=',wei1x +! &,' wei2x=',wei2x,' tsfk12=',tsf(iprnt,k1),tsf(iprnt,k2) +! &,' mon1s=',mon1s,' mon2s=',mon2s +! &,' slmask=',slmask(iprnt) +! + if(fnacnc(1:8).ne.' ') then + do i=1,len + acnclm(i) = wei1m * acn(i,k1) + wei2m * acn(i,k2) + enddo + elseif(fnaisc(1:8).ne.' ') then + do i=1,len + aisclm(i) = wei1m * ais(i,k1) + wei2m * ais(i,k2) + enddo + endif +! + if(fnwetc(1:8).ne.' ') then + do i=1,len + wetclm(i) = wei1m * wet(i,k1) + wei2m * wet(i,k2) + enddo + elseif(fnsmcc(1:8).ne.' ') then + do k=1,lsoil + do i=1,len + smcclm(i,k) = wei1m * smc(i,k,k1) + wei2m * smc(i,k,k2) + enddo + enddo + endif +! + if(fnscvc(1:8).ne.' ') then + do i=1,len + scvclm(i) = wei1m * scv(i,k1) + wei2m * scv(i,k2) + enddo + endif +! + if(fntg3c(1:8).ne.' ') then + do i=1,len + tg3clm(i) = tg3(i) + enddo + elseif(fnstcc(1:8).ne.' ') then + do k=1,lsoil + do i=1,len + stcclm(i,k) = wei1m * stc(i,k,k1) + wei2m * stc(i,k,k2) + enddo + enddo + endif +! + if(fnvegc(1:8).ne.' ') then + do i=1,len + vegclm(i) = wei1m * veg(i,k1) + wei2m * veg(i,k2) + enddo + endif +! + if(fnvetc(1:8).ne.' ') then + do i=1,len + vetclm(i) = vet(i) + enddo + endif +! + if(fnsotc(1:8).ne.' ') then + do i=1,len + sotclm(i) = sot(i) + enddo + endif + + +!clu ---------------------------------------------------------------------- +! + if(fnvmnc(1:8).ne.' ') then + do i=1,len + vmnclm(i) = vmn(i) + enddo + endif +! + if(fnvmxc(1:8).ne.' ') then + do i=1,len + vmxclm(i) = vmx(i) + enddo + endif +! + if(fnslpc(1:8).ne.' ') then + do i=1,len + slpclm(i) = slp(i) + enddo + endif +! + if(fnabsc(1:8).ne.' ') then + do i=1,len + absclm(i) = absm(i) + enddo + endif +!clu ---------------------------------------------------------------------- +! +!cbosu diagnostic print + if (me == 0) print*,'monthly albedo weights are ', + & wei1m,' for k', k1, wei2m, ' for k', k2 + + if (ialb == 1) then + do k=1,4 + do i=1,len + albclm(i,k) = wei1m * alb(i,k,k1) + wei2m * alb(i,k,k2) + enddo + enddo + else + do k=1,4 + do i=1,len + albclm(i,k) = wei1s * alb(i,k,m1) + wei2s * alb(i,k,m2) + enddo + enddo + endif +! + do k=1,2 + do i=1,len + alfclm(i,k) = alf(i,k) + enddo + enddo +! +! end of climatology reads +! + return + end subroutine clima + +!>\ingroup mod_sfcsub + subroutine fixrdc_tile(filename_raw, tile_num_ch, + & i_index, j_index, kpds, + & var, mon, npts, me) + use netcdf + use machine , only : kind_io8 + implicit none + character(len=*), intent(in) :: filename_raw + character(len=*), intent(in) :: tile_num_ch + integer, intent(in) :: npts, me, kpds, mon + integer, intent(in) :: i_index(npts) + integer, intent(in) :: j_index(npts) + real(kind_io8), intent(out) :: var(npts) + character(len=500) :: filename + character(len=80) :: errmsg + integer :: i, ii, ncid, t + integer :: error, id_dim + integer :: nx, ny, num_times + integer :: id_var + real(kind=4), allocatable :: dummy(:,:,:) + ii=index(filename_raw,"tileX") + + do i = 1, len(filename) + filename(i:i) = " " + enddo + + filename = filename_raw(1:ii-1) // tile_num_ch // ".nc" + + if (me == 0) print*, ' in fixrdc_tile for mon=',mon, + & ' filename=', trim(filename) + + error=nf90_open(trim(filename), nf90_nowrite, ncid) + if (error /= nf90_noerr) call netcdf_err(error) + + error=nf90_inq_dimid(ncid, 'nx', id_dim) + if (error /= nf90_noerr) call netcdf_err(error) + error=nf90_inquire_dimension(ncid,id_dim,len=nx) + if (error /= nf90_noerr) call netcdf_err(error) + + error=nf90_inq_dimid(ncid, 'ny', id_dim) + if (error /= nf90_noerr) call netcdf_err(error) + error=nf90_inquire_dimension(ncid,id_dim,len=ny) + if (error /= nf90_noerr) call netcdf_err(error) + + error=nf90_inq_dimid(ncid, 'time', id_dim) + if (error /= nf90_noerr) call netcdf_err(error) + error=nf90_inquire_dimension(ncid,id_dim,len=num_times) + if (error /= nf90_noerr) call netcdf_err(error) + + select case (kpds) + case(11) + error=nf90_inq_varid(ncid, 'substrate_temperature', id_var) + case(87) + error=nf90_inq_varid(ncid, 'vegetation_greenness', id_var) + case(159) + error=nf90_inq_varid(ncid, 'maximum_snow_albedo', id_var) + case(189) + error=nf90_inq_varid(ncid, 'visible_black_sky_albedo', id_var) + case(190) + error=nf90_inq_varid(ncid, 'visible_white_sky_albedo', id_var) + case(191) + error=nf90_inq_varid(ncid, 'near_IR_black_sky_albedo', id_var) + case(192) + error=nf90_inq_varid(ncid, 'near_IR_white_sky_albedo', id_var) + case(214) + error=nf90_inq_varid(ncid, 'facsf', id_var) + case(224) + error=nf90_inq_varid(ncid, 'soil_type', id_var) + case(225) + error=nf90_inq_varid(ncid, 'vegetation_type', id_var) + case(236) + error=nf90_inq_varid(ncid, 'slope_type', id_var) + case(256:257) + error=nf90_inq_varid(ncid, 'vegetation_greenness', id_var) + case default + print*,'fatal error in fixrdc_tile of sfcsub.F.' + print*,'unknown variable.' + call abort + end select + if (error /= nf90_noerr) call netcdf_err(error) + + allocate(dummy(nx,ny,1)) + + if (kpds == 256) then ! max veg greenness + + var = -9999. + do t = 1, num_times + error=nf90_get_var(ncid, id_var, dummy, start=(/1,1,t/), + & count=(/nx,ny,1/) ) + if (error /= nf90_noerr) call netcdf_err(error) + do ii = 1,npts + var(ii) = max(var(ii), dummy(i_index(ii),j_index(ii),1)) + enddo + enddo + + elseif (kpds == 257) then ! min veg greenness + + var = 9999. + do t = 1, num_times + error=nf90_get_var(ncid, id_var, dummy, start=(/1,1,t/), + & count=(/nx,ny,1/) ) + if (error /= nf90_noerr) call netcdf_err(error) + do ii = 1, npts + var(ii) = min(var(ii), dummy(i_index(ii),j_index(ii),1)) + enddo + enddo + + else + + error=nf90_get_var(ncid, id_var, dummy, start=(/1,1,mon/), + & count=(/nx,ny,1/) ) + if (error /= nf90_noerr) call netcdf_err(error) + + do ii = 1, npts + var(ii) = dummy(i_index(ii),j_index(ii),1) + enddo + + endif + + deallocate(dummy) + + error=nf90_close(ncid) + + select case (kpds) + case(159) ! max snow alb + var = var * 100.0 + case(214) ! facsf + where (var < 0.0) var = 0.0 + var = var * 100.0 + case(189:192) + var = var * 100.0 + case(256:257) + var = var * 100.0 + end select + + return + + end subroutine fixrdc_tile + +!>\ingroup mod_sfcsub + subroutine netcdf_err(error) + + use netcdf + implicit none + + integer,intent(in) :: error + character(len=256) :: errmsg + + errmsg = nf90_strerror(error) + print*,'fatal error in sfcsub.F: ', trim(errmsg) + call abort + + end subroutine netcdf_err + +!>\ingroup mod_sfcsub + subroutine fixrdc(lugb,fngrib,kpds5,kpds7,mon,slmask, + & gdata,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + use machine , only : kind_io8,kind_io4 + use sfccyc_module, only : mdata + implicit none + integer imax,jmax,ijmax,i,j,n,jret,inttyp,iret,imsk, + & jmsk,len,lugb,kpds5,mon,lskip,lgrib,ndata,lugi,me,kmami + &, jj,w3kindreal,w3kindint + real (kind=kind_io8) wlon,elon,rnlat,dlat,dlon,rslat,blno,blto +! +! read in grib climatology files and interpolate to the input +! grid. grib files should allow all the necessary parameters +! to be extracted from the description records. +! +! + character*500 fngrib +! character*80 fngrib, asgnstr +! + real (kind=kind_io8) slmskh(imsk,jmsk) +! + real (kind=kind_io8) gdata(len), slmask(len) + real (kind=kind_io8), allocatable :: data(:,:), rslmsk(:,:) + real (kind=kind_io8), allocatable :: data8(:) + real (kind=kind_io4), allocatable :: data4(:) + real (kind=kind_io8), allocatable :: rlngrb(:), rltgrb(:) +! + logical lmask, yr2kc, gaus, ijordr + logical*1, allocatable :: lbms(:) +! + integer, intent(in) :: kpds7 + integer kpds(1000),kgds(1000) + integer jpds(1000),jgds(1000), kpds0(1000) + real (kind=kind_io8) outlat(len), outlon(len) +! + allocate(data8(1:mdata)) + allocate(lbms(mdata)) +! +! integer imax_sv, jmax_sv, wlon_sv, rnlat_sv, kpds1_sv +! date imax_sv/0/, jmax_sv/0/, wlon_sv/999.0/, rnlat_sv/999.0/ +! &, kpds1_sv/-1/ +! save imax_sv, jmax_sv, wlon_sv, rnlat_sv, kpds1_sv +! &, rlngrb, rltgrb +! + iret = 0 +! + if (me .eq. 0) write(6,*) ' in fixrdc for mon=',mon + &,' fngrib=',trim(fngrib) +! + close(lugb) + call baopenr(lugb,fngrib,iret) + if (iret .ne. 0) then + write(6,*) ' error in opening file ',trim(fngrib) + print *,'error in opening file ',trim(fngrib) + call abort + endif + if (me .eq. 0) write(6,*) ' file ',trim(fngrib), + & ' opened. unit=',lugb +! + lugi = 0 +! + lskip = -1 + jpds = -1 + jgds = -1 + jpds(5) = kpds5 + jpds(7) = kpds7 + kpds = jpds + call getgbh(lugb,lugi,lskip,jpds,jgds,lgrib,ndata, + & lskip,kpds,kgds,iret) + if (me .eq. 0) then + write(6,*) ' first grib record.' + write(6,*) ' kpds( 1-10)=',(kpds(j),j= 1,10) + write(6,*) ' kpds(11-20)=',(kpds(j),j=11,20) + write(6,*) ' kpds(21- )=',(kpds(j),j=21,22) + endif + yr2kc = (kpds(8) / 100) .gt. 0 + kpds0 = jpds + kpds0(4) = -1 + kpds0(18) = -1 + if(iret.ne.0) then + write(6,*) ' error in getgbh. iret: ', iret + if (iret==99) write(6,*) ' field not found.' + call abort + endif +! +! handling climatology file +! + lskip = -1 + n = 0 + jpds = kpds0 + jpds(9) = mon + if(jpds(9).eq.13) jpds(9) = 1 + call w3kind(w3kindreal,w3kindint) + if (w3kindreal==8) then + call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip, + & kpds,kgds,lbms,data8,jret) + else if (w3kindreal==4) then + allocate(data4(1:mdata)) + call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip, + & kpds,kgds,lbms,data4,jret) + data8 = real(data4, kind=kind_io8) + deallocate(data4) + endif + if (me .eq. 0) write(6,*) ' input grib file dates=', + & (kpds(i),i=8,11) + if(jret.eq.0) then + if(ndata.eq.0) then + write(6,*) ' error in getgb' + write(6,*) ' kpds=',kpds + write(6,*) ' kgds=',kgds + call abort + endif + imax=kgds(2) + jmax=kgds(3) + ijmax=imax*jmax + allocate (data(imax,jmax)) + do j=1,jmax + jj = (j-1)*imax + do i=1,imax + data(i,j) = data8(jj+i) + enddo + enddo + if (me .eq. 0) write(6,*) 'imax,jmax,ijmax=',imax,jmax,ijmax + else + write(6,*) ' error in getgb - jret=', jret + call abort + endif +! +! if (me == 0) then +! write(6,*) ' maxmin of input as is' +! kmami=1 +! call maxmin(data(1,1),ijmax,kmami) +! endif +! + call getarea(kgds,dlat,dlon,rslat,rnlat,wlon,elon,ijordr,me) + if (me == 0) then + write(6,*) 'imax,jmax,ijmax,dlon,dlat,ijordr,wlon,rnlat=' + write(6,*) imax,jmax,ijmax,dlon,dlat,ijordr,wlon,rnlat + endif + call subst(data,imax,jmax,dlon,dlat,ijordr) +! +! first get slmask over input grid +! + allocate (rlngrb(imax), rltgrb(jmax)) + allocate (rslmsk(imax,jmax)) + + call setrmsk(kpds5,slmskh,imsk,jmsk,wlon,rnlat, + & data,imax,jmax,rlngrb,rltgrb,lmask,rslmsk + &, gaus,blno, blto, kgds(1), kpds(4), lbms) +! write(6,*) ' kpds5=',kpds5,' lmask=',lmask +! + inttyp = 0 + if(kpds5.eq.225) inttyp = 1 + if(kpds5.eq.230) inttyp = 1 + if(kpds5.eq.236) inttyp = 1 + if(kpds5.eq.224) inttyp = 1 + if (me .eq. 0) then + if(inttyp.eq.1) print *, ' nearest grid point used' + &, ' kpds5=',kpds5, ' lmask = ',lmask + endif +! + call la2ga(data,imax,jmax,rlngrb,rltgrb,wlon,rnlat,inttyp, + & gdata,len,lmask,rslmsk,slmask + &, outlat, outlon,me) +! + deallocate (rlngrb, stat=iret) + deallocate (rltgrb, stat=iret) + deallocate (data, stat=iret) + deallocate (rslmsk, stat=iret) + call baclose(lugb,iret) +! + deallocate(data8) + deallocate(lbms) + return + end subroutine fixrdc + +!>\ingroup mod_sfcsub + subroutine fixrda(lugb,fngrib,kpds5,slmask, + & iy,im,id,ih,fh,gdata,len,iret + &, imsk, jmsk, slmskh, gaus,blno, blto + &, outlat, outlon, me) + use machine , only : kind_io8,kind_io4 + use sfccyc_module, only : mdata + implicit none + integer nrepmx,nvalid,imo,iyr,idy,jret,ihr,nrept,lskip,lugi, + & lgrib,j,ndata,i,inttyp,jmax,imax,ijmax,ij,jday,len,iret, + & jmsk,imsk,ih,kpds5,lugb,iy,id,im,jh,jd,jdoy,jdow,jm,me, + & monend,jy,iy4,kmami,iret2,jj,w3kindreal,w3kindint + real (kind=kind_io8) rnlat,rslat,wlon,elon,dlon,dlat,fh,blno, + & rjday,blto +! +! read in grib climatology/analysis files and interpolate to the input +! dates and the grid. grib files should allow all the necessary parameters +! to be extracted from the description records. +! +! nrepmx: max number of days for going back date search +! nvalid: analysis later than (current date - nvalid) is regarded as +! valid for current analysis +! + parameter(nrepmx=15, nvalid=4) +! + character*500 fngrib +! character*80 fngrib, asgnstr +! + real (kind=kind_io8) slmskh(imsk,jmsk) +! + real (kind=kind_io8) gdata(len), slmask(len) + real (kind=kind_io8), allocatable :: data(:,:),rslmsk(:,:) + real (kind=kind_io8), allocatable :: data8(:) + real (kind=kind_io4), allocatable :: data4(:) + real (kind=kind_io8), allocatable :: rlngrb(:), rltgrb(:) +! + logical lmask, yr2kc, gaus, ijordr + logical*1 lbms(mdata) +! + integer kpds(1000),kgds(1000) + integer jpds(1000),jgds(1000), kpds0(1000) + real (kind=kind_io8) outlat(len), outlon(len) +! +! dayhf : julian day of the middle of each month +! + real (kind=kind_io8) dayhf(13) + data dayhf/ 15.5, 45.0, 74.5,105.0,135.5,166.0, + & 196.5,227.5,258.0,288.5,319.0,349.5,380.5/ +! +! mjday : number of days in a month +! + integer mjday(12) + data mjday/31,28,31,30,31,30,31,31,30,31,30,31/ +! + real (kind=kind_io8) fha(5) + real(4) fha4(5) + integer ida(8),jda(8) +! + allocate(data8(1:mdata)) + iret = 0 + monend = 9999 +! +! compute jy,jm,jd,jh of forecast and the day of the year +! + iy4=iy + if(iy.lt.101) iy4=1900+iy4 + fha=0 + ida=0 + jda=0 + fha(2)=nint(fh) + ida(1)=iy + ida(2)=im + ida(3)=id + ida(5)=ih + call w3kind(w3kindreal,w3kindint) + if(w3kindreal==4) then + fha4=fha + call w3movdat(fha4,ida,jda) + else + call w3movdat(fha,ida,jda) + endif + jy=jda(1) + jm=jda(2) + jd=jda(3) + jh=jda(5) +! if (me .eq. 0) write(6,*) ' forecast jy,jm,jd,jh,rjday=', +! & jy,jm,jd,jh,rjday + jdow = 0 + jdoy = 0 + jday = 0 + call w3doxdat(jda,jdow,jdoy,jday) + rjday=jdoy+jda(5)/24. + if(rjday.lt.dayhf(1)) rjday=rjday+365. + + if (me .eq. 0) write(6,*) ' forecast jy,jm,jd,jh,rjday=', + & jy,jm,jd,jh,rjday +! + if (me .eq. 0) then + write(6,*) 'forecast jy,jm,jd,jh=',jy,jm,jd,jh +! + write(6,*) ' ' + write(6,*) '************************************************' + endif +! + close(lugb) + call baopenr(lugb,fngrib,iret) + if (iret .ne. 0) then + write(6,*) ' error in opening file ',trim(fngrib) + print *,'error in opening file ',trim(fngrib) + call abort + endif + if (me .eq. 0) write(6,*) ' file ',trim(fngrib), + & ' opened. unit=',lugb +! + lugi = 0 +! + lskip=-1 + jpds=-1 + jgds=-1 + jpds(5)=kpds5 + kpds = jpds + call getgbh(lugb,lugi,lskip,jpds,jgds,lgrib,ndata, + & lskip,kpds,kgds,iret) + if (me .eq. 0) then + write(6,*) ' first grib record.' + write(6,*) ' kpds( 1-10)=',(kpds(j),j= 1,10) + write(6,*) ' kpds(11-20)=',(kpds(j),j=11,20) + write(6,*) ' kpds(21- )=',(kpds(j),j=21,22) + endif + yr2kc = (kpds(8) / 100) .gt. 0 + kpds0=jpds + kpds0(4)=-1 + kpds0(18)=-1 + if(iret.ne.0) then + write(6,*) ' error in getgbh. iret: ', iret + if(iret==99) write(6,*) ' field not found.' + call abort + endif +! +! handling analysis file +! +! find record for the given hour/day/month/year +! + nrept=0 + jpds=kpds0 + lskip = -1 + iyr=jy + if(iyr.le.100) iyr=2050-mod(2050-iyr,100) + imo=jm + idy=jd + ihr=jh +! year 2000 compatible data + if (yr2kc) then + jpds(8) = iyr + else + jpds(8) = mod(iyr,1900) + endif + 50 continue + jpds( 8)=mod(iyr-1,100)+1 + jpds( 9)=imo + jpds(10)=idy +! jpds(11)=ihr + jpds(21)=(iyr-1)/100+1 + call w3kind(w3kindreal,w3kindint) + if (w3kindreal == 8) then + call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip, + & kpds,kgds,lbms,data8,jret) + elseif (w3kindreal == 4) then + allocate (data4(1:mdata)) + call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip, + & kpds,kgds,lbms,data4,jret) + data8 = real(data4, kind=kind_io8) + deallocate(data4) + endif + if (me .eq. 0) write(6,*) ' input grib file dates=', + & (kpds(i),i=8,11) + if(jret.eq.0) then + if(ndata.eq.0) then + write(6,*) ' error in getgb' + write(6,*) ' kpds=',kpds + write(6,*) ' kgds=',kgds + call abort + endif + imax=kgds(2) + jmax=kgds(3) + ijmax=imax*jmax + allocate (data(imax,jmax)) + do j=1,jmax + jj = (j-1)*imax + do i=1,imax + data(i,j) = data8(jj+i) + enddo + enddo + else + if(nrept.eq.0) then + if (me .eq. 0) then + write(6,*) ' no matching dates found. start searching', + & ' nearest matching dates (going back).' + endif + endif +! +! no matching ih found. search nearest hour +! + if(ihr.eq.6) then + ihr=0 + go to 50 + elseif(ihr.eq.12) then + ihr=0 + go to 50 + elseif(ihr.eq.18) then + ihr=12 + go to 50 + elseif(ihr.eq.0.or.ihr.eq.-1) then + idy=idy-1 + if(idy.eq.0) then + imo=imo-1 + if(imo.eq.0) then + iyr=iyr-1 + if(iyr.lt.0) iyr=99 + imo=12 + endif + idy=31 + if(imo.eq.4.or.imo.eq.6.or.imo.eq.9.or.imo.eq.11) idy=30 + if(imo.eq.2) then + if(mod(iyr,4).eq.0) then + idy=29 + else + idy=28 + endif + endif + endif + ihr=-1 + if (me .eq. 0) write(6,*) ' decremented dates=', + & iyr,imo,idy,ihr + nrept=nrept+1 + if(nrept.gt.nvalid) iret=-1 + if(nrept.gt.nrepmx) then + if (me .eq. 0) then + write(6,*) ' searching range exceeded.' + &, ' may be wrong grib file given' + write(6,*) ' fngrib=',trim(fngrib) + write(6,*) ' terminating search and', + & ' and setting gdata to -999' + write(6,*) ' range max=',nrepmx + endif +! imax=kgds(2) +! jmax=kgds(3) +! ijmax=imax*jmax +! do ij=1,ijmax +! data(ij)=0. +! enddo + go to 100 + endif + go to 50 + else + if (me .eq. 0) then + write(6,*) ' search of analysis for ihr=',ihr,' failed.' + write(6,*) ' kpds=',kpds + write(6,*) ' iyr,imo,idy,ihr=',iyr,imo,idy,ihr + endif + go to 100 + endif + endif +! + 80 continue +! if (me == 0) then +! write(6,*) ' maxmin of input as is' +! kmami=1 +! call maxmin(data(1,1),ijmax,kmami) +! endif +! + call getarea(kgds,dlat,dlon,rslat,rnlat,wlon,elon,ijordr,me) + if (me == 0) then + write(6,*) 'imax,jmax,ijmax,dlon,dlat,ijordr,wlon,rnlat=' + write(6,*) imax,jmax,ijmax,dlon,dlat,ijordr,wlon,rnlat + endif + call subst(data,imax,jmax,dlon,dlat,ijordr) +! +! first get slmask over input grid +! + allocate (rlngrb(imax), rltgrb(jmax)) + allocate (rslmsk(imax,jmax)) + call setrmsk(kpds5,slmskh,imsk,jmsk,wlon,rnlat, + & data,imax,jmax,rlngrb,rltgrb,lmask,rslmsk +! & data,imax,jmax,abs(dlon),abs(dlat),lmask,rslmsk +!cggg &, gaus,blno, blto, kgds(1)) + &, gaus,blno, blto, kgds(1), kpds(4), lbms) + +! write(6,*) ' kpds5=',kpds5,' lmask=',lmask +! + inttyp = 0 + if(kpds5.eq.225) inttyp = 1 + if(kpds5.eq.230) inttyp = 1 + if(kpds5.eq.66) inttyp = 1 + if(inttyp.eq.1) print *, ' nearest grid point used' +! + call la2ga(data,imax,jmax,rlngrb,rltgrb,wlon,rnlat,inttyp, + & gdata,len,lmask,rslmsk,slmask + &, outlat, outlon, me) +! + deallocate (rlngrb, stat=iret) + deallocate (rltgrb, stat=iret) + deallocate (data, stat=iret) + deallocate (rslmsk, stat=iret) + call baclose(lugb,iret2) +! write(6,*) ' ' + deallocate(data8) + return +! + 100 continue + iret=1 + do i=1,len + gdata(i) = -999. + enddo +! + call baclose(lugb,iret2) +! + deallocate(data8) + return + end subroutine fixrda + +!>\ingroup mod_sfcsub + subroutine snodpth2(glacir,snwmax,snoanl, len, me) + use machine , only : kind_io8,kind_io4 + implicit none + integer i,me,len + real (kind=kind_io8) snwmax +! + real (kind=kind_io8) snoanl(len), glacir(len) +! + if (me .eq. 0) write(6,*) 'snodpth2' +! + do i=1,len +! +! if glacial points has snow in climatology, set sno to snomax +! + if(glacir(i).ne.0..and.snoanl(i).lt.snwmax*0.5) then + snoanl(i) = snwmax + snoanl(i) + endif +! + enddo + return + end +!>@} From ca43794963a6a80fa4dcee2f43e0aee87273e251 Mon Sep 17 00:00:00 2001 From: Man Zhang Date: Thu, 20 Jun 2019 16:26:31 -0600 Subject: [PATCH 15/89] scidoc fv3 updates --- physics/GFS_phys_time_vary.fv3.F90 | 34 +- physics/GFS_rad_time_vary.fv3.F90 | 7 +- physics/docs/ccppv3_fv3_doxyfile | 4 +- physics/docs/pdftxt/GFS_SAMF.txt | 1 + physics/sfcsub.F | 835 ++++++++++++++--------------- 5 files changed, 438 insertions(+), 443 deletions(-) diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index b8823fac6..80a55529c 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -2,8 +2,9 @@ !! Contains code related to GFS physics suite setup (physics part of time_vary_step) !>\defgroup mod_GFS_phys_time_vary GFS Physics Time Update -!! This module contains GFS physics time vary subroutines including ozone, h2o, i -!! aerosol and IN&CCN updates. +!! This module contains GFS physics time vary subroutines including ozone, stratospheric water vapor, +!! aerosol, IN&CCN and surface properties updates. +!> @{ module GFS_phys_time_vary #ifdef OPENMP @@ -42,6 +43,8 @@ module GFS_phys_time_vary !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! +!>\section gen_GFS_phys_time_vary_init GFS_phys_time_vary_init General Algorithm +!! @{ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, errflg) use GFS_typedefs, only: GFS_control_type, GFS_data_type, GFS_interstitial_type @@ -111,6 +114,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e !$OMP sections !$OMP section +!> - Call read_o3data() to read ozone data call read_o3data (Model%ntoz, Model%me, Model%master) ! Consistency check that the hardcoded values for levozp and @@ -130,6 +134,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e end if !$OMP section +!> - Call read_h2odata() to read stratospheric water vapor data call read_h2odata (Model%h2o_phys, Model%me, Model%master) ! Consistency check that the hardcoded values for levh2o and @@ -149,6 +154,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e end if !$OMP section +!> - Call read_aerdata() to read aerosol climatology if (Model%aero_in) then ! Consistency check that the value for ntrcaerm set in GFS_typedefs.F90 ! and used to allocate Tbd%aer_nm matches the value defined in aerclm_def @@ -173,6 +179,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e endif !$OMP section +!> - Call read_cidata() to read IN and CCN data if (Model%iccn) then call read_cidata ( Model%me, Model%master) ! No consistency check needed for in/ccn data, all values are @@ -204,7 +211,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e end if - !--- read in and initialize ozone +!> - Call setindxoz() to initialize ozone data if (Model%ntoz > 0) then !$OMP do schedule (dynamic,1) do nb = 1, nblks @@ -214,7 +221,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e !$OMP end do endif - !--- read in and initialize stratospheric water +!> - Call setindxh2o() to initialize stratospheric water vapor data if (Model%h2o_phys) then !$OMP do schedule (dynamic,1) do nb = 1, nblks @@ -224,7 +231,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e !$OMP end do endif - !--- read in and initialize aerosols +!> - Call setindxaer() to initialize aerosols data if (Model%aero_in) then !$OMP do schedule (dynamic,1) do nb = 1, nblks @@ -236,7 +243,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e !$OMP end do endif - !--- read in and initialize IN and CCN +!> - Call setindxci() to initialize IN and CCN data if (Model%iccn) then !$OMP do schedule (dynamic,1) do nb = 1, nblks @@ -267,6 +274,7 @@ subroutine GFS_phys_time_vary_init (Data, Model, Interstitial, nthrds, errmsg, e is_initialized = .true. end subroutine GFS_phys_time_vary_init +!! @} !> \section arg_table_GFS_phys_time_vary_finalize Argument Table @@ -324,6 +332,8 @@ end subroutine GFS_phys_time_vary_finalize !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! +!>\section gen_GFS_phys_time_vary_run GFS_phys_time_vary_run General Algorithm +!> @{ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg) use mersenne_twister, only: random_setseed, random_number @@ -412,7 +422,7 @@ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg) enddo endif ! imfdeepcnv, cal_re, random_clds - !--- o3 interpolation +!> - Call ozinterpol() to make ozone interpolation if (Model%ntoz > 0) then !$OMP do schedule (dynamic,1) do nb = 1, nblks @@ -423,7 +433,7 @@ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg) !$OMP end do endif - !--- h2o interpolation +!> - Call h2ointerpol() to make stratospheric water vapor data interpolation if (Model%h2o_phys) then !$OMP do schedule (dynamic,1) do nb = 1, nblks @@ -434,7 +444,7 @@ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg) !$OMP end do endif - !--- aerosol interpolation +!> - Call aerinterpol() to make aerosol interpolation if (Model%aero_in) then !$OMP do schedule (dynamic,1) do nb = 1, nblks @@ -449,7 +459,7 @@ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg) !$OMP end do endif - !--- ICCN interpolation +!> - Call ciinterpol() to make IN and CCN data interpolation if (Model%iccn) then !$OMP do schedule (dynamic,1) do nb = 1, nblks @@ -465,7 +475,7 @@ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg) !$OMP end parallel - !--- repopulate specific time-varying sfc properties for AMIP/forecast runs +!> - Call gcycle() to repopulate specific time-varying surface properties for AMIP/forecast runs if (Model%nscyc > 0) then if (mod(Model%kdt,Model%nscyc) == 1) THEN call gcycle (nblks, Model, Data(:)%Grid, Data(:)%Sfcprop, Data(:)%Cldprop) @@ -482,5 +492,7 @@ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg) endif end subroutine GFS_phys_time_vary_run +!> @} end module GFS_phys_time_vary +!> @} diff --git a/physics/GFS_rad_time_vary.fv3.F90 b/physics/GFS_rad_time_vary.fv3.F90 index ac96e78d0..22be34b51 100644 --- a/physics/GFS_rad_time_vary.fv3.F90 +++ b/physics/GFS_rad_time_vary.fv3.F90 @@ -10,14 +10,13 @@ module GFS_rad_time_vary contains -!>\defgroup GFS_rad_time_vary GFS RRTMG Update -!!\ingroup RRTMG -!! @{ !! \section arg_table_GFS_rad_time_vary_init Argument Table !! subroutine GFS_rad_time_vary_init end subroutine GFS_rad_time_vary_init +!>\defgroup mod_GFS_rad_time_vary GFS Radiation Time Update +!> @{ !> \section arg_table_GFS_rad_time_vary_run Argument Table !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |-------------------|--------------------------------------------------------|-------------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| @@ -105,10 +104,10 @@ subroutine GFS_rad_time_vary_run (Model, Data, nthrds, errmsg, errflg) endif end subroutine GFS_rad_time_vary_run +!> @} !> \section arg_table_GFS_rad_time_vary_finalize Argument Table !! subroutine GFS_rad_time_vary_finalize() end subroutine GFS_rad_time_vary_finalize -!! @} end module GFS_rad_time_vary diff --git a/physics/docs/ccppv3_fv3_doxyfile b/physics/docs/ccppv3_fv3_doxyfile index f92aa9b18..b2b896b9e 100644 --- a/physics/docs/ccppv3_fv3_doxyfile +++ b/physics/docs/ccppv3_fv3_doxyfile @@ -116,7 +116,7 @@ INPUT = pdftxt/mainpage.txt \ pdftxt/GFS_OZPHYS.txt \ pdftxt/GFS_H2OPHYS.txt \ pdftxt/GFS_RAYLEIGH.txt \ - pgftxt/GFS_SAMF.txt \ + pdftxt/GFS_SAMF.txt \ pdftxt/GFS_SAMFdeep.txt \ pdftxt/GFS_GWDC.txt \ pdftxt/GFS_SAMFshal.txt \ @@ -137,6 +137,7 @@ INPUT = pdftxt/mainpage.txt \ ../gfdl_fv_sat_adj.F90 \ ### time_vary ../GFS_phys_time_vary.fv3.F90 \ + ../GFS_rad_time_vary.fv3.F90 \ ../ozne_def.f \ ../ozinterp.f90 \ ../h2o_def.f \ @@ -147,7 +148,6 @@ INPUT = pdftxt/mainpage.txt \ ../iccninterp.F90 \ ../sfcsub.F \ ../gcycle.F90 \ - ### Radiation ../radlw_main.f \ ../radsw_main.f \ diff --git a/physics/docs/pdftxt/GFS_SAMF.txt b/physics/docs/pdftxt/GFS_SAMF.txt index 870599652..192f1f9a1 100644 --- a/physics/docs/pdftxt/GFS_SAMF.txt +++ b/physics/docs/pdftxt/GFS_SAMF.txt @@ -1,5 +1,6 @@ /** \page GFS_SAMF GFS Scale-Aware Simplified Arakawa-Schubert (sa-SAS) Convection Scheme + \section des_samf Description \section intra_samf Intraphysics Communication diff --git a/physics/sfcsub.F b/physics/sfcsub.F index 7c78707f5..391256ce0 100644 --- a/physics/sfcsub.F +++ b/physics/sfcsub.F @@ -2,10 +2,9 @@ !! This file contains gribcode for each parameter. -!>\defgroup mod_sfcsub_mod GFS sfcsub Module +!>\defgroup mod_sfcsub GFS sfcsub Module !!\ingroup Noah_LSM !> @{ -!>\ingroup mod_sfcsub !! This module contains grib code for each parameter-used in subroutines sfccycle() !! and setrmsk(). module sfccyc_module @@ -39,18 +38,37 @@ module sfccyc_module ! end module sfccyc_module -!>\ingroup mod_sfcsub - subroutine sfccycle(lugb,len,lsoil,sig1t,deltsfc - &, iy,im,id,ih,fh - &, rla, rlo, slmask,orog,orog_uf,use_ufo,nst_anl - &, sihfcs,sicfcs,sitfcs - &, swdfcs,slcfcs - &, vmnfcs,vmxfcs,slpfcs,absfcs - &, tsffcs,snofcs,zorfcs,albfcs,tg3fcs - &, cnpfcs,smcfcs,stcfcs,slifcs,aisfcs - &, vegfcs,vetfcs,sotfcs,alffcs - &, cvfcs,cvbfcs,cvtfcs,me,nlunit - &, sz_nml,input_nml_file +!>\ingroup mod_GFS_phys_time_vary +!! This subroutine reads or interpolates surface climatology data in analysis +!! and forecast mode. +!!\param lugb the unit number used in this subprogram +!!\param len number of points on which sfccyc operates +!!\param lsoil number of soil layers +!!\param sig1t sigma level 1 temperature for dead start. it should be on gaussian +!! grid. If not dead start, no need for dimension but set to zero as +!! in the example below. +!!\param deltsfc = fhcyc, frequcy for surface data cycling in hours +!!\param iy,im,id,ih year, month, day, and hour of initial state +!!\param fh forecast hour +!!\param rla, rlo latitude and longitudes of the len points +!!\param slmsk +!!\param orog +!!\param orog_uf +!!\param use_ufo +!!\param nst_anl +!! + + subroutine sfccycle(lugb,len,lsoil,sig1t,deltsfc & + &, iy,im,id,ih,fh & + &, rla, rlo, slmask,orog,orog_uf,use_ufo,nst_anl & + &, sihfcs,sicfcs,sitfcs & + &, swdfcs,slcfcs & + &, vmnfcs,vmxfcs,slpfcs,absfcs & + &, tsffcs,snofcs,zorfcs,albfcs,tg3fcs & + &, cnpfcs,smcfcs,stcfcs,slifcs,aisfcs & + &, vegfcs,vetfcs,sotfcs,alffcs & + &, cvfcs,cvbfcs,cvtfcs,me,nlunit & + &, sz_nml,input_nml_file & &, ialb,isot,ivegsrc,tile_num_ch,i_index,j_index) ! use machine , only : kind_io8,kind_io4 @@ -59,90 +77,90 @@ subroutine sfccycle(lugb,len,lsoil,sig1t,deltsfc character(len=*), intent(in) :: tile_num_ch integer,intent(in) :: i_index(len), j_index(len) logical use_ufo, nst_anl - real (kind=kind_io8) sllnd,slsea,aicice,aicsea,tgice,rlapse, - & orolmx,orolmn,oroomx,oroomn,orosmx, - & orosmn,oroimx,oroimn,orojmx,orojmn, - & alblmx,alblmn,albomx,albomn,albsmx, - & albsmn,albimx,albimn,albjmx,albjmn, - & wetlmx,wetlmn,wetomx,wetomn,wetsmx, - & wetsmn,wetimx,wetimn,wetjmx,wetjmn, - & snolmx,snolmn,snoomx,snoomn,snosmx, - & snosmn,snoimx,snoimn,snojmx,snojmn, - & zorlmx,zorlmn,zoromx,zoromn,zorsmx, - & zorsmn,zorimx,zorimn,zorjmx, zorjmn, - & plrlmx,plrlmn,plromx,plromn,plrsmx, - & plrsmn,plrimx,plrimn,plrjmx,plrjmn, - & tsflmx,tsflmn,tsfomx,tsfomn,tsfsmx, - & tsfsmn,tsfimx,tsfimn,tsfjmx,tsfjmn, - & tg3lmx,tg3lmn,tg3omx,tg3omn,tg3smx, - & tg3smn,tg3imx,tg3imn,tg3jmx,tg3jmn, - & stclmx,stclmn,stcomx,stcomn,stcsmx, - & stcsmn,stcimx,stcimn,stcjmx,stcjmn, - & smclmx,smclmn,smcomx,smcomn,smcsmx, - & smcsmn,smcimx,smcimn,smcjmx,smcjmn, - & scvlmx,scvlmn,scvomx,scvomn,scvsmx, - & scvsmn,scvimx,scvimn,scvjmx,scvjmn, - & veglmx,veglmn,vegomx,vegomn,vegsmx, - & vegsmn,vegimx,vegimn,vegjmx,vegjmn, - & vetlmx,vetlmn,vetomx,vetomn,vetsmx, - & vetsmn,vetimx,vetimn,vetjmx,vetjmn, - & sotlmx,sotlmn,sotomx,sotomn,sotsmx, - & sotsmn,sotimx,sotimn,sotjmx,sotjmn, - & alslmx,alslmn,alsomx,alsomn,alssmx, - & alssmn,alsimx,alsimn,alsjmx,alsjmn, - & epstsf,epsalb,epssno,epswet,epszor, - & epsplr,epsoro,epssmc,epsscv,eptsfc, - & epstg3,epsais,epsacn,epsveg,epsvet, - & epssot,epsalf,qctsfs,qcsnos,qctsfi, - & aislim,snwmin,snwmax,cplrl,cplrs, - & cvegl,czors,csnol,csnos,czorl,csots, - & csotl,cvwgs,cvetl,cvets,calfs, - & fcalfl,fcalfs,ccvt,ccnp,ccv,ccvb, - & calbl,calfl,calbs,ctsfs,grboro, - & grbmsk,ctsfl,deltf,caisl,caiss, - & fsalfl,fsalfs,flalfs,falbl,ftsfl, - & ftsfs,fzorl,fzors,fplrl,fsnos,faisl, - & faiss,fsnol,bltmsk,falbs,cvegs,percrit, - & deltsfc,critp2,critp3,blnmsk,critp1, - & fcplrl,fcplrs,fczors,fvets,fsotl,fsots, - & fvetl,fplrs,fvegl,fvegs,fcsnol,fcsnos, - & fczorl,fcalbs,fctsfl,fctsfs,fcalbl, - & falfs,falfl,fh,crit,zsca,ztsfc,tem1,tem2 - &, fsihl,fsihs,fsicl,fsics, - & csihl,csihs,csicl,csics,epssih,epssic - &, fvmnl,fvmns,fvmxl,fvmxs,fslpl,fslps, - & fabsl,fabss,cvmnl,cvmns,cvmxl,cvmxs, - & cslpl,cslps,cabsl,cabss,epsvmn,epsvmx, - & epsslp,epsabs - &, sihlmx,sihlmn,sihomx,sihomn,sihsmx, - & sihsmn,sihimx,sihimn,sihjmx,sihjmn, - & siclmx,siclmn,sicomx,sicomn,sicsmx, - & sicsmn,sicimx,sicimn,sicjmx,sicjmn - &, glacir_hice - &, vmnlmx,vmnlmn,vmnomx,vmnomn,vmnsmx, - & vmnsmn,vmnimx,vmnimn,vmnjmx,vmnjmn, - & vmxlmx,vmxlmn,vmxomx,vmxomn,vmxsmx, - & vmxsmn,vmximx,vmximn,vmxjmx,vmxjmn, - & slplmx,slplmn,slpomx,slpomn,slpsmx, - & slpsmn,slpimx,slpimn,slpjmx,slpjmn, - & abslmx,abslmn,absomx,absomn,abssmx, - & abssmn,absimx,absimn,absjmx,absjmn + real (kind=kind_io8) sllnd,slsea,aicice,aicsea,tgice,rlapse, & + & orolmx,orolmn,oroomx,oroomn,orosmx, & + & orosmn,oroimx,oroimn,orojmx,orojmn, & + & alblmx,alblmn,albomx,albomn,albsmx, & + & albsmn,albimx,albimn,albjmx,albjmn, & + & wetlmx,wetlmn,wetomx,wetomn,wetsmx, & + & wetsmn,wetimx,wetimn,wetjmx,wetjmn, & + & snolmx,snolmn,snoomx,snoomn,snosmx, & + & snosmn,snoimx,snoimn,snojmx,snojmn, & + & zorlmx,zorlmn,zoromx,zoromn,zorsmx, & + & zorsmn,zorimx,zorimn,zorjmx, zorjmn, & + & plrlmx,plrlmn,plromx,plromn,plrsmx, & + & plrsmn,plrimx,plrimn,plrjmx,plrjmn, & + & tsflmx,tsflmn,tsfomx,tsfomn,tsfsmx, & + & tsfsmn,tsfimx,tsfimn,tsfjmx,tsfjmn, & + & tg3lmx,tg3lmn,tg3omx,tg3omn,tg3smx, & + & tg3smn,tg3imx,tg3imn,tg3jmx,tg3jmn, & + & stclmx,stclmn,stcomx,stcomn,stcsmx, & + & stcsmn,stcimx,stcimn,stcjmx,stcjmn, & + & smclmx,smclmn,smcomx,smcomn,smcsmx, & + & smcsmn,smcimx,smcimn,smcjmx,smcjmn, & + & scvlmx,scvlmn,scvomx,scvomn,scvsmx, & + & scvsmn,scvimx,scvimn,scvjmx,scvjmn, & + & veglmx,veglmn,vegomx,vegomn,vegsmx, & + & vegsmn,vegimx,vegimn,vegjmx,vegjmn, & + & vetlmx,vetlmn,vetomx,vetomn,vetsmx, & + & vetsmn,vetimx,vetimn,vetjmx,vetjmn, & + & sotlmx,sotlmn,sotomx,sotomn,sotsmx, & + & sotsmn,sotimx,sotimn,sotjmx,sotjmn, & + & alslmx,alslmn,alsomx,alsomn,alssmx, & + & alssmn,alsimx,alsimn,alsjmx,alsjmn, & + & epstsf,epsalb,epssno,epswet,epszor, & + & epsplr,epsoro,epssmc,epsscv,eptsfc, & + & epstg3,epsais,epsacn,epsveg,epsvet, & + & epssot,epsalf,qctsfs,qcsnos,qctsfi, & + & aislim,snwmin,snwmax,cplrl,cplrs, & + & cvegl,czors,csnol,csnos,czorl,csots, & + & csotl,cvwgs,cvetl,cvets,calfs, & + & fcalfl,fcalfs,ccvt,ccnp,ccv,ccvb, & + & calbl,calfl,calbs,ctsfs,grboro, & + & grbmsk,ctsfl,deltf,caisl,caiss, & + & fsalfl,fsalfs,flalfs,falbl,ftsfl, & + & ftsfs,fzorl,fzors,fplrl,fsnos,faisl, & + & faiss,fsnol,bltmsk,falbs,cvegs,percrit, & + & deltsfc,critp2,critp3,blnmsk,critp1, & + & fcplrl,fcplrs,fczors,fvets,fsotl,fsots, & + & fvetl,fplrs,fvegl,fvegs,fcsnol,fcsnos, & + & fczorl,fcalbs,fctsfl,fctsfs,fcalbl, & + & falfs,falfl,fh,crit,zsca,ztsfc,tem1,tem2 & + &, fsihl,fsihs,fsicl,fsics, & + & csihl,csihs,csicl,csics,epssih,epssic & + &, fvmnl,fvmns,fvmxl,fvmxs,fslpl,fslps, & + & fabsl,fabss,cvmnl,cvmns,cvmxl,cvmxs, & + & cslpl,cslps,cabsl,cabss,epsvmn,epsvmx, & + & epsslp,epsabs & + &, sihlmx,sihlmn,sihomx,sihomn,sihsmx, & + & sihsmn,sihimx,sihimn,sihjmx,sihjmn, & + & siclmx,siclmn,sicomx,sicomn,sicsmx, & + & sicsmn,sicimx,sicimn,sicjmx,sicjmn & + &, glacir_hice & + &, vmnlmx,vmnlmn,vmnomx,vmnomn,vmnsmx, & + & vmnsmn,vmnimx,vmnimn,vmnjmx,vmnjmn, & + & vmxlmx,vmxlmn,vmxomx,vmxomn,vmxsmx, & + & vmxsmn,vmximx,vmximn,vmxjmx,vmxjmn, & + & slplmx,slplmn,slpomx,slpomn,slpsmx, & + & slpsmn,slpimx,slpimn,slpjmx,slpjmn, & + & abslmx,abslmn,absomx,absomn,abssmx, & + & abssmn,absimx,absimn,absjmx,absjmn & &, sihnew - integer imsk,jmsk,ifp,irtscv,irtacn,irtais,irtsno,irtzor, - & irtalb,irtsot,irtalf,j,irtvet,irtsmc,irtstc,irtveg, - & irtwet,k,iprnt,kk,irttsf,iret,i,igrdbg,iy,im,id, - & icalbl,icalbs,icalfl,ictsfs,lugb,len,lsoil,ih, - & ictsfl,iczors,icplrl,icplrs,iczorl,icalfs,icsnol, - & icsnos,irttg3,me,kqcm,nlunit,sz_nml,ialb + integer imsk,jmsk,ifp,irtscv,irtacn,irtais,irtsno,irtzor, & + & irtalb,irtsot,irtalf,j,irtvet,irtsmc,irtstc,irtveg, & + & irtwet,k,iprnt,kk,irttsf,iret,i,igrdbg,iy,im,id, & + & icalbl,icalbs,icalfl,ictsfs,lugb,len,lsoil,ih, & + & ictsfl,iczors,icplrl,icplrs,iczorl,icalfs,icsnol, & + & icsnos,irttg3,me,kqcm,nlunit,sz_nml,ialb & &, irtvmn, irtvmx, irtslp, irtabs, isot, ivegsrc - logical gausm, deads, qcmsk, znlst, monclm, monanl, + logical gausm, deads, qcmsk, znlst, monclm, monanl, & & monfcs, monmer, mondif, landice character(len=*), intent(in) :: input_nml_file(sz_nml) integer num_parthds ! -!> this is a limited point version of surface program. +!> This is a limited point version of surface program. !! !! this program runs in two different modes: !! @@ -159,9 +177,7 @@ subroutine sfccycle(lugb,len,lsoil,sig1t,deltsfc !! forecast hour. if surface analysis file is given, for the corresponding !! dates, the program will use it. !! -!! note: -!! -!! if the date of the analysis does not match given iy,im,id,ih, (and fh), +!!\note if the date of the analysis does not match given iy,im,id,ih, (and fh), !! the program searches an old analysis by going back 6 hours, then 12 hours, !! then one day upto nrepmx days (parameter statement in the subrotine fixrd. !! now defined as 8). this allows the user to provide non-daily analysis to @@ -178,15 +194,6 @@ subroutine sfccycle(lugb,len,lsoil,sig1t,deltsfc !! !! for a dead start, do not supply fnbgsi or set fnbgsi=' ' ! -! lugb is the unit number used in this subprogram -! len ... number of points on which sfccyc operates -! lsoil .. number of soil layers (2 as of april, 1994) -! iy,im,id,ih .. year, month, day, and hour of initial state. -! fh .. forecast hour -! rla, rlo -- latitude and longitudes of the len points -! sig1t .. sigma level 1 temperature for dead start. should be on gaussian -! grid. if not dead start, no need for dimension but set to zero -! as in the example below. ! ! variable naming conventions: ! @@ -427,7 +434,7 @@ subroutine sfccycle(lugb,len,lsoil,sig1t,deltsfc ! ! mask orography and variance on gaussian grid ! - real (kind=kind_io8) slmask(len),orog(len), orog_uf(len) + real (kind=kind_io8) slmask(len),orog(len), orog_uf(len) & &, orogd(len) real (kind=kind_io8) rla(len), rlo(len) ! @@ -440,50 +447,50 @@ subroutine sfccycle(lugb,len,lsoil,sig1t,deltsfc ! ! climatology surface fields (last character 'c' or 'clm' indicate climatology) ! - character*500 fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, - & fnplrc,fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc, - & fnvegc,fnvetc,fnsotc + character*500 fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, & + & fnplrc,fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc, & + & fnvegc,fnvetc,fnsotc & &, fnvmnc,fnvmxc,fnslpc,fnabsc, fnalbc2 - real (kind=kind_io8) tsfclm(len), wetclm(len), snoclm(len), - & zorclm(len), albclm(len,4), aisclm(len), - & tg3clm(len), acnclm(len), cnpclm(len), - & cvclm (len), cvbclm(len), cvtclm(len), - & scvclm(len), tsfcl2(len), vegclm(len), - & vetclm(len), sotclm(len), alfclm(len,2), sliclm(len), - & smcclm(len,lsoil), stcclm(len,lsoil) - &, sihclm(len), sicclm(len) + real (kind=kind_io8) tsfclm(len), wetclm(len), snoclm(len), & + & zorclm(len), albclm(len,4), aisclm(len), & + & tg3clm(len), acnclm(len), cnpclm(len), & + & cvclm (len), cvbclm(len), cvtclm(len), & + & scvclm(len), tsfcl2(len), vegclm(len), & + & vetclm(len), sotclm(len), alfclm(len,2), sliclm(len), & + & smcclm(len,lsoil), stcclm(len,lsoil) & + &, sihclm(len), sicclm(len) & &, vmnclm(len), vmxclm(len), slpclm(len), absclm(len) ! ! analyzed surface fields (last character 'a' or 'anl' indicate analysis) ! - character*500 fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, - & fnplra,fntg3a,fnscva,fnsmca,fnstca,fnacna, - & fnvega,fnveta,fnsota + character*500 fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, & + & fnplra,fntg3a,fnscva,fnsmca,fnstca,fnacna, & + & fnvega,fnveta,fnsota & &, fnvmna,fnvmxa,fnslpa,fnabsa ! - real (kind=kind_io8) tsfanl(len), wetanl(len), snoanl(len), - & zoranl(len), albanl(len,4), aisanl(len), - & tg3anl(len), acnanl(len), cnpanl(len), - & cvanl (len), cvbanl(len), cvtanl(len), - & scvanl(len), tsfan2(len), veganl(len), - & vetanl(len), sotanl(len), alfanl(len,2), slianl(len), - & smcanl(len,lsoil), stcanl(len,lsoil) - &, sihanl(len), sicanl(len) + real (kind=kind_io8) tsfanl(len), wetanl(len), snoanl(len), & + & zoranl(len), albanl(len,4), aisanl(len), & + & tg3anl(len), acnanl(len), cnpanl(len), & + & cvanl (len), cvbanl(len), cvtanl(len), & + & scvanl(len), tsfan2(len), veganl(len), & + & vetanl(len), sotanl(len), alfanl(len,2), slianl(len), & + & smcanl(len,lsoil), stcanl(len,lsoil) & + &, sihanl(len), sicanl(len) & &, vmnanl(len), vmxanl(len), slpanl(len), absanl(len) ! real (kind=kind_io8) tsfan0(len) ! sea surface temperature analysis at ft=0. ! ! predicted surface fields (last characters 'fcs' indicates forecast) ! - real (kind=kind_io8) tsffcs(len), wetfcs(len), snofcs(len), - & zorfcs(len), albfcs(len,4), aisfcs(len), - & tg3fcs(len), acnfcs(len), cnpfcs(len), - & cvfcs (len), cvbfcs(len), cvtfcs(len), - & slifcs(len), vegfcs(len), - & vetfcs(len), sotfcs(len), alffcs(len,2), - & smcfcs(len,lsoil), stcfcs(len,lsoil) - &, sihfcs(len), sicfcs(len), sitfcs(len) - &, vmnfcs(len), vmxfcs(len), slpfcs(len), absfcs(len) + real (kind=kind_io8) tsffcs(len), wetfcs(len), snofcs(len), & + & zorfcs(len), albfcs(len,4), aisfcs(len), & + & tg3fcs(len), acnfcs(len), cnpfcs(len), & + & cvfcs (len), cvbfcs(len), cvtfcs(len), & + & slifcs(len), vegfcs(len), & + & vetfcs(len), sotfcs(len), alffcs(len,2), & + & smcfcs(len,lsoil), stcfcs(len,lsoil) & + &, sihfcs(len), sicfcs(len), sitfcs(len) & + &, vmnfcs(len), vmxfcs(len), slpfcs(len), absfcs(len) & &, swdfcs(len), slcfcs(len,lsoil) ! ! ratio of sigma level 1 wind and 10m wind (diagnozed by model and not touched @@ -989,7 +996,7 @@ subroutine sfccycle(lugb,len,lsoil,sig1t,deltsfc if((fabss.gt.0.).and.(fabss.lt.99999)) cabss=exp(-deltf/fabss) !clu ---------------------------------------------------------------------- ! -! read a high resolution mask field for use in grib interpolation +!> - Call hmskrd() to read a high resolution mask field for use in grib interpolation ! call hmskrd(lugb,imsk,jmsk,fnmskh, & kpdmsk,slmskh,gausm,blnmsk,bltmsk,me) @@ -2671,7 +2678,8 @@ subroutine dayoyr(iyr,imo,idy,ldy) end !>\ingroup mod_sfcsub - subroutine hmskrd(lugb,imsk,jmsk,fnmskh, +!! reads a high resolution mask field for use in grib interpolation + subroutine hmskrd(lugb,imsk,jmsk,fnmskh, & & kpds5,slmskh,gausm,blnmsk,bltmsk,me) use machine , only : kind_io8,kind_io4 use sfccyc_module, only : mdata, xdata, ydata @@ -2706,7 +2714,7 @@ subroutine hmskrd(lugb,imsk,jmsk,fnmskh, end !>\ingroup mod_sfcsub - subroutine fixrdg(lugb,idim,jdim,fngrib, + subroutine fixrdg(lugb,idim,jdim,fngrib, & & kpds5,gdata,gaus,blno,blto,me) use machine , only : kind_io8,kind_io4 use sfccyc_module, only : mdata @@ -2824,7 +2832,7 @@ subroutine fixrdg(lugb,idim,jdim,fngrib, !>\ingroup mod_sfcsub !! This subroutine get area of the grib record. - subroutine getarea(kgds,dlat,dlon,rslat,rnlat,wlon,elon,ijordr + subroutine getarea(kgds,dlat,dlon,rslat,rnlat,wlon,elon,ijordr & &, me) use machine , only : kind_io8,kind_io4 implicit none @@ -3040,24 +3048,22 @@ subroutine subst(data,imax,jmax,dlon,dlat,ijordr) !>\ingroup mod_sfcsub !! This subroutine conducts interpolation from lat/lon to Gaussian !! grid to other lat/lon grid. - subroutine la2ga(regin,imxin,jmxin,rinlon,rinlat,rlon,rlat,inttyp, - & gauout,len,lmask,rslmsk,slmask + subroutine la2ga(regin,imxin,jmxin,rinlon,rinlat,rlon,rlat,inttyp,& + & gauout,len,lmask,rslmsk,slmask & &, outlat, outlon,me) use machine , only : kind_io8,kind_io4 implicit none - real (kind=kind_io8) wei4,wei3,wei2,sum2,sum1,sum3,wei1,sum4, - & wsum,tem,wsumiv,sums,sumn,wi2j2,x,y,wi1j1, - & wi1j2,wi2j1,rlat,rlon,aphi, + real (kind=kind_io8) wei4,wei3,wei2,sum2,sum1,sum3,wei1,sum4, & + & wsum,tem,wsumiv,sums,sumn,wi2j2,x,y,wi1j1, & + & wi1j2,wi2j1,rlat,rlon,aphi, & & rnume,alamd,denom - integer jy,ifills,ix,len,inttyp,me,i,j,jmxin,imxin,jq,jx,j1,j2, + integer jy,ifills,ix,len,inttyp,me,i,j,jmxin,imxin,jq,jx,j1,j2, & & ii,i1,i2,kmami,it integer nx,kxs,kxt integer, allocatable, save :: imxnx(:) integer, allocatable :: ifill(:) ! -! interpolation from lat/lon or gaussian grid to other lat/lon grid -! - real (kind=kind_io8) outlon(len),outlat(len),gauout(len), + real (kind=kind_io8) outlon(len),outlat(len),gauout(len), & & slmask(len) real (kind=kind_io8) regin (imxin,jmxin),rslmsk(imxin,jmxin) ! @@ -3613,54 +3619,46 @@ subroutine maxmin(f,imax,kmax) end !>\ingroup mod_sfcsub - subroutine filanl(tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl, - & aisanl, - & tg3anl,cvanl ,cvbanl,cvtanl, - & cnpanl,smcanl,stcanl,slianl,scvanl,veganl, - & vetanl,sotanl,alfanl, -!cwu [+1l] add ()anl for sih, sic - & sihanl,sicanl, -!clu [+1l] add ()anl for vmn, vmx, slp, abs - & vmnanl,vmxanl,slpanl,absanl, - & tsfclm,tsfcl2,wetclm,snoclm,zorclm,albclm, - & aisclm, - & tg3clm,cvclm ,cvbclm,cvtclm, - & cnpclm,smcclm,stcclm,sliclm,scvclm,vegclm, - & vetclm,sotclm,alfclm, -!cwu [+1l] add ()clm for sih, sic - & sihclm,sicclm, -!clu [+1l] add ()clm for vmn, vmx, slp, abs - & vmnclm,vmxclm,slpclm,absclm, + subroutine filanl(tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl, & + & aisanl, & + & tg3anl,cvanl ,cvbanl,cvtanl, & + & cnpanl,smcanl,stcanl,slianl,scvanl,veganl, & + & vetanl,sotanl,alfanl, & + & sihanl,sicanl, & !cwu [+1l] add ()anl for sih, sic + & vmnanl,vmxanl,slpanl,absanl, & !clu [+1l] add ()anl for vmn, vmx, slp, abs + & tsfclm,tsfcl2,wetclm,snoclm,zorclm,albclm, & + & aisclm, & + & tg3clm,cvclm ,cvbclm,cvtclm, & + & cnpclm,smcclm,stcclm,sliclm,scvclm,vegclm, & + & vetclm,sotclm,alfclm, & + & sihclm,sicclm, & !cwu [+1l] add ()clm for sih, sic + & vmnclm,vmxclm,slpclm,absclm, & !clu [+1l] add ()clm for vmn, vmx, slp, abs & len,lsoil) use machine , only : kind_io8,kind_io4 implicit none integer i,j,len,lsoil ! - real (kind=kind_io8) tsfanl(len),tsfan2(len),wetanl(len), - & snoanl(len), - & zoranl(len),albanl(len,4),aisanl(len), - & tg3anl(len), - & cvanl (len),cvbanl(len),cvtanl(len), - & cnpanl(len), - & smcanl(len,lsoil),stcanl(len,lsoil), - & slianl(len),scvanl(len),veganl(len), - & vetanl(len),sotanl(len),alfanl(len,2) -!cwu [+1l] add ()anl for sih, sic - &, sihanl(len),sicanl(len) -!clu [+1l] add ()anl for vmn, vmx, slp, abs - &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len) - real (kind=kind_io8) tsfclm(len),tsfcl2(len),wetclm(len), - & snoclm(len), - & zorclm(len),albclm(len,4),aisclm(len), - & tg3clm(len), - & cvclm (len),cvbclm(len),cvtclm(len), - & cnpclm(len), - & smcclm(len,lsoil),stcclm(len,lsoil), - & sliclm(len),scvclm(len),vegclm(len), - & vetclm(len),sotclm(len),alfclm(len,2) -!cwu [+1l] add ()clm for sih, sic - &, sihclm(len),sicclm(len) -!clu [+1l] add ()clm for vmn, vmx, slp, abs + real (kind=kind_io8) tsfanl(len),tsfan2(len),wetanl(len), & + & snoanl(len), & + & zoranl(len),albanl(len,4),aisanl(len), & + & tg3anl(len), & + & cvanl (len),cvbanl(len),cvtanl(len), & + & cnpanl(len), & + & smcanl(len,lsoil),stcanl(len,lsoil), & + & slianl(len),scvanl(len),veganl(len), & + & vetanl(len),sotanl(len),alfanl(len,2) & + &, sihanl(len),sicanl(len) & + &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len) + real (kind=kind_io8) tsfclm(len),tsfcl2(len),wetclm(len), & + & snoclm(len), & + & zorclm(len),albclm(len,4),aisclm(len), & + & tg3clm(len), & + & cvclm (len),cvbclm(len),cvtclm(len), & + & cnpclm(len), & + & smcclm(len,lsoil),stcclm(len,lsoil), & + & sliclm(len),scvclm(len),vegclm(len), & + & vetclm(len),sotclm(len),alfclm(len,2) & + &, sihclm(len),sicclm(len) & &, vmnclm(len),vmxclm(len),slpclm(len),absclm(len) ! do i=1,len @@ -3712,43 +3710,34 @@ subroutine filanl(tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl, end !>\ingroup mod_sfcsub - subroutine analy(lugb,iy,im,id,ih,fh,len,lsoil, - & slmask,fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, - & fntg3a,fnscva,fnsmca,fnstca,fnacna,fnvega, - & fnveta,fnsota, -!clu [+1l] add fn()a for vmn, vmx, slp, abs - & fnvmna,fnvmxa,fnslpa,fnabsa, - & tsfanl,wetanl,snoanl,zoranl,albanl,aisanl, - & tg3anl,cvanl ,cvbanl,cvtanl, - & smcanl,stcanl,slianl,scvanl,acnanl,veganl, - & vetanl,sotanl,alfanl,tsfan0, -!clu [+1l] add ()anl for vmn, vmx, slp, abs - & vmnanl,vmxanl,slpanl,absanl, -!cggg snow mods start & kpdtsf,kpdwet,kpdsno,kpdzor,kpdalb,kpdais, - & kpdtsf,kpdwet,kpdsno,kpdsnd,kpdzor,kpdalb,kpdais, -!cggg snow mods end - & kpdtg3,kpdscv,kpdacn,kpdsmc,kpdstc,kpdveg, - & kprvet,kpdsot,kpdalf, -!clu [+1l] add kpd() for vmn, vmx, slp, abs - & kpdvmn,kpdvmx,kpdslp,kpdabs, - & irttsf,irtwet,irtsno,irtzor,irtalb,irtais, - & irttg3,irtscv,irtacn,irtsmc,irtstc,irtveg, - & irtvet,irtsot,irtalf -!clu [+1l] add irt() for vmn, vmx, slp, abs - &, irtvmn,irtvmx,irtslp,irtabs - &, imsk, jmsk, slmskh, outlat, outlon + subroutine analy(lugb,iy,im,id,ih,fh,len,lsoil, & + & slmask,fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa,& + & fntg3a,fnscva,fnsmca,fnstca,fnacna,fnvega, & + & fnveta,fnsota, & + & fnvmna,fnvmxa,fnslpa,fnabsa, & !clu [+1l] add fn()a for vmn, vmx, slp, abs + & tsfanl,wetanl,snoanl,zoranl,albanl,aisanl, & + & tg3anl,cvanl ,cvbanl,cvtanl, & + & smcanl,stcanl,slianl,scvanl,acnanl,veganl, & + & vetanl,sotanl,alfanl,tsfan0, & + & vmnanl,vmxanl,slpanl,absanl, & !clu [+1l] add ()anl for vmn, vmx, slp, abs + & kpdtsf,kpdwet,kpdsno,kpdsnd,kpdzor,kpdalb,kpdais,& + & kpdtg3,kpdscv,kpdacn,kpdsmc,kpdstc,kpdveg, & + & kprvet,kpdsot,kpdalf, & + & kpdvmn,kpdvmx,kpdslp,kpdabs, & !clu [+1l] add kpd() for vmn, vmx, slp, abs + & irttsf,irtwet,irtsno,irtzor,irtalb,irtais, & + & irttg3,irtscv,irtacn,irtsmc,irtstc,irtveg, & + & irtvet,irtsot,irtalf & + &, irtvmn,irtvmx,irtslp,irtabs & !clu [+1l] add irt() for vmn, vmx, slp, abs + &, imsk, jmsk, slmskh, outlat, outlon & &, gaus, blno, blto, me, lanom) use machine , only : kind_io8,kind_io4 implicit none logical lanom - integer irtsmc,irtacn,irtstc,irtvet,irtveg,irtscv,irtzor,irtsno, - & irtalb,irttg3,irtais,iret,me,kk,kpdvet,i,irtalf,irtsot, -!cggg snow mods start & imsk,jmsk,irtwet,lsoil,len, kpdtsf,kpdsno,kpdwet,iy, - & imsk,jmsk,irtwet,lsoil,len,kpdtsf,kpdsno,kpdsnd,kpdwet,iy, -!cggg snow mods end - & lugb,im,ih,id,kpdveg,kpdstc,kprvet,irttsf,kpdsot,kpdsmc, - & kpdais,kpdzor,kpdtg3,kpdacn,kpdscv,j -!clu [+1l] add kpd() and irt() for vmn, vmx, slp, abs + integer irtsmc,irtacn,irtstc,irtvet,irtveg,irtscv,irtzor,irtsno, & + & irtalb,irttg3,irtais,iret,me,kk,kpdvet,i,irtalf,irtsot, & + & imsk,jmsk,irtwet,lsoil,len,kpdtsf,kpdsno,kpdsnd,kpdwet,iy,& + & lugb,im,ih,id,kpdveg,kpdstc,kprvet,irttsf,kpdsot,kpdsmc, & + & kpdais,kpdzor,kpdtg3,kpdacn,kpdscv,j & &, kpdvmn,kpdvmx,kpdslp,kpdabs,irtvmn,irtvmx,irtslp,irtabs real (kind=kind_io8) blto,blno,fh ! @@ -3761,21 +3750,19 @@ subroutine analy(lugb,iy,im,id,ih,fh,len,lsoil, integer lugi, lskip, lgrib, ndata !cggg snow mods end ! - character*500 fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, - & fntg3a,fnscva,fnsmca,fnstca,fnacna,fnvega, + character*500 fntsfa,fnweta,fnsnoa,fnzora,fnalba,fnaisa, & + & fntg3a,fnscva,fnsmca,fnstca,fnacna,fnvega, & & fnveta,fnsota -!clu [+1l] add fn()a for vmn, vmx, slp, abs &, fnvmna,fnvmxa,fnslpa,fnabsa - real (kind=kind_io8) tsfanl(len), wetanl(len), snoanl(len), - & zoranl(len), albanl(len,4), aisanl(len), - & tg3anl(len), acnanl(len), - & cvanl (len), cvbanl(len), cvtanl(len), - & slianl(len), scvanl(len), veganl(len), - & vetanl(len), sotanl(len), alfanl(len,2), - & smcanl(len,lsoil), stcanl(len,lsoil), - & tsfan0(len) -!clu [+1l] add ()anl for vmn, vmx, slp, abs + real (kind=kind_io8) tsfanl(len), wetanl(len), snoanl(len), & + & zoranl(len), albanl(len,4), aisanl(len), & + & tg3anl(len), acnanl(len), & + & cvanl (len), cvbanl(len), cvtanl(len), & + & slianl(len), scvanl(len), veganl(len), & + & vetanl(len), sotanl(len), alfanl(len,2), & + & smcanl(len,lsoil), stcanl(len,lsoil), & + & tsfan0(len) & &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len) ! logical gaus @@ -4378,53 +4365,45 @@ subroutine analy(lugb,iy,im,id,ih,fh,len,lsoil, end !>\ingroup mod_sfcsub - subroutine filfcs(tsffcs,wetfcs,snofcs,zorfcs,albfcs, - & tg3fcs,cvfcs ,cvbfcs,cvtfcs, - & cnpfcs,smcfcs,stcfcs,slifcs,aisfcs, - & vegfcs, vetfcs, sotfcs, alffcs, -!cwu [+1l] add ()fcs for sih, sic - & sihfcs,sicfcs, -!clu [+1l] add ()fcs for vmn, vmx, slp, abs - & vmnfcs,vmxfcs,slpfcs,absfcs, - & tsfanl,wetanl,snoanl,zoranl,albanl, - & tg3anl,cvanl ,cvbanl,cvtanl, - & cnpanl,smcanl,stcanl,slianl,aisanl, - & veganl, vetanl, sotanl, alfanl, -!cwu [+1l] add ()anl for sih, sic - & sihanl,sicanl, -!clu [+1l] add ()anl for vmn, vmx, slp, abs - & vmnanl,vmxanl,slpanl,absanl, + subroutine filfcs(tsffcs,wetfcs,snofcs,zorfcs,albfcs, & + & tg3fcs,cvfcs ,cvbfcs,cvtfcs, & + & cnpfcs,smcfcs,stcfcs,slifcs,aisfcs, & + & vegfcs, vetfcs, sotfcs, alffcs, & + & sihfcs,sicfcs, & !cwu [+1l] add ()fcs for sih, sic + & vmnfcs,vmxfcs,slpfcs,absfcs, & !clu [+1l] add ()fcs for vmn, vmx, slp, abs + & tsfanl,wetanl,snoanl,zoranl,albanl, & + & tg3anl,cvanl ,cvbanl,cvtanl, & + & cnpanl,smcanl,stcanl,slianl,aisanl, & + & veganl, vetanl, sotanl, alfanl, & + & sihanl,sicanl, & !cwu [+1l] add ()anl for sih, sic + & vmnanl,vmxanl,slpanl,absanl, & !clu [+1l] add ()anl for vmn, vmx, slp, abs & len,lsoil) ! use machine , only : kind_io8,kind_io4 implicit none integer i,j,len,lsoil - real (kind=kind_io8) tsffcs(len),wetfcs(len),snofcs(len), - & zorfcs(len),albfcs(len,4),aisfcs(len), - & tg3fcs(len), - & cvfcs (len),cvbfcs(len),cvtfcs(len), - & cnpfcs(len), - & smcfcs(len,lsoil),stcfcs(len,lsoil), - & slifcs(len),vegfcs(len), - & vetfcs(len),sotfcs(len),alffcs(len,2) -!cwu [+1l] add ()fcs for sih, sic - &, sihfcs(len),sicfcs(len) -!clu [+1l] add ()fcs for vmn, vmx, slp, abs - &, vmnfcs(len),vmxfcs(len),slpfcs(len),absfcs(len) - real (kind=kind_io8) tsfanl(len),wetanl(len),snoanl(len), - & zoranl(len),albanl(len,4),aisanl(len), - & tg3anl(len), - & cvanl (len),cvbanl(len),cvtanl(len), - & cnpanl(len), - & smcanl(len,lsoil),stcanl(len,lsoil), - & slianl(len),veganl(len), - & vetanl(len),sotanl(len),alfanl(len,2) -!cwu [+1l] add ()anl for sih, sic - &, sihanl(len),sicanl(len) -!clu [+1l] add ()anl for vmn, vmx, slp, abs + real (kind=kind_io8) tsffcs(len),wetfcs(len),snofcs(len), & + & zorfcs(len),albfcs(len,4),aisfcs(len), & + & tg3fcs(len), & + & cvfcs (len),cvbfcs(len),cvtfcs(len), & + & cnpfcs(len), & + & smcfcs(len,lsoil),stcfcs(len,lsoil), & + & slifcs(len),vegfcs(len), & + & vetfcs(len),sotfcs(len),alffcs(len,2) & + &, sihfcs(len),sicfcs(len) & + &, vmnfcs(len),vmxfcs(len),slpfcs(len),absfcs(len) + real (kind=kind_io8) tsfanl(len),wetanl(len),snoanl(len), & + & zoranl(len),albanl(len,4),aisanl(len), & + & tg3anl(len), & + & cvanl (len),cvbanl(len),cvtanl(len), & + & cnpanl(len), & + & smcanl(len,lsoil),stcanl(len,lsoil), & + & slianl(len),veganl(len), & + & vetanl(len),sotanl(len),alfanl(len,2) & + &, sihanl(len),sicanl(len) & &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len) ! - write(6,*) ' this is a dead start run, tsfc over land is', + write(6,*) ' this is a dead start run, tsfc over land is', & & ' set as lowest sigma level temperture if given.' write(6,*) ' if not, set to climatological tsf over land is used' ! @@ -4477,7 +4456,7 @@ subroutine bktges(smcfcs,slianl,stcfcs,len,lsoil) use machine , only : kind_io8,kind_io4 implicit none integer i,j,len,lsoil,k - real (kind=kind_io8) smcfcs(len,lsoil), stcfcs(len,lsoil), + real (kind=kind_io8) smcfcs(len,lsoil), stcfcs(len,lsoil), & & slianl(len) ! ! note that smfcs comes in with the original unit (cm?) (not grib file) @@ -4565,7 +4544,10 @@ subroutine tsfcor(tsfc,orog,slmask,umask,len,rlapse) enddo return end - subroutine snodpth(scvanl,slianl,tsfanl,snoclm, + +!>\ingroup mod_sfcsub +!! This subroutine uses surface temperature to get snow depth estimate. + subroutine snodpth(scvanl,slianl,tsfanl,snoclm, & & glacir,snwmax,snwmin,landice,len,snoanl, me) use machine , only : kind_io8,kind_io4 implicit none @@ -4573,7 +4555,7 @@ subroutine snodpth(scvanl,slianl,tsfanl,snoclm, logical, intent(in) :: landice real (kind=kind_io8) sno,snwmax,snwmin ! - real (kind=kind_io8) scvanl(len), slianl(len), tsfanl(len), + real (kind=kind_io8) scvanl(len), slianl(len), tsfanl(len), & & snoclm(len), snoanl(len), glacir(len) ! if (me .eq. 0) write(6,*) 'snodpth' @@ -4621,80 +4603,81 @@ subroutine snodpth(scvanl,slianl,tsfanl,snoclm, end subroutine snodpth !>\ingroup mod_sfcsub - subroutine merge(len,lsoil,iy,im,id,ih,fh,deltsfc, - & sihfcs,sicfcs, - & vmnfcs,vmxfcs,slpfcs,absfcs, - & tsffcs,wetfcs,snofcs,zorfcs,albfcs,aisfcs, - & cvfcs ,cvbfcs,cvtfcs, - & cnpfcs,smcfcs,stcfcs,slifcs,vegfcs, - & vetfcs,sotfcs,alffcs, - & sihanl,sicanl, - & vmnanl,vmxanl,slpanl,absanl, - & tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl,aisanl, - & cvanl ,cvbanl,cvtanl, - & cnpanl,smcanl,stcanl,slianl,veganl, - & vetanl,sotanl,alfanl, - & ctsfl,calbl,caisl,csnol,csmcl,czorl,cstcl,cvegl, - & ctsfs,calbs,caiss,csnos,csmcs,czors,cstcs,cvegs, - & ccv,ccvb,ccvt,ccnp,cvetl,cvets,csotl,csots, - & calfl,calfs, - & csihl,csihs,csicl,csics, - & cvmnl,cvmns,cvmxl,cvmxs,cslpl,cslps,cabsl,cabss, - & irttsf,irtwet,irtsno,irtzor,irtalb,irtais, - & irttg3,irtscv,irtacn,irtsmc,irtstc,irtveg, - & irtvmn,irtvmx,irtslp,irtabs, +!! This subroutine merges analysis and forecast. + subroutine merge(len,lsoil,iy,im,id,ih,fh,deltsfc, & + & sihfcs,sicfcs, & + & vmnfcs,vmxfcs,slpfcs,absfcs, & + & tsffcs,wetfcs,snofcs,zorfcs,albfcs,aisfcs, & + & cvfcs ,cvbfcs,cvtfcs, & + & cnpfcs,smcfcs,stcfcs,slifcs,vegfcs, & + & vetfcs,sotfcs,alffcs, & + & sihanl,sicanl, & + & vmnanl,vmxanl,slpanl,absanl, & + & tsfanl,tsfan2,wetanl,snoanl,zoranl,albanl,aisanl,& + & cvanl ,cvbanl,cvtanl, & + & cnpanl,smcanl,stcanl,slianl,veganl, & + & vetanl,sotanl,alfanl, & + & ctsfl,calbl,caisl,csnol,csmcl,czorl,cstcl,cvegl, & + & ctsfs,calbs,caiss,csnos,csmcs,czors,cstcs,cvegs, & + & ccv,ccvb,ccvt,ccnp,cvetl,cvets,csotl,csots, & + & calfl,calfs, & + & csihl,csihs,csicl,csics, & + & cvmnl,cvmns,cvmxl,cvmxs,cslpl,cslps,cabsl,cabss, & + & irttsf,irtwet,irtsno,irtzor,irtalb,irtais, & + & irttg3,irtscv,irtacn,irtsmc,irtstc,irtveg, & + & irtvmn,irtvmx,irtslp,irtabs, & & irtvet,irtsot,irtalf, landice, me) use machine , only : kind_io8,kind_io4 use sfccyc_module, only : veg_type_landice, soil_type_landice implicit none - integer k,i,im,id,iy,len,lsoil,ih,irtacn,irtsmc,irtscv,irtais, - & irttg3,irtstc,irtalf,me,irtsot,irtveg,irtvet, irtzor, - & irtalb,irtsno,irttsf,irtwet,j + integer k,i,im,id,iy,len,lsoil,ih,irtacn,irtsmc,irtscv,irtais, & + & irttg3,irtstc,irtalf,me,irtsot,irtveg,irtvet, irtzor, & + & irtalb,irtsno,irttsf,irtwet,j & &, irtvmn,irtvmx,irtslp,irtabs logical, intent(in) :: landice - real (kind=kind_io8) rvegs,rvets,rzors,raiss,rsnos,rsots,rcnp, - & rcvt,rcv,rcvb,rsnol,rzorl,raisl,ralbl, - & ralfl,rvegl,ralbs,ralfs,rtsfs,rvetl,rsotl, - & qzors,qvegs,qsnos,qalfs,qaiss,qvets,qcvt, - & qcnp,qcvb,qsots,qcv,qaisl,qsnol,qalfl, - & qtsfl,qalbl,qzorl,qtsfs,qalbs,qsotl,qvegl, - & qvetl,rtsfl,calbs,caiss,ctsfs,czorl,cvegl, - & csnos,ccvb,ccvt,ccv,czors,cvegs,caisl,csnol, - & calbl,fh,ctsfl,ccnp,csots,calfl,csotl,cvetl, - & cvets,calfs,deltsfc, - & csihl,csihs,csicl,csics, - & rsihl,rsihs,rsicl,rsics, - & qsihl,qsihs,qsicl,qsics - &, cvmnl,cvmns,cvmxl,cvmxs,cslpl,cslps - &, cabsl,cabss,rvmnl,rvmns,rvmxl,rvmxs - &, rslpl,rslps,rabsl,rabss,qvmnl,qvmns + real (kind=kind_io8) rvegs,rvets,rzors,raiss,rsnos,rsots,rcnp, & + & rcvt,rcv,rcvb,rsnol,rzorl,raisl,ralbl, & + & ralfl,rvegl,ralbs,ralfs,rtsfs,rvetl,rsotl, & + & qzors,qvegs,qsnos,qalfs,qaiss,qvets,qcvt, & + & qcnp,qcvb,qsots,qcv,qaisl,qsnol,qalfl, & + & qtsfl,qalbl,qzorl,qtsfs,qalbs,qsotl,qvegl, & + & qvetl,rtsfl,calbs,caiss,ctsfs,czorl,cvegl, & + & csnos,ccvb,ccvt,ccv,czors,cvegs,caisl,csnol, & + & calbl,fh,ctsfl,ccnp,csots,calfl,csotl,cvetl, & + & cvets,calfs,deltsfc, & + & csihl,csihs,csicl,csics, & + & rsihl,rsihs,rsicl,rsics, & + & qsihl,qsihs,qsicl,qsics & + &, cvmnl,cvmns,cvmxl,cvmxs,cslpl,cslps & + &, cabsl,cabss,rvmnl,rvmns,rvmxl,rvmxs & + &, rslpl,rslps,rabsl,rabss,qvmnl,qvmns & &, qvmxl,qvmxs,qslpl,qslps,qabsl,qabss ! - real (kind=kind_io8) tsffcs(len), wetfcs(len), snofcs(len), - & zorfcs(len), albfcs(len,4), aisfcs(len), - & cvfcs (len), cvbfcs(len), cvtfcs(len), - & cnpfcs(len), - & smcfcs(len,lsoil),stcfcs(len,lsoil), - & slifcs(len), vegfcs(len), - & vetfcs(len), sotfcs(len), alffcs(len,2) - &, sihfcs(len), sicfcs(len) + real (kind=kind_io8) tsffcs(len), wetfcs(len), snofcs(len), & + & zorfcs(len), albfcs(len,4), aisfcs(len), & + & cvfcs (len), cvbfcs(len), cvtfcs(len), & + & cnpfcs(len), & + & smcfcs(len,lsoil),stcfcs(len,lsoil), & + & slifcs(len), vegfcs(len), & + & vetfcs(len), sotfcs(len), alffcs(len,2) & + &, sihfcs(len), sicfcs(len) & &, vmnfcs(len),vmxfcs(len),slpfcs(len),absfcs(len) - real (kind=kind_io8) tsfanl(len),tsfan2(len), - & wetanl(len),snoanl(len), - & zoranl(len), albanl(len,4), aisanl(len), - & cvanl (len), cvbanl(len), cvtanl(len), - & cnpanl(len), - & smcanl(len,lsoil),stcanl(len,lsoil), - & slianl(len), veganl(len), - & vetanl(len), sotanl(len), alfanl(len,2) - &, sihanl(len),sicanl(len) + real (kind=kind_io8) tsfanl(len),tsfan2(len), & + & wetanl(len),snoanl(len), & + & zoranl(len), albanl(len,4), aisanl(len), & + & cvanl (len), cvbanl(len), cvtanl(len), & + & cnpanl(len), & + & smcanl(len,lsoil),stcanl(len,lsoil), & + & slianl(len), veganl(len), & + & vetanl(len), sotanl(len), alfanl(len,2) & + &, sihanl(len),sicanl(len) & &, vmnanl(len),vmxanl(len),slpanl(len),absanl(len) ! - real (kind=kind_io8) csmcl(lsoil), csmcs(lsoil), + real (kind=kind_io8) csmcl(lsoil), csmcs(lsoil), & & cstcl(lsoil), cstcs(lsoil) - real (kind=kind_io8) rsmcl(lsoil), rsmcs(lsoil), + real (kind=kind_io8) rsmcl(lsoil), rsmcs(lsoil), & & rstcl(lsoil), rstcs(lsoil) - real (kind=kind_io8) qsmcl(lsoil), qsmcs(lsoil), + real (kind=kind_io8) qsmcl(lsoil), qsmcs(lsoil), & & qstcl(lsoil), qstcs(lsoil) logical first integer num_threads @@ -5074,18 +5057,17 @@ subroutine merge(len,lsoil,iy,im,id,ih,fh,deltsfc, end subroutine merge !>\ingroup mod_sfcsub - subroutine newice(slianl,slifcs,tsfanl,tsffcs,len,lsoil, -!cwu [+1l] add sihnew,sicnew,sihanl,sicanl - & sihnew,sicnew,sihanl,sicanl, - & albanl,snoanl,zoranl,smcanl,stcanl, - & albsea,snosea,zorsea,smcsea,smcice, - & tsfmin,tsfice,albice,zorice,tgice, + subroutine newice(slianl,slifcs,tsfanl,tsffcs,len,lsoil, & + & sihnew,sicnew,sihanl,sicanl, & !cwu [+1l] add sihnew,sicnew,sihanl,sicanl + & albanl,snoanl,zoranl,smcanl,stcanl, & + & albsea,snosea,zorsea,smcsea,smcice, & + & tsfmin,tsfice,albice,zorice,tgice, & & rla,rlo,me) ! use machine , only : kind_io8,kind_io4 implicit none real (kind=kind_io8), parameter :: one=1.0 - real (kind=kind_io8) tgice,albice,zorice,tsfice,albsea,snosea, + real (kind=kind_io8) tgice,albice,zorice,tsfice,albsea,snosea, & & smcice,tsfmin,zorsea,smcsea !cwu [+1l] add sicnew,sihnew &, sicnew,sihnew @@ -5172,7 +5154,7 @@ subroutine newice(slianl,slifcs,tsfanl,tsffcs,len,lsoil, end !>\ingroup mod_sfcsub - subroutine qcsnow(snoanl,slmask,aisanl,glacir,len,snoval, + subroutine qcsnow(snoanl,slmask,aisanl,glacir,len,snoval, & & landice,me) use machine , only : kind_io8,kind_io4 implicit none @@ -5220,14 +5202,14 @@ subroutine qcsnow(snoanl,slmask,aisanl,glacir,len,snoval, end subroutine qcsnow !>\ingroup mod_sfcsub - subroutine qcsice(ais,glacir,amxice,aicice,aicsea,sllnd,slmask, + subroutine qcsice(ais,glacir,amxice,aicice,aicsea,sllnd,slmask, & & rla,rlo,len,me) use machine , only : kind_io8,kind_io4 implicit none integer kount1,kount,i,me,len real (kind=kind_io8) per,aicsea,aicice,sllnd ! - real (kind=kind_io8) ais(len), glacir(len), + real (kind=kind_io8) ais(len), glacir(len), & & amxice(len), slmask(len) real (kind=kind_io8) rla(len), rlo(len) ! @@ -5353,23 +5335,23 @@ subroutine scale(fld,len,scl) end !>\ingroup mod_sfcsub - subroutine qcmxmn(ttl,fld,slimsk,sno,iceflg, - & fldlmx,fldlmn,fldomx,fldomn,fldimx,fldimn, - & fldjmx,fldjmn,fldsmx,fldsmn,epsfld, + subroutine qcmxmn(ttl,fld,slimsk,sno,iceflg, & + & fldlmx,fldlmn,fldomx,fldomn,fldimx,fldimn, & + & fldjmx,fldjmn,fldsmx,fldsmn,epsfld, & & rla,rlo,len,mode,percrit,lgchek,me) ! use machine , only : kind_io8,kind_io4 implicit none - real (kind=kind_io8) permax,per,fldimx,fldimn,fldjmx,fldomn, - & fldlmx,fldlmn,fldomx,fldjmn,percrit, + real (kind=kind_io8) permax,per,fldimx,fldimn,fldjmx,fldomn, & + & fldlmx,fldlmn,fldomx,fldjmn,percrit, & & fldsmx,fldsmn,epsfld - integer kmaxi,kmini,kmaxj,kmino,kmaxl,kminl,kmaxo,mmprt,kminj, + integer kmaxi,kmini,kmaxj,kmino,kmaxl,kminl,kmaxo,mmprt,kminj, & & ij,nprt,kmaxs,kmins,i,me,len,mode parameter(mmprt=2) ! character*8 ttl logical iceflg(len) - real (kind=kind_io8) fld(len),slimsk(len),sno(len), + real (kind=kind_io8) fld(len),slimsk(len),sno(len), & & rla(len), rlo(len) integer iwk(len) logical lgchek @@ -5856,7 +5838,7 @@ subroutine getsmc(wetfld,len,lsoil,smcfld,me) end !>\ingroup mod_sfcsub - subroutine usesgt(sig1t,slianl,tg3anl,len,lsoil,tsfanl,stcanl, + subroutine usesgt(sig1t,slianl,tg3anl,len,lsoil,tsfanl,stcanl, & & tsfimx) ! use machine , only : kind_io8,kind_io4 @@ -6012,9 +5994,9 @@ subroutine qcsli(slianl,slifcs,len,me) ! end !>\ingroup mod_sfcsub - subroutine qcbyfc(tsffcs,snofcs,qctsfs,qcsnos,qctsfi, - & len,lsoil,snoanl,aisanl,slianl,tsfanl,albanl, - & zoranl,smcanl, + subroutine qcbyfc(tsffcs,snofcs,qctsfs,qcsnos,qctsfi, & + & len,lsoil,snoanl,aisanl,slianl,tsfanl,albanl, & + & zoranl,smcanl, & & smcclm,tsfsmx,albomx,zoromx, me) ! use machine , only : kind_io8,kind_io4 @@ -6110,8 +6092,8 @@ subroutine qcbyfc(tsffcs,snofcs,qctsfs,qcsnos,qctsfi, end !>\ingroup mod_sfcsub - subroutine setrmsk(kpds5,slmask,igaul,jgaul,wlon,rnlat, - & data,imax,jmax,rlnout,rltout,lmask,rslmsk + subroutine setrmsk(kpds5,slmask,igaul,jgaul,wlon,rnlat, & + & data,imax,jmax,rlnout,rltout,lmask,rslmsk & &, gaus,blno, blto, kgds1, kpds4, lbms) use machine , only : kind_io8,kind_io4 use sfccyc_module @@ -6586,25 +6568,26 @@ subroutine setrmsk(kpds5,slmask,igaul,jgaul,wlon,rnlat, end !>\ingroup mod_sfcsub - subroutine ga2la(gauin,imxin,jmxin,regout,imxout,jmxout, +!! This subroutine interpolates from lat/lon grid to other lat/lon grid. + subroutine ga2la(gauin,imxin,jmxin,regout,imxout,jmxout, & & wlon,rnlat,rlnout,rltout,gaus,blno, blto) use machine , only : kind_io8,kind_io4 implicit none - integer i1,i2,j2,ishft,i,jj,j1,jtem,jmxout,imxin,jmxin,imxout, + integer i1,i2,j2,ishft,i,jj,j1,jtem,jmxout,imxin,jmxin,imxout, & & j,iret - real (kind=kind_io8) alamd,dxin,aphi,x,sum1,sum2,y,dlati,wlon, - & rnlat,dxout,dphi,dlat,facns,tem,blno, + real (kind=kind_io8) alamd,dxin,aphi,x,sum1,sum2,y,dlati,wlon, & + & rnlat,dxout,dphi,dlat,facns,tem,blno, & & blto ! ! interpolation from lat/lon grid to other lat/lon grid ! - real (kind=kind_io8) gauin (imxin,jmxin), regout(imxout,jmxout) + real (kind=kind_io8) gauin (imxin,jmxin), regout(imxout,jmxout) & &, rlnout(imxout), rltout(jmxout) logical gaus ! real, allocatable :: gaul(:) real (kind=kind_io8) ddx(imxout),ddy(jmxout) - integer iindx1(imxout), iindx2(imxout), + integer iindx1(imxout), iindx2(imxout), & & jindx1(jmxout), jindx2(jmxout) integer jmxsav,n,kspla data jmxsav/0/ @@ -6838,8 +6821,8 @@ subroutine landtyp(vegtype,soiltype,slptype,slmask,len) use machine , only : kind_io8,kind_io4 implicit none integer i,len - real (kind=kind_io8) vegtype(len),soiltype(len),slmask(len) - +, slptype(len) + real (kind=kind_io8) vegtype(len),soiltype(len),slmask(len) & + &, slptype(len) ! ! make sure that the soil type and veg type are non-zero over land ! @@ -6852,8 +6835,9 @@ subroutine landtyp(vegtype,soiltype,slptype,slmask,len) enddo return -!>\ingroup mod_sfcsub end subroutine landtyp + +!>\ingroup mod_sfcsub subroutine gaulat(gaul,k) ! use machine , only : kind_io8,kind_io4 @@ -6886,7 +6870,7 @@ subroutine anomint(tsfan0,tsfclm,tsfcl0,tsfanl,len) use machine , only : kind_io8,kind_io4 implicit none integer i,len - real (kind=kind_io8) tsfanl(len), tsfan0(len), + real (kind=kind_io8) tsfanl(len), tsfan0(len), & & tsfclm(len), tsfcl0(len) ! ! time interpolation of anomalies @@ -6900,53 +6884,53 @@ subroutine anomint(tsfan0,tsfclm,tsfcl0,tsfanl,len) end !>\ingroup mod_sfcsub - subroutine clima(lugb,iy,im,id,ih,fh,len,lsoil, - & slmask,fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, - & fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,fnvegc, - & fnvetc,fnsotc, - & fnvmnc,fnvmxc,fnslpc,fnabsc, - & tsfclm,tsfcl2,wetclm,snoclm,zorclm,albclm,aisclm, - & tg3clm,cvclm ,cvbclm,cvtclm, - & cnpclm,smcclm,stcclm,sliclm,scvclm,acnclm,vegclm, - & vetclm,sotclm,alfclm, - & vmnclm,vmxclm,slpclm,absclm, - & kpdtsf,kpdwet,kpdsno,kpdzor,kpdalb,kpdais, - & kpdtg3,kpdscv,kpdacn,kpdsmc,kpdstc,kpdveg, - & kpdvet,kpdsot,kpdalf,tsfcl0, - & kpdvmn,kpdvmx,kpdslp,kpdabs, - & deltsfc, lanom - &, imsk, jmsk, slmskh, outlat, outlon - &, gaus, blno, blto, me,lprnt,iprnt, fnalbc2, ialb + subroutine clima(lugb,iy,im,id,ih,fh,len,lsoil, & + & slmask,fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc,& + & fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,fnvegc, & + & fnvetc,fnsotc, & + & fnvmnc,fnvmxc,fnslpc,fnabsc, & + & tsfclm,tsfcl2,wetclm,snoclm,zorclm,albclm,aisclm,& + & tg3clm,cvclm ,cvbclm,cvtclm, & + & cnpclm,smcclm,stcclm,sliclm,scvclm,acnclm,vegclm,& + & vetclm,sotclm,alfclm, & + & vmnclm,vmxclm,slpclm,absclm, & + & kpdtsf,kpdwet,kpdsno,kpdzor,kpdalb,kpdais, & + & kpdtg3,kpdscv,kpdacn,kpdsmc,kpdstc,kpdveg, & + & kpdvet,kpdsot,kpdalf,tsfcl0, & + & kpdvmn,kpdvmx,kpdslp,kpdabs, & + & deltsfc, lanom & + &, imsk, jmsk, slmskh, outlat, outlon & + &, gaus, blno, blto, me,lprnt,iprnt, fnalbc2, ialb & &, tile_num_ch, i_index, j_index) ! use machine , only : kind_io8,kind_io4 implicit none character(len=*), intent(in) :: tile_num_ch integer, intent(in) :: i_index(len), j_index(len) - real (kind=kind_io8) rjday,wei1x,wei2x,rjdayh,wei2m,wei1m,wei1s, + real (kind=kind_io8) rjday,wei1x,wei2x,rjdayh,wei2m,wei1m,wei1s, & & wei2s,fh,stcmon1s,blto,blno,deltsfc,rjdayh2 real (kind=kind_io8) wei1y,wei2y - integer jdoy,jday,jh,jdow,mmm,mmp,mm,iret,monend,i,k,jm,jd,iy4, - & jy,mon1,is2,isx,kpd9,is1,l,nn,mon2,mon,is,kpdsno, - & kpdzor,kpdtsf,kpdwet,kpdscv,kpdacn,kpdais,kpdtg3,im,id, - & lugb,iy,len,lsoil,ih,kpdsmc,iprnt,me,m1,m2,k1,k2, - & kpdvet,kpdsot,kpdstc,kpdveg,jmsk,imsk,j,ialb + integer jdoy,jday,jh,jdow,mmm,mmp,mm,iret,monend,i,k,jm,jd,iy4, & + & jy,mon1,is2,isx,kpd9,is1,l,nn,mon2,mon,is,kpdsno, & + & kpdzor,kpdtsf,kpdwet,kpdscv,kpdacn,kpdais,kpdtg3,im,id, & + & lugb,iy,len,lsoil,ih,kpdsmc,iprnt,me,m1,m2,k1,k2, & + & kpdvet,kpdsot,kpdstc,kpdveg,jmsk,imsk,j,ialb & &, kpdvmn,kpdvmx,kpdslp,kpdabs,landice_cat integer kpdalb(4), kpdalf(2) ! - character*500 fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, - & fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,fnvegc, - & fnvetc,fnsotc,fnalbc2 + character*500 fntsfc,fnwetc,fnsnoc,fnzorc,fnalbc,fnaisc, & + & fntg3c,fnscvc,fnsmcc,fnstcc,fnacnc,fnvegc, & + & fnvetc,fnsotc,fnalbc2 & &, fnvmnc,fnvmxc,fnslpc,fnabsc - real (kind=kind_io8) tsfclm(len),tsfcl2(len), - & wetclm(len),snoclm(len), - & zorclm(len),albclm(len,4),aisclm(len), - & tg3clm(len),acnclm(len), - & cvclm (len),cvbclm(len),cvtclm(len), - & cnpclm(len), - & smcclm(len,lsoil),stcclm(len,lsoil), - & sliclm(len),scvclm(len),vegclm(len), - & vetclm(len),sotclm(len),alfclm(len,2) + real (kind=kind_io8) tsfclm(len),tsfcl2(len), & + & wetclm(len),snoclm(len), & + & zorclm(len),albclm(len,4),aisclm(len), & + & tg3clm(len),acnclm(len), & + & cvclm (len),cvbclm(len),cvtclm(len), & + & cnpclm(len), & + & smcclm(len,lsoil),stcclm(len,lsoil), & + & sliclm(len),scvclm(len),vegclm(len), & + & vetclm(len),sotclm(len),alfclm(len,2) & &, vmnclm(len),vmxclm(len),slpclm(len),absclm(len) real (kind=kind_io8) slmskh(imsk,jmsk) real (kind=kind_io8) outlat(len), outlon(len) @@ -8068,8 +8052,8 @@ subroutine clima(lugb,iy,im,id,ih,fh,len,lsoil, end subroutine clima !>\ingroup mod_sfcsub - subroutine fixrdc_tile(filename_raw, tile_num_ch, - & i_index, j_index, kpds, + subroutine fixrdc_tile(filename_raw, tile_num_ch, & + & i_index, j_index, kpds, & & var, mon, npts, me) use netcdf use machine , only : kind_io8 @@ -8222,22 +8206,21 @@ subroutine netcdf_err(error) end subroutine netcdf_err !>\ingroup mod_sfcsub - subroutine fixrdc(lugb,fngrib,kpds5,kpds7,mon,slmask, - & gdata,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto +!! reads in grib climatology files and interpolate to the input +!! grid. grib files should allow all the necessary parameters +!! to be extracted from the description records. + subroutine fixrdc(lugb,fngrib,kpds5,kpds7,mon,slmask, & + & gdata,len,iret & + &, imsk, jmsk, slmskh, gaus,blno, blto & &, outlat, outlon, me) use machine , only : kind_io8,kind_io4 use sfccyc_module, only : mdata implicit none - integer imax,jmax,ijmax,i,j,n,jret,inttyp,iret,imsk, - & jmsk,len,lugb,kpds5,mon,lskip,lgrib,ndata,lugi,me,kmami + integer imax,jmax,ijmax,i,j,n,jret,inttyp,iret,imsk, & + & jmsk,len,lugb,kpds5,mon,lskip,lgrib,ndata,lugi,me,kmami & &, jj,w3kindreal,w3kindint real (kind=kind_io8) wlon,elon,rnlat,dlat,dlon,rslat,blno,blto ! -! read in grib climatology files and interpolate to the input -! grid. grib files should allow all the necessary parameters -! to be extracted from the description records. -! ! character*500 fngrib ! character*80 fngrib, asgnstr @@ -8400,18 +8383,18 @@ subroutine fixrdc(lugb,fngrib,kpds5,kpds7,mon,slmask, end subroutine fixrdc !>\ingroup mod_sfcsub - subroutine fixrda(lugb,fngrib,kpds5,slmask, - & iy,im,id,ih,fh,gdata,len,iret - &, imsk, jmsk, slmskh, gaus,blno, blto + subroutine fixrda(lugb,fngrib,kpds5,slmask, & + & iy,im,id,ih,fh,gdata,len,iret & + &, imsk, jmsk, slmskh, gaus,blno, blto & &, outlat, outlon, me) use machine , only : kind_io8,kind_io4 use sfccyc_module, only : mdata implicit none - integer nrepmx,nvalid,imo,iyr,idy,jret,ihr,nrept,lskip,lugi, - & lgrib,j,ndata,i,inttyp,jmax,imax,ijmax,ij,jday,len,iret, - & jmsk,imsk,ih,kpds5,lugb,iy,id,im,jh,jd,jdoy,jdow,jm,me, - & monend,jy,iy4,kmami,iret2,jj,w3kindreal,w3kindint - real (kind=kind_io8) rnlat,rslat,wlon,elon,dlon,dlat,fh,blno, + integer nrepmx,nvalid,imo,iyr,idy,jret,ihr,nrept,lskip,lugi, & + & lgrib,j,ndata,i,inttyp,jmax,imax,ijmax,ij,jday,len,iret, & + & jmsk,imsk,ih,kpds5,lugb,iy,id,im,jh,jd,jdoy,jdow,jm,me, & + & monend,jy,iy4,kmami,iret2,jj,w3kindreal,w3kindint + real (kind=kind_io8) rnlat,rslat,wlon,elon,dlon,dlat,fh,blno, & & rjday,blto ! ! read in grib climatology/analysis files and interpolate to the input From 845a725d6ad6f42627a7086af3ee5d76e464bf9d Mon Sep 17 00:00:00 2001 From: climbfuji Date: Tue, 25 Jun 2019 08:13:16 -0600 Subject: [PATCH 16/89] Bugfix: correct suffix of file gfs_phy_tracer_config.f->F --- physics/{gfs_phy_tracer_config.f => gfs_phy_tracer_config.F} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename physics/{gfs_phy_tracer_config.f => gfs_phy_tracer_config.F} (100%) diff --git a/physics/gfs_phy_tracer_config.f b/physics/gfs_phy_tracer_config.F similarity index 100% rename from physics/gfs_phy_tracer_config.f rename to physics/gfs_phy_tracer_config.F From 8fa2d4f7da2b074fb9e3f9d6399ede867f4598c9 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Tue, 25 Jun 2019 21:28:11 -0600 Subject: [PATCH 17/89] gfsphysics/physics/GFS_debug.F90: comment out Diag%fluxr components, not required for b4b (purely diagnostic and not in output) --- physics/GFS_debug.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 index 9ed719d76..c4295871f 100644 --- a/physics/GFS_debug.F90 +++ b/physics/GFS_debug.F90 @@ -260,10 +260,10 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, call print_var(mpirank,omprank, blkno, 'Tbd%ccn_nm' , Tbd%ccn_nm) call print_var(mpirank,omprank, blkno, 'Tbd%aer_nm' , Tbd%aer_nm) ! Diag - call print_var(mpirank,omprank, blkno, 'Diag%fluxr ', Diag%fluxr) - do n=1,size(Diag%fluxr(1,:)) - call print_var(mpirank,omprank, blkno, 'Diag%fluxr_n ', Diag%fluxr(:,n)) - end do + !call print_var(mpirank,omprank, blkno, 'Diag%fluxr ', Diag%fluxr) + !do n=1,size(Diag%fluxr(1,:)) + ! call print_var(mpirank,omprank, blkno, 'Diag%fluxr_n ', Diag%fluxr(:,n)) + !end do call print_var(mpirank,omprank, blkno, 'Diag%srunoff ', Diag%srunoff) call print_var(mpirank,omprank, blkno, 'Diag%evbsa ', Diag%evbsa) call print_var(mpirank,omprank, blkno, 'Diag%evcwa ', Diag%evcwa) From 2d16bbdec8ee2e13de26a0d5af1ad62ec4c2b0c7 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Tue, 25 Jun 2019 21:29:44 -0600 Subject: [PATCH 18/89] physics/GFS_rrtmg_pre.F90: replace hard-coded indices with correct index variables for cloud effective radii --- physics/GFS_rrtmg_pre.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index 0c7dc14a0..90ac0134e 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -71,7 +71,7 @@ end subroutine GFS_rrtmg_pre_init !! | cldsa | cloud_area_fraction_for_radiation | fraction of clouds for low, middle,high, total and BL | frac | 2 | real | kind_phys | out | F | !! | mtopa | model_layer_number_at_cloud_top | vertical indices for low, middle and high cloud tops | index | 2 | integer | | out | F | !! | mbota | model_layer_number_at_cloud_base | vertical indices for low, middle and high cloud bases | index | 2 | integer | | out | F | -!! | de_lgth | cloud_decorrelation_length | cloud decorrelation length | km | 1 | real | kind_phys | out | F | +!! | de_lgth | cloud_decorrelation_length | cloud decorrelation length | km | 1 | real | kind_phys | out | F | !! | alb1d | surface_albedo_perturbation | surface albedo perturbation | frac | 1 | real | kind_phys | out | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | @@ -800,9 +800,9 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input elseif(Model%imp_physics == 8 .or. Model%imp_physics == 6) then ! Thompson / WSM6 cloud micrphysics scheme if (Model%kdt == 1) then - Tbd%phy_f3d(:,:,1) = 10. - Tbd%phy_f3d(:,:,2) = 50. - Tbd%phy_f3d(:,:,3) = 250. + Tbd%phy_f3d(:,:,Model%nleffr) = 10. + Tbd%phy_f3d(:,:,Model%nieffr) = 50. + Tbd%phy_f3d(:,:,Model%nseffr) = 250. endif call progcld5 (plyr,plvl,tlyr,qlyr,qstl,rhly,tracer1, & ! --- inputs From afb2c4f9a8905518759565e61735a67228955456 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Tue, 25 Jun 2019 21:30:19 -0600 Subject: [PATCH 19/89] physics/mp_thompson.F90: set correct intent for cloud effective radii --- physics/mp_thompson.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index e87847f95..9fdd43bad 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -183,9 +183,9 @@ end subroutine mp_thompson_init !! | sr | ratio_of_snowfall_to_rainfall | ratio of snowfall to large-scale rainfall | frac | 1 | real | kind_phys | out | F | !! | refl_10cm | radar_reflectivity_10cm | instantaneous refl_10cm | dBZ | 2 | real | kind_phys | out | F | !! | do_radar_ref | flag_for_radar_reflectivity | flag for radar reflectivity | flag | 0 | logical | | in | F | -!! | re_cloud | effective_radius_of_stratiform_cloud_liquid_water_particle_in_um | eff. radius of cloud liquid water particle in micrometer | um | 2 | real | kind_phys | none | F | -!! | re_ice | effective_radius_of_stratiform_cloud_ice_particle_in_um | eff. radius of cloud ice water particle in micrometer | um | 2 | real | kind_phys | none | F | -!! | re_snow | effective_radius_of_stratiform_cloud_snow_particle_in_um | effective radius of cloud snow particle in micrometers | um | 2 | real | kind_phys | none | F | +!! | re_cloud | effective_radius_of_stratiform_cloud_liquid_water_particle_in_um | eff. radius of cloud liquid water particle in micrometer | um | 2 | real | kind_phys | out | F | +!! | re_ice | effective_radius_of_stratiform_cloud_ice_particle_in_um | eff. radius of cloud ice water particle in micrometer | um | 2 | real | kind_phys | out | F | +!! | re_snow | effective_radius_of_stratiform_cloud_snow_particle_in_um | effective radius of cloud snow particle in micrometers | um | 2 | real | kind_phys | out | F | !! | mpicomm | mpi_comm | MPI communicator | index | 0 | integer | | in | F | !! | mpirank | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | !! | mpiroot | mpi_root | master MPI-rank | index | 0 | integer | | in | F | From 1a17ef9a7980293c83e875edba7a94f13bc56ddb Mon Sep 17 00:00:00 2001 From: climbfuji Date: Tue, 25 Jun 2019 21:32:35 -0600 Subject: [PATCH 20/89] Update standard (Noah LSM) soil variables for physics that require these variables (e.g. sfc_sice), independent of whether it is a land point or not --- physics/sfc_drv_ruc.F90 | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index 0dd2cf286..3b0e64637 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -1069,12 +1069,6 @@ subroutine lsm_ruc_run & ! --- inpu smfrkeep(i,k) = smfrsoil(i,k,j) enddo - !do k = 1, lsoil - ! smc(i,k) = smsoil(i,k,j) - ! slc(i,k) = slsoil(i,k,j) - ! stc(i,k) = stsoil(i,k,j) - !enddo - ! --- ... do not return the following output fields to parent model ! ec - canopy water evaporation (m s-1) ! edir - direct soil evaporation (m s-1) @@ -1139,6 +1133,17 @@ subroutine lsm_ruc_run & ! --- inpu deallocate(soilctop) deallocate(landusef) ! + ! Update standard (Noah LSM) soil variables for physics + ! that require these variables (e.g. sfc_sice), independent + ! of whether it is a land point or not + do i = 1, im + do k = 1, lsoil + smc(i,k) = smois(i,k) + slc(i,k) = sh2o(i,k) + stc(i,k) = tslb(i,k) + enddo + enddo + return !................................... end subroutine lsm_ruc_run From 480670c90a0aaa22f833d6c280caf0a639301551 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Thu, 27 Jun 2019 10:57:00 -0600 Subject: [PATCH 21/89] Cleanup work: remove comments and notes as checked, remove hard-coded dimension extents for d?3dt fields, add notes on future cleanup work --- physics/GFS_DCNV_generic.F90 | 6 +++--- physics/GFS_MP_generic.F90 | 5 +++-- physics/GFS_PBL_generic.F90 | 3 +-- physics/GFS_suite_interstitial.F90 | 3 ++- physics/cu_gf_driver.F90 | 2 +- physics/gfdl_fv_sat_adj.F90 | 1 - physics/gwdps.f | 3 ++- physics/maximum_hourly_diagnostics.F90 | 2 +- physics/module_mp_thompson.F90 | 2 -- physics/mp_thompson_post.F90 | 25 +------------------------ physics/multi_gases.F90 | 2 +- physics/physcons.F90 | 4 ++-- physics/radcons.f90 | 1 - physics/samfshalcnv.f | 3 +-- 14 files changed, 18 insertions(+), 44 deletions(-) diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 index 0784e921f..c99c8d04b 100644 --- a/physics/GFS_DCNV_generic.F90 +++ b/physics/GFS_DCNV_generic.F90 @@ -155,7 +155,7 @@ end subroutine GFS_DCNV_generic_post_finalize !! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | inout | F | !! | cnvw_phy_f3d | convective_cloud_water_mixing_ratio_in_phy_f3d | convective cloud water mixing ratio in the phy_f3d array | kg kg-1 | 2 | real | kind_phys | inout | F | !! | cnvc_phy_f3d | convective_cloud_cover_in_phy_f3d | convective cloud cover in the phy_f3d array | frac | 2 | real | kind_phys | inout | F | -!! | cape | convective_available_potential_energy_for_coupling | convective available potential energy for coupling DH* CHECK THIS DOESN'T MAKE SENSE!!! *DH | m2 s-2 | 1 | real | kind_phys | inout | F | +!! | cape | convective_available_potential_energy_for_coupling | convective available potential energy for coupling | m2 s-2 | 1 | real | kind_phys | inout | F | !! | tconvtend | tendency_of_air_temperature_due_to_deep_convection_for_coupling_on_physics_timestep | tendency of air temperature due to deep convection | K | 2 | real | kind_phys | inout | F | !! | qconvtend | tendency_of_water_vapor_specific_humidity_due_to_deep_convection_for_coupling_on_physics_timestep | tendency of specific humidity due to deep convection | kg kg-1 | 2 | real | kind_phys | inout | F | !! | uconvtend | tendency_of_x_wind_due_to_deep_convection_for_coupling_on_physics_timestep | tendency_of_x_wind_due_to_deep_convection | m s-1 | 2 | real | kind_phys | inout | F | @@ -194,12 +194,12 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, lgocart, ras, cs ! dqdti, cnvqci, upd_mfi, dwn_mfi, det_mfi only allocated if ldiag3d == .true. or lgocart == .true. real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti, cnvqci, upd_mfi, dwn_mfi, det_mfi real(kind=kind_phys), dimension(im,levs), intent(inout) :: cnvw, cnvc - ! DH* The following arrays may not be allocated, depending on certain flags and microphysics schemes. + ! The following arrays may not be allocated, depending on certain flags and microphysics schemes. ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, ! use assumed-shape arrays. Note that Intel 18 and GNU 6.2.0-8.1.0 tolerate explicit-shape arrays ! as long as these do not get used when not allocated (it is still invalid Fortran code, though). real(kind=kind_phys), dimension(:,:), intent(inout) :: cnvw_phy_f3d, cnvc_phy_f3d - ! *DH + real(kind=kind_phys), dimension(im), intent(inout) :: cape real(kind=kind_phys), dimension(im,levs), intent(inout) :: tconvtend, qconvtend, uconvtend, vconvtend diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 8021f0801..fd7c96c7a 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -206,7 +206,8 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt srflag, cnvprcp, totprcp, totice, totsnw, totgrp, cnvprcpb, & totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, & snow_cpl, pwat - real(kind=kind_phys), dimension(im,levs), intent(inout) :: dt3dt, dq3dt + ! These arrays are only allocated if ldiag3d is .true. + real(kind=kind_phys), dimension(:,:), intent(inout) :: dt3dt, dq3dt ! Stochastic physics / surface perturbations logical, intent(in) :: do_sppt @@ -259,7 +260,7 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt ! put ice, snow, graupel on dynamics timestep. The way the code in ! GFS_physics_driver is written, Diag%{graupel,ice,snow} are on the ! physics timestep, while Diag%{rain,rainc} and all totprecip etc - ! are on the dynamics timestep. Totally confusing and wrong. *DH + ! are on the dynamics timestep. Confusing, but works if frain=1. *DH if (imp_physics == imp_physics_gfdl) then tprcp = max(0., rain) ! clu: rain -> tprcp !graupel = frain*graupel0 diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index 127de28e4..13b33d43e 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -320,14 +320,13 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, real(kind=kind_phys), dimension(im, levs, ntrac), intent(inout) :: dqdt - ! DH* The following arrays may not be allocated, depending on certain flags (cplflx, ...). + ! The following arrays may not be allocated, depending on certain flags (cplflx, ...). ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, ! use assumed-shape arrays. Note that Intel 18 and GNU 6.2.0-8.1.0 tolerate explicit-shape arrays ! as long as these do not get used when not allocated. real(kind=kind_phys), dimension(:,:), intent(inout) :: dt3dt, du3dt_PBL, du3dt_OGWD, dv3dt_PBL, dv3dt_OGWD, dq3dt, dq3dt_ozone real(kind=kind_phys), dimension(:), intent(inout) :: dusfc_cpl, dvsfc_cpl, dtsfc_cpl, dqsfc_cpl, dusfci_cpl, dvsfci_cpl, & dtsfci_cpl, dqsfci_cpl, dusfc_diag, dvsfc_diag, dtsfc_diag, dqsfc_diag, dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag - ! *DH character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 262454f15..ac3b7ad2f 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -262,7 +262,8 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplfl integer, intent(inout), dimension(im) :: kinver real(kind=kind_phys), intent(inout), dimension(im) :: suntim, dlwsfc, ulwsfc, psmean, adjsfculw, ctei_rml, ctei_r - real(kind=kind_phys), intent(inout), dimension(im, levs) :: dt3dt_lw, dt3dt_sw, dt3dt_pbl, dt3dt_dcnv, dt3dt_scnv, dt3dt_mp + ! These arrays are only allocated if ldiag3d is .true. + real(kind=kind_phys), intent(inout), dimension(:,:) :: dt3dt_lw, dt3dt_sw, dt3dt_pbl, dt3dt_dcnv, dt3dt_scnv, dt3dt_mp character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 30fe5b8f5..be084097f 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -315,7 +315,7 @@ subroutine cu_gf_driver_run(tottracer,ntrac,garea,im,ix,km,dt,cactiv, & dd_mf =0. dt_mf =0. tau_ecmwf(:)=0. -! +! j=1 ht(:)=phil(:,1)/g do i=its,ite diff --git a/physics/gfdl_fv_sat_adj.F90 b/physics/gfdl_fv_sat_adj.F90 index b4b273595..bfa3fd7c7 100644 --- a/physics/gfdl_fv_sat_adj.F90 +++ b/physics/gfdl_fv_sat_adj.F90 @@ -53,7 +53,6 @@ module fv_sat_adj !
    ! DH* TODO - MAKE THIS INPUT ARGUMENTS *DH - !use constants_mod, only: rvgas, rdgas, grav, hlv, hlf, cp_air use physcons, only : rdgas => con_rd_dyn, & rvgas => con_rv_dyn, & grav => con_g_dyn, & diff --git a/physics/gwdps.f b/physics/gwdps.f index 8784a2f6d..5e47a6b24 100644 --- a/physics/gwdps.f +++ b/physics/gwdps.f @@ -57,7 +57,8 @@ subroutine gwdps_pre_run( & logical, intent(in) :: lssav, ldiag3d real(kind=kind_phys), intent(in) :: dtdt(im,levs) - real(kind=kind_phys), intent(inout) :: dt3dt(im,levs) + ! dt3dt only allocated only if ldiag3d is .true. + real(kind=kind_phys), intent(inout) :: dt3dt(:,:) real(kind=kind_phys), intent(in) :: dtf character(len=*), intent(out) :: errmsg diff --git a/physics/maximum_hourly_diagnostics.F90 b/physics/maximum_hourly_diagnostics.F90 index 62c68c937..4e739e463 100644 --- a/physics/maximum_hourly_diagnostics.F90 +++ b/physics/maximum_hourly_diagnostics.F90 @@ -8,7 +8,7 @@ module maximum_hourly_diagnostics public maximum_hourly_diagnostics_init, maximum_hourly_diagnostics_run, maximum_hourly_diagnostics_finalize - ! DH* TODO - THIS CAME FROM PHYSCONS.F90 BUT IS IT BETTER PLACED IN HERE? + ! DH* TODO - cleanup use of constants real(kind=kind_phys), parameter ::PQ0=379.90516E0, A2A=17.2693882, A3=273.16, A4=35.86, RHmin=1.0E-6 ! *DH diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index f958ab5e8..8e2340ade 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -1486,11 +1486,9 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & rainprod, evapprod, & #endif kts, kte, dt, ii, jj) - ! DH* #ifdef MPI use mpi #endif - ! *DH implicit none !..Sub arguments diff --git a/physics/mp_thompson_post.F90 b/physics/mp_thompson_post.F90 index 67cbc5790..1b683f602 100644 --- a/physics/mp_thompson_post.F90 +++ b/physics/mp_thompson_post.F90 @@ -21,20 +21,17 @@ module mp_thompson_post !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |-----------------|-------------------------------------------------------|----------------------------------------------------------|------------|------|-----------|-----------|--------|----------| !! | ncol | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | area | cell_area | area of the grid cell | m2 | 1 | real | kind_phys | in | F | !! | ttendlim | limit_for_temperature_tendency_for_microphysics | temperature tendency limiter per physics time step | K s-1 | 0 | real | kind_phys | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! #endif - subroutine mp_thompson_post_init(ncol, area, ttendlim, errmsg, errflg) + subroutine mp_thompson_post_init(ncol, ttendlim, errmsg, errflg) implicit none ! Interface variables integer, intent(in) :: ncol - ! DH* TODO: remove area and dx (also from metadata table) - real(kind_phys), dimension(1:ncol), intent(in) :: area real(kind_phys), intent(in) :: ttendlim ! CCPP error handling @@ -42,7 +39,6 @@ subroutine mp_thompson_post_init(ncol, area, ttendlim, errmsg, errflg) integer, intent( out) :: errflg ! Local variables - !real(kind_phys), dimension(1:ncol) :: dx integer :: i ! Initialize the CCPP error handling variables @@ -60,26 +56,7 @@ subroutine mp_thompson_post_init(ncol, area, ttendlim, errmsg, errflg) allocate(mp_tend_lim(1:ncol)) - !! Cell size in m as square root of cell area - !dx = sqrt(area) - do i=1,ncol - ! The column-dependent values that were set here previously - ! are replaced with a single value set in the namelist - ! input.nml.This value is independent of the grid spacing - ! (as opposed to setting it here on a per-column basis). - ! However, given that the timestep is the same for all grid - ! columns and determined by the smallest grid spacing in - ! the domain, it makes sense to use a single value. - ! - ! The values previously used in RAP/HRRR were - ! mp_tend_lim(i) = 0.07 ! [K/s], 3-km HRRR value - ! and - ! mp_tend_lim(i) = 0.002 ! [K/s], 13-km RAP value - ! - ! Our testing with FV3 has shown thus far that 0.002 is - ! too small for a 13km (C768) resolution and that 0.01 - ! works better. This is work in progress ... mp_tend_lim(i) = ttendlim end do diff --git a/physics/multi_gases.F90 b/physics/multi_gases.F90 index 1e62c89a1..c660b7dfb 100644 --- a/physics/multi_gases.F90 +++ b/physics/multi_gases.F90 @@ -36,7 +36,7 @@ module ccpp_multi_gases_mod !
    use machine, only: kind_dyn - ! DH* TODO - MAKE THIS INPUT ARGUMENTS *DH + ! DH* TODO - MAKE THIS INPUT ARGUMENTS use physcons, only : rdgas => con_rd_dyn, & cp_air => con_cp_dyn ! *DH diff --git a/physics/physcons.F90 b/physics/physcons.F90 index 0a95bc679..059071ee1 100644 --- a/physics/physcons.F90 +++ b/physics/physcons.F90 @@ -56,7 +56,7 @@ module physcons real(kind=kind_phys),parameter:: con_solr_old =1.3660e+3_kind_phys !< solar constant (\f$W/m^{2}\f$)-Liu(2002) real(kind=kind_phys),parameter:: con_solr =1.3608e+3_kind_phys !< solar constant (\f$W/m^{2}\f$)-nasa-sorce Tim(2008) ! real(kind=kind_phys),parameter:: con_solr =1.36742732e+3_kind_phys ! solar constant (W/m2)-gfdl(1989) - OPR as of Jan 2006 - ! Selected geophysics/astronomy constants with kind=kind_dyn DH* CHECK IF THIS BREAKS B4B AND IF SO REMOVE _kind_dyn + ! Selected geophysics/astronomy constants with kind=kind_dyn real(kind=kind_dyn), parameter:: con_g_dyn =9.80665e+0_kind_dyn !< gravity (\f$m/s^{2}\f$) !> \name Thermodynamics constants @@ -79,7 +79,7 @@ module physcons real(kind=kind_phys),parameter:: con_jcal =4.1855E+0_kind_phys !< joules per calorie real(kind=kind_phys),parameter:: con_rhw0 =1022.0_kind_phys !< sea water reference density (\f$kg/m^{3}\f$) real(kind=kind_phys),parameter:: con_epsq =1.0E-12_kind_phys !< min q for computing precip type - ! Selected thermodynamics constants with kind=kind_dyn DH* CHECK IF THIS BREAKS B4B AND IF SO REMOVE _kind_dyn + ! Selected thermodynamics constants with kind=kind_dyn real(kind=kind_dyn), parameter:: con_rd_dyn =2.8705e+2_kind_dyn !< gas constant air (\f$J/kg/K\f$) real(kind=kind_dyn), parameter:: con_rv_dyn =4.6150e+2_kind_dyn !< gas constant H2O (\f$J/kg/K\f$) real(kind=kind_dyn), parameter:: con_cp_dyn =1.0046e+3_kind_dyn !< spec heat air at p (\f$J/kg/K\f$) diff --git a/physics/radcons.f90 b/physics/radcons.f90 index da90bcb74..b767d2192 100644 --- a/physics/radcons.f90 +++ b/physics/radcons.f90 @@ -60,7 +60,6 @@ module radcons !---------------------------- ! Module variable definitions !---------------------------- -! DH* CHECK IF THIS IS NEEDED/TRUE? !CCPP: copy from GFS_driver.F90 real(kind=kind_phys), parameter :: con_24 = 24.0_kind_phys real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys diff --git a/physics/samfshalcnv.f b/physics/samfshalcnv.f index 183467d4b..1600244ea 100644 --- a/physics/samfshalcnv.f +++ b/physics/samfshalcnv.f @@ -1869,13 +1869,12 @@ subroutine samfshalcnv_post_run (im, levs, lssav, shcnvcw, frain, real(kind=kind_phys), dimension(im), intent(inout) :: rainc, & cnvprcp, cnvprcpb - ! DH* The following arrays may not be allocated, depending on certain flags and microphysics schemes. + ! The following arrays may not be allocated, depending on certain flags and microphysics schemes. ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, ! use assumed-shape arrays. Note that Intel 18 and GNU 6.2.0-8.1.0 tolerate explicit-shape arrays ! as long as these do not get used when not allocated. real(kind=kind_phys), dimension(:,:), intent(inout) :: & cnvw_phy_f3d, cnvc_phy_f3d - ! *DH character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg From b170021b7ece53d6bcdc1a092faa36f9f6f019af Mon Sep 17 00:00:00 2001 From: "Man.Zhang" Date: Thu, 27 Jun 2019 14:01:55 -0600 Subject: [PATCH 22/89] minor format changes --- physics/sfcsub.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/sfcsub.F b/physics/sfcsub.F index 391256ce0..7039884f8 100644 --- a/physics/sfcsub.F +++ b/physics/sfcsub.F @@ -6821,7 +6821,7 @@ subroutine landtyp(vegtype,soiltype,slptype,slmask,len) use machine , only : kind_io8,kind_io4 implicit none integer i,len - real (kind=kind_io8) vegtype(len),soiltype(len),slmask(len) & + real (kind=kind_io8) vegtype(len),soiltype(len),slmask(len) & &, slptype(len) ! ! make sure that the soil type and veg type are non-zero over land From c015a4ea5e28c8e6b95ae1c9ffb57075eaf3d395 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Thu, 27 Jun 2019 22:37:45 -0600 Subject: [PATCH 23/89] physics/gfdl_cloud_microphys.F90: update metadata --- physics/gfdl_cloud_microphys.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/gfdl_cloud_microphys.F90 b/physics/gfdl_cloud_microphys.F90 index 8e6f645ca..903175572 100644 --- a/physics/gfdl_cloud_microphys.F90 +++ b/physics/gfdl_cloud_microphys.F90 @@ -160,7 +160,7 @@ end subroutine gfdl_cloud_microphys_finalize !! | lradar | flag_for_radar_reflectivity | flag for radar reflectivity | flag | 0 | logical | | in | F | !! | refl_10cm | radar_reflectivity_10cm | instantaneous refl_10cm | dBZ | 2 | real | kind_phys | inout | F | !! | reset | flag_reset_maximum_hourly_fields | flag for resetting maximum hourly fields | flag | 0 | logical | | in | F | -!! | effr_in | flag_for_cloud_effective_radii | flag for cloud effective radii calculations in microphysics | | 0 | logical | | in | F | +!! | effr_in | flag_for_cloud_effective_radii | flag for cloud effective radii calculations in GFDL microphysics | | 0 | logical | | in | F | !! | rew | effective_radius_of_stratiform_cloud_liquid_water_particle_in_um | eff. radius of cloud liquid water particle in micrometer | um | 2 | real | kind_phys | inout | F | !! | rei | effective_radius_of_stratiform_cloud_ice_particle_in_um | eff. radius of cloud ice water particle in micrometer | um | 2 | real | kind_phys | inout | F | !! | rer | effective_radius_of_stratiform_cloud_rain_particle_in_um | effective radius of cloud rain particle in micrometers | um | 2 | real | kind_phys | inout | F | From 1e9d51a84a13fa175d3a7ff1ce86c9a255b07701 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Thu, 27 Jun 2019 22:38:13 -0600 Subject: [PATCH 24/89] physics/sfc_drv_ruc.F90: update metadata and rename wet1 to wetness --- physics/sfc_drv_ruc.F90 | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index 3b0e64637..77833671f 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -134,7 +134,7 @@ end subroutine lsm_ruc_finalize ! sbsno - real, sublimation/deposit from snopack (m/s) im ! ! stm - real, total soil column moisture content (m) im ! ! zorl - real, surface roughness im ! -! wet1 - real, normalized soil wetness im ! +! wetness - real, normalized soil wetness im ! ! ! ! ==================== end of description ===================== ! @@ -193,7 +193,7 @@ end subroutine lsm_ruc_finalize !! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_land | surface exchange coeff heat & moisture over land | none | 1 | real | kind_phys | in | F | !! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land | thermal exchange coefficient over land | kg m-2 s-1 | 1 | real | kind_phys | inout | F | !! | cmm | surface_drag_wind_speed_for_momentum_in_air_over_land | momentum exchange coefficient over land | m s-1 | 1 | real | kind_phys | inout | F | -!! | wet1 | normalized_soil_wetness | normalized soil wetness | frac | 1 | real | kind_phys | inout | F | +!! | wetness | normalized_soil_wetness_for_land_surface_model | normalized soil wetness | frac | 1 | real | kind_phys | inout | F | !! | canopy | canopy_water_amount | canopy water amount | kg m-2 | 1 | real | kind_phys | inout | F | !! | sigmaf | vegetation_area_fraction | areal fractional cover of green vegetation | frac | 1 | real | kind_phys | in | F | !! | sfalb | surface_diffused_shortwave_albedo | mean surface diffused sw albedo | frac | 1 | real | kind_phys | inout | F | @@ -267,7 +267,7 @@ subroutine lsm_ruc_run & ! --- inpu & sfcqc, sfcdew, tice, sfcqv, & & sncovr1, qsurf, gflux, drain, evap, hflx, & ! --- outputs & rhosnf, runof, runoff, srunoff, & - & chh, cmm, evbs, evcw, sbsno, stm, wet1, & + & chh, cmm, evbs, evcw, sbsno, stm, wetness, & & acsnow, snowfallac, & & flag_init, flag_restart, errmsg, errflg & & ) @@ -319,7 +319,7 @@ subroutine lsm_ruc_run & ! --- inpu real (kind=kind_phys), dimension(im), intent(inout) :: sncovr1, & & qsurf , gflux , evap , runof , drain , & & runoff, srunoff, hflx, cmm, chh, & - & rhosnf, evbs, evcw, sbsno, stm, wet1, & + & rhosnf, evbs, evcw, sbsno, stm, wetness, & & acsnow, snowfallac logical, intent(in) :: flag_init, flag_restart @@ -331,7 +331,7 @@ subroutine lsm_ruc_run & ! --- inpu & q0, qs1, wind, weasd_old, snwdph_old, & & tprcp_old, srflag_old, sr_old, tskin_old, canopy_old, & & tsnow_old, snowfallac_old, acsnow_old, sfalb_old, & - & sfcqv_old, sfcqc_old, wet1_old, zorl_old, sncovr1_old + & sfcqv_old, sfcqc_old, wetness_old, zorl_old, sncovr1_old real (kind=kind_phys), dimension(lsoil_ruc) :: et @@ -426,7 +426,7 @@ subroutine lsm_ruc_run & ! --- inpu smc, slc, stc, & ! in smcref2, smcwlt2, & ! inout lsm_ruc, lsm, & ! in - zs, sh2o, smfrkeep, tslb, smois, wet1, & ! out + zs, sh2o, smfrkeep, tslb, smois, wetness, & ! out errmsg, errflg) !do i = 1, im ! n - horizontal loop @@ -521,7 +521,7 @@ subroutine lsm_ruc_run & ! --- inpu sfalb_old(i) = sfalb(i) sfcqv_old(i) = sfcqv(i) sfcqc_old(i) = sfcqc(i) - wet1_old(i) = wet1(i) + wetness_old(i) = wetness(i) zorl_old(i) = zorl(i) sncovr1_old(i) = sncovr1(i) do k = 1, lsoil_ruc @@ -777,8 +777,8 @@ subroutine lsm_ruc_run & ! --- inpu if(stype(i,j) .ne. 14) then ! land - if (wet1(i) > 0.) then - wet(i,j) = wet1(i) + if (wetness(i) > 0.) then + wet(i,j) = wetness(i) else wet(i,j) = max(0.0001,smsoil(i,1,j)/0.3) endif @@ -1034,7 +1034,7 @@ subroutine lsm_ruc_run & ! --- inpu runof (i) = runoff1(i,j) drain (i) = runoff2(i,j) - wet1(i) = wet(i,j) + wetness(i) = wet(i,j) ! State variables tsnow(i) = soilt1(i,j) @@ -1111,7 +1111,7 @@ subroutine lsm_ruc_run & ! --- inpu sfalb(i) = sfalb_old(i) sfcqv(i) = sfcqv_old(i) sfcqc(i) = sfcqc_old(i) - wet1(i) = wet1_old(i) + wetness(i) = wetness_old(i) zorl(i) = zorl_old(i) sncovr1(i) = sncovr1_old(i) do k = 1, lsoil_ruc @@ -1157,8 +1157,8 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in smc, slc, stc, & ! in smcref2, smcwlt2, & ! inout lsm_ruc, lsm, & ! in - zs, sh2o, smfrkeep, tslb, smois, wet1, & ! out - errmsg, errflg) + zs, sh2o, smfrkeep, tslb, smois, & ! out + wetness, errmsg, errflg) implicit none @@ -1180,7 +1180,7 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in integer, dimension(im), intent(inout) :: soiltyp integer, dimension(im), intent(inout) :: vegtype - real (kind=kind_phys), dimension(im), intent(inout) :: wet1 + real (kind=kind_phys), dimension(im), intent(inout) :: wetness real (kind=kind_phys), dimension(im), intent(inout) :: fice real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: smois! ruc real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: tslb ! ruc @@ -1502,7 +1502,7 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in do j=jts,jte do i=its,ite - wet1(i) = mavail(i,j) + wetness(i) = mavail(i,j) do k = 1, lsoil_ruc smois(i,k) = soilm(i,k,j) tslb(i,k) = soiltemp(i,k,j) From 04fe39a8fe673de65e913f62c94ce1363ad86715 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Fri, 28 Jun 2019 13:22:05 -0600 Subject: [PATCH 25/89] physics/sfc_drv_ruc.F90: remove sr and use srflag, together with information about the MP physics scheme --- physics/sfc_drv_ruc.F90 | 258 ++++++++++++++++++++-------------------- 1 file changed, 131 insertions(+), 127 deletions(-) diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index 77833671f..d4e15a7f7 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -114,8 +114,8 @@ end subroutine lsm_ruc_finalize ! snwdph - real, snow depth (water equiv) over land im ! ! tskin - real, ground surface skin temperature ( k ) im ! ! tprcp - real, total precipitation im ! -! srflag - real, snow/rain flag for precipitation im ! -! sr - real, mixed-phase precipitation fraction im ! +! srflag - real, snow/rain flag for precipitation or mixed-phase +! precipitation fraction (depends on MP) im ! ! tslb - real, soil temp (k) im,km ! ! sh2o - real, liquid soil moisture im,km ! ! canopy - real, canopy moisture content (mm) im ! @@ -142,130 +142,133 @@ end subroutine lsm_ruc_finalize !! This module contains GSD RUC Land Surface Model #if 0 !> \section arg_table_lsm_ruc_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | delt | time_step_for_dynamics | physics time step | s | 0 | real | kind_phys | in | F | -!! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | kdt | index_of_time_step | current number of time steps | index | 0 | integer | | in | F | -!! | iter | ccpp_loop_counter | loop counter for subcycling loops in CCPP | index | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | nlev | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | lsm_ruc | flag_for_ruc_land_surface_scheme | flag for RUC land surface model | flag | 0 | integer | | in | F | -!! | lsm | flag_for_land_surface_scheme | flag for land surface model | flag | 0 | integer | | in | F | -!! | do_mynnsfclay | do_mynnsfclay | flag to activate MYNN surface layer | flag | 0 | logical | | in | F | -!! | lsoil_ruc | soil_vertical_dimension_for_land_surface_model | number of soil layers internal to land surface model | count | 0 | integer | | in | F | -!! | lsoil | soil_vertical_dimension | soil vertical layer dimension | count | 0 | integer | | in | F | -!! | zs | depth_of_soil_levels_for_land_surface_model | depth of soil levels for land surface model | m | 1 | real | kind_phys | inout | F | -!! | islmsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | -!! | con_cp | specific_heat_of_dry_air_at_constant_pressure | specific heat !of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | con_pi | pi | ratio of a circle's circumference to its diameter | radians | 0 | real | kind_phys | in | F | -!! | con_rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | con_rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | con_hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of vaporization/sublimation (hvap) | J kg-1 | 0 | real | kind_phys | in | F | -!! | con_fvirt | ratio_of_vapor_to_dry_air_gas_constants_minus_one | rv/rd - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | land | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | -!! | rainnc | lwe_thickness_of_explicit_rainfall_amount_from_previous_timestep | explicit rainfall from previous timestep | m | 1 | real | kind_phys | in | F | -!! | rainc | lwe_thickness_of_convective_precipitation_amount_from_previous_timestep | convective_precipitation_amount from previous timestep | m | 1 | real | kind_phys | in | F | -!! | ice | lwe_thickness_of_ice_amount_from_previous_timestep | ice amount from previous timestep | m | 1 | real | kind_phys | in | F | -!! | snow | lwe_thickness_of_snow_amount_from_previous_timestep | snow amount from previous timestep | m | 1 | real | kind_phys | in | F | -!! | graupel | lwe_thickness_of_graupel_amount_from_previous_timestep | graupel amount from previous timestep | m | 1 | real | kind_phys | in | F | -!! | srflag | flag_for_precipitation_type | snow/rain flag for precipitation | flag | 1 | real | kind_phys | in | F | -!! | sncovr1 | surface_snow_area_fraction_over_land | surface snow area fraction | frac | 1 | real | kind_phys | inout | F | -!! | weasd | water_equivalent_accumulated_snow_depth_over_land | water equiv of acc snow depth over land | mm | 1 | real | kind_phys | inout | F | -!! | snwdph | surface_snow_thickness_water_equivalent_over_land | water equivalent snow depth over land | mm | 1 | real | kind_phys | inout | F | -!! | sr | ratio_of_snowfall_to_rainfall | snow ratio: ratio of snow to total precipitation | frac | 1 | real | kind_phys | in | F | -!! | rhosnf | density_of_frozen_precipitation | density of frozen precipitation | kg m-3 | 1 | real | kind_phys | out | F | -!! | zf | height_above_ground_at_lowest_model_layer | layer 1 height above ground (not MSL) | m | 1 | real | kind_phys | in | F | -!! | u1 | x_wind_at_lowest_model_layer | zonal wind at lowest model layer | m s-1 | 1 | real | kind_phys | in | F | -!! | v1 | y_wind_at_lowest_model_layer | meridional wind at lowest model layer | m s-1 | 1 | real | kind_phys | in | F | -!! | prsl1 | air_pressure_at_lowest_model_layer | mean pressure at lowest model layer | Pa | 1 | real | kind_phys | in | F | -!! | ddvel | surface_wind_enhancement_due_to_convection | surface wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | -!! | t1 | air_temperature_at_lowest_model_layer | mean temperature at lowest model layer | K | 1 | real | kind_phys | in | F | -!! | q1 | water_vapor_specific_humidity_at_lowest_model_layer | water vapor specific humidity at lowest model layer | kg kg-1 | 1 | real | kind_phys | in | F | -!! | qc | cloud_condensed_water_mixing_ratio_at_lowest_model_layer | moist (dry+vapor, no condensates) mixing ratio of cloud water at lowest model layer | kg kg-1 | 1 | real | kind_phys | in | F | -!! | dlwflx | surface_downwelling_longwave_flux | surface downwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | dswsfc | surface_downwelling_shortwave_flux | surface downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | snet | surface_net_downwelling_shortwave_flux | surface net downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | sfcemis | surface_longwave_emissivity | surface lw emissivity in fraction | frac | 1 | real | kind_phys | inout | F | -!! | wspd | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | inout | F | -!! | cm | surface_drag_coefficient_for_momentum_in_air_over_land | surface exchange coeff for momentum over land | none | 1 | real | kind_phys | in | F | -!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_land | surface exchange coeff heat & moisture over land | none | 1 | real | kind_phys | in | F | -!! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land | thermal exchange coefficient over land | kg m-2 s-1 | 1 | real | kind_phys | inout | F | -!! | cmm | surface_drag_wind_speed_for_momentum_in_air_over_land | momentum exchange coefficient over land | m s-1 | 1 | real | kind_phys | inout | F | -!! | wetness | normalized_soil_wetness_for_land_surface_model | normalized soil wetness | frac | 1 | real | kind_phys | inout | F | -!! | canopy | canopy_water_amount | canopy water amount | kg m-2 | 1 | real | kind_phys | inout | F | -!! | sigmaf | vegetation_area_fraction | areal fractional cover of green vegetation | frac | 1 | real | kind_phys | in | F | -!! | sfalb | surface_diffused_shortwave_albedo | mean surface diffused sw albedo | frac | 1 | real | kind_phys | inout | F | -!! | alvwf | mean_vis_albedo_with_weak_cosz_dependency | mean vis albedo with weak cosz dependency | frac | 1 | real | kind_phys | in | F | -!! | alnwf | mean_nir_albedo_with_weak_cosz_dependency | mean nir albedo with weak cosz dependency | frac | 1 | real | kind_phys | in | F | -!! | snoalb | upper_bound_on_max_albedo_over_deep_snow | maximum snow albedo | frac | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length_over_land_interstitial | surface roughness length over land (temporary use as interstitial)| cm | 1 | real | kind_phys | inout | F | -!! | qsurf | surface_specific_humidity_over_land | surface air saturation specific humidity over land | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | sfcqc | cloud_condensed_water_mixing_ratio_at_surface | moist cloud water mixing ratio at surface | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | sfcqv | water_vapor_mixing_ratio_at_surface | water vapor mixing ratio at surface | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | sfcdew | surface_condensation_mass | surface condensation mass | kg m-2 | 1 | real | kind_phys | inout | F | -!! | tg3 | deep_soil_temperature | deep soil temperature | K | 1 | real | kind_phys | in | F | -!! | smc | volume_fraction_of_soil_moisture | total soil moisture | frac | 2 | real | kind_phys | inout | F | -!! | slc | volume_fraction_of_unfrozen_soil_moisture | liquid soil moisture | frac | 2 | real | kind_phys | inout | F | -!! | stc | soil_temperature | soil temperature | K | 2 | real | kind_phys | inout | F | -!! | smcwlt2 | volume_fraction_of_condensed_water_in_soil_at_wilting_point | soil water fraction at wilting point | frac | 1 | real | kind_phys | inout | F | -!! | smcref2 | threshold_volume_fraction_of_condensed_water_in_soil | soil moisture threshold | frac | 1 | real | kind_phys | inout | F | -!! | vegtype | vegetation_type_classification | vegetation type at each grid cell | index | 1 | integer | | in | F | -!! | soiltyp | soil_type_classification | soil type at each grid cell | index | 1 | integer | | in | F | -!! | isot | soil_type_dataset_choice | soil type dataset choice | index | 0 | integer | | in | F | -!! | ivegsrc | vegetation_type_dataset_choice | land use dataset choice | index | 0 | integer | | in | F | -!! | fice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | -!! | keepfr | flag_for_frozen_soil_physics | flag for frozen soil physics (RUC) | flag | 2 | real | kind_phys | inout | F | -!! | smois | volume_fraction_of_soil_moisture_for_land_surface_model | volumetric fraction of soil moisture for lsm | frac | 2 | real | kind_phys | inout | F | -!! | sh2o | volume_fraction_of_unfrozen_soil_moisture_for_land_surface_model | volume fraction of unfrozen soil moisture for lsm | frac | 2 | real | kind_phys | inout | F | -!! | smfrkeep | volume_fraction_of_frozen_soil_moisture_for_land_surface_model | volume fraction of frozen soil moisture for lsm | frac | 2 | real | kind_phys | inout | F | -!! | tslb | soil_temperature_for_land_surface_model | soil temperature for land surface model | K | 2 | real | kind_phys | inout | F | -!! | stm | soil_moisture_content | soil moisture content | kg m-2 | 1 | real | kind_phys | inout | F | -!! | tskin | surface_skin_temperature_over_land_interstitial | surface skin temperature over land use as interstitial | K | 1 | real | kind_phys | inout | F | -!! | tsurf | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | inout | F | -!! | tice | sea_ice_temperature_interstitial | sea ice surface skin temperature use as interstitial | K | 1 | real | kind_phys | inout | F | -!! | tsnow | snow_temperature_bottom_first_layer | snow temperature at the bottom of first snow layer | K | 1 | real | kind_phys | inout | F | -!! | snowfallac | total_accumulated_snowfall | run-total snow accumulation on the ground | kg m-2 | 1 | real | kind_phys | inout | F | -!! | acsnow | accumulated_water_equivalent_of_frozen_precip | snow water equivalent of run-total frozen precip | kg m-2 | 1 | real | kind_phys | inout | F | -!! | evap | kinematic_surface_upward_latent_heat_flux_over_land | kinematic surface upward evaporation flux over land | kg kg-1 m s-1 | 1 | real | kind_phys | out | F | -!! | hflx | kinematic_surface_upward_sensible_heat_flux_over_land | kinematic surface upward sensible heat flux over land | K m s-1 | 1 | real | kind_phys | out | F | -!! | evbs | soil_upward_latent_heat_flux | soil upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | evcw | canopy_upward_latent_heat_flux | canopy upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | sbsno | snow_deposition_sublimation_upward_latent_heat_flux | latent heat flux from snow depo/subl | W m-2 | 1 | real | kind_phys | out | F | -!! | trans | transpiration_flux | total plant transpiration rate | kg m-2 s-1 | 1 | real | kind_phys | out | F | -!! | runof | surface_runoff_flux | surface runoff flux | g m-2 s-1 | 1 | real | kind_phys | out | F | -!! | drain | subsurface_runoff_flux | subsurface runoff flux | g m-2 s-1 | 1 | real | kind_phys | out | F | -!! | runoff | total_runoff | total water runoff | kg m-2 | 1 | real | kind_phys | inout | F | -!! | srunoff | surface_runoff | surface water runoff (from lsm) | kg m-2 | 1 | real | kind_phys | inout | F | -!! | gflux | upward_heat_flux_in_soil_over_land | soil heat flux over land | W m-2 | 1 | real | kind_phys | out | F | -!! | shdmin | minimum_vegetation_area_fraction | min fractional coverage of green vegetation | frac | 1 | real | kind_phys | in | F | -!! | shdmax | maximum_vegetation_area_fraction | max fractional coverage of green vegetation | frac | 1 | real | kind_phys | in | F | -!! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | -!! | flag_guess | flag_for_guess_run | flag for guess run | flag | 1 | logical | | in | F | -!! | flag_init | flag_for_first_time_step | flag signaling first time step for time integration loop | flag | 0 | logical | | in | F | -!! | flag_restart | flag_for_restart | flag for restart (warmstart) or coldstart | flag | 0 | logical | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| +!! | delt | time_step_for_dynamics | physics time step | s | 0 | real | kind_phys | in | F | +!! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | +!! | kdt | index_of_time_step | current number of time steps | index | 0 | integer | | in | F | +!! | iter | ccpp_loop_counter | loop counter for subcycling loops in CCPP | index | 0 | integer | | in | F | +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | nlev | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | +!! | lsm_ruc | flag_for_ruc_land_surface_scheme | flag for RUC land surface model | flag | 0 | integer | | in | F | +!! | lsm | flag_for_land_surface_scheme | flag for land surface model | flag | 0 | integer | | in | F | +!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | +!! | do_mynnsfclay | do_mynnsfclay | flag to activate MYNN surface layer | flag | 0 | logical | | in | F | +!! | lsoil_ruc | soil_vertical_dimension_for_land_surface_model | number of soil layers internal to land surface model | count | 0 | integer | | in | F | +!! | lsoil | soil_vertical_dimension | soil vertical layer dimension | count | 0 | integer | | in | F | +!! | zs | depth_of_soil_levels_for_land_surface_model | depth of soil levels for land surface model | m | 1 | real | kind_phys | inout | F | +!! | islmsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | +!! | con_cp | specific_heat_of_dry_air_at_constant_pressure | specific heat !of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | +!! | con_pi | pi | ratio of a circle's circumference to its diameter | radians | 0 | real | kind_phys | in | F | +!! | con_rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | con_rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | con_hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of vaporization/sublimation (hvap) | J kg-1 | 0 | real | kind_phys | in | F | +!! | con_fvirt | ratio_of_vapor_to_dry_air_gas_constants_minus_one | rv/rd - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | +!! | land | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | +!! | rainnc | lwe_thickness_of_explicit_rainfall_amount_from_previous_timestep | explicit rainfall from previous timestep | m | 1 | real | kind_phys | in | F | +!! | rainc | lwe_thickness_of_convective_precipitation_amount_from_previous_timestep | convective_precipitation_amount from previous timestep | m | 1 | real | kind_phys | in | F | +!! | ice | lwe_thickness_of_ice_amount_from_previous_timestep | ice amount from previous timestep | m | 1 | real | kind_phys | in | F | +!! | snow | lwe_thickness_of_snow_amount_from_previous_timestep | snow amount from previous timestep | m | 1 | real | kind_phys | in | F | +!! | graupel | lwe_thickness_of_graupel_amount_from_previous_timestep | graupel amount from previous timestep | m | 1 | real | kind_phys | in | F | +!! | srflag | flag_for_precipitation_type | snow/rain flag for precipitation | flag | 1 | real | kind_phys | in | F | +!! | sncovr1 | surface_snow_area_fraction_over_land | surface snow area fraction | frac | 1 | real | kind_phys | inout | F | +!! | weasd | water_equivalent_accumulated_snow_depth_over_land | water equiv of acc snow depth over land | mm | 1 | real | kind_phys | inout | F | +!! | snwdph | surface_snow_thickness_water_equivalent_over_land | water equivalent snow depth over land | mm | 1 | real | kind_phys | inout | F | +!! | rhosnf | density_of_frozen_precipitation | density of frozen precipitation | kg m-3 | 1 | real | kind_phys | out | F | +!! | zf | height_above_ground_at_lowest_model_layer | layer 1 height above ground (not MSL) | m | 1 | real | kind_phys | in | F | +!! | u1 | x_wind_at_lowest_model_layer | zonal wind at lowest model layer | m s-1 | 1 | real | kind_phys | in | F | +!! | v1 | y_wind_at_lowest_model_layer | meridional wind at lowest model layer | m s-1 | 1 | real | kind_phys | in | F | +!! | prsl1 | air_pressure_at_lowest_model_layer | mean pressure at lowest model layer | Pa | 1 | real | kind_phys | in | F | +!! | ddvel | surface_wind_enhancement_due_to_convection | surface wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | +!! | t1 | air_temperature_at_lowest_model_layer | mean temperature at lowest model layer | K | 1 | real | kind_phys | in | F | +!! | q1 | water_vapor_specific_humidity_at_lowest_model_layer | water vapor specific humidity at lowest model layer | kg kg-1 | 1 | real | kind_phys | in | F | +!! | qc | cloud_condensed_water_mixing_ratio_at_lowest_model_layer | moist (dry+vapor, no condensates) mixing ratio of cloud water at lowest model layer | kg kg-1 | 1 | real | kind_phys | in | F | +!! | dlwflx | surface_downwelling_longwave_flux | surface downwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | dswsfc | surface_downwelling_shortwave_flux | surface downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | snet | surface_net_downwelling_shortwave_flux | surface net downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | +!! | sfcemis | surface_longwave_emissivity | surface lw emissivity in fraction | frac | 1 | real | kind_phys | inout | F | +!! | wspd | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | inout | F | +!! | cm | surface_drag_coefficient_for_momentum_in_air_over_land | surface exchange coeff for momentum over land | none | 1 | real | kind_phys | in | F | +!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_land | surface exchange coeff heat & moisture over land | none | 1 | real | kind_phys | in | F | +!! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land | thermal exchange coefficient over land | kg m-2 s-1 | 1 | real | kind_phys | inout | F | +!! | cmm | surface_drag_wind_speed_for_momentum_in_air_over_land | momentum exchange coefficient over land | m s-1 | 1 | real | kind_phys | inout | F | +!! | wetness | normalized_soil_wetness_for_land_surface_model | normalized soil wetness | frac | 1 | real | kind_phys | inout | F | +!! | canopy | canopy_water_amount | canopy water amount | kg m-2 | 1 | real | kind_phys | inout | F | +!! | sigmaf | vegetation_area_fraction | areal fractional cover of green vegetation | frac | 1 | real | kind_phys | in | F | +!! | sfalb | surface_diffused_shortwave_albedo | mean surface diffused sw albedo | frac | 1 | real | kind_phys | inout | F | +!! | alvwf | mean_vis_albedo_with_weak_cosz_dependency | mean vis albedo with weak cosz dependency | frac | 1 | real | kind_phys | in | F | +!! | alnwf | mean_nir_albedo_with_weak_cosz_dependency | mean nir albedo with weak cosz dependency | frac | 1 | real | kind_phys | in | F | +!! | snoalb | upper_bound_on_max_albedo_over_deep_snow | maximum snow albedo | frac | 1 | real | kind_phys | in | F | +!! | zorl | surface_roughness_length_over_land_interstitial | surface roughness length over land (temporary use as interstitial)| cm | 1 | real | kind_phys | inout | F | +!! | qsurf | surface_specific_humidity_over_land | surface air saturation specific humidity over land | kg kg-1 | 1 | real | kind_phys | inout | F | +!! | sfcqc | cloud_condensed_water_mixing_ratio_at_surface | moist cloud water mixing ratio at surface | kg kg-1 | 1 | real | kind_phys | inout | F | +!! | sfcqv | water_vapor_mixing_ratio_at_surface | water vapor mixing ratio at surface | kg kg-1 | 1 | real | kind_phys | inout | F | +!! | sfcdew | surface_condensation_mass | surface condensation mass | kg m-2 | 1 | real | kind_phys | inout | F | +!! | tg3 | deep_soil_temperature | deep soil temperature | K | 1 | real | kind_phys | in | F | +!! | smc | volume_fraction_of_soil_moisture | total soil moisture | frac | 2 | real | kind_phys | inout | F | +!! | slc | volume_fraction_of_unfrozen_soil_moisture | liquid soil moisture | frac | 2 | real | kind_phys | inout | F | +!! | stc | soil_temperature | soil temperature | K | 2 | real | kind_phys | inout | F | +!! | smcwlt2 | volume_fraction_of_condensed_water_in_soil_at_wilting_point | soil water fraction at wilting point | frac | 1 | real | kind_phys | inout | F | +!! | smcref2 | threshold_volume_fraction_of_condensed_water_in_soil | soil moisture threshold | frac | 1 | real | kind_phys | inout | F | +!! | vegtype | vegetation_type_classification | vegetation type at each grid cell | index | 1 | integer | | in | F | +!! | soiltyp | soil_type_classification | soil type at each grid cell | index | 1 | integer | | in | F | +!! | isot | soil_type_dataset_choice | soil type dataset choice | index | 0 | integer | | in | F | +!! | ivegsrc | vegetation_type_dataset_choice | land use dataset choice | index | 0 | integer | | in | F | +!! | fice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | +!! | keepfr | flag_for_frozen_soil_physics | flag for frozen soil physics (RUC) | flag | 2 | real | kind_phys | inout | F | +!! | smois | volume_fraction_of_soil_moisture_for_land_surface_model | volumetric fraction of soil moisture for lsm | frac | 2 | real | kind_phys | inout | F | +!! | sh2o | volume_fraction_of_unfrozen_soil_moisture_for_land_surface_model | volume fraction of unfrozen soil moisture for lsm | frac | 2 | real | kind_phys | inout | F | +!! | smfrkeep | volume_fraction_of_frozen_soil_moisture_for_land_surface_model | volume fraction of frozen soil moisture for lsm | frac | 2 | real | kind_phys | inout | F | +!! | tslb | soil_temperature_for_land_surface_model | soil temperature for land surface model | K | 2 | real | kind_phys | inout | F | +!! | stm | soil_moisture_content | soil moisture content | kg m-2 | 1 | real | kind_phys | inout | F | +!! | tskin | surface_skin_temperature_over_land_interstitial | surface skin temperature over land use as interstitial | K | 1 | real | kind_phys | inout | F | +!! | tsurf | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | inout | F | +!! | tice | sea_ice_temperature_interstitial | sea ice surface skin temperature use as interstitial | K | 1 | real | kind_phys | inout | F | +!! | tsnow | snow_temperature_bottom_first_layer | snow temperature at the bottom of first snow layer | K | 1 | real | kind_phys | inout | F | +!! | snowfallac | total_accumulated_snowfall | run-total snow accumulation on the ground | kg m-2 | 1 | real | kind_phys | inout | F | +!! | acsnow | accumulated_water_equivalent_of_frozen_precip | snow water equivalent of run-total frozen precip | kg m-2 | 1 | real | kind_phys | inout | F | +!! | evap | kinematic_surface_upward_latent_heat_flux_over_land | kinematic surface upward evaporation flux over land | kg kg-1 m s-1 | 1 | real | kind_phys | out | F | +!! | hflx | kinematic_surface_upward_sensible_heat_flux_over_land | kinematic surface upward sensible heat flux over land | K m s-1 | 1 | real | kind_phys | out | F | +!! | evbs | soil_upward_latent_heat_flux | soil upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | evcw | canopy_upward_latent_heat_flux | canopy upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | sbsno | snow_deposition_sublimation_upward_latent_heat_flux | latent heat flux from snow depo/subl | W m-2 | 1 | real | kind_phys | out | F | +!! | trans | transpiration_flux | total plant transpiration rate | kg m-2 s-1 | 1 | real | kind_phys | out | F | +!! | runof | surface_runoff_flux | surface runoff flux | g m-2 s-1 | 1 | real | kind_phys | out | F | +!! | drain | subsurface_runoff_flux | subsurface runoff flux | g m-2 s-1 | 1 | real | kind_phys | out | F | +!! | runoff | total_runoff | total water runoff | kg m-2 | 1 | real | kind_phys | inout | F | +!! | srunoff | surface_runoff | surface water runoff (from lsm) | kg m-2 | 1 | real | kind_phys | inout | F | +!! | gflux | upward_heat_flux_in_soil_over_land | soil heat flux over land | W m-2 | 1 | real | kind_phys | out | F | +!! | shdmin | minimum_vegetation_area_fraction | min fractional coverage of green vegetation | frac | 1 | real | kind_phys | in | F | +!! | shdmax | maximum_vegetation_area_fraction | max fractional coverage of green vegetation | frac | 1 | real | kind_phys | in | F | +!! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | +!! | flag_guess | flag_for_guess_run | flag for guess run | flag | 1 | logical | | in | F | +!! | flag_init | flag_for_first_time_step | flag signaling first time step for time integration loop | flag | 0 | logical | | in | F | +!! | flag_restart | flag_for_restart | flag for restart (warmstart) or coldstart | flag | 0 | logical | | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! #endif !>\section gen_lsmruc GSD RUC LSM General Algorithm - subroutine lsm_ruc_run & ! --- inputs +! DH* TODO - make order of arguments the same as in the metadata table + subroutine lsm_ruc_run & ! inputs & ( iter, me, kdt, im, nlev, lsoil_ruc, lsoil, zs, & & u1, v1, t1, q1, qc, soiltyp, vegtype, sigmaf, & & sfcemis, dlwflx, dswsfc, snet, delt, tg3, cm, ch, & & prsl1, zf, islmsk, ddvel, shdmin, shdmax, alvwf, alnwf, & & snoalb, sfalb, flag_iter, flag_guess, isot, ivegsrc, fice, & & smc, stc, slc, lsm_ruc, lsm, land, & + & imp_physics, imp_physics_gfdl, imp_physics_thompson, & & smcwlt2, smcref2, wspd, do_mynnsfclay, & - & con_cp, con_rv, con_rd, con_g, con_pi, con_hvap, con_fvirt,& ! constants - & weasd, snwdph, tskin, & ! in/outs + & con_cp, con_rv, con_rd, con_g, con_pi, con_hvap, con_fvirt,& ! constants + & weasd, snwdph, tskin, & ! in/outs & rainnc, rainc, ice, snow, graupel, & ! in - & srflag, sr, & ! in/outs - & smois, tslb, sh2o, keepfr, smfrkeep, & ! on RUC levels + & srflag, smois, tslb, sh2o, keepfr, smfrkeep, & ! in/outs, on RUC levels & canopy, trans, tsurf, tsnow, zorl, & & sfcqc, sfcdew, tice, sfcqv, & - & sncovr1, qsurf, gflux, drain, evap, hflx, & ! --- outputs + & sncovr1, qsurf, gflux, drain, evap, hflx, & ! outputs & rhosnf, runof, runoff, srunoff, & & chh, cmm, evbs, evcw, sbsno, stm, wetness, & & acsnow, snowfallac, & @@ -282,6 +285,7 @@ subroutine lsm_ruc_run & ! --- inpu integer, intent(in) :: me integer, intent(in) :: im, nlev, iter, lsoil_ruc, lsoil, kdt, isot, ivegsrc integer, intent(in) :: lsm_ruc, lsm + integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson real (kind=kind_phys), dimension(im,lsoil), intent(inout) :: smc,stc,slc @@ -305,7 +309,7 @@ subroutine lsm_ruc_run & ! --- inpu real (kind=kind_phys), dimension(lsoil_ruc), intent(inout ) :: zs real (kind=kind_phys), dimension(im), intent(inout) :: weasd, & & snwdph, tskin, & - & srflag, sr, canopy, trans, tsurf, zorl, tsnow, & + & srflag, canopy, trans, tsurf, zorl, tsnow, & & sfcqc, sfcqv, sfcdew, fice, tice, sfalb, smcwlt2, smcref2 ! --- in real (kind=kind_phys), dimension(im), intent(in) :: & @@ -329,7 +333,7 @@ subroutine lsm_ruc_run & ! --- inpu ! --- locals: real (kind=kind_phys), dimension(im) :: rch, rho, & & q0, qs1, wind, weasd_old, snwdph_old, & - & tprcp_old, srflag_old, sr_old, tskin_old, canopy_old, & + & tprcp_old, srflag_old, tskin_old, canopy_old, & & tsnow_old, snowfallac_old, acsnow_old, sfalb_old, & & sfcqv_old, sfcqc_old, wetness_old, zorl_old, sncovr1_old @@ -514,7 +518,6 @@ subroutine lsm_ruc_run & ! --- inpu canopy_old(i) = canopy(i) !tprcp_old(i) = tprcp(i) srflag_old(i) = srflag(i) - sr_old(i) = sr(i) tsnow_old(i) = tsnow(i) snowfallac_old(i) = snowfallac(i) acsnow_old(i) = acsnow(i) @@ -606,22 +609,23 @@ subroutine lsm_ruc_run & ! --- inpu !!\n \a lsoil_ruc - number of soil layers (= 6 or 9) !!\n \a zs - the depth of each soil level (\f$m\f$) - ! DH* TODO - TEST FOR DIFFERENT PHYSICS AND SET ACCORDINGLY? - frpcpn = .true. ! .true. if mixed phase precipitation available (Thompson) + ! Set flag for mixed phase precipitation depending on microphysics scheme. + ! For GFDL and Thompson, srflag is fraction of frozen precip for convective+explicit precip. + if (imp_physics==imp_physics_gfdlmp .or. imp_physics==imp_physics_thompson) then + frpcpn = .true. + else + frpcpn = .false. + endif do j = 1, 1 ! 1:1 do i = 1, im ! i - horizontal loop if (flag_iter(i) .and. flag(i)) then - if(.not.frpcpn) then ! no mixed-phase precipitation available - if (srflag(i) == 1.0) then ! snow phase - ffrozp(i,j) = 1.0 - elseif (srflag(i) == 0.0) then ! rain phase - ffrozp(i,j) = 0.0 - endif - else ! mixed-phase precipitation is available - ffrozp(i,j) = sr(i) - endif ! frpcpn + if (frpcpn) then + ffrozp(i,j) = srflag(i) + else + ffrozp(i,j) = real(nint(srflag(i)),kind_phys) + endif !tgs - for now set rdlai2d to .false., WRF has LAI maps, and RUC LSM ! uses rdlai2d = .true. From f42f84c7fd4a0e3295d4bbe580d9a5e775f5bc6b Mon Sep 17 00:00:00 2001 From: climbfuji Date: Sat, 29 Jun 2019 05:06:11 -0600 Subject: [PATCH 26/89] physics/GFS_debug.F90, physics/sfc_drv_ruc.F90: bugfixes after removing sr from and change to use Sfcprop%wetness for RUC LSM instead of Diag%wet1 for RUC LSM --- physics/GFS_debug.F90 | 7 ++++++- physics/sfc_drv_ruc.F90 | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 index c4295871f..c0bfef12b 100644 --- a/physics/GFS_debug.F90 +++ b/physics/GFS_debug.F90 @@ -174,7 +174,6 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, call print_var(mpirank,omprank, blkno, 'Sfcprop%f10m' , Sfcprop%f10m) call print_var(mpirank,omprank, blkno, 'Sfcprop%tprcp' , Sfcprop%tprcp) call print_var(mpirank,omprank, blkno, 'Sfcprop%srflag' , Sfcprop%srflag) - call print_var(mpirank,omprank, blkno, 'Sfcprop%sr' , Sfcprop%sr) call print_var(mpirank,omprank, blkno, 'Sfcprop%slc' , Sfcprop%slc) call print_var(mpirank,omprank, blkno, 'Sfcprop%smc' , Sfcprop%smc) call print_var(mpirank,omprank, blkno, 'Sfcprop%stc' , Sfcprop%stc) @@ -321,10 +320,16 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, call print_var(mpirank,omprank, blkno, 'Diag%epi ', Diag%epi) call print_var(mpirank,omprank, blkno, 'Diag%smcwlt2 ', Diag%smcwlt2) call print_var(mpirank,omprank, blkno, 'Diag%smcref2 ', Diag%smcref2) + call print_var(mpirank,omprank, blkno, 'Diag%sr ', Diag%sr) call print_var(mpirank,omprank, blkno, 'Diag%tdomr ', Diag%tdomr) call print_var(mpirank,omprank, blkno, 'Diag%tdomzr ', Diag%tdomzr) call print_var(mpirank,omprank, blkno, 'Diag%tdomip ', Diag%tdomip) call print_var(mpirank,omprank, blkno, 'Diag%tdoms ', Diag%tdoms) + if (Model%lsm == Model%lsm_ruc) then + call print_var(mpirank,omprank, blkno, 'Diag%wet1 ', Sfcprop%wetness) + else + call print_var(mpirank,omprank, blkno, 'Diag%wet1 ', Diag%wet1) + end if call print_var(mpirank,omprank, blkno, 'Diag%skebu_wts ', Diag%skebu_wts) call print_var(mpirank,omprank, blkno, 'Diag%skebv_wts ', Diag%skebv_wts) call print_var(mpirank,omprank, blkno, 'Diag%sppt_wts ', Diag%sppt_wts) diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index e129f5eb1..8316aba4d 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -612,7 +612,7 @@ subroutine lsm_ruc_run & ! inputs ! Set flag for mixed phase precipitation depending on microphysics scheme. ! For GFDL and Thompson, srflag is fraction of frozen precip for convective+explicit precip. - if (imp_physics==imp_physics_gfdlmp .or. imp_physics==imp_physics_thompson) then + if (imp_physics==imp_physics_gfdl .or. imp_physics==imp_physics_thompson) then frpcpn = .true. else frpcpn = .false. From fd33e61bc3304a69f96bcb777c7a7c0b20bd3263 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Tue, 9 Jul 2019 10:11:59 -0600 Subject: [PATCH 27/89] physics/GFS_PBL_generic.F90: add missing tracers for Thompson MP to tracer advection array for PBL schemes --- physics/GFS_PBL_generic.F90 | 44 +++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index 13b33d43e..5063038d4 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -100,18 +100,19 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, enddo elseif (imp_physics == imp_physics_thompson) then ! Thompson - ! DH* Thompson ntrw and ntsw? if(ltaerosol) then do k=1,levs do i=1,im - vdftra(i,k,1) = qgrs(i,k,ntqv) - vdftra(i,k,2) = qgrs(i,k,ntcw) - vdftra(i,k,3) = qgrs(i,k,ntiw) - vdftra(i,k,4) = qgrs(i,k,ntlnc) - vdftra(i,k,5) = qgrs(i,k,ntinc) - vdftra(i,k,6) = qgrs(i,k,ntoz) - vdftra(i,k,7) = qgrs(i,k,ntwa) - vdftra(i,k,8) = qgrs(i,k,ntia) + vdftra(i,k,1) = qgrs(i,k,ntqv) + vdftra(i,k,2) = qgrs(i,k,ntcw) + vdftra(i,k,3) = qgrs(i,k,ntiw) + vdftra(i,k,4) = qgrs(i,k,ntrw) + vdftra(i,k,5) = qgrs(i,k,ntsw) + vdftra(i,k,6) = qgrs(i,k,ntlnc) + vdftra(i,k,7) = qgrs(i,k,ntinc) + vdftra(i,k,8) = qgrs(i,k,ntoz) + vdftra(i,k,9) = qgrs(i,k,ntwa) + vdftra(i,k,10) = qgrs(i,k,ntia) enddo enddo else @@ -120,8 +121,10 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, vdftra(i,k,1) = qgrs(i,k,ntqv) vdftra(i,k,2) = qgrs(i,k,ntcw) vdftra(i,k,3) = qgrs(i,k,ntiw) - vdftra(i,k,4) = qgrs(i,k,ntinc) - vdftra(i,k,5) = qgrs(i,k,ntoz) + vdftra(i,k,4) = qgrs(i,k,ntrw) + vdftra(i,k,5) = qgrs(i,k,ntsw) + vdftra(i,k,6) = qgrs(i,k,ntinc) + vdftra(i,k,7) = qgrs(i,k,ntoz) enddo enddo endif @@ -362,18 +365,19 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, enddo elseif (imp_physics == imp_physics_thompson) then ! Thompson - ! DH* - Thompson ntrw, ntsw? if(ltaerosol) then do k=1,levs do i=1,im dqdt(i,k,ntqv) = dvdftra(i,k,1) dqdt(i,k,ntcw) = dvdftra(i,k,2) dqdt(i,k,ntiw) = dvdftra(i,k,3) - dqdt(i,k,ntlnc) = dvdftra(i,k,4) - dqdt(i,k,ntinc) = dvdftra(i,k,5) - dqdt(i,k,ntoz) = dvdftra(i,k,6) - dqdt(i,k,ntwa) = dvdftra(i,k,7) - dqdt(i,k,ntia) = dvdftra(i,k,8) + dqdt(i,k,ntrw) = dvdftra(i,k,4) + dqdt(i,k,ntsw) = dvdftra(i,k,5) + dqdt(i,k,ntlnc) = dvdftra(i,k,6) + dqdt(i,k,ntinc) = dvdftra(i,k,7) + dqdt(i,k,ntoz) = dvdftra(i,k,8) + dqdt(i,k,ntwa) = dvdftra(i,k,9) + dqdt(i,k,ntia) = dvdftra(i,k,10) enddo enddo else @@ -382,8 +386,10 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, dqdt(i,k,ntqv) = dvdftra(i,k,1) dqdt(i,k,ntcw) = dvdftra(i,k,2) dqdt(i,k,ntiw) = dvdftra(i,k,3) - dqdt(i,k,ntinc) = dvdftra(i,k,4) - dqdt(i,k,ntoz) = dvdftra(i,k,5) + dqdt(i,k,ntrw) = dvdftra(i,k,4) + dqdt(i,k,ntsw) = dvdftra(i,k,5) + dqdt(i,k,ntinc) = dvdftra(i,k,6) + dqdt(i,k,ntoz) = dvdftra(i,k,7) enddo enddo endif From 9a57d7f4def6b6926d50ebb18459dcfcd2c59b3f Mon Sep 17 00:00:00 2001 From: climbfuji Date: Tue, 9 Jul 2019 10:26:53 -0600 Subject: [PATCH 28/89] physics/cu_gf_deep.F90: bugfix, replace exit statements in do loop with cycle statements --- physics/cu_gf_deep.F90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/physics/cu_gf_deep.F90 b/physics/cu_gf_deep.F90 index 4c357d787..3e865c9ba 100644 --- a/physics/cu_gf_deep.F90 +++ b/physics/cu_gf_deep.F90 @@ -3227,9 +3227,9 @@ subroutine cup_up_aa0(aa0,z,zu,dby,gamma_cup,t_cup, & enddo do k=kts+1,ktf do i=its,itf - if(ierr(i).ne.0) exit - if(k.lt.kbcon(i)) exit - if(k.gt.ktop(i)) exit + if(ierr(i).ne.0) cycle + if(k.lt.kbcon(i)) cycle + if(k.gt.ktop(i)) cycle dz=z(i,k)-z(i,k-1) da=zu(i,k)*dz*(9.81/(1004.*( & (t_cup(i,k)))))*dby(i,k-1)/ & @@ -4379,8 +4379,8 @@ subroutine cup_up_aa1bl(aa0,t,tn,q,qo,dtime, & enddo do i=its,itf do k=kts,kbcon(i) - if(ierr(i).ne.0 ) exit -! if(k.gt.kbcon(i)) exit + if(ierr(i).ne.0 ) cycle +! if(k.gt.kbcon(i)) cycle dz = (z_cup (i,k+1)-z_cup (i,k))*g da = dz*(tn(i,k)*(1.+0.608*qo(i,k))-t(i,k)*(1.+0.608*q(i,k)))/dtime From 76c8df5d79495702be06222df8ff8ab99c5dae21 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Tue, 9 Jul 2019 10:27:40 -0600 Subject: [PATCH 29/89] physics/cu_gf_driver.F90: cleanup, instead of passing in convective_transportable_tracers array, only pass in the components required --- physics/cu_gf_driver.F90 | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 0c92f7af1..347f1ae6f 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -71,8 +71,6 @@ end subroutine cu_gf_driver_finalize !! \section arg_table_cu_gf_driver_run Argument Table !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |----------------|-----------------------------------------------------------|-----------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | tottracer | number_of_total_tracers | number of total tracers | count | 0 | integer | | in | F | -!! | ntrac | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | !! | garea | cell_area | grid cell area | m2 | 1 | real | kind_phys | in | F | !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | !! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | @@ -99,7 +97,8 @@ end subroutine cu_gf_driver_finalize !! | xland | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | !! | hfx2 | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | !! | qfx2 | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | clw | convective_transportable_tracers | cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | inout | F | +!! | cliw | ice_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | clcw | cloud_condensed_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of cloud water in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | inout | F | !! | pbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | in | F | !! | ud_mf | instantaneous_atmosphere_updraft_convective_mass_flux | (updraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | !! | dd_mf | instantaneous_atmosphere_downdraft_convective_mass_flux | (downdraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | @@ -112,11 +111,12 @@ end subroutine cu_gf_driver_finalize !! !>\section gen_gf_driver GSD GF Cumulus Scheme General Algorithm !> @{ - subroutine cu_gf_driver_run(tottracer,ntrac,garea,im,ix,km,dt,cactiv, & - forcet,forceqv_spechum,phil,raincv,qv_spechum,t,cld1d, & - us,vs,t2di,w,qv2di_spechum,p2di,psuri, & - hbot,htop,kcnv,xland,hfx2,qfx2,clw, & - pbl,ud_mf,dd_mf,dt_mf,cnvw_moist,cnvc,imfshalcnv,errmsg,errflg) + subroutine cu_gf_driver_run(garea,im,ix,km,dt,cactiv, & + forcet,forceqv_spechum,phil,raincv,qv_spechum,t,cld1d, & + us,vs,t2di,w,qv2di_spechum,p2di,psuri, & + hbot,htop,kcnv,xland,hfx2,qfx2,cliw,clcw, & + pbl,ud_mf,dd_mf,dt_mf,cnvw_moist,cnvc,imfshalcnv, & + errmsg,errflg) !------------------------------------------------------------- implicit none integer, parameter :: maxiens=1 @@ -137,7 +137,7 @@ subroutine cu_gf_driver_run(tottracer,ntrac,garea,im,ix,km,dt,cactiv, & integer :: ishallow_g3 ! depend on imfshalcnv !------------------------------------------------------------- integer :: its,ite, jts,jte, kts,kte - integer, intent(in ) :: im,ix,km,ntrac,tottracer + integer, intent(in ) :: im,ix,km real(kind=kind_phys), dimension( ix , km ), intent(in ) :: forcet,forceqv_spechum,w,phil real(kind=kind_phys), dimension( ix , km ), intent(inout ) :: t,us,vs @@ -145,7 +145,7 @@ subroutine cu_gf_driver_run(tottracer,ntrac,garea,im,ix,km,dt,cactiv, & real(kind=kind_phys), dimension( ix,4 ) :: rand_clos real(kind=kind_phys), dimension( ix , km, 11 ) :: gdc,gdc2 real(kind=kind_phys), dimension( ix , km ), intent(out ) :: cnvw_moist,cnvc - real(kind=kind_phys), dimension( ix , km,tottracer+2 ), intent(inout ) :: clw + real(kind=kind_phys), dimension( ix , km ), intent(inout ) :: cliw, clcw !hj change from ix to im integer, dimension (im), intent(inout) :: hbot,htop,kcnv @@ -260,10 +260,13 @@ subroutine cu_gf_driver_run(tottracer,ntrac,garea,im,ix,km,dt,cactiv, & rand_mom(:) = 0. rand_vmas(:) = 0. rand_clos(:,:) = 0. +! its=1 ite=im + itf=ite jts=1 jte=1 + jtf=jte kts=1 kte=km ktf=kte-1 @@ -307,9 +310,6 @@ subroutine cu_gf_driver_run(tottracer,ntrac,garea,im,ix,km,dt,cactiv, & iend=ite tcrit=258. - itf=ite - ktf=kte-1 - jtf=jte ztm=0. ztq=0. hfm=0. @@ -818,9 +818,9 @@ subroutine cu_gf_driver_run(tottracer,ntrac,garea,im,ix,km,dt,cactiv, & dsubclwm=0. dsubclws=0. dp=100.*(p2d(i,k)-p2d(i,k+1)) - if (clw(i,k,2) .gt. -999.0 .and. clw(i,k+1,2) .gt. -999.0 )then - clwtot = clw(i,k,1) + clw(i,k,2) - clwtot1= clw(i,k+1,1) + clw(i,k+1,2) + if (clcw(i,k) .gt. -999.0 .and. clcw(i,k+1) .gt. -999.0 )then + clwtot = cliw(i,k) + clcw(i,k) + clwtot1= cliw(i,k+1) + clcw(i,k+1) dsubclw=((-edt(i)*zd(i,k+1)+zu(i,k+1))*clwtot1 & -(-edt(i)*zd(i,k) +zu(i,k)) *clwtot )*g/dp dsubclwm=((-edtm(i)*zdm(i,k+1)+zum(i,k+1))*clwtot1 & @@ -835,11 +835,11 @@ subroutine cu_gf_driver_run(tottracer,ntrac,garea,im,ix,km,dt,cactiv, & ! +dsubclw*xmb(i)+dsubclws*xmbs(i)+dsubclwm*xmbm(i) & ) tem1 = max(0.0, min(1.0, (tcr-t(i,k))*tcrf)) - if (clw(i,k,2) .gt. -999.0) then - clw(i,k,1) = max(0.,clw(i,k,1) + tem * tem1) ! ice - clw(i,k,2) = max(0.,clw(i,k,2) + tem *(1.0-tem1)) ! water + if (clcw(i,k) .gt. -999.0) then + cliw(i,k) = max(0.,cliw(i,k) + tem * tem1) ! ice + clcw(i,k) = max(0.,clcw(i,k) + tem *(1.0-tem1)) ! water else - clw(i,k,1) = max(0.,clw(i,k,1) + tem) + cliw(i,k) = max(0.,cliw(i,k) + tem) endif enddo From 86ade1c392f0589890e2dbd90454c37a12232176 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Tue, 9 Jul 2019 10:28:56 -0600 Subject: [PATCH 30/89] physics/cu_ntiedtke.F90, physics/samfdeepcnv.f, physics/samfshalcnv.f: add notes to check dimensions of clw array --- physics/cu_ntiedtke.F90 | 4 ++++ physics/samfdeepcnv.f | 1 + physics/samfshalcnv.f | 1 + 3 files changed, 6 insertions(+) diff --git a/physics/cu_ntiedtke.F90 b/physics/cu_ntiedtke.F90 index 954c4a65f..dcce444e9 100644 --- a/physics/cu_ntiedtke.F90 +++ b/physics/cu_ntiedtke.F90 @@ -202,6 +202,10 @@ subroutine cu_ntiedtke_run(pu,pv,pt,pqv,pqvf,ptf,clw,poz,pzz,prsl,prsi,pomg, & real(kind=kind_phys), dimension( ix , km ), intent(inout) :: pu, pv, pt, pqv real(kind=kind_phys), dimension( ix , km ), intent(in ) :: poz, prsl, pomg, pqvf, ptf real(kind=kind_phys), dimension( ix , km+1 ), intent(in ) :: pzz, prsi + ! DH* TODO - check dimensions of clw, ktrac+2 seems to be smaller + ! than the actual dimensions (ok as long as only indices 1 and 2 + ! are accessed here, and as long as these contain what is expected); + ! better to expand into the cloud-ice and cloud-water components *DH real(kind=kind_phys), dimension( ix , km, ktrac+2 ), intent(inout ) :: clw integer, dimension( lq ), intent(out) :: kbot, ktop, kcnv diff --git a/physics/samfdeepcnv.f b/physics/samfdeepcnv.f index 0cd4468a0..d50071547 100644 --- a/physics/samfdeepcnv.f +++ b/physics/samfdeepcnv.f @@ -159,6 +159,7 @@ subroutine samfdeepcnv_run (im,ix,km,cliq,cp,cvap, & logical, intent(in) :: do_ca integer, intent(inout) :: kcnv(im) + ! DH* TODO - check dimensions of qtr, ntr+2 correct? *DH real(kind=kind_phys), intent(inout) :: qtr(ix,km,ntr+2), & & q1(ix,km), t1(ix,km), u1(ix,km), v1(ix,km), & & cnvw(ix,km), cnvc(ix,km) diff --git a/physics/samfshalcnv.f b/physics/samfshalcnv.f index 24f56d1cd..b6fb2cb33 100644 --- a/physics/samfshalcnv.f +++ b/physics/samfshalcnv.f @@ -116,6 +116,7 @@ subroutine samfshalcnv_run(im,ix,km,cliq,cp,cvap, & & prslp(ix,km), garea(im), hpbl(im), dot(ix,km), phil(ix,km) ! integer, intent(inout) :: kcnv(im) + ! DH* TODO - check dimensions of qtr, ntr+2 correct? *DH real(kind=kind_phys), intent(inout) :: qtr(ix,km,ntr+2), & & q1(ix,km), t1(ix,km), u1(ix,km), v1(ix,km) ! From 1d8cb0bed9776961a87016c21151b4bf0ce06a20 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Tue, 9 Jul 2019 10:29:55 -0600 Subject: [PATCH 31/89] physics/module_mp_thompson.F90, physics/mp_thompson.F90: cleanup, return with an error if CCN_ACTIVATE.BIN is not found, remove temporary stopping of model --- physics/module_mp_thompson.F90 | 26 ++++++++++++-------------- physics/mp_thompson.F90 | 4 ++-- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index 66f2bfa44..f1b462b1e 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -414,7 +414,8 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & its, ite, jts, jte, kts, kte, & - mpicomm, mpirank, mpiroot, threads) + mpicomm, mpirank, mpiroot, & + threads, errmsg, errflg) IMPLICIT NONE @@ -428,6 +429,8 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & REAL, DIMENSION(ims:ime,jms:jme), OPTIONAL, INTENT(IN) :: nwfa2d, nifa2d INTEGER, INTENT(IN) :: mpicomm, mpirank, mpiroot INTEGER, INTENT(IN) :: threads + CHARACTER(len=*), INTENT(INOUT) :: errmsg + INTEGER, INTENT(INOUT) :: errflg INTEGER:: i, j, k, l, m, n @@ -881,7 +884,8 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & ! doing it always ensures that the correct data is in the SIONlib ! file containing the precomputed tables *DH WRITE (*,*) ' calling table_ccnAct routine' - call table_ccnAct + call table_ccnAct(errmsg,errflg) + if (.not. errflg==0) return !> - Call table_efrw() and table_efsw() to creat collision efficiency table !! between rain/snow and cloud water @@ -4613,15 +4617,17 @@ end subroutine table_dropEvap !! vertical velocity, temperature, lognormal mean aerosol radius, and !! hygroscopicity, kappa. The data are read from external file and !! contain activated fraction of CCN for given conditions. - subroutine table_ccnAct + subroutine table_ccnAct(errmess,errflag) implicit none +!..Error handling variables + CHARACTER(len=*), INTENT(INOUT) :: errmess + INTEGER, INTENT(INOUT) :: errflag !..Local variables INTEGER:: iunit_mp_th1, i LOGICAL:: opened - CHARACTER*64 errmess iunit_mp_th1 = -1 DO i = 20,99 @@ -4649,19 +4655,11 @@ subroutine table_ccnAct RETURN 9009 CONTINUE WRITE( errmess , '(A,I2)' ) 'module_mp_thompson: error opening CCN_ACTIVATE.BIN on unit ',iunit_mp_th1 - write(0,*) errmess - ! DH* TEMPORARY FIX 20181203 - call sleep(5) - stop - ! *DH + errflag = 1 RETURN 9010 CONTINUE WRITE( errmess , '(A,I2)' ) 'module_mp_thompson: error reading CCN_ACTIVATE.BIN on unit ',iunit_mp_th1 - write(0,*) errmess - ! DH* TEMPORARY FIX 20181203 - call sleep(5) - stop - ! *DH + errflag = 1 RETURN end subroutine table_ccnAct diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index 86727aea7..5fc7d5722 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -124,7 +124,7 @@ subroutine mp_thompson_init(ncol, nlev, is_aerosol_aware, & ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, & its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, & mpicomm=mpicomm, mpirank=mpirank, mpiroot=mpiroot, & - threads=threads) + threads=threads, errmsg=errmsg, errflg=errflg) if (errflg /= 0) return else if (is_aerosol_aware) then write(errmsg,fmt='(*(a))') 'Logic error in mp_thompson_init:', & @@ -137,7 +137,7 @@ subroutine mp_thompson_init(ncol, nlev, is_aerosol_aware, & ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, & its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, & mpicomm=mpicomm, mpirank=mpirank, mpiroot=mpiroot, & - threads=threads) + threads=threads, errmsg=errmsg, errflg=errflg) if (errflg /= 0) return end if From 564479dfed9d6c4dc664312c9779eec3dfcc508c Mon Sep 17 00:00:00 2001 From: climbfuji Date: Tue, 16 Jul 2019 15:02:55 -0600 Subject: [PATCH 32/89] Update CODEOWNERS to GSD team --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index d7c3658fd..181a9d458 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -3,7 +3,7 @@ # These owners will be the default owners for everything in the repo. #* @defunkt -* @climbfuji @llpcarson @grantfirl +* @climbfuji @tanyasmirnova @haiqinli @joeolson42 # Order is important. The last matching pattern has the most precedence. # So if a pull request only touches javascript files, only these owners From 5cc39ad4e22524ca3cd287688545249caa432b3f Mon Sep 17 00:00:00 2001 From: climbfuji Date: Wed, 17 Jul 2019 14:15:09 -0600 Subject: [PATCH 33/89] Remove option to turn off make_number_concentrations (use it as only option) --- physics/docs/pdftxt/GSD_adv_suite.txt | 1 - physics/docs/pdftxt/suite_input.nml.txt | 1 - physics/mp_thompson_pre.F90 | 36 +++++++------------------ 3 files changed, 9 insertions(+), 29 deletions(-) diff --git a/physics/docs/pdftxt/GSD_adv_suite.txt b/physics/docs/pdftxt/GSD_adv_suite.txt index 0db91ede1..f77190a31 100644 --- a/physics/docs/pdftxt/GSD_adv_suite.txt +++ b/physics/docs/pdftxt/GSD_adv_suite.txt @@ -144,7 +144,6 @@ The GSD RAP/HRRR physics suite uses the parameterizations in the following order ltaerosol = .true. lradar = .true. ttendlim = -999. - make_number_concentrations = .true. pdfcld = .false. fhswr = 3600. fhlwr = 3600. diff --git a/physics/docs/pdftxt/suite_input.nml.txt b/physics/docs/pdftxt/suite_input.nml.txt index bc904bfac..b6cd62c0c 100644 --- a/physics/docs/pdftxt/suite_input.nml.txt +++ b/physics/docs/pdftxt/suite_input.nml.txt @@ -279,7 +279,6 @@ and how stochastic perturbations are used in the Noah Land Surface Model.
    iccn gfs_control_type flag for using IN and CCN forcing in MG2/3 microphysics .false.
    rhcmax gfs_control_type maximum critical relative humidity 0.9999999
    \b Parameters \b Specific \b to \b GSD_v0 \b Suite -
    make_number_concentrations gfs_control_type flag to calculate initial number concentrations from mass concentrations if not in ICs/BCs .false.
    ltaerosol gfs_control_type logical flag for using aerosol climotology in Thompson MP scheme .false.
    lradar gfs_control_type logical flag for computing radar reflectivity in Thompson MP scheme .false.
    ttendlim gfs_control_type temperature tendency limiter per time step in K/s, set to < 0 to deactivate -999.0 diff --git a/physics/mp_thompson_pre.F90 b/physics/mp_thompson_pre.F90 index 51f621fc9..44fe4714e 100644 --- a/physics/mp_thompson_pre.F90 +++ b/physics/mp_thompson_pre.F90 @@ -39,7 +39,6 @@ end subroutine mp_thompson_pre_init !! | qg | graupel_mixing_ratio_updated_by_physics | graupel mixing ratio wrt dry+vapor (no condensates) | kg kg-1 | 2 | real | kind_phys | inout | F | !! | ni | ice_number_concentration_updated_by_physics | ice number concentration | kg-1 | 2 | real | kind_phys | inout | F | !! | nr | rain_number_concentration_updated_by_physics | rain number concentration | kg-1 | 2 | real | kind_phys | inout | F | -!! | make_number_concentrations | flag_for_initial_number_concentration_calculation | flag for initial number concentration calculation | flag | 0 | logical | | in | F | !! | is_aerosol_aware| flag_for_aerosol_physics | flag for aerosol-aware physics | flag | 0 | logical | | in | F | !! | nc | cloud_droplet_number_concentration_updated_by_physics | cloud droplet number concentration | kg-1 | 2 | real | kind_phys | inout | T | !! | nwfa | water_friendly_aerosol_number_concentration_updated_by_physics | number concentration of water-friendly aerosols | kg-1 | 2 | real | kind_phys | inout | T | @@ -60,7 +59,6 @@ end subroutine mp_thompson_pre_init #endif subroutine mp_thompson_pre_run(ncol, nlev, kdt, con_g, con_rd, & spechum, qc, qr, qi, qs, qg, ni, nr, & - make_number_concentrations, & is_aerosol_aware, nc, nwfa, nifa, nwfa2d, & nifa2d, tgrs, tgrs_save, prsl, phil, area, & mpirank, mpiroot, blkno, errmsg, errflg) @@ -83,7 +81,6 @@ subroutine mp_thompson_pre_run(ncol, nlev, kdt, con_g, con_rd, & real(kind_phys), intent(inout) :: qg(1:ncol,1:nlev) real(kind_phys), intent(inout) :: ni(1:ncol,1:nlev) real(kind_phys), intent(inout) :: nr(1:ncol,1:nlev) - logical, intent(in ) :: make_number_concentrations ! Aerosols logical, intent(in ) :: is_aerosol_aware real(kind_phys), optional, intent(inout) :: nc(1:ncol,1:nlev) @@ -169,27 +166,17 @@ subroutine mp_thompson_pre_run(ncol, nlev, kdt, con_g, con_rd, & ! they also need to be switched back to mass/number per kg of air, because ! what is returned by the functions is in units of number per cubic meter. - if (make_number_concentrations) then - ! If qi is in boundary conditions but ni is not, calculate ni from qi, rho and tgrs - if (maxval(qi)>0.0 .and. maxval(ni)==0.0) then - ni = make_IceNumber(qi*rho, tgrs) * orho - end if - else - ! If qi is in boundary conditions but ni is not, reset qi to zero - if (maxval(qi)>0.0 .and. maxval(ni)==0.0) qi = 0.0 + ! If qi is in boundary conditions but ni is not, calculate ni from qi, rho and tgrs + if (maxval(qi)>0.0 .and. maxval(ni)==0.0) then + ni = make_IceNumber(qi*rho, tgrs) * orho end if ! If ni is in boundary conditions but qi is not, reset ni to zero if (maxval(ni)>0.0 .and. maxval(qi)==0.0) ni = 0.0 - if (make_number_concentrations) then - ! If qr is in boundary conditions but nr is not, calculate nr from qr, rho and tgrs - if (maxval(qr)>0.0 .and. maxval(nr)==0.0) then - nr = make_RainNumber(qr*rho, tgrs) * orho - end if - else - ! If qr is in boundary conditions but nr is not, reset qr to zero - if (maxval(qr)>0.0 .and. maxval(nr)==0.0) qr = 0.0 + ! If qr is in boundary conditions but nr is not, calculate nr from qr, rho and tgrs + if (maxval(qr)>0.0 .and. maxval(nr)==0.0) then + nr = make_RainNumber(qr*rho, tgrs) * orho end if ! If nr is in boundary conditions but qr is not, reset nr to zero @@ -298,14 +285,9 @@ subroutine mp_thompson_pre_run(ncol, nlev, kdt, con_g, con_rd, & endif endif - if (make_number_concentrations) then - ! If qc is in boundary conditions but nc is not, calculate nc from qc, rho and nwfa - if (maxval(qc)>0.0 .and. maxval(nc)==0.0) then - nc = make_DropletNumber(qc*rho, nwfa) * orho - end if - else - ! If qc is in boundary conditions but nc is not, reset qc to zero - if (maxval(qc)>0.0 .and. maxval(nc)==0.0) qc = 0.0 + ! If qc is in boundary conditions but nc is not, calculate nc from qc, rho and nwfa + if (maxval(qc)>0.0 .and. maxval(nc)==0.0) then + nc = make_DropletNumber(qc*rho, nwfa) * orho end if ! If nc is in boundary conditions but qc is not, reset nc to zero From 7e8c166b7cf65c96e46a0144f55ac73eff71560c Mon Sep 17 00:00:00 2001 From: climbfuji Date: Thu, 18 Jul 2019 10:43:57 -0600 Subject: [PATCH 34/89] Update CODEOWNERS to enable branch protection --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index 181a9d458..c5dc4caf7 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -3,7 +3,7 @@ # These owners will be the default owners for everything in the repo. #* @defunkt -* @climbfuji @tanyasmirnova @haiqinli @joeolson42 +* @climbfuji # Order is important. The last matching pattern has the most precedence. # So if a pull request only touches javascript files, only these owners From 7111e220603ba2693d6f6b79ee8aa7b222648dab Mon Sep 17 00:00:00 2001 From: climbfuji Date: Thu, 18 Jul 2019 21:19:20 -0600 Subject: [PATCH 35/89] Add bugfix for surface fluxes, but do not use them (guard with CPP directive) --- physics/sfc_diag.f | 4 ++++ physics/sfc_diff.f | 21 ++++++++++++++++++--- physics/sfc_nst.f | 26 +++++++++++++++++++++++--- physics/sfc_sice.f | 25 ++++++++++++++++++++++--- 4 files changed, 67 insertions(+), 9 deletions(-) diff --git a/physics/sfc_diag.f b/physics/sfc_diag.f index 7200e9231..4c8b90e0d 100644 --- a/physics/sfc_diag.f +++ b/physics/sfc_diag.f @@ -100,7 +100,11 @@ subroutine sfc_diag_run & ! t2m(i) = t2m(i) * sig2k wrk = 1.0 - fhi +#ifdef GSD_SURFACE_FLUXES_BUGFIX + t2m(i) = tskin(i)*wrk + t1(i)*fhi - (grav+grav)/cp +#else t2m(i) = tskin(i)*wrk + t1(i)*prslki(i)*fhi - (grav+grav)/cp +#endif if(evap(i) >= 0.) then ! for evaporation>0, use inferred qsurf to deduce q2m q2m(i) = qsurf(i)*wrk + max(qmin,q1(i))*fhi diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 7757dd3c9..b59ed1be2 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -47,6 +47,8 @@ end subroutine sfc_diff_finalize !! | z1 | height_above_ground_at_lowest_model_layer | height above ground at 1st model layer | m | 1 | real | kind_phys | in | F | !! | prsl1 | air_pressure_at_lowest_model_layer | Model layer 1 mean pressure | Pa | 1 | real | kind_phys | in | F | !! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | +!! | prsik1 | dimensionless_exner_function_at_lowest_model_interface | dimensionless Exner function at the ground surface | none | 1 | real | kind_phys | none | F | +!! | prslk1 | dimensionless_exner_function_at_lowest_model_layer | dimensionless Exner function at the lowest model layer | none | 1 | real | kind_phys | none | F | !! | ddvel | surface_wind_enhancement_due_to_convection | surface wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | !! | sigmaf | bounded_vegetation_area_fraction | areal fractional cover of green vegetation bounded on the bottom | frac | 1 | real | kind_phys | in | F | !! | vegtype | vegetation_type_classification | vegetation type at each grid cell | index | 1 | integer | | in | F | @@ -130,7 +132,7 @@ end subroutine sfc_diff_finalize !! subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) & ps,u1,v1,t1,q1,z1, & !intent(in) - & prsl1,prslki,ddvel, & !intent(in) + & prsl1,prslki,prsik1,prslk1,ddvel, & !intent(in) & sigmaf,vegtype,shdmax,ivegsrc, & !intent(in) & z0pert,ztpert, & ! mg, sfc-perts !intent(in) & flag_iter,redrag, & !intent(in) @@ -151,6 +153,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) & wind , & !intent(inout) & errmsg, errflg) !intent(out) ! +! DH* 20190718: prslki can be removed if GSD_SURFACE_FLUXES_BUGFIX is adopted use funcphys, only : fpvs implicit none @@ -163,8 +166,8 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) real(kind=kind_phys), intent(in) :: rvrdm1, eps, epsm1, grav real(kind=kind_phys), dimension(im), intent(in) :: & - & ps,u1,v1,t1,q1,z1,prsl1,prslki,ddvel, & - & sigmaf,shdmax, & + & ps,u1,v1,t1,q1,z1,prsl1,prslki,prsik1,prslk1, & + & ddvel, sigmaf,shdmax, & & z0pert,ztpert ! mg, sfc-perts real(kind=kind_phys), dimension(im), intent(in) :: & & tskin_ocn, tskin_lnd, tskin_ice, & @@ -234,10 +237,17 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) wind(i) = max(sqrt(u1(i)*u1(i) + v1(i)*v1(i)) & + max(0.0, min(ddvel(i), 30.0)), 1.0) tem1 = 1.0 + rvrdm1 * max(q1(i),1.e-8) +#ifdef GSD_SURFACE_FLUXES_BUGFIX + thv1 = t1(i) / prslk1(i) * tem1 + tvs_lnd = 0.5 * (tsurf_lnd(i)+tskin_lnd(i))/prsik1(i) * tem1 + tvs_ice = 0.5 * (tsurf_ice(i)+tskin_ice(i))/prsik1(i) * tem1 + tvs_ocn = 0.5 * (tsurf_ocn(i)+tskin_ocn(i))/prsik1(i) * tem1 +#else thv1 = t1(i) * prslki(i) * tem1 tvs_lnd = 0.5 * (tsurf_lnd(i)+tskin_lnd(i)) * tem1 tvs_ice = 0.5 * (tsurf_ice(i)+tskin_ice(i)) * tem1 tvs_ocn = 0.5 * (tsurf_ocn(i)+tskin_ocn(i)) * tem1 +#endif qs1 = fpvs(t1(i)) qs1 = max(1.0e-8, eps * qs1 / (prsl1(i) + epsm1 * qs1)) @@ -447,8 +457,13 @@ subroutine stability & dtv = thv1 - tvs adtv = max(abs(dtv),0.001) dtv = sign(1.,dtv) * adtv +#ifdef GSD_SURFACE_FLUXES_BUGFIX + rb = max(-5000.0, grav * dtv * z1 + & / (thv1 * wind * wind)) +#else rb = max(-5000.0, (grav+grav) * dtv * z1 & / ((thv1 + tvs) * wind * wind)) +#endif tem1 = 1.0 / z0max tem2 = 1.0 / ztmax fm = log((z0max+z1) * tem1) diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f index 5246411e2..3dc3b56aa 100644 --- a/physics/sfc_nst.f +++ b/physics/sfc_nst.f @@ -48,6 +48,8 @@ end subroutine sfc_nst_finalize !! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ocean | surface exchange coeff heat & moisture over ocean | none | 1 | real | kind_phys | in | F | !! | prsl1 | air_pressure_at_lowest_model_layer | surface layer mean pressure | Pa | 1 | real | kind_phys | in | F | !! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | +!! | prsik1 | dimensionless_exner_function_at_lowest_model_interface | dimensionless Exner function at the ground surface | none | 1 | real | kind_phys | none | F | +!! | prslk1 | dimensionless_exner_function_at_lowest_model_layer | dimensionless Exner function at the lowest model layer | none | 1 | real | kind_phys | none | F | !! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | !! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | !! | xlon | longitude | longitude | radians | 1 | real | kind_phys | in | F | @@ -103,7 +105,8 @@ end subroutine sfc_nst_finalize subroutine sfc_nst_run & & ( im, hvap, cp, hfus, jcal, eps, epsm1, rvrdm1, rd, rhw0, & & pi, sbc, ps, u1, v1, t1, q1, tref, cm, ch, & - & prsl1, prslki, wet, icy, xlon, sinlat, stress, & + & prsl1, prslki, prsik1, prslk1, wet, icy, xlon, sinlat, & + & stress, & & sfcemis, dlwflx, sfcnsw, rain, timestep, kdt, solhr,xcosz, & & ddvel, flag_iter, flag_guess, nstf_name1, nstf_name4, & & nstf_name5, lprnt, ipr, & ! inputs from here and above @@ -112,6 +115,7 @@ subroutine sfc_nst_run & & qsurf, gflux, cmm, chh, evap, hflx, ep, errmsg, errflg & ! outputs & ) +! DH* 20190718: prslki can be removed if GSD_SURFACE_FLUXES_BUGFIX is adopted ! ===================================================================== ! ! description: ! ! ! @@ -121,7 +125,8 @@ subroutine sfc_nst_run & ! call sfc_nst ! ! inputs: ! ! ( im, ps, u1, v1, t1, q1, tref, cm, ch, ! -! prsl1, prslki, iwet, iice, xlon, sinlat, stress, ! +! prsl1, prslki, prsik1, prslk1, iwet, iice, xlon, sinlat, ! +! stress, ! ! sfcemis, dlwflx, sfcnsw, rain, timestep, kdt,solhr,xcosz, ! ! ddvel, flag_iter, flag_guess, nstf_name1, nstf_name4, ! ! nstf_name5, lprnt, ipr, ! @@ -165,6 +170,8 @@ subroutine sfc_nst_run & ! ch - real, surface exchange coeff heat & moisture(m/s) im ! ! prsl1 - real, surface layer mean pressure (pa) im ! ! prslki - real, im ! +! prsik1 - real, im ! +! prslk1 - real, im ! ! wet - logical, =T if any ocn/lake water (F otherwise) im ! ! icy - logical, =T if any ice im ! ! xlon - real, longitude (radians) im ! @@ -262,7 +269,8 @@ subroutine sfc_nst_run & real (kind=kind_phys), intent(in) :: hvap, cp, hfus, jcal, eps, & & epsm1, rvrdm1, rd, rhw0, sbc, pi real (kind=kind_phys), dimension(im), intent(in) :: ps, u1, v1, & - & t1, q1, tref, cm, ch, prsl1, prslki, xlon,xcosz, & + & t1, q1, tref, cm, ch, prsl1, prslki, prsik1, prslk1, & + & xlon,xcosz, & & sinlat, stress, sfcemis, dlwflx, sfcnsw, rain, ddvel real (kind=kind_phys), intent(in) :: timestep real (kind=kind_phys), intent(in) :: solhr @@ -368,7 +376,11 @@ subroutine sfc_nst_run & wind(i) = max( wind(i), 1.0 ) q0(i) = max(q1(i), 1.0e-8) +#ifdef GSD_SURFACE_FLUXES_BUGFIX + theta1(i) = t1(i) / prslk1(i) ! potential temperature at the middle of lowest model layer +#else theta1(i) = t1(i) * prslki(i) +#endif tv1(i) = t1(i) * (1.0 + rvrdm1*q0(i)) rho_a(i) = prsl1(i) / (rd*tv1(i)) qss(i) = fpvs(tsurf(i)) ! pa @@ -389,7 +401,11 @@ subroutine sfc_nst_run & ! at previous time step evap(i) = elocp * rch(i) * (qss(i) - q0(i)) qsurf(i) = qss(i) +#ifdef GSD_SURFACE_FLUXES_BUGFIX + hflx(i) = rch(i) * (tsurf(i)/prsik1(i) - theta1(i)) +#else hflx(i) = rch(i) * (tsurf(i) - theta1(i)) +#endif ! if (lprnt .and. i == ipr) print *,' tskin=',tskin(i),' theta1=', ! & theta1(i),' hflx=',hflx(i),' t1=',t1(i),'prslki=',prslki(i) @@ -683,7 +699,11 @@ subroutine sfc_nst_run & qss(i) = eps*qss(i) / (ps(i) + epsm1*qss(i)) qsurf(i) = qss(i) evap(i) = elocp*rch(i) * (qss(i) - q0(i)) +#ifdef GSD_SURFACE_FLUXES_BUGFIX + hflx(i) = rch(i) * (tskin(i)/prsik1(i) - theta1(i)) +#else hflx(i) = rch(i) * (tskin(i) - theta1(i)) +#endif endif enddo endif ! if ( nstf_name1 > 1 ) then diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index fbc14587a..2f31ee918 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -45,6 +45,8 @@ end subroutine sfc_sice_finalize !! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice | surface exchange coeff heat & moisture over ice | none | 1 | real | kind_phys | in | F | !! | prsl1 | air_pressure_at_lowest_model_layer | surface layer mean pressure | Pa | 1 | real | kind_phys | in | F | !! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | +!! | prsik1 | dimensionless_exner_function_at_lowest_model_interface | dimensionless Exner function at the ground surface | none | 1 | real | kind_phys | none | F | +!! | prslk1 | dimensionless_exner_function_at_lowest_model_layer | dimensionless Exner function at the lowest model layer | none | 1 | real | kind_phys | none | F | !! | islimsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | in | F | !! | ddvel | surface_wind_enhancement_due_to_convection | wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | !! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | @@ -95,13 +97,14 @@ subroutine sfc_sice_run & & ( im, km, sbc, hvap, tgice, cp, eps, epsm1, rvrdm1, grav, & ! --- inputs: & t0c, rd, cimin, ps, u1, v1, t1, q1, delt, & & sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, & - & cm, ch, prsl1, prslki, islimsk, ddvel, & + & cm, ch, prsl1, prslki, prsik1, prslk1, islimsk, ddvel, & & flag_iter, lprnt, ipr, & & hice, fice, tice, weasd, tskin, tprcp, stc, ep, & ! --- input/outputs: & snwdph, qsurf, snowmt, gflux, cmm, chh, evap, hflx, & ! --- outputs: & errmsg, errflg & ) +! DH* 20190718: prslki can be removed if GSD_SURFACE_FLUXES_BUGFIX is adopted ! ===================================================================== ! ! description: ! ! ! @@ -111,7 +114,7 @@ subroutine sfc_sice_run & ! inputs: ! ! ( im, km, ps, u1, v1, t1, q1, delt, ! ! sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, ! -! cm, ch, prsl1, prslki, islimsk, ddvel, ! +! cm, ch, prsl1, prslki, prsik1, prslk1, islimsk, ddvel, ! ! flag_iter, ! ! input/outputs: ! ! hice, fice, tice, weasd, tskin, tprcp, stc, ep, ! @@ -156,6 +159,8 @@ subroutine sfc_sice_run & ! ch - real, surface exchange coeff heat & moisture(m/s) im ! ! prsl1 - real, surface layer mean pressure im ! ! prslki - real, im ! +! prsik1 - real, im ! +! prslk1 - real, im ! ! islimsk - integer, sea/land/ice mask (=0/1/2) im ! ! ddvel - real, im ! ! flag_iter- logical, im ! @@ -206,7 +211,7 @@ subroutine sfc_sice_run & real (kind=kind_phys), dimension(im), intent(in) :: ps, u1, v1, & & t1, q1, sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, cm, ch, & - & prsl1, prslki, ddvel + & prsl1, prslki, prsik1, prslk1, ddvel integer, dimension(im), intent(in) :: islimsk real (kind=kind_phys), intent(in) :: delt @@ -299,7 +304,11 @@ subroutine sfc_sice_run & q0 = max(q1(i), 1.0e-8) ! tsurf(i) = tskin(i) +#ifdef GSD_SURFACE_FLUXES_BUGFIX + theta1(i) = t1(i) / prslk1(i) ! potential temperature in middle of lowest atm. layer +#else theta1(i) = t1(i) * prslki(i) +#endif rho(i) = prsl1(i) / (rd*t1(i)*(one+rvrdm1*q0)) qs1 = fpvs(t1(i)) qs1 = max(eps*qs1 / (prsl1(i) + epsm1*qs1), 1.e-8) @@ -351,8 +360,13 @@ subroutine sfc_sice_run & !> - Calculate net non-solar and upir heat flux @ ice surface \a hfi. +#ifdef GSD_SURFACE_FLUXES_BUGFIX + hfi(i) = -dlwflx(i) + sfcemis(i)*sbc*t14 + evapi(i) & + & + rch(i)*(tice(i)/prsik1(i) - theta1(i)) +#else hfi(i) = -dlwflx(i) + sfcemis(i)*sbc*t14 + evapi(i) & & + rch(i)*(tice(i) - theta1(i)) +#endif !> - Calculate heat flux derivative at surface \a hfd. hfd(i) = 4.0d0*sfcemis(i)*sbc*tice(i)*t12 & & + (one + elocp*eps*hvap*qs1/(rd*t12)) * rch(i) @@ -428,8 +442,13 @@ subroutine sfc_sice_run & if (flag(i)) then ! --- ... calculate sensible heat flux (& evap over sea ice) +#ifdef GSD_SURFACE_FLUXES_BUGFIX + hflxi = rch(i) * (tice(i)/prsik1(i) - theta1(i)) + hflxw = rch(i) * (tgice / prsik1(i) - theta1(i)) +#else hflxi = rch(i) * (tice(i) - theta1(i)) hflxw = rch(i) * (tgice - theta1(i)) +#endif hflx(i) = fice(i)*hflxi + ffw(i)*hflxw evap(i) = fice(i)*evapi(i) + ffw(i)*evapw(i) ! From ffff91b30bb584174f4c248e25349ca1893df129 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Thu, 18 Jul 2019 21:24:28 -0600 Subject: [PATCH 36/89] physics/lsm_ruc_sfc_sice_interstitial.F90 physics/sfc_drv_ruc.F90: add support for coldstarting from either Noah LSM or RUC LSM data, temporary interstitial scheme to update Noah-LSM surface fields used by sfc_sice --- physics/lsm_ruc_sfc_sice_interstitial.F90 | 131 +++++++++++ physics/sfc_drv_ruc.F90 | 252 +++++++++++----------- 2 files changed, 261 insertions(+), 122 deletions(-) create mode 100644 physics/lsm_ruc_sfc_sice_interstitial.F90 diff --git a/physics/lsm_ruc_sfc_sice_interstitial.F90 b/physics/lsm_ruc_sfc_sice_interstitial.F90 new file mode 100644 index 000000000..b051b08c2 --- /dev/null +++ b/physics/lsm_ruc_sfc_sice_interstitial.F90 @@ -0,0 +1,131 @@ +module lsm_ruc_sfc_sice_pre + + use machine, only: kind_phys + + implicit none + + private + + public :: lsm_ruc_sfc_sice_pre_init, lsm_ruc_sfc_sice_pre_run, lsm_ruc_sfc_sice_pre_finalize + +contains + + subroutine lsm_ruc_sfc_sice_pre_init () + end subroutine lsm_ruc_sfc_sice_pre_init + + subroutine lsm_ruc_sfc_sice_pre_finalize () + end subroutine lsm_ruc_sfc_sice_pre_finalize + +#if 0 +!> \section arg_table_lsm_ruc_sfc_sice_pre_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | lsoil_ruc | soil_vertical_dimension_for_land_surface_model | number of soil layers internal to land surface model | count | 0 | integer | | in | F | +!! | lsoil | soil_vertical_dimension | soil vertical layer dimension | count | 0 | integer | | in | F | +!! | land | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | +!! | stc | soil_temperature | soil temperature | K | 2 | real | kind_phys | inout | F | +!! | tslb | soil_temperature_for_land_surface_model | soil temperature for land surface model | K | 2 | real | kind_phys | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +#endif + subroutine lsm_ruc_sfc_sice_pre_run(im, lsoil_ruc, lsoil, land, stc, tslb, errmsg, errflg) + + implicit none + + ! Interface variables + integer, intent(in) :: im, lsoil_ruc, lsoil + logical, dimension(im), intent(in) :: land +! --- on Noah levels + real (kind=kind_phys), dimension(im,lsoil), intent(inout) :: stc +! --- on RUC levels + real (kind=kind_phys), dimension(im,lsoil_ruc), intent(in) :: tslb + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Local variables + integer :: i, k + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + do i=1,im + if (.not.land(i)) then + do k=1,min(lsoil,lsoil_ruc) + stc(i,k) = tslb(i,k) + end do + end if + end do + + end subroutine lsm_ruc_sfc_sice_pre_run + +end module lsm_ruc_sfc_sice_pre + +module lsm_ruc_sfc_sice_post + + use machine, only: kind_phys + + implicit none + + private + + public :: lsm_ruc_sfc_sice_post_init, lsm_ruc_sfc_sice_post_run, lsm_ruc_sfc_sice_post_finalize + +contains + + subroutine lsm_ruc_sfc_sice_post_init () + end subroutine lsm_ruc_sfc_sice_post_init + + subroutine lsm_ruc_sfc_sice_post_finalize () + end subroutine lsm_ruc_sfc_sice_post_finalize + +#if 0 +!> \section arg_table_lsm_ruc_sfc_sice_post_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | lsoil_ruc | soil_vertical_dimension_for_land_surface_model | number of soil layers internal to land surface model | count | 0 | integer | | in | F | +!! | lsoil | soil_vertical_dimension | soil vertical layer dimension | count | 0 | integer | | in | F | +!! | land | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | +!! | stc | soil_temperature | soil temperature | K | 2 | real | kind_phys | in | F | +!! | tslb | soil_temperature_for_land_surface_model | soil temperature for land surface model | K | 2 | real | kind_phys | inout | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +#endif + subroutine lsm_ruc_sfc_sice_post_run(im, lsoil_ruc, lsoil, land, stc, tslb, errmsg, errflg) + + implicit none + + ! Interface variables + integer, intent(in) :: im, lsoil_ruc, lsoil + logical, dimension(im), intent(in) :: land +! --- on Noah levels + real (kind=kind_phys), dimension(im,lsoil), intent(in) :: stc +! --- on RUC levels + real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: tslb + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Local variables + integer :: i, k + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + do i=1,im + if (.not.land(i)) then + do k=1,min(lsoil,lsoil_ruc) + tslb(i,k) = stc(i,k) + end do + end if + end do + + end subroutine lsm_ruc_sfc_sice_post_run + +end module lsm_ruc_sfc_sice_post \ No newline at end of file diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index 8316aba4d..5e4f37d34 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -96,7 +96,6 @@ end subroutine lsm_ruc_finalize ! prsl1 - real, sfc layer 1 mean pressure (pa) im ! ! prslki - real, dimensionless exner function at layer 1 im ! ! zf - real, height of bottom layer (m) im ! -! islmsk - integer, sea/land/ice mask (=0/1/2) im ! ! slopetyp - integer, class of sfc slope (integer index) im ! ! shdmin - real, min fractional coverage of green veg im ! ! shdmax - real, max fractnl cover of green veg (not used) im ! @@ -160,7 +159,6 @@ end subroutine lsm_ruc_finalize !! | lsoil_ruc | soil_vertical_dimension_for_land_surface_model | number of soil layers internal to land surface model | count | 0 | integer | | in | F | !! | lsoil | soil_vertical_dimension | soil vertical layer dimension | count | 0 | integer | | in | F | !! | zs | depth_of_soil_levels_for_land_surface_model | depth of soil levels for land surface model | m | 1 | real | kind_phys | inout | F | -!! | islmsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | !! | con_cp | specific_heat_of_dry_air_at_constant_pressure | specific heat !of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | !! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | !! | con_pi | pi | ratio of a circle's circumference to its diameter | radians | 0 | real | kind_phys | in | F | @@ -226,6 +224,7 @@ end subroutine lsm_ruc_finalize !! | tslb | soil_temperature_for_land_surface_model | soil temperature for land surface model | K | 2 | real | kind_phys | inout | F | !! | stm | soil_moisture_content | soil moisture content | kg m-2 | 1 | real | kind_phys | inout | F | !! | tskin | surface_skin_temperature_over_land_interstitial | surface skin temperature over land use as interstitial | K | 1 | real | kind_phys | inout | F | +!! | tskin_ocn | surface_skin_temperature_over_ocean_interstitial | surface skin temperature over ocean (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | !! | tsurf | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | inout | F | !! | tice | sea_ice_temperature_interstitial | sea ice surface skin temperature use as interstitial | K | 1 | real | kind_phys | inout | F | !! | tsnow | snow_temperature_bottom_first_layer | snow temperature at the bottom of first snow layer | K | 1 | real | kind_phys | inout | F | @@ -258,13 +257,13 @@ subroutine lsm_ruc_run & ! inputs & ( iter, me, kdt, im, nlev, lsoil_ruc, lsoil, zs, & & u1, v1, t1, q1, qc, soiltyp, vegtype, sigmaf, & & sfcemis, dlwflx, dswsfc, snet, delt, tg3, cm, ch, & - & prsl1, zf, islmsk, ddvel, shdmin, shdmax, alvwf, alnwf, & + & prsl1, zf, ddvel, shdmin, shdmax, alvwf, alnwf, & & snoalb, sfalb, flag_iter, flag_guess, isot, ivegsrc, fice, & & smc, stc, slc, lsm_ruc, lsm, land, & & imp_physics, imp_physics_gfdl, imp_physics_thompson, & & smcwlt2, smcref2, wspd, do_mynnsfclay, & - & con_cp, con_rv, con_rd, con_g, con_pi, con_hvap, con_fvirt,& ! constants - & weasd, snwdph, tskin, & ! in/outs + & con_cp, con_rv, con_rd, con_g, con_pi, con_hvap, con_fvirt,& ! constants + & weasd, snwdph, tskin, tskin_ocn, & ! in/outs & rainnc, rainc, ice, snow, graupel, & ! in & srflag, smois, tslb, sh2o, keepfr, smfrkeep, & ! in/outs, on RUC levels & canopy, trans, tsurf, tsnow, zorl, & @@ -295,7 +294,6 @@ subroutine lsm_ruc_run & ! inputs & ch, prsl1, ddvel, shdmin, shdmax, & & snoalb, alvwf, alnwf, zf, qc, q1, wspd - integer, dimension(im), intent(in) :: islmsk real (kind=kind_phys), intent(in) :: delt real (kind=kind_phys), intent(in) :: con_cp, con_rv, con_g, & con_pi, con_rd, & @@ -309,7 +307,7 @@ subroutine lsm_ruc_run & ! inputs real (kind=kind_phys), dimension(lsoil_ruc) :: dzs real (kind=kind_phys), dimension(lsoil_ruc), intent(inout ) :: zs real (kind=kind_phys), dimension(im), intent(inout) :: weasd, & - & snwdph, tskin, & + & snwdph, tskin, tskin_ocn, & & srflag, canopy, trans, tsurf, zorl, tsnow, & & sfcqc, sfcqv, sfcdew, fice, tice, sfalb, smcwlt2, smcref2 ! --- in @@ -427,22 +425,13 @@ subroutine lsm_ruc_run & ! inputs call rucinit (flag_restart, im, lsoil_ruc, lsoil, nlev, & ! in isot, soiltyp, vegtype, fice, & ! in - islmsk, tskin, tg3, & ! in + land, tskin, tskin_ocn, tg3, & ! in smc, slc, stc, & ! in smcref2, smcwlt2, & ! inout lsm_ruc, lsm, & ! in zs, sh2o, smfrkeep, tslb, smois, wetness, & ! out errmsg, errflg) - !do i = 1, im ! n - horizontal loop - ! overwrite Noah soil fields with initialized RUC soil fields for output - !do k = 1, lsoil - ! smc(i,k) = smois(i,k) - ! slc(i,k) = sh2o(i,k) - ! stc(i,k) = tslb(i,k) - !enddo - !enddo ! i - endif ! flag_init=.true.,iter=1 !-- end of initialization @@ -633,7 +622,9 @@ subroutine lsm_ruc_run & ! inputs rdlai2d = .false. !if( .not. rdlai2d) xlai = lai_data(vtype) - conflx2(i,1,j) = zf(i) ! first atm. level above ground surface + conflx2(i,1,j) = zf(i) * 2. ! factor 2. is needed to get the height of + ! atm. forcing inside RUC LSM (inherited + ! from WRF) !> - 2. forcing data (f): !!\n \a sfcprs - pressure at height zf above ground (pascals) @@ -699,35 +690,11 @@ subroutine lsm_ruc_run & ! inputs if(ivegsrc == 1) then ! IGBP - MODIS !> - Prepare land/ice/water masks for RUC LSM - !SLMSK0 - SEA(0),LAND(1),ICE(2) MASK - IF (LAND(I)) then - ! when LAND fraction is .true. - vtype(i,j) = vegtype(i) - stype(i,j) = soiltyp(i) - xland(i,j) = 1. - xice(i,j) = 0. - ELSE - if(islmsk(i) == 0.) then - vtype(i,j) = 17 ! 17 - water (oceans and lakes) in MODIS - stype(i,j) = 14 - xland(i,j) = 2. ! xland = 2 for water - xice(i,j) = 0. - elseif(islmsk(i) == 1.) then ! land + !> - for land only vtype(i,j) = vegtype(i) stype(i,j) = soiltyp(i) xland(i,j) = 1. xice(i,j) = 0. - elseif(islmsk(i) == 2) then ! ice - vtype(i,j) = 15 ! MODIS - if(isot == 0) then - stype(i,j) = 9 ! ZOBLER - else - stype(i,j) = 16 ! STASGO - endif - xland(i,j) = 1. - xice(i,j) = fice(i) ! fraction of sea-ice - endif - ENDIF ! land=.true. else print *,'MODIS landuse is not available' endif @@ -1138,16 +1105,31 @@ subroutine lsm_ruc_run & ! inputs deallocate(soilctop) deallocate(landusef) ! - ! Update standard (Noah LSM) soil variables for physics - ! that require these variables (e.g. sfc_sice), independent - ! of whether it is a land point or not - do i = 1, im - do k = 1, lsoil - smc(i,k) = smois(i,k) - slc(i,k) = sh2o(i,k) - stc(i,k) = tslb(i,k) - enddo - enddo + !! Update standard (Noah LSM) soil variables for physics + !! that require these variables (e.g. sfc_sice), independent + !! of whether it is a land point or not + !do i = 1, im + ! if (land(i)) then + ! do k = 1, lsoil + ! smc(i,k) = smois(i,k) + ! slc(i,k) = sh2o(i,k) + ! stc(i,k) = tslb(i,k) + ! enddo + ! endif + !enddo + ! + !write(0,*) "DH DEBUG: i, k, land(i), smc(i,k), slc(i,k), stc(i,k):" + !do i = 1, im + ! do k = 1, lsoil + ! write(0,'(2i5,1x,l,1x,3e20.10)'), i, k, land(i), smc(i,k), slc(i,k), stc(i,k) + ! smc(i,k) = smois(i,k) + ! slc(i,k) = sh2o(i,k) + ! stc(i,k) = tslb(i,k) + ! enddo + !enddo + + !call sleep(20) + !stop return !................................... @@ -1158,8 +1140,8 @@ end subroutine lsm_ruc_run !! This subroutine contains RUC LSM initialization. subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in isot, soiltyp, vegtype, fice, & ! in - islmsk, tsurf, tg3, & ! in - smc, slc, stc, & ! in + land, tsurf, tsurf_ocn, & ! in + tg3, smc, slc, stc, & ! in smcref2, smcwlt2, & ! inout lsm_ruc, lsm, & ! in zs, sh2o, smfrkeep, tslb, smois, & ! out @@ -1174,8 +1156,8 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in integer, intent(in ) :: im, nlev integer, intent(in ) :: lsoil_ruc integer, intent(in ) :: lsoil - integer, dimension(im), intent(in ) :: islmsk - real (kind=kind_phys), dimension(im), intent(in ) :: tsurf + logical, dimension(im), intent(in ) :: land + real (kind=kind_phys), dimension(im), intent(in ) :: tsurf, tsurf_ocn real (kind=kind_phys), dimension(im), intent(inout) :: smcref2 real (kind=kind_phys), dimension(im), intent(inout) :: smcwlt2 real (kind=kind_phys), dimension(im), intent(in ) :: tg3 @@ -1197,7 +1179,7 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg -! local +!> local logical :: debug_print logical :: smadj ! for soil mosture adjustment logical :: swi_init ! for initialization in terms of SWI (soil wetness index) @@ -1234,6 +1216,7 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in integer, dimension(1:lsoil) :: st_levels_input ! 4 - for Noah lsm integer, dimension(1:lsoil) :: sm_levels_input ! 4 - for Noah lsm + integer :: ii,jj ! Initialize the CCPP error handling variables errmsg = '' errflg = 0 @@ -1248,6 +1231,7 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in return else if (debug_print) then write(0,*) 'Start of RUC LSM initialization' + print *,'lsoil, lsoil_ruc =',lsoil, lsoil_ruc endif ipr = 10 @@ -1280,22 +1264,30 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in ! For restart runs, can assume that RUC soul data is provided if (.not.restart) then - flag_soil_layers = 1 ! =1 for input from the Noah LSM - flag_soil_levels = 0 ! =1 for input from RUC LSM flag_sst = 0 num_soil_layers = lsoil ! 4 - for Noah lsm + if( lsoil_ruc == lsoil) then + ! RUC LSM input + smadj = .false. + swi_init = .false. + flag_soil_layers = 0 ! =1 for input from the Noah LSM + flag_soil_levels = 1 ! =1 for input from RUC LSM + else ! for Noah input set smadj and swi_init to .true. smadj = .true. swi_init = .true. + flag_soil_layers = 1 ! =1 for input from the Noah LSM + flag_soil_levels = 0 ! =1 for input from RUC LSM + endif if(lsoil == 4 ) then ! for Noah input - st_levels_input = (/ 5, 25, 70, 150/) ! Noah soil levels - sm_levels_input = (/ 5, 25, 70, 150/) ! Noah soil levels - else + st_levels_input = (/ 5, 25, 70, 150/) ! Noah centers of soil layers + sm_levels_input = (/ 5, 25, 70, 150/) ! Noah centers of soil layers + elseif(lsoil /= lsoil_ruc) then write(errmsg,'(a,i0,a)') & - 'WARNING in lsm_ruc_init: non-Noah input, lsoil=', lsoil + 'WARNING in lsm_ruc_init: non-Noah and non-RUC input, lsoil=', lsoil errflg = 1 return endif @@ -1308,7 +1300,6 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in endif if(debug_print) then - print *,'Land mask islmsk(ipr) ==', ipr, islmsk(ipr) print *,'Noah smc(ipr,:) ==', ipr, smc(ipr,:) print *,'Noah stc(ipr,:) ==', ipr, stc(ipr,:) print *,'Noah vegtype(ipr) ==', ipr, vegtype(ipr) @@ -1316,53 +1307,36 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in print *,'its,ite,jts,jte ',its,ite,jts,jte endif - ! Noah lsm input - if ( flag_soil_layers == 1 ) then do j=jts,jte ! do i=its,ite ! i = horizontal loop tsk(i,j) = tsurf(i) - tbot(i,j)=tg3(i) - - !SLMSK - SEA(0),LAND(1),ICE(2) MASK - if(islmsk(i) == 0) then - ivgtyp(i,j)= 17 ! 17 - water (oceans and lakes) in MODIS - isltyp(i,j)=14 - xice(i,j)=0. - landmask(i,j)=0. - elseif(islmsk(i) == 1) then ! land - ivgtyp(i,j)=vegtype(i) - isltyp(i,j)=soiltyp(i) - landmask(i,j)=1. - xice(i,j)=0. - elseif(islmsk(i) == 2) then ! ice - ivgtyp(i,j)=15 ! MODIS - !> -- number of soil categories - if(isot == 1) then - isltyp(i,j) = 16 ! STATSGO - else - isltyp(i,j) = 9 ! ZOBLER - endif - landmask(i,j)=1. - xice(i,j)=fice(i) - endif + sst(i,j) = tsurf_ocn(i) + tbot(i,j)= tg3(i) - sst(i,j) = tsk(i,j) + ! land only version + ivgtyp(i,j)=vegtype(i) + isltyp(i,j)=soiltyp(i) + landmask(i,j)=1. + xice(i,j)=0. + + enddo + enddo + + if ( flag_soil_layers == 1 ) then + ! Noah lsm input + do j=jts,jte ! + do i=its,ite ! i = horizontal loop + + if (land(i)) then st_input(i,1,j)=tsk(i,j) sm_input(i,1,j)=0. !--- initialize smcwlt2 and smcref2 with Noah values - if(islmsk(i) == 0 .or. islmsk(i) == 2) then - !water and sea ice - smcref2 (i) = 1. - smcwlt2 (i) = 0. - else - !land smcref2 (i) = REFSMCnoah(soiltyp(i)) smcwlt2 (i) = WLTSMCnoah(soiltyp(i)) - endif do k=1,lsoil st_input(i,k+1,j)=stc(i,k) @@ -1379,6 +1353,8 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in sm_input(i,k,j)=0. enddo + endif ! land(i) + enddo ! i - horizontal loop enddo ! jme @@ -1402,29 +1378,25 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in do j=jts,jte do i=its,ite + if (land(i)) then do k=1,lsoil_ruc ! convert from SWI to RUC volumetric soil moisture if(swi_init) then - if(islmsk(i) == 1) then - !land soilm(i,k,j)= dumsm(i,k,j) * & (refsmc(isltyp(i,j))-drysmc(isltyp(i,j))) & + drysmc(isltyp(i,j)) - else - soilm(i,k,j)= 1. - endif else soilm(i,k,j)= dumsm(i,k,j) endif soiltemp(i,k,j) = dumt(i,k,j) enddo + endif ! land(i) enddo enddo if(debug_print) then print *,'tsk(i,j),tbot(i,j),sst(i,j),landmask(i,j)' & ,ipr,1,tsk(ipr,1),tbot(ipr,1),sst(ipr,1),landmask(ipr,1) - print *,'islmsk(ipr)=',ipr,islmsk(ipr) print *,'tsurf(ipr)=',ipr,tsurf(ipr) print *,'stc(ipr)=',ipr,stc(ipr,:) print *,'smc(ipr)=',ipr,smc(ipr,:) @@ -1440,7 +1412,8 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in do j=jts,jte do i=its,ite - IF ( islmsk(i) == 1 ) then ! Land + if (land(i)) then + ! initialize factor do k=1,lsoil_ruc factorsm(k)=1. @@ -1489,36 +1462,71 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in if(i==ipr)print *,'after correction: RUC bucket and Noah bucket at', & i,j,smtotr(i,j),smtotn(i,j) endif - ENDIF ! land + + endif ! land(i) enddo enddo endif ! smadj==.true. - ! Initialize liquid and frozen soil moisture from total soil moisture - ! and soil temperature, and also soil moisture availability in the top - ! layer - call ruclsminit( debug_print, & - lsoil_ruc, isltyp, ivgtyp, xice, mavail, & - soilh2o, smfr, soiltemp, soilm, & - ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte ) - + elseif (flag_soil_layers==0) then + ! RUC LSM input + print *,' RUC LSM input for soil variables' do j=jts,jte do i=its,ite - wetness(i) = mavail(i,j) - do k = 1, lsoil_ruc - smois(i,k) = soilm(i,k,j) - tslb(i,k) = soiltemp(i,k,j) - sh2o(i,k) = soilh2o(i,k,j) - smfrkeep(i,k) = smfr(i,k,j) + do k=1,lsoil_ruc + soilm(i,k,j) = smc(i,k) + soiltemp(i,k,j) = stc(i,k) enddo enddo enddo endif ! flag_soil_layers==1 + + ! Initialize liquid and frozen soil moisture from total soil moisture + ! and soil temperature, and also soil moisture availability in the top + ! layer + call ruclsminit( debug_print, & + lsoil_ruc, isltyp, ivgtyp, xice, mavail, & + soilh2o, smfr, soiltemp, soilm, & + ims,ime, jms,jme, kms,kme, & + its,ite, jts,jte, kts,kte ) + + do j=jts,jte + do i=its,ite + if (land(i)) then + wetness(i) = mavail(i,j) + do k = 1, lsoil_ruc + smois(i,k) = soilm(i,k,j) + tslb(i,k) = soiltemp(i,k,j) + sh2o(i,k) = soilh2o(i,k,j) + smfrkeep(i,k) = smfr(i,k,j) + enddo + endif ! land(i) + enddo + enddo + + if ( flag_soil_layers == 1 ) then + ! For Noah lsm input and non-land points, set RUC LSM fields to Noah fields + do i=1,im + if (.not.land(i)) then + do k=1,min(lsoil,lsoil_ruc) + smois(i,k) = smc(i,k) + tslb(i,k) = stc(i,k) + sh2o(i,k) = slc(i,k) + enddo + endif + enddo + endif ! flag_soil_layers==1 + + if(debug_print) then + print *,'End of RUC LSM initialization' + print *,'tslb(ipr)=',ipr,tslb(ipr,:) + print *,'smois(ipr)=',ipr,smois(ipr,:) + endif ! debug_print + end subroutine rucinit From f15aaf510518588bd4a2a8d5cdb940cbb648727c Mon Sep 17 00:00:00 2001 From: climbfuji Date: Wed, 24 Jul 2019 08:08:12 -0400 Subject: [PATCH 37/89] physics/moninedmf.f: add guard to prevent using hedmf with HAFS, convert windows linebreak characters to unix linebreak characters --- physics/moninedmf.f | 2458 ++++++++++++++++++++++--------------------- 1 file changed, 1239 insertions(+), 1219 deletions(-) diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 76bc62298..7ce39e639 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -1,1219 +1,1239 @@ -!> \file moninedmf.f -!! Contains most of the hybrid eddy-diffusivity mass-flux scheme except for the -!! subroutine that calculates the mass flux and updraft properties. - -!> This module contains the CCPP-compliant hybrid eddy-diffusivity mass-flux -!! scheme. - module hedmf - - contains - - - subroutine hedmf_init () - end subroutine hedmf_init - - subroutine hedmf_finalize () - end subroutine hedmf_finalize - - -!> \defgroup HEDMF GFS Hybrid Eddy-Diffusivity Mass-Flux (HEDMF) Scheme Module -!! @{ -!! \brief This subroutine contains all of logic for the -!! Hybrid EDMF PBL scheme except for the calculation of -!! the updraft properties and mass flux. -!! -!> \section arg_table_hedmf_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | ntrac | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | cloud condensate index in tracer array | index | 0 | integer | | in | F | -!! | dv | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | du | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | tau | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | -!! | rtg | tendency_of_vertically_diffused_tracer_concentration | updated tendency of the tracers due to vertical diffusion in PBL scheme | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | -!! | u1 | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | v1 | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | t1 | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | -!! | q1 | vertically_diffused_tracer_concentration | tracer concentration diffused by PBL scheme | kg kg-1 | 3 | real | kind_phys | in | F | -!! | swh | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step | total sky shortwave heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | hlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step | total sky longwave heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave | none | 1 | real | kind_phys | in | F | -!! | psk | dimensionless_exner_function_at_lowest_model_interface | dimensionless Exner function at the surface interface | none | 1 | real | kind_phys | in | F | -!! | rbsoil | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | -!! | u10m | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | -!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | -!! | tsea | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | -!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | -!! | spd1 | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | -!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | prslk | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | -!! | dspheat | flag_TKE_dissipation_heating | flag for using TKE dissipation heating | flag | 0 | logical | | in | F | -!! | dusfc | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dvsfc | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | -!! | hgamt | countergradient_mixing_term_for_temperature | countergradient mixing term for temperature | K | 1 | real | kind_phys | inout | F | -!! | hgamq | countergradient_mixing_term_for_water_vapor | countergradient mixing term for water vapor | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | dkt | atmosphere_heat_diffusivity | diffusivity for heat | m2 s-1 | 2 | real | kind_phys | out | F | -!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | in | F | -!! | xkzm_m | atmosphere_momentum_diffusivity_background | background value of momentum diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | -!! | xkzm_h | atmosphere_heat_diffusivity_background | background value of heat diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | -!! | xkzm_s | diffusivity_background_sigma_level | sigma level threshold for background diffusivity | none | 0 | real | kind_phys | in | F | -!! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | -!! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | -!! | xkzminv | atmosphere_heat_diffusivity_background_maximum | maximum background value of heat diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | -!! | moninq_fac | atmosphere_diffusivity_coefficient_factor | multiplicative constant for atmospheric diffusivities | none | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! -!! \section general_edmf GFS Hybrid EDMF General Algorithm -!! -# Compute preliminary variables from input arguments. -!! -# Calculate the first estimate of the PBL height ("Predictor step"). -!! -# Calculate Monin-Obukhov similarity parameters. -!! -# Update thermal properties of surface parcel and recompute PBL height ("Corrector step"). -!! -# Determine whether stratocumulus layers exist and compute quantities needed for enhanced diffusion. -!! -# Calculate the inverse Prandtl number. -!! -# Compute diffusion coefficients below the PBL top. -!! -# Compute diffusion coefficients above the PBL top. -!! -# If the PBL is convective, call the mass flux scheme to replace the countergradient terms. -!! -# Compute enhanced diffusion coefficients related to stratocumulus-topped PBLs. -!! -# Solve for the temperature and moisture tendencies due to vertical mixing. -!! -# Calculate heating due to TKE dissipation and add to the tendency for temperature. -!! -# Solve for the horizontal momentum tendencies and add them to output tendency terms. -!! \section detailed_hedmf GFS Hybrid HEDMF Detailed Algorithm -!! @{ - subroutine hedmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & - & u1,v1,t1,q1,swh,hlw,xmu, & - & psk,rbsoil,zorl,u10m,v10m,fm,fh, & - & tsea,heat,evap,stress,spd1,kpbl, & - & prsi,del,prsl,prslk,phii,phil,delt,dspheat, & - & dusfc,dvsfc,dtsfc,dqsfc,hpbl,hgamt,hgamq,dkt, & - & kinver,xkzm_m,xkzm_h,xkzm_s,lprnt,ipr, & - & xkzminv,moninq_fac,errmsg,errflg) -! - use machine , only : kind_phys - use funcphys , only : fpvs - use physcons, grav => con_g, rd => con_rd, cp => con_cp - &, hvap => con_hvap, fv => con_fvirt - implicit none -! -! arguments -! - logical, intent(in) :: lprnt - integer, intent(in) :: ipr - integer, intent(in) :: ix, im, km, ntrac, ntcw, kinver(im) - integer, intent(out) :: kpbl(im) - -! - real(kind=kind_phys), intent(in) :: delt, xkzm_m, xkzm_h, xkzm_s - real(kind=kind_phys), intent(in) :: xkzminv, moninq_fac - real(kind=kind_phys), intent(inout) :: dv(im,km), du(im,km), & - & tau(im,km), rtg(im,km,ntrac) - real(kind=kind_phys), intent(in) :: & - & u1(ix,km), v1(ix,km), & - & t1(ix,km), q1(ix,km,ntrac), & - & swh(ix,km), hlw(ix,km), & - & xmu(im), psk(im), & - & rbsoil(im), zorl(im), & - & u10m(im), v10m(im), & - & fm(im), fh(im), & - & tsea(im), & - & heat(im), evap(im), & - & stress(im), spd1(im) - real(kind=kind_phys), intent(in) :: & - & prsi(ix,km+1), del(ix,km), & - & prsl(ix,km), prslk(ix,km), & - & phii(ix,km+1), phil(ix,km) - real(kind=kind_phys), intent(out) :: & - & dusfc(im), dvsfc(im), & - & dtsfc(im), dqsfc(im), & - & hpbl(im), dkt(im,km-1) - real(kind=kind_phys), intent(inout) :: & - & hgamt(im), hgamq(im) -! - logical, intent(in) :: dspheat -! flag for tke dissipative heating - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -! -! locals - - integer i,iprt,is,iun,k,kk,km1,kmpbl,latd,lond - integer lcld(im),icld(im),kcld(im),krad(im) - integer kx1(im), kpblx(im) -! -! real(kind=kind_phys) betaq(im), betat(im), betaw(im), - real(kind=kind_phys) phih(im), phim(im), hpblx(im), & - & rbdn(im), rbup(im), & - & beta(im), sflux(im), & - & z0(im), crb(im), wstar(im), & - & zol(im), ustmin(im), ustar(im), & - & thermal(im),wscale(im), wscaleu(im) -! - real(kind=kind_phys) theta(im,km),thvx(im,km), thlvx(im,km), & - & qlx(im,km), thetae(im,km), & - & qtx(im,km), bf(im,km-1), diss(im,km), & - & radx(im,km-1), & - & govrth(im), hrad(im), & -! & hradm(im), radmin(im), vrad(im), & - & radmin(im), vrad(im), & - & zd(im), zdd(im), thlvx1(im) -! - real(kind=kind_phys) rdzt(im,km-1),dktx(im,km-1), & - & zi(im,km+1), zl(im,km), xkzo(im,km-1), & - & dku(im,km-1), xkzmo(im,km-1), & - & cku(im,km-1), ckt(im,km-1), & - & ti(im,km-1), shr2(im,km-1), & - & al(im,km-1), ad(im,km), & - & au(im,km-1), a1(im,km), & - & a2(im,km*ntrac) -! - real(kind=kind_phys) tcko(im,km), qcko(im,km,ntrac), & - & ucko(im,km), vcko(im,km), xmf(im,km) -! - real(kind=kind_phys) prinv(im), rent(im) -! - logical pblflg(im), sfcflg(im), scuflg(im), flg(im) - logical ublflg(im), pcnvflg(im) -! -! pcnvflg: true for convective(strongly unstable) pbl -! ublflg: true for unstable but not convective(strongly unstable) pbl -! - real(kind=kind_phys) aphi16, aphi5, bvf2, wfac, - & cfac, conq, cont, conw, - & dk, dkmax, dkmin, - & dq1, dsdz2, dsdzq, dsdzt, - & dsdzu, dsdzv, - & dsig, dt2, dthe1, dtodsd, - & dtodsu, dw2, dw2min, g, - & gamcrq, gamcrt, gocp, - & gravi, f0, - & prnum, prmax, prmin, pfac, crbcon, - & qmin, tdzmin, qtend, crbmin,crbmax, - & rbint, rdt, rdz, qlmin, - & ri, rimin, rl2, rlam, rlamun, - & rone, rzero, sfcfrac, - & spdk2, sri, zol1, zolcr, zolcru, - & robn, ttend, - & utend, vk, vk2, - & ust3, wst3, - & vtend, zfac, vpert, cteit, - & rentf1, rentf2, radfac, - & zfmin, zk, tem, tem1, tem2, - & xkzm, xkzmu, - & ptem, ptem1, ptem2, tx1(im), tx2(im) -! - real(kind=kind_phys) zstblmax,h1, h2, qlcr, actei, - & cldtime -cc - parameter(gravi=1.0/grav) - parameter(g=grav) - parameter(gocp=g/cp) - parameter(cont=cp/g,conq=hvap/g,conw=1.0/g) ! for del in pa -! parameter(cont=1000.*cp/g,conq=1000.*hvap/g,conw=1000./g) ! for del in kpa - parameter(rlam=30.0,vk=0.4,vk2=vk*vk) - parameter(prmin=0.25,prmax=4.,zolcr=0.2,zolcru=-0.5) - parameter(dw2min=0.0001,dkmin=0.0,dkmax=1000.,rimin=-100.) - parameter(crbcon=0.25,crbmin=0.15,crbmax=0.35) - parameter(wfac=7.0,cfac=6.5,pfac=2.0,sfcfrac=0.1) -! parameter(qmin=1.e-8,xkzm=1.0,zfmin=1.e-8,aphi5=5.,aphi16=16.) - parameter(qmin=1.e-8, zfmin=1.e-8,aphi5=5.,aphi16=16.) - parameter(tdzmin=1.e-3,qlmin=1.e-12,f0=1.e-4) - parameter(h1=0.33333333,h2=0.66666667) -! parameter(cldtime=500.,xkzminv=0.3) - parameter(cldtime=500.) -! parameter(cldtime=500.,xkzmu=3.0,xkzminv=0.3) -! parameter(gamcrt=3.,gamcrq=2.e-3,rlamun=150.0) - parameter(gamcrt=3.,gamcrq=0.,rlamun=150.0) - parameter(rentf1=0.2,rentf2=1.0,radfac=0.85) - parameter(iun=84) -! -! parameter (zstblmax = 2500., qlcr=1.0e-5) -! parameter (zstblmax = 2500., qlcr=3.0e-5) -! parameter (zstblmax = 2500., qlcr=3.5e-5) -! parameter (zstblmax = 2500., qlcr=1.0e-4) - parameter (zstblmax = 2500., qlcr=3.5e-5) -! parameter (actei = 0.23) - parameter (actei = 0.7) -c -c----------------------------------------------------------------------- -c - 601 format(1x,' moninp lat lon step hour ',3i6,f6.1) - 602 format(1x,' k',' z',' t',' th', - 1 ' tvh',' q',' u',' v', - 2 ' sp') - 603 format(1x,i5,8f9.1) - 604 format(1x,' sfc',9x,f9.1,18x,f9.1) - 605 format(1x,' k zl spd2 thekv the1v' - 1 ,' thermal rbup') - 606 format(1x,i5,6f8.2) - 607 format(1x,' kpbl hpbl fm fh hgamt', - 1 ' hgamq ws ustar cd ch') - 608 format(1x,i5,9f8.2) - 609 format(1x,' k pr dkt dku ',i5,3f8.2) - 610 format(1x,' k pr dkt dku ',i5,3f8.2,' l2 ri t2', - 1 ' sr2 ',2f8.2,2e10.2) -! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - -!> ## Compute preliminary variables from input arguments - -! compute preliminary variables -! - if (ix .lt. im) stop -! -! iprt = 0 -! if(iprt.eq.1) then -!cc latd = 0 -! lond = 0 -! else -!cc latd = 0 -! lond = 0 -! endif -! - dt2 = delt - rdt = 1. / dt2 - km1 = km - 1 - kmpbl = km / 2 -!> - Compute physical height of the layer centers and interfaces from the geopotential height (zi and zl) - do k=1,km - do i=1,im - zi(i,k) = phii(i,k) * gravi - zl(i,k) = phil(i,k) * gravi - enddo - enddo - do i=1,im - zi(i,km+1) = phii(i,km+1) * gravi - enddo -!> - Compute reciprocal of \f$ \Delta z \f$ (rdzt) - do k = 1,km1 - do i=1,im - rdzt(i,k) = 1.0 / (zl(i,k+1) - zl(i,k)) - enddo - enddo -!> - Compute reciprocal of pressure (tx1, tx2) - do i=1,im - kx1(i) = 1 - tx1(i) = 1.0 / prsi(i,1) - tx2(i) = tx1(i) - enddo -!> - Compute background vertical diffusivities for scalars and momentum (xkzo and xkzmo) - do k = 1,km1 - do i=1,im - xkzo(i,k) = 0.0 - xkzmo(i,k) = 0.0 - if (k < kinver(i)) then -! vertical background diffusivity - ptem = prsi(i,k+1) * tx1(i) - tem1 = 1.0 - ptem - tem1 = tem1 * tem1 * 10.0 - xkzo(i,k) = xkzm_h * min(1.0, exp(-tem1)) - -! vertical background diffusivity for momentum - if (ptem >= xkzm_s) then - xkzmo(i,k) = xkzm_m - kx1(i) = k + 1 - else - if (k == kx1(i) .and. k > 1) tx2(i) = 1.0 / prsi(i,k) - tem1 = 1.0 - prsi(i,k+1) * tx2(i) - tem1 = tem1 * tem1 * 5.0 - xkzmo(i,k) = xkzm_m * min(1.0, exp(-tem1)) - endif - endif - enddo - enddo -! if (lprnt) then -! print *,' xkzo=',(xkzo(ipr,k),k=1,km1) -! print *,' xkzmo=',(xkzmo(ipr,k),k=1,km1) -! endif -! -! diffusivity in the inversion layer is set to be xkzminv (m^2/s) -!> - The background scalar vertical diffusivity is limited to be less than or equal to xkzminv - do k = 1,kmpbl - do i=1,im -! if(zi(i,k+1) > 200..and.zi(i,k+1) < zstblmax) then - if(zi(i,k+1) > 250.) then - tem1 = (t1(i,k+1)-t1(i,k)) * rdzt(i,k) - if(tem1 > 1.e-5) then - xkzo(i,k) = min(xkzo(i,k),xkzminv) - endif - endif - enddo - enddo -!> - Some output variables and logical flags are initialized - do i = 1,im - z0(i) = 0.01 * zorl(i) - dusfc(i) = 0. - dvsfc(i) = 0. - dtsfc(i) = 0. - dqsfc(i) = 0. - wscale(i)= 0. - wscaleu(i)= 0. - kpbl(i) = 1 - hpbl(i) = zi(i,1) - hpblx(i) = zi(i,1) - pblflg(i)= .true. - sfcflg(i)= .true. - if(rbsoil(i) > 0.) sfcflg(i) = .false. - ublflg(i)= .false. - pcnvflg(i)= .false. - scuflg(i)= .true. - if(scuflg(i)) then - radmin(i)= 0. - rent(i) = rentf1 - hrad(i) = zi(i,1) -! hradm(i) = zi(i,1) - krad(i) = 1 - icld(i) = 0 - lcld(i) = km1 - kcld(i) = km1 - zd(i) = 0. - endif - enddo -!> - Compute \f$\theta\f$ (theta), \f$q_l\f$ (qlx), \f$q_t\f$ (qtx), \f$\theta_e\f$ (thetae), \f$\theta_v\f$ (thvx), \f$\theta_{l,v}\f$ (thlvx) - do k = 1,km - do i = 1,im - theta(i,k) = t1(i,k) * psk(i) / prslk(i,k) - qlx(i,k) = max(q1(i,k,ntcw),qlmin) - qtx(i,k) = max(q1(i,k,1),qmin)+qlx(i,k) - ptem = qlx(i,k) - ptem1 = hvap*max(q1(i,k,1),qmin)/(cp*t1(i,k)) - thetae(i,k)= theta(i,k)*(1.+ptem1) - thvx(i,k) = theta(i,k)*(1.+fv*max(q1(i,k,1),qmin)-ptem) - ptem2 = theta(i,k)-(hvap/cp)*ptem - thlvx(i,k) = ptem2*(1.+fv*qtx(i,k)) - enddo - enddo -!> - Initialize diffusion coefficients to 0 and calculate the total radiative heating rate (dku, dkt, radx) - do k = 1,km1 - do i = 1,im - dku(i,k) = 0. - dkt(i,k) = 0. - dktx(i,k) = 0. - cku(i,k) = 0. - ckt(i,k) = 0. - tem = zi(i,k+1)-zi(i,k) - radx(i,k) = tem*(swh(i,k)*xmu(i)+hlw(i,k)) - enddo - enddo -!> - Set lcld to first index above 2.5km - do i=1,im - flg(i) = scuflg(i) - enddo - do k = 1, km1 - do i=1,im - if(flg(i).and.zl(i,k) >= zstblmax) then - lcld(i)=k - flg(i)=.false. - endif - enddo - enddo -! -! compute virtual potential temp gradient (bf) and winshear square -!> - Compute \f$\frac{\partial \theta_v}{\partial z}\f$ (bf) and the wind shear squared (shr2) - do k = 1, km1 - do i = 1, im - rdz = rdzt(i,k) - bf(i,k) = (thvx(i,k+1)-thvx(i,k))*rdz - ti(i,k) = 2./(t1(i,k)+t1(i,k+1)) - dw2 = (u1(i,k)-u1(i,k+1))**2 - & + (v1(i,k)-v1(i,k+1))**2 - shr2(i,k) = max(dw2,dw2min)*rdz*rdz - enddo - enddo -!> - Calculate \f$\frac{g}{\theta}\f$ (govrth), \f$\beta = \frac{\Delta t}{\Delta z}\f$ (beta), \f$u_*\f$ (ustar), total surface flux (sflux), and set pblflag to false if the total surface energy flux is into the surface - do i = 1,im - govrth(i) = g/theta(i,1) - enddo -! - do i=1,im - beta(i) = dt2 / (zi(i,2)-zi(i,1)) - enddo -! - do i=1,im - ustar(i) = sqrt(stress(i)) - enddo -! - do i = 1,im - sflux(i) = heat(i) + evap(i)*fv*theta(i,1) - if(.not.sfcflg(i) .or. sflux(i) <= 0.) pblflg(i)=.false. - enddo -!> ## Calculate the first estimate of the PBL height ("Predictor step") -!! The calculation of the boundary layer height follows Troen and Mahrt (1986) \cite troen_and_mahrt_1986 section 3. The approach is to find the level in the column where a modified bulk Richardson number exceeds a critical value. -!! -!! The temperature of the thermal is of primary importance. For the initial estimate of the PBL height, the thermal is assumed to have one of two temperatures. If the boundary layer is stable, the thermal is assumed to have a temperature equal to the surface virtual temperature. Otherwise, the thermal is assumed to have the same virtual potential temperature as the lowest model level. For the stable case, the critical bulk Richardson number becomes a function of the wind speed and roughness length, otherwise it is set to a tunable constant. -! compute the pbl height -! - do i=1,im - flg(i) = .false. - rbup(i) = rbsoil(i) -! - if(pblflg(i)) then - thermal(i) = thvx(i,1) - crb(i) = crbcon - else - thermal(i) = tsea(i)*(1.+fv*max(q1(i,1,1),qmin)) - tem = sqrt(u10m(i)**2+v10m(i)**2) - tem = max(tem, 1.) - robn = tem / (f0 * z0(i)) - tem1 = 1.e-7 * robn - crb(i) = 0.16 * (tem1 ** (-0.18)) - crb(i) = max(min(crb(i), crbmax), crbmin) - endif - enddo -!> Given the thermal's properties and the critical Richardson number, a loop is executed to find the first level above the surface where the modified Richardson number is greater than the critical Richardson number, using equation 10a from Troen and Mahrt (1986) \cite troen_and_mahrt_1986 (also equation 8 from Hong and Pan (1996) \cite hong_and_pan_1996): -!! \f[ -!! h = Ri\frac{T_0\left|\vec{v}(h)\right|^2}{g\left(\theta_v(h) - \theta_s\right)} -!! \f] -!! where \f$h\f$ is the PBL height, \f$Ri\f$ is the Richardson number, \f$T_0\f$ is the virtual potential temperature near the surface, \f$\left|\vec{v}\right|\f$ is the wind speed, and \f$\theta_s\f$ is for the thermal. Rearranging this equation to calculate the modified Richardson number at each level, k, for comparison with the critical value yields: -!! \f[ -!! Ri_k = gz(k)\frac{\left(\theta_v(k) - \theta_s\right)}{\theta_v(1)*\vec{v}(k)} -!! \f] - do k = 1, kmpbl - do i = 1, im - if(.not.flg(i)) then - rbdn(i) = rbup(i) - spdk2 = max((u1(i,k)**2+v1(i,k)**2),1.) - rbup(i) = (thvx(i,k)-thermal(i))* - & (g*zl(i,k)/thvx(i,1))/spdk2 - kpbl(i) = k - flg(i) = rbup(i) > crb(i) - endif - enddo - enddo -!> Once the level is found, some linear interpolation is performed to find the exact height of the boundary layer top (where \f$Ri = Ri_{cr}\f$) and the PBL height and the PBL top index are saved (hpblx and kpblx, respectively) - do i = 1,im - if(kpbl(i) > 1) then - k = kpbl(i) - if(rbdn(i) >= crb(i)) then - rbint = 0. - elseif(rbup(i) <= crb(i)) then - rbint = 1. - else - rbint = (crb(i)-rbdn(i))/(rbup(i)-rbdn(i)) - endif - hpbl(i) = zl(i,k-1) + rbint*(zl(i,k)-zl(i,k-1)) - if(hpbl(i) < zi(i,kpbl(i))) kpbl(i) = kpbl(i) - 1 - else - hpbl(i) = zl(i,1) - kpbl(i) = 1 - endif - kpblx(i) = kpbl(i) - hpblx(i) = hpbl(i) - enddo -! -! compute similarity parameters -!> ## Calculate Monin-Obukhov similarity parameters -!! Using the initial guess for the PBL height, Monin-Obukhov similarity parameters are calculated. They are needed to refine the PBL height calculation and for calculating diffusion coefficients. -!! -!! First, calculate the Monin-Obukhov nondimensional stability parameter, commonly referred to as \f$\zeta\f$ using the following equation from Businger et al. (1971) \cite businger_et_al_1971 (equation 28): -!! \f[ -!! \zeta = Ri_{sfc}\frac{F_m^2}{F_h} = \frac{z}{L} -!! \f] -!! where \f$F_m\f$ and \f$F_h\f$ are surface Monin-Obukhov stability functions calculated in sfc_diff.f and \f$L\f$ is the Obukhov length. Then, the nondimensional gradients of momentum and temperature (phim and phih) are calculated using equations 5 and 6 from Hong and Pan (1996) \cite hong_and_pan_1996 depending on the surface layer stability. Then, the velocity scale valid for the surface layer (\f$w_s\f$, wscale) is calculated using equation 3 from Hong and Pan (1996) \cite hong_and_pan_1996. For the neutral and unstable PBL above the surface layer, the convective velocity scale, \f$w_*\f$, is calculated according to: -!! \f[ -!! w_* = \left(\frac{g}{\theta_0}h\overline{w'\theta_0'}\right)^{1/3} -!! \f] -!! and the mixed layer velocity scale is then calculated with equation 6 from Troen and Mahrt (1986) \cite troen_and_mahrt_1986 -!! \f[ -!! w_s = (u_*^3 + 7\epsilon k w_*^3)^{1/3} -!! \f] - do i=1,im - zol(i) = max(rbsoil(i)*fm(i)*fm(i)/fh(i),rimin) - if(sfcflg(i)) then - zol(i) = min(zol(i),-zfmin) - else - zol(i) = max(zol(i),zfmin) - endif - zol1 = zol(i)*sfcfrac*hpbl(i)/zl(i,1) - if(sfcflg(i)) then -! phim(i) = (1.-aphi16*zol1)**(-1./4.) -! phih(i) = (1.-aphi16*zol1)**(-1./2.) - tem = 1.0 / (1. - aphi16*zol1) - phih(i) = sqrt(tem) - phim(i) = sqrt(phih(i)) - else - phim(i) = 1. + aphi5*zol1 - phih(i) = phim(i) - endif - wscale(i) = ustar(i)/phim(i) - ustmin(i) = ustar(i)/aphi5 - wscale(i) = max(wscale(i),ustmin(i)) - enddo - do i=1,im - if(pblflg(i)) then - if(zol(i) < zolcru .and. kpbl(i) > 1) then - pcnvflg(i) = .true. - else - ublflg(i) = .true. - endif - wst3 = govrth(i)*sflux(i)*hpbl(i) - wstar(i)= wst3**h1 - ust3 = ustar(i)**3. - wscaleu(i) = (ust3+wfac*vk*wst3*sfcfrac)**h1 - wscaleu(i) = max(wscaleu(i),ustmin(i)) - endif - enddo -! -! compute counter-gradient mixing term for heat and moisture -!> ## Update thermal properties of surface parcel and recompute PBL height ("Corrector step"). -!! Next, the counter-gradient terms for temperature and humidity are calculated using equation 4 of Hong and Pan (1996) \cite hong_and_pan_1996 and are used to calculate the "scaled virtual temperature excess near the surface" (equation 9 in Hong and Pan (1996) \cite hong_and_pan_1996) so that the properties of the thermal are updated to recalculate the PBL height. - do i = 1,im - if(ublflg(i)) then - hgamt(i) = min(cfac*heat(i)/wscaleu(i),gamcrt) - hgamq(i) = min(cfac*evap(i)/wscaleu(i),gamcrq) - vpert = hgamt(i) + hgamq(i)*fv*theta(i,1) - vpert = min(vpert,gamcrt) - thermal(i)= thermal(i)+max(vpert,0.) - hgamt(i) = max(hgamt(i),0.0) - hgamq(i) = max(hgamq(i),0.0) - endif - enddo -! -! enhance the pbl height by considering the thermal excess -!> The PBL height calculation follows the same procedure as the predictor step, except that it uses an updated virtual potential temperature for the thermal. - do i=1,im - flg(i) = .true. - if(ublflg(i)) then - flg(i) = .false. - rbup(i) = rbsoil(i) - endif - enddo - do k = 2, kmpbl - do i = 1, im - if(.not.flg(i)) then - rbdn(i) = rbup(i) - spdk2 = max((u1(i,k)**2+v1(i,k)**2),1.) - rbup(i) = (thvx(i,k)-thermal(i))* - & (g*zl(i,k)/thvx(i,1))/spdk2 - kpbl(i) = k - flg(i) = rbup(i) > crb(i) - endif - enddo - enddo - do i = 1,im - if(ublflg(i)) then - k = kpbl(i) - if(rbdn(i) >= crb(i)) then - rbint = 0. - elseif(rbup(i) <= crb(i)) then - rbint = 1. - else - rbint = (crb(i)-rbdn(i))/(rbup(i)-rbdn(i)) - endif - hpbl(i) = zl(i,k-1) + rbint*(zl(i,k)-zl(i,k-1)) - if(hpbl(i) < zi(i,kpbl(i))) kpbl(i) = kpbl(i) - 1 - if(kpbl(i) <= 1) then - ublflg(i) = .false. - pblflg(i) = .false. - endif - endif - enddo -! -! look for stratocumulus -!> ## Determine whether stratocumulus layers exist and compute quantities needed for enhanced diffusion -!! - Starting at the PBL top and going downward, if the level is less than 2.5 km and \f$q_l>q_{l,cr}\f$ then set kcld = k (find the cloud top index in the PBL). If no cloud water above the threshold is found, scuflg is set to F. - do i = 1, im - flg(i)=scuflg(i) - enddo - do k = kmpbl,1,-1 - do i = 1, im - if(flg(i) .and. k <= lcld(i)) then - if(qlx(i,k).ge.qlcr) then - kcld(i)=k - flg(i)=.false. - endif - endif - enddo - enddo - do i = 1, im - if(scuflg(i) .and. kcld(i)==km1) scuflg(i)=.false. - enddo -!> - Starting at the PBL top and going downward, if the level is less than the cloud top, find the level of the minimum radiative heating rate within the cloud. If the level of the minimum is the lowest model level or the minimum radiative heating rate is positive, then set scuflg to F. - do i = 1, im - flg(i)=scuflg(i) - enddo - do k = kmpbl,1,-1 - do i = 1, im - if(flg(i) .and. k <= kcld(i)) then - if(qlx(i,k) >= qlcr) then - if(radx(i,k) < radmin(i)) then - radmin(i)=radx(i,k) - krad(i)=k - endif - else - flg(i)=.false. - endif - endif - enddo - enddo - do i = 1, im - if(scuflg(i) .and. krad(i) <= 1) scuflg(i)=.false. - if(scuflg(i) .and. radmin(i)>=0.) scuflg(i)=.false. - enddo -!> - Starting at the PBL top and going downward, count the number of levels below the minimum radiative heating rate level that have cloud water above the threshold. If there are none, then set the scuflg to F. - do i = 1, im - flg(i)=scuflg(i) - enddo - do k = kmpbl,2,-1 - do i = 1, im - if(flg(i) .and. k <= krad(i)) then - if(qlx(i,k) >= qlcr) then - icld(i)=icld(i)+1 - else - flg(i)=.false. - endif - endif - enddo - enddo - do i = 1, im - if(scuflg(i) .and. icld(i) < 1) scuflg(i)=.false. - enddo -!> - Find the height of the interface where the minimum in radiative heating rate is located. If this height is less than the second model interface height, then set the scuflg to F. - do i = 1, im - if(scuflg(i)) then - hrad(i) = zi(i,krad(i)+1) -! hradm(i)= zl(i,krad(i)) - endif - enddo -! - do i = 1, im - if(scuflg(i) .and. hrad(i) - Calculate the hypothetical \f$\theta_v\f$ at the minimum radiative heating level that a parcel would reach due to radiative cooling after a typical cloud turnover time spent at that level. - do i = 1, im - if(scuflg(i)) then - k = krad(i) - tem = zi(i,k+1)-zi(i,k) - tem1 = cldtime*radmin(i)/tem - thlvx1(i) = thlvx(i,k)+tem1 -! if(thlvx1(i) > thlvx(i,k-1)) scuflg(i)=.false. - endif - enddo -!> - Determine the distance that a parcel would sink downwards starting from the level of minimum radiative heating rate by comparing the hypothetical minimum \f$\theta_v\f$ calculated above with the environmental \f$\theta_v\f$. - do i = 1, im - flg(i)=scuflg(i) - enddo - do k = kmpbl,1,-1 - do i = 1, im - if(flg(i) .and. k <= krad(i))then - if(thlvx1(i) <= thlvx(i,k))then - tem=zi(i,k+1)-zi(i,k) - zd(i)=zd(i)+tem - else - flg(i)=.false. - endif - endif - enddo - enddo -!> - Calculate the cloud thickness, where the cloud top is the in-cloud minimum radiative heating level and the bottom is determined previously. - do i = 1, im - if(scuflg(i))then - kk = max(1, krad(i)+1-icld(i)) - zdd(i) = hrad(i)-zi(i,kk) - endif - enddo -!> - Find the largest between the cloud thickness and the distance of a sinking parcel, then determine the smallest of that number and the height of the minimum in radiative heating rate. Set this number to \f$zd\f$. Using \f$zd\f$, calculate the characteristic velocity scale of cloud-top radiative cooling-driven turbulence. - do i = 1, im - if(scuflg(i))then - zd(i) = max(zd(i),zdd(i)) - zd(i) = min(zd(i),hrad(i)) - tem = govrth(i)*zd(i)*(-radmin(i)) - vrad(i)= tem**h1 - endif - enddo -! -! compute inverse prandtl number -!> ## Calculate the inverse Prandtl number -!! For an unstable PBL, the Prandtl number is calculated according to Hong and Pan (1996) \cite hong_and_pan_1996, equation 10, whereas for a stable boundary layer, the Prandtl number is simply \f$Pr = \frac{\phi_h}{\phi_m}\f$. - do i = 1, im - if(ublflg(i)) then - tem = phih(i)/phim(i)+cfac*vk*sfcfrac - else - tem = phih(i)/phim(i) - endif - prinv(i) = 1.0 / tem - prinv(i) = min(prinv(i),prmax) - prinv(i) = max(prinv(i),prmin) - enddo - do i = 1, im - if(zol(i) > zolcr) then - kpbl(i) = 1 - endif - enddo -! -! compute diffusion coefficients below pbl -!> ## Compute diffusion coefficients below the PBL top -!! Below the PBL top, the diffusion coefficients (\f$K_m\f$ and \f$K_h\f$) are calculated according to equation 2 in Hong and Pan (1996) \cite hong_and_pan_1996 where a different value for \f$w_s\f$ (PBL vertical velocity scale) is used depending on the PBL stability. \f$K_h\f$ is calculated from \f$K_m\f$ using the Prandtl number. The calculated diffusion coefficients are checked so that they are bounded by maximum values and the local background diffusion coefficients. - do k = 1, kmpbl - do i=1,im - if(k < kpbl(i)) then -! zfac = max((1.-(zi(i,k+1)-zl(i,1))/ -! 1 (hpbl(i)-zl(i,1))), zfmin) - zfac = max((1.-zi(i,k+1)/hpbl(i)), zfmin) - tem = zi(i,k+1) * (zfac**pfac) * moninq_fac ! lmh suggested by kg - if(pblflg(i)) then - tem1 = vk * wscaleu(i) * tem -! dku(i,k) = xkzmo(i,k) + tem1 -! dkt(i,k) = xkzo(i,k) + tem1 * prinv(i) - dku(i,k) = tem1 - dkt(i,k) = tem1 * prinv(i) - else - tem1 = vk * wscale(i) * tem -! dku(i,k) = xkzmo(i,k) + tem1 -! dkt(i,k) = xkzo(i,k) + tem1 * prinv(i) - dku(i,k) = tem1 - dkt(i,k) = tem1 * prinv(i) - endif - dku(i,k) = min(dku(i,k),dkmax) - dku(i,k) = max(dku(i,k),xkzmo(i,k)) - dkt(i,k) = min(dkt(i,k),dkmax) - dkt(i,k) = max(dkt(i,k),xkzo(i,k)) - dktx(i,k)= dkt(i,k) - endif - enddo - enddo -! -! compute diffusion coefficients based on local scheme above pbl -!> ## Compute diffusion coefficients above the PBL top -!! Diffusion coefficients above the PBL top are computed as a function of local stability (gradient Richardson number), shear, and a length scale from Louis (1979) \cite louis_1979 : -!! \f[ -!! K_{m,h}=l^2f_{m,h}(Ri_g)\left|\frac{\partial U}{\partial z}\right| -!! \f] -!! The functions used (\f$f_{m,h}\f$) depend on the local stability. First, the gradient Richardson number is calculated as -!! \f[ -!! Ri_g=\frac{\frac{g}{T}\frac{\partial \theta_v}{\partial z}}{\frac{\partial U}{\partial z}^2} -!! \f] -!! where \f$U\f$ is the horizontal wind. For the unstable case (\f$Ri_g < 0\f$), the Richardson number-dependent functions are given by -!! \f[ -!! f_h(Ri_g) = 1 + \frac{8\left|Ri_g\right|}{1 + 1.286\sqrt{\left|Ri_g\right|}}\\ -!! \f] -!! \f[ -!! f_m(Ri_g) = 1 + \frac{8\left|Ri_g\right|}{1 + 1.746\sqrt{\left|Ri_g\right|}}\\ -!! \f] -!! For the stable case, the following formulas are used -!! \f[ -!! f_h(Ri_g) = \frac{1}{\left(1 + 5Ri_g\right)^2}\\ -!! \f] -!! \f[ -!! Pr = \frac{K_h}{K_m} = 1 + 2.1Ri_g -!! \f] -!! The source for the formulas used for the Richardson number-dependent functions is unclear. They are different than those used in Hong and Pan (1996) \cite hong_and_pan_1996 as the previous documentation suggests. They follow equation 14 of Louis (1979) \cite louis_1979 for the unstable case, but it is unclear where the values of the coefficients \f$b\f$ and \f$c\f$ from that equation used in this scheme originate. Finally, the length scale, \f$l\f$ is calculated according to the following formula from Hong and Pan (1996) \cite hong_and_pan_1996 -!! \f[ -!! \frac{1}{l} = \frac{1}{kz} + \frac{1}{l_0}\\ -!! \f] -!! \f[ -!! or\\ -!! \f] -!! \f[ -!! l=\frac{l_0kz}{l_0+kz} -!! \f] -!! where \f$l_0\f$ is currently 30 m for stable conditions and 150 m for unstable. Finally, the diffusion coefficients are kept in a range bounded by the background diffusion and the maximum allowable values. - do k = 1, km1 - do i=1,im - if(k >= kpbl(i)) then - bvf2 = g*bf(i,k)*ti(i,k) - ri = max(bvf2/shr2(i,k),rimin) - zk = vk*zi(i,k+1) - if(ri < 0.) then ! unstable regime - rl2 = zk*rlamun/(rlamun+zk) - dk = rl2*rl2*sqrt(shr2(i,k)) - sri = sqrt(-ri) -! dku(i,k) = xkzmo(i,k) + dk*(1+8.*(-ri)/(1+1.746*sri)) -! dkt(i,k) = xkzo(i,k) + dk*(1+8.*(-ri)/(1+1.286*sri)) - dku(i,k) = dk*(1+8.*(-ri)/(1+1.746*sri)) - dkt(i,k) = dk*(1+8.*(-ri)/(1+1.286*sri)) - else ! stable regime - rl2 = zk*rlam/(rlam+zk) -!! tem = rlam * sqrt(0.01*prsi(i,k)) -!! rl2 = zk*tem/(tem+zk) - dk = rl2*rl2*sqrt(shr2(i,k)) - tem1 = dk/(1+5.*ri)**2 -! - if(k >= kpblx(i)) then - prnum = 1.0 + 2.1*ri - prnum = min(prnum,prmax) - else - prnum = 1.0 - endif -! dku(i,k) = xkzmo(i,k) + tem1 * prnum -! dkt(i,k) = xkzo(i,k) + tem1 - dku(i,k) = tem1 * prnum - dkt(i,k) = tem1 - endif -! - dku(i,k) = min(dku(i,k),dkmax) - dku(i,k) = max(dku(i,k),xkzmo(i,k)) - dkt(i,k) = min(dkt(i,k),dkmax) - dkt(i,k) = max(dkt(i,k),xkzo(i,k)) -! - endif -! - enddo - enddo -! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! compute components for mass flux mixing by large thermals -!> ## If the PBL is convective, call the mass flux scheme to replace the countergradient terms. -!! If the PBL is convective, the updraft properties are initialized to be the same as the state variables and the subroutine mfpbl is called. - do k = 1, km - do i = 1, im - if(pcnvflg(i)) then - tcko(i,k) = t1(i,k) - ucko(i,k) = u1(i,k) - vcko(i,k) = v1(i,k) - xmf(i,k) = 0. - endif - enddo - enddo - do kk = 1, ntrac - do k = 1, km - do i = 1, im - if(pcnvflg(i)) then - qcko(i,k,kk) = q1(i,k,kk) - endif - enddo - enddo - enddo -!> For details of the mfpbl subroutine, step into its documentation ::mfpbl - call mfpbl(im,ix,km,ntrac,dt2,pcnvflg, - & zl,zi,thvx,q1,t1,u1,v1,hpbl,kpbl, - & sflux,ustar,wstar,xmf,tcko,qcko,ucko,vcko) -! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! compute diffusion coefficients for cloud-top driven diffusion -! if the condition for cloud-top instability is met, -! increase entrainment flux at cloud top -! -!> ## Compute enhanced diffusion coefficients related to stratocumulus-topped PBLs -!! If a stratocumulus layer has been identified in the PBL, the diffusion coefficients in the PBL are modified in the following way. -!! -!! -# First, the criteria for CTEI is checked, using the threshold from equation 13 of Macvean and Mason (1990) \cite macvean_and_mason_1990. If the criteria is met, the cloud top diffusion is increased: -!! \f[ -!! K_h^{Sc} = -c\frac{\Delta F_R}{\rho c_p}\frac{1}{\frac{\partial \theta_v}{\partial z}} -!! \f] -!! where the constant \f$c\f$ is set to 0.2 if the CTEI criterion is not met and 1.0 if it is. -!! -!! -# Calculate the diffusion coefficients due to stratocumulus mixing according to equation 5 in Lock et al. (2000) \cite lock_et_al_2000 for every level below the stratocumulus top using the characteristic stratocumulus velocity scale previously calculated. The diffusion coefficient for momentum is calculated assuming a constant inverse Prandtl number of 0.75. - do i = 1, im - if(scuflg(i)) then - k = krad(i) - tem = thetae(i,k) - thetae(i,k+1) - tem1 = qtx(i,k) - qtx(i,k+1) - if (tem > 0. .and. tem1 > 0.) then - cteit= cp*tem/(hvap*tem1) - if(cteit > actei) rent(i) = rentf2 - endif - endif - enddo - do i = 1, im - if(scuflg(i)) then - k = krad(i) - tem1 = max(bf(i,k),tdzmin) - ckt(i,k) = -rent(i)*radmin(i)/tem1 - cku(i,k) = ckt(i,k) - endif - enddo -! - do k = 1, kmpbl - do i=1,im - if(scuflg(i) .and. k < krad(i)) then - tem1=hrad(i)-zd(i) - tem2=zi(i,k+1)-tem1 - if(tem2 > 0.) then - ptem= tem2/zd(i) - if(ptem.ge.1.) ptem= 1. - ptem= tem2*ptem*sqrt(1.-ptem) - ckt(i,k) = radfac*vk*vrad(i)*ptem - cku(i,k) = 0.75*ckt(i,k) - ckt(i,k) = max(ckt(i,k),dkmin) - ckt(i,k) = min(ckt(i,k),dkmax) - cku(i,k) = max(cku(i,k),dkmin) - cku(i,k) = min(cku(i,k),dkmax) - endif - endif - enddo - enddo -! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! -!> After \f$K_h^{Sc}\f$ has been determined from the surface to the top of the stratocumulus layer, it is added to the value for the diffusion coefficient calculated previously using surface-based mixing [see equation 6 of Lock et al. (2000) \cite lock_et_al_2000 ]. - do k = 1, kmpbl - do i=1,im - if(scuflg(i)) then - dkt(i,k) = dkt(i,k)+ckt(i,k) - dku(i,k) = dku(i,k)+cku(i,k) - dkt(i,k) = min(dkt(i,k),dkmax) - dku(i,k) = min(dku(i,k),dkmax) - endif - enddo - enddo -! -! compute tridiagonal matrix elements for heat and moisture -! -!> ## Solve for the temperature and moisture tendencies due to vertical mixing. -!! The tendencies of heat, moisture, and momentum due to vertical diffusion are calculated using a two-part process. First, a solution is obtained using an implicit time-stepping scheme, then the time tendency terms are "backed out". The tridiagonal matrix elements for the implicit solution for temperature and moisture are prepared in this section, with differing algorithms depending on whether the PBL was convective (substituting the mass flux term for counter-gradient term), unstable but not convective (using the computed counter-gradient terms), or stable (no counter-gradient terms). - do i=1,im - ad(i,1) = 1. - a1(i,1) = t1(i,1) + beta(i) * heat(i) - a2(i,1) = q1(i,1,1) + beta(i) * evap(i) - enddo - - if(ntrac >= 2) then - do k = 2, ntrac - is = (k-1) * km - do i = 1, im - a2(i,1+is) = q1(i,1,k) - enddo - enddo - endif -! - do k = 1,km1 - do i = 1,im - dtodsd = dt2/del(i,k) - dtodsu = dt2/del(i,k+1) - dsig = prsl(i,k)-prsl(i,k+1) - rdz = rdzt(i,k) - tem1 = dsig * dkt(i,k) * rdz - dsdz2 = tem1 * rdz - au(i,k) = -dtodsd*dsdz2 - al(i,k) = -dtodsu*dsdz2 -! - if(pcnvflg(i) .and. k < kpbl(i)) then - tem2 = dsig * rdz - ptem = 0.5 * tem2 * xmf(i,k) - ptem1 = dtodsd * ptem - ptem2 = dtodsu * ptem - ad(i,k) = ad(i,k)-au(i,k)-ptem1 - ad(i,k+1) = 1.-al(i,k)+ptem2 - au(i,k) = au(i,k)-ptem1 - al(i,k) = al(i,k)+ptem2 - ptem = tcko(i,k) + tcko(i,k+1) - dsdzt = tem1 * gocp - a1(i,k) = a1(i,k)+dtodsd*dsdzt-ptem1*ptem - a1(i,k+1) = t1(i,k+1)-dtodsu*dsdzt+ptem2*ptem - ptem = qcko(i,k,1) + qcko(i,k+1,1) - a2(i,k) = a2(i,k) - ptem1 * ptem - a2(i,k+1) = q1(i,k+1,1) + ptem2 * ptem - elseif(ublflg(i) .and. k < kpbl(i)) then - ptem1 = dsig * dktx(i,k) * rdz - tem = 1.0 / hpbl(i) - dsdzt = tem1 * gocp - ptem1 * hgamt(i) * tem - dsdzq = - ptem1 * hgamq(i) * tem - ad(i,k) = ad(i,k)-au(i,k) - ad(i,k+1) = 1.-al(i,k) - a1(i,k) = a1(i,k)+dtodsd*dsdzt - a1(i,k+1) = t1(i,k+1)-dtodsu*dsdzt - a2(i,k) = a2(i,k)+dtodsd*dsdzq - a2(i,k+1) = q1(i,k+1,1)-dtodsu*dsdzq - else - ad(i,k) = ad(i,k)-au(i,k) - ad(i,k+1) = 1.-al(i,k) - dsdzt = tem1 * gocp - a1(i,k) = a1(i,k)+dtodsd*dsdzt - a1(i,k+1) = t1(i,k+1)-dtodsu*dsdzt - a2(i,k+1) = q1(i,k+1,1) - endif -! - enddo - enddo -! - if(ntrac >= 2) then - do kk = 2, ntrac - is = (kk-1) * km - do k = 1, km1 - do i = 1, im - if(pcnvflg(i) .and. k < kpbl(i)) then - dtodsd = dt2/del(i,k) - dtodsu = dt2/del(i,k+1) - dsig = prsl(i,k)-prsl(i,k+1) - tem = dsig * rdzt(i,k) - ptem = 0.5 * tem * xmf(i,k) - ptem1 = dtodsd * ptem - ptem2 = dtodsu * ptem - tem1 = qcko(i,k,kk) + qcko(i,k+1,kk) - a2(i,k+is) = a2(i,k+is) - ptem1*tem1 - a2(i,k+1+is)= q1(i,k+1,kk) + ptem2*tem1 - else - a2(i,k+1+is) = q1(i,k+1,kk) - endif - enddo - enddo - enddo - endif -! -! solve tridiagonal problem for heat and moisture -! -!> The tridiagonal system is solved by calling the internal ::tridin subroutine. - call tridin(im,km,ntrac,al,ad,au,a1,a2,au,a1,a2) - -! -! recover tendencies of heat and moisture -! -!> After returning with the solution, the tendencies for temperature and moisture are recovered. - do k = 1,km - do i = 1,im - ttend = (a1(i,k)-t1(i,k)) * rdt - qtend = (a2(i,k)-q1(i,k,1))*rdt - tau(i,k) = tau(i,k)+ttend - rtg(i,k,1) = rtg(i,k,1)+qtend - dtsfc(i) = dtsfc(i)+cont*del(i,k)*ttend - dqsfc(i) = dqsfc(i)+conq*del(i,k)*qtend - enddo - enddo - if(ntrac >= 2) then - do kk = 2, ntrac - is = (kk-1) * km - do k = 1, km - do i = 1, im - qtend = (a2(i,k+is)-q1(i,k,kk))*rdt - rtg(i,k,kk) = rtg(i,k,kk)+qtend - enddo - enddo - enddo - endif -! -! compute tke dissipation rate -! -!> ## Calculate heating due to TKE dissipation and add to the tendency for temperature -!! Following Han et al. (2016) \cite Han_2016 , turbulence dissipation contributes to the tendency of temperature in the following way. First, turbulence dissipation is calculated by equation 17 of Han et al. (2016) \cite Han_2016 for the PBL and equation 16 for the surface layer. - if(dspheat) then -! - do k = 1,km1 - do i = 1,im - diss(i,k) = dku(i,k)*shr2(i,k)-g*ti(i,k)*dkt(i,k)*bf(i,k) -! diss(i,k) = dku(i,k)*shr2(i,k) - enddo - enddo -! -! add dissipative heating at the first model layer -! -!> Next, the temperature tendency is updated following equation 14. - do i = 1,im - tem = govrth(i)*sflux(i) - tem1 = tem + stress(i)*spd1(i)/zl(i,1) - tem2 = 0.5 * (tem1+diss(i,1)) - tem2 = max(tem2, 0.) - ttend = tem2 / cp - tau(i,1) = tau(i,1)+0.5*ttend - enddo -! -! add dissipative heating above the first model layer -! - do k = 2,km1 - do i = 1,im - tem = 0.5 * (diss(i,k-1)+diss(i,k)) - tem = max(tem, 0.) - ttend = tem / cp - tau(i,k) = tau(i,k) + 0.5*ttend - enddo - enddo -! - endif -! -! compute tridiagonal matrix elements for momentum -! -!> ## Solve for the horizontal momentum tendencies and add them to the output tendency terms -!! As with the temperature and moisture tendencies, the horizontal momentum tendencies are calculated by solving tridiagonal matrices after the matrices are prepared in this section. - do i=1,im - ad(i,1) = 1.0 + beta(i) * stress(i) / spd1(i) - a1(i,1) = u1(i,1) - a2(i,1) = v1(i,1) - enddo -! - do k = 1,km1 - do i=1,im - dtodsd = dt2/del(i,k) - dtodsu = dt2/del(i,k+1) - dsig = prsl(i,k)-prsl(i,k+1) - rdz = rdzt(i,k) - tem1 = dsig*dku(i,k)*rdz - dsdz2 = tem1 * rdz - au(i,k) = -dtodsd*dsdz2 - al(i,k) = -dtodsu*dsdz2 -! - if(pcnvflg(i) .and. k < kpbl(i)) then - tem2 = dsig * rdz - ptem = 0.5 * tem2 * xmf(i,k) - ptem1 = dtodsd * ptem - ptem2 = dtodsu * ptem - ad(i,k) = ad(i,k)-au(i,k)-ptem1 - ad(i,k+1) = 1.-al(i,k)+ptem2 - au(i,k) = au(i,k)-ptem1 - al(i,k) = al(i,k)+ptem2 - ptem = ucko(i,k) + ucko(i,k+1) - a1(i,k) = a1(i,k) - ptem1 * ptem - a1(i,k+1) = u1(i,k+1) + ptem2 * ptem - ptem = vcko(i,k) + vcko(i,k+1) - a2(i,k) = a2(i,k) - ptem1 * ptem - a2(i,k+1) = v1(i,k+1) + ptem2 * ptem - else - ad(i,k) = ad(i,k)-au(i,k) - ad(i,k+1) = 1.-al(i,k) - a1(i,k+1) = u1(i,k+1) - a2(i,k+1) = v1(i,k+1) - endif -! - enddo - enddo -! -! solve tridiagonal problem for momentum -! - call tridi2(im,km,al,ad,au,a1,a2,au,a1,a2) -! -! recover tendencies of momentum -! -!> Finally, the tendencies are recovered from the tridiagonal solutions. - do k = 1,km - do i = 1,im - utend = (a1(i,k)-u1(i,k))*rdt - vtend = (a2(i,k)-v1(i,k))*rdt - du(i,k) = du(i,k) + utend - dv(i,k) = dv(i,k) + vtend - dusfc(i) = dusfc(i) + conw*del(i,k)*utend - dvsfc(i) = dvsfc(i) + conw*del(i,k)*vtend -! -! for dissipative heating for ecmwf model -! -! tem1 = 0.5*(a1(i,k)+u1(i,k)) -! tem2 = 0.5*(a2(i,k)+v1(i,k)) -! diss(i,k) = -(tem1*utend+tem2*vtend) -! diss(i,k) = max(diss(i,k),0.) -! ttend = diss(i,k) / cp -! tau(i,k) = tau(i,k) + ttend -! - enddo - enddo -! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! - do i = 1, im - hpbl(i) = hpblx(i) - kpbl(i) = kpblx(i) - enddo -! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - return - end subroutine hedmf_run -!> @} -!> @} - - end module hedmf +!> \file moninedmf.f +!! Contains most of the hybrid eddy-diffusivity mass-flux scheme except for the +!! subroutine that calculates the mass flux and updraft properties. + +!> This module contains the CCPP-compliant hybrid eddy-diffusivity mass-flux +!! scheme. + module hedmf + + contains + +!> \section arg_table_hedmf_init Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| +!! | moninq_fac | atmosphere_diffusivity_coefficient_factor | multiplicative constant for atmospheric diffusivities | none | 0 | real | kind_phys | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine hedmf_init (moninq_fac,errmsg,errflg) + use machine, only : kind_phys + implicit none + real(kind=kind_phys), intent(in ) :: moninq_fac + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (moninq_fac == 0) then + errflg = 1 + write(errmsg,'(*(a))') 'Logic error: moninq_fac == 0', + & ' is incompatible with hedmf' + end if + end subroutine hedmf_init + + subroutine hedmf_finalize () + end subroutine hedmf_finalize + + +!> \defgroup HEDMF GFS Hybrid Eddy-Diffusivity Mass-Flux (HEDMF) Scheme Module +!! @{ +!! \brief This subroutine contains all of logic for the +!! Hybrid EDMF PBL scheme except for the calculation of +!! the updraft properties and mass flux. +!! +!> \section arg_table_hedmf_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| +!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | +!! | ntrac | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | +!! | ntcw | index_for_liquid_cloud_condensate | cloud condensate index in tracer array | index | 0 | integer | | in | F | +!! | dv | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | +!! | du | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | +!! | tau | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | +!! | rtg | tendency_of_vertically_diffused_tracer_concentration | updated tendency of the tracers due to vertical diffusion in PBL scheme | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | +!! | u1 | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | +!! | v1 | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | +!! | t1 | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | +!! | q1 | vertically_diffused_tracer_concentration | tracer concentration diffused by PBL scheme | kg kg-1 | 3 | real | kind_phys | in | F | +!! | swh | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step | total sky shortwave heating rate | K s-1 | 2 | real | kind_phys | in | F | +!! | hlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step | total sky longwave heating rate | K s-1 | 2 | real | kind_phys | in | F | +!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave | none | 1 | real | kind_phys | in | F | +!! | psk | dimensionless_exner_function_at_lowest_model_interface | dimensionless Exner function at the surface interface | none | 1 | real | kind_phys | in | F | +!! | rbsoil | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | +!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | +!! | u10m | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | +!! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | +!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | +!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | +!! | tsea | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | +!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | +!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | +!! | spd1 | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | +!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | +!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | +!! | del | air_pressure_difference_between_midlayers | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | +!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | prslk | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | +!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | +!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | +!! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | +!! | dspheat | flag_TKE_dissipation_heating | flag for using TKE dissipation heating | flag | 0 | logical | | in | F | +!! | dusfc | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | +!! | dvsfc | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | +!! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | +!! | hgamt | countergradient_mixing_term_for_temperature | countergradient mixing term for temperature | K | 1 | real | kind_phys | inout | F | +!! | hgamq | countergradient_mixing_term_for_water_vapor | countergradient mixing term for water vapor | kg kg-1 | 1 | real | kind_phys | inout | F | +!! | dkt | atmosphere_heat_diffusivity | diffusivity for heat | m2 s-1 | 2 | real | kind_phys | out | F | +!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | in | F | +!! | xkzm_m | atmosphere_momentum_diffusivity_background | background value of momentum diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | +!! | xkzm_h | atmosphere_heat_diffusivity_background | background value of heat diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | +!! | xkzm_s | diffusivity_background_sigma_level | sigma level threshold for background diffusivity | none | 0 | real | kind_phys | in | F | +!! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | +!! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | +!! | xkzminv | atmosphere_heat_diffusivity_background_maximum | maximum background value of heat diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | +!! | moninq_fac | atmosphere_diffusivity_coefficient_factor | multiplicative constant for atmospheric diffusivities | none | 0 | real | kind_phys | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +!! \section general_edmf GFS Hybrid EDMF General Algorithm +!! -# Compute preliminary variables from input arguments. +!! -# Calculate the first estimate of the PBL height ("Predictor step"). +!! -# Calculate Monin-Obukhov similarity parameters. +!! -# Update thermal properties of surface parcel and recompute PBL height ("Corrector step"). +!! -# Determine whether stratocumulus layers exist and compute quantities needed for enhanced diffusion. +!! -# Calculate the inverse Prandtl number. +!! -# Compute diffusion coefficients below the PBL top. +!! -# Compute diffusion coefficients above the PBL top. +!! -# If the PBL is convective, call the mass flux scheme to replace the countergradient terms. +!! -# Compute enhanced diffusion coefficients related to stratocumulus-topped PBLs. +!! -# Solve for the temperature and moisture tendencies due to vertical mixing. +!! -# Calculate heating due to TKE dissipation and add to the tendency for temperature. +!! -# Solve for the horizontal momentum tendencies and add them to output tendency terms. +!! \section detailed_hedmf GFS Hybrid HEDMF Detailed Algorithm +!! @{ + subroutine hedmf_run (ix,im,km,ntrac,ntcw,dv,du,tau,rtg, & + & u1,v1,t1,q1,swh,hlw,xmu, & + & psk,rbsoil,zorl,u10m,v10m,fm,fh, & + & tsea,heat,evap,stress,spd1,kpbl, & + & prsi,del,prsl,prslk,phii,phil,delt,dspheat, & + & dusfc,dvsfc,dtsfc,dqsfc,hpbl,hgamt,hgamq,dkt, & + & kinver,xkzm_m,xkzm_h,xkzm_s,lprnt,ipr, & + & xkzminv,moninq_fac,errmsg,errflg) +! + use machine , only : kind_phys + use funcphys , only : fpvs + use physcons, grav => con_g, rd => con_rd, cp => con_cp + &, hvap => con_hvap, fv => con_fvirt + implicit none +! +! arguments +! + logical, intent(in) :: lprnt + integer, intent(in) :: ipr + integer, intent(in) :: ix, im, km, ntrac, ntcw, kinver(im) + integer, intent(out) :: kpbl(im) + +! + real(kind=kind_phys), intent(in) :: delt, xkzm_m, xkzm_h, xkzm_s + real(kind=kind_phys), intent(in) :: xkzminv, moninq_fac + real(kind=kind_phys), intent(inout) :: dv(im,km), du(im,km), & + & tau(im,km), rtg(im,km,ntrac) + real(kind=kind_phys), intent(in) :: & + & u1(ix,km), v1(ix,km), & + & t1(ix,km), q1(ix,km,ntrac), & + & swh(ix,km), hlw(ix,km), & + & xmu(im), psk(im), & + & rbsoil(im), zorl(im), & + & u10m(im), v10m(im), & + & fm(im), fh(im), & + & tsea(im), & + & heat(im), evap(im), & + & stress(im), spd1(im) + real(kind=kind_phys), intent(in) :: & + & prsi(ix,km+1), del(ix,km), & + & prsl(ix,km), prslk(ix,km), & + & phii(ix,km+1), phil(ix,km) + real(kind=kind_phys), intent(out) :: & + & dusfc(im), dvsfc(im), & + & dtsfc(im), dqsfc(im), & + & hpbl(im), dkt(im,km-1) + real(kind=kind_phys), intent(inout) :: & + & hgamt(im), hgamq(im) +! + logical, intent(in) :: dspheat +! flag for tke dissipative heating + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + +! +! locals + + integer i,iprt,is,iun,k,kk,km1,kmpbl,latd,lond + integer lcld(im),icld(im),kcld(im),krad(im) + integer kx1(im), kpblx(im) +! +! real(kind=kind_phys) betaq(im), betat(im), betaw(im), + real(kind=kind_phys) phih(im), phim(im), hpblx(im), & + & rbdn(im), rbup(im), & + & beta(im), sflux(im), & + & z0(im), crb(im), wstar(im), & + & zol(im), ustmin(im), ustar(im), & + & thermal(im),wscale(im), wscaleu(im) +! + real(kind=kind_phys) theta(im,km),thvx(im,km), thlvx(im,km), & + & qlx(im,km), thetae(im,km), & + & qtx(im,km), bf(im,km-1), diss(im,km), & + & radx(im,km-1), & + & govrth(im), hrad(im), & +! & hradm(im), radmin(im), vrad(im), & + & radmin(im), vrad(im), & + & zd(im), zdd(im), thlvx1(im) +! + real(kind=kind_phys) rdzt(im,km-1),dktx(im,km-1), & + & zi(im,km+1), zl(im,km), xkzo(im,km-1), & + & dku(im,km-1), xkzmo(im,km-1), & + & cku(im,km-1), ckt(im,km-1), & + & ti(im,km-1), shr2(im,km-1), & + & al(im,km-1), ad(im,km), & + & au(im,km-1), a1(im,km), & + & a2(im,km*ntrac) +! + real(kind=kind_phys) tcko(im,km), qcko(im,km,ntrac), & + & ucko(im,km), vcko(im,km), xmf(im,km) +! + real(kind=kind_phys) prinv(im), rent(im) +! + logical pblflg(im), sfcflg(im), scuflg(im), flg(im) + logical ublflg(im), pcnvflg(im) +! +! pcnvflg: true for convective(strongly unstable) pbl +! ublflg: true for unstable but not convective(strongly unstable) pbl +! + real(kind=kind_phys) aphi16, aphi5, bvf2, wfac, + & cfac, conq, cont, conw, + & dk, dkmax, dkmin, + & dq1, dsdz2, dsdzq, dsdzt, + & dsdzu, dsdzv, + & dsig, dt2, dthe1, dtodsd, + & dtodsu, dw2, dw2min, g, + & gamcrq, gamcrt, gocp, + & gravi, f0, + & prnum, prmax, prmin, pfac, crbcon, + & qmin, tdzmin, qtend, crbmin,crbmax, + & rbint, rdt, rdz, qlmin, + & ri, rimin, rl2, rlam, rlamun, + & rone, rzero, sfcfrac, + & spdk2, sri, zol1, zolcr, zolcru, + & robn, ttend, + & utend, vk, vk2, + & ust3, wst3, + & vtend, zfac, vpert, cteit, + & rentf1, rentf2, radfac, + & zfmin, zk, tem, tem1, tem2, + & xkzm, xkzmu, + & ptem, ptem1, ptem2, tx1(im), tx2(im) +! + real(kind=kind_phys) zstblmax,h1, h2, qlcr, actei, + & cldtime +cc + parameter(gravi=1.0/grav) + parameter(g=grav) + parameter(gocp=g/cp) + parameter(cont=cp/g,conq=hvap/g,conw=1.0/g) ! for del in pa +! parameter(cont=1000.*cp/g,conq=1000.*hvap/g,conw=1000./g) ! for del in kpa + parameter(rlam=30.0,vk=0.4,vk2=vk*vk) + parameter(prmin=0.25,prmax=4.,zolcr=0.2,zolcru=-0.5) + parameter(dw2min=0.0001,dkmin=0.0,dkmax=1000.,rimin=-100.) + parameter(crbcon=0.25,crbmin=0.15,crbmax=0.35) + parameter(wfac=7.0,cfac=6.5,pfac=2.0,sfcfrac=0.1) +! parameter(qmin=1.e-8,xkzm=1.0,zfmin=1.e-8,aphi5=5.,aphi16=16.) + parameter(qmin=1.e-8, zfmin=1.e-8,aphi5=5.,aphi16=16.) + parameter(tdzmin=1.e-3,qlmin=1.e-12,f0=1.e-4) + parameter(h1=0.33333333,h2=0.66666667) +! parameter(cldtime=500.,xkzminv=0.3) + parameter(cldtime=500.) +! parameter(cldtime=500.,xkzmu=3.0,xkzminv=0.3) +! parameter(gamcrt=3.,gamcrq=2.e-3,rlamun=150.0) + parameter(gamcrt=3.,gamcrq=0.,rlamun=150.0) + parameter(rentf1=0.2,rentf2=1.0,radfac=0.85) + parameter(iun=84) +! +! parameter (zstblmax = 2500., qlcr=1.0e-5) +! parameter (zstblmax = 2500., qlcr=3.0e-5) +! parameter (zstblmax = 2500., qlcr=3.5e-5) +! parameter (zstblmax = 2500., qlcr=1.0e-4) + parameter (zstblmax = 2500., qlcr=3.5e-5) +! parameter (actei = 0.23) + parameter (actei = 0.7) +c +c----------------------------------------------------------------------- +c + 601 format(1x,' moninp lat lon step hour ',3i6,f6.1) + 602 format(1x,' k',' z',' t',' th', + 1 ' tvh',' q',' u',' v', + 2 ' sp') + 603 format(1x,i5,8f9.1) + 604 format(1x,' sfc',9x,f9.1,18x,f9.1) + 605 format(1x,' k zl spd2 thekv the1v' + 1 ,' thermal rbup') + 606 format(1x,i5,6f8.2) + 607 format(1x,' kpbl hpbl fm fh hgamt', + 1 ' hgamq ws ustar cd ch') + 608 format(1x,i5,9f8.2) + 609 format(1x,' k pr dkt dku ',i5,3f8.2) + 610 format(1x,' k pr dkt dku ',i5,3f8.2,' l2 ri t2', + 1 ' sr2 ',2f8.2,2e10.2) +! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + +!> ## Compute preliminary variables from input arguments + +! compute preliminary variables +! + if (ix .lt. im) stop +! +! iprt = 0 +! if(iprt.eq.1) then +!cc latd = 0 +! lond = 0 +! else +!cc latd = 0 +! lond = 0 +! endif +! + dt2 = delt + rdt = 1. / dt2 + km1 = km - 1 + kmpbl = km / 2 +!> - Compute physical height of the layer centers and interfaces from the geopotential height (zi and zl) + do k=1,km + do i=1,im + zi(i,k) = phii(i,k) * gravi + zl(i,k) = phil(i,k) * gravi + enddo + enddo + do i=1,im + zi(i,km+1) = phii(i,km+1) * gravi + enddo +!> - Compute reciprocal of \f$ \Delta z \f$ (rdzt) + do k = 1,km1 + do i=1,im + rdzt(i,k) = 1.0 / (zl(i,k+1) - zl(i,k)) + enddo + enddo +!> - Compute reciprocal of pressure (tx1, tx2) + do i=1,im + kx1(i) = 1 + tx1(i) = 1.0 / prsi(i,1) + tx2(i) = tx1(i) + enddo +!> - Compute background vertical diffusivities for scalars and momentum (xkzo and xkzmo) + do k = 1,km1 + do i=1,im + xkzo(i,k) = 0.0 + xkzmo(i,k) = 0.0 + if (k < kinver(i)) then +! vertical background diffusivity + ptem = prsi(i,k+1) * tx1(i) + tem1 = 1.0 - ptem + tem1 = tem1 * tem1 * 10.0 + xkzo(i,k) = xkzm_h * min(1.0, exp(-tem1)) + +! vertical background diffusivity for momentum + if (ptem >= xkzm_s) then + xkzmo(i,k) = xkzm_m + kx1(i) = k + 1 + else + if (k == kx1(i) .and. k > 1) tx2(i) = 1.0 / prsi(i,k) + tem1 = 1.0 - prsi(i,k+1) * tx2(i) + tem1 = tem1 * tem1 * 5.0 + xkzmo(i,k) = xkzm_m * min(1.0, exp(-tem1)) + endif + endif + enddo + enddo +! if (lprnt) then +! print *,' xkzo=',(xkzo(ipr,k),k=1,km1) +! print *,' xkzmo=',(xkzmo(ipr,k),k=1,km1) +! endif +! +! diffusivity in the inversion layer is set to be xkzminv (m^2/s) +!> - The background scalar vertical diffusivity is limited to be less than or equal to xkzminv + do k = 1,kmpbl + do i=1,im +! if(zi(i,k+1) > 200..and.zi(i,k+1) < zstblmax) then + if(zi(i,k+1) > 250.) then + tem1 = (t1(i,k+1)-t1(i,k)) * rdzt(i,k) + if(tem1 > 1.e-5) then + xkzo(i,k) = min(xkzo(i,k),xkzminv) + endif + endif + enddo + enddo +!> - Some output variables and logical flags are initialized + do i = 1,im + z0(i) = 0.01 * zorl(i) + dusfc(i) = 0. + dvsfc(i) = 0. + dtsfc(i) = 0. + dqsfc(i) = 0. + wscale(i)= 0. + wscaleu(i)= 0. + kpbl(i) = 1 + hpbl(i) = zi(i,1) + hpblx(i) = zi(i,1) + pblflg(i)= .true. + sfcflg(i)= .true. + if(rbsoil(i) > 0.) sfcflg(i) = .false. + ublflg(i)= .false. + pcnvflg(i)= .false. + scuflg(i)= .true. + if(scuflg(i)) then + radmin(i)= 0. + rent(i) = rentf1 + hrad(i) = zi(i,1) +! hradm(i) = zi(i,1) + krad(i) = 1 + icld(i) = 0 + lcld(i) = km1 + kcld(i) = km1 + zd(i) = 0. + endif + enddo +!> - Compute \f$\theta\f$ (theta), \f$q_l\f$ (qlx), \f$q_t\f$ (qtx), \f$\theta_e\f$ (thetae), \f$\theta_v\f$ (thvx), \f$\theta_{l,v}\f$ (thlvx) + do k = 1,km + do i = 1,im + theta(i,k) = t1(i,k) * psk(i) / prslk(i,k) + qlx(i,k) = max(q1(i,k,ntcw),qlmin) + qtx(i,k) = max(q1(i,k,1),qmin)+qlx(i,k) + ptem = qlx(i,k) + ptem1 = hvap*max(q1(i,k,1),qmin)/(cp*t1(i,k)) + thetae(i,k)= theta(i,k)*(1.+ptem1) + thvx(i,k) = theta(i,k)*(1.+fv*max(q1(i,k,1),qmin)-ptem) + ptem2 = theta(i,k)-(hvap/cp)*ptem + thlvx(i,k) = ptem2*(1.+fv*qtx(i,k)) + enddo + enddo +!> - Initialize diffusion coefficients to 0 and calculate the total radiative heating rate (dku, dkt, radx) + do k = 1,km1 + do i = 1,im + dku(i,k) = 0. + dkt(i,k) = 0. + dktx(i,k) = 0. + cku(i,k) = 0. + ckt(i,k) = 0. + tem = zi(i,k+1)-zi(i,k) + radx(i,k) = tem*(swh(i,k)*xmu(i)+hlw(i,k)) + enddo + enddo +!> - Set lcld to first index above 2.5km + do i=1,im + flg(i) = scuflg(i) + enddo + do k = 1, km1 + do i=1,im + if(flg(i).and.zl(i,k) >= zstblmax) then + lcld(i)=k + flg(i)=.false. + endif + enddo + enddo +! +! compute virtual potential temp gradient (bf) and winshear square +!> - Compute \f$\frac{\partial \theta_v}{\partial z}\f$ (bf) and the wind shear squared (shr2) + do k = 1, km1 + do i = 1, im + rdz = rdzt(i,k) + bf(i,k) = (thvx(i,k+1)-thvx(i,k))*rdz + ti(i,k) = 2./(t1(i,k)+t1(i,k+1)) + dw2 = (u1(i,k)-u1(i,k+1))**2 + & + (v1(i,k)-v1(i,k+1))**2 + shr2(i,k) = max(dw2,dw2min)*rdz*rdz + enddo + enddo +!> - Calculate \f$\frac{g}{\theta}\f$ (govrth), \f$\beta = \frac{\Delta t}{\Delta z}\f$ (beta), \f$u_*\f$ (ustar), total surface flux (sflux), and set pblflag to false if the total surface energy flux is into the surface + do i = 1,im + govrth(i) = g/theta(i,1) + enddo +! + do i=1,im + beta(i) = dt2 / (zi(i,2)-zi(i,1)) + enddo +! + do i=1,im + ustar(i) = sqrt(stress(i)) + enddo +! + do i = 1,im + sflux(i) = heat(i) + evap(i)*fv*theta(i,1) + if(.not.sfcflg(i) .or. sflux(i) <= 0.) pblflg(i)=.false. + enddo +!> ## Calculate the first estimate of the PBL height ("Predictor step") +!! The calculation of the boundary layer height follows Troen and Mahrt (1986) \cite troen_and_mahrt_1986 section 3. The approach is to find the level in the column where a modified bulk Richardson number exceeds a critical value. +!! +!! The temperature of the thermal is of primary importance. For the initial estimate of the PBL height, the thermal is assumed to have one of two temperatures. If the boundary layer is stable, the thermal is assumed to have a temperature equal to the surface virtual temperature. Otherwise, the thermal is assumed to have the same virtual potential temperature as the lowest model level. For the stable case, the critical bulk Richardson number becomes a function of the wind speed and roughness length, otherwise it is set to a tunable constant. +! compute the pbl height +! + do i=1,im + flg(i) = .false. + rbup(i) = rbsoil(i) +! + if(pblflg(i)) then + thermal(i) = thvx(i,1) + crb(i) = crbcon + else + thermal(i) = tsea(i)*(1.+fv*max(q1(i,1,1),qmin)) + tem = sqrt(u10m(i)**2+v10m(i)**2) + tem = max(tem, 1.) + robn = tem / (f0 * z0(i)) + tem1 = 1.e-7 * robn + crb(i) = 0.16 * (tem1 ** (-0.18)) + crb(i) = max(min(crb(i), crbmax), crbmin) + endif + enddo +!> Given the thermal's properties and the critical Richardson number, a loop is executed to find the first level above the surface where the modified Richardson number is greater than the critical Richardson number, using equation 10a from Troen and Mahrt (1986) \cite troen_and_mahrt_1986 (also equation 8 from Hong and Pan (1996) \cite hong_and_pan_1996): +!! \f[ +!! h = Ri\frac{T_0\left|\vec{v}(h)\right|^2}{g\left(\theta_v(h) - \theta_s\right)} +!! \f] +!! where \f$h\f$ is the PBL height, \f$Ri\f$ is the Richardson number, \f$T_0\f$ is the virtual potential temperature near the surface, \f$\left|\vec{v}\right|\f$ is the wind speed, and \f$\theta_s\f$ is for the thermal. Rearranging this equation to calculate the modified Richardson number at each level, k, for comparison with the critical value yields: +!! \f[ +!! Ri_k = gz(k)\frac{\left(\theta_v(k) - \theta_s\right)}{\theta_v(1)*\vec{v}(k)} +!! \f] + do k = 1, kmpbl + do i = 1, im + if(.not.flg(i)) then + rbdn(i) = rbup(i) + spdk2 = max((u1(i,k)**2+v1(i,k)**2),1.) + rbup(i) = (thvx(i,k)-thermal(i))* + & (g*zl(i,k)/thvx(i,1))/spdk2 + kpbl(i) = k + flg(i) = rbup(i) > crb(i) + endif + enddo + enddo +!> Once the level is found, some linear interpolation is performed to find the exact height of the boundary layer top (where \f$Ri = Ri_{cr}\f$) and the PBL height and the PBL top index are saved (hpblx and kpblx, respectively) + do i = 1,im + if(kpbl(i) > 1) then + k = kpbl(i) + if(rbdn(i) >= crb(i)) then + rbint = 0. + elseif(rbup(i) <= crb(i)) then + rbint = 1. + else + rbint = (crb(i)-rbdn(i))/(rbup(i)-rbdn(i)) + endif + hpbl(i) = zl(i,k-1) + rbint*(zl(i,k)-zl(i,k-1)) + if(hpbl(i) < zi(i,kpbl(i))) kpbl(i) = kpbl(i) - 1 + else + hpbl(i) = zl(i,1) + kpbl(i) = 1 + endif + kpblx(i) = kpbl(i) + hpblx(i) = hpbl(i) + enddo +! +! compute similarity parameters +!> ## Calculate Monin-Obukhov similarity parameters +!! Using the initial guess for the PBL height, Monin-Obukhov similarity parameters are calculated. They are needed to refine the PBL height calculation and for calculating diffusion coefficients. +!! +!! First, calculate the Monin-Obukhov nondimensional stability parameter, commonly referred to as \f$\zeta\f$ using the following equation from Businger et al. (1971) \cite businger_et_al_1971 (equation 28): +!! \f[ +!! \zeta = Ri_{sfc}\frac{F_m^2}{F_h} = \frac{z}{L} +!! \f] +!! where \f$F_m\f$ and \f$F_h\f$ are surface Monin-Obukhov stability functions calculated in sfc_diff.f and \f$L\f$ is the Obukhov length. Then, the nondimensional gradients of momentum and temperature (phim and phih) are calculated using equations 5 and 6 from Hong and Pan (1996) \cite hong_and_pan_1996 depending on the surface layer stability. Then, the velocity scale valid for the surface layer (\f$w_s\f$, wscale) is calculated using equation 3 from Hong and Pan (1996) \cite hong_and_pan_1996. For the neutral and unstable PBL above the surface layer, the convective velocity scale, \f$w_*\f$, is calculated according to: +!! \f[ +!! w_* = \left(\frac{g}{\theta_0}h\overline{w'\theta_0'}\right)^{1/3} +!! \f] +!! and the mixed layer velocity scale is then calculated with equation 6 from Troen and Mahrt (1986) \cite troen_and_mahrt_1986 +!! \f[ +!! w_s = (u_*^3 + 7\epsilon k w_*^3)^{1/3} +!! \f] + do i=1,im + zol(i) = max(rbsoil(i)*fm(i)*fm(i)/fh(i),rimin) + if(sfcflg(i)) then + zol(i) = min(zol(i),-zfmin) + else + zol(i) = max(zol(i),zfmin) + endif + zol1 = zol(i)*sfcfrac*hpbl(i)/zl(i,1) + if(sfcflg(i)) then +! phim(i) = (1.-aphi16*zol1)**(-1./4.) +! phih(i) = (1.-aphi16*zol1)**(-1./2.) + tem = 1.0 / (1. - aphi16*zol1) + phih(i) = sqrt(tem) + phim(i) = sqrt(phih(i)) + else + phim(i) = 1. + aphi5*zol1 + phih(i) = phim(i) + endif + wscale(i) = ustar(i)/phim(i) + ustmin(i) = ustar(i)/aphi5 + wscale(i) = max(wscale(i),ustmin(i)) + enddo + do i=1,im + if(pblflg(i)) then + if(zol(i) < zolcru .and. kpbl(i) > 1) then + pcnvflg(i) = .true. + else + ublflg(i) = .true. + endif + wst3 = govrth(i)*sflux(i)*hpbl(i) + wstar(i)= wst3**h1 + ust3 = ustar(i)**3. + wscaleu(i) = (ust3+wfac*vk*wst3*sfcfrac)**h1 + wscaleu(i) = max(wscaleu(i),ustmin(i)) + endif + enddo +! +! compute counter-gradient mixing term for heat and moisture +!> ## Update thermal properties of surface parcel and recompute PBL height ("Corrector step"). +!! Next, the counter-gradient terms for temperature and humidity are calculated using equation 4 of Hong and Pan (1996) \cite hong_and_pan_1996 and are used to calculate the "scaled virtual temperature excess near the surface" (equation 9 in Hong and Pan (1996) \cite hong_and_pan_1996) so that the properties of the thermal are updated to recalculate the PBL height. + do i = 1,im + if(ublflg(i)) then + hgamt(i) = min(cfac*heat(i)/wscaleu(i),gamcrt) + hgamq(i) = min(cfac*evap(i)/wscaleu(i),gamcrq) + vpert = hgamt(i) + hgamq(i)*fv*theta(i,1) + vpert = min(vpert,gamcrt) + thermal(i)= thermal(i)+max(vpert,0.) + hgamt(i) = max(hgamt(i),0.0) + hgamq(i) = max(hgamq(i),0.0) + endif + enddo +! +! enhance the pbl height by considering the thermal excess +!> The PBL height calculation follows the same procedure as the predictor step, except that it uses an updated virtual potential temperature for the thermal. + do i=1,im + flg(i) = .true. + if(ublflg(i)) then + flg(i) = .false. + rbup(i) = rbsoil(i) + endif + enddo + do k = 2, kmpbl + do i = 1, im + if(.not.flg(i)) then + rbdn(i) = rbup(i) + spdk2 = max((u1(i,k)**2+v1(i,k)**2),1.) + rbup(i) = (thvx(i,k)-thermal(i))* + & (g*zl(i,k)/thvx(i,1))/spdk2 + kpbl(i) = k + flg(i) = rbup(i) > crb(i) + endif + enddo + enddo + do i = 1,im + if(ublflg(i)) then + k = kpbl(i) + if(rbdn(i) >= crb(i)) then + rbint = 0. + elseif(rbup(i) <= crb(i)) then + rbint = 1. + else + rbint = (crb(i)-rbdn(i))/(rbup(i)-rbdn(i)) + endif + hpbl(i) = zl(i,k-1) + rbint*(zl(i,k)-zl(i,k-1)) + if(hpbl(i) < zi(i,kpbl(i))) kpbl(i) = kpbl(i) - 1 + if(kpbl(i) <= 1) then + ublflg(i) = .false. + pblflg(i) = .false. + endif + endif + enddo +! +! look for stratocumulus +!> ## Determine whether stratocumulus layers exist and compute quantities needed for enhanced diffusion +!! - Starting at the PBL top and going downward, if the level is less than 2.5 km and \f$q_l>q_{l,cr}\f$ then set kcld = k (find the cloud top index in the PBL). If no cloud water above the threshold is found, scuflg is set to F. + do i = 1, im + flg(i)=scuflg(i) + enddo + do k = kmpbl,1,-1 + do i = 1, im + if(flg(i) .and. k <= lcld(i)) then + if(qlx(i,k).ge.qlcr) then + kcld(i)=k + flg(i)=.false. + endif + endif + enddo + enddo + do i = 1, im + if(scuflg(i) .and. kcld(i)==km1) scuflg(i)=.false. + enddo +!> - Starting at the PBL top and going downward, if the level is less than the cloud top, find the level of the minimum radiative heating rate within the cloud. If the level of the minimum is the lowest model level or the minimum radiative heating rate is positive, then set scuflg to F. + do i = 1, im + flg(i)=scuflg(i) + enddo + do k = kmpbl,1,-1 + do i = 1, im + if(flg(i) .and. k <= kcld(i)) then + if(qlx(i,k) >= qlcr) then + if(radx(i,k) < radmin(i)) then + radmin(i)=radx(i,k) + krad(i)=k + endif + else + flg(i)=.false. + endif + endif + enddo + enddo + do i = 1, im + if(scuflg(i) .and. krad(i) <= 1) scuflg(i)=.false. + if(scuflg(i) .and. radmin(i)>=0.) scuflg(i)=.false. + enddo +!> - Starting at the PBL top and going downward, count the number of levels below the minimum radiative heating rate level that have cloud water above the threshold. If there are none, then set the scuflg to F. + do i = 1, im + flg(i)=scuflg(i) + enddo + do k = kmpbl,2,-1 + do i = 1, im + if(flg(i) .and. k <= krad(i)) then + if(qlx(i,k) >= qlcr) then + icld(i)=icld(i)+1 + else + flg(i)=.false. + endif + endif + enddo + enddo + do i = 1, im + if(scuflg(i) .and. icld(i) < 1) scuflg(i)=.false. + enddo +!> - Find the height of the interface where the minimum in radiative heating rate is located. If this height is less than the second model interface height, then set the scuflg to F. + do i = 1, im + if(scuflg(i)) then + hrad(i) = zi(i,krad(i)+1) +! hradm(i)= zl(i,krad(i)) + endif + enddo +! + do i = 1, im + if(scuflg(i) .and. hrad(i) - Calculate the hypothetical \f$\theta_v\f$ at the minimum radiative heating level that a parcel would reach due to radiative cooling after a typical cloud turnover time spent at that level. + do i = 1, im + if(scuflg(i)) then + k = krad(i) + tem = zi(i,k+1)-zi(i,k) + tem1 = cldtime*radmin(i)/tem + thlvx1(i) = thlvx(i,k)+tem1 +! if(thlvx1(i) > thlvx(i,k-1)) scuflg(i)=.false. + endif + enddo +!> - Determine the distance that a parcel would sink downwards starting from the level of minimum radiative heating rate by comparing the hypothetical minimum \f$\theta_v\f$ calculated above with the environmental \f$\theta_v\f$. + do i = 1, im + flg(i)=scuflg(i) + enddo + do k = kmpbl,1,-1 + do i = 1, im + if(flg(i) .and. k <= krad(i))then + if(thlvx1(i) <= thlvx(i,k))then + tem=zi(i,k+1)-zi(i,k) + zd(i)=zd(i)+tem + else + flg(i)=.false. + endif + endif + enddo + enddo +!> - Calculate the cloud thickness, where the cloud top is the in-cloud minimum radiative heating level and the bottom is determined previously. + do i = 1, im + if(scuflg(i))then + kk = max(1, krad(i)+1-icld(i)) + zdd(i) = hrad(i)-zi(i,kk) + endif + enddo +!> - Find the largest between the cloud thickness and the distance of a sinking parcel, then determine the smallest of that number and the height of the minimum in radiative heating rate. Set this number to \f$zd\f$. Using \f$zd\f$, calculate the characteristic velocity scale of cloud-top radiative cooling-driven turbulence. + do i = 1, im + if(scuflg(i))then + zd(i) = max(zd(i),zdd(i)) + zd(i) = min(zd(i),hrad(i)) + tem = govrth(i)*zd(i)*(-radmin(i)) + vrad(i)= tem**h1 + endif + enddo +! +! compute inverse prandtl number +!> ## Calculate the inverse Prandtl number +!! For an unstable PBL, the Prandtl number is calculated according to Hong and Pan (1996) \cite hong_and_pan_1996, equation 10, whereas for a stable boundary layer, the Prandtl number is simply \f$Pr = \frac{\phi_h}{\phi_m}\f$. + do i = 1, im + if(ublflg(i)) then + tem = phih(i)/phim(i)+cfac*vk*sfcfrac + else + tem = phih(i)/phim(i) + endif + prinv(i) = 1.0 / tem + prinv(i) = min(prinv(i),prmax) + prinv(i) = max(prinv(i),prmin) + enddo + do i = 1, im + if(zol(i) > zolcr) then + kpbl(i) = 1 + endif + enddo +! +! compute diffusion coefficients below pbl +!> ## Compute diffusion coefficients below the PBL top +!! Below the PBL top, the diffusion coefficients (\f$K_m\f$ and \f$K_h\f$) are calculated according to equation 2 in Hong and Pan (1996) \cite hong_and_pan_1996 where a different value for \f$w_s\f$ (PBL vertical velocity scale) is used depending on the PBL stability. \f$K_h\f$ is calculated from \f$K_m\f$ using the Prandtl number. The calculated diffusion coefficients are checked so that they are bounded by maximum values and the local background diffusion coefficients. + do k = 1, kmpbl + do i=1,im + if(k < kpbl(i)) then +! zfac = max((1.-(zi(i,k+1)-zl(i,1))/ +! 1 (hpbl(i)-zl(i,1))), zfmin) + zfac = max((1.-zi(i,k+1)/hpbl(i)), zfmin) + tem = zi(i,k+1) * (zfac**pfac) * moninq_fac ! lmh suggested by kg + if(pblflg(i)) then + tem1 = vk * wscaleu(i) * tem +! dku(i,k) = xkzmo(i,k) + tem1 +! dkt(i,k) = xkzo(i,k) + tem1 * prinv(i) + dku(i,k) = tem1 + dkt(i,k) = tem1 * prinv(i) + else + tem1 = vk * wscale(i) * tem +! dku(i,k) = xkzmo(i,k) + tem1 +! dkt(i,k) = xkzo(i,k) + tem1 * prinv(i) + dku(i,k) = tem1 + dkt(i,k) = tem1 * prinv(i) + endif + dku(i,k) = min(dku(i,k),dkmax) + dku(i,k) = max(dku(i,k),xkzmo(i,k)) + dkt(i,k) = min(dkt(i,k),dkmax) + dkt(i,k) = max(dkt(i,k),xkzo(i,k)) + dktx(i,k)= dkt(i,k) + endif + enddo + enddo +! +! compute diffusion coefficients based on local scheme above pbl +!> ## Compute diffusion coefficients above the PBL top +!! Diffusion coefficients above the PBL top are computed as a function of local stability (gradient Richardson number), shear, and a length scale from Louis (1979) \cite louis_1979 : +!! \f[ +!! K_{m,h}=l^2f_{m,h}(Ri_g)\left|\frac{\partial U}{\partial z}\right| +!! \f] +!! The functions used (\f$f_{m,h}\f$) depend on the local stability. First, the gradient Richardson number is calculated as +!! \f[ +!! Ri_g=\frac{\frac{g}{T}\frac{\partial \theta_v}{\partial z}}{\frac{\partial U}{\partial z}^2} +!! \f] +!! where \f$U\f$ is the horizontal wind. For the unstable case (\f$Ri_g < 0\f$), the Richardson number-dependent functions are given by +!! \f[ +!! f_h(Ri_g) = 1 + \frac{8\left|Ri_g\right|}{1 + 1.286\sqrt{\left|Ri_g\right|}}\\ +!! \f] +!! \f[ +!! f_m(Ri_g) = 1 + \frac{8\left|Ri_g\right|}{1 + 1.746\sqrt{\left|Ri_g\right|}}\\ +!! \f] +!! For the stable case, the following formulas are used +!! \f[ +!! f_h(Ri_g) = \frac{1}{\left(1 + 5Ri_g\right)^2}\\ +!! \f] +!! \f[ +!! Pr = \frac{K_h}{K_m} = 1 + 2.1Ri_g +!! \f] +!! The source for the formulas used for the Richardson number-dependent functions is unclear. They are different than those used in Hong and Pan (1996) \cite hong_and_pan_1996 as the previous documentation suggests. They follow equation 14 of Louis (1979) \cite louis_1979 for the unstable case, but it is unclear where the values of the coefficients \f$b\f$ and \f$c\f$ from that equation used in this scheme originate. Finally, the length scale, \f$l\f$ is calculated according to the following formula from Hong and Pan (1996) \cite hong_and_pan_1996 +!! \f[ +!! \frac{1}{l} = \frac{1}{kz} + \frac{1}{l_0}\\ +!! \f] +!! \f[ +!! or\\ +!! \f] +!! \f[ +!! l=\frac{l_0kz}{l_0+kz} +!! \f] +!! where \f$l_0\f$ is currently 30 m for stable conditions and 150 m for unstable. Finally, the diffusion coefficients are kept in a range bounded by the background diffusion and the maximum allowable values. + do k = 1, km1 + do i=1,im + if(k >= kpbl(i)) then + bvf2 = g*bf(i,k)*ti(i,k) + ri = max(bvf2/shr2(i,k),rimin) + zk = vk*zi(i,k+1) + if(ri < 0.) then ! unstable regime + rl2 = zk*rlamun/(rlamun+zk) + dk = rl2*rl2*sqrt(shr2(i,k)) + sri = sqrt(-ri) +! dku(i,k) = xkzmo(i,k) + dk*(1+8.*(-ri)/(1+1.746*sri)) +! dkt(i,k) = xkzo(i,k) + dk*(1+8.*(-ri)/(1+1.286*sri)) + dku(i,k) = dk*(1+8.*(-ri)/(1+1.746*sri)) + dkt(i,k) = dk*(1+8.*(-ri)/(1+1.286*sri)) + else ! stable regime + rl2 = zk*rlam/(rlam+zk) +!! tem = rlam * sqrt(0.01*prsi(i,k)) +!! rl2 = zk*tem/(tem+zk) + dk = rl2*rl2*sqrt(shr2(i,k)) + tem1 = dk/(1+5.*ri)**2 +! + if(k >= kpblx(i)) then + prnum = 1.0 + 2.1*ri + prnum = min(prnum,prmax) + else + prnum = 1.0 + endif +! dku(i,k) = xkzmo(i,k) + tem1 * prnum +! dkt(i,k) = xkzo(i,k) + tem1 + dku(i,k) = tem1 * prnum + dkt(i,k) = tem1 + endif +! + dku(i,k) = min(dku(i,k),dkmax) + dku(i,k) = max(dku(i,k),xkzmo(i,k)) + dkt(i,k) = min(dkt(i,k),dkmax) + dkt(i,k) = max(dkt(i,k),xkzo(i,k)) +! + endif +! + enddo + enddo +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! compute components for mass flux mixing by large thermals +!> ## If the PBL is convective, call the mass flux scheme to replace the countergradient terms. +!! If the PBL is convective, the updraft properties are initialized to be the same as the state variables and the subroutine mfpbl is called. + do k = 1, km + do i = 1, im + if(pcnvflg(i)) then + tcko(i,k) = t1(i,k) + ucko(i,k) = u1(i,k) + vcko(i,k) = v1(i,k) + xmf(i,k) = 0. + endif + enddo + enddo + do kk = 1, ntrac + do k = 1, km + do i = 1, im + if(pcnvflg(i)) then + qcko(i,k,kk) = q1(i,k,kk) + endif + enddo + enddo + enddo +!> For details of the mfpbl subroutine, step into its documentation ::mfpbl + call mfpbl(im,ix,km,ntrac,dt2,pcnvflg, + & zl,zi,thvx,q1,t1,u1,v1,hpbl,kpbl, + & sflux,ustar,wstar,xmf,tcko,qcko,ucko,vcko) +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! compute diffusion coefficients for cloud-top driven diffusion +! if the condition for cloud-top instability is met, +! increase entrainment flux at cloud top +! +!> ## Compute enhanced diffusion coefficients related to stratocumulus-topped PBLs +!! If a stratocumulus layer has been identified in the PBL, the diffusion coefficients in the PBL are modified in the following way. +!! +!! -# First, the criteria for CTEI is checked, using the threshold from equation 13 of Macvean and Mason (1990) \cite macvean_and_mason_1990. If the criteria is met, the cloud top diffusion is increased: +!! \f[ +!! K_h^{Sc} = -c\frac{\Delta F_R}{\rho c_p}\frac{1}{\frac{\partial \theta_v}{\partial z}} +!! \f] +!! where the constant \f$c\f$ is set to 0.2 if the CTEI criterion is not met and 1.0 if it is. +!! +!! -# Calculate the diffusion coefficients due to stratocumulus mixing according to equation 5 in Lock et al. (2000) \cite lock_et_al_2000 for every level below the stratocumulus top using the characteristic stratocumulus velocity scale previously calculated. The diffusion coefficient for momentum is calculated assuming a constant inverse Prandtl number of 0.75. + do i = 1, im + if(scuflg(i)) then + k = krad(i) + tem = thetae(i,k) - thetae(i,k+1) + tem1 = qtx(i,k) - qtx(i,k+1) + if (tem > 0. .and. tem1 > 0.) then + cteit= cp*tem/(hvap*tem1) + if(cteit > actei) rent(i) = rentf2 + endif + endif + enddo + do i = 1, im + if(scuflg(i)) then + k = krad(i) + tem1 = max(bf(i,k),tdzmin) + ckt(i,k) = -rent(i)*radmin(i)/tem1 + cku(i,k) = ckt(i,k) + endif + enddo +! + do k = 1, kmpbl + do i=1,im + if(scuflg(i) .and. k < krad(i)) then + tem1=hrad(i)-zd(i) + tem2=zi(i,k+1)-tem1 + if(tem2 > 0.) then + ptem= tem2/zd(i) + if(ptem.ge.1.) ptem= 1. + ptem= tem2*ptem*sqrt(1.-ptem) + ckt(i,k) = radfac*vk*vrad(i)*ptem + cku(i,k) = 0.75*ckt(i,k) + ckt(i,k) = max(ckt(i,k),dkmin) + ckt(i,k) = min(ckt(i,k),dkmax) + cku(i,k) = max(cku(i,k),dkmin) + cku(i,k) = min(cku(i,k),dkmax) + endif + endif + enddo + enddo +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +!> After \f$K_h^{Sc}\f$ has been determined from the surface to the top of the stratocumulus layer, it is added to the value for the diffusion coefficient calculated previously using surface-based mixing [see equation 6 of Lock et al. (2000) \cite lock_et_al_2000 ]. + do k = 1, kmpbl + do i=1,im + if(scuflg(i)) then + dkt(i,k) = dkt(i,k)+ckt(i,k) + dku(i,k) = dku(i,k)+cku(i,k) + dkt(i,k) = min(dkt(i,k),dkmax) + dku(i,k) = min(dku(i,k),dkmax) + endif + enddo + enddo +! +! compute tridiagonal matrix elements for heat and moisture +! +!> ## Solve for the temperature and moisture tendencies due to vertical mixing. +!! The tendencies of heat, moisture, and momentum due to vertical diffusion are calculated using a two-part process. First, a solution is obtained using an implicit time-stepping scheme, then the time tendency terms are "backed out". The tridiagonal matrix elements for the implicit solution for temperature and moisture are prepared in this section, with differing algorithms depending on whether the PBL was convective (substituting the mass flux term for counter-gradient term), unstable but not convective (using the computed counter-gradient terms), or stable (no counter-gradient terms). + do i=1,im + ad(i,1) = 1. + a1(i,1) = t1(i,1) + beta(i) * heat(i) + a2(i,1) = q1(i,1,1) + beta(i) * evap(i) + enddo + + if(ntrac >= 2) then + do k = 2, ntrac + is = (k-1) * km + do i = 1, im + a2(i,1+is) = q1(i,1,k) + enddo + enddo + endif +! + do k = 1,km1 + do i = 1,im + dtodsd = dt2/del(i,k) + dtodsu = dt2/del(i,k+1) + dsig = prsl(i,k)-prsl(i,k+1) + rdz = rdzt(i,k) + tem1 = dsig * dkt(i,k) * rdz + dsdz2 = tem1 * rdz + au(i,k) = -dtodsd*dsdz2 + al(i,k) = -dtodsu*dsdz2 +! + if(pcnvflg(i) .and. k < kpbl(i)) then + tem2 = dsig * rdz + ptem = 0.5 * tem2 * xmf(i,k) + ptem1 = dtodsd * ptem + ptem2 = dtodsu * ptem + ad(i,k) = ad(i,k)-au(i,k)-ptem1 + ad(i,k+1) = 1.-al(i,k)+ptem2 + au(i,k) = au(i,k)-ptem1 + al(i,k) = al(i,k)+ptem2 + ptem = tcko(i,k) + tcko(i,k+1) + dsdzt = tem1 * gocp + a1(i,k) = a1(i,k)+dtodsd*dsdzt-ptem1*ptem + a1(i,k+1) = t1(i,k+1)-dtodsu*dsdzt+ptem2*ptem + ptem = qcko(i,k,1) + qcko(i,k+1,1) + a2(i,k) = a2(i,k) - ptem1 * ptem + a2(i,k+1) = q1(i,k+1,1) + ptem2 * ptem + elseif(ublflg(i) .and. k < kpbl(i)) then + ptem1 = dsig * dktx(i,k) * rdz + tem = 1.0 / hpbl(i) + dsdzt = tem1 * gocp - ptem1 * hgamt(i) * tem + dsdzq = - ptem1 * hgamq(i) * tem + ad(i,k) = ad(i,k)-au(i,k) + ad(i,k+1) = 1.-al(i,k) + a1(i,k) = a1(i,k)+dtodsd*dsdzt + a1(i,k+1) = t1(i,k+1)-dtodsu*dsdzt + a2(i,k) = a2(i,k)+dtodsd*dsdzq + a2(i,k+1) = q1(i,k+1,1)-dtodsu*dsdzq + else + ad(i,k) = ad(i,k)-au(i,k) + ad(i,k+1) = 1.-al(i,k) + dsdzt = tem1 * gocp + a1(i,k) = a1(i,k)+dtodsd*dsdzt + a1(i,k+1) = t1(i,k+1)-dtodsu*dsdzt + a2(i,k+1) = q1(i,k+1,1) + endif +! + enddo + enddo +! + if(ntrac >= 2) then + do kk = 2, ntrac + is = (kk-1) * km + do k = 1, km1 + do i = 1, im + if(pcnvflg(i) .and. k < kpbl(i)) then + dtodsd = dt2/del(i,k) + dtodsu = dt2/del(i,k+1) + dsig = prsl(i,k)-prsl(i,k+1) + tem = dsig * rdzt(i,k) + ptem = 0.5 * tem * xmf(i,k) + ptem1 = dtodsd * ptem + ptem2 = dtodsu * ptem + tem1 = qcko(i,k,kk) + qcko(i,k+1,kk) + a2(i,k+is) = a2(i,k+is) - ptem1*tem1 + a2(i,k+1+is)= q1(i,k+1,kk) + ptem2*tem1 + else + a2(i,k+1+is) = q1(i,k+1,kk) + endif + enddo + enddo + enddo + endif +! +! solve tridiagonal problem for heat and moisture +! +!> The tridiagonal system is solved by calling the internal ::tridin subroutine. + call tridin(im,km,ntrac,al,ad,au,a1,a2,au,a1,a2) + +! +! recover tendencies of heat and moisture +! +!> After returning with the solution, the tendencies for temperature and moisture are recovered. + do k = 1,km + do i = 1,im + ttend = (a1(i,k)-t1(i,k)) * rdt + qtend = (a2(i,k)-q1(i,k,1))*rdt + tau(i,k) = tau(i,k)+ttend + rtg(i,k,1) = rtg(i,k,1)+qtend + dtsfc(i) = dtsfc(i)+cont*del(i,k)*ttend + dqsfc(i) = dqsfc(i)+conq*del(i,k)*qtend + enddo + enddo + if(ntrac >= 2) then + do kk = 2, ntrac + is = (kk-1) * km + do k = 1, km + do i = 1, im + qtend = (a2(i,k+is)-q1(i,k,kk))*rdt + rtg(i,k,kk) = rtg(i,k,kk)+qtend + enddo + enddo + enddo + endif +! +! compute tke dissipation rate +! +!> ## Calculate heating due to TKE dissipation and add to the tendency for temperature +!! Following Han et al. (2016) \cite Han_2016 , turbulence dissipation contributes to the tendency of temperature in the following way. First, turbulence dissipation is calculated by equation 17 of Han et al. (2016) \cite Han_2016 for the PBL and equation 16 for the surface layer. + if(dspheat) then +! + do k = 1,km1 + do i = 1,im + diss(i,k) = dku(i,k)*shr2(i,k)-g*ti(i,k)*dkt(i,k)*bf(i,k) +! diss(i,k) = dku(i,k)*shr2(i,k) + enddo + enddo +! +! add dissipative heating at the first model layer +! +!> Next, the temperature tendency is updated following equation 14. + do i = 1,im + tem = govrth(i)*sflux(i) + tem1 = tem + stress(i)*spd1(i)/zl(i,1) + tem2 = 0.5 * (tem1+diss(i,1)) + tem2 = max(tem2, 0.) + ttend = tem2 / cp + tau(i,1) = tau(i,1)+0.5*ttend + enddo +! +! add dissipative heating above the first model layer +! + do k = 2,km1 + do i = 1,im + tem = 0.5 * (diss(i,k-1)+diss(i,k)) + tem = max(tem, 0.) + ttend = tem / cp + tau(i,k) = tau(i,k) + 0.5*ttend + enddo + enddo +! + endif +! +! compute tridiagonal matrix elements for momentum +! +!> ## Solve for the horizontal momentum tendencies and add them to the output tendency terms +!! As with the temperature and moisture tendencies, the horizontal momentum tendencies are calculated by solving tridiagonal matrices after the matrices are prepared in this section. + do i=1,im + ad(i,1) = 1.0 + beta(i) * stress(i) / spd1(i) + a1(i,1) = u1(i,1) + a2(i,1) = v1(i,1) + enddo +! + do k = 1,km1 + do i=1,im + dtodsd = dt2/del(i,k) + dtodsu = dt2/del(i,k+1) + dsig = prsl(i,k)-prsl(i,k+1) + rdz = rdzt(i,k) + tem1 = dsig*dku(i,k)*rdz + dsdz2 = tem1 * rdz + au(i,k) = -dtodsd*dsdz2 + al(i,k) = -dtodsu*dsdz2 +! + if(pcnvflg(i) .and. k < kpbl(i)) then + tem2 = dsig * rdz + ptem = 0.5 * tem2 * xmf(i,k) + ptem1 = dtodsd * ptem + ptem2 = dtodsu * ptem + ad(i,k) = ad(i,k)-au(i,k)-ptem1 + ad(i,k+1) = 1.-al(i,k)+ptem2 + au(i,k) = au(i,k)-ptem1 + al(i,k) = al(i,k)+ptem2 + ptem = ucko(i,k) + ucko(i,k+1) + a1(i,k) = a1(i,k) - ptem1 * ptem + a1(i,k+1) = u1(i,k+1) + ptem2 * ptem + ptem = vcko(i,k) + vcko(i,k+1) + a2(i,k) = a2(i,k) - ptem1 * ptem + a2(i,k+1) = v1(i,k+1) + ptem2 * ptem + else + ad(i,k) = ad(i,k)-au(i,k) + ad(i,k+1) = 1.-al(i,k) + a1(i,k+1) = u1(i,k+1) + a2(i,k+1) = v1(i,k+1) + endif +! + enddo + enddo +! +! solve tridiagonal problem for momentum +! + call tridi2(im,km,al,ad,au,a1,a2,au,a1,a2) +! +! recover tendencies of momentum +! +!> Finally, the tendencies are recovered from the tridiagonal solutions. + do k = 1,km + do i = 1,im + utend = (a1(i,k)-u1(i,k))*rdt + vtend = (a2(i,k)-v1(i,k))*rdt + du(i,k) = du(i,k) + utend + dv(i,k) = dv(i,k) + vtend + dusfc(i) = dusfc(i) + conw*del(i,k)*utend + dvsfc(i) = dvsfc(i) + conw*del(i,k)*vtend +! +! for dissipative heating for ecmwf model +! +! tem1 = 0.5*(a1(i,k)+u1(i,k)) +! tem2 = 0.5*(a2(i,k)+v1(i,k)) +! diss(i,k) = -(tem1*utend+tem2*vtend) +! diss(i,k) = max(diss(i,k),0.) +! ttend = diss(i,k) / cp +! tau(i,k) = tau(i,k) + ttend +! + enddo + enddo +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! + do i = 1, im + hpbl(i) = hpblx(i) + kpbl(i) = kpblx(i) + enddo +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + return + end subroutine hedmf_run +!> @} +!> @} + + end module hedmf From 2781be174d1b3b9e2e93e65dd7ba66486f97d29e Mon Sep 17 00:00:00 2001 From: climbfuji Date: Wed, 24 Jul 2019 08:08:52 -0400 Subject: [PATCH 38/89] physics/sfc_diff.f: add HAFS code as in IPD version --- physics/sfc_diff.f | 337 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 336 insertions(+), 1 deletion(-) diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 7757dd3c9..8e265f227 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -56,6 +56,9 @@ end subroutine sfc_diff_finalize !! | ztpert | perturbation_of_heat_to_momentum_roughness_length_ratio | perturbation of heat to momentum roughness length ratio | frac | 1 | real | kind_phys | in | F | !! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | !! | redrag | flag_for_reduced_drag_coefficient_over_sea | flag for reduced drag coefficient over sea | flag | 0 | logical | | in | F | +!! | u10m | x_wind_at_10m | 10 meter u wind speed | m s-1 | 1 | real | kind_phys | in | F | +!! | v10m | y_wind_at_10m | 10 meter v wind speed | m s-1 | 1 | real | kind_phys | in | F | +!! | sfc_z0_type | flag_for_surface_roughness_option_over_ocean | surface roughness options over ocean | flag | 0 | integer | | in | F | !! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | !! | dry | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | !! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | @@ -134,6 +137,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) & sigmaf,vegtype,shdmax,ivegsrc, & !intent(in) & z0pert,ztpert, & ! mg, sfc-perts !intent(in) & flag_iter,redrag, & !intent(in) + & u10m,v10m,sfc_z0_type, & !hafs,z0 type !intent(in) & wet,dry,icy, & !intent(in) & tskin_ocn, tskin_lnd, tskin_ice, & !intent(in) & tsurf_ocn, tsurf_lnd, tsurf_ice, & !intent(in) @@ -156,11 +160,14 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) implicit none ! integer, intent(in) :: im, ivegsrc + integer, intent(in) :: sfc_z0_type ! option for calculating surface roughness length over ocean + integer, dimension(im), intent(in) :: vegtype logical, intent(in) :: redrag ! reduced drag coeff. flag for high wind over sea (j.han) logical, dimension(im), intent(in) :: flag_iter, wet, dry, icy ! added by s.lu + real(kind=kind_phys), dimension(im), intent(in) :: u10m,v10m real(kind=kind_phys), intent(in) :: rvrdm1, eps, epsm1, grav real(kind=kind_phys), dimension(im), intent(in) :: & & ps,u1,v1,t1,q1,z1,prsl1,prslki,ddvel, & @@ -188,6 +195,8 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! ! locals ! + real(kind=kind_phys), dimension(im) :: wind10m + integer i ! real(kind=kind_phys) :: qs1, rat, thv1, restar, @@ -227,9 +236,16 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! ps is in pascals, wind is wind speed, ! surface roughness length is converted to m from cm ! + +! write(0,*)'in sfc_diff, sfc_z0_type=',sfc_z0_type + do i=1,im - ztmax_ocn = 0.; ztmax_lnd = 0.; ztmax_ice = 0. + ztmax_ocn = 0.0 ; ztmax_lnd = 0.0 ; ztmax_ice = 0.0 + + wind10m(i) = max(sqrt( u10m(i)*u10m(i) + v10m(i)*v10m(i)), + & 1.0) + if(flag_iter(i)) then wind(i) = max(sqrt(u1(i)*u1(i) + v1(i)*v1(i)) & + max(0.0, min(ddvel(i), 30.0)), 1.0) @@ -270,7 +286,18 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) rat = min(7.0, 2.67 * sqrt(sqrt(restar)) - 2.57) ztmax_ocn = z0max_ocn * exp(-rat) + + if (sfc_z0_type == 6) then + call znot_t_v6(wind10m(i),ztmax_ocn) ! 10-m wind,m/s, ztmax(m) + else if (sfc_z0_type == 7) then + call znot_t_v7(wind10m(i),ztmax_ocn) ! 10-m wind,m/s, ztmax(m) + else if (sfc_z0_type .ne. 0) then + write(0,*)'no option for sfc_z0_type=',sfc_z0_type + stop + endif + endif ! Open ocean + if (dry(i) .or. icy(i)) then ! over land or sea ice !** xubin's new z0 over land and sea ice tem1 = 1.0 - shdmax(i) @@ -396,6 +423,17 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) else z0rl_ocn(i) = 100.0 * max(min(z0_ocn,.1), 1.e-7) endif + + if (sfc_z0_type == 6) then ! wang + call znot_m_v6(wind10m(i),z0_ocn) ! wind, m/s, z0, m + z0rl_ocn(i) = 100.0 * z0_ocn ! cm + endif !wang + if (sfc_z0_type == 7) then ! wang + call znot_m_v7(wind10m(i),z0_ocn) ! wind, m/s, z0, m + z0rl_ocn(i) = 100.0 * z0_ocn ! cm + endif !wang + + endif ! end of if(open ocean) endif ! end of if(flagiter) loop enddo @@ -559,5 +597,302 @@ subroutine stability & end subroutine stability !--------------------------------- + +!! add fitted z0,zt curves for hurricane application (used in HWRF/HMON) +!! Weiguo Wang, 2019-0425 + + SUBROUTINE znot_m_v6(uref,znotm) + IMPLICIT NONE +! Calculate areodynamical roughness over water with input 10-m wind +! For low-to-moderate winds, try to match the Cd-U10 relationship from COARE V3.5 (Edson et al. 2013) +! For high winds, try to fit available observational data +! +! Bin Liu, NOAA/NCEP/EMC 2017 +! +! uref(m/s) : wind speed at 10-m height +! znotm(meter): areodynamical roughness scale over water +! + + REAL, INTENT(IN) :: uref + REAL, INTENT(OUT):: znotm + REAL :: p13, p12, p11, p10 + REAL :: p25, p24, p23, p22, p21, p20 + REAL :: p35, p34, p33, p32, p31, p30 + REAL :: p40 + + p13 = -1.296521881682694e-02 + p12 = 2.855780863283819e-01 + p11 = -1.597898515251717e+00 + p10 = -8.396975715683501e+00 + + p25 = 3.790846746036765e-10 + p24 = 3.281964357650687e-09 + p23 = 1.962282433562894e-07 + p22 = -1.240239171056262e-06 + p21 = 1.739759082358234e-07 + p20 = 2.147264020369413e-05 + + p35 = 1.840430200185075e-07 + p34 = -2.793849676757154e-05 + p33 = 1.735308193700643e-03 + p32 = -6.139315534216305e-02 + p31 = 1.255457892775006e+00 + p30 = -1.663993561652530e+01 + + p40 = 4.579369142033410e-04 + + if (uref >= 0.0 .and. uref <= 6.5 ) then + znotm = exp( p10 + p11*uref + p12*uref**2 + + & p13*uref**3) + elseif (uref > 6.5 .and. uref <= 15.7) then + znotm = p25*uref**5 + p24*uref**4 + p23*uref**3 + + & p22*uref**2 + p21*uref + p20 + elseif (uref > 15.7 .and. uref <= 53.0) then + znotm = exp( p35*uref**5 + p34*uref**4 + + & p33*uref**3 + p32*uref**2 + p31*uref + p30 ) + elseif ( uref > 53.0) then + znotm = p40 + else + print*, 'Wrong input uref value:',uref + endif + + END SUBROUTINE znot_m_v6 + + SUBROUTINE znot_t_v6(uref,znott) + IMPLICIT NONE +! Calculate scalar roughness over water with input 10-m wind +! For low-to-moderate winds, try to match the Ck-U10 relationship from COARE algorithm +! For high winds, try to retain the Ck-U10 relationship of FY2015 HWRF +! +! Bin Liu, NOAA/NCEP/EMC 2017 +! +! uref(m/s) : wind speed at 10-m height +! znott(meter): scalar roughness scale over water +! + + REAL, INTENT(IN) :: uref + REAL, INTENT(OUT):: znott + + REAL :: p00 + REAL :: p15, p14, p13, p12, p11, p10 + REAL :: p25, p24, p23, p22, p21, p20 + REAL :: p35, p34, p33, p32, p31, p30 + REAL :: p45, p44, p43, p42, p41, p40 + REAL :: p56, p55, p54, p53, p52, p51, p50 + REAL :: p60 + + p00 = 1.100000000000000e-04 + + p15 = -9.144581627678278e-10 + p14 = 7.020346616456421e-08 + p13 = -2.155602086883837e-06 + p12 = 3.333848806567684e-05 + p11 = -2.628501274963990e-04 + p10 = 8.634221567969181e-04 + + p25 = -8.654513012535990e-12 + p24 = 1.232380050058077e-09 + p23 = -6.837922749505057e-08 + p22 = 1.871407733439947e-06 + p21 = -2.552246987137160e-05 + p20 = 1.428968311457630e-04 + + p35 = 3.207515102100162e-12 + p34 = -2.945761895342535e-10 + p33 = 8.788972147364181e-09 + p32 = -3.814457439412957e-08 + p31 = -2.448983648874671e-06 + p30 = 3.436721779020359e-05 + + p45 = -3.530687797132211e-11 + p44 = 3.939867958963747e-09 + p43 = -1.227668406985956e-08 + p42 = -1.367469811838390e-05 + p41 = 5.988240863928883e-04 + p40 = -7.746288511324971e-03 + + p56 = -1.187982453329086e-13 + p55 = 4.801984186231693e-11 + p54 = -8.049200462388188e-09 + p53 = 7.169872601310186e-07 + p52 = -3.581694433758150e-05 + p51 = 9.503919224192534e-04 + p50 = -1.036679430885215e-02 + + p60 = 4.751256171799112e-05 + + if (uref >= 0.0 .and. uref < 5.9 ) then + znott = p00 + elseif (uref >= 5.9 .and. uref <= 15.4) then + znott = p15*uref**5 + p14*uref**4 + p13*uref**3 + & + p12*uref**2 + p11*uref + p10 + elseif (uref > 15.4 .and. uref <= 21.6) then + znott = p25*uref**5 + p24*uref**4 + p23*uref**3 + & + p22*uref**2 + p21*uref + p20 + elseif (uref > 21.6 .and. uref <= 42.2) then + znott = p35*uref**5 + p34*uref**4 + p33*uref**3 + & + p32*uref**2 + p31*uref + p30 + elseif ( uref > 42.2 .and. uref <= 53.3) then + znott = p45*uref**5 + p44*uref**4 + p43*uref**3 + & + p42*uref**2 + p41*uref + p40 + elseif ( uref > 53.3 .and. uref <= 80.0) then + znott = p56*uref**6 + p55*uref**5 + p54*uref**4 + & + p53*uref**3 + p52*uref**2 + p51*uref + p50 + elseif ( uref > 80.0) then + znott = p60 + else + print*, 'Wrong input uref value:',uref + endif + + END SUBROUTINE znot_t_v6 + + + SUBROUTINE znot_m_v7(uref,znotm) + IMPLICIT NONE +! Calculate areodynamical roughness over water with input 10-m wind +! For low-to-moderate winds, try to match the Cd-U10 relationship from COARE V3.5 (Edson et al. 2013) +! For high winds, try to fit available observational data +! Comparing to znot_t_v6, slightly decrease Cd for higher wind speed +! +! Bin Liu, NOAA/NCEP/EMC 2018 +! +! uref(m/s) : wind speed at 10-m height +! znotm(meter): areodynamical roughness scale over water +! + + REAL, INTENT(IN) :: uref + REAL, INTENT(OUT):: znotm + REAL :: p13, p12, p11, p10 + REAL :: p25, p24, p23, p22, p21, p20 + REAL :: p35, p34, p33, p32, p31, p30 + REAL :: p40 + + p13 = -1.296521881682694e-02 + p12 = 2.855780863283819e-01 + p11 = -1.597898515251717e+00 + p10 = -8.396975715683501e+00 + + p25 = 3.790846746036765e-10 + p24 = 3.281964357650687e-09 + p23 = 1.962282433562894e-07 + p22 = -1.240239171056262e-06 + p21 = 1.739759082358234e-07 + p20 = 2.147264020369413e-05 + + + p35 = 1.897534489606422e-07 + p34 = -3.019495980684978e-05 + p33 = 1.931392924987349e-03 + p32 = -6.797293095862357e-02 + p31 = 1.346757797103756e+00 + p30 = -1.707846930193362e+01 + + p40 = 3.371427455376717e-04 + + if (uref >= 0.0 .and. uref <= 6.5 ) then + znotm = exp( p10 + p11*uref + p12*uref**2 + p13*uref**3) + elseif (uref > 6.5 .and. uref <= 15.7) then + znotm = p25*uref**5 + p24*uref**4 + p23*uref**3 + + & p22*uref**2 + p21*uref + p20 + elseif (uref > 15.7 .and. uref <= 53.0) then + znotm = exp( p35*uref**5 + p34*uref**4 + p33*uref**3 + & + p32*uref**2 + p31*uref + p30 ) + elseif ( uref > 53.0) then + znotm = p40 + else + print*, 'Wrong input uref value:',uref + endif + + END SUBROUTINE znot_m_v7 + SUBROUTINE znot_t_v7(uref,znott) + IMPLICIT NONE +! Calculate scalar roughness over water with input 10-m wind +! For low-to-moderate winds, try to match the Ck-U10 relationship from COARE algorithm +! For high winds, try to retain the Ck-U10 relationship of FY2015 HWRF +! To be compatible with the slightly decreased Cd for higher wind speed +! +! Bin Liu, NOAA/NCEP/EMC 2018 +! +! uref(m/s) : wind speed at 10-m height +! znott(meter): scalar roughness scale over water +! + + REAL, INTENT(IN) :: uref + REAL, INTENT(OUT):: znott + + REAL :: p00 + REAL :: p15, p14, p13, p12, p11, p10 + REAL :: p25, p24, p23, p22, p21, p20 + REAL :: p35, p34, p33, p32, p31, p30 + REAL :: p45, p44, p43, p42, p41, p40 + REAL :: p56, p55, p54, p53, p52, p51, p50 + REAL :: p60 + + p00 = 1.100000000000000e-04 + + p15 = -9.193764479895316e-10 + p14 = 7.052217518653943e-08 + p13 = -2.163419217747114e-06 + p12 = 3.342963077911962e-05 + p11 = -2.633566691328004e-04 + p10 = 8.644979973037803e-04 + + p25 = -9.402722450219142e-12 + p24 = 1.325396583616614e-09 + p23 = -7.299148051141852e-08 + p22 = 1.982901461144764e-06 + p21 = -2.680293455916390e-05 + p20 = 1.484341646128200e-04 + + p35 = 7.921446674311864e-12 + p34 = -1.019028029546602e-09 + p33 = 5.251986927351103e-08 + p32 = -1.337841892062716e-06 + p31 = 1.659454106237737e-05 + p30 = -7.558911792344770e-05 + + p45 = -2.694370426850801e-10 + p44 = 5.817362913967911e-08 + p43 = -5.000813324746342e-06 + p42 = 2.143803523428029e-04 + p41 = -4.588070983722060e-03 + p40 = 3.924356617245624e-02 + + p56 = -1.663918773476178e-13 + p55 = 6.724854483077447e-11 + p54 = -1.127030176632823e-08 + p53 = 1.003683177025925e-06 + p52 = -5.012618091180904e-05 + p51 = 1.329762020689302e-03 + p50 = -1.450062148367566e-02 + + p60 = 6.840803042788488e-05 + + if (uref >= 0.0 .and. uref < 5.9 ) then + znott = p00 + elseif (uref >= 5.9 .and. uref <= 15.4) then + znott = p15*uref**5 + p14*uref**4 + p13*uref**3 + + & p12*uref**2 + p11*uref + p10 + elseif (uref > 15.4 .and. uref <= 21.6) then + znott = p25*uref**5 + p24*uref**4 + p23*uref**3 + + & p22*uref**2 + p21*uref + p20 + elseif (uref > 21.6 .and. uref <= 42.6) then + znott = p35*uref**5 + p34*uref**4 + p33*uref**3 + + & p32*uref**2 + p31*uref + p30 + elseif ( uref > 42.6 .and. uref <= 53.0) then + znott = p45*uref**5 + p44*uref**4 + p43*uref**3 + + & p42*uref**2 + p41*uref + p40 + elseif ( uref > 53.0 .and. uref <= 80.0) then + znott = p56*uref**6 + p55*uref**5 + p54*uref**4 + + & p53*uref**3 + p52*uref**2 + p51*uref + p50 + elseif ( uref > 80.0) then + znott = p60 + else + print*, 'Wrong input uref value:',uref + endif + + END SUBROUTINE znot_t_v7 + + !--------------------------------- end module sfc_diff From d70a1a4bde148fb396108042b536300cbf7a8a03 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Thu, 25 Jul 2019 15:46:19 -0600 Subject: [PATCH 39/89] Convert machine.F and ysuvdif.F90 to new metadata format --- physics/machine.F | 6 +- physics/machine.meta | 21 ++ physics/ysuvdif.F90 | 54 +----- physics/ysuvdif.meta | 452 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 475 insertions(+), 58 deletions(-) create mode 100644 physics/machine.meta create mode 100644 physics/ysuvdif.meta diff --git a/physics/machine.F b/physics/machine.F index 8adf87ac6..f50a950d7 100644 --- a/physics/machine.F +++ b/physics/machine.F @@ -2,11 +2,7 @@ module machine #if 0 !! \section arg_table_machine -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------------------------|-------------------------- |-------------------------------------------------------|---------|------|-----------|----------|--------|----------| -!! | kind_dyn | kind_dyn | definition of kind_dyn | none | 0 | integer | | none | F | -!! | kind_grid | kind_grid | definition of kind_grid | none | 0 | integer | | none | F | -!! | kind_phys | kind_phys | definition of kind_phys | none | 0 | integer | | none | F | +!! \htmlinclude machine.html !! #endif diff --git a/physics/machine.meta b/physics/machine.meta new file mode 100644 index 000000000..43fc8770a --- /dev/null +++ b/physics/machine.meta @@ -0,0 +1,21 @@ +[ccpp-arg-table] + name = machine + type = module +[kind_dyn] + standard_name = kind_dyn + long_name = definition of kind_dyn + units = none + dimensions = () + type = integer +[kind_grid] + standard_name = kind_grid + long_name = definition of kind_grid + units = none + dimensions = () + type = integer +[kind_phys] + standard_name = kind_phys + long_name = definition of kind_phys + units = none + dimensions = () + type = integer diff --git a/physics/ysuvdif.F90 b/physics/ysuvdif.F90 index e76f2120b..a417e53d5 100644 --- a/physics/ysuvdif.F90 +++ b/physics/ysuvdif.F90 @@ -22,59 +22,7 @@ end subroutine ysuvdif_finalize !! YSU scheme. !! !> \section arg_table_ysuvdif_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | ux | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | vx | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | tx | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | -!! | qx | tracer_concentration | model layer mean tracer concentration | kg kg-1 | 3 | real | kind_phys | in | F | -!! | p2d | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | p2di | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | pi2d | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | -!! | vtnp | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | utnp | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | ttnp | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | -!! | qtnp | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers due to model physics | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | -!! | swh | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step | total sky shortwave heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | hlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step | total sky longwave heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave | none | 1 | real | kind_phys | in | F | -!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | ndiff | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | tracer index for cloud condensate (or liquid water) | index | 0 | integer | | in | F | -!! | ntiw | index_for_ice_cloud_condensate | tracer index for ice water | index | 0 | integer | | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | psfcpa | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | -!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | -!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | -!! | psim | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | -!! | psih | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | -!! | landmask | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | -!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | wspd | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | br | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | -!! | g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | ep1 | ratio_of_vapor_to_dry_air_gas_constants_minus_one | rv/rd - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | ep2 | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | -!! | xlv | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | dusfc | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dvsfc | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | -!! | kpbl1d | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | -!! | u10 | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | v10 | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude ysuvdif_run.html !! !------------------------------------------------------------------------------- subroutine ysuvdif_run(ix,im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & diff --git a/physics/ysuvdif.meta b/physics/ysuvdif.meta new file mode 100644 index 000000000..ca3f8810e --- /dev/null +++ b/physics/ysuvdif.meta @@ -0,0 +1,452 @@ +[ccpp-arg-table] + name = ysuvdif_run + type = scheme +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[ux] + standard_name = x_wind + long_name = x component of layer wind + units = m s-1 + dimensions = (XX_NotFound_XX,XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[vx] + standard_name = y_wind + long_name = y component of layer wind + units = m s-1 + dimensions = (XX_NotFound_XX,XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[tx] + standard_name = air_temperature + long_name = layer mean air temperature + units = K + dimensions = (XX_NotFound_XX,XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[qx] + standard_name = tracer_concentration + long_name = model layer mean tracer concentration + units = kg kg-1 + dimensions = (XX_NotFound_XX,XX_NotFound_XX,XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[p2d] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (XX_NotFound_XX,XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[p2di] + standard_name = air_pressure_at_interface + long_name = air pressure at model layer interfaces + units = Pa + dimensions = (XX_NotFound_XX,XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[pi2d] + standard_name = dimensionless_exner_function_at_model_layers + long_name = Exner function at layers + units = none + dimensions = (XX_NotFound_XX,XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[vtnp] + standard_name = tendency_of_y_wind_due_to_model_physics + long_name = updated tendency of the y wind + units = m s-2 + dimensions = (XX_NotFound_XX,XX_NotFound_XX) + type = real + kind = kind_phys + intent = inout + optional = F +[utnp] + standard_name = tendency_of_x_wind_due_to_model_physics + long_name = updated tendency of the x wind + units = m s-2 + dimensions = (XX_NotFound_XX,XX_NotFound_XX) + type = real + kind = kind_phys + intent = inout + optional = F +[ttnp] + standard_name = tendency_of_air_temperature_due_to_model_physics + long_name = updated tendency of the temperature + units = K s-1 + dimensions = (XX_NotFound_XX,XX_NotFound_XX) + type = real + kind = kind_phys + intent = inout + optional = F +[qtnp] + standard_name = tendency_of_tracers_due_to_model_physics + long_name = updated tendency of the tracers due to model physics + units = kg kg-1 s-1 + dimensions = (XX_NotFound_XX,XX_NotFound_XX,XX_NotFound_XX) + type = real + kind = kind_phys + intent = inout + optional = F +[swh] + standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step + long_name = total sky shortwave heating rate + units = K s-1 + dimensions = (XX_NotFound_XX,XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[hlw] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step + long_name = total sky longwave heating rate + units = K s-1 + dimensions = (XX_NotFound_XX,XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[xmu] + standard_name = zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes + long_name = zenith angle temporal adjustment factor for shortwave + units = none + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F +[ndiff] + standard_name = number_of_vertical_diffusion_tracers + long_name = number of tracers to diffuse vertically + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntcw] + standard_name = index_for_liquid_cloud_condensate + long_name = tracer index for cloud condensate (or liquid water) + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntiw] + standard_name = index_for_ice_cloud_condensate + long_name = tracer index for ice water + units = index + dimensions = () + type = integer + intent = in + optional = F +[phii] + standard_name = geopotential_at_interface + long_name = geopotential at model layer interfaces + units = m2 s-2 + dimensions = (XX_NotFound_XX,XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[phil] + standard_name = geopotential + long_name = geopotential at model layer centers + units = m2 s-2 + dimensions = (XX_NotFound_XX,XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[psfcpa] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[zorl] + standard_name = surface_roughness_length + long_name = surface roughness length in cm + units = cm + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[stress] + standard_name = surface_wind_stress + long_name = surface wind stress + units = m2 s-2 + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[hpbl] + standard_name = atmosphere_boundary_layer_thickness + long_name = PBL thickness + units = m + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = out + optional = F +[psim] + standard_name = Monin_Obukhov_similarity_function_for_momentum + long_name = Monin-Obukhov similarity function for momentum + units = none + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[psih] + standard_name = Monin_Obukhov_similarity_function_for_heat + long_name = Monin-Obukhov similarity function for heat + units = none + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[landmask] + standard_name = sea_land_ice_mask + long_name = landmask: sea/land/ice=0/1/2 + units = flag + dimensions = (XX_NotFound_XX) + type = integer + intent = in + optional = F +[heat] + standard_name = kinematic_surface_upward_sensible_heat_flux + long_name = kinematic surface upward sensible heat flux + units = K m s-1 + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux + long_name = kinematic surface upward latent heat flux + units = kg kg-1 m s-1 + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[wspd] + standard_name = wind_speed_at_lowest_model_layer + long_name = wind speed at lowest model level + units = m s-1 + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[br] + standard_name = bulk_richardson_number_at_lowest_model_level + long_name = bulk Richardson number at the surface + units = none + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rv] + standard_name = gas_constant_water_vapor + long_name = ideal gas constant for water vapor + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ep1] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = rv/rd - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ep2] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[xlv] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dusfc] + standard_name = instantaneous_surface_x_momentum_flux + long_name = x momentum flux + units = Pa + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = out + optional = F +[dvsfc] + standard_name = instantaneous_surface_y_momentum_flux + long_name = y momentum flux + units = Pa + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = out + optional = F +[dtsfc] + standard_name = instantaneous_surface_upward_sensible_heat_flux + long_name = surface upward sensible heat flux + units = W m-2 + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = out + optional = F +[dqsfc] + standard_name = instantaneous_surface_upward_latent_heat_flux + long_name = surface upward latent heat flux + units = W m-2 + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = out + optional = F +[dt] + standard_name = time_step_for_physics + long_name = time step for physics + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[kpbl1d] + standard_name = vertical_index_at_top_of_atmosphere_boundary_layer + long_name = PBL top model level index + units = index + dimensions = (XX_NotFound_XX) + type = integer + intent = out + optional = F +[u10] + standard_name = x_wind_at_10m + long_name = x component of wind at 10 m + units = m s-1 + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[v10] + standard_name = y_wind_at_10m + long_name = y component of wind at 10 m + units = m s-1 + dimensions = (XX_NotFound_XX) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F From d9b8c8807c4fc9b30e541c84565807bc20b7fa1a Mon Sep 17 00:00:00 2001 From: climbfuji Date: Thu, 25 Jul 2019 15:46:57 -0600 Subject: [PATCH 40/89] Replace dashes (-) with underscores (_) in all variable standard names --- physics/GFS_DCNV_generic.F90 | 2 +- physics/GFS_rrtmg_pre.F90 | 12 +++++------ physics/GFS_rrtmg_setup.F90 | 18 ++++++++--------- physics/GFS_suite_interstitial.F90 | 12 +++++------ physics/GFS_surface_composites.F90 | 32 +++++++++++++++--------------- physics/cs_conv.F90 | 4 ++-- physics/gfdl_fv_sat_adj.F90 | 2 +- physics/gmtb_scm_sfc_flux_spec.F90 | 4 ++-- physics/gwdc.f | 4 ++-- physics/module_MYNNSFC_wrapper.F90 | 8 ++++---- physics/moninedmf.f | 4 ++-- physics/moninshoc.f | 4 ++-- physics/precpd.f | 2 +- physics/radlw_main.f | 4 ++-- physics/radsw_main.f | 6 +++--- physics/samfshalcnv.f | 2 +- physics/satmedmfvdif.F | 4 ++-- physics/sfc_diag.f | 8 ++++---- physics/sfc_diff.f | 24 +++++++++++----------- physics/sfc_nst.f | 24 +++++++++++----------- physics/shinhongvdif.F90 | 4 ++-- 21 files changed, 92 insertions(+), 92 deletions(-) diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 index c99c8d04b..ea0199443 100644 --- a/physics/GFS_DCNV_generic.F90 +++ b/physics/GFS_DCNV_generic.F90 @@ -134,7 +134,7 @@ end subroutine GFS_DCNV_generic_post_finalize !! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | !! | clw_ice | ice_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | in | F | !! | clw_liquid | cloud_condensed_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | in | F | -!! | npdf3d | number_of_3d_arrays_associated_with_pdf-based_clouds | number of 3d arrays associated with pdf based clouds/mp | count | 0 | integer | | in | F | +!! | npdf3d | number_of_3d_arrays_associated_with_pdf_based_clouds | number of 3d arrays associated with pdf based clouds/mp | count | 0 | integer | | in | F | !! | num_p3d | array_dimension_of_3d_arrays_for_microphysics | number of 3D arrays needed for microphysics | count | 0 | integer | | in | F | !! | ncnvcld3d | number_of_convective_3d_cloud_fields | number of convective 3d clouds fields | count | 0 | integer | | in | F | !! | rainc | lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep | convective rain at this time step | m | 1 | real | kind_phys | inout | F | diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index 90ac0134e..b58320fee 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -52,12 +52,12 @@ end subroutine GFS_rrtmg_pre_init !! | gasvmr_cfc22 | volume_mixing_ratio_cfc22 | CFC22 volume mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | !! | gasvmr_ccl4 | volume_mixing_ratio_ccl4 | CCL4 volume mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | !! | gasvmr_cfc113 | volume_mixing_ratio_cfc113 | CFC113 volume mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | -!! | faersw1 | aerosol_optical_depth_for_shortwave_bands_01-16 | aerosol optical depth for shortwave bands 01-16 | none | 3 | real | kind_phys | out | F | -!! | faersw2 | aerosol_single_scattering_albedo_for_shortwave_bands_01-16 | aerosol single scattering albedo for shortwave bands 01-16 | frac | 3 | real | kind_phys | out | F | -!! | faersw3 | aerosol_asymmetry_parameter_for_shortwave_bands_01-16 | aerosol asymmetry parameter for shortwave bands 01-16 | none | 3 | real | kind_phys | out | F | -!! | faerlw1 | aerosol_optical_depth_for_longwave_bands_01-16 | aerosol optical depth for longwave bands 01-16 | none | 3 | real | kind_phys | out | F | -!! | faerlw2 | aerosol_single_scattering_albedo_for_longwave_bands_01-16 | aerosol single scattering albedo for longwave bands 01-16 | frac | 3 | real | kind_phys | out | F | -!! | faerlw3 | aerosol_asymmetry_parameter_for_longwave_bands_01-16 | aerosol asymmetry parameter for longwave bands 01-16 | none | 3 | real | kind_phys | out | F | +!! | faersw1 | aerosol_optical_depth_for_shortwave_bands_01_16 | aerosol optical depth for shortwave bands 01-16 | none | 3 | real | kind_phys | out | F | +!! | faersw2 | aerosol_single_scattering_albedo_for_shortwave_bands_01_16 | aerosol single scattering albedo for shortwave bands 01-16 | frac | 3 | real | kind_phys | out | F | +!! | faersw3 | aerosol_asymmetry_parameter_for_shortwave_bands_01_16 | aerosol asymmetry parameter for shortwave bands 01-16 | none | 3 | real | kind_phys | out | F | +!! | faerlw1 | aerosol_optical_depth_for_longwave_bands_01_16 | aerosol optical depth for longwave bands 01-16 | none | 3 | real | kind_phys | out | F | +!! | faerlw2 | aerosol_single_scattering_albedo_for_longwave_bands_01_16 | aerosol single scattering albedo for longwave bands 01-16 | frac | 3 | real | kind_phys | out | F | +!! | faerlw3 | aerosol_asymmetry_parameter_for_longwave_bands_01_16 | aerosol asymmetry parameter for longwave bands 01-16 | none | 3 | real | kind_phys | out | F | !! | aerodp | atmosphere_optical_thickness_due_to_ambient_aerosol_particles | vertical integrated optical depth for various aerosol species | none | 2 | real | kind_phys | out | F | !! | clouds1 | total_cloud_fraction | layer total cloud fraction | frac | 2 | real | kind_phys | out | F | !! | clouds2 | cloud_liquid_water_path | layer cloud liquid water path | g m-2 | 2 | real | kind_phys | out | F | diff --git a/physics/GFS_rrtmg_setup.F90 b/physics/GFS_rrtmg_setup.F90 index 9c99076cc..f9d5a8c61 100644 --- a/physics/GFS_rrtmg_setup.F90 +++ b/physics/GFS_rrtmg_setup.F90 @@ -45,7 +45,7 @@ module GFS_rrtmg_setup !! |--------------------------|-------------------------------------------------------------------------------|---------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| !! | si | vertical_sigma_coordinate_for_radiation_initialization | vertical sigma coordinate for radiation initialization | none | 1 | real | kind_phys | in | F | !! | levr | number_of_vertical_layers_for_radiation_calculations | number of vertical levels for radiation calculations | count | 0 | integer | | in | F | -!! | ictm | flag_for_initial_time-date_control | flag for initial conditions and forcing | flag | 0 | integer | | in | F | +!! | ictm | flag_for_initial_time_date_control | flag for initial conditions and forcing | flag | 0 | integer | | in | F | !! | isol | flag_for_solar_constant | use prescribed solar constant | flag | 0 | integer | | in | F | !! | ico2 | flag_for_using_prescribed_global_mean_co2_value | prescribed global mean value (old opernl) | flag | 0 | integer | | in | F | !! | iaer | flag_for_default_aerosol_effect_in_shortwave_radiation | default aerosol effect in sw only | flag | 0 | integer | | in | F | @@ -54,22 +54,22 @@ module GFS_rrtmg_setup !! | ntcw | index_for_liquid_cloud_condensate | tracer index for cloud condensate (or liquid water) | index | 0 | integer | | in | F | !! | num_p2d | array_dimension_of_2d_arrays_for_microphysics | number of 2D arrays needed for microphysics | count | 0 | integer | | in | F | !! | num_p3d | array_dimension_of_3d_arrays_for_microphysics | number of 3D arrays needed for microphysics | count | 0 | integer | | in | F | -!! | npdf3d | number_of_3d_arrays_associated_with_pdf-based_clouds | number of 3d arrays associated with pdf based clouds/mp | count | 0 | integer | | in | F | +!! | npdf3d | number_of_3d_arrays_associated_with_pdf_based_clouds | number of 3d arrays associated with pdf based clouds/mp | count | 0 | integer | | in | F | !! | ntoz | index_for_ozone | tracer index for ozone mixing ratio | index | 0 | integer | | in | F | -!! | iovr_sw | flag_for_max-random_overlap_clouds_for_shortwave_radiation | sw: max-random overlap clouds | flag | 0 | integer | | in | F | -!! | iovr_lw | flag_for_max-random_overlap_clouds_for_longwave_radiation | lw: max-random overlap clouds | flag | 0 | integer | | in | F | -!! | isubc_sw | flag_for_sw_clouds_without_sub-grid_approximation | flag for sw clouds without sub-grid approximation | flag | 0 | integer | | in | F | -!! | isubc_lw | flag_for_lw_clouds_without_sub-grid_approximation | flag for lw clouds without sub-grid approximation | flag | 0 | integer | | in | F | +!! | iovr_sw | flag_for_max_random_overlap_clouds_for_shortwave_radiation | sw: max-random overlap clouds | flag | 0 | integer | | in | F | +!! | iovr_lw | flag_for_max_random_overlap_clouds_for_longwave_radiation | lw: max-random overlap clouds | flag | 0 | integer | | in | F | +!! | isubc_sw | flag_for_sw_clouds_without_sub_grid_approximation | flag for sw clouds without sub-grid approximation | flag | 0 | integer | | in | F | +!! | isubc_lw | flag_for_lw_clouds_without_sub_grid_approximation | flag for lw clouds without sub-grid approximation | flag | 0 | integer | | in | F | !! | icliq_sw | flag_for_optical_property_for_liquid_clouds_for_shortwave_radiation | sw optical property for liquid clouds | flag | 0 | integer | | in | F | -!! | crick_proof | flag_for_CRICK-proof_cloud_water | flag for CRICK-Proof cloud water | flag | 0 | logical | | in | F | +!! | crick_proof | flag_for_CRICK_proof_cloud_water | flag for CRICK-Proof cloud water | flag | 0 | logical | | in | F | !! | ccnorm | flag_for_cloud_condensate_normalized_by_cloud_cover | flag for cloud condensate normalized by cloud cover | flag | 0 | logical | | in | F | !! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | !! | norad_precip | flag_for_precipitation_effect_on_radiation | radiation precip flag for Ferrier/Moorthi | flag | 0 | logical | | in | F | !! | idate | date_and_time_at_model_initialization_reordered | initialization date and time | none | 1 | integer | | in | F | !! | iflip | flag_for_vertical_index_direction_control | flag for vertical index direction control | flag | 0 | integer | | in | F | !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | faerlw | aerosol_optical_properties_for_longwave_bands_01-16 | optical properties for longwave bands 01-16 | various | 4 | real | kind_phys | in | F | -!! | faersw | aerosol_optical_properties_for_shortwave_bands_01-16 | aerosol optical properties for shortwave bands 01-16 | various | 4 | real | kind_phys | in | F | +!! | faerlw | aerosol_optical_properties_for_longwave_bands_01_16 | optical properties for longwave bands 01-16 | various | 4 | real | kind_phys | in | F | +!! | faersw | aerosol_optical_properties_for_shortwave_bands_01_16 | aerosol optical properties for shortwave bands 01-16 | various | 4 | real | kind_phys | in | F | !! | aerodp | atmosphere_optical_thickness_due_to_ambient_aerosol_particles | vertical integrated optical depth for various aerosol species | none | 2 | real | kind_phys | in | F | !! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index ac3b7ad2f..ab294958f 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -104,8 +104,8 @@ end subroutine GFS_suite_interstitial_1_finalize !! | pgr | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | !! | frain | dynamics_to_physics_timestep_ratio | ratio of dynamics timestep to physics timestep | none | 0 | real | kind_phys | out | F | !! | islmsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | out | F | -!! | work1 | grid_size_related_coefficient_used_in_scale-sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | out | F | -!! | work2 | grid_size_related_coefficient_used_in_scale-sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | out | F | +!! | work1 | grid_size_related_coefficient_used_in_scale_sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | out | F | +!! | work2 | grid_size_related_coefficient_used_in_scale_sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | out | F | !! | psurf | surface_air_pressure_diag | surface air pressure diagnostic | Pa | 1 | real | kind_phys | out | F | !! | dudt | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | out | F | !! | dvdt | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | out | F | @@ -210,8 +210,8 @@ end subroutine GFS_suite_interstitial_2_finalize !! | htrlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep | total sky lw heating rate | K s-1 | 2 | real | kind_phys | in | F | !! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave fluxes | none | 1 | real | kind_phys | in | F | !! | ctei_rm | critical_cloud_top_entrainment_instability_criteria | critical cloud top entrainment instability criteria | none | 1 | real | kind_phys | in | F | -!! | work1 | grid_size_related_coefficient_used_in_scale-sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | -!! | work2 | grid_size_related_coefficient_used_in_scale-sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | in | F | +!! | work1 | grid_size_related_coefficient_used_in_scale_sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | +!! | work2 | grid_size_related_coefficient_used_in_scale_sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | in | F | !! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | !! | tgrs | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | in | F | !! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | @@ -568,8 +568,8 @@ end subroutine GFS_suite_interstitial_3_finalize !! | rhctop | critical_relative_humidity_at_top_of_atmosphere | critical relative humidity at the top of atmosphere | frac | 0 | real | kind_phys | in | F | !! | rhcmax | maximum_critical_relative_humidity | maximum critical relative humidity | frac | 0 | real | kind_phys | in | F | !! | islmsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | in | F | -!! | work1 | grid_size_related_coefficient_used_in_scale-sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | -!! | work2 | grid_size_related_coefficient_used_in_scale-sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | in | F | +!! | work1 | grid_size_related_coefficient_used_in_scale_sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | +!! | work2 | grid_size_related_coefficient_used_in_scale_sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | in | F | !! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | vertical index at top atmospheric boundary layer | index | 1 | integer | | in | F | !! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | in | F | !! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | inout | F | diff --git a/physics/GFS_surface_composites.F90 b/physics/GFS_surface_composites.F90 index df99b68dc..858acaaa7 100644 --- a/physics/GFS_surface_composites.F90 +++ b/physics/GFS_surface_composites.F90 @@ -248,26 +248,26 @@ end subroutine GFS_surface_composites_post_finalize !! | stress_ocn | surface_wind_stress_over_ocean | surface wind stress over ocean | m2 s-2 | 1 | real | kind_phys | in | F | !! | stress_lnd | surface_wind_stress_over_land | surface wind stress over land | m2 s-2 | 1 | real | kind_phys | in | F | !! | stress_ice | surface_wind_stress_over_ice | surface wind stress over ice | m2 s-2 | 1 | real | kind_phys | in | F | -!! | ffmm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | inout | F | -!! | ffmm_ocn | Monin-Obukhov_similarity_function_for_momentum_over_ocean | Monin-Obukhov similarity function for momentum over ocean | none | 1 | real | kind_phys | in | F | -!! | ffmm_lnd | Monin-Obukhov_similarity_function_for_momentum_over_land | Monin-Obukhov similarity function for momentum over land | none | 1 | real | kind_phys | in | F | -!! | ffmm_ice | Monin-Obukhov_similarity_function_for_momentum_over_ice | Monin-Obukhov similarity function for momentum over ice | none | 1 | real | kind_phys | in | F | -!! | ffhh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | inout | F | -!! | ffhh_ocn | Monin-Obukhov_similarity_function_for_heat_over_ocean | Monin-Obukhov similarity function for heat over ocean | none | 1 | real | kind_phys | in | F | -!! | ffhh_lnd | Monin-Obukhov_similarity_function_for_heat_over_land | Monin-Obukhov similarity function for heat over land | none | 1 | real | kind_phys | in | F | -!! | ffhh_ice | Monin-Obukhov_similarity_function_for_heat_over_ice | Monin-Obukhov similarity function for heat over ice | none | 1 | real | kind_phys | in | F | +!! | ffmm | Monin_Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | inout | F | +!! | ffmm_ocn | Monin_Obukhov_similarity_function_for_momentum_over_ocean | Monin-Obukhov similarity function for momentum over ocean | none | 1 | real | kind_phys | in | F | +!! | ffmm_lnd | Monin_Obukhov_similarity_function_for_momentum_over_land | Monin-Obukhov similarity function for momentum over land | none | 1 | real | kind_phys | in | F | +!! | ffmm_ice | Monin_Obukhov_similarity_function_for_momentum_over_ice | Monin-Obukhov similarity function for momentum over ice | none | 1 | real | kind_phys | in | F | +!! | ffhh | Monin_Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | inout | F | +!! | ffhh_ocn | Monin_Obukhov_similarity_function_for_heat_over_ocean | Monin-Obukhov similarity function for heat over ocean | none | 1 | real | kind_phys | in | F | +!! | ffhh_lnd | Monin_Obukhov_similarity_function_for_heat_over_land | Monin-Obukhov similarity function for heat over land | none | 1 | real | kind_phys | in | F | +!! | ffhh_ice | Monin_Obukhov_similarity_function_for_heat_over_ice | Monin-Obukhov similarity function for heat over ice | none | 1 | real | kind_phys | in | F | !! | uustar | surface_friction_velocity | boundary layer parameter | m s-1 | 1 | real | kind_phys | inout | F | !! | uustar_ocn | surface_friction_velocity_over_ocean | surface friction velocity over ocean | m s-1 | 1 | real | kind_phys | in | F | !! | uustar_lnd | surface_friction_velocity_over_land | surface friction velocity over land | m s-1 | 1 | real | kind_phys | in | F | !! | uustar_ice | surface_friction_velocity_over_ice | surface friction velocity over ice | m s-1 | 1 | real | kind_phys | in | F | -!! | fm10 | Monin-Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum at 10m | none | 1 | real | kind_phys | inout | F | -!! | fm10_ocn | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_ocean | Monin-Obukhov similarity parameter for momentum at 10m over ocean | none | 1 | real | kind_phys | in | F | -!! | fm10_lnd | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_land | Monin-Obukhov similarity parameter for momentum at 10m over land | none | 1 | real | kind_phys | in | F | -!! | fm10_ice | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_ice | Monin-Obukhov similarity parameter for momentum at 10m over ice | none | 1 | real | kind_phys | in | F | -!! | fh2 | Monin-Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat at 2m | none | 1 | real | kind_phys | inout | F | -!! | fh2_ocn | Monin-Obukhov_similarity_function_for_heat_at_2m_over_ocean | Monin-Obukhov similarity parameter for heat at 2m over ocean | none | 1 | real | kind_phys | in | F | -!! | fh2_lnd | Monin-Obukhov_similarity_function_for_heat_at_2m_over_land | Monin-Obukhov similarity parameter for heat at 2m over land | none | 1 | real | kind_phys | in | F | -!! | fh2_ice | Monin-Obukhov_similarity_function_for_heat_at_2m_over_ice | Monin-Obukhov similarity parameter for heat at 2m over ice | none | 1 | real | kind_phys | in | F | +!! | fm10 | Monin_Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum at 10m | none | 1 | real | kind_phys | inout | F | +!! | fm10_ocn | Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ocean | Monin-Obukhov similarity parameter for momentum at 10m over ocean | none | 1 | real | kind_phys | in | F | +!! | fm10_lnd | Monin_Obukhov_similarity_function_for_momentum_at_10m_over_land | Monin-Obukhov similarity parameter for momentum at 10m over land | none | 1 | real | kind_phys | in | F | +!! | fm10_ice | Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ice | Monin-Obukhov similarity parameter for momentum at 10m over ice | none | 1 | real | kind_phys | in | F | +!! | fh2 | Monin_Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat at 2m | none | 1 | real | kind_phys | inout | F | +!! | fh2_ocn | Monin_Obukhov_similarity_function_for_heat_at_2m_over_ocean | Monin-Obukhov similarity parameter for heat at 2m over ocean | none | 1 | real | kind_phys | in | F | +!! | fh2_lnd | Monin_Obukhov_similarity_function_for_heat_at_2m_over_land | Monin-Obukhov similarity parameter for heat at 2m over land | none | 1 | real | kind_phys | in | F | +!! | fh2_ice | Monin_Obukhov_similarity_function_for_heat_at_2m_over_ice | Monin-Obukhov similarity parameter for heat at 2m over ice | none | 1 | real | kind_phys | in | F | !! | tsurf | surface_skin_temperature_after_iteration | surface skin temperature after iteration | K | 1 | real | kind_phys | inout | F | !! | tsurf_ocn | surface_skin_temperature_after_iteration_over_ocean | surface skin temperature after iteration over ocean | K | 1 | real | kind_phys | in | F | !! | tsurf_lnd | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | in | F | diff --git a/physics/cs_conv.F90 b/physics/cs_conv.F90 index d59f27656..8861c089c 100644 --- a/physics/cs_conv.F90 +++ b/physics/cs_conv.F90 @@ -25,8 +25,8 @@ end subroutine cs_conv_pre_finalize !! | q | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | !! | clw1 | ice_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | in | F | !! | clw2 | cloud_condensed_water_mixing_ratio_convective_transport_tracer| moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | in | F | -!! | work1 | grid_size_related_coefficient_used_in_scale-sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | -!! | work2 | grid_size_related_coefficient_used_in_scale-sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | in | F | +!! | work1 | grid_size_related_coefficient_used_in_scale_sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | +!! | work2 | grid_size_related_coefficient_used_in_scale_sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | in | F | !! | cs_parm1 | updraft_velocity_tunable_parameter_1_CS | tunable parameter 1 for Chikira-Sugiyama convection | m s-1 | 0 | real | kind_phys | in | F | !! | cs_parm2 | updraft_velocity_tunable_parameter_2_CS | tunable parameter 2 for Chikira-Sugiyama convection | m s-1 | 0 | real | kind_phys | in | F | !! | wcbmax | maximum_updraft_velocity_at_cloud_base | maximum updraft velocity at cloud base | m s-1 | 1 | real | kind_phys | out | F | diff --git a/physics/gfdl_fv_sat_adj.F90 b/physics/gfdl_fv_sat_adj.F90 index 01a563f0e..3b8cca3b3 100644 --- a/physics/gfdl_fv_sat_adj.F90 +++ b/physics/gfdl_fv_sat_adj.F90 @@ -270,7 +270,7 @@ end subroutine fv_sat_adj_finalize !! | delz | thickness_at_Lagrangian_surface | thickness at Lagrangian_surface | m | 3 | real | kind_dyn | in | F | !! | delp | pressure_thickness_at_Lagrangian_surface | pressure thickness at Lagrangian surface | Pa | 3 | real | kind_dyn | in | F | !! | pt | virtual_temperature_at_Lagrangian_surface | virtual temperature at Lagrangian surface | K | 3 | real | kind_dyn | inout | F | -!! | pkz | finite-volume_mean_edge_pressure_raised_to_the_power_of_kappa | finite-volume mean edge pressure raised to the power of kappa | Pa**kappa | 3 | real | kind_dyn | inout | F | +!! | pkz | finite_volume_mean_edge_pressure_raised_to_the_power_of_kappa | finite-volume mean edge pressure raised to the power of kappa | Pa**kappa | 3 | real | kind_dyn | inout | F | !! | q_con | cloud_condensed_water_specific_humidity_at_Lagrangian_surface | cloud condensed water specific humidity updated by fast physics at Lagrangian surface | kg kg-1 | 3 | real | kind_dyn | inout | F | !! | akap | kappa_dry_for_fast_physics | modified kappa for dry air, fast physics | none | 0 | real | kind_dyn | in | F | !! | cappa | cappa_moist_gas_constant_at_Lagrangian_surface | cappa(i,j,k) = rdgas / ( rdgas + cvm(i)/(1.+r_vir*q(i,j,k,sphum)) ) | none | 3 | real | kind_dyn | inout | F | diff --git a/physics/gmtb_scm_sfc_flux_spec.F90 b/physics/gmtb_scm_sfc_flux_spec.F90 index 1ce2f95a0..8146ac540 100644 --- a/physics/gmtb_scm_sfc_flux_spec.F90 +++ b/physics/gmtb_scm_sfc_flux_spec.F90 @@ -50,8 +50,8 @@ end subroutine gmtb_scm_sfc_flux_spec_finalize !! | sfc_stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | out | F | !! | cm | surface_drag_coefficient_for_momentum_in_air | surface exchange coeff for momentum | none | 1 | real | kind_phys | out | F | !! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air | surface exchange coeff heat & moisture | none | 1 | real | kind_phys | out | F | -!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | out | F | -!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | out | F | +!! | fm | Monin_Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | out | F | +!! | fh | Monin_Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | out | F | !! | rb | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | out | F | !! | u10m | x_wind_at_10m | 10 meter u wind speed | m s-1 | 1 | real | kind_phys | out | F | !! | v10m | y_wind_at_10m | 10 meter v wind speed | m s-1 | 1 | real | kind_phys | out | F | diff --git a/physics/gwdc.f b/physics/gwdc.f index 48e78cb44..065e8d73e 100644 --- a/physics/gwdc.f +++ b/physics/gwdc.f @@ -22,8 +22,8 @@ end subroutine gwdc_pre_init !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | !! | cgwf | multiplication_factors_for_convective_gravity_wave_drag | multiplication factors for convective gravity wave drag | none | 1 | real | kind_phys | in | F | !! | dx | cell_size | grid size in zonal direction | m | 1 | real | kind_phys | in | F | -!! | work1 | grid_size_related_coefficient_used_in_scale-sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | -!! | work2 | grid_size_related_coefficient_used_in_scale-sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | in | F | +!! | work1 | grid_size_related_coefficient_used_in_scale_sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | +!! | work2 | grid_size_related_coefficient_used_in_scale_sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | in | F | !! | dlength | characteristic_grid_length_scale | representative horizontal length scale of grid box | m | 1 | real | kind_phys | out | F | !! | cldf | cloud_area_fraction | fraction of grid box area in which updrafts occur | frac | 1 | real | kind_phys | out | F | !! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | diff --git a/physics/module_MYNNSFC_wrapper.F90 b/physics/module_MYNNSFC_wrapper.F90 index 554a00e74..cae73f6bd 100644 --- a/physics/module_MYNNSFC_wrapper.F90 +++ b/physics/module_MYNNSFC_wrapper.F90 @@ -52,10 +52,10 @@ end subroutine mynnsfc_wrapper_finalize !! | zol | surface_stability_parameter | monin obukhov surface stability parameter | none | 1 | real | kind_phys | inout | F | !! | mol | theta_star | temperature flux divided by ustar (temperature scale) | K | 1 | real | kind_phys | inout | F | !! | rmol | reciprocal_of_obukhov_length | one over obukhov length | m-1 | 1 | real | kind_phys | inout | F | -!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | inout | F | -!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | inout | F | -!! | fm10 | Monin-Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | inout | F | -!! | fh2 | Monin-Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | inout | F | +!! | fm | Monin_Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | inout | F | +!! | fh | Monin_Obukhov_similarity_function_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | inout | F | +!! | fm10 | Monin_Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | inout | F | +!! | fh2 | Monin_Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | inout | F | !! | wspd | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | inout | F | !! | br | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | inout | F | !! | ch | surface_drag_wind_speed_for_momentum_in_air | momentum exchange coefficient | m s-1 | 1 | real | kind_phys | inout | F | diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 76bc62298..17486cb74 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -46,8 +46,8 @@ end subroutine hedmf_finalize !! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | !! | u10m | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | !! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | -!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | +!! | fm | Monin_Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | +!! | fh | Monin_Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | !! | tsea | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | !! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | !! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | diff --git a/physics/moninshoc.f b/physics/moninshoc.f index 96b294824..f15011caa 100644 --- a/physics/moninshoc.f +++ b/physics/moninshoc.f @@ -46,8 +46,8 @@ end subroutine moninshoc_finalize !! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | !! | u10m | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | !! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | -!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | +!! | fm | Monin_Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | +!! | fh | Monin_Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | !! | tsea | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | !! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | !! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | diff --git a/physics/precpd.f b/physics/precpd.f index 9e8f5b696..b4bda60be 100644 --- a/physics/precpd.f +++ b/physics/precpd.f @@ -37,7 +37,7 @@ end subroutine zhaocarr_precpd_init !! | prautco | coefficient_from_cloud_water_to_rain | conversion coefficient from cloud water to rain | none | 1 | real | kind_phys | in | F | !! | evpco | coefficient_for_evaporation_of_rainfall | coefficient for evaporation of rainfall | none | 0 | real | kind_phys | in | F | !! | wminco | cloud_condensed_water_conversion_threshold | conversion coefficient from cloud liquid and ice to precipitation | none | 1 | real | kind_phys | in | F | -!! | wk1 | grid_size_related_coefficient_used_in_scale-sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | +!! | wk1 | grid_size_related_coefficient_used_in_scale_sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | !! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | !! | jpr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | diff --git a/physics/radlw_main.f b/physics/radlw_main.f index 4d560b7b2..5529860b5 100644 --- a/physics/radlw_main.f +++ b/physics/radlw_main.f @@ -398,8 +398,8 @@ end subroutine rrtmg_lw_init !! | gasvmr_cfc22 | volume_mixing_ratio_cfc22 | volume mixing ratio cfc22 | kg kg-1 | 2 | real | kind_phys | in | F | !! | gasvmr_ccl4 | volume_mixing_ratio_ccl4 | volume mixing ratio ccl4 | kg kg-1 | 2 | real | kind_phys | in | F | !! | icseed | seed_random_numbers_lw | seed for random number generation for longwave radiation | none | 1 | integer | | in | F | -!! | aeraod | aerosol_optical_depth_for_longwave_bands_01-16 | aerosol optical depth for longwave bands 01-16 | none | 3 | real | kind_phys | in | F | -!! | aerssa | aerosol_single_scattering_albedo_for_longwave_bands_01-16 | aerosol single scattering albedo for longwave bands 01-16 | frac | 3 | real | kind_phys | in | F | +!! | aeraod | aerosol_optical_depth_for_longwave_bands_01_16 | aerosol optical depth for longwave bands 01-16 | none | 3 | real | kind_phys | in | F | +!! | aerssa | aerosol_single_scattering_albedo_for_longwave_bands_01_16 | aerosol single scattering albedo for longwave bands 01-16 | frac | 3 | real | kind_phys | in | F | !! | sfemis | surface_longwave_emissivity | surface emissivity | frac | 1 | real | kind_phys | in | F | !! | sfgtmp | surface_ground_temperature_for_radiation | surface ground temperature for radiation | K | 1 | real | kind_phys | in | F | !! | dzlyr | layer_thickness_for_radiation | layer thickness | km | 2 | real | kind_phys | in | F | diff --git a/physics/radsw_main.f b/physics/radsw_main.f index 23bfdaa8a..47f8700f9 100644 --- a/physics/radsw_main.f +++ b/physics/radsw_main.f @@ -473,9 +473,9 @@ end subroutine rrtmg_sw_init !! | gasvmr_cfc22 | volume_mixing_ratio_cfc22 | volume mixing ratio cfc22 | kg kg-1 | 2 | real | kind_phys | in | F | !! | gasvmr_ccl4 | volume_mixing_ratio_ccl4 | volume mixing ratio ccl4 | kg kg-1 | 2 | real | kind_phys | in | F | !! | icseed | seed_random_numbers_sw | seed for random number generation for shortwave radiation | none | 1 | integer | | in | F | -!! | aeraod | aerosol_optical_depth_for_shortwave_bands_01-16 | aerosol optical depth for shortwave bands 01-16 | none | 3 | real | kind_phys | in | F | -!! | aerssa | aerosol_single_scattering_albedo_for_shortwave_bands_01-16 | aerosol single scattering albedo for shortwave bands 01-16 | frac | 3 | real | kind_phys | in | F | -!! | aerasy | aerosol_asymmetry_parameter_for_shortwave_bands_01-16 | aerosol asymmetry paramter for shortwave bands 01-16 | none | 3 | real | kind_phys | in | F | +!! | aeraod | aerosol_optical_depth_for_shortwave_bands_01_16 | aerosol optical depth for shortwave bands 01-16 | none | 3 | real | kind_phys | in | F | +!! | aerssa | aerosol_single_scattering_albedo_for_shortwave_bands_01_16 | aerosol single scattering albedo for shortwave bands 01-16 | frac | 3 | real | kind_phys | in | F | +!! | aerasy | aerosol_asymmetry_parameter_for_shortwave_bands_01_16 | aerosol asymmetry paramter for shortwave bands 01-16 | none | 3 | real | kind_phys | in | F | !! | sfcalb_nir_dir | surface_albedo_due_to_near_IR_direct | surface albedo due to near IR direct beam | frac | 1 | real | kind_phys | in | F | !! | sfcalb_nir_dif | surface_albedo_due_to_near_IR_diffused | surface albedo due to near IR diffused beam | frac | 1 | real | kind_phys | in | F | !! | sfcalb_uvis_dir | surface_albedo_due_to_UV_and_VIS_direct | surface albedo due to UV+VIS direct beam | frac | 1 | real | kind_phys | in | F | diff --git a/physics/samfshalcnv.f b/physics/samfshalcnv.f index b6fb2cb33..ddacba9d8 100644 --- a/physics/samfshalcnv.f +++ b/physics/samfshalcnv.f @@ -1838,7 +1838,7 @@ module samfshalcnv_post !! | shcnvcw | flag_shallow_convective_cloud | flag for shallow convective cloud | | 0 | logical | | in | F | !! | frain | dynamics_to_physics_timestep_ratio | ratio of dynamics timestep to physics timestep | none | 0 | real | kind_phys | in | F | !! | rain1 | lwe_thickness_of_shallow_convective_precipitation_amount | shallow convective rainfall amount on physics timestep | m | 1 | real | kind_phys | in | F | -!! | npdf3d | number_of_3d_arrays_associated_with_pdf-based_clouds | number of 3d arrays associated with pdf based clouds/mp | count | 0 | integer | | in | F | +!! | npdf3d | number_of_3d_arrays_associated_with_pdf_based_clouds | number of 3d arrays associated with pdf based clouds/mp | count | 0 | integer | | in | F | !! | num_p3d | array_dimension_of_3d_arrays_for_microphysics | number of 3D arrays needed for microphysics | count | 0 | integer | | in | F | !! | ncnvcld3d | number_of_convective_3d_cloud_fields | number of convective 3d clouds fields | count | 0 | integer | | in | F | !! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | in | F | diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F index fc3cc9d98..d4e909f0c 100644 --- a/physics/satmedmfvdif.F +++ b/physics/satmedmfvdif.F @@ -53,8 +53,8 @@ end subroutine satmedmfvdif_finalize !! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | !! | u10m | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | !! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | -!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | +!! | fm | Monin_Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | +!! | fh | Monin_Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | !! | tsea | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | !! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | !! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | diff --git a/physics/sfc_diag.f b/physics/sfc_diag.f index 7200e9231..d025156f4 100644 --- a/physics/sfc_diag.f +++ b/physics/sfc_diag.f @@ -30,10 +30,10 @@ end subroutine sfc_diag_finalize !! | q1 | water_vapor_specific_humidity_at_lowest_model_layer_updated_by_physics | 1st model layer specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | !! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | !! | evap | kinematic_surface_upward_latent_heat_flux | surface upward evaporation flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | -!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | -!! | fm10 | Monin-Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | -!! | fh2 | Monin-Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | +!! | fm | Monin_Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | +!! | fh | Monin_Obukhov_similarity_function_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | +!! | fm10 | Monin_Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | +!! | fh2 | Monin_Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | !! | tskin | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | !! | qsurf | surface_specific_humidity | surface specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | !! | f10m | ratio_of_wind_at_lowest_model_layer_and_wind_at_10m | ratio of fm10 and fm | ratio | 1 | real | kind_phys | out | F | diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 7757dd3c9..2a20af80b 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -86,18 +86,18 @@ end subroutine sfc_diff_finalize !! | stress_ocn | surface_wind_stress_over_ocean | surface wind stress over ocean | m2 s-2 | 1 | real | kind_phys | inout | F | !! | stress_lnd | surface_wind_stress_over_land | surface wind stress over land | m2 s-2 | 1 | real | kind_phys | inout | F | !! | stress_ice | surface_wind_stress_over_ice | surface wind stress over ice | m2 s-2 | 1 | real | kind_phys | inout | F | -!! | fm_ocn | Monin-Obukhov_similarity_function_for_momentum_over_ocean | Monin-Obukhov similarity function for momentum over ocean | none | 1 | real | kind_phys | inout | F | -!! | fm_lnd | Monin-Obukhov_similarity_function_for_momentum_over_land | Monin-Obukhov similarity function for momentum over land | none | 1 | real | kind_phys | inout | F | -!! | fm_ice | Monin-Obukhov_similarity_function_for_momentum_over_ice | Monin-Obukhov similarity function for momentum over ice | none | 1 | real | kind_phys | inout | F | -!! | fh_ocn | Monin-Obukhov_similarity_function_for_heat_over_ocean | Monin-Obukhov similarity function for heat over ocean | none | 1 | real | kind_phys | inout | F | -!! | fh_lnd | Monin-Obukhov_similarity_function_for_heat_over_land | Monin-Obukhov similarity function for heat over land | none | 1 | real | kind_phys | inout | F | -!! | fh_ice | Monin-Obukhov_similarity_function_for_heat_over_ice | Monin-Obukhov similarity function for heat over ice | none | 1 | real | kind_phys | inout | F | -!! | fm10_ocn | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_ocean | Monin-Obukhov similarity parameter for momentum at 10m over ocean | none | 1 | real | kind_phys | inout | F | -!! | fm10_lnd | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_land | Monin-Obukhov similarity parameter for momentum at 10m over land | none | 1 | real | kind_phys | inout | F | -!! | fm10_ice | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_ice | Monin-Obukhov similarity parameter for momentum at 10m over ice | none | 1 | real | kind_phys | inout | F | -!! | fh2_ocn | Monin-Obukhov_similarity_function_for_heat_at_2m_over_ocean | Monin-Obukhov similarity parameter for heat at 2m over ocean | none | 1 | real | kind_phys | inout | F | -!! | fh2_lnd | Monin-Obukhov_similarity_function_for_heat_at_2m_over_land | Monin-Obukhov similarity parameter for heat at 2m over land | none | 1 | real | kind_phys | inout | F | -!! | fh2_ice | Monin-Obukhov_similarity_function_for_heat_at_2m_over_ice | Monin-Obukhov similarity parameter for heat at 2m over ice | none | 1 | real | kind_phys | inout | F | +!! | fm_ocn | Monin_Obukhov_similarity_function_for_momentum_over_ocean | Monin-Obukhov similarity function for momentum over ocean | none | 1 | real | kind_phys | inout | F | +!! | fm_lnd | Monin_Obukhov_similarity_function_for_momentum_over_land | Monin-Obukhov similarity function for momentum over land | none | 1 | real | kind_phys | inout | F | +!! | fm_ice | Monin_Obukhov_similarity_function_for_momentum_over_ice | Monin-Obukhov similarity function for momentum over ice | none | 1 | real | kind_phys | inout | F | +!! | fh_ocn | Monin_Obukhov_similarity_function_for_heat_over_ocean | Monin-Obukhov similarity function for heat over ocean | none | 1 | real | kind_phys | inout | F | +!! | fh_lnd | Monin_Obukhov_similarity_function_for_heat_over_land | Monin-Obukhov similarity function for heat over land | none | 1 | real | kind_phys | inout | F | +!! | fh_ice | Monin_Obukhov_similarity_function_for_heat_over_ice | Monin-Obukhov similarity function for heat over ice | none | 1 | real | kind_phys | inout | F | +!! | fm10_ocn | Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ocean | Monin-Obukhov similarity parameter for momentum at 10m over ocean | none | 1 | real | kind_phys | inout | F | +!! | fm10_lnd | Monin_Obukhov_similarity_function_for_momentum_at_10m_over_land | Monin-Obukhov similarity parameter for momentum at 10m over land | none | 1 | real | kind_phys | inout | F | +!! | fm10_ice | Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ice | Monin-Obukhov similarity parameter for momentum at 10m over ice | none | 1 | real | kind_phys | inout | F | +!! | fh2_ocn | Monin_Obukhov_similarity_function_for_heat_at_2m_over_ocean | Monin-Obukhov similarity parameter for heat at 2m over ocean | none | 1 | real | kind_phys | inout | F | +!! | fh2_lnd | Monin_Obukhov_similarity_function_for_heat_at_2m_over_land | Monin-Obukhov similarity parameter for heat at 2m over land | none | 1 | real | kind_phys | inout | F | +!! | fh2_ice | Monin_Obukhov_similarity_function_for_heat_at_2m_over_ice | Monin-Obukhov similarity parameter for heat at 2m over ice | none | 1 | real | kind_phys | inout | F | !! | wind | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | inout | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f index 5246411e2..a6675f88d 100644 --- a/physics/sfc_nst.f +++ b/physics/sfc_nst.f @@ -79,8 +79,8 @@ end subroutine sfc_nst_finalize !! | zm | ocean_mixed_layer_thickness | mixed layer thickness | m | 1 | real | kind_phys | inout | F | !! | xtts | sensitivity_of_dtl_heat_content_to_surface_temperature | d(xt)/d(ts) | m | 1 | real | kind_phys | inout | F | !! | xzts | sensitivity_of_dtl_thickness_to_surface_temperature | d(xz)/d(ts) | m K-1 | 1 | real | kind_phys | inout | F | -!! | dt_cool | sub-layer_cooling_amount | sub-layer cooling amount | K | 1 | real | kind_phys | inout | F | -!! | z_c | sub-layer_cooling_thickness | sub-layer cooling thickness | m | 1 | real | kind_phys | inout | F | +!! | dt_cool | sub_layer_cooling_amount | sub-layer cooling amount | K | 1 | real | kind_phys | inout | F | +!! | z_c | sub_layer_cooling_thickness | sub-layer cooling thickness | m | 1 | real | kind_phys | inout | F | !! | c_0 | coefficient_c_0 | coefficient1 to calculate d(tz)/d(ts) | none | 1 | real | kind_phys | inout | F | !! | c_d | coefficient_c_d | coefficient2 to calculate d(tz)/d(ts) | none | 1 | real | kind_phys | inout | F | !! | w_0 | coefficient_w_0 | coefficient3 to calculate d(tz)/d(ts) | none | 1 | real | kind_phys | inout | F | @@ -743,16 +743,16 @@ end subroutine sfc_nst_pre_finalize !! | rb_ice | bulk_richardson_number_at_lowest_model_level_over_ice | bulk Richardson number at the surface over ice | none | 1 | real | kind_phys | in | F | !! | stress_ocn | surface_wind_stress_over_ocean | surface wind stress over ocean | m2 s-2 | 1 | real | kind_phys | inout | F | !! | stress_ice | surface_wind_stress_over_ice | surface wind stress over ice | m2 s-2 | 1 | real | kind_phys | in | F | -!! | ffmm_ocn | Monin-Obukhov_similarity_function_for_momentum_over_ocean | Monin-Obukhov similarity function for momentum over ocean | none | 1 | real | kind_phys | inout | F | -!! | ffmm_ice | Monin-Obukhov_similarity_function_for_momentum_over_ice | Monin-Obukhov similarity function for momentum over ice | none | 1 | real | kind_phys | in | F | -!! | ffhh_ocn | Monin-Obukhov_similarity_function_for_heat_over_ocean | Monin-Obukhov similarity function for heat over ocean | none | 1 | real | kind_phys | inout | F | -!! | ffhh_ice | Monin-Obukhov_similarity_function_for_heat_over_ice | Monin-Obukhov similarity function for heat over ice | none | 1 | real | kind_phys | in | F | +!! | ffmm_ocn | Monin_Obukhov_similarity_function_for_momentum_over_ocean | Monin-Obukhov similarity function for momentum over ocean | none | 1 | real | kind_phys | inout | F | +!! | ffmm_ice | Monin_Obukhov_similarity_function_for_momentum_over_ice | Monin-Obukhov similarity function for momentum over ice | none | 1 | real | kind_phys | in | F | +!! | ffhh_ocn | Monin_Obukhov_similarity_function_for_heat_over_ocean | Monin-Obukhov similarity function for heat over ocean | none | 1 | real | kind_phys | inout | F | +!! | ffhh_ice | Monin_Obukhov_similarity_function_for_heat_over_ice | Monin-Obukhov similarity function for heat over ice | none | 1 | real | kind_phys | in | F | !! | uustar_ocn | surface_friction_velocity_over_ocean | surface friction velocity over ocean | m s-1 | 1 | real | kind_phys | inout | F | !! | uustar_ice | surface_friction_velocity_over_ice | surface friction velocity over ice | m s-1 | 1 | real | kind_phys | in | F | -!! | fm10_ocn | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_ocean | Monin-Obukhov similarity parameter for momentum at 10m over ocean | none | 1 | real | kind_phys | inout | F | -!! | fm10_ice | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_ice | Monin-Obukhov similarity parameter for momentum at 10m over ice | none | 1 | real | kind_phys | in | F | -!! | fh2_ocn | Monin-Obukhov_similarity_function_for_heat_at_2m_over_ocean | Monin-Obukhov similarity parameter for heat at 2m over ocean | none | 1 | real | kind_phys | inout | F | -!! | fh2_ice | Monin-Obukhov_similarity_function_for_heat_at_2m_over_ice | Monin-Obukhov similarity parameter for heat at 2m over ice | none | 1 | real | kind_phys | in | F | +!! | fm10_ocn | Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ocean | Monin-Obukhov similarity parameter for momentum at 10m over ocean | none | 1 | real | kind_phys | inout | F | +!! | fm10_ice | Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ice | Monin-Obukhov similarity parameter for momentum at 10m over ice | none | 1 | real | kind_phys | in | F | +!! | fh2_ocn | Monin_Obukhov_similarity_function_for_heat_at_2m_over_ocean | Monin-Obukhov similarity parameter for heat at 2m over ocean | none | 1 | real | kind_phys | inout | F | +!! | fh2_ice | Monin_Obukhov_similarity_function_for_heat_at_2m_over_ice | Monin-Obukhov similarity parameter for heat at 2m over ice | none | 1 | real | kind_phys | in | F | !! | oro | orography | orography | m | 1 | real | kind_phys | in | F | !! | oro_uf | orography_unfiltered | unfiltered orographyo | m | 1 | real | kind_phys | in | F | !! | tsfc_ocn | surface_skin_temperature_over_ocean_interstitial | surface skin temperature over ocean (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | @@ -849,8 +849,8 @@ end subroutine sfc_nst_post_finalize !! | nstf_name5 | vertical_temperature_average_range_upper_bound | zsea2 | mm | 0 | integer | | in | F | !! | xt | diurnal_thermocline_layer_heat_content | heat content in diurnal thermocline layer | K m | 1 | real | kind_phys | in | F | !! | xz | diurnal_thermocline_layer_thickness | diurnal thermocline layer thickness | m | 1 | real | kind_phys | in | F | -!! | dt_cool | sub-layer_cooling_amount | sub-layer cooling amount | K | 1 | real | kind_phys | in | F | -!! | z_c | sub-layer_cooling_thickness | sub-layer cooling thickness | m | 1 | real | kind_phys | in | F | +!! | dt_cool | sub_layer_cooling_amount | sub-layer cooling amount | K | 1 | real | kind_phys | in | F | +!! | z_c | sub_layer_cooling_thickness | sub-layer cooling thickness | m | 1 | real | kind_phys | in | F | !! | tref | sea_surface_reference_temperature | reference/foundation temperature | K | 1 | real | kind_phys | in | F | !! | xlon | longitude | longitude | radians | 1 | real | kind_phys | in | F | !! | tsurf_ocn | surface_skin_temperature_after_iteration_over_ocean | surface skin temperature after iteration over ocean | K | 1 | real | kind_phys | inout | F | diff --git a/physics/shinhongvdif.F90 b/physics/shinhongvdif.F90 index c5011218b..b6ff380d8 100644 --- a/physics/shinhongvdif.F90 +++ b/physics/shinhongvdif.F90 @@ -48,8 +48,8 @@ end subroutine shinhongvdif_finalize !! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | !! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | !! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | -!! | psim | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | -!! | psih | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | +!! | psim | Monin_Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | +!! | psih | Monin_Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | !! | landmask | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | !! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | !! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | From bc7b298b2a55462c1ac893a65456dd9b27944616 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Fri, 26 Jul 2019 11:08:55 -0600 Subject: [PATCH 41/89] physics/sfc_nst.f, physics/sfc_sice.f: correct name of Stefan Boltzmann constant --- physics/sfc_nst.f | 2 +- physics/sfc_sice.f | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f index a6675f88d..086eb54f2 100644 --- a/physics/sfc_nst.f +++ b/physics/sfc_nst.f @@ -36,7 +36,7 @@ end subroutine sfc_nst_finalize !! | rvrdm1 | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | !! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | !! | rhw0 | sea_water_reference_density | sea water reference density | kg m-3 | 0 | real | kind_phys | in | F | -!! | sbc | steffan_boltzmann_constant | Steffan-Boltzmann constant | W m-2 K-4 | 0 | real | kind_phys | in | F | +!! | sbc | stefan_boltzmann_constant | Stefan-Boltzmann constant | W m-2 K-4 | 0 | real | kind_phys | in | F | !! | pi | pi | ratio of a circle's circumference to its diameter | radians | 0 | real | kind_phys | in | F | !! | ps | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | !! | u1 | x_wind_at_lowest_model_layer | x component of surface layer wind | m s-1 | 1 | real | kind_phys | in | F | diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index fbc14587a..5ce9b3b8f 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -19,7 +19,7 @@ end subroutine sfc_sice_finalize !! |----------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | !! | km | soil_vertical_dimension | vertical loop extent for soil levels, start at 1 | count | 0 | integer | | in | F | -!! | sbc | steffan_boltzmann_constant | Steffan-Boltzmann constant | W m-2 K-4 | 0 | real | kind_phys | in | F | +!! | sbc | stefan_boltzmann_constant | Stefan-Boltzmann constant | W m-2 K-4 | 0 | real | kind_phys | in | F | !! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | !! | tgice | freezing_point_temperature_of_seawater | freezing point temperature of seawater | K | 0 | real | kind_phys | in | F | !! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | From 11e5d6f7ceb1924eb14f05c532ba8f1559191775 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Mon, 29 Jul 2019 13:19:40 -0600 Subject: [PATCH 42/89] remove loops over nblks in SCM-related GFS_phys_time_vary --- physics/GFS_phys_time_vary.scm.F90 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/physics/GFS_phys_time_vary.scm.F90 b/physics/GFS_phys_time_vary.scm.F90 index 200881d2c..a69df6c79 100644 --- a/physics/GFS_phys_time_vary.scm.F90 +++ b/physics/GFS_phys_time_vary.scm.F90 @@ -367,25 +367,19 @@ subroutine GFS_phys_time_vary_run (Grid, Statein, Model, Tbd, Sfcprop, Cldprop, sec_zero = nint(Model%fhzero*con_hr) if (sec_zero >= nint(max(Model%fhswr,Model%fhlwr))) then if (mod(Model%kdt,Model%nszero) == 1) then - do nb = 1,nblks call Diag%rad_zero (Model) call Diag%phys_zero (Model) !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED - enddo endif else if (mod(Model%kdt,Model%nszero) == 1) then - do nb = 1,nblks call Diag%phys_zero (Model) !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED - enddo endif kdt_rad = nint(min(Model%fhswr,Model%fhlwr)/Model%dtp) if (mod(Model%kdt, kdt_rad) == 1) then - do nb = 1,nblks call Diag%rad_zero (Model) !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED - enddo endif endif From c0b60ecd17f9734c158b2397a2a0abf19f58efa8 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Wed, 31 Jul 2019 11:19:24 -0600 Subject: [PATCH 43/89] use assumed-shape arrays for MG-specific arrays in convection schemes (since memory is conditionally allocated) --- physics/cs_conv.F90 | 6 +++++- physics/m_micro.F90 | 16 +++++++++++++--- physics/samfdeepcnv.f | 8 ++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/physics/cs_conv.F90 b/physics/cs_conv.F90 index d59f27656..617fe5066 100644 --- a/physics/cs_conv.F90 +++ b/physics/cs_conv.F90 @@ -423,9 +423,13 @@ subroutine cs_conv_run(IM , IJSDIM , KMAX , ntracp1 , NN, & real(r8), intent(inout), dimension(IJSDIM,KMAX) :: ud_mf, dd_mf, dt_mf real(r8), intent(out) :: rain1(IJSDIM) ! lwe thickness of deep convective precipitation amount (m) - real(r8), intent(out), dimension(ijsdim,kmax) :: qlcn, qicn, w_upi,cnv_mfd, & +! GJF* These variables are conditionally allocated depending on whether the +! Morrison-Gettelman microphysics is used, so they must be declared +! using assumed shape. + real(r8), intent(out), dimension(:,:) :: qlcn, qicn, w_upi,cnv_mfd, & cnv_dqldt, clcn, cnv_fice, & cnv_ndrop, cnv_nice, cf_upi +! *GJF integer, intent(inout) :: kcnv(im) ! zero if no deep convection and 1 otherwise character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/m_micro.F90 b/physics/m_micro.F90 index 26a9471f6..7a13f13fe 100644 --- a/physics/m_micro.F90 +++ b/physics/m_micro.F90 @@ -297,10 +297,16 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & & lwheat_i,swheat_i real (kind=kind_phys), dimension(ix,0:lm),intent(in):: prsi_i, & & phii - real (kind=kind_phys), dimension(im,lm),intent(in) :: & +! GJF* These variables are conditionally allocated depending on whether the +! Morrison-Gettelman microphysics is used, so they must be declared +! using assumed shape. + real (kind=kind_phys), dimension(:,:), intent(in) :: & & CNV_DQLDT_i, CLCN_i, QLCN_i, QICN_i, & & CNV_MFD_i, cf_upi, CNV_FICE_i, CNV_NDROP_i, & - & CNV_NICE_i, w_upi, rhc_i, naai_i, npccn_i + & CNV_NICE_i, w_upi +! *GJF + real (kind=kind_phys), dimension(im,lm),intent(in) :: & + & rhc_i, naai_i, npccn_i real (kind=kind_phys), dimension(im,lm,ntrcaer),intent(in) :: & & aerfld_i real (kind=kind_phys),dimension(im),intent(in):: TAUGWX, & @@ -320,9 +326,13 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & integer, dimension(IM), intent(inout):: KCBL real (kind=kind_phys),dimension(ix,lm),intent(inout):: q_io, t_io, & & ncpl_io,ncpi_io,CLLS_io - real (kind=kind_phys),dimension(im,lm),intent(inout):: rnw_io,snw_io,& +! GJF* These variables are conditionally allocated depending on whether the +! Morrison-Gettelman microphysics is used, so they must be declared +! using assumed shape. + real (kind=kind_phys),dimension(:,:),intent(inout):: rnw_io,snw_io,& & ncpr_io, ncps_io, & & qgl_io, ncgl_io +! *GJF !Moo real (kind=kind_phys),dimension(im,lm),intent(inout):: CLLS_io diff --git a/physics/samfdeepcnv.f b/physics/samfdeepcnv.f index d50071547..b60734a0f 100644 --- a/physics/samfdeepcnv.f +++ b/physics/samfdeepcnv.f @@ -168,10 +168,14 @@ subroutine samfdeepcnv_run (im,ix,km,cliq,cp,cvap, & real(kind=kind_phys), intent(out) :: cldwrk(im), & & rn(im), & & ud_mf(im,km),dd_mf(im,km), dt_mf(im,km) - - real(kind=kind_phys), dimension(im,km), intent(inout) :: & + + ! GJF* These variables are conditionally allocated depending on whether the + ! Morrison-Gettelman microphysics is used, so they must be declared + ! using assumed shape. + real(kind=kind_phys), dimension(:,:), intent(inout) :: & & qlcn, qicn, w_upi, cnv_mfd, cnv_dqldt, clcn & &, cnv_fice, cnv_ndrop, cnv_nice, cf_upi + ! *GJF integer :: mp_phys, mp_phys_mg real(kind=kind_phys), intent(in) :: clam, c0s, c1, & From 99b645c3d7f881061dcbfd531e63f4f644c773d8 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Wed, 31 Jul 2019 13:51:10 -0600 Subject: [PATCH 44/89] Change schemes to use 'number_of_vertical_layers_for_radiation_calculations' instead of its interstitial duplicate 'vertical_layer_dimension_for_radiation', replace '.' in standard names with 'p' --- physics/GFS_rrtmg_post.F90 | 4 ++-- physics/GFS_rrtmg_pre.F90 | 2 +- physics/radsw_main.f | 2 +- physics/rrtmg_lw_post.F90 | 2 +- physics/rrtmg_sw_post.F90 | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/physics/GFS_rrtmg_post.F90 b/physics/GFS_rrtmg_post.F90 index 4454998e5..8cb9cd131 100644 --- a/physics/GFS_rrtmg_post.F90 +++ b/physics/GFS_rrtmg_post.F90 @@ -21,7 +21,7 @@ end subroutine GFS_rrtmg_post_init !! | Coupling | GFS_coupling_type_instance | Fortran DDT containing FV3-GFS fields to/from coupling with other components | DDT | 0 | GFS_coupling_type | | inout | F | !! | scmpsw | components_of_surface_downward_shortwave_fluxes | derived type for special components of surface downward shortwave fluxes | W m-2 | 1 | cmpfsw_type | | in | F | !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | lm | vertical_layer_dimension_for_radiation | number of vertical layers for radiation calculation | count | 0 | integer | | in | F | +!! | lm | number_of_vertical_layers_for_radiation_calculations | number of vertical layers for radiation calculation | count | 0 | integer | | in | F | !! | ltp | extra_top_layer | extra top layers | none | 0 | integer | | in | F | !! | kt | vertical_index_difference_between_layer_and_upper_bound | vertical index difference between layer and upper bound | index | 0 | integer | | in | F | !! | kb | vertical_index_difference_between_layer_and_lower_bound | vertical index difference between layer and lower bound | index | 0 | integer | | in | F | @@ -33,7 +33,7 @@ end subroutine GFS_rrtmg_post_init !! | mbota | model_layer_number_at_cloud_base | vertical indices for low, middle and high cloud bases | index | 2 | integer | | in | F | !! | clouds1 | total_cloud_fraction | layer total cloud fraction | frac | 2 | real | kind_phys | in | F | !! | cldtaulw | cloud_optical_depth_layers_at_10mu_band | approx 10mu band layer cloud optical depth | none | 2 | real | kind_phys | in | F | -!! | cldtausw | cloud_optical_depth_layers_at_0.55mu_band | approx .55mu band layer cloud optical depth | none | 2 | real | kind_phys | in | F | +!! | cldtausw | cloud_optical_depth_layers_at_0p55mu_band | approx .55mu band layer cloud optical depth | none | 2 | real | kind_phys | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index b58320fee..651e65337 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -24,7 +24,7 @@ end subroutine GFS_rrtmg_pre_init !! | Cldprop | GFS_cldprop_type_instance | Fortran DDT containing FV3-GFS cloud fields needed by radiation from physics | DDT | 0 | GFS_cldprop_type | | in | F | !! | Coupling | GFS_coupling_type_instance | Fortran DDT containing FV3-GFS fields needed for coupling | DDT | 0 | GFS_coupling_type| | in | F | !! | Radtend | GFS_radtend_type_instance | Fortran DDT containing FV3-GFS radiation tendencies | DDT | 0 | GFS_radtend_type | | inout | F | -!! | lm | vertical_layer_dimension_for_radiation | number of vertical layers for radiation calculation | count | 0 | integer | | in | F | +!! | lm | number_of_vertical_layers_for_radiation_calculations | number of vertical layers for radiation calculation | count | 0 | integer | | in | F | !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | !! | lmk | adjusted_vertical_layer_dimension_for_radiation | number of vertical layers for radiation | count | 0 | integer | | in | F | !! | lmp | adjusted_vertical_level_dimension_for_radiation | number of vertical levels for radiation | count | 0 | integer | | in | F | diff --git a/physics/radsw_main.f b/physics/radsw_main.f index 47f8700f9..78f11c6cd 100644 --- a/physics/radsw_main.f +++ b/physics/radsw_main.f @@ -496,7 +496,7 @@ end subroutine rrtmg_sw_init !! | hswc | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step | shortwave total sky heating rate | K s-1 | 2 | real | kind_phys | inout | F | !! | topflx | sw_fluxes_top_atmosphere | shortwave total sky fluxes at the top of the atm | W m-2 | 1 | topfsw_type | | inout | F | !! | sfcflx | sw_fluxes_sfc | shortwave total sky fluxes at the Earth surface | W m-2 | 1 | sfcfsw_type | | inout | F | -!! | cldtau | cloud_optical_depth_layers_at_0.55mu_band | approx .55mu band layer cloud optical depth | none | 2 | real | kind_phys | inout | F | +!! | cldtau | cloud_optical_depth_layers_at_0p55mu_band | approx .55mu band layer cloud optical depth | none | 2 | real | kind_phys | inout | F | !! | hsw0 | tendency_of_air_temperature_due_to_shortwave_heating_assuming_clear_sky_on_radiation_time_step | shortwave clear sky heating rate | K s-1 | 2 | real | kind_phys | inout | T | !! | hswb | sw_heating_rate_spectral | shortwave total sky heating rate (spectral) | K s-1 | 3 | real | kind_phys | inout | T | !! | flxprf | sw_fluxes | sw fluxes total sky / csk and up / down at levels | W m-2 | 2 | profsw_type | | inout | T | diff --git a/physics/rrtmg_lw_post.F90 b/physics/rrtmg_lw_post.F90 index 0eacfe2ef..5e98d65e1 100644 --- a/physics/rrtmg_lw_post.F90 +++ b/physics/rrtmg_lw_post.F90 @@ -21,7 +21,7 @@ end subroutine rrtmg_lw_post_init !! | Coupling | GFS_coupling_type_instance | Fortran DDT containing FV3-GFS fields to/from coupling with other components | DDT | 0 | GFS_coupling_type | | inout | F | !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | !! | ltp | extra_top_layer | extra top layers | none | 0 | integer | | in | F | -!! | lm | vertical_layer_dimension_for_radiation | number of vertical layers for radiation calculation | count | 0 | integer | | in | F | +!! | lm | number_of_vertical_layers_for_radiation_calculations | number of vertical layers for radiation calculation | count | 0 | integer | | in | F | !! | kd | vertical_index_difference_between_inout_and_local | vertical index difference between in/out and local | index | 0 | integer | | in | F | !! | tsfa | surface_air_temperature_for_radiation | lowest model layer air temperature for radiation | K | 1 | real | kind_phys | in | F | !! | htlwc | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step | total sky heating rate due to longwave radiation | K s-1 | 2 | real | kind_phys | in | F | diff --git a/physics/rrtmg_sw_post.F90 b/physics/rrtmg_sw_post.F90 index a80c62652..a31ed7ec9 100644 --- a/physics/rrtmg_sw_post.F90 +++ b/physics/rrtmg_sw_post.F90 @@ -22,7 +22,7 @@ end subroutine rrtmg_sw_post_init !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | !! | ltp | extra_top_layer | extra top layers | none | 0 | integer | | in | F | !! | nday | daytime_points_dimension | daytime points dimension | count | 0 | integer | | in | F | -!! | lm | vertical_layer_dimension_for_radiation | number of vertical layers for radiation calculation | count | 0 | integer | | in | F | +!! | lm | number_of_vertical_layers_for_radiation_calculations | number of vertical layers for radiation calculation | count | 0 | integer | | in | F | !! | kd | vertical_index_difference_between_inout_and_local | vertical index difference between in/out and local | index | 0 | integer | | in | F | !! | htswc | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step | total sky heating rate due to shortwave radiation | K s-1 | 2 | real | kind_phys | in | F | !! | htsw0 | tendency_of_air_temperature_due_to_shortwave_heating_assuming_clear_sky_on_radiation_time_step | clear sky heating rates due to shortwave radiation | K s-1 | 2 | real | kind_phys | in | F | From 9157281abdae57b07880714467129435693f525a Mon Sep 17 00:00:00 2001 From: climbfuji Date: Wed, 31 Jul 2019 13:56:07 -0600 Subject: [PATCH 45/89] physics/radlw_param.f, physics/radlw_param.meta, physics/radsw_param.f, physics/radsw_param.meta: add metadata (in new format) in the correct places for radiation DDTs --- physics/radlw_param.f | 24 +++++++++++++++----- physics/radlw_param.meta | 25 +++++++++++++++++++++ physics/radsw_param.f | 48 +++++++++++++++++++++++++--------------- physics/radsw_param.meta | 36 ++++++++++++++++++++++++++++++ 4 files changed, 109 insertions(+), 24 deletions(-) create mode 100644 physics/radlw_param.meta create mode 100644 physics/radsw_param.meta diff --git a/physics/radlw_param.f b/physics/radlw_param.f index 47ed660d8..539d2faa5 100644 --- a/physics/radlw_param.f +++ b/physics/radlw_param.f @@ -61,30 +61,42 @@ module module_radlw_parameters ! !........................................! +!! \section arg_table_module_radlw_parameters +!! \htmlinclude module_radlw_parameters.html +!! + use physparam, only : kind_phys implicit none ! public ! - type :: topflw_type !< define type construct for radiation fluxes at toa +!> derived type for LW fluxes at top of atmosphere +!! \section arg_table_topflw_type +!! \htmlinclude topflw_type.html +!! + type topflw_type !< define type construct for radiation fluxes at toa real (kind=kind_phys) :: upfxc !< total sky upward flux at toa real (kind=kind_phys) :: upfx0 !< clear sky upward flux at toa - end type + end type topflw_type ! - type :: sfcflw_type !< define type construct for radiation fluxes at surface +!> derived type for LW fluxes at surface +!! \section arg_table_sfcflw_type +!! \htmlinclude sfcflw_type.html +!! + type sfcflw_type !< define type construct for radiation fluxes at surface real (kind=kind_phys) :: upfxc !< total sky upward flux at sfc real (kind=kind_phys) :: upfx0 !< clear sky upward flux at sfc real (kind=kind_phys) :: dnfxc !< total sky downward flux at sfc real (kind=kind_phys) :: dnfx0 !< clear sky downward flux at sfc - end type + end type sfcflw_type ! - type :: proflw_type !< define type construct for optional radiation flux profiles + type proflw_type !< define type construct for optional radiation flux profiles real (kind=kind_phys) :: upfxc !< level up flux for total sky real (kind=kind_phys) :: dnfxc !< level down flux for total sky real (kind=kind_phys) :: upfx0 !< level up for clear sky real (kind=kind_phys) :: dnfx0 !< level down flux for clear sky - end type + end type proflw_type ! ! Parameter constants for LW band structures integer, parameter :: NBANDS = 16 !< number of total spectral bands diff --git a/physics/radlw_param.meta b/physics/radlw_param.meta new file mode 100644 index 000000000..a06a89512 --- /dev/null +++ b/physics/radlw_param.meta @@ -0,0 +1,25 @@ +[ccpp-arg-table] + name = topflw_type + type = ddt + +######################################################################## +[ccpp-arg-table] + name = sfcflw_type + type = ddt + +######################################################################## +[ccpp-arg-table] + name = module_radlw_parameters + type = module +[topflw_type] + standard_name = topflw_type + long_name = definition of type topflw_type + units = DDT + dimensions = () + type = topflw_type +[sfcflw_type] + standard_name = sfcflw_type + long_name = definition of type sfcflw_type + units = DDT + dimensions = () + type = sfcflw_type diff --git a/physics/radsw_param.f b/physics/radsw_param.f index d4e697711..93608eb65 100644 --- a/physics/radsw_param.f +++ b/physics/radsw_param.f @@ -62,6 +62,10 @@ module module_radsw_parameters ! !........................................! +!! \section arg_table_module_radsw_parameters +!! \htmlinclude module_radsw_parameters.html +!! + use physparam, only : kind_phys implicit none @@ -69,37 +73,46 @@ module module_radsw_parameters ! public ! !> derived type for SW fluxes at TOA - type :: topfsw_type +!! \section arg_table_topfsw_type +!! \htmlinclude topfsw_type.html +!! + type topfsw_type real (kind=kind_phys) :: upfxc !< total-sky upward flux real (kind=kind_phys) :: dnfxc !< total-sky downward flux real (kind=kind_phys) :: upfx0 !< clear-sky upward flux - end type + end type topfsw_type ! !> derived type for SW fluxes at surface - type :: sfcfsw_type +!! \section arg_table_sfcfsw_type +!! \htmlinclude sfcfsw_type.html +!! + type sfcfsw_type real (kind=kind_phys) :: upfxc !< total-sky upward flux real (kind=kind_phys) :: dnfxc !< total-sky downward flux real (kind=kind_phys) :: upfx0 !< clear-sky upward flux real (kind=kind_phys) :: dnfx0 !< clear-sky downward flux - end type + end type sfcfsw_type ! !> derived type for SW fluxes' column profiles (at layer interfaces) - type :: profsw_type + type profsw_type real (kind=kind_phys) :: upfxc !< total-sky upward flux real (kind=kind_phys) :: dnfxc !< total-sky downward flux real (kind=kind_phys) :: upfx0 !< clear-sky upward flux real (kind=kind_phys) :: dnfx0 !< clear-sky downward flux - end type + end type profsw_type ! !> derived type for special components of surface SW fluxes - type :: cmpfsw_type +!! \section arg_table_cmpfsw_type +!! \htmlinclude cmpfsw_type.html +!! + type cmpfsw_type real (kind=kind_phys) :: uvbfc !< total-sky downward flux cover UV-B spectrum real (kind=kind_phys) :: uvbf0 !< clear-sky downward flux cover UV-B spectrum real (kind=kind_phys) :: nirbm !< total-sky downward flux for near-IR direct beam real (kind=kind_phys) :: nirdf !< total-sky downward flux for near-IR diffused part real (kind=kind_phys) :: visbm !< total-sky downward flux for UV+Visible direct real (kind=kind_phys) :: visdf !< total-sky downward flux for UV+Visible diffused - end type + end type cmpfsw_type ! ! Parameter constants for SW band structures @@ -142,8 +155,8 @@ module module_radsw_parameters ! & NS23, NS24, NS25, NS26, NS27, NS28, NS29 / !> reverse checking of band index for each g-point - integer, dimension(NGPTSW) :: NGB - data NGB(:) / 16,16,16,16,16,16, & ! band 16 + integer, dimension(NGPTSW), parameter :: NGB = & + & (/ 16,16,16,16,16,16, & ! band 16 & 17,17,17,17,17,17,17,17,17,17,17,17, & ! band 17 & 18,18,18,18,18,18,18,18, & ! band 18 & 19,19,19,19,19,19,19,19, & ! band 19 @@ -156,16 +169,15 @@ module module_radsw_parameters ! & 26,26,26,26,26,26, & ! band 26 & 27,27,27,27,27,27,27,27, & ! band 27 & 28,28,28,28,28,28, & ! band 28 - & 29,29,29,29,29,29,29,29,29,29,29,29 / ! band 29 + & 29,29,29,29,29,29,29,29,29,29,29,29 /) ! band 29 !> \name Starting/ending wavenumber for each of the SW bands - real (kind=kind_phys), dimension(NBANDS):: wvnum1, wvnum2 - data wvnum1(:) / & - & 2600.0, 3250.0, 4000.0, 4650.0, 5150.0, 6150.0, 7700.0, & - & 8050.0,12850.0,16000.0,22650.0,29000.0,38000.0, 820.0 / - data wvnum2(:) / & - & 3250.0, 4000.0, 4650.0, 5150.0, 6150.0, 7700.0, 8050.0, & - & 12850.0,16000.0,22650.0,29000.0,38000.0,50000.0, 2600.0 / + real (kind=kind_phys), dimension(NBANDS), parameter :: wvnum1 = & + & (/ 2600.0, 3250.0, 4000.0, 4650.0, 5150.0, 6150.0, 7700.0, & + & 8050.0,12850.0,16000.0,22650.0,29000.0,38000.0, 820.0 /) + real (kind=kind_phys), dimension(NBANDS), parameter :: wvnum2 = & + & (/ 3250.0, 4000.0, 4650.0, 5150.0, 6150.0, 7700.0, 8050.0, & + & 12850.0,16000.0,22650.0,29000.0,38000.0,50000.0, 2600.0 /) ! !........................................! diff --git a/physics/radsw_param.meta b/physics/radsw_param.meta new file mode 100644 index 000000000..9f7c8a35a --- /dev/null +++ b/physics/radsw_param.meta @@ -0,0 +1,36 @@ +[ccpp-arg-table] + name = topfsw_type + type = ddt + +######################################################################## +[ccpp-arg-table] + name = sfcfsw_type + type = ddt + +######################################################################## +[ccpp-arg-table] + name = cmpfsw_type + type = ddt + +######################################################################## +[ccpp-arg-table] + name = module_radsw_parameters + type = module +[topfsw_type] + standard_name = topfsw_type + long_name = definition of type topfsw_type + units = DDT + dimensions = () + type = topfsw_type +[sfcfsw_type] + standard_name = sfcfsw_type + long_name = definition of type sfcfsw_type + units = DDT + dimensions = () + type = sfcfsw_type +[cmpfsw_type] + standard_name = cmpfsw_type + long_name = definition of type cmpfsw_type + units = DDT + dimensions = () + type = cmpfsw_type From 9e441cc49e353b7f439bbaba0c64393884b9fb1e Mon Sep 17 00:00:00 2001 From: Joseph Olson Date: Wed, 31 Jul 2019 20:00:05 +0000 Subject: [PATCH 46/89] Updating MYNN EDMF and MYNNrad_pre --- physics/module_MYNNrad_pre.F90 | 14 ++- physics/module_bl_mynn.F90 | 196 ++++++++++++++++++++++----------- 2 files changed, 143 insertions(+), 67 deletions(-) diff --git a/physics/module_MYNNrad_pre.F90 b/physics/module_MYNNrad_pre.F90 index 7b8af5962..7236f4f8e 100644 --- a/physics/module_MYNNrad_pre.F90 +++ b/physics/module_MYNNrad_pre.F90 @@ -41,6 +41,15 @@ end subroutine mynnrad_pre_finalize !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! #endif +! +! cloud array description: ! +! clouds(:,:,1) - layer total cloud fraction ! +! clouds(:,:,2) - layer cloud liq water path ! +! clouds(:,:,3) - mean effective radius for liquid cloud ! +! clouds(:,:,4) - layer cloud ice water path ! +! clouds(:,:,5) - mean effective radius for ice cloud ! +! +!###=================================================================== SUBROUTINE mynnrad_pre_run( & & ix,im,levs, & & qc, qi, T3D, & @@ -88,6 +97,7 @@ SUBROUTINE mynnrad_pre_run( & qc_save(i,k) = qc(i,k) qi_save(i,k) = qi(i,k) + clouds1(i,k)=CLDFRA_BL(i,k) IF (qc(i,k) < 1.E-6 .AND. qi(i,k) < 1.E-8 .AND. CLDFRA_BL(i,k)>0.001) THEN !Partition the BL clouds into water & ice according to a linear @@ -95,8 +105,8 @@ SUBROUTINE mynnrad_pre_run( & !one 3D array for both cloud water & ice. ! Wice = 1. - MIN(1., MAX(0., (t(i,k)-254.)/15.)) ! Wh2o = 1. - Wice - clouds1(i,k)=MAX(clouds1(i,k),CLDFRA_BL(i,k)) - clouds1(i,k)=MAX(0.0,MIN(1.0,clouds1(i,k))) + !clouds1(i,k)=MAX(clouds1(i,k),CLDFRA_BL(i,k)) + !clouds1(i,k)=MAX(0.0,MIN(1.0,clouds1(i,k))) qc(i,k) = QC_BL(i,k)*(MIN(1., MAX(0., (T3D(i,k)-254.)/15.)))*CLDFRA_BL(i,k) qi(i,k) = QC_BL(i,k)*(1. - MIN(1., MAX(0., (T3D(i,k)-254.)/15.)))*CLDFRA_BL(i,k) diff --git a/physics/module_bl_mynn.F90 b/physics/module_bl_mynn.F90 index 183d4bb5a..e472a2873 100644 --- a/physics/module_bl_mynn.F90 +++ b/physics/module_bl_mynn.F90 @@ -218,7 +218,7 @@ MODULE module_bl_mynn ! Constants for cloud PDF (mym_condensation) REAL, PARAMETER :: rr2=0.7071068, rrp=0.3989423 -! 'parameters' for Poisson distribution (StEM EDMF scheme) +! 'parameters' for Poisson distribution (EDMF scheme) REAL, PARAMETER :: zero = 0.0, half = 0.5, one = 1.0, two = 2.0 !>Use Canuto/Kitamura mod (remove Ric and negative TKE) (1:yes, 0:no) @@ -443,7 +443,8 @@ MODULE module_bl_mynn SUBROUTINE mym_initialize ( & & kts,kte, & & dz, zw, & - & u, v, thl, qw, & ! &ust, rmo, pmz, phh, flt, flq, & + & u, v, thl, qw, & +! & ust, rmo, pmz, phh, flt, flq, & & zi, theta, sh, & & ust, rmo, el, & & Qke, Tsq, Qsq, Cov, Psig_bl, cldfra_bl1D, & @@ -1003,12 +1004,12 @@ SUBROUTINE mym_length ( & CASE (2) !Experimental mixing length formulation cns = 3.5 - alp1 = 0.23 + alp1 = 0.25 + 0.02*MIN(MAX(zi-200.,0.),1000.)/1000. !0.23 alp2 = 0.6 !0.3 - alp3 = 2.0 - alp4 = 10. + alp3 = 3.0 !2.0 + alp4 = 20. !10. alp5 = 0.6 !0.3 !like alp2, but for free atmosphere - alp6 = 10.0 !used for MF mixing length instead of BouLac (x times MF) + alp6 = 50.0 !used for MF mixing length instead of BouLac (x times MF) ! Impose limits on the height integration for elt and the transition layer depth !zi2=MAX(zi,minzi) @@ -1024,7 +1025,7 @@ SUBROUTINE mym_length ( & afk = dz(k)/( dz(k)+dz(k-1) ) abk = 1.0 -afk qkw(k) = SQRT(MAX(qke(k)*abk+qke(k-1)*afk,1.0e-3)) - qtke(k) = 0.5*(qkw(k)**2.) ! q -> TKE + qtke(k) = 0.5*qkw(k) ! q -> TKE END DO elt = 1.0e-5 @@ -1060,7 +1061,8 @@ SUBROUTINE mym_length ( & bv = SQRT( gtr*dtv(k) ) !elb_mf = alp2*qkw(k) / bv & elb_mf = MAX(alp2*qkw(k), & - &MAX(1.-2.0*cldavg,0.0)**0.5*alp6*edmf_a1(k)*edmf_w1(k)) / bv & +! &MAX(1.-2.0*cldavg,0.0)**0.5*alp6*edmf_a1(k)*edmf_w1(k)) / bv & + & alp6*edmf_a1(k)*edmf_w1(k)) / bv & & *( 1.0 + alp3*SQRT( vsc/( bv*elt ) ) ) elb = MIN(alp5*qkw(k)/bv, zwk) elf = elb/(1. + (elb/600.)) !bound free-atmos mixing length to < 600 m. @@ -1082,12 +1084,12 @@ SUBROUTINE mym_length ( & ! velocity scale), except that elt is relpaced ! by zi, and zero is replaced by 1.0e-4 to ! prevent division by zero. - tau_cloud = MIN(MAX(0.5*zi/((gtr*zi*MAX(flt,1.0e-4))**(1.0/3.0)),25.),100.) + tau_cloud = MIN(MAX(0.5*zi/((gtr*zi*MAX(flt,1.0e-4))**(1.0/3.0)),50.),150.) !minimize influence of surface heat flux on tau far away from the PBLH. wt=.5*TANH((zwk - (zi2+h1))/h2) + .5 tau_cloud = tau_cloud*(1.-wt) + 50.*wt - elb = MIN(tau_cloud*SQRT(MIN(qtke(k),50.)), zwk) + elb = MIN(tau_cloud*SQRT(MIN(qtke(k),30.)), zwk) elf = elb elb_mf = elb END IF @@ -1141,6 +1143,22 @@ END SUBROUTINE mym_length !\param lb1 the minimum of the length up and length down !\param lb2 the average of the length up and length down SUBROUTINE boulac_length0(k,kts,kte,zw,dz,qtke,theta,lb1,lb2) +! +! NOTE: This subroutine was taken from the BouLac scheme in WRF-ARW +! and modified for integration into the MYNN PBL scheme. +! WHILE loops were added to reduce the computational expense. +! This subroutine computes the length scales up and down +! and then computes the min, average of the up/down +! length scales, and also considers the distance to the +! surface. +! +! dlu = the distance a parcel can be lifted upwards give a finite +! amount of TKE. +! dld = the distance a parcel can be displaced downwards given a +! finite amount of TKE. +! lb1 = the minimum of the length up and length down +! lb2 = the average of the length up and length down +!------------------------------------------------------------------- INTEGER, INTENT(IN) :: k,kts,kte REAL, DIMENSION(kts:kte), INTENT(IN) :: qtke,dz,theta @@ -2342,7 +2360,7 @@ END SUBROUTINE mym_predict !! calculate the buoyancy flux. Different cloud PDFs can be selected by !! use of the namelist parameter \p bl_mynn_cloudpdf . SUBROUTINE mym_condensation (kts,kte, & - & dx, dz, & + & dx, dz, zw, & & thl, qw, & & p,exner, & & tsq, qsq, cov, & @@ -2363,6 +2381,7 @@ SUBROUTINE mym_condensation (kts,kte, & REAL, INTENT(IN) :: dx,PBLH1,HFX1,rmo REAL, DIMENSION(kts:kte), INTENT(IN) :: dz + REAL, DIMENSION(kts:kte+1), INTENT(IN) :: zw REAL, DIMENSION(kts:kte), INTENT(IN) :: p,exner, thl, qw, & &tsq, qsq, cov, th @@ -2373,7 +2392,8 @@ SUBROUTINE mym_condensation (kts,kte, & DOUBLE PRECISION :: t3sq, r3sq, c3sq REAL :: qsl,esat,qsat,tlk,qsat_tl,dqsl,cld0,q1k,eq1,qll,& - &q2p,pt,rac,qt,t,xl,rsl,cpm,cdhdz,Fng,qww,alpha,beta,bb,ls_min,ls,wt + &q2p,pt,rac,qt,t,xl,rsl,cpm,cdhdz,Fng,qww,alpha,beta,bb,& + &ls_min,ls,wt,cld_factor,fac_damp INTEGER :: i,j,k REAL :: erf @@ -2560,7 +2580,7 @@ SUBROUTINE mym_condensation (kts,kte, & zagl = zagl + dz(k) !Use analog to surface layer length scale to make the cloud mixing length scale !become less than z in stable conditions. - els = zagl/(1.0 + 1.0*MIN( 0.5*dz(1)*MAX(rmo,0.0), 1. )) + els = zagl ! /(1.0 + 1.0*MIN( 0.5*dz(1)*MAX(rmo,0.0), 1. )) ls_min = 300. + MIN(3.*MAX(HFX1,0.),300.) ls_min = MIN(MAX(els,25.),ls_min) ! Let this be the minimum possible length scale: @@ -2669,14 +2689,6 @@ SUBROUTINE mym_condensation (kts,kte, & vt(k) = qt-1.0 -rac*bet(k) vq(k) = p608*pt-tv0 +rac - !To avoid FPE in radiation driver, when these two quantities are multiplied by eachother, - ! add limit to qc_bl and cldfra_bl: - IF (QC_BL1D(k) < 1E-6 .AND. ABS(CLDFRA_BL1D(k)) > 0.01) QC_BL1D(k)= 1E-6 - IF (CLDFRA_BL1D(k) < 1E-2)THEN - CLDFRA_BL1D(k)=0. - QC_BL1D(k)=0. - ENDIF - END DO CASE ( 2, -2) ! JAYMES- this option added 8 May 2015 @@ -2748,20 +2760,25 @@ SUBROUTINE mym_condensation (kts,kte, & ! The "-1" and "-tv0" terms are included for consistency with ! the legacy vt and vq formulations (above). + !OLD-- ! increase the cloud fraction estimate below PBLH+1km - if (zagl .lt. PBLH2+1000.) cld(k) = MIN( 1., 1.5*cld(k) ) + !if (zagl .lt. PBLH2+1000.) then + ! cld_factor = 1.0 + MAX(0.0, ( RH(k) - 0.83 ) / 0.18 ) + ! cld(k) = MIN( 1., cld_factor*cld(k) ) + !end if + !NEW-- + ! dampen the amplification factor (cld_factor) with height in order + ! to limit excessively large cloud fractions aloft + fac_damp = 1. -MIN(MAX( zagl-(PBLH2+1000.),0.0)/ & + MAX((zw(k_tropo)-(PBLH2+1000.)),500.), 1.) + !cld_factor = 1.0 + fac_damp*MAX(0.0, ( RH(k) - 0.5 ) / 0.51 )**3.3 + cld_factor = 1.0 + fac_damp*MAX(0.0, ( RH(k) - 0.75 ) / 0.26 )**1.9 + cld(k) = MIN( 1., cld_factor*cld(k) ) + ! return a cloud condensate and cloud fraction for icloud_bl option: cldfra_bl1D(k) = cld(k) qc_bl1D(k) = ql(k) - !To avoid FPE in radiation driver, when these two quantities are multiplied by eachother, - ! add limit to qc_bl and cldfra_bl: - IF (QC_BL1D(k) < 1E-6 .AND. ABS(CLDFRA_BL1D(k)) > 0.01) QC_BL1D(k)= 1E-6 - IF (CLDFRA_BL1D(k) < 1E-2)THEN - CLDFRA_BL1D(k)=0. - QC_BL1D(k)=0. - ENDIF - END DO END SELECT !end cloudPDF option @@ -3988,7 +4005,7 @@ SUBROUTINE mynn_bl_driver( & INTEGER :: i,j,k REAL, DIMENSION(KTS:KTE) :: thl,thvl,tl,sqv,sqc,sqi,sqw,& &El, Dfm, Dfh, Dfq, Tcd, Qcd, Pdk, Pdt, Pdq, Pdc, & - &Vt, Vq, sgm + &Vt, Vq, sgm, thlsg REAL, DIMENSION(KTS:KTE) :: thetav,sh,u1,v1,w1,p1,ex1,dz1,th1,tk1,rho1,& & qke1,tsq1,qsq1,cov1,qv1,qi1,qc1,du1,dv1,dth1,dqv1,dqc1,dqi1, & @@ -4004,7 +4021,7 @@ SUBROUTINE mynn_bl_driver( & REAL, DIMENSION(KTS:KTE+1) :: zw REAL :: cpm,sqcg,flt,flq,flqv,flqc,pmz,phh,exnerg,zet,& - &afk,abk,ts_decay,th_sfc,ztop_shallow + &afk,abk,ts_decay,th_sfc,ztop_shallow,sqc9,sqi9 !JOE-add GRIMS parameters & variables real,parameter :: d1 = 0.02, d2 = 0.05, d3 = 0.001 @@ -4147,6 +4164,16 @@ SUBROUTINE mynn_bl_driver( & !suggested min temperature to improve accuracy. !thl(k)=th(i,k,j)*(1.- xlvcp/MAX(tk1(k),TKmin)*sqc(k) & ! & - xlscp/MAX(tk1(k),TKmin)*sqi(k)) + !COMPUTE THL USING SGS CLOUDS FOR PBLH DIAG + IF(sqc(k)<1e-6 .and. sqi(k)<1e-8 .and. CLDFRA_BL(i,k,j)>0.001)THEN + sqc9=QC_BL(i,k,j)*(MIN(1., MAX(0., (tk1(k)-254.)/15.)))*CLDFRA_BL(i,k,j) + sqi9=QC_BL(i,k,j)*(1. - MIN(1., MAX(0., (tk1(k)-254.)/15.)))*CLDFRA_BL(i,k,j) + ELSE + sqc9=sqc(k) + sqi9=sqi(k) + ENDIF + thlsg(k)=th(i,k,j)- xlvcp/exner(i,k,j)*sqc9 & + & - xlscp/exner(i,k,j)*sqi9 ELSE sqi(k)=0.0 sqw(k)=sqv(k)+sqc(k) @@ -4154,14 +4181,24 @@ SUBROUTINE mynn_bl_driver( & !Use form from Tripoli and Cotton (1981) with their !suggested min temperature to improve accuracy. !thl(k)=th(i,k,j)*(1.- xlvcp/MAX(tk1(k),TKmin)*sqc(k)) + !COMPUTE THL USING SGS CLOUDS FOR PBLH DIAG + IF(sqc(k)<1e-6 .and. CLDFRA_BL(i,k,j)>0.001)THEN + sqc9=QC_BL(i,k,j)*(MIN(1., MAX(0., (tk1(k)-254.)/15.)))*CLDFRA_BL(i,k,j) + sqi9=QC_BL(i,k,j)*(1. - MIN(1., MAX(0., (tk1(k)-254.)/15.)))*CLDFRA_BL(i,k,j) + ELSE + sqc9=sqc(k) + sqi9=0.0 + ENDIF + thlsg(k)=th(i,k,j)- xlvcp/exner(i,k,j)*sqc9 & + & - xlscp/exner(i,k,j)*sqi9 ENDIF + thvl(k)=thlsg(k)*(1.+0.61*sqv(k)) IF (k==kts) THEN zw(k)=0. ELSE zw(k)=zw(k-1)+dz(i,k-1,j) ENDIF - thvl(k)=thl(k)*(1.+0.61*sqv(k)) if (restart) then qke1(k) = qke(i,k,j) else @@ -4287,6 +4324,16 @@ SUBROUTINE mynn_bl_driver( & !suggested min temperature to improve accuracy. !thl(k)=th(i,k,j)*(1.- xlvcp/MAX(tk1(k),TKmin)*sqc(k) & ! & - xlscp/MAX(tk1(k),TKmin)*sqi(k)) + !COMPUTE THL USING SGS CLOUDS FOR PBLH DIAG + IF(sqc(k)<1e-6 .and. sqi(k)<1e-8 .and. CLDFRA_BL(i,k,j)>0.001)THEN + sqc9=QC_BL(i,k,j)*(MIN(1., MAX(0., (tk1(k)-254.)/15.)))*CLDFRA_BL(i,k,j) + sqi9=QC_BL(i,k,j)*(1. - MIN(1., MAX(0., (tk1(k)-254.)/15.)))*CLDFRA_BL(i,k,j) + ELSE + sqc9=sqc(k) + sqi9=sqi(k) + ENDIF + thlsg(k)=th(i,k,j)- xlvcp/exner(i,k,j)*sqc9 & + & - xlscp/exner(i,k,j)*sqi9 ELSE qi1(k)=0.0 sqi(k)=0.0 @@ -4295,7 +4342,19 @@ SUBROUTINE mynn_bl_driver( & !Use form from Tripoli and Cotton (1981) with their !suggested min temperature to improve accuracy. !thl(k)=th(i,k,j)*(1.- xlvcp/MAX(tk1(k),TKmin)*sqc(k)) + !COMPUTE THL USING SGS CLOUDS FOR PBLH DIAG + IF(sqc(k)<1e-6 .and. CLDFRA_BL(i,k,j)>0.001)THEN + sqc9=QC_BL(i,k,j)*(MIN(1., MAX(0., (tk1(k)-254.)/15.)))*CLDFRA_BL(i,k,j) + sqi9=QC_BL(i,k,j)*(1. - MIN(1., MAX(0., (tk1(k)-254.)/15.)))*CLDFRA_BL(i,k,j) + ELSE + sqc9=sqc(k) + sqi9=0.0 + ENDIF + thlsg(k)=th(i,k,j)- xlvcp/exner(i,k,j)*sqc9 & + & - xlscp/exner(i,k,j)*sqi9 ENDIF + thetav(k)=th(i,k,j)*(1.+0.608*sqv(k)) + thvl(k)=thlsg(k)*(1.+0.61*sqv(k)) IF (PRESENT(qni) .AND. FLAG_QNI ) THEN qni1(k)=qni(i,k,j) @@ -4317,8 +4376,6 @@ SUBROUTINE mynn_bl_driver( & ELSE qnifa1(k)=0.0 ENDIF - thetav(k)=th(i,k,j)*(1.+0.608*sqv(k)) - thvl(k)=thl(k)*(1.+0.61*sqv(k)) p1(k) = p(i,k,j) ex1(k)= exner(i,k,j) el(k) = el_pbl(i,k,j) @@ -4474,7 +4531,7 @@ SUBROUTINE mynn_bl_driver( & !! selected by use of the namelist parameter \p bl_mynn_cloudpdf. CALL mym_condensation ( kts,kte, & - &dx(i,j),dz1,thl,sqw,p1,ex1, & + &dx(i,j),dz1,zw,thl,sqw,p1,ex1, & &tsq1, qsq1, cov1, & &Sh,el,bl_mynn_cloudpdf, & &qc_bl1D,cldfra_bl1D, & @@ -4871,7 +4928,8 @@ END SUBROUTINE mynn_bl_driver SUBROUTINE mynn_bl_init_driver( & &RUBLTEN,RVBLTEN,RTHBLTEN,RQVBLTEN, & &RQCBLTEN,RQIBLTEN & !,RQNIBLTEN,RQNCBLTEN & - &,QKE,TKE_PBL,EXCH_H & ! &,icloud_bl,qc_bl,cldfra_bl & !JOE-subgrid bl clouds + &,QKE,TKE_PBL,EXCH_H & +! &,icloud_bl,qc_bl,cldfra_bl & !JOE-subgrid bl clouds &,RESTART,ALLOWED_TO_READ,LEVEL & &,IDS,IDE,JDS,JDE,KDS,KDE & &,IMS,IME,JMS,JME,KMS,KME & @@ -4948,6 +5006,23 @@ END SUBROUTINE mynn_bl_init_driver !> @{ SUBROUTINE GET_PBLH(KTS,KTE,zi,thetav1D,qke1D,zw1D,dz1D,landsea,kzi) + !--------------------------------------------------------------- + ! NOTES ON THE PBLH FORMULATION + ! + !The 1.5-theta-increase method defines PBL heights as the level at + !which the potential temperature first exceeds the minimum potential + !temperature within the boundary layer by 1.5 K. When applied to + !observed temperatures, this method has been shown to produce PBL- + !height estimates that are unbiased relative to profiler-based + !estimates (Nielsen-Gammon et al. 2008). However, their study did not + !include LLJs. Banta and Pichugina (2008) show that a TKE-based + !threshold is a good estimate of the PBL height in LLJs. Therefore, + !a hybrid definition is implemented that uses both methods, weighting + !the TKE-method more during stable conditions (PBLH < 400 m). + !A variable tke threshold (TKEeps) is used since no hard-wired + !value could be found to work best in all conditions. + !--------------------------------------------------------------- + INTEGER,INTENT(IN) :: KTS,KTE #ifdef HARDCODE_VERTICAL @@ -4990,7 +5065,7 @@ SUBROUTINE GET_PBLH(KTS,KTE,zi,thetav1D,qke1D,zw1D,dz1D,landsea,kzi) k = kthv+1 IF((landsea-1.5).GE.0)THEN ! WATER - delt_thv = 0.75 + delt_thv = 1.0 ELSE ! LAND delt_thv = 1.25 @@ -5205,7 +5280,7 @@ SUBROUTINE DMP_mf( & REAL, PARAMETER :: Atot = 0.10 ! Maximum total fractional area of all updrafts REAL, PARAMETER :: lmax = 1000.! diameter of largest plume REAL, PARAMETER :: dl = 100. ! diff size of each plume - the differential multiplied by the integrand - REAL, PARAMETER :: dcut = 1.0 ! max diameter of plume to parameterize relative to dx (km) + REAL, PARAMETER :: dcut = 1.2 ! max diameter of plume to parameterize relative to dx (km) REAL :: d != -2.3 to -1.7 ;=-1.9 in Neggers paper; power law exponent for number density (N=Cl^d). ! Note that changing d to -2.0 makes each size plume equally contribute to the total coverage of all plumes. ! Note that changing d to -1.7 doubles the area coverage of the largest plumes relative to the smallest plumes. @@ -5378,28 +5453,21 @@ SUBROUTINE DMP_mf( & ! Some of these criteria may be a little redundant but useful for bullet-proofing. ! (1) largest plume = 1.0 * dx. ! (2) Apply a scale-break, assuming no plumes with diameter larger than PBLH can exist. - ! (3) max plume size beneath clouds deck approx = 0.5 * cloud_base. + ! (3) max plume size beneath clouds deck approx = height of cloud_base. ! (4) add shear-dependent limit, when plume model breaks down. (taken out) ! (5) land-only limit to reduce plume sizes in weakly forced conditions ! Criteria (1) - NUP2 = max(1,min(NUP,INT(dx*dcut/dl))) + NUP2 = max(1,min(NUP,INT(dx*dcut/dl))) ! Criteria (2) and (4) - !wspd_pbl=SQRT(MAX(u(kpbl)**2 + v(kpbl)**2, 0.01)) - maxwidth = 1.1*PBLH !- MIN(15.*MAX(wspd_pbl - 7.5, 0.), 0.3*PBLH) + !wspd_pbl=SQRT(MAX(u(kpbl)**2 + v(kpbl)**2, 0.01)) + maxwidth = 1.2*PBLH !- MIN(15.*MAX(wspd_pbl - 7.5, 0.), 0.3*PBLH) ! Criteria (3) -! maxwidth = MIN(maxwidth,0.5*cloud_base) - maxwidth = MIN(maxwidth,0.75*cloud_base) + maxwidth = MIN(maxwidth,cloud_base) ! Criteria (5) - IF((landsea-1.5).LT.0)THEN - IF (cloud_base .LT. 2000.) THEN - !width_flx = MAX(MIN(1000.*(0.6*tanh((flt - 0.120)/0.03) + .5),1000.), 0.) - width_flx = MAX(MIN(1000.*(0.6*tanh((flt - 0.090)/0.03) + .5),1000.), 0.) - ELSE - width_flx = MAX(MIN(1000.*(0.6*tanh((flt - 0.040)/0.03) + .5),1000.), 0.) - !width_flx = MAX(MIN(1000.*(0.6*tanh((flt - 0.050)/0.03) + .5),1000.), 0.) + IF((landsea-1.5).LT.0)THEN + width_flx = MAX(MIN(1000.*(0.6*tanh((flt - 0.050)/0.03) + .5),1000.), 0.) + maxwidth = MIN(maxwidth,width_flx) ENDIF - maxwidth = MIN(maxwidth,width_flx) - ENDIF ! Convert maxwidth to number of plumes NUP2 = MIN(MAX(INT((maxwidth - MOD(maxwidth,100.))/100), 0), NUP2) @@ -5430,11 +5498,9 @@ SUBROUTINE DMP_mf( & N = C*l**d ! number density of plume n UPA(1,I) = N*l*l/(dx*dx) * dl ! fractional area of plume n ! Make updraft area (UPA) a function of the buoyancy flux -! acfac = .5*tanh((fltv - 0.05)/0.2) + .5 -! acfac = .5*tanh((fltv - 0.07)/0.09) + .5 ! acfac = .5*tanh((fltv - 0.03)/0.09) + .5 acfac = .5*tanh((fltv - 0.02)/0.09) + .5 -! acfac = .5*tanh((fltv - 0.015)/0.05) + .5 + UPA(1,I)=UPA(1,I)*acfac An2 = An2 + UPA(1,I) ! total fractional area of all plumes !print*," plume size=",l,"; area=",UPA(1,I),"; total=",An2 @@ -5459,10 +5525,10 @@ SUBROUTINE DMP_mf( & sigmaTH=csigma*thstar*(z0/pblh)**(-1./3.) wmin=MIN(sigmaW*pwmin,0.1) - wmax=MIN(sigmaW*pwmax,0.5) + wmax=MIN(sigmaW*pwmax,0.333) !recompute acfac for plume excess - acfac = .5*tanh((fltv - 0.08)/0.07) + .5 + acfac = .5*tanh((fltv - 0.03)/0.07) + .5 !SPECIFY SURFACE UPDRAFT PROPERTIES AT MODEL INTERFACE BETWEEN K = 1 & 2 DO I=1,NUP !NUP2 @@ -5516,7 +5582,8 @@ SUBROUTINE DMP_mf( & DO k=KTS+1,KTE-1 !w-dependency for entrainment a la Tian and Kuang (2016) !ENT(k,i) = 0.5/(MIN(MAX(UPW(K-1,I),0.75),1.5)*l) - ENT(k,i) = 0.35/(MIN(MAX(UPW(K-1,I),0.75),1.5)*l) + !ENT(k,i) = 0.35/(MIN(MAX(UPW(K-1,I),0.75),1.5)*l) + ENT(k,i) = 0.33/(MIN(MAX(UPW(K-1,I),0.666),2.0)*l) !Entrainment from Negggers (2015, JAMES) !ENT(k,i) = 0.02*l**-0.35 - 0.0009 !JOE - implement minimum background entrainment @@ -5526,7 +5593,7 @@ SUBROUTINE DMP_mf( & IF(ZW(k) >= MIN(pblh+1500., 3500.))THEN ENT(k,i)=ENT(k,i) + (ZW(k)-MIN(pblh+1500.,3500.))*5.0E-6 ENDIF - IF(UPW(K-1,I) > 2.0) ENT(k,i) = ENT(k,i) + EntThrottle*(UPW(K-1,I) - 2.0) + !IF(UPW(K-1,I) > 2.0) ENT(k,i) = ENT(k,i) + EntThrottle*(UPW(K-1,I) - 2.0) !SPP ENT(k,i) = ENT(k,i) * (1.0 - rstoch_col(k)) @@ -5743,12 +5810,11 @@ SUBROUTINE DMP_mf( & ! d(k)=thl(k) + dtz(k)*flt + tcd(k)*delt & ! & -dtz(k)*s_awthl(kts+1) + diss_heat(k)*delt*dheat_opt ! So, s_awthl(kts+1) must be less than flt - !GJF: check if s_aw(kts+1) /= 0 before using it; if KTOP=0, s_aw(kts+1) = 0; caught using -fpe0 with intel compiler IF (s_aw(kts+1) /= 0.) THEN - THVk = (THL(kts)*DZ(kts+1)+THL(kts+1)*DZ(kts))/(DZ(kts+1)+DZ(kts)) - flx1 = MAX(s_aw(kts+1)*(s_awthl(kts+1)/s_aw(kts+1) - THVk),0.0) + THVk = (THL(kts)*DZ(kts+1)+THL(kts+1)*DZ(kts))/(DZ(kts+1)+DZ(kts)) + flx1 = MAX(s_aw(kts+1)*(s_awthl(kts+1)/s_aw(kts+1) - THVk),0.0) ELSE - flx1 = 0.0 + flx1 = 0.0 ENDIF !flx1 = -dt/dz(kts)*s_awthl(kts+1) !flx1 = (s_awthl(kts+1)-s_awthl(kts))!/(0.5*(dz(k)+dz(k-1))) From 197a300727701dcd5e2791a62014b9b1377f0665 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Wed, 31 Jul 2019 14:54:07 -0600 Subject: [PATCH 47/89] physics/ysuvdif.meta: filled all dimension information --- physics/ysuvdif.meta | 68 ++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/physics/ysuvdif.meta b/physics/ysuvdif.meta index ca3f8810e..458ff75ae 100644 --- a/physics/ysuvdif.meta +++ b/physics/ysuvdif.meta @@ -29,7 +29,7 @@ standard_name = x_wind long_name = x component of layer wind units = m s-1 - dimensions = (XX_NotFound_XX,XX_NotFound_XX) + dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys intent = in @@ -38,7 +38,7 @@ standard_name = y_wind long_name = y component of layer wind units = m s-1 - dimensions = (XX_NotFound_XX,XX_NotFound_XX) + dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys intent = in @@ -47,7 +47,7 @@ standard_name = air_temperature long_name = layer mean air temperature units = K - dimensions = (XX_NotFound_XX,XX_NotFound_XX) + dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys intent = in @@ -56,7 +56,7 @@ standard_name = tracer_concentration long_name = model layer mean tracer concentration units = kg kg-1 - dimensions = (XX_NotFound_XX,XX_NotFound_XX,XX_NotFound_XX) + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) type = real kind = kind_phys intent = in @@ -65,7 +65,7 @@ standard_name = air_pressure long_name = mean layer pressure units = Pa - dimensions = (XX_NotFound_XX,XX_NotFound_XX) + dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys intent = in @@ -74,7 +74,7 @@ standard_name = air_pressure_at_interface long_name = air pressure at model layer interfaces units = Pa - dimensions = (XX_NotFound_XX,XX_NotFound_XX) + dimensions = (horizontal_dimension,vertical_dimension_plus_one) type = real kind = kind_phys intent = in @@ -83,7 +83,7 @@ standard_name = dimensionless_exner_function_at_model_layers long_name = Exner function at layers units = none - dimensions = (XX_NotFound_XX,XX_NotFound_XX) + dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys intent = in @@ -92,7 +92,7 @@ standard_name = tendency_of_y_wind_due_to_model_physics long_name = updated tendency of the y wind units = m s-2 - dimensions = (XX_NotFound_XX,XX_NotFound_XX) + dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys intent = inout @@ -101,7 +101,7 @@ standard_name = tendency_of_x_wind_due_to_model_physics long_name = updated tendency of the x wind units = m s-2 - dimensions = (XX_NotFound_XX,XX_NotFound_XX) + dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys intent = inout @@ -110,7 +110,7 @@ standard_name = tendency_of_air_temperature_due_to_model_physics long_name = updated tendency of the temperature units = K s-1 - dimensions = (XX_NotFound_XX,XX_NotFound_XX) + dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys intent = inout @@ -119,7 +119,7 @@ standard_name = tendency_of_tracers_due_to_model_physics long_name = updated tendency of the tracers due to model physics units = kg kg-1 s-1 - dimensions = (XX_NotFound_XX,XX_NotFound_XX,XX_NotFound_XX) + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) type = real kind = kind_phys intent = inout @@ -128,7 +128,7 @@ standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step long_name = total sky shortwave heating rate units = K s-1 - dimensions = (XX_NotFound_XX,XX_NotFound_XX) + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys intent = in @@ -137,7 +137,7 @@ standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step long_name = total sky longwave heating rate units = K s-1 - dimensions = (XX_NotFound_XX,XX_NotFound_XX) + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys intent = in @@ -146,7 +146,7 @@ standard_name = zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes long_name = zenith angle temporal adjustment factor for shortwave units = none - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = in @@ -187,7 +187,7 @@ standard_name = geopotential_at_interface long_name = geopotential at model layer interfaces units = m2 s-2 - dimensions = (XX_NotFound_XX,XX_NotFound_XX) + dimensions = (horizontal_dimension,vertical_dimension_plus_one) type = real kind = kind_phys intent = in @@ -196,7 +196,7 @@ standard_name = geopotential long_name = geopotential at model layer centers units = m2 s-2 - dimensions = (XX_NotFound_XX,XX_NotFound_XX) + dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys intent = in @@ -205,7 +205,7 @@ standard_name = surface_air_pressure long_name = surface pressure units = Pa - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = in @@ -214,7 +214,7 @@ standard_name = surface_roughness_length long_name = surface roughness length in cm units = cm - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = in @@ -223,7 +223,7 @@ standard_name = surface_wind_stress long_name = surface wind stress units = m2 s-2 - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = in @@ -232,7 +232,7 @@ standard_name = atmosphere_boundary_layer_thickness long_name = PBL thickness units = m - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = out @@ -241,7 +241,7 @@ standard_name = Monin_Obukhov_similarity_function_for_momentum long_name = Monin-Obukhov similarity function for momentum units = none - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = in @@ -250,7 +250,7 @@ standard_name = Monin_Obukhov_similarity_function_for_heat long_name = Monin-Obukhov similarity function for heat units = none - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = in @@ -259,7 +259,7 @@ standard_name = sea_land_ice_mask long_name = landmask: sea/land/ice=0/1/2 units = flag - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = integer intent = in optional = F @@ -267,7 +267,7 @@ standard_name = kinematic_surface_upward_sensible_heat_flux long_name = kinematic surface upward sensible heat flux units = K m s-1 - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = in @@ -276,7 +276,7 @@ standard_name = kinematic_surface_upward_latent_heat_flux long_name = kinematic surface upward latent heat flux units = kg kg-1 m s-1 - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = in @@ -285,7 +285,7 @@ standard_name = wind_speed_at_lowest_model_layer long_name = wind speed at lowest model level units = m s-1 - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = in @@ -294,7 +294,7 @@ standard_name = bulk_richardson_number_at_lowest_model_level long_name = bulk Richardson number at the surface units = none - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = in @@ -366,7 +366,7 @@ standard_name = instantaneous_surface_x_momentum_flux long_name = x momentum flux units = Pa - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = out @@ -375,7 +375,7 @@ standard_name = instantaneous_surface_y_momentum_flux long_name = y momentum flux units = Pa - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = out @@ -384,7 +384,7 @@ standard_name = instantaneous_surface_upward_sensible_heat_flux long_name = surface upward sensible heat flux units = W m-2 - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = out @@ -393,7 +393,7 @@ standard_name = instantaneous_surface_upward_latent_heat_flux long_name = surface upward latent heat flux units = W m-2 - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = out @@ -411,7 +411,7 @@ standard_name = vertical_index_at_top_of_atmosphere_boundary_layer long_name = PBL top model level index units = index - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = integer intent = out optional = F @@ -419,7 +419,7 @@ standard_name = x_wind_at_10m long_name = x component of wind at 10 m units = m s-1 - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = in @@ -428,7 +428,7 @@ standard_name = y_wind_at_10m long_name = y component of wind at 10 m units = m s-1 - dimensions = (XX_NotFound_XX) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = in From ea6300f17e8c9b8e3e890d0e26f4f03372a15c75 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Thu, 8 Aug 2019 15:59:56 -0600 Subject: [PATCH 48/89] physics/samfdeepcnv.f: bugfix, line continuation character at wrong position for fixed format file --- physics/samfdeepcnv.f | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/samfdeepcnv.f b/physics/samfdeepcnv.f index b60734a0f..6838f3048 100644 --- a/physics/samfdeepcnv.f +++ b/physics/samfdeepcnv.f @@ -172,7 +172,7 @@ subroutine samfdeepcnv_run (im,ix,km,cliq,cp,cvap, & ! GJF* These variables are conditionally allocated depending on whether the ! Morrison-Gettelman microphysics is used, so they must be declared ! using assumed shape. - real(kind=kind_phys), dimension(:,:), intent(inout) :: & + real(kind=kind_phys), dimension(:,:), intent(inout) :: & & qlcn, qicn, w_upi, cnv_mfd, cnv_dqldt, clcn & &, cnv_fice, cnv_ndrop, cnv_nice, cf_upi ! *GJF From b0188e4f6f0d925d676468c5c803357254b59595 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Fri, 9 Aug 2019 10:16:47 -0600 Subject: [PATCH 49/89] physics/GFS_debug.F90: add new module/scheme GFS_checkland --- physics/GFS_debug.F90 | 136 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 index c0bfef12b..7eaf81434 100644 --- a/physics/GFS_debug.F90 +++ b/physics/GFS_debug.F90 @@ -933,3 +933,139 @@ subroutine GFS_abort_run (Model, blkno, errmsg, errflg) end subroutine GFS_abort_run end module GFS_abort + + module GFS_checkland + + private + + public GFS_checkland_init, GFS_checkland_run, GFS_checkland_finalize + + contains + + subroutine GFS_checkland_init () + end subroutine GFS_checkland_init + + subroutine GFS_checkland_finalize () + end subroutine GFS_checkland_finalize + +!> \section arg_table_GFS_checkland_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |--------------|---------------------------------------|----------------------------------------------------------|-------|------|-----------|-----------|--------|----------| +!! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | +!! | master | mpi_root | master MPI-rank | index | 0 | integer | | in | F | +!! | blkno | ccpp_block_number | number of block for explicit data blocking in CCPP | index | 0 | integer | | in | F | +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | kdt | index_of_time_step | current number of time steps | index | 0 | integer | | in | F | +!! | iter | ccpp_loop_counter | loop counter for subcycling loops in CCPP | index | 0 | integer | | in | F | +!! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | +!! | flag_guess | flag_for_guess_run | flag for guess run | flag | 1 | logical | | in | F | +!! | flag_init | flag_for_first_time_step | flag signaling first time step for time integration loop | flag | 0 | logical | | in | F | +!! | flag_restart | flag_for_restart | flag for restart (warmstart) or coldstart | flag | 0 | logical | | in | F | +!! | frac_grid | flag_for_fractional_grid | flag for fractional grid | flag | 0 | logical | | in | F | +!! | isot | soil_type_dataset_choice | soil type dataset choice | index | 0 | integer | | in | F | +!! | ivegsrc | vegetation_type_dataset_choice | land use dataset choice | index | 0 | integer | | in | F | +!! | stype | soil_type_classification_real | soil type for lsm | index | 1 | real | kind_phys | in | F | +!! | vtype | vegetation_type_classification_real | vegetation type for lsm | index | 1 | real | kind_phys | in | F | +!! | slope | surface_slope_classification_real | sfc slope type for lsm | index | 1 | real | kind_phys | in | F | +!! | soiltyp | soil_type_classification | soil type at each grid cell | index | 1 | integer | | in | F | +!! | vegtype | vegetation_type_classification | vegetation type at each grid cell | index | 1 | integer | | in | F | +!! | slopetyp | surface_slope_classification | surface slope type at each grid cell | index | 1 | integer | | in | F | +!! | dry | flag_nonzero_land_surface_fraction | flag indicating some land surface area fraction | flag | 1 | logical | | in | F | +!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating some sea ice surface area fraction | flag | 1 | logical | | in | F | +!! | wet | flag_nonzero_wet_surface_fraction | flag indicating some ocean or lake surface area fraction | flag | 1 | logical | | in | F | +!! | lake | flag_nonzero_lake_surface_fraction | flag indicating some lake surface area fraction | flag | 1 | logical | | in | F | +!! | ocean | flag_nonzero_ocean_surface_fraction | flag indicating some ocean surface area fraction | flag | 1 | logical | | in | F | +!! | oceanfrac | sea_area_fraction | fraction of horizontal grid area occupied by ocean | frac | 1 | real | kind_phys | in | F | +!! | landfrac | land_area_fraction | fraction of horizontal grid area occupied by land | frac | 1 | real | kind_phys | in | F | +!! | lakefrac | lake_area_fraction | fraction of horizontal grid area occupied by lake | frac | 1 | real | kind_phys | in | F | +!! | slmsk | sea_land_ice_mask_real | landmask: sea/land/ice=0/1/2 | flag | 1 | real | kind_phys | in | F | +!! | islmsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine GFS_checkland_run (me, master, blkno, im, kdt, iter, flag_iter, flag_guess, & + flag_init, flag_restart, frac_grid, isot, ivegsrc, stype, vtype, slope, & + soiltyp, vegtype, slopetyp, dry, icy, wet, lake, ocean, & + oceanfrac, landfrac, lakefrac, slmsk, islmsk, errmsg, errflg ) + + use machine, only: kind_phys + + implicit none + + ! Interface variables + integer, intent(in ) :: me + integer, intent(in ) :: master + integer, intent(in ) :: blkno + integer, intent(in ) :: im + integer, intent(in ) :: kdt + integer, intent(in ) :: iter + logical, intent(in ) :: flag_iter(im) + logical, intent(in ) :: flag_guess(im) + logical, intent(in ) :: flag_init + logical, intent(in ) :: flag_restart + logical, intent(in ) :: frac_grid + integer, intent(in ) :: isot + integer, intent(in ) :: ivegsrc + real(kind_phys), intent(in ) :: stype(im) + real(kind_phys), intent(in ) :: vtype(im) + real(kind_phys), intent(in ) :: slope(im) + integer, intent(in ) :: soiltyp(im) + integer, intent(in ) :: vegtype(im) + integer, intent(in ) :: slopetyp(im) + logical, intent(in ) :: dry(im) + logical, intent(in ) :: icy(im) + logical, intent(in ) :: wet(im) + logical, intent(in ) :: lake(im) + logical, intent(in ) :: ocean(im) + real(kind_phys), intent(in ) :: oceanfrac(im) + real(kind_phys), intent(in ) :: landfrac(im) + real(kind_phys), intent(in ) :: lakefrac(im) + real(kind_phys), intent(in ) :: slmsk(im) + integer, intent(in ) :: islmsk(im) + character(len=*), intent( out) :: errmsg + integer, intent( out) :: errflg + + ! Local variables + integer :: i + + errflg = 0 + errmsg = '' + + write(0,'(a,i5)') 'YYY: me :', me + write(0,'(a,i5)') 'YYY: master :', master + write(0,'(a,i5)') 'YYY: blkno :', blkno + write(0,'(a,i5)') 'YYY: im :', im + write(0,'(a,i5)') 'YYY: kdt :', kdt + write(0,'(a,i5)') 'YYY: iter :', iter + write(0,'(a,1x,l)') 'YYY: flag_init :', flag_init + write(0,'(a,1x,l)') 'YYY: flag_restart :', flag_restart + write(0,'(a,1x,l)') 'YYY: frac_grid :', frac_grid + write(0,'(a,i5)') 'YYY: isot :', isot + write(0,'(a,i5)') 'YYY: ivegsrc :', ivegsrc + + do i=1,im + !if (vegtype(i)==15) then + write(0,'(a,2i5,1x,1x,l)') 'YYY: i, blk, flag_iter(i) :', i, blkno, flag_iter(i) + write(0,'(a,2i5,1x,1x,l)') 'YYY: i, blk, flag_guess(i) :', i, blkno, flag_guess(i) + write(0,'(a,2i5,1x,e16.7)')'YYY: i, blk, stype(i) :', i, blkno, stype(i) + write(0,'(a,2i5,1x,e16.7)')'YYY: i, blk, vtype(i) :', i, blkno, vtype(i) + write(0,'(a,2i5,1x,e16.7)')'YYY: i, blk, slope(i) :', i, blkno, slope(i) + write(0,'(a,2i5,1x,i5)') 'YYY: i, blk, soiltyp(i) :', i, blkno, soiltyp(i) + write(0,'(a,2i5,1x,i5)') 'YYY: i, blk, vegtype(i) :', i, blkno, vegtype(i) + write(0,'(a,2i5,1x,i5)') 'YYY: i, blk, slopetyp(i) :', i, blkno, slopetyp(i) + write(0,'(a,2i5,1x,1x,l)') 'YYY: i, blk, dry(i) :', i, blkno, dry(i) + write(0,'(a,2i5,1x,1x,l)') 'YYY: i, blk, icy(i) :', i, blkno, icy(i) + write(0,'(a,2i5,1x,1x,l)') 'YYY: i, blk, wet(i) :', i, blkno, wet(i) + write(0,'(a,2i5,1x,1x,l)') 'YYY: i, blk, lake(i) :', i, blkno, lake(i) + write(0,'(a,2i5,1x,1x,l)') 'YYY: i, blk, ocean(i) :', i, blkno, ocean(i) + write(0,'(a,2i5,1x,e16.7)')'YYY: i, blk, oceanfrac(i) :', i, blkno, oceanfrac(i) + write(0,'(a,2i5,1x,e16.7)')'YYY: i, blk, landfrac(i) :', i, blkno, landfrac(i) + write(0,'(a,2i5,1x,e16.7)')'YYY: i, blk, lakefrac(i) :', i, blkno, lakefrac(i) + write(0,'(a,2i5,1x,e16.7)')'YYY: i, blk, slmsk(i) :', i, blkno, slmsk(i) + write(0,'(a,2i5,1x,i5)') 'YYY: i, blk, islmsk(i) :', i, blkno, islmsk(i) + !end if + end do + + end subroutine GFS_checkland_run + + end module GFS_checkland From 00d4ddc61913e19fba734aa588bbcc8c6c762b4a Mon Sep 17 00:00:00 2001 From: climbfuji Date: Fri, 9 Aug 2019 10:27:39 -0600 Subject: [PATCH 50/89] physics/module_mp_thompson.F90: reduce debug/info output from scheme --- physics/module_mp_thompson.F90 | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index f1b462b1e..1a8529231 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -873,8 +873,8 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & enddo enddo - if (mpirank==mpiroot) WRITE (*,*)'CREATING MICROPHYSICS LOOKUP TABLES ... ' - if (mpirank==mpiroot) WRITE (*,'(a, f5.2, a, f5.2, a, f5.2, a, f5.2)') & + if (mpirank==mpiroot) write (*,*)'creating microphysics lookup tables ... ' + if (mpirank==mpiroot) write (*,'(a, f5.2, a, f5.2, a, f5.2, a, f5.2)') & ' using: mu_c=',mu_c,' mu_i=',mu_i,' mu_r=',mu_r,' mu_g=',mu_g !> - Call table_ccnact() to read a static file containing CCN activation of aerosols. The @@ -883,18 +883,18 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & ! This computation is cheap compared to the others below, and ! doing it always ensures that the correct data is in the SIONlib ! file containing the precomputed tables *DH - WRITE (*,*) ' calling table_ccnAct routine' + if (mpirank==mpiroot) write(0,*) ' calling table_ccnAct routine' call table_ccnAct(errmsg,errflg) if (.not. errflg==0) return !> - Call table_efrw() and table_efsw() to creat collision efficiency table !! between rain/snow and cloud water - WRITE (*,*)' creating qc collision eff tables' + if (mpirank==mpiroot) write(0,*) ' creating qc collision eff tables' call table_Efrw call table_Efsw !> - Call table_dropevap() to creat rain drop evaporation table - WRITE(*,*) ' creating rain evap table' + if (mpirank==mpiroot) write(0,*) ' creating rain evap table' call table_dropEvap call cpu_time(etime) @@ -930,7 +930,7 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & !$OMP section !> - Call qr_acr_qg() to create rain collecting graupel & graupel collecting rain table - WRITE (*,*) ' creating rain collecting graupel table' + if (mpirank==mpiroot) write(0,*) ' creating rain collecting graupel table' call cpu_time(stime) call qr_acr_qg call cpu_time(etime) @@ -938,7 +938,7 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & !$OMP section !> - Call qr_acr_qs() to create rain collecting snow & snow collecting rain table - WRITE (*,*) ' creating rain collecting snow table' + if (mpirank==mpiroot) write (*,*) ' creating rain collecting snow table' call cpu_time(stime) call qr_acr_qs call cpu_time(etime) @@ -949,14 +949,14 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & !$OMP end parallel !> - Call freezeh2o() to create cloud water and rain freezing (Bigg, 1953) table - WRITE (*,*) ' creating freezing of water drops table' + if (mpirank==mpiroot) write(0,*) ' creating freezing of water drops table' call cpu_time(stime) call freezeH2O(threads) call cpu_time(etime) if (mpirank==mpiroot) print '("Computing freezing of water drops table took ",f10.3," seconds.")', etime-stime !> - Call qi_aut_qs() to create conversion of some ice mass into snow category - WRITE (*,*) ' creating ice converting to snow table' + if (mpirank==mpiroot) write(0,*) ' creating ice converting to snow table' call cpu_time(stime) call qi_aut_qs call cpu_time(etime) @@ -988,7 +988,7 @@ SUBROUTINE thompson_init(nwfa2d, nifa2d, nwfa, nifa, & endif if_not_iiwarm - WRITE (*,*) ' ... DONE microphysical lookup tables' + if (mpirank==mpiroot) write(0,*) ' ... DONE microphysical lookup tables' endif if_micro_init @@ -3733,7 +3733,7 @@ subroutine qr_acr_qg call MPI_BARRIER(mpi_communicator,ierr) #endif IF ( lexist ) THEN - write(0,*) "ThompMP: read qr_acr_qg.dat instead of computing" + !write(0,*) "ThompMP: read qr_acr_qg.dat instead of computing" OPEN(63,file="qr_acr_qg.dat",form="unformatted",err=1234) !sms$serial begin READ(63,err=1234) tcg_racg @@ -3909,7 +3909,7 @@ subroutine qr_acr_qs call MPI_BARRIER(mpi_communicator,ierr) #endif IF ( lexist ) THEN - write(0,*) "ThompMP: read qr_acr_qs.dat instead of computing" + !write(0,*) "ThompMP: read qr_acr_qs.dat instead of computing" OPEN(63,file="qr_acr_qs.dat",form="unformatted",err=1234) !sms$serial begin READ(63,err=1234)tcs_racs1 @@ -4170,7 +4170,7 @@ subroutine freezeH2O(threads) call MPI_BARRIER(mpi_communicator,ierr) #endif IF ( lexist ) THEN - write(0,*) "ThompMP: read freezeH2O.dat instead of computing" + !write(0,*) "ThompMP: read freezeH2O.dat instead of computing" OPEN(63,file="freezeH2O.dat",form="unformatted",err=1234) !sms$serial begin READ(63,err=1234)tpi_qrfz From 1180673d69ec3489228ff1b2e49b17a386f22c2f Mon Sep 17 00:00:00 2001 From: climbfuji Date: Fri, 9 Aug 2019 16:22:54 -0600 Subject: [PATCH 51/89] physics/module_sf_ruclsm.F90: run ruclsminit only over land points --- physics/module_sf_ruclsm.F90 | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 9ffc8f49b..ea5800736 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -7020,7 +7020,7 @@ END SUBROUTINE SOILVEGIN !> This subroutine computes liquid and forezen soil moisture from the !! total soil moisture, and also computes soil moisture availability in !! the top soil layer. - SUBROUTINE RUCLSMINIT( debug_print, & + SUBROUTINE RUCLSMINIT( debug_print, landmask, & nzs, isltyp, ivgtyp, xice, mavail, & sh2o, smfr3d, tslb, smois, & ims,ime, jms,jme, kms,kme, & @@ -7044,6 +7044,9 @@ SUBROUTINE RUCLSMINIT( debug_print, & INTENT(IN) :: TSLB, & SMOIS + REAL, DIMENSION( ims:ime, jms:jme ) , & + INTENT(IN) :: LANDMASK + INTEGER, DIMENSION( ims:ime, jms:jme ) , & INTENT(INOUT) :: ISLTYP,IVGTYP @@ -7072,6 +7075,9 @@ SUBROUTINE RUCLSMINIT( debug_print, & errflag = 0 DO j = jts,jtf DO i = its,itf + ! land-only version + IF ( LANDMASK( i,j ) .NE. 1 ) CYCLE + ! IF ( ISLTYP( i,j ) .LT. 0 ) THEN errflag = 1 print *, & @@ -7086,18 +7092,21 @@ SUBROUTINE RUCLSMINIT( debug_print, & ENDIF DO J=jts,jtf - DO I=its,itf + DO I=its,itf + + ! land-only version + IF ( LANDMASK( i,j ) .NE. 1 ) CYCLE !--- Computation of volumetric content of ice in soil !--- and initialize MAVAIL - if(ISLTYP(I,J) > 0) then - DQM = MAXSMC (ISLTYP(I,J)) - & - DRYSMC (ISLTYP(I,J)) - REF = REFSMC (ISLTYP(I,J)) - PSIS = - SATPSI (ISLTYP(I,J)) - QMIN = DRYSMC (ISLTYP(I,J)) - BCLH = BB (ISLTYP(I,J)) - endif + if(ISLTYP(I,J) > 0) then + DQM = MAXSMC (ISLTYP(I,J)) - & + DRYSMC (ISLTYP(I,J)) + REF = REFSMC (ISLTYP(I,J)) + PSIS = - SATPSI (ISLTYP(I,J)) + QMIN = DRYSMC (ISLTYP(I,J)) + BCLH = BB (ISLTYP(I,J)) + endif ! in Zobler classification isltyp=0 for water. Statsgo classification From 1c94e238502d6330b7ed5628aeeafeafe0dc7f30 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Fri, 9 Aug 2019 16:26:46 -0600 Subject: [PATCH 52/89] physics/sfc_drv_ruc.F90: convert print to write statements, add guard to prevent using unconfigured ivegsrc, add check for inconsistent landmask and landuse classification, correctly initialize RUC subsurface data for non-land points for both Noah and RUC input data --- physics/sfc_drv_ruc.F90 | 422 +++++++++++++++++++++------------------- 1 file changed, 218 insertions(+), 204 deletions(-) diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index 5e4f37d34..bb8c46d9e 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -146,6 +146,7 @@ end subroutine lsm_ruc_finalize !! |----------------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| !! | delt | time_step_for_dynamics | physics time step | s | 0 | real | kind_phys | in | F | !! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | +!! | master | mpi_root | master MPI-rank | index | 0 | integer | | in | F | !! | kdt | index_of_time_step | current number of time steps | index | 0 | integer | | in | F | !! | iter | ccpp_loop_counter | loop counter for subcycling loops in CCPP | index | 0 | integer | | in | F | !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | @@ -254,7 +255,7 @@ end subroutine lsm_ruc_finalize !>\section gen_lsmruc GSD RUC LSM General Algorithm ! DH* TODO - make order of arguments the same as in the metadata table subroutine lsm_ruc_run & ! inputs - & ( iter, me, kdt, im, nlev, lsoil_ruc, lsoil, zs, & + & ( iter, me, master, kdt, im, nlev, lsoil_ruc, lsoil, zs, & & u1, v1, t1, q1, qc, soiltyp, vegtype, sigmaf, & & sfcemis, dlwflx, dswsfc, snet, delt, tg3, cm, ch, & & prsl1, zf, ddvel, shdmin, shdmax, alvwf, alnwf, & @@ -282,7 +283,7 @@ subroutine lsm_ruc_run & ! inputs real(kind=kind_phys), parameter :: stbolt = 5.670400e-8 ! --- input: - integer, intent(in) :: me + integer, intent(in) :: me, master integer, intent(in) :: im, nlev, iter, lsoil_ruc, lsoil, kdt, isot, ivegsrc integer, intent(in) :: lsm_ruc, lsm integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson @@ -407,21 +408,21 @@ subroutine lsm_ruc_run & ! inputs allocate(landusef(im,nlcat,1)) if(debug_print) then - print *,'RUC LSM run' - print *,'noah soil temp',ipr,stc(ipr,:) - print *,'noah soil mois',ipr,smc(ipr,:) - print *,'soiltyp=',ipr,soiltyp(ipr) - print *,'vegtype=',ipr,vegtype(ipr) - print *,'kdt, iter =',kdt,iter - print *,'flag_init =',flag_init - print *,'flag_restart =',flag_restart + write (0,*)'RUC LSM run' + write (0,*)'noah soil temp',ipr,stc(ipr,:) + write (0,*)'noah soil mois',ipr,smc(ipr,:) + write (0,*)'soiltyp=',ipr,soiltyp(ipr) + write (0,*)'vegtype=',ipr,vegtype(ipr) + write (0,*)'kdt, iter =',kdt,iter + write (0,*)'flag_init =',flag_init + write (0,*)'flag_restart =',flag_restart endif !> - Call rucinit() at the first time step and the first interation !! for RUC initialization,then overwrite Noah soil fields !! with initialized RUC soil fields for output. if(flag_init .and. iter==1) then - !print *,'RUC LSM initialization, kdt=', kdt + if (debug_print) write (0,'(a,i0,a,l)') 'RUC LSM initialization, kdt = ', kdt, ', flag_restart = ', flag_restart call rucinit (flag_restart, im, lsoil_ruc, lsoil, nlev, & ! in isot, soiltyp, vegtype, fice, & ! in @@ -430,7 +431,7 @@ subroutine lsm_ruc_run & ! inputs smcref2, smcwlt2, & ! inout lsm_ruc, lsm, & ! in zs, sh2o, smfrkeep, tslb, smois, wetness, & ! out - errmsg, errflg) + me, master, errmsg, errflg) endif ! flag_init=.true.,iter=1 !-- end of initialization @@ -468,6 +469,10 @@ subroutine lsm_ruc_run & ! inputs llanduse = 'MODI-RUC' ! IGBP iswater = 17 isice = 15 + else + write(errmsg, '(a,i0)') 'Logic error in sfc_drv_ruc_run: iswater/isice not configured for ivegsrc=', ivegsrc + errflg = 1 + return endif fractional_seaice = 1 @@ -496,12 +501,18 @@ subroutine lsm_ruc_run & ! inputs !> - Set flag for land and ice points. !- 10may19 - ice points are turned off. flag(i) = land(i) + if (land(i) .and. (vegtype(i)==iswater .or. vegtype(i)==isice)) then + write(errmsg,'(a,i0,a,i0)') 'Logic error in sfc_drv_ruc_run: for i=', i, & + ', land(i) is true but vegtype(i) is water or ice: ', vegtype(i) + errflg = 1 + return + end if enddo do i = 1, im ! i - horizontal loop if (flag(i) .and. flag_guess(i)) then !> - Save land-related prognostic fields for guess run. - !if(me==0 .and. i==ipr) print *,'before call to RUC guess run', i + !if(me==0 .and. i==ipr) write (0,*)'before call to RUC guess run', i weasd_old(i) = weasd(i) snwdph_old(i) = snwdph(i) tskin_old(i) = tskin(i) @@ -532,7 +543,7 @@ subroutine lsm_ruc_run & ! inputs do j = 1, 1 do i = 1, im ! i - horizontal loop if (flag_iter(i) .and. flag(i)) then - !if(me==0 .and. i==ipr) print *,'iter run', iter, i, flag_iter(i),flag_guess(i) + !if(me==0 .and. i==ipr) write (0,*)'iter run', iter, i, flag_iter(i),flag_guess(i) evap (i) = 0.0 hflx (i) = 0.0 gflux(i) = 0.0 @@ -696,7 +707,7 @@ subroutine lsm_ruc_run & ! inputs xland(i,j) = 1. xice(i,j) = 0. else - print *,'MODIS landuse is not available' + write (0,*)'MODIS landuse is not available' endif ! --- units % @@ -796,99 +807,99 @@ subroutine lsm_ruc_run & ! inputs if(debug_print) then !if(me==0 .and. i==ipr) then - print *,'before RUC smsoil = ',smsoil(i,:,j), i,j - print *,'stsoil = ',stsoil(i,:,j), i,j - print *,'soilt = ',soilt(i,j), i,j - print *,'wet = ',wet(i,j), i,j - print *,'soilt1 = ',soilt1(i,j), i,j - print *,'delt =',delt - print *,'kdt =',kdt - print *,'flag_init =',flag_init - print *,'flag_restart =',flag_restart - print *,'nsoil =',nsoil - print *,'frpcpn =',frpcpn - print *,'zs =',zs - print *,'graupelncv(i,j) =',i,j,graupelncv(i,j) - print *,'snowncv(i,j) =',i,j,snowncv(i,j) - print *,'rainncv(i,j) =',i,j,rainncv(i,j) - print *,'raincv(i,j) =',i,j,raincv(i,j) - print *,'prcp(i,j) =',i,j,prcp(i,j) - print *,'sneqv(i,j) =',i,j,sneqv(i,j) - print *,'snowh(i,j) =',i,j,snowh(i,j) - print *,'sncovr(i,j) =',i,j,sncovr(i,j) - print *,'ffrozp(i,j) =',i,j,ffrozp(i,j) - print *,'conflx2(i,1,j) =',i,j,conflx2(i,1,j) - print *,'sfcprs(i,1,j) =',i,j,sfcprs(i,1,j) - print *,'sfctmp(i,1,j) =',i,j,sfctmp(i,1,j) - print *,'q2(i,1,j) =',i,j,q2(i,1,j) - print *,'qcatm(i,1,j) =',i,j,qcatm(i,1,j) - print *,'rho2(i,1,j) =',i,j,rho2(i,1,j) - print *,'lwdn(i,j) =',i,j,lwdn(i,j) - print *,'solnet(i,j) =',i,j,solnet(i,j) - print *,'sfcems(i,j) =',i,j,sfcems(i,j) - print *,'chklowq(i,j) =',i,j,chklowq(i,j) - print *,'chs(i,j) =',i,j,chs(i,j) - print *,'flqc(i,j) =',i,j,flqc(i,j) - print *,'flhc(i,j) =',i,j,flhc(i,j) - print *,'wet(i,j) =',i,j,wet(i,j) - print *,'cmc(i,j) =',i,j,cmc(i,j) - print *,'shdfac(i,j) =',i,j,shdfac(i,j) - print *,'alb(i,j) =',i,j,alb(i,j) - print *,'znt(i,j) =',i,j,znt(i,j) - print *,'z0(i,j) =',i,j,z0(i,j) - print *,'snoalb1d(i,j) =',i,j,snoalb1d(i,j) - print *,'alb(i,j) =',i,j,alb(i,j) - print *,'landusef(i,:,j) =',i,j,landusef(i,:,j) - print *,'soilctop(i,:,j) =',i,j,soilctop(i,:,j) - print *,'nlcat=',nlcat - print *,'nscat=',nscat - print *,'qsfc(i,j) =',i,j,qsfc(i,j) - print *,'qvg(i,j) =',i,j,qvg(i,j) - print *,'qsg(i,j) =',i,j,qsg(i,j) - print *,'qcg(i,j) =',i,j,qcg(i,j) - print *,'dew(i,j) =',i,j,dew(i,j) - print *,'soilt(i,j) =',i,j,soilt(i,j) - print *,'tskin(i) =',i,j,tskin(i) - print *,'soilt1(i,j) =',i,j,soilt1(i,j) - print *,'tsnav(i,j) =',i,j,tsnav(i,j) - print *,'tbot(i,j) =',i,j,tbot(i,j) - print *,'vtype(i,j) =',i,j,vtype(i,j) - print *,'stype(i,j) =',i,j,stype(i,j) - print *,'xland(i,j) =',i,j,xland(i,j) - print *,'xice(i,j) =',i,j,xice(i,j) - print *,'iswater=',iswater - print *,'isice=',isice - print *,'xice_threshold=',xice_threshold - print *,'con_cp=',con_cp - print *,'con_rv=',con_rv - print *,'con_rd=',con_rd - print *,'con_g=',con_g - print *,'con_pi=',con_pi - print *,'con_hvap=',con_hvap - print *,'stbolt=',stbolt - print *,'smsoil(i,:,j)=',i,j,smsoil(i,:,j) - print *,'slsoil(i,:,j)=',i,j,slsoil(i,:,j) - print *,'stsoil(i,:,j)=',i,j,stsoil(i,:,j) - print *,'smfrsoil(i,:,j)=',i,j,smfrsoil(i,:,j) - print *,'keepfrsoil(i,:,j)=',i,j,keepfrsoil(i,:,j) - print *,'soilm(i,j) =',i,j,soilm(i,j) - print *,'smmax(i,j) =',i,j,smmax(i,j) - print *,'hfx(i,j) =',i,j,hfx(i,j) - print *,'qfx(i,j) =',i,j,qfx(i,j) - print *,'lh(i,j) =',i,j,lh(i,j) - print *,'infiltr(i,j) =',i,j,infiltr(i,j) - print *,'runoff1(i,j) =',i,j,runoff1(i,j) - print *,'runoff2(i,j) =',i,j,runoff2(i,j) - print *,'acrunoff(i,j) =',i,j,acrunoff(i,j) - print *,'sfcexc(i,j) =',i,j,sfcexc(i,j) - print *,'acceta(i,j) =',i,j,acceta(i,j) - print *,'ssoil(i,j) =',i,j,ssoil(i,j) - print *,'snfallac(i,j) =',i,j,snfallac(i,j) - print *,'acsn(i,j) =',i,j,acsn(i,j) - print *,'snomlt(i,j) =',i,j,snomlt(i,j) - print *,'shdmin1d(i,j) =',i,j,shdmin1d(i,j) - print *,'shdmax1d(i,j) =',i,j,shdmax1d(i,j) - print *,'rdlai2d =',rdlai2d + write (0,*)'before RUC smsoil = ',smsoil(i,:,j), i,j + write (0,*)'stsoil = ',stsoil(i,:,j), i,j + write (0,*)'soilt = ',soilt(i,j), i,j + write (0,*)'wet = ',wet(i,j), i,j + write (0,*)'soilt1 = ',soilt1(i,j), i,j + write (0,*)'delt =',delt + write (0,*)'kdt =',kdt + write (0,*)'flag_init =',flag_init + write (0,*)'flag_restart =',flag_restart + write (0,*)'nsoil =',nsoil + write (0,*)'frpcpn =',frpcpn + write (0,*)'zs =',zs + write (0,*)'graupelncv(i,j) =',i,j,graupelncv(i,j) + write (0,*)'snowncv(i,j) =',i,j,snowncv(i,j) + write (0,*)'rainncv(i,j) =',i,j,rainncv(i,j) + write (0,*)'raincv(i,j) =',i,j,raincv(i,j) + write (0,*)'prcp(i,j) =',i,j,prcp(i,j) + write (0,*)'sneqv(i,j) =',i,j,sneqv(i,j) + write (0,*)'snowh(i,j) =',i,j,snowh(i,j) + write (0,*)'sncovr(i,j) =',i,j,sncovr(i,j) + write (0,*)'ffrozp(i,j) =',i,j,ffrozp(i,j) + write (0,*)'conflx2(i,1,j) =',i,j,conflx2(i,1,j) + write (0,*)'sfcprs(i,1,j) =',i,j,sfcprs(i,1,j) + write (0,*)'sfctmp(i,1,j) =',i,j,sfctmp(i,1,j) + write (0,*)'q2(i,1,j) =',i,j,q2(i,1,j) + write (0,*)'qcatm(i,1,j) =',i,j,qcatm(i,1,j) + write (0,*)'rho2(i,1,j) =',i,j,rho2(i,1,j) + write (0,*)'lwdn(i,j) =',i,j,lwdn(i,j) + write (0,*)'solnet(i,j) =',i,j,solnet(i,j) + write (0,*)'sfcems(i,j) =',i,j,sfcems(i,j) + write (0,*)'chklowq(i,j) =',i,j,chklowq(i,j) + write (0,*)'chs(i,j) =',i,j,chs(i,j) + write (0,*)'flqc(i,j) =',i,j,flqc(i,j) + write (0,*)'flhc(i,j) =',i,j,flhc(i,j) + write (0,*)'wet(i,j) =',i,j,wet(i,j) + write (0,*)'cmc(i,j) =',i,j,cmc(i,j) + write (0,*)'shdfac(i,j) =',i,j,shdfac(i,j) + write (0,*)'alb(i,j) =',i,j,alb(i,j) + write (0,*)'znt(i,j) =',i,j,znt(i,j) + write (0,*)'z0(i,j) =',i,j,z0(i,j) + write (0,*)'snoalb1d(i,j) =',i,j,snoalb1d(i,j) + write (0,*)'alb(i,j) =',i,j,alb(i,j) + write (0,*)'landusef(i,:,j) =',i,j,landusef(i,:,j) + write (0,*)'soilctop(i,:,j) =',i,j,soilctop(i,:,j) + write (0,*)'nlcat=',nlcat + write (0,*)'nscat=',nscat + write (0,*)'qsfc(i,j) =',i,j,qsfc(i,j) + write (0,*)'qvg(i,j) =',i,j,qvg(i,j) + write (0,*)'qsg(i,j) =',i,j,qsg(i,j) + write (0,*)'qcg(i,j) =',i,j,qcg(i,j) + write (0,*)'dew(i,j) =',i,j,dew(i,j) + write (0,*)'soilt(i,j) =',i,j,soilt(i,j) + write (0,*)'tskin(i) =',i,j,tskin(i) + write (0,*)'soilt1(i,j) =',i,j,soilt1(i,j) + write (0,*)'tsnav(i,j) =',i,j,tsnav(i,j) + write (0,*)'tbot(i,j) =',i,j,tbot(i,j) + write (0,*)'vtype(i,j) =',i,j,vtype(i,j) + write (0,*)'stype(i,j) =',i,j,stype(i,j) + write (0,*)'xland(i,j) =',i,j,xland(i,j) + write (0,*)'xice(i,j) =',i,j,xice(i,j) + write (0,*)'iswater=',iswater + write (0,*)'isice=',isice + write (0,*)'xice_threshold=',xice_threshold + write (0,*)'con_cp=',con_cp + write (0,*)'con_rv=',con_rv + write (0,*)'con_rd=',con_rd + write (0,*)'con_g=',con_g + write (0,*)'con_pi=',con_pi + write (0,*)'con_hvap=',con_hvap + write (0,*)'stbolt=',stbolt + write (0,*)'smsoil(i,:,j)=',i,j,smsoil(i,:,j) + write (0,*)'slsoil(i,:,j)=',i,j,slsoil(i,:,j) + write (0,*)'stsoil(i,:,j)=',i,j,stsoil(i,:,j) + write (0,*)'smfrsoil(i,:,j)=',i,j,smfrsoil(i,:,j) + write (0,*)'keepfrsoil(i,:,j)=',i,j,keepfrsoil(i,:,j) + write (0,*)'soilm(i,j) =',i,j,soilm(i,j) + write (0,*)'smmax(i,j) =',i,j,smmax(i,j) + write (0,*)'hfx(i,j) =',i,j,hfx(i,j) + write (0,*)'qfx(i,j) =',i,j,qfx(i,j) + write (0,*)'lh(i,j) =',i,j,lh(i,j) + write (0,*)'infiltr(i,j) =',i,j,infiltr(i,j) + write (0,*)'runoff1(i,j) =',i,j,runoff1(i,j) + write (0,*)'runoff2(i,j) =',i,j,runoff2(i,j) + write (0,*)'acrunoff(i,j) =',i,j,acrunoff(i,j) + write (0,*)'sfcexc(i,j) =',i,j,sfcexc(i,j) + write (0,*)'acceta(i,j) =',i,j,acceta(i,j) + write (0,*)'ssoil(i,j) =',i,j,ssoil(i,j) + write (0,*)'snfallac(i,j) =',i,j,snfallac(i,j) + write (0,*)'acsn(i,j) =',i,j,acsn(i,j) + write (0,*)'snomlt(i,j) =',i,j,snomlt(i,j) + write (0,*)'shdmin1d(i,j) =',i,j,shdmin1d(i,j) + write (0,*)'shdmax1d(i,j) =',i,j,shdmax1d(i,j) + write (0,*)'rdlai2d =',rdlai2d !endif endif @@ -929,39 +940,39 @@ subroutine lsm_ruc_run & ! inputs & its,ite, jts,jte, kts,kte ) if(debug_print) then - print *,'after sneqv(i,j) =',i,j,sneqv(i,j) - print *,'after snowh(i,j) =',i,j,snowh(i,j) - print *,'after sncovr(i,j) =',i,j,sncovr(i,j) - print *,'after vtype(i,j) =',i,j,vtype(i,j) - print *,'after stype(i,j) =',i,j,stype(i,j) - print *,'after wet(i,j) =',i,j,wet(i,j) - print *,'after cmc(i,j) =',i,j,cmc(i,j) - print *,'after qsfc(i,j) =',i,j,qsfc(i,j) - print *,'after qvg(i,j) =',i,j,qvg(i,j) - print *,'after qsg(i,j) =',i,j,qsg(i,j) - print *,'after qcg(i,j) =',i,j,qcg(i,j) - print *,'after dew(i,j) =',i,j,dew(i,j) - print *,'after soilt(i,j) =',i,j,soilt(i,j) - print *,'after tskin(i) =',i,j,tskin(i) - print *,'after soilt1(i,j) =',i,j,soilt1(i,j) - print *,'after tsnav(i,j) =',i,j,tsnav(i,j) - print *,'after smsoil(i,:,j)=',i,j,smsoil(i,:,j) - print *,'after slsoil(i,:,j)=',i,j,slsoil(i,:,j) - print *,'after stsoil(i,:,j)=',i,j,stsoil(i,:,j) - print *,'after smfrsoil(i,:,j)=',i,j,smfrsoil(i,:,j) - print *,'after keepfrsoil(i,:,j)=',i,j,keepfrsoil(i,:,j) - print *,'after soilm(i,j) =',i,j,soilm(i,j) - print *,'after smmax(i,j) =',i,j,smmax(i,j) - print *,'after hfx(i,j) =',i,j,hfx(i,j) - print *,'after qfx(i,j) =',i,j,qfx(i,j) - print *,'after lh(i,j) =',i,j,lh(i,j) - print *,'after infiltr(i,j) =',i,j,infiltr(i,j) - print *,'after runoff1(i,j) =',i,j,runoff1(i,j) - print *,'after runoff2(i,j) =',i,j,runoff2(i,j) - print *,'after ssoil(i,j) =',i,j,ssoil(i,j) - print *,'after snfallac(i,j) =',i,j,snfallac(i,j) - print *,'after acsn(i,j) =',i,j,acsn(i,j) - print *,'after snomlt(i,j) =',i,j,snomlt(i,j) + write (0,*)'after sneqv(i,j) =',i,j,sneqv(i,j) + write (0,*)'after snowh(i,j) =',i,j,snowh(i,j) + write (0,*)'after sncovr(i,j) =',i,j,sncovr(i,j) + write (0,*)'after vtype(i,j) =',i,j,vtype(i,j) + write (0,*)'after stype(i,j) =',i,j,stype(i,j) + write (0,*)'after wet(i,j) =',i,j,wet(i,j) + write (0,*)'after cmc(i,j) =',i,j,cmc(i,j) + write (0,*)'after qsfc(i,j) =',i,j,qsfc(i,j) + write (0,*)'after qvg(i,j) =',i,j,qvg(i,j) + write (0,*)'after qsg(i,j) =',i,j,qsg(i,j) + write (0,*)'after qcg(i,j) =',i,j,qcg(i,j) + write (0,*)'after dew(i,j) =',i,j,dew(i,j) + write (0,*)'after soilt(i,j) =',i,j,soilt(i,j) + write (0,*)'after tskin(i) =',i,j,tskin(i) + write (0,*)'after soilt1(i,j) =',i,j,soilt1(i,j) + write (0,*)'after tsnav(i,j) =',i,j,tsnav(i,j) + write (0,*)'after smsoil(i,:,j)=',i,j,smsoil(i,:,j) + write (0,*)'after slsoil(i,:,j)=',i,j,slsoil(i,:,j) + write (0,*)'after stsoil(i,:,j)=',i,j,stsoil(i,:,j) + write (0,*)'after smfrsoil(i,:,j)=',i,j,smfrsoil(i,:,j) + write (0,*)'after keepfrsoil(i,:,j)=',i,j,keepfrsoil(i,:,j) + write (0,*)'after soilm(i,j) =',i,j,soilm(i,j) + write (0,*)'after smmax(i,j) =',i,j,smmax(i,j) + write (0,*)'after hfx(i,j) =',i,j,hfx(i,j) + write (0,*)'after qfx(i,j) =',i,j,qfx(i,j) + write (0,*)'after lh(i,j) =',i,j,lh(i,j) + write (0,*)'after infiltr(i,j) =',i,j,infiltr(i,j) + write (0,*)'after runoff1(i,j) =',i,j,runoff1(i,j) + write (0,*)'after runoff2(i,j) =',i,j,runoff2(i,j) + write (0,*)'after ssoil(i,j) =',i,j,ssoil(i,j) + write (0,*)'after snfallac(i,j) =',i,j,snfallac(i,j) + write (0,*)'after acsn(i,j) =',i,j,acsn(i,j) + write (0,*)'after snomlt(i,j) =',i,j,snomlt(i,j) endif @@ -976,12 +987,12 @@ subroutine lsm_ruc_run & ! inputs ! if(debug_print) then !if(me==0.and.i==ipr) then - print *,'after RUC smsoil = ',smsoil(i,:,j), i, j - print *,'stsoil = ',stsoil(i,:,j), i,j - print *,'soilt = ',soilt(i,j), i,j - print *,'wet = ',wet(i,j), i,j - print *,'soilt1 = ',soilt1(i,j), i,j - print *,'rhosnfr = ',rhosnfr(i,j), i,j + write (0,*)'after RUC smsoil = ',smsoil(i,:,j), i, j + write (0,*)'stsoil = ',stsoil(i,:,j), i,j + write (0,*)'soilt = ',soilt(i,j), i,j + write (0,*)'wet = ',wet(i,j), i,j + write (0,*)'soilt1 = ',soilt1(i,j), i,j + write (0,*)'rhosnfr = ',rhosnfr(i,j), i,j !endif endif @@ -1068,9 +1079,9 @@ subroutine lsm_ruc_run & ! inputs do j = 1, 1 do i = 1, im if (flag(i)) then - if(debug_print) print *,'end ',i,flag_guess(i),flag_iter(i) + if(debug_print) write (0,*)'end ',i,flag_guess(i),flag_iter(i) if (flag_guess(i)) then - if(debug_print) print *,'guess run' + if(debug_print) write (0,*)'guess run' weasd(i) = weasd_old(i) snwdph(i) = snwdph_old(i) tskin(i) = tskin_old(i) @@ -1094,7 +1105,7 @@ subroutine lsm_ruc_run & ! inputs smfrkeep(i,k) = smfrkeep_old(i,k) enddo else - if(debug_print) print *,'iter run', i,j, tskin(i),tsurf(i) + if(debug_print) write (0,*)'iter run', i,j, tskin(i),tsurf(i) tskin(i) = tsurf(i) tice (i) = tsurf(i) endif @@ -1145,7 +1156,7 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in smcref2, smcwlt2, & ! inout lsm_ruc, lsm, & ! in zs, sh2o, smfrkeep, tslb, smois, & ! out - wetness, errmsg, errflg) + wetness, me, master, errmsg, errflg) implicit none @@ -1176,6 +1187,8 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in real (kind=kind_phys), dimension(1:lsoil_ruc), intent (out) :: zs + integer, intent(in ) :: me + integer, intent(in ) :: master character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -1230,8 +1243,8 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in errflg = 1 return else if (debug_print) then - write(0,*) 'Start of RUC LSM initialization' - print *,'lsoil, lsoil_ruc =',lsoil, lsoil_ruc + write (0,*) 'Start of RUC LSM initialization' + write (0,*)'lsoil, lsoil_ruc =',lsoil, lsoil_ruc endif ipr = 10 @@ -1268,20 +1281,20 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in num_soil_layers = lsoil ! 4 - for Noah lsm - if( lsoil_ruc == lsoil) then - ! RUC LSM input - smadj = .false. - swi_init = .false. - flag_soil_layers = 0 ! =1 for input from the Noah LSM - flag_soil_levels = 1 ! =1 for input from RUC LSM - else - ! for Noah input set smadj and swi_init to .true. - smadj = .true. - swi_init = .true. - flag_soil_layers = 1 ! =1 for input from the Noah LSM - flag_soil_levels = 0 ! =1 for input from RUC LSM - endif - + if( lsoil_ruc == lsoil) then + ! RUC LSM input + smadj = .false. + swi_init = .false. + flag_soil_layers = 0 ! =1 for input from the Noah LSM + flag_soil_levels = 1 ! =1 for input from RUC LSM + else + ! for Noah input set smadj and swi_init to .true. + smadj = .true. + swi_init = .true. + flag_soil_layers = 1 ! =1 for input from the Noah LSM + flag_soil_levels = 0 ! =1 for input from RUC LSM + endif + if(lsoil == 4 ) then ! for Noah input st_levels_input = (/ 5, 25, 70, 150/) ! Noah centers of soil layers sm_levels_input = (/ 5, 25, 70, 150/) ! Noah centers of soil layers @@ -1294,32 +1307,35 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in else - ! For RUC input data, return here + ! For RUC restart data, return here return endif if(debug_print) then - print *,'Noah smc(ipr,:) ==', ipr, smc(ipr,:) - print *,'Noah stc(ipr,:) ==', ipr, stc(ipr,:) - print *,'Noah vegtype(ipr) ==', ipr, vegtype(ipr) - print *,'Noah soiltyp(ipr) ==', ipr, soiltyp(ipr) - print *,'its,ite,jts,jte ',its,ite,jts,jte + write (0,*)'smc(ipr,:) ==', ipr, smc(ipr,:) + write (0,*)'stc(ipr,:) ==', ipr, stc(ipr,:) + write (0,*)'vegtype(ipr) ==', ipr, vegtype(ipr) + write (0,*)'soiltyp(ipr) ==', ipr, soiltyp(ipr) + write (0,*)'its,ite,jts,jte ',its,ite,jts,jte endif do j=jts,jte ! do i=its,ite ! i = horizontal loop - tsk(i,j) = tsurf(i) - sst(i,j) = tsurf_ocn(i) - tbot(i,j)= tg3(i) - - ! land only version - ivgtyp(i,j)=vegtype(i) - isltyp(i,j)=soiltyp(i) - landmask(i,j)=1. - xice(i,j)=0. + ! land only version + if (land(i)) then + tsk(i,j) = tsurf(i) + sst(i,j) = tsurf_ocn(i) + tbot(i,j)= tg3(i) + ivgtyp(i,j)=vegtype(i) + isltyp(i,j)=soiltyp(i) + landmask(i,j)=1. + xice(i,j)=0. + else + landmask(i,j)=0. + endif ! land(i) enddo enddo @@ -1335,8 +1351,8 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in sm_input(i,1,j)=0. !--- initialize smcwlt2 and smcref2 with Noah values - smcref2 (i) = REFSMCnoah(soiltyp(i)) - smcwlt2 (i) = WLTSMCnoah(soiltyp(i)) + smcref2 (i) = REFSMCnoah(soiltyp(i)) + smcwlt2 (i) = WLTSMCnoah(soiltyp(i)) do k=1,lsoil st_input(i,k+1,j)=stc(i,k) @@ -1359,8 +1375,8 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in enddo ! jme if(debug_print) then - print *,'st_input=',ipr, st_input(ipr,:,1) - print *,'sm_input=',ipr, sm_input(ipr,:,1) + write (0,*)'st_input=',ipr, st_input(ipr,:,1) + write (0,*)'sm_input=',ipr, sm_input(ipr,:,1) endif CALL init_soil_3_real ( tsk , tbot , dumsm , dumt , & @@ -1395,13 +1411,13 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in enddo if(debug_print) then - print *,'tsk(i,j),tbot(i,j),sst(i,j),landmask(i,j)' & + write (0,*)'tsk(i,j),tbot(i,j),sst(i,j),landmask(i,j)' & ,ipr,1,tsk(ipr,1),tbot(ipr,1),sst(ipr,1),landmask(ipr,1) - print *,'tsurf(ipr)=',ipr,tsurf(ipr) - print *,'stc(ipr)=',ipr,stc(ipr,:) - print *,'smc(ipr)=',ipr,smc(ipr,:) - print *,'soilt(1,:,ipr)',ipr,soiltemp(ipr,:,1) - print *,'soilm(1,:,ipr)',ipr,soilm(ipr,:,1) + write (0,*)'tsurf(ipr)=',ipr,tsurf(ipr) + write (0,*)'stc(ipr)=',ipr,stc(ipr,:) + write (0,*)'smc(ipr)=',ipr,smc(ipr,:) + write (0,*)'soilt(1,:,ipr)',ipr,soiltemp(ipr,:,1) + write (0,*)'soilm(1,:,ipr)',ipr,soilm(ipr,:,1) endif ! debug_print ! smadj should be true when the Noah LSM is used to initialize RUC @@ -1429,9 +1445,9 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in if(debug_print) then if(i==ipr) then - print *,'from Noah to RUC: RUC bucket and Noah bucket at', & + write (0,*)'from Noah to RUC: RUC bucket and Noah bucket at', & i,j,smtotr(i,j),smtotn(i,j) - print *,'before smois=',i,j,soilm(i,:,j) + write (0,*)'before smois=',i,j,soilm(i,:,j) endif endif @@ -1452,14 +1468,14 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in soilm(i,k,j) = factorsm(k) * soilm(i,k,j) enddo if(debug_print) then - if(i==ipr) print *,'after smois=',i,j,soilm(i,:,j) + if(i==ipr) write (0,*)'after smois=',i,j,soilm(i,:,j) endif smtotr(i,j) = 0. do k=1,lsoil_ruc - 1 smtotr(i,j)=smtotr(i,j) + soilm(i,k,j) *dzs(k) enddo if(debug_print) then - if(i==ipr)print *,'after correction: RUC bucket and Noah bucket at', & + if(i==ipr) write (0,*)'after correction: RUC bucket and Noah bucket at', & i,j,smtotr(i,j),smtotn(i,j) endif @@ -1472,7 +1488,7 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in elseif (flag_soil_layers==0) then ! RUC LSM input - print *,' RUC LSM input for soil variables' + if(debug_print) write (0,*)' RUC LSM input for soil variables' do j=jts,jte do i=its,ite do k=1,lsoil_ruc @@ -1488,7 +1504,7 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in ! Initialize liquid and frozen soil moisture from total soil moisture ! and soil temperature, and also soil moisture availability in the top ! layer - call ruclsminit( debug_print, & + call ruclsminit( debug_print, landmask, & lsoil_ruc, isltyp, ivgtyp, xice, mavail, & soilh2o, smfr, soiltemp, soilm, & ims,ime, jms,jme, kms,kme, & @@ -1508,8 +1524,7 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in enddo enddo - if ( flag_soil_layers == 1 ) then - ! For Noah lsm input and non-land points, set RUC LSM fields to Noah fields + ! For non-land points, set RUC LSM fields to input (Noah or RUC) fields do i=1,im if (.not.land(i)) then do k=1,min(lsoil,lsoil_ruc) @@ -1519,12 +1534,11 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in enddo endif enddo - endif ! flag_soil_layers==1 if(debug_print) then - print *,'End of RUC LSM initialization' - print *,'tslb(ipr)=',ipr,tslb(ipr,:) - print *,'smois(ipr)=',ipr,smois(ipr,:) + write (0,*)'End of RUC LSM initialization' + write (0,*)'tslb(ipr)=',ipr,tslb(ipr,:) + write (0,*)'smois(ipr)=',ipr,smois(ipr,:) endif ! debug_print end subroutine rucinit From e4e75a33a9218bd96565f426f6883b9aeef76a0a Mon Sep 17 00:00:00 2001 From: climbfuji Date: Mon, 12 Aug 2019 08:15:53 -0600 Subject: [PATCH 53/89] physics/sfc_drv_ruc.F90: turn error into warning for land points with vegtype == 15 --- physics/sfc_drv_ruc.F90 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index bb8c46d9e..3ab8c9d64 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -502,10 +502,14 @@ subroutine lsm_ruc_run & ! inputs !- 10may19 - ice points are turned off. flag(i) = land(i) if (land(i) .and. (vegtype(i)==iswater .or. vegtype(i)==isice)) then - write(errmsg,'(a,i0,a,i0)') 'Logic error in sfc_drv_ruc_run: for i=', i, & - ', land(i) is true but vegtype(i) is water or ice: ', vegtype(i) - errflg = 1 - return + !write(errmsg,'(a,i0,a,i0)') 'Logic error in sfc_drv_ruc_run: for i=', i, & + ! ', land(i) is true but vegtype(i) is water or ice: ', vegtype(i) + !errflg = 1 + !return + if(flag_init .and. iter==1) then + write(0,'(a,i0,a,i0)') 'Warning: in sfc_drv_ruc_run: for i=', i, & + ', land(i) is true but vegtype(i) is water or ice: ', vegtype(i) + end if end if enddo From 8333bb83f5a1f0aa442eef235adc406deb048468 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Tue, 13 Aug 2019 07:56:24 -0600 Subject: [PATCH 54/89] physics/docs/ccpplatex_dox: add machine.F and extension mapping for .F files --- physics/docs/ccpplatex_dox | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/physics/docs/ccpplatex_dox b/physics/docs/ccpplatex_dox index 0dd432cd1..5ddd552f5 100644 --- a/physics/docs/ccpplatex_dox +++ b/physics/docs/ccpplatex_dox @@ -29,7 +29,8 @@ OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_FOR_FORTRAN = YES OPTIMIZE_OUTPUT_VHDL = NO -EXTENSION_MAPPING = .f=FortranFree \ +EXTENSION_MAPPING = .F=FortranFree \ + .f=FortranFree \ .F90=FortranFree \ .f90=FortranFree MARKDOWN_SUPPORT = YES @@ -175,7 +176,8 @@ INPUT = pdftxt/mainpage.txt \ ../funcphys.f90 \ ../physparam.f \ ../physcons.f90 \ - ../radcons.f90 + ../radcons.f90 \ + ../machine.F INPUT_ENCODING = UTF-8 FILE_PATTERNS = *.f \ From 73f7d2355d12c4c9846e69a225106375df11caae Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Tue, 13 Aug 2019 18:18:24 -0600 Subject: [PATCH 55/89] remove loops over nblks in SCM version of GFS_phys_time_vary; no effect on FV3 --- physics/GFS_phys_time_vary.scm.F90 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/physics/GFS_phys_time_vary.scm.F90 b/physics/GFS_phys_time_vary.scm.F90 index 200881d2c..a69df6c79 100644 --- a/physics/GFS_phys_time_vary.scm.F90 +++ b/physics/GFS_phys_time_vary.scm.F90 @@ -367,25 +367,19 @@ subroutine GFS_phys_time_vary_run (Grid, Statein, Model, Tbd, Sfcprop, Cldprop, sec_zero = nint(Model%fhzero*con_hr) if (sec_zero >= nint(max(Model%fhswr,Model%fhlwr))) then if (mod(Model%kdt,Model%nszero) == 1) then - do nb = 1,nblks call Diag%rad_zero (Model) call Diag%phys_zero (Model) !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED - enddo endif else if (mod(Model%kdt,Model%nszero) == 1) then - do nb = 1,nblks call Diag%phys_zero (Model) !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED - enddo endif kdt_rad = nint(min(Model%fhswr,Model%fhlwr)/Model%dtp) if (mod(Model%kdt, kdt_rad) == 1) then - do nb = 1,nblks call Diag%rad_zero (Model) !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED - enddo endif endif From 307769dba0b97fbaf5d6be4bf310f8c4b345070d Mon Sep 17 00:00:00 2001 From: "Linlin.Pan" Date: Thu, 15 Aug 2019 09:05:57 +0000 Subject: [PATCH 56/89] adding coupling option in ccpp --- physics/GFS_PBL_generic.F90 | 116 ++++++++++------ physics/GFS_surface_generic.F90 | 63 ++++++++- physics/sfc_cice.f | 226 ++++++++++++++++++++++++++++++++ physics/sfc_sice.f | 52 ++++++-- 4 files changed, 410 insertions(+), 47 deletions(-) create mode 100644 physics/sfc_cice.f diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index 5063038d4..2b230d952 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -291,6 +291,29 @@ end subroutine GFS_PBL_generic_post_finalize !! | dv3dt_OGWD | cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag | cumulative change in y wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | !! | dq3dt | cumulative_change_in_water_vapor_specific_humidity_due_to_PBL | cumulative change in water vapor specific humidity due to PBL | kg kg-1 | 2 | real | kind_phys | inout | F | !! | dq3dt_ozone | cumulative_change_in_ozone_mixing_ratio_due_to_PBL | cumulative change in ozone mixing ratio due to PBL | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | fvirt | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | +!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | +!! | t1 | air_temperature_at_lowest_model_layer_for_diag | layer 1 temperature for diag | K | 1 | real | kind_phys | in | F | +!! | q1 | water_vapor_specific_humidity_at_lowest_model_layer_for_diag | layer 1 specific humidity for diag | kg kg-1 | 1 | real | kind_phys | in | F | +!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | hflx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | +!! | ushfsfci | instantaneous_upward_sensible_heat_flux | instantaneous upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | oceanfrac | sea_area_fraction | fraction of horizontal grid area occupied by ocean | frac | 1 | real | kind_phys | in | F | +!! | fice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | +!! | dusfc_cice | surface_x_momentum_flux_for_coupling_cice | sfc x momentum flux for cice | Pa | 1 | real | kind_phys | in | F | +!! | dvsfc_cice | surface_y_momentum_flux_for_coupling_cice | sfc y momentum flux for cice | Pa | 1 | real | kind_phys | in | F | +!! | dtsfc_cice | surface_upward_sensible_heat_flux_for_coupling_cice | sfc sensible heat flux for cice | W m-2 | 1 | real | kind_phys | in | F | +!! | dqsfc_cice | surface_upward_latent_heat_flux_for_coupling_cice | sfc latent heat flux for cice | W m-2 | 1 | real | kind_phys | in | F | +!! | dry | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | +!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | +!! | wind | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | +!! | stress_ocn | surface_wind_stress_over_ocean | surface wind stress over ocean | m2 s-2 | 1 | real | kind_phys | in | F | +!! | hflx_ocn | kinematic_surface_upward_sensible_heat_flux_over_ocean | kinematic surface upward sensible heat flux over ocean | K m s-1 | 1 | real | kind_phys | in | F | +!! | evap_ocn | kinematic_surface_upward_latent_heat_flux_over_ocean | kinematic surface upward latent heat flux over ocean | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | ugrs1 | x_wind_at_lowest_model_layer | zonal wind at lowest model layer | m s-1 | 1 | real | kind_phys | in | F | +!! | vgrs1 | y_wind_at_lowest_model_layer | meridional wind at lowest model layer | m s-1 | 1 | real | kind_phys | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! @@ -303,7 +326,8 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, dqdt, dusfc_cpl, dvsfc_cpl, dtsfc_cpl, & dqsfc_cpl, dusfci_cpl, dvsfci_cpl, dtsfci_cpl, dqsfci_cpl, dusfc_diag, dvsfc_diag, dtsfc_diag, dqsfc_diag, & dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag, dt3dt, du3dt_PBL, du3dt_OGWD, dv3dt_PBL, dv3dt_OGWD, dq3dt, & - dq3dt_ozone, errmsg, errflg) + dq3dt_ozone, rd, cp,fvirt, hvap, t1, q1, prsl, hflx, ushfsfci, oceanfrac, fice, dusfc_cice, dvsfc_cice, dtsfc_cice, & + dqsfc_cice, dry, icy, wind, stress_ocn, hflx_ocn, evap_ocn, ugrs1, vgrs1, errmsg, errflg) use machine, only: kind_phys @@ -317,6 +341,11 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, logical, intent(in) :: hybedmf, do_shoc, satmedmf, shinhong, do_ysu real(kind=kind_phys), intent(in) :: dtf + real(kind=kind_phys), intent(in) :: rd, cp, fvirt, hvap + real(kind=kind_phys), dimension(:), intent(in) :: t1, q1, hflx, oceanfrac, fice + real(kind=kind_phys), dimension(:,:), intent(in) :: prsl + real(kind=kind_phys), dimension(:), intent(in) :: dusfc_cice, dvsfc_cice, dtsfc_cice, dqsfc_cice, & + wind, stress_ocn, hflx_ocn, evap_ocn, ugrs1, vgrs1 real(kind=kind_phys), dimension(im, levs, nvdiff), intent(in) :: dvdftra real(kind=kind_phys), dimension(im), intent(in) :: dusfc1, dvsfc1, dtsfc1, dqsfc1, xmu real(kind=kind_phys), dimension(im, levs), intent(in) :: dudt, dvdt, dtdt, htrsw, htrlw @@ -331,11 +360,14 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, real(kind=kind_phys), dimension(:), intent(inout) :: dusfc_cpl, dvsfc_cpl, dtsfc_cpl, dqsfc_cpl, dusfci_cpl, dvsfci_cpl, & dtsfci_cpl, dqsfci_cpl, dusfc_diag, dvsfc_diag, dtsfc_diag, dqsfc_diag, dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag + logical, dimension(:),intent(in) :: dry, icy + + real(kind=kind_phys), dimension(:), intent(out) :: ushfsfci character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg integer :: i, k - real(kind=kind_phys) :: tem + real(kind=kind_phys) :: tem, tem1, rho ! Initialize CCPP error handling variables errmsg = '' @@ -453,47 +485,57 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, endif endif ! nvdiff == ntrac + write(*,*)rd,cp,hvap,fvirt +!! new adding + if (cplchm) then + do i = 1, im + tem1 = max(q1(i), 1.e-8) + tem = prsl(i,1) / (rd*t1(i)*(1.0+fvirt*tem1)) + ushfsfci(i) = -cp * tem * hflx(i) ! upward sensible heat flux + enddo +!! Coupling%dkt (:,:) = dkt (:,:) + endif ! --- ... coupling insertion ! ### GJF ### the following section needs to be made CCPP-compliant when cplflx = T -! if (Model%cplflx) then -! do i=1,im -! if (Sfcprop%oceanfrac(i) > 0.0) then ! Ocean only, NO LAKES -! if (fice(i) == 1.0) then ! use results from CICE -! Coupling%dusfci_cpl(i) = dusfc_cice(i) -! Coupling%dvsfci_cpl(i) = dvsfc_cice(i) -! Coupling%dtsfci_cpl(i) = dtsfc_cice(i) -! Coupling%dqsfci_cpl(i) = dqsfc_cice(i) -! elseif (dry(i) .or. icy(i)) then ! use stress_ocean from sfc_diff for opw component at mixed point -! tem1 = max(Diag%q1(i), 1.e-8) -! rho = Statein%prsl(i,1) / (con_rd*Diag%t1(i)*(1.0+con_fvirt*tem1)) -! if (wind(i) > 0.0) then -! tem = - rho * stress_ocn(i) / wind(i) -! Coupling%dusfci_cpl(i) = tem * Statein%ugrs(i,1) ! U-momentum flux -! Coupling%dvsfci_cpl(i) = tem * Statein%vgrs(i,1) ! V-momentum flux -! else -! Coupling%dusfci_cpl(i) = 0.0 -! Coupling%dvsfci_cpl(i) = 0.0 -! endif -! Coupling%dtsfci_cpl(i) = con_cp * rho * hflx_ocn(i) ! sensible heat flux over open ocean -! Coupling%dqsfci_cpl(i) = con_hvap * rho * evap_ocn(i) ! latent heat flux over open ocean -! else ! use results from PBL scheme for 100% open ocean -! Coupling%dusfci_cpl(i) = dusfc1(i) -! Coupling%dvsfci_cpl(i) = dvsfc1(i) -! Coupling%dtsfci_cpl(i) = dtsfc1(i) -! Coupling%dqsfci_cpl(i) = dqsfc1(i) -! endif + if (cplflx) then + do i=1,im + if (oceanfrac(i) > 0.0) then ! Ocean only, NO LAKES + if (fice(i) == 1.0) then ! use results from CICE + dusfci_cpl(i) = dusfc_cice(i) + dvsfci_cpl(i) = dvsfc_cice(i) + dtsfci_cpl(i) = dtsfc_cice(i) + dqsfci_cpl(i) = dqsfc_cice(i) + elseif (dry(i) .or. icy(i)) then ! use stress_ocean from sfc_diff for opw component at mixed point + tem1 = max(q1(i), 1.e-8) + rho = prsl(i,1) / (rd*t1(i)*(1.0+fvirt*tem1)) + if (wind(i) > 0.0) then + tem = - rho * stress_ocn(i) / wind(i) + dusfci_cpl(i) = tem * ugrs1(i) ! U-momentum flux + dvsfci_cpl(i) = tem * vgrs1(i) ! V-momentum flux + else + dusfci_cpl(i) = 0.0 + dvsfci_cpl(i) = 0.0 + endif + dtsfci_cpl(i) = cp * rho * hflx_ocn(i) ! sensible heat flux over open ocean + dqsfci_cpl(i) = hvap * rho * evap_ocn(i) ! latent heat flux over open ocean + else ! use results from PBL scheme for 100% open ocean + dusfci_cpl(i) = dusfc1(i) + dvsfci_cpl(i) = dvsfc1(i) + dtsfci_cpl(i) = dtsfc1(i) + dqsfci_cpl(i) = dqsfc1(i) + endif ! -! Coupling%dusfc_cpl (i) = Coupling%dusfc_cpl(i) + Coupling%dusfci_cpl(i) * dtf -! Coupling%dvsfc_cpl (i) = Coupling%dvsfc_cpl(i) + Coupling%dvsfci_cpl(i) * dtf -! Coupling%dtsfc_cpl (i) = Coupling%dtsfc_cpl(i) + Coupling%dtsfci_cpl(i) * dtf -! Coupling%dqsfc_cpl (i) = Coupling%dqsfc_cpl(i) + Coupling%dqsfci_cpl(i) * dtf + dusfc_cpl (i) = dusfc_cpl(i) + dusfci_cpl(i) * dtf + dvsfc_cpl (i) = dvsfc_cpl(i) + dvsfci_cpl(i) * dtf + dtsfc_cpl (i) = dtsfc_cpl(i) + dtsfci_cpl(i) * dtf + dqsfc_cpl (i) = dqsfc_cpl(i) + dqsfci_cpl(i) * dtf !! -! endif ! Ocean only, NO LAKES -! enddo -! endif -!-------------------------------------------------------lssav if loop ---------- + endif ! Ocean only, NO LAKES + enddo + endif + if (lssav) then do i=1,im dusfc_diag (i) = dusfc_diag(i) + dusfc1(i)*dtf diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index 5504eb7cd..e40ac44b4 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -32,7 +32,7 @@ end subroutine GFS_surface_generic_pre_finalize !! | prslk_1 | dimensionless_exner_function_at_lowest_model_layer | dimensionless Exner function at lowest model layer | none | 1 | real | kind_phys | in | F | !! | semis | surface_longwave_emissivity | surface lw emissivity in fraction | frac | 1 | real | kind_phys | in | F | !! | adjsfcdlw | surface_downwelling_longwave_flux | surface downwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | +!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | inout | F | !! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | !! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | !! | sigmaf | bounded_vegetation_area_fraction | areal fractional cover of green vegetation bounded on the bottom | frac | 1 | real | kind_phys | inout | F | @@ -62,6 +62,24 @@ end subroutine GFS_surface_generic_pre_finalize !! | bexp1d | perturbation_of_soil_type_b_parameter | perturbation of soil type "b" parameter | frac | 1 | real | kind_phys | out | F | !! | xlai1d | perturbation_of_leaf_area_index | perturbation of leaf area index | frac | 1 | real | kind_phys | out | F | !! | vegf1d | perturbation_of_vegetation_fraction | perturbation of vegetation fraction | frac | 1 | real | kind_phys | out | F | +!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | +!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | inout | F | +!! | islmsk_cice | sea_land_ice_mask_cice | sea/land/ice mask cice (=0/1/2) | flag | 1 | integer | | in | F | +!! | slimskin_cpl | sea_land_ice_mask_in | sea/land/ice mask input (=0/1/2) | flag | 1 | real | kind_phys | in | F | +!! | dusfcin_cpl | surface_x_momentum_flux_for_coupling_in | sfc x momentum flux for coupling in | Pa | 1 | real | kind_phys | in | F | +!! | dvsfcin_cpl | surface_y_momentum_flux_for_coupling_in | sfc y momentum flux for coupling in | Pa | 1 | real | kind_phys | in | F | +!! | dtsfcin_cpl | surface_upward_sensible_heat_flux_for_coupling_in | sfc sensible heat flux input | W m-2 | 1 | real | kind_phys | in | F | +!! | dqsfcin_cpl | surface_upward_latent_heat_flux_for_coupling_in | sfc latent heat flux input for coupling in | W m-2 | 1 | real | kind_phys | in | F | +!! | ulwsfcin_cpl | surface_upwelling_longwave_flux_for_coupling_in | surface upwelling LW flux for coupling in | W m-2 | 1 | real | kind_phys | in | F | +!! | ulwsfc_cice | surface_upwelling_longwave_flux_for_cice | surface upwelling longwave flux for cice | W m-2 | 1 | real | kind_phys | out | F | +!! | dusfc_cice | surface_x_momentum_flux_for_coupling_cice | sfc x momentum flux for cice | Pa | 1 | real | kind_phys | out | F | +!! | dvsfc_cice | surface_y_momentum_flux_for_coupling_cice | sfc y momentum flux for cice | Pa | 1 | real | kind_phys | out | F | +!! | dtsfc_cice | surface_upward_sensible_heat_flux_for_coupling_cice | sfc sensible heat flux for cice | W m-2 | 1 | real | kind_phys | out | F | +!! | dqsfc_cice | surface_upward_latent_heat_flux_for_coupling_cice | sfc latent heat flux for cice | W m-2 | 1 | real | kind_phys | out | F | +!! | tisfc | sea_ice_temperature | sea-ice surface temperature | K | 1 | real | kind_phys | in | F | +!! | tsfco | sea_surface_temperature | sea surface temperature | K | 1 | real | kind_phys | in | F | +!! | fice | sea_ice_concentration | sea-ice concentration [0,1] | frac | 1 | real | kind_phys | in | F | +!! | hice | sea_ice_thickness | sea-ice thickness | m | 1 | real | kind_phys | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! @@ -71,6 +89,9 @@ subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, slopetyp, work3, gabsbdlw, tsurf, zlvl, do_sppt, dtdtr, & drain_cpl, dsnow_cpl, rain_cpl, snow_cpl, do_sfcperts, nsfcpert, sfc_wts, & pertz0, pertzt, pertshc, pertlai, pertvegf, z01d, zt1d, bexp1d, xlai1d, vegf1d, & + cplflx, flag_cice, islmsk_cice,slimskin_cpl, dusfcin_cpl, dvsfcin_cpl, & + dtsfcin_cpl, dqsfcin_cpl, ulwsfcin_cpl, ulwsfc_cice, dusfc_cice, dvsfc_cice, & + dtsfc_cice, dqsfc_cice, tisfc, tsfco, fice, hice, & errmsg, errflg) use machine, only: kind_phys @@ -85,7 +106,8 @@ subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, real(kind=kind_phys), intent(in) :: con_g real(kind=kind_phys), dimension(im), intent(in) :: vfrac, stype, vtype, slope, prsik_1, prslk_1, & - semis, adjsfcdlw, tsfc + semis, adjsfcdlw + real(kind=kind_phys), dimension(im), intent(inout) :: tsfc real(kind=kind_phys), dimension(im,levs), intent(in) :: phil real(kind=kind_phys), dimension(im), intent(inout) :: sigmaf, work3, gabsbdlw, tsurf, zlvl @@ -111,6 +133,19 @@ subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, real(kind=kind_phys), dimension(im), intent(out) :: xlai1d real(kind=kind_phys), dimension(im), intent(out) :: vegf1d + logical, intent(in) :: cplflx + real(kind=kind_phys), dimension(im), intent(in) :: slimskin_cpl + logical, dimension(im), intent(inout) :: flag_cice + integer, dimension(im), intent(out) :: islmsk_cice + real(kind=kind_phys), dimension(im), intent(in) ::ulwsfcin_cpl, & + dusfcin_cpl, dvsfcin_cpl, dtsfcin_cpl, dqsfcin_cpl, & + tisfc, tsfco, fice, hice + real(kind=kind_phys), dimension(im), intent(out) ::ulwsfc_cice, & + dusfc_cice, dvsfc_cice, dtsfc_cice, dqsfc_cice + real(kind=kind_phys), dimension(im) :: tisfc_cice, tsea_cice, & + fice_cice,hice_cice + + ! CCPP error handling character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -216,6 +251,30 @@ subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, tsurf(i) = tsfc(i) zlvl(i) = phil(i,1) * onebg end do + if (cplflx) then + do i=1,im + islmsk_cice(i) = int(slimskin_cpl(i)+0.5) + if(islmsk_cice(i) == 4)then + flag_cice(i) = .true. + else + flag_cice(i) = .false. + endif + ulwsfc_cice(i) = ulwsfcin_cpl(i) + dusfc_cice(i) = dusfcin_cpl(i) + dvsfc_cice(i) = dvsfcin_cpl(i) + dtsfc_cice(i) = dtsfcin_cpl(i) + dqsfc_cice(i) = dqsfcin_cpl(i) + tisfc_cice(i) = tisfc(i) + tsea_cice(i) = tsfco(i) + fice_cice(i) = fice(i) + hice_cice(i) = hice(i) + if(flag_cice(i)) tsfc(i) = fice_cice(i)*tisfc_cice(i) + (1. - fice_cice(i))*tsea_cice(i) + enddo + else + ! Avoid uninitialized variables - set to default values + flag_cice = .false. + endif + end subroutine GFS_surface_generic_pre_run diff --git a/physics/sfc_cice.f b/physics/sfc_cice.f new file mode 100644 index 000000000..d7b84f800 --- /dev/null +++ b/physics/sfc_cice.f @@ -0,0 +1,226 @@ +!> \file sfc_cice.f +!! This file contains the sfc_sice for coupling to CICE + +!> This module comtains the CCPP-compliant GFS sea ice post interstitial codes, which returns +!! updated ice thickness and concentration to global arrays +!! where there is no ice, and set temperature to surface skin +!!temperature. + module sfc_cice_pre + + contains +!! \section arg_table_sfc_cice_post_init Argument Table +!! + subroutine sfc_cice_pre_init + end subroutine sfc_cice_pre_init + + subroutine sfc_cice_pre_finalize + end subroutine sfc_cice_pre_finalize + + end module sfc_cice_pre +!! + module sfc_cice_post + + contains +!! \section arg_table_sfc_cice_post_init Argument Table +!! + subroutine sfc_cice_post_init + end subroutine sfc_cice_post_init + +!! \section arg_table_sfc_cice_post_finalize Argument Table +!! + subroutine sfc_cice_post_finalize + end subroutine sfc_cice_post_finalize + + subroutine sfc_cice_post_run + end subroutine sfc_cice_post_run + + end module sfc_cice_post + +!> This module contains the CCPP-compliant GFS sea ice scheme. + module sfc_cice + + contains + + subroutine sfc_cice_init + end subroutine sfc_cice_init +! + subroutine sfc_cice_finalize + end subroutine sfc_cice_finalize + + +!> \defgroup sfc_sice for coupling to CICE +!! @{ +!! \section diagram Calling Hierarchy Diagram +!! \section intraphysics Intraphysics Communication +!! +!> \brief Brief description of the subroutine +!! +!! \section arg_table_cice_run Arguments +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! +!! |----------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F +!! | cplchm | flag_for_chemistry_coupling | flag controlling cplchm collection (default off) | flag | 0 | logical | | in | F | +!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | +!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | rvrdm1 | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | +!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | u1 | x_wind_at_lowest_model_layer | u component of surface layer wind | m s-1 | 1 | real | kind_phys | in | F | +!! | v1 | y_wind_at_lowest_model_layer | v component of surface layer wind | m s-1 | 1 | real | kind_phys | in | F | +!! | t1 | air_temperature_at_lowest_model_layer | surface layer mean temperature | K | 1 | real | kind_phys | in | F | +!! | q1 | water_vapor_specific_humidity_at_lowest_model_layer | surface layer mean specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | +!! | cm | surface_drag_coefficient_for_momentum_in_air_over_ice | surface exchange coeff for momentum over ice | none | 1 | real | kind_phys | in | F | +!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice | surface exchange coeff heat & moisture over ice | none | 1 | real | kind_phys | in | F +!! | prsl1 | air_pressure_at_lowest_model_layer | surface layer mean pressure | Pa | 1 | real | kind_phys | in | F | +!! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | +!! | islimsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | in | F | +!! | ddvel | surface_wind_enhancement_due_to_convection | wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | +!! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | +!! | dqsfc | dqsfcin | aoi_fld%dqsfcin(item,lan) | | 1 | real | kind_phys | none | F | +!! | dtsfc | dtsfcin | aoi_fld%dtsfcin(item,lan) | | 1 | real | kind_phys | none | F | +!! | qsurf | surface_specific_humidity_over_ice | surface air saturation specific humidity over ice | kg kg-1 | 1 | real | kind_phys | inout | F | +!! | cmm | surface_drag_wind_speed_for_momentum_in_air_over_ice | momentum exchange coefficient over ice | m s-1 | 1 | real | kind_phys | inout | F | +!! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ice | thermal exchange coefficient over ice | kg m-2 s-1 | 1 | real | kind_phys | inout | F | +!! | evap | kinematic_surface_upward_latent_heat_flux_over_ice | kinematic surface upward latent heat flux over ice | kg kg-1 m s-1 | 1 | real | kind_phys | inout | F | +!! | hflx | kinematic_surface_upward_sensible_heat_flux_over_ice | kinematic surface upward sensible heat flux over ice | K m s-1 | 1 | real | kind_phys | inout | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + +!! +!! \section general General Algorithm +!! \section detailed Detailed Algorithm +!! @{ + + +!! use physcons, only : hvap => con_hvap, cp => con_cp, & +!! & rvrdm1 => con_fvirt, rd => con_rd + contains +! +!----------------------------------- + subroutine sfc_cice_run & + & ( im, cplflx, cplchm, hvap, cp, rvrdm1, rd, & ! --- inputs: + & u1, v1, t1, q1, cm, ch, prsl1, prslki, & + & islimsk, ddvel, flag_iter, dqsfc, dtsfc, & + & qsurf, cmm, chh, evap, hflx, & ! --- outputs: + & errmsg, errflg + & ) + +! ===================================================================== ! +! description: ! +! Sep 2015 -- Xingren Wu created from sfc_sice for coupling to CICE ! +! ! +! usage: ! +! ! +! call sfc_cice ! +! inputs: ! +! ( im, u1, v1, t1, q1, cm, ch, prsl1, prslki, ! +! islimsk, ddvel, flag_iter, dqsfc, dtsfc, ! +! outputs: ! +! qsurf, cmm, chh, evap, hflx) ! +! ! +! ==================== defination of variables ==================== ! +! ! +! inputs: +! im, - integer, horiz dimension +! u1, v1 - real, u/v component of surface layer wind +! t1 - real, surface layer mean temperature ( k ) +! q1 - real, surface layer mean specific humidity +! cm - real, surface exchange coeff for momentum (m/s) +! ch - real, surface exchange coeff heat & moisture(m/s) +! prsl1 - real, surface layer mean pressure +! prslki - real, ? +! islimsk - integer, sea/land/ice mask +! ddvel - real, ? +! flag_iter- logical +! dqsfc - real, latent heat flux +! dtsfc - real, sensible heat flux +! outputs: +! qsurf - real, specific humidity at sfc +! cmm - real, ? +! chh - real, ? +! evap - real, evaperation from latent heat +! hflx - real, sensible heat +! ==================== end of description ===================== ! +! +! + use machine , only : kind_phys + implicit none + + + real (kind=kind_phys), intent(in) :: hvap, cp, rvrdm1, rd + +!- constant parameters: + real(kind=kind_phys), parameter :: cpinv = 1.0/cp + real(kind=kind_phys), parameter :: hvapi = 1.0/hvap + real(kind=kind_phys), parameter :: elocp = hvap/cp + +! --- inputs: + integer, intent(in) :: im + logical, intent(in) :: cplflx + logical, intent(in) :: cplchm + + real (kind=kind_phys), dimension(im), intent(in) :: u1, v1, & + & t1, q1, cm, ch, prsl1, prslki, ddvel, dqsfc, dtsfc + + integer, dimension(im), intent(in) :: islimsk + + logical, intent(in) :: flag_iter(im) + +! --- outputs: + real (kind=kind_phys), dimension(im), intent(out) :: qsurf, & + & cmm, chh, evap, hflx +! + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + +! --- locals: + real (kind=kind_phys), dimension(im) :: q0, rch, rho, tv1, wind + + real (kind=kind_phys) :: tem + + integer :: i + + logical :: flag(im) + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 +! + if((.not. cplflx).and.(.not.cplchm))then + return + endif + + do i = 1, im + flag(i) = (islimsk(i) == 4) .and. flag_iter(i) + enddo +! + do i = 1, im + if (flag(i)) then + + wind(i) = sqrt(u1(i)*u1(i) + v1(i)*v1(i)) & + & + max(0.0, min(ddvel(i), 30.0)) + wind(i) = max(wind(i), 1.0) + + q0(i) = max(q1(i), 1.0e-8) + tv1(i) = t1(i) * (1.0 + rvrdm1*q0(i)) + rho(i) = prsl1(i) / (rd*tv1(i)) + + cmm(i) = cm(i) * wind(i) + chh(i) = rho(i) * ch(i) * wind(i) + rch(i) = chh(i) * cp + + qsurf(i) = q1(i) + dqsfc(i) / (elocp*rch(i)) + tem = 1.0 / rho(i) + hflx(i) = dtsfc(i) * tem * cpinv + evap(i) = dqsfc(i) * tem * hvapi + endif + enddo + + return +!----------------------------------- + end subroutine sfc_cice_run +!----------------------------------- + +!> @} + end module sfc_cice diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index fbc14587a..96c641ac3 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -19,7 +19,7 @@ end subroutine sfc_sice_finalize !! |----------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | !! | km | soil_vertical_dimension | vertical loop extent for soil levels, start at 1 | count | 0 | integer | | in | F | -!! | sbc | steffan_boltzmann_constant | Steffan-Boltzmann constant | W m-2 K-4 | 0 | real | kind_phys | in | F | +!! | sbc | stefan_boltzmann_constant | Stefan-Boltzmann constant | W m-2 K-4 | 0 | real | kind_phys | in | F | !! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | !! | tgice | freezing_point_temperature_of_seawater | freezing point temperature of seawater | K | 0 | real | kind_phys | in | F | !! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | @@ -45,7 +45,7 @@ end subroutine sfc_sice_finalize !! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice | surface exchange coeff heat & moisture over ice | none | 1 | real | kind_phys | in | F | !! | prsl1 | air_pressure_at_lowest_model_layer | surface layer mean pressure | Pa | 1 | real | kind_phys | in | F | !! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | -!! | islimsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | in | F | +!! | islimsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | inout | F | !! | ddvel | surface_wind_enhancement_due_to_convection | wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | !! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | !! | lprnt | flag_print | switch for printing sample column to stdout | flag | 0 | logical | | in | F | @@ -66,6 +66,11 @@ end subroutine sfc_sice_finalize !! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ice | thermal exchange coefficient over ice | kg m-2 s-1 | 1 | real | kind_phys | inout | F | !! | evap | kinematic_surface_upward_latent_heat_flux_over_ice | kinematic surface upward latent heat flux over ice | kg kg-1 m s-1 | 1 | real | kind_phys | inout | F | !! | hflx | kinematic_surface_upward_sensible_heat_flux_over_ice | kinematic surface upward sensible heat flux over ice | K m s-1 | 1 | real | kind_phys | inout | F | +!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | +!! | cplchm | flag_for_chemistry_coupling | flag controlling cplchm collection (default off) | flag | 0 | logical | | in | F | +!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | in | F | +!! | islmsk_cice | sea_land_ice_mask_cice | sea/land/ice mask cice (=0/1/2) | flag | 1 | integer | | in | F | +!! | slmsk | sea_land_ice_mask_real | landmask: sea/land/ice=0/1/2 | flag | 1 | real | kind_phys | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! @@ -98,7 +103,8 @@ subroutine sfc_sice_run & & cm, ch, prsl1, prslki, islimsk, ddvel, & & flag_iter, lprnt, ipr, & & hice, fice, tice, weasd, tskin, tprcp, stc, ep, & ! --- input/outputs: - & snwdph, qsurf, snowmt, gflux, cmm, chh, evap, hflx, & ! --- outputs: + & snwdph, qsurf, snowmt, gflux, cmm, chh, evap, hflx, & ! + & cplflx, cplchm, flag_cice, islmsk_cice, slmsk, & & errmsg, errflg & ) @@ -200,6 +206,8 @@ subroutine sfc_sice_run & ! --- inputs: integer, intent(in) :: im, km, ipr logical, intent(in) :: lprnt + logical, intent(in) :: cplflx + logical, intent(in) :: cplchm real (kind=kind_phys), intent(in) :: sbc, hvap, tgice, cp, eps, & & epsm1, grav, rvrdm1, t0c, rd, cimin @@ -208,10 +216,12 @@ subroutine sfc_sice_run & & t1, q1, sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, cm, ch, & & prsl1, prslki, ddvel - integer, dimension(im), intent(in) :: islimsk + integer, dimension(im), intent(inout) :: islimsk + integer, dimension(im), intent(in) :: islmsk_cice real (kind=kind_phys), intent(in) :: delt + real (kind=kind_phys), dimension(im), intent(in) :: slmsk - logical, dimension(im), intent(in) :: flag_iter + logical, dimension(im), intent(in) :: flag_iter, flag_cice ! --- input/outputs: real (kind=kind_phys), dimension(im), intent(inout) :: hice, & @@ -238,6 +248,7 @@ subroutine sfc_sice_run & real (kind=kind_phys) :: cpinv, hvapi, elocp integer :: i, k + integer, dimension(im) :: islmsk_LOCAL logical :: flag(im) ! @@ -250,17 +261,42 @@ subroutine sfc_sice_run & ! Initialize CCPP error handling variables errmsg = '' errflg = 0 + + do i = 1, im + islmsk_LOCAL(i) = islimsk(i) + enddo + + if (cplflx) then + do i=1,im + if (flag_cice(i)) then + islmsk_LOCAL (i) = islmsk_cice(i) + endif + enddo + endif + + do i = 1, im + islimsk(i)=islmsk_LOCAL(i) + enddo + + if (cplflx .or. cplchm) then + do i = 1, im + if (flag_cice(i)) then + islimsk(i) = int(slmsk(i)+0.5) + endif + enddo + endif + ! !> - Set flag for sea-ice. do i = 1, im - flag(i) = (islimsk(i) == 2) .and. flag_iter(i) - if (flag_iter(i) .and. islimsk(i) < 2) then + flag(i) = (islmsk_LOCAL(i) == 2) .and. flag_iter(i) + if (flag_iter(i) .and. islmsk_LOCAL(i) < 2) then hice(i) = zero fice(i) = zero endif enddo -! + do i = 1, im if (flag(i)) then if (srflag(i) > zero) then From 2061415b9d64d1ebdb381746e8debb8725240169 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Thu, 15 Aug 2019 15:53:12 -0600 Subject: [PATCH 57/89] physics/docs/ccpplatex_dox: set search path for HTML include files --- physics/docs/ccpplatex_dox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/docs/ccpplatex_dox b/physics/docs/ccpplatex_dox index 5ddd552f5..5d0e68ae0 100644 --- a/physics/docs/ccpplatex_dox +++ b/physics/docs/ccpplatex_dox @@ -189,7 +189,7 @@ EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = EXCLUDE_SYMBOLS = -EXAMPLE_PATH = +EXAMPLE_PATH = . EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO IMAGE_PATH = img From e3977fbabddb0c08cea63b192deca05b64af4f8a Mon Sep 17 00:00:00 2001 From: climbfuji Date: Thu, 15 Aug 2019 16:00:36 -0600 Subject: [PATCH 58/89] Convert ozphys and ozphys_2015 to new metadata format --- physics/ozphys.f | 24 +---- physics/ozphys.meta | 194 +++++++++++++++++++++++++++++++++++++++ physics/ozphys_2015.f | 24 +---- physics/ozphys_2015.meta | 194 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 390 insertions(+), 46 deletions(-) create mode 100644 physics/ozphys.meta create mode 100644 physics/ozphys_2015.meta diff --git a/physics/ozphys.f b/physics/ozphys.f index 4acf87107..73f7d8b20 100644 --- a/physics/ozphys.f +++ b/physics/ozphys.f @@ -28,29 +28,7 @@ end subroutine ozphys_finalize !! Research Laboratory through CHEM2D chemistry model !! (McCormack et al. (2006) \cite mccormack_et_al_2006). !! \section arg_table_ozphys_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|---------------------------------------------------------------------------|----------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | -!! | ko3 | vertical_dimension_of_ozone_forcing_data | number of vertical layers in ozone forcing data | count | 0 | integer | | in | F | -!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | oz | ozone_concentration_updated_by_physics | ozone concentration updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | tin | air_temperature_updated_by_physics | updated air temperature | K | 2 | real | kind_phys | in | F | -!! | po3 | natural_log_of_ozone_forcing_data_pressure_levels | natural log of ozone forcing data pressure levels | log(Pa) | 1 | real | kind_phys | in | F | -!! | prsl | air_pressure | mid-layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | prdout | ozone_forcing | ozone forcing coefficients | various | 3 | real | kind_phys | in | F | -!! | oz_coeff | number_of_coefficients_in_ozone_forcing_data | number of coefficients in ozone forcing data | index | 0 | integer | | in | F | -!! | delp | air_pressure_difference_between_midlayers | difference between mid-layer pressures | Pa | 2 | real | kind_phys | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for calculating 3-D diagnostic fields | flag | 0 | logical | | in | F | -!! | ozp1 | cumulative_change_in_ozone_concentration_due_to_production_and_loss_rate | cumulative change in ozone concentration due to production and loss rate | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ozp2 | cumulative_change_in_ozone_concentration_due_to_ozone_mixing_ratio | cumulative change in ozone concentration due to ozone mixing ratio | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ozp3 | cumulative_change_in_ozone_concentration_due_to_temperature | cumulative change in ozone concentration due to temperature | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ozp4 | cumulative_change_in_ozone_concentration_due_to_overhead_ozone_column | cumulative change in ozone concentration due to overhead ozone column | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | me | mpi_rank | rank of the current MPI task | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude ozphys_run.html !! !> \section genal_ozphys GFS ozphys_run General Algorithm !> @{ diff --git a/physics/ozphys.meta b/physics/ozphys.meta new file mode 100644 index 000000000..80ab9453e --- /dev/null +++ b/physics/ozphys.meta @@ -0,0 +1,194 @@ +[ccpp-arg-table] + name = ozphys_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = ozphys_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = ozphys_run + type = scheme +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of vertical layers + units = count + dimensions = () + type = integer + intent = in + optional = F +[ko3] + standard_name = vertical_dimension_of_ozone_forcing_data + long_name = number of vertical layers in ozone forcing data + units = count + dimensions = () + type = integer + intent = in + optional = F +[dt] + standard_name = time_step_for_physics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[oz] + standard_name = ozone_concentration_updated_by_physics + long_name = ozone concentration updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tin] + standard_name = air_temperature_updated_by_physics + long_name = updated air temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[po3] + standard_name = natural_log_of_ozone_forcing_data_pressure_levels + long_name = natural log of ozone forcing data pressure levels + units = log(Pa) + dimensions = (vertical_dimension_of_ozone_forcing_data) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mid-layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prdout] + standard_name = ozone_forcing + long_name = ozone forcing coefficients + units = various + dimensions = (horizontal_dimension,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_forcing_data) + type = real + kind = kind_phys + intent = in + optional = F +[oz_coeff] + standard_name = number_of_coefficients_in_ozone_forcing_data + long_name = number of coefficients in ozone forcing data + units = index + dimensions = () + type = integer + intent = in + optional = F +[delp] + standard_name = air_pressure_difference_between_midlayers + long_name = difference between mid-layer pressures + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for calculating 3-D diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ozp1] + standard_name = cumulative_change_in_ozone_concentration_due_to_production_and_loss_rate + long_name = cumulative change in ozone concentration due to production and loss rate + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ozp2] + standard_name = cumulative_change_in_ozone_concentration_due_to_ozone_mixing_ratio + long_name = cumulative change in ozone concentration due to ozone mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ozp3] + standard_name = cumulative_change_in_ozone_concentration_due_to_temperature + long_name = cumulative change in ozone concentration due to temperature + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ozp4] + standard_name = cumulative_change_in_ozone_concentration_due_to_overhead_ozone_column + long_name = cumulative change in ozone concentration due to overhead ozone column + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[me] + standard_name = mpi_rank + long_name = rank of the current MPI task + units = index + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/ozphys_2015.f b/physics/ozphys_2015.f index 0e7e11484..6983f58e2 100644 --- a/physics/ozphys_2015.f +++ b/physics/ozphys_2015.f @@ -27,29 +27,7 @@ end subroutine ozphys_2015_finalize !! Research Laboratory through CHEM2D chemistry model !! (McCormack et al. (2006) \cite mccormack_et_al_2006). !! \section arg_table_ozphys_2015_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------------------------|----------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | -!! | ko3 | vertical_dimension_of_ozone_forcing_data | number of vertical layers in ozone forcing data | count | 0 | integer | | in | F | -!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | oz | ozone_concentration_updated_by_physics | ozone concentration updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | tin | air_temperature_updated_by_physics | updated air temperature | K | 2 | real | kind_phys | in | F | -!! | po3 | natural_log_of_ozone_forcing_data_pressure_levels | natural log of ozone forcing data pressure levels | log(Pa) | 1 | real | kind_phys | in | F | -!! | prsl | air_pressure | mid-layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | prdout | ozone_forcing | ozone forcing data | various | 3 | real | kind_phys | in | F | -!! | pl_coeff | number_of_coefficients_in_ozone_forcing_data | number of coefficients in ozone forcing data | index | 0 | integer | | in | F | -!! | delp | air_pressure_difference_between_midlayers | difference between mid-layer pressures | Pa | 2 | real | kind_phys | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for calculating 3-D diagnostic fields | flag | 0 | logical | | in | F | -!! | ozp1 | cumulative_change_in_ozone_concentration_due_to_production_and_loss_rate | cumulative change in ozone concentration due to production and loss rate | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ozp2 | cumulative_change_in_ozone_concentration_due_to_ozone_mixing_ratio | cumulative change in ozone concentration due to ozone mixing ratio | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ozp3 | cumulative_change_in_ozone_concentration_due_to_temperature | cumulative change in ozone concentration due to temperature | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ozp4 | cumulative_change_in_ozone_concentration_due_to_overhead_ozone_column | cumulative change in ozone concentration due to overhead ozone column | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | me | mpi_rank | rank of the current MPI task | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude ozphys_2015_run.html !! !> \section genal_ozphys_2015 GFS ozphys_2015_run General Algorithm !> @{ diff --git a/physics/ozphys_2015.meta b/physics/ozphys_2015.meta new file mode 100644 index 000000000..e9eb7d5a5 --- /dev/null +++ b/physics/ozphys_2015.meta @@ -0,0 +1,194 @@ +[ccpp-arg-table] + name = ozphys_2015_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = ozphys_2015_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = ozphys_2015_run + type = scheme +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of vertical layers + units = count + dimensions = () + type = integer + intent = in + optional = F +[ko3] + standard_name = vertical_dimension_of_ozone_forcing_data + long_name = number of vertical layers in ozone forcing data + units = count + dimensions = () + type = integer + intent = in + optional = F +[dt] + standard_name = time_step_for_physics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[oz] + standard_name = ozone_concentration_updated_by_physics + long_name = ozone concentration updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tin] + standard_name = air_temperature_updated_by_physics + long_name = updated air temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[po3] + standard_name = natural_log_of_ozone_forcing_data_pressure_levels + long_name = natural log of ozone forcing data pressure levels + units = log(Pa) + dimensions = (vertical_dimension_of_ozone_forcing_data) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mid-layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prdout] + standard_name = ozone_forcing + long_name = ozone forcing data + units = various + dimensions = (horizontal_dimension,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_forcing_data) + type = real + kind = kind_phys + intent = in + optional = F +[pl_coeff] + standard_name = number_of_coefficients_in_ozone_forcing_data + long_name = number of coefficients in ozone forcing data + units = index + dimensions = () + type = integer + intent = in + optional = F +[delp] + standard_name = air_pressure_difference_between_midlayers + long_name = difference between mid-layer pressures + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for calculating 3-D diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ozp1] + standard_name = cumulative_change_in_ozone_concentration_due_to_production_and_loss_rate + long_name = cumulative change in ozone concentration due to production and loss rate + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ozp2] + standard_name = cumulative_change_in_ozone_concentration_due_to_ozone_mixing_ratio + long_name = cumulative change in ozone concentration due to ozone mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ozp3] + standard_name = cumulative_change_in_ozone_concentration_due_to_temperature + long_name = cumulative change in ozone concentration due to temperature + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ozp4] + standard_name = cumulative_change_in_ozone_concentration_due_to_overhead_ozone_column + long_name = cumulative change in ozone concentration due to overhead ozone column + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[me] + standard_name = mpi_rank + long_name = rank of the current MPI task + units = index + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F From 94461c626296c23987a9976549caf43aa89b7af1 Mon Sep 17 00:00:00 2001 From: Weiwei Li Date: Sun, 30 Jun 2019 15:03:33 -0600 Subject: [PATCH 59/89] new file: physics/GFS_GWD_generic.F90 (same content as in gwdps.f but with a generic name because both gwdps and ugwp use the _pre part) new file: physics/cires_ugwp.F90 new file: physics/cires_ugwp_post.F90 new file: physics/cires_ugwp_initialize.F90 new file: physics/cires_ugwp_module.F90 new file: physics/cires_ugwp_solvers.F90 new file: physics/cires_ugwp_triggers.F90 new file: physics/cires_ugwp_utils.F90 new file: physics/cires_vert_lsatdis.F90 new file: physics/cires_vert_orodis.F90 new file: physics/cires_vert_wmsdis.F90 new file: physics/cires_orowam2017.f new file: physics/ugwp_driver_v0.f --- physics/GFS_GWD_generic.F90 | 1566 ++++++++++++++++++++++ physics/cires_orowam2017.f | 339 +++++ physics/cires_ugwp.F90 | 363 ++++++ physics/cires_ugwp_initialize.F90 | 710 ++++++++++ physics/cires_ugwp_module.F90 | 670 ++++++++++ physics/cires_ugwp_post.F90 | 115 ++ physics/cires_ugwp_solvers.F90 | 664 ++++++++++ physics/cires_ugwp_triggers.F90 | 573 ++++++++ physics/cires_ugwp_utils.F90 | 152 +++ physics/cires_vert_lsatdis.F90 | 524 ++++++++ physics/cires_vert_orodis.F90 | 1018 +++++++++++++++ physics/cires_vert_wmsdis.F90 | 425 ++++++ physics/ugwp_driver_v0.f | 2008 +++++++++++++++++++++++++++++ 13 files changed, 9127 insertions(+) create mode 100644 physics/GFS_GWD_generic.F90 create mode 100644 physics/cires_orowam2017.f create mode 100644 physics/cires_ugwp.F90 create mode 100644 physics/cires_ugwp_initialize.F90 create mode 100644 physics/cires_ugwp_module.F90 create mode 100755 physics/cires_ugwp_post.F90 create mode 100644 physics/cires_ugwp_solvers.F90 create mode 100644 physics/cires_ugwp_triggers.F90 create mode 100644 physics/cires_ugwp_utils.F90 create mode 100644 physics/cires_vert_lsatdis.F90 create mode 100644 physics/cires_vert_orodis.F90 create mode 100644 physics/cires_vert_wmsdis.F90 create mode 100644 physics/ugwp_driver_v0.f diff --git a/physics/GFS_GWD_generic.F90 b/physics/GFS_GWD_generic.F90 new file mode 100644 index 000000000..94e7c6ffc --- /dev/null +++ b/physics/GFS_GWD_generic.F90 @@ -0,0 +1,1566 @@ +!> \file GFS_GWD_generic.f +!! This file is the parameterization of orographic gravity wave +!! drag and mountain blocking. + +!> This module contains the CCPP-compliant orographic gravity wave +!! drag pre interstitial codes. + module GFS_GWD_generic_pre + + contains + +!> \section arg_table_GFS_GWD_generic_pre_init Argument Table +!! + subroutine GFS_GWD_generic_pre_init() + end subroutine GFS_GWD_generic_pre_init + +!! \section arg_table_GFS_GWD_generic_pre_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|-------------------------------------------------------------------------|------------------------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| +!! | im | horizontal_loop_extent | horizontal dimension | count | 0 | integer | | in | F | +!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | +!! | nmtvr | number_of_statistical_measures_of_subgrid_orography | number of statistical measures of subgrid orography | count | 0 | integer | | in | F | +!! | mntvar | statistical_measures_of_subgrid_orography | array of statistical measures of subgrid orography | various | 2 | real | kind_phys | in | F | +!! | hprime | standard_deviation_of_subgrid_orography | standard deviation of subgrid orography | m | 1 | real | kind_phys | out | F | +!! | oc | convexity_of_subgrid_orography | convexity of subgrid orography | none | 1 | real | kind_phys | out | F | +!! | oa4 | asymmetry_of_subgrid_orography | asymmetry of subgrid orography | none | 2 | real | kind_phys | out | F | +!! | clx | fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height | horizontal fraction of grid box covered by subgrid orography higher than critical height | frac | 2 | real | kind_phys | out | F | +!! | theta | angle_from_east_of_maximum_subgrid_orographic_variations | angle with_respect to east of maximum subgrid orographic variations | degrees | 1 | real | kind_phys | out | F | +!! | sigma | slope_of_subgrid_orography | slope of subgrid orography | none | 1 | real | kind_phys | out | F | +!! | gamma | anisotropy_of_subgrid_orography | anisotropy of subgrid orography | none | 1 | real | kind_phys | out | F | +!! | elvmax | maximum_subgrid_orography | maximum of subgrid orography | m | 1 | real | kind_phys | out | F | +!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | +!! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | +!! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | in | F | +!! | dt3dt | cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag | cumulative change in temperature due to orographic gravity wave drag | K | 2 | real | kind_phys | inout | F | +!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +!! \section general General Algorithm +!! \section detailed Detailed Algorithm +!! @{ + subroutine GFS_GWD_generic_pre_run( & + & im, levs, nmtvr, mntvar, & + & hprime, oc, oa4, clx, theta, & + & sigma, gamma, elvmax, lssav, ldiag3d, & + & dtdt, dt3dt, dtf, errmsg, errflg) + + use machine, only : kind_phys + implicit none + + integer, intent(in) :: im, levs, nmtvr + real(kind=kind_phys), intent(in) :: mntvar(im,nmtvr) + + real(kind=kind_phys), intent(out) :: & + & hprime(im), oc(im), oa4(im,4), clx(im,4), & + & theta(im), sigma(im), gamma(im), elvmax(im) + + logical, intent(in) :: lssav, ldiag3d + real(kind=kind_phys), intent(in) :: dtdt(im,levs) + ! dt3dt only allocated only if ldiag3d is .true. + real(kind=kind_phys), intent(inout) :: dt3dt(:,:) + real(kind=kind_phys), intent(in) :: dtf + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + integer :: i, k + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (nmtvr == 14) then ! current operational - as of 2014 + hprime(:) = mntvar(:,1) + oc(:) = mntvar(:,2) + oa4(:,1) = mntvar(:,3) + oa4(:,2) = mntvar(:,4) + oa4(:,3) = mntvar(:,5) + oa4(:,4) = mntvar(:,6) + clx(:,1) = mntvar(:,7) + clx(:,2) = mntvar(:,8) + clx(:,3) = mntvar(:,9) + clx(:,4) = mntvar(:,10) + theta(:) = mntvar(:,11) + gamma(:) = mntvar(:,12) + sigma(:) = mntvar(:,13) + elvmax(:) = mntvar(:,14) + elseif (nmtvr == 10) then + hprime(:) = mntvar(:,1) + oc(:) = mntvar(:,2) + oa4(:,1) = mntvar(:,3) + oa4(:,2) = mntvar(:,4) + oa4(:,3) = mntvar(:,5) + oa4(:,4) = mntvar(:,6) + clx(:,1) = mntvar(:,7) + clx(:,2) = mntvar(:,8) + clx(:,3) = mntvar(:,9) + clx(:,4) = mntvar(:,10) + elseif (nmtvr == 6) then + hprime(:) = mntvar(:,1) + oc(:) = mntvar(:,2) + oa4(:,1) = mntvar(:,3) + oa4(:,2) = mntvar(:,4) + oa4(:,3) = mntvar(:,5) + oa4(:,4) = mntvar(:,6) + clx(:,1) = 0.0 + clx(:,2) = 0.0 + clx(:,3) = 0.0 + clx(:,4) = 0.0 + else + hprime = 0 + oc = 0 + oa4 = 0 + clx = 0 + theta = 0 + gamma = 0 + sigma = 0 + elvmax = 0 + endif ! end if_nmtvr + + if (lssav) then + if (ldiag3d) then + do k=1,levs + do i=1,im + dt3dt(i,k) = dt3dt(i,k) - dtdt(i,k)*dtf + enddo + enddo + endif + endif + + end subroutine GFS_GWD_generic_pre_run +!> @} + +! \ingroup GFS_ogwd +! \brief Brief description of the subroutine +! +!> \section arg_table_GFS_GWD_generic_pre_finalize Argument Table +!! + subroutine GFS_GWD_generic_pre_finalize() + end subroutine GFS_GWD_generic_pre_finalize + + end module GFS_GWD_generic_pre + +!> This module contains the CCPP-compliant orographic gravity wave dray scheme. + module GFS_GWD_generic + + contains + +!> \section arg_table_GFS_GWD_generic_init Argument Table +!! + subroutine GFS_GWD_generic_init() + end subroutine GFS_GWD_generic_init + +!> \defgroup gfs_GFS_GWD_generic GFS Orographic Gravity Wave Drag and Mountain Blocking Scheme Module +!! \brief This subroutine includes orographic gravity wave drag and mountain +!! blocking. +!! +!> The time tendencies of zonal and meridional wind are altered to +!! include the effect of mountain induced gravity wave drag from +!! subgrid scale orography including convective breaking, shear +!! breaking and the presence of critical levels. +!! +!! \section arg_table_GFS_GWD_generic_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|-------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | +!! | km | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | +!! | A | tendency_of_y_wind_due_to_model_physics | meridional wind tendency due to model physics | m s-2 | 2 | real | kind_phys | inout | F | +!! | B | tendency_of_x_wind_due_to_model_physics | zonal wind tendency due to model physics | m s-2 | 2 | real | kind_phys | inout | F | +!! | C | tendency_of_air_temperature_due_to_model_physics | air temperature tendency due to model physics | K s-1 | 2 | real | kind_phys | inout | F | +!! | u1 | x_wind | zonal wind | m s-1 | 2 | real | kind_phys | in | F | +!! | v1 | y_wind | meridional wind | m s-1 | 2 | real | kind_phys | in | F | +!! | t1 | air_temperature | mid-layer temperature | K | 2 | real | kind_phys | in | F | +!! | q1 | water_vapor_specific_humidity | mid-layer specific humidity of water vapor | kg kg-1 | 2 | real | kind_phys | in | F | +!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | vertical index at top atmospheric boundary layer | index | 1 | integer | | in | F | +!! | prsi | air_pressure_at_interface | interface pressure | Pa | 2 | real | kind_phys | in | F | +!! | del | air_pressure_difference_between_midlayers | difference between mid-layer pressures | Pa | 2 | real | kind_phys | in | F | +!! | prsl | air_pressure | mid-layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | prslk | dimensionless_exner_function_at_model_layers | mid-layer Exner function | none | 2 | real | kind_phys | in | F | +!! | phii | geopotential_at_interface | interface geopotential | m2 s-2 | 2 | real | kind_phys | in | F | +!! | phil | geopotential | mid-layer geopotential | m2 s-2 | 2 | real | kind_phys | in | F | +!! | deltim | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | +!! | kdt | index_of_time_step | current time step index | index | 0 | integer | | in | F | +!! | hprime | standard_deviation_of_subgrid_orography | standard deviation of subgrid orography | m | 1 | real | kind_phys | in | F | +!! | oc | convexity_of_subgrid_orography | convexity of subgrid orography | none | 1 | real | kind_phys | in | F | +!! | oa4 | asymmetry_of_subgrid_orography | asymmetry of subgrid orography | none | 2 | real | kind_phys | in | F | +!! | clx4 | fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height | horizontal fraction of grid box covered by subgrid orography higher than critical height | frac | 2 | real | kind_phys | in | F | +!! | theta | angle_from_east_of_maximum_subgrid_orographic_variations | angle with respect to east of maximum subgrid orographic variations | degrees | 1 | real | kind_phys | in | F | +!! | sigma | slope_of_subgrid_orography | slope of subgrid orography | none | 1 | real | kind_phys | in | F | +!! | gamma | anisotropy_of_subgrid_orography | anisotropy of subgrid orography | none | 1 | real | kind_phys | in | F | +!! | elvmax | maximum_subgrid_orography | maximum of subgrid orography | m | 1 | real | kind_phys | inout | F | +!! | dusfc | instantaneous_x_stress_due_to_gravity_wave_drag | zonal surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | out | F | +!! | dvsfc | instantaneous_y_stress_due_to_gravity_wave_drag | meridional surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | out | F | +!! | g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | +!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | +!! | imx | number_of_equatorial_longitude_points | number of longitude points along the equator | count | 0 | integer | | in | F | +!! | nmtvr | number_of_statistical_measures_of_subgrid_orography | number of statistical measures of subgrid orography | count | 0 | integer | | in | F | +!! | cdmbgwd | multiplication_factors_for_mountain_blocking_and_orographic_gravity_wave_drag | multiplic. factors for (1) mountain blocking drag coeff. and (2) ref. level orographic gravity wave drag | none | 1 | real | kind_phys | in | F | +!! | me | mpi_rank | rank of the current MPI task | index | 0 | integer | | in | F | +!! | lprnt | flag_print | flag for debugging printouts | flag | 0 | logical | | in | F | +!! | ipr | horizontal_index_of_printed_column | horizontal index of column used in debugging printouts | index | 0 | integer | | in | F | +!! | rdxzb | level_of_dividing_streamline | level of the dividing streamline | none | 1 | real | kind_phys | out | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +!> \section gen_GFS_GWD_generic GFS Orographic GWD Scheme General Algorithm +!! -# Calculate subgrid mountain blocking +!! -# Calculate orographic wave drag +!! +!! The NWP model gravity wave drag (GWD) scheme in the GFS has two +!! main components: how the surface stress is computed, and then how +!! that stress is distributed over a vertical column where it may +!! interact with the models momentum. Each of these depends on the +!! large scale environmental atmospheric state and assumptions about +!! the sub-grid scale processes. In Alpert GWD (1987) based on linear, +!! two-dimensional non-rotating, stably stratified flow over a mountain ridge, +!! sub-grid scale gravity wave motions are assumed which propagate away +!! from the mountain. Described in Alpert (1987), the flux measured over +!! a "low level" vertically averaged layer, in the atmosphere defines a base +!! level flux. "Low level" was taken to be the first 1/3 of the troposphere +!! in the 1987 implementation. This choice was meant to encompass a thick +!! low layer for vertical averages of the environmental (large scale) flow +!! quantities. The vertical momentum flux or gravity wave stress in a +!! grid box due to a single mountain is given as in Pierrehumbert(1986) +!! \cite pierrehumbert_1986 : +!! \f[ +!! \tau = \frac {\rho \: U^{3}\: G(F_{r})} {\Delta X \; N } +!! \f] +!! where \f$ \Delta X \f$ is a grid increment, N is the Brunt Viasala frequency +!! \f[ +!! N(\sigma) = \frac{-g \: \sigma \: +!! \frac{\partial\Theta}{\partial\sigma}}{\Theta \:R \:T} +!! \f] +!! The environmental variables are calculated from a mass weighted vertical +!! average over a base layer. \f$G(F_{r})\f$ is a monotonically increasing +!! function of Froude number : +!! \f[ +!! F_{r} = \frac{N h^{'}}{U} +!! \f] +!! where \f$U\f$ is the wind speed calculated as a mass weighted vertical average in +!! the base layer, and \f$h^{'}\f$, is the vertical displacement caused by the orography +!! variance. An effective mountain length for the gravity wave processes: +!! \f[ +!! l^{*} = \frac{\Delta X}{m} +!! \f] +!! where \f$m\f$ is the number of mountains in a grid box, can then +!! be defined to obtain the form of the base level stress +!! \f[ +!! \tau = \frac {\rho \: U^{3} \: G(F_{r})} {N \;l^{*}} +!! \f] +!! giving the stress induced from the surface in a model grid box. +!! Pierrehumbert(1986) \cite pierrehumbert_1986 gives the form +!! for the function \f$G(F_{r})\f$ as +!! \f[ +!! G(F_{r}) = \bar{G}\frac{F^{2}_{r}}{F^{2}_{r}\: + \:a^{2}} +!! \f] +!! Where \f$ \bar{G} \f$ is an order unity non-dimensional saturation +!! flux set to 1 and \f$a\f$ is a function of the mountain aspect ratio also +!!set to 1 in the 1987 implementation of the GFS GWD. Typical values of +!! U=10m/s, N=0.01 1/s, l*=100km, and a=1, gives a flux of 1 Pascal and +!! if this flux is made to go to zero linearly with height then the +!! decelerations would be about 10/m/s/day which is consistent with +!! observations in PH. +!! +!! In Kim, Moorthi, Alpert's (1998, 2001) GWD currently in GFS operations, +!! the GWD scheme has the same physical basis as in Alpert (1987) with the addition +!! of enhancement factors for the amplitude, G, and mountain shape details +!! in G(Fr) to account for effects from the mountain blocking. A factor, +!! E m’, is an enhancement factor on the stress in the Alpert '87 scheme. +!! The E ranges from no enhancement to an upper limit of 3, E=E(OA)[1-3], +!! and is a function of OA, the Orographic Asymmetry defined in Kim and Arakawa (1995) +!! \cite kim_and_arakawa_1995 as +!! Orographic Asymmetry (OA): +!! \f[ +!! OA=\frac{ \bar{x} \; - \; +!! \sum\limits_{j=1}^{N_{b}} x_{j} \; n_{j} }{\sigma_{x}} +!! \f] +!! where \f$N_{b}\f$ is the total number of bottom blocks in the mountain barrier, +!! \f$ \sigma_{x} \f$ is the standard deviation of the horizontal distance defined by +!!\f[ +!! \sigma_{x} = \sqrt{ \frac{\sum\limits_{j=1}^{N_{b}} +!! \; (x_{j} \; - \; \bar{x} )^2}{N_{x}} } +!!\f] +!! where \f$N_{x}\f$ is the number of grid intervals for the large scale domain being +!! considered. So the term, E(OA)m’/ \f$ \Delta X \f$ in Kim's scheme represents +!! a multiplier on G shown in Alpert's eq (1), where m’ is the number of mountains +!! in a sub-grid scale box. Kim increased the complexity of m’ making it a +!! function of the fractional area of the sub-grid mountain and the asymmetry +!! and convexity statistics which are found from running a gravity wave +!! model for a large number of cases: +!! \f[ +!! m^{'} = C_{m} \Delta X \left[ \frac{1 \; + \; +!! \sum\limits_{x} L_{h} }{\Delta X} \right]^{OA+1} +!! \f] +!! Where, according to Kim, \f$ \sum \frac{L_{h}}{\Delta X} \f$ is +!! the fractional area covered by the subgrid-scale orography higher than +!! a critical height \f$ h_{c} = Fr_{c} U_{0}/N_{0} \f$ , over the +!! "low level" vertically averaged layer, for a grid box with the interval +!! \f$ \Delta X \f$. Each \f$ L_{n}\f$ is the width of a segment of +!! orography intersection at the critical height: +!! \f[ +!! Fr_{0} = \frac{N_{0} \; h^{'}}{U_{0}} +!! \f] +!! \f[ +!! G^{'}(OC,Fr_{0}) = \frac{Fr_{0}^{2}}{Fr_{0}^{2} \; + \; a^{2}} +!! \f] +!! \f[ +!! a^{2} = \frac{C_{G}}{OC} +!! \f] +!! \f[ +!! E(OA, Fr_{0}) = (OA \; + \; 2)^{\delta} +!! \f] +!! and +!! \f[ +!! \delta \; = \; \frac{C_{E} \; Fr_{0}}{Fr_{c}} +!! \f] +!! where \f$ Fr_{c} \f$ is as in Alpert. +!! +!! This represents a closed scheme, somewhat empirical adjustments +!! to the original scheme to calculate the surface stress. +!! +!! Momentum is deposited by the sub-grid scale gravity waves break due +!! to the presence of convective mixing assumed to occur when the +!! minimum Richardson number: +!! +!! Orographic Convexity (OC) = +!! \f[ +!! OC=\frac{ \sum\limits_{j=1}^{N_{x}} +!! \; (h_{j} \; - \; \bar{h})^4 }{N_{x} \;\sigma_{h}^4} +!! \f] +!! and where +!! \f[ +!! \sigma_{h} = \sqrt{ \frac{\sum\limits_{j=1}^{N_{x}} +!! \; (h_{j} \; - \; \bar{h} )^2}{N_{x}} } +!! \f] +!! This represents a closed scheme, somewhat empirical adjustments +!! to the original scheme to calculate the surface stress. +!! +!! Momentum is deposited by the sub-grid scale gravity waves break due +!! to the presence of convective mixing assumed to occur when +!! the minimum Richardson number: +!! \f[ +!! Ri_{m} = \frac{Ri(1 \; - \; Fr)}{(1 \; + \; \sqrt{Ri}Fr)^2} +!! \f] +!! Is less than 1/4 Or if critical layers are encountered in a layer +!! the the momentum flux will vanish. The critical layer is defined +!! when the base layer wind becomes perpendicular to the environmental +!! wind. Otherwise, wave breaking occurs at a level where the amplification +!! of the wave causes the local Froude number or similarly a truncated +!! (first term of the) Scorer parameter, to be reduced below a critical +!! value by the saturation hypothesis (Lindzen). This is done through +!! eq 1 which can be written as +!! \f[ +!! \tau = \rho U N k h^{'2} +!! \f] +!! For small Froude number this is discretized in the vertical so at each +!! level the stress is reduced by ratio of the Froude or truncated Scorer +!! parameter, \f$ \frac{U^{2}}{N^{2}} = \frac{N \tau_{l-1}}{\rho U^{3} k} \f$ , +!! where the stress is from the layer below beginning with that found near +!! the surface. The respective change in momentum is applied in +!! that layer building up from below. +!! +!! An amplitude factor is part of the calibration of this scheme which is +!! a function of the model resolution and the vertical diffusion. This +!! is because the vertical diffusion and the GWD account encompass +!! similar physical processes. Thus, one needs to run the model over +!! and over for various amplitude factors for GWD and vertical diffusion. +!! +!! In addition, there is also mountain blocking from lift and frictional +!! forces. Improved integration between how the GWD is calculated and +!! the mountain blocking of wind flow around sub-grid scale orography +!! is underway at NCEP. The GFS already has convectively forced GWD +!! an independent process. +!! +!> \section det_GFS_GWD_generic GFS Orographic GWD Scheme Detailed Algorithm +!> @{ + subroutine GFS_GWD_generic_run( & + & IM,IX,KM,A,B,C,U1,V1,T1,Q1,KPBL, & + & PRSI,DEL,PRSL,PRSLK,PHII, PHIL,DELTIM,KDT, & + & HPRIME,OC,OA4,CLX4,THETA,SIGMA,GAMMA,ELVMAX, & + & DUSFC,DVSFC,G, CP, RD, RV, IMX, & + & nmtvr, cdmbgwd, me, lprnt, ipr, rdxzb, errmsg, errflg) +! +! ******************************************************************** +! -----> I M P L E M E N T A T I O N V E R S I O N <---------- +! +! --- Not in this code -- History of GWDP at NCEP---- +! ---------------- ----------------------- +! VERSION 3 MODIFIED FOR GRAVITY WAVES, LOCATION: .FR30(V3GWD) *J* +!--- 3.1 INCLUDES VARIABLE SATURATION FLUX PROFILE CF ISIGST +!--- 3.G INCLUDES PS COMBINED W/ PH (GLAS AND GFDL) +!----- ALSO INCLUDED IS RI SMOOTH OVER A THICK LOWER LAYER +!----- ALSO INCLUDED IS DECREASE IN DE-ACC AT TOP BY 1/2 +!----- THE NMC GWD INCORPORATING BOTH GLAS(P&S) AND GFDL(MIGWD) +!----- MOUNTAIN INDUCED GRAVITY WAVE DRAG +!----- CODE FROM .FR30(V3MONNX) FOR MONIN3 +!----- THIS VERSION (06 MAR 1987) +!----- THIS VERSION (26 APR 1987) 3.G +!----- THIS VERSION (01 MAY 1987) 3.9 +!----- CHANGE TO FORTRAN 77 (FEB 1989) --- HANN-MING HENRY JUANG +!----- 20070601 ELVMAX bug fix (*j*) +! +! VERSION 4 +! ----- This code ----- +! +!----- MODIFIED TO IMPLEMENT THE ENHANCED LOW TROPOSPHERIC GRAVITY +!----- WAVE DRAG DEVELOPED BY KIM AND ARAKAWA(JAS, 1995). +! Orographic Std Dev (hprime), Convexity (OC), Asymmetry (OA4) +! and Lx (CLX4) are input topographic statistics needed. +! +!----- PROGRAMMED AND DEBUGGED BY HONG, ALPERT AND KIM --- JAN 1996. +!----- debugged again - moorthi and iredell --- may 1998. +!----- +! Further Cleanup, optimization and modification +! - S. Moorthi May 98, March 99. +!----- modified for usgs orography data (ncep office note 424) +! and with several bugs fixed - moorthi and hong --- july 1999. +! +!----- Modified & implemented into NRL NOGAPS +! - Young-Joon Kim, July 2000 +!----- +! VERSION lm MB (6): oz fix 8/2003 +! ----- This code ----- +! +!------ Changed to include the Lott and Miller Mtn Blocking +! with some modifications by (*j*) 4/02 +! From a Principal Coordinate calculation using the +! Hi Res 8 minute orography, the Angle of the +! mtn with that to the East (x) axis is THETA, the slope +! parameter SIGMA. The anisotropy is in GAMMA - all are input +! topographic statistics needed. These are calculated off-line +! as a function of model resolution in the fortran code ml01rg2.f, +! with script mlb2.sh. (*j*) +!----- GFS_GWD_generic_mb.f version (following lmi) elvmax < hncrit (*j*) +! MB3a expt to enhance elvmax mtn hgt see sigfac & hncrit +! GFS_GWD_generic_GWDFIX_v6.f FIXGWD GF6.0 20070608 sigfac=4. +!----- +!----------------------------------------------------------------------C +! USE +! ROUTINE IS CALLED FROM GBPHYS (AFTER CALL TO MONNIN) +! +! PURPOSE +! USING THE GWD PARAMETERIZATIONS OF PS-GLAS AND PH- +! GFDL TECHNIQUE. THE TIME TENDENCIES OF U V +! ARE ALTERED TO INCLUDE THE EFFECT OF MOUNTAIN INDUCED +! GRAVITY WAVE DRAG FROM SUB-GRID SCALE OROGRAPHY INCLUDING +! CONVECTIVE BREAKING, SHEAR BREAKING AND THE PRESENCE OF +! CRITICAL LEVELS +! +! INPUT +! A(IX,KM) NON-LIN TENDENCY FOR V WIND COMPONENT +! B(IX,KM) NON-LIN TENDENCY FOR U WIND COMPONENT +! C(IX,KM) NON-LIN TENDENCY FOR TEMPERATURE +! U1(IX,KM) ZONAL WIND M/SEC AT T0-DT +! V1(IX,KM) MERIDIONAL WIND M/SEC AT T0-DT +! T1(IX,KM) TEMPERATURE DEG K AT T0-DT +! Q1(IX,KM) SPECIFIC HUMIDITY AT T0-DT +! +! DELTIM TIME STEP SECS +! SI(N) P/PSFC AT BASE OF LAYER N +! SL(N) P/PSFC AT MIDDLE OF LAYER N +! DEL(N) POSITIVE INCREMENT OF P/PSFC ACROSS LAYER N +! KPBL(IM) is the index of the top layer of the PBL +! ipr & lprnt for diagnostics +! +! OUTPUT +! A, B AS AUGMENTED BY TENDENCY DUE TO GWDPS +! OTHER INPUT VARIABLES UNMODIFIED. +! revision log: +! May 2013 J. Wang change cleff back to opn setting +! Jan 2014 J. Wang merge Henry and Fangin's dissipation heat in gfs to nems +! +! +! ******************************************************************** + USE MACHINE , ONLY : kind_phys + implicit none +! + ! Interface variables + integer, intent(in) :: im, ix, km, imx, kdt, ipr, me + integer, intent(in) :: KPBL(IM) ! Index for the PBL top layer! + ! DH* adding intent(in) information for the following variables + ! changes the results on Theia/Intel - skip for bit-for-bit results *DH +! real(kind=kind_phys), intent(in) :: & +! & deltim, G, CP, RD, RV, cdmbgwd(2) + real(kind=kind_phys) deltim, G, CP, RD, RV, cdmbgwd(2) + ! *DH + real(kind=kind_phys), intent(inout) :: & + & A(IX,KM), B(IX,KM), C(IX,KM) + real(kind=kind_phys), intent(in) :: & + & U1(IX,KM), V1(IX,KM), T1(IX,KM), & + & Q1(IX,KM), PRSI(IX,KM+1), DEL(IX,KM), & + & PRSL(IX,KM), PRSLK(IX,KM), PHIL(IX,KM), & + & PHII(IX,KM+1) + real(kind=kind_phys), intent(in) :: & + & OC(IM), OA4(IX,4), CLX4(IX,4), HPRIME(IM) + real(kind=kind_phys), intent(inout) :: ELVMAX(IM) + real(kind=kind_phys), intent(in) :: & + & THETA(IM), SIGMA(IM), GAMMA(IM) + real(kind=kind_phys), intent(out) :: DUSFC(IM), DVSFC(IM), & + & RDXZB(IX) + integer, intent(in) :: nmtvr + logical, intent(in) :: lprnt + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +! + ! Local variables +! for lm mtn blocking + real(kind=kind_phys) wk(IM) + real(kind=kind_phys) bnv2lm(IM,KM),PE(IM),EK(IM),ZBK(IM),UP(IM) + real(kind=kind_phys) DB(IM,KM),ANG(IM,KM),UDS(IM,KM) + real(kind=kind_phys) ZLEN, DBTMP, Rtrm, PHIANG, CDmb, DBIM, ZR + real(kind=kind_phys) ENG0, ENG1 +! +! Some constants +! + real(kind=kind_phys) pi, dw2min, rimin, ric, bnv2min, efmin & + &, efmax,hpmax,hpmin, rad_to_deg, deg_to_rad + PARAMETER (PI=3.1415926535897931) + PARAMETER (RAD_TO_DEG=180.0/PI, DEG_TO_RAD=PI/180.0) + PARAMETER (DW2MIN=1., RIMIN=-100., RIC=0.25, BNV2MIN=1.0E-5) +! PARAMETER (EFMIN=0.0, EFMAX=10.0, hpmax=200.0) + PARAMETER (EFMIN=0.0, EFMAX=10.0, hpmax=2400.0, hpmin=1.0) +! + real(kind=kind_phys) FRC, CE, CEOFRC, frmax, CG, GMAX & + &, VELEPS, FACTOP, RLOLEV, RDI +! &, CRITAC, VELEPS, FACTOP, RLOLEV, RDI + parameter (FRC=1.0, CE=0.8, CEOFRC=CE/FRC, frmax=100., CG=0.5) + parameter (GMAX=1.0, VELEPS=1.0, FACTOP=0.5) +! parameter (GMAX=1.0, CRITAC=5.0E-4, VELEPS=1.0, FACTOP=0.5) + parameter (RLOLEV=50000.0) +! parameter (RLOLEV=500.0) +! parameter (RLOLEV=0.5) +! + real(kind=kind_phys) dpmin,hminmt,hncrit,minwnd,sigfac +! --- for lm mtn blocking +! parameter (cdmb = 1.0) !< non-dim sub grid mtn drag Amp (*j*) + parameter (hncrit=8000.) !< Max value in meters for ELVMAX (*j*) +! hncrit set to 8000m and sigfac added to enhance elvmax mtn hgt + parameter (sigfac=4.0) !< MB3a expt test for ELVMAX factor (*j*) + parameter (hminmt=50.) !< min mtn height (*j*) + parameter (minwnd=0.1) !< min wind component (*j*) + +! parameter (dpmin=00.0) !< Minimum thickness of the reference layer +!! parameter (dpmin=05.0) !< Minimum thickness of the reference layer +! parameter (dpmin=20.0) !< Minimum thickness of the reference layer + !< in centibars + parameter (dpmin=5000.0) !< Minimum thickness of the reference layer + !< in Pa +! + real(kind=kind_phys) FDIR + integer mdir + parameter(mdir=8, FDIR=mdir/(PI+PI)) + integer nwdir(mdir) + data nwdir/6,7,5,8,2,3,1,4/ + save nwdir +! + LOGICAL ICRILV(IM) +! +!---- MOUNTAIN INDUCED GRAVITY WAVE DRAG +! + real(kind=kind_phys) TAUB(IM), XN(IM), YN(IM), UBAR(IM) & + &, VBAR(IM), ULOW(IM), OA(IM), CLX(IM) & + &, ROLL(IM), ULOI(IM) & + &, DTFAC(IM), XLINV(IM), DELKS(IM), DELKS1(IM) +! + real(kind=kind_phys) BNV2(IM,KM), TAUP(IM,KM+1), ri_n(IM,KM) & + &, TAUD(IM,KM), RO(IM,KM), VTK(IM,KM) & + &, VTJ(IM,KM), SCOR(IM), VELCO(IM,KM-1) & + &, bnv2bar(im) +! +! real(kind=kind_phys) VELKO(KM-1) + integer kref(IM), kint(im), iwk(im), ipt(im) +! for lm mtn blocking + integer kreflm(IM), iwklm(im) + integer idxzb(im), ktrial, klevm1 +! + real(kind=kind_phys) gor, gocp, fv, gr2, bnv, fr & + &, brvf, cleff, tem, tem1, tem2, temc, temv& + &, wdir, ti, rdz, dw2, shr2, bvf2 & + &, rdelks, efact, coefm, gfobnv, onebg & + &, scork, rscor, hd, fro, rim, sira & + &, dtaux, dtauy, pkp1log, pklog & + &, cosang, sinang, cos2a, sin2a +! + integer kmm1, kmm2, lcap, lcapp1, kbps, kbpsp1,kbpsm1 & + &, kmps, idir, nwd, i, j, k, klcap, kp1, kmpbl, npt, npr, kmll +! &, kmll,kmds,ihit,jhit +! + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 +! +! parameter (cdmb = 1.0) ! non-dim sub grid mtn drag Amp (*j*) +! non-dim sub grid mtn drag Amp (*j*) +! cdmb = 1.0/float(IMX/192) +! cdmb = 192.0/float(IMX) + cdmb = 4.0 * 192.0/float(IMX) + if (cdmbgwd(1) >= 0.0) cdmb = cdmb * cdmbgwd(1) +! + npr = 0 + DO I = 1, IM + DUSFC(I) = 0. + DVSFC(I) = 0. + ENDDO +! + DO K = 1, KM + DO I = 1, IM + DB(I,K) = 0. + ANG(I,K) = 0. + UDS(I,K) = 0. + ENDDO + ENDDO +! + RDI = 1.0 / RD + onebg = 1.0 / g + GOR = G/RD + GR2 = G*GOR + GOCP = G/CP + FV = RV/RD - 1 +! +! NCNT = 0 + KMM1 = KM - 1 + KMM2 = KM - 2 + LCAP = KM + LCAPP1 = LCAP + 1 +! +! + IF ( NMTVR == 14) then +! ---- for lm and gwd calculation points + RDXZB(:) = 0 + ipt = 0 + npt = 0 + DO I = 1,IM + IF (elvmax(i) > HMINMT .and. hprime(i) > hpmin) then + npt = npt + 1 + ipt(npt) = i + if (ipr == i) npr = npt + ENDIF + ENDDO + IF (npt == 0) RETURN ! No gwd/mb calculation done! +! +! if (lprnt) print *,' npt=',npt,' npr=',npr,' ipr=',ipr,' im=',im +! &,' ipt(npt)=',ipt(npt) +! +! --- iwklm is the level above the height of the of the mountain. +! --- idxzb is the level of the dividing streamline. +! INITIALIZE DIVIDING STREAMLINE (DS) CONTROL VECTOR +! + do i=1,npt + iwklm(i) = 2 + IDXZB(i) = 0 + kreflm(i) = 0 + enddo +! if (lprnt) +! & print *,' in GFS_GWD_generic_lm.f npt,IM,IX,IY,km,me=',npt,IM,IX,IY,km,me +! +! +!> --- Subgrid Mountain Blocking Section +! +!.............................. +!.............................. +! +! (*j*) 11/03: test upper limit on KMLL=km - 1 +! then do not need hncrit -- test with large hncrit first. +! KMLL = km / 2 ! maximum mtnlm height : # of vertical levels / 2 + + KMLL = kmm1 + +! --- No mtn should be as high as KMLL (so we do not have to start at +! --- the top of the model but could do calc for all levels). +! + DO I = 1, npt + j = ipt(i) + ELVMAX(J) = min (ELVMAX(J) + sigfac * hprime(j), hncrit) + ENDDO +! + DO K = 1,KMLL + DO I = 1, npt + j = ipt(i) +! --- interpolate to max mtn height for index, iwklm(I) wk[gz] +! --- ELVMAX is limited to hncrit because to hi res topo30 orog. + pkp1log = phil(j,k+1) * onebg + pklog = phil(j,k) * onebg +!!!------- ELVMAX(J) = min (ELVMAX(J) + sigfac * hprime(j), hncrit) + + if (ELVMAX(j) <= pkp1log .and. ELVMAX(j) >= pklog) THEN + +! print *,' in GFS_GWD_generic_lm.f 1 =',k,ELVMAX(j),pklog,pkp1log,me +! --- wk for diags but can be saved and reused. + wk(i) = G * ELVMAX(j) / (phil(j,k+1) - phil(j,k)) + iwklm(I) = MAX(iwklm(I), k+1) +! print *,' in GFS_GWD_generic_lm.f 2 npt=',npt,i,j,wk(i),iwklm(i),me + endif +! +! --- find at prsl levels large scale environment variables +! --- these cover all possible mtn max heights + VTJ(I,K) = T1(J,K) * (1.0+FV*Q1(J,K)) + VTK(I,K) = VTJ(I,K) / PRSLK(J,K) + RO(I,K) = RDI * PRSL(J,K) / VTJ(I,K) ! DENSITY Kg/M**3 + ENDDO + ENDDO +! +! testing for highest model level of mountain top +! +! ihit = 2 +! jhit = 0 +! do i = 1, npt +! j=ipt(i) +! if ( iwklm(i) .gt. ihit ) then +! ihit = iwklm(i) +! jhit = j +! endif +! enddo +! print *, ' mb: kdt,max(iwklm),jhit,phil,me=', +! & kdt,ihit,jhit,phil(jhit,ihit),me + + klevm1 = KMLL - 1 + DO K = 1, klevm1 + kp1 = k + 1 + DO I = 1, npt + j = ipt(i) + RDZ = g / (phil(j,kp1) - phil(j,k)) +! --- Brunt-Vaisala Frequency +!> - Compute Brunt-Vaisala Frequency \f$N\f$. + BNV2LM(I,K) = (G+G) * RDZ * (VTK(I,Kp1) - VTK(I,K)) & + & / (VTK(I,Kp1) + VTK(I,K)) + bnv2lm(i,k) = max( bnv2lm(i,k), bnv2min ) + ENDDO + ENDDO +! print *,' in GFS_GWD_generic_lm.f 3 npt=',npt,j,RDZ,me +! + DO I = 1, npt + J = ipt(i) + DELKS(I) = 1.0 / (PRSI(J,1) - PRSI(J,iwklm(i))) + DELKS1(I) = 1.0 / (PRSL(J,1) - PRSL(J,iwklm(i))) + UBAR (I) = 0.0 + VBAR (I) = 0.0 + ROLL (I) = 0.0 + PE (I) = 0.0 + EK (I) = 0.0 + BNV2bar(I) = (PRSL(J,1)-PRSL(J,2)) * DELKS1(I) * BNV2LM(I,1) + ENDDO + +! --- find the dividing stream line height +! --- starting from the level above the max mtn downward +! --- iwklm(i) is the k-index of mtn elvmax elevation +!> - Find the dividing streamline height starting from the level above +!! the maximum mountain height and processing downward. + DO Ktrial = KMLL, 1, -1 + DO I = 1, npt + IF ( Ktrial < iwklm(I) .and. kreflm(I) == 0 ) then + kreflm(I) = Ktrial + ENDIF + ENDDO + ENDDO +! print *,' in GFS_GWD_generic_lm.f 4 npt=',npt,kreflm(npt),me +! +! --- in the layer kreflm(I) to 1 find PE (which needs N, ELVMAX) +! --- make averages, guess dividing stream (DS) line layer. +! --- This is not used in the first cut except for testing and +! --- is the vert ave of quantities from the surface to mtn top. +! + DO I = 1, npt + DO K = 1, Kreflm(I) + J = ipt(i) + RDELKS = DEL(J,K) * DELKS(I) + UBAR(I) = UBAR(I) + RDELKS * U1(J,K) ! trial Mean U below + VBAR(I) = VBAR(I) + RDELKS * V1(J,K) ! trial Mean V below + ROLL(I) = ROLL(I) + RDELKS * RO(I,K) ! trial Mean RO below + RDELKS = (PRSL(J,K)-PRSL(J,K+1)) * DELKS1(I) + BNV2bar(I) = BNV2bar(I) + BNV2lm(I,K) * RDELKS +! --- these vert ave are for diags, testing and GWD to follow (*j*). + ENDDO + ENDDO +! print *,' in GFS_GWD_generic_lm.f 5 =',i,kreflm(npt),BNV2bar(npt),me +! +! --- integrate to get PE in the trial layer. +! --- Need the first layer where PE>EK - as soon as +! --- IDXZB is not 0 we have a hit and Zb is found. +! + DO I = 1, npt + J = ipt(i) + DO K = iwklm(I), 1, -1 + PHIANG = atan2(V1(J,K),U1(J,K))*RAD_TO_DEG + ANG(I,K) = ( THETA(J) - PHIANG ) + if ( ANG(I,K) > 90. ) ANG(I,K) = ANG(I,K) - 180. + if ( ANG(I,K) < -90. ) ANG(I,K) = ANG(I,K) + 180. + ANG(I,K) = ANG(I,K) * DEG_TO_RAD +! +!> - Compute wind speed UDS +!!\f[ +!! UDS=\max(\sqrt{U1^2+V1^2},minwnd) +!!\f] +!! where \f$ minwnd=0.1 \f$, \f$U1\f$ and \f$V1\f$ are zonal and +!! meridional wind components of model layer wind. + + UDS(I,K) = & + & MAX(SQRT(U1(J,K)*U1(J,K) + V1(J,K)*V1(J,K)), minwnd) +! --- Test to see if we found Zb previously + IF (IDXZB(I) == 0 ) then + PE(I) = PE(I) + BNV2lm(I,K) * (G*ELVMAX(J) - phil(J,K)) & + & * (PHII(J,K+1) - PHII(J,K)) & + & * (onebg*onebg) +! --- KE +! --- Wind projected on the line perpendicular to mtn range, U(Zb(K)). +! --- kenetic energy is at the layer Zb +! --- THETA ranges from -+90deg |_ to the mtn "largest topo variations" + UP(I) = UDS(I,K) * cos(ANG(I,K)) + EK(I) = 0.5 * UP(I) * UP(I) + +! --- Dividing Stream lime is found when PE =exceeds EK. + IF (PE(I) >= EK(I)) THEN + IDXZB(I) = K + RDXZB(J) = real(K,kind=kind_phys) + ENDIF +! --- Then mtn blocked flow is between Zb=k(IDXZB(I)) and surface +! +!> - The dividing streamline height (idxzb), of a subgrid scale +!! obstable, is found by comparing the potential (PE) and kinetic +!! energies (EK) of the upstream large scale wind and subgrid scale air +!! parcel movements. the dividing streamline is found when +!! \f$PE\geq EK\f$. Mountain-blocked flow is defined to exist between +!! the surface and the dividing streamline height (\f$h_d\f$), which +!! can be found by solving an integral equation for \f$h_d\f$: +!!\f[ +!! \frac{U^{2}(h_{d})}{2}=\int_{h_{d}}^{H} N^{2}(z)(H-z)dz +!!\f] +!! where \f$H\f$ is the maximum subgrid scale elevation within the grid +!! box of actual orography, \f$h\f$, obtained from the GTOPO30 dataset +!! from the U.S. Geological Survey. + ENDIF + ENDDO + ENDDO +! +! print *,' in GFS_GWD_generic_lm.f 6 =',phiang,THETA(ipt(npt)),me +! print *,' in GFS_GWD_generic_lm.f 7 =',IDXZB(npt),PE(npt) +! +! if (lprnt .and. npr .gt. 0) then +! print *,' BNV2bar,BNV2lm=',bnv2bar(npr),BNV2lm(npr,1:klevm1) +! print *,' npr,IDXZB,UDS=',npr,IDXZB(npr),UDS(npr,:) +! print *,' PE,UP,EK=',PE(npr),UP(npr),EK(npr) +! endif +! + DO I = 1, npt + J = ipt(i) +! --- Calc if N constant in layers (Zb guess) - a diagnostic only. + ZBK(I) = ELVMAX(J) & + & - SQRT(UBAR(I)*UBAR(I) + VBAR(I)*VBAR(I))/BNV2bar(I) + ENDDO +! +! if (lprnt .and. npr .gt. 0) then +! print *,' iwklm,ZBK=',iwklm(npr),ZBK(npr),IDXZB(npr) +! print *,' Zb=',PHIL(ipr),IDXZB(npr))/G +! print *,' in GFS_GWD_generic_lm.f 8 npt =',npt,ZBK(npt),UP(npt),me +! endif +! +! --- The drag for mtn blocked flow +! + DO I = 1, npt + J = ipt(i) + ZLEN = 0. +! print *,' in GFS_GWD_generic_lm.f 9 =',i,j,IDXZB(i),me + IF (IDXZB(I) > 0) then + DO K = IDXZB(I), 1, -1 + IF (PHIL(J,IDXZB(I)) > PHIL(J,K)) then + +!> - Calculate \f$ZLEN\f$, which sums up a number of contributions of +!! elliptic obstables. +!!\f[ +!! ZLEN=\sqrt{[\frac{h_{d}-z}{z+h'}]} +!!\f] +!! where \f$z\f$ is the height, \f$h'\f$ is the orographic standard +!! deviation (HPRIME). + ZLEN = SQRT( (PHIL(J,IDXZB(I)) - PHIL(J,K)) & + & / (PHIL(J,K ) + G*hprime(J)) ) +! --- lm eq 14: +!> - Calculate the drag coefficient to vary with the aspect ratio of +!! the obstable as seen by the incident flow (see eq.14 in Lott and +!! Miller (1997) \cite lott_and_miller_1997) +!!\f[ +!! R=\frac{\cos^{2}\psi+\gamma\sin^{2}\psi}{\gamma\cos^{2}\psi+\sin^{2}\psi} +!!\f] +!! where \f$\psi\f$, which is derived from THETA, is the angle between +!! the incident flow direction and the normal ridge direcion. +!! \f$\gamma\f$ is the orographic anisotropy (GAMMA). + + cosang = cos(ang(i,k)) + sinang = sin(ang(i,k)) + cos2a = cosang * cosang + sin2a = sinang * sinang + tem = cos2a + GAMMA(J)*sin2a + ! Here Rtrm is 1.0/R + ! -------------------- + if (abs(tem) > 1.e-06) then + Rtrm = (gamma(J)*cos2a + sin2a) / tem + elseif (tem > 0.0) then + Rtrm = (gamma(J)*cos2a + sin2a) * 1.0e6 + else + Rtrm = - (gamma(J)*cos2a + sin2a) * 1.0e6 + endif + ZR = MAX( 2.0 - Rtrm, 0. ) + +! --- (negitive of DB -- see sign at tendency) +!> - In each model layer below the dividing streamlines, a drag from +!! the blocked flow is exerted by the obstacle on the large scale flow. +!! The drag per unit area and per unit height is written (eq.15 in +!! Lott and Miller (1997) \cite lott_and_miller_1997): +!!\f[ +!! D_{b}(z)=-C_{d}\max(2-\frac{1}{R},0)\rho\frac{\sigma}{2h'}ZLEN\max(\cos\psi,\gamma\sin\psi)\frac{UDS}{2} +!!\f] +!! where \f$C_{d}\f$ is a specified constant, \f$\sigma\f$ is the +!! orographic slope. + + DBTMP = 0.25 * CDmb * ZR * sigma(J) * & + & MAX(cosANG, gamma(J)*sinANG) * ZLEN / hprime(J) + DB(I,K) = DBTMP * UDS(I,K) +! +! if(lprnt .and. i .eq. npr) then +! print *,' in GFS_GWD_generic_lmi.f 10 npt=',npt,i,j,idxzb(i) +! &, DBTMP,R' ang=',ang(i,k),' gamma=',gamma(j),' K=',K +! print *,' in GFS_GWD_generic_lmi.f 11 K=',k,ZLEN,cos(ANG(I,K)) +! print *,' in GFS_GWD_generic_lmi.f 12 DB=',DB(i,k),sin(ANG(I,K)) +! endif + endif + ENDDO +! if(lprnt) print *,' @K=1,ZLEN,DBTMP=',K,ZLEN,DBTMP + endif + ENDDO +! +!............................. +!............................. +! end mtn blocking section +! + ELSEIF ( NMTVR /= 14) then +! ---- for mb not present and gwd (nmtvr .ne .14) + ipt = 0 + npt = 0 + DO I = 1,IM + IF ( hprime(i) > hpmin ) then + npt = npt + 1 + ipt(npt) = i + if (ipr == i) npr = npt + ENDIF + ENDDO + IF (npt == 0) RETURN ! No gwd/mb calculation done! +! +! if (lprnt) print *,' NPR=',npr,' npt=',npt,' IPR=',IPR +! &,' ipt(npt)=',ipt(npt) +! + do i=1,npt + IDXZB(i) = 0 + RDXZB(i) = 0. + enddo + ENDIF +! +!............................. +!............................. +! +!>-# Orographic Gravity Wave Drag Section + KMPBL = km / 2 ! maximum pbl height : # of vertical levels / 2 +! +! Scale cleff between IM=384*2 and 192*2 for T126/T170 and T62 +! + if (imx > 0) then +! cleff = 1.0E-5 * SQRT(FLOAT(IMX)/384.0) ! this is inverse of CLEFF! +! cleff = 1.0E-5 * SQRT(FLOAT(IMX)/192.0) ! this is inverse of CLEFF! +! cleff = 0.5E-5 * SQRT(FLOAT(IMX)/192.0) ! this is inverse of CLEFF! +! cleff = 1.0E-5 * SQRT(FLOAT(IMX)/192)/float(IMX/192) +! cleff = 1.0E-5 / SQRT(FLOAT(IMX)/192.0) ! this is inverse of CLEFF! + cleff = 0.5E-5 / SQRT(FLOAT(IMX)/192.0) ! this is inverse of CLEFF! +! hmhj for ndsl +! jw cleff = 0.1E-5 / SQRT(FLOAT(IMX)/192.0) ! this is inverse of CLEFF! +! cleff = 2.0E-5 * SQRT(FLOAT(IMX)/192.0) ! this is inverse of CLEFF! +! cleff = 2.5E-5 * SQRT(FLOAT(IMX)/192.0) ! this is inverse of CLEFF! + endif + if (cdmbgwd(2) >= 0.0) cleff = cleff * cdmbgwd(2) +! + DO K = 1,KM + DO I =1,npt + J = ipt(i) + VTJ(I,K) = T1(J,K) * (1.0+FV*Q1(J,K)) + VTK(I,K) = VTJ(I,K) / PRSLK(J,K) + RO(I,K) = RDI * PRSL(J,K) / VTJ(I,K) ! DENSITY TONS/M**3 + TAUP(I,K) = 0.0 + ENDDO + ENDDO + DO K = 1,KMM1 + kp1 = k + 1 + DO I =1,npt + J = ipt(i) + TI = 2.0 / (T1(J,K)+T1(J,Kp1)) + TEM = TI / (PRSL(J,K)-PRSL(J,Kp1)) + RDZ = g / (phil(j,kp1) - phil(j,k)) + TEM1 = U1(J,K) - U1(J,Kp1) + TEM2 = V1(J,K) - V1(J,Kp1) + DW2 = TEM1*TEM1 + TEM2*TEM2 + SHR2 = MAX(DW2,DW2MIN) * RDZ * RDZ + BVF2 = G*(GOCP+RDZ*(VTJ(I,Kp1)-VTJ(I,K))) * TI + ri_n(I,K) = MAX(BVF2/SHR2,RIMIN) ! Richardson number +! Brunt-Vaisala Frequency +! TEM = GR2 * (PRSL(J,K)+PRSL(J,K+1)) * TEM +! BNV2(I,K) = TEM * (VTK(I,K+1)-VTK(I,K))/(VTK(I,K+1)+VTK(I,K)) + BNV2(I,K) = (G+G) * RDZ * (VTK(I,Kp1)-VTK(I,K)) & + & / (VTK(I,Kp1)+VTK(I,K)) + bnv2(i,k) = max( bnv2(i,k), bnv2min ) + ENDDO + ENDDO +! print *,' in GFS_GWD_generic_lm.f GWD:14 =',npt,kmm1,bnv2(npt,kmm1) +! +! Apply 3 point smoothing on BNV2 +! +! do k=1,km +! do i=1,im +! vtk(i,k) = bnv2(i,k) +! enddo +! enddo +! do k=2,kmm1 +! do i=1,im +! bnv2(i,k) = 0.25*(vtk(i,k-1)+vtk(i,k+1)) + 0.5*vtk(i,k) +! enddo +! enddo +! +! Finding the first interface index above 50 hPa level +! + do i=1,npt + iwk(i) = 2 + enddo + DO K=3,KMPBL + DO I=1,npt + j = ipt(i) + tem = (prsi(j,1) - prsi(j,k)) + if (tem < dpmin) iwk(i) = k + enddo + enddo +! +!> - Calculate the reference level index: kref=max(2,KPBL+1). where +!! KPBL is the index for the PBL top layer. + KBPS = 1 + KMPS = KM + DO I=1,npt + J = ipt(i) + kref(I) = MAX(IWK(I), KPBL(J)+1 ) ! reference level + DELKS(I) = 1.0 / (PRSI(J,1) - PRSI(J,kref(I))) + DELKS1(I) = 1.0 / (PRSL(J,1) - PRSL(J,kref(I))) + UBAR (I) = 0.0 + VBAR (I) = 0.0 + ROLL (I) = 0.0 + KBPS = MAX(KBPS, kref(I)) + KMPS = MIN(KMPS, kref(I)) +! + BNV2bar(I) = (PRSL(J,1)-PRSL(J,2)) * DELKS1(I) * BNV2(I,1) + ENDDO +! print *,' in GFS_GWD_generic_lm.f GWD:15 =',KBPS,KMPS + KBPSP1 = KBPS + 1 + KBPSM1 = KBPS - 1 + DO K = 1,KBPS + DO I = 1,npt + IF (K < kref(I)) THEN + J = ipt(i) + RDELKS = DEL(J,K) * DELKS(I) + UBAR(I) = UBAR(I) + RDELKS * U1(J,K) ! Mean U below kref + VBAR(I) = VBAR(I) + RDELKS * V1(J,K) ! Mean V below kref +! + ROLL(I) = ROLL(I) + RDELKS * RO(I,K) ! Mean RO below kref + RDELKS = (PRSL(J,K)-PRSL(J,K+1)) * DELKS1(I) + BNV2bar(I) = BNV2bar(I) + BNV2(I,K) * RDELKS + ENDIF + ENDDO + ENDDO +! print *,' in GFS_GWD_generic_lm.f GWD:15B =',bnv2bar(npt) +! +! FIGURE OUT LOW-LEVEL HORIZONTAL WIND DIRECTION AND FIND 'OA' +! +! NWD 1 2 3 4 5 6 7 8 +! WD W S SW NW E N NE SE +! +!> - Calculate low-level horizontal wind direction, the derived +!! orographic asymmetry parameter (OA), and the derived Lx (CLX). + DO I = 1,npt + J = ipt(i) + wdir = atan2(UBAR(I),VBAR(I)) + pi + idir = mod(nint(fdir*wdir),mdir) + 1 + nwd = nwdir(idir) + OA(I) = (1-2*INT( (NWD-1)/4 )) * OA4(J,MOD(NWD-1,4)+1) + CLX(I) = CLX4(J,MOD(NWD-1,4)+1) + ENDDO +! +!-----XN,YN "LOW-LEVEL" WIND PROJECTIONS IN ZONAL +! & MERIDIONAL DIRECTIONS +!-----ULOW "LOW-LEVEL" WIND MAGNITUDE - (= U) +!-----BNV2 BNV2 = N**2 +!-----TAUB BASE MOMENTUM FLUX +!-----= -(RO * U**3/(N*XL)*GF(FR) FOR N**2 > 0 +!-----= 0. FOR N**2 < 0 +!-----FR FROUDE = N*HPRIME / U +!-----G GMAX*FR**2/(FR**2+CG/OC) +! +!-----INITIALIZE SOME ARRAYS +! + DO I = 1,npt + XN(I) = 0.0 + YN(I) = 0.0 + TAUB (I) = 0.0 + ULOW (I) = 0.0 + DTFAC(I) = 1.0 + ICRILV(I) = .FALSE. ! INITIALIZE CRITICAL LEVEL CONTROL VECTOR + +! +!----COMPUTE THE "LOW LEVEL" WIND MAGNITUDE (M/S) +! + ULOW(I) = MAX(SQRT(UBAR(I)*UBAR(I) + VBAR(I)*VBAR(I)), 1.0) + ULOI(I) = 1.0 / ULOW(I) + ENDDO +! + DO K = 1,KMM1 + kp1 = k + 1 + DO I = 1,npt + J = ipt(i) + VELCO(I,K) = 0.5 * ((U1(J,K)+U1(J,Kp1))*UBAR(I) & + & + (V1(J,K)+V1(J,Kp1))*VBAR(I)) + VELCO(I,K) = VELCO(I,K) * ULOI(I) +! IF ((VELCO(I,K).LT.VELEPS) .AND. (VELCO(I,K).GT.0.)) THEN +! VELCO(I,K) = VELEPS +! ENDIF + ENDDO + ENDDO +! +! +! find the interface level of the projected wind where +! low levels & upper levels meet above pbl +! +! do i=1,npt +! kint(i) = km +! enddo +! do k = 1,kmm1 +! do i = 1,npt +! IF (K .GT. kref(I)) THEN +! if(velco(i,k) .lt. veleps .and. kint(i) .eq. km) then +! kint(i) = k+1 +! endif +! endif +! enddo +! enddo +! WARNING KINT = KREF !!!!!!!!! + do i=1,npt + kint(i) = kref(i) + enddo +! +! if(lprnt) print *,' ubar=',ubar +! &,' vbar=',vbar,' ulow=',ulow,' veleps=',veleps +! + DO I = 1,npt + J = ipt(i) + BNV = SQRT( BNV2bar(I) ) + FR = BNV * ULOI(I) * min(HPRIME(J),hpmax) + FR = MIN(FR, FRMAX) + XN(I) = UBAR(I) * ULOI(I) + YN(I) = VBAR(I) * ULOI(I) +! +! Compute the base level stress and store it in TAUB +! CALCULATE ENHANCEMENT FACTOR, NUMBER OF MOUNTAINS & ASPECT +! RATIO CONST. USE SIMPLIFIED RELATIONSHIP BETWEEN STANDARD +! DEVIATION & CRITICAL HGT +! +!> - Calculate enhancement factor (E),number of mountans (m') and +!! aspect ratio constant. +!!\n As in eq.(4.9),(4.10),(4.11) in Kim and Arakawa (1995) +!! \cite kim_and_arakawa_1995, we define m' and E in such a way that they +!! depend on the geometry and location of the subgrid-scale orography +!! through OA and the nonlinearity of flow above the orography through +!! Fr. OC, which is the orographic convexity, and statistically +!! determine how protruded (sharp) the subgrid-scale orography is, is +!! included in the saturation flux G' in such a way that G' is +!! proportional to OC. The forms of E,m' and G' are: +!!\f[ +!! E(OA,F_{r_{0}})=(OA+2)^{\delta} +!!\f] +!!\f[ +!! \delta=C_{E}F_{r_{0}}/F_{r_{c}} +!!\f] +!!\f[ +!! m'(OA,CLX)=C_{m}\triangle x(1+CLX)^{OA+1} +!!\f] +!!\f[ +!! G'(OC,F_{r_{0}})=\frac{F_{r_{0}}^2}{F_{r_{0}}^2+a^{2}} +!!\f] +!!\f[ +!! a^{2}=C_{G}OC^{-1} +!!\f] +!! where \f$F_{r_{c}}(=1)\f$ is the critical Froude number, +!! \f$F_{r_{0}}\f$ is the Froude number. \f$C_{E}\f$,\f$C_{m}\f$, +!! \f$C_{G}\f$ are constants. + +!> - Calculate the reference-level drag \f$\tau_{0}\f$ (eq.(4.8) in +!! Kim and Arakawa (1995) \cite kim_and_arakawa_1995): +!!\f[ +!! \tau_0=E\frac{m'}{\triangle x}\frac{\rho_{0}U_0^3}{N_{0}}G' +!!\f] +!! where \f$E\f$,\f$m'\f$, and \f$G'\f$ are the enhancement factor, +!! "the number of mountains", and the flux function defined above, +!! respectively. + + EFACT = (OA(I) + 2.) ** (CEOFRC*FR) + EFACT = MIN( MAX(EFACT,EFMIN), EFMAX ) +! + COEFM = (1. + CLX(I)) ** (OA(I)+1.) +! + XLINV(I) = COEFM * CLEFF +! + TEM = FR * FR * OC(J) + GFOBNV = GMAX * TEM / ((TEM + CG)*BNV) ! G/N0 +! + TAUB(I) = XLINV(I) * ROLL(I) * ULOW(I) * ULOW(I) & + & * ULOW(I) * GFOBNV * EFACT ! BASE FLUX Tau0 +! +! tem = min(HPRIME(I),hpmax) +! TAUB(I) = XLINV(I) * ROLL(I) * ULOW(I) * BNV * tem * tem +! + K = MAX(1, kref(I)-1) + TEM = MAX(VELCO(I,K)*VELCO(I,K), 0.1) + SCOR(I) = BNV2(I,K) / TEM ! Scorer parameter below ref level + ENDDO +! if(lprnt) print *,' taub=',taub +! +!----SET UP BOTTOM VALUES OF STRESS +! + DO K = 1, KBPS + DO I = 1,npt + IF (K <= kref(I)) TAUP(I,K) = TAUB(I) + ENDDO + ENDDO +! +! Now compute vertical structure of the stress. +! + DO K = KMPS, KMM1 ! Vertical Level K Loop! + KP1 = K + 1 + DO I = 1, npt +! +!-----UNSTABLE LAYER IF RI < RIC +!-----UNSTABLE LAYER IF UPPER AIR VEL COMP ALONG SURF VEL <=0 (CRIT LAY) +!---- AT (U-C)=0. CRIT LAYER EXISTS AND BIT VECTOR SHOULD BE SET (.LE.) +! + IF (K >= kref(I)) THEN + ICRILV(I) = ICRILV(I) .OR. ( ri_n(I,K) < RIC) & + & .OR. (VELCO(I,K) <= 0.0) + ENDIF + ENDDO +! +!> - Compute the drag above the reference level (\f$k\geq kref\f$): +!! - Calculate the ratio of the Scorer parameter (\f$R_{scor}\f$). +!! \n From a series of experiments, Kim and Arakawa (1995) +!! \cite kim_and_arakawa_1995 found that the magnitude of drag divergence +!! tends to be underestimated by the revised scheme in low-level +!! downstream regions with wave breaking. Therefore, at low levels when +!! OA > 0 (i.e., in the "downstream" region) the saturation hypothesis +!! is replaced by the following formula based on the ratio of the +!! the Scorer parameter: +!!\f[ +!! R_{scor}=\min \left[\frac{\tau_i}{\tau_{i+1}},1\right] +!!\f] + DO I = 1,npt + IF (K >= kref(I)) THEN + IF (.NOT.ICRILV(I) .AND. TAUP(I,K) > 0.0 ) THEN + TEMV = 1.0 / max(VELCO(I,K), 0.01) +! IF (OA(I) .GT. 0. .AND. PRSI(ipt(i),KP1).GT.RLOLEV) THEN + IF (OA(I) > 0. .AND. kp1 < kint(i)) THEN + SCORK = BNV2(I,K) * TEMV * TEMV + RSCOR = MIN(1.0, SCORK / SCOR(I)) + SCOR(I) = SCORK + ELSE + RSCOR = 1. + ENDIF +! +!> - The drag above the reference level is expressed as: +!!\f[ +!! \tau=\frac{m'}{\triangle x}\rho NUh_d^2 +!!\f] +!! where \f$h_{d}\f$ is the displacement wave amplitude. In the absence +!! of wave breaking, the displacement amplitude for the \f$i^{th}\f$ +!! layer can be expressed using the drag for the layer immediately +!! below. Thus, assuming \f$\tau_i=\tau_{i+1}\f$, we can get: +!!\f[ +!! h_{d_i}^2=\frac{\triangle x}{m'}\frac{\tau_{i+1}}{\rho_{i}N_{i}U_{i}} +!!\f] + + BRVF = SQRT(BNV2(I,K)) ! Brunt-Vaisala Frequency +! TEM1 = XLINV(I)*(RO(I,KP1)+RO(I,K))*BRVF*VELCO(I,K)*0.5 + TEM1 = XLINV(I)*(RO(I,KP1)+RO(I,K))*BRVF*0.5 & + & * max(VELCO(I,K),0.01) + HD = SQRT(TAUP(I,K) / TEM1) + FRO = BRVF * HD * TEMV +! +! RIM is the MINIMUM-RICHARDSON NUMBER BY SHUTTS (1985) +! +!> - The minimum Richardson number (\f$Ri_{m}\f$) or local +!! wave-modified Richardson number, which determines the onset of wave +!! breaking, is expressed in terms of \f$R_{i}\f$ and +!! \f$F_{r_{d}}=Nh_{d}/U\f$: +!!\f[ +!! Ri_{m}=\frac{Ri(1-Fr_{d})}{(1+\sqrt{Ri}\cdot Fr_{d})^{2}} +!!\f] +!! see eq.(4.6) in Kim and Arakawa (1995) \cite kim_and_arakawa_1995. + + TEM2 = SQRT(ri_n(I,K)) + TEM = 1. + TEM2 * FRO + RIM = ri_n(I,K) * (1.-FRO) / (TEM * TEM) +! +! CHECK STABILITY TO EMPLOY THE 'SATURATION HYPOTHESIS' +! OF LINDZEN (1981) EXCEPT AT TROPOSPHERIC DOWNSTREAM REGIONS +! +!> - Check stability to employ the 'saturation hypothesis' of Lindzen +!! (1981) \cite lindzen_1981 except at tropospheric downstream regions. +!! \n Wave breaking occurs when \f$Ri_{m}= kint(i) )) THEN + TEMC = 2.0 + 1.0 / TEM2 + HD = VELCO(I,K) * (2.*SQRT(TEMC)-TEMC) / BRVF + TAUP(I,KP1) = TEM1 * HD * HD + ELSE + TAUP(I,KP1) = TAUP(I,K) * RSCOR + ENDIF + taup(i,kp1) = min(taup(i,kp1), taup(i,k)) + ENDIF + ENDIF + ENDDO + ENDDO +! +! DO I=1,IM +! taup(i,km+1) = taup(i,km) +! ENDDO +! + IF(LCAP .LE. KM) THEN + DO KLCAP = LCAPP1, KM+1 + DO I = 1,npt + SIRA = PRSI(ipt(I),KLCAP) / PRSI(ipt(I),LCAP) + TAUP(I,KLCAP) = SIRA * TAUP(I,LCAP) + ENDDO + ENDDO + ENDIF +! +! Calculate - (g/p*)*d(tau)/d(sigma) and Decel terms DTAUX, DTAUY +! + DO K = 1,KM + DO I = 1,npt + TAUD(I,K) = G * (TAUP(I,K+1) - TAUP(I,K)) / DEL(ipt(I),K) + ENDDO + ENDDO +! +!------LIMIT DE-ACCELERATION (MOMENTUM DEPOSITION ) AT TOP TO 1/2 VALUE +!------THE IDEA IS SOME STUFF MUST GO OUT THE 'TOP' +! + DO KLCAP = LCAP, KM + DO I = 1,npt + TAUD(I,KLCAP) = TAUD(I,KLCAP) * FACTOP + ENDDO + ENDDO +! +!------IF THE GRAVITY WAVE DRAG WOULD FORCE A CRITICAL LINE IN THE +!------LAYERS BELOW SIGMA=RLOLEV DURING THE NEXT DELTIM TIMESTEP, +!------THEN ONLY APPLY DRAG UNTIL THAT CRITICAL LINE IS REACHED. +! + DO K = 1,KMM1 + DO I = 1,npt + IF (K > kref(I) .and. PRSI(ipt(i),K) >= RLOLEV) THEN + IF(TAUD(I,K) /= 0.) THEN + TEM = DELTIM * TAUD(I,K) + DTFAC(I) = MIN(DTFAC(I),ABS(VELCO(I,K)/TEM)) + ENDIF + ENDIF + ENDDO + ENDDO +! +! if(lprnt .and. npr .gt. 0) then +! print *,' before A=',A(npr,:) +! print *,' before B=',B(npr,:) +! endif + +!> - Calculate outputs: A, B, DUSFC, DVSFC (see parameter description). +!! - Below the dividing streamline height (k < idxzb), mountain +!! blocking(\f$D_{b}\f$) is applied. +!! - Otherwise (k>= idxzb), orographic GWD (\f$\tau\f$) is applied. + DO K = 1,KM + DO I = 1,npt + J = ipt(i) + TAUD(I,K) = TAUD(I,K) * DTFAC(I) + DTAUX = TAUD(I,K) * XN(I) + DTAUY = TAUD(I,K) * YN(I) + ENG0 = 0.5*(U1(j,K)*U1(j,K)+V1(J,K)*V1(J,K)) +! --- lm mb (*j*) changes overwrite GWD + if ( K < IDXZB(I) .AND. IDXZB(I) /= 0 ) then + DBIM = DB(I,K) / (1.+DB(I,K)*DELTIM) + A(J,K) = - DBIM * V1(J,K) + A(J,K) + B(J,K) = - DBIM * U1(J,K) + B(J,K) + ENG1 = ENG0*(1.0-DBIM*DELTIM)*(1.0-DBIM*DELTIM) +! if ( ABS(DBIM * U1(J,K)) .gt. .01 ) +! & print *,' in GFS_GWD_generic_lmi.f KDT=',KDT,I,K,DB(I,K), +! & dbim,idxzb(I),U1(J,K),V1(J,K),me + DUSFC(J) = DUSFC(J) - DBIM * U1(J,K) * DEL(J,K) + DVSFC(J) = DVSFC(J) - DBIM * V1(J,K) * DEL(J,K) + else +! + A(J,K) = DTAUY + A(J,K) + B(J,K) = DTAUX + B(J,K) + ENG1 = 0.5*( & + & (U1(J,K)+DTAUX*DELTIM)*(U1(J,K)+DTAUX*DELTIM) & + & + (V1(J,K)+DTAUY*DELTIM)*(V1(J,K)+DTAUY*DELTIM)) + DUSFC(J) = DUSFC(J) + DTAUX * DEL(J,K) + DVSFC(J) = DVSFC(J) + DTAUY * DEL(J,K) + endif + C(J,K) = C(J,K) + max(ENG0-ENG1,0.)/CP/DELTIM + ENDDO + ENDDO +! if (lprnt) then +! print *,' in GFS_GWD_generic_lm.f after A=',A(ipr,:) +! print *,' in GFS_GWD_generic_lm.f after B=',B(ipr,:) +! print *,' DB=',DB(ipr,:) +! endif + + DO I = 1,npt + J = ipt(i) +! TEM = (-1.E3/G) + DUSFC(J) = - onebg * DUSFC(J) + DVSFC(J) = - onebg * DVSFC(J) + ENDDO +! +! MONITOR FOR EXCESSIVE GRAVITY WAVE DRAG TENDENCIES IF NCNT>0 +! +! IF(NCNT.GT.0) THEN +! IF(LAT.GE.38.AND.LAT.LE.42) THEN +!CMIC$ GUARD 37 +! DO 92 I = 1,IM +! IF(IKOUNT.GT.NCNT) GO TO 92 +! IF(I.LT.319.OR.I.GT.320) GO TO 92 +! DO 91 K = 1,KM +! IF(ABS(TAUD(I,K)) .GT. CRITAC) THEN +! IF(I.LE.IM) THEN +! IKOUNT = IKOUNT+1 +! PRINT 123,I,LAT,KDT +! PRINT 124,TAUB(I),BNV(I),ULOW(I), +! 1 GF(I),FR(I),ROLL(I),HPRIME(I),XN(I),YN(I) +! PRINT 124,(TAUD(I,KK),KK = 1,KM) +! PRINT 124,(TAUP(I,KK),KK = 1,KM+1) +! PRINT 124,(ri_n(I,KK),KK = 1,KM) +! DO 93 KK = 1,KMM1 +! VELKO(KK) = +! 1 0.5*((U1(I,KK)+U1(I,KK+1))*UBAR(I)+ +! 2 (V1(I,KK)+V1(I,KK+1))*VBAR(I))*ULOI(I) +!93 CONTINUE +! PRINT 124,(VELKO(KK),KK = 1,KMM1) +! PRINT 124,(A (I,KK),KK = 1,KM) +! PRINT 124,(DTAUY(I,KK),KK = 1,KM) +! PRINT 124,(B (I,KK),KK = 1,KM) +! PRINT 124,(DTAUX(I,KK),KK = 1,KM) +! GO TO 92 +! ENDIF +! ENDIF +!91 CONTINUE +!92 CONTINUE +!CMIC$ END GUARD 37 +!123 FORMAT(' *** MIGWD PRINT *** I=',I3,' LAT=',I3,' KDT=',I3) +!124 FORMAT(2X, 10E13.6) +! ENDIF +! ENDIF +! +! print *,' in GFS_GWD_generic_lm.f 18 =',A(ipt(1),idxzb(1)) +! &, B(ipt(1),idxzb(1)),me + RETURN + end subroutine GFS_GWD_generic_run +!> @} + +! +!> \section arg_table_GFS_GWD_generic_finalize Argument Table +!! + subroutine GFS_GWD_generic_finalize() + end subroutine GFS_GWD_generic_finalize + + end module GFS_GWD_generic + +!> This module contains the CCPP-compliant orographic gravity wave drag post +!! interstitial codes. + module GFS_GWD_generic_post + + contains + +!! \section arg_table_GFS_GWD_generic_post_init Argument Table +!! + subroutine GFS_GWD_generic_post_init() + end subroutine GFS_GWD_generic_post_init + +!! \section arg_table_GFS_GWD_generic_post_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|----------------------------------------------------------------------|--------------------------------------------------------------------------|-------|------|-----------|-----------|--------|----------| +!! | lssav | flag_diagnostics | flag for calculating diagnostic fields | flag | 0 | logical | | in | F | +!! | ldiag3d | flag_diagnostics_3D | flag for calculating 3-D diagnostic fields | flag | 0 | logical | | in | F | +!! | dtf | time_step_for_dynamics | dynamics time step | s | 0 | real | kind_phys | in | F | +!! | dusfcg | instantaneous_x_stress_due_to_gravity_wave_drag | zonal surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | in | F | +!! | dvsfcg | instantaneous_y_stress_due_to_gravity_wave_drag | meridional surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | in | F | +!! | dudt | tendency_of_x_wind_due_to_model_physics | zonal wind tendency due to model physics | m s-2 | 2 | real | kind_phys | in | F | +!! | dvdt | tendency_of_y_wind_due_to_model_physics | meridional wind tendency due to model physics | m s-2 | 2 | real | kind_phys | in | F | +!! | dtdt | tendency_of_air_temperature_due_to_model_physics | air temperature tendency due to model physics | K s-1 | 2 | real | kind_phys | in | F | +!! | dugwd | time_integral_of_x_stress_due_to_gravity_wave_drag | integral over time of zonal stress due to gravity wave drag | Pa s | 1 | real | kind_phys | inout | F | +!! | dvgwd | time_integral_of_y_stress_due_to_gravity_wave_drag | integral over time of meridional stress due to gravity wave drag | Pa s | 1 | real | kind_phys | inout | F | +!! | du3dt | cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag | cumulative change in zonal wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | +!! | dv3dt | cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag | cumulative change in meridional wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | +!! | dt3dt | cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag | cumulative change in temperature due to orographic gravity wave drag | K | 2 | real | kind_phys | inout | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! + subroutine GFS_GWD_generic_post_run( & + & lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, dvdt, dtdt, & + & dugwd, dvgwd, du3dt, dv3dt, dt3dt, errmsg, errflg) + + use machine, only : kind_phys + implicit none + + logical, intent(in) :: lssav, ldiag3d + real(kind=kind_phys), intent(in) :: dtf + real(kind=kind_phys), intent(in) :: & + & dusfcg(:), dvsfcg(:), dudt(:,:), dvdt(:,:), dtdt(:,:) + + real(kind=kind_phys), intent(inout) :: & + & dugwd(:), dvgwd(:), du3dt(:,:), dv3dt(:,:), dt3dt(:,:) + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (lssav) then + dugwd(:) = dugwd(:) + dusfcg(:)*dtf + dvgwd(:) = dvgwd(:) + dvsfcg(:)*dtf + + if (ldiag3d) then + du3dt(:,:) = du3dt(:,:) + dudt(:,:) * dtf + dv3dt(:,:) = dv3dt(:,:) + dvdt(:,:) * dtf + dt3dt(:,:) = dt3dt(:,:) + dtdt(:,:) * dtf + endif + endif + + end subroutine GFS_GWD_generic_post_run + +!> \section arg_table_GFS_GWD_generic_post_finalize Argument Table +!! + subroutine GFS_GWD_generic_post_finalize() + end subroutine GFS_GWD_generic_post_finalize + + end module GFS_GWD_generic_post diff --git a/physics/cires_orowam2017.f b/physics/cires_orowam2017.f new file mode 100644 index 000000000..4170a3d79 --- /dev/null +++ b/physics/cires_orowam2017.f @@ -0,0 +1,339 @@ + subroutine oro_wam_2017(im, levs,npt,ipt, kref,kdt,me,master, + & dtp,dxres, taub, u1, v1, t1, xn, yn, bn2, rho, prsi, prsL, + & del, sigma, hprime, gamma, theta, + & sinlat, xlatd, taup, taud, pkdis) +! + USE MACHINE , ONLY : kind_phys + use ugwp_common , only : grav, omega2 +! + implicit none + + integer :: im, levs + integer :: npt + integer :: kdt, me, master + integer :: kref(im), ipt(im) + real(kind=kind_phys), intent(in) :: dtp, dxres + real(kind=kind_phys), intent(in) :: taub(im) + + real(kind=kind_phys), intent(in) :: sinlat(im), xlatd(im) + real(kind=kind_phys), intent(in), dimension(im) :: sigma, + & hprime, gamma, theta + + real(kind=kind_phys), intent(in), dimension(im) :: xn, yn + + real(kind=kind_phys), intent(in), dimension(im, levs) :: + & u1, v1, t1, bn2, rho, prsl, del + + real(kind=kind_phys), intent(in), dimension(im, levs+1) :: prsi +! +! out : taup, taud, pkdis +! + real(kind=kind_phys), intent(inout), dimension(im, levs+1) :: taup + real(kind=kind_phys), intent(inout), dimension(im, levs) :: taud + real(kind=kind_phys), intent(inout), dimension(im, levs) :: pkdis + real(kind=kind_phys) :: belps, aelps, nhills, selps +! +! multiwave oro-spectra +! locals +! + integer :: i, j, k, isp, iw + + integer, parameter :: nworo = 30 + real(kind=kind_phys), parameter :: fc_flag = 0.0 + real(kind=kind_phys), parameter :: mkzmin = 6.28e-3/50.0 + real(kind=kind_phys), parameter :: mkz2min = mkzmin* mkzmin + real(kind=kind_phys), parameter :: kedmin = 1.e-3 + real(kind=kind_phys), parameter :: kedmax = 350.,axmax=250.e-5 + real(kind=kind_phys), parameter :: rtau = 0.01 ! nonlin-OGW scale 1/10sec + real(kind=kind_phys), parameter :: Linsat2 =0.5 + real(kind=kind_phys), parameter :: kxmin = 6.28e-3/100. + real(kind=kind_phys), parameter :: kxmax = 6.28e-3/5.0 + real(kind=kind_phys), parameter :: dkx = (kxmax -kxmin)/(nworo-1) + real(kind=kind_phys), parameter :: kx_slope= -5./3. + real(kind=kind_phys), parameter :: hps =7000., rhp2 = .5/hps + real(kind=kind_phys), parameter :: cxmin=0.5, cxmin2=cxmin*cxmin + + real :: akx(nworo), cxoro(nworo), akx2(nworo) + real :: aspkx(nworo), c2f2(nworo) , cdf2(nworo) + real :: tau_sp(nworo,levs+1), wkdis(nworo, levs+1) + real :: tau_kx(nworo),taub_kx(nworo) + real, dimension(nworo, levs+1) :: wrms, akzw + + real :: tauz(levs+1), rms_wind(levs+1) + real :: wave_act(nworo,levs+1) + + real :: kxw, kzw, kzw2, kzw3, kzi, dzmet, rhoint + real :: rayf, kturb + real :: uz, bv, bv2,kxsp, fcor2, cf2 + + real :: fdis + real :: wfdm, wfdt, wfim, wfit + real :: betadis, betam, betat, kds, cx, rhofac + real :: etwk, etws, tauk, cx2sat + real :: cdf1, tau_norm +! +! mean flow +! + real, dimension(levs+1) :: uzi,rhoi,ktur, kalp, dzi + + integer :: nw, nzi, ksrc + taud (:, :) = 0.0 ; pkdis(:,:) = 0.0 ; taup (:,:) = 0.0 + tau_sp (:,:) = 0.0 ; wrms(:,:) = 0.0 + nw = nworo + nzi = levs+1 + + do iw = 1, nw +! !kxw = 0.25/(dxres)*iw + kxw = kxmin+(iw-1)*dkx + akx(iw) = kxw + akx2(iw) = kxw*kxw + aspkx(iw) = kxw ** (kx_slope) + tau_kx(iw) = aspkx(iw)*dkx + enddo + + tau_norm = sum(tau_kx) + tau_kx(:) = tau_kx(:)/tau_norm + + if (kdt == 1) then +771 format( 'vay-oro19 ', 3(2x,F8.3)) + write(6,771) + & maxval(tau_kx)*maxval(taub)*1.e3, + & minval(tau_kx), maxval(tau_kx) + endif +! +! main loop over oro-points +! + do i =1, npt + j = ipt(i) + +! +! estimate "nhills" => stochastic choices for OGWs +! + if (taub(i) > 0.) then +! +! max_kxridge =min( .5*sigma(j)/hprime(j), kmax) +! ridge-dependent dkx = (max_kxridge -kxmin)/(nw-1) +! option to make grid-box variable kx-spectra kxw = kxmin+(iw-1)*dkx +! + wave_act(1:nw, 1:levs+1) = 1.0 + ksrc = kref(i) + tauz(1:ksrc) = taub(i) + taub_kx(1:nw) = tau_kx(1:nw) * taub(i) + wkdis(:,:) = kedmin + + call oro_meanflow(levs, nzi, u1(j,:), v1(j,:), t1(j,:), + & prsi(j,:), prsL(j,:), del(j,:), rho(i,:), + & bn2(i,:), uzi, rhoi,ktur, kalp,dzi, + & xn(i), yn(i)) + + fcor2 = (omega2*sinlat(j))*(omega2*sinlat(j))*fc_flag + + k = ksrc + + bv2 = bn2(i,k) + uz = uzi(k) !u1(j,ksrc)*xn(i)+v1(j,ksrc)*yn(i)! + kturb = ktur(k) + rayf = kalp(k) + rhoint = rhoi(k) + dzmet = dzi(k) + kzw = max(sqrt(bv2)/max(cxmin, uz), mkzmin) +! +! specify oro-kx spectra and related variables k=ksrc +! + do iw = 1, nw + kxw = akx(iw) + cxoro(iw) = 0.0 - uz + c2f2(iw) = fcor2/akx2(iw) + wrms(iw,k)= taub_kx(iw)/rhoint*kzw/kxw + tau_sp(iw, k) = taub_kx(iw) +! +! + if (cxoro(iw) > cxmin) then + wave_act(iw,k:levs+1) = 0. ! crit-level + else + cdf2(iw) = cxoro(iw)*cxoro(iw) -c2f2(iw) + if ( cdf2(iw) < cxmin2) then + wave_act(iw,k:levs+1) = 0. ! coriolis cut-off + else + kzw2 = max(Bv2/Cdf2(iw) - akx2(iw), mkz2min) + kzw = sqrt(kzw2) + akzw(iw,k)= kzw + wrms(iw,k)= taub_kx(iw)/rhoint * kzw/kxw + endif + endif + enddo ! nw-spectral loop +! +! defined abobe, k = ksrc: akx(nworo), cxoro(nworo), tau_sp(ksrc, nworo) +! propagate upward multiwave-spectra are filtered by dissipation & instability +! +! tau_sp(:,ksrc+1:levs+1) = tau_sp(:, ksrc) + do k= ksrc+1, levs + uz = uzi(k) + bv2 =bn2(i,k) + bv = sqrt(bv2) + rayf = kalp(k) + rhoint= rhoi(k) + dzmet = dzi(k) + rhofac = rhoi(k-1)/rhoi(k) + + do iw = 1, nworo +! + if (wave_act(iw, k-1) <= 0.0) cycle + cxoro(iw)= 0.0 - uz + if ( cxoro(iw) > cxmin) then + wave_act(iw,k:levs+1) = 0.0 ! crit-level + else + cdf2(iw) = cxoro(iw)*cxoro(iw) -c2f2(iw) + if ( cdf2(iw) < cxmin2) wave_act(iw,k:levs+1) = 0.0 + endif + if ( wave_act(iw,k) <= 0.0) cycle +! +! upward propagation +! + kzw2 = Bv2/Cdf2(iw) - akx2(iw) + + if (kzw2 < mkz2min) then + wave_act(iw,k:levs+1) = 0.0 + else +! +! upward propagation w/o reflection +! + kxw = akx(iw) + kzw = sqrt(kzw2) + akzw(iw,k) = kzw + kzw3 = kzw2*kzw + + cx = cxoro(iw) + betadis = cdf2(iw) / (Cx*Cx+c2f2(iw)) + betaM = 1.0 / (1.0+betadis) + betaT = 1.0 - BetaM + kds = wkdis(iw,k-1) + + etws = wrms(iw,k-1)*rhofac * kzw/akzw(iw,k-1) + + kturb = ktur(k)+pkdis(j,k-1) + wfiM = kturb*kzw2 +rayf + wfiT = wfiM ! do updates with Pr-numbers Kv/Kt + cdf1 = sqrt(Cdf2(iw)) + wfdM = wfiM/(kxw*Cdf1)*BetaM + wfdT = wfiT/(kxw*Cdf1)*BetaT + kzi = 2.*kzw*(wfdM+wfdT)*dzmet + Fdis = exp(-kzi) + + etwk = etws*Fdis + Cx2sat = Linsat2*Cdf2(iw) + + if (etwk > cx2sat) then + Kds = kxw*Cdf1*rhp2/kzw3 + etwk = cx2sat + wfiM = kds*kzw2 + wfdM = wfiM/(kxw*Cdf1) + kzi = 2.*kzw*(wfdm + wfdm)*dzmet + etwk = cx2sat*exp(-kzi) + endif +! if( lat(j) eq 40.5 ) then stop + wkdis(iw,k) = kds + wrms(iw,k) = etwk + tauk = etwk*kxw/kzw + tau_sp(iw,k) = tauk *rhoint + if ( tau_sp(iw,k) > tau_sp(iw,k-1)) + & tau_sp(iw,k) = tau_sp(iw,k-1) + + ENDIF ! upward + ENDDO ! spectral + +!......... do spectral sum of rms, wkdis, tau + + tauz(k) = sum( tau_sp(:,k)*wave_act(:,k) ) + rms_wind(k) = sum( wrms(:,k)*wave_act(:,k) ) + + pkdis(j,k) = sum(wkdis(:,k)*wave_act(:,k))+rms_wind(k)*rtau + + if (pkdis(j,k) > kedmax) pkdis(j,k) = kedmax + + ENDDO ! k=ksrc+1, levs + + k = ksrc + tauz(k) = sum(tau_sp(:,k)*wave_act(:,k)) + tauz(k) = tauz(k+1) ! zero momentum dep-n at k=ksrc + + pkdis(j,k) = sum(wkdis(:,k)*wave_act(:,k)) + rms_wind(k) = sum(wrms(:,k)*wave_act(:,k)) + tauz(levs+1) = tauz(levs) + taup(i, 1:levs+1) = tauz(1:levs+1) + do k=ksrc, levs + taud(i,k) = ( tauz(k+1) - tauz(k))*grav/del(j,k) +! if (taud(i,k) .gt. 0)taud(i,k)=taud(i,k)*.01 +! if (abs(taud(i,k)).ge.axmax)taud(i,k)=sign(taud(i,k),axmax) + enddo + endif ! taub > 0 + enddo ! oro-points (i, j, ipt) +!23456 + end subroutine oro_wam_2017 +!------------------------------------------------------------- +! +! define mean flow and dissipation for OGW-kx spectrum +! +!------------------------------------------------------------- + subroutine oro_meanflow(nz, nzi, u1, v1, t1, pint, pmid, + & delp, rho, bn2, uzi, rhoi, ktur, kalp, dzi, xn, yn) + + use ugwp_common , only : grav, rgrav, rdi, velmin, dw2min + implicit none + + integer :: nz, nzi + real, dimension(nz ) :: u1, v1, t1, delp, rho, pmid + real, dimension(nz ) :: bn2 ! define at the interfaces + real, dimension(nz+1) :: pint + real :: xn, yn +! output + + real, dimension(nz+1) :: dzi, uzi, rhoi, ktur, kalp + +! locals + integer :: i, j, k + real :: ui, vi, ti, uz, vz, shr2, rdz, kamp + real :: zgrow, zmet, rdpm, ritur, kmol, w1 +! paremeters + real, parameter :: hps = 7000., rpspa = 1.e-5 + real, parameter :: rhps=1.0/hps + real, parameter :: h4= 0.25/hps + real, parameter :: rimin = 1.0/8.0, kedmin = 0.01 + real, parameter :: lturb = 30. , uturb = 150.0 + real, parameter :: lsc2 = lturb*lturb,usc2 = uturb*uturb + kalp(1:nzi) = 2.e-7 ! radiative damping + + do k=2, nz + rdpm = grav/(pmid(k-1)-pmid(k)) + ui = .5*(u1(k-1)+u1(k)) + vi = .5*(v1(k-1)+v1(k)) + uzi(k) = Ui*xn + Vi*yn + ti = .5*(t1(k-1)+t1(k)) + rhoi(k) = rdi*pint(k)/ti + rdz = rdpm *rhoi(k) + dzi(k) = 1./rdz + uz = u1(k)-u1(k-1) + vz = v1(k)-v1(k-1) + shr2 = rdz*rdz*(max(uz*uz+vz*vz, dw2min)) + zmet = -hps*alog(pint(k)*rpspa) + zgrow = exp(zmet*h4) + kmol = 2.e-5*exp(zmet*rhps)+kedmin + ritur = max(bn2(k)/shr2, rimin) + kamp = sqrt(shr2)*lsc2 *zgrow + w1 = 1./(1. + 5*ritur) + ktur(k) = kamp * w1 * w1 +kmol + enddo + + k = 1 + uzi(k) = uzi(k+1) + ktur(k) = ktur(k+1) + rhoi(k) = rdi*pint(k)/t1(k+1) + dzi(k) = rgrav*delp(k)/rhoi(k) + + k = nzi + uzi(k) = uzi(k-1) + ktur(k) = ktur(k-1) + rhoi(k) = rhoi(k-1)*.5 + dzi(k) = dzi(k-1) + + end subroutine oro_meanflow diff --git a/physics/cires_ugwp.F90 b/physics/cires_ugwp.F90 new file mode 100644 index 000000000..322b4af8e --- /dev/null +++ b/physics/cires_ugwp.F90 @@ -0,0 +1,363 @@ +!> \file cires_ugwp.F90 +!! This file contains the Unified Gravity Wave Physics (UGWP) scheme by Valery Yudin (University of Colorado, CIRES) +!! See Valery Yudin's presentation at 2017 NGGPS PI meeting: +!! Gravity waves (GWs): Mesoscale GWs transport momentum, energy (heat) , and create eddy mixing in the whole atmosphere domain; Breaking and dissipating GWs deposit: (a) momentum; (b) heat (energy); and create (c) turbulent mixing of momentum, heat, and tracers +!! To properly incorporate GW effects (a-c) unresolved by DYCOREs we need GW physics +!! "Unified": a) all GW effects due to both dissipation/breaking; b) identical GW solvers for all GW sources; c) ability to replace solvers. +!! Unified Formalism: +!! 1. GW Sources: Stochastic and physics based mechanisms for GW-excitations in the lower atmosphere, calibrated by the high-res analyses/forecasts, and observations (3 types of GW sources: orography, convection, fronts/jets). +!! 2. GW Propagation: Unified solver for “propagation, dissipation and breaking” excited from all type of GW sources. +!! 3. GW Effects: Unified representation of GW impacts on the ‘resolved’ flow for all sources (energy-balanced schemes for momentum, heat and mixing). +!! https://www.weather.gov/media/sti/nggps/Presentations%202017/02%20NGGPS_VYUDIN_2017_.pdf + +module cires_ugwp + + use cires_ugwp_module, only: knob_ugwp_version, cires_ugwp_mod_init, cires_ugwp_mod_finalize!, GWDPS_V0, slat_geos5_tamp, fv3_ugwp_solv2_v0, edmix_ugwp_v0, diff_1d_wtend, diff_1d_ptend + + + implicit none + + logical :: is_initialized = .False. + +contains +! ------------------------------------------------------------------------ +! CCPP entry points for CIRES Unified Gravity Wave Physics (UGWP) scheme v0 +! ------------------------------------------------------------------------ +!>@brief The subroutine initializes the CIRES UGWP +#if 0 +!> \section arg_table_cires_ugwp_init Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |------------------|-------------------------------------------------------------------------------|---------------------------------------------------------|--------|------|-----------|-----------|--------|----------| +!! | me | mpi_rank | MPI rank of current process | index | 0 | integer | | in | F | +!! | master | mpi_root | MPI rank of master process | index | 0 | integer | | in | F | +!! | nlunit | iounit_namelist | fortran unit number for opening namelist file | none | 0 | integer | | in | F | +!! | logunit | iounit_log | fortran unit number for writing logfile | none | 0 | integer | | in | F | +!! | fn_nml2 | namelist_filename | namelist filename for ugwp | none | 0 | character | len=* | in | F | +!! | lonr | number_of_equatorial_longitude_points | number of global points in x-dir (i) along the equator | count | 0 | integer | | in | F | +!! | latr | number_of_latitude_points | number of global points in y-dir (j) along the meridian | count | 0 | integer | | none | F | +!! | levs | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | +!! | ak | a_parameter_of_the_hybrid_coordinate | a parameter for sigma pressure level calculations | Pa | 0 | real | kind_phys | none | F | +!! | bk | b_parameter_of_the_hybrid_coordinate | b parameter for sigma pressure level calculations | none | 0 | real | kind_phys | none | F | +!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | +!! | cdmvgwd | multiplication_factors_for_mountain_blocking_and_orographic_gravity_wave_drag | multiplication factors for cdmb and gwd | none | 1 | real | kind_phys | in | F | +!! | cgwf | multiplication_factors_for_convective_gravity_wave_drag | multiplication factor for convective GWD | none | 1 | real | kind_phys | in | F | +!! | pa_rf_in | pressure_cutoff_for_rayleigh_damping | pressure level from which Rayleigh Damping is applied | Pa | 0 | real | kind_phys | none | F | +!! | tau_rf_in | time_scale_for_rayleigh_damping | time scale for Rayleigh damping in days | d | 0 | real | kind_phys | none | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +#endif +! ----------------------------------------------------------------------- +! + subroutine cires_ugwp_init (me, master, nlunit, logunit, fn_nml2, & + lonr, latr, levs, ak, bk, dtp, cdmvgwd, cgwf, & + pa_rf_in, tau_rf_in, errmsg, errflg) + + use physcons, only: con_p0 ! pref in VAY's code + +!---- initialization of cires_ugwp + implicit none + + integer, intent (in) :: me + integer, intent (in) :: master + integer, intent (in) :: nlunit + integer, intent (in) :: logunit + integer, intent (in) :: lonr + integer, intent (in) :: levs + integer, intent (in) :: latr + real, intent(in), dimension(levs+1):: ak, bk + !real(kind=kind_phys), intent (in) :: ak(levs+1), bk(levs+1) + real, intent (in) :: dtp + real, intent (in) :: cdmvgwd(2), cgwf(2) ! "scaling" controls for "old" GFS-GW schemes + real, intent (in) :: pa_rf_in, tau_rf_in + + character(len=*), intent (in) :: fn_nml2 + !character(len=*), parameter :: fn_nml='input.nml' + + + integer :: ios + logical :: exists + real :: dxsg + integer :: k + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + + + if (is_initialized) return + + + call cires_ugwp_mod_init (me, master, nlunit, logunit, fn_nml2, & + lonr, latr, levs, ak, bk, con_p0, dtp, cdmvgwd, cgwf, & + pa_rf_in, tau_rf_in) + + if (.not.knob_ugwp_version==0) then + write(errmsg,'(*(a))') 'Logic error: CCPP only supports version zero of UGWP' + errflg = 1 + return + end if + + is_initialized = .true. + + + end subroutine cires_ugwp_init + + + + +! ----------------------------------------------------------------------- +! finalize of cires_ugwp (_finalize) +! ----------------------------------------------------------------------- + +!>@brief The subroutine finalizes the CIRES UGWP +#if 0 +!> \section arg_table_cires_ugwp_finalize Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |------------------|-------------------------------------------------------------------------------|---------------------------------------------------------|--------|------|-----------|-----------|--------|----------| +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +#endif + subroutine cires_ugwp_finalize(errmsg, errflg) + + implicit none +! + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (.not.is_initialized) return + + call cires_ugwp_mod_finalize() + + is_initialized = .false. + + end subroutine cires_ugwp_finalize + + + + + +! ----------------------------------------------------------------------- +! originally from ugwp_driver_v0.f +! driver of cires_ugwp (_driver) +! ----------------------------------------------------------------------- +! driver is called after pbl & before chem-parameterizations +! ----------------------------------------------------------------------- +! order = dry-adj=>conv=mp-aero=>radiation -sfc/land- chem -> vertdiff-> [rf-gws]=> ion-re +! ----------------------------------------------------------------------- +!>@brief The subroutine executes the CIRES UGWP +#if 0 +!> \section arg_table_cires_ugwp_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |------------------|--------------------------------------------------------------------------------|--------------------------------------------------------------|-----------|------|-----------|-----------|--------|----------| +!! | do_ugwp | do_ugwp | flag to activate CIRES UGWP | flag | 0 | logical | | none | F | +!! | me | mpi_rank | MPI rank of current process | index | 0 | integer | | in | F | +!! | master | mpi_root | MPI rank of master process | index | 0 | integer | | in | F | +!! | im | horizontal_loop_extent | horizontal | count | 0 | integer | | in | F | +!! | levs | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | +!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | +!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | +!! | kdt | index_of_time_step | current forecast iteration | index | 0 | integer | | in | F | +!! | lonr | number_of_equatorial_longitude_points | number of global points in x-dir (i) along the equator | count | 0 | integer | | in | F | +!! | oro | orography | orography | m | 1 | real | kind_phys | in | F | +!! | oro_uf | orography_unfiltered | unfiltered orography | m | 1 | real | kind_phys | in | F | +!! | hprime | standard_deviation_of_subgrid_orography | standard deviation of subgrid orography | m | 1 | real | kind_phys | out | F | +!! | nmtvr | number_of_statistical_measures_of_subgrid_orography | number of topographic variables in GWD | count | 0 | integer | | in | F | +!! | oc | convexity_of_subgrid_orography | convexity of subgrid orography | none | 1 | real | kind_phys | out | F | +!! | oa4 | asymmetry_of_subgrid_orography | asymmetry of subgrid orography | none | 2 | real | kind_phys | out | F | +!! | clx | fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height | horizontal fraction of grid box covered by subgrid orography higher than critical height | frac | 2 | real | kind_phys | out | F | +!! | theta | angle_from_east_of_maximum_subgrid_orographic_variations | angle with_respect to east of maximum subgrid orographic variations | degrees | 1 | real | kind_phys | out | F | +!! | sigma | slope_of_subgrid_orography | slope of subgrid orography | none | 1 | real | kind_phys | out | F | +!! | gamma | anisotropy_of_subgrid_orography | anisotropy of subgrid orography | none | 1 | real | kind_phys | out | F | +!! | elvmax | maximum_subgrid_orography | maximum of subgrid orography | m | 1 | real | kind_phys | out | F | +!! | do_tofd | turb_oro_form_drag_flag | flag for turbulent orographic form drag | flag | 0 | logical | | none | F | +!! | cdmbgwd | multiplication_factors_for_mountain_blocking_and_orographic_gravity_wave_drag | multiplication factors for cdmb and gwd | none | 1 | real | kind_phys | in | F | +!! | xlat | latitude | grid latitude in radians | radians | 1 | real | kind_phys | in | F | +!! | xlat_d | latitude_degree | latitude in degrees | degree | 1 | real | kind_phys | in | F | +!! | sinlat | sine_of_latitude | sine of the grid latitude | none | 1 | real | kind_phys | in | F | +!! | coslat | cosine_of_latitude | cosine of the grid latitude | none | 1 | real | kind_phys | in | F | +!! | area | cell_area | area of the grid cell | m2 | 1 | real | kind_phys | none | F | +!! | ugrs | x_wind | zonal wind | m s-1 | 2 | real | kind_phys | in | F | +!! | vgrs | y_wind | meridional wind | m s-1 | 2 | real | kind_phys | in | F | +!! | tgrs | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | in | F | +!! | qgrs | tracer_concentration | model layer mean tracer concentration | kg kg-1 | 3 | real | kind_phys | in | F | +!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | +!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | +!! | prslk | dimensionless_exner_function_at_model_layers | dimensionless Exner function at model layer centers | none | 2 | real | kind_phys | in | F | +!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | +!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | +!! | del | air_pressure_difference_between_midlayers | air pressure difference between midlayers | Pa | 2 | real | kind_phys | none | F | +!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | vertical index at top atmospheric boundary layer | index | 1 | integer | | in | F | +!! | dusfcg | instantaneous_x_stress_due_to_gravity_wave_drag | zonal surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | none | F | +!! | dvsfcg | instantaneous_y_stress_due_to_gravity_wave_drag | meridional surface stress due to orographic gravity wave drag| Pa | 1 | real | kind_phys | none | F | +!! | gw_dudt | tendency_of_x_wind_due_to_ugwp | zonal wind tendency due to UGWP | m s-2 | 2 | real | kind_phys | none | F | +!! | gw_dvdt | tendency_of_y_wind_due_to_ugwp | meridional wind tendency due to UGWP | m s-2 | 2 | real | kind_phys | none | F | +!! | gw_dtdt | tendency_of_air_temperature_due_to_ugwp | air temperature tendency due to UGWP | K s-1 | 2 | real | kind_phys | none | F | +!! | gw_kdis | eddy_mixing_due_to_ugwp | eddy mixing due to UGWP | m2 s-1 | 2 | real | kind_phys | none | F | +!! | tau_tofd | instantaneous_momentum_flux_due_to_turbulent_orographic_form_drag | momentum flux or stress due to TOFD | Pa | 2 | real | kind_phys | none | F | +!! | tau_mtb | instantaneous_momentum_flux_due_to_mountain_blocking_drag | momentum flux or stress due to mountain blocking drag | Pa | 2 | real | kind_phys | none | F | +!! | tau_ogw | instantaneous_momentum_flux_due_to_orographic_gravity_wave_drag | momentum flux or stress due to orographic gravity wave drag | Pa | 2 | real | kind_phys | none | F | +!! | tau_ngw | instantaneous_momentum_flux_due_to_nonstationary_gravity_wave | momentum flux or stress due to nonstationary gravity waves | Pa | 2 | real | kind_phys | none | F | +!! | zmtb | height_of_mountain_blocking | height of mountain blocking drag | m | 1 | real | kind_phys | none | F | +!! | zlwb | height_of_low_level_wave_breaking | height of low level wave breaking | m | 1 | real | kind_phys | none | F | +!! | zogw | height_of_launch_level_of_orographic_gravity_wave | height of launch level of orographic gravity wave | m | 1 | real | kind_phys | none | F | +!! | dudt_mtb | instantaneous_change_in_x_wind_due_to_mountain_blocking_drag | instantaneous change in x wind due to mountain blocking drag | m s-2 | 2 | real | kind_phys | none | F | +!! | dudt_ogw | instantaneous_change_in_x_wind_due_to_orographic_gravity_wave_drag | instantaneous change in x wind due to orographic gw drag | m s-2 | 2 | real | kind_phys | none | F | +!! | dudt_tms | instantaneous_change_in_x_wind_due_to_turbulent_orographic_form_drag | instantaneous change in x wind due to TOFD | m s-2 | 2 | real | kind_phys | none | F | +!! | dudt | tendency_of_x_wind_due_to_model_physics | zonal wind tendency due to model physics | m s-2 | 2 | real | kind_phys | none | F | +!! | dvdt | tendency_of_y_wind_due_to_model_physics | meridional wind tendency due to model physics | m s-2 | 2 | real | kind_phys | none | F | +!! | dtdt | tendency_of_air_temperature_due_to_model_physics | air temperature tendency due to model physics | K s-1 | 2 | real | kind_phys | none | F | +!! | rdxzb | level_of_dividing_streamline | level of the dividing streamline | none | 1 | real | kind_phys | none | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +#endif + +! subroutines original + subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr, & + oro, oro_uf, hprime, nmtvr, oc, theta, sigma, gamma, elvmax, clx, oa4,& + do_tofd, cdmbgwd, xlat, xlat_d, sinlat, coslat, area, & + ugrs, vgrs, tgrs, qgrs, prsi, prsl, prslk, phii, phil, & + del, kpbl, dusfcg, dvsfcg, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, & + tau_tofd, tau_mtb, tau_ogw, tau_ngw, zmtb, zlwb, zogw, & + dudt_mtb,dudt_ogw, dudt_tms, dudt, dvdt, dtdt, rdxzb, & + errmsg, errflg) + + + use machine, only: kind_phys + use physcons, only: con_g, con_pi, con_cp, con_rd, con_rv, con_fvirt + + implicit none + + ! interface variables + integer, intent(in) :: me, master, im, levs, ntrac, kdt, lonr, nmtvr + integer, intent(in), dimension(im) :: kpbl + real(kind=kind_phys), intent(in), dimension(im) :: oro, oro_uf, hprime, oc, theta, sigma, gamma, elvmax + real(kind=kind_phys), intent(in), dimension(im, 4) :: clx, oa4 + real(kind=kind_phys), intent(in), dimension(im) :: xlat, xlat_d, sinlat, coslat, area + real(kind=kind_phys), intent(in), dimension(im, levs) :: del, ugrs, vgrs, tgrs, prsl, prslk, phil + real(kind=kind_phys), intent(in), dimension(im, levs+1) :: prsi, phii + real(kind=kind_phys), intent(in), dimension(im, levs, ntrac):: qgrs + real(kind=kind_phys), intent(in) :: dtp, cdmbgwd(2) + logical, intent(in) :: do_ugwp, do_tofd + + real(kind=kind_phys), intent(out), dimension(im) :: dusfcg, dvsfcg + real(kind=kind_phys), intent(out), dimension(im) :: zmtb, zlwb, zogw, rdxzb + real(kind=kind_phys), intent(out), dimension(im) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw + real(kind=kind_phys), intent(out), dimension(im, levs):: gw_dudt, gw_dvdt, gw_dtdt, gw_kdis + real(kind=kind_phys), intent(out), dimension(im, levs):: dudt_mtb, dudt_ogw, dudt_tms + + real(kind=kind_phys), intent(inout), dimension(im, levs):: dudt, dvdt, dtdt + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + + ! local variables + integer :: i, k + real(kind=kind_phys), dimension(im) :: sgh30 + real(kind=kind_phys), dimension(im, levs) :: Pdvdt, Pdudt + real(kind=kind_phys), dimension(im, levs) :: Pdtdt, Pkdis + real(kind=kind_phys), dimension(im, levs) :: ed_dudt, ed_dvdt, ed_dtdt + ! from ugwp_driver_v0.f -> cires_ugwp_initialize.F90 -> module ugwp_wmsdis_init + real(kind=kind_phys), parameter :: tamp_mpa=30.e-3 + ! switches that activate impact of OGWs and NGWs (WL* how to deal with them? *WL) + real(kind=kind_phys), parameter :: pogw=1., pngw=1., pked=1. + + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! wrap everything in a do_ugwp 'if test' in order not to break the namelist functionality + IF (do_ugwp) THEN + + ! topo paras + ! w/ orographic effects + if(nmtvr == 14)then + ! calculate sgh30 for TOFD + sgh30 = abs(oro - oro_uf) + ! w/o orographic effects + else + sgh30 = 0. + endif + + zlwb(:) = 0. + + call GWDPS_V0(im, levs, lonr, do_tofd, Pdvdt, Pdudt, Pdtdt, Pkdis, & + ugrs, vgrs, tgrs, qgrs(:,:,1), kpbl, prsi,del,prsl, prslk, phii, phil, & + dtp, kdt, sgh30, hprime, oc, oa4, clx, theta, sigma, gamma, elvmax, & + dusfcg, dvsfcg, xlat_d, sinlat, coslat, area, cdmbgwd, & + me, master, rdxzb, zmtb, zogw, tau_mtb, tau_ogw, tau_tofd, dudt_mtb, dudt_ogw, dudt_tms) + + + ! 1) non-stationary GW-scheme with GMAO/MERRA GW-forcing + call slat_geos5_tamp(im, tamp_mpa, xlat_d, tau_ngw) + + + ! 2) non-stationary GW-scheme with GEOS-5/MERRA GW-forcing + call fv3_ugwp_solv2_v0(im, levs, dtp, tgrs, ugrs, vgrs,qgrs(:,:,1), & + prsl, prsi, phil, xlat_d, sinlat, coslat, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, & + tau_ngw, me, master, kdt) + + if(pogw /= 0.)then + + do k=1,levs + do i=1,im + gw_dtdt(i,k) = pngw*gw_dtdt(i,k)+ pogw*Pdtdt(i,k) + gw_dudt(i,k) = pngw*gw_dudt(i,k)+ pogw*Pdudt(i,k) + gw_dvdt(i,k) = pngw*gw_dvdt(i,k)+ pogw*Pdvdt(i,k) + gw_kdis(i,k) = pngw*gw_kdis(i,k)+ pogw*Pkdis(i,k) + + ! accumulation of tendencies for CCPP to replicate EMC-physics updates (!! removed in latest code commit to VLAB) + dudt(i,k) = dudt(i,k) +gw_dudt(i,k) + dvdt(i,k) = dvdt(i,k) +gw_dvdt(i,k) + dtdt(i,k) = dtdt(i,k) +gw_dtdt(i,k) + enddo + enddo + + else + + tau_mtb = 0. ; tau_ogw =0.; tau_tofd =0. + dudt_mtb =0. ; dudt_ogw = 0.; dudt_tms=0. + + endif + + return + + + !============================================================================= + ! make "ugwp eddy-diffusion" update for gw_dtdt/gw_dudt/gw_dvdt by solving + ! vert diffusion equations & update "Statein%tgrs, Statein%ugrs, Statein%vgrs" + !============================================================================= + ! 3) application of "eddy"-diffusion to "smooth" UGWP-related tendencies + !------------------------------------------------------------------------------ + ed_dudt(:,:) =0.; ed_dvdt(:,:) = 0. ; ed_dtdt(:,:) = 0. + + call edmix_ugwp_v0(im, levs, dtp, tgrs, ugrs, vgrs, qgrs(:,:,1), & + del, prsl, prsi, phil, prslk, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, & + ed_dudt, ed_dvdt, ed_dtdt, me, master, kdt) + gw_dtdt = gw_dtdt*(1.-pked) + ed_dtdt*pked + gw_dvdt = gw_dvdt*(1.-pked) + ed_dvdt*pked + gw_dudt = gw_dudt*(1.-pked) + ed_dudt*pked + + + + ENDIF ! do_ugwp + + + end subroutine cires_ugwp_run + + + + +end module cires_ugwp diff --git a/physics/cires_ugwp_initialize.F90 b/physics/cires_ugwp_initialize.F90 new file mode 100644 index 000000000..6177100b7 --- /dev/null +++ b/physics/cires_ugwp_initialize.F90 @@ -0,0 +1,710 @@ +!=============================== +! cu-cires ugwp-scheme +! initialization of selected +! init gw-solvers (1,2,3,4) +! init gw-source specifications +! init gw-background dissipation +!============================== +! +! Part-0 specifications of common constants, limiters and "criiical" values + + +! module oro_state + +! integer, parameter :: kind_phys=8 +! integer, parameter :: nvaroro=14 +! real (kind=kind_phys), allocatable :: oro_stat(:, :) +! contains + +! subroutine fill_oro_stat(nx, oc, oa4, clx4, theta, gamm, sigma, elvmax, hprime) + +! real (kind=kind_phys),dimension(nx) :: oc, theta, gamm, sigma, elvmax, hprime +! real(kind=kind_phys),dimension(nx,4) :: oa4, clx4 +! integer :: i +! do i=1, nx +! oro_stat(i,1) = hprime(i) +! oro_stat(i,2) = oc(i) +! oro_stat(i,3:6) = oa4(i,1:4) +! oro_stat(i,7:10) = clx4(i,1:4) +! oro_stat(i,11) = theta(i) +! oro_stat(i,12) = gamm(i) +! oro_stat(i,13) = sigma(i) +! oro_stat(i,14) = elvmax(i) +! enddo +! end subroutine fill_oro_stat + +! end module oro_state + + module ugwp_common +! + implicit none + + real, parameter :: grav =9.80665, cpd = 1004.6, grcp = grav/cpd + real, parameter :: rd = 287.05 , rv =461.5 + real, parameter :: rgrav = 1.0/grav + + real, parameter :: fv = rv/rd - 1.0 + real, parameter :: rdi = 1.0 / rd + real, parameter :: gor = grav/rd + real, parameter :: gr2 = grav*gor + real, parameter :: gocp = grav/cpd + real, parameter :: pi = 4.*atan(1.0), pi2 = 2.*pi +! + real, parameter :: rad_to_deg=180.0/pi, deg_to_rad=pi/180.0 + + real, parameter :: arad = 6370.e3 + real, parameter :: rcpd2 = 0.5/cpd, rcpd = 1./cpd + real, parameter :: dw2min=1.0 + real, parameter :: bnv2min=1.e-6 + real, parameter :: velmin=sqrt(dw2min) + real, parameter :: omega1 = pi2/86400. + real, parameter :: omega2 = 2.*omega1 + end module ugwp_common +! +! +!=================================================== +! +!Part-1 init => wave dissipation + RFriction +! +!=================================================== + subroutine init_global_gwdis(levs, zkm, pmb, kvg, ktg, krad, kion) + implicit none + + integer :: levs + real, intent(in) :: zkm(levs), pmb(levs) + real, intent(out), dimension(levs+1) :: kvg, ktg, krad, kion +! +!locals + data +! + integer :: k + real, parameter :: vusurf = 2.e-5 + real, parameter :: musurf = vusurf/1.95 + real, parameter :: hpmol = 8.5 +! + real, parameter :: kzmin = 0.1 + real, parameter :: kturbo = 100. + real, parameter :: zturbo = 130. + real, parameter :: zturw = 30. + real, parameter :: inv_pra = 3. !kt/kv =inv_pr +! + real, parameter :: alpha = 1./86400./15. +! + real, parameter :: kdrag = 1./86400./10. + real, parameter :: zdrag = 100. + real, parameter :: zgrow = 50. +! + real :: vumol, mumol, keddy, ion_drag +! + do k=1, levs + vumol = vusurf*exp(-zkm(k)/hpmol) + mumol = musurf*exp(-zkm(k)/hpmol) + + keddy = kturbo*exp(-((zkm(k)-zturbo) /zturw)**2) + + kvg(k) = vumol + keddy + ktg(k) = mumol + keddy*inv_pra + + krad(k) = alpha +! + ion_drag = kdrag +! + kion(k) = ion_drag + enddo + + k= levs+1 + kion(k) = kion(k-1) + krad(k) = krad(k-1) + kvg(k) = kvg(k-1) + ktg(k) = ktg(k-1) +! + end subroutine init_global_gwdis +! +! + subroutine rf_damp_init(levs, pa_rf, tau_rf, dtp, pmb, rfdis, rfdist, levs_rf) + implicit none + + integer :: levs + real :: pa_rf, tau_rf + real :: dtp + + real :: pmb(levs) + real :: rfdis(levs), rfdist(levs) + integer :: levs_rf + + real :: krf, krfz + integer :: k +! + rfdis(1:levs) = 1.0 + rfdist(1:levs) = 0.0 + levs_rf = levs + if (tau_rf <= 0.0 .or. pa_rf == 0.0) return + + krf = 1.0/(tau_rf*86400.0) + + do k=levs, 1, -1 + if(pmb(k) < pa_rf ) then ! applied only on constant pressure surfaces fixed pmb in "Pa" + krfz = krf*log(pa_rf/pmb(k)) + rfdis(k) = 1.0/(1.+krfz*dtp) + rfdist(k) = (rfdis(k) -1.0)/dtp ! du/dtp + levs_rf = k + endif + enddo + + end subroutine rf_damp_init +! ======================================================================== +! Part 2 - sources +! wave sources +! ======================================================================== +! +! ugwp_oro_init +! +!========================================================================= + module ugwp_oro_init + + use ugwp_common, only : bnv2min, grav, grcp, fv, grav, cpd, grcp, pi + + implicit none +! +! constants and "crirtical" values to run oro-mtb_gw physics +! +! choice of oro-scheme: strver = 'vay_2018' , 'gfs_2018', 'kdn_2005', 'smc_2000' +! + character(len=8) :: strver = 'gfs_2018' + character(len=8) :: strbase = 'gfs_2018' + real, parameter :: rimin=-10., ric=0.25 + +! + real, parameter :: efmin=0.5, efmax=10.0 + real, parameter :: hpmax=2400.0, hpmin=25.0 + real, parameter :: sigma_std=1./100., gamm_std=1.0 + + real, parameter :: frmax=10., frc =1.0, frmin =0.01 +! + + real, parameter :: ce=0.8, ceofrc=ce/frc, cg=0.5 + real, parameter :: gmax=1.0, veleps=1.0, factop=0.5 +! + real, parameter :: rlolev=50000.0 +! + real, parameter :: hncrit=9000. ! max value in meters for elvmax + +! hncrit set to 8000m and sigfac added to enhance elvmax mtn hgt + + real, parameter :: sigfac=4.0 ! mb3a expt test for elvmax factor + real, parameter :: hminmt=50. ! min mtn height (*j*) + real, parameter :: minwnd=1.0 ! min wind component (*j*) + real, parameter :: dpmin=5000.0 ! minimum thickness of the reference layer in pa + + real, parameter :: kxoro=6.28e-3/200. ! + real, parameter :: coro = 0.0 + integer, parameter :: nridge=2 + + real :: cdmb ! scale factors for mtb + real :: cleff ! scale factors for orogw + integer :: nworo ! number of waves + integer :: nazoro ! number of azimuths + integer :: nstoro ! flag for stochastic launch above SG-peak + + integer, parameter :: mdir = 8 + real, parameter :: fdir=.5*mdir/pi + + integer nwdir(mdir) + data nwdir/6,7,5,8,2,3,1,4/ + save nwdir + + real, parameter :: odmin = 0.1, odmax = 10.0 +!------------------------------------------------------------------------------ +! small-scale orography parameters for TOFD of Beljaars et al., 2004, QJRMS +!------------------------------------------------------------------------------ + + integer, parameter :: n_tofd=2 ! depth of SSO for TOFD compared with Zpbl + real, parameter :: const_tofd = 0.0759 ! alpha*beta*Cmd*Ccorr*2.109 = 12.*1.*0.005*0.6*2.109 = 0.0759 + real, parameter :: ze_tofd =1500.0 ! BJ's z-decay in meters + real, parameter :: a12_tofd =0.0002662*0.005363 ! BJ's k-spect const for sigf2 * a1*a2*exp(-[z/zdec]**1.5] + real, parameter :: ztop_tofd =10.*ze_tofd ! no TOFD > this height too higher 15 km +!------------------------------------------------------------------------------ +! + real, parameter :: fcrit_sm = 0.7, fcrit_sm2 = fcrit_sm * fcrit_sm + real, parameter :: fcrit_gfs = 0.7 + real, parameter :: fcrit_mtb = 0.7 + + real, parameter :: lzmax = 18.e3 ! 18 km + real, parameter :: mkzmin = 6.28/lzmax + real, parameter :: mkz2min = mkzmin*mkzmin + real, parameter :: zbr_pi = 3./2.*4.*atan(1.0) ! 3pi/2 + real, parameter :: zbr_ifs = 2.*atan(1.0) ! pi/2 + + contains +! + subroutine init_oro_gws(nwaves, nazdir, nstoch, effac, & + lonr, kxw, cdmbgwd ) +! +! + integer :: nwaves, nazdir, nstoch + integer :: lonr + real :: cdmbgwd(2) ! scaling factors for MTb (1) & (2) for cleff = cleff * cdmbgwd(2) + ! high res-n "larger" MTB and "less-active" cleff in GFS-2018 + real :: cdmbX + real :: kxw + real :: effac ! it is analog of cdmbgwd(2) for GWs, off for now +!-----------------------------! GFS-setup for cdmb & cleff +! cdmb = 4.0 * (192.0/IMX) +! cleff = 0.5E-5 / SQRT(IMX/192.0) = 0.5E-5*SQRT(192./IMX) +! + real, parameter :: lonr_refmb = 4.0 * 192.0 + real, parameter :: lonr_refgw = 192.0 + +! copy to "ugwp_oro_init" => nwaves, nazdir, nstoch + + nworo = nwaves + nazoro = nazdir + nstoro = nstoch + + cdmbX = lonr_refmb/float(lonr) + cdmb = cdmbX + if (cdmbgwd(1) >= 0.0) cdmb = cdmb * cdmbgwd(1) + + cleff = 0.5e-5 * sqrt(lonr_refgw/float(lonr)) !* effac + +!!! cleff = kxw * sqrt(lonr_refgw/float(lonr)) !* effac + + if (cdmbgwd(2) >= 0.0) cleff = cleff * cdmbgwd(2) +! +!.................................................................... +! higher res => smaller h' ..&.. higher kx +! flux_gwd ~ 'u'^2*kx/kz ~kxu/n ~1/dx *u/n tau ~ h'*h'*kx*kx = const (h'-less kx-grow) +!.................................................................... +! +! print *, ' init_oro_gws 2-1cdmb', cdmbgwd(2), cdmbgwd(1) + end subroutine init_oro_gws +! + + end module ugwp_oro_init +! ========================================================================= +! +! ugwp_conv_init +! +!========================================================================= + module ugwp_conv_init + + implicit none + real :: eff_con ! scale factors for conv GWs + integer :: nwcon ! number of waves + integer :: nazcon ! number of azimuths + integer :: nstcon ! flag for stochastic choice of launch level above Conv-cloud + real :: con_dlength + real :: con_cldf + + real, parameter :: cmin = 5 !2.5 + real, parameter :: cmax = 95. !82.5 + real, parameter :: cmid = 22.5 + real, parameter :: cwid = cmid + real, parameter :: bns = 2.e-2, bns2 = bns*bns, bns4=bns2*bns2 + real, parameter :: mstar = 6.28e-3/2. ! 2km + real :: dc + + real, allocatable :: ch_conv(:), spf_conv(:) + real, allocatable :: xaz_conv(:), yaz_conv(:) + contains +! + subroutine init_conv_gws(nwaves, nazdir, nstoch, effac, & + lonr, kxw, cgwf) + use ugwp_common, only : pi2, arad + implicit none + + integer :: nwaves, nazdir, nstoch + integer :: lonr + real :: cgwf(2) + real :: kxw, effac + real :: work1 = 0.5 + real :: chk, tn4, snorm + integer :: k + + nwcon = nwaves + nazcon = nazdir + nstcon = nstoch + eff_con = effac + + con_dlength = pi2*arad/float(lonr) + con_cldf = cgwf(1) * work1 + cgwf(2) *(1.-work1) +! +! allocate & define spectra in "selected direction": "dc" "ch(nwaves)" +! + if (.not. allocated(ch_conv)) allocate (ch_conv(nwaves)) + if (.not. allocated(spf_conv)) allocate (spf_conv(nwaves)) + if (.not. allocated(xaz_conv)) allocate (xaz_conv(nazdir)) + if (.not. allocated(yaz_conv)) allocate (yaz_conv(nazdir)) + + dc = (cmax-cmin)/float(nwaves-1) +! +! we may use different spectral "shapes" +! for example FVS-93 "Desabeius" +! E(s=1, t=3,m, w, k) ~ m^s/(m*^4 + m^4) ~ m^-3 saturated tail +! + do k = 1,nwaves + chk = cmin + (k-1)*dc + tn4 = (mstar*chk)**4 + ch_conv(k) = chk + spf_conv(k) = bns4*chk/(bns4+tn4) + enddo + + snorm = sum(spf_conv) + spf_conv = spf_conv/snorm*1.5 + + call init_nazdir(nazdir, xaz_conv, yaz_conv) + end subroutine init_conv_gws + + + end module ugwp_conv_init +!========================================================================= +! +! ugwp_fjet_init +! +!========================================================================= + + module ugwp_fjet_init + implicit none + real :: eff_fj ! scale factors for conv GWs + integer :: nwfj ! number of waves + integer :: nazfj ! number of azimuths + integer :: nstfj ! flag for stochastic choice of launch level above Conv-cloud +! + real, parameter :: fjet_trig=0. ! if ( abs(frgf) > fjet_trig ) launch GW-packet + + + real, parameter :: cmin = 2.5 + real, parameter :: cmax = 67.5 + real :: dc + real, allocatable :: ch_fjet(:) , spf_fjet(:) + real, allocatable :: xaz_fjet(:), yaz_fjet(:) + contains + subroutine init_fjet_gws(nwaves, nazdir, nstoch, effac, lonr, kxw) + use ugwp_common, only : pi2, arad + implicit none + + integer :: nwaves, nazdir, nstoch + integer :: lonr + real :: kxw, effac , chk + + integer :: k + + nwfj = nwaves + nazfj = nazdir + nstfj = nstoch + eff_fj = effac + + if (.not. allocated(ch_fjet)) allocate (ch_fjet(nwaves)) + if (.not. allocated(spf_fjet)) allocate (spf_fjet(nwaves)) + if (.not. allocated(xaz_fjet)) allocate (xaz_fjet(nazdir)) + if (.not. allocated(yaz_fjet)) allocate (yaz_fjet(nazdir)) + + dc = (cmax-cmin)/float(nwaves-1) + do k = 1,nwaves + chk = cmin + (k-1)*dc + ch_fjet(k) = chk + spf_fjet(k) = 1.0 + enddo + call init_nazdir(nazdir, xaz_fjet, yaz_fjet) + + end subroutine init_fjet_gws + + end module ugwp_fjet_init +! +!========================================================================= +! +! + module ugwp_okw_init +!========================================================================= + implicit none + + real :: eff_okw ! scale factors for conv GWs + integer :: nwokw ! number of waves + integer :: nazokw ! number of azimuths + integer :: nstokw ! flag for stochastic choice of launch level above Conv-cloud +! + real, parameter :: okw_trig=0. ! if ( abs(okwp) > okw_trig ) launch GW-packet + + real, parameter :: cmin = 2.5 + real, parameter :: cmax = 67.5 + real :: dc + real, allocatable :: ch_okwp(:), spf_okwp(:) + real, allocatable :: xaz_okwp(:), yaz_okwp(:) + + contains +! + subroutine init_okw_gws(nwaves, nazdir, nstoch, effac, lonr, kxw) + + use ugwp_common, only : pi2, arad + implicit none + + integer :: nwaves, nazdir, nstoch + integer :: lonr + real :: kxw, effac , chk + + integer :: k + + nwokw = nwaves + nazokw = nazdir + nstokw = nstoch + eff_okw = effac + + if (.not. allocated(ch_okwp)) allocate (ch_okwp(nwaves)) + if (.not. allocated(spf_okwp)) allocate (spf_okwp(nwaves)) + if (.not. allocated(xaz_okwp)) allocate (xaz_okwp(nazdir)) + if (.not. allocated(yaz_okwp)) allocate (yaz_okwp(nazdir)) + dc = (cmax-cmin)/float(nwaves-1) + do k = 1,nwaves + chk = cmin + (k-1)*dc + ch_okwp(k) = chk + spf_okwp(k) = 1. + enddo + + call init_nazdir(nazdir, xaz_okwp, yaz_okwp) + + end subroutine init_okw_gws + + end module ugwp_okw_init + +!=============================== end of GW sources +! +! init specific gw-solvers (1,2,3,4) +! + +!=============================== +! Part -3 init wave solvers +!=============================== + + module ugwp_lsatdis_init + implicit none + + integer :: nwav, nazd + integer :: nst + real :: eff + integer, parameter :: incdim = 4, iazdim = 4 +! + contains + + subroutine initsolv_lsatdis(me, master, nwaves, nazdir, nstoch, effac, do_physb, kxw) + + implicit none +! + integer :: me, master + integer :: nwaves, nazdir + integer :: nstoch + real :: effac + logical :: do_physb + real :: kxw +! +!locals: define azimuths and Ch(nwaves) - domain when physics-based soureces +! are not actibve +! + integer :: inc, jk, jl, iazi, i, j, k + + if( nwaves == 0 .or. nstoch == 1 ) then +! redefine from the default + nwav = incdim + nazd = iazdim + nst = 0 + eff = 1.0 + else +! from input_nml multi-wave spectra + nwav = nwaves + nazd = nazdir + nst = nstoch + eff = effac + endif +! + end subroutine initsolv_lsatdis +! + end module ugwp_lsatdis_init +! +! + module ugwp_wmsdis_init + + implicit none + + real, parameter :: maxdudt = 250.e-5 + + real, parameter :: hpscale= 7000., rhp2 = 0.5/hpscale + real, parameter :: omega2 = 2.*6.28/86400 + real, parameter :: gptwo=2.0 + + real, parameter :: dked_min =0.01 + real, parameter :: gssec = (6.28/30.)**2 ! max-value for bn2 + real, parameter :: bv2min = (6.28/60./120.)**2 ! min-value for bn2 7.6(-7) 2 hrs + real, parameter :: minvel = 0.5 + +! +! make parameter list that will be passed to SOLVER +! + + real, parameter :: v_kxw = 6.28e-3/200. + real, parameter :: v_kxw2 = v_kxw*v_kxw + real, parameter :: tamp_mpa = 30.e-3 + real, parameter :: zfluxglob= 3.75e-3 + + real , parameter :: nslope=1 ! the GW sprctral slope at small-m +! integer, parameter :: klaunch=55 ! 32 - ~ 1km ;55 - 5.5 km ; 52 4.7km ; 60-7km index for selecting launch level +! integer, parameter :: ilaunch=klaunch + + integer , parameter :: iazidim=4 ! number of azimuths + integer , parameter :: incdim=25 ! number of discrete cx - spectral elements in launch spectrum + real , parameter :: ucrit2=0.5 + + real , parameter :: zcimin = ucrit2 + real , parameter :: zcimax = 125.0 + real , parameter :: zgam = 0.25 + real , parameter :: zms_l = 2000.0 + + integer :: ilaunch + real :: gw_eff + +!=========================================================================== + integer :: nwav, nazd, nst + real :: eff + + real :: zaz_fct , zms + real, allocatable :: zci(:), zci4(:), zci3(:),zci2(:), zdci(:) + real, allocatable :: zcosang(:), zsinang(:) + contains +!============================================================================ + subroutine initsolv_wmsdis(me, master, nwaves, nazdir, nstoch, effac, do_physb, kxw) + +! call initsolv_wmsdis(me, master, knob_ugwp_wvspec(2), knob_ugwp_azdir(2), & +! knob_ugwp_stoch(2), knob_ugwp_effac(2), do_physb_gwsrcs, kxw) +! + use ugwp_common, only : pi, pi2 + implicit none +! +!input -control for solvers: +! nwaves, nazdir, nstoch, effac, do_physb, kxw +! +! + integer :: me, master, nwaves, nazdir, nstoch + real :: effac, kxw + logical :: do_physb +! +!locals +! + integer :: inc, jk, jl, iazi +! + real :: zang, zang1, znorm + real :: zx1, zx2, ztx, zdx, zxran, zxmin, zxmax, zx, zpexp + + if( nwaves == 0) then +! +! redefine from the deafault +! + nwav = incdim + nazd = iazidim + nst = 0 + eff = 1.0 + gw_eff = eff + else +! +! from input.nml +! + nwav = nwaves + nazd = nazdir + nst = nstoch + gw_eff = effac + endif + + allocate ( zci(nwav), zci4(nwav), zci3(nwav),zci2(nwav), zdci(nwav) ) + allocate ( zcosang(nazd), zsinang(nazd) ) + + if (me == master) then + print *, 'ugwp_v0: init_gw_wmsdis_control ' +! print *, 'ugwp_v0: WMSDIS launch layer ', klaunch + print *, 'ugwp_v0: WMSDIS launch layer ', ilaunch + print *, 'ugwp_v0: WMSDID tot_mflux in mpa', tamp_mpa*1000. + endif + + zpexp = gptwo * 0.5 ! gptwo=2 , zpexp = 1. + +! +! set up azimuth directions and some trig factors +! +! + zang=pi2/float(nazd) + +! get normalization factor to ensure that the same amount of momentum +! flux is directed (n,s,e,w) no mater how many azimuths are selected. +! + znorm = 0.0 + do iazi=1, nazd + zang1 = (iazi-1)*zang + zcosang(iazi) = cos(zang1) + zsinang(iazi) = sin(zang1) + znorm = znorm + abs(zcosang(iazi)) + enddo + zaz_fct = 1.0 + zaz_fct = 2.0 / znorm ! correction factot for azimuthal sums + +! define coordinate transform for "Ch" ....x = 1/c stretching transform +! ----------------------------------------------- +! note that this is expresed in terms of the intrinsic phase speed +! at launch ci=c-u_o so that the transformation is identical +! see eq. 28-30 of scinocca 2003. x = 1/c stretching transform +! + zxmax = 1.0 / zcimin + zxmin = 1.0 / zcimax + zxran = zxmax - zxmin + zdx = zxran / real(nwav-1) ! dkz +! + zx1 = zxran/(exp(zxran/zgam)-1.0 ) ! zgam =1./4. + zx2 = zxmin - zx1 + +! +! computations for zci =1/zx +! if(lgacalc) zgam=(zxmax-zxmin)/log(zxmax/zxmin) +! zx1=zxran/(exp(zxran/zgam)-1.0_jprb) +! zx2=zxmin-zx1 + zms = 2.*pi/zms_l + do inc=1, nwav + ztx = real(inc-1)*zdx+zxmin + zx = zx1*exp((ztx-zxmin)/zgam)+zx2 !eq. 29 of scinocca 2003 + zci(inc) = 1.0 /zx !eq. 28 of scinocca 2003 + zdci(inc) = zci(inc)**2*(zx1/zgam)*exp((ztx-zxmin)/zgam)*zdx !eq. 30 of scinocca 2003 + zci4(inc) = (zms*zci(inc))**4 + zci2(inc) = (zms*zci(inc))**2 + zci3(inc) = (zms*zci(inc))**3 + enddo +! +! +! all done and print-out +! +! + if (me == master) then + print * + print *, 'ugwp_v0: zcimin=' , zcimin + print *, 'ugwp_v0: zcimax=' , zcimax + print *, 'ugwp_v0: cd_crit=', zgam ! m/s precision for crit-level + print *, 'ugwp_v0: launch_level', ilaunch + print *, ' ugwp_v0 zms_l=', zms_l + print *, ' ugwp_vgw nslope=', nslope + + print * + endif + + + end subroutine initsolv_wmsdis +! +! make a list of all-initilized parameters needed for "gw_solver_wmsdis" +! + + end module ugwp_wmsdis_init +!========================================================================= +! +! work TODO for 2-extra WAM-solvers: +! DSPDIS (Hines)+ADODIS (Alexander-Dunkerton-Ortland) +! +!========================================================================= + subroutine init_dspdis + implicit none + end subroutine init_dspdis + + subroutine init_adodis + implicit none + end subroutine init_adodis + diff --git a/physics/cires_ugwp_module.F90 b/physics/cires_ugwp_module.F90 new file mode 100644 index 000000000..7a675c3cc --- /dev/null +++ b/physics/cires_ugwp_module.F90 @@ -0,0 +1,670 @@ +! +module cires_ugwp_module + +! +! driver is called after pbl & before chem-parameterizations +! +!.................................................................................... +! order = dry-adj=>conv=mp-aero=>radiation -sfc/land- chem -> vertdiff-> [rf-gws]=> ion-re +!................................................................................... +! +! + implicit none + logical :: module_is_initialized +!logical :: do_ugwp = .false. ! control => true - ugwp false old gws + rayeleigh friction + + logical :: do_physb_gwsrcs = .false. ! control for physics-based GW-sources + logical :: do_rfdamp = .false. ! control for Rayleigh friction inside ugwp_driver + + real, parameter :: arad=6370.e3 + real, parameter :: pi = atan(1.0) + real, parameter :: pi2 = 2.*pi + real, parameter :: hps = 7000. + real, parameter :: hpskm = hps/1000. +! + real :: kxw = 6.28e-3/100. ! single horizontal wavenumber of ugwp schemes + real, parameter :: ricrit = 0.25 + real, parameter :: frcrit = 0.50 + real, parameter :: linsat = 1.00 + real, parameter :: linsat2 = linsat*linsat +! + + integer :: knob_ugwp_solver=1 ! 1, 2, 3, 4 - (linsat, ifs_2010, ad_gfdl, dsp_dis) + integer, dimension(4) :: knob_ugwp_source ! [1,1,1,0] - (oro, fronts, conv, imbf-owp] + integer, dimension(4) :: knob_ugwp_wvspec ! number of waves for- (oro, fronts, conv, imbf-owp] + integer, dimension(4) :: knob_ugwp_azdir ! number of wave azimuths for- (oro, fronts, conv, imbf-owp] + integer, dimension(4) :: knob_ugwp_stoch ! 1 - deterministic ; 0 - stochastic + real, dimension(4) :: knob_ugwp_effac ! efficiency factors for- (oro, fronts, conv, imbf-owp] + + integer :: knob_ugwp_doaxyz=1 ! 1 -gwdrag + integer :: knob_ugwp_doheat=1 ! 1 -gwheat + integer :: knob_ugwp_dokdis=0 ! 1 -gwmixing + integer :: knob_ugwp_ndx4lh = 2 ! n-number of "unresolved" "n*dx" for lh_gw +! + integer :: ugwp_azdir + integer :: ugwp_stoch + + integer :: ugwp_src + integer :: ugwp_nws + real :: ugwp_effac + +! + data knob_ugwp_source / 1,0, 1, 0 / ! oro-conv-fjet-okw-taub_lat: 1-active 0-off + data knob_ugwp_wvspec /1,32,32,32/ ! number of waves for- (oro, fronts, conv, imbf-owp, taulat] + data knob_ugwp_azdir /2, 4, 4,4/ ! number of wave azimuths for- (oro, fronts, conv, imbf-okwp] + data knob_ugwp_stoch /0, 0, 0,0/ ! 0 - deterministic ; 1 - stochastic, non-activated option + data knob_ugwp_effac /1.,1.,1.,1./ ! efficiency factors for- (oro, fronts, conv, imbf-owp] + integer :: knob_ugwp_version = 0 + integer :: launch_level = 55 +! + namelist /cires_ugwp_nml/ knob_ugwp_solver, knob_ugwp_source,knob_ugwp_wvspec, knob_ugwp_azdir, & + knob_ugwp_stoch, knob_ugwp_effac,knob_ugwp_doaxyz, knob_ugwp_doheat, knob_ugwp_dokdis, & + knob_ugwp_ndx4lh, knob_ugwp_version, launch_level + +!&cires_ugwp_nml +! knob_ugwp_solver=2 +! knob_ugwp_source=1,1,1,0 +! knob_ugwp_wvspec=1,32,32,32 +! knob_ugwp_azdir =2, 4, 4,4 +! knob_ugwp_stoch =0, 0, 0,0 +! knob_ugwp_effac=1, 1, 1,1 +! knob_ugwp_doaxyz=1 +! knob_ugwp_doheat=1 +! knob_ugwp_dokdis=0 +! knob_ugwp_ndx4lh=4 +!/ +! +! allocatable arrays, initilized during "cires_ugwp_init" & +! released during "cires_ugwp_finalize" +! + real, allocatable :: kvg(:), ktg(:), krad(:), kion(:) + real, allocatable :: zkm(:), pmb(:) + real, allocatable :: rfdis(:), rfdist(:) + integer :: levs_rf + real :: pa_rf, tau_rf +! +! limiters +! + real, parameter :: max_kdis = 400. ! 400 m2/s + real, parameter :: max_axyz = 400.e-5 ! 400 m/s/day + real, parameter :: max_eps = max_kdis*4.e-7 ! ~16 K/day +! +!====================================================================== + real, parameter :: F_coriol=1 ! Coriolis effects + real, parameter :: F_nonhyd=1 ! Nonhydrostatic waves + real, parameter :: F_kds =0 ! Eddy mixing due to GW-unstable below + real, parameter :: iPr_ktgw =1./3., iPr_spgw=iPr_ktgw + real, parameter :: iPr_turb =1./3., iPr_mol =1.95 + real, parameter :: rhp1=1./hps, rhp2=0.5*rhp1, rhp4 = rhp2*rhp2 + real, parameter :: khp = 0.287*rhp1 ! R/Cp/Hp + real, parameter :: cd_ulim = 1.0 ! critical level precision or Lz ~ 0 ~dz of model + + contains +! +! ----------------------------------------------------------------------- +! +! init of cires_ugwp (_init) called from GFS_driver.F90 +! +! ----------------------------------------------------------------------- + subroutine cires_ugwp_mod_init (me, master, nlunit, logunit, fn_nml2, & + lonr, latr, levs, ak, bk, pref, dtp, cdmvgwd, cgwf, & + pa_rf_in, tau_rf_in) +! +! input_nml_file ='input.nml'=fn_nml +! + use ugwp_oro_init, only : init_oro_gws + use ugwp_conv_init, only : init_conv_gws + use ugwp_fjet_init, only : init_fjet_gws + use ugwp_okw_init, only : init_okw_gws + use ugwp_wmsdis_init, only : initsolv_wmsdis, ilaunch + use ugwp_lsatdis_init, only : initsolv_lsatdis + implicit none + + integer, intent (in) :: me + integer, intent (in) :: master + integer, intent (in) :: nlunit + integer, intent (in) :: logunit + integer, intent (in) :: lonr + integer, intent (in) :: levs + integer, intent (in) :: latr + real, intent (in) :: ak(levs+1), bk(levs+1), pref + real, intent (in) :: dtp + real, intent (in) :: cdmvgwd(2), cgwf(2) ! "scaling" controls for "old" GFS-GW schemes + real, intent (in) :: pa_rf_in, tau_rf_in + + character(len=64), intent (in) :: fn_nml2 + character(len=64), parameter :: fn_nml='input.nml' + +! character, intent (in) :: input_nml_file +! integer, parameter :: logunit = 6 + integer :: ios + logical :: exists + real :: dxsg + integer :: k +! + if (me == master) print *, trim (fn_nml), ' GW-namelist file ' + inquire (file =trim (fn_nml) , exist = exists) +! + if (.not. exists) then + if (me == master) & + write (6, *) 'separate ugwp :: namelist file: ', trim (fn_nml), ' does not exist' + else + open (unit = nlunit, file = trim(fn_nml), action = 'read', status = 'old', iostat = ios) + endif + rewind (nlunit) + read (nlunit, nml = cires_ugwp_nml) + close (nlunit) +! + ilaunch = launch_level + pa_rf = pa_rf_in + tau_rf = tau_rf_in + +! write version number and namelist to log file + if (me == master) then + write (logunit, *) " ================================================================== " + write (logunit, *) "cires_ugwp_cires" + write (logunit, nml = cires_ugwp_nml) + endif +! +! effective kxw - resolution-aware +! + dxsg = pi2*arad/float(lonr) * knob_ugwp_ndx4lh +! +! kxw = pi2/dxsg +! +! init global background dissipation for ugwp -> 4d-variable for fv3wam linked with pbl-vert_diff +! + +! allocate(fcor(latr), fcor2(latr) ) +! + allocate( kvg(levs+1), ktg(levs+1) ) + allocate( krad(levs+1), kion(levs+1) ) + allocate( zkm(levs), pmb(levs) ) + allocate( rfdis(levs), rfdist(levs) ) +! +! ak -pa bk-dimensionless from surf => tol_lid_pressure =0 +! + do k=1, levs + pmb(k) = 1.e0*(ak(k) + pref*bk(k)) ! Pa -unit Pref = 1.e5 + zkm(k) = -hpskm*alog(pmb(k)/pref) + enddo +! +! Part-1 :init_global_gwdis +! + call init_global_gwdis(levs, zkm, pmb, kvg, ktg, krad, kion) + call rf_damp_init (levs, pa_rf, tau_rf, dtp, pmb, rfdis, rfdist, levs_rf) +! +! Part-2 :init_SOURCES_gws +! + +! +! call init-solver for "stationary" multi-wave spectra and sub-grid oro +! + call init_oro_gws( knob_ugwp_wvspec(1), knob_ugwp_azdir(1), & + knob_ugwp_stoch(1), knob_ugwp_effac(1), lonr, kxw, cdmvgwd ) +! +! call init-sources for "non-sationary" multi-wave spectra +! + do_physb_gwsrcs=.true. + + IF (do_physb_gwsrcs) THEN + + if (me == master) print *, ' do_physb_gwsrcs ', do_physb_gwsrcs, ' in cires_ugwp_init ' + if (knob_ugwp_wvspec(4) > 0) then +! okw + call init_okw_gws(knob_ugwp_wvspec(4), knob_ugwp_azdir(4), & + knob_ugwp_stoch(4), knob_ugwp_effac(4), lonr, kxw ) + if (me == master) print *, ' init_okw_gws ' + endif + + if (knob_ugwp_wvspec(3) > 0) then +! fronts + call init_fjet_gws(knob_ugwp_wvspec(3), knob_ugwp_azdir(3), & + knob_ugwp_stoch(3), knob_ugwp_effac(3), lonr, kxw ) + if (me == master) print *, ' init_fjet_gws ' + endif + + if (knob_ugwp_wvspec(2) > 0) then +! conv + call init_conv_gws(knob_ugwp_wvspec(2), knob_ugwp_azdir(2), & + knob_ugwp_stoch(2), knob_ugwp_effac(2), lonr, kxw, cgwf ) + if (me == master) & + print *, ' init_convective GWs cgwf', knob_ugwp_wvspec(2), knob_ugwp_azdir(2) + + endif + + ENDIF !IF (do_physb_gwsrcs) + +!====================== +! Part-3 :init_SOLVERS +! ===================== +! +! call init-solvers for "broad" non-stationary multi-wave spectra +! + if (knob_ugwp_solver==1) then +! + call initsolv_lsatdis(me, master, knob_ugwp_wvspec(2), knob_ugwp_azdir(2), & + knob_ugwp_stoch(2), knob_ugwp_effac(2), do_physb_gwsrcs, kxw ) + endif + if (knob_ugwp_solver==2) then + + call initsolv_wmsdis(me, master, knob_ugwp_wvspec(2), knob_ugwp_azdir(2), & + knob_ugwp_stoch(2), knob_ugwp_effac(2), do_physb_gwsrcs, kxw) + endif +! +! other solvers not yet tested for fv3gfs +! +!< if (knob_ugwp_solver==3) call init_dspdis +!< if (knob_ugwp_solver==4) call init_adodis +! + +!====================== + module_is_initialized = .true. + if (me == master) print *, ' VAY-ugwp is initialized ', module_is_initialized + + end subroutine cires_ugwp_mod_init + +! ----------------------------------------------------------------------- +! +! driver of cires_ugwp (_driver) +! called from GFS_physics_driver.F90 +! +! ----------------------------------------------------------------------- +! call cires_ugwp_driver & +! (im, levs, dtp, kdt, me, lprnt, Model%lonr, & +! Model%prslrd0, Model%ral_ts, Model%cdmbgwd, & +! Grid%xlat, Grid%xlat_d, Grid%sinlat, Grid%coslat, & +! Statein, delp_gws, Oro_stat, & +! dusfcg, dvsfcg, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, & +! Diag%gwp_ax, Diag%gwp_axo, Diag%gwp_axc, Diag%gwp_axf, & +! Diag%gwp_ay, Diag%gwp_ayo, Diag%gwp_ayc, Diag%gwp_ayf, & +! Diag%gwp_dtdt, Diag%gwp_kdis, Diag%gwp_okw, Diag%gwp_fgf, & +! Diag%gwp_dcheat, Diag%gwp_precip, Diag%gwp_klevs, & +! Diag%zmtb, Diag%gwp_scheat, dlength, cldf, & +! Diag%tau_tofd, Diag%tau_mtb, Diag%tau_ogw, Diag%tau_ngw, & +! Diag%zmtb, Diag%zlwb, Diag%zogw, Diag%du3dt_mtb, & +! Diag%du3dt_ogw, Diag%du3dt_tms ) + + subroutine cires_ugwp_driver & + (im, levs, dtp, kdt, me, lprnt, lonr, & + pa_rf, tau_rf, cdmbgwd, xlat, xlatd, sinlat, coslat, & + ugrs, vgrs, tgrs, qgrs, prsi, prsl, prslk, phii, phil, & + delp, orostat, kpbl, & + dusfc, dvsfc, dudt, dvdt, dtdt, kdis, & + axtot, axo, axc, axf, aytot, ayo, ayc, ayf, & + eps_tot, ekdis, trig_okw, trig_fgf, & + dcheat, precip, cld_klevs, zmtb, scheat, dlength, cldf, & + taus_sso, taus_ogw, tauf_ogw, tauf_ngw, & + ugw_zmtb, ugw_zlwb, ugw_zogw, ugw_axmtb, ugw_axlwb, ugw_axtms ) + +! + use machine, only: kind_phys + use physcons, only: con_cp, con_fvirt, con_g, con_rd + use ugwp_common, only: omega2 +! +! + use ugwp_okw_init, only : & + eff_okw, nstokw, nwokw, ch_okwp, nazokw, spf_okwp, xaz_okwp, yaz_okwp + use ugwp_conv_init, only : & + eff_con, nstcon, nwcon, ch_conv, nazcon, spf_conv, xaz_conv, yaz_conv + use ugwp_fjet_init, only : & + eff_fj, nstfj, nwfj, ch_fjet, nazfj, spf_fjet, xaz_fjet, yaz_fjet + +! + implicit none +! + + logical :: lprnt + integer :: me, im, levs, kdt, lonr + real(kind_phys) :: dtp + real(kind_phys) :: pa_rf, tau_rf + real(kind_phys) :: cdmbgwd(2) + + integer, intent(in) :: kpbl(im) + real(kind_phys) :: hpbl(im) + real(kind_phys), intent(in) :: orostat(im, 14) + real(kind_phys), intent(in), dimension(im,levs) :: ugrs, vgrs, & + tgrs, qgrs, prsi, prsl, prslk, phii, phil, delp +! + real(kind_phys), dimension(im) :: xlat, xlatd, sinlat, coslat + real(kind_phys), dimension(im, levs) :: trig_okw, trig_fgf + real(kind_phys), dimension(im) :: precip ! precip-n rates and + integer , dimension(im, 3) :: cld_klevs ! indices fo cloud top/bot/? + real(kind_phys), dimension(im, levs) :: dcheat, scheat ! deep and shal conv heat tend. + + + real(kind_phys), dimension(im) :: dlength ! tail-grid box scale in meters + real(kind_phys), dimension(im) :: cldf ! "bizzard" old cgwd-tuning knobs dimensionless +!=================== +! tendency + kdis +!=================== + real(kind_phys), dimension(im, levs) :: dudt, dvdt, dtdt, kdis + real(kind_phys), dimension(im, levs) :: axtot, axo, axc, axf + real(kind_phys), dimension(im, levs) :: aytot, ayo, ayc, ayf + real(kind_phys), dimension(im, levs) :: eps_tot, ekdis + +! + real(kind_phys), dimension(im, levs) :: eds_o, kdis_o + real(kind_phys), dimension(im, levs) :: eds_c, kdis_c + real(kind_phys), dimension(im, levs) :: eds_f, kdis_f + real(kind_phys), dimension(im, levs) :: ax_rf, ay_rf, eps_rf +! +!================================================================================== +! diagnostics for OGW & NGW + SSO effects axmtb, axlwb, axtms +!================================================================================== + real(kind_phys), dimension(im) :: dusfc, dvsfc + real(kind_phys), dimension(im) :: taus_sso, taus_ogw, tauf_ogw, tauf_ngw + real(kind_phys), dimension(im) :: ugw_zmtb, ugw_zlwb, ugw_zogw + real(kind_phys), dimension(im, levs) :: ugw_axmtb,ugw_axlwb, ugw_axtms + real(kind_phys), dimension(im, levs) :: tauz_ogw, tauz_ngw, wtauz + +! +! knob_ugwp_source=[ 1, 1, 1, 0 ] +! oro conv nst imbal-okw +! locals +! + integer :: i, j, k, istype, ido +! +! internal diagnostics for oro-waves, lee waves, and mtb : +! + real(kind_phys), dimension(im) :: dusfc_mb, dvsfc_mb, dusfc_ogw, dvsfc_ogw + real(kind_phys), dimension(im) :: dusfc_lwb, dvsfc_lwb + real(kind_phys), dimension(im) :: zmtb, zlwb, zogw ! GW-launch levels in "meters" +! + real(kind_phys), dimension(im) :: fcor, c2f2 +! +! three sources with different: a) spectra-content/azimuth; b) efficiency ;c) spectral shape +! + real(kind_phys), dimension(im) :: taub_con, taub_fj, taub_okw + integer , dimension(im) :: klev_okw, klev_fj, klev_con + integer , dimension(im) :: if_okw, if_con, if_fj + integer :: nf_okw, nf_con, nf_fj +! + dudt = 0. + dvdt = 0. + dtdt = 0. + kdis = 0. + axo = 0. ; axc = 0. ; axf = 0. + ayo = 0. ; ayc = 0. ; ayf = 0. + eds_o = 0. ; kdis_o = 0. ; eds_f = 0. ; kdis_f = 0. ; eds_c = 0. ; kdis_c = 0. + ax_rf = 0. ; ay_rf = 0. ; eps_rf = 0 + + hpbl(:) = 2000. ! hpbl (1:im) = phil(1:im, kpbl(1:im)) +! + + do i=1, im + fcor(i) = omega2*sinlat(i) + c2f2(i) = fcor(i)*fcor(i)/(kxw*kxw) + enddo + +! i=im +! print *, i, fcor(i), 6.28e-3/kxw, sqrt(c2f2(i)) +! print *, maxval(statein%prsl/statein%tgrs)/287. , ' density ' + +! +! +! What can be computed for ALL types of GWs? => +! "Br-Vi frequency"with "limits" in case of "conv-unstable" layers +! Background dissipation: Molecular + Eddy +! Wind projections may differ from GW-sources/propagation azimuths +! + do istype=1, size(knob_ugwp_source) + + ido = knob_ugwp_source(istype) ! 0 or 1 off or active + + ugwp_azdir = knob_ugwp_azdir(istype) + ugwp_stoch = knob_ugwp_stoch(istype) + ugwp_nws = knob_ugwp_wvspec(istype) + ugwp_effac = knob_ugwp_effac(istype) + +! +! oro-gw effects +! + if (ido == 1 .and. istype ==1 ) then +! +! 1. solve for OGW effects on the mean flow +! 2. all parts of ORO effexra inside: MTB TOFD LeeWB OGW-drag +! + call ugwp_oro(im, levs, dtp, kdt, me, lprnt, & + fcor, c2f2, ugrs, vgrs, tgrs, & + qgrs, prsi, delp, prsl, prslk, phii, phil, & + orostat, hpbl, axo, ayo, eds_o, kdis_o, & + dusfc, dvsfc, dusfc_mb, dvsfc_mb, dusfc_ogw, dvsfc_ogw, & + dusfc_lwb, dvsfc_lwb, zmtb, zlwb, zogw,tauf_ogw,tauz_ogw,& + ugw_axmtb,ugw_axlwb, ugw_axtms) +! +! taus_sso, taus_ogw, tauz_ogw, tauz_ngw, tauf_ogw, tauf_ngw, & +! ugw_zmtb, ugw_zlwb, ugw_zogw, ugw_axmtb,ugw_axlwb, ugw_axtms +! collect column-integrated "dusfc, dvsfc" only for oro-waves +! + taus_sso = dusfc_mb + dusfc_lwb + dusfc_ogw + taus_ogw = dusfc_ogw + ugw_zmtb = zmtb + ugw_zlwb = zlwb + ugw_zogw = zogw + +! tauz_ogw/tauf_ogw => output +! ugwp_azdir, ugwp_stoch, ugwp_nws ..... "multi-wave + stochastic" +! +! stationary gw-mode ch=0, with "gw_solver_linsat" +! compute column-integrated "dusfc, dvsfc" only for oro-waves +! + dudt = dudt + axo * ugwp_effac + dvdt = dvdt + ayo * ugwp_effac + dtdt = dtdt + eds_o * ugwp_effac + kdis = kdis + kdis_o* ugwp_effac +! print *, ' ido istype ORO=1 ', ido, istype, ' ugwp_oro as a solver ' + endif + + if (ido == 1 .and. istype ==2 ) then +! +! convective gw effects +! +! 1. specify spectra + forcing nstcon, nwcon, ch_conv, nazcon, spf_conv +! + call get_spectra_tau_convgw & + (nwcon, im, levs, dcheat, scheat, precip, cld_klevs, & + xlatd, sinlat, coslat, taub_con, klev_con, if_con, nf_con) +! +! 2. solve for GW effects on the mean flow +! + if ( nf_con > 0) then + + klev_con(:) = 52 ! ~5 km +! +!eff_con, nstcon, nwcon, ch_conv, nazcon, spf_conv, xaz_conv, yaz_conv +! + if (knob_ugwp_solver == 1) call gw_solver_linsatdis & + (im, levs, dtp, kdt, me, taub_con, klev_con, if_con, nf_con, & + nwcon, ch_conv, nazcon, spf_conv, xaz_conv, yaz_conv, & + fcor, c2f2, ugrs, vgrs, tgrs, qgrs, prsi, delp, & + prsl, prslk, phii, phil, & + axc, ayc, eds_c, kdis_c, wtauz) + + + if (knob_ugwp_solver == 2) then +! print *, ' before CONV-2 ', ido, istype, ' gw_solver_wmsdis ', knob_ugwp_solver + call gw_solver_wmsdis & + (im, levs, dtp, kdt, me, taub_con, klev_con, if_con, nf_con, & + nwfj, ch_fjet, nazfj, spf_fjet, xaz_fjet, yaz_fjet, & + fcor, c2f2, ugrs, vgrs, tgrs, & + qgrs, prsi, delp, prsl, prslk, phii, phil, & + axc, ayc, eds_c, kdis_c, wtauz) +! print *, ' after ido istype CONV-2 ', ido, istype, ' gw_solver_wmsdis ', knob_ugwp_solver + endif + + dudt = dudt + axc * ugwp_effac + dvdt = dvdt + ayc * ugwp_effac + dtdt = dtdt + eds_c * ugwp_effac + kdis = kdis + kdis_c * ugwp_effac + + tauz_ngw = wtauz + + endif + + endif + + if (ido == 1 .and. istype ==3 ) then +! +! nonstationary gw effects +! +! 1. specify spectra + forcing +! + call get_spectra_tau_nstgw (nwfj, im, levs, & + trig_fgf, xlatd, sinlat, coslat, taub_fj, klev_fj, if_fj, nf_fj) +! +! 2. solve for GW effects on the mean flow +! + print *, ' tau_nstgw nf_fj-GW triggers ', nf_fj, ' ugwp_solver = ', knob_ugwp_solver + if ( nf_fj > 0) then + + if (knob_ugwp_solver == 1) call gw_solver_linsatdis & + (im, levs, dtp, kdt, me, taub_fj, klev_fj, if_fj, nf_fj, & + nwfj, ch_fjet, nazfj, spf_fjet, xaz_fjet, yaz_fjet, & + fcor, c2f2, ugrs, vgrs, tgrs, & + qgrs, prsi, delp, prsl, prslk, phii, phil, & + axf, ayf, eds_f, kdis_f, wtauz) + + + + if (knob_ugwp_solver == 2) call gw_solver_wmsdis & + (im, levs, dtp, kdt, me, taub_fj, klev_fj, if_fj, nf_fj, & + nwfj, ch_fjet, nazfj, spf_fjet, xaz_fjet, yaz_fjet, & + fcor, c2f2, ugrs, vgrs, tgrs, & + qgrs, prsi, delp, prsl, prslk, phii, phil, & + axf, ayf, eds_f, kdis_f, wtauz) + + dudt = dudt + axf * ugwp_effac + dvdt = dvdt + ayf * ugwp_effac + dtdt = dtdt + eds_f * ugwp_effac + kdis = kdis + kdis_f * ugwp_effac + tauz_ngw = wtauz + print *, ' ido istype for FJ 1-4 ', ido, istype, ' gw_solver_wmsdis ', knob_ugwp_solver + + endif + endif +! print *, ' ido istype for okw 1-4 ', ido, istype + if (ido == 1 .and. istype == 4 ) then +! +! nonstationary gw effects due to both "convection +fronts/jets " = imbalance of rs-flow +! +! 1. specify spectra + forcing +! + call get_spectra_tau_okw (nwokw, im, levs,& + trig_okw, xlatd, sinlat, coslat, taub_okw, klev_okw, if_okw, nf_okw) +! +! 2. solve for GW effects on the mean flow +! + if ( nf_okw > 0) then +! + if (knob_ugwp_solver == 1) call gw_solver_linsatdis & + (im, levs, dtp, kdt, me, taub_okw, klev_okw, if_okw, nf_okw, & + nwfj, ch_fjet, nazfj, spf_fjet, xaz_fjet, yaz_fjet, & + fcor, c2f2, ugrs, vgrs, tgrs, & + qgrs, prsi, delp, prsl, prslk, phii, phil, & + axf, ayf, eds_f, kdis_f, wtauz) + + + if (knob_ugwp_solver == 2) call gw_solver_wmsdis & + (im, levs, dtp, kdt, me, taub_okw, klev_okw, if_okw, nf_okw, & + nwfj, ch_fjet, nazfj, spf_fjet, xaz_fjet, yaz_fjet, & + fcor, c2f2, ugrs, vgrs, tgrs, & + qgrs, prsi, delp, prsl, prslk, phii, phil, & + axf, ayf, eds_f, kdis_f, wtauz) + + dudt = dudt + axf * ugwp_effac + dvdt = dvdt + ayf * ugwp_effac + dtdt = dtdt + eds_f * ugwp_effac + kdis = kdis + kdis_f * ugwp_effac + tauz_ngw = wtauz + endif + endif +! +! broad gw-spectra +! + 356 continue + enddo +! +! gw-diag only +! + axtot = dudt + aytot = dvdt + eps_tot = dtdt + +! +! optional rf-damping +! + if (do_rfdamp) then +! +! + call rf_damp(im, levs, levs_rf, dtp, rfdis, rfdist, ugrs, vgrs, ax_rf, ay_rf, eps_rf) +! +! gw-diag only + rf-damping ..... now orchestrate it with FV3-dycore RF-damping +! + do k=levs_rf, levs + + dudt(:,k) = dudt(:,k) + ax_rf(:,k) + dvdt(:,k) = dvdt(:,k) + ay_rf(:,k) + dtdt(:,k) = dtdt(:,k) + eps_rf(:,k) + + enddo + + endif +!================================================================================ +! To update U-V-T STATE by [dudt dvdt dtdt kdis+rf] => Solve 3-diag VD-equation +!================================================================================ +! to do for fv3wam=> +! joint eddy+molecular viscosity/conductivity/diffusion +! requires "dqdt" + dudt_vis, dvdt_vis. dtdt_cond + +! print *, ' cires_ugwp_driver +++++++++++++++++ ' +! + end subroutine cires_ugwp_driver + + +!============================================= + + + subroutine cires_ugwp_advance +!----------------------------------------------------------------------- +! +! options for the day-to-day variable sources/spectra + diagnostics +! for stochastic "triggers" +! diagnose GW-source functions * FGF + OKWP + SGO/CONV from IAU-fields +! or use for stochastic GWP-sources "memory" +!----------------------------------------------------------------------- + implicit none +! +! update sources +! a) physics-based triggers for multi-wave +! b) stochastic-based spectra and amplitudes +! c) use "memory" on GW-spectra from previous time-step +! d) update "background" GW dissipation as needed +! + end subroutine cires_ugwp_advance + +! +! ----------------------------------------------------------------------- +! finalize of cires_ugwp (_finalize) +! ----------------------------------------------------------------------- + + + subroutine cires_ugwp_mod_finalize +! +! deallocate sources/spectra & some diagnostics need to find where "deaalocate them" +! before "end" of the FV3GFS +! + implicit none +! +! deallocate arrays employed in: +! cires_ugwp_advance / cires_ugwp_driver / cires_ugwp_init +! + deallocate( kvg, ktg ) + deallocate( krad, kion ) + deallocate( zkm, pmb ) + deallocate( rfdis, rfdist) + + end subroutine cires_ugwp_mod_finalize +! + end module cires_ugwp_module + diff --git a/physics/cires_ugwp_post.F90 b/physics/cires_ugwp_post.F90 new file mode 100755 index 000000000..7d106235d --- /dev/null +++ b/physics/cires_ugwp_post.F90 @@ -0,0 +1,115 @@ +!> \file cires_ugwp_post.F90 +!! This file contains +module cires_ugwp_post + +contains + +!>\defgroup cires_ugwp_post CIRES UGWP Scheme Post +!! @{ +!> \section arg_table_cires_ugwp_post_init Argument Table +!! + subroutine cires_ugwp_post_init () + end subroutine cires_ugwp_post_init + +!>@brief The subroutine initializes the CIRES UGWP +#if 0 +!> \section arg_table_cires_ugwp_post_run Argument Table +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |------------------|--------------------------------------------------------------------------------|------------------------------------------------------------------------|-----------|------|-----------|-----------|--------|----------| +!! | ldiag_ugwp | diag_ugwp_flag | flag for CIRES UGWP Diagnostics | flag | 0 | logical | | in | F | +!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | none | F | +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | levs | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | +!! | gw_dudt | tendency_of_x_wind_due_to_ugwp | zonal wind tendency due to UGWP | m s-2 | 2 | real | kind_phys | none | F | +!! | tau_tofd | instantaneous_momentum_flux_due_to_turbulent_orographic_form_drag | momentum flux or stress due to TOFD | Pa | 2 | real | kind_phys | none | F | +!! | tau_mtb | instantaneous_momentum_flux_due_to_mountain_blocking_drag | momentum flux or stress due to mountain blocking drag | Pa | 2 | real | kind_phys | none | F | +!! | tau_ogw | instantaneous_momentum_flux_due_to_orographic_gravity_wave_drag | momentum flux or stress due to orographic gravity wave drag | Pa | 2 | real | kind_phys | none | F | +!! | tau_ngw | instantaneous_momentum_flux_due_to_nonstationary_gravity_wave | momentum flux or stress due to nonstationary gravity waves | Pa | 2 | real | kind_phys | none | F | +!! | zmtb | height_of_mountain_blocking | height of mountain blocking drag | m | 1 | real | kind_phys | none | F | +!! | zlwb | height_of_low_level_wave_breaking | height of low level wave breaking | m | 1 | real | kind_phys | none | F | +!! | zogw | height_of_launch_level_of_orographic_gravity_wave | height of launch level of orographic gravity wave | m | 1 | real | kind_phys | none | F | +!! | dudt_mtb | instantaneous_change_in_x_wind_due_to_mountain_blocking_drag | instantaneous change in x wind due to mountain blocking drag | m s-2 | 2 | real | kind_phys | none | F | +!! | dudt_ogw | instantaneous_change_in_x_wind_due_to_orographic_gravity_wave_drag | instantaneous change in x wind due to orographic gw drag | m s-2 | 2 | real | kind_phys | none | F | +!! | dudt_tms | instantaneous_change_in_x_wind_due_to_turbulent_orographic_form_drag | instantaneous change in x wind due to TOFD | m s-2 | 2 | real | kind_phys | none | F | +!! | cnvgwd | flag_convective_gravity_wave_drag | flag for conv gravity wave drag | flag | 0 | logical | | in | F | +!! | tot_zmtb | time_integral_of_height_of_mountain_blocking | time integral of height of mountain blocking drag | m | 1 | real | kind_phys | none | F | +!! | tot_zlwb | time_integral_of_height_of_low_level_wave_breaking | time integral of height of drag due to low level wave breaking | m | 1 | real | kind_phys | none | F | +!! | tot_zogw | time_integral_of_height_of_launch_level_of_orographic_gravity_wave | time integral of height of launch level of orographic gravity wave | m | 1 | real | kind_phys | none | F | +!! | tot_tofd | time_integral_of_momentum_flux_due_to_turbulent_orographic_form_drag | time integral of momentum flux due to TOFD | Pa | 2 | real | kind_phys | none | F | +!! | tot_mtb | time_integral_of_momentum_flux_due_to_mountain_blocking_drag | time integral of momentum flux due to mountain blocking drag | Pa | 2 | real | kind_phys | none | F | +!! | tot_ogw | time_integral_of_momentum_flux_due_to_orographic_gravity_wave_drag | time integral of momentum flux due to orographic gravity wave drag | Pa | 2 | real | kind_phys | none | F | +!! | tot_ngw | time_integral_of_momentum_flux_due_to_nonstationary_gravity_wave | time integral of momentum flux due to nonstationary gravity waves | Pa | 2 | real | kind_phys | none | F | +!! | du3dt_mtb | time_integral_of_change_in_x_wind_due_to_mountain_blocking_drag | time integral of change in x wind due to mountain blocking drag | m s-2 | 2 | real | kind_phys | none | F | +!! | du3dt_ogw | time_integral_of_change_in_x_wind_due_to_orographic_gravity_wave_drag | time integral of change in x wind due to orographic gw drag | m s-2 | 2 | real | kind_phys | none | F | +!! | du3dt_tms | time_integral_of_change_in_x_wind_due_to_turbulent_orographic_form_drag | time integral of change in x wind due to TOFD | m s-2 | 2 | real | kind_phys | none | F | +!! | du3dt_ngw | time_integral_of_change_in_x_wind_due_to_nonstationary_gravity_wave | time integral of change in x wind due to NGW | m s-2 | 2 | real | kind_phys | none | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! +#endif + + + subroutine cires_ugwp_post_run (ldiag_ugwp, dtf, im, levs, & + gw_dudt, tau_tofd, tau_mtb, tau_ogw, tau_ngw, & + zmtb, zlwb, zogw, dudt_mtb, dudt_ogw, dudt_tms, & + tot_zmtb, tot_zlwb, tot_zogw, & + tot_tofd, tot_mtb, tot_ogw, tot_ngw, & + du3dt_mtb,du3dt_ogw, du3dt_tms, du3dt_ngw, & + cnvgwd, errmsg, errflg) + + use machine, only: kind_phys + + implicit none + + ! Interface variables + integer, intent(in) :: im, levs + real(kind=kind_phys), intent(in) :: dtf + logical, intent(in) :: ldiag_ugwp !< flag for CIRES UGWP Diagnostics + logical, intent(inout) :: cnvgwd !< flag to turn on/off convective gwd + + real(kind=kind_phys), intent(in), dimension(im) :: zmtb, zlwb, zogw + real(kind=kind_phys), intent(in), dimension(im) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw + real(kind=kind_phys), intent(out), dimension(im) :: tot_mtb, tot_ogw, tot_tofd, tot_ngw + real(kind=kind_phys), intent(out), dimension(im) :: tot_zmtb, tot_zlwb, tot_zogw + real(kind=kind_phys), intent(in), dimension(im, levs) :: gw_dudt, dudt_mtb, dudt_ogw, dudt_tms + real(kind=kind_phys), intent(out), dimension(im, levs) :: du3dt_mtb, du3dt_ogw, du3dt_tms, du3dt_ngw + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (.not. (ldiag_ugwp)) return + + + if (ldiag_ugwp) then + tot_zmtb = tot_zmtb + dtf *zmtb + tot_zlwb = tot_zlwb + dtf *zlwb + tot_zogw = tot_zogw + dtf *zogw + + tot_tofd = tot_tofd + dtf *tau_tofd + tot_mtb = tot_mtb + dtf *tau_mtb + tot_ogw = tot_ogw + dtf *tau_ogw + tot_ngw = tot_ngw + dtf *tau_ngw + + du3dt_mtb = du3dt_mtb + dtf *dudt_mtb + du3dt_tms = du3dt_tms + dtf *dudt_tms + du3dt_ogw = du3dt_ogw + dtf *dudt_ogw + du3dt_ngw = du3dt_ngw + dtf *gw_dudt + endif + + + cnvgwd = .false. + + end subroutine cires_ugwp_post_run + +!> \section arg_table_cires_ugwp_post_finalize Argument Table +!! + subroutine cires_ugwp_post_finalize () + end subroutine cires_ugwp_post_finalize + +!! @} +end module cires_ugwp_post diff --git a/physics/cires_ugwp_solvers.F90 b/physics/cires_ugwp_solvers.F90 new file mode 100644 index 000000000..daba9b4c7 --- /dev/null +++ b/physics/cires_ugwp_solvers.F90 @@ -0,0 +1,664 @@ +! GW SOLVERS: +!=========== SOLVER_ORODIS; SOLVER_WMSDIS, SOLVER_LSATDIS +! + RF_DAMP if it is needed along with ugwp_tofd +!=========== +! Note in contrast to dycore vertical indices: surface=1 top=levs +! +! Collection of main friction-GWD solvers +! +! subroutine ugwp_oro +! +! subroutine gw_solver_linsatdis +! subroutine gw_solver_wmsdis +! subroutine rf_damp +! +! =========== +! +! + subroutine ugwp_oro(im, levs, dtp, kdt,me, lprnt, fcor, c2f2, & + u, v, tkin, pint, delp, pmid, pexner, gzint, gzmid, orostat, & + hpbl, axz, ayz, edis, kdis, dusfc, dvsfc, & + dusfc_mb, dvsfc_mb, dusfc_ogw, dvsfc_ogw, dusfc_lwb, dvsfc_lwb, & + zmtb, zlwb, zogw, tauf_ogw, tauz_ogw, axmtb, axlwb, axtms ) +!---------------------------------------------------------------------- +! COORDE-output: 6-hour inst: U, V, T, PMSL, PS, HT (ounce) +! 3D 6-hr aver: DYN-U, SSO-U, PBL-U, AF-U1.... +! 2D 6-hr aver: tau_SSO, tau_GWD, tau_BL; & +! tau_sso = tau_mtb + tau_tofd + tau_lwb +tau_ogw +! ZM 6-hr aver: tau_RES = PS*dH/dx -zonal mean +! Experiments: Midlat 80-200km +! LR_CTL; ; LR_NOSSO with TOFD/TMS; +! LR_NOGWD (MTN+TOFD); LR_GWD4 --- 4 times taub +!---------------------------------------------------------------------- + use machine , only : kind_phys + use ugwp_oro_init, only : cdmb, cleff, sigfac, hncrit, hpmin, hminmt + use ugwp_oro_init, only : gamm_std, sigma_std + use ugwp_common , only : rgrav, grav, cpd, rd, rv, rcpd, rcpd2 + + + use ugwp_common , only : pi, rad_to_deg, deg_to_rad, pi2 + + use cires_ugwp_module, only : kxw, max_kdis, max_axyz + + implicit none + logical :: lprnt + integer :: im, levs + integer :: me + integer :: kdt + real(kind_phys) :: dtp + real(kind_phys), dimension(im) :: hpbl ! pbl-height in meters + real(kind_phys), dimension(im) :: fcor, c2f2 + real(kind_phys), dimension(im, 14) :: orostat + real(kind_phys), dimension(im, levs) :: u, v, tkin, q + + real(kind_phys), dimension(im, levs) :: pmid, pexner, gzmid, delp + real(kind_phys), dimension(im, levs+1) :: pint, gzint + + + real(kind_phys), dimension(im, levs) :: axz, ayz, edis, kdis ! total 6-hr averaged tendencies + real(kind_phys), dimension(im, levs) :: krf2d + real(kind_phys), dimension(im, levs) :: tauz_ogw, axmtb, axlwb, axtms ! 3-sub components axogw = axz-(axmtb+axlwb+axtms) + real(kind_phys), dimension(im) :: tauf_ogw ! total-source momentum flux + + real(kind_phys), dimension(im) :: zmtb, zlwb, zogw + + real(kind_phys), dimension(im) :: dusfc, dvsfc ! total tausfc_sso + real(kind_phys), dimension(im) :: dusfc_mb, dvsfc_mb ! integrated tau_mtb + real(kind_phys), dimension(im) :: dusfc_ogw, dvsfc_ogw ! integrated tau_ogw + real(kind_phys), dimension(im) :: dusfc_lwb, dvsfc_lwb ! integrated tau_lwb + real(kind_phys), dimension(im) :: dusfc_tofd, dvsfc_tofd ! integrated tau_tofd + +! +! mu=hprime gamm=a/b sigma theta +! which stand for the standard deviation, the anisotropy, the slope and the orientation of the orography. +! + real(kind_phys) :: elvmax(im) + real(kind_phys) :: hprime(im) + + real(kind_phys) :: theta !the orienatation, angle + real(kind_phys) :: sigma !the slope dh/dx + real(kind_phys) :: gamm !the anisotropy see ifs-oro + + real(kind_phys) :: oc, oa4(4), clx4(4) !kim & doyle 2005 .... attempt to do TOFD ..? +! + integer, allocatable :: k_elev(:), k_mtb(:), k_ogw(:), k_lee(:), k_tofd(:) + + real(kind_phys) wk(im) + + real(kind_phys) eng0, eng1 +! +! +! + real(kind_phys), dimension(levs) :: up, vp, tp, qp, dp, zpm, pmid1, pex + + real(kind_phys), dimension(levs+1) :: taudz, rhoi, rim_z, pint1, zpi + real(kind_phys), dimension(levs) :: drtau, kdis_oro +! + real (kind_phys) :: elvp, elvpd, dtaux, dtauy + real(kind_phys) :: loss, mtb_fric, mbx, mby + real(kind_phys) :: sigflt + + real(kind_phys) :: zpbl = 2000. ! can be passed from PBL physics as in gwdps.f +! + logical icrilv(im) +! +!---- mountain/oro gravity wave drag +TOFD +! + real(kind=kind_phys), dimension(levs) :: utofd1, vtofd1, epstofd1, krf_tofd1 +! + real(kind=kind_phys), dimension(levs) :: drlee, drmtb, drlow, drogw + real(kind_phys) :: r_cpdt, acc_lim + real(kind_phys), dimension(im) :: tautot, tauogw, taumtb, taulee, taurf + real(kind_phys) :: xn, yn, umag, kxridge, & + tx1, tx2 + real(kind=kind_phys),dimension(levs+1):: tau_src + + integer :: npt, krefj, kdswj, kotr, i, j, k + integer :: ipt(im) + +! +! copy 1D +! + do i=1, im + hprime(i) = orostat(i, 1) + elvmax(i) = orostat(i, 14) +! + tautot(i) = 0.0 + tauogw(i) = 0.0 + taumtb(i) = 0.0 + taulee(i) = 0.0 + taurf(i) = 0.0 +! + dusfc(i) = 0.0 + dvsfc(i) = 0.0 + dusfc_mb(i) = 0.0 + dvsfc_mb(i) = 0.0 + dusfc_ogw(i) = 0.0 + dvsfc_ogw(i) = 0.0 + dusfc_lwb(i) = 0.0 + dvsfc_lwb(i) = 0.0 + dusfc_tofd(i) = 0.0 + dvsfc_tofd(i) = 0.0 + tauf_ogw(i) = 0.0 +! + zmtb(i) = -99. + zlwb(i) = -99. + zogw(i) = -99. + ipt(i) = 0 + enddo +! print *, maxval(hprime), maxval(elvmax), ' check hprime -elevmax ugwp_oro' +! +! 3-part of oro-effects + ked_oro +! + do k=1, levs + do i=1, im + axz(i,k) = 0.0 + ayz(i,k) = 0.0 + edis(i,k) = 0.0 + kdis(i,k) = 0.0 + krf2d(i,k) = 0.0 + tauz_ogw(i,k) = 0.0 + axmtb(i:,k) = 0.0 + axlwb(i,k) = 0.0 + axtms(i,k) = 0.0 + enddo + enddo + +! +! optional diag 3-parts of drag: [tx_ogw, tx_mtb, tx_lee] +! +! ----do we have orography for mtb and gwd calculation points ? +! + npt = 0 + do i = 1,im + if ( (elvmax(i) > hminmt) .and. (hprime(i) > hpmin) ) then + npt = npt + 1 + ipt(npt) = i + + endif + enddo + if (npt == 0) return ! no ororgraphy ====> gwd/mb calculation done + +! allocate(iwklm(npt), idxzb(npt), kreflm(npt)) + allocate( k_elev(npt), k_mtb(npt), k_ogw(npt), k_lee(npt), k_tofd(npt)) + do i=1,npt + k_ogw (i) = 2 + k_tofd(i) = 2 + k_lee (i) = 2 + k_mtb(i) = 0 + k_elev(i) = 2 + enddo +! +! controls through: use ugwp_oro_init +! main ORO-loop sigfac = n*sigma = [1.5, 2, 2.5, 4]*hprime +! + + + do i = 1, npt +! + j = ipt(i) + + elvpd = elvmax(j) + elvp = min (elvpd + sigfac * hprime(j), hncrit) + + sigma = orostat(j,13) + gamm = orostat(j,12) + theta = orostat(j,11)*deg_to_rad + + if (sigma == 0.0 ) then + sigma = sigma_std + gamm = gamm_std + theta = 0.0 + endif + + oc = orostat(j,2) + oa4(1) = orostat(j,3) + oa4(2) = orostat(j,4) + oa4(3) = orostat(j,5) + oa4(4) = orostat(j,6) + clx4(1) = orostat(j,7) + clx4(2) = orostat(j,8) + clx4(3) = orostat(j,9) + clx4(4) = orostat(j,10) +! +! do column-based diagnostics "more-efficient" for oro-places +! + + do k=1,levs + up(k) = u(j,k) + vp(k) = v(j,k) + tp(k) = tkin(j,k) + qp(k) = q(j,k) + dp(k) = delp(j,k) + + zpm(k) = gzmid(j,k) * rgrav + pmid1(k) = pmid(j,k) + pex(k) = pexner(j,k) + enddo + do k=1,levs+1 + zpi(k) = gzint(j,k) * rgrav + pint1(k) = pint(j,k) + enddo +! +! elvp- k-index: iwklm k_elvp = index for elvmax + 4*hprime, "elevation index" +! GFS-2017 + do k=1, levs-1 + if (elvp <= zpi(k+1) .and. elvp > zpi(k)) then + k_elev(i) = k+1 !......simply k+1 next interface level + exit + endif + enddo +! if (elvp .ge. 300. ) then +! write(6,333) elvp, zpi(1), elvpd, hprime(j), sigfac, hncrit +! pause +! endif +!333 format(6(3x, F10.3)) +! +! SSO effects: TOFD-drag/friction coefficients can be calculated +! + sigflt = hprime(j)*0.01 ! turb SSo(j) ...small-scale orography < 2-5 km .... + zpbl = hpbl(j) + + call ugwp_tofd1d(levs, sigflt, elvPd, zpi(1), zpbl, up, vp, zpm, & + utofd1, vtofd1, epstofd1, krf_tofd1) + + do k=1, levs + krf2d(j,k) = krf_tofd1(k) + axtms(j,k) = utofd1(k) +!------- +! nullify ORO-tendencies +! + drmtb(k) = 0.0 + drlee(k) = 0.0 + drtau(k) = 0.0 + drlow(k) = 0.0 + enddo + +!------- +! +! levels of k_mtb(i)/mtb + kdswj/dwlee + krefj/ogwd inside next "subs" +! zmtb, zlwb, zogw +! drmtb, drlow/drlee, drogw +!------- +! +! mtb : drmtb => 1-st order friction as well as TurbulentOro-Drag +! + call ugwp_drag_mtb( k_elev(i), levs, & + elvpd, elvp, hprime(j), sigma, theta, oc, oa4, clx4, gamm, zpbl, & + up, vp, tp, qp, dp, zpm, zpi, pmid1, pint1, k_mtb(i), drmtb, taumtb(j)) + + axmtb(j,1:levs) = drmtb(1:levs)*up(1:levs) +! +! print * , k_elev(i), k_mtb(i) , taumtb(j)*1.e3, ' k_elev, k_mtb , taumtb ' +! +! tautot = taulee+tauogw + rho*drlee = -d[taulee(z)]/dz +! + + + call ugwp_taub_oro(levs, k_mtb(i), kxw, taumtb(j), fcor(j), & + hprime(j) , sigma, theta, oc, oa4, clx4, gamm, elvp, & + up, vp, tp, qp, dp, zpm, zpi, pmid1, pint1, xn, yn, umag, & + tautot(j), tauogw(j), taulee(j), drlee, tau_src, & + kxridge, kdswj, krefj, kotr) + +! print *, k_mtb(i), kxw, taumtb(j), fcor(j),hprime(j), ' af ugwp_taub_oro ' +! print *, kdswj, krefj, kotr, ' kdswj, krefj, kotr ' + + + tauf_ogw(j) = tautot(j) + axlwb(j,1:levs) = drlee(1:levs) + + if ( k_mtb(i) > 0) zmtb(j) = zpi(k_mtb(i))- zpi(1) + if ( krefj > 0) zogw(j) = zpi(krefj) - zpi(1) + if ( kdswj > 0) zlwb(j) = zpi(kdswj) - zpi(1) +! if ( k_mtb(i) > 0 .and. zmtb(j) > zogw(j)) print *, ' zmtb > zogw ', zmtb(j), zogw(j) +! +! tau: tauogw, kxw/kxridge ATTENTION c2f2(j) = fcor(j)*fcor(j)/kxridge/kxridge +! + if ( (krefj > 1) .and. ( abs(tauogw(j)) > 0.) ) then +! + call ugwp_oro_lsatdis( krefj, levs, tauogw(j), tautot(j), tau_src, kxw, & + fcor(j), kxridge, up, vp, tp, qp, dp, zpm, zpi, pmid1, pint1, & + xn, yn, umag, drtau, kdis_oro) +! + else + drtau = 0. + endif + + tauz_ogw(j,1:levs) = tau_src(1:levs) + + r_cpdt = rcpd2/dtp +! +! + do k = 1,levs +! +! project to x-dir & y=dir and do diagnostics +! & apply limiters and output separate oro-effects +! + drlow(k) = drtau(k) + drlee(k) + acc_lim = min(abs(drlow(k)), max_axyz) + drlow(k) = sign(acc_lim, drlow(k)) + + dtaux = drlow(k) * xn + utofd1(k) + dtauy = drlow(k) * yn + vtofd1(k) + + eng0 = up(k)*up(k)+vp(k)*vp(k) + eng1 = 0.0 +! + if (k < k_mtb(i) .and. drmtb(k) /= 0 ) then + loss = 1.0 / (1.0+drmtb(k)*dtp) + mtb_fric = drmtb(k)*loss +! + mbx = mtb_fric * up(k) + mby = mtb_fric * vp(k) +! + ayz(j,k) = -mby !+ ayz(j,k) + axz(j,k) = -mbx !+ axz(j,k) +! + eng1 = eng0*loss*loss +eng1 + dusfc(j) = dusfc(j) - mbx * dp(k) + dvsfc(j) = dvsfc(j) - mby * dp(k) + endif +! + ayz(j,k) = dtauy + ayz(j,k) + axz(j,k) = dtaux + axz(j,k) +! + tx1 = u(j,k) + dtaux*dtp + tx2 = v(j,k) + dtauy*dtp + eng1 = tx1*tx1 + tx2*tx2 + eng1 + + dusfc(j) = dusfc(j) + dtaux * dp(k) + dvsfc(j) = dvsfc(j) + dtauy * dp(k) + + edis(j,k) = max(eng0-eng1, 0.0) * r_cpdt !+ epstofd1(k) + kdis(j,k) = min(kdis_oro(k), max_kdis ) + + enddo +! + dusfc(j) = -rgrav * dusfc(j) + dvsfc(j) = -rgrav * dvsfc(j) +! +! oro-locations +! + enddo ! ipt - oro-loop .... "fraction of Land" in the grid box + deallocate(k_elev, k_mtb, k_ogw, k_lee, k_tofd ) +! + end subroutine ugwp_oro +! +! + subroutine gw_solver_linsatdis(im, levs, dtp, kdt, me, & + taub, klev, if_src, nf_src, nw, ch, naz, spf, xaz, yaz, & + fcor, c2f2, u, v, t, q, prsi, delp, prsl, prslk, phii, phil, & + ax, ay, eps, ked, tauz) + + use ugwp_common , only : rgrav, grav, cpd, rd, rv, rcpd, rcpd2 + use ugwp_common , only : pi, rad_to_deg, deg_to_rad, pi2 + + use cires_ugwp_module, only : kxw, max_kdis, max_axyz, max_eps + use cires_ugwp_module, only : kvg, ktg, krad, kion + + implicit none + integer :: im, levs + integer :: me, kdt, nw, naz, nf_src + real :: dtp + integer, dimension(im) :: klev, if_src + real, dimension(im) :: taub, fcor, c2f2 + + real, dimension(naz) :: xaz, yaz + real, dimension(nw ) :: ch, spf +!========================== + real, dimension(im, levs) :: u, v, t, delp, prsl, prslk, phil, q + real, dimension(im, levs+1) :: prsi , phii +!========================== + real, dimension(im, levs) :: ax, ay, eps, ked, tauz + + real, dimension(levs) :: u1, v1, t1, dp, pmid, zmid, pex1, & + q1, rho + real, dimension(levs+1) :: pint , zint, ui, vi, ti, & + bn2i, bvi, rhoi + integer :: i, j, k, ksrc + real, dimension(nw) :: taub_spect +! real, dimension(levs) :: ax1, ay1, eps1 +! real, dimension(levs+1) :: ked1, tau1 + real :: chm, ss + real, parameter :: dsp = 1./20. + logical :: pfirst=.true. + + save pfirst +128 Format (2x, I4, 4(2x, F10.3)) + +! do i=1, nw +! spf(i) = exp(-Ch(i)*dsp) +! enddo +! ss = sum(spf) +! spf(1:nw) = spf(1:nw)/ss + + if (pfirst ) then + j = 1 + ksrc = klev(j) + taub_spect(1:nw) = spf(1:nw)*taub(j) + print * + chm = 0. + do i=1, nw + write(6, 128) i, spf(i), taub_spect(i)*1.e3, ch(i), ch(i)-chm + chm = ch(i) + enddo + + print * + pause + endif + + do j=1,im + if (if_src(j) == 1) then +! +! compute GW-effects +! prsi, delp, prsl, prslk, phii, phil +! + do k=1,levs + u1(k) = u(j,k) + v1(k) = v(j,k) + t1(k) = t(j,k) + q1(k) = q(j,k) ! H2O-index -1 in tracer-array + dp(k) = delp(j,k) + + zmid(k) = phil(j,k) * rgrav + pmid(k) = prsl(j,k) +! pex1(k) = prslk(j,k) + enddo + do k=1,levs+1 + zint(k) = phii(j,k) * rgrav + pint(k) = prsi(j,k) + enddo + + call mflow_tauz(levs, u1, v1, t1, q1, dp, zmid, zint, & + pmid, pint, rho, ui, vi, ti, bn2i, bvi, rhoi) +! + ksrc = klev(j) + taub_spect(1:nw) = spf(1:nw)*taub(j)/rhoi(ksrc) + if (pfirst .and. j ==1 ) then + + print *, maxval(taub_spect)/kxw*bvi(ksrc)/ch(1), ' Urms ' + print *, maxval(zmid), minval(zmid) , ' zmid ' + print *, maxval(zint), minval(zint) , ' zint ' + print *, maxval(rho), minval(rho) , ' rho ' + print *, maxval(rhoi), minval(rhoi) , ' rhoi ' + print *, maxval(ti), minval(ti) , ' tempi ' + print *, maxval(ui), minval(ui) , ' ui ' + print *, maxval(u1), minval(u1) , ' ++++ u1 ' + print *, maxval(vi), minval(vi) , ' vi ' + print *, maxval(v1), minval(v1) , ' ++++ v1 ' + print *, maxval(pint), minval(pint) , ' pint ' + pause + endif +! + call ugwp_lsatdis_naz(levs, ksrc, nw, naz, kxw, taub_spect, & + ch, xaz, yaz, fcor(j), c2f2(j), dp, & + zmid, zint, pmid, pint, rho, ui, vi, ti, & + kvg, ktg, krad, kion, bn2i, bvi, rhoi, & + ax(j,1:levs), ay(j,1:levs), eps(j,1:levs), & + ked(j,1:levs), tauz(j,1:levs)) +! kvg, ktg, krad, kion, bn2i, bvi, rhoi, ax1, ay1, eps1, ked1, tau1) + + if (pfirst .and. j ==1 ) then + + print *, maxval(taub_spect)/kxw*bvi(ksrc)/ch(1), ' Urms ' + print *, maxval(zmid), minval(zmid) , ' zmid ' + print *, maxval(zint), minval(zint) , ' zint ' + print *, maxval(rho), minval(rho) , ' rho ' + print *, maxval(rhoi), minval(rhoi) , ' rhoi ' + print *, maxval(ti), minval(ti) , ' rhoi ' + print *, maxval(ui), minval(ui) , ' ui ' + print *, maxval(vi), minval(vi) , ' vi ' + print *, maxval(pint), minval(pint) , ' pint ' + pause + endif +! +! ax(j,:) = ax1 +! ay(j,:) = ay1 +! eps(j,:) = eps1 +! ked(j,:) = ked1(1:levs) +! tauz(j,:) = tau1(1:levs) + endif + + enddo + pfirst = .false. +! +! spectral solver for discrete spectra of GWs in N-azimiths +! Linear saturation with background dissipation +! + end subroutine gw_solver_linsatdis +! + subroutine gw_solver_wmsdis(im, levs, dtp, kdt, me, & + taub, klev, if_src, nf_src, nw, ch, naz, spf, xaz, yaz, & + fcor, c2f2, u, v, t, q, prsi, delp, prsl, prslk, phii, phil, & + ax, ay, eps, ked, tauz) +! use para_taub, only : tau_ex + use ugwp_common , only : rgrav, grav, cpd, rd, rv, rcpd, rcpd2 + use ugwp_common , only : pi, rad_to_deg, deg_to_rad, pi2 + + use cires_ugwp_module, only : kxw, max_kdis, max_axyz, max_eps + use cires_ugwp_module, only : kvg, ktg, krad, kion + + implicit none + integer :: im, levs, me, kdt, nw, naz, nf_src + real :: dtp + + integer, dimension(im) :: klev, if_src + real, dimension(im) :: taub, fcor, c2f2 + + real, dimension(naz) :: xaz, yaz + real, dimension(nw ) :: ch, spf +!========================== + real, dimension(im, levs) :: u, v, t, delp, prsl, prslk, phil, q + real, dimension(im, levs+1) :: prsi , phii +!========================== + real, dimension(im, levs) :: ax, ay, eps, ked, tauz + + real, dimension(levs) :: u1, v1, t1, dp, pmid, zmid, pex1, q1, rho + real, dimension(levs+1) :: pint , zint, ui, vi, ti, bn2i, bvi, rhoi + + integer :: i, j, k, ksrc + real, dimension(nw) :: taub_spect +! real, dimension(levs) :: ax1, ay1, eps1 +! real,dimension(levs+1) :: ked1, tau1 + real :: tau_ex + +! print *, nf_src, 'nf_src ... gw_solver_wmsdis ' +! print *, if_src, 'if_src ... gw_solver_wmsdis ' + + do j=1,im + if (if_src(j) == 1) then +! +! compute gw-effects +! prsi, delp, prsl, prslk, phii, phil +! + do k=1,levs + u1(k) = u(j,k) + v1(k) = v(j,k) + t1(k) = t(j,k) + q1(k) = q(j,k) ! h2o-index -1 in tracer-array + dp(k) = delp(j,k) + + zmid(k) = phil(j,k) *rgrav + pmid(k) = prsl(j,k) +! pex1(k) = prslk(j,k) + enddo + do k=1,levs+1 + zint(k) = phii(j,k)*rgrav + pint(k) = prsi(j,k) + enddo + + call mflow_tauz(levs, u1, v1, t1, q1, dp, zmid, zint, & + pmid, pint, rho, ui, vi, ti, bn2i, bvi, rhoi) +! +! any extras bkg-arrays +! + ksrc = klev(j) +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +! +! more work for spectral setup for different "slopes" +! +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + tau_ex = taub(j) + taub_spect(1:nw) = spf(1:nw)/rhoi(ksrc) *tau_ex ! check it ....*tau_ex(j) + +! +! call FVS93_ugwps(nw, ch, dch, taub_spect, spnorm, nslope, bn2i(ksrc), bvi(ksrc), bnrho(ksrc)) +! +! print *, ' bf ugwp_wmsdis_naz ksrc', ksrc, zmid(ksrc) + + call ugwp_wmsdis_naz(levs, ksrc, nw, naz, kxw, tau_ex, ch, xaz, yaz, & + fcor(j), c2f2(j), dp, zmid, zint, pmid, pint, & + rho, ui, vi, ti, kvg, ktg, krad, kion, bn2i, bvi, & + rhoi, ax(j,1:levs), ay(j,1:levs), eps(j,1:levs), & + ked(j,1:levs), tauz(j,1:levs)) +! kvg, ktg, krad, kion, bn2i, bvi, rhoi, ax1, ay1, eps1, ked1, tau1) + +! print *, ' after ugwp_wmsdis_naz ksrc', ksrc, zint(ksrc) + +! subroutine ugwp_wmsdis_naz(levs, ksrc, nw, naz, kxw, taub_lat, ch, xaz, yaz, & +! fcor, c2f2, dp, zmid, zint, pmid, pint, rho, ui, vi, ti, & +! kvg, ktg, krad, kion, bn2i, bvi, rhoi, ax, ay, eps, ked) + +! ax(j,:) = ax1 +! ay(j,:) = ay1 +! eps(j,:) = eps1 +! ked(j,:) = ked1(1:levs) +! tauz(j,:) = tau1(1:levs) + + endif + + enddo +! +! ugwp_wmsdis_naz everything similar to linsat , except spectral saturation +! +! + return + end subroutine gw_solver_wmsdis +! +! + subroutine rf_damp(im, levs, levs_rf, dtp, rfdis, rfdist, u, v, ax, ay, eps) + use ugwp_common, only : rcpd2 + + implicit none + + integer :: im, levs, levs_rf + real :: dtp + real, dimension(levs) :: rfdis, rfdist + real, dimension(im, levs) :: u, v, ax, ay, eps + real :: ud, vd, rdtp + integer :: i, k + + rdtp = 1.0 / dtp + + do k= levs_rf, levs + do i=1,im + ud = rfdis(k)*u(i,k) + vd = rfdis(k)*u(i,k) + ax(i,k) = rfdist(k)*u(i,k) + ay(i,k) = rfdist(k)*v(i,k) + eps(i,k) = rcpd2*(u(i,k)*u(i,k) +v(i,k)*v(i,k) -ud*ud -vd*vd) + enddo + enddo + end subroutine rf_damp +! diff --git a/physics/cires_ugwp_triggers.F90 b/physics/cires_ugwp_triggers.F90 new file mode 100644 index 000000000..07782e44d --- /dev/null +++ b/physics/cires_ugwp_triggers.F90 @@ -0,0 +1,573 @@ + subroutine ugwp_triggers + implicit none + write(6,*) ' physics-based triggers for UGWP ' + end subroutine ugwp_triggers +! + SUBROUTINE subs_diag_geo(nx, ny, lat, lon, rlat, rlon, dy, dx, & + cosv, rlatc, brcos, brcos2, dlam1, dlam2, dlat, divJp, divJm) + use ugwp_common , only : deg_to_rad + + implicit none + integer :: nx, ny + real :: lon(nx), lat(ny) + real :: rlon(nx), rlat(ny) , cosv(ny), tanlat(ny) + real :: rlatc(ny-1), brcos(ny), brcos2(ny) + real :: earth_r, ra1, ra2, dx, dy, dlat + real :: dlam1(ny), dlam2(ny), divJp(ny), divJm(ny) + integer :: j +! +! specify common constants and +! geometric factors to compute deriv-es etc ... +! coriolis coslat tan etc... +! + earth_r = 6370.e3 + ra1 = 1.0 / earth_r + ra2 = ra1*ra1 +! + rlat = lat*deg_to_rad + rlon = lon*deg_to_rad + tanlat = atan(rlat) + cosv = cos(rlat) + dy = rlat(2)-rlat(1) + dx = rlon(2)-rlon(1) +! + + do j=1, ny-1 + rlatc(j) = 0.5 * (rlat(j)+rlat(j+1)) + enddo + + +! + + do j=2, ny-1 + brcos(j) = 1.0 / cos(rlat(j))*ra1 + enddo + + brcos(1) = brcos(2) + brcos(ny) = brcos(ny-1) + brcos2 = brcos*brcos +! + dlam1 = brcos / (dx+dx) + dlam2 = brcos2 / (dx*dx) + + dlat = ra1 / (dy+dy) + + divJp = dlat*cosv + divJM = dlat*cosv +! + do j=2, ny-1 + divJp(j) = dlat*cosv(j+1)/cosv(j) + divJM(j) = dlat*cosv(j-1)/cosv(j) + enddo + divJp(1) = divjp(2) !*divjp(1)/divjp(2) + divJp(ny) = divjp(1) + divJM(1) = divjM(2) !*divjM(1)/divjM(2) + divJM(ny) = divjM(1) +! + return + end SUBROUTINE subs_diag_geo +! + subroutine get_xy_pt(V, Vx, Vy, nx, ny, dlam1, dlat) +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +! compute for each Vert-column: grad(V) +! periodic in X and central diff ... +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + implicit none + integer :: nx, ny + real :: V(nx, ny), dlam1(ny), dlat + real :: Vx(nx, ny), Vy(nx, ny) + integer :: i, j + do i=2, nx-1 + Vx(i,:) = dlam1(:)*(V(i+1,:)-V(i-1,:)) + enddo + Vx(1,:) = dlam1(:)*(V(2,:)-V(nx,:)) + Vx(nx,:) = dlam1(:)*(V(1,:)-V(nx-1,:)) + + do j=2, ny-1 + Vy(:,j) = dlat*(V(:,j+1)-V(:, j-1)) + enddo + Vy(:, 1) = dlat*2.*(V(:,2)-V(:,1)) + Vy(:,ny) = dlat*2.*(V(:,ny)-V(:,ny-1)) + + end subroutine get_xy_pt + + subroutine get_xyd_wind( V, Vx, Vy, Vyd, nx, ny, dlam1, dlat, divJp, divJm) +! +! compute for each Vert-column: grad(V) +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + implicit none + integer :: nx, ny + real :: V(nx, ny), dlam1(ny), dlat + real :: Divjp(ny), Divjm(ny) + real :: Vx(nx, ny), Vy(nx, ny), Vyd(nx, ny) + integer :: i, j + do i=2, nx-1 + Vx(i,:) = dlam1(:)*(V(i+1,:)-V(i-1,:)) + enddo + Vx(1,:) = dlam1(:)*(V(2,:)-V(nx,:)) + Vx(nx,:) = dlam1(:)*(V(1,:)-V(nx-1,:)) + + do j=2, ny-1 + Vy(:,j) = dlat*(V(:,j+1)-V(:, j-1)) + enddo + Vy(:, 1) = dlat*2.*(V(:,2)-V(:,1)) + Vy(:,ny) = dlat*2.*(V(:,ny)-V(:,ny-1)) +!~~~~~~~~~~~~~~~~~~~~ +! 1/cos*d(vcos)/dy +!~~~~~~~~~~~~~~~~~~~~ + do j=2, ny-1 + Vyd(:,j) = divJP(j)*V(:,j+1)-V(:, j-1)*divJM(j) + enddo + Vyd(:, 1) = Vyd(:,2) + Vyd(:,ny) = Vyd(:,ny-1) + + end subroutine get_xyd_wind + + subroutine trig3d_fjets( nx, ny, nz, U, V, T, Q, P3D, PS, delp, delz, lon, lat, pmid, trig3d_fgf) + implicit none + integer :: nx, ny, nz + real :: lon(nx), lat(ny) +! + real, dimension(nz) :: pmid + real, dimension(nx, ny, nz) :: U, V, T, Q, delp, delz, p3d + real, dimension(nx, ny ) :: PS + real, dimension(nx, ny, nz) :: trig3d_fgf +! +! locals +! + real, dimension(nx, ny) :: ux, uy, uyd, vy, vx, vyd, ptx, pty + integer :: k, i, j + + real, parameter :: cappa=2./7., pref=1.e5 + real, dimension(nx, ny) :: pt, w1, w2 + + real :: rlon(nx), rlat(ny) , cosv(ny), tanlat(ny) + real :: rlatc(ny-1), brcos(ny), brcos2(ny) + + real :: dx, dy, dlat + real :: dlam1(ny), dlam2(ny), divJp(ny), divJm(ny) + + + call subs_diag_geo(nx, ny, lat, lon, rlat, rlon, dy, dx, & + cosv, rlatc, brcos, brcos2, dlam1, dlam2, dlat, divJp, divJm) + + do k=1, nz + w1(:,:) = P3d(:,:,k) + w2(:,:) = T(:,:,k) + + pt = w2*(pref/w1)**cappa + call get_xy_pt(Pt, ptx, pty, nx, ny, dlam1, dlat) + w1(:,:) = V(:,:, K) + call get_xyd_wind( w1, Vx, Vy, Vyd, nx, ny, dlam1, dlat, divJp, divJm) + w1(:,:) = U(:,:, K) + call get_xyd_wind( w1, Ux, Uy, Uyd, nx, ny, dlam1, dlat, divJp, divJm) + + trig3d_fgf(:,:,k) = -ptx*ptx*ux - pty*pty*vy -(vx+uyd)*ptx*pty + + enddo + end subroutine trig3d_fjets + + subroutine trig3d_okubo( nx, ny, nz, U, V, T, Q, P3d, PS, delp, delz, lon, lat, pmid, trig3d_okw) + implicit none + integer :: nx, ny, nz + real :: lon(nx), lat(ny) +! + real, dimension(nz) :: pmid + real, dimension(nx, ny, nz) :: U, V, T, Q, delp, delz, p3d + real, dimension(nx, ny ) :: PS + real, dimension(nx, ny, nz) :: trig3d_okw +! +! locals +! + real, dimension(nx, ny) :: ux, uy, uyd, vy, vx, vyd, ptx, pty + integer :: k, i, j + + real, parameter :: cappa=2./7., pref=1.e5 + real, dimension(nx, ny) :: pt, w1, w2, d1 + + real :: rlon(nx), rlat(ny) , cosv(ny), tanlat(ny) + real :: rlatc(ny-1), brcos(ny), brcos2(ny) + + real :: dx, dy, dlat + real :: dlam1(ny), dlam2(ny), divJp(ny), divJm(ny) + + call subs_diag_geo(nx, ny, lat, lon, rlat, rlon, dy, dx, & + cosv, rlatc, brcos, brcos2, dlam1, dlam2, dlat, divJp, divJm) + + do k=1, nz + w1(:,:) = P3d(:,:,k) + w2(:,:) = T(:,:,k) + + pt = w2*(pref/w1)**cappa + call get_xy_pt(Pt, ptx, pty, nx, ny, dlam1, dlat) + w1(:,:) = V(:,:, K) + call get_xyd_wind( w1, Vx, Vy, Vyd, nx, ny, dlam1, dlat, divJp, divJm) + w1(:,:) = U(:,:, K) + call get_xyd_wind( w1, Ux, Uy, Uyd, nx, ny, dlam1, dlat, divJp, divJm) + + trig3d_okw(:,:,k) = -ptx*ptx*ux - pty*pty*vy -(vx+uyd)*ptx*pty + w1 = (Ux -Vy)*(Ux-Vy) + (Vx +Uy)*(Vx+Uy) ! S2 + W2 = (Vx - Uyd)*(Vx - Uyd) + D1 = Ux + Vyd + trig3d_okw(:,:,k) = W1 -W2 +! trig3d_okw(:, :, k) =S2 -W2 +! trig3d_okw(:, :, k) =D1*D1 + 4*(Vx*Uyd -Ux*Vyd) ! ocean +! trig3d_okw(:, :, k) = trig3d_okw(:,:,k) + D1*D1 + 2.*D1*sqrt(abs(W1-W2)) ! S2 =W1Ted-luk + enddo + end subroutine trig3d_okubo +! + subroutine trig3d_dconv(nx, ny, nz, U, V, T, Q, P3d, PS, delp, delz, lon, lat, pmid, trig3d_conv, & + dcheat3d, precip2d, cld_klevs2d, scheat3d) + + implicit none + integer :: nx, ny, nz + real :: lon(nx), lat(ny) +! + real, dimension(nz) :: pmid + real, dimension(nx, ny, nz) :: U, V, T, Q, delp, delz, p3d + real, dimension(nx, ny ) :: PS + real, dimension(nx, ny, nz) :: trig3d_conv + + real, dimension(nx, ny, nz) :: dcheat3d, scheat3d + real, dimension(nx, ny ) :: precip2d + integer,dimension(nx, ny, 3 ):: cld_klevs2d + integer :: k + end subroutine trig3d_dconv + + subroutine cires_3d_triggers( nx, ny, nz, lon, lat, pmid, & + U, V, W, T, Q, delp, delz, p3d, PS, HS, Hyam, Hybm, Hyai, Hybi, & + trig3d_okw, trig3d_fgf, trig3d_conv, & + dcheat3d, precip2d, cld_klevs2d, scheat3d) + + implicit none + integer :: nx, ny, nz + real :: lon(nx), lat(ny) +! +! reversed ??? Hyai, Hybi , pmid +! + real, dimension(nz+2) :: Hyai, Hybi + real, dimension(nz+1) :: Hyam, Hybm +! + real, dimension(nz) :: pmid + real, dimension(nx, ny, nz) :: U, V, W, T, Q, delp, delz, p3d + real, dimension(nx, ny ) :: PS, HS + real, dimension(nx, ny, nz) :: trig3d_okw, trig3d_fgf, trig3d_conv + real, dimension(nx, ny, nz) :: dcheat3d, scheat3d + real, dimension(nx, ny ) :: precip2d + integer,dimension(nx, ny, 3 ):: cld_klevs2d + real :: dzkm, zkm + integer :: k +!================================================================================== +! fgf and OW-triggers +! read PRECIP + SH/DC conv heating + cloud-top-bot-middle from "separate" file !!! +! +!=================================================================================== + + call trig3d_fjets( nx, ny, nz, U, V, T, Q, P3D, PS, delp, delz, lon, lat, pmid, trig3d_fgf) + call trig3d_okubo( nx, ny, nz, U, V, T, Q, P3D, PS, delp, delz, lon, lat, pmid, trig3d_okw) + call trig3d_dconv(nx, ny, nz, U, V, T, Q, P3D, PS, delp, delz, lon, lat, pmid, trig3d_conv, & + dcheat3d, precip2d, cld_klevs2d, scheat3d) +!===================================================================================================== +! output of triggers: trig3d_fgf, trig3d_okw, trig3d_conv, cheat3d, precip2d, cld_klevs2d, scheat3d +! +! Bulk momentum flux=/ 0 and levels for launches +! +!===================================================================================================== + 111 format(i6, 4(3x, F8.3), ' trigger-grid ') + + do k=1, nz-1 + zkm = -7.*alog(pmid(k)*1.e-3) + dzkm = zkm +7.*alog(pmid(k+1)*1.e-3) + write(6,111) k, hybi(k), pmid(k), zkm, dzkm !' triggers ' + enddo + + end subroutine cires_3d_triggers +!================================================================================== +! tot-flux launch 0 or 1 # of Launches +! specify time-dep bulk sources: taub, klev, if_src, nf_src +! +!================================================================================== + subroutine get_spectra_tau_convgw & + (nw, im, levs, dcheat, scheat, precip, icld, xlatd, sinlat, coslat,taub, klev, if_src, nf_src) +! +! temporarily can put GEOS-5/MERRA-2 GW-lat dependent function +! + integer :: nw, im, levs + integer,dimension(im,3) :: icld + real, dimension(im, levs) :: dcheat, scheat + real, dimension(im) :: precip, xlatd, sinlat, coslat + real, dimension(im) :: taub + integer, dimension(im) :: klev, if_src + integer :: nf_src +! +! locals + real, parameter :: precip_max = 100. ! mm/day + real, parameter :: tau_amp = 35.e-3 ! 35 mPa + + integer :: i, k, klow, ktop, kmid + real :: dtot, dmax, daver +! + nf_src = 0 + if_src(1:im) = 0 + taub(1:im) = 0.0 + do i=1, im + klow = icld(i,1) + ktop = icld(i,2) + kmid= icld(i,3) + if (klow == -99 .and. ktop == -99) then + cycle + else + klev(i) = ktop + k = klow + klev(i) = k + dmax = abs(dcheat(i,k) + scheat(i,k)) + do k=klow+1, ktop + dtot =abs(dcheat(i,k) + scheat(i,k)) + if ( dtot > dmax) then + klev(i) = k + dmax = dtot + endif + enddo +! +! klev as max( dcheat(i,k) + scheat) +! vertical width of conv-heating +! +! counts/triiger=1 & taub(i) +! + nf_src = nf_src +1 + if_src(i) = 1 + taub(i) = tau_amp* precip(i)/precip_max*coslat(i) + endif + + enddo +! +! 100 mb launch and MERRA-2 slat-forcing +! + call Slat_geos5(im, xlatd, taub) + nf_src =im + do i=1, im + if_src(i) = 1 + klev(i) = 127-45 + enddo + +! with info on precip/clouds/dc_heat create Bulk +! taub(im), klev(im) +! +! print *, ' get_spectra_tau_convgw ' + end subroutine get_spectra_tau_convgw +! + subroutine get_spectra_tau_nstgw(nw, im, levs, trig_fgf, xlatd, sinlat, coslat, taub, klev, if_src, nf_src) + integer :: nw, im, levs + real, dimension(im, levs) :: trig_fgf +! real, dimension(im, levs+1) :: pint + real, dimension(im) :: xlatd, sinlat, coslat + real, dimension(im) :: taub + integer, dimension(im) :: klev, if_src + integer :: nf_src +! locals + real, parameter :: tlim_fgf = 100. ! trig_fgf > tlim_fgf, launch waves should scale-dependent + real, parameter :: tau_amp = 35.e-3 ! 35 mPa + real, parameter :: pmax = 750.e2, pmin = 100.e2 + integer, parameter :: klow =127-92, ktop=127-45 + integer, parameter :: kwidth = ktop-klow+1 + integer :: i, k, kex + real :: dtot, dmax, daver + real :: fnorm, tau_min + nf_src = 0 + if_src(1:im) = 0 + taub(1:im) = 0.0 + fnorm = 1.0 / float(kwidth) + tau_min = tau_amp*fnorm + do i=1, im +! +! only trop-c fjets so find max(trig_fgf) => klev +! use abs-values to scale tau_amp +! + + k = klow + klev(i) = k + dmax = abs(trig_fgf(i,k)) + kex = 0 + if (dmax >= tlim_fgf) kex = kex+1 + do k=klow+1, ktop + dtot = abs(trig_fgf(i,k)) + if (dtot >= tlim_fgf) kex = kex+1 + if ( dtot > dmax) then + klev(i) = k + dmax = dtot + endif + enddo + + if (dmax .ge. tlim_fgf) then + nf_src = nf_src +1 + if_src(i) = 1 + taub(i) = tau_min*float(kex) !* precip(i)/precip_max*coslat(i) + endif + + enddo +! +! print *, ' get_spectra_tau_nstgw ' + call Slat_geos5(im, xlatd, taub) + nf_src =im + do i=1, im + if_src(i) = 1 + klev(i) = 127-45 + enddo +! + end subroutine get_spectra_tau_nstgw +! + subroutine get_spectra_tau_okw(nw, im, levs, trig_okw, xlatd, sinlat, coslat, taub, klev, if_src, nf_src) + integer :: nw, im, levs + real, dimension(im, levs) :: trig_okw +! real, dimension(im, levs+1) :: pint + real, dimension(im) :: xlatd, sinlat, coslat + real, dimension(im) :: taub + integer, dimension(im) :: klev, if_src + integer :: nf_src +! locals + real, parameter :: tlim_okw = 100. ! trig_fgf > tlim_fgf, launch waves should scale-dependent + real, parameter :: tau_amp = 35.e-3 ! 35 mPa + real, parameter :: pmax = 750.e2, pmin = 100.e2 + integer, parameter :: klow =127-92, ktop=127-45 + integer, parameter :: kwidth = ktop-klow+1 + integer :: i, k, kex + real :: dtot, dmax, daver + real :: fnorm, tau_min + + nf_src = 0 + if_src(1:im) = 0 + taub(1:im) = 0.0 + fnorm = 1./float(kwidth) + tau_min = tau_amp*fnorm + print *, ' get_spectra_tau_okwgw ' + do i=1, im + k = klow + klev(i) = k + dmax = abs(trig_okw(i,k)) + kex = 0 + if (dmax >= tlim_okw) kex = kex+1 + do k=klow+1, ktop + dtot = abs(trig_okw(i,k)) + if (dtot >= tlim_fgf ) kex = kex+1 + if ( dtot > dmax) then + klev(i) = k + dmax = dtot + endif + enddo +! + if (dmax >= tlim_okw) then + nf_src = nf_src +1 + if_src(i) = 1 + taub(i) = tau_min*float(kex) !* precip(i)/precip_max*coslat(i) + endif + + enddo + print *, ' get_spectra_tau_okwgw ' + end subroutine get_spectra_tau_okw +! +! +! + subroutine slat_geos5_tamp(im, tau_amp, xlatdeg, tau_gw) +!================= +! GEOS-5 & MERRA-2 lat-dependent GW-source function tau(z=Zlaunch) =rho* +!================= + implicit none + integer :: im + real :: xlatdeg(im), tau_amp + real :: tau_gw(im) + real :: latdeg +! real, parameter :: tau_amp = 100.e-3 + real :: trop_gw, flat_gw + integer :: i + +! +! if-lat +! + trop_gw = 0.75 + do i=1, im + latdeg = xlatdeg(i) + if (-15.3 < latdeg .and. latdeg < 15.3) then + flat_gw = trop_gw*exp(-( (abs(latdeg)-3.)/8.0)**2) + if (flat_gw < 1.2 .and. abs(latdeg) <= 3.) flat_gw = trop_gw + else if (latdeg > -31. .and. latdeg <= -15.3) then + flat_gw = 0.10 + else if (latdeg < 31. .and. latdeg >= 15.3) then + flat_gw = 0.10 + else if (latdeg > -60. .and. latdeg <= -31.) then + flat_gw = 0.50*exp(-((abs(latdeg)-60.)/23.)**2) + else if (latdeg < 60. .and. latdeg >= 31.) then + flat_gw = 0.50*exp(-((abs(latdeg)-60.)/23.)**2) + else if (latdeg <= -60.) then + flat_gw = 0.50*exp(-((abs(latdeg)-60.)/70.)**2) + else if (latdeg >= 60.) then + flat_gw = 0.50*exp(-((abs(latdeg)-60.)/70.)**2) + end if + tau_gw(i) = tau_amp*flat_gw + enddo +! + end subroutine slat_geos5_tamp + + subroutine slat_geos5(im, xlatdeg, tau_gw) +!================= +! GEOS-5 & MERRA-2 lat-dependent GW-source function tau(z=Zlaunch) =rho* +!================= + implicit none + integer :: im + real :: xlatdeg(im) + real :: tau_gw(im) + real :: latdeg + real, parameter :: tau_amp = 100.e-3 + real :: trop_gw, flat_gw + integer :: i +! +! if-lat +! + trop_gw = 0.75 + do i=1, im + latdeg = xlatdeg(i) + if (-15.3 < latdeg .and. latdeg < 15.3) then + flat_gw = trop_gw*exp(-( (abs(latdeg)-3.)/8.0)**2) + if (flat_gw < 1.2 .and. abs(latdeg) <= 3.) flat_gw = trop_gw + else if (latdeg > -31. .and. latdeg <= -15.3) then + flat_gw = 0.10 + else if (latdeg < 31. .and. latdeg >= 15.3) then + flat_gw = 0.10 + else if (latdeg > -60. .and. latdeg <= -31.) then + flat_gw = 0.50*exp(-((abs(latdeg)-60.)/23.)**2) + else if (latdeg < 60. .and. latdeg >= 31.) then + flat_gw = 0.50*exp(-((abs(latdeg)-60.)/23.)**2) + else if (latdeg <= -60.) then + flat_gw = 0.50*exp(-((abs(latdeg)-60.)/70.)**2) + else if (latdeg >= 60.) then + flat_gw = 0.50*exp(-((abs(latdeg)-60.)/70.)**2) + end if + tau_gw(i) = tau_amp*flat_gw + enddo +! + end subroutine slat_geos5 + subroutine init_nazdir(naz, xaz, yaz) + use ugwp_common , only : pi2 + implicit none + integer :: naz + real, dimension(naz) :: xaz, yaz + integer :: idir + real :: phic, drad + drad = pi2/float(naz) + if (naz.ne.4) then + do idir =1, naz + Phic = drad*(float(idir)-1.0) + xaz(idir) = cos(Phic) + yaz(idir) = sin(Phic) + enddo + else +! if (naz.eq.4) then + xaz(1) = 1.0 !E + yaz(1) = 0.0 + xaz(2) = 0.0 + yaz(2) = 1.0 !N + xaz(3) =-1.0 !W + yaz(3) = 0.0 + xaz(4) = 0.0 + yaz(4) =-1.0 !S + endif + end subroutine init_nazdir diff --git a/physics/cires_ugwp_utils.F90 b/physics/cires_ugwp_utils.F90 new file mode 100644 index 000000000..63a5b3238 --- /dev/null +++ b/physics/cires_ugwp_utils.F90 @@ -0,0 +1,152 @@ +! + subroutine um_flow(nz, klow, ktop, up, vp, tp, qp, dp, zpm, zpi, & + pmid, pint, bn2, uhm, vhm, bn2hm, rhohm) +! + use ugwp_common, only : bnv2min, grav, gocp, fv, rdi + implicit none +! +! mass-averaged variables between klow-ktop +! + integer, intent(in) :: nz, klow, ktop + real, dimension(nz), intent(in) :: up, vp, tp, qp, dp, zpm, pmid + real, dimension(nz+1), intent(in) :: pint, zpi + real, dimension(nz), intent(out) :: bn2 + + real :: vtj, rhok, bnv2, rdz + real :: vtkp, vtk, dzp, rhm,dphm + + real, intent(out) :: uhm, vhm, bn2hm, rhohm + + integer :: k +! + dphm = 0.0 !pint(k+1)-pint(k)) + + uhm = 0.0 ! dphm*u1(k) + vhm = 0.0 ! dphm*v1(k) + rhm = 0.0 ! + bn2hm = 0.0 ! +! + do k=klow, ktop + vtj = tp(k) * (1.+fv*qp(k)) + vtk = vtj + vtkp = tp(k+1) * (1.+fv*qp(k+1)) + rhok = rdi * pmid(k) / vtj ! density kg/m**3 + rdz = 1.0 / (zpm(k+1)-zpm(k)) +! dry +! bnv2 = grav * (rdz * ( tp(k+1)-tp(k)) +grcp) /tp(k) +! +! wet +! + bnv2 = grav * (rdz * ( vtkp- vtk) +gocp) /vtk +! if (bnv2 < 0) print *, k, bnv2, ' bnv2 < 0 ', klow, ktop + bnv2 = max(bnv2, bnv2min ) + dzp = pint(k+1)-pint(k) + + dphm = dphm + dzp + uhm = uhm + up(k)*dzp + vhm = vhm + vp(k)*dzp + rhm = rhm + rhok*dzp + bn2hm = bn2hm + bnv2 * dzp + bn2(k) = bnv2 + enddo + + uhm = uhm/dphm + vhm = vhm/dphm + rhm = rhm/dphm + bn2hm = bn2hm/dphm + rhohm = rhm/dphm +! +! print *, ' MF-BV ', bn2hm, bn2(ktop), bn2(klow) +! + end subroutine um_flow +! +! + subroutine mflow_tauz(levs, up, vp, tp, qp, dp, zpm, zpi, & + pmid, pint, rho, ui, vi, ti, bn2i, bvi, rhoi) + + use ugwp_common, only : bnv2min, grav, gocp, fv, rdi + + implicit none + + integer :: levs + real, dimension(levs) :: up, vp, tp, qp, dp, zpm, pmid + real, dimension(levs+1) :: pint, rho, zpi + real, dimension(levs) :: zdelpi, zdelpm + real :: zul, bvl + real, dimension(levs+1) :: ui, vi, bn2i, bvi, rhoi, ti, qi + + real :: vtj, rhok, bnv2, rdz + real :: vtkp, vtk, dzp + real :: vtji + integer :: k +! +! get interface values from surf to top +! + do k=2,levs + vi(k) = 0.5 *(vp(k-1) + vp(k)) + ui(k) = 0.5 *(up(k-1) + up(k)) + ti(k) = 0.5 *(tp(k-1) + tp(k)) + qi(k) = 0.5 *(qp(k-1) + qp(k)) + enddo + + k=1 + ti(k) = tp(k) + ui(k) = up(k) + vi(k) = vp(k) + qi(k) = qp(k) + k= levs + ti(k+1) = tp(k) + ui(k+1) = up(k) + vi(k+1) = vp(k) + qi(k+1)=qp(k) + + do k=1,levs-1 + vtj = tp(k) * (1.+fv*qp(k)) + vtji = ti(k) * (1.+fv*qi(k)) + rho(k) = rdi * pmid(k) / vtj ! density kg/m**3 + rhoi(k) = rdi * pint(k) / vtji + vtk = vtj + vtkp = tp(k+1) * (1.+fv*qp(k+1)) + rdz = 1. / ( zpm(k+1)-zpm(k)) + bnv2 = grav * (rdz * ( vtkp- vtk) +gocp) /vtji + bn2i(k) = max(bnv2, bnv2min ) + bvi(k) = sqrt( bn2i(k) ) + vtk = vtkp + enddo + k = levs + vtj = tp(k) ! * (1.+fv*qp(k)) + vtji = ti(k) !* (1.+fv*qi(k)) + rho(k) = rdi * pmid(k) / vtj + rhoi(k) = rdi * pint(k) / vtji + bn2i(k) = bn2i(k-1) + bvi(k) = sqrt( bn2i(k) ) + k = levs+1 + rhoi(k) = rdi * pint(k) / ti(k) + bn2i(k) = bn2i(k-1) + bvi(k) = sqrt( bn2i(k) ) +! do k=1,levs +! write(6, 121) k, zpm(k)*1.e-3, zpi(k)*1.e-3, bvi(k), rho(k), rhoi(k) +! enddo + 121 format(i5, 2x, 3(2x, F10.3), 2(2x, E10.3)) + + end subroutine mflow_tauz + +! + subroutine get_unit_vector(u, v, u_n, v_n, mag) + implicit none + real, intent(in) :: u, v + real, intent(out) :: u_n, v_n, mag +! + + mag = sqrt(u*u + v*v) + + if (mag > 0.0) then + u_n = u/mag + v_n = v/mag + else + u_n = 0. + v_n = 0. + end if + + end subroutine get_unit_vector +! diff --git a/physics/cires_vert_lsatdis.F90 b/physics/cires_vert_lsatdis.F90 new file mode 100644 index 000000000..a44b8dde0 --- /dev/null +++ b/physics/cires_vert_lsatdis.F90 @@ -0,0 +1,524 @@ + subroutine ugwp_lsatdis_naz(levs, ksrc, nw, naz, kxw, taub_spect, ch, xaz, yaz, & + fcor, c2f2, dp, zmid, zint, pmid, pint, rho, ui, vi, ti, & + kvg, ktg, krad, kion, bn2i, bvi, rhoi, ax, ay, eps, ked, tau1) +! +! call ugwp_lsatdis_naz(levs, ksrc, nw, naz, kxw, taub_spect, ch, xaz, yaz, & +! fcor(j), c2f2(j), dp, zmid, zint, pmid, pint, rho, ui, vi, ti, & +! kvg, ktg, krad, kion, bn2i, bvi, rhoi, ax1, ay1, eps1, ked1) + use ugwp_common, only : rcpd, grav, rgrav + implicit none +! + integer :: levs, nw, naz, ksrc + real :: kxw + real, dimension(nw) :: taub_spect, ch + real, dimension(naz) :: xaz, yaz + real, dimension(levs+1) :: ui, vi, ti, bn2i, bvi, rhoi, zint, pint + real, dimension(levs ) :: dp, rho, pmid, zmid + real :: fcor, c2f2 + real, dimension(levs+1) :: kvg, ktg, kion, krad, kmol + +! output/locals + real, dimension(levs ) :: ax, ay, eps + real, dimension(levs+1) :: ked , tau1 + + real, dimension(levs+1 ) :: uaz + real, dimension(levs, naz ) :: epsd + real, dimension(levs+1, naz ) :: atau, kedd + real, dimension(levs+1 ) :: taux, tauy + real, dimension(levs ) :: dzirho , dzpi + real :: usrc +! + integer :: iaz, k +! + atau=0.0 ; epsd=0.0 ; kedd=0.0 + + do k=1,levs + dzpi(k) = -(pint(k+1)-pint(k))/rho(k)*rgrav + dzirho(k) = 1./rho(k)/dzpi(k) ! grav/abs(dp(k)) still hydrostatic "UGWP" + enddo + + LOOP_IAZ: do iaz =1, naz + usrc = ui(ksrc)*xaz(iaz) +vi(ksrc)*yaz(iaz) + do k=1,levs+1 + uaz(k) =ui(k)*xaz(iaz) +vi(k)*yaz(iaz) -usrc + enddo +! +! if (nw .le. 4) call stochastic ..ugwp_lsatdis_az1 only 4-waves ch_ngw1, fuw_ngw1, eff_ngw1=1 +! +! multi-wave scheme +! + if (nw .gt. 4) then + call ugwp_lsatdis_az1(levs, ksrc, nw, kxw, ch, taub_spect, & + fcor, c2f2, zmid, zint, rho, uaz, ti, bn2i, bvi, rhoi, dzirho, dzpi, & + kvg, ktg, krad, kion, kmol, epsd(:, iaz), kedd(:,iaz), atau(:, iaz) ) + + endif +! + ENDDO LOOP_IAZ ! Azimuth of GW propagation directions +! +! sum over azimuth and project aTau(z, iza) =>(taux and tauy) +! for scalars for "wave-drag vector" +! + eps =0. ; ked =0. + do k=ksrc, levs + eps(k) = sum(epsd(k,:))*rcpd + enddo + + do k=ksrc, levs+1 + taux(k) = sum( atau(k,:)*xaz(:)) + tauy(k) = sum( atau(k,:)*yaz(:)) + ked(k) = sum(kedd(k,:)) + enddo + + tau1(ksrc:levs) = taux(ksrc:levs) + tau1(1:ksrc-1) = tau1(ksrc) +! +! end solver: gw_azimuth_solver_LS81 +! sign Ax in rho*dU/dt = -d(rho*tau)/dz +! [(k) - (k+1)] + ax =0. ; ay = 0. + do k=ksrc, levs + ax(k) = dzirho(k)*(taux(k)-taux(k+1)) + ay(k) = dzirho(k)*(tauy(k)-tauy(k+1)) + enddo + call ugwp_limit_1d(ax, ay, eps, ked, levs) + return + +! + print * + print *, ' Ax: ', maxval(Ax(ksrc:levs))*86400., minval(Ax(ksrc:levs))*86400. + print *, ' Ay: ', maxval(Ay(ksrc:levs))*86400., minval(Ay(ksrc:levs))*86400. + print *, 'Eps: ', maxval(Eps(ksrc:levs))*86400., minval(Eps(ksrc:levs))*86400. + print *, 'Ked: ', maxval(Ked(ksrc:levs))*1., minval(Ked(ksrc:levs))*1. +! print *, 'Atau ', maxval(atau(ksrc:levs, 1:Naz))*1.e3, minval(atau(ksrc:levs, 1:Naz))*1.e3 +! print *, 'taux_gw: ', maxval(taux( ksrc:levs))*1.e3, minval(taux( ksrc:levs))*1.e3 + print * +!----------------------------------------------------------------------- +! Here we can apply "ad-hoc" or/and "stability-based" limiters on +! (axy_gw, ked_gw and eps_gw) and check vert-inegrated conservation laws: +! energy and momentum and after that => final update gw-phys tendencies +!----------------------------------------------------------------------- + + end subroutine ugwp_lsatdis_naz +! + subroutine ugwp_lsatdis_az1(levs, ksrc, nw, kxw, ch, taub_sp, & + fcor, c2f2, zm, zi, rho, um, tm, bn2, bn, rhoi, & + dzirho, dzpi, kvg, ktg, krad, kion, kmol, eps, ked, tau ) + +! call ugwp_lsatdis_az1(levs, ksrc, nw, kxw, ch, taub_spect, & +! fcor, c2f2, zmid, zint, rho, uaz, ti, bn2i, bvi, rhoi, dzirho, dzpi, & +! kvg, ktg, krad, kion, kmol, epsd(:, iaz), kedd(:,iaz), atau(:, iaz) ) + + use cires_ugwp_module, only : F_coriol, F_nonhyd, F_kds, linsat, linsat2 + use cires_ugwp_module, only : iPr_ktgw, iPr_spgw, iPr_turb, iPr_mol + use cires_ugwp_module, only : rhp4, rhp2, rhp1, khp, cd_ulim +! + implicit NONE +! + integer, intent(in) :: nw ! number of GW modes in given direction + integer, intent(in) :: levs ! vertical layers + integer, intent(in) :: ksrc ! level of GW-launch layer + + real , intent(in) :: kxw ! horizontal wavelength + real , intent(in) :: ch(nw) ! horizontal phase velocities + real , intent(in) :: taub_sp(nw) ! spectral distribution of the mom-flux +! + real, intent(in) :: fcor, c2f2 ! Corilois factors + + real , intent(in) :: um(levs+1) + real , intent(in) :: tm(levs+1) +!in + real, intent(in), dimension(levs) :: rho, zm + real, intent(in), dimension(levs+1) :: rhoi, zi + real, intent(in), dimension(levs+1) :: bn2, bn + real, intent(in), dimension(levs) :: dzpi, dzirho + real, intent(in), dimension(levs+1) :: kvg, ktg, krad, kion, kmol +!======================================================================== +!out + real, dimension(levs+1) :: tau, ked + real, dimension(levs) :: eps + +!========================================================================= +!local + real :: Fd1, Fd2 + real, dimension(levs) :: a_mkz + real, dimension(levs+1,nw) :: sp_tau, sp_ked, sp_kth + real, dimension(levs,nw) :: sp_eps + + real, dimension(levs,nw) :: sp_mkz, sp_etot + real, dimension(levs,nw) :: sp_ek, sp_ep + + + real, dimension(levs) :: swg_ep, swg_ek, swg_et, swg_kz + + real, dimension(nw) :: rtaus ! spectral distribution at ksrc + real :: sum_rtaus ! total flux in iaz-azimuth + real :: Chnorm, Cx, Cs, Cxs, Cx2sat + real :: Fdis, Fdisat + real :: Cdf2, Cdf1 ! (Cd*cd-f*f) and sqrt +! +! two-level => upward integration for wave-filtering (dissip + breaking) +! + real :: taus, tauk, tau_lin + real :: etws, etwk, etw_lin + real :: epss, epsk + real :: kds, kdk + real :: kzw, kzw2, kzw3, kzi, kzs + real :: wfd, wfi ! +! +! for GW dissipation on the rotational sphere +! + real :: Betadis ! Ep/Ek ratio + real :: BetaM, BetaT ! 0.5 or 1./1+b and 1-1/(1+b) + real :: wfdM, wfdT, wfiM, wfiT, wdop2 + + real :: dzi, keff, keff_m, keff_t, keffs + + real :: sf2k2, cf2 + real :: Lzkm, Lzsat + + integer :: i, k, igw + integer :: ksat1, ksat2 + + real :: zsat1, zsat2 + real :: kx2_nh + + real :: rab1, rab2, rab3, rab4, cd_ulim2 + + integer :: Ind_out(nw, levs+1) + +! + logical, parameter :: dbg_print = .false. +! +!=================================================================== +! Nullify arrays +! tau, eps, ked +!==================================================================== + + tau = 0.0 + eps = 0.0 + ked = 0.0 + Ind_out(1:nw,:) = 0 +! +! GW-spectral arrays ..... sp_etot ....sp_tau +! + sp_tau = 0. + sp_eps = 0. + sp_ked = 0. + sp_mkz = -99. + sp_etot = 0. + sp_ek = 0. + sp_ep = 0. + sp_kth = 0. +! + swg_et = 0. + swg_ep = 0. + swg_ek = 0. + swg_kz = 0. + cd_ulim2 = cd_ulim*cd_ulim + cf2 = F_coriol*c2f2 + kx2_nh = F_nonhyd*kxw*kxw + + if (dbg_print) then + write(6,*) linsat , ' eff-linsat & kx ', kxw + write(6,*) maxval(ch), minval(ch), ' ch ' + write(6,*) + write(6,*) maxval(rhoi), minval(rhoi), 'rhoi ' + write(6,*) zi(ksrc) , ' zi(ksrc) ' + write(6,*) cd_ulim, ' crit-level cd_ulim ' + write(6,*) F_coriol, ' F_coriol' + write(6,*) F_nonhyd, ' F_nonhyd ' + write(6,*) maxval(Bn), minval(BN), ' BN-BV ' + write(6,*) Um(ksrc), ' Um-ksrc ', cd_ulim2 , 'cd_ulim2 ', c2f2, ' c2f2 ' + pause + endif + +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +! Loop_GW: over GW-spectra +! of individual non-interactive modes +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +! + Loop_GW: do i=1, nw +! + Kds = 0.0 +! +! src-level +! + Cx = ch(i) - Um(ksrc) + Cdf2 = Cx*Cx - cf2 + taus = taub_sp(i) ! momentum flux for i-mode w/o rhoi(ksrc) + kzw = Bn(ksrc) / Ch(i) ! ch(i) > 0. Cx(i) < 0. critica + etws = taus*kzw / kxw + rtaus(i) = taus*rhoi(ksrc) +! + IF( Cx <= cd_ulim .or. Cdf2 <= cd_ulim2) THEN + Ind_out(i, ksrc) =-1 ! -1 - diagnostic index for critical levels + cycle Loop_GW ! got to the next mode of GW-spectra + ELSE +! + kzw2 = Bn2(ksrc)/Cdf2 - rhp4 - kx2_nh +! + if (kzw2 <= 0.) then + Ind_out(i, ksrc) =-2 ! -2 - diagnostic index for reflected waves + cycle Loop_GW ! no wave reflection in GW-LSD scheme + endif + + kzw = sqrt(kzw2) + kzw3 = kzw2*kzw + etws = taus*kzw/kxw +! +! Here Linsat == Fr_critical +! + Cx2sat = Linsat2*Cdf2 + if (etws >= cx2sat) then + Kds = kxw*Cx*rhp2/kzw3 + etws = cx2sat + taus = etws*kxw/kzw + Ind_out(i, ksrc) =-3 ! -3 - dignostic index for saturated waves + endif +! + betadis = cdf2/(Cx*Cx+cf2) + betaM = 1.0 /(1.0+betadis) + betaT = 1.0 - BetaM +! + Cxs = Cx + kzs = kzw +! keffs = (kvg(ksrc)+kds)*iPr_turb*.5*khp +! sp_kth(ksrc, i) = rhoi(ksrc)*keffs*(Tm(ksrc)+Tm(ksrc-1)) + rtaus(i) = taus*rhoi(ksrc) + sp_tau(ksrc, i) = rtaus(i) + sp_etot(ksrc, i) = etws + sp_mkz(ksrc, i) = kzw + sp_ek(ksrc, i) = etws*betam + sp_ep(ksrc, i) = etws*betaT ! can be transferred to (T'**2) T-rms + +! + ENDIF ! vertical propagation of i-mode to the next upper layer = (ksrc+1) +! +! Loop_Zint .................................. VERTICAL "INTERFACE" LOOP from ksrc => ktop_GW +! + Loop_Zi: do k=ksrc+1, levs +! + Cx = ch(i)-Um(k) ! Um(k) is defined at the interface pressure levels + Cdf2 = Cx*Cx -cf2 + if( Cx <= cd_ulim .or. Cdf2 <= 0.) then + Ind_out(i, k) =-1 ! 1 - diagnostic index for critical levels + ! print*,'crit level C-U ',int(Cx),int(sqrt(cf2)),' Um ',Um(k) + cycle Loop_GW + endif + + cdf1 =sqrt(Cdf2) + wdop2 = (kxw*Cx)* (kxw*Cx) + kzw2 = (Bn2(k)-wdop2)/Cdf2 - rhp4 - kx2_nh ! full lin DS-NIGW (N2-wd2)*k2=(m2+k2+[1/2H]^2)*(wd2-f2) + + if (kzw2 < 0.) then + Ind_out(i, k) =-2 ! 2 - diagnostic index for reflected waves + cycle Loop_GW + endif + kzw = sqrt(kzw2) + kzw3 =kzw2*kzw +! + keff_m = kvg(k)*kzw2 + kion(k) +! keff_t = kturb(k)*iPr_turb + kmol(k)*iPr_mol + keff_t = ktg(k)*kzw2 + krad(k) +! +! + betadis = cdf2 / (Cx*Cx+cf2) + betaM = 1.0 / (1.0+betadis) + betaT = 1.0 - BetaM + +! +!imaginary frequencies of momentum and heat with "kds at (k-1) level" +! + wfiM = kds*kzw2*F_kds + keff_m + wfiT = kds*iPr_ktgw*F_kds * kzw2 + keff_t +! + wfdM = wfiM/(kxw*Cdf1)*BetaM + wfdT = wfiT/(kxw*Cx)*BetaT +! exp-l: "kzi*dz" + kzi = 2.*kzw*(wfdM+wfdT)*dzpi(k) ! 2-factor energy-momentum (U')^2 +!------------------------------------------------------- +! dissipative factor: Fdis +! we can replace WKB-solver by Numerical integration of +! tau_gw == etot_gw/kzw*kxw +! d(rho*tau_gw) = -kdis*rho*tau_gw +! |tau_gw| <= |tau_gwsat| +! linear limit for single mode +! generalization for the "broad" spectra +! or treating single mode breaking +! over finite "vertical"-depth with "efficiency" +! Now: time-step + hor-l scale +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Fdis = exp(-kzi) +! +! +! dissipative "wave rms" by WKB +! + etwk = etws*rhoi(k-1)/rhoi(k)*Fdis*kzw/kzs +! + Cx2sat = Linsat2*Cdf2 +! +! Linear saturation +! + if (etwk.ge.cx2sat) then + + Ind_out(i, k) =-3 ! 3 - dignostic index for saturated waves +! ! saturate energy and "trigger" keddy + etw_lin = etwk + etwk = cx2sat + Kds = kxw*Cdf1*rhp2/kzw3 + tauk = etwk*kxw/kzw + +!=================================================================================== +! WAM/case with high Kds tau_lin = (etw_lin-etwk)*kxw/kzw !tau_loss by sat theory +! Lzsat = 6,28/kzw Zsat1 = Zi(k)-.5*Lzsat +! Zsat2 = Zi(k)+.5*Lzsat +! in WAM triggering from "kds = 0 m2/s" => "200 m2/s" for Lzw ~ 10 km +! +! call sat_domain(zi, Zsat1, Zsat2, pver, ksat1, ksat2) +! +! to avoid it do the new diss-n factor with eddy "kds" added to the +! background keff_m and keff_t +! +! can be taken out for the strato-mesosphere in GFS +! wfiM = kds*kzw2 + keff_m +! wfiT = kds*iPr_ktgw * kzw2 +keff_t +! wfdM = wfiM/(kxw*Cdf1)*BetaM +! wfdT = wfiT/(kxw*Cx)*BetaT +! kzi = 2.*kzw*(wfdM+wfdT)*dzpi(k) +! Fdisat = exp(-kzi) +! etwk = etws*rhoi(k-1)/rhoi(k)*Fdis*(kzw/Kzs) +! updated breaking in the Lzsat-domain: zsat1 < zi < zsat2 +! ================================================================================= + else + kds = 0.0 + tauk = etwk*kxw/kzw ! = Ekin*kx/kz + ENDIF +!-------------------------------------- +! +! Fill in spectral arrays(levs, nw) +! +!-------------------------------------- + sp_ked(k,i) = kds ! defined at interfaces + sp_tau(k, i) = tauk*rhoi(k) ! defined at interfaces + +! keff = (kds + kvg(k))*iPr_turb*0.5*KHP +! sp_kth(k, i) = rhoi(k)*keff*(Tm(k)+Tm(k-1)) ! defined at mid-layers + + sp_etot(k, i) = etwk ! defined at interfaces + sp_mkz(k, i) = kzw ! defined at interfaces + sp_ek(k, i) = etwk*betam ! defined at interfaces + sp_ep(k, i) = etwk*betaT ! can be transferred to (T'**2) +! +! + if (sp_tau(k,i) > sp_tau(k-1,i)) then + sp_tau(k,i) = sp_tau(k-1,i) ! prevent "possible" numerical "noise" + endif +! +! updates for "eps and keff" from +! + rab1 =.5*(cx+cxs)*dzirho(k) +! heating +! due to wave dissipation +! + sp_eps(k,i) = rab1*(sp_tau(k-1,i)- sp_tau(k,i)) ! defined at mid-layers +! +! cooling term due to eddy heat conduction =0 if Keff_cond =>0, +! usually updated by 1D-heat implict tridiagonal solver +! explicit local solver ---->sp_kth(k,i) = Kt*(dT/dz+ R/Cp*T/Hp~>g/cp) +! +! sp_eps(k,i)=sp_eps(k,i)+dzirho(k)*(sp_kth(k,i)- sp_kth(k-1,i)) +! + kzs = kzw + cxs = cX + taus = tauk + etws = etwk +! keffs = keff + + enddo Loop_Zi ! ++++++++++++++ vertical layer +! +! ................................! stop ' in solver single-mode' +! + enddo Loop_GW ! i-mode of GW-spectra +! + sum_rtaus =sum(rtaus) ! total momentum flux at k=ksrc + +! print *, sum_rtaus, ' tau-src ', nint(zi(ksrc)*1.e-3) +! print *, maxval(ch), minval(ch), ' Ch ', ngwv, ' N-modes ' +! +!============================================================================== +! Perform spectral integartion (sum) & apply "efficiency/inremittency" factors +! +! eff_factor: ~ 1./[number of modes in 1-direction of model columns] +! +!============================================================================== + do k=ksrc, levs + + ked(k) =0. + Eps(k) = 0. + Tau(k) = 0. + swg_et(k) =0. + swg_ep(k) =0. + swg_ek(k) =0. + + do i=1,nw + Ked(k) = Ked(k)+sp_ked(k,i) + Eps(k) = Eps(k)+sp_eps(k,i) + Tau(k) = Tau(k)+sp_tau(k,i) +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +! GW-energy + GW-en flux ~ Cgz*E, diagnostics-only +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + swg_et(k) = swg_et(k)+sp_etot(k,i) !*eff_fact + swg_ep(k) = swg_ep(k)+sp_ep(k,i) !*eff_fact + swg_ek(k) = swg_ek(k)+sp_ek(k,i) !*eff_fact + enddo + + enddo +! fill in below the "source" level ..... [1:ksrc-1] +! + do k=1, ksrc-1 +! no loss of the total momentum flux + ked(k) =0. + eps(k) = 0. + tau(k) = tau(ksrc) +! lin-theory diagnostics-only + swg_et(k) =swg_et(ksrc)*rhoi(ksrc)/rhoi(k) + swg_ep(k) =swg_ep(ksrc)*rhoi(ksrc)/rhoi(k) + swg_ek(k) =swg_ek(ksrc)*rhoi(ksrc)/rhoi(k) + enddo +! + RETURN +! +! diagnostics below +! +345 FORMAT(2x, F8.2, 4(2x, F10.3), 2x, F8.2) + if (dbg_print) then + print * + print *, ' Zkm EK m2/s2 Ked m2/s Eps m2/s3 tau-Mpa ' + do k=ksrc, levs +! Fd1 = maxval(Fdis_modes(1:nw,k)) +! Fd2 = minval(Fdis_modes(1:nw,k)) + write(6, 345) Zi(k)*1.e-3, sqrt(swg_ek(k)), Ked(k), Eps(k), Tau(k)*1.e3, Um(k) !, Fd1, Fd2 + enddo + print * + write(6,*) nw , ' nwaves-linsat ' + write(6,*) maxval(sp_ked), minval(sp_ked), 'ked ' + write(6,*) maxval(sp_tau), minval(sp_tau), 'sp_tau ' + pause + endif + +! + end subroutine ugwp_lsatdis_az1 +! + subroutine ugwp_limit_1d(ax, ay,eps, ked, levs) + use cires_ugwp_module, only : max_kdis, max_eps, max_axyz + implicit none + integer :: levs + real, dimension(levs) :: ax, ay,eps + real, dimension(levs+1) :: ked + real, parameter :: xtiny = 1.e-30 + where (abs(ax) > max_axyz ) ax = ax/abs(ax+xtiny)*max_axyz + where (abs(ay) > max_axyz ) ay = ay/abs(ay+xtiny)*max_axyz + where (abs(eps) > max_eps ) eps = eps/abs(eps+xtiny)*max_eps + where (ked > max_kdis ) ked = max_kdis + end subroutine ugwp_limit_1d diff --git a/physics/cires_vert_orodis.F90 b/physics/cires_vert_orodis.F90 new file mode 100644 index 000000000..0d3cce194 --- /dev/null +++ b/physics/cires_vert_orodis.F90 @@ -0,0 +1,1018 @@ +! subroutine ugwp_drag_mtb +! subroutine ugwp_taub_oro +! subroutine ugwp_oro_lsatdis +! + subroutine ugwp_drag_mtb( iemax, nz, & + elvpd, elvp, hprime , sigma, theta, oc, oa4, clx4, gam, zpbl, & + up, vp, tp, qp, dp, zpm, zpi, pmid, pint, idxzb, drmtb,taumtb) + + use ugwp_common, only : bnv2min, grav, grcp, fv, rad_to_deg, dw2min, velmin, rdi + use ugwp_oro_init,only : nridge, cdmb, fcrit_mtb, frmax, frmin, strver + + implicit none +!======================== +! several versions for drmtb => high froude mountain blocking +! version 1 => vay_2018 ; +! version 2 => kdn_2005 ; Kim & Doyle in NRL-2005 +! version 3 => ncep/gfs-2017 -gfs_2017 with lm1997 +!======================== + +! character(len=8) :: strver = 'vay_2018' +! real, parameter :: Fcrit_mtb = 0.7 + + integer, intent(in) :: nz + integer, intent(in) :: iemax ! standard ktop z=elvpd + 4 * hprime + real , intent(out) :: taumtb + + integer , intent(out) :: idxzb + real, dimension(nz), intent(out) :: drmtb + + real, intent(in) :: elvp, elvpd !elvp = min (elvpd + sigfac * hprime(j), hncrit=10000meters) + real, intent(in) :: hprime , sigma, theta, oc, oa4(4), clx4(4), gam + real, intent(in) :: zpbl + + real, dimension(nz), intent(in) :: up, vp, tp, qp, dp, zpm, pmid + real, dimension(nz+1), intent(in) :: zpi, pint +! + real, dimension(nz+1) :: zpi_zero + real, dimension(nz) :: zpm_zero + real :: vtj, rhok, bnv2, rdz, vtkp, vtk, dzp + + real, dimension(nz) :: bn2, uds, umf, cosang, sinang + + integer :: k, klow, ktop, kpbl + real :: uhm, vhm, bn2hm, rhohm, & + mtb_fix, umag, bnmag, frd_src, & + zblk, who_iz_normal, rlm97, & + phiang, ang, pe, ek, & + cang, sang, ss2, cs2, zlen, dbtmp, & + hamp, bgamm, cgamm + +!================================================== +! +! elvp + hprime <=>elvp + nridge*hprime, ns =2 +! ns = sigfac +! tau_parel & tau_normal along major "axes" +! +! options to block the "flow", choices for [klow, ktop] +! +! 1-directional (normal) & 2-directional "blocking" +! +!================================================== +! no - blocking: drmtb(1:nz) = 0.0 +!================= + idxzb = -1 + drmtb(1:nz) = 0.0 + taumtb = 0.0 + klow = 2 + + ktop = iemax + hamp = nridge*hprime + +! reminder: cdmb = 4.0 * 192.0/float(imx)*cdmbgwd(1) Lellipse= a/2=sigma/hprime + + mtb_fix = cdmb*sigma/hamp !hamp ~ 2*hprime and 1/sigfac = 0.25 is inside 1/hamp + + if (mtb_fix == 0.) then + print *, cdmb, sigma, hamp + print *, ' MTB == 0' + stop + endif + + if (strver == 'vay_2018') then + + zpm_zero = zpm - zpi(1) + zpi_zero = zpi - zpi(1) + + do k=1, nz-1 + if (hamp .le. zpi_zero(k+1) .and. (hamp .gt. zpi_zero(k) ) ) then + ktop = k+1 !......simply k+1 next interface level + exit + endif + enddo +! print *, klow, ktop, ' klow-ktop ' + call um_flow(nz, klow, ktop, up, vp, tp, qp, dp, zpm, zpi, pmid, pint, & + bn2, uhm, vhm, bn2hm, rhohm) + + umag = max(sqrt(uhm*uhm + vhm*vhm), velmin) !velmin=dw2min =1.0 m/s + if (bn2hm .le. 0.0) then + print *, ' unstable MF for MTB -RETURN ' + RETURN ! unstable PBL + endif + bnmag =sqrt(bn2hm) + + frd_src = min(hamp*bnmag/umag, frmax) ! frmax =10. + +! print *, frd_src, Fcrit_mtb/frd_src, ' no-Blocking > 1 ' +! + if ( frd_src .le. Fcrit_mtb) RETURN ! no-blocking, although on small ridges with weak winds can be blocking +! +! zblk > 0 +! Fcrit_mtb > Fcrit_ogw h_clip = Fr_mtb*U/N ! h_hill minus h_clip = zblk +! + zblk = hamp*(1. - Fcrit_mtb/frd_src) + idxzb =1 + do k = 2, ktop + + if ( zblk < zpm_zero(k) .and. zblk >= zpm_zero(k-1)) then + idxzb = k + exit + endif + enddo +! + if (idxzb == 1) RETURN ! first surface level block is not "important" + + if (idxzb > 1) then ! let start with idxzb = 2....and up with LM1997 +! +! several options to compute MTB-drag: a) IFS_1997 ; b) WRF_KD05 ; c) SJM_2000 +! + bgamm = 1.0 - 0.18*gam -0.04*gam*gam + cgamm = 0.48*gam +0.3*gam*gam + + do k = 1, idxzb-1 + zlen = sqrt( (zblk - zpm_zero(k) ) / ( zpm_zero(k) +hprime )) + + umag = max(sqrt(up(k)*up(k) + vp(k)*vp(k)), velmin) + + phiang = atan(vp(k)/umag) +! theta -90/90 + ang = theta - phiang + cang = cos(ang) ; sang = sin(ang) + + who_iz_normal = max(cang, gam*sang ) !gfs-2018 + + cs2 = cang* cang ; ss2 = 1.-cs2 + + rlm97 =(gam * cs2 + ss2)/ (cs2 + gam * ss2) ! ... (cs2 + gam * ss2) / (gam * cs2 + ss2) ! check it +! + if (rlm97 > 2.0 ) rlm97 = 2.0 ! zero mtb-friction at this level +! + + who_iz_normal = bgamm*cs2 + cgamm*ss2 ! LM1997/IFS + + dbtmp = mtb_fix* max(0., 2.- rlm97)*zlen*who_iz_normal + if (dbtmp < 0) dbtmp = 0.0 +! +! several approximation can be made to implement MTB-drag +! as a "nonlinear level dependent"-drag or "constant"-drag +! uds(k) == umag = const between the 1-layer and idxzb +! + + drmtb(k) = dbtmp * abs(umag) ! full mtb-drag = -drmtb(k) * uds = -kr*u + taumtb = taumtb - drmtb(k)*umag *rdi * pmid(k)/tp(k)*(zpi(k+1)-zpi(k)) +! +! 2-wave appr for anisotropic drmtb_Bellipse(k) and drmtb_Aell(k) can be used +! with Umag-projections on A & B ellipse axes +! mtb_fix =0.25*cdmb*sigma/hprime, +! in SM-2000 mtb_fix~ 1/8*[cdmb_A, cdmb_B]*sigma/hprimesum ( A+B) = 1/4. +! +!333 format(i4, 7(2x, F10.3)) +! write(6,333) , k, zpm_zero(k), zblk, hamp*Fcrit_mtb/frd_src, taumtb*1.e3, drmtb(k) , -drmtb(k)*up(k)*1.e5 + enddo +! + endif + endif ! strver=='vay_2018' +! +! +! + if (strver == 'kdn_2005' .or. strver == 'wrf_2018' ) then + + print *, ' kdn_2005 with # of hills ' +! +! compute flow-blocking stress based on WRF 'gwdo2d' +! + endif +! +! + if (strver == 'gfs_2018') then + + ktop = iemax; klow = 2 + + call um_flow(nz, klow, ktop, up, vp, tp, qp, dp, zpm, zpi, pmid, pint, & + bn2, uhm, vhm, bn2hm, rhohm) + if (bn2hm <= 0.0) RETURN ! unstable PBL +!--------------------------------------------- +! +!'gfs_2018' .... does not rely on Fr_crit +! and Fr-regimes +!----gfs17 for mtn ignores "averaging of the flow" +! for MTB-part it is only works with "angles" +! no projections on [uhm, vhm] -direction +! kpbl can be used for getting high values of iemax-hill +!----------------------------------------------------------- + zpm_zero = zpm - zpi(1) + zpi_zero = zpi - zpi(1) + do k=1, nz-1 + if (zpbl .le. zpm_zero(k+1) .and. (zpbl .ge. zpm_zero(k) ) ) then + kpbl = k+1 + exit + endif + enddo + + do k = iemax, 1, -1 + + uds(k) = max(sqrt(up(k)*up(k) + vp(k)*vp(k)), velmin) + phiang = atan(vp(k)/uds(k)) + ang = theta - phiang + cosang(k) = cos(ang) + sinang(k) = sin(ang) + + if (idxzb == 0) then + pe = pe + bn2(k) * (elvp - zpm(k)) *(zpi(k+1) - zpi(k)) + umf(k) = uds(k) * cosang(k) ! normal to main axis + ek = 0.5 * umf(k) * umf(k) +! +! --- dividing stream lime is found when pe =>exceeds ek first from the "top" +! + if (pe >= ek) idxzb = k + exit + endif + enddo + +! idxzb = min(kpbl, idxzb) +! +! +! +! last: mtb-drag +! + if (idxzb > 1) then + zblk = zpm(idxzb) + print *, zpm(idxzb)*1.e-3, ' mtb-gfs18 block-lev km ', idxzb, iemax, int(elvp) + do k = idxzb-1, 1, -1 +! + zlen = sqrt( (zblk - zpm_zero(k) ) / ( zpm_zero(k) +hprime )) + cs2 = cosang(k)* cosang(k) + ss2 = 1.-cs2 + rlm97 =(gam * cs2 + ss2)/ (cs2 + gam * ss2) ! (cs2 + gam * ss2) / (gam * cs2 + ss2) ! check it + + who_iz_normal = max(cosang(k), gam*sinang(k)) +! +! high res-n higher mtb 0.125 => 3.5 ; (negative of db -- see sign at tendency) +! + dbtmp = mtb_fix* max(0., 2.- rlm97)*zlen*who_iz_normal + + drmtb(k) = dbtmp * abs(uds(k)) ! full mtb-drag = -drmtb(k) * uds = -kr*u +! + taumtb = taumtb - drmtb(k) * uds(k) *rdi * pmid(k)/tp(k)*(zpi(k+1)-zpi(k)) +! + enddo + endif + endif ! strver=='gfs17' +! +! + end subroutine ugwp_drag_mtb +! +! +! ugwp_taub_oro - Computes [taulin, taufrb, drlee(levs) ] +! +! + subroutine ugwp_taub_oro(levs, izb, kxw, tau_izb, fcor, & + hprime , sigma, theta, oc, oa4, clx4, gamm, & + elvp, up, vp, tp, qp, dp, zpm, zpi, pmid, pint, xn, yn, umag, & + tautot, tauogw, taulee, drlee, tau_src, kxridge, kdswj, krefj, kotr) +! + use ugwp_common, only : bnv2min, grav, pi, pi2, dw2min, velmin + use cires_ugwp_module, only : frcrit, ricrit, linsat + use ugwp_oro_init, only : hpmax, cleff, frmax + use ugwp_oro_init, only : nwdir, mdir, fdir + use ugwp_oro_init, only : efmin, efmax , gmax, cg, ceofrc + use ugwp_oro_init, only : fcrit_sm, fcrit_gfs, frmin, frmax + use ugwp_oro_init, only : coro, nridge, odmin, odmax + use ugwp_oro_init, only : strver +! + use ugwp_oro_init, only : mkz2min, lzmax, zbr_pi +! --- +! +! define oro-GW fluxes: taulin, taufrb amd if kdswj > 0 (LWB-lee wave breaking) +! approximate for drlee-momentum tendency +! --- + implicit none +! + integer, intent(in) :: levs, izb + real , intent(in) :: tau_izb ! integrated (1:izb) drag -Kr_mtb*U, or Zero + integer, intent(out) :: kdswj, krefj, kotr + integer :: klwb + real, intent(in) :: kxw, fcor + real, intent(in) :: hprime, sigma, theta, oc, gamm, elvp + +! + real, intent(in) :: oa4(4), clx4(4) + + real, dimension(levs), intent(in) :: up, vp, tp, qp, dp + real, dimension(levs+1), intent(in) :: zpi, pint + real, dimension(levs ), intent(in) :: zpm, pmid +! + real,dimension(levs), intent(out) :: drlee + real,dimension(levs+1), intent(out) :: tau_src +! + real, intent(out) :: tauogw, tautot, taulee + real :: taulin, tauhcr, taumtb + real, intent(out) :: xn, yn, umag, kxridge +! +! +! locals +! four possible versions to compute "taubase as a function of Fr-number" +! character :: strver='smc_2000' ! 'kd_2005', 'gfs_2017', 'vay_2018' +! + real, dimension(levs+1) :: zpi_zero + + real :: oa, clx, odir, cl4p(4), clxp + + real :: uhm, vhm, bn2hm, rhohm, bnv + + real :: elvpMTB, wdir + real :: tem, efact, coefm, kxlinv, gfobnv + + real :: fr, frlin, frlin2, frlin3, frlocal, dfr + real :: betamax, betaf, frlwb, frmtb + integer :: klow, ktop, kph + + integer :: i, j, k, nwd, ind4, idir + + real :: sg_ridge, kx2, umd2 + real :: mkz, mkz2, zbr_mkz, mkzi + + real :: hamp ! clipped hprime*elvmax/elv_clip > hprime + real :: hogw ! hprime or hamp for free-prop OGWs z > z(krefj) + real :: hdsw ! empirical like DNS amplitudes for Lee-dsw trapped waves + real :: hcrit + real :: hblk ! blocking div-stream height + + real :: coef_h2, frnorm + + + real, dimension(levs) :: bn2 + real :: rho(levs) + real, dimension(levs+1) :: ui, vi, ti, bn2i, bvi, rhoi + real, dimension(levs+1) :: umd, phmkz + real :: c2f2, umag2, dzwidth, udir + real :: hogwi, hdswi, hogwz, hdswz ! height*height wave-amp + real :: uogwi, udswi, uogwz, udswz ! wind2 wave-rms + real, dimension(levs+1) :: dtrans, deff + real :: pdtrans + logical :: do_klwb_phase = .false. ! phase-crireria for LLWB of SM00 + logical :: do_dtrans = .true. ! dissipative saturation to deposit momentum + ! between ZMTB => ZHILL +!----------------------------------------------------------------------------- +! +! downslope/lee/GW wave regimes kdswj: between ZMTB and ZOGW(krefj) +! ZMTB < ZOGW = ns*HPRIME < ELVP +! define krefj as a level for OGWs above ZMTB and "2-3-4*hprime" + ZMTB +! we rely on the concept of the "CLIPPED-SG" mountain above ZMTB & new +! inverse Froude number for the "mean flow" averaged from ZMTB to ZOGW +! here we can use "elvp" as only for hprime adjustment ...elvp/elvp_MTB +! +!"empirical" specification of tauwave = taulee+tauogw in [ZMTB : ns*HPRIME] +! can be based on numerical runs like WRF-model +! for Frc < Fr< [Frc : 2.5-3 Frc] +! see suggestions proposed in SM-2000 and Eckermann et al. (2010) +!----------------------------------------------------------------------------- + tautot = 0. ; taulin = 0. ; taulee = 0. ; drlee(1:levs) = 0. ; tau_src = 0.0 + krefj = 1 ; kotr = levs+1; kdswj = 1 + xn = 1.0 ; yn = 0. ; umag = velmin; kxridge = kxw + + dtrans = 0. ; deff =0. + klow = 2 + elvpMTB = elvp +! +! clipped mountain H-zmtb for estimating wave-regimes new Fr and MF above ZMTB +! + if (izb > 0 ) then + klow = izb + elvpMTB = max(elvp - zpi(izb), 0.0) + endif + if (elvpMTB <=0 ) print *, ' blocked flow ' + if (elvpMTB <=0 ) return ! "blocked flow" from the surface to elvMAX + + zpi_zero(:) = zpi(:) - zpi(1) + hblk = zpi_zero(klow) + + sg_ridge = max( nridge*hprime * (elvp/elvpMTB), hblk+hprime*0.333) + +! +! enhance sg_ridge by elvp/elvpMTB >1 and H_clip = H-hiilnew - zblk later for hamp +! + sg_ridge = min(sg_ridge, hpmax) + +! print *, 'sg_ridge ', sg_ridge + + do k=1, levs + if (sg_ridge .gt. zpi_zero(k) .and. ( sg_ridge .le. zpi_zero(k+1) ) ) then + ktop = k+1 + exit + endif + enddo + + krefj = ktop ! the mountain top index for sg_ridge = ns*hprime + +! if ( izb > 0 .and. krefj .le. izb) then +! print *, izb, krefj, sg_ridge, zpi_zero(izb), ' izb >ktop ' +! endif + +! +! here ktop displays sg_ridge-position not elvP !!!! klow =2 to avoid for 127-126L +! instability due to extreme "thin" layer...128L-model needs cruder vertical resolution +! + call um_flow(levs, klow, ktop, up, vp, tp, qp, dp, zpm, zpi, pmid, pint, & + bn2, uhm, vhm, bn2hm, rhohm) + + call get_unit_vector(uhm, vhm, xn, yn, umag) + + if (bn2hm <= 0.0) RETURN ! "unstable/neutral" hill need different treatment + bnv = sqrt(bn2hm) + hamp = sg_ridge-zpi_zero(klow) ! hamp >= nridge*hprime due higher SG-elevations - zblk or first layer + hogw = hamp + hdsw = hamp + + + fr = bnv * hamp /umag + fr = min(fr, frmax) + kxridge = max(sigma/hamp, kxw) ! to get rid from "SSO-errors" kxw-provides max-value for kx + kx2 = kxridge*kxridge + umag = max( umag, velmin) + c2f2 = fcor*fcor/kx2 + umag2 = umag*umag - c2f2 + + if (umag2 <= 0.0) RETURN ! Coriolis cut-off at high-mid latitudes for low kx + + mkz2 = bn2hm/umag2 - kx2 ! we add Coriolis corrections for crude model resolutions "low-kx" + ! and non-stationary waves coro, fcor for small umag + ! bn2hm/[(coro-umag)^2 -fc2/kx2] - kx2, cf = fc/kx => 2 m/s to 11 m/s for 60deg + IF (mkz2 < mkz2min .or. krefj <= 2 ) THEN +! +! case then no effects of wave-orography +! + krefj = 1 ; kdswj = 1; kotr = levs ; klwb = 1 + tautot = 0. + tauogw = 0. + taulee = 0. + drlee = 0. ; tau_src(1:levs+1) = 0. + return + ENDIF +!========================================================================= +! find orographic asymmetry and convexity :'oa/clx' for clipped SG-hill +! nwd 1 2 3 4 5 6 7 8 +! wd w s sw nw e n ne se +! make sure that SM_00 and KD_05 oro-characteristics can match each other +! OD-KDO5 = Gamma=a/b [0:2] ; hsg = 2.*hprime +! OC-KD05 mount sharpness sigma^4 "height to half-width"[0:1] +! alph-SM00 fraction of h2d contributed to hprime [0:1] +! +! OA-KDO5 OA > dwstream OA=0 sym OA < 0 upstram [-1. 0. 1] +! delt-SM00 dw/up asymmetry -1 < delta < 1 +! Gamma-LM97 anisotropy of the orography g2 =(dh/dx)^2/(dh/dy)^2 +!.. +!A parametrization of low-level wave breaking which includes a dependence on +!the degree of 2-dimensionality of SG; it is active over a finite range of Fr +!========================================================================= + wdir = atan2(uhm,vhm) + pi + idir = mod( int(fdir*wdir),mdir) + 1 + + nwd = nwdir(idir) + ind4 = mod(nwd-1,4) + 1 + if (ind4 < 1 ) ind4 = 1 + if (ind4 > 4 ) ind4 = 4 + + oa = ( 1-2*int( (nwd-1)/4 )) * oa4(ind4) + clx = clx4(ind4) + cl4p(1) = clx4(2) + cl4p(2) = clx4(1) + cl4p(3) = clx4(4) + cl4p(4) = clx4(3) + clxp = cl4p(ind4) + + odir = clxp/max(clx, 1.e-5) ! WRF-based definition for "odir" + + odir = min(odmax, odir) + odir = max(odmin, odir) + + + if (strver == 'smc_2000' .or. strver == 'vay_2018') then +!========================================================================= +! +! thrree-piece def-n for tautot(Fr): 0-Fr_lin - Fr_lee -Fr_mtb +! taulin/tauogw taulee taumtb +! here tau_src(levs+1): approximate wave flux from surface to LLWB +! Following attempts of Scinocca +McFarlane, 2000 & Eckermann etal.(2010) +!========================================================================= +! +! if (mkz2 < 0)... mkzi = sqrt(-mkz2) trapped wave regime don't a case in UGWP-V1 +! wave flux ~ rho_src*kx_src/mkz_src*wind_rms +! bn2, uhm, vhm, bn2hm, rhohm +! +! IF (mkz2.ge. mkz2min .and. krefj > 2 ) THEN +! +! wave regimes +! + mkz = sqrt(mkz2) + frlwb = fcrit_sm ! should be higher than LOGW to get zblk < zlwb + frlin = fcrit_sm + frlin2 = 1.5*fcrit_sm + frlin3 = 3.0*fcrit_sm + + hcrit = fcrit_sm*umag/bnv + hogw = min(hamp, hcrit) + hdsw = min(hamp, frlwb*umag/bnv) ! no trapped-wave solution + + coef_h2 = kxridge * rhohm * bnv * umag + + taulin = coef_h2 * hamp*hamp + tauhcr = coef_h2 * hcrit*hcrit + + IF (fr < frlin ) then + tauogw = taulin + taulee = 0.0 + taumtb = 0.0 + else if (fr .ge. frlin ) then + tauogw = tauhcr + taulin = coef_h2 * hamp*hamp + taumtb = tau_izb ! integrated form MTB +! +! SM-2000 approach for taulee, shall we put limits on BetaMax_max ~ 20 or Betaf ?? +! + frnorm = fr/fcrit_sm ! frnorm below [1.0 to 3.0] + BetaMax = 1.0 + 2.0*OC ! alpha of SM00 or OC-mountain sharphess KD05 OC=[10, 0] + + if ( fr <= frlin2 ) then + Betaf= 2.*BetaMax*(frNorm-1.0) + taulee = (1. + Betaf )*taulin - tauhcr + else if ( (fr > frlin2).and.(fr <= frlin3))then + Betaf=-1.+ 1./frnorm/frnorm + & + (BetaMax + 0.555556)*(2.0 - 0.666*frnorm)* (2.0 - 0.666*frnorm) + taulee = (1. + Betaf )*taulin - tauhcr +!============== +! Eck-2010 WRF-alternatve through Dp_surf = P'*grad(h(x,y)) +! 1 < Fr < 2.5 tauwave = taulee+tauogw = tau_dp*(fr)**(-0.9) +! Fr > 2.5 tauwave = tau_dp*(2.5)**(-0.9) +! to apply it need tabulated Dp(fr, Dlin) Dp=function(Dlin, U, N, h) +! +!============== + else + taulee = 0.0 + hdsw = 0.0 + endif + ENDIF + + tautot = tauogw + taulee + taumtb*0. + + IF (taulee > 0.0 ) THEN + + hdsw = sqrt(tautot/coef_h2) ! averaged value for hdsw - mixture of lee+ogw with mkz/kxridge +! +! compute vertical profile "drlee" with the low-level wave breaking & "locally" trapped waves +! make "empirical" height above elvp that may represent DSW-wave breaking & trapping +! here we will assign tau_sso(z) profile between: zblk(zsurf) - zlwb - ztop_sso = ns*sridge +! + call mflow_tauz(levs, up, vp, tp, qp, dp, zpm, zpi, & + pmid, pint, rho, ui, vi, ti, bn2i, bvi, rhoi) + + kph = max(izb, 2) ! kph marks the low-level of wave solutions + klwb = kph ! klwb above blocking marks wave-breaking + kotr = levs+1 ! kotr marks mkz2(z) <= 0., reflection level + + if (do_dtrans) pdtrans = log(tautot/tauogw)/(zpi(krefj) - zpi(kph)) + + udir = max(ui(krefj)*xn +vi(krefj)*yn, velmin) + hogwi = hogw*hogw* rhohm/rhoi(krefj) * umag/udir * bnv/bvi(krefj) + umd(krefj) = udir + + udir = max(ui(kph)*xn +vi(kph)*yn, velmin) + hdswi = hdsw*hdsw* rhohm/rhoi(kph) * umag/udir * bnv/bvi(kph) + umd(kph) = udir + ! what we can put between k =[kph:krefj] + phmkz(:) = 0.0 ! + phmkz(kph-1) = fr ! initial Phase of the low-level wave +! +! now transfer tau_layer => tau_level assuming tau_layer = tau_level +! kx*rho_layer*bn_layer*u_layer* HL*HL = kx*rho_top*bn_top*u_top * HT*HT +! apply it for both hdsw & hogw with linear saturation-solver for Cx =0 +! + loop_lwb_otr: do k=kph+1, krefj ! levs + + umd(k) = max(ui(k)*xn +vi(k)*yn, velmin) + umd2 =(coro- umd(k))*(coro- umd(k)) + umd2 = max(umd2, dw2min) -c2f2 + + + if (umd2 <= 0.0) then +! +! critical layer +! + klwb = k + kotr = k + exit loop_lwb_otr + endif + + mkz2 = bn2i(k)/umd2 - kx2 + + if ( mkz2 >= mkz2min ) then +! +! find klwb having some "kinematic" phase "break-down" crireria SM00 or LM97 +! at finest vertical resolution we can meet "abrupt" mkz +! mkzmax = 6.28/(2*dz), mkzmin = 6.28/ztrop=18km +! to regularize SG-solution mkz = max(mkzmax, min(mkz,in, mkz)) +! + mkz = sqrt(mkz2) + hdswz = hdswi* rhoi(k-1)/rhoi(k) * umd(k-1)/umd(k) * bvi(k-1)/bvi(k) + udswz = hdswz *bn2i(k) +!=========================================================================================== +!linsat wave ampl.: mkz*sqrt(hdswz) <= 1.0 or udswz <= linsat2*umd2 +! +! tautot = tausat = rhoi(k) *udswz_sat * kxridge/mkz +! by k = krefj tautot = tauogw(krefj) +!=========================================================================================== + if (do_klwb_phase) then + phmkz(k) = phmkz(k-1) + mkz*(zpm(k)-zpm(k-1)) + if( ( phmkz(k) .ge. zbr_pi).and.(klwb == kph)) then + klwb = min(k, krefj) + exit loop_lwb_otr + endif + endif + else ! mkz2 < mkz2min + kotr = k ! trapped/reflected waves / + exit loop_lwb_otr + endif + enddo loop_lwb_otr +! +! define tau_src(1:zblk:klwb) = sum(tau_oro+tau_dsw+tau_ogw) and define drlee +! tau_trapped ??? +! + if (do_klwb_phase) then + do k=kph, kotr-1 + + if (klwb > kph .and. k < klwb) then + drlee(k) = (tautot -tauogw)/(zpi(kph) - zpi(klwb)) ! negative Ax*rho + tau_src(k) = tautot + (zpi(k) - zpi(klwb))*drlee(k) + drlee(k) = drlee(k)/rho(k) + else if ( k >= klwb .and. k < kotr) then + tau_src(k) = tauogw + drlee(k) = 0.0 + endif + enddo + kdswj = klwb ! assign to the "low-level" wave breaking + endif +! +! simplest exponential transmittance d(tau)/dz = - pdtrans *tau(z) +! more complicated is dissipative saturation pdtrans =/= constant +! + if (do_dtrans) then + do k=kph, krefj + tau_src(k)= tautot*exp(-pdtrans*(zpi(k)-zpi(kph))) + drlee(k) = -tau_src(k)/rho(k) * pdtrans + enddo + endif + + + ENDIF !taulee > 0.0 + + + endif !strver +! + +!========================================================================= + if (strver == 'gfs_2018' .or. strver == 'kd_2005') then +!========================================================================= +! +! orowaves: OGW+DSW/Lee +! + efact = (oa + 2.0) ** (ceofrc*fr) + efact = min( max(efact,efmin), efmax ) + coefm = (1. + clx) ** (oa+1.) + + kxlinv = min (kxw, coefm * cleff) ! does not exceed 42km ~4*dx + kxlinv = coefm * cleff + tem = fr * fr * oc + gfobnv = gmax * tem / ((tem + cg)*bnv) ! g/n0 +!========================================================================= +! source fluxes: taulin, taufrb +!========================================================================= + tautot = kxlinv * rhohm * umag * umag *umag* gfobnv * efact + + coef_h2 = kxlinv *rhohm * bnv*umag + taulin = coef_h2 *hamp*hamp + hcrit = fcrit_gfs*umag/bnv + tauhcr = coef_h2 *hcrit*hcrit + + IF (fr <= fcrit_gfs) then + tauogw = taulin + tautot = taulin + taulee = 0. + drlee(:) = 0. + ELSE !fr > fcrit_gfs + tauogw = tauhcr + taulee = max(tautot - tauogw, 0.0) + if (taulee > 0.0 ) hdsw = sqrt(taulee/coef_h2) +! approximate drlee(k) between [izb, klwb] +! find klwb and decrease taulee(izb) => taulee(klwb) = 0. +! above izb tau + if (mkz2 > mkz2min.and. krefj > 2 .and. taulee > 0.0) then + + mkz = sqrt(mkz2) + call mflow_tauz(levs, up, vp, tp, qp, dp, zpm, zpi, & + pmid, pint, rho, ui, vi, ti, bn2i, bvi, rhoi) + + kph = max(izb, 2) + phmkz(:) = 0.0 + klwb = max(izb, 1) + kotr = levs+1 + phmkz(kph-1) = fr ! initial Phase of the Lee-OGW + + loop_lwb_gfs18: do k=kph, levs + + umd(k) = max(ui(k)*xn +vi(k)*yn, velmin) + umd2 =(coro- umd(k))*(coro- umd(k)) + umd2 = max(umd2, velmin*velmin) + mkz2 = bn2i(k)/umd2 - kx2 + if ( mkz2 > mkz2min ) then + mkz = sqrt(mkz2) + frlocal = max(hdsw*bvi(k)/umd(k), frlwb) + phmkz(k) = phmkz(k-1) + mkz*(zpm(k)-zpm(k-1)) + if( ( phmkz(k) >= zbr_pi ) .and. (frlocal > frlin)) klwb = k + else + kotr = k + exit loop_lwb_gfs18 + endif + enddo loop_lwb_gfs18 +! +! + do k=kph, kotr-1 + + if (klwb > kph .and. k < klwb) then + drlee(k) = -(tautot -tauogw)/(zpi(kph) - zpi(klwb)) + tau_src(k) = tautot + (zpi(k) - zpi(klwb))*drlee(k) + drlee(k) = drlee(k)/rho(k) + else if ( k >= klwb .and. k < kotr) then + tau_src(k) = tauogw + drlee(k) = 0.0 + endif + enddo + kdswj = klwb ! assign to the "low-level" wave breaking + endif ! mkz2 > mkz2min.and. krefj > 2 .and. taulee > 0.0 + ENDIF !fr > fcrit_gfs + + + ENDIF !strbase='gfs2017' .or. strbase='kd_2005' + + +! output : taulin, taufrb, taulee, xn, yn, umag, kxw/kxridge +! print *, krefj, levs, tauogw, tautot , ' ugwp_taub_oro ' +! + end subroutine ugwp_taub_oro +! +!-------------------------------------- +! +! call ugwp_oro_lsatdis( krefj, levs, tauogw(j), tautot(j), tau_src, kxw, & +! fcor(j), c2f2(j), up, vp, tp, qp, dp, zpm, zpi, pmid1, pint1, & +! xn, yn, umag, drtau, kdis_oro) + + subroutine ugwp_oro_lsatdis( krefj, levs, tauogw, tautot, tau_src, & + kxw, fcor, kxridge, up, vp, tp, qp, dp, zpm, zpi, pmid, pint, & + xn, yn, umag, drtau, kdis) + + use ugwp_common, only : bnv2min, grav, pi, pi2, dw2min, velmin, rgrav + use cires_ugwp_module, only : frcrit, ricrit, linsat, hps, rhp1, rhp2 + use cires_ugwp_module, only : kvg, ktg, krad, kion + use ugwp_oro_init, only : coro , fcrit_sm , fcrit_sm2 + implicit none +! + integer, intent(in) :: krefj, levs + real , intent(in) :: tauogw, tautot, kxw + real , intent(in) :: fcor + + real , dimension(levs+1) :: tau_src + + real, dimension(levs) , intent(in) :: up, vp, tp, qp, dp, zpm + real, dimension(levs+1), intent(in) :: zpi, pmid, pint + real , intent(in) :: xn, yn, umag + real , intent(in) :: kxridge + + + real, dimension(levs), intent(out) :: drtau, kdis +! +! locals +! + real :: uref, udir, uf2, ufd, uf2p + real, dimension(levs+1) :: tauz + real, dimension(levs) :: rho + real, dimension(levs+1) :: ui, vi, ti, bn2i, bvi, rhoi + + integer :: i, j, k, kcrit, kref + real :: kx2, kx2w, kxs + real :: mkzm, mkz, dkz, mkz2, ch, kzw3 + real :: wfdM, wfdT, wfiM, wfiT + real :: fdis, mkzi, keff_m, keff_t + real :: betadis, betam, betat, cdfm, cdft + real :: fsat, hsat, hsat2, kds , c2f2 + + drtau(1:levs) = 0.0 + kdis (1:levs) = 0.0 + + ch = coro + + kx2w = kxw*kxw + kx2 = kxridge*kxridge + if( kx2 < kx2w ) kx2 = kx2w + kxs = sqrt(kx2) + c2f2 = fcor*fcor/kx2 +! +! non-hydrostatic LinSatDis for Ch = 0 (with set of horizontal wavenumber kxw) +! +! print *, krefj, levs, tauogw, tautot , ' orolsatdis ' + call mflow_tauz(levs, up, vp, tp, qp, dp, zpm, zpi, & + pmid, pint, rho, ui, vi, ti, bn2i, bvi, rhoi) +!=============================================================================== +! for stationary oro-GWs only "single"-azimuth cd = 0 -(-Udir) = Udir > 0 +! rotational/non-hyrostatic effects are important only for high-res runs +! Udir = 0, Udir < 0 are not +! future"revisions" shear effects for d mkz /dt = -kxw*dU/dz +! horizontal wavelength spectra mkz2 = l2 -kxw(n)*kxw(n) +! stochastic "tauogw'-setup+ sigma_tau ; +! 3D-wave effects 1+ (k/l)^2 and NS vs EW orowaves +! target is to get "multiple"-saturation levels for OGWs +!=============================================================================== + tauz(1:krefj) = tauogw ! constant flux for OGW-packet or single mode + ! sign of tauz > 0...and its attenuate with Z + k = krefj + uref = ui(k)*xn +vi(k)*yn - ch ! stationary waves + uf2 = uref*uref - c2f2 + if (uf2 > 0) then + mkz2 = bn2i(k)/uf2 -kx2 + if (mkz2.gt.0) then + mkzm = sqrt(mkz2) + else + return ! wave reflection mkz2 <=0. + endif + else + return ! wave absorption uf2 <= 0. + endif +! +! upward solver for single "mode" with tauz(levs+1) =0. at the top +! + kds = 0.1* kvg(krefj) ! eddy wave diffusion from the previous layer + kcrit = levs + do k= krefj+1, levs +! +! 2D-wave propagation along reference-wind direction +! udir = 0 critical wind for coro =0 +! cdop = -uref .... upwind waves travel against MF +! + udir = ui(k)*xn +vi(k)*yn + uf2 = udir*udir - c2f2 + + + if (uf2 < dw2min .or. udir <= 0.0) then + kcrit =K + tauz(kcrit:levs) = 0. + exit ! vert-level loop + endif +! +! wave-based solution +! + mkz2 = bn2i(k)/uf2 -kx2 + if (mkz2 > 0) then + mkzm = sqrt(mkz2) +! +! do dissipative flux vs saturation: kvg, ktg, krad, kion +! + kzw3 = mkzm*mkz2 +! + keff_m = kvg(k)*mkz2 + kion(k) +! keff_t = kturb(k)*iPr_turb + kmol(k)*iPr_mol + keff_t = ktg(k)*mkz2 + krad(k) +! +! + uf2p = uf2 + 2.0*c2f2 + betadis = uf2/uf2p + betaM = 1.0 / (1.0+betadis) ! if c2f2 = 0. betaM = betaT =0.5 ekw = epw + betaT = 1.0- BetaM + +! +!imaginary frequencies of momentum and heat with "kds at (k-1) level" +! + wfiM = kds*mkz2 + keff_m + wfiT = kds*mkz2 + keff_t +! + cdfm = sqrt(uf2)*kxs + cdft = abs(udir)*kxs + wfdM = wfiM/cdfm *BetaM + wfdT = wfiT/Cdft *BetaT + mkzi = 2.0*mkzm*(wfdM+wfdT) + + fdis = tauz(k-1)*exp(-mkzi*(zpi(k)-zpi(k-1)) ) + tauz(k) = fdis + hsat2 = fcrit_sm2 * uf2 *bn2i(k) + fsat = rhoi(k)* hsat2 * sqrt(uf2) * bvi(k) + if (fdis > fsat) then + tauz(k) = min(fsat, tauz(k-1)) +!================================================================= +! two definitions for eddy mixing of MF: +! a) wave damping-Lindzen : Ked ~ kx/(2H)*(u-c)^4/N^3 +! b) heat-based turbulence: 4/3 Richardson Ked ~eps^1/3 *Lt^4/3 +!================================================================= + kds = rhp2*kxs*uf2*uf2/bn2i(k)/bvi(k) + kdis(k) = kds + endif + else + tauz(k:levs) = 0. ! wave is reflected above + kds = 0. + endif + enddo + + do k=krefj+1, kcrit + drtau(k) = rgrav*(tauz(k+1)-tauz(k))/dp(k) + enddo +! +! + end subroutine ugwp_oro_lsatdis +! +! + subroutine ugwp_tofd(im, levs, sigflt, elvmax, zpbl, u, v, zmid, & + utofd, vtofd, epstofd, krf_tofd) + use machine , only : kind_phys + use ugwp_common , only : rcpd2 + use ugwp_oro_init, only : n_tofd, const_tofd, ze_tofd, a12_tofd, ztop_tofd +! + implicit none +! + integer :: im, levs + real(kind_phys), dimension(im, levs) :: u, v, zmid + real(kind_phys), dimension(im) :: sigflt, elvmax, zpbl + real(kind_phys), dimension(im, levs) :: utofd, vtofd, epstofd, krf_tofd +! +! locals +! + integer :: i, k + real :: sgh = 30. + real :: sgh2, ekin, zdec, rzdec, umag, zmet, zarg, zexp, krf +! + utofd =0.0 ; vtofd = 0.0 ; epstofd =0.0 ; krf_tofd =0.0 +! + + do i=1, im + + zdec = max(n_tofd*sigflt(i), zpbl(i)) + zdec = min(ze_tofd, zdec) + rzdec = 1.0/zdec + sgh2 = max(sigflt(i)*sigflt(i), sgh*sgh) + + do k=1, levs + zmet = zmid(i,k) + if (zmet > ztop_tofd) cycle + ekin = u(i,k)*u(i,k) + v(i,k)*v(i,k) + umag = sqrt(ekin) + zarg = zmet*rzdec + zexp = exp(-zarg*sqrt(zarg)) + krf = const_tofd* a12_tofd *sgh2* zmet ** (-1.2) *zexp + utofd(i,k) = -krf*u(i,k) + vtofd(i,k) = -krf*v(i,k) + epstofd(i,k)= rcpd2*krf*ekin ! more accurate heat/mom form using "implicit tend-solver" + ! to update momentum and temp-re + krf_tofd(i,k) = krf + enddo + enddo +! + end subroutine ugwp_tofd +! +! + subroutine ugwp_tofd1d(levs, sigflt, elvmax, zsurf, zpbl, u, v, & + zmid, utofd, vtofd, epstofd, krf_tofd) + use machine , only : kind_phys + use ugwp_common , only : rcpd2 + use ugwp_oro_init, only : n_tofd, const_tofd, ze_tofd, a12_tofd, ztop_tofd +! + implicit none + integer :: levs + real(kind_phys), dimension(levs) :: u, v, zmid + real(kind_phys) :: sigflt, elvmax, zpbl, zsurf + real(kind_phys), dimension(levs) :: utofd, vtofd, epstofd, krf_tofd +! +! locals +! + integer :: i, k + real :: sghmax = 5. + real :: sgh2, ekin, zdec, rzdec, umag, zmet, zarg, ztexp, krf +! + utofd =0.0 ; vtofd = 0.0 ; epstofd =0.0 ; krf_tofd =0.0 +! + zdec = max(n_tofd*sigflt, zpbl) ! ntimes*sgh_turb or Zpbl + zdec = min(ze_tofd, zdec) ! cannot exceed 18 km + rzdec = 1.0/zdec + sgh2 = max(sigflt*sigflt, sghmax*sghmax) ! 25 meters dz-of the first layer + + do k=1, levs + zmet = zmid(k)-zsurf + if (zmet > ztop_tofd) cycle + ekin = u(k)*u(k) + v(k)*v(k) + umag = sqrt(ekin) + zarg = zmet*rzdec + ztexp = exp(-zarg*sqrt(zarg)) + krf = const_tofd* a12_tofd *sgh2* zmet ** (-1.2) *ztexp + + utofd(k) = -krf*u(k) + vtofd(k) = -krf*v(k) + epstofd(k) = rcpd2*krf*ekin ! more accurate heat/mom form using "implicit tend-solver" + ! to update momentum and temp-re; epstofd(k) can be skipped + krf_tofd(k) = krf + enddo +! + end subroutine ugwp_tofd1d diff --git a/physics/cires_vert_wmsdis.F90 b/physics/cires_vert_wmsdis.F90 new file mode 100644 index 000000000..9e0bbf37c --- /dev/null +++ b/physics/cires_vert_wmsdis.F90 @@ -0,0 +1,425 @@ + subroutine ugwp_wmsdis_naz(levs, ksrc, nw, naz, kxw, taub_lat, ch, xaz, yaz, & + fcor, c2f2, dp, zmid, zint, pmid, pint, rho, ui, vi, ti, & + kvg, ktg, krad, kion, bn2i, bvi, rhoi, ax, ay, eps, ked, tau1) +! +! +! use para_taub, only : tau_ex + use ugwp_common, only : rcpd, grav, rgrav + implicit none +! + integer :: levs + integer :: nw, naz ! # - waves for each azimuth (naz) + integer :: ksrc ! source level + real :: kxw ! horizontal wn + real :: taub_lat ! lat-dep tau_bulk N/m2 +! + real, dimension(nw) :: ch, dch, taub_spect + real, dimension(naz) :: xaz, yaz + real, dimension(levs+1) :: ui, vi, ti, bn2i, bvi, rhoi, zint, pint + real, dimension(levs ) :: dp, rho, pmid, zmid + real :: fcor, c2f2 + real, dimension(levs+1) :: kvg, ktg, kion, krad, kmol + +! output/locals + real, dimension(levs ) :: ax, ay, eps + real, dimension(levs+1) :: ked , tau1 + real, dimension(levs+1 ) :: uaz + + real, dimension(levs, naz ) :: epsd + real, dimension(levs+1, naz ) :: atau, kedd + + real, dimension(levs+1 ) :: taux, tauy, bnrho + real, dimension(levs ) :: dzirho , dzpi + +! + integer :: iaz, k , inc + real, parameter :: gcstar=1.0 + integer , parameter :: nslope=1 + real :: spnorm ! source level normalization factor for the Broad Spectra + real :: bnrhos ! sum(taub_spect*dc) = spnorm taub_sect_norm = taub_spect/spnorm +! + atau=0.0 ; epsd=0.0 ; kedd=0.0 + bnrhos = bvi(ksrc)/rhoi(ksrc) + do k=1,levs + dzpi(k) = zint(k+1)-zint(k) + dzirho(k) = 1.0 / (rho(k)*dzpi(k)) ! grav/abs(dp(k)) still hydrostatic "ugwp" + bnrho(k) = (rhoi(k)/bvi(k)) !*bnrhos * gcstar ! gcstar=1.0 and bnrho(k=ksrc) =1. + enddo + k = levs+1 + bnrho(k) = (rhoi(k)/bvi(k))*bnrhos +! +! re-define ch, dch, taub_spect, this portion can be moved to "ugwp_init" +! +! +! + call FVS93_ugwps(nw, ch, dch, taub_spect, spnorm, nslope, bn2i(ksrc), bvi(ksrc), bnrho(ksrc)) + + +! print *, ' after FVS93_ugwp ', nw, maxval(ch), minval(ch) +! +! do normaalization for the spectral element of the saturated flux +! + bnrho = bnrho *spnorm + +! print * +! do inc=1, nw +! write(6,221) inc, ch(INC),taub_lat*taub_spect(inc), spnorm, dch(inc) +!221 FORMAT( i6, 2x, F8.2, 3(2x, E10.3)) +! enddo +! pause + + loop_iaz: do iaz =1, naz + + do k=1,levs+1 + uaz(k) =ui(k)*xaz(iaz) +vi(k)*yaz(iaz) + enddo +! +! +! multi-wave broad spectrum of FVS-93 with ~scheme of WMS-IFS 2010 +! +! print *, ' iaz before ugwp_wmsdis_az1 ', iaz +! + + call ugwp_wmsdis_az1(levs, ksrc, nw, kxw, ch, dch, taub_spect, taub_lat, & + spnorm, fcor, c2f2, zmid, zint, rho, uaz, ti, bn2i, bvi, rhoi, bnrho, dzirho, dzpi, & + kvg, ktg, krad, kion, kmol, epsd(:, iaz), kedd(:,iaz), atau(:, iaz) ) + +! print *, ' iaz after ugwp_wmsdis_az1 ', iaz + +! + enddo loop_iaz ! azimuth of gw propagation directions +! +! sum over azimuth and project atau(z, iza) =>(taux and tauy) +! for scalars for "wave-drag vector" +! + eps =0. ; ked =0. + do k=ksrc, levs + eps(k) = sum(epsd(k,:))*rcpd + enddo + + do k=ksrc, levs+1 + taux(k) = sum( atau(k,:)*xaz(:)) + tauy(k) = sum( atau(k,:)*yaz(:)) + ked(k) = sum( kedd(k,:)) + enddo +! + tau1(ksrc:levs) = taux(ksrc:levs) + tau1(1:ksrc-1) = tau1(ksrc) + +! end solver: gw_azimuth_solver_ls81 +! sign ax in rho*du/dt = -d(rho*tau)/dz +! [(k) - (k+1)] +! du/dt = ax = -1/rho*d( tau) /dz +! + ax =0. ; ay = 0. + + do k=ksrc, levs + ax(k) = dzirho(k)*(taux(k)-taux(k+1)) + ay(k) = dzirho(k)*(tauy(k)-tauy(k+1)) + enddo + call ugwp_limit_1d(ax, ay, eps, ked, levs) + + return + end subroutine ugwp_wmsdis_naz + + +! ======================================================================= + subroutine ugwp_wmsdis_az1(levs, ksrc, nw, kxw, ch, dch, taub_sp, tau_bulk, & + spnorm, fcor, c2f2, zm, zi, rho, um, tm, bn2, bn, rhoi, bnrho, & + dzirho, dzpi, kvg, ktg, krad, kion, kmol, eps, ked, tau ) +! +! use para_taub, only : tau_ex, xlatdeg !for exchange src-tau +! + use cires_ugwp_module, only : f_coriol, f_nonhyd, f_kds, linsat + use cires_ugwp_module, only : ipr_ktgw, ipr_spgw, ipr_turb, ipr_mol + use cires_ugwp_module, only : rhp4, rhp2, rhp1, khp, cd_ulim +! ======================================================================= + integer :: levs, ksrc, nw + real :: fcor, c2f2, kxw +! + real, dimension(nw) :: taub_sp, ch, dch + real :: tau_bulk, spnorm + real, dimension(levs) :: zm, rho, dzirho, dzpi + real, dimension(levs+1) :: zi, um, tm, bn2, bn, rhoi, bnrho + real, dimension(levs+1) :: kvg, ktg, krad, kion, kmol + real, dimension(levs+1) :: ked, tau + real, dimension(levs ) :: eps +! +!locals + integer :: k, inc + real, dimension(levs+1) :: umi + real :: zcin, zci_min, ztmp, zcinc + real :: zcimin=0.5 ! crit-level precision, 0.5 and start of Ch_MIN + real, parameter :: Keff = 0.2 + + real, dimension(nw) :: zflux ! + real, dimension(nw) :: wzact, zacc ! =1 ..crit level change it + + real, dimension(levs) :: zcrt ! + real, dimension(nw, levs) :: zflux_z, zact + + real :: zdelp, kxw2 + real :: vu_eff, vu_lin, v_kzw, v_cdp, v_wdp, v_kzi + real :: dfsat, fdis, fsat, fmode, expdis + real :: vc_zflx_mode, vm_zflx_mode + real :: tau_g5 +! ======================================================================= +!eps, ked, tau + + eps (:) =0; ked = 0.0 ; + kxw2 = kxw*kxw +! + zcrt(1:levs) = 0.0 + umi(1:levs+1) = um +! umi(1:levs+1) = um(1:levs+1) -um(ksrc) + + zci_min = zcimin + +! CALL slat_geos5(1, xlatdeg(1), tau_g5) +! tau_bulk = tau_g5 !tau_bulk*0.75 !3.75e-2 +! + zflux(:) = taub_sp(:)*tau_bulk ! includes tau_bulk(x,y) and spectral normalization + + zflux_z(1:nw,ksrc)=zflux(:) + + tau(1:levs+1) = tau_bulk ! constant flux for all layers k0.0 ) then +! ztmp = sum( ch(:)*zacc(:)*zflux(:)*dch(:) ) +! zcrt(k)=ztmp/tau(k) +! else +! zcrt( k )=zcrt(k-1) +! endif +! --------------------------------------------------------- +! do saturation (eq. (26) and (27) of scinocca 2003) +! + add molecular/eddy dissipation od gw-spectra vay-2015 +! for each mode & direction +! x by exp(-mi*zdelp) x introduce ....... mi(nw) +! +! mode-loop + add molecular/eddy dissipation od gw-spectra vay-2015 +! + do inc=1,nw + if (zact(inc,k) == 0.0) then + zflux(inc) = 0.0 + zflux_z(inc,k) = zflux(inc) + else + vu_eff = kvg(k) ! + ktg (k) !* ipr_ktgw + vu_lin = kion(k) ! + krad(k) !* ipr_ktgw + vu_eff = 2.e-5*exp(zi(k)/7000.)+.01 + zcin= ch(inc) + +!======================================================================= +! saturated limit wfit = kzw*kzw*kt; wfdt = wfit/(kxw*cx)*betat +! & dissipative kzi = 2.*kzw*(wfdm+wfdt)*dzpi(k) +! define kxw = +!======================================================================= + v_cdp = zcin-umi(k) + v_wdp = kxw*v_cdp + if (v_wdp.gt.0) then + v_kzw = bn(k)/v_cdp !can be non-hydrostatic + v_kzi = abs(( v_kzw*v_kzw*vu_eff + vu_lin) /v_wdp*v_kzw) + expdis = exp(-2.*v_kzi*dzpi(k) ) + else + v_kzi = 0. + expdis = 1.0 + endif + fmode = zflux(inc) + fdis = fmode*expdis ! only dissipation/crit_lev degrades it +!------------------------ +! includes rho/bn /(rhos/bns) *spnorm +!------------------------ + fsat = bnrho(k)* v_cdp*v_cdp /zcin ! expression for saturated flux + ! zfluxs=gcstar*zfct( k)*(zcin-zui( k ))**2/zcin +! flux_tot - sat.flux +! + dfsat= fdis-fsat + if( dfsat > 0.0 ) then +! put sat-n limit + zflux(inc) = fsat + else +! assign dis-ve flux + zflux(inc) =fdis + endif + zflux_z(inc,k)=zflux(inc) + + if (zflux_z(inc,k) > zflux_z(inc,k-1) ) zflux_z(inc,k) = zflux_z(inc,k-1) + + endif + + enddo +! +! integrate over spectral modes zpu(y, z, azimuth) zact( inc, )*zflux( inc, )*[d("zcinc")] +! + tau(k) = sum( zflux_z(:,k)*dch(:)) +!------------------------------------------------------------------------------ +! define expressions for eps-heat + Ked, needs more work for the broad spectra +! formulation especially for Ked +! after defining Ked .....GW-eddy cooling needs to be added +! for now "only" heating here +!============================================================================== + eps(k) =0. + do inc=1, nw + if (zact(inc,k) == 0.0) cycle ! dc-integration + dtau/dz + vc_zflx_mode = zflux(inc) + + zdelp= abs(ch(inc)-umi(k)) * dch(inc) /dzpi(k) + vm_zflx_mode=zflux_z(inc,k-1) + eps(k) =eps( k ) + (vm_zflx_mode-vc_zflx_mode)*zdelp ! heating >0 + + + enddo !inc=1, nw + ked(k) = Keff*eps(k)/bn2(k) +! +! -------------- +! + enddo ! end k do-loop vertical loop do k=ksrc+1, levs + +!top lid + k =levs+1 + ked(k) = ked(k-1) +! eps(k) = eps(k-1) + tau(k) =tau(k-1)*0.933 + +! from surface to ksrc-1 +! tau(1:ksrc) = tau(ksrc) + ked(1:ksrc) = 0. + eps( 1:ksrc) = 0. + +! +! output: eps, ked, tau for given azimuth +! + end subroutine ugwp_wmsdis_az1 +! +! + subroutine FVS93_ugwps(nw, ch, dch, taub_sp, spnorm, nslope, bn2, bn, bnrhos) + implicit none + integer :: nw, nslope + real :: bn2, bn, bnrhos +!! real :: taub_lat ! bulk - lat-dep momentum flux + real, dimension (nw) :: ch, dch, taub_sp +! locals + integer :: i, inc + real, parameter :: zcimin = 0.5, zcimax = 95.0, zgam =1./4. + real, parameter :: zms = 6.28e-3/2. ! mstar Lz ~ 2km + real :: zxran, zxmax, zxmin, zx1, zx2, zdx, ztx, rch + real :: bn3, bn4, zcin, tn4, tn3, tn2, cstar + real :: spnorm ! needs to be passed for saturation flux norm-n + real :: tau_bulk +!-------------------------------------------------------------------- +! +! transforms ch -uniform => 1/ch and back to non-uniform ch, dch +! +!------------------------------------------------------------------- +! note that this is expresed in terms of the intrinsic ch or vertical wn=N/cd +! at launch cd=ch-um(ksrc), the transformation is identical for all +! levels, azimuths and horizontal pixels +! see eq. 28-30 of scinocca 2003. x = 1/c stretching transform +! + zxmax=1.0 /zcimin + zxmin=1.0 /zcimax + zxran=zxmax-zxmin + zdx=zxran/float(nw-1) ! d_kz or d_mi +! +! + zx1=zxran/(exp(zxran/zgam)-1.0 ) !zgam =1./4. + zx2=zxmin-zx1 +! +! add idl computations for zci =1/zx +! x = 1/c stretching transform to look at final ch(i), dch(i) +! + + do i=1, nw + ztx=float(i-1)*zdx+zxmin + rch=zx1*exp((ztx-zxmin)/zgam)+zx2 !eq. 29 of scinocca 2003 + ch(i)=1.0 /rch !eq. 28 of scinocca 2003 + dch(i)=ch(i)*ch(i)*(zx1/zgam)*exp((ztx-zxmin)/zgam)*zdx !eq. 30 of scinocca 2003 + enddo +! +! nslope-dependent flux taub_spect(nw) momentum flux spectral density +! need to check math....expressions +! eq. (25) of scinocca 2003 with u-uo=0 it is identical to all azimuths +! +! + cstar=bn/zms + bn4=bn2*bn2 ! four times + bn3=bn2*bn + if(nslope==1) then +! s=1 case + do inc=1, nw + zcin=ch(inc) + tn4=(zms*zcin)**4 + taub_sp(inc) =bnrhos * zcin*bn4/(bn4+tn4) + enddo +! + elseif(nslope==2) then +! s=2 case + do inc=1, nw + zcin=ch(inc) + tn4=(zms*zcin)**4 + taub_sp(inc)= bnrhos*zcin*bn4/(bn4+tn4*zcin/cstar) + enddo +! + elseif(nslope==-1) then +! s=-1 case + do inc=1, nw + zcin=ch(inc) + tn2=(zms*zcin)**2 + taub_sp(inc)=bnrhos*zcin*bn2/(bn2+tn2) + enddo +! s=0 case + elseif(nslope==0) then + + do inc=1, nw + zcin=ch(inc) + tn3=(zms*zcin)**3 + taub_sp(inc)=bnrhos*zcin*bn3/(bn3+tn3) + enddo + endif ! for n-slopes +!============================================= +! normalize launch momentum flux +! ------------------------------------ +! (rho x f^h = rho_o x f_p^total) integrate (zflux x dx) + + tau_bulk= sum(taub_sp(:)*dch(:)) + spnorm= 1./tau_bulk + + do inc=1, nw + taub_sp(inc)=spnorm*taub_sp(inc) + enddo + + end subroutine FVS93_ugwps + diff --git a/physics/ugwp_driver_v0.f b/physics/ugwp_driver_v0.f new file mode 100644 index 000000000..a3ca5f96d --- /dev/null +++ b/physics/ugwp_driver_v0.f @@ -0,0 +1,2008 @@ +!!23456 + module sso_coorde +! +! specific to COORDE-2019 project OGW switches/sensitivity +! to diagnose SSO effects pgwd=1 (OGW is on) =0 (off) +! pgd4=4 (4 timse taub, control pgwd=1) +! + use machine, only: kind_phys + real(kind=kind_phys),parameter :: pgwd = 1._kind_phys + real(kind=kind_phys),parameter :: pgwd4 = 1._kind_phys + end module sso_coorde +! +! + subroutine cires_ugwp_driver_v0(me, master, + & im, levs, nmtvr, dtp, kdt, imx,do_tofd, + & cdmbgwd, xlat, xlatd, sinlat, coslat, spgrid, + & ugrs, vgrs, tgrs, qgrs, prsi, prsl, prslk, + & phii, phil, del, oro_stat, sgh30, kpbl, + & dusfcg, dvsfcg, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, + & tau_tofd, tau_mtb, tau_ogw, tau_ngw, + & zmtb, zlwb, zogw, du3dt_mtb,du3dt_ogw, du3dt_tms,rdxzb ) +!----------------------------------------------------------- +! Part 1 "old-revised" gfs-gwdps_v0 +! Part 2 non-stationary multi-wave GWs FV3GFS-v0 +! Part 3 Dissipative version of UGWP-tendency application +! (similar to WAM-2017) +!----------------------------------------------------------- + use machine, only: kind_phys +! use physcons, only: con_cp, con_fvirt, con_g, con_rd, +! & con_rv, con_rerth, con_pi + + use ugwp_wmsdis_init, only : tamp_mpa + use sso_coorde, only : pgwd, pgwd4 + implicit none +!input + + integer, intent(in) :: me, master + integer, intent(in) :: im, levs, nmtvr, kdt, imx + + real(kind=kind_phys), intent(in) :: dtp, cdmbgwd(2) + logical :: do_tofd + integer, intent(in) :: kpbl(im) + real(kind=kind_phys), intent(in), dimension(im) :: xlat, xlatd + &, sgh30, sinlat, coslat, spgrid ! spgrid = tile-area + + real(kind=kind_phys), intent(in), dimension(im,levs) :: ugrs + &, vgrs, tgrs, qgrs, prsi, prsl, prslk, phii, phil, del + + real(kind=kind_phys), intent(in) :: oro_stat(im,nmtvr) +!out + real(kind=kind_phys), dimension(im,levs) :: gw_dudt, gw_dvdt + &, gw_dTdt, gw_kdis + +!-----locals + diagnostics output + + real(kind=kind_phys), dimension(im,levs) :: Pdvdt, Pdudt + &, Pdtdt, Pkdis, ed_dudt, ed_dvdt, ed_dTdt + + real(kind=kind_phys), dimension(im) :: dusfcg, dvsfcg + + real(kind=kind_phys), dimension(im) :: rdxzb, zmtb, + & zlwb, zogw, tau_mtb, tau_ogw, tau_tofd, tau_ngw + real(kind=kind_phys), dimension(im,levs) :: du3dt_mtb, du3dt_ogw + &, du3dt_tms +! locals + integer :: i, j, k, ix +! +! define hprime, oc, oa4, clx, theta, sigma, gamm, elvmax +! + real(kind=kind_phys), dimension(im) :: hprime, + & oc, theta, sigma, gamm, elvmax + real(kind=kind_phys), dimension(im, 4) :: clx, oa4 +! +! switches that activate impact of OGWs and NGWs along with eddy diffusion +! + real(kind=kind_phys), parameter :: pogw=1.0, pngw=1.0, pked=1.0 + &, ompked=1.0-pked +! +! switches for GW-effects: pogw=1 (OGWs) pngw=1 (NGWs) pked=1 (eddy mixing) +! + if (me == master .and. kdt < 2) then + print * + write(6,*) 'FV3GFS execute ugwp_driver_v0 nmtvr=', nmtvr + write(6,*) ' COORDE EXPER pogw = ' , pogw + write(6,*) ' COORDE EXPER pgwd = ' , pgwd + write(6,*) ' COORDE EXPER pgwd4 = ', pgwd4 + print * + endif + + +! print *, ' NMTVR in driver ', nmtvr + do i=1,im + hprime(i) = oro_stat(i,1) + oc(i) = oro_stat(i,2) + oa4(i,1) = oro_stat(i,3) + oa4(i,2) = oro_stat(i,4) + oa4(i,3) = oro_stat(i,5) + oa4(i,4) = oro_stat(i,6) + clx(i,1) = oro_stat(i,7) + clx(i,2) = oro_stat(i,8) + clx(i,3) = oro_stat(i,9) + clx(i,4) = oro_stat(i,10) + theta(i) = oro_stat(i,11) + gamm(i) = oro_stat(i,12) + sigma(i) = oro_stat(i,13) + elvmax(i) = oro_stat(i,14) + + zlwb(i) = 0. + enddo +! +! 1) ORO stationary GWs +! +! pdvdt(:,:) = 0. ; pdudt(:,:) = 0. +! pkdis(:,:) = 0. ; pdtdt(:,:) = 0. +! zlwb(:) = 0. + + CALL GWDPS_V0(IM, levs, imx, do_tofd, + & Pdvdt, Pdudt, Pdtdt, Pkdis, + & ugrs, vgrs, tgrs, qgrs,KPBL, prsi,del,prsl, + & prslk, phii, phil, DTP,KDT, + & sgh30, HPRIME,OC,OA4, CLX, THETA,SIGMA,GAMM,ELVMAX, + & DUSFCg, DVSFCg, xlatd, sinlat, coslat, spgrid, + & cdmbgwd, me, master, rdxzb, + & zmtb, zogw, tau_mtb, tau_ogw, tau_tofd, + & du3dt_mtb, du3dt_ogw, du3dt_tms) +! +! +! non-stationary GW-scheme with GMAO/MERRA GW-forcing +! + if (me == master .and. kdt < 2) then + print * + write(6,*) 'FV3GFS finished gwdps_v0 in ugwp_driver_v0 ' + print * + endif +!-------- +! GMAO GEOS-5/MERRA GW-forcing lat-dep +!-------- + call slat_geos5_tamp(im, tamp_mpa, xlatd, tau_ngw) + +! call slat_geos5(im, xlatd, tau_ngw) +! +! 2) non-stationary GWs with GEOS-5/MERRA GW-forcing +! + call fv3_ugwp_solv2_v0(im, levs, dtp, + & tgrs, ugrs, vgrs, qgrs, prsl, prsi, phil, xlatd, + & sinlat, coslat, gw_dudt, gw_dvdt, gw_dTdt, gw_kdis, + & tau_ngw, me, master, kdt ) + + if (me == master .and. kdt < 2) then + print * + write(6,*)'FV3GFS finished fv3_ugwp_v0 in ugwp_driver_v0 ' + write(6,*) ' non-stationary GWs with GMAO/MERRA GW-forcing ' + print * + endif + + do k=1,levs + do i=1,im + gw_dtdt(i,k) = pngw*gw_dtdt(i,k) + pogw*Pdtdt(i,k) + gw_dudt(i,k) = pngw*gw_dudt(i,k) + pogw*Pdudt(i,k) + gw_dvdt(i,k) = pngw*gw_dvdt(i,k) + pogw*Pdvdt(i,k) + gw_kdis(i,k) = pngw*gw_kdis(i,k) + pogw*Pkdis(i,k) + enddo + enddo + if (pogw == 0.0) then +! zmtb = 0.; zogw =0. + tau_mtb = 0.0 ; tau_ogw = 0.0 ; tau_tofd = 0.0 + du3dt_mtb = 0.0 ; du3dt_ogw = 0.0 ; du3dt_tms= 0.0 + endif + + return + +!============================================================================= +! make "ugwp eddy-diffusion" update for gw_dtdt/gw_dudt/gw_dvdt by solving +! vert diffusion equations & update "Statein%tgrs, Statein%ugrs, Statein%vgrs" +!============================================================================= +! +! 3) application of "eddy"-diffusion to "smooth" UGWP-related tendencies +!------------------------------------------------------------------------------ + ed_dudt(:,:) = 0.0 ; ed_dvdt(:,:) = 0.0 ; ed_dtdt(:,:) = 0.0 + + call edmix_ugwp_v0(im, levs, dtp, + & tgrs, ugrs, vgrs, qgrs, del, + & prsl, prsi, phil, prslk, + & gw_dudt, gw_dvdt, gw_dTdt, gw_kdis, + & ed_dudt, ed_dvdt, ed_dTdt, + & me, master, kdt ) + + do k=1,levs + do i=1,im + gw_dtdt(i,k) = gw_dtdt(i,k)*ompked + ed_dtdt(i,k)*pked + gw_dvdt(i,k) = gw_dvdt(i,k)*ompked + ed_dvdt(i,k)*pked + gw_dudt(i,k) = gw_dudt(i,k)*ompked + ed_dudt(i,k)*pked + enddo + enddo + + end subroutine cires_ugwp_driver_v0 +! +!===================================================================== +! +!ugwp-v0 subroutines: GWDPS_V0 and fv3_ugwp_solv2_v0 +! +!===================================================================== + SUBROUTINE GWDPS_V0(IM, levs, imx, do_tofd, + & Pdvdt, Pdudt, Pdtdt, Pkdis, U1,V1,T1,Q1,KPBL, + & PRSI,DEL,PRSL,PRSLK,PHII, PHIL,DTP,KDT, + & sgh30, HPRIME,OC,OA4,CLX4,THETA,vSIGMA,vGAMMA,ELVMAXD, + & DUSFC, DVSFC, xlatd, sinlat, coslat, sparea, + $ cdmbgwd, me, master, rdxzb, + & zmtb, zogw, tau_mtb, tau_ogw, tau_tofd, + & dudt_mtb, dudt_ogw, dudt_tms) +!---------------------------------------- +! ugwp_v0 +! +! modified/revised version of gwdps.f (with bug fixes, tofd, appropriate +! computation of kref for OGW + COORDE diagnostics +! all constants/parameters inside cires_ugwp_initialize.F90 +!---------------------------------------- + + USE MACHINE , ONLY : kind_phys + use ugwp_common , only : rgrav, grav, cpd, rd, rv, rcpd, rcpd2 + &, pi, rad_to_deg, deg_to_rad, pi2 + &, rdi, gor, grcp, gocp, fv, gr2 + &, bnv2min, dw2min, velmin, arad + + use ugwp_oro_init, only : rimin, ric, efmin, efmax + &, hpmax, hpmin, sigfaci => sigfac + &, dpmin, minwnd, hminmt, hncrit + &, RLOLEV, GMAX, VELEPS, FACTOP + &, FRC, CE, CEOFRC, frmax, CG + &, FDIR, MDIR, NWDIR + &, cdmb, cleff, fcrit_gfs, fcrit_mtb + &, n_tofd, ze_tofd, ztop_tofd + + use cires_ugwp_module, only : kxw, max_kdis, max_axyz + use sso_coorde, only : pgwd, pgwd4 +!---------------------------------------- + implicit none + character(len=8) :: strsolver='PSS-1986' ! current operational solver or 'WAM-2017' + integer, intent(in) :: im, levs, imx, kdt + integer, intent(in) :: me, master + logical, intent(in) :: do_tofd + real(kind=kind_phys), parameter :: sigfac =3, sigfacS = 0.5 + real(kind=kind_phys) :: ztopH,zlowH,ph_blk, dz_blk + integer, intent(in) :: KPBL(IM) ! Index for the PBL top layer! + real(kind=kind_phys), intent(in) :: dtp ! time step + real(kind=kind_phys), intent(in) :: cdmbgwd(2) + + real(kind=kind_phys), intent(in), dimension(im,levs) :: + & u1, v1, t1, q1, + & del, prsl, prslk, phil + real(kind=kind_phys), intent(in),dimension(im,levs+1):: prsi, phii + real(kind=kind_phys), intent(in) ::xlatd(im),sinlat(im),coslat(im) + real(kind=kind_phys), intent(in) :: sparea(im) + + real(kind=kind_phys), intent(in) :: OC(IM), OA4(im,4), CLX4(im,4) + real(kind=kind_phys), intent(in) :: HPRIME(IM), sgh30(IM) + real(kind=kind_phys), intent(in) :: ELVMAXD(IM), THETA(IM) + real(kind=kind_phys), intent(in) :: vSIGMA(IM), vGAMMA(IM) + real(kind=kind_phys) :: SIGMA(IM), GAMMA(IM) + +!output -phys-tend + real(kind=kind_phys),dimension(im,levs),intent(out) :: + & Pdvdt, Pdudt, Pkdis, Pdtdt +! output - diag-coorde + &, dudt_mtb, dudt_ogw, dudt_tms +! + real(kind=kind_phys),dimension(im) :: RDXZB, zmtb, zogw + &, tau_ogw, tau_mtb, tau_tofd + &, dusfc, dvsfc + +! +! locals +! mean flow + real(kind=kind_phys) :: RI_N(IM,levs), BNV2(IM,levs), RO(IM,levs) + real(kind=kind_phys) :: VTK(IM,levs),VTJ(IM,levs),VELCO(IM,levs) +!mtb + real(kind=kind_phys) :: OA(IM), CLX(IM) , elvmax(im) + real(kind=kind_phys) :: wk(IM) + real(kind=kind_phys), dimension(im) :: PE, EK, UP + + real(kind=kind_phys) :: DB(IM,levs),ANG(IM,levs),UDS(IM, levs) + real(kind=kind_phys) :: ZLEN, DBTMP, R, PHIANG, DBIM, ZR + real(kind=kind_phys) :: ENG0, ENG1, COSANG2, SINANG2 + real(kind=kind_phys) :: bgam, cgam, gam2, rnom, rdem +! +! TOFD +! Some constants now in "use ugwp_oro_init" + "use ugwp_common" +! +!================== + real(kind=kind_phys) :: unew, vnew, zpbl, sigflt + real(kind=kind_phys), dimension(levs) :: utofd1, vtofd1 + &, epstofd1, krf_tofd1 + &, up1, vp1, zpm + real(kind=kind_phys) :: zsurf + real(kind=kind_phys),dimension(im, levs) :: axtms, aytms +! +! OGW +! + LOGICAL ICRILV(IM) +! + real(kind=kind_phys) :: XN(IM), YN(IM), UBAR(IM), + & VBAR(IM), ULOW(IM), + & ROLL(IM), bnv2bar(im), SCOR(IM), + & DTFAC(IM), XLINV(IM), DELKS(IM), DELKS1(IM) +! + real(kind=kind_phys) :: TAUP(IM,levs+1), TAUD(IM,levs) + real(kind=kind_phys) :: taub(im), taulin(im), heff, hsat, hdis + + integer :: kref(IM), idxzb(im), ipt(im), k_mtb,k_zlow + integer :: kreflm(IM), iwklm(im), iwk(im), izlow(im) + integer :: ktrial, klevm1 +! +!check what we need +! + real(kind=kind_phys) :: bnv, fr, ri_gw , + & brvf, tem, tem1, tem2, temc, temv, + & ti, rdz, dw2, shr2, bvf2, + & rdelks, efact, coefm, gfobnv, + & scork, rscor, hd, fro, sira, + & dtaux, dtauy, pkp1log, pklog + + integer :: km, kmm1, kmm2, lcap, lcapp1 + &, npt, kbps, kbpsp1,kbpsm1 + &, kmps, idir, nwd, klcap, kp1, kmpbl, kmll +!--------------------------------------------------------------------- +! # of permissible sub-grid orography hills for "any" resolution < 25 +! correction for "elliptical" hills based on shilmin-area =sgrid/25 +! 4.*gamma*b_ell*b_ell >= shilmin +! give us limits on [b_ell & gamma *b_ell] > 5 km =sso_min +! gamma_min = 1/4*shilmin/sso_min/sso_min +!23.01.2019: cdmb = 4.*192/768_c192=1 x 0.5 +! 192: cdmbgwd = 0.5, 2.5 +! cleff = 2.5*0.5e-5 * sqrt(192./768.) => Lh_eff = 1004. km +! 6*dx = 240 km 8*dx = 320. ~ 3-5 more effective +!--------------------------------------------------------------------- + real(kind=kind_phys) :: gammin = 0.00999999 + real(kind=kind_phys) :: shilmin, sgrmax, sgrmin + real(kind=kind_phys) :: belpmin, dsmin, dsmax + real(kind=kind_phys), parameter :: nhilmax = 25. + real(kind=kind_phys), parameter :: sso_min = 3000. + real(kind=kind_phys) :: xlingfs + real(kind=kind_phys) :: arhills(im) + logical, parameter :: do_adjoro = .true. +! + integer :: i, j, k + real(kind=kind_phys) :: grav2, rcpdt, windik, wdir + &, sigmin, dxres,sigres,hdxres + &, cdmb4, mtbridge + &, kxridge, inv_b2eff, zw1, zw2 + &, belps, aelps, nhills, selps +! + rcpdt = 1.0 / (cpd*dtp) + grav2 = grav + grav +! +! mtb-blocking sigma_min and dxres => cires_initialize +! + sgrmax = maxval(sparea) ; sgrmin = minval(sparea) + dsmax = sqrt(sgrmax) ; dsmin = sqrt(sgrmin) + + dxres = pi2*arad/float(IMX) + hdxres = 0.5*dxres + shilmin = sgrmin/nhilmax + + gammin = min(sso_min/dsmax, 1.) + + sigmin = 2.*hpmin/dsmax !dxres + +! if (kdt == 1) then +! print *, sgrmax, sgrmin , ' min-max sparea ' +! print *, 'sigmin-hpmin-dsmax', sigmin, hpmin, dsmax +! print *, 'dxres/dsmax ', dxres, dsmax +! print *, ' shilmin gammin ', shilmin, gammin +! endif + + kxridge = float(IMX)/arad * cdmbgwd(2) + + if (me == master .and. kdt==1) then + print *, ' gwdps_v0 kxridge ', kxridge + print *, ' gwdps_v0 scale2 ', cdmbgwd(2) + print *, ' gwdps_v0 IMX ', imx + print *, ' gwdps_v0 GAM_MIN ', gammin + print *, ' gwdps_v0 SSO_MIN ', sso_min + endif + + do i=1,im + idxzb(:) = 0 + zmtb(i) = 0.0 + zogw(i) = 0.0 + rdxzb(i) = 0.0 + tau_ogw(i) = 0.0 + tau_mtb(i) = 0.0 + dusfc(i) = 0.0 + dvsfc(i) = 0.0 + tau_tofd(i) = 0.0 + enddo + + do k=1,levs + do i=1,im + pdvdt(i,k) = 0.0 + pdudt(i,k) = 0.0 + pdtdt(i,k) = 0.0 + pkdis(i,k) = 0.0 + dudt_mtb(i,k) = 0.0 + dudt_ogw(i,k) = 0.0 + dudt_tms(i,k) = 0.0 + enddo + enddo + +! ---- for lm and gwd calculation points + + ipt(:) = 0 + npt = 0 + sigma = vsigma + gamma = vgamma + do i = 1,im + if ( (elvmaxd(i) >= hminmt) + & .and. (gamma(i) >= gammin) + & .and. (hprime(i) >= hpmin) ) then + + npt = npt + 1 + ipt(npt) = i + arhills(i) = 1.0 +! + if (gamma(i) < gammin) gamma(i) = gammin + sigres = max(sigmin, sigma(i)) + if (sigma(i) < sigmin) sigma(i)= sigmin + dxres = sqrt(sparea(i)) + if (2.*hprime(i)/sigres > dxres) sigres=2.*hprime(i)/dxres + aelps = min(2.*hprime(i)/sigres, 0.5*dxres) + if (gamma(i) > 0.0 ) belps=min(aelps/gamma(i),.5*dxres) +! +! small-scale "turbulent" oro-scales < sso_min +! + if( aelps < sso_min .and. do_adjoro) then + +! a, b > sso_min upscale ellipse a/b > 0.1 a>sso_min & h/b=>new_sigm +! + aelps = sso_min + if (belps < sso_min ) then + gamma(i) = 1.0 + belps = aelps*gamma(i) + + else + gamma(i) = min(aelps/belps, 1.0) + endif + sigma(i) = 2.*hprime(i)/aelps + gamma(i) = min(aelps/belps, 1.0) + endif + + selps = belps*belps*gamma(i)*4. ! ellipse area of the el-c hill + nhills = sparea(i)/selps + if (nhills > nhilmax) nhills = nhilmax + arhills(i) = max(nhills, 1.0) + +!333 format( ' nhil: ', I6, 4(2x, F9.3), 2(2x, E9.3)) +! if (kdt==1 ) +! & write(6,333) nint(nhills)+1,xlatd(i), hprime(i),aelps*1.e-3, +! & belps*1.e-3, sigma(i),gamma(i) + + endif + enddo + + IF (npt == 0) then +! print *, 'oro-npt = 0 elvmax ', maxval(elvmaxd), hminmt +! print *, 'oro-npt = 0 hprime ', maxval(hprime), hpmin + RETURN ! No gwd/mb calculation done + endif + + + do i=1,npt + iwklm(i) = 2 + IDXZB(i) = 0 + kreflm(i) = 0 + enddo + + do k=1,levs + do i=1,im + db(i,k) = 0.0 + ang(i,k) = 0.0 + uds(i,k) = 0.0 + enddo + enddo + + km = levs + KMM1 = levs- 1 ; KMM2 = levs - 2 ; KMLL = kmm1 + LCAP = levs ; LCAPP1 = LCAP + 1 + + DO I = 1, npt + j = ipt(i) + ELVMAX(J) = min (ELVMAXd(J)*0. + sigfac * hprime(j), hncrit) + ENDDO +! + izlow(:) =1 ! surface-level + DO K = 1, levs-1 + DO I = 1, npt + j = ipt(i) + ztopH = sigfac * hprime(j) + zlowH = sigfacs* hprime(j) + pkp1log = phil(j,k+1) * rgrav + pklog = phil(j,k) * rgrav +! if (( ELVMAX(j) <= pkp1log) .and. (ELVMAX(j).ge.pklog) ) +! & iwklm(I) = MAX(iwklm(I), k+1 ) + if (( ztopH <= pkp1log) .and. (zTOPH >= pklog) ) + & iwklm(I) = MAX(iwklm(I), k+1 ) +! + if (zlowH <= pkp1log .and. zlowH >= pklog) + & izlow(I) = MAX(izlow(I),k) + ENDDO + ENDDO +! + DO K = 1,levs + DO I =1,npt + J = ipt(i) + VTJ(I,K) = T1(J,K) * (1.+FV*Q1(J,K)) + VTK(I,K) = VTJ(I,K) / PRSLK(J,K) + RO(I,K) = RDI * PRSL(J,K) / VTJ(I,K) ! DENSITY mid-levels + TAUP(I,K) = 0.0 + ENDDO + ENDDO +! +! check RI_N or RI_MF computation +! + DO K = 1,levs-1 + DO I =1,npt + J = ipt(i) + RDZ = grav / (phil(j,k+1) - phil(j,k)) + TEM1 = U1(J,K) - U1(J,K+1) + TEM2 = V1(J,K) - V1(J,K+1) + DW2 = TEM1*TEM1 + TEM2*TEM2 + SHR2 = MAX(DW2,DW2MIN) * RDZ * RDZ +! TI = 2.0 / (T1(J,K)+T1(J,K+1)) +! BVF2 = Grav*(GOCP+RDZ*(VTJ(I,K+1)-VTJ(I,K)))* TI +! RI_N(I,K) = MAX(BVF2/SHR2,RIMIN) ! Richardson number +! + BVF2 = grav2 * RDZ * (VTK(I,K+1)-VTK(I,K)) + & / (VTK(I,K+1)+VTK(I,K)) + bnv2(i,k+1) = max( BVF2, bnv2min ) + RI_N(I,K+1) = Bnv2(i,k)/SHR2 ! Richardson number consistent with BNV2 +! +! add here computation for Ktur and OGW-dissipation fro VE-GFS +! + ENDDO + ENDDO + K = 1 + DO I = 1, npt + bnv2(i,k) = bnv2(i,k+1) + ENDDO +! +! level iwklm =>phil(j,k)/g < sigfac * hprime(j) < phil(j,k+1)/g +! + DO I = 1, npt + J = ipt(i) + k_zlow = izlow(I) + if (k_zlow == iwklm(i)) k_zlow = 1 + DELKS(I) = 1.0 / (PRSI(J,k_zlow) - PRSI(J,iwklm(i))) +! DELKS1(I) = 1.0 /(PRSL(J,k_zlow) - PRSL(J,iwklm(i))) + UBAR (I) = 0.0 + VBAR (I) = 0.0 + ROLL (I) = 0.0 + PE (I) = 0.0 + EK (I) = 0.0 + BNV2bar(I) = 0.0 + ENDDO +! + DO I = 1, npt + k_zlow = izlow(I) + if (k_zlow == iwklm(i)) k_zlow = 1 + DO K = k_zlow, iwklm(I)-1 ! Kreflm(I)= iwklm(I)-1 + J = ipt(i) ! laye-aver Rho, U, V + RDELKS = DEL(J,K) * DELKS(I) + UBAR(I) = UBAR(I) + RDELKS * U1(J,K) ! trial Mean U below + VBAR(I) = VBAR(I) + RDELKS * V1(J,K) ! trial Mean V below + ROLL(I) = ROLL(I) + RDELKS * RO(I,K) ! trial Mean RO below +! + BNV2bar(I) = BNV2bar(I) + .5*(BNV2(I,K)+BNV2(I,K+1))* RDELKS + ENDDO + ENDDO +! + DO I = 1, npt + J = ipt(i) +! +! integrate from Ztoph = sigfac*hprime down to Zblk if exists +! find ph_blk, dz_blk like in LM-97 and IFS +! + ph_blk =0. + DO K = iwklm(I), 1, -1 + PHIANG = atan2(V1(J,K),U1(J,K))*RAD_TO_DEG + ANG(I,K) = ( THETA(J) - PHIANG ) + if ( ANG(I,K) > 90. ) ANG(I,K) = ANG(I,K) - 180. + if ( ANG(I,K) < -90. ) ANG(I,K) = ANG(I,K) + 180. + ANG(I,K) = ANG(I,K) * DEG_TO_RAD + UDS(I,K) = + & MAX(SQRT(U1(J,K)*U1(J,K) + V1(J,K)*V1(J,K)), velmin) +! + IF (IDXZB(I) == 0 ) then + dz_blk=( PHII(J,K+1) - PHII(J,K) ) *rgrav + PE(I) = PE(I) + BNV2(I,K) * + & ( ELVMAX(J) - phil(J,K)*rgrav ) * dz_blk + + UP(I) = max(UDS(I,K) * cos(ANG(I,K)), velmin) + EK(I) = 0.5 * UP(I) * UP(I) + + ph_blk = ph_blk + dz_blk*sqrt(BNV2(I,K))/UP(I) + +! --- Dividing Stream lime is found when PE =exceeds EK. oper-l GFS +! IF ( PE(I) >= EK(I) ) THEN + IF ( ph_blk >= fcrit_gfs ) THEN + IDXZB(I) = K + zmtb (J) = PHIL(J, K)*rgrav + RDXZB(J) = real(k, kind=kind_phys) + ENDIF + + ENDIF + ENDDO +! +! Alternative expression: ZMTB = max(Heff*(1. -Fcrit_gfs/Fr), 0) +! fcrit_gfs/fr +! + goto 788 + + BNV = SQRT( BNV2bar(I) ) + heff = 2.*min(HPRIME(J),hpmax) + zw2 = UBAR(I)*UBAR(I)+VBAR(I)*VBAR(I) + Ulow(i) = sqrt(max(zw2,dw2min)) + Fr = heff*bnv/Ulow(i) + ZW1 = max(Heff*(1. -fcrit_gfs/fr), 0.0) + zw2 = phil(j,2)*rgrav + if (Fr > fcrit_gfs .and. zw1 > zw2 ) then + do k=2, levs-1 + pkp1log = phil(j,k+1) * rgrav + pklog = phil(j,k) * rgrav + if (zw1 <= pkp1log .and. zw1 >= pklog) exit + enddo + IDXZB(I) = K + zmtb (J) = PHIL(J, K)*rgrav + else + zmtb (J) = 0. + IDXZB(I) = 0 + endif +788 continue + ENDDO + +! +! --- The drag for mtn blocked flow +! + cdmb4 = 0.25*cdmb + DO I = 1, npt + J = ipt(i) +! + IF ( IDXZB(I) > 0 ) then +! (4.16)-IFS + gam2 = gamma(j)*gamma(j) + BGAM = 1.0 - 0.18*gamma(j) - 0.04*gam2 + CGAM = 0.48*gamma(j) + 0.30*gam2 + DO K = IDXZB(I)-1, 1, -1 + + ZLEN = SQRT( ( PHIL(J,IDXZB(I)) - PHIL(J,K) ) / + & ( PHIL(J,K ) + Grav * hprime(J) ) ) + + COSANG2 = cos(ANG(I,K))*cos(ANG(I,K)) + SINANG2 = 1.0 - COSANG2 +! +! cos =1 sin =0 => 1/R= gam ZR = 2.-gam +! cos =0 sin =1 => 1/R= 1/gam ZR = 2.- 1/gam +! + rdem = COSANG2 + GAM2 * SINANG2 + rnom = COSANG2*GAM2 + SINANG2 +! +! metOffice Dec 2010 +! correction of H. Wells & A. Zadra for the +! aspect ratio of the hill seen by MF +! (1/R , R-inverse below: 2-R) + + rdem = max(rdem, 1.e-6) + R = sqrt(rnom/rdem) + ZR = MAX( 2. - R, 0. ) + + sigres = max(sigmin, sigma(J)) + if (hprime(J)/sigres > dxres) sigres = hprime(J)/dxres + mtbridge = ZR * sigres*ZLEN / hprime(J) +! (4.15)-IFS +! DBTMP = CDmb4 * mtbridge * +! & MAX(cos(ANG(I,K)), gamma(J)*sin(ANG(I,K))) +! (4.16)-IFS + DBTMP = CDmb4*mtbridge*(bgam* COSANG2 +cgam* SINANG2) + DB(I,K)= DBTMP * UDS(I,K) + ENDDO +! + endif + ENDDO +! +!............................. +!............................. +! end mtn blocking section +!............................. +!............................. +! +!--- Orographic Gravity Wave Drag Section +! +! Scale cleff between IM=384*2 and 192*2 for T126/T170 and T62 +! inside "cires_ugwp_initialize.F90" now +! + KMPBL = km / 2 + iwk(1:npt) = 2 +! +! METO-scheme: +! k_mtb = max(k_zmtb, k_n*hprime/2] to reduce diurnal variations taub_ogw +! + DO K=3,KMPBL + DO I=1,npt + j = ipt(i) + tem = (prsi(j,1) - prsi(j,k)) + if (tem < dpmin) iwk(i) = k ! dpmin=50 mb + +!=============================================================== +! lev=111 t=311.749 hkm=0.430522 Ps-P(iwk)=52.8958 +! below "Hprime" - source of OGWs and below Zblk !!! +! 27 2 kpbl ~ 1-2 km < Hprime +!=============================================================== + enddo + enddo +! +! iwk - adhoc GFS-parameter to select OGW-launch level between +! LEVEL ~0.4-0.5 KM from surface or/and PBL-top +! in UGWP-V1: options to modify as Htop ~ (2-3)*Hprime > Zmtb +! in UGWP-V0 we ensured that : Zogw > Zmtb +! + + KBPS = 1 + KMPS = levs + K_mtb = 1 + DO I=1,npt + J = ipt(i) + K_mtb = max(1, idxzb(i)) + + kref(I) = MAX(IWK(I), KPBL(J)+1 ) ! reference level PBL or smt-else ???? + kref(I) = MAX(kref(i), iwklm(i) ) ! iwklm => sigfac*hprime + + if (kref(i) <= idxzb(i)) kref(i) = idxzb(i) + 1 ! layer above zmtb + KBPS = MAX(KBPS, kref(I)) + KMPS = MIN(KMPS, kref(I)) +! + DELKS(I) = 1.0 / (PRSI(J,k_mtb) - PRSI(J,kref(I))) + UBAR (I) = 0.0 + VBAR (I) = 0.0 + ROLL (I) = 0.0 + BNV2bar(I)= 0.0 + ENDDO +! + KBPSP1 = KBPS + 1 + KBPSM1 = KBPS - 1 + K_mtb = 1 +! + DO I = 1,npt + K_mtb = max(1, idxzb(i)) + DO K = k_mtb,KBPS !KBPS = MAX(kref) ;KMPS= MIN(kref) + IF (K < kref(I)) THEN + J = ipt(i) + RDELKS = DEL(J,K) * DELKS(I) + UBAR(I) = UBAR(I) + RDELKS * U1(J,K) ! Mean U below kref + VBAR(I) = VBAR(I) + RDELKS * V1(J,K) ! Mean V below kref + ROLL(I) = ROLL(I) + RDELKS * RO(I,K) ! Mean RO below kref + BNV2bar(I) = BNV2bar(I) + .5*(BNV2(I,K)+BNV2(I,K+1))* RDELKS + ENDIF + ENDDO + ENDDO +! +! orographic asymmetry parameter (OA), and (CLX) + DO I = 1,npt + J = ipt(i) + wdir = atan2(UBAR(I),VBAR(I)) + pi + idir = mod(nint(fdir*wdir),mdir) + 1 + nwd = nwdir(idir) + OA(I) = (1-2*INT( (NWD-1)/4 )) * OA4(J,MOD(NWD-1,4)+1) + CLX(I) = CLX4(J,MOD(NWD-1,4)+1) + ENDDO +! + DO I = 1,npt + DTFAC(I) = 1.0 + ICRILV(I) = .FALSE. ! INITIALIZE CRITICAL LEVEL CONTROL VECTOR + ULOW(I) = MAX(SQRT(UBAR(I)*UBAR(I)+VBAR(I)*VBAR(I)),velmin) + XN(I) = UBAR(I) / ULOW(I) + YN(I) = VBAR(I) / ULOW(I) + ENDDO +! + DO K = 1, levs-1 + DO I = 1,npt + J = ipt(i) + VELCO(I,K) = 0.5 * ((U1(J,K)+U1(J,K+1))*XN(I) + & + (V1(J,K)+V1(J,K+1))*YN(I)) + ENDDO + ENDDO +! +!------------------ +! v0: incorporates latest modifications for kxridge and heff/hsat +! and taulin for Fr <=fcrit_gfs +! and concept of "clipped" hill if zmtb > 0. to make +! the integrated "tau_sso = tau_ogw +tau_mtb" close to reanalysis data +! it is still used the "single-OGWave"-approach along ULOW-upwind +! +! in contrast to the 2-orthogonal wave (2OTW) schemes of IFS/METO/E-CANADA +! 2OTW scheme requires "aver angle" and wind projections on 2 axes of ellipse a-b +! with 2-stresses: taub_a & taub_b from AS of Phillips et al. (1984) +!------------------ + taub(:) = 0. ; taulin(:)= 0. + DO I = 1,npt + J = ipt(i) + BNV = SQRT( BNV2bar(I) ) + heff = min(HPRIME(J),hpmax) + + if( zmtb(j) > 0.) heff = max(sigfac*heff-zmtb(j), 0.)/sigfac + if (heff <= 0) cycle + + hsat = fcrit_gfs*ULOW(I)/bnv + heff = min(heff, hsat) + + FR = min(BNV * heff /ULOW(I), FRMAX) +! + EFACT = (OA(I) + 2.) ** (CEOFRC*FR) + EFACT = MIN( MAX(EFACT,EFMIN), EFMAX ) +! + COEFM = (1. + CLX(I)) ** (OA(I)+1.) +! + XLINV(I) = COEFM * CLEFF ! effective kxw for Lin-wave + XLINGFS = COEFM * CLEFF +! + TEM = FR * FR * OC(J) + GFOBNV = GMAX * TEM / ((TEM + CG)*BNV) +! +!new specification of XLINV(I) & taulin(i) + + sigres = max(sigmin, sigma(J)) + if (heff/sigres > hdxres) sigres = heff/hdxres + inv_b2eff = 0.5*sigres/heff + kxridge = 1.0 / sqrt(sparea(J)) + XLINV(I) = XLINGFS !or max(kxridge, inv_b2eff) ! 6.28/Lx ..0.5*sigma(j)/heff = 1./Lridge + taulin(i) = 0.5*ROLL(I)*XLINV(I)*BNV*ULOW(I)* + & heff*heff*pgwd4 + + if ( FR > fcrit_gfs ) then + TAUB(I) = XLINV(I) * ROLL(I) * ULOW(I) * ULOW(I) + & * ULOW(I) * GFOBNV * EFACT *pgwd4 ! nonlinear FLUX Tau0...XLINV(I) +! + else +! + TAUB(I) = XLINV(I) * ROLL(I) * ULOW(I) * ULOW(I) + & * ULOW(I) * GFOBNV * EFACT *pgwd4 +! +! TAUB(I) = taulin(i) ! linear flux for FR <= fcrit_gfs +! + endif +! +! + K = MAX(1, kref(I)-1) + TEM = MAX(VELCO(I,K)*VELCO(I,K), dw2min) + SCOR(I) = BNV2(I,K) / TEM ! Scorer parameter below ref level +! +! diagnostics for zogw > zmtb +! + zogw(J) = PHII(j, kref(I)) *rgrav + ENDDO +! +!----SET UP BOTTOM VALUES OF STRESS +! + DO K = 1, KBPS + DO I = 1,npt + IF (K <= kref(I)) TAUP(I,K) = TAUB(I) + ENDDO + ENDDO + + if (strsolver == 'PSS-1986') then + +!====================================================== +! V0-GFS OROGW-solver of Palmer et al 1986 -"PSS-1986" +! in V1-OROGW LINSATDIS of "WAM-2017" +! with LLWB-mechanism for +! rotational/non-hydrostat OGWs important for +! HighRES-FV3GFS with dx < 10 km +!====================================================== + + DO K = KMPS, KMM1 ! Vertical Level Loop + KP1 = K + 1 + DO I = 1, npt +! + IF (K >= kref(I)) THEN + ICRILV(I) = ICRILV(I) .OR. ( RI_N(I,K) < RIC) + & .OR. (VELCO(I,K) <= 0.0) + ENDIF + ENDDO +! + DO I = 1,npt + IF (K >= kref(I)) THEN + IF (.NOT.ICRILV(I) .AND. TAUP(I,K) > 0.0 ) THEN + TEMV = 1.0 / max(VELCO(I,K), velmin) +! + IF (OA(I) > 0. .AND. kp1 < kref(i)) THEN + SCORK = BNV2(I,K) * TEMV * TEMV + RSCOR = MIN(1.0, SCORK / SCOR(I)) + SCOR(I) = SCORK + ELSE + RSCOR = 1. + ENDIF +! + BRVF = SQRT(BNV2(I,K)) ! Brent-Vaisala Frequency interface +! TEM1 = XLINV(I)*(RO(I,KP1)+RO(I,K))*BRVF*VELCO(I,K)*0.5 + + TEM1 = XLINV(I)*(RO(I,KP1)+RO(I,K))*BRVF*0.5 + & * max(VELCO(I,K), velmin) + HD = SQRT(TAUP(I,K) / TEM1) + FRO = BRVF * HD * TEMV +! +! RIM is the "WAVE"-RICHARDSON NUMBER BY PALMER,Shutts, Swinbank 1986 +! + + TEM2 = SQRT(ri_n(I,K)) + TEM = 1. + TEM2 * FRO + RI_GW = ri_n(I,K) * (1.0-FRO) / (TEM * TEM) +! +! CHECK STABILITY TO EMPLOY THE 'dynamical SATURATION HYPOTHESIS' +! OF PALMER,Shutts, Swinbank 1986 +! ---------------------- + IF (RI_GW <= RIC .AND. + & (OA(I) <= 0. .OR. kp1 >= kref(i) )) THEN + TEMC = 2.0 + 1.0 / TEM2 + HD = VELCO(I,K) * (2.*SQRT(TEMC)-TEMC) / BRVF + TAUP(I,KP1) = TEM1 * HD * HD + ELSE + TAUP(I,KP1) = TAUP(I,K) * RSCOR + ENDIF + taup(i,kp1) = min(taup(i,kp1), taup(i,k)) + ENDIF + ENDIF + ENDDO + ENDDO +! +! zero momentum deposition at the top model layer +! + taup(1:npt,levs+1) = taup(1:npt,levs) +! +! Calculate wave acc-n: - (grav)*d(tau)/d(p) = taud +! + DO K = 1,KM + DO I = 1,npt + TAUD(I,K) = GRAV*(TAUP(I,K+1) - TAUP(I,K))/DEL(ipt(I),K) + ENDDO + ENDDO +! +!------scale MOMENTUM DEPOSITION AT TOP TO 1/2 VALUE +! it is zero now +! DO I = 1,npt +! TAUD(I, levs) = TAUD(I,levs) * FACTOP +! ENDDO + +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!------IF THE GRAVITY WAVE DRAG WOULD FORCE A CRITICAL LINE IN THE +!------LAYERS BELOW SIGMA=RLOLEV DURING THE NEXT DELTIM TIMESTEP, +!------THEN ONLY APPLY DRAG UNTIL THAT CRITICAL LINE IS REACHED. +! Empirical implementation of the LLWB-mechanism: Lower Level Wave Breaking +! by limiting "Ax = Dtfac*Ax" due to possible LLWB around Kref and 500 mb +! critical line [V - Ax*dtp = 0.] is smt like "LLWB" for stationary OGWs +!2019: this option limits sensitivity of taux/tauy to increase/decreaseof TAUB +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + DO K = 1,KMM1 + DO I = 1,npt + IF (K >= kref(I) .and. PRSI(ipt(i),K) >= RLOLEV) THEN + + IF(TAUD(I,K) /= 0.) THEN + TEM = DTP * TAUD(I,K) + DTFAC(I) = MIN(DTFAC(I),ABS(VELCO(I,K)/TEM)) +! DTFAC(I) = 1.0 + ENDIF + ENDIF + ENDDO + ENDDO +! +!--------------------------- OROGW-solver of GFS PSS-1986 +! + else +! +!--------------------------- OROGW-solver of WAM2017 +! +! sigres = max(sigmin, sigma(J)) +! if (heff/sigres.gt.dxres) sigres=heff/dxres +! inv_b2eff = 0.5*sigres/heff +! XLINV(I) = max(kxridge, inv_b2eff) ! 0.5*sigma(j)/heff = 1./Lridge + dtfac(:) = 1.0 + + call oro_wam_2017(im, levs, npt, ipt, kref, kdt, me, master, + & dtp, dxres, taub, u1, v1, t1, xn, yn, bnv2, ro, prsi,prsL, + & del, sigma, hprime, gamma, theta, + & sinlat, xlatd, taup, taud, pkdis) + + endif ! oro_wam_2017 - LINSATDIS-solver of WAM-2017 +! +!--------------------------- OROGW-solver of WAM2017 +! +! TOFD as in BELJAARS-2004 +! +! --------------------------- + IF( do_tofd ) then + axtms(:,:) = 0.0 ; aytms(:,:) = 0.0 + if ( kdt == 1 .and. me == 0) then + print *, 'VAY do_tofd from surface to ', ztop_tofd + endif + DO I = 1,npt + J = ipt(i) + zpbl =rgrav*phil( j, kpbl(j) ) + + sigflt = min(sgh30(j), 0.3*hprime(j)) ! cannot exceed 30% of LS-SSO + + zsurf = phii(j,1)*rgrav + do k=1,levs + zpm(k) = phiL(j,k)*rgrav + up1(k) = u1(j,k) + vp1(k) = v1(j,k) + enddo + + call ugwp_tofd1d(levs, sigflt, elvmaxd(j), zsurf, zpbl, + & up1, vp1, zpm, utofd1, vtofd1, epstofd1, krf_tofd1) + + do k=1,levs + axtms(j,k) = utofd1(k) + aytms(j,k) = vtofd1(k) +! +! add TOFD to GW-tendencies +! + pdvdt(J,k) = pdvdt(J,k) + aytms(j,k) + pdudt(J,k) = pdudt(J,k) + axtms(j,k) + enddo +!2018-diag + tau_tofd(J) = sum( utofd1(1:levs)* del(j,1:levs)) + enddo + ENDIF ! do_tofd + +!--------------------------- +! combine oro-drag effects +!--------------------------- +! + diag-3d + + dudt_tms = axtms + tau_ogw = 0. + tau_mtb = 0. + + DO K = 1,KM + DO I = 1,npt + J = ipt(i) +! + ENG0 = 0.5*(U1(j,K)*U1(j,K)+V1(J,K)*V1(J,K)) +! + if ( K < IDXZB(I) .AND. IDXZB(I) /= 0 ) then +! +! if blocking layers -- no OGWs +! + DBIM = DB(I,K) / (1.+DB(I,K)*DTP) + Pdvdt(j,k) = - DBIM * V1(J,K) +Pdvdt(j,k) + Pdudt(j,k) = - DBIM * U1(J,K) +Pdudt(j,k) + ENG1 = ENG0*(1.0-DBIM*DTP)*(1.-DBIM*DTP) + + DUSFC(J) = DUSFC(J) - DBIM * U1(J,K) * DEL(J,K) + DVSFC(J) = DVSFC(J) - DBIM * V1(J,K) * DEL(J,K) +!2018-diag + dudt_mtb(j,k) = -DBIM * U1(J,K) + tau_mtb(j) = tau_mtb(j) + dudt_mtb(j,k)* DEL(J,K) + + else +! +! OGW-s above blocking height +! + TAUD(I,K) = TAUD(I,K) * DTFAC(I) + DTAUX = TAUD(I,K) * XN(I) * pgwd + DTAUY = TAUD(I,K) * YN(I) * pgwd + + Pdvdt(j,k) = DTAUY +Pdvdt(j,k) + Pdudt(j,k) = DTAUX +Pdudt(j,k) + + unew = U1(J,K) + DTAUX*dtp ! Pdudt(J,K)*DTP + vnew = V1(J,K) + DTAUY*dtp ! Pdvdt(J,K)*DTP + ENG1 = 0.5*(unew*unew + vnew*vnew) +! + DUSFC(J) = DUSFC(J) + DTAUX * DEL(J,K) + DVSFC(J) = DVSFC(J) + DTAUY * DEL(J,K) +!2018-diag + dudt_ogw(j,k) = DTAUX + tau_ogw(j) = tau_ogw(j) +DTAUX*DEL(j,k) + endif +! +! local energy deposition SSO-heat +! + Pdtdt(j,k) = max(ENG0-ENG1,0.)*rcpdt + ENDDO + ENDDO +! dusfc w/o tofd sign as in the ERA-I, MERRA and CFSR + DO I = 1,npt + J = ipt(i) + DUSFC(J) = -rgrav * DUSFC(J) + DVSFC(J) = -rgrav * DVSFC(J) + tau_mtb(j) = -rgrav * tau_mtb(j) + tau_ogw(j) = -rgrav * tau_ogw(j) + tau_tofd(J) = -rgrav * tau_tofd(j) + ENDDO + + RETURN + + +!============ debug ------------------------------------------------ + if (kdt <= 2 .and. me == 0) then + print *, 'vgw-oro done gwdps_v0 in ugwp-v0 step-proc ', kdt, me +! + print *, maxval(pdudt)*86400., minval(pdudt)*86400, 'vgw_axoro' + print *, maxval(pdvdt)*86400., minval(pdvdt)*86400, 'vgw_ayoro' +! print *, maxval(kdis), minval(kdis), 'vgw_kdispro m2/sec' + print *, maxval(pdTdt)*86400., minval(pdTdt)*86400,'vgw_epsoro' + print *, maxval(zmtb), ' z_mtb ', maxval(tau_mtb), ' tau_mtb ' + print *, maxval(zogw), ' z_ogw ', maxval(tau_ogw), ' tau_ogw ' +! print *, maxval(tau_tofd), ' tau_tofd ' +! print *, maxval(axtms)*86400., minval(axtms)*86400, 'vgw_axtms' +! print *,maxval(dudt_mtb)*86400.,minval(dudt_mtb)*86400,'vgw_axmtb' + if (maxval(abs(pdudt))*86400. > 100.) then + + print *, maxval(u1), minval(u1), ' u1 gwdps-v0 ' + print *, maxval(v1), minval(v1), ' v1 gwdps-v0 ' + print *, maxval(t1), minval(t1), ' t1 gwdps-v0 ' + print *, maxval(q1), minval(q1), ' q1 gwdps-v0 ' + print *, maxval(del), minval(del), ' del gwdps-v0 ' + print *, maxval(phil)*rgrav,minval(phil)*rgrav, 'zmet' + print *, maxval(phii)*rgrav,minval(phii)*rgrav, 'zmeti' + print *, maxval(prsi), minval(prsi), ' prsi ' + print *, maxval(prsL), minval(prsL), ' prsL ' + print *, maxval(RO), minval(RO), ' RO-dens ' + print *, maxval(bnv2(1:npt,:)), minval(bnv2(1:npt,:)),' BNV2 ' + print *, maxval(kpbl), minval(kpbl), ' kpbl ' + print *, maxval(sgh30), maxval(hprime), maxval(elvmax),'oro-d' + print * + do i =1, npt + j= ipt(i) + print *,zogw(J)/hprime(j), zmtb(j)/hprime(j), + & phil(j,1)/9.81, nint(hprime(j)/sigma(j)) +! +!.................................................................... +! +! zogw/hp=5.9 zblk/hp=10.7 zm=11.1m ridge/2=2,489m/9,000m +! from 5 to 20 km , we need to count for "ridges" > dx/4 ~ 15 km +! we must exclude blocking by small ridges +! VAY-kref < iblk zogw-lev 15 block-level: 39 +! +! velmin => 1.0, 0.01, 0.1 etc.....unification of wind limiters +! MAX(SQRT(U1(J,K)*U1(J,K) + V1(J,K)*V1(J,K)), minwnd) +! MAX(DW2,DW2MIN) * RDZ * RDZ +! ULOW(I) = MAX(SQRT(UBAR(I)*UBAR(I) + VBAR(I)*VBAR(I)), 1.0) +! TEM = MAX(VELCO(I,K)*VELCO(I,K), 0.1) +! TEMV = 1.0 / max(VELCO(I,K), 0.01) +! & * max(VELCO(I,K),0.01) +!.................................................................... + enddo + print * + stop + endif + endif + +! + RETURN +!--------------------------------------------------------------- +! review of OLD-GFS code 2017/18 most substantial changes +! a) kref > idxzb if idxzb > KPBL "OK" clipped-hill for OGW +! b) tofd -sgh30 "OK" +! +! c) FR < Frc linear theory for taub-specification +! +! d) solver of Palmer et al. (1987) => Linsat of McFarlane +! +!--------------------------------------------------------------- + end subroutine gwdps_v0 + + + +!=============================================================================== +! use fv3gfs-v0 +! first beta version of ugwp for fv3gfs-128 +! cires/swpc - jan 2018 +! non-tested wam ugwp-solvers in fv3gfs: "lsatdis", "dspdis", "ado99dis" +! they reqiure extra-work to put them in with intializtion and namelists +! next will be lsatdis for both fv3wam & fv3gfs-128l implementations +! with (a) stochastic-deterministic propagation solvers for wave packets/spectra +! (b) gw-sources: oro/convection/dyn-instability (fronts/jets/pv-anomalies) +! (c) guidance from high-res runs for GW sources and res-aware tune-ups +!23456 +! +! call gwdrag_wam(1, im, ix, levs, ksrc, dtp, +! & xlat, gw_dudt, gw_dvdt, taux, tauy) +! call fv3_ugwp_wms17(kid1, im, ix, levs, ksrc_ifs, dtp, +! & adt,adu,adv,prsl,prsi,phil,xlat, gw_dudt, gw_dvdt, gw_dtdt, gw_ked, +! & taux,tauy,grav, amol_i, me, lstep_first ) +! +! +!23456============================================================================== + + + subroutine fv3_ugwp_solv2_v0(klon, klev, dtime, + & tm1 , um1, vm1, qm1, + & prsl, prsi, philg, xlatd, sinlat, coslat, + & pdudt, pdvdt, pdtdt, dked, tau_ngw, mpi_id, master, kdt) +! + + +!======================================================= +! +! nov 2015 alternative gw-solver for nggps-wam +! nov 2017 nh/rotational gw-modes for nh-fv3gfs +! --------------------------------------------------------------------------------- +! + + use ugwp_common , only : rgrav, grav, cpd, rd, rv + &, omega2, rcpd2, pi, pi2, fv + &, rad_to_deg, deg_to_rad + &, rdi, gor, grcp, gocp + &, bnv2min, dw2min, velmin, gr2 +! + use ugwp_wmsdis_init, only : hpscale, rhp2, bv2min, gssec + &, v_kxw, v_kxw2, tamp_mpa, zfluxglob + &, maxdudt, gw_eff, dked_min + &, nslope, ilaunch, zms + &, zci, zdci, zci4, zci3, zci2 + &, zaz_fct, zcosang, zsinang + &, nwav, nazd, zcimin, zcimax +! + implicit none +!23456 + + integer, intent(in) :: klev ! vertical level + integer, intent(in) :: klon ! horiz tiles + + real ,intent(in) :: dtime ! model time step + real ,intent(in) :: vm1(klon,klev) ! meridional wind + real ,intent(in) :: um1(klon,klev) ! zonal wind + real ,intent(in) :: qm1(klon,klev) ! spec. humidity + real ,intent(in) :: tm1(klon,klev) ! kin temperature + + real ,intent(in) :: prsl(klon,klev) ! mid-layer pressure + real ,intent(in) :: philg(klon,klev) ! m2/s2-phil => meters !!!!! phil =philg/grav + real ,intent(in) :: prsi(klon,klev+1) ! prsi interface pressure + real ,intent(in) :: xlatd(klon) ! lat was in radians, now with xlat_d in degrees + real ,intent(in) :: sinlat(klon) + real ,intent(in) :: coslat(klon) + real ,intent(in) :: tau_ngw(klon) + + integer, intent(in):: mpi_id, master, kdt +! +! +! out-gw effects +! + real ,intent(out) :: pdudt(klon,klev) ! zonal momentum tendency + real ,intent(out) :: pdvdt(klon,klev) ! meridional momentum tendency + real ,intent(out) :: pdtdt(klon,klev) ! gw-heating (u*ax+v*ay)/cp + real ,intent(out) :: dked(klon,klev) ! gw-eddy diffusion + real, parameter :: minvel = 0.5 ! + +!vay-2018 + + real :: taux(klon,klev+1) ! EW component of vertical momentum flux (pa) + real :: tauy(klon,klev+1) ! NS component of vertical momentum flux (pa) + real :: phil(klon,klev) ! gphil/grav +! +! local =============================================================================================== +! + +! real :: zthm1(klon,klev) ! temperature interface levels + real :: zthm1 ! 1.0 / temperature interface levels + real :: zbvfhm1(klon,ilaunch:klev) ! interface BV-frequency + real :: zbn2(klon,ilaunch:klev) ! interface BV-frequency + real :: zrhohm1(klon,ilaunch:klev) ! interface density + real :: zuhm1(klon,ilaunch:klev) ! interface zonal wind + real :: zvhm1(klon,ilaunch:klev) ! meridional wind + real :: v_zmet(klon,ilaunch:klev) + real :: vueff(klon,ilaunch:klev) + real :: zbvfl(klon) ! BV at launch level + real :: c2f2(klon) + +!23456 + real :: zul(klon,nazd) ! velocity in azimuthal direction at launch level + real :: zci_min(klon,nazd) + real :: zcrt(klon,klev,nazd) + real :: zact(klon, nwav, nazd) ! if =1 then critical level encountered => c-u + real :: zacc(klon, nwav, nazd) +! + real :: zpu(klon,klev, nazd) ! momentum flux + real :: zdfl(klon,klev, nazd) + real :: zfct(klon,klev) + real :: zfnorm(klon) ! normalisation factor + + real :: zfluxlaun(klon) + real :: zui(klon, klev,nazd) +! + real :: zdfdz_v(klon,klev, nazd) ! axj = -df*rho/dz directional momentum depositiom + real :: zflux(klon, nwav, nazd) ! momentum flux at each level stored as ( ix, mode, iazdim) + + real :: zflux_z (klon, nwav,klev) !momentum flux at each azimuth stored as ( ix, mode, klev) +! + real :: vm_zflx_mode, vc_zflx_mode + real :: kzw2, kzw3, kdsat, cdf2, cdf1, wdop2 + + real :: zang, znorm, zang1, ztx + real :: zu, zcin, zcpeak, zcin4, zbvfl4 + real :: zcin2, zbvfl2, zcin3, zbvfl3, zcinc + real :: zatmp, zfluxs, zdep, zfluxsq, zulm, zdft, ze1, ze2 + +! + real :: zdelp,zrgpts + real :: zthstd,zrhostd,zbvfstd + real :: tvc1, tvm1 + real :: zhook_handle + + +! real :: rcpd, grav2cpd + real, parameter :: rcpdl = cpd/grav ! 1/[g/cp] == cp/g + &, grav2cpd = grav/rcpdl ! g*(g/cp)= g^2/cp + + real :: fmode, expdis, fdis + real :: v_kzi, v_kzw, v_cdp, v_wdp, sc, tx1 + + integer :: j, k, inc, jk, jl, iazi +! +!-------------------------------------------------------------------------- +! + do k=1,klev + do j=1,klon + pdvdt(j,k) = 0.0 + pdudt(j,k) = 0.0 + pdtdt(j,k) = 0.0 + dked(j,k) = 0.0 + phil(j,k) = philg(j,k) * rgrav + enddo + enddo +!----------------------------------------------------------- +! also other options to alter tropical values +! tamp = 100.e-3*1.e3 = 100 mpa +! vay-2017 zfluxglob=> lat-dep here from geos-5/merra-2 +!----------------------------------------------------------- +! call slat_geos5_tamp(klon, tamp_mpa, xlatd, tau_ngw) + + +! phil = philg*rgrav + +! rcpd = 1.0/(grav/cpd) ! 1/[g/cp] +! grav2cpd = grav*grav/cpd ! g*(g/cp)= g^2/cp + + if (kdt ==1 .and. mpi_id == master) then + print *, maxval(tm1), minval(tm1), 'vgw: temp-res ' + print *, 'ugwp-v0: zcimin=' , zcimin + print *, 'ugwp-v0: zcimax=' , zcimax + print * + endif +! +!================================================= + do iazi=1, nazd + do jk=1,klev + do jl=1,klon + zpu(jl,jk,iazi) = 0.0 + zcrt(jl,jk,iazi) = 0.0 + zdfl(jl,jk,iazi) = 0.0 + enddo + enddo + enddo + +! +! set initial min Cxi for critical level absorption + do iazi=1,nazd + do jl=1,klon + zci_min(jl,iazi) = zcimin + enddo + enddo +! define half model level winds and temperature +! --------------------------------------------- + do jk=max(ilaunch,2),klev + do jl=1,klon + tvc1 = tm1(jl,jk) * (1. +fv*qm1(jl,jk)) + tvm1 = tm1(jl,jk-1) * (1. +fv*qm1(jl,jk-1)) +! zthm1(jl,jk) = 0.5 *(tvc1+tvm1) + zthm1 = 2.0 / (tvc1+tvm1) + zuhm1(jl,jk) = 0.5 *(um1(jl,jk-1)+um1(jl,jk)) + zvhm1(jl,jk) = 0.5 *(vm1(jl,jk-1)+vm1(jl,jk)) +! zrhohm1(jl,jk) = prsi(jl,jk)*rdi/zthm1(jl,jk) ! rho = p/(RTv) + zrhohm1(jl,jk) = prsi(jl,jk)*rdi*zthm1 ! rho = p/(RTv) + zdelp = phil(jl,jk)-phil(jl,jk-1) !>0 ...... dz-meters + v_zmet(jl,jk) = 2.*zdelp + vueff(jl,jk) = + & 2.e-5*exp( (phil(jl,jk)+phil(jl,jk-1))*rhp2)+dked_min +! +! zbn2(jl,jk) = grav2cpd/zthm1(jl,jk) + zbn2(jl,jk) = grav2cpd*zthm1 + & * (1.0+rcpdl*(tm1(jl,jk)-tm1(jl,jk-1))/zdelp) + zbn2(jl,jk) = max(min(zbn2(jl,jk), gssec), bv2min) + zbvfhm1(jl,jk) = sqrt(zbn2(jl,jk)) ! bn = sqrt(bn2) + enddo + enddo + + if (ilaunch == 1) then + jk = 1 + do jl=1,klon +! zthm1(jl,jk) = tm1(jl,jk) * (1. +fv*qm1(jl,jk)) ! not used + zuhm1(jl,jk) = um1(jl,jk) + zvhm1(jl,jk) = vm1(jl,jk) + ZBVFHM1(JL,1) = ZBVFHM1(JL,2) + V_ZMET(JL,1) = V_ZMET(JL,2) + VUEFF(JL,1) = DKED_MIN + ZBN2(JL,1) = ZBN2(JL,2) + enddo + endif + do jl=1,klon + tx1 = OMEGA2 * SINLAT(JL) / V_KXW + C2F2(JL) = tx1 * tx1 + zbvfl(jl) = zbvfhm1(jl,ilaunch) + enddo +! +! define intrinsic velocity (relative to launch level velocity) u(z)-u(zo), and coefficinets +! ------------------------------------------------------------------------------------------ + do iazi=1, nazd + do jl=1,klon + zul(jl,iazi) = zcosang(iazi) * zuhm1(jl,ilaunch) + & + zsinang(iazi) * zvhm1(jl,ilaunch) + enddo + enddo +! + do jk=ilaunch, klev-1 ! from z-launch up model level from which gw spectrum is launched + do iazi=1, nazd + do jl=1,klon + zu = zcosang(iazi)*zuhm1(jl,jk) + & + zsinang(iazi)*zvhm1(jl,jk) + zui(jl,jk,iazi) = zu - zul(jl,iazi) + enddo + enddo + + enddo +! define rho(zo)/n(zo) +! ------------------- + do jk=ilaunch, klev-1 + do jl=1,klon + zfct(jl,jk) = zrhohm1(jl,jk) / zbvfhm1(jl,jk) + enddo + enddo + +! ----------------------------------------- +! set launch momentum flux spectral density +! ----------------------------------------- + + if(nslope == 1) then ! s=1 case + ! -------- + do inc=1,nwav + zcin = zci(inc) + zcin4 = zci4(inc) + do jl=1,klon +!n4 + zbvfl4 = zbvfl(jl) * zbvfl(jl) + zbvfl4 = zbvfl4 * zbvfl4 + zflux(jl,inc,1) = zfct(jl,ilaunch)*zbvfl4*zcin + & / (zbvfl4+zcin4) + enddo + enddo + elseif(nslope == 2) then ! s=2 case + ! -------- + do inc=1, nwav + zcin = zci(inc) + zcin4 = zci4(inc) + do jl=1,klon + zbvfl4 = zbvfl(jl)*zbvfl(jl) + zbvfl4 = zbvfl4 * zbvfl4 + zcpeak = zbvfl(jl)/zms + zflux(jl,inc,1) = zfct(jl,ilaunch)* + & zbvfl4*zcin*zcpeak/(zbvfl4*zcpeak+zcin4*zcin) + enddo + enddo + elseif(nslope == -1) then ! s=-1 case + ! -------- + do inc=1,nwav + zcin = zci(inc) + zcin2 = zci2(inc) + do jl=1,klon + zbvfl2 = zbvfl(jl)*zbvfl(jl) + zflux(jl,inc,1) = zfct(jl,ilaunch)*zbvfl2*zcin + & / (zbvfl2+zcin2) + enddo + enddo + elseif(nslope == 0) then ! s=0 case + ! -------- + + do inc=1, nwav + zcin = zci(inc) + zcin3 = zci3(inc) + do jl=1,klon + zbvfl3 = zbvfl(jl)**3 + zflux(jl,inc,1) = zfct(jl,ilaunch)*zbvfl3*zcin + & / (zbvfl3+zcin3) + enddo + enddo + + endif ! for slopes +! +! normalize momentum flux at the src-level +! ------------------------------ +! integrate (zflux x dx) + do inc=1, nwav + zcinc = zdci(inc) + do jl=1,klon + zpu(jl,ilaunch,1) = zpu(jl,ilaunch,1) + zflux(jl,inc,1)*zcinc + enddo + enddo +! +! normalize and include lat-dep (precip or merra-2) +! ----------------------------------------------------------- +! also other options to alter tropical values +! + do jl=1,klon + zfluxlaun(jl) = tau_ngw(jl) !*(.5+.75*coslat(JL)) !zfluxglob/2 on poles + zfnorm(jl) = zfluxlaun(jl) / zpu(jl,ilaunch,1) + enddo +! + do iazi=1,nazd + do jl=1,klon + zpu(jl,ilaunch,iazi) = zfluxlaun(jl) + enddo + enddo + +! adjust constant zfct + + do jk=ilaunch, klev-1 + do jl=1,klon + zfct(jl,jk) = zfnorm(jl)*zfct(jl,jk) + enddo + enddo +! renormalize each spectral mode + + do inc=1, nwav + do jl=1,klon + zflux(jl,inc,1) = zfnorm(jl)*zflux(jl,inc,1) + enddo + enddo + +! copy zflux into all other azimuths +! -------------------------------- + zact(:,:,:) = 1.0 ; zacc(:,:,:) = 1.0 + do iazi=2, nazd + do inc=1,nwav + do jl=1,klon + zflux(jl,inc,iazi) = zflux(jl,inc,1) + enddo + enddo + enddo + +! ------------------------------------------------------------- +! azimuth do-loop +! -------------------- + do iazi=1, nazd +! vertical do-loop +! ---------------- + do jk=ilaunch, klev-1 +! first check for critical levels +! ------------------------ + do jl=1,klon + zci_min(jl,iazi) = max(zci_min(jl,iazi),zui(jl,jk,iazi)) + enddo +! set zact to zero if critical level encountered +! ---------------------------------------------- + do inc=1, nwav + zcin = zci(inc) + do jl=1,klon + zatmp = minvel + sign(minvel,zcin-zci_min(jl,iazi)) + zacc(jl,inc,iazi) = zact(jl,inc,iazi)-zatmp + zact(jl,inc,iazi) = zatmp + enddo + enddo +! +! integrate to get critical-level contribution to mom deposition +! --------------------------------------------------------------- + do inc=1, nwav + zcinc = zdci(inc) + do jl=1,klon + zdfl(jl,jk,iazi) = zdfl(jl,jk,iazi) + + & zacc(jl,inc,iazi)*zflux(jl,inc,iazi)*zcinc + enddo + enddo +! -------------------------------------------- +! get weighted average of phase speed in layer +! -------------------------------------------- + do jl=1,klon + if(zdfl(jl,jk,iazi) > 0.0 ) then + zatmp = zcrt(jl,jk,iazi) + do inc=1, nwav + zatmp = zatmp + zci(inc) * + & zacc(jl,inc,iazi)*zflux(jl,inc,iazi)*zdci(inc) + enddo +! + zcrt(jl,jk,iazi)=zatmp/zdfl(jl,jk,iazi) + else + zcrt(jl,jk,iazi)=zcrt(jl,jk-1,iazi) + endif + enddo + +! + do inc=1, nwav + zcin = zci(inc) + zcinc = 1.0 / zcin + do jl=1,klon +!======================================================================= +! saturated limit wfit = kzw*kzw*kt; wfdt = wfit/(kxw*cx)*betat +! & dissipative kzi = 2.*kzw*(wfdm+wfdt)*dzpi(k) +! define kxw = +!======================================================================= + v_cdp = abs(zcin-zui(jL,jk,iazi)) + v_wdp = v_kxw*v_cdp + wdop2 = v_wdp* v_wdp + cdf2 = v_cdp*v_cdp - c2f2(jL) + if (cdf2 > 0) then + kzw2 = (zBn2(jL,jk)-wdop2)/Cdf2 - v_kxw2 + else + kzw2 = 0.0 + endif + if ( kzw2 > 0 ) then + v_kzw = sqrt(kzw2) +! +!linsatdis: kzw2, kzw3, kdsat, c2f2, cdf2, cdf1 +! +!kzw2 = (zBn2(k)-wdop2)/Cdf2 - rhp4 - v_kx2w ! full lin DS-NiGW (N2-wd2)*k2=(m2+k2+[1/2H]^2)*(wd2-f2) +! Kds = kxw*Cdf1*rhp2/kzw3 +! + v_cdp = sqrt( cdf2 ) + v_wdp = v_kxw * v_cdp + v_kzi = abs(v_kzw*v_kzw*vueff(jl,jk)/v_wdp*v_kzw) + expdis = exp(-v_kzi*v_zmet(jl,jk)) + else + v_kzi = 0. + expdis = 1.0 + v_kzw = 0. + v_cdp = 0. ! no effects of reflected waves + endif + + fmode = zflux(jl,inc,iazi) + fdis = fmode*expdis +! +! saturated flux + wave dissipation - Keddy_gwsat in UGWP-V1 +! linsatdis = 1.0 , here: u'^2 ~ linsatdis* [v_cdp*v_cdp] +! + zfluxs= zfct(jl,jk)*v_cdp*v_cdp*zcinc +! +! zfluxs= zfct(jl,jk)*(zcin-zui(jl,jk,iazi))**2/zcin +! flux_tot - sat.flux +! + + zdep = zact(jl,inc,iazi)* (fdis-zfluxs) + if(zdep > 0.0 ) then +! subs on sat-limit + zflux(jl,inc,iazi) = zfluxs + zflux_z(jl,inc,jk) = zfluxs + else +! assign dis-ve flux + zflux(jl,inc,iazi) = fdis + zflux_z(jl,inc,jk) = fdis + endif + enddo + enddo +! +! integrate over spectral modes zpu(y, z, azimuth) zact(jl,inc,iazi)*zflux(jl,inc,iazi)*[d("zcinc")] +! + zdfdz_v(:,jk,iazi) = 0.0 + + do inc=1, nwav + zcinc=zdci(inc) ! dc-integration + do jl=1,klon + vc_zflx_mode = zact(jl,inc,iazi)*zflux(jl,inc,iazi) + zpu(jl,jk,iazi) = zpu(jl,jk,iazi) + vc_zflx_mode*zcinc + +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +! check monotonic decrease +! (heat deposition integration over spectral mode for each azimuth +! later sum over selected azimuths as "non-negative" scalars) +!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (jk > ilaunch)then + zdelp = grav/(prsi(jl,jk-1)-prsi(jl,jk))* + & abs(zcin-zui(jl,jk,iazi)) *zcinc + vm_zflx_mode = zact(jl,inc,iazi)* zflux_z(jl,inc,jk-1) + + if (vc_zflx_mode > vm_zflx_mode) + & vc_zflx_mode = vm_zflx_mode ! no-flux increase + zdfdz_v( jl,jk,iazi) = zdfdz_v( jl,jk,iazi) + + & (vm_zflx_mode-vc_zflx_mode)*zdelp ! heating >0 +! +! + endif + enddo !jl=1,klon + enddo !waves inc=1,nwav + +! -------------- + enddo ! end jk do-loop vertical loop +! --------------- + enddo ! end nazd do-loop +! ---------------------------------------------------------------------------- +! sum contribution for total zonal and meridional flux + +! energy dissipation +! --------------------------------------------------- +! + do jk=1,klev+1 + do jl=1,klon + taux(jl,jk) = 0.0 + tauy(jl,jk) = 0.0 + enddo + enddo + + do iazi=1,nazd + do jk=ilaunch, klev-1 + do jl=1,klon + taux(jl,jk) = taux(jl,jk) + & + zpu(jl,jk,iazi)*zaz_fct*zcosang(iazi) ! zaz_fct - "azimuth"-norm-n + tauy(jl,jk) = tauy(jl,jk) + & + zpu(jl,jk,iazi)*zaz_fct*zsinang(iazi) + pdtdt(jl,jk) = pdtdt(jl,jk) + & + zdfdz_v(jl,jk,iazi)*zaz_fct/cpd ! eps_dis =sum( +d(flux_e)/dz) > 0. + enddo + enddo + + enddo +! +! update du/dt and dv/dt tendencies ..... no contribution to heating => keddy/tracer-mom-heat +! ---------------------------- +! + + do jk=ilaunch,klev + do jl=1, klon + zdelp = grav / (prsi(jl,jk-1)-prsi(jl,jk)) + ze1 = (taux(jl,jk)-taux(jl,jk-1))*zdelp + ze2 = (tauy(jl,jk)-tauy(jl,jk-1))*zdelp + if (abs(ze1) >= maxdudt ) then + ze1 = sign(maxdudt, ze1) + endif + if (abs(ze2) >= maxdudt ) then + ze2 = sign(maxdudt, ze2) + endif + pdudt(jl,jk) = -ze1 + pdvdt(jl,jk) = -ze2 +! +! Cx =0 based Cx=/= 0. above +! + pdtdt(jl,jk) = (ze1*um1(jl,jk) + ze2*vm1(jl,jk))/cpd +! + dked(jl,jk) = max(dked_min, pdtdt(jl,jk)/zbn2(jl,jk)) +! if (dked(jl,jk) < 0) dked(jl,jk) = dked_min + enddo + enddo +! +! add limiters/efficiency for "unbalanced ics" if it is needed +! + do jk=ilaunch,klev + do jl=1, klon + pdudt(jl,jk) = gw_eff * pdudt(jl,jk) + pdvdt(jl,jk) = gw_eff * pdvdt(jl,jk) + pdtdt(jl,jk) = gw_eff * pdtdt(jl,jk) + dked(jl,jk) = gw_eff * dked(jl,jk) + enddo + enddo +! +!--------------------------------------------------------------------------- +! + if (kdt == 1 .and. mpi_id == master) then + print *, 'vgw done ' +! + print *, maxval(pdudt)*86400., minval(pdudt)*86400, 'vgw ax' + print *, maxval(pdvdt)*86400., minval(pdvdt)*86400, 'vgw ay' + print *, maxval(dked)*1., minval(dked)*1, 'vgw keddy m2/sec' + print *, maxval(pdtdt)*86400., minval(pdtdt)*86400,'vgw eps' +! +! print *, ' ugwp -heating rates ' + endif + + return + end subroutine fv3_ugwp_solv2_v0 +!------------------------------------------------------------------------------- +! +! Part-3 of UGWP-V01 Dissipative (eddy) effects of UGWP it will be activated +! after tests of OGW (new revision) and NGW with MERRA-2 forcing. +! +!------------------------------------------------------------------------------- + subroutine edmix_ugwp_v0(im, levs, dtp, + & t1, u1, v1, q1, del, + & prsl, prsi, phil, prslk, + & pdudt, pdvdt, pdTdt, pkdis, + & ed_dudt, ed_dvdt, ed_dTdt, + & me, master, kdt ) +! + use machine, only : kind_phys + use ugwp_common , only : rgrav, grav, cpd, rd, rdi, fv +! &, pi, rad_to_deg, deg_to_rad, pi2 + &, bnv2min, velmin, arad + + implicit none + + integer, intent(in) :: me, master, kdt + integer, intent(in) :: im, levs + real(kind=kind_phys), intent(in) :: dtp + real(kind=kind_phys), intent(in), dimension(im,levs) :: + & u1, v1, t1, q1, del, prsl, prslk, phil +! + real(kind=kind_phys), intent(in),dimension(im,levs+1):: prsi + real(kind=kind_phys),dimension(im,levs) :: pdudt, pdvdt, pdTdt + real(kind=kind_phys),dimension(im,levs) :: pkdis +! +! out +! + real(kind=kind_phys),dimension(im,levs) :: ed_dudt, ed_dvdt + real(kind=kind_phys),dimension(im,levs) :: ed_dTdt +! +! locals +! + integer :: i, j, k +!------------------------------------------------------------------------ +! solving 1D-vertical eddy diffusion to "smooth" +! GW-related tendencies: du/dt, dv/dt, d(PT)/dt +! we need to use sum of molecular + eddy terms including turb-part +! of PBL extended to the model top, because "phys-tend" dx/dt +! should be smoothed as "entire" fields therefore one should +! first estimate and collect "effective" diffusion and applied +! it to each part of tendency or "sum of tendencies + Xdyn" +! this "diffusive-way" is tested with UGWP-tendencies +! forced by various wave sources. X' =dx/dt *dt +! d(X + X')/dt = K*diff(X + X') => +! +! wave1 dX'/dt = Kw * diff(X')... eddy part "Kwave" on wave-part +! turb2 dX/dt = Kturb * diff(X) ... resolved scale mixing "Kturb" like PBL +! we may assume "zero-GW"-tendency at the top lid and "zero" flux +! or "vertical gradient" near the surface +! +! 1-st trial w/o PBL interactions: add dU, dV dT tendencies +! compute BV, SHR2, Ri => Kturb, Kturb + Kwave => Apply it to "X_Tend +X " +! ed_X = X_ed - X => final eddy tendencies +!--------------------------------------------------------------------------- +! rzs=30m dk = rzs*rzs*sqrt(shr2(i,k)) +! Ktemp = dk/(1+5.*ri)**2 Kmom = Pr*Ktemp +! + real(kind=kind_phys) :: Sw(levs), Sw1(levs), Fw(levs), Fw1(levs) + real(kind=kind_phys) :: Km(levs), Kpt(levs), Pt(levs), Ptmap(levs) + real(kind=kind_phys) :: rho(levs), rdp(levs), rdpm(levs-1) + real(kind=kind_phys),dimension(levs) :: ktur, vumol, up, vp, tp + real(kind=kind_phys),dimension(levs) :: bn2, shr2, ksum + real(kind=kind_phys) :: eps_shr, eps_bn2, eps_dis + real(kind=kind_phys) :: rdz , uz, vz, ptz +! ------------------------------------------------------------------------- +! Prw*Lsat2 =1, for GW-eddy diffusion Pr_wave = Kv/Kt +! Pr_wave ~1/Lsat2 = 1/Frcit2 = 2. => Lsat2 = 1./2 (Frc ~0.7) +! m*u'/N = u'/{c-U) = h'N/(c-U) = Lsat = Fcrit +! > PBL: 0.25 < prnum = 1.0 + 2.1*ri < 4 +! monin-edmf parameter(rlam=30.0,vk=0.4,vk2=vk*vk) rlamun=150.0 +! + real(kind=kind_phys), parameter :: iPr_pt = 0.5, dw2min = 1.e-4 + real(kind=kind_phys), parameter :: lturb = 30., sc2 = lturb*lturb + real(kind=kind_phys),parameter :: ulturb=150.,sc2u=ulturb* ulturb + real(kind=kind_phys), parameter :: ric =0.25 + real(kind=kind_phys), parameter :: rimin = -10., prmin = 0.25 + real(kind=kind_phys), parameter :: prmax = 4.0 + real(kind=kind_phys), parameter :: hps = 7000., h4 = 0.25/hps + real(kind=kind_phys), parameter :: kedmin = 0.01, kedmax = 250. + + + real(kind=kind_phys) :: rdtp, rineg, kamp, zmet, zgrow + real(kind=kind_phys) :: stab, stab_dt, dtstab, ritur + integer :: nstab + real(kind=kind_phys) :: w1, w2, w3 + rdtp = 1./dtp + nstab = 1 + stab_dt = 0.9999 + + do i =1, im + + rdp(1:levs) = grav/del(i, 1:levs) + + up(1:levs) = u1(i,1:levs) +pdudt(i,1:levs)*dtp + vp(1:levs) = v1(i,1:levs) +pdvdt(i,1:levs)*dtp + tp(1:levs) = t1(i,1:levs) +pdTdt(i,1:levs)*dtp + Ptmap(1:levs) = (1.+fv*q1(i,1:levs))/prslk(i,1:levs) + rho(1:levs) = rdi*prsl(i, 1:levs)/tp(1:levs) + Pt(1:levs) = tp(1:levs)*Ptmap(1:levs) + + do k=1, levs-1 + rdpm(k) = grav/(prsl(i,k)-prsl(i,k+1)) + rdz = .5*rdpm(k)*(rho(k)+rho(k+1)) + uz = up(k+1)-up(k) + vz = vp(k+1)-vp(k) + ptz =2.*(pt(k+1)-pt(k))/(pt(k+1)+pt(k)) + shr2(k) = rdz*rdz*(max(uz*uz+vz*vz, dw2min)) + bn2(k) = grav*rdz*ptz + zmet = phil(j,k)*rgrav + zgrow = exp(zmet*h4) + if ( bn2(k) < 0. ) then +! +! adjust PT-profile to bn2(k) = bnv2min -- neutral atmosphere +! adapt "pdtdt = (Ptadj-Ptdyn)/Ptmap" +! + print *,' UGWP-V0 unstab PT(z) via gwdTdt ', bn2(k), k + + rineg = bn2(k)/shr2(k) + bn2(k) = max(bn2(k), bnv2min) + kamp = sqrt(shr2(k))*sc2u *zgrow + ktur(k) =kamp* (1+8.*(-rineg)/(1+1.746*sqrt(-rineg))) + endif + ritur = max(bn2(k)/shr2(k), rimin) + if (ritur > 0. ) then + kamp = sqrt(shr2(k))*sc2 *zgrow + w1 = 1./(1. + 5*ritur) + ktur(k)= kamp * w1 * w1 + endif + vumol(k) = 2.e-5 *exp(zmet/hps) + ksum(k) =ktur(k)+Pkdis(i,k)+vumol(k) + ksum(k) = max(ksum(k), kedmin) + ksum(k) = min(ksum(k), kedmax) + stab = 2.*ksum(k)*rdz*rdz*dtp + if ( stab >= 1.0 ) then + stab_dt = max(stab_dt, stab) + endif + enddo + nstab = max(1, nint(stab_dt)+1) + dtstab = dtp / float(nstab) + ksum(levs) = ksum(levs-1) + Fw(1:levs) = pdudt(i, 1:levs) + Fw1(1:levs) = pdvdt(i, 1:levs) + Km(1:levs) = ksum(1:levs) * rho(1:levs)* rho(1:levs) + + do j=1, nstab + call diff_1d_wtend(levs, dtstab, Fw, Fw1, Km, + & del(i,:), Sw, Sw1) + Fw = Sw + Fw1 = Sw1 + enddo + + ed_dudt(i,:) = Sw + ed_dvdt(i,:) = Sw1 + + Pt(1:levs) = t1(i,1:levs)*Ptmap(1:levs) + Kpt = Km*iPr_pt + Fw(1:levs) = pdTdt(i, 1:levs)*Ptmap(1:levs) + do j=1, nstab + call diff_1d_ptend(levs, dtstab, Fw, Kpt, del(i,:), Sw) + Fw = Sw + enddo + ed_dtdt(i,1:levs) = Sw(1:levs)/Ptmap(1:levs) + + enddo + + end subroutine edmix_ugwp_v0 + + subroutine diff_1d_wtend(levs, dt, F, F1, Km, rdp, rdpm, S, S1) + use machine, only: kind_phys + implicit none + integer :: levs + real(kind=kind_phys) :: dt + real(kind=kind_phys) :: S(levs), S1(levs), F(levs), F1(levs) + real(kind=kind_phys) :: Km(levs), rdp(levs), rdpm(levs-1) + integer :: i, k + real(kind=kind_phys) :: Km1, Kp1, ad, cd, bd +! S(:) = 0.0 ; S1(:) = 0.0 +! +! explicit diffusion solver +! + k = 1 + km1 = 0. ; ad =0. + kp1 = .5*(Km(k)+Km(k+1)) + cd = rdp(1)*rdpm(1)*kp1*dt + bd = 1. - cd - ad +! S(k) = cd*F(k+1) + ad *F(k-1) + bd *F(k) + S(K) = F(k) + S1(K) = F1(k) + do k=2, levs-1 + ad = cd + kp1 = .5*(Km(k)+Km(k+1)) + cd = rdp(k)*rdpm(k)*kp1*dt + bd = 1.-(ad +cd) + S(k) = cd*F(k+1) + ad *F(k-1) + bd *F(k) + S1(k) = cd*F1(k+1) + ad *F1(k-1) + bd *F1(k) + enddo + k = levs + S(k) = F(k) + S1(k) = F1(k) + end subroutine diff_1d_wtend + + subroutine diff_1d_ptend(levs, dt, F, Km, rdp, rdpm, S) + use machine, only: kind_phys + implicit none + integer :: levs + real(kind=kind_phys) :: dt + real(kind=kind_phys) :: S(levs), S1(levs), F(levs), F1(levs) + real(kind=kind_phys) :: Km(levs), rdp(levs), rdpm(levs-1) + integer :: i, k + real(kind=kind_phys) :: Km1, Kp1, ad, cd, bd +! +! explicit "eddy" smoother for tendencies +! + + k = 1 + km1 = 0. ; ad =0. + kp1 = .5*(Km(k)+Km(k+1)) + cd = rdp(1)*rdpm(1)*kp1*dt + bd = 1. -(cd +ad) +! S(k) = cd*F(k+1) + ad *F(k-1) + bd *F(k) + S(K) = F(k) + do k=2, levs-1 + ad = cd + kp1 = .5*(Km(k)+Km(k+1)) + cd = rdp(k)*rdpm(k)*kp1*dt + bd = 1.-(ad +cd) + S(k) = cd*F(k+1) + ad *F(k-1) + bd *F(k) + enddo + k =levs + S(k) = F(k) + end subroutine diff_1d_ptend From f76289ea50facf218cc913b5ac04906f2cc6b1ab Mon Sep 17 00:00:00 2001 From: "Linlin.Pan" Date: Mon, 19 Aug 2019 22:06:45 +0000 Subject: [PATCH 60/89] adding coupling option to CCPP --- physics/GFS_PBL_generic.F90 | 13 +++++++++---- physics/GFS_suite_interstitial.F90 | 2 +- physics/GFS_surface_generic.F90 | 26 ++++++++++++++++---------- physics/sfc_sice.f | 4 ++++ 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index 2b230d952..93ce62deb 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -302,10 +302,10 @@ end subroutine GFS_PBL_generic_post_finalize !! | ushfsfci | instantaneous_upward_sensible_heat_flux | instantaneous upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | !! | oceanfrac | sea_area_fraction | fraction of horizontal grid area occupied by ocean | frac | 1 | real | kind_phys | in | F | !! | fice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | -!! | dusfc_cice | surface_x_momentum_flux_for_coupling_cice | sfc x momentum flux for cice | Pa | 1 | real | kind_phys | in | F | -!! | dvsfc_cice | surface_y_momentum_flux_for_coupling_cice | sfc y momentum flux for cice | Pa | 1 | real | kind_phys | in | F | -!! | dtsfc_cice | surface_upward_sensible_heat_flux_for_coupling_cice | sfc sensible heat flux for cice | W m-2 | 1 | real | kind_phys | in | F | -!! | dqsfc_cice | surface_upward_latent_heat_flux_for_coupling_cice | sfc latent heat flux for cice | W m-2 | 1 | real | kind_phys | in | F | +!! | dusfc_cice | surface_x_momentum_flux_for_coupling_interstitial | sfc x momentum flux for coupling interstitial | Pa | 1 | real | kind_phys | in | F | +!! | dvsfc_cice | surface_y_momentum_flux_for_coupling_interstitial | sfc y momentum flux for coupling interstitial | Pa | 1 | real | kind_phys | in | F | +!! | dtsfc_cice | surface_upward_sensible_heat_flux_for_coupling_interstitial | sfc sensible heat flux for coupling interstitial | W m-2 | 1 | real | kind_phys | in | F | +!! | dqsfc_cice | surface_upward_latent_heat_flux_for_coupling_interstitial | sfc latent heat flux for coupling interstitial | W m-2 | 1 | real | kind_phys | in | F | !! | dry | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | !! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | !! | wind | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | @@ -496,6 +496,11 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, !! Coupling%dkt (:,:) = dkt (:,:) endif + if(cplflx)then + write(*,*)'Fatal error: CCPP is not ready for cplflx=true!!' + stop + endif + ! --- ... coupling insertion ! ### GJF ### the following section needs to be made CCPP-compliant when cplflx = T diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index ab294958f..0ba7f8c82 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -204,7 +204,7 @@ end subroutine GFS_suite_interstitial_2_finalize !! | adjsfcdsw | surface_downwelling_shortwave_flux | surface downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | !! | adjsfcdlw | surface_downwelling_longwave_flux | surface downwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | !! | pgr | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | ulwsfc_cice | surface_upwelling_longwave_flux_for_cice | surface upwelling longwave flux for cice | W m-2 | 1 | real | kind_phys | in | F | +!! | ulwsfc_cice | surface_upwelling_longwave_flux_for_coupling | surface upwelling longwave flux for coupling | W m-2 | 1 | real | kind_phys | in | F | !! | lwhd | tendency_of_air_temperature_due_to_longwave_heating_for_idea | idea sky lw heating rates | K s-1 | 3 | real | kind_phys | in | F | !! | htrsw | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep | total sky sw heating rate | K s-1 | 2 | real | kind_phys | in | F | !! | htrlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep | total sky lw heating rate | K s-1 | 2 | real | kind_phys | in | F | diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index e40ac44b4..522da3631 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -66,16 +66,16 @@ end subroutine GFS_surface_generic_pre_finalize !! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | inout | F | !! | islmsk_cice | sea_land_ice_mask_cice | sea/land/ice mask cice (=0/1/2) | flag | 1 | integer | | in | F | !! | slimskin_cpl | sea_land_ice_mask_in | sea/land/ice mask input (=0/1/2) | flag | 1 | real | kind_phys | in | F | -!! | dusfcin_cpl | surface_x_momentum_flux_for_coupling_in | sfc x momentum flux for coupling in | Pa | 1 | real | kind_phys | in | F | -!! | dvsfcin_cpl | surface_y_momentum_flux_for_coupling_in | sfc y momentum flux for coupling in | Pa | 1 | real | kind_phys | in | F | -!! | dtsfcin_cpl | surface_upward_sensible_heat_flux_for_coupling_in | sfc sensible heat flux input | W m-2 | 1 | real | kind_phys | in | F | -!! | dqsfcin_cpl | surface_upward_latent_heat_flux_for_coupling_in | sfc latent heat flux input for coupling in | W m-2 | 1 | real | kind_phys | in | F | -!! | ulwsfcin_cpl | surface_upwelling_longwave_flux_for_coupling_in | surface upwelling LW flux for coupling in | W m-2 | 1 | real | kind_phys | in | F | -!! | ulwsfc_cice | surface_upwelling_longwave_flux_for_cice | surface upwelling longwave flux for cice | W m-2 | 1 | real | kind_phys | out | F | -!! | dusfc_cice | surface_x_momentum_flux_for_coupling_cice | sfc x momentum flux for cice | Pa | 1 | real | kind_phys | out | F | -!! | dvsfc_cice | surface_y_momentum_flux_for_coupling_cice | sfc y momentum flux for cice | Pa | 1 | real | kind_phys | out | F | -!! | dtsfc_cice | surface_upward_sensible_heat_flux_for_coupling_cice | sfc sensible heat flux for cice | W m-2 | 1 | real | kind_phys | out | F | -!! | dqsfc_cice | surface_upward_latent_heat_flux_for_coupling_cice | sfc latent heat flux for cice | W m-2 | 1 | real | kind_phys | out | F | +!! | dusfcin_cpl | surface_x_momentum_flux_for_coupling | sfc x momentum flux for coupling | Pa | 1 | real | kind_phys | in | F | +!! | dvsfcin_cpl | surface_y_momentum_flux_for_coupling | sfc y momentum flux for coupling | Pa | 1 | real | kind_phys | in | F | +!! | dtsfcin_cpl | surface_upward_sensible_heat_flux_for_coupling | sfc sensible heat flux input | W m-2 | 1 | real | kind_phys | in | F | +!! | dqsfcin_cpl | surface_upward_latent_heat_flux_for_coupling | sfc latent heat flux input for coupling | W m-2 | 1 | real | kind_phys | in | F | +!! | ulwsfcin_cpl | surface_upwelling_longwave_flux_for_coupling | surface upwelling LW flux for coupling | W m-2 | 1 | real | kind_phys | in | F | +!! | ulwsfc_cice | surface_upwelling_longwave_flux_for_coupling_interstitial | surface upwelling longwave flux for coupling interstitial | W m-2 | 1 | real | kind_phys | out | F | +!! | dusfc_cice | surface_x_momentum_flux_for_coupling_interstitial | sfc x momentum flux for coupling interstitial | Pa | 1 | real | kind_phys | out | F | +!! | dvsfc_cice | surface_y_momentum_flux_for_coupling_interstitial | sfc y momentum flux for coupling interstitial | Pa | 1 | real | kind_phys | out | F | +!! | dtsfc_cice | surface_upward_sensible_heat_flux_for_coupling_interstitial | sfc sensible heat flux for coupling interstitial | W m-2 | 1 | real | kind_phys | out | F | +!! | dqsfc_cice | surface_upward_latent_heat_flux_for_coupling_interstitial | sfc latent heat flux for coupling interstitial | W m-2 | 1 | real | kind_phys | out | F | !! | tisfc | sea_ice_temperature | sea-ice surface temperature | K | 1 | real | kind_phys | in | F | !! | tsfco | sea_surface_temperature | sea surface temperature | K | 1 | real | kind_phys | in | F | !! | fice | sea_ice_concentration | sea-ice concentration [0,1] | frac | 1 | real | kind_phys | in | F | @@ -251,6 +251,12 @@ subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, tsurf(i) = tsfc(i) zlvl(i) = phil(i,1) * onebg end do + + if(cplflx)then + write(*,*)'Fatal error: CCPP is not ready for cplflx=true!!' + stop + endif + if (cplflx) then do i=1,im islmsk_cice(i) = int(slimskin_cpl(i)+0.5) diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index 96c641ac3..900a23f3c 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -265,6 +265,10 @@ subroutine sfc_sice_run & do i = 1, im islmsk_LOCAL(i) = islimsk(i) enddo + if(cplflx)then + write(*,*)'Fatal error: CCPP is not ready for cplflx=true!!' + stop + endif if (cplflx) then do i=1,im From 2f013964b032fc0ba66efc6ca39b9308fcfc0f95 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Tue, 20 Aug 2019 13:48:17 -0600 Subject: [PATCH 61/89] change units of runoff fluxes to kg m-2 s-1 in the metadata (and in the code for RUC LSM); change units of soil moisture content and runoff variables to kg m-2 (CCPP metadata had been in error and they only were in kg m-2 after a conversion in GFS_diagnostics.F90); should be merged with removal of conversion factor in GFS_diagnostics.F90 in FV3 repo --- physics/GFS_surface_generic.F90 | 13 ++++++------- physics/sfc_drv.f | 10 +++++----- physics/sfc_drv_ruc.F90 | 18 +++++++++--------- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index 5504eb7cd..62214438c 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -272,7 +272,7 @@ end subroutine GFS_surface_generic_post_finalize !! | xcosz | instantaneous_cosine_of_zenith_angle | cosine of zenith angle at current time | none | 1 | real | kind_phys | in | F | !! | evbs | soil_upward_latent_heat_flux | soil upward latent heat flux | W m-2 | 1 | real | kind_phys | in | F | !! | evcw | canopy_upward_latent_heat_flux | canopy upward latent heat flux | W m-2 | 1 | real | kind_phys | in | F | -!! | trans | transpiration_flux | total plant transpiration rate | kg m-2 s-1 | 1 | real | kind_phys | in | F | +!! | trans | transpiration_flux | total plant transpiration rate | W m-2 | 1 | real | kind_phys | in | F | !! | sbsno | snow_deposition_sublimation_upward_latent_heat_flux | latent heat flux from snow depo/subl | W m-2 | 1 | real | kind_phys | in | F | !! | snowc | surface_snow_area_fraction | surface snow area fraction | frac | 1 | real | kind_phys | in | F | !! | snohf | snow_freezing_rain_upward_latent_heat_flux | latent heat flux due to snow and frz rain | W m-2 | 1 | real | kind_phys | in | F | @@ -322,8 +322,8 @@ end subroutine GFS_surface_generic_post_finalize !! | ep | cumulative_surface_upward_potential_latent_heat_flux_multiplied_by_timestep | cumulative surface upward potential latent heat flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | !! | runoff | total_runoff | total water runoff | kg m-2 | 1 | real | kind_phys | inout | F | !! | srunoff | surface_runoff | surface water runoff (from lsm) | kg m-2 | 1 | real | kind_phys | inout | F | -!! | runof | surface_runoff_flux | surface runoff flux | g m-2 s-1 | 1 | real | kind_phys | in | F | -!! | drain | subsurface_runoff_flux | subsurface runoff flux | g m-2 s-1 | 1 | real | kind_phys | in | F | +!! | runof | surface_runoff_flux | surface runoff flux | kg m-2 s-1 | 1 | real | kind_phys | in | F | +!! | drain | subsurface_runoff_flux | subsurface runoff flux | kg m-2 s-1 | 1 | real | kind_phys | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! @@ -365,7 +365,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, icy, wet, dt real(kind=kind_phys), parameter :: albdf = 0.06d0 integer :: i - real(kind=kind_phys) :: tem, xcosz_loc, ocalnirdf_cpl, ocalnirbm_cpl, ocalvisdf_cpl, ocalvisbm_cpl + real(kind=kind_phys) :: xcosz_loc, ocalnirdf_cpl, ocalnirbm_cpl, ocalvisdf_cpl, ocalvisbm_cpl ! Initialize CCPP error handling variables errmsg = '' @@ -459,10 +459,9 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, icy, wet, dt ! --- ... total runoff is composed of drainage into water table and ! runoff at the surface and is accumulated in unit of meters if (lssav) then - tem = dtf * 0.001 do i=1,im - runoff(i) = runoff(i) + (drain(i)+runof(i)) * tem - srunoff(i) = srunoff(i) + runof(i) * tem + runoff(i) = runoff(i) + (drain(i)+runof(i)) * dtf + srunoff(i) = srunoff(i) + runof(i) * dtf enddo endif diff --git a/physics/sfc_drv.f b/physics/sfc_drv.f index ffe47ee17..d521be250 100644 --- a/physics/sfc_drv.f +++ b/physics/sfc_drv.f @@ -231,17 +231,17 @@ end subroutine lsm_noah_finalize !! | stc | soil_temperature | soil temperature | K | 2 | real | kind_phys | inout | F | !! | slc | volume_fraction_of_unfrozen_soil_moisture | volume fraction of unfrozen soil moisture | frac | 2 | real | kind_phys | inout | F | !! | canopy | canopy_water_amount | canopy moisture content | kg m-2 | 1 | real | kind_phys | inout | F | -!! | trans | transpiration_flux | total plant transpiration rate | kg m-2 s-1 | 1 | real | kind_phys | inout | F | +!! | trans | transpiration_flux | total plant transpiration rate | W m-2 | 1 | real | kind_phys | inout | F | !! | tsurf | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | inout | F | !! | zorl | surface_roughness_length_over_land_interstitial | surface roughness length over land (temporary use as interstitial) | cm | 1 | real | kind_phys | inout | F | !! | sncovr1 | surface_snow_area_fraction_over_land | surface snow area fraction | frac | 1 | real | kind_phys | inout | F | !! | qsurf | surface_specific_humidity_over_land | surface air saturation specific humidity over land | kg kg-1 | 1 | real | kind_phys | inout | F | !! | gflux | upward_heat_flux_in_soil_over_land | soil heat flux over land | W m-2 | 1 | real | kind_phys | inout | F | -!! | drain | subsurface_runoff_flux | subsurface runoff flux | g m-2 s-1 | 1 | real | kind_phys | inout | F | +!! | drain | subsurface_runoff_flux | subsurface runoff flux | kg m-2 s-1 | 1 | real | kind_phys | inout | F | !! | evap | kinematic_surface_upward_latent_heat_flux_over_land | kinematic surface upward latent heat flux over land | kg kg-1 m s-1 | 1 | real | kind_phys | inout | F | !! | hflx | kinematic_surface_upward_sensible_heat_flux_over_land | kinematic surface upward sensible heat flux over land | K m s-1 | 1 | real | kind_phys | inout | F | !! | ep | surface_upward_potential_latent_heat_flux_over_land | surface upward potential latent heat flux over land | W m-2 | 1 | real | kind_phys | inout | F | -!! | runoff | surface_runoff_flux | surface runoff flux | g m-2 s-1 | 1 | real | kind_phys | inout | F | +!! | runoff | surface_runoff_flux | surface runoff flux | kg m-2 s-1 | 1 | real | kind_phys | inout | F | !! | cmm | surface_drag_wind_speed_for_momentum_in_air_over_land | momentum exchange coefficient over land | m s-1 | 1 | real | kind_phys | inout | F | !! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land | thermal exchange coefficient over land | kg m-2 s-1 | 1 | real | kind_phys | inout | F | !! | evbs | soil_upward_latent_heat_flux | soil upward latent heat flux | W m-2 | 1 | real | kind_phys | inout | F | @@ -614,7 +614,7 @@ subroutine lsm_noah_run & trans(i) = ett sbsno(i) = esnow snowc(i) = sncovr - stm(i) = soilm + stm(i) = soilm * 1000.0 ! unit conversion (from m to kg m-2) snohf(i) = flx1 + flx2 + flx3 smcwlt2(i) = smcwlt @@ -630,7 +630,7 @@ subroutine lsm_noah_run & enddo wet1(i) = smsoil(1) / smcmax !Sarah Lu added 09/09/2010 (for GOCART) -! --- ... unit conversion (from m s-1 to mm s-1) +! --- ... unit conversion (from m s-1 to mm s-1 and kg m-2 s-1) runoff(i) = runoff1 * 1000.0 drain (i) = runoff2 * 1000.0 diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index 8316aba4d..ddf03e248 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -236,9 +236,9 @@ end subroutine lsm_ruc_finalize !! | evbs | soil_upward_latent_heat_flux | soil upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | !! | evcw | canopy_upward_latent_heat_flux | canopy upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | !! | sbsno | snow_deposition_sublimation_upward_latent_heat_flux | latent heat flux from snow depo/subl | W m-2 | 1 | real | kind_phys | out | F | -!! | trans | transpiration_flux | total plant transpiration rate | kg m-2 s-1 | 1 | real | kind_phys | out | F | -!! | runof | surface_runoff_flux | surface runoff flux | g m-2 s-1 | 1 | real | kind_phys | out | F | -!! | drain | subsurface_runoff_flux | subsurface runoff flux | g m-2 s-1 | 1 | real | kind_phys | out | F | +!! | trans | transpiration_flux | total plant transpiration rate | W m-2 | 1 | real | kind_phys | out | F | +!! | runof | surface_runoff_flux | surface runoff flux | kg m-2 s-1 | 1 | real | kind_phys | out | F | +!! | drain | subsurface_runoff_flux | subsurface runoff flux | kg m-2 s-1 | 1 | real | kind_phys | out | F | !! | runoff | total_runoff | total water runoff | kg m-2 | 1 | real | kind_phys | inout | F | !! | srunoff | surface_runoff | surface water runoff (from lsm) | kg m-2 | 1 | real | kind_phys | inout | F | !! | gflux | upward_heat_flux_in_soil_over_land | soil heat flux over land | W m-2 | 1 | real | kind_phys | out | F | @@ -1032,12 +1032,12 @@ subroutine lsm_ruc_run & ! inputs sfcdew(i) = dew(i,j) qsurf(i) = qsfc(i,j) sncovr1(i) = sncovr(i,j) - stm(i) = soilm(i,j) + stm(i) = soilm(i,j) * 1000.0 ! unit conversion (from m to kg m-2) tsurf(i) = soilt(i,j) tice(i) = tsurf(i) - ! --- ... units [m/s] = [g m-2 s-1] - runof (i) = runoff1(i,j) - drain (i) = runoff2(i,j) + + runof (i) = runoff1(i,j) * 1000.0 ! unit conversion (from m s-1 to mm s-1 and kg m-2 s-1) + drain (i) = runoff2(i,j) * 1000.0 ! unit conversion (from m s-1 to mm s-1 and kg m-2 s-1) wetness(i) = wet(i,j) @@ -1048,8 +1048,8 @@ subroutine lsm_ruc_run & ! inputs rhosnf(i) = rhosnfr(i,j) ! --- ... accumulated total runoff and surface runoff - runoff(i) = runoff(i) + (drain(i)+runof(i)) * delt * 0.001 ! kg m-2 - srunoff(i) = srunoff(i) + runof(i) * delt * 0.001 ! kg m-2 + runoff(i) = runoff(i) + (drain(i)+runof(i)) * delt ! kg m-2 + srunoff(i) = srunoff(i) + runof(i) * delt ! kg m-2 ! --- ... accumulated frozen precipitation (accumulation in lsmruc) snowfallac(i) = snfallac(i,j) ! kg m-2 From f9a7b4f2ed57e14050b43a728f25eada06c35a8a Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Tue, 20 Aug 2019 14:12:09 -0600 Subject: [PATCH 62/89] swap CCPP metadata for convective/non-convective precipitation such that it is consistent with the code in GFS_MP_generic_post_run --- physics/GFS_MP_generic.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index f8ad355d8..8d3074988 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -165,8 +165,8 @@ end subroutine GFS_MP_generic_post_init !! | dsnow_cpl | tendency_of_lwe_thickness_of_snow_amount_for_coupling | change in show_cpl (coupling_type) | m | 1 | real | kind_phys | inout | F | !! | lsm | flag_for_land_surface_scheme | flag for land surface model | flag | 0 | integer | | in | F | !! | lsm_ruc | flag_for_ruc_land_surface_scheme | flag for RUC land surface model | flag | 0 | integer | | in | F | -!! | raincprv | lwe_thickness_of_explicit_rainfall_amount_from_previous_timestep | explicit rainfall from previous timestep | m | 1 | real | kind_phys | inout | F | -!! | rainncprv | lwe_thickness_of_convective_precipitation_amount_from_previous_timestep | convective_precipitation_amount from previous timestep | m | 1 | real | kind_phys | inout | F | +!! | raincprv | lwe_thickness_of_convective_precipitation_amount_from_previous_timestep | convective_precipitation_amount from previous timestep | m | 1 | real | kind_phys | inout | F | +!! | rainncprv | lwe_thickness_of_explicit_rainfall_amount_from_previous_timestep | explicit rainfall from previous timestep | m | 1 | real | kind_phys | inout | F | !! | iceprv | lwe_thickness_of_ice_amount_from_previous_timestep | ice amount from previous timestep | m | 1 | real | kind_phys | inout | F | !! | snowprv | lwe_thickness_of_snow_amount_from_previous_timestep | snow amount from previous timestep | m | 1 | real | kind_phys | inout | F | !! | graupelprv | lwe_thickness_of_graupel_amount_from_previous_timestep | graupel amount from previous timestep | m | 1 | real | kind_phys | inout | F | From a82db03d3072050ba232c5853fd815b7eca45b59 Mon Sep 17 00:00:00 2001 From: "Linlin.Pan" Date: Thu, 22 Aug 2019 19:02:26 +0000 Subject: [PATCH 63/89] adding coupling option in ccpp modified according to Dom's comments passed regression test. --- physics/GFS_PBL_generic.F90 | 3 +-- physics/sfc_cice.f | 38 ++++--------------------------------- physics/sfc_sice.f | 22 +++++++++------------ 3 files changed, 14 insertions(+), 49 deletions(-) diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index 93ce62deb..3c755705e 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -485,8 +485,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, endif endif ! nvdiff == ntrac - write(*,*)rd,cp,hvap,fvirt -!! new adding + if (cplchm) then do i = 1, im tem1 = max(q1(i), 1.e-8) diff --git a/physics/sfc_cice.f b/physics/sfc_cice.f index d7b84f800..d5a18c94c 100644 --- a/physics/sfc_cice.f +++ b/physics/sfc_cice.f @@ -1,40 +1,10 @@ !> \file sfc_cice.f !! This file contains the sfc_sice for coupling to CICE -!> This module comtains the CCPP-compliant GFS sea ice post interstitial codes, which returns -!! updated ice thickness and concentration to global arrays -!! where there is no ice, and set temperature to surface skin -!!temperature. - module sfc_cice_pre - - contains -!! \section arg_table_sfc_cice_post_init Argument Table -!! - subroutine sfc_cice_pre_init - end subroutine sfc_cice_pre_init - - subroutine sfc_cice_pre_finalize - end subroutine sfc_cice_pre_finalize - - end module sfc_cice_pre -!! - module sfc_cice_post - - contains -!! \section arg_table_sfc_cice_post_init Argument Table -!! - subroutine sfc_cice_post_init - end subroutine sfc_cice_post_init - -!! \section arg_table_sfc_cice_post_finalize Argument Table -!! - subroutine sfc_cice_post_finalize - end subroutine sfc_cice_post_finalize - - subroutine sfc_cice_post_run - end subroutine sfc_cice_post_run - - end module sfc_cice_post +!> This module contains the CCPP-compliant GFS sea ice post +!! interstitial codes, which returns updated ice thickness and +!! concentration to global arrays where there is no ice, and +!! set temperature to surface skin temperature. !> This module contains the CCPP-compliant GFS sea ice scheme. module sfc_cice diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index 900a23f3c..8e4881990 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -248,7 +248,7 @@ subroutine sfc_sice_run & real (kind=kind_phys) :: cpinv, hvapi, elocp integer :: i, k - integer, dimension(im) :: islmsk_LOCAL + integer, dimension(im) :: islmsk_local logical :: flag(im) ! @@ -262,24 +262,20 @@ subroutine sfc_sice_run & errmsg = '' errflg = 0 - do i = 1, im - islmsk_LOCAL(i) = islimsk(i) - enddo if(cplflx)then write(*,*)'Fatal error: CCPP is not ready for cplflx=true!!' stop endif - if (cplflx) then - do i=1,im - if (flag_cice(i)) then - islmsk_LOCAL (i) = islmsk_cice(i) + do i = 1, im + islmsk_local(i) = islimsk(i) + if (flag_cice(i).and.cplflx) then + islmsk_local (i) = islmsk_cice(i) endif - enddo - endif + enddo do i = 1, im - islimsk(i)=islmsk_LOCAL(i) + islimsk(i)=islmsk_local(i) enddo if (cplflx .or. cplchm) then @@ -294,8 +290,8 @@ subroutine sfc_sice_run & !> - Set flag for sea-ice. do i = 1, im - flag(i) = (islmsk_LOCAL(i) == 2) .and. flag_iter(i) - if (flag_iter(i) .and. islmsk_LOCAL(i) < 2) then + flag(i) = (islmsk_local(i) == 2) .and. flag_iter(i) + if (flag_iter(i) .and. islmsk_local(i) < 2) then hice(i) = zero fice(i) = zero endif From 4cf8be7407fc798bbf1b263c53f0026e5f60d68f Mon Sep 17 00:00:00 2001 From: climbfuji Date: Fri, 23 Aug 2019 08:55:16 -0600 Subject: [PATCH 64/89] physics/GFS_GWD_generic.F90: remove unneeded duplicate code, formatting changes --- physics/GFS_GWD_generic.F90 | 1450 +---------------------------------- 1 file changed, 12 insertions(+), 1438 deletions(-) diff --git a/physics/GFS_GWD_generic.F90 b/physics/GFS_GWD_generic.F90 index 94e7c6ffc..94a74b75a 100644 --- a/physics/GFS_GWD_generic.F90 +++ b/physics/GFS_GWD_generic.F90 @@ -1,12 +1,10 @@ !> \file GFS_GWD_generic.f -!! This file is the parameterization of orographic gravity wave -!! drag and mountain blocking. - -!> This module contains the CCPP-compliant orographic gravity wave +!! This file contains the CCPP-compliant orographic gravity wave !! drag pre interstitial codes. - module GFS_GWD_generic_pre - contains +module GFS_GWD_generic_pre + +contains !> \section arg_table_GFS_GWD_generic_pre_init Argument Table !! @@ -53,7 +51,7 @@ subroutine GFS_GWD_generic_pre_run( & real(kind=kind_phys), intent(out) :: & & hprime(im), oc(im), oa4(im,4), clx(im,4), & - & theta(im), sigma(im), gamma(im), elvmax(im) + & theta(im), sigma(im), gamma(im), elvmax(im) logical, intent(in) :: lssav, ldiag3d real(kind=kind_phys), intent(in) :: dtdt(im,levs) @@ -109,12 +107,12 @@ subroutine GFS_GWD_generic_pre_run( & clx(:,4) = 0.0 else hprime = 0 - oc = 0 - oa4 = 0 - clx = 0 - theta = 0 - gamma = 0 - sigma = 0 + oc = 0 + oa4 = 0 + clx = 0 + theta = 0 + gamma = 0 + sigma = 0 elvmax = 0 endif ! end if_nmtvr @@ -139,1428 +137,4 @@ end subroutine GFS_GWD_generic_pre_run subroutine GFS_GWD_generic_pre_finalize() end subroutine GFS_GWD_generic_pre_finalize - end module GFS_GWD_generic_pre - -!> This module contains the CCPP-compliant orographic gravity wave dray scheme. - module GFS_GWD_generic - - contains - -!> \section arg_table_GFS_GWD_generic_init Argument Table -!! - subroutine GFS_GWD_generic_init() - end subroutine GFS_GWD_generic_init - -!> \defgroup gfs_GFS_GWD_generic GFS Orographic Gravity Wave Drag and Mountain Blocking Scheme Module -!! \brief This subroutine includes orographic gravity wave drag and mountain -!! blocking. -!! -!> The time tendencies of zonal and meridional wind are altered to -!! include the effect of mountain induced gravity wave drag from -!! subgrid scale orography including convective breaking, shear -!! breaking and the presence of critical levels. -!! -!! \section arg_table_GFS_GWD_generic_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | km | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | -!! | A | tendency_of_y_wind_due_to_model_physics | meridional wind tendency due to model physics | m s-2 | 2 | real | kind_phys | inout | F | -!! | B | tendency_of_x_wind_due_to_model_physics | zonal wind tendency due to model physics | m s-2 | 2 | real | kind_phys | inout | F | -!! | C | tendency_of_air_temperature_due_to_model_physics | air temperature tendency due to model physics | K s-1 | 2 | real | kind_phys | inout | F | -!! | u1 | x_wind | zonal wind | m s-1 | 2 | real | kind_phys | in | F | -!! | v1 | y_wind | meridional wind | m s-1 | 2 | real | kind_phys | in | F | -!! | t1 | air_temperature | mid-layer temperature | K | 2 | real | kind_phys | in | F | -!! | q1 | water_vapor_specific_humidity | mid-layer specific humidity of water vapor | kg kg-1 | 2 | real | kind_phys | in | F | -!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | vertical index at top atmospheric boundary layer | index | 1 | integer | | in | F | -!! | prsi | air_pressure_at_interface | interface pressure | Pa | 2 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | difference between mid-layer pressures | Pa | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mid-layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | prslk | dimensionless_exner_function_at_model_layers | mid-layer Exner function | none | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | interface geopotential | m2 s-2 | 2 | real | kind_phys | in | F | -!! | phil | geopotential | mid-layer geopotential | m2 s-2 | 2 | real | kind_phys | in | F | -!! | deltim | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | kdt | index_of_time_step | current time step index | index | 0 | integer | | in | F | -!! | hprime | standard_deviation_of_subgrid_orography | standard deviation of subgrid orography | m | 1 | real | kind_phys | in | F | -!! | oc | convexity_of_subgrid_orography | convexity of subgrid orography | none | 1 | real | kind_phys | in | F | -!! | oa4 | asymmetry_of_subgrid_orography | asymmetry of subgrid orography | none | 2 | real | kind_phys | in | F | -!! | clx4 | fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height | horizontal fraction of grid box covered by subgrid orography higher than critical height | frac | 2 | real | kind_phys | in | F | -!! | theta | angle_from_east_of_maximum_subgrid_orographic_variations | angle with respect to east of maximum subgrid orographic variations | degrees | 1 | real | kind_phys | in | F | -!! | sigma | slope_of_subgrid_orography | slope of subgrid orography | none | 1 | real | kind_phys | in | F | -!! | gamma | anisotropy_of_subgrid_orography | anisotropy of subgrid orography | none | 1 | real | kind_phys | in | F | -!! | elvmax | maximum_subgrid_orography | maximum of subgrid orography | m | 1 | real | kind_phys | inout | F | -!! | dusfc | instantaneous_x_stress_due_to_gravity_wave_drag | zonal surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | out | F | -!! | dvsfc | instantaneous_y_stress_due_to_gravity_wave_drag | meridional surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | out | F | -!! | g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | imx | number_of_equatorial_longitude_points | number of longitude points along the equator | count | 0 | integer | | in | F | -!! | nmtvr | number_of_statistical_measures_of_subgrid_orography | number of statistical measures of subgrid orography | count | 0 | integer | | in | F | -!! | cdmbgwd | multiplication_factors_for_mountain_blocking_and_orographic_gravity_wave_drag | multiplic. factors for (1) mountain blocking drag coeff. and (2) ref. level orographic gravity wave drag | none | 1 | real | kind_phys | in | F | -!! | me | mpi_rank | rank of the current MPI task | index | 0 | integer | | in | F | -!! | lprnt | flag_print | flag for debugging printouts | flag | 0 | logical | | in | F | -!! | ipr | horizontal_index_of_printed_column | horizontal index of column used in debugging printouts | index | 0 | integer | | in | F | -!! | rdxzb | level_of_dividing_streamline | level of the dividing streamline | none | 1 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! -!> \section gen_GFS_GWD_generic GFS Orographic GWD Scheme General Algorithm -!! -# Calculate subgrid mountain blocking -!! -# Calculate orographic wave drag -!! -!! The NWP model gravity wave drag (GWD) scheme in the GFS has two -!! main components: how the surface stress is computed, and then how -!! that stress is distributed over a vertical column where it may -!! interact with the models momentum. Each of these depends on the -!! large scale environmental atmospheric state and assumptions about -!! the sub-grid scale processes. In Alpert GWD (1987) based on linear, -!! two-dimensional non-rotating, stably stratified flow over a mountain ridge, -!! sub-grid scale gravity wave motions are assumed which propagate away -!! from the mountain. Described in Alpert (1987), the flux measured over -!! a "low level" vertically averaged layer, in the atmosphere defines a base -!! level flux. "Low level" was taken to be the first 1/3 of the troposphere -!! in the 1987 implementation. This choice was meant to encompass a thick -!! low layer for vertical averages of the environmental (large scale) flow -!! quantities. The vertical momentum flux or gravity wave stress in a -!! grid box due to a single mountain is given as in Pierrehumbert(1986) -!! \cite pierrehumbert_1986 : -!! \f[ -!! \tau = \frac {\rho \: U^{3}\: G(F_{r})} {\Delta X \; N } -!! \f] -!! where \f$ \Delta X \f$ is a grid increment, N is the Brunt Viasala frequency -!! \f[ -!! N(\sigma) = \frac{-g \: \sigma \: -!! \frac{\partial\Theta}{\partial\sigma}}{\Theta \:R \:T} -!! \f] -!! The environmental variables are calculated from a mass weighted vertical -!! average over a base layer. \f$G(F_{r})\f$ is a monotonically increasing -!! function of Froude number : -!! \f[ -!! F_{r} = \frac{N h^{'}}{U} -!! \f] -!! where \f$U\f$ is the wind speed calculated as a mass weighted vertical average in -!! the base layer, and \f$h^{'}\f$, is the vertical displacement caused by the orography -!! variance. An effective mountain length for the gravity wave processes: -!! \f[ -!! l^{*} = \frac{\Delta X}{m} -!! \f] -!! where \f$m\f$ is the number of mountains in a grid box, can then -!! be defined to obtain the form of the base level stress -!! \f[ -!! \tau = \frac {\rho \: U^{3} \: G(F_{r})} {N \;l^{*}} -!! \f] -!! giving the stress induced from the surface in a model grid box. -!! Pierrehumbert(1986) \cite pierrehumbert_1986 gives the form -!! for the function \f$G(F_{r})\f$ as -!! \f[ -!! G(F_{r}) = \bar{G}\frac{F^{2}_{r}}{F^{2}_{r}\: + \:a^{2}} -!! \f] -!! Where \f$ \bar{G} \f$ is an order unity non-dimensional saturation -!! flux set to 1 and \f$a\f$ is a function of the mountain aspect ratio also -!!set to 1 in the 1987 implementation of the GFS GWD. Typical values of -!! U=10m/s, N=0.01 1/s, l*=100km, and a=1, gives a flux of 1 Pascal and -!! if this flux is made to go to zero linearly with height then the -!! decelerations would be about 10/m/s/day which is consistent with -!! observations in PH. -!! -!! In Kim, Moorthi, Alpert's (1998, 2001) GWD currently in GFS operations, -!! the GWD scheme has the same physical basis as in Alpert (1987) with the addition -!! of enhancement factors for the amplitude, G, and mountain shape details -!! in G(Fr) to account for effects from the mountain blocking. A factor, -!! E m’, is an enhancement factor on the stress in the Alpert '87 scheme. -!! The E ranges from no enhancement to an upper limit of 3, E=E(OA)[1-3], -!! and is a function of OA, the Orographic Asymmetry defined in Kim and Arakawa (1995) -!! \cite kim_and_arakawa_1995 as -!! Orographic Asymmetry (OA): -!! \f[ -!! OA=\frac{ \bar{x} \; - \; -!! \sum\limits_{j=1}^{N_{b}} x_{j} \; n_{j} }{\sigma_{x}} -!! \f] -!! where \f$N_{b}\f$ is the total number of bottom blocks in the mountain barrier, -!! \f$ \sigma_{x} \f$ is the standard deviation of the horizontal distance defined by -!!\f[ -!! \sigma_{x} = \sqrt{ \frac{\sum\limits_{j=1}^{N_{b}} -!! \; (x_{j} \; - \; \bar{x} )^2}{N_{x}} } -!!\f] -!! where \f$N_{x}\f$ is the number of grid intervals for the large scale domain being -!! considered. So the term, E(OA)m’/ \f$ \Delta X \f$ in Kim's scheme represents -!! a multiplier on G shown in Alpert's eq (1), where m’ is the number of mountains -!! in a sub-grid scale box. Kim increased the complexity of m’ making it a -!! function of the fractional area of the sub-grid mountain and the asymmetry -!! and convexity statistics which are found from running a gravity wave -!! model for a large number of cases: -!! \f[ -!! m^{'} = C_{m} \Delta X \left[ \frac{1 \; + \; -!! \sum\limits_{x} L_{h} }{\Delta X} \right]^{OA+1} -!! \f] -!! Where, according to Kim, \f$ \sum \frac{L_{h}}{\Delta X} \f$ is -!! the fractional area covered by the subgrid-scale orography higher than -!! a critical height \f$ h_{c} = Fr_{c} U_{0}/N_{0} \f$ , over the -!! "low level" vertically averaged layer, for a grid box with the interval -!! \f$ \Delta X \f$. Each \f$ L_{n}\f$ is the width of a segment of -!! orography intersection at the critical height: -!! \f[ -!! Fr_{0} = \frac{N_{0} \; h^{'}}{U_{0}} -!! \f] -!! \f[ -!! G^{'}(OC,Fr_{0}) = \frac{Fr_{0}^{2}}{Fr_{0}^{2} \; + \; a^{2}} -!! \f] -!! \f[ -!! a^{2} = \frac{C_{G}}{OC} -!! \f] -!! \f[ -!! E(OA, Fr_{0}) = (OA \; + \; 2)^{\delta} -!! \f] -!! and -!! \f[ -!! \delta \; = \; \frac{C_{E} \; Fr_{0}}{Fr_{c}} -!! \f] -!! where \f$ Fr_{c} \f$ is as in Alpert. -!! -!! This represents a closed scheme, somewhat empirical adjustments -!! to the original scheme to calculate the surface stress. -!! -!! Momentum is deposited by the sub-grid scale gravity waves break due -!! to the presence of convective mixing assumed to occur when the -!! minimum Richardson number: -!! -!! Orographic Convexity (OC) = -!! \f[ -!! OC=\frac{ \sum\limits_{j=1}^{N_{x}} -!! \; (h_{j} \; - \; \bar{h})^4 }{N_{x} \;\sigma_{h}^4} -!! \f] -!! and where -!! \f[ -!! \sigma_{h} = \sqrt{ \frac{\sum\limits_{j=1}^{N_{x}} -!! \; (h_{j} \; - \; \bar{h} )^2}{N_{x}} } -!! \f] -!! This represents a closed scheme, somewhat empirical adjustments -!! to the original scheme to calculate the surface stress. -!! -!! Momentum is deposited by the sub-grid scale gravity waves break due -!! to the presence of convective mixing assumed to occur when -!! the minimum Richardson number: -!! \f[ -!! Ri_{m} = \frac{Ri(1 \; - \; Fr)}{(1 \; + \; \sqrt{Ri}Fr)^2} -!! \f] -!! Is less than 1/4 Or if critical layers are encountered in a layer -!! the the momentum flux will vanish. The critical layer is defined -!! when the base layer wind becomes perpendicular to the environmental -!! wind. Otherwise, wave breaking occurs at a level where the amplification -!! of the wave causes the local Froude number or similarly a truncated -!! (first term of the) Scorer parameter, to be reduced below a critical -!! value by the saturation hypothesis (Lindzen). This is done through -!! eq 1 which can be written as -!! \f[ -!! \tau = \rho U N k h^{'2} -!! \f] -!! For small Froude number this is discretized in the vertical so at each -!! level the stress is reduced by ratio of the Froude or truncated Scorer -!! parameter, \f$ \frac{U^{2}}{N^{2}} = \frac{N \tau_{l-1}}{\rho U^{3} k} \f$ , -!! where the stress is from the layer below beginning with that found near -!! the surface. The respective change in momentum is applied in -!! that layer building up from below. -!! -!! An amplitude factor is part of the calibration of this scheme which is -!! a function of the model resolution and the vertical diffusion. This -!! is because the vertical diffusion and the GWD account encompass -!! similar physical processes. Thus, one needs to run the model over -!! and over for various amplitude factors for GWD and vertical diffusion. -!! -!! In addition, there is also mountain blocking from lift and frictional -!! forces. Improved integration between how the GWD is calculated and -!! the mountain blocking of wind flow around sub-grid scale orography -!! is underway at NCEP. The GFS already has convectively forced GWD -!! an independent process. -!! -!> \section det_GFS_GWD_generic GFS Orographic GWD Scheme Detailed Algorithm -!> @{ - subroutine GFS_GWD_generic_run( & - & IM,IX,KM,A,B,C,U1,V1,T1,Q1,KPBL, & - & PRSI,DEL,PRSL,PRSLK,PHII, PHIL,DELTIM,KDT, & - & HPRIME,OC,OA4,CLX4,THETA,SIGMA,GAMMA,ELVMAX, & - & DUSFC,DVSFC,G, CP, RD, RV, IMX, & - & nmtvr, cdmbgwd, me, lprnt, ipr, rdxzb, errmsg, errflg) -! -! ******************************************************************** -! -----> I M P L E M E N T A T I O N V E R S I O N <---------- -! -! --- Not in this code -- History of GWDP at NCEP---- -! ---------------- ----------------------- -! VERSION 3 MODIFIED FOR GRAVITY WAVES, LOCATION: .FR30(V3GWD) *J* -!--- 3.1 INCLUDES VARIABLE SATURATION FLUX PROFILE CF ISIGST -!--- 3.G INCLUDES PS COMBINED W/ PH (GLAS AND GFDL) -!----- ALSO INCLUDED IS RI SMOOTH OVER A THICK LOWER LAYER -!----- ALSO INCLUDED IS DECREASE IN DE-ACC AT TOP BY 1/2 -!----- THE NMC GWD INCORPORATING BOTH GLAS(P&S) AND GFDL(MIGWD) -!----- MOUNTAIN INDUCED GRAVITY WAVE DRAG -!----- CODE FROM .FR30(V3MONNX) FOR MONIN3 -!----- THIS VERSION (06 MAR 1987) -!----- THIS VERSION (26 APR 1987) 3.G -!----- THIS VERSION (01 MAY 1987) 3.9 -!----- CHANGE TO FORTRAN 77 (FEB 1989) --- HANN-MING HENRY JUANG -!----- 20070601 ELVMAX bug fix (*j*) -! -! VERSION 4 -! ----- This code ----- -! -!----- MODIFIED TO IMPLEMENT THE ENHANCED LOW TROPOSPHERIC GRAVITY -!----- WAVE DRAG DEVELOPED BY KIM AND ARAKAWA(JAS, 1995). -! Orographic Std Dev (hprime), Convexity (OC), Asymmetry (OA4) -! and Lx (CLX4) are input topographic statistics needed. -! -!----- PROGRAMMED AND DEBUGGED BY HONG, ALPERT AND KIM --- JAN 1996. -!----- debugged again - moorthi and iredell --- may 1998. -!----- -! Further Cleanup, optimization and modification -! - S. Moorthi May 98, March 99. -!----- modified for usgs orography data (ncep office note 424) -! and with several bugs fixed - moorthi and hong --- july 1999. -! -!----- Modified & implemented into NRL NOGAPS -! - Young-Joon Kim, July 2000 -!----- -! VERSION lm MB (6): oz fix 8/2003 -! ----- This code ----- -! -!------ Changed to include the Lott and Miller Mtn Blocking -! with some modifications by (*j*) 4/02 -! From a Principal Coordinate calculation using the -! Hi Res 8 minute orography, the Angle of the -! mtn with that to the East (x) axis is THETA, the slope -! parameter SIGMA. The anisotropy is in GAMMA - all are input -! topographic statistics needed. These are calculated off-line -! as a function of model resolution in the fortran code ml01rg2.f, -! with script mlb2.sh. (*j*) -!----- GFS_GWD_generic_mb.f version (following lmi) elvmax < hncrit (*j*) -! MB3a expt to enhance elvmax mtn hgt see sigfac & hncrit -! GFS_GWD_generic_GWDFIX_v6.f FIXGWD GF6.0 20070608 sigfac=4. -!----- -!----------------------------------------------------------------------C -! USE -! ROUTINE IS CALLED FROM GBPHYS (AFTER CALL TO MONNIN) -! -! PURPOSE -! USING THE GWD PARAMETERIZATIONS OF PS-GLAS AND PH- -! GFDL TECHNIQUE. THE TIME TENDENCIES OF U V -! ARE ALTERED TO INCLUDE THE EFFECT OF MOUNTAIN INDUCED -! GRAVITY WAVE DRAG FROM SUB-GRID SCALE OROGRAPHY INCLUDING -! CONVECTIVE BREAKING, SHEAR BREAKING AND THE PRESENCE OF -! CRITICAL LEVELS -! -! INPUT -! A(IX,KM) NON-LIN TENDENCY FOR V WIND COMPONENT -! B(IX,KM) NON-LIN TENDENCY FOR U WIND COMPONENT -! C(IX,KM) NON-LIN TENDENCY FOR TEMPERATURE -! U1(IX,KM) ZONAL WIND M/SEC AT T0-DT -! V1(IX,KM) MERIDIONAL WIND M/SEC AT T0-DT -! T1(IX,KM) TEMPERATURE DEG K AT T0-DT -! Q1(IX,KM) SPECIFIC HUMIDITY AT T0-DT -! -! DELTIM TIME STEP SECS -! SI(N) P/PSFC AT BASE OF LAYER N -! SL(N) P/PSFC AT MIDDLE OF LAYER N -! DEL(N) POSITIVE INCREMENT OF P/PSFC ACROSS LAYER N -! KPBL(IM) is the index of the top layer of the PBL -! ipr & lprnt for diagnostics -! -! OUTPUT -! A, B AS AUGMENTED BY TENDENCY DUE TO GWDPS -! OTHER INPUT VARIABLES UNMODIFIED. -! revision log: -! May 2013 J. Wang change cleff back to opn setting -! Jan 2014 J. Wang merge Henry and Fangin's dissipation heat in gfs to nems -! -! -! ******************************************************************** - USE MACHINE , ONLY : kind_phys - implicit none -! - ! Interface variables - integer, intent(in) :: im, ix, km, imx, kdt, ipr, me - integer, intent(in) :: KPBL(IM) ! Index for the PBL top layer! - ! DH* adding intent(in) information for the following variables - ! changes the results on Theia/Intel - skip for bit-for-bit results *DH -! real(kind=kind_phys), intent(in) :: & -! & deltim, G, CP, RD, RV, cdmbgwd(2) - real(kind=kind_phys) deltim, G, CP, RD, RV, cdmbgwd(2) - ! *DH - real(kind=kind_phys), intent(inout) :: & - & A(IX,KM), B(IX,KM), C(IX,KM) - real(kind=kind_phys), intent(in) :: & - & U1(IX,KM), V1(IX,KM), T1(IX,KM), & - & Q1(IX,KM), PRSI(IX,KM+1), DEL(IX,KM), & - & PRSL(IX,KM), PRSLK(IX,KM), PHIL(IX,KM), & - & PHII(IX,KM+1) - real(kind=kind_phys), intent(in) :: & - & OC(IM), OA4(IX,4), CLX4(IX,4), HPRIME(IM) - real(kind=kind_phys), intent(inout) :: ELVMAX(IM) - real(kind=kind_phys), intent(in) :: & - & THETA(IM), SIGMA(IM), GAMMA(IM) - real(kind=kind_phys), intent(out) :: DUSFC(IM), DVSFC(IM), & - & RDXZB(IX) - integer, intent(in) :: nmtvr - logical, intent(in) :: lprnt - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -! - ! Local variables -! for lm mtn blocking - real(kind=kind_phys) wk(IM) - real(kind=kind_phys) bnv2lm(IM,KM),PE(IM),EK(IM),ZBK(IM),UP(IM) - real(kind=kind_phys) DB(IM,KM),ANG(IM,KM),UDS(IM,KM) - real(kind=kind_phys) ZLEN, DBTMP, Rtrm, PHIANG, CDmb, DBIM, ZR - real(kind=kind_phys) ENG0, ENG1 -! -! Some constants -! - real(kind=kind_phys) pi, dw2min, rimin, ric, bnv2min, efmin & - &, efmax,hpmax,hpmin, rad_to_deg, deg_to_rad - PARAMETER (PI=3.1415926535897931) - PARAMETER (RAD_TO_DEG=180.0/PI, DEG_TO_RAD=PI/180.0) - PARAMETER (DW2MIN=1., RIMIN=-100., RIC=0.25, BNV2MIN=1.0E-5) -! PARAMETER (EFMIN=0.0, EFMAX=10.0, hpmax=200.0) - PARAMETER (EFMIN=0.0, EFMAX=10.0, hpmax=2400.0, hpmin=1.0) -! - real(kind=kind_phys) FRC, CE, CEOFRC, frmax, CG, GMAX & - &, VELEPS, FACTOP, RLOLEV, RDI -! &, CRITAC, VELEPS, FACTOP, RLOLEV, RDI - parameter (FRC=1.0, CE=0.8, CEOFRC=CE/FRC, frmax=100., CG=0.5) - parameter (GMAX=1.0, VELEPS=1.0, FACTOP=0.5) -! parameter (GMAX=1.0, CRITAC=5.0E-4, VELEPS=1.0, FACTOP=0.5) - parameter (RLOLEV=50000.0) -! parameter (RLOLEV=500.0) -! parameter (RLOLEV=0.5) -! - real(kind=kind_phys) dpmin,hminmt,hncrit,minwnd,sigfac -! --- for lm mtn blocking -! parameter (cdmb = 1.0) !< non-dim sub grid mtn drag Amp (*j*) - parameter (hncrit=8000.) !< Max value in meters for ELVMAX (*j*) -! hncrit set to 8000m and sigfac added to enhance elvmax mtn hgt - parameter (sigfac=4.0) !< MB3a expt test for ELVMAX factor (*j*) - parameter (hminmt=50.) !< min mtn height (*j*) - parameter (minwnd=0.1) !< min wind component (*j*) - -! parameter (dpmin=00.0) !< Minimum thickness of the reference layer -!! parameter (dpmin=05.0) !< Minimum thickness of the reference layer -! parameter (dpmin=20.0) !< Minimum thickness of the reference layer - !< in centibars - parameter (dpmin=5000.0) !< Minimum thickness of the reference layer - !< in Pa -! - real(kind=kind_phys) FDIR - integer mdir - parameter(mdir=8, FDIR=mdir/(PI+PI)) - integer nwdir(mdir) - data nwdir/6,7,5,8,2,3,1,4/ - save nwdir -! - LOGICAL ICRILV(IM) -! -!---- MOUNTAIN INDUCED GRAVITY WAVE DRAG -! - real(kind=kind_phys) TAUB(IM), XN(IM), YN(IM), UBAR(IM) & - &, VBAR(IM), ULOW(IM), OA(IM), CLX(IM) & - &, ROLL(IM), ULOI(IM) & - &, DTFAC(IM), XLINV(IM), DELKS(IM), DELKS1(IM) -! - real(kind=kind_phys) BNV2(IM,KM), TAUP(IM,KM+1), ri_n(IM,KM) & - &, TAUD(IM,KM), RO(IM,KM), VTK(IM,KM) & - &, VTJ(IM,KM), SCOR(IM), VELCO(IM,KM-1) & - &, bnv2bar(im) -! -! real(kind=kind_phys) VELKO(KM-1) - integer kref(IM), kint(im), iwk(im), ipt(im) -! for lm mtn blocking - integer kreflm(IM), iwklm(im) - integer idxzb(im), ktrial, klevm1 -! - real(kind=kind_phys) gor, gocp, fv, gr2, bnv, fr & - &, brvf, cleff, tem, tem1, tem2, temc, temv& - &, wdir, ti, rdz, dw2, shr2, bvf2 & - &, rdelks, efact, coefm, gfobnv, onebg & - &, scork, rscor, hd, fro, rim, sira & - &, dtaux, dtauy, pkp1log, pklog & - &, cosang, sinang, cos2a, sin2a -! - integer kmm1, kmm2, lcap, lcapp1, kbps, kbpsp1,kbpsm1 & - &, kmps, idir, nwd, i, j, k, klcap, kp1, kmpbl, npt, npr, kmll -! &, kmll,kmds,ihit,jhit -! - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 -! -! parameter (cdmb = 1.0) ! non-dim sub grid mtn drag Amp (*j*) -! non-dim sub grid mtn drag Amp (*j*) -! cdmb = 1.0/float(IMX/192) -! cdmb = 192.0/float(IMX) - cdmb = 4.0 * 192.0/float(IMX) - if (cdmbgwd(1) >= 0.0) cdmb = cdmb * cdmbgwd(1) -! - npr = 0 - DO I = 1, IM - DUSFC(I) = 0. - DVSFC(I) = 0. - ENDDO -! - DO K = 1, KM - DO I = 1, IM - DB(I,K) = 0. - ANG(I,K) = 0. - UDS(I,K) = 0. - ENDDO - ENDDO -! - RDI = 1.0 / RD - onebg = 1.0 / g - GOR = G/RD - GR2 = G*GOR - GOCP = G/CP - FV = RV/RD - 1 -! -! NCNT = 0 - KMM1 = KM - 1 - KMM2 = KM - 2 - LCAP = KM - LCAPP1 = LCAP + 1 -! -! - IF ( NMTVR == 14) then -! ---- for lm and gwd calculation points - RDXZB(:) = 0 - ipt = 0 - npt = 0 - DO I = 1,IM - IF (elvmax(i) > HMINMT .and. hprime(i) > hpmin) then - npt = npt + 1 - ipt(npt) = i - if (ipr == i) npr = npt - ENDIF - ENDDO - IF (npt == 0) RETURN ! No gwd/mb calculation done! -! -! if (lprnt) print *,' npt=',npt,' npr=',npr,' ipr=',ipr,' im=',im -! &,' ipt(npt)=',ipt(npt) -! -! --- iwklm is the level above the height of the of the mountain. -! --- idxzb is the level of the dividing streamline. -! INITIALIZE DIVIDING STREAMLINE (DS) CONTROL VECTOR -! - do i=1,npt - iwklm(i) = 2 - IDXZB(i) = 0 - kreflm(i) = 0 - enddo -! if (lprnt) -! & print *,' in GFS_GWD_generic_lm.f npt,IM,IX,IY,km,me=',npt,IM,IX,IY,km,me -! -! -!> --- Subgrid Mountain Blocking Section -! -!.............................. -!.............................. -! -! (*j*) 11/03: test upper limit on KMLL=km - 1 -! then do not need hncrit -- test with large hncrit first. -! KMLL = km / 2 ! maximum mtnlm height : # of vertical levels / 2 - - KMLL = kmm1 - -! --- No mtn should be as high as KMLL (so we do not have to start at -! --- the top of the model but could do calc for all levels). -! - DO I = 1, npt - j = ipt(i) - ELVMAX(J) = min (ELVMAX(J) + sigfac * hprime(j), hncrit) - ENDDO -! - DO K = 1,KMLL - DO I = 1, npt - j = ipt(i) -! --- interpolate to max mtn height for index, iwklm(I) wk[gz] -! --- ELVMAX is limited to hncrit because to hi res topo30 orog. - pkp1log = phil(j,k+1) * onebg - pklog = phil(j,k) * onebg -!!!------- ELVMAX(J) = min (ELVMAX(J) + sigfac * hprime(j), hncrit) - - if (ELVMAX(j) <= pkp1log .and. ELVMAX(j) >= pklog) THEN - -! print *,' in GFS_GWD_generic_lm.f 1 =',k,ELVMAX(j),pklog,pkp1log,me -! --- wk for diags but can be saved and reused. - wk(i) = G * ELVMAX(j) / (phil(j,k+1) - phil(j,k)) - iwklm(I) = MAX(iwklm(I), k+1) -! print *,' in GFS_GWD_generic_lm.f 2 npt=',npt,i,j,wk(i),iwklm(i),me - endif -! -! --- find at prsl levels large scale environment variables -! --- these cover all possible mtn max heights - VTJ(I,K) = T1(J,K) * (1.0+FV*Q1(J,K)) - VTK(I,K) = VTJ(I,K) / PRSLK(J,K) - RO(I,K) = RDI * PRSL(J,K) / VTJ(I,K) ! DENSITY Kg/M**3 - ENDDO - ENDDO -! -! testing for highest model level of mountain top -! -! ihit = 2 -! jhit = 0 -! do i = 1, npt -! j=ipt(i) -! if ( iwklm(i) .gt. ihit ) then -! ihit = iwklm(i) -! jhit = j -! endif -! enddo -! print *, ' mb: kdt,max(iwklm),jhit,phil,me=', -! & kdt,ihit,jhit,phil(jhit,ihit),me - - klevm1 = KMLL - 1 - DO K = 1, klevm1 - kp1 = k + 1 - DO I = 1, npt - j = ipt(i) - RDZ = g / (phil(j,kp1) - phil(j,k)) -! --- Brunt-Vaisala Frequency -!> - Compute Brunt-Vaisala Frequency \f$N\f$. - BNV2LM(I,K) = (G+G) * RDZ * (VTK(I,Kp1) - VTK(I,K)) & - & / (VTK(I,Kp1) + VTK(I,K)) - bnv2lm(i,k) = max( bnv2lm(i,k), bnv2min ) - ENDDO - ENDDO -! print *,' in GFS_GWD_generic_lm.f 3 npt=',npt,j,RDZ,me -! - DO I = 1, npt - J = ipt(i) - DELKS(I) = 1.0 / (PRSI(J,1) - PRSI(J,iwklm(i))) - DELKS1(I) = 1.0 / (PRSL(J,1) - PRSL(J,iwklm(i))) - UBAR (I) = 0.0 - VBAR (I) = 0.0 - ROLL (I) = 0.0 - PE (I) = 0.0 - EK (I) = 0.0 - BNV2bar(I) = (PRSL(J,1)-PRSL(J,2)) * DELKS1(I) * BNV2LM(I,1) - ENDDO - -! --- find the dividing stream line height -! --- starting from the level above the max mtn downward -! --- iwklm(i) is the k-index of mtn elvmax elevation -!> - Find the dividing streamline height starting from the level above -!! the maximum mountain height and processing downward. - DO Ktrial = KMLL, 1, -1 - DO I = 1, npt - IF ( Ktrial < iwklm(I) .and. kreflm(I) == 0 ) then - kreflm(I) = Ktrial - ENDIF - ENDDO - ENDDO -! print *,' in GFS_GWD_generic_lm.f 4 npt=',npt,kreflm(npt),me -! -! --- in the layer kreflm(I) to 1 find PE (which needs N, ELVMAX) -! --- make averages, guess dividing stream (DS) line layer. -! --- This is not used in the first cut except for testing and -! --- is the vert ave of quantities from the surface to mtn top. -! - DO I = 1, npt - DO K = 1, Kreflm(I) - J = ipt(i) - RDELKS = DEL(J,K) * DELKS(I) - UBAR(I) = UBAR(I) + RDELKS * U1(J,K) ! trial Mean U below - VBAR(I) = VBAR(I) + RDELKS * V1(J,K) ! trial Mean V below - ROLL(I) = ROLL(I) + RDELKS * RO(I,K) ! trial Mean RO below - RDELKS = (PRSL(J,K)-PRSL(J,K+1)) * DELKS1(I) - BNV2bar(I) = BNV2bar(I) + BNV2lm(I,K) * RDELKS -! --- these vert ave are for diags, testing and GWD to follow (*j*). - ENDDO - ENDDO -! print *,' in GFS_GWD_generic_lm.f 5 =',i,kreflm(npt),BNV2bar(npt),me -! -! --- integrate to get PE in the trial layer. -! --- Need the first layer where PE>EK - as soon as -! --- IDXZB is not 0 we have a hit and Zb is found. -! - DO I = 1, npt - J = ipt(i) - DO K = iwklm(I), 1, -1 - PHIANG = atan2(V1(J,K),U1(J,K))*RAD_TO_DEG - ANG(I,K) = ( THETA(J) - PHIANG ) - if ( ANG(I,K) > 90. ) ANG(I,K) = ANG(I,K) - 180. - if ( ANG(I,K) < -90. ) ANG(I,K) = ANG(I,K) + 180. - ANG(I,K) = ANG(I,K) * DEG_TO_RAD -! -!> - Compute wind speed UDS -!!\f[ -!! UDS=\max(\sqrt{U1^2+V1^2},minwnd) -!!\f] -!! where \f$ minwnd=0.1 \f$, \f$U1\f$ and \f$V1\f$ are zonal and -!! meridional wind components of model layer wind. - - UDS(I,K) = & - & MAX(SQRT(U1(J,K)*U1(J,K) + V1(J,K)*V1(J,K)), minwnd) -! --- Test to see if we found Zb previously - IF (IDXZB(I) == 0 ) then - PE(I) = PE(I) + BNV2lm(I,K) * (G*ELVMAX(J) - phil(J,K)) & - & * (PHII(J,K+1) - PHII(J,K)) & - & * (onebg*onebg) -! --- KE -! --- Wind projected on the line perpendicular to mtn range, U(Zb(K)). -! --- kenetic energy is at the layer Zb -! --- THETA ranges from -+90deg |_ to the mtn "largest topo variations" - UP(I) = UDS(I,K) * cos(ANG(I,K)) - EK(I) = 0.5 * UP(I) * UP(I) - -! --- Dividing Stream lime is found when PE =exceeds EK. - IF (PE(I) >= EK(I)) THEN - IDXZB(I) = K - RDXZB(J) = real(K,kind=kind_phys) - ENDIF -! --- Then mtn blocked flow is between Zb=k(IDXZB(I)) and surface -! -!> - The dividing streamline height (idxzb), of a subgrid scale -!! obstable, is found by comparing the potential (PE) and kinetic -!! energies (EK) of the upstream large scale wind and subgrid scale air -!! parcel movements. the dividing streamline is found when -!! \f$PE\geq EK\f$. Mountain-blocked flow is defined to exist between -!! the surface and the dividing streamline height (\f$h_d\f$), which -!! can be found by solving an integral equation for \f$h_d\f$: -!!\f[ -!! \frac{U^{2}(h_{d})}{2}=\int_{h_{d}}^{H} N^{2}(z)(H-z)dz -!!\f] -!! where \f$H\f$ is the maximum subgrid scale elevation within the grid -!! box of actual orography, \f$h\f$, obtained from the GTOPO30 dataset -!! from the U.S. Geological Survey. - ENDIF - ENDDO - ENDDO -! -! print *,' in GFS_GWD_generic_lm.f 6 =',phiang,THETA(ipt(npt)),me -! print *,' in GFS_GWD_generic_lm.f 7 =',IDXZB(npt),PE(npt) -! -! if (lprnt .and. npr .gt. 0) then -! print *,' BNV2bar,BNV2lm=',bnv2bar(npr),BNV2lm(npr,1:klevm1) -! print *,' npr,IDXZB,UDS=',npr,IDXZB(npr),UDS(npr,:) -! print *,' PE,UP,EK=',PE(npr),UP(npr),EK(npr) -! endif -! - DO I = 1, npt - J = ipt(i) -! --- Calc if N constant in layers (Zb guess) - a diagnostic only. - ZBK(I) = ELVMAX(J) & - & - SQRT(UBAR(I)*UBAR(I) + VBAR(I)*VBAR(I))/BNV2bar(I) - ENDDO -! -! if (lprnt .and. npr .gt. 0) then -! print *,' iwklm,ZBK=',iwklm(npr),ZBK(npr),IDXZB(npr) -! print *,' Zb=',PHIL(ipr),IDXZB(npr))/G -! print *,' in GFS_GWD_generic_lm.f 8 npt =',npt,ZBK(npt),UP(npt),me -! endif -! -! --- The drag for mtn blocked flow -! - DO I = 1, npt - J = ipt(i) - ZLEN = 0. -! print *,' in GFS_GWD_generic_lm.f 9 =',i,j,IDXZB(i),me - IF (IDXZB(I) > 0) then - DO K = IDXZB(I), 1, -1 - IF (PHIL(J,IDXZB(I)) > PHIL(J,K)) then - -!> - Calculate \f$ZLEN\f$, which sums up a number of contributions of -!! elliptic obstables. -!!\f[ -!! ZLEN=\sqrt{[\frac{h_{d}-z}{z+h'}]} -!!\f] -!! where \f$z\f$ is the height, \f$h'\f$ is the orographic standard -!! deviation (HPRIME). - ZLEN = SQRT( (PHIL(J,IDXZB(I)) - PHIL(J,K)) & - & / (PHIL(J,K ) + G*hprime(J)) ) -! --- lm eq 14: -!> - Calculate the drag coefficient to vary with the aspect ratio of -!! the obstable as seen by the incident flow (see eq.14 in Lott and -!! Miller (1997) \cite lott_and_miller_1997) -!!\f[ -!! R=\frac{\cos^{2}\psi+\gamma\sin^{2}\psi}{\gamma\cos^{2}\psi+\sin^{2}\psi} -!!\f] -!! where \f$\psi\f$, which is derived from THETA, is the angle between -!! the incident flow direction and the normal ridge direcion. -!! \f$\gamma\f$ is the orographic anisotropy (GAMMA). - - cosang = cos(ang(i,k)) - sinang = sin(ang(i,k)) - cos2a = cosang * cosang - sin2a = sinang * sinang - tem = cos2a + GAMMA(J)*sin2a - ! Here Rtrm is 1.0/R - ! -------------------- - if (abs(tem) > 1.e-06) then - Rtrm = (gamma(J)*cos2a + sin2a) / tem - elseif (tem > 0.0) then - Rtrm = (gamma(J)*cos2a + sin2a) * 1.0e6 - else - Rtrm = - (gamma(J)*cos2a + sin2a) * 1.0e6 - endif - ZR = MAX( 2.0 - Rtrm, 0. ) - -! --- (negitive of DB -- see sign at tendency) -!> - In each model layer below the dividing streamlines, a drag from -!! the blocked flow is exerted by the obstacle on the large scale flow. -!! The drag per unit area and per unit height is written (eq.15 in -!! Lott and Miller (1997) \cite lott_and_miller_1997): -!!\f[ -!! D_{b}(z)=-C_{d}\max(2-\frac{1}{R},0)\rho\frac{\sigma}{2h'}ZLEN\max(\cos\psi,\gamma\sin\psi)\frac{UDS}{2} -!!\f] -!! where \f$C_{d}\f$ is a specified constant, \f$\sigma\f$ is the -!! orographic slope. - - DBTMP = 0.25 * CDmb * ZR * sigma(J) * & - & MAX(cosANG, gamma(J)*sinANG) * ZLEN / hprime(J) - DB(I,K) = DBTMP * UDS(I,K) -! -! if(lprnt .and. i .eq. npr) then -! print *,' in GFS_GWD_generic_lmi.f 10 npt=',npt,i,j,idxzb(i) -! &, DBTMP,R' ang=',ang(i,k),' gamma=',gamma(j),' K=',K -! print *,' in GFS_GWD_generic_lmi.f 11 K=',k,ZLEN,cos(ANG(I,K)) -! print *,' in GFS_GWD_generic_lmi.f 12 DB=',DB(i,k),sin(ANG(I,K)) -! endif - endif - ENDDO -! if(lprnt) print *,' @K=1,ZLEN,DBTMP=',K,ZLEN,DBTMP - endif - ENDDO -! -!............................. -!............................. -! end mtn blocking section -! - ELSEIF ( NMTVR /= 14) then -! ---- for mb not present and gwd (nmtvr .ne .14) - ipt = 0 - npt = 0 - DO I = 1,IM - IF ( hprime(i) > hpmin ) then - npt = npt + 1 - ipt(npt) = i - if (ipr == i) npr = npt - ENDIF - ENDDO - IF (npt == 0) RETURN ! No gwd/mb calculation done! -! -! if (lprnt) print *,' NPR=',npr,' npt=',npt,' IPR=',IPR -! &,' ipt(npt)=',ipt(npt) -! - do i=1,npt - IDXZB(i) = 0 - RDXZB(i) = 0. - enddo - ENDIF -! -!............................. -!............................. -! -!>-# Orographic Gravity Wave Drag Section - KMPBL = km / 2 ! maximum pbl height : # of vertical levels / 2 -! -! Scale cleff between IM=384*2 and 192*2 for T126/T170 and T62 -! - if (imx > 0) then -! cleff = 1.0E-5 * SQRT(FLOAT(IMX)/384.0) ! this is inverse of CLEFF! -! cleff = 1.0E-5 * SQRT(FLOAT(IMX)/192.0) ! this is inverse of CLEFF! -! cleff = 0.5E-5 * SQRT(FLOAT(IMX)/192.0) ! this is inverse of CLEFF! -! cleff = 1.0E-5 * SQRT(FLOAT(IMX)/192)/float(IMX/192) -! cleff = 1.0E-5 / SQRT(FLOAT(IMX)/192.0) ! this is inverse of CLEFF! - cleff = 0.5E-5 / SQRT(FLOAT(IMX)/192.0) ! this is inverse of CLEFF! -! hmhj for ndsl -! jw cleff = 0.1E-5 / SQRT(FLOAT(IMX)/192.0) ! this is inverse of CLEFF! -! cleff = 2.0E-5 * SQRT(FLOAT(IMX)/192.0) ! this is inverse of CLEFF! -! cleff = 2.5E-5 * SQRT(FLOAT(IMX)/192.0) ! this is inverse of CLEFF! - endif - if (cdmbgwd(2) >= 0.0) cleff = cleff * cdmbgwd(2) -! - DO K = 1,KM - DO I =1,npt - J = ipt(i) - VTJ(I,K) = T1(J,K) * (1.0+FV*Q1(J,K)) - VTK(I,K) = VTJ(I,K) / PRSLK(J,K) - RO(I,K) = RDI * PRSL(J,K) / VTJ(I,K) ! DENSITY TONS/M**3 - TAUP(I,K) = 0.0 - ENDDO - ENDDO - DO K = 1,KMM1 - kp1 = k + 1 - DO I =1,npt - J = ipt(i) - TI = 2.0 / (T1(J,K)+T1(J,Kp1)) - TEM = TI / (PRSL(J,K)-PRSL(J,Kp1)) - RDZ = g / (phil(j,kp1) - phil(j,k)) - TEM1 = U1(J,K) - U1(J,Kp1) - TEM2 = V1(J,K) - V1(J,Kp1) - DW2 = TEM1*TEM1 + TEM2*TEM2 - SHR2 = MAX(DW2,DW2MIN) * RDZ * RDZ - BVF2 = G*(GOCP+RDZ*(VTJ(I,Kp1)-VTJ(I,K))) * TI - ri_n(I,K) = MAX(BVF2/SHR2,RIMIN) ! Richardson number -! Brunt-Vaisala Frequency -! TEM = GR2 * (PRSL(J,K)+PRSL(J,K+1)) * TEM -! BNV2(I,K) = TEM * (VTK(I,K+1)-VTK(I,K))/(VTK(I,K+1)+VTK(I,K)) - BNV2(I,K) = (G+G) * RDZ * (VTK(I,Kp1)-VTK(I,K)) & - & / (VTK(I,Kp1)+VTK(I,K)) - bnv2(i,k) = max( bnv2(i,k), bnv2min ) - ENDDO - ENDDO -! print *,' in GFS_GWD_generic_lm.f GWD:14 =',npt,kmm1,bnv2(npt,kmm1) -! -! Apply 3 point smoothing on BNV2 -! -! do k=1,km -! do i=1,im -! vtk(i,k) = bnv2(i,k) -! enddo -! enddo -! do k=2,kmm1 -! do i=1,im -! bnv2(i,k) = 0.25*(vtk(i,k-1)+vtk(i,k+1)) + 0.5*vtk(i,k) -! enddo -! enddo -! -! Finding the first interface index above 50 hPa level -! - do i=1,npt - iwk(i) = 2 - enddo - DO K=3,KMPBL - DO I=1,npt - j = ipt(i) - tem = (prsi(j,1) - prsi(j,k)) - if (tem < dpmin) iwk(i) = k - enddo - enddo -! -!> - Calculate the reference level index: kref=max(2,KPBL+1). where -!! KPBL is the index for the PBL top layer. - KBPS = 1 - KMPS = KM - DO I=1,npt - J = ipt(i) - kref(I) = MAX(IWK(I), KPBL(J)+1 ) ! reference level - DELKS(I) = 1.0 / (PRSI(J,1) - PRSI(J,kref(I))) - DELKS1(I) = 1.0 / (PRSL(J,1) - PRSL(J,kref(I))) - UBAR (I) = 0.0 - VBAR (I) = 0.0 - ROLL (I) = 0.0 - KBPS = MAX(KBPS, kref(I)) - KMPS = MIN(KMPS, kref(I)) -! - BNV2bar(I) = (PRSL(J,1)-PRSL(J,2)) * DELKS1(I) * BNV2(I,1) - ENDDO -! print *,' in GFS_GWD_generic_lm.f GWD:15 =',KBPS,KMPS - KBPSP1 = KBPS + 1 - KBPSM1 = KBPS - 1 - DO K = 1,KBPS - DO I = 1,npt - IF (K < kref(I)) THEN - J = ipt(i) - RDELKS = DEL(J,K) * DELKS(I) - UBAR(I) = UBAR(I) + RDELKS * U1(J,K) ! Mean U below kref - VBAR(I) = VBAR(I) + RDELKS * V1(J,K) ! Mean V below kref -! - ROLL(I) = ROLL(I) + RDELKS * RO(I,K) ! Mean RO below kref - RDELKS = (PRSL(J,K)-PRSL(J,K+1)) * DELKS1(I) - BNV2bar(I) = BNV2bar(I) + BNV2(I,K) * RDELKS - ENDIF - ENDDO - ENDDO -! print *,' in GFS_GWD_generic_lm.f GWD:15B =',bnv2bar(npt) -! -! FIGURE OUT LOW-LEVEL HORIZONTAL WIND DIRECTION AND FIND 'OA' -! -! NWD 1 2 3 4 5 6 7 8 -! WD W S SW NW E N NE SE -! -!> - Calculate low-level horizontal wind direction, the derived -!! orographic asymmetry parameter (OA), and the derived Lx (CLX). - DO I = 1,npt - J = ipt(i) - wdir = atan2(UBAR(I),VBAR(I)) + pi - idir = mod(nint(fdir*wdir),mdir) + 1 - nwd = nwdir(idir) - OA(I) = (1-2*INT( (NWD-1)/4 )) * OA4(J,MOD(NWD-1,4)+1) - CLX(I) = CLX4(J,MOD(NWD-1,4)+1) - ENDDO -! -!-----XN,YN "LOW-LEVEL" WIND PROJECTIONS IN ZONAL -! & MERIDIONAL DIRECTIONS -!-----ULOW "LOW-LEVEL" WIND MAGNITUDE - (= U) -!-----BNV2 BNV2 = N**2 -!-----TAUB BASE MOMENTUM FLUX -!-----= -(RO * U**3/(N*XL)*GF(FR) FOR N**2 > 0 -!-----= 0. FOR N**2 < 0 -!-----FR FROUDE = N*HPRIME / U -!-----G GMAX*FR**2/(FR**2+CG/OC) -! -!-----INITIALIZE SOME ARRAYS -! - DO I = 1,npt - XN(I) = 0.0 - YN(I) = 0.0 - TAUB (I) = 0.0 - ULOW (I) = 0.0 - DTFAC(I) = 1.0 - ICRILV(I) = .FALSE. ! INITIALIZE CRITICAL LEVEL CONTROL VECTOR - -! -!----COMPUTE THE "LOW LEVEL" WIND MAGNITUDE (M/S) -! - ULOW(I) = MAX(SQRT(UBAR(I)*UBAR(I) + VBAR(I)*VBAR(I)), 1.0) - ULOI(I) = 1.0 / ULOW(I) - ENDDO -! - DO K = 1,KMM1 - kp1 = k + 1 - DO I = 1,npt - J = ipt(i) - VELCO(I,K) = 0.5 * ((U1(J,K)+U1(J,Kp1))*UBAR(I) & - & + (V1(J,K)+V1(J,Kp1))*VBAR(I)) - VELCO(I,K) = VELCO(I,K) * ULOI(I) -! IF ((VELCO(I,K).LT.VELEPS) .AND. (VELCO(I,K).GT.0.)) THEN -! VELCO(I,K) = VELEPS -! ENDIF - ENDDO - ENDDO -! -! -! find the interface level of the projected wind where -! low levels & upper levels meet above pbl -! -! do i=1,npt -! kint(i) = km -! enddo -! do k = 1,kmm1 -! do i = 1,npt -! IF (K .GT. kref(I)) THEN -! if(velco(i,k) .lt. veleps .and. kint(i) .eq. km) then -! kint(i) = k+1 -! endif -! endif -! enddo -! enddo -! WARNING KINT = KREF !!!!!!!!! - do i=1,npt - kint(i) = kref(i) - enddo -! -! if(lprnt) print *,' ubar=',ubar -! &,' vbar=',vbar,' ulow=',ulow,' veleps=',veleps -! - DO I = 1,npt - J = ipt(i) - BNV = SQRT( BNV2bar(I) ) - FR = BNV * ULOI(I) * min(HPRIME(J),hpmax) - FR = MIN(FR, FRMAX) - XN(I) = UBAR(I) * ULOI(I) - YN(I) = VBAR(I) * ULOI(I) -! -! Compute the base level stress and store it in TAUB -! CALCULATE ENHANCEMENT FACTOR, NUMBER OF MOUNTAINS & ASPECT -! RATIO CONST. USE SIMPLIFIED RELATIONSHIP BETWEEN STANDARD -! DEVIATION & CRITICAL HGT -! -!> - Calculate enhancement factor (E),number of mountans (m') and -!! aspect ratio constant. -!!\n As in eq.(4.9),(4.10),(4.11) in Kim and Arakawa (1995) -!! \cite kim_and_arakawa_1995, we define m' and E in such a way that they -!! depend on the geometry and location of the subgrid-scale orography -!! through OA and the nonlinearity of flow above the orography through -!! Fr. OC, which is the orographic convexity, and statistically -!! determine how protruded (sharp) the subgrid-scale orography is, is -!! included in the saturation flux G' in such a way that G' is -!! proportional to OC. The forms of E,m' and G' are: -!!\f[ -!! E(OA,F_{r_{0}})=(OA+2)^{\delta} -!!\f] -!!\f[ -!! \delta=C_{E}F_{r_{0}}/F_{r_{c}} -!!\f] -!!\f[ -!! m'(OA,CLX)=C_{m}\triangle x(1+CLX)^{OA+1} -!!\f] -!!\f[ -!! G'(OC,F_{r_{0}})=\frac{F_{r_{0}}^2}{F_{r_{0}}^2+a^{2}} -!!\f] -!!\f[ -!! a^{2}=C_{G}OC^{-1} -!!\f] -!! where \f$F_{r_{c}}(=1)\f$ is the critical Froude number, -!! \f$F_{r_{0}}\f$ is the Froude number. \f$C_{E}\f$,\f$C_{m}\f$, -!! \f$C_{G}\f$ are constants. - -!> - Calculate the reference-level drag \f$\tau_{0}\f$ (eq.(4.8) in -!! Kim and Arakawa (1995) \cite kim_and_arakawa_1995): -!!\f[ -!! \tau_0=E\frac{m'}{\triangle x}\frac{\rho_{0}U_0^3}{N_{0}}G' -!!\f] -!! where \f$E\f$,\f$m'\f$, and \f$G'\f$ are the enhancement factor, -!! "the number of mountains", and the flux function defined above, -!! respectively. - - EFACT = (OA(I) + 2.) ** (CEOFRC*FR) - EFACT = MIN( MAX(EFACT,EFMIN), EFMAX ) -! - COEFM = (1. + CLX(I)) ** (OA(I)+1.) -! - XLINV(I) = COEFM * CLEFF -! - TEM = FR * FR * OC(J) - GFOBNV = GMAX * TEM / ((TEM + CG)*BNV) ! G/N0 -! - TAUB(I) = XLINV(I) * ROLL(I) * ULOW(I) * ULOW(I) & - & * ULOW(I) * GFOBNV * EFACT ! BASE FLUX Tau0 -! -! tem = min(HPRIME(I),hpmax) -! TAUB(I) = XLINV(I) * ROLL(I) * ULOW(I) * BNV * tem * tem -! - K = MAX(1, kref(I)-1) - TEM = MAX(VELCO(I,K)*VELCO(I,K), 0.1) - SCOR(I) = BNV2(I,K) / TEM ! Scorer parameter below ref level - ENDDO -! if(lprnt) print *,' taub=',taub -! -!----SET UP BOTTOM VALUES OF STRESS -! - DO K = 1, KBPS - DO I = 1,npt - IF (K <= kref(I)) TAUP(I,K) = TAUB(I) - ENDDO - ENDDO -! -! Now compute vertical structure of the stress. -! - DO K = KMPS, KMM1 ! Vertical Level K Loop! - KP1 = K + 1 - DO I = 1, npt -! -!-----UNSTABLE LAYER IF RI < RIC -!-----UNSTABLE LAYER IF UPPER AIR VEL COMP ALONG SURF VEL <=0 (CRIT LAY) -!---- AT (U-C)=0. CRIT LAYER EXISTS AND BIT VECTOR SHOULD BE SET (.LE.) -! - IF (K >= kref(I)) THEN - ICRILV(I) = ICRILV(I) .OR. ( ri_n(I,K) < RIC) & - & .OR. (VELCO(I,K) <= 0.0) - ENDIF - ENDDO -! -!> - Compute the drag above the reference level (\f$k\geq kref\f$): -!! - Calculate the ratio of the Scorer parameter (\f$R_{scor}\f$). -!! \n From a series of experiments, Kim and Arakawa (1995) -!! \cite kim_and_arakawa_1995 found that the magnitude of drag divergence -!! tends to be underestimated by the revised scheme in low-level -!! downstream regions with wave breaking. Therefore, at low levels when -!! OA > 0 (i.e., in the "downstream" region) the saturation hypothesis -!! is replaced by the following formula based on the ratio of the -!! the Scorer parameter: -!!\f[ -!! R_{scor}=\min \left[\frac{\tau_i}{\tau_{i+1}},1\right] -!!\f] - DO I = 1,npt - IF (K >= kref(I)) THEN - IF (.NOT.ICRILV(I) .AND. TAUP(I,K) > 0.0 ) THEN - TEMV = 1.0 / max(VELCO(I,K), 0.01) -! IF (OA(I) .GT. 0. .AND. PRSI(ipt(i),KP1).GT.RLOLEV) THEN - IF (OA(I) > 0. .AND. kp1 < kint(i)) THEN - SCORK = BNV2(I,K) * TEMV * TEMV - RSCOR = MIN(1.0, SCORK / SCOR(I)) - SCOR(I) = SCORK - ELSE - RSCOR = 1. - ENDIF -! -!> - The drag above the reference level is expressed as: -!!\f[ -!! \tau=\frac{m'}{\triangle x}\rho NUh_d^2 -!!\f] -!! where \f$h_{d}\f$ is the displacement wave amplitude. In the absence -!! of wave breaking, the displacement amplitude for the \f$i^{th}\f$ -!! layer can be expressed using the drag for the layer immediately -!! below. Thus, assuming \f$\tau_i=\tau_{i+1}\f$, we can get: -!!\f[ -!! h_{d_i}^2=\frac{\triangle x}{m'}\frac{\tau_{i+1}}{\rho_{i}N_{i}U_{i}} -!!\f] - - BRVF = SQRT(BNV2(I,K)) ! Brunt-Vaisala Frequency -! TEM1 = XLINV(I)*(RO(I,KP1)+RO(I,K))*BRVF*VELCO(I,K)*0.5 - TEM1 = XLINV(I)*(RO(I,KP1)+RO(I,K))*BRVF*0.5 & - & * max(VELCO(I,K),0.01) - HD = SQRT(TAUP(I,K) / TEM1) - FRO = BRVF * HD * TEMV -! -! RIM is the MINIMUM-RICHARDSON NUMBER BY SHUTTS (1985) -! -!> - The minimum Richardson number (\f$Ri_{m}\f$) or local -!! wave-modified Richardson number, which determines the onset of wave -!! breaking, is expressed in terms of \f$R_{i}\f$ and -!! \f$F_{r_{d}}=Nh_{d}/U\f$: -!!\f[ -!! Ri_{m}=\frac{Ri(1-Fr_{d})}{(1+\sqrt{Ri}\cdot Fr_{d})^{2}} -!!\f] -!! see eq.(4.6) in Kim and Arakawa (1995) \cite kim_and_arakawa_1995. - - TEM2 = SQRT(ri_n(I,K)) - TEM = 1. + TEM2 * FRO - RIM = ri_n(I,K) * (1.-FRO) / (TEM * TEM) -! -! CHECK STABILITY TO EMPLOY THE 'SATURATION HYPOTHESIS' -! OF LINDZEN (1981) EXCEPT AT TROPOSPHERIC DOWNSTREAM REGIONS -! -!> - Check stability to employ the 'saturation hypothesis' of Lindzen -!! (1981) \cite lindzen_1981 except at tropospheric downstream regions. -!! \n Wave breaking occurs when \f$Ri_{m}= kint(i) )) THEN - TEMC = 2.0 + 1.0 / TEM2 - HD = VELCO(I,K) * (2.*SQRT(TEMC)-TEMC) / BRVF - TAUP(I,KP1) = TEM1 * HD * HD - ELSE - TAUP(I,KP1) = TAUP(I,K) * RSCOR - ENDIF - taup(i,kp1) = min(taup(i,kp1), taup(i,k)) - ENDIF - ENDIF - ENDDO - ENDDO -! -! DO I=1,IM -! taup(i,km+1) = taup(i,km) -! ENDDO -! - IF(LCAP .LE. KM) THEN - DO KLCAP = LCAPP1, KM+1 - DO I = 1,npt - SIRA = PRSI(ipt(I),KLCAP) / PRSI(ipt(I),LCAP) - TAUP(I,KLCAP) = SIRA * TAUP(I,LCAP) - ENDDO - ENDDO - ENDIF -! -! Calculate - (g/p*)*d(tau)/d(sigma) and Decel terms DTAUX, DTAUY -! - DO K = 1,KM - DO I = 1,npt - TAUD(I,K) = G * (TAUP(I,K+1) - TAUP(I,K)) / DEL(ipt(I),K) - ENDDO - ENDDO -! -!------LIMIT DE-ACCELERATION (MOMENTUM DEPOSITION ) AT TOP TO 1/2 VALUE -!------THE IDEA IS SOME STUFF MUST GO OUT THE 'TOP' -! - DO KLCAP = LCAP, KM - DO I = 1,npt - TAUD(I,KLCAP) = TAUD(I,KLCAP) * FACTOP - ENDDO - ENDDO -! -!------IF THE GRAVITY WAVE DRAG WOULD FORCE A CRITICAL LINE IN THE -!------LAYERS BELOW SIGMA=RLOLEV DURING THE NEXT DELTIM TIMESTEP, -!------THEN ONLY APPLY DRAG UNTIL THAT CRITICAL LINE IS REACHED. -! - DO K = 1,KMM1 - DO I = 1,npt - IF (K > kref(I) .and. PRSI(ipt(i),K) >= RLOLEV) THEN - IF(TAUD(I,K) /= 0.) THEN - TEM = DELTIM * TAUD(I,K) - DTFAC(I) = MIN(DTFAC(I),ABS(VELCO(I,K)/TEM)) - ENDIF - ENDIF - ENDDO - ENDDO -! -! if(lprnt .and. npr .gt. 0) then -! print *,' before A=',A(npr,:) -! print *,' before B=',B(npr,:) -! endif - -!> - Calculate outputs: A, B, DUSFC, DVSFC (see parameter description). -!! - Below the dividing streamline height (k < idxzb), mountain -!! blocking(\f$D_{b}\f$) is applied. -!! - Otherwise (k>= idxzb), orographic GWD (\f$\tau\f$) is applied. - DO K = 1,KM - DO I = 1,npt - J = ipt(i) - TAUD(I,K) = TAUD(I,K) * DTFAC(I) - DTAUX = TAUD(I,K) * XN(I) - DTAUY = TAUD(I,K) * YN(I) - ENG0 = 0.5*(U1(j,K)*U1(j,K)+V1(J,K)*V1(J,K)) -! --- lm mb (*j*) changes overwrite GWD - if ( K < IDXZB(I) .AND. IDXZB(I) /= 0 ) then - DBIM = DB(I,K) / (1.+DB(I,K)*DELTIM) - A(J,K) = - DBIM * V1(J,K) + A(J,K) - B(J,K) = - DBIM * U1(J,K) + B(J,K) - ENG1 = ENG0*(1.0-DBIM*DELTIM)*(1.0-DBIM*DELTIM) -! if ( ABS(DBIM * U1(J,K)) .gt. .01 ) -! & print *,' in GFS_GWD_generic_lmi.f KDT=',KDT,I,K,DB(I,K), -! & dbim,idxzb(I),U1(J,K),V1(J,K),me - DUSFC(J) = DUSFC(J) - DBIM * U1(J,K) * DEL(J,K) - DVSFC(J) = DVSFC(J) - DBIM * V1(J,K) * DEL(J,K) - else -! - A(J,K) = DTAUY + A(J,K) - B(J,K) = DTAUX + B(J,K) - ENG1 = 0.5*( & - & (U1(J,K)+DTAUX*DELTIM)*(U1(J,K)+DTAUX*DELTIM) & - & + (V1(J,K)+DTAUY*DELTIM)*(V1(J,K)+DTAUY*DELTIM)) - DUSFC(J) = DUSFC(J) + DTAUX * DEL(J,K) - DVSFC(J) = DVSFC(J) + DTAUY * DEL(J,K) - endif - C(J,K) = C(J,K) + max(ENG0-ENG1,0.)/CP/DELTIM - ENDDO - ENDDO -! if (lprnt) then -! print *,' in GFS_GWD_generic_lm.f after A=',A(ipr,:) -! print *,' in GFS_GWD_generic_lm.f after B=',B(ipr,:) -! print *,' DB=',DB(ipr,:) -! endif - - DO I = 1,npt - J = ipt(i) -! TEM = (-1.E3/G) - DUSFC(J) = - onebg * DUSFC(J) - DVSFC(J) = - onebg * DVSFC(J) - ENDDO -! -! MONITOR FOR EXCESSIVE GRAVITY WAVE DRAG TENDENCIES IF NCNT>0 -! -! IF(NCNT.GT.0) THEN -! IF(LAT.GE.38.AND.LAT.LE.42) THEN -!CMIC$ GUARD 37 -! DO 92 I = 1,IM -! IF(IKOUNT.GT.NCNT) GO TO 92 -! IF(I.LT.319.OR.I.GT.320) GO TO 92 -! DO 91 K = 1,KM -! IF(ABS(TAUD(I,K)) .GT. CRITAC) THEN -! IF(I.LE.IM) THEN -! IKOUNT = IKOUNT+1 -! PRINT 123,I,LAT,KDT -! PRINT 124,TAUB(I),BNV(I),ULOW(I), -! 1 GF(I),FR(I),ROLL(I),HPRIME(I),XN(I),YN(I) -! PRINT 124,(TAUD(I,KK),KK = 1,KM) -! PRINT 124,(TAUP(I,KK),KK = 1,KM+1) -! PRINT 124,(ri_n(I,KK),KK = 1,KM) -! DO 93 KK = 1,KMM1 -! VELKO(KK) = -! 1 0.5*((U1(I,KK)+U1(I,KK+1))*UBAR(I)+ -! 2 (V1(I,KK)+V1(I,KK+1))*VBAR(I))*ULOI(I) -!93 CONTINUE -! PRINT 124,(VELKO(KK),KK = 1,KMM1) -! PRINT 124,(A (I,KK),KK = 1,KM) -! PRINT 124,(DTAUY(I,KK),KK = 1,KM) -! PRINT 124,(B (I,KK),KK = 1,KM) -! PRINT 124,(DTAUX(I,KK),KK = 1,KM) -! GO TO 92 -! ENDIF -! ENDIF -!91 CONTINUE -!92 CONTINUE -!CMIC$ END GUARD 37 -!123 FORMAT(' *** MIGWD PRINT *** I=',I3,' LAT=',I3,' KDT=',I3) -!124 FORMAT(2X, 10E13.6) -! ENDIF -! ENDIF -! -! print *,' in GFS_GWD_generic_lm.f 18 =',A(ipt(1),idxzb(1)) -! &, B(ipt(1),idxzb(1)),me - RETURN - end subroutine GFS_GWD_generic_run -!> @} - -! -!> \section arg_table_GFS_GWD_generic_finalize Argument Table -!! - subroutine GFS_GWD_generic_finalize() - end subroutine GFS_GWD_generic_finalize - - end module GFS_GWD_generic - -!> This module contains the CCPP-compliant orographic gravity wave drag post -!! interstitial codes. - module GFS_GWD_generic_post - - contains - -!! \section arg_table_GFS_GWD_generic_post_init Argument Table -!! - subroutine GFS_GWD_generic_post_init() - end subroutine GFS_GWD_generic_post_init - -!! \section arg_table_GFS_GWD_generic_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|----------------------------------------------------------------------|--------------------------------------------------------------------------|-------|------|-----------|-----------|--------|----------| -!! | lssav | flag_diagnostics | flag for calculating diagnostic fields | flag | 0 | logical | | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for calculating 3-D diagnostic fields | flag | 0 | logical | | in | F | -!! | dtf | time_step_for_dynamics | dynamics time step | s | 0 | real | kind_phys | in | F | -!! | dusfcg | instantaneous_x_stress_due_to_gravity_wave_drag | zonal surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | in | F | -!! | dvsfcg | instantaneous_y_stress_due_to_gravity_wave_drag | meridional surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | in | F | -!! | dudt | tendency_of_x_wind_due_to_model_physics | zonal wind tendency due to model physics | m s-2 | 2 | real | kind_phys | in | F | -!! | dvdt | tendency_of_y_wind_due_to_model_physics | meridional wind tendency due to model physics | m s-2 | 2 | real | kind_phys | in | F | -!! | dtdt | tendency_of_air_temperature_due_to_model_physics | air temperature tendency due to model physics | K s-1 | 2 | real | kind_phys | in | F | -!! | dugwd | time_integral_of_x_stress_due_to_gravity_wave_drag | integral over time of zonal stress due to gravity wave drag | Pa s | 1 | real | kind_phys | inout | F | -!! | dvgwd | time_integral_of_y_stress_due_to_gravity_wave_drag | integral over time of meridional stress due to gravity wave drag | Pa s | 1 | real | kind_phys | inout | F | -!! | du3dt | cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag | cumulative change in zonal wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | -!! | dv3dt | cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag | cumulative change in meridional wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | -!! | dt3dt | cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag | cumulative change in temperature due to orographic gravity wave drag | K | 2 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine GFS_GWD_generic_post_run( & - & lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, dvdt, dtdt, & - & dugwd, dvgwd, du3dt, dv3dt, dt3dt, errmsg, errflg) - - use machine, only : kind_phys - implicit none - - logical, intent(in) :: lssav, ldiag3d - real(kind=kind_phys), intent(in) :: dtf - real(kind=kind_phys), intent(in) :: & - & dusfcg(:), dvsfcg(:), dudt(:,:), dvdt(:,:), dtdt(:,:) - - real(kind=kind_phys), intent(inout) :: & - & dugwd(:), dvgwd(:), du3dt(:,:), dv3dt(:,:), dt3dt(:,:) - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (lssav) then - dugwd(:) = dugwd(:) + dusfcg(:)*dtf - dvgwd(:) = dvgwd(:) + dvsfcg(:)*dtf - - if (ldiag3d) then - du3dt(:,:) = du3dt(:,:) + dudt(:,:) * dtf - dv3dt(:,:) = dv3dt(:,:) + dvdt(:,:) * dtf - dt3dt(:,:) = dt3dt(:,:) + dtdt(:,:) * dtf - endif - endif - - end subroutine GFS_GWD_generic_post_run - -!> \section arg_table_GFS_GWD_generic_post_finalize Argument Table -!! - subroutine GFS_GWD_generic_post_finalize() - end subroutine GFS_GWD_generic_post_finalize - - end module GFS_GWD_generic_post +end module GFS_GWD_generic_pre From 6c621fc50c4c7f9cd5c6010bcd84060fad7a2ff3 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Fri, 23 Aug 2019 08:56:24 -0600 Subject: [PATCH 65/89] physics/cires_ugwp.F90: formatting changes, correct wrong variable intents, replace constant imports with arguments, add missing kind_phys --- physics/cires_ugwp.F90 | 192 ++++++++++++++++++++--------------------- 1 file changed, 93 insertions(+), 99 deletions(-) diff --git a/physics/cires_ugwp.F90 b/physics/cires_ugwp.F90 index 322b4af8e..274782d83 100644 --- a/physics/cires_ugwp.F90 +++ b/physics/cires_ugwp.F90 @@ -4,22 +4,28 @@ !! Gravity waves (GWs): Mesoscale GWs transport momentum, energy (heat) , and create eddy mixing in the whole atmosphere domain; Breaking and dissipating GWs deposit: (a) momentum; (b) heat (energy); and create (c) turbulent mixing of momentum, heat, and tracers !! To properly incorporate GW effects (a-c) unresolved by DYCOREs we need GW physics !! "Unified": a) all GW effects due to both dissipation/breaking; b) identical GW solvers for all GW sources; c) ability to replace solvers. -!! Unified Formalism: +!! Unified Formalism: !! 1. GW Sources: Stochastic and physics based mechanisms for GW-excitations in the lower atmosphere, calibrated by the high-res analyses/forecasts, and observations (3 types of GW sources: orography, convection, fronts/jets). -!! 2. GW Propagation: Unified solver for “propagation, dissipation and breaking” excited from all type of GW sources. +!! 2. GW Propagation: Unified solver for “propagation, dissipation and breaking” excited from all type of GW sources. !! 3. GW Effects: Unified representation of GW impacts on the ‘resolved’ flow for all sources (energy-balanced schemes for momentum, heat and mixing). !! https://www.weather.gov/media/sti/nggps/Presentations%202017/02%20NGGPS_VYUDIN_2017_.pdf module cires_ugwp - use cires_ugwp_module, only: knob_ugwp_version, cires_ugwp_mod_init, cires_ugwp_mod_finalize!, GWDPS_V0, slat_geos5_tamp, fv3_ugwp_solv2_v0, edmix_ugwp_v0, diff_1d_wtend, diff_1d_ptend - + use machine, only: kind_phys + + use cires_ugwp_module, only: knob_ugwp_version, cires_ugwp_mod_init, cires_ugwp_mod_finalize implicit none + private + + public cires_ugwp_init, cires_ugwp_run, cires_ugwp_finalize + logical :: is_initialized = .False. contains + ! ------------------------------------------------------------------------ ! CCPP entry points for CIRES Unified Gravity Wave Physics (UGWP) scheme v0 ! ------------------------------------------------------------------------ @@ -34,15 +40,16 @@ module cires_ugwp !! | logunit | iounit_log | fortran unit number for writing logfile | none | 0 | integer | | in | F | !! | fn_nml2 | namelist_filename | namelist filename for ugwp | none | 0 | character | len=* | in | F | !! | lonr | number_of_equatorial_longitude_points | number of global points in x-dir (i) along the equator | count | 0 | integer | | in | F | -!! | latr | number_of_latitude_points | number of global points in y-dir (j) along the meridian | count | 0 | integer | | none | F | +!! | latr | number_of_latitude_points | number of global points in y-dir (j) along the meridian | count | 0 | integer | | in | F | !! | levs | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | ak | a_parameter_of_the_hybrid_coordinate | a parameter for sigma pressure level calculations | Pa | 0 | real | kind_phys | none | F | -!! | bk | b_parameter_of_the_hybrid_coordinate | b parameter for sigma pressure level calculations | none | 0 | real | kind_phys | none | F | +!! | ak | a_parameter_of_the_hybrid_coordinate | a parameter for sigma pressure level calculations | Pa | 1 | real | kind_phys | in | F | +!! | bk | b_parameter_of_the_hybrid_coordinate | b parameter for sigma pressure level calculations | none | 1 | real | kind_phys | in | F | !! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | !! | cdmvgwd | multiplication_factors_for_mountain_blocking_and_orographic_gravity_wave_drag | multiplication factors for cdmb and gwd | none | 1 | real | kind_phys | in | F | -!! | cgwf | multiplication_factors_for_convective_gravity_wave_drag | multiplication factor for convective GWD | none | 1 | real | kind_phys | in | F | -!! | pa_rf_in | pressure_cutoff_for_rayleigh_damping | pressure level from which Rayleigh Damping is applied | Pa | 0 | real | kind_phys | none | F | -!! | tau_rf_in | time_scale_for_rayleigh_damping | time scale for Rayleigh damping in days | d | 0 | real | kind_phys | none | F | +!! | cgwf | multiplication_factors_for_convective_gravity_wave_drag | multiplication factor for convective GWD | none | 1 | real | kind_phys | in | F | +!! | pa_rf_in | pressure_cutoff_for_rayleigh_damping | pressure level from which Rayleigh Damping is applied | Pa | 0 | real | kind_phys | in | F | +!! | tau_rf_in | time_scale_for_rayleigh_damping | time scale for Rayleigh damping in days | d | 0 | real | kind_phys | in | F | +!! | con_p0 | standard_atmospheric_pressure | standard atmospheric pressure | Pa | 0 | real | kind_phys | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! @@ -50,34 +57,31 @@ module cires_ugwp ! ----------------------------------------------------------------------- ! subroutine cires_ugwp_init (me, master, nlunit, logunit, fn_nml2, & - lonr, latr, levs, ak, bk, dtp, cdmvgwd, cgwf, & - pa_rf_in, tau_rf_in, errmsg, errflg) - - use physcons, only: con_p0 ! pref in VAY's code + lonr, latr, levs, ak, bk, dtp, cdmvgwd, cgwf, & + pa_rf_in, tau_rf_in, con_p0, errmsg, errflg) -!---- initialization of cires_ugwp +!---- initialization of cires_ugwp implicit none - - integer, intent (in) :: me - integer, intent (in) :: master - integer, intent (in) :: nlunit - integer, intent (in) :: logunit - integer, intent (in) :: lonr - integer, intent (in) :: levs - integer, intent (in) :: latr - real, intent(in), dimension(levs+1):: ak, bk - !real(kind=kind_phys), intent (in) :: ak(levs+1), bk(levs+1) - real, intent (in) :: dtp - real, intent (in) :: cdmvgwd(2), cgwf(2) ! "scaling" controls for "old" GFS-GW schemes - real, intent (in) :: pa_rf_in, tau_rf_in - - character(len=*), intent (in) :: fn_nml2 - !character(len=*), parameter :: fn_nml='input.nml' + integer, intent (in) :: me + integer, intent (in) :: master + integer, intent (in) :: nlunit + integer, intent (in) :: logunit + integer, intent (in) :: lonr + integer, intent (in) :: levs + integer, intent (in) :: latr + real(kind=kind_phys), intent (in) :: ak(:), bk(:) + real(kind=kind_phys), intent (in) :: dtp + real(kind=kind_phys), intent (in) :: cdmvgwd(:), cgwf(2) ! "scaling" controls for "old" GFS-GW schemes + real(kind=kind_phys), intent (in) :: pa_rf_in, tau_rf_in + real(kind=kind_phys), intent (in) :: con_p0 + + character(len=*), intent (in) :: fn_nml2 + !character(len=*), parameter :: fn_nml='input.nml' integer :: ios logical :: exists - real :: dxsg + real :: dxsg integer :: k character(len=*), intent(out) :: errmsg @@ -86,15 +90,12 @@ subroutine cires_ugwp_init (me, master, nlunit, logunit, fn_nml2, & ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - - if (is_initialized) return - - call cires_ugwp_mod_init (me, master, nlunit, logunit, fn_nml2, & - lonr, latr, levs, ak, bk, con_p0, dtp, cdmvgwd, cgwf, & - pa_rf_in, tau_rf_in) + call cires_ugwp_mod_init (me, master, nlunit, logunit, fn_nml2, & + lonr, latr, levs, ak, bk, con_p0, dtp, & + cdmvgwd, cgwf, pa_rf_in, tau_rf_in) if (.not.knob_ugwp_version==0) then write(errmsg,'(*(a))') 'Logic error: CCPP only supports version zero of UGWP' @@ -104,14 +105,11 @@ subroutine cires_ugwp_init (me, master, nlunit, logunit, fn_nml2, & is_initialized = .true. - end subroutine cires_ugwp_init - - ! ----------------------------------------------------------------------- -! finalize of cires_ugwp (_finalize) +! finalize of cires_ugwp (_finalize) ! ----------------------------------------------------------------------- !>@brief The subroutine finalizes the CIRES UGWP @@ -139,11 +137,8 @@ subroutine cires_ugwp_finalize(errmsg, errflg) call cires_ugwp_mod_finalize() is_initialized = .false. - - end subroutine cires_ugwp_finalize - - + end subroutine cires_ugwp_finalize ! ----------------------------------------------------------------------- @@ -159,7 +154,7 @@ end subroutine cires_ugwp_finalize !> \section arg_table_cires_ugwp_run Argument Table !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |------------------|--------------------------------------------------------------------------------|--------------------------------------------------------------|-----------|------|-----------|-----------|--------|----------| -!! | do_ugwp | do_ugwp | flag to activate CIRES UGWP | flag | 0 | logical | | none | F | +!! | do_ugwp | do_ugwp | flag to activate CIRES UGWP | flag | 0 | logical | | in | F | !! | me | mpi_rank | MPI rank of current process | index | 0 | integer | | in | F | !! | master | mpi_root | MPI rank of master process | index | 0 | integer | | in | F | !! | im | horizontal_loop_extent | horizontal | count | 0 | integer | | in | F | @@ -179,13 +174,13 @@ end subroutine cires_ugwp_finalize !! | sigma | slope_of_subgrid_orography | slope of subgrid orography | none | 1 | real | kind_phys | out | F | !! | gamma | anisotropy_of_subgrid_orography | anisotropy of subgrid orography | none | 1 | real | kind_phys | out | F | !! | elvmax | maximum_subgrid_orography | maximum of subgrid orography | m | 1 | real | kind_phys | out | F | -!! | do_tofd | turb_oro_form_drag_flag | flag for turbulent orographic form drag | flag | 0 | logical | | none | F | +!! | do_tofd | turb_oro_form_drag_flag | flag for turbulent orographic form drag | flag | 0 | logical | | in | F | !! | cdmbgwd | multiplication_factors_for_mountain_blocking_and_orographic_gravity_wave_drag | multiplication factors for cdmb and gwd | none | 1 | real | kind_phys | in | F | -!! | xlat | latitude | grid latitude in radians | radians | 1 | real | kind_phys | in | F | +!! | xlat | latitude | grid latitude in radians | radians | 1 | real | kind_phys | in | F | !! | xlat_d | latitude_degree | latitude in degrees | degree | 1 | real | kind_phys | in | F | !! | sinlat | sine_of_latitude | sine of the grid latitude | none | 1 | real | kind_phys | in | F | -!! | coslat | cosine_of_latitude | cosine of the grid latitude | none | 1 | real | kind_phys | in | F | -!! | area | cell_area | area of the grid cell | m2 | 1 | real | kind_phys | none | F | +!! | coslat | cosine_of_latitude | cosine of the grid latitude | none | 1 | real | kind_phys | in | F | +!! | area | cell_area | area of the grid cell | m2 | 1 | real | kind_phys | in | F | !! | ugrs | x_wind | zonal wind | m s-1 | 2 | real | kind_phys | in | F | !! | vgrs | y_wind | meridional wind | m s-1 | 2 | real | kind_phys | in | F | !! | tgrs | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | in | F | @@ -195,50 +190,52 @@ end subroutine cires_ugwp_finalize !! | prslk | dimensionless_exner_function_at_model_layers | dimensionless Exner function at model layer centers | none | 2 | real | kind_phys | in | F | !! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | !! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | air pressure difference between midlayers | Pa | 2 | real | kind_phys | none | F | +!! | del | air_pressure_difference_between_midlayers | air pressure difference between midlayers | Pa | 2 | real | kind_phys | in | F | !! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | vertical index at top atmospheric boundary layer | index | 1 | integer | | in | F | -!! | dusfcg | instantaneous_x_stress_due_to_gravity_wave_drag | zonal surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | none | F | -!! | dvsfcg | instantaneous_y_stress_due_to_gravity_wave_drag | meridional surface stress due to orographic gravity wave drag| Pa | 1 | real | kind_phys | none | F | -!! | gw_dudt | tendency_of_x_wind_due_to_ugwp | zonal wind tendency due to UGWP | m s-2 | 2 | real | kind_phys | none | F | -!! | gw_dvdt | tendency_of_y_wind_due_to_ugwp | meridional wind tendency due to UGWP | m s-2 | 2 | real | kind_phys | none | F | -!! | gw_dtdt | tendency_of_air_temperature_due_to_ugwp | air temperature tendency due to UGWP | K s-1 | 2 | real | kind_phys | none | F | -!! | gw_kdis | eddy_mixing_due_to_ugwp | eddy mixing due to UGWP | m2 s-1 | 2 | real | kind_phys | none | F | -!! | tau_tofd | instantaneous_momentum_flux_due_to_turbulent_orographic_form_drag | momentum flux or stress due to TOFD | Pa | 2 | real | kind_phys | none | F | -!! | tau_mtb | instantaneous_momentum_flux_due_to_mountain_blocking_drag | momentum flux or stress due to mountain blocking drag | Pa | 2 | real | kind_phys | none | F | -!! | tau_ogw | instantaneous_momentum_flux_due_to_orographic_gravity_wave_drag | momentum flux or stress due to orographic gravity wave drag | Pa | 2 | real | kind_phys | none | F | -!! | tau_ngw | instantaneous_momentum_flux_due_to_nonstationary_gravity_wave | momentum flux or stress due to nonstationary gravity waves | Pa | 2 | real | kind_phys | none | F | -!! | zmtb | height_of_mountain_blocking | height of mountain blocking drag | m | 1 | real | kind_phys | none | F | -!! | zlwb | height_of_low_level_wave_breaking | height of low level wave breaking | m | 1 | real | kind_phys | none | F | -!! | zogw | height_of_launch_level_of_orographic_gravity_wave | height of launch level of orographic gravity wave | m | 1 | real | kind_phys | none | F | -!! | dudt_mtb | instantaneous_change_in_x_wind_due_to_mountain_blocking_drag | instantaneous change in x wind due to mountain blocking drag | m s-2 | 2 | real | kind_phys | none | F | -!! | dudt_ogw | instantaneous_change_in_x_wind_due_to_orographic_gravity_wave_drag | instantaneous change in x wind due to orographic gw drag | m s-2 | 2 | real | kind_phys | none | F | -!! | dudt_tms | instantaneous_change_in_x_wind_due_to_turbulent_orographic_form_drag | instantaneous change in x wind due to TOFD | m s-2 | 2 | real | kind_phys | none | F | -!! | dudt | tendency_of_x_wind_due_to_model_physics | zonal wind tendency due to model physics | m s-2 | 2 | real | kind_phys | none | F | -!! | dvdt | tendency_of_y_wind_due_to_model_physics | meridional wind tendency due to model physics | m s-2 | 2 | real | kind_phys | none | F | -!! | dtdt | tendency_of_air_temperature_due_to_model_physics | air temperature tendency due to model physics | K s-1 | 2 | real | kind_phys | none | F | -!! | rdxzb | level_of_dividing_streamline | level of the dividing streamline | none | 1 | real | kind_phys | none | F | +!! | dusfcg | instantaneous_x_stress_due_to_gravity_wave_drag | zonal surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | out | F | +!! | dvsfcg | instantaneous_y_stress_due_to_gravity_wave_drag | meridional surface stress due to orographic gravity wave drag| Pa | 1 | real | kind_phys | out | F | +!! | gw_dudt | tendency_of_x_wind_due_to_ugwp | zonal wind tendency due to UGWP | m s-2 | 2 | real | kind_phys | out | F | +!! | gw_dvdt | tendency_of_y_wind_due_to_ugwp | meridional wind tendency due to UGWP | m s-2 | 2 | real | kind_phys | out | F | +!! | gw_dtdt | tendency_of_air_temperature_due_to_ugwp | air temperature tendency due to UGWP | K s-1 | 2 | real | kind_phys | out | F | +!! | gw_kdis | eddy_mixing_due_to_ugwp | eddy mixing due to UGWP | m2 s-1 | 2 | real | kind_phys | out | F | +!! | tau_tofd | instantaneous_momentum_flux_due_to_turbulent_orographic_form_drag | momentum flux or stress due to TOFD | Pa | 2 | real | kind_phys | out | F | +!! | tau_mtb | instantaneous_momentum_flux_due_to_mountain_blocking_drag | momentum flux or stress due to mountain blocking drag | Pa | 2 | real | kind_phys | out | F | +!! | tau_ogw | instantaneous_momentum_flux_due_to_orographic_gravity_wave_drag | momentum flux or stress due to orographic gravity wave drag | Pa | 2 | real | kind_phys | out | F | +!! | tau_ngw | instantaneous_momentum_flux_due_to_nonstationary_gravity_wave | momentum flux or stress due to nonstationary gravity waves | Pa | 2 | real | kind_phys | out | F | +!! | zmtb | height_of_mountain_blocking | height of mountain blocking drag | m | 1 | real | kind_phys | out | F | +!! | zlwb | height_of_low_level_wave_breaking | height of low level wave breaking | m | 1 | real | kind_phys | out | F | +!! | zogw | height_of_launch_level_of_orographic_gravity_wave | height of launch level of orographic gravity wave | m | 1 | real | kind_phys | out | F | +!! | dudt_mtb | instantaneous_change_in_x_wind_due_to_mountain_blocking_drag | instantaneous change in x wind due to mountain blocking drag | m s-2 | 2 | real | kind_phys | out | F | +!! | dudt_ogw | instantaneous_change_in_x_wind_due_to_orographic_gravity_wave_drag | instantaneous change in x wind due to orographic gw drag | m s-2 | 2 | real | kind_phys | out | F | +!! | dudt_tms | instantaneous_change_in_x_wind_due_to_turbulent_orographic_form_drag | instantaneous change in x wind due to TOFD | m s-2 | 2 | real | kind_phys | out | F | +!! | dudt | tendency_of_x_wind_due_to_model_physics | zonal wind tendency due to model physics | m s-2 | 2 | real | kind_phys | inout | F | +!! | dvdt | tendency_of_y_wind_due_to_model_physics | meridional wind tendency due to model physics | m s-2 | 2 | real | kind_phys | inout | F | +!! | dtdt | tendency_of_air_temperature_due_to_model_physics | air temperature tendency due to model physics | K s-1 | 2 | real | kind_phys | inout | F | +!! | rdxzb | level_of_dividing_streamline | level of the dividing streamline | none | 1 | real | kind_phys | out | F | +!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | +!! | con_pi | pi | ratio of a circle's circumference to its diameter | radians | 0 | real | kind_phys | in | F | +!! | con_cp | specific_heat_of_dry_air_at_constant_pressure | specific heat !of dry air at constant pressure | J kg-1 K-1| 0 | real | kind_phys | in | F | +!! | con_rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1| 0 | real | kind_phys | in | F | +!! | con_rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1| 0 | real | kind_phys | in | F | +!! | con_fvirt | ratio_of_vapor_to_dry_air_gas_constants_minus_one | rv/rd - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! #endif ! subroutines original - subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr, & - oro, oro_uf, hprime, nmtvr, oc, theta, sigma, gamma, elvmax, clx, oa4,& - do_tofd, cdmbgwd, xlat, xlat_d, sinlat, coslat, area, & - ugrs, vgrs, tgrs, qgrs, prsi, prsl, prslk, phii, phil, & - del, kpbl, dusfcg, dvsfcg, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, & - tau_tofd, tau_mtb, tau_ogw, tau_ngw, zmtb, zlwb, zogw, & - dudt_mtb,dudt_ogw, dudt_tms, dudt, dvdt, dtdt, rdxzb, & - errmsg, errflg) - - - use machine, only: kind_phys - use physcons, only: con_g, con_pi, con_cp, con_rd, con_rv, con_fvirt + subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr, & + oro, oro_uf, hprime, nmtvr, oc, theta, sigma, gamma, elvmax, clx, oa4, & + do_tofd, cdmbgwd, xlat, xlat_d, sinlat, coslat, area, & + ugrs, vgrs, tgrs, qgrs, prsi, prsl, prslk, phii, phil, & + del, kpbl, dusfcg, dvsfcg, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, & + tau_tofd, tau_mtb, tau_ogw, tau_ngw, zmtb, zlwb, zogw, & + dudt_mtb,dudt_ogw, dudt_tms, dudt, dvdt, dtdt, rdxzb, & + con_g, con_pi, con_cp, con_rd, con_rv, con_fvirt, errmsg, errflg) implicit none - ! interface variables + ! interface variables integer, intent(in) :: me, master, im, levs, ntrac, kdt, lonr, nmtvr integer, intent(in), dimension(im) :: kpbl real(kind=kind_phys), intent(in), dimension(im) :: oro, oro_uf, hprime, oc, theta, sigma, gamma, elvmax @@ -250,7 +247,7 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr real(kind=kind_phys), intent(in) :: dtp, cdmbgwd(2) logical, intent(in) :: do_ugwp, do_tofd - real(kind=kind_phys), intent(out), dimension(im) :: dusfcg, dvsfcg + real(kind=kind_phys), intent(out), dimension(im) :: dusfcg, dvsfcg real(kind=kind_phys), intent(out), dimension(im) :: zmtb, zlwb, zogw, rdxzb real(kind=kind_phys), intent(out), dimension(im) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw real(kind=kind_phys), intent(out), dimension(im, levs):: gw_dudt, gw_dvdt, gw_dtdt, gw_kdis @@ -258,10 +255,11 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr real(kind=kind_phys), intent(inout), dimension(im, levs):: dudt, dvdt, dtdt + real(kind=kind_phys), intent(in) :: con_g, con_pi, con_cp, con_rd, con_rv, con_fvirt + character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - ! local variables integer :: i, k real(kind=kind_phys), dimension(im) :: sgh30 @@ -273,17 +271,16 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr ! switches that activate impact of OGWs and NGWs (WL* how to deal with them? *WL) real(kind=kind_phys), parameter :: pogw=1., pngw=1., pked=1. - ! Initialize CCPP error handling variables errmsg = '' errflg = 0 ! wrap everything in a do_ugwp 'if test' in order not to break the namelist functionality - IF (do_ugwp) THEN + if (do_ugwp) then ! topo paras ! w/ orographic effects - if(nmtvr == 14)then + if(nmtvr == 14)then ! calculate sgh30 for TOFD sgh30 = abs(oro - oro_uf) ! w/o orographic effects @@ -308,7 +305,7 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr call fv3_ugwp_solv2_v0(im, levs, dtp, tgrs, ugrs, vgrs,qgrs(:,:,1), & prsl, prsi, phil, xlat_d, sinlat, coslat, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, & tau_ngw, me, master, kdt) - + if(pogw /= 0.)then do k=1,levs @@ -321,16 +318,16 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr ! accumulation of tendencies for CCPP to replicate EMC-physics updates (!! removed in latest code commit to VLAB) dudt(i,k) = dudt(i,k) +gw_dudt(i,k) dvdt(i,k) = dvdt(i,k) +gw_dvdt(i,k) - dtdt(i,k) = dtdt(i,k) +gw_dtdt(i,k) + dtdt(i,k) = dtdt(i,k) +gw_dtdt(i,k) enddo enddo else tau_mtb = 0. ; tau_ogw =0.; tau_tofd =0. - dudt_mtb =0. ; dudt_ogw = 0.; dudt_tms=0. + dudt_mtb =0. ; dudt_ogw = 0.; dudt_tms=0. - endif + endif return @@ -342,7 +339,7 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr ! 3) application of "eddy"-diffusion to "smooth" UGWP-related tendencies !------------------------------------------------------------------------------ ed_dudt(:,:) =0.; ed_dvdt(:,:) = 0. ; ed_dtdt(:,:) = 0. - + call edmix_ugwp_v0(im, levs, dtp, tgrs, ugrs, vgrs, qgrs(:,:,1), & del, prsl, prsi, phil, prslk, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, & ed_dudt, ed_dvdt, ed_dtdt, me, master, kdt) @@ -352,12 +349,9 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr - ENDIF ! do_ugwp - + endif ! do_ugwp end subroutine cires_ugwp_run - - end module cires_ugwp From e1c3047379109b60121855749cb6b52c277fab10 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Fri, 23 Aug 2019 08:57:33 -0600 Subject: [PATCH 66/89] physics/cires_ugwp_post.F90: formatting changes --- physics/cires_ugwp_post.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/cires_ugwp_post.F90 b/physics/cires_ugwp_post.F90 index 7d106235d..4a88574e6 100755 --- a/physics/cires_ugwp_post.F90 +++ b/physics/cires_ugwp_post.F90 @@ -49,7 +49,7 @@ end subroutine cires_ugwp_post_init #endif - subroutine cires_ugwp_post_run (ldiag_ugwp, dtf, im, levs, & + subroutine cires_ugwp_post_run (ldiag_ugwp, dtf, im, levs, & gw_dudt, tau_tofd, tau_mtb, tau_ogw, tau_ngw, & zmtb, zlwb, zogw, dudt_mtb, dudt_ogw, dudt_tms, & tot_zmtb, tot_zlwb, tot_zogw, & From 04fd8cb25e2c8b34d6af07607cbabae36481c0e8 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Fri, 23 Aug 2019 08:58:10 -0600 Subject: [PATCH 67/89] physics/docs/pdftxt/*.txt: rename gwdps_pre to GFS_GWD_generic_pre --- physics/docs/pdftxt/CPT_adv_suite.txt | 2 +- physics/docs/pdftxt/GFSv14_suite.txt | 2 +- physics/docs/pdftxt/GFSv15_suite.txt | 2 +- physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt | 2 +- physics/docs/pdftxt/GSD_adv_suite.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/physics/docs/pdftxt/CPT_adv_suite.txt b/physics/docs/pdftxt/CPT_adv_suite.txt index 7617d9df3..132d8bd11 100644 --- a/physics/docs/pdftxt/CPT_adv_suite.txt +++ b/physics/docs/pdftxt/CPT_adv_suite.txt @@ -82,7 +82,7 @@ The advanced csawmg physics suite uses the parameterizations in the following or GFS_PBL_generic_pre hedmf GFS_PBL_generic_post - gwdps_pre + GFS_GWD_generic_pre gwdps gwdps_post rayleigh_damp diff --git a/physics/docs/pdftxt/GFSv14_suite.txt b/physics/docs/pdftxt/GFSv14_suite.txt index 25e03e7fd..23f611a25 100644 --- a/physics/docs/pdftxt/GFSv14_suite.txt +++ b/physics/docs/pdftxt/GFSv14_suite.txt @@ -82,7 +82,7 @@ The GFS v14 suite uses the parameterizations in the following order, as defined GFS_PBL_generic_pre hedmf GFS_PBL_generic_post - gwdps_pre + GFS_GWD_generic_pre gwdps gwdps_post rayleigh_damp diff --git a/physics/docs/pdftxt/GFSv15_suite.txt b/physics/docs/pdftxt/GFSv15_suite.txt index 82545bbff..6b5fddcf8 100644 --- a/physics/docs/pdftxt/GFSv15_suite.txt +++ b/physics/docs/pdftxt/GFSv15_suite.txt @@ -92,7 +92,7 @@ The GFS v15 suite uses the parameterizations in the following order, as defined GFS_PBL_generic_pre hedmf GFS_PBL_generic_post - gwdps_pre + GFS_GWD_generic_pre gwdps gwdps_post rayleigh_damp diff --git a/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt b/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt index e844f0206..56a1f97f5 100644 --- a/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt +++ b/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt @@ -83,7 +83,7 @@ The GFS v15plus suite uses the parameterizations in the following order, as defi GFS_PBL_generic_pre satmedmfvdif GFS_PBL_generic_post - gwdps_pre + GFS_GWD_generic_pre gwdps gwdps_post rayleigh_damp diff --git a/physics/docs/pdftxt/GSD_adv_suite.txt b/physics/docs/pdftxt/GSD_adv_suite.txt index 0db91ede1..995297a08 100644 --- a/physics/docs/pdftxt/GSD_adv_suite.txt +++ b/physics/docs/pdftxt/GSD_adv_suite.txt @@ -95,7 +95,7 @@ The GSD RAP/HRRR physics suite uses the parameterizations in the following order sfc_diag_post GFS_surface_generic_post mynnedmf_wrapper - gwdps_pre + GFS_GWD_generic_pre gwdps gwdps_post rayleigh_damp From 57aa69f31d6544fa0c6be1669070599cad81f91b Mon Sep 17 00:00:00 2001 From: climbfuji Date: Fri, 23 Aug 2019 09:05:02 -0600 Subject: [PATCH 68/89] physics/gwdps.f: remove module gwdps_pre, now GFS_GWD_generic_pre in GFS_GWD_generic.F90 --- physics/gwdps.f | 139 ------------------------------------------------ 1 file changed, 139 deletions(-) diff --git a/physics/gwdps.f b/physics/gwdps.f index d98573dcc..f2f5f218f 100644 --- a/physics/gwdps.f +++ b/physics/gwdps.f @@ -2,145 +2,6 @@ !! This file is the parameterization of orographic gravity wave !! drag and mountain blocking. -!> This module contains the CCPP-compliant orographic gravity wave -!! drag pre interstitial codes. - module gwdps_pre - - contains - -!> \section arg_table_gwdps_pre_init Argument Table -!! - subroutine gwdps_pre_init() - end subroutine gwdps_pre_init - -!! \section arg_table_gwdps_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-------------------------------------------------------------------------|------------------------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal dimension | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | nmtvr | number_of_statistical_measures_of_subgrid_orography | number of statistical measures of subgrid orography | count | 0 | integer | | in | F | -!! | mntvar | statistical_measures_of_subgrid_orography | array of statistical measures of subgrid orography | various | 2 | real | kind_phys | in | F | -!! | hprime | standard_deviation_of_subgrid_orography | standard deviation of subgrid orography | m | 1 | real | kind_phys | out | F | -!! | oc | convexity_of_subgrid_orography | convexity of subgrid orography | none | 1 | real | kind_phys | out | F | -!! | oa4 | asymmetry_of_subgrid_orography | asymmetry of subgrid orography | none | 2 | real | kind_phys | out | F | -!! | clx | fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height | horizontal fraction of grid box covered by subgrid orography higher than critical height | frac | 2 | real | kind_phys | out | F | -!! | theta | angle_from_east_of_maximum_subgrid_orographic_variations | angle with_respect to east of maximum subgrid orographic variations | degrees | 1 | real | kind_phys | out | F | -!! | sigma | slope_of_subgrid_orography | slope of subgrid orography | none | 1 | real | kind_phys | out | F | -!! | gamma | anisotropy_of_subgrid_orography | anisotropy of subgrid orography | none | 1 | real | kind_phys | out | F | -!! | elvmax | maximum_subgrid_orography | maximum of subgrid orography | m | 1 | real | kind_phys | out | F | -!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | -!! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | in | F | -!! | dt3dt | cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag | cumulative change in temperature due to orographic gravity wave drag | K | 2 | real | kind_phys | inout | F | -!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! -!! \section general General Algorithm -!! \section detailed Detailed Algorithm -!! @{ - subroutine gwdps_pre_run( & - & im, levs, nmtvr, mntvar, & - & hprime, oc, oa4, clx, theta, & - & sigma, gamma, elvmax, lssav, ldiag3d, & - & dtdt, dt3dt, dtf, errmsg, errflg) - - use machine, only : kind_phys - implicit none - - integer, intent(in) :: im, levs, nmtvr - real(kind=kind_phys), intent(in) :: mntvar(im,nmtvr) - - real(kind=kind_phys), intent(out) :: & - & hprime(im), oc(im), oa4(im,4), clx(im,4), & - & theta(im), sigma(im), gamma(im), elvmax(im) & - - logical, intent(in) :: lssav, ldiag3d - real(kind=kind_phys), intent(in) :: dtdt(im,levs) - ! dt3dt only allocated only if ldiag3d is .true. - real(kind=kind_phys), intent(inout) :: dt3dt(:,:) - real(kind=kind_phys), intent(in) :: dtf - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - integer :: i, k - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (nmtvr == 14) then ! current operational - as of 2014 - hprime(:) = mntvar(:,1) - oc(:) = mntvar(:,2) - oa4(:,1) = mntvar(:,3) - oa4(:,2) = mntvar(:,4) - oa4(:,3) = mntvar(:,5) - oa4(:,4) = mntvar(:,6) - clx(:,1) = mntvar(:,7) - clx(:,2) = mntvar(:,8) - clx(:,3) = mntvar(:,9) - clx(:,4) = mntvar(:,10) - theta(:) = mntvar(:,11) - gamma(:) = mntvar(:,12) - sigma(:) = mntvar(:,13) - elvmax(:) = mntvar(:,14) - elseif (nmtvr == 10) then - hprime(:) = mntvar(:,1) - oc(:) = mntvar(:,2) - oa4(:,1) = mntvar(:,3) - oa4(:,2) = mntvar(:,4) - oa4(:,3) = mntvar(:,5) - oa4(:,4) = mntvar(:,6) - clx(:,1) = mntvar(:,7) - clx(:,2) = mntvar(:,8) - clx(:,3) = mntvar(:,9) - clx(:,4) = mntvar(:,10) - elseif (nmtvr == 6) then - hprime(:) = mntvar(:,1) - oc(:) = mntvar(:,2) - oa4(:,1) = mntvar(:,3) - oa4(:,2) = mntvar(:,4) - oa4(:,3) = mntvar(:,5) - oa4(:,4) = mntvar(:,6) - clx(:,1) = 0.0 - clx(:,2) = 0.0 - clx(:,3) = 0.0 - clx(:,4) = 0.0 - else - hprime = 0 - oc = 0 - oa4 = 0 - clx = 0 - theta = 0 - gamma = 0 - sigma = 0 - elvmax = 0 - endif ! end if_nmtvr - - if (lssav) then - if (ldiag3d) then - do k=1,levs - do i=1,im - dt3dt(i,k) = dt3dt(i,k) - dtdt(i,k)*dtf - enddo - enddo - endif - endif - - end subroutine gwdps_pre_run -!> @} - -! \ingroup GFS_ogwd -! \brief Brief description of the subroutine -! -!> \section arg_table_gwdps_pre_finalize Argument Table -!! - subroutine gwdps_pre_finalize() - end subroutine gwdps_pre_finalize - - end module gwdps_pre - !> This module contains the CCPP-compliant orographic gravity wave dray scheme. module gwdps From 2a39566051693dac5d592f0cc9a800dd54abf4dd Mon Sep 17 00:00:00 2001 From: climbfuji Date: Fri, 23 Aug 2019 11:58:26 -0600 Subject: [PATCH 69/89] physics/cires_ugwp.F90, physics/cires_ugwp_post.F90: correct metadata and variable intents --- physics/cires_ugwp.F90 | 26 ++++++++-------- physics/cires_ugwp_post.F90 | 60 ++++++++++++++++++------------------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/physics/cires_ugwp.F90 b/physics/cires_ugwp.F90 index 274782d83..226a83f02 100644 --- a/physics/cires_ugwp.F90 +++ b/physics/cires_ugwp.F90 @@ -72,7 +72,7 @@ subroutine cires_ugwp_init (me, master, nlunit, logunit, fn_nml2, & integer, intent (in) :: latr real(kind=kind_phys), intent (in) :: ak(:), bk(:) real(kind=kind_phys), intent (in) :: dtp - real(kind=kind_phys), intent (in) :: cdmvgwd(:), cgwf(2) ! "scaling" controls for "old" GFS-GW schemes + real(kind=kind_phys), intent (in) :: cdmvgwd(2), cgwf(2) ! "scaling" controls for "old" GFS-GW schemes real(kind=kind_phys), intent (in) :: pa_rf_in, tau_rf_in real(kind=kind_phys), intent (in) :: con_p0 @@ -165,15 +165,15 @@ end subroutine cires_ugwp_finalize !! | lonr | number_of_equatorial_longitude_points | number of global points in x-dir (i) along the equator | count | 0 | integer | | in | F | !! | oro | orography | orography | m | 1 | real | kind_phys | in | F | !! | oro_uf | orography_unfiltered | unfiltered orography | m | 1 | real | kind_phys | in | F | -!! | hprime | standard_deviation_of_subgrid_orography | standard deviation of subgrid orography | m | 1 | real | kind_phys | out | F | +!! | hprime | standard_deviation_of_subgrid_orography | standard deviation of subgrid orography | m | 1 | real | kind_phys | in | F | !! | nmtvr | number_of_statistical_measures_of_subgrid_orography | number of topographic variables in GWD | count | 0 | integer | | in | F | -!! | oc | convexity_of_subgrid_orography | convexity of subgrid orography | none | 1 | real | kind_phys | out | F | -!! | oa4 | asymmetry_of_subgrid_orography | asymmetry of subgrid orography | none | 2 | real | kind_phys | out | F | -!! | clx | fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height | horizontal fraction of grid box covered by subgrid orography higher than critical height | frac | 2 | real | kind_phys | out | F | -!! | theta | angle_from_east_of_maximum_subgrid_orographic_variations | angle with_respect to east of maximum subgrid orographic variations | degrees | 1 | real | kind_phys | out | F | -!! | sigma | slope_of_subgrid_orography | slope of subgrid orography | none | 1 | real | kind_phys | out | F | -!! | gamma | anisotropy_of_subgrid_orography | anisotropy of subgrid orography | none | 1 | real | kind_phys | out | F | -!! | elvmax | maximum_subgrid_orography | maximum of subgrid orography | m | 1 | real | kind_phys | out | F | +!! | oc | convexity_of_subgrid_orography | convexity of subgrid orography | none | 1 | real | kind_phys | in | F | +!! | oa4 | asymmetry_of_subgrid_orography | asymmetry of subgrid orography | none | 2 | real | kind_phys | in | F | +!! | clx | fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height | horizontal fraction of grid box covered by subgrid orography higher than critical height | frac | 2 | real | kind_phys | in | F | +!! | theta | angle_from_east_of_maximum_subgrid_orographic_variations | angle with_respect to east of maximum subgrid orographic variations | degrees | 1 | real | kind_phys | in | F | +!! | sigma | slope_of_subgrid_orography | slope of subgrid orography | none | 1 | real | kind_phys | in | F | +!! | gamma | anisotropy_of_subgrid_orography | anisotropy of subgrid orography | none | 1 | real | kind_phys | in | F | +!! | elvmax | maximum_subgrid_orography | maximum of subgrid orography | m | 1 | real | kind_phys | in | F | !! | do_tofd | turb_oro_form_drag_flag | flag for turbulent orographic form drag | flag | 0 | logical | | in | F | !! | cdmbgwd | multiplication_factors_for_mountain_blocking_and_orographic_gravity_wave_drag | multiplication factors for cdmb and gwd | none | 1 | real | kind_phys | in | F | !! | xlat | latitude | grid latitude in radians | radians | 1 | real | kind_phys | in | F | @@ -198,10 +198,10 @@ end subroutine cires_ugwp_finalize !! | gw_dvdt | tendency_of_y_wind_due_to_ugwp | meridional wind tendency due to UGWP | m s-2 | 2 | real | kind_phys | out | F | !! | gw_dtdt | tendency_of_air_temperature_due_to_ugwp | air temperature tendency due to UGWP | K s-1 | 2 | real | kind_phys | out | F | !! | gw_kdis | eddy_mixing_due_to_ugwp | eddy mixing due to UGWP | m2 s-1 | 2 | real | kind_phys | out | F | -!! | tau_tofd | instantaneous_momentum_flux_due_to_turbulent_orographic_form_drag | momentum flux or stress due to TOFD | Pa | 2 | real | kind_phys | out | F | -!! | tau_mtb | instantaneous_momentum_flux_due_to_mountain_blocking_drag | momentum flux or stress due to mountain blocking drag | Pa | 2 | real | kind_phys | out | F | -!! | tau_ogw | instantaneous_momentum_flux_due_to_orographic_gravity_wave_drag | momentum flux or stress due to orographic gravity wave drag | Pa | 2 | real | kind_phys | out | F | -!! | tau_ngw | instantaneous_momentum_flux_due_to_nonstationary_gravity_wave | momentum flux or stress due to nonstationary gravity waves | Pa | 2 | real | kind_phys | out | F | +!! | tau_tofd | instantaneous_momentum_flux_due_to_turbulent_orographic_form_drag | momentum flux or stress due to TOFD | Pa | 1 | real | kind_phys | out | F | +!! | tau_mtb | instantaneous_momentum_flux_due_to_mountain_blocking_drag | momentum flux or stress due to mountain blocking drag | Pa | 1 | real | kind_phys | out | F | +!! | tau_ogw | instantaneous_momentum_flux_due_to_orographic_gravity_wave_drag | momentum flux or stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | out | F | +!! | tau_ngw | instantaneous_momentum_flux_due_to_nonstationary_gravity_wave | momentum flux or stress due to nonstationary gravity waves | Pa | 1 | real | kind_phys | out | F | !! | zmtb | height_of_mountain_blocking | height of mountain blocking drag | m | 1 | real | kind_phys | out | F | !! | zlwb | height_of_low_level_wave_breaking | height of low level wave breaking | m | 1 | real | kind_phys | out | F | !! | zogw | height_of_launch_level_of_orographic_gravity_wave | height of launch level of orographic gravity wave | m | 1 | real | kind_phys | out | F | diff --git a/physics/cires_ugwp_post.F90 b/physics/cires_ugwp_post.F90 index 4a88574e6..8393dd8d2 100755 --- a/physics/cires_ugwp_post.F90 +++ b/physics/cires_ugwp_post.F90 @@ -17,32 +17,32 @@ end subroutine cires_ugwp_post_init !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |------------------|--------------------------------------------------------------------------------|------------------------------------------------------------------------|-----------|------|-----------|-----------|--------|----------| !! | ldiag_ugwp | diag_ugwp_flag | flag for CIRES UGWP Diagnostics | flag | 0 | logical | | in | F | -!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | none | F | +!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | !! | levs | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | gw_dudt | tendency_of_x_wind_due_to_ugwp | zonal wind tendency due to UGWP | m s-2 | 2 | real | kind_phys | none | F | -!! | tau_tofd | instantaneous_momentum_flux_due_to_turbulent_orographic_form_drag | momentum flux or stress due to TOFD | Pa | 2 | real | kind_phys | none | F | -!! | tau_mtb | instantaneous_momentum_flux_due_to_mountain_blocking_drag | momentum flux or stress due to mountain blocking drag | Pa | 2 | real | kind_phys | none | F | -!! | tau_ogw | instantaneous_momentum_flux_due_to_orographic_gravity_wave_drag | momentum flux or stress due to orographic gravity wave drag | Pa | 2 | real | kind_phys | none | F | -!! | tau_ngw | instantaneous_momentum_flux_due_to_nonstationary_gravity_wave | momentum flux or stress due to nonstationary gravity waves | Pa | 2 | real | kind_phys | none | F | -!! | zmtb | height_of_mountain_blocking | height of mountain blocking drag | m | 1 | real | kind_phys | none | F | -!! | zlwb | height_of_low_level_wave_breaking | height of low level wave breaking | m | 1 | real | kind_phys | none | F | -!! | zogw | height_of_launch_level_of_orographic_gravity_wave | height of launch level of orographic gravity wave | m | 1 | real | kind_phys | none | F | -!! | dudt_mtb | instantaneous_change_in_x_wind_due_to_mountain_blocking_drag | instantaneous change in x wind due to mountain blocking drag | m s-2 | 2 | real | kind_phys | none | F | -!! | dudt_ogw | instantaneous_change_in_x_wind_due_to_orographic_gravity_wave_drag | instantaneous change in x wind due to orographic gw drag | m s-2 | 2 | real | kind_phys | none | F | -!! | dudt_tms | instantaneous_change_in_x_wind_due_to_turbulent_orographic_form_drag | instantaneous change in x wind due to TOFD | m s-2 | 2 | real | kind_phys | none | F | -!! | cnvgwd | flag_convective_gravity_wave_drag | flag for conv gravity wave drag | flag | 0 | logical | | in | F | -!! | tot_zmtb | time_integral_of_height_of_mountain_blocking | time integral of height of mountain blocking drag | m | 1 | real | kind_phys | none | F | -!! | tot_zlwb | time_integral_of_height_of_low_level_wave_breaking | time integral of height of drag due to low level wave breaking | m | 1 | real | kind_phys | none | F | -!! | tot_zogw | time_integral_of_height_of_launch_level_of_orographic_gravity_wave | time integral of height of launch level of orographic gravity wave | m | 1 | real | kind_phys | none | F | -!! | tot_tofd | time_integral_of_momentum_flux_due_to_turbulent_orographic_form_drag | time integral of momentum flux due to TOFD | Pa | 2 | real | kind_phys | none | F | -!! | tot_mtb | time_integral_of_momentum_flux_due_to_mountain_blocking_drag | time integral of momentum flux due to mountain blocking drag | Pa | 2 | real | kind_phys | none | F | -!! | tot_ogw | time_integral_of_momentum_flux_due_to_orographic_gravity_wave_drag | time integral of momentum flux due to orographic gravity wave drag | Pa | 2 | real | kind_phys | none | F | -!! | tot_ngw | time_integral_of_momentum_flux_due_to_nonstationary_gravity_wave | time integral of momentum flux due to nonstationary gravity waves | Pa | 2 | real | kind_phys | none | F | -!! | du3dt_mtb | time_integral_of_change_in_x_wind_due_to_mountain_blocking_drag | time integral of change in x wind due to mountain blocking drag | m s-2 | 2 | real | kind_phys | none | F | -!! | du3dt_ogw | time_integral_of_change_in_x_wind_due_to_orographic_gravity_wave_drag | time integral of change in x wind due to orographic gw drag | m s-2 | 2 | real | kind_phys | none | F | -!! | du3dt_tms | time_integral_of_change_in_x_wind_due_to_turbulent_orographic_form_drag | time integral of change in x wind due to TOFD | m s-2 | 2 | real | kind_phys | none | F | -!! | du3dt_ngw | time_integral_of_change_in_x_wind_due_to_nonstationary_gravity_wave | time integral of change in x wind due to NGW | m s-2 | 2 | real | kind_phys | none | F | +!! | gw_dudt | tendency_of_x_wind_due_to_ugwp | zonal wind tendency due to UGWP | m s-2 | 2 | real | kind_phys | in | F | +!! | tau_tofd | instantaneous_momentum_flux_due_to_turbulent_orographic_form_drag | momentum flux or stress due to TOFD | Pa | 1 | real | kind_phys | in | F | +!! | tau_mtb | instantaneous_momentum_flux_due_to_mountain_blocking_drag | momentum flux or stress due to mountain blocking drag | Pa | 1 | real | kind_phys | in | F | +!! | tau_ogw | instantaneous_momentum_flux_due_to_orographic_gravity_wave_drag | momentum flux or stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | in | F | +!! | tau_ngw | instantaneous_momentum_flux_due_to_nonstationary_gravity_wave | momentum flux or stress due to nonstationary gravity waves | Pa | 1 | real | kind_phys | in | F | +!! | zmtb | height_of_mountain_blocking | height of mountain blocking drag | m | 1 | real | kind_phys | in | F | +!! | zlwb | height_of_low_level_wave_breaking | height of low level wave breaking | m | 1 | real | kind_phys | in | F | +!! | zogw | height_of_launch_level_of_orographic_gravity_wave | height of launch level of orographic gravity wave | m | 1 | real | kind_phys | in | F | +!! | dudt_mtb | instantaneous_change_in_x_wind_due_to_mountain_blocking_drag | instantaneous change in x wind due to mountain blocking drag | m s-2 | 2 | real | kind_phys | in | F | +!! | dudt_ogw | instantaneous_change_in_x_wind_due_to_orographic_gravity_wave_drag | instantaneous change in x wind due to orographic gw drag | m s-2 | 2 | real | kind_phys | in | F | +!! | dudt_tms | instantaneous_change_in_x_wind_due_to_turbulent_orographic_form_drag | instantaneous change in x wind due to TOFD | m s-2 | 2 | real | kind_phys | in | F | +!! | cnvgwd | flag_convective_gravity_wave_drag | flag for conv gravity wave drag | flag | 0 | logical | | inout | F | +!! | tot_zmtb | time_integral_of_height_of_mountain_blocking | time integral of height of mountain blocking drag | m | 1 | real | kind_phys | inout | F | +!! | tot_zlwb | time_integral_of_height_of_low_level_wave_breaking | time integral of height of drag due to low level wave breaking | m | 1 | real | kind_phys | inout | F | +!! | tot_zogw | time_integral_of_height_of_launch_level_of_orographic_gravity_wave | time integral of height of launch level of orographic gravity wave | m | 1 | real | kind_phys | inout | F | +!! | tot_tofd | time_integral_of_momentum_flux_due_to_turbulent_orographic_form_drag | time integral of momentum flux due to TOFD | Pa | 1 | real | kind_phys | inout | F | +!! | tot_mtb | time_integral_of_momentum_flux_due_to_mountain_blocking_drag | time integral of momentum flux due to mountain blocking drag | Pa | 1 | real | kind_phys | inout | F | +!! | tot_ogw | time_integral_of_momentum_flux_due_to_orographic_gravity_wave_drag | time integral of momentum flux due to orographic gravity wave drag | Pa | 1 | real | kind_phys | inout | F | +!! | tot_ngw | time_integral_of_momentum_flux_due_to_nonstationary_gravity_wave | time integral of momentum flux due to nonstationary gravity waves | Pa | 1 | real | kind_phys | inout | F | +!! | du3dt_mtb | time_integral_of_change_in_x_wind_due_to_mountain_blocking_drag | time integral of change in x wind due to mountain blocking drag | m s-2 | 2 | real | kind_phys | inout | F | +!! | du3dt_ogw | time_integral_of_change_in_x_wind_due_to_orographic_gravity_wave_drag | time integral of change in x wind due to orographic gw drag | m s-2 | 2 | real | kind_phys | inout | F | +!! | du3dt_tms | time_integral_of_change_in_x_wind_due_to_turbulent_orographic_form_drag | time integral of change in x wind due to TOFD | m s-2 | 2 | real | kind_phys | inout | F | +!! | du3dt_ngw | time_integral_of_change_in_x_wind_due_to_nonstationary_gravity_wave | time integral of change in x wind due to NGW | m s-2 | 2 | real | kind_phys | inout | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! @@ -67,12 +67,12 @@ subroutine cires_ugwp_post_run (ldiag_ugwp, dtf, im, levs, & logical, intent(in) :: ldiag_ugwp !< flag for CIRES UGWP Diagnostics logical, intent(inout) :: cnvgwd !< flag to turn on/off convective gwd - real(kind=kind_phys), intent(in), dimension(im) :: zmtb, zlwb, zogw - real(kind=kind_phys), intent(in), dimension(im) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw - real(kind=kind_phys), intent(out), dimension(im) :: tot_mtb, tot_ogw, tot_tofd, tot_ngw - real(kind=kind_phys), intent(out), dimension(im) :: tot_zmtb, tot_zlwb, tot_zogw - real(kind=kind_phys), intent(in), dimension(im, levs) :: gw_dudt, dudt_mtb, dudt_ogw, dudt_tms - real(kind=kind_phys), intent(out), dimension(im, levs) :: du3dt_mtb, du3dt_ogw, du3dt_tms, du3dt_ngw + real(kind=kind_phys), intent(in), dimension(im) :: zmtb, zlwb, zogw + real(kind=kind_phys), intent(in), dimension(im) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw + real(kind=kind_phys), intent(inout), dimension(im) :: tot_mtb, tot_ogw, tot_tofd, tot_ngw + real(kind=kind_phys), intent(inout), dimension(im) :: tot_zmtb, tot_zlwb, tot_zogw + real(kind=kind_phys), intent(in), dimension(im, levs) :: gw_dudt, dudt_mtb, dudt_ogw, dudt_tms + real(kind=kind_phys), intent(inout), dimension(im, levs) :: du3dt_mtb, du3dt_ogw, du3dt_tms, du3dt_ngw character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg From 9b56b9007c4262b2087eb659eb62c168da061386 Mon Sep 17 00:00:00 2001 From: "Linlin.Pan" Date: Tue, 27 Aug 2019 16:33:34 +0000 Subject: [PATCH 70/89] adding coupling option to CCPP modified sfc_cice.f --- physics/sfc_cice.f | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/physics/sfc_cice.f b/physics/sfc_cice.f index d5a18c94c..eb66b28ce 100644 --- a/physics/sfc_cice.f +++ b/physics/sfc_cice.f @@ -65,7 +65,6 @@ end subroutine sfc_cice_finalize !! use physcons, only : hvap => con_hvap, cp => con_cp, & !! & rvrdm1 => con_fvirt, rd => con_rd - contains ! !----------------------------------- subroutine sfc_cice_run & @@ -120,11 +119,6 @@ subroutine sfc_cice_run & real (kind=kind_phys), intent(in) :: hvap, cp, rvrdm1, rd -!- constant parameters: - real(kind=kind_phys), parameter :: cpinv = 1.0/cp - real(kind=kind_phys), parameter :: hvapi = 1.0/hvap - real(kind=kind_phys), parameter :: elocp = hvap/cp - ! --- inputs: integer, intent(in) :: im logical, intent(in) :: cplflx @@ -149,6 +143,8 @@ subroutine sfc_cice_run & real (kind=kind_phys) :: tem + real(kind=kind_phys) :: cpinv, hvapi, elocp + integer :: i logical :: flag(im) @@ -156,6 +152,10 @@ subroutine sfc_cice_run & ! Initialize CCPP error handling variables errmsg = '' errflg = 0 + + cpinv = 1.0/cp + hvapi = 1.0/hvap + elocp = hvap/cp ! if((.not. cplflx).and.(.not.cplchm))then return From 7626e87d215d37cdb44e1ae38ebe1f7d8bf635c5 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Tue, 20 Aug 2019 14:12:09 -0600 Subject: [PATCH 71/89] swap CCPP metadata for convective/non-convective precipitation such that it is consistent with the code in GFS_MP_generic_post_run --- physics/GFS_MP_generic.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index f8ad355d8..8d3074988 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -165,8 +165,8 @@ end subroutine GFS_MP_generic_post_init !! | dsnow_cpl | tendency_of_lwe_thickness_of_snow_amount_for_coupling | change in show_cpl (coupling_type) | m | 1 | real | kind_phys | inout | F | !! | lsm | flag_for_land_surface_scheme | flag for land surface model | flag | 0 | integer | | in | F | !! | lsm_ruc | flag_for_ruc_land_surface_scheme | flag for RUC land surface model | flag | 0 | integer | | in | F | -!! | raincprv | lwe_thickness_of_explicit_rainfall_amount_from_previous_timestep | explicit rainfall from previous timestep | m | 1 | real | kind_phys | inout | F | -!! | rainncprv | lwe_thickness_of_convective_precipitation_amount_from_previous_timestep | convective_precipitation_amount from previous timestep | m | 1 | real | kind_phys | inout | F | +!! | raincprv | lwe_thickness_of_convective_precipitation_amount_from_previous_timestep | convective_precipitation_amount from previous timestep | m | 1 | real | kind_phys | inout | F | +!! | rainncprv | lwe_thickness_of_explicit_rainfall_amount_from_previous_timestep | explicit rainfall from previous timestep | m | 1 | real | kind_phys | inout | F | !! | iceprv | lwe_thickness_of_ice_amount_from_previous_timestep | ice amount from previous timestep | m | 1 | real | kind_phys | inout | F | !! | snowprv | lwe_thickness_of_snow_amount_from_previous_timestep | snow amount from previous timestep | m | 1 | real | kind_phys | inout | F | !! | graupelprv | lwe_thickness_of_graupel_amount_from_previous_timestep | graupel amount from previous timestep | m | 1 | real | kind_phys | inout | F | From a72e150284a1ce4c21ada0e3a11f0fb8c60a8911 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Wed, 28 Aug 2019 11:18:32 -0600 Subject: [PATCH 72/89] physics/GFS_PBL_generic.F90: formatting changes, updates of comments --- physics/GFS_PBL_generic.F90 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index 3c755705e..357917ab7 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -361,8 +361,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, dtsfci_cpl, dqsfci_cpl, dusfc_diag, dvsfc_diag, dtsfc_diag, dqsfc_diag, dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag logical, dimension(:),intent(in) :: dry, icy - - real(kind=kind_phys), dimension(:), intent(out) :: ushfsfci + real(kind=kind_phys), dimension(:), intent(out) :: ushfsfci character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -502,7 +501,6 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, ! --- ... coupling insertion -! ### GJF ### the following section needs to be made CCPP-compliant when cplflx = T if (cplflx) then do i=1,im if (oceanfrac(i) > 0.0) then ! Ocean only, NO LAKES @@ -540,6 +538,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, enddo endif +!-------------------------------------------------------lssav if loop ---------- if (lssav) then do i=1,im dusfc_diag (i) = dusfc_diag(i) + dusfc1(i)*dtf From da8bea5b895dc2c026be183b38959f82846765d2 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Wed, 28 Aug 2019 11:19:19 -0600 Subject: [PATCH 73/89] physics/sfc_cice.f, physics/sfc_sice.f: bugfixes for coupling code to correct logic for cice land-sea-ice mask --- physics/sfc_cice.f | 32 +++++++++++++------------------- physics/sfc_sice.f | 37 +++++++++++++------------------------ 2 files changed, 26 insertions(+), 43 deletions(-) diff --git a/physics/sfc_cice.f b/physics/sfc_cice.f index eb66b28ce..e969d677f 100644 --- a/physics/sfc_cice.f +++ b/physics/sfc_cice.f @@ -26,11 +26,11 @@ end subroutine sfc_cice_finalize !> \brief Brief description of the subroutine !! !! \section arg_table_cice_run Arguments -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |----------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F -!! | cplchm | flag_for_chemistry_coupling | flag controlling cplchm collection (default off) | flag | 0 | logical | | in | F | +!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | +!! | cplchm | flag_for_chemistry_coupling | flag controlling cplchm collection (default off) | flag | 0 | logical | | in | F | !! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | !! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | !! | rvrdm1 | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | @@ -40,10 +40,10 @@ end subroutine sfc_cice_finalize !! | t1 | air_temperature_at_lowest_model_layer | surface layer mean temperature | K | 1 | real | kind_phys | in | F | !! | q1 | water_vapor_specific_humidity_at_lowest_model_layer | surface layer mean specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | !! | cm | surface_drag_coefficient_for_momentum_in_air_over_ice | surface exchange coeff for momentum over ice | none | 1 | real | kind_phys | in | F | -!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice | surface exchange coeff heat & moisture over ice | none | 1 | real | kind_phys | in | F +!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice | surface exchange coeff heat & moisture over ice | none | 1 | real | kind_phys | in | F | !! | prsl1 | air_pressure_at_lowest_model_layer | surface layer mean pressure | Pa | 1 | real | kind_phys | in | F | !! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | -!! | islimsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | in | F | +!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | in | F | !! | ddvel | surface_wind_enhancement_due_to_convection | wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | !! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | !! | dqsfc | dqsfcin | aoi_fld%dqsfcin(item,lan) | | 1 | real | kind_phys | none | F | @@ -70,7 +70,7 @@ end subroutine sfc_cice_finalize subroutine sfc_cice_run & & ( im, cplflx, cplchm, hvap, cp, rvrdm1, rd, & ! --- inputs: & u1, v1, t1, q1, cm, ch, prsl1, prslki, & - & islimsk, ddvel, flag_iter, dqsfc, dtsfc, & + & flag_cice, ddvel, flag_iter, dqsfc, dtsfc, & & qsurf, cmm, chh, evap, hflx, & ! --- outputs: & errmsg, errflg & ) @@ -127,7 +127,7 @@ subroutine sfc_cice_run & real (kind=kind_phys), dimension(im), intent(in) :: u1, v1, & & t1, q1, cm, ch, prsl1, prslki, ddvel, dqsfc, dtsfc - integer, dimension(im), intent(in) :: islimsk + logical, dimension(im), intent(in) :: flag_cice logical, intent(in) :: flag_iter(im) @@ -146,27 +146,21 @@ subroutine sfc_cice_run & real(kind=kind_phys) :: cpinv, hvapi, elocp integer :: i - - logical :: flag(im) ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - +! + if ((.not. cplflx) .and. (.not.cplchm)) then + return + endif +! cpinv = 1.0/cp hvapi = 1.0/hvap elocp = hvap/cp -! - if((.not. cplflx).and.(.not.cplchm))then - return - endif - - do i = 1, im - flag(i) = (islimsk(i) == 4) .and. flag_iter(i) - enddo ! do i = 1, im - if (flag(i)) then + if (flag_cice(i) .and. flag_iter(i)) then wind(i) = sqrt(u1(i)*u1(i) + v1(i)*v1(i)) & & + max(0.0, min(ddvel(i), 30.0)) diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index 8e4881990..7b817d813 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -45,7 +45,7 @@ end subroutine sfc_sice_finalize !! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice | surface exchange coeff heat & moisture over ice | none | 1 | real | kind_phys | in | F | !! | prsl1 | air_pressure_at_lowest_model_layer | surface layer mean pressure | Pa | 1 | real | kind_phys | in | F | !! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | -!! | islimsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | inout | F | +!! | islimsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | in | F | !! | ddvel | surface_wind_enhancement_due_to_convection | wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | !! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | !! | lprnt | flag_print | switch for printing sample column to stdout | flag | 0 | logical | | in | F | @@ -70,7 +70,6 @@ end subroutine sfc_sice_finalize !! | cplchm | flag_for_chemistry_coupling | flag controlling cplchm collection (default off) | flag | 0 | logical | | in | F | !! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | in | F | !! | islmsk_cice | sea_land_ice_mask_cice | sea/land/ice mask cice (=0/1/2) | flag | 1 | integer | | in | F | -!! | slmsk | sea_land_ice_mask_real | landmask: sea/land/ice=0/1/2 | flag | 1 | real | kind_phys | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! @@ -104,7 +103,7 @@ subroutine sfc_sice_run & & flag_iter, lprnt, ipr, & & hice, fice, tice, weasd, tskin, tprcp, stc, ep, & ! --- input/outputs: & snwdph, qsurf, snowmt, gflux, cmm, chh, evap, hflx, & ! - & cplflx, cplchm, flag_cice, islmsk_cice, slmsk, & + & cplflx, cplchm, flag_cice, islmsk_cice, & & errmsg, errflg & ) @@ -216,10 +215,9 @@ subroutine sfc_sice_run & & t1, q1, sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, cm, ch, & & prsl1, prslki, ddvel - integer, dimension(im), intent(inout) :: islimsk + integer, dimension(im), intent(in) :: islimsk integer, dimension(im), intent(in) :: islmsk_cice real (kind=kind_phys), intent(in) :: delt - real (kind=kind_phys), dimension(im), intent(in) :: slmsk logical, dimension(im), intent(in) :: flag_iter, flag_cice @@ -263,28 +261,19 @@ subroutine sfc_sice_run & errflg = 0 if(cplflx)then - write(*,*)'Fatal error: CCPP is not ready for cplflx=true!!' + write(*,*)'Fatal error: CCPP not been tested with cplflx=true!' stop endif - do i = 1, im - islmsk_local(i) = islimsk(i) - if (flag_cice(i).and.cplflx) then - islmsk_local (i) = islmsk_cice(i) - endif - enddo - - do i = 1, im - islimsk(i)=islmsk_local(i) - enddo - - if (cplflx .or. cplchm) then - do i = 1, im - if (flag_cice(i)) then - islimsk(i) = int(slmsk(i)+0.5) - endif - enddo - endif + if (cplflx) then + where (flag_cice) + islmsk_local = islmsk_cice + elsewhere + islmsk_local = islimsk + endwhere + else + islmsk_local = islimsk + end if ! !> - Set flag for sea-ice. From 5a21626935e777875067f5922f22e4e084753565 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Wed, 28 Aug 2019 17:17:38 -0600 Subject: [PATCH 74/89] physics/GFS_PBL_generic.F90: bugfix, add missing assignment of interstitial dkt to coupling dkt --- physics/GFS_PBL_generic.F90 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index 357917ab7..cecc477a4 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -314,6 +314,8 @@ end subroutine GFS_PBL_generic_post_finalize !! | evap_ocn | kinematic_surface_upward_latent_heat_flux_over_ocean | kinematic surface upward latent heat flux over ocean | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | !! | ugrs1 | x_wind_at_lowest_model_layer | zonal wind at lowest model layer | m s-1 | 1 | real | kind_phys | in | F | !! | vgrs1 | y_wind_at_lowest_model_layer | meridional wind at lowest model layer | m s-1 | 1 | real | kind_phys | in | F | +!! | dkt_cpl | instantaneous_atmosphere_heat_diffusivity | instantaneous atmospheric heat diffusivity | m2 s-1 | 2 | real | kind_phys | inout | F | +!! | dkt | atmosphere_heat_diffusivity | diffusivity for heat | m2 s-1 | 2 | real | kind_phys | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! @@ -327,7 +329,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, dqsfc_cpl, dusfci_cpl, dvsfci_cpl, dtsfci_cpl, dqsfci_cpl, dusfc_diag, dvsfc_diag, dtsfc_diag, dqsfc_diag, & dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag, dt3dt, du3dt_PBL, du3dt_OGWD, dv3dt_PBL, dv3dt_OGWD, dq3dt, & dq3dt_ozone, rd, cp,fvirt, hvap, t1, q1, prsl, hflx, ushfsfci, oceanfrac, fice, dusfc_cice, dvsfc_cice, dtsfc_cice, & - dqsfc_cice, dry, icy, wind, stress_ocn, hflx_ocn, evap_ocn, ugrs1, vgrs1, errmsg, errflg) + dqsfc_cice, dry, icy, wind, stress_ocn, hflx_ocn, evap_ocn, ugrs1, vgrs1, dkt_cpl, dkt, errmsg, errflg) use machine, only: kind_phys @@ -362,6 +364,10 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, logical, dimension(:),intent(in) :: dry, icy real(kind=kind_phys), dimension(:), intent(out) :: ushfsfci + + real(kind=kind_phys), dimension(:,:), intent(inout) :: dkt_cpl + real(kind=kind_phys), dimension(:,:), intent(in) :: dkt + character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -491,7 +497,8 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, tem = prsl(i,1) / (rd*t1(i)*(1.0+fvirt*tem1)) ushfsfci(i) = -cp * tem * hflx(i) ! upward sensible heat flux enddo -!! Coupling%dkt (:,:) = dkt (:,:) + ! dkt_cpl has dimensions (1:im,1:levs), but dkt has (1:im,1:levs-1) + dkt_cpl(1:im,1:levs-1) = dkt(1:im,1:levs-1) endif if(cplflx)then From 3f885901b6e59a0f56b89cececbda32beb384550 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Wed, 28 Aug 2019 17:17:59 -0600 Subject: [PATCH 75/89] physics/GFS_surface_generic.F90: bugfix, remove coupling code that is no longer in GFS_physics_driver.F90, remove redundant assignment of default values for flag_cice --- physics/GFS_surface_generic.F90 | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index 7b7fa7e9d..8acf186c1 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -142,9 +142,6 @@ subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, tisfc, tsfco, fice, hice real(kind=kind_phys), dimension(im), intent(out) ::ulwsfc_cice, & dusfc_cice, dvsfc_cice, dtsfc_cice, dqsfc_cice - real(kind=kind_phys), dimension(im) :: tisfc_cice, tsea_cice, & - fice_cice,hice_cice - ! CCPP error handling character(len=*), intent(out) :: errmsg @@ -262,23 +259,13 @@ subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, islmsk_cice(i) = int(slimskin_cpl(i)+0.5) if(islmsk_cice(i) == 4)then flag_cice(i) = .true. - else - flag_cice(i) = .false. endif ulwsfc_cice(i) = ulwsfcin_cpl(i) dusfc_cice(i) = dusfcin_cpl(i) dvsfc_cice(i) = dvsfcin_cpl(i) dtsfc_cice(i) = dtsfcin_cpl(i) dqsfc_cice(i) = dqsfcin_cpl(i) - tisfc_cice(i) = tisfc(i) - tsea_cice(i) = tsfco(i) - fice_cice(i) = fice(i) - hice_cice(i) = hice(i) - if(flag_cice(i)) tsfc(i) = fice_cice(i)*tisfc_cice(i) + (1. - fice_cice(i))*tsea_cice(i) enddo - else - ! Avoid uninitialized variables - set to default values - flag_cice = .false. endif From 65ec1e3e4e55fffa7fd95af560a6ac4883899a8b Mon Sep 17 00:00:00 2001 From: climbfuji Date: Wed, 28 Aug 2019 17:28:43 -0600 Subject: [PATCH 76/89] physics/GFS_PBL_generic.F90: rename instantaneous_upward_sensible_heat_flux to instantaneous_surface_upward_sensible_heat_flux_for_chemistry_coupling --- physics/GFS_PBL_generic.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index cecc477a4..b67e07d76 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -299,7 +299,7 @@ end subroutine GFS_PBL_generic_post_finalize !! | q1 | water_vapor_specific_humidity_at_lowest_model_layer_for_diag | layer 1 specific humidity for diag | kg kg-1 | 1 | real | kind_phys | in | F | !! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | !! | hflx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | ushfsfci | instantaneous_upward_sensible_heat_flux | instantaneous upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | +!! | ushfsfci | instantaneous_surface_upward_sensible_heat_flux_for_chemistry_coupling | instantaneous upward sensible heat flux for chemistry coupling | W m-2 | 1 | real | kind_phys | out | F | !! | oceanfrac | sea_area_fraction | fraction of horizontal grid area occupied by ocean | frac | 1 | real | kind_phys | in | F | !! | fice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | !! | dusfc_cice | surface_x_momentum_flux_for_coupling_interstitial | sfc x momentum flux for coupling interstitial | Pa | 1 | real | kind_phys | in | F | From 767ec7348b8fbad8ed8c54ea111d386e0794f40e Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Thu, 29 Aug 2019 15:12:58 -0600 Subject: [PATCH 77/89] add Julie as codeowner --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index d7c3658fd..0d5230f89 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -3,7 +3,7 @@ # These owners will be the default owners for everything in the repo. #* @defunkt -* @climbfuji @llpcarson @grantfirl +* @climbfuji @llpcarson @grantfirl @JulieSchramm # Order is important. The last matching pattern has the most precedence. # So if a pull request only touches javascript files, only these owners From bb81114dd23720c4d3d1fb243142f56210884d9b Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Thu, 29 Aug 2019 15:17:45 -0600 Subject: [PATCH 78/89] add Julie as codeowner --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index d7c3658fd..0d5230f89 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -3,7 +3,7 @@ # These owners will be the default owners for everything in the repo. #* @defunkt -* @climbfuji @llpcarson @grantfirl +* @climbfuji @llpcarson @grantfirl @JulieSchramm # Order is important. The last matching pattern has the most precedence. # So if a pull request only touches javascript files, only these owners From bd616c3ca2ce440c72938193975e3a29df456642 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Fri, 30 Aug 2019 15:41:35 -0600 Subject: [PATCH 79/89] physics/GFS_time_vary_pre.fv3.F90 physics/GFS_time_vary_pre.scm.F90: reflect changes in GFS_physics_driver.F90 for calling radiation at every time step --- physics/GFS_time_vary_pre.fv3.F90 | 3 +++ physics/GFS_time_vary_pre.scm.F90 | 3 +++ 2 files changed, 6 insertions(+) diff --git a/physics/GFS_time_vary_pre.fv3.F90 b/physics/GFS_time_vary_pre.fv3.F90 index 4fecabad5..de33b5404 100644 --- a/physics/GFS_time_vary_pre.fv3.F90 +++ b/physics/GFS_time_vary_pre.fv3.F90 @@ -119,6 +119,9 @@ subroutine GFS_time_vary_pre_run (Model, errmsg, errflg) !--- radiation triggers Model%lsswr = (mod(Model%kdt, Model%nsswr) == 1) Model%lslwr = (mod(Model%kdt, Model%nslwr) == 1) + !--- allow for radiation to be called on every physics time step, if needed + if (Model%nsswr == 1) Model%lsswr = .true. + if (Model%nslwr == 1) Model%lslwr = .true. !--- set the solar hour based on a combination of phour and time initial hour Model%solhr = mod(Model%phour+Model%idate(1),con_24) diff --git a/physics/GFS_time_vary_pre.scm.F90 b/physics/GFS_time_vary_pre.scm.F90 index bb246cd32..c2151151d 100644 --- a/physics/GFS_time_vary_pre.scm.F90 +++ b/physics/GFS_time_vary_pre.scm.F90 @@ -119,6 +119,9 @@ subroutine GFS_time_vary_pre_run (Model, errmsg, errflg) !--- radiation triggers Model%lsswr = (mod(Model%kdt, Model%nsswr) == 1) Model%lslwr = (mod(Model%kdt, Model%nslwr) == 1) + !--- allow for radiation to be called on every physics time step, if needed + if (Model%nsswr == 1) Model%lsswr = .true. + if (Model%nslwr == 1) Model%lslwr = .true. !--- set the solar hour based on a combination of phour and time initial hour Model%solhr = mod(Model%phour+Model%idate(1),con_24) From 73477cd50d839851e74538f33c3790f79269bae9 Mon Sep 17 00:00:00 2001 From: "ligia.bernardet" Date: Sun, 1 Sep 2019 16:19:11 -0600 Subject: [PATCH 80/89] Added file ccpp_doxyfile, which is a new doxygen configuration file identical to ccppv3_doxyfile, except that it is not specific to the V3 release and contains information about where to find the HTML files containing the metadata tables created from the .meta files (new metadata format). --- physics/docs/ccpp_doxyfile | 441 +++++++++++++++++++++++++++++++++++++ 1 file changed, 441 insertions(+) create mode 100644 physics/docs/ccpp_doxyfile diff --git a/physics/docs/ccpp_doxyfile b/physics/docs/ccpp_doxyfile new file mode 100644 index 000000000..1a11e9e99 --- /dev/null +++ b/physics/docs/ccpp_doxyfile @@ -0,0 +1,441 @@ +# Doxyfile 1.8.11 +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = "Common Community Physics Package (CCPP) Scientific Documentation" +PROJECT_NUMBER = "Version 3.0" +PROJECT_BRIEF = " " +PROJECT_LOGO = img/dtc_logo.png +OUTPUT_DIRECTORY = doc +CREATE_SUBDIRS = NO +ALLOW_UNICODE_NAMES = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = NO +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = YES +TAB_SIZE = 4 +ALIASES = +TCL_SUBST = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = YES +OPTIMIZE_OUTPUT_VHDL = NO +EXTENSION_MAPPING = .f=FortranFree \ + .F90=FortranFree \ + .f90=FortranFree +MARKDOWN_SUPPORT = YES +AUTOLINK_SUPPORT = YES +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = YES +GROUP_NESTED_COMPOUNDS = NO +SUBGROUPING = YES +INLINE_GROUPED_CLASSES = NO +INLINE_SIMPLE_STRUCTS = NO +TYPEDEF_HIDES_STRUCT = YES +LOOKUP_CACHE_SIZE = 0 +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_PACKAGE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = YES +EXTRACT_ANON_NSPACES = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = YES + +CASE_SENSE_NAMES = NO + +HIDE_SCOPE_NAMES = NO + +HIDE_COMPOUND_REFERENCE= NO + +SHOW_INCLUDE_FILES = NO + +SHOW_GROUPED_MEMB_INC = NO + +FORCE_LOCAL_INCLUDES = NO + +INLINE_INFO = YES + +SORT_MEMBER_DOCS = NO + +SORT_BRIEF_DOCS = NO +SORT_MEMBERS_CTORS_1ST = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +STRICT_PROTO_MATCHING = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = YES +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_FILES = YES +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = ccpp_dox_layout.xml +CITE_BIB_FILES = library.bib +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = NO +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_AS_ERROR = NO +WARN_FORMAT = +WARN_LOGFILE = +INPUT = pdftxt/mainpage.txt \ + pdftxt/all_shemes_list.txt \ + pdftxt/GFSv15_suite.txt \ + pdftxt/GFSv15_suite_TKEEDMF.txt \ + pdftxt/CPT_adv_suite.txt \ + pdftxt/GSD_adv_suite.txt \ + pdftxt/GFS_RRTMG.txt \ + pdftxt/GFS_SFCLYR.txt \ + pdftxt/GFS_NSST.txt \ + pdftxt/GFS_NOAH.txt \ + pdftxt/GFS_SFCSICE.txt \ + pdftxt/GFS_HEDMF.txt \ + pdftxt/GFS_SATMEDMF.txt \ + pdftxt/GFS_GWDPS.txt \ + pdftxt/GFS_OZPHYS.txt \ + pdftxt/GFS_H2OPHYS.txt \ + pdftxt/GFS_RAYLEIGH.txt \ + pdftxt/GFS_SAMF.txt \ + pdftxt/GFS_SAMFdeep.txt \ + pdftxt/GFS_GWDC.txt \ + pdftxt/GFS_SAMFshal.txt \ + pdftxt/GFDL_cloud.txt \ +### pdftxt/GFS_SURFACE_PERT.txt \ + pdftxt/GFS_CALPRECIPTYPE.txt \ +### pdftxt/rad_cld.txt \ + pdftxt/CPT_CSAW.txt \ + pdftxt/CPT_MG3.txt \ + pdftxt/GSD_MYNN_EDMF.txt \ + pdftxt/GSD_CU_GF_deep.txt \ + pdftxt/GSD_RUCLSM.txt \ + pdftxt/GSD_THOMPSON.txt \ +### pdftxt/GFSphys_namelist.txt \ +### pdftxt/GFS_STOCHY_PHYS.txt \ + pdftxt/suite_input.nml.txt \ +### in-core MP + ../gfdl_fv_sat_adj.F90 \ +### time_vary + ../GFS_phys_time_vary.fv3.F90 \ + ../GFS_rad_time_vary.fv3.F90 \ + ../ozne_def.f \ + ../ozinterp.f90 \ + ../h2o_def.f \ + ../h2ointerp.f90 \ + ../aerclm_def.F \ + ../aerinterp.F90 \ + ../iccn_def.F \ + ../iccninterp.F90 \ + ../sfcsub.F \ + ../gcycle.F90 \ +### Radiation + ../radlw_main.f \ + ../radsw_main.f \ + ../radiation_aerosols.f \ + ../radiation_astronomy.f \ + ../radiation_clouds.f \ + ../radiation_gases.f \ + ../radiation_surface.f \ + ../radlw_param.f \ + ../radlw_datatb.f \ + ../radsw_param.f \ + ../radsw_datatb.f \ + ../dcyc2.f \ +### Land Surface + ../sfc_diff.f \ + ../sfc_nst.f \ + ../module_nst_model.f90 \ + ../module_nst_parameters.f90 \ + ../module_nst_water_prop.f90 \ + ../sfc_drv.f \ + ../sflx.f \ + ../namelist_soilveg.f \ + ../set_soilveg.f \ +### Sea Ice Surface + ../sfc_sice.f \ +### PBL + ../moninedmf.f \ + ../mfpbl.f \ + ../tridi.f \ +### satmedmf + ../satmedmfvdif.F \ + ../mfpblt.f \ + ../mfscu.f \ + ../tridi.f \ +### Orographic Gravity Wave + ../gwdps.f \ +### Rayleigh Dampling + ../rayleigh_damp.f \ +### Prognostic Ozone + ../ozphys_2015.f \ +### ../ozphys.f \ +### stratospheric h2o + ../h2ophys.f \ +### Deep Convection + ../samfdeepcnv.f \ +### Convective Gravity Wave + ../gwdc.f \ +### Shallow Convection + ../samfshalcnv.f \ + ../cnvc90.f \ +### Microphysics +### ../gscond.f \ +### ../precpd.f \ + ../module_bfmicrophysics.f \ +### GFDL cloud MP + ../gfdl_cloud_microphys.F90 \ + ../module_gfdl_cloud_microphys.F90 \ +### + ../GFS_MP_generic.F90 \ + ../calpreciptype.f90 \ +### stochy +### ../GFS_stochastics.F90 \ +### ../surface_perturbation.F90 \ +### ../../stochastic_physics/stochastic_physics.F90 \ +### CPT + ../m_micro.F90 \ +### ../micro_mg2_0.F90 \ + ../micro_mg3_0.F90 \ + ../micro_mg_utils.F90 \ + ../cldmacro.F \ + ../aer_cloud.F \ + ../cldwat2m_micro.F \ + ../wv_saturation.F \ + ../cs_conv_aw_adj.F90 \ + ../cs_conv.F90 \ +### GSD + ../cu_gf_driver.F90 \ + ../cu_gf_deep.F90 \ + ../cu_gf_sh.F90 \ + ../module_MYNNrad_pre.F90 \ + ../module_MYNNrad_post.F90 \ + ../module_MYNNPBL_wrapper.F90 \ + ../module_bl_mynn.F90 \ +### ../module_MYNNSFC_wrapper.F90 \ +### ../module_sf_mynn.F90 \ + ../sfc_drv_ruc.F90 \ + ../module_sf_ruclsm.F90 \ + ../namelist_soilveg_ruc.F90 \ + ../set_soilveg_ruc.F90 \ + ../module_soil_pre.F90 \ + ../mp_thompson_pre.F90 \ + ../module_mp_thompson_make_number_concentrations.F90 \ + ../mp_thompson.F90 \ + ../module_mp_thompson.F90 \ + ../module_mp_radar.F90 \ + ../mp_thompson_post.F90 \ +### utils + ../funcphys.f90 \ + ../physparam.f \ + ../physcons.F90 \ + ../radcons.f90 \ + ../mersenne_twister.f \ + compns_stochy.F90 + + +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.f \ + *.F90 \ + *.f90 \ + *.nml \ + *.txt +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = ./ +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = img +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +FILTER_SOURCE_PATTERNS = +USE_MDFILE_AS_MAINPAGE = +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#CLANG_ASSISTED_PARSING = NO +#CLANG_OPTIONS = +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_EXTRA_STYLESHEET = ccpp_dox_extra_style.css +HTML_EXTRA_FILES = +HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_GAMMA = 80 +HTML_TIMESTAMP = NO +HTML_DYNAMIC_SECTIONS = NO +HTML_INDEX_NUM_ENTRIES = 100 +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_NAME = Publisher +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +GENERATE_ECLIPSEHELP = NO +ECLIPSE_DOC_ID = org.doxygen.Project +DISABLE_INDEX = YES +GENERATE_TREEVIEW = YES +ENUM_VALUES_PER_LINE = 4 +TREEVIEW_WIDTH = 250 +EXT_LINKS_IN_WINDOW = NO +FORMULA_FONTSIZE = 10 +FORMULA_TRANSPARENT = YES +USE_MATHJAX = YES +MATHJAX_FORMAT = HTML-CSS +MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2 +MATHJAX_EXTENSIONS = +MATHJAX_CODEFILE = +SEARCHENGINE = YES +SERVER_BASED_SEARCH = NO +EXTERNAL_SEARCH = NO +SEARCHENGINE_URL = +SEARCHDATA_FILE = searchdata.xml +EXTERNAL_SEARCH_ID = +EXTRA_SEARCH_MAPPINGS = +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = YES +PAPER_TYPE = a4 +EXTRA_PACKAGES = amsmath +LATEX_HEADER = +LATEX_FOOTER = +LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_FILES = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = YES +LATEX_SOURCE_CODE = NO + +LATEX_BIB_STYLE = plainnat + +LATEX_TIMESTAMP = NO + +GENERATE_RTF = NO + +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +RTF_SOURCE_CODE = NO +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_SUBDIR = +MAN_LINKS = NO +GENERATE_XML = NO +XML_OUTPUT = xml +XML_PROGRAMLISTING = YES +GENERATE_DOCBOOK = NO +DOCBOOK_OUTPUT = docbook +DOCBOOK_PROGRAMLISTING = NO +GENERATE_AUTOGEN_DEF = NO +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +ENABLE_PREPROCESSING = NO +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = CCPP \ + MULTI_GASES \ + 0 +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +EXTERNAL_PAGES = YES +PERL_PATH = /usr/bin/perl +CLASS_DIAGRAMS = YES +MSCGEN_PATH = +DIA_PATH = +HIDE_UNDOC_RELATIONS = NO +HAVE_DOT = YES +DOT_NUM_THREADS = 0 +DOT_FONTNAME = Helvetica +DOT_FONTSIZE = 10 +DOT_FONTPATH = +CLASS_GRAPH = NO +COLLABORATION_GRAPH = NO +GROUP_GRAPHS = YES +UML_LOOK = YES +UML_LIMIT_NUM_FIELDS = 10 +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = NO +CALL_GRAPH = YES +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = svg +INTERACTIVE_SVG = NO +DOT_PATH = +DOTFILE_DIRS = +MSCFILE_DIRS = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_INCLUDE_PATH = +DOT_GRAPH_MAX_NODES = 200 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = YES +GENERATE_LEGEND = YES +DOT_CLEANUP = YES From 103bf3249c57e2e39c3005124bca73bc3d721baa Mon Sep 17 00:00:00 2001 From: climbfuji Date: Tue, 3 Sep 2019 08:38:02 -0600 Subject: [PATCH 81/89] physics/module_mp_thompson.F90, physics/mp_thompson.F90: use automatic unit conversion for cloud effective radii --- physics/module_mp_thompson.F90 | 2 +- physics/mp_thompson.F90 | 28 +++++++++------------------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index f1b462b1e..0d6b541f2 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -1034,7 +1034,7 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, & REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT):: & nc, nwfa, nifa REAL, DIMENSION(ims:ime, jms:jme), OPTIONAL, INTENT(IN):: nwfa2d, nifa2d - REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(OUT):: & + REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(OUT):: & re_cloud, re_ice, re_snow INTEGER, INTENT(IN):: has_reqc, has_reqi, has_reqs #if ( WRF_CHEM == 1 ) diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index 5fc7d5722..4065df992 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -181,9 +181,9 @@ end subroutine mp_thompson_init !! | sr | ratio_of_snowfall_to_rainfall | ratio of snowfall to large-scale rainfall | frac | 1 | real | kind_phys | out | F | !! | refl_10cm | radar_reflectivity_10cm | instantaneous refl_10cm | dBZ | 2 | real | kind_phys | out | F | !! | do_radar_ref | flag_for_radar_reflectivity | flag for radar reflectivity | flag | 0 | logical | | in | F | -!! | re_cloud | effective_radius_of_stratiform_cloud_liquid_water_particle_in_um | eff. radius of cloud liquid water particle in micrometer | um | 2 | real | kind_phys | out | F | -!! | re_ice | effective_radius_of_stratiform_cloud_ice_particle_in_um | eff. radius of cloud ice water particle in micrometer | um | 2 | real | kind_phys | out | F | -!! | re_snow | effective_radius_of_stratiform_cloud_snow_particle_in_um | effective radius of cloud snow particle in micrometers | um | 2 | real | kind_phys | out | F | +!! | re_cloud | effective_radius_of_stratiform_cloud_liquid_water_particle_in_um | eff. radius of cloud liquid water particle in micrometer (meter here) | m | 2 | real | kind_phys | out | F | +!! | re_ice | effective_radius_of_stratiform_cloud_ice_particle_in_um | eff. radius of cloud ice water particle in micrometer (meter here) | m | 2 | real | kind_phys | out | F | +!! | re_snow | effective_radius_of_stratiform_cloud_snow_particle_in_um | effective radius of cloud snow particle in micrometer (meter here) | m | 2 | real | kind_phys | out | F | !! | mpicomm | mpi_comm | MPI communicator | index | 0 | integer | | in | F | !! | mpirank | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | !! | mpiroot | mpi_root | master MPI-rank | index | 0 | integer | | in | F | @@ -286,9 +286,6 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & integer :: do_radar_ref_mp ! integer instead of logical do_radar_ref ! Effective cloud radii logical :: do_effective_radii - real(kind_phys) :: re_cloud_mp(1:ncol,1:nlev) ! m - real(kind_phys) :: re_ice_mp(1:ncol,1:nlev) ! m - real(kind_phys) :: re_snow_mp(1:ncol,1:nlev) ! m integer :: has_reqc integer :: has_reqi integer :: has_reqs @@ -363,6 +360,10 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & has_reqc = 1 has_reqi = 1 has_reqs = 1 + ! Initialize to zero, intent(out) variables + re_cloud = 0 + re_ice = 0 + re_snow = 0 else if (.not.present(re_cloud) .and. .not.present(re_ice) .and. .not.present(re_snow)) then do_effective_radii = .false. has_reqc = 0 @@ -375,10 +376,6 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & errflg = 1 return end if - ! Initialize to zero, intent(out) variables - re_cloud_mp = 0 - re_ice_mp = 0 - re_snow_mp = 0 ! Set internal dimensions ids = 1 @@ -413,7 +410,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, & refl_10cm=refl_10cm, & diagflag=diagflag, do_radar_ref=do_radar_ref_mp, & - re_cloud=re_cloud_mp, re_ice=re_ice_mp, re_snow=re_snow_mp, & + re_cloud=re_cloud, re_ice=re_ice, re_snow=re_snow, & has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, & ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, & ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, & @@ -430,7 +427,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, & refl_10cm=refl_10cm, & diagflag=diagflag, do_radar_ref=do_radar_ref_mp, & - re_cloud=re_cloud_mp, re_ice=re_ice_mp, re_snow=re_snow_mp, & + re_cloud=re_cloud, re_ice=re_ice, re_snow=re_snow, & has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, & ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, & ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, & @@ -456,13 +453,6 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & snow = max(0.0, delta_snow_mp/1000.0_kind_phys) rain = max(0.0, delta_rain_mp - (delta_graupel_mp + delta_ice_mp + delta_snow_mp)/1000.0_kind_phys) - if (do_effective_radii) then - ! Convert m to micron - re_cloud = re_cloud_mp*1.0E6_kind_phys - re_ice = re_ice_mp*1.0E6_kind_phys - re_snow = re_snow_mp*1.0E6_kind_phys - end if - end subroutine mp_thompson_run !>@} From 81b3484df28edbbabddcdfd06e8c7b05188356e4 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Tue, 9 Jul 2019 14:34:09 -0600 Subject: [PATCH 82/89] Remove directory stochastic_physics --- stochastic_physics/compns_stochy.F90 | 214 ------- stochastic_physics/dezouv_stochy.f | 269 --------- stochastic_physics/dozeuv_stochy.f | 267 --------- stochastic_physics/epslon_stochy.f | 93 ---- stochastic_physics/four_to_grid_stochy.F | 271 --------- stochastic_physics/function2 | 5 - stochastic_physics/function_indlsev | 3 - stochastic_physics/function_indlsod | 3 - stochastic_physics/get_lats_node_a_stochy.f | 92 --- stochastic_physics/get_ls_node_stochy.f | 81 --- stochastic_physics/get_stochy_pattern.F90 | 527 ------------------ stochastic_physics/getcon_lag_stochy.f | 89 --- stochastic_physics/getcon_spectral.F90 | 277 --------- stochastic_physics/glats_stochy.f | 109 ---- stochastic_physics/gozrineo_stochy.f | 180 ------ .../initialize_spectral_mod.F90 | 268 --------- stochastic_physics/pln2eo_stochy.f | 287 ---------- stochastic_physics/setlats_a_stochy.f | 195 ------- stochastic_physics/setlats_lag_stochy.f | 127 ----- stochastic_physics/spectral_layout.f | 31 -- stochastic_physics/stochastic_physics.F90 | 420 -------------- stochastic_physics/stochy_ccpp.F90 | 437 --------------- stochastic_physics/stochy_data_mod.F90 | 397 ------------- stochastic_physics/stochy_gg_def.f | 9 - .../stochy_internal_state_mod.F90 | 136 ----- stochastic_physics/stochy_layout_lag.f | 13 - stochastic_physics/stochy_namelist_def.F90 | 37 -- .../stochy_patterngenerator.F90 | 362 ------------ stochastic_physics/stochy_resol_def.f | 44 -- stochastic_physics/sumfln_stochy.f | 294 ---------- 30 files changed, 5537 deletions(-) delete mode 100644 stochastic_physics/compns_stochy.F90 delete mode 100644 stochastic_physics/dezouv_stochy.f delete mode 100644 stochastic_physics/dozeuv_stochy.f delete mode 100644 stochastic_physics/epslon_stochy.f delete mode 100644 stochastic_physics/four_to_grid_stochy.F delete mode 100644 stochastic_physics/function2 delete mode 100644 stochastic_physics/function_indlsev delete mode 100644 stochastic_physics/function_indlsod delete mode 100644 stochastic_physics/get_lats_node_a_stochy.f delete mode 100644 stochastic_physics/get_ls_node_stochy.f delete mode 100644 stochastic_physics/get_stochy_pattern.F90 delete mode 100644 stochastic_physics/getcon_lag_stochy.f delete mode 100644 stochastic_physics/getcon_spectral.F90 delete mode 100644 stochastic_physics/glats_stochy.f delete mode 100644 stochastic_physics/gozrineo_stochy.f delete mode 100644 stochastic_physics/initialize_spectral_mod.F90 delete mode 100644 stochastic_physics/pln2eo_stochy.f delete mode 100644 stochastic_physics/setlats_a_stochy.f delete mode 100644 stochastic_physics/setlats_lag_stochy.f delete mode 100644 stochastic_physics/spectral_layout.f delete mode 100644 stochastic_physics/stochastic_physics.F90 delete mode 100644 stochastic_physics/stochy_ccpp.F90 delete mode 100644 stochastic_physics/stochy_data_mod.F90 delete mode 100644 stochastic_physics/stochy_gg_def.f delete mode 100644 stochastic_physics/stochy_internal_state_mod.F90 delete mode 100644 stochastic_physics/stochy_layout_lag.f delete mode 100644 stochastic_physics/stochy_namelist_def.F90 delete mode 100644 stochastic_physics/stochy_patterngenerator.F90 delete mode 100644 stochastic_physics/stochy_resol_def.f delete mode 100644 stochastic_physics/sumfln_stochy.f diff --git a/stochastic_physics/compns_stochy.F90 b/stochastic_physics/compns_stochy.F90 deleted file mode 100644 index 7015d937f..000000000 --- a/stochastic_physics/compns_stochy.F90 +++ /dev/null @@ -1,214 +0,0 @@ -!>\file compns_stochy.F90 -!! This file includes ... - -!>\ingroup gfs_stoch -!! This module -module compns_stochy_mod - - implicit none - - contains - -!----------------------------------------------------------------------- - subroutine compns_stochy (me,sz_nml,input_nml_file,fn_nml,nlunit,deltim,iret) -!$$$ Subprogram Documentation Block -! -! Subprogram: compns Check and compute namelist frequencies -! Prgmmr: Iredell Org: NP23 Date: 1999-01-26 -! -! Abstract: This subprogram checks global spectral model namelist -! frequencies in hour units for validity. If they are valid, -! then the frequencies are computed in timestep units. -! The following rules are applied: -! 1. the timestep must be positive; -! -! Program History Log: -! 2016-10-11 Phil Pegion make the stochastic physics stand alone -! -! Usage: call compns_stochy (me,deltim,nlunit, stochy_namelist,iret) -! Input Arguments: -! deltim - real timestep in seconds -! Output Arguments: -! iret - integer return code (0 if successful or -! between 1 and 8 for which rule above was broken) -! stochy_namelist -! -! Attributes: -! Language: Fortran 90 -! -!$$$ - - - use stochy_namelist_def - - implicit none - - - integer, intent(out) :: iret - integer, intent(in) :: nlunit,me,sz_nml - character(len=*), intent(in) :: input_nml_file(sz_nml) - character(len=64), intent(in) :: fn_nml - real, intent(in) :: deltim - real tol - integer k,ios - -! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -! - namelist /nam_stochy/ntrunc,lon_s,lat_s,sppt,sppt_tau,sppt_lscale,sppt_logit, & - iseed_shum,iseed_sppt,shum,shum_tau,& - shum_lscale,fhstoch,stochini,skeb_varspect_opt,sppt_sfclimit, & - skeb,skeb_tau,skeb_vdof,skeb_lscale,iseed_skeb,skeb_vfilt,skeb_diss_smooth, & - skeb_sigtop1,skeb_sigtop2,skebnorm,sppt_sigtop1,sppt_sigtop2,& - shum_sigefold,skebint,skeb_npass,use_zmtnblck - namelist /nam_sfcperts/nsfcpert,pertz0,pertshc,pertzt,pertlai, & ! mg, sfcperts - pertvegf,pertalb,iseed_sfc,sfc_tau,sfc_lscale,sppt_land - - tol=0.01 ! tolerance for calculations -! spectral resolution defintion - ntrunc=-999 - lon_s=-999 - lat_s=-999 - ! can specify up to 5 values for the stochastic physics parameters - ! (each is an array of length 5) - sppt = -999. !< stochastic physics tendency amplitude - shum = -999. !< stochastic boundary layer spf hum amp - skeb = -999. !< stochastic KE backscatter amplitude - ! mg, sfcperts - pertz0 = -999. !< momentum roughness length amplitude - pertshc = -999. !< soil hydraulic conductivity amp - pertzt = -999. !< mom/heat roughness length amplitude - pertlai = -999. !< leaf area index amplitude - pertvegf = -999. !< vegetation fraction amplitude - pertalb = -999. !< albedo perturbations amplitude -! logicals - do_sppt = .false. - use_zmtnblck = .false. - do_shum = .false. - do_skeb = .false. - ! mg, sfcperts - do_sfcperts = .false. - sppt_land = .false. - nsfcpert = 0 -! for sfcperts random patterns - sfc_lscale = -999. !< length scales - sfc_tau = -999. ! time scales - iseed_sfc = 0 ! random seeds (if 0 use system clock) -! for SKEB random patterns. - skeb_vfilt = 0 - skebint = 0 - skeb_npass = 11 ! number of passes of smoother for dissipation estiamte - sppt_tau = -999. ! time scales - shum_tau = -999. - skeb_tau = -999. - skeb_vdof = 5 ! proxy for vertical correlation, 5 is close to 40 passes of the 1-2-1 filter in the GFS - skebnorm = 0 ! 0 - random pattern is stream function, 1- pattern is kenorm, 2- pattern is vorticity - sppt_lscale = -999. ! length scales - shum_lscale = -999. - skeb_lscale = -999. - iseed_sppt = 0 ! random seeds (if 0 use system clock) - iseed_shum = 0 - iseed_skeb = 0 -! parameters to control vertical tapering of stochastic physics with -! height - sppt_sigtop1 = 0.1 - sppt_sigtop2 = 0.025 - skeb_sigtop1 = 0.1 - skeb_sigtop2 = 0.025 - shum_sigefold = 0.2 -! reduce amplitude of sppt near surface (lowest 2 levels) - sppt_sfclimit = .false. -! gaussian or power law variance spectrum for skeb (0: gaussian, 1: -! power law). If power law, skeb_lscale interpreted as a power not a -! length scale. - skeb_varspect_opt = 0 - sppt_logit = .false. ! logit transform for sppt to bounded interval [-1,+1] - fhstoch = -999.0 ! forecast hour to dump random patterns - stochini = .false. ! true= read in pattern, false=initialize from seed - -#ifdef INTERNAL_FILE_NML - read(input_nml_file, nml=nam_stochy) -#else - rewind (nlunit) - open (unit=nlunit, file=fn_nml, READONLY, status='OLD', iostat=ios) - read(nlunit,nam_stochy) -#endif -#ifdef INTERNAL_FILE_NML - read(input_nml_file, nml=nam_sfcperts) -#else - rewind (nlunit) - open (unit=nlunit, file=fn_nml, READONLY, status='OLD', iostat=ios) - read(nlunit,nam_sfcperts) -#endif - - if (me == 0) then - print *,' in compns_stochy' - print*,'skeb=',skeb - endif - -! PJP stochastic physics additions - IF (sppt(1) > 0 ) THEN - do_sppt=.true. - ENDIF - IF (shum(1) > 0 ) THEN - do_shum=.true. -! shum parameter has units of 1/hour, to remove time step -! dependence. -! change shum parameter units from per hour to per timestep - DO k=1,5 - IF (shum(k) .gt. 0.0) shum(k)=shum(k)*deltim/3600.0 - ENDDO - ENDIF - IF (skeb(1) > 0 ) THEN - do_skeb=.true. - if (skebnorm==0) then ! stream function norm - skeb=skeb*1.111e3*sqrt(deltim) - !skeb=skeb*5.0e5/sqrt(deltim) - endif - if (skebnorm==1) then ! stream function norm - skeb=skeb*0.00222*sqrt(deltim) - !skeb=skeb*1/sqrt(deltim) - endif - if (skebnorm==2) then ! vorticty function norm - skeb=skeb*1.111e-9*sqrt(deltim) - !skeb=skeb*5.0e-7/sqrt(deltim) - endif -! adjust skeb values for resolution. -! scaling is such that a value of 1.0 at T574 with a 900 second -! timestep produces well-calibrated values of forecast spread. -! DO k=1,5 -! IF (skeb(k) .gt. 0.0) THEN -! skeb(k)=skeb(k)*deltim/(ntrunc*(ntrunc+1))*365765.0 ! 365765 is a scale factor so the base SKEB value in the namelist is 1.0 -! skeb(k)=skeb(k)*deltim/(ntrunc*(ntrunc+1))*2000.0 ! 2000 is new scale factor so the base SKEB value in the namelist is 1.0 -! ENDIF -! ENDDO - ENDIF -! compute frequencty to estimate dissipation timescale - IF (skebint == 0.) skebint=deltim - nsskeb=nint(skebint/deltim) ! skebint in seconds - IF(nsskeb<=0 .or. abs(nsskeb-skebint/deltim)>tol) THEN - WRITE(0,*) "SKEB interval is invalid",skebint - iret=9 - return - ENDIF -! mg, sfcperts - IF (pertz0(1) > 0 .OR. pertshc(1) > 0 .OR. pertzt(1) > 0 .OR. & - pertlai(1) > 0 .OR. pertvegf(1) > 0 .OR. pertalb(1) > 0) THEN - do_sfcperts=.true. - ENDIF -! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -! -! All checks are successful. -! - if (me == 0) then - print *, 'stochastic physics' - print *, ' do_sppt : ', do_sppt - print *, ' do_shum : ', do_shum - print *, ' do_skeb : ', do_skeb - print *, ' do_sfcperts : ', do_sfcperts - endif - iret = 0 -! - return - end subroutine compns_stochy - -end module compns_stochy_mod diff --git a/stochastic_physics/dezouv_stochy.f b/stochastic_physics/dezouv_stochy.f deleted file mode 100644 index 32f4e7dba..000000000 --- a/stochastic_physics/dezouv_stochy.f +++ /dev/null @@ -1,269 +0,0 @@ - module dezouv_stochy_mod - - implicit none - - contains - - subroutine dezouv_stochy(dev,zod,uev,vod,epsedn,epsodn, - & snnp1ev,snnp1od,ls_node) -cc - -cc - use stochy_resol_def - use spectral_layout_mod - use machine - implicit none -cc - real(kind_dbl_prec) dev(len_trie_ls,2) - real(kind_dbl_prec) zod(len_trio_ls,2) - real(kind_dbl_prec) uev(len_trie_ls,2) - real(kind_dbl_prec) vod(len_trio_ls,2) -cc - real(kind_dbl_prec) epsedn(len_trie_ls) - real(kind_dbl_prec) epsodn(len_trio_ls) -cc - real(kind_dbl_prec) snnp1ev(len_trie_ls) - real(kind_dbl_prec) snnp1od(len_trio_ls) -cc - integer ls_node(ls_dim,3) -cc -!cmr ls_node(1,1) ... ls_node(ls_max_node,1) : values of L -!cmr ls_node(1,2) ... ls_node(ls_max_node,2) : values of jbasev -!cmr ls_node(1,3) ... ls_node(ls_max_node,3) : values of jbasod -cc - integer l,locl,n -cc - integer indev,indev1,indev2 - integer indod,indod1,indod2 - integer inddif -cc - real(kind_dbl_prec) rl -cc - real(kind_dbl_prec) cons0 !constant -cc - integer indlsev,jbasev - integer indlsod,jbasod - real(kind_evod) rerth -cc - include 'function2' -cc -cc -cc...................................................................... -cc -cc - cons0 = 0.d0 !constant - rerth =6.3712e+6 ! radius of earth (m) -cc -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) -cc - uev(indlsev(l,l),1) = cons0 !constant - uev(indlsev(l,l),2) = cons0 !constant -cc -cc - enddo -cc -cc...................................................................... -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - jbasod=ls_node(locl,3) - indev1 = indlsev(L,L) + 1 - if (mod(L,2).eq.mod(jcap+1,2)) then - indev2 = indlsev(jcap+1,L) - else - indev2 = indlsev(jcap ,L) - endif - indod1 = indlsod(l+1,l) - inddif = indev1 - indod1 -cc - do indev = indev1 , indev2 -cc - uev(indev,1) = -epsedn(indev) - x * zod(indev-inddif,1) -cc - uev(indev,2) = -epsedn(indev) - x * zod(indev-inddif,2) -cc - enddo -cc - enddo -cc -cc...................................................................... -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - jbasod=ls_node(locl,3) - indev1 = indlsev(L,L) - if (mod(L,2).eq.mod(jcap+1,2)) then - indev2 = indlsev(jcap-1,L) - else - indev2 = indlsev(jcap ,L) - endif - indod1 = indlsod(l+1,l) - inddif = indev1 - indod1 -cc - do indev = indev1 , indev2 -cc - vod(indev-inddif,1) = epsodn(indev-inddif) - x * dev(indev,1) -cc - vod(indev-inddif,2) = epsodn(indev-inddif) - x * dev(indev,2) -cc - enddo -cc - enddo -cc -cc...................................................................... -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - indev1 = indlsev(L,L) - if (mod(L,2).eq.mod(jcap+1,2)) then - indev2 = indlsev(jcap-1,L) - else - indev2 = indlsev(jcap ,L) - endif - if ( l .ge. 1 ) then - rl = l - do indev = indev1 , indev2 -cc u(l,n)=-i*l*d(l,n)/(n*(n+1)) -cc - uev(indev,1) = uev(indev,1) - 1 + rl * dev(indev,2) - 2 / snnp1ev(indev) -cc - uev(indev,2) = uev(indev,2) - 1 - rl * dev(indev,1) - 2 / snnp1ev(indev) -cc - enddo - endif -cc - enddo -cc -cc...................................................................... -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasod=ls_node(locl,3) - indod1 = indlsod(L+1,L) - if (mod(L,2).eq.mod(jcap+1,2)) then - indod2 = indlsod(jcap ,L) - else - indod2 = indlsod(jcap+1,L) - 1 - endif - if ( l .ge. 1 ) then - rl = l - do indod = indod1 , indod2 -cc u(l,n)=-i*l*d(l,n)/(n*(n+1)) -cc - vod(indod,1) = vod(indod,1) - 1 + rl * zod(indod,2) - 2 / snnp1od(indod) -cc - vod(indod,2) = vod(indod,2) - 1 - rl * zod(indod,1) - 2 / snnp1od(indod) -cc - enddo - endif -cc - enddo -cc -cc...................................................................... -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - jbasod=ls_node(locl,3) - indev1 = indlsev(L,L) - if (mod(L,2).eq.mod(jcap+1,2)) then - indev2 = indlsev(jcap+1,L) - 1 - else - indev2 = indlsev(jcap ,L) - 1 - endif - indod1 = indlsod(l+1,l) - inddif = indev1 - indod1 -cc - do indev = indev1 , indev2 -cc - uev(indev,1) = uev(indev ,1) - 1 + epsodn(indev-inddif) * zod(indev-inddif,1) -cc - uev(indev,2) = uev(indev ,2) - 1 + epsodn(indev-inddif) * zod(indev-inddif,2) -cc - enddo -cc - enddo -cc -cc...................................................................... -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - jbasod=ls_node(locl,3) - indev1 = indlsev(L,L) + 1 - if (mod(L,2).eq.mod(jcap+1,2)) then - indev2 = indlsev(jcap-1,L) - else - indev2 = indlsev(jcap ,L) - endif - indod1 = indlsod(l+1,l) - inddif = indev1 - indod1 -cc - do indev = indev1 , indev2 -cc - vod(indev-inddif,1) = vod(indev-inddif,1) - 1 - epsedn(indev) * dev(indev ,1) -cc - vod(indev-inddif,2) = vod(indev-inddif,2) - 1 - epsedn(indev) * dev(indev ,2) -cc - enddo -cc - enddo -cc -cc...................................................................... -cc -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - jbasod=ls_node(locl,3) - indev1 = indlsev(L,L) - indod1 = indlsod(L+1,L) - if (mod(L,2).eq.mod(jcap+1,2)) then - indev2 = indlsev(jcap+1,L) - indod2 = indlsod(jcap ,L) - else - indev2 = indlsev(jcap ,L) - indod2 = indlsod(jcap+1,L) - endif - do indev = indev1 , indev2 -cc - uev(indev,1) = uev(indev,1) * rerth - uev(indev,2) = uev(indev,2) * rerth -cc - enddo -cc - do indod = indod1 , indod2 -cc - vod(indod,1) = vod(indod,1) * rerth - vod(indod,2) = vod(indod,2) * rerth -cc - enddo -cc - enddo -cc - return - end - - end module dezouv_stochy_mod diff --git a/stochastic_physics/dozeuv_stochy.f b/stochastic_physics/dozeuv_stochy.f deleted file mode 100644 index 4ff5ad8f2..000000000 --- a/stochastic_physics/dozeuv_stochy.f +++ /dev/null @@ -1,267 +0,0 @@ - module dozeuv_stochy_mod - - implicit none - - contains - - subroutine dozeuv_stochy(dod,zev,uod,vev,epsedn,epsodn, - & snnp1ev,snnp1od,ls_node) -cc - use stochy_resol_def - use spectral_layout_mod - use machine - implicit none -cc - real(kind_dbl_prec) dod(len_trio_ls,2) - real(kind_dbl_prec) zev(len_trie_ls,2) - real(kind_dbl_prec) uod(len_trio_ls,2) - real(kind_dbl_prec) vev(len_trie_ls,2) -cc - real(kind_dbl_prec) epsedn(len_trie_ls) - real(kind_dbl_prec) epsodn(len_trio_ls) -cc - real(kind_dbl_prec) snnp1ev(len_trie_ls) - real(kind_dbl_prec) snnp1od(len_trio_ls) -cc - integer ls_node(ls_dim,3) -cc -!cmr ls_node(1,1) ... ls_node(ls_max_node,1) : values of L -!cmr ls_node(1,2) ... ls_node(ls_max_node,2) : values of jbasev -!cmr ls_node(1,3) ... ls_node(ls_max_node,3) : values of jbasod -cc - integer l,locl,n -cc - integer indev,indev1,indev2 - integer indod,indod1,indod2 - integer inddif -cc - real(kind_dbl_prec) rl -cc - real(kind_dbl_prec) cons0 !constant -cc - integer indlsev,jbasev - integer indlsod,jbasod - real(kind_evod) rerth -cc - include 'function2' -cc -cc -cc...................................................................... -cc -cc - cons0 = 0.d0 !constant - rerth =6.3712e+6 ! radius of earth (m) -cc -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) -cc - vev(indlsev(l,l),1) = cons0 !constant - vev(indlsev(l,l),2) = cons0 !constant -cc -cc - enddo -cc -cc...................................................................... -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - jbasod=ls_node(locl,3) - indev1 = indlsev(L,L) - if (mod(L,2).eq.mod(jcap+1,2)) then - indev2 = indlsev(jcap-1,L) - else - indev2 = indlsev(jcap ,L) - endif - indod1 = indlsod(l+1,l) - inddif = indev1 - indod1 -cc - do indev = indev1 , indev2 -cc - uod(indev-inddif,1) = -epsodn(indev-inddif) - x * zev(indev,1) -cc - uod(indev-inddif,2) = -epsodn(indev-inddif) - x * zev(indev,2) -cc - enddo -cc - enddo -cc -cc...................................................................... -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - jbasod=ls_node(locl,3) - indev1 = indlsev(L,L) + 1 - if (mod(L,2).eq.mod(jcap+1,2)) then - indev2 = indlsev(jcap+1,L) - else - indev2 = indlsev(jcap ,L) - endif - indod1 = indlsod(l+1,l) - inddif = indev1 - indod1 -cc - do indev = indev1 , indev2 -cc - vev(indev,1) = epsedn(indev) - x * dod(indev-inddif,1) -cc - vev(indev,2) = epsedn(indev) - x * dod(indev-inddif,2) -cc - enddo -cc - enddo -cc -cc...................................................................... -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasod=ls_node(locl,3) - indod1 = indlsod(L+1,L) - if (mod(L,2).eq.mod(jcap+1,2)) then - indod2 = indlsod(jcap ,L) - else - indod2 = indlsod(jcap+1,L) - 1 - endif - if ( l .ge. 1 ) then - rl = l - do indod = indod1 , indod2 -cc u(l,n)=-i*l*d(l,n)/(n*(n+1)) -cc - uod(indod,1) = uod(indod,1) - 1 + rl * dod(indod,2) - 2 / snnp1od(indod) -cc - uod(indod,2) = uod(indod,2) - 1 - rl * dod(indod,1) - 2 / snnp1od(indod) -cc - enddo - endif -cc - enddo -cc -cc...................................................................... -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - indev1 = indlsev(L,L) - if (mod(L,2).eq.mod(jcap+1,2)) then - indev2 = indlsev(jcap-1,L) - else - indev2 = indlsev(jcap ,L) - endif - if ( l .ge. 1 ) then - rl = l - do indev = indev1 , indev2 -cc u(l,n)=-i*l*d(l,n)/(n*(n+1)) -cc - vev(indev,1) = vev(indev,1) - 1 + rl * zev(indev,2) - 2 / snnp1ev(indev) -cc - vev(indev,2) = vev(indev,2) - 1 - rl * zev(indev,1) - 2 / snnp1ev(indev) -cc - enddo - endif -cc - enddo -cc -cc...................................................................... -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - jbasod=ls_node(locl,3) - indev1 = indlsev(L,L) + 1 - if (mod(L,2).eq.mod(jcap+1,2)) then - indev2 = indlsev(jcap-1,L) - else - indev2 = indlsev(jcap ,L) - endif - indod1 = indlsod(l+1,l) - inddif = indev1 - indod1 -cc - do indev = indev1 , indev2 -cc - uod(indev-inddif,1) = uod(indev-inddif,1) - 1 + epsedn(indev) * zev(indev ,1) -cc - uod(indev-inddif,2) = uod(indev-inddif,2) - 1 + epsedn(indev) * zev(indev ,2) -cc - enddo -cc - enddo -cc -cc...................................................................... -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - jbasod=ls_node(locl,3) - indev1 = indlsev(L,L) - if (mod(L,2).eq.mod(jcap+1,2)) then - indev2 = indlsev(jcap+1,L) - 1 - else - indev2 = indlsev(jcap ,L) - 1 - endif - indod1 = indlsod(l+1,l) - inddif = indev1 - indod1 -cc - do indev = indev1 , indev2 -cc - vev(indev,1) = vev(indev ,1) - 1 - epsodn(indev-inddif) * dod(indev-inddif,1) -cc - vev(indev,2) = vev(indev ,2) - 1 - epsodn(indev-inddif) * dod(indev-inddif,2) -cc - enddo -cc - enddo -cc -cc...................................................................... -cc -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - jbasod=ls_node(locl,3) - indev1 = indlsev(L,L) - indod1 = indlsod(L+1,L) - if (mod(L,2).eq.mod(jcap+1,2)) then - indev2 = indlsev(jcap+1,L) - indod2 = indlsod(jcap ,L) - else - indev2 = indlsev(jcap ,L) - indod2 = indlsod(jcap+1,L) - endif - do indod = indod1 , indod2 -cc - uod(indod,1) = uod(indod,1) * rerth - uod(indod,2) = uod(indod,2) * rerth -cc - enddo -cc - do indev = indev1 , indev2 -cc - vev(indev,1) = vev(indev,1) * rerth - vev(indev,2) = vev(indev,2) * rerth -cc - enddo -cc - enddo -cc - return - end - - end module dozeuv_stochy_mod diff --git a/stochastic_physics/epslon_stochy.f b/stochastic_physics/epslon_stochy.f deleted file mode 100644 index c7aace515..000000000 --- a/stochastic_physics/epslon_stochy.f +++ /dev/null @@ -1,93 +0,0 @@ - module epslon_stochy_mod - - implicit none - - contains - - subroutine epslon_stochy(epse,epso,epsedn,epsodn, - & ls_node) -cc - use stochy_resol_def - use spectral_layout_mod - use machine - implicit none -cc - real(kind_dbl_prec) epse(len_trie_ls) - real(kind_dbl_prec) epso(len_trio_ls) -cc - real(kind_dbl_prec) epsedn(len_trie_ls) - real(kind_dbl_prec) epsodn(len_trio_ls) -cc - integer ls_node(ls_dim,3) -cc -!cmr ls_node(1,1) ... ls_node(ls_max_node,1) : values of L -!cmr ls_node(1,2) ... ls_node(ls_max_node,2) : values of jbasev -!cmr ls_node(1,3) ... ls_node(ls_max_node,3) : values of jbasod -cc - integer l,locl,n -cc - integer indev - integer indod -cc - real(kind_dbl_prec) f1,f2,rn,val -cc - real(kind_dbl_prec) cons0 !constant -cc - integer indlsev,jbasev - integer indlsod,jbasod -cc - include 'function2' -cc -cc - cons0=0.0d0 !constant -cc -cc -cc...................................................................... -cc -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - indev=indlsev(l,l) - epse (indev)=cons0 !constant - epsedn(indev)=cons0 !constant - indev=indev+1 -cc - - do n=l+2,jcap+1,2 - rn=n - f1=n*n-l*l - f2=4*n*n-1 - val=sqrt(f1/f2) - epse (indev)=val - epsedn(indev)=val/rn - indev=indev+1 - enddo -cc - enddo -cc -cc -cc...................................................................... -cc -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasod=ls_node(locl,3) - indod=indlsod(l+1,l) -cc - do n=l+1,jcap+1,2 - rn=n - f1=n*n-l*l - f2=4*n*n-1 - val=sqrt(f1/f2) - epso (indod)=val - epsodn(indod)=val/rn - indod=indod+1 - enddo -cc - enddo -cc - return - end - - end module epslon_stochy_mod diff --git a/stochastic_physics/four_to_grid_stochy.F b/stochastic_physics/four_to_grid_stochy.F deleted file mode 100644 index 5f26a0a7e..000000000 --- a/stochastic_physics/four_to_grid_stochy.F +++ /dev/null @@ -1,271 +0,0 @@ - module four_to_grid_mod - - use stochy_ccpp, only: num_parthds_stochy => ompthreads - - implicit none - - contains - - subroutine four_to_grid(syn_gr_a_1,syn_gr_a_2, - & lon_dim_coef,lon_dim_grid,lons_lat,lot) -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - use machine - implicit none -!! - real(kind=kind_dbl_prec) syn_gr_a_1(lon_dim_coef,lot) - real(kind=kind_dbl_prec) syn_gr_a_2(lon_dim_grid,lot) - integer lon_dim_coef - integer lon_dim_grid - integer lons_lat - integer lot -!________________________________________________________ -#ifdef MKL - integer*8 plan -#else - real(kind=kind_dbl_prec) aux1crs(42002) - real(kind=kind_dbl_prec) scale_ibm - integer ibmsign - integer init -#endif - integer lot_thread - integer num_threads - integer nvar_thread_max - integer nvar_1 - integer nvar_2 - integer thread -#ifdef MKL - include "fftw/fftw3.f" - integer NULL -#else - external dcrft - external scrft -#endif -!________________________________________________________ - num_threads = min(num_parthds_stochy,lot) - - nvar_thread_max = (lot+num_threads-1)/num_threads - - if ( kind_dbl_prec == 8 ) then !------------------------------------ -#ifdef MKL -!$omp parallel do shared(syn_gr_a_1,syn_gr_a_2,lons_lat) -!$omp+shared(lon_dim_coef,lon_dim_grid) -!$omp+shared(lot,num_threads,nvar_thread_max) -!$omp+private(thread,nvar_1,nvar_2,lot_thread,plan) -#else -!$omp parallel do shared(syn_gr_a_1,syn_gr_a_2,lons_lat) -!$omp+shared(lon_dim_coef,lon_dim_grid) -!$omp+shared(lot,num_threads,nvar_thread_max) -!$omp+shared(ibmsign,scale_ibm) -!$omp+private(thread,nvar_1,nvar_2,lot_thread,init,aux1crs) -#endif - do thread=1,num_threads ! start of thread loop .............. - nvar_1=(thread-1)*nvar_thread_max + 1 - nvar_2=min(nvar_1+nvar_thread_max-1,lot) - - lot_thread=nvar_2 - nvar_1 + 1 - - if (nvar_2 >= nvar_1) then -#ifdef MKL - !call dfftw_plan_many_dft_c2r( - ! plan, 1, N, m, & - ! X, NULL, 1, dimx, & - ! Y, NULL, 1, dimy, & - ! fftw_flag) - call dfftw_plan_many_dft_c2r( & - & plan, 1, lons_lat, lot_thread, & - & syn_gr_a_1, NULL, 1, size(syn_gr_a_1,dim=1), & - & syn_gr_a_2, NULL, 1, size(syn_gr_a_2,dim=1), & - & FFTW_ESTIMATE) - call dfftw_execute(plan) - call dfftw_destroy_plan(plan) -#else - init = 1 - ibmsign = -1 - scale_ibm = 1.0d0 - - call dcrft(init, - & syn_gr_a_1(1,nvar_1) ,lon_dim_coef/2, - & syn_gr_a_2(1,nvar_1) ,lon_dim_grid, - & lons_lat,lot_thread,ibmsign,scale_ibm, - & aux1crs,22000, - & aux1crs(22001),20000) - - init = 0 - call dcrft(init, - & syn_gr_a_1(1,nvar_1) ,lon_dim_coef/2, - & syn_gr_a_2(1,nvar_1) ,lon_dim_grid, - & lons_lat,lot_thread,ibmsign,scale_ibm, - & aux1crs,22000, - & aux1crs(22001),20000) -#endif - endif - - enddo ! fin thread loop ...................................... - else !------------------------------------------------------------ -#ifdef MKL -!$omp parallel do shared(syn_gr_a_1,syn_gr_a_2,lons_lat) -!$omp+shared(lon_dim_coef,lon_dim_grid) -!$omp+shared(lot,num_threads,nvar_thread_max) -!$omp+private(thread,nvar_1,nvar_2,lot_thread,plan) -#else -!$omp parallel do shared(syn_gr_a_1,syn_gr_a_2,lons_lat) -!$omp+shared(lon_dim_coef,lon_dim_grid) -!$omp+shared(lot,num_threads,nvar_thread_max) -!$omp+shared(ibmsign,scale_ibm) -!$omp+private(thread,nvar_1,nvar_2,lot_thread,init,aux1crs) -#endif - do thread=1,num_threads ! start of thread loop .............. - nvar_1 = (thread-1)*nvar_thread_max + 1 - nvar_2 = min(nvar_1+nvar_thread_max-1,lot) - - lot_thread = nvar_2 - nvar_1 + 1 - - if (nvar_2 >= nvar_1) then -#ifdef MKL - !call sfftw_plan_many_dft_c2r( - ! plan, 1, N, m, & - ! X, NULL, 1, dimx, & - ! Y, NULL, 1, dimy, & - ! fftw_flag) - call sfftw_plan_many_dft_c2r( & - & plan, 1, lons_lat, lot_thread, & - & syn_gr_a_1, NULL, 1, size(syn_gr_a_1,dim=1), & - & syn_gr_a_2, NULL, 1, size(syn_gr_a_2,dim=1), & - & FFTW_ESTIMATE) - call sfftw_execute(plan) - call sfftw_destroy_plan(plan) -#else - init = 1 - ibmsign = -1 - scale_ibm = 1.0d0 - call scrft(init, - & syn_gr_a_1(1,nvar_1) ,lon_dim_coef/2, - & syn_gr_a_2(1,nvar_1) ,lon_dim_grid, - & lons_lat,lot_thread,ibmsign,scale_ibm, - & aux1crs,22000, - & aux1crs(22001),20000, - & aux1crs(22001),0) - init = 0 - call scrft(init, - & syn_gr_a_1(1,nvar_1) ,lon_dim_coef/2, - & syn_gr_a_2(1,nvar_1) ,lon_dim_grid, - & lons_lat,lot_thread,ibmsign,scale_ibm, - & aux1crs,22000, - & aux1crs(22001),20000, - & aux1crs(22001),0) -#endif - endif - enddo ! fin thread loop ...................................... - endif !----------------------------------------------------------- -!! - return - end - subroutine grid_to_four(anl_gr_a_2,anl_gr_a_1, - & lon_dim_grid,lon_dim_coef,lons_lat,lot) -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - use machine - implicit none -!! - real(kind=kind_dbl_prec) anl_gr_a_2(lon_dim_grid,lot) - real(kind=kind_dbl_prec) anl_gr_a_1(lon_dim_coef,lot) - integer lon_dim_grid - integer lon_dim_coef - integer lons_lat - integer lot -!________________________________________________________ - real(kind=kind_dbl_prec) aux1crs(42002) - real(kind=kind_dbl_prec) scale_ibm,rone - integer ibmsign - integer init - integer lot_thread - integer num_threads - integer nvar_thread_max - integer nvar_1,nvar_2 - integer thread -!________________________________________________________ -#ifdef MKL - write(0,*) "ERROR in grid_to_four: srcft and drcft ", - & " must be replaced with MKL's FFTW calls. ABORT." - call sleep(5) - stop -#endif - num_threads=min(num_parthds_stochy,lot) - - nvar_thread_max=(lot+num_threads-1)/num_threads - - if ( kind_dbl_prec == 8 ) then !------------------------------------ -!$omp parallel do shared(anl_gr_a_1,anl_gr_a_2,lons_lat) -!$omp+shared(lon_dim_coef,lon_dim_grid) -!$omp+shared(lot,num_threads,nvar_thread_max) -!$omp+shared(ibmsign,scale_ibm,rone) -!$omp+private(thread,nvar_1,nvar_2,lot_thread,init,aux1crs) - - do thread=1,num_threads ! start of thread loop .............. - nvar_1 = (thread-1)*nvar_thread_max + 1 - nvar_2 = min(nvar_1+nvar_thread_max-1,lot) - - if (nvar_2 >= nvar_1) then - lot_thread = nvar_2 - nvar_1 + 1 - - init = 1 - ibmsign = 1 - rone = 1.0d0 - scale_ibm = rone/lons_lat - call drcft(init, - & anl_gr_a_2(1,nvar_1), lon_dim_grid, - & anl_gr_a_1(1,nvar_1), lon_dim_coef/2, - & lons_lat,lot_thread,ibmsign,scale_ibm, - & aux1crs,22000, - & aux1crs(22001),20000) - init = 0 - call drcft(init, - & anl_gr_a_2(1,nvar_1), lon_dim_grid, - & anl_gr_a_1(1,nvar_1), lon_dim_coef/2, - & lons_lat,lot_thread,ibmsign,scale_ibm, - & aux1crs,22000, - & aux1crs(22001),20000) - - endif - enddo ! fin thread loop ...................................... - else !------------------------------------------------------------ -!$omp parallel do shared(anl_gr_a_1,anl_gr_a_2,lons_lat) -!$omp+shared(lon_dim_coef,lon_dim_grid) -!$omp+shared(lot,num_threads,nvar_thread_max) -!$omp+shared(ibmsign,scale_ibm,rone) -!$omp+private(thread,nvar_1,nvar_2,lot_thread,init,aux1crs) - - do thread=1,num_threads ! start of thread loop .............. - nvar_1 = (thread-1)*nvar_thread_max + 1 - nvar_2 = min(nvar_1+nvar_thread_max-1,lot) - - if (nvar_2 >= nvar_1) then - lot_thread=nvar_2 - nvar_1 + 1 - - init = 1 - ibmsign = 1 - rone = 1.0d0 - scale_ibm = rone/lons_lat - call srcft(init, - & anl_gr_a_2(1,nvar_1), lon_dim_grid, - & anl_gr_a_1(1,nvar_1), lon_dim_coef/2, - & lons_lat,lot_thread,ibmsign,scale_ibm, - & aux1crs,22000, - & aux1crs(22001),20000, - & aux1crs(22001),0) - init = 0 - call srcft(init, - & anl_gr_a_2(1,nvar_1), lon_dim_grid, - & anl_gr_a_1(1,nvar_1), lon_dim_coef/2, - & lons_lat,lot_thread,ibmsign,scale_ibm, - & aux1crs,22000, - & aux1crs(22001),20000, - & aux1crs(22001),0) - - endif - enddo ! fin thread loop ...................................... - endif !----------------------------------------------------------- -!! - return - end - - end module four_to_grid_mod diff --git a/stochastic_physics/function2 b/stochastic_physics/function2 deleted file mode 100644 index f3328235b..000000000 --- a/stochastic_physics/function2 +++ /dev/null @@ -1,5 +0,0 @@ -!cc - indlsev(n,l) = jbasev + (n-l)/2 + 1 -!cc - indlsod(n,l) = jbasod + (n-l)/2 + 1 -!cc diff --git a/stochastic_physics/function_indlsev b/stochastic_physics/function_indlsev deleted file mode 100644 index 94e605cfb..000000000 --- a/stochastic_physics/function_indlsev +++ /dev/null @@ -1,3 +0,0 @@ -!cc - indlsev(n,l) = jbasev + (n-l)/2 + 1 -!cc diff --git a/stochastic_physics/function_indlsod b/stochastic_physics/function_indlsod deleted file mode 100644 index 16c4e7996..000000000 --- a/stochastic_physics/function_indlsod +++ /dev/null @@ -1,3 +0,0 @@ -!cc - indlsod(n,l) = jbasod + (n-l)/2 + 1 -!cc diff --git a/stochastic_physics/get_lats_node_a_stochy.f b/stochastic_physics/get_lats_node_a_stochy.f deleted file mode 100644 index 62bc7b293..000000000 --- a/stochastic_physics/get_lats_node_a_stochy.f +++ /dev/null @@ -1,92 +0,0 @@ - module get_lats_node_a_stochy_mod - - implicit none - - contains - - subroutine get_lats_node_a_stochy(me_fake,global_lats_a, - & lats_nodes_a_fake,gl_lats_index, - & global_time_sort_index,iprint) -cc - use stochy_resol_def - use spectral_layout_mod - implicit none -cc - integer gl_lats_index,gl_start - integer me_fake - integer global_lats_a(latg) - integer lats_nodes_a_fake - integer iprint -cc - integer ijk - integer jptlats - integer lat - integer node,nodesio - integer global_time_sort_index(latg) - integer nodes_tmp -cc -c -!jw if (liope) then -!jw if (icolor.eq.2) then -!jw nodesio=1 -!jw else - nodesio=nodes -!jw endif -!jw else -!jw nodesio=nodes -!jw endif -!! -cc - lat = 1 - nodes_tmp = nodes -!jw if (liope .and. icolor .eq. 2) nodes_tmp = nodes -1 - - gl_start = gl_lats_index -cc............................................. - do ijk=1,latg -cc - do node=1,nodes_tmp - if (node.eq.me_fake+1) then - gl_lats_index=gl_lats_index+1 - global_lats_a(gl_lats_index) = global_time_sort_index(lat) - endif - lat = lat + 1 - if (lat .gt. latg) go to 200 - enddo -cc - do node=nodes_tmp,1,-1 - if (node.eq.me_fake+1) then - gl_lats_index=gl_lats_index+1 - global_lats_a(gl_lats_index) = global_time_sort_index(lat) - endif - lat = lat + 1 - if (lat .gt. latg) go to 200 - enddo -cc - enddo -cc............................................. -cc - 200 continue -cc -cc............................................. -cc -!jw if (liope .and. icolor .eq. 2) gl_start = 0 - do node=1,nodes_tmp - if (node.eq.me_fake+1) then - lats_nodes_a_fake=gl_lats_index-gl_start -c$$$ print*,' setting lats_nodes_a_fake = ', -c$$$ . lats_nodes_a_fake - endif - enddo - - if(iprint.eq.1) print 220 - 220 format ('completed loop 200 in get_lats_a ') -c - if(iprint.eq.1) - & print*,'completed get_lats_node, lats_nodes_a_fake=', - & lats_nodes_a_fake -cc - return - end - - end module get_lats_node_a_stochy_mod diff --git a/stochastic_physics/get_ls_node_stochy.f b/stochastic_physics/get_ls_node_stochy.f deleted file mode 100644 index 51d9f85c3..000000000 --- a/stochastic_physics/get_ls_node_stochy.f +++ /dev/null @@ -1,81 +0,0 @@ - module get_ls_node_stochy_mod - - implicit none - - contains - - subroutine get_ls_node_stochy(me_fake,ls_node,ls_max_node_fake, - c iprint) -! - use stochy_resol_def - use spectral_layout_mod - implicit none -! - integer me_fake, ls_max_node_fake, iprint - integer ls_node(ls_dim) - - integer ijk, jptls, l, node, nodesio -! -!jw if (liope) then -!jw if (icolor.eq.2) then -!jw nodesio=1 -!jw else - - nodesio = nodes - -!jw endif -!jw else -!jw nodesio=nodes -!jw endif -!! - ls_node = -1 -! - jptls = 0 - l = 0 -!............................................. - do ijk=1,jcap1 -! - do node=1,nodesio - if (node == me_fake+1) then - jptls = jptls + 1 - ls_node(jptls) = l - endif - l = l + 1 - if (l > jcap) go to 200 - enddo -! - do node=nodesio,1,-1 - if (node == me_fake+1) then - jptls = jptls + 1 - ls_node(jptls) = l - endif - l = l + 1 - if (l > jcap) go to 200 - enddo -! - enddo -!............................................. -! - 200 continue -! -!............................................. -! - if(iprint == 1) print *, 'completed loop 200 in get_ls_node' - ls_max_node_fake = 0 - do ijk=1,ls_dim - if(ls_node(ijk) >= 0) then - ls_max_node_fake = ijk - if(iprint == 1) - & print 230, me_fake, ijk, ls_node(ijk) - endif - 230 format ('me_fake=',i5,' get_ls_node ls_node(', i5, ')=',i5) - enddo -! - if(iprint == 1) - & print*,'completed get_ls_node, ls_max_node_fake=', - & ls_max_node_fake -! - return - end - - end module get_ls_node_stochy_mod diff --git a/stochastic_physics/get_stochy_pattern.F90 b/stochastic_physics/get_stochy_pattern.F90 deleted file mode 100644 index 0ccaf7f2e..000000000 --- a/stochastic_physics/get_stochy_pattern.F90 +++ /dev/null @@ -1,527 +0,0 @@ -!>\file get_stochy_pattern.F90 -!! This file includes random pattern generators for FV3GFS stochastic physics. - -!>\ingroup gfs_stoch -!! This module contains random pattern generators for FV3GFS stochastic physics. -module get_stochy_pattern_mod - use machine, only : kind_dbl_prec, kind_evod - use stochy_ccpp, only : nodes => mpisize, stochy_la2ga - use stochy_resol_def, only : latg, latg2, levs, lonf, skeblevs - use spectral_layout_mod, only : ipt_lats_node_a, lat1s_a, lats_dim_a, & - lats_node_a, lon_dim_a, len_trie_ls, & - len_trio_ls, ls_dim - use stochy_namelist_def, only : nsfcpert, ntrunc, stochini - use stochy_data_mod, only : gg_lats, gg_lons, inttyp, nskeb, nshum, nsppt, & - rad2deg, rnlat, rpattern_sfc, rpattern_skeb, & - rpattern_shum, rpattern_sppt, skebu_save, & - skebv_save, skeb_vwts, skeb_vpts, wlon - use stochy_gg_def, only : coslat_a - use stochy_patterngenerator_mod, only: random_pattern, ndimspec, & - patterngenerator_advance - use stochy_internal_state_mod, only: stochy_internal_state - use stochy_ccpp, only : is_master, mp_reduce_sum, mpicomm - use GFS_typedefs, only: GFS_control_type, GFS_grid_type - use mersenne_twister, only: random_seed - use dezouv_stochy_mod, only: dezouv_stochy - use dozeuv_stochy_mod, only: dozeuv_stochy - use four_to_grid_mod, only: four_to_grid - use sumfln_stochy_mod, only: sumfln_stochy - implicit none - private - - public get_random_pattern_fv3,get_random_pattern_fv3_vect - public get_random_pattern_sfc_fv3 - public dump_patterns - logical :: first_call=.true. - contains - -!> This subroutine generates a random pattern for stochastic physics. -subroutine get_random_pattern_fv3(rpattern,npatterns,& - gis_stochy,Model,Grid,nblks,maxlen,pattern_2d) - -! generate a random pattern for stochastic physics - implicit none - type(random_pattern), intent(inout) :: rpattern(npatterns) - type(stochy_internal_state) :: gis_stochy - type(GFS_control_type), intent(in) :: Model - type(GFS_grid_type), intent(in) :: Grid(nblks) - integer,intent(in):: npatterns,nblks,maxlen - - integer i,j,l,lat,ierr,n,nn,k,nt - real(kind=kind_dbl_prec), dimension(lonf,gis_stochy%lats_node_a,1):: wrk2d - - integer :: num2d -! logical lprint - - real(kind=kind_dbl_prec), allocatable, dimension(:,:) :: workg - real (kind=kind_dbl_prec) glolal(lonf,gis_stochy%lats_node_a) - integer kmsk0(lonf,gis_stochy%lats_node_a),len - real(kind=kind_dbl_prec) :: globalvar,globalvar0 - real(kind=kind_dbl_prec) :: pattern_2d(nblks,maxlen) - real(kind=kind_dbl_prec) :: pattern_1d(maxlen) - real(kind=kind_dbl_prec), allocatable, dimension(:,:) :: rslmsk - integer :: blk - - kmsk0 = 0 - glolal = 0. - do n=1,npatterns - call patterngenerator_advance(rpattern(n),1,.false.) - call scalarspect_to_gaugrid( & - rpattern(n)%spec_e,rpattern(n)%spec_o,wrk2d,& - gis_stochy%ls_node,gis_stochy%ls_nodes,gis_stochy%max_ls_nodes,& - gis_stochy%lats_nodes_a,gis_stochy%global_lats_a,gis_stochy%lonsperlat,& - gis_stochy%plnev_a,gis_stochy%plnod_a,1) - glolal = glolal + wrk2d(:,:,1) - enddo - - allocate(workg(lonf,latg)) - workg = 0. - do j=1,gis_stochy%lats_node_a - lat=gis_stochy%global_lats_a(ipt_lats_node_a-1+j) - do i=1,lonf - workg(i,lat) = glolal(i,j) - enddo - enddo - - call mp_reduce_sum(workg,lonf,latg) - -! interpolate to cube grid - - allocate(rslmsk(lonf,latg)) - do blk=1,nblks - len=size(Grid(blk)%xlat,1) - pattern_1d = 0 - associate( tlats=>Grid(blk)%xlat*rad2deg,& - tlons=>Grid(blk)%xlon*rad2deg ) - call stochy_la2ga(workg,lonf,latg,gg_lons,gg_lats,wlon,rnlat,& - pattern_1d(1:len),len,rslmsk,tlats,tlons) - pattern_2d(blk,:)=pattern_1d(:) - end associate - enddo - deallocate(rslmsk) - deallocate(workg) - -end subroutine get_random_pattern_fv3 - -!> This subroutine generates a random pattern for surface perturbations of -!! stochastic physics. -subroutine get_random_pattern_sfc_fv3(rpattern,npatterns,& - gis_stochy,Model,Grid,nblks,maxlen,pattern_3d) - -! generate a random pattern for stochastic physics - implicit none - type(random_pattern), intent(inout) :: rpattern(npatterns) - type(stochy_internal_state), target :: gis_stochy - type(GFS_control_type), intent(in) :: Model - type(GFS_grid_type), intent(in) :: Grid(nblks) - integer,intent(in):: npatterns,nblks,maxlen - - integer i,j,l,lat,ierr,n,nn,k,nt - real(kind=kind_dbl_prec), dimension(lonf,gis_stochy%lats_node_a,1):: wrk2d - - integer :: num2d -! logical lprint - - real(kind=kind_dbl_prec), allocatable, dimension(:,:) :: workg - real (kind=kind_dbl_prec) glolal(lonf,gis_stochy%lats_node_a) - integer kmsk0(lonf,gis_stochy%lats_node_a),len - real(kind=kind_dbl_prec) :: globalvar,globalvar0 - real(kind=kind_dbl_prec) :: pattern_3d(nblks,maxlen,nsfcpert) - real(kind=kind_dbl_prec) :: pattern_1d(maxlen) - real(kind=kind_dbl_prec), allocatable, dimension(:,:) :: rslmsk - integer :: blk - - do k=1,nsfcpert - kmsk0 = 0 - glolal = 0. - do n=1,npatterns - if (is_master()) print *, 'Random pattern for SFC-PERTS in get_random_pattern_sfc_fv3: k, min, max ',k,minval(rpattern_sfc(n)%spec_o(:,:,k)), maxval(rpattern_sfc(n)%spec_o(:,:,k)) - call scalarspect_to_gaugrid( & - rpattern(n)%spec_e(:,:,k),rpattern(n)%spec_o(:,:,k),wrk2d,& - gis_stochy%ls_node,gis_stochy%ls_nodes,gis_stochy%max_ls_nodes,& - gis_stochy%lats_nodes_a,gis_stochy%global_lats_a,gis_stochy%lonsperlat,& - gis_stochy%plnev_a,gis_stochy%plnod_a,1) - glolal = glolal + wrk2d(:,:,1) - enddo - - allocate(workg(lonf,latg)) - workg = 0. - do j=1,gis_stochy%lats_node_a - lat=gis_stochy%global_lats_a(ipt_lats_node_a-1+j) - do i=1,lonf - workg(i,lat) = glolal(i,j) - enddo - enddo - - call mp_reduce_sum(workg,lonf,latg) - if (is_master()) print *, 'workg after mp_reduce_sum for SFC-PERTS in get_random_pattern_sfc_fv3: k, min, max ',k,minval(workg), maxval(workg) - -! interpolate to cube grid - - allocate(rslmsk(lonf,latg)) - do blk=1,nblks - len=size(Grid(blk)%xlat,1) - pattern_1d = 0 - associate( tlats=>Grid(blk)%xlat*rad2deg,& - tlons=>Grid(blk)%xlon*rad2deg ) - call stochy_la2ga(workg,lonf,latg,gg_lons,gg_lats,wlon,rnlat,& - pattern_1d(1:len),len,rslmsk,tlats,tlons) - pattern_3d(blk,:,k)=pattern_1d(:) - end associate - enddo - if (is_master()) print *, '3D pattern for SFC-PERTS in get_random_pattern_sfc_fv3: k, min, max ',k,minval(pattern_3d(:,:,k)), maxval(pattern_3d(:,:,k)) - deallocate(rslmsk) - deallocate(workg) - - enddo ! loop over k, nsfcpert - -end subroutine get_random_pattern_sfc_fv3 - -!> This subroutine generates a random pattern for FV3GFS stochastic physics in SKEB application. -subroutine get_random_pattern_fv3_vect(rpattern,npatterns,& - gis_stochy,Model,Grid,nblks,maxlen,upattern_3d,vpattern_3d) - -! generate a random pattern for stochastic physics - implicit none - type(GFS_control_type), intent(in) :: Model - type(GFS_grid_type), intent(in) :: Grid(nblks) - type(stochy_internal_state), target :: gis_stochy - type(random_pattern), intent(inout) :: rpattern(npatterns) - - real(kind=kind_evod), dimension(len_trie_ls,2,1) :: vrtspec_e,divspec_e - real(kind=kind_evod), dimension(len_trio_ls,2,1) :: vrtspec_o,divspec_o - integer:: npatterns,nblks,blk,len,maxlen - - real(kind=kind_dbl_prec) :: upattern_3d(nblks,maxlen,levs) - real(kind=kind_dbl_prec) :: vpattern_3d(nblks,maxlen,levs) - real(kind=kind_dbl_prec) :: pattern_1d(maxlen) - real(kind=kind_dbl_prec), allocatable, dimension(:,:) :: rslmsk - integer i,j,l,lat,ierr,n,nn,k,nt - real(kind_dbl_prec), dimension(lonf,gis_stochy%lats_node_a,1):: wrk2du,wrk2dv - - integer :: num2d -! logical lprint - - real, allocatable, dimension(:,:) :: workgu,workgv - integer kmsk0(lonf,gis_stochy%lats_node_a),i1,i2,j1 - real(kind=kind_dbl_prec) :: globalvar,globalvar0 - kmsk0 = 0 - allocate(workgu(lonf,latg)) - allocate(workgv(lonf,latg)) - allocate(rslmsk(lonf,latg)) - if (first_call) then - allocate(skebu_save(nblks,maxlen,skeblevs)) - allocate(skebv_save(nblks,maxlen,skeblevs)) - do k=2,skeblevs - workgu = 0. - workgv = 0. - do n=1,npatterns - if (.not. stochini) call patterngenerator_advance(rpattern(n),k,first_call) - ! ke norm (convert streamfunction forcing to vorticity forcing) - divspec_e = 0; divspec_o = 0. - do nn=1,2 - vrtspec_e(:,nn,1) = gis_stochy%kenorm_e*rpattern(n)%spec_e(:,nn,k) - vrtspec_o(:,nn,1) = gis_stochy%kenorm_o*rpattern(n)%spec_o(:,nn,k) - enddo - ! convert to winds - call vrtdivspect_to_uvgrid(& - divspec_e,divspec_o,vrtspec_e,vrtspec_o,& - wrk2du,wrk2dv,& - gis_stochy%ls_node,gis_stochy%ls_nodes,gis_stochy%max_ls_nodes,& - gis_stochy%lats_nodes_a,gis_stochy%global_lats_a,gis_stochy%lonsperlat,& - gis_stochy%epsedn,gis_stochy%epsodn,gis_stochy%snnp1ev,gis_stochy%snnp1od,& - gis_stochy%plnev_a,gis_stochy%plnod_a,1) - do i=1,lonf - do j=1,gis_stochy%lats_node_a - lat=gis_stochy%global_lats_a(ipt_lats_node_a-1+j) - workgu(i,lat) = workgu(i,lat) + wrk2du(i,j,1) - workgv(i,lat) = workgv(i,lat) + wrk2dv(i,j,1) - enddo - enddo - enddo - call mp_reduce_sum(workgu,lonf,latg) - call mp_reduce_sum(workgv,lonf,latg) -! interpolate to cube grid - do blk=1,nblks - len=size(Grid(blk)%xlat,1) - pattern_1d = 0 - associate( tlats=>Grid(blk)%xlat*rad2deg,& - tlons=>Grid(blk)%xlon*rad2deg ) - call stochy_la2ga(workgu,lonf,latg,gg_lons,gg_lats,wlon,rnlat,& - pattern_1d(1:len),len,rslmsk,tlats,tlons) - skebu_save(blk,:,k)=pattern_1d(:) - call stochy_la2ga(workgv,lonf,latg,gg_lons,gg_lats,wlon,rnlat,& - pattern_1d(1:len),len,rslmsk,tlats,tlons) - skebv_save(blk,:,k)=-1*pattern_1d(:) - end associate - enddo - enddo - endif - do k=1,skeblevs-1 - skebu_save(:,:,k)=skebu_save(:,:,k+1) - skebv_save(:,:,k)=skebv_save(:,:,k+1) - do n=1,npatterns - rpattern(n)%spec_e(:,:,k)=rpattern(n)%spec_e(:,:,k+1) - rpattern(n)%spec_o(:,:,k)=rpattern(n)%spec_o(:,:,k+1) - enddo - enddo - -! get pattern for last level - workgu = 0. - workgv = 0. - do n=1,npatterns -! if (stochini.AND. first_call) then -! print*,'skipping advance' -! else - call patterngenerator_advance(rpattern(n),skeblevs,first_call) -! endif -! ke norm (convert streamfunction forcing to vorticity forcing) - divspec_e = 0; divspec_o = 0. - do nn=1,2 - vrtspec_e(:,nn,1) = gis_stochy%kenorm_e*rpattern(n)%spec_e(:,nn,skeblevs) - vrtspec_o(:,nn,1) = gis_stochy%kenorm_o*rpattern(n)%spec_o(:,nn,skeblevs) - enddo - ! convert to winds - call vrtdivspect_to_uvgrid(& - divspec_e,divspec_o,vrtspec_e,vrtspec_o,& - wrk2du,wrk2dv,& - gis_stochy%ls_node,gis_stochy%ls_nodes,gis_stochy%max_ls_nodes,& - gis_stochy%lats_nodes_a,gis_stochy%global_lats_a,gis_stochy%lonsperlat,& - gis_stochy%epsedn,gis_stochy%epsodn,gis_stochy%snnp1ev,gis_stochy%snnp1od,& - gis_stochy%plnev_a,gis_stochy%plnod_a,1) - do i=1,lonf - do j=1,gis_stochy%lats_node_a - lat=gis_stochy%global_lats_a(ipt_lats_node_a-1+j) - workgu(i,lat) = workgu(i,lat) + wrk2du(i,j,1) - workgv(i,lat) = workgv(i,lat) + wrk2dv(i,j,1) - enddo - enddo - enddo - call mp_reduce_sum(workgu,lonf,latg) - call mp_reduce_sum(workgv,lonf,latg) -! interpolate to cube grid - do blk=1,nblks - len=size(Grid(blk)%xlat,1) - pattern_1d = 0 - associate( tlats=>Grid(blk)%xlat*rad2deg,& - tlons=>Grid(blk)%xlon*rad2deg ) - call stochy_la2ga(workgu,lonf,latg,gg_lons,gg_lats,wlon,rnlat,& - pattern_1d(1:len),len,rslmsk,tlats,tlons) - skebu_save(blk,:,skeblevs)=pattern_1d(:) - call stochy_la2ga(workgv,lonf,latg,gg_lons,gg_lats,wlon,rnlat,& - pattern_1d(1:len),len,rslmsk,tlats,tlons) - skebv_save(blk,:,skeblevs)=-1*pattern_1d(:) - end associate - enddo - deallocate(rslmsk) - deallocate(workgu) - deallocate(workgv) -! interpolate in the vertical ! consider moving to cubed sphere side, more memory, but less interpolations - do k=1,Model%levs - do blk=1,nblks - upattern_3d(blk,:,k) = skeb_vwts(k,1)*skebu_save(blk,:,skeb_vpts(k,1))+skeb_vwts(k,2)*skebu_save(blk,:,skeb_vpts(k,2)) - vpattern_3d(blk,:,k) = skeb_vwts(k,1)*skebv_save(blk,:,skeb_vpts(k,1))+skeb_vwts(k,2)*skebv_save(blk,:,skeb_vpts(k,2)) - enddo - enddo - first_call=.false. - -end subroutine get_random_pattern_fv3_vect - -subroutine scalarspect_to_gaugrid(& - trie_ls,trio_ls,datag,& - ls_node,ls_nodes,max_ls_nodes,& - lats_nodes_a,global_lats_a,lonsperlat,& - plnev_a,plnod_a,nlevs) - - - implicit none - real(kind=kind_dbl_prec), intent(in) :: trie_ls(len_trie_ls,2,nlevs) - real(kind=kind_dbl_prec), intent(in) :: trio_ls(len_trio_ls,2,nlevs) - real(kind=kind_dbl_prec), intent(out) :: datag(lonf,lats_node_a,nlevs) - integer, intent(in) :: ls_node(ls_dim,3),ls_nodes(ls_dim,nodes),& - nlevs,max_ls_nodes(nodes),lats_nodes_a(nodes),global_lats_a(latg),lonsperlat(latg) - real(kind=kind_dbl_prec),intent(in) :: plnev_a(len_trie_ls,latg2),plnod_a(len_trio_ls,latg2) -! local vars - real(kind=kind_dbl_prec) for_gr_a_1(lon_dim_a,nlevs,lats_dim_a) - real(kind=kind_dbl_prec) for_gr_a_2(lonf,nlevs,lats_dim_a) - integer i,j,k - integer l,lan,lat - integer lons_lat - - call sumfln_stochy(trie_ls,& - trio_ls,& - lat1s_a,& - plnev_a,plnod_a,& - nlevs,ls_node,latg2,& - lats_dim_a,nlevs,for_gr_a_1,& - ls_nodes,max_ls_nodes,& - lats_nodes_a,global_lats_a,& - lats_node_a,ipt_lats_node_a,& - lonsperlat,lon_dim_a,latg,0) - - do lan=1,lats_node_a - lat = global_lats_a(ipt_lats_node_a-1+lan) - lons_lat = lonsperlat(lat) - CALL FOUR_TO_GRID(for_gr_a_1(1,1,lan),for_gr_a_2(1,1,lan),& - lon_dim_a,lonf,lons_lat,nlevs) - enddo - - datag = 0. - do lan=1,lats_node_a - lat = global_lats_a(ipt_lats_node_a-1+lan) - lons_lat = lonsperlat(lat) - do k=1,nlevs - do i=1,lons_lat - datag(i,lan,k) = for_gr_a_2(i,k,lan) - enddo - enddo - enddo - - return - end subroutine scalarspect_to_gaugrid - -subroutine dump_patterns(sfile) - implicit none - character*120 :: sfile - integer :: stochlun,k,n - stochlun=99 - if (is_master()) then - if (nsppt > 0 .OR. nshum > 0 .OR. nskeb > 0) then - OPEN(stochlun,file=sfile,form='unformatted') - print*,'open ',sfile,' for output' - endif - endif - if (nsppt > 0) then - do n=1,nsppt - call write_pattern(rpattern_sppt(n),1,stochlun) - enddo - endif - if (nshum > 0) then - do n=1,nshum - call write_pattern(rpattern_shum(n),1,stochlun) - enddo - endif - if (nskeb > 0) then - do n=1,nskeb - do k=1,skeblevs - call write_pattern(rpattern_skeb(n),k,stochlun) - enddo - enddo - endif - close(stochlun) - end subroutine dump_patterns - subroutine write_pattern(rpattern,lev,lunptn) - implicit none - type(random_pattern), intent(inout) :: rpattern - integer, intent(in) :: lunptn,lev - real(kind_dbl_prec), allocatable :: pattern2d(:) - integer nm,nn,ierr,arrlen,isize - integer,allocatable :: isave(:) - arrlen=2*ndimspec - - allocate(pattern2d(arrlen)) - pattern2d=0.0 - ! fill in apprpriate pieces of array - !print*,'before collection...',me,maxval(rpattern%spec_e),maxval(rpattern%spec_o) & - ! ,minval(rpattern%spec_e),minval(rpattern%spec_o) - do nn=1,len_trie_ls - nm = rpattern%idx_e(nn) - if (nm == 0) cycle - pattern2d(nm) = rpattern%spec_e(nn,1,lev) - pattern2d(ndimspec+nm) = rpattern%spec_e(nn,2,lev) - enddo - do nn=1,len_trio_ls - nm = rpattern%idx_o(nn) - if (nm == 0) cycle - pattern2d(nm) = rpattern%spec_o(nn,1,lev) - pattern2d(ndimspec+nm) = rpattern%spec_o(nn,2,lev) - enddo - call mp_reduce_sum(pattern2d,arrlen) - ! write only on root process - if (is_master()) then - print*,'writing out random pattern (min/max/size)',& - minval(pattern2d),maxval(pattern2d),size(pattern2d) - !print*,'max/min pattern=',maxval(pattern2d),minval(pattern2d) - write(lunptn) ntrunc - call random_seed(size=isize) ! get seed size - allocate(isave(isize)) ! get seed - call random_seed(get=isave,stat=rpattern%rstate) ! write seed - write(lunptn) isave - write(lunptn) pattern2d - endif - deallocate(pattern2d) - end subroutine write_pattern - - - subroutine vrtdivspect_to_uvgrid(& - trie_di,trio_di,trie_ze,trio_ze,& - uug,vvg,& - ls_node,ls_nodes,max_ls_nodes,& - lats_nodes_a,global_lats_a,lonsperlar,& - epsedn,epsodn,snnp1ev,snnp1od,plnev_a,plnod_a,nlevs) - - implicit none - real(kind=kind_dbl_prec), intent(in) :: trie_di(len_trie_ls,2,nlevs) - real(kind=kind_dbl_prec), intent(in) :: trio_di(len_trio_ls,2,nlevs) - real(kind=kind_dbl_prec), intent(in) :: trie_ze(len_trie_ls,2,nlevs) - real(kind=kind_dbl_prec), intent(in) :: trio_ze(len_trio_ls,2,nlevs) - real(kind=kind_dbl_prec), intent(out) :: uug(lonf,lats_node_a,nlevs) - real(kind=kind_dbl_prec), intent(out) :: vvg(lonf,lats_node_a,nlevs) - integer, intent(in) :: ls_node(ls_dim,3),ls_nodes(ls_dim,nodes),& - nlevs,max_ls_nodes(nodes),lats_nodes_a(nodes),global_lats_a(latg),lonsperlar(latg) - real(kind=kind_dbl_prec),intent(in) :: epsedn(len_trie_ls),& - epsodn(len_trio_ls),snnp1ev(len_trie_ls),snnp1od(len_trio_ls),& - plnev_a(len_trie_ls,latg2),plnod_a(len_trio_ls,latg2) -! local vars - real(kind=kind_dbl_prec) trie_ls(len_trie_ls,2,2*nlevs) - real(kind=kind_dbl_prec) trio_ls(len_trio_ls,2,2*nlevs) - real(kind=kind_dbl_prec) for_gr_a_1(lon_dim_a,2*nlevs,lats_dim_a) - real(kind=kind_dbl_prec) for_gr_a_2(lonf,2*nlevs,lats_dim_a) - integer i,j,k - integer l,lan,lat - integer lons_lat - real (kind=kind_dbl_prec) tx1 - - do k=1,nlevs - call dezouv_stochy(trie_di(1,1,k), trio_ze(1,1,k),& - trie_ls(1,1,k), trio_ls(1,1,nlevs+k),& - epsedn,epsodn,snnp1ev,snnp1od,ls_node) - call dozeuv_stochy(trio_di(1,1,k), trie_ze(1,1,k),& - trio_ls(1,1,k), trie_ls(1,1,nlevs+k),& - epsedn,epsodn,snnp1ev,snnp1od,ls_node) - enddo - - call sumfln_stochy(trie_ls,& - trio_ls,& - lat1s_a,& - plnev_a,plnod_a,& - 2*nlevs,ls_node,latg2,& - lats_dim_a,2*nlevs,for_gr_a_1,& - ls_nodes,max_ls_nodes,& - lats_nodes_a,global_lats_a,& - lats_node_a,ipt_lats_node_a,& - lonsperlar,lon_dim_a,latg,0) - - do lan=1,lats_node_a - lat = global_lats_a(ipt_lats_node_a-1+lan) - lons_lat = lonsperlar(lat) - CALL FOUR_TO_GRID(for_gr_a_1(1,1,lan),for_gr_a_2(1,1,lan),& - lon_dim_a,lonf,lons_lat,2*nlevs) - enddo - - uug = 0.; vvg = 0. - do lan=1,lats_node_a - lat = global_lats_a(ipt_lats_node_a-1+lan) - lons_lat = lonsperlar(lat) - tx1 = 1. / coslat_a(lat) - do k=1,nlevs - do i=1,lons_lat - uug(i,lan,k) = for_gr_a_2(i,k,lan) * tx1 - vvg(i,lan,k) = for_gr_a_2(i,nlevs+k,lan) * tx1 - enddo - enddo - enddo - - return - end subroutine vrtdivspect_to_uvgrid -end module get_stochy_pattern_mod diff --git a/stochastic_physics/getcon_lag_stochy.f b/stochastic_physics/getcon_lag_stochy.f deleted file mode 100644 index e90f51279..000000000 --- a/stochastic_physics/getcon_lag_stochy.f +++ /dev/null @@ -1,89 +0,0 @@ - module getcon_lag_stochy_mod - - implicit none - - contains - - subroutine getcon_lag_stochy(lats_nodes_a,global_lats_a, - & lats_nodes_h,global_lats_h_sn, - & lonsperlat,xhalo,yhalo) - use stochy_resol_def, only : jcap,latg,latg2,lonf - use spectral_layout_mod, only : me,nodes - - use stochy_gg_def, only : colrad_a,sinlat_a - use stochy_layout_lag, only : - & ipt_lats_node_h,lat1s_h,lats_dim_h, - & lats_node_h,lats_node_h_max,lon_dim_h - use setlats_lag_stochy_mod, only: setlats_lag_stochy - implicit none -! - integer yhalo,xhalo -! - integer, dimension(nodes) :: lats_nodes_a, lats_nodes_h - integer, dimension(latg) :: lonsperlat, global_lats_a - - integer, dimension(latg+2*yhalo*nodes) :: global_lats_h_sn -! - integer i,j,l,n,lat,i1,i2,node,nodesio - integer, dimension(latg+2*yhalo*nodes) :: global_lats_h_ns -! - if (me == 0) print 100, jcap, me -100 format ('getcon_h jcap= ',i4,2x,'me=',i3) - - do lat = 1, latg2 - lonsperlat(latg+1-lat) = lonsperlat(lat) - end do - nodesio = nodes - -! print*,'con_h me,nodes,nodesio = ',me,nodes,nodesio - - call setlats_lag_stochy(lats_nodes_a,global_lats_a, - & lats_nodes_h,global_lats_h_ns,yhalo) - -! reverse order for use in set_halos - - i1 = 1 - i2 = 0 - do n=1,nodes - j = 0 - i2 = i2 + lats_nodes_h(n) - do i=i1,i2 - j = j + 1 - global_lats_h_sn(i) = global_lats_h_ns(i2+1-j) - enddo - i1 = i2 + 1 - enddo - - 830 format(10(i4,1x)) - lats_dim_h = 0 - do node=1,nodes - lats_dim_h = max(lats_dim_h, lats_nodes_h(node)) - enddo - lats_node_h = lats_nodes_h(me+1) - lats_node_h_max = 0 - do i=1,nodes - lats_node_h_max = max(lats_node_h_max, lats_nodes_h(i)) - enddo - ipt_lats_node_h = 1 - if ( me > 0 ) then - do node=1,me - ipt_lats_node_h = ipt_lats_node_h + lats_nodes_h(node) - enddo - endif - do j=1,latg2 - sinlat_a(j) = cos(colrad_a(j)) - enddo - do l=0,jcap - do lat = 1, latg2 - if ( l <= min(jcap,lonsperlat(lat)/2) ) then - lat1s_h(l) = lat - go to 200 - endif - end do - 200 continue - end do - lon_dim_h = lonf + 1 + xhalo + xhalo !even/odd - return - end - - end module getcon_lag_stochy_mod diff --git a/stochastic_physics/getcon_spectral.F90 b/stochastic_physics/getcon_spectral.F90 deleted file mode 100644 index 7eaa48ae8..000000000 --- a/stochastic_physics/getcon_spectral.F90 +++ /dev/null @@ -1,277 +0,0 @@ -module getcon_spectral_mod - - implicit none - - contains - - subroutine getcon_spectral ( ls_node,ls_nodes,max_ls_nodes, & - lats_nodes_a,global_lats_a, & - lonsperlat,latsmax, & - lats_nodes_ext,global_lats_ext, & - epse,epso,epsedn,epsodn, & - snnp1ev,snnp1od, & - plnev_a,plnod_a,pddev_a,pddod_a, & - plnew_a,plnow_a,colat1) - -! program log: -! 20110220 henry juang update code to fit mass_dp and ndslfv -! - use epslon_stochy_mod, only: epslon_stochy - use get_lats_node_a_stochy_mod, only: get_lats_node_a_stochy - use get_ls_node_stochy_mod, only: get_ls_node_stochy - use glats_stochy_mod, only: glats_stochy - use gozrineo_a_stochy_mod, only: gozrineo_a_stochy - use pln2eo_a_stochy_mod, only: pln2eo_a_stochy - use setlats_a_stochy_mod, only: setlats_a_stochy - use stochy_resol_def - use spectral_layout_mod - use stochy_gg_def - use stochy_internal_state_mod - - implicit none -! - integer i,j,k,l,lat,lan,lons_lat,n - integer ls_node(ls_dim,3),ierr -! -! ls_node(1,1) ... ls_node(ls_max_node,1) : values of L -! ls_node(1,2) ... ls_node(ls_max_node,2) : values of jbasev -! ls_node(1,3) ... ls_node(ls_max_node,3) : values of jbasod -! - integer ls_nodes(ls_dim,nodes) - integer, dimension(nodes) :: max_ls_nodes, lats_nodes_a - integer, dimension(latg) :: global_lats_a, lonsperlat -! - integer lats_nodes_ext(nodes) - integer global_lats_ext(latg+2*jintmx+2*nypt*(nodes-1)) -! - real(kind=kind_dbl_prec), dimension(len_trie_ls) :: epse, epsedn, snnp1ev - real(kind=kind_dbl_prec), dimension(len_trio_ls) :: epso, epsodn, snnp1od -! - real(kind=kind_dbl_prec), dimension(len_trie_ls,latg2) :: plnev_a, pddev_a, plnew_a - real(kind=kind_dbl_prec), dimension(len_trio_ls,latg2) :: plnod_a, pddod_a, plnow_a -! - real(kind=kind_dbl_prec), allocatable:: colrad_dp(:), wgt_dp(:),& - wgtcs_dp(:), rcs2_dp(:), epse_dp(:), epso_dp(:),& - epsedn_dp(:), epsodn_dp(:),plnev_dp(:), plnod_dp(:),& - pddev_dp(:), pddod_dp(:),plnew_dp(:), plnow_dp(:) -! - integer iprint,locl,node,& - len_trie_ls_nod, len_trio_ls_nod,& - indev, indod, indlsev,jbasev,indlsod,jbasod -! - integer gl_lats_index, latsmax - integer global_time_sort_index_a(latg) -! - real fd2 -!! - include 'function2' -! - real(kind=kind_dbl_prec) global_time_a(latg) -! - real(kind=kind_dbl_prec), parameter :: cons0 = 0.d0, cons0p5 = 0.5d0,& - cons1 = 1.d0, cons0p92 = 0.92d0 - real(kind=kind_dbl_prec) colat1 -! - gl_lats_index = 0 - global_lats_a = -1 - do lat = 1,latg !my intialize global_time_a to lonsperlat - global_time_a(lat) = lonsperlat(lat) - enddo - - do lat = 1, latg2 - lonsperlat(latg+1-lat) = lonsperlat(lat) - end do - do node=1,nodes - call get_lats_node_a_stochy( node-1, global_lats_a,lats_nodes_a(node),& - gl_lats_index,global_time_sort_index_a, iprint) - enddo - call setlats_a_stochy(lats_nodes_a,global_lats_a,iprint, lonsperlat) - - iprint = 0 - do node=1,nodes - call get_ls_node_stochy( node-1, ls_nodes(1,node),max_ls_nodes(node), iprint ) - enddo -! - len_trie_ls_max = 0 - len_trio_ls_max = 0 - do node=1,nodes -! - len_trie_ls_nod = 0 - len_trio_ls_nod = 0 - do locl=1,max_ls_nodes(node) - l=ls_nodes(locl,node) - len_trie_ls_nod = len_trie_ls_nod+(jcap+3-l)/2 - len_trio_ls_nod = len_trio_ls_nod+(jcap+2-l)/2 - enddo - len_trie_ls_max = max(len_trie_ls_max,len_trie_ls_nod) - len_trio_ls_max = max(len_trio_ls_max,len_trio_ls_nod) -! - enddo -! - iprint = 0 -! - lats_dim_a = 0 - do node=1,nodes - lats_dim_a = max(lats_dim_a,lats_nodes_a(node)) - enddo - lats_node_a = lats_nodes_a(me+1) - - lats_node_a_max = 0 - do i=1,nodes - lats_node_a_max = max(lats_node_a_max, lats_nodes_a(i)) - enddo - latsmax = lats_node_a_max - -! - ipt_lats_node_ext = 1 -! - ipt_lats_node_a = 1 - if ( me > 0 ) then - do node=1,me - ipt_lats_node_a = ipt_lats_node_a + lats_nodes_a(node) - enddo - endif - -! - iprint = 0 -! - if ( kind_dbl_prec == 8 ) then !------------------------------------ - call glats_stochy(latg2,colrad_a,wgt_a,wgtcs_a,rcs2_a,iprint) - call epslon_stochy(epse,epso,epsedn,epsodn,ls_node) - call pln2eo_a_stochy(plnev_a,plnod_a,epse,epso,colrad_a,ls_node,latg2) - call gozrineo_a_stochy(plnev_a,plnod_a,pddev_a,pddod_a, & - plnew_a,plnow_a,epse,epso,rcs2_a,wgt_a,ls_node,latg2) -! - else !------------------------------------------------------------ - allocate ( colrad_dp(latg2) ) - allocate ( wgt_dp(latg2) ) - allocate ( wgtcs_dp(latg2) ) - allocate ( rcs2_dp(latg2) ) -! - allocate ( epse_dp(len_trie_ls) ) - allocate ( epso_dp(len_trio_ls) ) - allocate ( epsedn_dp(len_trie_ls) ) - allocate ( epsodn_dp(len_trio_ls) ) -! - allocate ( plnev_dp(len_trie_ls) ) - allocate ( plnod_dp(len_trio_ls) ) - allocate ( pddev_dp(len_trie_ls) ) - allocate ( pddod_dp(len_trio_ls) ) - allocate ( plnew_dp(len_trie_ls) ) - allocate ( plnow_dp(len_trio_ls) ) - - call glats_stochy(latg2,colrad_dp,wgt_dp,wgtcs_dp,rcs2_dp,iprint) -! - do i=1,latg2 - colrad_a(i) = colrad_dp(i) - wgt_a(i) = wgt_dp(i) - wgtcs_a(i) = wgtcs_dp(i) - rcs2_a(i) = rcs2_dp(i) - enddo -! - call epslon_stochy(epse_dp,epso_dp,epsedn_dp,epsodn_dp,ls_node) -! - do i=1,len_trie_ls - epse(i) = epse_dp(i) - epsedn(i) = epsedn_dp(i) - enddo -! - do i=1,len_trio_ls - epso(i) = epso_dp(i) - epsodn(i) = epsodn_dp(i) - enddo -! - do lat=1,latg2 -! - call pln2eo_a_stochy(plnev_dp,plnod_dp,epse_dp,epso_dp,colrad_dp(lat),ls_node,1) -! - call gozrineo_a_stochy(plnev_dp,plnod_dp,pddev_dp,pddod_dp, plnew_dp,plnow_dp,& - epse_dp,epso_dp,rcs2_dp(lat),wgt_dp(lat),ls_node,1) -! - do i=1,len_trie_ls - plnev_a(i,lat) = plnev_dp(i) - pddev_a(i,lat) = pddev_dp(i) - plnew_a(i,lat) = plnew_dp(i) - enddo - do i=1,len_trio_ls - plnod_a(i,lat) = plnod_dp(i) - pddod_a(i,lat) = pddod_dp(i) - plnow_a(i,lat) = plnow_dp(i) - enddo - enddo -! - deallocate ( colrad_dp, wgt_dp, wgtcs_dp, rcs2_dp , & - epse_dp, epso_dp, epsedn_dp, epsodn_dp, & - plnev_dp, plnod_dp, pddev_dp, pddod_dp , & - plnew_dp, plnow_dp ) - endif !----------------------------------------------------------- -! -! - do locl=1,ls_max_node - l = ls_node(locl,1) - jbasev = ls_node(locl,2) - indev = indlsev(l,l) - do n = l, jcap, 2 - snnp1ev(indev) = n*(n+1) - indev = indev+1 - end do - end do -! -! - do locl=1,ls_max_node - l = ls_node(locl,1) - jbasod = ls_node(locl,3) - if ( l <= jcap-1 ) then - indod = indlsod(l+1,l) - do n = l+1, jcap, 2 - snnp1od(indod) = n*(n+1) - indod = indod+1 - end do - end if - end do -! -! - do locl=1,ls_max_node - l = ls_node(locl,1) - jbasev = ls_node(locl,2) - jbasod = ls_node(locl,3) - if (mod(L,2) == mod(jcap+1,2)) then ! set even (n-l) terms of top row to zero - snnp1ev(indlsev(jcap+1,l)) = cons0 - else ! set odd (n-l) terms of top row to zero - snnp1od(indlsod(jcap+1,l)) = cons0 - endif - enddo -! - do j=1,latg - if( j <= latg2 ) then - sinlat_a(j) = cos(colrad_a(j)) - else - sinlat_a(j) = -cos(colrad_a(latg+1-j)) - endif - coslat_a(j) = sqrt(1.-sinlat_a(j)*sinlat_a(j)) - enddo -! - do L=0,jcap - do lat = 1, latg2 - if ( L <= min(jcap,lonsperlat(lat)/2) ) then - lat1s_a(L) = lat - go to 200 - endif - end do - 200 continue - end do -! - - do j=1,lats_node_a - lat = global_lats_a(ipt_lats_node_a-1+j) - if ( lonsperlat(lat) == lonf ) then - lon_dims_a(j) = lonfx - else - lon_dims_a(j) = lonsperlat(lat) + 2 - endif - enddo -! - return - end - -end module getcon_spectral_mod diff --git a/stochastic_physics/glats_stochy.f b/stochastic_physics/glats_stochy.f deleted file mode 100644 index 4ed9d38f4..000000000 --- a/stochastic_physics/glats_stochy.f +++ /dev/null @@ -1,109 +0,0 @@ - module glats_stochy_mod - - implicit none - - contains - - subroutine glats_stochy(lgghaf,colrad,wgt,wgtcs,rcs2,iprint) -! -! Jan 2013 Henry Juang increase precision by kind_qdt_prec=16 -! to help wgt (Gaussian weighting) - use machine - implicit none - integer iter,k,k1,l2,lgghaf,iprint -! -! increase precision for more significant digit to help wgt - real(kind=kind_qdt_prec) drad,dradz,p1,p2,phi,pi,rad,rc -! real(kind=kind_qdt_prec) drad,dradz,eps,p1,p2,phi,pi,rad,rc - real(kind=kind_qdt_prec) rl2,scale,si,sn,w,x -! - real(kind=kind_dbl_prec), dimension(lgghaf) :: colrad, wgt, - & wgtcs, rcs2 -! - real(kind=kind_dbl_prec), parameter :: cons0 = 0.d0, cons1 = 1.d0, - & cons2 = 2.d0, cons4 = 4.d0, - & cons180 = 180.d0, - & cons360 = 360.d0, - & cons0p25 = 0.25d0 - real(kind=kind_qdt_prec), parameter :: eps = 1.d-20 -! -! for better accuracy to select smaller number -! eps = 1.d-12 -! eps = 1.d-20 -! - if(iprint == 1) print 101 - 101 format (' i colat colrad wgt', 12x, 'wgtcs', - & 10x, 'iter res') - si = cons1 - l2 = 2*lgghaf - rl2 = l2 - scale = cons2/(rl2*rl2) - k1 = l2-1 - pi = atan(si)*cons4 -! dradz = pi / cons360 / 10.0 -! for better accuracy to start iteration - dradz = pi / float(lgghaf) / 200.0 - rad = cons0 - do k=1,lgghaf - iter = 0 - drad = dradz -1 call poly(l2,rad,p2) -2 p1 = p2 - iter = iter + 1 - rad = rad + drad - call poly(l2,rad,p2) - if(sign(si,p1) == sign(si,p2)) go to 2 - if(drad < eps)go to 3 - rad = rad-drad - drad = drad * cons0p25 - go to 1 -3 continue - colrad(k) = rad - phi = rad * cons180 / pi - call poly(k1,rad,p1) - x = cos(rad) - w = scale * (cons1 - x*x)/ (p1*p1) - wgt(k) = w - sn = sin(rad) - w = w/(sn*sn) - wgtcs(k) = w - rc = cons1/(sn*sn) - rcs2(k) = rc - call poly(l2,rad,p1) - if(iprint == 1) - & print 102,k,phi,colrad(k),wgt(k),wgtcs(k),iter,p1 - 102 format(1x,i3,2x,f6.2,2x,f10.7,2x,e14.7,2x,e14.7,2x,i4,2x,e14.7) - enddo - if(iprint == 1) print 100,lgghaf -100 format(1h ,'shalom from 0.0e0 glats for ',i3) -! - return - end - - subroutine poly(n,rad,p) - use machine -! - implicit none -! - integer i,n -! -! increase precision for more significant digit to help wgt - real(kind=kind_qdt_prec) floati,g,p,rad,x,y1,y2,y3 -! - real(kind=kind_dbl_prec), parameter :: cons1 = 1.d0 -! - x = cos(rad) - y1 = cons1 - y2 = x - do i=2,n - g = x*y2 - floati = i - y3 = g - y1 + g - (g-y1)/floati - y1 = y2 - y2 = y3 - enddo - p = y3 - return - end - - end module glats_stochy_mod diff --git a/stochastic_physics/gozrineo_stochy.f b/stochastic_physics/gozrineo_stochy.f deleted file mode 100644 index 01210ff92..000000000 --- a/stochastic_physics/gozrineo_stochy.f +++ /dev/null @@ -1,180 +0,0 @@ - module gozrineo_a_stochy_mod - - implicit none - - contains - - subroutine gozrineo_a_stochy(plnev_a,plnod_a, - & pddev_a,pddod_a, - & plnew_a,plnow_a, - & epse,epso,rcs2_a,wgt_a,ls_node,num_lat) -cc - use stochy_resol_def - use spectral_layout_mod - use machine - implicit none -cc - real(kind=kind_dbl_prec) plnev_a(len_trie_ls,latg2) - real(kind=kind_dbl_prec) plnod_a(len_trio_ls,latg2) - real(kind=kind_dbl_prec) pddev_a(len_trie_ls,latg2) - real(kind=kind_dbl_prec) pddod_a(len_trio_ls,latg2) - real(kind=kind_dbl_prec) plnew_a(len_trie_ls,latg2) - real(kind=kind_dbl_prec) plnow_a(len_trio_ls,latg2) -cc - real(kind=kind_dbl_prec) epse(len_trie_ls) - real(kind=kind_dbl_prec) epso(len_trio_ls) -cc - real(kind=kind_dbl_prec) rcs2_a(latg2) - real(kind=kind_dbl_prec) wgt_a(latg2) -cc - integer ls_node(ls_dim,3) -cc - integer num_lat -cc -!cmr ls_node(1,1) ... ls_node(ls_max_node,1) : values of L -!cmr ls_node(1,2) ... ls_node(ls_max_node,2) : values of jbasev -!cmr ls_node(1,3) ... ls_node(ls_max_node,3) : values of jbasod -cc - integer l,lat,locl,n -cc - integer indev,indev1,indev2 - integer indod,indod1,indod2 - integer inddif -cc - real(kind=kind_dbl_prec) rn,rnp1,wcsa -cc - real(kind=kind_dbl_prec) cons0 !constant - real(kind=kind_dbl_prec) cons2 !constant - real rerth -cc - integer indlsev,jbasev - integer indlsod,jbasod -cc - include 'function2' -cc -cc - cons0 = 0.d0 !constant - cons2 = 2.d0 !constant - rerth =6.3712e+6 ! radius of earth (m) -cc -cc - do lat=1,num_lat -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - jbasod=ls_node(locl,3) -cc - rn=l -cc -cc - pddev_a(indlsev(l,l),lat) = -epso(indlsod(l+1,l)) - & * plnod_a(indlsod(l+1,l),lat) * rn - indev1 = indlsev(L,L) + 1 - if (mod(L,2).eq.mod(jcap+1,2)) then - indev2 = indlsev(jcap-1,L) - else - indev2 = indlsev(jcap ,L) - endif - indod1 = indlsod(l+1,l) - inddif = indev1 - indod1 -cc - rn =l+2 - rnp1=l+2+1 - do indev = indev1 , indev2 -cc - pddev_a(indev,lat) = epse(indev) - & * plnod_a(indev-inddif ,lat) * rnp1 - & - epso(indev-inddif+1) - & * plnod_a(indev-inddif+1,lat) * rn -cc - rn = rn + cons2 !constant - rnp1 = rnp1 + cons2 !constant - enddo -cc -cc...................................................................... - indev1 = indlsev(L,L) - if (mod(L,2).eq.mod(jcap+1,2)) then - indev2 = indlsev(jcap+1,L) - 1 - else - indev2 = indlsev(jcap ,L) - 1 - endif - indod1 = indlsod(l+1,l) - inddif = indev1 - indod1 -cc - rn =l+1 - rnp1=l+1+1 - do indev = indev1 , indev2 -cc - pddod_a(indev-inddif,lat) = epso(indev-inddif) - & * plnev_a(indev ,lat) * rnp1 - & - epse(indev+1) - & * plnev_a(indev+1,lat) * rn -cc - rn = rn + cons2 !constant - rnp1 = rnp1 + cons2 !constant - enddo -cc - enddo -cc -cc...................................................................... -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - jbasod=ls_node(locl,3) -cc - if (mod(L,2).eq.mod(jcap+1,2)) then -cc -cc set the even (n-l) terms of the top row to zero - pddev_a(indlsev(jcap+1,l),lat) = cons0 !constant -cc - else -cc -cc set the odd (n-l) terms of the top row to zero - pddod_a(indlsod(jcap+1,l),lat) = cons0 !constant -cc - endif -cc - enddo -cc -cc...................................................................... -cc - wcsa=rcs2_a(lat)/rerth -cc -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - jbasod=ls_node(locl,3) - indev1 = indlsev(L,L) - indod1 = indlsod(L+1,L) - if (mod(L,2).eq.mod(jcap+1,2)) then - indev2 = indlsev(jcap+1,L) - indod2 = indlsod(jcap ,L) - else - indev2 = indlsev(jcap ,L) - indod2 = indlsod(jcap+1,L) - endif - do indev = indev1 , indev2 -cc - pddev_a(indev,lat) = pddev_a(indev,lat) * wcsa - plnew_a(indev,lat) = plnev_a(indev,lat) * wgt_a(lat) -cc - enddo -cc - do indod = indod1 , indod2 -cc - pddod_a(indod,lat) = pddod_a(indod,lat) * wcsa - plnow_a(indod,lat) = plnod_a(indod,lat) * wgt_a(lat) -cc - enddo -cc - enddo -cc - enddo -cc - return - end - - end module gozrineo_a_stochy_mod diff --git a/stochastic_physics/initialize_spectral_mod.F90 b/stochastic_physics/initialize_spectral_mod.F90 deleted file mode 100644 index 13d1dd2f0..000000000 --- a/stochastic_physics/initialize_spectral_mod.F90 +++ /dev/null @@ -1,268 +0,0 @@ -! !module: stochy_initialize_spectral -! --- initialize module of the -! gridded component of the stochastic physics patteern -! generator, which is in spectral space -! -! !description: gfs dynamics gridded component initialize module. -! -! !revision history: -! -! oct 11 2016 P.Pegion copy of gsm/dynamics to create stand alone version -! -! !interface: -! - module initialize_spectral_mod -! -!!uses: -! - use machine - use spectral_layout_mod, only : ipt_lats_node_a, lats_node_a_max,lon_dim_a,len_trie_ls,len_trio_ls & - ,nodes,ls_max_node,lats_dim_a,ls_dim,nodes_comp,lat1s_a - use stochy_layout_lag, only : lat1s_h - use stochy_internal_state_mod - use spectral_layout_mod,only:lon_dims_a - use stochy_resol_def - use stochy_namelist_def - use stochy_ccpp, only : is_master, num_parthds_stochy => ompthreads - use stochy_gg_def, only : wgt_a,sinlat_a,coslat_a,colrad_a,wgtcs_a,rcs2_a,lats_nodes_h,global_lats_h - use getcon_spectral_mod, only: getcon_spectral - use get_ls_node_stochy_mod, only: get_ls_node_stochy - use getcon_lag_stochy_mod, only: getcon_lag_stochy -#ifndef IBM - USE omp_lib -#endif - - implicit none - - contains - - subroutine initialize_spectral(gis_stochy, rc) - -! this subroutine set up the internal state variables, -! allocate internal state arrays for initializing the gfs system. -!---------------------------------------------------------------- -! - implicit none -! -! type(stochy_internal_state), pointer, intent(inout) :: gis_stochy - type(stochy_internal_state), intent(inout) :: gis_stochy - integer, intent(out) :: rc - integer :: ierr, npe_single_member, iret,latghf - integer :: i, j, k, l, n, locl - logical :: file_exists=.false. - integer, parameter :: iunit=101 - -!------------------------------------------------------------------- - -! set up gfs internal state dimension and values for dynamics etc -!------------------------------------------------------------------- -! print*,'before allocate lonsperlat,',& -! allocated(gis_stochy%lonsperlat),'latg=',latg -! -! gis_stochy%nodes=mpp_npes() -! print*,'mpp_npes=',mpp_npes() - nodes = gis_stochy%nodes - npe_single_member = gis_stochy%npe_single_member - - lon_dim_a = lon_s + 2 - jcap=ntrunc - jcap1 = jcap+1 - jcap2 = jcap+2 - latg = lat_s - latg2 = latg/2 - lonf = lon_s - lnt = jcap2*jcap1/2 - lnuv = jcap2*jcap1 - lnt2 = lnt + lnt - lnt22 = lnt2 + 1 - lnte = (jcap2/2)*((jcap2/2)+1)-1 - lnto = (jcap2/2)*((jcap2/2)+1)-(jcap2/2) - lnted = lnte - lntod = lnto - - gis_stochy%lnt2 = lnt2 - - allocate(lat1s_a(0:jcap)) - allocate(lon_dims_a(latg)) - - allocate(wgt_a(latg2)) - allocate(wgtcs_a(latg2)) - allocate(rcs2_a(latg2)) - -!! create io communicator and comp communicator -!! - nodes_comp=nodes -! -! if (is_master()) then -! print*,'number of threads is',num_parthds_stochy -! print*,'number of mpi procs is',nodes -! endif -! - ls_dim = (jcap1-1)/nodes+1 -! print*,'allocating lonsperlat',latg - allocate(gis_stochy%lonsperlat(latg)) -! print*,'size=',size(gis_stochy%lonsperlat) - - - inquire (file="lonsperlat.dat", exist=file_exists) - if ( .not. file_exists ) then - !call mpp_error(FATAL,'Requested lonsperlat.dat data file does not exist') - gis_stochy%lonsperlat(:)=lonf - else - open (iunit,file='lonsperlat.dat',status='old',form='formatted', & - action='read',iostat=iret) - if (iret /= 0) then - write(0,*) 'error while reading lonsperlat.dat' - rc = 1 - return - end if - rewind iunit - read (iunit,*,iostat=iret) latghf,(gis_stochy%lonsperlat(i),i=1,latghf) - if (latghf+latghf /= latg) then - write(0,*)' latghf=',latghf,' not equal to latg/2=',latg/2 - if (iret /= 0) then - write(0,*) 'lonsperlat file has wrong size' - rc = 1 - return - end if - endif - do i=1,latghf - gis_stochy%lonsperlat(latg-i+1) = gis_stochy%lonsperlat(i) - enddo - close(iunit) - endif -!! -!cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -! -! write(0,*)'before allocate ls_nodes,',allocated(gis_stochy%ls_nodes),& -! 'ls_dim=', ls_dim,'nodes=',nodes - allocate ( gis_stochy%ls_node (ls_dim*3) ) - allocate ( gis_stochy%ls_nodes(ls_dim,nodes) ) - allocate ( gis_stochy%max_ls_nodes(nodes) ) -! - allocate ( gis_stochy%lats_nodes_a_fix(nodes)) ! added for mGrid -! - allocate ( gis_stochy%lats_nodes_a(nodes) ) - allocate ( gis_stochy%global_lats_a(latg) ) -! - allocate ( gis_stochy%lats_nodes_ext(nodes) ) - allocate ( gis_stochy%global_lats_ext(latg+2*jintmx+2*nypt*(nodes-1)) ) - -! internal parallel structure. Weiyu. -!--------------------------------------------------- - ALLOCATE(gis_stochy%TRIE_LS_SIZE (npe_single_member)) - ALLOCATE(gis_stochy%TRIO_LS_SIZE (npe_single_member)) - ALLOCATE(gis_stochy%TRIEO_LS_SIZE (npe_single_member)) - ALLOCATE(gis_stochy%LS_MAX_NODE_GLOBAL(npe_single_member)) - ALLOCATE(gis_stochy%LS_NODE_GLOBAL (LS_DIM*3, npe_single_member)) - - gis_stochy%LS_NODE_GLOBAL = 0 - gis_stochy%LS_MAX_NODE_GLOBAL = 0 - gis_stochy%TRIEO_TOTAL_SIZE = 0 - - DO i = 1, npe_single_member - CALL GET_LS_NODE_STOCHY(i-1, gis_stochy%LS_NODE_GLOBAL(1, i), & - gis_stochy%LS_MAX_NODE_GLOBAL(i), gis_stochy%IPRINT) - gis_stochy%TRIE_LS_SIZE(i) = 0 - gis_stochy%TRIO_LS_SIZE(i) = 0 - DO LOCL = 1, gis_stochy%LS_MAX_NODE_GLOBAL(i) - gis_stochy%LS_NODE_GLOBAL(LOCL+ LS_DIM, i) = gis_stochy%TRIE_LS_SIZE(i) - gis_stochy%LS_NODE_GLOBAL(LOCL+ 2*LS_DIM, i) = gis_stochy%TRIO_LS_SIZE(i) - - L = gis_stochy%LS_NODE_GLOBAL(LOCL, i) - - gis_stochy%TRIE_LS_SIZE(i) = gis_stochy%TRIE_LS_SIZE(i) + (JCAP+3-L)/2 - gis_stochy%TRIO_LS_SIZE(i) = gis_stochy%TRIO_LS_SIZE(i) + (JCAP+2-L)/2 - END DO - gis_stochy%TRIEO_LS_SIZE(i) = gis_stochy%TRIE_LS_SIZE(i) + gis_stochy%TRIO_LS_SIZE(i) + 3 - gis_stochy%TRIEO_TOTAL_SIZE = gis_stochy%TRIEO_TOTAL_SIZE + gis_stochy%TRIEO_LS_SIZE(i) - END DO - - -!--------------------------------------------------- -! - gis_stochy%iprint = 0 - call get_ls_node_stochy( gis_stochy%me, gis_stochy%ls_node, ls_max_node, gis_stochy%iprint ) -! -! - len_trie_ls = 0 - len_trio_ls = 0 - do locl=1,ls_max_node - gis_stochy%ls_node(locl+ ls_dim) = len_trie_ls - gis_stochy%ls_node(locl+2*ls_dim) = len_trio_ls - l = gis_stochy%ls_node(locl) - len_trie_ls = len_trie_ls+(jcap+3-l)/2 - len_trio_ls = len_trio_ls+(jcap+2-l)/2 - enddo -! if (gis_stochy%me == 0) print *,'ls_node=',gis_stochy%ls_node(1:ls_dim),'2dim=', & -! gis_stochy%ls_node(ls_dim+1:2*ls_dim),'3dim=', & -! gis_stochy%ls_node(2*ls_dim+1:3*ls_dim) -! -! - allocate ( gis_stochy%epse (len_trie_ls) ) - allocate ( gis_stochy%epso (len_trio_ls) ) - allocate ( gis_stochy%epsedn(len_trie_ls) ) - allocate ( gis_stochy%epsodn(len_trio_ls) ) - allocate ( gis_stochy%kenorm_e(len_trie_ls) ) - allocate ( gis_stochy%kenorm_o(len_trio_ls) ) -! - allocate ( gis_stochy%snnp1ev(len_trie_ls) ) - allocate ( gis_stochy%snnp1od(len_trio_ls) ) -! - allocate ( gis_stochy%plnev_a(len_trie_ls,latg2) ) - allocate ( gis_stochy%plnod_a(len_trio_ls,latg2) ) - allocate ( gis_stochy%pddev_a(len_trie_ls,latg2) ) - allocate ( gis_stochy%pddod_a(len_trio_ls,latg2) ) - allocate ( gis_stochy%plnew_a(len_trie_ls,latg2) ) - allocate ( gis_stochy%plnow_a(len_trio_ls,latg2) ) - - allocate(colrad_a(latg2)) - allocate(sinlat_a(latg)) - allocate(coslat_a(latg)) - allocate(lat1s_h(0:jcap)) -! - if(gis_stochy%iret/=0) then - write(0,*) 'incompatible namelist - aborted in stochy' - rc = 1 - return - end if -!! - gis_stochy%lats_nodes_ext = 0 - call getcon_spectral(gis_stochy%ls_node, gis_stochy%ls_nodes, & - gis_stochy%max_ls_nodes, gis_stochy%lats_nodes_a, & - gis_stochy%global_lats_a, gis_stochy%lonsperlat, & - gis_stochy%lats_node_a_max, gis_stochy%lats_nodes_ext, & - gis_stochy%global_lats_ext, gis_stochy%epse, & - gis_stochy%epso, gis_stochy%epsedn, & - gis_stochy%epsodn, gis_stochy%snnp1ev, & - gis_stochy%snnp1od, gis_stochy%plnev_a, & - gis_stochy%plnod_a, gis_stochy%pddev_a, & - gis_stochy%pddod_a, gis_stochy%plnew_a, & - gis_stochy%plnow_a, gis_stochy%colat1) -! - gis_stochy%lats_node_a = gis_stochy%lats_nodes_a(gis_stochy%me+1) - gis_stochy%ipt_lats_node_a = ipt_lats_node_a - -! if (gis_stochy%me == 0) & -! write(0,*)'after getcon_spectral lats_node_a=',gis_stochy%lats_node_a & -! ,'ipt_lats_node_a=',gis_stochy%ipt_lats_node_a -! - if (.not. allocated(lats_nodes_h)) allocate (lats_nodes_h(nodes)) - if (.not. allocated(global_lats_h)) allocate (global_lats_h(latg+2*gis_stochy%yhalo*nodes)) - call getcon_lag_stochy(gis_stochy%lats_nodes_a,gis_stochy%global_lats_a, & - lats_nodes_h, global_lats_h, & - gis_stochy%lonsperlat,gis_stochy%xhalo,gis_stochy%yhalo) - -! -! - allocate ( gis_stochy%trie_ls (len_trie_ls,2,lotls) ) - allocate ( gis_stochy%trio_ls (len_trio_ls,2,lotls) ) - -! if (gis_stochy%me == 0) then -! print*, ' lats_dim_a=', lats_dim_a, ' lats_node_a=', gis_stochy%lats_node_a -! endif - rc=0 - - end subroutine initialize_spectral - - end module initialize_spectral_mod diff --git a/stochastic_physics/pln2eo_stochy.f b/stochastic_physics/pln2eo_stochy.f deleted file mode 100644 index 4c6576ba6..000000000 --- a/stochastic_physics/pln2eo_stochy.f +++ /dev/null @@ -1,287 +0,0 @@ - module pln2eo_a_stochy_mod - - implicit none - - contains - - subroutine pln2eo_a_stochy(plnev_a,plnod_a,epse,epso,colrad_a, - & ls_node,num_lat) -! -! use x-number method to archieve accuracy due to recursive to avoid -! underflow and overflow if necessary by henry juang 2012 july -! - use stochy_resol_def - use spectral_layout_mod - use machine - implicit none -! -! define x number constant for real8 start - integer, parameter :: in_f = 960 , in_h = in_f/2 - real(kind=kind_dbl_prec), parameter :: bb_f = 2.d0 ** ( in_f ) - real(kind=kind_dbl_prec), parameter :: bs_f = 2.d0 ** (-in_f ) - real(kind=kind_dbl_prec), parameter :: bb_h = 2.d0 ** ( in_h ) - real(kind=kind_dbl_prec), parameter :: bs_h = 2.d0 ** (-in_h ) -! define x number constant end - -cc - real(kind=kind_dbl_prec) plnev_a(len_trie_ls,latg2) - real(kind=kind_dbl_prec) plnod_a(len_trio_ls,latg2) -cc - real(kind=kind_dbl_prec) epse(len_trie_ls) - real(kind=kind_dbl_prec) epso(len_trio_ls) -cc - real(kind=kind_dbl_prec) colrad_a(latg2) -cc - integer ls_node(ls_dim,3) -cc - integer num_lat -cc -!cmr ls_node(1,1) ... ls_node(ls_max_node,1) : values of L -!cmr ls_node(1,2) ... ls_node(ls_max_node,2) : values of jbasev -!cmr ls_node(1,3) ... ls_node(ls_max_node,3) : values of jbasod -cc - integer l,lat,locl,max_l,n -cc - integer indev - integer indod -cc -! need index for alp to be x-number - integer id, ialp1, ialp2, ialp3, iprod - integer ialp10(0:jcap) - real(kind=kind_dbl_prec) aa, bb, w - - real(kind=kind_dbl_prec) a,alp1,alp2,alp3,b - real(kind=kind_dbl_prec) cos2,fl,prod,sinlat,coslat -cc - real(kind=kind_dbl_prec) alp10(0:jcap) -cc - real(kind=kind_dbl_prec) cons0,cons0p5,cons1,cons2,cons3 !constant -cc -cc - integer indlsev,jbasev - integer indlsod,jbasod -cc - include 'function2' -cc -cc - cons0=0.0d0 !constant - cons0p5=0.5d0 !constant - cons1=1.0d0 !constant - cons2=2.0d0 !constant - cons3=3.0d0 !constant -cc -cc - max_l=-1 - do locl=1,ls_max_node - max_l = max ( max_l, ls_node(locl,1) ) - enddo -cc -cc - do lat=1,num_lat -cc - sinlat = cos(colrad_a(lat)) - cos2=cons1-sinlat*sinlat !constant - coslat = sqrt(cos2) - -! use x number for alp10 - alp10(0) = sqrt(0.5) - ialp10(0) = 0 - - do l=1,max_l - fl = l - prod=coslat*sqrt(cons1+cons1/(cons2*fl)) - iprod=0 - w = abs(prod) - if( w.ge.bb_h ) then - prod = prod * bs_f - iprod = iprod + 1 - elseif( w.lt.bs_h ) then - prod = prod * bb_f - iprod = iprod - 1 - endif - alp10(l)=alp10(l-1)*prod - ialp10(l)=ialp10(l-1)+iprod - w = abs(alp10(l)) - if( w.ge.bb_h ) then - alp10(l) = alp10(l) * bs_f - ialp10(l) = ialp10(l) + 1 - elseif( w.lt.bs_h ) then - alp10(l) = alp10(l) * bb_f - ialp10(l) = ialp10(l) - 1 - endif - enddo -cc - do locl=1,ls_max_node - l=ls_node(locl,1) - jbasev=ls_node(locl,2) - jbasod=ls_node(locl,3) - n=l - fl=l -! get m=normalized x number for alp1 start - alp1=alp10(l) - ialp1=ialp10(l) - - indev=indlsev(n ,l) - indod=indlsod(n+1,l) -! x2f plnev_a(indev ,lat)=alp1 -! x2f start - if( ialp1.eq.0 ) then - plnev_a(indev ,lat)=alp1 - elseif( ialp1.eq.-1 ) then - plnev_a(indev ,lat)=alp1 * bs_f - elseif( ialp1.lt.-1 ) then - plnev_a(indev ,lat)=0.0 -!! plnev_a(indev ,lat)=alp1 * bs_f * bs_f - else - plnev_a(indev ,lat)=alp1 * bb_f - endif -! x2f end - -! xltime alp2=sqrt(cons2*fl+cons3)*sinlat*alp1 !constant -! xltime start - prod=sqrt(cons2*fl+cons3)*sinlat - iprod=0 - w = abs(prod) - if( w.ge.bb_h ) then - prod = prod * bs_f - iprod = iprod + 1 - elseif( w.lt.bs_h ) then - prod = prod * bb_f - iprod = iprod - 1 - endif - alp2=alp1*prod - ialp2 = ialp1 + iprod -! xltime end -! norm alp2 start - w = abs(alp2) - if( w.ge.bb_h ) then - alp2 = alp2*bs_f - ialp2 = ialp2 + 1 - elseif( w.lt.bs_h ) then - alp2 = alp2*bb_f - ialp2 = ialp2 - 1 - endif -! norm alp2 end - -! x2f plnod_a(indod ,lat)=alp2 -! x2f start - if( ialp2.eq.0 ) then - plnod_a(indod ,lat)=alp2 - elseif( ialp2.eq.-1 ) then - plnod_a(indod ,lat)=alp2 * bs_f - elseif( ialp2.lt.-1 ) then - plnod_a(indod ,lat)=0.0 -!! plnod_a(indod ,lat)=alp2 * bs_f * bs_f - else - plnod_a(indod ,lat)=alp2 * bb_f - endif -! x2f end -cc - do n=l+2,jcap+1 - if(mod(n+l,2).eq.0) then - indev=indev+1 -! xlsum2 start - aa = sinlat / epse(indev) - bb = epso(indod) / epse(indev) - id = ialp2 - ialp1 - if( id.eq.0 ) then - alp3 = aa*alp2 - bb*alp1 - ialp3 = ialp1 - elseif( id.eq.1 ) then - alp3 = aa*alp2 - bb*alp1*bs_f - ialp3 = ialp2 - elseif( id.eq.-1 ) then - alp3 = aa*alp2*bs_f - bb*alp1 - ialp3 = ialp1 - elseif( id.gt.1 ) then - alp3 = aa*alp2 - ialp3 = ialp2 - else - alp3 = - bb*alp1 - ialp3 = ialp1 - endif -! xlsum2 end -! xnorm alp3 start - w = abs(alp3) - if( w.ge.bb_h ) then - alp3 = alp3*bs_f - ialp3 = ialp3 + 1 - elseif( w.lt.bs_h ) then - alp3 = alp3*bb_f - ialp3 = ialp3 - 1 - endif -! xnorm alp3 end - -! x2f alp3 start - if( ialp3.eq.0 ) then - plnev_a(indev,lat)=alp3 - elseif( ialp3.eq.-1 ) then - plnev_a(indev,lat)=alp3 * bs_f - elseif( ialp3.lt.-1 ) then - plnev_a(indev,lat)=0.0 - else - plnev_a(indev,lat)=alp3 * bb_f - endif -! x2f alp3 end - - else - indod=indod+1 - -! xlsum2 start - aa = sinlat / epso(indod) - bb = epse(indev) / epso(indod) - id = ialp2 - ialp1 - if( id.eq.0 ) then - alp3 = aa*alp2 - bb*alp1 - ialp3 = ialp1 - elseif( id.eq.1 ) then - alp3 = aa*alp2 - bb*alp1*bs_f - ialp3 = ialp2 - elseif( id.eq.-1 ) then - alp3 = aa*alp2*bs_f - bb*alp1 - ialp3 = ialp1 - elseif( id.gt.1 ) then - alp3 = aa*alp2 - ialp3 = ialp2 - else - alp3 = - bb*alp1 - ialp3 = ialp1 - endif -! xlsum2 end -! xnorm alp3 start - w = abs(alp3) - if( w.ge.bb_h ) then - alp3 = alp3*bs_f - ialp3 = ialp3 + 1 - elseif( w.lt.bs_h ) then - alp3 = alp3*bb_f - ialp3 = ialp3 - 1 - endif -! xnorm alp3 end - -! x2f alp3 start - if( ialp3.eq.0 ) then - plnod_a(indod,lat)=alp3 - elseif( ialp3.eq.-1 ) then - plnod_a(indod,lat)=alp3 * bs_f - elseif( ialp3.lt.-1 ) then - plnod_a(indod,lat)=0.0 - else - plnod_a(indod,lat)=alp3 * bb_f - endif -! x2f alp3 end - endif - alp1=alp2 - alp2=alp3 - ialp1 = ialp2 - ialp2 = ialp3 - enddo -cc - enddo -cc - enddo -cc - return - end - - end module pln2eo_a_stochy_mod diff --git a/stochastic_physics/setlats_a_stochy.f b/stochastic_physics/setlats_a_stochy.f deleted file mode 100644 index 4eb4b876f..000000000 --- a/stochastic_physics/setlats_a_stochy.f +++ /dev/null @@ -1,195 +0,0 @@ - module setlats_a_stochy_mod - - implicit none - - contains - - subroutine setlats_a_stochy(lats_nodes_a,global_lats_a, - & iprint,lonsperlat) -! - use stochy_resol_def , only : latg,lonf - use spectral_layout_mod , only : nodes,me -! - implicit none -! - integer, dimension(latg) :: global_lats_a, lonsperlat - integer lats_nodes_a(nodes) - - integer iprint,opt,ifin,nodesio - &, jcount,jpt,lat,lats_sum,node,i,ii - &, ngrptg,ngrptl,ipe,irest,idp - &, ngrptgh,nodesioh -! &, ilatpe,ngrptg,ngrptl,ipe,irest,idp -! - integer,allocatable :: lats_hold(:,:) -! - allocate ( lats_hold(latg,nodes) ) -! -! iprint = 1 - iprint = 0 - opt = 1 ! reduced grid - if (opt == 2) lonsperlat = lonf ! full grid - lats_nodes_a = 0 -! if (liope .and. icolor == 2) then -! nodesio = 1 -! else - nodesio = nodes -! endif -! - ngrptg = 0 - do lat=1,latg - do i=1,lonsperlat(lat) - ngrptg = ngrptg + 1 - enddo - enddo - -! -! ngrptg contains total number of grid points. -! -! distribution of the grid - nodesioh = nodesio / 2 - - if (nodesioh*2 /= nodesio) then -! ilatpe = ngrptg / nodesio - ngrptl = 0 - ipe = 0 - irest = 0 - idp = 1 - - do lat=1,latg - ifin = lonsperlat(lat) - ngrptl = ngrptl + ifin - -! if (me == 0) -! &write(2000+me,*)'in setlats lat=',lat,' latg=',latg,' ifin=',ifin -! &,' ngrptl=',ngrptl,' nodesio=',nodesio,' ngrptg=',ngrptg -! &,' irest=',irest - - if (ngrptl*nodesio <= ngrptg+irest) then - lats_nodes_a(ipe+1) = lats_nodes_a(ipe+1) + 1 - lats_hold(idp,ipe+1) = lat - idp = idp + 1 -! if (me == 0) -! & write(2000+me,*)' nodesio1=',nodesio,' idp=',idp,' ipe=',ipe - else - ipe = ipe + 1 - if (ipe <= nodesio) lats_hold(1,ipe+1) = lat - idp = 2 - irest = irest + ngrptg - (ngrptl-ifin)*nodesio - ngrptl = ifin - lats_nodes_a(ipe+1) = lats_nodes_a(ipe+1) + 1 -! if (me == 0) -! & write(2000+me,*)' nodesio1=',nodesio,' idp=',idp,' ipe=',ipe - endif -! if (me == 0) -! & write(2000+me,*)' lat=',lat,' lats_nodes_a=',lats_nodes_a(ipe+1) -! &,' ipe+1=',ipe+1 - enddo - else - nodesioh = nodesio/2 - ngrptgh = ngrptg/2 - ngrptl = 0 - ipe = 0 - irest = 0 - idp = 1 - - do lat=1,latg/2 - ifin = lonsperlat(lat) - ngrptl = ngrptl + ifin - -! if (me == 0) -! &write(0,*)'in setlats lat=',lat,' latg=',latg,' ifin=',ifin -! &,' ngrptl=',ngrptl,' nodesio=',nodesio,' ngrptg=',ngrptg -! &,' irest=',irest,' ngrptgh=',ngrptgh,' nodesioh=',nodesioh - - if (ngrptl*nodesioh <= ngrptgh+irest .or. lat == latg/2) then - lats_nodes_a(ipe+1) = lats_nodes_a(ipe+1) + 1 - lats_hold(idp,ipe+1) = lat -! lats_nodes_a(nodesio-ipe) = lats_nodes_a(nodesio-ipe) + 1 -! lats_hold(idp,nodesio-ipe) = latg+1-lat - idp = idp + 1 -! if (me == 0) -! & write(0,*)' nodesio1=',nodesioh,' idp=',idp,' ipe=',ipe - else - ipe = ipe + 1 - if (ipe <= nodesioh) then - lats_hold(1,ipe+1) = lat -! lats_hold(1,nodesio-ipe) = latg+1-lat - endif - idp = 2 - irest = irest + ngrptgh - (ngrptl-ifin)*nodesioh - ngrptl = ifin - lats_nodes_a(ipe+1) = lats_nodes_a(ipe+1) + 1 -! lats_nodes_a(nodesio-ipe) = lats_nodes_a(nodesio-ipe) + 1 -! if (me == 0) -! & write(0,*)' nodesio1h=',nodesioh,'idp=',idp,' ipe=',ipe - endif -! if (me == 0) -! & write(0,*)' lat=',lat,' lats_nodes_a=',lats_nodes_a(ipe+1) -! &,' ipe+1=',ipe+1 - enddo - do node=1, nodesioh - ii = nodesio-node+1 - jpt = lats_nodes_a(node) - lats_nodes_a(ii) = jpt - do i=1,jpt - lats_hold(jpt+1-i,ii) = latg+1-lats_hold(i,node) - enddo - enddo - - - endif -!! -!!........................................................ -!! - jpt = 0 - do node=1,nodesio -! write(2000+me,*)'node=',node,' lats_nodes_a=',lats_nodes_a(node) -! &, ' jpt=',jpt,' nodesio=',nodesio - if ( lats_nodes_a(node) > 0 ) then - do jcount=1,lats_nodes_a(node) - global_lats_a(jpt+jcount) = lats_hold(jcount,node) -! write(2000+me,*)' jpt+jcount=',jpt+jcount -! &, 'global_lats_a=',global_lats_a(jpt+jcount) - enddo - endif - jpt = jpt + lats_nodes_a(node) - enddo -!! - deallocate (lats_hold) - if ( iprint /= 1 ) return -!! - if (me == 0) then - jpt=0 - do node=1,nodesio - if ( lats_nodes_a(node) > 0 ) then - print 600 - lats_sum=0 - do jcount=1,lats_nodes_a(node) - lats_sum=lats_sum + lonsperlat(global_lats_a(jpt+jcount)) - print 700, node-1, - x node, lats_nodes_a(node), - x jpt+jcount, global_lats_a(jpt+jcount), - x lonsperlat(global_lats_a(jpt+jcount)), - x lats_sum - enddo - endif - jpt=jpt+lats_nodes_a(node) - enddo -! - print 600 -! - 600 format ( ' ' ) -! - 700 format ( 'setlats me=', i4, - x ' lats_nodes_a(', i4, ' )=', i4, - x ' global_lats_a(', i4, ' )=', i4, - x ' lonsperlat=', i5, - x ' lats_sum=', i6 ) -! - endif - - return - end - - end module setlats_a_stochy_mod diff --git a/stochastic_physics/setlats_lag_stochy.f b/stochastic_physics/setlats_lag_stochy.f deleted file mode 100644 index ff4e4f0a6..000000000 --- a/stochastic_physics/setlats_lag_stochy.f +++ /dev/null @@ -1,127 +0,0 @@ - module setlats_lag_stochy_mod - - implicit none - - contains - - subroutine setlats_lag_stochy(lats_nodes_a, global_lats_a, - & lats_nodes_h, global_lats_h, yhalo) -! - use stochy_resol_def, only : latg - use spectral_layout_mod, only : me,nodes - implicit none -! - integer yhalo -! - integer lats_nodes_a(nodes), lats_nodes_h(nodes) - &, global_lats_a(latg) - &, global_lats_h(latg+2*yhalo*nodes) -! - integer jj,jpt_a,jpt_h,lat_val,nn,nodes_lats - &, j1, j2, iprint -! - lats_nodes_h = 0 -! - nodes_lats = 0 - do nn=1,nodes - if (lats_nodes_a(nn) > 0) then - lats_nodes_h(nn) = lats_nodes_a(nn) + yhalo + yhalo - nodes_lats = nodes_lats + 1 - endif - enddo -! - global_lats_h = 0 -! -! set non-yhalo latitudes -! - jpt_a = 0 - jpt_h = yhalo - do nn=1,nodes - if (lats_nodes_a(nn) > 0) then - do jj=1,lats_nodes_a(nn) - jpt_a = jpt_a + 1 - jpt_h = jpt_h + 1 - global_lats_h(jpt_h) = global_lats_a(jpt_a) - enddo - jpt_h = jpt_h + yhalo + yhalo - endif - enddo -! - j1 = latg + (yhalo+yhalo) * nodes_lats - do jj=1,yhalo - j2 = yhalo - jj - global_lats_h(jj) = global_lats_a(1) + j2 ! set north pole yhalo - global_lats_h(j1-j2) = global_lats_a(latg) + 1 - jj ! set south pole yhalo - enddo -! - if (lats_nodes_a(1) /= latg) then -! -! set non-polar south yhalos - jpt_h = 0 - do nn=1,nodes-1 - jpt_h = jpt_h + lats_nodes_h(nn) - lat_val = global_lats_h(jpt_h-yhalo) - do jj=1,yhalo - global_lats_h(jpt_h-yhalo+jj) = min(lat_val+jj,latg) - enddo - enddo -! -! set non-polar north yhalos - jpt_h = 0 - do nn=1,nodes-1 - jpt_h = jpt_h + lats_nodes_h(nn) - lat_val = global_lats_h(jpt_h+yhalo+1) - do jj=1,yhalo - global_lats_h(jpt_h+yhalo-(jj-1)) = max(lat_val-jj,1) - enddo - enddo -! - endif -! - - iprint = 0 -! iprint = 1 - if (iprint == 1 .and. me == 0) then -! - write(me+6000,'("setlats_h yhalo=",i3," nodes=",i3/)') - & yhalo,nodes -! - do nn=1,nodes - write(me+6000,'("lats_nodes_a(",i4,")=",i4," ", - & " lats_nodes_h(",i4,")=",i4)') - & nn, lats_nodes_a(nn), - & nn, lats_nodes_h(nn) - enddo -! - jpt_a = 0 - do nn=1,nodes - if (lats_nodes_a(nn) > 0) then - write(me+6000,'(" ")') - do jj=1,lats_nodes_a(nn) - jpt_a=jpt_a+1 - write(me+6000,'(2i4," global_lats_a(",i4,")=",i4)') - & nn, jj, jpt_a, global_lats_a(jpt_a) - enddo - endif - enddo -! - jpt_h=0 - do nn=1,nodes - if (lats_nodes_h(nn).gt.0) then - write(me+6000,'(" ")') - do jj=1,lats_nodes_h(nn) - jpt_h=jpt_h+1 - write(me+6000,'(2i4," global_lats_h(",i4,")=",i4)') - & nn, jj, jpt_h, global_lats_h(jpt_h) - enddo - endif - enddo -! - close(6000+me) - endif -! close(6000+me) -! - return - end - - end module setlats_lag_stochy_mod diff --git a/stochastic_physics/spectral_layout.f b/stochastic_physics/spectral_layout.f deleted file mode 100644 index 687e2da82..000000000 --- a/stochastic_physics/spectral_layout.f +++ /dev/null @@ -1,31 +0,0 @@ - module spectral_layout_mod - - implicit none -! -! program log: -! 20161011 philip pegion : make stochastic pattern generator standalone -! -! 20180731 dom heinzeller : todo: cleanup nodes, me, ... (defined multiple times in confusing ways in several files) -! - - integer nodes, nodes_comp,nodes_io, - & me,lon_dim_a, - & ls_dim, - & ls_max_node, - & lats_dim_a, - & lats_node_a, - & lats_node_a_max, - & ipt_lats_node_a, - & len_trie_ls, - & len_trio_ls, - & len_trie_ls_max, - & len_trio_ls_max, - & me_l_0, - - & lats_dim_ext, - & lats_node_ext, - & ipt_lats_node_ext -! - INTEGER ,ALLOCATABLE :: lat1s_a(:), lon_dims_a(:),lon_dims_ext(:) - - end module spectral_layout_mod diff --git a/stochastic_physics/stochastic_physics.F90 b/stochastic_physics/stochastic_physics.F90 deleted file mode 100644 index 51a173173..000000000 --- a/stochastic_physics/stochastic_physics.F90 +++ /dev/null @@ -1,420 +0,0 @@ -!>\file stochastic_physics.F90 -!! This file includes - -!>\ingroup gfs_stoch -!! This module -module stochastic_physics - -use stochy_ccpp, only : is_initialized, & - is_master, & - mpicomm, & - mpirank, & - mpiroot, & - mpisize, & - ompthreads - -implicit none - -private - -public :: stochastic_physics_init, stochastic_physics_run, stochastic_physics_finalize - -contains - -!> This subroutine -!> \section arg_table_stochastic_physics_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | -!! | nthreads | omp_threads | number of OpenMP threads available for physics schemes | count | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! -subroutine stochastic_physics_init(Model, nthreads, errmsg, errflg) -use stochy_internal_state_mod -use stochy_data_mod, only : nshum,rpattern_shum,init_stochdata,rpattern_sppt,nsppt,rpattern_skeb,nskeb,gg_lats,gg_lons,& - rad2deg,INTTYP,wlon,rnlat,gis_stochy,vfact_skeb,vfact_sppt,vfact_shum,skeb_vpts,skeb_vwts,sl -use stochy_resol_def, only : latg,lonf,skeblevs -use stochy_gg_def, only : colrad_a -use stochy_namelist_def -use physcons, only: con_pi -use spectral_layout_mod, only:me -use GFS_typedefs, only: GFS_control_type - -implicit none -type(GFS_control_type), intent(inout) :: Model -integer, intent(in) :: nthreads -character(len=*), intent(out) :: errmsg -integer, intent(out) :: errflg - -integer :: nblks -integer :: iret -real*8 :: PRSI(Model%levs),PRSL(Model%levs),dx -real, allocatable :: skeb_vloc(:) -integer :: k,kflip,latghf,nodes,blk,k2 -character*2::proc - -! Initialize CCPP error handling variables -errmsg = '' -errflg = 0 - -! Set/update shared variables in stochy_ccpp -mpicomm = Model%communicator -mpirank = Model%me -mpiroot = Model%master -mpisize = Model%ntasks -ompthreads = nthreads -is_initialized = .true. - -! ------------------------------------------ - -nblks = size(Model%blksz) - -! replace -rad2deg=180.0/con_pi -INTTYP=0 ! bilinear interpolation -me=Model%me -nodes=Model%ntasks -gis_stochy%me=me -gis_stochy%nodes=nodes -call init_stochdata(Model%levs,Model%dtp,Model%input_nml_file,Model%fn_nml,Model%nlunit,iret) -! check to see decomposition -!if(Model%isppt_deep == .true.)then -!do_sppt = .true. -!endif -! check namelist entries for consistency -if (Model%do_sppt.neqv.do_sppt) then - write(errmsg,'(*(a))') 'Logic error in stochastic_physics_init: incompatible', & - & ' namelist settings do_sppt and sppt' - errflg = 1 -else if (Model%do_shum.neqv.do_shum) then - write(errmsg,'(*(a))') 'Logic error in stochastic_physics_init: incompatible', & - & ' namelist settings do_shum and shum' - errflg = 1 -else if (Model%do_skeb.neqv.do_skeb) then - write(errmsg,'(*(a))') 'Logic error in stochastic_physics_init: incompatible', & - & ' namelist settings do_skeb and skeb' - errflg = 1 -else if (Model%do_sfcperts.neqv.do_sfcperts) then ! mg, sfc-perts - write(errmsg,'(*(a))') 'Logic error in stochastic_physics_init: incompatible', & - & ' namelist settings do_sfcperts and pertz0 / pertshc / pertzt / pertlai / pertvegf / pertalb' - errflg = 1 -end if -! update remaining model configuration parameters from namelist -Model%use_zmtnblck=use_zmtnblck -Model%skeb_npass=skeb_npass -Model%nsfcpert=nsfcpert ! mg, sfc-perts -Model%pertz0=pertz0 ! mg, sfc-perts -Model%pertzt=pertzt ! mg, sfc-perts -Model%pertshc=pertshc ! mg, sfc-perts -Model%pertlai=pertlai ! mg, sfc-perts -Model%pertalb=pertalb ! mg, sfc-perts -Model%pertvegf=pertvegf ! mg, sfc-perts -if ( (.NOT. do_sppt) .AND. (.NOT. do_shum) .AND. (.NOT. do_skeb) .AND. (.NOT. do_sfcperts) ) return -allocate(sl(Model%levs)) -do k=1,Model%levs - sl(k)= 0.5*(Model%ak(k)/101300.+Model%bk(k)+Model%ak(k+1)/101300.0+Model%bk(k+1)) ! si are now sigmas -! if(is_master())print*,'sl(k)',k,sl(k),Model%ak(k),Model%bk(k) -enddo -if (do_sppt) then - allocate(vfact_sppt(Model%levs)) - do k=1,Model%levs - if (sl(k) .lt. sppt_sigtop1 .and. sl(k) .gt. sppt_sigtop2) then - vfact_sppt(k) = (sl(k)-sppt_sigtop2)/(sppt_sigtop1-sppt_sigtop2) - else if (sl(k) .lt. sppt_sigtop2) then - vfact_sppt(k) = 0.0 - else - vfact_sppt(k) = 1.0 - endif - enddo - if (sppt_sfclimit) then - vfact_sppt(2)=vfact_sppt(3)*0.5 - vfact_sppt(1)=0.0 - endif - if (is_master()) then - do k=1,MOdel%levs - print *,'sppt vert profile',k,sl(k),vfact_sppt(k) - enddo - endif -endif -if (do_skeb) then - !print*,'allocating skeb stuff',skeblevs - allocate(vfact_skeb(Model%levs)) - allocate(skeb_vloc(skeblevs)) ! local - allocate(skeb_vwts(Model%levs,2)) ! save for later - allocate(skeb_vpts(Model%levs,2)) ! save for later - do k=1,Model%levs - if (sl(k) .lt. skeb_sigtop1 .and. sl(k) .gt. skeb_sigtop2) then - vfact_skeb(k) = (sl(k)-skeb_sigtop2)/(skeb_sigtop1-skeb_sigtop2) - else if (sl(k) .lt. skeb_sigtop2) then - vfact_skeb(k) = 0.0 - else - vfact_skeb(k) = 1.0 - endif - if (is_master()) print *,'skeb vert profile',k,sl(k),vfact_skeb(k) - enddo -! calculate vertical interpolation weights - do k=1,skeblevs - skeb_vloc(k)=sl(1)-real(k-1)/real(skeblevs-1.0)*(sl(1)-sl(Model%levs)) - enddo -! surface -skeb_vwts(1,2)=0 -skeb_vpts(1,1)=1 -! top -skeb_vwts(Model%levs,2)=1 -skeb_vpts(Model%levs,1)=skeblevs-2 -! internal -DO k=2,Model%levs-1 - DO k2=1,skeblevs-1 - IF (sl(k) .LE. skeb_vloc(k2) .AND. sl(k) .GT. skeb_vloc(k2+1)) THEN - skeb_vpts(k,1)=k2 - skeb_vwts(k,2)=(skeb_vloc(k2)-sl(k))/(skeb_vloc(k2)-skeb_vloc(k2+1)) - ENDIF - ENDDO -ENDDO -deallocate(skeb_vloc) -if (is_master()) then -DO k=1,Model%levs - print*,'skeb vpts ',skeb_vpts(k,1),skeb_vwts(k,2) -ENDDO -endif -skeb_vwts(:,1)=1.0-skeb_vwts(:,2) -skeb_vpts(:,2)=skeb_vpts(:,1)+1.0 -endif - -if (do_shum) then - allocate(vfact_shum(Model%levs)) - do k=1,Model%levs - vfact_shum(k) = exp((sl(k)-1.)/shum_sigefold) - if (sl(k).LT. 2*shum_sigefold) then - vfact_shum(k)=0.0 - endif - if (is_master()) print *,'shum vert profile',k,sl(k),vfact_shum(k) - enddo -endif -! get interpolation weights -! define gaussian grid lats and lons -latghf=latg/2 -!print *,'define interp weights',latghf,lonf -!print *,allocated(gg_lats),allocated(gg_lons) -allocate(gg_lats(latg)) -!print *,'aloocated lats' -allocate(gg_lons(lonf)) -!print *,'aloocated lons' -do k=1,latghf - gg_lats(k)=-1.0*colrad_a(latghf-k+1)*rad2deg - gg_lats(latg-k+1)=-1*gg_lats(k) -enddo -dx=360.0/lonf -!print*,'dx=',dx -do k=1,lonf - gg_lons(k)=dx*(k-1) -enddo -WLON=gg_lons(1)-(gg_lons(2)-gg_lons(1)) -RNLAT=gg_lats(1)*2-gg_lats(2) - -!print *,'done with init_stochastic_physics' - -if(Model%me == Model%master) print*,'do_skeb=',Model%do_skeb - -end subroutine stochastic_physics_init - - -!> \section arg_table_stochastic_physics_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F | -!! | Data | GFS_data_type_instance_all_blocks | Fortran DDT containing FV3-GFS data | DDT | 1 | GFS_data_type | | inout | F | -!! | nthreads | omp_threads | number of OpenMP threads available for physics schemes | count | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! -subroutine stochastic_physics_run(Model, Data, nthreads, errmsg, errflg) -use stochy_internal_state_mod -use stochy_data_mod, only : nshum,rpattern_shum,rpattern_sppt,nsppt,rpattern_skeb,nskeb,& - rad2deg,INTTYP,wlon,rnlat,gis_stochy,vfact_sppt,vfact_shum,vfact_skeb -use get_stochy_pattern_mod,only : get_random_pattern_fv3,get_random_pattern_fv3_vect,dump_patterns -use stochy_resol_def , only : latg,lonf -use stochy_namelist_def -use spectral_layout_mod,only:me -use GFS_typedefs, only: GFS_control_type, GFS_data_type -implicit none -type(GFS_control_type), intent(in) :: Model -type(GFS_data_type), intent(inout) :: Data(:) -integer, intent(in) :: nthreads -character(len=*), intent(out) :: errmsg -integer, intent(out) :: errflg - -real,allocatable :: tmp_wts(:,:),tmpu_wts(:,:,:),tmpv_wts(:,:,:) -!D-grid -integer :: k -integer j,ierr,i -integer :: nblks, blk, len, maxlen -character*120 :: sfile -character*6 :: STRFH - -! Initialize CCPP error handling variables -errmsg = '' -errflg = 0 - -if ( (.NOT. do_sppt) .AND. (.NOT. do_shum) .AND. (.NOT. do_skeb) .AND. (.NOT. do_sfcperts) ) return - -! Update number of threads in shared variables in stochy_ccpp and set block-related variables -ompthreads = nthreads -nblks = size(Model%blksz) -maxlen = maxval(Model%blksz(:)) - -! check to see if it is time to write out random patterns -if (Model%phour .EQ. fhstoch) then - write(STRFH,FMT='(I6.6)') nint(Model%phour) - sfile='stoch_out.F'//trim(STRFH) - call dump_patterns(sfile) -endif -allocate(tmp_wts(nblks,maxlen)) -allocate(tmpu_wts(nblks,maxlen,Model%levs)) -allocate(tmpv_wts(nblks,maxlen,Model%levs)) -if (do_sppt) then - call get_random_pattern_fv3(rpattern_sppt,nsppt,gis_stochy,Model,Data(:)%Grid,nblks,maxlen,tmp_wts) - DO blk=1,nblks - len=size(Data(blk)%Grid%xlat,1) - DO k=1,Model%levs - Data(blk)%Coupling%sppt_wts(:,k)=tmp_wts(blk,1:len)*vfact_sppt(k) - ENDDO - if (sppt_logit) Data(blk)%Coupling%sppt_wts(:,:) = (2./(1.+exp(Data(blk)%Coupling%sppt_wts(:,:))))-1. - Data(blk)%Coupling%sppt_wts(:,:)= Data(blk)%Coupling%sppt_wts(:,:)+1.0 - ENDDO -endif -if (do_shum) then - call get_random_pattern_fv3(rpattern_shum,nshum,gis_stochy,Model,Data(:)%Grid,nblks,maxlen,tmp_wts) - DO blk=1,nblks - len=size(Data(blk)%Grid%xlat,1) - DO k=1,Model%levs - Data(blk)%Coupling%shum_wts(:,k)=tmp_wts(blk,1:len)*vfact_shum(k) - ENDDO - ENDDO -endif -if (do_skeb) then - call get_random_pattern_fv3_vect(rpattern_skeb,nskeb,gis_stochy,Model,Data(:)%Grid,nblks,maxlen,tmpu_wts,tmpv_wts) - DO blk=1,nblks - len=size(Data(blk)%Grid%xlat,1) - DO k=1,Model%levs - Data(blk)%Coupling%skebu_wts(:,k)=tmpu_wts(blk,1:len,k)*vfact_skeb(k) - Data(blk)%Coupling%skebv_wts(:,k)=tmpv_wts(blk,1:len,k)*vfact_skeb(k) - ENDDO - ENDDO -endif -deallocate(tmp_wts) -deallocate(tmpu_wts) -deallocate(tmpv_wts) - -end subroutine stochastic_physics_run - -!> \section arg_table_stochastic_physics_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! -subroutine stochastic_physics_finalize(errmsg, errflg) - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (.not.is_initialized) return - - is_initialized = .false. - -end subroutine stochastic_physics_finalize - -end module stochastic_physics - -!>\ingroup gfs_stoch -!! This module -module stochastic_physics_sfc - -use stochy_ccpp, only : is_initialized, is_master - -implicit none - -private -public :: stochastic_physics_sfc_init, stochastic_physics_sfc_run, stochastic_physics_sfc_finalize - -contains - -!> \section arg_table_stochastic_physics_sfc_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F | -!! | Data | GFS_data_type_instance_all_blocks | Fortran DDT containing FV3-GFS data | DDT | 1 | GFS_data_type | | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! -subroutine stochastic_physics_sfc_init(Model, Data, errmsg, errflg) -use stochy_internal_state_mod -use stochy_data_mod, only : rad2deg,INTTYP,wlon,rnlat,gis_stochy, rpattern_sfc,npsfc ! mg, sfc-perts -use get_stochy_pattern_mod,only : get_random_pattern_sfc_fv3 ! mg, sfc-perts -use stochy_resol_def , only : latg,lonf -use stochy_namelist_def -use GFS_typedefs, only: GFS_control_type, GFS_data_type -implicit none -type(GFS_control_type), intent(in) :: Model -type(GFS_data_type), intent(inout) :: Data(:) -character(len=*), intent(out) :: errmsg -integer, intent(out) :: errflg - -real,allocatable :: tmpsfc_wts(:,:,:) -!D-grid -integer :: k -integer j,ierr,i -integer :: nblks, blk, len, maxlen -character*120 :: sfile -character*6 :: STRFH - -! Initialize CCPP error handling variables -errmsg = '' -errflg = 0 - -if (.NOT. do_sfcperts) return - -! stochastic_physics_sfc_init depends on stochastic_physics_init being run first; -! in general, stochastic_physics_sfc can only be run with/after stochastic_physics -! check initialization status in stochy_ccpp to make sure this is true -if (.not.is_initialized) then - write(errmsg,'(*(a))') 'Logic error: stochastic_physics_init must be called before stochastic_physics_sfc_init' - errflg = 1 - return -end if - -! Set block-related variables -nblks = size(Model%blksz) -maxlen = maxval(Model%blksz(:)) - -allocate(tmpsfc_wts(nblks,maxlen,Model%nsfcpert)) ! mg, sfc-perts -if (is_master()) then - print*,'In stochastic_physics_sfc_init: do_sfcperts ',do_sfcperts -endif -call get_random_pattern_sfc_fv3(rpattern_sfc,npsfc,gis_stochy,Model,Data(:)%Grid,nblks,maxlen,tmpsfc_wts) -DO blk=1,nblks - len=size(Data(blk)%Grid%xlat,1) - DO k=1,Model%nsfcpert - Data(blk)%Coupling%sfc_wts(:,k)=tmpsfc_wts(blk,1:len,k) - ENDDO -ENDDO -if (is_master()) then - print*,'tmpsfc_wts(blk,1,:) =',tmpsfc_wts(1,1,1),tmpsfc_wts(1,1,2),tmpsfc_wts(1,1,3),tmpsfc_wts(1,1,4),tmpsfc_wts(1,1,5) - print*,'min(tmpsfc_wts(:,:,:)) =',minval(tmpsfc_wts(:,:,:)) -endif -deallocate(tmpsfc_wts) -end subroutine stochastic_physics_sfc_init - -subroutine stochastic_physics_sfc_run() -end subroutine stochastic_physics_sfc_run - -subroutine stochastic_physics_sfc_finalize() -end subroutine stochastic_physics_sfc_finalize - -end module stochastic_physics_sfc diff --git a/stochastic_physics/stochy_ccpp.F90 b/stochastic_physics/stochy_ccpp.F90 deleted file mode 100644 index f7c7ce60a..000000000 --- a/stochastic_physics/stochy_ccpp.F90 +++ /dev/null @@ -1,437 +0,0 @@ -module stochy_ccpp - -#ifdef MPI - use mpi -#endif - - implicit none - - private - - public is_initialized - public is_master - public stochy_la2ga - public mp_bcst - public mp_reduce_sum - public mpicomm - public mpirank - public mpiroot - public mpisize - public mpp_alltoall - public ompthreads - - logical :: is_initialized = .false. - - interface mpp_alltoall - !module procedure mpp_alltoall_int4 - !module procedure mpp_alltoall_int8 - !module procedure mpp_alltoall_real4 - !module procedure mpp_alltoall_real8 - !module procedure mpp_alltoall_int4_v - !module procedure mpp_alltoall_int8_v - module procedure mpp_alltoall_real4_v - !module procedure mpp_alltoall_real8_v - end interface - - !> The interface 'mp_bcast contains routines that call SPMD broadcast - !! (one-to-many communication). - interface mp_bcst - module procedure mp_bcst_i - !module procedure mp_bcst_r4 - !module procedure mp_bcst_r8 - !module procedure mp_bcst_1d_r4 - module procedure mp_bcst_1d_r8 - !module procedure mp_bcst_2d_r4 - !module procedure mp_bcst_2d_r8 - !module procedure mp_bcst_3d_r4 - !module procedure mp_bcst_3d_r8 - !module procedure mp_bcst_4d_r4 - !module procedure mp_bcst_4d_r8 - module procedure mp_bcst_1d_i - !module procedure mp_bcst_2d_i - !module procedure mp_bcst_3d_i - !module procedure mp_bcst_4d_i - end interface - - !> The interface 'mp_reduce_sum' contains routines that call SPMD_REDUCE. - !! The routines compute the sums of values and place the net sum in a result. - interface mp_reduce_sum - !module procedure mp_reduce_sum_r4 - !module procedure mp_reduce_sum_r4_1d - !module procedure mp_reduce_sum_r4_1darr - !module procedure mp_reduce_sum_r4_2darr - !module procedure mp_reduce_sum_r8 - !module procedure mp_reduce_sum_r8_1d - module procedure mp_reduce_sum_r8_1darr - module procedure mp_reduce_sum_r8_2darr - end interface - -#ifdef MPI - integer, save, target :: mpicomm = MPI_COMM_WORLD -#else - integer, save, target :: mpicomm = 0 -#endif - integer, save, target :: mpirank = 0 - integer, save, target :: mpiroot = 0 - integer, save, target :: mpisize = 1 - - integer, save, target :: ompthreads = 1 - -contains - - - function is_master() result(match) - - logical :: match - - match = (mpirank==mpiroot) - - end function is_master - - - subroutine mpp_alltoall_real4_v(sbuf, ssize, sdispl, rbuf, rsize, rdispl) - - real(kind=4), intent(in) :: sbuf(:) - real(kind=4), intent(inout) :: rbuf(:) - - integer :: ierr - - integer, intent(in) :: ssize(:), rsize(:) - integer, intent(in) :: sdispl(:), rdispl(:) - -#ifdef MPI - call MPI_Alltoallv( sbuf, ssize, sdispl, MPI_REAL, & - rbuf, rsize, rdispl, MPI_REAL, & - mpicomm, ierr ) -#else - rbuf = sbuf -#endif - - end subroutine mpp_alltoall_real4_v - - - subroutine mp_bcst_i(q) - integer, intent(inout) :: q - integer :: ierr - -#ifdef MPI - call MPI_BCAST(q, 1, MPI_INTEGER, mpiroot, mpicomm, ierr) -#endif - - end subroutine mp_bcst_i - - - subroutine mp_bcst_1d_i(q, idim) - - integer, intent(in) :: idim - integer, intent(inout) :: q(idim) - - integer :: ierr - -#ifdef MPI - call MPI_BCAST(q, idim, MPI_INTEGER, mpiroot, mpicomm, ierr) -#endif - - end subroutine mp_bcst_1d_i - - - subroutine mp_bcst_1d_r8(q, idim) - - integer, intent(in) :: idim - real(kind=8), intent(inout) :: q(idim) - - integer :: ierr - -#ifdef MPI - call MPI_BCAST(q, idim, MPI_DOUBLE_PRECISION, mpiroot, mpicomm, ierr) -#endif - - end subroutine mp_bcst_1d_r8 - - - subroutine mp_reduce_sum_r8_1darr(mysum, npts) - - integer, intent(in) :: npts - real(kind=8), intent(inout) :: mysum(npts) - - real(kind=8) :: gsum(npts) - integer :: ierr - -#ifdef MPI - gsum = 0.0 - - call MPI_ALLREDUCE( mysum, gsum, npts, & - MPI_DOUBLE_PRECISION, MPI_SUM, & - mpicomm, ierr ) - - mysum = gsum -#endif - - end subroutine mp_reduce_sum_r8_1darr - - - subroutine mp_reduce_sum_r8_2darr(mysum,npts1,npts2) - - integer, intent(in) :: npts1,npts2 - real(kind=8), intent(inout) :: mysum(npts1,npts2) - - real(kind=8) :: gsum(npts1,npts2) - integer :: ierr - -#ifdef MPI - gsum = 0.0 - - call MPI_ALLREDUCE( mysum, gsum, npts1*npts2, & - MPI_DOUBLE_PRECISION, MPI_SUM, & - mpicomm, ierr ) - - mysum = gsum -#endif - - end subroutine mp_reduce_sum_r8_2darr - - - ! - ! interpolation from lat/lon or gaussian grid to other lat/lon grid - ! - subroutine stochy_la2ga(regin,imxin,jmxin,rinlon,rinlat,rlon,rlat, & - gauout,len,rslmsk, outlat, outlon) - use machine , only : kind_io8, kind_io4 - implicit none - ! interface variables - real (kind=kind_io8), intent(in) :: regin(imxin,jmxin) - integer, intent(in) :: imxin - integer, intent(in) :: jmxin - real (kind=kind_io8), intent(in) :: rinlon(imxin) - real (kind=kind_io8), intent(in) :: rinlat(jmxin) - real (kind=kind_io8), intent(in) :: rlon - real (kind=kind_io8), intent(in) :: rlat - real (kind=kind_io8), intent(out) :: gauout(len) - integer, intent(in) :: len - real (kind=kind_io8), intent(in) :: rslmsk(imxin,jmxin) - real (kind=kind_io8), intent(in) :: outlat(len) - real (kind=kind_io8), intent(in) :: outlon(len) - ! local variables - real (kind=kind_io8) :: wei4,wei3,wei2,sum2,sum1,sum3,wei1,sum4 - real (kind=kind_io8) :: wsum,wsumiv,sums,sumn,wi2j2,x,y,wi1j1 - real (kind=kind_io8) :: wi1j2,wi2j1,aphi,rnume,alamd,denom - integer :: jy,ix,i,j,jq,jx - integer :: j1,j2,ii,i1,i2,kmami,it - integer :: nx,kxs,kxt - integer :: iindx1(len) - integer :: iindx2(len) - integer :: jindx1(len) - integer :: jindx2(len) - real(kind=kind_io8) :: ddx(len) - real(kind=kind_io8) :: ddy(len) - real(kind=kind_io8) :: wrk(len) - integer :: len_thread_m - integer :: len_thread - integer :: i1_t - integer :: i2_t -! - len_thread_m = (len+ompthreads-1) / ompthreads -! - !$omp parallel do num_threads(ompthreads) default(none) & - !$omp private(i1_t,i2_t,len_thread,it,i,ii,i1,i2) & - !$omp private(j,j1,j2,jq,ix,jy,nx,kxs,kxt,kmami) & - !$omp private(alamd,denom,rnume,aphi,x,y,wsum,wsumiv,sum1,sum2) & - !$omp private(sum3,sum4,wi1j1,wi2j1,wi1j2,wi2j2,wei1,wei2,wei3,wei4) & - !$omp private(sumn,sums) & - !$omp shared(imxin,jmxin) & - !$omp shared(outlon,outlat,wrk,iindx1,rinlon,jindx1,rinlat,ddx,ddy) & - !$omp shared(rlon,rlat,regin,gauout) & - !$omp shared(ompthreads,len_thread_m,len,iindx2,jindx2,rslmsk) - do it=1,ompthreads ! start of threaded loop - i1_t = (it-1)*len_thread_m+1 - i2_t = min(i1_t+len_thread_m-1,len) - len_thread = i2_t-i1_t+1 -! -! find i-index for interpolation -! - do i=i1_t, i2_t - alamd = outlon(i) - if (alamd .lt. rlon) alamd = alamd + 360.0 - if (alamd .gt. 360.0+rlon) alamd = alamd - 360.0 - wrk(i) = alamd - iindx1(i) = imxin - enddo - do i=i1_t,i2_t - do ii=1,imxin - if(wrk(i) .ge. rinlon(ii)) iindx1(i) = ii - enddo - enddo - do i=i1_t,i2_t - i1 = iindx1(i) - if (i1 .lt. 1) i1 = imxin - i2 = i1 + 1 - if (i2 .gt. imxin) i2 = 1 - iindx1(i) = i1 - iindx2(i) = i2 - denom = rinlon(i2) - rinlon(i1) - if(denom.lt.0.) denom = denom + 360. - rnume = wrk(i) - rinlon(i1) - if(rnume.lt.0.) rnume = rnume + 360. - ddx(i) = rnume / denom - enddo -! -! find j-index for interplation -! - if(rlat.gt.0.) then - do j=i1_t,i2_t - jindx1(j)=0 - enddo - do jx=1,jmxin - do j=i1_t,i2_t - if(outlat(j).le.rinlat(jx)) jindx1(j) = jx - enddo - enddo - do j=i1_t,i2_t - jq = jindx1(j) - aphi=outlat(j) - if(jq.ge.1 .and. jq .lt. jmxin) then - j2=jq+1 - j1=jq - ddy(j)=(aphi-rinlat(j1))/(rinlat(j2)-rinlat(j1)) - elseif (jq .eq. 0) then - j2=1 - j1=1 - if(abs(90.-rinlat(j1)).gt.0.001) then - ddy(j)=(aphi-rinlat(j1))/(90.-rinlat(j1)) - else - ddy(j)=0.0 - endif - else - j2=jmxin - j1=jmxin - if(abs(-90.-rinlat(j1)).gt.0.001) then - ddy(j)=(aphi-rinlat(j1))/(-90.-rinlat(j1)) - else - ddy(j)=0.0 - endif - endif - jindx1(j)=j1 - jindx2(j)=j2 - enddo - else - do j=i1_t,i2_t - jindx1(j) = jmxin+1 - enddo - do jx=jmxin,1,-1 - do j=i1_t,i2_t - if(outlat(j).le.rinlat(jx)) jindx1(j) = jx - enddo - enddo - do j=i1_t,i2_t - jq = jindx1(j) - aphi=outlat(j) - if(jq.gt.1 .and. jq .le. jmxin) then - j2=jq - j1=jq-1 - ddy(j)=(aphi-rinlat(j1))/(rinlat(j2)-rinlat(j1)) - elseif (jq .eq. 1) then - j2=1 - j1=1 - if(abs(-90.-rinlat(j1)).gt.0.001) then - ddy(j)=(aphi-rinlat(j1))/(-90.-rinlat(j1)) - else - ddy(j)=0.0 - endif - else - j2=jmxin - j1=jmxin - if(abs(90.-rinlat(j1)).gt.0.001) then - ddy(j)=(aphi-rinlat(j1))/(90.-rinlat(j1)) - else - ddy(j)=0.0 - endif - endif - jindx1(j)=j1 - jindx2(j)=j2 - enddo - endif -! - sum1 = 0. - sum2 = 0. - sum3 = 0. - sum4 = 0. - do i=1,imxin - sum1 = sum1 + regin(i,1) - sum2 = sum2 + regin(i,jmxin) - enddo - sum1 = sum1 / imxin - sum2 = sum2 / imxin - sum3 = sum1 - sum4 = sum2 -! -! quasi-bilinear interpolation -! - do i=i1_t,i2_t - y = ddy(i) - j1 = jindx1(i) - j2 = jindx2(i) - x = ddx(i) - i1 = iindx1(i) - i2 = iindx2(i) -! - wi1j1 = (1.-x) * (1.-y) - wi2j1 = x *( 1.-y) - wi1j2 = (1.-x) * y - wi2j2 = x * y -! - wsum = wi1j1 + wi2j1 + wi1j2 + wi2j2 - wrk(i) = wsum - if(wsum.ne.0.) then - wsumiv = 1./wsum - if(j1.ne.j2) then - gauout(i) = (wi1j1*regin(i1,j1) + wi2j1*regin(i2,j1) + & - wi1j2*regin(i1,j2) + wi2j2*regin(i2,j2)) & - *wsumiv - else - if (rlat .gt. 0.0) then - sumn = sum3 - sums = sum4 - if( j1 .eq. 1) then - gauout(i) = (wi1j1*sumn +wi2j1*sumn + & - wi1j2*regin(i1,j2)+wi2j2*regin(i2,j2)) & - * wsumiv - elseif (j1 .eq. jmxin) then - gauout(i) = (wi1j1*regin(i1,j1)+wi2j1*regin(i2,j1)+ & - wi1j2*sums +wi2j2*sums ) & - * wsumiv - endif - else - sums = sum3 - sumn = sum4 - if( j1 .eq. 1) then - gauout(i) = (wi1j1*regin(i1,j1)+wi2j1*regin(i2,j1)+ & - wi1j2*sums +wi2j2*sums ) & - * wsumiv - elseif (j1 .eq. jmxin) then - gauout(i) = (wi1j1*sumn +wi2j1*sumn + & - wi1j2*regin(i1,j2)+wi2j2*regin(i2,j2)) & - * wsumiv - endif - endif - endif ! if j1 .ne. j2 - endif - enddo - do i=i1_t,i2_t - j1 = jindx1(i) - j2 = jindx2(i) - i1 = iindx1(i) - i2 = iindx2(i) - if(wrk(i) .eq. 0.0) then - write(6,*) ' la2ga: bad rslmsk given' - call sleep(2) - stop - endif - enddo - enddo ! end of threaded loop -!$omp end parallel do -! - return -! - end subroutine stochy_la2ga - -end module stochy_ccpp diff --git a/stochastic_physics/stochy_data_mod.F90 b/stochastic_physics/stochy_data_mod.F90 deleted file mode 100644 index ff3916d3a..000000000 --- a/stochastic_physics/stochy_data_mod.F90 +++ /dev/null @@ -1,397 +0,0 @@ -!>\file stochy_data_mod.F90 -!!This file includes module to set up and initializes stochastic random patterns. - -!> This module set up and initializes stochastic random patterns -module stochy_data_mod - - - use spectral_layout_mod, only: len_trie_ls,len_trio_ls,ls_dim,ls_max_node - use stochy_resol_def, only : skeblevs,levs,jcap,lonf,latg - use stochy_namelist_def - use physcons, only : radius => con_rerth - use stochy_ccpp, only: is_master, & - mp_bcst, & - me => mpirank, & - nodes => mpisize - use stochy_patterngenerator_mod, only: random_pattern, patterngenerator_init,& - getnoise, patterngenerator_advance,ndimspec,chgres_pattern,computevarspec_r - use initialize_spectral_mod, only: initialize_spectral - use stochy_internal_state_mod -! use mersenne_twister_stochy, only : random_seed - use mersenne_twister, only : random_seed - use compns_stochy_mod, only : compns_stochy - - implicit none - private - public :: init_stochdata - - type(random_pattern), public, save, allocatable, dimension(:) :: & - rpattern_sppt,rpattern_shum,rpattern_skeb, rpattern_sfc - integer, public :: nsppt=0 - integer, public :: nshum=0 - integer, public :: nskeb=0 - integer, public :: npsfc=0 - real*8, public,allocatable :: sl(:) - - real(kind=kind_dbl_prec),public, allocatable :: vfact_sppt(:),vfact_shum(:),vfact_skeb(:) - real(kind=kind_dbl_prec),public, allocatable :: skeb_vwts(:,:),skeb_vpts(:,:) - real(kind=kind_dbl_prec),public, allocatable :: gg_lats(:),gg_lons(:) - real(kind=kind_dbl_prec),public :: wlon,rnlat,rad2deg - real(kind=kind_dbl_prec),public, allocatable :: skebu_save(:,:,:),skebv_save(:,:,:) - integer,public :: INTTYP - type(stochy_internal_state),public :: gis_stochy - - contains - -!> This subroutine initializes random patterns. A spinup period of spinup_efolds times -!! the temporal time scale is run for each pattern. - subroutine init_stochdata(nlevs,delt,input_nml_file,fn_nml,nlunit,iret) - - integer, intent(in) :: nlunit,nlevs - character(len=*), intent(in) :: input_nml_file(:) - character(len=64), intent(in) :: fn_nml - real, intent(in) :: delt - integer, intent(out) :: iret - real :: pertsfc(1) - - real :: rnn1 - integer :: nn,nspinup,k,nm,spinup_efolds,stochlun,ierr,n - integer :: locl,indev,indod,indlsod,indlsev - integer :: l,jbasev,jbasod - real(kind_dbl_prec),allocatable :: noise_e(:,:),noise_o(:,:) - include 'function_indlsod' - include 'function_indlsev' - stochlun=99 - levs=nlevs - - iret=0 - if(is_master()) print*,'in init stochdata' - call compns_stochy (me,size(input_nml_file,1),input_nml_file(:),fn_nml,nlunit,delt,iret) - if ( (.NOT. do_sppt) .AND. (.NOT. do_shum) .AND. (.NOT. do_skeb) .AND. (.NOT. do_sfcperts) ) return - if (nodes.GE.lat_s/2) then - lat_s=(int(nodes/12)+1)*24 - lon_s=lat_s*2 - ntrunc=lat_s-2 - if (is_master()) print*,'WARNING: spectral resolution is too low for number of mpi_tasks, resetting lon_s,lat_s,and ntrunc to',lon_s,lat_s,ntrunc - endif - call initialize_spectral(gis_stochy, iret) - if (iret/=0) return - allocate(noise_e(len_trie_ls,2),noise_o(len_trio_ls,2)) -! determine number of random patterns to be used for each scheme. - do n=1,size(sppt) - if (sppt(n) > 0) then - nsppt=nsppt+1 - else - exit - endif - enddo - if (is_master()) print *,'nsppt = ',nsppt - do n=1,size(shum) - if (shum(n) > 0) then - nshum=nshum+1 - else - exit - endif - enddo - if (is_master()) print *,'nshum = ',nshum - do n=1,size(skeb) - if (skeb(n) > 0) then - nskeb=nskeb+1 - else - exit - endif - enddo - if (is_master()) print *,'nskeb = ',nskeb - ! mg, sfc-perts - do n=1,size(pertz0) - if (pertz0(n) > 0 .or. pertzt(n)>0 .or. pertshc(n)>0 .or. & - pertvegf(n)>0 .or. pertlai(n)>0 .or. pertalb(n)>0) then - npsfc=npsfc+1 - else - exit - endif - enddo - if (is_master()) then - if (npsfc > 0) then - print *,' npsfc = ', npsfc - print *,' pertz0 = ', pertz0 - print *,' pertzt = ', pertzt - print *,' pertshc = ', pertshc - print *,' pertlai = ', pertlai - print *,' pertalb = ', pertalb - print *,' pertvegf = ', pertvegf - endif - endif - - if (nsppt > 0) allocate(rpattern_sppt(nsppt)) - if (nshum > 0) allocate(rpattern_shum(nshum)) - if (nskeb > 0) allocate(rpattern_skeb(nskeb)) - ! mg, sfc perts - if (npsfc > 0) allocate(rpattern_sfc(npsfc)) - -! if stochini is true, then read in pattern from a file - if (is_master()) then - if (stochini) then - print*,'opening stoch_ini' - OPEN(stochlun,file='stoch_ini',form='unformatted',iostat=ierr,status='old') - if (ierr .NE. 0) then - write(0,*) 'error opening stoch_ini' - iret = ierr - return - end if - endif - endif - ! no spinup needed if initial patterns are defined correctly. - spinup_efolds = 0 - if (nsppt > 0) then - if (is_master()) print *, 'Initialize random pattern for SPPT' - call patterngenerator_init(sppt_lscale,delt,sppt_tau,sppt,iseed_sppt,rpattern_sppt, & - lonf,latg,jcap,gis_stochy%ls_node,nsppt,1,0) - do n=1,nsppt - nspinup = spinup_efolds*sppt_tau(n)/delt - if (stochini) then - call read_pattern(rpattern_sppt(n),1,stochlun) - else - call getnoise(rpattern_sppt(n),noise_e,noise_o) - do nn=1,len_trie_ls - rpattern_sppt(n)%spec_e(nn,1,1)=noise_e(nn,1) - rpattern_sppt(n)%spec_e(nn,2,1)=noise_e(nn,2) - nm = rpattern_sppt(n)%idx_e(nn) - if (nm .eq. 0) cycle - rpattern_sppt(n)%spec_e(nn,1,1) = rpattern_sppt(n)%stdev*rpattern_sppt(n)%spec_e(nn,1,1)*rpattern_sppt(n)%varspectrum(nm) - rpattern_sppt(n)%spec_e(nn,2,1) = rpattern_sppt(n)%stdev*rpattern_sppt(n)%spec_e(nn,2,1)*rpattern_sppt(n)%varspectrum(nm) - enddo - do nn=1,len_trio_ls - rpattern_sppt(n)%spec_o(nn,1,1)=noise_o(nn,1) - rpattern_sppt(n)%spec_o(nn,2,1)=noise_o(nn,2) - nm = rpattern_sppt(n)%idx_o(nn) - if (nm .eq. 0) cycle - rpattern_sppt(n)%spec_o(nn,1,1) = rpattern_sppt(n)%stdev*rpattern_sppt(n)%spec_o(nn,1,1)*rpattern_sppt(n)%varspectrum(nm) - rpattern_sppt(n)%spec_o(nn,2,1) = rpattern_sppt(n)%stdev*rpattern_sppt(n)%spec_o(nn,2,1)*rpattern_sppt(n)%varspectrum(nm) - enddo - do nn=1,nspinup - call patterngenerator_advance(rpattern_sppt(n),1,.false.) - enddo - endif - enddo - endif - if (nshum > 0) then - if (is_master()) print *, 'Initialize random pattern for SHUM' - call patterngenerator_init(shum_lscale,delt,shum_tau,shum,iseed_shum,rpattern_shum, & - lonf,latg,jcap,gis_stochy%ls_node,nshum,1,0) - do n=1,nshum - nspinup = spinup_efolds*shum_tau(n)/delt - if (stochini) then - call read_pattern(rpattern_shum(n),1,stochlun) - else - call getnoise(rpattern_shum(n),noise_e,noise_o) - do nn=1,len_trie_ls - rpattern_shum(n)%spec_e(nn,1,1)=noise_e(nn,1) - rpattern_shum(n)%spec_e(nn,2,1)=noise_e(nn,2) - nm = rpattern_shum(n)%idx_e(nn) - if (nm .eq. 0) cycle - rpattern_shum(n)%spec_e(nn,1,1) = rpattern_shum(n)%stdev*rpattern_shum(n)%spec_e(nn,1,1)*rpattern_shum(n)%varspectrum(nm) - rpattern_shum(n)%spec_e(nn,2,1) = rpattern_shum(n)%stdev*rpattern_shum(n)%spec_e(nn,2,1)*rpattern_shum(n)%varspectrum(nm) - enddo - do nn=1,len_trio_ls - rpattern_shum(n)%spec_o(nn,1,1)=noise_o(nn,1) - rpattern_shum(n)%spec_o(nn,2,1)=noise_o(nn,2) - nm = rpattern_shum(n)%idx_o(nn) - if (nm .eq. 0) cycle - rpattern_shum(n)%spec_o(nn,1,1) = rpattern_shum(n)%stdev*rpattern_shum(n)%spec_o(nn,1,1)*rpattern_shum(n)%varspectrum(nm) - rpattern_shum(n)%spec_o(nn,2,1) = rpattern_shum(n)%stdev*rpattern_shum(n)%spec_o(nn,2,1)*rpattern_shum(n)%varspectrum(nm) - enddo - do nn=1,nspinup - call patterngenerator_advance(rpattern_shum(n),1,.false.) - enddo - endif - enddo - endif - - if (nskeb > 0) then - ! determine number of skeb levels to deal with temperoal/vertical correlations - skeblevs=nint(skeb_tau(1)/delt*skeb_vdof) -! backscatter noise. - if (is_master()) print *, 'Initialize random pattern for SKEB',skeblevs - call patterngenerator_init(skeb_lscale,delt,skeb_tau,skeb,iseed_skeb,rpattern_skeb, & - lonf,latg,jcap,gis_stochy%ls_node,nskeb,skeblevs,skeb_varspect_opt) - do n=1,nskeb - do k=1,skeblevs - nspinup = spinup_efolds*skeb_tau(n)/delt - if (stochini) then - call read_pattern(rpattern_skeb(n),k,stochlun) - if (is_master()) print *, 'skeb read',k,rpattern_skeb(n)%spec_o(5,1,k) - else - call getnoise(rpattern_skeb(n),noise_e,noise_o) - do nn=1,len_trie_ls - rpattern_skeb(n)%spec_e(nn,1,k)=noise_e(nn,1) - rpattern_skeb(n)%spec_e(nn,2,k)=noise_e(nn,2) - nm = rpattern_skeb(n)%idx_e(nn) - if (nm .eq. 0) cycle - rpattern_skeb(n)%spec_e(nn,1,k) = rpattern_skeb(n)%stdev*rpattern_skeb(n)%spec_e(nn,1,k)*rpattern_skeb(n)%varspectrum(nm) - rpattern_skeb(n)%spec_e(nn,2,k) = rpattern_skeb(n)%stdev*rpattern_skeb(n)%spec_e(nn,2,k)*rpattern_skeb(n)%varspectrum(nm) - enddo - do nn=1,len_trio_ls - rpattern_skeb(n)%spec_o(nn,1,k)=noise_o(nn,1) - rpattern_skeb(n)%spec_o(nn,2,k)=noise_o(nn,2) - nm = rpattern_skeb(n)%idx_o(nn) - if (nm .eq. 0) cycle - rpattern_skeb(n)%spec_o(nn,1,k) = rpattern_skeb(n)%stdev*rpattern_skeb(n)%spec_o(nn,1,k)*rpattern_skeb(n)%varspectrum(nm) - rpattern_skeb(n)%spec_o(nn,2,k) = rpattern_skeb(n)%stdev*rpattern_skeb(n)%spec_o(nn,2,k)*rpattern_skeb(n)%varspectrum(nm) - enddo - endif - enddo - do nn=1,nspinup - call patterngenerator_advance(rpattern_skeb(n),skeblevs,.false.) - enddo - enddo - - gis_stochy%kenorm_e=1. - gis_stochy%kenorm_o=1. ! used to convert forcing pattern to wind field. -if (skebnorm==0) then - do locl=1,ls_max_node - l = gis_stochy%ls_node(locl) - jbasev = gis_stochy%ls_node(locl+ls_dim) - indev = indlsev(l,l) - jbasod = gis_stochy%ls_node(locl+2*ls_dim) - indod = indlsod(l+1,l) - do n=l,jcap,2 - rnn1 = n*(n+1.) - gis_stochy%kenorm_e(indev) = rnn1/radius**2 - indev = indev + 1 - enddo - do n=l+1,jcap,2 - rnn1 = n*(n+1.) - gis_stochy%kenorm_o(indod) = rnn1/radius**2 - indod = indod + 1 - enddo - enddo - if (is_master()) print*,'using streamfunction ',maxval(gis_stochy%kenorm_e(:)),minval(gis_stochy%kenorm_e(:)) -endif -if (skebnorm==1) then - do locl=1,ls_max_node - l = gis_stochy%ls_node(locl) - jbasev = gis_stochy%ls_node(locl+ls_dim) - indev = indlsev(l,l) - jbasod = gis_stochy%ls_node(locl+2*ls_dim) - indod = indlsod(l+1,l) - do n=l,jcap,2 - rnn1 = n*(n+1.) - gis_stochy%kenorm_e(indev) = sqrt(rnn1)/radius - indev = indev + 1 - enddo - do n=l+1,jcap,2 - rnn1 = n*(n+1.) - gis_stochy%kenorm_o(indod) = sqrt(rnn1)/radius - indod = indod + 1 - enddo - enddo - if (is_master()) print*,'using kenorm ',maxval(gis_stochy%kenorm_e(:)),minval(gis_stochy%kenorm_e(:)) -endif - ! set the even and odd (n-l) terms of the top row to zero -do locl=1,ls_max_node - l = gis_stochy%ls_node(locl) - jbasev = gis_stochy%ls_node(locl+ls_dim) - jbasod = gis_stochy%ls_node(locl+2*ls_dim) - if (mod(l,2) .eq. mod(jcap+1,2)) then - gis_stochy%kenorm_e(indlsev(jcap+1,l)) = 0. - endif - if (mod(l,2) .ne. mod(jcap+1,2)) then - gis_stochy%kenorm_o(indlsod(jcap+1,l)) = 0. - endif -enddo - - endif ! skeb > 0 -! mg, sfc-perts -if (npsfc > 0) then - pertsfc(1) = 1. - call patterngenerator_init(sfc_lscale,delt,sfc_tau,pertsfc,iseed_sfc,rpattern_sfc, & - lonf,latg,jcap,gis_stochy%ls_node,npsfc,nsfcpert,0) - do n=1,npsfc - if (is_master()) print *, 'Initialize random pattern for SFC-PERTS',n - do k=1,nsfcpert - nspinup = spinup_efolds*sfc_tau(n)/delt - call getnoise(rpattern_sfc(n),noise_e,noise_o) - do nn=1,len_trie_ls - rpattern_sfc(n)%spec_e(nn,1,k)=noise_e(nn,1) - rpattern_sfc(n)%spec_e(nn,2,k)=noise_e(nn,2) - nm = rpattern_sfc(n)%idx_e(nn) - if (nm .eq. 0) cycle - rpattern_sfc(n)%spec_e(nn,1,k) = rpattern_sfc(n)%stdev*rpattern_sfc(n)%spec_e(nn,1,k)*rpattern_sfc(n)%varspectrum(nm) - rpattern_sfc(n)%spec_e(nn,2,k) = rpattern_sfc(n)%stdev*rpattern_sfc(n)%spec_e(nn,2,k)*rpattern_sfc(n)%varspectrum(nm) - enddo - do nn=1,len_trio_ls - rpattern_sfc(n)%spec_o(nn,1,k)=noise_o(nn,1) - rpattern_sfc(n)%spec_o(nn,2,k)=noise_o(nn,2) - nm = rpattern_sfc(n)%idx_o(nn) - if (nm .eq. 0) cycle - rpattern_sfc(n)%spec_o(nn,1,k) = rpattern_sfc(n)%stdev*rpattern_sfc(n)%spec_o(nn,1,k)*rpattern_sfc(n)%varspectrum(nm) - rpattern_sfc(n)%spec_o(nn,2,k) = rpattern_sfc(n)%stdev*rpattern_sfc(n)%spec_o(nn,2,k)*rpattern_sfc(n)%varspectrum(nm) - enddo - do nn=1,nspinup - call patterngenerator_advance(rpattern_sfc(n),k,.false.) - enddo - if (is_master()) print *, 'Random pattern for SFC-PERTS: k, min, max ',k, minval(rpattern_sfc(1)%spec_o(:,:,k)), maxval(rpattern_sfc(1)%spec_o(:,:,k)) - enddo ! k, nsfcpert - enddo ! n, npsfc - endif ! npsfc > 0 - if (is_master() .and. stochini) CLOSE(stochlun) - deallocate(noise_e,noise_o) - end subroutine init_stochdata - -subroutine read_pattern(rpattern,k,lunptn) - type(random_pattern), intent(inout) :: rpattern - integer, intent(in) :: lunptn - real(kind_dbl_prec),allocatable :: pattern2d(:),pattern2din(:) - real(kind_dbl_prec) :: stdevin,varin - integer nm,nn,ierr,jcap,isize,k - integer, allocatable :: isave(:) - - allocate(pattern2d(2*ndimspec)) - pattern2d=0. - call random_seed(size=isize,stat=rpattern%rstate) ! get size of generator state seed array - allocate(isave(isize)) - ! read only on root process, and send to all tasks - if (is_master()) then - read(lunptn) jcap - read(lunptn) isave - allocate(pattern2din((jcap+1)*(jcap+2))) - print*,'reading in random pattern at ',jcap,ndimspec,size(pattern2din) - read(lunptn) pattern2din - print*,'reading in random pattern (min/max/size/seed)',& - minval(pattern2din),maxval(pattern2din),size(pattern2din),isave(1:4) - if (jcap .eq. ntrunc) then - pattern2d=pattern2din - else - call chgres_pattern(pattern2din,pattern2d,jcap,ntrunc) ! chgres of spectral files - ! change the standard deviation of the patterns for a resolution change - ! needed for SKEB & SHUM - call computevarspec_r(rpattern,pattern2d,varin) - print*,'stddev in and out..',sqrt(varin),rpattern%stdev - stdevin=rpattern%stdev/sqrt(varin) - pattern2d(:)=pattern2d(:)*stdevin - endif - deallocate(pattern2din) - endif - call mp_bcst(isave,isize) ! blast out seed - call mp_bcst(pattern2d,2*ndimspec) - call random_seed(put=isave,stat=rpattern%rstate) - ! subset - do nn=1,len_trie_ls - nm = rpattern%idx_e(nn) - if (nm == 0) cycle - rpattern%spec_e(nn,1,k) = pattern2d(nm) - rpattern%spec_e(nn,2,k) = pattern2d(ndimspec+nm) - enddo - do nn=1,len_trio_ls - nm = rpattern%idx_o(nn) - if (nm == 0) cycle - rpattern%spec_o(nn,1,k) = pattern2d(nm) - rpattern%spec_o(nn,2,k) = pattern2d(ndimspec+nm) - enddo - !print*,'after scatter...',me,maxval(pattern2d_e),maxval(pattern2d_o) & - ! ,minval(pattern2d_e),minval(pattern2d_o) - deallocate(pattern2d,isave) - end subroutine read_pattern - -end module stochy_data_mod diff --git a/stochastic_physics/stochy_gg_def.f b/stochastic_physics/stochy_gg_def.f deleted file mode 100644 index 9470c436e..000000000 --- a/stochastic_physics/stochy_gg_def.f +++ /dev/null @@ -1,9 +0,0 @@ - module stochy_gg_def - use machine - implicit none - - real(kind=kind_dbl_prec), allocatable, dimension(:) :: colrad_a, - & wgt_a, wgtcs_a, rcs2_a, sinlat_a, coslat_a -! - integer ,allocatable, dimension(:) :: lats_nodes_h,global_lats_h - end module stochy_gg_def diff --git a/stochastic_physics/stochy_internal_state_mod.F90 b/stochastic_physics/stochy_internal_state_mod.F90 deleted file mode 100644 index e62645bd1..000000000 --- a/stochastic_physics/stochy_internal_state_mod.F90 +++ /dev/null @@ -1,136 +0,0 @@ - -! -! !module: stochy_internal_state_mod -! --- internal state definition of the -! gridded component of the spectral random patterns -! -! !description: define the spectral internal state used to -! create the internal state. -!--------------------------------------------------------------------------- -! !revision history: -! -! Oct 11 2016 P Pegion port of gfs_dynamics_interal_state -! -! !interface: -! - - module stochy_internal_state_mod - -!!uses: -!------ - use spectral_layout_mod - use stochy_gg_def - use stochy_resol_def - - - implicit none - private - -! ----------------------------------------------- - type,public::stochy_internal_state ! start type define -! ----------------------------------------------- - - integer :: me, nodes - integer :: lnt2_s, llgg_s - integer :: lnt2 - integer :: grib_inp - -! - integer nxpt,nypt,jintmx - integer lonf,latg,lats_node_a_max - - integer npe_single_member - - character(16) :: cfhour1 -!jws - integer :: num_file - character(32) ,allocatable :: filename_base(:) - integer :: ipt_lats_node_a - integer :: lats_node_a -!jwe - - integer :: nblck,kdt -! real :: deltim - - integer ,allocatable :: lonsperlat (:) - integer ,allocatable :: ls_node (:) - integer ,allocatable :: ls_nodes (:, :) - integer ,allocatable :: max_ls_nodes (:) - - integer ,allocatable :: lats_nodes_a (:) - integer ,allocatable :: global_lats_a (:) - integer ,allocatable :: lats_nodes_ext (:) - integer ,allocatable :: global_lats_ext(:) - integer ,allocatable :: global_lats_h (:) - integer :: xhalo,yhalo - - integer ,allocatable :: lats_nodes_a_fix (:) - - real(kind=kind_dbl_prec) ,allocatable :: epse (:) - real(kind=kind_dbl_prec) ,allocatable :: epso (:) - real(kind=kind_dbl_prec) ,allocatable :: epsedn(:) - real(kind=kind_dbl_prec) ,allocatable :: epsodn(:) - real(kind=kind_dbl_prec) ,allocatable :: kenorm_e(:) - real(kind=kind_dbl_prec) ,allocatable :: kenorm_o(:) - - real(kind=kind_dbl_prec) ,allocatable :: snnp1ev(:) - real(kind=kind_dbl_prec) ,allocatable :: snnp1od(:) - - real(kind=kind_dbl_prec) ,allocatable :: plnev_a(:,:) - real(kind=kind_dbl_prec) ,allocatable :: plnod_a(:,:) - real(kind=kind_dbl_prec) ,allocatable :: pddev_a(:,:) - real(kind=kind_dbl_prec) ,allocatable :: pddod_a(:,:) - real(kind=kind_dbl_prec) ,allocatable :: plnew_a(:,:) - real(kind=kind_dbl_prec) ,allocatable :: plnow_a(:,:) - - - real(kind=kind_dbl_prec) ,allocatable :: trie_ls(:,:,:) - real(kind=kind_dbl_prec) ,allocatable :: trio_ls(:,:,:) - - INTEGER :: TRIEO_TOTAL_SIZE - INTEGER, ALLOCATABLE, DIMENSION(:) :: TRIE_LS_SIZE - INTEGER, ALLOCATABLE, DIMENSION(:) :: TRIO_LS_SIZE - INTEGER, ALLOCATABLE, DIMENSION(:) :: TRIEO_LS_SIZE - INTEGER, ALLOCATABLE, DIMENSION(:) :: LS_MAX_NODE_GLOBAL - INTEGER, ALLOCATABLE, DIMENSION(:, :) :: LS_NODE_GLOBAL - - -! - -!! - integer init,jcount,jpt,node,ibmsign,lon_dim,ilat - - real(kind=kind_dbl_prec) colat1, rone, rlons_lat, scale_ibm - - integer lotls,lotgr,lots,lots_slg,lotd,lota,lotp - - integer ibrad,ifges,ihour,ini,j,jdt,ksout,maxstp - integer mdt,idt,timetot,timer,time0 - integer mods,n1,n2,ndgf,ndgi,nfiles,nflps - integer n1hyb, n2hyb,nlunit - integer nges,ngpken,niter,nnmod,nradf,nradr - integer nsfcf,nsfci,nsfcs,nsigi,nsigs,nstep - integer nznlf,nznli,nznls,id,iret,nsout,ndfi - - integer ierr,iprint,k,l,locl,n - integer lan,lat - integer spectral_loop - - - integer ikey,nrank_all,kcolor - - real(kind=kind_dbl_prec) cons0p5,cons1200,cons3600,cons0 - -! -! ----------------------------------------------------- - end type stochy_internal_state ! end type define -! ----------------------------------------------------- - -! this state is supported by c pointer not f90 pointer, thus -! need this wrap. -!----------------------------------------------------------- - type stochy_wrap ! begin type define - type (stochy_internal_state), pointer :: int_state - end type stochy_wrap ! end type define - - end module stochy_internal_state_mod diff --git a/stochastic_physics/stochy_layout_lag.f b/stochastic_physics/stochy_layout_lag.f deleted file mode 100644 index b2ee13bab..000000000 --- a/stochastic_physics/stochy_layout_lag.f +++ /dev/null @@ -1,13 +0,0 @@ - module stochy_layout_lag - use machine - implicit none - save -cc - integer lats_dim_h, - x lats_node_h, - x lats_node_h_max, - x ipt_lats_node_h, - x lon_dim_h -cc - INTEGER ,ALLOCATABLE :: lat1s_h(:) - end module stochy_layout_lag diff --git a/stochastic_physics/stochy_namelist_def.F90 b/stochastic_physics/stochy_namelist_def.F90 deleted file mode 100644 index 06fac4f48..000000000 --- a/stochastic_physics/stochy_namelist_def.F90 +++ /dev/null @@ -1,37 +0,0 @@ - module stochy_namelist_def -! -! program log -! 11 Oct 2016: Philip Pegion create standalone stochastic physics -! - use machine - implicit none - - public - integer nsskeb,lon_s,lat_s,ntrunc - -! pjp stochastic phyics - integer skeb_varspect_opt,skeb_npass - logical sppt_sfclimit - - real(kind=kind_dbl_prec) :: skeb_sigtop1,skeb_sigtop2, & - sppt_sigtop1,sppt_sigtop2,shum_sigefold, & - skeb_vdof - real(kind=kind_dbl_prec) fhstoch,skeb_diss_smooth,skebint,skebnorm - real(kind=kind_dbl_prec), dimension(5) :: skeb,skeb_lscale,skeb_tau - real(kind=kind_dbl_prec), dimension(5) :: sppt,sppt_lscale,sppt_tau - real(kind=kind_dbl_prec), dimension(5) :: shum,shum_lscale,shum_tau - integer,dimension(5) ::skeb_vfilt - integer(8),dimension(5) ::iseed_sppt,iseed_shum,iseed_skeb - logical stochini,sppt_logit - logical do_shum,do_sppt,do_skeb,use_zmtnblck - -! mg surface perturbations - real(kind=kind_dbl_prec), dimension(5) :: sfc_lscale,sfc_tau - real(kind=kind_dbl_prec), dimension(5) :: pertz0,pertshc,pertzt - real(kind=kind_dbl_prec), dimension(5) :: pertlai,pertvegf,pertalb - integer nsfcpert - integer(8),dimension(5) ::iseed_sfc - logical sppt_land - logical do_sfcperts - - end module stochy_namelist_def diff --git a/stochastic_physics/stochy_patterngenerator.F90 b/stochastic_physics/stochy_patterngenerator.F90 deleted file mode 100644 index 9cb477cfc..000000000 --- a/stochastic_physics/stochy_patterngenerator.F90 +++ /dev/null @@ -1,362 +0,0 @@ -module stochy_patterngenerator_mod - - ! generate random patterns with specified temporal and spatial auto-correlation - ! in spherical harmonic space. - use machine - use spectral_layout_mod, only: len_trie_ls, len_trio_ls, ls_dim, ls_max_node -! use mersenne_twister_stochy, only: random_setseed,random_gauss,random_stat - use mersenne_twister, only: random_setseed,random_gauss,random_stat - use stochy_ccpp, only: is_master, mp_bcst - implicit none - private - - public :: computevarspec, setvarspect,& - patterngenerator_init, patterngenerator_destroy, getnoise, & - patterngenerator_advance, random_pattern, ndimspec,& - chgres_pattern,computevarspec_r - - type random_pattern - real(kind_dbl_prec), public :: lengthscale - real(kind_dbl_prec), public :: tau - real(kind_dbl_prec), public :: dt - real(kind_dbl_prec), public :: phi - real(kind_dbl_prec), public :: stdev - real(kind_evod), allocatable, dimension(:), public :: varspectrum, varspectrum1d, lap - integer, allocatable, dimension(:), public ::& - degree,order,idx_e,idx_o - integer, allocatable, dimension(:,:), public :: idx - integer, public :: seed - real(kind_dbl_prec), allocatable, dimension(:,:,:), public :: spec_e,spec_o - type(random_stat), public :: rstate - end type random_pattern - - integer :: nlons,nlats,ntrunc,ndimspec - - contains - - subroutine patterngenerator_init(lscale, delt, tscale, stdev, iseed, rpattern,& - nlon, nlat, jcap, ls_node, npatterns,& - nlevs, varspect_opt) - real(kind_dbl_prec), intent(in),dimension(npatterns) :: lscale,tscale,stdev - real, intent(in) :: delt - integer, intent(in) :: nlon,nlat,jcap,npatterns,varspect_opt - integer, intent(in) :: ls_node(ls_dim,3),nlevs - type(random_pattern), intent(out), dimension(npatterns) :: rpattern - integer(8), intent(inout) :: iseed(npatterns) - integer m,j,l,n,nm,nn,np,indev1,indev2,indod1,indod2 - integer(8) count, count_rate, count_max, count_trunc - integer(8) :: iscale = 10000000000 - integer count4, ierr -! integer member_id - integer indlsod,indlsev,jbasev,jbasod - include 'function_indlsod' - include 'function_indlsev' - nlons = nlon - nlats = nlat - ntrunc = jcap - ndimspec = (ntrunc+1)*(ntrunc+2)/2 -! propagate seed supplied from namelist to all patterns... - if (iseed(1) .NE. 0) then - do np=2,npatterns - if (iseed(np).EQ.0) then - iseed(np)=iseed(1)+np*100000000 - endif - enddo - endif - - do np=1,npatterns - allocate(rpattern(np)%idx(0:ntrunc,0:ntrunc)) - allocate(rpattern(np)%idx_e(len_trie_ls)) - allocate(rpattern(np)%idx_o(len_trio_ls)) - allocate(rpattern(np)%spec_e(len_trie_ls,2,nlevs)) - allocate(rpattern(np)%spec_o(len_trio_ls,2,nlevs)) - rpattern(np)%idx_e = 0; rpattern(np)%idx_o = 0; rpattern(np)%idx = 0 - rpattern(np)%spec_e(:,:,:)=0. - rpattern(np)%spec_o(:,:,:)=0. - nm = 0 - do m=0,ntrunc - do n=m,ntrunc - nm = nm + 1 - rpattern(np)%idx(m,n) = nm - enddo - enddo - do j = 1, ls_max_node - l=ls_node(j,1) ! zonal wavenumber - jbasev=ls_node(j,2) - jbasod=ls_node(j,3) - indev1 = indlsev(l,l) - indod1 = indlsod(l+1,l) - if (mod(l,2) .eq. mod(ntrunc+1,2)) then - indev2 = indlsev(ntrunc+1,l) - indod2 = indlsod(ntrunc ,l) - else - indev2 = indlsev(ntrunc ,l) - indod2 = indlsod(ntrunc+1,l) - endif - n = l ! degree - do nn=indev1,indev2 - if (n <= ntrunc .and. l <= ntrunc) then - nm = rpattern(np)%idx(l,n) - rpattern(np)%idx_e(nn) = nm - endif - n = n + 2 - enddo - n = l+1 - do nn=indod1,indod2 - if (n <= ntrunc .and. l <= ntrunc) then - nm = rpattern(np)%idx(l,n) - rpattern(np)%idx_o(nn) = nm - endif - n = n + 2 - enddo - enddo - allocate(rpattern(np)%degree(ndimspec),rpattern(np)%order(ndimspec),rpattern(np)%lap(ndimspec)) -#ifdef __GFORTRAN__ - j = 0 - do m=0,ntrunc - do n=m,ntrunc - j = j + 1 - rpattern(np)%degree(j) = n - rpattern(np)%order(j) = m - end do - end do -#else - rpattern(np)%degree = (/((n,n=m,ntrunc),m=0,ntrunc)/) - rpattern(np)%order = (/((m,n=m,ntrunc),m=0,ntrunc)/) -#endif - rpattern(np)%lap = -rpattern(np)%degree*(rpattern(np)%degree+1.0) - rpattern(np)%tau = tscale(np) - rpattern(np)%lengthscale = lscale(np) - rpattern(np)%dt = delt - rpattern(np)%phi = exp(-delt/tscale(np)) - rpattern(np)%stdev = stdev(np) - allocate(rpattern(np)%varspectrum(ndimspec)) - allocate(rpattern(np)%varspectrum1d(0:ntrunc)) - ! seed computed on root, then bcast to all tasks and set. - if (is_master()) then -! read(ens_nam(2:3),'(i2)') member_id -! print *,'ens_nam,member_id',trim(ens_nam),member_id - if (iseed(np) == 0) then - ! generate a random seed from system clock and ens member number - call system_clock(count, count_rate, count_max) - ! iseed is elapsed time since unix epoch began (secs) - ! truncate to 4 byte integer - count_trunc = iscale*(count/iscale) - count4 = count - count_trunc !+ member_id - print *,'using seed',count4 - else - !count4 = iseed(np) + member_id - ! don't rely on compiler to truncate integer(8) to integer(4) on - ! overflow, do wrap around explicitly. - !count4 = mod(iseed(np) + member_id + 2147483648, 4294967296) - 2147483648 - count4 = mod(iseed(np) + 2147483648, 4294967296) - 2147483648 - print *,'using seed',count4,iseed(np)!,member_id - endif - endif - ! broadcast seed to all tasks. - call mp_bcst(count4) - rpattern(np)%seed = count4 - ! set seed (to be the same) on all tasks. Save random state. - call random_setseed(rpattern(np)%seed,rpattern(np)%rstate) - if (varspect_opt .ne. 0 .and. varspect_opt .ne. 1) then - if (is_master()) then - print *,'WARNING: illegal value for varspect_opt (should be 0 or 1), using 0 (gaussian spectrum)...' - endif - call setvarspect(rpattern(np),0) - else - call setvarspect(rpattern(np),varspect_opt) - endif - enddo ! n=1,npatterns - end subroutine patterngenerator_init - - - - subroutine patterngenerator_destroy(rpattern,npatterns) - type(random_pattern), intent(inout) :: rpattern(npatterns) - integer, intent(in) :: npatterns - integer n - do n=1,npatterns - deallocate(rpattern(n)%varspectrum,rpattern(n)%varspectrum1d) - deallocate(rpattern(n)%degree,rpattern(n)%order,rpattern(n)%lap) - deallocate(rpattern(n)%idx,rpattern(n)%idx_e,rpattern(n)%idx_o) - enddo - end subroutine patterngenerator_destroy - - subroutine computevarspec(rpattern,dataspec,var) - ! compute globally integrated variance from spectral coefficients - complex(kind_evod), intent(in) :: dataspec(ndimspec) - real(kind_evod), intent(out) :: var - type(random_pattern), intent(in) :: rpattern - integer n - var = 0. - do n=1,ndimspec - if (rpattern%order(n) .ne. 0) then - var = var + dataspec(n)*conjg(dataspec(n)) - else - var = var + 0.5*dataspec(n)*conjg(dataspec(n)) - endif - enddo - end subroutine computevarspec - - subroutine computevarspec_r(rpattern,dataspec,var) - ! compute globally integrated variance from spectral coefficients - real(kind_dbl_prec), intent(in) :: dataspec(2*ndimspec) - real(kind_dbl_prec), intent(out) :: var - type(random_pattern), intent(in) :: rpattern - integer n - var = 0. - do n=1,ndimspec - if (rpattern%order(n) .ne. 0) then - var = var + dataspec(n)**2+dataspec(n+ndimspec)**2 - else - var = var + 0.5*(dataspec(n)**2+dataspec(n+ndimspec)**2) - endif - enddo - end subroutine computevarspec_r - - subroutine getnoise(rpattern,noise_e,noise_o) - real(kind_dbl_prec), intent(out) :: noise_e(len_trie_ls,2) - real(kind_dbl_prec), intent(out) :: noise_o(len_trio_ls,2) - ! generate white noise with unit variance in spectral space - type(random_pattern), intent(inout) :: rpattern - real :: noise(2*ndimspec) - integer nm,nn - call random_gauss(noise,rpattern%rstate) - noise(1) = 0.; noise(ndimspec+1) = 0. - noise = noise*sqrt(1./ntrunc) - noise_e = 0.; noise_o = 0. - ! subset - do nn=1,len_trie_ls - nm = rpattern%idx_e(nn) - if (nm == 0) cycle - noise_e(nn,1) = noise(nm)/sqrt(2.*rpattern%degree(nm)+1) - noise_e(nn,2) = noise(ndimspec+nm)/sqrt(2.*rpattern%degree(nm)+1) - if (rpattern%order(nm) .eq. 0) then - noise_e(nn,1) = sqrt(2.)*noise_e(nn,1) - noise_e(nn,2) = 0. - endif - enddo - do nn=1,len_trio_ls - nm = rpattern%idx_o(nn) - if (nm == 0) cycle - noise_o(nn,1) = noise(nm)/sqrt(2.*rpattern%degree(nm)+1) - noise_o(nn,2) = noise(ndimspec+nm)/sqrt(2.*rpattern%degree(nm)+1) - if (rpattern%order(nm) .eq. 0) then - noise_o(nn,1) = sqrt(2.)*noise_o(nn,1) - noise_o(nn,2) = 0. - endif - enddo - end subroutine getnoise - - subroutine patterngenerator_advance(rpattern,k,skeb_first_call) - -#ifdef TRANSITION -!DIR$ OPTIMIZE:1 -#endif - - ! advance 1st-order autoregressive process with - ! specified autocorrelation (phi) and variance spectrum (spectrum) - real(kind_dbl_prec) :: noise_e(len_trie_ls,2) - real(kind_dbl_prec) :: noise_o(len_trio_ls,2) - type(random_pattern), intent(inout) :: rpattern - logical, intent(in) :: skeb_first_call - integer j,l,n,nn,nm,k,k2 - call getnoise(rpattern,noise_e,noise_o) - if (k.GT.1.AND.skeb_first_call) then - k2=k-1 - else - k2=k - endif - do nn=1,len_trie_ls - nm = rpattern%idx_e(nn) - if (nm == 0) cycle - rpattern%spec_e(nn,1,k) = rpattern%phi*rpattern%spec_e(nn,1,k2) + & - rpattern%stdev*sqrt(1.-rpattern%phi**2)*rpattern%varspectrum(nm)*noise_e(nn,1) - rpattern%spec_e(nn,2,k) = rpattern%phi*rpattern%spec_e(nn,2,k2) + & - rpattern%stdev*sqrt(1.-rpattern%phi**2)*rpattern%varspectrum(nm)*noise_e(nn,2) - enddo - do nn=1,len_trio_ls - nm = rpattern%idx_o(nn) - if (nm == 0) cycle - rpattern%spec_o(nn,1,k) = rpattern%phi*rpattern%spec_o(nn,1,k2) + & - rpattern%stdev*sqrt(1.-rpattern%phi**2)*rpattern%varspectrum(nm)*noise_o(nn,1) - rpattern%spec_o(nn,2,k) = rpattern%phi*rpattern%spec_o(nn,2,k2) + & - rpattern%stdev*sqrt(1.-rpattern%phi**2)*rpattern%varspectrum(nm)*noise_o(nn,2) - enddo - end subroutine patterngenerator_advance - - subroutine setvarspect(rpattern,varspect_opt) - ! define variance spectrum (isotropic covariance) - ! normalized to unit global variance - type(random_pattern), intent(inout) :: rpattern - integer, intent(in) :: varspect_opt - integer :: n - complex(kind_evod) noise(ndimspec) - real(kind_evod) var,rerth - rerth =6.3712e+6 ! radius of earth (m) - ! 1d variance spectrum (as a function of total wavenumber) - if (varspect_opt == 0) then ! gaussian - ! rpattern%lengthscale is interpreted as an efolding length - ! scale, in meters. - do n=0,ntrunc - rpattern%varspectrum1d(n) = exp(-rpattern%lengthscale**2*(float(n)*(float(n)+1.))/(4.*rerth**2)) - enddo - ! scaling factors for spectral coeffs of white noise pattern with unit variance - rpattern%varspectrum = sqrt(ntrunc*exp(rpattern%lengthscale**2*rpattern%lap/(4.*rerth**2))) - else if (varspect_opt == 1) then ! power law - ! rpattern%lengthscale is interpreted as a power, not a length. - do n=0,ntrunc - rpattern%varspectrum1d(n) = float(n)**(rpattern%lengthscale) - enddo - ! scaling factors for spectral coeffs of white noise pattern with unit variance - rpattern%varspectrum = sqrt(ntrunc*(rpattern%degree**(rpattern%lengthscale))) - endif - noise = 0. - do n=1,ndimspec - if (rpattern%order(n) .ne. 0.) then - noise(n) = cmplx(1.,1.)/sqrt(2.*rpattern%degree(n)+1) - else - noise(n) = sqrt(2.)/sqrt(2.*rpattern%degree(n)+1.) - endif - enddo - noise(1) = 0 ! no global mean. - ! make sure global mean variance is 1. - noise = noise*sqrt(1./ntrunc) - noise = rpattern%varspectrum*noise - call computevarspec(rpattern,noise,var) - rpattern%varspectrum = rpattern%varspectrum/sqrt(var) - rpattern%varspectrum1d = rpattern%varspectrum1d/var - - end subroutine setvarspect - - subroutine chgres_pattern(pattern2din,pattern2dout,ntruncin,ntruncout) - real(kind_dbl_prec), intent(in) :: pattern2din((ntruncin+1)*(ntruncin+2)) - real(kind_dbl_prec), intent(out) :: pattern2dout((ntruncout+1)*(ntruncout+2)) - integer, intent(in) :: ntruncin,ntruncout - integer :: m,n,nm,ndimsspecin,ndimsspecout - integer,allocatable, dimension(:,:):: idxin - allocate(idxin(0:ntruncin,0:ntruncin)) - ndimsspecin=(ntruncin+1)*(ntruncin+2)/2 - ndimsspecout=(ntruncout+1)*(ntruncout+2)/2 - nm = 0 - do m=0,ntruncin - do n=m,ntruncin - nm = nm + 1 - idxin(m,n) = nm - enddo - enddo - ! chgres - nm = 0 - do m=0,ntruncout - do n=m,ntruncout - nm = nm + 1 - if (m .le. ntruncin .and. n .le. ntruncin) then - pattern2dout(nm) = pattern2din(idxin(m,n)) - pattern2dout(ndimsspecout+nm) = pattern2din(ndimsspecin+idxin(m,n)) - endif - enddo - enddo - deallocate(idxin) -end subroutine chgres_pattern - -end module stochy_patterngenerator_mod diff --git a/stochastic_physics/stochy_resol_def.f b/stochastic_physics/stochy_resol_def.f deleted file mode 100644 index 708e31c84..000000000 --- a/stochastic_physics/stochy_resol_def.f +++ /dev/null @@ -1,44 +0,0 @@ - module stochy_resol_def - -! program log: -! 20110220: Henry Juang update index for MASS_DP and NDSLFV -! 20130202: Henry Juang revise reduced grid and add x number -! - implicit none - - integer jcap,jcap1,jcap2,latg,latg2 - integer levh,levm1,levp1,skeblevs,levs,lnt,lnt2,lnt22,levr - integer lnte,lnted,lnto,lntod,lnuv - integer lonf,lonfx,num_p2d,num_p3d - integer nxpt,nypt,jintmx,latgd - integer ntoz,ntcw,ncld,ntke,ixgr,ntiw,ntlnc,ntinc,nto,nto2 - integer ivsupa, ivsinp - integer nlunit, kdt_start - integer,target :: ntrac - integer,target :: ngrids_gg - integer,target :: thermodyn_id, sfcpress_id ! hmhj - logical,target :: adiabatic -! - INTEGER p_gz,p_lapgz,p_zslam,p_zsphi,p_dlam,p_dphi,p_uln,p_vln - INTEGER p_zem,p_dim,p_tem,p_rm,p_dpm,p_qm - INTEGER p_ze ,p_di ,p_te ,p_rq,p_dp ,p_q - INTEGER p_w ,p_x ,p_y ,p_rt,p_dpn,p_zq - INTEGER p_zz ,p_dpphi,p_dplam,p_zzphi,p_zzlam - INTEGER g_uum,g_vvm,g_ttm,g_rm ,g_dpm,g_qm,g_gz,g_zz - INTEGER g_uu ,g_vv ,g_tt ,g_rq ,g_dp ,g_q - INTEGER g_uup,g_vvp,g_ttp,g_rqp,g_dpp,g_zqp,g_rqtk - INTEGER g_u ,g_v ,g_t ,g_rt ,g_dpn,g_zq, g_p, g_dpdt - INTEGER lots,lots_slg,lotd,lota,lotp,lotls,lotgr,lotgr6 - - integer ksz, ksd, kst, ksr, ksdp, ksq, ksplam, kspphi - integer ksu, ksv, kzslam, kzsphi -! - integer kau, kav, kat, kar, kadp, kaps, kazs, kap2 -! - integer kdpphi, kzzphi, kdplam, kzzlam -! - integer kdtphi, kdrphi, kdtlam, kdrlam - integer kdulam, kdvlam, kduphi, kdvphi - - - end module stochy_resol_def diff --git a/stochastic_physics/sumfln_stochy.f b/stochastic_physics/sumfln_stochy.f deleted file mode 100644 index 973828e1b..000000000 --- a/stochastic_physics/sumfln_stochy.f +++ /dev/null @@ -1,294 +0,0 @@ - module sumfln_stochy_mod - - implicit none - - contains - - subroutine sumfln_stochy(flnev,flnod,lat1s,plnev,plnod, - & nvars,ls_node,latl2, - & workdim,nvarsdim,four_gr, - & ls_nodes,max_ls_nodes, - & lats_nodes,global_lats, - & lats_node,ipt_lats_node, - & lons_lat,londi,latl,nvars_0) -! - use stochy_resol_def , only : jcap,latgd - use spectral_layout_mod , only : len_trie_ls,len_trio_ls, - & ls_dim,ls_max_node,me,nodes - use machine - use stochy_ccpp, only : mpp_alltoall, - & num_parthds_stochy => ompthreads - - implicit none -! - external esmf_dgemm -! - integer lat1s(0:jcap),latl2 -! - integer nvars,nvars_0 - real(kind=kind_dbl_prec) flnev(len_trie_ls,2*nvars) - real(kind=kind_dbl_prec) flnod(len_trio_ls,2*nvars) -! - real(kind=kind_dbl_prec) plnev(len_trie_ls,latl2) - real(kind=kind_dbl_prec) plnod(len_trio_ls,latl2) -! - integer ls_node(ls_dim,3) -! -!cmr ls_node(1,1) ... ls_node(ls_max_node,1) : values of L -!cmr ls_node(1,2) ... ls_node(ls_max_node,2) : values of jbasev -!cmr ls_node(1,3) ... ls_node(ls_max_node,3) : values of jbasod -! -! local scalars -! ------------- -! - integer j, k, l, lat, lat1, n, kn, n2,indev,indod -! -! local arrays -! ------------ -! - real(kind=kind_dbl_prec), dimension(nvars*2,latl2) :: apev, apod - integer num_threads, nvar_thread_max, nvar_1, nvar_2 - &, thread -! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -! - integer nvarsdim, latl, workdim, londi - &, lats_node, ipt_lats_node -! - real(kind=kind_dbl_prec) four_gr(londi,nvarsdim,workdim) -! - integer ls_nodes(ls_dim,nodes) - integer, dimension(nodes) :: max_ls_nodes, lats_nodes - integer, dimension(latl) :: global_lats, lons_lat - -!jfe integer global_lats(latg+2*jintmx+2*nypt*(nodes-1)) -! - real(kind=4),target,dimension(2,nvars,ls_dim*workdim,nodes):: - & workr,works -! real(kind=4),dimension(2*nvars*ls_dim*workdim*nodes):: -! & work1dr,work1ds - real(kind=4),pointer:: work1dr(:),work1ds(:) - integer, dimension(jcap+1) :: kpts, kptr, sendcounts, recvcounts, - & sdispls -! - integer ierr,ilat,ipt_ls, lmax,lval,i,jj,lonl,nv - integer node,nvar,arrsz - integer ilat_list(nodes) ! for OMP buffer copy -! -! statement functions -! ------------------- -! - integer indlsev, jbasev, indlsod, jbasod -! - include 'function_indlsev' - include 'function_indlsod' -! - real(kind=kind_dbl_prec), parameter :: cons0=0.0d0, cons1=1.0d0 -! -! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -! - arrsz=2*nvars*ls_dim*workdim*nodes - num_threads = min(num_parthds_stochy,nvars) - nvar_thread_max = (nvars+num_threads-1)/num_threads - kpts = 0 -! write(0,*)' londi=',londi,'nvarsdim=',nvarsdim,'workdim=',workdim -! - do j = 1, ls_max_node ! start of do j loop ##################### -! - l = ls_node(j,1) - jbasev = ls_node(j,2) - jbasod = ls_node(j,3) - - indev = indlsev(l,l) - indod = indlsod(l+1,l) -! - lat1 = lat1s(l) - if ( kind_dbl_prec == 8 ) then !------------------------------------ - -!$omp parallel do private(thread,nvar_1,nvar_2,n2) - do thread=1,num_threads ! start of thread loop .............. - nvar_1 = (thread-1)*nvar_thread_max + 1 - nvar_2 = min(nvar_1+nvar_thread_max-1,nvars) - - if (nvar_2 >= nvar_1) then - n2 = 2*(nvar_2-nvar_1+1) - -! compute the even and odd components of the fourier coefficients -! -! compute the sum of the even real terms for each level -! compute the sum of the even imaginary terms for each level -! -! call dgemm('t','n',latl2-lat1+1, 2*(nvar_2-nvar_1+1), -! & (jcap+2-l)/2,cons1, !constant -! & plnev(indev,lat1), len_trio_ls, -! & flnev(indev,2*nvar_1-1),len_trio_ls,cons0, -! & apev(2*nvar_1-1,lat1),latl2) - call esmf_dgemm( - & 't', - & 'n', - & n2, - & latl2-lat1+1, - & (jcap+3-l)/2, - & cons1, - & flnev(indev,2*nvar_1-1), - & len_trie_ls, - & plnev(indev,lat1), - & len_trie_ls, - & cons0, - & apev(2*nvar_1-1,lat1), - & 2*nvars - & ) -! -! compute the sum of the odd real terms for each level -! compute the sum of the odd imaginary terms for each level -! -! call dgemm('t','n',latl2-lat1+1, 2*(nvar_2-nvar_1+1), -! & (jcap+2-l)/2,cons1, !constant -! & plnod(indod,lat1), len_trio_ls, -! & flnod(indod,2*nvar_1-1),len_trio_ls,cons0, -! & apod(2*nvar_1-1,lat1), latl2) - call esmf_dgemm( - & 't', - & 'n', - & n2, - & latl2-lat1+1, - & (jcap+2-l)/2, - & cons1, - & flnod(indod,2*nvar_1-1), - & len_trio_ls, - & plnod(indod,lat1), - & len_trio_ls, - & cons0, - & apod(2*nvar_1-1,lat1), - & 2*nvars - & ) -! - endif - enddo ! end of thread loop .................................. - else !------------------------------------------------------------ -!$omp parallel do private(thread,nvar_1,nvar_2) - do thread=1,num_threads ! start of thread loop .............. - nvar_1 = (thread-1)*nvar_thread_max + 1 - nvar_2 = min(nvar_1+nvar_thread_max-1,nvars) - enddo ! end of thread loop .................................. - endif !----------------------------------------------------------- -! -ccxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -! -! compute the fourier coefficients for each level -! ----------------------------------------------- -! - ilat_list(1) = 0 - do node = 1, nodes - 1 - ilat_list(node+1) = ilat_list(node) + lats_nodes(node) - end do - -!$omp parallel do private(node,jj,ilat,lat,ipt_ls,nvar,kn,n2) - do node=1,nodes - do jj=1,lats_nodes(node) - ilat = ilat_list(node) + jj - lat = global_lats(ilat) - ipt_ls = min(lat,latl-lat+1) - if ( ipt_ls >= lat1s(ls_nodes(j,me+1)) ) then - kpts(node) = kpts(node) + 1 - kn = kpts(node) -! - if ( lat <= latl2 ) then -! northern hemisphere - do nvar=1,nvars - n2 = nvar + nvar - works(1,nvar,kn,node) = apev(n2-1,ipt_ls) - & + apod(n2-1,ipt_ls) - works(2,nvar,kn,node) = apev(n2, ipt_ls) - & + apod(n2, ipt_ls) - enddo - else -! southern hemisphere - do nvar=1,nvars - n2 = nvar + nvar - works(1,nvar,kn,node) = apev(n2-1,ipt_ls) - & - apod(n2-1,ipt_ls) - works(2,nvar,kn,node) = apev(n2, ipt_ls) - & - apod(n2, ipt_ls) - enddo - endif - endif - enddo - enddo -! - enddo ! end of do j loop ####################################### -! - kptr = 0 - do node=1,nodes - do l=1,max_ls_nodes(node) - lval = ls_nodes(l,node)+1 - do j=1,lats_node - lat = global_lats(ipt_lats_node-1+j) - if ( min(lat,latl-lat+1) >= lat1s(lval-1) ) then - kptr(node) = kptr(node) + 1 - endif - enddo - enddo - enddo -! -! - n2 = nvars + nvars -!$omp parallel do private(node) - do node=1,nodes - sendcounts(node) = kpts(node) * n2 - recvcounts(node) = kptr(node) * n2 - sdispls(node) = (node-1) * n2 * ls_dim * workdim - end do - work1dr(1:arrsz)=>workr - work1ds(1:arrsz)=>works - call mpp_alltoall(work1ds, sendcounts, sdispls, - & work1dr, recvcounts, sdispls) - nullify(work1dr) - nullify(work1ds) -!$omp parallel do private(j,lat,lmax,nvar,lval,n2,lonl,nv) - do j=1,lats_node - lat = global_lats(ipt_lats_node-1+j) - lonl = lons_lat(lat) - lmax = min(jcap,lonl/2) - n2 = lmax + lmax + 3 -! write(0,*)' j=',j,' lat=',lat,' lmax=',lmax,' n2=',n2 -! &,' nvars=',nvars,' lonl=',lonl - if ( n2 <= lonl+2 ) then - do nvar=1,nvars - nv = nvars_0 + nvar - do lval = n2, lonl+2 -! write(0,*)' lval=',lval,' nvar=',nvar,nvars_0 -! &,' n2=',n2,' lonl=',lonl,' nv=',nv,' j=',j -! &,'size=',size(four_gr,1),size(four_gr,2),size(four_gr,3) - four_gr(lval,nv,j) = cons0 - enddo - enddo - endif - enddo -! - kptr = 0 -! write(0,*)' kptr=',kptr(1) -!! -!$omp parallel do private(node,l,lval,j,lat,nvar,kn,n2) - do node=1,nodes - do l=1,max_ls_nodes(node) - lval = ls_nodes(l,node)+1 - n2 = lval + lval - do j=1,lats_node - lat = global_lats(ipt_lats_node-1+j) - if ( min(lat,latl-lat+1) >= lat1s(lval-1) ) then - kptr(node) = kptr(node) + 1 - kn = kptr(node) - - do nvar=1,nvars - four_gr(n2-1,nvars_0+nvar,j) = workr(1,nvar,kn,node) - four_gr(n2, nvars_0+nvar,j) = workr(2,nvar,kn,node) - enddo - endif - enddo - enddo - enddo -! - return - end - - end module sumfln_stochy_mod From 7f64be277d1c2d8648cc3b2324776b41f5bc0b20 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Wed, 4 Sep 2019 08:22:32 -0600 Subject: [PATCH 83/89] Convert all remaining physics schemes to new metadata format --- physics/GFS_DCNV_generic.F90 | 79 +- physics/GFS_DCNV_generic.meta | 644 ++++++++ physics/GFS_MP_generic.F90 | 100 +- physics/GFS_MP_generic.meta | 844 +++++++++++ physics/GFS_PBL_generic.F90 | 141 +- physics/GFS_PBL_generic.meta | 1151 +++++++++++++++ physics/GFS_SCNV_generic.F90 | 33 +- physics/GFS_SCNV_generic.meta | 239 +++ physics/GFS_debug.F90 | 43 +- physics/GFS_debug.meta | 288 ++++ physics/GFS_phys_time_vary.fv3.F90 | 22 +- physics/GFS_phys_time_vary.fv3.meta | 120 ++ physics/GFS_phys_time_vary.scm.F90 | 26 +- physics/GFS_phys_time_vary.scm.meta | 152 ++ physics/GFS_rad_time_vary.fv3.F90 | 8 +- physics/GFS_rad_time_vary.fv3.meta | 54 + physics/GFS_rad_time_vary.scm.F90 | 8 +- physics/GFS_rad_time_vary.scm.meta | 54 + physics/GFS_rrtmg_post.F90 | 26 +- physics/GFS_rrtmg_post.meta | 204 +++ physics/GFS_rrtmg_pre.F90 | 62 +- physics/GFS_rrtmg_pre.meta | 526 +++++++ physics/GFS_rrtmg_setup.F90 | 54 +- physics/GFS_rrtmg_setup.meta | 386 +++++ physics/GFS_stochastics.F90 | 42 +- physics/GFS_stochastics.meta | 346 +++++ physics/GFS_suite_init_finalize_test.F90 | 15 +- physics/GFS_suite_init_finalize_test.meta | 64 + physics/GFS_suite_interstitial.F90 | 210 +-- physics/GFS_suite_interstitial.meta | 1627 +++++++++++++++++++++ physics/GFS_surface_generic.F90 | 156 +- physics/GFS_surface_generic.meta | 1336 +++++++++++++++++ physics/GFS_surface_loop_control.F90 | 23 +- physics/GFS_surface_loop_control.meta | 148 ++ physics/GFS_time_vary_pre.fv3.F90 | 16 +- physics/GFS_time_vary_pre.fv3.meta | 72 + physics/GFS_time_vary_pre.scm.F90 | 16 +- physics/GFS_time_vary_pre.scm.meta | 72 + physics/cires_ugwp_solvers.F90 | 6 +- physics/cires_vert_lsatdis.F90 | 4 +- physics/cnvc90.f | 19 +- physics/cnvc90.meta | 151 ++ physics/cs_conv.F90 | 88 +- physics/cs_conv.meta | 726 +++++++++ physics/cs_conv_aw_adj.F90 | 27 +- physics/cs_conv_aw_adj.meta | 206 +++ physics/cu_gf_driver.F90 | 47 +- physics/cu_gf_driver.meta | 369 +++++ physics/cu_gf_driver_post.F90 | 12 +- physics/cu_gf_driver_post.meta | 81 + physics/cu_gf_driver_pre.F90 | 18 +- physics/cu_gf_driver_pre.meta | 133 ++ physics/cu_ntiedtke.F90 | 42 +- physics/cu_ntiedtke.meta | 325 ++++ physics/cu_ntiedtke_post.F90 | 9 +- physics/cu_ntiedtke_post.meta | 56 + physics/cu_ntiedtke_pre.F90 | 16 +- physics/cu_ntiedtke_pre.meta | 116 ++ physics/dcyc2.f | 62 +- physics/dcyc2.meta | 526 +++++++ physics/gcm_shoc.F90 | 61 +- physics/gcm_shoc.meta | 510 +++++++ physics/get_prs_fv3.F90 | 25 +- physics/get_prs_fv3.meta | 193 +++ physics/gfdl_cloud_microphys.F90 | 63 +- physics/gfdl_cloud_microphys.meta | 482 ++++++ physics/gfdl_fv_sat_adj.F90 | 65 +- physics/gfdl_fv_sat_adj.meta | 489 +++++++ physics/gmtb_scm_sfc_flux_spec.F90 | 37 +- physics/gmtb_scm_sfc_flux_spec.meta | 308 ++++ physics/gscond.f | 26 +- physics/gscond.meta | 214 +++ physics/gwdc.f | 78 +- physics/gwdc.meta | 644 ++++++++ physics/gwdps.f | 63 +- physics/gwdps.meta | 527 +++++++ physics/h2ophys.f | 17 +- physics/h2ophys.meta | 131 ++ physics/m_micro.F90 | 110 +- physics/m_micro.meta | 919 ++++++++++++ physics/m_micro_interstitial.F90 | 64 +- physics/m_micro_interstitial.meta | 538 +++++++ physics/module_MYNNPBL_wrapper.F90 | 110 +- physics/module_MYNNPBL_wrapper.meta | 935 ++++++++++++ physics/module_MYNNSFC_wrapper.F90 | 66 +- physics/module_MYNNSFC_wrapper.meta | 560 +++++++ physics/module_MYNNrad_post.F90 | 12 +- physics/module_MYNNrad_post.meta | 80 + physics/module_MYNNrad_pre.F90 | 22 +- physics/module_MYNNrad_pre.meta | 170 +++ physics/moninedmf.f | 64 +- physics/moninedmf.meta | 518 +++++++ physics/moninshoc.f | 61 +- physics/moninshoc.meta | 512 +++++++ physics/mp_thompson.F90 | 65 +- physics/mp_thompson.meta | 498 +++++++ physics/mp_thompson_post.F90 | 26 +- physics/mp_thompson_post.meta | 157 ++ physics/mp_thompson_pre.F90 | 33 +- physics/mp_thompson_pre.meta | 264 ++++ physics/precpd.f | 25 +- physics/precpd.meta | 205 +++ physics/radlw_main.f | 50 +- physics/radlw_main.meta | 390 +++++ physics/radlw_param.f | 2 +- physics/radsw_main.f | 60 +- physics/radsw_main.meta | 459 ++++++ physics/rayleigh_damp.f | 21 +- physics/rayleigh_damp.meta | 169 +++ physics/rrtmg_lw_post.F90 | 16 +- physics/rrtmg_lw_post.meta | 121 ++ physics/rrtmg_lw_pre.F90 | 12 +- physics/rrtmg_lw_pre.meta | 88 ++ physics/rrtmg_sw_post.F90 | 22 +- physics/rrtmg_sw_post.meta | 172 +++ physics/rrtmg_sw_pre.F90 | 19 +- physics/rrtmg_sw_pre.meta | 149 ++ physics/samfdeepcnv.f | 68 +- physics/samfdeepcnv.meta | 584 ++++++++ physics/samfshalcnv.f | 70 +- physics/samfshalcnv.meta | 585 ++++++++ physics/satmedmfvdif.F | 63 +- physics/satmedmfvdif.meta | 532 +++++++ physics/sfc_diag.f | 28 +- physics/sfc_diag.meta | 226 +++ physics/sfc_diag_post.F90 | 23 +- physics/sfc_diag_post.meta | 180 +++ physics/sfc_diff.f | 73 +- physics/sfc_diff.meta | 623 ++++++++ physics/sfc_drv.f | 94 +- physics/sfc_drv.meta | 760 ++++++++++ physics/sfc_drv_ruc.F90 | 122 +- physics/sfc_drv_ruc.meta | 1000 +++++++++++++ physics/sfc_nst.f | 131 +- physics/sfc_nst.meta | 1118 ++++++++++++++ physics/sfc_ocean.F | 32 +- physics/sfc_ocean.meta | 270 ++++ physics/sfc_sice.f | 58 +- physics/sfc_sice.meta | 487 ++++++ physics/shinhongvdif.F90 | 52 +- physics/shinhongvdif.meta | 434 ++++++ 141 files changed, 28346 insertions(+), 3410 deletions(-) create mode 100644 physics/GFS_DCNV_generic.meta create mode 100644 physics/GFS_MP_generic.meta create mode 100644 physics/GFS_PBL_generic.meta create mode 100644 physics/GFS_SCNV_generic.meta create mode 100644 physics/GFS_debug.meta create mode 100644 physics/GFS_phys_time_vary.fv3.meta create mode 100644 physics/GFS_phys_time_vary.scm.meta create mode 100644 physics/GFS_rad_time_vary.fv3.meta create mode 100644 physics/GFS_rad_time_vary.scm.meta create mode 100644 physics/GFS_rrtmg_post.meta create mode 100644 physics/GFS_rrtmg_pre.meta create mode 100644 physics/GFS_rrtmg_setup.meta create mode 100644 physics/GFS_stochastics.meta create mode 100644 physics/GFS_suite_init_finalize_test.meta create mode 100644 physics/GFS_suite_interstitial.meta create mode 100644 physics/GFS_surface_generic.meta create mode 100644 physics/GFS_surface_loop_control.meta create mode 100644 physics/GFS_time_vary_pre.fv3.meta create mode 100644 physics/GFS_time_vary_pre.scm.meta create mode 100644 physics/cnvc90.meta create mode 100644 physics/cs_conv.meta create mode 100644 physics/cs_conv_aw_adj.meta create mode 100644 physics/cu_gf_driver.meta create mode 100644 physics/cu_gf_driver_post.meta create mode 100644 physics/cu_gf_driver_pre.meta create mode 100644 physics/cu_ntiedtke.meta create mode 100644 physics/cu_ntiedtke_post.meta create mode 100644 physics/cu_ntiedtke_pre.meta create mode 100644 physics/dcyc2.meta create mode 100644 physics/gcm_shoc.meta create mode 100644 physics/get_prs_fv3.meta create mode 100644 physics/gfdl_cloud_microphys.meta create mode 100644 physics/gfdl_fv_sat_adj.meta create mode 100644 physics/gmtb_scm_sfc_flux_spec.meta create mode 100644 physics/gscond.meta create mode 100644 physics/gwdc.meta create mode 100644 physics/gwdps.meta create mode 100644 physics/h2ophys.meta create mode 100644 physics/m_micro.meta create mode 100644 physics/m_micro_interstitial.meta create mode 100644 physics/module_MYNNPBL_wrapper.meta create mode 100644 physics/module_MYNNSFC_wrapper.meta create mode 100644 physics/module_MYNNrad_post.meta create mode 100644 physics/module_MYNNrad_pre.meta create mode 100644 physics/moninedmf.meta create mode 100644 physics/moninshoc.meta create mode 100644 physics/mp_thompson.meta create mode 100644 physics/mp_thompson_post.meta create mode 100644 physics/mp_thompson_pre.meta create mode 100644 physics/precpd.meta create mode 100644 physics/radlw_main.meta create mode 100644 physics/radsw_main.meta create mode 100644 physics/rayleigh_damp.meta create mode 100644 physics/rrtmg_lw_post.meta create mode 100644 physics/rrtmg_lw_pre.meta create mode 100644 physics/rrtmg_sw_post.meta create mode 100644 physics/rrtmg_sw_pre.meta create mode 100644 physics/samfdeepcnv.meta create mode 100644 physics/samfshalcnv.meta create mode 100644 physics/satmedmfvdif.meta create mode 100644 physics/sfc_diag.meta create mode 100644 physics/sfc_diag_post.meta create mode 100644 physics/sfc_diff.meta create mode 100644 physics/sfc_drv.meta create mode 100644 physics/sfc_drv_ruc.meta create mode 100644 physics/sfc_nst.meta create mode 100644 physics/sfc_ocean.meta create mode 100644 physics/sfc_sice.meta create mode 100644 physics/shinhongvdif.meta diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 index ea0199443..dada6f18b 100644 --- a/physics/GFS_DCNV_generic.F90 +++ b/physics/GFS_DCNV_generic.F90 @@ -14,26 +14,7 @@ end subroutine GFS_DCNV_generic_pre_finalize #if 0 !> \brief Interstitial scheme called prior to any deep convective scheme to save state variables for calculating tendencies after the deep convective scheme is executed !! \section arg_table_GFS_DCNV_generic_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------|--------------------------------------------------------|---------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | -!! | cnvgwd | flag_convective_gravity_wave_drag | flag for conv gravity wave drag | flag | 0 | logical | | in | F | -!! | lgocart | flag_gocart | flag for 3d diagnostic fields for gocart 1 | flag | 0 | logical | | in | F | -!! | do_ca | flag_for_cellular_automata | cellular automata main switch | flag | 0 | logical | | in | F | -!! | isppt_deep | flag_for_combination_of_sppt_with_isppt_deep | switch for combination with isppt_deep. | flag | 0 | logical | | in | F | -!! | gu0 | x_wind_updated_by_physics | zonal wind updated by physics | m s-1 | 2 | real | kind_phys | in | F | -!! | gv0 | y_wind_updated_by_physics | meridional wind updated by physics | m s-1 | 2 | real | kind_phys | in | F | -!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | in | F | -!! | gq0_water_vapor | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | save_u | x_wind_save | x-wind before entering a physics scheme | m s-1 | 2 | real | kind_phys | inout | F | -!! | save_v | y_wind_save | y-wind before entering a physics scheme | m s-1 | 2 | real | kind_phys | inout | F | -!! | save_t | air_temperature_save | air temperature before entering a physics scheme | K | 2 | real | kind_phys | inout | F | -!! | save_qv | water_vapor_specific_humidity_save | water vapor specific humidity before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ca_deep | fraction_of_cellular_automata_for_deep_convection | fraction of cellular automata for deep convection | frac | 1 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_DCNV_generic_pre_run.html !! #endif subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, cnvgwd, lgocart, do_ca, & @@ -105,63 +86,7 @@ end subroutine GFS_DCNV_generic_post_finalize #if 0 !> \section arg_table_GFS_DCNV_generic_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------|---------------|------|-------------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | -!! | lgocart | flag_gocart | flag for 3d diagnostic fields for gocart 1 | flag | 0 | logical | | in | F | -!! | ras | flag_for_ras_deep_convection | flag for ras convection scheme | flag | 0 | logical | | in | F | -!! | cscnv | flag_for_Chikira_Sugiyama_deep_convection | flag for Chikira-Sugiyama convection | flag | 0 | logical | | in | F | -!! | do_ca | flag_for_cellular_automata | cellular automata main switch | flag | 0 | logical | | in | F | -!! | isppt_deep | flag_for_combination_of_sppt_with_isppt_deep | switch for combination with isppt_deep. | flag | 0 | logical | | in | F | -!! | frain | dynamics_to_physics_timestep_ratio | ratio of dynamics timestep to physics timestep | none | 0 | real | kind_phys | in | F | -!! | rain1 | lwe_thickness_of_deep_convective_precipitation_amount | deep convective rainfall amount on physics timestep | m | 1 | real | kind_phys | in | F | -!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | -!! | cld1d | cloud_work_function | cloud work function | m2 s-2 | 1 | real | kind_phys | in | F | -!! | save_u | x_wind_save | x-wind before entering a physics scheme | m s-1 | 2 | real | kind_phys | in | F | -!! | save_v | y_wind_save | y-wind before entering a physics scheme | m s-1 | 2 | real | kind_phys | in | F | -!! | save_t | air_temperature_save | air temperature before entering a physics scheme | K | 2 | real | kind_phys | in | F | -!! | save_qv | water_vapor_specific_humidity_save | water vapor specific humidity before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gu0 | x_wind_updated_by_physics | zonal wind updated by physics | m s-1 | 2 | real | kind_phys | in | F | -!! | gv0 | y_wind_updated_by_physics | meridional wind updated by physics | m s-1 | 2 | real | kind_phys | in | F | -!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | in | F | -!! | gq0_water_vapor | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | ud_mf | instantaneous_atmosphere_updraft_convective_mass_flux | (updraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | in | F | -!! | dd_mf | instantaneous_atmosphere_downdraft_convective_mass_flux | (downdraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | in | F | -!! | dt_mf | instantaneous_atmosphere_detrainment_convective_mass_flux | (detrainment mass flux) * delt | kg m-2 | 2 | real | kind_phys | in | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | clw_ice | ice_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | in | F | -!! | clw_liquid | cloud_condensed_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | in | F | -!! | npdf3d | number_of_3d_arrays_associated_with_pdf_based_clouds | number of 3d arrays associated with pdf based clouds/mp | count | 0 | integer | | in | F | -!! | num_p3d | array_dimension_of_3d_arrays_for_microphysics | number of 3D arrays needed for microphysics | count | 0 | integer | | in | F | -!! | ncnvcld3d | number_of_convective_3d_cloud_fields | number of convective 3d clouds fields | count | 0 | integer | | in | F | -!! | rainc | lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep | convective rain at this time step | m | 1 | real | kind_phys | inout | F | -!! | cldwrk | cumulative_cloud_work_function | cumulative cloud work function (valid only with sas) | m2 s-1 | 1 | real | kind_phys | inout | F | -!! | dt3dt | cumulative_change_in_temperature_due_to_deep_convection | cumulative change in temperature due to deep conv. | K | 2 | real | kind_phys | inout | F | -!! | dq3dt | cumulative_change_in_water_vapor_specific_humidity_due_to_deep_convection | cumulative change in water vapor specific humidity due to deep conv. | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | du3dt | cumulative_change_in_x_wind_due_to_deep_convection | cumulative change in x wind due to deep convection | m s-1 | 2 | real | kind_phys | inout | F | -!! | dv3dt | cumulative_change_in_y_wind_due_to_deep_convection | cumulative change in y wind due to deep convection | m s-1 | 2 | real | kind_phys | inout | F | -!! | upd_mf | cumulative_atmosphere_updraft_convective_mass_flux | cumulative updraft mass flux | Pa | 2 | real | kind_phys | inout | F | -!! | dwn_mf | cumulative_atmosphere_downdraft_convective_mass_flux | cumulative downdraft mass flux | Pa | 2 | real | kind_phys | inout | F | -!! | det_mf | cumulative_atmosphere_detrainment_convective_mass_flux | cumulative detrainment mass flux | Pa | 2 | real | kind_phys | inout | F | -!! | dqdti | instantaneous_water_vapor_specific_humidity_tendency_due_to_convection | instantaneous moisture tendency due to convection | kg kg-1 s-1 | 2 | real | kind_phys | inout | F | -!! | cnvqci | instantaneous_deep_convective_cloud_condensate_mixing_ratio_on_dynamics_time_step | instantaneous total convective condensate mixing ratio | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | upd_mfi | instantaneous_atmosphere_updraft_convective_mass_flux_on_dynamics_timestep | (updraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | inout | F | -!! | dwn_mfi | instantaneous_atmosphere_downdraft_convective_mass_flux_on_dynamics_timestep | (downdraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | inout | F | -!! | det_mfi | instantaneous_atmosphere_detrainment_convective_mass_flux_on_dynamics_timestep | (detrainment mass flux) * delt | kg m-2 | 2 | real | kind_phys | inout | F | -!! | cnvw | convective_cloud_water_mixing_ratio | moist convective cloud water mixing ratio | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | inout | F | -!! | cnvw_phy_f3d | convective_cloud_water_mixing_ratio_in_phy_f3d | convective cloud water mixing ratio in the phy_f3d array | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | cnvc_phy_f3d | convective_cloud_cover_in_phy_f3d | convective cloud cover in the phy_f3d array | frac | 2 | real | kind_phys | inout | F | -!! | cape | convective_available_potential_energy_for_coupling | convective available potential energy for coupling | m2 s-2 | 1 | real | kind_phys | inout | F | -!! | tconvtend | tendency_of_air_temperature_due_to_deep_convection_for_coupling_on_physics_timestep | tendency of air temperature due to deep convection | K | 2 | real | kind_phys | inout | F | -!! | qconvtend | tendency_of_water_vapor_specific_humidity_due_to_deep_convection_for_coupling_on_physics_timestep | tendency of specific humidity due to deep convection | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | uconvtend | tendency_of_x_wind_due_to_deep_convection_for_coupling_on_physics_timestep | tendency_of_x_wind_due_to_deep_convection | m s-1 | 2 | real | kind_phys | inout | F | -!! | vconvtend | tendency_of_y_wind_due_to_deep_convection_for_coupling_on_physics_timestep | tendency_of_y_wind_due_to_deep_convection | m s-1 | 2 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_DCNV_generic_post_run.html !! #endif subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, lgocart, ras, cscnv, do_ca, & diff --git a/physics/GFS_DCNV_generic.meta b/physics/GFS_DCNV_generic.meta new file mode 100644 index 000000000..1aee22322 --- /dev/null +++ b/physics/GFS_DCNV_generic.meta @@ -0,0 +1,644 @@ +[ccpp-arg-table] + name = GFS_DCNV_generic_pre_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for 3d diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[cnvgwd] + standard_name = flag_convective_gravity_wave_drag + long_name = flag for conv gravity wave drag + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lgocart] + standard_name = flag_gocart + long_name = flag for 3d diagnostic fields for gocart 1 + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_ca] + standard_name = flag_for_cellular_automata + long_name = cellular automata main switch + units = flag + dimensions = () + type = logical + intent = in + optional = F +[isppt_deep] + standard_name = flag_for_combination_of_sppt_with_isppt_deep + long_name = switch for combination with isppt_deep. + units = flag + dimensions = () + type = logical + intent = in + optional = F +[gu0] + standard_name = x_wind_updated_by_physics + long_name = zonal wind updated by physics + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gv0] + standard_name = y_wind_updated_by_physics + long_name = meridional wind updated by physics + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0_water_vapor] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[save_u] + standard_name = x_wind_save + long_name = x-wind before entering a physics scheme + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[save_v] + standard_name = y_wind_save + long_name = y-wind before entering a physics scheme + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[save_t] + standard_name = air_temperature_save + long_name = air temperature before entering a physics scheme + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[save_qv] + standard_name = water_vapor_specific_humidity_save + long_name = water vapor specific humidity before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ca_deep] + standard_name = fraction_of_cellular_automata_for_deep_convection + long_name = fraction of cellular automata for deep convection + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_DCNV_generic_post_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[lssav] + standard_name = flag_diagnostics + long_name = logical flag for storing diagnostics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for 3d diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lgocart] + standard_name = flag_gocart + long_name = flag for 3d diagnostic fields for gocart 1 + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ras] + standard_name = flag_for_ras_deep_convection + long_name = flag for ras convection scheme + units = flag + dimensions = () + type = logical + intent = in + optional = F +[cscnv] + standard_name = flag_for_Chikira_Sugiyama_deep_convection + long_name = flag for Chikira-Sugiyama convection + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_ca] + standard_name = flag_for_cellular_automata + long_name = cellular automata main switch + units = flag + dimensions = () + type = logical + intent = in + optional = F +[isppt_deep] + standard_name = flag_for_combination_of_sppt_with_isppt_deep + long_name = switch for combination with isppt_deep. + units = flag + dimensions = () + type = logical + intent = in + optional = F +[frain] + standard_name = dynamics_to_physics_timestep_ratio + long_name = ratio of dynamics timestep to physics timestep + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rain1] + standard_name = lwe_thickness_of_deep_convective_precipitation_amount + long_name = deep convective rainfall amount on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dtf] + standard_name = time_step_for_dynamics + long_name = dynamics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cld1d] + standard_name = cloud_work_function + long_name = cloud work function + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[save_u] + standard_name = x_wind_save + long_name = x-wind before entering a physics scheme + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[save_v] + standard_name = y_wind_save + long_name = y-wind before entering a physics scheme + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[save_t] + standard_name = air_temperature_save + long_name = air temperature before entering a physics scheme + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[save_qv] + standard_name = water_vapor_specific_humidity_save + long_name = water vapor specific humidity before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gu0] + standard_name = x_wind_updated_by_physics + long_name = zonal wind updated by physics + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gv0] + standard_name = y_wind_updated_by_physics + long_name = meridional wind updated by physics + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0_water_vapor] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ud_mf] + standard_name = instantaneous_atmosphere_updraft_convective_mass_flux + long_name = (updraft mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dd_mf] + standard_name = instantaneous_atmosphere_downdraft_convective_mass_flux + long_name = (downdraft mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dt_mf] + standard_name = instantaneous_atmosphere_detrainment_convective_mass_flux + long_name = (detrainment mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[clw_ice] + standard_name = ice_water_mixing_ratio_convective_transport_tracer + long_name = moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[clw_liquid] + standard_name = cloud_condensed_water_mixing_ratio_convective_transport_tracer + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[npdf3d] + standard_name = number_of_3d_arrays_associated_with_pdf_based_clouds + long_name = number of 3d arrays associated with pdf based clouds/mp + units = count + dimensions = () + type = integer + intent = in + optional = F +[num_p3d] + standard_name = array_dimension_of_3d_arrays_for_microphysics + long_name = number of 3D arrays needed for microphysics + units = count + dimensions = () + type = integer + intent = in + optional = F +[ncnvcld3d] + standard_name = number_of_convective_3d_cloud_fields + long_name = number of convective 3d clouds fields + units = count + dimensions = () + type = integer + intent = in + optional = F +[rainc] + standard_name = lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep + long_name = convective rain at this time step + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cldwrk] + standard_name = cumulative_cloud_work_function + long_name = cumulative cloud work function (valid only with sas) + units = m2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dt3dt] + standard_name = cumulative_change_in_temperature_due_to_deep_convection + long_name = cumulative change in temperature due to deep conv. + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dq3dt] + standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_deep_convection + long_name = cumulative change in water vapor specific humidity due to deep conv. + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[du3dt] + standard_name = cumulative_change_in_x_wind_due_to_deep_convection + long_name = cumulative change in x wind due to deep convection + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dv3dt] + standard_name = cumulative_change_in_y_wind_due_to_deep_convection + long_name = cumulative change in y wind due to deep convection + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[upd_mf] + standard_name = cumulative_atmosphere_updraft_convective_mass_flux + long_name = cumulative updraft mass flux + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dwn_mf] + standard_name = cumulative_atmosphere_downdraft_convective_mass_flux + long_name = cumulative downdraft mass flux + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[det_mf] + standard_name = cumulative_atmosphere_detrainment_convective_mass_flux + long_name = cumulative detrainment mass flux + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dqdti] + standard_name = instantaneous_water_vapor_specific_humidity_tendency_due_to_convection + long_name = instantaneous moisture tendency due to convection + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnvqci] + standard_name = instantaneous_deep_convective_cloud_condensate_mixing_ratio_on_dynamics_time_step + long_name = instantaneous total convective condensate mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[upd_mfi] + standard_name = instantaneous_atmosphere_updraft_convective_mass_flux_on_dynamics_timestep + long_name = (updraft mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dwn_mfi] + standard_name = instantaneous_atmosphere_downdraft_convective_mass_flux_on_dynamics_timestep + long_name = (downdraft mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[det_mfi] + standard_name = instantaneous_atmosphere_detrainment_convective_mass_flux_on_dynamics_timestep + long_name = (detrainment mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnvw] + standard_name = convective_cloud_water_mixing_ratio + long_name = moist convective cloud water mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnvc] + standard_name = convective_cloud_cover + long_name = convective cloud cover + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnvw_phy_f3d] + standard_name = convective_cloud_water_mixing_ratio_in_phy_f3d + long_name = convective cloud water mixing ratio in the phy_f3d array + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnvc_phy_f3d] + standard_name = convective_cloud_cover_in_phy_f3d + long_name = convective cloud cover in the phy_f3d array + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cape] + standard_name = convective_available_potential_energy_for_coupling + long_name = convective available potential energy for coupling + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tconvtend] + standard_name = tendency_of_air_temperature_due_to_deep_convection_for_coupling_on_physics_timestep + long_name = tendency of air temperature due to deep convection + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qconvtend] + standard_name = tendency_of_water_vapor_specific_humidity_due_to_deep_convection_for_coupling_on_physics_timestep + long_name = tendency of specific humidity due to deep convection + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[uconvtend] + standard_name = tendency_of_x_wind_due_to_deep_convection_for_coupling_on_physics_timestep + long_name = tendency_of_x_wind_due_to_deep_convection + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[vconvtend] + standard_name = tendency_of_y_wind_due_to_deep_convection_for_coupling_on_physics_timestep + long_name = tendency_of_y_wind_due_to_deep_convection + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 8d3074988..b83f592f2 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -14,21 +14,7 @@ end subroutine GFS_MP_generic_pre_init !> \section arg_table_GFS_MP_generic_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|---------------------------------------------------------------------------|-------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | ldiag3d | flag_diagnostics_3D | logical flag for 3D diagnostics | flag | 0 | logical | | in | F | -!! | do_aw | flag_for_Arakawa_Wu_adjustment | flag for Arakawa Wu scale-aware adjustment | flag | 0 | logical | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | tracer index for cloud condensate (or liquid water) | index | 0 | integer | | in | F | -!! | nncl | number_of_tracers_for_cloud_condensate | number of tracers for cloud condensate | count | 0 | integer | | in | F | -!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | in | F | -!! | gq0 | tracer_concentration_updated_by_physics | tracer concentration updated by physics | kg kg-1 | 3 | real | kind_phys | in | F | -!! | save_t | air_temperature_save | air temperature before entering a physics scheme | K | 2 | real | kind_phys | inout | F | -!! | save_q | tracer_concentration_save | tracer concentration before entering a physics scheme | kg kg-1 | 3 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_MP_generic_pre_run.html !! subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, do_aw, ntcw, nncl, ntrac, gt0, gq0, save_t, save_q, errmsg, errflg) ! @@ -90,89 +76,7 @@ end subroutine GFS_MP_generic_post_init !! rain/snow by surface temperature; and determine explicit rain/snow by rain/snow coming out directly from MP. !! !! \section arg_table_GFS_MP_generic_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |------------------|-------------------------------------------------------------------------|-------------------------------------------------------------------------|-------------|------|------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | kdt | index_of_time_step | current time step index | index | 0 | integer | | in | F | -!! | nrcm | array_dimension_of_random_number | second dimension of random number stream for RAS | count | 0 | integer | | in | F | -!! | ncld | number_of_hydrometeors | choice of cloud scheme / number of hydrometeors | count | 0 | integer | | in | F | -!! | nncl | number_of_tracers_for_cloud_condensate | number of tracers for cloud condensate | count | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | tracer index for cloud condensate (or liquid water) | index | 0 | integer | | in | F | -!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | -!! | cal_pre | flag_for_precipitation_type_algorithm | flag controls precip type algorithm | flag | 0 | logical | | in | F | -!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | -!! | cplchm | flag_for_chemistry_coupling | flag controlling cplchm collection (default off) | flag | 0 | logical | | in | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | -!! | frain | dynamics_to_physics_timestep_ratio | ratio of dynamics timestep to physics timestep | none | 0 | real | kind_phys | in | F | -!! | rainc | lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep | convective rain at this time step | m | 1 | real | kind_phys | in | F | -!! | rain1 | lwe_thickness_of_explicit_precipitation_amount | explicit rainfall amount on physics timestep | m | 1 | real | kind_phys | in | F | -!! | rann | random_number_array | random number array (0-1) | none | 2 | real | kind_phys | in | F | -!! | xlat | latitude | latitude | radians | 1 | real | kind_phys | in | F | -!! | xlon | longitude | longitude | radians | 1 | real | kind_phys | in | F | -!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | in | F | -!! | gq0 | tracer_concentration_updated_by_physics | tracer concentration updated by physics | kg kg-1 | 3 | real | kind_phys | in | F | -!! | prsl | air_pressure | layer mean pressure | Pa | 2 | real | kind_phys | in | F | -!! | prsi | air_pressure_at_interface | pressure at layer interface | Pa | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | -!! | ice | lwe_thickness_of_ice_amount_on_dynamics_timestep | ice fall at this time step | m | 1 | real | kind_phys | inout | F | -!! | snow | lwe_thickness_of_snow_amount_on_dynamics_timestep | snow fall at this time step | m | 1 | real | kind_phys | inout | F | -!! | graupel | lwe_thickness_of_graupel_amount_on_dynamics_timestep | graupel fall at this time step | m | 1 | real | kind_phys | inout | F | -!! | save_t | air_temperature_save | air temperature before entering a physics scheme | K | 2 | real | kind_phys | in | F | -!! | save_qv | water_vapor_specific_humidity_save | water vapor specific humidity before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | in | F | -!! | rain0 | lwe_thickness_of_explicit_rain_amount | explicit rain on physics timestep | m | 1 | real | kind_phys | in | F | -!! | ice0 | lwe_thickness_of_ice_amount | ice fall on physics timestep | m | 1 | real | kind_phys | in | F | -!! | snow0 | lwe_thickness_of_snow_amount | snow fall on physics timestep | m | 1 | real | kind_phys | in | F | -!! | graupel0 | lwe_thickness_of_graupel_amount | graupel fall on physics timestep | m | 1 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | air pressure difference between midlayers | Pa | 2 | real | kind_phys | in | F | -!! | rain | lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total rain at this time step | m | 1 | real | kind_phys | inout | F | -!! | domr_diag | dominant_rain_type | dominant rain type | none | 1 | real | kind_phys | inout | F | -!! | domzr_diag | dominant_freezing_rain_type | dominant freezing rain type | none | 1 | real | kind_phys | inout | F | -!! | domip_diag | dominant_sleet_type | dominant sleet type | none | 1 | real | kind_phys | inout | F | -!! | doms_diag | dominant_snow_type | dominant snow type | none | 1 | real | kind_phys | inout | F | -!! | tprcp | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total precipitation amount in each time step | m | 1 | real | kind_phys | inout | F | -!! | srflag | flag_for_precipitation_type | snow/rain flag for precipitation | flag | 1 | real | kind_phys | inout | F | -!! | sr | ratio_of_snowfall_to_rainfall | snow ratio: ratio of snow to total precipitation | frac | 1 | real | kind_phys | in | F | -!! | cnvprcp | cumulative_lwe_thickness_of_convective_precipitation_amount | cumulative convective precipitation | m | 1 | real | kind_phys | inout | F | -!! | totprcp | accumulated_lwe_thickness_of_precipitation_amount | accumulated total precipitation | m | 1 | real | kind_phys | inout | F | -!! | totice | accumulated_lwe_thickness_of_ice_amount | accumulated ice precipitation | kg m-2 | 1 | real | kind_phys | inout | F | -!! | totsnw | accumulated_lwe_thickness_of_snow_amount | accumulated snow precipitation | kg m-2 | 1 | real | kind_phys | inout | F | -!! | totgrp | accumulated_lwe_thickness_of_graupel_amount | accumulated graupel precipitation | kg m-2 | 1 | real | kind_phys | inout | F | -!! | cnvprcpb | cumulative_lwe_thickness_of_convective_precipitation_amount_in_bucket | cumulative convective precipitation in bucket | m | 1 | real | kind_phys | inout | F | -!! | totprcpb | accumulated_lwe_thickness_of_precipitation_amount_in_bucket | accumulated total precipitation in bucket | m | 1 | real | kind_phys | inout | F | -!! | toticeb | accumulated_lwe_thickness_of_ice_amount_in_bucket | accumulated ice precipitation in bucket | kg m-2 | 1 | real | kind_phys | inout | F | -!! | totsnwb | accumulated_lwe_thickness_of_snow_amount_in_bucket | accumulated snow precipitation in bucket | kg m-2 | 1 | real | kind_phys | inout | F | -!! | totgrpb | accumulated_lwe_thickness_of_graupel_amount_in_bucket | accumulated graupel precipitation in bucket | kg m-2 | 1 | real | kind_phys | inout | F | -!! | dt3dt | cumulative_change_in_temperature_due_to_microphysics | cumulative change in temperature due to microphysics | K | 2 | real | kind_phys | inout | F | -!! | dq3dt | cumulative_change_in_water_vapor_specific_humidity_due_to_microphysics | cumulative change in water vapor specific humidity due to microphysics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | rain_cpl | lwe_thickness_of_precipitation_amount_for_coupling | total rain precipitation | m | 1 | real | kind_phys | inout | F | -!! | rainc_cpl | lwe_thickness_of_convective_precipitation_amount_for_coupling | total convective precipitation | m | 1 | real | kind_phys | inout | F | -!! | snow_cpl | lwe_thickness_of_snow_amount_for_coupling | total snow precipitation | m | 1 | real | kind_phys | inout | F | -!! | pwat | column_precipitable_water | precipitable water | kg m-2 | 1 | real | kind_phys | inout | F | -!! | do_sppt | flag_for_stochastic_surface_physics_perturbations | flag for stochastic surface physics perturbations | flag | 0 | logical | | in | F | -!! | dtdtr | tendency_of_air_temperature_due_to_radiative_heating_on_physics_time_step| temp. change due to radiative heating per time step | K | 2 | real | kind_phys | inout | F | -!! | dtdtc | tendency_of_air_temperature_due_to_radiative_heating_assuming_clear_sky | clear sky radiative (shortwave + longwave) heating rate at current time | K s-1 | 2 | real | kind_phys | in | F | -!! | drain_cpl | tendency_of_lwe_thickness_of_precipitation_amount_for_coupling | change in rain_cpl (coupling_type) | m | 1 | real | kind_phys | inout | F | -!! | dsnow_cpl | tendency_of_lwe_thickness_of_snow_amount_for_coupling | change in show_cpl (coupling_type) | m | 1 | real | kind_phys | inout | F | -!! | lsm | flag_for_land_surface_scheme | flag for land surface model | flag | 0 | integer | | in | F | -!! | lsm_ruc | flag_for_ruc_land_surface_scheme | flag for RUC land surface model | flag | 0 | integer | | in | F | -!! | raincprv | lwe_thickness_of_convective_precipitation_amount_from_previous_timestep | convective_precipitation_amount from previous timestep | m | 1 | real | kind_phys | inout | F | -!! | rainncprv | lwe_thickness_of_explicit_rainfall_amount_from_previous_timestep | explicit rainfall from previous timestep | m | 1 | real | kind_phys | inout | F | -!! | iceprv | lwe_thickness_of_ice_amount_from_previous_timestep | ice amount from previous timestep | m | 1 | real | kind_phys | inout | F | -!! | snowprv | lwe_thickness_of_snow_amount_from_previous_timestep | snow amount from previous timestep | m | 1 | real | kind_phys | inout | F | -!! | graupelprv | lwe_thickness_of_graupel_amount_from_previous_timestep | graupel amount from previous timestep | m | 1 | real | kind_phys | inout | F | -!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_MP_generic_post_run.html !! !> \section gfs_mp_gen GFS MP Generic Post General Algorithm !> @{ diff --git a/physics/GFS_MP_generic.meta b/physics/GFS_MP_generic.meta new file mode 100644 index 000000000..2e55b6ad5 --- /dev/null +++ b/physics/GFS_MP_generic.meta @@ -0,0 +1,844 @@ +[ccpp-arg-table] + name = GFS_MP_generic_pre_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = GFS_MP_generic_pre_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = logical flag for 3D diagnostics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_aw] + standard_name = flag_for_Arakawa_Wu_adjustment + long_name = flag for Arakawa Wu scale-aware adjustment + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ntcw] + standard_name = index_for_liquid_cloud_condensate + long_name = tracer index for cloud condensate (or liquid water) + units = index + dimensions = () + type = integer + intent = in + optional = F +[nncl] + standard_name = number_of_tracers_for_cloud_condensate + long_name = number of tracers for cloud condensate + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0] + standard_name = tracer_concentration_updated_by_physics + long_name = tracer concentration updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = in + optional = F +[save_t] + standard_name = air_temperature_save + long_name = air temperature before entering a physics scheme + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[save_q] + standard_name = tracer_concentration_save + long_name = tracer concentration before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_MP_generic_pre_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = GFS_MP_generic_post_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = GFS_MP_generic_post_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[kdt] + standard_name = index_of_time_step + long_name = current time step index + units = index + dimensions = () + type = integer + intent = in + optional = F +[nrcm] + standard_name = array_dimension_of_random_number + long_name = second dimension of random number stream for RAS + units = count + dimensions = () + type = integer + intent = in + optional = F +[ncld] + standard_name = number_of_hydrometeors + long_name = choice of cloud scheme / number of hydrometeors + units = count + dimensions = () + type = integer + intent = in + optional = F +[nncl] + standard_name = number_of_tracers_for_cloud_condensate + long_name = number of tracers for cloud condensate + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntcw] + standard_name = index_for_liquid_cloud_condensate + long_name = tracer index for cloud condensate (or liquid water) + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F +[imp_physics] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_gfdl] + standard_name = flag_for_gfdl_microphysics_scheme + long_name = choice of GFDL microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_thompson] + standard_name = flag_for_thompson_microphysics_scheme + long_name = choice of Thompson microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_mg] + standard_name = flag_for_morrison_gettelman_microphysics_scheme + long_name = choice of Morrison-Gettelman microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[cal_pre] + standard_name = flag_for_precipitation_type_algorithm + long_name = flag controls precip type algorithm + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lssav] + standard_name = flag_diagnostics + long_name = logical flag for storing diagnostics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for 3d diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[cplflx] + standard_name = flag_for_flux_coupling + long_name = flag controlling cplflx collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[cplchm] + standard_name = flag_for_chemistry_coupling + long_name = flag controlling cplchm collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dtf] + standard_name = time_step_for_dynamics + long_name = dynamics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[frain] + standard_name = dynamics_to_physics_timestep_ratio + long_name = ratio of dynamics timestep to physics timestep + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rainc] + standard_name = lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep + long_name = convective rain at this time step + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rain1] + standard_name = lwe_thickness_of_explicit_precipitation_amount + long_name = explicit rainfall amount on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rann] + standard_name = random_number_array + long_name = random number array (0-1) + units = none + dimensions = (horizontal_dimension,array_dimension_of_random_number) + type = real + kind = kind_phys + intent = in + optional = F +[xlat] + standard_name = latitude + long_name = latitude + units = radians + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[xlon] + standard_name = longitude + long_name = longitude + units = radians + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0] + standard_name = tracer_concentration_updated_by_physics + long_name = tracer concentration updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = layer mean pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsi] + standard_name = air_pressure_at_interface + long_name = pressure at layer interface + units = Pa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[phii] + standard_name = geopotential_at_interface + long_name = geopotential at model layer interfaces + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[tsfc] + standard_name = surface_skin_temperature + long_name = surface skin temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ice] + standard_name = lwe_thickness_of_ice_amount_on_dynamics_timestep + long_name = ice fall at this time step + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snow] + standard_name = lwe_thickness_of_snow_amount_on_dynamics_timestep + long_name = snow fall at this time step + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[graupel] + standard_name = lwe_thickness_of_graupel_amount_on_dynamics_timestep + long_name = graupel fall at this time step + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[save_t] + standard_name = air_temperature_save + long_name = air temperature before entering a physics scheme + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[save_qv] + standard_name = water_vapor_specific_humidity_save + long_name = water vapor specific humidity before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rain0] + standard_name = lwe_thickness_of_explicit_rain_amount + long_name = explicit rain on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ice0] + standard_name = lwe_thickness_of_ice_amount + long_name = ice fall on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snow0] + standard_name = lwe_thickness_of_snow_amount + long_name = snow fall on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[graupel0] + standard_name = lwe_thickness_of_graupel_amount + long_name = graupel fall on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[del] + standard_name = air_pressure_difference_between_midlayers + long_name = air pressure difference between midlayers + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rain] + standard_name = lwe_thickness_of_precipitation_amount_on_dynamics_timestep + long_name = total rain at this time step + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[domr_diag] + standard_name = dominant_rain_type + long_name = dominant rain type + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[domzr_diag] + standard_name = dominant_freezing_rain_type + long_name = dominant freezing rain type + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[domip_diag] + standard_name = dominant_sleet_type + long_name = dominant sleet type + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[doms_diag] + standard_name = dominant_snow_type + long_name = dominant snow type + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tprcp] + standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep + long_name = total precipitation amount in each time step + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[srflag] + standard_name = flag_for_precipitation_type + long_name = snow/rain flag for precipitation + units = flag + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[sr] + standard_name = ratio_of_snowfall_to_rainfall + long_name = snow ratio: ratio of snow to total precipitation + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cnvprcp] + standard_name = cumulative_lwe_thickness_of_convective_precipitation_amount + long_name = cumulative convective precipitation + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[totprcp] + standard_name = accumulated_lwe_thickness_of_precipitation_amount + long_name = accumulated total precipitation + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[totice] + standard_name = accumulated_lwe_thickness_of_ice_amount + long_name = accumulated ice precipitation + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[totsnw] + standard_name = accumulated_lwe_thickness_of_snow_amount + long_name = accumulated snow precipitation + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[totgrp] + standard_name = accumulated_lwe_thickness_of_graupel_amount + long_name = accumulated graupel precipitation + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnvprcpb] + standard_name = cumulative_lwe_thickness_of_convective_precipitation_amount_in_bucket + long_name = cumulative convective precipitation in bucket + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[totprcpb] + standard_name = accumulated_lwe_thickness_of_precipitation_amount_in_bucket + long_name = accumulated total precipitation in bucket + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[toticeb] + standard_name = accumulated_lwe_thickness_of_ice_amount_in_bucket + long_name = accumulated ice precipitation in bucket + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[totsnwb] + standard_name = accumulated_lwe_thickness_of_snow_amount_in_bucket + long_name = accumulated snow precipitation in bucket + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[totgrpb] + standard_name = accumulated_lwe_thickness_of_graupel_amount_in_bucket + long_name = accumulated graupel precipitation in bucket + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dt3dt] + standard_name = cumulative_change_in_temperature_due_to_microphysics + long_name = cumulative change in temperature due to microphysics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dq3dt] + standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_microphysics + long_name = cumulative change in water vapor specific humidity due to microphysics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rain_cpl] + standard_name = lwe_thickness_of_precipitation_amount_for_coupling + long_name = total rain precipitation + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rainc_cpl] + standard_name = lwe_thickness_of_convective_precipitation_amount_for_coupling + long_name = total convective precipitation + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snow_cpl] + standard_name = lwe_thickness_of_snow_amount_for_coupling + long_name = total snow precipitation + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[pwat] + standard_name = column_precipitable_water + long_name = precipitable water + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[do_sppt] + standard_name = flag_for_stochastic_surface_physics_perturbations + long_name = flag for stochastic surface physics perturbations + units = flag + dimensions = () + type = logical + intent = in + optional = F +[dtdtr] + standard_name = tendency_of_air_temperature_due_to_radiative_heating_on_physics_time_step + long_name = temp. change due to radiative heating per time step + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dtdtc] + standard_name = tendency_of_air_temperature_due_to_radiative_heating_assuming_clear_sky + long_name = clear sky radiative (shortwave + longwave) heating rate at current time + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[drain_cpl] + standard_name = tendency_of_lwe_thickness_of_precipitation_amount_for_coupling + long_name = change in rain_cpl (coupling_type) + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dsnow_cpl] + standard_name = tendency_of_lwe_thickness_of_snow_amount_for_coupling + long_name = change in show_cpl (coupling_type) + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[lsm] + standard_name = flag_for_land_surface_scheme + long_name = flag for land surface model + units = flag + dimensions = () + type = integer + intent = in + optional = F +[lsm_ruc] + standard_name = flag_for_ruc_land_surface_scheme + long_name = flag for RUC land surface model + units = flag + dimensions = () + type = integer + intent = in + optional = F +[raincprv] + standard_name = lwe_thickness_of_convective_precipitation_amount_from_previous_timestep + long_name = convective_precipitation_amount from previous timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rainncprv] + standard_name = lwe_thickness_of_explicit_rainfall_amount_from_previous_timestep + long_name = explicit rainfall from previous timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[iceprv] + standard_name = lwe_thickness_of_ice_amount_from_previous_timestep + long_name = ice amount from previous timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snowprv] + standard_name = lwe_thickness_of_snow_amount_from_previous_timestep + long_name = snow amount from previous timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[graupelprv] + standard_name = lwe_thickness_of_graupel_amount_from_previous_timestep + long_name = graupel amount from previous timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dtp] + standard_name = time_step_for_physics + long_name = physics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_MP_generic_post_finalize + type = scheme diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index b67e07d76..e030b5d03 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -14,43 +14,7 @@ end subroutine GFS_PBL_generic_pre_finalize !> \brief This scheme sets up the vertically diffused tracer array for any PBL scheme based on the microphysics scheme chosen #if 0 !! \section arg_table_GFS_PBL_generic_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |------------------------------|--------------------------------------------------------|-------------------------------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | nvdiff | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | -!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | ntqv | index_for_water_vapor | tracer index for water vapor (specific humidity) | index | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | tracer index for cloud condensate (or liquid water) | index | 0 | integer | | in | F | -!! | ntiw | index_for_ice_cloud_condensate | tracer index for ice water | index | 0 | integer | | in | F | -!! | ntrw | index_for_rain_water | tracer index for rain water | index | 0 | integer | | in | F | -!! | ntsw | index_for_snow_water | tracer index for snow water | index | 0 | integer | | in | F | -!! | ntlnc | index_for_liquid_cloud_number_concentration | tracer index for liquid number concentration | index | 0 | integer | | in | F | -!! | ntinc | index_for_ice_cloud_number_concentration | tracer index for ice number concentration | index | 0 | integer | | in | F | -!! | ntrnc | index_for_rain_number_concentration | tracer index for rain number concentration | index | 0 | integer | | in | F | -!! | ntsnc | index_for_snow_number_concentration | tracer index for snow number concentration | index | 0 | integer | | in | F | -!! | ntgnc | index_for_graupel_number_concentration | tracer index for graupel number concentration | index | 0 | integer | | in | F | -!! | ntwa | index_for_water_friendly_aerosols | tracer index for water friendly aerosol | index | 0 | integer | | in | F | -!! | ntia | index_for_ice_friendly_aerosols | tracer index for ice friendly aerosol | index | 0 | integer | | in | F | -!! | ntgl | index_for_graupel | tracer index for graupel | index | 0 | integer | | in | F | -!! | ntoz | index_for_ozone | tracer index for ozone mixing ratio | index | 0 | integer | | in | F | -!! | ntke | index_for_turbulent_kinetic_energy | tracer index for turbulent kinetic energy | index | 0 | integer | | in | F | -!! | ntkev | index_for_turbulent_kinetic_energy_vertical_diffusion_tracer | index for turbulent kinetic energy in the vertically diffused tracer array | index | 0 | integer | | in | F | -!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_wsm6 | flag_for_wsm6_microphysics_scheme | choice of WSM6 microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_zhao_carr | flag_for_zhao_carr_microphysics_scheme | choice of Zhao-Carr microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | -!! | cplchm | flag_for_chemistry_coupling | flag controlling cplchm collection (default off) | flag | 0 | logical | | in | F | -!! | ltaerosol | flag_for_aerosol_physics | flag for aerosol physics | flag | 0 | logical | | in | F | -!! | hybedmf | flag_for_hedmf | flag for hybrid edmf pbl scheme (moninedmf) | flag | 0 | logical | | in | F | -!! | do_shoc | flag_for_shoc | flag for SHOC | flag | 0 | logical | | in | F | -!! | satmedmf | flag_for_scale_aware_TKE_moist_EDMF_PBL | flag for scale-aware TKE moist EDMF PBL scheme | flag | 0 | logical | | in | F | -!! | qgrs | tracer_concentration | model layer mean tracer concentration | kg kg-1 | 3 | real | kind_phys | in | F | -!! | vdftra | vertically_diffused_tracer_concentration | tracer concentration diffused by PBL scheme | kg kg-1 | 3 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_PBL_generic_pre_run.html !! #endif subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, & @@ -216,108 +180,7 @@ end subroutine GFS_PBL_generic_post_finalize #if 0 !> \section arg_table_GFS_PBL_generic_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |------------------------------|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | nvdiff | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | -!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | ntqv | index_for_water_vapor | tracer index for water vapor (specific humidity) | index | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | tracer index for cloud condensate (or liquid water) | index | 0 | integer | | in | F | -!! | ntiw | index_for_ice_cloud_condensate | tracer index for ice water | index | 0 | integer | | in | F | -!! | ntrw | index_for_rain_water | tracer index for rain water | index | 0 | integer | | in | F | -!! | ntsw | index_for_snow_water | tracer index for snow water | index | 0 | integer | | in | F | -!! | ntlnc | index_for_liquid_cloud_number_concentration | tracer index for liquid number concentration | index | 0 | integer | | in | F | -!! | ntinc | index_for_ice_cloud_number_concentration | tracer index for ice number concentration | index | 0 | integer | | in | F | -!! | ntrnc | index_for_rain_number_concentration | tracer index for rain number concentration | index | 0 | integer | | in | F | -!! | ntsnc | index_for_snow_number_concentration | tracer index for snow number concentration | index | 0 | integer | | in | F | -!! | ntgnc | index_for_graupel_number_concentration | tracer index for graupel number concentration | index | 0 | integer | | in | F | -!! | ntwa | index_for_water_friendly_aerosols | tracer index for water friendly aerosol | index | 0 | integer | | in | F | -!! | ntia | index_for_ice_friendly_aerosols | tracer index for ice friendly aerosol | index | 0 | integer | | in | F | -!! | ntgl | index_for_graupel | tracer index for graupel | index | 0 | integer | | in | F | -!! | ntoz | index_for_ozone | tracer index for ozone mixing ratio | index | 0 | integer | | in | F | -!! | ntke | index_for_turbulent_kinetic_energy | tracer index for turbulent kinetic energy | index | 0 | integer | | in | F | -!! | ntkev | index_for_turbulent_kinetic_energy_vertical_diffusion_tracer | index for turbulent kinetic energy in the vertically diffused tracer array | index | 0 | integer | | in | F | -!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_wsm6 | flag_for_wsm6_microphysics_scheme | choice of WSM6 microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_zhao_carr | flag_for_zhao_carr_microphysics_scheme | choice of Zhao-Carr microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | -!! | ltaerosol | flag_for_aerosol_physics | flag for aerosol physics | flag | 0 | logical | | in | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | -!! | cplchm | flag_for_chemistry_coupling | flag controlling cplchm collection (default off) | flag | 0 | logical | | in | F | -!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | -!! | lsidea | flag_idealized_physics | flag for idealized physics | flag | 0 | logical | | in | F | -!! | hybedmf | flag_for_hedmf | flag for hybrid edmf pbl scheme (moninedmf) | flag | 0 | logical | | in | F | -!! | do_shoc | flag_for_shoc | flag for SHOC | flag | 0 | logical | | in | F | -!! | satmedmf | flag_for_scale_aware_TKE_moist_EDMF_PBL | flag for scale-aware TKE moist EDMF PBL scheme | flag | 0 | logical | | in | F | -!! | shinhong | flag_for_scale_aware_Shinhong_PBL | flag for scale-aware Shinhong PBL scheme | flag | 0 | logical | | in | F | -!! | do_ysu | flag_for_ysu | flag for YSU PBL scheme | flag | 0 | logical | | in | F | -!! | dvdftra | tendency_of_vertically_diffused_tracer_concentration | updated tendency of the tracers due to vertical diffusion in PBL scheme | kg kg-1 s-1 | 3 | real | kind_phys | in | F | -!! | dusfc1 | instantaneous_surface_x_momentum_flux | surface momentum flux in the x-direction valid for current call | Pa | 1 | real | kind_phys | in | F | -!! | dvsfc1 | instantaneous_surface_y_momentum_flux | surface momentum flux in the y-direction valid for current call | Pa | 1 | real | kind_phys | in | F | -!! | dtsfc1 | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux valid for current call | W m-2 | 1 | real | kind_phys | in | F | -!! | dqsfc1 | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux valid for current call | W m-2 | 1 | real | kind_phys | in | F | -!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | -!! | dudt | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | in | F | -!! | dvdt | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | in | F | -!! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | in | F | -!! | htrsw | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep | total sky sw heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | htrlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep | total sky lw heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave | none | 1 | real | kind_phys | in | F | -!! | dqdt | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers due to model physics | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | -!! | dusfc_cpl | cumulative_surface_x_momentum_flux_for_coupling_multiplied_by_timestep | cumulative sfc u momentum flux multiplied by timestep | Pa s | 1 | real | kind_phys | inout | F | -!! | dvsfc_cpl | cumulative_surface_y_momentum_flux_for_coupling_multiplied_by_timestep | cumulative sfc v momentum flux multiplied by timestep | Pa s | 1 | real | kind_phys | inout | F | -!! | dtsfc_cpl | cumulative_surface_upward_sensible_heat_flux_for_coupling_multiplied_by_timestep | cumulative sfc sensible heat flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | dqsfc_cpl | cumulative_surface_upward_latent_heat_flux_for_coupling_multiplied_by_timestep | cumulative sfc latent heat flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | dusfci_cpl | instantaneous_surface_x_momentum_flux_for_coupling | instantaneous sfc u momentum flux | Pa | 1 | real | kind_phys | inout | F | -!! | dvsfci_cpl | instantaneous_surface_y_momentum_flux_for_coupling | instantaneous sfc v momentum flux | Pa | 1 | real | kind_phys | inout | F | -!! | dtsfci_cpl | instantaneous_surface_upward_sensible_heat_flux_for_coupling | instantaneous sfc sensible heat flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | dqsfci_cpl | instantaneous_surface_upward_latent_heat_flux_for_coupling | instantaneous sfc latent heat flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | dusfc_diag | cumulative_surface_x_momentum_flux_for_diag_multiplied_by_timestep | cumulative sfc x momentum flux multiplied by timestep | Pa s | 1 | real | kind_phys | inout | F | -!! | dvsfc_diag | cumulative_surface_y_momentum_flux_for_diag_multiplied_by_timestep | cumulative sfc y momentum flux multiplied by timestep | Pa s | 1 | real | kind_phys | inout | F | -!! | dtsfc_diag | cumulative_surface_upward_sensible_heat_flux_for_diag_multiplied_by_timestep | cumulative sfc sensible heat flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | dqsfc_diag | cumulative_surface_upward_latent_heat_flux_for_diag_multiplied_by_timestep | cumulative sfc latent heat flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | dusfci_diag | instantaneous_surface_x_momentum_flux_for_diag | instantaneous sfc x momentum flux multiplied by timestep | Pa | 1 | real | kind_phys | inout | F | -!! | dvsfci_diag | instantaneous_surface_y_momentum_flux_for_diag | instantaneous sfc y momentum flux multiplied by timestep | Pa | 1 | real | kind_phys | inout | F | -!! | dtsfci_diag | instantaneous_surface_upward_sensible_heat_flux_for_diag | instantaneous sfc sensible heat flux multiplied by timestep | W m-2 | 1 | real | kind_phys | inout | F | -!! | dqsfci_diag | instantaneous_surface_upward_latent_heat_flux_for_diag | instantaneous sfc latent heat flux multiplied by timestep | W m-2 | 1 | real | kind_phys | inout | F | -!! | dt3dt | cumulative_change_in_temperature_due_to_PBL | cumulative change in temperature due to PBL | K | 2 | real | kind_phys | inout | F | -!! | du3dt_PBL | cumulative_change_in_x_wind_due_to_PBL | cumulative change in x wind due to PBL | m s-1 | 2 | real | kind_phys | inout | F | -!! | du3dt_OGWD | cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag | cumulative change in x wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | -!! | dv3dt_PBL | cumulative_change_in_y_wind_due_to_PBL | cumulative change in y wind due to PBL | m s-1 | 2 | real | kind_phys | inout | F | -!! | dv3dt_OGWD | cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag | cumulative change in y wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | -!! | dq3dt | cumulative_change_in_water_vapor_specific_humidity_due_to_PBL | cumulative change in water vapor specific humidity due to PBL | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | dq3dt_ozone | cumulative_change_in_ozone_mixing_ratio_due_to_PBL | cumulative change in ozone mixing ratio due to PBL | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | fvirt | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | t1 | air_temperature_at_lowest_model_layer_for_diag | layer 1 temperature for diag | K | 1 | real | kind_phys | in | F | -!! | q1 | water_vapor_specific_humidity_at_lowest_model_layer_for_diag | layer 1 specific humidity for diag | kg kg-1 | 1 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | hflx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | ushfsfci | instantaneous_surface_upward_sensible_heat_flux_for_chemistry_coupling | instantaneous upward sensible heat flux for chemistry coupling | W m-2 | 1 | real | kind_phys | out | F | -!! | oceanfrac | sea_area_fraction | fraction of horizontal grid area occupied by ocean | frac | 1 | real | kind_phys | in | F | -!! | fice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | -!! | dusfc_cice | surface_x_momentum_flux_for_coupling_interstitial | sfc x momentum flux for coupling interstitial | Pa | 1 | real | kind_phys | in | F | -!! | dvsfc_cice | surface_y_momentum_flux_for_coupling_interstitial | sfc y momentum flux for coupling interstitial | Pa | 1 | real | kind_phys | in | F | -!! | dtsfc_cice | surface_upward_sensible_heat_flux_for_coupling_interstitial | sfc sensible heat flux for coupling interstitial | W m-2 | 1 | real | kind_phys | in | F | -!! | dqsfc_cice | surface_upward_latent_heat_flux_for_coupling_interstitial | sfc latent heat flux for coupling interstitial | W m-2 | 1 | real | kind_phys | in | F | -!! | dry | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | -!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | -!! | wind | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | stress_ocn | surface_wind_stress_over_ocean | surface wind stress over ocean | m2 s-2 | 1 | real | kind_phys | in | F | -!! | hflx_ocn | kinematic_surface_upward_sensible_heat_flux_over_ocean | kinematic surface upward sensible heat flux over ocean | K m s-1 | 1 | real | kind_phys | in | F | -!! | evap_ocn | kinematic_surface_upward_latent_heat_flux_over_ocean | kinematic surface upward latent heat flux over ocean | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | ugrs1 | x_wind_at_lowest_model_layer | zonal wind at lowest model layer | m s-1 | 1 | real | kind_phys | in | F | -!! | vgrs1 | y_wind_at_lowest_model_layer | meridional wind at lowest model layer | m s-1 | 1 | real | kind_phys | in | F | -!! | dkt_cpl | instantaneous_atmosphere_heat_diffusivity | instantaneous atmospheric heat diffusivity | m2 s-1 | 2 | real | kind_phys | inout | F | -!! | dkt | atmosphere_heat_diffusivity | diffusivity for heat | m2 s-1 | 2 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_PBL_generic_post_run.html !! #endif subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, & diff --git a/physics/GFS_PBL_generic.meta b/physics/GFS_PBL_generic.meta new file mode 100644 index 000000000..677f2e533 --- /dev/null +++ b/physics/GFS_PBL_generic.meta @@ -0,0 +1,1151 @@ +[ccpp-arg-table] + name = GFS_PBL_generic_pre_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[nvdiff] + standard_name = number_of_vertical_diffusion_tracers + long_name = number of tracers to diffuse vertically + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntqv] + standard_name = index_for_water_vapor + long_name = tracer index for water vapor (specific humidity) + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntcw] + standard_name = index_for_liquid_cloud_condensate + long_name = tracer index for cloud condensate (or liquid water) + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntiw] + standard_name = index_for_ice_cloud_condensate + long_name = tracer index for ice water + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntrw] + standard_name = index_for_rain_water + long_name = tracer index for rain water + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntsw] + standard_name = index_for_snow_water + long_name = tracer index for snow water + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntlnc] + standard_name = index_for_liquid_cloud_number_concentration + long_name = tracer index for liquid number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntinc] + standard_name = index_for_ice_cloud_number_concentration + long_name = tracer index for ice number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntrnc] + standard_name = index_for_rain_number_concentration + long_name = tracer index for rain number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntsnc] + standard_name = index_for_snow_number_concentration + long_name = tracer index for snow number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntgnc] + standard_name = index_for_graupel_number_concentration + long_name = tracer index for graupel number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntwa] + standard_name = index_for_water_friendly_aerosols + long_name = tracer index for water friendly aerosol + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntia] + standard_name = index_for_ice_friendly_aerosols + long_name = tracer index for ice friendly aerosol + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntgl] + standard_name = index_for_graupel + long_name = tracer index for graupel + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntoz] + standard_name = index_for_ozone + long_name = tracer index for ozone mixing ratio + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntke] + standard_name = index_for_turbulent_kinetic_energy + long_name = tracer index for turbulent kinetic energy + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntkev] + standard_name = index_for_turbulent_kinetic_energy_vertical_diffusion_tracer + long_name = index for turbulent kinetic energy in the vertically diffused tracer array + units = index + dimensions = () + type = integer + intent = in + optional = F +[imp_physics] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_gfdl] + standard_name = flag_for_gfdl_microphysics_scheme + long_name = choice of GFDL microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_thompson] + standard_name = flag_for_thompson_microphysics_scheme + long_name = choice of Thompson microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_wsm6] + standard_name = flag_for_wsm6_microphysics_scheme + long_name = choice of WSM6 microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_zhao_carr] + standard_name = flag_for_zhao_carr_microphysics_scheme + long_name = choice of Zhao-Carr microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_mg] + standard_name = flag_for_morrison_gettelman_microphysics_scheme + long_name = choice of Morrison-Gettelman microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[cplchm] + standard_name = flag_for_chemistry_coupling + long_name = flag controlling cplchm collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ltaerosol] + standard_name = flag_for_aerosol_physics + long_name = flag for aerosol physics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[hybedmf] + standard_name = flag_for_hedmf + long_name = flag for hybrid edmf pbl scheme (moninedmf) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_shoc] + standard_name = flag_for_shoc + long_name = flag for SHOC + units = flag + dimensions = () + type = logical + intent = in + optional = F +[satmedmf] + standard_name = flag_for_scale_aware_TKE_moist_EDMF_PBL + long_name = flag for scale-aware TKE moist EDMF PBL scheme + units = flag + dimensions = () + type = logical + intent = in + optional = F +[qgrs] + standard_name = tracer_concentration + long_name = model layer mean tracer concentration + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = in + optional = F +[vdftra] + standard_name = vertically_diffused_tracer_concentration + long_name = tracer concentration diffused by PBL scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_vertical_diffusion_tracers) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_PBL_generic_post_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[nvdiff] + standard_name = number_of_vertical_diffusion_tracers + long_name = number of tracers to diffuse vertically + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntqv] + standard_name = index_for_water_vapor + long_name = tracer index for water vapor (specific humidity) + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntcw] + standard_name = index_for_liquid_cloud_condensate + long_name = tracer index for cloud condensate (or liquid water) + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntiw] + standard_name = index_for_ice_cloud_condensate + long_name = tracer index for ice water + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntrw] + standard_name = index_for_rain_water + long_name = tracer index for rain water + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntsw] + standard_name = index_for_snow_water + long_name = tracer index for snow water + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntlnc] + standard_name = index_for_liquid_cloud_number_concentration + long_name = tracer index for liquid number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntinc] + standard_name = index_for_ice_cloud_number_concentration + long_name = tracer index for ice number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntrnc] + standard_name = index_for_rain_number_concentration + long_name = tracer index for rain number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntsnc] + standard_name = index_for_snow_number_concentration + long_name = tracer index for snow number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntgnc] + standard_name = index_for_graupel_number_concentration + long_name = tracer index for graupel number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntwa] + standard_name = index_for_water_friendly_aerosols + long_name = tracer index for water friendly aerosol + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntia] + standard_name = index_for_ice_friendly_aerosols + long_name = tracer index for ice friendly aerosol + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntgl] + standard_name = index_for_graupel + long_name = tracer index for graupel + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntoz] + standard_name = index_for_ozone + long_name = tracer index for ozone mixing ratio + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntke] + standard_name = index_for_turbulent_kinetic_energy + long_name = tracer index for turbulent kinetic energy + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntkev] + standard_name = index_for_turbulent_kinetic_energy_vertical_diffusion_tracer + long_name = index for turbulent kinetic energy in the vertically diffused tracer array + units = index + dimensions = () + type = integer + intent = in + optional = F +[imp_physics] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_gfdl] + standard_name = flag_for_gfdl_microphysics_scheme + long_name = choice of GFDL microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_thompson] + standard_name = flag_for_thompson_microphysics_scheme + long_name = choice of Thompson microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_wsm6] + standard_name = flag_for_wsm6_microphysics_scheme + long_name = choice of WSM6 microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_zhao_carr] + standard_name = flag_for_zhao_carr_microphysics_scheme + long_name = choice of Zhao-Carr microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_mg] + standard_name = flag_for_morrison_gettelman_microphysics_scheme + long_name = choice of Morrison-Gettelman microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[ltaerosol] + standard_name = flag_for_aerosol_physics + long_name = flag for aerosol physics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[cplflx] + standard_name = flag_for_flux_coupling + long_name = flag controlling cplflx collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[cplchm] + standard_name = flag_for_chemistry_coupling + long_name = flag controlling cplchm collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lssav] + standard_name = flag_diagnostics + long_name = logical flag for storing diagnostics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for 3d diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lsidea] + standard_name = flag_idealized_physics + long_name = flag for idealized physics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[hybedmf] + standard_name = flag_for_hedmf + long_name = flag for hybrid edmf pbl scheme (moninedmf) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_shoc] + standard_name = flag_for_shoc + long_name = flag for SHOC + units = flag + dimensions = () + type = logical + intent = in + optional = F +[satmedmf] + standard_name = flag_for_scale_aware_TKE_moist_EDMF_PBL + long_name = flag for scale-aware TKE moist EDMF PBL scheme + units = flag + dimensions = () + type = logical + intent = in + optional = F +[shinhong] + standard_name = flag_for_scale_aware_Shinhong_PBL + long_name = flag for scale-aware Shinhong PBL scheme + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_ysu] + standard_name = flag_for_ysu + long_name = flag for YSU PBL scheme + units = flag + dimensions = () + type = logical + intent = in + optional = F +[dvdftra] + standard_name = tendency_of_vertically_diffused_tracer_concentration + long_name = updated tendency of the tracers due to vertical diffusion in PBL scheme + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_vertical_diffusion_tracers) + type = real + kind = kind_phys + intent = in + optional = F +[dusfc1] + standard_name = instantaneous_surface_x_momentum_flux + long_name = surface momentum flux in the x-direction valid for current call + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dvsfc1] + standard_name = instantaneous_surface_y_momentum_flux + long_name = surface momentum flux in the y-direction valid for current call + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dtsfc1] + standard_name = instantaneous_surface_upward_sensible_heat_flux + long_name = surface upward sensible heat flux valid for current call + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dqsfc1] + standard_name = instantaneous_surface_upward_latent_heat_flux + long_name = surface upward latent heat flux valid for current call + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dtf] + standard_name = time_step_for_dynamics + long_name = dynamics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dudt] + standard_name = tendency_of_x_wind_due_to_model_physics + long_name = updated tendency of the x wind + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dvdt] + standard_name = tendency_of_y_wind_due_to_model_physics + long_name = updated tendency of the y wind + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dtdt] + standard_name = tendency_of_air_temperature_due_to_model_physics + long_name = updated tendency of the temperature + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[htrsw] + standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep + long_name = total sky sw heating rate + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[htrlw] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep + long_name = total sky lw heating rate + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[xmu] + standard_name = zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes + long_name = zenith angle temporal adjustment factor for shortwave + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dqdt] + standard_name = tendency_of_tracers_due_to_model_physics + long_name = updated tendency of the tracers due to model physics + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = inout + optional = F +[dusfc_cpl] + standard_name = cumulative_surface_x_momentum_flux_for_coupling_multiplied_by_timestep + long_name = cumulative sfc u momentum flux multiplied by timestep + units = Pa s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dvsfc_cpl] + standard_name = cumulative_surface_y_momentum_flux_for_coupling_multiplied_by_timestep + long_name = cumulative sfc v momentum flux multiplied by timestep + units = Pa s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dtsfc_cpl] + standard_name = cumulative_surface_upward_sensible_heat_flux_for_coupling_multiplied_by_timestep + long_name = cumulative sfc sensible heat flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dqsfc_cpl] + standard_name = cumulative_surface_upward_latent_heat_flux_for_coupling_multiplied_by_timestep + long_name = cumulative sfc latent heat flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dusfci_cpl] + standard_name = instantaneous_surface_x_momentum_flux_for_coupling + long_name = instantaneous sfc u momentum flux + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dvsfci_cpl] + standard_name = instantaneous_surface_y_momentum_flux_for_coupling + long_name = instantaneous sfc v momentum flux + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dtsfci_cpl] + standard_name = instantaneous_surface_upward_sensible_heat_flux_for_coupling + long_name = instantaneous sfc sensible heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dqsfci_cpl] + standard_name = instantaneous_surface_upward_latent_heat_flux_for_coupling + long_name = instantaneous sfc latent heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dusfc_diag] + standard_name = cumulative_surface_x_momentum_flux_for_diag_multiplied_by_timestep + long_name = cumulative sfc x momentum flux multiplied by timestep + units = Pa s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dvsfc_diag] + standard_name = cumulative_surface_y_momentum_flux_for_diag_multiplied_by_timestep + long_name = cumulative sfc y momentum flux multiplied by timestep + units = Pa s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dtsfc_diag] + standard_name = cumulative_surface_upward_sensible_heat_flux_for_diag_multiplied_by_timestep + long_name = cumulative sfc sensible heat flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dqsfc_diag] + standard_name = cumulative_surface_upward_latent_heat_flux_for_diag_multiplied_by_timestep + long_name = cumulative sfc latent heat flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dusfci_diag] + standard_name = instantaneous_surface_x_momentum_flux_for_diag + long_name = instantaneous sfc x momentum flux multiplied by timestep + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dvsfci_diag] + standard_name = instantaneous_surface_y_momentum_flux_for_diag + long_name = instantaneous sfc y momentum flux multiplied by timestep + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dtsfci_diag] + standard_name = instantaneous_surface_upward_sensible_heat_flux_for_diag + long_name = instantaneous sfc sensible heat flux multiplied by timestep + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dqsfci_diag] + standard_name = instantaneous_surface_upward_latent_heat_flux_for_diag + long_name = instantaneous sfc latent heat flux multiplied by timestep + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dt3dt] + standard_name = cumulative_change_in_temperature_due_to_PBL + long_name = cumulative change in temperature due to PBL + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[du3dt_PBL] + standard_name = cumulative_change_in_x_wind_due_to_PBL + long_name = cumulative change in x wind due to PBL + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[du3dt_OGWD] + standard_name = cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag + long_name = cumulative change in x wind due to orographic gravity wave drag + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dv3dt_PBL] + standard_name = cumulative_change_in_y_wind_due_to_PBL + long_name = cumulative change in y wind due to PBL + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dv3dt_OGWD] + standard_name = cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag + long_name = cumulative change in y wind due to orographic gravity wave drag + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dq3dt] + standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_PBL + long_name = cumulative change in water vapor specific humidity due to PBL + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dq3dt_ozone] + standard_name = cumulative_change_in_ozone_mixing_ratio_due_to_PBL + long_name = cumulative change in ozone mixing ratio due to PBL + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[fvirt] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[t1] + standard_name = air_temperature_at_lowest_model_layer_for_diag + long_name = layer 1 temperature for diag + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q1] + standard_name = water_vapor_specific_humidity_at_lowest_model_layer_for_diag + long_name = layer 1 specific humidity for diag + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[hflx] + standard_name = kinematic_surface_upward_sensible_heat_flux + long_name = kinematic surface upward sensible heat flux + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ushfsfci] + standard_name = instantaneous_surface_upward_sensible_heat_flux_for_chemistry_coupling + long_name = instantaneous upward sensible heat flux for chemistry coupling + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[oceanfrac] + standard_name = sea_area_fraction + long_name = fraction of horizontal grid area occupied by ocean + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fice] + standard_name = sea_ice_concentration + long_name = ice fraction over open water + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dusfc_cice] + standard_name = surface_x_momentum_flux_for_coupling_interstitial + long_name = sfc x momentum flux for coupling interstitial + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dvsfc_cice] + standard_name = surface_y_momentum_flux_for_coupling_interstitial + long_name = sfc y momentum flux for coupling interstitial + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dtsfc_cice] + standard_name = surface_upward_sensible_heat_flux_for_coupling_interstitial + long_name = sfc sensible heat flux for coupling interstitial + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dqsfc_cice] + standard_name = surface_upward_latent_heat_flux_for_coupling_interstitial + long_name = sfc latent heat flux for coupling interstitial + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dry] + standard_name = flag_nonzero_land_surface_fraction + long_name = flag indicating presence of some land surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[icy] + standard_name = flag_nonzero_sea_ice_surface_fraction + long_name = flag indicating presence of some sea ice surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[wind] + standard_name = wind_speed_at_lowest_model_layer + long_name = wind speed at lowest model level + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[stress_ocn] + standard_name = surface_wind_stress_over_ocean + long_name = surface wind stress over ocean + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[hflx_ocn] + standard_name = kinematic_surface_upward_sensible_heat_flux_over_ocean + long_name = kinematic surface upward sensible heat flux over ocean + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[evap_ocn] + standard_name = kinematic_surface_upward_latent_heat_flux_over_ocean + long_name = kinematic surface upward latent heat flux over ocean + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ugrs1] + standard_name = x_wind_at_lowest_model_layer + long_name = zonal wind at lowest model layer + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[vgrs1] + standard_name = y_wind_at_lowest_model_layer + long_name = meridional wind at lowest model layer + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dkt_cpl] + standard_name = instantaneous_atmosphere_heat_diffusivity + long_name = instantaneous atmospheric heat diffusivity + units = m2 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dkt] + standard_name = atmosphere_heat_diffusivity + long_name = diffusivity for heat + units = m2 s-1 + dimensions = (horizontal_dimension,vertical_dimension_minus_one) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 index 5cb2fc798..a845abb48 100644 --- a/physics/GFS_SCNV_generic.F90 +++ b/physics/GFS_SCNV_generic.F90 @@ -12,18 +12,7 @@ subroutine GFS_SCNV_generic_pre_finalize() end subroutine GFS_SCNV_generic_pre_finalize !> \section arg_table_GFS_SCNV_generic_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | -!! | lgocart | flag_gocart | flag for 3d diagnostic fields for gocart 1 | flag | 0 | logical | | in | F | -!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | in | F | -!! | gq0_water_vapor | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | save_t | air_temperature_save | air temperature before entering a physics scheme | K | 2 | real | kind_phys | inout | F | -!! | save_qv | water_vapor_specific_humidity_save | water vapor specific humidity before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_SCNV_generic_pre_run.html !! subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, lgocart, gt0, gq0_water_vapor, & save_t, save_qv, errmsg, errflg) @@ -76,25 +65,7 @@ subroutine GFS_SCNV_generic_post_finalize () end subroutine GFS_SCNV_generic_post_finalize !> \section arg_table_GFS_SCNV_generic_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------|---------------|------|-------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | nn | number_of_tracers_for_convective_transport | number of tracers for convective transport | count | 0 | integer | | in | F | -!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | -!! | lgocart | flag_gocart | flag for 3d diagnostic fields for gocart 1 | flag | 0 | logical | | in | F | -!! | frain | dynamics_to_physics_timestep_ratio | ratio of dynamics timestep to physics timestep | none | 0 | real | kind_phys | in | F | -!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | in | F | -!! | gq0_water_vapor | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | save_t | air_temperature_save | air temperature before entering a physics scheme | K | 2 | real | kind_phys | in | F | -!! | save_qv | water_vapor_specific_humidity_save | water vapor specific humidity before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | in | F | -!! | dqdti | instantaneous_water_vapor_specific_humidity_tendency_due_to_convection | instantaneous moisture tendency due to convection | kg kg-1 s-1 | 2 | real | kind_phys | inout | F | -!! | dt3dt | cumulative_change_in_temperature_due_to_shal_convection | cumulative change in temperature due to shal conv. | K | 2 | real | kind_phys | inout | F | -!! | dq3dt | cumulative_change_in_water_vapor_specific_humidity_due_to_shal_convection | cumulative change in water vapor specific humidity due to shal conv. | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_SCNV_generic_post_run.html !! subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, lgocart, frain, gt0, gq0_water_vapor, & save_t, save_qv, dqdti, dt3dt, dq3dt, clw, errmsg, errflg) diff --git a/physics/GFS_SCNV_generic.meta b/physics/GFS_SCNV_generic.meta new file mode 100644 index 000000000..11b9b71a2 --- /dev/null +++ b/physics/GFS_SCNV_generic.meta @@ -0,0 +1,239 @@ +[ccpp-arg-table] + name = GFS_SCNV_generic_pre_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for 3d diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lgocart] + standard_name = flag_gocart + long_name = flag for 3d diagnostic fields for gocart 1 + units = flag + dimensions = () + type = logical + intent = in + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0_water_vapor] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[save_t] + standard_name = air_temperature_save + long_name = air temperature before entering a physics scheme + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[save_qv] + standard_name = water_vapor_specific_humidity_save + long_name = water vapor specific humidity before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_SCNV_generic_post_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[nn] + standard_name = number_of_tracers_for_convective_transport + long_name = number of tracers for convective transport + units = count + dimensions = () + type = integer + intent = in + optional = F +[lssav] + standard_name = flag_diagnostics + long_name = logical flag for storing diagnostics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for 3d diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lgocart] + standard_name = flag_gocart + long_name = flag for 3d diagnostic fields for gocart 1 + units = flag + dimensions = () + type = logical + intent = in + optional = F +[frain] + standard_name = dynamics_to_physics_timestep_ratio + long_name = ratio of dynamics timestep to physics timestep + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0_water_vapor] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[save_t] + standard_name = air_temperature_save + long_name = air temperature before entering a physics scheme + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[save_qv] + standard_name = water_vapor_specific_humidity_save + long_name = water vapor specific humidity before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dqdti] + standard_name = instantaneous_water_vapor_specific_humidity_tendency_due_to_convection + long_name = instantaneous moisture tendency due to convection + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dt3dt] + standard_name = cumulative_change_in_temperature_due_to_shal_convection + long_name = cumulative change in temperature due to shal conv. + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dq3dt] + standard_name = cumulative_change_in_water_vapor_specific_humidity_due_to_shal_convection + long_name = cumulative change in water vapor specific humidity due to shal conv. + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[clw] + standard_name = convective_transportable_tracers + long_name = array to contain cloud water and other convective trans. tracers + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers_for_convective_transport) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 index c0bfef12b..10b714d7e 100644 --- a/physics/GFS_debug.F90 +++ b/physics/GFS_debug.F90 @@ -41,23 +41,7 @@ subroutine GFS_diagtoscreen_finalize () end subroutine GFS_diagtoscreen_finalize !> \section arg_table_GFS_diagtoscreen_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | instance of derived type GFS_control_type in FV3 | DDT | 0 | GFS_control_type | | in | F | -!! | Statein | GFS_statein_type_instance | instance of derived type GFS_statein_type in FV3 | DDT | 0 | GFS_statein_type | | in | F | -!! | Stateout | GFS_stateout_type_instance | instance of derived type GFS_stateout_type | DDT | 0 | GFS_stateout_type | | in | F | -!! | Sfcprop | GFS_sfcprop_type_instance | instance of type GFS_sfcprop_type in FV3 | DDT | 0 | GFS_sfcprop_type | | in | F | -!! | Coupling | GFS_coupling_type_instance | instance of type GFS_coupling_type in FV3 | DDT | 0 | GFS_coupling_type | | in | F | -!! | Grid | GFS_grid_type_instance | instance of type GFS_grid_type in FV3 | DDT | 0 | GFS_grid_type | | in | F | -!! | Tbd | GFS_tbd_type_instance | instance of type GFS_tbd_type in FV3 | DDT | 0 | GFS_tbd_type | | in | F | -!! | Cldprop | GFS_cldprop_type_instance | instance of type GFS_cldprop_type in FV3 | DDT | 0 | GFS_cldprop_type | | in | F | -!! | Radtend | GFS_radtend_type_instance | instance of type GFS_radtend_type in FV3 | DDT | 0 | GFS_radtend_type | | in | F | -!! | Diag | GFS_diag_type_instance | instance of type GFS_diag_type in FV3 | DDT | 0 | GFS_diag_type | | in | F | -!! | Interstitial | GFS_interstitial_type_instance | instance of type GFS_interstitial_type in FV3 | DDT | 0 | GFS_interstitial_type | | in | F | -!! | nthreads | omp_threads | number of OpenMP threads or fast physics schemes | count | 0 | integer | | in | F | -!! | blkno | ccpp_block_number | number of block for explicit data blocking in CCPP | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_diagtoscreen_run.html !! subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, & Grid, Tbd, Cldprop, Radtend, Diag, Interstitial, & @@ -772,23 +756,7 @@ subroutine GFS_interstitialtoscreen_finalize () end subroutine GFS_interstitialtoscreen_finalize !> \section arg_table_GFS_interstitialtoscreen_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | instance of derived type GFS_control_type | DDT | 0 | GFS_control_type | | in | F | -!! | Statein | GFS_statein_type_instance | instance of derived type GFS_statein_type | DDT | 0 | GFS_statein_type | | in | F | -!! | Stateout | GFS_stateout_type_instance | instance of derived type GFS_stateout_type | DDT | 0 | GFS_stateout_type | | in | F | -!! | Sfcprop | GFS_sfcprop_type_instance | instance of derived type GFS_sfcprop_type | DDT | 0 | GFS_sfcprop_type | | in | F | -!! | Coupling | GFS_coupling_type_instance | instance of derived type GFS_coupling_type | DDT | 0 | GFS_coupling_type | | in | F | -!! | Grid | GFS_grid_type_instance | instance of derived type GFS_grid_type | DDT | 0 | GFS_grid_type | | in | F | -!! | Tbd | GFS_tbd_type_instance | instance of derived type GFS_tbd_type | DDT | 0 | GFS_tbd_type | | in | F | -!! | Cldprop | GFS_cldprop_type_instance | instance of derived type GFS_cldprop_type | DDT | 0 | GFS_cldprop_type | | in | F | -!! | Radtend | GFS_radtend_type_instance | instance of derived type GFS_radtend_type | DDT | 0 | GFS_radtend_type | | in | F | -!! | Diag | GFS_diag_type_instance | instance of derived type GFS_diag_type | DDT | 0 | GFS_diag_type | | in | F | -!! | Interstitial | GFS_interstitial_type_instance | instance of derived type GFS_interstitial_type | DDT | 0 | GFS_interstitial_type | | in | F | -!! | nthreads | omp_threads | number of OpenMP threads or fast physics schemes | count | 0 | integer | | in | F | -!! | blkno | ccpp_block_number | number of block for explicit data blocking in CCPP | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_interstitialtoscreen_run.html !! subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, & Grid, Tbd, Cldprop, Radtend, Diag, Interstitial, & @@ -900,12 +868,7 @@ subroutine GFS_abort_finalize () end subroutine GFS_abort_finalize !> \section arg_table_GFS_abort_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | instance of derived type GFS_control_type | DDT | 0 | GFS_control_type | | in | F | -!! | blkno | ccpp_block_number | number of block for explicit data blocking in CCPP | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_abort_run.html !! subroutine GFS_abort_run (Model, blkno, errmsg, errflg) diff --git a/physics/GFS_debug.meta b/physics/GFS_debug.meta new file mode 100644 index 000000000..c584f4a92 --- /dev/null +++ b/physics/GFS_debug.meta @@ -0,0 +1,288 @@ +[ccpp-arg-table] + name = GFS_diagtoscreen_run + type = scheme +[Model] + standard_name = GFS_control_type_instance + long_name = instance of derived type GFS_control_type in FV3 + units = DDT + dimensions = () + type = GFS_control_type + intent = in + optional = F +[Statein] + standard_name = GFS_statein_type_instance + long_name = instance of derived type GFS_statein_type in FV3 + units = DDT + dimensions = () + type = GFS_statein_type + intent = in + optional = F +[Stateout] + standard_name = GFS_stateout_type_instance + long_name = instance of derived type GFS_stateout_type + units = DDT + dimensions = () + type = GFS_stateout_type + intent = in + optional = F +[Sfcprop] + standard_name = GFS_sfcprop_type_instance + long_name = instance of type GFS_sfcprop_type in FV3 + units = DDT + dimensions = () + type = GFS_sfcprop_type + intent = in + optional = F +[Coupling] + standard_name = GFS_coupling_type_instance + long_name = instance of type GFS_coupling_type in FV3 + units = DDT + dimensions = () + type = GFS_coupling_type + intent = in + optional = F +[Grid] + standard_name = GFS_grid_type_instance + long_name = instance of type GFS_grid_type in FV3 + units = DDT + dimensions = () + type = GFS_grid_type + intent = in + optional = F +[Tbd] + standard_name = GFS_tbd_type_instance + long_name = instance of type GFS_tbd_type in FV3 + units = DDT + dimensions = () + type = GFS_tbd_type + intent = in + optional = F +[Cldprop] + standard_name = GFS_cldprop_type_instance + long_name = instance of type GFS_cldprop_type in FV3 + units = DDT + dimensions = () + type = GFS_cldprop_type + intent = in + optional = F +[Radtend] + standard_name = GFS_radtend_type_instance + long_name = instance of type GFS_radtend_type in FV3 + units = DDT + dimensions = () + type = GFS_radtend_type + intent = in + optional = F +[Diag] + standard_name = GFS_diag_type_instance + long_name = instance of type GFS_diag_type in FV3 + units = DDT + dimensions = () + type = GFS_diag_type + intent = in + optional = F +[Interstitial] + standard_name = GFS_interstitial_type_instance + long_name = instance of type GFS_interstitial_type in FV3 + units = DDT + dimensions = () + type = GFS_interstitial_type + intent = in + optional = F +[nthreads] + standard_name = omp_threads + long_name = number of OpenMP threads or fast physics schemes + units = count + dimensions = () + type = integer + intent = in + optional = F +[blkno] + standard_name = ccpp_block_number + long_name = number of block for explicit data blocking in CCPP + units = index + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_interstitialtoscreen_run + type = scheme +[Model] + standard_name = GFS_control_type_instance + long_name = instance of derived type GFS_control_type + units = DDT + dimensions = () + type = GFS_control_type + intent = in + optional = F +[Statein] + standard_name = GFS_statein_type_instance + long_name = instance of derived type GFS_statein_type + units = DDT + dimensions = () + type = GFS_statein_type + intent = in + optional = F +[Stateout] + standard_name = GFS_stateout_type_instance + long_name = instance of derived type GFS_stateout_type + units = DDT + dimensions = () + type = GFS_stateout_type + intent = in + optional = F +[Sfcprop] + standard_name = GFS_sfcprop_type_instance + long_name = instance of derived type GFS_sfcprop_type + units = DDT + dimensions = () + type = GFS_sfcprop_type + intent = in + optional = F +[Coupling] + standard_name = GFS_coupling_type_instance + long_name = instance of derived type GFS_coupling_type + units = DDT + dimensions = () + type = GFS_coupling_type + intent = in + optional = F +[Grid] + standard_name = GFS_grid_type_instance + long_name = instance of derived type GFS_grid_type + units = DDT + dimensions = () + type = GFS_grid_type + intent = in + optional = F +[Tbd] + standard_name = GFS_tbd_type_instance + long_name = instance of derived type GFS_tbd_type + units = DDT + dimensions = () + type = GFS_tbd_type + intent = in + optional = F +[Cldprop] + standard_name = GFS_cldprop_type_instance + long_name = instance of derived type GFS_cldprop_type + units = DDT + dimensions = () + type = GFS_cldprop_type + intent = in + optional = F +[Radtend] + standard_name = GFS_radtend_type_instance + long_name = instance of derived type GFS_radtend_type + units = DDT + dimensions = () + type = GFS_radtend_type + intent = in + optional = F +[Diag] + standard_name = GFS_diag_type_instance + long_name = instance of derived type GFS_diag_type + units = DDT + dimensions = () + type = GFS_diag_type + intent = in + optional = F +[Interstitial] + standard_name = GFS_interstitial_type_instance + long_name = instance of derived type GFS_interstitial_type + units = DDT + dimensions = () + type = GFS_interstitial_type + intent = in + optional = F +[nthreads] + standard_name = omp_threads + long_name = number of OpenMP threads or fast physics schemes + units = count + dimensions = () + type = integer + intent = in + optional = F +[blkno] + standard_name = ccpp_block_number + long_name = number of block for explicit data blocking in CCPP + units = index + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_abort_run + type = scheme +[Model] + standard_name = GFS_control_type_instance + long_name = instance of derived type GFS_control_type + units = DDT + dimensions = () + type = GFS_control_type + intent = in + optional = F +[blkno] + standard_name = ccpp_block_number + long_name = number of block for explicit data blocking in CCPP + units = index + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index f66a43675..a497e71e4 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -34,14 +34,7 @@ module GFS_phys_time_vary contains !> \section arg_table_GFS_phys_time_vary_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | Data | GFS_data_type_instance_all_blocks | Fortran DDT containing FV3-GFS data | DDT | 1 | GFS_data_type | | inout | F | -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | -!! | Interstitial | GFS_interstitial_type_instance_all_threads | Fortran DDT containing FV3-GFS interstitial data | DDT | 1 | GFS_interstitial_type | | inout | F | -!! | nthrds | omp_threads | number of OpenMP threads available for physics schemes | count | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_phys_time_vary_init.html !! !>\section gen_GFS_phys_time_vary_init GFS_phys_time_vary_init General Algorithm !! @{ @@ -278,10 +271,7 @@ end subroutine GFS_phys_time_vary_init !> \section arg_table_GFS_phys_time_vary_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_phys_time_vary_finalize.html !! subroutine GFS_phys_time_vary_finalize(errmsg, errflg) @@ -324,13 +314,7 @@ end subroutine GFS_phys_time_vary_finalize !> \section arg_table_GFS_phys_time_vary_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | Data | GFS_data_type_instance_all_blocks | Fortran DDT containing FV3-GFS data | DDT | 1 | GFS_data_type | | inout | F | -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | -!! | nthrds | omp_threads | number of OpenMP threads available for physics schemes | count | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_phys_time_vary_run.html !! !>\section gen_GFS_phys_time_vary_run GFS_phys_time_vary_run General Algorithm !> @{ diff --git a/physics/GFS_phys_time_vary.fv3.meta b/physics/GFS_phys_time_vary.fv3.meta new file mode 100644 index 000000000..135bfe398 --- /dev/null +++ b/physics/GFS_phys_time_vary.fv3.meta @@ -0,0 +1,120 @@ +[ccpp-arg-table] + name = GFS_phys_time_vary_init + type = scheme +[Data] + standard_name = GFS_data_type_instance_all_blocks + long_name = Fortran DDT containing FV3-GFS data + units = DDT + dimensions = (ccpp_block_number) + type = GFS_data_type + intent = inout + optional = F +[Model] + standard_name = GFS_control_type_instance + long_name = Fortran DDT containing FV3-GFS model control parameters + units = DDT + dimensions = () + type = GFS_control_type + intent = inout + optional = F +[Interstitial] + standard_name = GFS_interstitial_type_instance_all_threads + long_name = Fortran DDT containing FV3-GFS interstitial data + units = DDT + dimensions = (ccpp_thread_number) + type = GFS_interstitial_type + intent = inout + optional = F +[nthrds] + standard_name = omp_threads + long_name = number of OpenMP threads available for physics schemes + units = count + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_phys_time_vary_finalize + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_phys_time_vary_run + type = scheme +[Data] + standard_name = GFS_data_type_instance_all_blocks + long_name = Fortran DDT containing FV3-GFS data + units = DDT + dimensions = (ccpp_block_number) + type = GFS_data_type + intent = inout + optional = F +[Model] + standard_name = GFS_control_type_instance + long_name = Fortran DDT containing FV3-GFS model control parameters + units = DDT + dimensions = () + type = GFS_control_type + intent = inout + optional = F +[nthrds] + standard_name = omp_threads + long_name = number of OpenMP threads available for physics schemes + units = count + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/GFS_phys_time_vary.scm.F90 b/physics/GFS_phys_time_vary.scm.F90 index a69df6c79..6905b9277 100644 --- a/physics/GFS_phys_time_vary.scm.F90 +++ b/physics/GFS_phys_time_vary.scm.F90 @@ -26,14 +26,7 @@ module GFS_phys_time_vary contains !> \section arg_table_GFS_phys_time_vary_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | Grid | GFS_grid_type_instance | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_grid_type | | inout | F | -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F | -!! | Interstitial | GFS_interstitial_type_instance | Fortran DDT containing FV3-GFS interstitial data | DDT | 0 | GFS_interstitial_type | | inout | F | -!! | Tbd | GFS_tbd_type_instance | Fortran DDT containing FV3-GFS miscellaneous data | DDT | 0 | GFS_tbd_type | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_phys_time_vary_init.html !! subroutine GFS_phys_time_vary_init (Grid, Model, Interstitial, Tbd, errmsg, errflg) @@ -184,10 +177,7 @@ subroutine GFS_phys_time_vary_init (Grid, Model, Interstitial, Tbd, errmsg, errf end subroutine GFS_phys_time_vary_init !> \section arg_table_GFS_phys_time_vary_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_phys_time_vary_finalize.html !! subroutine GFS_phys_time_vary_finalize(errmsg, errflg) implicit none @@ -228,17 +218,7 @@ subroutine GFS_phys_time_vary_finalize(errmsg, errflg) end subroutine GFS_phys_time_vary_finalize !> \section arg_table_GFS_phys_time_vary_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|---------------|------|-------------------------------|-----------|--------|----------| -!! | Grid | GFS_grid_type_instance | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_grid_type | | in | F | -!! | Statein | GFS_statein_type_instance | instance of derived type GFS_statein_type | DDT | 0 | GFS_statein_type | | in | F | -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | -!! | Tbd | GFS_tbd_type_instance | Fortran DDT containing FV3-GFS miscellaneous data | DDT | 0 | GFS_tbd_type | | inout | F | -!! | Sfcprop | GFS_sfcprop_type_instance | Fortran DDT containing FV3-GFS surface fields | DDT | 0 | GFS_sfcprop_type | | inout | F | -!! | Cldprop | GFS_cldprop_type_instance | Fortran DDT containing FV3-GFS cloud fields | DDT | 0 | GFS_cldprop_type | | inout | F | -!! | Diag | GFS_diag_type_instance | Fortran DDT containing FV3-GFS fields targeted for diagnostic output | DDT | 0 | GFS_diag_type | | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_phys_time_vary_run.html !! subroutine GFS_phys_time_vary_run (Grid, Statein, Model, Tbd, Sfcprop, Cldprop, Diag, errmsg, errflg) diff --git a/physics/GFS_phys_time_vary.scm.meta b/physics/GFS_phys_time_vary.scm.meta new file mode 100644 index 000000000..4fc643d29 --- /dev/null +++ b/physics/GFS_phys_time_vary.scm.meta @@ -0,0 +1,152 @@ +[ccpp-arg-table] + name = GFS_phys_time_vary_init + type = scheme +[Grid] + standard_name = GFS_grid_type_instance + long_name = Fortran DDT containing FV3-GFS grid and interpolation related data + units = DDT + dimensions = () + type = GFS_grid_type + intent = inout + optional = F +[Model] + standard_name = GFS_control_type_instance + long_name = Fortran DDT containing FV3-GFS model control parameters + units = DDT + dimensions = () + type = GFS_control_type + intent = in + optional = F +[Interstitial] + standard_name = GFS_interstitial_type_instance + long_name = Fortran DDT containing FV3-GFS interstitial data + units = DDT + dimensions = () + type = GFS_interstitial_type + intent = inout + optional = F +[Tbd] + standard_name = GFS_tbd_type_instance + long_name = Fortran DDT containing FV3-GFS miscellaneous data + units = DDT + dimensions = () + type = GFS_tbd_type + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_phys_time_vary_finalize + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_phys_time_vary_run + type = scheme +[Grid] + standard_name = GFS_grid_type_instance + long_name = Fortran DDT containing FV3-GFS grid and interpolation related data + units = DDT + dimensions = () + type = GFS_grid_type + intent = in + optional = F +[Statein] + standard_name = GFS_statein_type_instance + long_name = instance of derived type GFS_statein_type + units = DDT + dimensions = () + type = GFS_statein_type + intent = in + optional = F +[Model] + standard_name = GFS_control_type_instance + long_name = Fortran DDT containing FV3-GFS model control parameters + units = DDT + dimensions = () + type = GFS_control_type + intent = inout + optional = F +[Tbd] + standard_name = GFS_tbd_type_instance + long_name = Fortran DDT containing FV3-GFS miscellaneous data + units = DDT + dimensions = () + type = GFS_tbd_type + intent = inout + optional = F +[Sfcprop] + standard_name = GFS_sfcprop_type_instance + long_name = Fortran DDT containing FV3-GFS surface fields + units = DDT + dimensions = () + type = GFS_sfcprop_type + intent = inout + optional = F +[Cldprop] + standard_name = GFS_cldprop_type_instance + long_name = Fortran DDT containing FV3-GFS cloud fields + units = DDT + dimensions = () + type = GFS_cldprop_type + intent = inout + optional = F +[Diag] + standard_name = GFS_diag_type_instance + long_name = Fortran DDT containing FV3-GFS fields targeted for diagnostic output + units = DDT + dimensions = () + type = GFS_diag_type + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/GFS_rad_time_vary.fv3.F90 b/physics/GFS_rad_time_vary.fv3.F90 index 22be34b51..9a4583dc4 100644 --- a/physics/GFS_rad_time_vary.fv3.F90 +++ b/physics/GFS_rad_time_vary.fv3.F90 @@ -18,13 +18,7 @@ end subroutine GFS_rad_time_vary_init !>\defgroup mod_GFS_rad_time_vary GFS Radiation Time Update !> @{ !> \section arg_table_GFS_rad_time_vary_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-------------------|--------------------------------------------------------|-------------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | -!! | Data | GFS_data_type_instance_all_blocks | Fortran DDT containing FV3-GFS data | DDT | 1 | GFS_data_type | | inout | F | -!! | nthrds | omp_threads | number of OpenMP threads available for physics schemes | count | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_rad_time_vary_run.html !! subroutine GFS_rad_time_vary_run (Model, Data, nthrds, errmsg, errflg) diff --git a/physics/GFS_rad_time_vary.fv3.meta b/physics/GFS_rad_time_vary.fv3.meta new file mode 100644 index 000000000..c86c81f18 --- /dev/null +++ b/physics/GFS_rad_time_vary.fv3.meta @@ -0,0 +1,54 @@ +[ccpp-arg-table] + name = GFS_rad_time_vary_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = GFS_rad_time_vary_run + type = scheme +[Model] + standard_name = GFS_control_type_instance + long_name = Fortran DDT containing FV3-GFS model control parameters + units = DDT + dimensions = () + type = GFS_control_type + intent = inout + optional = F +[Data] + standard_name = GFS_data_type_instance_all_blocks + long_name = Fortran DDT containing FV3-GFS data + units = DDT + dimensions = (ccpp_block_number) + type = GFS_data_type + intent = inout + optional = F +[nthrds] + standard_name = omp_threads + long_name = number of OpenMP threads available for physics schemes + units = count + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_rad_time_vary_finalize + type = scheme diff --git a/physics/GFS_rad_time_vary.scm.F90 b/physics/GFS_rad_time_vary.scm.F90 index 4ea13a416..13ae5e14b 100644 --- a/physics/GFS_rad_time_vary.scm.F90 +++ b/physics/GFS_rad_time_vary.scm.F90 @@ -19,13 +19,7 @@ subroutine GFS_rad_time_vary_init end subroutine GFS_rad_time_vary_init !> \section arg_table_GFS_rad_time_vary_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-------------------|--------------------------------------------------------|-------------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | -!! | Statein | GFS_statein_type_instance | Fortran DDT containing FV3-GFS prognostic state data in from dycore | DDT | 0 | GFS_statein_type | | in | F | -!! | Tbd | GFS_tbd_type_instance | Fortran DDT containing FV3-GFS data not yet assigned to a defined container | DDT | 0 | GFS_tbd_type | | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_rad_time_vary_run.html !! subroutine GFS_rad_time_vary_run (Model, Statein, Tbd, errmsg, errflg) diff --git a/physics/GFS_rad_time_vary.scm.meta b/physics/GFS_rad_time_vary.scm.meta new file mode 100644 index 000000000..7e87f1f8a --- /dev/null +++ b/physics/GFS_rad_time_vary.scm.meta @@ -0,0 +1,54 @@ +[ccpp-arg-table] + name = GFS_rad_time_vary_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = GFS_rad_time_vary_run + type = scheme +[Model] + standard_name = GFS_control_type_instance + long_name = Fortran DDT containing FV3-GFS model control parameters + units = DDT + dimensions = () + type = GFS_control_type + intent = inout + optional = F +[Statein] + standard_name = GFS_statein_type_instance + long_name = Fortran DDT containing FV3-GFS prognostic state data in from dycore + units = DDT + dimensions = () + type = GFS_statein_type + intent = in + optional = F +[Tbd] + standard_name = GFS_tbd_type_instance + long_name = Fortran DDT containing FV3-GFS data not yet assigned to a defined container + units = DDT + dimensions = () + type = GFS_tbd_type + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_rad_time_vary_finalize + type = scheme diff --git a/physics/GFS_rrtmg_post.F90 b/physics/GFS_rrtmg_post.F90 index 8cb9cd131..14f148aa4 100644 --- a/physics/GFS_rrtmg_post.F90 +++ b/physics/GFS_rrtmg_post.F90 @@ -11,31 +11,7 @@ subroutine GFS_rrtmg_post_init () end subroutine GFS_rrtmg_post_init !> \section arg_table_GFS_rrtmg_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|---------------------------------------------------------------|-------------------------------------------------------------------------------|----------|------|-------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F | -!! | Grid | GFS_grid_type_instance | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_grid_type | | in | F | -!! | Diag | GFS_diag_type_instance | Fortran DDT containing FV3-GFS diagnotics data | DDT | 0 | GFS_diag_type | | inout | F | -!! | Radtend | GFS_radtend_type_instance | Fortran DDT containing FV3-GFS radiation tendencies | DDT | 0 | GFS_radtend_type | | in | F | -!! | Statein | GFS_statein_type_instance | Fortran DDT containing FV3-GFS prognostic state data in from dycore | DDT | 0 | GFS_statein_type | | in | F | -!! | Coupling | GFS_coupling_type_instance | Fortran DDT containing FV3-GFS fields to/from coupling with other components | DDT | 0 | GFS_coupling_type | | inout | F | -!! | scmpsw | components_of_surface_downward_shortwave_fluxes | derived type for special components of surface downward shortwave fluxes | W m-2 | 1 | cmpfsw_type | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | lm | number_of_vertical_layers_for_radiation_calculations | number of vertical layers for radiation calculation | count | 0 | integer | | in | F | -!! | ltp | extra_top_layer | extra top layers | none | 0 | integer | | in | F | -!! | kt | vertical_index_difference_between_layer_and_upper_bound | vertical index difference between layer and upper bound | index | 0 | integer | | in | F | -!! | kb | vertical_index_difference_between_layer_and_lower_bound | vertical index difference between layer and lower bound | index | 0 | integer | | in | F | -!! | kd | vertical_index_difference_between_inout_and_local | vertical index difference between in/out and local | index | 0 | integer | | in | F | -!! | raddt | time_step_for_radiation | radiation time step | s | 0 | real | kind_phys | in | F | -!! | aerodp | atmosphere_optical_thickness_due_to_ambient_aerosol_particles | vertical integrated optical depth for various aerosol species | none | 2 | real | kind_phys | in | F | -!! | cldsa | cloud_area_fraction_for_radiation | fraction of clouds for low, middle, high, total and BL | frac | 2 | real | kind_phys | in | F | -!! | mtopa | model_layer_number_at_cloud_top | vertical indices for low, middle and high cloud tops | index | 2 | integer | | in | F | -!! | mbota | model_layer_number_at_cloud_base | vertical indices for low, middle and high cloud bases | index | 2 | integer | | in | F | -!! | clouds1 | total_cloud_fraction | layer total cloud fraction | frac | 2 | real | kind_phys | in | F | -!! | cldtaulw | cloud_optical_depth_layers_at_10mu_band | approx 10mu band layer cloud optical depth | none | 2 | real | kind_phys | in | F | -!! | cldtausw | cloud_optical_depth_layers_at_0p55mu_band | approx .55mu band layer cloud optical depth | none | 2 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_rrtmg_post_run.html !! subroutine GFS_rrtmg_post_run (Model, Grid, Diag, Radtend, Statein, & Coupling, scmpsw, im, lm, ltp, kt, kb, kd, raddt, aerodp, & diff --git a/physics/GFS_rrtmg_post.meta b/physics/GFS_rrtmg_post.meta new file mode 100644 index 000000000..fdd2c2b55 --- /dev/null +++ b/physics/GFS_rrtmg_post.meta @@ -0,0 +1,204 @@ +[ccpp-arg-table] + name = GFS_rrtmg_post_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = GFS_rrtmg_post_run + type = scheme +[Model] + standard_name = GFS_control_type_instance + long_name = Fortran DDT containing FV3-GFS model control parameters + units = DDT + dimensions = () + type = GFS_control_type + intent = in + optional = F +[Grid] + standard_name = GFS_grid_type_instance + long_name = Fortran DDT containing FV3-GFS grid and interpolation related data + units = DDT + dimensions = () + type = GFS_grid_type + intent = in + optional = F +[Diag] + standard_name = GFS_diag_type_instance + long_name = Fortran DDT containing FV3-GFS diagnotics data + units = DDT + dimensions = () + type = GFS_diag_type + intent = inout + optional = F +[Radtend] + standard_name = GFS_radtend_type_instance + long_name = Fortran DDT containing FV3-GFS radiation tendencies + units = DDT + dimensions = () + type = GFS_radtend_type + intent = in + optional = F +[Statein] + standard_name = GFS_statein_type_instance + long_name = Fortran DDT containing FV3-GFS prognostic state data in from dycore + units = DDT + dimensions = () + type = GFS_statein_type + intent = in + optional = F +[Coupling] + standard_name = GFS_coupling_type_instance + long_name = Fortran DDT containing FV3-GFS fields to/from coupling with other components + units = DDT + dimensions = () + type = GFS_coupling_type + intent = inout + optional = F +[scmpsw] + standard_name = components_of_surface_downward_shortwave_fluxes + long_name = derived type for special components of surface downward shortwave fluxes + units = W m-2 + dimensions = (horizontal_dimension) + type = cmpfsw_type + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[lm] + standard_name = number_of_vertical_layers_for_radiation_calculations + long_name = number of vertical layers for radiation calculation + units = count + dimensions = () + type = integer + intent = in + optional = F +[ltp] + standard_name = extra_top_layer + long_name = extra top layers + units = none + dimensions = () + type = integer + intent = in + optional = F +[kt] + standard_name = vertical_index_difference_between_layer_and_upper_bound + long_name = vertical index difference between layer and upper bound + units = index + dimensions = () + type = integer + intent = in + optional = F +[kb] + standard_name = vertical_index_difference_between_layer_and_lower_bound + long_name = vertical index difference between layer and lower bound + units = index + dimensions = () + type = integer + intent = in + optional = F +[kd] + standard_name = vertical_index_difference_between_inout_and_local + long_name = vertical index difference between in/out and local + units = index + dimensions = () + type = integer + intent = in + optional = F +[raddt] + standard_name = time_step_for_radiation + long_name = radiation time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[aerodp] + standard_name = atmosphere_optical_thickness_due_to_ambient_aerosol_particles + long_name = vertical integrated optical depth for various aerosol species + units = none + dimensions = (horizontal_dimension,number_of_species_for_aerosol_optical_depth) + type = real + kind = kind_phys + intent = in + optional = F +[cldsa] + standard_name = cloud_area_fraction_for_radiation + long_name = fraction of clouds for low, middle, high, total and BL + units = frac + dimensions = (horizontal_dimension,5) + type = real + kind = kind_phys + intent = in + optional = F +[mtopa] + standard_name = model_layer_number_at_cloud_top + long_name = vertical indices for low, middle and high cloud tops + units = index + dimensions = (horizontal_dimension,3) + type = integer + intent = in + optional = F +[mbota] + standard_name = model_layer_number_at_cloud_base + long_name = vertical indices for low, middle and high cloud bases + units = index + dimensions = (horizontal_dimension,3) + type = integer + intent = in + optional = F +[clouds1] + standard_name = total_cloud_fraction + long_name = layer total cloud fraction + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cldtaulw] + standard_name = cloud_optical_depth_layers_at_10mu_band + long_name = approx 10mu band layer cloud optical depth + units = none + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[cldtausw] + standard_name = cloud_optical_depth_layers_at_0p55mu_band + long_name = approx .55mu band layer cloud optical depth + units = none + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_rrtmg_post_finalize + type = scheme diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index 651e65337..f6e683bff 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -14,67 +14,7 @@ subroutine GFS_rrtmg_pre_init () end subroutine GFS_rrtmg_pre_init !> \section arg_table_GFS_rrtmg_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-------------------|---------------------------------------------------------------|-------------------------------------------------------------------------------|----------|------|------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F | -!! | Grid | GFS_grid_type_instance | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_grid_type | | in | F | -!! | Sfcprop | GFS_sfcprop_type_instance | Fortran DDT containing FV3-GFS surface fields | DDT | 0 | GFS_sfcprop_type | | in | F | -!! | Statein | GFS_statein_type_instance | Fortran DDT containing FV3-GFS prognostic state data in from dycore | DDT | 0 | GFS_statein_type | | in | F | -!! | Tbd | GFS_tbd_type_instance | Fortran DDT containing FV3-GFS data not yet assigned to a defined container | DDT | 0 | GFS_tbd_type | | in | F | -!! | Cldprop | GFS_cldprop_type_instance | Fortran DDT containing FV3-GFS cloud fields needed by radiation from physics | DDT | 0 | GFS_cldprop_type | | in | F | -!! | Coupling | GFS_coupling_type_instance | Fortran DDT containing FV3-GFS fields needed for coupling | DDT | 0 | GFS_coupling_type| | in | F | -!! | Radtend | GFS_radtend_type_instance | Fortran DDT containing FV3-GFS radiation tendencies | DDT | 0 | GFS_radtend_type | | inout | F | -!! | lm | number_of_vertical_layers_for_radiation_calculations | number of vertical layers for radiation calculation | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | lmk | adjusted_vertical_layer_dimension_for_radiation | number of vertical layers for radiation | count | 0 | integer | | in | F | -!! | lmp | adjusted_vertical_level_dimension_for_radiation | number of vertical levels for radiation | count | 0 | integer | | in | F | -!! | kd | vertical_index_difference_between_inout_and_local | vertical index difference between in/out and local | index | 0 | integer | | out | F | -!! | kt | vertical_index_difference_between_layer_and_upper_bound | vertical index difference between layer and upper bound | index | 0 | integer | | out | F | -!! | kb | vertical_index_difference_between_layer_and_lower_bound | vertical index difference between layer and lower bound | index | 0 | integer | | out | F | -!! | raddt | time_step_for_radiation | radiation time step | s | 0 | real | kind_phys | out | F | -!! | delp | layer_pressure_thickness_for_radiation | layer pressure thickness on radiation levels | hPa | 2 | real | kind_phys | out | F | -!! | dz | layer_thickness_for_radiation | layer thickness on radiation levels | km | 2 | real | kind_phys | out | F | -!! | plvl | air_pressure_at_interface_for_radiation_in_hPa | air pressure at vertical interface for radiation calculation | hPa | 2 | real | kind_phys | out | F | -!! | plyr | air_pressure_at_layer_for_radiation_in_hPa | air pressure at vertical layer for radiation calculation | hPa | 2 | real | kind_phys | out | F | -!! | tlvl | air_temperature_at_interface_for_radiation | air temperature at vertical interface for radiation calculation | K | 2 | real | kind_phys | out | F | -!! | tlyr | air_temperature_at_layer_for_radiation | air temperature at vertical layer for radiation calculation | K | 2 | real | kind_phys | out | F | -!! | tsfg | surface_ground_temperature_for_radiation | surface ground temperature for radiation | K | 1 | real | kind_phys | out | F | -!! | tsfa | surface_air_temperature_for_radiation | lowest model layer air temperature for radiation | K | 1 | real | kind_phys | out | F | -!! | qlyr | water_vapor_specific_humidity_at_layer_for_radiation | water vapor specific humidity at vertical layer for radiation calculation | kg kg-1 | 2 | real | kind_phys | out | F | -!! | olyr | ozone_concentration_at_layer_for_radiation | ozone concentration | kg kg-1 | 2 | real | kind_phys | out | F | -!! | gasvmr_co2 | volume_mixing_ratio_co2 | CO2 volume mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | -!! | gasvmr_n2o | volume_mixing_ratio_n2o | N2O volume mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | -!! | gasvmr_ch4 | volume_mixing_ratio_ch4 | CH4 volume mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | -!! | gasvmr_o2 | volume_mixing_ratio_o2 | O2 volume mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | -!! | gasvmr_co | volume_mixing_ratio_co | CO volume mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | -!! | gasvmr_cfc11 | volume_mixing_ratio_cfc11 | CFC11 volume mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | -!! | gasvmr_cfc12 | volume_mixing_ratio_cfc12 | CFC12 volume mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | -!! | gasvmr_cfc22 | volume_mixing_ratio_cfc22 | CFC22 volume mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | -!! | gasvmr_ccl4 | volume_mixing_ratio_ccl4 | CCL4 volume mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | -!! | gasvmr_cfc113 | volume_mixing_ratio_cfc113 | CFC113 volume mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | -!! | faersw1 | aerosol_optical_depth_for_shortwave_bands_01_16 | aerosol optical depth for shortwave bands 01-16 | none | 3 | real | kind_phys | out | F | -!! | faersw2 | aerosol_single_scattering_albedo_for_shortwave_bands_01_16 | aerosol single scattering albedo for shortwave bands 01-16 | frac | 3 | real | kind_phys | out | F | -!! | faersw3 | aerosol_asymmetry_parameter_for_shortwave_bands_01_16 | aerosol asymmetry parameter for shortwave bands 01-16 | none | 3 | real | kind_phys | out | F | -!! | faerlw1 | aerosol_optical_depth_for_longwave_bands_01_16 | aerosol optical depth for longwave bands 01-16 | none | 3 | real | kind_phys | out | F | -!! | faerlw2 | aerosol_single_scattering_albedo_for_longwave_bands_01_16 | aerosol single scattering albedo for longwave bands 01-16 | frac | 3 | real | kind_phys | out | F | -!! | faerlw3 | aerosol_asymmetry_parameter_for_longwave_bands_01_16 | aerosol asymmetry parameter for longwave bands 01-16 | none | 3 | real | kind_phys | out | F | -!! | aerodp | atmosphere_optical_thickness_due_to_ambient_aerosol_particles | vertical integrated optical depth for various aerosol species | none | 2 | real | kind_phys | out | F | -!! | clouds1 | total_cloud_fraction | layer total cloud fraction | frac | 2 | real | kind_phys | out | F | -!! | clouds2 | cloud_liquid_water_path | layer cloud liquid water path | g m-2 | 2 | real | kind_phys | out | F | -!! | clouds3 | mean_effective_radius_for_liquid_cloud | mean effective radius for liquid cloud | micron | 2 | real | kind_phys | out | F | -!! | clouds4 | cloud_ice_water_path | layer cloud ice water path | g m-2 | 2 | real | kind_phys | out | F | -!! | clouds5 | mean_effective_radius_for_ice_cloud | mean effective radius for ice cloud | micron | 2 | real | kind_phys | out | F | -!! | clouds6 | cloud_rain_water_path | cloud rain water path | g m-2 | 2 | real | kind_phys | out | F | -!! | clouds7 | mean_effective_radius_for_rain_drop | mean effective radius for rain drop | micron | 2 | real | kind_phys | out | F | -!! | clouds8 | cloud_snow_water_path | cloud snow water path | g m-2 | 2 | real | kind_phys | out | F | -!! | clouds9 | mean_effective_radius_for_snow_flake | mean effective radius for snow flake | micron | 2 | real | kind_phys | out | F | -!! | cldsa | cloud_area_fraction_for_radiation | fraction of clouds for low, middle,high, total and BL | frac | 2 | real | kind_phys | out | F | -!! | mtopa | model_layer_number_at_cloud_top | vertical indices for low, middle and high cloud tops | index | 2 | integer | | out | F | -!! | mbota | model_layer_number_at_cloud_base | vertical indices for low, middle and high cloud bases | index | 2 | integer | | out | F | -!! | de_lgth | cloud_decorrelation_length | cloud decorrelation length | km | 1 | real | kind_phys | out | F | -!! | alb1d | surface_albedo_perturbation | surface albedo perturbation | frac | 1 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_rrtmg_pre_run.html !! ! Attention - the output arguments lm, im, lmk, lmp must not be set ! in the CCPP version - they are defined in the interstitial_create routine diff --git a/physics/GFS_rrtmg_pre.meta b/physics/GFS_rrtmg_pre.meta new file mode 100644 index 000000000..d0c370882 --- /dev/null +++ b/physics/GFS_rrtmg_pre.meta @@ -0,0 +1,526 @@ +[ccpp-arg-table] + name = GFS_rrtmg_pre_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = GFS_rrtmg_pre_run + type = scheme +[Model] + standard_name = GFS_control_type_instance + long_name = Fortran DDT containing FV3-GFS model control parameters + units = DDT + dimensions = () + type = GFS_control_type + intent = in + optional = F +[Grid] + standard_name = GFS_grid_type_instance + long_name = Fortran DDT containing FV3-GFS grid and interpolation related data + units = DDT + dimensions = () + type = GFS_grid_type + intent = in + optional = F +[Sfcprop] + standard_name = GFS_sfcprop_type_instance + long_name = Fortran DDT containing FV3-GFS surface fields + units = DDT + dimensions = () + type = GFS_sfcprop_type + intent = in + optional = F +[Statein] + standard_name = GFS_statein_type_instance + long_name = Fortran DDT containing FV3-GFS prognostic state data in from dycore + units = DDT + dimensions = () + type = GFS_statein_type + intent = in + optional = F +[Tbd] + standard_name = GFS_tbd_type_instance + long_name = Fortran DDT containing FV3-GFS data not yet assigned to a defined container + units = DDT + dimensions = () + type = GFS_tbd_type + intent = in + optional = F +[Cldprop] + standard_name = GFS_cldprop_type_instance + long_name = Fortran DDT containing FV3-GFS cloud fields needed by radiation from physics + units = DDT + dimensions = () + type = GFS_cldprop_type + intent = in + optional = F +[Coupling] + standard_name = GFS_coupling_type_instance + long_name = Fortran DDT containing FV3-GFS fields needed for coupling + units = DDT + dimensions = () + type = GFS_coupling_type + intent = in + optional = F +[Radtend] + standard_name = GFS_radtend_type_instance + long_name = Fortran DDT containing FV3-GFS radiation tendencies + units = DDT + dimensions = () + type = GFS_radtend_type + intent = inout + optional = F +[lm] + standard_name = number_of_vertical_layers_for_radiation_calculations + long_name = number of vertical layers for radiation calculation + units = count + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[lmk] + standard_name = adjusted_vertical_layer_dimension_for_radiation + long_name = number of vertical layers for radiation + units = count + dimensions = () + type = integer + intent = in + optional = F +[lmp] + standard_name = adjusted_vertical_level_dimension_for_radiation + long_name = number of vertical levels for radiation + units = count + dimensions = () + type = integer + intent = in + optional = F +[kd] + standard_name = vertical_index_difference_between_inout_and_local + long_name = vertical index difference between in/out and local + units = index + dimensions = () + type = integer + intent = out + optional = F +[kt] + standard_name = vertical_index_difference_between_layer_and_upper_bound + long_name = vertical index difference between layer and upper bound + units = index + dimensions = () + type = integer + intent = out + optional = F +[kb] + standard_name = vertical_index_difference_between_layer_and_lower_bound + long_name = vertical index difference between layer and lower bound + units = index + dimensions = () + type = integer + intent = out + optional = F +[raddt] + standard_name = time_step_for_radiation + long_name = radiation time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = out + optional = F +[delp] + standard_name = layer_pressure_thickness_for_radiation + long_name = layer pressure thickness on radiation levels + units = hPa + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[dz] + standard_name = layer_thickness_for_radiation + long_name = layer thickness on radiation levels + units = km + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[plvl] + standard_name = air_pressure_at_interface_for_radiation_in_hPa + long_name = air pressure at vertical interface for radiation calculation + units = hPa + dimensions = (horizontal_dimension,adjusted_vertical_level_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[plyr] + standard_name = air_pressure_at_layer_for_radiation_in_hPa + long_name = air pressure at vertical layer for radiation calculation + units = hPa + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[tlvl] + standard_name = air_temperature_at_interface_for_radiation + long_name = air temperature at vertical interface for radiation calculation + units = K + dimensions = (horizontal_dimension,adjusted_vertical_level_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[tlyr] + standard_name = air_temperature_at_layer_for_radiation + long_name = air temperature at vertical layer for radiation calculation + units = K + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[tsfg] + standard_name = surface_ground_temperature_for_radiation + long_name = surface ground temperature for radiation + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[tsfa] + standard_name = surface_air_temperature_for_radiation + long_name = lowest model layer air temperature for radiation + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[qlyr] + standard_name = water_vapor_specific_humidity_at_layer_for_radiation + long_name = water vapor specific humidity at vertical layer for radiation calculation + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[olyr] + standard_name = ozone_concentration_at_layer_for_radiation + long_name = ozone concentration + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[gasvmr_co2] + standard_name = volume_mixing_ratio_co2 + long_name = CO2 volume mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[gasvmr_n2o] + standard_name = volume_mixing_ratio_n2o + long_name = N2O volume mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[gasvmr_ch4] + standard_name = volume_mixing_ratio_ch4 + long_name = CH4 volume mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[gasvmr_o2] + standard_name = volume_mixing_ratio_o2 + long_name = O2 volume mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[gasvmr_co] + standard_name = volume_mixing_ratio_co + long_name = CO volume mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[gasvmr_cfc11] + standard_name = volume_mixing_ratio_cfc11 + long_name = CFC11 volume mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[gasvmr_cfc12] + standard_name = volume_mixing_ratio_cfc12 + long_name = CFC12 volume mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[gasvmr_cfc22] + standard_name = volume_mixing_ratio_cfc22 + long_name = CFC22 volume mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[gasvmr_ccl4] + standard_name = volume_mixing_ratio_ccl4 + long_name = CCL4 volume mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[gasvmr_cfc113] + standard_name = volume_mixing_ratio_cfc113 + long_name = CFC113 volume mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[faersw1] + standard_name = aerosol_optical_depth_for_shortwave_bands_01_16 + long_name = aerosol optical depth for shortwave bands 01-16 + units = none + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_shortwave_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[faersw2] + standard_name = aerosol_single_scattering_albedo_for_shortwave_bands_01_16 + long_name = aerosol single scattering albedo for shortwave bands 01-16 + units = frac + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_shortwave_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[faersw3] + standard_name = aerosol_asymmetry_parameter_for_shortwave_bands_01_16 + long_name = aerosol asymmetry parameter for shortwave bands 01-16 + units = none + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_shortwave_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[faerlw1] + standard_name = aerosol_optical_depth_for_longwave_bands_01_16 + long_name = aerosol optical depth for longwave bands 01-16 + units = none + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_longwave_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[faerlw2] + standard_name = aerosol_single_scattering_albedo_for_longwave_bands_01_16 + long_name = aerosol single scattering albedo for longwave bands 01-16 + units = frac + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_longwave_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[faerlw3] + standard_name = aerosol_asymmetry_parameter_for_longwave_bands_01_16 + long_name = aerosol asymmetry parameter for longwave bands 01-16 + units = none + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_longwave_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[aerodp] + standard_name = atmosphere_optical_thickness_due_to_ambient_aerosol_particles + long_name = vertical integrated optical depth for various aerosol species + units = none + dimensions = (horizontal_dimension,number_of_species_for_aerosol_optical_depth) + type = real + kind = kind_phys + intent = out + optional = F +[clouds1] + standard_name = total_cloud_fraction + long_name = layer total cloud fraction + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[clouds2] + standard_name = cloud_liquid_water_path + long_name = layer cloud liquid water path + units = g m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[clouds3] + standard_name = mean_effective_radius_for_liquid_cloud + long_name = mean effective radius for liquid cloud + units = micron + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[clouds4] + standard_name = cloud_ice_water_path + long_name = layer cloud ice water path + units = g m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[clouds5] + standard_name = mean_effective_radius_for_ice_cloud + long_name = mean effective radius for ice cloud + units = micron + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[clouds6] + standard_name = cloud_rain_water_path + long_name = cloud rain water path + units = g m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[clouds7] + standard_name = mean_effective_radius_for_rain_drop + long_name = mean effective radius for rain drop + units = micron + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[clouds8] + standard_name = cloud_snow_water_path + long_name = cloud snow water path + units = g m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[clouds9] + standard_name = mean_effective_radius_for_snow_flake + long_name = mean effective radius for snow flake + units = micron + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cldsa] + standard_name = cloud_area_fraction_for_radiation + long_name = fraction of clouds for low, middle,high, total and BL + units = frac + dimensions = (horizontal_dimension,5) + type = real + kind = kind_phys + intent = out + optional = F +[mtopa] + standard_name = model_layer_number_at_cloud_top + long_name = vertical indices for low, middle and high cloud tops + units = index + dimensions = (horizontal_dimension,3) + type = integer + intent = out + optional = F +[mbota] + standard_name = model_layer_number_at_cloud_base + long_name = vertical indices for low, middle and high cloud bases + units = index + dimensions = (horizontal_dimension,3) + type = integer + intent = out + optional = F +[de_lgth] + standard_name = cloud_decorrelation_length + long_name = cloud decorrelation length + units = km + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[alb1d] + standard_name = surface_albedo_perturbation + long_name = surface albedo perturbation + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_rrtmg_pre_finalize + type = scheme diff --git a/physics/GFS_rrtmg_setup.F90 b/physics/GFS_rrtmg_setup.F90 index f9d5a8c61..b6d86a34e 100644 --- a/physics/GFS_rrtmg_setup.F90 +++ b/physics/GFS_rrtmg_setup.F90 @@ -41,39 +41,7 @@ module GFS_rrtmg_setup !> \defgroup GFS_rrtmg_setup GFS RRTMG Scheme Setup !! @{ !! \section arg_table_GFS_rrtmg_setup_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |--------------------------|-------------------------------------------------------------------------------|---------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | si | vertical_sigma_coordinate_for_radiation_initialization | vertical sigma coordinate for radiation initialization | none | 1 | real | kind_phys | in | F | -!! | levr | number_of_vertical_layers_for_radiation_calculations | number of vertical levels for radiation calculations | count | 0 | integer | | in | F | -!! | ictm | flag_for_initial_time_date_control | flag for initial conditions and forcing | flag | 0 | integer | | in | F | -!! | isol | flag_for_solar_constant | use prescribed solar constant | flag | 0 | integer | | in | F | -!! | ico2 | flag_for_using_prescribed_global_mean_co2_value | prescribed global mean value (old opernl) | flag | 0 | integer | | in | F | -!! | iaer | flag_for_default_aerosol_effect_in_shortwave_radiation | default aerosol effect in sw only | flag | 0 | integer | | in | F | -!! | ialb | flag_for_using_climatology_albedo | flag for using climatology alb, based on sfc type | flag | 0 | integer | | in | F | -!! | iems | flag_for_surface_emissivity_control | surface emissivity control flag, use fixed value of 1 | flag | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | tracer index for cloud condensate (or liquid water) | index | 0 | integer | | in | F | -!! | num_p2d | array_dimension_of_2d_arrays_for_microphysics | number of 2D arrays needed for microphysics | count | 0 | integer | | in | F | -!! | num_p3d | array_dimension_of_3d_arrays_for_microphysics | number of 3D arrays needed for microphysics | count | 0 | integer | | in | F | -!! | npdf3d | number_of_3d_arrays_associated_with_pdf_based_clouds | number of 3d arrays associated with pdf based clouds/mp | count | 0 | integer | | in | F | -!! | ntoz | index_for_ozone | tracer index for ozone mixing ratio | index | 0 | integer | | in | F | -!! | iovr_sw | flag_for_max_random_overlap_clouds_for_shortwave_radiation | sw: max-random overlap clouds | flag | 0 | integer | | in | F | -!! | iovr_lw | flag_for_max_random_overlap_clouds_for_longwave_radiation | lw: max-random overlap clouds | flag | 0 | integer | | in | F | -!! | isubc_sw | flag_for_sw_clouds_without_sub_grid_approximation | flag for sw clouds without sub-grid approximation | flag | 0 | integer | | in | F | -!! | isubc_lw | flag_for_lw_clouds_without_sub_grid_approximation | flag for lw clouds without sub-grid approximation | flag | 0 | integer | | in | F | -!! | icliq_sw | flag_for_optical_property_for_liquid_clouds_for_shortwave_radiation | sw optical property for liquid clouds | flag | 0 | integer | | in | F | -!! | crick_proof | flag_for_CRICK_proof_cloud_water | flag for CRICK-Proof cloud water | flag | 0 | logical | | in | F | -!! | ccnorm | flag_for_cloud_condensate_normalized_by_cloud_cover | flag for cloud condensate normalized by cloud cover | flag | 0 | logical | | in | F | -!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | norad_precip | flag_for_precipitation_effect_on_radiation | radiation precip flag for Ferrier/Moorthi | flag | 0 | logical | | in | F | -!! | idate | date_and_time_at_model_initialization_reordered | initialization date and time | none | 1 | integer | | in | F | -!! | iflip | flag_for_vertical_index_direction_control | flag for vertical index direction control | flag | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | faerlw | aerosol_optical_properties_for_longwave_bands_01_16 | optical properties for longwave bands 01-16 | various | 4 | real | kind_phys | in | F | -!! | faersw | aerosol_optical_properties_for_shortwave_bands_01_16 | aerosol optical properties for shortwave bands 01-16 | various | 4 | real | kind_phys | in | F | -!! | aerodp | atmosphere_optical_thickness_due_to_ambient_aerosol_particles | vertical integrated optical depth for various aerosol species | none | 2 | real | kind_phys | in | F | -!! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_rrtmg_setup_init.html !! subroutine GFS_rrtmg_setup_init ( & si, levr, ictm, isol, ico2, iaer, ialb, iems, ntcw, num_p2d, & @@ -352,20 +320,7 @@ subroutine GFS_rrtmg_setup_init ( & end subroutine GFS_rrtmg_setup_init !> \section arg_table_GFS_rrtmg_setup_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |--------------------------|-------------------------------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | idate | date_and_time_at_model_initialization | initialization date and time | none | 1 | integer | | in | F | -!! | jdate | forecast_date_and_time | current forecast date and time | none | 1 | integer | | in | F | -!! | deltsw | frequency_for_shortwave_radiation | frequency for shortwave radiation | s | 0 | real | kind_phys | in | F | -!! | deltim | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | -!! | lsswr | flag_to_calc_sw | logical flags for sw radiation calls | flag | 0 | logical | | in | F | -!! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | slag | equation_of_time | equation of time (radian) | radians | 0 | real | kind_phys | out | F | -!! | sdec | sine_of_solar_declination_angle | sin of the solar declination angle | none | 0 | real | kind_phys | out | F | -!! | cdec | cosine_of_solar_declination_angle | cos of the solar declination angle | none | 0 | real | kind_phys | out | F | -!! | solcon | solar_constant | solar constant (sun-earth distant adjusted) | W m-2 | 0 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_rrtmg_setup_run.html !! subroutine GFS_rrtmg_setup_run ( & idate, jdate, deltsw, deltim, lsswr, me, & @@ -404,10 +359,7 @@ subroutine GFS_rrtmg_setup_run ( & end subroutine GFS_rrtmg_setup_run !> \section arg_table_GFS_rrtmg_setup_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |--------------------------|-------------------------------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_rrtmg_setup_finalize.html !! subroutine GFS_rrtmg_setup_finalize (errmsg, errflg) diff --git a/physics/GFS_rrtmg_setup.meta b/physics/GFS_rrtmg_setup.meta new file mode 100644 index 000000000..8405d160d --- /dev/null +++ b/physics/GFS_rrtmg_setup.meta @@ -0,0 +1,386 @@ +[ccpp-arg-table] + name = GFS_rrtmg_setup_init + type = scheme +[si] + standard_name = vertical_sigma_coordinate_for_radiation_initialization + long_name = vertical sigma coordinate for radiation initialization + units = none + dimensions = (number_of_vertical_layers_for_radiation_calculations_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[levr] + standard_name = number_of_vertical_layers_for_radiation_calculations + long_name = number of vertical levels for radiation calculations + units = count + dimensions = () + type = integer + intent = in + optional = F +[ictm] + standard_name = flag_for_initial_time_date_control + long_name = flag for initial conditions and forcing + units = flag + dimensions = () + type = integer + intent = in + optional = F +[isol] + standard_name = flag_for_solar_constant + long_name = use prescribed solar constant + units = flag + dimensions = () + type = integer + intent = in + optional = F +[ico2] + standard_name = flag_for_using_prescribed_global_mean_co2_value + long_name = prescribed global mean value (old opernl) + units = flag + dimensions = () + type = integer + intent = in + optional = F +[iaer] + standard_name = flag_for_default_aerosol_effect_in_shortwave_radiation + long_name = default aerosol effect in sw only + units = flag + dimensions = () + type = integer + intent = in + optional = F +[ialb] + standard_name = flag_for_using_climatology_albedo + long_name = flag for using climatology alb, based on sfc type + units = flag + dimensions = () + type = integer + intent = in + optional = F +[iems] + standard_name = flag_for_surface_emissivity_control + long_name = surface emissivity control flag, use fixed value of 1 + units = flag + dimensions = () + type = integer + intent = in + optional = F +[ntcw] + standard_name = index_for_liquid_cloud_condensate + long_name = tracer index for cloud condensate (or liquid water) + units = index + dimensions = () + type = integer + intent = in + optional = F +[num_p2d] + standard_name = array_dimension_of_2d_arrays_for_microphysics + long_name = number of 2D arrays needed for microphysics + units = count + dimensions = () + type = integer + intent = in + optional = F +[num_p3d] + standard_name = array_dimension_of_3d_arrays_for_microphysics + long_name = number of 3D arrays needed for microphysics + units = count + dimensions = () + type = integer + intent = in + optional = F +[npdf3d] + standard_name = number_of_3d_arrays_associated_with_pdf_based_clouds + long_name = number of 3d arrays associated with pdf based clouds/mp + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntoz] + standard_name = index_for_ozone + long_name = tracer index for ozone mixing ratio + units = index + dimensions = () + type = integer + intent = in + optional = F +[iovr_sw] + standard_name = flag_for_max_random_overlap_clouds_for_shortwave_radiation + long_name = sw: max-random overlap clouds + units = flag + dimensions = () + type = integer + intent = in + optional = F +[iovr_lw] + standard_name = flag_for_max_random_overlap_clouds_for_longwave_radiation + long_name = lw: max-random overlap clouds + units = flag + dimensions = () + type = integer + intent = in + optional = F +[isubc_sw] + standard_name = flag_for_sw_clouds_without_sub_grid_approximation + long_name = flag for sw clouds without sub-grid approximation + units = flag + dimensions = () + type = integer + intent = in + optional = F +[isubc_lw] + standard_name = flag_for_lw_clouds_without_sub_grid_approximation + long_name = flag for lw clouds without sub-grid approximation + units = flag + dimensions = () + type = integer + intent = in + optional = F +[icliq_sw] + standard_name = flag_for_optical_property_for_liquid_clouds_for_shortwave_radiation + long_name = sw optical property for liquid clouds + units = flag + dimensions = () + type = integer + intent = in + optional = F +[crick_proof] + standard_name = flag_for_CRICK_proof_cloud_water + long_name = flag for CRICK-Proof cloud water + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ccnorm] + standard_name = flag_for_cloud_condensate_normalized_by_cloud_cover + long_name = flag for cloud condensate normalized by cloud cover + units = flag + dimensions = () + type = logical + intent = in + optional = F +[imp_physics] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[norad_precip] + standard_name = flag_for_precipitation_effect_on_radiation + long_name = radiation precip flag for Ferrier/Moorthi + units = flag + dimensions = () + type = logical + intent = in + optional = F +[idate] + standard_name = date_and_time_at_model_initialization_reordered + long_name = initialization date and time + units = none + dimensions = (4) + type = integer + intent = in + optional = F +[iflip] + standard_name = flag_for_vertical_index_direction_control + long_name = flag for vertical index direction control + units = flag + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[faerlw] + standard_name = aerosol_optical_properties_for_longwave_bands_01_16 + long_name = optical properties for longwave bands 01-16 + units = various + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_longwave_radiation,number_of_aerosol_output_fields_for_longwave_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[faersw] + standard_name = aerosol_optical_properties_for_shortwave_bands_01_16 + long_name = aerosol optical properties for shortwave bands 01-16 + units = various + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_shortwave_radiation,number_of_aerosol_output_fields_for_shortwave_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[aerodp] + standard_name = atmosphere_optical_thickness_due_to_ambient_aerosol_particles + long_name = vertical integrated optical depth for various aerosol species + units = none + dimensions = (horizontal_dimension,number_of_species_for_aerosol_optical_depth) + type = real + kind = kind_phys + intent = in + optional = F +[me] + standard_name = mpi_rank + long_name = current MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_rrtmg_setup_run + type = scheme +[idate] + standard_name = date_and_time_at_model_initialization + long_name = initialization date and time + units = none + dimensions = (8) + type = integer + intent = in + optional = F +[jdate] + standard_name = forecast_date_and_time + long_name = current forecast date and time + units = none + dimensions = (8) + type = integer + intent = in + optional = F +[deltsw] + standard_name = frequency_for_shortwave_radiation + long_name = frequency for shortwave radiation + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[deltim] + standard_name = time_step_for_dynamics + long_name = dynamics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[lsswr] + standard_name = flag_to_calc_sw + long_name = logical flags for sw radiation calls + units = flag + dimensions = () + type = logical + intent = in + optional = F +[me] + standard_name = mpi_rank + long_name = current MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[slag] + standard_name = equation_of_time + long_name = equation of time (radian) + units = radians + dimensions = () + type = real + kind = kind_phys + intent = out + optional = F +[sdec] + standard_name = sine_of_solar_declination_angle + long_name = sin of the solar declination angle + units = none + dimensions = () + type = real + kind = kind_phys + intent = out + optional = F +[cdec] + standard_name = cosine_of_solar_declination_angle + long_name = cos of the solar declination angle + units = none + dimensions = () + type = real + kind = kind_phys + intent = out + optional = F +[solcon] + standard_name = solar_constant + long_name = solar constant (sun-earth distant adjusted) + units = W m-2 + dimensions = () + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_rrtmg_setup_finalize + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/GFS_stochastics.F90 b/physics/GFS_stochastics.F90 index 7fa2e256b..c35de0954 100644 --- a/physics/GFS_stochastics.F90 +++ b/physics/GFS_stochastics.F90 @@ -16,47 +16,7 @@ end subroutine GFS_stochastics_finalize !! This module !> @{ !> \section arg_table_GFS_stochastics_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|---------------------------------------------------------------------------|--------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | km | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | do_sppt | flag_for_stochastic_surface_physics_perturbations | flag for stochastic surface physics perturbations | flag | 0 | logical | | in | F | -!! | use_zmtnblck | flag_for_mountain_blocking | flag for mountain blocking | flag | 0 | logical | | in | F | -!! | do_shum | flag_for_stochastic_shum_option | flag for stochastic shum option | flag | 0 | logical | | in | F | -!! | do_skeb | flag_for_stochastic_skeb_option | flag for stochastic skeb option | flag | 0 | logical | | in | F | -!! | zmtnblck | level_of_dividing_streamline | level of the dividing streamline | none | 1 | real | kind_phys | in | F | -!! | sppt_wts | weights_for_stochastic_sppt_perturbation | weights for stochastic sppt perturbation | none | 2 | real | kind_phys | inout | F | -!! | skebu_wts | weights_for_stochastic_skeb_perturbation_of_x_wind | weights for stochastic skeb perturbation of x wind | none | 2 | real | kind_phys | in | F | -!! | skebv_wts | weights_for_stochastic_skeb_perturbation_of_y_wind | weights for stochastic skeb perturbation of y wind | none | 2 | real | kind_phys | in | F | -!! | shum_wts | weights_for_stochastic_shum_perturbation | weights for stochastic shum perturbation | none | 2 | real | kind_phys | in | F | -!! | sppt_wts_inv | weights_for_stochastic_sppt_perturbation_flipped | weights for stochastic sppt perturbation, flipped | none | 2 | real | kind_phys | inout | F | -!! | skebu_wts_inv | weights_for_stochastic_skeb_perturbation_of_x_wind_flipped | weights for stochastic skeb perturbation of x wind, flipped | none | 2 | real | kind_phys | inout | F | -!! | skebv_wts_inv | weights_for_stochastic_skeb_perturbation_of_y_wind_flipped | weights for stochastic skeb perturbation of y wind, flipped | none | 2 | real | kind_phys | inout | F | -!! | shum_wts_inv | weights_for_stochastic_shum_perturbation_flipped | weights for stochastic shum perturbation, flipped | none | 2 | real | kind_phys | inout | F | -!! | diss_est | dissipation_estimate_of_air_temperature_at_model_layers | dissipation estimate model layer mean temperature | K | 2 | real | kind_phys | in | F | -!! | ugrs | x_wind | zonal wind | m s-1 | 2 | real | kind_phys | in | F | -!! | vgrs | y_wind | meridional wind | m s-1 | 2 | real | kind_phys | in | F | -!! | tgrs | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | in | F | -!! | qgrs | water_vapor_specific_humidity | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gu0 | x_wind_updated_by_physics | zonal wind updated by physics | m s-1 | 2 | real | kind_phys | inout | F | -!! | gv0 | y_wind_updated_by_physics | meridional wind updated by physics | m s-1 | 2 | real | kind_phys | inout | F | -!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | inout | F | -!! | gq0 | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | dtdtr | tendency_of_air_temperature_due_to_radiative_heating_on_physics_time_step | temp. change due to radiative heating per time step | K | 2 | real | kind_phys | in | F | -!! | rain | lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total rain at this time step | m | 1 | real | kind_phys | in | F | -!! | rainc | lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep | convective rain at this time step | m | 1 | real | kind_phys | in | F | -!! | tprcp | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total precipitation amount in each time step | m | 1 | real | kind_phys | inout | F | -!! | totprcp | accumulated_lwe_thickness_of_precipitation_amount | accumulated total precipitation | m | 1 | real | kind_phys | inout | F | -!! | cnvprcp | cumulative_lwe_thickness_of_convective_precipitation_amount | cumulative convective precipitation | m | 1 | real | kind_phys | inout | F | -!! | totprcpb | accumulated_lwe_thickness_of_precipitation_amount_in_bucket | accumulated total precipitation in bucket | m | 1 | real | kind_phys | inout | F | -!! | cnvprcpb | cumulative_lwe_thickness_of_convective_precipitation_amount_in_bucket | cumulative convective precipitation in bucket | m | 1 | real | kind_phys | inout | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | -!! | rain_cpl | lwe_thickness_of_precipitation_amount_for_coupling | total rain precipitation | m | 1 | real | kind_phys | inout | F | -!! | snow_cpl | lwe_thickness_of_snow_amount_for_coupling | total snow precipitation | m | 1 | real | kind_phys | inout | F | -!! | drain_cpl | tendency_of_lwe_thickness_of_precipitation_amount_for_coupling | change in rain_cpl (coupling_type) | m | 1 | real | kind_phys | in | F | -!! | dsnow_cpl | tendency_of_lwe_thickness_of_snow_amount_for_coupling | change in show_cpl (coupling_type) | m | 1 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_stochastics_run.html !! !>\section gfs_stochy_general GFS_stochastics_run General Algorithm !! This is the GFS stochastic physics driver. diff --git a/physics/GFS_stochastics.meta b/physics/GFS_stochastics.meta new file mode 100644 index 000000000..9232c8d6a --- /dev/null +++ b/physics/GFS_stochastics.meta @@ -0,0 +1,346 @@ +[ccpp-arg-table] + name = GFS_stochastics_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[do_sppt] + standard_name = flag_for_stochastic_surface_physics_perturbations + long_name = flag for stochastic surface physics perturbations + units = flag + dimensions = () + type = logical + intent = in + optional = F +[use_zmtnblck] + standard_name = flag_for_mountain_blocking + long_name = flag for mountain blocking + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_shum] + standard_name = flag_for_stochastic_shum_option + long_name = flag for stochastic shum option + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_skeb] + standard_name = flag_for_stochastic_skeb_option + long_name = flag for stochastic skeb option + units = flag + dimensions = () + type = logical + intent = in + optional = F +[zmtnblck] + standard_name = level_of_dividing_streamline + long_name = level of the dividing streamline + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sppt_wts] + standard_name = weights_for_stochastic_sppt_perturbation + long_name = weights for stochastic sppt perturbation + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[skebu_wts] + standard_name = weights_for_stochastic_skeb_perturbation_of_x_wind + long_name = weights for stochastic skeb perturbation of x wind + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[skebv_wts] + standard_name = weights_for_stochastic_skeb_perturbation_of_y_wind + long_name = weights for stochastic skeb perturbation of y wind + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[shum_wts] + standard_name = weights_for_stochastic_shum_perturbation + long_name = weights for stochastic shum perturbation + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sppt_wts_inv] + standard_name = weights_for_stochastic_sppt_perturbation_flipped + long_name = weights for stochastic sppt perturbation, flipped + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[skebu_wts_inv] + standard_name = weights_for_stochastic_skeb_perturbation_of_x_wind_flipped + long_name = weights for stochastic skeb perturbation of x wind, flipped + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[skebv_wts_inv] + standard_name = weights_for_stochastic_skeb_perturbation_of_y_wind_flipped + long_name = weights for stochastic skeb perturbation of y wind, flipped + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[shum_wts_inv] + standard_name = weights_for_stochastic_shum_perturbation_flipped + long_name = weights for stochastic shum perturbation, flipped + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[diss_est] + standard_name = dissipation_estimate_of_air_temperature_at_model_layers + long_name = dissipation estimate model layer mean temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ugrs] + standard_name = x_wind + long_name = zonal wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[vgrs] + standard_name = y_wind + long_name = meridional wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tgrs] + standard_name = air_temperature + long_name = model layer mean temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qgrs] + standard_name = water_vapor_specific_humidity + long_name = water vapor specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gu0] + standard_name = x_wind_updated_by_physics + long_name = zonal wind updated by physics + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gv0] + standard_name = y_wind_updated_by_physics + long_name = meridional wind updated by physics + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gq0] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dtdtr] + standard_name = tendency_of_air_temperature_due_to_radiative_heating_on_physics_time_step + long_name = temp. change due to radiative heating per time step + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rain] + standard_name = lwe_thickness_of_precipitation_amount_on_dynamics_timestep + long_name = total rain at this time step + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rainc] + standard_name = lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep + long_name = convective rain at this time step + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tprcp] + standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep + long_name = total precipitation amount in each time step + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[totprcp] + standard_name = accumulated_lwe_thickness_of_precipitation_amount + long_name = accumulated total precipitation + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnvprcp] + standard_name = cumulative_lwe_thickness_of_convective_precipitation_amount + long_name = cumulative convective precipitation + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[totprcpb] + standard_name = accumulated_lwe_thickness_of_precipitation_amount_in_bucket + long_name = accumulated total precipitation in bucket + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnvprcpb] + standard_name = cumulative_lwe_thickness_of_convective_precipitation_amount_in_bucket + long_name = cumulative convective precipitation in bucket + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cplflx] + standard_name = flag_for_flux_coupling + long_name = flag controlling cplflx collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[rain_cpl] + standard_name = lwe_thickness_of_precipitation_amount_for_coupling + long_name = total rain precipitation + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snow_cpl] + standard_name = lwe_thickness_of_snow_amount_for_coupling + long_name = total snow precipitation + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[drain_cpl] + standard_name = tendency_of_lwe_thickness_of_precipitation_amount_for_coupling + long_name = change in rain_cpl (coupling_type) + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dsnow_cpl] + standard_name = tendency_of_lwe_thickness_of_snow_amount_for_coupling + long_name = change in show_cpl (coupling_type) + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/GFS_suite_init_finalize_test.F90 b/physics/GFS_suite_init_finalize_test.F90 index efd0530e2..0a958d2fc 100644 --- a/physics/GFS_suite_init_finalize_test.F90 +++ b/physics/GFS_suite_init_finalize_test.F90 @@ -3,10 +3,7 @@ module GFS_suite_ini_fini_test contains !> \section arg_table_GFS_suite_ini_fini_test_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_suite_ini_fini_test_init.html !! subroutine GFS_suite_ini_fini_test_init (errmsg, errflg) @@ -24,10 +21,7 @@ subroutine GFS_suite_ini_fini_test_init (errmsg, errflg) end subroutine GFS_suite_ini_fini_test_init !> \section arg_table_GFS_suite_ini_fini_test_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_suite_ini_fini_test_finalize.html !! subroutine GFS_suite_ini_fini_test_finalize(errmsg, errflg) @@ -45,10 +39,7 @@ subroutine GFS_suite_ini_fini_test_finalize(errmsg, errflg) end subroutine GFS_suite_ini_fini_test_finalize !> \section arg_table_GFS_suite_ini_fini_test_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_suite_ini_fini_test_run.html !! subroutine GFS_suite_ini_fini_test_run (errmsg, errflg) diff --git a/physics/GFS_suite_init_finalize_test.meta b/physics/GFS_suite_init_finalize_test.meta new file mode 100644 index 000000000..cdca8b0e0 --- /dev/null +++ b/physics/GFS_suite_init_finalize_test.meta @@ -0,0 +1,64 @@ +[ccpp-arg-table] + name = GFS_suite_ini_fini_test_init + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_suite_ini_fini_test_finalize + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_suite_ini_fini_test_run + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 0ba7f8c82..955fe90bd 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -12,11 +12,7 @@ subroutine GFS_suite_interstitial_rad_reset_finalize() end subroutine GFS_suite_interstitial_rad_reset_finalize !> \section arg_table_GFS_suite_interstitial_rad_reset_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------| -!! | Interstitial | GFS_interstitial_type_instance | derived type GFS_interstitial_type in FV3 | DDT | 0 | GFS_interstitial_type | | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_suite_interstitial_rad_reset_run.html !! subroutine GFS_suite_interstitial_rad_reset_run (Interstitial, errmsg, errflg) @@ -50,12 +46,7 @@ subroutine GFS_suite_interstitial_phys_reset_finalize() end subroutine GFS_suite_interstitial_phys_reset_finalize !> \section arg_table_GFS_suite_interstitial_phys_reset_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|---------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------| -!! | Interstitial | GFS_interstitial_type_instance | derived type GFS_interstitial_type in FV3 | DDT | 0 | GFS_interstitial_type | | inout | F | -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_suite_interstitial_phys_reset_run.html !! subroutine GFS_suite_interstitial_phys_reset_run (Interstitial, Model, errmsg, errflg) @@ -90,30 +81,7 @@ subroutine GFS_suite_interstitial_1_finalize() end subroutine GFS_suite_interstitial_1_finalize !> \section arg_table_GFS_suite_interstitial_1_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|---------------------------------------------------------------------------|-------------------------------------------------------------------------|---------------|------|------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | -!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | -!! | slmsk | sea_land_ice_mask_real | landmask: sea/land/ice=0/1/2 | flag | 1 | real | kind_phys | in | F | -!! | area | cell_area | area of the grid cell | m2 | 1 | real | kind_phys | in | F | -!! | dxmin | minimum_scaling_factor_for_critical_relative_humidity | minimum scaling factor for critical relative humidity | m2 rad-2 | 0 | real | kind_phys | in | F | -!! | dxinv | inverse_scaling_factor_for_critical_relative_humidity | inverse scaling factor for critical relative humidity | rad2 m-2 | 0 | real | kind_phys | in | F | -!! | pgr | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | frain | dynamics_to_physics_timestep_ratio | ratio of dynamics timestep to physics timestep | none | 0 | real | kind_phys | out | F | -!! | islmsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | out | F | -!! | work1 | grid_size_related_coefficient_used_in_scale_sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | out | F | -!! | work2 | grid_size_related_coefficient_used_in_scale_sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | out | F | -!! | psurf | surface_air_pressure_diag | surface air pressure diagnostic | Pa | 1 | real | kind_phys | out | F | -!! | dudt | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | out | F | -!! | dvdt | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | out | F | -!! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | out | F | -!! | dtdtc | tendency_of_air_temperature_due_to_radiative_heating_assuming_clear_sky | clear sky radiative (shortwave + longwave) heating rate at current time | K s-1 | 2 | real | kind_phys | out | F | -!! | dqdt | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers | kg kg-1 s-1 | 3 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_suite_interstitial_1_run.html !! subroutine GFS_suite_interstitial_1_run (im, levs, ntrac, dtf, dtp, slmsk, area, dxmin, dxinv, pgr, & frain, islmsk, work1, work2, psurf, dudt, dvdt, dtdt, dtdtc, dqdt, errmsg, errflg) @@ -185,57 +153,7 @@ subroutine GFS_suite_interstitial_2_finalize() end subroutine GFS_suite_interstitial_2_finalize #if 0 !> \section arg_table_GFS_suite_interstitial_2_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |------------------|----------------------------------------------------------------------------|-----------------------------------------------------------------------------|---------------|------|------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | -!! | lsidea | flag_idealized_physics | flag for idealized physics | flag | 0 | logical | | in | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | -!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | in | F | -!! | shal_cnv | flag_for_shallow_convection | flag for calling shallow convection | flag | 0 | logical | | in | F | -!! | old_monin | flag_for_old_PBL_scheme | flag for using old PBL schemes | flag | 0 | logical | | in | F | -!! | mstrat | flag_for_moorthi_stratus | flag for moorthi approach for stratus | flag | 0 | logical | | in | F | -!! | do_shoc | flag_for_shoc | flag for SHOC | flag | 0 | logical | | in | F | -!! | imfshalcnv | flag_for_mass_flux_shallow_convection_scheme | flag for mass-flux shallow convection scheme | flag | 0 | integer | | in | F | -!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | -!! | xcosz | instantaneous_cosine_of_zenith_angle | cosine of zenith angle at current time | none | 1 | real | kind_phys | in | F | -!! | adjsfcdsw | surface_downwelling_shortwave_flux | surface downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | adjsfcdlw | surface_downwelling_longwave_flux | surface downwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | pgr | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | ulwsfc_cice | surface_upwelling_longwave_flux_for_coupling | surface upwelling longwave flux for coupling | W m-2 | 1 | real | kind_phys | in | F | -!! | lwhd | tendency_of_air_temperature_due_to_longwave_heating_for_idea | idea sky lw heating rates | K s-1 | 3 | real | kind_phys | in | F | -!! | htrsw | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep | total sky sw heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | htrlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep | total sky lw heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave fluxes | none | 1 | real | kind_phys | in | F | -!! | ctei_rm | critical_cloud_top_entrainment_instability_criteria | critical cloud top entrainment instability criteria | none | 1 | real | kind_phys | in | F | -!! | work1 | grid_size_related_coefficient_used_in_scale_sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | -!! | work2 | grid_size_related_coefficient_used_in_scale_sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | in | F | -!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | tgrs | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | qgrs_water_vapor | water_vapor_specific_humidity | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | in | F | -!! | qgrs_cloud_water | cloud_condensed_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) | kg kg-1 | 2 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | prslk | dimensionless_exner_function_at_model_layers | dimensionless Exner function at model layer centers | none | 2 | real | kind_phys | in | F | -!! | suntim | duration_of_sunshine | sunshine duration time | s | 1 | real | kind_phys | inout | F | -!! | adjsfculw | surface_upwelling_longwave_flux | surface upwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | inout | F | -!! | dlwsfc | cumulative_surface_downwelling_longwave_flux_multiplied_by_timestep | cumulative surface downwelling LW flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | ulwsfc | cumulative_surface_upwelling_longwave_flux_multiplied_by_timestep | cumulative surface upwelling LW flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | psmean | cumulative_surface_pressure_multiplied_by_timestep | cumulative surface pressure multiplied by timestep | Pa s | 1 | real | kind_phys | inout | F | -!! | dt3dt_lw | cumulative_change_in_temperature_due_to_longwave_radiation | cumulative change in temperature due to longwave radiation | K | 2 | real | kind_phys | inout | F | -!! | dt3dt_sw | cumulative_change_in_temperature_due_to_shortwave_radiation | cumulative change in temperature due to shortwave radiation | K | 2 | real | kind_phys | inout | F | -!! | dt3dt_pbl | cumulative_change_in_temperature_due_to_PBL | cumulative change in temperature due to PBL | K | 2 | real | kind_phys | inout | F | -!! | dt3dt_dcnv | cumulative_change_in_temperature_due_to_deep_convection | cumulative change in temperature due to deep conv. | K | 2 | real | kind_phys | inout | F | -!! | dt3dt_scnv | cumulative_change_in_temperature_due_to_shal_convection | cumulative change in temperature due to shal conv. | K | 2 | real | kind_phys | inout | F | -!! | dt3dt_mp | cumulative_change_in_temperature_due_to_microphysics | cumulative change in temperature due to microphysics | K | 2 | real | kind_phys | inout | F | -!! | ctei_rml | grid_sensitive_critical_cloud_top_entrainment_instability_criteria | grid sensitive critical cloud top entrainment instability criteria | none | 1 | real | kind_phys | inout | F | -!! | ctei_r | cloud_top_entrainment_instability_value | cloud top entrainment instability value | none | 1 | real | kind_phys | inout | F | -!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_suite_interstitial_2_run.html !! #endif subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplflx, flag_cice, shal_cnv, old_monin, mstrat, & @@ -397,21 +315,7 @@ subroutine GFS_suite_stateout_reset_finalize() end subroutine GFS_suite_stateout_reset_finalize !> \section arg_table_GFS_suite_stateout_reset_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | tgrs | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | in | F | -!! | ugrs | x_wind | zonal wind | m s-1 | 2 | real | kind_phys | in | F | -!! | vgrs | y_wind | meridional wind | m s-1 | 2 | real | kind_phys | in | F | -!! | qgrs | tracer_concentration | model layer mean tracer concentration | kg kg-1 | 3 | real | kind_phys | in | F | -!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | out | F | -!! | gu0 | x_wind_updated_by_physics | zonal wind updated by physics | m s-1 | 2 | real | kind_phys | out | F | -!! | gv0 | y_wind_updated_by_physics | meridional wind updated by physics | m s-1 | 2 | real | kind_phys | out | F | -!! | gq0 | tracer_concentration_updated_by_physics | tracer concentration updated by physics | kg kg-1 | 3 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_suite_stateout_reset_run.html !! subroutine GFS_suite_stateout_reset_run (im, levs, ntrac, & tgrs, ugrs, vgrs, qgrs, & @@ -459,26 +363,7 @@ subroutine GFS_suite_stateout_update_finalize() end subroutine GFS_suite_stateout_update_finalize !> \section arg_table_GFS_suite_stateout_update_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | -!! | tgrs | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | in | F | -!! | ugrs | x_wind | zonal wind | m s-1 | 2 | real | kind_phys | in | F | -!! | vgrs | y_wind | meridional wind | m s-1 | 2 | real | kind_phys | in | F | -!! | qgrs | tracer_concentration | model layer mean tracer concentration | kg kg-1 | 3 | real | kind_phys | in | F | -!! | dudt | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | in | F | -!! | dvdt | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | in | F | -!! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | in | F | -!! | dqdt | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers | kg kg-1 s-1 | 3 | real | kind_phys | in | F | -!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | out | F | -!! | gu0 | x_wind_updated_by_physics | zonal wind updated by physics | m s-1 | 2 | real | kind_phys | out | F | -!! | gv0 | y_wind_updated_by_physics | meridional wind updated by physics | m s-1 | 2 | real | kind_phys | out | F | -!! | gq0 | tracer_concentration_updated_by_physics | tracer concentration updated by physics | kg kg-1 | 3 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_suite_stateout_update_run.html !! subroutine GFS_suite_stateout_update_run (im, levs, ntrac, dtp, & tgrs, ugrs, vgrs, qgrs, dudt, dvdt, dtdt, dqdt, & @@ -531,53 +416,7 @@ end subroutine GFS_suite_interstitial_3_finalize #if 0 !> \section arg_table_GFS_suite_interstitial_3_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------------------|-----------------------------------------------------------------------------------------------|-------------------------------------------------------------------|---------------|------|------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | nn | number_of_tracers_for_convective_transport | number of tracers for convective transport | count | 0 | integer | | in | F | -!! | cscnv | flag_for_Chikira_Sugiyama_deep_convection | flag for Chikira-Sugiyama convection | flag | 0 | logical | | in | F | -!! | satmedmf | flag_for_scale_aware_TKE_moist_EDMF_PBL | flag for scale-aware TKE moist EDMF PBL scheme | flag | 0 | logical | | in | F | -!! | trans_trac | flag_for_convective_transport_of_tracers | flag for convective transport of tracers | flag | 0 | logical | | in | F | -!! | do_shoc | flag_for_shoc | flag for SHOC | flag | 0 | logical | | in | F | -!! | ltaerosol | flag_for_aerosol_physics | flag for aerosol physics | flag | 0 | logical | | in | F | -!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | tracer index for cloud condensate (or liquid water) | index | 0 | integer | | in | F | -!! | ntiw | index_for_ice_cloud_condensate | tracer index for ice water | index | 0 | integer | | in | F | -!! | ntclamt | index_for_cloud_amount | tracer index for cloud amount integer | index | 0 | integer | | in | F | -!! | ntrw | index_for_rain_water | tracer index for rain water | index | 0 | integer | | in | F | -!! | ntsw | index_for_snow_water | tracer index for snow water | index | 0 | integer | | in | F | -!! | ntrnc | index_for_rain_number_concentration | tracer index for rain number concentration | index | 0 | integer | | in | F | -!! | ntsnc | index_for_snow_number_concentration | tracer index for snow number concentration | index | 0 | integer | | in | F | -!! | ntgl | index_for_graupel | tracer index for graupel | index | 0 | integer | | in | F | -!! | ntgnc | index_for_graupel_number_concentration | tracer index for graupel number concentration | index | 0 | integer | | in | F | -!! | xlat | latitude | latitude | radians | 1 | real | kind_phys | in | F | -!! | gq0 | tracer_concentration_updated_by_physics | tracer concentration updated by physics | kg kg-1 | 3 | real | kind_phys | in | F | -!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_zhao_carr | flag_for_zhao_carr_microphysics_scheme | choice of Zhao-Carr microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_zhao_carr_pdf | flag_for_zhao_carr_pdf_microphysics_scheme | choice of Zhao-Carr microphysics scheme with PDF clouds | flag | 0 | integer | | in | F | -!! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_wsm6 | flag_for_wsm6_microphysics_scheme | choice of WSM6 microphysics scheme | flag | 0 | integer | | in | F | -!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | prslk | dimensionless_exner_function_at_model_layers | dimensionless Exner function at model layer centers | none | 2 | real | kind_phys | in | F | -!! | rhcbot | critical_relative_humidity_at_surface | critical relative humidity at the surface | frac | 0 | real | kind_phys | in | F | -!! | rhcpbl | critical_relative_humidity_at_PBL_top | critical relative humidity at the PBL top | frac | 0 | real | kind_phys | in | F | -!! | rhctop | critical_relative_humidity_at_top_of_atmosphere | critical relative humidity at the top of atmosphere | frac | 0 | real | kind_phys | in | F | -!! | rhcmax | maximum_critical_relative_humidity | maximum critical relative humidity | frac | 0 | real | kind_phys | in | F | -!! | islmsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | in | F | -!! | work1 | grid_size_related_coefficient_used_in_scale_sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | -!! | work2 | grid_size_related_coefficient_used_in_scale_sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | in | F | -!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | vertical index at top atmospheric boundary layer | index | 1 | integer | | in | F | -!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | in | F | -!! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | inout | F | -!! | rhc | critical_relative_humidity | critical relative humidity | frac | 2 | real | kind_phys | inout | F | -!! | save_qc | cloud_condensed_water_mixing_ratio_save | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | save_qi | ice_water_mixing_ratio_save | cloud ice water mixing ratio before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_suite_interstitial_3_run.html !! #endif subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, satmedmf, trans_trac, do_shoc, ltaerosol, ntrac, ntcw, & @@ -772,40 +611,7 @@ subroutine GFS_suite_interstitial_4_finalize() end subroutine GFS_suite_interstitial_4_finalize !> \section arg_table_GFS_suite_interstitial_4_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------------------|-------------------------------------------------------------------------------|-------------------------------------------------------------------|---------------|------|------------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | ltaerosol | flag_for_aerosol_physics | flag for aerosol physics | flag | 0 | logical | | in | F | -!! | lgocart | flag_gocart | flag for 3d diagnostic fields for gocart 1 | flag | 0 | logical | | in | F | -!! | tracers_total | number_of_total_tracers | total number of tracers | count | 0 | integer | | in | F | -!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | tracer index for cloud condensate (or liquid water) | index | 0 | integer | | in | F | -!! | ntiw | index_for_ice_cloud_condensate | tracer index for ice water | index | 0 | integer | | in | F | -!! | ntclamt | index_for_cloud_amount | tracer index for cloud amount integer | index | 0 | integer | | in | F | -!! | ntrw | index_for_rain_water | tracer index for rain water | index | 0 | integer | | in | F | -!! | ntsw | index_for_snow_water | tracer index for snow water | index | 0 | integer | | in | F | -!! | ntrnc | index_for_rain_number_concentration | tracer index for rain number concentration | index | 0 | integer | | in | F | -!! | ntsnc | index_for_snow_number_concentration | tracer index for snow number concentration | index | 0 | integer | | in | F | -!! | ntgl | index_for_graupel | tracer index for graupel | index | 0 | integer | | in | F | -!! | ntgnc | index_for_graupel_number_concentration | tracer index for graupel number concentration | index | 0 | integer | | in | F | -!! | ntlnc | index_for_liquid_cloud_number_concentration | tracer index for liquid number concentration | index | 0 | integer | | in | F | -!! | ntinc | index_for_ice_cloud_number_concentration | tracer index for ice number concentration | index | 0 | integer | | in | F | -!! | nn | number_of_tracers_for_convective_transport | number of tracers for convective transport | count | 0 | integer | | in | F | -!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_zhao_carr | flag_for_zhao_carr_microphysics_scheme | choice of Zhao-Carr microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_zhao_carr_pdf | flag_for_zhao_carr_pdf_microphysics_scheme | choice of Zhao-Carr microphysics scheme with PDF clouds | flag | 0 | integer | | in | F | -!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | -!! | save_qc | cloud_condensed_water_mixing_ratio_save | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | in | F | -!! | save_qi | ice_water_mixing_ratio_save | cloud ice water mixing ratio before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | in | F | -!! | con_pi | pi | ratio of a circle's circumference to its diameter | radians | 0 | real | kind_phys | in | F | -!! | gq0 | tracer_concentration_updated_by_physics | tracer concentration updated by physics | kg kg-1 | 3 | real | kind_phys | inout | F | -!! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | inout | F | -!! | dqdti | instantaneous_water_vapor_specific_humidity_tendency_due_to_convection | instantaneous moisture tendency due to convection | kg kg-1 s-1 | 2 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_suite_interstitial_4_run.html !! subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, lgocart, tracers_total, ntrac, ntcw, ntiw, ntclamt, & ntrw, ntsw, ntrnc, ntsnc, ntgl, ntgnc, ntlnc, ntinc, nn, imp_physics, imp_physics_gfdl, imp_physics_thompson, & diff --git a/physics/GFS_suite_interstitial.meta b/physics/GFS_suite_interstitial.meta new file mode 100644 index 000000000..feefe3da3 --- /dev/null +++ b/physics/GFS_suite_interstitial.meta @@ -0,0 +1,1627 @@ +[ccpp-arg-table] + name = GFS_suite_interstitial_rad_reset_run + type = scheme +[Interstitial] + standard_name = GFS_interstitial_type_instance + long_name = derived type GFS_interstitial_type in FV3 + units = DDT + dimensions = () + type = GFS_interstitial_type + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_suite_interstitial_phys_reset_run + type = scheme +[Interstitial] + standard_name = GFS_interstitial_type_instance + long_name = derived type GFS_interstitial_type in FV3 + units = DDT + dimensions = () + type = GFS_interstitial_type + intent = inout + optional = F +[Model] + standard_name = GFS_control_type_instance + long_name = Fortran DDT containing FV3-GFS model control parameters + units = DDT + dimensions = () + type = GFS_control_type + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_suite_interstitial_1_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F +[dtf] + standard_name = time_step_for_dynamics + long_name = dynamics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dtp] + standard_name = time_step_for_physics + long_name = physics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[slmsk] + standard_name = sea_land_ice_mask_real + long_name = landmask: sea/land/ice=0/1/2 + units = flag + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[area] + standard_name = cell_area + long_name = area of the grid cell + units = m2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dxmin] + standard_name = minimum_scaling_factor_for_critical_relative_humidity + long_name = minimum scaling factor for critical relative humidity + units = m2 rad-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dxinv] + standard_name = inverse_scaling_factor_for_critical_relative_humidity + long_name = inverse scaling factor for critical relative humidity + units = rad2 m-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[pgr] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[frain] + standard_name = dynamics_to_physics_timestep_ratio + long_name = ratio of dynamics timestep to physics timestep + units = none + dimensions = () + type = real + kind = kind_phys + intent = out + optional = F +[islmsk] + standard_name = sea_land_ice_mask + long_name = landmask: sea/land/ice=0/1/2 + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[work1] + standard_name = grid_size_related_coefficient_used_in_scale_sensitive_schemes + long_name = grid size related coefficient used in scale-sensitive schemes + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[work2] + standard_name = grid_size_related_coefficient_used_in_scale_sensitive_schemes_complement + long_name = complement to work1 + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[psurf] + standard_name = surface_air_pressure_diag + long_name = surface air pressure diagnostic + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dudt] + standard_name = tendency_of_x_wind_due_to_model_physics + long_name = updated tendency of the x wind + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dvdt] + standard_name = tendency_of_y_wind_due_to_model_physics + long_name = updated tendency of the y wind + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dtdt] + standard_name = tendency_of_air_temperature_due_to_model_physics + long_name = updated tendency of the temperature + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dtdtc] + standard_name = tendency_of_air_temperature_due_to_radiative_heating_assuming_clear_sky + long_name = clear sky radiative (shortwave + longwave) heating rate at current time + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dqdt] + standard_name = tendency_of_tracers_due_to_model_physics + long_name = updated tendency of the tracers + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_suite_interstitial_2_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[lssav] + standard_name = flag_diagnostics + long_name = logical flag for storing diagnostics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for 3d diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lsidea] + standard_name = flag_idealized_physics + long_name = flag for idealized physics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[cplflx] + standard_name = flag_for_flux_coupling + long_name = flag controlling cplflx collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[flag_cice] + standard_name = flag_for_cice + long_name = flag for cice + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[shal_cnv] + standard_name = flag_for_shallow_convection + long_name = flag for calling shallow convection + units = flag + dimensions = () + type = logical + intent = in + optional = F +[old_monin] + standard_name = flag_for_old_PBL_scheme + long_name = flag for using old PBL schemes + units = flag + dimensions = () + type = logical + intent = in + optional = F +[mstrat] + standard_name = flag_for_moorthi_stratus + long_name = flag for moorthi approach for stratus + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_shoc] + standard_name = flag_for_shoc + long_name = flag for SHOC + units = flag + dimensions = () + type = logical + intent = in + optional = F +[imfshalcnv] + standard_name = flag_for_mass_flux_shallow_convection_scheme + long_name = flag for mass-flux shallow convection scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[dtf] + standard_name = time_step_for_dynamics + long_name = dynamics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[xcosz] + standard_name = instantaneous_cosine_of_zenith_angle + long_name = cosine of zenith angle at current time + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[adjsfcdsw] + standard_name = surface_downwelling_shortwave_flux + long_name = surface downwelling shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[adjsfcdlw] + standard_name = surface_downwelling_longwave_flux + long_name = surface downwelling longwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[pgr] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ulwsfc_cice] + standard_name = surface_upwelling_longwave_flux_for_coupling + long_name = surface upwelling longwave flux for coupling + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[lwhd] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_for_idea + long_name = idea sky lw heating rates + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension,6) + type = real + kind = kind_phys + intent = in + optional = F +[htrsw] + standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep + long_name = total sky sw heating rate + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[htrlw] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep + long_name = total sky lw heating rate + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[xmu] + standard_name = zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes + long_name = zenith angle temporal adjustment factor for shortwave fluxes + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ctei_rm] + standard_name = critical_cloud_top_entrainment_instability_criteria + long_name = critical cloud top entrainment instability criteria + units = none + dimensions = (2) + type = real + kind = kind_phys + intent = in + optional = F +[work1] + standard_name = grid_size_related_coefficient_used_in_scale_sensitive_schemes + long_name = grid size related coefficient used in scale-sensitive schemes + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[work2] + standard_name = grid_size_related_coefficient_used_in_scale_sensitive_schemes_complement + long_name = complement to work1 + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsi] + standard_name = air_pressure_at_interface + long_name = air pressure at model layer interfaces + units = Pa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[tgrs] + standard_name = air_temperature + long_name = model layer mean temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qgrs_water_vapor] + standard_name = water_vapor_specific_humidity + long_name = water vapor specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qgrs_cloud_water] + standard_name = cloud_condensed_water_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[prslk] + standard_name = dimensionless_exner_function_at_model_layers + long_name = dimensionless Exner function at model layer centers + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[suntim] + standard_name = duration_of_sunshine + long_name = sunshine duration time + units = s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[adjsfculw] + standard_name = surface_upwelling_longwave_flux + long_name = surface upwelling longwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dlwsfc] + standard_name = cumulative_surface_downwelling_longwave_flux_multiplied_by_timestep + long_name = cumulative surface downwelling LW flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ulwsfc] + standard_name = cumulative_surface_upwelling_longwave_flux_multiplied_by_timestep + long_name = cumulative surface upwelling LW flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[psmean] + standard_name = cumulative_surface_pressure_multiplied_by_timestep + long_name = cumulative surface pressure multiplied by timestep + units = Pa s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dt3dt_lw] + standard_name = cumulative_change_in_temperature_due_to_longwave_radiation + long_name = cumulative change in temperature due to longwave radiation + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dt3dt_sw] + standard_name = cumulative_change_in_temperature_due_to_shortwave_radiation + long_name = cumulative change in temperature due to shortwave radiation + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dt3dt_pbl] + standard_name = cumulative_change_in_temperature_due_to_PBL + long_name = cumulative change in temperature due to PBL + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dt3dt_dcnv] + standard_name = cumulative_change_in_temperature_due_to_deep_convection + long_name = cumulative change in temperature due to deep conv. + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dt3dt_scnv] + standard_name = cumulative_change_in_temperature_due_to_shal_convection + long_name = cumulative change in temperature due to shal conv. + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dt3dt_mp] + standard_name = cumulative_change_in_temperature_due_to_microphysics + long_name = cumulative change in temperature due to microphysics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ctei_rml] + standard_name = grid_sensitive_critical_cloud_top_entrainment_instability_criteria + long_name = grid sensitive critical cloud top entrainment instability criteria + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ctei_r] + standard_name = cloud_top_entrainment_instability_value + long_name = cloud top entrainment instability value + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[kinver] + standard_name = index_of_highest_temperature_inversion + long_name = index of highest temperature inversion + units = index + dimensions = (horizontal_dimension) + type = integer + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_suite_stateout_reset_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F +[tgrs] + standard_name = air_temperature + long_name = model layer mean temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ugrs] + standard_name = x_wind + long_name = zonal wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[vgrs] + standard_name = y_wind + long_name = meridional wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qgrs] + standard_name = tracer_concentration + long_name = model layer mean tracer concentration + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = in + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[gu0] + standard_name = x_wind_updated_by_physics + long_name = zonal wind updated by physics + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[gv0] + standard_name = y_wind_updated_by_physics + long_name = meridional wind updated by physics + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[gq0] + standard_name = tracer_concentration_updated_by_physics + long_name = tracer concentration updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_suite_stateout_update_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F +[dtp] + standard_name = time_step_for_physics + long_name = physics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[tgrs] + standard_name = air_temperature + long_name = model layer mean temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ugrs] + standard_name = x_wind + long_name = zonal wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[vgrs] + standard_name = y_wind + long_name = meridional wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qgrs] + standard_name = tracer_concentration + long_name = model layer mean tracer concentration + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = in + optional = F +[dudt] + standard_name = tendency_of_x_wind_due_to_model_physics + long_name = updated tendency of the x wind + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dvdt] + standard_name = tendency_of_y_wind_due_to_model_physics + long_name = updated tendency of the y wind + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dtdt] + standard_name = tendency_of_air_temperature_due_to_model_physics + long_name = updated tendency of the temperature + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dqdt] + standard_name = tendency_of_tracers_due_to_model_physics + long_name = updated tendency of the tracers + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = in + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[gu0] + standard_name = x_wind_updated_by_physics + long_name = zonal wind updated by physics + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[gv0] + standard_name = y_wind_updated_by_physics + long_name = meridional wind updated by physics + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[gq0] + standard_name = tracer_concentration_updated_by_physics + long_name = tracer concentration updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_suite_interstitial_3_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[nn] + standard_name = number_of_tracers_for_convective_transport + long_name = number of tracers for convective transport + units = count + dimensions = () + type = integer + intent = in + optional = F +[cscnv] + standard_name = flag_for_Chikira_Sugiyama_deep_convection + long_name = flag for Chikira-Sugiyama convection + units = flag + dimensions = () + type = logical + intent = in + optional = F +[satmedmf] + standard_name = flag_for_scale_aware_TKE_moist_EDMF_PBL + long_name = flag for scale-aware TKE moist EDMF PBL scheme + units = flag + dimensions = () + type = logical + intent = in + optional = F +[trans_trac] + standard_name = flag_for_convective_transport_of_tracers + long_name = flag for convective transport of tracers + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_shoc] + standard_name = flag_for_shoc + long_name = flag for SHOC + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ltaerosol] + standard_name = flag_for_aerosol_physics + long_name = flag for aerosol physics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntcw] + standard_name = index_for_liquid_cloud_condensate + long_name = tracer index for cloud condensate (or liquid water) + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntiw] + standard_name = index_for_ice_cloud_condensate + long_name = tracer index for ice water + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntclamt] + standard_name = index_for_cloud_amount + long_name = tracer index for cloud amount integer + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntrw] + standard_name = index_for_rain_water + long_name = tracer index for rain water + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntsw] + standard_name = index_for_snow_water + long_name = tracer index for snow water + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntrnc] + standard_name = index_for_rain_number_concentration + long_name = tracer index for rain number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntsnc] + standard_name = index_for_snow_number_concentration + long_name = tracer index for snow number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntgl] + standard_name = index_for_graupel + long_name = tracer index for graupel + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntgnc] + standard_name = index_for_graupel_number_concentration + long_name = tracer index for graupel number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[xlat] + standard_name = latitude + long_name = latitude + units = radians + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0] + standard_name = tracer_concentration_updated_by_physics + long_name = tracer concentration updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = in + optional = F +[imp_physics] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_mg] + standard_name = flag_for_morrison_gettelman_microphysics_scheme + long_name = choice of Morrison-Gettelman microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_zhao_carr] + standard_name = flag_for_zhao_carr_microphysics_scheme + long_name = choice of Zhao-Carr microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_zhao_carr_pdf] + standard_name = flag_for_zhao_carr_pdf_microphysics_scheme + long_name = choice of Zhao-Carr microphysics scheme with PDF clouds + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_gfdl] + standard_name = flag_for_gfdl_microphysics_scheme + long_name = choice of GFDL microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_thompson] + standard_name = flag_for_thompson_microphysics_scheme + long_name = choice of Thompson microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_wsm6] + standard_name = flag_for_wsm6_microphysics_scheme + long_name = choice of WSM6 microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[prsi] + standard_name = air_pressure_at_interface + long_name = air pressure at model layer interfaces + units = Pa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslk] + standard_name = dimensionless_exner_function_at_model_layers + long_name = dimensionless Exner function at model layer centers + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rhcbot] + standard_name = critical_relative_humidity_at_surface + long_name = critical relative humidity at the surface + units = frac + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rhcpbl] + standard_name = critical_relative_humidity_at_PBL_top + long_name = critical relative humidity at the PBL top + units = frac + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rhctop] + standard_name = critical_relative_humidity_at_top_of_atmosphere + long_name = critical relative humidity at the top of atmosphere + units = frac + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rhcmax] + standard_name = maximum_critical_relative_humidity + long_name = maximum critical relative humidity + units = frac + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[islmsk] + standard_name = sea_land_ice_mask + long_name = sea/land/ice mask (=0/1/2) + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[work1] + standard_name = grid_size_related_coefficient_used_in_scale_sensitive_schemes + long_name = grid size related coefficient used in scale-sensitive schemes + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[work2] + standard_name = grid_size_related_coefficient_used_in_scale_sensitive_schemes_complement + long_name = complement to work1 + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[kpbl] + standard_name = vertical_index_at_top_of_atmosphere_boundary_layer + long_name = vertical index at top atmospheric boundary layer + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[kinver] + standard_name = index_of_highest_temperature_inversion + long_name = index of highest temperature inversion + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[clw] + standard_name = convective_transportable_tracers + long_name = array to contain cloud water and other convective trans. tracers + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers_for_convective_transport) + type = real + kind = kind_phys + intent = inout + optional = F +[rhc] + standard_name = critical_relative_humidity + long_name = critical relative humidity + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[save_qc] + standard_name = cloud_condensed_water_mixing_ratio_save + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[save_qi] + standard_name = ice_water_mixing_ratio_save + long_name = cloud ice water mixing ratio before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_suite_interstitial_4_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[ltaerosol] + standard_name = flag_for_aerosol_physics + long_name = flag for aerosol physics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lgocart] + standard_name = flag_gocart + long_name = flag for 3d diagnostic fields for gocart 1 + units = flag + dimensions = () + type = logical + intent = in + optional = F +[tracers_total] + standard_name = number_of_total_tracers + long_name = total number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntcw] + standard_name = index_for_liquid_cloud_condensate + long_name = tracer index for cloud condensate (or liquid water) + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntiw] + standard_name = index_for_ice_cloud_condensate + long_name = tracer index for ice water + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntclamt] + standard_name = index_for_cloud_amount + long_name = tracer index for cloud amount integer + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntrw] + standard_name = index_for_rain_water + long_name = tracer index for rain water + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntsw] + standard_name = index_for_snow_water + long_name = tracer index for snow water + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntrnc] + standard_name = index_for_rain_number_concentration + long_name = tracer index for rain number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntsnc] + standard_name = index_for_snow_number_concentration + long_name = tracer index for snow number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntgl] + standard_name = index_for_graupel + long_name = tracer index for graupel + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntgnc] + standard_name = index_for_graupel_number_concentration + long_name = tracer index for graupel number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntlnc] + standard_name = index_for_liquid_cloud_number_concentration + long_name = tracer index for liquid number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntinc] + standard_name = index_for_ice_cloud_number_concentration + long_name = tracer index for ice number concentration + units = index + dimensions = () + type = integer + intent = in + optional = F +[nn] + standard_name = number_of_tracers_for_convective_transport + long_name = number of tracers for convective transport + units = count + dimensions = () + type = integer + intent = in + optional = F +[imp_physics] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_gfdl] + standard_name = flag_for_gfdl_microphysics_scheme + long_name = choice of GFDL microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_thompson] + standard_name = flag_for_thompson_microphysics_scheme + long_name = choice of Thompson microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_zhao_carr] + standard_name = flag_for_zhao_carr_microphysics_scheme + long_name = choice of Zhao-Carr microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_zhao_carr_pdf] + standard_name = flag_for_zhao_carr_pdf_microphysics_scheme + long_name = choice of Zhao-Carr microphysics scheme with PDF clouds + units = flag + dimensions = () + type = integer + intent = in + optional = F +[dtf] + standard_name = time_step_for_dynamics + long_name = dynamics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[save_qc] + standard_name = cloud_condensed_water_mixing_ratio_save + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[save_qi] + standard_name = ice_water_mixing_ratio_save + long_name = cloud ice water mixing ratio before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[con_pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = radians + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[gq0] + standard_name = tracer_concentration_updated_by_physics + long_name = tracer concentration updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = inout + optional = F +[clw] + standard_name = convective_transportable_tracers + long_name = array to contain cloud water and other convective trans. tracers + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers_for_convective_transport) + type = real + kind = kind_phys + intent = inout + optional = F +[dqdti] + standard_name = instantaneous_water_vapor_specific_humidity_tendency_due_to_convection + long_name = instantaneous moisture tendency due to convection + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index 8acf186c1..e6c91abd7 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -17,71 +17,7 @@ end subroutine GFS_surface_generic_pre_finalize #if 0 !> \section arg_table_GFS_surface_generic_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|------------------------------------------------------------------------------|------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | vfrac | vegetation_area_fraction | areal fractional cover of green vegetation | frac | 1 | real | kind_phys | in | F | -!! | islmsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | -!! | isot | soil_type_dataset_choice | soil type dataset choice | index | 0 | integer | | in | F | -!! | ivegsrc | vegetation_type_dataset_choice | land use dataset choice | index | 0 | integer | | in | F | -!! | stype | soil_type_classification_real | soil type for lsm | index | 1 | real | kind_phys | in | F | -!! | vtype | vegetation_type_classification_real | vegetation type for lsm | index | 1 | real | kind_phys | in | F | -!! | slope | surface_slope_classification_real | sfc slope type for lsm | index | 1 | real | kind_phys | in | F | -!! | prsik_1 | dimensionless_exner_function_at_lowest_model_interface | dimensionless Exner function at lowest model interface | none | 1 | real | kind_phys | in | F | -!! | prslk_1 | dimensionless_exner_function_at_lowest_model_layer | dimensionless Exner function at lowest model layer | none | 1 | real | kind_phys | in | F | -!! | semis | surface_longwave_emissivity | surface lw emissivity in fraction | frac | 1 | real | kind_phys | in | F | -!! | adjsfcdlw | surface_downwelling_longwave_flux | surface downwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | inout | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | sigmaf | bounded_vegetation_area_fraction | areal fractional cover of green vegetation bounded on the bottom | frac | 1 | real | kind_phys | inout | F | -!! | soiltyp | soil_type_classification | soil type at each grid cell | index | 1 | integer | | inout | F | -!! | vegtype | vegetation_type_classification | vegetation type at each grid cell | index | 1 | integer | | inout | F | -!! | slopetyp | surface_slope_classification | surface slope type at each grid cell | index | 1 | integer | | inout | F | -!! | work3 | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | inout | F | -!! | gabsbdlw | surface_downwelling_longwave_flux_absorbed_by_ground | total sky surface downward longwave flux absorbed by the ground | W m-2 | 1 | real | kind_phys | inout | F | -!! | tsurf | surface_skin_temperature_after_iteration | surface skin temperature after iteration | K | 1 | real | kind_phys | inout | F | -!! | zlvl | height_above_ground_at_lowest_model_layer | layer 1 height above ground (not MSL) | m | 1 | real | kind_phys | inout | F | -!! | do_sppt | flag_for_stochastic_surface_physics_perturbations | flag for stochastic surface physics perturbations | flag | 0 | logical | | in | F | -!! | dtdtr | tendency_of_air_temperature_due_to_radiative_heating_on_physics_time_step | temp. change due to radiative heating per time step | K | 2 | real | kind_phys | out | F | -!! | drain_cpl | tendency_of_lwe_thickness_of_precipitation_amount_for_coupling | change in rain_cpl (coupling_type) | m | 1 | real | kind_phys | out | F | -!! | dsnow_cpl | tendency_of_lwe_thickness_of_snow_amount_for_coupling | change in show_cpl (coupling_type) | m | 1 | real | kind_phys | out | F | -!! | rain_cpl | lwe_thickness_of_precipitation_amount_for_coupling | total rain precipitation | m | 1 | real | kind_phys | in | F | -!! | snow_cpl | lwe_thickness_of_snow_amount_for_coupling | total snow precipitation | m | 1 | real | kind_phys | in | F | -!! | do_sfcperts | flag_for_stochastic_surface_perturbations | flag for stochastic surface perturbations option | flag | 0 | logical | | in | F | -!! | nsfcpert | number_of_surface_perturbations | number of surface perturbations | count | 0 | integer | | in | F | -!! | sfc_wts | weights_for_stochastic_surface_physics_perturbation | weights for stochastic surface physics perturbation | none | 2 | real | kind_phys | in | F | -!! | pertz0 | magnitude_of_perturbation_of_momentum_roughness_length | magnitude of perturbation of momentum roughness length | frac | 1 | real | kind_phys | in | F | -!! | pertzt | magnitude_of_perturbation_of_heat_to_momentum_roughness_length_ratio | magnitude of perturbation of heat to momentum roughness length r.| frac | 1 | real | kind_phys | in | F | -!! | pertshc | magnitude_of_perturbation_of_soil_type_b_parameter | magnitude of perturbation of soil type b parameter | frac | 1 | real | kind_phys | in | F | -!! | pertlai | magnitude_of_perturbation_of_leaf_area_index | magnitude of perturbation of leaf area index | frac | 1 | real | kind_phys | in | F | -!! | pertvegf | magnitude_of_perturbation_of_vegetation_fraction | magnitude of perturbation of vegetation fraction | frac | 1 | real | kind_phys | in | F | -!! | z01d | perturbation_of_momentum_roughness_length | perturbation of momentum roughness length | frac | 1 | real | kind_phys | out | F | -!! | zt1d | perturbation_of_heat_to_momentum_roughness_length_ratio | perturbation of heat to momentum roughness length ratio | frac | 1 | real | kind_phys | out | F | -!! | bexp1d | perturbation_of_soil_type_b_parameter | perturbation of soil type "b" parameter | frac | 1 | real | kind_phys | out | F | -!! | xlai1d | perturbation_of_leaf_area_index | perturbation of leaf area index | frac | 1 | real | kind_phys | out | F | -!! | vegf1d | perturbation_of_vegetation_fraction | perturbation of vegetation fraction | frac | 1 | real | kind_phys | out | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | -!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | inout | F | -!! | islmsk_cice | sea_land_ice_mask_cice | sea/land/ice mask cice (=0/1/2) | flag | 1 | integer | | in | F | -!! | slimskin_cpl | sea_land_ice_mask_in | sea/land/ice mask input (=0/1/2) | flag | 1 | real | kind_phys | in | F | -!! | dusfcin_cpl | surface_x_momentum_flux_for_coupling | sfc x momentum flux for coupling | Pa | 1 | real | kind_phys | in | F | -!! | dvsfcin_cpl | surface_y_momentum_flux_for_coupling | sfc y momentum flux for coupling | Pa | 1 | real | kind_phys | in | F | -!! | dtsfcin_cpl | surface_upward_sensible_heat_flux_for_coupling | sfc sensible heat flux input | W m-2 | 1 | real | kind_phys | in | F | -!! | dqsfcin_cpl | surface_upward_latent_heat_flux_for_coupling | sfc latent heat flux input for coupling | W m-2 | 1 | real | kind_phys | in | F | -!! | ulwsfcin_cpl | surface_upwelling_longwave_flux_for_coupling | surface upwelling LW flux for coupling | W m-2 | 1 | real | kind_phys | in | F | -!! | ulwsfc_cice | surface_upwelling_longwave_flux_for_coupling_interstitial | surface upwelling longwave flux for coupling interstitial | W m-2 | 1 | real | kind_phys | out | F | -!! | dusfc_cice | surface_x_momentum_flux_for_coupling_interstitial | sfc x momentum flux for coupling interstitial | Pa | 1 | real | kind_phys | out | F | -!! | dvsfc_cice | surface_y_momentum_flux_for_coupling_interstitial | sfc y momentum flux for coupling interstitial | Pa | 1 | real | kind_phys | out | F | -!! | dtsfc_cice | surface_upward_sensible_heat_flux_for_coupling_interstitial | sfc sensible heat flux for coupling interstitial | W m-2 | 1 | real | kind_phys | out | F | -!! | dqsfc_cice | surface_upward_latent_heat_flux_for_coupling_interstitial | sfc latent heat flux for coupling interstitial | W m-2 | 1 | real | kind_phys | out | F | -!! | tisfc | sea_ice_temperature | sea-ice surface temperature | K | 1 | real | kind_phys | in | F | -!! | tsfco | sea_surface_temperature | sea surface temperature | K | 1 | real | kind_phys | in | F | -!! | fice | sea_ice_concentration | sea-ice concentration [0,1] | frac | 1 | real | kind_phys | in | F | -!! | hice | sea_ice_thickness | sea-ice thickness | m | 1 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_surface_generic_pre_run.html !! #endif subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, stype, vtype, slope, & @@ -289,95 +225,7 @@ subroutine GFS_surface_generic_post_finalize() end subroutine GFS_surface_generic_post_finalize #if 0 !> \section arg_table_GFS_surface_generic_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|---------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|-------------|------|------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | -!! | cplwav | flag_for_wave_coupling | flag controlling cplwav collection (default off) | flag | 0 | logical | | in | F | -!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | -!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | -!! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | -!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | -!! | ep1d | surface_upward_potential_latent_heat_flux | surface upward potential latent heat flux | W m-2 | 1 | real | kind_phys | in | F | -!! | gflx | upward_heat_flux_in_soil | upward soil heat flux | W m-2 | 1 | real | kind_phys | in | F | -!! | tgrs_1 | air_temperature_at_lowest_model_layer | mean temperature at lowest model layer | K | 1 | real | kind_phys | in | F | -!! | qgrs_1 | water_vapor_specific_humidity_at_lowest_model_layer | specific humidity at lowest model layer | kg kg-1 | 1 | real | kind_phys | in | F | -!! | ugrs_1 | x_wind_at_lowest_model_layer | zonal wind at lowest model layer | m s-1 | 1 | real | kind_phys | in | F | -!! | vgrs_1 | y_wind_at_lowest_model_layer | meridional wind at lowest model layer | m s-1 | 1 | real | kind_phys | in | F | -!! | adjsfcdlw | surface_downwelling_longwave_flux | surface downwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | adjsfcdsw | surface_downwelling_shortwave_flux | surface downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | adjnirbmd | surface_downwelling_direct_near_infrared_shortwave_flux | surface downwelling beam near-infrared shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | adjnirdfd | surface_downwelling_diffuse_near_infrared_shortwave_flux | surface downwelling diffuse near-infrared shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | adjvisbmd | surface_downwelling_direct_ultraviolet_and_visible_shortwave_flux | surface downwelling beam ultraviolet plus visible shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | adjvisdfd | surface_downwelling_diffuse_ultraviolet_and_visible_shortwave_flux | surface downwelling diffuse ultraviolet plus visible shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | adjsfculw | surface_upwelling_longwave_flux | surface upwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | adjnirbmu | surface_upwelling_direct_near_infrared_shortwave_flux | surface upwelling beam near-infrared shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | adjnirdfu | surface_upwelling_diffuse_near_infrared_shortwave_flux | surface upwelling diffuse near-infrared shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | adjvisbmu | surface_upwelling_direct_ultraviolet_and_visible_shortwave_flux | surface upwelling beam ultraviolet plus visible shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | adjvisdfu | surface_upwelling_diffuse_ultraviolet_and_visible_shortwave_flux | surface upwelling diffuse ultraviolet plus visible shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | t2m | temperature_at_2m | 2 meter temperature | K | 1 | real | kind_phys | in | F | -!! | q2m | specific_humidity_at_2m | 2 meter specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | u10m | x_wind_at_10m | 10 meter u wind speed | m s-1 | 1 | real | kind_phys | in | F | -!! | v10m | y_wind_at_10m | 10 meter v wind speed | m s-1 | 1 | real | kind_phys | in | F | -!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | -!! | pgr | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | xcosz | instantaneous_cosine_of_zenith_angle | cosine of zenith angle at current time | none | 1 | real | kind_phys | in | F | -!! | evbs | soil_upward_latent_heat_flux | soil upward latent heat flux | W m-2 | 1 | real | kind_phys | in | F | -!! | evcw | canopy_upward_latent_heat_flux | canopy upward latent heat flux | W m-2 | 1 | real | kind_phys | in | F | -!! | trans | transpiration_flux | total plant transpiration rate | W m-2 | 1 | real | kind_phys | in | F | -!! | sbsno | snow_deposition_sublimation_upward_latent_heat_flux | latent heat flux from snow depo/subl | W m-2 | 1 | real | kind_phys | in | F | -!! | snowc | surface_snow_area_fraction | surface snow area fraction | frac | 1 | real | kind_phys | in | F | -!! | snohf | snow_freezing_rain_upward_latent_heat_flux | latent heat flux due to snow and frz rain | W m-2 | 1 | real | kind_phys | in | F | -!! | epi | instantaneous_surface_potential_evaporation | instantaneous sfc potential evaporation | W m-2 | 1 | real | kind_phys | inout | F | -!! | gfluxi | instantaneous_surface_ground_heat_flux | instantaneous sfc ground heat flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | t1 | air_temperature_at_lowest_model_layer_for_diag | layer 1 temperature for diag | K | 1 | real | kind_phys | inout | F | -!! | q1 | water_vapor_specific_humidity_at_lowest_model_layer_for_diag | layer 1 specific humidity for diag | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | u1 | x_wind_at_lowest_model_layer_for_diag | layer 1 x wind for diag | m s-1 | 1 | real | kind_phys | inout | F | -!! | v1 | y_wind_at_lowest_model_layer_for_diag | layer 1 y wind for diag | m s-1 | 1 | real | kind_phys | inout | F | -!! | dlwsfci_cpl | instantaneous_surface_downwelling_longwave_flux_for_coupling | instantaneous sfc downward lw flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | dswsfci_cpl | instantaneous_surface_downwelling_shortwave_flux_for_coupling | instantaneous sfc downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | dlwsfc_cpl | cumulative_surface_downwelling_longwave_flux_for_coupling_multiplied_by_timestep | cumulative sfc downward lw flux mulitplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | dswsfc_cpl | cumulative_surface_downwelling_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative sfc downward sw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | dnirbmi_cpl | instantaneous_surface_downwelling_direct_near_infrared_shortwave_flux_for_coupling | instantaneous sfc nir beam downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | dnirdfi_cpl | instantaneous_surface_downwelling_diffuse_near_infrared_shortwave_flux_for_coupling | instantaneous sfc nir diff downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | dvisbmi_cpl | instantaneous_surface_downwelling_direct_ultraviolet_and_visible_shortwave_flux_for_coupling | instantaneous sfc uv+vis beam downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | dvisdfi_cpl | instantaneous_surface_downwelling_diffuse_ultraviolet_and_visible_shortwave_flux_for_coupling | instantaneous sfc uv+vis diff downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | dnirbm_cpl | cumulative_surface_downwelling_direct_near_infrared_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative sfc nir beam downward sw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | dnirdf_cpl | cumulative_surface_downwelling_diffuse_near_infrared_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative sfc nir diff downward sw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | dvisbm_cpl | cumulative_surface_downwelling_direct_ultraviolet_and_visible_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative sfc uv+vis beam dnwd sw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | dvisdf_cpl | cumulative_surface_downwelling_diffuse_ultraviolet_and_visible_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative sfc uv+vis diff dnwd sw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | nlwsfci_cpl | instantaneous_surface_net_downward_longwave_flux_for_coupling | instantaneous net sfc downward lw flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | nlwsfc_cpl | cumulative_surface_net_downward_longwave_flux_for_coupling_multiplied_by_timestep | cumulative net downward lw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | t2mi_cpl | instantaneous_temperature_at_2m_for_coupling | instantaneous T2m | K | 1 | real | kind_phys | inout | F | -!! | q2mi_cpl | instantaneous_specific_humidity_at_2m_for_coupling | instantaneous Q2m | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | u10mi_cpl | instantaneous_x_wind_at_10m_for_coupling | instantaneous U10m | m s-1 | 1 | real | kind_phys | inout | F | -!! | v10mi_cpl | instantaneous_y_wind_at_10m_for_coupling | instantaneous V10m | m s-1 | 1 | real | kind_phys | inout | F | -!! | tsfci_cpl | instantaneous_surface_skin_temperature_for_coupling | instantaneous sfc temperature | K | 1 | real | kind_phys | inout | F | -!! | psurfi_cpl | instantaneous_surface_air_pressure_for_coupling | instantaneous sfc pressure | Pa | 1 | real | kind_phys | inout | F | -!! | nnirbmi_cpl | instantaneous_surface_net_downward_direct_near_infrared_shortwave_flux_for_coupling | instantaneous net nir beam sfc downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | nnirdfi_cpl | instantaneous_surface_net_downward_diffuse_near_infrared_shortwave_flux_for_coupling | instantaneous net nir diff sfc downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | nvisbmi_cpl | instantaneous_surface_net_downward_direct_ultraviolet_and_visible_shortwave_flux_for_coupling | instantaneous net uv+vis beam downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | nvisdfi_cpl | instantaneous_surface_net_downward_diffuse_ultraviolet_and_visible_shortwave_flux_for_coupling | instantaneous net uv+vis diff downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | nswsfci_cpl | instantaneous_surface_net_downward_shortwave_flux_for_coupling | instantaneous net sfc downward sw flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | nswsfc_cpl | cumulative_surface_net_downward_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative net downward sw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | nnirbm_cpl | cumulative_surface_net_downward_direct_near_infrared_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative net nir beam downward sw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | nnirdf_cpl | cumulative_surface_net_downward_diffuse_near_infrared_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative net nir diff downward sw flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | nvisbm_cpl | cumulative_surface_net_downward_direct_ultraviolet_and_visible_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative net uv+vis beam downward sw rad flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | nvisdf_cpl | cumulative_surface_net_downward_diffuse_ultraviolet_and_visible_shortwave_flux_for_coupling_multiplied_by_timestep | cumulative net uv+vis diff downward sw rad flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | gflux | cumulative_surface_ground_heat_flux_multiplied_by_timestep | cumulative groud conductive heat flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | evbsa | cumulative_soil_upward_latent_heat_flux_multiplied_by_timestep | cumulative soil upward latent heat flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | evcwa | cumulative_canopy_upward_latent_heat_flu_multiplied_by_timestep | cumulative canopy upward latent heat flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | transa | cumulative_transpiration_flux_multiplied_by_timestep | cumulative total plant transpiration rate multiplied by timestep | kg m-2 | 1 | real | kind_phys | inout | F | -!! | sbsnoa | cumulative_snow_deposition_sublimation_upward_latent_heat_flux_multiplied_by_timestep | cumulative latent heat flux from snow depo/subl multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | snowca | cumulative_surface_snow_area_fraction_multiplied_by_timestep | cumulative surface snow area fraction multiplied by timestep | s | 1 | real | kind_phys | inout | F | -!! | snohfa | cumulative_snow_freezing_rain_upward_latent_heat_flux_multiplied_by_timestep | cumulative latent heat flux due to snow and frz rain multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | ep | cumulative_surface_upward_potential_latent_heat_flux_multiplied_by_timestep | cumulative surface upward potential latent heat flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | inout | F | -!! | runoff | total_runoff | total water runoff | kg m-2 | 1 | real | kind_phys | inout | F | -!! | srunoff | surface_runoff | surface water runoff (from lsm) | kg m-2 | 1 | real | kind_phys | inout | F | -!! | runof | surface_runoff_flux | surface runoff flux | kg m-2 s-1 | 1 | real | kind_phys | in | F | -!! | drain | subsurface_runoff_flux | subsurface runoff flux | kg m-2 s-1 | 1 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_surface_generic_post_run.html !! #endif subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, icy, wet, dtf, ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1,& diff --git a/physics/GFS_surface_generic.meta b/physics/GFS_surface_generic.meta new file mode 100644 index 000000000..def8cd1b6 --- /dev/null +++ b/physics/GFS_surface_generic.meta @@ -0,0 +1,1336 @@ +[ccpp-arg-table] + name = GFS_surface_generic_pre_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[vfrac] + standard_name = vegetation_area_fraction + long_name = areal fractional cover of green vegetation + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[islmsk] + standard_name = sea_land_ice_mask + long_name = landmask: sea/land/ice=0/1/2 + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[isot] + standard_name = soil_type_dataset_choice + long_name = soil type dataset choice + units = index + dimensions = () + type = integer + intent = in + optional = F +[ivegsrc] + standard_name = vegetation_type_dataset_choice + long_name = land use dataset choice + units = index + dimensions = () + type = integer + intent = in + optional = F +[stype] + standard_name = soil_type_classification_real + long_name = soil type for lsm + units = index + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[vtype] + standard_name = vegetation_type_classification_real + long_name = vegetation type for lsm + units = index + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[slope] + standard_name = surface_slope_classification_real + long_name = sfc slope type for lsm + units = index + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsik_1] + standard_name = dimensionless_exner_function_at_lowest_model_interface + long_name = dimensionless Exner function at lowest model interface + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslk_1] + standard_name = dimensionless_exner_function_at_lowest_model_layer + long_name = dimensionless Exner function at lowest model layer + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[semis] + standard_name = surface_longwave_emissivity + long_name = surface lw emissivity in fraction + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[adjsfcdlw] + standard_name = surface_downwelling_longwave_flux + long_name = surface downwelling longwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsfc] + standard_name = surface_skin_temperature + long_name = surface skin temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[phil] + standard_name = geopotential + long_name = geopotential at model layer centers + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[sigmaf] + standard_name = bounded_vegetation_area_fraction + long_name = areal fractional cover of green vegetation bounded on the bottom + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[soiltyp] + standard_name = soil_type_classification + long_name = soil type at each grid cell + units = index + dimensions = (horizontal_dimension) + type = integer + intent = inout + optional = F +[vegtype] + standard_name = vegetation_type_classification + long_name = vegetation type at each grid cell + units = index + dimensions = (horizontal_dimension) + type = integer + intent = inout + optional = F +[slopetyp] + standard_name = surface_slope_classification + long_name = surface slope type at each grid cell + units = index + dimensions = (horizontal_dimension) + type = integer + intent = inout + optional = F +[work3] + standard_name = ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer + long_name = Exner function ratio bt midlayer and interface at 1st layer + units = ratio + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gabsbdlw] + standard_name = surface_downwelling_longwave_flux_absorbed_by_ground + long_name = total sky surface downward longwave flux absorbed by the ground + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsurf] + standard_name = surface_skin_temperature_after_iteration + long_name = surface skin temperature after iteration + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[zlvl] + standard_name = height_above_ground_at_lowest_model_layer + long_name = layer 1 height above ground (not MSL) + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[do_sppt] + standard_name = flag_for_stochastic_surface_physics_perturbations + long_name = flag for stochastic surface physics perturbations + units = flag + dimensions = () + type = logical + intent = in + optional = F +[dtdtr] + standard_name = tendency_of_air_temperature_due_to_radiative_heating_on_physics_time_step + long_name = temp. change due to radiative heating per time step + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[drain_cpl] + standard_name = tendency_of_lwe_thickness_of_precipitation_amount_for_coupling + long_name = change in rain_cpl (coupling_type) + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dsnow_cpl] + standard_name = tendency_of_lwe_thickness_of_snow_amount_for_coupling + long_name = change in show_cpl (coupling_type) + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[rain_cpl] + standard_name = lwe_thickness_of_precipitation_amount_for_coupling + long_name = total rain precipitation + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snow_cpl] + standard_name = lwe_thickness_of_snow_amount_for_coupling + long_name = total snow precipitation + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[do_sfcperts] + standard_name = flag_for_stochastic_surface_perturbations + long_name = flag for stochastic surface perturbations option + units = flag + dimensions = () + type = logical + intent = in + optional = F +[nsfcpert] + standard_name = number_of_surface_perturbations + long_name = number of surface perturbations + units = count + dimensions = () + type = integer + intent = in + optional = F +[sfc_wts] + standard_name = weights_for_stochastic_surface_physics_perturbation + long_name = weights for stochastic surface physics perturbation + units = none + dimensions = (horizontal_dimension,number_of_surface_perturbations) + type = real + kind = kind_phys + intent = in + optional = F +[pertz0] + standard_name = magnitude_of_perturbation_of_momentum_roughness_length + long_name = magnitude of perturbation of momentum roughness length + units = frac + dimensions = (5) + type = real + kind = kind_phys + intent = in + optional = F +[pertzt] + standard_name = magnitude_of_perturbation_of_heat_to_momentum_roughness_length_ratio + long_name = magnitude of perturbation of heat to momentum roughness length r. + units = frac + dimensions = (5) + type = real + kind = kind_phys + intent = in + optional = F +[pertshc] + standard_name = magnitude_of_perturbation_of_soil_type_b_parameter + long_name = magnitude of perturbation of soil type b parameter + units = frac + dimensions = (5) + type = real + kind = kind_phys + intent = in + optional = F +[pertlai] + standard_name = magnitude_of_perturbation_of_leaf_area_index + long_name = magnitude of perturbation of leaf area index + units = frac + dimensions = (5) + type = real + kind = kind_phys + intent = in + optional = F +[pertvegf] + standard_name = magnitude_of_perturbation_of_vegetation_fraction + long_name = magnitude of perturbation of vegetation fraction + units = frac + dimensions = (5) + type = real + kind = kind_phys + intent = in + optional = F +[z01d] + standard_name = perturbation_of_momentum_roughness_length + long_name = perturbation of momentum roughness length + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[zt1d] + standard_name = perturbation_of_heat_to_momentum_roughness_length_ratio + long_name = perturbation of heat to momentum roughness length ratio + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[bexp1d] + standard_name = perturbation_of_soil_type_b_parameter + long_name = perturbation of soil type "b" parameter + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[xlai1d] + standard_name = perturbation_of_leaf_area_index + long_name = perturbation of leaf area index + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[vegf1d] + standard_name = perturbation_of_vegetation_fraction + long_name = perturbation of vegetation fraction + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cplflx] + standard_name = flag_for_flux_coupling + long_name = flag controlling cplflx collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[flag_cice] + standard_name = flag_for_cice + long_name = flag for cice + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = inout + optional = F +[islmsk_cice] + standard_name = sea_land_ice_mask_cice + long_name = sea/land/ice mask cice (=0/1/2) + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[slimskin_cpl] + standard_name = sea_land_ice_mask_in + long_name = sea/land/ice mask input (=0/1/2) + units = flag + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dusfcin_cpl] + standard_name = surface_x_momentum_flux_for_coupling + long_name = sfc x momentum flux for coupling + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dvsfcin_cpl] + standard_name = surface_y_momentum_flux_for_coupling + long_name = sfc y momentum flux for coupling + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dtsfcin_cpl] + standard_name = surface_upward_sensible_heat_flux_for_coupling + long_name = sfc sensible heat flux input + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dqsfcin_cpl] + standard_name = surface_upward_latent_heat_flux_for_coupling + long_name = sfc latent heat flux input for coupling + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ulwsfcin_cpl] + standard_name = surface_upwelling_longwave_flux_for_coupling + long_name = surface upwelling LW flux for coupling + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ulwsfc_cice] + standard_name = surface_upwelling_longwave_flux_for_coupling_interstitial + long_name = surface upwelling longwave flux for coupling interstitial + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dusfc_cice] + standard_name = surface_x_momentum_flux_for_coupling_interstitial + long_name = sfc x momentum flux for coupling interstitial + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dvsfc_cice] + standard_name = surface_y_momentum_flux_for_coupling_interstitial + long_name = sfc y momentum flux for coupling interstitial + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dtsfc_cice] + standard_name = surface_upward_sensible_heat_flux_for_coupling_interstitial + long_name = sfc sensible heat flux for coupling interstitial + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dqsfc_cice] + standard_name = surface_upward_latent_heat_flux_for_coupling_interstitial + long_name = sfc latent heat flux for coupling interstitial + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[tisfc] + standard_name = sea_ice_temperature + long_name = sea-ice surface temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsfco] + standard_name = sea_surface_temperature + long_name = sea surface temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fice] + standard_name = sea_ice_concentration + long_name = sea-ice concentration [0,1] + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[hice] + standard_name = sea_ice_thickness + long_name = sea-ice thickness + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_surface_generic_post_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[cplflx] + standard_name = flag_for_flux_coupling + long_name = flag controlling cplflx collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[cplwav] + standard_name = flag_for_wave_coupling + long_name = flag controlling cplwav collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lssav] + standard_name = flag_diagnostics + long_name = logical flag for storing diagnostics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[icy] + standard_name = flag_nonzero_sea_ice_surface_fraction + long_name = flag indicating presence of some sea ice surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[wet] + standard_name = flag_nonzero_wet_surface_fraction + long_name = flag indicating presence of some ocean or lake surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[dtf] + standard_name = time_step_for_dynamics + long_name = dynamics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ep1d] + standard_name = surface_upward_potential_latent_heat_flux + long_name = surface upward potential latent heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gflx] + standard_name = upward_heat_flux_in_soil + long_name = upward soil heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tgrs_1] + standard_name = air_temperature_at_lowest_model_layer + long_name = mean temperature at lowest model layer + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qgrs_1] + standard_name = water_vapor_specific_humidity_at_lowest_model_layer + long_name = specific humidity at lowest model layer + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ugrs_1] + standard_name = x_wind_at_lowest_model_layer + long_name = zonal wind at lowest model layer + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[vgrs_1] + standard_name = y_wind_at_lowest_model_layer + long_name = meridional wind at lowest model layer + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[adjsfcdlw] + standard_name = surface_downwelling_longwave_flux + long_name = surface downwelling longwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[adjsfcdsw] + standard_name = surface_downwelling_shortwave_flux + long_name = surface downwelling shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[adjnirbmd] + standard_name = surface_downwelling_direct_near_infrared_shortwave_flux + long_name = surface downwelling beam near-infrared shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[adjnirdfd] + standard_name = surface_downwelling_diffuse_near_infrared_shortwave_flux + long_name = surface downwelling diffuse near-infrared shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[adjvisbmd] + standard_name = surface_downwelling_direct_ultraviolet_and_visible_shortwave_flux + long_name = surface downwelling beam ultraviolet plus visible shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[adjvisdfd] + standard_name = surface_downwelling_diffuse_ultraviolet_and_visible_shortwave_flux + long_name = surface downwelling diffuse ultraviolet plus visible shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[adjsfculw] + standard_name = surface_upwelling_longwave_flux + long_name = surface upwelling longwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[adjnirbmu] + standard_name = surface_upwelling_direct_near_infrared_shortwave_flux + long_name = surface upwelling beam near-infrared shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[adjnirdfu] + standard_name = surface_upwelling_diffuse_near_infrared_shortwave_flux + long_name = surface upwelling diffuse near-infrared shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[adjvisbmu] + standard_name = surface_upwelling_direct_ultraviolet_and_visible_shortwave_flux + long_name = surface upwelling beam ultraviolet plus visible shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[adjvisdfu] + standard_name = surface_upwelling_diffuse_ultraviolet_and_visible_shortwave_flux + long_name = surface upwelling diffuse ultraviolet plus visible shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t2m] + standard_name = temperature_at_2m + long_name = 2 meter temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q2m] + standard_name = specific_humidity_at_2m + long_name = 2 meter specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[u10m] + standard_name = x_wind_at_10m + long_name = 10 meter u wind speed + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v10m] + standard_name = y_wind_at_10m + long_name = 10 meter v wind speed + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsfc] + standard_name = surface_skin_temperature + long_name = surface skin temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[pgr] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[xcosz] + standard_name = instantaneous_cosine_of_zenith_angle + long_name = cosine of zenith angle at current time + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[evbs] + standard_name = soil_upward_latent_heat_flux + long_name = soil upward latent heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[evcw] + standard_name = canopy_upward_latent_heat_flux + long_name = canopy upward latent heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[trans] + standard_name = transpiration_flux + long_name = total plant transpiration rate + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sbsno] + standard_name = snow_deposition_sublimation_upward_latent_heat_flux + long_name = latent heat flux from snow depo/subl + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snowc] + standard_name = surface_snow_area_fraction + long_name = surface snow area fraction + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snohf] + standard_name = snow_freezing_rain_upward_latent_heat_flux + long_name = latent heat flux due to snow and frz rain + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[epi] + standard_name = instantaneous_surface_potential_evaporation + long_name = instantaneous sfc potential evaporation + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gfluxi] + standard_name = instantaneous_surface_ground_heat_flux + long_name = instantaneous sfc ground heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[t1] + standard_name = air_temperature_at_lowest_model_layer_for_diag + long_name = layer 1 temperature for diag + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[q1] + standard_name = water_vapor_specific_humidity_at_lowest_model_layer_for_diag + long_name = layer 1 specific humidity for diag + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[u1] + standard_name = x_wind_at_lowest_model_layer_for_diag + long_name = layer 1 x wind for diag + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[v1] + standard_name = y_wind_at_lowest_model_layer_for_diag + long_name = layer 1 y wind for diag + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dlwsfci_cpl] + standard_name = instantaneous_surface_downwelling_longwave_flux_for_coupling + long_name = instantaneous sfc downward lw flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dswsfci_cpl] + standard_name = instantaneous_surface_downwelling_shortwave_flux_for_coupling + long_name = instantaneous sfc downward sw flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dlwsfc_cpl] + standard_name = cumulative_surface_downwelling_longwave_flux_for_coupling_multiplied_by_timestep + long_name = cumulative sfc downward lw flux mulitplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dswsfc_cpl] + standard_name = cumulative_surface_downwelling_shortwave_flux_for_coupling_multiplied_by_timestep + long_name = cumulative sfc downward sw flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dnirbmi_cpl] + standard_name = instantaneous_surface_downwelling_direct_near_infrared_shortwave_flux_for_coupling + long_name = instantaneous sfc nir beam downward sw flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dnirdfi_cpl] + standard_name = instantaneous_surface_downwelling_diffuse_near_infrared_shortwave_flux_for_coupling + long_name = instantaneous sfc nir diff downward sw flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dvisbmi_cpl] + standard_name = instantaneous_surface_downwelling_direct_ultraviolet_and_visible_shortwave_flux_for_coupling + long_name = instantaneous sfc uv+vis beam downward sw flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dvisdfi_cpl] + standard_name = instantaneous_surface_downwelling_diffuse_ultraviolet_and_visible_shortwave_flux_for_coupling + long_name = instantaneous sfc uv+vis diff downward sw flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dnirbm_cpl] + standard_name = cumulative_surface_downwelling_direct_near_infrared_shortwave_flux_for_coupling_multiplied_by_timestep + long_name = cumulative sfc nir beam downward sw flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dnirdf_cpl] + standard_name = cumulative_surface_downwelling_diffuse_near_infrared_shortwave_flux_for_coupling_multiplied_by_timestep + long_name = cumulative sfc nir diff downward sw flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dvisbm_cpl] + standard_name = cumulative_surface_downwelling_direct_ultraviolet_and_visible_shortwave_flux_for_coupling_multiplied_by_timestep + long_name = cumulative sfc uv+vis beam dnwd sw flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dvisdf_cpl] + standard_name = cumulative_surface_downwelling_diffuse_ultraviolet_and_visible_shortwave_flux_for_coupling_multiplied_by_timestep + long_name = cumulative sfc uv+vis diff dnwd sw flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[nlwsfci_cpl] + standard_name = instantaneous_surface_net_downward_longwave_flux_for_coupling + long_name = instantaneous net sfc downward lw flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[nlwsfc_cpl] + standard_name = cumulative_surface_net_downward_longwave_flux_for_coupling_multiplied_by_timestep + long_name = cumulative net downward lw flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[t2mi_cpl] + standard_name = instantaneous_temperature_at_2m_for_coupling + long_name = instantaneous T2m + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[q2mi_cpl] + standard_name = instantaneous_specific_humidity_at_2m_for_coupling + long_name = instantaneous Q2m + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[u10mi_cpl] + standard_name = instantaneous_x_wind_at_10m_for_coupling + long_name = instantaneous U10m + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[v10mi_cpl] + standard_name = instantaneous_y_wind_at_10m_for_coupling + long_name = instantaneous V10m + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsfci_cpl] + standard_name = instantaneous_surface_skin_temperature_for_coupling + long_name = instantaneous sfc temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[psurfi_cpl] + standard_name = instantaneous_surface_air_pressure_for_coupling + long_name = instantaneous sfc pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[nnirbmi_cpl] + standard_name = instantaneous_surface_net_downward_direct_near_infrared_shortwave_flux_for_coupling + long_name = instantaneous net nir beam sfc downward sw flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[nnirdfi_cpl] + standard_name = instantaneous_surface_net_downward_diffuse_near_infrared_shortwave_flux_for_coupling + long_name = instantaneous net nir diff sfc downward sw flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[nvisbmi_cpl] + standard_name = instantaneous_surface_net_downward_direct_ultraviolet_and_visible_shortwave_flux_for_coupling + long_name = instantaneous net uv+vis beam downward sw flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[nvisdfi_cpl] + standard_name = instantaneous_surface_net_downward_diffuse_ultraviolet_and_visible_shortwave_flux_for_coupling + long_name = instantaneous net uv+vis diff downward sw flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[nswsfci_cpl] + standard_name = instantaneous_surface_net_downward_shortwave_flux_for_coupling + long_name = instantaneous net sfc downward sw flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[nswsfc_cpl] + standard_name = cumulative_surface_net_downward_shortwave_flux_for_coupling_multiplied_by_timestep + long_name = cumulative net downward sw flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[nnirbm_cpl] + standard_name = cumulative_surface_net_downward_direct_near_infrared_shortwave_flux_for_coupling_multiplied_by_timestep + long_name = cumulative net nir beam downward sw flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[nnirdf_cpl] + standard_name = cumulative_surface_net_downward_diffuse_near_infrared_shortwave_flux_for_coupling_multiplied_by_timestep + long_name = cumulative net nir diff downward sw flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[nvisbm_cpl] + standard_name = cumulative_surface_net_downward_direct_ultraviolet_and_visible_shortwave_flux_for_coupling_multiplied_by_timestep + long_name = cumulative net uv+vis beam downward sw rad flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[nvisdf_cpl] + standard_name = cumulative_surface_net_downward_diffuse_ultraviolet_and_visible_shortwave_flux_for_coupling_multiplied_by_timestep + long_name = cumulative net uv+vis diff downward sw rad flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gflux] + standard_name = cumulative_surface_ground_heat_flux_multiplied_by_timestep + long_name = cumulative groud conductive heat flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[evbsa] + standard_name = cumulative_soil_upward_latent_heat_flux_multiplied_by_timestep + long_name = cumulative soil upward latent heat flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[evcwa] + standard_name = cumulative_canopy_upward_latent_heat_flu_multiplied_by_timestep + long_name = cumulative canopy upward latent heat flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[transa] + standard_name = cumulative_transpiration_flux_multiplied_by_timestep + long_name = cumulative total plant transpiration rate multiplied by timestep + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[sbsnoa] + standard_name = cumulative_snow_deposition_sublimation_upward_latent_heat_flux_multiplied_by_timestep + long_name = cumulative latent heat flux from snow depo/subl multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snowca] + standard_name = cumulative_surface_snow_area_fraction_multiplied_by_timestep + long_name = cumulative surface snow area fraction multiplied by timestep + units = s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snohfa] + standard_name = cumulative_snow_freezing_rain_upward_latent_heat_flux_multiplied_by_timestep + long_name = cumulative latent heat flux due to snow and frz rain multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ep] + standard_name = cumulative_surface_upward_potential_latent_heat_flux_multiplied_by_timestep + long_name = cumulative surface upward potential latent heat flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[runoff] + standard_name = total_runoff + long_name = total water runoff + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[srunoff] + standard_name = surface_runoff + long_name = surface water runoff (from lsm) + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[runof] + standard_name = surface_runoff_flux + long_name = surface runoff flux + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[drain] + standard_name = subsurface_runoff_flux + long_name = subsurface runoff flux + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/GFS_surface_loop_control.F90 b/physics/GFS_surface_loop_control.F90 index 49de8fdab..dd6bc86c0 100644 --- a/physics/GFS_surface_loop_control.F90 +++ b/physics/GFS_surface_loop_control.F90 @@ -17,14 +17,7 @@ end subroutine GFS_surface_loop_control_part1_finalize !! #if 0 !! \section arg_table_GFS_surface_loop_control_part1_run Arguments -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|--------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | iter | ccpp_loop_counter | loop counter for subcycling loops in CCPP | index | 0 | integer | | in | F | -!! | wind | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | flag_guess | flag_for_guess_run | flag for guess run | flag | 1 | logical | | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_surface_loop_control_part1_run.html !! #endif !! \section general General Algorithm @@ -80,19 +73,7 @@ end subroutine GFS_surface_loop_control_part2_finalize !! #if 0 !! \section arg_table_GFS_surface_loop_control_part2_run Arguments -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|----------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | iter | ccpp_loop_counter | loop counter for subcycling loops in CCPP | index | 0 | integer | | in | F | -!! | wind | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | flag_guess | flag_for_guess_run | flag for guess run | flag | 1 | logical | | inout | F | -!! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | inout | F | -!! | dry | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | -!! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | -!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | -!! | nstf_name1 | flag_for_nsstm_run | NSSTM flag: off/uncoupled/coupled=0/1/2 | flag | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_surface_loop_control_part2_run.html !! #endif !! \section general General Algorithm diff --git a/physics/GFS_surface_loop_control.meta b/physics/GFS_surface_loop_control.meta new file mode 100644 index 000000000..3fe5878f7 --- /dev/null +++ b/physics/GFS_surface_loop_control.meta @@ -0,0 +1,148 @@ +[ccpp-arg-table] + name = GFS_surface_loop_control_part1_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[iter] + standard_name = ccpp_loop_counter + long_name = loop counter for subcycling loops in CCPP + units = index + dimensions = () + type = integer + intent = in + optional = F +[wind] + standard_name = wind_speed_at_lowest_model_layer + long_name = wind speed at lowest model level + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[flag_guess] + standard_name = flag_for_guess_run + long_name = flag for guess run + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_surface_loop_control_part2_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[iter] + standard_name = ccpp_loop_counter + long_name = loop counter for subcycling loops in CCPP + units = index + dimensions = () + type = integer + intent = in + optional = F +[wind] + standard_name = wind_speed_at_lowest_model_layer + long_name = wind speed at lowest model level + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[flag_guess] + standard_name = flag_for_guess_run + long_name = flag for guess run + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = inout + optional = F +[flag_iter] + standard_name = flag_for_iteration + long_name = flag for iteration + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = inout + optional = F +[dry] + standard_name = flag_nonzero_land_surface_fraction + long_name = flag indicating presence of some land surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[wet] + standard_name = flag_nonzero_wet_surface_fraction + long_name = flag indicating presence of some ocean or lake surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[icy] + standard_name = flag_nonzero_sea_ice_surface_fraction + long_name = flag indicating presence of some sea ice surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[nstf_name1] + standard_name = flag_for_nsstm_run + long_name = NSSTM flag: off/uncoupled/coupled=0/1/2 + units = flag + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/GFS_time_vary_pre.fv3.F90 b/physics/GFS_time_vary_pre.fv3.F90 index de33b5404..b3c4c0f08 100644 --- a/physics/GFS_time_vary_pre.fv3.F90 +++ b/physics/GFS_time_vary_pre.fv3.F90 @@ -16,10 +16,7 @@ module GFS_time_vary_pre contains !> \section arg_table_GFS_time_vary_pre_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_time_vary_pre_init.html !! subroutine GFS_time_vary_pre_init (errmsg, errflg) @@ -43,10 +40,7 @@ end subroutine GFS_time_vary_pre_init !> \section arg_table_GFS_time_vary_pre_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_time_vary_pre_finalize.html !! subroutine GFS_time_vary_pre_finalize(errmsg, errflg) @@ -69,11 +63,7 @@ end subroutine GFS_time_vary_pre_finalize !> \section arg_table_GFS_time_vary_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_time_vary_pre_run.html !! subroutine GFS_time_vary_pre_run (Model, errmsg, errflg) diff --git a/physics/GFS_time_vary_pre.fv3.meta b/physics/GFS_time_vary_pre.fv3.meta new file mode 100644 index 000000000..c4312790f --- /dev/null +++ b/physics/GFS_time_vary_pre.fv3.meta @@ -0,0 +1,72 @@ +[ccpp-arg-table] + name = GFS_time_vary_pre_init + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_time_vary_pre_finalize + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_time_vary_pre_run + type = scheme +[Model] + standard_name = GFS_control_type_instance + long_name = Fortran DDT containing FV3-GFS model control parameters + units = DDT + dimensions = () + type = GFS_control_type + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/GFS_time_vary_pre.scm.F90 b/physics/GFS_time_vary_pre.scm.F90 index c2151151d..790cf0d1a 100644 --- a/physics/GFS_time_vary_pre.scm.F90 +++ b/physics/GFS_time_vary_pre.scm.F90 @@ -16,10 +16,7 @@ module GFS_time_vary_pre contains !> \section arg_table_GFS_time_vary_pre_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_time_vary_pre_init.html !! subroutine GFS_time_vary_pre_init (errmsg, errflg) @@ -43,10 +40,7 @@ end subroutine GFS_time_vary_pre_init !> \section arg_table_GFS_time_vary_pre_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_time_vary_pre_finalize.html !! subroutine GFS_time_vary_pre_finalize(errmsg, errflg) @@ -69,11 +63,7 @@ end subroutine GFS_time_vary_pre_finalize !> \section arg_table_GFS_time_vary_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-----------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_time_vary_pre_run.html !! subroutine GFS_time_vary_pre_run (Model, errmsg, errflg) diff --git a/physics/GFS_time_vary_pre.scm.meta b/physics/GFS_time_vary_pre.scm.meta new file mode 100644 index 000000000..c4312790f --- /dev/null +++ b/physics/GFS_time_vary_pre.scm.meta @@ -0,0 +1,72 @@ +[ccpp-arg-table] + name = GFS_time_vary_pre_init + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_time_vary_pre_finalize + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_time_vary_pre_run + type = scheme +[Model] + standard_name = GFS_control_type_instance + long_name = Fortran DDT containing FV3-GFS model control parameters + units = DDT + dimensions = () + type = GFS_control_type + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/cires_ugwp_solvers.F90 b/physics/cires_ugwp_solvers.F90 index daba9b4c7..6736daf6a 100644 --- a/physics/cires_ugwp_solvers.F90 +++ b/physics/cires_ugwp_solvers.F90 @@ -445,7 +445,7 @@ subroutine gw_solver_linsatdis(im, levs, dtp, kdt, me, & enddo print * - pause + !pause endif do j=1,im @@ -488,7 +488,7 @@ subroutine gw_solver_linsatdis(im, levs, dtp, kdt, me, & print *, maxval(vi), minval(vi) , ' vi ' print *, maxval(v1), minval(v1) , ' ++++ v1 ' print *, maxval(pint), minval(pint) , ' pint ' - pause + !pause endif ! call ugwp_lsatdis_naz(levs, ksrc, nw, naz, kxw, taub_spect, & @@ -510,7 +510,7 @@ subroutine gw_solver_linsatdis(im, levs, dtp, kdt, me, & print *, maxval(ui), minval(ui) , ' ui ' print *, maxval(vi), minval(vi) , ' vi ' print *, maxval(pint), minval(pint) , ' pint ' - pause + !pause endif ! ! ax(j,:) = ax1 diff --git a/physics/cires_vert_lsatdis.F90 b/physics/cires_vert_lsatdis.F90 index a44b8dde0..362bed8ef 100644 --- a/physics/cires_vert_lsatdis.F90 +++ b/physics/cires_vert_lsatdis.F90 @@ -230,7 +230,7 @@ subroutine ugwp_lsatdis_az1(levs, ksrc, nw, kxw, ch, taub_sp, & write(6,*) F_nonhyd, ' F_nonhyd ' write(6,*) maxval(Bn), minval(BN), ' BN-BV ' write(6,*) Um(ksrc), ' Um-ksrc ', cd_ulim2 , 'cd_ulim2 ', c2f2, ' c2f2 ' - pause + !pause endif !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -504,7 +504,7 @@ subroutine ugwp_lsatdis_az1(levs, ksrc, nw, kxw, ch, taub_sp, & write(6,*) nw , ' nwaves-linsat ' write(6,*) maxval(sp_ked), minval(sp_ked), 'ked ' write(6,*) maxval(sp_tau), minval(sp_tau), 'sp_tau ' - pause + !pause endif ! diff --git a/physics/cnvc90.f b/physics/cnvc90.f index 1e95148be..87d034b77 100644 --- a/physics/cnvc90.f +++ b/physics/cnvc90.f @@ -18,24 +18,7 @@ end subroutine cnvc90_init !! pressure at bottom of convective cloud and at top of convective !! cloud. !> \section arg_table_cnvc90_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------|---------------------------------------------------------|-------|------|-----------|-----------|--------|----------| -!! | clstp | convective_cloud_switch | switch for saving convective clouds | none | 0 | real | kind_phys | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | rn | lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep | convective rainfall amount on dynamics timestep | m | 1 | real | kind_phys | in | F | -!! | kbot | vertical_index_at_cloud_base | vertical index at cloud base | index | 1 | integer | | in | F | -!! | ktop | vertical_index_at_cloud_top | vertical index at cloud top | index | 1 | integer | | in | F | -!! | km | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | -!! | prsi | air_pressure_at_interface | interface pressure | Pa | 2 | real | kind_phys | in | F | -!! | acv | accumulated_lwe_thickness_of_convective_precipitation_amount_cnvc90 | accumulated convective rainfall amount for cnvc90 only | m | 1 | real | kind_phys | inout | F | -!! | acvb | smallest_cloud_base_vertical_index_encountered_thus_far | smallest cloud base vertical index encountered thus far | index | 1 | real | kind_phys | inout | F | -!! | acvt | largest_cloud_top_vertical_index_encountered_thus_far | largest cloud top vertical index encountered thus far | index | 1 | real | kind_phys | inout | F | -!! | cv | fraction_of_convective_cloud | fraction of convective cloud | frac | 1 | real | kind_phys | inout | F | -!! | cvb | pressure_at_bottom_of_convective_cloud | pressure at bottom of convective cloud | Pa | 1 | real | kind_phys | inout | F | -!! | cvt | pressure_at_top_of_convective_cloud | pressure at top of convective cloud | Pa | 1 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cnvc90_run.html !! ! \section gen_cnvc_run GFS cnvc90_run General Algorithm SUBROUTINE cnvc90_run(CLSTP,IM,IX,RN,KBOT,KTOP,KM,PRSI, & diff --git a/physics/cnvc90.meta b/physics/cnvc90.meta new file mode 100644 index 000000000..57290c9c5 --- /dev/null +++ b/physics/cnvc90.meta @@ -0,0 +1,151 @@ +[ccpp-arg-table] + name = cnvc90_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = cnvc90_run + type = scheme +[clstp] + standard_name = convective_cloud_switch + long_name = switch for saving convective clouds + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[rn] + standard_name = lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep + long_name = convective rainfall amount on dynamics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[kbot] + standard_name = vertical_index_at_cloud_base + long_name = vertical index at cloud base + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[ktop] + standard_name = vertical_index_at_cloud_top + long_name = vertical index at cloud top + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension + long_name = number of vertical layers + units = count + dimensions = () + type = integer + intent = in + optional = F +[prsi] + standard_name = air_pressure_at_interface + long_name = interface pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[acv] + standard_name = accumulated_lwe_thickness_of_convective_precipitation_amount_cnvc90 + long_name = accumulated convective rainfall amount for cnvc90 only + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[acvb] + standard_name = smallest_cloud_base_vertical_index_encountered_thus_far + long_name = smallest cloud base vertical index encountered thus far + units = index + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[acvt] + standard_name = largest_cloud_top_vertical_index_encountered_thus_far + long_name = largest cloud top vertical index encountered thus far + units = index + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cv] + standard_name = fraction_of_convective_cloud + long_name = fraction of convective cloud + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cvb] + standard_name = pressure_at_bottom_of_convective_cloud + long_name = pressure at bottom of convective cloud + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cvt] + standard_name = pressure_at_top_of_convective_cloud + long_name = pressure at top of convective cloud + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = cnvc90_finalize + type = scheme diff --git a/physics/cs_conv.F90 b/physics/cs_conv.F90 index a1f58da0a..a955f6247 100644 --- a/physics/cs_conv.F90 +++ b/physics/cs_conv.F90 @@ -16,27 +16,7 @@ end subroutine cs_conv_pre_finalize #if 0 !! \section arg_table_cs_conv_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------|---------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | im | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of veritcal levels | count | 0 | integer | | in | F | -!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | ncld | number_of_hydrometeors | number of hydrometeors | count | 0 | integer | | in | F | -!! | q | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | clw1 | ice_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | in | F | -!! | clw2 | cloud_condensed_water_mixing_ratio_convective_transport_tracer| moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | in | F | -!! | work1 | grid_size_related_coefficient_used_in_scale_sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | -!! | work2 | grid_size_related_coefficient_used_in_scale_sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | in | F | -!! | cs_parm1 | updraft_velocity_tunable_parameter_1_CS | tunable parameter 1 for Chikira-Sugiyama convection | m s-1 | 0 | real | kind_phys | in | F | -!! | cs_parm2 | updraft_velocity_tunable_parameter_2_CS | tunable parameter 2 for Chikira-Sugiyama convection | m s-1 | 0 | real | kind_phys | in | F | -!! | wcbmax | maximum_updraft_velocity_at_cloud_base | maximum updraft velocity at cloud base | m s-1 | 1 | real | kind_phys | out | F | -!! | fswtr | fraction_of_cloud_top_water_scavenged | fraction of the tracer (cloud top water) that is scavenged by convection | km-1 | 1 | real | kind_phys | out | F | -!! | fscav | fraction_of_tracer_scavenged | fraction of the tracer (aerosols) that is scavenged by convection | km-1 | 1 | real | kind_phys | out | F | -!! | save_q1 | water_vapor_specific_humidity_save | water vapor specific humidity before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | out | F | -!! | save_q2 | cloud_condensed_water_mixing_ratio_save | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | out | F | -!! | save_q3 | ice_water_mixing_ratio_save | cloud ice water mixing ratio before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cs_conv_pre_run.html !! #endif subroutine cs_conv_pre_run(im, levs, ntrac, ncld, q, clw1, clw2, & @@ -110,15 +90,7 @@ end subroutine cs_conv_post_finalize !! !! \section arg_table_cs_conv_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |------------|-----------------------------------------------------------------|--------------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | kmax | vertical_dimension | number of veritcal levels | count | 0 | integer | | in | F | -!! | do_aw | flag_for_Arakawa_Wu_adjustment | flag for Arakawa Wu scale-aware adjustment | flag | 0 | logical | | in | F | -!! | sigmatot | convective_updraft_area_fraction_at_model_interfaces | convective updraft area fraction at model interfaces | frac | 2 | real | kind_phys | in | F | -!! | sigmafrac | convective_updraft_area_fraction | convective updraft area fraction | frac | 2 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cs_conv_post_run.html !! subroutine cs_conv_post_run(im, kmax, do_aw, sigmatot, sigmafrac, errmsg, errflg) @@ -313,61 +285,7 @@ end subroutine cs_conv_finalize !! and long_name as the other convective schemes, where the units are in kg/m2. (Aug 2018) !! !! \section arg_table_cs_conv_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |------------|-----------------------------------------------------------|-------------------------------------------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | ijsdim | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | kmax | vertical_dimension | number of veritcal levels | count | 0 | integer | | in | F | -!! | ntracp1 | number_of_tracers_plus_one | number of tracers plus one | count | 0 | integer | | in | F | -!! | nn | number_of_tracers_for_convective_transport | number of tracers for convective transport (used to dimension clw) | count | 0 | integer | | in | F | -!! | ntr | number_of_tracers_for_CS | number of convectively transported tracers in Chikira-Sugiyama deep conv. scheme | count | 0 | integer | | in | F | -!! | nctp | number_of_cloud_types_CS | number of cloud types in Chikira-Sugiyama scheme | count | 0 | integer | | in | F | -!! | otspt | flag_convective_tracer_transport | flag to enable tracer transport by updrafts/downdrafts[(:,1)] or subsidence [(:,2)] | flag | 2 | logical | | in | F | -!! | lat | latitude_index_in_debug_printouts | latitude index in debug printouts | index | 0 | integer | | in | F | -!! | kdt | index_of_time_step | current forecast iteration | index | 0 | integer | | in | F | -!! | t | air_temperature_updated_by_physics | mid-layer temperature | K | 2 | real | kind_phys | inout | F | -!! | q | water_vapor_specific_humidity_updated_by_physics | mid-layer specific humidity of water vapor | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | rain1 | lwe_thickness_of_deep_convective_precipitation_amount | deep convective rainfall amount on physics timestep | m | 1 | real | kind_phys | out | F | -!! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | inout | F | -!! | zm | geopotential | mid-layer geopotential | m2 s-2 | 2 | real | kind_phys | in | F | -!! | zi | geopotential_at_interface | interface geopotential | m2 s-2 | 2 | real | kind_phys | in | F | -!! | pap | air_pressure | mid-layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | paph | air_pressure_at_interface | interface pressure | Pa | 2 | real | kind_phys | in | F | -!! | delta | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | delti | time_step_for_dynamics | dynamics time step | s | 0 | real | kind_phys | in | F | -!! | ud_mf | instantaneous_atmosphere_updraft_convective_mass_flux | (updraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | inout | F | -!! | dd_mf | instantaneous_atmosphere_downdraft_convective_mass_flux | (downdraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | inout | F | -!! | dt_mf | instantaneous_atmosphere_detrainment_convective_mass_flux | (detrainment mass flux) * delt | kg m-2 | 2 | real | kind_phys | inout | F | -!! | u | x_wind_updated_by_physics | mid-layer zonal wind | m s-1 | 2 | real | kind_phys | inout | F | -!! | v | y_wind_updated_by_physics | mid-layer meridional wind | m s-1 | 2 | real | kind_phys | inout | F | -!! | fscav | fraction_of_tracer_scavenged | fraction of the tracer (aerosols) that is scavenged by convection | km-1 | 1 | real | kind_phys | in | F | -!! | fswtr | fraction_of_cloud_top_water_scavenged | fraction of the tracer (cloud top water) that is scavenged by convection | km-1 | 1 | real | kind_phys | in | F | -!! | cbmfx | cloud_base_mass_flux | cloud base mass flux | kg m-2 s-1 | 2 | real | kind_phys | inout | F | -!! | mype | mpi_rank | current MPI rank | index | 0 | integer | | in | F | -!! | wcbmaxm | maximum_updraft_velocity_at_cloud_base | maximum updraft velocity at cloud base | m s-1 | 1 | real | kind_phys | in | F | -!! | precz0in | detrainment_and_precipitation_tunable_parameter_3_CS | partition water between detrainment and precipitation (decrease for more precipitation) | m | 0 | real | kind_phys | in | F | -!! | preczhin | detrainment_and_precipitation_tunable_parameter_4_CS | partition water between detrainment and precipitation (decrease for more precipitation) | m | 0 | real | kind_phys | in | F | -!! | clmdin | entrainment_efficiency_tunable_parameter_9_CS | entrainment efficiency | none | 0 | real | kind_phys | in | F | -!! | sigma | convective_updraft_area_fraction_at_model_interfaces | convective updraft area fraction at model interfaces | frac | 2 | real | kind_phys | out | F | -!! | do_aw | flag_for_Arakawa_Wu_adjustment | flag for Arakawa Wu scale-aware adjustment | flag | 0 | logical | | in | F | -!! | do_awdd | flag_arakawa_wu_downdraft | flag to enable treating convective tendencies following Arakwaw-Wu for downdrafts (2013) | flag | 0 | logical | | in | F | -!! | flx_form | flag_flux_form_CS | flag to enable using the flux form of the equations in CS scheme | flag | 0 | logical | | in | F | -!! | lprnt | flag_print | control flag for diagnostic print out | flag | 0 | logical | | in | F | -!! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | -!! | kcnv | flag_deep_convection | flag indicating whether convection occurs in column | flag | 1 | integer | | inout | F | -!! | qlcn | mass_fraction_of_convective_cloud_liquid_water | mass fraction of convective cloud liquid water | kg kg-1 | 2 | real | kind_phys | out | F | -!! | qicn | mass_fraction_of_convective_cloud_ice | mass fraction of convective cloud ice water | kg kg-1 | 2 | real | kind_phys | out | F | -!! | w_upi | vertical_velocity_for_updraft | vertical velocity for updraft | m s-1 | 2 | real | kind_phys | out | F | -!! | cf_upi | convective_cloud_fraction_for_microphysics | convective cloud fraction for microphysics | frac | 2 | real | kind_phys | out | F | -!! | cnv_mfd | detrained_mass_flux | detrained mass flux | kg m-2 s-1 | 2 | real | kind_phys | out | F | -!! | cnv_dqldt | tendency_of_cloud_water_due_to_convective_microphysics | tendency of cloud water due to convective microphysics | kg m-2 s-1 | 2 | real | kind_phys | out | F | -!! | clcn | convective_cloud_volume_fraction | convective cloud volume fraction | frac | 2 | real | kind_phys | out | F | -!! | cnv_fice | ice_fraction_in_convective_tower | ice fraction in convective tower | frac | 2 | real | kind_phys | out | F | -!! | cnv_ndrop | number_concentration_of_cloud_liquid_water_particles_for_detrainment | droplet number concentration in convective detrainment | m-3 | 2 | real | kind_phys | out | F | -!! | cnv_nice | number_concentration_of_ice_crystals_for_detrainment | crystal number concentration in convective detrainment | m-3 | 2 | real | kind_phys | out | F | -!! | mp_phys | flag_for_microphysics_scheme | flag for microphysics scheme | flag | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cs_conv_run.html !! !! \section general_cs_conv CS Convection Scheme General Algorithm !> @{ diff --git a/physics/cs_conv.meta b/physics/cs_conv.meta new file mode 100644 index 000000000..e1d6c3538 --- /dev/null +++ b/physics/cs_conv.meta @@ -0,0 +1,726 @@ +[ccpp-arg-table] + name = cs_conv_pre_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = cs_conv_pre_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = cs_conv_pre_run + type = scheme +[im] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of veritcal levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F +[ncld] + standard_name = number_of_hydrometeors + long_name = number of hydrometeors + units = count + dimensions = () + type = integer + intent = in + optional = F +[q] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[clw1] + standard_name = ice_water_mixing_ratio_convective_transport_tracer + long_name = moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[clw2] + standard_name = cloud_condensed_water_mixing_ratio_convective_transport_tracer + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[work1] + standard_name = grid_size_related_coefficient_used_in_scale_sensitive_schemes + long_name = grid size related coefficient used in scale-sensitive schemes + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[work2] + standard_name = grid_size_related_coefficient_used_in_scale_sensitive_schemes_complement + long_name = complement to work1 + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cs_parm1] + standard_name = updraft_velocity_tunable_parameter_1_CS + long_name = tunable parameter 1 for Chikira-Sugiyama convection + units = m s-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cs_parm2] + standard_name = updraft_velocity_tunable_parameter_2_CS + long_name = tunable parameter 2 for Chikira-Sugiyama convection + units = m s-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[wcbmax] + standard_name = maximum_updraft_velocity_at_cloud_base + long_name = maximum updraft velocity at cloud base + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[fswtr] + standard_name = fraction_of_cloud_top_water_scavenged + long_name = fraction of the tracer (cloud top water) that is scavenged by convection + units = km-1 + dimensions = (number_of_tracers_scavenged) + type = real + kind = kind_phys + intent = out + optional = F +[fscav] + standard_name = fraction_of_tracer_scavenged + long_name = fraction of the tracer (aerosols) that is scavenged by convection + units = km-1 + dimensions = (number_of_tracers_scavenged) + type = real + kind = kind_phys + intent = out + optional = F +[save_q1] + standard_name = water_vapor_specific_humidity_save + long_name = water vapor specific humidity before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[save_q2] + standard_name = cloud_condensed_water_mixing_ratio_save + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[save_q3] + standard_name = ice_water_mixing_ratio_save + long_name = cloud ice water mixing ratio before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = cs_conv_post_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = cs_conv_post_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = cs_conv_post_run + type = scheme +[im] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[kmax] + standard_name = vertical_dimension + long_name = number of veritcal levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[do_aw] + standard_name = flag_for_Arakawa_Wu_adjustment + long_name = flag for Arakawa Wu scale-aware adjustment + units = flag + dimensions = () + type = logical + intent = in + optional = F +[sigmatot] + standard_name = convective_updraft_area_fraction_at_model_interfaces + long_name = convective updraft area fraction at model interfaces + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sigmafrac] + standard_name = convective_updraft_area_fraction + long_name = convective updraft area fraction + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = cs_conv_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = cs_conv_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = cs_conv_run + type = scheme +[im] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[ijsdim] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[kmax] + standard_name = vertical_dimension + long_name = number of veritcal levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntracp1] + standard_name = number_of_tracers_plus_one + long_name = number of tracers plus one + units = count + dimensions = () + type = integer + intent = in + optional = F +[nn] + standard_name = number_of_tracers_for_convective_transport + long_name = number of tracers for convective transport (used to dimension clw) + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntr] + standard_name = number_of_tracers_for_CS + long_name = number of convectively transported tracers in Chikira-Sugiyama deep conv. scheme + units = count + dimensions = () + type = integer + intent = in + optional = F +[nctp] + standard_name = number_of_cloud_types_CS + long_name = number of cloud types in Chikira-Sugiyama scheme + units = count + dimensions = () + type = integer + intent = in + optional = F +[otspt] + standard_name = flag_convective_tracer_transport + long_name = flag to enable tracer transport by updrafts/downdrafts[(:,1)] or subsidence [(:,2)] + units = flag + dimensions = (number_of_tracers_plus_one,2) + type = logical + intent = in + optional = F +[lat] + standard_name = latitude_index_in_debug_printouts + long_name = latitude index in debug printouts + units = index + dimensions = () + type = integer + intent = in + optional = F +[kdt] + standard_name = index_of_time_step + long_name = current forecast iteration + units = index + dimensions = () + type = integer + intent = in + optional = F +[t] + standard_name = air_temperature_updated_by_physics + long_name = mid-layer temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[q] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = mid-layer specific humidity of water vapor + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rain1] + standard_name = lwe_thickness_of_deep_convective_precipitation_amount + long_name = deep convective rainfall amount on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[clw] + standard_name = convective_transportable_tracers + long_name = array to contain cloud water and other convective trans. tracers + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers_for_convective_transport) + type = real + kind = kind_phys + intent = inout + optional = F +[zm] + standard_name = geopotential + long_name = mid-layer geopotential + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zi] + standard_name = geopotential_at_interface + long_name = interface geopotential + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[pap] + standard_name = air_pressure + long_name = mid-layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[paph] + standard_name = air_pressure_at_interface + long_name = interface pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[delta] + standard_name = time_step_for_physics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[delti] + standard_name = time_step_for_dynamics + long_name = dynamics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ud_mf] + standard_name = instantaneous_atmosphere_updraft_convective_mass_flux + long_name = (updraft mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dd_mf] + standard_name = instantaneous_atmosphere_downdraft_convective_mass_flux + long_name = (downdraft mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dt_mf] + standard_name = instantaneous_atmosphere_detrainment_convective_mass_flux + long_name = (detrainment mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[u] + standard_name = x_wind_updated_by_physics + long_name = mid-layer zonal wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[v] + standard_name = y_wind_updated_by_physics + long_name = mid-layer meridional wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fscav] + standard_name = fraction_of_tracer_scavenged + long_name = fraction of the tracer (aerosols) that is scavenged by convection + units = km-1 + dimensions = (number_of_tracers_scavenged) + type = real + kind = kind_phys + intent = in + optional = F +[fswtr] + standard_name = fraction_of_cloud_top_water_scavenged + long_name = fraction of the tracer (cloud top water) that is scavenged by convection + units = km-1 + dimensions = (number_of_tracers_scavenged) + type = real + kind = kind_phys + intent = in + optional = F +[cbmfx] + standard_name = cloud_base_mass_flux + long_name = cloud base mass flux + units = kg m-2 s-1 + dimensions = (horizontal_dimension,number_of_cloud_types_CS) + type = real + kind = kind_phys + intent = inout + optional = F +[mype] + standard_name = mpi_rank + long_name = current MPI rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[wcbmaxm] + standard_name = maximum_updraft_velocity_at_cloud_base + long_name = maximum updraft velocity at cloud base + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[precz0in] + standard_name = detrainment_and_precipitation_tunable_parameter_3_CS + long_name = partition water between detrainment and precipitation (decrease for more precipitation) + units = m + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[preczhin] + standard_name = detrainment_and_precipitation_tunable_parameter_4_CS + long_name = partition water between detrainment and precipitation (decrease for more precipitation) + units = m + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[clmdin] + standard_name = entrainment_efficiency_tunable_parameter_9_CS + long_name = entrainment efficiency + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[sigma] + standard_name = convective_updraft_area_fraction_at_model_interfaces + long_name = convective updraft area fraction at model interfaces + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[do_aw] + standard_name = flag_for_Arakawa_Wu_adjustment + long_name = flag for Arakawa Wu scale-aware adjustment + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_awdd] + standard_name = flag_arakawa_wu_downdraft + long_name = flag to enable treating convective tendencies following Arakwaw-Wu for downdrafts (2013) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[flx_form] + standard_name = flag_flux_form_CS + long_name = flag to enable using the flux form of the equations in CS scheme + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lprnt] + standard_name = flag_print + long_name = control flag for diagnostic print out + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ipr] + standard_name = horizontal_index_of_printed_column + long_name = horizontal index of printed column + units = index + dimensions = () + type = integer + intent = in + optional = F +[kcnv] + standard_name = flag_deep_convection + long_name = flag indicating whether convection occurs in column + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = inout + optional = F +[qlcn] + standard_name = mass_fraction_of_convective_cloud_liquid_water + long_name = mass fraction of convective cloud liquid water + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[qicn] + standard_name = mass_fraction_of_convective_cloud_ice + long_name = mass fraction of convective cloud ice water + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[w_upi] + standard_name = vertical_velocity_for_updraft + long_name = vertical velocity for updraft + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cf_upi] + standard_name = convective_cloud_fraction_for_microphysics + long_name = convective cloud fraction for microphysics + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cnv_mfd] + standard_name = detrained_mass_flux + long_name = detrained mass flux + units = kg m-2 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cnv_dqldt] + standard_name = tendency_of_cloud_water_due_to_convective_microphysics + long_name = tendency of cloud water due to convective microphysics + units = kg m-2 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[clcn] + standard_name = convective_cloud_volume_fraction + long_name = convective cloud volume fraction + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cnv_fice] + standard_name = ice_fraction_in_convective_tower + long_name = ice fraction in convective tower + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cnv_ndrop] + standard_name = number_concentration_of_cloud_liquid_water_particles_for_detrainment + long_name = droplet number concentration in convective detrainment + units = m-3 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cnv_nice] + standard_name = number_concentration_of_ice_crystals_for_detrainment + long_name = crystal number concentration in convective detrainment + units = m-3 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[mp_phys] + standard_name = flag_for_microphysics_scheme + long_name = flag for microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/cs_conv_aw_adj.F90 b/physics/cs_conv_aw_adj.F90 index eab2fb411..756161d8c 100644 --- a/physics/cs_conv_aw_adj.F90 +++ b/physics/cs_conv_aw_adj.F90 @@ -23,32 +23,7 @@ end subroutine cs_conv_aw_adj_finalize !>\ingroup cs_scheme !> This subroutine adjusts surface rainrate for conservation. !> \section arg_table_cs_conv_aw_adj_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------|---------------------------------------------------------------|----------------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | im | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of veritcal levels | count | 0 | integer | | in | F | -!! | do_cscnv | flag_for_Chikira_Sugiyama_deep_convection | flag for Chikira-Sugiyama convection | flag | 0 | logical | | in | F | -!! | do_aw | flag_for_Arakawa_Wu_adjustment | flag for Arakawa Wu scale-aware adjustment | flag | 0 | logical | | in | F | -!! | do_shoc | flag_for_shoc | flag for SHOC | flag | 0 | logical | | in | F | -!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | ncld | number_of_hydrometeors | number of hydrometeors | count | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | tracer index for cloud condensate (or liquid water) | index | 0 | integer | | in | F | -!! | ntclamt | index_for_cloud_amount | tracer index for cloud amount integer | index | 0 | integer | | in | F | -!! | nncl | number_of_tracers_for_cloud_condensate | number of tracers for cloud condensate | count | 0 | integer | | in | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | sigmafrac | convective_updraft_area_fraction | convective updraft area fraction | frac | 2 | real | kind_phys | in | F | -!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | inout | F | -!! | gq0 | tracer_concentration_updated_by_physics | tracer concentration updated by physics | kg kg-1 | 3 | real | kind_phys | inout | F | -!! | save_t | air_temperature_save | air temperature before entering a physics scheme | K | 2 | real | kind_phys | in | F | -!! | save_q | tracer_concentration_save | tracer concentration before entering a physics scheme | kg kg-1 | 3 | real | kind_phys | in | F | -!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | cldfrac | cloud_fraction_for_MG | cloud fraction used by Morrison-Gettelman MP | frac | 2 | real | kind_phys | inout | F | -!! | subcldfrac | subgrid_scale_cloud_fraction_from_shoc | subgrid-scale cloud fraction from the SHOC scheme | frac | 2 | real | kind_phys | inout | F | -!! | prcp | lwe_thickness_of_explicit_precipitation_amount | explicit precipitation (rain, ice, snow, graupel, ...) on physics timestep | m | 1 | real | kind_phys | inout | F | -!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cs_conv_aw_adj_run.html !! !\section gen_cs_conv_aw_adj_run CPT cs_conv_aw_adj_run General Algorithm subroutine cs_conv_aw_adj_run(im, levs, do_cscnv, do_aw, do_shoc, & diff --git a/physics/cs_conv_aw_adj.meta b/physics/cs_conv_aw_adj.meta new file mode 100644 index 000000000..1e744bdd3 --- /dev/null +++ b/physics/cs_conv_aw_adj.meta @@ -0,0 +1,206 @@ +[ccpp-arg-table] + name = cs_conv_aw_adj_run + type = scheme +[im] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of veritcal levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[do_cscnv] + standard_name = flag_for_Chikira_Sugiyama_deep_convection + long_name = flag for Chikira-Sugiyama convection + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_aw] + standard_name = flag_for_Arakawa_Wu_adjustment + long_name = flag for Arakawa Wu scale-aware adjustment + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_shoc] + standard_name = flag_for_shoc + long_name = flag for SHOC + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F +[ncld] + standard_name = number_of_hydrometeors + long_name = number of hydrometeors + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntcw] + standard_name = index_for_liquid_cloud_condensate + long_name = tracer index for cloud condensate (or liquid water) + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntclamt] + standard_name = index_for_cloud_amount + long_name = tracer index for cloud amount integer + units = index + dimensions = () + type = integer + intent = in + optional = F +[nncl] + standard_name = number_of_tracers_for_cloud_condensate + long_name = number of tracers for cloud condensate + units = count + dimensions = () + type = integer + intent = in + optional = F +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[sigmafrac] + standard_name = convective_updraft_area_fraction + long_name = convective updraft area fraction + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gq0] + standard_name = tracer_concentration_updated_by_physics + long_name = tracer concentration updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = inout + optional = F +[save_t] + standard_name = air_temperature_save + long_name = air temperature before entering a physics scheme + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[save_q] + standard_name = tracer_concentration_save + long_name = tracer concentration before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = in + optional = F +[prsi] + standard_name = air_pressure_at_interface + long_name = air pressure at model layer interfaces + units = Pa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[cldfrac] + standard_name = cloud_fraction_for_MG + long_name = cloud fraction used by Morrison-Gettelman MP + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[subcldfrac] + standard_name = subgrid_scale_cloud_fraction_from_shoc + long_name = subgrid-scale cloud fraction from the SHOC scheme + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[prcp] + standard_name = lwe_thickness_of_explicit_precipitation_amount + long_name = explicit precipitation (rain, ice, snow, graupel, ...) on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[imp_physics] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_mg] + standard_name = flag_for_morrison_gettelman_microphysics_scheme + long_name = choice of Morrison-Gettelman microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 347f1ae6f..58a30749a 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -21,12 +21,7 @@ module cu_gf_driver !> \brief Brief description of the subroutine !! !! \section arg_table_cu_gf_driver_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------------|--------------------|------------------------------------------|-------|------|-----------|-----------|--------|----------| -!! | mpirank | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | mpiroot | mpi_root | master MPI-rank | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cu_gf_driver_init.html !! subroutine cu_gf_driver_init(mpirank, mpiroot, errmsg, errflg) @@ -69,45 +64,7 @@ end subroutine cu_gf_driver_finalize !> \ingroup cu_gf_group !! This is the Grell-Freitas convection scheme driver module. !! \section arg_table_cu_gf_driver_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------|-----------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | garea | cell_area | grid cell area | m2 | 1 | real | kind_phys | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | cactiv | conv_activity_counter | convective activity memory | none | 1 | integer | | inout | F | -!! | forcet | temperature_tendency_due_to_dynamics | temperature tendency due to dynamics only | K s-1 | 2 | real | kind_phys | in | F | -!! | forceqv_spechum| moisture_tendency_due_to_dynamics | moisture tendency due to dynamics only | kg kg-1 s-1 | 2 | real | kind_phys | in | F | -!! | phil | geopotential | layer geopotential | m2 s-2 | 2 | real | kind_phys | in | F | -!! | raincv | lwe_thickness_of_deep_convective_precipitation_amount | deep convective rainfall amount on physics timestep | m | 1 | real | kind_phys | out | F | -!! | qv_spechum | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | t | air_temperature_updated_by_physics | updated temperature | K | 2 | real | kind_phys | inout | F | -!! | cld1d | cloud_work_function | cloud work function | m2 s-2 | 1 | real | kind_phys | out | F | -!! | us | x_wind_updated_by_physics | updated x-direction wind | m s-1 | 2 | real | kind_phys | inout | F | -!! | vs | y_wind_updated_by_physics | updated y-direction wind | m s-1 | 2 | real | kind_phys | inout | F | -!! | t2di | air_temperature | mid-layer temperature | K | 2 | real | kind_phys | in | F | -!! | w | omega | layer mean vertical velocity | Pa s-1 | 2 | real | kind_phys | in | F | -!! | qv2di_spechum | water_vapor_specific_humidity | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | in | F | -!! | p2di | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | psuri | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | hbot | vertical_index_at_cloud_base | index for cloud base | index | 1 | integer | | out | F | -!! | htop | vertical_index_at_cloud_top | index for cloud top | index | 1 | integer | | out | F | -!! | kcnv | flag_deep_convection | deep convection: 0=no, 1=yes | flag | 1 | integer | | out | F | -!! | xland | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | -!! | hfx2 | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | qfx2 | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | cliw | ice_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | clcw | cloud_condensed_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of cloud water in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | pbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | in | F | -!! | ud_mf | instantaneous_atmosphere_updraft_convective_mass_flux | (updraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | -!! | dd_mf | instantaneous_atmosphere_downdraft_convective_mass_flux | (downdraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | -!! | dt_mf | instantaneous_atmosphere_detrainment_convective_mass_flux | (detrainment mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | -!! | cnvw_moist | convective_cloud_water_mixing_ratio | moist convective cloud water mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | -!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | out | F | -!! | imfshalcnv | flag_for_mass_flux_shallow_convection_scheme | flag for mass-flux shallow convection scheme | flag | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cu_gf_driver_run.html !! !>\section gen_gf_driver GSD GF Cumulus Scheme General Algorithm !> @{ diff --git a/physics/cu_gf_driver.meta b/physics/cu_gf_driver.meta new file mode 100644 index 000000000..1969f9464 --- /dev/null +++ b/physics/cu_gf_driver.meta @@ -0,0 +1,369 @@ +[ccpp-arg-table] + name = cu_gf_driver_init + type = scheme +[mpirank] + standard_name = mpi_rank + long_name = current MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[mpiroot] + standard_name = mpi_root + long_name = master MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = cu_gf_driver_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = cu_gf_driver_run + type = scheme +[garea] + standard_name = cell_area + long_name = grid cell area + units = m2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[dt] + standard_name = time_step_for_physics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cactiv] + standard_name = conv_activity_counter + long_name = convective activity memory + units = none + dimensions = (horizontal_dimension) + type = integer + intent = inout + optional = F +[forcet] + standard_name = temperature_tendency_due_to_dynamics + long_name = temperature tendency due to dynamics only + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[forceqv_spechum] + standard_name = moisture_tendency_due_to_dynamics + long_name = moisture tendency due to dynamics only + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[phil] + standard_name = geopotential + long_name = layer geopotential + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[raincv] + standard_name = lwe_thickness_of_deep_convective_precipitation_amount + long_name = deep convective rainfall amount on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[qv_spechum] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[t] + standard_name = air_temperature_updated_by_physics + long_name = updated temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cld1d] + standard_name = cloud_work_function + long_name = cloud work function + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[us] + standard_name = x_wind_updated_by_physics + long_name = updated x-direction wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[vs] + standard_name = y_wind_updated_by_physics + long_name = updated y-direction wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[t2di] + standard_name = air_temperature + long_name = mid-layer temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[w] + standard_name = omega + long_name = layer mean vertical velocity + units = Pa s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qv2di_spechum] + standard_name = water_vapor_specific_humidity + long_name = water vapor specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[p2di] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[psuri] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[hbot] + standard_name = vertical_index_at_cloud_base + long_name = index for cloud base + units = index + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[htop] + standard_name = vertical_index_at_cloud_top + long_name = index for cloud top + units = index + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[kcnv] + standard_name = flag_deep_convection + long_name = deep convection: 0=no, 1=yes + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[xland] + standard_name = sea_land_ice_mask + long_name = landmask: sea/land/ice=0/1/2 + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[hfx2] + standard_name = kinematic_surface_upward_sensible_heat_flux + long_name = kinematic surface upward sensible heat flux + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qfx2] + standard_name = kinematic_surface_upward_latent_heat_flux + long_name = kinematic surface upward latent heat flux + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cliw] + standard_name = ice_water_mixing_ratio_convective_transport_tracer + long_name = moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[clcw] + standard_name = cloud_condensed_water_mixing_ratio_convective_transport_tracer + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water in the convectively transported tracer array + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[pbl] + standard_name = atmosphere_boundary_layer_thickness + long_name = PBL thickness + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ud_mf] + standard_name = instantaneous_atmosphere_updraft_convective_mass_flux + long_name = (updraft mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dd_mf] + standard_name = instantaneous_atmosphere_downdraft_convective_mass_flux + long_name = (downdraft mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dt_mf] + standard_name = instantaneous_atmosphere_detrainment_convective_mass_flux + long_name = (detrainment mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cnvw_moist] + standard_name = convective_cloud_water_mixing_ratio + long_name = moist convective cloud water mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cnvc] + standard_name = convective_cloud_cover + long_name = convective cloud cover + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[imfshalcnv] + standard_name = flag_for_mass_flux_shallow_convection_scheme + long_name = flag for mass-flux shallow convection scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/cu_gf_driver_post.F90 b/physics/cu_gf_driver_post.F90 index d2423de55..4e172ed5a 100644 --- a/physics/cu_gf_driver_post.F90 +++ b/physics/cu_gf_driver_post.F90 @@ -18,17 +18,7 @@ subroutine cu_gf_driver_post_finalize() end subroutine cu_gf_driver_post_finalize !> \section arg_table_cu_gf_driver_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|--------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | t | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | in | F | -!! | q | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | prevst | temperature_from_previous_timestep | temperature from previous time step | K | 2 | real | kind_phys | out | F | -!! | prevsq | moisture_from_previous_timestep | moisture from previous time step | kg kg-1 | 2 | real | kind_phys | out | F | -!! | cactiv | conv_activity_counter | convective activity memory | none | 1 | integer | | in | F | -!! | conv_act | gf_memory_counter | Memory counter for GF | none | 1 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cu_gf_driver_post_run.html !! subroutine cu_gf_driver_post_run (im, t, q, prevst, prevsq, cactiv, conv_act, errmsg, errflg) diff --git a/physics/cu_gf_driver_post.meta b/physics/cu_gf_driver_post.meta new file mode 100644 index 000000000..9a28bc719 --- /dev/null +++ b/physics/cu_gf_driver_post.meta @@ -0,0 +1,81 @@ +[ccpp-arg-table] + name = cu_gf_driver_post_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[t] + standard_name = air_temperature_updated_by_physics + long_name = temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prevst] + standard_name = temperature_from_previous_timestep + long_name = temperature from previous time step + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[prevsq] + standard_name = moisture_from_previous_timestep + long_name = moisture from previous time step + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cactiv] + standard_name = conv_activity_counter + long_name = convective activity memory + units = none + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[conv_act] + standard_name = gf_memory_counter + long_name = Memory counter for GF + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/cu_gf_driver_pre.F90 b/physics/cu_gf_driver_pre.F90 index dfaad6bf6..3512f65f9 100644 --- a/physics/cu_gf_driver_pre.F90 +++ b/physics/cu_gf_driver_pre.F90 @@ -18,23 +18,7 @@ subroutine cu_gf_driver_pre_finalize() end subroutine cu_gf_driver_pre_finalize !> \section arg_table_cu_gf_driver_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|--------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | flag_init | flag_for_first_time_step | flag signaling first time step for time integration loop | flag | 0 | logical | | in | F | -!! | flag_restart | flag_for_restart | flag for restart (warmstart) or coldstart | flag | 0 | logical | | in | F | -!! | kdt | index_of_time_step | current forecast iteration | index | 0 | integer | | in | F | -!! | fhour | forecast_time | curent forecast time | h | 0 | real | kind_phys | in | F | -!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | -!! | t | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | in | F | -!! | q | water_vapor_specific_humidity | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | in | F | -!! | prevst | temperature_from_previous_timestep | temperature from previous time step | K | 2 | real | kind_phys | in | F | -!! | prevsq | moisture_from_previous_timestep | moisture from previous time step | kg kg-1 | 2 | real | kind_phys | in | F | -!! | forcet | temperature_tendency_due_to_dynamics | temperature tendency due to dynamics only | K s-1 | 2 | real | kind_phys | out | F | -!! | forceq | moisture_tendency_due_to_dynamics | moisture tendency due to dynamics only | kg kg-1 s-1 | 2 | real | kind_phys | out | F | -!! | cactiv | conv_activity_counter | convective activity memory | none | 1 | integer | | out | F | -!! | conv_act | gf_memory_counter | Memory counter for GF | none | 1 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cu_gf_driver_pre_run.html !! subroutine cu_gf_driver_pre_run (flag_init, flag_restart, kdt, fhour, dtp, t, q, prevst, prevsq, & forcet, forceq, cactiv, conv_act, errmsg, errflg) diff --git a/physics/cu_gf_driver_pre.meta b/physics/cu_gf_driver_pre.meta new file mode 100644 index 000000000..353bbe889 --- /dev/null +++ b/physics/cu_gf_driver_pre.meta @@ -0,0 +1,133 @@ +[ccpp-arg-table] + name = cu_gf_driver_pre_run + type = scheme +[flag_init] + standard_name = flag_for_first_time_step + long_name = flag signaling first time step for time integration loop + units = flag + dimensions = () + type = logical + intent = in + optional = F +[flag_restart] + standard_name = flag_for_restart + long_name = flag for restart (warmstart) or coldstart + units = flag + dimensions = () + type = logical + intent = in + optional = F +[kdt] + standard_name = index_of_time_step + long_name = current forecast iteration + units = index + dimensions = () + type = integer + intent = in + optional = F +[fhour] + standard_name = forecast_time + long_name = curent forecast time + units = h + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dtp] + standard_name = time_step_for_physics + long_name = physics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[t] + standard_name = air_temperature + long_name = model layer mean temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q] + standard_name = water_vapor_specific_humidity + long_name = water vapor specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prevst] + standard_name = temperature_from_previous_timestep + long_name = temperature from previous time step + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prevsq] + standard_name = moisture_from_previous_timestep + long_name = moisture from previous time step + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[forcet] + standard_name = temperature_tendency_due_to_dynamics + long_name = temperature tendency due to dynamics only + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[forceq] + standard_name = moisture_tendency_due_to_dynamics + long_name = moisture tendency due to dynamics only + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cactiv] + standard_name = conv_activity_counter + long_name = convective activity memory + units = none + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[conv_act] + standard_name = gf_memory_counter + long_name = Memory counter for GF + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/cu_ntiedtke.F90 b/physics/cu_ntiedtke.F90 index dcce444e9..8e42ebdd4 100644 --- a/physics/cu_ntiedtke.F90 +++ b/physics/cu_ntiedtke.F90 @@ -104,12 +104,7 @@ module cu_ntiedtke !> \brief Brief description of the subroutine !! !! \section arg_table_cu_ntiedtke_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------------|--------------------|------------------------------------------|-------|------|-----------|-----------|--------|----------| -!! | mpirank | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | mpiroot | mpi_root | master MPI-rank | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cu_ntiedtke_init.html !! subroutine cu_ntiedtke_init(mpirank, mpiroot, errmsg, errflg) @@ -148,40 +143,7 @@ end subroutine cu_ntiedtke_finalize ! !! !! \section arg_table_cu_ntiedtke_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------|----------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | pu | x_wind_updated_by_physics | updated x-direction wind | m s-1 | 2 | real | kind_phys | inout | F | -!! | pv | y_wind_updated_by_physics | updated y-direction wind | m s-1 | 2 | real | kind_phys | inout | F | -!! | pt | air_temperature_updated_by_physics | updated temperature | K | 2 | real | kind_phys | inout | F | -!! | pqv | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | pqvf | moisture_tendency_due_to_dynamics | moisture tendency due to dynamics only | kg kg-1 s-1 | 2 | real | kind_phys | in | F | -!! | ptf | temperature_tendency_due_to_dynamics | temperature tendency due to dynamics only | K s-1 | 2 | real | kind_phys | in | F | -!! | clw | convective_transportable_tracers | array to contain cloud water and other tracers | kg kg-1 | 3 | real | kind_phys | inout | F | -!! | poz | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | pzz | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | pomg | omega | layer mean vertical velocity | Pa s-1 | 2 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | hfx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | zprecc | lwe_thickness_of_deep_convective_precipitation_amount | deep convective rainfall amount on physics timestep | m | 1 | real | kind_phys | out | F | -!! | lmask | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | -!! | lq | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | dx | cell_size | size of the grid cell | m | 1 | real | kind_phys | in | F | -!! | kbot | vertical_index_at_cloud_base | index for cloud base | index | 1 | integer | | out | F | -!! | ktop | vertical_index_at_cloud_top | index for cloud top | index | 1 | integer | | out | F | -!! | kcnv | flag_deep_convection | deep convection: 0=no, 1=yes | flag | 1 | integer | | out | F | -!! | ktrac | number_of_total_tracers | number of total tracers | count | 0 | integer | | in | F | -!! | ud_mf | instantaneous_atmosphere_updraft_convective_mass_flux | (updraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | -!! | dd_mf | instantaneous_atmosphere_downdraft_convective_mass_flux | (downdraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | -!! | dt_mf | instantaneous_atmosphere_detrainment_convective_mass_flux | (detrainment mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | -!! | cnvw | convective_cloud_water_mixing_ratio | convective cloud water | kg kg-1 | 2 | real | kind_phys | out | F | -!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cu_ntiedtke_run.html !! !----------------------------------------------------------------------- ! level 1 subroutine 'tiecnvn' diff --git a/physics/cu_ntiedtke.meta b/physics/cu_ntiedtke.meta new file mode 100644 index 000000000..da9219c10 --- /dev/null +++ b/physics/cu_ntiedtke.meta @@ -0,0 +1,325 @@ +[ccpp-arg-table] + name = cu_ntiedtke_init + type = scheme +[mpirank] + standard_name = mpi_rank + long_name = current MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[mpiroot] + standard_name = mpi_root + long_name = master MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = cu_ntiedtke_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = cu_ntiedtke_run + type = scheme +[pu] + standard_name = x_wind_updated_by_physics + long_name = updated x-direction wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[pv] + standard_name = y_wind_updated_by_physics + long_name = updated y-direction wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[pt] + standard_name = air_temperature_updated_by_physics + long_name = updated temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[pqv] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[pqvf] + standard_name = moisture_tendency_due_to_dynamics + long_name = moisture tendency due to dynamics only + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ptf] + standard_name = temperature_tendency_due_to_dynamics + long_name = temperature tendency due to dynamics only + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[clw] + standard_name = convective_transportable_tracers + long_name = array to contain cloud water and other tracers + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers_for_convective_transport) + type = real + kind = kind_phys + intent = inout + optional = F +[poz] + standard_name = geopotential + long_name = geopotential at model layer centers + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[pzz] + standard_name = geopotential_at_interface + long_name = geopotential at model layer interfaces + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsi] + standard_name = air_pressure_at_interface + long_name = air pressure at model layer interfaces + units = Pa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[pomg] + standard_name = omega + long_name = layer mean vertical velocity + units = Pa s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux + long_name = kinematic surface upward latent heat flux + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[hfx] + standard_name = kinematic_surface_upward_sensible_heat_flux + long_name = kinematic surface upward sensible heat flux + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zprecc] + standard_name = lwe_thickness_of_deep_convective_precipitation_amount + long_name = deep convective rainfall amount on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[lmask] + standard_name = sea_land_ice_mask + long_name = landmask: sea/land/ice=0/1/2 + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[lq] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[dt] + standard_name = time_step_for_physics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dx] + standard_name = cell_size + long_name = size of the grid cell + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[kbot] + standard_name = vertical_index_at_cloud_base + long_name = index for cloud base + units = index + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[ktop] + standard_name = vertical_index_at_cloud_top + long_name = index for cloud top + units = index + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[kcnv] + standard_name = flag_deep_convection + long_name = deep convection: 0=no, 1=yes + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[ktrac] + standard_name = number_of_total_tracers + long_name = number of total tracers + units = count + dimensions = () + type = integer + intent = in + optional = F +[ud_mf] + standard_name = instantaneous_atmosphere_updraft_convective_mass_flux + long_name = (updraft mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dd_mf] + standard_name = instantaneous_atmosphere_downdraft_convective_mass_flux + long_name = (downdraft mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dt_mf] + standard_name = instantaneous_atmosphere_detrainment_convective_mass_flux + long_name = (detrainment mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cnvw] + standard_name = convective_cloud_water_mixing_ratio + long_name = convective cloud water + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cnvc] + standard_name = convective_cloud_cover + long_name = convective cloud cover + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/cu_ntiedtke_post.F90 b/physics/cu_ntiedtke_post.F90 index fdc0b8b0f..5db6ab0af 100644 --- a/physics/cu_ntiedtke_post.F90 +++ b/physics/cu_ntiedtke_post.F90 @@ -18,14 +18,7 @@ subroutine cu_ntiedtke_post_finalize() end subroutine cu_ntiedtke_post_finalize !> \section arg_table_cu_ntiedtke_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|--------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | t | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | in | F | -!! | q | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | prevst | temperature_from_previous_timestep | temperature from previous time step | K | 2 | real | kind_phys | out | F | -!! | prevsq | moisture_from_previous_timestep | moisture from previous time step | kg kg-1 | 2 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cu_ntiedtke_post_run.html !! subroutine cu_ntiedtke_post_run (t, q, prevst, prevsq, errmsg, errflg) diff --git a/physics/cu_ntiedtke_post.meta b/physics/cu_ntiedtke_post.meta new file mode 100644 index 000000000..a4fea92b3 --- /dev/null +++ b/physics/cu_ntiedtke_post.meta @@ -0,0 +1,56 @@ +[ccpp-arg-table] + name = cu_ntiedtke_post_run + type = scheme +[t] + standard_name = air_temperature_updated_by_physics + long_name = temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prevst] + standard_name = temperature_from_previous_timestep + long_name = temperature from previous time step + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[prevsq] + standard_name = moisture_from_previous_timestep + long_name = moisture from previous time step + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/cu_ntiedtke_pre.F90 b/physics/cu_ntiedtke_pre.F90 index 725b4a351..95e4bccf8 100644 --- a/physics/cu_ntiedtke_pre.F90 +++ b/physics/cu_ntiedtke_pre.F90 @@ -18,21 +18,7 @@ subroutine cu_ntiedtke_pre_finalize() end subroutine cu_ntiedtke_pre_finalize !> \section arg_table_cu_ntiedtke_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|--------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | flag_init | flag_for_first_time_step | flag signaling first time step for time integration loop | flag | 0 | logical | | in | F | -!! | flag_restart | flag_for_restart | flag for restart (warmstart) or coldstart | flag | 0 | logical | | in | F | -!! | kdt | index_of_time_step | current forecast iteration | index | 0 | integer | | in | F | -!! | fhour | forecast_time | curent forecast time | h | 0 | real | kind_phys | in | F | -!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | -!! | t | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | in | F | -!! | q | water_vapor_specific_humidity | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | in | F | -!! | prevst | temperature_from_previous_timestep | temperature from previous time step | K | 2 | real | kind_phys | in | F | -!! | prevsq | moisture_from_previous_timestep | moisture from previous time step | kg kg-1 | 2 | real | kind_phys | in | F | -!! | forcet | temperature_tendency_due_to_dynamics | temperature tendency due to dynamics only | K s-1 | 2 | real | kind_phys | out | F | -!! | forceq | moisture_tendency_due_to_dynamics | moisture tendency due to dynamics only | kg kg-1 s-1 | 2 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cu_ntiedtke_pre_run.html !! subroutine cu_ntiedtke_pre_run (flag_init, flag_restart, kdt, fhour, dtp, t, q, prevst, prevsq, & forcet, forceq, errmsg, errflg) diff --git a/physics/cu_ntiedtke_pre.meta b/physics/cu_ntiedtke_pre.meta new file mode 100644 index 000000000..8fd2448a9 --- /dev/null +++ b/physics/cu_ntiedtke_pre.meta @@ -0,0 +1,116 @@ +[ccpp-arg-table] + name = cu_ntiedtke_pre_run + type = scheme +[flag_init] + standard_name = flag_for_first_time_step + long_name = flag signaling first time step for time integration loop + units = flag + dimensions = () + type = logical + intent = in + optional = F +[flag_restart] + standard_name = flag_for_restart + long_name = flag for restart (warmstart) or coldstart + units = flag + dimensions = () + type = logical + intent = in + optional = F +[kdt] + standard_name = index_of_time_step + long_name = current forecast iteration + units = index + dimensions = () + type = integer + intent = in + optional = F +[fhour] + standard_name = forecast_time + long_name = curent forecast time + units = h + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dtp] + standard_name = time_step_for_physics + long_name = physics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[t] + standard_name = air_temperature + long_name = model layer mean temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q] + standard_name = water_vapor_specific_humidity + long_name = water vapor specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prevst] + standard_name = temperature_from_previous_timestep + long_name = temperature from previous time step + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prevsq] + standard_name = moisture_from_previous_timestep + long_name = moisture from previous time step + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[forcet] + standard_name = temperature_tendency_due_to_dynamics + long_name = temperature tendency due to dynamics only + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[forceq] + standard_name = moisture_tendency_due_to_dynamics + long_name = moisture tendency due to dynamics only + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/dcyc2.f b/physics/dcyc2.f index 5844e7371..dfcff8adc 100644 --- a/physics/dcyc2.f +++ b/physics/dcyc2.f @@ -160,58 +160,7 @@ end subroutine dcyc2t3_finalize !! way and add more accuracy when physics !! time step is close to radiation time step !> \section arg_table_dcyc2t3_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | solhr | forecast_hour | forecast time in 24-hour form | h | 0 | real | kind_phys | in | F | -!! | slag | equation_of_time | equation of time | radians | 0 | real | kind_phys | in | F | -!! | sdec | sine_of_solar_declination_angle | sine of solar declination angle | none | 0 | real | kind_phys | in | F | -!! | cdec | cosine_of_solar_declination_angle | cosine of solar declination angle | none | 0 | real | kind_phys | in | F | -!! | sinlat | sine_of_latitude | sine of latitude | none | 1 | real | kind_phys | in | F | -!! | coslat | cosine_of_latitude | cosine of latitude | none | 1 | real | kind_phys | in | F | -!! | xlon | longitude | longitude of grid box | radians | 1 | real | kind_phys | in | F | -!! | coszen | cosine_of_zenith_angle | average of cosine of zenith angle over daytime shortwave call time interval | none | 1 | real | kind_phys | in | F | -!! | tsea | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | -!! | tf | air_temperature_at_lowest_model_layer | air temperature at lowest model layer | K | 1 | real | kind_phys | in | F | -!! | tsflw | surface_midlayer_air_temperature_in_longwave_radiation | surface (first layer) air temperature saved in longwave radiation call | K | 1 | real | kind_phys | in | F | -!! | sfcemis | surface_longwave_emissivity | surface emissivity | frac | 1 | real | kind_phys | in | F | -!! | sfcdsw | surface_downwelling_shortwave_flux_on_radiation_time_step | total sky surface downwelling shortwave flux on radiation time step | W m-2 | 1 | real | kind_phys | in | F | -!! | sfcnsw | surface_net_downwelling_shortwave_flux_on_radiation_time_step | total sky surface net downwelling shortwave flux on radiation time step | W m-2 | 1 | real | kind_phys | in | F | -!! | sfcdlw | surface_downwelling_longwave_flux_on_radiation_time_step | total sky surface downwelling longwave flux on radiation time step | W m-2 | 1 | real | kind_phys | in | F | -!! | swh | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step | total sky shortwave heating rate on radiation time step | K s-1 | 2 | real | kind_phys | in | F | -!! | swhc | tendency_of_air_temperature_due_to_shortwave_heating_assuming_clear_sky_on_radiation_time_step | clear sky shortwave heating rate on radiation time step | K s-1 | 2 | real | kind_phys | in | F | -!! | hlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step | total sky longwave heating rate on radiation time step | K s-1 | 2 | real | kind_phys | in | F | -!! | hlwc | tendency_of_air_temperature_due_to_longwave_heating_assuming_clear_sky_on_radiation_time_step | clear sky longwave heating rate on radiation time step | K s-1 | 2 | real | kind_phys | in | F | -!! | sfcnirbmu | surface_upwelling_direct_near_infrared_shortwave_flux_on_radiation_time_step | total sky surface upwelling beam near-infrared shortwave flux on radiation time step | W m-2 | 1 | real | kind_phys | in | F | -!! | sfcnirdfu | surface_upwelling_diffuse_near_infrared_shortwave_flux_on_radiation_time_step | total sky surface upwelling diffuse near-infrared shortwave flux on radiation time step | W m-2 | 1 | real | kind_phys | in | F | -!! | sfcvisbmu | surface_upwelling_direct_ultraviolet_and_visible_shortwave_flux_on_radiation_time_step | total sky surface upwelling beam ultraviolet plus visible shortwave flux on radiation time step | W m-2 | 1 | real | kind_phys | in | F | -!! | sfcvisdfu | surface_upwelling_diffuse_ultraviolet_and_visible_shortwave_flux_on_radiation_time_step | total sky surface upwelling diffuse ultraviolet plus visible shortwave flux on radiation time step | W m-2 | 1 | real | kind_phys | in | F | -!! | sfcnirbmd | surface_downwelling_direct_near_infrared_shortwave_flux_on_radiation_time_step | total sky surface downwelling beam near-infrared shortwave flux on radiation time step | W m-2 | 1 | real | kind_phys | in | F | -!! | sfcnirdfd | surface_downwelling_diffuse_near_infrared_shortwave_flux_on_radiation_time_step | total sky surface downwelling diffuse near-infrared shortwave flux on radiation time step | W m-2 | 1 | real | kind_phys | in | F | -!! | sfcvisbmd | surface_downwelling_direct_ultraviolet_and_visible_shortwave_flux_on_radiation_time_step | total sky surface downwelling beam ultraviolet plus visible shortwave flux on radiation time step | W m-2 | 1 | real | kind_phys | in | F | -!! | sfcvisdfd | surface_downwelling_diffuse_ultraviolet_and_visible_shortwave_flux_on_radiation_time_step | total sky surface downwelling diffuse ultraviolet plus visible shortwave flux on radiation time step | W m-2 | 1 | real | kind_phys | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | -!! | deltim | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | -!! | fhswr | frequency_for_shortwave_radiation | frequency for shortwave radiation | s | 0 | real | kind_phys | in | F | -!! | dtdt | tendency_of_air_temperature_due_to_model_physics | total radiative heating rate at current time | K s-1 | 2 | real | kind_phys | inout | F | -!! | dtdtc | tendency_of_air_temperature_due_to_radiative_heating_assuming_clear_sky | clear sky radiative (shortwave + longwave) heating rate at current time | K s-1 | 2 | real | kind_phys | inout | F | -!! | adjsfcdsw | surface_downwelling_shortwave_flux | surface downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | out | F | -!! | adjsfcnsw | surface_net_downwelling_shortwave_flux | surface net downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | out | F | -!! | adjsfcdlw | surface_downwelling_longwave_flux | surface downwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | out | F | -!! | adjsfculw | surface_upwelling_longwave_flux | surface upwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | out | F | -!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave fluxes | none | 1 | real | kind_phys | out | F | -!! | xcosz | instantaneous_cosine_of_zenith_angle | cosine of zenith angle at current time | none | 1 | real | kind_phys | out | F | -!! | adjnirbmu | surface_upwelling_direct_near_infrared_shortwave_flux | surface upwelling beam near-infrared shortwave flux at current time | W m-2 | 1 | real | kind_phys | out | F | -!! | adjnirdfu | surface_upwelling_diffuse_near_infrared_shortwave_flux | surface upwelling diffuse near-infrared shortwave flux at current time | W m-2 | 1 | real | kind_phys | out | F | -!! | adjvisbmu | surface_upwelling_direct_ultraviolet_and_visible_shortwave_flux | surface upwelling beam ultraviolet plus visible shortwave flux at current time | W m-2 | 1 | real | kind_phys | out | F | -!! | adjvisdfu | surface_upwelling_diffuse_ultraviolet_and_visible_shortwave_flux | surface upwelling diffuse ultraviolet plus visible shortwave flux at current time | W m-2 | 1 | real | kind_phys | out | F | -!! | adjnirbmd | surface_downwelling_direct_near_infrared_shortwave_flux | surface downwelling beam near-infrared shortwave flux at current time | W m-2 | 1 | real | kind_phys | out | F | -!! | adjnirdfd | surface_downwelling_diffuse_near_infrared_shortwave_flux | surface downwelling diffuse near-infrared shortwave flux at current time | W m-2 | 1 | real | kind_phys | out | F | -!! | adjvisbmd | surface_downwelling_direct_ultraviolet_and_visible_shortwave_flux | surface downwelling beam ultraviolet plus visible shortwave flux at current time | W m-2 | 1 | real | kind_phys | out | F | -!! | adjvisdfd | surface_downwelling_diffuse_ultraviolet_and_visible_shortwave_flux | surface downwelling diffuse ultraviolet plus visible shortwave flux at current time | W m-2 | 1 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude dcyc2t3_run.html !! !!\section dcyc2t3_general RRTMG dcyc2t3 General Algorithm !> @{ @@ -402,14 +351,7 @@ end subroutine dcyc2t3_post_finalize !! surface upwelling shortwave flux at current time. !! !! \section arg_table_dcyc2t3_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|----------------------------------------|--------------------------------------------------------|---------|------|-----------------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | adjsfcdsw | surface_downwelling_shortwave_flux | surface downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | adjsfcnsw | surface_net_downwelling_shortwave_flux | surface net downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | adjsfcusw | surface_upwelling_shortwave_flux | surface upwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude dcyc2t3_post_run.html !! subroutine dcyc2t3_post_run( & & im, adjsfcdsw, adjsfcnsw, adjsfcusw, & diff --git a/physics/dcyc2.meta b/physics/dcyc2.meta new file mode 100644 index 000000000..3e413817d --- /dev/null +++ b/physics/dcyc2.meta @@ -0,0 +1,526 @@ +[ccpp-arg-table] + name = dcyc2t3_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = dcyc2t3_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = dcyc2t3_run + type = scheme +[solhr] + standard_name = forecast_hour + long_name = forecast time in 24-hour form + units = h + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[slag] + standard_name = equation_of_time + long_name = equation of time + units = radians + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[sdec] + standard_name = sine_of_solar_declination_angle + long_name = sine of solar declination angle + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cdec] + standard_name = cosine_of_solar_declination_angle + long_name = cosine of solar declination angle + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[sinlat] + standard_name = sine_of_latitude + long_name = sine of latitude + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[coslat] + standard_name = cosine_of_latitude + long_name = cosine of latitude + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[xlon] + standard_name = longitude + long_name = longitude of grid box + units = radians + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[coszen] + standard_name = cosine_of_zenith_angle + long_name = average of cosine of zenith angle over daytime shortwave call time interval + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsea] + standard_name = surface_skin_temperature + long_name = surface skin temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tf] + standard_name = air_temperature_at_lowest_model_layer + long_name = air temperature at lowest model layer + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsflw] + standard_name = surface_midlayer_air_temperature_in_longwave_radiation + long_name = surface (first layer) air temperature saved in longwave radiation call + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcemis] + standard_name = surface_longwave_emissivity + long_name = surface emissivity + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcdsw] + standard_name = surface_downwelling_shortwave_flux_on_radiation_time_step + long_name = total sky surface downwelling shortwave flux on radiation time step + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcnsw] + standard_name = surface_net_downwelling_shortwave_flux_on_radiation_time_step + long_name = total sky surface net downwelling shortwave flux on radiation time step + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcdlw] + standard_name = surface_downwelling_longwave_flux_on_radiation_time_step + long_name = total sky surface downwelling longwave flux on radiation time step + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[swh] + standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step + long_name = total sky shortwave heating rate on radiation time step + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[swhc] + standard_name = tendency_of_air_temperature_due_to_shortwave_heating_assuming_clear_sky_on_radiation_time_step + long_name = clear sky shortwave heating rate on radiation time step + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[hlw] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step + long_name = total sky longwave heating rate on radiation time step + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[hlwc] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_assuming_clear_sky_on_radiation_time_step + long_name = clear sky longwave heating rate on radiation time step + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[sfcnirbmu] + standard_name = surface_upwelling_direct_near_infrared_shortwave_flux_on_radiation_time_step + long_name = total sky surface upwelling beam near-infrared shortwave flux on radiation time step + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcnirdfu] + standard_name = surface_upwelling_diffuse_near_infrared_shortwave_flux_on_radiation_time_step + long_name = total sky surface upwelling diffuse near-infrared shortwave flux on radiation time step + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcvisbmu] + standard_name = surface_upwelling_direct_ultraviolet_and_visible_shortwave_flux_on_radiation_time_step + long_name = total sky surface upwelling beam ultraviolet plus visible shortwave flux on radiation time step + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcvisdfu] + standard_name = surface_upwelling_diffuse_ultraviolet_and_visible_shortwave_flux_on_radiation_time_step + long_name = total sky surface upwelling diffuse ultraviolet plus visible shortwave flux on radiation time step + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcnirbmd] + standard_name = surface_downwelling_direct_near_infrared_shortwave_flux_on_radiation_time_step + long_name = total sky surface downwelling beam near-infrared shortwave flux on radiation time step + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcnirdfd] + standard_name = surface_downwelling_diffuse_near_infrared_shortwave_flux_on_radiation_time_step + long_name = total sky surface downwelling diffuse near-infrared shortwave flux on radiation time step + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcvisbmd] + standard_name = surface_downwelling_direct_ultraviolet_and_visible_shortwave_flux_on_radiation_time_step + long_name = total sky surface downwelling beam ultraviolet plus visible shortwave flux on radiation time step + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcvisdfd] + standard_name = surface_downwelling_diffuse_ultraviolet_and_visible_shortwave_flux_on_radiation_time_step + long_name = total sky surface downwelling diffuse ultraviolet plus visible shortwave flux on radiation time step + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of vertical layers + units = count + dimensions = () + type = integer + intent = in + optional = F +[deltim] + standard_name = time_step_for_dynamics + long_name = dynamics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[fhswr] + standard_name = frequency_for_shortwave_radiation + long_name = frequency for shortwave radiation + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dtdt] + standard_name = tendency_of_air_temperature_due_to_model_physics + long_name = total radiative heating rate at current time + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dtdtc] + standard_name = tendency_of_air_temperature_due_to_radiative_heating_assuming_clear_sky + long_name = clear sky radiative (shortwave + longwave) heating rate at current time + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[adjsfcdsw] + standard_name = surface_downwelling_shortwave_flux + long_name = surface downwelling shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[adjsfcnsw] + standard_name = surface_net_downwelling_shortwave_flux + long_name = surface net downwelling shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[adjsfcdlw] + standard_name = surface_downwelling_longwave_flux + long_name = surface downwelling longwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[adjsfculw] + standard_name = surface_upwelling_longwave_flux + long_name = surface upwelling longwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[xmu] + standard_name = zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes + long_name = zenith angle temporal adjustment factor for shortwave fluxes + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[xcosz] + standard_name = instantaneous_cosine_of_zenith_angle + long_name = cosine of zenith angle at current time + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[adjnirbmu] + standard_name = surface_upwelling_direct_near_infrared_shortwave_flux + long_name = surface upwelling beam near-infrared shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[adjnirdfu] + standard_name = surface_upwelling_diffuse_near_infrared_shortwave_flux + long_name = surface upwelling diffuse near-infrared shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[adjvisbmu] + standard_name = surface_upwelling_direct_ultraviolet_and_visible_shortwave_flux + long_name = surface upwelling beam ultraviolet plus visible shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[adjvisdfu] + standard_name = surface_upwelling_diffuse_ultraviolet_and_visible_shortwave_flux + long_name = surface upwelling diffuse ultraviolet plus visible shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[adjnirbmd] + standard_name = surface_downwelling_direct_near_infrared_shortwave_flux + long_name = surface downwelling beam near-infrared shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[adjnirdfd] + standard_name = surface_downwelling_diffuse_near_infrared_shortwave_flux + long_name = surface downwelling diffuse near-infrared shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[adjvisbmd] + standard_name = surface_downwelling_direct_ultraviolet_and_visible_shortwave_flux + long_name = surface downwelling beam ultraviolet plus visible shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[adjvisdfd] + standard_name = surface_downwelling_diffuse_ultraviolet_and_visible_shortwave_flux + long_name = surface downwelling diffuse ultraviolet plus visible shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = dcyc2t3_post_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = dcyc2t3_post_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = dcyc2t3_post_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[adjsfcdsw] + standard_name = surface_downwelling_shortwave_flux + long_name = surface downwelling shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[adjsfcnsw] + standard_name = surface_net_downwelling_shortwave_flux + long_name = surface net downwelling shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[adjsfcusw] + standard_name = surface_upwelling_shortwave_flux + long_name = surface upwelling shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/gcm_shoc.F90 b/physics/gcm_shoc.F90 index dff067893..1f466c50d 100644 --- a/physics/gcm_shoc.F90 +++ b/physics/gcm_shoc.F90 @@ -21,66 +21,7 @@ end subroutine shoc_finalize #if 0 !> \section arg_table_shoc_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------------------|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|---------------|------|------------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | nx | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | nzm | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | do_shoc | flag_for_shoc | flag for SHOC | flag | 0 | logical | | in | F | -!! | shocaftcnv | flag_for_shoc_after_convection | flag to execute SHOC after convection | flag | 0 | logical | | in | F | -!! | mg3_as_mg2 | flag_mg3_as_mg2 | flag for controlling prep for Morrison-Gettelman microphysics | flag | 0 | logical | | in | F | -!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_zhao_carr | flag_for_zhao_carr_microphysics_scheme | choice of Zhao-Carr microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_zhao_carr_pdf | flag_for_zhao_carr_pdf_microphysics_scheme | choice of Zhao-Carr microphysics scheme with PDF clouds | flag | 0 | integer | | in | F | -!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | -!! | fprcp | number_of_frozen_precipitation_species | number of frozen precipitation species | count | 0 | integer | | in | F | -!! | tcr | cloud_phase_transition_threshold_temperature | threshold temperature below which cloud starts to freeze | K | 0 | real | kind_phys | in | F | -!! | tcrf | cloud_phase_transition_denominator | denominator in cloud phase transition = 1/(tcr-tf) | K-1 | 0 | real | kind_phys | in | F | -!! | con_cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | con_hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | con_hfus | latent_heat_of_fusion_of_water_at_0C | latent heat of fusion | J kg-1 | 0 | real | kind_phys | in | F | -!! | con_rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | con_rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | con_pi | pi | ratio of a circle's circumference to its diameter | radians | 0 | real | kind_phys | in | F | -!! | con_fvirt | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | gq0_cloud_ice | ice_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of ice water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gq0_rain | rain_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of rain water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gq0_snow | snow_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of snow water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gq0_graupel | graupel_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of graupel updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | dtp | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | -!! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | u | x_wind_updated_by_physics | zonal wind updated by physics | m s-1 | 2 | real | kind_phys | in | F | -!! | v | y_wind_updated_by_physics | meridional wind updated by physics | m s-1 | 2 | real | kind_phys | in | F | -!! | omega | omega | layer mean vertical velocity | Pa s-1 | 2 | real | kind_phys | in | F | -!! | rhc | critical_relative_humidity | critical relative humidity | frac | 2 | real | kind_phys | in | F | -!! | supice | ice_supersaturation_threshold | ice supersaturation parameter for PDF clouds | none | 0 | real | kind_phys | in | F | -!! | pcrit | shoc_tke_dissipatation_pressure_threshold | pressure below which extra TKE diss. is applied in SHOC | Pa | 0 | real | kind_phys | in | F | -!! | cefac | shoc_tke_dissipation_tunable_parameter | mult. tuning parameter for TKE diss. in SHOC | none | 0 | real | kind_phys | in | F | -!! | cesfac | shoc_tke_dissipation_tunable_parameter_near_surface | mult. tuning parameter for TKE diss. at surface in SHOC | none | 0 | real | kind_phys | in | F | -!! | tkef1 | shoc_implicit_TKE_integration_uncentering_term | uncentering term for TKE integration in SHOC | none | 0 | real | kind_phys | in | F | -!! | dis_opt | shoc_flag_for_optional_surface_TKE_dissipation | flag for alt. TKE diss. near surface in SHOC (>0 = ON) | none | 0 | real | kind_phys | in | F | -!! | hflx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | prnum | prandtl_number | turbulent Prandtl number | none | 2 | real | kind_phys | in | F | -!! | skip_macro | flag_skip_macro | flag to skip cloud macrophysics in Morrison scheme | flag | 0 | logical | | inout | F | -!! | clw_ice | ice_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | clw_liquid | cloud_condensed_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | gq0_cloud_liquid | cloud_condensed_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of cloud condensed water updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ncpl | cloud_droplet_number_concentration_updated_by_physics | number concentration of cloud droplets updated by physics | kg-1 | 2 | real | kind_phys | inout | F | -!! | ncpi | ice_number_concentration_updated_by_physics | number concentration of ice updated by physics | kg-1 | 2 | real | kind_phys | inout | F | -!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | inout | F | -!! | gq0_water_vapor | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | cld_sgs | subgrid_scale_cloud_fraction_from_shoc | subgrid-scale cloud fraction from the SHOC scheme | frac | 2 | real | kind_phys | inout | F | -!! | tke | turbulent_kinetic_energy_convective_transport_tracer | turbulent kinetic energy in the convectively transported tracer array | m2 s-2 | 2 | real | kind_phys | inout | F | -!! | tkh | atmosphere_heat_diffusivity_from_shoc | diffusivity for heat from the SHOC scheme | m2 s-1 | 2 | real | kind_phys | inout | F | -!! | wthv_sec | kinematic_buoyancy_flux_from_shoc | upward kinematic buoyancy flux from the SHOC scheme | K m s-1 | 2 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude shoc_run.html !! #endif subroutine shoc_run (ix, nx, nzm, do_shoc, shocaftcnv, mg3_as_mg2, imp_physics, imp_physics_gfdl, imp_physics_zhao_carr, & diff --git a/physics/gcm_shoc.meta b/physics/gcm_shoc.meta new file mode 100644 index 000000000..9fb5cb38d --- /dev/null +++ b/physics/gcm_shoc.meta @@ -0,0 +1,510 @@ +[ccpp-arg-table] + name = shoc_run + type = scheme +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[nx] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[nzm] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[do_shoc] + standard_name = flag_for_shoc + long_name = flag for SHOC + units = flag + dimensions = () + type = logical + intent = in + optional = F +[shocaftcnv] + standard_name = flag_for_shoc_after_convection + long_name = flag to execute SHOC after convection + units = flag + dimensions = () + type = logical + intent = in + optional = F +[mg3_as_mg2] + standard_name = flag_mg3_as_mg2 + long_name = flag for controlling prep for Morrison-Gettelman microphysics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[imp_physics] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_gfdl] + standard_name = flag_for_gfdl_microphysics_scheme + long_name = choice of GFDL microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_zhao_carr] + standard_name = flag_for_zhao_carr_microphysics_scheme + long_name = choice of Zhao-Carr microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_zhao_carr_pdf] + standard_name = flag_for_zhao_carr_pdf_microphysics_scheme + long_name = choice of Zhao-Carr microphysics scheme with PDF clouds + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_mg] + standard_name = flag_for_morrison_gettelman_microphysics_scheme + long_name = choice of Morrison-Gettelman microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[fprcp] + standard_name = number_of_frozen_precipitation_species + long_name = number of frozen precipitation species + units = count + dimensions = () + type = integer + intent = in + optional = F +[tcr] + standard_name = cloud_phase_transition_threshold_temperature + long_name = threshold temperature below which cloud starts to freeze + units = K + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[tcrf] + standard_name = cloud_phase_transition_denominator + long_name = denominator in cloud phase transition = 1/(tcr-tf) + units = K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_hfus] + standard_name = latent_heat_of_fusion_of_water_at_0C + long_name = latent heat of fusion + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_rv] + standard_name = gas_constant_water_vapor + long_name = ideal gas constant for water vapor + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = radians + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_fvirt] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[gq0_cloud_ice] + standard_name = ice_water_mixing_ratio_updated_by_physics + long_name = moist (dry+vapor, no condensates) mixing ratio of ice water updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0_rain] + standard_name = rain_water_mixing_ratio_updated_by_physics + long_name = moist (dry+vapor, no condensates) mixing ratio of rain water updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0_snow] + standard_name = snow_water_mixing_ratio_updated_by_physics + long_name = moist (dry+vapor, no condensates) mixing ratio of snow water updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0_graupel] + standard_name = graupel_mixing_ratio_updated_by_physics + long_name = moist (dry+vapor, no condensates) mixing ratio of graupel updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dtp] + standard_name = time_step_for_physics + long_name = time step for physics + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[me] + standard_name = mpi_rank + long_name = current MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[phii] + standard_name = geopotential_at_interface + long_name = geopotential at model layer interfaces + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[phil] + standard_name = geopotential + long_name = geopotential at model layer centers + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[u] + standard_name = x_wind_updated_by_physics + long_name = zonal wind updated by physics + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v] + standard_name = y_wind_updated_by_physics + long_name = meridional wind updated by physics + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[omega] + standard_name = omega + long_name = layer mean vertical velocity + units = Pa s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rhc] + standard_name = critical_relative_humidity + long_name = critical relative humidity + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[supice] + standard_name = ice_supersaturation_threshold + long_name = ice supersaturation parameter for PDF clouds + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[pcrit] + standard_name = shoc_tke_dissipatation_pressure_threshold + long_name = pressure below which extra TKE diss. is applied in SHOC + units = Pa + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cefac] + standard_name = shoc_tke_dissipation_tunable_parameter + long_name = mult. tuning parameter for TKE diss. in SHOC + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cesfac] + standard_name = shoc_tke_dissipation_tunable_parameter_near_surface + long_name = mult. tuning parameter for TKE diss. at surface in SHOC + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[tkef1] + standard_name = shoc_implicit_TKE_integration_uncentering_term + long_name = uncentering term for TKE integration in SHOC + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dis_opt] + standard_name = shoc_flag_for_optional_surface_TKE_dissipation + long_name = flag for alt. TKE diss. near surface in SHOC (>0 = ON) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hflx] + standard_name = kinematic_surface_upward_sensible_heat_flux + long_name = kinematic surface upward sensible heat flux + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux + long_name = kinematic surface upward latent heat flux + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prnum] + standard_name = prandtl_number + long_name = turbulent Prandtl number + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[skip_macro] + standard_name = flag_skip_macro + long_name = flag to skip cloud macrophysics in Morrison scheme + units = flag + dimensions = () + type = logical + intent = inout + optional = F +[clw_ice] + standard_name = ice_water_mixing_ratio_convective_transport_tracer + long_name = moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[clw_liquid] + standard_name = cloud_condensed_water_mixing_ratio_convective_transport_tracer + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gq0_cloud_liquid] + standard_name = cloud_condensed_water_mixing_ratio_updated_by_physics + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud condensed water updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ncpl] + standard_name = cloud_droplet_number_concentration_updated_by_physics + long_name = number concentration of cloud droplets updated by physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ncpi] + standard_name = ice_number_concentration_updated_by_physics + long_name = number concentration of ice updated by physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gq0_water_vapor] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cld_sgs] + standard_name = subgrid_scale_cloud_fraction_from_shoc + long_name = subgrid-scale cloud fraction from the SHOC scheme + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tke] + standard_name = turbulent_kinetic_energy_convective_transport_tracer + long_name = turbulent kinetic energy in the convectively transported tracer array + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tkh] + standard_name = atmosphere_heat_diffusivity_from_shoc + long_name = diffusivity for heat from the SHOC scheme + units = m2 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[wthv_sec] + standard_name = kinematic_buoyancy_flux_from_shoc + long_name = upward kinematic buoyancy flux from the SHOC scheme + units = K m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/get_prs_fv3.F90 b/physics/get_prs_fv3.F90 index 25074908d..dd5871896 100644 --- a/physics/get_prs_fv3.F90 +++ b/physics/get_prs_fv3.F90 @@ -20,18 +20,7 @@ end subroutine get_prs_fv3_init !! \section arg_table_get_prs_fv3_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | -!! | phii | geopotential_at_interface | interface geopotential | m2 s-2 | 2 | real | kind_phys | in | F | -!! | prsi | air_pressure_at_interface | interface pressure | Pa | 2 | real | kind_phys | in | F | -!! | tgrs | air_temperature | mid-layer temperature | K | 2 | real | kind_phys | in | F | -!! | qgrs1 | water_vapor_specific_humidity | mid-layer specific humidity of water vapor | kg kg-1 | 2 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | difference between mid-layer pressures | Pa | 2 | real | kind_phys | out | F | -!! | del_gz | geopotential_difference_between_midlayers_divided_by_midlayer_virtual_temperature | difference between mid-layer geopotentials divided by mid-layer virtual temperature | m2 s-2 K-1 | 2 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude get_prs_fv3_run.html !! subroutine get_prs_fv3_run(ix, levs, phii, prsi, tgrs, qgrs1, del, del_gz, errmsg, errflg) @@ -99,17 +88,7 @@ end subroutine get_phi_fv3_init !! \section arg_table_get_phi_fv3_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | -!! | gt0 | air_temperature_updated_by_physics | updated air temperature | K | 2 | real | kind_phys | in | F | -!! | gq01 | water_vapor_specific_humidity_updated_by_physics | mid-layer specific humidity of water vapor | kg kg-1 | 2 | real | kind_phys | in | F | -!! | del_gz | geopotential_difference_between_midlayers_divided_by_midlayer_virtual_temperature | difference between mid-layer geopotentials divided by mid-layer virtual temperature | m2 s-2 K-1 | 2 | real | kind_phys | inout | F | -!! | phii | geopotential_at_interface | interface geopotential | m2 s-2 | 2 | real | kind_phys | out | F | -!! | phil | geopotential | mid-layer geopotential | m2 s-2 | 2 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude get_phi_fv3_run.html !! subroutine get_phi_fv3_run(ix, levs, gt0, gq01, del_gz, phii, phil, errmsg, errflg) diff --git a/physics/get_prs_fv3.meta b/physics/get_prs_fv3.meta new file mode 100644 index 000000000..f93d259e1 --- /dev/null +++ b/physics/get_prs_fv3.meta @@ -0,0 +1,193 @@ +[ccpp-arg-table] + name = get_prs_fv3_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = get_prs_fv3_run + type = scheme +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of vertical layers + units = count + dimensions = () + type = integer + intent = in + optional = F +[phii] + standard_name = geopotential_at_interface + long_name = interface geopotential + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[prsi] + standard_name = air_pressure_at_interface + long_name = interface pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[tgrs] + standard_name = air_temperature + long_name = mid-layer temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qgrs1] + standard_name = water_vapor_specific_humidity + long_name = mid-layer specific humidity of water vapor + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[del] + standard_name = air_pressure_difference_between_midlayers + long_name = difference between mid-layer pressures + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[del_gz] + standard_name = geopotential_difference_between_midlayers_divided_by_midlayer_virtual_temperature + long_name = difference between mid-layer geopotentials divided by mid-layer virtual temperature + units = m2 s-2 K-1 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = get_prs_fv3_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = get_phi_fv3_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = get_phi_fv3_run + type = scheme +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of vertical layers + units = count + dimensions = () + type = integer + intent = in + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = updated air temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq01] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = mid-layer specific humidity of water vapor + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[del_gz] + standard_name = geopotential_difference_between_midlayers_divided_by_midlayer_virtual_temperature + long_name = difference between mid-layer geopotentials divided by mid-layer virtual temperature + units = m2 s-2 K-1 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = inout + optional = F +[phii] + standard_name = geopotential_at_interface + long_name = interface geopotential + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = out + optional = F +[phil] + standard_name = geopotential + long_name = mid-layer geopotential + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = get_phi_fv3_finalize + type = scheme diff --git a/physics/gfdl_cloud_microphys.F90 b/physics/gfdl_cloud_microphys.F90 index 903175572..6d907e40a 100644 --- a/physics/gfdl_cloud_microphys.F90 +++ b/physics/gfdl_cloud_microphys.F90 @@ -26,19 +26,7 @@ module gfdl_cloud_microphys !! cloud microphysics. !! !> \section arg_table_gfdl_cloud_microphys_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |------------------|--------------------------------------------------|----------------------------------------------------|--------|------|-----------|-------|--------|----------| -!! | me | mpi_rank | MPI rank of current process | index | 0 | integer | | in | F | -!! | master | mpi_root | MPI rank of master process | index | 0 | integer | | in | F | -!! | nlunit | iounit_namelist | fortran unit number for opening nameliust file | none | 0 | integer | | in | F | -!! | input_nml_file | namelist_filename_for_internal_file_reads | character string to store full namelist contents | none | 1 | character | len=* | in | F | -!! | logunit | iounit_log | fortran unit number for writing logfile | none | 0 | integer | | in | F | -!! | fn_nml | namelist_filename | namelist filename | none | 0 | character | len=* | in | F | -!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | -!! | do_shoc | flag_for_shoc | flag to indicate use of SHOC | flag | 0 | logical | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude gfdl_cloud_microphys_init.html !! subroutine gfdl_cloud_microphys_init (me, master, nlunit, input_nml_file, logunit, fn_nml, & imp_physics, imp_physics_gfdl, do_shoc, errmsg, errflg) @@ -86,10 +74,7 @@ end subroutine gfdl_cloud_microphys_init !! cloud microphysics. !! !! \section arg_table_gfdl_cloud_microphys_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-------------|--------------------|---------------------------------------------|---------|------|-----------|--------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude gfdl_cloud_microphys_finalize.html !! subroutine gfdl_cloud_microphys_finalize(errmsg, errflg) @@ -125,49 +110,7 @@ end subroutine gfdl_cloud_microphys_finalize !! !>\brief The subroutine executes the full GFDL cloud microphysics. !! \section arg_table_gfdl_cloud_microphys_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent| optional | -!! |------------------|------------------------------------------------------------------|-----------------------------------------------------------------------|------------|------|-----------|-----------|-------|----------| -!! | levs | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | con_fvirt | ratio_of_vapor_to_dry_air_gas_constants_minus_one | rv/rd - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | con_rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | frland | land_area_fraction_for_microphysics | land area fraction used in microphysics schemes | frac | 1 | real | kind_phys | in | F | -!! | garea | cell_area | area of grid cell | m2 | 1 | real | kind_phys | in | F | -!! | gq0 | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | gq0_ntcw | cloud_condensed_water_mixing_ratio_updated_by_physics | cloud condensed water mixing ratio updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | gq0_ntrw | rain_water_mixing_ratio_updated_by_physics | moist mixing ratio of rain updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | gq0_ntiw | ice_water_mixing_ratio_updated_by_physics | moist mixing ratio of cloud ice updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | gq0_ntsw | snow_water_mixing_ratio_updated_by_physics | moist mixing ratio of snow updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | gq0_ntgl | graupel_mixing_ratio_updated_by_physics | moist mixing ratio of graupel updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | gq0_ntclamt | cloud_fraction_updated_by_physics | cloud fraction updated by physics | frac | 2 | real | kind_phys | inout | F | -!! | gt0 | air_temperature_updated_by_physics | air temperature updated by physics | K | 2 | real | kind_phys | inout | F | -!! | gu0 | x_wind_updated_by_physics | zonal wind updated by physics | m s-1 | 2 | real | kind_phys | inout | F | -!! | gv0 | y_wind_updated_by_physics | meridional wind updated by physics | m s-1 | 2 | real | kind_phys | inout | F | -!! | vvl | omega | layer mean vertical velocity | Pa s-1 | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | air pressure difference between mid-layers | Pa | 2 | real | kind_phys | in | F | -!! | rain0 | lwe_thickness_of_explicit_rain_amount | explicit rain on physics timestep | m | 1 | real | kind_phys | out | F | -!! | ice0 | lwe_thickness_of_ice_amount | ice fall on physics timestep | m | 1 | real | kind_phys | out | F | -!! | snow0 | lwe_thickness_of_snow_amount | snow fall on physics timestep | m | 1 | real | kind_phys | out | F | -!! | graupel0 | lwe_thickness_of_graupel_amount | graupel fall on physics timestep | m | 1 | real | kind_phys | out | F | -!! | prcp0 | lwe_thickness_of_explicit_precipitation_amount | explicit precipitation (rain, ice, snow, graupel) on physics timestep | m | 1 | real | kind_phys | out | F | -!! | sr | ratio_of_snowfall_to_rainfall | snow ratio: ratio of snow to total precipitation | frac | 1 | real | kind_phys | out | F | -!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | -!! | hydrostatic | flag_for_hydrostatic_solver | flag indicating hydrostatic solver | flag | 0 | logical | | in | F | -!! | phys_hydrostatic | flag_for_hydrostatic_heating_from_physics | flag indicating hydrostatic heating from physics | flag | 0 | logical | | in | F | -!! | lradar | flag_for_radar_reflectivity | flag for radar reflectivity | flag | 0 | logical | | in | F | -!! | refl_10cm | radar_reflectivity_10cm | instantaneous refl_10cm | dBZ | 2 | real | kind_phys | inout | F | -!! | reset | flag_reset_maximum_hourly_fields | flag for resetting maximum hourly fields | flag | 0 | logical | | in | F | -!! | effr_in | flag_for_cloud_effective_radii | flag for cloud effective radii calculations in GFDL microphysics | | 0 | logical | | in | F | -!! | rew | effective_radius_of_stratiform_cloud_liquid_water_particle_in_um | eff. radius of cloud liquid water particle in micrometer | um | 2 | real | kind_phys | inout | F | -!! | rei | effective_radius_of_stratiform_cloud_ice_particle_in_um | eff. radius of cloud ice water particle in micrometer | um | 2 | real | kind_phys | inout | F | -!! | rer | effective_radius_of_stratiform_cloud_rain_particle_in_um | effective radius of cloud rain particle in micrometers | um | 2 | real | kind_phys | inout | F | -!! | res | effective_radius_of_stratiform_cloud_snow_particle_in_um | effective radius of cloud snow particle in micrometers | um | 2 | real | kind_phys | inout | F | -!! | reg | effective_radius_of_stratiform_cloud_graupel_particle_in_um | eff. radius of cloud graupel particle in micrometer | um | 2 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude gfdl_cloud_microphys_run.html !! subroutine gfdl_cloud_microphys_run( & levs, im, con_g, con_fvirt, con_rd, frland, garea, & diff --git a/physics/gfdl_cloud_microphys.meta b/physics/gfdl_cloud_microphys.meta new file mode 100644 index 000000000..c2ce3f8f5 --- /dev/null +++ b/physics/gfdl_cloud_microphys.meta @@ -0,0 +1,482 @@ +[ccpp-arg-table] + name = gfdl_cloud_microphys_init + type = scheme +[me] + standard_name = mpi_rank + long_name = MPI rank of current process + units = index + dimensions = () + type = integer + intent = in + optional = F +[master] + standard_name = mpi_root + long_name = MPI rank of master process + units = index + dimensions = () + type = integer + intent = in + optional = F +[nlunit] + standard_name = iounit_namelist + long_name = fortran unit number for opening nameliust file + units = none + dimensions = () + type = integer + intent = in + optional = F +[input_nml_file] + standard_name = namelist_filename_for_internal_file_reads + long_name = character string to store full namelist contents + units = none + dimensions = (number_of_lines_of_namelist_filename_for_internal_file_reads) + type = character + kind = len=* + intent = in + optional = F +[logunit] + standard_name = iounit_log + long_name = fortran unit number for writing logfile + units = none + dimensions = () + type = integer + intent = in + optional = F +[fn_nml] + standard_name = namelist_filename + long_name = namelist filename + units = none + dimensions = () + type = character + kind = len=* + intent = in + optional = F +[imp_physics] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_gfdl] + standard_name = flag_for_gfdl_microphysics_scheme + long_name = choice of GFDL microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[do_shoc] + standard_name = flag_for_shoc + long_name = flag to indicate use of SHOC + units = flag + dimensions = () + type = logical + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = gfdl_cloud_microphys_finalize + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = gfdl_cloud_microphys_run + type = scheme +[levs] + standard_name = vertical_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_fvirt] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = rv/rd - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[frland] + standard_name = land_area_fraction_for_microphysics + long_name = land area fraction used in microphysics schemes + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[garea] + standard_name = cell_area + long_name = area of grid cell + units = m2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gq0_ntcw] + standard_name = cloud_condensed_water_mixing_ratio_updated_by_physics + long_name = cloud condensed water mixing ratio updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gq0_ntrw] + standard_name = rain_water_mixing_ratio_updated_by_physics + long_name = moist mixing ratio of rain updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gq0_ntiw] + standard_name = ice_water_mixing_ratio_updated_by_physics + long_name = moist mixing ratio of cloud ice updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gq0_ntsw] + standard_name = snow_water_mixing_ratio_updated_by_physics + long_name = moist mixing ratio of snow updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gq0_ntgl] + standard_name = graupel_mixing_ratio_updated_by_physics + long_name = moist mixing ratio of graupel updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gq0_ntclamt] + standard_name = cloud_fraction_updated_by_physics + long_name = cloud fraction updated by physics + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = air temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gu0] + standard_name = x_wind_updated_by_physics + long_name = zonal wind updated by physics + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gv0] + standard_name = y_wind_updated_by_physics + long_name = meridional wind updated by physics + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[vvl] + standard_name = omega + long_name = layer mean vertical velocity + units = Pa s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[phii] + standard_name = geopotential_at_interface + long_name = geopotential at model layer interfaces + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[del] + standard_name = air_pressure_difference_between_midlayers + long_name = air pressure difference between mid-layers + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rain0] + standard_name = lwe_thickness_of_explicit_rain_amount + long_name = explicit rain on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[ice0] + standard_name = lwe_thickness_of_ice_amount + long_name = ice fall on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[snow0] + standard_name = lwe_thickness_of_snow_amount + long_name = snow fall on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[graupel0] + standard_name = lwe_thickness_of_graupel_amount + long_name = graupel fall on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[prcp0] + standard_name = lwe_thickness_of_explicit_precipitation_amount + long_name = explicit precipitation (rain, ice, snow, graupel) on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[sr] + standard_name = ratio_of_snowfall_to_rainfall + long_name = snow ratio: ratio of snow to total precipitation + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dtp] + standard_name = time_step_for_physics + long_name = physics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hydrostatic] + standard_name = flag_for_hydrostatic_solver + long_name = flag indicating hydrostatic solver + units = flag + dimensions = () + type = logical + intent = in + optional = F +[phys_hydrostatic] + standard_name = flag_for_hydrostatic_heating_from_physics + long_name = flag indicating hydrostatic heating from physics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lradar] + standard_name = flag_for_radar_reflectivity + long_name = flag for radar reflectivity + units = flag + dimensions = () + type = logical + intent = in + optional = F +[refl_10cm] + standard_name = radar_reflectivity_10cm + long_name = instantaneous refl_10cm + units = dBZ + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[reset] + standard_name = flag_reset_maximum_hourly_fields + long_name = flag for resetting maximum hourly fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[effr_in] + standard_name = flag_for_cloud_effective_radii + long_name = flag for cloud effective radii calculations in GFDL microphysics + units = + dimensions = () + type = logical + intent = in + optional = F +[rew] + standard_name = effective_radius_of_stratiform_cloud_liquid_water_particle_in_um + long_name = eff. radius of cloud liquid water particle in micrometer + units = um + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rei] + standard_name = effective_radius_of_stratiform_cloud_ice_particle_in_um + long_name = eff. radius of cloud ice water particle in micrometer + units = um + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rer] + standard_name = effective_radius_of_stratiform_cloud_rain_particle_in_um + long_name = effective radius of cloud rain particle in micrometers + units = um + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[res] + standard_name = effective_radius_of_stratiform_cloud_snow_particle_in_um + long_name = effective radius of cloud snow particle in micrometers + units = um + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[reg] + standard_name = effective_radius_of_stratiform_cloud_graupel_particle_in_um + long_name = eff. radius of cloud graupel particle in micrometer + units = um + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/gfdl_fv_sat_adj.F90 b/physics/gfdl_fv_sat_adj.F90 index 3b8cca3b3..d535ebc91 100644 --- a/physics/gfdl_fv_sat_adj.F90 +++ b/physics/gfdl_fv_sat_adj.F90 @@ -117,18 +117,7 @@ module fv_sat_adj !>\brief The subroutine 'fv_sat_adj_init' initializes lookup tables for the saturation mixing ratio. !! \section arg_table_fv_sat_adj_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|---------------------------------------------------------------|----------------------------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | do_sat_adj | flag_for_saturation_adjustment_for_microphysics_in_dynamics | flag for saturation adjustment for microphysics in dynamics | none | 0 | logical | | in | F | -!! | kmp | top_layer_index_for_fast_physics | top_layer_inder_for_gfdl_mp | index | 0 | integer | | in | F | -!! | nwat | number_of_water_species | number of water species | count | 0 | integer | | in | F | -!! | ngas | number_of_gases_for_multi_gases_physics | number of gases for multi gases physics | count | 0 | integer | | in | F | -!! | rilist | gas_constants_for_multi_gases_physics | gas constants for multi gases physics | J kg-1 K-1 | 1 | real | kind_dyn | in | F | -!! | cpilist | specific_heat_capacities_for_multi_gases_physics | specific heat capacities for multi gases physics | J kg-1 K-1 | 1 | real | kind_dyn | in | F | -!! | mpirank | mpi_rank_for_fast_physics | current MPI-rank for fast physics schemes | index | 0 | integer | | in | F | -!! | mpiroot | mpi_root_for_fast_physics | master MPI-rank for fast physics schemes | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude fv_sat_adj_init.html !! subroutine fv_sat_adj_init(do_sat_adj, kmp, nwat, ngas, rilist, cpilist, & mpirank, mpiroot, errmsg, errflg) @@ -194,10 +183,7 @@ end subroutine fv_sat_adj_init !\ingroup fast_sat_adj !>\brief The subroutine 'fv_sat_adj_finalize' deallocates lookup tables for the saturation mixing ratio. !! \section arg_table_fv_sat_adj_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|---------------------------------------------------------------|----------------------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude fv_sat_adj_finalize.html !! subroutine fv_sat_adj_finalize (errmsg, errflg) @@ -237,52 +223,7 @@ end subroutine fv_sat_adj_finalize !! It handles the heat release due to in situ phase changes. !! !! \section arg_table_fv_sat_adj_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|---------------------------------------------------------------|----------------------------------------------------------------------------------------|-----------|------|-----------|-----------|--------|----------| -!! | mdt | time_step_for_remapping_for_fast_physics | remapping time step for fast physics | s | 0 | real | kind_dyn | in | F | -!! | zvir | ratio_of_vapor_to_dry_air_gas_constants_minus_one_default_kind| zvir=rv/rd-1.0 | none | 0 | real | kind_dyn | in | F | -!! | is | starting_x_direction_index | starting X direction index | count | 0 | integer | | in | F | -!! | ie | ending_x_direction_index | ending X direction index | count | 0 | integer | | in | F | -!! | isd | starting_x_direction_index_domain | starting X direction index for domain | count | 0 | integer | | in | F | -!! | ied | ending_x_direction_index_domain | ending X direction index for domain | count | 0 | integer | | in | F | -!! | kmp | top_layer_index_for_fast_physics | top layer index for GFDL mp | index | 0 | integer | | in | F | -!! | km | vertical_dimension_for_fast_physics | number of vertical levels | count | 0 | integer | | in | F | -!! | kmdelz | vertical_dimension_for_thickness_at_Lagrangian_surface | vertical dimension for thickness at Lagrangian surface | count | 0 | integer | | in | F | -!! | js | starting_y_direction_index | starting Y direction index | count | 0 | integer | | in | F | -!! | je | ending_y_direction_index | ending Y direction index | count | 0 | integer | | in | F | -!! | jsd | starting_y_direction_index_domain | starting X direction index for domain | count | 0 | integer | | in | F | -!! | jed | ending_y_direction_index_domain | ending X direction index for domain | count | 0 | integer | | in | F | -!! | ng | number_of_ghost_zones | number of ghost zones defined in fv_mp | count | 0 | integer | | in | F | -!! | hydrostatic | flag_for_hydrostatic_solver_for_fast_physics | flag for use the hydrostatic or nonhydrostatic solver | flag | 0 | logical | | in | F | -!! | fast_mp_consv | flag_for_fast_microphysics_energy_conservation | flag for fast microphysics energy conservation | flag | 0 | logical | | in | F | -!! | te0_2d | atmosphere_energy_content_in_column | atmosphere total energy in columns | J m-2 | 2 | real | kind_dyn | inout | F | -!! | te0 | atmosphere_energy_content_at_Lagrangian_surface | atmosphere total energy at Lagrangian surface | J m-2 | 3 | real | kind_dyn | out | F | -!! | ngas | number_of_gases_for_multi_gases_physics | number of gases for multi gases physics | count | 0 | integer | | in | F | -!! | qvi | gas_tracers_for_multi_gas_physics_at_Lagrangian_surface | gas tracers for multi gas physics at Lagrangian surface | kg kg-1 | 4 | real | kind_dyn | inout | F | -!! | qv | water_vapor_specific_humidity_at_Lagrangian_surface | water vapor specific humidity updated by fast physics at Lagrangian surface | kg kg-1 | 3 | real | kind_dyn | inout | F | -!! | ql | cloud_liquid_water_specific_humidity_at_Lagrangian_surface | cloud liquid water specific humidity updated by fast physics at Lagrangian surface | kg kg-1 | 3 | real | kind_dyn | inout | F | -!! | qi | cloud_ice_specific_humidity_at_Lagrangian_surface | cloud ice specific humidity updated by fast physics at Lagrangian surface | kg kg-1 | 3 | real | kind_dyn | inout | F | -!! | qr | cloud_rain_specific_humidity_at_Lagrangian_surface | cloud rain specific humidity updated by fast physics at Lagrangian surface | kg kg-1 | 3 | real | kind_dyn | inout | F | -!! | qs | cloud_snow_specific_humidity_at_Lagrangian_surface | cloud snow specific humidity updated by fast physics at Lagrangian surface | kg kg-1 | 3 | real | kind_dyn | inout | F | -!! | qg | cloud_graupel_specific_humidity_at_Lagrangian_surface | cloud graupel specific humidity updated by fast physics at Lagrangian surface | kg kg-1 | 3 | real | kind_dyn | inout | F | -!! | hs | surface_geopotential_at_Lagrangian_surface | surface geopotential at Lagrangian surface | m2 s-2 | 2 | real | kind_dyn | in | F | -!! | peln | log_pressure_at_Lagrangian_surface | logarithm of pressure at Lagrangian surface | Pa | 3 | real | kind_dyn | in | F | -!! | delz | thickness_at_Lagrangian_surface | thickness at Lagrangian_surface | m | 3 | real | kind_dyn | in | F | -!! | delp | pressure_thickness_at_Lagrangian_surface | pressure thickness at Lagrangian surface | Pa | 3 | real | kind_dyn | in | F | -!! | pt | virtual_temperature_at_Lagrangian_surface | virtual temperature at Lagrangian surface | K | 3 | real | kind_dyn | inout | F | -!! | pkz | finite_volume_mean_edge_pressure_raised_to_the_power_of_kappa | finite-volume mean edge pressure raised to the power of kappa | Pa**kappa | 3 | real | kind_dyn | inout | F | -!! | q_con | cloud_condensed_water_specific_humidity_at_Lagrangian_surface | cloud condensed water specific humidity updated by fast physics at Lagrangian surface | kg kg-1 | 3 | real | kind_dyn | inout | F | -!! | akap | kappa_dry_for_fast_physics | modified kappa for dry air, fast physics | none | 0 | real | kind_dyn | in | F | -!! | cappa | cappa_moist_gas_constant_at_Lagrangian_surface | cappa(i,j,k) = rdgas / ( rdgas + cvm(i)/(1.+r_vir*q(i,j,k,sphum)) ) | none | 3 | real | kind_dyn | inout | F | -!! | area | cell_area_for_fast_physics | area of the grid cell for fast physics | m2 | 2 | real | kind_grid | in | F | -!! | dtdt | tendency_of_air_temperature_at_Lagrangian_surface | air temperature tendency due to fast physics at Lagrangian surface | K s-1 | 3 | real | kind_dyn | inout | F | -!! | out_dt | flag_for_tendency_of_air_temperature_at_Lagrangian_surface | flag for calculating tendency of air temperature due to fast physics | flag | 0 | logical | | in | F | -!! | last_step | flag_for_the_last_step_of_k_split_remapping | flag for the last step of k-split remapping | flag | 0 | logical | | in | F | -!! | do_qa | flag_for_inline_cloud_fraction_calculation | flag for the inline cloud fraction calculation | flag | 0 | logical | | in | F | -!! | qa | cloud_fraction_at_Lagrangian_surface | cloud fraction at Lagrangian surface | none | 3 | real | kind_dyn | out | F | -!! | nthreads | omp_threads_for_fast_physics | number of OpenMP threads available for fast physics schemes | count | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude fv_sat_adj_run.html !! subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, kmp, km, kmdelz, js, je, jsd, jed, & ng, hydrostatic, fast_mp_consv, te0_2d, te0, ngas, qvi, qv, ql, qi, qr, & diff --git a/physics/gfdl_fv_sat_adj.meta b/physics/gfdl_fv_sat_adj.meta new file mode 100644 index 000000000..983863a26 --- /dev/null +++ b/physics/gfdl_fv_sat_adj.meta @@ -0,0 +1,489 @@ +[ccpp-arg-table] + name = fv_sat_adj_init + type = scheme +[do_sat_adj] + standard_name = flag_for_saturation_adjustment_for_microphysics_in_dynamics + long_name = flag for saturation adjustment for microphysics in dynamics + units = none + dimensions = () + type = logical + intent = in + optional = F +[kmp] + standard_name = top_layer_index_for_fast_physics + long_name = top_layer_inder_for_gfdl_mp + units = index + dimensions = () + type = integer + intent = in + optional = F +[nwat] + standard_name = number_of_water_species + long_name = number of water species + units = count + dimensions = () + type = integer + intent = in + optional = F +[ngas] + standard_name = number_of_gases_for_multi_gases_physics + long_name = number of gases for multi gases physics + units = count + dimensions = () + type = integer + intent = in + optional = F +[rilist] + standard_name = gas_constants_for_multi_gases_physics + long_name = gas constants for multi gases physics + units = J kg-1 K-1 + dimensions = (0:number_of_gases_for_multi_gases_physics) + type = real + kind = kind_dyn + intent = in + optional = F +[cpilist] + standard_name = specific_heat_capacities_for_multi_gases_physics + long_name = specific heat capacities for multi gases physics + units = J kg-1 K-1 + dimensions = (0:number_of_gases_for_multi_gases_physics) + type = real + kind = kind_dyn + intent = in + optional = F +[mpirank] + standard_name = mpi_rank_for_fast_physics + long_name = current MPI-rank for fast physics schemes + units = index + dimensions = () + type = integer + intent = in + optional = F +[mpiroot] + standard_name = mpi_root_for_fast_physics + long_name = master MPI-rank for fast physics schemes + units = index + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = fv_sat_adj_finalize + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = fv_sat_adj_run + type = scheme +[mdt] + standard_name = time_step_for_remapping_for_fast_physics + long_name = remapping time step for fast physics + units = s + dimensions = () + type = real + kind = kind_dyn + intent = in + optional = F +[zvir] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one_default_kind + long_name = zvir=rv/rd-1.0 + units = none + dimensions = () + type = real + kind = kind_dyn + intent = in + optional = F +[is] + standard_name = starting_x_direction_index + long_name = starting X direction index + units = count + dimensions = () + type = integer + intent = in + optional = F +[ie] + standard_name = ending_x_direction_index + long_name = ending X direction index + units = count + dimensions = () + type = integer + intent = in + optional = F +[isd] + standard_name = starting_x_direction_index_domain + long_name = starting X direction index for domain + units = count + dimensions = () + type = integer + intent = in + optional = F +[ied] + standard_name = ending_x_direction_index_domain + long_name = ending X direction index for domain + units = count + dimensions = () + type = integer + intent = in + optional = F +[kmp] + standard_name = top_layer_index_for_fast_physics + long_name = top layer index for GFDL mp + units = index + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension_for_fast_physics + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[kmdelz] + standard_name = vertical_dimension_for_thickness_at_Lagrangian_surface + long_name = vertical dimension for thickness at Lagrangian surface + units = count + dimensions = () + type = integer + intent = in + optional = F +[js] + standard_name = starting_y_direction_index + long_name = starting Y direction index + units = count + dimensions = () + type = integer + intent = in + optional = F +[je] + standard_name = ending_y_direction_index + long_name = ending Y direction index + units = count + dimensions = () + type = integer + intent = in + optional = F +[jsd] + standard_name = starting_y_direction_index_domain + long_name = starting X direction index for domain + units = count + dimensions = () + type = integer + intent = in + optional = F +[jed] + standard_name = ending_y_direction_index_domain + long_name = ending X direction index for domain + units = count + dimensions = () + type = integer + intent = in + optional = F +[ng] + standard_name = number_of_ghost_zones + long_name = number of ghost zones defined in fv_mp + units = count + dimensions = () + type = integer + intent = in + optional = F +[hydrostatic] + standard_name = flag_for_hydrostatic_solver_for_fast_physics + long_name = flag for use the hydrostatic or nonhydrostatic solver + units = flag + dimensions = () + type = logical + intent = in + optional = F +[fast_mp_consv] + standard_name = flag_for_fast_microphysics_energy_conservation + long_name = flag for fast microphysics energy conservation + units = flag + dimensions = () + type = logical + intent = in + optional = F +[te0_2d] + standard_name = atmosphere_energy_content_in_column + long_name = atmosphere total energy in columns + units = J m-2 + dimensions = (starting_x_direction_index:ending_x_direction_index,starting_y_direction_index:ending_y_direction_index) + type = real + kind = kind_dyn + intent = inout + optional = F +[te0] + standard_name = atmosphere_energy_content_at_Lagrangian_surface + long_name = atmosphere total energy at Lagrangian surface + units = J m-2 + dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + type = real + kind = kind_dyn + intent = out + optional = F +[ngas] + standard_name = number_of_gases_for_multi_gases_physics + long_name = number of gases for multi gases physics + units = count + dimensions = () + type = integer + intent = in + optional = F +[qvi] + standard_name = gas_tracers_for_multi_gas_physics_at_Lagrangian_surface + long_name = gas tracers for multi gas physics at Lagrangian surface + units = kg kg-1 + dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics,1:number_of_gases_for_multi_gases_physics) + type = real + kind = kind_dyn + intent = inout + optional = F +[qv] + standard_name = water_vapor_specific_humidity_at_Lagrangian_surface + long_name = water vapor specific humidity updated by fast physics at Lagrangian surface + units = kg kg-1 + dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + type = real + kind = kind_dyn + intent = inout + optional = F +[ql] + standard_name = cloud_liquid_water_specific_humidity_at_Lagrangian_surface + long_name = cloud liquid water specific humidity updated by fast physics at Lagrangian surface + units = kg kg-1 + dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + type = real + kind = kind_dyn + intent = inout + optional = F +[qi] + standard_name = cloud_ice_specific_humidity_at_Lagrangian_surface + long_name = cloud ice specific humidity updated by fast physics at Lagrangian surface + units = kg kg-1 + dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + type = real + kind = kind_dyn + intent = inout + optional = F +[qr] + standard_name = cloud_rain_specific_humidity_at_Lagrangian_surface + long_name = cloud rain specific humidity updated by fast physics at Lagrangian surface + units = kg kg-1 + dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + type = real + kind = kind_dyn + intent = inout + optional = F +[qs] + standard_name = cloud_snow_specific_humidity_at_Lagrangian_surface + long_name = cloud snow specific humidity updated by fast physics at Lagrangian surface + units = kg kg-1 + dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + type = real + kind = kind_dyn + intent = inout + optional = F +[qg] + standard_name = cloud_graupel_specific_humidity_at_Lagrangian_surface + long_name = cloud graupel specific humidity updated by fast physics at Lagrangian surface + units = kg kg-1 + dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + type = real + kind = kind_dyn + intent = inout + optional = F +[hs] + standard_name = surface_geopotential_at_Lagrangian_surface + long_name = surface geopotential at Lagrangian surface + units = m2 s-2 + dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain) + type = real + kind = kind_dyn + intent = in + optional = F +[peln] + standard_name = log_pressure_at_Lagrangian_surface + long_name = logarithm of pressure at Lagrangian surface + units = Pa + dimensions = (starting_x_direction_index:ending_x_direction_index,1:vertical_dimension_for_fast_physics_plus_one,starting_y_direction_index:ending_y_direction_index) + type = real + kind = kind_dyn + intent = in + optional = F +[delz] + standard_name = thickness_at_Lagrangian_surface + long_name = thickness at Lagrangian_surface + units = m + dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_thickness_at_Lagrangian_surface) + type = real + kind = kind_dyn + intent = in + optional = F +[delp] + standard_name = pressure_thickness_at_Lagrangian_surface + long_name = pressure thickness at Lagrangian surface + units = Pa + dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + type = real + kind = kind_dyn + intent = in + optional = F +[pt] + standard_name = virtual_temperature_at_Lagrangian_surface + long_name = virtual temperature at Lagrangian surface + units = K + dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + type = real + kind = kind_dyn + intent = inout + optional = F +[pkz] + standard_name = finite_volume_mean_edge_pressure_raised_to_the_power_of_kappa + long_name = finite-volume mean edge pressure raised to the power of kappa + units = Pa**kappa + dimensions = (starting_x_direction_index:ending_x_direction_index,starting_y_direction_index:ending_y_direction_index,1:vertical_dimension_for_fast_physics) + type = real + kind = kind_dyn + intent = inout + optional = F +[q_con] + standard_name = cloud_condensed_water_specific_humidity_at_Lagrangian_surface + long_name = cloud condensed water specific humidity updated by fast physics at Lagrangian surface + units = kg kg-1 + dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_condensed_water_at_Lagrangian_surface) + type = real + kind = kind_dyn + intent = inout + optional = F +[akap] + standard_name = kappa_dry_for_fast_physics + long_name = modified kappa for dry air, fast physics + units = none + dimensions = () + type = real + kind = kind_dyn + intent = in + optional = F +[cappa] + standard_name = cappa_moist_gas_constant_at_Lagrangian_surface + long_name = cappa(i,j,k) = rdgas / ( rdgas + cvm(i)/(1.+r_vir*q(i,j,k,sphum)) ) + units = none + dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_cappa_at_Lagrangian_surface) + type = real + kind = kind_dyn + intent = inout + optional = F +[area] + standard_name = cell_area_for_fast_physics + long_name = area of the grid cell for fast physics + units = m2 + dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain) + type = real + kind = kind_grid + intent = in + optional = F +[dtdt] + standard_name = tendency_of_air_temperature_at_Lagrangian_surface + long_name = air temperature tendency due to fast physics at Lagrangian surface + units = K s-1 + dimensions = (starting_x_direction_index:ending_x_direction_index,starting_y_direction_index:ending_y_direction_index,1:vertical_dimension_for_fast_physics) + type = real + kind = kind_dyn + intent = inout + optional = F +[out_dt] + standard_name = flag_for_tendency_of_air_temperature_at_Lagrangian_surface + long_name = flag for calculating tendency of air temperature due to fast physics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[last_step] + standard_name = flag_for_the_last_step_of_k_split_remapping + long_name = flag for the last step of k-split remapping + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_qa] + standard_name = flag_for_inline_cloud_fraction_calculation + long_name = flag for the inline cloud fraction calculation + units = flag + dimensions = () + type = logical + intent = in + optional = F +[qa] + standard_name = cloud_fraction_at_Lagrangian_surface + long_name = cloud fraction at Lagrangian surface + units = none + dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + type = real + kind = kind_dyn + intent = out + optional = F +[nthreads] + standard_name = omp_threads_for_fast_physics + long_name = number of OpenMP threads available for fast physics schemes + units = count + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/gmtb_scm_sfc_flux_spec.F90 b/physics/gmtb_scm_sfc_flux_spec.F90 index 8146ac540..d77e42000 100644 --- a/physics/gmtb_scm_sfc_flux_spec.F90 +++ b/physics/gmtb_scm_sfc_flux_spec.F90 @@ -25,42 +25,7 @@ end subroutine gmtb_scm_sfc_flux_spec_finalize !! is "backing out" parameters that are calculated in sfc_dff.f from the known surface heat fluxes and roughness length. !! !! \section arg_table_gmtb_scm_sfc_flux_spec_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |------------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | u1 | x_wind_at_lowest_model_layer | x component of 1st model layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | v1 | y_wind_at_lowest_model_layer | y component of 1st model layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | z1 | height_above_ground_at_lowest_model_layer | height above ground at 1st model layer | m | 1 | real | kind_phys | in | F | -!! | t1 | air_temperature_at_lowest_model_layer | 1st model layer air temperature | K | 1 | real | kind_phys | in | F | -!! | q1 | water_vapor_specific_humidity_at_lowest_model_layer | 1st model layer specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | p1 | air_pressure_at_lowest_model_layer | Model layer 1 mean pressure | Pa | 1 | real | kind_phys | in | F | -!! | roughness_length | surface_roughness_length | surface roughness length | cm | 1 | real | kind_phys | in | F | -!! | spec_sh_flux | specified_kinematic_surface_upward_sensible_heat_flux | specified kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | spec_lh_flux | specified_kinematic_surface_upward_latent_heat_flux | specified kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | exner_inverse | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | -!! | T_surf | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | grav | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of vaporization of water at 0C | J kg-1 | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | fvirt | ratio_of_vapor_to_dry_air_gas_constants_minus_one | rv/rd - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | vonKarman | vonKarman_constant | vonKarman constant | none | 0 | real | kind_phys | in | F | -!! | sh_flux | kinematic_surface_upward_sensible_heat_flux | surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | out | F | -!! | lh_flux | kinematic_surface_upward_latent_heat_flux | surface upward evaporation flux | kg kg-1 m s-1 | 1 | real | kind_phys | out | F | -!! | u_star | surface_friction_velocity | boundary layer parameter | m s-1 | 1 | real | kind_phys | out | F | -!! | sfc_stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | out | F | -!! | cm | surface_drag_coefficient_for_momentum_in_air | surface exchange coeff for momentum | none | 1 | real | kind_phys | out | F | -!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air | surface exchange coeff heat & moisture | none | 1 | real | kind_phys | out | F | -!! | fm | Monin_Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | out | F | -!! | fh | Monin_Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | out | F | -!! | rb | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | out | F | -!! | u10m | x_wind_at_10m | 10 meter u wind speed | m s-1 | 1 | real | kind_phys | out | F | -!! | v10m | y_wind_at_10m | 10 meter v wind speed | m s-1 | 1 | real | kind_phys | out | F | -!! | wind1 | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | out | F | -!! | qss | surface_specific_humidity | surface air saturation specific humidity | kg kg-1 | 1 | real | kind_phys | out | F | -!! | t2m | temperature_at_2m | 2 meter temperature | K | 1 | real | kind_phys | out | F | -!! | q2m | specific_humidity_at_2m | 2 meter specific humidity | kg kg-1 | 1 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude gmtb_scm_sfc_flux_spec_run.html !! !! \section general_sfc_flux_spec General Algorithm !! -# Compute friction velocity from the wind speed at the lowest model layer, the height about the ground, and the roughness length. diff --git a/physics/gmtb_scm_sfc_flux_spec.meta b/physics/gmtb_scm_sfc_flux_spec.meta new file mode 100644 index 000000000..6424789bc --- /dev/null +++ b/physics/gmtb_scm_sfc_flux_spec.meta @@ -0,0 +1,308 @@ +[ccpp-arg-table] + name = gmtb_scm_sfc_flux_spec_run + type = scheme +[u1] + standard_name = x_wind_at_lowest_model_layer + long_name = x component of 1st model layer wind + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v1] + standard_name = y_wind_at_lowest_model_layer + long_name = y component of 1st model layer wind + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[z1] + standard_name = height_above_ground_at_lowest_model_layer + long_name = height above ground at 1st model layer + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t1] + standard_name = air_temperature_at_lowest_model_layer + long_name = 1st model layer air temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q1] + standard_name = water_vapor_specific_humidity_at_lowest_model_layer + long_name = 1st model layer specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[p1] + standard_name = air_pressure_at_lowest_model_layer + long_name = Model layer 1 mean pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[roughness_length] + standard_name = surface_roughness_length + long_name = surface roughness length + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[spec_sh_flux] + standard_name = specified_kinematic_surface_upward_sensible_heat_flux + long_name = specified kinematic surface upward sensible heat flux + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[spec_lh_flux] + standard_name = specified_kinematic_surface_upward_latent_heat_flux + long_name = specified kinematic surface upward latent heat flux + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[exner_inverse] + standard_name = ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer + long_name = Exner function ratio bt midlayer and interface at 1st layer + units = ratio + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[T_surf] + standard_name = surface_skin_temperature + long_name = surface skin temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[grav] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of vaporization of water at 0C + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[fvirt] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = rv/rd - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[vonKarman] + standard_name = vonKarman_constant + long_name = vonKarman constant + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[sh_flux] + standard_name = kinematic_surface_upward_sensible_heat_flux + long_name = surface upward sensible heat flux + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[lh_flux] + standard_name = kinematic_surface_upward_latent_heat_flux + long_name = surface upward evaporation flux + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[u_star] + standard_name = surface_friction_velocity + long_name = boundary layer parameter + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[sfc_stress] + standard_name = surface_wind_stress + long_name = surface wind stress + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cm] + standard_name = surface_drag_coefficient_for_momentum_in_air + long_name = surface exchange coeff for momentum + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[ch] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air + long_name = surface exchange coeff heat & moisture + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[fm] + standard_name = Monin_Obukhov_similarity_function_for_momentum + long_name = Monin-Obukhov similarity function for momentum + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[fh] + standard_name = Monin_Obukhov_similarity_function_for_heat + long_name = Monin-Obukhov similarity function for heat + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[rb] + standard_name = bulk_richardson_number_at_lowest_model_level + long_name = bulk Richardson number at the surface + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[u10m] + standard_name = x_wind_at_10m + long_name = 10 meter u wind speed + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[v10m] + standard_name = y_wind_at_10m + long_name = 10 meter v wind speed + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[wind1] + standard_name = wind_speed_at_lowest_model_layer + long_name = wind speed at lowest model level + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[qss] + standard_name = surface_specific_humidity + long_name = surface air saturation specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[t2m] + standard_name = temperature_at_2m + long_name = 2 meter temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[q2m] + standard_name = specific_humidity_at_2m + long_name = 2 meter specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/gscond.f b/physics/gscond.f index bfc6115fa..6dd77d87e 100644 --- a/physics/gscond.f +++ b/physics/gscond.f @@ -29,31 +29,7 @@ end subroutine zhaocarr_gscond_finalize !! #if 0 !> \section arg_table_zhaocarr_gscond_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|----------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | dtf | time_step_for_dynamics | dynamics time step | s | 0 | real | kind_phys | in | F | -!! | prsl | air_pressure | layer mean air pressure | Pa | 2 | real | kind_phys | in | F | -!! | ps | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | q | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | clw1 | ice_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | in | F | -!! | clw2 | cloud_condensed_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | in | F | -!! | cwm | cloud_condensed_water_mixing_ratio_updated_by_physics | moist cloud condensed water mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | -!! | t | air_temperature_updated_by_physics | layer mean air temperature | K | 2 | real | kind_phys | inout | F | -!! | tp | air_temperature_two_time_steps_back | air temperature two time steps back | K | 2 | real | kind_phys | inout | F | -!! | qp | water_vapor_specific_humidity_two_time_steps_back | water vapor specific humidity two time steps back | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | psp | surface_air_pressure_two_time_steps_back | surface air pressure two time steps back | Pa | 1 | real | kind_phys | inout | F | -!! | tp1 | air_temperature_at_previous_time_step | air temperature at previous time step | K | 2 | real | kind_phys | inout | F | -!! | qp1 | water_vapor_specific_humidity_at_previous_time_step | water vapor specific humidity at previous time step | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | psp1 | surface_air_pressure_at_previous_time_step | surface air surface pressure at previous time step | Pa | 1 | real | kind_phys | inout | F | -!! | u | critical_relative_humidity | critical relative humidity | frac | 2 | real | kind_phys | in | F | -!! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | -!! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude zhaocarr_gscond_run.html !! #endif !> \section general_gscond GFS gscond Scheme General Algorithm diff --git a/physics/gscond.meta b/physics/gscond.meta new file mode 100644 index 000000000..a317b8529 --- /dev/null +++ b/physics/gscond.meta @@ -0,0 +1,214 @@ +[ccpp-arg-table] + name = gscond_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = gscond_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = zhaocarr_gscond_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[dt] + standard_name = time_step_for_physics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dtf] + standard_name = time_step_for_dynamics + long_name = dynamics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = layer mean air pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ps] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[clw1] + standard_name = ice_water_mixing_ratio_convective_transport_tracer + long_name = moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[clw2] + standard_name = cloud_condensed_water_mixing_ratio_convective_transport_tracer + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cwm] + standard_name = cloud_condensed_water_mixing_ratio_updated_by_physics + long_name = moist cloud condensed water mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[t] + standard_name = air_temperature_updated_by_physics + long_name = layer mean air temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tp] + standard_name = air_temperature_two_time_steps_back + long_name = air temperature two time steps back + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qp] + standard_name = water_vapor_specific_humidity_two_time_steps_back + long_name = water vapor specific humidity two time steps back + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[psp] + standard_name = surface_air_pressure_two_time_steps_back + long_name = surface air pressure two time steps back + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tp1] + standard_name = air_temperature_at_previous_time_step + long_name = air temperature at previous time step + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qp1] + standard_name = water_vapor_specific_humidity_at_previous_time_step + long_name = water vapor specific humidity at previous time step + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[psp1] + standard_name = surface_air_pressure_at_previous_time_step + long_name = surface air surface pressure at previous time step + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[u] + standard_name = critical_relative_humidity + long_name = critical relative humidity + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[lprnt] + standard_name = flag_print + long_name = flag for printing diagnostics to output + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ipr] + standard_name = horizontal_index_of_printed_column + long_name = horizontal index of printed column + units = index + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/gwdc.f b/physics/gwdc.f index 065e8d73e..80898c47b 100644 --- a/physics/gwdc.f +++ b/physics/gwdc.f @@ -17,25 +17,7 @@ end subroutine gwdc_pre_init ! \brief Brief description of the subroutine !! !! \section arg_table_gwdc_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------------------------|---------------------------------------------------------------|-------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | cgwf | multiplication_factors_for_convective_gravity_wave_drag | multiplication factors for convective gravity wave drag | none | 1 | real | kind_phys | in | F | -!! | dx | cell_size | grid size in zonal direction | m | 1 | real | kind_phys | in | F | -!! | work1 | grid_size_related_coefficient_used_in_scale_sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | -!! | work2 | grid_size_related_coefficient_used_in_scale_sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | in | F | -!! | dlength | characteristic_grid_length_scale | representative horizontal length scale of grid box | m | 1 | real | kind_phys | out | F | -!! | cldf | cloud_area_fraction | fraction of grid box area in which updrafts occur | frac | 1 | real | kind_phys | out | F | -!! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | -!! | kbot | vertical_index_at_cloud_base | vertical index at cloud base | index | 1 | integer | | in | F | -!! | ktop | vertical_index_at_cloud_top | vertical index at cloud top | index | 1 | integer | | in | F | -!! | dtp | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | gt0 | air_temperature_updated_by_physics | updated air temperature | K | 2 | real | kind_phys | in | F | -!! | gt0_init | air_temperature_save | air temperature before entering convection scheme | K | 2 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | difference between mid-layer pressures | Pa | 2 | real | kind_phys | in | F | -!! | cumabs | maximum_column_heating_rate | maximum heating rate in column | K s-1 | 1 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude gwdc_pre_run.html !! subroutine gwdc_pre_run ( & & im, cgwf, dx, work1, work2, dlength, cldf, & @@ -123,40 +105,7 @@ end subroutine gwdc_init !! GFS/CFS by Ake Johansson(Aug 2005). !! !> \section arg_table_gwdc_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|--------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | km | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | -!! | lat | latitude_index_in_debug_printouts | latitude index in debug printouts | index | 0 | integer | | in | F | -!! | u1 | x_wind | zonal wind | m s-1 | 2 | real | kind_phys | in | F | -!! | v1 | y_wind | meridional wind | m s-1 | 2 | real | kind_phys | in | F | -!! | t1 | air_temperature | mid-layer temperature | K | 2 | real | kind_phys | in | F | -!! | q1 | water_vapor_specific_humidity | mid-layer specific humidity of water vapor | kg kg-1 | 2 | real | kind_phys | in | F | -!! | deltim | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | pmid1 | air_pressure | mid-layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | pint1 | air_pressure_at_interface | interface pressure | Pa | 2 | real | kind_phys | in | F | -!! | dpmid1 | air_pressure_difference_between_midlayers | difference between mid-layer pressures | Pa | 2 | real | kind_phys | in | F | -!! | qmax | maximum_column_heating_rate | maximum heating rate in column | K s-1 | 1 | real | kind_phys | in | F | -!! | ktop | vertical_index_at_cloud_top | vertical index at cloud top | index | 1 | integer | | in | F | -!! | kbot | vertical_index_at_cloud_base | vertical index at cloud base | index | 1 | integer | | in | F | -!! | kcnv | flag_deep_convection | flag indicating whether convection occurs in column (0 or 1) | flag | 1 | integer | | in | F | -!! | cldf | cloud_area_fraction | fraction of grid box area in which updrafts occur | frac | 1 | real | kind_phys | in | F | -!! | grav | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | fv | ratio_of_vapor_to_dry_air_gas_constants_minus_one | rv/rd - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | pi | pi | ratio of a circle's circumference to its diameter | radians | 0 | real | kind_phys | in | F | -!! | dlength | characteristic_grid_length_scale | representative horizontal length scale of grid box | m | 1 | real | kind_phys | in | F | -!! | lprnt | flag_print | flag for debugging printouts | flag | 0 | logical | | in | F | -!! | ipr | horizontal_index_of_printed_column | horizontal index of column used in debugging printouts | index | 0 | integer | | in | F | -!! | fhour | forecast_time | forecast hour | h | 0 | real | kind_phys | in | F | -!! | utgwc | tendency_of_x_wind_due_to_convective_gravity_wave_drag | zonal wind tendency due to convective gravity wave drag | m s-2 | 2 | real | kind_phys | out | F | -!! | vtgwc | tendency_of_y_wind_due_to_convective_gravity_wave_drag | meridional wind tendency due to convective gravity wave drag | m s-2 | 2 | real | kind_phys | out | F | -!! | tauctx | instantaneous_x_stress_due_to_gravity_wave_drag | zonal stress at cloud top due to convective gravity wave drag | Pa | 1 | real | kind_phys | out | F | -!! | taucty | instantaneous_y_stress_due_to_gravity_wave_drag | meridional stress at cloud top due to convective gravity wave drag | Pa | 1 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude gwdc_run.html !! !>\section gen_gwdc GFS Convective GWD Scheme General Algorithm !! Parameterizing subgrid-scale convection-induced gravity wave @@ -1504,28 +1453,7 @@ end subroutine gwdc_post_init ! \brief Brief description of the subroutine !! !> \section arg_table_gwdc_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------|--------------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | -!! | lssav | flag_diagnostics | flag for calculating diagnostic fields | flag | 0 | logical | | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for calculating 3-D diagnostic fields | flag | 0 | logical | | in | F | -!! | dtf | time_step_for_dynamics | dynamics time step | s | 0 | real | kind_phys | in | F | -!! | dtp | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | con_cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | tauctx | instantaneous_x_stress_due_to_gravity_wave_drag | zonal stress at cloud top due to convective gravity wave drag | Pa | 1 | real | kind_phys | in | F | -!! | taucty | instantaneous_y_stress_due_to_gravity_wave_drag | meridional stress at cloud top due to convective gravity wave drag | Pa | 1 | real | kind_phys | in | F | -!! | gwdcu | tendency_of_x_wind_due_to_convective_gravity_wave_drag | zonal wind tendency due to convective gravity wave drag | m s-2 | 2 | real | kind_phys | in | F | -!! | gwdcv | tendency_of_y_wind_due_to_convective_gravity_wave_drag | meridional wind tendency due to convective gravity wave drag | m s-2 | 2 | real | kind_phys | in | F | -!! | dugwd | time_integral_of_x_stress_due_to_gravity_wave_drag | integral over time of zonal stress due to gravity wave drag | Pa s | 1 | real | kind_phys | inout | F | -!! | dvgwd | time_integral_of_y_stress_due_to_gravity_wave_drag | integral over time of meridional stress due to gravity wave drag | Pa s | 1 | real | kind_phys | inout | F | -!! | du3dt | cumulative_change_in_x_wind_due_to_convective_gravity_wave_drag | cumulative change in zonal wind due to convective gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | -!! | dv3dt | cumulative_change_in_y_wind_due_to_convective_gravity_wave_drag | cumulative change in meridional wind due to convective gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | -!! | gu0 | x_wind_updated_by_physics | updated zonal wind | m s-1 | 2 | real | kind_phys | inout | F | -!! | gv0 | y_wind_updated_by_physics | updated meridional wind | m s-1 | 2 | real | kind_phys | inout | F | -!! | gt0 | air_temperature_updated_by_physics | updated air temperature | K | 2 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude gwdc_post_run.html !! subroutine gwdc_post_run( & & im, levs, lssav, ldiag3d, dtf, dtp, con_cp, & diff --git a/physics/gwdc.meta b/physics/gwdc.meta new file mode 100644 index 000000000..b87529aec --- /dev/null +++ b/physics/gwdc.meta @@ -0,0 +1,644 @@ +[ccpp-arg-table] + name = gwdc_pre_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = gwdc_pre_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[cgwf] + standard_name = multiplication_factors_for_convective_gravity_wave_drag + long_name = multiplication factors for convective gravity wave drag + units = none + dimensions = (2) + type = real + kind = kind_phys + intent = in + optional = F +[dx] + standard_name = cell_size + long_name = grid size in zonal direction + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[work1] + standard_name = grid_size_related_coefficient_used_in_scale_sensitive_schemes + long_name = grid size related coefficient used in scale-sensitive schemes + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[work2] + standard_name = grid_size_related_coefficient_used_in_scale_sensitive_schemes_complement + long_name = complement to work1 + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dlength] + standard_name = characteristic_grid_length_scale + long_name = representative horizontal length scale of grid box + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cldf] + standard_name = cloud_area_fraction + long_name = fraction of grid box area in which updrafts occur + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of vertical layers + units = count + dimensions = () + type = integer + intent = in + optional = F +[kbot] + standard_name = vertical_index_at_cloud_base + long_name = vertical index at cloud base + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[ktop] + standard_name = vertical_index_at_cloud_top + long_name = vertical index at cloud top + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[dtp] + standard_name = time_step_for_physics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = updated air temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gt0_init] + standard_name = air_temperature_save + long_name = air temperature before entering convection scheme + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[del] + standard_name = air_pressure_difference_between_midlayers + long_name = difference between mid-layer pressures + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cumabs] + standard_name = maximum_column_heating_rate + long_name = maximum heating rate in column + units = K s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = gwdc_pre_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = gwdc_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = gwdc_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension + long_name = number of vertical layers + units = count + dimensions = () + type = integer + intent = in + optional = F +[lat] + standard_name = latitude_index_in_debug_printouts + long_name = latitude index in debug printouts + units = index + dimensions = () + type = integer + intent = in + optional = F +[u1] + standard_name = x_wind + long_name = zonal wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v1] + standard_name = y_wind + long_name = meridional wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t1] + standard_name = air_temperature + long_name = mid-layer temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q1] + standard_name = water_vapor_specific_humidity + long_name = mid-layer specific humidity of water vapor + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[deltim] + standard_name = time_step_for_physics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[pmid1] + standard_name = air_pressure + long_name = mid-layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[pint1] + standard_name = air_pressure_at_interface + long_name = interface pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[dpmid1] + standard_name = air_pressure_difference_between_midlayers + long_name = difference between mid-layer pressures + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qmax] + standard_name = maximum_column_heating_rate + long_name = maximum heating rate in column + units = K s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ktop] + standard_name = vertical_index_at_cloud_top + long_name = vertical index at cloud top + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[kbot] + standard_name = vertical_index_at_cloud_base + long_name = vertical index at cloud base + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[kcnv] + standard_name = flag_deep_convection + long_name = flag indicating whether convection occurs in column (0 or 1) + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[cldf] + standard_name = cloud_area_fraction + long_name = fraction of grid box area in which updrafts occur + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[grav] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[fv] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = rv/rd - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = radians + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dlength] + standard_name = characteristic_grid_length_scale + long_name = representative horizontal length scale of grid box + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[lprnt] + standard_name = flag_print + long_name = flag for debugging printouts + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ipr] + standard_name = horizontal_index_of_printed_column + long_name = horizontal index of column used in debugging printouts + units = index + dimensions = () + type = integer + intent = in + optional = F +[fhour] + standard_name = forecast_time + long_name = forecast hour + units = h + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[utgwc] + standard_name = tendency_of_x_wind_due_to_convective_gravity_wave_drag + long_name = zonal wind tendency due to convective gravity wave drag + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[vtgwc] + standard_name = tendency_of_y_wind_due_to_convective_gravity_wave_drag + long_name = meridional wind tendency due to convective gravity wave drag + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[tauctx] + standard_name = instantaneous_x_stress_due_to_gravity_wave_drag + long_name = zonal stress at cloud top due to convective gravity wave drag + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[taucty] + standard_name = instantaneous_y_stress_due_to_gravity_wave_drag + long_name = meridional stress at cloud top due to convective gravity wave drag + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = gwdc_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = gwdc_post_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = gwdc_post_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of vertical layers + units = count + dimensions = () + type = integer + intent = in + optional = F +[lssav] + standard_name = flag_diagnostics + long_name = flag for calculating diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for calculating 3-D diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[dtf] + standard_name = time_step_for_dynamics + long_name = dynamics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dtp] + standard_name = time_step_for_physics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[tauctx] + standard_name = instantaneous_x_stress_due_to_gravity_wave_drag + long_name = zonal stress at cloud top due to convective gravity wave drag + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[taucty] + standard_name = instantaneous_y_stress_due_to_gravity_wave_drag + long_name = meridional stress at cloud top due to convective gravity wave drag + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gwdcu] + standard_name = tendency_of_x_wind_due_to_convective_gravity_wave_drag + long_name = zonal wind tendency due to convective gravity wave drag + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gwdcv] + standard_name = tendency_of_y_wind_due_to_convective_gravity_wave_drag + long_name = meridional wind tendency due to convective gravity wave drag + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dugwd] + standard_name = time_integral_of_x_stress_due_to_gravity_wave_drag + long_name = integral over time of zonal stress due to gravity wave drag + units = Pa s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dvgwd] + standard_name = time_integral_of_y_stress_due_to_gravity_wave_drag + long_name = integral over time of meridional stress due to gravity wave drag + units = Pa s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[du3dt] + standard_name = cumulative_change_in_x_wind_due_to_convective_gravity_wave_drag + long_name = cumulative change in zonal wind due to convective gravity wave drag + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dv3dt] + standard_name = cumulative_change_in_y_wind_due_to_convective_gravity_wave_drag + long_name = cumulative change in meridional wind due to convective gravity wave drag + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gu0] + standard_name = x_wind_updated_by_physics + long_name = updated zonal wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gv0] + standard_name = y_wind_updated_by_physics + long_name = updated meridional wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = updated air temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = gwdc_post_finalize + type = scheme diff --git a/physics/gwdps.f b/physics/gwdps.f index f2f5f218f..366a8b974 100644 --- a/physics/gwdps.f +++ b/physics/gwdps.f @@ -22,50 +22,7 @@ end subroutine gwdps_init !! breaking and the presence of critical levels. !! !! \section arg_table_gwdps_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | km | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | -!! | A | tendency_of_y_wind_due_to_model_physics | meridional wind tendency due to model physics | m s-2 | 2 | real | kind_phys | inout | F | -!! | B | tendency_of_x_wind_due_to_model_physics | zonal wind tendency due to model physics | m s-2 | 2 | real | kind_phys | inout | F | -!! | C | tendency_of_air_temperature_due_to_model_physics | air temperature tendency due to model physics | K s-1 | 2 | real | kind_phys | inout | F | -!! | u1 | x_wind | zonal wind | m s-1 | 2 | real | kind_phys | in | F | -!! | v1 | y_wind | meridional wind | m s-1 | 2 | real | kind_phys | in | F | -!! | t1 | air_temperature | mid-layer temperature | K | 2 | real | kind_phys | in | F | -!! | q1 | water_vapor_specific_humidity | mid-layer specific humidity of water vapor | kg kg-1 | 2 | real | kind_phys | in | F | -!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | vertical index at top atmospheric boundary layer | index | 1 | integer | | in | F | -!! | prsi | air_pressure_at_interface | interface pressure | Pa | 2 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | difference between mid-layer pressures | Pa | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mid-layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | prslk | dimensionless_exner_function_at_model_layers | mid-layer Exner function | none | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | interface geopotential | m2 s-2 | 2 | real | kind_phys | in | F | -!! | phil | geopotential | mid-layer geopotential | m2 s-2 | 2 | real | kind_phys | in | F | -!! | deltim | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | kdt | index_of_time_step | current time step index | index | 0 | integer | | in | F | -!! | hprime | standard_deviation_of_subgrid_orography | standard deviation of subgrid orography | m | 1 | real | kind_phys | in | F | -!! | oc | convexity_of_subgrid_orography | convexity of subgrid orography | none | 1 | real | kind_phys | in | F | -!! | oa4 | asymmetry_of_subgrid_orography | asymmetry of subgrid orography | none | 2 | real | kind_phys | in | F | -!! | clx4 | fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height | horizontal fraction of grid box covered by subgrid orography higher than critical height | frac | 2 | real | kind_phys | in | F | -!! | theta | angle_from_east_of_maximum_subgrid_orographic_variations | angle with respect to east of maximum subgrid orographic variations | degrees | 1 | real | kind_phys | in | F | -!! | sigma | slope_of_subgrid_orography | slope of subgrid orography | none | 1 | real | kind_phys | in | F | -!! | gamma | anisotropy_of_subgrid_orography | anisotropy of subgrid orography | none | 1 | real | kind_phys | in | F | -!! | elvmax | maximum_subgrid_orography | maximum of subgrid orography | m | 1 | real | kind_phys | inout | F | -!! | dusfc | instantaneous_x_stress_due_to_gravity_wave_drag | zonal surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | out | F | -!! | dvsfc | instantaneous_y_stress_due_to_gravity_wave_drag | meridional surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | out | F | -!! | g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | imx | number_of_equatorial_longitude_points | number of longitude points along the equator | count | 0 | integer | | in | F | -!! | nmtvr | number_of_statistical_measures_of_subgrid_orography | number of statistical measures of subgrid orography | count | 0 | integer | | in | F | -!! | cdmbgwd | multiplication_factors_for_mountain_blocking_and_orographic_gravity_wave_drag | multiplic. factors for (1) mountain blocking drag coeff. and (2) ref. level orographic gravity wave drag | none | 1 | real | kind_phys | in | F | -!! | me | mpi_rank | rank of the current MPI task | index | 0 | integer | | in | F | -!! | lprnt | flag_print | flag for debugging printouts | flag | 0 | logical | | in | F | -!! | ipr | horizontal_index_of_printed_column | horizontal index of column used in debugging printouts | index | 0 | integer | | in | F | -!! | rdxzb | level_of_dividing_streamline | level of the dividing streamline | none | 1 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude gwdps_run.html !! !> \section gen_gwdps GFS Orographic GWD Scheme General Algorithm !! -# Calculate subgrid mountain blocking @@ -1366,23 +1323,7 @@ subroutine gwdps_post_init() end subroutine gwdps_post_init !! \section arg_table_gwdps_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|----------------------------------------------------------------------|--------------------------------------------------------------------------|-------|------|-----------|-----------|--------|----------| -!! | lssav | flag_diagnostics | flag for calculating diagnostic fields | flag | 0 | logical | | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for calculating 3-D diagnostic fields | flag | 0 | logical | | in | F | -!! | dtf | time_step_for_dynamics | dynamics time step | s | 0 | real | kind_phys | in | F | -!! | dusfcg | instantaneous_x_stress_due_to_gravity_wave_drag | zonal surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | in | F | -!! | dvsfcg | instantaneous_y_stress_due_to_gravity_wave_drag | meridional surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | in | F | -!! | dudt | tendency_of_x_wind_due_to_model_physics | zonal wind tendency due to model physics | m s-2 | 2 | real | kind_phys | in | F | -!! | dvdt | tendency_of_y_wind_due_to_model_physics | meridional wind tendency due to model physics | m s-2 | 2 | real | kind_phys | in | F | -!! | dtdt | tendency_of_air_temperature_due_to_model_physics | air temperature tendency due to model physics | K s-1 | 2 | real | kind_phys | in | F | -!! | dugwd | time_integral_of_x_stress_due_to_gravity_wave_drag | integral over time of zonal stress due to gravity wave drag | Pa s | 1 | real | kind_phys | inout | F | -!! | dvgwd | time_integral_of_y_stress_due_to_gravity_wave_drag | integral over time of meridional stress due to gravity wave drag | Pa s | 1 | real | kind_phys | inout | F | -!! | du3dt | cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag | cumulative change in zonal wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | -!! | dv3dt | cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag | cumulative change in meridional wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | -!! | dt3dt | cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag | cumulative change in temperature due to orographic gravity wave drag | K | 2 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude gwdps_post_run.html !! subroutine gwdps_post_run( & & lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, dvdt, dtdt, & diff --git a/physics/gwdps.meta b/physics/gwdps.meta new file mode 100644 index 000000000..97b6abae3 --- /dev/null +++ b/physics/gwdps.meta @@ -0,0 +1,527 @@ +[ccpp-arg-table] + name = gwdps_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = gwdps_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension + long_name = number of vertical layers + units = count + dimensions = () + type = integer + intent = in + optional = F +[A] + standard_name = tendency_of_y_wind_due_to_model_physics + long_name = meridional wind tendency due to model physics + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[B] + standard_name = tendency_of_x_wind_due_to_model_physics + long_name = zonal wind tendency due to model physics + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[C] + standard_name = tendency_of_air_temperature_due_to_model_physics + long_name = air temperature tendency due to model physics + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[u1] + standard_name = x_wind + long_name = zonal wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v1] + standard_name = y_wind + long_name = meridional wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t1] + standard_name = air_temperature + long_name = mid-layer temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q1] + standard_name = water_vapor_specific_humidity + long_name = mid-layer specific humidity of water vapor + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[kpbl] + standard_name = vertical_index_at_top_of_atmosphere_boundary_layer + long_name = vertical index at top atmospheric boundary layer + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[prsi] + standard_name = air_pressure_at_interface + long_name = interface pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[del] + standard_name = air_pressure_difference_between_midlayers + long_name = difference between mid-layer pressures + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mid-layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslk] + standard_name = dimensionless_exner_function_at_model_layers + long_name = mid-layer Exner function + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[phii] + standard_name = geopotential_at_interface + long_name = interface geopotential + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[phil] + standard_name = geopotential + long_name = mid-layer geopotential + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[deltim] + standard_name = time_step_for_physics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[kdt] + standard_name = index_of_time_step + long_name = current time step index + units = index + dimensions = () + type = integer + intent = in + optional = F +[hprime] + standard_name = standard_deviation_of_subgrid_orography + long_name = standard deviation of subgrid orography + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[oc] + standard_name = convexity_of_subgrid_orography + long_name = convexity of subgrid orography + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[oa4] + standard_name = asymmetry_of_subgrid_orography + long_name = asymmetry of subgrid orography + units = none + dimensions = (horizontal_dimension,4) + type = real + kind = kind_phys + intent = in + optional = F +[clx4] + standard_name = fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height + long_name = horizontal fraction of grid box covered by subgrid orography higher than critical height + units = frac + dimensions = (horizontal_dimension,4) + type = real + kind = kind_phys + intent = in + optional = F +[theta] + standard_name = angle_from_east_of_maximum_subgrid_orographic_variations + long_name = angle with respect to east of maximum subgrid orographic variations + units = degrees + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sigma] + standard_name = slope_of_subgrid_orography + long_name = slope of subgrid orography + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gamma] + standard_name = anisotropy_of_subgrid_orography + long_name = anisotropy of subgrid orography + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[elvmax] + standard_name = maximum_subgrid_orography + long_name = maximum of subgrid orography + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dusfc] + standard_name = instantaneous_x_stress_due_to_gravity_wave_drag + long_name = zonal surface stress due to orographic gravity wave drag + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dvsfc] + standard_name = instantaneous_y_stress_due_to_gravity_wave_drag + long_name = meridional surface stress due to orographic gravity wave drag + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rv] + standard_name = gas_constant_water_vapor + long_name = ideal gas constant for water vapor + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[imx] + standard_name = number_of_equatorial_longitude_points + long_name = number of longitude points along the equator + units = count + dimensions = () + type = integer + intent = in + optional = F +[nmtvr] + standard_name = number_of_statistical_measures_of_subgrid_orography + long_name = number of statistical measures of subgrid orography + units = count + dimensions = () + type = integer + intent = in + optional = F +[cdmbgwd] + standard_name = multiplication_factors_for_mountain_blocking_and_orographic_gravity_wave_drag + long_name = multiplic. factors for (1) mountain blocking drag coeff. and (2) ref. level orographic gravity wave drag + units = none + dimensions = (2) + type = real + kind = kind_phys + intent = in + optional = F +[me] + standard_name = mpi_rank + long_name = rank of the current MPI task + units = index + dimensions = () + type = integer + intent = in + optional = F +[lprnt] + standard_name = flag_print + long_name = flag for debugging printouts + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ipr] + standard_name = horizontal_index_of_printed_column + long_name = horizontal index of column used in debugging printouts + units = index + dimensions = () + type = integer + intent = in + optional = F +[rdxzb] + standard_name = level_of_dividing_streamline + long_name = level of the dividing streamline + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = gwdps_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = gwdps_post_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = gwdps_post_run + type = scheme +[lssav] + standard_name = flag_diagnostics + long_name = flag for calculating diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for calculating 3-D diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[dtf] + standard_name = time_step_for_dynamics + long_name = dynamics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dusfcg] + standard_name = instantaneous_x_stress_due_to_gravity_wave_drag + long_name = zonal surface stress due to orographic gravity wave drag + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dvsfcg] + standard_name = instantaneous_y_stress_due_to_gravity_wave_drag + long_name = meridional surface stress due to orographic gravity wave drag + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dudt] + standard_name = tendency_of_x_wind_due_to_model_physics + long_name = zonal wind tendency due to model physics + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dvdt] + standard_name = tendency_of_y_wind_due_to_model_physics + long_name = meridional wind tendency due to model physics + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dtdt] + standard_name = tendency_of_air_temperature_due_to_model_physics + long_name = air temperature tendency due to model physics + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dugwd] + standard_name = time_integral_of_x_stress_due_to_gravity_wave_drag + long_name = integral over time of zonal stress due to gravity wave drag + units = Pa s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dvgwd] + standard_name = time_integral_of_y_stress_due_to_gravity_wave_drag + long_name = integral over time of meridional stress due to gravity wave drag + units = Pa s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[du3dt] + standard_name = cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag + long_name = cumulative change in zonal wind due to orographic gravity wave drag + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dv3dt] + standard_name = cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag + long_name = cumulative change in meridional wind due to orographic gravity wave drag + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dt3dt] + standard_name = cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag + long_name = cumulative change in temperature due to orographic gravity wave drag + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = gwdps_post_finalize + type = scheme diff --git a/physics/h2ophys.f b/physics/h2ophys.f index 287cfa3d3..929b38aa7 100644 --- a/physics/h2ophys.f +++ b/physics/h2ophys.f @@ -22,22 +22,7 @@ end subroutine h2ophys_init !>\defgroup GFS_h2ophys GFS Water Vapor Photochemical Production and Loss Module !> This subroutine is NRL H2O physics for stratosphere and mesosphere. !! \section arg_table_h2ophys_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|---------------------------------------------------|---------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | -!! | kh2o | vertical_dimension_of_h2o_forcing_data | number of vertical layers in h2o forcing data | count | 0 | integer | | in | F | -!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | h2o | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ph2o | natural_log_of_h2o_forcing_data_pressure_levels | natural log of h2o forcing data pressure levels | log(Pa) | 1 | real | kind_phys | in | F | -!! | prsl | air_pressure | mid-layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | h2opltc | h2o_forcing | water forcing data | various | 3 | real | kind_phys | in | F | -!! | h2o_coeff | number_of_coefficients_in_h2o_forcing_data | number of coefficients in h2o forcing data | index | 0 | integer | | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for calculating 3-D diagnostic fields | flag | 0 | logical | | in | F | -!! | me | mpi_rank | rank of the current MPI task | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude h2ophys_run.html !! !! \section genal_h2ophys GFS H2O Physics Scheme General Algorithm !> @{ diff --git a/physics/h2ophys.meta b/physics/h2ophys.meta new file mode 100644 index 000000000..9aed54eb2 --- /dev/null +++ b/physics/h2ophys.meta @@ -0,0 +1,131 @@ +[ccpp-arg-table] + name = h2ophys_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = h2ophys_run + type = scheme +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of vertical layers + units = count + dimensions = () + type = integer + intent = in + optional = F +[kh2o] + standard_name = vertical_dimension_of_h2o_forcing_data + long_name = number of vertical layers in h2o forcing data + units = count + dimensions = () + type = integer + intent = in + optional = F +[dt] + standard_name = time_step_for_physics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[h2o] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ph2o] + standard_name = natural_log_of_h2o_forcing_data_pressure_levels + long_name = natural log of h2o forcing data pressure levels + units = log(Pa) + dimensions = (vertical_dimension_of_h2o_forcing_data) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mid-layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[h2opltc] + standard_name = h2o_forcing + long_name = water forcing data + units = various + dimensions = (horizontal_dimension,vertical_dimension_of_h2o_forcing_data,number_of_coefficients_in_h2o_forcing_data) + type = real + kind = kind_phys + intent = in + optional = F +[h2o_coeff] + standard_name = number_of_coefficients_in_h2o_forcing_data + long_name = number of coefficients in h2o forcing data + units = index + dimensions = () + type = integer + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for calculating 3-D diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[me] + standard_name = mpi_rank + long_name = rank of the current MPI task + units = index + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = h2ophys_finalize + type = scheme diff --git a/physics/m_micro.F90 b/physics/m_micro.F90 index 7a13f13fe..40025a898 100644 --- a/physics/m_micro.F90 +++ b/physics/m_micro.F90 @@ -17,41 +17,7 @@ module m_micro !>\ingroup mg_driver !! This subroutine is the MG initialization. !> \section arg_table_m_micro_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |------------------------|-------------------------------------------------|---------------------------------------------------------------------------------------------|-------------|------|------------|-----------|--------|----------| -!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | -!! | fprcp | number_of_frozen_precipitation_species | number of frozen precipitation species | count | 0 | integer | | in | F | -!! | gravit | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | rair | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | rh2o | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | cpair | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | tmelt | triple_point_temperature_of_water | triple point temperature of water | K | 0 | real | kind_phys | in | F | -!! | latvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | latice | latent_heat_of_fusion_of_water_at_0C | latent heat of fusion | J kg-1 | 0 | real | kind_phys | in | F | -!! | mg_dcs | mg_autoconversion_size_threshold_ice_snow | autoconversion size threshold for cloud ice to snow for MG microphysics | um | 0 | real | kind_phys | in | F | -!! | mg_qcvar | mg_cloud_water_variance | cloud water relative variance for MG microphysics | | 0 | real | kind_phys | in | F | -!! | mg_ts_auto_ice | mg_time_scale_for_autoconversion_of_ice | autoconversion time scale for ice for MG microphysics | s | 1 | real | kind_phys | in | F | -!! | mg_rhmini | mg_minimum_rh_for_ice | relative humidity threshold parameter for nucleating ice for MG microphysics | none | 0 | real | kind_phys | in | F | -!! | microp_uniform | mg_flag_for_uniform_subcolumns | flag for uniform subcolumns for MG microphysics | flag | 0 | logical | | in | F | -!! | do_cldice | mg_flag_for_cloud_ice_processes | flag for cloud ice processes for MG microphysics | flag | 0 | logical | | in | F | -!! | hetfrz_classnuc | mg_flag_for_heterogeneous_freezing | flag for heterogeneous freezing for MG microphysics | flag | 0 | logical | | in | F | -!! | mg_precip_frac_method | mg_type_of_precip_fraction_method | type of precip fraction method for MG microphysics (in_cloud or max_overlap) | none | 0 | character | len=16 | in | F | -!! | mg_berg_eff_factor | mg_bergeron_efficiency_factor | bergeron efficiency factor for MG microphysics | frac | 0 | real | kind_phys | in | F | -!! | sed_supersat | mg_allow_supersat_after_sed | allow supersaturation after sedimentation for MG microphysics | flag | 0 | logical | | in | F | -!! | do_sb_physics | mg_flag_for_sb2001_autoconversion | flag for SB 2001 autoconversion or accretion for MG microphysics | flag | 0 | logical | | in | F | -!! | mg_do_hail | mg_flag_for_hail | flag for hail for MG microphysics (graupel possible if false) | flag | 0 | logical | | in | F | -!! | mg_do_graupel | mg_flag_for_graupel | flag for graupel for MG microphysics (hail possible if false) | flag | 0 | logical | | in | F | -!! | mg_nccons | mg_flag_drop_concentration_constant | flag for constant droplet concentration for MG microphysics | flag | 0 | logical | | in | F | -!! | mg_nicons | mg_flag_ice_concentration_constant | flag for constant ice concentration for MG microphysics | flag | 0 | logical | | in | F | -!! | mg_ngcons | mg_flag_graupel_concentration_constant | flag for constant graupel concentration for MG microphysics | flag | 0 | logical | | in | F | -!! | mg_ncnst | mg_drop_concentration_constant | droplet concentration constant for MG microphysics | m-3 | 0 | real | kind_phys | in | F | -!! | mg_ninst | mg_ice_concentration_constant | ice concentration constant for MG microphysics | m-3 | 0 | real | kind_phys | in | F | -!! | mg_ngnst | mg_graupel_concentration_constant | graupel concentration constant for MG microphysics | m-3 | 0 | real | kind_phys | in | F | -!! | mg_do_ice_gmao | mg_flag_for_gmao_ice_formulation | flag for gmao ice formulation | flag | 0 | logical | | in | F | -!! | mg_do_liq_liu | mg_flag_for_liu_liquid_treatment | flag for liu liquid treatment | flag | 0 | logical | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude m_micro_init.html !! subroutine m_micro_init(imp_physics, imp_physics_mg, fprcp, gravit, rair, rh2o, cpair,& tmelt, latvap, latice, mg_dcs, mg_qcvar, mg_ts_auto_ice, & @@ -147,79 +113,7 @@ end subroutine m_micro_finalize #if 0 !> \section arg_table_m_micro_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|-------------|------|------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | lm | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | flipv | flag_flip | vertical flip logical | flag | 0 | logical | | in | F | -!! | dt_i | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | prsl_i | air_pressure | layer mean pressure | Pa | 2 | real | kind_phys | in | F | -!! | prsi_i | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | omega_i | omega | layer mean vertical velocity | Pa s-1 | 2 | real | kind_phys | in | F | -!! | qlls_i | cloud_condensed_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | in | F | -!! | qlcn_i | mass_fraction_of_convective_cloud_liquid_water | mass fraction of convective cloud liquid water | kg kg-1 | 2 | real | kind_phys | in | F | -!! | qils_i | ice_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | in | F | -!! | qicn_i | mass_fraction_of_convective_cloud_ice | mass fraction of convective cloud ice water | kg kg-1 | 2 | real | kind_phys | in | F | -!! | lwheat_i | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep | total sky lw heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | swheat_i | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep | total sky sw heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | w_upi | vertical_velocity_for_updraft | vertical velocity for updraft | m s-1 | 2 | real | kind_phys | in | F | -!! | cf_upi | convective_cloud_fraction_for_microphysics | convective cloud fraction for microphysics | frac | 2 | real | kind_phys | in | F | -!! | frland | land_area_fraction_for_microphysics | land area fraction used in microphysics schemes | frac | 1 | real | kind_phys | in | F | -!! | zpbl | atmosphere_boundary_layer_thickness | pbl height | m | 1 | real | kind_phys | in | F | -!! | cnv_mfd_i | detrained_mass_flux | detrained mass flux | kg m-2 s-1 | 2 | real | kind_phys | in | F | -!! | cnv_dqldt_i | tendency_of_cloud_water_due_to_convective_microphysics | tendency of cloud water due to convective microphysics | kg m-2 s-1 | 2 | real | kind_phys | in | F | -!! | clcn_i | convective_cloud_volume_fraction | convective cloud volume fraction | frac | 2 | real | kind_phys | in | F | -!! | u_i | x_wind_updated_by_physics | zonal wind updated by physics | m s-1 | 2 | real | kind_phys | in | F | -!! | v_i | y_wind_updated_by_physics | meridional wind updated by physics | m s-1 | 2 | real | kind_phys | in | F | -!! | taugwx | cumulative_surface_x_momentum_flux_for_diag_multiplied_by_timestep | cumulative sfc x momentum flux multiplied by timestep | Pa s | 1 | real | kind_phys | in | F | -!! | taugwy | cumulative_surface_y_momentum_flux_for_diag_multiplied_by_timestep | cumulative sfc y momentum flux multiplied by timestep | Pa s | 1 | real | kind_phys | in | F | -!! | tauorox | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | in | F | -!! | tauoroy | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | in | F | -!! | cnv_fice_i | ice_fraction_in_convective_tower | ice fraction in convective tower | frac | 2 | real | kind_phys | in | F | -!! | cnv_ndrop_i | number_concentration_of_cloud_liquid_water_particles_for_detrainment | droplet number concentration in convective detrainment | m-3 | 2 | real | kind_phys | in | F | -!! | cnv_nice_i | number_concentration_of_ice_crystals_for_detrainment | crystal number concentration in convective detrainment | m-3 | 2 | real | kind_phys | in | F | -!! | q_io | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | lwm_o | cloud_condensed_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of cloud condensed water updated by physics | kg kg-1 | 2 | real | kind_phys | out | F | -!! | qi_o | ice_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of ice water updated by physics | kg kg-1 | 2 | real | kind_phys | out | F | -!! | t_io | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | inout | F | -!! | rn_o | lwe_thickness_of_explicit_precipitation_amount | explicit precipitation (rain, ice, snow, graupel, ...) on physics timestep | m | 1 | real | kind_phys | out | F | -!! | sr_o | ratio_of_snowfall_to_rainfall | snow ratio: ratio of snow to total precipitation | frac | 1 | real | kind_phys | out | F | -!! | ncpl_io | cloud_droplet_number_concentration_updated_by_physics | number concentration of cloud droplets updated by physics | kg-1 | 2 | real | kind_phys | inout | F | -!! | ncpi_io | ice_number_concentration_updated_by_physics | number concentration of ice updated by physics | kg-1 | 2 | real | kind_phys | inout | F | -!! | fprcp | number_of_frozen_precipitation_species | number of frozen precipitation species | count | 0 | integer | | in | F | -!! | rnw_io | local_rain_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of rain water local to physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | snw_io | local_snow_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of snow water local to physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qgl_io | local_graupel_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of graupel local to physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ncpr_io | local_rain_number_concentration | number concentration of rain local to physics | kg-1 | 2 | real | kind_phys | inout | F | -!! | ncps_io | local_snow_number_concentration | number concentration of snow local to physics | kg-1 | 2 | real | kind_phys | inout | F | -!! | ncgl_io | local_graupel_number_concentration | number concentration of graupel local to physics | kg-1 | 2 | real | kind_phys | inout | F | -!! | clls_io | cloud_fraction_for_MG | cloud fraction used by Morrison-Gettelman MP | frac | 2 | real | kind_phys | inout | F | -!! | kcbl | vertical_index_at_cloud_base | vertical index at cloud base | index | 1 | integer | | inout | F | -!! | cldreffl | effective_radius_of_stratiform_cloud_liquid_water_particle_in_um | effective radius of cloud liquid water particle in micrometer | um | 2 | real | kind_phys | out | F | -!! | cldreffi | effective_radius_of_stratiform_cloud_ice_particle_in_um | effective radius of cloud ice water particle in micrometers | um | 2 | real | kind_phys | out | F | -!! | cldreffr | effective_radius_of_stratiform_cloud_rain_particle_in_um | effective radius of cloud rain particle in micrometers | um | 2 | real | kind_phys | out | F | -!! | cldreffs | effective_radius_of_stratiform_cloud_snow_particle_in_um | effective radius of cloud snow particle in micrometers | um | 2 | real | kind_phys | out | F | -!! | cldreffg | effective_radius_of_stratiform_cloud_graupel_particle_in_um | effective radius of cloud graupel particle in micrometers | um | 2 | real | kind_phys | out | F | -!! | aerfld_i | aerosol_number_concentration_from_gocart_aerosol_climatology | GOCART aerosol climatology number concentration | kg-1? | 3 | real | kind_phys | in | F | -!! | aero_in | flag_for_aerosol_input_MG | flag for using aerosols in Morrison-Gettelman microphysics | flag | 0 | logical | | in | F | -!! | naai_i | in_number_concentration | IN number concentration | kg-1? | 2 | real | kind_phys | in | F | -!! | npccn_i | ccn_number_concentration | CCN number concentration | kg-1? | 2 | real | kind_phys | in | F | -!! | iccn | flag_for_in_ccn_forcing_for_morrison_gettelman_microphysics | flag for IN and CCN forcing for morrison gettelman microphysics | flag | 0 | logical | | in | F | -!! | skip_macro | flag_skip_macro | flag to skip cloud macrophysics in Morrison scheme | flag | 0 | logical | | in | F | -!! | lprnt | flag_print | control flag for diagnostic print out | flag | 0 | logical | | in | F | -!! | alf_fac | mg_tuning_factor_for_alphas | tuning factor for alphas (alpha = 1 - critical relative humidity) | none | 0 | real | kind_phys | in | F | -!! | qc_min | mg_minimum_cloud_condensed_water_and_ice_mixing_ratio | minimum cloud condensed water and ice mixing ratio in MG macro clouds | kg kg-1 | 1 | real | kind_phys | in | F | -!! | pdfflag | flag_for_pdf_for_morrison_gettelman_microphysics_scheme | pdf flag for MG macrophysics | flag | 0 | integer | | in | F | -!! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | -!! | kdt | index_of_time_step | current forecast iteration | index | 0 | integer | | in | F | -!! | xlat | latitude | latitude | radians | 1 | real | kind_phys | in | F | -!! | xlon | longitude | longitude | radians | 1 | real | kind_phys | in | F | -!! | rhc_i | critical_relative_humidity | critical relative humidity | frac | 2 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude m_micro_run.html !! #endif !>\ingroup mg_driver diff --git a/physics/m_micro.meta b/physics/m_micro.meta new file mode 100644 index 000000000..91b0c1df0 --- /dev/null +++ b/physics/m_micro.meta @@ -0,0 +1,919 @@ +[ccpp-arg-table] + name = m_micro_init + type = scheme +[imp_physics] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_mg] + standard_name = flag_for_morrison_gettelman_microphysics_scheme + long_name = choice of Morrison-Gettelman microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[fprcp] + standard_name = number_of_frozen_precipitation_species + long_name = number of frozen precipitation species + units = count + dimensions = () + type = integer + intent = in + optional = F +[gravit] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rair] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rh2o] + standard_name = gas_constant_water_vapor + long_name = ideal gas constant for water vapor + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cpair] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[tmelt] + standard_name = triple_point_temperature_of_water + long_name = triple point temperature of water + units = K + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[latvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[latice] + standard_name = latent_heat_of_fusion_of_water_at_0C + long_name = latent heat of fusion + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[mg_dcs] + standard_name = mg_autoconversion_size_threshold_ice_snow + long_name = autoconversion size threshold for cloud ice to snow for MG microphysics + units = um + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[mg_qcvar] + standard_name = mg_cloud_water_variance + long_name = cloud water relative variance for MG microphysics + units = + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[mg_ts_auto_ice] + standard_name = mg_time_scale_for_autoconversion_of_ice + long_name = autoconversion time scale for ice for MG microphysics + units = s + dimensions = (2) + type = real + kind = kind_phys + intent = in + optional = F +[mg_rhmini] + standard_name = mg_minimum_rh_for_ice + long_name = relative humidity threshold parameter for nucleating ice for MG microphysics + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[microp_uniform] + standard_name = mg_flag_for_uniform_subcolumns + long_name = flag for uniform subcolumns for MG microphysics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_cldice] + standard_name = mg_flag_for_cloud_ice_processes + long_name = flag for cloud ice processes for MG microphysics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[hetfrz_classnuc] + standard_name = mg_flag_for_heterogeneous_freezing + long_name = flag for heterogeneous freezing for MG microphysics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[mg_precip_frac_method] + standard_name = mg_type_of_precip_fraction_method + long_name = type of precip fraction method for MG microphysics (in_cloud or max_overlap) + units = none + dimensions = () + type = character + kind = len=16 + intent = in + optional = F +[mg_berg_eff_factor] + standard_name = mg_bergeron_efficiency_factor + long_name = bergeron efficiency factor for MG microphysics + units = frac + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[sed_supersat] + standard_name = mg_allow_supersat_after_sed + long_name = allow supersaturation after sedimentation for MG microphysics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[do_sb_physics] + standard_name = mg_flag_for_sb2001_autoconversion + long_name = flag for SB 2001 autoconversion or accretion for MG microphysics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[mg_do_hail] + standard_name = mg_flag_for_hail + long_name = flag for hail for MG microphysics (graupel possible if false) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[mg_do_graupel] + standard_name = mg_flag_for_graupel + long_name = flag for graupel for MG microphysics (hail possible if false) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[mg_nccons] + standard_name = mg_flag_drop_concentration_constant + long_name = flag for constant droplet concentration for MG microphysics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[mg_nicons] + standard_name = mg_flag_ice_concentration_constant + long_name = flag for constant ice concentration for MG microphysics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[mg_ngcons] + standard_name = mg_flag_graupel_concentration_constant + long_name = flag for constant graupel concentration for MG microphysics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[mg_ncnst] + standard_name = mg_drop_concentration_constant + long_name = droplet concentration constant for MG microphysics + units = m-3 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[mg_ninst] + standard_name = mg_ice_concentration_constant + long_name = ice concentration constant for MG microphysics + units = m-3 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[mg_ngnst] + standard_name = mg_graupel_concentration_constant + long_name = graupel concentration constant for MG microphysics + units = m-3 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[mg_do_ice_gmao] + standard_name = mg_flag_for_gmao_ice_formulation + long_name = flag for gmao ice formulation + units = flag + dimensions = () + type = logical + intent = in + optional = F +[mg_do_liq_liu] + standard_name = mg_flag_for_liu_liquid_treatment + long_name = flag for liu liquid treatment + units = flag + dimensions = () + type = logical + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = m_micro_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = m_micro_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[lm] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[flipv] + standard_name = flag_flip + long_name = vertical flip logical + units = flag + dimensions = () + type = logical + intent = in + optional = F +[dt_i] + standard_name = time_step_for_physics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[prsl_i] + standard_name = air_pressure + long_name = layer mean pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsi_i] + standard_name = air_pressure_at_interface + long_name = air pressure at model layer interfaces + units = Pa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[phil] + standard_name = geopotential + long_name = geopotential at model layer centers + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[phii] + standard_name = geopotential_at_interface + long_name = geopotential at model layer interfaces + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[omega_i] + standard_name = omega + long_name = layer mean vertical velocity + units = Pa s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qlls_i] + standard_name = cloud_condensed_water_mixing_ratio_convective_transport_tracer + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qlcn_i] + standard_name = mass_fraction_of_convective_cloud_liquid_water + long_name = mass fraction of convective cloud liquid water + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qils_i] + standard_name = ice_water_mixing_ratio_convective_transport_tracer + long_name = moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qicn_i] + standard_name = mass_fraction_of_convective_cloud_ice + long_name = mass fraction of convective cloud ice water + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[lwheat_i] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep + long_name = total sky lw heating rate + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[swheat_i] + standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep + long_name = total sky sw heating rate + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[w_upi] + standard_name = vertical_velocity_for_updraft + long_name = vertical velocity for updraft + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cf_upi] + standard_name = convective_cloud_fraction_for_microphysics + long_name = convective cloud fraction for microphysics + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[frland] + standard_name = land_area_fraction_for_microphysics + long_name = land area fraction used in microphysics schemes + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zpbl] + standard_name = atmosphere_boundary_layer_thickness + long_name = pbl height + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cnv_mfd_i] + standard_name = detrained_mass_flux + long_name = detrained mass flux + units = kg m-2 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cnv_dqldt_i] + standard_name = tendency_of_cloud_water_due_to_convective_microphysics + long_name = tendency of cloud water due to convective microphysics + units = kg m-2 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[clcn_i] + standard_name = convective_cloud_volume_fraction + long_name = convective cloud volume fraction + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[u_i] + standard_name = x_wind_updated_by_physics + long_name = zonal wind updated by physics + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v_i] + standard_name = y_wind_updated_by_physics + long_name = meridional wind updated by physics + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[taugwx] + standard_name = cumulative_surface_x_momentum_flux_for_diag_multiplied_by_timestep + long_name = cumulative sfc x momentum flux multiplied by timestep + units = Pa s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[taugwy] + standard_name = cumulative_surface_y_momentum_flux_for_diag_multiplied_by_timestep + long_name = cumulative sfc y momentum flux multiplied by timestep + units = Pa s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tauorox] + standard_name = instantaneous_surface_x_momentum_flux + long_name = x momentum flux + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tauoroy] + standard_name = instantaneous_surface_y_momentum_flux + long_name = y momentum flux + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cnv_fice_i] + standard_name = ice_fraction_in_convective_tower + long_name = ice fraction in convective tower + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cnv_ndrop_i] + standard_name = number_concentration_of_cloud_liquid_water_particles_for_detrainment + long_name = droplet number concentration in convective detrainment + units = m-3 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cnv_nice_i] + standard_name = number_concentration_of_ice_crystals_for_detrainment + long_name = crystal number concentration in convective detrainment + units = m-3 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q_io] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[lwm_o] + standard_name = cloud_condensed_water_mixing_ratio_updated_by_physics + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud condensed water updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[qi_o] + standard_name = ice_water_mixing_ratio_updated_by_physics + long_name = moist (dry+vapor, no condensates) mixing ratio of ice water updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[t_io] + standard_name = air_temperature_updated_by_physics + long_name = temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rn_o] + standard_name = lwe_thickness_of_explicit_precipitation_amount + long_name = explicit precipitation (rain, ice, snow, graupel, ...) on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[sr_o] + standard_name = ratio_of_snowfall_to_rainfall + long_name = snow ratio: ratio of snow to total precipitation + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[ncpl_io] + standard_name = cloud_droplet_number_concentration_updated_by_physics + long_name = number concentration of cloud droplets updated by physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ncpi_io] + standard_name = ice_number_concentration_updated_by_physics + long_name = number concentration of ice updated by physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fprcp] + standard_name = number_of_frozen_precipitation_species + long_name = number of frozen precipitation species + units = count + dimensions = () + type = integer + intent = in + optional = F +[rnw_io] + standard_name = local_rain_water_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of rain water local to physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snw_io] + standard_name = local_snow_water_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of snow water local to physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qgl_io] + standard_name = local_graupel_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of graupel local to physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ncpr_io] + standard_name = local_rain_number_concentration + long_name = number concentration of rain local to physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ncps_io] + standard_name = local_snow_number_concentration + long_name = number concentration of snow local to physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ncgl_io] + standard_name = local_graupel_number_concentration + long_name = number concentration of graupel local to physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[clls_io] + standard_name = cloud_fraction_for_MG + long_name = cloud fraction used by Morrison-Gettelman MP + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[kcbl] + standard_name = vertical_index_at_cloud_base + long_name = vertical index at cloud base + units = index + dimensions = (horizontal_dimension) + type = integer + intent = inout + optional = F +[cldreffl] + standard_name = effective_radius_of_stratiform_cloud_liquid_water_particle_in_um + long_name = effective radius of cloud liquid water particle in micrometer + units = um + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cldreffi] + standard_name = effective_radius_of_stratiform_cloud_ice_particle_in_um + long_name = effective radius of cloud ice water particle in micrometers + units = um + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cldreffr] + standard_name = effective_radius_of_stratiform_cloud_rain_particle_in_um + long_name = effective radius of cloud rain particle in micrometers + units = um + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cldreffs] + standard_name = effective_radius_of_stratiform_cloud_snow_particle_in_um + long_name = effective radius of cloud snow particle in micrometers + units = um + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cldreffg] + standard_name = effective_radius_of_stratiform_cloud_graupel_particle_in_um + long_name = effective radius of cloud graupel particle in micrometers + units = um + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[aerfld_i] + standard_name = aerosol_number_concentration_from_gocart_aerosol_climatology + long_name = GOCART aerosol climatology number concentration + units = kg-1? + dimensions = (horizontal_dimension,vertical_dimension,number_of_aerosol_tracers_MG) + type = real + kind = kind_phys + intent = in + optional = F +[aero_in] + standard_name = flag_for_aerosol_input_MG + long_name = flag for using aerosols in Morrison-Gettelman microphysics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[naai_i] + standard_name = in_number_concentration + long_name = IN number concentration + units = kg-1? + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[npccn_i] + standard_name = ccn_number_concentration + long_name = CCN number concentration + units = kg-1? + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[iccn] + standard_name = flag_for_in_ccn_forcing_for_morrison_gettelman_microphysics + long_name = flag for IN and CCN forcing for morrison gettelman microphysics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[skip_macro] + standard_name = flag_skip_macro + long_name = flag to skip cloud macrophysics in Morrison scheme + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lprnt] + standard_name = flag_print + long_name = control flag for diagnostic print out + units = flag + dimensions = () + type = logical + intent = in + optional = F +[alf_fac] + standard_name = mg_tuning_factor_for_alphas + long_name = tuning factor for alphas (alpha = 1 - critical relative humidity) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[qc_min] + standard_name = mg_minimum_cloud_condensed_water_and_ice_mixing_ratio + long_name = minimum cloud condensed water and ice mixing ratio in MG macro clouds + units = kg kg-1 + dimensions = (2) + type = real + kind = kind_phys + intent = in + optional = F +[pdfflag] + standard_name = flag_for_pdf_for_morrison_gettelman_microphysics_scheme + long_name = pdf flag for MG macrophysics + units = flag + dimensions = () + type = integer + intent = in + optional = F +[ipr] + standard_name = horizontal_index_of_printed_column + long_name = horizontal index of printed column + units = index + dimensions = () + type = integer + intent = in + optional = F +[kdt] + standard_name = index_of_time_step + long_name = current forecast iteration + units = index + dimensions = () + type = integer + intent = in + optional = F +[xlat] + standard_name = latitude + long_name = latitude + units = radians + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[xlon] + standard_name = longitude + long_name = longitude + units = radians + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rhc_i] + standard_name = critical_relative_humidity + long_name = critical relative humidity + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/m_micro_interstitial.F90 b/physics/m_micro_interstitial.F90 index c40740e63..2ab2b68db 100644 --- a/physics/m_micro_interstitial.F90 +++ b/physics/m_micro_interstitial.F90 @@ -18,43 +18,7 @@ end subroutine m_micro_pre_init !! #if 0 !! \section arg_table_m_micro_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|---------|------|------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | -!! | do_shoc | flag_for_shoc | flag for SHOC | flag | 0 | logical | | in | F | -!! | skip_macro | flag_skip_macro | flag to skip cloud macrophysics in Morrison scheme | flag | 0 | logical | | inout | F | -!! | fprcp | number_of_frozen_precipitation_species | number of frozen precipitation species | count | 0 | integer | | in | F | -!! | mg3_as_mg2 | flag_mg3_as_mg2 | flag for controlling prep for Morrison-Gettelman microphysics | flag | 0 | logical | | in | F | -!! | gq0_ice | ice_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of ice water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gq0_water | cloud_condensed_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of cloud condensed water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gq0_rain | rain_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of rain water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gq0_snow | snow_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of snow water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gq0_graupel | graupel_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of graupel updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gq0_rain_nc | rain_number_concentration_updated_by_physics | number concentration of rain updated by physics | kg-1 | 2 | real | kind_phys | in | F | -!! | gq0_snow_nc | snow_number_concentration_updated_by_physics | number concentration of snow updated by physics | kg-1 | 2 | real | kind_phys | in | F | -!! | gq0_graupel_nc | graupel_number_concentration_updated_by_physics | number concentration of graupel updated by physics | kg-1 | 2 | real | kind_phys | in | F | -!! | cld_shoc | subgrid_scale_cloud_fraction_from_shoc | subgrid-scale cloud fraction from the SHOC scheme | frac | 2 | real | kind_phys | in | F | -!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | in | F | -!! | cnvw | convective_cloud_water_mixing_ratio | moist convective cloud water mixing ratio | kg kg-1 | 2 | real | kind_phys | in | F | -!! | tcr | cloud_phase_transition_threshold_temperature | threshold temperature below which cloud starts to freeze | K | 0 | real | kind_phys | in | F | -!! | tcrf | cloud_phase_transition_denominator | denominator in cloud phase transition = 1/(tcr-tf) | K-1 | 0 | real | kind_phys | in | F | -!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | in | F | -!! | qrn | local_rain_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of rain water local to physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qsnw | local_snow_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of snow water local to physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qgl | local_graupel_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of graupel local to physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ncpr | local_rain_number_concentration | number concentration of rain local to physics | kg-1 | 2 | real | kind_phys | inout | F | -!! | ncps | local_snow_number_concentration | number concentration of snow local to physics | kg-1 | 2 | real | kind_phys | inout | F | -!! | ncgl | local_graupel_number_concentration | number concentration of graupel local to physics | kg-1 | 2 | real | kind_phys | inout | F | -!! | cld_frc_MG | cloud_fraction_for_MG | cloud fraction used by Morrison-Gettelman MP | frac | 2 | real | kind_phys | inout | F | -!! | qlcn | mass_fraction_of_convective_cloud_liquid_water | mass fraction of convective cloud liquid water | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qicn | mass_fraction_of_convective_cloud_ice | mass fraction of convective cloud ice water | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | cf_upi | convective_cloud_fraction_for_microphysics | convective cloud fraction for microphysics | frac | 2 | real | kind_phys | inout | F | -!! | clw_water | cloud_condensed_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | out | F | -!! | clw_ice | ice_water_mixing_ratio_convective_transport_tracer | moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array | kg kg-1 | 2 | real | kind_phys | out | F | -!! | clcn | convective_cloud_volume_fraction | convective cloud volume fraction | frac | 2 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude m_micro_pre_run.html !! #endif subroutine m_micro_pre_run (im, levs, do_shoc, skip_macro, fprcp, mg3_as_mg2, gq0_ice, gq0_water, gq0_rain, & @@ -206,31 +170,7 @@ end subroutine m_micro_post_init ! \brief Brief description of the subroutine !! !! \section arg_table_m_micro_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------------------------|----------------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | -!! | fprcp | number_of_frozen_precipitation_species | number of frozen precipitation species | count | 0 | integer | | in | F | -!! | mg3_as_mg2 | flag_mg3_as_mg2 | flag for controlling prep for Morrison-Gettelman microphysics | flag | 0 | logical | | in | F | -!! | ncpr | local_rain_number_concentration | number concentration of rain local to physics | kg-1 | 2 | real | kind_phys | in | F | -!! | ncps | local_snow_number_concentration | number concentration of snow local to physics | kg-1 | 2 | real | kind_phys | in | F | -!! | ncgl | local_graupel_number_concentration | number concentration of graupel local to physics | kg-1 | 2 | real | kind_phys | in | F | -!! | qrn | local_rain_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of rain water local to physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qsnw | local_snow_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of snow water local to physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qgl | local_graupel_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of graupel local to physics | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | gq0_ice | ice_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of ice water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gq0_rain | rain_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of rain water updated by physics | kg kg-1 | 2 | real | kind_phys | out | F | -!! | gq0_snow | snow_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of snow water updated by physics | kg kg-1 | 2 | real | kind_phys | out | F | -!! | gq0_graupel | graupel_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of graupel updated by physics | kg kg-1 | 2 | real | kind_phys | out | F | -!! | gq0_rain_nc | rain_number_concentration_updated_by_physics | number concentration of rain updated by physics | kg-1 | 2 | real | kind_phys | out | F | -!! | gq0_snow_nc | snow_number_concentration_updated_by_physics | number concentration of snow updated by physics | kg-1 | 2 | real | kind_phys | out | F | -!! | gq0_graupel_nc | graupel_number_concentration_updated_by_physics | number concentration of graupel updated by physics | kg-1 | 2 | real | kind_phys | out | F | -!! | ice | lwe_thickness_of_ice_amount_on_dynamics_timestep | ice fall at this time step | m | 1 | real | kind_phys | out | F | -!! | snow | lwe_thickness_of_snow_amount_on_dynamics_timestep | snow fall at this time step | m | 1 | real | kind_phys | out | F | -!! | graupel | lwe_thickness_of_graupel_amount_on_dynamics_timestep | graupel fall at this time step | m | 1 | real | kind_phys | out | F | -!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude m_micro_post_run.html !! subroutine m_micro_post_run( & im, levs, fprcp, mg3_as_mg2, ncpr, ncps, ncgl, qrn, qsnw, qgl, & diff --git a/physics/m_micro_interstitial.meta b/physics/m_micro_interstitial.meta new file mode 100644 index 000000000..17358de83 --- /dev/null +++ b/physics/m_micro_interstitial.meta @@ -0,0 +1,538 @@ +[ccpp-arg-table] + name = m_micro_pre_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = m_micro_pre_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of vertical layers + units = count + dimensions = () + type = integer + intent = in + optional = F +[do_shoc] + standard_name = flag_for_shoc + long_name = flag for SHOC + units = flag + dimensions = () + type = logical + intent = in + optional = F +[skip_macro] + standard_name = flag_skip_macro + long_name = flag to skip cloud macrophysics in Morrison scheme + units = flag + dimensions = () + type = logical + intent = inout + optional = F +[fprcp] + standard_name = number_of_frozen_precipitation_species + long_name = number of frozen precipitation species + units = count + dimensions = () + type = integer + intent = in + optional = F +[mg3_as_mg2] + standard_name = flag_mg3_as_mg2 + long_name = flag for controlling prep for Morrison-Gettelman microphysics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[gq0_ice] + standard_name = ice_water_mixing_ratio_updated_by_physics + long_name = moist (dry+vapor, no condensates) mixing ratio of ice water updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0_water] + standard_name = cloud_condensed_water_mixing_ratio_updated_by_physics + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud condensed water updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0_rain] + standard_name = rain_water_mixing_ratio_updated_by_physics + long_name = moist (dry+vapor, no condensates) mixing ratio of rain water updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0_snow] + standard_name = snow_water_mixing_ratio_updated_by_physics + long_name = moist (dry+vapor, no condensates) mixing ratio of snow water updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0_graupel] + standard_name = graupel_mixing_ratio_updated_by_physics + long_name = moist (dry+vapor, no condensates) mixing ratio of graupel updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0_rain_nc] + standard_name = rain_number_concentration_updated_by_physics + long_name = number concentration of rain updated by physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0_snow_nc] + standard_name = snow_number_concentration_updated_by_physics + long_name = number concentration of snow updated by physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0_graupel_nc] + standard_name = graupel_number_concentration_updated_by_physics + long_name = number concentration of graupel updated by physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cld_shoc] + standard_name = subgrid_scale_cloud_fraction_from_shoc + long_name = subgrid-scale cloud fraction from the SHOC scheme + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cnvc] + standard_name = convective_cloud_cover + long_name = convective cloud cover + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cnvw] + standard_name = convective_cloud_water_mixing_ratio + long_name = moist convective cloud water mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tcr] + standard_name = cloud_phase_transition_threshold_temperature + long_name = threshold temperature below which cloud starts to freeze + units = K + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[tcrf] + standard_name = cloud_phase_transition_denominator + long_name = denominator in cloud phase transition = 1/(tcr-tf) + units = K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qrn] + standard_name = local_rain_water_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of rain water local to physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qsnw] + standard_name = local_snow_water_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of snow water local to physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qgl] + standard_name = local_graupel_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of graupel local to physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ncpr] + standard_name = local_rain_number_concentration + long_name = number concentration of rain local to physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ncps] + standard_name = local_snow_number_concentration + long_name = number concentration of snow local to physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ncgl] + standard_name = local_graupel_number_concentration + long_name = number concentration of graupel local to physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cld_frc_MG] + standard_name = cloud_fraction_for_MG + long_name = cloud fraction used by Morrison-Gettelman MP + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qlcn] + standard_name = mass_fraction_of_convective_cloud_liquid_water + long_name = mass fraction of convective cloud liquid water + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qicn] + standard_name = mass_fraction_of_convective_cloud_ice + long_name = mass fraction of convective cloud ice water + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cf_upi] + standard_name = convective_cloud_fraction_for_microphysics + long_name = convective cloud fraction for microphysics + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[clw_water] + standard_name = cloud_condensed_water_mixing_ratio_convective_transport_tracer + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) in the convectively transported tracer array + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[clw_ice] + standard_name = ice_water_mixing_ratio_convective_transport_tracer + long_name = moist (dry+vapor, no condensates) mixing ratio of ice water in the convectively transported tracer array + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[clcn] + standard_name = convective_cloud_volume_fraction + long_name = convective cloud volume fraction + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = m_micro_pre_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = m_micro_post_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = m_micro_post_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of vertical layers + units = count + dimensions = () + type = integer + intent = in + optional = F +[fprcp] + standard_name = number_of_frozen_precipitation_species + long_name = number of frozen precipitation species + units = count + dimensions = () + type = integer + intent = in + optional = F +[mg3_as_mg2] + standard_name = flag_mg3_as_mg2 + long_name = flag for controlling prep for Morrison-Gettelman microphysics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ncpr] + standard_name = local_rain_number_concentration + long_name = number concentration of rain local to physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ncps] + standard_name = local_snow_number_concentration + long_name = number concentration of snow local to physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ncgl] + standard_name = local_graupel_number_concentration + long_name = number concentration of graupel local to physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qrn] + standard_name = local_rain_water_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of rain water local to physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qsnw] + standard_name = local_snow_water_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of snow water local to physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qgl] + standard_name = local_graupel_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of graupel local to physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gq0_ice] + standard_name = ice_water_mixing_ratio_updated_by_physics + long_name = moist (dry+vapor, no condensates) mixing ratio of ice water updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gq0_rain] + standard_name = rain_water_mixing_ratio_updated_by_physics + long_name = moist (dry+vapor, no condensates) mixing ratio of rain water updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[gq0_snow] + standard_name = snow_water_mixing_ratio_updated_by_physics + long_name = moist (dry+vapor, no condensates) mixing ratio of snow water updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[gq0_graupel] + standard_name = graupel_mixing_ratio_updated_by_physics + long_name = moist (dry+vapor, no condensates) mixing ratio of graupel updated by physics + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[gq0_rain_nc] + standard_name = rain_number_concentration_updated_by_physics + long_name = number concentration of rain updated by physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[gq0_snow_nc] + standard_name = snow_number_concentration_updated_by_physics + long_name = number concentration of snow updated by physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[gq0_graupel_nc] + standard_name = graupel_number_concentration_updated_by_physics + long_name = number concentration of graupel updated by physics + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[ice] + standard_name = lwe_thickness_of_ice_amount_on_dynamics_timestep + long_name = ice fall at this time step + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[snow] + standard_name = lwe_thickness_of_snow_amount_on_dynamics_timestep + long_name = snow fall at this time step + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[graupel] + standard_name = lwe_thickness_of_graupel_amount_on_dynamics_timestep + long_name = graupel fall at this time step + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dtp] + standard_name = time_step_for_physics + long_name = physics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = m_micro_post_finalize + type = scheme diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index 4d97c6f24..36c9e55de 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -19,115 +19,7 @@ end subroutine mynnedmf_wrapper_finalize ! \brief This scheme (1) performs pre-mynnedmf work, (2) runs the mynnedmf, and (3) performs post-mynnedmf work #if 0 !> \section arg_table_mynnedmf_wrapper_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------------------|------------------------------------------------------------------------------|----------------------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | flag_init | flag_for_first_time_step | flag signaling first time step for time integration loop | flag | 0 | logical | | in | F | -!! | flag_restart | flag_for_restart | flag for restart (warmstart) or coldstart | flag | 0 | logical | | in | F | -!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | -!! | lsidea | flag_idealized_physics | flag for idealized physics | flag | 0 | logical | | in | F | -!! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | -!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | -!! | dx | cell_size | size of the grid cell | m | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | U | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | V | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | omega | omega | layer mean vertical velocity | Pa s-1 | 2 | real | kind_phys | in | F | -!! | T3D | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | -!! | qgrs_water_vapor | water_vapor_specific_humidity | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | in | F | -!! | qgrs_liquid_cloud | cloud_condensed_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) | kg kg-1 | 2 | real | kind_phys | in | F | -!! | qgrs_ice_cloud | ice_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of ice water | kg kg-1 | 2 | real | kind_phys | in | F | -!! | qgrs_cloud_droplet_num_conc | cloud_droplet_number_concentration | number concentration of cloud droplets (liquid) | kg-1 | 2 | real | kind_phys | in | F | -!! | qgrs_cloud_ice_num_conc | ice_number_concentration | number concentration of ice | kg-1 | 2 | real | kind_phys | in | F | -!! | qgrs_ozone | ozone_mixing_ratio | ozone mixing ratio | kg kg-1 | 2 | real | kind_phys | in | F | -!! | qgrs_water_aer_num_conc | water_friendly_aerosol_number_concentration | number concentration of water-friendly aerosols | kg-1 | 2 | real | kind_phys | in | F | -!! | qgrs_ice_aer_num_conc | ice_friendly_aerosol_number_concentration | number concentration of ice-friendly aerosols | kg-1 | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | exner | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | -!! | slmsk | sea_land_ice_mask_real | landmask: sea/land/ice=0/1/2 | flag | 1 | real | kind_phys | in | F | -!! | tsurf | surface_skin_temperature | surface temperature | K | 1 | real | kind_phys | in | F | -!! | qsfc | surface_specific_humidity | surface air saturation specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | ps | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | ust | surface_friction_velocity | boundary layer parameter | m s-1 | 1 | real | kind_phys | in | F | -!! | ch | surface_drag_wind_speed_for_momentum_in_air | momentum exchange coefficient | m s-1 | 1 | real | kind_phys | out | F | -!! | hflx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | qflx | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | wspd | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | rb | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | -!! | dtsfc1 | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux valid for current call | W m-2 | 1 | real | kind_phys | out | F | -!! | dqsfc1 | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux valid for current call | W m-2 | 1 | real | kind_phys | out | F | -!! | dtsfci_diag | instantaneous_surface_upward_sensible_heat_flux_for_diag | instantaneous sfc sensible heat flux multiplied by timestep | W m-2 | 1 | real | kind_phys | out | F | -!! | dqsfci_diag | instantaneous_surface_upward_latent_heat_flux_for_diag | instantaneous sfc latent heat flux multiplied by timestep | W m-2 | 1 | real | kind_phys | out | F | -!! | dtsfc_diag | cumulative_surface_upward_sensible_heat_flux_for_diag_multiplied_by_timestep | cumulative sfc sensible heat flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | out | F | -!! | dqsfc_diag | cumulative_surface_upward_latent_heat_flux_for_diag_multiplied_by_timestep | cumulative sfc latent heat flux multiplied by timestep | W m-2 s | 1 | real | kind_phys | out | F | -!! | recmol | reciprocal_of_obukhov_length | one over obukhov length | m-1 | 1 | real | kind_phys | in | F | -!! | qke | tke_at_mass_points | 2 x tke at mass points | m2 s-2 | 2 | real | kind_phys | inout | F | -!! | qke_adv | turbulent_kinetic_energy | turbulent kinetic energy | J | 2 | real | kind_phys | inout | F | -!! | tsq | t_prime_squared | temperature fluctuation squared | K2 | 2 | real | kind_phys | out | F | -!! | qsq | q_prime_squared | water vapor fluctuation squared | kg2 kg-2 | 2 | real | kind_phys | out | F | -!! | cov | t_prime_q_prime | covariance of temperature and moisture | K kg kg-1 | 2 | real | kind_phys | out | F | -!! | el_pbl | mixing_length | mixing length in meters | m | 2 | real | kind_phys | inout | F | -!! | Sh3D | stability_function_for_heat | stability function for heat | none | 2 | real | kind_phys | inout | F | -!! | exch_h | atmosphere_heat_diffusivity_for_mynnpbl | diffusivity for heat for MYNN PBL (defined for all mass levels) | m2 s-1 | 2 | real | kind_phys | out | F | -!! | exch_m | atmosphere_momentum_diffusivity_for_mynnpbl | diffusivity for momentum for MYNN PBL (defined for all mass levels) | m2 s-1 | 2 | real | kind_phys | out | F | -!! | PBLH | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | inout | F | -!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | inout | F | -!! | QC_BL | subgrid_cloud_mixing_ratio_pbl | subgrid cloud cloud mixing ratio from PBL scheme | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | CLDFRA_BL | subgrid_cloud_fraction_pbl | subgrid cloud fraction from PBL scheme | frac | 2 | real | kind_phys | inout | F | -!! | edmf_a | emdf_updraft_area | updraft area from mass flux scheme | frac | 2 | real | kind_phys | inout | F | -!! | edmf_w | emdf_updraft_vertical_velocity | updraft vertical velocity from mass flux scheme | m s-1 | 2 | real | kind_phys | inout | F | -!! | edmf_qt | emdf_updraft_total_water | updraft total water from mass flux scheme | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | edmf_thl | emdf_updraft_theta_l | updraft theta-l from mass flux scheme | K | 2 | real | kind_phys | inout | F | -!! | edmf_ent | emdf_updraft_entrainment_rate | updraft entrainment rate from mass flux scheme | s-1 | 2 | real | kind_phys | inout | F | -!! | edmf_qc | emdf_updraft_cloud_water | updraft cloud water from mass flux scheme | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | nupdraft | number_of_plumes | number of plumes per grid column | count | 1 | integer | | inout | F | -!! | maxMF | maximum_mass_flux | maximum mass flux within a column | m s-1 | 1 | real | kind_phys | out | F | -!! | ktop_shallow | k_level_of_highest_reaching_plume | k-level of highest reaching plume | count | 1 | integer | | inout | F | -!! | RTHRATEN | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step | total sky longwave heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | dudt | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | dvdt | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | -!! | dqdt_water_vapor | tendency_of_water_vapor_specific_humidity_due_to_model_physics | water vapor specific humidity tendency due to model physics | kg kg-1 s-1 | 2 | real | kind_phys | inout | F | -!! | dqdt_liquid_cloud | tendency_of_liquid_cloud_water_mixing_ratio_due_to_model_physics | cloud condensed water mixing ratio tendency due to model physics | kg kg-1 s-1 | 2 | real | kind_phys | inout | F | -!! | dqdt_ice_cloud | tendency_of_ice_cloud_water_mixing_ratio_due_to_model_physics | cloud condensed water mixing ratio tendency due to model physics | kg kg-1 s-1 | 2 | real | kind_phys | inout | F | -!! | dqdt_ozone | tendency_of_ozone_mixing_ratio_due_to_model_physics | ozone mixing ratio tendency due to model physics | kg kg-1 s-1 | 2 | real | kind_phys | inout | F | -!! | dqdt_cloud_droplet_num_conc | tendency_of_cloud_droplet_number_concentration_due_to_model_physics | number conc. of cloud droplets (liquid) tendency due to model physics | kg-1 s-1 | 2 | real | kind_phys | inout | F | -!! | dqdt_ice_num_conc | tendency_of_ice_number_concentration_due_to_model_physics | number conc. of ice tendency due to model physics | kg-1 s-1 | 2 | real | kind_phys | inout | F | -!! | dqdt_water_aer_num_conc | tendency_of_water_friendly_aerosol_number_concentration_due_to_model_physics | number conc. of water-friendly aerosols tendency due to model physics | kg-1 s-1 | 2 | real | kind_phys | inout | F | -!! | dqdt_ice_aer_num_conc | tendency_of_ice_friendly_aerosol_number_concentration_due_to_model_physics | number conc. of ice-friendly aerosols tendency due to model physics | kg-1 s-1 | 2 | real | kind_phys | inout | F | -!! | dt3dt | cumulative_change_in_temperature_due_to_PBL | cumulative change in temperature due to PBL | K | 2 | real | kind_phys | inout | F | -!! | du3dt_PBL | cumulative_change_in_x_wind_due_to_PBL | cumulative change in x wind due to PBL | m s-1 | 2 | real | kind_phys | inout | F | -!! | du3dt_OGWD | cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag | cumulative change in x wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | -!! | dv3dt_PBL | cumulative_change_in_y_wind_due_to_PBL | cumulative change in y wind due to PBL | m s-1 | 2 | real | kind_phys | inout | F | -!! | dv3dt_OGWD | cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag | cumulative change in y wind due to orographic gravity wave drag | m s-1 | 2 | real | kind_phys | inout | F | -!! | htrsw | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep | total sky sw heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | htrlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep | total sky lw heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave | none | 1 | real | kind_phys | in | F | -!! | grav_settling | grav_settling | flag to activate gravitational setting of fog | flag | 0 | integer | | in | F | -!! | bl_mynn_tkebudget | tke_budget | flag for activating TKE budget | flag | 0 | integer | | in | F | -!! | bl_mynn_tkeadvect | tke_advect | flag for activating TKE advect | flag | 0 | logical | | in | F | -!! | bl_mynn_cloudpdf | cloudpdf | flag to determine which cloud PDF to use | flag | 0 | integer | | in | F | -!! | bl_mynn_mixlength | mixing_length_flag | flag to determine which mixing length form to use | flag | 0 | integer | | in | F | -!! | bl_mynn_edmf | edmf_flag | flag to activate the mass-flux scheme | flag | 0 | integer | | in | F | -!! | bl_mynn_edmf_mom | edmf_momentum_transport_flag | flag to activate the transport of momentum | flag | 0 | integer | | in | F | -!! | bl_mynn_edmf_tke | edmf_tke_transport_flag | flag to activate the transport of TKE | flag | 0 | integer | | in | F | -!! | bl_mynn_edmf_part | edmf_partition_flag | flag to partitioning of the MF and ED areas | flag | 0 | integer | | in | F | -!! | bl_mynn_cloudmix | cloud_specie_mix_flag | flag to activate mixing of cloud species | flag | 0 | integer | | in | F | -!! | bl_mynn_mixqt | mix_total_water_flag | flag to mix total water or individual species | flag | 0 | integer | | in | F | -!! | icloud_bl | couple_sgs_clouds_to_radiation_flag | flag for coupling sgs clouds to radiation | flag | 0 | integer | | in | F | -!! | do_mynnsfclay | do_mynnsfclay | flag to activate MYNN surface layer | flag | 0 | logical | | in | F | -!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_wsm6 | flag_for_wsm6_microphysics_scheme | choice of WSM6 microphysics scheme | flag | 0 | integer | | in | F | -!! | ltaerosol | flag_for_aerosol_physics | flag for aerosol physics | flag | 0 | logical | | in | F | -!! | lprnt | flag_print | control flag for diagnostic print out | flag | 0 | logical | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude mynnedmf_wrapper_run.html !! #endif SUBROUTINE mynnedmf_wrapper_run( & diff --git a/physics/module_MYNNPBL_wrapper.meta b/physics/module_MYNNPBL_wrapper.meta new file mode 100644 index 000000000..61a9ccb70 --- /dev/null +++ b/physics/module_MYNNPBL_wrapper.meta @@ -0,0 +1,935 @@ +[ccpp-arg-table] + name = mynnedmf_wrapper_run + type = scheme +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[flag_init] + standard_name = flag_for_first_time_step + long_name = flag signaling first time step for time integration loop + units = flag + dimensions = () + type = logical + intent = in + optional = F +[flag_restart] + standard_name = flag_for_restart + long_name = flag for restart (warmstart) or coldstart + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lssav] + standard_name = flag_diagnostics + long_name = logical flag for storing diagnostics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for 3d diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lsidea] + standard_name = flag_idealized_physics + long_name = flag for idealized physics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[delt] + standard_name = time_step_for_physics + long_name = time step for physics + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dtf] + standard_name = time_step_for_dynamics + long_name = dynamics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dx] + standard_name = cell_size + long_name = size of the grid cell + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zorl] + standard_name = surface_roughness_length + long_name = surface roughness length in cm + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[phii] + standard_name = geopotential_at_interface + long_name = geopotential at model layer interfaces + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[U] + standard_name = x_wind + long_name = x component of layer wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[V] + standard_name = y_wind + long_name = y component of layer wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[omega] + standard_name = omega + long_name = layer mean vertical velocity + units = Pa s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[T3D] + standard_name = air_temperature + long_name = layer mean air temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qgrs_water_vapor] + standard_name = water_vapor_specific_humidity + long_name = water vapor specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qgrs_liquid_cloud] + standard_name = cloud_condensed_water_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qgrs_ice_cloud] + standard_name = ice_water_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of ice water + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qgrs_cloud_droplet_num_conc] + standard_name = cloud_droplet_number_concentration + long_name = number concentration of cloud droplets (liquid) + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qgrs_cloud_ice_num_conc] + standard_name = ice_number_concentration + long_name = number concentration of ice + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qgrs_ozone] + standard_name = ozone_mixing_ratio + long_name = ozone mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qgrs_water_aer_num_conc] + standard_name = water_friendly_aerosol_number_concentration + long_name = number concentration of water-friendly aerosols + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qgrs_ice_aer_num_conc] + standard_name = ice_friendly_aerosol_number_concentration + long_name = number concentration of ice-friendly aerosols + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[exner] + standard_name = dimensionless_exner_function_at_model_layers + long_name = Exner function at layers + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[slmsk] + standard_name = sea_land_ice_mask_real + long_name = landmask: sea/land/ice=0/1/2 + units = flag + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsurf] + standard_name = surface_skin_temperature + long_name = surface temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qsfc] + standard_name = surface_specific_humidity + long_name = surface air saturation specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ps] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ust] + standard_name = surface_friction_velocity + long_name = boundary layer parameter + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ch] + standard_name = surface_drag_wind_speed_for_momentum_in_air + long_name = momentum exchange coefficient + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[hflx] + standard_name = kinematic_surface_upward_sensible_heat_flux + long_name = kinematic surface upward sensible heat flux + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qflx] + standard_name = kinematic_surface_upward_latent_heat_flux + long_name = kinematic surface upward latent heat flux + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[wspd] + standard_name = wind_speed_at_lowest_model_layer + long_name = wind speed at lowest model level + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rb] + standard_name = bulk_richardson_number_at_lowest_model_level + long_name = bulk Richardson number at the surface + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dtsfc1] + standard_name = instantaneous_surface_upward_sensible_heat_flux + long_name = surface upward sensible heat flux valid for current call + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dqsfc1] + standard_name = instantaneous_surface_upward_latent_heat_flux + long_name = surface upward latent heat flux valid for current call + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dtsfci_diag] + standard_name = instantaneous_surface_upward_sensible_heat_flux_for_diag + long_name = instantaneous sfc sensible heat flux multiplied by timestep + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dqsfci_diag] + standard_name = instantaneous_surface_upward_latent_heat_flux_for_diag + long_name = instantaneous sfc latent heat flux multiplied by timestep + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dtsfc_diag] + standard_name = cumulative_surface_upward_sensible_heat_flux_for_diag_multiplied_by_timestep + long_name = cumulative sfc sensible heat flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dqsfc_diag] + standard_name = cumulative_surface_upward_latent_heat_flux_for_diag_multiplied_by_timestep + long_name = cumulative sfc latent heat flux multiplied by timestep + units = W m-2 s + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[recmol] + standard_name = reciprocal_of_obukhov_length + long_name = one over obukhov length + units = m-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qke] + standard_name = tke_at_mass_points + long_name = 2 x tke at mass points + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qke_adv] + standard_name = turbulent_kinetic_energy + long_name = turbulent kinetic energy + units = J + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsq] + standard_name = t_prime_squared + long_name = temperature fluctuation squared + units = K2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[qsq] + standard_name = q_prime_squared + long_name = water vapor fluctuation squared + units = kg2 kg-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cov] + standard_name = t_prime_q_prime + long_name = covariance of temperature and moisture + units = K kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[el_pbl] + standard_name = mixing_length + long_name = mixing length in meters + units = m + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[Sh3D] + standard_name = stability_function_for_heat + long_name = stability function for heat + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[exch_h] + standard_name = atmosphere_heat_diffusivity_for_mynnpbl + long_name = diffusivity for heat for MYNN PBL (defined for all mass levels) + units = m2 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[exch_m] + standard_name = atmosphere_momentum_diffusivity_for_mynnpbl + long_name = diffusivity for momentum for MYNN PBL (defined for all mass levels) + units = m2 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[PBLH] + standard_name = atmosphere_boundary_layer_thickness + long_name = PBL thickness + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[kpbl] + standard_name = vertical_index_at_top_of_atmosphere_boundary_layer + long_name = PBL top model level index + units = index + dimensions = (horizontal_dimension) + type = integer + intent = inout + optional = F +[QC_BL] + standard_name = subgrid_cloud_mixing_ratio_pbl + long_name = subgrid cloud cloud mixing ratio from PBL scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[CLDFRA_BL] + standard_name = subgrid_cloud_fraction_pbl + long_name = subgrid cloud fraction from PBL scheme + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[edmf_a] + standard_name = emdf_updraft_area + long_name = updraft area from mass flux scheme + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[edmf_w] + standard_name = emdf_updraft_vertical_velocity + long_name = updraft vertical velocity from mass flux scheme + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[edmf_qt] + standard_name = emdf_updraft_total_water + long_name = updraft total water from mass flux scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[edmf_thl] + standard_name = emdf_updraft_theta_l + long_name = updraft theta-l from mass flux scheme + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[edmf_ent] + standard_name = emdf_updraft_entrainment_rate + long_name = updraft entrainment rate from mass flux scheme + units = s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[edmf_qc] + standard_name = emdf_updraft_cloud_water + long_name = updraft cloud water from mass flux scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[nupdraft] + standard_name = number_of_plumes + long_name = number of plumes per grid column + units = count + dimensions = (horizontal_dimension) + type = integer + intent = inout + optional = F +[maxMF] + standard_name = maximum_mass_flux + long_name = maximum mass flux within a column + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[ktop_shallow] + standard_name = k_level_of_highest_reaching_plume + long_name = k-level of highest reaching plume + units = count + dimensions = (horizontal_dimension) + type = integer + intent = inout + optional = F +[RTHRATEN] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step + long_name = total sky longwave heating rate + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[dudt] + standard_name = tendency_of_x_wind_due_to_model_physics + long_name = updated tendency of the x wind + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dvdt] + standard_name = tendency_of_y_wind_due_to_model_physics + long_name = updated tendency of the y wind + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dtdt] + standard_name = tendency_of_air_temperature_due_to_model_physics + long_name = updated tendency of the temperature + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dqdt_water_vapor] + standard_name = tendency_of_water_vapor_specific_humidity_due_to_model_physics + long_name = water vapor specific humidity tendency due to model physics + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dqdt_liquid_cloud] + standard_name = tendency_of_liquid_cloud_water_mixing_ratio_due_to_model_physics + long_name = cloud condensed water mixing ratio tendency due to model physics + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dqdt_ice_cloud] + standard_name = tendency_of_ice_cloud_water_mixing_ratio_due_to_model_physics + long_name = cloud condensed water mixing ratio tendency due to model physics + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dqdt_ozone] + standard_name = tendency_of_ozone_mixing_ratio_due_to_model_physics + long_name = ozone mixing ratio tendency due to model physics + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dqdt_cloud_droplet_num_conc] + standard_name = tendency_of_cloud_droplet_number_concentration_due_to_model_physics + long_name = number conc. of cloud droplets (liquid) tendency due to model physics + units = kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dqdt_ice_num_conc] + standard_name = tendency_of_ice_number_concentration_due_to_model_physics + long_name = number conc. of ice tendency due to model physics + units = kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dqdt_water_aer_num_conc] + standard_name = tendency_of_water_friendly_aerosol_number_concentration_due_to_model_physics + long_name = number conc. of water-friendly aerosols tendency due to model physics + units = kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dqdt_ice_aer_num_conc] + standard_name = tendency_of_ice_friendly_aerosol_number_concentration_due_to_model_physics + long_name = number conc. of ice-friendly aerosols tendency due to model physics + units = kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dt3dt] + standard_name = cumulative_change_in_temperature_due_to_PBL + long_name = cumulative change in temperature due to PBL + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[du3dt_PBL] + standard_name = cumulative_change_in_x_wind_due_to_PBL + long_name = cumulative change in x wind due to PBL + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[du3dt_OGWD] + standard_name = cumulative_change_in_x_wind_due_to_orographic_gravity_wave_drag + long_name = cumulative change in x wind due to orographic gravity wave drag + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dv3dt_PBL] + standard_name = cumulative_change_in_y_wind_due_to_PBL + long_name = cumulative change in y wind due to PBL + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dv3dt_OGWD] + standard_name = cumulative_change_in_y_wind_due_to_orographic_gravity_wave_drag + long_name = cumulative change in y wind due to orographic gravity wave drag + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[htrsw] + standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep + long_name = total sky sw heating rate + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[htrlw] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep + long_name = total sky lw heating rate + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[xmu] + standard_name = zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes + long_name = zenith angle temporal adjustment factor for shortwave + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[grav_settling] + standard_name = grav_settling + long_name = flag to activate gravitational setting of fog + units = flag + dimensions = () + type = integer + intent = in + optional = F +[bl_mynn_tkebudget] + standard_name = tke_budget + long_name = flag for activating TKE budget + units = flag + dimensions = () + type = integer + intent = in + optional = F +[bl_mynn_tkeadvect] + standard_name = tke_advect + long_name = flag for activating TKE advect + units = flag + dimensions = () + type = logical + intent = in + optional = F +[bl_mynn_cloudpdf] + standard_name = cloudpdf + long_name = flag to determine which cloud PDF to use + units = flag + dimensions = () + type = integer + intent = in + optional = F +[bl_mynn_mixlength] + standard_name = mixing_length_flag + long_name = flag to determine which mixing length form to use + units = flag + dimensions = () + type = integer + intent = in + optional = F +[bl_mynn_edmf] + standard_name = edmf_flag + long_name = flag to activate the mass-flux scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[bl_mynn_edmf_mom] + standard_name = edmf_momentum_transport_flag + long_name = flag to activate the transport of momentum + units = flag + dimensions = () + type = integer + intent = in + optional = F +[bl_mynn_edmf_tke] + standard_name = edmf_tke_transport_flag + long_name = flag to activate the transport of TKE + units = flag + dimensions = () + type = integer + intent = in + optional = F +[bl_mynn_edmf_part] + standard_name = edmf_partition_flag + long_name = flag to partitioning of the MF and ED areas + units = flag + dimensions = () + type = integer + intent = in + optional = F +[bl_mynn_cloudmix] + standard_name = cloud_specie_mix_flag + long_name = flag to activate mixing of cloud species + units = flag + dimensions = () + type = integer + intent = in + optional = F +[bl_mynn_mixqt] + standard_name = mix_total_water_flag + long_name = flag to mix total water or individual species + units = flag + dimensions = () + type = integer + intent = in + optional = F +[icloud_bl] + standard_name = couple_sgs_clouds_to_radiation_flag + long_name = flag for coupling sgs clouds to radiation + units = flag + dimensions = () + type = integer + intent = in + optional = F +[do_mynnsfclay] + standard_name = do_mynnsfclay + long_name = flag to activate MYNN surface layer + units = flag + dimensions = () + type = logical + intent = in + optional = F +[imp_physics] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_gfdl] + standard_name = flag_for_gfdl_microphysics_scheme + long_name = choice of GFDL microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_thompson] + standard_name = flag_for_thompson_microphysics_scheme + long_name = choice of Thompson microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_wsm6] + standard_name = flag_for_wsm6_microphysics_scheme + long_name = choice of WSM6 microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[ltaerosol] + standard_name = flag_for_aerosol_physics + long_name = flag for aerosol physics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lprnt] + standard_name = flag_print + long_name = control flag for diagnostic print out + units = flag + dimensions = () + type = logical + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/module_MYNNSFC_wrapper.F90 b/physics/module_MYNNSFC_wrapper.F90 index cae73f6bd..5471c4825 100644 --- a/physics/module_MYNNSFC_wrapper.F90 +++ b/physics/module_MYNNSFC_wrapper.F90 @@ -15,71 +15,7 @@ end subroutine mynnsfc_wrapper_finalize !> \brief This scheme (1) performs pre-mynnsfc work, (2) runs the mynn sfc layer scheme, and (3) performs post-mynnsfc work #if 0 !! \section arg_table_mynnsfc_wrapper_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |---------------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | iter | ccpp_loop_counter | loop counter for subcycling loops in CCPP | index | 0 | integer | | in | F | -!! | flag_init | flag_for_first_time_step | flag signaling first time step for time integration loop | flag | 0 | logical | | in | F | -!! | flag_restart | flag_for_restart | flag for restart (warmstart) or coldstart | flag | 0 | logical | | in | F | -!! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | -!! | dx | cell_size | size of the grid cell | m | 1 | real | kind_phys | in | F | -!! | u | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | v | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | t3d | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | -!! | qvsh | water_vapor_specific_humidity | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | in | F | -!! | qc | cloud_condensed_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) | kg kg-1 | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | exner | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | -!! | tsq | t_prime_squared | temperature fluctuation squared | K2 | 2 | real | kind_phys | in | F | -!! | qsq | q_prime_squared | water vapor fluctuation squared | kg2 kg-2 | 2 | real | kind_phys | in | F | -!! | cov | t_prime_q_prime | covariance of temperature and moisture | K kg kg-1 | 2 | real | kind_phys | in | F | -!! | el_pbl | mixing_length | mixing length in meters | m | 2 | real | kind_phys | in | F | -!! | Sh3D | stability_function_for_heat | stability function for heat | none | 2 | real | kind_phys | in | F | -!! | QC_BL | subgrid_cloud_mixing_ratio_pbl | subgrid cloud cloud mixing ratio from PBL scheme | kg kg-1 | 2 | real | kind_phys | in | F | -!! | CLDFRA_BL | subgrid_cloud_fraction_pbl | subgrid cloud fraction from PBL scheme | frac | 2 | real | kind_phys | in | F | -!! | ps | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | PBLH | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | in | F | -!! | slmsk | sea_land_ice_mask_real | landmask: sea/land/ice=0/1/2 | flag | 1 | real | kind_phys | in | F | -!! | tsk | surface_skin_temperature | surface temperature | K | 1 | real | kind_phys | in | F | -!! | qsfc | surface_specific_humidity | surface air saturation specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | snowd | surface_snow_thickness_water_equivalent | water equivalent snow depth over land | mm | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | inout | F | -!! | ust | surface_friction_velocity | boundary layer parameter | m s-1 | 1 | real | kind_phys | inout | F | -!! | ustm | surface_friction_velocity_drag | friction velocity isolated for momentum only | m s-1 | 1 | real | kind_phys | inout | F | -!! | zol | surface_stability_parameter | monin obukhov surface stability parameter | none | 1 | real | kind_phys | inout | F | -!! | mol | theta_star | temperature flux divided by ustar (temperature scale) | K | 1 | real | kind_phys | inout | F | -!! | rmol | reciprocal_of_obukhov_length | one over obukhov length | m-1 | 1 | real | kind_phys | inout | F | -!! | fm | Monin_Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | inout | F | -!! | fh | Monin_Obukhov_similarity_function_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | inout | F | -!! | fm10 | Monin_Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | inout | F | -!! | fh2 | Monin_Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | inout | F | -!! | wspd | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | inout | F | -!! | br | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | inout | F | -!! | ch | surface_drag_wind_speed_for_momentum_in_air | momentum exchange coefficient | m s-1 | 1 | real | kind_phys | inout | F | -!! | hflx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | inout | F | -!! | QFX | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | inout | F | -!! | lh | surface_latent_heat | latent heating at the surface (pos = up) | W m-2 | 1 | real | kind_phys | inout | F | -!! | flhc | surface_exchange_coefficient_for_heat | surface exchange coefficient for heat | W m-2 K-1 | 1 | real | kind_phys | inout | F | -!! | flqc | surface_exchange_coefficient_for_moisture | surface exchange coefficient for moisture | kg m-2 s-1 | 1 | real | kind_phys | inout | F | -!! | u10 | x_wind_at_10m | 10 meter u wind speed | m s-1 | 1 | real | kind_phys | inout | F | -!! | v10 | y_wind_at_10m | 10 meter v wind speed | m s-1 | 1 | real | kind_phys | inout | F | -!! | th2 | potential_temperature_at_2m | 2 meter potential temperature | K | 1 | real | kind_phys | inout | F | -!! | t2 | temperature_at_2m | 2 meter temperature | K | 1 | real | kind_phys | inout | F | -!! | q2 | specific_humidity_at_2m | 2 meter specific humidity | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | wstar | surface_wind_enhancement_due_to_convection | surface wind enhancement due to convection | m s-1 | 1 | real | kind_phys | inout | F | -!! | chs2 | surface_exchange_coefficient_for_heat_at_2m | exchange coefficient for heat at 2 meters | m s-1 | 1 | real | kind_phys | inout | F | -!! | cqs2 | surface_exchange_coefficient_for_moisture_at_2m | exchange coefficient for moisture at 2 meters | m s-1 | 1 | real | kind_phys | inout | F | -!! | cda | surface_drag_coefficient_for_momentum_in_air | surface exchange coeff for momentum | none | 1 | real | kind_phys | inout | F | -!! | cka | surface_drag_coefficient_for_heat_and_moisture_in_air | surface exchange coeff heat & moisture | none | 1 | real | kind_phys | inout | F | -!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | inout | F | -!! | bl_mynn_cloudpdf | cloudpdf | flag to determine which cloud PDF to use | flag | 0 | integer | | in | F | -!! | icloud_bl | couple_sgs_clouds_to_radiation_flag | flag for coupling sgs clouds to radiation | flag | 0 | integer | | in | F | -!! | lprnt | flag_print | control flag for diagnostic print out | flag | 0 | logical | | none | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude mynnsfc_wrapper_run.html !! #endif !###=================================================================== diff --git a/physics/module_MYNNSFC_wrapper.meta b/physics/module_MYNNSFC_wrapper.meta new file mode 100644 index 000000000..2f877075c --- /dev/null +++ b/physics/module_MYNNSFC_wrapper.meta @@ -0,0 +1,560 @@ +[ccpp-arg-table] + name = mynnsfc_wrapper_run + type = scheme +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[iter] + standard_name = ccpp_loop_counter + long_name = loop counter for subcycling loops in CCPP + units = index + dimensions = () + type = integer + intent = in + optional = F +[flag_init] + standard_name = flag_for_first_time_step + long_name = flag signaling first time step for time integration loop + units = flag + dimensions = () + type = logical + intent = in + optional = F +[flag_restart] + standard_name = flag_for_restart + long_name = flag for restart (warmstart) or coldstart + units = flag + dimensions = () + type = logical + intent = in + optional = F +[delt] + standard_name = time_step_for_physics + long_name = time step for physics + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dx] + standard_name = cell_size + long_name = size of the grid cell + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[u] + standard_name = x_wind + long_name = x component of layer wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v] + standard_name = y_wind + long_name = y component of layer wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t3d] + standard_name = air_temperature + long_name = layer mean air temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qvsh] + standard_name = water_vapor_specific_humidity + long_name = water vapor specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qc] + standard_name = cloud_condensed_water_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[phii] + standard_name = geopotential_at_interface + long_name = geopotential at model layer interfaces + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[exner] + standard_name = dimensionless_exner_function_at_model_layers + long_name = Exner function at layers + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsq] + standard_name = t_prime_squared + long_name = temperature fluctuation squared + units = K2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qsq] + standard_name = q_prime_squared + long_name = water vapor fluctuation squared + units = kg2 kg-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cov] + standard_name = t_prime_q_prime + long_name = covariance of temperature and moisture + units = K kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[el_pbl] + standard_name = mixing_length + long_name = mixing length in meters + units = m + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[Sh3D] + standard_name = stability_function_for_heat + long_name = stability function for heat + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[QC_BL] + standard_name = subgrid_cloud_mixing_ratio_pbl + long_name = subgrid cloud cloud mixing ratio from PBL scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[CLDFRA_BL] + standard_name = subgrid_cloud_fraction_pbl + long_name = subgrid cloud fraction from PBL scheme + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ps] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[PBLH] + standard_name = atmosphere_boundary_layer_thickness + long_name = PBL thickness + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[slmsk] + standard_name = sea_land_ice_mask_real + long_name = landmask: sea/land/ice=0/1/2 + units = flag + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsk] + standard_name = surface_skin_temperature + long_name = surface temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qsfc] + standard_name = surface_specific_humidity + long_name = surface air saturation specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snowd] + standard_name = surface_snow_thickness_water_equivalent + long_name = water equivalent snow depth over land + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zorl] + standard_name = surface_roughness_length + long_name = surface roughness length in cm + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ust] + standard_name = surface_friction_velocity + long_name = boundary layer parameter + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ustm] + standard_name = surface_friction_velocity_drag + long_name = friction velocity isolated for momentum only + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[zol] + standard_name = surface_stability_parameter + long_name = monin obukhov surface stability parameter + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[mol] + standard_name = theta_star + long_name = temperature flux divided by ustar (temperature scale) + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rmol] + standard_name = reciprocal_of_obukhov_length + long_name = one over obukhov length + units = m-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fm] + standard_name = Monin_Obukhov_similarity_function_for_momentum + long_name = Monin-Obukhov similarity parameter for momentum + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fh] + standard_name = Monin_Obukhov_similarity_function_for_heat + long_name = Monin-Obukhov similarity parameter for heat + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fm10] + standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m + long_name = Monin-Obukhov similarity parameter for momentum + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fh2] + standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m + long_name = Monin-Obukhov similarity parameter for heat + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[wspd] + standard_name = wind_speed_at_lowest_model_layer + long_name = wind speed at lowest model level + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[br] + standard_name = bulk_richardson_number_at_lowest_model_level + long_name = bulk Richardson number at the surface + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ch] + standard_name = surface_drag_wind_speed_for_momentum_in_air + long_name = momentum exchange coefficient + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[hflx] + standard_name = kinematic_surface_upward_sensible_heat_flux + long_name = kinematic surface upward sensible heat flux + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[QFX] + standard_name = kinematic_surface_upward_latent_heat_flux + long_name = kinematic surface upward latent heat flux + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[lh] + standard_name = surface_latent_heat + long_name = latent heating at the surface (pos = up) + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[flhc] + standard_name = surface_exchange_coefficient_for_heat + long_name = surface exchange coefficient for heat + units = W m-2 K-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[flqc] + standard_name = surface_exchange_coefficient_for_moisture + long_name = surface exchange coefficient for moisture + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[u10] + standard_name = x_wind_at_10m + long_name = 10 meter u wind speed + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[v10] + standard_name = y_wind_at_10m + long_name = 10 meter v wind speed + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[th2] + standard_name = potential_temperature_at_2m + long_name = 2 meter potential temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[t2] + standard_name = temperature_at_2m + long_name = 2 meter temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[q2] + standard_name = specific_humidity_at_2m + long_name = 2 meter specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[wstar] + standard_name = surface_wind_enhancement_due_to_convection + long_name = surface wind enhancement due to convection + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[chs2] + standard_name = surface_exchange_coefficient_for_heat_at_2m + long_name = exchange coefficient for heat at 2 meters + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cqs2] + standard_name = surface_exchange_coefficient_for_moisture_at_2m + long_name = exchange coefficient for moisture at 2 meters + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cda] + standard_name = surface_drag_coefficient_for_momentum_in_air + long_name = surface exchange coeff for momentum + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cka] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air + long_name = surface exchange coeff heat & moisture + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[stress] + standard_name = surface_wind_stress + long_name = surface wind stress + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[bl_mynn_cloudpdf] + standard_name = cloudpdf + long_name = flag to determine which cloud PDF to use + units = flag + dimensions = () + type = integer + intent = in + optional = F +[icloud_bl] + standard_name = couple_sgs_clouds_to_radiation_flag + long_name = flag for coupling sgs clouds to radiation + units = flag + dimensions = () + type = integer + intent = in + optional = F +[lprnt] + standard_name = flag_print + long_name = control flag for diagnostic print out + units = flag + dimensions = () + type = logical + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/module_MYNNrad_post.F90 b/physics/module_MYNNrad_post.F90 index 987ad1efe..7acd2e406 100644 --- a/physics/module_MYNNrad_post.F90 +++ b/physics/module_MYNNrad_post.F90 @@ -17,17 +17,7 @@ end subroutine mynnrad_post_finalize !! This interstitial code restores the original resolved-scale clouds (qc and qi). #if 0 !! \section arg_table_mynnrad_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |---------------------|-----------------------------------------------------------------------------|----------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | qc | cloud_condensed_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) | kg kg-1 | 2 | real | kind_phys | out | F | -!! | qi | ice_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of ice water | kg kg-1 | 2 | real | kind_phys | out | F | -!! | qc_save | cloud_condensed_water_mixing_ratio_save | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | in | F | -!! | qi_save | ice_water_mixing_ratio_save | moist (dry+vapor, no condensates) mixing ratio of ice water before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude mynnrad_post_run.html !! #endif SUBROUTINE mynnrad_post_run( & diff --git a/physics/module_MYNNrad_post.meta b/physics/module_MYNNrad_post.meta new file mode 100644 index 000000000..b09abe01e --- /dev/null +++ b/physics/module_MYNNrad_post.meta @@ -0,0 +1,80 @@ +[ccpp-arg-table] + name = mynnrad_post_run + type = scheme +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[qc] + standard_name = cloud_condensed_water_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[qi] + standard_name = ice_water_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of ice water + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[qc_save] + standard_name = cloud_condensed_water_mixing_ratio_save + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qi_save] + standard_name = ice_water_mixing_ratio_save + long_name = moist (dry+vapor, no condensates) mixing ratio of ice water before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/module_MYNNrad_pre.F90 b/physics/module_MYNNrad_pre.F90 index 7b8af5962..92ca980a5 100644 --- a/physics/module_MYNNrad_pre.F90 +++ b/physics/module_MYNNrad_pre.F90 @@ -18,27 +18,7 @@ end subroutine mynnrad_pre_finalize !! This interstitial code adds the subgrid clouds to the resolved-scale clouds if there is no resolved-scale clouds in that particular grid box. #if 0 !> \section arg_table_mynnrad_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |---------------------|-----------------------------------------------------------------------------|----------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | qc | cloud_condensed_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qi | ice_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of ice water | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | T3D | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | -!! | qc_save | cloud_condensed_water_mixing_ratio_save | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | out | F | -!! | qi_save | ice_water_mixing_ratio_save | moist (dry+vapor, no condensates) mixing ratio of ice water before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | out | F | -!! | QC_BL | subgrid_cloud_mixing_ratio_pbl | subgrid cloud cloud mixing ratio from PBL scheme | kg kg-1 | 2 | real | kind_phys | in | F | -!! | CLDFRA_BL | subgrid_cloud_fraction_pbl | subgrid cloud fraction from PBL scheme | frac | 2 | real | kind_phys | in | F | -!! | delp | layer_pressure_thickness_for_radiation | layer pressure thickness on radiation levels | hPa | 2 | real | kind_phys | out | F | -!! | clouds1 | total_cloud_fraction | layer total cloud fraction | frac | 2 | real | kind_phys | inout | F | -!! | clouds2 | cloud_liquid_water_path | layer cloud liquid water path | g m-2 | 2 | real | kind_phys | inout | F | -!! | clouds3 | mean_effective_radius_for_liquid_cloud | mean effective radius for liquid cloud | micron | 2 | real | kind_phys | inout | F | -!! | clouds4 | cloud_ice_water_path | layer cloud ice water path | g m-2 | 2 | real | kind_phys | inout | F | -!! | clouds5 | mean_effective_radius_for_ice_cloud | mean effective radius for ice cloud | micron | 2 | real | kind_phys | inout | F | -!! | slmsk | sea_land_ice_mask_real | landmask: sea/land/ice=0/1/2 | flag | 1 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude mynnrad_pre_run.html !! #endif SUBROUTINE mynnrad_pre_run( & diff --git a/physics/module_MYNNrad_pre.meta b/physics/module_MYNNrad_pre.meta new file mode 100644 index 000000000..617ee3f31 --- /dev/null +++ b/physics/module_MYNNrad_pre.meta @@ -0,0 +1,170 @@ +[ccpp-arg-table] + name = mynnrad_pre_run + type = scheme +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[qc] + standard_name = cloud_condensed_water_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qi] + standard_name = ice_water_mixing_ratio + long_name = moist (dry+vapor, no condensates) mixing ratio of ice water + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[T3D] + standard_name = air_temperature + long_name = layer mean air temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qc_save] + standard_name = cloud_condensed_water_mixing_ratio_save + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[qi_save] + standard_name = ice_water_mixing_ratio_save + long_name = moist (dry+vapor, no condensates) mixing ratio of ice water before entering a physics scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[QC_BL] + standard_name = subgrid_cloud_mixing_ratio_pbl + long_name = subgrid cloud cloud mixing ratio from PBL scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[CLDFRA_BL] + standard_name = subgrid_cloud_fraction_pbl + long_name = subgrid cloud fraction from PBL scheme + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[delp] + standard_name = layer_pressure_thickness_for_radiation + long_name = layer pressure thickness on radiation levels + units = hPa + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = out + optional = F +[clouds1] + standard_name = total_cloud_fraction + long_name = layer total cloud fraction + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[clouds2] + standard_name = cloud_liquid_water_path + long_name = layer cloud liquid water path + units = g m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[clouds3] + standard_name = mean_effective_radius_for_liquid_cloud + long_name = mean effective radius for liquid cloud + units = micron + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[clouds4] + standard_name = cloud_ice_water_path + long_name = layer cloud ice water path + units = g m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[clouds5] + standard_name = mean_effective_radius_for_ice_cloud + long_name = mean effective radius for ice cloud + units = micron + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[slmsk] + standard_name = sea_land_ice_mask_real + long_name = landmask: sea/land/ice=0/1/2 + units = flag + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/moninedmf.f b/physics/moninedmf.f index e2c7354fd..1084aa426 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -9,11 +9,7 @@ module hedmf contains !> \section arg_table_hedmf_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | moninq_fac | atmosphere_diffusivity_coefficient_factor | multiplicative constant for atmospheric diffusivities | none | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude hedmf_init.html !! subroutine hedmf_init (moninq_fac,errmsg,errflg) use machine, only : kind_phys @@ -43,63 +39,7 @@ end subroutine hedmf_finalize !! the updraft properties and mass flux. !! !> \section arg_table_hedmf_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | ntrac | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | cloud condensate index in tracer array | index | 0 | integer | | in | F | -!! | dv | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | du | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | tau | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | -!! | rtg | tendency_of_vertically_diffused_tracer_concentration | updated tendency of the tracers due to vertical diffusion in PBL scheme | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | -!! | u1 | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | v1 | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | t1 | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | -!! | q1 | vertically_diffused_tracer_concentration | tracer concentration diffused by PBL scheme | kg kg-1 | 3 | real | kind_phys | in | F | -!! | swh | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step | total sky shortwave heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | hlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step | total sky longwave heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave | none | 1 | real | kind_phys | in | F | -!! | psk | dimensionless_exner_function_at_lowest_model_interface | dimensionless Exner function at the surface interface | none | 1 | real | kind_phys | in | F | -!! | rbsoil | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | -!! | u10m | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | fm | Monin_Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | -!! | fh | Monin_Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | -!! | tsea | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | -!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | -!! | spd1 | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | -!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | prslk | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | -!! | dspheat | flag_TKE_dissipation_heating | flag for using TKE dissipation heating | flag | 0 | logical | | in | F | -!! | dusfc | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dvsfc | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | -!! | hgamt | countergradient_mixing_term_for_temperature | countergradient mixing term for temperature | K | 1 | real | kind_phys | inout | F | -!! | hgamq | countergradient_mixing_term_for_water_vapor | countergradient mixing term for water vapor | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | dkt | atmosphere_heat_diffusivity | diffusivity for heat | m2 s-1 | 2 | real | kind_phys | out | F | -!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | in | F | -!! | xkzm_m | atmosphere_momentum_diffusivity_background | background value of momentum diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | -!! | xkzm_h | atmosphere_heat_diffusivity_background | background value of heat diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | -!! | xkzm_s | diffusivity_background_sigma_level | sigma level threshold for background diffusivity | none | 0 | real | kind_phys | in | F | -!! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | -!! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | -!! | xkzminv | atmosphere_heat_diffusivity_background_maximum | maximum background value of heat diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | -!! | moninq_fac | atmosphere_diffusivity_coefficient_factor | multiplicative constant for atmospheric diffusivities | none | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude hedmf_run.html !! !! \section general_edmf GFS Hybrid EDMF General Algorithm !! -# Compute preliminary variables from input arguments. diff --git a/physics/moninedmf.meta b/physics/moninedmf.meta new file mode 100644 index 000000000..47875640f --- /dev/null +++ b/physics/moninedmf.meta @@ -0,0 +1,518 @@ +[ccpp-arg-table] + name = hedmf_init + type = scheme +[moninq_fac] + standard_name = atmosphere_diffusivity_coefficient_factor + long_name = multiplicative constant for atmospheric diffusivities + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = hedmf_run + type = scheme +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntrac] + standard_name = number_of_vertical_diffusion_tracers + long_name = number of tracers to diffuse vertically + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntcw] + standard_name = index_for_liquid_cloud_condensate + long_name = cloud condensate index in tracer array + units = index + dimensions = () + type = integer + intent = in + optional = F +[dv] + standard_name = tendency_of_y_wind_due_to_model_physics + long_name = updated tendency of the y wind + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[du] + standard_name = tendency_of_x_wind_due_to_model_physics + long_name = updated tendency of the x wind + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tau] + standard_name = tendency_of_air_temperature_due_to_model_physics + long_name = updated tendency of the temperature + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rtg] + standard_name = tendency_of_vertically_diffused_tracer_concentration + long_name = updated tendency of the tracers due to vertical diffusion in PBL scheme + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_vertical_diffusion_tracers) + type = real + kind = kind_phys + intent = inout + optional = F +[u1] + standard_name = x_wind + long_name = x component of layer wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v1] + standard_name = y_wind + long_name = y component of layer wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t1] + standard_name = air_temperature + long_name = layer mean air temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q1] + standard_name = vertically_diffused_tracer_concentration + long_name = tracer concentration diffused by PBL scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_vertical_diffusion_tracers) + type = real + kind = kind_phys + intent = in + optional = F +[swh] + standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step + long_name = total sky shortwave heating rate + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[hlw] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step + long_name = total sky longwave heating rate + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[xmu] + standard_name = zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes + long_name = zenith angle temporal adjustment factor for shortwave + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[psk] + standard_name = dimensionless_exner_function_at_lowest_model_interface + long_name = dimensionless Exner function at the surface interface + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rbsoil] + standard_name = bulk_richardson_number_at_lowest_model_level + long_name = bulk Richardson number at the surface + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zorl] + standard_name = surface_roughness_length + long_name = surface roughness length in cm + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[u10m] + standard_name = x_wind_at_10m + long_name = x component of wind at 10 m + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v10m] + standard_name = y_wind_at_10m + long_name = y component of wind at 10 m + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fm] + standard_name = Monin_Obukhov_similarity_function_for_momentum + long_name = Monin-Obukhov similarity function for momentum + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fh] + standard_name = Monin_Obukhov_similarity_function_for_heat + long_name = Monin-Obukhov similarity function for heat + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsea] + standard_name = surface_skin_temperature + long_name = surface skin temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[heat] + standard_name = kinematic_surface_upward_sensible_heat_flux + long_name = kinematic surface upward sensible heat flux + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux + long_name = kinematic surface upward latent heat flux + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[stress] + standard_name = surface_wind_stress + long_name = surface wind stress + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[spd1] + standard_name = wind_speed_at_lowest_model_layer + long_name = wind speed at lowest model level + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[kpbl] + standard_name = vertical_index_at_top_of_atmosphere_boundary_layer + long_name = PBL top model level index + units = index + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[prsi] + standard_name = air_pressure_at_interface + long_name = air pressure at model layer interfaces + units = Pa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[del] + standard_name = air_pressure_difference_between_midlayers + long_name = pres(k) - pres(k+1) + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslk] + standard_name = dimensionless_exner_function_at_model_layers + long_name = Exner function at layers + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[phii] + standard_name = geopotential_at_interface + long_name = geopotential at model layer interfaces + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[phil] + standard_name = geopotential + long_name = geopotential at model layer centers + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[delt] + standard_name = time_step_for_physics + long_name = time step for physics + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dspheat] + standard_name = flag_TKE_dissipation_heating + long_name = flag for using TKE dissipation heating + units = flag + dimensions = () + type = logical + intent = in + optional = F +[dusfc] + standard_name = instantaneous_surface_x_momentum_flux + long_name = x momentum flux + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dvsfc] + standard_name = instantaneous_surface_y_momentum_flux + long_name = y momentum flux + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dtsfc] + standard_name = instantaneous_surface_upward_sensible_heat_flux + long_name = surface upward sensible heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dqsfc] + standard_name = instantaneous_surface_upward_latent_heat_flux + long_name = surface upward latent heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[hpbl] + standard_name = atmosphere_boundary_layer_thickness + long_name = PBL thickness + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[hgamt] + standard_name = countergradient_mixing_term_for_temperature + long_name = countergradient mixing term for temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[hgamq] + standard_name = countergradient_mixing_term_for_water_vapor + long_name = countergradient mixing term for water vapor + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dkt] + standard_name = atmosphere_heat_diffusivity + long_name = diffusivity for heat + units = m2 s-1 + dimensions = (horizontal_dimension,vertical_dimension_minus_one) + type = real + kind = kind_phys + intent = out + optional = F +[kinver] + standard_name = index_of_highest_temperature_inversion + long_name = index of highest temperature inversion + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[xkzm_m] + standard_name = atmosphere_momentum_diffusivity_background + long_name = background value of momentum diffusivity + units = m2 s-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[xkzm_h] + standard_name = atmosphere_heat_diffusivity_background + long_name = background value of heat diffusivity + units = m2 s-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[xkzm_s] + standard_name = diffusivity_background_sigma_level + long_name = sigma level threshold for background diffusivity + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[lprnt] + standard_name = flag_print + long_name = flag for printing diagnostics to output + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ipr] + standard_name = horizontal_index_of_printed_column + long_name = horizontal index of printed column + units = index + dimensions = () + type = integer + intent = in + optional = F +[xkzminv] + standard_name = atmosphere_heat_diffusivity_background_maximum + long_name = maximum background value of heat diffusivity + units = m2 s-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[moninq_fac] + standard_name = atmosphere_diffusivity_coefficient_factor + long_name = multiplicative constant for atmospheric diffusivities + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/moninshoc.f b/physics/moninshoc.f index f15011caa..df123958a 100644 --- a/physics/moninshoc.f +++ b/physics/moninshoc.f @@ -22,66 +22,7 @@ end subroutine moninshoc_finalize ! for tke as in Deardorff (1980) - added tridi1 ! !> \section arg_table_moninshoc_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | ntrac | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | cloud condensate index in tracer array | index | 0 | integer | | in | F | -!! | ncnd | number_of_tracers_for_cloud_condensate | number of tracers for cloud condensate | count | 0 | integer | | in | F | -!! | dv | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | du | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | tau | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | -!! | rtg | tendency_of_vertically_diffused_tracer_concentration | updated tendency of the tracers due to vertical diffusion in PBL scheme | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | -!! | u1 | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | v1 | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | t1 | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | -!! | q1 | vertically_diffused_tracer_concentration | tracer concentration diffused by PBL scheme | kg kg-1 | 3 | real | kind_phys | in | F | -!! | tkh | atmosphere_heat_diffusivity_from_shoc | diffusivity for heat from the SHOC scheme | m2 s-1 | 2 | real | kind_phys | in | F | -!! | prnum | prandtl_number | turbulent Prandtl number | none | 2 | real | kind_phys | inout | F | -!! | ntke | index_for_turbulent_kinetic_energy_vertical_diffusion_tracer | index for turbulent kinetic energy in the vertically diffused tracer array | index | 0 | integer | | in | F | -!! | psk | dimensionless_exner_function_at_lowest_model_interface | dimensionless Exner function at the surface interface | none | 1 | real | kind_phys | in | F | -!! | rbsoil | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | -!! | u10m | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | fm | Monin_Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | -!! | fh | Monin_Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | -!! | tsea | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | -!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | -!! | spd1 | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | -!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | prslk | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | -!! | dusfc | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dvsfc | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dkt | atmosphere_heat_diffusivity | diffusivity for heat | m2 s-1 | 2 | real | kind_phys | out | F | -!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | -!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | in | F | -!! | xkzm_m | atmosphere_momentum_diffusivity_background | background value of momentum diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | -!! | xkzm_h | atmosphere_heat_diffusivity_background | background value of heat diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | -!! | xkzm_s | diffusivity_background_sigma_level | sigma level threshold for background diffusivity | none | 0 | real | kind_phys | in | F | -!! | xkzminv | atmosphere_heat_diffusivity_background_maximum | max. background val. diffusivity in inversion layers | m2 s-1 | 0 | real | kind_phys | in | F | -!! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | -!! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | -!! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | grav | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | fv | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude moninshoc_run.html !! subroutine moninshoc_run (ix,im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, & u1,v1,t1,q1,tkh,prnum,ntke, diff --git a/physics/moninshoc.meta b/physics/moninshoc.meta new file mode 100644 index 000000000..f506b6ab0 --- /dev/null +++ b/physics/moninshoc.meta @@ -0,0 +1,512 @@ +[ccpp-arg-table] + name = moninshoc_run + type = scheme +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntrac] + standard_name = number_of_vertical_diffusion_tracers + long_name = number of tracers to diffuse vertically + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntcw] + standard_name = index_for_liquid_cloud_condensate + long_name = cloud condensate index in tracer array + units = index + dimensions = () + type = integer + intent = in + optional = F +[ncnd] + standard_name = number_of_tracers_for_cloud_condensate + long_name = number of tracers for cloud condensate + units = count + dimensions = () + type = integer + intent = in + optional = F +[dv] + standard_name = tendency_of_y_wind_due_to_model_physics + long_name = updated tendency of the y wind + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[du] + standard_name = tendency_of_x_wind_due_to_model_physics + long_name = updated tendency of the x wind + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tau] + standard_name = tendency_of_air_temperature_due_to_model_physics + long_name = updated tendency of the temperature + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rtg] + standard_name = tendency_of_vertically_diffused_tracer_concentration + long_name = updated tendency of the tracers due to vertical diffusion in PBL scheme + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_vertical_diffusion_tracers) + type = real + kind = kind_phys + intent = inout + optional = F +[u1] + standard_name = x_wind + long_name = x component of layer wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v1] + standard_name = y_wind + long_name = y component of layer wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t1] + standard_name = air_temperature + long_name = layer mean air temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q1] + standard_name = vertically_diffused_tracer_concentration + long_name = tracer concentration diffused by PBL scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_vertical_diffusion_tracers) + type = real + kind = kind_phys + intent = in + optional = F +[tkh] + standard_name = atmosphere_heat_diffusivity_from_shoc + long_name = diffusivity for heat from the SHOC scheme + units = m2 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prnum] + standard_name = prandtl_number + long_name = turbulent Prandtl number + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ntke] + standard_name = index_for_turbulent_kinetic_energy_vertical_diffusion_tracer + long_name = index for turbulent kinetic energy in the vertically diffused tracer array + units = index + dimensions = () + type = integer + intent = in + optional = F +[psk] + standard_name = dimensionless_exner_function_at_lowest_model_interface + long_name = dimensionless Exner function at the surface interface + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rbsoil] + standard_name = bulk_richardson_number_at_lowest_model_level + long_name = bulk Richardson number at the surface + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zorl] + standard_name = surface_roughness_length + long_name = surface roughness length in cm + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[u10m] + standard_name = x_wind_at_10m + long_name = x component of wind at 10 m + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v10m] + standard_name = y_wind_at_10m + long_name = y component of wind at 10 m + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fm] + standard_name = Monin_Obukhov_similarity_function_for_momentum + long_name = Monin-Obukhov similarity function for momentum + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fh] + standard_name = Monin_Obukhov_similarity_function_for_heat + long_name = Monin-Obukhov similarity function for heat + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsea] + standard_name = surface_skin_temperature + long_name = surface skin temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[heat] + standard_name = kinematic_surface_upward_sensible_heat_flux + long_name = kinematic surface upward sensible heat flux + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux + long_name = kinematic surface upward latent heat flux + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[stress] + standard_name = surface_wind_stress + long_name = surface wind stress + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[spd1] + standard_name = wind_speed_at_lowest_model_layer + long_name = wind speed at lowest model level + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[kpbl] + standard_name = vertical_index_at_top_of_atmosphere_boundary_layer + long_name = PBL top model level index + units = index + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[prsi] + standard_name = air_pressure_at_interface + long_name = air pressure at model layer interfaces + units = Pa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[del] + standard_name = air_pressure_difference_between_midlayers + long_name = pres(k) - pres(k+1) + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslk] + standard_name = dimensionless_exner_function_at_model_layers + long_name = Exner function at layers + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[phii] + standard_name = geopotential_at_interface + long_name = geopotential at model layer interfaces + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[phil] + standard_name = geopotential + long_name = geopotential at model layer centers + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[delt] + standard_name = time_step_for_physics + long_name = time step for physics + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dusfc] + standard_name = instantaneous_surface_x_momentum_flux + long_name = x momentum flux + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dvsfc] + standard_name = instantaneous_surface_y_momentum_flux + long_name = y momentum flux + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dtsfc] + standard_name = instantaneous_surface_upward_sensible_heat_flux + long_name = surface upward sensible heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dqsfc] + standard_name = instantaneous_surface_upward_latent_heat_flux + long_name = surface upward latent heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dkt] + standard_name = atmosphere_heat_diffusivity + long_name = diffusivity for heat + units = m2 s-1 + dimensions = (horizontal_dimension,vertical_dimension_minus_one) + type = real + kind = kind_phys + intent = out + optional = F +[hpbl] + standard_name = atmosphere_boundary_layer_thickness + long_name = PBL thickness + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[kinver] + standard_name = index_of_highest_temperature_inversion + long_name = index of highest temperature inversion + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[xkzm_m] + standard_name = atmosphere_momentum_diffusivity_background + long_name = background value of momentum diffusivity + units = m2 s-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[xkzm_h] + standard_name = atmosphere_heat_diffusivity_background + long_name = background value of heat diffusivity + units = m2 s-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[xkzm_s] + standard_name = diffusivity_background_sigma_level + long_name = sigma level threshold for background diffusivity + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[xkzminv] + standard_name = atmosphere_heat_diffusivity_background_maximum + long_name = max. background val. diffusivity in inversion layers + units = m2 s-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[lprnt] + standard_name = flag_print + long_name = flag for printing diagnostics to output + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ipr] + standard_name = horizontal_index_of_printed_column + long_name = horizontal index of printed column + units = index + dimensions = () + type = integer + intent = in + optional = F +[me] + standard_name = mpi_rank + long_name = current MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[grav] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[fv] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index 4065df992..3b2da9c3e 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -23,23 +23,7 @@ module mp_thompson !> This subroutine is a wrapper around the actual mp_gt_driver(). #if 0 !! \section arg_table_mp_thompson_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------------|-------------------------------------------------------|----------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | ncol | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | nlev | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | is_aerosol_aware | flag_for_aerosol_physics | flag for aerosol-aware physics | flag | 0 | logical | | in | F | -!! | nwfa2d | tendency_of_water_friendly_aerosols_at_surface | instantaneous fake water-friendly surface aerosol source | kg-1 s-1 | 1 | real | kind_phys | inout | T | -!! | nifa2d | tendency_of_ice_friendly_aerosols_at_surface | instantaneous fake ice-friendly surface aerosol source | kg-1 s-1 | 1 | real | kind_phys | inout | T | -!! | nwfa | water_friendly_aerosol_number_concentration | number concentration of water-friendly aerosols | kg-1 | 2 | real | kind_phys | inout | T | -!! | nifa | ice_friendly_aerosol_number_concentration | number concentration of ice-friendly aerosols | kg-1 | 2 | real | kind_phys | inout | T | -!! | mpicomm | mpi_comm | MPI communicator | index | 0 | integer | | in | F | -!! | mpirank | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | mpiroot | mpi_root | master MPI-rank | index | 0 | integer | | in | F | -!! | threads | omp_threads | number of OpenMP threads available to scheme | count | 0 | integer | | in | F | -!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude mp_thompson_init.html !! #endif subroutine mp_thompson_init(ncol, nlev, is_aerosol_aware, & @@ -148,47 +132,7 @@ end subroutine mp_thompson_init #if 0 !> \section arg_table_mp_thompson_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------|-----------------------------------------------------------------------|-----------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | ncol | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | nlev | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | con_rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | spechum | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qc | cloud_condensed_water_mixing_ratio_updated_by_physics | cloud water mixing ratio wrt dry+vapor (no condensates) | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qr | rain_water_mixing_ratio_updated_by_physics | rain water mixing ratio wrt dry+vapor (no condensates) | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qi | ice_water_mixing_ratio_updated_by_physics | ice water mixing ratio wrt dry+vapor (no condensates) | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qs | snow_water_mixing_ratio_updated_by_physics | snow water mixing ratio wrt dry+vapor (no condensates) | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qg | graupel_mixing_ratio_updated_by_physics | graupel mixing ratio wrt dry+vapor (no condensates) | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ni | ice_number_concentration_updated_by_physics | ice number concentration | kg-1 | 2 | real | kind_phys | inout | F | -!! | nr | rain_number_concentration_updated_by_physics | rain number concentration | kg-1 | 2 | real | kind_phys | inout | F | -!! | is_aerosol_aware| flag_for_aerosol_physics | flag for aerosol-aware physics | flag | 0 | logical | | in | F | -!! | nc | cloud_droplet_number_concentration_updated_by_physics | cloud droplet number concentration | kg-1 | 2 | real | kind_phys | inout | T | -!! | nwfa | water_friendly_aerosol_number_concentration_updated_by_physics | number concentration of water-friendly aerosols | kg-1 | 2 | real | kind_phys | inout | T | -!! | nifa | ice_friendly_aerosol_number_concentration_updated_by_physics | number concentration of ice-friendly aerosols | kg-1 | 2 | real | kind_phys | inout | T | -!! | nwfa2d | tendency_of_water_friendly_aerosols_at_surface | instantaneous fake water-friendly surface aerosol source | kg-1 s-1 | 1 | real | kind_phys | in | T | -!! | nifa2d | tendency_of_ice_friendly_aerosols_at_surface | instantaneous fake ice-friendly surface aerosol source | kg-1 s-1 | 1 | real | kind_phys | in | T | -!! | tgrs | air_temperature_updated_by_physics | model layer mean temperature | K | 2 | real | kind_phys | inout | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | omega | omega | layer mean vertical velocity | Pa s-1 | 2 | real | kind_phys | in | F | -!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | -!! | prcp | lwe_thickness_of_explicit_precipitation_amount | explicit precipitation (rain, ice, snow, graupel) on physics timestep | m | 1 | real | kind_phys | inout | F | -!! | rain | lwe_thickness_of_explicit_rain_amount | explicit rain fall on physics timestep | m | 1 | real | kind_phys | inout | F | -!! | graupel | lwe_thickness_of_graupel_amount | graupel fall on physics timestep | m | 1 | real | kind_phys | inout | F | -!! | ice | lwe_thickness_of_ice_amount | ice fall on physics timestep | m | 1 | real | kind_phys | inout | F | -!! | snow | lwe_thickness_of_snow_amount | snow fall on physics timestep | m | 1 | real | kind_phys | inout | F | -!! | sr | ratio_of_snowfall_to_rainfall | ratio of snowfall to large-scale rainfall | frac | 1 | real | kind_phys | out | F | -!! | refl_10cm | radar_reflectivity_10cm | instantaneous refl_10cm | dBZ | 2 | real | kind_phys | out | F | -!! | do_radar_ref | flag_for_radar_reflectivity | flag for radar reflectivity | flag | 0 | logical | | in | F | -!! | re_cloud | effective_radius_of_stratiform_cloud_liquid_water_particle_in_um | eff. radius of cloud liquid water particle in micrometer (meter here) | m | 2 | real | kind_phys | out | F | -!! | re_ice | effective_radius_of_stratiform_cloud_ice_particle_in_um | eff. radius of cloud ice water particle in micrometer (meter here) | m | 2 | real | kind_phys | out | F | -!! | re_snow | effective_radius_of_stratiform_cloud_snow_particle_in_um | effective radius of cloud snow particle in micrometer (meter here) | m | 2 | real | kind_phys | out | F | -!! | mpicomm | mpi_comm | MPI communicator | index | 0 | integer | | in | F | -!! | mpirank | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | mpiroot | mpi_root | master MPI-rank | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude mp_thompson_run.html !! #endif !>\ingroup aathompson @@ -458,10 +402,7 @@ end subroutine mp_thompson_run #if 0 !! \section arg_table_mp_thompson_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------|---------------------------------------------------------------|--------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude mp_thompson_finalize.html !! #endif subroutine mp_thompson_finalize(errmsg, errflg) diff --git a/physics/mp_thompson.meta b/physics/mp_thompson.meta new file mode 100644 index 000000000..619053882 --- /dev/null +++ b/physics/mp_thompson.meta @@ -0,0 +1,498 @@ +[ccpp-arg-table] + name = mp_thompson_init + type = scheme +[ncol] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[nlev] + standard_name = vertical_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[is_aerosol_aware] + standard_name = flag_for_aerosol_physics + long_name = flag for aerosol-aware physics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[nwfa2d] + standard_name = tendency_of_water_friendly_aerosols_at_surface + long_name = instantaneous fake water-friendly surface aerosol source + units = kg-1 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[nifa2d] + standard_name = tendency_of_ice_friendly_aerosols_at_surface + long_name = instantaneous fake ice-friendly surface aerosol source + units = kg-1 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[nwfa] + standard_name = water_friendly_aerosol_number_concentration + long_name = number concentration of water-friendly aerosols + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[nifa] + standard_name = ice_friendly_aerosol_number_concentration + long_name = number concentration of ice-friendly aerosols + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[mpicomm] + standard_name = mpi_comm + long_name = MPI communicator + units = index + dimensions = () + type = integer + intent = in + optional = F +[mpirank] + standard_name = mpi_rank + long_name = current MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[mpiroot] + standard_name = mpi_root + long_name = master MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[threads] + standard_name = omp_threads + long_name = number of OpenMP threads available to scheme + units = count + dimensions = () + type = integer + intent = in + optional = F +[imp_physics] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_thompson] + standard_name = flag_for_thompson_microphysics_scheme + long_name = choice of Thompson microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = mp_thompson_run + type = scheme +[ncol] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[nlev] + standard_name = vertical_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[spechum] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qc] + standard_name = cloud_condensed_water_mixing_ratio_updated_by_physics + long_name = cloud water mixing ratio wrt dry+vapor (no condensates) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qr] + standard_name = rain_water_mixing_ratio_updated_by_physics + long_name = rain water mixing ratio wrt dry+vapor (no condensates) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qi] + standard_name = ice_water_mixing_ratio_updated_by_physics + long_name = ice water mixing ratio wrt dry+vapor (no condensates) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qs] + standard_name = snow_water_mixing_ratio_updated_by_physics + long_name = snow water mixing ratio wrt dry+vapor (no condensates) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qg] + standard_name = graupel_mixing_ratio_updated_by_physics + long_name = graupel mixing ratio wrt dry+vapor (no condensates) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ni] + standard_name = ice_number_concentration_updated_by_physics + long_name = ice number concentration + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[nr] + standard_name = rain_number_concentration_updated_by_physics + long_name = rain number concentration + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[is_aerosol_aware] + standard_name = flag_for_aerosol_physics + long_name = flag for aerosol-aware physics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[nc] + standard_name = cloud_droplet_number_concentration_updated_by_physics + long_name = cloud droplet number concentration + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[nwfa] + standard_name = water_friendly_aerosol_number_concentration_updated_by_physics + long_name = number concentration of water-friendly aerosols + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[nifa] + standard_name = ice_friendly_aerosol_number_concentration_updated_by_physics + long_name = number concentration of ice-friendly aerosols + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[nwfa2d] + standard_name = tendency_of_water_friendly_aerosols_at_surface + long_name = instantaneous fake water-friendly surface aerosol source + units = kg-1 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[nifa2d] + standard_name = tendency_of_ice_friendly_aerosols_at_surface + long_name = instantaneous fake ice-friendly surface aerosol source + units = kg-1 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[tgrs] + standard_name = air_temperature_updated_by_physics + long_name = model layer mean temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[prsl] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[phii] + standard_name = geopotential_at_interface + long_name = geopotential at model layer interfaces + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[omega] + standard_name = omega + long_name = layer mean vertical velocity + units = Pa s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dtp] + standard_name = time_step_for_physics + long_name = physics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[prcp] + standard_name = lwe_thickness_of_explicit_precipitation_amount + long_name = explicit precipitation (rain, ice, snow, graupel) on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rain] + standard_name = lwe_thickness_of_explicit_rain_amount + long_name = explicit rain fall on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[graupel] + standard_name = lwe_thickness_of_graupel_amount + long_name = graupel fall on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ice] + standard_name = lwe_thickness_of_ice_amount + long_name = ice fall on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snow] + standard_name = lwe_thickness_of_snow_amount + long_name = snow fall on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[sr] + standard_name = ratio_of_snowfall_to_rainfall + long_name = ratio of snowfall to large-scale rainfall + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[refl_10cm] + standard_name = radar_reflectivity_10cm + long_name = instantaneous refl_10cm + units = dBZ + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[do_radar_ref] + standard_name = flag_for_radar_reflectivity + long_name = flag for radar reflectivity + units = flag + dimensions = () + type = logical + intent = in + optional = F +[re_cloud] + standard_name = effective_radius_of_stratiform_cloud_liquid_water_particle_in_um + long_name = eff. radius of cloud liquid water particle in micrometer (meter here) + units = m + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[re_ice] + standard_name = effective_radius_of_stratiform_cloud_ice_particle_in_um + long_name = eff. radius of cloud ice water particle in micrometer (meter here) + units = m + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[re_snow] + standard_name = effective_radius_of_stratiform_cloud_snow_particle_in_um + long_name = effective radius of cloud snow particle in micrometer (meter here) + units = m + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[mpicomm] + standard_name = mpi_comm + long_name = MPI communicator + units = index + dimensions = () + type = integer + intent = in + optional = F +[mpirank] + standard_name = mpi_rank + long_name = current MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[mpiroot] + standard_name = mpi_root + long_name = master MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = mp_thompson_finalize + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/mp_thompson_post.F90 b/physics/mp_thompson_post.F90 index 1b683f602..a21f668ec 100644 --- a/physics/mp_thompson_post.F90 +++ b/physics/mp_thompson_post.F90 @@ -18,12 +18,7 @@ module mp_thompson_post #if 0 !! \section arg_table_mp_thompson_post_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------|-------------------------------------------------------|----------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | ncol | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ttendlim | limit_for_temperature_tendency_for_microphysics | temperature tendency limiter per physics time step | K s-1 | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude mp_thompson_post_init.html !! #endif subroutine mp_thompson_post_init(ncol, ttendlim, errmsg, errflg) @@ -68,19 +63,7 @@ end subroutine mp_thompson_post_init #if 0 !! \section arg_table_mp_thompson_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------|-------------------------------------------------------|----------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | ncol | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | nlev | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | tgrs_save | air_temperature_save | air temperature before entering a physics scheme | K | 2 | real | kind_phys | in | F | -!! | tgrs | air_temperature_updated_by_physics | model layer mean temperature | K | 2 | real | kind_phys | inout | F | -!! | prslk | dimensionless_exner_function_at_model_layers | dimensionless Exner function at model layer centers | none | 2 | real | kind_phys | in | F | -!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | -!! | mpicomm | mpi_comm | MPI communicator | index | 0 | integer | | in | F | -!! | mpirank | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | mpiroot | mpi_root | master MPI-rank | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude mp_thompson_post_run.html !! #endif subroutine mp_thompson_post_run(ncol, nlev, tgrs_save, tgrs, prslk, dtp, & @@ -149,10 +132,7 @@ end subroutine mp_thompson_post_run #if 0 !! \section arg_table_mp_thompson_post_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------|-------------------------------------------------------|----------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude mp_thompson_post_finalize.html !! #endif subroutine mp_thompson_post_finalize(errmsg, errflg) diff --git a/physics/mp_thompson_post.meta b/physics/mp_thompson_post.meta new file mode 100644 index 000000000..f1df2dd35 --- /dev/null +++ b/physics/mp_thompson_post.meta @@ -0,0 +1,157 @@ +[ccpp-arg-table] + name = mp_thompson_post_init + type = scheme +[ncol] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[ttendlim] + standard_name = limit_for_temperature_tendency_for_microphysics + long_name = temperature tendency limiter per physics time step + units = K s-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = mp_thompson_post_run + type = scheme +[ncol] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[nlev] + standard_name = vertical_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[tgrs_save] + standard_name = air_temperature_save + long_name = air temperature before entering a physics scheme + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tgrs] + standard_name = air_temperature_updated_by_physics + long_name = model layer mean temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[prslk] + standard_name = dimensionless_exner_function_at_model_layers + long_name = dimensionless Exner function at model layer centers + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dtp] + standard_name = time_step_for_physics + long_name = physics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[mpicomm] + standard_name = mpi_comm + long_name = MPI communicator + units = index + dimensions = () + type = integer + intent = in + optional = F +[mpirank] + standard_name = mpi_rank + long_name = current MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[mpiroot] + standard_name = mpi_root + long_name = master MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = mp_thompson_post_finalize + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/mp_thompson_pre.F90 b/physics/mp_thompson_pre.F90 index 51f621fc9..3cb60008d 100644 --- a/physics/mp_thompson_pre.F90 +++ b/physics/mp_thompson_pre.F90 @@ -24,38 +24,7 @@ end subroutine mp_thompson_pre_init #if 0 !! \section arg_table_mp_thompson_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------|-----------------------------------------------------------------------|----------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | ncol | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | nlev | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | kdt | index_of_time_step | current forecast iteration | index | 0 | integer | | in | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | con_rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | spechum | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qc | cloud_condensed_water_mixing_ratio_updated_by_physics | cloud water mixing ratio wrt dry+vapor (no condensates) | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qr | rain_water_mixing_ratio_updated_by_physics | rain water mixing ratio wrt dry+vapor (no condensates) | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qi | ice_water_mixing_ratio_updated_by_physics | ice water mixing ratio wrt dry+vapor (no condensates) | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qs | snow_water_mixing_ratio_updated_by_physics | snow water mixing ratio wrt dry+vapor (no condensates) | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qg | graupel_mixing_ratio_updated_by_physics | graupel mixing ratio wrt dry+vapor (no condensates) | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | ni | ice_number_concentration_updated_by_physics | ice number concentration | kg-1 | 2 | real | kind_phys | inout | F | -!! | nr | rain_number_concentration_updated_by_physics | rain number concentration | kg-1 | 2 | real | kind_phys | inout | F | -!! | make_number_concentrations | flag_for_initial_number_concentration_calculation | flag for initial number concentration calculation | flag | 0 | logical | | in | F | -!! | is_aerosol_aware| flag_for_aerosol_physics | flag for aerosol-aware physics | flag | 0 | logical | | in | F | -!! | nc | cloud_droplet_number_concentration_updated_by_physics | cloud droplet number concentration | kg-1 | 2 | real | kind_phys | inout | T | -!! | nwfa | water_friendly_aerosol_number_concentration_updated_by_physics | number concentration of water-friendly aerosols | kg-1 | 2 | real | kind_phys | inout | T | -!! | nifa | ice_friendly_aerosol_number_concentration_updated_by_physics | number concentration of ice-friendly aerosols | kg-1 | 2 | real | kind_phys | inout | T | -!! | nwfa2d | tendency_of_water_friendly_aerosols_at_surface | instantaneous fake water-friendly surface aerosol source | kg-1 s-1 | 1 | real | kind_phys | inout | T | -!! | nifa2d | tendency_of_ice_friendly_aerosols_at_surface | instantaneous fake ice-friendly surface aerosol source | kg-1 s-1 | 1 | real | kind_phys | inout | T | -!! | tgrs | air_temperature_updated_by_physics | model layer mean temperature | K | 2 | real | kind_phys | in | F | -!! | tgrs_save | air_temperature_save | air temperature before entering a physics scheme | K | 2 | real | kind_phys | out | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | area | cell_area | area of the grid cell | m2 | 1 | real | kind_phys | in | F | -!! | mpirank | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | mpiroot | mpi_root | master MPI-rank | index | 0 | integer | | in | F | -!! | blkno | ccpp_block_number | for explicit data blocking: block number of this block | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude mp_thompson_pre_run.html !! #endif subroutine mp_thompson_pre_run(ncol, nlev, kdt, con_g, con_rd, & diff --git a/physics/mp_thompson_pre.meta b/physics/mp_thompson_pre.meta new file mode 100644 index 000000000..ad79522bd --- /dev/null +++ b/physics/mp_thompson_pre.meta @@ -0,0 +1,264 @@ +[ccpp-arg-table] + name = mp_thompson_pre_run + type = scheme +[ncol] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[nlev] + standard_name = vertical_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[kdt] + standard_name = index_of_time_step + long_name = current forecast iteration + units = index + dimensions = () + type = integer + intent = in + optional = F +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[spechum] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qc] + standard_name = cloud_condensed_water_mixing_ratio_updated_by_physics + long_name = cloud water mixing ratio wrt dry+vapor (no condensates) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qr] + standard_name = rain_water_mixing_ratio_updated_by_physics + long_name = rain water mixing ratio wrt dry+vapor (no condensates) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qi] + standard_name = ice_water_mixing_ratio_updated_by_physics + long_name = ice water mixing ratio wrt dry+vapor (no condensates) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qs] + standard_name = snow_water_mixing_ratio_updated_by_physics + long_name = snow water mixing ratio wrt dry+vapor (no condensates) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qg] + standard_name = graupel_mixing_ratio_updated_by_physics + long_name = graupel mixing ratio wrt dry+vapor (no condensates) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ni] + standard_name = ice_number_concentration_updated_by_physics + long_name = ice number concentration + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[nr] + standard_name = rain_number_concentration_updated_by_physics + long_name = rain number concentration + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[make_number_concentrations] + standard_name = flag_for_initial_number_concentration_calculation + long_name = flag for initial number concentration calculation + units = flag + dimensions = () + type = logical + intent = in + optional = F +[is_aerosol_aware] + standard_name = flag_for_aerosol_physics + long_name = flag for aerosol-aware physics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[nc] + standard_name = cloud_droplet_number_concentration_updated_by_physics + long_name = cloud droplet number concentration + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[nwfa] + standard_name = water_friendly_aerosol_number_concentration_updated_by_physics + long_name = number concentration of water-friendly aerosols + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[nifa] + standard_name = ice_friendly_aerosol_number_concentration_updated_by_physics + long_name = number concentration of ice-friendly aerosols + units = kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[nwfa2d] + standard_name = tendency_of_water_friendly_aerosols_at_surface + long_name = instantaneous fake water-friendly surface aerosol source + units = kg-1 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[nifa2d] + standard_name = tendency_of_ice_friendly_aerosols_at_surface + long_name = instantaneous fake ice-friendly surface aerosol source + units = kg-1 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = T +[tgrs] + standard_name = air_temperature_updated_by_physics + long_name = model layer mean temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tgrs_save] + standard_name = air_temperature_save + long_name = air temperature before entering a physics scheme + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[prsl] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[phil] + standard_name = geopotential + long_name = geopotential at model layer centers + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[area] + standard_name = cell_area + long_name = area of the grid cell + units = m2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[mpirank] + standard_name = mpi_rank + long_name = current MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[mpiroot] + standard_name = mpi_root + long_name = master MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[blkno] + standard_name = ccpp_block_number + long_name = for explicit data blocking: block number of this block + units = index + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/precpd.f b/physics/precpd.f index b4bda60be..5e7018314 100644 --- a/physics/precpd.f +++ b/physics/precpd.f @@ -18,30 +18,7 @@ end subroutine zhaocarr_precpd_init !! precipitation (snow or rain) or evaporation of rain. !! !! \section arg_table_zhaocarr_precpd_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|---------------------------------------------------------------|-------------------------------------------------------------------|-------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | pressure level thickness | Pa | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | layer mean pressure | Pa | 2 | real | kind_phys | in | F | -!! | q | water_vapor_specific_humidity_updated_by_physics | water vapor specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | cwm | cloud_condensed_water_mixing_ratio_updated_by_physics | moist cloud condensed water mixing ratio | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | t | air_temperature_updated_by_physics | layer mean air temperature | K | 2 | real | kind_phys | inout | F | -!! | rn | lwe_thickness_of_explicit_precipitation_amount | explicit precipitation amount on physics timestep | m | 1 | real | kind_phys | out | F | -!! | sr | ratio_of_snowfall_to_rainfall | ratio of snowfall to large-scale rainfall | frac | 1 | real | kind_phys | out | F | -!! | rainp | tendency_of_rain_water_mixing_ratio_due_to_microphysics | tendency of rain water mixing ratio due to microphysics | kg kg-1 s-1 | 2 | real | kind_phys | out | F | -!! | u00k | critical_relative_humidity | critical relative humidity | frac | 2 | real | kind_phys | in | F | -!! | psautco | coefficient_from_cloud_ice_to_snow | conversion coefficient from cloud ice to snow | none | 1 | real | kind_phys | in | F | -!! | prautco | coefficient_from_cloud_water_to_rain | conversion coefficient from cloud water to rain | none | 1 | real | kind_phys | in | F | -!! | evpco | coefficient_for_evaporation_of_rainfall | coefficient for evaporation of rainfall | none | 0 | real | kind_phys | in | F | -!! | wminco | cloud_condensed_water_conversion_threshold | conversion coefficient from cloud liquid and ice to precipitation | none | 1 | real | kind_phys | in | F | -!! | wk1 | grid_size_related_coefficient_used_in_scale_sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | -!! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | -!! | jpr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude zhaocarr_precpd_run.html !! !> \section general_precpd GFS precpd Scheme General Algorithm !! The following two equations can be used to calculate the diff --git a/physics/precpd.meta b/physics/precpd.meta new file mode 100644 index 000000000..37a1850ab --- /dev/null +++ b/physics/precpd.meta @@ -0,0 +1,205 @@ +[ccpp-arg-table] + name = zhaocarr_precpd_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = zhaocarr_precpd_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[dt] + standard_name = time_step_for_physics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[del] + standard_name = air_pressure_difference_between_midlayers + long_name = pressure level thickness + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = layer mean pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = water vapor specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cwm] + standard_name = cloud_condensed_water_mixing_ratio_updated_by_physics + long_name = moist cloud condensed water mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[t] + standard_name = air_temperature_updated_by_physics + long_name = layer mean air temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rn] + standard_name = lwe_thickness_of_explicit_precipitation_amount + long_name = explicit precipitation amount on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[sr] + standard_name = ratio_of_snowfall_to_rainfall + long_name = ratio of snowfall to large-scale rainfall + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[rainp] + standard_name = tendency_of_rain_water_mixing_ratio_due_to_microphysics + long_name = tendency of rain water mixing ratio due to microphysics + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[u00k] + standard_name = critical_relative_humidity + long_name = critical relative humidity + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[psautco] + standard_name = coefficient_from_cloud_ice_to_snow + long_name = conversion coefficient from cloud ice to snow + units = none + dimensions = (2) + type = real + kind = kind_phys + intent = in + optional = F +[prautco] + standard_name = coefficient_from_cloud_water_to_rain + long_name = conversion coefficient from cloud water to rain + units = none + dimensions = (2) + type = real + kind = kind_phys + intent = in + optional = F +[evpco] + standard_name = coefficient_for_evaporation_of_rainfall + long_name = coefficient for evaporation of rainfall + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[wminco] + standard_name = cloud_condensed_water_conversion_threshold + long_name = conversion coefficient from cloud liquid and ice to precipitation + units = none + dimensions = (2) + type = real + kind = kind_phys + intent = in + optional = F +[wk1] + standard_name = grid_size_related_coefficient_used_in_scale_sensitive_schemes + long_name = grid size related coefficient used in scale-sensitive schemes + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[lprnt] + standard_name = flag_print + long_name = flag for printing diagnostics to output + units = flag + dimensions = () + type = logical + intent = in + optional = F +[jpr] + standard_name = horizontal_index_of_printed_column + long_name = horizontal index of printed column + units = index + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = zhaocarr_precpd_finalize + type = scheme diff --git a/physics/radlw_main.f b/physics/radlw_main.f index 5529860b5..7b029f8b0 100644 --- a/physics/radlw_main.f +++ b/physics/radlw_main.f @@ -380,55 +380,7 @@ end subroutine rrtmg_lw_init !! This model is provided as is without any express or implied warranties. !! (http://www.rtweb.aer.com/) !! \section arg_table_rrtmg_lw_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------|---------|------|-------------|-----------|--------|----------| -!! | plyr | air_pressure_at_layer_for_radiation_in_hPa | air pressure layer | hPa | 2 | real | kind_phys | in | F | -!! | plvl | air_pressure_at_interface_for_radiation_in_hPa | air pressure level | hPa | 2 | real | kind_phys | in | F | -!! | tlyr | air_temperature_at_layer_for_radiation | air temperature layer | K | 2 | real | kind_phys | in | F | -!! | tlvl | air_temperature_at_interface_for_radiation | air temperature level | K | 2 | real | kind_phys | in | F | -!! | qlyr | water_vapor_specific_humidity_at_layer_for_radiation | specific humidity layer | kg kg-1 | 2 | real | kind_phys | in | F | -!! | olyr | ozone_concentration_at_layer_for_radiation | ozone concentration layer | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_co2 | volume_mixing_ratio_co2 | volume mixing ratio co2 | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_n2o | volume_mixing_ratio_n2o | volume mixing ratio no2 | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_ch4 | volume_mixing_ratio_ch4 | volume mixing ratio ch4 | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_o2 | volume_mixing_ratio_o2 | volume mixing ratio o2 | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_co | volume_mixing_ratio_co | volume mixing ratio co | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_cfc11 | volume_mixing_ratio_cfc11 | volume mixing ratio cfc11 | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_cfc12 | volume_mixing_ratio_cfc12 | volume mixing ratio cfc12 | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_cfc22 | volume_mixing_ratio_cfc22 | volume mixing ratio cfc22 | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_ccl4 | volume_mixing_ratio_ccl4 | volume mixing ratio ccl4 | kg kg-1 | 2 | real | kind_phys | in | F | -!! | icseed | seed_random_numbers_lw | seed for random number generation for longwave radiation | none | 1 | integer | | in | F | -!! | aeraod | aerosol_optical_depth_for_longwave_bands_01_16 | aerosol optical depth for longwave bands 01-16 | none | 3 | real | kind_phys | in | F | -!! | aerssa | aerosol_single_scattering_albedo_for_longwave_bands_01_16 | aerosol single scattering albedo for longwave bands 01-16 | frac | 3 | real | kind_phys | in | F | -!! | sfemis | surface_longwave_emissivity | surface emissivity | frac | 1 | real | kind_phys | in | F | -!! | sfgtmp | surface_ground_temperature_for_radiation | surface ground temperature for radiation | K | 1 | real | kind_phys | in | F | -!! | dzlyr | layer_thickness_for_radiation | layer thickness | km | 2 | real | kind_phys | in | F | -!! | delpin | layer_pressure_thickness_for_radiation | layer pressure thickness | hPa | 2 | real | kind_phys | in | F | -!! | de_lgth | cloud_decorrelation_length | cloud decorrelation length | km | 1 | real | kind_phys | in | F | -!! | npts | horizontal_loop_extent | horizontal dimension | count | 0 | integer | | in | F | -!! | nlay | adjusted_vertical_layer_dimension_for_radiation | number of vertical layers for radiation | count | 0 | integer | | in | F | -!! | nlp1 | adjusted_vertical_level_dimension_for_radiation | number of vertical levels for radiation | count | 0 | integer | | in | F | -!! | lprnt | flag_print | flag to print | flag | 0 | logical | | in | F | -!! | cld_cf | total_cloud_fraction | total cloud fraction | frac | 2 | real | kind_phys | in | F | -!! | lslwr | flag_to_calc_lw | flag to calculate LW irradiances | flag | 0 | logical | | in | F | -!! | hlwc | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step | longwave total sky heating rate | K s-1 | 2 | real | kind_phys | inout | F | -!! | topflx | lw_fluxes_top_atmosphere | longwave total sky fluxes at the top of the atm | W m-2 | 1 | topflw_type | | inout | F | -!! | sfcflx | lw_fluxes_sfc | longwave total sky fluxes at the Earth surface | W m-2 | 1 | sfcflw_type | | inout | F | -!! | cldtau | cloud_optical_depth_layers_at_10mu_band | approx 10mu band layer cloud optical depth | none | 2 | real | kind_phys | inout | F | -!! | hlw0 | tendency_of_air_temperature_due_to_longwave_heating_assuming_clear_sky_on_radiation_time_step | longwave clear sky heating rate | K s-1 | 2 | real | kind_phys | inout | T | -!! | hlwb | lw_heating_rate_spectral | longwave total sky heating rate (spectral) | K s-1 | 3 | real | kind_phys | inout | T | -!! | flxprf | lw_fluxes | lw fluxes total sky / csk and up / down at levels | W m-2 | 2 | proflw_type | | inout | T | -!! | cld_lwp | cloud_liquid_water_path | cloud liquid water path | g m-2 | 2 | real | kind_phys | in | T | -!! | cld_ref_liq | mean_effective_radius_for_liquid_cloud | mean effective radius for liquid cloud | micron | 2 | real | kind_phys | in | T | -!! | cld_iwp | cloud_ice_water_path | cloud ice water path | g m-2 | 2 | real | kind_phys | in | T | -!! | cld_ref_ice | mean_effective_radius_for_ice_cloud | mean effective radius for ice cloud | micron | 2 | real | kind_phys | in | T | -!! | cld_rwp | cloud_rain_water_path | cloud ice water path | g m-2 | 2 | real | kind_phys | in | T | -!! | cld_ref_rain | mean_effective_radius_for_rain_drop | mean effective radius for rain drop | micron | 2 | real | kind_phys | in | T | -!! | cld_swp | cloud_snow_water_path | cloud snow water path | g m-2 | 2 | real | kind_phys | in | T | -!! | cld_ref_snow | mean_effective_radius_for_snow_flake | mean effective radius for snow flake | micron | 2 | real | kind_phys | in | T | -!! | cld_od | cloud_optical_depth | cloud optical depth | none | 2 | real | kind_phys | in | T | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude rrtmg_lw_run.html !! !> \section gen_lwrad RRTMG Longwave Radiation Scheme General Algorithm !> @{ diff --git a/physics/radlw_main.meta b/physics/radlw_main.meta new file mode 100644 index 000000000..73977e5cb --- /dev/null +++ b/physics/radlw_main.meta @@ -0,0 +1,390 @@ +[ccpp-arg-table] + name = rrtmg_lw_run + type = scheme +[plyr] + standard_name = air_pressure_at_layer_for_radiation_in_hPa + long_name = air pressure layer + units = hPa + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[plvl] + standard_name = air_pressure_at_interface_for_radiation_in_hPa + long_name = air pressure level + units = hPa + dimensions = (horizontal_dimension,adjusted_vertical_level_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[tlyr] + standard_name = air_temperature_at_layer_for_radiation + long_name = air temperature layer + units = K + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[tlvl] + standard_name = air_temperature_at_interface_for_radiation + long_name = air temperature level + units = K + dimensions = (horizontal_dimension,adjusted_vertical_level_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[qlyr] + standard_name = water_vapor_specific_humidity_at_layer_for_radiation + long_name = specific humidity layer + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[olyr] + standard_name = ozone_concentration_at_layer_for_radiation + long_name = ozone concentration layer + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_co2] + standard_name = volume_mixing_ratio_co2 + long_name = volume mixing ratio co2 + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_n2o] + standard_name = volume_mixing_ratio_n2o + long_name = volume mixing ratio no2 + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_ch4] + standard_name = volume_mixing_ratio_ch4 + long_name = volume mixing ratio ch4 + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_o2] + standard_name = volume_mixing_ratio_o2 + long_name = volume mixing ratio o2 + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_co] + standard_name = volume_mixing_ratio_co + long_name = volume mixing ratio co + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_cfc11] + standard_name = volume_mixing_ratio_cfc11 + long_name = volume mixing ratio cfc11 + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_cfc12] + standard_name = volume_mixing_ratio_cfc12 + long_name = volume mixing ratio cfc12 + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_cfc22] + standard_name = volume_mixing_ratio_cfc22 + long_name = volume mixing ratio cfc22 + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_ccl4] + standard_name = volume_mixing_ratio_ccl4 + long_name = volume mixing ratio ccl4 + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[icseed] + standard_name = seed_random_numbers_lw + long_name = seed for random number generation for longwave radiation + units = none + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[aeraod] + standard_name = aerosol_optical_depth_for_longwave_bands_01_16 + long_name = aerosol optical depth for longwave bands 01-16 + units = none + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_longwave_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[aerssa] + standard_name = aerosol_single_scattering_albedo_for_longwave_bands_01_16 + long_name = aerosol single scattering albedo for longwave bands 01-16 + units = frac + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_longwave_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[sfemis] + standard_name = surface_longwave_emissivity + long_name = surface emissivity + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfgtmp] + standard_name = surface_ground_temperature_for_radiation + long_name = surface ground temperature for radiation + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dzlyr] + standard_name = layer_thickness_for_radiation + long_name = layer thickness + units = km + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[delpin] + standard_name = layer_pressure_thickness_for_radiation + long_name = layer pressure thickness + units = hPa + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[de_lgth] + standard_name = cloud_decorrelation_length + long_name = cloud decorrelation length + units = km + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[npts] + standard_name = horizontal_loop_extent + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[nlay] + standard_name = adjusted_vertical_layer_dimension_for_radiation + long_name = number of vertical layers for radiation + units = count + dimensions = () + type = integer + intent = in + optional = F +[nlp1] + standard_name = adjusted_vertical_level_dimension_for_radiation + long_name = number of vertical levels for radiation + units = count + dimensions = () + type = integer + intent = in + optional = F +[lprnt] + standard_name = flag_print + long_name = flag to print + units = flag + dimensions = () + type = logical + intent = in + optional = F +[cld_cf] + standard_name = total_cloud_fraction + long_name = total cloud fraction + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[lslwr] + standard_name = flag_to_calc_lw + long_name = flag to calculate LW irradiances + units = flag + dimensions = () + type = logical + intent = in + optional = F +[hlwc] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step + long_name = longwave total sky heating rate + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = inout + optional = F +[topflx] + standard_name = lw_fluxes_top_atmosphere + long_name = longwave total sky fluxes at the top of the atm + units = W m-2 + dimensions = (horizontal_dimension) + type = topflw_type + intent = inout + optional = F +[sfcflx] + standard_name = lw_fluxes_sfc + long_name = longwave total sky fluxes at the Earth surface + units = W m-2 + dimensions = (horizontal_dimension) + type = sfcflw_type + intent = inout + optional = F +[cldtau] + standard_name = cloud_optical_depth_layers_at_10mu_band + long_name = approx 10mu band layer cloud optical depth + units = none + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = inout + optional = F +[hlw0] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_assuming_clear_sky_on_radiation_time_step + long_name = longwave clear sky heating rate + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = inout + optional = T +[cld_lwp] + standard_name = cloud_liquid_water_path + long_name = cloud liquid water path + units = g m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[cld_ref_liq] + standard_name = mean_effective_radius_for_liquid_cloud + long_name = mean effective radius for liquid cloud + units = micron + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[cld_iwp] + standard_name = cloud_ice_water_path + long_name = cloud ice water path + units = g m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[cld_ref_ice] + standard_name = mean_effective_radius_for_ice_cloud + long_name = mean effective radius for ice cloud + units = micron + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[cld_rwp] + standard_name = cloud_rain_water_path + long_name = cloud ice water path + units = g m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[cld_ref_rain] + standard_name = mean_effective_radius_for_rain_drop + long_name = mean effective radius for rain drop + units = micron + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[cld_swp] + standard_name = cloud_snow_water_path + long_name = cloud snow water path + units = g m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[cld_ref_snow] + standard_name = mean_effective_radius_for_snow_flake + long_name = mean effective radius for snow flake + units = micron + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/radlw_param.f b/physics/radlw_param.f index 539d2faa5..6c107a3d8 100644 --- a/physics/radlw_param.f +++ b/physics/radlw_param.f @@ -99,7 +99,7 @@ module module_radlw_parameters ! end type proflw_type ! ! Parameter constants for LW band structures - integer, parameter :: NBANDS = 16 !< number of total spectral bands + integer, parameter :: NBANDS = 16 !< number of total spectral bands integer, parameter :: NGPTLW = 140 !< number of total g-points integer, parameter :: NTBL = 10000 !< lookup table dimension integer, parameter :: MAXGAS = 7 !< maximum number of absorbing gases diff --git a/physics/radsw_main.f b/physics/radsw_main.f index 78f11c6cd..b10541fb7 100644 --- a/physics/radsw_main.f +++ b/physics/radsw_main.f @@ -455,65 +455,7 @@ end subroutine rrtmg_sw_init !! (http://www.rtweb.aer.com/) !! !> \section arg_table_rrtmg_sw_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|---------|------|-------------|-----------|--------|----------| -!! | plyr | air_pressure_at_layer_for_radiation_in_hPa | air pressure layer | hPa | 2 | real | kind_phys | in | F | -!! | plvl | air_pressure_at_interface_for_radiation_in_hPa | air pressure level | hPa | 2 | real | kind_phys | in | F | -!! | tlyr | air_temperature_at_layer_for_radiation | air temperature layer | K | 2 | real | kind_phys | in | F | -!! | tlvl | air_temperature_at_interface_for_radiation | air temperature level | K | 2 | real | kind_phys | in | F | -!! | qlyr | water_vapor_specific_humidity_at_layer_for_radiation | specific humidity layer | kg kg-1 | 2 | real | kind_phys | in | F | -!! | olyr | ozone_concentration_at_layer_for_radiation | ozone concentration layer | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_co2 | volume_mixing_ratio_co2 | volume mixing ratio co2 | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_n2o | volume_mixing_ratio_n2o | volume mixing ratio no2 | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_ch4 | volume_mixing_ratio_ch4 | volume mixing ratio ch4 | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_o2 | volume_mixing_ratio_o2 | volume mixing ratio o2 | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_co | volume_mixing_ratio_co | volume mixing ratio co | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_cfc11 | volume_mixing_ratio_cfc11 | volume mixing ratio cfc11 | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_cfc12 | volume_mixing_ratio_cfc12 | volume mixing ratio cfc12 | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_cfc22 | volume_mixing_ratio_cfc22 | volume mixing ratio cfc22 | kg kg-1 | 2 | real | kind_phys | in | F | -!! | gasvmr_ccl4 | volume_mixing_ratio_ccl4 | volume mixing ratio ccl4 | kg kg-1 | 2 | real | kind_phys | in | F | -!! | icseed | seed_random_numbers_sw | seed for random number generation for shortwave radiation | none | 1 | integer | | in | F | -!! | aeraod | aerosol_optical_depth_for_shortwave_bands_01_16 | aerosol optical depth for shortwave bands 01-16 | none | 3 | real | kind_phys | in | F | -!! | aerssa | aerosol_single_scattering_albedo_for_shortwave_bands_01_16 | aerosol single scattering albedo for shortwave bands 01-16 | frac | 3 | real | kind_phys | in | F | -!! | aerasy | aerosol_asymmetry_parameter_for_shortwave_bands_01_16 | aerosol asymmetry paramter for shortwave bands 01-16 | none | 3 | real | kind_phys | in | F | -!! | sfcalb_nir_dir | surface_albedo_due_to_near_IR_direct | surface albedo due to near IR direct beam | frac | 1 | real | kind_phys | in | F | -!! | sfcalb_nir_dif | surface_albedo_due_to_near_IR_diffused | surface albedo due to near IR diffused beam | frac | 1 | real | kind_phys | in | F | -!! | sfcalb_uvis_dir | surface_albedo_due_to_UV_and_VIS_direct | surface albedo due to UV+VIS direct beam | frac | 1 | real | kind_phys | in | F | -!! | sfcalb_uvis_dif | surface_albedo_due_to_UV_and_VIS_diffused | surface albedo due to UV+VIS diffused beam | frac | 1 | real | kind_phys | in | F | -!! | dzlyr | layer_thickness_for_radiation | layer thickness | km | 2 | real | kind_phys | in | F | -!! | delpin | layer_pressure_thickness_for_radiation | layer pressure thickness | hPa | 2 | real | kind_phys | in | F | -!! | de_lgth | cloud_decorrelation_length | cloud decorrelation length | km | 1 | real | kind_phys | in | F | -!! | cosz | cosine_of_zenith_angle | cosine of the solar zenit angle | none | 1 | real | kind_phys | in | F | -!! | solcon | solar_constant | solar constant | W m-2 | 0 | real | kind_phys | in | F | -!! | nday | daytime_points_dimension | daytime points dimension | count | 0 | integer | | in | F | -!! | idxday | daytime_points | daytime points | index | 1 | integer | | in | F | -!! | npts | horizontal_loop_extent | horizontal dimension | count | 0 | integer | | in | F | -!! | nlay | adjusted_vertical_layer_dimension_for_radiation | number of vertical layers for radiation | count | 0 | integer | | in | F | -!! | nlp1 | adjusted_vertical_level_dimension_for_radiation | number of vertical levels for radiation | count | 0 | integer | | in | F | -!! | lprnt | flag_print | flag to print | flag | 0 | logical | | in | F | -!! | cld_cf | total_cloud_fraction | total cloud fraction | frac | 2 | real | kind_phys | in | F | -!! | lsswr | flag_to_calc_sw | flag to calculate SW irradiances | flag | 0 | logical | | in | F | -!! | hswc | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step | shortwave total sky heating rate | K s-1 | 2 | real | kind_phys | inout | F | -!! | topflx | sw_fluxes_top_atmosphere | shortwave total sky fluxes at the top of the atm | W m-2 | 1 | topfsw_type | | inout | F | -!! | sfcflx | sw_fluxes_sfc | shortwave total sky fluxes at the Earth surface | W m-2 | 1 | sfcfsw_type | | inout | F | -!! | cldtau | cloud_optical_depth_layers_at_0p55mu_band | approx .55mu band layer cloud optical depth | none | 2 | real | kind_phys | inout | F | -!! | hsw0 | tendency_of_air_temperature_due_to_shortwave_heating_assuming_clear_sky_on_radiation_time_step | shortwave clear sky heating rate | K s-1 | 2 | real | kind_phys | inout | T | -!! | hswb | sw_heating_rate_spectral | shortwave total sky heating rate (spectral) | K s-1 | 3 | real | kind_phys | inout | T | -!! | flxprf | sw_fluxes | sw fluxes total sky / csk and up / down at levels | W m-2 | 2 | profsw_type | | inout | T | -!! | fdncmp | components_of_surface_downward_shortwave_fluxes | derived type for special components of surface downward shortwave fluxes | W m-2 | 1 | cmpfsw_type | | inout | T | -!! | cld_lwp | cloud_liquid_water_path | cloud liquid water path | g m-2 | 2 | real | kind_phys | in | T | -!! | cld_ref_liq | mean_effective_radius_for_liquid_cloud | mean effective radius for liquid cloud | micron | 2 | real | kind_phys | in | T | -!! | cld_iwp | cloud_ice_water_path | cloud ice water path | g m-2 | 2 | real | kind_phys | in | T | -!! | cld_ref_ice | mean_effective_radius_for_ice_cloud | mean effective radius for ice cloud | micron | 2 | real | kind_phys | in | T | -!! | cld_rwp | cloud_rain_water_path | cloud rain water path | g m-2 | 2 | real | kind_phys | in | T | -!! | cld_ref_rain | mean_effective_radius_for_rain_drop | mean effective radius for rain drop | micron | 2 | real | kind_phys | in | T | -!! | cld_swp | cloud_snow_water_path | cloud snow water path | g m-2 | 2 | real | kind_phys | in | T | -!! | cld_ref_snow | mean_effective_radius_for_snow_flake | mean effective radius for snow flake | micron | 2 | real | kind_phys | in | T | -!! | cld_od | cloud_optical_depth | cloud optical depth | none | 2 | real | kind_phys | in | T | -!! | cld_ssa | cloud_single_scattering_albedo | cloud single scattering albedo | frac | 2 | real | kind_phys | in | T | -!! | cld_asy | cloud_asymmetry_parameter | cloud asymmetry parameter | none | 2 | real | kind_phys | in | T | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude rrtmg_sw_run.html !! !> \section gen_swrad RRTMG Shortwave Radiation Scheme General Algorithm !> @{ diff --git a/physics/radsw_main.meta b/physics/radsw_main.meta new file mode 100644 index 000000000..c5cbe768a --- /dev/null +++ b/physics/radsw_main.meta @@ -0,0 +1,459 @@ +[ccpp-arg-table] + name = rrtmg_sw_run + type = scheme +[plyr] + standard_name = air_pressure_at_layer_for_radiation_in_hPa + long_name = air pressure layer + units = hPa + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[plvl] + standard_name = air_pressure_at_interface_for_radiation_in_hPa + long_name = air pressure level + units = hPa + dimensions = (horizontal_dimension,adjusted_vertical_level_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[tlyr] + standard_name = air_temperature_at_layer_for_radiation + long_name = air temperature layer + units = K + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[tlvl] + standard_name = air_temperature_at_interface_for_radiation + long_name = air temperature level + units = K + dimensions = (horizontal_dimension,adjusted_vertical_level_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[qlyr] + standard_name = water_vapor_specific_humidity_at_layer_for_radiation + long_name = specific humidity layer + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[olyr] + standard_name = ozone_concentration_at_layer_for_radiation + long_name = ozone concentration layer + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_co2] + standard_name = volume_mixing_ratio_co2 + long_name = volume mixing ratio co2 + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_n2o] + standard_name = volume_mixing_ratio_n2o + long_name = volume mixing ratio no2 + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_ch4] + standard_name = volume_mixing_ratio_ch4 + long_name = volume mixing ratio ch4 + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_o2] + standard_name = volume_mixing_ratio_o2 + long_name = volume mixing ratio o2 + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_co] + standard_name = volume_mixing_ratio_co + long_name = volume mixing ratio co + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_cfc11] + standard_name = volume_mixing_ratio_cfc11 + long_name = volume mixing ratio cfc11 + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_cfc12] + standard_name = volume_mixing_ratio_cfc12 + long_name = volume mixing ratio cfc12 + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_cfc22] + standard_name = volume_mixing_ratio_cfc22 + long_name = volume mixing ratio cfc22 + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[gasvmr_ccl4] + standard_name = volume_mixing_ratio_ccl4 + long_name = volume mixing ratio ccl4 + units = kg kg-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[icseed] + standard_name = seed_random_numbers_sw + long_name = seed for random number generation for shortwave radiation + units = none + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[aeraod] + standard_name = aerosol_optical_depth_for_shortwave_bands_01_16 + long_name = aerosol optical depth for shortwave bands 01-16 + units = none + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_shortwave_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[aerssa] + standard_name = aerosol_single_scattering_albedo_for_shortwave_bands_01_16 + long_name = aerosol single scattering albedo for shortwave bands 01-16 + units = frac + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_shortwave_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[aerasy] + standard_name = aerosol_asymmetry_parameter_for_shortwave_bands_01_16 + long_name = aerosol asymmetry paramter for shortwave bands 01-16 + units = none + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation,number_of_aerosol_bands_for_shortwave_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[sfcalb_nir_dir] + standard_name = surface_albedo_due_to_near_IR_direct + long_name = surface albedo due to near IR direct beam + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcalb_nir_dif] + standard_name = surface_albedo_due_to_near_IR_diffused + long_name = surface albedo due to near IR diffused beam + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcalb_uvis_dir] + standard_name = surface_albedo_due_to_UV_and_VIS_direct + long_name = surface albedo due to UV+VIS direct beam + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcalb_uvis_dif] + standard_name = surface_albedo_due_to_UV_and_VIS_diffused + long_name = surface albedo due to UV+VIS diffused beam + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dzlyr] + standard_name = layer_thickness_for_radiation + long_name = layer thickness + units = km + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[delpin] + standard_name = layer_pressure_thickness_for_radiation + long_name = layer pressure thickness + units = hPa + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[de_lgth] + standard_name = cloud_decorrelation_length + long_name = cloud decorrelation length + units = km + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cosz] + standard_name = cosine_of_zenith_angle + long_name = cosine of the solar zenit angle + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[solcon] + standard_name = solar_constant + long_name = solar constant + units = W m-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[nday] + standard_name = daytime_points_dimension + long_name = daytime points dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[idxday] + standard_name = daytime_points + long_name = daytime points + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[npts] + standard_name = horizontal_loop_extent + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[nlay] + standard_name = adjusted_vertical_layer_dimension_for_radiation + long_name = number of vertical layers for radiation + units = count + dimensions = () + type = integer + intent = in + optional = F +[nlp1] + standard_name = adjusted_vertical_level_dimension_for_radiation + long_name = number of vertical levels for radiation + units = count + dimensions = () + type = integer + intent = in + optional = F +[lprnt] + standard_name = flag_print + long_name = flag to print + units = flag + dimensions = () + type = logical + intent = in + optional = F +[cld_cf] + standard_name = total_cloud_fraction + long_name = total cloud fraction + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[lsswr] + standard_name = flag_to_calc_sw + long_name = flag to calculate SW irradiances + units = flag + dimensions = () + type = logical + intent = in + optional = F +[hswc] + standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step + long_name = shortwave total sky heating rate + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = inout + optional = F +[topflx] + standard_name = sw_fluxes_top_atmosphere + long_name = shortwave total sky fluxes at the top of the atm + units = W m-2 + dimensions = (horizontal_dimension) + type = topfsw_type + intent = inout + optional = F +[sfcflx] + standard_name = sw_fluxes_sfc + long_name = shortwave total sky fluxes at the Earth surface + units = W m-2 + dimensions = (horizontal_dimension) + type = sfcfsw_type + intent = inout + optional = F +[cldtau] + standard_name = cloud_optical_depth_layers_at_0p55mu_band + long_name = approx .55mu band layer cloud optical depth + units = none + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = inout + optional = F +[hsw0] + standard_name = tendency_of_air_temperature_due_to_shortwave_heating_assuming_clear_sky_on_radiation_time_step + long_name = shortwave clear sky heating rate + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = inout + optional = T +[fdncmp] + standard_name = components_of_surface_downward_shortwave_fluxes + long_name = derived type for special components of surface downward shortwave fluxes + units = W m-2 + dimensions = (horizontal_dimension) + type = cmpfsw_type + intent = inout + optional = T +[cld_lwp] + standard_name = cloud_liquid_water_path + long_name = cloud liquid water path + units = g m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[cld_ref_liq] + standard_name = mean_effective_radius_for_liquid_cloud + long_name = mean effective radius for liquid cloud + units = micron + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[cld_iwp] + standard_name = cloud_ice_water_path + long_name = cloud ice water path + units = g m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[cld_ref_ice] + standard_name = mean_effective_radius_for_ice_cloud + long_name = mean effective radius for ice cloud + units = micron + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[cld_rwp] + standard_name = cloud_rain_water_path + long_name = cloud rain water path + units = g m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[cld_ref_rain] + standard_name = mean_effective_radius_for_rain_drop + long_name = mean effective radius for rain drop + units = micron + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[cld_swp] + standard_name = cloud_snow_water_path + long_name = cloud snow water path + units = g m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[cld_ref_snow] + standard_name = mean_effective_radius_for_snow_flake + long_name = mean effective radius for snow flake + units = micron + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = T +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/rayleigh_damp.f b/physics/rayleigh_damp.f index 6c2806668..3231a16d8 100644 --- a/physics/rayleigh_damp.f +++ b/physics/rayleigh_damp.f @@ -19,26 +19,7 @@ end subroutine rayleigh_damp_init !! - The winter-summer zonal wind drag in the strato-mesosphere !! !! \section arg_table_rayleigh_damp_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|------------------------------------------------------|------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | lsidea | flag_idealized_physics | flag for idealized physics | flag | 0 | logical | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | km | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | -!! | A | tendency_of_y_wind_due_to_model_physics | meridional wind tendency due to model physics | m s-2 | 2 | real | kind_phys | inout | F | -!! | B | tendency_of_x_wind_due_to_model_physics | zonal wind tendency due to model physics | m s-2 | 2 | real | kind_phys | inout | F | -!! | C | tendency_of_air_temperature_due_to_model_physics | air temperature tendency due to model physics | K s-1 | 2 | real | kind_phys | inout | F | -!! | u1 | x_wind | zonal wind | m s-1 | 2 | real | kind_phys | in | F | -!! | v1 | y_wind | meridional wind | m s-1 | 2 | real | kind_phys | in | F | -!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | levr | number_of_vertical_layers_for_radiation_calculations | number of vertical layers for radiation calculations | count | 0 | integer | | in | F | -!! | pgr | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | prsl | air_pressure | mid-layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | prslrd0 | pressure_cutoff_for_rayleigh_damping | pressure level above which to apply Rayleigh damping | Pa | 0 | real | kind_phys | in | F | -!! | ral_ts | time_scale_for_rayleigh_damping | time scale for Rayleigh damping | d | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude rayleigh_damp_run.html !! !>\section gen_ray_damp_run GFS rayleigh_damp_runGeneral Algorithm !> @{ diff --git a/physics/rayleigh_damp.meta b/physics/rayleigh_damp.meta new file mode 100644 index 000000000..ec08802e8 --- /dev/null +++ b/physics/rayleigh_damp.meta @@ -0,0 +1,169 @@ +[ccpp-arg-table] + name = rayleigh_damp_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = rayleigh_damp_run + type = scheme +[lsidea] + standard_name = flag_idealized_physics + long_name = flag for idealized physics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension + long_name = number of vertical layers + units = count + dimensions = () + type = integer + intent = in + optional = F +[A] + standard_name = tendency_of_y_wind_due_to_model_physics + long_name = meridional wind tendency due to model physics + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[B] + standard_name = tendency_of_x_wind_due_to_model_physics + long_name = zonal wind tendency due to model physics + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[C] + standard_name = tendency_of_air_temperature_due_to_model_physics + long_name = air temperature tendency due to model physics + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[u1] + standard_name = x_wind + long_name = zonal wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v1] + standard_name = y_wind + long_name = meridional wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dt] + standard_name = time_step_for_physics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[levr] + standard_name = number_of_vertical_layers_for_radiation_calculations + long_name = number of vertical layers for radiation calculations + units = count + dimensions = () + type = integer + intent = in + optional = F +[pgr] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mid-layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslrd0] + standard_name = pressure_cutoff_for_rayleigh_damping + long_name = pressure level above which to apply Rayleigh damping + units = Pa + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ral_ts] + standard_name = time_scale_for_rayleigh_damping + long_name = time scale for Rayleigh damping + units = d + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = rayleigh_damp_finalize + type = scheme diff --git a/physics/rrtmg_lw_post.F90 b/physics/rrtmg_lw_post.F90 index 5e98d65e1..971b278dd 100644 --- a/physics/rrtmg_lw_post.F90 +++ b/physics/rrtmg_lw_post.F90 @@ -13,21 +13,7 @@ end subroutine rrtmg_lw_post_init ! PGI compiler does not accept lines longer than 264 characters, remove during pre-processing #ifndef __PGI !> \section arg_table_rrtmg_lw_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |-----------------|-----------------------------------------------------------------------------------------------|------------------------------------------------------------------------------|----------|------|-----------------------|-----------|-----------|----------| -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F | -!! | Grid | GFS_grid_type_instance | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_grid_type | | in | F | -!! | Radtend | GFS_radtend_type_instance | Fortran DDT containing FV3-GFS fields targetted for diagnostic output | DDT | 0 | GFS_radtend_type | | inout | F | -!! | Coupling | GFS_coupling_type_instance | Fortran DDT containing FV3-GFS fields to/from coupling with other components | DDT | 0 | GFS_coupling_type | | inout | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ltp | extra_top_layer | extra top layers | none | 0 | integer | | in | F | -!! | lm | number_of_vertical_layers_for_radiation_calculations | number of vertical layers for radiation calculation | count | 0 | integer | | in | F | -!! | kd | vertical_index_difference_between_inout_and_local | vertical index difference between in/out and local | index | 0 | integer | | in | F | -!! | tsfa | surface_air_temperature_for_radiation | lowest model layer air temperature for radiation | K | 1 | real | kind_phys | in | F | -!! | htlwc | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step | total sky heating rate due to longwave radiation | K s-1 | 2 | real | kind_phys | in | F | -!! | htlw0 | tendency_of_air_temperature_due_to_longwave_heating_assuming_clear_sky_on_radiation_time_step | clear sky heating rate due to longwave radiation | K s-1 | 2 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude rrtmg_lw_post_run.html !! #endif subroutine rrtmg_lw_post_run (Model, Grid, Radtend, Coupling, & diff --git a/physics/rrtmg_lw_post.meta b/physics/rrtmg_lw_post.meta new file mode 100644 index 000000000..92b4003d7 --- /dev/null +++ b/physics/rrtmg_lw_post.meta @@ -0,0 +1,121 @@ +[ccpp-arg-table] + name = rrtmg_lw_post_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = rrtmg_lw_post_run + type = scheme +[Model] + standard_name = GFS_control_type_instance + long_name = Fortran DDT containing FV3-GFS model control parameters + units = DDT + dimensions = () + type = GFS_control_type + intent = in + optional = F +[Grid] + standard_name = GFS_grid_type_instance + long_name = Fortran DDT containing FV3-GFS grid and interpolation related data + units = DDT + dimensions = () + type = GFS_grid_type + intent = in + optional = F +[Radtend] + standard_name = GFS_radtend_type_instance + long_name = Fortran DDT containing FV3-GFS fields targetted for diagnostic output + units = DDT + dimensions = () + type = GFS_radtend_type + intent = inout + optional = F +[Coupling] + standard_name = GFS_coupling_type_instance + long_name = Fortran DDT containing FV3-GFS fields to/from coupling with other components + units = DDT + dimensions = () + type = GFS_coupling_type + intent = inout + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[ltp] + standard_name = extra_top_layer + long_name = extra top layers + units = none + dimensions = () + type = integer + intent = in + optional = F +[lm] + standard_name = number_of_vertical_layers_for_radiation_calculations + long_name = number of vertical layers for radiation calculation + units = count + dimensions = () + type = integer + intent = in + optional = F +[kd] + standard_name = vertical_index_difference_between_inout_and_local + long_name = vertical index difference between in/out and local + units = index + dimensions = () + type = integer + intent = in + optional = F +[tsfa] + standard_name = surface_air_temperature_for_radiation + long_name = lowest model layer air temperature for radiation + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[htlwc] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step + long_name = total sky heating rate due to longwave radiation + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[htlw0] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_assuming_clear_sky_on_radiation_time_step + long_name = clear sky heating rate due to longwave radiation + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = rrtmg_lw_post_finalize + type = scheme diff --git a/physics/rrtmg_lw_pre.F90 b/physics/rrtmg_lw_pre.F90 index b45a2932f..783d65e90 100644 --- a/physics/rrtmg_lw_pre.F90 +++ b/physics/rrtmg_lw_pre.F90 @@ -12,17 +12,7 @@ subroutine rrtmg_lw_pre_init () end subroutine rrtmg_lw_pre_init !> \section arg_table_rrtmg_lw_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-------------------------------------------|--------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F | -!! | Grid | GFS_grid_type_instance | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_grid_type | | in | F | -!! | Sfcprop | GFS_sfcprop_type_instance | Fortran DDT containing FV3-GFS surface fields | DDT | 0 | GFS_sfcprop_type | | in | F | -!! | Radtend | GFS_radtend_type_instance | Fortran DDT containing FV3-GFS radiation tendencies | DDT | 0 | GFS_radtend_type | | inout | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | tsfg | surface_ground_temperature_for_radiation | surface ground temperature for radiation | K | 1 | real | kind_phys | in | F | -!! | tsfa | surface_air_temperature_for_radiation | lowest model layer air temperature for radiation | K | 1 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude rrtmg_lw_pre_run.html !! subroutine rrtmg_lw_pre_run (Model, Grid, Sfcprop, Radtend, im, tsfg, tsfa, errmsg, errflg) diff --git a/physics/rrtmg_lw_pre.meta b/physics/rrtmg_lw_pre.meta new file mode 100644 index 000000000..6b4488b26 --- /dev/null +++ b/physics/rrtmg_lw_pre.meta @@ -0,0 +1,88 @@ +[ccpp-arg-table] + name = rrtmg_lw_pre_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = rrtmg_lw_pre_run + type = scheme +[Model] + standard_name = GFS_control_type_instance + long_name = Fortran DDT containing FV3-GFS model control parameters + units = DDT + dimensions = () + type = GFS_control_type + intent = in + optional = F +[Grid] + standard_name = GFS_grid_type_instance + long_name = Fortran DDT containing FV3-GFS grid and interpolation related data + units = DDT + dimensions = () + type = GFS_grid_type + intent = in + optional = F +[Sfcprop] + standard_name = GFS_sfcprop_type_instance + long_name = Fortran DDT containing FV3-GFS surface fields + units = DDT + dimensions = () + type = GFS_sfcprop_type + intent = in + optional = F +[Radtend] + standard_name = GFS_radtend_type_instance + long_name = Fortran DDT containing FV3-GFS radiation tendencies + units = DDT + dimensions = () + type = GFS_radtend_type + intent = inout + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[tsfg] + standard_name = surface_ground_temperature_for_radiation + long_name = surface ground temperature for radiation + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsfa] + standard_name = surface_air_temperature_for_radiation + long_name = lowest model layer air temperature for radiation + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = rrtmg_lw_pre_finalize + type = scheme diff --git a/physics/rrtmg_sw_post.F90 b/physics/rrtmg_sw_post.F90 index a31ed7ec9..e11491d48 100644 --- a/physics/rrtmg_sw_post.F90 +++ b/physics/rrtmg_sw_post.F90 @@ -12,27 +12,7 @@ end subroutine rrtmg_sw_post_init ! PGI compiler does not accept lines longer than 264 characters, remove during pre-processing #ifndef __PGI !> \section arg_table_rrtmg_sw_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------|----------|------|-----------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F | -!! | Grid | GFS_grid_type_instance | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_grid_type | | in | F | -!! | Diag | GFS_diag_type_instance | Fortran DDT containing FV3-GFS diagnotics data | DDT | 0 | GFS_diag_type | | inout | F | -!! | Radtend | GFS_radtend_type_instance | Fortran DDT containing FV3-GFS fields targetted for diagnostic output | DDT | 0 | GFS_radtend_type | | inout | F | -!! | Coupling | GFS_coupling_type_instance | Fortran DDT containing FV3-GFS fields to/from coupling with other components | DDT | 0 | GFS_coupling_type | | inout | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ltp | extra_top_layer | extra top layers | none | 0 | integer | | in | F | -!! | nday | daytime_points_dimension | daytime points dimension | count | 0 | integer | | in | F | -!! | lm | number_of_vertical_layers_for_radiation_calculations | number of vertical layers for radiation calculation | count | 0 | integer | | in | F | -!! | kd | vertical_index_difference_between_inout_and_local | vertical index difference between in/out and local | index | 0 | integer | | in | F | -!! | htswc | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step | total sky heating rate due to shortwave radiation | K s-1 | 2 | real | kind_phys | in | F | -!! | htsw0 | tendency_of_air_temperature_due_to_shortwave_heating_assuming_clear_sky_on_radiation_time_step | clear sky heating rates due to shortwave radiation | K s-1 | 2 | real | kind_phys | in | F | -!! | sfcalb1 | surface_albedo_due_to_near_IR_direct | surface albedo due to near IR direct beam | frac | 1 | real | kind_phys | in | F | -!! | sfcalb2 | surface_albedo_due_to_near_IR_diffused | surface albedo due to near IR diffused beam | frac | 1 | real | kind_phys | in | F | -!! | sfcalb3 | surface_albedo_due_to_UV_and_VIS_direct | surface albedo due to UV+VIS direct beam | frac | 1 | real | kind_phys | in | F | -!! | sfcalb4 | surface_albedo_due_to_UV_and_VIS_diffused | surface albedo due to UV+VIS diffused beam | frac | 1 | real | kind_phys | in | F | -!! | scmpsw | components_of_surface_downward_shortwave_fluxes | derived type for special components of surface downward shortwave fluxes | W m-2 | 1 | cmpfsw_type | | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude rrtmg_sw_post_run.html !! #endif subroutine rrtmg_sw_post_run (Model, Grid, Diag, Radtend, Coupling, & diff --git a/physics/rrtmg_sw_post.meta b/physics/rrtmg_sw_post.meta new file mode 100644 index 000000000..28b54b5bf --- /dev/null +++ b/physics/rrtmg_sw_post.meta @@ -0,0 +1,172 @@ +[ccpp-arg-table] + name = rrtmg_sw_post_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = rrtmg_sw_post_run + type = scheme +[Model] + standard_name = GFS_control_type_instance + long_name = Fortran DDT containing FV3-GFS model control parameters + units = DDT + dimensions = () + type = GFS_control_type + intent = in + optional = F +[Grid] + standard_name = GFS_grid_type_instance + long_name = Fortran DDT containing FV3-GFS grid and interpolation related data + units = DDT + dimensions = () + type = GFS_grid_type + intent = in + optional = F +[Diag] + standard_name = GFS_diag_type_instance + long_name = Fortran DDT containing FV3-GFS diagnotics data + units = DDT + dimensions = () + type = GFS_diag_type + intent = inout + optional = F +[Radtend] + standard_name = GFS_radtend_type_instance + long_name = Fortran DDT containing FV3-GFS fields targetted for diagnostic output + units = DDT + dimensions = () + type = GFS_radtend_type + intent = inout + optional = F +[Coupling] + standard_name = GFS_coupling_type_instance + long_name = Fortran DDT containing FV3-GFS fields to/from coupling with other components + units = DDT + dimensions = () + type = GFS_coupling_type + intent = inout + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[ltp] + standard_name = extra_top_layer + long_name = extra top layers + units = none + dimensions = () + type = integer + intent = in + optional = F +[nday] + standard_name = daytime_points_dimension + long_name = daytime points dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[lm] + standard_name = number_of_vertical_layers_for_radiation_calculations + long_name = number of vertical layers for radiation calculation + units = count + dimensions = () + type = integer + intent = in + optional = F +[kd] + standard_name = vertical_index_difference_between_inout_and_local + long_name = vertical index difference between in/out and local + units = index + dimensions = () + type = integer + intent = in + optional = F +[htswc] + standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step + long_name = total sky heating rate due to shortwave radiation + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[htsw0] + standard_name = tendency_of_air_temperature_due_to_shortwave_heating_assuming_clear_sky_on_radiation_time_step + long_name = clear sky heating rates due to shortwave radiation + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[sfcalb1] + standard_name = surface_albedo_due_to_near_IR_direct + long_name = surface albedo due to near IR direct beam + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcalb2] + standard_name = surface_albedo_due_to_near_IR_diffused + long_name = surface albedo due to near IR diffused beam + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcalb3] + standard_name = surface_albedo_due_to_UV_and_VIS_direct + long_name = surface albedo due to UV+VIS direct beam + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcalb4] + standard_name = surface_albedo_due_to_UV_and_VIS_diffused + long_name = surface albedo due to UV+VIS diffused beam + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[scmpsw] + standard_name = components_of_surface_downward_shortwave_fluxes + long_name = derived type for special components of surface downward shortwave fluxes + units = W m-2 + dimensions = (horizontal_dimension) + type = cmpfsw_type + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = rrtmg_sw_post_finalize + type = scheme diff --git a/physics/rrtmg_sw_pre.F90 b/physics/rrtmg_sw_pre.F90 index 2a9665ad1..de994ba79 100644 --- a/physics/rrtmg_sw_pre.F90 +++ b/physics/rrtmg_sw_pre.F90 @@ -12,24 +12,7 @@ subroutine rrtmg_sw_pre_init () end subroutine rrtmg_sw_pre_init !> \section arg_table_rrtmg_sw_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-------------------------------------------|--------------------------------------------------------------------|----------|------|------------------|-----------|--------|----------| -!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F | -!! | Grid | GFS_grid_type_instance | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_grid_type | | in | F | -!! | Sfcprop | GFS_sfcprop_type_instance | Fortran DDT containing FV3-GFS surface fields | DDT | 0 | GFS_sfcprop_type | | in | F | -!! | Radtend | GFS_radtend_type_instance | Fortran DDT containing FV3-GFS radiation tendencies | DDT | 0 | GFS_radtend_type | | inout | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | nday | daytime_points_dimension | daytime points dimension | count | 0 | integer | | out | F | -!! | idxday | daytime_points | daytime points | index | 1 | integer | | out | F | -!! | tsfg | surface_ground_temperature_for_radiation | surface ground temperature for radiation | K | 1 | real | kind_phys | in | F | -!! | tsfa | surface_air_temperature_for_radiation | lowest model layer air temperature for radiation | K | 1 | real | kind_phys | in | F | -!! | sfcalb1 | surface_albedo_due_to_near_IR_direct | surface albedo due to near IR direct beam | frac | 1 | real | kind_phys | out | F | -!! | sfcalb2 | surface_albedo_due_to_near_IR_diffused | surface albedo due to near IR diffused beam | frac | 1 | real | kind_phys | out | F | -!! | sfcalb3 | surface_albedo_due_to_UV_and_VIS_direct | surface albedo due to UV+VIS direct beam | frac | 1 | real | kind_phys | out | F | -!! | sfcalb4 | surface_albedo_due_to_UV_and_VIS_diffused | surface albedo due to UV+VIS diffused beam | frac | 1 | real | kind_phys | out | F | -!! | alb1d | surface_albedo_perturbation | surface albedo perturbation | frac | 1 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude rrtmg_sw_pre_run.html !! subroutine rrtmg_sw_pre_run (Model, Grid, Sfcprop, Radtend, im, & nday, idxday, tsfg, tsfa, sfcalb1, sfcalb2, sfcalb3, sfcalb4, & diff --git a/physics/rrtmg_sw_pre.meta b/physics/rrtmg_sw_pre.meta new file mode 100644 index 000000000..6a68a8cd6 --- /dev/null +++ b/physics/rrtmg_sw_pre.meta @@ -0,0 +1,149 @@ +[ccpp-arg-table] + name = rrtmg_sw_pre_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = rrtmg_sw_pre_run + type = scheme +[Model] + standard_name = GFS_control_type_instance + long_name = Fortran DDT containing FV3-GFS model control parameters + units = DDT + dimensions = () + type = GFS_control_type + intent = in + optional = F +[Grid] + standard_name = GFS_grid_type_instance + long_name = Fortran DDT containing FV3-GFS grid and interpolation related data + units = DDT + dimensions = () + type = GFS_grid_type + intent = in + optional = F +[Sfcprop] + standard_name = GFS_sfcprop_type_instance + long_name = Fortran DDT containing FV3-GFS surface fields + units = DDT + dimensions = () + type = GFS_sfcprop_type + intent = in + optional = F +[Radtend] + standard_name = GFS_radtend_type_instance + long_name = Fortran DDT containing FV3-GFS radiation tendencies + units = DDT + dimensions = () + type = GFS_radtend_type + intent = inout + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[nday] + standard_name = daytime_points_dimension + long_name = daytime points dimension + units = count + dimensions = () + type = integer + intent = out + optional = F +[idxday] + standard_name = daytime_points + long_name = daytime points + units = index + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[tsfg] + standard_name = surface_ground_temperature_for_radiation + long_name = surface ground temperature for radiation + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsfa] + standard_name = surface_air_temperature_for_radiation + long_name = lowest model layer air temperature for radiation + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcalb1] + standard_name = surface_albedo_due_to_near_IR_direct + long_name = surface albedo due to near IR direct beam + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[sfcalb2] + standard_name = surface_albedo_due_to_near_IR_diffused + long_name = surface albedo due to near IR diffused beam + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[sfcalb3] + standard_name = surface_albedo_due_to_UV_and_VIS_direct + long_name = surface albedo due to UV+VIS direct beam + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[sfcalb4] + standard_name = surface_albedo_due_to_UV_and_VIS_diffused + long_name = surface albedo due to UV+VIS diffused beam + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[alb1d] + standard_name = surface_albedo_perturbation + long_name = surface albedo perturbation + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = rrtmg_sw_pre_finalize + type = scheme diff --git a/physics/samfdeepcnv.f b/physics/samfdeepcnv.f index 6838f3048..8ebf9cde0 100644 --- a/physics/samfdeepcnv.f +++ b/physics/samfdeepcnv.f @@ -49,73 +49,7 @@ end subroutine samfdeepcnv_finalize !! of the large-scale environment due to the cumulus convection. !! !! \section arg_table_samfdeepcnv_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|----------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|-------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | cliq | specific_heat_of_liquid_water_at_constant_pressure | specific heat of liquid water at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | cvap | specific_heat_of_water_vapor_at_constant_pressure | specific heat of water vapor at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | eps | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | -!! | epsm1 | ratio_of_dry_air_to_water_vapor_gas_constants_minus_one | (rd/rv) - 1 | none | 0 | real | kind_phys | in | F | -!! | fv | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | grav | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | t0c | temperature_at_zero_celsius | temperature at 0 degrees Celsius | K | 0 | real | kind_phys | in | F | -!! | delt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | ntk | index_for_turbulent_kinetic_energy_convective_transport_tracer | index for turbulent kinetic energy in the convectively transported tracer array | index | 0 | integer | | in | F | -!! | ntr | number_of_tracers_for_samf | number of tracers for scale-aware mass flux schemes | count | 0 | integer | | in | F | -!! | delp | air_pressure_difference_between_midlayers | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | -!! | prslp | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | psp | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | phil | geopotential | layer geopotential | m2 s-2 | 2 | real | kind_phys | in | F | -!! | qtr | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | inout | F | -!! | q1 | water_vapor_specific_humidity_updated_by_physics | updated vapor specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | t1 | air_temperature_updated_by_physics | updated temperature | K | 2 | real | kind_phys | inout | F | -!! | u1 | x_wind_updated_by_physics | updated x-direction wind | m s-1 | 2 | real | kind_phys | inout | F | -!! | v1 | y_wind_updated_by_physics | updated y-direction wind | m s-1 | 2 | real | kind_phys | inout | F | -!! | do_ca | flag_for_cellular_automata | cellular automata main switch | flag | 0 | logical | | in | F | -!! | ca_deep | fraction_of_cellular_automata_for_deep_convection | fraction of cellular automata for deep convection | frac | 1 | real | kind_phys | in | F | -!! | cldwrk | cloud_work_function | cloud work function | m2 s-2 | 1 | real | kind_phys | out | F | -!! | rn | lwe_thickness_of_deep_convective_precipitation_amount | deep convective rainfall amount on physics timestep | m | 1 | real | kind_phys | out | F | -!! | kbot | vertical_index_at_cloud_base | index for cloud base | index | 1 | integer | | out | F | -!! | ktop | vertical_index_at_cloud_top | index for cloud top | index | 1 | integer | | out | F | -!! | kcnv | flag_deep_convection | deep convection: 0=no, 1=yes | flag | 1 | integer | | inout | F | -!! | islimsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | -!! | garea | cell_area | grid cell area | m2 | 1 | real | kind_phys | in | F | -!! | dot | omega | layer mean vertical velocity | Pa s-1 | 2 | real | kind_phys | in | F | -!! | ncloud | number_of_hydrometeors | number of hydrometeors | count | 0 | integer | | in | F | -!! | ud_mf | instantaneous_atmosphere_updraft_convective_mass_flux | (updraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | -!! | dd_mf | instantaneous_atmosphere_downdraft_convective_mass_flux | (downdraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | -!! | dt_mf | instantaneous_atmosphere_detrainment_convective_mass_flux | (detrainment mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | -!! | cnvw | convective_cloud_water_mixing_ratio | moist convective cloud water mixing ratio | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | inout | F | -!! | qlcn | mass_fraction_of_convective_cloud_liquid_water | mass fraction of convective cloud liquid water | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | qicn | mass_fraction_of_convective_cloud_ice | mass fraction of convective cloud ice water | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | w_upi | vertical_velocity_for_updraft | vertical velocity for updraft | m s-1 | 2 | real | kind_phys | inout | F | -!! | cf_upi | convective_cloud_fraction_for_microphysics | convective cloud fraction for microphysics | frac | 2 | real | kind_phys | inout | F | -!! | cnv_mfd | detrained_mass_flux | detrained mass flux | kg m-2 s-1 | 2 | real | kind_phys | inout | F | -!! | cnv_dqldt | tendency_of_cloud_water_due_to_convective_microphysics | tendency of cloud water due to convective microphysics | kg m-2 s-1 | 2 | real | kind_phys | inout | F | -!! | clcn | convective_cloud_volume_fraction | convective cloud volume fraction | frac | 2 | real | kind_phys | inout | F | -!! | cnv_fice | ice_fraction_in_convective_tower | ice fraction in convective tower | frac | 2 | real | kind_phys | inout | F | -!! | cnv_ndrop | number_concentration_of_cloud_liquid_water_particles_for_detrainment | droplet number concentration in convective detrainment | m-3 | 2 | real | kind_phys | inout | F | -!! | cnv_nice | number_concentration_of_ice_crystals_for_detrainment | crystal number concentration in convective detrainment | m-3 | 2 | real | kind_phys | inout | F | -!! | mp_phys | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | mp_phys_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | -!! | clam | entrainment_rate_coefficient_deep_convection | entrainment rate coefficient for deep conv. | none | 0 | real | kind_phys | in | F | -!! | c0s | rain_conversion_parameter_deep_convection | convective rain conversion parameter for deep conv. | m-1 | 0 | real | kind_phys | in | F | -!! | c1 | detrainment_conversion_parameter_deep_convection | convective detrainment conversion parameter for deep conv. | m-1 | 0 | real | kind_phys | in | F | -!! | betal | downdraft_fraction_reaching_surface_over_land_deep_convection | downdraft fraction reaching surface over land for deep conv. | frac | 0 | real | kind_phys | in | F | -!! | betas | downdraft_fraction_reaching_surface_over_ocean_deep_convection | downdraft fraction reaching surface over ocean for deep conv. | frac | 0 | real | kind_phys | in | F | -!! | evfact | rain_evaporation_coefficient_deep_convection | convective rain evaporation coefficient for deep conv. | frac | 0 | real | kind_phys | in | F | -!! | evfactl | rain_evaporation_coefficient_over_land_deep_convection | convective rain evaporation coefficient over land for deep conv. | frac | 0 | real | kind_phys | in | F | -!! | pgcon | momentum_transport_reduction_factor_pgf_deep_convection | reduction factor in momentum transport due to deep conv. induced pressure gradient force | frac | 0 | real | kind_phys | in | F | -!! | asolfac | aerosol_aware_parameter_deep_convection | aerosol-aware parameter inversely proportional to CCN number concentraion from Lim (2011) for deep conv. | none | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude samfdeepcnv_run.html !! !! \section general_samfdeep GFS samfdeepcnv General Algorithm !! -# Compute preliminary quantities needed for static, dynamic, and feedback control portions of the algorithm. diff --git a/physics/samfdeepcnv.meta b/physics/samfdeepcnv.meta new file mode 100644 index 000000000..7db1880a7 --- /dev/null +++ b/physics/samfdeepcnv.meta @@ -0,0 +1,584 @@ +[ccpp-arg-table] + name = samfdeepcnv_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = samfdeepcnv_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = samfdeepcnv_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[cliq] + standard_name = specific_heat_of_liquid_water_at_constant_pressure + long_name = specific heat of liquid water at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cvap] + standard_name = specific_heat_of_water_vapor_at_constant_pressure + long_name = specific heat of water vapor at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[eps] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[epsm1] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one + long_name = (rd/rv) - 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[fv] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[grav] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rv] + standard_name = gas_constant_water_vapor + long_name = ideal gas constant for water vapor + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[t0c] + standard_name = temperature_at_zero_celsius + long_name = temperature at 0 degrees Celsius + units = K + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[delt] + standard_name = time_step_for_physics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ntk] + standard_name = index_for_turbulent_kinetic_energy_convective_transport_tracer + long_name = index for turbulent kinetic energy in the convectively transported tracer array + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntr] + standard_name = number_of_tracers_for_samf + long_name = number of tracers for scale-aware mass flux schemes + units = count + dimensions = () + type = integer + intent = in + optional = F +[delp] + standard_name = air_pressure_difference_between_midlayers + long_name = pres(k) - pres(k+1) + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslp] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[psp] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[phil] + standard_name = geopotential + long_name = layer geopotential + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qtr] + standard_name = convective_transportable_tracers + long_name = array to contain cloud water and other convective trans. tracers + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers_for_convective_transport) + type = real + kind = kind_phys + intent = inout + optional = F +[q1] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = updated vapor specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[t1] + standard_name = air_temperature_updated_by_physics + long_name = updated temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[u1] + standard_name = x_wind_updated_by_physics + long_name = updated x-direction wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[v1] + standard_name = y_wind_updated_by_physics + long_name = updated y-direction wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[do_ca] + standard_name = flag_for_cellular_automata + long_name = cellular automata main switch + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ca_deep] + standard_name = fraction_of_cellular_automata_for_deep_convection + long_name = fraction of cellular automata for deep convection + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cldwrk] + standard_name = cloud_work_function + long_name = cloud work function + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[rn] + standard_name = lwe_thickness_of_deep_convective_precipitation_amount + long_name = deep convective rainfall amount on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[kbot] + standard_name = vertical_index_at_cloud_base + long_name = index for cloud base + units = index + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[ktop] + standard_name = vertical_index_at_cloud_top + long_name = index for cloud top + units = index + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[kcnv] + standard_name = flag_deep_convection + long_name = deep convection: 0=no, 1=yes + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = inout + optional = F +[islimsk] + standard_name = sea_land_ice_mask + long_name = landmask: sea/land/ice=0/1/2 + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[garea] + standard_name = cell_area + long_name = grid cell area + units = m2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dot] + standard_name = omega + long_name = layer mean vertical velocity + units = Pa s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ncloud] + standard_name = number_of_hydrometeors + long_name = number of hydrometeors + units = count + dimensions = () + type = integer + intent = in + optional = F +[ud_mf] + standard_name = instantaneous_atmosphere_updraft_convective_mass_flux + long_name = (updraft mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dd_mf] + standard_name = instantaneous_atmosphere_downdraft_convective_mass_flux + long_name = (downdraft mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dt_mf] + standard_name = instantaneous_atmosphere_detrainment_convective_mass_flux + long_name = (detrainment mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cnvw] + standard_name = convective_cloud_water_mixing_ratio + long_name = moist convective cloud water mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnvc] + standard_name = convective_cloud_cover + long_name = convective cloud cover + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qlcn] + standard_name = mass_fraction_of_convective_cloud_liquid_water + long_name = mass fraction of convective cloud liquid water + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qicn] + standard_name = mass_fraction_of_convective_cloud_ice + long_name = mass fraction of convective cloud ice water + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[w_upi] + standard_name = vertical_velocity_for_updraft + long_name = vertical velocity for updraft + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cf_upi] + standard_name = convective_cloud_fraction_for_microphysics + long_name = convective cloud fraction for microphysics + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnv_mfd] + standard_name = detrained_mass_flux + long_name = detrained mass flux + units = kg m-2 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnv_dqldt] + standard_name = tendency_of_cloud_water_due_to_convective_microphysics + long_name = tendency of cloud water due to convective microphysics + units = kg m-2 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[clcn] + standard_name = convective_cloud_volume_fraction + long_name = convective cloud volume fraction + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnv_fice] + standard_name = ice_fraction_in_convective_tower + long_name = ice fraction in convective tower + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnv_ndrop] + standard_name = number_concentration_of_cloud_liquid_water_particles_for_detrainment + long_name = droplet number concentration in convective detrainment + units = m-3 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnv_nice] + standard_name = number_concentration_of_ice_crystals_for_detrainment + long_name = crystal number concentration in convective detrainment + units = m-3 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[mp_phys] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[mp_phys_mg] + standard_name = flag_for_morrison_gettelman_microphysics_scheme + long_name = choice of Morrison-Gettelman microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[clam] + standard_name = entrainment_rate_coefficient_deep_convection + long_name = entrainment rate coefficient for deep conv. + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[c0s] + standard_name = rain_conversion_parameter_deep_convection + long_name = convective rain conversion parameter for deep conv. + units = m-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[c1] + standard_name = detrainment_conversion_parameter_deep_convection + long_name = convective detrainment conversion parameter for deep conv. + units = m-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[betal] + standard_name = downdraft_fraction_reaching_surface_over_land_deep_convection + long_name = downdraft fraction reaching surface over land for deep conv. + units = frac + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[betas] + standard_name = downdraft_fraction_reaching_surface_over_ocean_deep_convection + long_name = downdraft fraction reaching surface over ocean for deep conv. + units = frac + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[evfact] + standard_name = rain_evaporation_coefficient_deep_convection + long_name = convective rain evaporation coefficient for deep conv. + units = frac + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[evfactl] + standard_name = rain_evaporation_coefficient_over_land_deep_convection + long_name = convective rain evaporation coefficient over land for deep conv. + units = frac + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[pgcon] + standard_name = momentum_transport_reduction_factor_pgf_deep_convection + long_name = reduction factor in momentum transport due to deep conv. induced pressure gradient force + units = frac + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[asolfac] + standard_name = aerosol_aware_parameter_deep_convection + long_name = aerosol-aware parameter inversely proportional to CCN number concentraion from Lim (2011) for deep conv. + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/samfshalcnv.f b/physics/samfshalcnv.f index ddacba9d8..27629d7d7 100644 --- a/physics/samfshalcnv.f +++ b/physics/samfshalcnv.f @@ -37,54 +37,7 @@ end subroutine samfshalcnv_finalize !! magnitude compared to the deep scheme. !! !! \section arg_table_samfshalcnv_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|-------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | cliq | specific_heat_of_liquid_water_at_constant_pressure | specific heat of liquid water at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | cvap | specific_heat_of_water_vapor_at_constant_pressure | specific heat of water vapor at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | eps | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | -!! | epsm1 | ratio_of_dry_air_to_water_vapor_gas_constants_minus_one | (rd/rv) - 1 | none | 0 | real | kind_phys | in | F | -!! | fv | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | grav | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | t0c | temperature_at_zero_celsius | temperature at 0 degrees Celsius | K | 0 | real | kind_phys | in | F | -!! | delt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F | -!! | ntk | index_for_turbulent_kinetic_energy_convective_transport_tracer | index for turbulent kinetic energy in the convectively transported tracer array | index | 0 | integer | | in | F | -!! | ntr | number_of_tracers_for_samf | number of tracers for scale-aware mass flux schemes | count | 0 | integer | | in | F | -!! | delp | air_pressure_difference_between_midlayers | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | -!! | prslp | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | psp | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | phil | geopotential | layer geopotential | m2 s-2 | 2 | real | kind_phys | in | F | -!! | qtr | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | inout | F | -!! | q1 | water_vapor_specific_humidity_updated_by_physics | updated vapor specific humidity | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | t1 | air_temperature_updated_by_physics | updated temperature | K | 2 | real | kind_phys | inout | F | -!! | u1 | x_wind_updated_by_physics | updated x-direction wind | m s-1 | 2 | real | kind_phys | inout | F | -!! | v1 | y_wind_updated_by_physics | updated y-direction wind | m s-1 | 2 | real | kind_phys | inout | F | -!! | rn | lwe_thickness_of_shallow_convective_precipitation_amount | shallow convective rainfall amount on physics timestep | m | 1 | real | kind_phys | out | F | -!! | kbot | vertical_index_at_cloud_base | index at cloud base | index | 1 | integer | | out | F | -!! | ktop | vertical_index_at_cloud_top | index at cloud top | index | 1 | integer | | out | F | -!! | kcnv | flag_deep_convection | deep convection: 0=no, 1=yes | flag | 1 | integer | | inout | F | -!! | islimsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | -!! | garea | cell_area | grid cell area | m2 | 1 | real | kind_phys | in | F | -!! | dot | omega | layer mean vertical velocity | Pa s-1 | 2 | real | kind_phys | in | F | -!! | ncloud | number_of_hydrometeors | number of hydrometeors | count | 0 | integer | | in | F | -!! | hpbl | atmosphere_boundary_layer_thickness | PBL top height | m | 1 | real | kind_phys | in | F | -!! | ud_mf | instantaneous_atmosphere_updraft_convective_mass_flux | (updraft mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | -!! | dt_mf | instantaneous_atmosphere_detrainment_convective_mass_flux | (detrainment mass flux) * delt | kg m-2 | 2 | real | kind_phys | out | F | -!! | cnvw | convective_cloud_water_mixing_ratio | moist convective cloud water mixing ratio | kg kg-1 | 2 | real | kind_phys | out | F | -!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | out | F | -!! | clam | entrainment_rate_coefficient_shallow_convection | entrainment rate coefficient for shal conv. | none | 0 | real | kind_phys | in | F | -!! | c0s | rain_conversion_parameter_shallow_convection | convective rain conversion parameter for shal conv. | m-1 | 0 | real | kind_phys | in | F | -!! | c1 | detrainment_conversion_parameter_shallow_convection | convective detrainment conversion parameter for shal conv. | m-1 | 0 | real | kind_phys | in | F | -!! | pgcon | momentum_transport_reduction_factor_pgf_shallow_convection | reduction factor in momentum transport due to shal conv. induced pressure gradient force | frac | 0 | real | kind_phys | in | F | -!! | asolfac | aerosol_aware_parameter_shallow_convection | aerosol-aware parameter inversely proportional to CCN number concentraion from Lim (2011) for shal conv. | none | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude samfshalcnv_run.html !! !! \section gen_samfshalcnv GFS samfshalcnv General Algorithm !! -# Compute preliminary quantities needed for the static and feedback control portions of the algorithm. @@ -1830,26 +1783,7 @@ module samfshalcnv_post contains !! \section arg_table_samfshalcnv_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------|----------------------------------------------------------------------|---------|------|------------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | -!! | shcnvcw | flag_shallow_convective_cloud | flag for shallow convective cloud | | 0 | logical | | in | F | -!! | frain | dynamics_to_physics_timestep_ratio | ratio of dynamics timestep to physics timestep | none | 0 | real | kind_phys | in | F | -!! | rain1 | lwe_thickness_of_shallow_convective_precipitation_amount | shallow convective rainfall amount on physics timestep | m | 1 | real | kind_phys | in | F | -!! | npdf3d | number_of_3d_arrays_associated_with_pdf_based_clouds | number of 3d arrays associated with pdf based clouds/mp | count | 0 | integer | | in | F | -!! | num_p3d | array_dimension_of_3d_arrays_for_microphysics | number of 3D arrays needed for microphysics | count | 0 | integer | | in | F | -!! | ncnvcld3d | number_of_convective_3d_cloud_fields | number of convective 3d clouds fields | count | 0 | integer | | in | F | -!! | cnvc | convective_cloud_cover | convective cloud cover | frac | 2 | real | kind_phys | in | F | -!! | cnvw | convective_cloud_water_mixing_ratio | moist convective cloud water mixing ratio | kg kg-1 | 2 | real | kind_phys | in | F | -!! | rainc | lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep | convective rain at this time step | m | 1 | real | kind_phys | inout | F | -!! | cnvprcp | cumulative_lwe_thickness_of_convective_precipitation_amount | cumulative convective precipitation | m | 1 | real | kind_phys | inout | F | -!! | cnvprcpb | cumulative_lwe_thickness_of_convective_precipitation_amount_in_bucket | cumulative convective precipitation in bucket | m | 1 | real | kind_phys | inout | F | -!! | cnvw_phy_f3d | convective_cloud_water_mixing_ratio_in_phy_f3d | convective cloud water mixing ratio in the phy_f3d array | kg kg-1 | 2 | real | kind_phys | inout | F | -!! | cnvc_phy_f3d | convective_cloud_cover_in_phy_f3d | convective cloud cover in the phy_f3d array | frac | 2 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude samfshalcnv_post_run.html !! subroutine samfshalcnv_post_run (im, levs, lssav, shcnvcw, frain, & rain1, npdf3d, num_p3d, ncnvcld3d, cnvc, cnvw, diff --git a/physics/samfshalcnv.meta b/physics/samfshalcnv.meta new file mode 100644 index 000000000..e056644c3 --- /dev/null +++ b/physics/samfshalcnv.meta @@ -0,0 +1,585 @@ +[ccpp-arg-table] + name = samfshalcnv_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = samfshalcnv_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = samfshalcnv_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[cliq] + standard_name = specific_heat_of_liquid_water_at_constant_pressure + long_name = specific heat of liquid water at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cvap] + standard_name = specific_heat_of_water_vapor_at_constant_pressure + long_name = specific heat of water vapor at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[eps] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[epsm1] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one + long_name = (rd/rv) - 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[fv] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[grav] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rv] + standard_name = gas_constant_water_vapor + long_name = ideal gas constant for water vapor + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[t0c] + standard_name = temperature_at_zero_celsius + long_name = temperature at 0 degrees Celsius + units = K + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[delt] + standard_name = time_step_for_physics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ntk] + standard_name = index_for_turbulent_kinetic_energy_convective_transport_tracer + long_name = index for turbulent kinetic energy in the convectively transported tracer array + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntr] + standard_name = number_of_tracers_for_samf + long_name = number of tracers for scale-aware mass flux schemes + units = count + dimensions = () + type = integer + intent = in + optional = F +[delp] + standard_name = air_pressure_difference_between_midlayers + long_name = pres(k) - pres(k+1) + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslp] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[psp] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[phil] + standard_name = geopotential + long_name = layer geopotential + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qtr] + standard_name = convective_transportable_tracers + long_name = array to contain cloud water and other convective trans. tracers + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers_for_convective_transport) + type = real + kind = kind_phys + intent = inout + optional = F +[q1] + standard_name = water_vapor_specific_humidity_updated_by_physics + long_name = updated vapor specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[t1] + standard_name = air_temperature_updated_by_physics + long_name = updated temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[u1] + standard_name = x_wind_updated_by_physics + long_name = updated x-direction wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[v1] + standard_name = y_wind_updated_by_physics + long_name = updated y-direction wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rn] + standard_name = lwe_thickness_of_shallow_convective_precipitation_amount + long_name = shallow convective rainfall amount on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[kbot] + standard_name = vertical_index_at_cloud_base + long_name = index at cloud base + units = index + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[ktop] + standard_name = vertical_index_at_cloud_top + long_name = index at cloud top + units = index + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[kcnv] + standard_name = flag_deep_convection + long_name = deep convection: 0=no, 1=yes + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = inout + optional = F +[islimsk] + standard_name = sea_land_ice_mask + long_name = landmask: sea/land/ice=0/1/2 + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[garea] + standard_name = cell_area + long_name = grid cell area + units = m2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dot] + standard_name = omega + long_name = layer mean vertical velocity + units = Pa s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ncloud] + standard_name = number_of_hydrometeors + long_name = number of hydrometeors + units = count + dimensions = () + type = integer + intent = in + optional = F +[hpbl] + standard_name = atmosphere_boundary_layer_thickness + long_name = PBL top height + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ud_mf] + standard_name = instantaneous_atmosphere_updraft_convective_mass_flux + long_name = (updraft mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dt_mf] + standard_name = instantaneous_atmosphere_detrainment_convective_mass_flux + long_name = (detrainment mass flux) * delt + units = kg m-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cnvw] + standard_name = convective_cloud_water_mixing_ratio + long_name = moist convective cloud water mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[cnvc] + standard_name = convective_cloud_cover + long_name = convective cloud cover + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[clam] + standard_name = entrainment_rate_coefficient_shallow_convection + long_name = entrainment rate coefficient for shal conv. + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[c0s] + standard_name = rain_conversion_parameter_shallow_convection + long_name = convective rain conversion parameter for shal conv. + units = m-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[c1] + standard_name = detrainment_conversion_parameter_shallow_convection + long_name = convective detrainment conversion parameter for shal conv. + units = m-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[pgcon] + standard_name = momentum_transport_reduction_factor_pgf_shallow_convection + long_name = reduction factor in momentum transport due to shal conv. induced pressure gradient force + units = frac + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[asolfac] + standard_name = aerosol_aware_parameter_shallow_convection + long_name = aerosol-aware parameter inversely proportional to CCN number concentraion from Lim (2011) for shal conv. + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = samfshalcnv_post_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[lssav] + standard_name = flag_diagnostics + long_name = logical flag for storing diagnostics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[shcnvcw] + standard_name = flag_shallow_convective_cloud + long_name = flag for shallow convective cloud + units = + dimensions = () + type = logical + intent = in + optional = F +[frain] + standard_name = dynamics_to_physics_timestep_ratio + long_name = ratio of dynamics timestep to physics timestep + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rain1] + standard_name = lwe_thickness_of_shallow_convective_precipitation_amount + long_name = shallow convective rainfall amount on physics timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[npdf3d] + standard_name = number_of_3d_arrays_associated_with_pdf_based_clouds + long_name = number of 3d arrays associated with pdf based clouds/mp + units = count + dimensions = () + type = integer + intent = in + optional = F +[num_p3d] + standard_name = array_dimension_of_3d_arrays_for_microphysics + long_name = number of 3D arrays needed for microphysics + units = count + dimensions = () + type = integer + intent = in + optional = F +[ncnvcld3d] + standard_name = number_of_convective_3d_cloud_fields + long_name = number of convective 3d clouds fields + units = count + dimensions = () + type = integer + intent = in + optional = F +[cnvc] + standard_name = convective_cloud_cover + long_name = convective cloud cover + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cnvw] + standard_name = convective_cloud_water_mixing_ratio + long_name = moist convective cloud water mixing ratio + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rainc] + standard_name = lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep + long_name = convective rain at this time step + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnvprcp] + standard_name = cumulative_lwe_thickness_of_convective_precipitation_amount + long_name = cumulative convective precipitation + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnvprcpb] + standard_name = cumulative_lwe_thickness_of_convective_precipitation_amount_in_bucket + long_name = cumulative convective precipitation in bucket + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnvw_phy_f3d] + standard_name = convective_cloud_water_mixing_ratio_in_phy_f3d + long_name = convective cloud water mixing ratio in the phy_f3d array + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cnvc_phy_f3d] + standard_name = convective_cloud_cover_in_phy_f3d + long_name = convective cloud cover in the phy_f3d array + units = frac + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = sasas_shal_post_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = sasas_shal_post_finalize + type = scheme diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F index d4e909f0c..4b308dd55 100644 --- a/physics/satmedmfvdif.F +++ b/physics/satmedmfvdif.F @@ -18,68 +18,7 @@ end subroutine satmedmfvdif_finalize !! scale-aware TKE-based moist eddy-diffusion mass-flux (TKE-EDMF) scheme. !! !> \section arg_table_satmedmfvdif_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | ntrac | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | tracer index for cloud condensate (or liquid water) | index | 0 | integer | | in | F | -!! | ntiw | index_for_ice_cloud_condensate_vertical_diffusion_tracer | tracer index for ice water in the vertically diffused tracer array | index | 0 | integer | | in | F | -!! | ntke | index_for_turbulent_kinetic_energy_vertical_diffusion_tracer | index for turbulent kinetic energy in the vertically diffused tracer array | index | 0 | integer | | in | F | -!! | grav | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | hfus | latent_heat_of_fusion_of_water_at_0C | latent heat of fusion | J kg-1 | 0 | real | kind_phys | in | F | -!! | fv | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | eps | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | -!! | epsm1 | ratio_of_dry_air_to_water_vapor_gas_constants_minus_one | (rd/rv) - 1 | none | 0 | real | kind_phys | in | F | -!! | dv | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | du | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | tdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | -!! | rtg | tendency_of_vertically_diffused_tracer_concentration | updated tendency of the tracers due to vertical diffusion in PBL scheme | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | -!! | u1 | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | v1 | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | t1 | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | -!! | q1 | vertically_diffused_tracer_concentration | tracer concentration diffused by PBL scheme | kg kg-1 | 3 | real | kind_phys | in | F | -!! | swh | tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step | total sky shortwave heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | hlw | tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step | total sky longwave heating rate | K s-1 | 2 | real | kind_phys | in | F | -!! | xmu | zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes | zenith angle temporal adjustment factor for shortwave | none | 1 | real | kind_phys | in | F | -!! | garea | cell_area | area of the grid cell | m2 | 1 | real | kind_phys | in | F | -!! | psk | dimensionless_exner_function_at_lowest_model_interface | dimensionless Exner function at the surface interface | none | 1 | real | kind_phys | in | F | -!! | rbsoil | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | -!! | u10m | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | fm | Monin_Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | -!! | fh | Monin_Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | -!! | tsea | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | -!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | -!! | spd1 | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | -!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | pres(k) - pres(k+1) | Pa | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | prslk | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | delt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | -!! | dspheat | flag_TKE_dissipation_heating | flag for using TKE dissipation heating | flag | 0 | logical | | in | F | -!! | dusfc | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dvsfc | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | -!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | in | F | -!! | xkzm_m | atmosphere_momentum_diffusivity_background | background value of momentum diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | -!! | xkzm_h | atmosphere_heat_diffusivity_background | background value of heat diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | -!! | xkzm_s | diffusivity_background_sigma_level | sigma level threshold for background diffusivity | none | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude satmedmfvdif_run.html !! !!\section gen_satmedmfvdif GFS satmedmfvdif General Algorithm !! satmedmfvdif_run() computes subgrid vertical turbulence mixing diff --git a/physics/satmedmfvdif.meta b/physics/satmedmfvdif.meta new file mode 100644 index 000000000..7f21e58e1 --- /dev/null +++ b/physics/satmedmfvdif.meta @@ -0,0 +1,532 @@ +[ccpp-arg-table] + name = satmedmfvdif_run + type = scheme +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntrac] + standard_name = number_of_vertical_diffusion_tracers + long_name = number of tracers to diffuse vertically + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntcw] + standard_name = index_for_liquid_cloud_condensate + long_name = tracer index for cloud condensate (or liquid water) + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntiw] + standard_name = index_for_ice_cloud_condensate_vertical_diffusion_tracer + long_name = tracer index for ice water in the vertically diffused tracer array + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntke] + standard_name = index_for_turbulent_kinetic_energy_vertical_diffusion_tracer + long_name = index for turbulent kinetic energy in the vertically diffused tracer array + units = index + dimensions = () + type = integer + intent = in + optional = F +[grav] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rv] + standard_name = gas_constant_water_vapor + long_name = ideal gas constant for water vapor + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hfus] + standard_name = latent_heat_of_fusion_of_water_at_0C + long_name = latent heat of fusion + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[fv] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[eps] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[epsm1] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one + long_name = (rd/rv) - 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dv] + standard_name = tendency_of_y_wind_due_to_model_physics + long_name = updated tendency of the y wind + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[du] + standard_name = tendency_of_x_wind_due_to_model_physics + long_name = updated tendency of the x wind + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tdt] + standard_name = tendency_of_air_temperature_due_to_model_physics + long_name = updated tendency of the temperature + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rtg] + standard_name = tendency_of_vertically_diffused_tracer_concentration + long_name = updated tendency of the tracers due to vertical diffusion in PBL scheme + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_vertical_diffusion_tracers) + type = real + kind = kind_phys + intent = inout + optional = F +[u1] + standard_name = x_wind + long_name = x component of layer wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v1] + standard_name = y_wind + long_name = y component of layer wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t1] + standard_name = air_temperature + long_name = layer mean air temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q1] + standard_name = vertically_diffused_tracer_concentration + long_name = tracer concentration diffused by PBL scheme + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_vertical_diffusion_tracers) + type = real + kind = kind_phys + intent = in + optional = F +[swh] + standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step + long_name = total sky shortwave heating rate + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[hlw] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step + long_name = total sky longwave heating rate + units = K s-1 + dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = in + optional = F +[xmu] + standard_name = zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes + long_name = zenith angle temporal adjustment factor for shortwave + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[garea] + standard_name = cell_area + long_name = area of the grid cell + units = m2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[psk] + standard_name = dimensionless_exner_function_at_lowest_model_interface + long_name = dimensionless Exner function at the surface interface + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rbsoil] + standard_name = bulk_richardson_number_at_lowest_model_level + long_name = bulk Richardson number at the surface + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zorl] + standard_name = surface_roughness_length + long_name = surface roughness length in cm + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[u10m] + standard_name = x_wind_at_10m + long_name = x component of wind at 10 m + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v10m] + standard_name = y_wind_at_10m + long_name = y component of wind at 10 m + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fm] + standard_name = Monin_Obukhov_similarity_function_for_momentum + long_name = Monin-Obukhov similarity function for momentum + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fh] + standard_name = Monin_Obukhov_similarity_function_for_heat + long_name = Monin-Obukhov similarity function for heat + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsea] + standard_name = surface_skin_temperature + long_name = surface skin temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[heat] + standard_name = kinematic_surface_upward_sensible_heat_flux + long_name = kinematic surface upward sensible heat flux + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux + long_name = kinematic surface upward latent heat flux + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[stress] + standard_name = surface_wind_stress + long_name = surface wind stress + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[spd1] + standard_name = wind_speed_at_lowest_model_layer + long_name = wind speed at lowest model level + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[kpbl] + standard_name = vertical_index_at_top_of_atmosphere_boundary_layer + long_name = PBL top model level index + units = index + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[prsi] + standard_name = air_pressure_at_interface + long_name = air pressure at model layer interfaces + units = Pa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[del] + standard_name = air_pressure_difference_between_midlayers + long_name = pres(k) - pres(k+1) + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslk] + standard_name = dimensionless_exner_function_at_model_layers + long_name = Exner function at layers + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[phii] + standard_name = geopotential_at_interface + long_name = geopotential at model layer interfaces + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[phil] + standard_name = geopotential + long_name = geopotential at model layer centers + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[delt] + standard_name = time_step_for_physics + long_name = time step for physics + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dspheat] + standard_name = flag_TKE_dissipation_heating + long_name = flag for using TKE dissipation heating + units = flag + dimensions = () + type = logical + intent = in + optional = F +[dusfc] + standard_name = instantaneous_surface_x_momentum_flux + long_name = x momentum flux + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dvsfc] + standard_name = instantaneous_surface_y_momentum_flux + long_name = y momentum flux + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dtsfc] + standard_name = instantaneous_surface_upward_sensible_heat_flux + long_name = surface upward sensible heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dqsfc] + standard_name = instantaneous_surface_upward_latent_heat_flux + long_name = surface upward latent heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[hpbl] + standard_name = atmosphere_boundary_layer_thickness + long_name = PBL thickness + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[kinver] + standard_name = index_of_highest_temperature_inversion + long_name = index of highest temperature inversion + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[xkzm_m] + standard_name = atmosphere_momentum_diffusivity_background + long_name = background value of momentum diffusivity + units = m2 s-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[xkzm_h] + standard_name = atmosphere_heat_diffusivity_background + long_name = background value of heat diffusivity + units = m2 s-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[xkzm_s] + standard_name = diffusivity_background_sigma_level + long_name = sigma level threshold for background diffusivity + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/sfc_diag.f b/physics/sfc_diag.f index d025156f4..3c3acf866 100644 --- a/physics/sfc_diag.f +++ b/physics/sfc_diag.f @@ -16,33 +16,7 @@ end subroutine sfc_diag_finalize !> \brief Brief description of the subroutine !! !! \section arg_table_sfc_diag_run Arguments -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|------------------------------------------------------------------------------|-------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | grav | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | eps | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | -!! | epsm1 | ratio_of_dry_air_to_water_vapor_gas_constants_minus_one | (rd/rv) - 1 | none | 0 | real | kind_phys | in | F | -!! | ps | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | u1 | x_wind_at_lowest_model_layer_updated_by_physics | x component of 1st model layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | v1 | y_wind_at_lowest_model_layer_updated_by_physics | y component of 1st model layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | t1 | air_temperature_at_lowest_model_layer_updated_by_physics | 1st model layer air temperature | K | 1 | real | kind_phys | in | F | -!! | q1 | water_vapor_specific_humidity_at_lowest_model_layer_updated_by_physics | 1st model layer specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | surface upward evaporation flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | fm | Monin_Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | -!! | fh | Monin_Obukhov_similarity_function_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | -!! | fm10 | Monin_Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | -!! | fh2 | Monin_Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | -!! | tskin | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | -!! | qsurf | surface_specific_humidity | surface specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | f10m | ratio_of_wind_at_lowest_model_layer_and_wind_at_10m | ratio of fm10 and fm | ratio | 1 | real | kind_phys | out | F | -!! | u10m | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | out | F | -!! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | out | F | -!! | t2m | temperature_at_2m | temperature at 2 m | K | 1 | real | kind_phys | out | F | -!! | q2m | specific_humidity_at_2m | specific humidity at 2 m | kg kg-1 | 1 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude sfc_diag_run.html !! !! \section general General Algorithm !! \section detailed Detailed Algorithm diff --git a/physics/sfc_diag.meta b/physics/sfc_diag.meta new file mode 100644 index 000000000..0e9699faf --- /dev/null +++ b/physics/sfc_diag.meta @@ -0,0 +1,226 @@ +[ccpp-arg-table] + name = sfc_diag_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[grav] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[eps] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[epsm1] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one + long_name = (rd/rv) - 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ps] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[u1] + standard_name = x_wind_at_lowest_model_layer_updated_by_physics + long_name = x component of 1st model layer wind + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v1] + standard_name = y_wind_at_lowest_model_layer_updated_by_physics + long_name = y component of 1st model layer wind + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t1] + standard_name = air_temperature_at_lowest_model_layer_updated_by_physics + long_name = 1st model layer air temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q1] + standard_name = water_vapor_specific_humidity_at_lowest_model_layer_updated_by_physics + long_name = 1st model layer specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslki] + standard_name = ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer + long_name = Exner function ratio bt midlayer and interface at 1st layer + units = ratio + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux + long_name = surface upward evaporation flux + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fm] + standard_name = Monin_Obukhov_similarity_function_for_momentum + long_name = Monin-Obukhov similarity parameter for momentum + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fh] + standard_name = Monin_Obukhov_similarity_function_for_heat + long_name = Monin-Obukhov similarity parameter for heat + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fm10] + standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m + long_name = Monin-Obukhov similarity parameter for momentum + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fh2] + standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m + long_name = Monin-Obukhov similarity parameter for heat + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tskin] + standard_name = surface_skin_temperature + long_name = surface skin temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qsurf] + standard_name = surface_specific_humidity + long_name = surface specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[f10m] + standard_name = ratio_of_wind_at_lowest_model_layer_and_wind_at_10m + long_name = ratio of fm10 and fm + units = ratio + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[u10m] + standard_name = x_wind_at_10m + long_name = x component of wind at 10 m + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[v10m] + standard_name = y_wind_at_10m + long_name = y component of wind at 10 m + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[t2m] + standard_name = temperature_at_2m + long_name = temperature at 2 m + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[q2m] + standard_name = specific_humidity_at_2m + long_name = specific humidity at 2 m + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/sfc_diag_post.F90 b/physics/sfc_diag_post.F90 index 80c90eadb..90be138f5 100644 --- a/physics/sfc_diag_post.F90 +++ b/physics/sfc_diag_post.F90 @@ -12,28 +12,7 @@ subroutine sfc_diag_post_finalize() end subroutine sfc_diag_post_finalize #if 0 !> \section arg_table_sfc_diag_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|---------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|-------------|------|------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | -!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | -!! | con_eps | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | -!! | con_epsm1 | ratio_of_dry_air_to_water_vapor_gas_constants_minus_one | (rd/rv) - 1 | none | 0 | real | kind_phys | in | F | -!! | pgr | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | t2m | temperature_at_2m | 2 meter temperature | K | 1 | real | kind_phys | in | F | -!! | q2m | specific_humidity_at_2m | 2 meter specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | u10m | x_wind_at_10m | 10 meter u wind speed | m s-1 | 1 | real | kind_phys | in | F | -!! | v10m | y_wind_at_10m | 10 meter v wind speed | m s-1 | 1 | real | kind_phys | in | F | -!! | tmpmin | minimum_temperature_at_2m | min temperature at 2m height | K | 1 | real | kind_phys | inout | F | -!! | tmpmax | maximum_temperature_at_2m | max temperature at 2m height | K | 1 | real | kind_phys | inout | F | -!! | spfhmin | minimum_specific_humidity_at_2m | minimum specific humidity at 2m height | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | spfhmax | maximum_specific_humidity_at_2m | maximum specific humidity at 2m height | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | wind10mmax | maximum_wind_at_10m | maximum wind speed at 10 m | m s-1 | 1 | real | kind_phys | inout | F | -!! | u10mmax | maximum_x_wind_at_10m | maximum x wind at 10 m | m s-1 | 1 | real | kind_phys | inout | F | -!! | v10mmax | maximum_y_wind_at_10m | maximum y wind at 10 m | m s-1 | 1 | real | kind_phys | inout | F | -!! | dpt2m | dewpoint_temperature_at_2m | 2 meter dewpoint temperature | K | 1 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude sfc_diag_post_run.html !! #endif subroutine sfc_diag_post_run (im, lssav, dtf, con_eps, con_epsm1, pgr, & diff --git a/physics/sfc_diag_post.meta b/physics/sfc_diag_post.meta new file mode 100644 index 000000000..8b519cdb7 --- /dev/null +++ b/physics/sfc_diag_post.meta @@ -0,0 +1,180 @@ +[ccpp-arg-table] + name = sfc_diag_post_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[lssav] + standard_name = flag_diagnostics + long_name = logical flag for storing diagnostics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[dtf] + standard_name = time_step_for_dynamics + long_name = dynamics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_eps] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_epsm1] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one + long_name = (rd/rv) - 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[pgr] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t2m] + standard_name = temperature_at_2m + long_name = 2 meter temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q2m] + standard_name = specific_humidity_at_2m + long_name = 2 meter specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[u10m] + standard_name = x_wind_at_10m + long_name = 10 meter u wind speed + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v10m] + standard_name = y_wind_at_10m + long_name = 10 meter v wind speed + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tmpmin] + standard_name = minimum_temperature_at_2m + long_name = min temperature at 2m height + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tmpmax] + standard_name = maximum_temperature_at_2m + long_name = max temperature at 2m height + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[spfhmin] + standard_name = minimum_specific_humidity_at_2m + long_name = minimum specific humidity at 2m height + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[spfhmax] + standard_name = maximum_specific_humidity_at_2m + long_name = maximum specific humidity at 2m height + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[wind10mmax] + standard_name = maximum_wind_at_10m + long_name = maximum wind speed at 10 m + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[u10mmax] + standard_name = maximum_x_wind_at_10m + long_name = maximum x wind at 10 m + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[v10mmax] + standard_name = maximum_y_wind_at_10m + long_name = maximum y wind at 10 m + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dpt2m] + standard_name = dewpoint_temperature_at_2m + long_name = 2 meter dewpoint temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 9c00fa376..b57916518 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -32,78 +32,7 @@ end subroutine sfc_diff_finalize !! based on the surface sublayer scheme in !! Zeng and Dickinson (1998) \cite zeng_and_dickinson_1998. !> \section arg_table_sfc_diff_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|------------------------------------------------------------------------------|------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | rvrdm1 | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | eps | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | -!! | epsm1 | ratio_of_dry_air_to_water_vapor_gas_constants_minus_one | (rd/rv) - 1 | none | 0 | real | kind_phys | in | F | -!! | grav | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | ps | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | u1 | x_wind_at_lowest_model_layer | x component of 1st model layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | v1 | y_wind_at_lowest_model_layer | y component of 1st model layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | t1 | air_temperature_at_lowest_model_layer | 1st model layer air temperature | K | 1 | real | kind_phys | in | F | -!! | q1 | water_vapor_specific_humidity_at_lowest_model_layer | 1st model layer specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | z1 | height_above_ground_at_lowest_model_layer | height above ground at 1st model layer | m | 1 | real | kind_phys | in | F | -!! | prsl1 | air_pressure_at_lowest_model_layer | Model layer 1 mean pressure | Pa | 1 | real | kind_phys | in | F | -!! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | -!! | ddvel | surface_wind_enhancement_due_to_convection | surface wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | -!! | sigmaf | bounded_vegetation_area_fraction | areal fractional cover of green vegetation bounded on the bottom | frac | 1 | real | kind_phys | in | F | -!! | vegtype | vegetation_type_classification | vegetation type at each grid cell | index | 1 | integer | | in | F | -!! | shdmax | maximum_vegetation_area_fraction | max fractnl cover of green veg | frac | 1 | real | kind_phys | in | F | -!! | ivegsrc | vegetation_type_dataset_choice | land use dataset choice | index | 0 | integer | | in | F | -!! | z0pert | perturbation_of_momentum_roughness_length | perturbation of momentum roughness length | frac | 1 | real | kind_phys | in | F | -!! | ztpert | perturbation_of_heat_to_momentum_roughness_length_ratio | perturbation of heat to momentum roughness length ratio | frac | 1 | real | kind_phys | in | F | -!! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | -!! | redrag | flag_for_reduced_drag_coefficient_over_sea | flag for reduced drag coefficient over sea | flag | 0 | logical | | in | F | -!! | u10m | x_wind_at_10m | 10 meter u wind speed | m s-1 | 1 | real | kind_phys | in | F | -!! | v10m | y_wind_at_10m | 10 meter v wind speed | m s-1 | 1 | real | kind_phys | in | F | -!! | sfc_z0_type | flag_for_surface_roughness_option_over_ocean | surface roughness options over ocean | flag | 0 | integer | | in | F | -!! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | -!! | dry | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | -!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | -!! | tskin_ocn | surface_skin_temperature_over_ocean_interstitial | surface skin temperature over ocean (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | -!! | tskin_lnd | surface_skin_temperature_over_land_interstitial | surface skin temperature over land (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | -!! | tskin_ice | surface_skin_temperature_over_ice_interstitial | surface skin temperature over ice (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | -!! | tsurf_ocn | surface_skin_temperature_after_iteration_over_ocean | surface skin temperature after iteration over ocean | K | 1 | real | kind_phys | in | F | -!! | tsurf_lnd | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | in | F | -!! | tsurf_ice | surface_skin_temperature_after_iteration_over_ice | surface skin temperature after iteration over ice | K | 1 | real | kind_phys | in | F | -!! | snwdph_ocn | surface_snow_thickness_water_equivalent_over_ocean | water equivalent snow depth over ocean | mm | 1 | real | kind_phys | in | F | -!! | snwdph_lnd | surface_snow_thickness_water_equivalent_over_land | water equivalent snow depth over land | mm | 1 | real | kind_phys | in | F | -!! | snwdph_ice | surface_snow_thickness_water_equivalent_over_ice | water equivalent snow depth over ice | mm | 1 | real | kind_phys | in | F | -!! | z0rl_ocn | surface_roughness_length_over_ocean_interstitial | surface roughness length over ocean (temporary use as interstitial) | cm | 1 | real | kind_phys | inout | F | -!! | z0rl_lnd | surface_roughness_length_over_land_interstitial | surface roughness length over land (temporary use as interstitial) | cm | 1 | real | kind_phys | inout | F | -!! | z0rl_ice | surface_roughness_length_over_ice_interstitial | surface roughness length over ice (temporary use as interstitial) | cm | 1 | real | kind_phys | inout | F | -!! | ustar_ocn | surface_friction_velocity_over_ocean | surface friction velocity over ocean | m s-1 | 1 | real | kind_phys | inout | F | -!! | ustar_lnd | surface_friction_velocity_over_land | surface friction velocity over land | m s-1 | 1 | real | kind_phys | inout | F | -!! | ustar_ice | surface_friction_velocity_over_ice | surface friction velocity over ice | m s-1 | 1 | real | kind_phys | inout | F | -!! | cm_ocn | surface_drag_coefficient_for_momentum_in_air_over_ocean | surface exchange coeff for momentum over ocean | none | 1 | real | kind_phys | inout | F | -!! | cm_lnd | surface_drag_coefficient_for_momentum_in_air_over_land | surface exchange coeff for momentum over land | none | 1 | real | kind_phys | inout | F | -!! | cm_ice | surface_drag_coefficient_for_momentum_in_air_over_ice | surface exchange coeff for momentum over ice | none | 1 | real | kind_phys | inout | F | -!! | ch_ocn | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ocean | surface exchange coeff heat & moisture over ocean | none | 1 | real | kind_phys | inout | F | -!! | ch_lnd | surface_drag_coefficient_for_heat_and_moisture_in_air_over_land | surface exchange coeff heat & moisture over land | none | 1 | real | kind_phys | inout | F | -!! | ch_ice | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice | surface exchange coeff heat & moisture over ice | none | 1 | real | kind_phys | inout | F | -!! | rb_ocn | bulk_richardson_number_at_lowest_model_level_over_ocean | bulk Richardson number at the surface over ocean | none | 1 | real | kind_phys | inout | F | -!! | rb_lnd | bulk_richardson_number_at_lowest_model_level_over_land | bulk Richardson number at the surface over land | none | 1 | real | kind_phys | inout | F | -!! | rb_ice | bulk_richardson_number_at_lowest_model_level_over_ice | bulk Richardson number at the surface over ice | none | 1 | real | kind_phys | inout | F | -!! | stress_ocn | surface_wind_stress_over_ocean | surface wind stress over ocean | m2 s-2 | 1 | real | kind_phys | inout | F | -!! | stress_lnd | surface_wind_stress_over_land | surface wind stress over land | m2 s-2 | 1 | real | kind_phys | inout | F | -!! | stress_ice | surface_wind_stress_over_ice | surface wind stress over ice | m2 s-2 | 1 | real | kind_phys | inout | F | -!! | fm_ocn | Monin_Obukhov_similarity_function_for_momentum_over_ocean | Monin-Obukhov similarity function for momentum over ocean | none | 1 | real | kind_phys | inout | F | -!! | fm_lnd | Monin_Obukhov_similarity_function_for_momentum_over_land | Monin-Obukhov similarity function for momentum over land | none | 1 | real | kind_phys | inout | F | -!! | fm_ice | Monin_Obukhov_similarity_function_for_momentum_over_ice | Monin-Obukhov similarity function for momentum over ice | none | 1 | real | kind_phys | inout | F | -!! | fh_ocn | Monin_Obukhov_similarity_function_for_heat_over_ocean | Monin-Obukhov similarity function for heat over ocean | none | 1 | real | kind_phys | inout | F | -!! | fh_lnd | Monin_Obukhov_similarity_function_for_heat_over_land | Monin-Obukhov similarity function for heat over land | none | 1 | real | kind_phys | inout | F | -!! | fh_ice | Monin_Obukhov_similarity_function_for_heat_over_ice | Monin-Obukhov similarity function for heat over ice | none | 1 | real | kind_phys | inout | F | -!! | fm10_ocn | Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ocean | Monin-Obukhov similarity parameter for momentum at 10m over ocean | none | 1 | real | kind_phys | inout | F | -!! | fm10_lnd | Monin_Obukhov_similarity_function_for_momentum_at_10m_over_land | Monin-Obukhov similarity parameter for momentum at 10m over land | none | 1 | real | kind_phys | inout | F | -!! | fm10_ice | Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ice | Monin-Obukhov similarity parameter for momentum at 10m over ice | none | 1 | real | kind_phys | inout | F | -!! | fh2_ocn | Monin_Obukhov_similarity_function_for_heat_at_2m_over_ocean | Monin-Obukhov similarity parameter for heat at 2m over ocean | none | 1 | real | kind_phys | inout | F | -!! | fh2_lnd | Monin_Obukhov_similarity_function_for_heat_at_2m_over_land | Monin-Obukhov similarity parameter for heat at 2m over land | none | 1 | real | kind_phys | inout | F | -!! | fh2_ice | Monin_Obukhov_similarity_function_for_heat_at_2m_over_ice | Monin-Obukhov similarity parameter for heat at 2m over ice | none | 1 | real | kind_phys | inout | F | -!! | wind | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude sfc_diff_run.html !! !> \section general_diff GFS Surface Layer Scheme General Algorithm !! - Calculate the thermal roughness length formulation over the ocean (see eq. (25) and (26) diff --git a/physics/sfc_diff.meta b/physics/sfc_diff.meta new file mode 100644 index 000000000..31e7915a2 --- /dev/null +++ b/physics/sfc_diff.meta @@ -0,0 +1,623 @@ +[ccpp-arg-table] + name = sfc_diff_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[rvrdm1] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[eps] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[epsm1] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one + long_name = (rd/rv) - 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[grav] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ps] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[u1] + standard_name = x_wind_at_lowest_model_layer + long_name = x component of 1st model layer wind + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v1] + standard_name = y_wind_at_lowest_model_layer + long_name = y component of 1st model layer wind + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t1] + standard_name = air_temperature_at_lowest_model_layer + long_name = 1st model layer air temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q1] + standard_name = water_vapor_specific_humidity_at_lowest_model_layer + long_name = 1st model layer specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[z1] + standard_name = height_above_ground_at_lowest_model_layer + long_name = height above ground at 1st model layer + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl1] + standard_name = air_pressure_at_lowest_model_layer + long_name = Model layer 1 mean pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslki] + standard_name = ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer + long_name = Exner function ratio bt midlayer and interface at 1st layer + units = ratio + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ddvel] + standard_name = surface_wind_enhancement_due_to_convection + long_name = surface wind enhancement due to convection + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sigmaf] + standard_name = bounded_vegetation_area_fraction + long_name = areal fractional cover of green vegetation bounded on the bottom + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[vegtype] + standard_name = vegetation_type_classification + long_name = vegetation type at each grid cell + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[shdmax] + standard_name = maximum_vegetation_area_fraction + long_name = max fractnl cover of green veg + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ivegsrc] + standard_name = vegetation_type_dataset_choice + long_name = land use dataset choice + units = index + dimensions = () + type = integer + intent = in + optional = F +[z0pert] + standard_name = perturbation_of_momentum_roughness_length + long_name = perturbation of momentum roughness length + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ztpert] + standard_name = perturbation_of_heat_to_momentum_roughness_length_ratio + long_name = perturbation of heat to momentum roughness length ratio + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[flag_iter] + standard_name = flag_for_iteration + long_name = flag for iteration + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[redrag] + standard_name = flag_for_reduced_drag_coefficient_over_sea + long_name = flag for reduced drag coefficient over sea + units = flag + dimensions = () + type = logical + intent = in + optional = F +[u10m] + standard_name = x_wind_at_10m + long_name = 10 meter u wind speed + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v10m] + standard_name = y_wind_at_10m + long_name = 10 meter v wind speed + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfc_z0_type] + standard_name = flag_for_surface_roughness_option_over_ocean + long_name = surface roughness options over ocean + units = flag + dimensions = () + type = integer + intent = in + optional = F +[wet] + standard_name = flag_nonzero_wet_surface_fraction + long_name = flag indicating presence of some ocean or lake surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[dry] + standard_name = flag_nonzero_land_surface_fraction + long_name = flag indicating presence of some land surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[icy] + standard_name = flag_nonzero_sea_ice_surface_fraction + long_name = flag indicating presence of some sea ice surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[tskin_ocn] + standard_name = surface_skin_temperature_over_ocean_interstitial + long_name = surface skin temperature over ocean (temporary use as interstitial) + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tskin_lnd] + standard_name = surface_skin_temperature_over_land_interstitial + long_name = surface skin temperature over land (temporary use as interstitial) + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tskin_ice] + standard_name = surface_skin_temperature_over_ice_interstitial + long_name = surface skin temperature over ice (temporary use as interstitial) + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsurf_ocn] + standard_name = surface_skin_temperature_after_iteration_over_ocean + long_name = surface skin temperature after iteration over ocean + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsurf_lnd] + standard_name = surface_skin_temperature_after_iteration_over_land + long_name = surface skin temperature after iteration over land + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsurf_ice] + standard_name = surface_skin_temperature_after_iteration_over_ice + long_name = surface skin temperature after iteration over ice + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snwdph_ocn] + standard_name = surface_snow_thickness_water_equivalent_over_ocean + long_name = water equivalent snow depth over ocean + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snwdph_lnd] + standard_name = surface_snow_thickness_water_equivalent_over_land + long_name = water equivalent snow depth over land + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snwdph_ice] + standard_name = surface_snow_thickness_water_equivalent_over_ice + long_name = water equivalent snow depth over ice + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[z0rl_ocn] + standard_name = surface_roughness_length_over_ocean_interstitial + long_name = surface roughness length over ocean (temporary use as interstitial) + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[z0rl_lnd] + standard_name = surface_roughness_length_over_land_interstitial + long_name = surface roughness length over land (temporary use as interstitial) + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[z0rl_ice] + standard_name = surface_roughness_length_over_ice_interstitial + long_name = surface roughness length over ice (temporary use as interstitial) + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ustar_ocn] + standard_name = surface_friction_velocity_over_ocean + long_name = surface friction velocity over ocean + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ustar_lnd] + standard_name = surface_friction_velocity_over_land + long_name = surface friction velocity over land + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ustar_ice] + standard_name = surface_friction_velocity_over_ice + long_name = surface friction velocity over ice + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cm_ocn] + standard_name = surface_drag_coefficient_for_momentum_in_air_over_ocean + long_name = surface exchange coeff for momentum over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cm_lnd] + standard_name = surface_drag_coefficient_for_momentum_in_air_over_land + long_name = surface exchange coeff for momentum over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cm_ice] + standard_name = surface_drag_coefficient_for_momentum_in_air_over_ice + long_name = surface exchange coeff for momentum over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ch_ocn] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_ocean + long_name = surface exchange coeff heat & moisture over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ch_lnd] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_land + long_name = surface exchange coeff heat & moisture over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ch_ice] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice + long_name = surface exchange coeff heat & moisture over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rb_ocn] + standard_name = bulk_richardson_number_at_lowest_model_level_over_ocean + long_name = bulk Richardson number at the surface over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rb_lnd] + standard_name = bulk_richardson_number_at_lowest_model_level_over_land + long_name = bulk Richardson number at the surface over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rb_ice] + standard_name = bulk_richardson_number_at_lowest_model_level_over_ice + long_name = bulk Richardson number at the surface over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[stress_ocn] + standard_name = surface_wind_stress_over_ocean + long_name = surface wind stress over ocean + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[stress_lnd] + standard_name = surface_wind_stress_over_land + long_name = surface wind stress over land + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[stress_ice] + standard_name = surface_wind_stress_over_ice + long_name = surface wind stress over ice + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fm_ocn] + standard_name = Monin_Obukhov_similarity_function_for_momentum_over_ocean + long_name = Monin-Obukhov similarity function for momentum over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fm_lnd] + standard_name = Monin_Obukhov_similarity_function_for_momentum_over_land + long_name = Monin-Obukhov similarity function for momentum over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fm_ice] + standard_name = Monin_Obukhov_similarity_function_for_momentum_over_ice + long_name = Monin-Obukhov similarity function for momentum over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fh_ocn] + standard_name = Monin_Obukhov_similarity_function_for_heat_over_ocean + long_name = Monin-Obukhov similarity function for heat over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fh_lnd] + standard_name = Monin_Obukhov_similarity_function_for_heat_over_land + long_name = Monin-Obukhov similarity function for heat over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fh_ice] + standard_name = Monin_Obukhov_similarity_function_for_heat_over_ice + long_name = Monin-Obukhov similarity function for heat over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fm10_ocn] + standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ocean + long_name = Monin-Obukhov similarity parameter for momentum at 10m over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fm10_lnd] + standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m_over_land + long_name = Monin-Obukhov similarity parameter for momentum at 10m over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fm10_ice] + standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ice + long_name = Monin-Obukhov similarity parameter for momentum at 10m over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fh2_ocn] + standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m_over_ocean + long_name = Monin-Obukhov similarity parameter for heat at 2m over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fh2_lnd] + standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m_over_land + long_name = Monin-Obukhov similarity parameter for heat at 2m over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fh2_ice] + standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m_over_ice + long_name = Monin-Obukhov similarity parameter for heat at 2m over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[wind] + standard_name = wind_speed_at_lowest_model_layer + long_name = wind speed at lowest model level + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/sfc_drv.f b/physics/sfc_drv.f index d521be250..4e27c07f1 100644 --- a/physics/sfc_drv.f +++ b/physics/sfc_drv.f @@ -17,14 +17,7 @@ module lsm_noah !>\ingroup Noah_LSM !! This subroutine contains the CCPP-compliant lsm_noah_init to initialize soil vegetation. !! \section arg_table_lsm_noah_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-------------------------------------------------------------|---------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | isot | soil_type_dataset_choice | soil type dataset choice | index | 0 | integer | | in | F | -!! | ivegsrc | vegetation_type_dataset_choice | land use dataset choice | index | 0 | integer | | in | F | -!! | nlunit | iounit_namelist | fortran unit number for file opens | none | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude lsm_noah_init.html !! subroutine lsm_noah_init(me, isot, ivegsrc, nlunit, & errmsg, errflg) @@ -46,10 +39,7 @@ end subroutine lsm_noah_init !! \section arg_table_lsm_noah_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-------------------------------------------------------------|--------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude lsm_noah_finalize.html !! subroutine lsm_noah_finalize(errmsg, errflg) @@ -176,85 +166,7 @@ end subroutine lsm_noah_finalize !! variables for return to the parent model suite including unit conversion, as well !! as diagnotics calculation. !! \section arg_table_lsm_noah_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | km | soil_vertical_dimension | soil vertical layer dimension | count | 0 | integer | | in | F | -!! | grav | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | eps | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | -!! | epsm1 | ratio_of_dry_air_to_water_vapor_gas_constants_minus_one | (rd/rv) - 1 | none | 0 | real | kind_phys | in | F | -!! | rvrdm1 | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | ps | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | u1 | x_wind_at_lowest_model_layer | x component of 1st model layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | v1 | y_wind_at_lowest_model_layer | y component of 1st model layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | t1 | air_temperature_at_lowest_model_layer | 1st model layer air temperature | K | 1 | real | kind_phys | in | F | -!! | q1 | water_vapor_specific_humidity_at_lowest_model_layer | 1st model layer specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | soiltyp | soil_type_classification | soil type at each grid cell | index | 1 | integer | | in | F | -!! | vegtype | vegetation_type_classification | vegetation type at each grid cell | index | 1 | integer | | in | F | -!! | sigmaf | bounded_vegetation_area_fraction | areal fractional cover of green vegetation bounded on the bottom| frac | 1 | real | kind_phys | in | F | -!! | sfcemis | surface_longwave_emissivity | surface longwave emissivity | frac | 1 | real | kind_phys | in | F | -!! | dlwflx | surface_downwelling_longwave_flux_absorbed_by_ground | total sky surface downward longwave flux absorbed by the ground | W m-2 | 1 | real | kind_phys | in | F | -!! | dswsfc | surface_downwelling_shortwave_flux | total sky surface downward shortwave flux | W m-2 | 1 | real | kind_phys | in | F | -!! | snet | surface_net_downwelling_shortwave_flux | total sky surface net shortwave flux | W m-2 | 1 | real | kind_phys | in | F | -!! | delt | time_step_for_dynamics | dynamics time step | s | 0 | real | kind_phys | in | F | -!! | tg3 | deep_soil_temperature | bottom soil temperature | K | 1 | real | kind_phys | in | F | -!! | cm | surface_drag_coefficient_for_momentum_in_air_over_land | surface exchange coeff for momentum over land | none | 1 | real | kind_phys | in | F | -!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_land | surface exchange coeff heat & moisture over land | none | 1 | real | kind_phys | in | F | -!! | prsl1 | air_pressure_at_lowest_model_layer | Model layer 1 mean pressure | Pa | 1 | real | kind_phys | in | F | -!! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | -!! | zf | height_above_ground_at_lowest_model_layer | height above ground at 1st model layer | m | 1 | real | kind_phys | in | F | -!! | land | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | -!! | ddvel | surface_wind_enhancement_due_to_convection | surface wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | -!! | slopetyp | surface_slope_classification | surface slope type at each grid cell | index | 1 | integer | | in | F | -!! | shdmin | minimum_vegetation_area_fraction | min fractional coverage of green veg | frac | 1 | real | kind_phys | in | F | -!! | shdmax | maximum_vegetation_area_fraction | max fractnl cover of green veg (not used) | frac | 1 | real | kind_phys | in | F | -!! | snoalb | upper_bound_on_max_albedo_over_deep_snow | upper bound on max albedo over deep snow | frac | 1 | real | kind_phys | in | F | -!! | sfalb | surface_diffused_shortwave_albedo | mean surface diffused shortwave albedo | frac | 1 | real | kind_phys | in | F | -!! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | -!! | flag_guess | flag_for_guess_run | flag for guess run | flag | 1 | logical | | in | F | -!! | lheatstrg | flag_for_canopy_heat_storage | flag for canopy heat storage parameterization | flag | 0 | logical | | in | F | -!! | isot | soil_type_dataset_choice | soil type dataset choice | index | 0 | integer | | in | F | -!! | ivegsrc | vegetation_type_dataset_choice | land use dataset choice | index | 0 | integer | | in | F | -!! | bexppert | perturbation_of_soil_type_b_parameter | perturbation of soil type "b" parameter | frac | 1 | real | kind_phys | in | F | -!! | xlaipert | perturbation_of_leaf_area_index | perturbation of leaf area index | frac | 1 | real | kind_phys | in | F | -!! | vegfpert | perturbation_of_vegetation_fraction | perturbation of vegetation fraction | frac | 1 | real | kind_phys | in | F | -!! | pertvegf | magnitude_of_perturbation_of_vegetation_fraction | magnitude of perturbation of vegetation fraction | frac | 1 | real | kind_phys | in | F | -!! | weasd | water_equivalent_accumulated_snow_depth_over_land | water equiv of acc snow depth over land | mm | 1 | real | kind_phys | inout | F | -!! | snwdph | surface_snow_thickness_water_equivalent_over_land | water equivalent snow depth over land | mm | 1 | real | kind_phys | inout | F | -!! | tskin | surface_skin_temperature_over_land_interstitial | surface skin temperature over land (temporary use as interstitial) | K | 1 | real | kind_phys | inout | F | -!! | tprcp | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_land | total precipitation amount in each time step over land | m | 1 | real | kind_phys | inout | F | -!! | srflag | flag_for_precipitation_type | flag for snow or rain precipitation | flag | 1 | real | kind_phys | inout | F | -!! | smc | volume_fraction_of_soil_moisture | volumetric fraction of soil moisture | frac | 2 | real | kind_phys | inout | F | -!! | stc | soil_temperature | soil temperature | K | 2 | real | kind_phys | inout | F | -!! | slc | volume_fraction_of_unfrozen_soil_moisture | volume fraction of unfrozen soil moisture | frac | 2 | real | kind_phys | inout | F | -!! | canopy | canopy_water_amount | canopy moisture content | kg m-2 | 1 | real | kind_phys | inout | F | -!! | trans | transpiration_flux | total plant transpiration rate | W m-2 | 1 | real | kind_phys | inout | F | -!! | tsurf | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | inout | F | -!! | zorl | surface_roughness_length_over_land_interstitial | surface roughness length over land (temporary use as interstitial) | cm | 1 | real | kind_phys | inout | F | -!! | sncovr1 | surface_snow_area_fraction_over_land | surface snow area fraction | frac | 1 | real | kind_phys | inout | F | -!! | qsurf | surface_specific_humidity_over_land | surface air saturation specific humidity over land | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | gflux | upward_heat_flux_in_soil_over_land | soil heat flux over land | W m-2 | 1 | real | kind_phys | inout | F | -!! | drain | subsurface_runoff_flux | subsurface runoff flux | kg m-2 s-1 | 1 | real | kind_phys | inout | F | -!! | evap | kinematic_surface_upward_latent_heat_flux_over_land | kinematic surface upward latent heat flux over land | kg kg-1 m s-1 | 1 | real | kind_phys | inout | F | -!! | hflx | kinematic_surface_upward_sensible_heat_flux_over_land | kinematic surface upward sensible heat flux over land | K m s-1 | 1 | real | kind_phys | inout | F | -!! | ep | surface_upward_potential_latent_heat_flux_over_land | surface upward potential latent heat flux over land | W m-2 | 1 | real | kind_phys | inout | F | -!! | runoff | surface_runoff_flux | surface runoff flux | kg m-2 s-1 | 1 | real | kind_phys | inout | F | -!! | cmm | surface_drag_wind_speed_for_momentum_in_air_over_land | momentum exchange coefficient over land | m s-1 | 1 | real | kind_phys | inout | F | -!! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land | thermal exchange coefficient over land | kg m-2 s-1 | 1 | real | kind_phys | inout | F | -!! | evbs | soil_upward_latent_heat_flux | soil upward latent heat flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | evcw | canopy_upward_latent_heat_flux | canopy upward latent heat flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | sbsno | snow_deposition_sublimation_upward_latent_heat_flux | latent heat flux from snow depo/subl | W m-2 | 1 | real | kind_phys | inout | F | -!! | snowc | surface_snow_area_fraction | surface snow area fraction | frac | 1 | real | kind_phys | inout | F | -!! | stm | soil_moisture_content | soil moisture content | kg m-2 | 1 | real | kind_phys | inout | F | -!! | snohf | snow_freezing_rain_upward_latent_heat_flux | latent heat flux due to snow and frz rain | W m-2 | 1 | real | kind_phys | inout | F | -!! | smcwlt2 | volume_fraction_of_condensed_water_in_soil_at_wilting_point | soil water fraction at wilting point | frac | 1 | real | kind_phys | inout | F | -!! | smcref2 | threshold_volume_fraction_of_condensed_water_in_soil | soil moisture threshold | frac | 1 | real | kind_phys | inout | F | -!! | wet1 | normalized_soil_wetness | normalized soil wetness | frac | 1 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude lsm_noah_run.html !! !> \section general_noah_drv GFS sfc_drv General Algorithm !> @{ diff --git a/physics/sfc_drv.meta b/physics/sfc_drv.meta new file mode 100644 index 000000000..f628c6c27 --- /dev/null +++ b/physics/sfc_drv.meta @@ -0,0 +1,760 @@ +[ccpp-arg-table] + name = lsm_noah_init + type = scheme +[me] + standard_name = mpi_rank + long_name = current MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[isot] + standard_name = soil_type_dataset_choice + long_name = soil type dataset choice + units = index + dimensions = () + type = integer + intent = in + optional = F +[ivegsrc] + standard_name = vegetation_type_dataset_choice + long_name = land use dataset choice + units = index + dimensions = () + type = integer + intent = in + optional = F +[nlunit] + standard_name = iounit_namelist + long_name = fortran unit number for file opens + units = none + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = lsm_noah_finalize + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = lsm_noah_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = soil_vertical_dimension + long_name = soil vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[grav] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[eps] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[epsm1] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one + long_name = (rd/rv) - 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rvrdm1] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ps] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[u1] + standard_name = x_wind_at_lowest_model_layer + long_name = x component of 1st model layer wind + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v1] + standard_name = y_wind_at_lowest_model_layer + long_name = y component of 1st model layer wind + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t1] + standard_name = air_temperature_at_lowest_model_layer + long_name = 1st model layer air temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q1] + standard_name = water_vapor_specific_humidity_at_lowest_model_layer + long_name = 1st model layer specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[soiltyp] + standard_name = soil_type_classification + long_name = soil type at each grid cell + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[vegtype] + standard_name = vegetation_type_classification + long_name = vegetation type at each grid cell + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[sigmaf] + standard_name = bounded_vegetation_area_fraction + long_name = areal fractional cover of green vegetation bounded on the bottom + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcemis] + standard_name = surface_longwave_emissivity + long_name = surface longwave emissivity + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dlwflx] + standard_name = surface_downwelling_longwave_flux_absorbed_by_ground + long_name = total sky surface downward longwave flux absorbed by the ground + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dswsfc] + standard_name = surface_downwelling_shortwave_flux + long_name = total sky surface downward shortwave flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snet] + standard_name = surface_net_downwelling_shortwave_flux + long_name = total sky surface net shortwave flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[delt] + standard_name = time_step_for_dynamics + long_name = dynamics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[tg3] + standard_name = deep_soil_temperature + long_name = bottom soil temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cm] + standard_name = surface_drag_coefficient_for_momentum_in_air_over_land + long_name = surface exchange coeff for momentum over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ch] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_land + long_name = surface exchange coeff heat & moisture over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl1] + standard_name = air_pressure_at_lowest_model_layer + long_name = Model layer 1 mean pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslki] + standard_name = ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer + long_name = Exner function ratio bt midlayer and interface at 1st layer + units = ratio + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zf] + standard_name = height_above_ground_at_lowest_model_layer + long_name = height above ground at 1st model layer + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[land] + standard_name = flag_nonzero_land_surface_fraction + long_name = flag indicating presence of some land surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[ddvel] + standard_name = surface_wind_enhancement_due_to_convection + long_name = surface wind enhancement due to convection + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[slopetyp] + standard_name = surface_slope_classification + long_name = surface slope type at each grid cell + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[shdmin] + standard_name = minimum_vegetation_area_fraction + long_name = min fractional coverage of green veg + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[shdmax] + standard_name = maximum_vegetation_area_fraction + long_name = max fractnl cover of green veg (not used) + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snoalb] + standard_name = upper_bound_on_max_albedo_over_deep_snow + long_name = upper bound on max albedo over deep snow + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfalb] + standard_name = surface_diffused_shortwave_albedo + long_name = mean surface diffused shortwave albedo + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[flag_iter] + standard_name = flag_for_iteration + long_name = flag for iteration + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[flag_guess] + standard_name = flag_for_guess_run + long_name = flag for guess run + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[lheatstrg] + standard_name = flag_for_canopy_heat_storage + long_name = flag for canopy heat storage parameterization + units = flag + dimensions = () + type = logical + intent = in + optional = F +[isot] + standard_name = soil_type_dataset_choice + long_name = soil type dataset choice + units = index + dimensions = () + type = integer + intent = in + optional = F +[ivegsrc] + standard_name = vegetation_type_dataset_choice + long_name = land use dataset choice + units = index + dimensions = () + type = integer + intent = in + optional = F +[bexppert] + standard_name = perturbation_of_soil_type_b_parameter + long_name = perturbation of soil type "b" parameter + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[xlaipert] + standard_name = perturbation_of_leaf_area_index + long_name = perturbation of leaf area index + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[vegfpert] + standard_name = perturbation_of_vegetation_fraction + long_name = perturbation of vegetation fraction + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[pertvegf] + standard_name = magnitude_of_perturbation_of_vegetation_fraction + long_name = magnitude of perturbation of vegetation fraction + units = frac + dimensions = (5) + type = real + kind = kind_phys + intent = in + optional = F +[weasd] + standard_name = water_equivalent_accumulated_snow_depth_over_land + long_name = water equiv of acc snow depth over land + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snwdph] + standard_name = surface_snow_thickness_water_equivalent_over_land + long_name = water equivalent snow depth over land + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tskin] + standard_name = surface_skin_temperature_over_land_interstitial + long_name = surface skin temperature over land (temporary use as interstitial) + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tprcp] + standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_land + long_name = total precipitation amount in each time step over land + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[srflag] + standard_name = flag_for_precipitation_type + long_name = flag for snow or rain precipitation + units = flag + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[smc] + standard_name = volume_fraction_of_soil_moisture + long_name = volumetric fraction of soil moisture + units = frac + dimensions = (horizontal_dimension,soil_vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[stc] + standard_name = soil_temperature + long_name = soil temperature + units = K + dimensions = (horizontal_dimension,soil_vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[slc] + standard_name = volume_fraction_of_unfrozen_soil_moisture + long_name = volume fraction of unfrozen soil moisture + units = frac + dimensions = (horizontal_dimension,soil_vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[canopy] + standard_name = canopy_water_amount + long_name = canopy moisture content + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[trans] + standard_name = transpiration_flux + long_name = total plant transpiration rate + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsurf] + standard_name = surface_skin_temperature_after_iteration_over_land + long_name = surface skin temperature after iteration over land + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[zorl] + standard_name = surface_roughness_length_over_land_interstitial + long_name = surface roughness length over land (temporary use as interstitial) + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[sncovr1] + standard_name = surface_snow_area_fraction_over_land + long_name = surface snow area fraction + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qsurf] + standard_name = surface_specific_humidity_over_land + long_name = surface air saturation specific humidity over land + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gflux] + standard_name = upward_heat_flux_in_soil_over_land + long_name = soil heat flux over land + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[drain] + standard_name = subsurface_runoff_flux + long_name = subsurface runoff flux + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux_over_land + long_name = kinematic surface upward latent heat flux over land + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[hflx] + standard_name = kinematic_surface_upward_sensible_heat_flux_over_land + long_name = kinematic surface upward sensible heat flux over land + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ep] + standard_name = surface_upward_potential_latent_heat_flux_over_land + long_name = surface upward potential latent heat flux over land + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[runoff] + standard_name = surface_runoff_flux + long_name = surface runoff flux + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cmm] + standard_name = surface_drag_wind_speed_for_momentum_in_air_over_land + long_name = momentum exchange coefficient over land + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[chh] + standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land + long_name = thermal exchange coefficient over land + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[evbs] + standard_name = soil_upward_latent_heat_flux + long_name = soil upward latent heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[evcw] + standard_name = canopy_upward_latent_heat_flux + long_name = canopy upward latent heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[sbsno] + standard_name = snow_deposition_sublimation_upward_latent_heat_flux + long_name = latent heat flux from snow depo/subl + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snowc] + standard_name = surface_snow_area_fraction + long_name = surface snow area fraction + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[stm] + standard_name = soil_moisture_content + long_name = soil moisture content + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snohf] + standard_name = snow_freezing_rain_upward_latent_heat_flux + long_name = latent heat flux due to snow and frz rain + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[smcwlt2] + standard_name = volume_fraction_of_condensed_water_in_soil_at_wilting_point + long_name = soil water fraction at wilting point + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[smcref2] + standard_name = threshold_volume_fraction_of_condensed_water_in_soil + long_name = soil moisture threshold + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[wet1] + standard_name = normalized_soil_wetness + long_name = normalized soil wetness + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index ddf03e248..4a614e3dd 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -21,14 +21,7 @@ module lsm_ruc !> This subroutine calls set_soilveg_ruc() to specify vegetation and soil parameters for !! a given soil and land-use classification. !! \section arg_table_lsm_ruc_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-------------------------------------------------------------|---------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | isot | soil_type_dataset_choice | soil type dataset choice | index | 0 | integer | | in | F | -!! | ivegsrc | vegetation_type_dataset_choice | land use dataset choice | index | 0 | integer | | in | F | -!! | nlunit | iounit_namelist | fortran unit number for file opens | none | 0 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude lsm_ruc_init.html !! subroutine lsm_ruc_init (me, isot, ivegsrc, nlunit, & & errmsg, errflg) @@ -49,10 +42,7 @@ subroutine lsm_ruc_init (me, isot, ivegsrc, nlunit, & end subroutine lsm_ruc_init !! \section arg_table_lsm_ruc_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-------------------------------------------------------------|--------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude lsm_ruc_finalize.html !! subroutine lsm_ruc_finalize (errmsg, errflg) @@ -143,113 +133,7 @@ end subroutine lsm_ruc_finalize !! (Smirnova et al. 2016 \cite Smirnova_2016). #if 0 !> \section arg_table_lsm_ruc_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | delt | time_step_for_dynamics | physics time step | s | 0 | real | kind_phys | in | F | -!! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | -!! | kdt | index_of_time_step | current number of time steps | index | 0 | integer | | in | F | -!! | iter | ccpp_loop_counter | loop counter for subcycling loops in CCPP | index | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | nlev | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | lsm_ruc | flag_for_ruc_land_surface_scheme | flag for RUC land surface model | flag | 0 | integer | | in | F | -!! | lsm | flag_for_land_surface_scheme | flag for land surface model | flag | 0 | integer | | in | F | -!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | -!! | do_mynnsfclay | do_mynnsfclay | flag to activate MYNN surface layer | flag | 0 | logical | | in | F | -!! | lsoil_ruc | soil_vertical_dimension_for_land_surface_model | number of soil layers internal to land surface model | count | 0 | integer | | in | F | -!! | lsoil | soil_vertical_dimension | soil vertical layer dimension | count | 0 | integer | | in | F | -!! | zs | depth_of_soil_levels_for_land_surface_model | depth of soil levels for land surface model | m | 1 | real | kind_phys | inout | F | -!! | islmsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | -!! | con_cp | specific_heat_of_dry_air_at_constant_pressure | specific heat !of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | con_pi | pi | ratio of a circle's circumference to its diameter | radians | 0 | real | kind_phys | in | F | -!! | con_rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | con_rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | con_hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of vaporization/sublimation (hvap) | J kg-1 | 0 | real | kind_phys | in | F | -!! | con_fvirt | ratio_of_vapor_to_dry_air_gas_constants_minus_one | rv/rd - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | land | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | -!! | rainnc | lwe_thickness_of_explicit_rainfall_amount_from_previous_timestep | explicit rainfall from previous timestep | m | 1 | real | kind_phys | in | F | -!! | rainc | lwe_thickness_of_convective_precipitation_amount_from_previous_timestep | convective_precipitation_amount from previous timestep | m | 1 | real | kind_phys | in | F | -!! | ice | lwe_thickness_of_ice_amount_from_previous_timestep | ice amount from previous timestep | m | 1 | real | kind_phys | in | F | -!! | snow | lwe_thickness_of_snow_amount_from_previous_timestep | snow amount from previous timestep | m | 1 | real | kind_phys | in | F | -!! | graupel | lwe_thickness_of_graupel_amount_from_previous_timestep | graupel amount from previous timestep | m | 1 | real | kind_phys | in | F | -!! | srflag | flag_for_precipitation_type | snow/rain flag for precipitation | flag | 1 | real | kind_phys | in | F | -!! | sncovr1 | surface_snow_area_fraction_over_land | surface snow area fraction | frac | 1 | real | kind_phys | inout | F | -!! | weasd | water_equivalent_accumulated_snow_depth_over_land | water equiv of acc snow depth over land | mm | 1 | real | kind_phys | inout | F | -!! | snwdph | surface_snow_thickness_water_equivalent_over_land | water equivalent snow depth over land | mm | 1 | real | kind_phys | inout | F | -!! | rhosnf | density_of_frozen_precipitation | density of frozen precipitation | kg m-3 | 1 | real | kind_phys | out | F | -!! | zf | height_above_ground_at_lowest_model_layer | layer 1 height above ground (not MSL) | m | 1 | real | kind_phys | in | F | -!! | u1 | x_wind_at_lowest_model_layer | zonal wind at lowest model layer | m s-1 | 1 | real | kind_phys | in | F | -!! | v1 | y_wind_at_lowest_model_layer | meridional wind at lowest model layer | m s-1 | 1 | real | kind_phys | in | F | -!! | prsl1 | air_pressure_at_lowest_model_layer | mean pressure at lowest model layer | Pa | 1 | real | kind_phys | in | F | -!! | ddvel | surface_wind_enhancement_due_to_convection | surface wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | -!! | t1 | air_temperature_at_lowest_model_layer | mean temperature at lowest model layer | K | 1 | real | kind_phys | in | F | -!! | q1 | water_vapor_specific_humidity_at_lowest_model_layer | water vapor specific humidity at lowest model layer | kg kg-1 | 1 | real | kind_phys | in | F | -!! | qc | cloud_condensed_water_mixing_ratio_at_lowest_model_layer | moist (dry+vapor, no condensates) mixing ratio of cloud water at lowest model layer | kg kg-1 | 1 | real | kind_phys | in | F | -!! | dlwflx | surface_downwelling_longwave_flux | surface downwelling longwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | dswsfc | surface_downwelling_shortwave_flux | surface downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | snet | surface_net_downwelling_shortwave_flux | surface net downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | -!! | sfcemis | surface_longwave_emissivity | surface lw emissivity in fraction | frac | 1 | real | kind_phys | inout | F | -!! | wspd | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | inout | F | -!! | cm | surface_drag_coefficient_for_momentum_in_air_over_land | surface exchange coeff for momentum over land | none | 1 | real | kind_phys | in | F | -!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_land | surface exchange coeff heat & moisture over land | none | 1 | real | kind_phys | in | F | -!! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land | thermal exchange coefficient over land | kg m-2 s-1 | 1 | real | kind_phys | inout | F | -!! | cmm | surface_drag_wind_speed_for_momentum_in_air_over_land | momentum exchange coefficient over land | m s-1 | 1 | real | kind_phys | inout | F | -!! | wetness | normalized_soil_wetness_for_land_surface_model | normalized soil wetness | frac | 1 | real | kind_phys | inout | F | -!! | canopy | canopy_water_amount | canopy water amount | kg m-2 | 1 | real | kind_phys | inout | F | -!! | sigmaf | vegetation_area_fraction | areal fractional cover of green vegetation | frac | 1 | real | kind_phys | in | F | -!! | sfalb | surface_diffused_shortwave_albedo | mean surface diffused sw albedo | frac | 1 | real | kind_phys | inout | F | -!! | alvwf | mean_vis_albedo_with_weak_cosz_dependency | mean vis albedo with weak cosz dependency | frac | 1 | real | kind_phys | in | F | -!! | alnwf | mean_nir_albedo_with_weak_cosz_dependency | mean nir albedo with weak cosz dependency | frac | 1 | real | kind_phys | in | F | -!! | snoalb | upper_bound_on_max_albedo_over_deep_snow | maximum snow albedo | frac | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length_over_land_interstitial | surface roughness length over land (temporary use as interstitial)| cm | 1 | real | kind_phys | inout | F | -!! | qsurf | surface_specific_humidity_over_land | surface air saturation specific humidity over land | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | sfcqc | cloud_condensed_water_mixing_ratio_at_surface | moist cloud water mixing ratio at surface | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | sfcqv | water_vapor_mixing_ratio_at_surface | water vapor mixing ratio at surface | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | sfcdew | surface_condensation_mass | surface condensation mass | kg m-2 | 1 | real | kind_phys | inout | F | -!! | tg3 | deep_soil_temperature | deep soil temperature | K | 1 | real | kind_phys | in | F | -!! | smc | volume_fraction_of_soil_moisture | total soil moisture | frac | 2 | real | kind_phys | inout | F | -!! | slc | volume_fraction_of_unfrozen_soil_moisture | liquid soil moisture | frac | 2 | real | kind_phys | inout | F | -!! | stc | soil_temperature | soil temperature | K | 2 | real | kind_phys | inout | F | -!! | smcwlt2 | volume_fraction_of_condensed_water_in_soil_at_wilting_point | soil water fraction at wilting point | frac | 1 | real | kind_phys | inout | F | -!! | smcref2 | threshold_volume_fraction_of_condensed_water_in_soil | soil moisture threshold | frac | 1 | real | kind_phys | inout | F | -!! | vegtype | vegetation_type_classification | vegetation type at each grid cell | index | 1 | integer | | in | F | -!! | soiltyp | soil_type_classification | soil type at each grid cell | index | 1 | integer | | in | F | -!! | isot | soil_type_dataset_choice | soil type dataset choice | index | 0 | integer | | in | F | -!! | ivegsrc | vegetation_type_dataset_choice | land use dataset choice | index | 0 | integer | | in | F | -!! | fice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | -!! | keepfr | flag_for_frozen_soil_physics | flag for frozen soil physics (RUC) | flag | 2 | real | kind_phys | inout | F | -!! | smois | volume_fraction_of_soil_moisture_for_land_surface_model | volumetric fraction of soil moisture for lsm | frac | 2 | real | kind_phys | inout | F | -!! | sh2o | volume_fraction_of_unfrozen_soil_moisture_for_land_surface_model | volume fraction of unfrozen soil moisture for lsm | frac | 2 | real | kind_phys | inout | F | -!! | smfrkeep | volume_fraction_of_frozen_soil_moisture_for_land_surface_model | volume fraction of frozen soil moisture for lsm | frac | 2 | real | kind_phys | inout | F | -!! | tslb | soil_temperature_for_land_surface_model | soil temperature for land surface model | K | 2 | real | kind_phys | inout | F | -!! | stm | soil_moisture_content | soil moisture content | kg m-2 | 1 | real | kind_phys | inout | F | -!! | tskin | surface_skin_temperature_over_land_interstitial | surface skin temperature over land use as interstitial | K | 1 | real | kind_phys | inout | F | -!! | tsurf | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | inout | F | -!! | tice | sea_ice_temperature_interstitial | sea ice surface skin temperature use as interstitial | K | 1 | real | kind_phys | inout | F | -!! | tsnow | snow_temperature_bottom_first_layer | snow temperature at the bottom of first snow layer | K | 1 | real | kind_phys | inout | F | -!! | snowfallac | total_accumulated_snowfall | run-total snow accumulation on the ground | kg m-2 | 1 | real | kind_phys | inout | F | -!! | acsnow | accumulated_water_equivalent_of_frozen_precip | snow water equivalent of run-total frozen precip | kg m-2 | 1 | real | kind_phys | inout | F | -!! | evap | kinematic_surface_upward_latent_heat_flux_over_land | kinematic surface upward evaporation flux over land | kg kg-1 m s-1 | 1 | real | kind_phys | out | F | -!! | hflx | kinematic_surface_upward_sensible_heat_flux_over_land | kinematic surface upward sensible heat flux over land | K m s-1 | 1 | real | kind_phys | out | F | -!! | evbs | soil_upward_latent_heat_flux | soil upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | evcw | canopy_upward_latent_heat_flux | canopy upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | sbsno | snow_deposition_sublimation_upward_latent_heat_flux | latent heat flux from snow depo/subl | W m-2 | 1 | real | kind_phys | out | F | -!! | trans | transpiration_flux | total plant transpiration rate | W m-2 | 1 | real | kind_phys | out | F | -!! | runof | surface_runoff_flux | surface runoff flux | kg m-2 s-1 | 1 | real | kind_phys | out | F | -!! | drain | subsurface_runoff_flux | subsurface runoff flux | kg m-2 s-1 | 1 | real | kind_phys | out | F | -!! | runoff | total_runoff | total water runoff | kg m-2 | 1 | real | kind_phys | inout | F | -!! | srunoff | surface_runoff | surface water runoff (from lsm) | kg m-2 | 1 | real | kind_phys | inout | F | -!! | gflux | upward_heat_flux_in_soil_over_land | soil heat flux over land | W m-2 | 1 | real | kind_phys | out | F | -!! | shdmin | minimum_vegetation_area_fraction | min fractional coverage of green vegetation | frac | 1 | real | kind_phys | in | F | -!! | shdmax | maximum_vegetation_area_fraction | max fractional coverage of green vegetation | frac | 1 | real | kind_phys | in | F | -!! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | -!! | flag_guess | flag_for_guess_run | flag for guess run | flag | 1 | logical | | in | F | -!! | flag_init | flag_for_first_time_step | flag signaling first time step for time integration loop | flag | 0 | logical | | in | F | -!! | flag_restart | flag_for_restart | flag for restart (warmstart) or coldstart | flag | 0 | logical | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude lsm_ruc_run.html !! #endif !>\section gen_lsmruc GSD RUC LSM General Algorithm diff --git a/physics/sfc_drv_ruc.meta b/physics/sfc_drv_ruc.meta new file mode 100644 index 000000000..a2fd34cb9 --- /dev/null +++ b/physics/sfc_drv_ruc.meta @@ -0,0 +1,1000 @@ +[ccpp-arg-table] + name = lsm_ruc_init + type = scheme +[me] + standard_name = mpi_rank + long_name = current MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[isot] + standard_name = soil_type_dataset_choice + long_name = soil type dataset choice + units = index + dimensions = () + type = integer + intent = in + optional = F +[ivegsrc] + standard_name = vegetation_type_dataset_choice + long_name = land use dataset choice + units = index + dimensions = () + type = integer + intent = in + optional = F +[nlunit] + standard_name = iounit_namelist + long_name = fortran unit number for file opens + units = none + dimensions = () + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = lsm_ruc_finalize + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = lsm_ruc_run + type = scheme +[delt] + standard_name = time_step_for_dynamics + long_name = physics time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[me] + standard_name = mpi_rank + long_name = current MPI-rank + units = index + dimensions = () + type = integer + intent = in + optional = F +[kdt] + standard_name = index_of_time_step + long_name = current number of time steps + units = index + dimensions = () + type = integer + intent = in + optional = F +[iter] + standard_name = ccpp_loop_counter + long_name = loop counter for subcycling loops in CCPP + units = index + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[nlev] + standard_name = vertical_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[lsm_ruc] + standard_name = flag_for_ruc_land_surface_scheme + long_name = flag for RUC land surface model + units = flag + dimensions = () + type = integer + intent = in + optional = F +[lsm] + standard_name = flag_for_land_surface_scheme + long_name = flag for land surface model + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_gfdl] + standard_name = flag_for_gfdl_microphysics_scheme + long_name = choice of GFDL microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_thompson] + standard_name = flag_for_thompson_microphysics_scheme + long_name = choice of Thompson microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[do_mynnsfclay] + standard_name = do_mynnsfclay + long_name = flag to activate MYNN surface layer + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lsoil_ruc] + standard_name = soil_vertical_dimension_for_land_surface_model + long_name = number of soil layers internal to land surface model + units = count + dimensions = () + type = integer + intent = in + optional = F +[lsoil] + standard_name = soil_vertical_dimension + long_name = soil vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[zs] + standard_name = depth_of_soil_levels_for_land_surface_model + long_name = depth of soil levels for land surface model + units = m + dimensions = (soil_vertical_dimension_for_land_surface_model) + type = real + kind = kind_phys + intent = inout + optional = F +[islmsk] + standard_name = sea_land_ice_mask + long_name = landmask: sea/land/ice=0/1/2 + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[con_cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat !of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = radians + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_rv] + standard_name = gas_constant_water_vapor + long_name = ideal gas constant for water vapor + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of vaporization/sublimation (hvap) + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_fvirt] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = rv/rd - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[land] + standard_name = flag_nonzero_land_surface_fraction + long_name = flag indicating presence of some land surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[rainnc] + standard_name = lwe_thickness_of_explicit_rainfall_amount_from_previous_timestep + long_name = explicit rainfall from previous timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rainc] + standard_name = lwe_thickness_of_convective_precipitation_amount_from_previous_timestep + long_name = convective_precipitation_amount from previous timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ice] + standard_name = lwe_thickness_of_ice_amount_from_previous_timestep + long_name = ice amount from previous timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snow] + standard_name = lwe_thickness_of_snow_amount_from_previous_timestep + long_name = snow amount from previous timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[graupel] + standard_name = lwe_thickness_of_graupel_amount_from_previous_timestep + long_name = graupel amount from previous timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[srflag] + standard_name = flag_for_precipitation_type + long_name = snow/rain flag for precipitation + units = flag + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sncovr1] + standard_name = surface_snow_area_fraction_over_land + long_name = surface snow area fraction + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[weasd] + standard_name = water_equivalent_accumulated_snow_depth_over_land + long_name = water equiv of acc snow depth over land + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snwdph] + standard_name = surface_snow_thickness_water_equivalent_over_land + long_name = water equivalent snow depth over land + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rhosnf] + standard_name = density_of_frozen_precipitation + long_name = density of frozen precipitation + units = kg m-3 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[zf] + standard_name = height_above_ground_at_lowest_model_layer + long_name = layer 1 height above ground (not MSL) + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[u1] + standard_name = x_wind_at_lowest_model_layer + long_name = zonal wind at lowest model layer + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v1] + standard_name = y_wind_at_lowest_model_layer + long_name = meridional wind at lowest model layer + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl1] + standard_name = air_pressure_at_lowest_model_layer + long_name = mean pressure at lowest model layer + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ddvel] + standard_name = surface_wind_enhancement_due_to_convection + long_name = surface wind enhancement due to convection + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t1] + standard_name = air_temperature_at_lowest_model_layer + long_name = mean temperature at lowest model layer + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q1] + standard_name = water_vapor_specific_humidity_at_lowest_model_layer + long_name = water vapor specific humidity at lowest model layer + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qc] + standard_name = cloud_condensed_water_mixing_ratio_at_lowest_model_layer + long_name = moist (dry+vapor, no condensates) mixing ratio of cloud water at lowest model layer + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dlwflx] + standard_name = surface_downwelling_longwave_flux + long_name = surface downwelling longwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dswsfc] + standard_name = surface_downwelling_shortwave_flux + long_name = surface downwelling shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snet] + standard_name = surface_net_downwelling_shortwave_flux + long_name = surface net downwelling shortwave flux at current time + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcemis] + standard_name = surface_longwave_emissivity + long_name = surface lw emissivity in fraction + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[wspd] + standard_name = wind_speed_at_lowest_model_layer + long_name = wind speed at lowest model level + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cm] + standard_name = surface_drag_coefficient_for_momentum_in_air_over_land + long_name = surface exchange coeff for momentum over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ch] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_land + long_name = surface exchange coeff heat & moisture over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[chh] + standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land + long_name = thermal exchange coefficient over land + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cmm] + standard_name = surface_drag_wind_speed_for_momentum_in_air_over_land + long_name = momentum exchange coefficient over land + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[wetness] + standard_name = normalized_soil_wetness_for_land_surface_model + long_name = normalized soil wetness + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[canopy] + standard_name = canopy_water_amount + long_name = canopy water amount + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[sigmaf] + standard_name = vegetation_area_fraction + long_name = areal fractional cover of green vegetation + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfalb] + standard_name = surface_diffused_shortwave_albedo + long_name = mean surface diffused sw albedo + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[alvwf] + standard_name = mean_vis_albedo_with_weak_cosz_dependency + long_name = mean vis albedo with weak cosz dependency + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[alnwf] + standard_name = mean_nir_albedo_with_weak_cosz_dependency + long_name = mean nir albedo with weak cosz dependency + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snoalb] + standard_name = upper_bound_on_max_albedo_over_deep_snow + long_name = maximum snow albedo + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zorl] + standard_name = surface_roughness_length_over_land_interstitial + long_name = surface roughness length over land (temporary use as interstitial) + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qsurf] + standard_name = surface_specific_humidity_over_land + long_name = surface air saturation specific humidity over land + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[sfcqc] + standard_name = cloud_condensed_water_mixing_ratio_at_surface + long_name = moist cloud water mixing ratio at surface + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[sfcqv] + standard_name = water_vapor_mixing_ratio_at_surface + long_name = water vapor mixing ratio at surface + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[sfcdew] + standard_name = surface_condensation_mass + long_name = surface condensation mass + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tg3] + standard_name = deep_soil_temperature + long_name = deep soil temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[smc] + standard_name = volume_fraction_of_soil_moisture + long_name = total soil moisture + units = frac + dimensions = (horizontal_dimension,soil_vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[slc] + standard_name = volume_fraction_of_unfrozen_soil_moisture + long_name = liquid soil moisture + units = frac + dimensions = (horizontal_dimension,soil_vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[stc] + standard_name = soil_temperature + long_name = soil temperature + units = K + dimensions = (horizontal_dimension,soil_vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[smcwlt2] + standard_name = volume_fraction_of_condensed_water_in_soil_at_wilting_point + long_name = soil water fraction at wilting point + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[smcref2] + standard_name = threshold_volume_fraction_of_condensed_water_in_soil + long_name = soil moisture threshold + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[vegtype] + standard_name = vegetation_type_classification + long_name = vegetation type at each grid cell + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[soiltyp] + standard_name = soil_type_classification + long_name = soil type at each grid cell + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[isot] + standard_name = soil_type_dataset_choice + long_name = soil type dataset choice + units = index + dimensions = () + type = integer + intent = in + optional = F +[ivegsrc] + standard_name = vegetation_type_dataset_choice + long_name = land use dataset choice + units = index + dimensions = () + type = integer + intent = in + optional = F +[fice] + standard_name = sea_ice_concentration + long_name = ice fraction over open water + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[keepfr] + standard_name = flag_for_frozen_soil_physics + long_name = flag for frozen soil physics (RUC) + units = flag + dimensions = (horizontal_dimension,soil_vertical_dimension_for_land_surface_model) + type = real + kind = kind_phys + intent = inout + optional = F +[smois] + standard_name = volume_fraction_of_soil_moisture_for_land_surface_model + long_name = volumetric fraction of soil moisture for lsm + units = frac + dimensions = (horizontal_dimension,soil_vertical_dimension_for_land_surface_model) + type = real + kind = kind_phys + intent = inout + optional = F +[sh2o] + standard_name = volume_fraction_of_unfrozen_soil_moisture_for_land_surface_model + long_name = volume fraction of unfrozen soil moisture for lsm + units = frac + dimensions = (horizontal_dimension,soil_vertical_dimension_for_land_surface_model) + type = real + kind = kind_phys + intent = inout + optional = F +[smfrkeep] + standard_name = volume_fraction_of_frozen_soil_moisture_for_land_surface_model + long_name = volume fraction of frozen soil moisture for lsm + units = frac + dimensions = (horizontal_dimension,soil_vertical_dimension_for_land_surface_model) + type = real + kind = kind_phys + intent = inout + optional = F +[tslb] + standard_name = soil_temperature_for_land_surface_model + long_name = soil temperature for land surface model + units = K + dimensions = (horizontal_dimension,soil_vertical_dimension_for_land_surface_model) + type = real + kind = kind_phys + intent = inout + optional = F +[stm] + standard_name = soil_moisture_content + long_name = soil moisture content + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tskin] + standard_name = surface_skin_temperature_over_land_interstitial + long_name = surface skin temperature over land use as interstitial + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsurf] + standard_name = surface_skin_temperature_after_iteration_over_land + long_name = surface skin temperature after iteration over land + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tice] + standard_name = sea_ice_temperature_interstitial + long_name = sea ice surface skin temperature use as interstitial + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsnow] + standard_name = snow_temperature_bottom_first_layer + long_name = snow temperature at the bottom of first snow layer + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snowfallac] + standard_name = total_accumulated_snowfall + long_name = run-total snow accumulation on the ground + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[acsnow] + standard_name = accumulated_water_equivalent_of_frozen_precip + long_name = snow water equivalent of run-total frozen precip + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux_over_land + long_name = kinematic surface upward evaporation flux over land + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[hflx] + standard_name = kinematic_surface_upward_sensible_heat_flux_over_land + long_name = kinematic surface upward sensible heat flux over land + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[evbs] + standard_name = soil_upward_latent_heat_flux + long_name = soil upward latent heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[evcw] + standard_name = canopy_upward_latent_heat_flux + long_name = canopy upward latent heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[sbsno] + standard_name = snow_deposition_sublimation_upward_latent_heat_flux + long_name = latent heat flux from snow depo/subl + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[trans] + standard_name = transpiration_flux + long_name = total plant transpiration rate + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[runof] + standard_name = surface_runoff_flux + long_name = surface runoff flux + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[drain] + standard_name = subsurface_runoff_flux + long_name = subsurface runoff flux + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[runoff] + standard_name = total_runoff + long_name = total water runoff + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[srunoff] + standard_name = surface_runoff + long_name = surface water runoff (from lsm) + units = kg m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gflux] + standard_name = upward_heat_flux_in_soil_over_land + long_name = soil heat flux over land + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[shdmin] + standard_name = minimum_vegetation_area_fraction + long_name = min fractional coverage of green vegetation + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[shdmax] + standard_name = maximum_vegetation_area_fraction + long_name = max fractional coverage of green vegetation + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[flag_iter] + standard_name = flag_for_iteration + long_name = flag for iteration + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[flag_guess] + standard_name = flag_for_guess_run + long_name = flag for guess run + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[flag_init] + standard_name = flag_for_first_time_step + long_name = flag signaling first time step for time integration loop + units = flag + dimensions = () + type = logical + intent = in + optional = F +[flag_restart] + standard_name = flag_for_restart + long_name = flag for restart (warmstart) or coldstart + units = flag + dimensions = () + type = logical + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f index 086eb54f2..a4efb72ac 100644 --- a/physics/sfc_nst.f +++ b/physics/sfc_nst.f @@ -24,79 +24,7 @@ end subroutine sfc_nst_finalize !>\defgroup gfs_nst_main GFS Near-Surface Sea Temperature Scheme Module !> \brief This subroutine calls the Thermal Skin-layer and Diurnal Thermocline models to update the NSST profile. !! \section arg_table_sfc_nst_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|------------------------------------------------------------------------------|-------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | hfus | latent_heat_of_fusion_of_water_at_0C | latent heat of fusion | J kg-1 | 0 | real | kind_phys | in | F | -!! | jcal | joules_per_calorie_constant | joules per calorie constant | J cal-1 | 0 | real | kind_phys | in | F | -!! | eps | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | -!! | epsm1 | ratio_of_dry_air_to_water_vapor_gas_constants_minus_one | (rd/rv) - 1 | none | 0 | real | kind_phys | in | F | -!! | rvrdm1 | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | rhw0 | sea_water_reference_density | sea water reference density | kg m-3 | 0 | real | kind_phys | in | F | -!! | sbc | stefan_boltzmann_constant | Stefan-Boltzmann constant | W m-2 K-4 | 0 | real | kind_phys | in | F | -!! | pi | pi | ratio of a circle's circumference to its diameter | radians | 0 | real | kind_phys | in | F | -!! | ps | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | u1 | x_wind_at_lowest_model_layer | x component of surface layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | v1 | y_wind_at_lowest_model_layer | y component of surface layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | t1 | air_temperature_at_lowest_model_layer | surface layer mean temperature | K | 1 | real | kind_phys | in | F | -!! | q1 | water_vapor_specific_humidity_at_lowest_model_layer | surface layer mean specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | tref | sea_surface_reference_temperature | reference/foundation temperature | K | 1 | real | kind_phys | in | F | -!! | cm | surface_drag_coefficient_for_momentum_in_air_over_ocean | surface exchange coeff for momentum over ocean | none | 1 | real | kind_phys | in | F | -!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ocean | surface exchange coeff heat & moisture over ocean | none | 1 | real | kind_phys | in | F | -!! | prsl1 | air_pressure_at_lowest_model_layer | surface layer mean pressure | Pa | 1 | real | kind_phys | in | F | -!! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | -!! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | -!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | -!! | xlon | longitude | longitude | radians | 1 | real | kind_phys | in | F | -!! | sinlat | sine_of_latitude | sine of latitude | none | 1 | real | kind_phys | in | F | -!! | stress | surface_wind_stress_over_ocean | surface wind stress over ocean | m2 s-2 | 1 | real | kind_phys | in | F | -!! | sfcemis | surface_longwave_emissivity | surface longwave emissivity | frac | 1 | real | kind_phys | in | F | -!! | dlwflx | surface_downwelling_longwave_flux_absorbed_by_ground | total sky sfc downward lw flux absorbed by the ocean | W m-2 | 1 | real | kind_phys | in | F | -!! | sfcnsw | surface_net_downwelling_shortwave_flux | total sky sfc net sw flx into ocean | W m-2 | 1 | real | kind_phys | in | F | -!! | rain | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ocean | total precipitation amount in each time step over ocean | m | 1 | real | kind_phys | in | F | -!! | timestep | time_step_for_dynamics | timestep interval | s | 0 | real | kind_phys | in | F | -!! | kdt | index_of_time_step | current time step index | index | 0 | integer | | in | F | -!! | solhr | forecast_hour | fcst hour at the end of prev time step | h | 0 | real | kind_phys | in | F | -!! | xcosz | instantaneous_cosine_of_zenith_angle | cosine of solar zenith angle | none | 1 | real | kind_phys | in | F | -!! | ddvel | surface_wind_enhancement_due_to_convection | wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | -!! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | -!! | flag_guess | flag_for_guess_run | flag for guess run | flag | 1 | logical | | in | F | -!! | nstf_name1 | flag_for_nsstm_run | NSSTM flag: off/uncoupled/coupled=0/1/2 | flag | 0 | integer | | in | F | -!! | nstf_name4 | vertical_temperature_average_range_lower_bound | zsea1 | mm | 0 | integer | | in | F | -!! | nstf_name5 | vertical_temperature_average_range_upper_bound | zsea2 | mm | 0 | integer | | in | F | -!! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | -!! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | -!! | tskin | surface_skin_temperature_for_nsst | ocean surface skin temperature | K | 1 | real | kind_phys | inout | F | -!! | tsurf | surface_skin_temperature_after_iteration_over_ocean | surface skin temperature after iteration over ocean | K | 1 | real | kind_phys | inout | F | -!! | xt | diurnal_thermocline_layer_heat_content | heat content in diurnal thermocline layer | K m | 1 | real | kind_phys | inout | F | -!! | xs | sea_water_salinity | salinity content in diurnal thermocline layer | ppt m | 1 | real | kind_phys | inout | F | -!! | xu | diurnal_thermocline_layer_x_current | u-current content in diurnal thermocline layer | m2 s-1 | 1 | real | kind_phys | inout | F | -!! | xv | diurnal_thermocline_layer_y_current | v-current content in diurnal thermocline layer | m2 s-1 | 1 | real | kind_phys | inout | F | -!! | xz | diurnal_thermocline_layer_thickness | diurnal thermocline layer thickness | m | 1 | real | kind_phys | inout | F | -!! | zm | ocean_mixed_layer_thickness | mixed layer thickness | m | 1 | real | kind_phys | inout | F | -!! | xtts | sensitivity_of_dtl_heat_content_to_surface_temperature | d(xt)/d(ts) | m | 1 | real | kind_phys | inout | F | -!! | xzts | sensitivity_of_dtl_thickness_to_surface_temperature | d(xz)/d(ts) | m K-1 | 1 | real | kind_phys | inout | F | -!! | dt_cool | sub_layer_cooling_amount | sub-layer cooling amount | K | 1 | real | kind_phys | inout | F | -!! | z_c | sub_layer_cooling_thickness | sub-layer cooling thickness | m | 1 | real | kind_phys | inout | F | -!! | c_0 | coefficient_c_0 | coefficient1 to calculate d(tz)/d(ts) | none | 1 | real | kind_phys | inout | F | -!! | c_d | coefficient_c_d | coefficient2 to calculate d(tz)/d(ts) | none | 1 | real | kind_phys | inout | F | -!! | w_0 | coefficient_w_0 | coefficient3 to calculate d(tz)/d(ts) | none | 1 | real | kind_phys | inout | F | -!! | w_d | coefficient_w_d | coefficient4 to calculate d(tz)/d(ts) | none | 1 | real | kind_phys | inout | F | -!! | d_conv | free_convection_layer_thickness | thickness of free convection layer | m | 1 | real | kind_phys | inout | F | -!! | ifd | index_of_dtlm_start | index to start dtlm run or not | index | 1 | real | kind_phys | inout | F | -!! | qrain | sensible_heat_flux_due_to_rainfall | sensible heat flux due to rainfall | W | 1 | real | kind_phys | inout | F | -!! | qsurf | surface_specific_humidity_over_ocean | surface air saturation specific humidity over ocean | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | gflux | upward_heat_flux_in_soil_over_ocean | soil heat flux over ocean | W m-2 | 1 | real | kind_phys | inout | F | -!! | cmm | surface_drag_wind_speed_for_momentum_in_air_over_ocean | momentum exchange coefficient over ocean | m s-1 | 1 | real | kind_phys | inout | F | -!! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ocean | thermal exchange coefficient over ocean | kg m-2 s-1 | 1 | real | kind_phys | inout | F | -!! | evap | kinematic_surface_upward_latent_heat_flux_over_ocean | kinematic surface upward latent heat flux over ocean | kg kg-1 m s-1 | 1 | real | kind_phys | inout | F | -!! | hflx | kinematic_surface_upward_sensible_heat_flux_over_ocean | kinematic surface upward sensible heat flux over ocean | K m s-1 | 1 | real | kind_phys | inout | F | -!! | ep | surface_upward_potential_latent_heat_flux_over_ocean | surface upward potential latent heat flux over ocean | W m-2 | 1 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude sfc_nst_run.html !! !! \section NSST_general_algorithm GFS Near-Surface Sea Temperature Scheme General Algorithm !> @{ @@ -727,39 +655,7 @@ subroutine sfc_nst_pre_finalize end subroutine sfc_nst_pre_finalize !! \section arg_table_sfc_nst_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-------------------------------------------------------------------|-----------------------------------------------------------------------|---------------|------|-------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | rlapse | air_temperature_lapse_rate_constant | environmental air temperature lapse rate constant | K m-1 | 0 | real | kind_phys | in | F | -!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | -!! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | -!! | zorl_ocn | surface_roughness_length_over_ocean_interstitial | surface roughness length over ocean (temporary use as interstitial) | cm | 1 | real | kind_phys | inout | F | -!! | zorl_ice | surface_roughness_length_over_ice_interstitial | surface roughness length over ice (temporary use as interstitial) | cm | 1 | real | kind_phys | in | F | -!! | cd_ocn | surface_drag_coefficient_for_momentum_in_air_over_ocean | surface exchange coeff for momentum over ocean | none | 1 | real | kind_phys | inout | F | -!! | cd_ice | surface_drag_coefficient_for_momentum_in_air_over_ice | surface exchange coeff for momentum over ice | none | 1 | real | kind_phys | in | F | -!! | cdq_ocn | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ocean | surface exchange coeff heat & moisture over ocean | none | 1 | real | kind_phys | inout | F | -!! | cdq_ice | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice | surface exchange coeff heat & moisture over ice | none | 1 | real | kind_phys | in | F | -!! | rb_ocn | bulk_richardson_number_at_lowest_model_level_over_ocean | bulk Richardson number at the surface over ocean | none | 1 | real | kind_phys | inout | F | -!! | rb_ice | bulk_richardson_number_at_lowest_model_level_over_ice | bulk Richardson number at the surface over ice | none | 1 | real | kind_phys | in | F | -!! | stress_ocn | surface_wind_stress_over_ocean | surface wind stress over ocean | m2 s-2 | 1 | real | kind_phys | inout | F | -!! | stress_ice | surface_wind_stress_over_ice | surface wind stress over ice | m2 s-2 | 1 | real | kind_phys | in | F | -!! | ffmm_ocn | Monin_Obukhov_similarity_function_for_momentum_over_ocean | Monin-Obukhov similarity function for momentum over ocean | none | 1 | real | kind_phys | inout | F | -!! | ffmm_ice | Monin_Obukhov_similarity_function_for_momentum_over_ice | Monin-Obukhov similarity function for momentum over ice | none | 1 | real | kind_phys | in | F | -!! | ffhh_ocn | Monin_Obukhov_similarity_function_for_heat_over_ocean | Monin-Obukhov similarity function for heat over ocean | none | 1 | real | kind_phys | inout | F | -!! | ffhh_ice | Monin_Obukhov_similarity_function_for_heat_over_ice | Monin-Obukhov similarity function for heat over ice | none | 1 | real | kind_phys | in | F | -!! | uustar_ocn | surface_friction_velocity_over_ocean | surface friction velocity over ocean | m s-1 | 1 | real | kind_phys | inout | F | -!! | uustar_ice | surface_friction_velocity_over_ice | surface friction velocity over ice | m s-1 | 1 | real | kind_phys | in | F | -!! | fm10_ocn | Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ocean | Monin-Obukhov similarity parameter for momentum at 10m over ocean | none | 1 | real | kind_phys | inout | F | -!! | fm10_ice | Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ice | Monin-Obukhov similarity parameter for momentum at 10m over ice | none | 1 | real | kind_phys | in | F | -!! | fh2_ocn | Monin_Obukhov_similarity_function_for_heat_at_2m_over_ocean | Monin-Obukhov similarity parameter for heat at 2m over ocean | none | 1 | real | kind_phys | inout | F | -!! | fh2_ice | Monin_Obukhov_similarity_function_for_heat_at_2m_over_ice | Monin-Obukhov similarity parameter for heat at 2m over ice | none | 1 | real | kind_phys | in | F | -!! | oro | orography | orography | m | 1 | real | kind_phys | in | F | -!! | oro_uf | orography_unfiltered | unfiltered orographyo | m | 1 | real | kind_phys | in | F | -!! | tsfc_ocn | surface_skin_temperature_over_ocean_interstitial | surface skin temperature over ocean (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | -!! | tsurf_ocn | surface_skin_temperature_after_iteration_over_ocean | surface skin temperature after iteration over ocean | K | 1 | real | kind_phys | inout | F | -!! | tseal | surface_skin_temperature_for_nsst | ocean surface skin temperature | K | 1 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude sfc_nst_pre_run.html !! !> \section NSST_general_pre_algorithm General Algorithm !! @{ @@ -836,28 +732,7 @@ end subroutine sfc_nst_post_finalize !> \brief Brief description of the subroutine !! !! \section arg_table_sfc_nst_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|--------------------------------------------------------|----------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | rlapse | air_temperature_lapse_rate_constant | environmental air temperature lapse rate constant | K m-1 | 0 | real | kind_phys | in | F | -!! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | -!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | -!! | oro | orography | orography | m | 1 | real | kind_phys | in | F | -!! | oro_uf | orography_unfiltered | unfiltered orography | m | 1 | real | kind_phys | in | F | -!! | nstf_name1 | flag_for_nsstm_run | NSSTM flag: off/uncoupled/coupled=0/1/2 | flag | 0 | integer | | in | F | -!! | nstf_name4 | vertical_temperature_average_range_lower_bound | zsea1 | mm | 0 | integer | | in | F | -!! | nstf_name5 | vertical_temperature_average_range_upper_bound | zsea2 | mm | 0 | integer | | in | F | -!! | xt | diurnal_thermocline_layer_heat_content | heat content in diurnal thermocline layer | K m | 1 | real | kind_phys | in | F | -!! | xz | diurnal_thermocline_layer_thickness | diurnal thermocline layer thickness | m | 1 | real | kind_phys | in | F | -!! | dt_cool | sub_layer_cooling_amount | sub-layer cooling amount | K | 1 | real | kind_phys | in | F | -!! | z_c | sub_layer_cooling_thickness | sub-layer cooling thickness | m | 1 | real | kind_phys | in | F | -!! | tref | sea_surface_reference_temperature | reference/foundation temperature | K | 1 | real | kind_phys | in | F | -!! | xlon | longitude | longitude | radians | 1 | real | kind_phys | in | F | -!! | tsurf_ocn | surface_skin_temperature_after_iteration_over_ocean | surface skin temperature after iteration over ocean | K | 1 | real | kind_phys | inout | F | -!! | tsfc_ocn | surface_skin_temperature_over_ocean_interstitial | surface skin temperature over ocean (temporary use as interstitial) | K | 1 | real | kind_phys | inout | F | -!! | dtzm | mean_change_over_depth_in_sea_water_temperature | mean of dT(z) (zsea1 to zsea2) | K | 1 | real | kind_phys | out | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude sfc_nst_post_run.html !! ! \section NSST_general_post_algorithm General Algorithm ! diff --git a/physics/sfc_nst.meta b/physics/sfc_nst.meta new file mode 100644 index 000000000..e8549979b --- /dev/null +++ b/physics/sfc_nst.meta @@ -0,0 +1,1118 @@ +[ccpp-arg-table] + name = sfc_nst_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = sfc_nst_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = sfc_nst_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hfus] + standard_name = latent_heat_of_fusion_of_water_at_0C + long_name = latent heat of fusion + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[jcal] + standard_name = joules_per_calorie_constant + long_name = joules per calorie constant + units = J cal-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[eps] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[epsm1] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one + long_name = (rd/rv) - 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rvrdm1] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rhw0] + standard_name = sea_water_reference_density + long_name = sea water reference density + units = kg m-3 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[sbc] + standard_name = stefan_boltzmann_constant + long_name = Stefan-Boltzmann constant + units = W m-2 K-4 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = radians + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ps] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[u1] + standard_name = x_wind_at_lowest_model_layer + long_name = x component of surface layer wind + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v1] + standard_name = y_wind_at_lowest_model_layer + long_name = y component of surface layer wind + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t1] + standard_name = air_temperature_at_lowest_model_layer + long_name = surface layer mean temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q1] + standard_name = water_vapor_specific_humidity_at_lowest_model_layer + long_name = surface layer mean specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tref] + standard_name = sea_surface_reference_temperature + long_name = reference/foundation temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cm] + standard_name = surface_drag_coefficient_for_momentum_in_air_over_ocean + long_name = surface exchange coeff for momentum over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ch] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_ocean + long_name = surface exchange coeff heat & moisture over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl1] + standard_name = air_pressure_at_lowest_model_layer + long_name = surface layer mean pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslki] + standard_name = ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer + long_name = Exner function ratio bt midlayer and interface at 1st layer + units = ratio + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[wet] + standard_name = flag_nonzero_wet_surface_fraction + long_name = flag indicating presence of some ocean or lake surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[icy] + standard_name = flag_nonzero_sea_ice_surface_fraction + long_name = flag indicating presence of some sea ice surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[xlon] + standard_name = longitude + long_name = longitude + units = radians + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sinlat] + standard_name = sine_of_latitude + long_name = sine of latitude + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[stress] + standard_name = surface_wind_stress_over_ocean + long_name = surface wind stress over ocean + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcemis] + standard_name = surface_longwave_emissivity + long_name = surface longwave emissivity + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dlwflx] + standard_name = surface_downwelling_longwave_flux_absorbed_by_ground + long_name = total sky sfc downward lw flux absorbed by the ocean + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcnsw] + standard_name = surface_net_downwelling_shortwave_flux + long_name = total sky sfc net sw flx into ocean + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rain] + standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ocean + long_name = total precipitation amount in each time step over ocean + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[timestep] + standard_name = time_step_for_dynamics + long_name = timestep interval + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[kdt] + standard_name = index_of_time_step + long_name = current time step index + units = index + dimensions = () + type = integer + intent = in + optional = F +[solhr] + standard_name = forecast_hour + long_name = fcst hour at the end of prev time step + units = h + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[xcosz] + standard_name = instantaneous_cosine_of_zenith_angle + long_name = cosine of solar zenith angle + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ddvel] + standard_name = surface_wind_enhancement_due_to_convection + long_name = wind enhancement due to convection + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[flag_iter] + standard_name = flag_for_iteration + long_name = flag for iteration + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[flag_guess] + standard_name = flag_for_guess_run + long_name = flag for guess run + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[nstf_name1] + standard_name = flag_for_nsstm_run + long_name = NSSTM flag: off/uncoupled/coupled=0/1/2 + units = flag + dimensions = () + type = integer + intent = in + optional = F +[nstf_name4] + standard_name = vertical_temperature_average_range_lower_bound + long_name = zsea1 + units = mm + dimensions = () + type = integer + intent = in + optional = F +[nstf_name5] + standard_name = vertical_temperature_average_range_upper_bound + long_name = zsea2 + units = mm + dimensions = () + type = integer + intent = in + optional = F +[lprnt] + standard_name = flag_print + long_name = flag for printing diagnostics to output + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ipr] + standard_name = horizontal_index_of_printed_column + long_name = horizontal index of printed column + units = index + dimensions = () + type = integer + intent = in + optional = F +[tskin] + standard_name = surface_skin_temperature_for_nsst + long_name = ocean surface skin temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsurf] + standard_name = surface_skin_temperature_after_iteration_over_ocean + long_name = surface skin temperature after iteration over ocean + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[xt] + standard_name = diurnal_thermocline_layer_heat_content + long_name = heat content in diurnal thermocline layer + units = K m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[xs] + standard_name = sea_water_salinity + long_name = salinity content in diurnal thermocline layer + units = ppt m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[xu] + standard_name = diurnal_thermocline_layer_x_current + long_name = u-current content in diurnal thermocline layer + units = m2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[xv] + standard_name = diurnal_thermocline_layer_y_current + long_name = v-current content in diurnal thermocline layer + units = m2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[xz] + standard_name = diurnal_thermocline_layer_thickness + long_name = diurnal thermocline layer thickness + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[zm] + standard_name = ocean_mixed_layer_thickness + long_name = mixed layer thickness + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[xtts] + standard_name = sensitivity_of_dtl_heat_content_to_surface_temperature + long_name = d(xt)/d(ts) + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[xzts] + standard_name = sensitivity_of_dtl_thickness_to_surface_temperature + long_name = d(xz)/d(ts) + units = m K-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dt_cool] + standard_name = sub_layer_cooling_amount + long_name = sub-layer cooling amount + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[z_c] + standard_name = sub_layer_cooling_thickness + long_name = sub-layer cooling thickness + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[c_0] + standard_name = coefficient_c_0 + long_name = coefficient1 to calculate d(tz)/d(ts) + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[c_d] + standard_name = coefficient_c_d + long_name = coefficient2 to calculate d(tz)/d(ts) + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[w_0] + standard_name = coefficient_w_0 + long_name = coefficient3 to calculate d(tz)/d(ts) + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[w_d] + standard_name = coefficient_w_d + long_name = coefficient4 to calculate d(tz)/d(ts) + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[d_conv] + standard_name = free_convection_layer_thickness + long_name = thickness of free convection layer + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ifd] + standard_name = index_of_dtlm_start + long_name = index to start dtlm run or not + units = index + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qrain] + standard_name = sensible_heat_flux_due_to_rainfall + long_name = sensible heat flux due to rainfall + units = W + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qsurf] + standard_name = surface_specific_humidity_over_ocean + long_name = surface air saturation specific humidity over ocean + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gflux] + standard_name = upward_heat_flux_in_soil_over_ocean + long_name = soil heat flux over ocean + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cmm] + standard_name = surface_drag_wind_speed_for_momentum_in_air_over_ocean + long_name = momentum exchange coefficient over ocean + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[chh] + standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ocean + long_name = thermal exchange coefficient over ocean + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux_over_ocean + long_name = kinematic surface upward latent heat flux over ocean + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[hflx] + standard_name = kinematic_surface_upward_sensible_heat_flux_over_ocean + long_name = kinematic surface upward sensible heat flux over ocean + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ep] + standard_name = surface_upward_potential_latent_heat_flux_over_ocean + long_name = surface upward potential latent heat flux over ocean + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = sfc_nst_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = sfc_nst_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = sfc_nst_pre_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[rlapse] + standard_name = air_temperature_lapse_rate_constant + long_name = environmental air temperature lapse rate constant + units = K m-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[icy] + standard_name = flag_nonzero_sea_ice_surface_fraction + long_name = flag indicating presence of some sea ice surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[wet] + standard_name = flag_nonzero_wet_surface_fraction + long_name = flag indicating presence of some ocean or lake surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[zorl_ocn] + standard_name = surface_roughness_length_over_ocean_interstitial + long_name = surface roughness length over ocean (temporary use as interstitial) + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[zorl_ice] + standard_name = surface_roughness_length_over_ice_interstitial + long_name = surface roughness length over ice (temporary use as interstitial) + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cd_ocn] + standard_name = surface_drag_coefficient_for_momentum_in_air_over_ocean + long_name = surface exchange coeff for momentum over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cd_ice] + standard_name = surface_drag_coefficient_for_momentum_in_air_over_ice + long_name = surface exchange coeff for momentum over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cdq_ocn] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_ocean + long_name = surface exchange coeff heat & moisture over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cdq_ice] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice + long_name = surface exchange coeff heat & moisture over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rb_ocn] + standard_name = bulk_richardson_number_at_lowest_model_level_over_ocean + long_name = bulk Richardson number at the surface over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rb_ice] + standard_name = bulk_richardson_number_at_lowest_model_level_over_ice + long_name = bulk Richardson number at the surface over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[stress_ocn] + standard_name = surface_wind_stress_over_ocean + long_name = surface wind stress over ocean + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[stress_ice] + standard_name = surface_wind_stress_over_ice + long_name = surface wind stress over ice + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ffmm_ocn] + standard_name = Monin_Obukhov_similarity_function_for_momentum_over_ocean + long_name = Monin-Obukhov similarity function for momentum over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ffmm_ice] + standard_name = Monin_Obukhov_similarity_function_for_momentum_over_ice + long_name = Monin-Obukhov similarity function for momentum over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ffhh_ocn] + standard_name = Monin_Obukhov_similarity_function_for_heat_over_ocean + long_name = Monin-Obukhov similarity function for heat over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ffhh_ice] + standard_name = Monin_Obukhov_similarity_function_for_heat_over_ice + long_name = Monin-Obukhov similarity function for heat over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[uustar_ocn] + standard_name = surface_friction_velocity_over_ocean + long_name = surface friction velocity over ocean + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[uustar_ice] + standard_name = surface_friction_velocity_over_ice + long_name = surface friction velocity over ice + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fm10_ocn] + standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ocean + long_name = Monin-Obukhov similarity parameter for momentum at 10m over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fm10_ice] + standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ice + long_name = Monin-Obukhov similarity parameter for momentum at 10m over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fh2_ocn] + standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m_over_ocean + long_name = Monin-Obukhov similarity parameter for heat at 2m over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fh2_ice] + standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m_over_ice + long_name = Monin-Obukhov similarity parameter for heat at 2m over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[oro] + standard_name = orography + long_name = orography + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[oro_uf] + standard_name = orography_unfiltered + long_name = unfiltered orographyo + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsfc_ocn] + standard_name = surface_skin_temperature_over_ocean_interstitial + long_name = surface skin temperature over ocean (temporary use as interstitial) + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsurf_ocn] + standard_name = surface_skin_temperature_after_iteration_over_ocean + long_name = surface skin temperature after iteration over ocean + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tseal] + standard_name = surface_skin_temperature_for_nsst + long_name = ocean surface skin temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = sfc_nst_post_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = sfc_nst_post_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = sfc_nst_post_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[rlapse] + standard_name = air_temperature_lapse_rate_constant + long_name = environmental air temperature lapse rate constant + units = K m-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[wet] + standard_name = flag_nonzero_wet_surface_fraction + long_name = flag indicating presence of some ocean or lake surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[icy] + standard_name = flag_nonzero_sea_ice_surface_fraction + long_name = flag indicating presence of some sea ice surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[oro] + standard_name = orography + long_name = orography + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[oro_uf] + standard_name = orography_unfiltered + long_name = unfiltered orography + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[nstf_name1] + standard_name = flag_for_nsstm_run + long_name = NSSTM flag: off/uncoupled/coupled=0/1/2 + units = flag + dimensions = () + type = integer + intent = in + optional = F +[nstf_name4] + standard_name = vertical_temperature_average_range_lower_bound + long_name = zsea1 + units = mm + dimensions = () + type = integer + intent = in + optional = F +[nstf_name5] + standard_name = vertical_temperature_average_range_upper_bound + long_name = zsea2 + units = mm + dimensions = () + type = integer + intent = in + optional = F +[xt] + standard_name = diurnal_thermocline_layer_heat_content + long_name = heat content in diurnal thermocline layer + units = K m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[xz] + standard_name = diurnal_thermocline_layer_thickness + long_name = diurnal thermocline layer thickness + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dt_cool] + standard_name = sub_layer_cooling_amount + long_name = sub-layer cooling amount + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[z_c] + standard_name = sub_layer_cooling_thickness + long_name = sub-layer cooling thickness + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tref] + standard_name = sea_surface_reference_temperature + long_name = reference/foundation temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[xlon] + standard_name = longitude + long_name = longitude + units = radians + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsurf_ocn] + standard_name = surface_skin_temperature_after_iteration_over_ocean + long_name = surface skin temperature after iteration over ocean + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsfc_ocn] + standard_name = surface_skin_temperature_over_ocean_interstitial + long_name = surface skin temperature over ocean (temporary use as interstitial) + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dtzm] + standard_name = mean_change_over_depth_in_sea_water_temperature + long_name = mean of dT(z) (zsea1 to zsea2) + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/sfc_ocean.F b/physics/sfc_ocean.F index e5cb95232..625e8e5f0 100644 --- a/physics/sfc_ocean.F +++ b/physics/sfc_ocean.F @@ -17,37 +17,7 @@ end subroutine sfc_ocean_finalize #if 0 !! \section arg_table_sfc_ocean_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|------------------------------------------------------------------------------|----------------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | eps | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | -!! | epsm1 | ratio_of_dry_air_to_water_vapor_gas_constants_minus_one | (rd/rv) - 1 | none | 0 | real | kind_phys | in | F | -!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | rvrdm1 | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | ps | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | u1 | x_wind_at_lowest_model_layer | x component of surface layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | v1 | y_wind_at_lowest_model_layer | y component of surface layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | t1 | air_temperature_at_lowest_model_layer | surface layer mean temperature | K | 1 | real | kind_phys | in | F | -!! | q1 | water_vapor_specific_humidity_at_lowest_model_layer | surface layer mean specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | tskin | surface_skin_temperature_over_ocean_interstitial | surface skin temperature over ocean (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | -!! | cm | surface_drag_coefficient_for_momentum_in_air_over_ocean | surface exchange coeff for momentum over ocean | none | 1 | real | kind_phys | in | F | -!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ocean | surface exchange coeff heat & moisture over ocean | none | 1 | real | kind_phys | in | F | -!! | prsl1 | air_pressure_at_lowest_model_layer | surface layer mean pressure | Pa | 1 | real | kind_phys | in | F | -!! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | -!! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | -!! | ddvel | surface_wind_enhancement_due_to_convection | wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | -!! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | -!! | qsurf | surface_specific_humidity_over_ocean | surface air saturation specific humidity over ocean | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | cmm | surface_drag_wind_speed_for_momentum_in_air_over_ocean | momentum exchange coefficient over ocean | m s-1 | 1 | real | kind_phys | inout | F | -!! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ocean | thermal exchange coefficient over ocean | kg m-2 s-1 | 1 | real | kind_phys | inout | F | -!! | gflux | upward_heat_flux_in_soil_over_ocean | soil heat flux over ocean | W m-2 | 1 | real | kind_phys | inout | F | -!! | evap | kinematic_surface_upward_latent_heat_flux_over_ocean | kinematic surface upward latent heat flux over ocean | kg kg-1 m s-1 | 1 | real | kind_phys | inout | F | -!! | hflx | kinematic_surface_upward_sensible_heat_flux_over_ocean | kinematic surface upward sensible heat flux over ocean | K m s-1 | 1 | real | kind_phys | inout | F | -!! | ep | surface_upward_potential_latent_heat_flux_over_ocean | surface upward potential latent heat flux over ocean | W m-2 | 1 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude sfc_ocean_run.html !! #endif subroutine sfc_ocean_run & diff --git a/physics/sfc_ocean.meta b/physics/sfc_ocean.meta new file mode 100644 index 000000000..4304e344d --- /dev/null +++ b/physics/sfc_ocean.meta @@ -0,0 +1,270 @@ +[ccpp-arg-table] + name = sfc_ocean_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = sfc_ocean_finalize + type = scheme + +######################################################################## +[ccpp-arg-table] + name = sfc_ocean_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[eps] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[epsm1] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one + long_name = (rd/rv) - 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rvrdm1] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ps] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[u1] + standard_name = x_wind_at_lowest_model_layer + long_name = x component of surface layer wind + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v1] + standard_name = y_wind_at_lowest_model_layer + long_name = y component of surface layer wind + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t1] + standard_name = air_temperature_at_lowest_model_layer + long_name = surface layer mean temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q1] + standard_name = water_vapor_specific_humidity_at_lowest_model_layer + long_name = surface layer mean specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tskin] + standard_name = surface_skin_temperature_over_ocean_interstitial + long_name = surface skin temperature over ocean (temporary use as interstitial) + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cm] + standard_name = surface_drag_coefficient_for_momentum_in_air_over_ocean + long_name = surface exchange coeff for momentum over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ch] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_ocean + long_name = surface exchange coeff heat & moisture over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl1] + standard_name = air_pressure_at_lowest_model_layer + long_name = surface layer mean pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslki] + standard_name = ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer + long_name = Exner function ratio bt midlayer and interface at 1st layer + units = ratio + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[wet] + standard_name = flag_nonzero_wet_surface_fraction + long_name = flag indicating presence of some ocean or lake surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[ddvel] + standard_name = surface_wind_enhancement_due_to_convection + long_name = wind enhancement due to convection + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[flag_iter] + standard_name = flag_for_iteration + long_name = flag for iteration + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[qsurf] + standard_name = surface_specific_humidity_over_ocean + long_name = surface air saturation specific humidity over ocean + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cmm] + standard_name = surface_drag_wind_speed_for_momentum_in_air_over_ocean + long_name = momentum exchange coefficient over ocean + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[chh] + standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ocean + long_name = thermal exchange coefficient over ocean + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gflux] + standard_name = upward_heat_flux_in_soil_over_ocean + long_name = soil heat flux over ocean + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux_over_ocean + long_name = kinematic surface upward latent heat flux over ocean + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[hflx] + standard_name = kinematic_surface_upward_sensible_heat_flux_over_ocean + long_name = kinematic surface upward sensible heat flux over ocean + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ep] + standard_name = surface_upward_potential_latent_heat_flux_over_ocean + long_name = surface upward potential latent heat flux over ocean + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index 7b817d813..ce4f286ba 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -15,63 +15,7 @@ end subroutine sfc_sice_finalize !>\defgroup gfs_sice_main GFS Three-layer Thermodynomics Sea-Ice Scheme Module !! \brief This is three-layer thermodynomics sea-ice model based on Winton (2000) \cite winton_2000. !! \section arg_table_sfc_sice_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | km | soil_vertical_dimension | vertical loop extent for soil levels, start at 1 | count | 0 | integer | | in | F | -!! | sbc | stefan_boltzmann_constant | Stefan-Boltzmann constant | W m-2 K-4 | 0 | real | kind_phys | in | F | -!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | tgice | freezing_point_temperature_of_seawater | freezing point temperature of seawater | K | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | eps | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | -!! | epsm1 | ratio_of_dry_air_to_water_vapor_gas_constants_minus_one | (rd/rv) - 1 | none | 0 | real | kind_phys | in | F | -!! | rvrdm1 | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | grav | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | t0c | temperature_at_zero_celsius | temperature at 0 degrees Celsius | K | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | cimin | minimum_sea_ice_concentration | minimum sea ice concentration | frac | 0 | real | kind_phys | in | F | -!! | ps | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | u1 | x_wind_at_lowest_model_layer | u component of surface layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | v1 | y_wind_at_lowest_model_layer | v component of surface layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | t1 | air_temperature_at_lowest_model_layer | surface layer mean temperature | K | 1 | real | kind_phys | in | F | -!! | q1 | water_vapor_specific_humidity_at_lowest_model_layer | surface layer mean specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | delt | time_step_for_dynamics | time step | s | 0 | real | kind_phys | in | F | -!! | sfcemis | surface_longwave_emissivity | sfc lw emissivity | frac | 1 | real | kind_phys | in | F | -!! | dlwflx | surface_downwelling_longwave_flux_absorbed_by_ground | total sky surface downward longwave flux absorbed by the ground | W m-2 | 1 | real | kind_phys | in | F | -!! | sfcnsw | surface_net_downwelling_shortwave_flux | total sky sfc netsw flx into ground | W m-2 | 1 | real | kind_phys | in | F | -!! | sfcdsw | surface_downwelling_shortwave_flux | total sky sfc downward sw flux | W m-2 | 1 | real | kind_phys | in | F | -!! | srflag | flag_for_precipitation_type | snow/rain flag for precipitation | flag | 1 | real | kind_phys | in | F | -!! | cm | surface_drag_coefficient_for_momentum_in_air_over_ice | surface exchange coeff for momentum over ice | none | 1 | real | kind_phys | in | F | -!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice | surface exchange coeff heat & moisture over ice | none | 1 | real | kind_phys | in | F | -!! | prsl1 | air_pressure_at_lowest_model_layer | surface layer mean pressure | Pa | 1 | real | kind_phys | in | F | -!! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | -!! | islimsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | in | F | -!! | ddvel | surface_wind_enhancement_due_to_convection | wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | -!! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | -!! | lprnt | flag_print | switch for printing sample column to stdout | flag | 0 | logical | | in | F | -!! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | -!! | hice | sea_ice_thickness | sea-ice thickness | m | 1 | real | kind_phys | inout | F | -!! | fice | sea_ice_concentration | sea-ice concentration [0,1] | frac | 1 | real | kind_phys | inout | F | -!! | tice | sea_ice_temperature_interstitial | sea-ice surface temperature use as interstitial | K | 1 | real | kind_phys | inout | F | -!! | weasd | water_equivalent_accumulated_snow_depth_over_ice | water equiv of acc snow depth over ice | mm | 1 | real | kind_phys | inout | F | -!! | tskin | surface_skin_temperature_over_ice_interstitial | surface skin temperature over ice (temporary use as interstitial) | K | 1 | real | kind_phys | inout | F | -!! | tprcp | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ice | total precipitation amount in each time step over ice | m | 1 | real | kind_phys | inout | F | -!! | stc | soil_temperature | soil temp | K | 2 | real | kind_phys | inout | F | -!! | ep | surface_upward_potential_latent_heat_flux_over_ice | surface upward potential latent heat flux over ice | W m-2 | 1 | real | kind_phys | inout | F | -!! | snwdph | surface_snow_thickness_water_equivalent_over_ice | water equivalent snow depth over ice | mm | 1 | real | kind_phys | inout | F | -!! | qsurf | surface_specific_humidity_over_ice | surface air saturation specific humidity over ice | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | snowmt | surface_snow_melt | snow melt during timestep | m | 1 | real | kind_phys | inout | F | -!! | gflux | upward_heat_flux_in_soil_over_ice | soil heat flux over ice | W m-2 | 1 | real | kind_phys | inout | F | -!! | cmm | surface_drag_wind_speed_for_momentum_in_air_over_ice | momentum exchange coefficient over ice | m s-1 | 1 | real | kind_phys | inout | F | -!! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ice | thermal exchange coefficient over ice | kg m-2 s-1 | 1 | real | kind_phys | inout | F | -!! | evap | kinematic_surface_upward_latent_heat_flux_over_ice | kinematic surface upward latent heat flux over ice | kg kg-1 m s-1 | 1 | real | kind_phys | inout | F | -!! | hflx | kinematic_surface_upward_sensible_heat_flux_over_ice | kinematic surface upward sensible heat flux over ice | K m s-1 | 1 | real | kind_phys | inout | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | -!! | cplchm | flag_for_chemistry_coupling | flag controlling cplchm collection (default off) | flag | 0 | logical | | in | F | -!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | in | F | -!! | islmsk_cice | sea_land_ice_mask_cice | sea/land/ice mask cice (=0/1/2) | flag | 1 | integer | | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude sfc_sice_run.html !! !> \section general_sice_run GFS Sea Ice Driver General Algorithm !!The model has four prognostic variables: the snow layer thickness \f$h_s\f$, the ice layer thickness diff --git a/physics/sfc_sice.meta b/physics/sfc_sice.meta new file mode 100644 index 000000000..bf6d470af --- /dev/null +++ b/physics/sfc_sice.meta @@ -0,0 +1,487 @@ +[ccpp-arg-table] + name = sfc_sice_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = soil_vertical_dimension + long_name = vertical loop extent for soil levels, start at 1 + units = count + dimensions = () + type = integer + intent = in + optional = F +[sbc] + standard_name = stefan_boltzmann_constant + long_name = Stefan-Boltzmann constant + units = W m-2 K-4 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[tgice] + standard_name = freezing_point_temperature_of_seawater + long_name = freezing point temperature of seawater + units = K + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[eps] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[epsm1] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one + long_name = (rd/rv) - 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rvrdm1] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[grav] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[t0c] + standard_name = temperature_at_zero_celsius + long_name = temperature at 0 degrees Celsius + units = K + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cimin] + standard_name = minimum_sea_ice_concentration + long_name = minimum sea ice concentration + units = frac + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ps] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[u1] + standard_name = x_wind_at_lowest_model_layer + long_name = u component of surface layer wind + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v1] + standard_name = y_wind_at_lowest_model_layer + long_name = v component of surface layer wind + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t1] + standard_name = air_temperature_at_lowest_model_layer + long_name = surface layer mean temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q1] + standard_name = water_vapor_specific_humidity_at_lowest_model_layer + long_name = surface layer mean specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[delt] + standard_name = time_step_for_dynamics + long_name = time step + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[sfcemis] + standard_name = surface_longwave_emissivity + long_name = sfc lw emissivity + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dlwflx] + standard_name = surface_downwelling_longwave_flux_absorbed_by_ground + long_name = total sky surface downward longwave flux absorbed by the ground + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcnsw] + standard_name = surface_net_downwelling_shortwave_flux + long_name = total sky sfc netsw flx into ground + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sfcdsw] + standard_name = surface_downwelling_shortwave_flux + long_name = total sky sfc downward sw flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[srflag] + standard_name = flag_for_precipitation_type + long_name = snow/rain flag for precipitation + units = flag + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cm] + standard_name = surface_drag_coefficient_for_momentum_in_air_over_ice + long_name = surface exchange coeff for momentum over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ch] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice + long_name = surface exchange coeff heat & moisture over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl1] + standard_name = air_pressure_at_lowest_model_layer + long_name = surface layer mean pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslki] + standard_name = ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer + long_name = Exner function ratio bt midlayer and interface at 1st layer + units = ratio + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[islimsk] + standard_name = sea_land_ice_mask + long_name = sea/land/ice mask (=0/1/2) + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[ddvel] + standard_name = surface_wind_enhancement_due_to_convection + long_name = wind enhancement due to convection + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[flag_iter] + standard_name = flag_for_iteration + long_name = flag for iteration + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[lprnt] + standard_name = flag_print + long_name = switch for printing sample column to stdout + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ipr] + standard_name = horizontal_index_of_printed_column + long_name = horizontal index of printed column + units = index + dimensions = () + type = integer + intent = in + optional = F +[hice] + standard_name = sea_ice_thickness + long_name = sea-ice thickness + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fice] + standard_name = sea_ice_concentration + long_name = sea-ice concentration [0,1] + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tice] + standard_name = sea_ice_temperature_interstitial + long_name = sea-ice surface temperature use as interstitial + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[weasd] + standard_name = water_equivalent_accumulated_snow_depth_over_ice + long_name = water equiv of acc snow depth over ice + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tskin] + standard_name = surface_skin_temperature_over_ice_interstitial + long_name = surface skin temperature over ice (temporary use as interstitial) + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tprcp] + standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ice + long_name = total precipitation amount in each time step over ice + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[stc] + standard_name = soil_temperature + long_name = soil temp + units = K + dimensions = (horizontal_dimension,soil_vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ep] + standard_name = surface_upward_potential_latent_heat_flux_over_ice + long_name = surface upward potential latent heat flux over ice + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snwdph] + standard_name = surface_snow_thickness_water_equivalent_over_ice + long_name = water equivalent snow depth over ice + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qsurf] + standard_name = surface_specific_humidity_over_ice + long_name = surface air saturation specific humidity over ice + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snowmt] + standard_name = surface_snow_melt + long_name = snow melt during timestep + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gflux] + standard_name = upward_heat_flux_in_soil_over_ice + long_name = soil heat flux over ice + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cmm] + standard_name = surface_drag_wind_speed_for_momentum_in_air_over_ice + long_name = momentum exchange coefficient over ice + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[chh] + standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ice + long_name = thermal exchange coefficient over ice + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux_over_ice + long_name = kinematic surface upward latent heat flux over ice + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[hflx] + standard_name = kinematic_surface_upward_sensible_heat_flux_over_ice + long_name = kinematic surface upward sensible heat flux over ice + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cplflx] + standard_name = flag_for_flux_coupling + long_name = flag controlling cplflx collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[cplchm] + standard_name = flag_for_chemistry_coupling + long_name = flag controlling cplchm collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[flag_cice] + standard_name = flag_for_cice + long_name = flag for cice + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[islmsk_cice] + standard_name = sea_land_ice_mask_cice + long_name = sea/land/ice mask cice (=0/1/2) + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/shinhongvdif.F90 b/physics/shinhongvdif.F90 index b6ff380d8..8053934ac 100644 --- a/physics/shinhongvdif.F90 +++ b/physics/shinhongvdif.F90 @@ -22,57 +22,7 @@ end subroutine shinhongvdif_finalize !! scale-aware Shinhong scheme. !! !> \section arg_table_shinhongvdif_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------------|-------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | km | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | ux | x_wind | x component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | vx | y_wind | y component of layer wind | m s-1 | 2 | real | kind_phys | in | F | -!! | tx | air_temperature | layer mean air temperature | K | 2 | real | kind_phys | in | F | -!! | qx | tracer_concentration | model layer mean tracer concentration | kg kg-1 | 3 | real | kind_phys | in | F | -!! | p2d | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | p2di | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | pi2d | dimensionless_exner_function_at_model_layers | Exner function at layers | none | 2 | real | kind_phys | in | F | -!! | vtnp | tendency_of_y_wind_due_to_model_physics | updated tendency of the y wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | utnp | tendency_of_x_wind_due_to_model_physics | updated tendency of the x wind | m s-2 | 2 | real | kind_phys | inout | F | -!! | ttnp | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | inout | F | -!! | qtnp | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers due to model physics | kg kg-1 s-1 | 3 | real | kind_phys | inout | F | -!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | ndiff | number_of_vertical_diffusion_tracers | number of tracers to diffuse vertically | count | 0 | integer | | in | F | -!! | ntcw | index_for_liquid_cloud_condensate | tracer index for cloud condensate (or liquid water) | index | 0 | integer | | in | F | -!! | ntiw | index_for_ice_cloud_condensate | tracer index for ice water | index | 0 | integer | | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | psfcpa | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | -!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | in | F | -!! | hpbl | atmosphere_boundary_layer_thickness | PBL thickness | m | 1 | real | kind_phys | out | F | -!! | psim | Monin_Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | in | F | -!! | psih | Monin_Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | in | F | -!! | landmask | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | in | F | -!! | heat | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | wspd | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | in | F | -!! | br | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | -!! | g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | ep1 | ratio_of_vapor_to_dry_air_gas_constants_minus_one | rv/rd - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | ep2 | ratio_of_dry_air_to_water_vapor_gas_constants | rd/rv | none | 0 | real | kind_phys | in | F | -!! | xlv | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | dusfc | instantaneous_surface_x_momentum_flux | x momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dvsfc | instantaneous_surface_y_momentum_flux | y momentum flux | Pa | 1 | real | kind_phys | out | F | -!! | dtsfc | instantaneous_surface_upward_sensible_heat_flux | surface upward sensible heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dqsfc | instantaneous_surface_upward_latent_heat_flux | surface upward latent heat flux | W m-2 | 1 | real | kind_phys | out | F | -!! | dt | time_step_for_physics | time step for physics | s | 0 | real | kind_phys | in | F | -!! | kpbl1d | vertical_index_at_top_of_atmosphere_boundary_layer | PBL top model level index | index | 1 | integer | | out | F | -!! | u10 | x_wind_at_10m | x component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | v10 | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | in | F | -!! | dx | cell_size | size of the grid cell | m | 1 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude shinhongvdif_run.html !! !------------------------------------------------------------------------------- subroutine shinhongvdif_run(ix,im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & diff --git a/physics/shinhongvdif.meta b/physics/shinhongvdif.meta new file mode 100644 index 000000000..e859fca4d --- /dev/null +++ b/physics/shinhongvdif.meta @@ -0,0 +1,434 @@ +[ccpp-arg-table] + name = shinhongvdif_run + type = scheme +[ix] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[km] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[ux] + standard_name = x_wind + long_name = x component of layer wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[vx] + standard_name = y_wind + long_name = y component of layer wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tx] + standard_name = air_temperature + long_name = layer mean air temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qx] + standard_name = tracer_concentration + long_name = model layer mean tracer concentration + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = in + optional = F +[p2d] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[p2di] + standard_name = air_pressure_at_interface + long_name = air pressure at model layer interfaces + units = Pa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[pi2d] + standard_name = dimensionless_exner_function_at_model_layers + long_name = Exner function at layers + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[vtnp] + standard_name = tendency_of_y_wind_due_to_model_physics + long_name = updated tendency of the y wind + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[utnp] + standard_name = tendency_of_x_wind_due_to_model_physics + long_name = updated tendency of the x wind + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ttnp] + standard_name = tendency_of_air_temperature_due_to_model_physics + long_name = updated tendency of the temperature + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qtnp] + standard_name = tendency_of_tracers_due_to_model_physics + long_name = updated tendency of the tracers due to model physics + units = kg kg-1 s-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = inout + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F +[ndiff] + standard_name = number_of_vertical_diffusion_tracers + long_name = number of tracers to diffuse vertically + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntcw] + standard_name = index_for_liquid_cloud_condensate + long_name = tracer index for cloud condensate (or liquid water) + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntiw] + standard_name = index_for_ice_cloud_condensate + long_name = tracer index for ice water + units = index + dimensions = () + type = integer + intent = in + optional = F +[phii] + standard_name = geopotential_at_interface + long_name = geopotential at model layer interfaces + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[phil] + standard_name = geopotential + long_name = geopotential at model layer centers + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[psfcpa] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zorl] + standard_name = surface_roughness_length + long_name = surface roughness length in cm + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[stress] + standard_name = surface_wind_stress + long_name = surface wind stress + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[hpbl] + standard_name = atmosphere_boundary_layer_thickness + long_name = PBL thickness + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[psim] + standard_name = Monin_Obukhov_similarity_function_for_momentum + long_name = Monin-Obukhov similarity function for momentum + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[psih] + standard_name = Monin_Obukhov_similarity_function_for_heat + long_name = Monin-Obukhov similarity function for heat + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[landmask] + standard_name = sea_land_ice_mask + long_name = landmask: sea/land/ice=0/1/2 + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[heat] + standard_name = kinematic_surface_upward_sensible_heat_flux + long_name = kinematic surface upward sensible heat flux + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux + long_name = kinematic surface upward latent heat flux + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[wspd] + standard_name = wind_speed_at_lowest_model_layer + long_name = wind speed at lowest model level + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[br] + standard_name = bulk_richardson_number_at_lowest_model_level + long_name = bulk Richardson number at the surface + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rv] + standard_name = gas_constant_water_vapor + long_name = ideal gas constant for water vapor + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ep1] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = rv/rd - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ep2] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[xlv] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[dusfc] + standard_name = instantaneous_surface_x_momentum_flux + long_name = x momentum flux + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dvsfc] + standard_name = instantaneous_surface_y_momentum_flux + long_name = y momentum flux + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dtsfc] + standard_name = instantaneous_surface_upward_sensible_heat_flux + long_name = surface upward sensible heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dqsfc] + standard_name = instantaneous_surface_upward_latent_heat_flux + long_name = surface upward latent heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dt] + standard_name = time_step_for_physics + long_name = time step for physics + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[kpbl1d] + standard_name = vertical_index_at_top_of_atmosphere_boundary_layer + long_name = PBL top model level index + units = index + dimensions = (horizontal_dimension) + type = integer + intent = out + optional = F +[u10] + standard_name = x_wind_at_10m + long_name = x component of wind at 10 m + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v10] + standard_name = y_wind_at_10m + long_name = y component of wind at 10 m + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dx] + standard_name = cell_size + long_name = size of the grid cell + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F From 6d386f1f7e44f411a472f43cce9ec12cf899a59f Mon Sep 17 00:00:00 2001 From: climbfuji Date: Wed, 4 Sep 2019 10:09:54 -0600 Subject: [PATCH 84/89] Additional metadata conversion for new physics, bugfixes for sfc_cice --- physics/GFS_GWD_generic.F90 | 22 +- physics/GFS_GWD_generic.meta | 178 +++ physics/GFS_surface_composites.F90 | 165 +-- physics/GFS_surface_composites.meta | 1420 ++++++++++++++++++++ physics/cires_ugwp.F90 | 95 +- physics/cires_ugwp.meta | 766 +++++++++++ physics/cires_ugwp_post.F90 | 32 +- physics/cires_ugwp_post.meta | 269 ++++ physics/lsm_ruc_sfc_sice_interstitial.F90 | 24 +- physics/lsm_ruc_sfc_sice_interstitial.meta | 142 ++ physics/maximum_hourly_diagnostics.F90 | 30 +- physics/maximum_hourly_diagnostics.meta | 238 ++++ physics/sfc_cice.f | 30 +- physics/sfc_cice.meta | 240 ++++ 14 files changed, 3265 insertions(+), 386 deletions(-) create mode 100644 physics/GFS_GWD_generic.meta create mode 100644 physics/GFS_surface_composites.meta create mode 100644 physics/cires_ugwp.meta create mode 100644 physics/cires_ugwp_post.meta create mode 100644 physics/lsm_ruc_sfc_sice_interstitial.meta create mode 100644 physics/maximum_hourly_diagnostics.meta create mode 100644 physics/sfc_cice.meta diff --git a/physics/GFS_GWD_generic.F90 b/physics/GFS_GWD_generic.F90 index 94a74b75a..07606c051 100644 --- a/physics/GFS_GWD_generic.F90 +++ b/physics/GFS_GWD_generic.F90 @@ -12,27 +12,7 @@ subroutine GFS_GWD_generic_pre_init() end subroutine GFS_GWD_generic_pre_init !! \section arg_table_GFS_GWD_generic_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-------------------------------------------------------------------------|------------------------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal dimension | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | -!! | nmtvr | number_of_statistical_measures_of_subgrid_orography | number of statistical measures of subgrid orography | count | 0 | integer | | in | F | -!! | mntvar | statistical_measures_of_subgrid_orography | array of statistical measures of subgrid orography | various | 2 | real | kind_phys | in | F | -!! | hprime | standard_deviation_of_subgrid_orography | standard deviation of subgrid orography | m | 1 | real | kind_phys | out | F | -!! | oc | convexity_of_subgrid_orography | convexity of subgrid orography | none | 1 | real | kind_phys | out | F | -!! | oa4 | asymmetry_of_subgrid_orography | asymmetry of subgrid orography | none | 2 | real | kind_phys | out | F | -!! | clx | fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height | horizontal fraction of grid box covered by subgrid orography higher than critical height | frac | 2 | real | kind_phys | out | F | -!! | theta | angle_from_east_of_maximum_subgrid_orographic_variations | angle with_respect to east of maximum subgrid orographic variations | degrees | 1 | real | kind_phys | out | F | -!! | sigma | slope_of_subgrid_orography | slope of subgrid orography | none | 1 | real | kind_phys | out | F | -!! | gamma | anisotropy_of_subgrid_orography | anisotropy of subgrid orography | none | 1 | real | kind_phys | out | F | -!! | elvmax | maximum_subgrid_orography | maximum of subgrid orography | m | 1 | real | kind_phys | out | F | -!! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | -!! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | -!! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | in | F | -!! | dt3dt | cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag | cumulative change in temperature due to orographic gravity wave drag | K | 2 | real | kind_phys | inout | F | -!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_GWD_generic_pre_run.html !! !! \section general General Algorithm !! \section detailed Detailed Algorithm diff --git a/physics/GFS_GWD_generic.meta b/physics/GFS_GWD_generic.meta new file mode 100644 index 000000000..be493b80b --- /dev/null +++ b/physics/GFS_GWD_generic.meta @@ -0,0 +1,178 @@ +[ccpp-arg-table] + name = GFS_GWD_generic_pre_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = GFS_GWD_generic_pre_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[nmtvr] + standard_name = number_of_statistical_measures_of_subgrid_orography + long_name = number of statistical measures of subgrid orography + units = count + dimensions = () + type = integer + intent = in + optional = F +[mntvar] + standard_name = statistical_measures_of_subgrid_orography + long_name = array of statistical measures of subgrid orography + units = various + dimensions = (horizontal_dimension,number_of_statistical_measures_of_subgrid_orography) + type = real + kind = kind_phys + intent = in + optional = F +[hprime] + standard_name = standard_deviation_of_subgrid_orography + long_name = standard deviation of subgrid orography + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[oc] + standard_name = convexity_of_subgrid_orography + long_name = convexity of subgrid orography + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[oa4] + standard_name = asymmetry_of_subgrid_orography + long_name = asymmetry of subgrid orography + units = none + dimensions = (horizontal_dimension,4) + type = real + kind = kind_phys + intent = out + optional = F +[clx] + standard_name = fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height + long_name = horizontal fraction of grid box covered by subgrid orography higher than critical height + units = frac + dimensions = (horizontal_dimension,4) + type = real + kind = kind_phys + intent = out + optional = F +[theta] + standard_name = angle_from_east_of_maximum_subgrid_orographic_variations + long_name = angle with_respect to east of maximum subgrid orographic variations + units = degrees + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[sigma] + standard_name = slope_of_subgrid_orography + long_name = slope of subgrid orography + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[gamma] + standard_name = anisotropy_of_subgrid_orography + long_name = anisotropy of subgrid orography + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[elvmax] + standard_name = maximum_subgrid_orography + long_name = maximum of subgrid orography + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[lssav] + standard_name = flag_diagnostics + long_name = logical flag for storing diagnostics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for 3d diagnostic fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[dtdt] + standard_name = tendency_of_air_temperature_due_to_model_physics + long_name = updated tendency of the temperature + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dt3dt] + standard_name = cumulative_change_in_temperature_due_to_orographic_gravity_wave_drag + long_name = cumulative change in temperature due to orographic gravity wave drag + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dtf] + standard_name = time_step_for_dynamics + long_name = dynamics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_GWD_generic_pre_finalize + type = scheme diff --git a/physics/GFS_surface_composites.F90 b/physics/GFS_surface_composites.F90 index 858acaaa7..2a01ab249 100644 --- a/physics/GFS_surface_composites.F90 +++ b/physics/GFS_surface_composites.F90 @@ -21,60 +21,7 @@ end subroutine GFS_surface_composites_pre_finalize #if 0 !> \section arg_table_GFS_surface_composites_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------------------|----------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | frac_grid | flag_for_fractional_grid | flag for fractional grid | flag | 0 | logical | | in | F | -!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | in | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | -!! | landfrac | land_area_fraction | fraction of horizontal grid area occupied by land | frac | 1 | real | kind_phys | in | F | -!! | lakefrac | lake_area_fraction | fraction of horizontal grid area occupied by lake | frac | 1 | real | kind_phys | in | F | -!! | oceanfrac | sea_area_fraction | fraction of horizontal grid area occupied by ocean | frac | 1 | real | kind_phys | in | F | -!! | frland | land_area_fraction_for_microphysics | land area fraction used in microphysics schemes | frac | 1 | real | kind_phys | out | F | -!! | dry | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | inout | F | -!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | inout | F | -!! | lake | flag_nonzero_lake_surface_fraction | flag indicating presence of some lake surface area fraction | flag | 1 | logical | | inout | F | -!! | ocean | flag_nonzero_ocean_surface_fraction | flag indicating presence of some ocean surface area fraction | flag | 1 | logical | | inout | F | -!! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | inout | F | -!! | cice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | -!! | cimin | minimum_sea_ice_concentration | minimum sea ice concentration | frac | 0 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length | cm | 1 | real | kind_phys | in | F | -!! | zorlo | surface_roughness_length_over_ocean | surface roughness length over ocean | cm | 1 | real | kind_phys | inout | F | -!! | zorll | surface_roughness_length_over_land | surface roughness length over land | cm | 1 | real | kind_phys | inout | F | -!! | zorl_ocn | surface_roughness_length_over_ocean_interstitial | surface roughness length over ocean (temporary use as interstitial) | cm | 1 | real | kind_phys | inout | F | -!! | zorl_lnd | surface_roughness_length_over_land_interstitial | surface roughness length over land (temporary use as interstitial) | cm | 1 | real | kind_phys | inout | F | -!! | zorl_ice | surface_roughness_length_over_ice_interstitial | surface roughness length over ice (temporary use as interstitial) | cm | 1 | real | kind_phys | inout | F | -!! | snowd | surface_snow_thickness_water_equivalent | water equivalent snow depth | mm | 1 | real | kind_phys | in | F | -!! | snowd_ocn | surface_snow_thickness_water_equivalent_over_ocean | water equivalent snow depth over ocean | mm | 1 | real | kind_phys | inout | F | -!! | snowd_lnd | surface_snow_thickness_water_equivalent_over_land | water equivalent snow depth over land | mm | 1 | real | kind_phys | inout | F | -!! | snowd_ice | surface_snow_thickness_water_equivalent_over_ice | water equivalent snow depth over ice | mm | 1 | real | kind_phys | inout | F | -!! | tprcp | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total precipitation amount in each time step | m | 1 | real | kind_phys | in | F | -!! | tprcp_ocn | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ocean | total precipitation amount in each time step over ocean | m | 1 | real | kind_phys | inout | F | -!! | tprcp_lnd | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_land | total precipitation amount in each time step over land | m | 1 | real | kind_phys | inout | F | -!! | tprcp_ice | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ice | total precipitation amount in each time step over ice | m | 1 | real | kind_phys | inout | F | -!! | uustar | surface_friction_velocity | boundary layer parameter | m s-1 | 1 | real | kind_phys | in | F | -!! | uustar_lnd | surface_friction_velocity_over_land | surface friction velocity over land | m s-1 | 1 | real | kind_phys | inout | F | -!! | uustar_ice | surface_friction_velocity_over_ice | surface friction velocity over ice | m s-1 | 1 | real | kind_phys | inout | F | -!! | weasd | water_equivalent_accumulated_snow_depth | water equiv of acc snow depth over land and sea ice | mm | 1 | real | kind_phys | in | F | -!! | weasd_ocn | water_equivalent_accumulated_snow_depth_over_ocean | water equiv of acc snow depth over ocean | mm | 1 | real | kind_phys | inout | F | -!! | weasd_lnd | water_equivalent_accumulated_snow_depth_over_land | water equiv of acc snow depth over land | mm | 1 | real | kind_phys | inout | F | -!! | weasd_ice | water_equivalent_accumulated_snow_depth_over_ice | water equiv of acc snow depth over ice | mm | 1 | real | kind_phys | inout | F | -!! | ep1d_ice | surface_upward_potential_latent_heat_flux_over_ice | surface upward potential latent heat flux over ice | W m-2 | 1 | real | kind_phys | inout | F | -!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | inout | F | -!! | tsfco | sea_surface_temperature | sea surface temperature | K | 1 | real | kind_phys | inout | F | -!! | tsfcl | surface_skin_temperature_over_land | surface skin temperature over land | K | 1 | real | kind_phys | inout | F | -!! | tsfc_ocn | surface_skin_temperature_over_ocean_interstitial | surface skin temperature over ocean (temporary use as interstitial) | K | 1 | real | kind_phys | inout | F | -!! | tsfc_lnd | surface_skin_temperature_over_land_interstitial | surface skin temperature over land (temporary use as interstitial) | K | 1 | real | kind_phys | inout | F | -!! | tsfc_ice | surface_skin_temperature_over_ice_interstitial | surface skin temperature over ice (temporary use as interstitial) | K | 1 | real | kind_phys | inout | F | -!! | tisfc | sea_ice_temperature | sea ice surface skin temperature | K | 1 | real | kind_phys | inout | F | -!! | tice | sea_ice_temperature_interstitial | sea ice surface skin temperature use as interstitial | K | 1 | real | kind_phys | out | F | -!! | tsurf | surface_skin_temperature_after_iteration | surface skin temperature after iteration | K | 1 | real | kind_phys | inout | F | -!! | tsurf_ocn | surface_skin_temperature_after_iteration_over_ocean | surface skin temperature after iteration over ocean | K | 1 | real | kind_phys | inout | F | -!! | tsurf_lnd | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | inout | F | -!! | tsurf_ice | surface_skin_temperature_after_iteration_over_ice | surface skin temperature after iteration over ice | K | 1 | real | kind_phys | inout | F | -!! | gflx_ice | upward_heat_flux_in_soil_over_ice | soil heat flux over ice | W m-2 | 1 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_surface_composites_pre_run.html !! #endif subroutine GFS_surface_composites_pre_run (im, frac_grid, flag_cice, cplflx, landfrac, lakefrac, oceanfrac, & @@ -215,115 +162,7 @@ end subroutine GFS_surface_composites_post_finalize #if 0 !> \section arg_table_GFS_surface_composites_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|-------------|------|------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | -!! | frac_grid | flag_for_fractional_grid | flag for fractional grid | flag | 0 | logical | | in | F | -!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | in | F | -!! | islmsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | in | F | -!! | dry | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | -!! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | -!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | -!! | landfrac | land_area_fraction | fraction of horizontal grid area occupied by land | frac | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length | cm | 1 | real | kind_phys | inout | F | -!! | zorlo | surface_roughness_length_over_ocean | surface roughness length over ocean | cm | 1 | real | kind_phys | inout | F | -!! | zorll | surface_roughness_length_over_land | surface roughness length over land | cm | 1 | real | kind_phys | inout | F | -!! | zorl_ocn | surface_roughness_length_over_ocean_interstitial | surface roughness length over ocean (temporary use as interstitial) | cm | 1 | real | kind_phys | in | F | -!! | zorl_lnd | surface_roughness_length_over_land_interstitial | surface roughness length over land (temporary use as interstitial) | cm | 1 | real | kind_phys | in | F | -!! | zorl_ice | surface_roughness_length_over_ice_interstitial | surface roughness length over ice (temporary use as interstitial) | cm | 1 | real | kind_phys | in | F | -!! | cd | surface_drag_coefficient_for_momentum_in_air | surface exchange coeff for momentum | none | 1 | real | kind_phys | inout | F | -!! | cd_ocn | surface_drag_coefficient_for_momentum_in_air_over_ocean | surface exchange coeff for momentum over ocean | none | 1 | real | kind_phys | in | F | -!! | cd_lnd | surface_drag_coefficient_for_momentum_in_air_over_land | surface exchange coeff for momentum over land | none | 1 | real | kind_phys | in | F | -!! | cd_ice | surface_drag_coefficient_for_momentum_in_air_over_ice | surface exchange coeff for momentum over ice | none | 1 | real | kind_phys | in | F | -!! | cdq | surface_drag_coefficient_for_heat_and_moisture_in_air | surface exchange coeff heat & moisture | none | 1 | real | kind_phys | inout | F | -!! | cdq_ocn | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ocean | surface exchange coeff heat & moisture over ocean | none | 1 | real | kind_phys | in | F | -!! | cdq_lnd | surface_drag_coefficient_for_heat_and_moisture_in_air_over_land | surface exchange coeff heat & moisture over land | none | 1 | real | kind_phys | in | F | -!! | cdq_ice | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice | surface exchange coeff heat & moisture over ice | none | 1 | real | kind_phys | in | F | -!! | rb | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | inout | F | -!! | rb_ocn | bulk_richardson_number_at_lowest_model_level_over_ocean | bulk Richardson number at the surface over ocean | none | 1 | real | kind_phys | in | F | -!! | rb_lnd | bulk_richardson_number_at_lowest_model_level_over_land | bulk Richardson number at the surface over land | none | 1 | real | kind_phys | in | F | -!! | rb_ice | bulk_richardson_number_at_lowest_model_level_over_ice | bulk Richardson number at the surface over ice | none | 1 | real | kind_phys | in | F | -!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | inout | F | -!! | stress_ocn | surface_wind_stress_over_ocean | surface wind stress over ocean | m2 s-2 | 1 | real | kind_phys | in | F | -!! | stress_lnd | surface_wind_stress_over_land | surface wind stress over land | m2 s-2 | 1 | real | kind_phys | in | F | -!! | stress_ice | surface_wind_stress_over_ice | surface wind stress over ice | m2 s-2 | 1 | real | kind_phys | in | F | -!! | ffmm | Monin_Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | inout | F | -!! | ffmm_ocn | Monin_Obukhov_similarity_function_for_momentum_over_ocean | Monin-Obukhov similarity function for momentum over ocean | none | 1 | real | kind_phys | in | F | -!! | ffmm_lnd | Monin_Obukhov_similarity_function_for_momentum_over_land | Monin-Obukhov similarity function for momentum over land | none | 1 | real | kind_phys | in | F | -!! | ffmm_ice | Monin_Obukhov_similarity_function_for_momentum_over_ice | Monin-Obukhov similarity function for momentum over ice | none | 1 | real | kind_phys | in | F | -!! | ffhh | Monin_Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | inout | F | -!! | ffhh_ocn | Monin_Obukhov_similarity_function_for_heat_over_ocean | Monin-Obukhov similarity function for heat over ocean | none | 1 | real | kind_phys | in | F | -!! | ffhh_lnd | Monin_Obukhov_similarity_function_for_heat_over_land | Monin-Obukhov similarity function for heat over land | none | 1 | real | kind_phys | in | F | -!! | ffhh_ice | Monin_Obukhov_similarity_function_for_heat_over_ice | Monin-Obukhov similarity function for heat over ice | none | 1 | real | kind_phys | in | F | -!! | uustar | surface_friction_velocity | boundary layer parameter | m s-1 | 1 | real | kind_phys | inout | F | -!! | uustar_ocn | surface_friction_velocity_over_ocean | surface friction velocity over ocean | m s-1 | 1 | real | kind_phys | in | F | -!! | uustar_lnd | surface_friction_velocity_over_land | surface friction velocity over land | m s-1 | 1 | real | kind_phys | in | F | -!! | uustar_ice | surface_friction_velocity_over_ice | surface friction velocity over ice | m s-1 | 1 | real | kind_phys | in | F | -!! | fm10 | Monin_Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum at 10m | none | 1 | real | kind_phys | inout | F | -!! | fm10_ocn | Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ocean | Monin-Obukhov similarity parameter for momentum at 10m over ocean | none | 1 | real | kind_phys | in | F | -!! | fm10_lnd | Monin_Obukhov_similarity_function_for_momentum_at_10m_over_land | Monin-Obukhov similarity parameter for momentum at 10m over land | none | 1 | real | kind_phys | in | F | -!! | fm10_ice | Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ice | Monin-Obukhov similarity parameter for momentum at 10m over ice | none | 1 | real | kind_phys | in | F | -!! | fh2 | Monin_Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat at 2m | none | 1 | real | kind_phys | inout | F | -!! | fh2_ocn | Monin_Obukhov_similarity_function_for_heat_at_2m_over_ocean | Monin-Obukhov similarity parameter for heat at 2m over ocean | none | 1 | real | kind_phys | in | F | -!! | fh2_lnd | Monin_Obukhov_similarity_function_for_heat_at_2m_over_land | Monin-Obukhov similarity parameter for heat at 2m over land | none | 1 | real | kind_phys | in | F | -!! | fh2_ice | Monin_Obukhov_similarity_function_for_heat_at_2m_over_ice | Monin-Obukhov similarity parameter for heat at 2m over ice | none | 1 | real | kind_phys | in | F | -!! | tsurf | surface_skin_temperature_after_iteration | surface skin temperature after iteration | K | 1 | real | kind_phys | inout | F | -!! | tsurf_ocn | surface_skin_temperature_after_iteration_over_ocean | surface skin temperature after iteration over ocean | K | 1 | real | kind_phys | in | F | -!! | tsurf_lnd | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | in | F | -!! | tsurf_ice | surface_skin_temperature_after_iteration_over_ice | surface skin temperature after iteration over ice | K | 1 | real | kind_phys | in | F | -!! | cmm | surface_drag_wind_speed_for_momentum_in_air | momentum exchange coefficient | m s-1 | 1 | real | kind_phys | inout | F | -!! | cmm_ocn | surface_drag_wind_speed_for_momentum_in_air_over_ocean | momentum exchange coefficient over ocean | m s-1 | 1 | real | kind_phys | in | F | -!! | cmm_lnd | surface_drag_wind_speed_for_momentum_in_air_over_land | momentum exchange coefficient over land | m s-1 | 1 | real | kind_phys | in | F | -!! | cmm_ice | surface_drag_wind_speed_for_momentum_in_air_over_ice | momentum exchange coefficient over ice | m s-1 | 1 | real | kind_phys | in | F | -!! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air | thermal exchange coefficient | kg m-2 s-1 | 1 | real | kind_phys | inout | F | -!! | chh_ocn | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ocean | thermal exchange coefficient over ocean | kg m-2 s-1 | 1 | real | kind_phys | in | F | -!! | chh_lnd | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land | thermal exchange coefficient over land | kg m-2 s-1 | 1 | real | kind_phys | in | F | -!! | chh_ice | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ice | thermal exchange coefficient over ice | kg m-2 s-1 | 1 | real | kind_phys | in | F | -!! | gflx | upward_heat_flux_in_soil | soil heat flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | gflx_ocn | upward_heat_flux_in_soil_over_ocean | soil heat flux over ocean | W m-2 | 1 | real | kind_phys | in | F | -!! | gflx_lnd | upward_heat_flux_in_soil_over_land | soil heat flux over land | W m-2 | 1 | real | kind_phys | in | F | -!! | gflx_ice | upward_heat_flux_in_soil_over_ice | soil heat flux over ice | W m-2 | 1 | real | kind_phys | in | F | -!! | ep1d | surface_upward_potential_latent_heat_flux | surface upward potential latent heat flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | ep1d_ocn | surface_upward_potential_latent_heat_flux_over_ocean | surface upward potential latent heat flux over ocean | W m-2 | 1 | real | kind_phys | in | F | -!! | ep1d_lnd | surface_upward_potential_latent_heat_flux_over_land | surface upward potential latent heat flux over land | W m-2 | 1 | real | kind_phys | in | F | -!! | ep1d_ice | surface_upward_potential_latent_heat_flux_over_ice | surface upward potential latent heat flux over ice | W m-2 | 1 | real | kind_phys | in | F | -!! | weasd | water_equivalent_accumulated_snow_depth | water equiv of acc snow depth over land and sea ice | mm | 1 | real | kind_phys | inout | F | -!! | weasd_ocn | water_equivalent_accumulated_snow_depth_over_ocean | water equiv of acc snow depth over ocean | mm | 1 | real | kind_phys | in | F | -!! | weasd_lnd | water_equivalent_accumulated_snow_depth_over_land | water equiv of acc snow depth over land | mm | 1 | real | kind_phys | in | F | -!! | weasd_ice | water_equivalent_accumulated_snow_depth_over_ice | water equiv of acc snow depth over ice | mm | 1 | real | kind_phys | in | F | -!! | snowd | surface_snow_thickness_water_equivalent | water equivalent snow depth | mm | 1 | real | kind_phys | inout | F | -!! | snowd_ocn | surface_snow_thickness_water_equivalent_over_ocean | water equivalent snow depth over ocean | mm | 1 | real | kind_phys | in | F | -!! | snowd_lnd | surface_snow_thickness_water_equivalent_over_land | water equivalent snow depth over land | mm | 1 | real | kind_phys | in | F | -!! | snowd_ice | surface_snow_thickness_water_equivalent_over_ice | water equivalent snow depth over ice | mm | 1 | real | kind_phys | in | F | -!! | tprcp | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total precipitation amount in each time step | m | 1 | real | kind_phys | inout | F | -!! | tprcp_ocn | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ocean | total precipitation amount in each time step over ocean | m | 1 | real | kind_phys | in | F | -!! | tprcp_lnd | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_land | total precipitation amount in each time step over land | m | 1 | real | kind_phys | in | F | -!! | tprcp_ice | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ice | total precipitation amount in each time step over ice | m | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | inout | F | -!! | evap_ocn | kinematic_surface_upward_latent_heat_flux_over_ocean | kinematic surface upward latent heat flux over ocean | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | evap_lnd | kinematic_surface_upward_latent_heat_flux_over_land | kinematic surface upward latent heat flux over land | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | evap_ice | kinematic_surface_upward_latent_heat_flux_over_ice | kinematic surface upward latent heat flux over ice | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | hflx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | inout | F | -!! | hflx_ocn | kinematic_surface_upward_sensible_heat_flux_over_ocean | kinematic surface upward sensible heat flux over ocean | K m s-1 | 1 | real | kind_phys | in | F | -!! | hflx_lnd | kinematic_surface_upward_sensible_heat_flux_over_land | kinematic surface upward sensible heat flux over land | K m s-1 | 1 | real | kind_phys | in | F | -!! | hflx_ice | kinematic_surface_upward_sensible_heat_flux_over_ice | kinematic surface upward sensible heat flux over ice | K m s-1 | 1 | real | kind_phys | in | F | -!! | qss | surface_specific_humidity | surface air saturation specific humidity | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | qss_ocn | surface_specific_humidity_over_ocean | surface air saturation specific humidity over ocean | kg kg-1 | 1 | real | kind_phys | in | F | -!! | qss_lnd | surface_specific_humidity_over_land | surface air saturation specific humidity over land | kg kg-1 | 1 | real | kind_phys | in | F | -!! | qss_ice | surface_specific_humidity_over_ice | surface air saturation specific humidity over ice | kg kg-1 | 1 | real | kind_phys | in | F | -!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | inout | F | -!! | tsfco | sea_surface_temperature | sea surface temperature | K | 1 | real | kind_phys | inout | F | -!! | tsfcl | surface_skin_temperature_over_land | surface skin temperature over land | K | 1 | real | kind_phys | inout | F | -!! | tsfc_ocn | surface_skin_temperature_over_ocean_interstitial | surface skin temperature over ocean (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | -!! | tsfc_lnd | surface_skin_temperature_over_land_interstitial | surface skin temperature over land (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | -!! | tsfc_ice | surface_skin_temperature_over_ice_interstitial | surface skin temperature over ice (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | -!! | tisfc | sea_ice_temperature | sea ice surface skin temperature | K | 1 | real | kind_phys | inout | F | -!! | tice | sea_ice_temperature_interstitial | sea ice surface skin temperature use as interstitial | K | 1 | real | kind_phys | in | F | -!! | hice | sea_ice_thickness | sea ice thickness | m | 1 | real | kind_phys | inout | F | -!! | cice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude GFS_surface_composites_post_run.html !! #endif subroutine GFS_surface_composites_post_run ( & diff --git a/physics/GFS_surface_composites.meta b/physics/GFS_surface_composites.meta new file mode 100644 index 000000000..4e8609ded --- /dev/null +++ b/physics/GFS_surface_composites.meta @@ -0,0 +1,1420 @@ +[ccpp-arg-table] + name = GFS_surface_composites_pre_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[frac_grid] + standard_name = flag_for_fractional_grid + long_name = flag for fractional grid + units = flag + dimensions = () + type = logical + intent = in + optional = F +[flag_cice] + standard_name = flag_for_cice + long_name = flag for cice + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[cplflx] + standard_name = flag_for_flux_coupling + long_name = flag controlling cplflx collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[landfrac] + standard_name = land_area_fraction + long_name = fraction of horizontal grid area occupied by land + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[lakefrac] + standard_name = lake_area_fraction + long_name = fraction of horizontal grid area occupied by lake + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[oceanfrac] + standard_name = sea_area_fraction + long_name = fraction of horizontal grid area occupied by ocean + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[frland] + standard_name = land_area_fraction_for_microphysics + long_name = land area fraction used in microphysics schemes + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dry] + standard_name = flag_nonzero_land_surface_fraction + long_name = flag indicating presence of some land surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = inout + optional = F +[icy] + standard_name = flag_nonzero_sea_ice_surface_fraction + long_name = flag indicating presence of some sea ice surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = inout + optional = F +[lake] + standard_name = flag_nonzero_lake_surface_fraction + long_name = flag indicating presence of some lake surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = inout + optional = F +[ocean] + standard_name = flag_nonzero_ocean_surface_fraction + long_name = flag indicating presence of some ocean surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = inout + optional = F +[wet] + standard_name = flag_nonzero_wet_surface_fraction + long_name = flag indicating presence of some ocean or lake surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = inout + optional = F +[cice] + standard_name = sea_ice_concentration + long_name = ice fraction over open water + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cimin] + standard_name = minimum_sea_ice_concentration + long_name = minimum sea ice concentration + units = frac + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[zorl] + standard_name = surface_roughness_length + long_name = surface roughness length + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zorlo] + standard_name = surface_roughness_length_over_ocean + long_name = surface roughness length over ocean + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[zorll] + standard_name = surface_roughness_length_over_land + long_name = surface roughness length over land + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[zorl_ocn] + standard_name = surface_roughness_length_over_ocean_interstitial + long_name = surface roughness length over ocean (temporary use as interstitial) + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[zorl_lnd] + standard_name = surface_roughness_length_over_land_interstitial + long_name = surface roughness length over land (temporary use as interstitial) + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[zorl_ice] + standard_name = surface_roughness_length_over_ice_interstitial + long_name = surface roughness length over ice (temporary use as interstitial) + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snowd] + standard_name = surface_snow_thickness_water_equivalent + long_name = water equivalent snow depth + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snowd_ocn] + standard_name = surface_snow_thickness_water_equivalent_over_ocean + long_name = water equivalent snow depth over ocean + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snowd_lnd] + standard_name = surface_snow_thickness_water_equivalent_over_land + long_name = water equivalent snow depth over land + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snowd_ice] + standard_name = surface_snow_thickness_water_equivalent_over_ice + long_name = water equivalent snow depth over ice + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tprcp] + standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep + long_name = total precipitation amount in each time step + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tprcp_ocn] + standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ocean + long_name = total precipitation amount in each time step over ocean + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tprcp_lnd] + standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_land + long_name = total precipitation amount in each time step over land + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tprcp_ice] + standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ice + long_name = total precipitation amount in each time step over ice + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[uustar] + standard_name = surface_friction_velocity + long_name = boundary layer parameter + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[uustar_lnd] + standard_name = surface_friction_velocity_over_land + long_name = surface friction velocity over land + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[uustar_ice] + standard_name = surface_friction_velocity_over_ice + long_name = surface friction velocity over ice + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[weasd] + standard_name = water_equivalent_accumulated_snow_depth + long_name = water equiv of acc snow depth over land and sea ice + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[weasd_ocn] + standard_name = water_equivalent_accumulated_snow_depth_over_ocean + long_name = water equiv of acc snow depth over ocean + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[weasd_lnd] + standard_name = water_equivalent_accumulated_snow_depth_over_land + long_name = water equiv of acc snow depth over land + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[weasd_ice] + standard_name = water_equivalent_accumulated_snow_depth_over_ice + long_name = water equiv of acc snow depth over ice + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ep1d_ice] + standard_name = surface_upward_potential_latent_heat_flux_over_ice + long_name = surface upward potential latent heat flux over ice + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsfc] + standard_name = surface_skin_temperature + long_name = surface skin temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsfco] + standard_name = sea_surface_temperature + long_name = sea surface temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsfcl] + standard_name = surface_skin_temperature_over_land + long_name = surface skin temperature over land + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsfc_ocn] + standard_name = surface_skin_temperature_over_ocean_interstitial + long_name = surface skin temperature over ocean (temporary use as interstitial) + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsfc_lnd] + standard_name = surface_skin_temperature_over_land_interstitial + long_name = surface skin temperature over land (temporary use as interstitial) + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsfc_ice] + standard_name = surface_skin_temperature_over_ice_interstitial + long_name = surface skin temperature over ice (temporary use as interstitial) + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tisfc] + standard_name = sea_ice_temperature + long_name = sea ice surface skin temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tice] + standard_name = sea_ice_temperature_interstitial + long_name = sea ice surface skin temperature use as interstitial + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[tsurf] + standard_name = surface_skin_temperature_after_iteration + long_name = surface skin temperature after iteration + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsurf_ocn] + standard_name = surface_skin_temperature_after_iteration_over_ocean + long_name = surface skin temperature after iteration over ocean + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsurf_lnd] + standard_name = surface_skin_temperature_after_iteration_over_land + long_name = surface skin temperature after iteration over land + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsurf_ice] + standard_name = surface_skin_temperature_after_iteration_over_ice + long_name = surface skin temperature after iteration over ice + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gflx_ice] + standard_name = upward_heat_flux_in_soil_over_ice + long_name = soil heat flux over ice + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = GFS_surface_composites_post_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[cplflx] + standard_name = flag_for_flux_coupling + long_name = flag controlling cplflx collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[frac_grid] + standard_name = flag_for_fractional_grid + long_name = flag for fractional grid + units = flag + dimensions = () + type = logical + intent = in + optional = F +[flag_cice] + standard_name = flag_for_cice + long_name = flag for cice + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[islmsk] + standard_name = sea_land_ice_mask + long_name = sea/land/ice mask (=0/1/2) + units = flag + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[dry] + standard_name = flag_nonzero_land_surface_fraction + long_name = flag indicating presence of some land surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[wet] + standard_name = flag_nonzero_wet_surface_fraction + long_name = flag indicating presence of some ocean or lake surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[icy] + standard_name = flag_nonzero_sea_ice_surface_fraction + long_name = flag indicating presence of some sea ice surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[landfrac] + standard_name = land_area_fraction + long_name = fraction of horizontal grid area occupied by land + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zorl] + standard_name = surface_roughness_length + long_name = surface roughness length + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[zorlo] + standard_name = surface_roughness_length_over_ocean + long_name = surface roughness length over ocean + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[zorll] + standard_name = surface_roughness_length_over_land + long_name = surface roughness length over land + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[zorl_ocn] + standard_name = surface_roughness_length_over_ocean_interstitial + long_name = surface roughness length over ocean (temporary use as interstitial) + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zorl_lnd] + standard_name = surface_roughness_length_over_land_interstitial + long_name = surface roughness length over land (temporary use as interstitial) + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zorl_ice] + standard_name = surface_roughness_length_over_ice_interstitial + long_name = surface roughness length over ice (temporary use as interstitial) + units = cm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cd] + standard_name = surface_drag_coefficient_for_momentum_in_air + long_name = surface exchange coeff for momentum + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cd_ocn] + standard_name = surface_drag_coefficient_for_momentum_in_air_over_ocean + long_name = surface exchange coeff for momentum over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cd_lnd] + standard_name = surface_drag_coefficient_for_momentum_in_air_over_land + long_name = surface exchange coeff for momentum over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cd_ice] + standard_name = surface_drag_coefficient_for_momentum_in_air_over_ice + long_name = surface exchange coeff for momentum over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cdq] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air + long_name = surface exchange coeff heat & moisture + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cdq_ocn] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_ocean + long_name = surface exchange coeff heat & moisture over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cdq_lnd] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_land + long_name = surface exchange coeff heat & moisture over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cdq_ice] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice + long_name = surface exchange coeff heat & moisture over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rb] + standard_name = bulk_richardson_number_at_lowest_model_level + long_name = bulk Richardson number at the surface + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rb_ocn] + standard_name = bulk_richardson_number_at_lowest_model_level_over_ocean + long_name = bulk Richardson number at the surface over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rb_lnd] + standard_name = bulk_richardson_number_at_lowest_model_level_over_land + long_name = bulk Richardson number at the surface over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[rb_ice] + standard_name = bulk_richardson_number_at_lowest_model_level_over_ice + long_name = bulk Richardson number at the surface over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[stress] + standard_name = surface_wind_stress + long_name = surface wind stress + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[stress_ocn] + standard_name = surface_wind_stress_over_ocean + long_name = surface wind stress over ocean + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[stress_lnd] + standard_name = surface_wind_stress_over_land + long_name = surface wind stress over land + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[stress_ice] + standard_name = surface_wind_stress_over_ice + long_name = surface wind stress over ice + units = m2 s-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ffmm] + standard_name = Monin_Obukhov_similarity_function_for_momentum + long_name = Monin-Obukhov similarity function for momentum + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ffmm_ocn] + standard_name = Monin_Obukhov_similarity_function_for_momentum_over_ocean + long_name = Monin-Obukhov similarity function for momentum over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ffmm_lnd] + standard_name = Monin_Obukhov_similarity_function_for_momentum_over_land + long_name = Monin-Obukhov similarity function for momentum over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ffmm_ice] + standard_name = Monin_Obukhov_similarity_function_for_momentum_over_ice + long_name = Monin-Obukhov similarity function for momentum over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ffhh] + standard_name = Monin_Obukhov_similarity_function_for_heat + long_name = Monin-Obukhov similarity function for heat + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ffhh_ocn] + standard_name = Monin_Obukhov_similarity_function_for_heat_over_ocean + long_name = Monin-Obukhov similarity function for heat over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ffhh_lnd] + standard_name = Monin_Obukhov_similarity_function_for_heat_over_land + long_name = Monin-Obukhov similarity function for heat over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ffhh_ice] + standard_name = Monin_Obukhov_similarity_function_for_heat_over_ice + long_name = Monin-Obukhov similarity function for heat over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[uustar] + standard_name = surface_friction_velocity + long_name = boundary layer parameter + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[uustar_ocn] + standard_name = surface_friction_velocity_over_ocean + long_name = surface friction velocity over ocean + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[uustar_lnd] + standard_name = surface_friction_velocity_over_land + long_name = surface friction velocity over land + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[uustar_ice] + standard_name = surface_friction_velocity_over_ice + long_name = surface friction velocity over ice + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fm10] + standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m + long_name = Monin-Obukhov similarity parameter for momentum at 10m + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fm10_ocn] + standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ocean + long_name = Monin-Obukhov similarity parameter for momentum at 10m over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fm10_lnd] + standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m_over_land + long_name = Monin-Obukhov similarity parameter for momentum at 10m over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fm10_ice] + standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m_over_ice + long_name = Monin-Obukhov similarity parameter for momentum at 10m over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fh2] + standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m + long_name = Monin-Obukhov similarity parameter for heat at 2m + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[fh2_ocn] + standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m_over_ocean + long_name = Monin-Obukhov similarity parameter for heat at 2m over ocean + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fh2_lnd] + standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m_over_land + long_name = Monin-Obukhov similarity parameter for heat at 2m over land + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[fh2_ice] + standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m_over_ice + long_name = Monin-Obukhov similarity parameter for heat at 2m over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsurf] + standard_name = surface_skin_temperature_after_iteration + long_name = surface skin temperature after iteration + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsurf_ocn] + standard_name = surface_skin_temperature_after_iteration_over_ocean + long_name = surface skin temperature after iteration over ocean + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsurf_lnd] + standard_name = surface_skin_temperature_after_iteration_over_land + long_name = surface skin temperature after iteration over land + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsurf_ice] + standard_name = surface_skin_temperature_after_iteration_over_ice + long_name = surface skin temperature after iteration over ice + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cmm] + standard_name = surface_drag_wind_speed_for_momentum_in_air + long_name = momentum exchange coefficient + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cmm_ocn] + standard_name = surface_drag_wind_speed_for_momentum_in_air_over_ocean + long_name = momentum exchange coefficient over ocean + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cmm_lnd] + standard_name = surface_drag_wind_speed_for_momentum_in_air_over_land + long_name = momentum exchange coefficient over land + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cmm_ice] + standard_name = surface_drag_wind_speed_for_momentum_in_air_over_ice + long_name = momentum exchange coefficient over ice + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[chh] + standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air + long_name = thermal exchange coefficient + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[chh_ocn] + standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ocean + long_name = thermal exchange coefficient over ocean + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[chh_lnd] + standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land + long_name = thermal exchange coefficient over land + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[chh_ice] + standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ice + long_name = thermal exchange coefficient over ice + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gflx] + standard_name = upward_heat_flux_in_soil + long_name = soil heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[gflx_ocn] + standard_name = upward_heat_flux_in_soil_over_ocean + long_name = soil heat flux over ocean + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gflx_lnd] + standard_name = upward_heat_flux_in_soil_over_land + long_name = soil heat flux over land + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gflx_ice] + standard_name = upward_heat_flux_in_soil_over_ice + long_name = soil heat flux over ice + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ep1d] + standard_name = surface_upward_potential_latent_heat_flux + long_name = surface upward potential latent heat flux + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[ep1d_ocn] + standard_name = surface_upward_potential_latent_heat_flux_over_ocean + long_name = surface upward potential latent heat flux over ocean + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ep1d_lnd] + standard_name = surface_upward_potential_latent_heat_flux_over_land + long_name = surface upward potential latent heat flux over land + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ep1d_ice] + standard_name = surface_upward_potential_latent_heat_flux_over_ice + long_name = surface upward potential latent heat flux over ice + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[weasd] + standard_name = water_equivalent_accumulated_snow_depth + long_name = water equiv of acc snow depth over land and sea ice + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[weasd_ocn] + standard_name = water_equivalent_accumulated_snow_depth_over_ocean + long_name = water equiv of acc snow depth over ocean + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[weasd_lnd] + standard_name = water_equivalent_accumulated_snow_depth_over_land + long_name = water equiv of acc snow depth over land + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[weasd_ice] + standard_name = water_equivalent_accumulated_snow_depth_over_ice + long_name = water equiv of acc snow depth over ice + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snowd] + standard_name = surface_snow_thickness_water_equivalent + long_name = water equivalent snow depth + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[snowd_ocn] + standard_name = surface_snow_thickness_water_equivalent_over_ocean + long_name = water equivalent snow depth over ocean + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snowd_lnd] + standard_name = surface_snow_thickness_water_equivalent_over_land + long_name = water equivalent snow depth over land + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[snowd_ice] + standard_name = surface_snow_thickness_water_equivalent_over_ice + long_name = water equivalent snow depth over ice + units = mm + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tprcp] + standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep + long_name = total precipitation amount in each time step + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tprcp_ocn] + standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ocean + long_name = total precipitation amount in each time step over ocean + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tprcp_lnd] + standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_land + long_name = total precipitation amount in each time step over land + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tprcp_ice] + standard_name = nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ice + long_name = total precipitation amount in each time step over ice + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux + long_name = kinematic surface upward latent heat flux + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[evap_ocn] + standard_name = kinematic_surface_upward_latent_heat_flux_over_ocean + long_name = kinematic surface upward latent heat flux over ocean + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[evap_lnd] + standard_name = kinematic_surface_upward_latent_heat_flux_over_land + long_name = kinematic surface upward latent heat flux over land + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[evap_ice] + standard_name = kinematic_surface_upward_latent_heat_flux_over_ice + long_name = kinematic surface upward latent heat flux over ice + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[hflx] + standard_name = kinematic_surface_upward_sensible_heat_flux + long_name = kinematic surface upward sensible heat flux + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[hflx_ocn] + standard_name = kinematic_surface_upward_sensible_heat_flux_over_ocean + long_name = kinematic surface upward sensible heat flux over ocean + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[hflx_lnd] + standard_name = kinematic_surface_upward_sensible_heat_flux_over_land + long_name = kinematic surface upward sensible heat flux over land + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[hflx_ice] + standard_name = kinematic_surface_upward_sensible_heat_flux_over_ice + long_name = kinematic surface upward sensible heat flux over ice + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qss] + standard_name = surface_specific_humidity + long_name = surface air saturation specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[qss_ocn] + standard_name = surface_specific_humidity_over_ocean + long_name = surface air saturation specific humidity over ocean + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qss_lnd] + standard_name = surface_specific_humidity_over_land + long_name = surface air saturation specific humidity over land + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qss_ice] + standard_name = surface_specific_humidity_over_ice + long_name = surface air saturation specific humidity over ice + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsfc] + standard_name = surface_skin_temperature + long_name = surface skin temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsfco] + standard_name = sea_surface_temperature + long_name = sea surface temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsfcl] + standard_name = surface_skin_temperature_over_land + long_name = surface skin temperature over land + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tsfc_ocn] + standard_name = surface_skin_temperature_over_ocean_interstitial + long_name = surface skin temperature over ocean (temporary use as interstitial) + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsfc_lnd] + standard_name = surface_skin_temperature_over_land_interstitial + long_name = surface skin temperature over land (temporary use as interstitial) + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tsfc_ice] + standard_name = surface_skin_temperature_over_ice_interstitial + long_name = surface skin temperature over ice (temporary use as interstitial) + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tisfc] + standard_name = sea_ice_temperature + long_name = sea ice surface skin temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tice] + standard_name = sea_ice_temperature_interstitial + long_name = sea ice surface skin temperature use as interstitial + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[hice] + standard_name = sea_ice_thickness + long_name = sea ice thickness + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cice] + standard_name = sea_ice_concentration + long_name = ice fraction over open water + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/cires_ugwp.F90 b/physics/cires_ugwp.F90 index 226a83f02..e1268d13c 100644 --- a/physics/cires_ugwp.F90 +++ b/physics/cires_ugwp.F90 @@ -32,26 +32,7 @@ module cires_ugwp !>@brief The subroutine initializes the CIRES UGWP #if 0 !> \section arg_table_cires_ugwp_init Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |------------------|-------------------------------------------------------------------------------|---------------------------------------------------------|--------|------|-----------|-----------|--------|----------| -!! | me | mpi_rank | MPI rank of current process | index | 0 | integer | | in | F | -!! | master | mpi_root | MPI rank of master process | index | 0 | integer | | in | F | -!! | nlunit | iounit_namelist | fortran unit number for opening namelist file | none | 0 | integer | | in | F | -!! | logunit | iounit_log | fortran unit number for writing logfile | none | 0 | integer | | in | F | -!! | fn_nml2 | namelist_filename | namelist filename for ugwp | none | 0 | character | len=* | in | F | -!! | lonr | number_of_equatorial_longitude_points | number of global points in x-dir (i) along the equator | count | 0 | integer | | in | F | -!! | latr | number_of_latitude_points | number of global points in y-dir (j) along the meridian | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | ak | a_parameter_of_the_hybrid_coordinate | a parameter for sigma pressure level calculations | Pa | 1 | real | kind_phys | in | F | -!! | bk | b_parameter_of_the_hybrid_coordinate | b parameter for sigma pressure level calculations | none | 1 | real | kind_phys | in | F | -!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | -!! | cdmvgwd | multiplication_factors_for_mountain_blocking_and_orographic_gravity_wave_drag | multiplication factors for cdmb and gwd | none | 1 | real | kind_phys | in | F | -!! | cgwf | multiplication_factors_for_convective_gravity_wave_drag | multiplication factor for convective GWD | none | 1 | real | kind_phys | in | F | -!! | pa_rf_in | pressure_cutoff_for_rayleigh_damping | pressure level from which Rayleigh Damping is applied | Pa | 0 | real | kind_phys | in | F | -!! | tau_rf_in | time_scale_for_rayleigh_damping | time scale for Rayleigh damping in days | d | 0 | real | kind_phys | in | F | -!! | con_p0 | standard_atmospheric_pressure | standard atmospheric pressure | Pa | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cires_ugwp_init.html !! #endif ! ----------------------------------------------------------------------- @@ -115,10 +96,7 @@ end subroutine cires_ugwp_init !>@brief The subroutine finalizes the CIRES UGWP #if 0 !> \section arg_table_cires_ugwp_finalize Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |------------------|-------------------------------------------------------------------------------|---------------------------------------------------------|--------|------|-----------|-----------|--------|----------| -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cires_ugwp_finalize.html !! #endif subroutine cires_ugwp_finalize(errmsg, errflg) @@ -152,74 +130,7 @@ end subroutine cires_ugwp_finalize !>@brief The subroutine executes the CIRES UGWP #if 0 !> \section arg_table_cires_ugwp_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |------------------|--------------------------------------------------------------------------------|--------------------------------------------------------------|-----------|------|-----------|-----------|--------|----------| -!! | do_ugwp | do_ugwp | flag to activate CIRES UGWP | flag | 0 | logical | | in | F | -!! | me | mpi_rank | MPI rank of current process | index | 0 | integer | | in | F | -!! | master | mpi_root | MPI rank of master process | index | 0 | integer | | in | F | -!! | im | horizontal_loop_extent | horizontal | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | -!! | kdt | index_of_time_step | current forecast iteration | index | 0 | integer | | in | F | -!! | lonr | number_of_equatorial_longitude_points | number of global points in x-dir (i) along the equator | count | 0 | integer | | in | F | -!! | oro | orography | orography | m | 1 | real | kind_phys | in | F | -!! | oro_uf | orography_unfiltered | unfiltered orography | m | 1 | real | kind_phys | in | F | -!! | hprime | standard_deviation_of_subgrid_orography | standard deviation of subgrid orography | m | 1 | real | kind_phys | in | F | -!! | nmtvr | number_of_statistical_measures_of_subgrid_orography | number of topographic variables in GWD | count | 0 | integer | | in | F | -!! | oc | convexity_of_subgrid_orography | convexity of subgrid orography | none | 1 | real | kind_phys | in | F | -!! | oa4 | asymmetry_of_subgrid_orography | asymmetry of subgrid orography | none | 2 | real | kind_phys | in | F | -!! | clx | fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height | horizontal fraction of grid box covered by subgrid orography higher than critical height | frac | 2 | real | kind_phys | in | F | -!! | theta | angle_from_east_of_maximum_subgrid_orographic_variations | angle with_respect to east of maximum subgrid orographic variations | degrees | 1 | real | kind_phys | in | F | -!! | sigma | slope_of_subgrid_orography | slope of subgrid orography | none | 1 | real | kind_phys | in | F | -!! | gamma | anisotropy_of_subgrid_orography | anisotropy of subgrid orography | none | 1 | real | kind_phys | in | F | -!! | elvmax | maximum_subgrid_orography | maximum of subgrid orography | m | 1 | real | kind_phys | in | F | -!! | do_tofd | turb_oro_form_drag_flag | flag for turbulent orographic form drag | flag | 0 | logical | | in | F | -!! | cdmbgwd | multiplication_factors_for_mountain_blocking_and_orographic_gravity_wave_drag | multiplication factors for cdmb and gwd | none | 1 | real | kind_phys | in | F | -!! | xlat | latitude | grid latitude in radians | radians | 1 | real | kind_phys | in | F | -!! | xlat_d | latitude_degree | latitude in degrees | degree | 1 | real | kind_phys | in | F | -!! | sinlat | sine_of_latitude | sine of the grid latitude | none | 1 | real | kind_phys | in | F | -!! | coslat | cosine_of_latitude | cosine of the grid latitude | none | 1 | real | kind_phys | in | F | -!! | area | cell_area | area of the grid cell | m2 | 1 | real | kind_phys | in | F | -!! | ugrs | x_wind | zonal wind | m s-1 | 2 | real | kind_phys | in | F | -!! | vgrs | y_wind | meridional wind | m s-1 | 2 | real | kind_phys | in | F | -!! | tgrs | air_temperature | model layer mean temperature | K | 2 | real | kind_phys | in | F | -!! | qgrs | tracer_concentration | model layer mean tracer concentration | kg kg-1 | 3 | real | kind_phys | in | F | -!! | prsi | air_pressure_at_interface | air pressure at model layer interfaces | Pa | 2 | real | kind_phys | in | F | -!! | prsl | air_pressure | mean layer pressure | Pa | 2 | real | kind_phys | in | F | -!! | prslk | dimensionless_exner_function_at_model_layers | dimensionless Exner function at model layer centers | none | 2 | real | kind_phys | in | F | -!! | phii | geopotential_at_interface | geopotential at model layer interfaces | m2 s-2 | 2 | real | kind_phys | in | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | del | air_pressure_difference_between_midlayers | air pressure difference between midlayers | Pa | 2 | real | kind_phys | in | F | -!! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | vertical index at top atmospheric boundary layer | index | 1 | integer | | in | F | -!! | dusfcg | instantaneous_x_stress_due_to_gravity_wave_drag | zonal surface stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | out | F | -!! | dvsfcg | instantaneous_y_stress_due_to_gravity_wave_drag | meridional surface stress due to orographic gravity wave drag| Pa | 1 | real | kind_phys | out | F | -!! | gw_dudt | tendency_of_x_wind_due_to_ugwp | zonal wind tendency due to UGWP | m s-2 | 2 | real | kind_phys | out | F | -!! | gw_dvdt | tendency_of_y_wind_due_to_ugwp | meridional wind tendency due to UGWP | m s-2 | 2 | real | kind_phys | out | F | -!! | gw_dtdt | tendency_of_air_temperature_due_to_ugwp | air temperature tendency due to UGWP | K s-1 | 2 | real | kind_phys | out | F | -!! | gw_kdis | eddy_mixing_due_to_ugwp | eddy mixing due to UGWP | m2 s-1 | 2 | real | kind_phys | out | F | -!! | tau_tofd | instantaneous_momentum_flux_due_to_turbulent_orographic_form_drag | momentum flux or stress due to TOFD | Pa | 1 | real | kind_phys | out | F | -!! | tau_mtb | instantaneous_momentum_flux_due_to_mountain_blocking_drag | momentum flux or stress due to mountain blocking drag | Pa | 1 | real | kind_phys | out | F | -!! | tau_ogw | instantaneous_momentum_flux_due_to_orographic_gravity_wave_drag | momentum flux or stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | out | F | -!! | tau_ngw | instantaneous_momentum_flux_due_to_nonstationary_gravity_wave | momentum flux or stress due to nonstationary gravity waves | Pa | 1 | real | kind_phys | out | F | -!! | zmtb | height_of_mountain_blocking | height of mountain blocking drag | m | 1 | real | kind_phys | out | F | -!! | zlwb | height_of_low_level_wave_breaking | height of low level wave breaking | m | 1 | real | kind_phys | out | F | -!! | zogw | height_of_launch_level_of_orographic_gravity_wave | height of launch level of orographic gravity wave | m | 1 | real | kind_phys | out | F | -!! | dudt_mtb | instantaneous_change_in_x_wind_due_to_mountain_blocking_drag | instantaneous change in x wind due to mountain blocking drag | m s-2 | 2 | real | kind_phys | out | F | -!! | dudt_ogw | instantaneous_change_in_x_wind_due_to_orographic_gravity_wave_drag | instantaneous change in x wind due to orographic gw drag | m s-2 | 2 | real | kind_phys | out | F | -!! | dudt_tms | instantaneous_change_in_x_wind_due_to_turbulent_orographic_form_drag | instantaneous change in x wind due to TOFD | m s-2 | 2 | real | kind_phys | out | F | -!! | dudt | tendency_of_x_wind_due_to_model_physics | zonal wind tendency due to model physics | m s-2 | 2 | real | kind_phys | inout | F | -!! | dvdt | tendency_of_y_wind_due_to_model_physics | meridional wind tendency due to model physics | m s-2 | 2 | real | kind_phys | inout | F | -!! | dtdt | tendency_of_air_temperature_due_to_model_physics | air temperature tendency due to model physics | K s-1 | 2 | real | kind_phys | inout | F | -!! | rdxzb | level_of_dividing_streamline | level of the dividing streamline | none | 1 | real | kind_phys | out | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | con_pi | pi | ratio of a circle's circumference to its diameter | radians | 0 | real | kind_phys | in | F | -!! | con_cp | specific_heat_of_dry_air_at_constant_pressure | specific heat !of dry air at constant pressure | J kg-1 K-1| 0 | real | kind_phys | in | F | -!! | con_rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1| 0 | real | kind_phys | in | F | -!! | con_rv | gas_constant_water_vapor | ideal gas constant for water vapor | J kg-1 K-1| 0 | real | kind_phys | in | F | -!! | con_fvirt | ratio_of_vapor_to_dry_air_gas_constants_minus_one | rv/rd - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cires_ugwp_run.html !! #endif diff --git a/physics/cires_ugwp.meta b/physics/cires_ugwp.meta new file mode 100644 index 000000000..e722b2992 --- /dev/null +++ b/physics/cires_ugwp.meta @@ -0,0 +1,766 @@ +[ccpp-arg-table] + name = cires_ugwp_init + type = scheme +[me] + standard_name = mpi_rank + long_name = MPI rank of current process + units = index + dimensions = () + type = integer + intent = in + optional = F +[master] + standard_name = mpi_root + long_name = MPI rank of master process + units = index + dimensions = () + type = integer + intent = in + optional = F +[nlunit] + standard_name = iounit_namelist + long_name = fortran unit number for opening namelist file + units = none + dimensions = () + type = integer + intent = in + optional = F +[logunit] + standard_name = iounit_log + long_name = fortran unit number for writing logfile + units = none + dimensions = () + type = integer + intent = in + optional = F +[fn_nml2] + standard_name = namelist_filename + long_name = namelist filename for ugwp + units = none + dimensions = () + type = character + kind = len=* + intent = in + optional = F +[lonr] + standard_name = number_of_equatorial_longitude_points + long_name = number of global points in x-dir (i) along the equator + units = count + dimensions = () + type = integer + intent = in + optional = F +[latr] + standard_name = number_of_latitude_points + long_name = number of global points in y-dir (j) along the meridian + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[ak] + standard_name = a_parameter_of_the_hybrid_coordinate + long_name = a parameter for sigma pressure level calculations + units = Pa + dimensions = (number_of_vertical_layers_for_radiation_calculations_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[bk] + standard_name = b_parameter_of_the_hybrid_coordinate + long_name = b parameter for sigma pressure level calculations + units = none + dimensions = (number_of_vertical_layers_for_radiation_calculations_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[dtp] + standard_name = time_step_for_physics + long_name = physics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cdmvgwd] + standard_name = multiplication_factors_for_mountain_blocking_and_orographic_gravity_wave_drag + long_name = multiplication factors for cdmb and gwd + units = none + dimensions = (2) + type = real + kind = kind_phys + intent = in + optional = F +[cgwf] + standard_name = multiplication_factors_for_convective_gravity_wave_drag + long_name = multiplication factor for convective GWD + units = none + dimensions = (2) + type = real + kind = kind_phys + intent = in + optional = F +[pa_rf_in] + standard_name = pressure_cutoff_for_rayleigh_damping + long_name = pressure level from which Rayleigh Damping is applied + units = Pa + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[tau_rf_in] + standard_name = time_scale_for_rayleigh_damping + long_name = time scale for Rayleigh damping in days + units = d + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_p0] + standard_name = standard_atmospheric_pressure + long_name = standard atmospheric pressure + units = Pa + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = cires_ugwp_finalize + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = cires_ugwp_run + type = scheme +[do_ugwp] + standard_name = do_ugwp + long_name = flag to activate CIRES UGWP + units = flag + dimensions = () + type = logical + intent = in + optional = F +[me] + standard_name = mpi_rank + long_name = MPI rank of current process + units = index + dimensions = () + type = integer + intent = in + optional = F +[master] + standard_name = mpi_root + long_name = MPI rank of master process + units = index + dimensions = () + type = integer + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntrac] + standard_name = number_of_tracers + long_name = number of tracers + units = count + dimensions = () + type = integer + intent = in + optional = F +[dtp] + standard_name = time_step_for_physics + long_name = physics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[kdt] + standard_name = index_of_time_step + long_name = current forecast iteration + units = index + dimensions = () + type = integer + intent = in + optional = F +[lonr] + standard_name = number_of_equatorial_longitude_points + long_name = number of global points in x-dir (i) along the equator + units = count + dimensions = () + type = integer + intent = in + optional = F +[oro] + standard_name = orography + long_name = orography + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[oro_uf] + standard_name = orography_unfiltered + long_name = unfiltered orography + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[hprime] + standard_name = standard_deviation_of_subgrid_orography + long_name = standard deviation of subgrid orography + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[nmtvr] + standard_name = number_of_statistical_measures_of_subgrid_orography + long_name = number of topographic variables in GWD + units = count + dimensions = () + type = integer + intent = in + optional = F +[oc] + standard_name = convexity_of_subgrid_orography + long_name = convexity of subgrid orography + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[oa4] + standard_name = asymmetry_of_subgrid_orography + long_name = asymmetry of subgrid orography + units = none + dimensions = (horizontal_dimension,4) + type = real + kind = kind_phys + intent = in + optional = F +[clx] + standard_name = fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height + long_name = horizontal fraction of grid box covered by subgrid orography higher than critical height + units = frac + dimensions = (horizontal_dimension,4) + type = real + kind = kind_phys + intent = in + optional = F +[theta] + standard_name = angle_from_east_of_maximum_subgrid_orographic_variations + long_name = angle with_respect to east of maximum subgrid orographic variations + units = degrees + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sigma] + standard_name = slope_of_subgrid_orography + long_name = slope of subgrid orography + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gamma] + standard_name = anisotropy_of_subgrid_orography + long_name = anisotropy of subgrid orography + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[elvmax] + standard_name = maximum_subgrid_orography + long_name = maximum of subgrid orography + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[do_tofd] + standard_name = turb_oro_form_drag_flag + long_name = flag for turbulent orographic form drag + units = flag + dimensions = () + type = logical + intent = in + optional = F +[cdmbgwd] + standard_name = multiplication_factors_for_mountain_blocking_and_orographic_gravity_wave_drag + long_name = multiplication factors for cdmb and gwd + units = none + dimensions = (2) + type = real + kind = kind_phys + intent = in + optional = F +[xlat] + standard_name = latitude + long_name = grid latitude in radians + units = radians + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[xlat_d] + standard_name = latitude_degree + long_name = latitude in degrees + units = degree + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sinlat] + standard_name = sine_of_latitude + long_name = sine of the grid latitude + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[coslat] + standard_name = cosine_of_latitude + long_name = cosine of the grid latitude + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[area] + standard_name = cell_area + long_name = area of the grid cell + units = m2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ugrs] + standard_name = x_wind + long_name = zonal wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[vgrs] + standard_name = y_wind + long_name = meridional wind + units = m s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tgrs] + standard_name = air_temperature + long_name = model layer mean temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qgrs] + standard_name = tracer_concentration + long_name = model layer mean tracer concentration + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = in + optional = F +[prsi] + standard_name = air_pressure_at_interface + long_name = air pressure at model layer interfaces + units = Pa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[prsl] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslk] + standard_name = dimensionless_exner_function_at_model_layers + long_name = dimensionless Exner function at model layer centers + units = none + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[phii] + standard_name = geopotential_at_interface + long_name = geopotential at model layer interfaces + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[phil] + standard_name = geopotential + long_name = geopotential at model layer centers + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[del] + standard_name = air_pressure_difference_between_midlayers + long_name = air pressure difference between midlayers + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[kpbl] + standard_name = vertical_index_at_top_of_atmosphere_boundary_layer + long_name = vertical index at top atmospheric boundary layer + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in + optional = F +[dusfcg] + standard_name = instantaneous_x_stress_due_to_gravity_wave_drag + long_name = zonal surface stress due to orographic gravity wave drag + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dvsfcg] + standard_name = instantaneous_y_stress_due_to_gravity_wave_drag + long_name = meridional surface stress due to orographic gravity wave drag + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[gw_dudt] + standard_name = tendency_of_x_wind_due_to_ugwp + long_name = zonal wind tendency due to UGWP + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[gw_dvdt] + standard_name = tendency_of_y_wind_due_to_ugwp + long_name = meridional wind tendency due to UGWP + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[gw_dtdt] + standard_name = tendency_of_air_temperature_due_to_ugwp + long_name = air temperature tendency due to UGWP + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[gw_kdis] + standard_name = eddy_mixing_due_to_ugwp + long_name = eddy mixing due to UGWP + units = m2 s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[tau_tofd] + standard_name = instantaneous_momentum_flux_due_to_turbulent_orographic_form_drag + long_name = momentum flux or stress due to TOFD + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[tau_mtb] + standard_name = instantaneous_momentum_flux_due_to_mountain_blocking_drag + long_name = momentum flux or stress due to mountain blocking drag + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[tau_ogw] + standard_name = instantaneous_momentum_flux_due_to_orographic_gravity_wave_drag + long_name = momentum flux or stress due to orographic gravity wave drag + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[tau_ngw] + standard_name = instantaneous_momentum_flux_due_to_nonstationary_gravity_wave + long_name = momentum flux or stress due to nonstationary gravity waves + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[zmtb] + standard_name = height_of_mountain_blocking + long_name = height of mountain blocking drag + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[zlwb] + standard_name = height_of_low_level_wave_breaking + long_name = height of low level wave breaking + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[zogw] + standard_name = height_of_launch_level_of_orographic_gravity_wave + long_name = height of launch level of orographic gravity wave + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dudt_mtb] + standard_name = instantaneous_change_in_x_wind_due_to_mountain_blocking_drag + long_name = instantaneous change in x wind due to mountain blocking drag + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dudt_ogw] + standard_name = instantaneous_change_in_x_wind_due_to_orographic_gravity_wave_drag + long_name = instantaneous change in x wind due to orographic gw drag + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dudt_tms] + standard_name = instantaneous_change_in_x_wind_due_to_turbulent_orographic_form_drag + long_name = instantaneous change in x wind due to TOFD + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[dudt] + standard_name = tendency_of_x_wind_due_to_model_physics + long_name = zonal wind tendency due to model physics + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dvdt] + standard_name = tendency_of_y_wind_due_to_model_physics + long_name = meridional wind tendency due to model physics + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[dtdt] + standard_name = tendency_of_air_temperature_due_to_model_physics + long_name = air temperature tendency due to model physics + units = K s-1 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rdxzb] + standard_name = level_of_dividing_streamline + long_name = level of the dividing streamline + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = radians + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat !of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_rv] + standard_name = gas_constant_water_vapor + long_name = ideal gas constant for water vapor + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_fvirt] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = rv/rd - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/cires_ugwp_post.F90 b/physics/cires_ugwp_post.F90 index 8393dd8d2..18acfa341 100755 --- a/physics/cires_ugwp_post.F90 +++ b/physics/cires_ugwp_post.F90 @@ -14,37 +14,7 @@ end subroutine cires_ugwp_post_init !>@brief The subroutine initializes the CIRES UGWP #if 0 !> \section arg_table_cires_ugwp_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |------------------|--------------------------------------------------------------------------------|------------------------------------------------------------------------|-----------|------|-----------|-----------|--------|----------| -!! | ldiag_ugwp | diag_ugwp_flag | flag for CIRES UGWP Diagnostics | flag | 0 | logical | | in | F | -!! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | gw_dudt | tendency_of_x_wind_due_to_ugwp | zonal wind tendency due to UGWP | m s-2 | 2 | real | kind_phys | in | F | -!! | tau_tofd | instantaneous_momentum_flux_due_to_turbulent_orographic_form_drag | momentum flux or stress due to TOFD | Pa | 1 | real | kind_phys | in | F | -!! | tau_mtb | instantaneous_momentum_flux_due_to_mountain_blocking_drag | momentum flux or stress due to mountain blocking drag | Pa | 1 | real | kind_phys | in | F | -!! | tau_ogw | instantaneous_momentum_flux_due_to_orographic_gravity_wave_drag | momentum flux or stress due to orographic gravity wave drag | Pa | 1 | real | kind_phys | in | F | -!! | tau_ngw | instantaneous_momentum_flux_due_to_nonstationary_gravity_wave | momentum flux or stress due to nonstationary gravity waves | Pa | 1 | real | kind_phys | in | F | -!! | zmtb | height_of_mountain_blocking | height of mountain blocking drag | m | 1 | real | kind_phys | in | F | -!! | zlwb | height_of_low_level_wave_breaking | height of low level wave breaking | m | 1 | real | kind_phys | in | F | -!! | zogw | height_of_launch_level_of_orographic_gravity_wave | height of launch level of orographic gravity wave | m | 1 | real | kind_phys | in | F | -!! | dudt_mtb | instantaneous_change_in_x_wind_due_to_mountain_blocking_drag | instantaneous change in x wind due to mountain blocking drag | m s-2 | 2 | real | kind_phys | in | F | -!! | dudt_ogw | instantaneous_change_in_x_wind_due_to_orographic_gravity_wave_drag | instantaneous change in x wind due to orographic gw drag | m s-2 | 2 | real | kind_phys | in | F | -!! | dudt_tms | instantaneous_change_in_x_wind_due_to_turbulent_orographic_form_drag | instantaneous change in x wind due to TOFD | m s-2 | 2 | real | kind_phys | in | F | -!! | cnvgwd | flag_convective_gravity_wave_drag | flag for conv gravity wave drag | flag | 0 | logical | | inout | F | -!! | tot_zmtb | time_integral_of_height_of_mountain_blocking | time integral of height of mountain blocking drag | m | 1 | real | kind_phys | inout | F | -!! | tot_zlwb | time_integral_of_height_of_low_level_wave_breaking | time integral of height of drag due to low level wave breaking | m | 1 | real | kind_phys | inout | F | -!! | tot_zogw | time_integral_of_height_of_launch_level_of_orographic_gravity_wave | time integral of height of launch level of orographic gravity wave | m | 1 | real | kind_phys | inout | F | -!! | tot_tofd | time_integral_of_momentum_flux_due_to_turbulent_orographic_form_drag | time integral of momentum flux due to TOFD | Pa | 1 | real | kind_phys | inout | F | -!! | tot_mtb | time_integral_of_momentum_flux_due_to_mountain_blocking_drag | time integral of momentum flux due to mountain blocking drag | Pa | 1 | real | kind_phys | inout | F | -!! | tot_ogw | time_integral_of_momentum_flux_due_to_orographic_gravity_wave_drag | time integral of momentum flux due to orographic gravity wave drag | Pa | 1 | real | kind_phys | inout | F | -!! | tot_ngw | time_integral_of_momentum_flux_due_to_nonstationary_gravity_wave | time integral of momentum flux due to nonstationary gravity waves | Pa | 1 | real | kind_phys | inout | F | -!! | du3dt_mtb | time_integral_of_change_in_x_wind_due_to_mountain_blocking_drag | time integral of change in x wind due to mountain blocking drag | m s-2 | 2 | real | kind_phys | inout | F | -!! | du3dt_ogw | time_integral_of_change_in_x_wind_due_to_orographic_gravity_wave_drag | time integral of change in x wind due to orographic gw drag | m s-2 | 2 | real | kind_phys | inout | F | -!! | du3dt_tms | time_integral_of_change_in_x_wind_due_to_turbulent_orographic_form_drag | time integral of change in x wind due to TOFD | m s-2 | 2 | real | kind_phys | inout | F | -!! | du3dt_ngw | time_integral_of_change_in_x_wind_due_to_nonstationary_gravity_wave | time integral of change in x wind due to NGW | m s-2 | 2 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cires_ugwp_post_run.html !! #endif diff --git a/physics/cires_ugwp_post.meta b/physics/cires_ugwp_post.meta new file mode 100644 index 000000000..4414115d8 --- /dev/null +++ b/physics/cires_ugwp_post.meta @@ -0,0 +1,269 @@ +[ccpp-arg-table] + name = cires_ugwp_post_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = cires_ugwp_post_run + type = scheme +[ldiag_ugwp] + standard_name = diag_ugwp_flag + long_name = flag for CIRES UGWP Diagnostics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[dtf] + standard_name = time_step_for_dynamics + long_name = dynamics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[gw_dudt] + standard_name = tendency_of_x_wind_due_to_ugwp + long_name = zonal wind tendency due to UGWP + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tau_tofd] + standard_name = instantaneous_momentum_flux_due_to_turbulent_orographic_form_drag + long_name = momentum flux or stress due to TOFD + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tau_mtb] + standard_name = instantaneous_momentum_flux_due_to_mountain_blocking_drag + long_name = momentum flux or stress due to mountain blocking drag + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tau_ogw] + standard_name = instantaneous_momentum_flux_due_to_orographic_gravity_wave_drag + long_name = momentum flux or stress due to orographic gravity wave drag + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tau_ngw] + standard_name = instantaneous_momentum_flux_due_to_nonstationary_gravity_wave + long_name = momentum flux or stress due to nonstationary gravity waves + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zmtb] + standard_name = height_of_mountain_blocking + long_name = height of mountain blocking drag + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zlwb] + standard_name = height_of_low_level_wave_breaking + long_name = height of low level wave breaking + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[zogw] + standard_name = height_of_launch_level_of_orographic_gravity_wave + long_name = height of launch level of orographic gravity wave + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dudt_mtb] + standard_name = instantaneous_change_in_x_wind_due_to_mountain_blocking_drag + long_name = instantaneous change in x wind due to mountain blocking drag + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dudt_ogw] + standard_name = instantaneous_change_in_x_wind_due_to_orographic_gravity_wave_drag + long_name = instantaneous change in x wind due to orographic gw drag + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dudt_tms] + standard_name = instantaneous_change_in_x_wind_due_to_turbulent_orographic_form_drag + long_name = instantaneous change in x wind due to TOFD + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cnvgwd] + standard_name = flag_convective_gravity_wave_drag + long_name = flag for conv gravity wave drag + units = flag + dimensions = () + type = logical + intent = inout + optional = F +[tot_zmtb] + standard_name = time_integral_of_height_of_mountain_blocking + long_name = time integral of height of mountain blocking drag + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tot_zlwb] + standard_name = time_integral_of_height_of_low_level_wave_breaking + long_name = time integral of height of drag due to low level wave breaking + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tot_zogw] + standard_name = time_integral_of_height_of_launch_level_of_orographic_gravity_wave + long_name = time integral of height of launch level of orographic gravity wave + units = m + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tot_tofd] + standard_name = time_integral_of_momentum_flux_due_to_turbulent_orographic_form_drag + long_name = time integral of momentum flux due to TOFD + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tot_mtb] + standard_name = time_integral_of_momentum_flux_due_to_mountain_blocking_drag + long_name = time integral of momentum flux due to mountain blocking drag + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tot_ogw] + standard_name = time_integral_of_momentum_flux_due_to_orographic_gravity_wave_drag + long_name = time integral of momentum flux due to orographic gravity wave drag + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tot_ngw] + standard_name = time_integral_of_momentum_flux_due_to_nonstationary_gravity_wave + long_name = time integral of momentum flux due to nonstationary gravity waves + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[du3dt_mtb] + standard_name = time_integral_of_change_in_x_wind_due_to_mountain_blocking_drag + long_name = time integral of change in x wind due to mountain blocking drag + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[du3dt_ogw] + standard_name = time_integral_of_change_in_x_wind_due_to_orographic_gravity_wave_drag + long_name = time integral of change in x wind due to orographic gw drag + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[du3dt_tms] + standard_name = time_integral_of_change_in_x_wind_due_to_turbulent_orographic_form_drag + long_name = time integral of change in x wind due to TOFD + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[du3dt_ngw] + standard_name = time_integral_of_change_in_x_wind_due_to_nonstationary_gravity_wave + long_name = time integral of change in x wind due to NGW + units = m s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = cires_ugwp_post_finalize + type = scheme diff --git a/physics/lsm_ruc_sfc_sice_interstitial.F90 b/physics/lsm_ruc_sfc_sice_interstitial.F90 index b051b08c2..63f006f1e 100644 --- a/physics/lsm_ruc_sfc_sice_interstitial.F90 +++ b/physics/lsm_ruc_sfc_sice_interstitial.F90 @@ -18,16 +18,7 @@ end subroutine lsm_ruc_sfc_sice_pre_finalize #if 0 !> \section arg_table_lsm_ruc_sfc_sice_pre_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | lsoil_ruc | soil_vertical_dimension_for_land_surface_model | number of soil layers internal to land surface model | count | 0 | integer | | in | F | -!! | lsoil | soil_vertical_dimension | soil vertical layer dimension | count | 0 | integer | | in | F | -!! | land | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | -!! | stc | soil_temperature | soil temperature | K | 2 | real | kind_phys | inout | F | -!! | tslb | soil_temperature_for_land_surface_model | soil temperature for land surface model | K | 2 | real | kind_phys | in | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude lsm_ruc_sfc_sice_pre_run.html !! #endif subroutine lsm_ruc_sfc_sice_pre_run(im, lsoil_ruc, lsoil, land, stc, tslb, errmsg, errflg) @@ -84,16 +75,7 @@ end subroutine lsm_ruc_sfc_sice_post_finalize #if 0 !> \section arg_table_lsm_ruc_sfc_sice_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | lsoil_ruc | soil_vertical_dimension_for_land_surface_model | number of soil layers internal to land surface model | count | 0 | integer | | in | F | -!! | lsoil | soil_vertical_dimension | soil vertical layer dimension | count | 0 | integer | | in | F | -!! | land | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | -!! | stc | soil_temperature | soil temperature | K | 2 | real | kind_phys | in | F | -!! | tslb | soil_temperature_for_land_surface_model | soil temperature for land surface model | K | 2 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude lsm_ruc_sfc_sice_post_run.html !! #endif subroutine lsm_ruc_sfc_sice_post_run(im, lsoil_ruc, lsoil, land, stc, tslb, errmsg, errflg) @@ -128,4 +110,4 @@ subroutine lsm_ruc_sfc_sice_post_run(im, lsoil_ruc, lsoil, land, stc, tslb, errm end subroutine lsm_ruc_sfc_sice_post_run -end module lsm_ruc_sfc_sice_post \ No newline at end of file +end module lsm_ruc_sfc_sice_post diff --git a/physics/lsm_ruc_sfc_sice_interstitial.meta b/physics/lsm_ruc_sfc_sice_interstitial.meta new file mode 100644 index 000000000..c105abe9d --- /dev/null +++ b/physics/lsm_ruc_sfc_sice_interstitial.meta @@ -0,0 +1,142 @@ +[ccpp-arg-table] + name = lsm_ruc_sfc_sice_pre_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[lsoil_ruc] + standard_name = soil_vertical_dimension_for_land_surface_model + long_name = number of soil layers internal to land surface model + units = count + dimensions = () + type = integer + intent = in + optional = F +[lsoil] + standard_name = soil_vertical_dimension + long_name = soil vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[land] + standard_name = flag_nonzero_land_surface_fraction + long_name = flag indicating presence of some land surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[stc] + standard_name = soil_temperature + long_name = soil temperature + units = K + dimensions = (horizontal_dimension,soil_vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[tslb] + standard_name = soil_temperature_for_land_surface_model + long_name = soil temperature for land surface model + units = K + dimensions = (horizontal_dimension,soil_vertical_dimension_for_land_surface_model) + type = real + kind = kind_phys + intent = in + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F + +######################################################################## +[ccpp-arg-table] + name = lsm_ruc_sfc_sice_post_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[lsoil_ruc] + standard_name = soil_vertical_dimension_for_land_surface_model + long_name = number of soil layers internal to land surface model + units = count + dimensions = () + type = integer + intent = in + optional = F +[lsoil] + standard_name = soil_vertical_dimension + long_name = soil vertical layer dimension + units = count + dimensions = () + type = integer + intent = in + optional = F +[land] + standard_name = flag_nonzero_land_surface_fraction + long_name = flag indicating presence of some land surface area fraction + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[stc] + standard_name = soil_temperature + long_name = soil temperature + units = K + dimensions = (horizontal_dimension,soil_vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tslb] + standard_name = soil_temperature_for_land_surface_model + long_name = soil temperature for land surface model + units = K + dimensions = (horizontal_dimension,soil_vertical_dimension_for_land_surface_model) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/maximum_hourly_diagnostics.F90 b/physics/maximum_hourly_diagnostics.F90 index 4e739e463..422cd147f 100644 --- a/physics/maximum_hourly_diagnostics.F90 +++ b/physics/maximum_hourly_diagnostics.F90 @@ -22,35 +22,7 @@ end subroutine maximum_hourly_diagnostics_finalize #if 0 !> \section arg_table_maximum_hourly_diagnostics_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------------|--------------------------------------------------------------------|--------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | levs | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | reset | flag_reset_maximum_hourly_fields | flag for resetting maximum hourly fields | flag | 0 | logical | | in | F | -!! | lradar | flag_for_radar_reflectivity | flag for radar reflectivity | flag | 0 | logical | | in | F | -!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | -!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | -!! | phil | geopotential | geopotential at model layer centers | m2 s-2 | 2 | real | kind_phys | in | F | -!! | gt0 | air_temperature_updated_by_physics | temperature updated by physics | K | 2 | real | kind_phys | in | F | -!! | refl_10cm | radar_reflectivity_10cm | instantaneous refl_10cm | dBZ | 2 | real | kind_phys | in | F | -!! | refdmax | maximum_reflectivity_at_1km_agl_over_maximum_hourly_time_interval | maximum reflectivity at 1km agl over maximum hourly time interval | dBZ | 1 | real | kind_phys | inout | F | -!! | refdmax263k | maximum_reflectivity_at_minus10c_over_maximum_hourly_time_interval | maximum reflectivity at minus10c over maximum hourly time interval | dBZ | 1 | real | kind_phys | inout | F | -!! | u10m | x_wind_at_10m | 10 meter u wind speed | m s-1 | 1 | real | kind_phys | in | F | -!! | v10m | y_wind_at_10m | 10 meter v wind speed | m s-1 | 1 | real | kind_phys | in | F | -!! | u10max | maximum_u_wind_at_10m_over_maximum_hourly_time_interval | maximum u wind at 10m over maximum hourly time interval | m s-1 | 1 | real | kind_phys | inout | F | -!! | v10max | maximum_v_wind_at_10m_over_maximum_hourly_time_interval | maximum v wind at 10m over maximum hourly time interval | m s-1 | 1 | real | kind_phys | inout | F | -!! | spd10max | maximum_wind_at_10m_over_maximum_hourly_time_interval | maximum wind at 10m over maximum hourly time interval | m s-1 | 1 | real | kind_phys | inout | F | -!! | pgr | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | t2m | temperature_at_2m | 2 meter temperature | K | 1 | real | kind_phys | in | F | -!! | q2m | specific_humidity_at_2m | 2 meter specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | t02max | maximum_temperature_at_2m_over_maximum_hourly_time_interval | maximum temperature at 2m over maximum hourly time interval | K | 1 | real | kind_phys | inout | F | -!! | t02min | minimum_temperature_at_2m_over_maximum_hourly_time_interval | minumum temperature at 2m over maximum hourly time interval | K | 1 | real | kind_phys | inout | F | -!! | rh02max | maximum_relative_humidity_at_2m_over_maximum_hourly_time_interval | maximum relative humidity at 2m over maximum hourly time interval | % | 1 | real | kind_phys | inout | F | -!! | rh02min | minimum_relative_humidity_at_2m_over_maximum_hourly_time_interval | minumum relative humidity at 2m over maximum hourly time interval | % | 1 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude maximum_hourly_diagnostics_run.html !! #endif subroutine maximum_hourly_diagnostics_run(im, levs, reset, lradar, imp_physics, & diff --git a/physics/maximum_hourly_diagnostics.meta b/physics/maximum_hourly_diagnostics.meta new file mode 100644 index 000000000..df6f10913 --- /dev/null +++ b/physics/maximum_hourly_diagnostics.meta @@ -0,0 +1,238 @@ +[ccpp-arg-table] + name = maximum_hourly_diagnostics_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[levs] + standard_name = vertical_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[reset] + standard_name = flag_reset_maximum_hourly_fields + long_name = flag for resetting maximum hourly fields + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lradar] + standard_name = flag_for_radar_reflectivity + long_name = flag for radar reflectivity + units = flag + dimensions = () + type = logical + intent = in + optional = F +[imp_physics] + standard_name = flag_for_microphysics_scheme + long_name = choice of microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_gfdl] + standard_name = flag_for_gfdl_microphysics_scheme + long_name = choice of GFDL microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imp_physics_thompson] + standard_name = flag_for_thompson_microphysics_scheme + long_name = choice of Thompson microphysics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[phil] + standard_name = geopotential + long_name = geopotential at model layer centers + units = m2 s-2 + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[gt0] + standard_name = air_temperature_updated_by_physics + long_name = temperature updated by physics + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[refl_10cm] + standard_name = radar_reflectivity_10cm + long_name = instantaneous refl_10cm + units = dBZ + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[refdmax] + standard_name = maximum_reflectivity_at_1km_agl_over_maximum_hourly_time_interval + long_name = maximum reflectivity at 1km agl over maximum hourly time interval + units = dBZ + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[refdmax263k] + standard_name = maximum_reflectivity_at_minus10c_over_maximum_hourly_time_interval + long_name = maximum reflectivity at minus10c over maximum hourly time interval + units = dBZ + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[u10m] + standard_name = x_wind_at_10m + long_name = 10 meter u wind speed + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v10m] + standard_name = y_wind_at_10m + long_name = 10 meter v wind speed + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[u10max] + standard_name = maximum_u_wind_at_10m_over_maximum_hourly_time_interval + long_name = maximum u wind at 10m over maximum hourly time interval + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[v10max] + standard_name = maximum_v_wind_at_10m_over_maximum_hourly_time_interval + long_name = maximum v wind at 10m over maximum hourly time interval + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[spd10max] + standard_name = maximum_wind_at_10m_over_maximum_hourly_time_interval + long_name = maximum wind at 10m over maximum hourly time interval + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[pgr] + standard_name = surface_air_pressure + long_name = surface pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t2m] + standard_name = temperature_at_2m + long_name = 2 meter temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q2m] + standard_name = specific_humidity_at_2m + long_name = 2 meter specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t02max] + standard_name = maximum_temperature_at_2m_over_maximum_hourly_time_interval + long_name = maximum temperature at 2m over maximum hourly time interval + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[t02min] + standard_name = minimum_temperature_at_2m_over_maximum_hourly_time_interval + long_name = minumum temperature at 2m over maximum hourly time interval + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rh02max] + standard_name = maximum_relative_humidity_at_2m_over_maximum_hourly_time_interval + long_name = maximum relative humidity at 2m over maximum hourly time interval + units = % + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[rh02min] + standard_name = minimum_relative_humidity_at_2m_over_maximum_hourly_time_interval + long_name = minumum relative humidity at 2m over maximum hourly time interval + units = % + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F diff --git a/physics/sfc_cice.f b/physics/sfc_cice.f index e969d677f..97efef18d 100644 --- a/physics/sfc_cice.f +++ b/physics/sfc_cice.f @@ -26,35 +26,7 @@ end subroutine sfc_cice_finalize !> \brief Brief description of the subroutine !! !! \section arg_table_cice_run Arguments -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|------------------------------------------------------------------------------|-----------------------------------------------------------------|---------------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | -!! | cplchm | flag_for_chemistry_coupling | flag controlling cplchm collection (default off) | flag | 0 | logical | | in | F | -!! | hvap | latent_heat_of_vaporization_of_water_at_0C | latent heat of evaporation/sublimation | J kg-1 | 0 | real | kind_phys | in | F | -!! | cp | specific_heat_of_dry_air_at_constant_pressure | specific heat of dry air at constant pressure | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | rvrdm1 | ratio_of_vapor_to_dry_air_gas_constants_minus_one | (rv/rd) - 1 (rv = ideal gas constant for water vapor) | none | 0 | real | kind_phys | in | F | -!! | rd | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | -!! | u1 | x_wind_at_lowest_model_layer | u component of surface layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | v1 | y_wind_at_lowest_model_layer | v component of surface layer wind | m s-1 | 1 | real | kind_phys | in | F | -!! | t1 | air_temperature_at_lowest_model_layer | surface layer mean temperature | K | 1 | real | kind_phys | in | F | -!! | q1 | water_vapor_specific_humidity_at_lowest_model_layer | surface layer mean specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | -!! | cm | surface_drag_coefficient_for_momentum_in_air_over_ice | surface exchange coeff for momentum over ice | none | 1 | real | kind_phys | in | F | -!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice | surface exchange coeff heat & moisture over ice | none | 1 | real | kind_phys | in | F | -!! | prsl1 | air_pressure_at_lowest_model_layer | surface layer mean pressure | Pa | 1 | real | kind_phys | in | F | -!! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | -!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | in | F | -!! | ddvel | surface_wind_enhancement_due_to_convection | wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | -!! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | -!! | dqsfc | dqsfcin | aoi_fld%dqsfcin(item,lan) | | 1 | real | kind_phys | none | F | -!! | dtsfc | dtsfcin | aoi_fld%dtsfcin(item,lan) | | 1 | real | kind_phys | none | F | -!! | qsurf | surface_specific_humidity_over_ice | surface air saturation specific humidity over ice | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | cmm | surface_drag_wind_speed_for_momentum_in_air_over_ice | momentum exchange coefficient over ice | m s-1 | 1 | real | kind_phys | inout | F | -!! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ice | thermal exchange coefficient over ice | kg m-2 s-1 | 1 | real | kind_phys | inout | F | -!! | evap | kinematic_surface_upward_latent_heat_flux_over_ice | kinematic surface upward latent heat flux over ice | kg kg-1 m s-1 | 1 | real | kind_phys | inout | F | -!! | hflx | kinematic_surface_upward_sensible_heat_flux_over_ice | kinematic surface upward sensible heat flux over ice | K m s-1 | 1 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! \htmlinclude cice_run.html !! !! diff --git a/physics/sfc_cice.meta b/physics/sfc_cice.meta new file mode 100644 index 000000000..2f8f70609 --- /dev/null +++ b/physics/sfc_cice.meta @@ -0,0 +1,240 @@ +[ccpp-arg-table] + name = cice_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in + optional = F +[cplflx] + standard_name = flag_for_flux_coupling + long_name = flag controlling cplflx collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[cplchm] + standard_name = flag_for_chemistry_coupling + long_name = flag controlling cplchm collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rvrdm1] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[u1] + standard_name = x_wind_at_lowest_model_layer + long_name = u component of surface layer wind + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[v1] + standard_name = y_wind_at_lowest_model_layer + long_name = v component of surface layer wind + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t1] + standard_name = air_temperature_at_lowest_model_layer + long_name = surface layer mean temperature + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[q1] + standard_name = water_vapor_specific_humidity_at_lowest_model_layer + long_name = surface layer mean specific humidity + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[cm] + standard_name = surface_drag_coefficient_for_momentum_in_air_over_ice + long_name = surface exchange coeff for momentum over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[ch] + standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice + long_name = surface exchange coeff heat & moisture over ice + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prsl1] + standard_name = air_pressure_at_lowest_model_layer + long_name = surface layer mean pressure + units = Pa + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[prslki] + standard_name = ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer + long_name = Exner function ratio bt midlayer and interface at 1st layer + units = ratio + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[flag_cice] + standard_name = flag_for_cice + long_name = flag for cice + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[ddvel] + standard_name = surface_wind_enhancement_due_to_convection + long_name = wind enhancement due to convection + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[flag_iter] + standard_name = flag_for_iteration + long_name = flag for iteration + units = flag + dimensions = (horizontal_dimension) + type = logical + intent = in + optional = F +[dqsfc] + standard_name = surface_upward_latent_heat_flux_for_coupling_interstitial + long_name = sfc latent heat flux for coupling interstitial + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[dtsfc] + standard_name = surface_upward_sensible_heat_flux_for_coupling_interstitial + long_name = sfc sensible heat flux for coupling interstitial + units = W m-2 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[qsurf] + standard_name = surface_specific_humidity_over_ice + long_name = surface air saturation specific humidity over ice + units = kg kg-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[cmm] + standard_name = surface_drag_wind_speed_for_momentum_in_air_over_ice + long_name = momentum exchange coefficient over ice + units = m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[chh] + standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ice + long_name = thermal exchange coefficient over ice + units = kg m-2 s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux_over_ice + long_name = kinematic surface upward latent heat flux over ice + units = kg kg-1 m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[hflx] + standard_name = kinematic_surface_upward_sensible_heat_flux_over_ice + long_name = kinematic surface upward sensible heat flux over ice + units = K m s-1 + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout + optional = F +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out + optional = F +[errflg] + standard_name = ccpp_error_flag + long_name = error flag for error handling in CCPP + units = flag + dimensions = () + type = integer + intent = out + optional = F From 5730682bc197c791eebdcf84a105df16270cf0be Mon Sep 17 00:00:00 2001 From: climbfuji Date: Wed, 4 Sep 2019 10:38:59 -0600 Subject: [PATCH 85/89] Bugfixes for sfc_cice metadata --- physics/sfc_cice.f | 4 ++-- physics/sfc_cice.meta | 2 +- physics/sfc_sice.f | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/physics/sfc_cice.f b/physics/sfc_cice.f index 97efef18d..562d00bee 100644 --- a/physics/sfc_cice.f +++ b/physics/sfc_cice.f @@ -25,8 +25,8 @@ end subroutine sfc_cice_finalize !! !> \brief Brief description of the subroutine !! -!! \section arg_table_cice_run Arguments -!! \htmlinclude cice_run.html +!! \section arg_table_sfc_cice_run Arguments +!! \htmlinclude sfc_cice_run.html !! !! diff --git a/physics/sfc_cice.meta b/physics/sfc_cice.meta index 2f8f70609..756c760a4 100644 --- a/physics/sfc_cice.meta +++ b/physics/sfc_cice.meta @@ -1,5 +1,5 @@ [ccpp-arg-table] - name = cice_run + name = sfc_cice_run type = scheme [im] standard_name = horizontal_loop_extent diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index 92a872cc1..7c2da2415 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -6,10 +6,10 @@ module sfc_sice contains - subroutine sfc_sice_init + subroutine sfc_sice_init() end subroutine sfc_sice_init ! - subroutine sfc_sice_finalize + subroutine sfc_sice_finalize() end subroutine sfc_sice_finalize !>\defgroup gfs_sice_main GFS Three-layer Thermodynomics Sea-Ice Scheme Module From cd8f28091aa5206dc3ab9b3ebe0a3ffdbc3f52a9 Mon Sep 17 00:00:00 2001 From: "ligia.bernardet" Date: Wed, 4 Sep 2019 10:53:33 -0600 Subject: [PATCH 86/89] Address reviewer comment regarding patterns for files that need to be documented (added .F). Remove mention of V3 release so documentation is generic. --- physics/docs/ccpp_doxyfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/physics/docs/ccpp_doxyfile b/physics/docs/ccpp_doxyfile index 1a11e9e99..351dc022f 100644 --- a/physics/docs/ccpp_doxyfile +++ b/physics/docs/ccpp_doxyfile @@ -1,7 +1,7 @@ # Doxyfile 1.8.11 DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = "Common Community Physics Package (CCPP) Scientific Documentation" -PROJECT_NUMBER = "Version 3.0" +PROJECT_NUMBER = "" PROJECT_BRIEF = " " PROJECT_LOGO = img/dtc_logo.png OUTPUT_DIRECTORY = doc @@ -255,6 +255,7 @@ INPUT = pdftxt/mainpage.txt \ INPUT_ENCODING = UTF-8 FILE_PATTERNS = *.f \ + *.F \ *.F90 \ *.f90 \ *.nml \ From 29474224bb2d0709fc4bc346a45fe9b5a84e6879 Mon Sep 17 00:00:00 2001 From: climbfuji Date: Wed, 4 Sep 2019 11:25:22 -0600 Subject: [PATCH 87/89] Make dqdti (instantaneous_water_vapor_specific_humidity_tendency_due_to_convection) an assumed-shape array --- physics/GFS_DCNV_generic.F90 | 2 -- physics/GFS_suite_interstitial.F90 | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 index dada6f18b..c2e98e966 100644 --- a/physics/GFS_DCNV_generic.F90 +++ b/physics/GFS_DCNV_generic.F90 @@ -84,11 +84,9 @@ end subroutine GFS_DCNV_generic_post_init subroutine GFS_DCNV_generic_post_finalize () end subroutine GFS_DCNV_generic_post_finalize -#if 0 !> \section arg_table_GFS_DCNV_generic_post_run Argument Table !! \htmlinclude GFS_DCNV_generic_post_run.html !! -#endif subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, lgocart, ras, cscnv, do_ca, & isppt_deep, frain, rain1, dtf, cld1d, save_u, save_v, save_t, save_qv, gu0, gv0, gt0, & gq0_water_vapor, ud_mf, dd_mf, dt_mf, con_g, clw_ice, clw_liquid, npdf3d, num_p3d, ncnvcld3d, & diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 955fe90bd..648959c99 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -637,7 +637,8 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, lgocart, tracers_t real(kind=kind_phys), dimension(im,levs,ntrac), intent(inout) :: gq0 real(kind=kind_phys), dimension(im,levs,nn), intent(inout) :: clw - real(kind=kind_phys), dimension(im,levs), intent(inout) :: dqdti + ! dqdti may not be allocated + real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg From f111a6f3a81675ed5048a4cd2aa95ff7e465d39f Mon Sep 17 00:00:00 2001 From: climbfuji Date: Wed, 4 Sep 2019 15:39:53 -0600 Subject: [PATCH 88/89] Update of CCPP physics to reflect latest changes in IPD physics (aerosol tracer transport for coupled chemistry applications) --- physics/GFS_PBL_generic.F90 | 38 +- physics/GFS_PBL_generic.meta | 48 ++ physics/GFS_SCNV_generic.F90 | 19 +- physics/GFS_SCNV_generic.meta | 8 + physics/GFS_suite_interstitial.F90 | 15 +- physics/GFS_suite_interstitial.meta | 8 + physics/maximum_hourly_diagnostics.F90 | 4 +- physics/physcons.F90 | 4 + physics/samfaerosols.F | 813 +++++++++++++++++++++++++ physics/samfdeepcnv.f | 49 +- physics/samfdeepcnv.meta | 25 + physics/samfshalcnv.f | 42 +- physics/samfshalcnv.meta | 25 + 13 files changed, 1070 insertions(+), 28 deletions(-) create mode 100644 physics/samfaerosols.F diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index e030b5d03..9eb707311 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -19,7 +19,7 @@ end subroutine GFS_PBL_generic_pre_finalize #endif subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, & ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, & - ntwa, ntia, ntgl, ntoz, ntke, ntkev, & + ntwa, ntia, ntgl, ntoz, ntke, ntkev, trans_aero, ntchs, ntchm, & imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, & imp_physics_zhao_carr, imp_physics_mg, cplchm, ltaerosol, hybedmf, do_shoc, & satmedmf, qgrs, vdftra, errmsg, errflg) @@ -30,7 +30,8 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, integer, intent(in) :: im, levs, nvdiff, ntrac integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc - integer, intent(in) :: ntwa, ntia, ntgl, ntoz, ntke, ntkev + integer, intent(in) :: ntwa, ntia, ntgl, ntoz, ntke, ntkev, ntchs, ntchm + logical, intent(in) :: trans_aero integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6 integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg logical, intent(in) :: cplchm, ltaerosol, hybedmf, do_shoc, satmedmf @@ -42,7 +43,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, integer, intent(out) :: errflg !local variables - integer :: i, k + integer :: i, k, kk, n ! Initialize CCPP error handling variables errmsg = '' @@ -140,6 +141,17 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, vdftra(i,k,7) = qgrs(i,k,ntoz) enddo enddo + if (trans_aero) then + kk = 7 + do n=ntchs,ntchm+ntchs-1 + kk = kk + 1 + do k=1,levs + do i=1,im + vdftra(i,k,kk) = qgrs(i,k,n) + enddo + enddo + enddo + endif elseif (imp_physics == imp_physics_zhao_carr) then ! Zhao/Carr/Sundqvist if (cplchm) then @@ -185,6 +197,7 @@ end subroutine GFS_PBL_generic_post_finalize #endif subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, & ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, ntwa, ntia, ntgl, ntoz, ntke, ntkev, & + trans_aero, ntchs, ntchm, & imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_zhao_carr, imp_physics_mg, & ltaerosol, cplflx, cplchm, lssav, ldiag3d, lsidea, hybedmf, do_shoc, satmedmf, shinhong, do_ysu, & dvdftra, dusfc1, dvsfc1, dtsfc1, dqsfc1, dtf, dudt, dvdt, dtdt, htrsw, htrlw, xmu, & @@ -198,8 +211,9 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, implicit none - integer, intent(in) :: im, levs, nvdiff, ntrac + integer, intent(in) :: im, levs, nvdiff, ntrac, ntchs, ntchm integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, ntwa, ntia, ntgl, ntoz, ntke, ntkev + logical, intent(in) :: trans_aero integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6 integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg logical, intent(in) :: ltaerosol, cplflx, cplchm, lssav, ldiag3d, lsidea @@ -234,7 +248,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - integer :: i, k + integer :: i, k, kk, n real(kind=kind_phys) :: tem, tem1, rho ! Initialize CCPP error handling variables @@ -327,8 +341,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, enddo enddo endif - elseif (imp_physics == imp_physics_gfdl) then - ! GFDL MP + elseif (imp_physics == imp_physics_gfdl) then ! GFDL MP do k=1,levs do i=1,im dqdt(i,k,ntqv) = dvdftra(i,k,1) @@ -340,6 +353,17 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, dqdt(i,k,ntoz) = dvdftra(i,k,7) enddo enddo + if (trans_aero) then + kk = 7 + do n=ntchs,ntchm+ntchs-1 + kk = kk + 1 + do k=1,levs + do i=1,im + dqdt(i,k,n) = dvdftra(i,k,kk) + enddo + enddo + enddo + endif elseif (imp_physics == imp_physics_zhao_carr) then if (cplchm) then do k=1,levs diff --git a/physics/GFS_PBL_generic.meta b/physics/GFS_PBL_generic.meta index 677f2e533..ddae5b5bd 100644 --- a/physics/GFS_PBL_generic.meta +++ b/physics/GFS_PBL_generic.meta @@ -161,6 +161,30 @@ type = integer intent = in optional = F +[trans_aero] + standard_name = flag_for_aerosol_convective_transport_and_PBL_diffusion + long_name = flag for aerosol convective transport and PBL diffusion + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ntchs] + standard_name = index_for_first_chemical_tracer + long_name = tracer index for first chemical tracer + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntchm] + standard_name = number_of_chemical_tracers + long_name = number of chemical tracers + units = count + dimensions = () + type = integer + intent = in + optional = F [imp_physics] standard_name = flag_for_microphysics_scheme long_name = choice of microphysics scheme @@ -449,6 +473,30 @@ type = integer intent = in optional = F +[trans_aero] + standard_name = flag_for_aerosol_convective_transport_and_PBL_diffusion + long_name = flag for aerosol convective transport and PBL diffusion + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ntchs] + standard_name = index_for_first_chemical_tracer + long_name = tracer index for first chemical tracer + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntchm] + standard_name = number_of_chemical_tracers + long_name = number of chemical tracers + units = count + dimensions = () + type = integer + intent = in + optional = F [imp_physics] standard_name = flag_for_microphysics_scheme long_name = choice of microphysics scheme diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 index a845abb48..f01fdad5f 100644 --- a/physics/GFS_SCNV_generic.F90 +++ b/physics/GFS_SCNV_generic.F90 @@ -67,15 +67,15 @@ end subroutine GFS_SCNV_generic_post_finalize !> \section arg_table_GFS_SCNV_generic_post_run Argument Table !! \htmlinclude GFS_SCNV_generic_post_run.html !! - subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, lgocart, frain, gt0, gq0_water_vapor, & - save_t, save_qv, dqdti, dt3dt, dq3dt, clw, errmsg, errflg) + subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, lgocart, cplchm, & + frain, gt0, gq0_water_vapor, save_t, save_qv, dqdti, dt3dt, dq3dt, clw, errmsg, errflg) use machine, only: kind_phys implicit none integer, intent(in) :: im, levs, nn - logical, intent(in) :: lssav, ldiag3d, lgocart + logical, intent(in) :: lssav, ldiag3d, lgocart, cplchm real(kind=kind_phys), intent(in) :: frain real(kind=kind_phys), dimension(im,levs), intent(in) :: gt0, gq0_water_vapor real(kind=kind_phys), dimension(im,levs), intent(in) :: save_t, save_qv @@ -98,11 +98,11 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, lgocart, fra if (lssav) then ! update dqdt_v to include moisture tendency due to shallow convection - if (lgocart) then + if (lgocart .and. .not.cplchm) then do k=1,levs do i=1,im tem = (gq0_water_vapor(i,k)-save_qv(i,k)) * frain - dqdti(i,k) = dqdti(i,k) + tem + dqdti(i,k) = dqdti(i,k) + tem enddo enddo endif @@ -115,6 +115,15 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, lgocart, fra enddo endif endif ! end if_lssav +! + if (cplchm) then + do k=1,levs + do i=1,im + tem = (gq0_water_vapor(i,k)-save_qv(i,k)) * frain + dqdti(i,k) = dqdti(i,k) + tem + enddo + enddo + endif ! do k=1,levs do i=1,im diff --git a/physics/GFS_SCNV_generic.meta b/physics/GFS_SCNV_generic.meta index 11b9b71a2..93c4a43df 100644 --- a/physics/GFS_SCNV_generic.meta +++ b/physics/GFS_SCNV_generic.meta @@ -139,6 +139,14 @@ type = logical intent = in optional = F +[cplchm] + standard_name = flag_for_chemistry_coupling + long_name = flag controlling cplchm collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F [frain] standard_name = dynamics_to_physics_timestep_ratio long_name = ratio of dynamics timestep to physics timestep diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 648959c99..6ecc5925f 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -613,9 +613,9 @@ end subroutine GFS_suite_interstitial_4_finalize !> \section arg_table_GFS_suite_interstitial_4_run Argument Table !! \htmlinclude GFS_suite_interstitial_4_run.html !! - subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, lgocart, tracers_total, ntrac, ntcw, ntiw, ntclamt, & - ntrw, ntsw, ntrnc, ntsnc, ntgl, ntgnc, ntlnc, ntinc, nn, imp_physics, imp_physics_gfdl, imp_physics_thompson, & - imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, dtf, save_qc, save_qi, con_pi, & + subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, lgocart, cplchm, tracers_total, ntrac, ntcw, ntiw, ntclamt, & + ntrw, ntsw, ntrnc, ntsnc, ntgl, ntgnc, ntlnc, ntinc, nn, imp_physics, imp_physics_gfdl, imp_physics_thompson, & + imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, dtf, save_qc, save_qi, con_pi, & gq0, clw, dqdti, errmsg, errflg) use machine, only: kind_phys @@ -628,7 +628,7 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, lgocart, tracers_t ntsw, ntrnc, ntsnc, ntgl, ntgnc, ntlnc, ntinc, nn, imp_physics, imp_physics_gfdl, imp_physics_thompson, & imp_physics_zhao_carr, imp_physics_zhao_carr_pdf - logical, intent(in) :: ltaerosol, lgocart + logical, intent(in) :: ltaerosol, lgocart, cplchm real(kind=kind_phys), intent(in) :: con_pi, dtf real(kind=kind_phys), dimension(im,levs), intent(in) :: save_qc @@ -678,8 +678,9 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, lgocart, tracers_t if (ntcw > 0) then ! for microphysics - if (imp_physics == imp_physics_zhao_carr_pdf .or. imp_physics == imp_physics_zhao_carr & - .or. imp_physics == imp_physics_gfdl) then + if (imp_physics == imp_physics_zhao_carr .or. & + imp_physics == imp_physics_zhao_carr_pdf .or. & + imp_physics == imp_physics_gfdl) then gq0(1:im,:,ntcw) = clw(1:im,:,1) + clw(1:im,:,2) elseif (ntiw > 0) then do k=1,levs @@ -723,7 +724,7 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, lgocart, tracers_t endif ! end if_ntcw ! dqdt_v : instaneous moisture tendency (kg/kg/sec) - if (lgocart) then + if (lgocart .or. cplchm) then do k=1,levs do i=1,im dqdti(i,k) = dqdti(i,k) * (1.0 / dtf) diff --git a/physics/GFS_suite_interstitial.meta b/physics/GFS_suite_interstitial.meta index feefe3da3..91a2c04a4 100644 --- a/physics/GFS_suite_interstitial.meta +++ b/physics/GFS_suite_interstitial.meta @@ -1393,6 +1393,14 @@ type = logical intent = in optional = F +[cplchm] + standard_name = flag_for_chemistry_coupling + long_name = flag controlling cplchm collection (default off) + units = flag + dimensions = () + type = logical + intent = in + optional = F [tracers_total] standard_name = number_of_total_tracers long_name = total number of tracers diff --git a/physics/maximum_hourly_diagnostics.F90 b/physics/maximum_hourly_diagnostics.F90 index 422cd147f..10533d99d 100644 --- a/physics/maximum_hourly_diagnostics.F90 +++ b/physics/maximum_hourly_diagnostics.F90 @@ -66,7 +66,9 @@ subroutine maximum_hourly_diagnostics_run(im, levs, reset, lradar, imp_physics, errflg = 0 !Calculate hourly max 1-km agl and -10C reflectivity - if (lradar .and. (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson)) then + if (lradar .and. & + (imp_physics == imp_physics_gfdl .or. & + imp_physics == imp_physics_thompson)) then allocate(refd(im)) allocate(refd263k(im)) call max_fields(phil,refl_10cm,con_g,im,levs,refd,gt0,refd263k) diff --git a/physics/physcons.F90 b/physics/physcons.F90 index 059071ee1..5fb993ac3 100644 --- a/physics/physcons.F90 +++ b/physics/physcons.F90 @@ -115,8 +115,12 @@ module physcons real(kind=kind_phys),parameter:: con_amn2o =44.013_kind_phys !< molecular wght of n2o (\f$g/mol\f$) real(kind=kind_phys),parameter:: con_thgni =-38.15_kind_phys !< temperature the H.G.Nuc. ice starts +!> minimum ice concentration real(kind=kind_phys),parameter:: cimin =0.15 !< minimum ice concentration +!> minimum aerosol concentration + real(kind=kind_phys),parameter:: qamin = 1.e-16_kind_phys + !> \name Miscellaneous physics related constants (For WSM6; Moorthi - Jul 2014) ! integer, parameter :: max_lon=16000, max_lat=8000, min_lon=192, min_lat=94 ! integer, parameter :: max_lon=5000, max_lat=2500, min_lon=192, min_lat=94 ! current opr diff --git a/physics/samfaerosols.F b/physics/samfaerosols.F new file mode 100644 index 000000000..fea4b5ead --- /dev/null +++ b/physics/samfaerosols.F @@ -0,0 +1,813 @@ + module samfcnv_aerosols + + implicit none + + private + + public :: samfdeepcnv_aerosols, samfshalcnv_aerosols + + contains + + subroutine samfdeepcnv_aerosols(im, ix, km, itc, ntc, ntr, delt, + & xlamde, xlamdd, cnvflg, jmin, kb, kmax, kbcon, ktcon, fscav, + & edto, xlamd, xmb, c0t, eta, etad, zi, xlamue, xlamud, delp, + & qtr, qaero) + + use machine , only : kind_phys + use physcons, only : g => con_g, qamin + + implicit none + +c -- input arguments + integer, intent(in) :: im, + & ix, km, itc, ntc, ntr + real(kind=kind_phys), intent(in) :: delt, + & xlamde, xlamdd + logical, dimension(im), intent(in) :: cnvflg + integer, dimension(im), intent(in) :: jmin, + & kb, kmax, kbcon, ktcon + real(kind=kind_phys), dimension(im), intent(in) :: edto, + & xlamd, xmb + real(kind=kind_phys), dimension(ntc), intent(in) :: fscav + real(kind=kind_phys), dimension(im,km), intent(in) :: c0t, + & eta, etad, zi, xlamue, xlamud + real(kind=kind_phys), dimension(ix,km), intent(in) :: delp + real(kind=kind_phys), dimension(ix,km,ntr+2), intent(in) :: qtr +c -- output arguments + real(kind=kind_phys), dimension(im,km,ntc), intent(out) :: qaero + +c -- local variables +c -- general variables + integer :: i, indx, it, k, kk, km1, kp1, n + real(kind=kind_phys) :: adw, aup, dtime_max, dv1q, dv2q, dv3q, + & dtovdz, dz, factor, ptem, ptem1, qamax, tem, tem1 + real(kind=kind_phys), dimension(ix,km) :: xmbp +c -- chemical transport variables + real(kind=kind_phys), dimension(im,km,ntc) :: ctro2, ecko2, ecdo2, + & dellae2 +c -- additional variables for tracers for wet deposition, + real(kind=kind_phys), dimension(im,km,ntc) :: chem_c, chem_pw, + & wet_dep +c -- if reevaporation is enabled, uncomment lines below +c real(kind=kind_phys), dimension(im,ntc) :: pwav +c real(kind=kind_phys), dimension(im,km) :: pwdper +c real(kind=kind_phys), dimension(im,km,ntr) :: chem_pwd +c -- additional variables for fct + real(kind=kind_phys), dimension(im,km) :: flx_lo, totlout, clipout + + real(kind=kind_phys), parameter :: one = 1.0_kind_phys + real(kind=kind_phys), parameter :: half = 0.5_kind_phys + real(kind=kind_phys), parameter :: quarter = 0.25_kind_phys + real(kind=kind_phys), parameter :: zero = 0.0_kind_phys + real(kind=kind_phys), parameter :: epsil = 1.e-22_kind_phys ! prevent division by zero + +c -- begin + +c -- check if aerosols are present + if ( ntc <= 0 .or. itc <= 0 .or. ntr <= 0 ) return + if ( ntr < itc + ntc - 3 ) return + +c -- initialize work variables + km1 = km - 1 + + chem_c = zero + chem_pw = zero + ctro2 = zero + dellae2 = zero + ecdo2 = zero + ecko2 = zero + qaero = zero + +c -- set work arrays + + do n = 1, ntc + it = n + itc - 1 + do k = 1, km + do i = 1, im + if (k <= kmax(i)) qaero(i,k,n) = max(qamin, qtr(i,k,it)) + enddo + enddo + enddo + + do k = 1, km + do i = 1, im + xmbp(i,k) = g * xmb(i) / delp(i,k) + enddo + enddo + + do n = 1, ntc +c -- interface level + do k = 1, km1 + kp1 = k + 1 + do i = 1, im + if (kp1 <= kmax(i)) ctro2(i,k,n) = + & half * (qaero(i,k,n) + qaero(i,kp1,n)) + enddo + enddo +c -- top level + do i = 1, im + ctro2(i,kmax(i),n) = qaero(i,kmax(i),n) + enddo + enddo + + do n = 1, ntc + do k = 1, km + do i = 1, im + if (cnvflg(i) .and. (k <= kb(i))) + & ecko2(i,k,n) = ctro2(i,k,n) + enddo + enddo + enddo + + do n = 1, ntc + do i = 1, im + if (cnvflg(i)) ecdo2(i,jmin(i),n) = ctro2(i,jmin(i),n) + enddo + enddo + +c do chemical tracers, first need to know how much reevaporates + +c aerosol re-evaporation is set to zero for now +c uncomment and edit the following code to enable re-evaporation +c chem_pwd = zero +c pwdper = zero +c pwav = zero +c do i = 1, im +c do k=1,jmin(i) +c pwdper(i,k)= -edto(i)*pwdo(i,k)/pwavo(i) +c enddo +c enddo +c +c calculate include mixing ratio (ecko2), how much goes into +c rainwater to be rained out (chem_pw), and total scavenged, +c if not reevaporated (pwav) + + do n = 1, ntc + do k = 2, km1 + kk = k - 1 + do i = 1, im + if (cnvflg(i)) then + if ((k > kb(i)) .and. (k < ktcon(i))) then + dz = zi(i,k) - zi(i,kk) + tem = half * (xlamue(i,k)+xlamue(i,kk)) * dz + tem1 = quarter * (xlamud(i,k)+xlamud(i,kk)) * dz + factor = one + tem - tem1 + +c if conserved (not scavenging) then + ecko2(i,k,n) = ((one-tem1)*ecko2(i,kk,n) + & + half*tem*(ctro2(i,k,n)+ctro2(i,kk,n)))/factor + +c how much will be scavenged +c +c this choice was used in GF, and is also described in a +c successful implementation into CESM in GRL (Yu et al. 2019), +c it uses dimesnsionless scavenging coefficients (fscav), +c but includes henry coeffs with gas phase chemistry + +c fraction fscav is going into liquid + chem_c(i,k,n)=fscav(n)*ecko2(i,k,n) + +c of that part is going into rain out (chem_pw) + tem=chem_c(i,k,n)/(one+c0t(i,k)*dz) + chem_pw(i,k,n)=c0t(i,k)*dz*tem*eta(i,kk) !etah + ecko2(i,k,n)=tem+ecko2(i,k,n)-chem_c(i,k,n) + +c pwav needed fo reevaporation in downdraft +c if including reevaporation, please uncomment code below +c pwav(i,n)=pwav(i,n)+chem_pw(i,k,n) + endif + endif + enddo + enddo + do k = 1, km1 + do i = 1, im + if (k >= ktcon(i)) ecko2(i,k,n)=ctro2(i,k,n) + enddo + enddo + enddo + +c reevaporation of some, pw and pwd terms needed later for dellae2 + + do n = 1, ntc + do k = km1, 1, -1 + kp1 = k + 1 + do i = 1, im + if (cnvflg(i) .and. (k < jmin(i))) then + dz = zi(i,kp1) - zi(i,k) + if (k >= kbcon(i)) then + tem = xlamde * dz + tem1 = half * xlamdd * dz + else + tem = xlamde * dz + tem1 = half * (xlamd(i)+xlamdd) * dz + endif + factor = one + tem - tem1 + ecdo2(i,k,n) = ((one-tem1)*ecdo2(i,kp1,n) + & +half*tem*(ctro2(i,k,n)+ctro2(i,kp1,n)))/factor +c if including reevaporation, please uncomment code below +c ecdo2(i,k,n)=ecdo2(i,k,n)+pwdper(i,kp1)*pwav(i,n) +c chem_pwd(i,k,n)=max(zero,pwdper(i,kp1)*pwav(i,n)) + endif + enddo + enddo + enddo + + do n = 1, ntc + do i = 1, im + if (cnvflg(i)) then +c subsidence term treated in fct routine + dellae2(i,1,n) = edto(i)*etad(i,1)*ecdo2(i,1,n)*xmbp(i,1) + endif + enddo + enddo + + do n = 1, ntc + do i = 1, im + if (cnvflg(i)) then + k = ktcon(i) + kk = k - 1 +c for the subsidence term already is considered + dellae2(i,k,n) = eta(i,kk) * ecko2(i,kk,n) * xmbp(i,k) + endif + enddo + enddo + +c --- for updraft & downdraft vertical transport +c +c initialize maximum allowed timestep for upstream difference approach +c + dtime_max=delt + do k=2,km1 + kk = k - 1 + do i = 1, im + if (kk < ktcon(i)) dtime_max = min(dtime_max,half*delp(i,kk)) + enddo + enddo + +c now for every chemistry tracer + do n = 1, ntc + do k = 2, km1 + kk = k - 1 + do i = 1, im + if (cnvflg(i) .and. (k < ktcon(i))) then + dz = zi(i,k) - zi(i,kk) + aup = one + if (k <= kb(i)) aup = zero + adw = one + if (k > jmin(i)) adw = zero + + dv1q = half * (ecko2(i,k,n) + ecko2(i,kk,n)) + dv2q = half * (ctro2(i,k,n) + ctro2(i,kk,n)) + dv3q = half * (ecdo2(i,k,n) + ecdo2(i,kk,n)) + + tem = half * (xlamue(i,k) + xlamue(i,kk)) + tem1 = half * (xlamud(i,k) + xlamud(i,kk)) + + if (k <= kbcon(i)) then + ptem = xlamde + ptem1 = xlamd(i) + xlamdd + else + ptem = xlamde + ptem1 = xlamdd + endif + dellae2(i,k,n) = dellae2(i,k,n) + +c detrainment from updraft + & ( aup*tem1*eta(i,kk)*dv1q +c entrainement into up and downdraft + & - (aup*tem*eta(i,kk)+adw*edto(i)*ptem*etad(i,k))*dv2q +c detrainment from downdraft + & + (adw*edto(i)*ptem1*etad(i,k)*dv3q) ) * dz * xmbp(i,k) + + wet_dep(i,k,n)=chem_pw(i,k,n)*g/delp(i,k) + +c sinks from where updraft and downdraft start + if (k == jmin(i)+1) then + dellae2(i,k,n) = dellae2(i,k,n) + & -edto(i)*etad(i,kk)*ctro2(i,kk,n)*xmbp(i,k) + endif + if (k == kb(i))then + dellae2(i,k,n) = dellae2(i,k,n) + & -eta(i,k)*ctro2(i,k,n)*xmbp(i,k) + endif + endif + enddo + enddo + + do i = 1, im + if (cnvflg(i)) then + if (kb(i) == 1) then + k=kb(i) + dellae2(i,k,n) = dellae2(i,k,n) + & -eta(i,k)*ctro2(i,k,n)*xmbp(i,k) + endif + endif + enddo + + enddo + +c for every tracer... + + do n = 1, ntc + flx_lo = zero + totlout = zero + clipout = zero +c compute low-order mass flux, upstream + do k = 2, km1 + kk = k - 1 + do i = 1, im + if (cnvflg(i) .and. (kk < ktcon(i))) then + tem = zero + if (kk >= kb(i) ) tem = eta(i,kk) + if (kk <= jmin(i)) tem = tem - edto(i)*etad(i,kk) +c low-order flux,upstream + if (tem > zero) then + flx_lo(i,k) = -xmb(i) * tem * qaero(i,k,n) + elseif (tem < zero) then + flx_lo(i,k) = -xmb(i) * tem * qaero(i,kk,n) + endif + endif + enddo + enddo + +c --- make sure low-ord fluxes don't violate positive-definiteness + do k=1,km1 + kp1 = k + 1 + do i=1,im + if (cnvflg(i) .and. (k <= ktcon(i))) then +c time step / grid spacing + dtovdz = g * dtime_max / abs(delp(i,k)) +c total flux out + totlout(i,k)=max(zero,flx_lo(i,kp1))-min(zero,flx_lo(i,k)) + clipout(i,k)=min(one ,qaero(i,k,n)/max(epsil,totlout(i,k)) + & / (1.0001_kind_phys*dtovdz)) + endif + enddo + enddo + +c recompute upstream mass fluxes + do k = 2, km1 + kk = k - 1 + do i = 1, im + if (cnvflg(i) .and. (kk < ktcon(i))) then + tem = zero + if (kk >= kb(i) ) tem = eta(i,kk) + if (kk <= jmin(i)) tem = tem - edto(i)*etad(i,kk) + if (tem > zero) then + flx_lo(i,k) = flx_lo(i,k) * clipout(i,k) + elseif (tem < zero) then + flx_lo(i,k) = flx_lo(i,k) * clipout(i,kk) + endif + endif + enddo + enddo + +c --- a positive-definite low-order (diffusive) solution for the subsidnce fluxes + do k=1,km1 + kp1 = k + 1 + do i=1,im + if (cnvflg(i) .and. (k <= ktcon(i))) then + dtovdz = g * dtime_max / abs(delp(i,k)) ! time step /grid spacing + dellae2(i,k,n) = dellae2(i,k,n) + & -(flx_lo(i,kp1)-flx_lo(i,k))*dtovdz/dtime_max + endif + enddo + enddo + + enddo ! ctr + +c convert wet deposition to total mass deposited over dt and dp + + do n = 1, ntc + do k = 1, km + do i = 1, im + if (cnvflg(i) .and. (k < ktcon(i))) + & wet_dep(i,k,n) = wet_dep(i,k,n)*xmb(i)*delt*delp(i,k) + enddo + enddo + enddo + +c compute final aerosol concentrations + + do n = 1, ntc + do k = 1, km + do i = 1, im + if (cnvflg(i) .and. (k <= min(kmax(i),ktcon(i)))) then + qaero(i,k,n) = qaero(i,k,n) + dellae2(i,k,n) * delt + if (qaero(i,k,n) < zero) then +c add negative mass to wet deposition + wet_dep(i,k,n) = wet_dep(i,k,n)-qaero(i,k,n)*delp(i,k) + qaero(i,k,n) = qamin + endif + endif + enddo + enddo + enddo + + return + end subroutine samfdeepcnv_aerosols + + subroutine samfshalcnv_aerosols(im, ix, km, itc, ntc, ntr, delt, + & cnvflg, kb, kmax, kbcon, ktcon, fscav, + & xmb, c0t, eta, zi, xlamue, xlamud, delp, + & qtr, qaero) + + use machine , only : kind_phys + use physcons, only : g => con_g, qamin + + implicit none + +c -- input arguments + integer, intent(in) :: im, + & ix, km, itc, ntc, ntr + real(kind=kind_phys), intent(in) :: delt +! & xlamde, xlamdd + logical, dimension(im), intent(in) :: cnvflg +! integer, dimension(im), intent(in) :: jmin, + integer, dimension(im), intent(in) :: + & kb, kmax, kbcon, ktcon + real(kind=kind_phys), dimension(im), intent(in) :: + & xmb, xlamud + real(kind=kind_phys), dimension(ntc), intent(in) :: fscav + real(kind=kind_phys), dimension(im,km), intent(in) :: c0t, + & eta, zi, xlamue !, xlamud + real(kind=kind_phys), dimension(ix,km), intent(in) :: delp + real(kind=kind_phys), dimension(ix,km,ntr+2), intent(in) :: qtr +c -- output arguments + real(kind=kind_phys), dimension(im,km,ntc), intent(out) :: qaero + +c -- local variables +c -- general variables + integer :: i, indx, it, k, kk, km1, kp1, n +! real(kind=kind_phys) :: adw, aup, dtime_max, dv1q, dv2q, dv3q, + real(kind=kind_phys) :: aup, dtime_max, dv1q, dv2q, dv3q, + & dtovdz, dz, factor, ptem, ptem1, qamax, tem, tem1 + real(kind=kind_phys), dimension(ix,km) :: xmbp +c -- chemical transport variables + real(kind=kind_phys), dimension(im,km,ntc) :: ctro2,ecko2,dellae2 +c -- additional variables for tracers for wet deposition, + real(kind=kind_phys), dimension(im,km,ntc) :: chem_c, chem_pw, + & wet_dep +c -- if reevaporation is enabled, uncomment lines below +c real(kind=kind_phys), dimension(im,ntc) :: pwav +c real(kind=kind_phys), dimension(im,km) :: pwdper +c real(kind=kind_phys), dimension(im,km,ntr) :: chem_pwd +c -- additional variables for fct + real(kind=kind_phys), dimension(im,km) :: flx_lo, totlout, clipout + + real(kind=kind_phys), parameter :: one = 1.0_kind_phys + real(kind=kind_phys), parameter :: half = 0.5_kind_phys + real(kind=kind_phys), parameter :: quarter = 0.25_kind_phys + real(kind=kind_phys), parameter :: zero = 0.0_kind_phys + real(kind=kind_phys), parameter :: epsil = 1.e-22_kind_phys ! prevent division by zero + real(kind=kind_phys), parameter :: escav = 0.8_kind_phys ! wet scavenging efficiency + +c -- begin + +c -- check if aerosols are present + if ( ntc <= 0 .or. itc <= 0 .or. ntr <= 0 ) return + if ( ntr < itc + ntc - 3 ) return + +c -- initialize work variables + km1 = km - 1 + + chem_c = zero + chem_pw = zero + ctro2 = zero + dellae2 = zero + !ecdo2 = zero + ecko2 = zero + qaero = zero + +c -- set work arrays + + do n = 1, ntc + it = n + itc - 1 + do k = 1, km + do i = 1, im + if (k <= kmax(i)) qaero(i,k,n) = max(qamin, qtr(i,k,it)) + enddo + enddo + enddo + + do k = 1, km + do i = 1, im + xmbp(i,k) = g * xmb(i) / delp(i,k) + enddo + enddo + + do n = 1, ntc +c -- interface level + do k = 1, km1 + kp1 = k + 1 + do i = 1, im + if (kp1 <= kmax(i)) ctro2(i,k,n) = + & half * (qaero(i,k,n) + qaero(i,kp1,n)) + enddo + enddo +c -- top level + do i = 1, im + ctro2(i,kmax(i),n) = qaero(i,kmax(i),n) + enddo + enddo + + do n = 1, ntc + do k = 1, km + do i = 1, im + if (cnvflg(i) .and. (k <= kb(i))) + & ecko2(i,k,n) = ctro2(i,k,n) + enddo + enddo + enddo + + !do n = 1, ntc + ! do i = 1, im + ! if (cnvflg(i)) ecdo2(i,jmin(i),n) = ctro2(i,jmin(i),n) + ! enddo + !enddo + +c do chemical tracers, first need to know how much reevaporates + +c aerosol re-evaporation is set to zero for now +c uncomment and edit the following code to enable re-evaporation +c chem_pwd = zero +c pwdper = zero +c pwav = zero +c do i = 1, im +c do k=1,jmin(i) +c pwdper(i,k)= -edto(i)*pwdo(i,k)/pwavo(i) +c enddo +c enddo +c +c calculate include mixing ratio (ecko2), how much goes into +c rainwater to be rained out (chem_pw), and total scavenged, +c if not reevaporated (pwav) + + do n = 1, ntc + do k = 2, km1 + kk = k - 1 + do i = 1, im + if (cnvflg(i)) then + if ((k > kb(i)) .and. (k < ktcon(i))) then + dz = zi(i,k) - zi(i,kk) + tem = half * (xlamue(i,k)+xlamue(i,kk)) * dz +! tem1 = quarter * (xlamud(i,k)+xlamud(i,kk)) * dz + tem1 = quarter * (xlamud(i )+xlamud(i )) * dz + factor = one + tem - tem1 + +c if conserved (not scavenging) then + ecko2(i,k,n) = ((one-tem1)*ecko2(i,kk,n) + & + half*tem*(ctro2(i,k,n)+ctro2(i,kk,n)))/factor + +c how much will be scavenged +c +c this choice was used in GF, and is also described in a +c successful implementation into CESM in GRL (Yu et al. 2019), +c it uses dimesnsionless scavenging coefficients (fscav), +c but includes henry coeffs with gas phase chemistry + +c fraction fscav is going into liquid + chem_c(i,k,n)=escav*fscav(n)*ecko2(i,k,n) + +c of that part is going into rain out (chem_pw) + tem=chem_c(i,k,n)/(one+c0t(i,k)*dz) + chem_pw(i,k,n)=c0t(i,k)*dz*tem*eta(i,kk) !etah + ecko2(i,k,n)=tem+ecko2(i,k,n)-chem_c(i,k,n) + +c pwav needed fo reevaporation in downdraft +c if including reevaporation, please uncomment code below +c pwav(i,n)=pwav(i,n)+chem_pw(i,k,n) + endif + endif + enddo + enddo + do k = 1, km1 + do i = 1, im + if (k >= ktcon(i)) ecko2(i,k,n)=ctro2(i,k,n) + enddo + enddo + enddo + +c reevaporation of some, pw and pwd terms needed later for dellae2 + +! do n = 1, ntc +! do k = km1, 1, -1 +! kp1 = k + 1 +! do i = 1, im +! if (cnvflg(i) .and. (k < jmin(i))) then +! dz = zi(i,kp1) - zi(i,k) +! if (k >= kbcon(i)) then +! tem = xlamde * dz +! tem1 = half * xlamdd * dz +! else +! tem = xlamde * dz +! tem1 = half * (xlamd(i)+xlamdd) * dz +! endif +! factor = one + tem - tem1 +! ecdo2(i,k,n) = ((one-tem1)*ecdo2(i,kp1,n) +! & +half*tem*(ctro2(i,k,n)+ctro2(i,kp1,n)))/factor +c if including reevaporation, please uncomment code below +c ecdo2(i,k,n)=ecdo2(i,k,n)+pwdper(i,kp1)*pwav(i,n) +c chem_pwd(i,k,n)=max(zero,pwdper(i,kp1)*pwav(i,n)) +! endif +! enddo +! enddo +! enddo + +! do n = 1, ntc +! do i = 1, im +! if (cnvflg(i)) then +c subsidence term treated in fct routine +! dellae2(i,1,n) = edto(i)*etad(i,1)*ecdo2(i,1,n)*xmbp(i,1) +! endif +! enddo +! enddo + + do n = 1, ntc + do i = 1, im + if (cnvflg(i)) then + k = ktcon(i) + kk = k - 1 +c for the subsidence term already is considered + dellae2(i,k,n) = eta(i,kk) * ecko2(i,kk,n) * xmbp(i,k) + endif + enddo + enddo + +c --- for updraft & downdraft vertical transport +c +c initialize maximum allowed timestep for upstream difference approach +c + dtime_max=delt + do k=2,km1 + kk = k - 1 + do i = 1, im + if (kk < ktcon(i)) dtime_max = min(dtime_max,half*delp(i,kk)) + enddo + enddo + +c now for every chemistry tracer + do n = 1, ntc + do k = 2, km1 + kk = k - 1 + do i = 1, im + if (cnvflg(i) .and. (k < ktcon(i))) then + dz = zi(i,k) - zi(i,kk) + aup = one + if (k <= kb(i)) aup = zero +! adw = one +! if (k > jmin(i)) adw = zero + + dv1q = half * (ecko2(i,k,n) + ecko2(i,kk,n)) + dv2q = half * (ctro2(i,k,n) + ctro2(i,kk,n)) +c dv3q = half * (ecdo2(i,k,n) + ecdo2(i,kk,n)) + + tem = half * (xlamue(i,k) + xlamue(i,kk)) + !tem1 = half * (xlamud(i,k) + xlamud(i,kk)) + tem1 = half * (xlamud(i ) + xlamud(i )) + +! if (k <= kbcon(i)) then +! ptem = xlamde +! ptem1 = xlamd(i) + xlamdd +! else +! ptem = xlamde +! ptem1 = xlamdd +! endif + dellae2(i,k,n) = dellae2(i,k,n) + +c detrainment from updraft + & ( aup*tem1*eta(i,kk)*dv1q +c entrainement into up and downdraft +! & - (aup*tem*eta(i,kk)+adw*edto(i)*ptem*etad(i,k))*dv2q + & - (aup*tem*eta(i,kk))*dv2q +c detrainment from downdraft +! & + (adw*edto(i)*ptem1*etad(i,k)*dv3q) + & ) * dz * xmbp(i,k) + + wet_dep(i,k,n)=chem_pw(i,k,n)*g/delp(i,k) + +c sinks from where updraft and downdraft start +! if (k == jmin(i)+1) then +! dellae2(i,k,n) = dellae2(i,k,n) +! & -edto(i)*etad(i,kk)*ctro2(i,kk,n)*xmbp(i,k) +! endif + if (k == kb(i))then + dellae2(i,k,n) = dellae2(i,k,n) + & -eta(i,k)*ctro2(i,k,n)*xmbp(i,k) + endif + endif + enddo + enddo + + do i = 1, im + if (cnvflg(i)) then + if (kb(i) == 1) then + k=kb(i) + dellae2(i,k,n) = dellae2(i,k,n) + & -eta(i,k)*ctro2(i,k,n)*xmbp(i,k) + endif + endif + enddo + + enddo + +c for every tracer... + + do n = 1, ntc + flx_lo = zero + totlout = zero + clipout = zero +c compute low-order mass flux, upstream + do k = 2, km1 + kk = k - 1 + do i = 1, im + if (cnvflg(i) .and. (kk < ktcon(i))) then + tem = zero + if (kk >= kb(i) ) tem = eta(i,kk) +! if (kk <= jmin(i)) tem = tem - edto(i)*etad(i,kk) +c low-order flux,upstream + if (tem > zero) then + flx_lo(i,k) = -xmb(i) * tem * qaero(i,k,n) + elseif (tem < zero) then + flx_lo(i,k) = -xmb(i) * tem * qaero(i,kk,n) + endif + endif + enddo + enddo + +c --- make sure low-ord fluxes don't violate positive-definiteness + do k=1,km1 + kp1 = k + 1 + do i=1,im + if (cnvflg(i) .and. (k <= ktcon(i))) then +c time step / grid spacing + dtovdz = g * dtime_max / abs(delp(i,k)) +c total flux out + totlout(i,k)=max(zero,flx_lo(i,kp1))-min(zero,flx_lo(i,k)) + clipout(i,k)=min(one ,qaero(i,k,n)/max(epsil,totlout(i,k)) + & / (1.0001_kind_phys*dtovdz)) + endif + enddo + enddo + +c recompute upstream mass fluxes + do k = 2, km1 + kk = k - 1 + do i = 1, im + if (cnvflg(i) .and. (kk < ktcon(i))) then + tem = zero + if (kk >= kb(i) ) tem = eta(i,kk) +! if (kk <= jmin(i)) tem = tem - edto(i)*etad(i,kk) + if (tem > zero) then + flx_lo(i,k) = flx_lo(i,k) * clipout(i,k) + elseif (tem < zero) then + flx_lo(i,k) = flx_lo(i,k) * clipout(i,kk) + endif + endif + enddo + enddo + +c --- a positive-definite low-order (diffusive) solution for the subsidnce fluxes + do k=1,km1 + kp1 = k + 1 + do i=1,im + if (cnvflg(i) .and. (k <= ktcon(i))) then + dtovdz = g * dtime_max / abs(delp(i,k)) ! time step /grid spacing + dellae2(i,k,n) = dellae2(i,k,n) + & -(flx_lo(i,kp1)-flx_lo(i,k))*dtovdz/dtime_max + endif + enddo + enddo + + enddo ! ctr + +c convert wet deposition to total mass deposited over dt and dp + + do n = 1, ntc + do k = 1, km + do i = 1, im + if (cnvflg(i) .and. (k < ktcon(i))) + & wet_dep(i,k,n) = wet_dep(i,k,n)*xmb(i)*delt*delp(i,k) + enddo + enddo + enddo + +c compute final aerosol concentrations + + do n = 1, ntc + do k = 1, km + do i = 1, im + if (cnvflg(i) .and. (k <= min(kmax(i),ktcon(i)))) then + qaero(i,k,n) = qaero(i,k,n) + dellae2(i,k,n) * delt + if (qaero(i,k,n) < zero) then +c add negative mass to wet deposition + wet_dep(i,k,n) = wet_dep(i,k,n)-qaero(i,k,n)*delp(i,k) + qaero(i,k,n) = qamin + endif + endif + enddo + enddo + enddo + + return + end subroutine samfshalcnv_aerosols + + end module samfcnv_aerosols \ No newline at end of file diff --git a/physics/samfdeepcnv.f b/physics/samfdeepcnv.f index 8ebf9cde0..bb5d5deb1 100644 --- a/physics/samfdeepcnv.f +++ b/physics/samfdeepcnv.f @@ -6,6 +6,8 @@ !! convection scheme. module samfdeepcnv + use samfcnv_aerosols, only : samfdeepcnv_aerosols + contains !> \brief Brief description of the subroutine @@ -66,10 +68,10 @@ end subroutine samfdeepcnv_finalize !! !! \section samfdeep_detailed GFS samfdeepcnv Detailed Algorithm !! @{ - subroutine samfdeepcnv_run (im,ix,km,cliq,cp,cvap, & + subroutine samfdeepcnv_run (im,ix,km,itc,ntc,cliq,cp,cvap, & & eps,epsm1,fv,grav,hvap,rd,rv, & & t0c,delt,ntk,ntr,delp, & - & prslp,psp,phil,qtr,q1,t1,u1,v1, & + & prslp,psp,phil,qtr,q1,t1,u1,v1,fscav, & & do_ca,ca_deep,cldwrk,rn,kbot,ktop,kcnv,islimsk,garea, & & dot,ncloud,ud_mf,dd_mf,dt_mf,cnvw,cnvc, & & QLCN, QICN, w_upi, cf_upi, CNV_MFD, & @@ -82,13 +84,14 @@ subroutine samfdeepcnv_run (im,ix,km,cliq,cp,cvap, & implicit none ! - integer, intent(in) :: im, ix, km, ntk, ntr, ncloud + integer, intent(in) :: im, ix, km, itc, ntc, ntk, ntr, ncloud integer, intent(in) :: islimsk(im) real(kind=kind_phys), intent(in) :: cliq, cp, cvap, eps, epsm1, & & fv, grav, hvap, rd, rv, t0c real(kind=kind_phys), intent(in) :: delt real(kind=kind_phys), intent(in) :: psp(im), delp(ix,km), & & prslp(ix,km), garea(im), dot(ix,km), phil(ix,km) + real(kind=kind_phys), dimension(:), intent(in) :: fscav real(kind=kind_phys), intent(in) :: ca_deep(ix) logical, intent(in) :: do_ca @@ -224,6 +227,8 @@ subroutine samfdeepcnv_run (im,ix,km,cliq,cp,cvap, & real(kind=kind_phys) pfld(im,km), to(im,km), qo(im,km), & uo(im,km), vo(im,km), qeso(im,km), & ctr(im,km,ntr), ctro(im,km,ntr) +! for aerosol transport + real(kind=kind_phys) qaero(im,km,ntc) ! for updraft velocity calculation real(kind=kind_phys) wu2(im,km), buo(im,km), drag(im,km) real(kind=kind_phys) wc(im), scaldfunc(im), sigmagfm(im) @@ -246,7 +251,7 @@ subroutine samfdeepcnv_run (im,ix,km,cliq,cp,cvap, & & tx1(im), sumx(im), cnvwt(im,km) ! &, rhbar(im) ! - logical totflg, cnvflg(im), asqecflg(im), flg(im) + logical do_aerosols, totflg, cnvflg(im), asqecflg(im), flg(im) ! ! asqecflg: flag for the quasi-equilibrium assumption of Arakawa-Schubert ! @@ -273,6 +278,11 @@ subroutine samfdeepcnv_run (im,ix,km,cliq,cp,cvap, & fact2 = hvap/rv-fact1*t0c ! c----------------------------------------------------------------------- +!> ## Determine whether to perform aerosol transport + do_aerosols = (itc > 0) .and. (ntc > 0) .and. (ntr > 0) + if (do_aerosols) do_aerosols = (ntr >= itc + ntc - 3) +! +c----------------------------------------------------------------------- !> ## Compute preliminary quantities needed for static, dynamic, and feedback control portions of the algorithm. !> - Convert input pressure terms to centibar units. !************************************************************************ @@ -2393,6 +2403,23 @@ subroutine samfdeepcnv_run (im,ix,km,cliq,cp,cvap, & xmb(i) = min(xmb(i),xmbmax(i)) endif enddo + +!> - If stochastic physics using cellular automata is .true. then perturb the mass-flux here: + + if(do_ca)then + do i=1,im + xmb(i) = xmb(i)*(1.0 + ca_deep(i)*5.) + enddo + endif + +!> - Transport aerosols if present + + if (do_aerosols) + & call samfdeepcnv_aerosols(im, ix, km, itc, ntc, ntr, delt, + & xlamde, xlamdd, cnvflg, jmin, kb, kmax, kbcon, ktcon, fscav, + & edto, xlamd, xmb, c0t, eta, etad, zi, xlamue, xlamud, delp, + & qtr, qaero) + c c restore to,qo,uo,vo to t1,q1,u1,v1 in case convection stops c @@ -2675,6 +2702,20 @@ subroutine samfdeepcnv_run (im,ix,km,cliq,cp,cvap, & enddo enddo enddo + +!> - Store aerosol concentrations if present + if (do_aerosols) then + do n = 1, ntc + kk = n + itc - 1 + do k = 1, km + do i = 1, im + if(cnvflg(i) .and. rn(i) > 0.) then + if (k <= kmax(i)) qtr(i,k,kk) = qaero(i,k,n) + endif + enddo + enddo + enddo + endif ! ! hchuang code change ! diff --git a/physics/samfdeepcnv.meta b/physics/samfdeepcnv.meta index 7db1880a7..3b54998fc 100644 --- a/physics/samfdeepcnv.meta +++ b/physics/samfdeepcnv.meta @@ -35,6 +35,22 @@ type = integer intent = in optional = F +[itc] + standard_name = number_of_aerosol_tracers_for_convection + long_name = number of aerosol tracers transported/scavenged by convection + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntc] + standard_name = number_of_chemical_tracers + long_name = number of chemical tracers + units = count + dimensions = () + type = integer + intent = in + optional = F [cliq] standard_name = specific_heat_of_liquid_water_at_constant_pressure long_name = specific heat of liquid water at constant pressure @@ -240,6 +256,15 @@ kind = kind_phys intent = inout optional = F +[fscav] + standard_name = coefficients_for_aerosol_scavenging + long_name = array of aerosol scavenging coefficients + units = none + dimensions = (number_of_chemical_tracers) + type = real + kind = kind_phys + intent = in + optional = F [do_ca] standard_name = flag_for_cellular_automata long_name = cellular automata main switch diff --git a/physics/samfshalcnv.f b/physics/samfshalcnv.f index 27629d7d7..51b64adfe 100644 --- a/physics/samfshalcnv.f +++ b/physics/samfshalcnv.f @@ -5,6 +5,8 @@ !! shallow convection scheme. module samfshalcnv + use samfcnv_aerosols, only : samfshalcnv_aerosols + contains !> \brief Brief description of the subroutine @@ -47,10 +49,10 @@ end subroutine samfshalcnv_finalize !! -# For the "feedback control", calculate updated values of the state variables by multiplying the cloud base mass flux and the tendencies calculated per unit cloud base mass flux from the static control. !! \section det_samfshalcnv GFS samfshalcnv Detailed Algorithm !! @{ - subroutine samfshalcnv_run(im,ix,km,cliq,cp,cvap, & + subroutine samfshalcnv_run(im,ix,km,itc,ntc,cliq,cp,cvap, & & eps,epsm1,fv,grav,hvap,rd,rv, & & t0c,delt,ntk,ntr,delp, & - & prslp,psp,phil,qtr,q1,t1,u1,v1, & + & prslp,psp,phil,qtr,q1,t1,u1,v1,fscav, & & rn,kbot,ktop,kcnv,islimsk,garea, & & dot,ncloud,hpbl,ud_mf,dt_mf,cnvw,cnvc, & & clam,c0s,c1,pgcon,asolfac,errmsg,errflg) @@ -60,7 +62,7 @@ subroutine samfshalcnv_run(im,ix,km,cliq,cp,cvap, & implicit none ! - integer, intent(in) :: im, ix, km, ntk, ntr, ncloud + integer, intent(in) :: im, ix, km, itc, ntc, ntk, ntr, ncloud integer, intent(in) :: islimsk(im) real(kind=kind_phys), intent(in) :: cliq, cp, cvap, & & eps, epsm1, fv, grav, hvap, rd, rv, t0c @@ -68,6 +70,7 @@ subroutine samfshalcnv_run(im,ix,km,cliq,cp,cvap, & real(kind=kind_phys), intent(in) :: psp(im), delp(ix,km), & & prslp(ix,km), garea(im), hpbl(im), dot(ix,km), phil(ix,km) ! + real(kind=kind_phys), dimension(:), intent(in) :: fscav integer, intent(inout) :: kcnv(im) ! DH* TODO - check dimensions of qtr, ntr+2 correct? *DH real(kind=kind_phys), intent(inout) :: qtr(ix,km,ntr+2), & @@ -175,6 +178,8 @@ subroutine samfshalcnv_run(im,ix,km,cliq,cp,cvap, & real(kind=kind_phys) pfld(im,km), to(im,km), qo(im,km), & uo(im,km), vo(im,km), qeso(im,km), & ctr(im,km,ntr), ctro(im,km,ntr) +! for aerosol transport + real(kind=kind_phys) qaero(im,km,ntc) ! for updraft velocity calculation real(kind=kind_phys) wu2(im,km), buo(im,km), drag(im,km) real(kind=kind_phys) wc(im), scaldfunc(im), sigmagfm(im) @@ -193,7 +198,7 @@ subroutine samfshalcnv_run(im,ix,km,cliq,cp,cvap, & & zi(im,km), pwo(im,km), c0t(im,km), & sumx(im), tx1(im), cnvwt(im,km) ! - logical totflg, cnvflg(im), flg(im) + logical do_aerosols, totflg, cnvflg(im), flg(im) ! real(kind=kind_phys) tf, tcr, tcrf parameter (tf=233.16, tcr=263.16, tcrf=1.0/(tcr-tf)) @@ -210,6 +215,11 @@ subroutine samfshalcnv_run(im,ix,km,cliq,cp,cvap, & fact1 = (cvap-cliq)/rv fact2 = hvap/rv-fact1*t0c +c----------------------------------------------------------------------- +!> ## Determine whether to perform aerosol transport + do_aerosols = (itc > 0) .and. (ntc > 0) .and. (ntr > 0) + if (do_aerosols) do_aerosols = (ntr >= itc + ntc - 3) +! !************************************************************************ ! convert input Pa terms to Cb terms -- Moorthi !> ## Compute preliminary quantities needed for the static and feedback control portions of the algorithm. @@ -1490,6 +1500,17 @@ subroutine samfshalcnv_run(im,ix,km,cliq,cp,cvap, & xmb(i) = min(xmb(i),xmbmax(i)) endif enddo +! +!> - Transport aerosols if present +! + if (do_aerosols) + & call samfshalcnv_aerosols(im, ix, km, itc, ntc, ntr, delt, +! & xlamde, xlamdd, cnvflg, jmin, kb, kmax, kbcon, ktcon, fscav, + & cnvflg, kb, kmax, kbcon, ktcon, fscav, +! & edto, xlamd, xmb, c0t, eta, etad, zi, xlamue, xlamud, delp, + & xmb, c0t, eta, zi, xlamue, xlamud, delp, + & qtr, qaero) +! !> ## For the "feedback control", calculate updated values of the state variables by multiplying the cloud base mass flux and the tendencies calculated per unit cloud base mass flux from the static control. !! - Recalculate saturation specific humidity. c @@ -1728,6 +1749,19 @@ subroutine samfshalcnv_run(im,ix,km,cliq,cp,cvap, & enddo ! endif +!> - Store aerosol concentrations if present + if (do_aerosols) then + do n = 1, ntc + kk = n + itc - 1 + do k = 1, km + do i = 1, im + if(cnvflg(i) .and. rn(i) > 0.) then + if (k <= kmax(i)) qtr(i,k,kk) = qaero(i,k,n) + endif + enddo + enddo + enddo + endif ! ! hchuang code change ! diff --git a/physics/samfshalcnv.meta b/physics/samfshalcnv.meta index e056644c3..2dd3be372 100644 --- a/physics/samfshalcnv.meta +++ b/physics/samfshalcnv.meta @@ -35,6 +35,22 @@ type = integer intent = in optional = F +[itc] + standard_name = number_of_aerosol_tracers_for_convection + long_name = number of aerosol tracers transported/scavenged by convection + units = count + dimensions = () + type = integer + intent = in + optional = F +[ntc] + standard_name = number_of_chemical_tracers + long_name = number of chemical tracers + units = count + dimensions = () + type = integer + intent = in + optional = F [cliq] standard_name = specific_heat_of_liquid_water_at_constant_pressure long_name = specific heat of liquid water at constant pressure @@ -240,6 +256,15 @@ kind = kind_phys intent = inout optional = F +[fscav] + standard_name = coefficients_for_aerosol_scavenging + long_name = array of aerosol scavenging coefficients + units = none + dimensions = (number_of_chemical_tracers) + type = real + kind = kind_phys + intent = in + optional = F [rn] standard_name = lwe_thickness_of_shallow_convective_precipitation_amount long_name = shallow convective rainfall amount on physics timestep From 7d11d9ce511701a17a5feda12a0adfd385d0d085 Mon Sep 17 00:00:00 2001 From: "ligia.bernardet" Date: Thu, 5 Sep 2019 10:18:57 -0600 Subject: [PATCH 89/89] Address review comment with changes in EXTENSION_MAPPING. No changes in derived HTML output. --- physics/docs/ccpp_doxyfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/physics/docs/ccpp_doxyfile b/physics/docs/ccpp_doxyfile index 351dc022f..91c80c221 100644 --- a/physics/docs/ccpp_doxyfile +++ b/physics/docs/ccpp_doxyfile @@ -29,7 +29,8 @@ OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_FOR_FORTRAN = YES OPTIMIZE_OUTPUT_VHDL = NO -EXTENSION_MAPPING = .f=FortranFree \ +EXTENSION_MAPPING = .f=Fortranfixed \ + .F=Fortranfixed \ .F90=FortranFree \ .f90=FortranFree MARKDOWN_SUPPORT = YES