SCALE-RM
Functions/Subroutines
scale_atmos_phy_tb_dns Module Reference

module ATMOSPHERE / Physics Turbulence More...

Functions/Subroutines

subroutine, public atmos_phy_tb_dns_config (TYPE_TB, I_TKE_out)
 Config. More...
 
subroutine, public atmos_phy_tb_dns_setup (CDZ, CDX, CDY, CZ)
 
subroutine, public atmos_phy_tb_dns (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)
 

Detailed Description

module ATMOSPHERE / Physics Turbulence

Description
Sub-grid scale turbulent process for DNS
Author
Team SCALE
History
NAMELIST
  • PARAM_ATMOS_PHY_TB_DNS
    nametypedefault valuecomment
    ATMOS_PHY_TB_DNS_NU real(RP) 1.512E-5_RP [m2/s] kinematic viscosity coefficient for air at 20degC
    ATMOS_PHY_TB_DNS_MU real(RP) 1.512E-5_RP same as NU (needed based on hyposes. see Mellado 2010)

History Output
No history output

Function/Subroutine Documentation

◆ atmos_phy_tb_dns_config()

subroutine, public scale_atmos_phy_tb_dns::atmos_phy_tb_dns_config ( character(len=*), intent(in)  TYPE_TB,
integer, intent(out)  I_TKE_out 
)

Config.

Definition at line 66 of file scale_atmos_phy_tb_dns.F90.

References scale_stdio::io_fid_log, scale_stdio::io_l, and scale_process::prc_mpistop().

Referenced by scale_atmos_phy_tb::atmos_phy_tb_config().

66  use scale_process, only: &
68  implicit none
69 
70  character(len=*), intent(in) :: TYPE_TB
71  integer, intent(out) :: I_TKE_out
72  !---------------------------------------------------------------------------
73 
74  if( io_l ) write(io_fid_log,*)
75  if( io_l ) write(io_fid_log,*) '++++++ Module[Turbulence Tracer] / Categ[ATMOS PHYSICS] / Origin[SCALElib]'
76  if( io_l ) write(io_fid_log,*) '*** Tracers for Deardorff (1980) 1.5th TKE Model'
77 
78  if ( type_tb /= 'DNS' ) then
79  write(*,*) 'xxx ATMOS_PHY_TB_TYPE is not DNS. Check!'
80  call prc_mpistop
81  endif
82 
83  i_tke_out = -1
84 
85  return
subroutine, public prc_mpistop
Abort MPI.
module PROCESS
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_tb_dns_setup()

subroutine, public scale_atmos_phy_tb_dns::atmos_phy_tb_dns_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 
)

Definition at line 90 of file scale_atmos_phy_tb_dns.F90.

References scale_stdio::io_fid_conf, scale_stdio::io_fid_log, scale_stdio::io_fid_nml, scale_stdio::io_l, scale_stdio::io_nml, and scale_process::prc_mpistop().

Referenced by scale_atmos_phy_tb::atmos_phy_tb_config().

90  use scale_process, only: &
92  implicit none
93 
94  real(RP), intent(in) :: CDZ(KA)
95  real(RP), intent(in) :: CDX(IA)
96  real(RP), intent(in) :: CDY(JA)
97  real(RP), intent(in) :: CZ (KA,IA,JA)
98 
99  namelist / param_atmos_phy_tb_dns / &
100  atmos_phy_tb_dns_nu, &
101  atmos_phy_tb_dns_mu
102 
103  integer :: ierr
104  !---------------------------------------------------------------------------
105 
106  if( io_l ) write(io_fid_log,*)
107  if( io_l ) write(io_fid_log,*) '++++++ Module[Turbulence] / Categ[ATMOS PHYSICS] / Origin[SCALElib]'
108  if( io_l ) write(io_fid_log,*) '*** Eddy Viscocity Model for DNS'
109 
110  !--- read namelist
111  rewind(io_fid_conf)
112  read(io_fid_conf,nml=param_atmos_phy_tb_dns,iostat=ierr)
113  if( ierr < 0 ) then !--- missing
114  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
115  elseif( ierr > 0 ) then !--- fatal error
116  write(*,*) 'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_TB_DNS. Check!'
117  call prc_mpistop
118  endif
119  if( io_nml ) write(io_fid_nml,nml=param_atmos_phy_tb_dns)
120 
121  return
subroutine, public prc_mpistop
Abort MPI.
module PROCESS
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_tb_dns()

