14 #include "inc_openmp.h" 59 private :: get_fact_fct
66 real(RP),
allocatable :: CNZ3(:,:,:)
67 real(RP),
allocatable :: CNX3(:,:,:)
68 real(RP),
allocatable :: CNY3(:,:,:)
69 real(RP),
allocatable :: CNZ4(:,:,:)
70 real(RP),
allocatable :: CNX4(:,:,:)
71 real(RP),
allocatable :: CNY4(:,:,:)
73 integer :: I_COMM_DENS_Z = 1
74 integer :: I_COMM_DENS_X = 2
75 integer :: I_COMM_DENS_Y = 3
76 integer :: I_COMM_MOMZ_Z = 4
77 integer :: I_COMM_MOMZ_X = 5
78 integer :: I_COMM_MOMZ_Y = 6
79 integer :: I_COMM_MOMX_Z = 7
80 integer :: I_COMM_MOMX_X = 8
81 integer :: I_COMM_MOMX_Y = 9
82 integer :: I_COMM_MOMY_Z = 10
83 integer :: I_COMM_MOMY_X = 11
84 integer :: I_COMM_MOMY_Y = 12
85 integer :: I_COMM_RHOT_Z = 13
86 integer :: I_COMM_RHOT_X = 14
87 integer :: I_COMM_RHOT_Y = 15
88 integer :: I_COMM_QTRC_Z = 1
89 integer :: I_COMM_QTRC_X = 2
90 integer :: I_COMM_QTRC_Y = 3
96 num_diff, num_diff_q, &
97 CDZ, CDX, CDY, FDZ, FDX, FDY )
103 real(RP),
intent(inout) :: num_diff(
ka,
ia,
ja,5,3)
104 real(RP),
intent(inout) :: num_diff_q(
ka,
ia,
ja,3)
105 real(RP),
intent(in) :: cdz(
ka)
106 real(RP),
intent(in) :: cdx(
ia)
107 real(RP),
intent(in) :: cdy(
ja)
108 real(RP),
intent(in) :: fdz(
ka-1)
109 real(RP),
intent(in) :: fdx(
ia-1)
110 real(RP),
intent(in) :: fdy(
ja-1)
116 write(*,*)
'xxx number of HALO must be at least 2 for numrical filter' 121 allocate( cnz3(3,
ka,2) )
122 allocate( cnx3(3,
ia,2) )
123 allocate( cny3(3,
ja,2) )
124 allocate( cnz4(5,
ka,2) )
125 allocate( cnx4(5,
ia,2) )
126 allocate( cny4(5,
ja,2) )
160 cnz3(1,k,1) = 1.0_rp / ( fdz(k ) * cdz(k ) * fdz(k-1) )
161 cnz3(2,k,1) = 1.0_rp / ( fdz(k ) * cdz(k ) * fdz(k-1) ) &
162 + 1.0_rp / ( fdz(k-1) * cdz(k ) * fdz(k-1) ) &
163 + 1.0_rp / ( fdz(k-1) * cdz(k-1) * fdz(k-1) )
166 cnz3(3,k,1) = 1.0_rp / ( fdz(k-1) * cdz(k ) * fdz(k-1) ) &
167 + 1.0_rp / ( fdz(k-1) * cdz(k-1) * fdz(k-1) ) &
168 + 1.0_rp / ( fdz(k-1) * cdz(k-1) * fdz(k-2) )
170 cnz3(1,
ks-1,1) = 1.0_rp / ( fdz(
ks ) * cdz(
ks+1) * fdz(
ks ) )
171 cnz3(1,
ks ,1) = 1.0_rp / ( fdz(
ks ) * cdz(
ks ) * fdz(
ks ) )
172 cnz3(2,
ks ,1) = 1.0_rp / ( fdz(
ks ) * cdz(
ks ) * fdz(
ks ) ) &
173 + 1.0_rp / ( fdz(
ks ) * cdz(
ks ) * fdz(
ks ) ) &
174 + 1.0_rp / ( fdz(
ks ) * cdz(
ks+1) * fdz(
ks ) )
175 cnz3(3,
ks ,1) = 1.0_rp / ( fdz(
ks ) * cdz(
ks ) * fdz(
ks ) ) &
176 + 1.0_rp / ( fdz(
ks ) * cdz(
ks+1) * fdz(
ks ) ) &
177 + 1.0_rp / ( fdz(
ks ) * cdz(
ks+1) * fdz(
ks+1) )
178 cnz3(3,
ks+1,1) = 1.0_rp / ( fdz(
ks ) * cdz(
ks+1) * fdz(
ks ) ) &
179 + 1.0_rp / ( fdz(
ks ) * cdz(
ks ) * fdz(
ks ) ) &
180 + 1.0_rp / ( fdz(
ks ) * cdz(
ks ) * fdz(
ks ) )
181 cnz3(1,
ke ,1) = 1.0_rp / ( fdz(
ke-1) * cdz(
ke ) * fdz(
ke-1) )
182 cnz3(2,
ke ,1) = 1.0_rp / ( fdz(
ke-1) * cdz(
ke ) * fdz(
ke-1) ) &
183 + 1.0_rp / ( fdz(
ke-1) * cdz(
ke ) * fdz(
ke-1) ) &
184 + 1.0_rp / ( fdz(
ke-1) * cdz(
ke-1) * fdz(
ke-1) )
185 cnz3(1,
ke+1,1) = 1.0_rp / ( fdz(
ke-2) * cdz(
ke-1) * fdz(
ke-1) )
186 cnz3(2,
ke+1,1) = 1.0_rp / ( fdz(
ke-2) * cdz(
ke-1) * fdz(
ke-1) ) &
187 + 1.0_rp / ( fdz(
ke-1) * cdz(
ke-1) * fdz(
ke-1) ) &
188 + 1.0_rp / ( fdz(
ke-1) * cdz(
ke ) * fdz(
ke-1) )
189 cnz3(3,
ke+1,1) = 1.0_rp / ( fdz(
ke-1) * cdz(
ke+1) * fdz(
ke-1) ) &
190 + 1.0_rp / ( fdz(
ke-1) * cdz(
ke ) * fdz(
ke-1) ) &
191 + 1.0_rp / ( fdz(
ke-1) * cdz(
ke ) * fdz(
ke-1) )
194 cnz4(1,k,1) = ( cnz3(1,k+1,1) ) / cdz(k)
195 cnz4(2,k,1) = ( cnz3(2,k+1,1) + cnz3(1,k,1) ) / cdz(k)
196 cnz4(3,k,1) = ( cnz3(3,k+1,1) + cnz3(2,k,1) ) / cdz(k)
197 cnz4(4,k,1) = ( cnz3(1,k ,1) + cnz3(3,k,1) ) / cdz(k)
198 cnz4(5,k,1) = ( cnz3(1,k-1,1) ) / cdz(k)
202 cnz3(1,k,2) = 1.0_rp / ( cdz(k+1) * fdz(k ) * cdz(k ) )
203 cnz3(2,k,2) = 1.0_rp / ( cdz(k+1) * fdz(k ) * cdz(k ) ) &
204 + 1.0_rp / ( cdz(k ) * fdz(k ) * cdz(k ) ) &
205 + 1.0_rp / ( cdz(k ) * fdz(k-1) * cdz(k ) )
206 cnz3(3,k,2) = 1.0_rp / ( cdz(k ) * fdz(k ) * cdz(k ) ) &
207 + 1.0_rp / ( cdz(k ) * fdz(k-1) * cdz(k ) ) &
208 + 1.0_rp / ( cdz(k ) * fdz(k-1) * cdz(k-1) )
210 cnz3(1,
ks-1,2) = 1.0_rp / ( cdz(
ks ) * fdz(
ks ) * cdz(
ks ) )
211 cnz3(1,
ks ,2) = 1.0_rp / ( cdz(
ks+1) * fdz(
ks ) * cdz(
ks ) )
212 cnz3(2,
ks ,2) = 1.0_rp / ( cdz(
ks+1) * fdz(
ks ) * cdz(
ks ) ) &
213 + 1.0_rp / ( cdz(
ks ) * fdz(
ks ) * cdz(
ks ) ) &
214 + 1.0_rp / ( cdz(
ks ) * fdz(
ks ) * cdz(
ks ) )
215 cnz3(3,
ks ,2) = 1.0_rp / ( cdz(
ks ) * fdz(
ks ) * cdz(
ks ) ) &
216 + 1.0_rp / ( cdz(
ks ) * fdz(
ks ) * cdz(
ks ) ) &
217 + 1.0_rp / ( cdz(
ks ) * fdz(
ks ) * cdz(
ks+1) )
218 cnz3(1,
ke ,2) = 1.0_rp / ( cdz(
ke-1) * fdz(
ke-1) * cdz(
ke ) )
219 cnz3(2,
ke ,2) = 1.0_rp / ( cdz(
ke-1) * fdz(
ke-1) * cdz(
ke ) ) &
220 + 1.0_rp / ( cdz(
ke ) * fdz(
ke-1) * cdz(
ke ) ) &
221 + 1.0_rp / ( cdz(
ke ) * fdz(
ke-1) * cdz(
ke ) )
222 cnz3(3,
ke ,2) = 1.0_rp / ( cdz(
ke ) * fdz(
ke-1) * cdz(
ke ) ) &
223 + 1.0_rp / ( cdz(
ke ) * fdz(
ke-1) * cdz(
ke ) ) &
224 + 1.0_rp / ( cdz(
ke ) * fdz(
ke-1) * cdz(
ke-1) )
225 cnz3(1,
ke+1,2) = 1.0_rp / ( cdz(
ke-2) * fdz(
ke-2) * cdz(
ke-1) )
226 cnz3(2,
ke+1,2) = 1.0_rp / ( cdz(
ke-2) * fdz(
ke-2) * cdz(
ke-1) ) &
227 + 1.0_rp / ( cdz(
ke-1) * fdz(
ke-2) * cdz(
ke-1) ) &
228 + 1.0_rp / ( cdz(
ke-1) * fdz(
ke-1) * cdz(
ke-1) )
229 cnz3(3,
ke+1,2) = 1.0_rp / ( cdz(
ke-1) * fdz(
ke-2) * cdz(
ke-1) ) &
230 + 1.0_rp / ( cdz(
ke-1) * fdz(
ke-1) * cdz(
ke-1) ) &
231 + 1.0_rp / ( cdz(
ke-1) * fdz(
ke-1) * cdz(
ke ) )
234 cnz4(1,k,2) = ( cnz3(1,k+1,2) ) / fdz(k)
235 cnz4(2,k,2) = ( cnz3(2,k+1,2) + cnz3(1,k,2) ) / fdz(k)
236 cnz4(3,k,2) = ( cnz3(3,k+1,2) + cnz3(2,k,2) ) / fdz(k)
237 cnz4(4,k,2) = ( cnz3(1,k ,2) + cnz3(3,k,2) ) / fdz(k)
238 cnz4(5,k,2) = ( cnz3(1,k-1,2) ) / fdz(k)
241 cnz4(2,
ke,2) = ( cnz3(2,
ke+1,2) + cnz3(1,
ke,2) ) / fdz(
ke-1)
242 cnz4(3,
ke,2) = ( cnz3(3,
ke+1,2) + cnz3(2,
ke,2) ) / fdz(
ke-1)
243 cnz4(4,
ke,2) = ( cnz3(1,
ke ,2) + cnz3(3,
ke,2) ) / fdz(
ke-1)
246 cnx3(1,
is-1,1) = 1.0_rp / ( fdx(
is-1) * cdx(
is-1) * fdx(
is-2) )
248 cnx3(1,i,1) = 1.0_rp / ( fdx(i ) * cdx(i ) * fdx(i-1) )
249 cnx3(2,i,1) = 1.0_rp / ( fdx(i ) * cdx(i ) * fdx(i-1) ) &
250 + 1.0_rp / ( fdx(i-1) * cdx(i ) * fdx(i-1) ) &
251 + 1.0_rp / ( fdx(i-1) * cdx(i-1) * fdx(i-1) )
252 cnx3(3,i,1) = 1.0_rp / ( fdx(i-1) * cdx(i ) * fdx(i-1) ) &
253 + 1.0_rp / ( fdx(i-1) * cdx(i-1) * fdx(i-1) ) &
254 + 1.0_rp / ( fdx(i-1) * cdx(i-1) * fdx(i-2) )
258 cnx4(1,i,1) = ( cnx3(1,i+1,1) ) / cdx(i)
259 cnx4(2,i,1) = ( cnx3(2,i+1,1) + cnx3(1,i,1) ) / cdx(i)
260 cnx4(3,i,1) = ( cnx3(3,i+1,1) + cnx3(2,i,1) ) / cdx(i)
261 cnx4(4,i,1) = ( cnx3(1,i ,1) + cnx3(3,i,1) ) / cdx(i)
262 cnx4(5,i,1) = ( cnx3(1,i-1,1) ) / cdx(i)
266 cnx3(1,i,2) = 1.0_rp / ( cdx(i+1) * fdx(i ) * cdx(i ) )
267 cnx3(2,i,2) = 1.0_rp / ( cdx(i+1) * fdx(i ) * cdx(i ) ) &
268 + 1.0_rp / ( cdx(i ) * fdx(i ) * cdx(i ) ) &
269 + 1.0_rp / ( cdx(i ) * fdx(i-1) * cdx(i ) )
270 cnx3(3,i,2) = 1.0_rp / ( cdx(i ) * fdx(i ) * cdx(i ) ) &
271 + 1.0_rp / ( cdx(i ) * fdx(i-1) * cdx(i ) ) &
272 + 1.0_rp / ( cdx(i ) * fdx(i-1) * cdx(i-1) )
276 cnx4(1,i,2) = ( cnx3(1,i+1,2) ) / fdx(i)
277 cnx4(2,i,2) = ( cnx3(2,i+1,2) + cnx3(1,i,2) ) / fdx(i)
278 cnx4(3,i,2) = ( cnx3(3,i+1,2) + cnx3(2,i,2) ) / fdx(i)
279 cnx4(4,i,2) = ( cnx3(1,i ,2) + cnx3(3,i,2) ) / fdx(i)
280 cnx4(5,i,2) = ( cnx3(1,i-1,2) ) / fdx(i)
284 cny3(1,
js-1,1) = 1.0_rp / ( fdy(
js-1) * cdy(
js-1) * fdy(
js-2) )
286 cny3(1,j,1) = 1.0_rp / ( fdy(j ) * cdy(j ) * fdy(j-1) )
287 cny3(2,j,1) = 1.0_rp / ( fdy(j ) * cdy(j ) * fdy(j-1) ) &
288 + 1.0_rp / ( fdy(j-1) * cdy(j ) * fdy(j-1) ) &
289 + 1.0_rp / ( fdy(j-1) * cdy(j-1) * fdy(j-1) )
290 cny3(3,j,1) = 1.0_rp / ( fdy(j-1) * cdy(j ) * fdy(j-1) ) &
291 + 1.0_rp / ( fdy(j-1) * cdy(j-1) * fdy(j-1) ) &
292 + 1.0_rp / ( fdy(j-1) * cdy(j-1) * fdy(j-2) )
296 cny4(1,j,1) = ( cny3(1,j+1,1) ) / cdy(j)
297 cny4(2,j,1) = ( cny3(2,j+1,1) + cny3(1,j,1) ) / cdy(j)
298 cny4(3,j,1) = ( cny3(3,j+1,1) + cny3(2,j,1) ) / cdy(j)
299 cny4(4,j,1) = ( cny3(1,j ,1) + cny3(3,j,1) ) / cdy(j)
300 cny4(5,j,1) = ( cny3(1,j-1,1) ) / cdy(j)
304 cny3(1,j,2) = 1.0_rp / ( cdy(j+1) * fdy(j ) * cdy(j ) )
305 cny3(2,j,2) = 1.0_rp / ( cdy(j+1) * fdy(j ) * cdy(j ) ) &
306 + 1.0_rp / ( cdy(j ) * fdy(j ) * cdy(j ) ) &
307 + 1.0_rp / ( cdy(j ) * fdy(j-1) * cdy(j ) )
308 cny3(3,j,2) = 1.0_rp / ( cdy(j ) * fdy(j ) * cdy(j ) ) &
309 + 1.0_rp / ( cdy(j ) * fdy(j-1) * cdy(j ) ) &
310 + 1.0_rp / ( cdy(j ) * fdy(j-1) * cdy(j-1) )
314 cny4(1,j,2) = ( cny3(1,j+1,2) ) / fdy(j)
315 cny4(2,j,2) = ( cny3(2,j+1,2) + cny3(1,j,2) ) / fdy(j)
316 cny4(3,j,2) = ( cny3(3,j+1,2) + cny3(2,j,2) ) / fdy(j)
317 cny4(4,j,2) = ( cny3(1,j ,2) + cny3(3,j,2) ) / fdy(j)
318 cny4(5,j,2) = ( cny3(1,j-1,2) ) / fdy(j)
328 wdamp_tau, wdamp_height, &
335 real(RP),
intent(inout) :: wdamp_coef(
ka)
336 real(RP),
intent(in) :: wdamp_tau
337 real(RP),
intent(in) :: wdamp_height
338 real(RP),
intent(in) :: fz(0:
ka)
340 real(RP) :: alpha, sw
345 if ( wdamp_height < 0.0_rp )
then 346 wdamp_coef(:) = 0.0_rp
347 elseif( fz(
ke)-wdamp_height < eps )
then 348 wdamp_coef(:) = 0.0_rp
350 alpha = 1.0_rp / wdamp_tau
353 sw = 0.5_rp + sign( 0.5_rp, fz(k)-wdamp_height )
355 wdamp_coef(k) = alpha * sw &
356 * 0.5_rp * ( 1.0_rp - cos( pi * (fz(k)-wdamp_height) / (fz(
ke)-wdamp_height)) )
358 wdamp_coef( 1:
ks-1) = wdamp_coef(
ks)
359 wdamp_coef(
ke+1:
ka ) = wdamp_coef(
ke)
362 if(
io_l )
write(
io_fid_log,*)
' *** Setup Rayleigh damping coefficient ***' 363 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'|=== Rayleigh Damping Coef ===|' 366 if(
io_l )
write(
io_fid_log,
'(1x,A,I5,F10.2,ES12.4,A)')
'| ',k, fz(k), wdamp_coef(k),
' |' 369 if(
io_l )
write(
io_fid_log,
'(1x,A,I5,F10.2,ES12.4,A)')
'| ',k, fz(k), wdamp_coef(k),
' | KE = TOA' 371 if(
io_l )
write(
io_fid_log,
'(1x,A,I5,F10.2,ES12.4,A)')
'| ',k, fz(k), wdamp_coef(k),
' |' 374 if(
io_l )
write(
io_fid_log,
'(1x,A,I5,F10.2,ES12.4,A)')
'| ',k, fz(k), wdamp_coef(k),
' | KS-1 = surface' 376 if(
io_l )
write(
io_fid_log,
'(1x,A,I5,F10.2,ES12.4,A)')
'| ',k, fz(k), wdamp_coef(k),
' |' 379 if(
io_l )
write(
io_fid_log,
'(1x,A,I5,F10.2,12x,A)')
'| ',k, fz(k),
' |' 380 if(
io_l )
write(
io_fid_log,
'(1x,A)')
'|=============================|' 390 DENS, MOMZ, MOMX, MOMY, RHOT, &
391 CDZ, CDX, CDY, FDZ, FDX, FDY, DT, &
392 REF_dens, REF_pott, &
393 ND_COEF, ND_ORDER, ND_SFC_FACT, ND_USE_RS )
399 real(RP),
intent(out) :: num_diff(
ka,
ia,
ja,5,3)
401 real(RP),
intent(in) :: dens(
ka,
ia,
ja)
402 real(RP),
intent(in) :: momz(
ka,
ia,
ja)
403 real(RP),
intent(in) :: momx(
ka,
ia,
ja)
404 real(RP),
intent(in) :: momy(
ka,
ia,
ja)
405 real(RP),
intent(in) :: rhot(
ka,
ia,
ja)
407 real(RP),
intent(in) :: cdz(
ka)
408 real(RP),
intent(in) :: cdx(
ia)
409 real(RP),
intent(in) :: cdy(
ja)
410 real(RP),
intent(in) :: fdz(
ka-1)
411 real(RP),
intent(in) :: fdx(
ia-1)
412 real(RP),
intent(in) :: fdy(
ja-1)
414 real(RP),
intent(in) :: dt
416 real(RP),
intent(in) :: ref_dens(
ka,
ia,
ja)
417 real(RP),
intent(in) :: ref_pott(
ka,
ia,
ja)
419 real(RP),
intent(in) :: nd_coef
420 integer,
intent(in) :: nd_order
421 real(RP),
intent(in) :: nd_sfc_fact
422 logical,
intent(in) :: nd_use_rs
425 real(RP) :: velz (
ka,
ia,
ja)
426 real(RP) :: velx (
ka,
ia,
ja)
427 real(RP) :: vely (
ka,
ia,
ja)
428 real(RP) :: pott (
ka,
ia,
ja)
430 real(RP) :: dens_diff(
ka,
ia,
ja)
431 real(RP) :: pott_diff(
ka,
ia,
ja)
433 real(RP) :: work(
ka,
ia,
ja,3,2)
438 real(RP) :: nd_coef_cdz(
ka)
439 real(RP) :: nd_coef_cdx(
ia)
440 real(RP) :: nd_coef_cdy(
ja)
441 real(RP) :: nd_coef_fdz(
ka-1)
442 real(RP) :: nd_coef_fdx(
ia-1)
443 real(RP) :: nd_coef_fdy(
ja-1)
449 nd_order4 = nd_order * 4
450 diff4 = nd_coef / ( 2**(nd_order4) * dt )
452 nd_coef_cdz(k) = diff4 * cdz(k)**nd_order4
455 nd_coef_fdz(k) = diff4 * fdz(k)**nd_order4
458 nd_coef_cdx(i) = diff4 * cdx(i)**nd_order4
459 nd_coef_fdx(i) = diff4 * fdx(i)**nd_order4
462 nd_coef_cdy(j) = diff4 * cdy(j)**nd_order4
463 nd_coef_fdy(j) = diff4 * fdy(j)**nd_order4
471 if ( .NOT. nd_use_rs )
then 478 pott(k,i,j) = rhot(k,i,j) / dens(k,i,j)
487 dens_diff(k,i,j) = ( ( dens(k,i,j) ) * 3.0_rp &
488 + ( dens(k,i+1,j)+dens(k,i-1,j)+dens(k,i,j+1)+dens(k,i,j-1) ) * 2.0_rp &
489 + ( dens(k,i+2,j)+dens(k,i-2,j)+dens(k,i,j+2)+dens(k,i,j-2) ) &
490 + ( dens(k+1,i,j)+dens(k-1,i,j) ) * 2.0_rp &
493 pott_diff(k,i,j) = ( ( pott(k,i,j) ) * 3.0_rp &
494 + ( pott(k,i+1,j)+pott(k,i-1,j)+pott(k,i,j+1)+pott(k,i,j-1) ) * 2.0_rp &
495 + ( pott(k,i+2,j)+pott(k,i-2,j)+pott(k,i,j+2)+pott(k,i,j-2) ) &
496 + ( pott(k+1,i,j)+pott(k-1,i,j) ) * 2.0_rp &
504 dens_diff(
ks,i,j) = ( ( dens(
ks,i,j) ) * 3.0_rp &
505 + ( dens(
ks,i+1,j)+dens(
ks,i-1,j)+dens(
ks,i,j+1)+dens(
ks,i,j-1) ) * 2.0_rp &
506 + ( dens(
ks,i+2,j)+dens(
ks,i-2,j)+dens(
ks,i,j+2)+dens(
ks,i,j-2) ) &
507 + ( dens(
ks+1,i,j) ) * 2.0_rp &
509 dens_diff(
ke,i,j) = ( ( dens(
ke,i,j) ) * 3.0_rp &
510 + ( dens(
ke,i+1,j)+dens(
ke,i-1,j)+dens(
ke,i,j+1)+dens(
ke,i,j-1) ) * 2.0_rp &
511 + ( dens(
ke,i+2,j)+dens(
ke,i-2,j)+dens(
ke,i,j+2)+dens(
ke,i,j-2) ) &
512 + ( dens(
ke-1,i,j) ) * 2.0_rp &
515 pott_diff(
ks,i,j) = ( ( pott(
ks,i,j) ) * 3.0_rp &
516 + ( pott(
ks,i+1,j)+pott(
ks,i-1,j)+pott(
ks,i,j+1)+pott(
ks,i,j-1) ) * 2.0_rp &
517 + ( pott(
ks,i+2,j)+pott(
ks,i-2,j)+pott(
ks,i,j+2)+pott(
ks,i,j-2) ) &
518 + ( pott(
ks+1,i,j) ) * 2.0_rp &
520 pott_diff(
ke,i,j) = ( ( pott(
ke,i,j) ) * 3.0_rp &
521 + ( pott(
ke,i+1,j)+pott(
ke,i-1,j)+pott(
ke,i,j+1)+pott(
ke,i,j-1) ) * 2.0_rp &
522 + ( pott(
ke,i+2,j)+pott(
ke,i-2,j)+pott(
ke,i,j+2)+pott(
ke,i,j-2) ) &
523 + ( pott(
ke-1,i,j) ) * 2.0_rp &
532 call comm_vars8( dens_diff, 1 )
533 call comm_vars8( pott_diff, 2 )
535 call comm_wait ( dens_diff, 1 )
536 call comm_wait ( pott_diff, 2 )
545 if ( nd_use_rs )
then 553 dens_diff(k,i,j) = dens(k,i,j) - ref_dens(k,i,j)
575 num_diff(k,i,j,
i_dens,
zdir) = work(k,i,j,
zdir,iwork) * nd_coef_cdz(k)
589 num_diff(k,i,j,
i_dens,
xdir) = work(k,i,j,
xdir,iwork) * nd_coef_cdx(i)
605 num_diff(k,i,j,
i_dens,
ydir) = work(k,i,j,
ydir,iwork) * nd_coef_cdy(j)
622 call comm_vars8( num_diff(:,:,:,
i_dens,
zdir), i_comm_dens_z )
623 call comm_vars8( num_diff(:,:,:,
i_dens,
xdir), i_comm_dens_x )
624 call comm_vars8( num_diff(:,:,:,
i_dens,
ydir), i_comm_dens_y )
637 velz(k,i,j) = 2.0_rp * momz(k,i,j) / ( dens(k+1,i,j)+dens(k,i,j) )
655 num_diff(k,i,j,
i_momz,
zdir) = work(k,i,j,
zdir,iwork) * nd_coef_fdz(k) &
670 num_diff(k,i,j,
i_momz,
xdir) = work(k,i,j,
xdir,iwork) * nd_coef_cdx(i) &
671 * 0.25_rp * ( dens(k+1,i+1,j)+dens(k+1,i,j)+dens(k,i+1,j)+dens(k,i,j) )
687 num_diff(k,i,j,
i_momz,
ydir) = work(k,i,j,
ydir,iwork) * nd_coef_cdy(j) &
688 * 0.25_rp * ( dens(k+1,i,j+1)+dens(k+1,i,j)+dens(k,i,j+1)+dens(k,i,j) )
706 call comm_vars8( num_diff(:,:,:,
i_momz,
zdir), i_comm_momz_z )
707 call comm_vars8( num_diff(:,:,:,
i_momz,
xdir), i_comm_momz_x )
708 call comm_vars8( num_diff(:,:,:,
i_momz,
ydir), i_comm_momz_y )
721 velx(k,i,j) = 2.0_rp * momx(k,i,j) / ( dens(k,i+1,j)+dens(k,i,j) )
740 num_diff(k,i,j,
i_momx,
zdir) = work(k,i,j,
zdir,iwork) * nd_coef_cdz(k) &
741 * 0.25_rp * ( dens(k+1,i+1,j)+dens(k+1,i,j)+dens(k,i+1,j)+dens(k,i,j) )
755 num_diff(k,i,j,
i_momx,
xdir) = work(k,i,j,
xdir,iwork) * nd_coef_fdx(i) &
773 num_diff(k,i,j,
i_momx,
ydir) = work(k,i,j,
ydir,iwork) * nd_coef_cdy(j) &
774 * 0.25_rp * ( dens(k,i+1,j+1)+dens(k,i+1,j)+dens(k,i,j+1)+dens(k,i,j) )
791 call comm_vars8( num_diff(:,:,:,
i_momx,
zdir), i_comm_momx_z )
792 call comm_vars8( num_diff(:,:,:,
i_momx,
xdir), i_comm_momx_x )
793 call comm_vars8( num_diff(:,:,:,
i_momx,
ydir), i_comm_momx_y )
806 vely(k,i,j) = 2.0_rp * momy(k,i,j) / ( dens(k,i,j+1)+dens(k,i,j) )
824 num_diff(k,i,j,
i_momy,
zdir) = work(k,i,j,
zdir,iwork) * nd_coef_cdz(k) &
825 * 0.25_rp * ( dens(k+1,i,j+1)+dens(k+1,i,j)+dens(k,i,j+1)+dens(k,i,j) )
839 num_diff(k,i,j,
i_momy,
xdir) = work(k,i,j,
xdir,iwork) * nd_coef_cdx(i) &
840 * 0.25_rp * ( dens(k,i+1,j+1)+dens(k,i,j+1)+dens(k,i+1,j)+dens(k,i,j) )
856 num_diff(k,i,j,
i_momy,
ydir) = work(k,i,j,
ydir,iwork) * nd_coef_fdy(j) &
874 call comm_vars8( num_diff(:,:,:,
i_momy,
zdir), i_comm_momy_z )
875 call comm_vars8( num_diff(:,:,:,
i_momy,
xdir), i_comm_momy_x )
876 call comm_vars8( num_diff(:,:,:,
i_momy,
ydir), i_comm_momy_y )
884 if ( nd_use_rs )
then 889 pott_diff(k,i,j) = rhot(k,i,j) / dens(k,i,j) - ref_pott(k,i,j)
908 num_diff(k,i,j,
i_rhot,
zdir) = work(k,i,j,
zdir,iwork) * nd_coef_cdz(k) &
909 * 0.5_rp * ( dens(k+1,i,j)+dens(k,i,j) )
930 num_diff(k,i,j,
i_rhot,
xdir) = work(k,i,j,
xdir,iwork) * nd_coef_cdx(i) &
931 * 0.5_rp * ( dens(k,i+1,j)+dens(k,i,j) )
947 num_diff(k,i,j,
i_rhot,
ydir) = work(k,i,j,
ydir,iwork) * nd_coef_cdy(j) &
948 * 0.5_rp * ( dens(k,i,j+1)+dens(k,i,j) )
965 call comm_vars8( num_diff(:,:,:,
i_rhot,
zdir), i_comm_rhot_z )
966 call comm_vars8( num_diff(:,:,:,
i_rhot,
xdir), i_comm_rhot_x )
967 call comm_vars8( num_diff(:,:,:,
i_rhot,
ydir), i_comm_rhot_y )
969 call comm_wait ( num_diff(:,:,:,
i_dens,
zdir), i_comm_dens_z )
970 call comm_wait ( num_diff(:,:,:,
i_dens,
xdir), i_comm_dens_x )
971 call comm_wait ( num_diff(:,:,:,
i_dens,
ydir), i_comm_dens_y )
972 call comm_wait ( num_diff(:,:,:,
i_momz,
zdir), i_comm_momz_z )
973 call comm_wait ( num_diff(:,:,:,
i_momz,
xdir), i_comm_momz_x )
974 call comm_wait ( num_diff(:,:,:,
i_momz,
ydir), i_comm_momz_y )
975 call comm_wait ( num_diff(:,:,:,
i_momx,
zdir), i_comm_momx_z )
976 call comm_wait ( num_diff(:,:,:,
i_momx,
xdir), i_comm_momx_x )
977 call comm_wait ( num_diff(:,:,:,
i_momx,
ydir), i_comm_momx_y )
978 call comm_wait ( num_diff(:,:,:,
i_momy,
zdir), i_comm_momy_z )
979 call comm_wait ( num_diff(:,:,:,
i_momy,
xdir), i_comm_momy_x )
980 call comm_wait ( num_diff(:,:,:,
i_momy,
ydir), i_comm_momy_y )
981 call comm_wait ( num_diff(:,:,:,
i_rhot,
zdir), i_comm_rhot_z )
982 call comm_wait ( num_diff(:,:,:,
i_rhot,
xdir), i_comm_rhot_x )
983 call comm_wait ( num_diff(:,:,:,
i_rhot,
ydir), i_comm_rhot_y )
997 ND_COEF, ND_ORDER, ND_SFC_FACT, ND_USE_RS )
1005 real(RP),
intent(out) :: num_diff_q(
ka,
ia,
ja,3)
1007 real(RP),
intent(in) :: dens(
ka,
ia,
ja)
1008 real(RP),
intent(in) :: qtrc(
ka,
ia,
ja)
1010 real(RP),
intent(in) :: cdz(
ka)
1011 real(RP),
intent(in) :: cdx(
ia)
1012 real(RP),
intent(in) :: cdy(
ja)
1014 real(RP),
intent(in) :: dt
1016 real(RP),
intent(in) :: ref_qv(
ka,
ia,
ja)
1017 integer,
intent(in) :: iq
1019 real(RP),
intent(in) :: nd_coef
1020 integer,
intent(in) :: nd_order
1021 real(RP),
intent(in) :: nd_sfc_fact
1022 logical,
intent(in) :: nd_use_rs
1024 real(RP) :: qv_diff(
ka,
ia,
ja)
1026 real(RP) :: work(
ka,
ia,
ja,3,2)
1030 integer :: nd_order4
1031 real(RP) :: nd_coef_cdz(
ka)
1032 real(RP) :: nd_coef_cdx(
ia)
1033 real(RP) :: nd_coef_cdy(
ja)
1042 nd_order4 = nd_order * 4
1043 diff4 = nd_coef / ( 2**(nd_order4) * dt )
1045 nd_coef_cdz(k) = diff4 * cdz(k)**nd_order4
1048 nd_coef_cdx(i) = diff4 * cdx(i)**nd_order4
1051 nd_coef_cdy(j) = diff4 * cdy(j)**nd_order4
1054 if ( iq ==
i_qv .AND. (.NOT. nd_use_rs) )
then 1062 qv_diff(k,i,j) = ( ( qtrc(k,i,j) ) * 3.0_rp &
1063 + ( qtrc(k,i+1,j)+qtrc(k,i-1,j)+qtrc(k,i,j+1)+qtrc(k,i,j-1) ) * 2.0_rp &
1064 + ( qtrc(k,i+2,j)+qtrc(k,i-2,j)+qtrc(k,i,j+2)+qtrc(k,i,j-2) ) &
1065 + ( qtrc(k+1,i,j)+qtrc(k-1,i,j) ) * 2.0_rp &
1074 qv_diff(
ks,i,j) = ( ( qtrc(
ks,i,j) ) * 3.0_rp &
1075 + ( qtrc(
ks,i+1,j)+qtrc(
ks,i-1,j)+qtrc(
ks,i,j+1)+qtrc(
ks,i,j-1) ) * 2.0_rp &
1076 + ( qtrc(
ks,i+2,j)+qtrc(
ks,i-2,j)+qtrc(
ks,i,j+2)+qtrc(
ks,i,j-2) ) &
1077 + ( qtrc(
ks+1,i,j) ) * 2.0_rp &
1079 qv_diff(
ke,i,j) = ( ( qtrc(
ke,i,j) ) * 3.0_rp &
1080 + ( qtrc(
ke,i+1,j)+qtrc(
ke,i-1,j)+qtrc(
ke,i,j+1)+qtrc(
ke,i,j-1) ) * 2.0_rp &
1081 + ( qtrc(
ke,i+2,j)+qtrc(
ke,i-2,j)+qtrc(
ke,i,j+2)+qtrc(
ke,i,j-2) ) &
1082 + ( qtrc(
ke-1,i,j) ) * 2.0_rp &
1091 call comm_vars8(qv_diff, 1)
1092 call comm_wait (qv_diff, 1)
1098 if ( iq ==
i_qv )
then 1100 if ( nd_use_rs )
then 1108 qv_diff(k,i,j) = qtrc(k,i,j) - ref_qv(k,i,j)
1139 num_diff_q(k,i,j,
zdir) = work(k,i,j,
zdir,iwork) * nd_coef_cdz(k) &
1140 * 0.5_rp * ( dens(k+1,i,j)+dens(k,i,j) )
1146 num_diff_q(1:
ks-2,i,j,
zdir) = 0.0_rp
1147 num_diff_q(
ks-1,i,j,
zdir) = work(
ks-1,i,j,
zdir,iwork) * nd_coef_cdz(
ks-1) &
1149 num_diff_q(
ke ,i,j,
zdir) = work(
ke ,i,j,
zdir,iwork) * nd_coef_cdz(
ke ) &
1151 num_diff_q(
ke+1:
ka,i,j,
zdir) = 0.0_rp
1158 num_diff_q(k,i,j,
xdir) = work(k,i,j,
xdir,iwork) * nd_coef_cdx(i) &
1159 * 0.5_rp * ( dens(k,i+1,j)+dens(k,i,j) )
1165 num_diff_q(1:
ks-1,i,j,
xdir) = 0.0_rp
1166 num_diff_q(
ks ,i,j,
xdir) = num_diff_q(
ks ,i,j,
xdir) * nd_sfc_fact
1167 num_diff_q(
ks+1,i,j,
xdir) = num_diff_q(
ks+1,i,j,
xdir) * (1.0_rp + nd_sfc_fact) * 0.5_rp
1168 num_diff_q(
ke+1:
ka,i,j,
xdir) = 0.0_rp
1175 num_diff_q(k,i,j,
ydir) = work(k,i,j,
ydir,iwork) * nd_coef_cdy(j) &
1176 * 0.5_rp * ( dens(k,i,j+1)+dens(k,i,j) )
1182 num_diff_q(1:
ks-1,i,j,
ydir) = 0.0_rp
1183 num_diff_q(
ks ,i,j,
ydir) = num_diff_q(
ks ,i,j,
ydir) * nd_sfc_fact
1184 num_diff_q(
ks+1,i,j,
ydir) = num_diff_q(
ks+1,i,j,
ydir) * (1.0_rp + nd_sfc_fact) * 0.5_rp
1185 num_diff_q(
ke+1:
ka,i,j,
ydir) = 0.0_rp
1193 call comm_vars8( num_diff_q(:,:,:,
zdir), i_comm_qtrc_z )
1194 call comm_vars8( num_diff_q(:,:,:,
xdir), i_comm_qtrc_x )
1195 call comm_vars8( num_diff_q(:,:,:,
ydir), i_comm_qtrc_y )
1197 call comm_wait ( num_diff_q(:,:,:,
zdir), i_comm_qtrc_z )
1198 call comm_wait ( num_diff_q(:,:,:,
xdir), i_comm_qtrc_x )
1199 call comm_wait ( num_diff_q(:,:,:,
ydir), i_comm_qtrc_y )
1216 real(RP),
intent(out) :: phi_t(
ka,
ia,
ja)
1217 real(RP),
intent(in ) :: phi (
ka,
ia,
ja)
1218 real(RP),
intent(in ) :: rdz(:)
1219 real(RP),
intent(in ) :: rdx(:)
1220 real(RP),
intent(in ) :: rdy(:)
1221 integer ,
intent(in ) :: ko
1222 integer ,
intent(in ) :: io
1223 integer ,
intent(in ) :: jo
1225 real(RP) :: flux(
ka,
ia,
ja,3)
1233 call comm_vars8( flux(:,:,:,
xdir), 1 )
1234 call comm_vars8( flux(:,:,:,
ydir), 2 )
1235 call comm_wait ( flux(:,:,:,
xdir), 1 )
1236 call comm_wait ( flux(:,:,:,
ydir), 2 )
1241 phi_t(k,i,j) = ( flux(k+ko,i,j,
zdir) - flux(k-1+ko,i,j,
zdir) ) * rdz(k) &
1242 + ( flux(k,i+io,j,
xdir) - flux(k,i-1+io,j,
xdir) ) * rdx(i) &
1243 + ( flux(k,i,j+jo,
ydir) - flux(k,i,j-1+jo,
ydir) ) * rdy(j)
1253 DENS, MOMZ, MOMX, MOMY, RHOT, PROG, &
1254 DENS0, MOMZ0, MOMX0, MOMY0, RHOT0, PROG0, &
1255 BND_W, BND_E, BND_S, BND_N )
1257 real(RP),
intent(inout) :: dens (
ka,
ia,
ja)
1258 real(RP),
intent(inout) :: momz (
ka,
ia,
ja)
1259 real(RP),
intent(inout) :: momx (
ka,
ia,
ja)
1260 real(RP),
intent(inout) :: momy (
ka,
ia,
ja)
1261 real(RP),
intent(inout) :: rhot (
ka,
ia,
ja)
1262 real(RP),
intent(inout) :: prog (
ka,
ia,
ja,
va)
1263 real(RP),
intent(in) :: dens0(
ka,
ia,
ja)
1264 real(RP),
intent(in) :: momz0(
ka,
ia,
ja)
1265 real(RP),
intent(in) :: momx0(
ka,
ia,
ja)
1266 real(RP),
intent(in) :: momy0(
ka,
ia,
ja)
1267 real(RP),
intent(in) :: rhot0(
ka,
ia,
ja)
1268 real(RP),
intent(in) :: prog0(
ka,
ia,
ja,
va)
1269 logical,
intent(in) :: bnd_w
1270 logical,
intent(in) :: bnd_e
1271 logical,
intent(in) :: bnd_s
1272 logical,
intent(in) :: bnd_n
1274 integer :: k, i, j, iv
1284 dens(k,i,j) = dens0(k,i,j)
1285 momz(k,i,j) = momz0(k,i,j)
1286 momx(k,i,j) = momx0(k,i,j)
1287 momy(k,i,j) = momy0(k,i,j)
1288 rhot(k,i,j) = rhot0(k,i,j)
1290 prog(k,i,j,iv) = prog0(k,i,j,iv)
1304 dens(k,i,j) = dens0(k,i,j)
1305 momz(k,i,j) = momz0(k,i,j)
1306 momx(k,i,j) = momx0(k,i,j)
1307 momy(k,i,j) = momy0(k,i,j)
1308 rhot(k,i,j) = rhot0(k,i,j)
1310 prog(k,i,j,iv) = prog0(k,i,j,iv)
1319 momx(k,
ie,j) = momx0(k,
ie,j)
1331 dens(k,i,j) = dens0(k,i,j)
1332 momz(k,i,j) = momz0(k,i,j)
1333 momx(k,i,j) = momx0(k,i,j)
1334 momy(k,i,j) = momy0(k,i,j)
1335 rhot(k,i,j) = rhot0(k,i,j)
1337 prog(k,i,j,iv) = prog0(k,i,j,iv)
1351 dens(k,i,j) = dens0(k,i,j)
1352 momz(k,i,j) = momz0(k,i,j)
1353 momx(k,i,j) = momx0(k,i,j)
1354 momy(k,i,j) = momy0(k,i,j)
1355 rhot(k,i,j) = rhot0(k,i,j)
1357 prog(k,i,j,iv) = prog0(k,i,j,iv)
1366 momy(k,i,
je) = momy0(k,i,
je)
1377 BND_W, BND_E, BND_S, BND_N )
1379 real(RP),
intent(inout) :: qtrc (
ka,
ia,
ja)
1380 real(RP),
intent(in) :: qtrc0(
ka,
ia,
ja)
1381 logical,
intent(in) :: bnd_w
1382 logical,
intent(in) :: bnd_e
1383 logical,
intent(in) :: bnd_s
1384 logical,
intent(in) :: bnd_n
1395 qtrc(k,i,j) = qtrc0(k,i,j)
1407 qtrc(k,i,j) = qtrc0(k,i,j)
1419 qtrc(k,i,j) = qtrc0(k,i,j)
1431 qtrc(k,i,j) = qtrc0(k,i,j)
1444 GSQRT, J13G, J23G, J33G, MAPF, &
1445 RCDZ, RCDX, RCDY, RFDZ, FDZ )
1455 real(RP),
intent(out) :: ddiv(
ka,
ia,
ja)
1456 real(RP),
intent(in) :: momz(
ka,
ia,
ja)
1457 real(RP),
intent(in) :: momx(
ka,
ia,
ja)
1458 real(RP),
intent(in) :: momy(
ka,
ia,
ja)
1459 real(RP),
intent(in) :: gsqrt(
ka,
ia,
ja,7)
1460 real(RP),
intent(in) :: j13g(
ka,
ia,
ja,7)
1461 real(RP),
intent(in) :: j23g(
ka,
ia,
ja,7)
1462 real(RP),
intent(in) :: j33g
1463 real(RP),
intent(in) :: mapf(
ia,
ja,2,7)
1464 real(RP),
intent(in) :: rcdz(
ka)
1465 real(RP),
intent(in) :: rcdx(
ia)
1466 real(RP),
intent(in) :: rcdy(
ja)
1467 real(RP),
intent(in) :: rfdz(
ka-1)
1468 real(RP),
intent(in) :: fdz(
ka-1)
1480 ddiv(k,i,j) = j33g * ( momz(k,i,j) - momz(k-1,i ,j ) ) * rcdz(k) &
1481 + ( ( momx(k+1,i,j) + momx(k+1,i-1,j ) ) * j13g(k+1,i,j,
i_xyw) &
1482 - ( momx(k-1,i,j) + momx(k-1,i-1,j ) ) * j13g(k-1,i,j,
i_xyw) &
1483 + ( momy(k+1,i,j) + momy(k+1,i ,j-1) ) * j23g(k+1,i,j,
i_xyw) &
1484 - ( momy(k-1,i,j) + momy(k-1,i ,j-1) ) * j23g(k-1,i,j,
i_xyw) ) / ( fdz(k)+fdz(k-1) ) &
1485 + mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) &
1486 * ( ( momx(k,i ,j ) * gsqrt(k,i ,j ,
i_uyz) / mapf(i ,j ,2,
i_uy) &
1487 - momx(k,i-1,j ) * gsqrt(k,i-1,j ,
i_uyz) / mapf(i-1,j ,2,
i_uy) ) * rcdx(i) &
1488 + ( momy(k,i ,j ) * gsqrt(k,i ,j ,
i_xvz) / mapf(i ,j ,1,
i_xv) &
1489 - momy(k,i, j-1) * gsqrt(k,i ,j-1,
i_xvz) / mapf(i ,j-1,1,
i_xv) ) * rcdy(j) )
1494 k = iundef; i = iundef; j = iundef
1499 ddiv(
ks,i,j) = j33g * ( momz(
ks,i,j) ) * rcdz(
ks) &
1500 + ( ( momx(
ks+1,i,j) + momx(
ks+1,i-1,j ) ) * j13g(
ks+1,i,j,
i_xyw) &
1501 - ( momx(
ks-1,i,j) + momx(
ks ,i-1,j ) ) * j13g(
ks ,i,j,
i_xyw) &
1502 + ( momy(
ks+1,i,j) + momy(
ks+1,i ,j-1) ) * j23g(
ks+1,i,j,
i_xyw) &
1503 - ( momy(
ks ,i,j) + momy(
ks ,i ,j-1) ) * j23g(
ks ,i,j,
i_xyw) ) * rfdz(
ks) &
1504 + mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) &
1505 * ( ( momx(
ks,i ,j ) * gsqrt(
ks,i ,j ,
i_uyz) / mapf(i ,j ,2,
i_uy) &
1506 - momx(
ks,i-1,j ) * gsqrt(
ks,i-1,j ,
i_uyz) / mapf(i-1,j ,2,
i_uy) ) * rcdx(i) &
1507 + ( momy(
ks,i ,j ) * gsqrt(
ks,i ,j ,
i_xvz) / mapf(i ,j ,1,
i_xv) &
1508 - momy(
ks,i, j-1) * gsqrt(
ks,i ,j-1,
i_xvz) / mapf(i ,j-1,1,
i_xv) ) * rcdy(j) )
1509 ddiv(
ke,i,j) = j33g * ( - momz(
ke-1,i ,j ) ) * rcdz(
ke) &
1510 + ( ( momx(
ke ,i,j) + momx(
ke ,i-1,j ) ) * j13g(
ke ,i,j,
i_xyw) &
1511 - ( momx(
ke-1,i,j) + momx(
ke-1,i-1,j ) ) * j13g(
ke-1,i,j,
i_xyw) &
1512 + ( momy(
ke ,i,j) + momy(
ke ,i ,j-1) ) * j23g(
ke ,i,j,
i_xyw) &
1513 - ( momy(
ke-1,i,j) + momy(
ke-1,i ,j-1) ) * j23g(
ke-1,i,j,
i_xyw) ) * rfdz(
ke) &
1514 + mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) &
1515 * ( ( momx(
ke,i ,j ) * gsqrt(
ke,i ,j ,
i_uyz) / mapf(i ,j ,2,
i_uy) &
1516 - momx(
ke,i-1,j ) * gsqrt(
ke,i-1,j ,
i_uyz) / mapf(i-1,j ,2,
i_uy) ) * rcdx(i) &
1517 + ( momy(
ke,i ,j ) * gsqrt(
ke,i ,j ,
i_xvz) / mapf(i ,j ,1,
i_xv) &
1518 - momy(
ke,i, j-1) * gsqrt(
ke,i ,j-1,
i_xvz) / mapf(i ,j-1,1,
i_xv) ) * rcdy(j) )
1522 k = iundef; i = iundef; j = iundef
1539 real(RP),
intent(out) :: work(KA,IA,JA,3,2)
1540 integer,
intent(out) :: iwork
1541 real(RP),
intent(in) :: data(KA,IA,JA)
1542 integer,
intent(in) :: nd_order
1543 integer,
intent(in) :: KO
1544 integer,
intent(in) :: IO
1545 integer,
intent(in) :: JO
1546 integer,
intent(in) :: KEE
1548 integer :: i_in, i_out, i_tmp
1571 call comm_vars8( work(:,:,:,
zdir,i_in), 16 )
1572 call comm_vars8( work(:,:,:,
xdir,i_in), 17 )
1573 call comm_vars8( work(:,:,:,
ydir,i_in), 18 )
1575 call comm_wait ( work(:,:,:,
zdir,i_in), 16 )
1576 call comm_wait ( work(:,:,:,
xdir,i_in), 17 )
1577 call comm_wait ( work(:,:,:,
ydir,i_in), 18 )
1583 call calc_diff4( work(:,:,:,:,i_out), &
1584 work(:,:,:,:,i_in), &
1609 real(RP),
intent(out) :: diff(KA,IA,JA,3)
1610 real(RP),
intent(in ) :: phi(KA,IA,JA)
1611 integer ,
intent(in ) :: KO
1612 integer ,
intent(in ) :: IO
1613 integer ,
intent(in ) :: JO
1628 call check( __line__, phi(k+2,i,j) )
1629 call check( __line__, phi(k+1,i,j) )
1630 call check( __line__, phi(k ,i,j) )
1631 call check( __line__, phi(k-1,i,j) )
1633 diff(k,i,j,
zdir) = ( + cnz3(1,k+1,1) * phi(k+2,i,j) &
1634 - cnz3(2,k+1,1) * phi(k+1,i,j) &
1635 + cnz3(3,k+1,1) * phi(k ,i,j) &
1636 - cnz3(1,k ,1) * phi(k-1,i,j) )
1645 call check( __line__, phi(
ks+2,i,j) )
1646 call check( __line__, phi(
ks+1,i,j) )
1647 call check( __line__, phi(
ks,i,j) )
1648 call check( __line__, phi(
ke,i,j) )
1649 call check( __line__, phi(
ke-1,i,j) )
1650 call check( __line__, phi(
ke-2,i,j) )
1652 diff(
ks,i,j,
zdir) = ( + cnz3(1,
ks+1,1) * phi(
ks+2,i,j) &
1653 - cnz3(2,
ks+1,1) * phi(
ks+1,i,j) &
1654 + cnz3(3,
ks+1,1) * phi(
ks ,i,j) &
1655 - cnz3(1,
ks ,1) * phi(
ks+1,i,j) )
1658 diff(
ke-1,i,j,
zdir) = ( + cnz3(1,
ke ,1) * phi(
ke-1,i,j) &
1659 - cnz3(2,
ke ,1) * phi(
ke ,i,j) &
1660 + cnz3(3,
ke ,1) * phi(
ke-1,i,j) &
1661 - cnz3(1,
ke-1,1) * phi(
ke-2,i,j) )
1664 diff(
ke+2,i,j,
zdir) = 0.0_rp
1676 call check( __line__, phi(k+1,i,j) )
1677 call check( __line__, phi(k ,i,j) )
1678 call check( __line__, phi(k-1,i,j) )
1679 call check( __line__, phi(k-2,i,j) )
1681 diff(k,i,j,
zdir) = ( + cnz3(1,k ,2) * phi(k+1,i,j) &
1682 - cnz3(2,k ,2) * phi(k ,i,j) &
1683 + cnz3(3,k ,2) * phi(k-1,i,j) &
1684 - cnz3(1,k-1,2) * phi(k-2,i,j) )
1693 call check( __line__, phi(
ks+2,i,j) )
1694 call check( __line__, phi(
ks+1,i,j) )
1695 call check( __line__, phi(
ks,i,j) )
1696 call check( __line__, phi(
ks+1,i,j) )
1697 call check( __line__, phi(
ks ,i,j) )
1698 call check( __line__, phi(
ke-1,i,j) )
1699 call check( __line__, phi(
ke-2,i,j) )
1700 call check( __line__, phi(
ke-3,i,j) )
1702 diff(
ks+1,i,j,
zdir) = ( + cnz3(1,
ks+1,2) * phi(
ks+2,i,j) &
1703 - cnz3(2,
ks+1,2) * phi(
ks+1,i,j) &
1704 + cnz3(3,
ks+1,2) * phi(
ks ,i,j) &
1705 - cnz3(1,
ks ,2) * phi(
ks+1,i,j) )
1709 diff(
ke-1,i,j,
zdir) = ( - cnz3(2,
ke-1,2) * phi(
ke-1,i,j) &
1710 + cnz3(3,
ke-1,2) * phi(
ke-2,i,j) &
1711 - cnz3(1,
ke-2,2) * phi(
ke-3,i,j) )
1712 diff(
ke ,i,j,
zdir) = ( + cnz3(1,
ke ,2) * phi(
ke-1,i,j) &
1713 + cnz3(3,
ke ,2) * phi(
ke-1,i,j) &
1714 - cnz3(1,
ke-1,2) * phi(
ke-2,i,j) )
1729 call check( __line__, phi(k,i+2,j) )
1730 call check( __line__, phi(k,i+1,j) )
1731 call check( __line__, phi(k,i ,j) )
1732 call check( __line__, phi(k,i-1,j) )
1734 diff(k,i,j,
xdir) = ( + cnx3(1,i+1,1) * phi(k,i+2,j) &
1735 - cnx3(2,i+1,1) * phi(k,i+1,j) &
1736 + cnx3(3,i+1,1) * phi(k,i ,j) &
1737 - cnx3(1,i ,1) * phi(k,i-1,j) )
1748 call check( __line__, phi(k,i+1,j) )
1749 call check( __line__, phi(k,i ,j) )
1750 call check( __line__, phi(k,i-1,j) )
1751 call check( __line__, phi(k,i-2,j) )
1753 diff(k,i,j,
xdir) = ( + cnx3(1,i ,2) * phi(k,i+1,j) &
1754 - cnx3(2,i ,2) * phi(k,i ,j) &
1755 + cnx3(3,i ,2) * phi(k,i-1,j) &
1756 - cnx3(1,i-1,2) * phi(k,i-2,j) )
1765 diff( 1:
ks-1,i,j,
xdir) = 0.0_rp
1766 diff(
ke+1:ka ,i,j,
xdir) = 0.0_rp
1777 call check( __line__, phi(k,i,j+2) )
1778 call check( __line__, phi(k,i,j+1) )
1779 call check( __line__, phi(k,i,j ) )
1780 call check( __line__, phi(k,i,j-1) )
1782 diff(k,i,j,
ydir) = ( + cny3(1,j+1,1) * phi(k,i,j+2) &
1783 - cny3(2,j+1,1) * phi(k,i,j+1) &
1784 + cny3(3,j+1,1) * phi(k,i,j ) &
1785 - cny3(1,j ,1) * phi(k,i,j-1) )
1796 call check( __line__, phi(k,i,j+1) )
1797 call check( __line__, phi(k,i,j ) )
1798 call check( __line__, phi(k,i,j-1) )
1799 call check( __line__, phi(k,i,j-2) )
1801 diff(k,i,j,
ydir) = ( + cny3(1,j ,2) * phi(k,i,j+1) &
1802 - cny3(2,j ,2) * phi(k,i,j ) &
1803 + cny3(3,j ,2) * phi(k,i,j-1) &
1804 - cny3(1,j-1,2) * phi(k,i,j-2) )
1813 diff( 1:
ks-1,i,j,
ydir) = 0.0_rp
1814 diff(
ke+1:ka ,i,j,
ydir) = 0.0_rp
1822 subroutine calc_diff4( &
1831 real(RP),
intent(out) :: num_diff_pt1(KA,IA,JA,3)
1832 real(RP),
intent(in) :: num_diff_pt0(KA,IA,JA,3)
1833 real(RP),
intent(in) :: CNZ4(5,KA)
1834 real(RP),
intent(in) :: CNX4(5,IA)
1835 real(RP),
intent(in) :: CNY4(5,JA)
1836 integer,
intent(in) :: k1
1846 call check( __line__, cnz4(1,k) )
1847 call check( __line__, cnz4(2,k) )
1848 call check( __line__, cnz4(3,k) )
1849 call check( __line__, cnz4(4,k) )
1850 call check( __line__, cnz4(5,k) )
1851 call check( __line__, num_diff_pt0(k+2,i,j,
zdir) )
1852 call check( __line__, num_diff_pt0(k+1,i,j,
zdir) )
1853 call check( __line__, num_diff_pt0(k ,i,j,
zdir) )
1854 call check( __line__, num_diff_pt0(k-1,i,j,
zdir) )
1855 call check( __line__, num_diff_pt0(k-2,i,j,
zdir) )
1857 num_diff_pt1(k,i,j,
zdir) = &
1858 ( cnz4(1,k) * num_diff_pt0(k+2,i,j,
zdir) &
1859 - cnz4(2,k) * num_diff_pt0(k+1,i,j,
zdir) &
1860 + cnz4(3,k) * num_diff_pt0(k ,i,j,
zdir) &
1861 - cnz4(4,k) * num_diff_pt0(k-1,i,j,
zdir) &
1862 + cnz4(5,k) * num_diff_pt0(k-2,i,j,
zdir) )
1870 num_diff_pt1(
ks-1,i,j,
zdir) = - num_diff_pt1(
ks ,i,j,
zdir)
1871 num_diff_pt1(
ks-2,i,j,
zdir) = - num_diff_pt1(
ks+1,i,j,
zdir)
1872 num_diff_pt1(
ke ,i,j,
zdir) = - num_diff_pt1(
ke-1,i,j,
zdir)
1873 num_diff_pt1(
ke+1,i,j,
zdir) = - num_diff_pt1(
ke-2,i,j,
zdir)
1882 call check( __line__, cnx4(1,i) )
1883 call check( __line__, cnx4(2,i) )
1884 call check( __line__, cnx4(3,i) )
1885 call check( __line__, cnx4(4,i) )
1886 call check( __line__, cnx4(5,i) )
1887 call check( __line__, num_diff_pt0(k,i-2,j,
xdir) )
1888 call check( __line__, num_diff_pt0(k,i+1,j,
xdir) )
1889 call check( __line__, num_diff_pt0(k,i ,j,
xdir) )
1890 call check( __line__, num_diff_pt0(k,i-1,j,
xdir) )
1891 call check( __line__, num_diff_pt0(k,i-2,j,
xdir) )
1893 num_diff_pt1(k,i,j,
xdir) = &
1894 ( cnx4(1,i) * num_diff_pt0(k,i+2,j,
xdir) &
1895 - cnx4(2,i) * num_diff_pt0(k,i+1,j,
xdir) &
1896 + cnx4(3,i) * num_diff_pt0(k,i ,j,
xdir) &
1897 - cnx4(4,i) * num_diff_pt0(k,i-1,j,
xdir) &
1898 + cnx4(5,i) * num_diff_pt0(k,i-2,j,
xdir) )
1908 call check( __line__, cny4(1,j) )
1909 call check( __line__, cny4(2,j) )
1910 call check( __line__, cny4(3,j) )
1911 call check( __line__, cny4(4,j) )
1912 call check( __line__, cny4(5,j) )
1913 call check( __line__, num_diff_pt0(k,i,j-2,
ydir) )
1914 call check( __line__, num_diff_pt0(k,i,j+1,
ydir) )
1915 call check( __line__, num_diff_pt0(k,i,j ,
ydir) )
1916 call check( __line__, num_diff_pt0(k,i,j-1,
ydir) )
1917 call check( __line__, num_diff_pt0(k,i,j-2,
ydir) )
1919 num_diff_pt1(k,i,j,
ydir) = &
1920 ( cny4(1,j) * num_diff_pt0(k,i,j+2,
ydir) &
1921 - cny4(2,j) * num_diff_pt0(k,i,j+1,
ydir) &
1922 + cny4(3,j) * num_diff_pt0(k,i,j ,
ydir) &
1923 - cny4(4,j) * num_diff_pt0(k,i,j-1,
ydir) &
1924 + cny4(5,j) * num_diff_pt0(k,i,j-2,
ydir) )
1930 end subroutine calc_diff4
1936 phi_in, DENS0, DENS, &
1951 real(RP),
intent(out) :: qflx_anti(
ka,
ia,
ja,3)
1953 real(RP),
intent(in) :: phi_in(
ka,
ia,
ja)
1954 real(RP),
intent(in) :: dens0(
ka,
ia,
ja)
1955 real(RP),
intent(in) :: dens (
ka,
ia,
ja)
1957 real(RP),
intent(in) :: qflx_hi(
ka,
ia,
ja,3)
1958 real(RP),
intent(in) :: qflx_lo(
ka,
ia,
ja,3)
1959 real(RP),
intent(in) :: mflx_hi(
ka,
ia,
ja,3)
1961 real(RP),
intent(in) :: rdz(:)
1962 real(RP),
intent(in) :: rdx(:)
1963 real(RP),
intent(in) :: rdy(:)
1965 real(RP),
intent(in) :: gsqrt(
ka,
ia,
ja)
1966 real(RP),
intent(in) :: mapf(
ia,
ja,2)
1968 real(RP),
intent(in) :: dt
1970 logical,
intent(in) :: flag_vect
1973 real(RP) :: phi_lo(
ka,
ia,
ja)
1974 real(RP) :: pjpls(
ka,
ia,
ja)
1975 real(RP) :: pjmns(
ka,
ia,
ja)
1976 real(RP) :: qjpls(
ka,
ia,
ja)
1977 real(RP) :: qjmns(
ka,
ia,
ja)
1978 real(RP) :: rjpls(
ka,
ia,
ja)
1979 real(RP) :: rjmns(
ka,
ia,
ja)
1981 real(RP) :: qmin, qmax
1982 real(RP) :: zerosw, dirsw
1984 real(RP) :: fact(0:1,-1:1,-1:1)
1985 real(RP) :: rw, ru, rv
1986 real(RP) :: qa_in, qb_in
1987 real(RP) :: qa_lo, qb_lo
1989 integer :: k, i, j, ijs
1990 integer :: iis, iie, jjs, jje
1994 qflx_anti(:,:,:,:) = undef
1996 pjpls(:,:,:) = undef
1997 pjmns(:,:,:) = undef
1998 qjpls(:,:,:) = undef
1999 qjmns(:,:,:) = undef
2000 rjpls(:,:,:) = undef
2001 rjmns(:,:,:) = undef
2014 call check( __line__, qflx_hi(k,i,j,
zdir) )
2015 call check( __line__, qflx_lo(k,i,j,
zdir) )
2017 qflx_anti(k,i,j,
zdir) = qflx_hi(k,i,j,
zdir) - qflx_lo(k,i,j,
zdir)
2022 k = iundef; i = iundef; j = iundef
2027 qflx_anti(
ks-1,i,j,
zdir) = 0.0_rp
2028 qflx_anti(
ke ,i,j,
zdir) = 0.0_rp
2032 k = iundef; i = iundef; j = iundef
2039 call check( __line__, qflx_hi(k,i,j,
xdir) )
2040 call check( __line__, qflx_lo(k,i,j,
xdir) )
2042 qflx_anti(k,i,j,
xdir) = qflx_hi(k,i,j,
xdir) - qflx_lo(k,i,j,
xdir)
2047 k = iundef; i = iundef; j = iundef
2054 call check( __line__, qflx_hi(k,i,j,
ydir) )
2055 call check( __line__, qflx_lo(k,i,j,
ydir) )
2057 qflx_anti(k,i,j,
ydir) = qflx_hi(k,i,j,
ydir) - qflx_lo(k,i,j,
ydir)
2062 k = iundef; i = iundef; j = iundef
2071 call check( __line__, phi_in(k,i,j) )
2072 call check( __line__, qflx_lo(k ,i ,j ,
zdir) )
2073 call check( __line__, qflx_lo(k-1,i ,j ,
zdir) )
2074 call check( __line__, qflx_lo(k ,i ,j ,
xdir) )
2075 call check( __line__, qflx_lo(k ,i-1,j ,
xdir) )
2076 call check( __line__, qflx_lo(k ,i ,j ,
ydir) )
2077 call check( __line__, qflx_lo(k ,i ,j-1,
ydir) )
2079 phi_lo(k,i,j) = ( phi_in(k,i,j) * dens0(k,i,j) &
2080 + dt * ( - ( ( qflx_lo(k,i,j,
zdir)-qflx_lo(k-1,i ,j ,
zdir) ) * rdz(k) &
2081 + ( qflx_lo(k,i,j,
xdir)-qflx_lo(k ,i-1,j ,
xdir) ) * rdx(i) &
2082 + ( qflx_lo(k,i,j,
ydir)-qflx_lo(k ,i ,j-1,
ydir) ) * rdy(j) &
2083 ) * mapf(i,j,1) * mapf(i,j,2) / gsqrt(k,i,j) ) &
2089 k = iundef; i = iundef; j = iundef
2098 call check( __line__, qflx_anti(k ,i ,j ,
zdir) )
2099 call check( __line__, qflx_anti(k-1,i ,j ,
zdir) )
2100 call check( __line__, qflx_anti(k ,i ,j ,
xdir) )
2101 call check( __line__, qflx_anti(k ,i-1,j ,
xdir) )
2102 call check( __line__, qflx_anti(k ,i ,j ,
ydir) )
2103 call check( __line__, qflx_anti(k ,i ,j-1,
ydir) )
2105 pjpls(k,i,j) = dt * ( ( max(0.0_rp,qflx_anti(k-1,i ,j ,
zdir)) - min(0.0_rp,qflx_anti(k,i,j,
zdir)) ) * rdz(k) &
2106 + ( max(0.0_rp,qflx_anti(k ,i-1,j ,
xdir)) - min(0.0_rp,qflx_anti(k,i,j,
xdir)) ) * rdx(i) &
2107 + ( max(0.0_rp,qflx_anti(k ,i ,j-1,
ydir)) - min(0.0_rp,qflx_anti(k,i,j,
ydir)) ) * rdy(j) &
2108 ) * mapf(i,j,1) * mapf(i,j,2) / gsqrt(k,i,j)
2113 k = iundef; i = iundef; j = iundef
2122 call check( __line__, qflx_anti(k ,i ,j ,
zdir) )
2123 call check( __line__, qflx_anti(k-1,i ,j ,
zdir) )
2124 call check( __line__, qflx_anti(k ,i ,j ,
xdir) )
2125 call check( __line__, qflx_anti(k ,i-1,j ,
xdir) )
2126 call check( __line__, qflx_anti(k ,i ,j ,
ydir) )
2127 call check( __line__, qflx_anti(k ,i ,j-1,
ydir) )
2129 pjmns(k,i,j) = dt * ( ( max(0.0_rp,qflx_anti(k,i,j,
zdir)) - min(0.0_rp,qflx_anti(k-1,i ,j ,
zdir)) ) * rdz(k) &
2130 + ( max(0.0_rp,qflx_anti(k,i,j,
xdir)) - min(0.0_rp,qflx_anti(k ,i-1,j ,
xdir)) ) * rdx(i) &
2131 + ( max(0.0_rp,qflx_anti(k,i,j,
ydir)) - min(0.0_rp,qflx_anti(k ,i ,j-1,
ydir)) ) * rdy(j) &
2132 ) * mapf(i,j,1) * mapf(i,j,2) / gsqrt(k,i,j)
2137 k = iundef; i = iundef; j = iundef
2148 rw = (mflx_hi(k,i,j,
zdir)+mflx_hi(k-1,i ,j ,
zdir)) * rdz(k)
2149 ru = (mflx_hi(k,i,j,
xdir)+mflx_hi(k ,i-1,j ,
xdir)) * rdx(i)
2150 rv = (mflx_hi(k,i,j,
ydir)+mflx_hi(k ,i ,j-1,
ydir)) * rdy(j)
2152 call get_fact_fct( fact, &
2155 qa_in = fact(1, 1, 1) * phi_in(k+1,i+1,j+1) &
2156 + fact(0, 1, 1) * phi_in(k ,i+1,j+1) &
2157 + fact(1, 0, 1) * phi_in(k+1,i ,j+1) &
2158 + fact(0, 0, 1) * phi_in(k ,i ,j+1) &
2159 + fact(1,-1, 1) * phi_in(k+1,i-1,j+1) &
2160 + fact(1, 1, 0) * phi_in(k+1,i+1,j ) &
2161 + fact(0, 1, 0) * phi_in(k ,i+1,j ) &
2162 + fact(1, 0, 0) * phi_in(k+1,i ,j ) &
2163 + fact(1,-1, 0) * phi_in(k+1,i-1,j ) &
2164 + fact(1, 1,-1) * phi_in(k+1,i+1,j-1) &
2165 + fact(0, 1,-1) * phi_in(k ,i+1,j-1) &
2166 + fact(1, 0,-1) * phi_in(k+1,i ,j-1) &
2167 + fact(1,-1,-1) * phi_in(k+1,i-1,j-1) &
2168 + fact(0, 0, 0) * phi_in(k ,i ,j )
2169 qb_in = fact(1, 1, 1) * phi_in(k-1,i-1,j-1) &
2170 + fact(0, 1, 1) * phi_in(k ,i-1,j-1) &
2171 + fact(1, 0, 1) * phi_in(k-1,i ,j-1) &
2172 + fact(0, 0, 1) * phi_in(k ,i ,j-1) &
2173 + fact(1,-1, 1) * phi_in(k-1,i+1,j-1) &
2174 + fact(1, 1, 0) * phi_in(k-1,i-1,j ) &
2175 + fact(0, 1, 0) * phi_in(k ,i-1,j ) &
2176 + fact(1, 0, 0) * phi_in(k-1,i ,j ) &
2177 + fact(1,-1, 0) * phi_in(k-1,i+1,j ) &
2178 + fact(1, 1,-1) * phi_in(k-1,i-1,j+1) &
2179 + fact(0, 1,-1) * phi_in(k ,i-1,j-1) &
2180 + fact(1, 0,-1) * phi_in(k-1,i ,j-1) &
2181 + fact(1,-1,-1) * phi_in(k-1,i+1,j+1) &
2182 + fact(0, 0, 0) * phi_in(k ,i ,j )
2183 qa_lo = fact(1, 1, 1) * phi_lo(k+1,i+1,j+1) &
2184 + fact(0, 1, 1) * phi_lo(k ,i+1,j+1) &
2185 + fact(1, 0, 1) * phi_lo(k+1,i ,j+1) &
2186 + fact(0, 0, 1) * phi_lo(k ,i ,j+1) &
2187 + fact(1,-1, 1) * phi_lo(k+1,i-1,j+1) &
2188 + fact(1, 1, 0) * phi_lo(k+1,i+1,j ) &
2189 + fact(0, 1, 0) * phi_lo(k ,i+1,j ) &
2190 + fact(1, 0, 0) * phi_lo(k+1,i ,j ) &
2191 + fact(1,-1, 0) * phi_lo(k+1,i-1,j ) &
2192 + fact(1, 1,-1) * phi_lo(k+1,i+1,j-1) &
2193 + fact(0, 1,-1) * phi_lo(k ,i+1,j-1) &
2194 + fact(1, 0,-1) * phi_lo(k+1,i ,j-1) &
2195 + fact(1,-1,-1) * phi_lo(k+1,i-1,j-1) &
2196 + fact(0, 0, 0) * phi_lo(k ,i ,j )
2197 qb_lo = fact(1, 1, 1) * phi_lo(k-1,i-1,j-1) &
2198 + fact(0, 1, 1) * phi_lo(k ,i-1,j-1) &
2199 + fact(1, 0, 1) * phi_lo(k-1,i ,j-1) &
2200 + fact(0, 0, 1) * phi_lo(k ,i ,j-1) &
2201 + fact(1,-1, 1) * phi_lo(k-1,i+1,j-1) &
2202 + fact(1, 1, 0) * phi_lo(k-1,i-1,j ) &
2203 + fact(0, 1, 0) * phi_lo(k ,i-1,j ) &
2204 + fact(1, 0, 0) * phi_lo(k-1,i ,j ) &
2205 + fact(1,-1, 0) * phi_lo(k-1,i+1,j ) &
2206 + fact(1, 1,-1) * phi_lo(k-1,i-1,j+1) &
2207 + fact(0, 1,-1) * phi_lo(k ,i-1,j-1) &
2208 + fact(1, 0,-1) * phi_lo(k-1,i ,j-1) &
2209 + fact(1,-1,-1) * phi_lo(k-1,i+1,j+1) &
2210 + fact(0, 0, 0) * phi_lo(k ,i ,j )
2213 phi_in(k,i,j), qa_in, qb_in, &
2214 phi_lo(k,i,j), qa_lo, qb_lo )
2216 phi_in(k,i,j), qa_in, qb_in, &
2217 phi_lo(k,i,j), qa_lo, qb_lo )
2218 qjpls(k,i,j) = ( qmax - phi_lo(k,i,j) ) * dens(k,i,j)
2219 qjmns(k,i,j) = ( phi_lo(k,i,j) - qmin ) * dens(k,i,j)
2228 rw = (mflx_hi(
ks,i,j,
zdir) ) * rdz(
ks)
2229 ru = (mflx_hi(
ks,i,j,
xdir)+mflx_hi(
ks ,i-1,j ,
xdir)) * rdx(i)
2230 rv = (mflx_hi(
ks,i,j,
ydir)+mflx_hi(
ks ,i ,j-1,
ydir)) * rdy(j)
2232 call get_fact_fct( fact, &
2235 qa_in = fact(1, 1, 1) * phi_in(
ks+1,i+1,j+1) &
2236 + fact(0, 1, 1) * phi_in(
ks ,i+1,j+1) &
2237 + fact(1, 0, 1) * phi_in(
ks+1,i ,j+1) &
2238 + fact(0, 0, 1) * phi_in(
ks ,i ,j+1) &
2239 + fact(1,-1, 1) * phi_in(
ks+1,i-1,j+1) &
2240 + fact(1, 1, 0) * phi_in(
ks+1,i+1,j ) &
2241 + fact(0, 1, 0) * phi_in(
ks ,i+1,j ) &
2242 + fact(1, 0, 0) * phi_in(
ks+1,i ,j ) &
2243 + fact(1,-1, 0) * phi_in(
ks+1,i-1,j ) &
2244 + fact(1, 1,-1) * phi_in(
ks+1,i+1,j-1) &
2245 + fact(0, 1,-1) * phi_in(
ks ,i+1,j-1) &
2246 + fact(1, 0,-1) * phi_in(
ks+1,i ,j-1) &
2247 + fact(1,-1,-1) * phi_in(
ks+1,i-1,j-1) &
2248 + fact(0, 0, 0) * phi_in(
ks ,i ,j )
2249 qb_in = fact(1, 1, 1) * phi_in(
ks ,i-1,j-1) &
2250 + fact(0, 1, 1) * phi_in(
ks ,i-1,j-1) &
2251 + fact(1, 0, 1) * phi_in(
ks ,i ,j-1) &
2252 + fact(0, 0, 1) * phi_in(
ks ,i ,j-1) &
2253 + fact(1,-1, 1) * phi_in(
ks ,i+1,j-1) &
2254 + fact(1, 1, 0) * phi_in(
ks ,i-1,j ) &
2255 + fact(0, 1, 0) * phi_in(
ks ,i-1,j ) &
2256 + fact(1, 0, 0) * phi_in(
ks ,i ,j ) &
2257 + fact(1,-1, 0) * phi_in(
ks ,i+1,j ) &
2258 + fact(1, 1,-1) * phi_in(
ks ,i-1,j+1) &
2259 + fact(0, 1,-1) * phi_in(
ks ,i-1,j-1) &
2260 + fact(1, 0,-1) * phi_in(
ks ,i ,j-1) &
2261 + fact(1,-1,-1) * phi_in(
ks ,i+1,j+1) &
2262 + fact(0, 0, 0) * phi_in(
ks ,i ,j )
2263 qa_lo = fact(1, 1, 1) * phi_lo(
ks+1,i+1,j+1) &
2264 + fact(0, 1, 1) * phi_lo(
ks ,i+1,j+1) &
2265 + fact(1, 0, 1) * phi_lo(
ks+1,i ,j+1) &
2266 + fact(0, 0, 1) * phi_lo(
ks ,i ,j+1) &
2267 + fact(1,-1, 1) * phi_lo(
ks+1,i-1,j+1) &
2268 + fact(1, 1, 0) * phi_lo(
ks+1,i+1,j ) &
2269 + fact(0, 1, 0) * phi_lo(
ks ,i+1,j ) &
2270 + fact(1, 0, 0) * phi_lo(
ks+1,i ,j ) &
2271 + fact(1,-1, 0) * phi_lo(
ks+1,i-1,j ) &
2272 + fact(1, 1,-1) * phi_lo(
ks+1,i+1,j-1) &
2273 + fact(0, 1,-1) * phi_lo(
ks ,i+1,j-1) &
2274 + fact(1, 0,-1) * phi_lo(
ks+1,i ,j-1) &
2275 + fact(1,-1,-1) * phi_lo(
ks+1,i-1,j-1) &
2276 + fact(0, 0, 0) * phi_lo(
ks ,i ,j )
2277 qb_lo = fact(1, 1, 1) * phi_lo(
ks ,i-1,j-1) &
2278 + fact(0, 1, 1) * phi_lo(
ks ,i-1,j-1) &
2279 + fact(1, 0, 1) * phi_lo(
ks ,i ,j-1) &
2280 + fact(0, 0, 1) * phi_lo(
ks ,i ,j-1) &
2281 + fact(1,-1, 1) * phi_lo(
ks ,i+1,j-1) &
2282 + fact(1, 1, 0) * phi_lo(
ks ,i-1,j ) &
2283 + fact(0, 1, 0) * phi_lo(
ks ,i-1,j ) &
2284 + fact(1, 0, 0) * phi_lo(
ks ,i ,j ) &
2285 + fact(1,-1, 0) * phi_lo(
ks ,i+1,j ) &
2286 + fact(1, 1,-1) * phi_lo(
ks ,i-1,j+1) &
2287 + fact(0, 1,-1) * phi_lo(
ks ,i-1,j-1) &
2288 + fact(1, 0,-1) * phi_lo(
ks ,i ,j-1) &
2289 + fact(1,-1,-1) * phi_lo(
ks ,i+1,j+1) &
2290 + fact(0, 0, 0) * phi_lo(
ks ,i ,j )
2293 phi_in(
ks,i,j), qa_in, qb_in, &
2294 phi_lo(
ks,i,j), qa_lo, qb_lo )
2296 phi_in(
ks,i,j), qa_in, qb_in, &
2297 phi_lo(
ks,i,j), qa_lo, qb_lo )
2298 qjpls(
ks,i,j) = ( qmax - phi_lo(
ks,i,j) ) * dens(
ks,i,j)
2299 qjmns(
ks,i,j) = ( phi_lo(
ks,i,j) - qmin ) * dens(
ks,i,j)
2307 rw = ( mflx_hi(
ke-1,i ,j ,
zdir)) * rdz(
ke)
2308 ru = (mflx_hi(
ke,i,j,
xdir)+mflx_hi(
ke ,i-1,j ,
xdir)) * rdx(i)
2309 rv = (mflx_hi(
ke,i,j,
ydir)+mflx_hi(
ke ,i ,j-1,
ydir)) * rdy(j)
2311 call get_fact_fct( fact, &
2314 qa_in = fact(1, 1, 1) * phi_in(
ke ,i+1,j+1) &
2315 + fact(0, 1, 1) * phi_in(
ke ,i+1,j+1) &
2316 + fact(1, 0, 1) * phi_in(
ke ,i ,j+1) &
2317 + fact(0, 0, 1) * phi_in(
ke ,i ,j+1) &
2318 + fact(1,-1, 1) * phi_in(
ke ,i-1,j+1) &
2319 + fact(1, 1, 0) * phi_in(
ke ,i+1,j ) &
2320 + fact(0, 1, 0) * phi_in(
ke ,i+1,j ) &
2321 + fact(1, 0, 0) * phi_in(
ke ,i ,j ) &
2322 + fact(1,-1, 0) * phi_in(
ke ,i-1,j ) &
2323 + fact(1, 1,-1) * phi_in(
ke ,i+1,j-1) &
2324 + fact(0, 1,-1) * phi_in(
ke ,i+1,j-1) &
2325 + fact(1, 0,-1) * phi_in(
ke ,i ,j-1) &
2326 + fact(1,-1,-1) * phi_in(
ke ,i-1,j-1) &
2327 + fact(0, 0, 0) * phi_in(
ke ,i ,j )
2328 qb_in = fact(1, 1, 1) * phi_in(
ke-1,i-1,j-1) &
2329 + fact(0, 1, 1) * phi_in(
ke ,i-1,j-1) &
2330 + fact(1, 0, 1) * phi_in(
ke-1,i ,j-1) &
2331 + fact(0, 0, 1) * phi_in(
ke ,i ,j-1) &
2332 + fact(1,-1, 1) * phi_in(
ke-1,i+1,j-1) &
2333 + fact(1, 1, 0) * phi_in(
ke-1,i-1,j ) &
2334 + fact(0, 1, 0) * phi_in(
ke ,i-1,j ) &
2335 + fact(1, 0, 0) * phi_in(
ke-1,i ,j ) &
2336 + fact(1,-1, 0) * phi_in(
ke-1,i+1,j ) &
2337 + fact(1, 1,-1) * phi_in(
ke-1,i-1,j+1) &
2338 + fact(0, 1,-1) * phi_in(
ke ,i-1,j-1) &
2339 + fact(1, 0,-1) * phi_in(
ke-1,i ,j-1) &
2340 + fact(1,-1,-1) * phi_in(
ke-1,i+1,j+1) &
2341 + fact(0, 0, 0) * phi_in(
ke ,i ,j )
2342 qa_lo = fact(1, 1, 1) * phi_lo(
ke ,i+1,j+1) &
2343 + fact(0, 1, 1) * phi_lo(
ke ,i+1,j+1) &
2344 + fact(1, 0, 1) * phi_lo(
ke ,i ,j+1) &
2345 + fact(0, 0, 1) * phi_lo(
ke ,i ,j+1) &
2346 + fact(1,-1, 1) * phi_lo(
ke ,i-1,j+1) &
2347 + fact(1, 1, 0) * phi_lo(
ke ,i+1,j ) &
2348 + fact(0, 1, 0) * phi_lo(
ke ,i+1,j ) &
2349 + fact(1, 0, 0) * phi_lo(
ke ,i ,j ) &
2350 + fact(1,-1, 0) * phi_lo(
ke ,i-1,j ) &
2351 + fact(1, 1,-1) * phi_lo(
ke ,i+1,j-1) &
2352 + fact(0, 1,-1) * phi_lo(
ke ,i+1,j-1) &
2353 + fact(1, 0,-1) * phi_lo(
ke ,i ,j-1) &
2354 + fact(1,-1,-1) * phi_lo(
ke ,i-1,j-1) &
2355 + fact(0, 0, 0) * phi_lo(
ke ,i ,j )
2356 qb_lo = fact(1, 1, 1) * phi_lo(
ke-1,i-1,j-1) &
2357 + fact(0, 1, 1) * phi_lo(
ke ,i-1,j-1) &
2358 + fact(1, 0, 1) * phi_lo(
ke-1,i ,j-1) &
2359 + fact(0, 0, 1) * phi_lo(
ke ,i ,j-1) &
2360 + fact(1,-1, 1) * phi_lo(
ke-1,i+1,j-1) &
2361 + fact(1, 1, 0) * phi_lo(
ke-1,i-1,j ) &
2362 + fact(0, 1, 0) * phi_lo(
ke ,i-1,j ) &
2363 + fact(1, 0, 0) * phi_lo(
ke-1,i ,j ) &
2364 + fact(1,-1, 0) * phi_lo(
ke-1,i+1,j ) &
2365 + fact(1, 1,-1) * phi_lo(
ke-1,i-1,j+1) &
2366 + fact(0, 1,-1) * phi_lo(
ke ,i-1,j-1) &
2367 + fact(1, 0,-1) * phi_lo(
ke-1,i ,j-1) &
2368 + fact(1,-1,-1) * phi_lo(
ke-1,i+1,j+1) &
2369 + fact(0, 0, 0) * phi_lo(
ke ,i ,j )
2372 phi_in(
ke,i,j), qa_in, qb_in, &
2373 phi_lo(
ke,i,j), qa_lo, qb_lo )
2375 phi_in(
ke,i,j), qa_in, qb_in, &
2376 phi_lo(
ke,i,j), qa_lo, qb_lo )
2377 qjpls(
ke,i,j) = ( qmax - phi_lo(
ke,i,j) ) * dens(
ke,i,j)
2378 qjmns(
ke,i,j) = ( phi_lo(
ke,i,j) - qmin ) * dens(
ke,i,j)
2389 call check( __line__, phi_in(k ,i ,j ) )
2390 call check( __line__, phi_in(k-1,i ,j ) )
2391 call check( __line__, phi_in(k+1,i ,j ) )
2392 call check( __line__, phi_in(k ,i-1,j ) )
2393 call check( __line__, phi_in(k ,i+1,j ) )
2394 call check( __line__, phi_in(k ,i ,j+1) )
2395 call check( __line__, phi_in(k ,i ,j-1) )
2396 call check( __line__, phi_lo(k ,i ,j ) )
2397 call check( __line__, phi_lo(k-1,i ,j ) )
2398 call check( __line__, phi_lo(k+1,i ,j ) )
2399 call check( __line__, phi_lo(k ,i-1,j ) )
2400 call check( __line__, phi_lo(k ,i+1,j ) )
2401 call check( __line__, phi_lo(k ,i ,j+1) )
2402 call check( __line__, phi_lo(k ,i ,j-1) )
2404 qmax = max( phi_in(k ,i ,j ), &
2405 phi_in(k+1,i ,j ), &
2406 phi_in(k-1,i ,j ), &
2407 phi_in(k ,i+1,j ), &
2408 phi_in(k ,i-1,j ), &
2409 phi_in(k ,i ,j+1), &
2410 phi_in(k ,i ,j-1), &
2412 phi_lo(k+1,i ,j ), &
2413 phi_lo(k-1,i ,j ), &
2414 phi_lo(k ,i+1,j ), &
2415 phi_lo(k ,i-1,j ), &
2416 phi_lo(k ,i ,j+1), &
2418 qmin = min( phi_in(k ,i ,j ), &
2419 phi_in(k+1,i ,j ), &
2420 phi_in(k-1,i ,j ), &
2421 phi_in(k ,i-1,j ), &
2422 phi_in(k ,i+1,j ), &
2423 phi_in(k ,i ,j+1), &
2424 phi_in(k ,i ,j-1), &
2426 phi_lo(k+1,i ,j ), &
2427 phi_lo(k-1,i ,j ), &
2428 phi_lo(k ,i-1,j ), &
2429 phi_lo(k ,i+1,j ), &
2430 phi_lo(k ,i ,j+1), &
2432 qjpls(k,i,j) = ( qmax - phi_lo(k,i,j) ) * dens(k,i,j)
2433 qjmns(k,i,j) = ( phi_lo(k,i,j) - qmin ) * dens(k,i,j)
2438 k = iundef; i = iundef; j = iundef
2444 call check( __line__, phi_in(
ks ,i ,j ) )
2445 call check( __line__, phi_in(
ks+1,i ,j ) )
2446 call check( __line__, phi_in(
ks ,i-1,j ) )
2447 call check( __line__, phi_in(
ks ,i+1,j ) )
2448 call check( __line__, phi_in(
ks ,i ,j+1) )
2449 call check( __line__, phi_in(
ks ,i ,j-1) )
2450 call check( __line__, phi_lo(
ks ,i ,j ) )
2451 call check( __line__, phi_lo(
ks+1,i ,j ) )
2452 call check( __line__, phi_lo(
ks ,i-1,j ) )
2453 call check( __line__, phi_lo(
ks ,i+1,j ) )
2454 call check( __line__, phi_lo(
ks ,i ,j+1) )
2455 call check( __line__, phi_lo(
ks ,i ,j-1) )
2456 call check( __line__, phi_in(
ke ,i ,j ) )
2457 call check( __line__, phi_in(
ke-1,i ,j ) )
2458 call check( __line__, phi_in(
ke ,i-1,j ) )
2459 call check( __line__, phi_in(
ke ,i+1,j ) )
2460 call check( __line__, phi_in(
ke ,i ,j+1) )
2461 call check( __line__, phi_in(
ke ,i ,j-1) )
2462 call check( __line__, phi_lo(
ke ,i ,j ) )
2463 call check( __line__, phi_lo(
ke-1,i ,j ) )
2464 call check( __line__, phi_lo(
ke ,i-1,j ) )
2465 call check( __line__, phi_lo(
ke ,i+1,j ) )
2466 call check( __line__, phi_lo(
ke ,i ,j+1) )
2467 call check( __line__, phi_lo(
ke ,i ,j-1) )
2469 qmax = max( phi_in(
ks ,i ,j ), &
2470 phi_in(
ks+1,i ,j ), &
2471 phi_in(
ks ,i+1,j ), &
2472 phi_in(
ks ,i-1,j ), &
2473 phi_in(
ks ,i ,j+1), &
2474 phi_in(
ks ,i ,j-1), &
2475 phi_lo(
ks ,i ,j ), &
2476 phi_lo(
ks+1,i ,j ), &
2477 phi_lo(
ks ,i+1,j ), &
2478 phi_lo(
ks ,i-1,j ), &
2479 phi_lo(
ks ,i ,j+1), &
2480 phi_lo(
ks ,i ,j-1) )
2481 qmin = min( phi_in(
ks ,i ,j ), &
2482 phi_in(
ks+1,i ,j ), &
2483 phi_in(
ks ,i+1,j ), &
2484 phi_in(
ks ,i-1,j ), &
2485 phi_in(
ks ,i ,j+1), &
2486 phi_in(
ks ,i ,j-1), &
2487 phi_lo(
ks ,i ,j ), &
2488 phi_lo(
ks+1,i ,j ), &
2489 phi_lo(
ks ,i+1,j ), &
2490 phi_lo(
ks ,i-1,j ), &
2491 phi_lo(
ks ,i ,j+1), &
2492 phi_lo(
ks ,i ,j-1) )
2493 qjmns(
ks,i,j) = ( phi_lo(
ks,i,j) - qmin ) * dens(
ks,i,j)
2494 qjpls(
ks,i,j) = ( qmax - phi_lo(
ks,i,j) ) * dens(
ks,i,j)
2496 qmax = max( phi_in(
ke ,i ,j ), &
2497 phi_in(
ke-1,i ,j ), &
2498 phi_in(
ke ,i+1,j ), &
2499 phi_in(
ke ,i-1,j ), &
2500 phi_in(
ke ,i ,j+1), &
2501 phi_in(
ke ,i ,j-1), &
2502 phi_lo(
ke ,i ,j ), &
2503 phi_lo(
ke-1,i ,j ), &
2504 phi_lo(
ke ,i+1,j ), &
2505 phi_lo(
ke ,i-1,j ), &
2506 phi_lo(
ke ,i ,j+1), &
2507 phi_lo(
ke ,i ,j-1) )
2508 qmin = min( phi_in(
ke ,i ,j ), &
2509 phi_in(
ke-1,i ,j ), &
2510 phi_in(
ke ,i-1,j ), &
2511 phi_in(
ke ,i+1,j ), &
2512 phi_in(
ke ,i ,j+1), &
2513 phi_in(
ke ,i ,j-1), &
2514 phi_lo(
ke ,i ,j ), &
2515 phi_lo(
ke-1,i ,j ), &
2516 phi_lo(
ke ,i-1,j ), &
2517 phi_lo(
ke ,i+1,j ), &
2518 phi_lo(
ke ,i ,j+1), &
2519 phi_lo(
ke ,i ,j-1) )
2520 qjpls(
ke,i,j) = ( qmax - phi_lo(
ke,i,j) ) * dens(
ke,i,j)
2521 qjmns(
ke,i,j) = ( phi_lo(
ke,i,j) - qmin ) * dens(
ke,i,j)
2525 k = iundef; i = iundef; j = iundef
2535 call check( __line__, pjpls(k,i,j) )
2536 call check( __line__, qjpls(k,i,j) )
2539 zerosw = 0.5_rp - sign( 0.5_rp, pjpls(k,i,j)-epsilon )
2540 rjpls(k,i,j) = min( 1.0_rp, qjpls(k,i,j) * ( 1.0_rp-zerosw ) / ( pjpls(k,i,j)-zerosw ) )
2545 k = iundef; i = iundef; j = iundef
2554 call check( __line__, pjmns(k,i,j) )
2555 call check( __line__, qjmns(k,i,j) )
2558 zerosw = 0.5_rp - sign( 0.5_rp, pjmns(k,i,j)-epsilon )
2559 rjmns(k,i,j) = min( 1.0_rp, qjmns(k,i,j) * ( 1.0_rp-zerosw ) / ( pjmns(k,i,j)-zerosw ) )
2564 k = iundef; i = iundef; j = iundef
2570 call comm_vars8( rjpls(:,:,:), 1 )
2571 call comm_vars8( rjmns(:,:,:), 2 )
2572 call comm_wait ( rjpls(:,:,:), 1 )
2573 call comm_wait ( rjmns(:,:,:), 2 )
2586 call check( __line__, qflx_anti(k,i,j,
zdir) )
2587 call check( __line__, rjpls(k ,i,j) )
2588 call check( __line__, rjpls(k+1,i,j) )
2589 call check( __line__, rjmns(k ,i,j) )
2590 call check( __line__, rjmns(k+1,i,j) )
2593 dirsw = 0.5_rp + sign( 0.5_rp, qflx_anti(k,i,j,
zdir) )
2594 qflx_anti(k,i,j,
zdir) = qflx_anti(k,i,j,
zdir) &
2596 - min( rjpls(k+1,i,j),rjmns(k ,i,j) ) * ( dirsw ) &
2597 - min( rjpls(k ,i,j),rjmns(k+1,i,j) ) * ( 1.0_rp - dirsw ) )
2602 k = iundef; i = iundef; j = iundef
2609 call check( __line__, rjpls(
ke ,i,j) )
2610 call check( __line__, rjmns(
ke ,i,j) )
2612 qflx_anti(
ks-1,i,j,
zdir) = 0.0_rp
2613 qflx_anti(
ke ,i,j,
zdir) = 0.0_rp
2617 k = iundef; i = iundef; j = iundef
2620 if ( iis ==
is )
then 2631 call check( __line__, qflx_anti(k,i,j,
xdir) )
2632 call check( __line__, rjpls(k,i ,j) )
2633 call check( __line__, rjpls(k,i+1,j) )
2634 call check( __line__, rjmns(k,i ,j) )
2635 call check( __line__, rjmns(k,i+1,j) )
2638 dirsw = 0.5_rp + sign( 0.5_rp, qflx_anti(k,i,j,
xdir) )
2639 qflx_anti(k,i,j,
xdir) = qflx_anti(k,i,j,
xdir) &
2641 - min( rjpls(k,i+1,j),rjmns(k,i ,j) ) * ( dirsw ) &
2642 - min( rjpls(k,i ,j),rjmns(k,i+1,j) ) * ( 1.0_rp - dirsw ) )
2647 k = iundef; i = iundef; j = iundef
2650 if ( jjs ==
js )
then 2660 call check( __line__, qflx_anti(k,i,j,
ydir) )
2661 call check( __line__, rjpls(k,i,j+1) )
2662 call check( __line__, rjpls(k,i,j ) )
2663 call check( __line__, rjmns(k,i,j ) )
2664 call check( __line__, rjmns(k,i,j+1) )
2667 dirsw = 0.5_rp + sign( 0.5_rp, qflx_anti(k,i,j,
ydir) )
2668 qflx_anti(k,i,j,
ydir) = qflx_anti(k,i,j,
ydir) &
2670 - min( rjpls(k,i,j+1),rjmns(k,i,j ) ) * ( dirsw ) &
2671 - min( rjpls(k,i,j ),rjmns(k,i,j+1) ) * ( 1.0_rp - dirsw ) )
2676 k = iundef; i = iundef; j = iundef
2688 subroutine get_fact_fct( &
2694 real(RP),
intent(out) :: fact(0:1,-1:1,-1:1)
2695 real(RP),
intent(in) :: rw, ru, rv
2697 real(RP) :: sign_uv, sign_uw, sign_vw
2698 real(RP) :: ugev, ugew, vgew
2699 real(RP) :: umax, vmax, wmax
2700 real(RP) :: vu, wu, uv, wv, uw, vw
2701 real(RP) :: uzero, vzero, wzero
2704 ugev = sign(0.5_rp, abs(ru)-abs(rv)) + 0.5_rp
2705 ugew = sign(0.5_rp, abs(ru)-abs(rw)) + 0.5_rp
2706 vgew = sign(0.5_rp, abs(rv)-abs(rw)) + 0.5_rp
2708 uzero = sign(0.5_rp,abs(ru)-epsilon) - 0.5_rp
2709 vzero = sign(0.5_rp,abs(rv)-epsilon) - 0.5_rp
2710 wzero = sign(0.5_rp,abs(rw)-epsilon) - 0.5_rp
2712 sign_uv = sign(0.5_rp, ru*rv) + 0.5_rp
2713 sign_uw = sign(0.5_rp, ru*rw) + 0.5_rp
2714 sign_vw = sign(0.5_rp, rv*rw) + 0.5_rp
2716 wu = abs( rw / ( ru+uzero ) * ( 1.0_rp+uzero ) )
2717 vu = abs( rv / ( ru+uzero ) * ( 1.0_rp+uzero ) )
2718 uv = abs( ru / ( rv+vzero ) * ( 1.0_rp+vzero ) )
2719 wv = abs( rw / ( rv+vzero ) * ( 1.0_rp+vzero ) )
2720 uw = abs( ru / ( rw+wzero ) * ( 1.0_rp+wzero ) )
2721 vw = abs( rv / ( rw+wzero ) * ( 1.0_rp+wzero ) )
2723 umax = ugev * ugew * ( 1.0_rp+uzero )
2724 vmax = (1.0_rp-ugev) * vgew
2725 wmax = 1.0_rp - ugev * ugew - vmax
2727 fact(0, 0, 0) = - ugev * ugew * uzero
2729 fact(1, 0, 0) = wmax * (1.0_rp-uw) * (1.0_rp-vw)
2730 fact(0, 1, 0) = umax * (1.0_rp-vu) * (1.0_rp-wu)
2731 fact(0, 0, 1) = vmax * (1.0_rp-uv) * (1.0_rp-wv)
2733 fact(1, 1, 1) = sign_uv * sign_uw * ( umax * vu*wu + vmax * uv*wv + wmax * uw*vw )
2734 fact(1,-1, 1) = (1.0_rp-sign_uv) * (1.0_rp-sign_uw) * ( umax * vu*wu + vmax * uv*wv + wmax * uw*vw )
2735 fact(1, 1,-1) = (1.0_rp-sign_uv) * sign_uw * ( umax * vu*wu + vmax * uv*wv + wmax * uw*vw )
2736 fact(1,-1,-1) = sign_uv * (1.0_rp-sign_uw) * ( umax * vu*wu + vmax * uv*wv + wmax * uw*vw )
2738 fact(1, 1, 0) = sign_uw * (1.0_rp-vmax) * ( ugew * wu * (1.0_rp-vu) + (1.0_rp-ugew) * uw * (1.0_rp-vw) )
2739 fact(1,-1, 0) = (1.0_rp-sign_uw) * (1.0_rp-vmax) * ( ugew * wu * (1.0_rp-vu) + (1.0_rp-ugew) * uw * (1.0_rp-vw) )
2740 fact(1, 0, 1) = sign_vw * (1.0_rp-umax) * ( vgew * wv * (1.0_rp-uv) + (1.0_rp-vgew) * vw * (1.0_rp-uw) )
2741 fact(1, 0,-1) = (1.0_rp-sign_vw) * (1.0_rp-umax) * ( vgew * wv * (1.0_rp-uv) + (1.0_rp-vgew) * vw * (1.0_rp-uw) )
2742 fact(0, 1, 1) = sign_uv * (1.0_rp-wmax) * ( ugev * vu * (1.0_rp-wu) + (1.0_rp-ugev) * uv * (1.0_rp-wv) )
2743 fact(0, 1,-1) = (1.0_rp-sign_uv) * (1.0_rp-wmax) * ( ugev * vu * (1.0_rp-wu) + (1.0_rp-ugev) * uv * (1.0_rp-wv) )
2746 end subroutine get_fact_fct
integer, parameter, public i_rhot
integer, public is
start point of inner domain: x, local
integer, public je
end point of inner domain: y, local
subroutine, public prc_mpistop
Abort MPI.
subroutine, public atmos_dyn_numfilter_coef_q(num_diff_q, DENS, QTRC, CDZ, CDX, CDY, dt, REF_qv, iq, ND_COEF, ND_ORDER, ND_SFC_FACT, ND_USE_RS)
Calc coefficient of numerical filter.
subroutine, public comm_vars8_init(varname, var, vid)
Register variables.
subroutine, public atmos_dyn_numfilter_coef(num_diff, DENS, MOMZ, MOMX, MOMY, RHOT, CDZ, CDX, CDY, FDZ, FDX, FDY, DT, REF_dens, REF_pott, ND_COEF, ND_ORDER, ND_SFC_FACT, ND_USE_RS)
Calc coefficient of numerical filter.
integer, public iblock
block size for cache blocking: x
integer, parameter, public i_momx
logical, public io_l
output log or not? (this process)
integer, parameter, public zdir
integer, parameter, public i_momz
integer, parameter, public ydir
integer, public ke
end point of inner domain: z, local
integer, parameter, public xdir
subroutine, public atmos_dyn_filter_tend(phi_t, phi, rdz, rdx, rdy, KO, IO, JO)
subroutine, public check(current_line, v)
Undefined value checker.
integer, parameter, public i_dens
integer, parameter, public i_momy
subroutine, public atmos_dyn_wdamp_setup(wdamp_coef, wdamp_tau, wdamp_height, FZ)
Setup.
real(rp), public const_undef
integer, public ia
of whole cells: x, local, with HALO
integer, public ka
of whole cells: z, local, with HALO
subroutine calc_diff3(diff, phi, KO, IO, JO)
integer, public jblock
block size for cache blocking: y
subroutine, public atmos_dyn_filter_setup(num_diff, num_diff_q, CDZ, CDX, CDY, FDZ, FDX, FDY)
Setup.
integer, public jhalo
of halo cells: y
integer, public js
start point of inner domain: y, local
integer, parameter, public const_undef2
undefined value (INT2)
module Atmosphere / Dynamics common
integer, public ks
start point of inner domain: z, local
integer, parameter, public khalo
of halo cells: z
subroutine calc_numdiff(work, iwork, data, nd_order, KO, IO, JO, KEE)
subroutine, public prof_rapstart(rapname_base, level)
Start raptime.
subroutine, public atmos_dyn_copy_boundary(DENS, MOMZ, MOMX, MOMY, RHOT, PROG, DENS0, MOMZ0, MOMX0, MOMY0, RHOT0, PROG0, BND_W, BND_E, BND_S, BND_N)
integer, public ie
end point of inner domain: x, local
real(rp), public const_eps
small number
subroutine, public atmos_dyn_fct(qflx_anti, phi_in, DENS0, DENS, qflx_hi, qflx_lo, mflx_hi, rdz, rdx, rdy, GSQRT, MAPF, dt, flag_vect)
Flux Correction Transport Limiter.
subroutine, public atmos_dyn_divergence(DDIV, MOMZ, MOMX, MOMY, GSQRT, J13G, J23G, J33G, MAPF, RCDZ, RCDX, RCDY, RFDZ, FDZ)
real(rp), public const_pi
pi
integer, public io_fid_log
Log file ID.
subroutine, public prof_rapend(rapname_base, level)
Save raptime.
subroutine, public atmos_dyn_copy_boundary_tracer(QTRC, QTRC0, BND_W, BND_E, BND_S, BND_N)
integer, public ihalo
of halo cells: x
integer, public ja
of whole cells: y, local, with HALO