SCALE-RM
Data Types | Functions/Subroutines
scale_atmos_phy_cp_kf Module Reference

module atmosphere / physics / cumulus / Kain-Fritsch More...

Functions/Subroutines

subroutine, public atmos_phy_cp_kf_setup (KA, KS, KE, IA, IS, IE, JA, JS, JE, CZ, AREA, TIME_DTSEC, KF_DTSEC, WARMRAIN_in)
 Setup initial setup for Kain-Fritsch Cumulus Parameterization. More...
 
subroutine, public atmos_phy_cp_kf_tendency (KA, KS, KE, IA, IS, IE, JA, JS, JE, DENS, U, V, RHOT, TEMP, PRES, QDRY, QV_in, Rtot, CPtot, w0avg, FZ, KF_DTSEC, DENS_t_CP, RHOT_t_CP, RHOQV_t_CP, RHOQ_t_CP, SFLX_convrain, cloudtop, cloudbase, cldfrac_dp, cldfrac_sh, nca)
 ATMOS_PHY_CP_kf calculate Kain-Fritsch Cumulus Parameterization. More...
 

Detailed Description

module atmosphere / physics / cumulus / Kain-Fritsch

Description
Main module of Kain-Fritsch Cumulus Convection Parameterization
Author
Team SCALE
References
  • Kain J. S. and J. M. Fritsch, 1990: A one-dimensional entraining/detraining plume model and its application in convective parameterization. J. Atmos. Sci. 47:2784–2802.
  • Kain J. S., 2004: The Kain–Fritsch Convective Parameterization: An Update, J. Appl. Meteor., 43, 170-181.
  • Narita, M. and S. Ohmori, 2007: Improving Precipitation Forecasts by the Operational Nonhydrostatic Mesoscale Model with the Kain-Fritsch Convective Parameterization and Cloud Microphysics. 12th Conference on Mesoscale Processes, 6-9 August 2007, Waterville Valley conference & event center, Waterville Valley, NH, USA.
  • Ogura, Y., and H. R. Cho, 1973: Diagnostic determination of cumulus cloud populations from observed large-scale variables. J. Atmos. Sci., 30, 1276-1286.
This file was originally copied from WRF. The original file was published with the following notice.

WRF was developed at the National Center for Atmospheric Research (NCAR) which is operated by the University Corporation for Atmospheric Research (UCAR). NCAR and UCAR make no proprietary claims, either statutory or otherwise, to this version and release of WRF and consider WRF to be in the public domain for use by any person or entity for any purpose without any fee or charge. UCAR requests that any WRF user include this notice on any partial or full copies of WRF. WRF is provided on an "AS IS" basis and any warranties, either express or implied, including but not limited to implied warranties of non-infringement, originality, merchantability and fitness for a particular purpose, are disclaimed. In no event shall UCAR be liable for any damages, whatsoever, whether direct, indirect, consequential or special, that arise out of or in connection with the access, use or performance of WRF, including infringement actions.

WRF® is a registered trademark of the University Corporation for Atmospheric Research (UCAR).

NAMELIST
  • PARAM_ATMOS_PHY_CP_KF
    nametypedefault valuecomment
    PARAM_ATMOS_PHY_CP_KF_RATE real(RP) 0.03_RP ratio of cloud water and precipitation (Ogura and Cho 1973)
    PARAM_ATMOS_PHY_CP_KF_TRIGGER integer 1 trigger function type 1:KF2004 3:NO2007
    PARAM_ATMOS_PHY_CP_KF_DLCAPE real(RP) 0.1_RP cape decleace rate
    PARAM_ATMOS_PHY_CP_KF_DLIFETIME real(RP) 1800.0_RP minimum lifetime scale of deep convection [sec]
    PARAM_ATMOS_PHY_CP_KF_SLIFETIME real(RP) 2400.0_RP lifetime of shallow convection [sec]
    PARAM_ATMOS_PHY_CP_KF_DEPTH_USL real(RP) 300.0_RP depth of updraft source layer [hPa]
    PARAM_ATMOS_PHY_CP_KF_PREC integer 1 precipitation type 1:Ogura-Cho(1973) 2:Kessler
    PARAM_ATMOS_PHY_CP_KF_THRES real(RP) 1.E-3_RP autoconversion rate for Kessler
    PARAM_ATMOS_PHY_CP_KF_LOG logical .false. output log?

History Output
namedescriptionunitvariable
KF_CONVFLAG CONVECTION FLAG R_convflag
KF_LIFETIME lifetime of KF scheme s lifetime

Function/Subroutine Documentation

◆ atmos_phy_cp_kf_setup()

subroutine, public scale_atmos_phy_cp_kf::atmos_phy_cp_kf_setup ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
integer, intent(in)  IA,
integer, intent(in)  IS,
integer, intent(in)  IE,
integer, intent(in)  JA,
integer, intent(in)  JS,
integer, intent(in)  JE,
real(rp), dimension(ka,ia,ja), intent(in)  CZ,
real(rp), dimension(ia,ja), intent(in)  AREA,
real(dp), intent(in)  TIME_DTSEC,
real(dp), intent(in)  KF_DTSEC,
logical, intent(in)  WARMRAIN_in 
)

Setup initial setup for Kain-Fritsch Cumulus Parameterization.

Parameters
[in]warmrain_intunning parameters, original parameter set is from KF2004 and NO2007

Definition at line 158 of file scale_atmos_phy_cp_kf.F90.

References scale_io::io_fid_conf, and scale_prc::prc_abort().

Referenced by mod_atmos_phy_cp_driver::atmos_phy_cp_driver_setup().

158  use scale_prc, only: &
159  prc_abort
160  implicit none
161  integer, intent(in) :: ka, ks, ke
162  integer, intent(in) :: ia, is, ie
163  integer, intent(in) :: ja, js, je
164 
165  real(RP), intent(in) :: cz(ka,ia,ja)
166  real(RP), intent(in) :: area(ia,ja)
167  real(DP), intent(in) :: time_dtsec
168  real(DP), intent(in) :: kf_dtsec
169  logical, intent(in) :: warmrain_in
170 
171 
172  integer :: param_atmos_phy_cp_kf_trigger = 1
173  integer :: param_atmos_phy_cp_kf_prec = 1
174  real(RP) :: param_atmos_phy_cp_kf_rate = 0.03_rp
175  real(RP) :: param_atmos_phy_cp_kf_dlcape = 0.1_rp
176  real(RP) :: param_atmos_phy_cp_kf_dlifetime = 1800.0_rp
177  real(RP) :: param_atmos_phy_cp_kf_slifetime = 2400.0_rp
178  real(RP) :: param_atmos_phy_cp_kf_depth_usl = 300.0_rp
179  real(RP) :: param_atmos_phy_cp_kf_thres = 1.e-3_rp
180  logical :: param_atmos_phy_cp_kf_log = .false.
181 
182  namelist / param_atmos_phy_cp_kf / &
183  param_atmos_phy_cp_kf_rate, &
184  param_atmos_phy_cp_kf_trigger, &
185  param_atmos_phy_cp_kf_dlcape, &
186  param_atmos_phy_cp_kf_dlifetime, &
187  param_atmos_phy_cp_kf_slifetime, &
188  param_atmos_phy_cp_kf_depth_usl, &
189  param_atmos_phy_cp_kf_prec, &
190  param_atmos_phy_cp_kf_thres, &
191  param_atmos_phy_cp_kf_log
192 
193  integer :: k, i, j
194  integer :: ierr
195  !---------------------------------------------------------------------------
196 
197  log_newline
198  log_info("ATMOS_PHY_CP_kf_setup",*) 'Setup'
199  log_info("ATMOS_PHY_CP_kf_setup",*) 'Kain-Fritsch scheme'
200 
201  warmrain = warmrain_in
202 
203  !--- read namelist
204  rewind(io_fid_conf)
205  read(io_fid_conf,nml=param_atmos_phy_cp_kf,iostat=ierr)
206  if( ierr < 0 ) then !--- missing
207  log_info("ATMOS_PHY_CP_kf_setup",*) 'Not found namelist. Default used.'
208  elseif( ierr > 0 ) then !--- fatal error
209  log_error("ATMOS_PHY_CP_kf_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_PHY_CP_KF. Check!'
210  call prc_abort
211  endif
212  log_nml(param_atmos_phy_cp_kf)
213 
214  call cp_kf_lutab ! set up of KF look-up table
215 
216  call cp_kf_param( param_atmos_phy_cp_kf_prec, & ! [IN]
217  param_atmos_phy_cp_kf_rate, & ! [IN]
218  param_atmos_phy_cp_kf_dlcape, & ! [IN]
219  param_atmos_phy_cp_kf_dlifetime, & ! [IN]
220  param_atmos_phy_cp_kf_slifetime, & ! [IN]
221  param_atmos_phy_cp_kf_depth_usl, & ! [IN]
222  param_atmos_phy_cp_kf_thres, & ! [IN]
223  param_atmos_phy_cp_kf_log, & ! [IN]
224  param_atmos_phy_cp_kf_trigger ) ! [INOUT]
225 
226  ! output parameter lists
227  log_newline
228  log_info("ATMOS_PHY_CP_kf_setup",*) "Ogura-Cho condense material convert rate : ", param_atmos_phy_cp_kf_rate
229  log_info("ATMOS_PHY_CP_kf_setup",*) "Trigger function type, 1:KF2004 3:NO2007 : ", param_atmos_phy_cp_kf_trigger
230  log_info("ATMOS_PHY_CP_kf_setup",*) "CAPE decrease rate : ", param_atmos_phy_cp_kf_dlcape
231  log_info("ATMOS_PHY_CP_kf_setup",*) "Minimum lifetime scale of deep convection [sec] : ", param_atmos_phy_cp_kf_dlifetime
232  log_info("ATMOS_PHY_CP_kf_setup",*) "Lifetime of shallow convection [sec] : ", param_atmos_phy_cp_kf_slifetime
233  log_info("ATMOS_PHY_CP_kf_setup",*) "Updraft souce layer depth [hPa] : ", param_atmos_phy_cp_kf_depth_usl
234  log_info("ATMOS_PHY_CP_kf_setup",*) "Precipitation type 1:Ogura-Cho(1973) 2:Kessler : ", param_atmos_phy_cp_kf_prec
235  log_info("ATMOS_PHY_CP_kf_setup",*) "Kessler type precipitation's threshold : ", param_atmos_phy_cp_kf_thres
236  log_info("ATMOS_PHY_CP_kf_setup",*) "Warm rain? : ", warmrain
237  log_info("ATMOS_PHY_CP_kf_setup",*) "Output log? : ", param_atmos_phy_cp_kf_log
238 
239  ! output variables
240  allocate( lifetime(ia,ja) )
241  allocate( i_convflag(ia,ja) )
242  lifetime(:,:) = 0.0_rp
243  i_convflag(:,:) = 2
244 
245  allocate( z(ka,ia,ja) )
246  z(:,:,:) = cz(:,:,:) ! because scale_atmos_phy_cp interface ,not use scale_grid
247 
248  allocate( deltaz(ka,ia,ja) )
249  ! deltaz is the interval of between model full levels(scalar point )
250  deltaz(:,:,:) = 0.0_rp
251  do j = js, je
252  do i = is, ie
253  do k = ks, ke
254  deltaz(k,i,j) = cz(k+1,i,j) - cz(k,i,j)
255  enddo
256  enddo
257  enddo
258  deltaz(ke,:,:) = 0.0_rp
259 
260  allocate( deltax(ia,ja) )
261  do j = js, je
262  do i = is, ie
263  deltax(i,j) = sqrt( area(i,j) )
264  end do
265  end do
266 
267  return
integer, public ia
of whole cells: x, local, with HALO
integer, public ja
of whole cells: y, local, with HALO
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:55
integer, public is
start point of inner domain: x, local
integer, public ie
end point of inner domain: x, local
integer, public ke
end point of inner domain: z, local
module PROCESS
Definition: scale_prc.F90:11
integer, public je
end point of inner domain: y, local
integer, public ks
start point of inner domain: z, local
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
integer, public js
start point of inner domain: y, local
integer, public ka
of whole cells: z, local, with HALO
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_cp_kf_tendency()

subroutine, public scale_atmos_phy_cp_kf::atmos_phy_cp_kf_tendency ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
integer, intent(in)  IA,
integer, intent(in)  IS,
integer, intent(in)  IE,
integer, intent(in)  JA,
integer, intent(in)  JS,
integer, intent(in)  JE,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja), intent(in)  U,
real(rp), dimension (ka,ia,ja), intent(in)  V,
real(rp), dimension (ka,ia,ja), intent(in)  RHOT,
real(rp), dimension (ka,ia,ja), intent(in)  TEMP,
real(rp), dimension (ka,ia,ja), intent(in)  PRES,
real(rp), dimension (ka,ia,ja), intent(in)  QDRY,
real(rp), dimension(ka,ia,ja), intent(in)  QV_in,
real(rp), dimension (ka,ia,ja), intent(in)  Rtot,
real(rp), dimension(ka,ia,ja), intent(in)  CPtot,
real(rp), dimension(ka,ia,ja), intent(in)  w0avg,
real(rp), dimension (0:ka,ia,ja), intent(in)  FZ,
real(dp), intent(in)  KF_DTSEC,
real(rp), dimension (ka,ia,ja), intent(inout)  DENS_t_CP,
real(rp), dimension (ka,ia,ja), intent(inout)  RHOT_t_CP,
real(rp), dimension (ka,ia,ja), intent(inout)  RHOQV_t_CP,
real(rp), dimension (ka,ia,ja,n_hyd), intent(inout)  RHOQ_t_CP,
real(rp), dimension(ia,ja), intent(out)  SFLX_convrain,
real(rp), dimension (ia,ja), intent(out)  cloudtop,
real(rp), dimension (ia,ja), intent(out)  cloudbase,
real(rp), dimension (ka,ia,ja), intent(out)  cldfrac_dp,
real(rp), dimension (ka,ia,ja), intent(out)  cldfrac_sh,
real(rp), dimension (ia,ja), intent(out)  nca 
)

ATMOS_PHY_CP_kf calculate Kain-Fritsch Cumulus Parameterization.

Parameters
[in]densDensity [kg/m3]
[in]uvelocity u [m/s]
[in]vvelocity v [m/s]
[in]rhotDENS * POTT [K*kg/m3]
[in]temptemperature [K]
[in]prespressure of dry air [Pa]
[in]qdrydry air [1]
[in]qv_inspecific humidity [kg/kg]
[in]rtotgass constant
[in]cptotspecific heat
[in]w0avgrunning mean of vertical velocity [m/s]
[in,out]dens_t_cptendency DENS [kg/m3/s]
[in,out]rhot_t_cptendency RHOT [K*kg/m3/s]
[in,out]rhoqv_t_cptendency rho*QV [kg/kg/s]
[in,out]rhoq_t_cptendency rho*QTRC [kg/kg/s]
[out]sflx_convrainconvective rain rate [kg/m2/s]
[out]cloudtopcloud top height [m]
[out]cloudbasecloud base height [m]
[out]cldfrac_dpcloud fraction (deep convection)
[out]cldfrac_shcloud fraction (shallow convection)
[out]ncaconvection active time [sec]

Definition at line 351 of file scale_atmos_phy_cp_kf.F90.

References scale_const::const_cpdry, scale_const::const_emelt, scale_const::const_grav, scale_const::const_pre00, scale_const::const_rdry, scale_const::const_rvap, scale_const::const_tem00, scale_atmos_hydrometeor::cp_ice, scale_atmos_hydrometeor::cp_vapor, scale_atmos_hydrometeor::cp_water, scale_atmos_hydrometeor::i_hc, scale_atmos_hydrometeor::i_hi, scale_atmos_hydrometeor::i_hr, scale_atmos_hydrometeor::i_hs, scale_atmos_hydrometeor::n_hyd, scale_prc::prc_abort(), scale_prof::prof_rapend(), scale_prof::prof_rapstart(), and scale_time::time_dtsec_atmos_phy_cp.

Referenced by mod_atmos_phy_cp_driver::atmos_phy_cp_driver_calc_tendency().

351  use scale_file_history, only: &
352  file_history_in
353  use scale_const, only: &
354  grav => const_grav, &
355  r => const_rdry, &
356  rvap => const_rvap, &
357  pre00 => const_pre00
358  use scale_atmos_hydrometeor, only: &
359  cp_vapor, &
360  cp_water, &
361  cp_ice, &
362  n_hyd, &
363  i_hc, &
364  i_hr, &
365  i_hi, &
366  i_hs
367  use scale_atmos_saturation ,only :&
368  saturation_psat_liq => atmos_saturation_psat_liq
369  implicit none
370  integer, intent(in) :: ka, ks, ke
371  integer, intent(in) :: ia, is, ie
372  integer, intent(in) :: ja, js, je
373 
374  real(RP), intent(in) :: dens (ka,ia,ja)
375  real(RP), intent(in) :: u (ka,ia,ja)
376  real(RP), intent(in) :: v (ka,ia,ja)
377  real(RP), intent(in) :: rhot (ka,ia,ja)
378  real(RP), intent(in) :: temp (ka,ia,ja)
379  real(RP), intent(in) :: pres (ka,ia,ja)
380  real(RP), intent(in) :: qdry (ka,ia,ja)
381  real(RP), intent(in) :: qv_in(ka,ia,ja)
382  real(RP), intent(in) :: rtot (ka,ia,ja)
383  real(RP), intent(in) :: cptot(ka,ia,ja)
384  real(RP), intent(in) :: w0avg(ka,ia,ja)
385  real(RP), intent(in) :: fz (0:ka,ia,ja)
386  real(DP), intent(in) :: kf_dtsec
387 
388  real(RP), intent(inout) :: dens_t_cp (ka,ia,ja)
389  real(RP), intent(inout) :: rhot_t_cp (ka,ia,ja)
390  real(RP), intent(inout) :: rhoqv_t_cp (ka,ia,ja)
391  real(RP), intent(inout) :: rhoq_t_cp (ka,ia,ja,n_hyd)
392 
393  real(RP), intent(out) :: sflx_convrain(ia,ja)
394  real(RP), intent(out) :: cloudtop (ia,ja)
395  real(RP), intent(out) :: cloudbase (ia,ja)
396  real(RP), intent(out) :: cldfrac_dp (ka,ia,ja)
397  real(RP), intent(out) :: cldfrac_sh (ka,ia,ja)
398  real(RP), intent(out) :: nca (ia,ja)
399 
400  integer :: k, i, j, iq
401  integer :: nic
402  integer :: k_lcl
403  integer :: k_top
404  integer :: k_ml
405  integer :: k_lc,k_let,k_pbl
406  integer :: k_lfs
407 
408  real(RP) :: qv (ka)
409  real(RP) :: psat (ka)
410  real(RP) :: qsat (ka)
411  real(RP) :: rh (ka)
412  real(RP) :: deltap(ka)
413 
414  real(RP) :: cldfrac_kf(ka,2)
415  real(RP) :: dens_nw(ka)
416  real(RP) :: time_advec
417  real(RP) :: umf(ka)
418  real(RP) :: umflcl
419  real(RP) :: upent(ka)
420  real(RP) :: updet(ka)
421  ! updraft value
422  real(RP) :: temp_u(ka)
423  real(RP) :: tempv(ka)
424  real(RP) :: qv_u(ka)
425  real(RP) :: cape
426  ! water
427  real(RP) :: qc(ka)
428  real(RP) :: qi(ka)
429  real(RP) :: qvdet(ka)
430  real(RP) :: qcdet(ka)
431  real(RP) :: qidet(ka)
432  real(RP) :: totalprcp
433  real(RP) :: flux_qr(ka)
434  real(RP) :: flux_qs(ka)
435  ! upward theta
436  real(RP) :: theta_eu(ka)
437  real(RP) :: theta_ee(ka)
438  real(RP) :: zmix
439  real(RP) :: presmix
440  real(RP) :: umfnewdold(ka)
441  real(RP) :: dpthmx
442  real(RP) :: ems(ka)
443  real(RP) :: emsd(ka)
444  ! output from downdraft
445  real(RP) :: wspd(3)
446  real(RP) :: dmf(ka)
447  real(RP) :: downent(ka)
448  real(RP) :: downdet(ka)
449  real(RP) :: theta_d(ka)
450  real(RP) :: qv_d(ka)
451  real(RP) :: prcp_flux
452  real(RP) :: tder
453  real(RP) :: cpr
454  ! output from compensasional subsidence
455  real(RP) :: temp_g(ka)
456  real(RP) :: qv_nw(ka)
457  real(RP) :: qc_nw(ka)
458  real(RP) :: qi_nw(ka)
459  real(RP) :: qr_nw(ka)
460  real(RP) :: qs_nw(ka)
461 
462  real(RP) :: dqv, dqc, dqi, dqr, dqs
463 
464  real(RP) :: rtot_nw(ka)
465  real(RP) :: cptot_nw(ka)
466 
467  ! update variables
468  real(RP) :: pott_nw(ka)
469  real(RP) :: rhod(ka)
470 
471  real(RP) :: r_convflag(ia,ja)
472  ! ------
473 
474  log_progress(*) 'atmosphere / physics / cumulus / KF'
475  log_info("ATMOS_PHY_CP_kf_tendency",*) 'KF Convection Check '
476 
477  call prof_rapstart('CP_kf', 3)
478 
479  i_convflag(:,:) = 2
480 
481  do j = js, je
482  do i = is, ie
483 
484  nca(i,j) = nca(i,j) - kf_dtsec
485 
486  ! check convection
487  if ( nca(i,j) .ge. 0.5_dp * kf_dtsec ) cycle
488 
489  do k = ks, ke
490  ! preparing a NON Hydriometeor condition to fit assumption in KF scheme
491  rhod(k) = dens(k,i,j) * qdry(k,i,j)
492  enddo
493 
494  ! initialize variables
495  cloudtop(i,j) = 0.0_rp
496  cloudbase(i,j) = 0.0_rp
497  sflx_convrain(i,j) = 0.0_rp
498  lifetime(i,j) = 0.0_rp
499  cldfrac_kf(:,:) = 0.0_rp
500  tempv(:) = 0.0_rp
501  qc(:) = 0.0_rp
502  qi(:) = 0.0_rp
503  flux_qr(:) = 0.0_rp
504  flux_qs(:) = 0.0_rp
505  theta_eu(:) = 0.0_rp
506  theta_ee(:) = 0.0_rp
507  theta_d(:) = 0.0_rp
508  umfnewdold(:) = 0.0_rp
509  wspd(:) = 0.0_rp
510  temp_g(:) = 0.0_rp
511  qv_nw(:) = 0.0_rp
512  qc_nw(:) = 0.0_rp
513  qi_nw(:) = 0.0_rp
514  qr_nw(:) = 0.0_rp
515  qs_nw(:) = 0.0_rp
516  pott_nw(:) = 0.0_rp
517  totalprcp = 0.0_rp
518  umflcl = 0.0_rp
519  cape = 0.0_rp
520  presmix = 0.0_rp
521  dpthmx = 0.0_rp
522  zmix = 0.0_rp
523  prcp_flux = 0.0_rp
524  cpr = 0.0_rp
525  tder = 0.0_rp
526  time_advec = 0.0_rp
527  k_lcl = 0
528  k_lc = 0
529  k_lfs = 0
530  k_pbl = 0
531  k_top = 0
532  k_let = 0
533  k_ml = 0
534  nic = 0
535 
536  do k = ks, ke
537  ! temporary: WRF TYPE equations are used to maintain consistency with kf_main
538  !call SATURATION_psat_liq( PSAT(k), TEMP(k,i,j) )
539  !QSAT(k) = 0.622_RP * PSAT(k) / ( PRES(k,i,j) - ( 1.0_RP-0.622_RP ) * PSAT(k) )
540  psat(k) = aliq*exp((bliq*temp(k,i,j)-cliq)/(temp(k,i,j)-dliq))
541  qsat(k) = 0.622_rp * psat(k) / ( pres(k,i,j) - psat(k) )
542 
543  ! calculate water vaper and relative humidity
544  !QV (k) = max( 0.000001_RP, min( QSAT(k), QV_in(k,i,j) ) ) ! conpare QSAT and QV, guess lower limit
545  qv(k) = max( kf_eps, min( qsat(k), qv_in(k,i,j) / qdry(k,i,j) ) ) ! conpare QSAT and QV, guess lower limit
546  rh(k) = qv(k) / qsat(k)
547  enddo
548 
549  ! calculate delta P by hydrostatic balance
550  ! deltap is the pressure interval between half levels(face levels) @ SCALE
551  do k = ks, ke
552  deltap(k) = rhod(k) * grav * ( fz(k,i,j) - fz(k-1,i,j) ) ! rho*g*dz
553  enddo
554 
555  cldfrac_kf(ks:ke,:) = 0.0_rp
556  sflx_convrain(i,j) = 0.0_rp
557  lifetime(i,j) = 0.0_rp
558  cloudtop(i,j) = 0.0_rp
559  cloudbase(i,j) = 0.0_rp
560 
561  call cp_kf_trigger ( &
562  ka, ks, ke, & ! [IN]
563  deltaz(:,i,j), z(:,i,j), & ! [IN]
564  qv(:), qsat(:), & ! [IN]
565  pres(:,i,j), & ! [IN]
566  deltap(:), deltax(i,j), & ! [IN]
567  temp(:,i,j), & ! [IN]
568  w0avg(:,i,j), & ! [IN]
569  i_convflag(i,j), & ! [INOUT]
570  cloudtop(i,j), & ! [INOUT]
571  temp_u(:), tempv(:), & ! [INOUT]
572  qv_u(:), qc(:), qi(:), & ! [INOUT]
573  qvdet(:), qcdet(:), qidet(:), & ! [INOUT]
574  flux_qr(:), flux_qs(:), & ! [INOUT]
575  totalprcp, & ! [INOUT]
576  theta_eu(:), theta_ee(:), & ! [INOUT]
577  cape, & ! [INOUT]
578  umf(:), umflcl, & ! [INOUT]
579  upent(:), updet(:), & ! [INOUT]
580  k_lcl, k_lc, k_pbl, & ! [INOUT]
581  k_top, k_let, k_ml, & ! [INOUT]
582  presmix, & ! [INOUT]
583  dpthmx, & ! [INOUT]
584  cloudbase(i,j), zmix, & ! [INOUT]
585  umfnewdold(:) ) ! [INOUT]
586 
587  ! calc ems(box weight[kg])
588  if(i_convflag(i,j) /= 2) then
589  ems(k_top+1:ke) = 0._rp
590  emsd(k_top+1:ke) = 0._rp
591  do k = ks, k_top
592  ems(k) = deltap(k) * deltax(i,j)**2 / grav
593  emsd(k) = 1._rp/ems(k)
594  umfnewdold(k) = 1._rp/umfnewdold(k)
595  end do
596  end if
597 
598  call cp_kf_downdraft ( &
599  ka, ks, ke, & ! [IN]
600  i_convflag(i,j), & ! [IN]
601  k_lcl, k_ml, k_top, k_pbl, k_let, k_lc, & ! [IN]
602  deltaz(:,i,j), z(:,i,j), cloudbase(i,j), & ! [IN]
603  u(:,i,j), v(:,i,j), rh(:), qv(:), pres(:,i,j), & ! [IN]
604  deltap(:), deltax(i,j), & ! [IN]
605  ems(:), emsd(:), & ! [IN]
606  theta_ee(:), & ! [IN]
607  umf(:), & ! [IN]
608  totalprcp, flux_qs(:), tempv(:), & ! [IN]
609  wspd(:), dmf(:), downent(:), downdet(:), & ! [OUT]
610  theta_d(:), qv_d(:), prcp_flux, k_lfs, & ! [OUT]
611  cpr, & ! [OUT]
612  tder ) ! [OUT]
613 
614  call cp_kf_compensational ( &
615  ka, ks, ke, & ! [IN]
616  k_top, k_lc, k_pbl, k_ml, k_lfs, & ! [IN]
617  deltaz(:,i,j), z(:,i,j), pres(:,i,j), deltap(:), deltax(i,j), & ! [IN]
618  temp(:,i,j), qv(:), ems(:), emsd(:), & ! [IN]
619  presmix, zmix, dpthmx, & ! [IN]
620  cape, & ! [IN]
621  temp_u(:), qvdet(:), umflcl, & ! [IN]
622  qc(:), qi(:), flux_qr(:), flux_qs(:), & ! [IN]
623  umfnewdold(:), & ! [IN]
624  wspd(:), & ! [IN]
625  qv_d(:), theta_d(:), & ! [IN]
626  cpr, & ! [IN]
627  i_convflag(i,j), k_lcl, & ! [INOUT]
628  umf(:), upent(:), updet(:), & ! [INOUT]
629  qcdet(:), qidet(:), dmf(:), downent(:), downdet(:), & ! [INOUT]
630  prcp_flux, tder, & ! [INOUT]
631  nic, & ! [OUT]
632  temp_g(:), qv_nw(:), qc_nw(:), qi_nw(:), qr_nw(:), qs_nw(:), & ! [OUT]
633  sflx_convrain(i,j), cldfrac_kf, & ! [OUT]
634  lifetime(i,j), time_advec ) ! [OUT]
635 
636  ! compute tendencys
637  !------------------------------------------------------------------------
638  do k = ks, ke
639  rtot_nw(k) = rtot(k,i,j) * dens(k,i,j)
640  cptot_nw(k) = cptot(k,i,j) * dens(k,i,j)
641  end do
642 
643  if(i_convflag(i,j) == 2) then ! no convection
644  sflx_convrain(i,j) = 0.0_rp
645  cldfrac_kf(ks:ke,:) = 0.0_rp
646  lifetime(i,j) = 0.0_rp
647  cloudtop(i,j) = 0.0_rp
648  cloudbase(i,j) = 0.0_rp
649  nca(i,j) = -100.0_rp
650 
651  dens_t_cp(ks:ke,i,j) = 0.0_rp
652  rhot_t_cp(ks:ke,i,j) = 0.0_rp
653  rhoqv_t_cp(ks:ke,i,j) = 0.0_rp
654  do iq = 1, n_hyd
655  rhoq_t_cp(ks:ke,i,j,iq) = 0.0_rp
656  end do
657 
658  else ! convection allowed I_convflag=0 or 1
659  ! check:
660  ! FEEDBACK TO RESOLVABLE SCALE TENDENCIES.
661  ! IF THE ADVECTIVE TIME PERIOD (time_advec) IS LESS THAN SPECIFIED MINIMUM
662  ! lifetime, ALLOW FEEDBACK TO OCCUR ONLY DURING TADVEC.
663  !
664  if (i_convflag(i,j) == 0) then ! deep
665  if (time_advec < lifetime(i,j)) nic=nint(time_advec/kf_dtsec)
666  nca(i,j) = real(nic,rp)*kf_dtsec ! convection feed back act this time span
667  elseif (i_convflag(i,j) == 1) then ! shallow
668  lifetime(i,j) = shallowlifetime
669  nca(i,j) = kf_dtsec ! convection feed back act this time span
670  end if
671 
672  do k=ks, k_top
673  ! vapor
674  dqv = rhod(k) * ( qv_nw(k) - qv(k) )
675  rhoqv_t_cp(k,i,j) = dqv / lifetime(i,j)
676  rtot_nw(k) = rtot_nw(k) + dqv * rvap
677  cptot_nw(k) = cptot_nw(k) + dqv * cp_vapor
678  ! liquid water
679  dqc = qc_nw(k) * rhod(k)
680  dqr = qr_nw(k) * rhod(k)
681  rhoq_t_cp(k,i,j,i_hc) = dqc / lifetime(i,j)
682  rhoq_t_cp(k,i,j,i_hr) = dqr / lifetime(i,j)
683  cptot_nw(k) = cptot_nw(k) + ( dqc + dqr ) * cp_water
684  ! ice water
685  if ( .not. warmrain ) then
686  dqi = qi_nw(k) * rhod(k)
687  dqs = qs_nw(k) * rhod(k)
688  else
689  dqi = 0.0_rp
690  dqs = 0.0_rp
691  end if
692  rhoq_t_cp(k,i,j,i_hi) = dqi / lifetime(i,j)
693  rhoq_t_cp(k,i,j,i_hs) = dqs / lifetime(i,j)
694  cptot_nw(k) = cptot_nw(k) + ( dqi + dqs ) * cp_ice
695 
696  dens_t_cp(k,i,j) = rhoqv_t_cp(k,i,j) &
697  + rhoq_t_cp(k,i,j,i_hc) + rhoq_t_cp(k,i,j,i_hr) &
698  + rhoq_t_cp(k,i,j,i_hi) + rhoq_t_cp(k,i,j,i_hs)
699  dens_nw(k) = dens(k,i,j) + dqv + dqc + dqr + dqi + dqs
700  rtot_nw(k) = rtot_nw(k) / dens_nw(k)
701  cptot_nw(k) = cptot_nw(k) / dens_nw(k)
702  end do
703  do iq = i_hs+1, n_hyd
704  do k = ks, k_top
705  rhoq_t_cp(k,i,j,iq) = 0.0_rp
706  end do
707  end do
708 
709  ! calc new potential temperature
710  do k = ks, k_top
711  pott_nw(k) = temp_g(k) * ( pre00 / pres(k,i,j) )**( rtot_nw(k) / cptot_nw(k) )
712  end do
713  ! update rhot
714  do k = ks, k_top
715  rhot_t_cp(k,i,j) = ( dens_nw(k)*pott_nw(k) - rhot(k,i,j) ) / lifetime(i,j)
716  end do
717 
718  do k=k_top+1, ke
719  dens_t_cp(k,i,j) = 0.0_rp
720  rhot_t_cp(k,i,j) = 0.0_rp
721  rhoqv_t_cp(k,i,j) = 0.0_rp
722  do iq = 1, n_hyd
723  rhoq_t_cp(k,i,j,iq) = 0.0_rp
724  end do
725  end do
726 
727  ! to keep conservation
728  ! if noconvection then nca is same value before call. nca only modifyed convectioned
729  end if
730 
731  cldfrac_sh(ks:ke,i,j) = cldfrac_kf(ks:ke,1)
732  cldfrac_dp(ks:ke,i,j) = cldfrac_kf(ks:ke,2)
733  end do
734  end do
735 
736  call prof_rapend('CP_kf', 3)
737 
738  call file_history_in( lifetime(:,:), 'KF_LIFETIME', 'lifetime of KF scheme', 's' )
739  r_convflag(:,:) = real(I_convflag(:,:),rp)
740  call file_history_in( r_convflag(:,:), 'KF_CONVFLAG', 'CONVECTION FLAG', '' )
741 
742  return
module atmosphere / saturation
real(rp), public cp_ice
CP for ice [J/kg/K].
integer, public ia
of whole cells: x, local, with HALO
integer, parameter, public i_hs
snow
integer, parameter, public i_hr
liquid water rain
integer, parameter, public i_hi
ice water cloud
integer, public ja
of whole cells: y, local, with HALO
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
Definition: scale_const.F90:55
integer, public is
start point of inner domain: x, local
integer, public ie
end point of inner domain: x, local
module atmosphere / hydrometeor
integer, public ke
end point of inner domain: z, local
real(rp), public const_pre00
pressure reference [Pa]
Definition: scale_const.F90:88
integer, public je
end point of inner domain: y, local
real(rp), public const_grav
standard acceleration of gravity [m/s2]
Definition: scale_const.F90:46
integer, public ks
start point of inner domain: z, local
real(rp), parameter, public const_rvap
specific gas constant (water vapor) [J/kg/K]
Definition: scale_const.F90:63
module CONSTANT
Definition: scale_const.F90:11
integer, parameter, public i_hc
liquid water cloud
integer, public js
start point of inner domain: y, local
integer, public ka
of whole cells: z, local, with HALO
integer, parameter, public n_hyd
real(rp), public cp_vapor
CP for vapor [J/kg/K].
integer, parameter, public rp
real(rp), public cp_water
CP for water [J/kg/K].
module file_history
Here is the call graph for this function:
Here is the caller graph for this function: