14 #include "inc_openmp.h" 57 private :: get_fact_fct
64 real(RP),
allocatable :: cnz3(:,:,:)
65 real(RP),
allocatable :: cnx3(:,:,:)
66 real(RP),
allocatable :: cny3(:,:,:)
67 real(RP),
allocatable :: cnz4(:,:,:)
68 real(RP),
allocatable :: cnx4(:,:,:)
69 real(RP),
allocatable :: cny4(:,:,:)
71 integer :: i_comm_dens_z = 1
72 integer :: i_comm_dens_x = 2
73 integer :: i_comm_dens_y = 3
74 integer :: i_comm_momz_z = 4
75 integer :: i_comm_momz_x = 5
76 integer :: i_comm_momz_y = 6
77 integer :: i_comm_momx_z = 7
78 integer :: i_comm_momx_x = 8
79 integer :: i_comm_momx_y = 9
80 integer :: i_comm_momy_z = 10
81 integer :: i_comm_momy_x = 11
82 integer :: i_comm_momy_y = 12
83 integer :: i_comm_rhot_z = 13
84 integer :: i_comm_rhot_x = 14
85 integer :: i_comm_rhot_y = 15
86 integer :: i_comm_qtrc_z = 1
87 integer :: i_comm_qtrc_x = 2
88 integer :: i_comm_qtrc_y = 3
94 num_diff, num_diff_q, &
95 CDZ, CDX, CDY, FDZ, FDX, FDY )
101 real(RP),
intent(inout) :: num_diff(
ka,
ia,
ja,5,3)
102 real(RP),
intent(inout) :: num_diff_q(
ka,
ia,
ja,3)
103 real(RP),
intent(in) :: CDZ(
ka)
104 real(RP),
intent(in) :: CDX(
ia)
105 real(RP),
intent(in) :: CDY(
ja)
106 real(RP),
intent(in) :: FDZ(
ka-1)
107 real(RP),
intent(in) :: FDX(
ia-1)
108 real(RP),
intent(in) :: FDY(
ja-1)
114 write(*,*)
'xxx number of HALO must be at least 2 for numrical filter' 119 allocate( cnz3(3,
ka,2) )
120 allocate( cnx3(3,
ia,2) )
121 allocate( cny3(3,
ja,2) )
122 allocate( cnz4(5,
ka,2) )
123 allocate( cnx4(5,
ia,2) )
124 allocate( cny4(5,
ja,2) )
158 cnz3(1,k,1) = 1.0_rp / ( fdz(k ) * cdz(k ) * fdz(k-1) )
159 cnz3(2,k,1) = 1.0_rp / ( fdz(k ) * cdz(k ) * fdz(k-1) ) &
160 + 1.0_rp / ( fdz(k-1) * cdz(k ) * fdz(k-1) ) &
161 + 1.0_rp / ( fdz(k-1) * cdz(k-1) * fdz(k-1) )
164 cnz3(3,k,1) = 1.0_rp / ( fdz(k-1) * cdz(k ) * fdz(k-1) ) &
165 + 1.0_rp / ( fdz(k-1) * cdz(k-1) * fdz(k-1) ) &
166 + 1.0_rp / ( fdz(k-1) * cdz(k-1) * fdz(k-2) )
168 cnz3(1,
ks-1,1) = 1.0_rp / ( fdz(
ks ) * cdz(
ks+1) * fdz(
ks ) )
169 cnz3(1,
ks ,1) = 1.0_rp / ( fdz(
ks ) * cdz(
ks ) * fdz(
ks ) )
170 cnz3(2,
ks ,1) = 1.0_rp / ( fdz(
ks ) * cdz(
ks ) * fdz(
ks ) ) &
171 + 1.0_rp / ( fdz(
ks ) * cdz(
ks ) * fdz(
ks ) ) &
172 + 1.0_rp / ( fdz(
ks ) * cdz(
ks+1) * fdz(
ks ) )
173 cnz3(3,
ks ,1) = 1.0_rp / ( fdz(
ks ) * cdz(
ks ) * fdz(
ks ) ) &
174 + 1.0_rp / ( fdz(
ks ) * cdz(
ks+1) * fdz(
ks ) ) &
175 + 1.0_rp / ( fdz(
ks ) * cdz(
ks+1) * fdz(
ks+1) )
176 cnz3(3,
ks+1,1) = 1.0_rp / ( fdz(
ks ) * cdz(
ks+1) * fdz(
ks ) ) &
177 + 1.0_rp / ( fdz(
ks ) * cdz(
ks ) * fdz(
ks ) ) &
178 + 1.0_rp / ( fdz(
ks ) * cdz(
ks ) * fdz(
ks ) )
179 cnz3(1,
ke ,1) = 1.0_rp / ( fdz(
ke-1) * cdz(
ke ) * fdz(
ke-1) )
180 cnz3(2,
ke ,1) = 1.0_rp / ( fdz(
ke-1) * cdz(
ke ) * fdz(
ke-1) ) &
181 + 1.0_rp / ( fdz(
ke-1) * cdz(
ke ) * fdz(
ke-1) ) &
182 + 1.0_rp / ( fdz(
ke-1) * cdz(
ke-1) * fdz(
ke-1) )
183 cnz3(1,
ke+1,1) = 1.0_rp / ( fdz(
ke-2) * cdz(
ke-1) * fdz(
ke-1) )
184 cnz3(2,
ke+1,1) = 1.0_rp / ( fdz(
ke-2) * cdz(
ke-1) * fdz(
ke-1) ) &
185 + 1.0_rp / ( fdz(
ke-1) * cdz(
ke-1) * fdz(
ke-1) ) &
186 + 1.0_rp / ( fdz(
ke-1) * cdz(
ke ) * fdz(
ke-1) )
187 cnz3(3,
ke+1,1) = 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 + 1.0_rp / ( fdz(
ke-1) * cdz(
ke ) * fdz(
ke-1) )
192 cnz4(1,k,1) = ( cnz3(1,k+1,1) ) / cdz(k)
193 cnz4(2,k,1) = ( cnz3(2,k+1,1) + cnz3(1,k,1) ) / cdz(k)
194 cnz4(3,k,1) = ( cnz3(3,k+1,1) + cnz3(2,k,1) ) / cdz(k)
195 cnz4(4,k,1) = ( cnz3(1,k ,1) + cnz3(3,k,1) ) / cdz(k)
196 cnz4(5,k,1) = ( cnz3(1,k-1,1) ) / cdz(k)
200 cnz3(1,k,2) = 1.0_rp / ( cdz(k+1) * fdz(k ) * cdz(k ) )
201 cnz3(2,k,2) = 1.0_rp / ( cdz(k+1) * fdz(k ) * cdz(k ) ) &
202 + 1.0_rp / ( cdz(k ) * fdz(k ) * cdz(k ) ) &
203 + 1.0_rp / ( cdz(k ) * fdz(k-1) * cdz(k ) )
204 cnz3(3,k,2) = 1.0_rp / ( cdz(k ) * fdz(k ) * cdz(k ) ) &
205 + 1.0_rp / ( cdz(k ) * fdz(k-1) * cdz(k ) ) &
206 + 1.0_rp / ( cdz(k ) * fdz(k-1) * cdz(k-1) )
208 cnz3(1,
ks-1,2) = 1.0_rp / ( cdz(
ks ) * fdz(
ks ) * cdz(
ks ) )
209 cnz3(1,
ks ,2) = 1.0_rp / ( cdz(
ks+1) * fdz(
ks ) * cdz(
ks ) )
210 cnz3(2,
ks ,2) = 1.0_rp / ( cdz(
ks+1) * fdz(
ks ) * cdz(
ks ) ) &
211 + 1.0_rp / ( cdz(
ks ) * fdz(
ks ) * cdz(
ks ) ) &
212 + 1.0_rp / ( cdz(
ks ) * fdz(
ks ) * cdz(
ks ) )
213 cnz3(3,
ks ,2) = 1.0_rp / ( cdz(
ks ) * fdz(
ks ) * cdz(
ks ) ) &
214 + 1.0_rp / ( cdz(
ks ) * fdz(
ks ) * cdz(
ks ) ) &
215 + 1.0_rp / ( cdz(
ks ) * fdz(
ks ) * cdz(
ks+1) )
216 cnz3(1,
ke ,2) = 1.0_rp / ( cdz(
ke-1) * fdz(
ke-1) * cdz(
ke ) )
217 cnz3(2,
ke ,2) = 1.0_rp / ( cdz(
ke-1) * fdz(
ke-1) * cdz(
ke ) ) &
218 + 1.0_rp / ( cdz(
ke ) * fdz(
ke-1) * cdz(
ke ) ) &
219 + 1.0_rp / ( cdz(
ke ) * fdz(
ke-1) * cdz(
ke ) )
220 cnz3(3,
ke ,2) = 1.0_rp / ( cdz(
ke ) * fdz(
ke-1) * cdz(
ke ) ) &
221 + 1.0_rp / ( cdz(
ke ) * fdz(
ke-1) * cdz(
ke ) ) &
222 + 1.0_rp / ( cdz(
ke ) * fdz(
ke-1) * cdz(
ke-1) )
223 cnz3(1,
ke+1,2) = 1.0_rp / ( cdz(
ke-2) * fdz(
ke-2) * cdz(
ke-1) )
224 cnz3(2,
ke+1,2) = 1.0_rp / ( cdz(
ke-2) * fdz(
ke-2) * cdz(
ke-1) ) &
225 + 1.0_rp / ( cdz(
ke-1) * fdz(
ke-2) * cdz(
ke-1) ) &
226 + 1.0_rp / ( cdz(
ke-1) * fdz(
ke-1) * cdz(
ke-1) )
227 cnz3(3,
ke+1,2) = 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 + 1.0_rp / ( cdz(
ke-1) * fdz(
ke-1) * cdz(
ke ) )
232 cnz4(1,k,2) = ( cnz3(1,k+1,2) ) / fdz(k)
233 cnz4(2,k,2) = ( cnz3(2,k+1,2) + cnz3(1,k,2) ) / fdz(k)
234 cnz4(3,k,2) = ( cnz3(3,k+1,2) + cnz3(2,k,2) ) / fdz(k)
235 cnz4(4,k,2) = ( cnz3(1,k ,2) + cnz3(3,k,2) ) / fdz(k)
236 cnz4(5,k,2) = ( cnz3(1,k-1,2) ) / fdz(k)
239 cnz4(2,
ke,2) = ( cnz3(2,
ke+1,2) + cnz3(1,
ke,2) ) / fdz(
ke-1)
240 cnz4(3,
ke,2) = ( cnz3(3,
ke+1,2) + cnz3(2,
ke,2) ) / fdz(
ke-1)
241 cnz4(4,
ke,2) = ( cnz3(1,
ke ,2) + cnz3(3,
ke,2) ) / fdz(
ke-1)
244 cnx3(1,
is-1,1) = 1.0_rp / ( fdx(
is-1) * cdx(
is-1) * fdx(
is-2) )
246 cnx3(1,i,1) = 1.0_rp / ( fdx(i ) * cdx(i ) * fdx(i-1) )
247 cnx3(2,i,1) = 1.0_rp / ( fdx(i ) * cdx(i ) * fdx(i-1) ) &
248 + 1.0_rp / ( fdx(i-1) * cdx(i ) * fdx(i-1) ) &
249 + 1.0_rp / ( fdx(i-1) * cdx(i-1) * fdx(i-1) )
250 cnx3(3,i,1) = 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 + 1.0_rp / ( fdx(i-1) * cdx(i-1) * fdx(i-2) )
256 cnx4(1,i,1) = ( cnx3(1,i+1,1) ) / cdx(i)
257 cnx4(2,i,1) = ( cnx3(2,i+1,1) + cnx3(1,i,1) ) / cdx(i)
258 cnx4(3,i,1) = ( cnx3(3,i+1,1) + cnx3(2,i,1) ) / cdx(i)
259 cnx4(4,i,1) = ( cnx3(1,i ,1) + cnx3(3,i,1) ) / cdx(i)
260 cnx4(5,i,1) = ( cnx3(1,i-1,1) ) / cdx(i)
264 cnx3(1,i,2) = 1.0_rp / ( cdx(i+1) * fdx(i ) * cdx(i ) )
265 cnx3(2,i,2) = 1.0_rp / ( cdx(i+1) * fdx(i ) * cdx(i ) ) &
266 + 1.0_rp / ( cdx(i ) * fdx(i ) * cdx(i ) ) &
267 + 1.0_rp / ( cdx(i ) * fdx(i-1) * cdx(i ) )
268 cnx3(3,i,2) = 1.0_rp / ( cdx(i ) * fdx(i ) * cdx(i ) ) &
269 + 1.0_rp / ( cdx(i ) * fdx(i-1) * cdx(i ) ) &
270 + 1.0_rp / ( cdx(i ) * fdx(i-1) * cdx(i-1) )
274 cnx4(1,i,2) = ( cnx3(1,i+1,2) ) / fdx(i)
275 cnx4(2,i,2) = ( cnx3(2,i+1,2) + cnx3(1,i,2) ) / fdx(i)
276 cnx4(3,i,2) = ( cnx3(3,i+1,2) + cnx3(2,i,2) ) / fdx(i)
277 cnx4(4,i,2) = ( cnx3(1,i ,2) + cnx3(3,i,2) ) / fdx(i)
278 cnx4(5,i,2) = ( cnx3(1,i-1,2) ) / fdx(i)
282 cny3(1,
js-1,1) = 1.0_rp / ( fdy(
js-1) * cdy(
js-1) * fdy(
js-2) )
284 cny3(1,j,1) = 1.0_rp / ( fdy(j ) * cdy(j ) * fdy(j-1) )
285 cny3(2,j,1) = 1.0_rp / ( fdy(j ) * cdy(j ) * fdy(j-1) ) &
286 + 1.0_rp / ( fdy(j-1) * cdy(j ) * fdy(j-1) ) &
287 + 1.0_rp / ( fdy(j-1) * cdy(j-1) * fdy(j-1) )
288 cny3(3,j,1) = 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 + 1.0_rp / ( fdy(j-1) * cdy(j-1) * fdy(j-2) )
294 cny4(1,j,1) = ( cny3(1,j+1,1) ) / cdy(j)
295 cny4(2,j,1) = ( cny3(2,j+1,1) + cny3(1,j,1) ) / cdy(j)
296 cny4(3,j,1) = ( cny3(3,j+1,1) + cny3(2,j,1) ) / cdy(j)
297 cny4(4,j,1) = ( cny3(1,j ,1) + cny3(3,j,1) ) / cdy(j)
298 cny4(5,j,1) = ( cny3(1,j-1,1) ) / cdy(j)
302 cny3(1,j,2) = 1.0_rp / ( cdy(j+1) * fdy(j ) * cdy(j ) )
303 cny3(2,j,2) = 1.0_rp / ( cdy(j+1) * fdy(j ) * cdy(j ) ) &
304 + 1.0_rp / ( cdy(j ) * fdy(j ) * cdy(j ) ) &
305 + 1.0_rp / ( cdy(j ) * fdy(j-1) * cdy(j ) )
306 cny3(3,j,2) = 1.0_rp / ( cdy(j ) * fdy(j ) * cdy(j ) ) &
307 + 1.0_rp / ( cdy(j ) * fdy(j-1) * cdy(j ) ) &
308 + 1.0_rp / ( cdy(j ) * fdy(j-1) * cdy(j-1) )
312 cny4(1,j,2) = ( cny3(1,j+1,2) ) / fdy(j)
313 cny4(2,j,2) = ( cny3(2,j+1,2) + cny3(1,j,2) ) / fdy(j)
314 cny4(3,j,2) = ( cny3(3,j+1,2) + cny3(2,j,2) ) / fdy(j)
315 cny4(4,j,2) = ( cny3(1,j ,2) + cny3(3,j,2) ) / fdy(j)
316 cny4(5,j,2) = ( cny3(1,j-1,2) ) / fdy(j)
326 DENS, MOMZ, MOMX, MOMY, RHOT, &
327 CDZ, CDX, CDY, FDZ, FDX, FDY, DT, &
328 REF_dens, REF_pott, &
329 ND_COEF, ND_ORDER, ND_SFC_FACT, ND_USE_RS )
335 real(RP),
intent(out) :: num_diff(
ka,
ia,
ja,5,3)
337 real(RP),
intent(in) :: DENS(
ka,
ia,
ja)
338 real(RP),
intent(in) :: MOMZ(
ka,
ia,
ja)
339 real(RP),
intent(in) :: MOMX(
ka,
ia,
ja)
340 real(RP),
intent(in) :: MOMY(
ka,
ia,
ja)
341 real(RP),
intent(in) :: RHOT(
ka,
ia,
ja)
343 real(RP),
intent(in) :: CDZ(
ka)
344 real(RP),
intent(in) :: CDX(
ia)
345 real(RP),
intent(in) :: CDY(
ja)
346 real(RP),
intent(in) :: FDZ(
ka-1)
347 real(RP),
intent(in) :: FDX(
ia-1)
348 real(RP),
intent(in) :: FDY(
ja-1)
350 real(RP),
intent(in) :: DT
352 real(RP),
intent(in) :: REF_dens(
ka,
ia,
ja)
353 real(RP),
intent(in) :: REF_pott(
ka,
ia,
ja)
355 real(RP),
intent(in) :: ND_COEF
356 integer,
intent(in) :: ND_ORDER
357 real(RP),
intent(in) :: ND_SFC_FACT
358 logical,
intent(in) :: ND_USE_RS
361 real(RP) :: VELZ (
ka,
ia,
ja)
362 real(RP) :: VELX (
ka,
ia,
ja)
363 real(RP) :: VELY (
ka,
ia,
ja)
364 real(RP) :: POTT (
ka,
ia,
ja)
366 real(RP) :: dens_diff(
ka,
ia,
ja)
367 real(RP) :: pott_diff(
ka,
ia,
ja)
369 real(RP) :: work(
ka,
ia,
ja,3,2)
374 real(RP) :: nd_coef_cdz(
ka)
375 real(RP) :: nd_coef_cdx(
ia)
376 real(RP) :: nd_coef_cdy(
ja)
377 real(RP) :: nd_coef_fdz(
ka-1)
378 real(RP) :: nd_coef_fdx(
ia-1)
379 real(RP) :: nd_coef_fdy(
ja-1)
385 nd_order4 = nd_order * 4
386 diff4 = nd_coef / ( 2**(nd_order4) * dt )
388 nd_coef_cdz(k) = diff4 * cdz(k)**nd_order4
391 nd_coef_fdz(k) = diff4 * fdz(k)**nd_order4
394 nd_coef_cdx(i) = diff4 * cdx(i)**nd_order4
395 nd_coef_fdx(i) = diff4 * fdx(i)**nd_order4
398 nd_coef_cdy(j) = diff4 * cdy(j)**nd_order4
399 nd_coef_fdy(j) = diff4 * fdy(j)**nd_order4
407 if ( .NOT. nd_use_rs )
then 414 pott(k,i,j) = rhot(k,i,j) / dens(k,i,j)
423 dens_diff(k,i,j) = ( ( dens(k,i,j) ) * 3.0_rp &
424 + ( dens(k,i+1,j)+dens(k,i-1,j)+dens(k,i,j+1)+dens(k,i,j-1) ) * 2.0_rp &
425 + ( dens(k,i+2,j)+dens(k,i-2,j)+dens(k,i,j+2)+dens(k,i,j-2) ) &
426 + ( dens(k+1,i,j)+dens(k-1,i,j) ) * 2.0_rp &
429 pott_diff(k,i,j) = ( ( pott(k,i,j) ) * 3.0_rp &
430 + ( pott(k,i+1,j)+pott(k,i-1,j)+pott(k,i,j+1)+pott(k,i,j-1) ) * 2.0_rp &
431 + ( pott(k,i+2,j)+pott(k,i-2,j)+pott(k,i,j+2)+pott(k,i,j-2) ) &
432 + ( pott(k+1,i,j)+pott(k-1,i,j) ) * 2.0_rp &
440 dens_diff(
ks,i,j) = ( ( dens(
ks,i,j) ) * 3.0_rp &
441 + ( dens(
ks,i+1,j)+dens(
ks,i-1,j)+dens(
ks,i,j+1)+dens(
ks,i,j-1) ) * 2.0_rp &
442 + ( dens(
ks,i+2,j)+dens(
ks,i-2,j)+dens(
ks,i,j+2)+dens(
ks,i,j-2) ) &
443 + ( dens(
ks+1,i,j) ) * 2.0_rp &
445 dens_diff(
ke,i,j) = ( ( dens(
ke,i,j) ) * 3.0_rp &
446 + ( dens(
ke,i+1,j)+dens(
ke,i-1,j)+dens(
ke,i,j+1)+dens(
ke,i,j-1) ) * 2.0_rp &
447 + ( dens(
ke,i+2,j)+dens(
ke,i-2,j)+dens(
ke,i,j+2)+dens(
ke,i,j-2) ) &
448 + ( dens(
ke-1,i,j) ) * 2.0_rp &
451 pott_diff(
ks,i,j) = ( ( pott(
ks,i,j) ) * 3.0_rp &
452 + ( pott(
ks,i+1,j)+pott(
ks,i-1,j)+pott(
ks,i,j+1)+pott(
ks,i,j-1) ) * 2.0_rp &
453 + ( pott(
ks,i+2,j)+pott(
ks,i-2,j)+pott(
ks,i,j+2)+pott(
ks,i,j-2) ) &
454 + ( pott(
ks+1,i,j) ) * 2.0_rp &
456 pott_diff(
ke,i,j) = ( ( pott(
ke,i,j) ) * 3.0_rp &
457 + ( pott(
ke,i+1,j)+pott(
ke,i-1,j)+pott(
ke,i,j+1)+pott(
ke,i,j-1) ) * 2.0_rp &
458 + ( pott(
ke,i+2,j)+pott(
ke,i-2,j)+pott(
ke,i,j+2)+pott(
ke,i,j-2) ) &
459 + ( pott(
ke-1,i,j) ) * 2.0_rp &
468 call comm_vars8( dens_diff, 1 )
469 call comm_vars8( pott_diff, 2 )
471 call comm_wait ( dens_diff, 1 )
472 call comm_wait ( pott_diff, 2 )
481 if ( nd_use_rs )
then 489 dens_diff(k,i,j) = dens(k,i,j) - ref_dens(k,i,j)
511 num_diff(k,i,j,
i_dens,
zdir) = work(k,i,j,
zdir,iwork) * nd_coef_cdz(k)
525 num_diff(k,i,j,
i_dens,
xdir) = work(k,i,j,
xdir,iwork) * nd_coef_cdx(i)
541 num_diff(k,i,j,
i_dens,
ydir) = work(k,i,j,
ydir,iwork) * nd_coef_cdy(j)
558 call comm_vars8( num_diff(:,:,:,
i_dens,
zdir), i_comm_dens_z )
559 call comm_vars8( num_diff(:,:,:,
i_dens,
xdir), i_comm_dens_x )
560 call comm_vars8( num_diff(:,:,:,
i_dens,
ydir), i_comm_dens_y )
573 velz(k,i,j) = 2.0_rp * momz(k,i,j) / ( dens(k+1,i,j)+dens(k,i,j) )
591 num_diff(k,i,j,
i_momz,
zdir) = work(k,i,j,
zdir,iwork) * nd_coef_fdz(k) &
606 num_diff(k,i,j,
i_momz,
xdir) = work(k,i,j,
xdir,iwork) * nd_coef_cdx(i) &
607 * 0.25_rp * ( dens(k+1,i+1,j)+dens(k+1,i,j)+dens(k,i+1,j)+dens(k,i,j) )
623 num_diff(k,i,j,
i_momz,
ydir) = work(k,i,j,
ydir,iwork) * nd_coef_cdy(j) &
624 * 0.25_rp * ( dens(k+1,i,j+1)+dens(k+1,i,j)+dens(k,i,j+1)+dens(k,i,j) )
642 call comm_vars8( num_diff(:,:,:,
i_momz,
zdir), i_comm_momz_z )
643 call comm_vars8( num_diff(:,:,:,
i_momz,
xdir), i_comm_momz_x )
644 call comm_vars8( num_diff(:,:,:,
i_momz,
ydir), i_comm_momz_y )
657 velx(k,i,j) = 2.0_rp * momx(k,i,j) / ( dens(k,i+1,j)+dens(k,i,j) )
676 num_diff(k,i,j,
i_momx,
zdir) = work(k,i,j,
zdir,iwork) * nd_coef_cdz(k) &
677 * 0.25_rp * ( dens(k+1,i+1,j)+dens(k+1,i,j)+dens(k,i+1,j)+dens(k,i,j) )
691 num_diff(k,i,j,
i_momx,
xdir) = work(k,i,j,
xdir,iwork) * nd_coef_fdx(i) &
709 num_diff(k,i,j,
i_momx,
ydir) = work(k,i,j,
ydir,iwork) * nd_coef_cdy(j) &
710 * 0.25_rp * ( dens(k,i+1,j+1)+dens(k,i+1,j)+dens(k,i,j+1)+dens(k,i,j) )
727 call comm_vars8( num_diff(:,:,:,
i_momx,
zdir), i_comm_momx_z )
728 call comm_vars8( num_diff(:,:,:,
i_momx,
xdir), i_comm_momx_x )
729 call comm_vars8( num_diff(:,:,:,
i_momx,
ydir), i_comm_momx_y )
742 vely(k,i,j) = 2.0_rp * momy(k,i,j) / ( dens(k,i,j+1)+dens(k,i,j) )
760 num_diff(k,i,j,
i_momy,
zdir) = work(k,i,j,
zdir,iwork) * nd_coef_cdz(k) &
761 * 0.25_rp * ( dens(k+1,i,j+1)+dens(k+1,i,j)+dens(k,i,j+1)+dens(k,i,j) )
775 num_diff(k,i,j,
i_momy,
xdir) = work(k,i,j,
xdir,iwork) * nd_coef_cdx(i) &
776 * 0.25_rp * ( dens(k,i+1,j+1)+dens(k,i,j+1)+dens(k,i+1,j)+dens(k,i,j) )
792 num_diff(k,i,j,
i_momy,
ydir) = work(k,i,j,
ydir,iwork) * nd_coef_fdy(j) &
810 call comm_vars8( num_diff(:,:,:,
i_momy,
zdir), i_comm_momy_z )
811 call comm_vars8( num_diff(:,:,:,
i_momy,
xdir), i_comm_momy_x )
812 call comm_vars8( num_diff(:,:,:,
i_momy,
ydir), i_comm_momy_y )
820 if ( nd_use_rs )
then 825 pott_diff(k,i,j) = rhot(k,i,j) / dens(k,i,j) - ref_pott(k,i,j)
844 num_diff(k,i,j,
i_rhot,
zdir) = work(k,i,j,
zdir,iwork) * nd_coef_cdz(k) &
845 * 0.5_rp * ( dens(k+1,i,j)+dens(k,i,j) )
863 num_diff(k,i,j,
i_rhot,
xdir) = work(k,i,j,
xdir,iwork) * nd_coef_cdx(i) &
864 * 0.5_rp * ( dens(k,i+1,j)+dens(k,i,j) )
880 num_diff(k,i,j,
i_rhot,
ydir) = work(k,i,j,
ydir,iwork) * nd_coef_cdy(j) &
881 * 0.5_rp * ( dens(k,i,j+1)+dens(k,i,j) )
898 call comm_vars8( num_diff(:,:,:,
i_rhot,
zdir), i_comm_rhot_z )
899 call comm_vars8( num_diff(:,:,:,
i_rhot,
xdir), i_comm_rhot_x )
900 call comm_vars8( num_diff(:,:,:,
i_rhot,
ydir), i_comm_rhot_y )
902 call comm_wait ( num_diff(:,:,:,
i_dens,
zdir), i_comm_dens_z )
903 call comm_wait ( num_diff(:,:,:,
i_dens,
xdir), i_comm_dens_x )
904 call comm_wait ( num_diff(:,:,:,
i_dens,
ydir), i_comm_dens_y )
905 call comm_wait ( num_diff(:,:,:,
i_momz,
zdir), i_comm_momz_z )
906 call comm_wait ( num_diff(:,:,:,
i_momz,
xdir), i_comm_momz_x )
907 call comm_wait ( num_diff(:,:,:,
i_momz,
ydir), i_comm_momz_y )
908 call comm_wait ( num_diff(:,:,:,
i_momx,
zdir), i_comm_momx_z )
909 call comm_wait ( num_diff(:,:,:,
i_momx,
xdir), i_comm_momx_x )
910 call comm_wait ( num_diff(:,:,:,
i_momx,
ydir), i_comm_momx_y )
911 call comm_wait ( num_diff(:,:,:,
i_momy,
zdir), i_comm_momy_z )
912 call comm_wait ( num_diff(:,:,:,
i_momy,
xdir), i_comm_momy_x )
913 call comm_wait ( num_diff(:,:,:,
i_momy,
ydir), i_comm_momy_y )
914 call comm_wait ( num_diff(:,:,:,
i_rhot,
zdir), i_comm_rhot_z )
915 call comm_wait ( num_diff(:,:,:,
i_rhot,
xdir), i_comm_rhot_x )
916 call comm_wait ( num_diff(:,:,:,
i_rhot,
ydir), i_comm_rhot_y )
930 ND_COEF, ND_ORDER, ND_SFC_FACT, ND_USE_RS )
936 real(RP),
intent(out) :: num_diff_q(
ka,
ia,
ja,3)
938 real(RP),
intent(in) :: DENS(
ka,
ia,
ja)
939 real(RP),
intent(in) :: QTRC(
ka,
ia,
ja)
941 real(RP),
intent(in) :: CDZ(
ka)
942 real(RP),
intent(in) :: CDX(
ia)
943 real(RP),
intent(in) :: CDY(
ja)
945 real(RP),
intent(in) :: dt
947 real(RP),
intent(in) :: REF_qv(
ka,
ia,
ja)
948 integer,
intent(in) :: iq
950 real(RP),
intent(in) :: ND_COEF
951 integer,
intent(in) :: ND_ORDER
952 real(RP),
intent(in) :: ND_SFC_FACT
953 logical,
intent(in) :: ND_USE_RS
955 real(RP) :: qv_diff(
ka,
ia,
ja)
957 real(RP) :: work(
ka,
ia,
ja,3,2)
962 real(RP) :: nd_coef_cdz(
ka)
963 real(RP) :: nd_coef_cdx(
ia)
964 real(RP) :: nd_coef_cdy(
ja)
973 nd_order4 = nd_order * 4
974 diff4 = nd_coef / ( 2**(nd_order4) * dt )
976 nd_coef_cdz(k) = diff4 * cdz(k)**nd_order4
979 nd_coef_cdx(i) = diff4 * cdx(i)**nd_order4
982 nd_coef_cdy(j) = diff4 * cdy(j)**nd_order4
985 if ( iq ==
i_qv .AND. (.NOT. nd_use_rs) )
then 993 qv_diff(k,i,j) = ( ( qtrc(k,i,j) ) * 3.0_rp &
994 + ( qtrc(k,i+1,j)+qtrc(k,i-1,j)+qtrc(k,i,j+1)+qtrc(k,i,j-1) ) * 2.0_rp &
995 + ( qtrc(k,i+2,j)+qtrc(k,i-2,j)+qtrc(k,i,j+2)+qtrc(k,i,j-2) ) &
996 + ( qtrc(k+1,i,j)+qtrc(k-1,i,j) ) * 2.0_rp &
1005 qv_diff(
ks,i,j) = ( ( qtrc(
ks,i,j) ) * 3.0_rp &
1006 + ( qtrc(
ks,i+1,j)+qtrc(
ks,i-1,j)+qtrc(
ks,i,j+1)+qtrc(
ks,i,j-1) ) * 2.0_rp &
1007 + ( qtrc(
ks,i+2,j)+qtrc(
ks,i-2,j)+qtrc(
ks,i,j+2)+qtrc(
ks,i,j-2) ) &
1008 + ( qtrc(
ks+1,i,j) ) * 2.0_rp &
1010 qv_diff(
ke,i,j) = ( ( qtrc(
ke,i,j) ) * 3.0_rp &
1011 + ( qtrc(
ke,i+1,j)+qtrc(
ke,i-1,j)+qtrc(
ke,i,j+1)+qtrc(
ke,i,j-1) ) * 2.0_rp &
1012 + ( qtrc(
ke,i+2,j)+qtrc(
ke,i-2,j)+qtrc(
ke,i,j+2)+qtrc(
ke,i,j-2) ) &
1013 + ( qtrc(
ke-1,i,j) ) * 2.0_rp &
1022 call comm_vars8(qv_diff, 1)
1023 call comm_wait (qv_diff, 1)
1029 if ( iq ==
i_qv )
then 1031 if ( nd_use_rs )
then 1039 qv_diff(k,i,j) = qtrc(k,i,j) - ref_qv(k,i,j)
1070 num_diff_q(k,i,j,
zdir) = work(k,i,j,
zdir,iwork) * nd_coef_cdz(k) &
1071 * 0.5_rp * ( dens(k+1,i,j)+dens(k,i,j) )
1077 num_diff_q(1:
ks-2,i,j,
zdir) = 0.0_rp
1078 num_diff_q(
ks-1,i,j,
zdir) = work(
ks-1,i,j,
zdir,iwork) * nd_coef_cdz(
ks-1) &
1080 num_diff_q(
ke ,i,j,
zdir) = work(
ke ,i,j,
zdir,iwork) * nd_coef_cdz(
ke ) &
1082 num_diff_q(
ke+1:
ka,i,j,
zdir) = 0.0_rp
1089 num_diff_q(k,i,j,
xdir) = work(k,i,j,
xdir,iwork) * nd_coef_cdx(i) &
1090 * 0.5_rp * ( dens(k,i+1,j)+dens(k,i,j) )
1096 num_diff_q(1:
ks-1,i,j,
xdir) = 0.0_rp
1097 num_diff_q(
ks ,i,j,
xdir) = num_diff_q(
ks ,i,j,
xdir) * nd_sfc_fact
1098 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
1099 num_diff_q(
ke+1:
ka,i,j,
xdir) = 0.0_rp
1106 num_diff_q(k,i,j,
ydir) = work(k,i,j,
ydir,iwork) * nd_coef_cdy(j) &
1107 * 0.5_rp * ( dens(k,i,j+1)+dens(k,i,j) )
1113 num_diff_q(1:
ks-1,i,j,
ydir) = 0.0_rp
1114 num_diff_q(
ks ,i,j,
ydir) = num_diff_q(
ks ,i,j,
ydir) * nd_sfc_fact
1115 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
1116 num_diff_q(
ke+1:
ka,i,j,
ydir) = 0.0_rp
1124 call comm_vars8( num_diff_q(:,:,:,
zdir), i_comm_qtrc_z )
1125 call comm_vars8( num_diff_q(:,:,:,
xdir), i_comm_qtrc_x )
1126 call comm_vars8( num_diff_q(:,:,:,
ydir), i_comm_qtrc_y )
1128 call comm_wait ( num_diff_q(:,:,:,
zdir), i_comm_qtrc_z )
1129 call comm_wait ( num_diff_q(:,:,:,
xdir), i_comm_qtrc_x )
1130 call comm_wait ( num_diff_q(:,:,:,
ydir), i_comm_qtrc_y )
1147 real(RP),
intent(out) :: phi_t(
ka,
ia,
ja)
1148 real(RP),
intent(in ) :: phi (
ka,
ia,
ja)
1149 real(RP),
intent(in ) :: rdz(:)
1150 real(RP),
intent(in ) :: rdx(:)
1151 real(RP),
intent(in ) :: rdy(:)
1152 integer ,
intent(in ) :: KO
1153 integer ,
intent(in ) :: IO
1154 integer ,
intent(in ) :: JO
1156 real(RP) :: flux(
ka,
ia,
ja,3)
1164 call comm_vars8( flux(:,:,:,
xdir), 1 )
1165 call comm_vars8( flux(:,:,:,
ydir), 2 )
1166 call comm_wait ( flux(:,:,:,
xdir), 1 )
1167 call comm_wait ( flux(:,:,:,
ydir), 2 )
1172 phi_t(k,i,j) = ( flux(k+ko,i,j,
zdir) - flux(k-1+ko,i,j,
zdir) ) * rdz(k) &
1173 + ( flux(k,i+io,j,
xdir) - flux(k,i-1+io,j,
xdir) ) * rdx(i) &
1174 + ( flux(k,i,j+jo,
ydir) - flux(k,i,j-1+jo,
ydir) ) * rdy(j)
1184 DENS, MOMZ, MOMX, MOMY, RHOT, PROG, &
1185 DENS0, MOMZ0, MOMX0, MOMY0, RHOT0, PROG0, &
1186 BND_W, BND_E, BND_S, BND_N )
1188 real(RP),
intent(inout) :: DENS (
ka,
ia,
ja)
1189 real(RP),
intent(inout) :: MOMZ (
ka,
ia,
ja)
1190 real(RP),
intent(inout) :: MOMX (
ka,
ia,
ja)
1191 real(RP),
intent(inout) :: MOMY (
ka,
ia,
ja)
1192 real(RP),
intent(inout) :: RHOT (
ka,
ia,
ja)
1193 real(RP),
intent(inout) :: PROG (
ka,
ia,
ja,
va)
1194 real(RP),
intent(in) :: DENS0(
ka,
ia,
ja)
1195 real(RP),
intent(in) :: MOMZ0(
ka,
ia,
ja)
1196 real(RP),
intent(in) :: MOMX0(
ka,
ia,
ja)
1197 real(RP),
intent(in) :: MOMY0(
ka,
ia,
ja)
1198 real(RP),
intent(in) :: RHOT0(
ka,
ia,
ja)
1199 real(RP),
intent(in) :: PROG0(
ka,
ia,
ja,
va)
1200 logical,
intent(in) :: BND_W
1201 logical,
intent(in) :: BND_E
1202 logical,
intent(in) :: BND_S
1203 logical,
intent(in) :: BND_N
1205 integer :: k, i, j, iv
1213 dens(k,i,j) = dens0(k,i,j)
1214 momz(k,i,j) = momz0(k,i,j)
1215 momx(k,i,j) = momx0(k,i,j)
1216 momy(k,i,j) = momy0(k,i,j)
1217 rhot(k,i,j) = rhot0(k,i,j)
1219 prog(k,i,j,iv) = prog0(k,i,j,iv)
1231 dens(k,i,j) = dens0(k,i,j)
1232 momz(k,i,j) = momz0(k,i,j)
1233 momx(k,i,j) = momx0(k,i,j)
1234 momy(k,i,j) = momy0(k,i,j)
1235 rhot(k,i,j) = rhot0(k,i,j)
1237 prog(k,i,j,iv) = prog0(k,i,j,iv)
1246 momx(k,
ie,j) = momx0(k,
ie,j)
1256 dens(k,i,j) = dens0(k,i,j)
1257 momz(k,i,j) = momz0(k,i,j)
1258 momx(k,i,j) = momx0(k,i,j)
1259 momy(k,i,j) = momy0(k,i,j)
1260 rhot(k,i,j) = rhot0(k,i,j)
1262 prog(k,i,j,iv) = prog0(k,i,j,iv)
1274 dens(k,i,j) = dens0(k,i,j)
1275 momz(k,i,j) = momz0(k,i,j)
1276 momx(k,i,j) = momx0(k,i,j)
1277 momy(k,i,j) = momy0(k,i,j)
1278 rhot(k,i,j) = rhot0(k,i,j)
1280 prog(k,i,j,iv) = prog0(k,i,j,iv)
1289 momy(k,i,
je) = momy0(k,i,
je)
1301 GSQRT, J13G, J23G, J33G, MAPF, &
1302 RCDZ, RCDX, RCDY, RFDZ, FDZ )
1312 real(RP),
intent(out) :: DDIV(
ka,
ia,
ja)
1313 real(RP),
intent(in) :: MOMZ(
ka,
ia,
ja)
1314 real(RP),
intent(in) :: MOMX(
ka,
ia,
ja)
1315 real(RP),
intent(in) :: MOMY(
ka,
ia,
ja)
1316 real(RP),
intent(in) :: GSQRT(
ka,
ia,
ja,7)
1317 real(RP),
intent(in) :: J13G(
ka,
ia,
ja,7)
1318 real(RP),
intent(in) :: J23G(
ka,
ia,
ja,7)
1319 real(RP),
intent(in) :: J33G
1320 real(RP),
intent(in) :: MAPF(
ia,
ja,2,7)
1321 real(RP),
intent(in) :: RCDZ(
ka)
1322 real(RP),
intent(in) :: RCDX(
ia)
1323 real(RP),
intent(in) :: RCDY(
ja)
1324 real(RP),
intent(in) :: RFDZ(
ka-1)
1325 real(RP),
intent(in) :: FDZ(
ka-1)
1337 ddiv(k,i,j) = j33g * ( momz(k,i,j) - momz(k-1,i ,j ) ) * rcdz(k) &
1338 + ( ( momx(k+1,i,j) + momx(k+1,i-1,j ) ) * j13g(k+1,i,j,
i_xyw) &
1339 - ( momx(k-1,i,j) + momx(k-1,i-1,j ) ) * j13g(k-1,i,j,
i_xyw) &
1340 + ( momy(k+1,i,j) + momy(k+1,i ,j-1) ) * j23g(k+1,i,j,
i_xyw) &
1341 - ( momy(k-1,i,j) + momy(k-1,i ,j-1) ) * j23g(k-1,i,j,
i_xyw) ) / ( fdz(k)+fdz(k-1) ) &
1342 + mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) &
1343 * ( ( momx(k,i ,j ) * gsqrt(k,i ,j ,
i_uyz) / mapf(i ,j ,2,
i_uy) &
1344 - momx(k,i-1,j ) * gsqrt(k,i-1,j ,
i_uyz) / mapf(i-1,j ,2,
i_uy) ) * rcdx(i) &
1345 + ( momy(k,i ,j ) * gsqrt(k,i ,j ,
i_xvz) / mapf(i ,j ,1,
i_xv) &
1346 - momy(k,i, j-1) * gsqrt(k,i ,j-1,
i_xvz) / mapf(i ,j-1,1,
i_xv) ) * rcdy(j) )
1351 k = iundef; i = iundef; j = iundef
1356 ddiv(
ks,i,j) = j33g * ( momz(
ks,i,j) ) * rcdz(
ks) &
1357 + ( ( momx(
ks+1,i,j) + momx(
ks+1,i-1,j ) ) * j13g(
ks+1,i,j,
i_xyw) &
1358 - ( momx(
ks-1,i,j) + momx(
ks ,i-1,j ) ) * j13g(
ks ,i,j,
i_xyw) &
1359 + ( momy(
ks+1,i,j) + momy(
ks+1,i ,j-1) ) * j23g(
ks+1,i,j,
i_xyw) &
1360 - ( momy(
ks ,i,j) + momy(
ks ,i ,j-1) ) * j23g(
ks ,i,j,
i_xyw) ) * rfdz(
ks) &
1361 + mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) &
1362 * ( ( momx(
ks,i ,j ) * gsqrt(
ks,i ,j ,
i_uyz) / mapf(i ,j ,2,
i_uy) &
1363 - momx(
ks,i-1,j ) * gsqrt(
ks,i-1,j ,
i_uyz) / mapf(i-1,j ,2,
i_uy) ) * rcdx(i) &
1364 + ( momy(
ks,i ,j ) * gsqrt(
ks,i ,j ,
i_xvz) / mapf(i ,j ,1,
i_xv) &
1365 - momy(
ks,i, j-1) * gsqrt(
ks,i ,j-1,
i_xvz) / mapf(i ,j-1,1,
i_xv) ) * rcdy(j) )
1366 ddiv(
ke,i,j) = j33g * ( - momz(
ke-1,i ,j ) ) * rcdz(
ke) &
1367 + ( ( momx(
ke ,i,j) + momx(
ke ,i-1,j ) ) * j13g(
ke ,i,j,
i_xyw) &
1368 - ( momx(
ke-1,i,j) + momx(
ke-1,i-1,j ) ) * j13g(
ke-1,i,j,
i_xyw) &
1369 + ( momy(
ke ,i,j) + momy(
ke ,i ,j-1) ) * j23g(
ke ,i,j,
i_xyw) &
1370 - ( momy(
ke-1,i,j) + momy(
ke-1,i ,j-1) ) * j23g(
ke-1,i,j,
i_xyw) ) * rfdz(
ke) &
1371 + mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) &
1372 * ( ( momx(
ke,i ,j ) * gsqrt(
ke,i ,j ,
i_uyz) / mapf(i ,j ,2,
i_uy) &
1373 - momx(
ke,i-1,j ) * gsqrt(
ke,i-1,j ,
i_uyz) / mapf(i-1,j ,2,
i_uy) ) * rcdx(i) &
1374 + ( momy(
ke,i ,j ) * gsqrt(
ke,i ,j ,
i_xvz) / mapf(i ,j ,1,
i_xv) &
1375 - momy(
ke,i, j-1) * gsqrt(
ke,i ,j-1,
i_xvz) / mapf(i ,j-1,1,
i_xv) ) * rcdy(j) )
1379 k = iundef; i = iundef; j = iundef
1396 real(RP),
intent(out) :: work(
ka,
ia,
ja,3,2)
1397 integer,
intent(out) :: iwork
1398 real(RP),
intent(in) :: data(
ka,
ia,
ja)
1399 integer,
intent(in) :: nd_order
1400 integer,
intent(in) :: KO
1401 integer,
intent(in) :: IO
1402 integer,
intent(in) :: JO
1403 integer,
intent(in) :: KEE
1405 integer :: i_in, i_out, i_tmp
1428 call comm_vars8( work(:,:,:,
zdir,i_in), 16 )
1429 call comm_vars8( work(:,:,:,
xdir,i_in), 17 )
1430 call comm_vars8( work(:,:,:,
ydir,i_in), 18 )
1432 call comm_wait ( work(:,:,:,
zdir,i_in), 16 )
1433 call comm_wait ( work(:,:,:,
xdir,i_in), 17 )
1434 call comm_wait ( work(:,:,:,
ydir,i_in), 18 )
1440 call calc_diff4( work(:,:,:,:,i_out), &
1441 work(:,:,:,:,i_in), &
1466 real(RP),
intent(out) :: diff(
ka,
ia,
ja,3)
1467 real(RP),
intent(in ) :: phi(
ka,
ia,
ja)
1468 integer ,
intent(in ) :: KO
1469 integer ,
intent(in ) :: IO
1470 integer ,
intent(in ) :: JO
1484 call check( __line__, phi(k+2,i,j) )
1485 call check( __line__, phi(k+1,i,j) )
1486 call check( __line__, phi(k ,i,j) )
1487 call check( __line__, phi(k-1,i,j) )
1489 diff(k,i,j,
zdir) = ( + cnz3(1,k+1,1) * phi(k+2,i,j) &
1490 - cnz3(2,k+1,1) * phi(k+1,i,j) &
1491 + cnz3(3,k+1,1) * phi(k ,i,j) &
1492 - cnz3(1,k ,1) * phi(k-1,i,j) )
1501 call check( __line__, phi(
ks+2,i,j) )
1502 call check( __line__, phi(
ks+1,i,j) )
1503 call check( __line__, phi(
ks,i,j) )
1504 call check( __line__, phi(
ke,i,j) )
1505 call check( __line__, phi(
ke-1,i,j) )
1506 call check( __line__, phi(
ke-2,i,j) )
1508 diff(
ks,i,j,
zdir) = ( + cnz3(1,
ks+1,1) * phi(
ks+2,i,j) &
1509 - cnz3(2,
ks+1,1) * phi(
ks+1,i,j) &
1510 + cnz3(3,
ks+1,1) * phi(
ks ,i,j) &
1511 - cnz3(1,
ks ,1) * phi(
ks+1,i,j) )
1514 diff(
ke-1,i,j,
zdir) = ( + cnz3(1,
ke ,1) * phi(
ke-1,i,j) &
1515 - cnz3(2,
ke ,1) * phi(
ke ,i,j) &
1516 + cnz3(3,
ke ,1) * phi(
ke-1,i,j) &
1517 - cnz3(1,
ke-1,1) * phi(
ke-2,i,j) )
1520 diff(
ke+2,i,j,
zdir) = 0.0_rp
1531 call check( __line__, phi(k+1,i,j) )
1532 call check( __line__, phi(k ,i,j) )
1533 call check( __line__, phi(k-1,i,j) )
1534 call check( __line__, phi(k-2,i,j) )
1536 diff(k,i,j,
zdir) = ( + cnz3(1,k ,2) * phi(k+1,i,j) &
1537 - cnz3(2,k ,2) * phi(k ,i,j) &
1538 + cnz3(3,k ,2) * phi(k-1,i,j) &
1539 - cnz3(1,k-1,2) * phi(k-2,i,j) )
1548 call check( __line__, phi(
ks+2,i,j) )
1549 call check( __line__, phi(
ks+1,i,j) )
1550 call check( __line__, phi(
ks,i,j) )
1551 call check( __line__, phi(
ks+1,i,j) )
1552 call check( __line__, phi(
ks ,i,j) )
1553 call check( __line__, phi(
ke-1,i,j) )
1554 call check( __line__, phi(
ke-2,i,j) )
1555 call check( __line__, phi(
ke-3,i,j) )
1557 diff(
ks+1,i,j,
zdir) = ( + cnz3(1,
ks+1,2) * phi(
ks+2,i,j) &
1558 - cnz3(2,
ks+1,2) * phi(
ks+1,i,j) &
1559 + cnz3(3,
ks+1,2) * phi(
ks ,i,j) )
1560 diff(
ks ,i,j,
zdir) = ( + cnz3(1,
ks ,2) * phi(
ks+1,i,j) &
1561 - cnz3(2,
ks ,2) * phi(
ks ,i,j) &
1562 - cnz3(1,
ks-1,2) * phi(
ks+1,i,j) )
1565 diff(
ke-1,i,j,
zdir) = ( - cnz3(2,
ke-1,2) * phi(
ke-1,i,j) &
1566 + cnz3(3,
ke-1,2) * phi(
ke-2,i,j) &
1567 - cnz3(1,
ke-2,2) * phi(
ke-3,i,j) )
1568 diff(
ke ,i,j,
zdir) = ( + cnz3(1,
ke ,2) * phi(
ke-1,i,j) &
1569 + cnz3(3,
ke ,2) * phi(
ke-1,i,j) &
1570 - cnz3(1,
ke-1,2) * phi(
ke-2,i,j) )
1584 call check( __line__, phi(k,i+2,j) )
1585 call check( __line__, phi(k,i+1,j) )
1586 call check( __line__, phi(k,i ,j) )
1587 call check( __line__, phi(k,i-1,j) )
1589 diff(k,i,j,
xdir) = ( + cnx3(1,i+1,1) * phi(k,i+2,j) &
1590 - cnx3(2,i+1,1) * phi(k,i+1,j) &
1591 + cnx3(3,i+1,1) * phi(k,i ,j) &
1592 - cnx3(1,i ,1) * phi(k,i-1,j) )
1602 call check( __line__, phi(k,i+1,j) )
1603 call check( __line__, phi(k,i ,j) )
1604 call check( __line__, phi(k,i-1,j) )
1605 call check( __line__, phi(k,i-2,j) )
1607 diff(k,i,j,
xdir) = ( + cnx3(1,i ,2) * phi(k,i+1,j) &
1608 - cnx3(2,i ,2) * phi(k,i ,j) &
1609 + cnx3(3,i ,2) * phi(k,i-1,j) &
1610 - cnx3(1,i-1,2) * phi(k,i-2,j) )
1619 diff( 1:
ks-1,i,j,
xdir) = 0.0_rp
1630 call check( __line__, phi(k,i,j+2) )
1631 call check( __line__, phi(k,i,j+1) )
1632 call check( __line__, phi(k,i,j ) )
1633 call check( __line__, phi(k,i,j-1) )
1635 diff(k,i,j,
ydir) = ( + cny3(1,j+1,1) * phi(k,i,j+2) &
1636 - cny3(2,j+1,1) * phi(k,i,j+1) &
1637 + cny3(3,j+1,1) * phi(k,i,j ) &
1638 - cny3(1,j ,1) * phi(k,i,j-1) )
1648 call check( __line__, phi(k,i,j+1) )
1649 call check( __line__, phi(k,i,j ) )
1650 call check( __line__, phi(k,i,j-1) )
1651 call check( __line__, phi(k,i,j-2) )
1653 diff(k,i,j,
ydir) = ( + cny3(1,j ,2) * phi(k,i,j+1) &
1654 - cny3(2,j ,2) * phi(k,i,j ) &
1655 + cny3(3,j ,2) * phi(k,i,j-1) &
1656 - cny3(1,j-1,2) * phi(k,i,j-2) )
1665 diff( 1:
ks-1,i,j,
ydir) = 0.0_rp
1674 subroutine calc_diff4( &
1683 real(RP),
intent(out) :: num_diff_pt1(
ka,
ia,
ja,3)
1684 real(RP),
intent(in) :: num_diff_pt0(
ka,
ia,
ja,3)
1685 real(RP),
intent(in) :: CNZ4(5,
ka)
1686 real(RP),
intent(in) :: CNX4(5,
ia)
1687 real(RP),
intent(in) :: CNY4(5,
ja)
1688 integer,
intent(in) :: k1
1698 call check( __line__, cnz4(1,k) )
1699 call check( __line__, cnz4(2,k) )
1700 call check( __line__, cnz4(3,k) )
1701 call check( __line__, cnz4(4,k) )
1702 call check( __line__, cnz4(5,k) )
1703 call check( __line__, num_diff_pt0(k+2,i,j,
zdir) )
1704 call check( __line__, num_diff_pt0(k+1,i,j,
zdir) )
1705 call check( __line__, num_diff_pt0(k ,i,j,
zdir) )
1706 call check( __line__, num_diff_pt0(k-1,i,j,
zdir) )
1707 call check( __line__, num_diff_pt0(k-2,i,j,
zdir) )
1709 num_diff_pt1(k,i,j,
zdir) = &
1710 ( cnz4(1,k) * num_diff_pt0(k+2,i,j,
zdir) &
1711 - cnz4(2,k) * num_diff_pt0(k+1,i,j,
zdir) &
1712 + cnz4(3,k) * num_diff_pt0(k ,i,j,
zdir) &
1713 - cnz4(4,k) * num_diff_pt0(k-1,i,j,
zdir) &
1714 + cnz4(5,k) * num_diff_pt0(k-2,i,j,
zdir) )
1722 num_diff_pt1(
ks-1,i,j,
zdir) = - num_diff_pt1(
ks ,i,j,
zdir)
1723 num_diff_pt1(
ks-2,i,j,
zdir) = - num_diff_pt1(
ks+1,i,j,
zdir)
1724 num_diff_pt1(
ke ,i,j,
zdir) = - num_diff_pt1(
ke-1,i,j,
zdir)
1725 num_diff_pt1(
ke+1,i,j,
zdir) = - num_diff_pt1(
ke-2,i,j,
zdir)
1734 call check( __line__, cnx4(1,i) )
1735 call check( __line__, cnx4(2,i) )
1736 call check( __line__, cnx4(3,i) )
1737 call check( __line__, cnx4(4,i) )
1738 call check( __line__, cnx4(5,i) )
1739 call check( __line__, num_diff_pt0(k,i-2,j,
xdir) )
1740 call check( __line__, num_diff_pt0(k,i+1,j,
xdir) )
1741 call check( __line__, num_diff_pt0(k,i ,j,
xdir) )
1742 call check( __line__, num_diff_pt0(k,i-1,j,
xdir) )
1743 call check( __line__, num_diff_pt0(k,i-2,j,
xdir) )
1745 num_diff_pt1(k,i,j,
xdir) = &
1746 ( cnx4(1,i) * num_diff_pt0(k,i+2,j,
xdir) &
1747 - cnx4(2,i) * num_diff_pt0(k,i+1,j,
xdir) &
1748 + cnx4(3,i) * num_diff_pt0(k,i ,j,
xdir) &
1749 - cnx4(4,i) * num_diff_pt0(k,i-1,j,
xdir) &
1750 + cnx4(5,i) * num_diff_pt0(k,i-2,j,
xdir) )
1760 call check( __line__, cny4(1,j) )
1761 call check( __line__, cny4(2,j) )
1762 call check( __line__, cny4(3,j) )
1763 call check( __line__, cny4(4,j) )
1764 call check( __line__, cny4(5,j) )
1765 call check( __line__, num_diff_pt0(k,i,j-2,
ydir) )
1766 call check( __line__, num_diff_pt0(k,i,j+1,
ydir) )
1767 call check( __line__, num_diff_pt0(k,i,j ,
ydir) )
1768 call check( __line__, num_diff_pt0(k,i,j-1,
ydir) )
1769 call check( __line__, num_diff_pt0(k,i,j-2,
ydir) )
1771 num_diff_pt1(k,i,j,
ydir) = &
1772 ( cny4(1,j) * num_diff_pt0(k,i,j+2,
ydir) &
1773 - cny4(2,j) * num_diff_pt0(k,i,j+1,
ydir) &
1774 + cny4(3,j) * num_diff_pt0(k,i,j ,
ydir) &
1775 - cny4(4,j) * num_diff_pt0(k,i,j-1,
ydir) &
1776 + cny4(5,j) * num_diff_pt0(k,i,j-2,
ydir) )
1782 end subroutine calc_diff4
1788 phi_in, DENS0, DENS, &
1803 real(RP),
intent(out) :: qflx_anti(
ka,
ia,
ja,3)
1805 real(RP),
intent(in) :: phi_in(
ka,
ia,
ja)
1806 real(RP),
intent(in) :: DENS0(
ka,
ia,
ja)
1807 real(RP),
intent(in) :: DENS (
ka,
ia,
ja)
1809 real(RP),
intent(in) :: qflx_hi(
ka,
ia,
ja,3)
1810 real(RP),
intent(in) :: qflx_lo(
ka,
ia,
ja,3)
1811 real(RP),
intent(in) :: mflx_hi(
ka,
ia,
ja,3)
1813 real(RP),
intent(in) :: RDZ(:)
1814 real(RP),
intent(in) :: RDX(:)
1815 real(RP),
intent(in) :: RDY(:)
1817 real(RP),
intent(in) :: GSQRT(
ka,
ia,
ja)
1818 real(RP),
intent(in) :: MAPF(
ia,
ja,2)
1820 real(RP),
intent(in) :: dt
1822 logical,
intent(in) :: flag_vect
1825 real(RP) :: phi_lo(
ka,
ia,
ja)
1826 real(RP) :: pjpls(
ka,
ia,
ja)
1827 real(RP) :: pjmns(
ka,
ia,
ja)
1828 real(RP) :: qjpls(
ka,
ia,
ja)
1829 real(RP) :: qjmns(
ka,
ia,
ja)
1830 real(RP) :: rjpls(
ka,
ia,
ja)
1831 real(RP) :: rjmns(
ka,
ia,
ja)
1833 real(RP) :: qmin, qmax
1834 real(RP) :: zerosw, dirsw
1836 real(RP) :: fact(0:1,-1:1,-1:1)
1837 real(RP) :: rw, ru, rv
1838 real(RP) :: qa_in, qb_in
1839 real(RP) :: qa_lo, qb_lo
1841 integer :: k, i, j, ijs
1842 integer :: IIS, IIE, JJS, JJE
1846 qflx_anti(:,:,:,:) = undef
1848 pjpls(:,:,:) = undef
1849 pjmns(:,:,:) = undef
1850 qjpls(:,:,:) = undef
1851 qjmns(:,:,:) = undef
1852 rjpls(:,:,:) = undef
1853 rjmns(:,:,:) = undef
1866 call check( __line__, qflx_hi(k,i,j,
zdir) )
1867 call check( __line__, qflx_lo(k,i,j,
zdir) )
1869 qflx_anti(k,i,j,
zdir) = qflx_hi(k,i,j,
zdir) - qflx_lo(k,i,j,
zdir)
1874 k = iundef; i = iundef; j = iundef
1879 qflx_anti(
ks-1,i,j,
zdir) = 0.0_rp
1880 qflx_anti(
ke ,i,j,
zdir) = 0.0_rp
1884 k = iundef; i = iundef; j = iundef
1891 call check( __line__, qflx_hi(k,i,j,
xdir) )
1892 call check( __line__, qflx_lo(k,i,j,
xdir) )
1894 qflx_anti(k,i,j,
xdir) = qflx_hi(k,i,j,
xdir) - qflx_lo(k,i,j,
xdir)
1899 k = iundef; i = iundef; j = iundef
1906 call check( __line__, qflx_hi(k,i,j,
ydir) )
1907 call check( __line__, qflx_lo(k,i,j,
ydir) )
1909 qflx_anti(k,i,j,
ydir) = qflx_hi(k,i,j,
ydir) - qflx_lo(k,i,j,
ydir)
1914 k = iundef; i = iundef; j = iundef
1923 call check( __line__, phi_in(k,i,j) )
1924 call check( __line__, qflx_lo(k ,i ,j ,
zdir) )
1925 call check( __line__, qflx_lo(k-1,i ,j ,
zdir) )
1926 call check( __line__, qflx_lo(k ,i ,j ,
xdir) )
1927 call check( __line__, qflx_lo(k ,i-1,j ,
xdir) )
1928 call check( __line__, qflx_lo(k ,i ,j ,
ydir) )
1929 call check( __line__, qflx_lo(k ,i ,j-1,
ydir) )
1931 phi_lo(k,i,j) = ( phi_in(k,i,j) * dens0(k,i,j) &
1932 + dt * ( - ( ( qflx_lo(k,i,j,
zdir)-qflx_lo(k-1,i ,j ,
zdir) ) * rdz(k) &
1933 + ( qflx_lo(k,i,j,
xdir)-qflx_lo(k ,i-1,j ,
xdir) ) * rdx(i) &
1934 + ( qflx_lo(k,i,j,
ydir)-qflx_lo(k ,i ,j-1,
ydir) ) * rdy(j) &
1935 ) * mapf(i,j,1) * mapf(i,j,2) / gsqrt(k,i,j) ) &
1941 k = iundef; i = iundef; j = iundef
1950 call check( __line__, qflx_anti(k ,i ,j ,
zdir) )
1951 call check( __line__, qflx_anti(k-1,i ,j ,
zdir) )
1952 call check( __line__, qflx_anti(k ,i ,j ,
xdir) )
1953 call check( __line__, qflx_anti(k ,i-1,j ,
xdir) )
1954 call check( __line__, qflx_anti(k ,i ,j ,
ydir) )
1955 call check( __line__, qflx_anti(k ,i ,j-1,
ydir) )
1957 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) &
1958 + ( max(0.0_rp,qflx_anti(k ,i-1,j ,
xdir)) - min(0.0_rp,qflx_anti(k,i,j,
xdir)) ) * rdx(i) &
1959 + ( max(0.0_rp,qflx_anti(k ,i ,j-1,
ydir)) - min(0.0_rp,qflx_anti(k,i,j,
ydir)) ) * rdy(j) &
1960 ) * mapf(i,j,1) * mapf(i,j,2) / gsqrt(k,i,j)
1965 k = iundef; i = iundef; j = iundef
1974 call check( __line__, qflx_anti(k ,i ,j ,
zdir) )
1975 call check( __line__, qflx_anti(k-1,i ,j ,
zdir) )
1976 call check( __line__, qflx_anti(k ,i ,j ,
xdir) )
1977 call check( __line__, qflx_anti(k ,i-1,j ,
xdir) )
1978 call check( __line__, qflx_anti(k ,i ,j ,
ydir) )
1979 call check( __line__, qflx_anti(k ,i ,j-1,
ydir) )
1981 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) &
1982 + ( max(0.0_rp,qflx_anti(k,i,j,
xdir)) - min(0.0_rp,qflx_anti(k ,i-1,j ,
xdir)) ) * rdx(i) &
1983 + ( max(0.0_rp,qflx_anti(k,i,j,
ydir)) - min(0.0_rp,qflx_anti(k ,i ,j-1,
ydir)) ) * rdy(j) &
1984 ) * mapf(i,j,1) * mapf(i,j,2) / gsqrt(k,i,j)
1989 k = iundef; i = iundef; j = iundef
2000 rw = (mflx_hi(k,i,j,
zdir)+mflx_hi(k-1,i ,j ,
zdir)) * rdz(k)
2001 ru = (mflx_hi(k,i,j,
xdir)+mflx_hi(k ,i-1,j ,
xdir)) * rdx(i)
2002 rv = (mflx_hi(k,i,j,
ydir)+mflx_hi(k ,i ,j-1,
ydir)) * rdy(j)
2004 call get_fact_fct( fact, &
2007 qa_in = fact(1, 1, 1) * phi_in(k+1,i+1,j+1) &
2008 + fact(0, 1, 1) * phi_in(k ,i+1,j+1) &
2009 + fact(1, 0, 1) * phi_in(k+1,i ,j+1) &
2010 + fact(0, 0, 1) * phi_in(k ,i ,j+1) &
2011 + fact(1,-1, 1) * phi_in(k+1,i-1,j+1) &
2012 + fact(1, 1, 0) * phi_in(k+1,i+1,j ) &
2013 + fact(0, 1, 0) * phi_in(k ,i+1,j ) &
2014 + fact(1, 0, 0) * phi_in(k+1,i ,j ) &
2015 + fact(1,-1, 0) * phi_in(k+1,i-1,j ) &
2016 + fact(1, 1,-1) * phi_in(k+1,i+1,j-1) &
2017 + fact(0, 1,-1) * phi_in(k ,i+1,j-1) &
2018 + fact(1, 0,-1) * phi_in(k+1,i ,j-1) &
2019 + fact(1,-1,-1) * phi_in(k+1,i-1,j-1) &
2020 + fact(0, 0, 0) * phi_in(k ,i ,j )
2021 qb_in = fact(1, 1, 1) * phi_in(k-1,i-1,j-1) &
2022 + fact(0, 1, 1) * phi_in(k ,i-1,j-1) &
2023 + fact(1, 0, 1) * phi_in(k-1,i ,j-1) &
2024 + fact(0, 0, 1) * phi_in(k ,i ,j-1) &
2025 + fact(1,-1, 1) * phi_in(k-1,i+1,j-1) &
2026 + fact(1, 1, 0) * phi_in(k-1,i-1,j ) &
2027 + fact(0, 1, 0) * phi_in(k ,i-1,j ) &
2028 + fact(1, 0, 0) * phi_in(k-1,i ,j ) &
2029 + fact(1,-1, 0) * phi_in(k-1,i+1,j ) &
2030 + fact(1, 1,-1) * phi_in(k-1,i-1,j+1) &
2031 + fact(0, 1,-1) * phi_in(k ,i-1,j-1) &
2032 + fact(1, 0,-1) * phi_in(k-1,i ,j-1) &
2033 + fact(1,-1,-1) * phi_in(k-1,i+1,j+1) &
2034 + fact(0, 0, 0) * phi_in(k ,i ,j )
2035 qa_lo = fact(1, 1, 1) * phi_lo(k+1,i+1,j+1) &
2036 + fact(0, 1, 1) * phi_lo(k ,i+1,j+1) &
2037 + fact(1, 0, 1) * phi_lo(k+1,i ,j+1) &
2038 + fact(0, 0, 1) * phi_lo(k ,i ,j+1) &
2039 + fact(1,-1, 1) * phi_lo(k+1,i-1,j+1) &
2040 + fact(1, 1, 0) * phi_lo(k+1,i+1,j ) &
2041 + fact(0, 1, 0) * phi_lo(k ,i+1,j ) &
2042 + fact(1, 0, 0) * phi_lo(k+1,i ,j ) &
2043 + fact(1,-1, 0) * phi_lo(k+1,i-1,j ) &
2044 + fact(1, 1,-1) * phi_lo(k+1,i+1,j-1) &
2045 + fact(0, 1,-1) * phi_lo(k ,i+1,j-1) &
2046 + fact(1, 0,-1) * phi_lo(k+1,i ,j-1) &
2047 + fact(1,-1,-1) * phi_lo(k+1,i-1,j-1) &
2048 + fact(0, 0, 0) * phi_lo(k ,i ,j )
2049 qb_lo = fact(1, 1, 1) * phi_lo(k-1,i-1,j-1) &
2050 + fact(0, 1, 1) * phi_lo(k ,i-1,j-1) &
2051 + fact(1, 0, 1) * phi_lo(k-1,i ,j-1) &
2052 + fact(0, 0, 1) * phi_lo(k ,i ,j-1) &
2053 + fact(1,-1, 1) * phi_lo(k-1,i+1,j-1) &
2054 + fact(1, 1, 0) * phi_lo(k-1,i-1,j ) &
2055 + fact(0, 1, 0) * phi_lo(k ,i-1,j ) &
2056 + fact(1, 0, 0) * phi_lo(k-1,i ,j ) &
2057 + fact(1,-1, 0) * phi_lo(k-1,i+1,j ) &
2058 + fact(1, 1,-1) * phi_lo(k-1,i-1,j+1) &
2059 + fact(0, 1,-1) * phi_lo(k ,i-1,j-1) &
2060 + fact(1, 0,-1) * phi_lo(k-1,i ,j-1) &
2061 + fact(1,-1,-1) * phi_lo(k-1,i+1,j+1) &
2062 + fact(0, 0, 0) * phi_lo(k ,i ,j )
2065 phi_in(k,i,j), qa_in, qb_in, &
2066 phi_lo(k,i,j), qa_lo, qb_lo )
2068 phi_in(k,i,j), qa_in, qb_in, &
2069 phi_lo(k,i,j), qa_lo, qb_lo )
2070 qjpls(k,i,j) = ( qmax - phi_lo(k,i,j) ) * dens(k,i,j)
2071 qjmns(k,i,j) = ( phi_lo(k,i,j) - qmin ) * dens(k,i,j)
2080 rw = (mflx_hi(
ks,i,j,
zdir) ) * rdz(
ks)
2081 ru = (mflx_hi(
ks,i,j,
xdir)+mflx_hi(
ks ,i-1,j ,
xdir)) * rdx(i)
2082 rv = (mflx_hi(
ks,i,j,
ydir)+mflx_hi(
ks ,i ,j-1,
ydir)) * rdy(j)
2084 call get_fact_fct( fact, &
2087 qa_in = fact(1, 1, 1) * phi_in(
ks+1,i+1,j+1) &
2088 + fact(0, 1, 1) * phi_in(
ks ,i+1,j+1) &
2089 + fact(1, 0, 1) * phi_in(
ks+1,i ,j+1) &
2090 + fact(0, 0, 1) * phi_in(
ks ,i ,j+1) &
2091 + fact(1,-1, 1) * phi_in(
ks+1,i-1,j+1) &
2092 + fact(1, 1, 0) * phi_in(
ks+1,i+1,j ) &
2093 + fact(0, 1, 0) * phi_in(
ks ,i+1,j ) &
2094 + fact(1, 0, 0) * phi_in(
ks+1,i ,j ) &
2095 + fact(1,-1, 0) * phi_in(
ks+1,i-1,j ) &
2096 + fact(1, 1,-1) * phi_in(
ks+1,i+1,j-1) &
2097 + fact(0, 1,-1) * phi_in(
ks ,i+1,j-1) &
2098 + fact(1, 0,-1) * phi_in(
ks+1,i ,j-1) &
2099 + fact(1,-1,-1) * phi_in(
ks+1,i-1,j-1) &
2100 + fact(0, 0, 0) * phi_in(
ks ,i ,j )
2101 qb_in = fact(1, 1, 1) * phi_in(
ks ,i-1,j-1) &
2102 + fact(0, 1, 1) * phi_in(
ks ,i-1,j-1) &
2103 + fact(1, 0, 1) * phi_in(
ks ,i ,j-1) &
2104 + fact(0, 0, 1) * phi_in(
ks ,i ,j-1) &
2105 + fact(1,-1, 1) * phi_in(
ks ,i+1,j-1) &
2106 + fact(1, 1, 0) * phi_in(
ks ,i-1,j ) &
2107 + fact(0, 1, 0) * phi_in(
ks ,i-1,j ) &
2108 + fact(1, 0, 0) * phi_in(
ks ,i ,j ) &
2109 + fact(1,-1, 0) * phi_in(
ks ,i+1,j ) &
2110 + fact(1, 1,-1) * phi_in(
ks ,i-1,j+1) &
2111 + fact(0, 1,-1) * phi_in(
ks ,i-1,j-1) &
2112 + fact(1, 0,-1) * phi_in(
ks ,i ,j-1) &
2113 + fact(1,-1,-1) * phi_in(
ks ,i+1,j+1) &
2114 + fact(0, 0, 0) * phi_in(
ks ,i ,j )
2115 qa_lo = fact(1, 1, 1) * phi_lo(
ks+1,i+1,j+1) &
2116 + fact(0, 1, 1) * phi_lo(
ks ,i+1,j+1) &
2117 + fact(1, 0, 1) * phi_lo(
ks+1,i ,j+1) &
2118 + fact(0, 0, 1) * phi_lo(
ks ,i ,j+1) &
2119 + fact(1,-1, 1) * phi_lo(
ks+1,i-1,j+1) &
2120 + fact(1, 1, 0) * phi_lo(
ks+1,i+1,j ) &
2121 + fact(0, 1, 0) * phi_lo(
ks ,i+1,j ) &
2122 + fact(1, 0, 0) * phi_lo(
ks+1,i ,j ) &
2123 + fact(1,-1, 0) * phi_lo(
ks+1,i-1,j ) &
2124 + fact(1, 1,-1) * phi_lo(
ks+1,i+1,j-1) &
2125 + fact(0, 1,-1) * phi_lo(
ks ,i+1,j-1) &
2126 + fact(1, 0,-1) * phi_lo(
ks+1,i ,j-1) &
2127 + fact(1,-1,-1) * phi_lo(
ks+1,i-1,j-1) &
2128 + fact(0, 0, 0) * phi_lo(
ks ,i ,j )
2129 qb_lo = fact(1, 1, 1) * phi_lo(
ks ,i-1,j-1) &
2130 + fact(0, 1, 1) * phi_lo(
ks ,i-1,j-1) &
2131 + fact(1, 0, 1) * phi_lo(
ks ,i ,j-1) &
2132 + fact(0, 0, 1) * phi_lo(
ks ,i ,j-1) &
2133 + fact(1,-1, 1) * phi_lo(
ks ,i+1,j-1) &
2134 + fact(1, 1, 0) * phi_lo(
ks ,i-1,j ) &
2135 + fact(0, 1, 0) * phi_lo(
ks ,i-1,j ) &
2136 + fact(1, 0, 0) * phi_lo(
ks ,i ,j ) &
2137 + fact(1,-1, 0) * phi_lo(
ks ,i+1,j ) &
2138 + fact(1, 1,-1) * phi_lo(
ks ,i-1,j+1) &
2139 + fact(0, 1,-1) * phi_lo(
ks ,i-1,j-1) &
2140 + fact(1, 0,-1) * phi_lo(
ks ,i ,j-1) &
2141 + fact(1,-1,-1) * phi_lo(
ks ,i+1,j+1) &
2142 + fact(0, 0, 0) * phi_lo(
ks ,i ,j )
2145 phi_in(
ks,i,j), qa_in, qb_in, &
2146 phi_lo(
ks,i,j), qa_lo, qb_lo )
2148 phi_in(
ks,i,j), qa_in, qb_in, &
2149 phi_lo(
ks,i,j), qa_lo, qb_lo )
2150 qjpls(
ks,i,j) = ( qmax - phi_lo(
ks,i,j) ) * dens(
ks,i,j)
2151 qjmns(
ks,i,j) = ( phi_lo(
ks,i,j) - qmin ) * dens(
ks,i,j)
2159 rw = ( mflx_hi(
ke-1,i ,j ,
zdir)) * rdz(
ke)
2160 ru = (mflx_hi(
ke,i,j,
xdir)+mflx_hi(
ke ,i-1,j ,
xdir)) * rdx(i)
2161 rv = (mflx_hi(
ke,i,j,
ydir)+mflx_hi(
ke ,i ,j-1,
ydir)) * rdy(j)
2163 call get_fact_fct( fact, &
2166 qa_in = fact(1, 1, 1) * phi_in(
ke ,i+1,j+1) &
2167 + fact(0, 1, 1) * phi_in(
ke ,i+1,j+1) &
2168 + fact(1, 0, 1) * phi_in(
ke ,i ,j+1) &
2169 + fact(0, 0, 1) * phi_in(
ke ,i ,j+1) &
2170 + fact(1,-1, 1) * phi_in(
ke ,i-1,j+1) &
2171 + fact(1, 1, 0) * phi_in(
ke ,i+1,j ) &
2172 + fact(0, 1, 0) * phi_in(
ke ,i+1,j ) &
2173 + fact(1, 0, 0) * phi_in(
ke ,i ,j ) &
2174 + fact(1,-1, 0) * phi_in(
ke ,i-1,j ) &
2175 + fact(1, 1,-1) * phi_in(
ke ,i+1,j-1) &
2176 + fact(0, 1,-1) * phi_in(
ke ,i+1,j-1) &
2177 + fact(1, 0,-1) * phi_in(
ke ,i ,j-1) &
2178 + fact(1,-1,-1) * phi_in(
ke ,i-1,j-1) &
2179 + fact(0, 0, 0) * phi_in(
ke ,i ,j )
2180 qb_in = fact(1, 1, 1) * phi_in(
ke-1,i-1,j-1) &
2181 + fact(0, 1, 1) * phi_in(
ke ,i-1,j-1) &
2182 + fact(1, 0, 1) * phi_in(
ke-1,i ,j-1) &
2183 + fact(0, 0, 1) * phi_in(
ke ,i ,j-1) &
2184 + fact(1,-1, 1) * phi_in(
ke-1,i+1,j-1) &
2185 + fact(1, 1, 0) * phi_in(
ke-1,i-1,j ) &
2186 + fact(0, 1, 0) * phi_in(
ke ,i-1,j ) &
2187 + fact(1, 0, 0) * phi_in(
ke-1,i ,j ) &
2188 + fact(1,-1, 0) * phi_in(
ke-1,i+1,j ) &
2189 + fact(1, 1,-1) * phi_in(
ke-1,i-1,j+1) &
2190 + fact(0, 1,-1) * phi_in(
ke ,i-1,j-1) &
2191 + fact(1, 0,-1) * phi_in(
ke-1,i ,j-1) &
2192 + fact(1,-1,-1) * phi_in(
ke-1,i+1,j+1) &
2193 + fact(0, 0, 0) * phi_in(
ke ,i ,j )
2194 qa_lo = fact(1, 1, 1) * phi_lo(
ke ,i+1,j+1) &
2195 + fact(0, 1, 1) * phi_lo(
ke ,i+1,j+1) &
2196 + fact(1, 0, 1) * phi_lo(
ke ,i ,j+1) &
2197 + fact(0, 0, 1) * phi_lo(
ke ,i ,j+1) &
2198 + fact(1,-1, 1) * phi_lo(
ke ,i-1,j+1) &
2199 + fact(1, 1, 0) * phi_lo(
ke ,i+1,j ) &
2200 + fact(0, 1, 0) * phi_lo(
ke ,i+1,j ) &
2201 + fact(1, 0, 0) * phi_lo(
ke ,i ,j ) &
2202 + fact(1,-1, 0) * phi_lo(
ke ,i-1,j ) &
2203 + fact(1, 1,-1) * phi_lo(
ke ,i+1,j-1) &
2204 + fact(0, 1,-1) * phi_lo(
ke ,i+1,j-1) &
2205 + fact(1, 0,-1) * phi_lo(
ke ,i ,j-1) &
2206 + fact(1,-1,-1) * phi_lo(
ke ,i-1,j-1) &
2207 + fact(0, 0, 0) * phi_lo(
ke ,i ,j )
2208 qb_lo = fact(1, 1, 1) * phi_lo(
ke-1,i-1,j-1) &
2209 + fact(0, 1, 1) * phi_lo(
ke ,i-1,j-1) &
2210 + fact(1, 0, 1) * phi_lo(
ke-1,i ,j-1) &
2211 + fact(0, 0, 1) * phi_lo(
ke ,i ,j-1) &
2212 + fact(1,-1, 1) * phi_lo(
ke-1,i+1,j-1) &
2213 + fact(1, 1, 0) * phi_lo(
ke-1,i-1,j ) &
2214 + fact(0, 1, 0) * phi_lo(
ke ,i-1,j ) &
2215 + fact(1, 0, 0) * phi_lo(
ke-1,i ,j ) &
2216 + fact(1,-1, 0) * phi_lo(
ke-1,i+1,j ) &
2217 + fact(1, 1,-1) * phi_lo(
ke-1,i-1,j+1) &
2218 + fact(0, 1,-1) * phi_lo(
ke ,i-1,j-1) &
2219 + fact(1, 0,-1) * phi_lo(
ke-1,i ,j-1) &
2220 + fact(1,-1,-1) * phi_lo(
ke-1,i+1,j+1) &
2221 + fact(0, 0, 0) * phi_lo(
ke ,i ,j )
2224 phi_in(
ke,i,j), qa_in, qb_in, &
2225 phi_lo(
ke,i,j), qa_lo, qb_lo )
2227 phi_in(
ke,i,j), qa_in, qb_in, &
2228 phi_lo(
ke,i,j), qa_lo, qb_lo )
2229 qjpls(
ke,i,j) = ( qmax - phi_lo(
ke,i,j) ) * dens(
ke,i,j)
2230 qjmns(
ke,i,j) = ( phi_lo(
ke,i,j) - qmin ) * dens(
ke,i,j)
2241 call check( __line__, phi_in(k ,i ,j ) )
2242 call check( __line__, phi_in(k-1,i ,j ) )
2243 call check( __line__, phi_in(k+1,i ,j ) )
2244 call check( __line__, phi_in(k ,i-1,j ) )
2245 call check( __line__, phi_in(k ,i+1,j ) )
2246 call check( __line__, phi_in(k ,i ,j+1) )
2247 call check( __line__, phi_in(k ,i ,j-1) )
2248 call check( __line__, phi_lo(k ,i ,j ) )
2249 call check( __line__, phi_lo(k-1,i ,j ) )
2250 call check( __line__, phi_lo(k+1,i ,j ) )
2251 call check( __line__, phi_lo(k ,i-1,j ) )
2252 call check( __line__, phi_lo(k ,i+1,j ) )
2253 call check( __line__, phi_lo(k ,i ,j+1) )
2254 call check( __line__, phi_lo(k ,i ,j-1) )
2256 qmax = max( phi_in(k ,i ,j ), &
2257 phi_in(k+1,i ,j ), &
2258 phi_in(k-1,i ,j ), &
2259 phi_in(k ,i+1,j ), &
2260 phi_in(k ,i-1,j ), &
2261 phi_in(k ,i ,j+1), &
2262 phi_in(k ,i ,j-1), &
2264 phi_lo(k+1,i ,j ), &
2265 phi_lo(k-1,i ,j ), &
2266 phi_lo(k ,i+1,j ), &
2267 phi_lo(k ,i-1,j ), &
2268 phi_lo(k ,i ,j+1), &
2270 qmin = min( phi_in(k ,i ,j ), &
2271 phi_in(k+1,i ,j ), &
2272 phi_in(k-1,i ,j ), &
2273 phi_in(k ,i-1,j ), &
2274 phi_in(k ,i+1,j ), &
2275 phi_in(k ,i ,j+1), &
2276 phi_in(k ,i ,j-1), &
2278 phi_lo(k+1,i ,j ), &
2279 phi_lo(k-1,i ,j ), &
2280 phi_lo(k ,i-1,j ), &
2281 phi_lo(k ,i+1,j ), &
2282 phi_lo(k ,i ,j+1), &
2284 qjpls(k,i,j) = ( qmax - phi_lo(k,i,j) ) * dens(k,i,j)
2285 qjmns(k,i,j) = ( phi_lo(k,i,j) - qmin ) * dens(k,i,j)
2290 k = iundef; i = iundef; j = iundef
2296 call check( __line__, phi_in(
ks ,i ,j ) )
2297 call check( __line__, phi_in(
ks+1,i ,j ) )
2298 call check( __line__, phi_in(
ks ,i-1,j ) )
2299 call check( __line__, phi_in(
ks ,i+1,j ) )
2300 call check( __line__, phi_in(
ks ,i ,j+1) )
2301 call check( __line__, phi_in(
ks ,i ,j-1) )
2302 call check( __line__, phi_lo(
ks ,i ,j ) )
2303 call check( __line__, phi_lo(
ks+1,i ,j ) )
2304 call check( __line__, phi_lo(
ks ,i-1,j ) )
2305 call check( __line__, phi_lo(
ks ,i+1,j ) )
2306 call check( __line__, phi_lo(
ks ,i ,j+1) )
2307 call check( __line__, phi_lo(
ks ,i ,j-1) )
2308 call check( __line__, phi_in(
ke ,i ,j ) )
2309 call check( __line__, phi_in(
ke-1,i ,j ) )
2310 call check( __line__, phi_in(
ke ,i-1,j ) )
2311 call check( __line__, phi_in(
ke ,i+1,j ) )
2312 call check( __line__, phi_in(
ke ,i ,j+1) )
2313 call check( __line__, phi_in(
ke ,i ,j-1) )
2314 call check( __line__, phi_lo(
ke ,i ,j ) )
2315 call check( __line__, phi_lo(
ke-1,i ,j ) )
2316 call check( __line__, phi_lo(
ke ,i-1,j ) )
2317 call check( __line__, phi_lo(
ke ,i+1,j ) )
2318 call check( __line__, phi_lo(
ke ,i ,j+1) )
2319 call check( __line__, phi_lo(
ke ,i ,j-1) )
2321 qmax = max( phi_in(
ks ,i ,j ), &
2322 phi_in(
ks+1,i ,j ), &
2323 phi_in(
ks ,i+1,j ), &
2324 phi_in(
ks ,i-1,j ), &
2325 phi_in(
ks ,i ,j+1), &
2326 phi_in(
ks ,i ,j-1), &
2327 phi_lo(
ks ,i ,j ), &
2328 phi_lo(
ks+1,i ,j ), &
2329 phi_lo(
ks ,i+1,j ), &
2330 phi_lo(
ks ,i-1,j ), &
2331 phi_lo(
ks ,i ,j+1), &
2332 phi_lo(
ks ,i ,j-1) )
2333 qmin = min( phi_in(
ks ,i ,j ), &
2334 phi_in(
ks+1,i ,j ), &
2335 phi_in(
ks ,i+1,j ), &
2336 phi_in(
ks ,i-1,j ), &
2337 phi_in(
ks ,i ,j+1), &
2338 phi_in(
ks ,i ,j-1), &
2339 phi_lo(
ks ,i ,j ), &
2340 phi_lo(
ks+1,i ,j ), &
2341 phi_lo(
ks ,i+1,j ), &
2342 phi_lo(
ks ,i-1,j ), &
2343 phi_lo(
ks ,i ,j+1), &
2344 phi_lo(
ks ,i ,j-1) )
2345 qjmns(
ks,i,j) = ( phi_lo(
ks,i,j) - qmin ) * dens(
ks,i,j)
2346 qjpls(
ks,i,j) = ( qmax - phi_lo(
ks,i,j) ) * dens(
ks,i,j)
2348 qmax = max( phi_in(
ke ,i ,j ), &
2349 phi_in(
ke-1,i ,j ), &
2350 phi_in(
ke ,i+1,j ), &
2351 phi_in(
ke ,i-1,j ), &
2352 phi_in(
ke ,i ,j+1), &
2353 phi_in(
ke ,i ,j-1), &
2354 phi_lo(
ke ,i ,j ), &
2355 phi_lo(
ke-1,i ,j ), &
2356 phi_lo(
ke ,i+1,j ), &
2357 phi_lo(
ke ,i-1,j ), &
2358 phi_lo(
ke ,i ,j+1), &
2359 phi_lo(
ke ,i ,j-1) )
2360 qmin = min( phi_in(
ke ,i ,j ), &
2361 phi_in(
ke-1,i ,j ), &
2362 phi_in(
ke ,i-1,j ), &
2363 phi_in(
ke ,i+1,j ), &
2364 phi_in(
ke ,i ,j+1), &
2365 phi_in(
ke ,i ,j-1), &
2366 phi_lo(
ke ,i ,j ), &
2367 phi_lo(
ke-1,i ,j ), &
2368 phi_lo(
ke ,i-1,j ), &
2369 phi_lo(
ke ,i+1,j ), &
2370 phi_lo(
ke ,i ,j+1), &
2371 phi_lo(
ke ,i ,j-1) )
2372 qjpls(
ke,i,j) = ( qmax - phi_lo(
ke,i,j) ) * dens(
ke,i,j)
2373 qjmns(
ke,i,j) = ( phi_lo(
ke,i,j) - qmin ) * dens(
ke,i,j)
2377 k = iundef; i = iundef; j = iundef
2387 call check( __line__, pjpls(k,i,j) )
2388 call check( __line__, qjpls(k,i,j) )
2391 zerosw = 0.5_rp - sign( 0.5_rp, pjpls(k,i,j)-epsilon )
2392 rjpls(k,i,j) = min( 1.0_rp, qjpls(k,i,j) * ( 1.0_rp-zerosw ) / ( pjpls(k,i,j)-zerosw ) )
2397 k = iundef; i = iundef; j = iundef
2406 call check( __line__, pjmns(k,i,j) )
2407 call check( __line__, qjmns(k,i,j) )
2410 zerosw = 0.5_rp - sign( 0.5_rp, pjmns(k,i,j)-epsilon )
2411 rjmns(k,i,j) = min( 1.0_rp, qjmns(k,i,j) * ( 1.0_rp-zerosw ) / ( pjmns(k,i,j)-zerosw ) )
2416 k = iundef; i = iundef; j = iundef
2422 call comm_vars8( rjpls(:,:,:), 1 )
2423 call comm_vars8( rjmns(:,:,:), 2 )
2424 call comm_wait ( rjpls(:,:,:), 1 )
2425 call comm_wait ( rjmns(:,:,:), 2 )
2438 call check( __line__, qflx_anti(k,i,j,
zdir) )
2439 call check( __line__, rjpls(k ,i,j) )
2440 call check( __line__, rjpls(k+1,i,j) )
2441 call check( __line__, rjmns(k ,i,j) )
2442 call check( __line__, rjmns(k+1,i,j) )
2445 dirsw = 0.5_rp + sign( 0.5_rp, qflx_anti(k,i,j,
zdir) )
2446 qflx_anti(k,i,j,
zdir) = qflx_anti(k,i,j,
zdir) &
2448 - min( rjpls(k+1,i,j),rjmns(k ,i,j) ) * ( dirsw ) &
2449 - min( rjpls(k ,i,j),rjmns(k+1,i,j) ) * ( 1.0_rp - dirsw ) )
2454 k = iundef; i = iundef; j = iundef
2461 call check( __line__, rjpls(
ke ,i,j) )
2462 call check( __line__, rjmns(
ke ,i,j) )
2464 qflx_anti(
ks-1,i,j,
zdir) = 0.0_rp
2465 qflx_anti(
ke ,i,j,
zdir) = 0.0_rp
2469 k = iundef; i = iundef; j = iundef
2472 if ( iis ==
is )
then 2483 call check( __line__, qflx_anti(k,i,j,
xdir) )
2484 call check( __line__, rjpls(k,i ,j) )
2485 call check( __line__, rjpls(k,i+1,j) )
2486 call check( __line__, rjmns(k,i ,j) )
2487 call check( __line__, rjmns(k,i+1,j) )
2490 dirsw = 0.5_rp + sign( 0.5_rp, qflx_anti(k,i,j,
xdir) )
2491 qflx_anti(k,i,j,
xdir) = qflx_anti(k,i,j,
xdir) &
2493 - min( rjpls(k,i+1,j),rjmns(k,i ,j) ) * ( dirsw ) &
2494 - min( rjpls(k,i ,j),rjmns(k,i+1,j) ) * ( 1.0_rp - dirsw ) )
2499 k = iundef; i = iundef; j = iundef
2502 if ( jjs ==
js )
then 2512 call check( __line__, qflx_anti(k,i,j,
ydir) )
2513 call check( __line__, rjpls(k,i,j+1) )
2514 call check( __line__, rjpls(k,i,j ) )
2515 call check( __line__, rjmns(k,i,j ) )
2516 call check( __line__, rjmns(k,i,j+1) )
2519 dirsw = 0.5_rp + sign( 0.5_rp, qflx_anti(k,i,j,
ydir) )
2520 qflx_anti(k,i,j,
ydir) = qflx_anti(k,i,j,
ydir) &
2522 - min( rjpls(k,i,j+1),rjmns(k,i,j ) ) * ( dirsw ) &
2523 - min( rjpls(k,i,j ),rjmns(k,i,j+1) ) * ( 1.0_rp - dirsw ) )
2528 k = iundef; i = iundef; j = iundef
2540 subroutine get_fact_fct( &
2546 real(RP),
intent(out) :: fact(0:1,-1:1,-1:1)
2547 real(RP),
intent(in) :: rw, ru, rv
2549 real(RP) :: sign_uv, sign_uw, sign_vw
2550 real(RP) :: ugev, ugew, vgew
2551 real(RP) :: umax, vmax, wmax
2552 real(RP) :: vu, wu, uv, wv, uw, vw
2553 real(RP) :: uzero, vzero, wzero
2556 ugev = sign(0.5_rp, abs(ru)-abs(rv)) + 0.5_rp
2557 ugew = sign(0.5_rp, abs(ru)-abs(rw)) + 0.5_rp
2558 vgew = sign(0.5_rp, abs(rv)-abs(rw)) + 0.5_rp
2560 uzero = sign(0.5_rp,abs(ru)-epsilon) - 0.5_rp
2561 vzero = sign(0.5_rp,abs(rv)-epsilon) - 0.5_rp
2562 wzero = sign(0.5_rp,abs(rw)-epsilon) - 0.5_rp
2564 sign_uv = sign(0.5_rp, ru*rv) + 0.5_rp
2565 sign_uw = sign(0.5_rp, ru*rw) + 0.5_rp
2566 sign_vw = sign(0.5_rp, rv*rw) + 0.5_rp
2568 wu = abs( rw / ( ru+uzero ) * ( 1.0_rp+uzero ) )
2569 vu = abs( rv / ( ru+uzero ) * ( 1.0_rp+uzero ) )
2570 uv = abs( ru / ( rv+vzero ) * ( 1.0_rp+vzero ) )
2571 wv = abs( rw / ( rv+vzero ) * ( 1.0_rp+vzero ) )
2572 uw = abs( ru / ( rw+wzero ) * ( 1.0_rp+wzero ) )
2573 vw = abs( rv / ( rw+wzero ) * ( 1.0_rp+wzero ) )
2575 umax = ugev * ugew * ( 1.0_rp+uzero )
2576 vmax = (1.0_rp-ugev) * vgew
2577 wmax = 1.0_rp - ugev * ugew - vmax
2579 fact(0, 0, 0) = - ugev * ugew * uzero
2581 fact(1, 0, 0) = wmax * (1.0_rp-uw) * (1.0_rp-vw)
2582 fact(0, 1, 0) = umax * (1.0_rp-vu) * (1.0_rp-wu)
2583 fact(0, 0, 1) = vmax * (1.0_rp-uv) * (1.0_rp-wv)
2585 fact(1, 1, 1) = sign_uv * sign_uw * ( umax * vu*wu + vmax * uv*wv + wmax * uw*vw )
2586 fact(1,-1, 1) = (1.0_rp-sign_uv) * (1.0_rp-sign_uw) * ( umax * vu*wu + vmax * uv*wv + wmax * uw*vw )
2587 fact(1, 1,-1) = (1.0_rp-sign_uv) * sign_uw * ( umax * vu*wu + vmax * uv*wv + wmax * uw*vw )
2588 fact(1,-1,-1) = sign_uv * (1.0_rp-sign_uw) * ( umax * vu*wu + vmax * uv*wv + wmax * uw*vw )
2590 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) )
2591 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) )
2592 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) )
2593 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) )
2594 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) )
2595 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) )
2598 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 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
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
real(rp), public const_undef
integer, public ia
of x whole cells (local, with HALO)
subroutine, public comm_vars8_init(var, vid)
Register variables.
integer, public ka
of z whole cells (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)
subroutine, public prof_rapend(rapname_base, level)
Save raptime.
integer, public ihalo
of halo cells: x
integer, public ja
of y whole cells (local, with HALO)