SCALE-RM
Data Types | Functions/Subroutines | Variables
scale_atmos_phy_tb_hybrid Module Reference

module ATMOSPHERE / Physics Turbulence More...

Data Types

interface  su
 

Functions/Subroutines

subroutine, public atmos_phy_tb_hybrid_config (TB_TYPE, I_TKE_out)
 Config. More...
 
subroutine, public atmos_phy_tb_hybrid_setup (CDZ, CDX, CDY, CZ)
 Setup. More...
 
subroutine, public atmos_phy_tb_hybrid (qflx_sgs_momz, qflx_sgs_momx, qflx_sgs_momy, qflx_sgs_rhot, qflx_sgs_rhoq, RHOQ_t, Nu, Ri, Pr, MOMZ, MOMX, MOMY, RHOT, DENS, QTRC, N2, SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_Q, GSQRT, J13G, J23G, J33G, MAPF, dt)
 

Variables

procedure(tb), pointer sgs_tb => NULL()
 

Detailed Description

module ATMOSPHERE / Physics Turbulence

Description
Boundary layer turbulence model
Author
Team SCALE
History
  • 2014-09-18 (S.Nishizawa) [new]
NAMELIST
  • PARAM_ATMOS_PHY_TB_HYBRID
    nametypedefault valuecomment
    ATMOS_PHY_TB_HYBRID_SGS_DX real(RP) 100.0_RP horizontal resolution for SGS model
    ATMOS_PHY_TB_HYBRID_PBL_DX real(RP) 500.0_RP horizontal resolution for PBL model
    ATMOS_PHY_TB_HYBRID_SGS_TYPE character(len=H_SHORT) 'SMAGORINSKY' scheme type for SGS
    ATMOS_PHY_TB_HYBRID_PBL_TYPE character(len=H_SHORT) 'MYNN' scheme type for turbulent parametarization

History Output
No history output

Function/Subroutine Documentation

◆ atmos_phy_tb_hybrid_config()

subroutine, public scale_atmos_phy_tb_hybrid::atmos_phy_tb_hybrid_config ( character(len=*), intent(in)  TB_TYPE,
integer, intent(out)  I_TKE_out 
)

Config.

Definition at line 141 of file scale_atmos_phy_tb_hybrid.F90.

References scale_atmos_phy_tb_mynn::atmos_phy_tb_mynn(), scale_atmos_phy_tb_mynn::atmos_phy_tb_mynn_config(), scale_atmos_phy_tb_mynn::atmos_phy_tb_mynn_setup(), scale_atmos_phy_tb_smg::atmos_phy_tb_smg(), scale_atmos_phy_tb_smg::atmos_phy_tb_smg_config(), scale_atmos_phy_tb_smg::atmos_phy_tb_smg_setup(), scale_stdio::io_fid_conf, scale_stdio::io_fid_log, scale_stdio::io_fid_nml, scale_stdio::io_l, scale_stdio::io_nml, scale_process::prc_mpistop(), and sgs_tb.

Referenced by scale_atmos_phy_tb::atmos_phy_tb_config().

141  use scale_process, only: &
143  use scale_atmos_phy_tb_smg, only: &
147  use scale_atmos_phy_tb_mynn, only: &
151  implicit none
152 
153  character(len=*), intent(in) :: TB_TYPE
154  integer, intent(out) :: I_TKE_out
155 
156  character(len=H_SHORT) :: ATMOS_PHY_TB_HYBRID_SGS_TYPE = 'SMAGORINSKY'
157  character(len=H_SHORT) :: ATMOS_PHY_TB_HYBRID_PBL_TYPE = 'MYNN'
158 
159  namelist / param_atmos_phy_tb_hybrid / &
160  atmos_phy_tb_hybrid_sgs_dx, &
161  atmos_phy_tb_hybrid_pbl_dx, &
162  atmos_phy_tb_hybrid_sgs_type, &
163  atmos_phy_tb_hybrid_pbl_type
164 
165  integer :: ierr
166  !---------------------------------------------------------------------------
167 
168  if( io_l ) write(io_fid_log,*)
169  if( io_l ) write(io_fid_log,*) '++++++ Module[Turbulence Tracer] / Categ[ATMOS PHYSICS] / Origin[SCALElib]'
170  if( io_l ) write(io_fid_log,*) '*** Tracers for SGS-parameterization hybrid Model'
171 
172  if ( tb_type /= 'HYBRID' ) then
173  write(*,*) 'xxx ATMOS_PHY_TB_TYPE is not HYBRID. Check!'
174  call prc_mpistop
175  endif
176 
177  !--- read namelist
178  rewind(io_fid_conf)
179  read(io_fid_conf,nml=param_atmos_phy_tb_hybrid,iostat=ierr)
180  if( ierr < 0 ) then !--- missing
181  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
182  elseif( ierr > 0 ) then !--- fatal error
183  write(*,*) 'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_TB_HYBRID. Check!'
184  call prc_mpistop
185  endif
186  if( io_nml ) write(io_fid_nml,nml=param_atmos_phy_tb_hybrid)
187 
188  select case( atmos_phy_tb_hybrid_sgs_type )
189  case('SMAGORINSKY')
191  atmos_phy_tb_hybrid_sgs_type, &
192  i_tke_sgs )
193  sgs_tb => atmos_phy_tb_smg
194  sgs_tb_setup => atmos_phy_tb_smg_setup
195  case default
196  write(*,*) 'xxx ATMOS_PHY_TB_HYBRID_SGS_TYPE is invalid'
197  call prc_mpistop
198  end select
199 
200  select case( atmos_phy_tb_hybrid_pbl_type )
201  case('MYNN')
203  atmos_phy_tb_hybrid_pbl_type, &
204  i_tke_pbl )
205  pbl_tb => atmos_phy_tb_mynn
206  pbl_tb_setup => atmos_phy_tb_mynn_setup
207  case default
208  write(*,*) 'xxx ATMOS_PHY_TB_HYBRID_PBL_TYPE is invalid'
209  call prc_mpistop
210  end select
211 
212  i_tke_out = i_tke_pbl
213 
214  return
subroutine, public prc_mpistop
Abort MPI.
subroutine, public atmos_phy_tb_smg_setup(CDZ, CDX, CDY, CZ)
Setup.
subroutine, public atmos_phy_tb_mynn_setup(CDZ, CDX, CDY, CZ)
Setup.
module ATMOSPHERE / Physics Turbulence
subroutine, public atmos_phy_tb_mynn(qflx_sgs_momz, qflx_sgs_momx, qflx_sgs_momy, qflx_sgs_rhot, qflx_sgs_rhoq, RHOQ_t, Nu, Ri, Pr, MOMZ, MOMX, MOMY, RHOT, DENS, QTRC, N2_in, SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_Q, GSQRT, J13G, J23G, J33G, MAPF, dt)
subroutine, public atmos_phy_tb_mynn_config(TYPE_TB, I_TKE_out)
Config.
module PROCESS
subroutine, public atmos_phy_tb_smg(qflx_sgs_momz, qflx_sgs_momx, qflx_sgs_momy, qflx_sgs_rhot, qflx_sgs_rhoq, RHOQ_t, Nu, Ri, Pr, MOMZ, MOMX, MOMY, RHOT, DENS, QTRC, N2, SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_Q, GSQRT, J13G, J23G, J33G, MAPF, dt)
module ATMOSPHERE / Physics Turbulence
subroutine, public atmos_phy_tb_smg_config(TYPE_TB, I_TKE_out)
Config.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_tb_hybrid_setup()

subroutine, public scale_atmos_phy_tb_hybrid::atmos_phy_tb_hybrid_setup ( real(rp), dimension(ka), intent(in)  CDZ,
real(rp), dimension(ia), intent(in)  CDX,
real(rp), dimension(ja), intent(in)  CDY,
real(rp), dimension (ka,ia,ja), intent(in)  CZ 
)

Setup.

Definition at line 221 of file scale_atmos_phy_tb_hybrid.F90.

References scale_grid_index::ia, scale_stdio::io_fid_log, scale_stdio::io_l, and scale_grid_index::ja.

Referenced by scale_atmos_phy_tb::atmos_phy_tb_config().

221  implicit none
222 
223  real(RP), intent(in) :: CDZ(KA)
224  real(RP), intent(in) :: CDX(IA)
225  real(RP), intent(in) :: CDY(JA)
226  real(RP), intent(in) :: CZ (KA,IA,JA)
227 
228  real(RP) :: dxy
229 
230  integer :: i, j
231  !---------------------------------------------------------------------------
232 
233  if( io_l ) write(io_fid_log,*)
234  if( io_l ) write(io_fid_log,*) '++++++ Module[Turbulence] / Categ[ATMOS PHYSICS] / Origin[SCALElib]'
235  if( io_l ) write(io_fid_log,*) '*** SGS-parameterization hybrid Model'
236 
237  call sgs_tb_setup( cdz, cdx, cdy, cz )
238  call pbl_tb_setup( cdz, cdx, cdy, cz )
239 
240  allocate( frac_sgs(ia,ja) )
241  allocate( frac_pbl(ia,ja) )
242  allocate( frac_sgs_tke(ia,ja) )
243  allocate( frac_pbl_tke(ia,ja) )
244 
245  do j = 1, ja
246  do i = 1, ia
247  dxy = sqrt( 0.5_rp * ( cdx(i)**2 + cdy(j)**2 ) )
248 
249  frac_pbl(i,j) = ( dxy - atmos_phy_tb_hybrid_sgs_dx ) / ( atmos_phy_tb_hybrid_pbl_dx - atmos_phy_tb_hybrid_sgs_dx )
250  frac_pbl(i,j) = min( 1.0_rp, max( 0.0_rp, frac_pbl(i,j) ) )
251  frac_sgs(i,j) = 1.0_rp - frac_pbl(i,j)
252  end do
253  end do
254 
255  return
Here is the caller graph for this function:

◆ atmos_phy_tb_hybrid()

subroutine, public scale_atmos_phy_tb_hybrid::atmos_phy_tb_hybrid ( real(rp), dimension(ka,ia,ja,3), intent(out)  qflx_sgs_momz,
real(rp), dimension(ka,ia,ja,3), intent(out)  qflx_sgs_momx,
real(rp), dimension(ka,ia,ja,3), intent(out)  qflx_sgs_momy,
real(rp), dimension(ka,ia,ja,3), intent(out)  qflx_sgs_rhot,
real(rp), dimension(ka,ia,ja,3,qa), intent(out)  qflx_sgs_rhoq,
real(rp), dimension (ka,ia,ja,qa), intent(inout)  RHOQ_t,
real(rp), dimension (ka,ia,ja), intent(out)  Nu,
real(rp), dimension (ka,ia,ja), intent(out)  Ri,
real(rp), dimension (ka,ia,ja), intent(out)  Pr,
real(rp), dimension (ka,ia,ja), intent(in)  MOMZ,
real(rp), dimension (ka,ia,ja), intent(in)  MOMX,
real(rp), dimension (ka,ia,ja), intent(in)  MOMY,
real(rp), dimension (ka,ia,ja), intent(in)  RHOT,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja,qa), intent(in)  QTRC,
real(rp), dimension (ka,ia,ja), intent(in)  N2,
real(rp), dimension (ia,ja), intent(in)  SFLX_MW,
real(rp), dimension (ia,ja), intent(in)  SFLX_MU,
real(rp), dimension (ia,ja), intent(in)  SFLX_MV,
real(rp), dimension (ia,ja), intent(in)  SFLX_SH,
real(rp), dimension (ia,ja,qa), intent(in)  SFLX_Q,
real(rp), dimension (ka,ia,ja,7), intent(in)  GSQRT,
real(rp), dimension (ka,ia,ja,7), intent(in)  J13G,
real(rp), dimension (ka,ia,ja,7), intent(in)  J23G,
real(rp), intent(in)  J33G,
real(rp), dimension (ia,ja,2,4), intent(in)  MAPF,
real(dp), intent(in)  dt 
)
Parameters
[in]gsqrtvertical metrics {G}^1/2
[in]j13g(1,3) element of Jacobian matrix
[in]j23g(1,3) element of Jacobian matrix
[in]j33g(3,3) element of Jacobian matrix
[in]mapfmap factor

Definition at line 267 of file scale_atmos_phy_tb_hybrid.F90.

References scale_const::const_grav, scale_grid_index::ia, scale_grid_index::ja, scale_grid_index::ke, scale_grid_index::ks, scale_tracer::qa, sgs_tb, scale_tracer::tracer_advc, scale_grid_index::xdir, scale_grid_index::ydir, and scale_grid_index::zdir.

Referenced by scale_atmos_phy_tb::atmos_phy_tb_config().

267  use scale_precision
268  use scale_grid_index
269  use scale_tracer
270  use scale_const, only: &
271  grav => const_grav
272  implicit none
273 
274  real(RP), intent(out) :: qflx_sgs_momz(KA,IA,JA,3)
275  real(RP), intent(out) :: qflx_sgs_momx(KA,IA,JA,3)
276  real(RP), intent(out) :: qflx_sgs_momy(KA,IA,JA,3)
277  real(RP), intent(out) :: qflx_sgs_rhot(KA,IA,JA,3)
278  real(RP), intent(out) :: qflx_sgs_rhoq(KA,IA,JA,3,QA)
279 
280  real(RP), intent(inout) :: RHOQ_t (KA,IA,JA,QA) ! tendency of rho * QTRC
281 
282  real(RP), intent(out) :: Nu (KA,IA,JA) ! eddy viscosity (center)
283  real(RP), intent(out) :: Pr (KA,IA,JA) ! Plandtle number
284  real(RP), intent(out) :: Ri (KA,IA,JA) ! Richardson number
285 
286  real(RP), intent(in) :: MOMZ (KA,IA,JA)
287  real(RP), intent(in) :: MOMX (KA,IA,JA)
288  real(RP), intent(in) :: MOMY (KA,IA,JA)
289  real(RP), intent(in) :: RHOT (KA,IA,JA)
290  real(RP), intent(in) :: DENS (KA,IA,JA)
291  real(RP), intent(in) :: QTRC (KA,IA,JA,QA)
292  real(RP), intent(in) :: N2 (KA,IA,JA)
293 
294  real(RP), intent(in) :: SFLX_MW (IA,JA)
295  real(RP), intent(in) :: SFLX_MU (IA,JA)
296  real(RP), intent(in) :: SFLX_MV (IA,JA)
297  real(RP), intent(in) :: SFLX_SH (IA,JA)
298  real(RP), intent(in) :: SFLX_Q (IA,JA,QA)
299 
300  real(RP), intent(in) :: GSQRT (KA,IA,JA,7)
301  real(RP), intent(in) :: J13G (KA,IA,JA,7)
302  real(RP), intent(in) :: J23G (KA,IA,JA,7)
303  real(RP), intent(in) :: J33G
304  real(RP), intent(in) :: MAPF (IA,JA,2,4)
305  real(DP), intent(in) :: dt
306 
307  real(RP) :: w_qflx_sgs_momz(KA,IA,JA,3,2)
308  real(RP) :: w_qflx_sgs_momx(KA,IA,JA,3,2)
309  real(RP) :: w_qflx_sgs_momy(KA,IA,JA,3,2)
310  real(RP) :: w_qflx_sgs_rhot(KA,IA,JA,3,2)
311  real(RP) :: w_qflx_sgs_rhoq(KA,IA,JA,3,QA,2)
312 
313  real(RP) :: w_Nu (KA,IA,JA,2)
314  real(RP) :: w_Ri (KA,IA,JA,2)
315  real(RP) :: w_Pr (KA,IA,JA,2)
316 
317  integer :: k, i, j, iq
318  !---------------------------------------------------------------------------
319 
320  call sgs_tb( w_qflx_sgs_momz(:,:,:,:,1), w_qflx_sgs_momx(:,:,:,:,1), & ! [OUT]
321  w_qflx_sgs_momy(:,:,:,:,1), w_qflx_sgs_rhot(:,:,:,:,1), & ! [OUT]
322  w_qflx_sgs_rhoq(:,:,:,:,:,1), & ! [OUT]
323  rhoq_t, & ! [INOUT]
324  w_nu(:,:,:,1), w_ri(:,:,:,1), w_pr(:,:,:,1), & ! [OUT]
325  momz, momx, momy, rhot, dens, qtrc, n2, & ! [IN]
326  sflx_mw, sflx_mu, sflx_mv, sflx_sh, sflx_q, & ! [IN]
327  gsqrt, j13g, j23g, j33g, mapf, dt ) ! [IN]
328 
329  call pbl_tb( w_qflx_sgs_momz(:,:,:,:,2), w_qflx_sgs_momx(:,:,:,:,2), & ! [OUT]
330  w_qflx_sgs_momy(:,:,:,:,2), w_qflx_sgs_rhot(:,:,:,:,2), & ! [OUT]
331  w_qflx_sgs_rhoq(:,:,:,:,:,2), & ! [OUT]
332  rhoq_t, & ! [INOUT]
333  w_nu(:,:,:,2), w_ri(:,:,:,2), w_pr(:,:,:,2), & ! [OUT]
334  momz, momx, momy, rhot, dens, qtrc, n2, & ! [IN]
335  sflx_mw, sflx_mu, sflx_mv, sflx_sh, sflx_q, & ! [IN]
336  gsqrt, j13g, j23g, j33g, mapf, dt ) ! [IN]
337 
338  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
339  !$omp shared(JA,IA,KS,KE,qflx_sgs_momz,w_qflx_sgs_momz,frac_sgs,frac_pbl)
340  do j = 1, ja
341  do i = 1, ia
342  do k = ks, ke
343  qflx_sgs_momz(k,i,j,zdir) = w_qflx_sgs_momz(k,i,j,zdir,1) * frac_sgs(i,j) &
344  + w_qflx_sgs_momz(k,i,j,zdir,2) * frac_pbl(i,j)
345  qflx_sgs_momz(k,i,j,xdir) = w_qflx_sgs_momz(k,i,j,xdir,1)
346  qflx_sgs_momz(k,i,j,ydir) = w_qflx_sgs_momz(k,i,j,ydir,1)
347  end do
348  end do
349  end do
350 
351  do j = 1, ja
352  do i = 1, ia
353  do k = ks, ke
354  qflx_sgs_momx(k,i,j,zdir) = w_qflx_sgs_momx(k,i,j,zdir,1) * frac_sgs(i,j) &
355  + w_qflx_sgs_momx(k,i,j,zdir,2) * frac_pbl(i,j)
356  qflx_sgs_momx(k,i,j,xdir) = w_qflx_sgs_momx(k,i,j,xdir,1)
357  qflx_sgs_momx(k,i,j,ydir) = w_qflx_sgs_momx(k,i,j,ydir,1)
358  end do
359  end do
360  end do
361 
362  do j = 1, ja
363  do i = 1, ia
364  do k = ks, ke
365  qflx_sgs_momy(k,i,j,zdir) = w_qflx_sgs_momy(k,i,j,zdir,1) * frac_sgs(i,j) &
366  + w_qflx_sgs_momy(k,i,j,zdir,2) * frac_pbl(i,j)
367  qflx_sgs_momy(k,i,j,xdir) = w_qflx_sgs_momy(k,i,j,xdir,1)
368  qflx_sgs_momy(k,i,j,ydir) = w_qflx_sgs_momy(k,i,j,ydir,1)
369  end do
370  end do
371  end do
372 
373  do j = 1, ja
374  do i = 1, ia
375  do k = ks, ke
376  qflx_sgs_rhot(k,i,j,zdir) = w_qflx_sgs_rhot(k,i,j,zdir,1) * frac_sgs(i,j) &
377  + w_qflx_sgs_rhot(k,i,j,zdir,2) * frac_pbl(i,j)
378  qflx_sgs_rhot(k,i,j,xdir) = w_qflx_sgs_rhot(k,i,j,xdir,1)
379  qflx_sgs_rhot(k,i,j,ydir) = w_qflx_sgs_rhot(k,i,j,ydir,1)
380  end do
381  end do
382  end do
383 
384  !$omp parallel do default(none) &
385  !$omp shared(JA,IA,KS,KE,qflx_sgs_rhoq,w_qflx_sgs_rhoq,frac_sgs,frac_pbl,QA,I_TKE_SGS) &
386  !$omp shared(I_TKE_PBL,TRACER_ADVC) &
387  !$omp private(i,j,k,iq) OMP_SCHEDULE_
388  do iq = 1, qa
389 
390  if ( iq == i_tke_sgs .or. iq == i_tke_pbl ) then
391  qflx_sgs_rhoq(:,:,:,:,iq) = 0.0_rp
392  cycle
393  end if
394  if ( .not. tracer_advc(iq) ) cycle
395 
396  do j = 1, ja
397  do i = 1, ia
398  do k = ks, ke
399  qflx_sgs_rhoq(k,i,j,zdir,iq) = w_qflx_sgs_rhoq(k,i,j,zdir,iq,1) * frac_sgs(i,j) &
400  + w_qflx_sgs_rhoq(k,i,j,zdir,iq,2) * frac_pbl(i,j)
401  qflx_sgs_rhoq(k,i,j,xdir,iq) = w_qflx_sgs_rhoq(k,i,j,xdir,iq,1)
402  qflx_sgs_rhoq(k,i,j,ydir,iq) = w_qflx_sgs_rhoq(k,i,j,ydir,iq,1)
403  end do
404  end do
405  end do
406 
407  end do
408 
409  do j = 1, ja
410  do i = 1, ia
411  do k = ks, ke
412  nu(k,i,j) = w_nu(k,i,j,1) * frac_sgs(i,j) &
413  + w_nu(k,i,j,2) * frac_pbl(i,j)
414  end do
415  end do
416  end do
417 
418  do j = 1, ja
419  do i = 1, ia
420  do k = ks, ke
421  ri(k,i,j) = w_ri(k,i,j,1) * frac_sgs(i,j) &
422  + w_ri(k,i,j,2) * frac_pbl(i,j)
423  end do
424  end do
425  end do
426 
427  do j = 1, ja
428  do i = 1, ia
429  do k = ks, ke
430  pr(k,i,j) = w_pr(k,i,j,1) * frac_sgs(i,j) &
431  + w_pr(k,i,j,2) * frac_pbl(i,j)
432  end do
433  end do
434  end do
435 
436  return
integer, parameter, public zdir
integer, parameter, public ydir
integer, parameter, public xdir
logical, dimension(qa_max), public tracer_advc
module grid index
module TRACER
real(rp), public const_grav
standard acceleration of gravity [m/s2]
Definition: scale_const.F90:48
module CONSTANT
Definition: scale_const.F90:14
module PRECISION
Here is the caller graph for this function:

Variable Documentation

◆ sgs_tb

procedure(tb), pointer scale_atmos_phy_tb_hybrid::sgs_tb => NULL()

Definition at line 114 of file scale_atmos_phy_tb_hybrid.F90.

Referenced by atmos_phy_tb_hybrid(), and atmos_phy_tb_hybrid_config().

114  procedure(tb), pointer :: SGS_TB => null()