SCALE-RM
Functions/Subroutines
scale_atmos_dyn_fvm_flux_ud1 Module Reference

module scale_atmos_dyn_fvm_flux_ud1 More...

Functions/Subroutines

subroutine, public atmos_dyn_fvm_flux_valuew_z_ud1 (valW, mflx, val, GSQRT, CDZ)
 value at XYW More...
 
subroutine, public atmos_dyn_fvm_fluxz_xyz_ud1 (flux, mflx, val, GSQRT, num_diff, CDZ, IIS, IIE, JJS, JJE)
 calculation z-flux at XYZ More...
 
subroutine, public atmos_dyn_fvm_fluxx_xyz_ud1 (flux, mflx, val, GSQRT, num_diff, CDZ, IIS, IIE, JJS, JJE)
 calculation X-flux at XYZ More...
 
subroutine, public atmos_dyn_fvm_fluxy_xyz_ud1 (flux, mflx, val, GSQRT, num_diff, CDZ, IIS, IIE, JJS, JJE)
 calculation Y-flux at XYZ More...
 
subroutine, public atmos_dyn_fvm_fluxz_xyw_ud1 (flux, mom, val, DENS, GSQRT, J33G, num_diff, CDZ, FDZ, dtrk, IIS, IIE, JJS, JJE)
 calculation z-flux at XYW More...
 
subroutine, public atmos_dyn_fvm_fluxj13_xyw_ud1 (flux, mom, val, DENS, GSQRT, J13G, MAPF, CDZ, TwoD, IIS, IIE, JJS, JJE)
 calculation J13-flux at XYW More...
 
subroutine, public atmos_dyn_fvm_fluxj23_xyw_ud1 (flux, mom, val, DENS, GSQRT, J23G, MAPF, CDZ, TwoD, IIS, IIE, JJS, JJE)
 calculation J23-flux at XYW More...
 
subroutine, public atmos_dyn_fvm_fluxx_xyw_ud1 (flux, mom, val, DENS, GSQRT, MAPF, num_diff, CDZ, TwoD, IIS, IIE, JJS, JJE)
 calculation X-flux at XYW More...
 
subroutine, public atmos_dyn_fvm_fluxy_xyw_ud1 (flux, mom, val, DENS, GSQRT, MAPF, num_diff, CDZ, TwoD, IIS, IIE, JJS, JJE)
 calculation Y-flux at XYW More...
 
subroutine, public atmos_dyn_fvm_fluxz_uyz_ud1 (flux, mom, val, DENS, GSQRT, J33G, num_diff, CDZ, TwoD, IIS, IIE, JJS, JJE)
 calculation z-flux at UY More...
 
subroutine, public atmos_dyn_fvm_fluxj13_uyz_ud1 (flux, mom, val, DENS, GSQRT, J13G, MAPF, CDZ, TwoD, IIS, IIE, JJS, JJE)
 calculation J13-flux at UYZ More...
 
subroutine, public atmos_dyn_fvm_fluxj23_uyz_ud1 (flux, mom, val, DENS, GSQRT, J23G, MAPF, CDZ, TwoD, IIS, IIE, JJS, JJE)
 calculation J23-flux at UYZ More...
 
subroutine, public atmos_dyn_fvm_fluxx_uyz_ud1 (flux, mom, val, DENS, GSQRT, MAPF, num_diff, CDZ, TwoD, IIS, IIE, JJS, JJE)
 calculation X-flux at UY More...
 
subroutine, public atmos_dyn_fvm_fluxy_uyz_ud1 (flux, mom, val, DENS, GSQRT, MAPF, num_diff, CDZ, TwoD, IIS, IIE, JJS, JJE)
 calculation Y-flux at UY More...
 
subroutine, public atmos_dyn_fvm_fluxz_xvz_ud1 (flux, mom, val, DENS, GSQRT, J33G, num_diff, CDZ, TwoD, IIS, IIE, JJS, JJE)
 calculation z-flux at XV More...
 
subroutine, public atmos_dyn_fvm_fluxj13_xvz_ud1 (flux, mom, val, DENS, GSQRT, J13G, MAPF, CDZ, TwoD, IIS, IIE, JJS, JJE)
 calculation J13-flux at XVZ More...
 
subroutine, public atmos_dyn_fvm_fluxj23_xvz_ud1 (flux, mom, val, DENS, GSQRT, J23G, MAPF, CDZ, TwoD, IIS, IIE, JJS, JJE)
 calculation J23-flux at XVZ More...
 
subroutine, public atmos_dyn_fvm_fluxx_xvz_ud1 (flux, mom, val, DENS, GSQRT, MAPF, num_diff, CDZ, TwoD, IIS, IIE, JJS, JJE)
 calculation X-flux at XV More...
 
subroutine, public atmos_dyn_fvm_fluxy_xvz_ud1 (flux, mom, val, DENS, GSQRT, MAPF, num_diff, CDZ, TwoD, IIS, IIE, JJS, JJE)
 calculation Y-flux at XV More...
 

Detailed Description

module scale_atmos_dyn_fvm_flux_ud1

Description
FVM flux scheme with the ud1 order
Author
Team SCALE

Function/Subroutine Documentation

◆ atmos_dyn_fvm_flux_valuew_z_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_flux_valuew_z_ud1 ( real(rp), dimension (ka), intent(out)  valW,
real(rp), dimension (ka), intent(in)  mflx,
real(rp), dimension (ka), intent(in)  val,
real(rp), dimension(ka), intent(in)  GSQRT,
real(rp), dimension (ka), intent(in)  CDZ 
)

value at XYW

Definition at line 101 of file scale_atmos_dyn_fvm_flux_ud1.F90.

101  !$acc routine vector
102  implicit none
103 
104  real(RP), intent(out) :: valW (KA)
105  real(RP), intent(in) :: mflx (KA)
106  real(RP), intent(in) :: val (KA)
107  real(RP), intent(in) :: GSQRT(KA)
108  real(RP), intent(in) :: CDZ (KA)
109 
110  integer :: k
111  !---------------------------------------------------------------------------
112 
113  do k = ks, ke-1
114 #ifdef DEBUG
115  call check( __line__, mflx(k) )
116 
117  call check( __line__, val(k) )
118  call check( __line__, val(k+1) )
119 
120 #endif
121  valw(k) = f1 * ( val(k+1)+val(k) ) - sign(f1,mflx(k)) * ( val(k+1)-val(k) )
122  enddo
123 #ifdef DEBUG
124  k = iundef
125 #endif
126 
127 #ifdef DEBUG
128 
129 #endif
130 
131 
132  return

References scale_debug::check(), scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxz_xyz_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxz_xyz_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mflx,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), dimension(ka,ia,ja), intent(in)  num_diff,
real(rp), dimension (ka), intent(in)  CDZ,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation z-flux at XYZ

Definition at line 143 of file scale_atmos_dyn_fvm_flux_ud1.F90.

143  use scale_const, only: &
144  eps => const_eps
145  implicit none
146 
147  real(RP), intent(inout) :: flux (KA,IA,JA)
148  real(RP), intent(in) :: mflx (KA,IA,JA)
149  real(RP), intent(in) :: val (KA,IA,JA)
150  real(RP), intent(in) :: GSQRT (KA,IA,JA)
151  real(RP), intent(in) :: num_diff(KA,IA,JA)
152  real(RP), intent(in) :: CDZ (KA)
153  integer, intent(in) :: IIS, IIE, JJS, JJE
154 
155  real(RP) :: vel
156  integer :: k, i, j
157  !---------------------------------------------------------------------------
158 
159  !$omp parallel default(none) private(i,j,k, vel) &
160  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mflx,val,flux,GSQRT,num_diff,EPS)
161 
162  !$acc data copy(flux) copyin(mflx, val, GSQRT, num_diff, CDZ)
163 
164  !$omp do OMP_SCHEDULE_ collapse(2)
165  !$acc kernels
166  do j = jjs, jje
167  do i = iis, iie
168  do k = ks, ke-1
169 #ifdef DEBUG
170  call check( __line__, mflx(k,i,j) )
171 
172  call check( __line__, val(k,i,j) )
173  call check( __line__, val(k+1,i,j) )
174 
175 #endif
176  vel = mflx(k,i,j)
177  flux(k,i,j) = vel &
178  * ( f1 * ( val(k+1,i,j)+val(k,i,j) ) - sign(f1,vel) * ( val(k+1,i,j)-val(k,i,j) ) )
179  enddo
180  enddo
181  enddo
182  !$acc end kernels
183  !$omp end do nowait
184 #ifdef DEBUG
185  k = iundef; i = iundef; j = iundef
186 #endif
187 
188  !$omp do OMP_SCHEDULE_ collapse(2)
189  !$acc kernels
190  do j = jjs, jje
191  do i = iis, iie
192 #ifdef DEBUG
193 
194 #endif
195  flux(ks-1,i,j) = 0.0_rp
196 
197  flux(ke ,i,j) = 0.0_rp
198  enddo
199  enddo
200  !$acc end kernels
201  !$omp end do nowait
202 
203  !$acc end data
204 
205  !$omp end parallel
206 #ifdef DEBUG
207  k = iundef; i = iundef; j = iundef
208 #endif
209 
210  return

References scale_debug::check(), scale_const::const_eps, scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup(), scale_atmos_dyn_tstep_short_fvm_heve::atmos_dyn_tstep_short_fvm_heve(), and scale_atmos_dyn_tstep_tracer_fvm_heve::atmos_dyn_tstep_tracer_fvm_heve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxx_xyz_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxx_xyz_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mflx,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), dimension(ka,ia,ja), intent(in)  num_diff,
real(rp), dimension(ka), intent(in)  CDZ,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation X-flux at XYZ

Definition at line 221 of file scale_atmos_dyn_fvm_flux_ud1.F90.

221  implicit none
222 
223  real(RP), intent(inout) :: flux (KA,IA,JA)
224  real(RP), intent(in) :: mflx (KA,IA,JA)
225  real(RP), intent(in) :: val (KA,IA,JA)
226  real(RP), intent(in) :: GSQRT (KA,IA,JA)
227  real(RP), intent(in) :: num_diff(KA,IA,JA)
228  real(RP), intent(in) :: CDZ(KA)
229  integer, intent(in) :: IIS, IIE, JJS, JJE
230 
231  real(RP) :: vel
232  integer :: k, i, j
233  !---------------------------------------------------------------------------
234 
235  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
236  !$omp private(vel) &
237  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mflx,val,flux,GSQRT,num_diff)
238  !$acc kernels
239  do j = jjs, jje
240  do i = iis-1, iie
241  do k = ks, ke
242 #ifdef DEBUG
243  call check( __line__, mflx(k,i,j) )
244 
245  call check( __line__, val(k,i,j) )
246  call check( __line__, val(k,i+1,j) )
247 
248 #endif
249  vel = mflx(k,i,j)
250  flux(k,i,j) = vel &
251  * ( f1 * ( val(k,i+1,j)+val(k,i,j) ) - sign(f1,vel) * ( val(k,i+1,j)-val(k,i,j) ) )
252  enddo
253  enddo
254  enddo
255  !$acc end kernels
256 #ifdef DEBUG
257  k = iundef; i = iundef; j = iundef
258 #endif
259 
260  return

References scale_debug::check(), scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup(), scale_atmos_dyn_tstep_short_fvm_heve::atmos_dyn_tstep_short_fvm_heve(), and scale_atmos_dyn_tstep_tracer_fvm_heve::atmos_dyn_tstep_tracer_fvm_heve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxy_xyz_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxy_xyz_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mflx,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), dimension(ka,ia,ja), intent(in)  num_diff,
real(rp), dimension(ka), intent(in)  CDZ,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation Y-flux at XYZ

Definition at line 271 of file scale_atmos_dyn_fvm_flux_ud1.F90.

271  implicit none
272 
273  real(RP), intent(inout) :: flux (KA,IA,JA)
274  real(RP), intent(in) :: mflx (KA,IA,JA)
275  real(RP), intent(in) :: val (KA,IA,JA)
276  real(RP), intent(in) :: GSQRT (KA,IA,JA)
277  real(RP), intent(in) :: num_diff(KA,IA,JA)
278  real(RP), intent(in) :: CDZ(KA)
279  integer, intent(in) :: IIS, IIE, JJS, JJE
280 
281  real(RP) :: vel
282  integer :: k, i, j
283  !---------------------------------------------------------------------------
284 
285  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
286  !$omp private(vel) &
287  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mflx,val,flux,GSQRT,num_diff)
288  !$acc kernels
289  do j = jjs-1, jje
290  do i = iis, iie
291  do k = ks, ke
292 #ifdef DEBUG
293  call check( __line__, mflx(k,i,j) )
294 
295  call check( __line__, val(k,i,j) )
296  call check( __line__, val(k,i,j+1) )
297 
298 #endif
299  vel = mflx(k,i,j)
300  flux(k,i,j) = vel &
301  * ( f1 * ( val(k,i,j+1)+val(k,i,j) ) - sign(f1,vel) * ( val(k,i,j+1)-val(k,i,j) ) )
302  enddo
303  enddo
304  enddo
305  !$acc end kernels
306 #ifdef DEBUG
307  k = iundef; i = iundef; j = iundef
308 #endif
309 
310  return

References scale_debug::check(), scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup(), scale_atmos_dyn_tstep_short_fvm_heve::atmos_dyn_tstep_short_fvm_heve(), and scale_atmos_dyn_tstep_tracer_fvm_heve::atmos_dyn_tstep_tracer_fvm_heve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxz_xyw_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxz_xyw_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mom,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), intent(in)  J33G,
real(rp), dimension(ka,ia,ja), intent(in)  num_diff,
real(rp), dimension (ka), intent(in)  CDZ,
real(rp), dimension (ka-1), intent(in)  FDZ,
real(rp), intent(in)  dtrk,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation z-flux at XYW

Definition at line 324 of file scale_atmos_dyn_fvm_flux_ud1.F90.

324  implicit none
325 
326  real(RP), intent(inout) :: flux (KA,IA,JA)
327  real(RP), intent(in) :: mom (KA,IA,JA)
328  real(RP), intent(in) :: val (KA,IA,JA)
329  real(RP), intent(in) :: DENS (KA,IA,JA)
330  real(RP), intent(in) :: GSQRT (KA,IA,JA)
331  real(RP), intent(in) :: J33G
332  real(RP), intent(in) :: num_diff(KA,IA,JA)
333  real(RP), intent(in) :: CDZ (KA)
334  real(RP), intent(in) :: FDZ (KA-1)
335  real(RP), intent(in) :: dtrk
336  integer, intent(in) :: IIS, IIE, JJS, JJE
337 
338  real(RP) :: vel
339  integer :: k, i, j
340  !---------------------------------------------------------------------------
341 
342  ! note than z-index is added by -1
343 
344  !$omp parallel default(none) private(i,j,k,vel) &
345  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,flux,J33G,GSQRT,num_diff,DENS,FDZ,dtrk)
346 
347  !$acc data copy(flux) copyin(mom, val, DENS, GSQRT, num_diff, CDZ, FDZ)
348 
349  !$omp do OMP_SCHEDULE_ collapse(2)
350  !$acc kernels
351  do j = jjs, jje
352  do i = iis, iie
353  do k = ks+1, ke-1
354 #ifdef DEBUG
355  call check( __line__, mom(k-1,i,j) )
356  call check( __line__, mom(k ,i,j) )
357 
358  call check( __line__, val(k-1,i,j) )
359  call check( __line__, val(k,i,j) )
360 
361 #endif
362  vel = ( 0.5_rp * ( mom(k-1,i,j) &
363  + mom(k,i,j) ) ) &
364  / dens(k,i,j)
365  flux(k-1,i,j) = j33g * vel &
366  * ( f1 * ( val(k,i,j)+val(k-1,i,j) ) - sign(f1,vel) * ( val(k,i,j)-val(k-1,i,j) ) )
367  enddo
368  enddo
369  enddo
370  !$acc end kernels
371  !$omp end do nowait
372 #ifdef DEBUG
373  k = iundef; i = iundef; j = iundef
374 #endif
375 
376  !$omp do OMP_SCHEDULE_ collapse(2)
377  !$acc kernels
378  do j = jjs, jje
379  do i = iis, iie
380 #ifdef DEBUG
381 
382 
383 #endif
384  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS.
385  ! The flux at KS can be non-zero.
386  ! To reduce calculations, all the fluxes are set to zero.
387  flux(ks-1,i,j) = 0.0_rp ! k = KS
388 
389 
390 
391  flux(ke-1,i,j) = 0.0_rp ! k = KE
392  flux(ke ,i,j) = 0.0_rp ! k = KE+1
393  enddo
394  enddo
395  !$acc end kernels
396  !$omp end do nowait
397 
398  !$acc end data
399 
400  !$omp end parallel
401 
402  return

References scale_debug::check(), scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup(), and scale_atmos_dyn_tstep_short_fvm_heve::atmos_dyn_tstep_short_fvm_heve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxj13_xyw_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxj13_xyw_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mom,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), dimension (ka,ia,ja), intent(in)  J13G,
real(rp), dimension ( ia,ja,2), intent(in)  MAPF,
real(rp), dimension (ka), intent(in)  CDZ,
logical, intent(in)  TwoD,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation J13-flux at XYW

Definition at line 414 of file scale_atmos_dyn_fvm_flux_ud1.F90.

414  implicit none
415 
416  real(RP), intent(inout) :: flux (KA,IA,JA)
417  real(RP), intent(in) :: mom (KA,IA,JA)
418  real(RP), intent(in) :: val (KA,IA,JA)
419  real(RP), intent(in) :: DENS (KA,IA,JA)
420  real(RP), intent(in) :: GSQRT (KA,IA,JA)
421  real(RP), intent(in) :: J13G (KA,IA,JA)
422  real(RP), intent(in) :: MAPF ( IA,JA,2)
423  real(RP), intent(in) :: CDZ (KA)
424  logical, intent(in) :: TwoD
425  integer, intent(in) :: IIS, IIE, JJS, JJE
426 
427  real(RP) :: vel
428  integer :: k, i, j
429  !---------------------------------------------------------------------------
430 
431  !$omp parallel default(none) private(i,j,k,vel) &
432  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J13G,MAPF)
433 
434  !$acc data copy(flux) copyin(mom, val, DENS, GSQRT, J13G, MAPF, CDZ)
435 
436  !$omp do OMP_SCHEDULE_ collapse(2)
437  !$acc kernels
438  do j = jjs, jje
439  do i = iis, iie
440  do k = ks+2, ke-1
441  vel = ( 0.5_rp * ( mom(k,i,j)+mom(k,i-1,j) ) ) &
442  / dens(k,i,j)
443  vel = vel * j13g(k,i,j)
444  flux(k-1,i,j) = vel / mapf(i,j,+2) &
445  * ( f1 * ( val(k,i,j)+val(k-1,i,j) ) - sign(f1,vel) * ( val(k,i,j)-val(k-1,i,j) ) )
446  enddo
447  enddo
448  enddo
449  !$acc end kernels
450  !$omp end do nowait
451 
452  !$omp do OMP_SCHEDULE_ collapse(2)
453  !$acc kernels
454  do j = jjs, jje
455  do i = iis, iie
456  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS.
457  ! The flux at KS can be non-zero.
458  ! To reduce calculations, all the fluxes are set to zero.
459  flux(ks-1,i,j) = 0.0_rp ! k = KS
460 
461  ! physically incorrect but for numerical stability
462  vel = ( ( 0.5_rp * ( mom(ks+1,i,j)+mom(ks+1,i-1,j) ) ) / dens(ks+1,i,j) &
463  + ( 0.5_rp * ( mom(ks,i,j)+mom(ks,i-1,j) ) ) / dens(ks ,i,j) ) * 0.5_rp
464 ! vel = ( 0.5_RP * ( mom(KS+1,i,j)+mom(KS+1,i-1,j) ) ) &
465 ! / DENS(KS+1,i,j)
466  vel = vel * j13g(ks+1,i,j)
467  flux(ks,i,j) = vel / mapf(i,j,+2) &
468  * ( val(ks,i,j) &
469  * ( 0.5_rp + sign(0.5_rp,vel) ) &
470  + ( 2.0_rp * val(ks,i,j) + 5.0_rp * val(ks+1,i,j) - val(ks+2,i,j) ) / 6.0_rp &
471  * ( 0.5_rp - sign(0.5_rp,vel) ) ) ! k = KS+1
472 
473 
474  flux(ke-1,i,j) = 0.0_rp
475  enddo
476  enddo
477  !$acc end kernels
478  !$omp end do nowait
479 
480  !$acc end data
481 
482  !$omp end parallel
483 
484  return

References scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxj23_xyw_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxj23_xyw_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mom,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), dimension (ka,ia,ja), intent(in)  J23G,
real(rp), dimension ( ia,ja,2), intent(in)  MAPF,
real(rp), dimension (ka), intent(in)  CDZ,
logical, intent(in)  TwoD,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation J23-flux at XYW

Definition at line 495 of file scale_atmos_dyn_fvm_flux_ud1.F90.

495  implicit none
496 
497  real(RP), intent(inout) :: flux (KA,IA,JA)
498  real(RP), intent(in) :: mom (KA,IA,JA)
499  real(RP), intent(in) :: val (KA,IA,JA)
500  real(RP), intent(in) :: DENS (KA,IA,JA)
501  real(RP), intent(in) :: GSQRT (KA,IA,JA)
502  real(RP), intent(in) :: J23G (KA,IA,JA)
503  real(RP), intent(in) :: MAPF ( IA,JA,2)
504  real(RP), intent(in) :: CDZ (KA)
505  logical, intent(in) :: TwoD
506  integer, intent(in) :: IIS, IIE, JJS, JJE
507 
508  real(RP) :: vel
509  integer :: k, i, j
510  !---------------------------------------------------------------------------
511 
512  !$omp parallel default(none) private(i,j,k,vel) &
513  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J23G,MAPF)
514 
515  !$acc data copy(flux) copyin(mom, val, DENS, GSQRT, J23G, MAPF, CDZ)
516 
517  !$omp do OMP_SCHEDULE_ collapse(2)
518  !$acc kernels
519  do j = jjs, jje
520  do i = iis, iie
521  do k = ks+2, ke-1
522  vel = ( 0.5_rp * ( mom(k,i,j)+mom(k,i,j-1) ) ) &
523  / dens(k,i,j)
524  vel = vel * j23g(k,i,j)
525  flux(k-1,i,j) = vel / mapf(i,j,+1) &
526  * ( f1 * ( val(k,i,j)+val(k-1,i,j) ) - sign(f1,vel) * ( val(k,i,j)-val(k-1,i,j) ) )
527  enddo
528  enddo
529  enddo
530  !$acc end kernels
531  !$omp end do nowait
532 
533  !$omp do OMP_SCHEDULE_ collapse(2)
534  !$acc kernels
535  do j = jjs, jje
536  do i = iis, iie
537  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS.
538  ! The flux at KS can be non-zero.
539  ! To reduce calculations, all the fluxes are set to zero.
540  flux(ks-1,i,j) = 0.0_rp ! k = KS
541 
542  ! physically incorrect but for numerical stability
543  vel = ( ( 0.5_rp * ( mom(ks+1,i,j)+mom(ks+1,i,j-1) ) ) / dens(ks+1,i,j) &
544  + ( 0.5_rp * ( mom(ks,i,j)+mom(ks,i,j-1) ) ) / dens(ks ,i,j) ) * 0.5_rp
545 ! vel = ( 0.5_RP * ( mom(KS+1,i,j)+mom(KS+1,i,j-1) ) ) &
546 ! / DENS(KS+1,i,j)
547  vel = vel * j23g(ks+1,i,j)
548  flux(ks,i,j) = vel / mapf(i,j,+1) &
549  * ( val(ks,i,j) &
550  * ( 0.5_rp + sign(0.5_rp,vel) ) &
551  + ( 2.0_rp * val(ks,i,j) + 5.0_rp * val(ks+1,i,j) - val(ks+2,i,j) ) / 6.0_rp &
552  * ( 0.5_rp - sign(0.5_rp,vel) ) ) ! k = KS+1
553 
554 
555  flux(ke-1,i,j) = 0.0_rp
556  enddo
557  enddo
558  !$acc end kernels
559  !$omp end do nowait
560 
561  !$acc end data
562 
563  !$omp end parallel
564 
565  return

References scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxx_xyw_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxx_xyw_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mom,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), dimension ( ia,ja,2), intent(in)  MAPF,
real(rp), dimension(ka,ia,ja), intent(in)  num_diff,
real(rp), dimension (ka), intent(in)  CDZ,
logical, intent(in)  TwoD,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation X-flux at XYW

Definition at line 578 of file scale_atmos_dyn_fvm_flux_ud1.F90.

578  implicit none
579 
580  real(RP), intent(inout) :: flux (KA,IA,JA)
581  real(RP), intent(in) :: mom (KA,IA,JA)
582  real(RP), intent(in) :: val (KA,IA,JA)
583  real(RP), intent(in) :: DENS (KA,IA,JA)
584  real(RP), intent(in) :: GSQRT (KA,IA,JA)
585  real(RP), intent(in) :: MAPF ( IA,JA,2)
586  real(RP), intent(in) :: num_diff(KA,IA,JA)
587  real(RP), intent(in) :: CDZ (KA)
588  logical, intent(in) :: TwoD
589  integer, intent(in) :: IIS, IIE, JJS, JJE
590 
591  real(RP) :: vel
592  integer :: k, i, j
593  !---------------------------------------------------------------------------
594 
595  !$omp parallel default(none) private(i,j,k,vel) &
596  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,GSQRT,MAPF,num_diff) &
597  !$omp shared(CDZ)
598 
599  !$acc data copy(flux) copyin(mom, val, DENS, GSQRT, MAPF, num_diff, CDZ)
600 
601  !$omp do OMP_SCHEDULE_ collapse(2)
602  !$acc kernels
603  do j = jjs, jje
604  do i = iis-1, iie
605  do k = ks, ke-1
606 #ifdef DEBUG
607  call check( __line__, mom(k ,i,j) )
608  call check( __line__, mom(k+1,i,j) )
609 
610  call check( __line__, val(k,i,j) )
611  call check( __line__, val(k,i+1,j) )
612 
613 #endif
614  vel = ( f2h(k,1,i_uyz) &
615  * mom(k+1,i,j) &
616  + f2h(k,2,i_uyz) &
617  * mom(k,i,j) ) &
618  / ( f2h(k,1,i_uyz) &
619  * 0.5_rp * ( dens(k+1,i,j)+dens(k+1,i+1,j) ) &
620  + f2h(k,2,i_uyz) &
621  * 0.5_rp * ( dens(k,i,j)+dens(k,i+1,j) ) )
622  flux(k,i,j) = gsqrt(k,i,j) / mapf(i,j,+2) * vel &
623  * ( f1 * ( val(k,i+1,j)+val(k,i,j) ) - sign(f1,vel) * ( val(k,i+1,j)-val(k,i,j) ) )
624  enddo
625  enddo
626  enddo
627  !$acc end kernels
628  !$omp end do nowait
629 #ifdef DEBUG
630  k = iundef; i = iundef; j = iundef
631 #endif
632 
633  !$omp do OMP_SCHEDULE_ collapse(2)
634  !$acc kernels
635  do j = jjs, jje
636  do i = iis-1, iie
637  flux(ke,i,j) = 0.0_rp
638  enddo
639  enddo
640  !$acc end kernels
641  !$omp end do nowait
642 
643  !$acc end data
644 
645  !$omp end parallel
646 #ifdef DEBUG
647  k = iundef; i = iundef; j = iundef
648 #endif
649 
650  return

References scale_debug::check(), scale_atmos_grid_cartesc_index::i_uyz, scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup(), and scale_atmos_dyn_tstep_short_fvm_heve::atmos_dyn_tstep_short_fvm_heve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxy_xyw_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxy_xyw_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mom,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), dimension ( ia,ja,2), intent(in)  MAPF,
real(rp), dimension(ka,ia,ja), intent(in)  num_diff,
real(rp), dimension (ka), intent(in)  CDZ,
logical, intent(in)  TwoD,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation Y-flux at XYW

Definition at line 662 of file scale_atmos_dyn_fvm_flux_ud1.F90.

662  implicit none
663 
664  real(RP), intent(inout) :: flux (KA,IA,JA)
665  real(RP), intent(in) :: mom (KA,IA,JA)
666  real(RP), intent(in) :: val (KA,IA,JA)
667  real(RP), intent(in) :: DENS (KA,IA,JA)
668  real(RP), intent(in) :: GSQRT (KA,IA,JA)
669  real(RP), intent(in) :: MAPF ( IA,JA,2)
670  real(RP), intent(in) :: num_diff(KA,IA,JA)
671  real(RP), intent(in) :: CDZ (KA)
672  logical, intent(in) :: TwoD
673  integer, intent(in) :: IIS, IIE, JJS, JJE
674 
675  real(RP) :: vel
676  integer :: k, i, j
677  !---------------------------------------------------------------------------
678 
679  !$omp parallel default(none) private(i,j,k,vel) &
680  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,GSQRT,MAPF,num_diff) &
681  !$omp shared(CDZ)
682 
683  !$acc data copy(flux) copyin(mom, val, DENS, GSQRT, MAPF, num_diff, CDZ)
684 
685  !$omp do OMP_SCHEDULE_ collapse(2)
686  !$acc kernels
687  do j = jjs-1, jje
688  do i = iis, iie
689  do k = ks, ke-1
690 #ifdef DEBUG
691  call check( __line__, mom(k ,i,j) )
692  call check( __line__, mom(k+1,i,j) )
693 
694  call check( __line__, val(k,i,j) )
695  call check( __line__, val(k,i,j+1) )
696 
697 #endif
698  vel = ( f2h(k,1,i_xvz) &
699  * mom(k+1,i,j) &
700  + f2h(k,2,i_xvz) &
701  * mom(k,i,j) ) &
702  / ( f2h(k,1,i_xvz) &
703  * 0.5_rp * ( dens(k+1,i,j)+dens(k+1,i,j+1) ) &
704  + f2h(k,2,i_xvz) &
705  * 0.5_rp * ( dens(k,i,j)+dens(k,i,j+1) ) )
706  flux(k,i,j) = gsqrt(k,i,j) / mapf(i,j,+1) * vel &
707  * ( f1 * ( val(k,i,j+1)+val(k,i,j) ) - sign(f1,vel) * ( val(k,i,j+1)-val(k,i,j) ) )
708  enddo
709  enddo
710  enddo
711  !$acc end kernels
712  !$omp end do nowait
713 #ifdef DEBUG
714  k = iundef; i = iundef; j = iundef
715 #endif
716 
717  !$omp do OMP_SCHEDULE_ collapse(2)
718  !$acc kernels
719  do j = jjs-1, jje
720  do i = iis, iie
721  flux(ke,i,j) = 0.0_rp
722  enddo
723  enddo
724  !$acc end kernels
725  !$omp end do nowait
726 
727  !$acc end data
728 
729  !$omp end parallel
730 #ifdef DEBUG
731  k = iundef; i = iundef; j = iundef
732 #endif
733 
734  return

References scale_debug::check(), scale_atmos_grid_cartesc_index::i_xvz, scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup(), and scale_atmos_dyn_tstep_short_fvm_heve::atmos_dyn_tstep_short_fvm_heve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxz_uyz_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxz_uyz_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mom,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), intent(in)  J33G,
real(rp), dimension(ka,ia,ja), intent(in)  num_diff,
real(rp), dimension (ka), intent(in)  CDZ,
logical, intent(in)  TwoD,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation z-flux at UY

Definition at line 747 of file scale_atmos_dyn_fvm_flux_ud1.F90.

747  implicit none
748 
749  real(RP), intent(inout) :: flux (KA,IA,JA)
750  real(RP), intent(in) :: mom (KA,IA,JA)
751  real(RP), intent(in) :: val (KA,IA,JA)
752  real(RP), intent(in) :: DENS (KA,IA,JA)
753  real(RP), intent(in) :: GSQRT (KA,IA,JA)
754  real(RP), intent(in) :: J33G
755  real(RP), intent(in) :: num_diff(KA,IA,JA)
756  real(RP), intent(in) :: CDZ (KA)
757  logical, intent(in) :: TwoD
758  integer, intent(in) :: IIS, IIE, JJS, JJE
759 
760  real(RP) :: vel
761  integer :: k, i, j
762  !---------------------------------------------------------------------------
763 
764  !$omp parallel default(none) private(i,j,k,vel) &
765  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J33G,GSQRT,num_diff) &
766  !$omp shared(CDZ,TwoD)
767 
768  !$acc data copy(flux) copyin(mom, val, DENS, GSQRT, num_diff, CDZ)
769 
770 
771  if ( twod ) then
772 
773  !$omp do OMP_SCHEDULE_
774  !$acc kernels
775  do j = jjs, jje
776  do k = ks, ke-1
777  i = iis
778 #ifdef DEBUG
779  call check( __line__, mom(k,i,j) )
780 
781  call check( __line__, val(k,i,j) )
782  call check( __line__, val(k+1,i,j) )
783 
784 #endif
785  vel = ( mom(k,i,j) ) &
786  / ( f2h(k,1,i_xyz) &
787  * dens(k+1,i,j) &
788  + f2h(k,2,i_xyz) &
789  * dens(k,i,j) )
790  flux(k,i,j) = j33g * vel &
791  * ( f1 * ( val(k+1,i,j)+val(k,i,j) ) - sign(f1,vel) * ( val(k+1,i,j)-val(k,i,j) ) )
792  enddo
793  enddo
794  !$acc end kernels
795  !$omp end do nowait
796 #ifdef DEBUG
797  k = iundef; i = iundef; j = iundef
798 #endif
799 
800  !$omp do OMP_SCHEDULE_
801  !$acc kernels
802  do j = jjs, jje
803  i = iis
804 #ifdef DEBUG
805 
806 #endif
807  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS-1.
808  ! The flux at KS-1 can be non-zero.
809  ! To reduce calculations, all the fluxes are set to zero.
810  flux(ks-1,i,j) = 0.0_rp
811 
812  flux(ke,i,j) = 0.0_rp
813  enddo
814  !$acc end kernels
815  !$omp end do nowait
816 
817  else
818 
819 
820  !$omp do OMP_SCHEDULE_ collapse(2)
821  !$acc kernels
822  do j = jjs, jje
823  do i = iis, iie
824  do k = ks, ke-1
825 #ifdef DEBUG
826  call check( __line__, mom(k,i,j) )
827  call check( __line__, mom(k,i+1,j) )
828 
829  call check( __line__, val(k,i,j) )
830  call check( __line__, val(k+1,i,j) )
831 
832 #endif
833  vel = ( 0.5_rp * ( mom(k,i,j)+mom(k,i+1,j) ) ) &
834  / ( f2h(k,1,i_uyz) &
835  * 0.5_rp * ( dens(k+1,i,j)+dens(k+1,i+1,j) ) &
836  + f2h(k,2,i_uyz) &
837  * 0.5_rp * ( dens(k,i,j)+dens(k,i+1,j) ) )
838  flux(k,i,j) = j33g * vel &
839  * ( f1 * ( val(k+1,i,j)+val(k,i,j) ) - sign(f1,vel) * ( val(k+1,i,j)-val(k,i,j) ) )
840  enddo
841  enddo
842  enddo
843  !$acc end kernels
844  !$omp end do nowait
845 #ifdef DEBUG
846  k = iundef; i = iundef; j = iundef
847 #endif
848 
849  !$omp do OMP_SCHEDULE_ collapse(2)
850  !$acc kernels
851  do j = jjs, jje
852  do i = iis, iie
853 #ifdef DEBUG
854 
855 #endif
856  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS-1.
857  ! The flux at KS-1 can be non-zero.
858  ! To reduce calculations, all the fluxes are set to zero.
859  flux(ks-1,i,j) = 0.0_rp
860 
861  flux(ke,i,j) = 0.0_rp
862  enddo
863  enddo
864  !$acc end kernels
865  !$omp end do nowait
866 
867  end if
868 
869 
870  !$acc end data
871 
872  !$omp end parallel
873 #ifdef DEBUG
874  k = iundef; i = iundef; j = iundef
875 #endif
876 
877  return

References scale_debug::check(), scale_atmos_grid_cartesc_index::i_uyz, scale_atmos_grid_cartesc_index::i_xyz, scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup(), and scale_atmos_dyn_tstep_short_fvm_heve::atmos_dyn_tstep_short_fvm_heve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxj13_uyz_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxj13_uyz_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mom,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), dimension (ka,ia,ja), intent(in)  J13G,
real(rp), dimension ( ia,ja,2), intent(in)  MAPF,
real(rp), dimension (ka), intent(in)  CDZ,
logical, intent(in)  TwoD,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation J13-flux at UYZ

Definition at line 888 of file scale_atmos_dyn_fvm_flux_ud1.F90.

888  implicit none
889 
890  real(RP), intent(inout) :: flux (KA,IA,JA)
891  real(RP), intent(in) :: mom (KA,IA,JA)
892  real(RP), intent(in) :: val (KA,IA,JA)
893  real(RP), intent(in) :: DENS (KA,IA,JA)
894  real(RP), intent(in) :: GSQRT (KA,IA,JA)
895  real(RP), intent(in) :: J13G (KA,IA,JA)
896  real(RP), intent(in) :: MAPF ( IA,JA,2)
897  real(RP), intent(in) :: CDZ (KA)
898  logical, intent(in) :: TwoD
899  integer, intent(in) :: IIS, IIE, JJS, JJE
900 
901  real(RP) :: vel
902  integer :: k, i, j
903  !---------------------------------------------------------------------------
904 
905  !$omp parallel default(none) private(i,j,k,vel) &
906  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J13G,MAPF) &
907  !$omp shared(GSQRT,CDZ,TwoD)
908 
909  !$acc data copy(flux) copyin(mom, val, DENS, GSQRT, J13G, MAPF, CDZ)
910 
911 
912 
913  !$omp do OMP_SCHEDULE_ collapse(2)
914  !$acc kernels
915  do j = jjs, jje
916  do i = iis, iie
917  do k = ks, ke-1
918  vel = ( f2h(k,1,i_uyz) &
919  * mom(k+1,i,j) &
920  + f2h(k,2,i_uyz) &
921  * mom(k,i,j) ) &
922  / ( f2h(k,1,i_uyz) &
923  * 0.5_rp * ( dens(k+1,i,j)+dens(k+1,i+1,j) ) &
924  + f2h(k,2,i_uyz) &
925  * 0.5_rp * ( dens(k,i,j)+dens(k,i+1,j) ) )
926  vel = vel * j13g(k,i,j)
927  flux(k,i,j) = vel / mapf(i,j,+2) &
928  * ( f1 * ( val(k+1,i,j)+val(k,i,j) ) - sign(f1,vel) * ( val(k+1,i,j)-val(k,i,j) ) )
929  enddo
930  enddo
931  enddo
932  !$acc end kernels
933  !$omp end do nowait
934 
935  !$omp do OMP_SCHEDULE_ collapse(2)
936  !$acc kernels
937  do j = jjs, jje
938  do i = iis, iie
939  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS-1.
940  ! The flux at KS-1 can be non-zero.
941  ! To reduce calculations, all the fluxes are set to zero.
942  flux(ks-1,i,j) = 0.0_rp
943 
944  flux(ke ,i,j) = 0.0_rp
945  enddo
946  enddo
947  !$acc end kernels
948  !$omp end do nowait
949 
950 
951 
952  !$acc end data
953 
954  !$omp end parallel
955  return

References scale_atmos_grid_cartesc_index::i_uyz, scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxj23_uyz_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxj23_uyz_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mom,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), dimension (ka,ia,ja), intent(in)  J23G,
real(rp), dimension ( ia,ja,2), intent(in)  MAPF,
real(rp), dimension (ka), intent(in)  CDZ,
logical, intent(in)  TwoD,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation J23-flux at UYZ

Definition at line 966 of file scale_atmos_dyn_fvm_flux_ud1.F90.

966  implicit none
967 
968  real(RP), intent(inout) :: flux (KA,IA,JA)
969  real(RP), intent(in) :: mom (KA,IA,JA)
970  real(RP), intent(in) :: val (KA,IA,JA)
971  real(RP), intent(in) :: DENS (KA,IA,JA)
972  real(RP), intent(in) :: GSQRT (KA,IA,JA)
973  real(RP), intent(in) :: J23G (KA,IA,JA)
974  real(RP), intent(in) :: MAPF ( IA,JA,2)
975  real(RP), intent(in) :: CDZ (KA)
976  logical, intent(in) :: TwoD
977  integer, intent(in) :: IIS, IIE, JJS, JJE
978 
979  real(RP) :: vel
980  integer :: k, i, j
981  !---------------------------------------------------------------------------
982 
983  !$omp parallel default(none) private(i,j,k,vel) &
984  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J23G,MAPF) &
985  !$omp shared(GSQRT,CDZ,TwoD)
986 
987  !$acc data copy(flux) copyin(mom, val, DENS, GSQRT, J23G, MAPF, CDZ)
988 
989 
990  if ( twod ) then
991 
992  !$omp do OMP_SCHEDULE_
993  !$acc kernels
994  do j = jjs, jje
995  do k = ks, ke-1
996  i = iis
997  vel = ( f2h(k,1,i_xyz) &
998  * 0.5_rp * ( mom(k+1,i,j)+mom(k+1,i,j-1) ) &
999  + f2h(k,2,i_xyz) &
1000  * 0.5_rp * ( mom(k,i,j)+mom(k,i,j-1) ) ) &
1001  / ( f2h(k,1,i_xyz) &
1002  * dens(k+1,i,j) &
1003  + f2h(k,2,i_xyz) &
1004  * dens(k,i,j) )
1005  vel = vel * j23g(k,i,j)
1006  flux(k,i,j) = vel * ( f1 * ( val(k+1,i,j)+val(k,i,j) ) - sign(f1,vel) * ( val(k+1,i,j)-val(k,i,j) ) )
1007  enddo
1008  enddo
1009  !$acc end kernels
1010  !$omp end do nowait
1011 
1012  !$omp do OMP_SCHEDULE_
1013  !$acc kernels
1014  do j = jjs, jje
1015  i = iis
1016  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS-1.
1017  ! The flux at KS-1 can be non-zero.
1018  ! To reduce calculations, all the fluxes are set to zero.
1019  flux(ks-1,i,j) = 0.0_rp
1020 
1021  flux(ke ,i,j) = 0.0_rp
1022  enddo
1023  !$acc end kernels
1024  !$omp end do nowait
1025 
1026  else
1027 
1028 
1029  !$omp do OMP_SCHEDULE_ collapse(2)
1030  !$acc kernels
1031  do j = jjs, jje
1032  do i = iis, iie
1033  do k = ks, ke-1
1034  vel = ( f2h(k,1,i_uyz) &
1035  * 0.25_rp * ( mom(k+1,i,j)+mom(k+1,i+1,j)+mom(k+1,i,j-1)+mom(k+1,i+1,j-1) ) &
1036  + f2h(k,2,i_uyz) &
1037  * 0.25_rp * ( mom(k,i,j)+mom(k,i+1,j)+mom(k,i,j-1)+mom(k,i+1,j-1) ) ) &
1038  / ( f2h(k,1,i_uyz) &
1039  * 0.5_rp * ( dens(k+1,i,j)+dens(k+1,i+1,j) ) &
1040  + f2h(k,2,i_uyz) &
1041  * 0.5_rp * ( dens(k,i,j)+dens(k,i+1,j) ) )
1042  vel = vel * j23g(k,i,j)
1043  flux(k,i,j) = vel / mapf(i,j,+1) &
1044  * ( f1 * ( val(k+1,i,j)+val(k,i,j) ) - sign(f1,vel) * ( val(k+1,i,j)-val(k,i,j) ) )
1045  enddo
1046  enddo
1047  enddo
1048  !$acc end kernels
1049  !$omp end do nowait
1050 
1051  !$omp do OMP_SCHEDULE_ collapse(2)
1052  !$acc kernels
1053  do j = jjs, jje
1054  do i = iis, iie
1055  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS-1.
1056  ! The flux at KS-1 can be non-zero.
1057  ! To reduce calculations, all the fluxes are set to zero.
1058  flux(ks-1,i,j) = 0.0_rp
1059 
1060  flux(ke ,i,j) = 0.0_rp
1061  enddo
1062  enddo
1063  !$acc end kernels
1064  !$omp end do nowait
1065 
1066 
1067  end if
1068 
1069 
1070  !$acc end data
1071 
1072  !$omp end parallel
1073  return

References scale_atmos_grid_cartesc_index::i_uyz, scale_atmos_grid_cartesc_index::i_xyz, scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxx_uyz_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxx_uyz_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mom,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), dimension ( ia,ja,2), intent(in)  MAPF,
real(rp), dimension(ka,ia,ja), intent(in)  num_diff,
real(rp), dimension (ka), intent(in)  CDZ,
logical, intent(in)  TwoD,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation X-flux at UY

Definition at line 1085 of file scale_atmos_dyn_fvm_flux_ud1.F90.

1085  implicit none
1086 
1087  real(RP), intent(inout) :: flux (KA,IA,JA)
1088  real(RP), intent(in) :: mom (KA,IA,JA)
1089  real(RP), intent(in) :: val (KA,IA,JA)
1090  real(RP), intent(in) :: DENS (KA,IA,JA)
1091  real(RP), intent(in) :: GSQRT (KA,IA,JA)
1092  real(RP), intent(in) :: MAPF ( IA,JA,2)
1093  real(RP), intent(in) :: num_diff(KA,IA,JA)
1094  real(RP), intent(in) :: CDZ (KA)
1095  logical, intent(in) :: TwoD
1096  integer, intent(in) :: IIS, IIE, JJS, JJE
1097 
1098  real(RP) :: vel
1099  integer :: k, i, j
1100  !---------------------------------------------------------------------------
1101 
1102  ! note that x-index is added by -1
1103 
1104 
1105 
1106  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
1107  !$omp private(vel) &
1108  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,GSQRT,MAPF,num_diff)
1109  !$acc kernels
1110  do j = jjs, jje
1111  do i = iis, iie+1
1112  do k = ks, ke
1113 #ifdef DEBUG
1114  call check( __line__, mom(k,i ,j) )
1115  call check( __line__, mom(k,i-1,j) )
1116 
1117  call check( __line__, val(k,i-1,j) )
1118  call check( __line__, val(k,i,j) )
1119 
1120 #endif
1121  vel = ( 0.5_rp * ( mom(k,i,j)+mom(k,i-1,j) ) ) &
1122  / ( dens(k,i,j) )
1123  flux(k,i-1,j) = gsqrt(k,i,j) / mapf(i,j,+2) * vel &
1124  * ( f1 * ( val(k,i,j)+val(k,i-1,j) ) - sign(f1,vel) * ( val(k,i,j)-val(k,i-1,j) ) )
1125  enddo
1126  enddo
1127  enddo
1128  !$acc end kernels
1129 #ifdef DEBUG
1130  k = iundef; i = iundef; j = iundef
1131 #endif
1132 
1133 
1134 
1135  return

References scale_debug::check(), scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup(), and scale_atmos_dyn_tstep_short_fvm_heve::atmos_dyn_tstep_short_fvm_heve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxy_uyz_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxy_uyz_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mom,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), dimension ( ia,ja,2), intent(in)  MAPF,
real(rp), dimension(ka,ia,ja), intent(in)  num_diff,
real(rp), dimension (ka), intent(in)  CDZ,
logical, intent(in)  TwoD,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation Y-flux at UY

Definition at line 1147 of file scale_atmos_dyn_fvm_flux_ud1.F90.

1147  implicit none
1148 
1149  real(RP), intent(inout) :: flux (KA,IA,JA)
1150  real(RP), intent(in) :: mom (KA,IA,JA)
1151  real(RP), intent(in) :: val (KA,IA,JA)
1152  real(RP), intent(in) :: DENS (KA,IA,JA)
1153  real(RP), intent(in) :: GSQRT (KA,IA,JA)
1154  real(RP), intent(in) :: MAPF ( IA,JA,2)
1155  real(RP), intent(in) :: num_diff(KA,IA,JA)
1156  real(RP), intent(in) :: CDZ (KA)
1157  logical, intent(in) :: TwoD
1158  integer, intent(in) :: IIS, IIE, JJS, JJE
1159 
1160  real(RP) :: vel
1161  integer :: k, i, j
1162  !---------------------------------------------------------------------------
1163 
1164 
1165 
1166  if ( twod ) then
1167 
1168  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ &
1169  !$omp private(vel) &
1170  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,GSQRT,MAPF,num_diff,TwoD)
1171  !$acc kernels
1172  do j = jjs-1, jje
1173  do k = ks, ke
1174  i = iis
1175 #ifdef DEBUG
1176  call check( __line__, mom(k,i ,j) )
1177 
1178  call check( __line__, val(k,i,j) )
1179  call check( __line__, val(k,i,j+1) )
1180 
1181 #endif
1182  vel = ( mom(k,i,j) ) &
1183  / ( 0.5_rp * ( dens(k,i,j)+dens(k,i,j+1) ) )
1184  flux(k,i,j) = gsqrt(k,i,j) / mapf(i,j,+1) * vel &
1185  * ( f1 * ( val(k,i,j+1)+val(k,i,j) ) - sign(f1,vel) * ( val(k,i,j+1)-val(k,i,j) ) )
1186  enddo
1187  enddo
1188  !$acc end kernels
1189 #ifdef DEBUG
1190  k = iundef; i = iundef; j = iundef
1191 #endif
1192 
1193  else
1194 
1195 
1196  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
1197  !$omp private(vel) &
1198  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,GSQRT,MAPF,num_diff)
1199  !$acc kernels
1200  do j = jjs-1, jje
1201  do i = iis, iie
1202  do k = ks, ke
1203 #ifdef DEBUG
1204  call check( __line__, mom(k,i ,j) )
1205  call check( __line__, mom(k,i-1,j) )
1206 
1207  call check( __line__, val(k,i,j) )
1208  call check( __line__, val(k,i,j+1) )
1209 
1210 #endif
1211  vel = ( 0.5_rp * ( mom(k,i,j)+mom(k,i+1,j) ) ) &
1212  / ( 0.25_rp * ( dens(k,i,j)+dens(k,i+1,j)+dens(k,i,j+1)+dens(k,i+1,j+1) ) )
1213  flux(k,i,j) = gsqrt(k,i,j) / mapf(i,j,+1) * vel &
1214  * ( f1 * ( val(k,i,j+1)+val(k,i,j) ) - sign(f1,vel) * ( val(k,i,j+1)-val(k,i,j) ) )
1215  enddo
1216  enddo
1217  enddo
1218  !$acc end kernels
1219 #ifdef DEBUG
1220  k = iundef; i = iundef; j = iundef
1221 #endif
1222 
1223 
1224  end if
1225 
1226 
1227  return

