225 atmos_thermodyn_temp_pres, &
226 atmos_thermodyn_templhv, &
227 atmos_thermodyn_templhs
229 atmos_saturation_alpha, &
230 atmos_saturation_pres2qsat => atmos_saturation_pres2qsat_all
237 real(RP),
intent(out) :: qflx_sgs_momz(
ka,
ia,
ja,3)
238 real(RP),
intent(out) :: qflx_sgs_momx(
ka,
ia,
ja,3)
239 real(RP),
intent(out) :: qflx_sgs_momy(
ka,
ia,
ja,3)
240 real(RP),
intent(out) :: qflx_sgs_rhot(
ka,
ia,
ja,3)
241 real(RP),
intent(out) :: qflx_sgs_rhoq(
ka,
ia,
ja,3,
qa)
243 real(RP),
intent(inout) :: tke (
ka,
ia,
ja)
244 real(RP),
intent(out) :: tke_t(
ka,
ia,
ja)
245 real(RP),
intent(out) :: nu(
ka,
ia,
ja)
246 real(RP),
intent(out) :: ri(
ka,
ia,
ja)
247 real(RP),
intent(out) :: pr(
ka,
ia,
ja)
248 real(RP),
intent(out) :: n2(
ka,
ia,
ja)
250 real(RP),
intent(in) :: momz(
ka,
ia,
ja)
251 real(RP),
intent(in) :: momx(
ka,
ia,
ja)
252 real(RP),
intent(in) :: momy(
ka,
ia,
ja)
253 real(RP),
intent(in) :: rhot(
ka,
ia,
ja)
254 real(RP),
intent(in) :: dens(
ka,
ia,
ja)
255 real(RP),
intent(in) :: qtrc(
ka,
ia,
ja,
qa)
257 real(RP),
intent(in) :: sflx_mw(
ia,
ja)
258 real(RP),
intent(in) :: sflx_mu(
ia,
ja)
259 real(RP),
intent(in) :: sflx_mv(
ia,
ja)
260 real(RP),
intent(in) :: sflx_sh(
ia,
ja)
261 real(RP),
intent(in) :: sflx_qv(
ia,
ja)
263 real(RP),
intent(in) :: gsqrt (
ka,
ia,
ja,7)
264 real(RP),
intent(in) :: j13g (
ka,
ia,
ja,7)
265 real(RP),
intent(in) :: j23g (
ka,
ia,
ja,7)
266 real(RP),
intent(in) :: j33g
267 real(RP),
intent(in) :: mapf (
ia,
ja,2,4)
268 real(DP),
intent(in) :: dt
272 real(RP) :: phin(
ka,
ia,
ja)
279 real(RP) :: dudz2(
ka,
ia,
ja)
280 real(RP) :: q2_2(
ka,
ia,
ja)
282 real(RP) :: rhokh (
ka,
ia,
ja)
284 real(RP) :: sflx_pt(
ia,
ja)
291 real(RP) :: tke_n(
ka,
ia,
ja)
293 real(RP) :: pott(
ka,
ia,
ja)
294 real(RP) :: potv(
ka,
ia,
ja)
295 real(RP) :: potl(
ka,
ia,
ja)
296 real(RP) :: teml(
ka,
ia,
ja)
303 real(RP) :: temp(
ka,
ia,
ja)
304 real(RP) :: pres(
ka,
ia,
ja)
309 real(RP) :: alpha(
ka,
ia,
ja)
326 real(RP) :: flux_x(
ka,
ia,
ja)
327 real(RP) :: flux_y(
ka,
ia,
ja)
336 integer :: k, i, j, iq
337 integer :: iis, iie, jjs, jje
339 if ( io_l )
write(io_fid_log, *)
"*** Physics step: Turbulence (MYNN)" 351 qflx_sgs_momz(k,i,j,
xdir) = 0.0_rp
359 qflx_sgs_momx(k,i,j,
xdir) = 0.0_rp
368 qflx_sgs_momy(k,i,j,
xdir) = 0.0_rp
376 qflx_sgs_rhot(k,i,j,
xdir) = 0.0_rp
385 qflx_sgs_rhoq(k,i,j,
xdir,iq) = 0.0_rp
395 qflx_sgs_momz(k,i,j,
ydir) = 0.0_rp
403 qflx_sgs_momx(k,i,j,
ydir) = 0.0_rp
411 qflx_sgs_momy(k,i,j,
ydir) = 0.0_rp
419 qflx_sgs_rhot(k,i,j,
ydir) = 0.0_rp
428 qflx_sgs_rhoq(k,i,j,
ydir,iq) = 0.0_rp
437 qflx_sgs_momz(k,i,j,
zdir) = 0.0_rp
446 qflx_sgs_rhoq(k,i,j,
zdir,iq) = 0.0_rp
463 u(k,i,j) = 0.5_rp * ( momx(k,i,j) + momx(k,i-1,j) ) / dens(k,i,j)
472 v(k,i,j) = 0.5_rp * ( momy(k,i,j) + momy(k,i,j-1) ) / dens(k,i,j)
480 call atmos_thermodyn_temp_pres( temp, pres, &
484 call atmos_thermodyn_templhv( lhv, temp )
485 call atmos_thermodyn_templhs( lhs, temp )
486 call atmos_saturation_alpha( alpha, temp )
493 if (
i_qc > 0 ) ql = qtrc(k,i,j,
i_qc)
498 if (
i_qi > 0 ) qs = qtrc(k,i,j,
i_qi)
504 qdry = qdry - qtrc(k,i,j,iq)
507 qw(k,i,j) = qtrc(k,i,j,
i_qv) + ql + qs
509 lh(k,i,j) = lhv(k,i,j) * alpha(k,i,j) + lhs(k,i,j) * ( 1.0_rp-alpha(k,i,j) )
511 pott(k,i,j) = rhot(k,i,j) / dens(k,i,j)
513 potl(k,i,j) = pott(k,i,j) * (1.0_rp - 1.0_rp * (lhv(k,i,j) * ql + lhs(k,i,j) * qs) / ( temp(k,i,j) * cp ) )
514 teml(k,i,j) = potl(k,i,j) * temp(k,i,j) / pott(k,i,j)
518 potv(k,i,j) = ( qdry + (epstvap+1.0_rp) * qtrc(k,i,j,
i_qv) ) * potl(k,i,j)
522 sflx_pt(i,j) = sflx_sh(i,j) / ( cp * dens(
ks,i,j) ) &
523 * pott(
ks,i,j) / temp(
ks,i,j)
525 n2(
ks,i,j) = min(atmos_phy_tb_mynn_n2_max, &
526 grav * ( potv(
ks+1,i,j) - potv(
ks,i,j) ) &
527 / ( ( cz(
ks+1,i,j)-cz(
ks,i,j) ) * potv(
ks,i,j) ) )
529 n2(k,i,j) = min(atmos_phy_tb_mynn_n2_max, &
530 grav * ( potv(k+1,i,j) - potv(k-1,i,j) ) &
531 / ( ( cz(k+1,i,j)-cz(k-1,i,j) ) * potv(k,i,j) ) )
534 dudz2(
ks,i,j) = ( ( u(
ks+1,i,j) - u(
ks,i,j) )**2 + ( v(
ks+1,i,j) - v(
ks,i,j) )**2 ) &
535 / ( cz(
ks+1,i,j) - cz(
ks,i,j) )**2
537 dudz2(k,i,j) = ( ( u(k+1,i,j) - u(k-1,i,j) )**2 + ( v(k+1,i,j) - v(k-1,i,j) )**2 ) &
538 / ( cz(k+1,i,j) - cz(k-1,i,j) )**2
542 ri(k,i,j) = n2(k,i,j) / max(dudz2(k,i,j), 1e-10_rp)
548 if ( atmos_phy_tb_mynn_tke_init )
then 553 q(k,i,j) = sqrt( tke_min*2.0_rp )
562 q(k,i,j) = sqrt( max(tke(k,i,j), tke_min)*2.0_rp )
573 sflx_mu, sflx_mv, sflx_pt, &
576 call get_q2_level2( &
580 if ( atmos_phy_tb_mynn_tke_init )
then 585 tke(k,i,j) = max(q2_2(k,i,j) * 0.5_rp, tke_min)
586 q(k,i,j) = sqrt( tke(k,i,j) * 2.0_rp )
598 call comm_vars8(tke, 1)
599 call comm_wait (tke, 1)
601 atmos_phy_tb_mynn_tke_init = .false.
604 call get_smsh( sm, sh, &
608 call atmos_saturation_pres2qsat( qsl(
ks:ke_pbl,:,:), &
609 teml(
ks:ke_pbl,:,:), pres(
ks:ke_pbl,:,:), &
617 dqsl = qsl(k,i,j) * lh(k,i,j) / ( rvap * potl(k,i,j)**2 )
618 aa = 1.0_rp / ( 1.0_rp + lh(k,i,j)/cp * dqsl )
619 bb = temp(k,i,j) / pott(k,i,j) * dqsl
620 ac = min( q(k,i,j)/sqrt(q2_2(k,i,j)), 1.0_rp )
621 sigma_s = max( sqrt( 0.25_rp * aa**2 * l(k,i,j)**2 * ac * b2 * sh(k,i,j) ) &
622 * abs( qw(k+1,i,j) - qw(k-1,i,j) - bb * ( potl(k+1,i,j)-potl(k-1,i,j) ) ) &
623 / ( cz(k+1,i,j) - cz(k-1,i,j) ), &
625 q1 = aa * ( qw(k,i,j) - qsl(k,i,j) ) * 0.5_rp / sigma_s
626 rr = min( max( 0.5_rp * ( 1.0_rp + erf(q1*rsqrt_2) ), 0.0_rp ), 1.0_rp )
627 ql = min( max( 2.0_rp * sigma_s * ( rr * q1 + rsqrt_2pi * exp(-0.5_rp*q1**2) ), &
630 cc = ( 1.0_rp + epstvap * qw(k,i,j) - (1.0_rp+epstvap) * ql ) * pott(k,i,j)/temp(k,i,j) * lh(k,i,j) / cp &
631 - (1.0_rp+epstvap) * pott(k,i,j)
632 rt = min( max( rr - ql / (2.0_rp*sigma_s*sqrt_2pi) * exp(-q1**2 * 0.5_rp), 0.0_rp ), 1.0_rp )
633 betat = 1.0_rp + epstvap * qw(k,i,j) - (1.0_rp+epstvap) * ql - rt * aa * bb * cc
634 betaq = epstvap * pott(k,i,j) + rt * aa * cc
635 n2(k,i,j) = min(atmos_phy_tb_mynn_n2_max, &
636 grav * ( ( potl(k+1,i,j) - potl(k-1,i,j) ) * betat &
637 + ( qw(k+1,i,j) - qw(k-1,i,j) ) * betaq ) &
638 / ( cz(k+1,i,j) - cz(k-1,i,j) ) / potv(k,i,j) )
640 n2(
ks,i,j) = n2(
ks+1,i,j)
643 ri(k,i,j) = n2(k,i,j) / max(dudz2(k,i,j), 1e-10_rp)
658 sflx_mu, sflx_mv, sflx_pt, &
661 call get_q2_level2( &
677 nu(k,i,j) = max( min( l(k,i,j) * q(k,i,j) * sm(k,i,j), &
678 atmos_phy_tb_mynn_nu_max ), &
679 atmos_phy_tb_mynn_nu_min )
686 kh = max( min( l(k,i,j) * q(k,i,j) * sh(k,i,j), &
687 atmos_phy_tb_mynn_kh_max ), &
688 atmos_phy_tb_mynn_kh_min )
689 rhokh(k,i,j) = dens(k,i,j) * kh
690 pr(k,i,j) = nu(k,i,j) / kh
698 call comm_vars( nu, 1 )
707 ap = - dt * 0.5_rp * ( dens(
ks ,i,j)*nu(
ks ,i,j) &
708 + dens(
ks+1,i,j)*nu(
ks+1,i,j) ) &
710 a(
ks,i,j) = ap * rcdz(
ks) / ( dens(
ks,i,j) * gsqrt(
ks,i,j,
i_xyz) )
712 b(
ks,i,j) = - a(
ks,i,j) + 1.0_rp
713 do k =
ks+1, ke_pbl-1
714 c(k,i,j) = ap * rcdz(k) / ( dens(k,i,j) * gsqrt(k,i,j,
i_xyz) )
715 ap = - dt * 0.5_rp * ( dens(k ,i,j)*nu(k ,i,j) &
716 + dens(k+1,i,j)*nu(k+1,i,j) ) &
717 * rfdz(k) / gsqrt(k,i,j,
i_xyw)
718 a(k,i,j) = ap * rcdz(k) / ( dens(k,i,j) * gsqrt(k,i,j,
i_xyz) )
719 b(k,i,j) = - a(k,i,j) - c(k,i,j) + 1.0_rp
721 a(ke_pbl,i,j) = 0.0_rp
722 c(ke_pbl,i,j) = ap * rcdz(ke_pbl) / ( dens(ke_pbl,i,j) * gsqrt(ke_pbl,i,j,
i_xyz) )
723 b(ke_pbl,i,j) = - c(ke_pbl,i,j) + 1.0_rp
725 d(
ks,i,j) = u(
ks,i,j) + dt * sflx_mu(i,j) * rcdz(
ks) / ( dens(
ks,i,j) * gsqrt(
ks,i,j,
i_xyz) )
729 call diffusion_solver( &
731 a(:,i,j), b(:,i,j), c(:,i,j), d(:,i,j), &
736 call comm_vars( phin, 2 )
737 call comm_wait( nu, 1 )
738 call comm_wait( phin, 2 )
749 qflx_sgs_momx(k,i,j,
zdir) = - 0.03125_rp &
750 * ( dens(k,i,j) + dens(k+1,i,j) + dens(k,i+1,j) + dens(k+1,i+1,j) ) &
751 * ( nu(k,i,j) + nu(k+1,i,j) + nu(k,i+1,j) + nu(k+1,i+1,j) ) &
752 * ( (phin(k+1,i,j)+phin(k+1,i+1,j)) - (phin(k,i,j)+phin(k,i+1,j)) ) &
753 * j33g * rfdz(k) / gsqrt(k,i,j,
i_uyw)
759 qflx_sgs_momx(
ks-1,i,j,
zdir) = 0.0_rp
765 qflx_sgs_momx(k,i,j,
zdir) = 0.0_rp
775 d(
ks,i,j) = v(
ks,i,j) + dt * sflx_mv(i,j) * rcdz(
ks) / ( dens(
ks,i,j) * gsqrt(
ks,i,j,
i_xyz) )
779 call diffusion_solver( &
781 a(:,i,j), b(:,i,j), c(:,i,j), d(:,i,j), &
789 call comm_vars( phin, 1 )
790 call comm_wait( phin, 1 )
799 qflx_sgs_momy(
ks-1,i,j,
zdir) = 0.0_rp
801 qflx_sgs_momy(k,i,j,
zdir) = - 0.03125_rp &
802 * ( dens(k,i,j) + dens(k+1,i,j) + dens(k,i,j+1) + dens(k+1,i,j+1) ) &
803 * ( nu(k,i,j) + nu(k+1,i,j) + nu(k,i,j+1) + nu(k+1,i,j+1) ) &
804 * ( (phin(k+1,i,j)+phin(k+1,i,j+1)) - (phin(k,i,j)+phin(k,i,j+1)) ) &
805 * j33g * rfdz(k) / gsqrt(k,i,j,
i_xvw)
808 qflx_sgs_momy(k,i,j,
zdir) = 0.0_rp
819 ap = - dt * 0.5_rp * ( rhokh(
ks,i,j) + rhokh(
ks+1,i,j) ) &
821 a(
ks,i,j) = ap * rcdz(
ks) / (dens(
ks,i,j) * gsqrt(
ks,i,j,
i_xyz) )
823 b(
ks,i,j) = - a(
ks,i,j) + 1.0_rp
824 do k =
ks+1, ke_pbl-1
825 c(k,i,j) = ap * rcdz(k) / (dens(k,i,j) * gsqrt(k,i,j,
i_xyz) )
826 ap = - dt * 0.5_rp * ( rhokh(k,i,j) + rhokh(k+1,i,j) ) &
827 * rfdz(k) / gsqrt(k,i,j,
i_xyw)
828 a(k,i,j) = ap * rcdz(k) / ( dens(k,i,j) * gsqrt(k,i,j,
i_xyz) )
829 b(k,i,j) = - a(k,i,j) - c(k,i,j) + 1.0_rp
831 a(ke_pbl,i,j) = 0.0_rp
832 c(ke_pbl,i,j) = ap * rcdz(ke_pbl) / (dens(ke_pbl,i,j) * gsqrt(ke_pbl,i,j,
i_xyz) )
833 b(ke_pbl,i,j) = - c(ke_pbl,i,j) + 1.0_rp
834 d(
ks,i,j) = potl(
ks,i,j) + dt * sflx_pt(i,j) * rcdz(
ks) / gsqrt(
ks,i,j,
i_xyz)
836 d(k,i,j) = potl(k,i,j)
838 call diffusion_solver( &
840 a(:,i,j), b(:,i,j), c(:,i,j), d(:,i,j), &
847 qflx_sgs_rhot(
ks-1,i,j,
zdir) = 0.0_rp
849 qflx_sgs_rhot(k,i,j,
zdir) = - 0.5_rp &
850 * ( rhokh(k,i,j) + rhokh(k+1,i,j) ) &
851 * j33g * ( phin(k+1,i,j) - phin(k,i,j) ) * rfdz(k) / gsqrt(k,i,j,
i_xyw)
854 qflx_sgs_rhot(k,i,j,
zdir) = 0.0_rp
865 d(
ks,i,j) = qw(
ks,i,j) + dt * sflx_qv(i,j) * rcdz(
ks) / ( dens(
ks,i,j) * gsqrt(
ks,i,j,
i_xyz) )
869 call diffusion_solver( &
871 a(:,i,j), b(:,i,j), c(:,i,j), d(:,i,j), &
878 qflx_sgs_rhoq(
ks-1,i,j,
zdir,iq) = 0.0_rp
880 qflx_sgs_rhoq(k,i,j,
zdir,iq) = - 0.5_rp &
881 * ( rhokh(k,i,j) + rhokh(k+1,i,j) ) &
882 * j33g * ( phin(k+1,i,j) - phin(k,i,j) ) * rfdz(k) / gsqrt(k,i,j,
i_xyw)
885 qflx_sgs_rhoq(k,i,j,
zdir,iq) = 0.0_rp
896 mflx = j33g * momz(k,i,j) / ( mapf(i,j,1,
i_xy)*mapf(i,j,2,
i_xy) ) &
897 + j13g(k,i,j,
i_xyw) * 0.25_rp * ( momx(k,i-1,j)+momx(k,i,j)+momx(k+1,i-1,j)+momx(k+1,i,j) ) / mapf(i,j,2,
i_xy) &
898 + j23g(k,i,j,
i_xyw) * 0.25_rp * ( momy(k,i,j-1)+momy(k,i,j)+momy(k+1,i,j-1)+momy(k+1,i,j) ) / mapf(i,j,1,
i_xy)
899 flux_z(k,i,j) = 0.5_rp * ( mflx * ( tke(k+1,i,j)+tke(k,i,j) ) &
900 -abs(mflx) * ( tke(k+1,i,j)-tke(k,i,j) ) )
907 mflx = momx(k,i,j) * gsqrt(k,i,j,
i_uyz) / mapf(i,j,2,
i_uy)
908 flux_x(k,i,j) = 0.5_rp * ( mflx * ( tke(k,i+1,j)+tke(k,i,j) ) &
909 -abs(mflx) * ( tke(k,i+1,j)-tke(k,i,j) ) )
916 mflx = momy(k,i,j) * gsqrt(k,i,j,
i_xvz) / mapf(i,j,1,
i_xv)
917 flux_y(k,i,j) = 0.5_rp * ( mflx * ( tke(k,i,j+1)+tke(k,i,j) ) &
918 -abs(mflx) * ( tke(k,i,j+1)-tke(k,i,j) ) )
926 + ( flux_x(
ks,i,j) - flux_x(
ks,i-1,j) ) * rcdx(i) &
927 + ( flux_y(
ks,i,j) - flux_y(
ks,i,j-1) ) * rcdy(j) ) &
928 * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / ( gsqrt(
ks,i,j,
i_xyz) * dens(
ks,i,j) )
929 d(
ks,i,j) = tke(
ks,i,j) + dt * ( nu(
ks,i,j) * (dudz2(
ks,i,j) - n2(
ks,i,j)/pr(
ks,i,j)) &
933 gen(
ks,i,j) = nu(
ks,i,j) * (dudz2(
ks,i,j) - n2(
ks,i,j)/pr(
ks,i,j))
935 do k =
ks+1, ke_pbl-1
936 advc = ( (
flux_z(k,i,j) -
flux_z(k-1,i,j) ) * rcdz(k) &
937 + ( flux_x(k,i,j) - flux_x(k,i-1,j) ) * rcdx(i) &
938 + ( flux_y(k,i,j) - flux_y(k,i,j-1) ) * rcdy(j) ) &
939 * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / ( gsqrt(k,i,j,
i_xyz) * dens(k,i,j) )
940 d(k,i,j) = tke(k,i,j) &
941 + dt * ( nu(k,i,j) * (dudz2(k,i,j) - n2(k,i,j)/pr(k,i,j)) &
945 gen(k,i,j) = nu(k,i,j) * (dudz2(k,i,j) - n2(k,i,j)/pr(k,i,j))
948 advc = ( ( -
flux_z(ke_pbl-1,i,j) ) * rcdz(ke_pbl) &
949 + ( flux_x(ke_pbl,i,j) - flux_x(ke_pbl,i-1,j) ) * rcdx(i) &
950 + ( flux_y(ke_pbl,i,j) - flux_y(ke_pbl,i,j-1) ) * rcdy(j) ) &
951 * mapf(i,j,1,
i_xy) * mapf(i,j,2,
i_xy) / ( gsqrt(ke_pbl,i,j,
i_xyz) * dens(ke_pbl,i,j) )
952 d(ke_pbl,i,j) = tke(ke_pbl,i,j) + dt * ( nu(ke_pbl,i,j) * (dudz2(ke_pbl,i,j) - n2(ke_pbl,i,j)/pr(ke_pbl,i,j)) &
955 adv(ke_pbl,i,j) = advc
956 gen(ke_pbl,i,j) = nu(ke_pbl,i,j) * (dudz2(ke_pbl,i,j) - n2(ke_pbl,i,j)/pr(ke_pbl,i,j))
964 ap = - dt * 1.5_rp * ( dens(
ks ,i,j)*nu(
ks ,i,j) &
965 + dens(
ks+1,i,j)*nu(
ks+1,i,j) ) &
967 a(
ks,i,j) = ap * rcdz(
ks) / ( dens(
ks,i,j) * gsqrt(
ks,i,j,
i_xyz) )
969 b(
ks,i,j) = - a(
ks,i,j) + 1.0_rp + 2.0_rp * dt * q(
ks,i,j) / ( b1 * l(
ks,i,j) )
970 do k =
ks+1, ke_pbl-1
971 c(k,i,j) = ap * rcdz(k) / ( dens(k,i,j) * gsqrt(k,i,j,
i_xyz) )
972 ap = - dt * 1.5_rp * ( dens(k ,i,j)*nu(k ,i,j) &
973 + dens(k+1,i,j)*nu(k+1,i,j)) &
974 * rfdz(k) / gsqrt(k,i,j,
i_xyw)
975 a(k,i,j) = ap * rcdz(k) / ( dens(k,i,j) * gsqrt(k,i,j,
i_xyz) )
976 b(k,i,j) = - a(k,i,j) - c(k,i,j) + 1.0_rp + 2.0_rp * dt * q(k,i,j) / ( b1 * l(k,i,j) )
979 a(ke_pbl,i,j) = 0.0_rp
980 c(ke_pbl,i,j) = ap * rcdz(ke_pbl) / ( dens(ke_pbl,i,j) * gsqrt(ke_pbl,i,j,
i_xyz) )
981 b(ke_pbl,i,j) = - c(ke_pbl,i,j) + 1.0_rp + 2.0_rp * dt * q(ke_pbl,i,j) / ( b1 * l(ke_pbl,i,j) )
982 call diffusion_solver( &
984 a(:,i,j), b(:,i,j), c(:,i,j), d(:,i,j), &
987 do k =
ks+1, ke_pbl-1
988 tke(1,i,j) = d(k,i,j) &
989 + ( ( (tke_n(k+1,i,j)-tke_n(k,i,j)) * rfdz(k) / gsqrt(k,i,j,
i_xyw) &
990 * (nu(k+1,i,j)*dens(k+1,i,j)+nu(k,i,j)*dens(k,i,j))*1.5_rp &
991 - (tke_n(k,i,j)-tke_n(k-1,i,j)) * rfdz(k-1) / gsqrt(k-1,i,j,
i_xyw) &
992 * (nu(k,i,j)*dens(k,i,j)+nu(k-1,i,j)*dens(k-1,i,j))*1.5_rp ) &
993 * rcdz(k) / gsqrt(k,i,j,
i_xyz) / dens(k,i,j) &
994 - 2.0_rp*tke_n(k,i,j) * q(k,i,j) / (b1 * l(k,i,j)) ) &
996 if ( tke_n(k,i,j) > 0.1_rp .AND. abs(tke(1,i,j) - tke_n(k,i,j))/tke_n(k,i,j) > 1e-10_rp )
then 997 advc = ( tke(k,i,j) - d(k,i,j) ) / dt + nu(k,i,j) * (dudz2(k,i,j) - n2(k,i,j)/pr(k,i,j))
998 write(*,*)k,i,j,tke(1,i,j),tke_n(k,i,j), tke(k,i,j),nu(k,i,j),dudz2(k,i,j),n2(k,i,j),pr(k,i,j),advc
999 open(90, file=
"mynn.dat")
1000 write(90,*)ke_pbl-
ks+1
1002 write(90,*)tke(
ks:ke_pbl,i,j)
1003 write(90,*)q(
ks:ke_pbl,i,j)
1004 write(90,*)l(
ks:ke_pbl,i,j)
1005 write(90,*)rcdz(
ks:ke_pbl)
1006 write(90,*)rfdz(
ks:ke_pbl)
1007 write(90,*)nu(
ks:ke_pbl,i,j)
1008 write(90,*)dens(
ks:ke_pbl,i,j)
1009 write(90,*)dudz2(
ks:ke_pbl,i,j)
1010 write(90,*)n2(
ks:ke_pbl,i,j)
1011 write(90,*)pr(
ks:ke_pbl,i,j)
1018 tke_t(k,i,j) = ( max(tke_n(k,i,j), tke_min) - tke(k,i,j) ) / dt
1021 tke_t(k,i,j) = 0.0_rp
1030 adv(ke_pbl+1:
ke,:,:) = 0.0_rp
1031 gen(ke_pbl+1:
ke,:,:) = 0.0_rp
1032 dudz2(ke_pbl+1:
ke,:,:) = 0.0_rp
1033 l(ke_pbl+1:
ke,:,:) = 0.0_rp
1034 potv(ke_pbl+1:
ke,:,:) = 0.0_rp
1035 potl(ke_pbl+1:
ke,:,:) = 0.0_rp
1036 call hist_in(adv,
'TKE_advc',
'advection of TKE',
'm2/s3', nohalo=.true.)
1037 call hist_in(gen,
'TKE_gen',
'generation of TKE',
'm2/s3', nohalo=.true.)
1038 call hist_in(dudz2,
'dUdZ2',
'dudz2',
'm2/s2', nohalo=.true.)
1039 call hist_in(l,
'L_mix',
'minxing length',
'm', nohalo=.true.)
1040 call hist_in(potv,
'POTV',
'virtual potential temperature',
'K', nohalo=.true.)
1041 call hist_in(potl,
'POTL',
'liquid potential temperature',
'K', nohalo=.true.)
integer, public is
start point of inner domain: x, local
integer, public je
end point of inner domain: y, local
real(rp), dimension(:), allocatable, public grid_rcdy
reciprocal of center-dy
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
module ATMOSPHERE / Saturation adjustment
subroutine, public atmos_phy_tb_diffusion_solver(phi, a, b, c, d, KE_TB)
integer, public iblock
block size for cache blocking: x
real(rp), dimension(:), allocatable, public grid_rcdx
reciprocal of center-dx
integer, parameter, public zdir
integer, parameter, public ydir
integer, public ke
end point of inner domain: z, local
integer, parameter, public xdir
real(rp), dimension(:,:,:), allocatable, public real_cz
geopotential height [m] (cell center)
real(rp), dimension(:), allocatable, public grid_rcdz
reciprocal of center-dz
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
integer, public ia
of x whole cells (local, with HALO)
integer, public ka
of z whole cells (local, with HALO)
integer, public jblock
block size for cache blocking: y
real(rp), public const_grav
standard acceleration of gravity [m/s2]
integer, public js
start point of inner domain: y, local
real(rp), public const_epstvap
1 / epsilon - 1
real(rp), parameter, public const_rvap
specific gas constant (water vapor) [J/kg/K]
integer, public ks
start point of inner domain: z, local
module ATMOSPHERE / Physics Turbulence
integer, public ie
end point of inner domain: x, local
module ATMOSPHERE / Thermodynamics
real(rp), dimension(:), allocatable, public grid_rfdz
reciprocal of face-dz
integer, public ja
of y whole cells (local, with HALO)