SCALE-RM
scale_atmos_dyn_tstep_short_fvm_hevi.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
14 !-------------------------------------------------------------------------------
15 #include "inc_openmp.h"
16 
17 #ifdef PROFILE_FAPP
18 #define PROFILE_START(name) call fapp_start(name, 1, 1)
19 #define PROFILE_STOP(name) call fapp_stop (name, 1, 1)
20 #elif defined(PROFILE_FINEPA)
21 #define PROFILE_START(name) call start_collection(name)
22 #define PROFILE_STOP(name) call stop_collection (name)
23 #else
24 #define PROFILE_START(name)
25 #define PROFILE_STOP(name)
26 #endif
27 
29  !-----------------------------------------------------------------------------
30  !
31  !++ used modules
32  !
33  use scale_precision
34  use scale_stdio
35  use scale_prof
37  use scale_index
38  use scale_tracer
39 #if defined DEBUG || defined QUICKDEBUG
40  use scale_debug, only: &
41  check
42  use scale_const, only: &
43  undef => const_undef, &
44  iundef => const_undef2
45 #endif
46  !-----------------------------------------------------------------------------
47  implicit none
48  private
49  !-----------------------------------------------------------------------------
50  !
51  !++ Public procedure
52  !
56 
57  !-----------------------------------------------------------------------------
58  !
59  !++ Public parameters & variables
60  !
61  !-----------------------------------------------------------------------------
62  !
63  !++ Private procedure
64  !
65 #if 1
66 #define F2H(k,p,idx) (CDZ(k+p-1)*GSQRT(k+p-1,i,j,idx)/(CDZ(k)*GSQRT(k,i,j,idx)+CDZ(k+1)*GSQRT(k+1,i,j,idx)))
67 #else
68 # define F2H(k,p,idx) 0.5_RP
69 #endif
70 
71  !-----------------------------------------------------------------------------
72  !
73  !++ Private parameters & variables
74  !
75  integer, private, parameter :: NB = 1
76  integer, private, parameter :: VA_FVM_HEVI = 0
77  integer :: IFS_OFF
78  integer :: JFS_OFF
79 
80  !-----------------------------------------------------------------------------
81 contains
82  !-----------------------------------------------------------------------------
85  ATMOS_DYN_TYPE, &
86  VA_out, &
87  VAR_NAME, &
88  VAR_DESC, &
89  VAR_UNIT )
90  use scale_process, only: &
92  implicit none
93 
94  character(len=*), intent(in) :: atmos_dyn_type
95  integer, intent(out) :: va_out
96  character(len=H_SHORT), intent(out) :: var_name(:)
97  character(len=H_MID), intent(out) :: var_desc(:)
98  character(len=H_SHORT), intent(out) :: var_unit(:)
99  !---------------------------------------------------------------------------
100 
101  if ( atmos_dyn_type /= 'FVM-HEVI' .AND. atmos_dyn_type /= 'HEVI' ) then
102  write(*,*) 'xxx ATMOS_DYN_TYPE is not FVM-HEVI. Check!'
103  call prc_mpistop
104  endif
105 
106  va_out = va_fvm_hevi
107  var_name(:) = ""
108  var_desc(:) = ""
109  var_unit(:) = ""
110 
111  if( io_l ) write(io_fid_log,*)
112  if( io_l ) write(io_fid_log,*) '*** Register additional prognostic variables (HEVI)'
113  if ( va_out < 1 ) then
114  if( io_l ) write(io_fid_log,*) '*** => nothing.'
115  endif
116 
117  return
119 
120  !-----------------------------------------------------------------------------
123  implicit none
124  !---------------------------------------------------------------------------
125 
126  if( io_l ) write(io_fid_log,*) '*** HEVI Setup'
127 
128  return
130 
131  !-----------------------------------------------------------------------------
132  subroutine atmos_dyn_tstep_short_fvm_hevi( &
133  DENS_RK, MOMZ_RK, MOMX_RK, MOMY_RK, RHOT_RK, &
134  PROG_RK, &
135  mflx_hi, tflx_hi, &
136  DENS0, MOMZ0, MOMX0, MOMY0, RHOT0, &
137  DENS, MOMZ, MOMX, MOMY, RHOT, &
138  DENS_t, MOMZ_t, MOMX_t, MOMY_t, RHOT_t, &
139  PROG0, PROG, &
140  DPRES0, RT2P, CORIOLI, &
141  num_diff, wdamp_coef, divdmp_coef, DDIV, &
142  FLAG_FCT_MOMENTUM, FLAG_FCT_T, &
143  FLAG_FCT_ALONG_STREAM, &
144  CDZ, FDZ, FDX, FDY, &
145  RCDZ, RCDX, RCDY, RFDZ, RFDX, RFDY, &
146  PHI, GSQRT, J13G, J23G, J33G, MAPF, &
147  REF_dens, REF_rhot, &
148  BND_W, BND_E, BND_S, BND_N, &
149  dtrk, last )
151  use scale_const, only: &
152 #ifdef dry
153  rdry => const_rdry, &
154  cvdry => const_cvdry, &
155  cpdry => const_cpdry, &
156 #endif
157  eps => const_eps, &
158  grav => const_grav, &
159  p00 => const_pre00
160  use scale_atmos_dyn_common, only: &
162  use scale_atmos_dyn_fvm_flux, only: &
182  use scale_gridtrans, only: &
183  i_xyz, &
184  i_xyw, &
185  i_uyw, &
186  i_xvw, &
187  i_uyz, &
188  i_xvz, &
189  i_uvz, &
190  i_xy , &
191  i_uy , &
192  i_xv , &
193  i_uv
194 #ifdef HIST_TEND
195  use scale_history, only: &
196  hist_in
197 #endif
198  implicit none
199 
200  real(RP), intent(out) :: dens_rk(ka,ia,ja) ! prognostic variables
201  real(RP), intent(out) :: momz_rk(ka,ia,ja) !
202  real(RP), intent(out) :: momx_rk(ka,ia,ja) !
203  real(RP), intent(out) :: momy_rk(ka,ia,ja) !
204  real(RP), intent(out) :: rhot_rk(ka,ia,ja) !
205 
206  real(RP), intent(out) :: prog_rk(ka,ia,ja,va) !
207 
208  real(RP), intent(inout) :: mflx_hi(ka,ia,ja,3) ! rho * vel(x,y,z)
209  real(RP), intent(out) :: tflx_hi(ka,ia,ja,3) ! rho * theta * vel(x,y,z)
210 
211  real(RP), intent(in),target :: dens0(ka,ia,ja) ! prognostic variables
212  real(RP), intent(in),target :: momz0(ka,ia,ja) ! at previous dynamical time step
213  real(RP), intent(in),target :: momx0(ka,ia,ja) !
214  real(RP), intent(in),target :: momy0(ka,ia,ja) !
215  real(RP), intent(in),target :: rhot0(ka,ia,ja) !
216 
217  real(RP), intent(in) :: dens(ka,ia,ja) ! prognostic variables
218  real(RP), intent(in) :: momz(ka,ia,ja) ! at previous RK step
219  real(RP), intent(in) :: momx(ka,ia,ja) !
220  real(RP), intent(in) :: momy(ka,ia,ja) !
221  real(RP), intent(in) :: rhot(ka,ia,ja) !
222 
223  real(RP), intent(in) :: dens_t(ka,ia,ja)
224  real(RP), intent(in) :: momz_t(ka,ia,ja)
225  real(RP), intent(in) :: momx_t(ka,ia,ja)
226  real(RP), intent(in) :: momy_t(ka,ia,ja)
227  real(RP), intent(in) :: rhot_t(ka,ia,ja)
228 
229  real(RP), intent(in) :: prog0(ka,ia,ja,va)
230  real(RP), intent(in) :: prog (ka,ia,ja,va)
231 
232  real(RP), intent(in) :: dpres0(ka,ia,ja)
233  real(RP), intent(in) :: rt2p(ka,ia,ja)
234  real(RP), intent(in) :: corioli(1,ia,ja)
235  real(RP), intent(in) :: num_diff(ka,ia,ja,5,3)
236  real(RP), intent(in) :: wdamp_coef(ka)
237  real(RP), intent(in) :: divdmp_coef
238  real(RP), intent(in) :: ddiv(ka,ia,ja)
239 
240  logical, intent(in) :: flag_fct_momentum
241  logical, intent(in) :: flag_fct_t
242  logical, intent(in) :: flag_fct_along_stream
243 
244  real(RP), intent(in) :: cdz(ka)
245  real(RP), intent(in) :: fdz(ka-1)
246  real(RP), intent(in) :: fdx(ia-1)
247  real(RP), intent(in) :: fdy(ja-1)
248  real(RP), intent(in) :: rcdz(ka)
249  real(RP), intent(in) :: rcdx(ia)
250  real(RP), intent(in) :: rcdy(ja)
251  real(RP), intent(in) :: rfdz(ka-1)
252  real(RP), intent(in) :: rfdx(ia-1)
253  real(RP), intent(in) :: rfdy(ja-1)
254 
255  real(RP), intent(in) :: phi (ka,ia,ja)
256  real(RP), intent(in) :: gsqrt (ka,ia,ja,7)
257  real(RP), intent(in) :: j13g (ka,ia,ja,7)
258  real(RP), intent(in) :: j23g (ka,ia,ja,7)
259  real(RP), intent(in) :: j33g
260  real(RP), intent(in) :: mapf (ia,ja,2,4)
261  real(RP), intent(in) :: ref_dens(ka,ia,ja)
262  real(RP), intent(in) :: ref_rhot(ka,ia,ja)
263 
264  logical, intent(in) :: bnd_w
265  logical, intent(in) :: bnd_e
266  logical, intent(in) :: bnd_s
267  logical, intent(in) :: bnd_n
268 
269  real(RP), intent(in) :: dtrk
270  logical, intent(in) :: last
271 
272 
273  ! diagnostic variables (work space)
274  real(RP) :: pott(ka,ia,ja) ! potential temperature [K]
275  real(RP) :: dpres(ka,ia,ja) ! pressure deviation from reference pressure
276 
277  real(RP) :: qflx_hi (ka,ia,ja,3)
278  real(RP) :: qflx_j13(ka,ia,ja)
279  real(RP) :: qflx_j23(ka,ia,ja)
280 
281  real(RP) :: advch ! horizontal advection
282  real(RP) :: advcv ! vertical advection
283  real(RP) :: wdmp ! Raileight damping
284  real(RP) :: div ! divergence damping
285  real(RP) :: pg ! pressure gradient force
286  real(RP) :: cf ! colioris force
287 #ifdef HIST_TEND
288  real(RP) :: advch_t(ka,ia,ja,5)
289  real(RP) :: advcv_t(ka,ia,ja,5)
290  real(RP) :: wdmp_t(ka,ia,ja)
291  real(RP) :: ddiv_t(ka,ia,ja,3)
292  real(RP) :: pg_t(ka,ia,ja,3)
293  real(RP) :: cf_t(ka,ia,ja,2)
294  logical :: lhist
295 #endif
296 
297  ! for implicit solver
298  real(RP) :: a(ka,ia,ja)
299  real(RP) :: b
300  real(RP) :: sr(ka,ia,ja)
301  real(RP) :: sw(ka,ia,ja)
302  real(RP) :: st(ka,ia,ja)
303  real(RP) :: pt(ka,ia,ja)
304  real(RP) :: c(kmax-1,ia,ja)
305 
306  real(RP) :: f1(ka,ia,ja)
307  real(RP) :: f2(ka,ia,ja)
308  real(RP) :: f3(ka,ia,ja)
309 
310  integer :: iis, iie, jjs, jje
311  integer :: k, i, j
312  integer :: iss, iee
313 
314 #ifdef DEBUG
315  pott(:,:,:) = undef
316  dpres(:,:,:) = undef
317 
318  pt(:,:,:) = undef
319 
320  qflx_hi(:,:,:,:) = undef
321  qflx_j13(:,:,:) = undef
322  qflx_j23(:,:,:) = undef
323 #endif
324 
325 #if defined DEBUG || defined QUICKDEBUG
326  dens_rk( 1:ks-1,:,:) = undef
327  dens_rk(ke+1:ka ,:,:) = undef
328  momz_rk( 1:ks-1,:,:) = undef
329  momz_rk(ke+1:ka ,:,:) = undef
330  momx_rk( 1:ks-1,:,:) = undef
331  momx_rk(ke+1:ka ,:,:) = undef
332  momy_rk( 1:ks-1,:,:) = undef
333  momy_rk(ke+1:ka ,:,:) = undef
334  rhot_rk( 1:ks-1,:,:) = undef
335  rhot_rk(ke+1:ka ,:,:) = undef
336  prog_rk( 1:ks-1,:,:,:) = undef
337  prog_rk(ke+1:ka ,:,:,:) = undef
338 #endif
339 
340 #ifdef HIST_TEND
341  lhist = last
342 #endif
343 
344 #ifdef PROFILE_FIPP
345  call fipp_start()
346 #endif
347 
348  ifs_off = 1
349  jfs_off = 1
350  if ( bnd_w ) ifs_off = 0
351  if ( bnd_s ) jfs_off = 0
352 
353 
354  do jjs = js, je, jblock
355  jje = jjs+jblock-1
356  do iis = is, ie, iblock
357  iie = iis+iblock-1
358 
359  profile_start("hevi_pres")
360  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
361  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,DPRES0,RT2P,RHOT,REF_rhot,DPRES,DENS,PHI)
362  do j = jjs, jje+1
363  do i = iis, iie+1
364  do k = ks, ke
365 #ifdef DEBUG
366  call check( __line__, dpres0(k,i,j) )
367  call check( __line__, rt2p(k,i,j) )
368  call check( __line__, rhot(k,i,j) )
369  call check( __line__, ref_rhot(k,i,j) )
370 #endif
371  dpres(k,i,j) = dpres0(k,i,j) + rt2p(k,i,j) * ( rhot(k,i,j) - ref_rhot(k,i,j) )
372  enddo
373  dpres(ks-1,i,j) = dpres0(ks-1,i,j) - dens(ks,i,j) * ( phi(ks-1,i,j) - phi(ks+1,i,j) )
374  dpres(ke+1,i,j) = dpres0(ke+1,i,j) - dens(ke,i,j) * ( phi(ke+1,i,j) - phi(ke-1,i,j) )
375  enddo
376  enddo
377  profile_stop("hevi_pres")
378 
379  !##### continuity equation #####
380 
381  profile_start("hevi_mflx_z")
382  ! at (x, y, w)
383  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
384  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,GSQRT,I_XYW,MOMX,MOMY,J13G,J23G,mflx_hi,MAPF,I_XY,num_diff)
385  do j = jjs, jje
386  do i = iis-1, iie
387  mflx_hi(ks-1,i,j,zdir) = 0.0_rp
388  do k = ks, ke-1
389 #ifdef DEBUG
390  call check( __line__, momx(k+1,i ,j) )
391  call check( __line__, momx(k+1,i-1,j) )
392  call check( __line__, momx(k ,i ,j) )
393  call check( __line__, momx(k ,i+1,j) )
394  call check( __line__, momy(k+1,i,j) )
395  call check( __line__, momy(k+1,i,j-1) )
396  call check( __line__, momy(k ,i,j) )
397  call check( __line__, momy(k ,i,j-1) )
398 #endif
399  mflx_hi(k,i,j,zdir) = j13g(k,i,j,i_xyw) * 0.25_rp / mapf(i,j,2,i_xy) &
400  * ( momx(k+1,i,j)+momx(k+1,i-1,j) &
401  + momx(k ,i,j)+momx(k ,i-1,j) ) &
402  + j23g(k,i,j,i_xyw) * 0.25_rp / mapf(i,j,1,i_xy) &
403  * ( momy(k+1,i,j)+momy(k+1,i,j-1) &
404  + momy(k ,i,j)+momy(k ,i,j-1) ) &
405  + gsqrt(k,i,j,i_xyw) / ( mapf(i,j,1,i_xy)*mapf(i,j,2,i_xy) ) * num_diff(k,i,j,i_dens,zdir)
406  enddo
407  mflx_hi(ke ,i,j,zdir) = 0.0_rp
408  enddo
409  enddo
410 #ifdef DEBUG
411  k = iundef; i = iundef; j = iundef
412 #endif
413  profile_stop("hevi_mflx_z")
414 
415  profile_start("hevi_mflx_x")
416  iss = max(iis-1,is-ifs_off)
417  iee = min(iie,ieh)
418  ! at (u, y, z)
419  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
420  !$omp shared(JJS,JJE,iss,iee,KS,KE,GSQRT,I_UYZ,MOMX,num_diff,mflx_hi,MAPF,I_UY)
421  do j = jjs, jje
422  do i = iss, iee
423  do k = ks, ke
424 #ifdef DEBUG
425  call check( __line__, gsqrt(k,i,j,i_uyz) )
426  call check( __line__, momx(k,i,j) )
427  call check( __line__, num_diff(k,i,j,i_dens,xdir) )
428 #endif
429  mflx_hi(k,i,j,xdir) = gsqrt(k,i,j,i_uyz) / mapf(i,j,2,i_uy) &
430  * ( momx(k,i,j) + num_diff(k,i,j,i_dens,xdir) )
431  enddo
432  enddo
433  enddo
434 #ifdef DEBUG
435  k = iundef; i = iundef; j = iundef
436 #endif
437  profile_stop("hevi_mflx_x")
438 
439  ! at (x, v, z)
440  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
441  !$omp shared(JJS,JS,JFS_OFF,JJE,JEH,IIS,IIE,KS,KE,GSQRT,I_XVZ,MOMY,num_diff,mflx_hi,MAPF,I_XV)
442  do j = max(jjs-1,js-jfs_off), min(jje,jeh)
443  do i = iis, iie
444  do k = ks, ke
445 #ifdef DEBUG
446  call check( __line__, gsqrt(k,i,j,i_xvz) )
447  call check( __line__, momy(k,i,j) )
448  call check( __line__, num_diff(k,i,j,i_dens,ydir) )
449 #endif
450  mflx_hi(k,i,j,ydir) = gsqrt(k,i,j,i_xvz) / mapf(i,j,1,i_xv) &
451  * ( momy(k,i,j) + num_diff(k,i,j,i_dens,ydir) )
452  enddo
453  enddo
454  enddo
455 #ifdef DEBUG
456  k = iundef; i = iundef; j = iundef
457 #endif
458 
459  !--- update density
460  profile_start("hevi_sr")
461  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
462  !$omp private(i,j,k,advcv,advch) &
463 #ifdef HIST_TEND
464  !$omp shared(advcv_t,advch_t,lhist) &
465 #endif
466  !$omp shared(JJS,JJE,IIS,IIE,KS,KE) &
467  !$omp shared(DENS0,Sr,mflx_hi,DENS_t) &
468  !$omp shared(RCDZ,RCDX,RCDY,MAPF,GSQRT,I_XY,I_XYZ)
469  do j = jjs, jje
470  do i = iis, iie
471  do k = ks, ke
472 #ifdef DEBUG
473  call check( __line__, dens0(k,i,j) )
474  call check( __line__, mflx_hi(k ,i ,j ,xdir) )
475  call check( __line__, mflx_hi(k ,i-1,j ,xdir) )
476  call check( __line__, mflx_hi(k ,i ,j ,ydir) )
477  call check( __line__, mflx_hi(k ,i ,j-1,ydir) )
478  call check( __line__, dens_t(k,i,j) )
479 #endif
480  advcv = - ( mflx_hi(k,i,j,zdir)-mflx_hi(k-1,i ,j, zdir) ) * rcdz(k)
481  advch = - ( ( mflx_hi(k,i,j,xdir)-mflx_hi(k ,i-1,j, xdir) ) * rcdx(i) &
482  + ( mflx_hi(k,i,j,ydir)-mflx_hi(k ,i, j-1,ydir) ) * rcdy(j) ) &
483  * mapf(i,j,1,i_xy) * mapf(i,j,2,i_xy)
484  sr(k,i,j) = ( advcv + advch ) / gsqrt(k,i,j,i_xyz) + dens_t(k,i,j)
485 #ifdef HIST_TEND
486  if ( lhist ) then
487  advcv_t(k,i,j,i_dens) = advcv / gsqrt(k,i,j,i_xyz)
488  advch_t(k,i,j,i_dens) = advch / gsqrt(k,i,j,i_xyz)
489  end if
490 #endif
491  enddo
492  enddo
493  enddo
494 #ifdef DEBUG
495  k = iundef; i = iundef; j = iundef
496 #endif
497  profile_stop("hevi_sr")
498 
499  !##### momentum equation (z) #####
500 
501  ! at (x, y, z)
502  ! not that z-index is added by -1
503  profile_start("hevi_momz_qflxhi_z")
504  call atmos_dyn_fvm_fluxz_xyw( qflx_hi(:,:,:,zdir), & ! (out)
505  momz, momz, dens, & ! (in)
506  gsqrt(:,:,:,i_xyz), j33g, & ! (in)
507  num_diff(:,:,:,i_momz,zdir), & ! (in)
508  cdz, fdz, dtrk, &
509  iis, iie, jjs, jje ) ! (in)
510  profile_stop("hevi_momz_qflxhi_z")
511 
512  profile_start("hevi_momz_qflxj")
513  call atmos_dyn_fvm_fluxj13_xyw( qflx_j13, & ! (out)
514  momx, momz, dens, & ! (in)
515  gsqrt(:,:,:,i_xyz), j13g(:,:,:,i_xyz), mapf(:,:,:,i_xy), & ! (in)
516  cdz, &
517  iis, iie, jjs, jje ) ! (in)
518  call atmos_dyn_fvm_fluxj23_xyw( qflx_j23, & ! (out)
519  momy, momz, dens, & ! (in)
520  gsqrt(:,:,:,i_xyz), j23g(:,:,:,i_xyz), mapf(:,:,:,i_xy), & ! (in)
521  cdz, &
522  iis, iie, jjs, jje ) ! (in)
523  profile_stop("hevi_momz_qflxj")
524 
525  ! at (u, y, w)
526  profile_start("hevi_momz_qflxhi_x")
527  call atmos_dyn_fvm_fluxx_xyw( qflx_hi(:,:,:,xdir), & ! (out)
528  momx, momz, dens, & ! (in)
529  gsqrt(:,:,:,i_uyw), mapf(:,:,:,i_uy), & ! (in)
530  num_diff(:,:,:,i_momz,xdir), & ! (in)
531  cdz, & ! (in)
532  iis, iie, jjs, jje ) ! (in)
533  profile_stop("hevi_momz_qflxhi_x")
534 
535  ! at (x, v, w)
536  profile_start("hevi_momz_qflxhi_y")
537  call atmos_dyn_fvm_fluxy_xyw( qflx_hi(:,:,:,ydir), & ! (out)
538  momy, momz, dens, & ! (in)
539  gsqrt(:,:,:,i_xvw), mapf(:,:,:,i_xv), & ! (in)
540  num_diff(:,:,:,i_momz,ydir), & ! (in)
541  cdz, & ! (in)
542  iis, iie, jjs, jje ) ! (in)
543  profile_stop("hevi_momz_qflxhi_y")
544 
545  !--- update momentum(z)
546  profile_start("hevi_sw")
547  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
548  !$omp private(i,j,k,advcv,advch,cf,wdmp,div) &
549 #ifdef HIST_TEND
550  !$omp shared(lhist,advcv_t,advch_t,wdmp_t,ddiv_t) &
551 #endif
552  !$omp shared(JJS,JJE,IIS,IIE,KS,KE) &
553  !$omp shared(qflx_hi,qflx_J13,qflx_J23,DDIV,MOMZ0,MOMZ_t,Sw) &
554  !$omp shared(RFDZ,RCDX,RCDY,FDZ,dtrk,wdamp_coef,divdmp_coef) &
555  !$omp shared(MAPF,GSQRT,I_XY,I_XYW)
556  do j = jjs, jje
557  do i = iis, iie
558  do k = ks, ke-1
559 #ifdef DEBUG
560  call check( __line__, qflx_hi(k ,i ,j ,zdir) )
561  call check( __line__, qflx_hi(k-1,i ,j ,zdir) )
562  call check( __line__, qflx_j13(k ,i ,j) )
563  call check( __line__, qflx_j13(k-1,i ,j) )
564  call check( __line__, qflx_j23(k ,i ,j) )
565  call check( __line__, qflx_j23(k-1,i ,j) )
566  call check( __line__, qflx_hi(k ,i ,j ,xdir) )
567  call check( __line__, qflx_hi(k ,i-1,j ,xdir) )
568  call check( __line__, qflx_hi(k ,i ,j ,ydir) )
569  call check( __line__, qflx_hi(k ,i ,j-1,ydir) )
570  call check( __line__, ddiv(k ,i,j) )
571  call check( __line__, ddiv(k+1,i,j) )
572  call check( __line__, momz0(k,i,j) )
573  call check( __line__, momz_t(k,i,j) )
574 #endif
575  advcv = - ( qflx_hi(k,i,j,zdir) - qflx_hi(k-1,i ,j ,zdir) &
576  + qflx_j13(k,i,j) - qflx_j13(k-1,i ,j ) &
577  + qflx_j23(k,i,j) - qflx_j23(k-1,i ,j ) ) * rfdz(k)
578  advch = - ( ( qflx_hi(k,i,j,xdir) - qflx_hi(k,i-1,j ,xdir) ) * rcdx(i) &
579  + ( qflx_hi(k,i,j,ydir) - qflx_hi(k,i ,j-1,ydir) ) * rcdy(j) ) &
580  * mapf(i,j,1,i_xy) * mapf(i,j,2,i_xy)
581  wdmp = - wdamp_coef(k) * momz0(k,i,j)
582  div = divdmp_coef / dtrk * ( ddiv(k+1,i,j)-ddiv(k,i,j) ) * fdz(k) ! divergence damping
583  sw(k,i,j) = ( advcv + advch ) / gsqrt(k,i,j,i_xyw) &
584  + wdmp + div + momz_t(k,i,j)
585 #ifdef HIST_TEND
586  if ( lhist ) then
587  advcv_t(k,i,j,i_momz) = advcv / gsqrt(k,i,j,i_xyw)
588  advch_t(k,i,j,i_momz) = advch / gsqrt(k,i,j,i_xyw)
589  wdmp_t(k,i,j) = wdmp
590  ddiv_t(k,i,j,1) = div
591  endif
592 #endif
593  enddo
594  enddo
595  enddo
596  profile_stop("hevi_sw")
597 #ifdef DEBUG
598  k = iundef; i = iundef; j = iundef
599 #endif
600 
601 
602  !##### Thermodynamic Equation #####
603 
604  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
605  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,JHALO,IHALO,RHOT,DENS,POTT)
606  do j = jjs-jhalo, jje+jhalo
607  do i = iis-ihalo, iie+ihalo
608  do k = ks, ke
609 #ifdef DEBUG
610  call check( __line__, rhot(k,i,j) )
611  call check( __line__, dens(k,i,j) )
612 #endif
613  pott(k,i,j) = rhot(k,i,j) / dens(k,i,j)
614  enddo
615  enddo
616  enddo
617 #ifdef DEBUG
618  k = iundef; i = iundef; j = iundef
619 #endif
620 
621  ! at (x, y, w)
622  call atmos_dyn_fvm_fluxz_xyz( tflx_hi(:,:,:,zdir), & ! (out)
623  mflx_hi(:,:,:,zdir), pott, gsqrt(:,:,:,i_xyw), & ! (in)
624  num_diff(:,:,:,i_rhot,zdir), & ! (in)
625  cdz, & ! (in)
626  iis, iie, jjs, jje ) ! (in)
627 
628  ! at (u, y, z)
629  call atmos_dyn_fvm_fluxx_xyz( tflx_hi(:,:,:,xdir), & ! (out)
630  mflx_hi(:,:,:,xdir), pott, gsqrt(:,:,:,i_uyz), & ! (in)
631  num_diff(:,:,:,i_rhot,xdir), & ! (in)
632  cdz, & ! (in)
633  iis, iie, jjs, jje ) ! (in)
634 
635  ! at (x, v, z)
636  call atmos_dyn_fvm_fluxy_xyz( tflx_hi(:,:,:,ydir), & ! (out)
637  mflx_hi(:,:,:,ydir), pott, gsqrt(:,:,:,i_xvz), & ! (in)
638  num_diff(:,:,:,i_rhot,ydir), & ! (in)
639  cdz, & ! (in)
640  iis, iie, jjs, jje ) ! (in)
641 
642 
643  profile_start("hevi_st")
644  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
645  !$omp private(i,j,k,advcv,advch) &
646 #ifdef HIST_TEND
647  !$omp shared(lhist,advcv_t,advch_t) &
648 #endif
649  !$omp shared(JJS,JJE,IIS,IIE,KS,KE) &
650  !$omp shared(tflx_hi,RHOT_t,St,RCDZ,RCDX,RCDY) &
651  !$omp shared(MAPF,GSQRT,I_XY,I_XYZ)
652  do j = jjs, jje
653  do i = iis, iie
654  do k = ks, ke
655 #ifdef DEBUG
656  call check( __line__, tflx_hi(k ,i ,j ,zdir) )
657  call check( __line__, tflx_hi(k-1,i ,j ,zdir) )
658  call check( __line__, tflx_hi(k ,i ,j ,xdir) )
659  call check( __line__, tflx_hi(k ,i-1,j ,xdir) )
660  call check( __line__, tflx_hi(k ,i ,j ,ydir) )
661  call check( __line__, tflx_hi(k ,i ,j-1,ydir) )
662  call check( __line__, rhot_t(k,i,j) )
663 #endif
664  advcv = - ( tflx_hi(k,i,j,zdir) - tflx_hi(k-1,i ,j ,zdir) ) * rcdz(k)
665  advch = - ( ( tflx_hi(k,i,j,xdir) - tflx_hi(k ,i-1,j ,xdir) ) * rcdx(i) &
666  + ( tflx_hi(k,i,j,ydir) - tflx_hi(k ,i ,j-1,ydir) ) * rcdy(j) ) &
667  * mapf(i,j,1,i_xy) * mapf(i,j,2,i_xy)
668  st(k,i,j) = ( advcv + advch ) / gsqrt(k,i,j,i_xyz) + rhot_t(k,i,j)
669 #ifdef HIST_TEND
670  if ( lhist ) then
671  advcv_t(k,i,j,i_rhot) = advcv / gsqrt(k,i,j,i_xyz)
672  advch_t(k,i,j,i_rhot) = advch / gsqrt(k,i,j,i_xyz)
673  endif
674 #endif
675  enddo
676  enddo
677  enddo
678 #ifdef DEBUG
679  k = iundef; i = iundef; j = iundef
680 #endif
681  profile_stop("hevi_st")
682 
683  ! implicit solver
684 
685  profile_start("hevi_solver")
686 
687 !OCL INDEPENDENT
688 !OCL PREFETCH_SEQUENTIAL(SOFT)
689 #ifndef __GFORTRAN__
690  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
691  !$omp private(i,j,B,pg,advcv) &
692 #ifdef HIST_TEND
693  !$omp shared(lhist,pg_t,advcv_t) &
694 #endif
695 #ifdef DEBUG
696  !$omp shared(RHOT) &
697 #endif
698  !$omp shared(JJS,JJE,IIS,IIE,KS,KE) &
699  !$omp shared(mflx_hi,MOMZ_RK,MOMZ0) &
700  !$omp shared(DENS_RK,RHOT_RK,DENS0,RHOT0,DENS,MOMZ,PT,POTT,DPRES) &
701  !$omp shared(GRAV,dtrk,A,C,F1,F2,F3,REF_dens,Sr,Sw,St,RT2P) &
702  !$omp shared(ATMOS_DYN_FVM_flux_valueW_Z) &
703  !$omp shared(MAPF,GSQRT,J33G,I_XY,I_XYZ,I_XYW,CDZ,RCDZ,RFDZ)
704 #else
705  !$omp parallel do default(shared) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
706  !$omp private(B,pg,advcv)
707 #endif
708  do j = jjs, jje
709  do i = iis, iie
710 
711  call atmos_dyn_fvm_flux_valuew_z( pt(:,i,j), & ! (out)
712  momz(:,i,j), pott(:,i,j), gsqrt(:,i,j,i_xyz), & ! (in)
713  cdz )
714 
715  do k = ks, ke
716  a(k,i,j) = dtrk**2 * j33g * rcdz(k) * rt2p(k,i,j) * j33g / gsqrt(k,i,j,i_xyz)
717  enddo
718  b = grav * dtrk**2 * j33g / ( cdz(ks+1) + cdz(ks) )
719  f1(ks,i,j) = - ( pt(ks+1,i,j) * rfdz(ks) * a(ks+1,i,j) + b ) / gsqrt(ks,i,j,i_xyw)
720  f2(ks,i,j) = 1.0_rp + ( pt(ks ,i,j) * rfdz(ks) * ( a(ks+1,i,j)+a(ks,i,j) ) ) / gsqrt(ks,i,j,i_xyw)
721  do k = ks+1, ke-2
722  b = grav * dtrk**2 * j33g / ( cdz(k+1) + cdz(k) )
723  f1(k,i,j) = - ( pt(k+1,i,j) * rfdz(k) * a(k+1,i,j) + b ) / gsqrt(k,i,j,i_xyw)
724  f2(k,i,j) = 1.0_rp + ( pt(k ,i,j) * rfdz(k) * ( a(k+1,i,j)+a(k,i,j) ) ) / gsqrt(k,i,j,i_xyw)
725  f3(k,i,j) = - ( pt(k-1,i,j) * rfdz(k) * a(k,i,j) - b ) / gsqrt(k,i,j,i_xyw)
726  enddo
727  b = grav * dtrk**2 * j33g / ( cdz(ke) + cdz(ke-1) )
728  f2(ke-1,i,j) = 1.0_rp + ( pt(ke-1,i,j) * rfdz(ke-1) * ( a(ke,i,j)+a(ke-1,i,j) ) ) / gsqrt(ke-1,i,j,i_xyw)
729  f3(ke-1,i,j) = - ( pt(ke-2,i,j) * rfdz(ke-1) * a(ke-1,i,j) - b ) / gsqrt(ke-1,i,j,i_xyw)
730  do k = ks, ke-1
731  pg = - ( dpres(k+1,i,j) + rt2p(k+1,i,j)*dtrk*st(k+1,i,j) &
732  - dpres(k ,i,j) - rt2p(k ,i,j)*dtrk*st(k ,i,j) ) &
733  * rfdz(k) * j33g / gsqrt(k,i,j,i_xyw) &
734  - grav &
735  * ( f2h(k,1,i_xyz) * ( dens(k+1,i,j) - ref_dens(k+1,i,j) + sr(k+1,i,j) * dtrk ) &
736  + f2h(k,2,i_xyz) * ( dens(k ,i,j) - ref_dens(k ,i,j) + sr(k ,i,j) * dtrk ) )
737  c(k-ks+1,i,j) = momz(k,i,j) + dtrk * ( pg + sw(k,i,j) )
738 #ifdef HIST_TEND
739  if ( lhist ) pg_t(k,i,j,1) = pg
740 #endif
741  enddo
742 
743  call solve_direct( &
744  c(:,i,j), & ! (inout)
745  f1(:,i,j), f2(:,i,j), f3(:,i,j) ) ! (in)
746 
747  do k = ks, ke-1
748 #ifdef DEBUG_HEVI2HEVE
749  ! for debug (change to explicit integration)
750  c(k-ks+1,i,j) = momz(k,i,j)
751  mflx_hi(k,i,j,zdir) = mflx_hi(k,i,j,zdir) &
752  + j33g * momz(k,i,j) / ( mapf(i,j,1,i_xy) * mapf(i,j,2,i_xy) )
753  momz_rk(k,i,j) = momz0(k,i,j) &
754  + dtrk*( &
755  - j33g * ( dpres(k+1,i,j)-dpres(k,i,j) ) * rfdz(k) / gsqrt(k,i,j,i_xyw) &
756  - grav * ( f2h(k,2,i_xyz)*(dens(k,i,j)-ref_dens(k,i,j))+f2h(k,1,i_xyz)*(dens(k+1,i,j)-ref_dens(k+1,i,j)) ) &
757  + sw(k,i,j) )
758 #else
759  ! z-momentum flux
760  mflx_hi(k,i,j,zdir) = mflx_hi(k,i,j,zdir) &
761  + j33g * c(k-ks+1,i,j) / ( mapf(i,j,1,i_xy) * mapf(i,j,2,i_xy) )
762  ! z-momentum
763  momz_rk(k,i,j) = momz0(k,i,j) &
764  + ( c(k-ks+1,i,j) - momz(k,i,j) )
765 #endif
766  enddo
767  momz_rk(ks-1,i,j) = 0.0_rp
768  momz_rk(ke ,i,j) = 0.0_rp
769 
770  ! density and rho*theta
771  advcv = - c(1,i,j) * j33g * rcdz(ks) / gsqrt(ks,i,j,i_xyz) ! C(0) = 0
772  dens_rk(ks,i,j) = dens0(ks,i,j) + dtrk * ( advcv + sr(ks,i,j) )
773 #ifdef HIST_TEND
774  if ( lhist ) advcv_t(ks,i,j,i_dens) = advcv
775 #endif
776  advcv = - c(1,i,j)*pt(ks,i,j) * j33g * rcdz(ks) / gsqrt(ks,i,j,i_xyz) ! C(0) = 0
777  rhot_rk(ks,i,j) = rhot0(ks,i,j) + dtrk * ( advcv + st(ks,i,j) )
778 #ifdef HIST_TEND
779  if ( lhist ) advcv_t(ks,i,j,i_rhot) = advcv
780 #endif
781  do k = ks+1, ke-1
782  advcv = - ( c(k-ks+1,i,j) - c(k-ks,i,j) ) &
783  * j33g * rcdz(k) / gsqrt(k,i,j,i_xyz)
784  dens_rk(k,i,j) = dens0(k,i,j) + dtrk * ( advcv + sr(k,i,j) )
785 #ifdef HIST_TEND
786  if ( lhist ) advcv_t(k,i,j,i_dens) = advcv
787 #endif
788  advcv = - ( c(k-ks+1,i,j)*pt(k,i,j) - c(k-ks,i,j)*pt(k-1,i,j) ) &
789  * j33g * rcdz(k) / gsqrt(k,i,j,i_xyz)
790  rhot_rk(k,i,j) = rhot0(k,i,j) + dtrk * ( advcv + st(k,i,j) )
791 #ifdef HIST_TEND
792  if ( lhist ) advcv_t(k,i,j,i_rhot) = advcv
793 #endif
794  enddo
795  advcv = c(ke-ks,i,j) * j33g * rcdz(ke) / gsqrt(ke,i,j,i_xyz) ! C(KE-KS+1) = 0
796  dens_rk(ke,i,j) = dens0(ke,i,j) + dtrk * ( advcv + sr(ke,i,j) )
797 #ifdef HIST_TEND
798  if ( lhist ) advcv_t(ke,i,j,i_dens) = advcv
799 #endif
800  advcv = c(ke-ks,i,j) * pt(ke-1,i,j) * j33g * rcdz(ke) / gsqrt(ke,i,j,i_xyz) ! C(KE-KS+1) = 0
801  rhot_rk(ke,i,j) = rhot0(ke,i,j) + dtrk * ( advcv + st(ke,i,j) )
802 #ifdef HIST_TEND
803  if ( lhist ) advcv_t(ke,i,j,i_rhot) = advcv
804 #endif
805 
806 #ifdef DEBUG
807  call check_equation( &
808  c(:,i,j), &
809  dens(:,i,j), momz(:,i,j), rhot(:,i,j), dpres(:,i,j), &
810  ref_dens(:,i,j), &
811  sr(:,i,j), sw(:,i,j), st(:,i,j), &
812  j33g, gsqrt(:,i,j,:), &
813  rt2p(:,i,j), &
814  dtrk, i, j )
815 #endif
816 
817  enddo
818  enddo
819 #ifdef DEBUG
820  k = iundef; i = iundef; j = iundef
821 #endif
822 
823  profile_stop("hevi_solver")
824 
825 
826  !##### momentum equation (x) #####
827 
828  profile_start("hevi_momx")
829  ! at (u, y, w)
830  call atmos_dyn_fvm_fluxz_uyz( qflx_hi(:,:,:,zdir), & ! (out)
831  momz, momx, dens, & ! (in)
832  gsqrt(:,:,:,i_uyw), j33g, & ! (in)
833  num_diff(:,:,:,i_momx,zdir), & ! (in)
834  cdz, & ! (in)
835  iis, iie, jjs, jje ) ! (in)
836  call atmos_dyn_fvm_fluxj13_uyz( qflx_j13, & ! (out)
837  momx, momx, dens, & ! (in)
838  gsqrt(:,:,:,i_uyz), j13g(:,:,:,i_uyw), mapf(:,:,:,i_uy), & ! (in)
839  cdz, & ! (in)
840  iis, iie, jjs, jje ) ! (in)
841  call atmos_dyn_fvm_fluxj23_uyz( qflx_j23, & ! (out)
842  momy, momx, dens, & ! (in)
843  gsqrt(:,:,:,i_uyz), j23g(:,:,:,i_uyw), mapf(:,:,:,i_uy), & ! (in)
844  cdz, & ! (in)
845  iis, iie, jjs, jje ) ! (in)
846 
847  ! at (x, y, z)
848  ! note that x-index is added by -1
849  call atmos_dyn_fvm_fluxx_uyz( qflx_hi(:,:,:,xdir), & ! (out)
850  momx, momx, dens, & ! (in)
851  gsqrt(:,:,:,i_xyz), mapf(:,:,:,i_xy), & ! (in)
852  num_diff(:,:,:,i_momx,xdir), & ! (in)
853  cdz, & ! (in)
854  iis, iie, jjs, jje ) ! (in)
855 
856  ! at (u, v, z)
857  call atmos_dyn_fvm_fluxy_uyz( qflx_hi(:,:,:,ydir), & ! (out)
858  momy, momx, dens, & ! (in)
859  gsqrt(:,:,:,i_uvz), mapf(:,:,1,i_uv), & ! (in)
860  num_diff(:,:,:,i_momx,ydir), & ! (in)
861  cdz, & ! (in)
862  iis, iie, jjs, jje ) ! (in)
863 
864  !--- update momentum(x)
865  iee = min(iie,ieh)
866  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
867  !$omp private(i,j,k,advch,advcv,pg,cf,div) &
868 #ifdef HIST_TEND
869  !$omp shared(lhist,advch_t,advcv_t,pg_t,cf_t,ddiv_t) &
870 #endif
871  !$omp shared(JJS,JJE,IIS,iee,KS,KE) &
872  !$omp shared(MOMX_RK,DPRES,DENS,MOMX,MOMY,DDIV,MOMX0,MOMX_t) &
873  !$omp shared(qflx_hi,qflx_J13,qflx_J23) &
874  !$omp shared(RCDZ,RCDY,RFDX,CDZ,FDX) &
875  !$omp shared(MAPF,GSQRT,J13G,I_XY,I_UY,I_UV,I_XYZ,I_UYW,I_UYZ) &
876  !$omp shared(dtrk,CORIOLI,divdmp_coef)
877  do j = jjs, jje
878  do i = iis, iee
879  do k = ks, ke
880 #ifdef DEBUG
881  call check( __line__, qflx_hi(k ,i ,j ,zdir) )
882  call check( __line__, qflx_hi(k-1,i ,j ,zdir) )
883  call check( __line__, qflx_hi(k ,i ,j ,xdir) )
884  call check( __line__, qflx_hi(k ,i-1,j ,xdir) )
885  call check( __line__, qflx_hi(k ,i ,j ,ydir) )
886  call check( __line__, qflx_hi(k ,i ,j-1,ydir) )
887  call check( __line__, dpres(k,i+1,j) )
888  call check( __line__, dpres(k,i ,j) )
889  call check( __line__, corioli(1,i ,j) )
890  call check( __line__, corioli(1,i+1,j) )
891  call check( __line__, momy(k,i ,j ) )
892  call check( __line__, momy(k,i+1,j ) )
893  call check( __line__, momy(k,i ,j-1) )
894  call check( __line__, momy(k,i+1,j-1) )
895  call check( __line__, ddiv(k,i+1,j) )
896  call check( __line__, ddiv(k,i ,j) )
897  call check( __line__, momx0(k,i,j) )
898 #endif
899  advcv = - ( qflx_hi(k,i,j,zdir) - qflx_hi(k-1,i ,j ,zdir) &
900  + qflx_j13(k,i,j) - qflx_j13(k-1,i ,j ) &
901  + qflx_j23(k,i,j) - qflx_j23(k-1,i ,j ) ) * rcdz(k)
902  advch = - ( ( qflx_hi(k,i,j,xdir) - qflx_hi(k ,i-1,j ,xdir) ) * rfdx(i) &
903  + ( qflx_hi(k,i,j,ydir) - qflx_hi(k ,i ,j-1,ydir) ) * rcdy(j) ) &
904  * mapf(i,j,1,i_uy) * mapf(i,j,2,i_uy)
905  pg = ( ( gsqrt(k,i+1,j,i_xyz) * dpres(k,i+1,j) & ! [x,y,z]
906  - gsqrt(k,i ,j,i_xyz) * dpres(k,i ,j) & ! [x,y,z]
907  ) * rfdx(i) &
908  + ( j13g(k ,i,j,i_uyw) &
909  * 0.5_rp * ( f2h(k,1,i_uyz) * ( dpres(k+1,i+1,j)+dpres(k+1,i,j) ) &
910  + f2h(k,2,i_uyz) * ( dpres(k ,i+1,j)+dpres(k ,i,j) ) ) & ! [x,y,z->u,y,w]
911  - j13g(k-1,i,j,i_uyw) &
912  * 0.5_rp * ( f2h(k,1,i_uyz) * ( dpres(k ,i+1,j)+dpres(k ,i,j) ) &
913  + f2h(k,2,i_uyz) * ( dpres(k-1,i+1,j)+dpres(k-1,i,j) ) ) & ! [x,y,z->u,y,w]
914  ) * rcdz(k) ) &
915  * mapf(i,j,1,i_uy)
916  cf = 0.125_rp * ( corioli(1,i+1,j )+corioli(1,i,j ) ) & ! [x,y,z->u,y,z]
917  * ( momy(k,i+1,j )+momy(k,i,j ) &
918  + momy(k,i+1,j-1)+momy(k,i,j-1) ) & ! [x,v,z->u,y,z]
919  + 0.25_rp * mapf(i,j,1,i_uy) * mapf(i,j,2,i_uy) &
920  * ( momy(k,i,j) + momy(k,i,j-1) + momy(k,i+1,j) + momy(k,i+1,j-1) ) &
921  * ( ( momy(k,i,j) + momy(k,i,j-1) + momy(k,i+1,j) + momy(k,i+1,j-1) ) * 0.25_rp &
922  * ( 1.0_rp/mapf(i+1,j,2,i_xy) - 1.0_rp/mapf(i,j,2,i_xy) ) * rfdx(i) &
923  - momx(k,i,j) &
924  * ( 1.0_rp/mapf(i,j,1,i_uv) - 1.0_rp/mapf(i,j-1,1,i_uv) ) * rcdy(j) ) &
925  * 2.0_rp / ( dens(k,i+1,j) + dens(k,i,j) ) ! metric term
926  div = divdmp_coef / dtrk * ( ddiv(k,i+1,j)/mapf(i+1,j,2,i_xy) - ddiv(k,i,j)/mapf(i,j,1,i_xy) ) &
927  * mapf(i,j,1,i_uy) * mapf(i,j,2,i_uy) * fdx(i) ! divergence damping
928  momx_rk(k,i,j) = momx0(k,i,j) &
929  + dtrk * ( ( advcv + advch - pg ) / gsqrt(k,i,j,i_uyz) + cf + div + momx_t(k,i,j) )
930 #ifdef HIST_TEND
931  if ( lhist ) then
932  advcv_t(k,i,j,i_momx) = advcv / gsqrt(k,i,j,i_uyz)
933  advch_t(k,i,j,i_momx) = advch / gsqrt(k,i,j,i_uyz)
934  pg_t(k,i,j,2) = - pg / gsqrt(k,i,j,i_uyz)
935  cf_t(k,i,j,1) = cf
936  ddiv_t(k,i,j,2) = div
937  endif
938 #endif
939  enddo
940  enddo
941  enddo
942  profile_stop("hevi_momx")
943 #ifdef DEBUG
944  k = iundef; i = iundef; j = iundef
945 #endif
946 
947  !##### momentum equation (y) #####
948  profile_start("hevi_momy")
949  ! at (x, v, w)
950  call atmos_dyn_fvm_fluxz_xvz( qflx_hi(:,:,:,zdir), & ! (out)
951  momz, momy, dens, & ! (in)
952  gsqrt(:,:,:,i_xvw), j33g, & ! (in)
953  num_diff(:,:,:,i_momy,zdir), & ! (in)
954  cdz, & ! (in)
955  iis, iie, jjs, jje ) ! (in)
956  call atmos_dyn_fvm_fluxj13_xvz( qflx_j13, & ! (out)
957  momx, momy, dens, & ! (in)
958  gsqrt(:,:,:,i_xvz), j13g(:,:,:,i_xvw), mapf(:,:,:,i_xv), & ! (in)
959  cdz, & ! (in)
960  iis, iie, jjs, jje ) ! (in)
961  call atmos_dyn_fvm_fluxj23_xvz( qflx_j23, & ! (out)
962  momy, momy, dens, & ! (in)
963  gsqrt(:,:,:,i_xvz), j23g(:,:,:,i_xvw), mapf(:,:,:,i_xv), & ! (in)
964  cdz, & ! (in)
965  iis, iie, jjs, jje ) ! (in)
966 
967  ! at (u, v, z)
968  call atmos_dyn_fvm_fluxx_xvz( qflx_hi(:,:,:,xdir), & ! (out)
969  momx, momy, dens, & ! (in)
970  gsqrt(:,:,:,i_uvz), mapf(:,:,:,i_uv), & ! (in)
971  num_diff(:,:,:,i_momy,xdir), & ! (in)
972  cdz, & ! (in)
973  iis, iie, jjs, jje ) ! (in)
974 
975  ! at (x, y, z)
976  ! note that y-index is added by -1
977  call atmos_dyn_fvm_fluxy_xvz( qflx_hi(:,:,:,ydir), & ! (out)
978  momy, momy, dens, & ! (in)
979  gsqrt(:,:,:,i_xyz), mapf(:,:,:,i_xy), & ! (in)
980  num_diff(:,:,:,i_momy,ydir), & ! (in
981  cdz, & ! (in)
982  iis, iie, jjs, jje ) ! (in)
983 
984  !--- update momentum(y)
985  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
986  !$omp private(i,j,k,advch,advcv,pg,cf,div) &
987 #ifdef HIST_TEND
988  !$omp shared(lhist,advch_t,advcv_t,pg_t,cf_t,ddiv_t) &
989 #endif
990  !$omp shared(JJS,JJE,JEH,IIS,IIE,KS,KE) &
991  !$omp shared(MOMY_RK,DPRES,DENS,MOMX,MOMY,DDIV,MOMY0,MOMY_t) &
992  !$omp shared(qflx_hi,qflx_J13,qflx_J23) &
993  !$omp shared(RCDZ,RCDX,RFDY,CDZ,FDY) &
994  !$omp shared(MAPF,GSQRT,J23G,I_XY,I_XV,I_UV,I_XYZ,I_XVW,I_XVZ) &
995  !$omp shared(dtrk,CORIOLI,divdmp_coef)
996  do j = jjs, min(jje,jeh)
997  do i = iis, iie
998  do k = ks, ke
999 #ifdef DEBUG
1000  call check( __line__, qflx_hi(k ,i ,j ,zdir) )
1001  call check( __line__, qflx_hi(k-1,i ,j ,zdir) )
1002  call check( __line__, qflx_hi(k ,i ,j ,xdir) )
1003  call check( __line__, qflx_hi(k ,i-1,j ,xdir) )
1004  call check( __line__, qflx_hi(k ,i ,j ,ydir) )
1005  call check( __line__, qflx_hi(k ,i ,j-1,ydir) )
1006  call check( __line__, dpres(k,i,j ) )
1007  call check( __line__, dpres(k,i,j+1) )
1008  call check( __line__, corioli(1,i,j ) )
1009  call check( __line__, corioli(1,i,j+1) )
1010  call check( __line__, momx(k,i ,j ) )
1011  call check( __line__, momx(k,i ,j+1) )
1012  call check( __line__, momx(k,i-1,j ) )
1013  call check( __line__, momx(k,i-1,j+1) )
1014  call check( __line__, ddiv(k,i,j+1) )
1015  call check( __line__, ddiv(k,i,j ) )
1016  call check( __line__, momy_t(k,i,j) )
1017  call check( __line__, momy0(k,i,j) )
1018 #endif
1019  advcv = - ( qflx_hi(k,i,j,zdir) - qflx_hi(k-1,i ,j ,zdir) &
1020  + qflx_j13(k,i,j) - qflx_j13(k-1,i ,j ) &
1021  + qflx_j23(k,i,j) - qflx_j23(k-1,i ,j ) ) * rcdz(k)
1022  advch = - ( ( qflx_hi(k,i,j,xdir) - qflx_hi(k ,i-1,j ,xdir) ) * rcdx(i) &
1023  + ( qflx_hi(k,i,j,ydir) - qflx_hi(k ,i ,j-1,ydir) ) * rfdy(j) ) &
1024  * mapf(i,j,1,i_xv) * mapf(i,j,2,i_xv)
1025  pg = ( ( gsqrt(k,i,j+1,i_xyz) * dpres(k,i,j+1) & ! [x,y,z]
1026  - gsqrt(k,i,j ,i_xyz) * dpres(k,i,j ) & ! [x,y,z]
1027  ) * rfdy(j) &
1028  + ( j23g(k ,i,j,i_xvw) &
1029  * 0.5_rp * ( f2h(k ,1,i_xvz) * ( dpres(k+1,i,j+1)+dpres(k+1,i,j) ) &
1030  + f2h(k ,2,i_xvz) * ( dpres(k ,i,j+1)+dpres(k ,i,j) ) ) & ! [x,y,z->x,v,w]
1031  - j23g(k-1,i,j,i_xvw) &
1032  * 0.5_rp * ( f2h(k-1,1,i_xvz) * ( dpres(k ,i,j+1)+dpres(k ,i,j) ) &
1033  + f2h(k-1,2,i_xvz) * ( dpres(k-1,i,j+1)+dpres(k-1,i,j) ) ) & ! [x,y,z->x,v,w]
1034  ) * rcdz(k) ) &
1035  * mapf(i,j,2,i_xv)
1036  cf = - 0.125_rp * ( corioli(1,i ,j+1)+corioli(1,i ,j) ) & ! [x,y,z->x,v,z]
1037  * ( momx(k,i ,j+1)+momx(k,i ,j) &
1038  + momx(k,i-1,j+1)+momx(k,i-1,j) ) & ! [u,y,z->x,v,z]
1039  - 0.25_rp * mapf(i,j,1,i_xv) * mapf(i,j,2,i_xv) &
1040  * ( momx(k,i,j) + momx(k,i-1,j) + momx(k,i,j+1) + momx(k,i-1,j+1) ) &
1041  * ( momy(k,i,j) &
1042  * ( 1.0_rp/mapf(i,j,2,i_uv) - 1.0_rp/mapf(i-1,j,2,i_uv) ) * rcdx(i) &
1043  - 0.25_rp * ( momx(k,i,j)+momx(k,i-1,j)+momx(k,i,j+1)+momx(k,i-1,j+1) ) &
1044  * ( 1.0_rp/mapf(i,j+1,1,i_xy) - 1.0_rp/mapf(i,j,1,i_xy) ) * rfdy(j) ) &
1045  * 2.0_rp / ( dens(k,i,j+1) + dens(k,i,j) ) ! metoric term
1046  div = divdmp_coef / dtrk * ( ddiv(k,i,j+1)/mapf(i,j+1,1,i_xy) - ddiv(k,i,j)/mapf(i,j,1,i_xy) ) &
1047  * mapf(i,j,1,i_xv) * mapf(i,j,2,i_xv) * fdy(j) ! divergence damping
1048  momy_rk(k,i,j) = momy0(k,i,j) &
1049  + dtrk * ( ( advcv + advch - pg ) / gsqrt(k,i,j,i_xvz) + cf + div + momy_t(k,i,j) )
1050 #ifdef HIST_TEND
1051  if ( lhist ) then
1052  advcv_t(k,i,j,i_momy) = advcv / gsqrt(k,i,j,i_xvz)
1053  advch_t(k,i,j,i_momy) = advch / gsqrt(k,i,j,i_xvz)
1054  pg_t(k,i,j,3) = - pg / gsqrt(k,i,j,i_xvz)
1055  cf_t(k,i,j,2) = cf
1056  ddiv_t(k,i,j,3) = div
1057  endif
1058 #endif
1059  enddo
1060  enddo
1061  enddo
1062  profile_stop("hevi_momy")
1063 #ifdef DEBUG
1064  k = iundef; i = iundef; j = iundef
1065 #endif
1066 
1067  enddo
1068  enddo
1069 
1070 #ifdef PROFILE_FIPP
1071  call fipp_stop()
1072 #endif
1073 
1074 #ifdef HIST_TEND
1075  if ( lhist ) then
1076  call hist_in(advcv_t(:,:,:,i_dens), 'DENS_t_advcv', 'tendency of density (vert. advection)', 'kg/m3/s' )
1077  call hist_in(advcv_t(:,:,:,i_momz), 'MOMZ_t_advcv', 'tendency of momentum z (vert. advection)', 'kg/m2/s2', zdim='half')
1078  call hist_in(advcv_t(:,:,:,i_momx), 'MOMX_t_advcv', 'tendency of momentum x (vert. advection)', 'kg/m2/s2', xdim='half')
1079  call hist_in(advcv_t(:,:,:,i_momy), 'MOMY_t_advcv', 'tendency of momentum y (vert. advection)', 'kg/m2/s2', ydim='half')
1080  call hist_in(advcv_t(:,:,:,i_rhot), 'RHOT_t_advcv', 'tendency of rho*theta (vert. advection)', 'K kg/m3/s' )
1081 
1082  call hist_in(advch_t(:,:,:,i_dens), 'DENS_t_advch', 'tendency of density (horiz. advection)', 'kg/m3/s' )
1083  call hist_in(advch_t(:,:,:,i_momz), 'MOMZ_t_advch', 'tendency of momentum z (horiz. advection)', 'kg/m2/s2', zdim='half')
1084  call hist_in(advch_t(:,:,:,i_momx), 'MOMX_t_advch', 'tendency of momentum x (horiz. advection)', 'kg/m2/s2', xdim='half')
1085  call hist_in(advch_t(:,:,:,i_momy), 'MOMY_t_advch', 'tendency of momentum y (horiz. advection)', 'kg/m2/s2', ydim='half')
1086  call hist_in(advch_t(:,:,:,i_rhot), 'RHOT_t_advch', 'tendency of rho*theta (horiz. advection)', 'K kg/m3/s' )
1087 
1088  call hist_in(pg_t(:,:,:,1), 'MOMZ_t_pg', 'tendency of momentum z (pressure gradient)', 'kg/m2/s2', zdim='half')
1089  call hist_in(pg_t(:,:,:,2), 'MOMX_t_pg', 'tendency of momentum x (pressure gradient)', 'kg/m2/s2', xdim='half')
1090  call hist_in(pg_t(:,:,:,3), 'MOMY_t_pg', 'tendency of momentum y (pressure gradient)', 'kg/m2/s2', ydim='half')
1091 
1092  call hist_in(wdmp_t(:,:,:), 'MOMZ_t_wdamp', 'tendency of momentum z (Rayleigh damping)', 'kg/m2/s2', zdim='half')
1093 
1094  call hist_in(ddiv_t(:,:,:,1), 'MOMZ_t_ddiv', 'tendency of momentum z (divergence damping)', 'kg/m2/s2', zdim='half')
1095  call hist_in(ddiv_t(:,:,:,2), 'MOMX_t_ddiv', 'tendency of momentum x (divergence damping)', 'kg/m2/s2', xdim='half')
1096  call hist_in(ddiv_t(:,:,:,3), 'MOMY_t_ddiv', 'tendency of momentum y (divergence damping)', 'kg/m2/s2', ydim='half')
1097 
1098  call hist_in(cf_t(:,:,:,1), 'MOMX_t_cf', 'tendency of momentum x (coliolis force)', 'kg/m2/s2', xdim='half')
1099  call hist_in(cf_t(:,:,:,2), 'MOMY_t_cf', 'tendency of momentum y (coliolis force)', 'kg/m2/s2', ydim='half')
1100  endif
1101 #endif
1102 
1103  end subroutine atmos_dyn_tstep_short_fvm_hevi
1104 
1105 !OCL SERIAL
1106  subroutine solve_direct( &
1107  C, & ! (inout)
1108  f1, f2, f3 ) ! (in)
1110  use scale_process, only: &
1111  prc_mpistop
1112  implicit none
1113  real(RP), intent(inout) :: C(KMAX-1)
1114  real(RP), intent(in) :: F1(KA)
1115  real(RP), intent(in) :: F2(KA)
1116  real(RP), intent(in) :: F3(KA)
1117 
1118  real(RP) :: e(KMAX-2)
1119  real(RP) :: f(KMAX-2)
1120 
1121  real(RP) :: rdenom
1122 
1123  integer :: k
1124 
1125  rdenom = 1.0_rp / f2(ks)
1126  e(1) = - f1(ks) * rdenom
1127  f(1) = c(1) * rdenom
1128  do k = 2, kmax-2
1129  rdenom = 1.0_rp / ( f2(k+ks-1) + f3(k+ks-1) * e(k-1) )
1130  e(k) = - f1(k+ks-1) * rdenom
1131  f(k) = ( c(k) - f3(k+ks-1) * f(k-1) ) * rdenom
1132  enddo
1133 
1134  ! C = \rho w
1135  c(kmax-1) = ( c(kmax-1) - f3(ke-1) * f(kmax-2) ) &
1136  / ( f2(ke-1) + f3(ke-1) * e(kmax-2) ) ! C(KMAX-1) = f(KMAX-1)
1137  do k = kmax-2, 1, -1
1138  c(k) = e(k) * c(k+1) + f(k)
1139  enddo
1140 
1141  return
1142  end subroutine solve_direct
1143 
1144 #ifdef DEBUG
1145  subroutine check_equation( &
1146  VECT, &
1147  DENS, MOMZ, RHOT, DPRES, &
1148  REF_dens, &
1149  Sr, Sw, St, &
1150  J33G, G, &
1151  RT2P, &
1152  dt, i, j )
1153  use scale_const, only: &
1154  eps => const_eps, &
1155  grav => const_grav
1156  use scale_process, only: &
1157  prc_mpistop
1158  use scale_grid, only: &
1159  rcdz => grid_rcdz, &
1160  rfdz => grid_rfdz
1161  use scale_gridtrans, only: &
1162  i_xyz, &
1163  i_xyw
1164  implicit none
1165  real(RP), intent(in) :: VECT(KMAX-1)
1166  real(RP), intent(in) :: DENS(KA)
1167  real(RP), intent(in) :: MOMZ(KA)
1168  real(RP), intent(in) :: RHOT(KA)
1169  real(RP), intent(in) :: DPRES(KA)
1170  real(RP), intent(in) :: REF_dens(KA)
1171  real(RP), intent(in) :: Sr(KA)
1172  real(RP), intent(in) :: Sw(KA)
1173  real(RP), intent(in) :: St(KA)
1174  real(RP), intent(in) :: J33G
1175  real(RP), intent(in) :: G(KA,8)
1176  real(RP), intent(in) :: RT2P(KA)
1177  real(RP), intent(in) :: dt
1178  integer , intent(in) :: i
1179  integer , intent(in) :: j
1180 
1181  real(RP), parameter :: small = 1e-6_rp
1182 
1183  real(RP) :: MOMZ_N(KA)
1184  real(RP) :: DENS_N(KA)
1185  real(RP) :: RHOT_N(KA)
1186  real(RP) :: DPRES_N(KA)
1187 
1188  real(RP) :: POTT(KA)
1189  real(RP) :: PT(KA)
1190 
1191  real(RP) :: error, lhs, rhs
1192  integer :: k
1193 
1194 
1195  do k = ks, ke-1
1196  momz_n(k) = vect(k-ks+1)
1197  enddo
1198  momz_n(:ks-1) = 0.0_rp
1199  momz_n(ke:) = 0.0_rp
1200 
1201  ! density
1202  do k = ks+1, ke-1
1203  dens_n(k) = dens(k) &
1204  + dt * ( - j33g * ( momz_n(k) - momz_n(k-1) ) * rcdz(k) / g(k,i_xyz) + sr(k) )
1205  enddo
1206  dens_n(ks) = dens(ks) &
1207  + dt * ( - j33g * momz_n(ks) * rcdz(ks) / g(ks,i_xyz) + sr(ks) )
1208  dens_n(ke) = dens(ke) &
1209  + dt * ( j33g * momz_n(ke-1) * rcdz(ke) / g(ke,i_xyz) + sr(ke) )
1210 
1211  ! rho*theta
1212  do k = ks, ke
1213  pott(k) = rhot(k) / dens(k)
1214  enddo
1215  do k = ks+1, ke-2
1216  pt(k) = ( 7.0_rp * ( pott(k+1) + pott(k ) ) &
1217  - ( pott(k+2) + pott(k-1) ) ) / 12.0_rp
1218  enddo
1219  pt(ks-1) = 0.0_rp
1220  pt(ks ) = ( pott(ks+1) + pott(ks ) ) * 0.5_rp
1221  pt(ke-1) = ( pott(ke ) + pott(ke-1) ) * 0.5_rp
1222  pt(ke ) = 0.0_rp
1223  do k = ks+1, ke-1
1224  rhot_n(k) = rhot(k) &
1225  + dt * ( - j33g * ( momz_n(k)*pt(k) - momz_n(k-1)*pt(k-1) ) * rcdz(k) / g(k,i_xyz) &
1226  + st(k) )
1227  enddo
1228  rhot_n(ks) = rhot(ks) &
1229  + dt * ( - j33g * momz_n(ks)*pt(ks) * rcdz(ks) / g(ks,i_xyz) + st(ks) )
1230  rhot_n(ke) = rhot(ke) &
1231  + dt * ( j33g * momz_n(ke-1)*pt(ke-1) * rcdz(ke) / g(ke-1,i_xyz) + st(ke) )
1232 
1233 
1234  do k = ks, ke
1235  dpres_n(k) = dpres(k) + rt2p(k) * ( rhot_n(k) - rhot(k) )
1236  enddo
1237 
1238  do k = ks, ke
1239  lhs = ( dens_n(k) - dens(k) ) / dt
1240  rhs = - j33g * ( momz_n(k) - momz_n(k-1) ) * rcdz(k) / g(k,i_xyz) + sr(k)
1241  if ( abs(lhs) < small ) then
1242  error = rhs
1243  else
1244  error = ( lhs - rhs ) / lhs
1245  endif
1246  if ( abs(error) > small ) then
1247  write(*,*)"HEVI: DENS error", k, i, j, error, lhs, rhs
1248  write(*,*)eps
1249  call prc_mpistop
1250  endif
1251  enddo
1252 
1253  do k = ks, ke-1
1254  lhs = ( momz_n(k) - momz(k) ) / dt
1255  rhs = - j33g * ( dpres_n(k+1) - dpres_n(k) ) * rfdz(k) / g(k,i_xyw) &
1256  - grav * ( dens_n(k+1) - ref_dens(k+1) + dens_n(k) - ref_dens(k) ) * 0.5_rp &
1257  + sw(k)
1258  if ( abs(lhs) < small ) then
1259  error = rhs
1260  else
1261  error = ( lhs - rhs ) / lhs
1262  endif
1263  if ( abs(error) > small ) then
1264  write(*,*)"HEVI: MOMZ error", k, i, j, error, lhs, rhs
1265  write(*,*) momz_n(k), momz(k), dt
1266  write(*,*) - j33g * ( dpres(k+1) - dpres(k) ) * rfdz(k) / g(k,i_xyw) &
1267  - grav * ( dens(k+1) -ref_dens(k+1) + dens(k) -ref_dens(k) ) * 0.5_rp &
1268  + sw(k)
1269  call prc_mpistop
1270  endif
1271  enddo
1272 
1273  do k = ks, ke
1274  lhs = ( rhot_n(k) - rhot(k) ) / dt
1275  rhs = - j33g * ( momz_n(k)*pt(k) - momz_n(k-1)*pt(k-1) ) * rcdz(k) / g(k,i_xyz) + st(k)
1276  if ( abs(lhs) < small ) then
1277  error = rhs
1278  else
1279  error = ( lhs - rhs ) / lhs
1280  endif
1281  if ( abs(error) > small ) then
1282  write(*,*)"HEVI: RHOT error", k, i, j, error, lhs, rhs
1283  call prc_mpistop
1284  endif
1285  enddo
1286 
1287  return
1288  end subroutine check_equation
1289 #endif
1290 
integer, parameter, public i_rhot
Definition: scale_index.F90:35
integer, public is
start point of inner domain: x, local
module DEBUG
Definition: scale_debug.F90:13
integer, public i_xvz
integer, public je
end point of inner domain: y, local
subroutine, public prc_mpistop
Abort MPI.
integer, public va
Definition: scale_index.F90:38
subroutine, public atmos_dyn_tstep_short_fvm_hevi_regist(ATMOS_DYN_TYPE, VA_out, VAR_NAME, VAR_DESC, VAR_UNIT)
Register.
procedure(flux_mom), pointer, public atmos_dyn_fvm_fluxx_xvz
procedure(flux_j), pointer, public atmos_dyn_fvm_fluxj23_uyz
integer, public iblock
block size for cache blocking: x
integer, parameter, public i_momx
Definition: scale_index.F90:33
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:61
integer, parameter, public zdir
integer, parameter, public i_momz
Definition: scale_index.F90:32
procedure(flux_j), pointer, public atmos_dyn_fvm_fluxj23_xyw
procedure(flux_phi), pointer, public atmos_dyn_fvm_fluxx_xyz
module STDIO
Definition: scale_stdio.F90:12
integer, parameter, public ydir
integer, public ke
end point of inner domain: z, local
procedure(flux_j), pointer, public atmos_dyn_fvm_fluxj13_xyw
integer, parameter, public xdir
integer, public i_xy
subroutine, public check(current_line, v)
Undefined value checker.
Definition: scale_debug.F90:58
real(rp), dimension(:), allocatable, public grid_rcdz
reciprocal of center-dz
integer, parameter, public i_dens
Definition: scale_index.F90:31
integer, parameter, public i_momy
Definition: scale_index.F90:34
integer, public i_xvw
real(rp), public const_undef
Definition: scale_const.F90:43
procedure(flux_mom), pointer, public atmos_dyn_fvm_fluxx_xyw
module grid index
procedure(flux_mom), pointer, public atmos_dyn_fvm_fluxy_xyw
module TRACER
module Index
Definition: scale_index.F90:14
integer, public ia
of whole cells: x, local, with HALO
procedure(flux_z), pointer, public atmos_dyn_fvm_fluxz_xvz
module GRIDTRANS
integer, public ka
of whole cells: z, local, with HALO
integer, public i_uy
integer, public jblock
block size for cache blocking: y
integer, public i_xyw
integer, public kmax
of computational cells: z, local
integer, public jhalo
of halo cells: 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
integer, parameter, public const_undef2
undefined value (INT2)
Definition: scale_const.F90:40
module Atmosphere / Dynamics common
module PROCESS
integer, public i_uyw
procedure(valuew), pointer, public atmos_dyn_fvm_flux_valuew_z
module CONSTANT
Definition: scale_const.F90:14
integer, public ks
start point of inner domain: z, local
procedure(flux_j), pointer, public atmos_dyn_fvm_fluxj13_xvz
integer, public jeh
end point of inner domain: y, local (half level)
integer, public ieh
end point of inner domain: x, local (half level)
module GRID (cartesian)
integer, public i_xv
module profiler
Definition: scale_prof.F90:10
integer, public ie
end point of inner domain: x, local
real(rp), public const_eps
small number
Definition: scale_const.F90:36
procedure(flux_z), pointer, public atmos_dyn_fvm_fluxz_uyz
subroutine, public atmos_dyn_tstep_short_fvm_hevi(DENS_RK, MOMZ_RK, MOMX_RK, MOMY_RK, RHOT_RK, PROG_RK, mflx_hi, tflx_hi, DENS0, MOMZ0, MOMX0, MOMY0, RHOT0, DENS, MOMZ, MOMX, MOMY, RHOT, DENS_t, MOMZ_t, MOMX_t, MOMY_t, RHOT_t, PROG0, PROG, DPRES0, RT2P, CORIOLI, num_diff, wdamp_coef, divdmp_coef, DDIV, FLAG_FCT_MOMENTUM, FLAG_FCT_T, FLAG_FCT_ALONG_STREAM, CDZ, FDZ, FDX, FDY, RCDZ, RCDX, RCDY, RFDZ, RFDX, RFDY, PHI, GSQRT, J13G, J23G, J33G, MAPF, REF_dens, REF_rhot, BND_W, BND_E, BND_S, BND_N, dtrk, last)
module scale_atmos_dyn_fvm_flux
integer, public i_uyz
module PRECISION
subroutine, public atmos_dyn_fct(qflx_anti, phi_in, DENS0, DENS, qflx_hi, qflx_lo, mflx_hi, rdz, rdx, rdy, GSQRT, MAPF, dt, flag_vect)
Flux Correction Transport Limiter.
module HISTORY
procedure(flux_j), pointer, public atmos_dyn_fvm_fluxj13_uyz
procedure(flux_j), pointer, public atmos_dyn_fvm_fluxj23_xvz
real(rp), dimension(:), allocatable, public grid_rfdz
reciprocal of face-dz
integer, public i_uvz
integer, public i_xyz
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56
integer, public i_uv
procedure(flux_phi), pointer, public atmos_dyn_fvm_fluxz_xyz
procedure(flux_mom), pointer, public atmos_dyn_fvm_fluxx_uyz
procedure(flux_phi), pointer, public atmos_dyn_fvm_fluxy_xyz
procedure(flux_mom), pointer, public atmos_dyn_fvm_fluxy_uyz
procedure(flux_wz), pointer, public atmos_dyn_fvm_fluxz_xyw
integer, public ihalo
of halo cells: x
procedure(flux_mom), pointer, public atmos_dyn_fvm_fluxy_xvz
integer, public ja
of whole cells: y, local, with HALO