14 #define HIVI_BICGSTAB 1
28 #if defined DEBUG || defined QUICKDEBUG
58 integer,
private,
parameter :: VA_FVM_HIVI = 0
60 integer,
private :: ITMAX
61 real(RP),
private :: epsilon
63 integer,
private :: mtype
66 real(RP),
private,
parameter :: FACT_N = 7.0_rp / 12.0_rp
67 real(RP),
private,
parameter :: FACT_F = -1.0_rp / 12.0_rp
83 character(len=*),
intent(in) :: atmos_dyn_type
84 integer,
intent(out) :: va_out
85 character(len=H_SHORT),
intent(out) :: var_name(:)
86 character(len=H_MID),
intent(out) :: var_desc(:)
87 character(len=H_SHORT),
intent(out) :: var_unit(:)
90 if ( atmos_dyn_type /=
'FVM-HIVI' .AND. atmos_dyn_type /=
'HIVI' )
then
91 log_error(
"ATMOS_DYN_Tstep_short_fvm_hivi_regist",*)
'ATMOS_DYN_TYPE is not FVM-HIVI. Check!'
101 log_info(
"ATMOS_DYN_Tstep_short_fvm_hivi_regist",*)
'Register additional prognostic variables (HIVI)'
102 if ( va_out < 1 )
then
103 log_info_cont(*)
'=> nothing.'
116 namelist / param_atmos_dyn_tstep_fvm_hivi / &
123 log_info(
"ATMOS_DYN_Tstep_short_fvm_hivi_setup",*)
'HIVI Setup'
125 log_info(
"ATMOS_DYN_Tstep_short_fvm_hivi_setup",*)
'USING Bi-CGSTAB'
127 log_info(
"ATMOS_DYN_Tstep_short_fvm_hivi_setup",*)
'USING Multi-Grid'
128 log_error(
"ATMOS_DYN_Tstep_short_fvm_hivi_setup",*)
'Not Implemented yet'
134 epsilon = 0.1_rp ** (rp*2)
138 read(
io_fid_conf,nml=param_atmos_dyn_tstep_fvm_hivi,iostat=ierr)
141 log_info(
"ATMOS_DYN_Tstep_short_fvm_hivi_setup",*)
'Not found namelist. Default used.'
142 elseif( ierr > 0 )
then
143 log_error(
"ATMOS_DYN_Tstep_short_fvm_hivi_setup",*)
'Not appropriate names in namelist PARAM_ATMOS_DYN_TSTEP_FVM_HIVI. Check!'
146 log_nml(param_atmos_dyn_tstep_fvm_hivi)
149 mtype = mpi_double_precision
150 elseif( rp ==
sp )
then
153 log_error(
"ATMOS_DYN_Tstep_short_fvm_hivi_setup",*)
'Unsupported precision'
162 DENS_RK, MOMZ_RK, MOMX_RK, MOMY_RK, RHOT_RK, &
165 DENS0, MOMZ0, MOMX0, MOMY0, RHOT0, &
166 DENS, MOMZ, MOMX, MOMY, RHOT, &
167 DENS_t, MOMZ_t, MOMX_t, MOMY_t, RHOT_t, &
169 DPRES0, RT2P, CORIOLI, &
170 num_diff, wdamp_coef, divdmp_coef, DDIV, &
171 FLAG_FCT_MOMENTUM, FLAG_FCT_T, &
172 FLAG_FCT_ALONG_STREAM, &
173 CDZ, FDZ, FDX, FDY, &
174 RCDZ, RCDX, RCDY, RFDZ, RFDX, RFDY, &
175 PHI, GSQRT, J13G, J23G, J33G, MAPF, &
176 REF_dens, REF_rhot, &
177 BND_W, BND_E, BND_S, BND_N, TwoD, &
210 real(rp),
intent(out) :: dens_rk(
ka,
ia,
ja)
211 real(rp),
intent(out) :: momz_rk(
ka,
ia,
ja)
212 real(rp),
intent(out) :: momx_rk(
ka,
ia,
ja)
213 real(rp),
intent(out) :: momy_rk(
ka,
ia,
ja)
214 real(rp),
intent(out) :: rhot_rk(
ka,
ia,
ja)
216 real(rp),
intent(out) :: prog_rk(
ka,
ia,
ja,
va)
218 real(rp),
intent(inout) :: mflx_hi(
ka,
ia,
ja,3)
219 real(rp),
intent(out) :: tflx_hi(
ka,
ia,
ja,3)
221 real(rp),
intent(in),
target :: dens0(
ka,
ia,
ja)
222 real(rp),
intent(in),
target :: momz0(
ka,
ia,
ja)
223 real(rp),
intent(in),
target :: momx0(
ka,
ia,
ja)
224 real(rp),
intent(in),
target :: momy0(
ka,
ia,
ja)
225 real(rp),
intent(in),
target :: rhot0(
ka,
ia,
ja)
227 real(rp),
intent(in) :: dens(
ka,
ia,
ja)
228 real(rp),
intent(in) :: momz(
ka,
ia,
ja)
229 real(rp),
intent(in) :: momx(
ka,
ia,
ja)
230 real(rp),
intent(in) :: momy(
ka,
ia,
ja)
231 real(rp),
intent(in) :: rhot(
ka,
ia,
ja)
233 real(rp),
intent(in) :: dens_t(
ka,
ia,
ja)
234 real(rp),
intent(in) :: momz_t(
ka,
ia,
ja)
235 real(rp),
intent(in) :: momx_t(
ka,
ia,
ja)
236 real(rp),
intent(in) :: momy_t(
ka,
ia,
ja)
237 real(rp),
intent(in) :: rhot_t(
ka,
ia,
ja)
239 real(rp),
intent(in) :: prog0(
ka,
ia,
ja,
va)
240 real(rp),
intent(in) :: prog (
ka,
ia,
ja,
va)
242 real(rp),
intent(in) :: dpres0(
ka,
ia,
ja)
243 real(rp),
intent(in) :: rt2p(
ka,
ia,
ja)
244 real(rp),
intent(in) :: corioli(
ia,
ja)
245 real(rp),
intent(in) :: num_diff(
ka,
ia,
ja,5,3)
246 real(rp),
intent(in) :: wdamp_coef(
ka)
247 real(rp),
intent(in) :: divdmp_coef
248 real(rp),
intent(in) :: ddiv(
ka,
ia,
ja)
250 logical,
intent(in) :: flag_fct_momentum
251 logical,
intent(in) :: flag_fct_t
252 logical,
intent(in) :: flag_fct_along_stream
254 real(rp),
intent(in) :: cdz(
ka)
255 real(rp),
intent(in) :: fdz(
ka-1)
256 real(rp),
intent(in) :: fdx(
ia-1)
257 real(rp),
intent(in) :: fdy(
ja-1)
258 real(rp),
intent(in) :: rcdz(
ka)
259 real(rp),
intent(in) :: rcdx(
ia)
260 real(rp),
intent(in) :: rcdy(
ja)
261 real(rp),
intent(in) :: rfdz(
ka-1)
262 real(rp),
intent(in) :: rfdx(
ia-1)
263 real(rp),
intent(in) :: rfdy(
ja-1)
265 real(rp),
intent(in) :: phi (
ka,
ia,
ja)
266 real(rp),
intent(in) :: gsqrt (
ka,
ia,
ja,7)
267 real(rp),
intent(in) :: j13g (
ka,
ia,
ja,7)
268 real(rp),
intent(in) :: j23g (
ka,
ia,
ja,7)
269 real(rp),
intent(in) :: j33g
270 real(rp),
intent(in) :: mapf (
ia,
ja,2,4)
271 real(rp),
intent(in) :: ref_dens(
ka,
ia,
ja)
272 real(rp),
intent(in) :: ref_rhot(
ka,
ia,
ja)
274 logical,
intent(in) :: bnd_w
275 logical,
intent(in) :: bnd_e
276 logical,
intent(in) :: bnd_s
277 logical,
intent(in) :: bnd_n
278 logical,
intent(in) :: twod
280 real(rp),
intent(in) :: dtrk
281 logical,
intent(in) :: last
285 real(rp) :: pott(
ka,
ia,
ja)
286 real(rp) :: ddens(
ka,
ia,
ja)
287 real(rp) :: dpres(
ka,
ia,
ja)
288 real(rp) :: dpres_n(
ka,
ia,
ja)
295 real(rp) :: rcs2t(
ka,
ia,
ja)
300 real(rp) :: qflx_hi (
ka,
ia,
ja,3)
301 real(rp) :: qflx_j13(
ka,
ia,
ja)
302 real(rp) :: qflx_j23(
ka,
ia,
ja)
303 real(rp) :: mflx_hi2(
ka,
ia,
ja,3)
310 real(rp) :: zero(
ka,
ia,
ja)
314 integer :: iis, iie, jjs, jje
323 qflx_j13(:,:,:) = undef
324 qflx_j23(:,:,:) = undef
325 mflx_hi2(:,:,:,:) = undef
339 #if defined DEBUG || defined QUICKDEBUG
340 dens_rk( 1:
ks-1,:,:) = undef
341 dens_rk(
ke+1:
ka ,:,:) = undef
342 momz_rk( 1:
ks-1,:,:) = undef
343 momz_rk(
ke+1:
ka ,:,:) = undef
344 momx_rk( 1:
ks-1,:,:) = undef
345 momx_rk(
ke+1:
ka ,:,:) = undef
346 momy_rk( 1:
ks-1,:,:) = undef
347 momy_rk(
ke+1:
ka ,:,:) = undef
348 rhot_rk( 1:
ks-1,:,:) = undef
349 rhot_rk(
ke+1:
ka ,:,:) = undef
350 prog_rk( 1:
ks-1,:,:,:) = undef
351 prog_rk(
ke+1:
ka ,:,:,:) = undef
363 do i = max(iis-1,1), min(iie+1,
ia)
366 call check( __line__, dpres0(
k,i,j) )
367 call check( __line__, rt2p(
k,i,j) )
368 call check( __line__, rhot(
k,i,j) )
369 call check( __line__, ref_rhot(
k,i,j) )
371 dpres(
k,i,j) = dpres0(
k,i,j) + rt2p(
k,i,j) * ( rhot(
k,i,j) - ref_rhot(
k,i,j) )
373 dpres(
ks-1,i,j) = dpres0(
ks-1,i,j) - dens(
ks,i,j) * ( phi(
ks-1,i,j) - phi(
ks+1,i,j) )
374 dpres(
ke+1,i,j) = dpres0(
ke+1,i,j) - dens(
ke,i,j) * ( phi(
ke+1,i,j) - phi(
ke-1,i,j) )
383 call check( __line__, dens(
k,i,j) )
384 call check( __line__, ref_dens(
k,i,j) )
386 ddens(
k,i,j) = dens(
k,i,j) - ref_dens(
k,i,j)
396 call check( __line__, rhot(
k,i,j) )
397 call check( __line__, dens(
k,i,j) )
399 pott(
k,i,j) = rhot(
k,i,j) / dens(
k,i,j)
404 k = iundef; i = iundef; j = iundef
412 call check( __line__, rt2p(
k,i,j) )
414 rcs2t(
k,i,j) = 1.0_rp / rt2p(
k,i,j)
419 k = iundef; i = iundef; j = iundef
430 call check( __line__, momx(
k+1,
is,j) )
431 call check( __line__, momx(
k ,
is,j) )
432 call check( __line__, momy(
k+1,
is,j) )
433 call check( __line__, momy(
k+1,
is,j-1) )
434 call check( __line__, momy(
k ,
is,j) )
435 call check( __line__, momy(
k ,
is,j-1) )
439 mflx_hi2(
k,
is,j,
zdir) = j23g(
k,
is,j,
i_xyw) * 0.25_rp * ( momy(
k+1,
is,j)+momy(
k+1,
is,j-1) &
440 + momy(
k ,
is,j)+momy(
k ,
is,j-1) ) &
450 call check( __line__, momx(
k+1,i ,j) )
451 call check( __line__, momx(
k+1,i-1,j) )
452 call check( __line__, momx(
k ,i ,j) )
453 call check( __line__, momx(
k ,i+1,j) )
454 call check( __line__, momy(
k+1,i,j) )
455 call check( __line__, momy(
k+1,i,j-1) )
456 call check( __line__, momy(
k ,i,j) )
457 call check( __line__, momy(
k ,i,j-1) )
461 mflx_hi2(
k,i,j,
zdir) = j13g(
k,i,j,
i_xyw) * 0.25_rp * ( momx(
k+1,i,j)+momx(
k+1,i-1,j) &
462 + momx(
k ,i,j)+momx(
k ,i-1,j) ) &
463 + j23g(
k,i,j,
i_xyw) * 0.25_rp * ( momy(
k+1,i,j)+momy(
k+1,i,j-1) &
464 + momy(
k ,i,j)+momy(
k ,i,j-1) ) &
471 k = iundef; i = iundef; j = iundef
477 mflx_hi2(
ks-1,i,j,
zdir) = 0.0_rp
478 mflx_hi2(
ke ,i,j,
zdir) = 0.0_rp
483 if ( .not. twod )
then
492 mflx_hi2(
k,i,j,
xdir) = gsqrt(
k,i,j,
i_uyz) * num_diff(
k,i,j,
i_dens,
xdir)
498 k = iundef; i = iundef; j = iundef
509 mflx_hi2(
k,i,j,
ydir) = gsqrt(
k,i,j,
i_xvz) * num_diff(
k,i,j,
i_dens,
ydir)
514 k = iundef; i = iundef; j = iundef
523 gsqrt(:,:,:,
i_xyz), j33g, &
530 gsqrt(:,:,:,
i_xyz), j13g(:,:,:,
i_xyz), mapf(:,:,:,
i_xy), &
535 gsqrt(:,:,:,
i_xyz), j23g(:,:,:,
i_xyz), mapf(:,:,:,
i_xy), &
563 call check( __line__, qflx_j23(
k ,
is,j ) )
564 call check( __line__, qflx_j23(
k-1,
is,j ) )
567 call check( __line__, ddiv(
k ,
is,j) )
568 call check( __line__, ddiv(
k+1,
is,j) )
569 call check( __line__, momz0(
k,
is,j) )
570 call check( __line__, momz_t(
k,
is,j) )
574 + qflx_j23(
k,
is,j) - qflx_j23(
k-1,
is,j ) ) * rfdz(
k) &
577 - wdamp_coef(
k) * momz0(
k,
is,j) &
578 + divdmp_coef * rdt * ( ddiv(
k+1,
is,j)-ddiv(
k,
is,j) ) * fdz(
k) &
588 call check( __line__, qflx_hi(
k ,i ,j ,
zdir) )
589 call check( __line__, qflx_hi(
k-1,i ,j ,
zdir) )
590 call check( __line__, qflx_j13(
k ,i ,j ) )
591 call check( __line__, qflx_j13(
k-1,i ,j ) )
592 call check( __line__, qflx_j23(
k ,i ,j ) )
593 call check( __line__, qflx_j23(
k-1,i ,j ) )
594 call check( __line__, qflx_hi(
k ,i ,j ,
xdir) )
595 call check( __line__, qflx_hi(
k ,i-1,j ,
xdir) )
596 call check( __line__, qflx_hi(
k ,i ,j ,
ydir) )
597 call check( __line__, qflx_hi(
k ,i ,j-1,
ydir) )
598 call check( __line__, ddiv(
k ,i,j) )
599 call check( __line__, ddiv(
k+1,i,j) )
600 call check( __line__, momz0(
k,i,j) )
601 call check( __line__, momz_t(
k,i,j) )
604 - ( ( qflx_hi(
k,i,j,
zdir) - qflx_hi(
k-1,i ,j ,
zdir) &
605 + qflx_j13(
k,i,j) - qflx_j13(
k-1,i ,j ) &
606 + qflx_j23(
k,i,j) - qflx_j23(
k-1,i ,j ) ) * rfdz(
k) &
607 + ( qflx_hi(
k,i,j,
xdir) - qflx_hi(
k ,i-1,j ,
xdir) ) * rcdx(i) &
608 + ( qflx_hi(
k,i,j,
ydir) - qflx_hi(
k ,i ,j-1,
ydir) ) * rcdy(j) &
610 - wdamp_coef(
k) * momz0(
k,i,j) &
611 + divdmp_coef * rdt * ( ddiv(
k+1,i,j)-ddiv(
k,i,j) ) * fdz(
k) &
618 k = iundef; i = iundef; j = iundef
623 sw(
ks-1,i,j) = 0.0_rp
628 k = iundef; i = iundef; j = iundef
637 gsqrt(:,:,:,
i_uyw), j33g, &
644 gsqrt(:,:,:,
i_uyz), j13g(:,:,:,
i_uyw), mapf(:,:,:,
i_uy), &
649 gsqrt(:,:,:,
i_uyz), j23g(:,:,:,
i_uyw), mapf(:,:,:,
i_uy), &
681 call check( __line__, corioli(
is,j) )
682 call check( __line__, momy(
k,
is,j ) )
683 call check( __line__, momy(
k,
is,j-1) )
684 call check( __line__, momx0(
k,
is,j) )
688 + qflx_j23(
k,
is,j) - qflx_j23(
k-1,
is,j) ) * rcdz(
k) &
689 + ( qflx_hi(
k,
is,j,
ydir) - qflx_hi(
k ,
is,j-1,
ydir) ) * rcdy(j) ) &
691 + 0.5_rp * corioli(
is,j) * ( momy(
k,
is,j)+momy(
k,
is,j-1) ) &
701 call check( __line__, qflx_hi(
k ,i ,j ,
zdir) )
702 call check( __line__, qflx_hi(
k-1,i ,j ,
zdir) )
703 call check( __line__, qflx_hi(
k ,i ,j ,
xdir) )
704 call check( __line__, qflx_hi(
k ,i-1,j ,
xdir) )
705 call check( __line__, qflx_hi(
k ,i ,j ,
ydir) )
706 call check( __line__, qflx_hi(
k ,i ,j-1,
ydir) )
707 call check( __line__, dpres(
k+1,i+1,j) )
708 call check( __line__, dpres(
k+1,i ,j) )
709 call check( __line__, dpres(
k-1,i+1,j) )
710 call check( __line__, dpres(
k-1,i ,j) )
711 call check( __line__, corioli(i ,j) )
712 call check( __line__, corioli(i+1,j) )
713 call check( __line__, momy(
k,i ,j ) )
714 call check( __line__, momy(
k,i+1,j ) )
715 call check( __line__, momy(
k,i ,j-1) )
716 call check( __line__, momy(
k,i+1,j-1) )
717 call check( __line__, ddiv(
k,i+1,j) )
718 call check( __line__, ddiv(
k,i ,j) )
719 call check( __line__, momx0(
k,i,j) )
722 - ( ( qflx_hi(
k,i,j,
zdir) - qflx_hi(
k-1,i ,j ,
zdir) &
723 + qflx_j13(
k,i,j) - qflx_j13(
k-1,i ,j) &
724 + qflx_j23(
k,i,j) - qflx_j23(
k-1,i ,j) ) * rcdz(
k) &
725 + ( qflx_hi(
k,i,j,
xdir) - qflx_hi(
k ,i-1,j ,
xdir) ) * rfdx(i) &
726 + ( qflx_hi(
k,i,j,
ydir) - qflx_hi(
k ,i ,j-1,
ydir) ) * rcdy(j) ) &
727 - ( j13g(
k+1,i,j,
i_uyz) * ( dpres(
k+1,i+1,j)+dpres(
k+1,i,j) ) &
728 - j13g(
k-1,i,j,
i_uyz) * ( dpres(
k-1,i+1,j)+dpres(
k-1,i,j) ) ) &
729 * 0.5_rp / ( fdz(
k+1)+fdz(
k) ) &
731 + 0.125_rp * ( corioli(i,j)+corioli(i+1,j) ) &
732 * ( momy(
k,i,j)+momy(
k,i+1,j)+momy(
k,i,j-1)+momy(
k,i+1,j-1) ) &
733 + divdmp_coef * rdt * ( ddiv(
k,i+1,j)-ddiv(
k,i,j) ) * fdx(i) &
740 k = iundef; i = iundef; j = iundef
748 gsqrt(:,:,:,
i_xvw), j33g, &
755 gsqrt(:,:,:,
i_xvz), j13g(:,:,:,
i_xvw), mapf(:,:,:,
i_xv), &
760 gsqrt(:,:,:,
i_xvz), j23g(:,:,:,
i_xvw), mapf(:,:,:,
i_xv), &
792 call check( __line__, dpres(
k+1,
is,j ) )
793 call check( __line__, dpres(
k+1,
is,j+1) )
794 call check( __line__, dpres(
k-1,
is,j ) )
795 call check( __line__, dpres(
k-1,
is,j+1) )
796 call check( __line__, corioli(
is,j ) )
797 call check( __line__, corioli(
is,j+1) )
798 call check( __line__, momx(
k,
is,j ) )
799 call check( __line__, momx(
k,
is,j+1) )
800 call check( __line__, ddiv(
k,
is,j+1) )
801 call check( __line__, ddiv(
k,
is,j ) )
802 call check( __line__, momy_t(
k,
is,j) )
806 + qflx_j23(
k,
is,j) - qflx_j23(
k-1,
is,j ) ) * rcdz(
k) &
807 + ( qflx_hi(
k,
is,j,
ydir) - qflx_hi(
k ,
is,j-1,
ydir) ) * rfdy(j) ) &
808 - ( j23g(
k+1,
is,j,
i_xvz) * ( dpres(
k+1,
is,j+1)+dpres(
k+1,
is,j) ) &
809 - j23g(
k-1,
is,j,
i_xvz) * ( dpres(
k-1,
is,j+1)+dpres(
k-1,
is,j) ) ) &
810 * 0.5_rp / ( fdz(
k+1)+fdz(
k) ) &
812 - 0.25_rp * ( corioli(
is,j+1)+corioli(
is,j) ) &
813 * ( momx(
k,
is,j+1)+momx(
k,
is,j) ) &
814 + divdmp_coef * rdt * ( ddiv(
k,
is,j+1)-ddiv(
k,
is,j) ) * fdy(j) &
824 call check( __line__, qflx_hi(
k ,i ,j ,
zdir) )
825 call check( __line__, qflx_hi(
k-1,i ,j ,
zdir) )
826 call check( __line__, qflx_hi(
k ,i ,j ,
xdir) )
827 call check( __line__, qflx_hi(
k ,i-1,j ,
xdir) )
828 call check( __line__, qflx_hi(
k ,i ,j ,
ydir) )
829 call check( __line__, qflx_hi(
k ,i ,j-1,
ydir) )
830 call check( __line__, dpres(
k+1,i,j ) )
831 call check( __line__, dpres(
k+1,i,j+1) )
832 call check( __line__, dpres(
k-1,i,j ) )
833 call check( __line__, dpres(
k-1,i,j+1) )
834 call check( __line__, corioli(i,j ) )
835 call check( __line__, corioli(i,j+1) )
836 call check( __line__, momx(
k,i ,j ) )
837 call check( __line__, momx(
k,i ,j+1) )
838 call check( __line__, momx(
k,i-1,j ) )
839 call check( __line__, momx(
k,i-1,j+1) )
840 call check( __line__, ddiv(
k,i,j+1) )
841 call check( __line__, ddiv(
k,i,j ) )
842 call check( __line__, momy_t(
k,i,j) )
845 ( - ( ( qflx_hi(
k,i,j,
zdir) - qflx_hi(
k-1,i ,j ,
zdir) &
846 + qflx_j13(
k,i,j) - qflx_j13(
k-1,i ,j ) &
847 + qflx_j23(
k,i,j) - qflx_j23(
k-1,i ,j ) ) * rcdz(
k) &
848 + ( qflx_hi(
k,i,j,
xdir) - qflx_hi(
k ,i-1,j ,
xdir) ) * rcdx(i) &
849 + ( qflx_hi(
k,i,j,
ydir) - qflx_hi(
k ,i ,j-1,
ydir) ) * rfdy(j) ) &
850 - ( j23g(
k+1,i,j,
i_xvz) * ( dpres(
k+1,i,j+1)+dpres(
k+1,i,j) ) &
851 - j23g(
k-1,i,j,
i_xvz) * ( dpres(
k-1,i,j+1)+dpres(
k-1,i,j) ) ) &
852 * 0.5_rp / ( fdz(
k+1)+fdz(
k) ) &
854 - 0.125_rp * ( corioli(i ,j+1)+corioli(i ,j) ) &
855 * ( momx(
k,i,j+1)+momx(
k,i,j)+momx(
k,i-1,j+1)+momx(
k,i-1,j) ) &
856 + divdmp_coef * rdt * ( ddiv(
k,i,j+1)-ddiv(
k,i,j) ) * fdy(j) &
863 k = iundef; i = iundef; j = iundef
871 mflx_hi2(:,:,:,
zdir), pott, gsqrt(:,:,:,
i_xyw), &
879 mflx_hi2(:,:,:,
xdir), pott, gsqrt(:,:,:,
i_uyz), &
886 mflx_hi2(:,:,:,
ydir), pott, gsqrt(:,:,:,
i_xvz), &
900 call check( __line__, rhot_t(
k,
is,j) )
915 call check( __line__, tflx_hi(
k ,i ,j ,
zdir) )
916 call check( __line__, tflx_hi(
k-1,i ,j ,
zdir) )
917 call check( __line__, tflx_hi(
k ,i ,j ,
xdir) )
918 call check( __line__, tflx_hi(
k ,i-1,j ,
xdir) )
919 call check( __line__, tflx_hi(
k ,i ,j ,
ydir) )
920 call check( __line__, tflx_hi(
k ,i ,j-1,
ydir) )
921 call check( __line__, rhot_t(
k,i,j) )
924 - ( ( tflx_hi(
k,i,j,
zdir) - tflx_hi(
k-1,i ,j ,
zdir) ) * rcdz(
k) &
925 + ( tflx_hi(
k,i,j,
xdir) - tflx_hi(
k ,i-1,j ,
xdir) ) * rcdx(i) &
926 + ( tflx_hi(
k,i,j,
ydir) - tflx_hi(
k ,i ,j-1,
ydir) ) * rcdy(j) &
934 k = iundef; i = iundef; j = iundef
947 call comm_vars8( su, 1 )
948 call comm_vars8( sv, 2 )
949 call comm_wait ( su, 1 )
950 call comm_wait ( sv, 2 )
964 call check( __line__, momz(
k-1,i,j) )
965 call check( __line__, momz(
k ,i,j) )
966 call check( __line__, momx(
k,i ,j) )
967 call check( __line__, momy(
k,i,j-1) )
968 call check( __line__, momy(
k,i,j ) )
969 call check( __line__, pott(
k-2,i,j) )
970 call check( __line__, pott(
k-1,i,j) )
971 call check( __line__, pott(
k ,i,j) )
972 call check( __line__, pott(
k+1,i,j) )
973 call check( __line__, pott(
k+2,i,j) )
974 call check( __line__, pott(
k,i ,j) )
975 call check( __line__, pott(
k,i,j-2) )
976 call check( __line__, pott(
k,i,j-1) )
977 call check( __line__, pott(
k,i,j ) )
978 call check( __line__, pott(
k,i,j+1) )
979 call check( __line__, pott(
k,i,j+2) )
980 call check( __line__, sw(
k-1,i,j) )
981 call check( __line__, sw(
k ,i,j) )
982 call check( __line__, su(
k,i-1,j) )
983 call check( __line__, su(
k,i ,j) )
984 call check( __line__, sv(
k,i,j-1) )
985 call check( __line__, sv(
k,i,j ) )
990 call check( __line__, st(
k,i,j) )
991 call check( __line__, dpres(
k-1,i,j) )
992 call check( __line__, dpres(
k ,i,j) )
993 call check( __line__, dpres(
k+1,i,j) )
994 call check( __line__, rt2p(
k-1,i,j) )
995 call check( __line__, rt2p(
k ,i,j) )
996 call check( __line__, rt2p(
k+1,i,j) )
997 call check( __line__, rhot(
k-1,i,j) )
998 call check( __line__, rhot(
k+1,i,j) )
999 call check( __line__, ddens(
k-1,i,j) )
1000 call check( __line__, ddens(
k+1,i,j) )
1003 ( j33g * ( momz(
k ,i,j) + dtrk*sw(
k ,i,j) ) &
1004 * ( fact_n*(pott(
k+1,i,j)+pott(
k ,i,j)) &
1005 + fact_f*(pott(
k+2,i,j)+pott(
k-1,i,j)) ) &
1006 - j33g * ( momz(
k-1,i,j) + dtrk*sw(
k-1,i,j) ) &
1007 * ( fact_n*(pott(
k ,i,j)+pott(
k-1,i,j)) &
1008 + fact_f*(pott(
k+1,i,j)+pott(
k-2,i,j)) ) ) * rcdz(
k) &
1009 + ( gsqrt(
k,i,j ,
i_xvz) * ( momy(
k,i,j ) + dtrk*sv(
k,i,j ) ) &
1010 * ( fact_n*(pott(
k,i,j+1)+pott(
k,i,j )) &
1011 + fact_f*(pott(
k,i,j+2)+pott(
k,i,j-1)) ) &
1012 - gsqrt(
k,i,j-1,
i_xvz) * ( momy(
k,i,j-1) + dtrk*sv(
k,i,j-1) ) &
1013 * ( fact_n*(pott(
k,i,j )+pott(
k,i,j-1)) &
1014 + fact_f*(pott(
k,i,j+1)+pott(
k,i,j-2)) ) ) * rcdy(j) &
1015 + gsqrt(
k,i,j,
i_xyz) * ( st(
k,i,j) - dpres(
k,i,j) * rcs2t(
k,i,j) * rdt ) &
1017 + grav * j33g * ( ( dpres(
k+1,i,j)*rcs2t(
k+1,i,j) &
1018 - dpres(
k-1,i,j)*rcs2t(
k-1,i,j) ) &
1019 - ( rhot(
k+1,i,j)*ddens(
k+1,i,j)/dens(
k+1,i,j) &
1020 - rhot(
k-1,i,j)*ddens(
k-1,i,j)/dens(
k-1,i,j) ) &
1021 ) / ( fdz(
k) + fdz(
k-1) )
1025 k = iundef; i = iundef; j = iundef
1030 call check( __line__, momz(
ks,i,j) )
1031 call check( __line__, momx(
ks,i,j) )
1032 call check( __line__, momy(
ks,i,j) )
1033 call check( __line__, sw(
ks,i,j) )
1034 call check( __line__, su(
ks,i-1,j) )
1035 call check( __line__, su(
ks,i ,j) )
1036 call check( __line__, sv(
ks,i,j-1) )
1037 call check( __line__, sv(
ks,i,j ) )
1038 call check( __line__, st(
ks,i,j) )
1039 call check( __line__, pott(
ks ,i,j) )
1040 call check( __line__, pott(
ks+1,i,j) )
1041 call check( __line__, pott(
ks,i ,j) )
1042 call check( __line__, pott(
ks,i,j-2) )
1043 call check( __line__, pott(
ks,i,j-1) )
1044 call check( __line__, pott(
ks,i,j ) )
1045 call check( __line__, pott(
ks,i,j+1) )
1046 call check( __line__, pott(
ks,i,j+2) )
1050 call check( __line__, dpres(
ks ,i,j) )
1051 call check( __line__, dpres(
ks+1,i,j) )
1052 call check( __line__, rt2p(
ks ,i,j) )
1053 call check( __line__, rt2p(
ks+1,i,j) )
1054 call check( __line__, rhot(
ks+1,i,j) )
1055 call check( __line__, ddens(
ks+1,i,j) )
1058 ( j33g * ( momz(
ks ,i,j) + dtrk*sw(
ks ,i,j) ) &
1059 * 0.5_rp*(pott(
ks+1,i,j)+pott(
ks ,i,j)) ) * rcdz(
ks) &
1060 + ( gsqrt(
ks,i,j ,
i_xvz) * ( momy(
ks,i,j ) + dtrk*sv(
ks,i,j ) ) &
1061 * ( fact_n*(pott(
ks,i,j+1)+pott(
ks,i,j )) &
1062 + fact_f*(pott(
ks,i,j+2)+pott(
ks,i,j-1)) ) &
1063 - gsqrt(
ks,i,j-1,
i_xvz) * ( momy(
ks,i,j-1) + dtrk*sv(
ks,i,j-1) ) &
1064 * ( fact_n*(pott(
ks,i,j )+pott(
ks,i,j-1)) &
1065 + fact_f*(pott(
ks,i,j+1)+pott(
ks,i,j-2)) ) ) * rcdy(j) &
1066 + gsqrt(
ks,i,j,
i_xyz) * ( st(
ks,i,j) - dpres(
ks,i,j) * rcs2t(
ks,i,j) * rdt ) &
1068 + grav * j33g * 0.5_rp * ( ( dpres(
ks,i,j)+dpres(
ks+1,i,j) ) * rcs2t(
ks,i,j) &
1069 - ( ddens(
ks,i,j)+ddens(
ks+1,i,j) ) * pott(
ks,i,j) ) * rcdz(
ks)
1071 call check( __line__, momz(
ks ,i,j) )
1072 call check( __line__, momz(
ks+1,i,j) )
1073 call check( __line__, momx(
ks+1,i,j) )
1074 call check( __line__, momy(
ks+1,i,j-1) )
1075 call check( __line__, momy(
ks+1,i,j ) )
1076 call check( __line__, pott(
ks ,i,j) )
1077 call check( __line__, pott(
ks+1 ,i,j) )
1078 call check( __line__, pott(
ks+1+1,i,j) )
1079 call check( __line__, pott(
ks+1+2,i,j) )
1080 call check( __line__, pott(
ks+1,i,j) )
1081 call check( __line__, pott(
ks+1,i,j-2) )
1082 call check( __line__, pott(
ks+1,i,j-1) )
1083 call check( __line__, pott(
ks+1,i,j ) )
1084 call check( __line__, pott(
ks+1,i,j+1) )
1085 call check( __line__, pott(
ks+1,i,j+2) )
1086 call check( __line__, sw(
ks ,i,j) )
1087 call check( __line__, sw(
ks+1,i,j) )
1088 call check( __line__, su(
ks+1,i,j) )
1089 call check( __line__, sv(
ks+1,i,j-1) )
1090 call check( __line__, sv(
ks+1,i,j ) )
1095 call check( __line__, st(
ks+1,i,j) )
1096 call check( __line__, dpres(
ks ,i,j) )
1097 call check( __line__, dpres(
ks+1,i,j) )
1098 call check( __line__, dpres(
ks+2,i,j) )
1099 call check( __line__, rt2p(
ks ,i,j) )
1100 call check( __line__, rt2p(
ks+1,i,j) )
1101 call check( __line__, rt2p(
ks+2,i,j) )
1102 call check( __line__, rhot(
ks ,i,j) )
1103 call check( __line__, rhot(
ks+2,i,j) )
1104 call check( __line__, ddens(
ks ,i,j) )
1105 call check( __line__, ddens(
ks+2,i,j) )
1108 ( j33g * ( momz(
ks+1,i,j) + dtrk*sw(
ks+1,i,j) ) &
1109 * ( fact_n*(pott(
ks+2,i,j)+pott(
ks+1,i,j)) &
1110 + fact_f*(pott(
ks+3,i,j)+pott(
ks ,i,j)) ) &
1111 - j33g * ( momz(
ks+1-1,i,j) + dtrk*sw(
ks+1-1,i,j) ) &
1112 * ( 0.5_rp*(pott(
ks+1,i,j)+pott(
ks,i,j)) ) ) * rcdz(
ks+1) &
1113 + ( gsqrt(
ks+1,i,j ,
i_xvz) * ( momy(
ks+1,i,j ) + dtrk*sv(
ks+1,i,j ) ) &
1114 * ( fact_n*(pott(
ks+1,i,j+1)+pott(
ks+1,i,j )) &
1115 + fact_f*(pott(
ks+1,i,j+2)+pott(
ks+1,i,j-1)) ) &
1116 - gsqrt(
ks+1,i,j-1,
i_xvz) * ( momy(
ks+1,i,j-1) + dtrk*sv(
ks+1,i,j-1) ) &
1117 * ( fact_n*(pott(
ks+1,i,j )+pott(
ks+1,i,j-1)) &
1118 + fact_f*(pott(
ks+1,i,j+1)+pott(
ks+1,i,j-2)) ) ) * rcdy(j) &
1119 + gsqrt(
ks+1,i,j,
i_xyz) * ( st(
ks+1,i,j) - dpres(
ks+1,i,j) * rcs2t(
ks+1,i,j) * rdt ) &
1121 + grav * j33g * ( ( dpres(
ks+2,i,j)*rcs2t(
ks+2,i,j) &
1122 - dpres(
ks ,i,j)*rcs2t(
ks ,i,j) ) &
1123 - ( rhot(
ks+2,i,j)*ddens(
ks+2,i,j)/dens(
ks+2,i,j) &
1124 - rhot(
ks ,i,j)*ddens(
ks ,i,j)/dens(
ks ,i,j) ) &
1125 ) / ( fdz(
ks+1) + fdz(
ks) )
1127 call check( __line__, momz(
ke-2,i,j) )
1128 call check( __line__, momz(
ke-1,i,j) )
1129 call check( __line__, momx(
ke-1,i,j) )
1130 call check( __line__, momy(
ke-1,i,j-1) )
1131 call check( __line__, momy(
ke-1,i,j ) )
1132 call check( __line__, pott(
ke-3,i,j) )
1133 call check( __line__, pott(
ke-2,i,j) )
1134 call check( __line__, pott(
ke-1,i,j) )
1135 call check( __line__, pott(
ke ,i,j) )
1136 call check( __line__, pott(
ke-1,i ,j) )
1137 call check( __line__, pott(
ke-1,i,j-2) )
1138 call check( __line__, pott(
ke-1,i,j-1) )
1139 call check( __line__, pott(
ke-1,i,j ) )
1140 call check( __line__, pott(
ke-1,i,j+1) )
1141 call check( __line__, pott(
ke-1,i,j+2) )
1142 call check( __line__, sw(
ke-2,i,j) )
1143 call check( __line__, sw(
ke-1,i,j) )
1144 call check( __line__, su(
ke-1,i,j) )
1145 call check( __line__, sv(
ke-1,i,j-1) )
1146 call check( __line__, sv(
ke-1,i,j ) )
1151 call check( __line__, st(
ke-1,i,j) )
1152 call check( __line__, dpres(
ke-2,i,j) )
1153 call check( __line__, dpres(
ke-1,i,j) )
1154 call check( __line__, dpres(
ke ,i,j) )
1155 call check( __line__, rt2p(
ke-2,i,j) )
1156 call check( __line__, rt2p(
ke-1,i,j) )
1157 call check( __line__, rt2p(
ke ,i,j) )
1158 call check( __line__, rhot(
ke-2,i,j) )
1159 call check( __line__, rhot(
ke,i,j) )
1160 call check( __line__, ddens(
ke-2,i,j) )
1161 call check( __line__, ddens(
ke,i,j) )
1164 ( j33g * ( momz(
ke-1,i,j) + dtrk*sw(
ke-1,i,j) ) &
1165 * ( 0.5_rp*(pott(
ke ,i,j)+pott(
ke-1,i,j)) ) &
1166 - j33g * ( momz(
ke-2,i,j) + dtrk*sw(
ke-2,i,j) ) &
1167 * ( fact_n*(pott(
ke-1,i,j)+pott(
ke-2,i,j)) &
1168 + fact_f*(pott(
ke ,i,j)+pott(
ke-3,i,j)) ) ) * rcdz(
ke-1) &
1169 + ( gsqrt(
ke-1,i,j ,
i_xvz) * ( momy(
ke-1,i,j ) + dtrk*sv(
ke-1,i,j ) ) &
1170 * ( fact_n*(pott(
ke-1,i,j+1)+pott(
ke-1,i,j )) &
1171 + fact_f*(pott(
ke-1,i,j+2)+pott(
ke-1,i,j-1)) ) &
1172 - gsqrt(
ke-1,i,j-1,
i_xvz) * ( momy(
ke-1,i,j-1) + dtrk*sv(
ke-1,i,j-1) ) &
1173 * ( fact_n*(pott(
ke-1,i,j )+pott(
ke-1,i,j-1)) &
1174 + fact_f*(pott(
ke-1,i,j+1)+pott(
ke-1,i,j-2)) ) ) * rcdy(j) &
1175 + gsqrt(
ke-1,i,j,
i_xyz) * ( st(
ke-1,i,j) - dpres(
ke-1,i,j) * rcs2t(
ke-1,i,j) * rdt ) &
1177 + grav * j33g * ( ( dpres(
ke ,i,j)*rcs2t(
ke ,i,j) &
1178 - dpres(
ke-2,i,j)*rcs2t(
ke-2,i,j) ) &
1179 - ( rhot(
ke ,i,j)*ddens(
ke ,i,j)/dens(
ke ,i,j) &
1180 - rhot(
ke-2,i,j)*ddens(
ke-2,i,j)/dens(
ke-2,i,j) )&
1181 ) / ( fdz(
ke-1) + fdz(
ke-1-1) )
1183 call check( __line__, momz(
ke-1,i,j) )
1184 call check( __line__, momx(
ke,i,j) )
1185 call check( __line__, momy(
ke,i,j-1) )
1186 call check( __line__, momy(
ke,i,j ) )
1187 call check( __line__, sw(
ke-1,i,j) )
1188 call check( __line__, su(
ke,i,j) )
1189 call check( __line__, sv(
ke,i,j-1) )
1190 call check( __line__, sv(
ke,i,j ) )
1191 call check( __line__, pott(
ke-1,i,j) )
1192 call check( __line__, pott(
ke ,i,j) )
1193 call check( __line__, pott(
ke,i,j) )
1194 call check( __line__, pott(
ke,i,j-2) )
1195 call check( __line__, pott(
ke,i,j-1) )
1196 call check( __line__, pott(
ke,i,j ) )
1197 call check( __line__, pott(
ke,i,j+1) )
1198 call check( __line__, pott(
ke,i,j+2) )
1203 call check( __line__, st(
ke,i,j) )
1204 call check( __line__, dpres(
ke-1,i,j) )
1205 call check( __line__, dpres(
ke ,i,j) )
1206 call check( __line__, rt2p(
ke-1,i,j) )
1207 call check( __line__, rt2p(
ke ,i,j) )
1208 call check( __line__, rhot(
ke-1,i,j) )
1209 call check( __line__, ddens(
ke-1,i,j) )
1213 - j33g * ( momz(
ke-1,i,j) + dtrk*sw(
ke-1,i,j) ) &
1214 * 0.5_rp*(pott(
ke ,i,j)+pott(
ke-1,i,j)) ) * rcdz(
ke) &
1215 + ( gsqrt(
ke,i,j ,
i_xvz) * ( momy(
ke,i,j ) + dtrk*sv(
ke,i,j ) ) &
1216 * ( fact_n*(pott(
ke,i,j+1)+pott(
ke,i,j )) &
1217 + fact_f*(pott(
ke,i,j+2)+pott(
ke,i,j-1)) ) &
1218 - gsqrt(
ke,i,j-1,
i_xvz) * ( momy(
ke,i,j-1) + dtrk*sv(
ke,i,j-1) ) &
1219 * ( fact_n*(pott(
ke,i,j )+pott(
ke,i,j-1)) &
1220 + fact_f*(pott(
ke,i,j+1)+pott(
ke,i,j-2)) ) ) * rcdy(j) &
1221 + gsqrt(
ke,i,j,
i_xyz) * ( st(
ke,i,j) - dpres(
ke,i,j) * rcs2t(
ke,i,j) * rdt ) &
1223 + grav * j33g * 0.5_rp * ( - ( dpres(
ke,i,j)+dpres(
ke-1,i,j) ) * rcs2t(
ke,i,j) &
1224 + ( ddens(
ke,i,j)+ddens(
ke-1,i,j) ) * pott(
ke,i,j) ) * rcdz(
ke)
1228 k = iundef; i = iundef; j = iundef
1239 call check( __line__, momz(
k-1,i,j) )
1240 call check( __line__, momz(
k ,i,j) )
1241 call check( __line__, momx(
k,i-1,j) )
1242 call check( __line__, momx(
k,i ,j) )
1243 call check( __line__, momy(
k,i,j-1) )
1244 call check( __line__, momy(
k,i,j ) )
1245 call check( __line__, pott(
k-2,i,j) )
1246 call check( __line__, pott(
k-1,i,j) )
1247 call check( __line__, pott(
k ,i,j) )
1248 call check( __line__, pott(
k+1,i,j) )
1249 call check( __line__, pott(
k+2,i,j) )
1250 call check( __line__, pott(
k,i-2,j) )
1251 call check( __line__, pott(
k,i-1,j) )
1252 call check( __line__, pott(
k,i ,j) )
1253 call check( __line__, pott(
k,i+1,j) )
1254 call check( __line__, pott(
k,i+2,j) )
1255 call check( __line__, pott(
k,i,j-2) )
1256 call check( __line__, pott(
k,i,j-1) )
1257 call check( __line__, pott(
k,i,j ) )
1258 call check( __line__, pott(
k,i,j+1) )
1259 call check( __line__, pott(
k,i,j+2) )
1260 call check( __line__, sw(
k-1,i,j) )
1261 call check( __line__, sw(
k ,i,j) )
1262 call check( __line__, su(
k,i-1,j) )
1263 call check( __line__, su(
k,i ,j) )
1264 call check( __line__, sv(
k,i,j-1) )
1265 call check( __line__, sv(
k,i,j ) )
1271 call check( __line__, st(
k,i,j) )
1272 call check( __line__, dpres(
k-1,i,j) )
1273 call check( __line__, dpres(
k ,i,j) )
1274 call check( __line__, dpres(
k+1,i,j) )
1275 call check( __line__, rt2p(
k-1,i,j) )
1276 call check( __line__, rt2p(
k ,i,j) )
1277 call check( __line__, rt2p(
k+1,i,j) )
1278 call check( __line__, rhot(
k-1,i,j) )
1279 call check( __line__, rhot(
k+1,i,j) )
1280 call check( __line__, ddens(
k-1,i,j) )
1281 call check( __line__, ddens(
k+1,i,j) )
1284 ( j33g * ( momz(
k ,i,j) + dtrk*sw(
k ,i,j) ) &
1285 * ( fact_n*(pott(
k+1,i,j)+pott(
k ,i,j)) &
1286 + fact_f*(pott(
k+2,i,j)+pott(
k-1,i,j)) ) &
1287 - j33g * ( momz(
k-1,i,j) + dtrk*sw(
k-1,i,j) ) &
1288 * ( fact_n*(pott(
k ,i,j)+pott(
k-1,i,j)) &
1289 + fact_f*(pott(
k+1,i,j)+pott(
k-2,i,j)) ) ) * rcdz(
k) &
1290 + ( gsqrt(
k,i ,j,
i_uyz) * ( momx(
k,i ,j) + dtrk*su(
k,i ,j) ) &
1291 * ( fact_n*(pott(
k,i+1,j)+pott(
k,i ,j)) &
1292 + fact_f*(pott(
k,i+2,j)+pott(
k,i-1,j)) ) &
1293 - gsqrt(
k,i-1,j,
i_uyz) * ( momx(
k,i-1,j) + dtrk*su(
k,i-1,j) ) &
1294 * ( fact_n*(pott(
k,i ,j)+pott(
k,i-1,j)) &
1295 + fact_f*(pott(
k,i+1,j)+pott(
k,i-2,j)) ) ) * rcdx(i) &
1296 + ( gsqrt(
k,i,j ,
i_xvz) * ( momy(
k,i,j ) + dtrk*sv(
k,i,j ) ) &
1297 * ( fact_n*(pott(
k,i,j+1)+pott(
k,i,j )) &
1298 + fact_f*(pott(
k,i,j+2)+pott(
k,i,j-1)) ) &
1299 - gsqrt(
k,i,j-1,
i_xvz) * ( momy(
k,i,j-1) + dtrk*sv(
k,i,j-1) ) &
1300 * ( fact_n*(pott(
k,i,j )+pott(
k,i,j-1)) &
1301 + fact_f*(pott(
k,i,j+1)+pott(
k,i,j-2)) ) ) * rcdy(j) &
1302 + gsqrt(
k,i,j,
i_xyz) * ( st(
k,i,j) - dpres(
k,i,j) * rcs2t(
k,i,j) * rdt ) &
1304 + grav * j33g * ( ( dpres(
k+1,i,j)*rcs2t(
k+1,i,j) &
1305 - dpres(
k-1,i,j)*rcs2t(
k-1,i,j) ) &
1306 - ( rhot(
k+1,i,j)*ddens(
k+1,i,j)/dens(
k+1,i,j) &
1307 - rhot(
k-1,i,j)*ddens(
k-1,i,j)/dens(
k-1,i,j) ) &
1308 ) / ( fdz(
k) + fdz(
k-1) )
1313 k = iundef; i = iundef; j = iundef
1318 call check( __line__, momz(
ks,i,j) )
1319 call check( __line__, momx(
ks,i,j) )
1320 call check( __line__, momy(
ks,i,j) )
1321 call check( __line__, sw(
ks,i,j) )
1322 call check( __line__, su(
ks,i-1,j) )
1323 call check( __line__, su(
ks,i ,j) )
1324 call check( __line__, sv(
ks,i,j-1) )
1325 call check( __line__, sv(
ks,i,j ) )
1326 call check( __line__, st(
ks,i,j) )
1327 call check( __line__, pott(
ks ,i,j) )
1328 call check( __line__, pott(
ks+1,i,j) )
1329 call check( __line__, pott(
ks,i-2,j) )
1330 call check( __line__, pott(
ks,i-1,j) )
1331 call check( __line__, pott(
ks,i ,j) )
1332 call check( __line__, pott(
ks,i+1,j) )
1333 call check( __line__, pott(
ks,i+2,j) )
1334 call check( __line__, pott(
ks,i,j-2) )
1335 call check( __line__, pott(
ks,i,j-1) )
1336 call check( __line__, pott(
ks,i,j ) )
1337 call check( __line__, pott(
ks,i,j+1) )
1338 call check( __line__, pott(
ks,i,j+2) )
1342 call check( __line__, dpres(
ks ,i,j) )
1343 call check( __line__, dpres(
ks+1,i,j) )
1344 call check( __line__, rt2p(
ks ,i,j) )
1345 call check( __line__, rt2p(
ks+1,i,j) )
1346 call check( __line__, rhot(
ks+1,i,j) )
1347 call check( __line__, ddens(
ks+1,i,j) )
1350 ( j33g * ( momz(
ks ,i,j) + dtrk*sw(
ks ,i,j) ) &
1351 * 0.5_rp*(pott(
ks+1,i,j)+pott(
ks ,i,j)) ) * rcdz(
ks) &
1352 + ( gsqrt(
ks,i ,j,
i_uyz) * ( momx(
ks,i ,j) + dtrk*su(
ks,i ,j) ) &
1353 * ( fact_n*(pott(
ks,i+1,j)+pott(
ks,i ,j)) &
1354 + fact_f*(pott(
ks,i+2,j)+pott(
ks,i-1,j)) ) &
1355 - gsqrt(
ks,i-1,j,
i_uyz) * ( momx(
ks,i-1,j) + dtrk*su(
ks,i-1,j) ) &
1356 * ( fact_n*(pott(
ks,i ,j)+pott(
ks,i-1,j)) &
1357 + fact_f*(pott(
ks,i+1,j)+pott(
ks,i-2,j)) ) ) * rcdx(i) &
1358 + ( gsqrt(
ks,i,j ,
i_xvz) * ( momy(
ks,i,j ) + dtrk*sv(
ks,i,j ) ) &
1359 * ( fact_n*(pott(
ks,i,j+1)+pott(
ks,i,j )) &
1360 + fact_f*(pott(
ks,i,j+2)+pott(
ks,i,j-1)) ) &
1361 - gsqrt(
ks,i,j-1,
i_xvz) * ( momy(
ks,i,j-1) + dtrk*sv(
ks,i,j-1) ) &
1362 * ( fact_n*(pott(
ks,i,j )+pott(
ks,i,j-1)) &
1363 + fact_f*(pott(
ks,i,j+1)+pott(
ks,i,j-2)) ) ) * rcdy(j) &
1364 + gsqrt(
ks,i,j,
i_xyz) * ( st(
ks,i,j) - dpres(
ks,i,j) * rcs2t(
ks,i,j) * rdt ) &
1366 + grav * j33g * 0.5_rp * ( ( dpres(
ks,i,j)+dpres(
ks+1,i,j) ) * rcs2t(
ks,i,j) &
1367 - ( ddens(
ks,i,j)+ddens(
ks+1,i,j) ) * pott(
ks,i,j) ) * rcdz(
ks)
1369 call check( __line__, momz(
ks ,i,j) )
1370 call check( __line__, momz(
ks+1 ,i,j) )
1371 call check( __line__, momx(
ks+1,i-1,j) )
1372 call check( __line__, momx(
ks+1,i ,j) )
1373 call check( __line__, momy(
ks+1,i,j-1) )
1374 call check( __line__, momy(
ks+1,i,j ) )
1375 call check( __line__, pott(
ks ,i,j) )
1376 call check( __line__, pott(
ks+1 ,i,j) )
1377 call check( __line__, pott(
ks+1+1,i,j) )
1378 call check( __line__, pott(
ks+1+2,i,j) )
1379 call check( __line__, pott(
ks+1,i-2,j) )
1380 call check( __line__, pott(
ks+1,i-1,j) )
1381 call check( __line__, pott(
ks+1,i ,j) )
1382 call check( __line__, pott(
ks+1,i+1,j) )
1383 call check( __line__, pott(
ks+1,i+2,j) )
1384 call check( __line__, pott(
ks+1,i,j-2) )
1385 call check( __line__, pott(
ks+1,i,j-1) )
1386 call check( __line__, pott(
ks+1,i,j ) )
1387 call check( __line__, pott(
ks+1,i,j+1) )
1388 call check( __line__, pott(
ks+1,i,j+2) )
1389 call check( __line__, sw(
ks ,i,j) )
1390 call check( __line__, sw(
ks+1,i,j) )
1391 call check( __line__, su(
ks+1,i-1,j) )
1392 call check( __line__, su(
ks+1,i ,j) )
1393 call check( __line__, sv(
ks+1,i,j-1) )
1394 call check( __line__, sv(
ks+1,i,j ) )
1400 call check( __line__, st(
ks+1,i,j) )
1401 call check( __line__, dpres(
ks ,i,j) )
1402 call check( __line__, dpres(
ks+1,i,j) )
1403 call check( __line__, dpres(
ks+2,i,j) )
1404 call check( __line__, rt2p(
ks ,i,j) )
1405 call check( __line__, rt2p(
ks+1,i,j) )
1406 call check( __line__, rt2p(
ks+2,i,j) )
1407 call check( __line__, rhot(
ks ,i,j) )
1408 call check( __line__, rhot(
ks+2,i,j) )
1409 call check( __line__, ddens(
ks ,i,j) )
1410 call check( __line__, ddens(
ks+2,i,j) )
1413 ( j33g * ( momz(
ks+1,i,j) + dtrk*sw(
ks+1,i,j) ) &
1414 * ( fact_n*(pott(
ks+2,i,j)+pott(
ks+1,i,j)) &
1415 + fact_f*(pott(
ks+3,i,j)+pott(
ks ,i,j)) ) &
1416 - j33g * ( momz(
ks+1-1,i,j) + dtrk*sw(
ks+1-1,i,j) ) &
1417 * ( 0.5_rp*(pott(
ks+1,i,j)+pott(
ks,i,j)) ) ) * rcdz(
ks+1) &
1418 + ( gsqrt(
ks+1,i ,j,
i_uyz) * ( momx(
ks+1,i ,j) + dtrk*su(
ks+1,i ,j) ) &
1419 * ( fact_n*(pott(
ks+1,i+1,j)+pott(
ks+1,i ,j)) &
1420 + fact_f*(pott(
ks+1,i+2,j)+pott(
ks+1,i-1,j)) ) &
1421 - gsqrt(
ks+1,i-1,j,
i_uyz) * ( momx(
ks+1,i-1,j) + dtrk*su(
ks+1,i-1,j) ) &
1422 * ( fact_n*(pott(
ks+1,i ,j)+pott(
ks+1,i-1,j)) &
1423 + fact_f*(pott(
ks+1,i+1,j)+pott(
ks+1,i-2,j)) ) ) * rcdx(i) &
1424 + ( gsqrt(
ks+1,i,j ,
i_xvz) * ( momy(
ks+1,i,j ) + dtrk*sv(
ks+1,i,j ) ) &
1425 * ( fact_n*(pott(
ks+1,i,j+1)+pott(
ks+1,i,j )) &
1426 + fact_f*(pott(
ks+1,i,j+2)+pott(
ks+1,i,j-1)) ) &
1427 - gsqrt(
ks+1,i,j-1,
i_xvz) * ( momy(
ks+1,i,j-1) + dtrk*sv(
ks+1,i,j-1) ) &
1428 * ( fact_n*(pott(
ks+1,i,j )+pott(
ks+1,i,j-1)) &
1429 + fact_f*(pott(
ks+1,i,j+1)+pott(
ks+1,i,j-2)) ) ) * rcdy(j) &
1430 + gsqrt(
ks+1,i,j,
i_xyz) * ( st(
ks+1,i,j) - dpres(
ks+1,i,j) * rcs2t(
ks+1,i,j) * rdt ) &
1432 + grav * j33g * ( ( dpres(
ks+2,i,j)*rcs2t(
ks+2,i,j) &
1433 - dpres(
ks ,i,j)*rcs2t(
ks ,i,j) ) &
1434 - ( rhot(
ks+2,i,j)*ddens(
ks+2,i,j)/dens(
ks+2,i,j) &
1435 - rhot(
ks ,i,j)*ddens(
ks ,i,j)/dens(
ks ,i,j) ) &
1436 ) / ( fdz(
ks+1) + fdz(
ks) )
1438 call check( __line__, momz(
ke-2,i,j) )
1439 call check( __line__, momz(
ke-1,i,j) )
1440 call check( __line__, momx(
ke-1,i-1,j) )
1441 call check( __line__, momx(
ke-1,i ,j) )
1442 call check( __line__, momy(
ke-1,i,j-1) )
1443 call check( __line__, momy(
ke-1,i,j ) )
1444 call check( __line__, pott(
ke-3,i,j) )
1445 call check( __line__, pott(
ke-2,i,j) )
1446 call check( __line__, pott(
ke-1,i,j) )
1447 call check( __line__, pott(
ke ,i,j) )
1448 call check( __line__, pott(
ke-1,i-2,j) )
1449 call check( __line__, pott(
ke-1,i-1,j) )
1450 call check( __line__, pott(
ke-1,i ,j) )
1451 call check( __line__, pott(
ke-1,i+1,j) )
1452 call check( __line__, pott(
ke-1,i+2,j) )
1453 call check( __line__, pott(
ke-1,i,j-2) )
1454 call check( __line__, pott(
ke-1,i,j-1) )
1455 call check( __line__, pott(
ke-1,i,j ) )
1456 call check( __line__, pott(
ke-1,i,j+1) )
1457 call check( __line__, pott(
ke-1,i,j+2) )
1458 call check( __line__, sw(
ke-2,i,j) )
1459 call check( __line__, sw(
ke-1,i,j) )
1460 call check( __line__, su(
ke-1,i-1,j) )
1461 call check( __line__, su(
ke-1,i ,j) )
1462 call check( __line__, sv(
ke-1,i,j-1) )
1463 call check( __line__, sv(
ke-1,i,j ) )
1469 call check( __line__, st(
ke-1,i,j) )
1470 call check( __line__, dpres(
ke-2,i,j) )
1471 call check( __line__, dpres(
ke-1,i,j) )
1472 call check( __line__, dpres(
ke ,i,j) )
1473 call check( __line__, rt2p(
ke-2,i,j) )
1474 call check( __line__, rt2p(
ke-1,i,j) )
1475 call check( __line__, rt2p(
ke ,i,j) )
1476 call check( __line__, rhot(
ke-2,i,j) )
1477 call check( __line__, rhot(
ke,i,j) )
1478 call check( __line__, ddens(
ke-2,i,j) )
1479 call check( __line__, ddens(
ke,i,j) )
1482 ( j33g * ( momz(
ke-1,i,j) + dtrk*sw(
ke-1,i,j) ) &
1483 * ( 0.5_rp*(pott(
ke ,i,j)+pott(
ke-1,i,j)) ) &
1484 - j33g * ( momz(
ke-2,i,j) + dtrk*sw(
ke-2,i,j) ) &
1485 * ( fact_n*(pott(
ke-1,i,j)+pott(
ke-2,i,j)) &
1486 + fact_f*(pott(
ke ,i,j)+pott(
ke-3,i,j)) ) ) * rcdz(
ke-1) &
1487 + ( gsqrt(
ke-1,i ,j,
i_uyz) * ( momx(
ke-1,i ,j) + dtrk*su(
ke-1,i ,j) ) &
1488 * ( fact_n*(pott(
ke-1,i+1,j)+pott(
ke-1,i ,j)) &
1489 + fact_f*(pott(
ke-1,i+2,j)+pott(
ke-1,i-1,j)) ) &
1490 - gsqrt(
ke-1,i-1,j,
i_uyz) * ( momx(
ke-1,i-1,j) + dtrk*su(
ke-1,i-1,j) ) &
1491 * ( fact_n*(pott(
ke-1,i ,j)+pott(
ke-1,i-1,j)) &
1492 + fact_f*(pott(
ke-1,i+1,j)+pott(
ke-1,i-2,j)) ) ) * rcdx(i) &
1493 + ( gsqrt(
ke-1,i,j ,
i_xvz) * ( momy(
ke-1,i,j ) + dtrk*sv(
ke-1,i,j ) ) &
1494 * ( fact_n*(pott(
ke-1,i,j+1)+pott(
ke-1,i,j )) &
1495 + fact_f*(pott(
ke-1,i,j+2)+pott(
ke-1,i,j-1)) ) &
1496 - gsqrt(
ke-1,i,j-1,
i_xvz) * ( momy(
ke-1,i,j-1) + dtrk*sv(
ke-1,i,j-1) ) &
1497 * ( fact_n*(pott(
ke-1,i,j )+pott(
ke-1,i,j-1)) &
1498 + fact_f*(pott(
ke-1,i,j+1)+pott(
ke-1,i,j-2)) ) ) * rcdy(j) &
1499 + gsqrt(
ke-1,i,j,
i_xyz) * ( st(
ke-1,i,j) - dpres(
ke-1,i,j) * rcs2t(
ke-1,i,j) * rdt ) &
1501 + grav * j33g * ( ( dpres(
ke ,i,j)*rcs2t(
ke ,i,j) &
1502 - dpres(
ke-2,i,j)*rcs2t(
ke-2,i,j) ) &
1503 - ( rhot(
ke ,i,j)*ddens(
ke ,i,j)/dens(
ke ,i,j) &
1504 - rhot(
ke-2,i,j)*ddens(
ke-2,i,j)/dens(
ke-2,i,j) )&
1505 ) / ( fdz(
ke-1) + fdz(
ke-1-1) )
1507 call check( __line__, momz(
ke-1,i,j) )
1508 call check( __line__, momx(
ke,i-1,j) )
1509 call check( __line__, momx(
ke,i ,j) )
1510 call check( __line__, momy(
ke,i,j-1) )
1511 call check( __line__, momy(
ke,i,j ) )
1512 call check( __line__, sw(
ke-1,i,j) )
1513 call check( __line__, su(
ke,i-1,j) )
1514 call check( __line__, su(
ke,i ,j) )
1515 call check( __line__, sv(
ke,i,j-1) )
1516 call check( __line__, sv(
ke,i,j ) )
1518 call check( __line__, pott(
ke-1,i,j) )
1519 call check( __line__, pott(
ke ,i,j) )
1520 call check( __line__, pott(
ke,i-2,j) )
1521 call check( __line__, pott(
ke,i-1,j) )
1522 call check( __line__, pott(
ke,i ,j) )
1523 call check( __line__, pott(
ke,i+1,j) )
1524 call check( __line__, pott(
ke,i+2,j) )
1525 call check( __line__, pott(
ke,i,j-2) )
1526 call check( __line__, pott(
ke,i,j-1) )
1527 call check( __line__, pott(
ke,i,j ) )
1528 call check( __line__, pott(
ke,i,j+1) )
1529 call check( __line__, pott(
ke,i,j+2) )
1535 call check( __line__, st(
ke,i,j) )
1536 call check( __line__, dpres(
ke-1,i,j) )
1537 call check( __line__, dpres(
ke ,i,j) )
1538 call check( __line__, rt2p(
ke-1,i,j) )
1539 call check( __line__, rt2p(
ke ,i,j) )
1540 call check( __line__, rhot(
ke-1,i,j) )
1541 call check( __line__, ddens(
ke-1,i,j) )
1545 - j33g * ( momz(
ke-1,i,j) + dtrk*sw(
ke-1,i,j) ) &
1546 * 0.5_rp*(pott(
ke ,i,j)+pott(
ke-1,i,j)) ) * rcdz(
ke) &
1547 + ( gsqrt(
ke,i ,j,
i_uyz) * ( momx(
ke,i ,j) + dtrk*su(
ke,i ,j) ) &
1548 * ( fact_n*(pott(
ke,i+1,j)+pott(
ke,i ,j)) &
1549 + fact_f*(pott(
ke,i+2,j)+pott(
ke,i-1,j)) ) &
1550 - gsqrt(
ke,i-1,j,
i_uyz) * ( momx(
ke,i-1,j) + dtrk*su(
ke,i-1,j) ) &
1551 * ( fact_n*(pott(
ke,i ,j)+pott(
ke,i-1,j)) &
1552 + fact_f*(pott(
ke,i+1,j)+pott(
ke,i-2,j)) ) ) * rcdx(i) &
1553 + ( gsqrt(
ke,i,j ,
i_xvz) * ( momy(
ke,i,j ) + dtrk*sv(
ke,i,j ) ) &
1554 * ( fact_n*(pott(
ke,i,j+1)+pott(
ke,i,j )) &
1555 + fact_f*(pott(
ke,i,j+2)+pott(
ke,i,j-1)) ) &
1556 - gsqrt(
ke,i,j-1,
i_xvz) * ( momy(
ke,i,j-1) + dtrk*sv(
ke,i,j-1) ) &
1557 * ( fact_n*(pott(
ke,i,j )+pott(
ke,i,j-1)) &
1558 + fact_f*(pott(
ke,i,j+1)+pott(
ke,i,j-2)) ) ) * rcdy(j) &
1559 + gsqrt(
ke,i,j,
i_xyz) * ( st(
ke,i,j) - dpres(
ke,i,j) * rcs2t(
ke,i,j) * rdt ) &
1561 + grav * j33g * 0.5_rp * ( - ( dpres(
ke,i,j)+dpres(
ke-1,i,j) ) * rcs2t(
ke,i,j) &
1562 + ( ddens(
ke,i,j)+ddens(
ke-1,i,j) ) * pott(
ke,i,j) ) * rcdz(
ke)
1566 k = iundef; i = iundef; j = iundef
1573 pott, rcs2t, grav, &
1575 rcdz, rfdz, rcdx, rfdx, rcdy,rfdy, fdz, &
1580 iis, iie, jjs, jje )
1591 call comm_vars8( dpres_n, 1 )
1592 call comm_wait ( dpres_n, 1 )
1595 call check_solver( dpres_n, m, b, twod )
1600 call solve_multigrid
1617 call check( __line__, dpres_n(
k+1,i,j) )
1618 call check( __line__, dpres_n(
k ,i,j) )
1619 call check( __line__, dpres(
k+1,i,j) )
1620 call check( __line__, dpres(
k ,i,j) )
1621 call check( __line__, ddens(
k+1,i,j) )
1622 call check( __line__, ddens(
k ,i,j) )
1623 call check( __line__, ref_dens(
k+1,i,j) )
1624 call check( __line__, ref_dens(
k,i,j) )
1625 call check( __line__, momz0(
k,i,j) )
1628 - j33g * ( dpres_n(
k+1,i,j) - dpres_n(
k,i,j) ) * rfdz(
k) &
1631 * ( ddens(
k+1,i,j) &
1632 + ( dpres_n(
k+1,i,j) - dpres(
k+1,i,j) ) &
1633 / ( pott(
k+1,i,j) * rt2p(
k+1,i,j) ) &
1635 + ( dpres_n(
k ,i,j) - dpres(
k ,i,j) ) &
1636 / ( pott(
k ,i,j) * rt2p(
k ,i,j) ) ) &
1638 momz_rk(
k,i,j) = momz0(
k,i,j) + duvw
1639 mflx_hi(
k,i,j,
zdir) = j33g * ( momz(
k,i,j) + duvw )
1644 k = iundef; i = iundef; j = iundef
1648 mflx_hi(
ks-1,i,j,
zdir) = 0.0_rp
1649 mflx_hi(
ke ,i,j,
zdir) = 0.0_rp
1653 k = iundef; i = iundef; j = iundef
1666 call check( __line__, momx0(
k,
is,j) )
1668 duvw = dtrk * su(
k,
is,j)
1670 momx_rk(
k,
is,j) = momx0(
k,
is,j) + duvw
1679 call check( __line__, dpres_n(
k,i+1,j) )
1680 call check( __line__, dpres_n(
k,i ,j) )
1684 call check( __line__, su(
k,i,j) )
1685 call check( __line__, momx0(
k,i,j) )
1688 - ( gsqrt(
k,i+1,j,
i_xyz) * dpres_n(
k,i+1,j) &
1689 - gsqrt(
k,i ,j,
i_xyz) * dpres_n(
k,i ,j) ) * rfdx(i) &
1693 momx_rk(
k,i,j) = momx0(
k,i,j) + duvw
1694 mflx_hi(
k,i,j,
xdir) = gsqrt(
k,i,j,
i_uyz) * ( momx(
k,i,j) + duvw )
1700 k = iundef; i = iundef; j = iundef
1711 call check( __line__, dpres_n(
k,i,j ) )
1712 call check( __line__, dpres_n(
k,i,j+1) )
1716 call check( __line__, sv(
k,i,j) )
1717 call check( __line__, momy0(
k,i,j) )
1720 - ( gsqrt(
k,i,j+1,
i_xyz) * dpres_n(
k,i,j+1) &
1721 - gsqrt(
k,i,j ,
i_xyz) * dpres_n(
k,i,j ) ) * rfdy(j) &
1724 momy_rk(
k,i,j) = momy0(
k,i,j) + duvw
1725 mflx_hi(
k,i,j,
ydir) = gsqrt(
k,i,j,
i_xvz) * ( momy(
k,i,j) + duvw )
1730 k = iundef; i = iundef; j = iundef
1743 call check( __line__, pott(
k,i-1,j) )
1744 call check( __line__, pott(
k,i ,j) )
1745 call check( __line__, pott(
k,i+1,j) )
1746 call check( __line__, pott(
k,i+1,j) )
1750 * ( fact_n * ( pott(
k+1,i,j) + pott(
k ,i,j) ) &
1751 + fact_f * ( pott(
k+2,i,j) + pott(
k-1,i,j) ) )
1756 k = iundef; i = iundef; j = iundef
1761 tflx_hi(
ks-1,i,j,
zdir) = 0.0_rp
1762 tflx_hi(
ks ,i,j,
zdir) = mflx_hi(
ks ,i,j,
zdir) * 0.5_rp * ( pott(
ks+1,i,j) + pott(
ks ,i,j) )
1763 tflx_hi(
ke-1,i,j,
zdir) = mflx_hi(
ke-1,i,j,
zdir) * 0.5_rp * ( pott(
ke ,i,j) + pott(
ke-1,i,j) )
1764 tflx_hi(
ke ,i,j,
zdir) = 0.0_rp
1768 k = iundef; i = iundef; j = iundef
1771 if ( .not. twod )
then
1778 call check( __line__, pott(
k,i-1,j) )
1779 call check( __line__, pott(
k,i ,j) )
1780 call check( __line__, pott(
k,i+1,j) )
1781 call check( __line__, pott(
k,i+1,j) )
1785 * ( fact_n * ( pott(
k,i+1,j)+pott(
k,i ,j) ) &
1786 + fact_f * ( pott(
k,i+2,j)+pott(
k,i-1,j) ) )
1792 k = iundef; i = iundef; j = iundef
1801 call check( __line__, pott(
k,i,j-1) )
1802 call check( __line__, pott(
k,i,j ) )
1803 call check( __line__, pott(
k,i,j+1) )
1804 call check( __line__, pott(
k,i,j+2) )
1808 * ( fact_n * ( pott(
k,i,j+1)+pott(
k,i,j ) ) &
1809 + fact_f * ( pott(
k,i,j+2)+pott(
k,i,j-1) ) )
1814 k = iundef; i = iundef; j = iundef
1822 rhot_rk(
k,
is,j) = rhot0(
k,
is,j) &
1823 + dtrk * ( - ( ( tflx_hi(
k,
is,j,
zdir) - tflx_hi(
k-1,
is,j ,
zdir) ) * rcdz(
k) &
1824 + ( tflx_hi(
k,
is,j,
ydir) - tflx_hi(
k ,
is,j-1,
ydir) ) * rcdy(j) ) &
1834 rhot_rk(
k,i,j) = rhot0(
k,i,j) &
1835 + dtrk * ( - ( ( tflx_hi(
k,i,j,
zdir) - tflx_hi(
k-1,i ,j ,
zdir) ) * rcdz(
k) &
1836 + ( tflx_hi(
k,i,j,
xdir) - tflx_hi(
k ,i-1,j ,
xdir) ) * rcdx(i) &
1837 + ( tflx_hi(
k,i,j,
ydir) - tflx_hi(
k ,i ,j-1,
ydir) ) * rcdy(j) ) &
1856 if ( .not. twod )
then
1881 call check( __line__, dens0(
k,
is,j) )
1886 call check( __line__, dens_t(
k,
is,j) )
1888 dens_rk(
k,
is,j) = dens0(
k,
is,j) &
1889 + dtrk * ( - ( ( mflx_hi(
k,
is,j,
zdir)-mflx_hi(
k-1,
is,j,
zdir) ) * rcdz(
k) &
1901 call check( __line__, dens0(
k,i,j) )
1902 call check( __line__, mflx_hi(
k ,i ,j ,
zdir) )
1903 call check( __line__, mflx_hi(
k-1,i ,j ,
zdir) )
1904 call check( __line__, mflx_hi(
k ,i ,j ,
xdir) )
1905 call check( __line__, mflx_hi(
k ,i-1,j ,
xdir) )
1906 call check( __line__, mflx_hi(
k ,i ,j ,
ydir) )
1907 call check( __line__, mflx_hi(
k ,i ,j-1,
ydir) )
1908 call check( __line__, dens_t(
k,i,j) )
1910 dens_rk(
k,i,j) = dens0(
k,i,j) &
1911 + dtrk * ( - ( ( mflx_hi(
k,i,j,
zdir)-mflx_hi(
k-1,i ,j,
zdir) ) * rcdz(
k) &
1912 + ( mflx_hi(
k,i,j,
xdir)-mflx_hi(
k ,i-1,j,
xdir) ) * rcdx(i) &
1913 + ( mflx_hi(
k,i,j,
ydir)-mflx_hi(
k ,i, j-1,
ydir) ) * rcdy(j) ) &
1921 k = iundef; i = iundef; j = iundef
1927 dpres_n, dpres, rhot_rk, rhot, dens_rk, dens, b,&
1937 #ifdef HIVI_BICGSTAB
1950 real(RP),
intent(out) :: DPRES_N(KA,IA,JA)
1951 real(RP),
intent(in) :: DPRES(KA,IA,JA)
1952 real(RP),
intent(in) :: M(7,KA,IA,JA)
1953 real(RP),
intent(in) :: B(KA,IA,JA)
1954 logical,
intent(in) :: TwoD
1956 real(RP) :: r0(KA,IA,JA)
1958 real(RP) :: p(KA,IA,JA)
1959 real(RP) :: Mp(KA,IA,JA)
1960 real(RP) :: s(KA,IA,JA)
1961 real(RP) :: Ms(KA,IA,JA)
1962 real(RP) :: al, be, w
1964 real(RP),
pointer :: r(:,:,:)
1965 real(RP),
pointer :: rn(:,:,:)
1966 real(RP),
pointer :: swap(:,:,:)
1967 real(RP),
target :: v0(KA,IA,JA)
1968 real(RP),
target :: v1(KA,IA,JA)
1970 real(RP) :: norm, error, error2
1972 real(RP) :: iprod(2)
1976 integer :: iis, iie, jjs, jje
1994 call mul_matrix( v1, m, dpres, twod )
2007 norm = norm + b(k,i,j)**2
2012 k = iundef; i = iundef; j = iundef
2020 call check( __line__, b(k,i,j) )
2021 call check( __line__, v1(k,i,j) )
2023 r(k,i,j) = b(k,i,j) - v1(k,i,j)
2028 k = iundef; i = iundef; j = iundef
2034 r0(k,i,j) = r(k,i,j)
2040 k = iundef; i = iundef; j = iundef
2047 call check( __line__, r(k,i,j) )
2048 call check( __line__, r0(k,i,j) )
2050 r0r = r0r + r0(k,i,j) * r(k,i,j)
2055 k = iundef; i = iundef; j = iundef
2064 dpres_n(k,i,j) = dpres(k,i,j)
2072 call mpi_allreduce(iprod, buf, 2, mtype, mpi_sum,
comm_world, ierror)
2085 call check( __line__, r(k,i,j) )
2087 error = error + r(k,i,j)**2
2092 k = iundef; i = iundef; j = iundef
2094 call mpi_allreduce(error, buf, 1, mtype, mpi_sum,
comm_world, ierror)
2098 log_info(
"solve_bicgstab",*) iter, error/norm
2100 if ( sqrt(error/norm) < epsilon .OR. error > error2 )
then
2102 log_info(
"solve_bicgstab",*)
"Bi-CGSTAB converged:", iter
2108 call comm_vars8( p, 1 )
2109 call comm_wait ( p, 1 )
2110 call mul_matrix( mp, m, p, twod )
2117 call check( __line__, r0(k,i,j) )
2118 call check( __line__, mp(k,i,j) )
2120 iprod(1) = iprod(1) + r0(k,i,j) * mp(k,i,j)
2125 k = iundef; i = iundef; j = iundef
2127 call mpi_allreduce(iprod, buf, 1, mtype, mpi_sum,
comm_world, ierror)
2134 call check( __line__, r(k,i,j) )
2135 call check( __line__, mp(k,i,j) )
2137 s(k,i,j) = r(k,i,j) - al*mp(k,i,j)
2142 k = iundef; i = iundef; j = iundef
2145 call comm_vars8( s, 1 )
2146 call comm_wait ( s, 1 )
2147 call mul_matrix( ms, m, s, twod )
2154 call check( __line__, ms(k,i,j) )
2155 call check( __line__, s(k,i,j) )
2157 iprod(1) = iprod(1) + ms(k,i,j) * s(k,i,j)
2158 iprod(2) = iprod(2) + ms(k,i,j) * ms(k,i,j)
2163 k = iundef; i = iundef; j = iundef
2165 call mpi_allreduce(iprod, buf, 2, mtype, mpi_sum,
comm_world, ierror)
2179 call check( __line__, dpres_n(k,i,j) )
2180 call check( __line__, p(k,i,j) )
2181 call check( __line__, s(k,i,j) )
2183 dpres_n(k,i,j) = dpres_n(k,i,j) + al*p(k,i,j) + w*s(k,i,j)
2188 k = iundef; i = iundef; j = iundef
2195 call check( __line__, s(k,i,j) )
2196 call check( __line__, ms(k,i,j) )
2198 rn(k,i,j) = s(k,i,j) - w*ms(k,i,j)
2203 k = iundef; i = iundef; j = iundef
2210 call check( __line__, r0(k,i,j) )
2211 call check( __line__, rn(k,i,j) )
2213 iprod(1) = iprod(1) + r0(k,i,j) * rn(k,i,j)
2218 k = iundef; i = iundef; j = iundef
2226 call mpi_allreduce(iprod, r0r, 1, mtype, mpi_sum,
comm_world, ierror)
2233 call check( __line__, rn(k,i,j) )
2234 call check( __line__, p(k,i,j) )
2235 call check( __line__, mp(k,i,j) )
2237 p(k,i,j) = rn(k,i,j) + be * ( p(k,i,j) - w*mp(k,i,j) )
2242 k = iundef; i = iundef; j = iundef
2253 if ( iter >= itmax )
then
2254 log_error(
"solve_bicgstab",*)
'not converged', error, norm
2263 POTT, RCs2T, GRAV, &
2265 RCDZ, RFDZ, RCDX, RFDX, RCDY, RFDY, FDZ, &
2270 IIS, IIE, JJS, JJE )
2272 real(RP),
intent(inout) :: M(7,KA,IA,JA)
2273 real(RP),
intent(in) :: POTT(KA,IA,JA)
2274 real(RP),
intent(in) :: RCs2T(KA,IA,JA)
2275 real(RP),
intent(in) :: GRAV
2276 real(RP),
intent(in) :: G(KA,IA,JA,7)
2277 real(RP),
intent(in) :: J33G
2278 real(RP),
intent(in) :: RCDZ(KA)
2279 real(RP),
intent(in) :: RFDZ(KA-1)
2280 real(RP),
intent(in) :: RFDX(IA-1)
2281 real(RP),
intent(in) :: RCDX(IA)
2282 real(RP),
intent(in) :: RCDY(JA)
2283 real(RP),
intent(in) :: RFDY(JA-1)
2284 real(RP),
intent(in) :: FDZ(KA-1)
2285 real(RP),
intent(in) :: rdt
2286 real(RP),
intent(in) :: FACT_N
2287 real(RP),
intent(in) :: FACT_F
2288 logical,
intent(in) :: TwoD
2289 integer,
intent(in) :: I_XYZ
2290 integer,
intent(in) :: I_XYW
2291 integer,
intent(in) :: IIS
2292 integer,
intent(in) :: IIE
2293 integer,
intent(in) :: JJS
2294 integer,
intent(in) :: JJE
2304 call check( __line__, pott(k-2,i,j) )
2305 call check( __line__, pott(k-1,i,j) )
2306 call check( __line__, pott(k ,i,j) )
2307 call check( __line__, pott(k+1,i,j) )
2308 call check( __line__, pott(k+2,i,j) )
2309 call check( __line__, pott(k,i ,j) )
2310 call check( __line__, pott(k,i,j-2) )
2311 call check( __line__, pott(k,i,j-1) )
2312 call check( __line__, pott(k,i,j ) )
2313 call check( __line__, pott(k,i,j+1) )
2314 call check( __line__, pott(k,i,j+2) )
2315 call check( __line__, g(k-1,i,j,i_xyw) )
2316 call check( __line__, g(k+1,i,j,i_xyw) )
2317 call check( __line__, g(k,i,j,i_xyz) )
2318 call check( __line__, rcs2t(k-1,i,j) )
2319 call check( __line__, rcs2t(k ,i,j) )
2320 call check( __line__, rcs2t(k+1,i,j) )
2324 - ( ( fact_n * (pott(k+1,i,j)+pott(k ,i,j)) &
2325 + fact_f * (pott(k+2,i,j)+pott(k-1,i,j)) ) * rfdz(k ) / g(k ,i,j,i_xyw) &
2326 + ( fact_n * (pott(k ,i,j)+pott(k-1,i,j)) &
2327 + fact_f * (pott(k+1,i,j)+pott(k-2,i,j)) ) * rfdz(k-1) / g(k-1,i,j,i_xyw) &
2328 ) * j33g * j33g * rfdz(k) &
2329 - ( ( fact_n * (pott(k,i,j+1)+pott(k,i,j )) &
2330 + fact_f * (pott(k,i,j+2)+pott(k,i,j-1)) ) * rfdy(j ) &
2331 + ( fact_n * (pott(k,i,j )+pott(k,i,j-1)) &
2332 + fact_f * (pott(k,i,j-1)+pott(k,i,j-2)) ) * rfdy(j-1) &
2333 ) * g(k,i,j,i_xyz) * rfdy(j) &
2334 - g(k,i,j,i_xyz) * rcs2t(k,i,j) * rdt * rdt
2336 m(2,k,i,j) = j33g * j33g / g(k-1,i,j,i_xyw) &
2337 * ( fact_n * (pott(k ,i,j)+pott(k-1,i,j)) &
2338 + fact_f * (pott(k+1,i,j)+pott(k-2,i,j)) ) &
2339 * rfdz(k-1) * rcdz(k) &
2340 - grav * j33g * rcs2t(k-1,i,j) / ( fdz(k)+fdz(k-1) )
2342 m(3,k,i,j) = j33g * j33g / g(k+1,i,j,i_xyw) &
2343 * ( fact_n * (pott(k+1,i,j)+pott(k ,i,j)) &
2344 + fact_f * (pott(k+2,i,j)+pott(k-1,i,j)) ) &
2345 * rfdz(k ) * rcdz(k) &
2346 + grav * j33g * rcs2t(k+1,i,j) / ( fdz(k)+fdz(k-1) )
2353 call check( __line__, pott(
ks ,i,j) )
2354 call check( __line__, pott(
ks+1,i,j) )
2355 call check( __line__, pott(
ks,i ,j) )
2356 call check( __line__, pott(
ks,i,j-2) )
2357 call check( __line__, pott(
ks,i,j-1) )
2358 call check( __line__, pott(
ks,i,j ) )
2359 call check( __line__, pott(
ks,i,j+1) )
2360 call check( __line__, pott(
ks,i,j+2) )
2361 call check( __line__, g(
ks,i,j,i_xyz) )
2362 call check( __line__, rcs2t(
ks,i,j) )
2363 call check( __line__, pott(
ks ,i,j) )
2364 call check( __line__, pott(
ks+1,i,j) )
2365 call check( __line__, g(
ks+1,i,j,i_xyw) )
2366 call check( __line__, rcs2t(
ks+1,i,j) )
2370 - ( 0.5_rp * (pott(
ks+1,i,j)+pott(
ks ,i,j)) * rfdz(
ks ) &
2371 ) * j33g * j33g / g(
ks ,i,j,i_xyw) * rfdz(
ks) &
2372 - ( ( fact_n * (pott(
ks,i,j+1)+pott(
ks,i,j )) &
2373 + fact_f * (pott(
ks,i,j+2)+pott(
ks,i,j-1)) ) * rfdy(j ) &
2374 + ( fact_n * (pott(
ks,i,j )+pott(
ks,i,j-1)) &
2375 + fact_f * (pott(
ks,i,j-1)+pott(
ks,i,j-2)) ) * rfdy(j-1) &
2376 ) * g(
ks,i,j,i_xyz) * rfdy(j) &
2377 - g(
ks,i,j,i_xyz) * rcs2t(
ks,i,j) * rdt * rdt &
2378 + grav * j33g * 0.5_rp * rcs2t(
ks,i,j) * rcdz(
ks)
2380 m(3,
ks,i,j) = j33g * j33g / g(
ks+1,i,j,i_xyw) &
2381 * 0.5_rp * (pott(
ks+1,i,j)+pott(
ks ,i,j)) &
2382 * rfdz(
ks ) * rcdz(
ks) &
2383 + grav * j33g * 0.5_rp * rcs2t(
ks+1,i,j) * rcdz(
ks)
2385 call check( __line__, pott(
ks ,i,j) )
2386 call check( __line__, pott(
ks+1,i,j) )
2387 call check( __line__, pott(
ks+2,i,j) )
2388 call check( __line__, pott(
ks+3,i,j) )
2389 call check( __line__, pott(
ks+1,i ,j) )
2390 call check( __line__, pott(
ks+1,i,j-2) )
2391 call check( __line__, pott(
ks+1,i,j-1) )
2392 call check( __line__, pott(
ks+1,i,j ) )
2393 call check( __line__, pott(
ks+1,i,j+1) )
2394 call check( __line__, pott(
ks+1,i,j+2) )
2395 call check( __line__, g(
ks ,i,j,i_xyw) )
2396 call check( __line__, g(
ks+2,i,j,i_xyw) )
2397 call check( __line__, g(
ks+1,i,j,i_xyz) )
2398 call check( __line__, rcs2t(
ks ,i,j) )
2399 call check( __line__, rcs2t(
ks+1 ,i,j) )
2400 call check( __line__, rcs2t(
ks+2,i,j) )
2404 - ( ( fact_n * (pott(
ks+2,i,j)+pott(
ks+1,i,j)) &
2405 + fact_f * (pott(
ks+3,i,j)+pott(
ks ,i,j)) ) * rfdz(
ks+1) / g(
ks+1,i,j,i_xyw) &
2406 + 0.5_rp * (pott(
ks+1,i,j)+pott(
ks ,i,j)) * rfdz(
ks ) / g(
ks ,i,j,i_xyw) &
2407 ) * j33g * j33g * rfdz(
ks+1) &
2408 - ( ( fact_n * (pott(
ks+1,i,j+1)+pott(
ks+1,i,j )) &
2409 + fact_f * (pott(
ks+1,i,j+2)+pott(
ks+1,i,j-1)) ) * rfdy(j ) &
2410 + ( fact_n * (pott(
ks+1,i,j )+pott(
ks+1,i,j-1)) &
2411 + fact_f * (pott(
ks+1,i,j-1)+pott(
ks+1,i,j-2)) ) * rfdy(j-1) &
2412 ) * g(
ks+1,i,j,i_xyz) * rfdy(j) &
2413 - g(
ks+1,i,j,i_xyz) * rcs2t(
ks+1,i,j) * rdt * rdt
2415 m(2,
ks+1,i,j) = j33g * j33g / g(
ks,i,j,i_xyw) &
2416 * 0.5_rp * (pott(
ks+1,i,j)+pott(
ks ,i,j)) &
2417 * rfdz(
ks ) * rcdz(
ks+1) &
2418 - grav * j33g * rcs2t(
ks ,i,j) / ( fdz(
ks+1)+fdz(
ks) )
2420 m(3,
ks+1,i,j) = j33g * j33g / g(
ks+2,i,j,i_xyw) &
2421 * ( fact_n * (pott(
ks+2,i,j)+pott(
ks+1,i,j)) &
2422 + fact_f * (pott(
ks+3,i,j)+pott(
ks ,i,j)) ) &
2423 * rfdz(
ks+1) * rcdz(
ks+1) &
2424 + grav * j33g * rcs2t(
ks+2,i,j) / ( fdz(
ks+1)+fdz(
ks) )
2426 call check( __line__, pott(
ke-3,i,j) )
2427 call check( __line__, pott(
ke-2,i,j) )
2428 call check( __line__, pott(
ke-1,i,j) )
2429 call check( __line__, pott(
ke ,i,j) )
2430 call check( __line__, pott(
ke-1,i ,j) )
2431 call check( __line__, pott(
ke-1,i,j-2) )
2432 call check( __line__, pott(
ke-1,i,j-1) )
2433 call check( __line__, pott(
ke-1,i,j ) )
2434 call check( __line__, pott(
ke-1,i,j+1) )
2435 call check( __line__, pott(
ke-1,i,j+2) )
2436 call check( __line__, g(
ke-2,i,j,i_xyw) )
2437 call check( __line__, g(
ke ,i,j,i_xyw) )
2438 call check( __line__, g(
ke-1,i,j,i_xyz) )
2439 call check( __line__, rcs2t(
ke-2,i,j) )
2440 call check( __line__, rcs2t(
ke-1,i,j) )
2441 call check( __line__, rcs2t(
ke ,i,j) )
2445 - ( 0.5_rp * (pott(
ke ,i,j)+pott(
ke-1,i,j)) * rfdz(
ke-1) / g(
ke-1,i,j,i_xyw) &
2446 + ( fact_n * (pott(
ke-1,i,j)+pott(
ke-2,i,j)) &
2447 + fact_f * (pott(
ke ,i,j)+pott(
ke-3,i,j)) ) * rfdz(
ke-2) / g(
ke-2,i,j,i_xyw) &
2448 ) * j33g * j33g * rfdz(
ke-1) &
2449 - ( ( fact_n * (pott(
ke-1,i,j+1)+pott(
ke-1,i,j )) &
2450 + fact_f * (pott(
ke-1,i,j+2)+pott(
ke-1,i,j-1)) ) * rfdy(j ) &
2451 + ( fact_n * (pott(
ke-1,i,j )+pott(
ke-1,i,j-1)) &
2452 + fact_f * (pott(
ke-1,i,j-1)+pott(
ke-1,i,j-2)) ) * rfdy(j-1) &
2453 ) * g(
ke-1,i,j,i_xyz) * rfdy(j) &
2454 - g(
ke-1,i,j,i_xyz) * rcs2t(
ke-1,i,j) * rdt * rdt
2456 m(2,
ke-1,i,j) = j33g * j33g / g(
ke-2,i,j,i_xyw) &
2457 * ( fact_n * (pott(
ke-1,i,j)+pott(
ke-2,i,j)) &
2458 + fact_f * (pott(
ke ,i,j)+pott(
ke-3,i,j)) ) &
2459 * rfdz(
ke-2) * rcdz(
ke-1) &
2460 - grav * j33g * rcs2t(
ke-2,i,j) / ( fdz(
ke-1)+fdz(
ke-2) )
2462 m(3,
ke-1,i,j) = j33g * j33g / g(
ke ,i,j,i_xyw) &
2463 * 0.5_rp * (pott(
ke ,i,j)+pott(
ke-1,i,j)) &
2464 * rfdz(
ke-1) * rcdz(
ke-1) &
2465 + grav * j33g * rcs2t(
ke ,i,j) / ( fdz(
ke-1)+fdz(
ke-2) )
2467 call check( __line__, pott(
ke-1,i,j) )
2468 call check( __line__, pott(
ke ,i,j) )
2469 call check( __line__, pott(
ke,i ,j) )
2470 call check( __line__, pott(
ke,i,j-2) )
2471 call check( __line__, pott(
ke,i,j-1) )
2472 call check( __line__, pott(
ke,i,j ) )
2473 call check( __line__, pott(
ke,i,j+1) )
2474 call check( __line__, pott(
ke,i,j+2) )
2475 call check( __line__, g(
ke-1,i,j,i_xyw) )
2476 call check( __line__, g(
ke,i,j,i_xyz) )
2477 call check( __line__, rcs2t(
ke-1,i,j) )
2478 call check( __line__, rcs2t(
ke,i,j) )
2483 + 0.5_rp * (pott(
ke ,i,j)+pott(
ke-1,i,j)) * rfdz(
ke-1) / g(
ke-1,i,j,i_xyw) &
2484 ) * j33g * j33g * rfdz(
ke) &
2485 - ( ( fact_n * (pott(
ke,i,j+1)+pott(
ke,i,j )) &
2486 + fact_f * (pott(
ke,i,j+2)+pott(
ke,i,j-1)) ) * rfdy(j ) &
2487 + ( fact_n * (pott(
ke,i,j )+pott(
ke,i,j-1)) &
2488 + fact_f * (pott(
ke,i,j-1)+pott(
ke,i,j-2)) ) * rfdy(j-1) &
2489 ) * g(
ke,i,j,i_xyz) * rfdy(j) &
2490 - g(
ke,i,j,i_xyz) * rcs2t(
ke,i,j) * rdt * rdt &
2491 - grav * j33g * 0.5_rp * rcs2t(
ke,i,j) * rcdz(
ke)
2493 m(2,
ke,i,j) = j33g * j33g / g(
ke-1,i,j,i_xyw) &
2494 * 0.5_rp * (pott(
ke ,i,j)+pott(
ke-1,i,j)) &
2495 * rfdz(
ke-1) * rcdz(
ke) &
2496 - grav * j33g * 0.5_rp * rcs2t(
ke,i,j) * rcdz(
ke)
2505 call check( __line__, pott(k-2,i,j) )
2506 call check( __line__, pott(k-1,i,j) )
2507 call check( __line__, pott(k ,i,j) )
2508 call check( __line__, pott(k+1,i,j) )
2509 call check( __line__, pott(k+2,i,j) )
2510 call check( __line__, pott(k,i-2,j) )
2511 call check( __line__, pott(k,i-1,j) )
2512 call check( __line__, pott(k,i ,j) )
2513 call check( __line__, pott(k,i+1,j) )
2514 call check( __line__, pott(k,i+2,j) )
2515 call check( __line__, pott(k,i,j-2) )
2516 call check( __line__, pott(k,i,j-1) )
2517 call check( __line__, pott(k,i,j ) )
2518 call check( __line__, pott(k,i,j+1) )
2519 call check( __line__, pott(k,i,j+2) )
2520 call check( __line__, g(k-1,i,j,i_xyw) )
2521 call check( __line__, g(k+1,i,j,i_xyw) )
2522 call check( __line__, g(k,i,j,i_xyz) )
2523 call check( __line__, rcs2t(k-1,i,j) )
2524 call check( __line__, rcs2t(k ,i,j) )
2525 call check( __line__, rcs2t(k+1,i,j) )
2529 - ( ( fact_n * (pott(k+1,i,j)+pott(k ,i,j)) &
2530 + fact_f * (pott(k+2,i,j)+pott(k-1,i,j)) ) * rfdz(k ) / g(k ,i,j,i_xyw) &
2531 + ( fact_n * (pott(k ,i,j)+pott(k-1,i,j)) &
2532 + fact_f * (pott(k+1,i,j)+pott(k-2,i,j)) ) * rfdz(k-1) / g(k-1,i,j,i_xyw) &
2533 ) * j33g * j33g * rfdz(k) &
2534 - ( ( fact_n * (pott(k,i+1,j)+pott(k,i ,j)) &
2535 + fact_f * (pott(k,i+2,j)+pott(k,i-1,j)) ) * rfdx(i ) &
2536 + ( fact_n * (pott(k,i ,j)+pott(k,i-1,j)) &
2537 + fact_f * (pott(k,i+1,j)+pott(k,i-2,j)) ) * rfdx(i-1) &
2538 ) * g(k,i,j,i_xyz) * rfdx(i) &
2539 - ( ( fact_n * (pott(k,i,j+1)+pott(k,i,j )) &
2540 + fact_f * (pott(k,i,j+2)+pott(k,i,j-1)) ) * rfdy(j ) &
2541 + ( fact_n * (pott(k,i,j )+pott(k,i,j-1)) &
2542 + fact_f * (pott(k,i,j-1)+pott(k,i,j-2)) ) * rfdy(j-1) &
2543 ) * g(k,i,j,i_xyz) * rfdy(j) &
2544 - g(k,i,j,i_xyz) * rcs2t(k,i,j) * rdt * rdt
2546 m(2,k,i,j) = j33g * j33g / g(k-1,i,j,i_xyw) &
2547 * ( fact_n * (pott(k ,i,j)+pott(k-1,i,j)) &
2548 + fact_f * (pott(k+1,i,j)+pott(k-2,i,j)) ) &
2549 * rfdz(k-1) * rcdz(k) &
2550 - grav * j33g * rcs2t(k-1,i,j) / ( fdz(k)+fdz(k-1) )
2552 m(3,k,i,j) = j33g * j33g / g(k+1,i,j,i_xyw) &
2553 * ( fact_n * (pott(k+1,i,j)+pott(k ,i,j)) &
2554 + fact_f * (pott(k+2,i,j)+pott(k-1,i,j)) ) &
2555 * rfdz(k ) * rcdz(k) &
2556 + grav * j33g * rcs2t(k+1,i,j) / ( fdz(k)+fdz(k-1) )
2565 call check( __line__, pott(
ks ,i,j) )
2566 call check( __line__, pott(
ks+1,i,j) )
2567 call check( __line__, pott(
ks,i-2,j) )
2568 call check( __line__, pott(
ks,i-1,j) )
2569 call check( __line__, pott(
ks,i ,j) )
2570 call check( __line__, pott(
ks,i+1,j) )
2571 call check( __line__, pott(
ks,i+2,j) )
2572 call check( __line__, pott(
ks,i,j-2) )
2573 call check( __line__, pott(
ks,i,j-1) )
2574 call check( __line__, pott(
ks,i,j ) )
2575 call check( __line__, pott(
ks,i,j+1) )
2576 call check( __line__, pott(
ks,i,j+2) )
2577 call check( __line__, g(
ks,i,j,i_xyz) )
2578 call check( __line__, rcs2t(
ks,i,j) )
2579 call check( __line__, pott(
ks ,i,j) )
2580 call check( __line__, pott(
ks+1,i,j) )
2581 call check( __line__, g(
ks+1,i,j,i_xyw) )
2582 call check( __line__, rcs2t(
ks+1,i,j) )
2586 - ( 0.5_rp * (pott(
ks+1,i,j)+pott(
ks ,i,j)) * rfdz(
ks ) &
2587 ) * j33g * j33g / g(
ks ,i,j,i_xyw) * rfdz(
ks) &
2588 - ( ( fact_n * (pott(
ks,i+1,j)+pott(
ks,i ,j)) &
2589 + fact_f * (pott(
ks,i+2,j)+pott(
ks,i-1,j)) ) * rfdx(i ) &
2590 + ( fact_n * (pott(
ks,i ,j)+pott(
ks,i-1,j)) &
2591 + fact_f * (pott(
ks,i+1,j)+pott(
ks,i-2,j)) ) * rfdx(i-1) &
2592 ) * g(
ks,i,j,i_xyz) * rfdx(i) &
2593 - ( ( fact_n * (pott(
ks,i,j+1)+pott(
ks,i,j )) &
2594 + fact_f * (pott(
ks,i,j+2)+pott(
ks,i,j-1)) ) * rfdy(j ) &
2595 + ( fact_n * (pott(
ks,i,j )+pott(
ks,i,j-1)) &
2596 + fact_f * (pott(
ks,i,j-1)+pott(
ks,i,j-2)) ) * rfdy(j-1) &
2597 ) * g(
ks,i,j,i_xyz) * rfdy(j) &
2598 - g(
ks,i,j,i_xyz) * rcs2t(
ks,i,j) * rdt * rdt &
2599 + grav * j33g * 0.5_rp * rcs2t(
ks,i,j) * rcdz(
ks)
2601 m(3,
ks,i,j) = j33g * j33g / g(
ks+1,i,j,i_xyw) &
2602 * 0.5_rp * (pott(
ks+1,i,j)+pott(
ks ,i,j)) &
2603 * rfdz(
ks ) * rcdz(
ks) &
2604 + grav * j33g * 0.5_rp * rcs2t(
ks+1,i,j) * rcdz(
ks)
2606 call check( __line__, pott(
ks ,i,j) )
2607 call check( __line__, pott(
ks+1,i,j) )
2608 call check( __line__, pott(
ks+2,i,j) )
2609 call check( __line__, pott(
ks+3,i,j) )
2610 call check( __line__, pott(
ks+1,i-2,j) )
2611 call check( __line__, pott(
ks+1,i-1,j) )
2612 call check( __line__, pott(
ks+1,i ,j) )
2613 call check( __line__, pott(
ks+1,i+1,j) )
2614 call check( __line__, pott(
ks+1,i+2,j) )
2615 call check( __line__, pott(
ks+1,i,j-2) )
2616 call check( __line__, pott(
ks+1,i,j-1) )
2617 call check( __line__, pott(
ks+1,i,j ) )
2618 call check( __line__, pott(
ks+1,i,j+1) )
2619 call check( __line__, pott(
ks+1,i,j+2) )
2620 call check( __line__, g(
ks ,i,j,i_xyw) )
2621 call check( __line__, g(
ks+2,i,j,i_xyw) )
2622 call check( __line__, g(
ks+1,i,j,i_xyz) )
2623 call check( __line__, rcs2t(
ks ,i,j) )
2624 call check( __line__, rcs2t(
ks+1 ,i,j) )
2625 call check( __line__, rcs2t(
ks+2,i,j) )
2629 - ( ( fact_n * (pott(
ks+2,i,j)+pott(
ks+1,i,j)) &
2630 + fact_f * (pott(
ks+3,i,j)+pott(
ks ,i,j)) ) * rfdz(
ks+1) / g(
ks+1,i,j,i_xyw) &
2631 + 0.5_rp * (pott(
ks+1,i,j)+pott(
ks ,i,j)) * rfdz(
ks ) / g(
ks ,i,j,i_xyw) &
2632 ) * j33g * j33g * rfdz(
ks+1) &
2633 - ( ( fact_n * (pott(
ks+1,i+1,j)+pott(
ks+1,i ,j)) &
2634 + fact_f * (pott(
ks+1,i+2,j)+pott(
ks+1,i-1,j)) ) * rfdx(i ) &
2635 + ( fact_n * (pott(
ks+1,i ,j)+pott(
ks+1,i-1,j)) &
2636 + fact_f * (pott(
ks+1,i+1,j)+pott(
ks+1,i-2,j)) ) * rfdx(i-1) &
2637 ) * g(
ks+1,i,j,i_xyz) * rfdx(i) &
2638 - ( ( fact_n * (pott(
ks+1,i,j+1)+pott(
ks+1,i,j )) &
2639 + fact_f * (pott(
ks+1,i,j+2)+pott(
ks+1,i,j-1)) ) * rfdy(j ) &
2640 + ( fact_n * (pott(
ks+1,i,j )+pott(
ks+1,i,j-1)) &
2641 + fact_f * (pott(
ks+1,i,j-1)+pott(
ks+1,i,j-2)) ) * rfdy(j-1) &
2642 ) * g(
ks+1,i,j,i_xyz) * rfdy(j) &
2643 - g(
ks+1,i,j,i_xyz) * rcs2t(
ks+1,i,j) * rdt * rdt
2645 m(2,
ks+1,i,j) = j33g * j33g / g(
ks,i,j,i_xyw) &
2646 * 0.5_rp * (pott(
ks+1,i,j)+pott(
ks ,i,j)) &
2647 * rfdz(
ks ) * rcdz(
ks+1) &
2648 - grav * j33g * rcs2t(
ks ,i,j) / ( fdz(
ks+1)+fdz(
ks) )
2650 m(3,
ks+1,i,j) = j33g * j33g / g(
ks+2,i,j,i_xyw) &
2651 * ( fact_n * (pott(
ks+2,i,j)+pott(
ks+1,i,j)) &
2652 + fact_f * (pott(
ks+3,i,j)+pott(
ks ,i,j)) ) &
2653 * rfdz(
ks+1) * rcdz(
ks+1) &
2654 + grav * j33g * rcs2t(
ks+2,i,j) / ( fdz(
ks+1)+fdz(
ks) )
2656 call check( __line__, pott(
ke-3,i,j) )
2657 call check( __line__, pott(
ke-2,i,j) )
2658 call check( __line__, pott(
ke-1,i,j) )
2659 call check( __line__, pott(
ke ,i,j) )
2660 call check( __line__, pott(
ke-1,i-2,j) )
2661 call check( __line__, pott(
ke-1,i-1,j) )
2662 call check( __line__, pott(
ke-1,i ,j) )
2663 call check( __line__, pott(
ke-1,i+1,j) )
2664 call check( __line__, pott(
ke-1,i+2,j) )
2665 call check( __line__, pott(
ke-1,i,j-2) )
2666 call check( __line__, pott(
ke-1,i,j-1) )
2667 call check( __line__, pott(
ke-1,i,j ) )
2668 call check( __line__, pott(
ke-1,i,j+1) )
2669 call check( __line__, pott(
ke-1,i,j+2) )
2670 call check( __line__, g(
ke-2,i,j,i_xyw) )
2671 call check( __line__, g(
ke ,i,j,i_xyw) )
2672 call check( __line__, g(
ke-1,i,j,i_xyz) )
2673 call check( __line__, rcs2t(
ke-2,i,j) )
2674 call check( __line__, rcs2t(
ke-1,i,j) )
2675 call check( __line__, rcs2t(
ke ,i,j) )
2679 - ( 0.5_rp * (pott(
ke ,i,j)+pott(
ke-1,i,j)) * rfdz(
ke-1) / g(
ke-1,i,j,i_xyw) &
2680 + ( fact_n * (pott(
ke-1,i,j)+pott(
ke-2,i,j)) &
2681 + fact_f * (pott(
ke ,i,j)+pott(
ke-3,i,j)) ) * rfdz(
ke-2) / g(
ke-2,i,j,i_xyw) &
2682 ) * j33g * j33g * rfdz(
ke-1) &
2683 - ( ( fact_n * (pott(
ke-1,i+1,j)+pott(
ke-1,i ,j)) &
2684 + fact_f * (pott(
ke-1,i+2,j)+pott(
ke-1,i-1,j)) ) * rfdx(i ) &
2685 + ( fact_n * (pott(
ke-1,i ,j)+pott(
ke-1,i-1,j)) &
2686 + fact_f * (pott(
ke-1,i+1,j)+pott(
ke-1,i-2,j)) ) * rfdx(i-1) &
2687 ) * g(
ke-1,i,j,i_xyz) * rfdx(i) &
2688 - ( ( fact_n * (pott(
ke-1,i,j+1)+pott(
ke-1,i,j )) &
2689 + fact_f * (pott(
ke-1,i,j+2)+pott(
ke-1,i,j-1)) ) * rfdy(j ) &
2690 + ( fact_n * (pott(
ke-1,i,j )+pott(
ke-1,i,j-1)) &
2691 + fact_f * (pott(
ke-1,i,j-1)+pott(
ke-1,i,j-2)) ) * rfdy(j-1) &
2692 ) * g(
ke-1,i,j,i_xyz) * rfdy(j) &
2693 - g(
ke-1,i,j,i_xyz) * rcs2t(
ke-1,i,j) * rdt * rdt
2695 m(2,
ke-1,i,j) = j33g * j33g / g(
ke-2,i,j,i_xyw) &
2696 * ( fact_n * (pott(
ke-1,i,j)+pott(
ke-2,i,j)) &
2697 + fact_f * (pott(
ke ,i,j)+pott(
ke-3,i,j)) ) &
2698 * rfdz(
ke-2) * rcdz(
ke-1) &
2699 - grav * j33g * rcs2t(
ke-2,i,j) / ( fdz(
ke-1)+fdz(
ke-2) )
2701 m(3,
ke-1,i,j) = j33g * j33g / g(
ke ,i,j,i_xyw) &
2702 * 0.5_rp * (pott(
ke ,i,j)+pott(
ke-1,i,j)) &
2703 * rfdz(
ke-1) * rcdz(
ke-1) &
2704 + grav * j33g * rcs2t(
ke ,i,j) / ( fdz(
ke-1)+fdz(
ke-2) )
2706 call check( __line__, pott(
ke-1,i,j) )
2707 call check( __line__, pott(
ke ,i,j) )
2708 call check( __line__, pott(
ke,i-2,j) )
2709 call check( __line__, pott(
ke,i-1,j) )
2710 call check( __line__, pott(
ke,i ,j) )
2711 call check( __line__, pott(
ke,i+1,j) )
2712 call check( __line__, pott(
ke,i+2,j) )
2713 call check( __line__, pott(
ke,i,j-2) )
2714 call check( __line__, pott(
ke,i,j-1) )
2715 call check( __line__, pott(
ke,i,j ) )
2716 call check( __line__, pott(
ke,i,j+1) )
2717 call check( __line__, pott(
ke,i,j+2) )
2718 call check( __line__, g(
ke-1,i,j,i_xyw) )
2719 call check( __line__, g(
ke,i,j,i_xyz) )
2720 call check( __line__, rcs2t(
ke-1,i,j) )
2721 call check( __line__, rcs2t(
ke,i,j) )
2726 + 0.5_rp * (pott(
ke ,i,j)+pott(
ke-1,i,j)) * rfdz(
ke-1) / g(
ke-1,i,j,i_xyw) &
2727 ) * j33g * j33g * rfdz(
ke) &
2728 - ( ( fact_n * (pott(
ke,i+1,j)+pott(
ke,i ,j)) &
2729 + fact_f * (pott(
ke,i+2,j)+pott(
ke,i-1,j)) ) * rfdx(i ) &
2730 + ( fact_n * (pott(
ke,i ,j)+pott(
ke,i-1,j)) &
2731 + fact_f * (pott(
ke,i+1,j)+pott(
ke,i-2,j)) ) * rfdx(i-1) &
2732 ) * g(
ke,i,j,i_xyz) * rfdx(i) &
2733 - ( ( fact_n * (pott(
ke,i,j+1)+pott(
ke,i,j )) &
2734 + fact_f * (pott(
ke,i,j+2)+pott(
ke,i,j-1)) ) * rfdy(j ) &
2735 + ( fact_n * (pott(
ke,i,j )+pott(
ke,i,j-1)) &
2736 + fact_f * (pott(
ke,i,j-1)+pott(
ke,i,j-2)) ) * rfdy(j-1) &
2737 ) * g(
ke,i,j,i_xyz) * rfdy(j) &
2738 - g(
ke,i,j,i_xyz) * rcs2t(
ke,i,j) * rdt * rdt &
2739 - grav * j33g * 0.5_rp * rcs2t(
ke,i,j) * rcdz(
ke)
2741 m(2,
ke,i,j) = j33g * j33g / g(
ke-1,i,j,i_xyw) &
2742 * 0.5_rp * (pott(
ke ,i,j)+pott(
ke-1,i,j)) &
2743 * rfdz(
ke-1) * rcdz(
ke) &
2744 - grav * j33g * 0.5_rp * rcs2t(
ke,i,j) * rcdz(
ke)
2750 k = iundef; i = iundef; j = iundef
2759 call check( __line__, g(k,i,j-1,i_xyz) )
2760 call check( __line__, g(k,i,j+1,i_xyz) )
2761 call check( __line__, pott(k,i ,j ) )
2762 call check( __line__, pott(k,i ,j-2) )
2763 call check( __line__, pott(k,i ,j-1) )
2764 call check( __line__, pott(k,i ,j ) )
2765 call check( __line__, pott(k,i ,j+1) )
2766 call check( __line__, pott(k,i ,j+2) )
2773 m(6,k,i,j) = g(k,i,j-1,i_xyz) &
2774 * ( fact_n * (pott(k,i,j )+pott(k,i,j-1)) &
2775 + fact_f * (pott(k,i,j+1)+pott(k,i,j-2)) ) &
2776 * rfdy(j-1) * rcdy(j)
2778 m(7,k,i,j) = g(k,i,j+1,i_xyz) &
2779 * ( fact_n * (pott(k,i,j+1)+pott(k,i,j )) &
2780 + fact_f * (pott(k,i,j+2)+pott(k,i,j-1)) ) &
2781 * rfdy(j ) * rcdy(j)
2790 call check( __line__, g(k,i-1,j,i_xyz) )
2791 call check( __line__, g(k,i+1,j,i_xyz) )
2792 call check( __line__, g(k,i,j-1,i_xyz) )
2793 call check( __line__, g(k,i,j+1,i_xyz) )
2794 call check( __line__, pott(k,i-2,j ) )
2795 call check( __line__, pott(k,i-1,j ) )
2796 call check( __line__, pott(k,i ,j ) )
2797 call check( __line__, pott(k,i+1,j ) )
2798 call check( __line__, pott(k,i+2,j ) )
2799 call check( __line__, pott(k,i ,j-2) )
2800 call check( __line__, pott(k,i ,j-1) )
2801 call check( __line__, pott(k,i ,j ) )
2802 call check( __line__, pott(k,i ,j+1) )
2803 call check( __line__, pott(k,i ,j+2) )
2806 m(4,k,i,j) = g(k,i-1,j,i_xyz) &
2807 * ( fact_n * (pott(k,i ,j)+pott(k,i-1,j)) &
2808 + fact_f * (pott(k,i+1,j)+pott(k,i-2,j)) ) &
2809 * rfdx(i-1) * rcdx(i)
2811 m(5,k,i,j) = g(k,i+1,j,i_xyz) &
2812 * ( fact_n * (pott(k,i+1,j)+pott(k,i ,j)) &
2813 + fact_f * (pott(k,i+2,j)+pott(k,i-1,j)) ) &
2814 * rfdx(i ) * rcdx(i)
2816 m(6,k,i,j) = g(k,i,j-1,i_xyz) &
2817 * ( fact_n * (pott(k,i,j )+pott(k,i,j-1)) &
2818 + fact_f * (pott(k,i,j+1)+pott(k,i,j-2)) ) &
2819 * rfdy(j-1) * rcdy(j)
2821 m(7,k,i,j) = g(k,i,j+1,i_xyz) &
2822 * ( fact_n * (pott(k,i,j+1)+pott(k,i,j )) &
2823 + fact_f * (pott(k,i,j+2)+pott(k,i,j-1)) ) &
2824 * rfdy(j ) * rcdy(j)
2830 k = iundef; i = iundef; j = iundef
2836 subroutine mul_matrix(V, M, C, TwoD)
2838 real(RP),
intent(out) :: V(KA,IA,JA)
2839 real(RP),
intent(in) :: M(7,KA,IA,JA)
2840 real(RP),
intent(in) :: C(KA,IA,JA)
2841 logical,
intent(in) :: TwoD
2855 call check( __line__, m(1,k,i,j) )
2856 call check( __line__, m(2,k,i,j) )
2857 call check( __line__, m(3,k,i,j) )
2858 call check( __line__, m(6,k,i,j) )
2859 call check( __line__, m(7,k,i,j) )
2860 call check( __line__, c(k ,i ,j ) )
2861 call check( __line__, c(k-1,i ,j ) )
2862 call check( __line__, c(k+1,i ,j ) )
2863 call check( __line__, c(k ,i ,j-1) )
2864 call check( __line__, c(k ,i ,j+1) )
2866 v(k,i,j) = m(1,k,i,j) * c(k ,i ,j ) &
2867 + m(2,k,i,j) * c(k-1,i ,j ) &
2868 + m(3,k,i,j) * c(k+1,i ,j ) &
2869 + m(6,k,i,j) * c(k ,i ,j-1) &
2870 + m(7,k,i,j) * c(k ,i ,j+1)
2877 call check( __line__, m(1,
ks,i,j) )
2878 call check( __line__, m(3,
ks,i,j) )
2879 call check( __line__, m(6,
ks,i,j) )
2880 call check( __line__, m(7,
ks,i,j) )
2881 call check( __line__, c(
ks ,i ,j ) )
2882 call check( __line__, c(
ks+1,i ,j ) )
2883 call check( __line__, c(
ks ,i ,j-1) )
2884 call check( __line__, c(
ks ,i ,j+1) )
2885 call check( __line__, m(1,
ke,i,j) )
2886 call check( __line__, m(2,
ke,i,j) )
2887 call check( __line__, m(6,
ke,i,j) )
2888 call check( __line__, m(7,
ke,i,j) )
2889 call check( __line__, c(
ke ,i ,j ) )
2890 call check( __line__, c(
ke-1,i ,j ) )
2891 call check( __line__, c(
ke ,i ,j-1) )
2892 call check( __line__, c(
ke ,i ,j+1) )
2894 v(
ks,i,j) = m(1,
ks,i,j) * c(
ks ,i ,j ) &
2895 + m(3,
ks,i,j) * c(
ks+1,i ,j ) &
2896 + m(6,
ks,i,j) * c(
ks ,i ,j-1) &
2897 + m(7,
ks,i,j) * c(
ks ,i ,j+1)
2898 v(
ke,i,j) = m(1,
ke,i,j) * c(
ke ,i ,j ) &
2899 + m(2,
ke,i,j) * c(
ke-1,i ,j ) &
2900 + m(6,
ke,i,j) * c(
ke ,i ,j-1) &
2901 + m(7,
ke,i,j) * c(
ke ,i ,j+1)
2911 call check( __line__, m(1,k,i,j) )
2912 call check( __line__, m(2,k,i,j) )
2913 call check( __line__, m(3,k,i,j) )
2914 call check( __line__, m(4,k,i,j) )
2915 call check( __line__, m(5,k,i,j) )
2916 call check( __line__, m(6,k,i,j) )
2917 call check( __line__, m(7,k,i,j) )
2918 call check( __line__, c(k ,i ,j ) )
2919 call check( __line__, c(k-1,i ,j ) )
2920 call check( __line__, c(k+1,i ,j ) )
2921 call check( __line__, c(k ,i-1,j ) )
2922 call check( __line__, c(k ,i+1,j ) )
2923 call check( __line__, c(k ,i ,j-1) )
2924 call check( __line__, c(k ,i ,j+1) )
2926 v(k,i,j) = m(1,k,i,j) * c(k ,i ,j ) &
2927 + m(2,k,i,j) * c(k-1,i ,j ) &
2928 + m(3,k,i,j) * c(k+1,i ,j ) &
2929 + m(4,k,i,j) * c(k ,i-1,j ) &
2930 + m(5,k,i,j) * c(k ,i+1,j ) &
2931 + m(6,k,i,j) * c(k ,i ,j-1) &
2932 + m(7,k,i,j) * c(k ,i ,j+1)
2941 call check( __line__, m(1,
ks,i,j) )
2942 call check( __line__, m(3,
ks,i,j) )
2943 call check( __line__, m(4,
ks,i,j) )
2944 call check( __line__, m(5,
ks,i,j) )
2945 call check( __line__, m(6,
ks,i,j) )
2946 call check( __line__, m(7,
ks,i,j) )
2947 call check( __line__, c(
ks ,i ,j ) )
2948 call check( __line__, c(
ks+1,i ,j ) )
2949 call check( __line__, c(
ks ,i-1,j ) )
2950 call check( __line__, c(
ks ,i+1,j ) )
2951 call check( __line__, c(
ks ,i ,j-1) )
2952 call check( __line__, c(
ks ,i ,j+1) )
2953 call check( __line__, m(1,
ke,i,j) )
2954 call check( __line__, m(2,
ke,i,j) )
2955 call check( __line__, m(4,
ke,i,j) )
2956 call check( __line__, m(5,
ke,i,j) )
2957 call check( __line__, m(6,
ke,i,j) )
2958 call check( __line__, m(7,
ke,i,j) )
2959 call check( __line__, c(
ke ,i ,j ) )
2960 call check( __line__, c(
ke-1,i ,j ) )
2961 call check( __line__, c(
ke ,i-1,j ) )
2962 call check( __line__, c(
ke ,i+1,j ) )
2963 call check( __line__, c(
ke ,i ,j-1) )
2964 call check( __line__, c(
ke ,i ,j+1) )
2966 v(
ks,i,j) = m(1,
ks,i,j) * c(
ks ,i ,j ) &
2967 + m(3,
ks,i,j) * c(
ks+1,i ,j ) &
2968 + m(4,
ks,i,j) * c(
ks ,i-1,j ) &
2969 + m(5,
ks,i,j) * c(
ks ,i+1,j ) &
2970 + m(6,
ks,i,j) * c(
ks ,i ,j-1) &
2971 + m(7,
ks,i,j) * c(
ks ,i ,j+1)
2972 v(
ke,i,j) = m(1,
ke,i,j) * c(
ke ,i ,j ) &
2973 + m(2,
ke,i,j) * c(
ke-1,i ,j ) &
2974 + m(4,
ke,i,j) * c(
ke ,i-1,j ) &
2975 + m(5,
ke,i,j) * c(
ke ,i+1,j ) &
2976 + m(6,
ke,i,j) * c(
ke ,i ,j-1) &
2977 + m(7,
ke,i,j) * c(
ke ,i ,j+1)
2983 k = iundef; i = iundef; j = iundef
2987 end subroutine mul_matrix
2990 subroutine solve_multigrid
2991 end subroutine solve_multigrid
2995 subroutine check_solver( &
2999 real(RP),
intent(in) :: DPRES(KA,IA,JA)
3000 real(RP),
intent(in) :: M(7,KA,IA,JA)
3001 real(RP),
intent(in) :: B(KA,IA,JA)
3002 logical,
intent(in) :: TwoD
3004 real(RP) :: B2(KA,IA,JA)
3008 call mul_matrix(b2, m, dpres, twod)
3013 err = abs( b2(k,i,j) - b(k,i,j) )
3014 if ( err > 1.e-5_rp .and. abs( err / b(k,i,j) ) > 1.e-5_rp )
then
3015 log_error(
"check_solver",*)
"solver error is too large: ", k,i,j, b(k,i,j), b2(k,i,j)
3022 end subroutine check_solver
3024 subroutine check_pres( &
3032 real(RP),
intent(in) :: DPRES_N(KA,IA,JA)
3033 real(RP),
intent(in) :: DPRES(KA,IA,JA)
3034 real(RP),
intent(in) :: RHOT_RK(KA,IA,JA)
3035 real(RP),
intent(in) :: RHOT(KA,IA,JA)
3036 real(RP),
intent(in) :: DENS_RK(KA,IA,JA)
3037 real(RP),
intent(in) :: DENS(KA,IA,JA)
3038 real(RP),
intent(in) :: B(KA,IA,JA)
3039 real(RP),
intent(in) :: RT2P(KA,IA,JA)
3041 real(RP) :: lhs, rhs
3047 lhs = dpres_n(k,i,j) - dpres(k,i,j)
3048 rhs = rt2p(k,i,j) * ( rhot_rk(k,i,j) - rhot(k,i,j) )
3049 if ( abs( (lhs - rhs) / lhs ) > 1e-15 )
then
3050 log_error(
"check_pres",*)
"error is too large: ", k,i,j, lhs, rhs, &
3051 dpres_n(k,i,j),dpres(k,i,j),rhot_rk(k,i,j),rhot(k,i,j),dens_rk(k,i,j),dens(k,i,j),b(k,i,j)
3057 end subroutine check_pres