149 rdry => const_rdry, &
150 cvdry => const_cvdry, &
151 cpdry => const_cpdry, &
154 grav => const_grav, &
184 real(RP),
intent(out) :: dens_rk(
ka,
ia,
ja)
185 real(RP),
intent(out) :: momz_rk(
ka,
ia,
ja)
186 real(RP),
intent(out) :: momx_rk(
ka,
ia,
ja)
187 real(RP),
intent(out) :: momy_rk(
ka,
ia,
ja)
188 real(RP),
intent(out) :: rhot_rk(
ka,
ia,
ja)
190 real(RP),
intent(out) :: prog_rk(
ka,
ia,
ja,
va)
192 real(RP),
intent(inout) :: mflx_hi(
ka,
ia,
ja,3)
193 real(RP),
intent(out) :: tflx_hi(
ka,
ia,
ja,3)
195 real(RP),
intent(in),
target :: dens0(
ka,
ia,
ja)
196 real(RP),
intent(in),
target :: momz0(
ka,
ia,
ja)
197 real(RP),
intent(in),
target :: momx0(
ka,
ia,
ja)
198 real(RP),
intent(in),
target :: momy0(
ka,
ia,
ja)
199 real(RP),
intent(in),
target :: rhot0(
ka,
ia,
ja)
201 real(RP),
intent(in) :: dens(
ka,
ia,
ja)
202 real(RP),
intent(in) :: momz(
ka,
ia,
ja)
203 real(RP),
intent(in) :: momx(
ka,
ia,
ja)
204 real(RP),
intent(in) :: momy(
ka,
ia,
ja)
205 real(RP),
intent(in) :: rhot(
ka,
ia,
ja)
207 real(RP),
intent(in) :: dens_t(
ka,
ia,
ja)
208 real(RP),
intent(in) :: momz_t(
ka,
ia,
ja)
209 real(RP),
intent(in) :: momx_t(
ka,
ia,
ja)
210 real(RP),
intent(in) :: momy_t(
ka,
ia,
ja)
211 real(RP),
intent(in) :: rhot_t(
ka,
ia,
ja)
213 real(RP),
intent(in) :: prog0(
ka,
ia,
ja,
va)
214 real(RP),
intent(in) :: prog (
ka,
ia,
ja,
va)
216 real(RP),
intent(in) :: dpres0(
ka,
ia,
ja)
217 real(RP),
intent(in) :: rt2p(
ka,
ia,
ja)
218 real(RP),
intent(in) :: corioli(1,
ia,
ja)
219 real(RP),
intent(in) :: num_diff(
ka,
ia,
ja,5,3)
220 real(RP),
intent(in) :: wdamp_coef(
ka)
221 real(RP),
intent(in) :: divdmp_coef
222 real(RP),
intent(in) :: ddiv(
ka,
ia,
ja)
224 logical,
intent(in) :: flag_fct_momentum
225 logical,
intent(in) :: flag_fct_t
226 logical,
intent(in) :: flag_fct_along_stream
228 real(RP),
intent(in) :: cdz(
ka)
229 real(RP),
intent(in) :: fdz(
ka-1)
230 real(RP),
intent(in) :: fdx(
ia-1)
231 real(RP),
intent(in) :: fdy(
ja-1)
232 real(RP),
intent(in) :: rcdz(
ka)
233 real(RP),
intent(in) :: rcdx(
ia)
234 real(RP),
intent(in) :: rcdy(
ja)
235 real(RP),
intent(in) :: rfdz(
ka-1)
236 real(RP),
intent(in) :: rfdx(
ia-1)
237 real(RP),
intent(in) :: rfdy(
ja-1)
239 real(RP),
intent(in) :: phi (
ka,
ia,
ja)
240 real(RP),
intent(in) :: gsqrt (
ka,
ia,
ja,7)
241 real(RP),
intent(in) :: j13g (
ka,
ia,
ja,7)
242 real(RP),
intent(in) :: j23g (
ka,
ia,
ja,7)
243 real(RP),
intent(in) :: j33g
244 real(RP),
intent(in) :: mapf (
ia,
ja,2,4)
245 real(RP),
intent(in) :: ref_dens(
ka,
ia,
ja)
246 real(RP),
intent(in) :: ref_rhot(
ka,
ia,
ja)
248 logical,
intent(in) :: bnd_w
249 logical,
intent(in) :: bnd_e
250 logical,
intent(in) :: bnd_s
251 logical,
intent(in) :: bnd_n
253 real(RP),
intent(in) :: dtrk
254 logical,
intent(in) :: last
258 real(RP) :: pott(
ka,
ia,
ja)
259 real(RP) :: dpres(
ka,
ia,
ja)
261 real(RP) :: qflx_hi (
ka,
ia,
ja,3)
262 real(RP) :: qflx_j13(
ka,
ia,
ja)
263 real(RP) :: qflx_j23(
ka,
ia,
ja)
272 real(RP) :: advch_t(
ka,
ia,
ja,5)
273 real(RP) :: advcv_t(
ka,
ia,
ja,5)
274 real(RP) :: wdmp_t(
ka,
ia,
ja)
275 real(RP) :: ddiv_t(
ka,
ia,
ja,3)
276 real(RP) :: pg_t(
ka,
ia,
ja,3)
277 real(RP) :: cf_t(
ka,
ia,
ja,2)
288 real(RP) :: c(
kmax-1)
294 integer :: iis, iie, jjs, jje
304 qflx_hi(:,:,:,:) = undef
305 qflx_j13(:,:,:) = undef
306 qflx_j23(:,:,:) = undef
309 #if defined DEBUG || defined QUICKDEBUG 310 dens_rk( 1:
ks-1,:,:) = undef
311 dens_rk(
ke+1:
ka ,:,:) = undef
312 momz_rk( 1:
ks-1,:,:) = undef
313 momz_rk(
ke+1:
ka ,:,:) = undef
314 momx_rk( 1:
ks-1,:,:) = undef
315 momx_rk(
ke+1:
ka ,:,:) = undef
316 momy_rk( 1:
ks-1,:,:) = undef
317 momy_rk(
ke+1:
ka ,:,:) = undef
318 rhot_rk( 1:
ks-1,:,:) = undef
319 rhot_rk(
ke+1:
ka ,:,:) = undef
320 prog_rk( 1:
ks-1,:,:,:) = undef
321 prog_rk(
ke+1:
ka ,:,:,:) = undef
334 if ( bnd_w ) ifs_off = 0
335 if ( bnd_s ) jfs_off = 0
343 profile_start(
"hevi_pres")
350 call check( __line__, dpres0(k,i,j) )
351 call check( __line__, rt2p(k,i,j) )
352 call check( __line__, rhot(k,i,j) )
353 call check( __line__, ref_rhot(k,i,j) )
355 dpres(k,i,j) = dpres0(k,i,j) + rt2p(k,i,j) * ( rhot(k,i,j) - ref_rhot(k,i,j) )
357 dpres(
ks-1,i,j) = dpres0(
ks-1,i,j) - dens(
ks,i,j) * ( phi(
ks-1,i,j) - phi(
ks+1,i,j) )
358 dpres(
ke+1,i,j) = dpres0(
ke+1,i,j) - dens(
ke,i,j) * ( phi(
ke+1,i,j) - phi(
ke-1,i,j) )
361 profile_stop(
"hevi_pres")
365 profile_start(
"hevi_mflx_z")
371 mflx_hi(
ks-1,i,j,
zdir) = 0.0_rp
374 call check( __line__, momx(k+1,i ,j) )
375 call check( __line__, momx(k+1,i-1,j) )
376 call check( __line__, momx(k ,i ,j) )
377 call check( __line__, momx(k ,i+1,j) )
378 call check( __line__, momy(k+1,i,j) )
379 call check( __line__, momy(k+1,i,j-1) )
380 call check( __line__, momy(k ,i,j) )
381 call check( __line__, momy(k ,i,j-1) )
383 mflx_hi(k,i,j,
zdir) = j13g(k,i,j,
i_xyw) * 0.25_rp / mapf(i,j,2,
i_xy) &
384 * ( momx(k+1,i,j)+momx(k+1,i-1,j) &
385 + momx(k ,i,j)+momx(k ,i-1,j) ) &
386 + j23g(k,i,j,
i_xyw) * 0.25_rp / mapf(i,j,1,
i_xy) &
387 * ( momy(k+1,i,j)+momy(k+1,i,j-1) &
388 + momy(k ,i,j)+momy(k ,i,j-1) ) &
389 + gsqrt(k,i,j,
i_xyw) / ( mapf(i,j,1,
i_xy)*mapf(i,j,2,
i_xy) ) * num_diff(k,i,j,
i_dens,
zdir)
391 mflx_hi(
ke ,i,j,
zdir) = 0.0_rp
395 k = iundef; i = iundef; j = iundef
397 profile_stop(
"hevi_mflx_z")
399 profile_start(
"hevi_mflx_x")
400 iss = max(iis-1,
is-ifs_off)
409 call check( __line__, gsqrt(k,i,j,
i_uyz) )
410 call check( __line__, momx(k,i,j) )
411 call check( __line__, num_diff(k,i,j,
i_dens,
xdir) )
413 mflx_hi(k,i,j,
xdir) = gsqrt(k,i,j,
i_uyz) / mapf(i,j,2,
i_uy) &
414 * ( momx(k,i,j) + num_diff(k,i,j,
i_dens,
xdir) )
419 k = iundef; i = iundef; j = iundef
421 profile_stop(
"hevi_mflx_x")
426 do j = max(jjs-1,
js-jfs_off), min(jje,
jeh)
430 call check( __line__, gsqrt(k,i,j,
i_xvz) )
431 call check( __line__, momy(k,i,j) )
432 call check( __line__, num_diff(k,i,j,
i_dens,
ydir) )
434 mflx_hi(k,i,j,
ydir) = gsqrt(k,i,j,
i_xvz) / mapf(i,j,1,
i_xv) &
435 * ( momy(k,i,j) + num_diff(k,i,j,
i_dens,
ydir) )
440 k = iundef; i = iundef; j = iundef
444 profile_start(
"hevi_sr")
457 call check( __line__, dens0(k,i,j) )
458 call check( __line__, mflx_hi(k ,i ,j ,
xdir) )
459 call check( __line__, mflx_hi(k ,i-1,j ,
xdir) )
460 call check( __line__, mflx_hi(k ,i ,j ,
ydir) )
461 call check( __line__, mflx_hi(k ,i ,j-1,
ydir) )
462 call check( __line__, dens_t(k,i,j) )
464 advcv = - ( mflx_hi(k,i,j,
zdir)-mflx_hi(k-1,i ,j,
zdir) ) * rcdz(k)
465 advch = - ( ( mflx_hi(k,i,j,
xdir)-mflx_hi(k ,i-1,j,
xdir) ) * rcdx(i) &
466 + ( mflx_hi(k,i,j,
ydir)-mflx_hi(k ,i, j-1,
ydir) ) * rcdy(j) )
467 sr(k,i,j) = ( advcv + advch ) * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / gsqrt(k,i,j,
i_xyz) + dens_t(k,i,j)
470 advch_t(k,i,j,
i_dens) = ( advch + advcv ) * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / gsqrt(k,i,j,
i_xyz)
477 k = iundef; i = iundef; j = iundef
479 profile_stop(
"hevi_sr")
485 profile_start(
"hevi_momz_qflxhi_z")
488 gsqrt(:,:,:,
i_xyz), j33g, &
492 profile_stop(
"hevi_momz_qflxhi_z")
494 profile_start(
"hevi_momz_qflxj")
497 gsqrt(:,:,:,
i_xyz), j13g(:,:,:,
i_xyz), mapf(:,:,:,
i_xy), &
502 gsqrt(:,:,:,
i_xyz), j23g(:,:,:,
i_xyz), mapf(:,:,:,
i_xy), &
505 profile_stop(
"hevi_momz_qflxj")
508 profile_start(
"hevi_momz_qflxhi_x")
515 profile_stop(
"hevi_momz_qflxhi_x")
518 profile_start(
"hevi_momz_qflxhi_y")
525 profile_stop(
"hevi_momz_qflxhi_y")
528 profile_start(
"hevi_sw")
542 call check( __line__, qflx_hi(k ,i ,j ,
zdir) )
543 call check( __line__, qflx_hi(k-1,i ,j ,
zdir) )
544 call check( __line__, qflx_j13(k ,i ,j) )
545 call check( __line__, qflx_j13(k-1,i ,j) )
546 call check( __line__, qflx_j23(k ,i ,j) )
547 call check( __line__, qflx_j23(k-1,i ,j) )
548 call check( __line__, qflx_hi(k ,i ,j ,
xdir) )
549 call check( __line__, qflx_hi(k ,i-1,j ,
xdir) )
550 call check( __line__, qflx_hi(k ,i ,j ,
ydir) )
551 call check( __line__, qflx_hi(k ,i ,j-1,
ydir) )
552 call check( __line__, ddiv(k ,i,j) )
553 call check( __line__, ddiv(k+1,i,j) )
554 call check( __line__, momz0(k,i,j) )
555 call check( __line__, momz_t(k,i,j) )
557 advcv = - ( qflx_hi(k,i,j,
zdir) - qflx_hi(k-1,i ,j ,
zdir) &
558 + qflx_j13(k,i,j) - qflx_j13(k-1,i ,j ) &
559 + qflx_j23(k,i,j) - qflx_j23(k-1,i ,j ) ) * rfdz(k)
560 advch = - ( ( qflx_hi(k,i,j,
xdir) - qflx_hi(k,i-1,j ,
xdir) ) * rcdx(i) &
561 + ( qflx_hi(k,i,j,
ydir) - qflx_hi(k,i ,j-1,
ydir) ) * rcdy(j) ) &
562 * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy)
563 wdmp = - wdamp_coef(k) * momz0(k,i,j)
564 div = divdmp_coef / dtrk * ( ddiv(k+1,i,j)-ddiv(k,i,j) ) * fdz(k)
565 sw(k,i,j) = ( advcv + advch ) / gsqrt(k,i,j,
i_xyw) &
566 + wdmp + div + momz_t(k,i,j)
572 ddiv_t(k,i,j,1) = div
578 profile_stop(
"hevi_sw")
580 k = iundef; i = iundef; j = iundef
592 call check( __line__, rhot(k,i,j) )
593 call check( __line__, dens(k,i,j) )
595 pott(k,i,j) = rhot(k,i,j) / dens(k,i,j)
600 k = iundef; i = iundef; j = iundef
605 mflx_hi(:,:,:,
zdir), pott, gsqrt(:,:,:,
i_xyw), &
612 mflx_hi(:,:,:,
xdir), pott, gsqrt(:,:,:,
i_uyz), &
619 mflx_hi(:,:,:,
ydir), pott, gsqrt(:,:,:,
i_xvz), &
625 profile_start(
"hevi_st")
638 call check( __line__, tflx_hi(k ,i ,j ,
zdir) )
639 call check( __line__, tflx_hi(k-1,i ,j ,
zdir) )
640 call check( __line__, tflx_hi(k ,i ,j ,
xdir) )
641 call check( __line__, tflx_hi(k ,i-1,j ,
xdir) )
642 call check( __line__, tflx_hi(k ,i ,j ,
ydir) )
643 call check( __line__, tflx_hi(k ,i ,j-1,
ydir) )
644 call check( __line__, rhot_t(k,i,j) )
646 advcv = - ( tflx_hi(k,i,j,
zdir) - tflx_hi(k-1,i ,j ,
zdir) ) * rcdz(k)
647 advch = - ( ( tflx_hi(k,i,j,
xdir) - tflx_hi(k ,i-1,j ,
xdir) ) * rcdx(i) &
648 + ( tflx_hi(k,i,j,
ydir) - tflx_hi(k ,i ,j-1,
ydir) ) * rcdy(j) )
649 st(k,i,j) = ( advcv + advch ) * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / gsqrt(k,i,j,
i_xyz) + rhot_t(k,i,j)
652 advch_t(k,i,j,
i_rhot) = ( advcv + advch ) * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / gsqrt(k,i,j,
i_xyz)
659 k = iundef; i = iundef; j = iundef
661 profile_stop(
"hevi_st")
665 profile_start(
"hevi_solver")
692 momz(:,i,j), pott(:,i,j), gsqrt(:,i,j,
i_xyz), &
696 a(k) = dtrk**2 * j33g * rcdz(k) * rt2p(k,i,j) * j33g / gsqrt(k,i,j,
i_xyz)
698 b = grav * dtrk**2 * j33g / ( cdz(
ks+1) + cdz(
ks) )
700 f2(
ks) = 1.0_rp + ( pt(
ks ) * rfdz(
ks) * ( a(
ks+1)+a(
ks) ) ) / gsqrt(
ks,i,j,
i_xyw)
702 b = grav * dtrk**2 * j33g / ( cdz(k+1) + cdz(k) )
703 f1(k) = - ( pt(k+1) * rfdz(k) * a(k+1) + b ) / gsqrt(k,i,j,
i_xyw)
704 f2(k) = 1.0_rp + ( pt(k ) * rfdz(k) * ( a(k+1)+a(k) ) ) / gsqrt(k,i,j,
i_xyw)
705 f3(k) = - ( pt(k-1) * rfdz(k) * a(k) - b ) / gsqrt(k,i,j,
i_xyw)
707 b = grav * dtrk**2 * j33g / ( cdz(
ke) + cdz(
ke-1) )
708 f2(
ke-1) = 1.0_rp + ( pt(
ke-1) * rfdz(
ke-1) * ( a(
ke)+a(
ke-1) ) ) / gsqrt(
ke-1,i,j,
i_xyw)
709 f3(
ke-1) = - ( pt(
ke-2) * rfdz(
ke-1) * a(
ke-1) - b ) / gsqrt(
ke-1,i,j,
i_xyw)
712 pg = - ( dpres(k+1,i,j) + rt2p(k+1,i,j)*dtrk*st(k+1,i,j) &
713 - dpres(k ,i,j) - rt2p(k ,i,j)*dtrk*st(k ,i,j) ) &
714 * rfdz(k) * j33g / gsqrt(k,i,j,
i_xyw) &
716 * ( f2h(k,1,
i_xyz) * ( dens(k+1,i,j) - ref_dens(k+1,i,j) + sr(k+1,i,j) * dtrk ) &
717 + f2h(k,2,
i_xyz) * ( dens(k ,i,j) - ref_dens(k ,i,j) + sr(k ,i,j) * dtrk ) )
718 c(k-
ks+1) = momz(k,i,j) + dtrk * ( pg + sw(k,i,j) )
720 if ( lhist ) pg_t(k,i,j,1) = pg
726 f1(:), f2(:), f3(:) )
729 #ifdef DEBUG_HEVI2HEVE 731 c(k-
ks+1) = momz(k,i,j)
732 mflx_hi(k,i,j,
zdir) = mflx_hi(k,i,j,
zdir) &
733 + j33g * momz(k,i,j) / ( mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) )
734 tflx_hi(k,i,j,
zdir) = tflx_hi(k,i,j,
zdir) &
735 + j33g * momz(k,i,j) * pt(k) / ( mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) )
737 momz_rk(k,i,j) = momz0(k,i,j) &
739 - j33g * ( dpres(k+1,i,j)-dpres(k,i,j) ) * rfdz(k) / gsqrt(k,i,j,
i_xyw) &
740 - grav * ( f2h(k,2,
i_xyz)*(dens(k,i,j)-ref_dens(k,i,j))+f2h(k,1,
i_xyz)*(dens(k+1,i,j)-ref_dens(k+1,i,j)) ) &
744 mflx_hi(k,i,j,
zdir) = mflx_hi(k,i,j,
zdir) &
745 + j33g * c(k-
ks+1) / ( mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) )
746 tflx_hi(k,i,j,
zdir) = tflx_hi(k,i,j,
zdir) &
747 + j33g * c(k-
ks+1) * pt(k) / ( mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) )
749 momz_rk(k,i,j) = momz0(k,i,j) &
750 + ( c(k-
ks+1) - momz(k,i,j) )
753 momz_rk(
ks-1,i,j) = 0.0_rp
754 momz_rk(
ke ,i,j) = 0.0_rp
757 advcv = - c(1) * j33g * rcdz(
ks) / gsqrt(
ks,i,j,
i_xyz)
758 dens_rk(
ks,i,j) = dens0(
ks,i,j) + dtrk * ( advcv + sr(
ks,i,j) )
760 if ( lhist ) advcv_t(
ks,i,j,
i_dens) = advcv
762 advcv = - c(1) * pt(
ks) * j33g * rcdz(
ks) / gsqrt(
ks,i,j,
i_xyz)
763 rhot_rk(
ks,i,j) = rhot0(
ks,i,j) + dtrk * ( advcv + st(
ks,i,j) )
765 if ( lhist ) advcv_t(
ks,i,j,
i_rhot) = advcv
768 advcv = - ( c(k-
ks+1) - c(k-
ks) ) &
769 * j33g * rcdz(k) / gsqrt(k,i,j,
i_xyz)
770 dens_rk(k,i,j) = dens0(k,i,j) + dtrk * ( advcv + sr(k,i,j) )
772 if ( lhist ) advcv_t(k,i,j,
i_dens) = advcv
774 advcv = - ( c(k-
ks+1) * pt(k) - c(k-
ks) * pt(k-1) ) &
775 * j33g * rcdz(k) / gsqrt(k,i,j,
i_xyz)
776 rhot_rk(k,i,j) = rhot0(k,i,j) + dtrk * ( advcv + st(k,i,j) )
778 if ( lhist ) advcv_t(k,i,j,
i_rhot) = advcv
782 dens_rk(
ke,i,j) = dens0(
ke,i,j) + dtrk * ( advcv + sr(
ke,i,j) )
784 if ( lhist ) advcv_t(
ke,i,j,
i_dens) = advcv
787 rhot_rk(
ke,i,j) = rhot0(
ke,i,j) + dtrk * ( advcv + st(
ke,i,j) )
789 if ( lhist ) advcv_t(
ke,i,j,
i_rhot) = advcv
793 call check_equation( &
795 dens(:,i,j), momz(:,i,j), rhot(:,i,j), dpres(:,i,j), &
797 sr(:,i,j), sw(:,i,j), st(:,i,j), &
798 j33g, gsqrt(:,i,j,:), &
806 k = iundef; i = iundef; j = iundef
809 profile_stop(
"hevi_solver")
814 profile_start(
"hevi_momx")
818 gsqrt(:,:,:,
i_uyw), j33g, &
824 gsqrt(:,:,:,
i_uyz), j13g(:,:,:,
i_uyw), mapf(:,:,:,
i_uy), &
829 gsqrt(:,:,:,
i_uyz), j23g(:,:,:,
i_uyw), mapf(:,:,:,
i_uy), &
867 call check( __line__, qflx_hi(k ,i ,j ,
zdir) )
868 call check( __line__, qflx_hi(k-1,i ,j ,
zdir) )
869 call check( __line__, qflx_hi(k ,i ,j ,
xdir) )
870 call check( __line__, qflx_hi(k ,i-1,j ,
xdir) )
871 call check( __line__, qflx_hi(k ,i ,j ,
ydir) )
872 call check( __line__, qflx_hi(k ,i ,j-1,
ydir) )
873 call check( __line__, dpres(k,i+1,j) )
874 call check( __line__, dpres(k,i ,j) )
875 call check( __line__, corioli(1,i ,j) )
876 call check( __line__, corioli(1,i+1,j) )
877 call check( __line__, momy(k,i ,j ) )
878 call check( __line__, momy(k,i+1,j ) )
879 call check( __line__, momy(k,i ,j-1) )
880 call check( __line__, momy(k,i+1,j-1) )
881 call check( __line__, ddiv(k,i+1,j) )
882 call check( __line__, ddiv(k,i ,j) )
883 call check( __line__, momx0(k,i,j) )
885 advcv = - ( qflx_hi(k,i,j,
zdir) - qflx_hi(k-1,i ,j ,
zdir) &
886 + qflx_j13(k,i,j) - qflx_j13(k-1,i ,j ) &
887 + qflx_j23(k,i,j) - qflx_j23(k-1,i ,j ) ) * rcdz(k)
888 advch = - ( ( qflx_hi(k,i,j,
xdir) - qflx_hi(k ,i-1,j ,
xdir) ) * rfdx(i) &
889 + ( qflx_hi(k,i,j,
ydir) - qflx_hi(k ,i ,j-1,
ydir) ) * rcdy(j) ) &
890 * mapf(i,j,1,
i_uy) * mapf(i,j,2,
i_uy)
891 pg = ( ( gsqrt(k,i+1,j,
i_xyz) * dpres(k,i+1,j) &
892 - gsqrt(k,i ,j,
i_xyz) * dpres(k,i ,j) &
894 + ( j13g(k ,i,j,
i_uyw) &
895 * 0.5_rp * ( f2h(k,1,
i_uyz) * ( dpres(k+1,i+1,j)+dpres(k+1,i,j) ) &
896 + f2h(k,2,
i_uyz) * ( dpres(k ,i+1,j)+dpres(k ,i,j) ) ) &
897 - j13g(k-1,i,j,
i_uyw) &
898 * 0.5_rp * ( f2h(k,1,
i_uyz) * ( dpres(k ,i+1,j)+dpres(k ,i,j) ) &
899 + f2h(k,2,
i_uyz) * ( dpres(k-1,i+1,j)+dpres(k-1,i,j) ) ) &
902 cf = 0.125_rp * ( corioli(1,i+1,j )+corioli(1,i,j ) ) &
903 * ( momy(k,i+1,j )+momy(k,i,j ) &
904 + momy(k,i+1,j-1)+momy(k,i,j-1) ) &
905 + 0.25_rp * mapf(i,j,1,
i_uy) * mapf(i,j,2,
i_uy) &
906 * ( momy(k,i,j) + momy(k,i,j-1) + momy(k,i+1,j) + momy(k,i+1,j-1) ) &
907 * ( ( momy(k,i,j) + momy(k,i,j-1) + momy(k,i+1,j) + momy(k,i+1,j-1) ) * 0.25_rp &
908 * ( 1.0_rp/mapf(i+1,j,2,
i_xy) - 1.0_rp/mapf(i,j,2,
i_xy) ) * rfdx(i) &
910 * ( 1.0_rp/mapf(i,j,1,
i_uv) - 1.0_rp/mapf(i,j-1,1,
i_uv) ) * rcdy(j) ) &
911 * 2.0_rp / ( dens(k,i+1,j) + dens(k,i,j) )
912 div = divdmp_coef / dtrk * ( ddiv(k,i+1,j)/mapf(i+1,j,2,
i_xy) - ddiv(k,i,j)/mapf(i,j,1,
i_xy) ) &
913 * mapf(i,j,1,
i_uy) * mapf(i,j,2,
i_uy) * fdx(i)
914 momx_rk(k,i,j) = momx0(k,i,j) &
915 + dtrk * ( ( advcv + advch - pg ) / gsqrt(k,i,j,
i_uyz) + cf + div + momx_t(k,i,j) )
920 pg_t(k,i,j,2) = - pg / gsqrt(k,i,j,
i_uyz)
922 ddiv_t(k,i,j,2) = div
928 profile_stop(
"hevi_momx")
930 k = iundef; i = iundef; j = iundef
934 profile_start(
"hevi_momy")
938 gsqrt(:,:,:,
i_xvw), j33g, &
944 gsqrt(:,:,:,
i_xvz), j13g(:,:,:,
i_xvw), mapf(:,:,:,
i_xv), &
949 gsqrt(:,:,:,
i_xvz), j23g(:,:,:,
i_xvw), mapf(:,:,:,
i_xv), &
982 do j = jjs, min(jje,
jeh)
986 call check( __line__, qflx_hi(k ,i ,j ,
zdir) )
987 call check( __line__, qflx_hi(k-1,i ,j ,
zdir) )
988 call check( __line__, qflx_hi(k ,i ,j ,
xdir) )
989 call check( __line__, qflx_hi(k ,i-1,j ,
xdir) )
990 call check( __line__, qflx_hi(k ,i ,j ,
ydir) )
991 call check( __line__, qflx_hi(k ,i ,j-1,
ydir) )
992 call check( __line__, dpres(k,i,j ) )
993 call check( __line__, dpres(k,i,j+1) )
994 call check( __line__, corioli(1,i,j ) )
995 call check( __line__, corioli(1,i,j+1) )
996 call check( __line__, momx(k,i ,j ) )
997 call check( __line__, momx(k,i ,j+1) )
998 call check( __line__, momx(k,i-1,j ) )
999 call check( __line__, momx(k,i-1,j+1) )
1000 call check( __line__, ddiv(k,i,j+1) )
1001 call check( __line__, ddiv(k,i,j ) )
1002 call check( __line__, momy_t(k,i,j) )
1003 call check( __line__, momy0(k,i,j) )
1005 advcv = - ( qflx_hi(k,i,j,
zdir) - qflx_hi(k-1,i ,j ,
zdir) &
1006 + qflx_j13(k,i,j) - qflx_j13(k-1,i ,j ) &
1007 + qflx_j23(k,i,j) - qflx_j23(k-1,i ,j ) ) * rcdz(k)
1008 advch = - ( ( qflx_hi(k,i,j,
xdir) - qflx_hi(k ,i-1,j ,
xdir) ) * rcdx(i) &
1009 + ( qflx_hi(k,i,j,
ydir) - qflx_hi(k ,i ,j-1,
ydir) ) * rfdy(j) ) &
1010 * mapf(i,j,1,
i_xv) * mapf(i,j,2,
i_xv)
1011 pg = ( ( gsqrt(k,i,j+1,
i_xyz) * dpres(k,i,j+1) &
1012 - gsqrt(k,i,j ,
i_xyz) * dpres(k,i,j ) &
1014 + ( j23g(k ,i,j,
i_xvw) &
1015 * 0.5_rp * ( f2h(k ,1,
i_xvz) * ( dpres(k+1,i,j+1)+dpres(k+1,i,j) ) &
1016 + f2h(k ,2,
i_xvz) * ( dpres(k ,i,j+1)+dpres(k ,i,j) ) ) &
1017 - j23g(k-1,i,j,
i_xvw) &
1018 * 0.5_rp * ( f2h(k-1,1,
i_xvz) * ( dpres(k ,i,j+1)+dpres(k ,i,j) ) &
1019 + f2h(k-1,2,
i_xvz) * ( dpres(k-1,i,j+1)+dpres(k-1,i,j) ) ) &
1022 cf = - 0.125_rp * ( corioli(1,i ,j+1)+corioli(1,i ,j) ) &
1023 * ( momx(k,i ,j+1)+momx(k,i ,j) &
1024 + momx(k,i-1,j+1)+momx(k,i-1,j) ) &
1025 - 0.25_rp * mapf(i,j,1,
i_xv) * mapf(i,j,2,
i_xv) &
1026 * ( momx(k,i,j) + momx(k,i-1,j) + momx(k,i,j+1) + momx(k,i-1,j+1) ) &
1028 * ( 1.0_rp/mapf(i,j,2,
i_uv) - 1.0_rp/mapf(i-1,j,2,
i_uv) ) * rcdx(i) &
1029 - 0.25_rp * ( momx(k,i,j)+momx(k,i-1,j)+momx(k,i,j+1)+momx(k,i-1,j+1) ) &
1030 * ( 1.0_rp/mapf(i,j+1,1,
i_xy) - 1.0_rp/mapf(i,j,1,
i_xy) ) * rfdy(j) ) &
1031 * 2.0_rp / ( dens(k,i,j+1) + dens(k,i,j) )
1032 div = divdmp_coef / dtrk * ( ddiv(k,i,j+1)/mapf(i,j+1,1,
i_xy) - ddiv(k,i,j)/mapf(i,j,1,
i_xy) ) &
1033 * mapf(i,j,1,
i_xv) * mapf(i,j,2,
i_xv) * fdy(j)
1034 momy_rk(k,i,j) = momy0(k,i,j) &
1035 + dtrk * ( ( advcv + advch - pg ) / gsqrt(k,i,j,
i_xvz) + cf + div + momy_t(k,i,j) )
1038 advcv_t(k,i,j,
i_momy) = advcv / gsqrt(k,i,j,
i_xvz)
1039 advch_t(k,i,j,
i_momy) = advch / gsqrt(k,i,j,
i_xvz)
1040 pg_t(k,i,j,3) = - pg / gsqrt(k,i,j,
i_xvz)
1042 ddiv_t(k,i,j,3) = div
1048 profile_stop(
"hevi_momy")
1050 k = iundef; i = iundef; j = iundef
1062 call file_history_in(advcv_t(:,:,:,
i_dens),
'DENS_t_advcv',
'tendency of density (vert. advection) (w/ HIST_TEND)',
'kg/m3/s' )
1063 call file_history_in(advcv_t(:,:,:,
i_momz),
'MOMZ_t_advcv',
'tendency of momentum z (vert. advection) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZHXY')
1064 call file_history_in(advcv_t(:,:,:,
i_momx),
'MOMX_t_advcv',
'tendency of momentum x (vert. advection) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXHY')
1065 call file_history_in(advcv_t(:,:,:,
i_momy),
'MOMY_t_advcv',
'tendency of momentum y (vert. advection) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXYH')
1066 call file_history_in(advcv_t(:,:,:,
i_rhot),
'RHOT_t_advcv',
'tendency of rho*theta (vert. advection) (w/ HIST_TEND)',
'K kg/m3/s' )
1068 call file_history_in(advch_t(:,:,:,
i_dens),
'DENS_t_advch',
'tendency of density (horiz. advection) (w/ HIST_TEND)',
'kg/m3/s' )
1069 call file_history_in(advch_t(:,:,:,
i_momz),
'MOMZ_t_advch',
'tendency of momentum z (horiz. advection) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZHXY')
1070 call file_history_in(advch_t(:,:,:,
i_momx),
'MOMX_t_advch',
'tendency of momentum x (horiz. advection) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXHY')
1071 call file_history_in(advch_t(:,:,:,
i_momy),
'MOMY_t_advch',
'tendency of momentum y (horiz. advection) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXYH')
1072 call file_history_in(advch_t(:,:,:,
i_rhot),
'RHOT_t_advch',
'tendency of rho*theta (horiz. advection) (w/ HIST_TEND)',
'K kg/m3/s' )
1074 call file_history_in(pg_t(:,:,:,1),
'MOMZ_t_pg',
'tendency of momentum z (pressure gradient) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZHXY')
1075 call file_history_in(pg_t(:,:,:,2),
'MOMX_t_pg',
'tendency of momentum x (pressure gradient) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXHY')
1076 call file_history_in(pg_t(:,:,:,3),
'MOMY_t_pg',
'tendency of momentum y (pressure gradient) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXYH')
1078 call file_history_in(wdmp_t(:,:,:),
'MOMZ_t_wdamp',
'tendency of momentum z (Rayleigh damping) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZHXY')
1080 call file_history_in(ddiv_t(:,:,:,1),
'MOMZ_t_ddiv',
'tendency of momentum z (divergence damping) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZHXY')
1081 call file_history_in(ddiv_t(:,:,:,2),
'MOMX_t_ddiv',
'tendency of momentum x (divergence damping) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXHY')
1082 call file_history_in(ddiv_t(:,:,:,3),
'MOMY_t_ddiv',
'tendency of momentum y (divergence damping) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXYH')
1084 call file_history_in(cf_t(:,:,:,1),
'MOMX_t_cf',
'tendency of momentum x (coliolis force) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXHY')
1085 call file_history_in(cf_t(:,:,:,2),
'MOMY_t_cf',
'tendency of momentum y (coliolis force) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXYH')
integer, parameter, public i_rhot
integer, public ihalo
of halo cells: x
procedure(flux_mom), pointer, public atmos_dyn_fvm_fluxx_xvz
procedure(flux_j), pointer, public atmos_dyn_fvm_fluxj23_uyz
integer, public jhalo
of halo cells: y
integer, public ia
of whole cells: x, local, with HALO
integer, parameter, public i_momx
integer, parameter, public i_momz
procedure(flux_j), pointer, public atmos_dyn_fvm_fluxj23_xyw
procedure(flux_phi), pointer, public atmos_dyn_fvm_fluxx_xyz
integer, public iblock
block size for cache blocking: x
procedure(flux_j), pointer, public atmos_dyn_fvm_fluxj13_xyw
integer, public ja
of whole cells: y, local, with HALO
integer, parameter, public i_dens
integer, parameter, public i_momy
procedure(flux_mom), pointer, public atmos_dyn_fvm_fluxx_xyw
integer, public is
start point of inner domain: x, local
procedure(flux_mom), pointer, public atmos_dyn_fvm_fluxy_xyw
integer, public ie
end point of inner domain: x, local
procedure(flux_z), pointer, public atmos_dyn_fvm_fluxz_xvz
integer, parameter, public ydir
module atmosphere / grid / cartesC index
integer, public ke
end point of inner domain: z, local
integer, public je
end point of inner domain: y, local
integer, public ieh
end point of inner domain: x, local (half level)
module Atmosphere / Dynamics common
integer, public ks
start point of inner domain: z, local
integer, public jblock
block size for cache blocking: y
integer, public kmax
of computational cells: z, local
procedure(valuew), pointer, public atmos_dyn_fvm_flux_valuew_z
integer, public js
start point of inner domain: y, local
integer, parameter, public xdir
procedure(flux_j), pointer, public atmos_dyn_fvm_fluxj13_xvz
procedure(flux_z), pointer, public atmos_dyn_fvm_fluxz_uyz
module scale_atmos_dyn_fvm_flux
integer, public ka
of whole cells: z, local, with HALO
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.
procedure(flux_j), pointer, public atmos_dyn_fvm_fluxj13_uyz
procedure(flux_j), pointer, public atmos_dyn_fvm_fluxj23_xvz
integer, public jeh
end point of inner domain: y, local (half level)
procedure(flux_phi), pointer, public atmos_dyn_fvm_fluxz_xyz
integer, parameter, public zdir
procedure(flux_mom), pointer, public atmos_dyn_fvm_fluxx_uyz
procedure(flux_phi), pointer, public atmos_dyn_fvm_fluxy_xyz
procedure(flux_mom), pointer, public atmos_dyn_fvm_fluxy_uyz
procedure(flux_wz), pointer, public atmos_dyn_fvm_fluxz_xyw
procedure(flux_mom), pointer, public atmos_dyn_fvm_fluxy_xvz