SCALE-RM
Functions/Subroutines
mod_atmos_phy_bl_driver Module Reference

module atmosphere / physics / PBL More...

Functions/Subroutines

subroutine, public atmos_phy_bl_driver_tracer_setup
 Config. More...
 
subroutine, public atmos_phy_bl_driver_setup
 Setup. More...
 
subroutine, public atmos_phy_bl_driver_calc_tendency (update_flag)
 calculate tendency More...
 

Detailed Description

module atmosphere / physics / PBL

Description
Planetary boundary layer turbulence
Author
Team SCALE
NAMELIST
  • No namelist group
History Output
namedescriptionunitvariable
Kh_BL eddy diffusion m2/s Kh
Nu_BL eddy viscosity m2/s Nu
RHOT_t_BL RHOT tendency (BL) K.kg/m3/s RHOT_t_BL
RHOU_t_BL MOMX tendency (BL) kg/m2/s2 RHOU_t_BL
RHOV_t_BL MOMY tendency (BL) kg/m2/s2 RHOV_t_BL
{TRACER_NAME}_t_BL RHO*{TRACER_NAME} tendency (BL);
{TRACER_NAME} depends on the physics schemes, e.g., QV, QC, QR.
kg/m3/s RHOQ_t_BL

Function/Subroutine Documentation

◆ atmos_phy_bl_driver_tracer_setup()

subroutine, public mod_atmos_phy_bl_driver::atmos_phy_bl_driver_tracer_setup ( )

Config.

Definition at line 50 of file mod_atmos_phy_bl_driver.F90.

References mod_atmos_admin::atmos_phy_bl_type, mod_atmos_admin::atmos_sw_phy_bl, scale_prc::prc_abort(), mod_atmos_phy_bl_vars::qe, mod_atmos_phy_bl_vars::qs, and scale_tracer::tracer_regist().

Referenced by mod_atmos_driver::atmos_driver_tracer_setup().

50  use scale_prc, only: &
51  prc_abort
52  use scale_tracer, only: &
54  use scale_atmos_phy_bl_mynn, only: &
55  atmos_phy_bl_mynn_tracer_setup, &
56  atmos_phy_bl_mynn_ntracer, &
57  atmos_phy_bl_mynn_name, &
58  atmos_phy_bl_mynn_desc, &
59  atmos_phy_bl_mynn_units
60  use mod_atmos_admin, only: &
63  use mod_atmos_phy_bl_vars, only: &
64  qs, qe
65  implicit none
66  !---------------------------------------------------------------------------
67 
68  log_newline
69  log_info("ATMOS_PHY_BL_driver_tracer_setup",*) 'Setup'
70 
71  if ( atmos_sw_phy_bl ) then
72  select case ( atmos_phy_bl_type )
73  case ( 'MYNN' )
74  call atmos_phy_bl_mynn_tracer_setup
75  call tracer_regist( &
76  qs, &
77  atmos_phy_bl_mynn_ntracer, &
78  atmos_phy_bl_mynn_name, &
79  atmos_phy_bl_mynn_desc, &
80  atmos_phy_bl_mynn_units )
81  qe = qs + atmos_phy_bl_mynn_ntracer - 1
82  case default
83  log_error("ATMOS_PHY_BL_driver_tracer_setup",*) 'ATMOS_PHY_BL_TYPE is invalid: ', trim(atmos_phy_bl_type)
84  call prc_abort
85  end select
86  end if
87 
88  return
module ATMOS admin
module TRACER
character(len=h_short), public atmos_phy_bl_type
module PROCESS
Definition: scale_prc.F90:11
module atmosphere / physics / PBL
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
logical, public atmos_sw_phy_bl
subroutine, public tracer_regist(QS, NQ, NAME, DESC, UNIT, CV, CP, R, ADVC, MASS)
Regist tracer.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_bl_driver_setup()

subroutine, public mod_atmos_phy_bl_driver::atmos_phy_bl_driver_setup ( )

Setup.

Definition at line 94 of file mod_atmos_phy_bl_driver.F90.

References scale_atmos_grid_cartesc::atmos_grid_cartesc_cdx, scale_atmos_grid_cartesc::atmos_grid_cartesc_cdy, scale_atmos_grid_cartesc::atmos_grid_cartesc_cdz, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_cz, mod_atmos_admin::atmos_phy_bl_type, mod_atmos_admin::atmos_sw_phy_bl, scale_atmos_grid_cartesc_index::ia, scale_atmos_grid_cartesc_index::ie, scale_atmos_grid_cartesc_index::is, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::je, scale_atmos_grid_cartesc_index::js, scale_atmos_grid_cartesc_index::ka, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by mod_atmos_driver::atmos_driver_setup().

94  use scale_atmos_grid_cartesc, only: &
95  cdz => atmos_grid_cartesc_cdz, &
96  cdx => atmos_grid_cartesc_cdx, &
100  use scale_atmos_phy_bl_mynn, only: &
101  atmos_phy_bl_mynn_setup
102  use mod_atmos_admin, only: &
105  implicit none
106  !---------------------------------------------------------------------------
107 
108  log_newline
109  log_info("ATMOS_PHY_BL_driver_setup",*) 'Setup'
110 
111  if ( atmos_sw_phy_bl ) then
112  select case ( atmos_phy_bl_type )
113  case ( 'MYNN' )
114  call atmos_phy_bl_mynn_setup( &
115  ka, ks, ke, ia, is, ie, ja, js, je, &
116  real_cz ) ! (in)
117  end select
118  else
119  log_info("ATMOS_PHY_BL_driver_setup",*) 'this component is never called.'
120  endif
121 
122  return
module ATMOS admin
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cdy
y-length of control volume [m]
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cdx
x-length of control volume [m]
character(len=h_short), public atmos_phy_bl_type
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cdz
z-length of control volume [m]
module atmosphere / grid / cartesC
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_cz
geopotential height [m] (zxy)
module Atmosphere GRID CartesC Real(real space)
logical, public atmos_sw_phy_bl
Here is the caller graph for this function:

◆ atmos_phy_bl_driver_calc_tendency()

subroutine, public mod_atmos_phy_bl_driver::atmos_phy_bl_driver_calc_tendency ( logical, intent(in)  update_flag)

calculate tendency

Definition at line 128 of file mod_atmos_phy_bl_driver.F90.

References scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_cz, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_fz, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_totvol, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_vol, mod_atmos_phy_bl_vars::atmos_phy_bl_rhoq_t, mod_atmos_phy_bl_vars::atmos_phy_bl_rhot_t, mod_atmos_phy_bl_vars::atmos_phy_bl_rhou_t, mod_atmos_phy_bl_vars::atmos_phy_bl_rhov_t, mod_atmos_admin::atmos_phy_bl_type, mod_atmos_phy_sf_vars::atmos_phy_sf_l_mo, mod_atmos_phy_sf_vars::atmos_phy_sf_sflx_mu, mod_atmos_phy_sf_vars::atmos_phy_sf_sflx_mv, mod_atmos_phy_sf_vars::atmos_phy_sf_sflx_qtrc, mod_atmos_phy_sf_vars::atmos_phy_sf_sflx_qv, mod_atmos_phy_sf_vars::atmos_phy_sf_sflx_sh, mod_atmos_admin::atmos_sw_phy_bl, mod_atmos_vars::dens, mod_atmos_vars::dens_av, mod_atmos_vars::exner, scale_atmos_grid_cartesc_index::ia, scale_atmos_grid_cartesc_index::ie, scale_atmos_grid_cartesc_index::ieb, scale_atmos_grid_cartesc_index::is, scale_atmos_grid_cartesc_index::isb, scale_atmos_grid_cartesc_index::ja, scale_atmos_grid_cartesc_index::je, scale_atmos_grid_cartesc_index::jeb, scale_atmos_grid_cartesc_index::js, scale_atmos_grid_cartesc_index::jsb, scale_atmos_grid_cartesc_index::ka, scale_atmos_grid_cartesc_index::ke, scale_atmos_grid_cartesc_index::ks, mod_atmos_vars::pott, mod_atmos_vars::pres, scale_tracer::qa, mod_atmos_vars::qc, mod_atmos_vars::qdry, mod_atmos_phy_bl_vars::qe, mod_atmos_vars::qi, mod_atmos_phy_bl_vars::qs, mod_atmos_vars::qtrc, mod_atmos_vars::qtrc_av, mod_atmos_vars::qv, mod_atmos_vars::rhoq_tp, mod_atmos_vars::rhot_tp, mod_atmos_vars::rhou_tp, mod_atmos_vars::rhov_tp, scale_statistics::statistics_checktotal, scale_time::time_dtsec_atmos_phy_bl, scale_tracer::tracer_advc, scale_tracer::tracer_name, mod_atmos_vars::u, and mod_atmos_vars::v.

Referenced by mod_atmos_driver::atmos_driver_calc_tendency(), and mod_atmos_driver::atmos_driver_calc_tendency_from_sflux().

128  use scale_statistics, only: &
130  statistics_total
131  use scale_file_history, only: &
132  file_history_in
133  use scale_time, only: &
134  dt_bl => time_dtsec_atmos_phy_bl
135  use scale_atmos_phy_bl_mynn, only: &
136  atmos_phy_bl_mynn_tendency, &
137  atmos_phy_bl_mynn_tendency_tracer
138  use scale_atmos_grid_cartesc_real, only: &
143  use mod_atmos_admin, only: &
146  use mod_atmos_vars, only: &
147  dens => dens_av, &
148  qtrc => qtrc_av, &
149  u, &
150  v, &
151  pott, &
152  pres, &
153  exner, &
154  qdry, &
155  qv, &
156  qc, &
157  qi, &
158  rhou_t => rhou_tp, &
159  rhov_t => rhov_tp, &
160  rhot_t => rhot_tp, &
161  rhoq_t => rhoq_tp, &
162  atmos_vars_get_diagnostic
163  use mod_atmos_phy_bl_vars, only: &
164  qs, qe, &
165  rhou_t_bl => atmos_phy_bl_rhou_t, &
166  rhov_t_bl => atmos_phy_bl_rhov_t, &
167  rhot_t_bl => atmos_phy_bl_rhot_t, &
168  rhoq_t_bl => atmos_phy_bl_rhoq_t
169  use mod_atmos_phy_sf_vars, only: &
170  sflx_mu => atmos_phy_sf_sflx_mu, &
171  sflx_mv => atmos_phy_sf_sflx_mv, &
172  sflx_sh => atmos_phy_sf_sflx_sh, &
173  sflx_q => atmos_phy_sf_sflx_qtrc, &
174  sflx_qv => atmos_phy_sf_sflx_qv, &
175  l_mo => atmos_phy_sf_l_mo
176  implicit none
177 
178  logical, intent(in) :: update_flag
179 
180  real(RP) :: nu(ka,ia,ja)
181  real(RP) :: kh(ka,ia,ja)
182  real(RP) :: qw(ka,ia,ja)
183 
184  real(RP) :: n2 (ka,ia,ja)
185  real(RP) :: potl(ka,ia,ja)
186  real(RP) :: potv(ka,ia,ja)
187 
188  integer :: k, i, j, iq
189  !---------------------------------------------------------------------------
190 
191  if ( update_flag ) then
192 
193  rhoq_t_bl(:,:,:,:) = 0.0_rp
194 
195  select case ( atmos_phy_bl_type )
196  case ( 'MYNN' )
197  call atmos_vars_get_diagnostic( "N2", n2 )
198  call atmos_vars_get_diagnostic( "POTL", potl )
199  call atmos_vars_get_diagnostic( "POTV", potv )
200  do j = jsb, jeb
201  do i = isb, ieb
202  do k = ks, ke
203  qw(k,i,j) = qv(k,i,j) + qc(k,i,j) + qi(k,i,j)
204  end do
205  end do
206  end do
207  call atmos_phy_bl_mynn_tendency( &
208  ka, ks, ke, ia, is, ie, ja, js, je, &
209  dens(:,:,:), u(:,:,:), v(:,:,:), & ! (in)
210  pott(:,:,:), qtrc(:,:,:,qs:qe), & ! (in)
211  pres(:,:,:), exner(:,:,:), n2(:,:,:), & ! (in)
212  qdry(:,:,:), qv(:,:,:), qw(:,:,:), & ! (in)
213  potl(:,:,:), potv(:,:,:), & ! (in)
214  sflx_mu(:,:), sflx_mv(:,:), sflx_sh(:,:), sflx_qv(:,:), & ! (in)
215  l_mo(:,:), & ! (in)
216  cz(:,:,:), fz(:,:,:), dt_bl, & ! (in)
217  rhou_t_bl(:,:,:), rhov_t_bl(:,:,:), & ! (out)
218  rhot_t_bl(:,:,:), rhoq_t_bl(:,:,:,qs:qe), & ! (out)
219  nu(:,:,:), kh(:,:,:) ) ! (out)
220  do iq = 1, qa
221  if ( ( .not. tracer_advc(iq) ) .or. (iq>=qs .and. iq<=qe) ) cycle
222  call atmos_phy_bl_mynn_tendency_tracer( &
223  ka, ks, ke, ia, is, ie, ja, js, je, &
224  dens(:,:,:), qtrc(:,:,:,iq), & ! (in)
225  sflx_q(:,:,iq), kh(:,:,:), & ! (in)
226  cz(:,:,:), fz(:,:,:), & ! (in)
227  dt_bl, tracer_name(iq), & ! (in)
228  rhoq_t_bl(:,:,:,iq) ) ! (out)
229  end do
230  end select
231 
232  call file_history_in( nu(:,:,:), 'Nu_BL', 'eddy viscosity', 'm2/s', fill_halo=.true. )
233  call file_history_in( kh(:,:,:), 'Kh_BL', 'eddy diffusion', 'm2/s', fill_halo=.true. )
234 
235  call file_history_in( rhou_t_bl(:,:,:), 'RHOU_t_BL', 'MOMX tendency (BL)', 'kg/m2/s2', fill_halo=.true. )
236  call file_history_in( rhov_t_bl(:,:,:), 'RHOV_t_BL', 'MOMY tendency (BL)', 'kg/m2/s2', fill_halo=.true. )
237  call file_history_in( rhot_t_bl(:,:,:), 'RHOT_t_BL', 'RHOT tendency (BL)', 'K.kg/m3/s', fill_halo=.true. )
238 
239  do iq = 1, qa
240  if ( .not. tracer_advc(iq) ) cycle
241  call file_history_in( rhoq_t_bl(:,:,:,iq), trim(tracer_name(iq))//'_t_BL', &
242  'RHO*'//trim(tracer_name(iq))//' tendency (BL)', 'kg/m3/s', fill_halo=.true. )
243  enddo
244 
245  if ( statistics_checktotal ) then
246  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
247  rhou_t_bl(:,:,:), 'RHOU_t_BL', &
250  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
251  rhov_t_bl(:,:,:), 'RHOV_t_BL', &
254  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
255  rhot_t_bl(:,:,:), 'RHOT_t_BL', &
258  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
259  nu(:,:,:), 'Nu_BL', &
262  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
263  kh(:,:,:), 'Kh_BL', &
266 
267  do iq = 1, qa
268  if ( .not. tracer_advc(iq) ) cycle
269  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
270  rhoq_t_bl(:,:,:,iq), trim(tracer_name(iq))//'_t_BL', &
273  enddo
274  endif
275 
276  endif
277 
278  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
279  !$omp shared(JS,JE,IS,IE,KS,KE,RHOU_t,RHOU_t_BL,RHOV_t,RHOV_t_BL,RHOT_t,RHOT_t_BL)
280  do j = js, je
281  do i = is, ie
282  do k = ks, ke
283  rhou_t(k,i,j) = rhou_t(k,i,j) + rhou_t_bl(k,i,j)
284  rhov_t(k,i,j) = rhov_t(k,i,j) + rhov_t_bl(k,i,j)
285  rhot_t(k,i,j) = rhot_t(k,i,j) + rhot_t_bl(k,i,j)
286  enddo
287  enddo
288  enddo
289 
290  do iq = 1, qa
291  if ( .not. tracer_advc(iq) ) cycle
292  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(3)
293  do j = js, je
294  do i = is, ie
295  do k = ks, ke
296  rhoq_t(k,i,j,iq) = rhoq_t(k,i,j,iq) + rhoq_t_bl(k,i,j,iq)
297  enddo
298  enddo
299  enddo
300  enddo
301 
302  return
module ATMOS admin
real(rp), dimension(:,:,:), pointer, public qc
real(rp), dimension(:,:,:), allocatable, target, public qdry
real(dp), public time_dtsec_atmos_phy_bl
time interval of physics(pbl ) [sec]
Definition: scale_time.F90:47
module ATMOSPHERIC Variables
real(rp), dimension(:,:,:,:), pointer, public qtrc_av
real(rp), dimension(:,:,:), allocatable, public atmos_phy_bl_rhov_t
real(rp), dimension(:,:,:), allocatable, public rhot_tp
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_vol
control volume (zxy) [m3]
real(rp), public atmos_grid_cartesc_real_totvol
total volume (zxy, local) [m3]
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_fz
geopotential height [m] (wxy)
real(rp), dimension(:,:,:), allocatable, target, public dens
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sflx_mv
real(rp), dimension(:,:,:), allocatable, public rhov_tp
logical, public statistics_checktotal
calc&report variable totals to logfile?
real(rp), dimension(:,:,:), pointer, public qi
real(rp), dimension(:,:,:), allocatable, public atmos_phy_bl_rhou_t
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_l_mo
module ATMOSPHERIC Surface Variables
character(len=h_short), public atmos_phy_bl_type
real(rp), dimension(:,:,:,:), allocatable, public rhoq_tp
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_bl_rhoq_t
module atmosphere / physics / PBL
module TIME
Definition: scale_time.F90:16
real(rp), dimension(:,:,:), allocatable, target, public atmos_phy_sf_sflx_qtrc
real(rp), dimension(:,:,:), allocatable, target, public pott
real(rp), dimension(:,:,:), pointer, public dens_av
real(rp), dimension(:,:,:), allocatable, pointer, target, public qv
real(rp), dimension(:,:), pointer, public atmos_phy_sf_sflx_qv
real(rp), dimension(:,:,:), allocatable, target, public v
real(rp), dimension(:,:,:), allocatable, target, public exner
real(rp), dimension(:,:,:), allocatable, target, public u
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sflx_sh
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_cz
geopotential height [m] (zxy)
module Atmosphere GRID CartesC Real(real space)
real(rp), dimension(:,:,:), allocatable, public rhou_tp
real(rp), dimension(:,:,:), allocatable, public atmos_phy_bl_rhot_t
logical, public atmos_sw_phy_bl
module Statistics
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sflx_mu
real(rp), dimension(:,:,:), allocatable, target, public pres
module file_history
real(rp), dimension(:,:,:,:), allocatable, target, public qtrc
Here is the caller graph for this function: