SCALE-RM
Functions/Subroutines
scale_atmos_dyn_fvm_flux_ud5 Module Reference

module scale_atmos_dyn_fvm_flux_ud5 More...

Functions/Subroutines

subroutine, public atmos_dyn_fvm_flux_valuew_z_ud5 (valW, mflx, val, GSQRT, CDZ)
 value at XYW More...
 
subroutine, public atmos_dyn_fvm_fluxz_xyz_ud5 (flux, mflx, val, GSQRT, num_diff, CDZ, IIS, IIE, JJS, JJE)
 calculation z-flux at XYZ More...
 
subroutine, public atmos_dyn_fvm_fluxx_xyz_ud5 (flux, mflx, val, GSQRT, num_diff, CDZ, IIS, IIE, JJS, JJE)
 calculation X-flux at XYZ More...
 
subroutine, public atmos_dyn_fvm_fluxy_xyz_ud5 (flux, mflx, val, GSQRT, num_diff, CDZ, IIS, IIE, JJS, JJE)
 calculation Y-flux at XYZ More...
 
subroutine, public atmos_dyn_fvm_fluxz_xyw_ud5 (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_ud5 (flux, mom, val, DENS, GSQRT, J13G, MAPF, CDZ, IIS, IIE, JJS, JJE)
 calculation J13-flux at XYW More...
 
subroutine, public atmos_dyn_fvm_fluxj23_xyw_ud5 (flux, mom, val, DENS, GSQRT, J23G, MAPF, CDZ, IIS, IIE, JJS, JJE)
 calculation J23-flux at XYW More...
 
subroutine, public atmos_dyn_fvm_fluxx_xyw_ud5 (flux, mom, val, DENS, GSQRT, MAPF, num_diff, CDZ, IIS, IIE, JJS, JJE)
 calculation X-flux at XYW More...
 
subroutine, public atmos_dyn_fvm_fluxy_xyw_ud5 (flux, mom, val, DENS, GSQRT, MAPF, num_diff, CDZ, IIS, IIE, JJS, JJE)
 calculation Y-flux at XYW More...
 
subroutine, public atmos_dyn_fvm_fluxz_uyz_ud5 (flux, mom, val, DENS, GSQRT, J33G, num_diff, CDZ, IIS, IIE, JJS, JJE)
 calculation z-flux at UY More...
 
subroutine, public atmos_dyn_fvm_fluxj13_uyz_ud5 (flux, mom, val, DENS, GSQRT, J13G, MAPF, CDZ, IIS, IIE, JJS, JJE)
 calculation J13-flux at UYZ More...
 
subroutine, public atmos_dyn_fvm_fluxj23_uyz_ud5 (flux, mom, val, DENS, GSQRT, J23G, MAPF, CDZ, IIS, IIE, JJS, JJE)
 calculation J23-flux at UYZ More...
 
subroutine, public atmos_dyn_fvm_fluxx_uyz_ud5 (flux, mom, val, DENS, GSQRT, MAPF, num_diff, CDZ, IIS, IIE, JJS, JJE)
 calculation X-flux at UY More...
 
subroutine, public atmos_dyn_fvm_fluxy_uyz_ud5 (flux, mom, val, DENS, GSQRT, MAPF, num_diff, CDZ, IIS, IIE, JJS, JJE)
 calculation Y-flux at UY More...
 
subroutine, public atmos_dyn_fvm_fluxz_xvz_ud5 (flux, mom, val, DENS, GSQRT, J33G, num_diff, CDZ, IIS, IIE, JJS, JJE)
 calculation z-flux at XV More...
 
subroutine, public atmos_dyn_fvm_fluxj13_xvz_ud5 (flux, mom, val, DENS, GSQRT, J13G, MAPF, CDZ, IIS, IIE, JJS, JJE)
 calculation J13-flux at XVZ More...
 
subroutine, public atmos_dyn_fvm_fluxj23_xvz_ud5 (flux, mom, val, DENS, GSQRT, J23G, MAPF, CDZ, IIS, IIE, JJS, JJE)
 calculation J23-flux at XVZ More...
 
subroutine, public atmos_dyn_fvm_fluxx_xvz_ud5 (flux, mom, val, DENS, GSQRT, MAPF, num_diff, CDZ, IIS, IIE, JJS, JJE)
 calculation X-flux at XV More...
 
subroutine, public atmos_dyn_fvm_fluxy_xvz_ud5 (flux, mom, val, DENS, GSQRT, MAPF, num_diff, CDZ, IIS, IIE, JJS, JJE)
 calculation Y-flux at XV More...
 

Detailed Description

module scale_atmos_dyn_fvm_flux_ud5

Description
FVM flux scheme with the ud5 order
Author
Team SCALE
History
  • 2016-04-18 (S.Nishizawa) [new]

Function/Subroutine Documentation

◆ atmos_dyn_fvm_flux_valuew_z_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_flux_valuew_z_ud5 ( 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 111 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_debug::check(), scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

111  implicit none
112 
113  real(RP), intent(out) :: valW (KA)
114  real(RP), intent(in) :: mflx (KA)
115  real(RP), intent(in) :: val (KA)
116  real(RP), intent(in) :: GSQRT(KA)
117  real(RP), intent(in) :: CDZ (KA)
118 
119  integer :: k
120  !---------------------------------------------------------------------------
121 
122  do k = ks+2, ke-3
123 #ifdef DEBUG
124  call check( __line__, mflx(k) )
125 
126  call check( __line__, val(k) )
127  call check( __line__, val(k+1) )
128 
129  call check( __line__, val(k-1) )
130  call check( __line__, val(k+2) )
131 
132  call check( __line__, val(k-2) )
133  call check( __line__, val(k+3) )
134 
135 #endif
136  valw(k) = ( f51 * ( val(k+3)+val(k-2) ) &
137  + f52 * ( val(k+2)+val(k-1) ) &
138  + f53 * ( val(k+1)+val(k) ) ) &
139  - ( f51 * ( val(k+3)-val(k-2) ) &
140  + f54 * ( val(k+2)-val(k-1) ) &
141  + f55 * ( val(k+1)-val(k) ) ) * sign(1.0_rp,mflx(k))
142  enddo
143 #ifdef DEBUG
144  k = iundef
145 #endif
146 
147 #ifdef DEBUG
148 
149  call check( __line__, mflx(ks) )
150  call check( __line__, val(ks ) )
151  call check( __line__, val(ks+1) )
152  call check( __line__, mflx(ke-1) )
153  call check( __line__, val(ke ) )
154  call check( __line__, val(ke-1) )
155 
156  call check( __line__, mflx(ks+1) )
157  call check( __line__, val(ks+2 ) )
158  call check( __line__, val(ks+3) )
159  call check( __line__, mflx(ke-2) )
160  call check( __line__, val(ke-2 ) )
161  call check( __line__, val(ke-3) )
162 
163 #endif
164 
165 
166 
167  valw(ks) = f2 * ( val(ks+1)+val(ks) )
168  valw(ke-1) = f2 * ( val(ke)+val(ke-1) )
169 
170  valw(ks+1) = ( f31 * ( val(ks+3)+val(ks) ) + f32 * ( val(ks+2)+val(ks+1) ) ) &
171  - ( f31 * ( val(ks+3)-val(ks) ) + f33 * ( val(ks+2)-val(ks+1) ) ) * sign(1.0_rp,mflx(ks+1))
172  valw(ke-2) = ( f31 * ( val(ke)+val(ke-3) ) + f32 * ( val(ke-1)+val(ke-2) ) ) &
173  - ( f31 * ( val(ke)-val(ke-3) ) + f33 * ( val(ke-1)-val(ke-2) ) ) * sign(1.0_rp,mflx(ke-2))
174 
175 
176  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxz_xyz_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxz_xyz_ud5 ( 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 187 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_debug::check(), scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

187  implicit none
188 
189  real(RP), intent(inout) :: flux (KA,IA,JA)
190  real(RP), intent(in) :: mflx (KA,IA,JA)
191  real(RP), intent(in) :: val (KA,IA,JA)
192  real(RP), intent(in) :: GSQRT (KA,IA,JA)
193  real(RP), intent(in) :: num_diff(KA,IA,JA)
194  real(RP), intent(in) :: CDZ (KA)
195  integer, intent(in) :: IIS, IIE, JJS, JJE
196 
197  real(RP) :: vel
198  integer :: k, i, j
199  !---------------------------------------------------------------------------
200 
201  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
202  !$omp private(vel) &
203  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mflx,val,flux,GSQRT,num_diff)
204  do j = jjs, jje
205  do i = iis, iie
206  do k = ks+2, ke-3
207 #ifdef DEBUG
208  call check( __line__, mflx(k,i,j) )
209 
210  call check( __line__, val(k,i,j) )
211  call check( __line__, val(k+1,i,j) )
212 
213  call check( __line__, val(k-1,i,j) )
214  call check( __line__, val(k+2,i,j) )
215 
216  call check( __line__, val(k-2,i,j) )
217  call check( __line__, val(k+3,i,j) )
218 
219 #endif
220  vel = mflx(k,i,j)
221  flux(k,i,j) = vel &
222  * ( ( f51 * ( val(k+3,i,j)+val(k-2,i,j) ) &
223  + f52 * ( val(k+2,i,j)+val(k-1,i,j) ) &
224  + f53 * ( val(k+1,i,j)+val(k,i,j) ) ) &
225  - ( f51 * ( val(k+3,i,j)-val(k-2,i,j) ) &
226  + f54 * ( val(k+2,i,j)-val(k-1,i,j) ) &
227  + f55 * ( val(k+1,i,j)-val(k,i,j) ) ) * sign(1.0_rp,vel) ) &
228  + gsqrt(k,i,j) * num_diff(k,i,j)
229  enddo
230  enddo
231  enddo
232 #ifdef DEBUG
233  k = iundef; i = iundef; j = iundef
234 #endif
235 
236  !$omp parallel do default(none) private(i,j) OMP_SCHEDULE_ collapse(2) &
237  !$omp private(vel) &
238  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mflx,val,flux,GSQRT,num_diff)
239  do j = jjs, jje
240  do i = iis, iie
241 #ifdef DEBUG
242 
243  call check( __line__, mflx(ks,i,j) )
244  call check( __line__, val(ks ,i,j) )
245  call check( __line__, val(ks+1,i,j) )
246  call check( __line__, mflx(ke-1,i,j) )
247  call check( __line__, val(ke ,i,j) )
248  call check( __line__, val(ke-1,i,j) )
249 
250  call check( __line__, mflx(ks+1,i,j) )
251  call check( __line__, val(ks+2 ,i,j) )
252  call check( __line__, val(ks+3,i,j) )
253  call check( __line__, mflx(ke-2,i,j) )
254  call check( __line__, val(ke-2 ,i,j) )
255  call check( __line__, val(ke-3,i,j) )
256 
257 #endif
258  flux(ks-1,i,j) = 0.0_rp
259 
260  vel = mflx(ks,i,j)
261  flux(ks,i,j) = vel &
262  * ( f2 * ( val(ks+1,i,j)+val(ks,i,j) ) ) &
263  + gsqrt(ks,i,j) * num_diff(ks,i,j)
264  vel = mflx(ke-1,i,j)
265  flux(ke-1,i,j) = vel &
266  * ( f2 * ( val(ke,i,j)+val(ke-1,i,j) ) ) &
267  + gsqrt(ke-1,i,j) * num_diff(ke-1,i,j)
268 
269  vel = mflx(ks+1,i,j)
270  flux(ks+1,i,j) = vel &
271  * ( ( f31 * ( val(ks+3,i,j)+val(ks,i,j) ) + f32 * ( val(ks+2,i,j)+val(ks+1,i,j) ) ) &
272  - ( f31 * ( val(ks+3,i,j)-val(ks,i,j) ) + f33 * ( val(ks+2,i,j)-val(ks+1,i,j) ) ) * sign(1.0_rp,vel) ) &
273  + gsqrt(ks+1,i,j) * num_diff(ks+1,i,j)
274  vel = mflx(ke-2,i,j)
275  flux(ke-2,i,j) = vel &
276  * ( ( f31 * ( val(ke,i,j)+val(ke-3,i,j) ) + f32 * ( val(ke-1,i,j)+val(ke-2,i,j) ) ) &
277  - ( f31 * ( val(ke,i,j)-val(ke-3,i,j) ) + f33 * ( val(ke-1,i,j)-val(ke-2,i,j) ) ) * sign(1.0_rp,vel) ) &
278  + gsqrt(ke-2,i,j) * num_diff(ke-2,i,j)
279 
280  flux(ke ,i,j) = 0.0_rp
281  enddo
282  enddo
283 #ifdef DEBUG
284  k = iundef; i = iundef; j = iundef
285 #endif
286 
287  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxx_xyz_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxx_xyz_ud5 ( 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 298 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_debug::check(), scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

298  implicit none
299 
300  real(RP), intent(inout) :: flux (KA,IA,JA)
301  real(RP), intent(in) :: mflx (KA,IA,JA)
302  real(RP), intent(in) :: val (KA,IA,JA)
303  real(RP), intent(in) :: GSQRT (KA,IA,JA)
304  real(RP), intent(in) :: num_diff(KA,IA,JA)
305  real(RP), intent(in) :: CDZ(KA)
306  integer, intent(in) :: IIS, IIE, JJS, JJE
307 
308  real(RP) :: vel
309  integer :: k, i, j
310  !---------------------------------------------------------------------------
311 
312  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
313  !$omp private(vel) &
314  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mflx,val,flux,GSQRT,num_diff)
315  do j = jjs, jje
316  do i = iis-1, iie
317  do k = ks, ke
318 #ifdef DEBUG
319  call check( __line__, mflx(k,i,j) )
320 
321  call check( __line__, val(k,i,j) )
322  call check( __line__, val(k,i+1,j) )
323 
324  call check( __line__, val(k,i-1,j) )
325  call check( __line__, val(k,i+2,j) )
326 
327  call check( __line__, val(k,i-2,j) )
328  call check( __line__, val(k,i+3,j) )
329 
330 #endif
331  vel = mflx(k,i,j)
332  flux(k,i,j) = vel &
333  * ( ( f51 * ( val(k,i+3,j)+val(k,i-2,j) ) &
334  + f52 * ( val(k,i+2,j)+val(k,i-1,j) ) &
335  + f53 * ( val(k,i+1,j)+val(k,i,j) ) ) &
336  - ( f51 * ( val(k,i+3,j)-val(k,i-2,j) ) &
337  + f54 * ( val(k,i+2,j)-val(k,i-1,j) ) &
338  + f55 * ( val(k,i+1,j)-val(k,i,j) ) ) * sign(1.0_rp,vel) ) &
339  + gsqrt(k,i,j) * num_diff(k,i,j)
340  enddo
341  enddo
342  enddo
343 #ifdef DEBUG
344  k = iundef; i = iundef; j = iundef
345 #endif
346 
347  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxy_xyz_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxy_xyz_ud5 ( 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 358 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_debug::check(), scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

358  implicit none
359 
360  real(RP), intent(inout) :: flux (KA,IA,JA)
361  real(RP), intent(in) :: mflx (KA,IA,JA)
362  real(RP), intent(in) :: val (KA,IA,JA)
363  real(RP), intent(in) :: GSQRT (KA,IA,JA)
364  real(RP), intent(in) :: num_diff(KA,IA,JA)
365  real(RP), intent(in) :: CDZ(KA)
366  integer, intent(in) :: IIS, IIE, JJS, JJE
367 
368  real(RP) :: vel
369  integer :: k, i, j
370  !---------------------------------------------------------------------------
371 
372  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
373  !$omp private(vel) &
374  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mflx,val,flux,GSQRT,num_diff)
375  do j = jjs-1, jje
376  do i = iis, iie
377  do k = ks, ke
378 #ifdef DEBUG
379  call check( __line__, mflx(k,i,j) )
380 
381  call check( __line__, val(k,i,j) )
382  call check( __line__, val(k,i,j+1) )
383 
384  call check( __line__, val(k,i,j-1) )
385  call check( __line__, val(k,i,j+2) )
386 
387  call check( __line__, val(k,i,j-2) )
388  call check( __line__, val(k,i,j+3) )
389 
390 #endif
391  vel = mflx(k,i,j)
392  flux(k,i,j) = vel &
393  * ( ( f51 * ( val(k,i,j+3)+val(k,i,j-2) ) &
394  + f52 * ( val(k,i,j+2)+val(k,i,j-1) ) &
395  + f53 * ( val(k,i,j+1)+val(k,i,j) ) ) &
396  - ( f51 * ( val(k,i,j+3)-val(k,i,j-2) ) &
397  + f54 * ( val(k,i,j+2)-val(k,i,j-1) ) &
398  + f55 * ( val(k,i,j+1)-val(k,i,j) ) ) * sign(1.0_rp,vel) ) &
399  + gsqrt(k,i,j) * num_diff(k,i,j)
400  enddo
401  enddo
402  enddo
403 #ifdef DEBUG
404  k = iundef; i = iundef; j = iundef
405 #endif
406 
407  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxz_xyw_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxz_xyw_ud5 ( 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 421 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_debug::check(), scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

421  implicit none
422 
423  real(RP), intent(inout) :: flux (KA,IA,JA)
424  real(RP), intent(in) :: mom (KA,IA,JA)
425  real(RP), intent(in) :: val (KA,IA,JA)
426  real(RP), intent(in) :: DENS (KA,IA,JA)
427  real(RP), intent(in) :: GSQRT (KA,IA,JA)
428  real(RP), intent(in) :: J33G
429  real(RP), intent(in) :: num_diff(KA,IA,JA)
430  real(RP), intent(in) :: CDZ (KA)
431  real(RP), intent(in) :: FDZ (KA-1)
432  real(RP), intent(in) :: dtrk
433  integer, intent(in) :: IIS, IIE, JJS, JJE
434 
435  real(RP) :: vel
436  integer :: k, i, j
437  !---------------------------------------------------------------------------
438 
439  ! note than z-index is added by -1
440 
441  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
442  !$omp private(vel) &
443  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,flux,J33G,GSQRT,num_diff,DENS)
444  do j = jjs, jje
445  do i = iis, iie
446  do k = ks+3, ke-2
447 #ifdef DEBUG
448  call check( __line__, mom(k-1,i,j) )
449  call check( __line__, mom(k ,i,j) )
450 
451  call check( __line__, val(k-1,i,j) )
452  call check( __line__, val(k,i,j) )
453 
454  call check( __line__, val(k-2,i,j) )
455  call check( __line__, val(k+1,i,j) )
456 
457  call check( __line__, val(k-3,i,j) )
458  call check( __line__, val(k+2,i,j) )
459 
460 #endif
461  vel = ( 0.5_rp * ( mom(k-1,i,j) &
462  + mom(k,i,j) ) ) &
463  / dens(k,i,j)
464  flux(k-1,i,j) = j33g * vel &
465  * ( ( f51 * ( val(k+2,i,j)+val(k-3,i,j) ) &
466  + f52 * ( val(k+1,i,j)+val(k-2,i,j) ) &
467  + f53 * ( val(k,i,j)+val(k-1,i,j) ) ) &
468  - ( f51 * ( val(k+2,i,j)-val(k-3,i,j) ) &
469  + f54 * ( val(k+1,i,j)-val(k-2,i,j) ) &
470  + f55 * ( val(k,i,j)-val(k-1,i,j) ) ) * sign(1.0_rp,vel) ) &
471  + gsqrt(k,i,j) * num_diff(k,i,j)
472  enddo
473  enddo
474  enddo
475 #ifdef DEBUG
476  k = iundef; i = iundef; j = iundef
477 #endif
478 
479  !$omp parallel do default(none) private(i,j) OMP_SCHEDULE_ collapse(2) &
480  !$omp private(vel) &
481  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J33G,GSQRT,num_diff,FDZ,dtrk)
482  do j = jjs, jje
483  do i = iis, iie
484 #ifdef DEBUG
485 
486  call check( __line__, val(ks ,i,j) )
487  call check( __line__, val(ks+1,i,j) )
488 
489 
490  call check( __line__, val(ke-2,i,j) )
491  call check( __line__, val(ke-1,i,j) )
492 
493 #endif
494  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS.
495  ! The flux at KS can be non-zero.
496  ! To reduce calculations, all the fluxes are set to zero.
497  flux(ks-1,i,j) = 0.0_rp ! k = KS
498 
499  vel = ( 0.5_rp * ( mom(ks,i,j) &
500  + mom(ks+1,i,j) ) ) &
501  / dens(ks+1,i,j)
502  flux(ks,i,j) = j33g * vel &
503  * ( f2 * ( val(ks+1,i,j)+val(ks,i,j) ) ) &
504  + gsqrt(ks+1,i,j) * num_diff(ks+1,i,j) ! k = KS+1
505 
506  vel = ( 0.5_rp * ( mom(ks+1,i,j) &
507  + mom(ks+2,i,j) ) ) &
508  / dens(ks+2,i,j)
509  flux(ks+1,i,j) = j33g * vel &
510  * ( ( f31 * ( val(ks+3,i,j)+val(ks,i,j) ) + f32 * ( val(ks+2,i,j)+val(ks+1,i,j) ) ) &
511  - ( f31 * ( val(ks+3,i,j)-val(ks,i,j) ) + f33 * ( val(ks+2,i,j)-val(ks+1,i,j) ) ) * sign(1.0_rp,vel) ) &
512  + gsqrt(ks+2,i,j) * num_diff(ks+2,i,j) ! k = KS+2
513 
514 
515 
516  vel = ( 0.5_rp * ( mom(ke-2,i,j) &
517  + mom(ke-1,i,j) ) ) &
518  / dens(ke-1,i,j)
519  flux(ke-2,i,j) = j33g * vel &
520  * ( ( f31 * ( val(ke,i,j)+val(ke-3,i,j) ) + f32 * ( val(ke-1,i,j)+val(ke-2,i,j) ) ) &
521  - ( f31 * ( val(ke,i,j)-val(ke-3,i,j) ) + f33 * ( val(ke-1,i,j)-val(ke-2,i,j) ) ) * sign(1.0_rp,vel) ) &
522  + gsqrt(ke-1,i,j) * num_diff(ke-1,i,j) ! k = KE-1
523 
524  flux(ke-1,i,j) = 0.0_rp ! k = KE
525  flux(ke ,i,j) = 0.0_rp ! k = KE+1
526  enddo
527  enddo
528 
529  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxj13_xyw_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxj13_xyw_ud5 ( 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,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation J13-flux at XYW

Definition at line 541 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

541  implicit none
542 
543  real(RP), intent(inout) :: flux (KA,IA,JA)
544  real(RP), intent(in) :: mom (KA,IA,JA)
545  real(RP), intent(in) :: val (KA,IA,JA)
546  real(RP), intent(in) :: DENS (KA,IA,JA)
547  real(RP), intent(in) :: GSQRT (KA,IA,JA)
548  real(RP), intent(in) :: J13G (KA,IA,JA)
549  real(RP), intent(in) :: MAPF ( IA,JA,2)
550  real(RP), intent(in) :: CDZ (KA)
551  integer, intent(in) :: IIS, IIE, JJS, JJE
552 
553  real(RP) :: vel
554  integer :: k, i, j
555  !---------------------------------------------------------------------------
556 
557  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
558  !$omp private(vel) &
559  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J13G,MAPF)
560  do j = jjs, jje
561  do i = iis, iie
562  do k = ks+2, ke-2
563  vel = ( 0.5_rp * ( mom(k,i,j)+mom(k,i-1,j) ) ) &
564  / dens(k,i,j)
565  flux(k-1,i,j) = j13g(k,i,j) / mapf(i,j,+2) * vel &
566  * ( ( f51 * ( val(k+2,i,j)+val(k-3,i,j) ) &
567  + f52 * ( val(k+1,i,j)+val(k-2,i,j) ) &
568  + f53 * ( val(k,i,j)+val(k-1,i,j) ) ) &
569  - ( f51 * ( val(k+2,i,j)-val(k-3,i,j) ) &
570  + f54 * ( val(k+1,i,j)-val(k-2,i,j) ) &
571  + f55 * ( val(k,i,j)-val(k-1,i,j) ) ) * sign(1.0_rp,vel) )
572  enddo
573  enddo
574  enddo
575 
576  !$omp parallel do default(none) private(i,j) OMP_SCHEDULE_ collapse(2) &
577  !$omp private(vel) &
578  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J13G,MAPF)
579  do j = jjs, jje
580  do i = iis, iie
581  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS.
582  ! The flux at KS can be non-zero.
583  ! To reduce calculations, all the fluxes are set to zero.
584  flux(ks-1,i,j) = 0.0_rp ! k = KS
585 
586  ! physically incorrect but for numerical stability
587  vel = ( ( 0.5_rp * ( mom(ks+1,i,j)+mom(ks+1,i-1,j) ) ) / dens(ks+1,i,j) &
588  + ( 0.5_rp * ( mom(ks,i,j)+mom(ks,i-1,j) ) ) / dens(ks ,i,j) ) * 0.5_rp
589 ! vel = ( 0.5_RP * ( mom(KS+1,i,j)+mom(KS+1,i-1,j) ) ) &
590 ! / DENS(KS+1,i,j)
591  flux(ks,i,j) = j13g(ks+1,i,j) / mapf(i,j,+2) * vel &
592  * ( f2 * ( val(ks+1,i,j)+val(ks,i,j) ) ) ! k = KS+1
593 
594 
595  vel = ( 0.5_rp * ( mom(ke-1,i,j)+mom(ke-1,i-1,j) ) ) &
596  / dens(ke-1,i,j)
597  flux(ke-2,i,j) = j13g(ke-1,i,j) / mapf(i,j,+2) * vel &
598  * ( f2 * ( val(ke-1,i,j)+val(ke-2,i,j) ) ) ! k = KE-3
599 
600  flux(ke-1,i,j) = 0.0_rp
601  enddo
602  enddo
603 
604  return
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxj23_xyw_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxj23_xyw_ud5 ( 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,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation J23-flux at XYW

Definition at line 615 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

615  implicit none
616 
617  real(RP), intent(inout) :: flux (KA,IA,JA)
618  real(RP), intent(in) :: mom (KA,IA,JA)
619  real(RP), intent(in) :: val (KA,IA,JA)
620  real(RP), intent(in) :: DENS (KA,IA,JA)
621  real(RP), intent(in) :: GSQRT (KA,IA,JA)
622  real(RP), intent(in) :: J23G (KA,IA,JA)
623  real(RP), intent(in) :: MAPF ( IA,JA,2)
624  real(RP), intent(in) :: CDZ (KA)
625  integer, intent(in) :: IIS, IIE, JJS, JJE
626 
627  real(RP) :: vel
628  integer :: k, i, j
629  !---------------------------------------------------------------------------
630 
631  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
632  !$omp private(vel) &
633  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J23G,MAPF)
634  do j = jjs, jje
635  do i = iis, iie
636  do k = ks+2, ke-2
637  vel = ( 0.5_rp * ( mom(k,i,j)+mom(k,i,j-1) ) ) &
638  / dens(k,i,j)
639  flux(k-1,i,j) = j23g(k,i,j) / mapf(i,j,+1) * vel &
640  * ( ( f51 * ( val(k+2,i,j)+val(k-3,i,j) ) &
641  + f52 * ( val(k+1,i,j)+val(k-2,i,j) ) &
642  + f53 * ( val(k,i,j)+val(k-1,i,j) ) ) &
643  - ( f51 * ( val(k+2,i,j)-val(k-3,i,j) ) &
644  + f54 * ( val(k+1,i,j)-val(k-2,i,j) ) &
645  + f55 * ( val(k,i,j)-val(k-1,i,j) ) ) * sign(1.0_rp,vel) )
646  enddo
647  enddo
648  enddo
649 
650  !$omp parallel do default(none) private(i,j) OMP_SCHEDULE_ collapse(2) &
651  !$omp private(vel) &
652  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J23G,MAPF)
653  do j = jjs, jje
654  do i = iis, iie
655  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS.
656  ! The flux at KS can be non-zero.
657  ! To reduce calculations, all the fluxes are set to zero.
658  flux(ks-1,i,j) = 0.0_rp ! k = KS
659 
660  ! physically incorrect but for numerical stability
661  vel = ( ( 0.5_rp * ( mom(ks+1,i,j)+mom(ks+1,i,j-1) ) ) / dens(ks+1,i,j) &
662  + ( 0.5_rp * ( mom(ks,i,j)+mom(ks,i,j-1) ) ) / dens(ks ,i,j) ) * 0.5_rp
663 ! vel = ( 0.5_RP * ( mom(KS+1,i,j)+mom(KS+1,i,j-1) ) ) &
664 ! / DENS(KS+1,i,j)
665  flux(ks,i,j) = j23g(ks+1,i,j) / mapf(i,j,+1) * vel &
666  * ( f2 * ( val(ks+1,i,j)+val(ks,i,j) ) ) ! k = KS+1
667 
668 
669  vel = ( 0.5_rp * ( mom(ke-1,i,j)+mom(ke-1,i,j-1) ) ) &
670  / dens(ke-1,i,j)
671  flux(ke-2,i,j) = j23g(ke-1,i,j) / mapf(i,j,+1) * vel &
672  * ( f2 * ( val(ke-1,i,j)+val(ke-2,i,j) ) ) ! k = KE-3
673 
674  flux(ke-1,i,j) = 0.0_rp
675  enddo
676  enddo
677 
678  return
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxx_xyw_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxx_xyw_ud5 ( 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,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation X-flux at XYW

Definition at line 691 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_debug::check(), scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

691  implicit none
692 
693  real(RP), intent(inout) :: flux (KA,IA,JA)
694  real(RP), intent(in) :: mom (KA,IA,JA)
695  real(RP), intent(in) :: val (KA,IA,JA)
696  real(RP), intent(in) :: DENS (KA,IA,JA)
697  real(RP), intent(in) :: GSQRT (KA,IA,JA)
698  real(RP), intent(in) :: MAPF ( IA,JA,2)
699  real(RP), intent(in) :: num_diff(KA,IA,JA)
700  real(RP), intent(in) :: CDZ (KA)
701  integer, intent(in) :: IIS, IIE, JJS, JJE
702 
703  real(RP) :: vel
704  integer :: k, i, j
705  !---------------------------------------------------------------------------
706 
707  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
708  !$omp private(vel) &
709  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,GSQRT,MAPF,num_diff) &
710  !$omp shared(CDZ)
711  do j = jjs, jje
712  do i = iis-1, iie
713  do k = ks, ke-1
714 #ifdef DEBUG
715  call check( __line__, mom(k ,i,j) )
716  call check( __line__, mom(k+1,i,j) )
717 
718  call check( __line__, val(k,i,j) )
719  call check( __line__, val(k,i+1,j) )
720 
721  call check( __line__, val(k,i-1,j) )
722  call check( __line__, val(k,i+2,j) )
723 
724  call check( __line__, val(k,i-2,j) )
725  call check( __line__, val(k,i+3,j) )
726 
727 #endif
728  vel = ( f2h(k,1,i_uyz) &
729  * mom(k+1,i,j) &
730  + f2h(k,2,i_uyz) &
731  * mom(k,i,j) ) &
732  / ( f2h(k,1,i_uyz) &
733  * 0.5_rp * ( dens(k+1,i,j)+dens(k+1,i+1,j) ) &
734  + f2h(k,2,i_uyz) &
735  * 0.5_rp * ( dens(k,i,j)+dens(k,i+1,j) ) )
736  flux(k,i,j) = gsqrt(k,i,j) / mapf(i,j,+2) * vel &
737  * ( ( f51 * ( val(k,i+3,j)+val(k,i-2,j) ) &
738  + f52 * ( val(k,i+2,j)+val(k,i-1,j) ) &
739  + f53 * ( val(k,i+1,j)+val(k,i,j) ) ) &
740  - ( f51 * ( val(k,i+3,j)-val(k,i-2,j) ) &
741  + f54 * ( val(k,i+2,j)-val(k,i-1,j) ) &
742  + f55 * ( val(k,i+1,j)-val(k,i,j) ) ) * sign(1.0_rp,vel) ) &
743  + gsqrt(k,i,j) * num_diff(k,i,j)
744  enddo
745  enddo
746  enddo
747 #ifdef DEBUG
748  k = iundef; i = iundef; j = iundef
749 #endif
750 
751  !$omp parallel do default(none) private(i,j) OMP_SCHEDULE_ collapse(2) &
752  !$omp private(vel) &
753  !$omp shared(JJS,JJE,IIS,IIE,KE,flux)
754  do j = jjs, jje
755  do i = iis-1, iie
756  flux(ke,i,j) = 0.0_rp
757  enddo
758  enddo
759 #ifdef DEBUG
760  k = iundef; i = iundef; j = iundef
761 #endif
762 
763  return
integer, public i_uyz
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxy_xyw_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxy_xyw_ud5 ( 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,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation Y-flux at XYW

Definition at line 775 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_debug::check(), scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

775  implicit none
776 
777  real(RP), intent(inout) :: flux (KA,IA,JA)
778  real(RP), intent(in) :: mom (KA,IA,JA)
779  real(RP), intent(in) :: val (KA,IA,JA)
780  real(RP), intent(in) :: DENS (KA,IA,JA)
781  real(RP), intent(in) :: GSQRT (KA,IA,JA)
782  real(RP), intent(in) :: MAPF ( IA,JA,2)
783  real(RP), intent(in) :: num_diff(KA,IA,JA)
784  real(RP), intent(in) :: CDZ (KA)
785  integer, intent(in) :: IIS, IIE, JJS, JJE
786 
787  real(RP) :: vel
788  integer :: k, i, j
789  !---------------------------------------------------------------------------
790 
791  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
792  !$omp private(vel) &
793  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,GSQRT,MAPF,num_diff) &
794  !$omp shared(CDZ)
795  do j = jjs-1, jje
796  do i = iis, iie
797  do k = ks, ke-1
798 #ifdef DEBUG
799  call check( __line__, mom(k ,i,j) )
800  call check( __line__, mom(k+1,i,j) )
801 
802  call check( __line__, val(k,i,j) )
803  call check( __line__, val(k,i,j+1) )
804 
805  call check( __line__, val(k,i,j-1) )
806  call check( __line__, val(k,i,j+2) )
807 
808  call check( __line__, val(k,i,j-2) )
809  call check( __line__, val(k,i,j+3) )
810 
811 #endif
812  vel = ( f2h(k,1,i_xvz) &
813  * mom(k+1,i,j) &
814  + f2h(k,2,i_xvz) &
815  * mom(k,i,j) ) &
816  / ( f2h(k,1,i_xvz) &
817  * 0.5_rp * ( dens(k+1,i,j)+dens(k+1,i,j+1) ) &
818  + f2h(k,2,i_xvz) &
819  * 0.5_rp * ( dens(k,i,j)+dens(k,i,j+1) ) )
820  flux(k,i,j) = gsqrt(k,i,j) / mapf(i,j,+1) * vel &
821  * ( ( f51 * ( val(k,i,j+3)+val(k,i,j-2) ) &
822  + f52 * ( val(k,i,j+2)+val(k,i,j-1) ) &
823  + f53 * ( val(k,i,j+1)+val(k,i,j) ) ) &
824  - ( f51 * ( val(k,i,j+3)-val(k,i,j-2) ) &
825  + f54 * ( val(k,i,j+2)-val(k,i,j-1) ) &
826  + f55 * ( val(k,i,j+1)-val(k,i,j) ) ) * sign(1.0_rp,vel) ) &
827  + gsqrt(k,i,j) * num_diff(k,i,j)
828  enddo
829  enddo
830  enddo
831 #ifdef DEBUG
832  k = iundef; i = iundef; j = iundef
833 #endif
834 
835  !$omp parallel do default(none) private(i,j) OMP_SCHEDULE_ collapse(2) &
836  !$omp private(vel) &
837  !$omp shared(JJS,JJE,IIS,IIE,KE,flux)
838  do j = jjs-1, jje
839  do i = iis, iie
840  flux(ke,i,j) = 0.0_rp
841  enddo
842  enddo
843 #ifdef DEBUG
844  k = iundef; i = iundef; j = iundef
845 #endif
846 
847  return
integer, public i_xvz
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxz_uyz_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxz_uyz_ud5 ( 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,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation z-flux at UY

Definition at line 860 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_debug::check(), scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

860  implicit none
861 
862  real(RP), intent(inout) :: flux (KA,IA,JA)
863  real(RP), intent(in) :: mom (KA,IA,JA)
864  real(RP), intent(in) :: val (KA,IA,JA)
865  real(RP), intent(in) :: DENS (KA,IA,JA)
866  real(RP), intent(in) :: GSQRT (KA,IA,JA)
867  real(RP), intent(in) :: J33G
868  real(RP), intent(in) :: num_diff(KA,IA,JA)
869  real(RP), intent(in) :: CDZ (KA)
870  integer, intent(in) :: IIS, IIE, JJS, JJE
871 
872  real(RP) :: vel
873  integer :: k, i, j
874  !---------------------------------------------------------------------------
875 
876  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
877  !$omp private(vel) &
878  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J33G,GSQRT,num_diff) &
879  !$omp shared(CDZ)
880  do j = jjs, jje
881  do i = iis, iie
882  do k = ks+2, ke-3
883 #ifdef DEBUG
884  call check( __line__, mom(k,i,j) )
885  call check( __line__, mom(k,i+1,j) )
886 
887  call check( __line__, val(k,i,j) )
888  call check( __line__, val(k+1,i,j) )
889 
890  call check( __line__, val(k-1,i,j) )
891  call check( __line__, val(k+2,i,j) )
892 
893  call check( __line__, val(k-2,i,j) )
894  call check( __line__, val(k+3,i,j) )
895 
896 #endif
897  vel = ( 0.5_rp * ( mom(k,i,j)+mom(k,i+1,j) ) ) &
898  / ( f2h(k,1,i_uyz) &
899  * 0.5_rp * ( dens(k+1,i,j)+dens(k+1,i+1,j) ) &
900  + f2h(k,2,i_uyz) &
901  * 0.5_rp * ( dens(k,i,j)+dens(k,i+1,j) ) )
902  flux(k,i,j) = j33g * vel &
903  * ( ( f51 * ( val(k+3,i,j)+val(k-2,i,j) ) &
904  + f52 * ( val(k+2,i,j)+val(k-1,i,j) ) &
905  + f53 * ( val(k+1,i,j)+val(k,i,j) ) ) &
906  - ( f51 * ( val(k+3,i,j)-val(k-2,i,j) ) &
907  + f54 * ( val(k+2,i,j)-val(k-1,i,j) ) &
908  + f55 * ( val(k+1,i,j)-val(k,i,j) ) ) * sign(1.0_rp,vel) ) &
909  + gsqrt(k,i,j) * num_diff(k,i,j)
910  enddo
911  enddo
912  enddo
913 #ifdef DEBUG
914  k = iundef; i = iundef; j = iundef
915 #endif
916 
917  !$omp parallel do default(none) private(i,j) OMP_SCHEDULE_ collapse(2) &
918  !$omp private(vel) &
919  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,flux,J33G,GSQRT,num_diff,DENS,CDZ)
920  do j = jjs, jje
921  do i = iis, iie
922 #ifdef DEBUG
923 
924  call check( __line__, mom(ks,i ,j) )
925  call check( __line__, mom(ks,i+1,j) )
926  call check( __line__, val(ks+1,i,j) )
927  call check( __line__, val(ks,i,j) )
928 
929  call check( __line__, mom(ks+1,i ,j) )
930  call check( __line__, mom(ks+1,i+1,j) )
931  call check( __line__, val(ks+3,i,j) )
932  call check( __line__, val(ks+2,i,j) )
933 
934 #endif
935  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS-1.
936  ! The flux at KS-1 can be non-zero.
937  ! To reduce calculations, all the fluxes are set to zero.
938  flux(ks-1,i,j) = 0.0_rp
939 
940  vel = ( 0.5_rp * ( mom(ks,i,j)+mom(ks,i+1,j) ) ) &
941  / ( f2h(ks,1,i_uyz) &
942  * 0.5_rp * ( dens(ks+1,i,j)+dens(ks+1,i+1,j) ) &
943  + f2h(ks,2,i_uyz) &
944  * 0.5_rp * ( dens(ks,i,j)+dens(ks,i+1,j) ) )
945  flux(ks,i,j) = j33g * vel &
946  * ( f2 * ( val(ks+1,i,j)+val(ks,i,j) ) ) &
947  + gsqrt(ks,i,j) * num_diff(ks,i,j)
948  vel = ( 0.5_rp * ( mom(ke-1,i,j)+mom(ke-1,i+1,j) ) ) &
949  / ( f2h(ke-1,1,i_uyz) &
950  * 0.5_rp * ( dens(ke,i,j)+dens(ke,i+1,j) ) &
951  + f2h(ke-1,2,i_uyz) &
952  * 0.5_rp * ( dens(ke-1,i,j)+dens(ke-1,i+1,j) ) )
953  flux(ke-1,i,j) = j33g * vel &
954  * ( f2 * ( val(ke,i,j)+val(ke-1,i,j) ) ) &
955  + gsqrt(ke-1,i,j) * num_diff(ke-1,i,j)
956 
957  vel = ( 0.5_rp * ( mom(ks+1,i,j)+mom(ks+1,i+1,j) ) ) &
958  / ( f2h(ks+1,1,i_uyz) &
959  * 0.5_rp * ( dens(ks+2,i,j)+dens(ks+2,i+1,j) ) &
960  + f2h(ks+1,2,i_uyz) &
961  * 0.5_rp * ( dens(ks+1,i,j)+dens(ks+1,i+1,j) ) )
962  flux(ks+1,i,j) = j33g * vel &
963  * ( ( f31 * ( val(ks+3,i,j)+val(ks,i,j) ) + f32 * ( val(ks+2,i,j)+val(ks+1,i,j) ) ) &
964  - ( f31 * ( val(ks+3,i,j)-val(ks,i,j) ) + f33 * ( val(ks+2,i,j)-val(ks+1,i,j) ) ) * sign(1.0_rp,vel) ) &
965  + gsqrt(ks+1,i,j) * num_diff(ks+1,i,j)
966  vel = ( 0.5_rp * ( mom(ke-2,i,j)+mom(ke-2,i+1,j) ) ) &
967  / ( f2h(ke-2,1,i_uyz) &
968  * 0.5_rp * ( dens(ke-1,i,j)+dens(ke-1,i+1,j) ) &
969  + f2h(ke-2,2,i_uyz) &
970  * 0.5_rp * ( dens(ke-2,i,j)+dens(ke-2,i+1,j) ) )
971  flux(ke-2,i,j) = j33g * vel &
972  * ( ( f31 * ( val(ke,i,j)+val(ke-3,i,j) ) + f32 * ( val(ke-1,i,j)+val(ke-2,i,j) ) ) &
973  - ( f31 * ( val(ke,i,j)-val(ke-3,i,j) ) + f33 * ( val(ke-1,i,j)-val(ke-2,i,j) ) ) * sign(1.0_rp,vel) ) &
974  + gsqrt(ke-2,i,j) * num_diff(ke-2,i,j)
975 
976  flux(ke,i,j) = 0.0_rp
977  enddo
978  enddo
979 #ifdef DEBUG
980  k = iundef; i = iundef; j = iundef
981 #endif
982 
983  return
integer, public i_uyz
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxj13_uyz_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxj13_uyz_ud5 ( 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,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation J13-flux at UYZ

Definition at line 994 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

994  implicit none
995 
996  real(RP), intent(inout) :: flux (KA,IA,JA)
997  real(RP), intent(in) :: mom (KA,IA,JA)
998  real(RP), intent(in) :: val (KA,IA,JA)
999  real(RP), intent(in) :: DENS (KA,IA,JA)
1000  real(RP), intent(in) :: GSQRT (KA,IA,JA)
1001  real(RP), intent(in) :: J13G (KA,IA,JA)
1002  real(RP), intent(in) :: MAPF ( IA,JA,2)
1003  real(RP), intent(in) :: CDZ (KA)
1004  integer, intent(in) :: IIS, IIE, JJS, JJE
1005 
1006  real(RP) :: vel
1007  integer :: k, i, j
1008  !---------------------------------------------------------------------------
1009 
1010  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
1011  !$omp private(vel) &
1012  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J13G,MAPF) &
1013  !$omp shared(GSQRT,CDZ)
1014  do j = jjs, jje
1015  do i = iis, iie
1016  do k = ks+2, ke-3
1017  vel = ( f2h(k,1,i_uyz) &
1018  * mom(k+1,i,j) &
1019  + f2h(k,2,i_uyz) &
1020  * mom(k,i,j) ) &
1021  / ( f2h(k,1,i_uyz) &
1022  * 0.5_rp * ( dens(k+1,i,j)+dens(k+1,i+1,j) ) &
1023  + f2h(k,2,i_uyz) &
1024  * 0.5_rp * ( dens(k,i,j)+dens(k,i+1,j) ) )
1025  flux(k,i,j) = j13g(k,i,j) / mapf(i,j,+2) * vel &
1026  * ( ( f51 * ( val(k+3,i,j)+val(k-2,i,j) ) &
1027  + f52 * ( val(k+2,i,j)+val(k-1,i,j) ) &
1028  + f53 * ( val(k+1,i,j)+val(k,i,j) ) ) &
1029  - ( f51 * ( val(k+3,i,j)-val(k-2,i,j) ) &
1030  + f54 * ( val(k+2,i,j)-val(k-1,i,j) ) &
1031  + f55 * ( val(k+1,i,j)-val(k,i,j) ) ) * sign(1.0_rp,vel) )
1032  enddo
1033  enddo
1034  enddo
1035 
1036  !$omp parallel do default(none) private(i,j) OMP_SCHEDULE_ collapse(2) &
1037  !$omp private(vel) &
1038  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J13G,MAPF) &
1039  !$omp shared(GSQRT,CDZ)
1040  do j = jjs, jje
1041  do i = iis, iie
1042  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS-1.
1043  ! The flux at KS-1 can be non-zero.
1044  ! To reduce calculations, all the fluxes are set to zero.
1045  flux(ks-1,i,j) = 0.0_rp
1046 
1047  vel = ( f2h(ks,1,i_uyz) &
1048  * mom(ks+1,i,j) &
1049  + f2h(ks,2,i_uyz) &
1050  * mom(ks,i,j) ) &
1051  / ( f2h(ks,1,i_uyz) &
1052  * 0.5_rp * ( dens(ks+1,i,j)+dens(ks+1,i+1,j) ) &
1053  + f2h(ks,2,i_uyz) &
1054  * 0.5_rp * ( dens(ks,i,j)+dens(ks,i+1,j) ) )
1055  flux(ks,i,j) = j13g(ks,i,j) / mapf(i,j,+2) * vel &
1056  * ( f2 * ( val(ks+1,i,j)+val(ks,i,j) ) )
1057 
1058  vel = ( f2h(ke-1,1,i_uyz) &
1059  * mom(ke,i,j) &
1060  + f2h(ke-1,2,i_uyz) &
1061  * mom(ke-1,i,j) ) &
1062  / ( f2h(ke-1,1,i_uyz) &
1063  * 0.5_rp * ( dens(ke,i,j)+dens(ke,i+1,j) ) &
1064  + f2h(ke-1,2,i_uyz) &
1065  * 0.5_rp * ( dens(ke-1,i,j)+dens(ke-1,i+1,j) ) )
1066  flux(ke-1,i,j) = j13g(ke-1,i,j) / mapf(i,j,+2) * vel &
1067  * ( f2 * ( val(ke,i,j)+val(ke-1,i,j) ) )
1068 
1069  vel = ( f2h(ks+1,1,i_uyz) &
1070  * mom(ks+2,i,j) &
1071  + f2h(ks+1,2,i_uyz) &
1072  * mom(ks+1,i,j) ) &
1073  / ( f2h(ks+1,1,i_uyz) &
1074  * 0.5_rp * ( dens(ks+2,i,j)+dens(ks+2,i+1,j) ) &
1075  + f2h(ks+1,2,i_uyz) &
1076  * 0.5_rp * ( dens(ks+1,i,j)+dens(ks+1,i+1,j) ) )
1077  flux(ks+1,i,j) = j13g(ks+1,i,j) / mapf(i,j,+2) * vel &
1078  * ( ( f31 * ( val(ks+3,i,j)+val(ks,i,j) ) + f32 * ( val(ks+2,i,j)+val(ks+1,i,j) ) ) &
1079  - ( f31 * ( val(ks+3,i,j)-val(ks,i,j) ) + f33 * ( val(ks+2,i,j)-val(ks+1,i,j) ) ) * sign(1.0_rp,vel) )
1080 
1081  vel = ( f2h(ke-2,1,i_uyz) &
1082  * mom(ke-1,i,j) &
1083  + f2h(ke-2,2,i_uyz) &
1084  * mom(ke-2,i,j) ) &
1085  / ( f2h(ke-2,1,i_uyz) &
1086  * 0.5_rp * ( dens(ke-1,i,j)+dens(ke-1,i+1,j) ) &
1087  + f2h(ke-2,2,i_uyz) &
1088  * 0.5_rp * ( dens(ke-2,i,j)+dens(ke-2,i+1,j) ) )
1089  flux(ke-2,i,j) = j13g(ke-2,i,j) / mapf(i,j,+2) * vel &
1090  * ( ( f31 * ( val(ke,i,j)+val(ke-3,i,j) ) + f32 * ( val(ke-1,i,j)+val(ke-2,i,j) ) ) &
1091  - ( f31 * ( val(ke,i,j)-val(ke-3,i,j) ) + f33 * ( val(ke-1,i,j)-val(ke-2,i,j) ) ) * sign(1.0_rp,vel) )
1092 
1093  flux(ke ,i,j) = 0.0_rp
1094  enddo
1095  enddo
1096 
1097  return
integer, public i_uyz
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxj23_uyz_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxj23_uyz_ud5 ( 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,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation J23-flux at UYZ

Definition at line 1108 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

1108  implicit none
1109 
1110  real(RP), intent(inout) :: flux (KA,IA,JA)
1111  real(RP), intent(in) :: mom (KA,IA,JA)
1112  real(RP), intent(in) :: val (KA,IA,JA)
1113  real(RP), intent(in) :: DENS (KA,IA,JA)
1114  real(RP), intent(in) :: GSQRT (KA,IA,JA)
1115  real(RP), intent(in) :: J23G (KA,IA,JA)
1116  real(RP), intent(in) :: MAPF ( IA,JA,2)
1117  real(RP), intent(in) :: CDZ (KA)
1118  integer, intent(in) :: IIS, IIE, JJS, JJE
1119 
1120  real(RP) :: vel
1121  integer :: k, i, j
1122  !---------------------------------------------------------------------------
1123 
1124  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
1125  !$omp private(vel) &
1126  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J23G,MAPF) &
1127  !$omp shared(GSQRT,CDZ)
1128  do j = jjs, jje
1129  do i = iis, iie
1130  do k = ks+2, ke-3
1131  vel = ( f2h(k,1,i_uyz) &
1132  * 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) ) &
1133  + f2h(k,2,i_uyz) &
1134  * 0.25_rp * ( mom(k,i,j)+mom(k,i+1,j)+mom(k,i,j-1)+mom(k,i+1,j-1) ) ) &
1135  / ( f2h(k,1,i_uyz) &
1136  * 0.5_rp * ( dens(k+1,i,j)+dens(k+1,i+1,j) ) &
1137  + f2h(k,2,i_uyz) &
1138  * 0.5_rp * ( dens(k,i,j)+dens(k,i+1,j) ) )
1139  flux(k,i,j) = j23g(k,i,j) / mapf(i,j,+1) * vel &
1140  * ( ( f51 * ( val(k+3,i,j)+val(k-2,i,j) ) &
1141  + f52 * ( val(k+2,i,j)+val(k-1,i,j) ) &
1142  + f53 * ( val(k+1,i,j)+val(k,i,j) ) ) &
1143  - ( f51 * ( val(k+3,i,j)-val(k-2,i,j) ) &
1144  + f54 * ( val(k+2,i,j)-val(k-1,i,j) ) &
1145  + f55 * ( val(k+1,i,j)-val(k,i,j) ) ) * sign(1.0_rp,vel) )
1146  enddo
1147  enddo
1148  enddo
1149 
1150  !$omp parallel do default(none) private(i,j) OMP_SCHEDULE_ collapse(2) &
1151  !$omp private(vel) &
1152  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J23G,MAPF) &
1153  !$omp shared(GSQRT,CDZ)
1154  do j = jjs, jje
1155  do i = iis, iie
1156  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS-1.
1157  ! The flux at KS-1 can be non-zero.
1158  ! To reduce calculations, all the fluxes are set to zero.
1159  flux(ks-1,i,j) = 0.0_rp
1160 
1161  vel = ( f2h(ks,1,i_uyz) &
1162  * 0.25_rp * ( mom(ks+1,i,j)+mom(ks+1,i+1,j)+mom(ks+1,i,j-1)+mom(ks+1,i+1,j-1) ) &
1163  + f2h(ks,2,i_uyz) &
1164  * 0.25_rp * ( mom(ks,i,j)+mom(ks,i+1,j)+mom(ks,i,j-1)+mom(ks,i+1,j-1) ) ) &
1165  / ( f2h(ks,1,i_uyz) &
1166  * 0.5_rp * ( dens(ks+1,i,j)+dens(ks+1,i+1,j) ) &
1167  + f2h(ks,2,i_uyz) &
1168  * 0.5_rp * ( dens(ks,i,j)+dens(ks,i+1,j) ) )
1169  flux(ks,i,j) = j23g(ks,i,j) / mapf(i,j,+1) * vel &
1170  * ( f2 * ( val(ks+1,i,j)+val(ks,i,j) ) )
1171 
1172  vel = ( f2h(ke-1,1,i_uyz) &
1173  * 0.25_rp * ( mom(ke,i,j)+mom(ke,i+1,j)+mom(ke,i,j-1)+mom(ke,i+1,j-1) ) &
1174  + f2h(ke-1,2,i_uyz) &
1175  * 0.25_rp * ( mom(ke-1,i,j)+mom(ke-1,i+1,j)+mom(ke-1,i,j-1)+mom(ke-1,i+1,j-1) ) ) &
1176  / ( f2h(ke-1,1,i_uyz) &
1177  * 0.5_rp * ( dens(ke,i,j)+dens(ke,i+1,j) ) &
1178  + f2h(ke-1,2,i_uyz) &
1179  * 0.5_rp * ( dens(ke-1,i,j)+dens(ke-1,i+1,j) ) )
1180  flux(ke-1,i,j) = j23g(ke-1,i,j) / mapf(i,j,+1) * vel &
1181  * ( f2 * ( val(ke,i,j)+val(ke-1,i,j) ) )
1182 
1183  vel = ( f2h(ks+1,1,i_uyz) &
1184  * 0.25_rp * ( mom(ks+2,i,j)+mom(ks+2,i+1,j)+mom(ks+2,i,j-1)+mom(ks+2,i+1,j-1) ) &
1185  + f2h(ks+1,2,i_uyz) &
1186  * 0.25_rp * ( mom(ks+1,i,j)+mom(ks+1,i+1,j)+mom(ks+1,i,j-1)+mom(ks+1,i+1,j-1) ) ) &
1187  / ( f2h(ks+1,1,i_uyz) &
1188  * 0.5_rp * ( dens(ks+2,i,j)+dens(ks+2,i+1,j) ) &
1189  + f2h(ks+1,2,i_uyz) &
1190  * 0.5_rp * ( dens(ks+1,i,j)+dens(ks+1,i+1,j) ) )
1191  flux(ks+1,i,j) = j23g(ks+1,i,j) / mapf(i,j,+1) * vel &
1192  * ( ( f31 * ( val(ks+3,i,j)+val(ks,i,j) ) + f32 * ( val(ks+2,i,j)+val(ks+1,i,j) ) ) &
1193  - ( f31 * ( val(ks+3,i,j)-val(ks,i,j) ) + f33 * ( val(ks+2,i,j)-val(ks+1,i,j) ) ) * sign(1.0_rp,vel) )
1194 
1195  vel = ( f2h(ke-2,1,i_uyz) &
1196  * 0.25_rp * ( mom(ke-1,i,j)+mom(ke-1,i+1,j)+mom(ke-1,i,j-1)+mom(ke-1,i+1,j-1) ) &
1197  + f2h(ke-2,2,i_uyz) &
1198  * 0.25_rp * ( mom(ke-2,i,j)+mom(ke-2,i+1,j)+mom(ke-2,i,j-1)+mom(ke-2,i+1,j-1) ) ) &
1199  / ( f2h(ke-2,1,i_uyz) &
1200  * 0.5_rp * ( dens(ke-1,i,j)+dens(ke-1,i+1,j) ) &
1201  + f2h(ke-2,2,i_uyz) &
1202  * 0.5_rp * ( dens(ke-2,i,j)+dens(ke-2,i+1,j) ) )
1203  flux(ke-2,i,j) = j23g(ke-2,i,j) / mapf(i,j,+1) * vel &
1204  * ( ( f31 * ( val(ke,i,j)+val(ke-3,i,j) ) + f32 * ( val(ke-1,i,j)+val(ke-2,i,j) ) ) &
1205  - ( f31 * ( val(ke,i,j)-val(ke-3,i,j) ) + f33 * ( val(ke-1,i,j)-val(ke-2,i,j) ) ) * sign(1.0_rp,vel) )
1206 
1207  flux(ke ,i,j) = 0.0_rp
1208  enddo
1209  enddo
1210 
1211  return
integer, public i_uyz
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxx_uyz_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxx_uyz_ud5 ( 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,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation X-flux at UY

Definition at line 1223 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_debug::check(), scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

1223  implicit none
1224 
1225  real(RP), intent(inout) :: flux (KA,IA,JA)
1226  real(RP), intent(in) :: mom (KA,IA,JA)
1227  real(RP), intent(in) :: val (KA,IA,JA)
1228  real(RP), intent(in) :: DENS (KA,IA,JA)
1229  real(RP), intent(in) :: GSQRT (KA,IA,JA)
1230  real(RP), intent(in) :: MAPF ( IA,JA,2)
1231  real(RP), intent(in) :: num_diff(KA,IA,JA)
1232  real(RP), intent(in) :: CDZ (KA)
1233  integer, intent(in) :: IIS, IIE, JJS, JJE
1234 
1235  real(RP) :: vel
1236  integer :: k, i, j
1237  !---------------------------------------------------------------------------
1238 
1239  ! note that x-index is added by -1
1240 
1241  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
1242  !$omp private(vel) &
1243  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,GSQRT,MAPF,num_diff)
1244  do j = jjs, jje
1245  do i = iis, iie+1
1246  do k = ks, ke
1247 #ifdef DEBUG
1248  call check( __line__, mom(k,i ,j) )
1249  call check( __line__, mom(k,i-1,j) )
1250 
1251  call check( __line__, val(k,i-1,j) )
1252  call check( __line__, val(k,i,j) )
1253 
1254  call check( __line__, val(k,i-2,j) )
1255  call check( __line__, val(k,i+1,j) )
1256 
1257  call check( __line__, val(k,i-3,j) )
1258  call check( __line__, val(k,i+2,j) )
1259 
1260 #endif
1261  vel = ( 0.5_rp * ( mom(k,i,j)+mom(k,i-1,j) ) ) &
1262  / ( dens(k,i,j) )
1263  flux(k,i-1,j) = gsqrt(k,i,j) / mapf(i,j,+2) * vel &
1264  * ( ( f51 * ( val(k,i+2,j)+val(k,i-3,j) ) &
1265  + f52 * ( val(k,i+1,j)+val(k,i-2,j) ) &
1266  + f53 * ( val(k,i,j)+val(k,i-1,j) ) ) &
1267  - ( f51 * ( val(k,i+2,j)-val(k,i-3,j) ) &
1268  + f54 * ( val(k,i+1,j)-val(k,i-2,j) ) &
1269  + f55 * ( val(k,i,j)-val(k,i-1,j) ) ) * sign(1.0_rp,vel) ) &
1270  + gsqrt(k,i,j) * num_diff(k,i,j)
1271  enddo
1272  enddo
1273  enddo
1274 #ifdef DEBUG
1275  k = iundef; i = iundef; j = iundef
1276 #endif
1277 
1278  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxy_uyz_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxy_uyz_ud5 ( 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,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation Y-flux at UY

Definition at line 1290 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_debug::check(), scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

1290  implicit none
1291 
1292  real(RP), intent(inout) :: flux (KA,IA,JA)
1293  real(RP), intent(in) :: mom (KA,IA,JA)
1294  real(RP), intent(in) :: val (KA,IA,JA)
1295  real(RP), intent(in) :: DENS (KA,IA,JA)
1296  real(RP), intent(in) :: GSQRT (KA,IA,JA)
1297  real(RP), intent(in) :: MAPF ( IA,JA,2)
1298  real(RP), intent(in) :: num_diff(KA,IA,JA)
1299  real(RP), intent(in) :: CDZ (KA)
1300  integer, intent(in) :: IIS, IIE, JJS, JJE
1301 
1302  real(RP) :: vel
1303  integer :: k, i, j
1304  !---------------------------------------------------------------------------
1305 
1306  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
1307  !$omp private(vel) &
1308  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,GSQRT,MAPF,num_diff)
1309  do j = jjs-1, jje
1310  do i = iis, iie
1311  do k = ks, ke
1312 #ifdef DEBUG
1313  call check( __line__, mom(k,i ,j) )
1314  call check( __line__, mom(k,i-1,j) )
1315 
1316  call check( __line__, val(k,i,j) )
1317  call check( __line__, val(k,i,j+1) )
1318 
1319  call check( __line__, val(k,i,j-1) )
1320  call check( __line__, val(k,i,j+2) )
1321 
1322  call check( __line__, val(k,i,j-2) )
1323  call check( __line__, val(k,i,j+3) )
1324 
1325 #endif
1326  vel = ( 0.5_rp * ( mom(k,i,j)+mom(k,i+1,j) ) ) &
1327  / ( 0.25_rp * ( dens(k,i,j)+dens(k,i+1,j)+dens(k,i,j+1)+dens(k,i+1,j+1) ) )
1328  flux(k,i,j) = gsqrt(k,i,j) / mapf(i,j,+1) * vel &
1329  * ( ( f51 * ( val(k,i,j+3)+val(k,i,j-2) ) &
1330  + f52 * ( val(k,i,j+2)+val(k,i,j-1) ) &
1331  + f53 * ( val(k,i,j+1)+val(k,i,j) ) ) &
1332  - ( f51 * ( val(k,i,j+3)-val(k,i,j-2) ) &
1333  + f54 * ( val(k,i,j+2)-val(k,i,j-1) ) &
1334  + f55 * ( val(k,i,j+1)-val(k,i,j) ) ) * sign(1.0_rp,vel) ) &
1335  + gsqrt(k,i,j) * num_diff(k,i,j)
1336  enddo
1337  enddo
1338  enddo
1339 #ifdef DEBUG
1340  k = iundef; i = iundef; j = iundef
1341 #endif
1342 
1343  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxz_xvz_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxz_xvz_ud5 ( 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,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation z-flux at XV

Definition at line 1357 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_debug::check(), scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

1357  implicit none
1358 
1359  real(RP), intent(inout) :: flux (KA,IA,JA)
1360  real(RP), intent(in) :: mom (KA,IA,JA)
1361  real(RP), intent(in) :: val (KA,IA,JA)
1362  real(RP), intent(in) :: DENS (KA,IA,JA)
1363  real(RP), intent(in) :: GSQRT (KA,IA,JA)
1364  real(RP), intent(in) :: J33G
1365  real(RP), intent(in) :: num_diff(KA,IA,JA)
1366  real(RP), intent(in) :: CDZ (KA)
1367  integer, intent(in) :: IIS, IIE, JJS, JJE
1368 
1369  real(RP) :: vel
1370  integer :: k, i, j
1371  !---------------------------------------------------------------------------
1372 
1373  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
1374  !$omp private(vel) &
1375  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J33G,GSQRT,num_diff) &
1376  !$omp shared(CDZ)
1377  do j = jjs, jje
1378  do i = iis, iie
1379  do k = ks+2, ke-3
1380 #ifdef DEBUG
1381  call check( __line__, mom(k,i,j) )
1382  call check( __line__, mom(k,i,j+1) )
1383 
1384  call check( __line__, val(k,i,j) )
1385  call check( __line__, val(k+1,i,j) )
1386 
1387  call check( __line__, val(k-1,i,j) )
1388  call check( __line__, val(k+2,i,j) )
1389 
1390  call check( __line__, val(k-2,i,j) )
1391  call check( __line__, val(k+3,i,j) )
1392 
1393 #endif
1394  vel = ( 0.5_rp * ( mom(k,i,j)+mom(k,i,j+1) ) ) &
1395  / ( f2h(k,1,i_xvz) &
1396  * 0.5_rp * ( dens(k+1,i,j)+dens(k+1,i,j+1) ) &
1397  + f2h(k,2,i_xvz) &
1398  * 0.5_rp * ( dens(k,i,j)+dens(k,i,j+1) ) )
1399  flux(k,i,j) = j33g * vel &
1400  * ( ( f51 * ( val(k+3,i,j)+val(k-2,i,j) ) &
1401  + f52 * ( val(k+2,i,j)+val(k-1,i,j) ) &
1402  + f53 * ( val(k+1,i,j)+val(k,i,j) ) ) &
1403  - ( f51 * ( val(k+3,i,j)-val(k-2,i,j) ) &
1404  + f54 * ( val(k+2,i,j)-val(k-1,i,j) ) &
1405  + f55 * ( val(k+1,i,j)-val(k,i,j) ) ) * sign(1.0_rp,vel) ) &
1406  + gsqrt(k,i,j) * num_diff(k,i,j)
1407  enddo
1408  enddo
1409  enddo
1410 #ifdef DEBUG
1411  k = iundef; i = iundef; j = iundef
1412 #endif
1413 
1414  !$omp parallel do default(none) private(i,j) OMP_SCHEDULE_ collapse(2) &
1415  !$omp private(vel) &
1416  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,flux,J33G,GSQRT,num_diff,DENS,CDZ)
1417  do j = jjs, jje
1418  do i = iis, iie
1419 #ifdef DEBUG
1420 
1421  call check( __line__, mom(ks,i ,j) )
1422  call check( __line__, mom(ks,i,j+1) )
1423  call check( __line__, val(ks+1,i,j) )
1424  call check( __line__, val(ks,i,j) )
1425 
1426  call check( __line__, mom(ks+1,i ,j) )
1427  call check( __line__, mom(ks+1,i,j+1) )
1428  call check( __line__, val(ks+3,i,j) )
1429  call check( __line__, val(ks+2,i,j) )
1430 
1431 #endif
1432  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS-1.
1433  ! The flux at KS-1 can be non-zero.
1434  ! To reduce calculations, all the fluxes are set to zero.
1435  flux(ks-1,i,j) = 0.0_rp
1436 
1437  vel = ( 0.5_rp * ( mom(ks,i,j)+mom(ks,i,j+1) ) ) &
1438  / ( f2h(ks,1,i_xvz) &
1439  * 0.5_rp * ( dens(ks+1,i,j)+dens(ks+1,i,j+1) ) &
1440  + f2h(ks,2,i_xvz) &
1441  * 0.5_rp * ( dens(ks,i,j)+dens(ks,i,j+1) ) )
1442  flux(ks,i,j) = j33g * vel &
1443  * ( f2 * ( val(ks+1,i,j)+val(ks,i,j) ) ) &
1444  + gsqrt(ks,i,j) * num_diff(ks,i,j)
1445  vel = ( 0.5_rp * ( mom(ke-1,i,j)+mom(ke-1,i,j+1) ) ) &
1446  / ( f2h(ke-1,1,i_xvz) &
1447  * 0.5_rp * ( dens(ke,i,j)+dens(ke,i,j+1) ) &
1448  + f2h(ke-1,2,i_xvz) &
1449  * 0.5_rp * ( dens(ke-1,i,j)+dens(ke-1,i,j+1) ) )
1450  flux(ke-1,i,j) = j33g * vel &
1451  * ( f2 * ( val(ke,i,j)+val(ke-1,i,j) ) ) &
1452  + gsqrt(ke-1,i,j) * num_diff(ke-1,i,j)
1453 
1454  vel = ( 0.5_rp * ( mom(ks+1,i,j)+mom(ks+1,i,j+1) ) ) &
1455  / ( f2h(ks+1,1,i_xvz) &
1456  * 0.5_rp * ( dens(ks+2,i,j)+dens(ks+2,i,j+1) ) &
1457  + f2h(ks+1,2,i_xvz) &
1458  * 0.5_rp * ( dens(ks+1,i,j)+dens(ks+1,i,j+1) ) )
1459  flux(ks+1,i,j) = j33g * vel &
1460  * ( ( f31 * ( val(ks+3,i,j)+val(ks,i,j) ) + f32 * ( val(ks+2,i,j)+val(ks+1,i,j) ) ) &
1461  - ( f31 * ( val(ks+3,i,j)-val(ks,i,j) ) + f33 * ( val(ks+2,i,j)-val(ks+1,i,j) ) ) * sign(1.0_rp,vel) ) &
1462  + gsqrt(ks+1,i,j) * num_diff(ks+1,i,j)
1463  vel = ( 0.5_rp * ( mom(ke-2,i,j)+mom(ke-2,i,j+1) ) ) &
1464  / ( f2h(ke-2,1,i_xvz) &
1465  * 0.5_rp * ( dens(ke-1,i,j)+dens(ke-1,i,j+1) ) &
1466  + f2h(ke-2,2,i_xvz) &
1467  * 0.5_rp * ( dens(ke-2,i,j)+dens(ke-2,i,j+1) ) )
1468  flux(ke-2,i,j) = j33g * vel &
1469  * ( ( f31 * ( val(ke,i,j)+val(ke-3,i,j) ) + f32 * ( val(ke-1,i,j)+val(ke-2,i,j) ) ) &
1470  - ( f31 * ( val(ke,i,j)-val(ke-3,i,j) ) + f33 * ( val(ke-1,i,j)-val(ke-2,i,j) ) ) * sign(1.0_rp,vel) ) &
1471  + gsqrt(ke-2,i,j) * num_diff(ke-2,i,j)
1472 
1473  flux(ke,i,j) = 0.0_rp
1474  enddo
1475  enddo
1476 #ifdef DEBUG
1477  k = iundef; i = iundef; j = iundef
1478 #endif
1479 
1480  return
integer, public i_xvz
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxj13_xvz_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxj13_xvz_ud5 ( 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,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation J13-flux at XVZ

Definition at line 1491 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

1491  implicit none
1492 
1493  real(RP), intent(inout) :: flux (KA,IA,JA)
1494  real(RP), intent(in) :: mom (KA,IA,JA)
1495  real(RP), intent(in) :: val (KA,IA,JA)
1496  real(RP), intent(in) :: DENS (KA,IA,JA)
1497  real(RP), intent(in) :: GSQRT (KA,IA,JA)
1498  real(RP), intent(in) :: J13G (KA,IA,JA)
1499  real(RP), intent(in) :: MAPF ( IA,JA,2)
1500  real(RP), intent(in) :: CDZ (KA)
1501  integer, intent(in) :: IIS, IIE, JJS, JJE
1502 
1503  real(RP) :: vel
1504  integer :: k, i, j
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,J13G,MAPF) &
1510  !$omp shared(GSQRT,CDZ)
1511  do j = jjs, jje
1512  do i = iis, iie
1513  do k = ks+2, ke-3
1514  vel = ( f2h(k,1,i_xvz) &
1515  * 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) ) &
1516  + f2h(k,2,i_xvz) &
1517  * 0.25_rp * ( mom(k,i,j)+mom(k,i-1,j)+mom(k,i,j+1)+mom(k,i-1,j+1) ) ) &
1518  / ( f2h(k,1,i_xvz) &
1519  * 0.5_rp * ( dens(k+1,i,j)+dens(k+1,i,j+1) ) &
1520  + f2h(k,2,i_xvz) &
1521  * 0.5_rp * ( dens(k,i,j)+dens(k,i,j+1) ) )
1522  flux(k,i,j) = j13g(k,i,j) / mapf(i,j,+2) * vel &
1523  * ( ( f51 * ( val(k+3,i,j)+val(k-2,i,j) ) &
1524  + f52 * ( val(k+2,i,j)+val(k-1,i,j) ) &
1525  + f53 * ( val(k+1,i,j)+val(k,i,j) ) ) &
1526  - ( f51 * ( val(k+3,i,j)-val(k-2,i,j) ) &
1527  + f54 * ( val(k+2,i,j)-val(k-1,i,j) ) &
1528  + f55 * ( val(k+1,i,j)-val(k,i,j) ) ) * sign(1.0_rp,vel) )
1529  enddo
1530  enddo
1531  enddo
1532 
1533  !$omp parallel do default(none) private(i,j) OMP_SCHEDULE_ collapse(2) &
1534  !$omp private(vel) &
1535  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J13G,MAPF) &
1536  !$omp shared(GSQRT,CDZ)
1537  do j = jjs, jje
1538  do i = iis, iie
1539  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS-1.
1540  ! The flux at KS-1 can be non-zero.
1541  ! To reduce calculations, all the fluxes are set to zero.
1542  flux(ks-1,i,j) = 0.0_rp
1543 
1544  vel = ( f2h(ks,1,i_xvz) &
1545  * 0.25_rp * ( mom(ks+1,i,j)+mom(ks+1,i-1,j)+mom(ks+1,i,j+1)+mom(ks+1,i-1,j+1) ) &
1546  + f2h(ks,2,i_xvz) &
1547  * 0.25_rp * ( mom(ks,i,j)+mom(ks,i-1,j)+mom(ks,i,j+1)+mom(ks,i-1,j+1) ) ) &
1548  / ( f2h(ks,1,i_xvz) &
1549  * 0.5_rp * ( dens(ks+1,i,j)+dens(ks+1,i,j+1) ) &
1550  + f2h(ks,2,i_xvz) &
1551  * 0.5_rp * ( dens(ks,i,j)+dens(ks,i,j+1) ) )
1552  flux(ks,i,j) = j13g(ks,i,j) / mapf(i,j,+2) * vel &
1553  * ( f2 * ( val(ks+1,i,j)+val(ks,i,j) ) )
1554 
1555  vel = ( f2h(ke-1,1,i_xvz) &
1556  * 0.25_rp * ( mom(ke,i,j)+mom(ke,i-1,j)+mom(ke,i,j+1)+mom(ke,i-1,j+1) ) &
1557  + f2h(ke-1,2,i_xvz) &
1558  * 0.25_rp * ( mom(ke-1,i,j)+mom(ke-1,i-1,j)+mom(ke-1,i,j+1)+mom(ke-1,i-1,j+1) ) ) &
1559  / ( f2h(ke-1,1,i_xvz) &
1560  * 0.5_rp * ( dens(ke,i,j)+dens(ke,i,j+1) ) &
1561  + f2h(ke-1,2,i_xvz) &
1562  * 0.5_rp * ( dens(ke-1,i,j)+dens(ke-1,i,j+1) ) )
1563  flux(ke-1,i,j) = j13g(ke-1,i,j) / mapf(i,j,+2) * vel &
1564  * ( f2 * ( val(ke,i,j)+val(ke-1,i,j) ) )
1565 
1566  vel = ( f2h(ks+1,1,i_xvz) &
1567  * 0.25_rp * ( mom(ks+2,i,j)+mom(ks+2,i-1,j)+mom(ks+2,i,j+1)+mom(ks+2,i-1,j+1) ) &
1568  + f2h(ks+1,2,i_xvz) &
1569  * 0.25_rp * ( mom(ks+1,i,j)+mom(ks+1,i-1,j)+mom(ks+1,i,j+1)+mom(ks+1,i-1,j+1) ) ) &
1570  / ( f2h(ks+1,1,i_xvz) &
1571  * 0.5_rp * ( dens(ks+2,i,j)+dens(ks+2,i,j+1) ) &
1572  + f2h(ks+1,2,i_xvz) &
1573  * 0.5_rp * ( dens(ks+1,i,j)+dens(ks+1,i,j+1) ) )
1574  flux(ks+1,i,j) = j13g(ks+1,i,j) / mapf(i,j,+2) * vel &
1575  * ( ( f31 * ( val(ks+3,i,j)+val(ks,i,j) ) + f32 * ( val(ks+2,i,j)+val(ks+1,i,j) ) ) &
1576  - ( f31 * ( val(ks+3,i,j)-val(ks,i,j) ) + f33 * ( val(ks+2,i,j)-val(ks+1,i,j) ) ) * sign(1.0_rp,vel) )
1577 
1578  vel = ( f2h(ke-2,1,i_xvz) &
1579  * 0.25_rp * ( mom(ke-1,i,j)+mom(ke-1,i-1,j)+mom(ke-1,i,j+1)+mom(ke-1,i-1,j+1) ) &
1580  + f2h(ke-2,2,i_xvz) &
1581  * 0.25_rp * ( mom(ke-2,i,j)+mom(ke-2,i-1,j)+mom(ke-2,i,j+1)+mom(ke-2,i-1,j+1) ) ) &
1582  / ( f2h(ke-2,1,i_xvz) &
1583  * 0.5_rp * ( dens(ke-1,i,j)+dens(ke-1,i,j+1) ) &
1584  + f2h(ke-2,2,i_xvz) &
1585  * 0.5_rp * ( dens(ke-2,i,j)+dens(ke-2,i,j+1) ) )
1586  flux(ke-2,i,j) = j13g(ke-2,i,j) / mapf(i,j,+2) * vel &
1587  * ( ( f31 * ( val(ke,i,j)+val(ke-3,i,j) ) + f32 * ( val(ke-1,i,j)+val(ke-2,i,j) ) ) &
1588  - ( f31 * ( val(ke,i,j)-val(ke-3,i,j) ) + f33 * ( val(ke-1,i,j)-val(ke-2,i,j) ) ) * sign(1.0_rp,vel) )
1589 
1590  flux(ke ,i,j) = 0.0_rp
1591  enddo
1592  enddo
1593 
1594  return
integer, public i_xvz
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxj23_xvz_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxj23_xvz_ud5 ( 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,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation J23-flux at XVZ

Definition at line 1605 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

1605  implicit none
1606 
1607  real(RP), intent(inout) :: flux (KA,IA,JA)
1608  real(RP), intent(in) :: mom (KA,IA,JA)
1609  real(RP), intent(in) :: val (KA,IA,JA)
1610  real(RP), intent(in) :: DENS (KA,IA,JA)
1611  real(RP), intent(in) :: GSQRT (KA,IA,JA)
1612  real(RP), intent(in) :: J23G (KA,IA,JA)
1613  real(RP), intent(in) :: MAPF ( IA,JA,2)
1614  real(RP), intent(in) :: CDZ (KA)
1615  integer, intent(in) :: IIS, IIE, JJS, JJE
1616 
1617  real(RP) :: vel
1618  integer :: k, i, j
1619  !---------------------------------------------------------------------------
1620 
1621  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
1622  !$omp private(vel) &
1623  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J23G,MAPF) &
1624  !$omp shared(GSQRT,CDZ)
1625  do j = jjs, jje
1626  do i = iis, iie
1627  do k = ks+2, ke-3
1628  vel = ( f2h(k,1,i_xvz) &
1629  * mom(k+1,i,j) &
1630  + f2h(k,2,i_xvz) &
1631  * mom(k,i,j) ) &
1632  / ( f2h(k,1,i_xvz) &
1633  * 0.5_rp * ( dens(k+1,i,j)+dens(k+1,i,j+1) ) &
1634  + f2h(k,2,i_xvz) &
1635  * 0.5_rp * ( dens(k,i,j)+dens(k,i,j+1) ) )
1636  flux(k,i,j) = j23g(k,i,j) / mapf(i,j,+1) * vel &
1637  * ( ( f51 * ( val(k+3,i,j)+val(k-2,i,j) ) &
1638  + f52 * ( val(k+2,i,j)+val(k-1,i,j) ) &
1639  + f53 * ( val(k+1,i,j)+val(k,i,j) ) ) &
1640  - ( f51 * ( val(k+3,i,j)-val(k-2,i,j) ) &
1641  + f54 * ( val(k+2,i,j)-val(k-1,i,j) ) &
1642  + f55 * ( val(k+1,i,j)-val(k,i,j) ) ) * sign(1.0_rp,vel) )
1643  enddo
1644  enddo
1645  enddo
1646 
1647  !$omp parallel do default(none) private(i,j) OMP_SCHEDULE_ collapse(2) &
1648  !$omp private(vel) &
1649  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,J23G,MAPF) &
1650  !$omp shared(GSQRT,CDZ)
1651  do j = jjs, jje
1652  do i = iis, iie
1653  ! The boundary condition is qflx_hi + qflxJ13 + qfluxJ23 = 0 at KS-1.
1654  ! The flux at KS-1 can be non-zero.
1655  ! To reduce calculations, all the fluxes are set to zero.
1656  flux(ks-1,i,j) = 0.0_rp
1657 
1658  vel = ( f2h(ks,1,i_xvz) &
1659  * mom(ks+1,i,j) &
1660  + f2h(ks,2,i_xvz) &
1661  * mom(ks,i,j) ) &
1662  / ( f2h(ks,1,i_xvz) &
1663  * 0.5_rp * ( dens(ks+1,i,j)+dens(ks+1,i,j+1) ) &
1664  + f2h(ks,2,i_xvz) &
1665  * 0.5_rp * ( dens(ks,i,j)+dens(ks,i,j+1) ) )
1666  flux(ks,i,j) = j23g(ks,i,j) / mapf(i,j,+1) * vel &
1667  * ( f2 * ( val(ks+1,i,j)+val(ks,i,j) ) )
1668 
1669  vel = ( f2h(ke-1,1,i_xvz) &
1670  * mom(ke,i,j) &
1671  + f2h(ke-1,2,i_xvz) &
1672  * mom(ke-1,i,j) ) &
1673  / ( f2h(ke-1,1,i_xvz) &
1674  * 0.5_rp * ( dens(ke,i,j)+dens(ke,i,j+1) ) &
1675  + f2h(ke-1,2,i_xvz) &
1676  * 0.5_rp * ( dens(ke-1,i,j)+dens(ke-1,i,j+1) ) )
1677  flux(ke-1,i,j) = j23g(ke-1,i,j) / mapf(i,j,+1) * vel &
1678  * ( f2 * ( val(ke,i,j)+val(ke-1,i,j) ) )
1679 
1680  vel = ( f2h(ks+1,1,i_xvz) &
1681  * mom(ks+2,i,j) &
1682  + f2h(ks+1,2,i_xvz) &
1683  * mom(ks+1,i,j) ) &
1684  / ( f2h(ks+1,1,i_xvz) &
1685  * 0.5_rp * ( dens(ks+2,i,j)+dens(ks+2,i,j+1) ) &
1686  + f2h(ks+1,2,i_xvz) &
1687  * 0.5_rp * ( dens(ks+1,i,j)+dens(ks+1,i,j+1) ) )
1688  flux(ks+1,i,j) = j23g(ks+1,i,j) / mapf(i,j,+1) * vel &
1689  * ( ( f31 * ( val(ks+3,i,j)+val(ks,i,j) ) + f32 * ( val(ks+2,i,j)+val(ks+1,i,j) ) ) &
1690  - ( f31 * ( val(ks+3,i,j)-val(ks,i,j) ) + f33 * ( val(ks+2,i,j)-val(ks+1,i,j) ) ) * sign(1.0_rp,vel) )
1691 
1692  vel = ( f2h(ke-2,1,i_xvz) &
1693  * mom(ke-1,i,j) &
1694  + f2h(ke-2,2,i_xvz) &
1695  * mom(ke-2,i,j) ) &
1696  / ( f2h(ke-2,1,i_xvz) &
1697  * 0.5_rp * ( dens(ke-1,i,j)+dens(ke-1,i,j+1) ) &
1698  + f2h(ke-2,2,i_xvz) &
1699  * 0.5_rp * ( dens(ke-2,i,j)+dens(ke-2,i,j+1) ) )
1700  flux(ke-2,i,j) = j23g(ke-2,i,j) / mapf(i,j,+1) * vel &
1701  * ( ( f31 * ( val(ke,i,j)+val(ke-3,i,j) ) + f32 * ( val(ke-1,i,j)+val(ke-2,i,j) ) ) &
1702  - ( f31 * ( val(ke,i,j)-val(ke-3,i,j) ) + f33 * ( val(ke-1,i,j)-val(ke-2,i,j) ) ) * sign(1.0_rp,vel) )
1703 
1704  flux(ke ,i,j) = 0.0_rp
1705  enddo
1706  enddo
1707 
1708  return
integer, public i_xvz
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxx_xvz_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxx_xvz_ud5 ( 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,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation X-flux at XV

Definition at line 1720 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_debug::check(), scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

1720  implicit none
1721 
1722  real(RP), intent(inout) :: flux (KA,IA,JA)
1723  real(RP), intent(in) :: mom (KA,IA,JA)
1724  real(RP), intent(in) :: val (KA,IA,JA)
1725  real(RP), intent(in) :: DENS (KA,IA,JA)
1726  real(RP), intent(in) :: GSQRT (KA,IA,JA)
1727  real(RP), intent(in) :: MAPF ( IA,JA,2)
1728  real(RP), intent(in) :: num_diff(KA,IA,JA)
1729  real(RP), intent(in) :: CDZ (KA)
1730  integer, intent(in) :: IIS, IIE, JJS, JJE
1731 
1732  real(RP) :: vel
1733  integer :: k, i, j
1734  !---------------------------------------------------------------------------
1735 
1736  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
1737  !$omp private(vel) &
1738  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,GSQRT,MAPF,num_diff)
1739  do j = jjs, jje
1740  do i = iis-1, iie
1741  do k = ks, ke
1742 #ifdef DEBUG
1743  call check( __line__, mom(k,i ,j) )
1744  call check( __line__, mom(k,i,j-1) )
1745 
1746  call check( __line__, val(k,i,j) )
1747  call check( __line__, val(k,i+1,j) )
1748 
1749  call check( __line__, val(k,i-1,j) )
1750  call check( __line__, val(k,i+2,j) )
1751 
1752  call check( __line__, val(k,i-2,j) )
1753  call check( __line__, val(k,i+3,j) )
1754 
1755 #endif
1756  vel = ( 0.5_rp * ( mom(k,i,j)+mom(k,i,j+1) ) ) &
1757  / ( 0.25_rp * ( dens(k,i,j)+dens(k,i+1,j)+dens(k,i,j+1)+dens(k,i+1,j+1) ) )
1758  flux(k,i,j) = gsqrt(k,i,j) / mapf(i,j,+2) * vel &
1759  * ( ( f51 * ( val(k,i+3,j)+val(k,i-2,j) ) &
1760  + f52 * ( val(k,i+2,j)+val(k,i-1,j) ) &
1761  + f53 * ( val(k,i+1,j)+val(k,i,j) ) ) &
1762  - ( f51 * ( val(k,i+3,j)-val(k,i-2,j) ) &
1763  + f54 * ( val(k,i+2,j)-val(k,i-1,j) ) &
1764  + f55 * ( val(k,i+1,j)-val(k,i,j) ) ) * sign(1.0_rp,vel) ) &
1765  + gsqrt(k,i,j) * num_diff(k,i,j)
1766  enddo
1767  enddo
1768  enddo
1769 #ifdef DEBUG
1770  k = iundef; i = iundef; j = iundef
1771 #endif
1772 
1773  return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_dyn_fvm_fluxy_xvz_ud5()

subroutine, public scale_atmos_dyn_fvm_flux_ud5::atmos_dyn_fvm_fluxy_xvz_ud5 ( 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,
integer, intent(in)  IIS,
integer, intent(in)  IIE,
integer, intent(in)  JJS,
integer, intent(in)  JJE 
)

calculation Y-flux at XV

Definition at line 1785 of file scale_atmos_dyn_fvm_flux_ud5.F90.

References scale_debug::check(), scale_grid_index::ke, and scale_grid_index::ks.

Referenced by scale_atmos_dyn_fvm_flux::atmos_dyn_fvm_flux_setup().

1785  implicit none
1786 
1787  real(RP), intent(inout) :: flux (KA,IA,JA)
1788  real(RP), intent(in) :: mom (KA,IA,JA)
1789  real(RP), intent(in) :: val (KA,IA,JA)
1790  real(RP), intent(in) :: DENS (KA,IA,JA)
1791  real(RP), intent(in) :: GSQRT (KA,IA,JA)
1792  real(RP), intent(in) :: MAPF ( IA,JA,2)
1793  real(RP), intent(in) :: num_diff(KA,IA,JA)
1794  real(RP), intent(in) :: CDZ (KA)
1795  integer, intent(in) :: IIS, IIE, JJS, JJE
1796 
1797  real(RP) :: vel
1798  integer :: k, i, j
1799  !---------------------------------------------------------------------------
1800 
1801  ! note that y-index is added by -1
1802 
1803  !$omp parallel do default(none) private(i,j,k) OMP_SCHEDULE_ collapse(2) &
1804  !$omp private(vel) &
1805  !$omp shared(JJS,JJE,IIS,IIE,KS,KE,mom,val,DENS,flux,GSQRT,MAPF,num_diff)
1806  do j = jjs, jje+1
1807  do i = iis, iie
1808  do k = ks, ke
1809 #ifdef DEBUG
1810  call check( __line__, mom(k,i ,j) )
1811  call check( __line__, mom(k,i,j-1) )
1812 
1813  call check( __line__, val(k,i,j-1) )
1814  call check( __line__, val(k,i,j) )
1815 
1816  call check( __line__, val(k,i,j-2) )
1817  call check( __line__, val(k,i,j+1) )
1818 
1819  call check( __line__, val(k,i,j-3) )
1820  call check( __line__, val(k,i,j+2) )
1821 
1822 #endif
1823  vel = ( 0.5_rp * ( mom(k,i,j)+mom(k,i,j-1) ) ) &
1824  / ( dens(k,i,j) )
1825  flux(k,i,j-1) = gsqrt(k,i,j) / mapf(i,j,+1) * vel &
1826  * ( ( f51 * ( val(k,i,j+2)+val(k,i,j-3) ) &
1827  + f52 * ( val(k,i,j+1)+val(k,i,j-2) ) &
1828  + f53 * ( val(k,i,j)+val(k,i,j-1) ) ) &
1829  - ( f51 * ( val(k,i,j+2)-val(k,i,j-3) ) &
1830  + f54 * ( val(k,i,j+1)-val(k,i,j-2) ) &
1831  + f55 * ( val(k,i,j)-val(k,i,j-1) ) ) * sign(1.0_rp,vel) ) &
1832  + gsqrt(k,i,j) * num_diff(k,i,j)
1833  enddo
1834  enddo
1835  enddo
1836 #ifdef DEBUG
1837  k = iundef; i = iundef; j = iundef
1838 #endif
1839 
1840  return
Here is the call graph for this function:
Here is the caller graph for this function: