13 #define PROFILE_START(name) call fapp_start(name, 1, 1)
14 #define PROFILE_STOP(name) call fapp_stop (name, 1, 1)
16 #define PROFILE_START(name)
17 #define PROFILE_STOP(name)
32 #if defined DEBUG || defined QUICKDEBUG
59 #define F2H(k,p,idx) (CDZ(k+p-1)*GSQRT(k+p-1,i,j,idx)/(CDZ(k)*GSQRT(k,i,j,idx)+CDZ(k+1)*GSQRT(k+1,i,j,idx)))
61 # define F2H(k,p,idx) 0.5_RP
68 integer,
private,
parameter :: NB = 1
69 integer,
private,
parameter :: VA_FVM_HEVI = 0
87 character(len=*),
intent(in) :: atmos_dyn_type
88 integer,
intent(out) :: va_out
89 character(len=H_SHORT),
intent(out) :: var_name(:)
90 character(len=H_MID),
intent(out) :: var_desc(:)
91 character(len=H_SHORT),
intent(out) :: var_unit(:)
94 if ( atmos_dyn_type /=
'FVM-HEVI' .AND. atmos_dyn_type /=
'HEVI' )
then
95 log_error(
"ATMOS_DYN_Tstep_short_fvm_hevi_regist",*)
'ATMOS_DYN_TYPE is not FVM-HEVI. Check!'
105 log_info(
"ATMOS_DYN_Tstep_short_fvm_hevi_regist",*)
'Register additional prognostic variables (HEVI)'
106 if ( va_out < 1 )
then
107 log_info_cont(*)
'=> nothing.'
119 log_info(
"ATMOS_DYN_Tstep_short_fvm_hevi_setup",*)
'HEVI Setup'
126 DENS_RK, MOMZ_RK, MOMX_RK, MOMY_RK, RHOT_RK, &
129 DENS0, MOMZ0, MOMX0, MOMY0, RHOT0, &
130 DENS, MOMZ, MOMX, MOMY, RHOT, &
131 DENS_t, MOMZ_t, MOMX_t, MOMY_t, RHOT_t, &
133 DPRES0, RT2P, CORIOLI, &
134 num_diff, wdamp_coef, divdmp_coef, DDIV, &
135 FLAG_FCT_MOMENTUM, FLAG_FCT_T, &
136 FLAG_FCT_ALONG_STREAM, &
137 CDZ, FDZ, FDX, FDY, &
138 RCDZ, RCDX, RCDY, RFDZ, RFDX, RFDY, &
139 PHI, GSQRT, J13G, J23G, J33G, MAPF, &
140 REF_dens, REF_rhot, &
141 BND_W, BND_E, BND_S, BND_N, TwoD, &
146 rdry => const_rdry, &
147 cvdry => const_cvdry, &
148 cpdry => const_cpdry, &
151 grav => const_grav, &
181 real(
rp),
intent(out) :: dens_rk(
ka,
ia,
ja)
182 real(
rp),
intent(out) :: momz_rk(
ka,
ia,
ja)
183 real(
rp),
intent(out) :: momx_rk(
ka,
ia,
ja)
184 real(
rp),
intent(out) :: momy_rk(
ka,
ia,
ja)
185 real(
rp),
intent(out) :: rhot_rk(
ka,
ia,
ja)
189 real(
rp),
intent(inout) :: mflx_hi(
ka,
ia,
ja,3)
190 real(
rp),
intent(out) :: tflx_hi(
ka,
ia,
ja,3)
192 real(
rp),
intent(in),
target :: dens0(
ka,
ia,
ja)
193 real(
rp),
intent(in),
target :: momz0(
ka,
ia,
ja)
194 real(
rp),
intent(in),
target :: momx0(
ka,
ia,
ja)
195 real(
rp),
intent(in),
target :: momy0(
ka,
ia,
ja)
196 real(
rp),
intent(in),
target :: rhot0(
ka,
ia,
ja)
198 real(
rp),
intent(in) :: dens(
ka,
ia,
ja)
199 real(
rp),
intent(in) :: momz(
ka,
ia,
ja)
200 real(
rp),
intent(in) :: momx(
ka,
ia,
ja)
201 real(
rp),
intent(in) :: momy(
ka,
ia,
ja)
202 real(
rp),
intent(in) :: rhot(
ka,
ia,
ja)
204 real(
rp),
intent(in) :: dens_t(
ka,
ia,
ja)
205 real(
rp),
intent(in) :: momz_t(
ka,
ia,
ja)
206 real(
rp),
intent(in) :: momx_t(
ka,
ia,
ja)
207 real(
rp),
intent(in) :: momy_t(
ka,
ia,
ja)
208 real(
rp),
intent(in) :: rhot_t(
ka,
ia,
ja)
213 real(
rp),
intent(in) :: dpres0(
ka,
ia,
ja)
214 real(
rp),
intent(in) :: rt2p(
ka,
ia,
ja)
215 real(
rp),
intent(in) :: corioli(
ia,
ja)
216 real(
rp),
intent(in) :: num_diff(
ka,
ia,
ja,5,3)
217 real(
rp),
intent(in) :: wdamp_coef(
ka)
218 real(
rp),
intent(in) :: divdmp_coef
219 real(
rp),
intent(in) :: ddiv(
ka,
ia,
ja)
221 logical,
intent(in) :: flag_fct_momentum
222 logical,
intent(in) :: flag_fct_t
223 logical,
intent(in) :: flag_fct_along_stream
225 real(
rp),
intent(in) :: cdz(
ka)
226 real(
rp),
intent(in) :: fdz(
ka-1)
227 real(
rp),
intent(in) :: fdx(
ia-1)
228 real(
rp),
intent(in) :: fdy(
ja-1)
229 real(
rp),
intent(in) :: rcdz(
ka)
230 real(
rp),
intent(in) :: rcdx(
ia)
231 real(
rp),
intent(in) :: rcdy(
ja)
232 real(
rp),
intent(in) :: rfdz(
ka-1)
233 real(
rp),
intent(in) :: rfdx(
ia-1)
234 real(
rp),
intent(in) :: rfdy(
ja-1)
236 real(
rp),
intent(in) :: phi (
ka,
ia,
ja)
237 real(
rp),
intent(in) :: gsqrt (
ka,
ia,
ja,7)
238 real(
rp),
intent(in) :: j13g (
ka,
ia,
ja,7)
239 real(
rp),
intent(in) :: j23g (
ka,
ia,
ja,7)
240 real(
rp),
intent(in) :: j33g
241 real(
rp),
intent(in) :: mapf (
ia,
ja,2,4)
242 real(
rp),
intent(in) :: ref_dens(
ka,
ia,
ja)
243 real(
rp),
intent(in) :: ref_rhot(
ka,
ia,
ja)
245 logical,
intent(in) :: bnd_w
246 logical,
intent(in) :: bnd_e
247 logical,
intent(in) :: bnd_s
248 logical,
intent(in) :: bnd_n
249 logical,
intent(in) :: twod
251 real(
rp),
intent(in) :: dtrk
252 logical,
intent(in) :: last
292 integer :: iis, iie, jjs, jje
302 qflx_hi(:,:,:,:) = undef
303 qflx_j13(:,:,:) = undef
304 qflx_j23(:,:,:) = undef
307 #if defined DEBUG || defined QUICKDEBUG
308 dens_rk( 1:
ks-1,:,:) = undef
309 dens_rk(
ke+1:
ka ,:,:) = undef
310 momz_rk( 1:
ks-1,:,:) = undef
311 momz_rk(
ke+1:
ka ,:,:) = undef
312 momx_rk( 1:
ks-1,:,:) = undef
313 momx_rk(
ke+1:
ka ,:,:) = undef
314 momy_rk( 1:
ks-1,:,:) = undef
315 momy_rk(
ke+1:
ka ,:,:) = undef
316 rhot_rk( 1:
ks-1,:,:) = undef
317 rhot_rk(
ke+1:
ka ,:,:) = undef
318 prog_rk( 1:
ks-1,:,:,:) = undef
319 prog_rk(
ke+1:
ka ,:,:,:) = undef
332 if ( bnd_w ) ifs_off = 0
333 if ( bnd_s ) jfs_off = 0
341 profile_start(
"hevi_pres")
345 do i = iis, min(iie+1,
ia)
348 call check( __line__, dpres0(
k,i,j) )
349 call check( __line__, rt2p(
k,i,j) )
350 call check( __line__, rhot(
k,i,j) )
351 call check( __line__, ref_rhot(
k,i,j) )
353 dpres(
k,i,j) = dpres0(
k,i,j) + rt2p(
k,i,j) * ( rhot(
k,i,j) - ref_rhot(
k,i,j) )
355 dpres(
ks-1,i,j) = dpres0(
ks-1,i,j) - dens(
ks,i,j) * ( phi(
ks-1,i,j) - phi(
ks+1,i,j) )
356 dpres(
ke+1,i,j) = dpres0(
ke+1,i,j) - dens(
ke,i,j) * ( phi(
ke+1,i,j) - phi(
ke-1,i,j) )
359 profile_stop(
"hevi_pres")
363 profile_start(
"hevi_mflx_z")
372 call check( __line__, momy(
k+1,
is,j) )
373 call check( __line__, momy(
k+1,
is,j-1) )
374 call check( __line__, momy(
k ,
is,j) )
375 call check( __line__, momy(
k ,
is,j-1) )
378 * ( momy(
k+1,
is,j)+momy(
k+1,
is,j-1) &
379 + momy(
k ,
is,j)+momy(
k ,
is,j-1) ) &
380 + gsqrt(
k,
is,j,
i_xyw) / mapf(
is,j,2,
i_xy) * num_diff(
k,
is,j,
i_dens,
zdir)
389 mflx_hi(
ks-1,i,j,
zdir) = 0.0_rp
392 call check( __line__, momx(
k+1,i ,j) )
393 call check( __line__, momx(
k+1,i-1,j) )
394 call check( __line__, momx(
k ,i ,j) )
395 call check( __line__, momx(
k ,i+1,j) )
396 call check( __line__, momy(
k+1,i,j) )
397 call check( __line__, momy(
k+1,i,j-1) )
398 call check( __line__, momy(
k ,i,j) )
399 call check( __line__, momy(
k ,i,j-1) )
402 * ( momx(
k+1,i,j)+momx(
k+1,i-1,j) &
403 + momx(
k ,i,j)+momx(
k ,i-1,j) ) &
404 + j23g(
k,i,j,
i_xyw) * 0.25_rp / mapf(i,j,1,
i_xy) &
405 * ( momy(
k+1,i,j)+momy(
k+1,i,j-1) &
406 + momy(
k ,i,j)+momy(
k ,i,j-1) ) &
407 + gsqrt(
k,i,j,
i_xyw) / ( mapf(i,j,1,
i_xy)*mapf(i,j,2,
i_xy) ) * num_diff(
k,i,j,
i_dens,
zdir)
409 mflx_hi(
ke ,i,j,
zdir) = 0.0_rp
414 k = iundef; i = iundef; j = iundef
416 profile_stop(
"hevi_mflx_z")
418 if ( .not. twod )
then
419 profile_start(
"hevi_mflx_x")
420 iss = max(iis-1,
is-ifs_off)
430 call check( __line__, momx(
k,i,j) )
439 k = iundef; i = iundef; j = iundef
441 profile_stop(
"hevi_mflx_x")
447 do j = max(jjs-1,
js-jfs_off), min(jje,
jeh)
452 call check( __line__, momy(
k,i,j) )
461 k = iundef; i = iundef; j = iundef
465 profile_start(
"hevi_sr")
478 call check( __line__, dens0(
k,
is,j) )
481 call check( __line__, dens_t(
k,
is,j) )
484 advch = - ( mflx_hi(
k,
is,j,
ydir)-mflx_hi(
k ,
is,j-1,
ydir) ) * rcdy(j)
485 sr(
k,
is,j) = ( advcv + advch ) * mapf(
is,j,2,
i_xy) / gsqrt(
k,
is,j,
i_xyz) + dens_t(
k,
is,j)
506 call check( __line__, dens0(
k,i,j) )
507 call check( __line__, mflx_hi(
k ,i ,j ,
xdir) )
508 call check( __line__, mflx_hi(
k ,i-1,j ,
xdir) )
509 call check( __line__, mflx_hi(
k ,i ,j ,
ydir) )
510 call check( __line__, mflx_hi(
k ,i ,j-1,
ydir) )
511 call check( __line__, dens_t(
k,i,j) )
513 advcv = - ( mflx_hi(
k,i,j,
zdir)-mflx_hi(
k-1,i ,j,
zdir) ) * rcdz(
k)
514 advch = - ( ( mflx_hi(
k,i,j,
xdir)-mflx_hi(
k ,i-1,j,
xdir) ) * rcdx(i) &
515 + ( mflx_hi(
k,i,j,
ydir)-mflx_hi(
k ,i, j-1,
ydir) ) * rcdy(j) )
516 sr(
k,i,j) = ( advcv + advch ) * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / gsqrt(
k,i,j,
i_xyz) + dens_t(
k,i,j)
519 advch_t(
k,i,j,
i_dens) = ( advch + advcv ) * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / gsqrt(
k,i,j,
i_xyz)
527 k = iundef; i = iundef; j = iundef
529 profile_stop(
"hevi_sr")
535 profile_start(
"hevi_momz_qflxhi_z")
538 gsqrt(:,:,:,
i_xyz), j33g, &
542 profile_stop(
"hevi_momz_qflxhi_z")
544 profile_start(
"hevi_momz_qflxj")
548 gsqrt(:,:,:,
i_xyz), j13g(:,:,:,
i_xyz), mapf(:,:,:,
i_xy), &
553 gsqrt(:,:,:,
i_xyz), j23g(:,:,:,
i_xyz), mapf(:,:,:,
i_xy), &
556 profile_stop(
"hevi_momz_qflxj")
559 if ( .not. twod )
then
560 profile_start(
"hevi_momz_qflxhi_x")
567 profile_stop(
"hevi_momz_qflxhi_x")
571 profile_start(
"hevi_momz_qflxhi_y")
578 profile_stop(
"hevi_momz_qflxhi_y")
581 profile_start(
"hevi_sw")
597 call check( __line__, qflx_j23(
k ,
is,j) )
598 call check( __line__, qflx_j23(
k-1,
is,j) )
601 call check( __line__, ddiv(
k ,
is,j) )
602 call check( __line__, ddiv(
k+1,
is,j) )
603 call check( __line__, momz0(
k,
is,j) )
604 call check( __line__, momz_t(
k,
is,j) )
607 + qflx_j23(
k,
is,j) - qflx_j23(
k-1,
is,j ) ) * rfdz(
k)
608 advch = - ( qflx_hi(
k,
is,j,
ydir) - qflx_hi(
k,
is,j-1,
ydir) ) * rcdy(j) &
610 wdmp = - wdamp_coef(
k) * momz0(
k,
is,j)
611 div = divdmp_coef / dtrk * ( ddiv(
k+1,
is,j)-ddiv(
k,
is,j) ) * fdz(
k)
612 sw(
k,
is,j) = ( advcv + advch ) / gsqrt(
k,
is,j,
i_xyw) &
613 + wdmp + div + momz_t(
k,
is,j)
618 wdmp_t(
k,
is,j) = wdmp
619 ddiv_t(
k,
is,j,1) = div
638 call check( __line__, qflx_hi(
k ,i ,j ,
zdir) )
639 call check( __line__, qflx_hi(
k-1,i ,j ,
zdir) )
640 call check( __line__, qflx_j13(
k ,i ,j) )
641 call check( __line__, qflx_j13(
k-1,i ,j) )
642 call check( __line__, qflx_j23(
k ,i ,j) )
643 call check( __line__, qflx_j23(
k-1,i ,j) )
644 call check( __line__, qflx_hi(
k ,i ,j ,
xdir) )
645 call check( __line__, qflx_hi(
k ,i-1,j ,
xdir) )
646 call check( __line__, qflx_hi(
k ,i ,j ,
ydir) )
647 call check( __line__, qflx_hi(
k ,i ,j-1,
ydir) )
648 call check( __line__, ddiv(
k ,i,j) )
649 call check( __line__, ddiv(
k+1,i,j) )
650 call check( __line__, momz0(
k,i,j) )
651 call check( __line__, momz_t(
k,i,j) )
653 advcv = - ( qflx_hi(
k,i,j,
zdir) - qflx_hi(
k-1,i ,j ,
zdir) &
654 + qflx_j13(
k,i,j) - qflx_j13(
k-1,i ,j ) &
655 + qflx_j23(
k,i,j) - qflx_j23(
k-1,i ,j ) ) * rfdz(
k)
656 advch = - ( ( qflx_hi(
k,i,j,
xdir) - qflx_hi(
k,i-1,j ,
xdir) ) * rcdx(i) &
657 + ( qflx_hi(
k,i,j,
ydir) - qflx_hi(
k,i ,j-1,
ydir) ) * rcdy(j) ) &
658 * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy)
659 wdmp = - wdamp_coef(
k) * momz0(
k,i,j)
660 div = divdmp_coef / dtrk * ( ddiv(
k+1,i,j)-ddiv(
k,i,j) ) * fdz(
k)
661 sw(
k,i,j) = ( advcv + advch ) / gsqrt(
k,i,j,
i_xyw) &
662 + wdmp + div + momz_t(
k,i,j)
668 ddiv_t(
k,i,j,1) = div
675 profile_stop(
"hevi_sw")
677 k = iundef; i = iundef; j = iundef
689 call check( __line__, rhot(
k,i,j) )
690 call check( __line__, dens(
k,i,j) )
692 pott(
k,i,j) = rhot(
k,i,j) / dens(
k,i,j)
697 k = iundef; i = iundef; j = iundef
702 mflx_hi(:,:,:,
zdir), pott, gsqrt(:,:,:,
i_xyw), &
710 mflx_hi(:,:,:,
xdir), pott, gsqrt(:,:,:,
i_uyz), &
717 mflx_hi(:,:,:,
ydir), pott, gsqrt(:,:,:,
i_xvz), &
723 profile_start(
"hevi_st")
740 call check( __line__, rhot_t(
k,
is,j) )
743 advch = - ( tflx_hi(
k,
is,j,
ydir) - tflx_hi(
k ,
is,j-1,
ydir) ) * rcdy(j)
744 st(
k,
is,j) = ( advcv + advch ) * mapf(
is,j,2,
i_xy) / gsqrt(
k,
is,j,
i_xyz) + rhot_t(
k,
is,j)
765 call check( __line__, tflx_hi(
k ,i ,j ,
zdir) )
766 call check( __line__, tflx_hi(
k-1,i ,j ,
zdir) )
767 call check( __line__, tflx_hi(
k ,i ,j ,
xdir) )
768 call check( __line__, tflx_hi(
k ,i-1,j ,
xdir) )
769 call check( __line__, tflx_hi(
k ,i ,j ,
ydir) )
770 call check( __line__, tflx_hi(
k ,i ,j-1,
ydir) )
771 call check( __line__, rhot_t(
k,i,j) )
773 advcv = - ( tflx_hi(
k,i,j,
zdir) - tflx_hi(
k-1,i ,j ,
zdir) ) * rcdz(
k)
774 advch = - ( ( tflx_hi(
k,i,j,
xdir) - tflx_hi(
k ,i-1,j ,
xdir) ) * rcdx(i) &
775 + ( tflx_hi(
k,i,j,
ydir) - tflx_hi(
k ,i ,j-1,
ydir) ) * rcdy(j) )
776 st(
k,i,j) = ( advcv + advch ) * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / gsqrt(
k,i,j,
i_xyz) + rhot_t(
k,i,j)
779 advch_t(
k,i,j,
i_rhot) = ( advcv + advch ) * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / gsqrt(
k,i,j,
i_xyz)
787 k = iundef; i = iundef; j = iundef
789 profile_stop(
"hevi_st")
793 profile_start(
"hevi_solver")
820 momz(:,i,j), pott(:,i,j), gsqrt(:,i,j,
i_xyz), &
824 a(
k) = dtrk**2 * j33g * rcdz(
k) * rt2p(
k,i,j) * j33g / gsqrt(
k,i,j,
i_xyz)
826 b = grav * dtrk**2 * j33g / ( cdz(
ks+1) + cdz(
ks) )
828 f2(
ks) = 1.0_rp + ( pt(
ks ) * rfdz(
ks) * ( a(
ks+1)+a(
ks) ) ) / gsqrt(
ks,i,j,
i_xyw)
830 b = grav * dtrk**2 * j33g / ( cdz(
k+1) + cdz(
k) )
831 f1(
k) = - ( pt(
k+1) * rfdz(
k) * a(
k+1) + b ) / gsqrt(
k,i,j,
i_xyw)
832 f2(
k) = 1.0_rp + ( pt(
k ) * rfdz(
k) * ( a(
k+1)+a(
k) ) ) / gsqrt(
k,i,j,
i_xyw)
833 f3(
k) = - ( pt(
k-1) * rfdz(
k) * a(
k) - b ) / gsqrt(
k,i,j,
i_xyw)
835 b = grav * dtrk**2 * j33g / ( cdz(
ke) + cdz(
ke-1) )
836 f2(
ke-1) = 1.0_rp + ( pt(
ke-1) * rfdz(
ke-1) * ( a(
ke)+a(
ke-1) ) ) / gsqrt(
ke-1,i,j,
i_xyw)
837 f3(
ke-1) = - ( pt(
ke-2) * rfdz(
ke-1) * a(
ke-1) - b ) / gsqrt(
ke-1,i,j,
i_xyw)
840 pg = - ( dpres(
k+1,i,j) + rt2p(
k+1,i,j)*dtrk*st(
k+1,i,j) &
841 - dpres(
k ,i,j) - rt2p(
k ,i,j)*dtrk*st(
k ,i,j) ) &
842 * rfdz(
k) * j33g / gsqrt(
k,i,j,
i_xyw) &
844 * ( ( dens(
k+1,i,j) - ref_dens(
k+1,i,j) + sr(
k+1,i,j) * dtrk ) &
845 + ( dens(
k ,i,j) - ref_dens(
k ,i,j) + sr(
k ,i,j) * dtrk ) )
846 c(
k-
ks+1) = momz(
k,i,j) + dtrk * ( pg + sw(
k,i,j) )
848 if ( lhist ) pg_t(
k,i,j,1) = pg
854 f1(:), f2(:), f3(:) )
857 #ifdef DEBUG_HEVI2HEVE
859 c(
k-
ks+1) = momz(
k,i,j)
861 + j33g * momz(
k,i,j) / ( mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) )
863 + j33g * momz(
k,i,j) * pt(
k) / ( mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) )
865 momz_rk(
k,i,j) = momz0(
k,i,j) &
867 - j33g * ( dpres(
k+1,i,j)-dpres(
k,i,j) ) * rfdz(
k) / gsqrt(
k,i,j,
i_xyw) &
868 - grav * 0.5_rp * ( (dens(
k,i,j)-ref_dens(
k,i,j)) + (dens(
k+1,i,j)-ref_dens(
k+1,i,j)) ) &
873 + j33g * c(
k-
ks+1) / ( mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) )
875 + j33g * c(
k-
ks+1) * pt(
k) / ( mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) )
877 momz_rk(
k,i,j) = momz0(
k,i,j) &
878 + ( c(
k-
ks+1) - momz(
k,i,j) )
881 momz_rk(
ks-1,i,j) = 0.0_rp
882 momz_rk(
ke ,i,j) = 0.0_rp
885 advcv = - c(1) * j33g * rcdz(
ks) / gsqrt(
ks,i,j,
i_xyz)
886 dens_rk(
ks,i,j) = dens0(
ks,i,j) + dtrk * ( advcv + sr(
ks,i,j) )
888 if ( lhist ) advcv_t(
ks,i,j,
i_dens) = advcv
890 advcv = - c(1) * pt(
ks) * j33g * rcdz(
ks) / gsqrt(
ks,i,j,
i_xyz)
891 rhot_rk(
ks,i,j) = rhot0(
ks,i,j) + dtrk * ( advcv + st(
ks,i,j) )
893 if ( lhist ) advcv_t(
ks,i,j,
i_rhot) = advcv
896 advcv = - ( c(
k-
ks+1) - c(
k-
ks) ) &
897 * j33g * rcdz(
k) / gsqrt(
k,i,j,
i_xyz)
898 dens_rk(
k,i,j) = dens0(
k,i,j) + dtrk * ( advcv + sr(
k,i,j) )
900 if ( lhist ) advcv_t(
k,i,j,
i_dens) = advcv
902 advcv = - ( c(
k-
ks+1) * pt(
k) - c(
k-
ks) * pt(
k-1) ) &
903 * j33g * rcdz(
k) / gsqrt(
k,i,j,
i_xyz)
904 rhot_rk(
k,i,j) = rhot0(
k,i,j) + dtrk * ( advcv + st(
k,i,j) )
906 if ( lhist ) advcv_t(
k,i,j,
i_rhot) = advcv
910 dens_rk(
ke,i,j) = dens0(
ke,i,j) + dtrk * ( advcv + sr(
ke,i,j) )
912 if ( lhist ) advcv_t(
ke,i,j,
i_dens) = advcv
915 rhot_rk(
ke,i,j) = rhot0(
ke,i,j) + dtrk * ( advcv + st(
ke,i,j) )
917 if ( lhist ) advcv_t(
ke,i,j,
i_rhot) = advcv
921 call check_equation( &
923 dens(:,i,j), momz(:,i,j), rhot(:,i,j), dpres(:,i,j), &
925 sr(:,i,j), sw(:,i,j), st(:,i,j), &
926 j33g, gsqrt(:,i,j,:), &
934 k = iundef; i = iundef; j = iundef
937 profile_stop(
"hevi_solver")
942 profile_start(
"hevi_momx")
946 gsqrt(:,:,:,
i_uyw), j33g, &
953 gsqrt(:,:,:,
i_uyz), j13g(:,:,:,
i_uyw), mapf(:,:,:,
i_uy), &
958 gsqrt(:,:,:,
i_uyz), j23g(:,:,:,
i_uyw), mapf(:,:,:,
i_uy), &
1000 call check( __line__, corioli(
is,j) )
1001 call check( __line__, momy(
k,
is,j ) )
1002 call check( __line__, momy(
k,
is,j-1) )
1003 call check( __line__, momx0(
k,
is,j) )
1006 + qflx_j23(
k,
is,j) - qflx_j23(
k-1,
is,j ) ) * rcdz(
k)
1007 advch = - ( qflx_hi(
k,
is,j,
ydir) - qflx_hi(
k ,
is,j-1,
ydir) ) * rcdy(j) &
1009 cf = 0.5_rp * corioli(
is,j) * ( momy(
k,
is,j) + momy(
k,
is,j-1) )
1010 momx_rk(
k,
is,j) = momx0(
k,
is,j) &
1011 + dtrk * ( ( advcv + advch ) / gsqrt(
k,
is,j,
i_uyz) + cf + momx_t(
k,
is,j) )
1016 pg_t(
k,
is,j,2) = 0.0_rp
1018 ddiv_t(
k,
is,j,2) = 0.0_rp
1040 call check( __line__, qflx_hi(
k ,i ,j ,
zdir) )
1041 call check( __line__, qflx_hi(
k-1,i ,j ,
zdir) )
1042 call check( __line__, qflx_hi(
k ,i ,j ,
xdir) )
1043 call check( __line__, qflx_hi(
k ,i-1,j ,
xdir) )
1044 call check( __line__, qflx_hi(
k ,i ,j ,
ydir) )
1045 call check( __line__, qflx_hi(
k ,i ,j-1,
ydir) )
1046 call check( __line__, dpres(
k,i+1,j) )
1047 call check( __line__, dpres(
k,i ,j) )
1048 call check( __line__, corioli(i ,j) )
1049 call check( __line__, corioli(i+1,j) )
1050 call check( __line__, momy(
k,i ,j ) )
1051 call check( __line__, momy(
k,i+1,j ) )
1052 call check( __line__, momy(
k,i ,j-1) )
1053 call check( __line__, momy(
k,i+1,j-1) )
1054 call check( __line__, ddiv(
k,i+1,j) )
1055 call check( __line__, ddiv(
k,i ,j) )
1056 call check( __line__, momx0(
k,i,j) )
1058 advcv = - ( qflx_hi(
k,i,j,
zdir) - qflx_hi(
k-1,i ,j ,
zdir) &
1059 + qflx_j13(
k,i,j) - qflx_j13(
k-1,i ,j ) &
1060 + qflx_j23(
k,i,j) - qflx_j23(
k-1,i ,j ) ) * rcdz(
k)
1061 advch = - ( ( qflx_hi(
k,i,j,
xdir) - qflx_hi(
k ,i-1,j ,
xdir) ) * rfdx(i) &
1062 + ( qflx_hi(
k,i,j,
ydir) - qflx_hi(
k ,i ,j-1,
ydir) ) * rcdy(j) ) &
1063 * mapf(i,j,1,
i_uy) * mapf(i,j,2,
i_uy)
1064 pg = ( ( gsqrt(
k,i+1,j,
i_xyz) * dpres(
k,i+1,j) &
1065 - gsqrt(
k,i ,j,
i_xyz) * dpres(
k,i ,j) &
1068 * 0.5_rp * ( f2h(
k,1,
i_uyz) * ( dpres(
k+1,i+1,j)+dpres(
k+1,i,j) ) &
1069 + f2h(
k,2,
i_uyz) * ( dpres(
k ,i+1,j)+dpres(
k ,i,j) ) ) &
1071 * 0.5_rp * ( f2h(
k,1,
i_uyz) * ( dpres(
k ,i+1,j)+dpres(
k ,i,j) ) &
1072 + f2h(
k,2,
i_uyz) * ( dpres(
k-1,i+1,j)+dpres(
k-1,i,j) ) ) &
1075 cf = 0.125_rp * ( corioli(i+1,j )+corioli(i,j ) ) &
1076 * ( momy(
k,i+1,j )+momy(
k,i,j ) &
1077 + momy(
k,i+1,j-1)+momy(
k,i,j-1) ) &
1078 + 0.25_rp * mapf(i,j,1,
i_uy) * mapf(i,j,2,
i_uy) &
1079 * ( momy(
k,i,j) + momy(
k,i,j-1) + momy(
k,i+1,j) + momy(
k,i+1,j-1) ) &
1080 * ( ( momy(
k,i,j) + momy(
k,i,j-1) + momy(
k,i+1,j) + momy(
k,i+1,j-1) ) * 0.25_rp &
1081 * ( 1.0_rp/mapf(i+1,j,2,
i_xy) - 1.0_rp/mapf(i,j,2,
i_xy) ) * rfdx(i) &
1083 * ( 1.0_rp/mapf(i,j,1,
i_uv) - 1.0_rp/mapf(i,j-1,1,
i_uv) ) * rcdy(j) ) &
1084 * 2.0_rp / ( dens(
k,i+1,j) + dens(
k,i,j) )
1085 div = divdmp_coef / dtrk * ( ddiv(
k,i+1,j)/mapf(i+1,j,2,
i_xy) - ddiv(
k,i,j)/mapf(i,j,1,
i_xy) ) &
1086 * mapf(i,j,1,
i_uy) * mapf(i,j,2,
i_uy) * fdx(i)
1087 momx_rk(
k,i,j) = momx0(
k,i,j) &
1088 + dtrk * ( ( advcv + advch - pg ) / gsqrt(
k,i,j,
i_uyz) + cf + div + momx_t(
k,i,j) )
1093 pg_t(
k,i,j,2) = - pg / gsqrt(
k,i,j,
i_uyz)
1095 ddiv_t(
k,i,j,2) = div
1102 profile_stop(
"hevi_momx")
1104 k = iundef; i = iundef; j = iundef
1108 profile_start(
"hevi_momy")
1112 gsqrt(:,:,:,
i_xvw), j33g, &
1115 iis, iie, jjs, jje )
1119 gsqrt(:,:,:,
i_xvz), j13g(:,:,:,
i_xvw), mapf(:,:,:,
i_xv), &
1121 iis, iie, jjs, jje )
1124 gsqrt(:,:,:,
i_xvz), j23g(:,:,:,
i_xvw), mapf(:,:,:,
i_xv), &
1126 iis, iie, jjs, jje )
1135 iis, iie, jjs, jje )
1144 iis, iie, jjs, jje )
1160 do j = jjs, min(jje,
jeh)
1167 call check( __line__, dpres(
k,
is,j ) )
1168 call check( __line__, dpres(
k,
is,j+1) )
1169 call check( __line__, corioli(
is,j ) )
1170 call check( __line__, corioli(
is,j+1) )
1171 call check( __line__, momx(
k,
is,j ) )
1172 call check( __line__, momx(
k,
is,j+1) )
1173 call check( __line__, ddiv(
k,
is,j+1) )
1174 call check( __line__, ddiv(
k,
is,j ) )
1175 call check( __line__, momy_t(
k,
is,j) )
1176 call check( __line__, momy0(
k,
is,j) )
1179 + qflx_j23(
k,
is,j) - qflx_j23(
k-1,
is,j ) ) * rcdz(
k)
1180 advch = - ( qflx_hi(
k,
is,j,
ydir) - qflx_hi(
k ,
is,j-1,
ydir) ) * rfdy(j) &
1182 pg = ( ( gsqrt(
k,
is,j+1,
i_xyz) * dpres(
k,
is,j+1) &
1186 * 0.5_rp * ( f2h(
k ,1,
i_xvz) * ( dpres(
k+1,
is,j+1)+dpres(
k+1,
is,j) ) &
1187 + f2h(
k ,2,
i_xvz) * ( dpres(
k ,
is,j+1)+dpres(
k ,
is,j) ) ) &
1189 * 0.5_rp * ( f2h(
k-1,1,
i_xvz) * ( dpres(
k ,
is,j+1)+dpres(
k ,
is,j) ) &
1190 + f2h(
k-1,2,
i_xvz) * ( dpres(
k-1,
is,j+1)+dpres(
k-1,
is,j) ) ) &
1193 cf = - 0.25_rp * ( corioli(
is,j+1)+corioli(
is,j) ) &
1194 * ( momx(
k,
is,j+1)+momx(
k,
is,j) )
1195 div = divdmp_coef / dtrk * ( ddiv(
k,
is,j+1) - ddiv(
k,
is,j) ) &
1196 * mapf(
is,j,2,
i_xv) * fdy(j)
1197 momy_rk(
k,
is,j) = momy0(
k,
is,j) &
1198 + dtrk * ( ( advcv + advch - pg ) / gsqrt(
k,
is,j,
i_xvz) + cf + div + momy_t(
k,
is,j) )
1205 ddiv_t(
k,
is,j,3) = div
1222 do j = jjs, min(jje,
jeh)
1226 call check( __line__, qflx_hi(
k ,i ,j ,
zdir) )
1227 call check( __line__, qflx_hi(
k-1,i ,j ,
zdir) )
1228 call check( __line__, qflx_hi(
k ,i ,j ,
xdir) )
1229 call check( __line__, qflx_hi(
k ,i-1,j ,
xdir) )
1230 call check( __line__, qflx_hi(
k ,i ,j ,
ydir) )
1231 call check( __line__, qflx_hi(
k ,i ,j-1,
ydir) )
1232 call check( __line__, dpres(
k,i,j ) )
1233 call check( __line__, dpres(
k,i,j+1) )
1234 call check( __line__, corioli(i,j ) )
1235 call check( __line__, corioli(i,j+1) )
1236 call check( __line__, momx(
k,i ,j ) )
1237 call check( __line__, momx(
k,i ,j+1) )
1238 call check( __line__, momx(
k,i-1,j ) )
1239 call check( __line__, momx(
k,i-1,j+1) )
1240 call check( __line__, ddiv(
k,i,j+1) )
1241 call check( __line__, ddiv(
k,i,j ) )
1242 call check( __line__, momy_t(
k,i,j) )
1243 call check( __line__, momy0(
k,i,j) )
1245 advcv = - ( qflx_hi(
k,i,j,
zdir) - qflx_hi(
k-1,i ,j ,
zdir) &
1246 + qflx_j13(
k,i,j) - qflx_j13(
k-1,i ,j ) &
1247 + qflx_j23(
k,i,j) - qflx_j23(
k-1,i ,j ) ) * rcdz(
k)
1248 advch = - ( ( qflx_hi(
k,i,j,
xdir) - qflx_hi(
k ,i-1,j ,
xdir) ) * rcdx(i) &
1249 + ( qflx_hi(
k,i,j,
ydir) - qflx_hi(
k ,i ,j-1,
ydir) ) * rfdy(j) ) &
1250 * mapf(i,j,1,
i_xv) * mapf(i,j,2,
i_xv)
1251 pg = ( ( gsqrt(
k,i,j+1,
i_xyz) * dpres(
k,i,j+1) &
1252 - gsqrt(
k,i,j ,
i_xyz) * dpres(
k,i,j ) &
1255 * 0.5_rp * ( f2h(
k ,1,
i_xvz) * ( dpres(
k+1,i,j+1)+dpres(
k+1,i,j) ) &
1256 + f2h(
k ,2,
i_xvz) * ( dpres(
k ,i,j+1)+dpres(
k ,i,j) ) ) &
1258 * 0.5_rp * ( f2h(
k-1,1,
i_xvz) * ( dpres(
k ,i,j+1)+dpres(
k ,i,j) ) &
1259 + f2h(
k-1,2,
i_xvz) * ( dpres(
k-1,i,j+1)+dpres(
k-1,i,j) ) ) &
1262 cf = - 0.125_rp * ( corioli(i ,j+1)+corioli(i ,j) ) &
1263 * ( momx(
k,i ,j+1)+momx(
k,i ,j) &
1264 + momx(
k,i-1,j+1)+momx(
k,i-1,j) ) &
1265 - 0.25_rp * mapf(i,j,1,
i_xv) * mapf(i,j,2,
i_xv) &
1266 * ( momx(
k,i,j) + momx(
k,i-1,j) + momx(
k,i,j+1) + momx(
k,i-1,j+1) ) &
1268 * ( 1.0_rp/mapf(i,j,2,
i_uv) - 1.0_rp/mapf(i-1,j,2,
i_uv) ) * rcdx(i) &
1269 - 0.25_rp * ( momx(
k,i,j)+momx(
k,i-1,j)+momx(
k,i,j+1)+momx(
k,i-1,j+1) ) &
1270 * ( 1.0_rp/mapf(i,j+1,1,
i_xy) - 1.0_rp/mapf(i,j,1,
i_xy) ) * rfdy(j) ) &
1271 * 2.0_rp / ( dens(
k,i,j+1) + dens(
k,i,j) )
1272 div = divdmp_coef / dtrk * ( ddiv(
k,i,j+1)/mapf(i,j+1,1,
i_xy) - ddiv(
k,i,j)/mapf(i,j,1,
i_xy) ) &
1273 * mapf(i,j,1,
i_xv) * mapf(i,j,2,
i_xv) * fdy(j)
1274 momy_rk(
k,i,j) = momy0(
k,i,j) &
1275 + dtrk * ( ( advcv + advch - pg ) / gsqrt(
k,i,j,
i_xvz) + cf + div + momy_t(
k,i,j) )
1280 pg_t(
k,i,j,3) = - pg / gsqrt(
k,i,j,
i_xvz)
1282 ddiv_t(
k,i,j,3) = div
1289 profile_stop(
"hevi_momy")
1291 k = iundef; i = iundef; j = iundef
1303 call file_history_in(advcv_t(:,:,:,
i_dens),
'DENS_t_advcv',
'tendency of density (vert. advection) (w/ HIST_TEND)',
'kg/m3/s' )
1304 call file_history_in(advcv_t(:,:,:,
i_momz),
'MOMZ_t_advcv',
'tendency of momentum z (vert. advection) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZHXY')
1305 call file_history_in(advcv_t(:,:,:,
i_momx),
'MOMX_t_advcv',
'tendency of momentum x (vert. advection) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXHY')
1306 call file_history_in(advcv_t(:,:,:,
i_momy),
'MOMY_t_advcv',
'tendency of momentum y (vert. advection) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXYH')
1307 call file_history_in(advcv_t(:,:,:,
i_rhot),
'RHOT_t_advcv',
'tendency of rho*theta (vert. advection) (w/ HIST_TEND)',
'K kg/m3/s' )
1309 call file_history_in(advch_t(:,:,:,
i_dens),
'DENS_t_advch',
'tendency of density (horiz. advection) (w/ HIST_TEND)',
'kg/m3/s' )
1310 call file_history_in(advch_t(:,:,:,
i_momz),
'MOMZ_t_advch',
'tendency of momentum z (horiz. advection) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZHXY')
1311 call file_history_in(advch_t(:,:,:,
i_momx),
'MOMX_t_advch',
'tendency of momentum x (horiz. advection) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXHY')
1312 call file_history_in(advch_t(:,:,:,
i_momy),
'MOMY_t_advch',
'tendency of momentum y (horiz. advection) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXYH')
1313 call file_history_in(advch_t(:,:,:,
i_rhot),
'RHOT_t_advch',
'tendency of rho*theta (horiz. advection) (w/ HIST_TEND)',
'K kg/m3/s' )
1315 call file_history_in(pg_t(:,:,:,1),
'MOMZ_t_pg',
'tendency of momentum z (pressure gradient) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZHXY')
1317 call file_history_in(pg_t(:,:,:,2),
'MOMX_t_pg',
'tendency of momentum x (pressure gradient) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXHY')
1318 call file_history_in(pg_t(:,:,:,3),
'MOMY_t_pg',
'tendency of momentum y (pressure gradient) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXYH')
1320 call file_history_in(wdmp_t(:,:,:),
'MOMZ_t_wdamp',
'tendency of momentum z (Rayleigh damping) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZHXY')
1322 call file_history_in(ddiv_t(:,:,:,1),
'MOMZ_t_ddiv',
'tendency of momentum z (divergence damping) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZHXY')
1324 call file_history_in(ddiv_t(:,:,:,2),
'MOMX_t_ddiv',
'tendency of momentum x (divergence damping) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXHY')
1325 call file_history_in(ddiv_t(:,:,:,3),
'MOMY_t_ddiv',
'tendency of momentum y (divergence damping) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXYH')
1327 call file_history_in(cf_t(:,:,:,1),
'MOMX_t_cf',
'tendency of momentum x (coliolis force) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXHY')
1328 call file_history_in(cf_t(:,:,:,2),
'MOMY_t_cf',
'tendency of momentum y (coliolis force) (w/ HIST_TEND)',
'kg/m2/s2', dim_type=
'ZXYH')
1341 real(RP),
intent(inout) :: C(KMAX-1)
1342 real(RP),
intent(in) :: F1(KA)
1343 real(RP),
intent(in) :: F2(KA)
1344 real(RP),
intent(in) :: F3(KA)
1346 real(RP) :: e(KMAX-2)
1347 real(RP) :: f(KMAX-2)
1353 rdenom = 1.0_rp / f2(
ks)
1354 e(1) = - f1(
ks) * rdenom
1355 f(1) = c(1) * rdenom
1357 rdenom = 1.0_rp / ( f2(k+
ks-1) + f3(k+
ks-1) * e(k-1) )
1358 e(k) = - f1(k+
ks-1) * rdenom
1359 f(k) = ( c(k) - f3(k+
ks-1) * f(k-1) ) * rdenom
1363 c(kmax-1) = ( c(kmax-1) - f3(
ke-1) * f(kmax-2) ) &
1364 / ( f2(
ke-1) + f3(
ke-1) * e(kmax-2) )
1365 do k = kmax-2, 1, -1
1366 c(k) = e(k) * c(k+1) + f(k)
1374 subroutine check_equation( &
1376 DENS, MOMZ, RHOT, DPRES, &
1391 real(RP),
intent(in) :: VECT(KMAX-1)
1392 real(RP),
intent(in) :: DENS(KA)
1393 real(RP),
intent(in) :: MOMZ(KA)
1394 real(RP),
intent(in) :: RHOT(KA)
1395 real(RP),
intent(in) :: DPRES(KA)
1396 real(RP),
intent(in) :: REF_dens(KA)
1397 real(RP),
intent(in) :: Sr(KA)
1398 real(RP),
intent(in) :: Sw(KA)
1399 real(RP),
intent(in) :: St(KA)
1400 real(RP),
intent(in) :: J33G
1401 real(RP),
intent(in) :: G(KA,8)
1402 real(RP),
intent(in) :: RT2P(KA)
1403 real(RP),
intent(in) :: dt
1404 integer ,
intent(in) :: i
1405 integer ,
intent(in) :: j
1407 real(RP),
parameter :: small = 1e-6_rp
1409 real(RP) :: MOMZ_N(KA)
1410 real(RP) :: DENS_N(KA)
1411 real(RP) :: RHOT_N(KA)
1412 real(RP) :: DPRES_N(KA)
1414 real(RP) :: POTT(KA)
1417 real(RP) :: error, lhs, rhs
1422 momz_n(k) = vect(k-
ks+1)
1424 momz_n(:
ks-1) = 0.0_rp
1425 momz_n(
ke:) = 0.0_rp
1429 dens_n(k) = dens(k) &
1430 + dt * ( - j33g * ( momz_n(k) - momz_n(k-1) ) * rcdz(k) / g(k,
i_xyz) + sr(k) )
1432 dens_n(
ks) = dens(
ks) &
1433 + dt * ( - j33g * momz_n(
ks) * rcdz(
ks) / g(
ks,
i_xyz) + sr(
ks) )
1434 dens_n(
ke) = dens(
ke) &
1435 + dt * ( j33g * momz_n(
ke-1) * rcdz(
ke) / g(
ke,
i_xyz) + sr(
ke) )
1439 pott(k) = rhot(k) / dens(k)
1442 pt(k) = ( 7.0_rp * ( pott(k+1) + pott(k ) ) &
1443 - ( pott(k+2) + pott(k-1) ) ) / 12.0_rp
1446 pt(
ks ) = ( pott(
ks+1) + pott(
ks ) ) * 0.5_rp
1447 pt(
ke-1) = ( pott(
ke ) + pott(
ke-1) ) * 0.5_rp
1450 rhot_n(k) = rhot(k) &
1451 + dt * ( - j33g * ( momz_n(k)*pt(k) - momz_n(k-1)*pt(k-1) ) * rcdz(k) / g(k,
i_xyz) &
1454 rhot_n(
ks) = rhot(
ks) &
1455 + dt * ( - j33g * momz_n(
ks)*pt(
ks) * rcdz(
ks) / g(
ks,
i_xyz) + st(
ks) )
1456 rhot_n(
ke) = rhot(
ke) &
1457 + dt * ( j33g * momz_n(
ke-1)*pt(
ke-1) * rcdz(
ke) / g(
ke-1,
i_xyz) + st(
ke) )
1461 dpres_n(k) = dpres(k) + rt2p(k) * ( rhot_n(k) - rhot(k) )
1465 lhs = ( dens_n(k) - dens(k) ) / dt
1466 rhs = - j33g * ( momz_n(k) - momz_n(k-1) ) * rcdz(k) / g(k,
i_xyz) + sr(k)
1467 if ( abs(lhs) < small )
then
1470 error = ( lhs - rhs ) / lhs
1472 if ( abs(error) > small )
then
1473 log_error(
"check_equation",*)
"DENS error", k, i, j, error, lhs, rhs
1474 log_error_cont(*)eps
1480 lhs = ( momz_n(k) - momz(k) ) / dt
1481 rhs = - j33g * ( dpres_n(k+1) - dpres_n(k) ) * rfdz(k) / g(k,
i_xyw) &
1482 - grav * ( ( dens_n(k+1) - ref_dens(k+1) ) + ( dens_n(k) - ref_dens(k) ) ) * 0.5_rp &
1484 if ( abs(lhs) < small )
then
1487 error = ( lhs - rhs ) / lhs
1489 if ( abs(error) > small )
then
1490 log_error(
"check_equation",*)
"MOMZ error", k, i, j, error, lhs, rhs
1491 log_error_cont(*) momz_n(k), momz(k), dt
1492 log_error_cont(*) - j33g * ( dpres(k+1) - dpres(k) ) * rfdz(k) / g(k,
i_xyw) &
1493 - grav * ( ( dens(k+1) - ref_dens(k+1) ) + ( dens(k) - ref_dens(k) ) ) * 0.5_rp &
1500 lhs = ( rhot_n(k) - rhot(k) ) / dt
1501 rhs = - j33g * ( momz_n(k)*pt(k) - momz_n(k-1)*pt(k-1) ) * rcdz(k) / g(k,
i_xyz) + st(k)
1502 if ( abs(lhs) < small )
then
1505 error = ( lhs - rhs ) / lhs
1507 if ( abs(error) > small )
then
1508 log_error(
"check_equation",*)
"RHOT error", k, i, j, error, lhs, rhs
1514 end subroutine check_equation