References scale_debug::check(), scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup(), and scale_atmos_dyn_tstep_short_fvm_heve::atmos_dyn_tstep_short_fvm_heve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxz_xvz_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxz_xvz_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mom,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), intent(in)  J33G,
real(rp), dimension(ka,ia,ja), intent(in)  num_diff,
real(rp), dimension (ka), intent(in)  CDZ,
logical, intent(in)  TwoD,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation z-flux at XV

Definition at line 1241 of file scale_atmos_dyn_fvm_flux_ud1.F90.

1241  implicit none
1242 
1243  real(RP), intent(inout) :: flux (KA,IA,JA)
1244  real(RP), intent(in) :: mom (KA,IA,JA)
1245  real(RP), intent(in) :: val (KA,IA,JA)
1246  real(RP), intent(in) :: DENS (KA,IA,JA)
1247  real(RP), intent(in) :: GSQRT (KA,IA,JA)
1248  real(RP), intent(in) :: J33G
1249  real(RP), intent(in) :: num_diff(KA,IA,JA)
1250  real(RP), intent(in) :: CDZ (KA)
1251  logical, intent(in) :: TwoD
1252  integer, intent(in) :: IIS, IIE, JJS, JJE
1253 
1254  real(RP) :: vel
1255  integer :: k, i, j
1256  !---------------------------------------------------------------------------
1257 
1258  !$omp parallel default(none) private(i,j,k,vel) &
1259  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J33G,GSQRT,num_diff) &
1260  !$omp shared(CDZ,TwoD)
1261 
1262  !$acc data copy(flux) copyin(mom, val, DENS, GSQRT, num_diff, CDZ)
1263 
1264 
1265  !$omp do OMP_SCHEDULE_ collapse(2)
1266  !$acc kernels
1267  do j = jjs, jje
1268  do i = iis, iie
1269  do k = ks, ke-1
1270 #ifdef DEBUG
1271  call check( __line__, mom(k,i,j) )
1272  call check( __line__, mom(k,i,j+1) )
1273 
1274  call check( __line__, val(k,i,j) )
1275  call check( __line__, val(k+1,i,j) )
1276 
1277 #endif
1278  vel = ( 0.5_rp * ( mom(k,i,j)+mom(k,i,j+1) ) ) &
1279  / ( f2h(k,1,i_xvz) &
1280  * 0.5_rp * ( dens(k+1,i,j)+dens(k+1,i,j+1) ) &
1281  + f2h(k,2,i_xvz) &
1282  * 0.5_rp * ( dens(k,i,j)+dens(k,i,j+1) ) )
1283  flux(k,i,j) = j33g * vel &
1284  * ( f1 * ( val(k+1,i,j)+val(k,i,j) ) - sign(f1,vel) * ( val(k+1,i,j)-val(k,i,j) ) )
1285  enddo
1286  enddo
1287  enddo
1288  !$acc end kernels
1289  !$omp end do nowait
1290 #ifdef DEBUG
1291  k = iundef; i = iundef; j = iundef
1292 #endif
1293 
1294  !$omp do OMP_SCHEDULE_ collapse(2)
1295  !$acc kernels
1296  do j = jjs, jje
1297  do i = iis, iie
1298 #ifdef DEBUG
1299 
1300 #endif
1301  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS-1.
1302  ! The flux at KS-1 can be non-zero.
1303  ! To reduce calculations, all the fluxes are set to zero.
1304  flux(ks-1,i,j) = 0.0_rp
1305 
1306  flux(ke,i,j) = 0.0_rp
1307  enddo
1308  enddo
1309  !$acc end kernels
1310  !$omp end do nowait
1311 
1312 
1313  !$acc end data
1314 
1315  !$omp end parallel
1316 #ifdef DEBUG
1317  k = iundef; i = iundef; j = iundef
1318 #endif
1319 
1320  return

References scale_debug::check(), scale_atmos_grid_cartesc_index::i_xvz, scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup(), and scale_atmos_dyn_tstep_short_fvm_heve::atmos_dyn_tstep_short_fvm_heve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxj13_xvz_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxj13_xvz_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mom,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), dimension (ka,ia,ja), intent(in)  J13G,
real(rp), dimension ( ia,ja,2), intent(in)  MAPF,
real(rp), dimension (ka), intent(in)  CDZ,
logical, intent(in)  TwoD,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation J13-flux at XVZ

Definition at line 1331 of file scale_atmos_dyn_fvm_flux_ud1.F90.

1331  implicit none
1332 
1333  real(RP), intent(inout) :: flux (KA,IA,JA)
1334  real(RP), intent(in) :: mom (KA,IA,JA)
1335  real(RP), intent(in) :: val (KA,IA,JA)
1336  real(RP), intent(in) :: DENS (KA,IA,JA)
1337  real(RP), intent(in) :: GSQRT (KA,IA,JA)
1338  real(RP), intent(in) :: J13G (KA,IA,JA)
1339  real(RP), intent(in) :: MAPF ( IA,JA,2)
1340  real(RP), intent(in) :: CDZ (KA)
1341  logical, intent(in) :: TwoD
1342  integer, intent(in) :: IIS, IIE, JJS, JJE
1343 
1344  real(RP) :: vel
1345  integer :: k, i, j
1346  !---------------------------------------------------------------------------
1347 
1348  !$omp parallel default(none) private(i,j,k,vel) &
1349  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J13G,MAPF) &
1350  !$omp shared(GSQRT,CDZ,TwoD)
1351 
1352  !$acc data copy(flux) copyin(mom, val, DENS, GSQRT, J13G, MAPF, CDZ)
1353 
1354 
1355 
1356  !$omp do OMP_SCHEDULE_ collapse(2)
1357  !$acc kernels
1358  do j = jjs, jje
1359  do i = iis, iie
1360  do k = ks, ke-1
1361  vel = ( f2h(k,1,i_xvz) &
1362  * 0.25_rp * ( mom(k+1,i,j)+mom(k+1,i-1,j)+mom(k+1,i,j+1)+mom(k+1,i-1,j+1) ) &
1363  + f2h(k,2,i_xvz) &
1364  * 0.25_rp * ( mom(k,i,j)+mom(k,i-1,j)+mom(k,i,j+1)+mom(k,i-1,j+1) ) ) &
1365  / ( f2h(k,1,i_xvz) &
1366  * 0.5_rp * ( dens(k+1,i,j)+dens(k+1,i,j+1) ) &
1367  + f2h(k,2,i_xvz) &
1368  * 0.5_rp * ( dens(k,i,j)+dens(k,i,j+1) ) )
1369  vel = vel * j13g(k,i,j)
1370  flux(k,i,j) = vel / mapf(i,j,+2) &
1371  * ( f1 * ( val(k+1,i,j)+val(k,i,j) ) - sign(f1,vel) * ( val(k+1,i,j)-val(k,i,j) ) )
1372  enddo
1373  enddo
1374  enddo
1375  !$acc end kernels
1376  !$omp end do nowait
1377 
1378  !$omp do OMP_SCHEDULE_ collapse(2)
1379  !$acc kernels
1380  do j = jjs, jje
1381  do i = iis, iie
1382  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS-1.
1383  ! The flux at KS-1 can be non-zero.
1384  ! To reduce calculations, all the fluxes are set to zero.
1385  flux(ks-1,i,j) = 0.0_rp
1386 
1387  flux(ke ,i,j) = 0.0_rp
1388  enddo
1389  enddo
1390  !$acc end kernels
1391  !$omp end do nowait
1392 
1393 
1394 
1395  !$acc end data
1396 
1397  !$omp end parallel
1398  return

References scale_atmos_grid_cartesc_index::i_xvz, scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxj23_xvz_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxj23_xvz_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mom,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), dimension (ka,ia,ja), intent(in)  J23G,
real(rp), dimension ( ia,ja,2), intent(in)  MAPF,
real(rp), dimension (ka), intent(in)  CDZ,
logical, intent(in)  TwoD,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation J23-flux at XVZ

Definition at line 1409 of file scale_atmos_dyn_fvm_flux_ud1.F90.

1409  implicit none
1410 
1411  real(RP), intent(inout) :: flux (KA,IA,JA)
1412  real(RP), intent(in) :: mom (KA,IA,JA)
1413  real(RP), intent(in) :: val (KA,IA,JA)
1414  real(RP), intent(in) :: DENS (KA,IA,JA)
1415  real(RP), intent(in) :: GSQRT (KA,IA,JA)
1416  real(RP), intent(in) :: J23G (KA,IA,JA)
1417  real(RP), intent(in) :: MAPF ( IA,JA,2)
1418  real(RP), intent(in) :: CDZ (KA)
1419  logical, intent(in) :: TwoD
1420  integer, intent(in) :: IIS, IIE, JJS, JJE
1421 
1422  real(RP) :: vel
1423  integer :: k, i, j
1424  !---------------------------------------------------------------------------
1425 
1426  !$omp parallel default(none) private(i,j,k,vel) &
1427  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J23G,MAPF) &
1428  !$omp shared(GSQRT,CDZ,TwoD)
1429 
1430  !$acc data copy(flux) copyin(mom, val, DENS, GSQRT, J23G, MAPF, CDZ)
1431 
1432 
1433 
1434  !$omp do OMP_SCHEDULE_ collapse(2)
1435  !$acc kernels
1436  do j = jjs, jje
1437  do i = iis, iie
1438  do k = ks, ke-1
1439  vel = ( f2h(k,1,i_xvz) &
1440  * mom(k+1,i,j) &
1441  + f2h(k,2,i_xvz) &
1442  * mom(k,i,j) ) &
1443  / ( f2h(k,1,i_xvz) &
1444  * 0.5_rp * ( dens(k+1,i,j)+dens(k+1,i,j+1) ) &
1445  + f2h(k,2,i_xvz) &
1446  * 0.5_rp * ( dens(k,i,j)+dens(k,i,j+1) ) )
1447  vel = vel * j23g(k,i,j)
1448  flux(k,i,j) = vel / mapf(i,j,+1) &
1449  * ( f1 * ( val(k+1,i,j)+val(k,i,j) ) - sign(f1,vel) * ( val(k+1,i,j)-val(k,i,j) ) )
1450  enddo
1451  enddo
1452  enddo
1453  !$acc end kernels
1454  !$omp end do nowait
1455 
1456  !$omp do OMP_SCHEDULE_ collapse(2)
1457  !$acc kernels
1458  do j = jjs, jje
1459  do i = iis, iie
1460  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS-1.
1461  ! The flux at KS-1 can be non-zero.
1462  ! To reduce calculations, all the fluxes are set to zero.
1463  flux(ks-1,i,j) = 0.0_rp
1464 
1465  flux(ke ,i,j) = 0.0_rp
1466  enddo
1467  enddo
1468  !$acc end kernels
1469  !$omp end do nowait
1470 
1471 
1472 
1473  !$acc end data
1474 
1475  !$omp end parallel
1476  return

References scale_atmos_grid_cartesc_index::i_xvz, scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxx_xvz_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxx_xvz_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mom,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), dimension ( ia,ja,2), intent(in)  MAPF,
real(rp), dimension(ka,ia,ja), intent(in)  num_diff,
real(rp), dimension (ka), intent(in)  CDZ,
logical, intent(in)  TwoD,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation X-flux at XV

Definition at line 1488 of file scale_atmos_dyn_fvm_flux_ud1.F90.

1488  implicit none
1489 
1490  real(RP), intent(inout) :: flux (KA,IA,JA)
1491  real(RP), intent(in) :: mom (KA,IA,JA)
1492  real(RP), intent(in) :: val (KA,IA,JA)
1493  real(RP), intent(in) :: DENS (KA,IA,JA)
1494  real(RP), intent(in) :: GSQRT (KA,IA,JA)
1495  real(RP), intent(in) :: MAPF ( IA,JA,2)
1496  real(RP), intent(in) :: num_diff(KA,IA,JA)
1497  real(RP), intent(in) :: CDZ (KA)
1498  logical, intent(in) :: TwoD
1499  integer, intent(in) :: IIS, IIE, JJS, JJE
1500 
1501  real(RP) :: vel
1502  integer :: k, i, j
1503  !---------------------------------------------------------------------------
1504 
1505 
1506 
1507  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
1508  !$omp private(vel) &
1509  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,GSQRT,MAPF,num_diff)
1510  !$acc kernels
1511  do j = jjs, jje
1512  do i = iis-1, iie
1513  do k = ks, ke
1514 #ifdef DEBUG
1515  call check( __line__, mom(k,i ,j) )
1516  call check( __line__, mom(k,i,j-1) )
1517 
1518  call check( __line__, val(k,i,j) )
1519  call check( __line__, val(k,i+1,j) )
1520 
1521 #endif
1522  vel = ( 0.5_rp * ( mom(k,i,j)+mom(k,i,j+1) ) ) &
1523  / ( 0.25_rp * ( dens(k,i,j)+dens(k,i+1,j)+dens(k,i,j+1)+dens(k,i+1,j+1) ) )
1524  flux(k,i,j) = gsqrt(k,i,j) / mapf(i,j,+2) * vel &
1525  * ( f1 * ( val(k,i+1,j)+val(k,i,j) ) - sign(f1,vel) * ( val(k,i+1,j)-val(k,i,j) ) )
1526  enddo
1527  enddo
1528  enddo
1529  !$acc end kernels
1530 #ifdef DEBUG
1531  k = iundef; i = iundef; j = iundef
1532 #endif
1533 
1534 
1535 
1536  return

References scale_debug::check(), scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup(), and scale_atmos_dyn_tstep_short_fvm_heve::atmos_dyn_tstep_short_fvm_heve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxy_xvz_ud1()

subroutine, public scale_atmos_dyn_fvm_flux_ud1::atmos_dyn_fvm_fluxy_xvz_ud1 ( real(rp), dimension (ka,ia,ja), intent(inout)  flux,
real(rp), dimension (ka,ia,ja), intent(in)  mom,
real(rp), dimension (ka,ia,ja), intent(in)  val,
real(rp), dimension (ka,ia,ja), intent(in)  DENS,
real(rp), dimension (ka,ia,ja), intent(in)  GSQRT,
real(rp), dimension ( ia,ja,2), intent(in)  MAPF,
real(rp), dimension(ka,ia,ja), intent(in)  num_diff,
real(rp), dimension (ka), intent(in)  CDZ,
logical, intent(in)  TwoD,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation Y-flux at XV

Definition at line 1548 of file scale_atmos_dyn_fvm_flux_ud1.F90.

1548  implicit none
1549 
1550  real(RP), intent(inout) :: flux (KA,IA,JA)
1551  real(RP), intent(in) :: mom (KA,IA,JA)
1552  real(RP), intent(in) :: val (KA,IA,JA)
1553  real(RP), intent(in) :: DENS (KA,IA,JA)
1554  real(RP), intent(in) :: GSQRT (KA,IA,JA)
1555  real(RP), intent(in) :: MAPF ( IA,JA,2)
1556  real(RP), intent(in) :: num_diff(KA,IA,JA)
1557  real(RP), intent(in) :: CDZ (KA)
1558  logical, intent(in) :: TwoD
1559  integer, intent(in) :: IIS, IIE, JJS, JJE
1560 
1561  real(RP) :: vel
1562  integer :: k, i, j
1563  !---------------------------------------------------------------------------
1564 
1565  ! note that y-index is added by -1
1566 
1567 
1568 
1569  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
1570  !$omp private(vel) &
1571  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,GSQRT,MAPF,num_diff)
1572  !$acc kernels
1573  do j = jjs, jje+1
1574  do i = iis, iie
1575  do k = ks, ke
1576 #ifdef DEBUG
1577  call check( __line__, mom(k,i ,j) )
1578  call check( __line__, mom(k,i,j-1) )
1579 
1580  call check( __line__, val(k,i,j-1) )
1581  call check( __line__, val(k,i,j) )
1582 
1583 #endif
1584  vel = ( 0.5_rp * ( mom(k,i,j)+mom(k,i,j-1) ) ) &
1585  / ( dens(k,i,j) )
1586  flux(k,i,j-1) = gsqrt(k,i,j) / mapf(i,j,+1) * vel &
1587  * ( f1 * ( val(k,i,j)+val(k,i,j-1) ) - sign(f1,vel) * ( val(k,i,j)-val(k,i,j-1) ) )
1588  enddo
1589  enddo
1590  enddo
1591  !$acc end kernels
1592 #ifdef DEBUG
1593  k = iundef; i = iundef; j = iundef
1594 #endif
1595 
1596 
1597 
1598  return

References scale_debug::check(), scale_tracer::k, scale_atmos_grid_cartesc_index::ke, and scale_atmos_grid_cartesc_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup(), and scale_atmos_dyn_tstep_short_fvm_heve::atmos_dyn_tstep_short_fvm_heve().

Here is the call graph for this function:
Here is the caller graph for this function:
scale_const::const_eps
real(rp), public const_eps
small number
Definition: scale_const.F90:35
scale_atmos_grid_cartesc_index::i_xyz
integer, public i_xyz
Definition: scale_atmos_grid_cartesC_index.F90:91
scale_const
module CONSTANT
Definition: scale_const.F90:11