subroutine, public scale_atmos_phy_tb_dns::atmos_phy_tb_dns ( 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 132 of file scale_atmos_phy_tb_dns.F90.

References scale_const::const_grav, scale_grid::grid_rcdx, scale_grid::grid_rcdy, scale_grid::grid_rcdz, scale_grid::grid_rfdx, scale_grid::grid_rfdy, scale_grid::grid_rfdz, scale_gridtrans::i_uy, scale_gridtrans::i_xv, scale_gridtrans::i_xy, scale_grid_index::iblock, scale_grid_index::ie, scale_grid_index::is, scale_grid_index::jblock, scale_grid_index::je, scale_grid_index::js, scale_grid_index::ke, scale_grid_index::ks, scale_tracer::qa, 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().

132  use scale_grid_index
133  use scale_tracer
134  use scale_const, only: &
135  grav => const_grav
136  use scale_grid, only: &
137  rcdz => grid_rcdz, &
138  rcdx => grid_rcdx, &
139  rcdy => grid_rcdy, &
140  rfdz => grid_rfdz, &
141  rfdx => grid_rfdx, &
142  rfdy => grid_rfdy
143  use scale_gridtrans, only: &
144  i_xy, &
145  i_uy, &
146  i_xv
147  implicit none
148 
149  ! SGS flux
150  real(RP), intent(out) :: qflx_sgs_MOMZ(KA,IA,JA,3)
151  real(RP), intent(out) :: qflx_sgs_MOMX(KA,IA,JA,3)
152  real(RP), intent(out) :: qflx_sgs_MOMY(KA,IA,JA,3)
153  real(RP), intent(out) :: qflx_sgs_rhot(KA,IA,JA,3)
154  real(RP), intent(out) :: qflx_sgs_rhoq(KA,IA,JA,3,QA)
155 
156  real(RP), intent(inout) :: RHOQ_t(KA,IA,JA,QA) ! tendency of rho * QTRC
157 
158  real(RP), intent(out) :: nu(KA,IA,JA) ! eddy viscosity (center)
159  real(RP), intent(out) :: Ri(KA,IA,JA) ! Richardson number
160  real(RP), intent(out) :: Pr(KA,IA,JA) ! Prantle number
161 
162  real(RP), intent(in) :: MOMZ(KA,IA,JA)
163  real(RP), intent(in) :: MOMX(KA,IA,JA)
164  real(RP), intent(in) :: MOMY(KA,IA,JA)
165  real(RP), intent(in) :: RHOT(KA,IA,JA)
166  real(RP), intent(in) :: DENS(KA,IA,JA)
167  real(RP), intent(in) :: QTRC(KA,IA,JA,QA)
168  real(RP), intent(in) :: N2(KA,IA,JA)
169 
170  real(RP), intent(in) :: SFLX_MW(IA,JA)
171  real(RP), intent(in) :: SFLX_MU(IA,JA)
172  real(RP), intent(in) :: SFLX_MV(IA,JA)
173  real(RP), intent(in) :: SFLX_SH(IA,JA)
174  real(RP), intent(in) :: SFLX_Q (IA,JA,QA)
175 
176  real(RP), intent(in) :: GSQRT (KA,IA,JA,7)
177  real(RP), intent(in) :: J13G (KA,IA,JA,7)
178  real(RP), intent(in) :: J23G (KA,IA,JA,7)
179  real(RP), intent(in) :: J33G
180  real(RP), intent(in) :: MAPF (IA,JA,2,4)
181  real(DP), intent(in) :: dt
182 
183  real(RP) :: POTT(KA,IA,JA)
184 
185  integer :: IIS, IIE
186  integer :: JJS, JJE
187 
188  integer :: k, i, j, iq
189  !---------------------------------------------------------------------------
190 
191 #ifdef DEBUG
192  qflx_sgs_momz(:,:,:,:) = undef
193  qflx_sgs_momx(:,:,:,:) = undef
194  qflx_sgs_momy(:,:,:,:) = undef
195  qflx_sgs_rhot(:,:,:,:) = undef
196  qflx_sgs_rhoq(:,:,:,:,:) = undef
197 
198  pott(:,:,:) = undef
199 #endif
200 
201  nu(:,:,:) = 0.0_rp
202  ri(:,:,:) = 0.0_rp
203  pr(:,:,:) = 1.0_rp
204 
205  ! potential temperature
206  do j = js-1, je+1
207  do i = is-1, ie+1
208  do k = ks, ke
209  pott(k,i,j) = rhot(k,i,j) / dens(k,i,j)
210  enddo
211  enddo
212  enddo
213 
214  !##### Start Upadate #####
215  do jjs = js, je, jblock
216  jje = jjs+jblock-1
217  do iis = is, ie, iblock
218  iie = iis+iblock-1
219 
220  !##### momentum equation (z) #####
221  ! (cell center)
222  do j = jjs, jje
223  do i = iis, iie
224  do k = ks+1, ke-1
225  qflx_sgs_momz(k,i,j,zdir) = -atmos_phy_tb_dns_nu * ( momz(k,i,j)-momz(k-1,i,j) ) * rcdz(k)
226  enddo
227  enddo
228  enddo
229 
230  do j = jjs, jje
231  do i = iis, iie
232  qflx_sgs_momz(ks,i,j,zdir) = 0.0_rp ! bottom boundary
233  qflx_sgs_momz(ke,i,j,zdir) = 0.0_rp ! top boundary
234  enddo
235  enddo
236 
237  ! (y edge)
238  do j = jjs, jje
239  do i = iis-1, iie
240  do k = ks, ke-1
241  qflx_sgs_momz(k,i,j,xdir) = -atmos_phy_tb_dns_nu * ( momz(k,i+1,j)-momz(k,i,j) ) * rfdx(i) * mapf(i,j,1,i_xy)
242  enddo
243  enddo
244  enddo
245 
246  ! (x edge)
247  do j = jjs-1, jje
248  do i = iis, iie
249  do k = ks, ke-1
250  qflx_sgs_momz(k,i,j,ydir) = -atmos_phy_tb_dns_nu * ( momz(k,i,j+1)-momz(k,i,j) ) * rfdy(j) * mapf(i,j,2,i_xy)
251  enddo
252  enddo
253  enddo
254 
255  !##### momentum equation (x) #####
256  ! (y edge)
257  do j = jjs, jje
258  do i = iis, iie
259  do k = ks, ke-1
260  qflx_sgs_momx(k,i,j,zdir) = -atmos_phy_tb_dns_nu * ( momx(k+1,i,j)-momx(k,i,j) ) * rfdz(k)
261  enddo
262  enddo
263  enddo
264 
265  do j = jjs, jje
266  do i = iis, iie
267  qflx_sgs_momx(ks-1,i,j,zdir) = 0.0_rp ! bottom boundary
268  qflx_sgs_momx(ke ,i,j,zdir) = 0.0_rp ! top boundary
269  enddo
270  enddo
271 
272  ! (cell center)
273  do j = jjs, jje
274  do i = iis, iie+1
275  do k = ks, ke
276  qflx_sgs_momx(k,i,j,xdir) = -atmos_phy_tb_dns_nu * ( momx(k,i,j)-momx(k,i-1,j) ) * rcdx(i) * mapf(i,j,1,i_uy)
277  enddo
278  enddo
279  enddo
280 
281  ! (z edge)
282  do j = jjs-1, jje
283  do i = iis, iie
284  do k = ks, ke
285  qflx_sgs_momx(k,i,j,ydir) = -atmos_phy_tb_dns_nu * ( momx(k,i,j+1)-momx(k,i,j) ) * rfdy(j) * mapf(i,j,2,i_uy)
286  enddo
287  enddo
288  enddo
289 
290  !##### momentum equation (y) #####
291 
292  ! (x edge)
293  do j = jjs, jje
294  do i = iis, iie
295  do k = ks, ke-1
296  qflx_sgs_momy(k,i,j,zdir) = -atmos_phy_tb_dns_nu * ( momy(k+1,i,j)-momy(k,i,j) ) * rfdz(k)
297  enddo
298  enddo
299  enddo
300 
301  do j = jjs, jje
302  do i = iis, iie
303  qflx_sgs_momy(ks-1,i,j,zdir) = 0.0_rp ! bottom boundary
304  qflx_sgs_momy(ke ,i,j,zdir) = 0.0_rp ! top boundary
305  enddo
306  enddo
307 
308  ! (z edge)
309  do j = jjs, jje
310  do i = iis-1, iie
311  do k = ks, ke
312  qflx_sgs_momy(k,i,j,xdir) = -atmos_phy_tb_dns_nu * ( momy(k,i+1,j)-momy(k,i,j) ) * rfdx(i) * mapf(i,j,1,i_xv)
313  enddo
314  enddo
315  enddo
316 
317  ! (z-x plane)
318  do j = jjs, jje+1
319  do i = iis, iie
320  do k = ks, ke
321  qflx_sgs_momy(k,i,j,ydir) = -atmos_phy_tb_dns_nu * ( momy(k,i,j)-momy(k,i,j-1) ) * rcdy(j) * mapf(i,j,2,i_xv)
322  enddo
323  enddo
324  enddo
325 
326  !##### Thermodynamic Equation #####
327 
328  ! at x, y ,w
329  do j = jjs, jje
330  do i = iis, iie
331  do k = ks, ke-1
332  qflx_sgs_rhot(k,i,j,zdir) = -0.5_rp * ( dens(k+1,i,j)+dens(k,i,j) ) &
333  * atmos_phy_tb_dns_mu * ( pott(k+1,i,j)-pott(k,i,j) ) * rfdz(k)
334  enddo
335  enddo
336  enddo
337 
338  do j = jjs, jje
339  do i = iis, iie
340  qflx_sgs_rhot(ks-1,i,j,zdir) = 0.0_rp
341  qflx_sgs_rhot(ke ,i,j,zdir) = 0.0_rp
342  enddo
343  enddo
344 
345  ! at u, y, z
346  do j = jjs, jje
347  do i = iis-1, iie
348  do k = ks, ke
349  qflx_sgs_rhot(k,i,j,xdir) = -0.5_rp * ( dens(k,i+1,j)+dens(k,i,j) ) &
350  * atmos_phy_tb_dns_mu * ( pott(k,i+1,j)-pott(k,i,j) ) * rfdx(i) * mapf(i,j,1,i_xy)
351  enddo
352  enddo
353  enddo
354 
355  ! at x, v, z
356  do j = jjs-1, jje
357  do i = iis, iie
358  do k = ks, ke
359  qflx_sgs_rhot(k,i,j,ydir) = -0.5_rp * ( dens(k,i,j+1)+dens(k,i,j) ) &
360  * atmos_phy_tb_dns_mu * ( pott(k,i,j+1)-pott(k,i,j) ) * rfdy(j) * mapf(i,j,2,i_xy)
361  enddo
362  enddo
363  enddo
364 
365  enddo
366  enddo
367 
368  !##### Tracers #####
369  do iq = 1, qa
370 
371  if ( .not. tracer_advc(iq) ) cycle
372 
373  do jjs = js, je, jblock
374  jje = jjs+jblock-1
375  do iis = is, ie, iblock
376  iie = iis+iblock-1
377 
378  ! at x, y ,w
379  do j = jjs, jje
380  do i = iis, iie
381  do k = ks, ke-1
382  qflx_sgs_rhoq(k,i,j,zdir,iq) = -0.5_rp * ( dens(k+1,i,j)+dens(k,i,j) ) &
383  * atmos_phy_tb_dns_mu * ( qtrc(k+1,i,j,iq)-qtrc(k,i,j,iq) ) * rfdz(k)
384  enddo
385  enddo
386  enddo
387  do j = jjs, jje
388  do i = iis, iie
389  qflx_sgs_rhoq(ks-1,i,j,zdir,iq) = 0.0_rp
390  qflx_sgs_rhoq(ke ,i,j,zdir,iq) = 0.0_rp
391  enddo
392  enddo
393 
394  ! at u, y, z
395  do j = jjs, jje
396  do i = iis-1, iie
397  do k = ks, ke
398  qflx_sgs_rhoq(k,i,j,xdir,iq) = -0.5_rp * ( dens(k,i+1,j)+dens(k,i,j) ) &
399  * atmos_phy_tb_dns_mu * ( qtrc(k,i+1,j,iq)-qtrc(k,i,j,iq) ) * rfdx(i) * mapf(i,j,1,i_xy)
400  enddo
401  enddo
402  enddo
403 
404  ! at x, v, z
405  do j = jjs-1, jje
406  do i = iis, iie
407  do k = ks, ke
408  qflx_sgs_rhoq(k,i,j,ydir,iq) = -0.5_rp * ( dens(k,i,j+1)+dens(k,i,j) ) &
409  * atmos_phy_tb_dns_mu * ( qtrc(k,i,j+1,iq)-qtrc(k,i,j,iq) ) * rfdy(j) * mapf(i,j,2,i_xy)
410  enddo
411  enddo
412  enddo
413 
414  enddo
415  enddo
416 
417  enddo ! scalar quantities loop
418 
419  return
integer, public is
start point of inner domain: x, local
integer, public je
end point of inner domain: y, local
real(rp), dimension(:), allocatable, public grid_rcdy
reciprocal of center-dy
integer, public iblock
block size for cache blocking: x
real(rp), dimension(:), allocatable, public grid_rcdx
reciprocal of center-dx
integer, parameter, public zdir
integer, parameter, public ydir
integer, parameter, public xdir
logical, dimension(qa_max), public tracer_advc
integer, public i_xy
real(rp), dimension(:), allocatable, public grid_rfdy
reciprocal of face-dy
real(rp), dimension(:), allocatable, public grid_rcdz
reciprocal of center-dz
module grid index
module TRACER
module GRIDTRANS
integer, public i_uy
integer, public jblock
block size for cache blocking: y
real(rp), public const_grav
standard acceleration of gravity [m/s2]
Definition: scale_const.F90:48
integer, public js
start point of inner domain: y, local
module CONSTANT
Definition: scale_const.F90:14
module GRID (cartesian)
integer, public i_xv
integer, public ie
end point of inner domain: x, local
real(rp), dimension(:), allocatable, public grid_rfdx
reciprocal of face-dx
real(rp), dimension(:), allocatable, public grid_rfdz
reciprocal of face-dz
Here is the caller graph for this function: