93 real(RP),
intent(out) :: s33_c (
ka,
ia,
ja)
94 real(RP),
intent(out) :: s11_c (
ka,
ia,
ja)
95 real(RP),
intent(out) :: s22_c (
ka,
ia,
ja)
96 real(RP),
intent(out) :: s31_c (
ka,
ia,
ja)
97 real(RP),
intent(out) :: s12_c (
ka,
ia,
ja)
98 real(RP),
intent(out) :: s23_c (
ka,
ia,
ja)
99 real(RP),
intent(out) :: s12_z (
ka,
ia,
ja)
100 real(RP),
intent(out) :: s23_x (
ka,
ia,
ja)
101 real(RP),
intent(out) :: s31_y (
ka,
ia,
ja)
102 real(RP),
intent(out) :: s2 (
ka,
ia,
ja)
104 real(RP),
intent(in) :: dens (
ka,
ia,
ja)
105 real(RP),
intent(in) :: momz (
ka,
ia,
ja)
106 real(RP),
intent(in) :: momx (
ka,
ia,
ja)
107 real(RP),
intent(in) :: momy (
ka,
ia,
ja)
109 real(RP),
intent(in) :: gsqrt (
ka,
ia,
ja,7)
110 real(RP),
intent(in) :: j13g (
ka,
ia,
ja,7)
111 real(RP),
intent(in) :: j23g (
ka,
ia,
ja,7)
112 real(RP),
intent(in) :: j33g
113 real(RP),
intent(in) :: mapf (
ia,
ja,2,4)
116 real(RP) :: velz_c (
ka,
ia,
ja)
117 real(RP) :: velz_xy(
ka,
ia,
ja)
118 real(RP) :: velx_c (
ka,
ia,
ja)
119 real(RP) :: velx_yz(
ka,
ia,
ja)
120 real(RP) :: vely_c (
ka,
ia,
ja)
121 real(RP) :: vely_zx(
ka,
ia,
ja)
124 real(RP) :: work_v(
ka,
ia,
ja)
125 real(RP) :: work_z(
ka,
ia,
ja)
126 real(RP) :: work_x(
ka,
ia,
ja)
127 real(RP) :: work_y(
ka,
ia,
ja)
129 integer :: iis, iie, jjs, jje
144 velz_c(:,:,:) = undef
145 velz_xy(:,:,:) = undef
146 velx_c(:,:,:) = undef
147 velx_yz(:,:,:) = undef
148 vely_c(:,:,:) = undef
149 vely_zx(:,:,:) = undef
151 work_v(:,:,:) = undef
152 work_z(:,:,:) = undef
153 work_x(:,:,:) = undef
154 work_y(:,:,:) = undef
162 call check( __line__, momz(k,i,j) )
163 call check( __line__, dens(k+1,i,j) )
164 call check( __line__, dens(k,i,j) )
166 velz_xy(k,i,j) = 2.0_rp * momz(k,i,j) / ( dens(k+1,i,j)+dens(k,i,j) )
171 i = iundef; j = iundef; k = iundef
175 velz_xy(
ke,i,j) = 0.0_rp
179 i = iundef; j = iundef; k = iundef
185 call check( __line__, momz(k,i,j) )
186 call check( __line__, momz(k-1,i,j) )
187 call check( __line__, dens(k,i,j) )
189 velz_c(k,i,j) = 0.5_rp * ( momz(k,i,j) + momz(k-1,i,j) ) / dens(k,i,j)
194 i = iundef; j = iundef; k = iundef
199 call check( __line__, momz(
ks,i,j) )
200 call check( __line__, dens(
ks,i,j) )
202 velz_c(
ks,i,j) = 0.5_rp * momz(
ks,i,j) / dens(
ks,i,j)
207 i = iundef; j = iundef; k = iundef
214 call check( __line__, momx(k,i,j) )
215 call check( __line__, dens(k,i+1,j) )
216 call check( __line__, dens(k,i,j) )
218 velx_yz(k,i,j) = 2.0_rp * momx(k,i,j) / ( dens(k,i+1,j)+dens(k,i,j) )
223 i = iundef; j = iundef; k = iundef
227 velx_yz(
ke+1,i,j) = 0.0_rp
231 i = iundef; j = iundef; k = iundef
237 call check( __line__, momx(k,i,j) )
238 call check( __line__, momx(k,i-1,j) )
239 call check( __line__, dens(k,i,j) )
241 velx_c(k,i,j) = 0.5_rp * ( momx(k,i,j) + momx(k,i-1,j) ) / dens(k,i,j)
246 i = iundef; j = iundef; k = iundef
253 call check( __line__, momy(k,i,j) )
254 call check( __line__, dens(k,i,j+1) )
255 call check( __line__, dens(k,i,j) )
257 vely_zx(k,i,j) = 2.0_rp * momy(k,i,j) / ( dens(k,i,j+1)+dens(k,i,j) )
262 i = iundef; j = iundef; k = iundef
266 vely_zx(
ke+1,i,j) = 0.0_rp
270 i = iundef; j = iundef; k = iundef
276 call check( __line__, momy(k,i,j) )
277 call check( __line__, momy(k,i,j-1) )
278 call check( __line__, dens(k,i,j) )
280 vely_c(k,i,j) = 0.5_rp * ( momy(k,i,j) + momy(k,i,j-1) ) / dens(k,i,j)
285 i = iundef; j = iundef; k = iundef
294 work_z(:,:,:) = undef; work_x(:,:,:) = undef; work_y(:,:,:) = undef; work_v(:,:,:) = undef
304 call check( __line__, velz_c(k,i+1,j) )
305 call check( __line__, velz_c(k,i,j) )
307 work_x(k,i,j) = 0.5_rp * ( velz_c(k,i+1,j) + velz_c(k,i,j) )
312 i = iundef; j = iundef; k = iundef
316 work_x(
ke+1,i,j) = 0.0_rp
320 i = iundef; j = iundef; k = iundef
327 call check( __line__, velz_c(k,i,j+1) )
328 call check( __line__, velz_c(k,i,j) )
330 work_y(k,i,j) = 0.5_rp * ( velz_c(k,i,j+1) + velz_c(k,i,j) )
335 i = iundef; j = iundef; k = iundef
339 work_y(
ke+1,i,j) = 0.0_rp
343 i = iundef; j = iundef; k = iundef
352 call check( __line__, velz_xy(k,i,j) )
353 call check( __line__, velz_xy(k-1,i,j) )
354 call check( __line__, rcdz(k) )
356 s33_c(k,i,j) = ( velz_xy(k,i,j) - velz_xy(k-1,i,j) ) * rcdz(k) &
357 * j33g / gsqrt(k,i,j,
i_xyz)
362 i = iundef; j = iundef; k = iundef
367 call check( __line__, velz_xy(
ks,i,j) )
368 call check( __line__, gsqrt(
ks,i,j,
i_xyz) )
369 call check( __line__, rcdz(
ks) )
371 s33_c(
ks,i,j) = velz_xy(
ks,i,j) * rcdz(
ks) &
376 i = iundef; j = iundef; k = iundef
385 call check( __line__, velz_c(k,i+1,j) )
386 call check( __line__, velz_c(k,i-1,j) )
387 call check( __line__, gsqrt(k,i+1,j,
i_xyz) )
388 call check( __line__, gsqrt(k,i-1,j,
i_xyz) )
389 call check( __line__, velz_xy(k,i,j) )
390 call check( __line__, velz_xy(k-1,i,j) )
391 call check( __line__, j13g(k,i,j,
i_xyw) )
392 call check( __line__, j13g(k-1,i,j,
i_xyw) )
393 call check( __line__, fdx(i) )
394 call check( __line__, fdx(i-1) )
396 s31_c(k,i,j) = 0.5_rp * ( &
397 ( gsqrt(k,i+1,j,
i_xyz)*velz_c(k,i+1,j) - gsqrt(k,i-1,j,
i_xyz)*velz_c(k,i-1,j) ) / ( fdx(i) + fdx(i-1) ) &
398 + ( j13g(k,i,j,
i_xyw)*velz_xy(k,i,j) - j13g(k-1,i,j,
i_xyw)*velz_xy(k-1,i,j) ) * rcdz(k) &
405 i = iundef; j = iundef; k = iundef
410 call check( __line__, velz_c(
ks,i+1,j) )
411 call check( __line__, velz_c(
ks,i-1,j) )
412 call check( __line__, gsqrt(
ks,i+1,j,
i_xyz) )
413 call check( __line__, gsqrt(
ks,i-1,j,
i_xyz) )
414 call check( __line__, velz_xy(
ks,i,j) )
415 call check( __line__, j13g(
ks,i,j,
i_xyw) )
416 call check( __line__, velz_c(
ke,i+1,j) )
417 call check( __line__, velz_c(
ke,i-1,j) )
418 call check( __line__, gsqrt(
ke,i+1,j,
i_xyz) )
419 call check( __line__, gsqrt(
ke,i-1,j,
i_xyz) )
420 call check( __line__, velz_xy(
ke,i,j) )
421 call check( __line__, j13g(
ke,i,j,
i_xyw) )
422 call check( __line__, fdx(i) )
423 call check( __line__, fdx(i-1) )
425 s31_c(
ks,i,j) = 0.5_rp * ( &
426 ( gsqrt(
ks,i+1,j,
i_xyz)*velz_c(
ks,i+1,j) - gsqrt(
ks,i-1,j,
i_xyz)*velz_c(
ks,i-1,j) ) / ( fdx(i) + fdx(i-1) ) &
427 + ( j13g(
ks,i,j,
i_xyw)*velz_xy(
ks,i,j) ) * rcdz(
ks) &
429 s31_c(
ke,i,j) = 0.5_rp * ( &
430 ( gsqrt(
ke,i+1,j,
i_xyz)*velz_c(
ke,i+1,j) - gsqrt(
ke,i-1,j,
i_xyz)*velz_c(
ke,i-1,j) ) / ( fdx(i) + fdx(i-1) ) &
431 - ( j13g(
ke-1,i,j,
i_xyw)*velz_xy(
ke-1,i,j) ) * rcdz(
ke) &
436 i = iundef; j = iundef; k = iundef
444 call check( __line__, velz_xy(k,i+1,j) )
445 call check( __line__, velz_xy(k,i,j) )
446 call check( __line__, rfdx(i) )
448 s31_y(k,i,j) = 0.5_rp * ( &
449 ( gsqrt(k,i+1,j,
i_xyw)*velz_xy(k,i+1,j) - gsqrt(k,i,j,
i_xyw)*velz_xy(k,i,j) ) * rfdx(i) &
450 + ( j13g(k+1,i,j,
i_uyz)*work_x(k+1,i,j) - j13g(k,i,j,
i_uyz)*work_x(k,i,j)) * rfdz(k) &
456 i = iundef; j = iundef; k = iundef
465 call check( __line__, velz_c(k,i,j+1) )
466 call check( __line__, velz_c(k,i,j-1) )
467 call check( __line__, gsqrt(k,i,j+1,
i_xyz) )
468 call check( __line__, gsqrt(k,i,j-1,
i_xyz) )
469 call check( __line__, velz_xy(k,i,j) )
470 call check( __line__, velz_xy(k-1,i,j) )
471 call check( __line__, j23g(k,i,j,
i_xyw) )
472 call check( __line__, j23g(k-1,i,j,
i_xyw) )
473 call check( __line__, fdy(j) )
474 call check( __line__, fdy(j-1) )
476 s23_c(k,i,j) = 0.5_rp * ( &
477 ( gsqrt(k,i,j+1,
i_xyz)*velz_c(k,i,j+1) - gsqrt(k,i,j-1,
i_xyz)*velz_c(k,i,j-1) ) / ( fdy(j) + fdy(j-1) ) &
478 + ( j23g(k,i,j,
i_xyw)*velz_xy(k,i,j) - j23g(k-1,i,j,
i_xyw)*velz_xy(k-1,i,j) ) * rcdz(k) &
484 i = iundef; j = iundef; k = iundef
489 call check( __line__, velz_c(
ks,i,j+1) )
490 call check( __line__, velz_c(
ks,i,j-1) )
491 call check( __line__, gsqrt(
ks,i,j+1,
i_xyz) )
492 call check( __line__, gsqrt(
ks,i,j-1,
i_xyz) )
493 call check( __line__, velz_xy(
ks,i,j) )
494 call check( __line__, j23g(
ks,i,j,
i_xyw) )
495 call check( __line__, velz_c(
ke,i,j+1) )
496 call check( __line__, velz_c(
ke,i,j-1) )
497 call check( __line__, gsqrt(
ke,i,j+1,
i_xyz) )
498 call check( __line__, gsqrt(
ke,i,j-1,
i_xyz) )
499 call check( __line__, velz_xy(
ke,i,j) )
500 call check( __line__, j23g(
ke,i,j,
i_xyw) )
501 call check( __line__, fdy(j) )
502 call check( __line__, fdy(j-1) )
504 s23_c(
ks,i,j) = 0.5_rp * ( &
505 ( gsqrt(
ks,i,j+1,
i_xyz)*velz_c(
ks,i,j+1) - gsqrt(
ks,i,j-1,
i_xyz)*velz_c(
ks,i,j-1) ) / ( fdy(j) + fdy(j-1) ) &
506 + ( j23g(
ks,i,j,
i_xyw)*velz_xy(
ks,i,j) ) * rcdz(
ks) &
508 s23_c(
ke,i,j) = 0.5_rp * ( &
509 ( gsqrt(
ke,i,j+1,
i_xyz)*velz_c(
ke,i,j+1) - gsqrt(
ke,i,j-1,
i_xyz)*velz_c(
ke,i,j-1) ) / ( fdy(j) + fdy(j-1) ) &
510 - ( j23g(
ke-1,i,j,
i_xyw)*velz_xy(
ke-1,i,j) ) * rcdz(
ke) &
515 i = iundef; j = iundef; k = iundef
523 call check( __line__, velz_xy(k,i,j+1) )
524 call check( __line__, velz_xy(k,i,j) )
525 call check( __line__, rfdy(j) )
527 s23_x(k,i,j) = 0.5_rp * ( &
528 ( gsqrt(k,i,j+1,
i_xyw)*velz_xy(k,i,j+1) - gsqrt(k,i,j,
i_xyw)*velz_xy(k,i,j) ) * rfdy(j) &
529 + ( j23g(k+1,i,j,
i_xvz)*work_y(k+1,i,j) - j23g(k,i,j,
i_xvz)*work_y(k,i,j) ) * rfdz(k) &
535 i = iundef; j = iundef; k = iundef
539 work_z(:,:,:) = undef; work_x(:,:,:) = undef; work_y(:,:,:) = undef; work_v(:,:,:) = undef
547 call check( __line__, velx_c(k+1,i,j) )
548 call check( __line__, velx_c(k,i,j) )
550 work_z(k,i,j) = 0.5_rp * ( velx_c(k+1,i,j) + velx_c(k,i,j) )
555 i = iundef; j = iundef; k = iundef
564 call check( __line__, velx_c(k,i,j+1) )
565 call check( __line__, velx_c(k,i,j) )
567 work_y(k,i,j) = 0.5_rp * ( velx_c(k,i,j+1) + velx_c(k,i,j) )
572 i = iundef; j = iundef; k = iundef
579 call check( __line__, velx_yz(k,i,j) )
580 call check( __line__, velx_yz(k,i,j+1) )
581 call check( __line__, velx_yz(k+1,i,j) )
582 call check( __line__, velx_yz(k+1,i,j+1) )
583 call check( __line__, j23g(k ,i,j ,
i_uvz) )
584 call check( __line__, j23g(k+1,i,j ,
i_uvz) )
585 call check( __line__, j23g(k ,i,j+1,
i_uvz) )
586 call check( __line__, j23g(k+1,i,j+1,
i_uvz) )
588 work_v(k,i,j) = 0.25_rp &
589 * ( j23g(k ,i,j ,
i_uyz)*velx_yz(k ,i,j ) &
590 + j23g(k+1,i,j ,
i_uyz)*velx_yz(k+1,i,j ) &
591 + j23g(k ,i,j+1,
i_uyz)*velx_yz(k ,i,j+1) &
592 + j23g(k+1,i,j+1,
i_uyz)*velx_yz(k+1,i,j+1) )
597 i = iundef; j = iundef; k = iundef
606 call check( __line__, velx_yz(k,i,j) )
607 call check( __line__, velx_yz(k,i-1,j) )
608 call check( __line__, gsqrt(k,i,j,
i_uyz) )
609 call check( __line__, gsqrt(k,i-1,j,
i_uyz) )
610 call check( __line__, work_z(k,i,j) )
611 call check( __line__, work_z(k-1,i,j) )
612 call check( __line__, j13g(k,i,j,
i_xyw) )
613 call check( __line__, j13g(k-1,i,j,
i_xyw) )
614 call check( __line__, gsqrt(k,i,j,
i_xyz) )
615 call check( __line__, rcdx(i) )
618 ( gsqrt(k,i,j,
i_uyz)*velx_yz(k,i,j) - gsqrt(k,i-1,j,
i_uyz)*velx_yz(k,i-1,j) ) * rcdx(i) &
619 + ( j13g(k,i,j,
i_xyw)*work_z(k,i,j) - j13g(k-1,i,j,
i_xyw)*work_z(k-1,i,j) ) * rcdz(k) &
620 ) * mapf(i,j,1,
i_xy) / gsqrt(k,i,j,
i_xyz)
625 i = iundef; j = iundef; k = iundef
630 call check( __line__, velx_yz(
ks,i,j) )
631 call check( __line__, velx_yz(
ks,i-1,j) )
632 call check( __line__, gsqrt(
ks,i,j,
i_uyz) )
633 call check( __line__, gsqrt(
ks,i-1,j,
i_uyz) )
634 call check( __line__, velx_c(
ks+1,i,j) )
635 call check( __line__, velx_c(
ks,i,j) )
636 call check( __line__, j13g(
ks+1,i,j,
i_xyz) )
637 call check( __line__, j13g(
ks,i,j,
i_xyz) )
638 call check( __line__, gsqrt(
ks,i,j,
i_xyz) )
639 call check( __line__, velx_yz(
ke,i,j) )
640 call check( __line__, velx_yz(
ke,i-1,j) )
641 call check( __line__, gsqrt(
ke,i,j,
i_uyz) )
642 call check( __line__, gsqrt(
ke,i-1,j,
i_uyz) )
643 call check( __line__, velx_c(
ke,i,j) )
644 call check( __line__, velx_c(
ke-1,i,j) )
645 call check( __line__, j13g(
ke,i,j,
i_xyz) )
646 call check( __line__, j13g(
ke-1,i,j,
i_xyz) )
647 call check( __line__, gsqrt(
ke,i,j,
i_xyz) )
648 call check( __line__, rcdx(i) )
651 ( gsqrt(
ks,i,j,
i_uyz)*velx_yz(
ks,i,j) - gsqrt(
ks,i-1,j,
i_uyz)*velx_yz(
ks,i-1,j) ) * rcdx(i) &
652 + ( j13g(
ks+1,i,j,
i_xyz)*velx_c(
ks+1,i,j) - j13g(
ks,i,j,
i_xyz)*velx_c(
ks,i,j) ) * rfdz(
ks) &
655 ( gsqrt(
ke,i,j,
i_uyz)*velx_yz(
ke,i,j) - gsqrt(
ke,i-1,j,
i_uyz)*velx_yz(
ke,i-1,j) ) * rcdx(i) &
656 + ( j13g(
ke,i,j,
i_xyz)*velx_c(
ke,i,j) - j13g(
ke-1,i,j,
i_xyz)*velx_c(
ke-1,i,j) ) * rfdz(
ke-1) &
661 i = iundef; j = iundef; k = iundef
670 call check( __line__, s31_c(k,i,j) )
671 call check( __line__, velx_c(k+1,i,j) )
672 call check( __line__, velx_c(k-1,i,j) )
673 call check( __line__, fdz(k) )
674 call check( __line__, fdz(k-1) )
676 s31_c(k,i,j) = ( s31_c(k,i,j) &
677 + 0.5_rp * ( velx_c(k+1,i,j) - velx_c(k-1,i,j) ) * j33g / ( fdz(k) + fdz(k-1) ) &
678 ) / gsqrt(k,i,j,
i_xyz)
683 i = iundef; j = iundef; k = iundef
688 call check( __line__, s31_c(
ks,i,j) )
689 call check( __line__, velx_c(
ks+1,i,j) )
690 call check( __line__, velx_c(
ks,i,j) )
691 call check( __line__, rfdz(
ks) )
692 call check( __line__, s31_c(
ke,i,j) )
693 call check( __line__, velx_c(
ke,i,j) )
694 call check( __line__, velx_c(
ke-1,i,j) )
695 call check( __line__, rfdz(
ke-1) )
697 s31_c(
ks,i,j) = ( s31_c(
ks,i,j) &
698 + 0.5_rp * ( velx_c(
ks+1,i,j) - velx_c(
ks,i,j) ) * j33g * rfdz(
ks) &
700 s31_c(
ke,i,j) = ( s31_c(
ke,i,j) &
701 + 0.5_rp * ( velx_c(
ke,i,j) - velx_c(
ke-1,i,j) ) * j33g * rfdz(
ke-1) &
706 i = iundef; j = iundef; k = iundef
713 call check( __line__, s31_y(k,i,j) )
714 call check( __line__, velx_yz(k+1,i,j) )
715 call check( __line__, velx_yz(k,i,j) )
716 call check( __line__, rfdz(k) )
718 s31_y(k,i,j) = ( s31_y(k,i,j) &
719 + 0.5_rp * ( velx_yz(k+1,i,j) - velx_yz(k,i,j) ) * j33g * rfdz(k) &
720 ) / gsqrt(k,i,j,
i_uyw)
725 i = iundef; j = iundef; k = iundef
734 call check( __line__, velx_c(k,i,j+1) )
735 call check( __line__, velx_c(k,i,j-1) )
736 call check( __line__, gsqrt(k,i,j+1,
i_xyz) )
737 call check( __line__, gsqrt(k,i,j-1,
i_xyz) )
738 call check( __line__, work_z(k,i,j) )
739 call check( __line__, work_z(k-1,i,j) )
740 call check( __line__, j23g(k,i,j,
i_xyw) )
741 call check( __line__, j23g(k-1,i,j,
i_xyw) )
743 s12_c(k,i,j) = 0.5_rp * ( &
744 ( gsqrt(k,i,j+1,
i_xyz)*velx_c(k,i,j+1) - gsqrt(k,i,j-1,
i_xyz)*velx_c(k,i,j-1) ) / ( fdy(j) + fdy(j-1) ) &
745 + ( j23g(k,i,j,
i_xyw)*work_z(k,i,j) - j23g(k-1,i,j,
i_xyw)*work_z(k-1,i,j) ) * rcdz(k) &
746 ) * mapf(i,j,2,
i_xy) / gsqrt(k,i,j,
i_xyz)
751 i = iundef; j = iundef; k = iundef
756 call check( __line__, velx_c(
ks,i,j+1) )
757 call check( __line__, velx_c(
ks,i,j-1) )
758 call check( __line__, gsqrt(
ks,i,j+1,
i_xyz) )
759 call check( __line__, gsqrt(
ks,i,j-1,
i_xyz) )
760 call check( __line__, velx_c(
ks+1,i,j) )
761 call check( __line__, velx_c(
ks,i,j) )
762 call check( __line__, j23g(
ks+1,i,j,
i_xyz) )
763 call check( __line__, j23g(
ks,i,j,
i_xyz) )
764 call check( __line__, gsqrt(
ks,i,j,
i_xyz) )
765 call check( __line__, velx_c(
ke,i,j+1) )
766 call check( __line__, velx_c(
ke,i,j-1) )
767 call check( __line__, gsqrt(
ke,i,j+1,
i_xyz) )
768 call check( __line__, gsqrt(
ke,i,j-1,
i_xyz) )
769 call check( __line__, velx_c(
ke,i,j) )
770 call check( __line__, velx_c(
ke-1,i,j) )
771 call check( __line__, j23g(
ke,i,j,
i_xyz) )
772 call check( __line__, j23g(
ke-1,i,j,
i_xyz) )
773 call check( __line__, gsqrt(
ke,i,j,
i_xyz) )
774 call check( __line__, fdy(j) )
775 call check( __line__, fdy(j-1) )
777 s12_c(
ks,i,j) = 0.5_rp * ( &
778 ( gsqrt(
ks,i,j+1,
i_xyz)*velx_c(
ks,i,j+1) - gsqrt(
ks,i,j-1,
i_xyz)*velx_c(
ks,i,j-1) ) / ( fdy(j) + fdy(j-1) ) &
779 + ( j23g(
ks+1,i,j,
i_xyz)*velx_c(
ks+1,i,j) - j23g(
ks,i,j,
i_xyz)*velx_c(
ks,i,j) ) * rfdz(
ks) &
781 s12_c(
ke,i,j) = 0.5_rp * ( &
782 ( gsqrt(
ke,i,j+1,
i_xyz)*velx_c(
ke,i,j+1) - gsqrt(
ke,i,j-1,
i_xyz)*velx_c(
ke,i,j-1) ) / ( fdy(j) + fdy(j-1) ) &
783 + ( j23g(
ke,i,j,
i_xyz)*velx_c(
ke,i,j) - j23g(
ke-1,i,j,
i_xyz)*velx_c(
ke-1,i,j) ) * rfdz(
ke-1) &
788 i = iundef; j = iundef; k = iundef
796 call check( __line__, velx_yz(k,i,j+1) )
797 call check( __line__, velx_yz(k,i,j) )
798 call check( __line__, work_v(k,i,j) )
799 call check( __line__, work_v(k-1,i,j) )
800 call check( __line__, rfdy(j) )
802 s12_z(k,i,j) = 0.5_rp * ( &
803 ( gsqrt(k,i,j+1,
i_uyz)*velx_yz(k,i,j+1) - gsqrt(k,i,j,
i_uyz)*velx_yz(k,i,j) ) * rfdy(j) &
804 + ( work_v(k,i,j) - work_v(k-1,i,j) ) * rcdz(k) &
810 i = iundef; j = iundef; k = iundef
815 call check( __line__, velx_yz(
ks,i,j+1) )
816 call check( __line__, velx_yz(
ks,i,j) )
817 call check( __line__, velx_yz(
ks+1,i,j) )
818 call check( __line__, velx_yz(
ks+1,i,j+1) )
819 call check( __line__, j23g(
ks+1,i,j,
i_uvz) )
820 call check( __line__, j23g(
ks ,i,j,
i_uvz) )
821 call check( __line__, velx_yz(
ke,i,j+1) )
822 call check( __line__, velx_yz(
ke,i,j) )
823 call check( __line__, velx_yz(
ke-1,i,j) )
824 call check( __line__, velx_yz(
ke-1,i,j+1) )
825 call check( __line__, j23g(
ke ,i,j,
i_uvz) )
826 call check( __line__, j23g(
ke-1,i,j,
i_uvz) )
828 s12_z(
ks,i,j) = 0.25_rp * ( &
829 ( gsqrt(
ks,i,j+1,
i_uyz)*velx_yz(
ks,i,j+1) - gsqrt(
ks,i,j,
i_uyz)*velx_yz(
ks,i,j) ) * rfdy(j) &
830 + ( j23g(
ks+1,i,j,
i_uvz) * ( velx_yz(
ks+1,i,j) + velx_yz(
ks+1,i,j+1) ) &
831 - j23g(
ks ,i,j,
i_uvz) * ( velx_yz(
ks ,i,j) + velx_yz(
ks ,i,j+1) ) ) * rfdz(
ks) &
833 s12_z(
ke,i,j) = 0.25_rp * ( &
834 ( gsqrt(
ke,i,j+1,
i_uyz)*velx_yz(
ke,i,j+1) - gsqrt(
ke,i,j,
i_uyz)*velx_yz(
ke,i,j) ) * rfdy(j) &
835 + ( j23g(
ke ,i,j,
i_uvz) * ( velx_yz(
ke ,i,j) + velx_yz(
ke ,i,j+1) ) &
836 - j23g(
ke-1,i,j,
i_uvz) * ( velx_yz(
ke-1,i,j) + velx_yz(
ke-1,i,j+1) ) ) * rfdz(
ke-1) &
841 i = iundef; j = iundef; k = iundef
845 work_z(:,:,:) = undef; work_x(:,:,:) = undef; work_y(:,:,:) = undef; work_v(:,:,:) = undef
853 call check( __line__, vely_c(k+1,i,j) )
854 call check( __line__, vely_c(k,i,j) )
856 work_z(k,i,j) = 0.5_rp * ( vely_c(k+1,i,j) + vely_c(k,i,j) )
861 i = iundef; j = iundef; k = iundef
868 call check( __line__, vely_c(k,i+1,j) )
869 call check( __line__, vely_c(k,i,j) )
871 work_x(k,i,j) = 0.5_rp * ( velz_c(k,i+1,j) + velz_c(k,i,j) )
876 i = iundef; j = iundef; k = iundef
885 call check( __line__, vely_zx(k,i,j) )
886 call check( __line__, vely_zx(k+1,i,j) )
887 call check( __line__, vely_zx(k,i+1,j) )
888 call check( __line__, vely_zx(k+1,i+1,j) )
890 work_v(k,i,j) = 0.25_rp &
891 * ( j13g(k ,i ,j,
i_xvz)*vely_zx(k ,i ,j) &
892 + j13g(k+1,i ,j,
i_xvz)*vely_zx(k+1,i ,j) &
893 + j13g(k ,i+1,j,
i_xvz)*vely_zx(k ,i+1,j) &
894 + j13g(k+1,i+1,j,
i_xvz)*vely_zx(k+1,i+1,j) )
899 i = iundef; j = iundef; k = iundef
908 call check( __line__, vely_zx(k,i,j) )
909 call check( __line__, vely_zx(k,i,j-1) )
910 call check( __line__, gsqrt(k,i,j,
i_xvz) )
911 call check( __line__, gsqrt(k,i,j-1,
i_xvz) )
912 call check( __line__, work_z(k,i,j) )
913 call check( __line__, work_z(k-1,i,j) )
914 call check( __line__, j23g(k,i,j,
i_xyw) )
915 call check( __line__, j23g(k-1,i,j,
i_xyw) )
916 call check( __line__, rcdy(j) )
919 ( gsqrt(k,i,j,
i_xvz)*vely_zx(k,i,j) - gsqrt(k,i,j-1,
i_xvz)*vely_zx(k,i,j-1) ) * rcdy(j) &
920 + ( j23g(k,i,j,
i_xyw)*work_z(k,i,j) - j23g(k-1,i,j,
i_xyw)*work_z(k-1,i,j) ) * rcdz(k) &
921 ) * mapf(i,j,2,
i_xy) / gsqrt(k,i,j,
i_xyz)
926 i = iundef; j = iundef; k = iundef
931 call check( __line__, vely_zx(
ks,i,j) )
932 call check( __line__, vely_zx(
ks,i,j-1) )
933 call check( __line__, gsqrt(
ks,i,j,
i_xvz) )
934 call check( __line__, gsqrt(
ks,i,j-1,
i_xvz) )
935 call check( __line__, vely_c(
ks+1,i,j) )
936 call check( __line__, vely_c(
ks,i,j) )
937 call check( __line__, j23g(
ks+1,i,j,
i_xyz) )
938 call check( __line__, j23g(
ks,i,j,
i_xyz) )
939 call check( __line__, rcdy(j) )
940 call check( __line__, vely_zx(
ke,i,j) )
941 call check( __line__, vely_zx(
ke,i,j-1) )
942 call check( __line__, gsqrt(
ke,i,j,
i_xvz) )
943 call check( __line__, gsqrt(
ke,i,j-1,
i_xvz) )
944 call check( __line__, vely_c(
ke,i,j) )
945 call check( __line__, vely_c(
ke-1,i,j) )
946 call check( __line__, j23g(
ke,i,j,
i_xyz) )
947 call check( __line__, j23g(
ke-1,i,j,
i_xyz) )
950 ( gsqrt(
ks,i,j,
i_xvz)*vely_zx(
ks,i,j) - gsqrt(
ks,i,j-1,
i_xvz)*vely_zx(
ks,i,j-1) ) * rcdy(j) &
951 + ( j23g(
ks+1,i,j,
i_xyz)*vely_c(
ks+1,i,j) - j23g(
ks,i,j,
i_xyz)*vely_c(
ks,i,j) ) * rfdz(
ks) &
954 ( gsqrt(
ke,i,j,
i_xvz)*vely_zx(
ke,i,j) - gsqrt(
ke,i,j-1,
i_xvz)*vely_zx(
ke,i,j-1) ) * rcdy(j) &
955 + ( j23g(
ke,i,j,
i_xyz)*vely_c(
ke,i,j) - j23g(
ke-1,i,j,
i_xyz)*vely_c(
ke-1,i,j) ) * rfdz(
ke-1) &
960 i = iundef; j = iundef; k = iundef
969 call check( __line__, s12_c(k,i,j) )
970 call check( __line__, vely_c(k,i+1,j) )
971 call check( __line__, vely_c(k,i-1,j) )
972 call check( __line__, gsqrt(k,i+1,j,
i_xyz) )
973 call check( __line__, gsqrt(k,i-1,j,
i_xyz) )
974 call check( __line__, work_z(k,i,j) )
975 call check( __line__, work_z(k-1,i,j) )
976 call check( __line__, j13g(k,i,j,
i_xyw) )
977 call check( __line__, j13g(k-1,i,j,
i_xyw) )
978 call check( __line__, gsqrt(k,i,j,
i_xyz) )
979 call check( __line__, fdx(i) )
980 call check( __line__, fdx(i-1) )
982 s12_c(k,i,j) = ( s12_c(k,i,j) &
984 ( gsqrt(k,i+1,j,
i_xyz)*vely_c(k,i+1,j) - gsqrt(k,i-1,j,
i_xyz)*vely_c(k,i-1,j) ) / ( fdx(i) + fdx(i-1) ) &
985 + ( j13g(k,i,j,
i_xyw)*work_z(k,i,j) - j13g(k-1,i,j,
i_xyw)*work_z(k-1,i,j) ) * rcdz(k) ) * mapf(i,j,1,
i_xy) &
986 ) / gsqrt(k,i,j,
i_xyz)
991 i = iundef; j = iundef; k = iundef
996 call check( __line__, s12_c(
ks,i,j) )
997 call check( __line__, vely_c(
ks,i+1,j) )
998 call check( __line__, vely_c(
ks,i-1,j) )
999 call check( __line__, gsqrt(
ks,i+1,j,
i_xyz) )
1000 call check( __line__, gsqrt(
ks,i-1,j,
i_xyz) )
1001 call check( __line__, vely_c(
ks+1,i,j) )
1002 call check( __line__, vely_c(
ks,i,j) )
1003 call check( __line__, j13g(
ks+1,i,j,
i_xyz) )
1004 call check( __line__, j13g(
ks,i,j,
i_xyz) )
1005 call check( __line__, gsqrt(
ks,i,j,
i_xyz) )
1006 call check( __line__, s12_c(
ke,i,j) )
1007 call check( __line__, vely_c(
ke,i+1,j) )
1008 call check( __line__, vely_c(
ke,i-1,j) )
1009 call check( __line__, gsqrt(
ke,i+1,j,
i_xyz) )
1010 call check( __line__, gsqrt(
ke,i-1,j,
i_xyz) )
1011 call check( __line__, vely_c(
ke,i,j) )
1012 call check( __line__, vely_c(
ke-1,i,j) )
1013 call check( __line__, j13g(
ke,i,j,
i_xyz) )
1014 call check( __line__, j13g(
ke-1,i,j,
i_xyz) )
1015 call check( __line__, gsqrt(
ke,i,j,
i_xyz) )
1016 call check( __line__, fdx(i) )
1017 call check( __line__, fdx(i-1) )
1019 s12_c(
ks,i,j) = ( s12_c(
ks,i,j) &
1021 ( gsqrt(
ks,i+1,j,
i_xyz)*vely_c(
ks,i+1,j) - gsqrt(
ks,i-1,j,
i_xyz)*vely_c(
ks,i-1,j) ) / ( fdx(i) + fdx(i-1) ) &
1022 + ( j13g(
ks+1,i,j,
i_xyz)*vely_c(
ks+1,i,j) - j13g(
ks,i,j,
i_xyz)*vely_c(
ks,i,j) ) * rfdz(
ks) ) &
1023 * mapf(i,j,1,
i_xy) &
1025 s12_c(
ke,i,j) = ( s12_c(
ke,i,j) &
1027 ( gsqrt(
ke,i+1,j,
i_xyz)*vely_c(
ke,i+1,j) - gsqrt(
ke,i-1,j,
i_xyz)*vely_c(
ke,i-1,j) ) / ( fdx(i) + fdx(i-1) ) &
1028 + ( j13g(
ke,i,j,
i_xyz)*vely_c(
ke,i,j) - j13g(
ke-1,i,j,
i_xyz)*vely_c(
ke-1,i,j) ) * rfdz(
ke-1) ) &
1029 * mapf(i,j,1,
i_xy) &
1034 i = iundef; j = iundef; k = iundef
1041 call check( __line__, s12_z(k,i,j) )
1042 call check( __line__, vely_zx(k,i+1,j) )
1043 call check( __line__, vely_zx(k,i,j) )
1044 call check( __line__, work_v(k,i,j) )
1045 call check( __line__, work_v(k-1,i,j) )
1046 call check( __line__, rfdx(i) )
1048 s12_z(k,i,j) = ( s12_z(k,i,j) &
1050 ( gsqrt(k,i+1,j,
i_xvz)*vely_zx(k,i+1,j) - gsqrt(k,i,j,
i_xvz)*vely_zx(k,i,j) ) * rfdx(i) &
1051 + ( work_v(k,i,j) - work_v(k-1,i,j) ) * rcdz(k) ) * mapf(i,j,1,
i_uv) &
1052 ) / gsqrt(k,i,j,
i_uvz)
1057 i = iundef; j = iundef; k = iundef
1062 call check( __line__, s12_z(
ks,i,j) )
1063 call check( __line__, vely_zx(
ks,i+1,j) )
1064 call check( __line__, vely_zx(
ks,i,j) )
1065 call check( __line__, vely_zx(
ks+1,i,j) )
1066 call check( __line__, vely_zx(
ks+1,i+1,j) )
1067 call check( __line__, s12_z(
ke,i,j) )
1068 call check( __line__, vely_zx(
ke,i+1,j) )
1069 call check( __line__, vely_zx(
ke,i,j) )
1070 call check( __line__, vely_zx(
ke-1,i,j) )
1071 call check( __line__, vely_zx(
ke-1,i+1,j) )
1072 call check( __line__, rfdx(i) )
1074 s12_z(
ks,i,j) = ( s12_z(
ks,i,j) &
1076 ( gsqrt(
ks,i+1,j,
i_xvz)*vely_zx(
ks,i+1,j) - gsqrt(
ks,i,j,
i_xvz)*vely_zx(
ks,i,j) ) * rfdx(i) &
1077 + ( j13g(
ks+1,i,j,
i_uvz) * ( vely_zx(
ks+1,i,j) + vely_zx(
ks+1,i+1,j) ) &
1078 - j13g(
ks ,i,j,
i_uvz) * ( vely_zx(
ks ,i,j) + vely_zx(
ks ,i+1,j) ) ) * rfdz(
ks) ) * mapf(i,j,1,
i_uv) &
1080 s12_z(
ke,i,j) = ( s12_z(
ke,i,j) &
1082 ( gsqrt(
ke,i+1,j,
i_xvz)*vely_zx(
ke,i+1,j) - gsqrt(
ke,i,j,
i_xvz)*vely_zx(
ke,i,j) ) * rfdx(i) &
1083 + ( j13g(
ke ,i,j,
i_uvz) * ( vely_zx(
ke ,i,j) + vely_zx(
ke ,i+1,j) ) &
1084 - j13g(
ke-1,i,j,
i_uvz) * ( vely_zx(
ke-1,i,j) + vely_zx(
ke-1,i+1,j) ) ) * rfdz(
ke-1) ) * mapf(i,j,1,
i_uv) &
1089 i = iundef; j = iundef; k = iundef
1098 call check( __line__, s23_c(k,i,j) )
1099 call check( __line__, vely_c(k+1,i,j) )
1100 call check( __line__, vely_c(k-1,i,j) )
1101 call check( __line__, fdz(k) )
1102 call check( __line__, fdz(k-1) )
1104 s23_c(k,i,j) = ( s23_c(k,i,j) &
1105 + 0.5_rp * ( vely_c(k+1,i,j) - vely_c(k-1,i,j) ) * j33g / ( fdz(k) + fdz(k-1) ) &
1106 ) / gsqrt(k,i,j,
i_xyz)
1111 i = iundef; j = iundef; k = iundef
1116 call check( __line__, s23_c(
ks,i,j) )
1117 call check( __line__, vely_c(
ks+1,i,j) )
1118 call check( __line__, vely_c(
ks,i,j) )
1119 call check( __line__, rfdz(
ks) )
1120 call check( __line__, s23_c(
ke,i,j) )
1121 call check( __line__, vely_c(
ke,i,j) )
1122 call check( __line__, vely_c(
ke-1,i,j) )
1123 call check( __line__, rfdz(
ke-1) )
1125 s23_c(
ks,i,j) = ( s23_c(
ks,i,j) &
1126 + 0.5_rp * ( vely_c(
ks+1,i,j) - vely_c(
ks,i,j) ) * j33g * rfdz(
ks) &
1128 s23_c(
ke,i,j) = ( s23_c(
ke,i,j) &
1129 + 0.5_rp * ( vely_c(
ke,i,j) - vely_c(
ke-1,i,j) ) * j33g * rfdz(
ke-1) &
1134 i = iundef; j = iundef; k = iundef
1142 call check( __line__, s23_x(k,i,j) )
1143 call check( __line__, vely_zx(k+1,i,j) )
1144 call check( __line__, vely_zx(k,i,j) )
1145 call check( __line__, rfdz(k) )
1147 s23_x(k,i,j) = ( s23_x(k,i,j) &
1148 + 0.5_rp * ( vely_zx(k+1,i,j) - vely_zx(k,i,j) ) * j33g * rfdz(k) &
1149 ) / gsqrt(k,i,j,
i_xvw)
1154 i = iundef; j = iundef; k = iundef
1160 work_z(:,:,:) = undef; work_x(:,:,:) = undef; work_y(:,:,:) = undef
1167 call check( __line__, s11_c(k,i,j) )
1168 call check( __line__, s22_c(k,i,j) )
1169 call check( __line__, s33_c(k,i,j) )
1170 call check( __line__, s31_c(k,i,j) )
1171 call check( __line__, s12_c(k,i,j) )
1172 call check( __line__, s23_c(k,i,j) )
1174 s2(k,i,j) = max( 1e-10_rp, &
1175 2.0_rp * ( s11_c(k,i,j)**2 + s22_c(k,i,j)**2 + s33_c(k,i,j)**2 ) &
1176 + 4.0_rp * ( s31_c(k,i,j)**2 + s12_c(k,i,j)**2 + s23_c(k,i,j)**2 ) )
1181 i = iundef; j = iundef; k = iundef
integer, public is
start point of inner domain: x, local
integer, public je
end point of inner domain: y, local
real(rp), dimension(:), allocatable, public grid_rcdy
reciprocal of center-dy
real(rp), dimension(:), allocatable, public grid_fdy
y-length of grid(j+1) to grid(j) [m]
integer, public iblock
block size for cache blocking: x
real(rp), dimension(:), allocatable, public grid_rcdx
reciprocal of center-dx
integer, public ke
end point of inner domain: z, local
real(rp), dimension(:), allocatable, public grid_rfdy
reciprocal of face-dy
real(rp), dimension(:), allocatable, public grid_rcdz
reciprocal of center-dz
integer, public ia
of x whole cells (local, with HALO)
real(rp), dimension(:), allocatable, public grid_fdz
z-length of grid(k+1) to grid(k) [m]
integer, public ka
of z whole cells (local, with HALO)
integer, public jblock
block size for cache blocking: y
integer, public js
start point of inner domain: y, local
integer, public ks
start point of inner domain: z, local
integer, public ie
end point of inner domain: x, local
real(rp), dimension(:), allocatable, public grid_fdx
x-length of grid(i+1) to grid(i) [m]
real(rp), dimension(:), allocatable, public grid_rfdx
reciprocal of face-dx
real(rp), dimension(:), allocatable, public grid_rfdz
reciprocal of face-dz
integer, public ja
of y whole cells (local, with HALO)