177 rdry => const_rdry, &
178 cvdry => const_cvdry, &
179 cpdry => const_cpdry, &
181 grav => const_grav, &
223 real(RP),
intent(out) :: dens_rk(
ka,
ia,
ja)
224 real(RP),
intent(out) :: momz_rk(
ka,
ia,
ja)
225 real(RP),
intent(out) :: momx_rk(
ka,
ia,
ja)
226 real(RP),
intent(out) :: momy_rk(
ka,
ia,
ja)
227 real(RP),
intent(out) :: rhot_rk(
ka,
ia,
ja)
229 real(RP),
intent(out) :: prog_rk(
ka,
ia,
ja,
va)
231 real(RP),
intent(inout) :: mflx_hi(
ka,
ia,
ja,3)
232 real(RP),
intent(out) :: tflx_hi(
ka,
ia,
ja,3)
234 real(RP),
intent(in),
target :: dens0(
ka,
ia,
ja)
235 real(RP),
intent(in),
target :: momz0(
ka,
ia,
ja)
236 real(RP),
intent(in),
target :: momx0(
ka,
ia,
ja)
237 real(RP),
intent(in),
target :: momy0(
ka,
ia,
ja)
238 real(RP),
intent(in),
target :: rhot0(
ka,
ia,
ja)
240 real(RP),
intent(in) :: dens(
ka,
ia,
ja)
241 real(RP),
intent(in) :: momz(
ka,
ia,
ja)
242 real(RP),
intent(in) :: momx(
ka,
ia,
ja)
243 real(RP),
intent(in) :: momy(
ka,
ia,
ja)
244 real(RP),
intent(in) :: rhot(
ka,
ia,
ja)
246 real(RP),
intent(in) :: dens_t(
ka,
ia,
ja)
247 real(RP),
intent(in) :: momz_t(
ka,
ia,
ja)
248 real(RP),
intent(in) :: momx_t(
ka,
ia,
ja)
249 real(RP),
intent(in) :: momy_t(
ka,
ia,
ja)
250 real(RP),
intent(in) :: rhot_t(
ka,
ia,
ja)
252 real(RP),
intent(in) :: prog0(
ka,
ia,
ja,
va)
253 real(RP),
intent(in) :: prog (
ka,
ia,
ja,
va)
255 real(RP),
intent(in) :: dpres0(
ka,
ia,
ja)
256 real(RP),
intent(in) :: rt2p(
ka,
ia,
ja)
257 real(RP),
intent(in) :: corioli(1,
ia,
ja)
258 real(RP),
intent(in) :: num_diff(
ka,
ia,
ja,5,3)
259 real(RP),
intent(in) :: divdmp_coef
260 real(RP),
intent(in) :: ddiv(
ka,
ia,
ja)
262 logical,
intent(in) :: flag_fct_momentum
263 logical,
intent(in) :: flag_fct_t
264 logical,
intent(in) :: flag_fct_along_stream
266 real(RP),
intent(in) :: cdz(
ka)
267 real(RP),
intent(in) :: fdz(
ka-1)
268 real(RP),
intent(in) :: fdx(
ia-1)
269 real(RP),
intent(in) :: fdy(
ja-1)
270 real(RP),
intent(in) :: rcdz(
ka)
271 real(RP),
intent(in) :: rcdx(
ia)
272 real(RP),
intent(in) :: rcdy(
ja)
273 real(RP),
intent(in) :: rfdz(
ka-1)
274 real(RP),
intent(in) :: rfdx(
ia-1)
275 real(RP),
intent(in) :: rfdy(
ja-1)
277 real(RP),
intent(in) :: phi (
ka,
ia,
ja)
278 real(RP),
intent(in) :: gsqrt (
ka,
ia,
ja,7)
279 real(RP),
intent(in) :: j13g (
ka,
ia,
ja,7)
280 real(RP),
intent(in) :: j23g (
ka,
ia,
ja,7)
281 real(RP),
intent(in) :: j33g
282 real(RP),
intent(in) :: mapf (
ia,
ja,2,4)
283 real(RP),
intent(in) :: ref_dens(
ka,
ia,
ja)
284 real(RP),
intent(in) :: ref_rhot(
ka,
ia,
ja)
286 logical,
intent(in) :: bnd_w
287 logical,
intent(in) :: bnd_e
288 logical,
intent(in) :: bnd_s
289 logical,
intent(in) :: bnd_n
291 real(RP),
intent(in) :: dtrk
292 real(RP),
intent(in) :: dt
296 real(RP) :: pott(
ka,
ia,
ja)
297 real(RP) :: dpres(
ka,
ia,
ja)
299 real(RP) :: qflx_hi (
ka,
ia,
ja,3)
300 real(RP) :: qflx_j13(
ka,
ia,
ja)
301 real(RP) :: qflx_j23(
ka,
ia,
ja)
309 real(RP) :: advch_t(
ka,
ia,
ja,5)
310 real(RP) :: advcv_t(
ka,
ia,
ja,5)
311 real(RP) :: ddiv_t(
ka,
ia,
ja,3)
312 real(RP) :: pg_t(
ka,
ia,
ja,3)
313 real(RP) :: cf_t(
ka,
ia,
ja,2)
330 integer :: iis, iie, jjs, jje
340 qflx_hi(:,:,:,:) = undef
341 qflx_j13(:,:,:) = undef
342 qflx_j23(:,:,:) = undef
355 if ( bnd_w ) ifs_off = 0
356 if ( bnd_s ) jfs_off = 0
364 profile_start(
"hevi_pres")
370 call check( __line__, dpres0(k,i,j) )
371 call check( __line__, rt2p(k,i,j) )
372 call check( __line__, rhot(k,i,j) )
373 call check( __line__, ref_rhot(k,i,j) )
375 dpres(k,i,j) = dpres0(k,i,j) + rt2p(k,i,j) * ( rhot(k,i,j) - ref_rhot(k,i,j) )
377 dpres(
ks-1,i,j) = dpres0(
ks-1,i,j) - dens(
ks,i,j) * ( phi(
ks-1,i,j) - phi(
ks+1,i,j) )
378 dpres(
ke+1,i,j) = dpres0(
ke+1,i,j) - dens(
ke,i,j) * ( phi(
ke+1,i,j) - phi(
ke-1,i,j) )
381 profile_stop(
"hevi_pres")
385 profile_start(
"hevi_mflx_z")
390 mflx_hi(
ks-1,i,j,
zdir) = 0.0_rp
393 call check( __line__, momx(k+1,i ,j) )
394 call check( __line__, momx(k+1,i-1,j) )
395 call check( __line__, momx(k ,i ,j) )
396 call check( __line__, momx(k ,i+1,j) )
397 call check( __line__, momy(k+1,i,j) )
398 call check( __line__, momy(k+1,i,j-1) )
399 call check( __line__, momy(k ,i,j) )
400 call check( __line__, momy(k ,i,j-1) )
402 mflx_hi(k,i,j,
zdir) = j13g(k,i,j,
i_xyw) * 0.25_rp / mapf(i,j,2,
i_xy) &
403 * ( momx(k+1,i,j)+momx(k+1,i-1,j) &
404 + momx(k ,i,j)+momx(k ,i-1,j) ) &
405 + j23g(k,i,j,
i_xyw) * 0.25_rp / mapf(i,j,1,
i_xy) &
406 * ( momy(k+1,i,j)+momy(k+1,i,j-1) &
407 + momy(k ,i,j)+momy(k ,i,j-1) ) &
408 + 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)
410 mflx_hi(
ke ,i,j,
zdir) = 0.0_rp
414 k = iundef; i = iundef; j = iundef
416 profile_stop(
"hevi_mflx_z")
418 profile_start(
"hevi_mflx_x")
419 iss = max(iis-1,
is-ifs_off)
427 call check( __line__, gsqrt(k,i,j,
i_uyz) )
428 call check( __line__, momx(k,i,j) )
429 call check( __line__, num_diff(k,i,j,
i_dens,
xdir) )
431 mflx_hi(k,i,j,
xdir) = gsqrt(k,i,j,
i_uyz) / mapf(i,j,2,
i_uy) &
432 * ( momx(k,i,j) + num_diff(k,i,j,
i_dens,
xdir) )
437 k = iundef; i = iundef; j = iundef
439 profile_stop(
"hevi_mflx_x")
443 do j = max(jjs-1,
js-jfs_off), min(jje,
jeh)
447 call check( __line__, gsqrt(k,i,j,
i_xvz) )
448 call check( __line__, momy(k,i,j) )
449 call check( __line__, num_diff(k,i,j,
i_dens,
ydir) )
451 mflx_hi(k,i,j,
ydir) = gsqrt(k,i,j,
i_xvz) / mapf(i,j,1,
i_xv) &
452 * ( momy(k,i,j) + num_diff(k,i,j,
i_dens,
ydir) )
457 k = iundef; i = iundef; j = iundef
461 profile_start(
"hevi_sr")
467 call check( __line__, dens0(k,i,j) )
468 call check( __line__, mflx_hi(k ,i ,j ,
xdir) )
469 call check( __line__, mflx_hi(k ,i-1,j ,
xdir) )
470 call check( __line__, mflx_hi(k ,i ,j ,
ydir) )
471 call check( __line__, mflx_hi(k ,i ,j-1,
ydir) )
472 call check( __line__, dens_t(k,i,j) )
474 advch = - ( ( mflx_hi(k,i,j,
zdir)-mflx_hi(k-1,i ,j,
zdir) ) * rcdz(k) &
475 + ( mflx_hi(k,i,j,
xdir)-mflx_hi(k ,i-1,j,
xdir) ) * rcdx(i) &
476 + ( mflx_hi(k,i,j,
ydir)-mflx_hi(k ,i, j-1,
ydir) ) * rcdy(j) ) &
478 sr(k,i,j) = advch + dens_t(k,i,j)
480 if ( lhist ) advch_t(k,i,j,
i_dens) = advch
486 k = iundef; i = iundef; j = iundef
488 profile_stop(
"hevi_sr")
494 profile_start(
"hevi_momz_qflxhi_z")
497 gsqrt(:,:,:,
i_xyz), j33g, &
501 profile_stop(
"hevi_momz_qflxhi_z")
503 profile_start(
"hevi_momz_qflxj")
506 gsqrt(:,:,:,
i_xyz), j13g(:,:,:,
i_xyz), mapf(:,:,:,
i_xy), &
511 gsqrt(:,:,:,
i_xyz), j23g(:,:,:,
i_xyz), mapf(:,:,:,
i_xy), &
514 profile_stop(
"hevi_momz_qflxj")
517 profile_start(
"hevi_momz_qflxhi_x")
524 profile_stop(
"hevi_momz_qflxhi_x")
527 profile_start(
"hevi_momz_qflxhi_y")
534 profile_stop(
"hevi_momz_qflxhi_y")
537 profile_start(
"hevi_sw")
543 call check( __line__, qflx_hi(k ,i ,j ,
zdir) )
544 call check( __line__, qflx_hi(k-1,i ,j ,
zdir) )
545 call check( __line__, qflx_j13(k ,i ,j) )
546 call check( __line__, qflx_j13(k-1,i ,j) )
547 call check( __line__, qflx_j23(k ,i ,j) )
548 call check( __line__, qflx_j23(k-1,i ,j) )
549 call check( __line__, qflx_hi(k ,i ,j ,
xdir) )
550 call check( __line__, qflx_hi(k ,i-1,j ,
xdir) )
551 call check( __line__, qflx_hi(k ,i ,j ,
ydir) )
552 call check( __line__, qflx_hi(k ,i ,j-1,
ydir) )
553 call check( __line__, ddiv(k ,i,j) )
554 call check( __line__, ddiv(k+1,i,j) )
555 call check( __line__, momz0(k,i,j) )
556 call check( __line__, momz_t(k,i,j) )
558 advcv = - ( qflx_hi(k,i,j,
zdir) - qflx_hi(k-1,i ,j ,
zdir) ) * rfdz(k)
559 advch = - ( ( qflx_j13(k,i,j) - qflx_j13(k-1,i ,j ) &
560 + qflx_j23(k,i,j) - qflx_j23(k-1,i ,j ) ) * rfdz(k) &
561 + ( qflx_hi(k,i,j,
xdir) - qflx_hi(k,i-1,j ,
xdir) ) * rcdx(i) &
562 + ( qflx_hi(k,i,j,
ydir) - qflx_hi(k,i ,j-1,
ydir) ) * rcdy(j) ) &
563 * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy)
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 + div + momz_t(k,i,j)
571 ddiv_t(k,i,j,1) = div
577 profile_stop(
"hevi_sw")
579 k = iundef; i = iundef; j = iundef
590 call check( __line__, rhot(k,i,j) )
591 call check( __line__, dens(k,i,j) )
593 pott(k,i,j) = rhot(k,i,j) / dens(k,i,j)
598 k = iundef; i = iundef; j = iundef
603 mflx_hi(:,:,:,
zdir), pott, gsqrt(:,:,:,
i_xyw), &
610 mflx_hi(:,:,:,
xdir), pott, gsqrt(:,:,:,
i_uyz), &
617 mflx_hi(:,:,:,
ydir), pott, gsqrt(:,:,:,
i_xvz), &
623 profile_start(
"hevi_st")
629 call check( __line__, tflx_hi(k ,i ,j ,
zdir) )
630 call check( __line__, tflx_hi(k-1,i ,j ,
zdir) )
631 call check( __line__, tflx_hi(k ,i ,j ,
xdir) )
632 call check( __line__, tflx_hi(k ,i-1,j ,
xdir) )
633 call check( __line__, tflx_hi(k ,i ,j ,
ydir) )
634 call check( __line__, tflx_hi(k ,i ,j-1,
ydir) )
635 call check( __line__, rhot_t(k,i,j) )
637 advch = - ( ( tflx_hi(k,i,j,
zdir) - tflx_hi(k-1,i ,j ,
zdir) ) * rcdz(k) &
638 + ( tflx_hi(k,i,j,
xdir) - tflx_hi(k ,i-1,j ,
xdir) ) * rcdx(i) &
639 + ( tflx_hi(k,i,j,
ydir) - tflx_hi(k ,i ,j-1,
ydir) ) * rcdy(j) ) &
641 st(k,i,j) = advch + rhot_t(k,i,j)
644 advch_t(k,i,j,
i_rhot) = advch
651 k = iundef; i = iundef; j = iundef
653 profile_stop(
"hevi_st")
657 profile_start(
"hevi_solver")
666 momz(:,i,j), pott(:,i,j), gsqrt(:,i,j,
i_xyz), &
670 a(k,i,j) = dtrk**2 * j33g * rcdz(k) * rt2p(k,i,j) * j33g / gsqrt(k,i,j,
i_xyz)
672 b = grav * dtrk**2 * j33g / ( cdz(
ks+1) + cdz(
ks) )
673 f1(
ks,i,j) = - ( pt(
ks+1,i,j) * rfdz(
ks) * a(
ks+1,i,j) + b ) / gsqrt(
ks,i,j,
i_xyw)
674 f2(
ks,i,j) = 1.0_rp + ( pt(
ks ,i,j) * rfdz(
ks) * ( a(
ks+1,i,j)+a(
ks,i,j) ) ) / gsqrt(
ks,i,j,
i_xyw)
676 b = grav * dtrk**2 * j33g / ( cdz(k+1) + cdz(k) )
677 f1(k,i,j) = - ( pt(k+1,i,j) * rfdz(k) * a(k+1,i,j) + b ) / gsqrt(k,i,j,
i_xyw)
678 f2(k,i,j) = 1.0_rp + ( pt(k ,i,j) * rfdz(k) * ( a(k+1,i,j)+a(k,i,j) ) ) / gsqrt(k,i,j,
i_xyw)
679 f3(k,i,j) = - ( pt(k-1,i,j) * rfdz(k) * a(k,i,j) - b ) / gsqrt(k,i,j,
i_xyw)
681 b = grav * dtrk**2 * j33g / ( cdz(
ke) + cdz(
ke-1) )
682 f2(
ke-1,i,j) = 1.0_rp + ( pt(
ke-1,i,j) * rfdz(
ke-1) * ( a(
ke,i,j)+a(
ke-1,i,j) ) ) / gsqrt(
ke-1,i,j,
i_xyw)
683 f3(
ke-1,i,j) = - ( pt(
ke-2,i,j) * rfdz(
ke-1) * a(
ke-1,i,j) - b ) / gsqrt(
ke-1,i,j,
i_xyw)
685 pg = - ( dpres(k+1,i,j) + rt2p(k+1,i,j)*dtrk*st(k+1,i,j) &
686 - dpres(k ,i,j) - rt2p(k ,i,j)*dtrk*st(k ,i,j) ) &
687 * rfdz(k) * j33g / gsqrt(k,i,j,
i_xyw) &
689 * ( f2h(k,1,
i_xyz) * ( dens(k+1,i,j) - ref_dens(k+1,i,j) + sr(k+1,i,j) * dtrk ) &
690 + f2h(k,2,
i_xyz) * ( dens(k ,i,j) - ref_dens(k ,i,j) + sr(k ,i,j) * dtrk ) )
691 c(k-
ks+1,i,j) = momz(k,i,j) + dtrk * ( pg + sw(k,i,j) )
693 if ( lhist ) pg_t(k,i,j,1) = pg
698 call solve_bicgstab( &
700 f1(:,i,j), f2(:,i,j), f3(:,i,j) )
701 #elif defined(HEVI_LAPACK) 707 f1(:,i,j), f2(:,i,j), f3(:,i,j) )
711 f1(:,i,j), f2(:,i,j), f3(:,i,j) )
715 #ifdef DEBUG_HEVI2HEVE 717 c(k-
ks+1,i,j) = momz(k,i,j)
718 mflx_hi(k,i,j,
zdir) = mflx_hi(k,i,j,
zdir) &
719 + j33g * momz(k,i,j) / ( mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) )
720 momz_rk(k,i,j) = momz0(k,i,j) &
722 - j33g * ( dpres(k+1,i,j)-dpres(k,i,j) ) * rfdz(k) / gsqrt(k,i,j,
i_xyw) &
723 - 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)) ) &
727 mflx_hi(k,i,j,
zdir) = mflx_hi(k,i,j,
zdir) &
728 + j33g * c(k-
ks+1,i,j) / ( mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) )
730 momz_rk(k,i,j) = momz0(k,i,j) &
731 + ( c(k-
ks+1,i,j) - momz(k,i,j) )
734 momz_rk(
ks-1,i,j) = 0.0_rp
735 momz_rk(
ke ,i,j) = 0.0_rp
738 advcv = - c(1,i,j) * j33g * rcdz(
ks) / gsqrt(
ks,i,j,
i_xyz)
739 dens_rk(
ks,i,j) = dens0(
ks,i,j) + dtrk * ( advcv + sr(
ks,i,j) )
741 if ( lhist ) advcv_t(
ks,i,j,
i_dens) = advcv
743 advcv = - c(1,i,j)*pt(
ks,i,j) * j33g * rcdz(
ks) / gsqrt(
ks,i,j,
i_xyz)
744 rhot_rk(
ks,i,j) = rhot0(
ks,i,j) + dtrk * ( advcv + st(
ks,i,j) )
746 if ( lhist ) advcv_t(
ks,i,j,
i_rhot) = advcv
749 advcv = - ( c(k-
ks+1,i,j) - c(k-
ks,i,j) ) &
750 * j33g * rcdz(k) / gsqrt(k,i,j,
i_xyz)
751 dens_rk(k,i,j) = dens0(k,i,j) + dtrk * ( advcv + sr(k,i,j) )
753 if ( lhist ) advcv_t(k,i,j,
i_dens) = advcv
755 advcv = - ( c(k-
ks+1,i,j)*pt(k,i,j) - c(k-
ks,i,j)*pt(k-1,i,j) ) &
756 * j33g * rcdz(k) / gsqrt(k,i,j,
i_xyz)
757 rhot_rk(k,i,j) = rhot0(k,i,j) + dtrk * ( advcv + st(k,i,j) )
759 if ( lhist ) advcv_t(k,i,j,
i_rhot) = advcv
763 dens_rk(
ke,i,j) = dens0(
ke,i,j) + dtrk * ( advcv + sr(
ke,i,j) )
765 if ( lhist ) advcv_t(
ke,i,j,
i_dens) = advcv
767 advcv = c(
ke-
ks,i,j) * pt(
ke-1,i,j) * j33g * rcdz(
ke) / gsqrt(
ke,i,j,
i_xyz)
768 rhot_rk(
ke,i,j) = rhot0(
ke,i,j) + dtrk * ( advcv + st(
ke,i,j) )
770 if ( lhist ) advcv_t(
ke,i,j,
i_rhot) = advcv
774 call check_equation( &
776 dens(:,i,j), momz(:,i,j), rhot(:,i,j), dpres(:,i,j), &
778 sr(:,i,j), sw(:,i,j), st(:,i,j), &
779 j33g, gsqrt(:,i,j,:), &
787 k = iundef; i = iundef; j = iundef
790 profile_stop(
"hevi_solver")
795 profile_start(
"hevi_momx")
799 gsqrt(:,:,:,
i_uyw), j33g, &
805 gsqrt(:,:,:,
i_uyz), j13g(:,:,:,
i_uyw), mapf(:,:,:,
i_uy), &
810 gsqrt(:,:,:,
i_uyz), j23g(:,:,:,
i_uyw), mapf(:,:,:,
i_uy), &
838 call check( __line__, qflx_hi(k ,i ,j ,
zdir) )
839 call check( __line__, qflx_hi(k-1,i ,j ,
zdir) )
840 call check( __line__, qflx_hi(k ,i ,j ,
xdir) )
841 call check( __line__, qflx_hi(k ,i-1,j ,
xdir) )
842 call check( __line__, qflx_hi(k ,i ,j ,
ydir) )
843 call check( __line__, qflx_hi(k ,i ,j-1,
ydir) )
844 call check( __line__, dpres(k,i+1,j) )
845 call check( __line__, dpres(k,i ,j) )
846 call check( __line__, corioli(1,i ,j) )
847 call check( __line__, corioli(1,i+1,j) )
848 call check( __line__, momy(k,i ,j ) )
849 call check( __line__, momy(k,i+1,j ) )
850 call check( __line__, momy(k,i ,j-1) )
851 call check( __line__, momy(k,i+1,j-1) )
852 call check( __line__, ddiv(k,i+1,j) )
853 call check( __line__, ddiv(k,i ,j) )
854 call check( __line__, momx0(k,i,j) )
856 advcv = - ( qflx_hi(k,i,j,
zdir) - qflx_hi(k-1,i ,j ,
zdir) ) * rcdz(k)
857 advch = - ( ( qflx_j13(k,i,j) - qflx_j13(k-1,i ,j ) &
858 + qflx_j23(k,i,j) - qflx_j23(k-1,i ,j ) ) * rfdz(k) &
859 + ( qflx_hi(k,i,j,
xdir) - qflx_hi(k ,i-1,j ,
xdir) ) * rfdx(i) &
860 + ( qflx_hi(k,i,j,
ydir) - qflx_hi(k ,i ,j-1,
ydir) ) * rcdy(j) ) &
861 * mapf(i,j,1,
i_uy) * mapf(i,j,2,
i_uy)
862 pg = ( ( gsqrt(k,i+1,j,
i_xyz) * dpres(k,i+1,j) &
863 - gsqrt(k,i ,j,
i_xyz) * dpres(k,i ,j) &
865 + ( j13g(k ,i,j,
i_uyw) &
866 * 0.5_rp * ( f2h(k,1,
i_uyz) * ( dpres(k+1,i+1,j)+dpres(k+1,i,j) ) &
867 + f2h(k,2,
i_uyz) * ( dpres(k ,i+1,j)+dpres(k ,i,j) ) ) &
868 - j13g(k-1,i,j,
i_uyw) &
869 * 0.5_rp * ( f2h(k,1,
i_uyz) * ( dpres(k ,i+1,j)+dpres(k ,i,j) ) &
870 + f2h(k,2,
i_uyz) * ( dpres(k-1,i+1,j)+dpres(k-1,i,j) ) ) &
873 cf = 0.125_rp * ( corioli(1,i+1,j )+corioli(1,i,j ) ) &
874 * ( momy(k,i+1,j )+momy(k,i,j ) &
875 + momy(k,i+1,j-1)+momy(k,i,j-1) ) &
876 + 0.25_rp * mapf(i,j,1,
i_uy) * mapf(i,j,2,
i_uy) &
877 * ( momy(k,i,j) + momy(k,i,j-1) + momy(k,i+1,j) + momy(k,i+1,j-1) ) &
878 * ( ( momy(k,i,j) + momy(k,i,j-1) + momy(k,i+1,j) + momy(k,i+1,j-1) ) * 0.25_rp &
879 * ( 1.0_rp/mapf(i+1,j,2,
i_xy) - 1.0_rp/mapf(i,j,2,
i_xy) ) * rcdx(i) &
881 * ( 1.0_rp/mapf(i,j,1,
i_uv) - 1.0_rp/mapf(i,j-1,1,
i_uv) ) * rfdy(j) ) &
882 * 2.0_rp / ( dens(k,i+1,j) + dens(k,i,j) )
883 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) ) &
884 * mapf(i,j,1,
i_uy) * mapf(i,j,2,
i_uy) * fdx(i)
885 momx_rk(k,i,j) = momx0(k,i,j) &
886 + dtrk * ( ( advcv + advch - pg ) / gsqrt(k,i,j,
i_uyz) +
cf + div + momx_t(k,i,j) )
891 pg_t(k,i,j,2) = - pg / gsqrt(k,i,j,
i_uyz)
893 ddiv_t(k,i,j,2) = div
899 profile_stop(
"hevi_momx")
901 k = iundef; i = iundef; j = iundef
905 profile_start(
"hevi_momy")
909 gsqrt(:,:,:,
i_xvw), j33g, &
915 gsqrt(:,:,:,
i_xvz), j13g(:,:,:,
i_xvw), mapf(:,:,:,
i_xv), &
920 gsqrt(:,:,:,
i_xvz), j23g(:,:,:,
i_xvw), mapf(:,:,:,
i_xv), &
943 do j = jjs, min(jje,
jeh)
947 call check( __line__, qflx_hi(k ,i ,j ,
zdir) )
948 call check( __line__, qflx_hi(k-1,i ,j ,
zdir) )
949 call check( __line__, qflx_hi(k ,i ,j ,
xdir) )
950 call check( __line__, qflx_hi(k ,i-1,j ,
xdir) )
951 call check( __line__, qflx_hi(k ,i ,j ,
ydir) )
952 call check( __line__, qflx_hi(k ,i ,j-1,
ydir) )
953 call check( __line__, dpres(k,i,j ) )
954 call check( __line__, dpres(k,i,j+1) )
955 call check( __line__, corioli(1,i,j ) )
956 call check( __line__, corioli(1,i,j+1) )
957 call check( __line__, momx(k,i ,j ) )
958 call check( __line__, momx(k,i ,j+1) )
959 call check( __line__, momx(k,i-1,j ) )
960 call check( __line__, momx(k,i-1,j+1) )
961 call check( __line__, ddiv(k,i,j+1) )
962 call check( __line__, ddiv(k,i,j ) )
963 call check( __line__, momy_t(k,i,j) )
964 call check( __line__, momy0(k,i,j) )
966 advcv = - ( qflx_hi(k,i,j,
zdir) - qflx_hi(k-1,i ,j ,
zdir) ) * rcdz(k)
967 advch = - ( ( qflx_j13(k,i,j) - qflx_j13(k-1,i ,j ) &
968 + qflx_j23(k,i,j) - qflx_j23(k-1,i ,j ) ) * rcdz(k) &
969 + ( qflx_hi(k,i,j,
xdir) - qflx_hi(k ,i-1,j ,
xdir) ) * rcdx(i) &
970 + ( qflx_hi(k,i,j,
ydir) - qflx_hi(k ,i ,j-1,
ydir) ) * rfdy(j) ) &
971 * mapf(i,j,1,
i_xv) * mapf(i,j,2,
i_xv)
972 pg = ( ( gsqrt(k,i,j+1,
i_xyz) * dpres(k,i,j+1) &
973 - gsqrt(k,i,j ,
i_xyz) * dpres(k,i,j ) &
975 + ( j23g(k ,i,j,
i_xvw) &
976 * 0.5_rp * ( f2h(k ,1,
i_xvz) * ( dpres(k+1,i,j+1)+dpres(k+1,i,j) ) &
977 + f2h(k ,2,
i_xvz) * ( dpres(k ,i,j+1)+dpres(k ,i,j) ) ) &
978 - j23g(k-1,i,j,
i_xvw) &
979 * 0.5_rp * ( f2h(k-1,1,
i_xvz) * ( dpres(k ,i,j+1)+dpres(k ,i,j) ) &
980 + f2h(k-1,2,
i_xvz) * ( dpres(k-1,i,j+1)+dpres(k-1,i,j) ) ) &
983 cf = - 0.125_rp * ( corioli(1,i ,j+1)+corioli(1,i ,j) ) &
984 * ( momx(k,i ,j+1)+momx(k,i ,j) &
985 + momx(k,i-1,j+1)+momx(k,i-1,j) ) &
986 - 0.25_rp * mapf(i,j,1,
i_xv) * mapf(i,j,2,
i_xv) &
987 * ( momx(k,i,j) + momx(k,i-1,j) + momx(k,i,j+1) + momx(k,i-1,j+1) ) &
989 * ( 1.0_rp/mapf(i,j,2,
i_uv) - 1.0_rp/mapf(i-1,j,2,
i_uv) ) * rcdx(i) &
990 - 0.25_rp * ( momx(k,i,j)+momx(k,i-1,j)+momx(k,i,j+1)+momx(k,i-1,j+1) ) &
991 * ( 1.0_rp/mapf(i,j+1,1,
i_xy) - 1.0_rp/mapf(i,j,1,
i_xy) ) * rfdy(j) ) &
992 * 2.0_rp / ( dens(k,i,j+1) + dens(k,i,j) )
993 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) ) &
994 * mapf(i,j,1,
i_xv) * mapf(i,j,2,
i_xv) * fdy(j)
995 momy_rk(k,i,j) = momy0(k,i,j) &
996 + dtrk * ( ( advcv + advch - pg ) / gsqrt(k,i,j,
i_xvz) +
cf + div + momy_t(k,i,j) )
1000 advch_t(k,i,j,
i_momy) = advch / gsqrt(k,i,j,
i_xvz)
1001 pg_t(k,i,j,3) = - pg / gsqrt(k,i,j,
i_xvz)
1003 ddiv_t(k,i,j,3) = div
1009 profile_stop(
"hevi_momy")
1011 k = iundef; i = iundef; j = iundef
1023 call hist_in(advcv_t(:,:,:,
i_dens),
'DENS_t_advcv',
'tendency of density (vert. advection)',
'kg/m3/s' )
1024 call hist_in(advcv_t(:,:,:,
i_momz),
'MOMZ_t_advcv',
'tendency of momentum z (vert. advection)',
'kg/m2/s2', zdim=
'half')
1025 call hist_in(advcv_t(:,:,:,
i_momx),
'MOMX_t_advcv',
'tendency of momentum x (vert. advection)',
'kg/m2/s2', xdim=
'half')
1026 call hist_in(advcv_t(:,:,:,
i_momy),
'MOMY_t_advcv',
'tendency of momentum y (vert. advection)',
'kg/m2/s2', ydim=
'half')
1027 call hist_in(advcv_t(:,:,:,
i_rhot),
'RHOT_t_advcv',
'tendency of rho*theta (vert. advection)',
'K kg/m3/s' )
1029 call hist_in(advch_t(:,:,:,
i_dens),
'DENS_t_advch',
'tendency of density (horiz. advection)',
'kg/m3/s' )
1030 call hist_in(advch_t(:,:,:,
i_momz),
'MOMZ_t_advch',
'tendency of momentum z (horiz. advection)',
'kg/m2/s2', zdim=
'half')
1031 call hist_in(advch_t(:,:,:,
i_momx),
'MOMX_t_advch',
'tendency of momentum x (horiz. advection)',
'kg/m2/s2', xdim=
'half')
1032 call hist_in(advch_t(:,:,:,
i_momy),
'MOMY_t_advch',
'tendency of momentum y (horiz. advection)',
'kg/m2/s2', ydim=
'half')
1033 call hist_in(advch_t(:,:,:,
i_rhot),
'RHOT_t_advch',
'tendency of rho*theta (horiz. advection)',
'K kg/m3/s' )
1035 call hist_in(pg_t(:,:,:,1),
'MOMZ_t_pg',
'tendency of momentum z (pressure gradient)',
'kg/m2/s2', zdim=
'half')
1036 call hist_in(pg_t(:,:,:,2),
'MOMX_t_pg',
'tendency of momentum x (pressure gradient)',
'kg/m2/s2', xdim=
'half')
1037 call hist_in(pg_t(:,:,:,3),
'MOMY_t_pg',
'tendency of momentum y (pressure gradient)',
'kg/m2/s2', ydim=
'half')
1039 call hist_in(ddiv_t(:,:,:,1),
'MOMZ_t_ddiv',
'tendency of momentum z (divergence damping)',
'kg/m2/s2', zdim=
'half')
1040 call hist_in(ddiv_t(:,:,:,2),
'MOMX_t_ddiv',
'tendency of momentum x (divergence damping)',
'kg/m2/s2', xdim=
'half')
1041 call hist_in(ddiv_t(:,:,:,3),
'MOMY_t_ddiv',
'tendency of momentum y (divergence damping)',
'kg/m2/s2', ydim=
'half')
1043 call hist_in(cf_t(:,:,:,1),
'MOMX_t_cf',
'tendency of momentum x (coliolis force)',
'kg/m2/s2', xdim=
'half')
1044 call hist_in(cf_t(:,:,:,2),
'MOMY_t_cf',
'tendency of momentum y (coliolis force)',
'kg/m2/s2', ydim=
'half')
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
procedure(flux_mom), pointer, public atmos_dyn_fvm_fluxx_xvz
procedure(flux_j), pointer, public atmos_dyn_fvm_fluxj23_uyz
integer, public iblock
block size for cache blocking: x
integer, parameter, public i_momx
integer, parameter, public zdir
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, parameter, public ydir
integer, public ke
end point of inner domain: z, local
procedure(flux_j), pointer, public atmos_dyn_fvm_fluxj13_xyw
integer, parameter, public xdir
integer, parameter, public i_dens
integer, parameter, public i_momy
procedure(flux_mom), pointer, public atmos_dyn_fvm_fluxx_xyw
procedure(flux_mom), pointer, public atmos_dyn_fvm_fluxy_xyw
integer, public ia
of x whole cells (local, with HALO)
procedure(flux_z), pointer, public atmos_dyn_fvm_fluxz_xvz
integer, public ka
of z whole cells (local, with HALO)
integer, public jblock
block size for cache blocking: y
integer, public kmax
of computational cells: z
integer, public jhalo
of halo cells: y
integer, public js
start point of inner domain: y, local
module Atmosphere / Dynamics common
procedure(valuew), pointer, public atmos_dyn_fvm_flux_valuew_z
integer, public ks
start point of inner domain: z, local
procedure(flux_j), pointer, public atmos_dyn_fvm_fluxj13_xvz
integer, public jeh
end point of inner domain: y, local (half level)
integer, public ieh
end point of inner domain: x, local (half level)
integer, public ie
end point of inner domain: x, local
procedure(flux_z), pointer, public atmos_dyn_fvm_fluxz_uyz
module scale_atmos_dyn_fvm_flux
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
procedure(flux_phi), pointer, public atmos_dyn_fvm_fluxz_xyz
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
integer, public ihalo
of halo cells: x
procedure(flux_mom), pointer, public atmos_dyn_fvm_fluxy_xvz
integer, public ja
of y whole cells (local, with HALO)