23 subroutine bl_driver ( IM, JM, LM, DT, U, V, TH, Q, P, QIT, QLT, FRLAND, FROCEAN, VARFLT, &
24 ZPBL, CM, CT, CQ, TURBPARAMS, TURBPARAMSI, &
26 AKS, BKS, CKS, AKQ, BKQ, CKQ, AKV, BKV, CKV, EKV, FKV &
32 INTEGER,
INTENT(IN) :: im, jm, lm
33 REAL(kind_real),
INTENT(IN) :: dt
35 REAL(kind_real),
INTENT(IN),
DIMENSION(:) :: turbparams
36 INTEGER,
INTENT(IN),
DIMENSION(:) :: turbparamsi
38 REAL(kind_real),
INTENT(IN),
DIMENSION(IM,JM,LM) :: u, v, th, q, qit, qlt
39 REAL(kind_real),
INTENT(IN),
DIMENSION(IM,JM,0:LM) :: p
40 REAL(kind_real),
INTENT(IN),
DIMENSION(IM,JM) :: frland, varflt, frocean
42 REAL(kind_real),
INTENT(IN),
DIMENSION(IM,JM) :: cm, cq
44 REAL(kind_real),
INTENT(IN),
DIMENSION(IM,JM) :: ustar, bstar
47 REAL(kind_real),
INTENT(INOUT),
DIMENSION(IM,JM) :: zpbl, ct
50 REAL(kind_real),
INTENT(OUT),
DIMENSION(IM,JM,LM) :: aks, bks, cks
51 REAL(kind_real),
INTENT(OUT),
DIMENSION(IM,JM,LM) :: akq, bkq, ckq
52 REAL(kind_real),
INTENT(OUT),
DIMENSION(IM,JM,LM) :: akv, bkv, ckv, ekv, fkv
56 REAL(kind_real),
DIMENSION(IM,JM,LM) :: pf, pif, qi, ql, tv, thv, zf, dmi
57 REAL(kind_real),
DIMENSION(IM,JM,0:LM) ::
pi, z
58 REAL(kind_real),
DIMENSION(IM,JM,1:LM-1) :: rdz
59 REAL(kind_real),
DIMENSION(IM,JM,LM) :: t
60 REAL(kind_real),
DIMENSION(IM,JM,0:LM) :: km, kh
62 REAL(kind_real),
DIMENSION(IM,JM,0:LM) :: ri, du
63 REAL(kind_real),
DIMENSION(IM,JM,0:LM) :: alh_x, kmls_x, khls_x
65 REAL(kind_real),
DIMENSION(IM,JM,LM) :: radlw
69 REAL(kind_real) :: louis,lambdam,lambdam2,lambdah,lambdah2,zkmenv,zkhenv,minthick,minshear,c_b,lambda_b,akhmmax
70 REAL(kind_real) :: prandtlsfc,prandtlrad,beta_rad,beta_surf,khradfac,khsfcfac,tpfac_surf,entrate_surf,pceff_surf,louis_memory
71 INTEGER :: kpblmin, lock_on, pblht_option, radlw_dep
74 integer,
parameter ::
degsubs = 100
77 real(kind_real),
dimension(TABLESIZE) :: estblx
96 pf = 0.5*(p(:,:,0:lm-1) + p(:,:,1:lm))
130 louis = turbparams(1)
131 lambdam = turbparams(2)
132 lambdam2 = turbparams(3)
133 lambdah = turbparams(4)
134 lambdah2 = turbparams(5)
135 zkmenv = turbparams(6)
136 zkhenv = turbparams(7)
137 minthick = turbparams(8)
138 minshear = turbparams(9)
140 lambda_b = turbparams(11)
141 akhmmax = turbparams(12)
142 prandtlsfc = turbparams(13)
143 prandtlrad = turbparams(14)
144 beta_rad = turbparams(15)
145 beta_surf = turbparams(16)
146 khradfac = turbparams(17)
147 khsfcfac = turbparams(18)
148 tpfac_surf = turbparams(19)
149 entrate_surf = turbparams(20)
150 pceff_surf = turbparams(21)
151 louis_memory = turbparams(22)
153 kpblmin = turbparamsi(1)
154 lock_on = turbparamsi(2)
155 pblht_option = turbparamsi(3)
156 radlw_dep = turbparamsi(4)
170 IF (frocean(i,j).eq.1.0)
then 171 ct(i,j) = frocean(i,j) * ct(i,j)
300 subroutine preliminary( IRUN, LM, DT, T, QV, PHALF, TH, QIT, QLT, &
301 ZFULL, ZHALF, TV, PV, RDZ, DMI, PFULL &
309 integer,
intent(IN) :: IRUN, LM
310 real(kind_real),
intent(IN) :: DT
311 real(kind_real),
intent(IN),
dimension(IRUN,LM) :: T, QV, TH, QIT, QLT
312 real(kind_real),
intent(IN),
dimension(IRUN,LM+1) :: PHALF
315 real(kind_real),
intent(OUT),
dimension(IRUN, LM ) :: ZFULL, TV, PV, DMI, PFULL
316 real(kind_real),
intent(OUT),
dimension(IRUN, LM+1) :: ZHALF
317 real(kind_real),
intent(OUT),
dimension(IRUN,1:LM-1) :: RDZ
321 real(kind_real) :: PKE_atL, PKE_atLp1, TVE
322 real(kind_real) :: QL_tot, QI_tot
329 pke_atlp1 = (phalf(i,l+1)/
p00)**
kappa 332 zhalf(i,l) = zhalf(i,l+1) + (
cp/
grav)*th(i,l)*(pke_atlp1-pke_atl)
340 zfull(i,l) = 0.5*(zhalf(i,l)+zhalf(i,l+1))
341 pfull(i,l) = 0.5*(phalf(i,l)+phalf(i,l+1))
343 tv(i,l) = t(i,l) *( 1.0 +
vireps *qv(i,l) - ql_tot - qi_tot )
344 pv(i,l) = tv(i,l)*(th(i,l)/t(i,l))
348 tve = (tv(i,l) + tv(i,l+1))*0.5
351 rdz(i,l) = phalf(i,l+1) / (
rgas * tve )
352 rdz(i,l) = rdz(i,l) / (zfull(i,l)-zfull(i,l+1))
356 dmi(i,l) = (
grav*dt)/(phalf(i,l+1)-phalf(i,l))
360 pv(i,lm ) = pv(i,lm-1)*0.25 + pv(i,lm )*0.75
361 pv(i,lm-1) = pv(i,lm-2)*0.25 + pv(i,lm-1)*0.50 + pv(i,lm )*0.25
362 pv(i,lm-2) = pv(i,lm-3)*0.25 + pv(i,lm-2)*0.50 + pv(i,lm-1)*0.25
363 pv(i,lm-3) = pv(i,lm-4)*0.25 + pv(i,lm-3)*0.50 + pv(i,lm-2)*0.25
364 pv(i,lm-4) = pv(i,lm-5)*0.25 + pv(i,lm-4)*0.50 + pv(i,lm-3)*0.25
365 pv(i,lm-5) = pv(i,lm-6)*0.25 + pv(i,lm-5)*0.50 + pv(i,lm-4)*0.25
373 subroutine louis_diff( IRUN,LM,KH,KM,RI,DU,ZPBL,ZZ,ZE,PV,UU,VV,LOUIS,MINSHEAR,MINTHICK,&
374 LAMBDAM,LAMBDAM2,LAMBDAH,LAMBDAH2,ZKMENV,ZKHENV,AKHMMAX,ALH_DIAG,KMLS_DIAG,KHLS_DIAG)
383 integer,
intent(IN ) :: IRUN,LM
384 real(kind_real),
intent(IN ) :: LOUIS
385 real(kind_real),
intent(IN ) :: MINSHEAR
386 real(kind_real),
intent(IN ) :: MINTHICK
387 real(kind_real),
intent(IN ) :: AKHMMAX
388 real(kind_real),
intent(IN ) :: LAMBDAM
389 real(kind_real),
intent(IN ) :: LAMBDAM2
390 real(kind_real),
intent(IN ) :: LAMBDAH
391 real(kind_real),
intent(IN ) :: LAMBDAH2
392 real(kind_real),
intent(IN ) :: ZKMENV
393 real(kind_real),
intent(IN ) :: ZKHENV
394 real(kind_real),
intent(IN ) :: ZZ(IRUN,LM)
395 real(kind_real),
intent(IN ) :: PV(IRUN,LM)
396 real(kind_real),
intent(IN ) :: UU(IRUN,LM)
397 real(kind_real),
intent(IN ) :: VV(IRUN,LM)
398 real(kind_real),
intent(IN ) :: ZE(IRUN,LM+1)
399 real(kind_real),
intent(IN ) :: ZPBL(IRUN)
404 real(kind_real),
intent( OUT) :: KM(IRUN,LM+1)
405 real(kind_real),
intent( OUT) :: KH(IRUN,LM+1)
406 real(kind_real),
intent( OUT) :: RI(IRUN,LM+1)
407 real(kind_real),
intent( OUT) :: DU(IRUN,LM+1)
408 real(kind_real),
intent( OUT) :: ALH_DIAG(IRUN,LM+1)
409 real(kind_real),
intent( OUT) :: KMLS_DIAG(IRUN,LM+1)
410 real(kind_real),
intent( OUT) :: KHLS_DIAG(IRUN,LM+1)
413 integer :: L,Levs,i,j,k
414 real(kind_real) :: ALH, ALM, DZ, DT, TM, PS, LAMBDAM_X, LAMBDAH_X
415 real(kind_real) :: pbllocal, alhfac,almfac
423 alh_diag(i,lm+1) = 0.0
433 kmls_diag(i, 1) = 0.0
434 kmls_diag(i,lm+1) = 0.0
435 khls_diag(i, 1) = 0.0
436 khls_diag(i,lm+1) = 0.0
440 if ( pbllocal .LE. zz(i,lm) )
then 450 dz = (zz(i,k-1) - zz(i,k))
451 tm = (pv(i,k-1) + pv(i,k))*0.5
452 dt = (pv(i,k-1) - pv(i,k))
453 du(i,k) = (uu(i,k-1) - uu(i,k))**2 + (vv(i,k-1) - vv(i,k))**2
456 dz =
max(dz, minthick)
457 du(i,k) = sqrt(du(i,k))/dz
460 ri(i,k) =
grav*(dt/dz)/(tm*(
max(du(i,k), minshear)**2))
463 lambdam_x =
max( 0.1 * pbllocal * exp( -(ze(i,k) / zkmenv )**2 ) , lambdam2 )
464 lambdah_x =
max( 0.1 * pbllocal * exp( -(ze(i,k) / zkhenv )**2 ) , lambdah2 )
466 alm = almfac * (
karman*ze(i,k)/( 1.0 +
karman*(ze(i,k)/lambdam_x) ) )**2
467 alh = alhfac * (
karman*ze(i,k)/( 1.0 +
karman*(ze(i,k)/lambdah_x) ) )**2
469 alh_diag(i,k) = sqrt( alh )
472 if ( ri(i,k) < 0.0 )
then 473 ps = ( (zz(i,k-1)/zz(i,k))**(1./3.) - 1.0 ) ** 3
474 ps = alh*sqrt( ps/(ze(i,k)*(dz**3)) )
475 ps = ri(i,k)/(1.0 + (3.0*louis*louis)*ps*sqrt(-ri(i,k)))
477 kh(i,k) = 1.0 - (louis*3.0)*ps
478 km(i,k) = 1.0 - (louis*2.0)*ps
482 if ( ri(i,k) >= 0.0 )
then 483 ps = sqrt(1.0 + louis *ri(i,k) )
485 kh(i,k) = 1.0 / (1.0 + (louis*3.0)*ri(i,k)*ps)
486 km(i,k) = ps / (ps + (louis*2.0)*ri(i,k) )
493 km(i,k) =
min(km(i,k)*alm, akhmmax)
494 kh(i,k) =
min(kh(i,k)*alh, akhmmax)
495 kmls_diag(i,k) = km(i,k)
496 khls_diag(i,k) = kh(i,k)
504 subroutine tridiag_setup(IRUN,LM,DT,KPBLMIN,ZFULL,PFULL,RDZ,DMI,PHALF,&
505 TV,CT,CQ,CU,T,Q,TH,U,V,DIFF_T,DIFF_M,&
506 AKQ,AKS,AKV,BKQ,BKS,BKV,CKQ,CKS,CKV,EKV,ZPBL)
511 integer,
intent(IN) :: IRUN,LM,KPBLMIN
512 real(kind_real),
intent(IN) :: DT
513 real(kind_real),
intent(IN),
dimension(IRUN,LM) :: T,Q,TH,U,V,ZFULL,PFULL,DMI,TV
514 real(kind_real),
intent(IN),
dimension(IRUN,LM-1) :: RDZ
515 real(kind_real),
intent(IN),
dimension(IRUN,LM+1) :: PHALF
516 real(kind_real),
intent(IN),
dimension(IRUN ) :: CT, CQ, CU
519 real(kind_real),
intent(INOUT),
dimension(IRUN,LM+1) :: DIFF_T, DIFF_M
522 real(kind_real),
intent(OUT),
dimension(IRUN,LM) :: AKQ, AKS, AKV
523 real(kind_real),
intent(OUT),
dimension(IRUN,LM) :: BKQ, BKS, BKV
524 real(kind_real),
intent(OUT),
dimension(IRUN,LM) :: CKQ, CKS, CKV
525 real(kind_real),
intent(OUT),
dimension(IRUN,LM) :: EKV
526 real(kind_real),
intent(OUT),
dimension(IRUN) :: ZPBL
529 real(kind_real),
dimension(LM+1) :: temparray
530 integer :: I,L,locmax
531 real(kind_real) :: maxkh,minlval,thetavs,thetavh,uv2h
532 real(kind_real),
parameter :: tcri_crit = 0.25
534 real(kind_real),
dimension(LM ) :: tcrib
541 if ( (diff_t(i,l) < 2.) .and. (diff_t(i,l+1) >= 2.) .and. (zpbl(i) == 10.e15 ) )
then 545 if ( zpbl(i) .eq. 10.e15 )
then 546 zpbl(i) = zfull(i,lm)
548 zpbl(i) =
min(zpbl(i),zfull(i,kpblmin))
553 cks(i,l) = -diff_t(i,l+1) * rdz(i,l)
557 aks(i,l+1) = cks(i,l) * dmi(i,l+1)
558 cks(i,l) = cks(i,l) * dmi(i,l)
562 cks(i,l) = -ct(i) * dmi(i,l)
567 diff_t(i,l+1) = ct(i) * (phalf(i,l+1)/(
rgas * tv(i,l))) / zfull(i,l)
574 ckq(i,l) = -cq(i) * dmi(i,l)
580 ekv(i,l) = -diff_m(i,l+1) * rdz(i,l)
584 akv(i,l+1) = ekv(i,l) * dmi(i,l+1)
585 ckv(i,l) = ekv(i,l) * dmi(i,l)
586 ekv(i,l) = -
grav * ekv(i,l)
590 ckv(i,l) = - cu(i) * dmi(i,l)
591 ekv(i,l) =
grav * cu(i)
596 diff_m(i,l+1) = cu(i) * (phalf(i,l+1)/(
rgas * tv(i,l))) / zfull(i,l)
600 bks(i,l) = 1.00 - (aks(i,l)+cks(i,l))
601 bkq(i,l) = 1.00 - (akq(i,l)+ckq(i,l))
602 bkv(i,l) = 1.00 - (akv(i,l)+ckv(i,l))
612 subroutine orodrag(IRUN,LM,DT,LAMBDA_B,C_B,FKV,BKV,U,V,ZFULL,VARFLT,PHALF)
619 integer,
intent(IN) :: IRUN, LM
620 real(kind_real),
intent(IN) :: DT, LAMBDA_B, C_B
621 real(kind_real),
intent(IN),
dimension(IRUN) :: VARFLT
622 real(kind_real),
intent(IN),
dimension(IRUN,LM) :: U, V, ZFULL
623 real(kind_real),
intent(IN),
dimension(IRUN,LM+1) :: PHALF
626 real(kind_real),
intent(INOUT),
dimension(IRUN,LM) :: BKV
629 real(kind_real),
intent(OUT),
dimension(IRUN,LM) :: FKV
633 real(kind_real) :: FKV_temp
640 if (zfull(i,l) < 4.0*lambda_b)
then 641 fkv_temp = zfull(i,l)*(1.0/lambda_b)
642 fkv_temp = varflt(i) * exp(-fkv_temp*sqrt(fkv_temp))*(fkv_temp**(-1.2))
643 fkv_temp = (c_b/lambda_b)*
min( sqrt(u(i,l)**2+v(i,l)**2),5.0 )*fkv_temp
645 bkv(i,l) = bkv(i,l) + dt*fkv_temp
646 fkv(i,l) = fkv_temp * (phalf(i,l+1)-phalf(i,l))
655 subroutine lock_diff( ncol,nlev,tdtlw_in_dev,u_star_dev,b_star_dev,frland_dev,t_dev,qv_dev, &
656 qit_dev,qlt_dev,u_dev,v_dev,zfull_dev,pfull_dev,zhalf_dev,phalf_dev, &
658 diff_m_dev,diff_t_dev, &
660 prandtlsfc_const,prandtlrad_const,beta_surf_const,beta_rad_const, &
661 tpfac_sfc_const,entrate_sfc_const,pceff_sfc_const,khradfac_const,khsfcfac_const,radlw_dep,&
667 integer,
intent(in) :: ncol,nlev
668 real(kind_real),
intent(in) :: ESTBLX(:)
669 real(kind_real),
intent(in),
dimension(ncol) :: u_star_dev,b_star_dev,frland_dev
670 real(kind_real),
intent(in),
dimension(ncol,nlev) :: tdtlw_in_dev,t_dev,qv_dev,qit_dev,qlt_dev
671 real(kind_real),
intent(in),
dimension(ncol,nlev) :: u_dev,v_dev,zfull_dev,pfull_dev
672 real(kind_real),
intent(in),
dimension(ncol,1:nlev+1) :: zhalf_dev, phalf_dev
673 real(kind_real),
intent(in) :: prandtlsfc_const,prandtlrad_const,beta_surf_const,beta_rad_const
674 real(kind_real),
intent(in) :: khradfac_const,tpfac_sfc_const,entrate_sfc_const
675 real(kind_real),
intent(in) :: pceff_sfc_const,khsfcfac_const
678 real(kind_real),
intent(inout),
dimension(ncol,1:nlev+1) :: diff_m_dev,diff_t_dev
681 real(kind_real),
parameter :: akmax = 1.e4, zcldtopmax = 3.e3, ramp = 20.
682 integer :: i,j,k,ibot,itmp,ipbl,kmax,kcldtop,kcldbot,kcldtop2,radlw_dep
683 logical :: used,keeplook,do_jump_exit
684 real(kind_real) :: maxradf, tmpradf,stab
685 real(kind_real) :: maxqdot, tmpqdot,wentrmax
686 real(kind_real) :: maxinv, qlcrit,ql00,qlm1,Abuoy,Ashear
687 real(kind_real) :: wentr_tmp,hlf,vbulkshr,vbulk_scale
688 real(kind_real) :: k_entr_tmp,tmpjump,critjump,radperturb,buoypert
689 real(kind_real) :: tmp1, tmp2, slmixture
690 real(kind_real) :: vsurf3, vshear3,vrad3, vbr3,dsiems
691 real(kind_real) :: dslvcptmp,ztmp
692 real(kind_real) :: zradtop
693 real(kind_real) :: vrad,svpcp,chis,vbrv
694 real(kind_real) :: vsurf, qs_dummy, ptmp
695 real(kind_real) :: wentr_rad,wentr_pbl,wentr_brv
696 real(kind_real) :: convpbl, radpbl
697 real(kind_real),
dimension(nlev) :: slv,density,qc,slvcp,hleff,radfq,pblfq,k_m_troen,k_t_troen,k_rad,dqs
700 real(kind_real),
dimension(ncol,1:nlev+1) :: k_m_entr_dev,k_t_entr_dev
701 real(kind_real),
dimension(ncol) :: zsml_dev,zradml_dev,zcloud_dev,zradbase_dev
714 zradbase_dev(i) = 0.0
732 k_t_entr_dev(i,k) = 0.0
733 k_m_entr_dev(i,k) = 0.0
739 k_t_entr_dev(i,nlev+1) = 0.0
740 k_m_entr_dev(i,nlev+1) = 0.0
744 if ( t_dev(i,k) <=
tice-ramp )
then 746 else if ( (t_dev(i,k) >
tice-ramp) .and. (t_dev(i,k) <
tice) )
then 747 hleff(k) = ( (t_dev(i,k)-
tice+ramp)*
alhl + (
tice -t_dev(i,k) )*
alhs ) / ramp
756 ptmp = pfull_dev(i,k)*0.01
761 qc(k) = (qit_dev(i,k) + qlt_dev(i,k))
764 slv(k) =
cp*t_dev(i,k)*(1+
vireps*qv_dev(i,k)-qc(k)) +
grav*zfull_dev(i,k) - hleff(k)*qc(k)
766 density(k) = pfull_dev(i,k)/(
rgas*(t_dev(i,k) *(1.+
vireps*qv_dev(i,k)-qc(k))))
775 if (b_star_dev(i) .gt. 0.)
then 779 call mpbl_depth(i,ncol,nlev,tpfac_sfc_const,entrate_sfc_const,pceff_sfc_const, &
780 t_dev,qv_dev,u_dev,v_dev,zfull_dev,pfull_dev,b_star_dev,u_star_dev,ipbl,zsml_dev,&
784 vsurf3 = u_star_dev(i)*b_star_dev(i)*zsml_dev(i)
785 vshear3 = ashear*u_star_dev(i)*u_star_dev(i)*u_star_dev(i)
787 vsurf = vsurf3**(1./3.)
790 vbulkshr = sqrt( ( u_dev(i,ipbl)-u_dev(i,ibot) )**2 + ( v_dev(i,ipbl)-v_dev(i,ibot) )**2 ) / zsml_dev(i)
791 vbulk_scale = 3.0 / 1000.
796 if (ipbl .lt. ibot)
then 797 do k = ibot, ipbl+1, -1
798 tmpjump =(slv(k-1)-slv(k))/
cp 799 if (tmpjump .gt. critjump)
then 801 zsml_dev(i) = zhalf_dev(i,ipbl)
808 tmp1 =
grav*
max(0.1,(slv(ipbl-1)-slv(ipbl))/
cp)/(slv(ipbl)/
cp)
809 tmp2 = ((vsurf3+vshear3)**(2./3.)) / zsml_dev(i)
811 wentr_tmp =
min( wentrmax,
max(0., (beta_surf_const * (vsurf3 + vshear3)/zsml_dev(i))/(tmp1+tmp2) ) )
814 if ( zsml_dev(i) .lt. 1600. )
then 815 wentr_tmp = wentr_tmp * ( zsml_dev(i) / 800. )
817 wentr_tmp = 2.*wentr_tmp
821 k_entr_tmp = wentr_tmp*(zfull_dev(i,ipbl-1)-zfull_dev(i,ipbl))
822 k_entr_tmp =
min( k_entr_tmp, akmax )
828 wentr_pbl = wentr_tmp
829 k_t_troen(ipbl) = k_entr_tmp
830 k_m_troen(ipbl) = k_entr_tmp
831 k_t_entr_dev(i,ipbl) = k_t_entr_dev(i,ipbl) + k_entr_tmp
832 k_m_entr_dev(i,ipbl) = k_m_entr_dev(i,ipbl) + k_entr_tmp
836 if (ipbl .lt. ibot)
then 838 call diffusivity_pbl2(i, ncol, nlev,zsml_dev,khsfcfac_const, k_entr_tmp,vsurf,&
839 frland_dev,zhalf_dev,k_m_troen,k_t_troen)
842 k_t_entr_dev(i,k) = k_t_entr_dev(i,k) + k_t_troen(k)
843 k_m_entr_dev(i,k) = k_m_entr_dev(i,k) + k_m_troen(k)*prandtlsfc_const
856 if ( zhalf_dev(i,k) < zcldtopmax)
then 867 stab = slv(k-1) - slv(k)
868 if ( ( ql00 .ge. qlcrit ) .and. ( qlm1 .lt. qlcrit) .and. (stab .gt. 0.) )
then 875 if (kcldtop .lt. ibot+1)
then 878 kcldtop2=
min( kcldtop+1,nlev)
880 if ( (qc(kcldtop) .lt. 10*qlcrit ) .and. (qc(kcldtop2) .ge. 10*qc(kcldtop) ) )
then 885 do k = ibot,kcldtop,-1
888 if ( ( ql00 .lt. qlcrit ) .and. ( qlm1 .ge. qlcrit) )
then 894 if (radlw_dep .eq. 1)
then 897 if (kcldtop .ne. kcldbot)
then 901 kcldtop2=
min( kcldtop+2,nlev)
902 maxradf = maxval( -1.*tdtlw_in_dev(i,kcldtop:kcldtop2) )
903 maxradf = maxradf*
cp*( (phalf_dev(i,kcldtop+1)-phalf_dev(i,kcldtop)) /
grav )
904 maxradf =
max( maxradf , 0. )
909 tmp1 = ( slv(kcldtop-1) - hlf*qc(kcldtop-1) ) - (slv(kcldtop) - hlf*qc(kcldtop) )
910 tmp1 = dqs(kcldtop)*tmp1/
cp 912 tmp2 = ( qv_dev(i,kcldtop-1) + qc(kcldtop-1) ) - ( qv_dev(i,kcldtop) + qc(kcldtop) )
914 chis = -qc(kcldtop)*( 1 + hlf * dqs(kcldtop) /
cp )
916 if ( ( tmp2 - tmp1 ) >= 0.0 )
then 919 chis = chis / ( tmp2 - tmp1 )
922 if ( chis .gt. 1.0 )
then 926 slmixture = ( 1.0-chis ) * ( slv(kcldtop) - hlf*qc(kcldtop) ) + chis * ( slv(kcldtop-1) - hlf*qc(kcldtop-1) )
929 svpcp = slmixture /
cp 931 buoypert = ( slmixture - slv(kcldtop) )/
cp 934 stab = slv(kcldtop-1) - slv(kcldtop)
935 if (stab .eq. 0.)
then 936 dsiems = ( slv(kcldtop) - slmixture )
938 dsiems = ( slv(kcldtop) - slmixture ) / stab
940 dsiems =
min( dsiems, 10. )
941 dsiems =
max( dsiems, 0. )
942 zradtop = zhalf_dev(i,kcldtop)
946 radperturb =
min( maxradf/100. , 0.3 )
947 do_jump_exit = .true.
949 svpcp = svpcp - radperturb
953 if (kcldtop .lt. ibot)
then 954 call radml_depth(i,ncol,nlev,kcldtop,ibot,svpcp,zradtop,critjump,do_jump_exit,&
955 slvcp,zfull_dev,zhalf_dev,zradbase_dev,zradml_dev )
957 zradbase_dev(i) = 0.0
958 zradml_dev(i) = zradtop
961 zcloud_dev(i) = zhalf_dev(i,kcldtop) - zhalf_dev(i,kcldbot)
964 if (zradml_dev(i) .gt. 0.0 )
then 968 vrad3 =
grav*zradml_dev(i)*maxradf/density(kcldtop)/slv(kcldtop)
971 tmp1 =
grav*
max(0.1,((slv(kcldtop-1)/
cp)-svpcp))/(slv(kcldtop)/
cp)
974 tmp1 =
grav*
max( 0.1, ( slv(kcldtop-1)-slv(kcldtop) )/
cp ) / ( slv(kcldtop) /
cp )
977 vbr3 = (
max( tmp1*zcloud_dev(i), 0.)**3 )
978 vbr3 = abuoy*(chis**2)*
max(dsiems,0.)*sqrt( vbr3 )
981 if ( zradtop .gt. zcldtopmax-500. )
then 982 vrad3 = vrad3*(zcldtopmax - zradtop)/500.
983 vbr3 = vbr3 *(zcldtopmax - zradtop)/500.
985 vrad3=
max( vrad3, 0. )
986 vbr3 =
max( vbr3, 0. )
988 vrad = vrad3 ** (1./3.)
991 tmp2 = ( vrad**2 + vbrv**2 ) / zradml_dev(i)
992 wentr_rad =
min(wentrmax,beta_rad_const*(vrad3+vbr3)/zradml_dev(i)/(tmp1+tmp2))
994 wentr_brv = beta_rad_const*vbr3/zradml_dev(i)/(tmp1+tmp2)
997 if ( zradtop .lt. 500. )
then 1000 if (( zradtop .gt. 500.) .and. (zradtop .le. 800. ))
then 1001 wentr_rad = wentr_rad * ( zradtop-500.) / 300.
1004 if ( zradtop .lt. 2400. )
then 1005 wentr_rad = wentr_rad * ( zradtop / 800. )
1007 wentr_rad = 3.*wentr_rad
1010 k_entr_tmp =
min( akmax, wentr_rad*(zfull_dev(i,kcldtop-1)-zfull_dev(i,kcldtop)) )
1014 k_rad(kcldtop) = k_entr_tmp
1015 k_t_entr_dev(i,kcldtop) = k_t_entr_dev(i,kcldtop) + k_entr_tmp
1016 k_m_entr_dev(i,kcldtop) = k_m_entr_dev(i,kcldtop) + k_entr_tmp
1019 if (ipbl .eq. kcldtop .and. ipbl .gt. 0)
then 1021 tmp2 = ((vbr3+vrad3+vsurf3+vshear3)**(2./3.)) / zradml_dev(i)
1023 wentr_rad =
min( wentrmax,
max(0., ((beta_surf_const *(vsurf3 + vshear3) + &
1024 beta_rad_const*(vrad3+vbr3) )/ zradml_dev(i))/(tmp1+tmp2) ) )
1025 wentr_pbl = wentr_rad
1027 k_entr_tmp =
min( akmax, wentr_rad*(zfull_dev(i,kcldtop-1)-zfull_dev(i,kcldtop)) )
1032 k_rad(kcldtop) = k_entr_tmp
1033 k_t_troen(ipbl) = k_entr_tmp
1034 k_m_troen(ipbl) = k_entr_tmp
1035 k_t_entr_dev(i,kcldtop) = k_entr_tmp
1036 k_m_entr_dev(i,kcldtop) = k_entr_tmp
1041 if ( kcldtop .lt. ibot )
then 1043 do k = kcldtop+1,ibot
1045 ztmp =
max(0.,(zhalf_dev(i,k)-zradbase_dev(i))/zradml_dev(i) )
1047 if (ztmp.gt.0.)
then 1050 k_entr_tmp = khradfac_const*
karman*( vrad+vbrv )*ztmp*zradml_dev(i)*ztmp*((1.-ztmp)**0.5)
1051 k_entr_tmp =
min( k_entr_tmp, akmax )
1052 k_rad(k) = k_entr_tmp
1053 k_t_entr_dev(i,k) = k_t_entr_dev(i,k) + k_entr_tmp
1054 k_m_entr_dev(i,k) = k_m_entr_dev(i,k) + k_entr_tmp*prandtlrad_const
1062 if (zradbase_dev(i) .lt. zsml_dev(i) .and. convpbl .eq. 1. .and. ipbl .gt. kcldtop)
then 1065 k_t_entr_dev(i,ipbl) = k_t_entr_dev(i,ipbl) - k_t_troen(ipbl)
1066 k_m_entr_dev(i,ipbl) = k_m_entr_dev(i,ipbl) - k_m_troen(ipbl)
1067 k_t_troen(ipbl) = 0.
1068 k_m_troen(ipbl) = 0.
1081 diff_t_dev(i,k) =
max( k_t_entr_dev(i,k), diff_t_dev(i,k) )
1082 diff_m_dev(i,k) =
max( k_m_entr_dev(i,k), diff_m_dev(i,k) )
1083 k_t_entr_dev(i,k) =
max( k_t_entr_dev(i,k), 0.0 )
1084 k_m_entr_dev(i,k) =
max( k_m_entr_dev(i,k), 0.0 )
1094 subroutine mpbl_depth(i,ncol,nlev,tpfac, entrate, pceff, t, q, u, v, z, p, b_star, u_star , ipbl, ztop, ESTBLX)
1101 integer,
intent(in) :: i, nlev, ncol
1102 real(kind_real),
intent(in) :: ESTBLX(:)
1103 real(kind_real),
intent(in),
dimension(ncol,nlev) :: t, z, q, p, u, v
1104 real(kind_real),
intent(in),
dimension(ncol) :: b_star, u_star
1105 real(kind_real),
intent(in) :: tpfac, entrate, pceff
1108 integer,
intent(out) :: ipbl
1109 real(kind_real),
intent(out),
dimension(ncol) :: ztop
1112 real(kind_real) :: tep,z1,z2,t1,t2,qp,pp,qsp,dqp,dqsp,u1,v1,u2,v2,du
1113 real(kind_real) :: ws,k_t_ref,entfr, tpfac_x, entrate_x,vscale,ptmp
1121 vscale = 0.25 / 100.
1124 tep = tep * (1.+ tpfac * b_star(i)/
grav)
1133 do k = nlev-1 , 2, -1
1140 du = sqrt( ( u2 - u1 )**2 + ( v2 - v1 )**2 ) / (z2-z1)
1143 entrate_x = entrate * ( 1.0 + du / vscale )
1145 entfr=
min( entrate_x*(z2-z1), 0.99 )
1147 qp = qp + entfr*(q(i,k)-qp)
1150 tep = tep -
grav*( z2-z1 )/
cp 1153 tep = tep + entfr*(t(i,k)-tep)
1159 dqp =
max( qp - qsp, 0. )/(1.+(
alhl/
cp)*dqsp )
1162 tep = tep + pceff *
alhl * dqp/
cp 1165 if ( (t2 .ge. tep) .or. ( entfr .ge. 0.9899 ) )
then 1166 ztop(i) = 0.5*(z2+z1)
1180 subroutine radml_depth(i, ncol, nlev, toplev, botlev, svp, zt, critjump, do_jump_exit, t, zf, zh, zb, zml)
1187 integer,
intent(in) :: i, toplev, botlev, ncol, nlev
1188 real(kind_real),
intent(in) :: svp, zt, critjump
1189 real(kind_real),
intent(in),
dimension(nlev) :: t
1190 real(kind_real),
intent(in),
dimension(ncol,nlev) :: zf
1191 real(kind_real),
intent(in),
dimension(ncol,nlev+1) :: zh
1192 logical,
intent(in) :: do_jump_exit
1195 real(kind_real),
intent(out),
dimension(ncol) :: zb, zml
1198 real(kind_real) :: svpar,h1,h2,t1,t2,entrate,entfr
1211 if (t1.lt.svpar)
then 1219 if (k > toplev)
then 1223 if (t2.lt.svpar)
then 1224 if ( abs(t1 - t2 ) .gt. 0.2 )
then 1225 zb(i) = h2 + (h1 - h2)*(svpar - t2)/(t1 - t2)
1226 zb(i) =
max( zb(i) , 0. )
1234 if (do_jump_exit .and. (t1-t2) .gt. critjump .and. k .gt. toplev+1)
then 1240 entfr =
min( entrate*(h1-h2), 1.0 )
1241 svpar = svpar + entfr*(t2-svpar)
1255 subroutine diffusivity_pbl2(i, ncol, lm, h, kfac, k_ent, vsurf, frland, zm, k_m, k_t)
1262 integer,
intent(in) :: i, lm, ncol
1263 real(kind_real),
intent(in),
dimension(ncol) :: h, frland
1264 real(kind_real),
intent(in) :: k_ent, vsurf, kfac
1265 real(kind_real),
intent(in),
dimension(ncol,1:lm+1) :: zm
1268 real(kind_real),
intent(out),
dimension(lm) :: k_m, k_t
1271 real(kind_real) :: EE, hin, kfacx
1275 if ( frland(i) < 0.5 )
then 1288 if ( vsurf*h(i) .gt. 0. )
then 1289 ee = 1.0 - sqrt( k_ent / ( kfacx *
karman * vsurf * h(i) ) )
1290 ee =
max( ee , 0.7 )
1292 if ( ( zm(i,k) .le. h(i) ) .and. ( zm(i,k) .gt. hin ) )
then 1293 k_t(k) = kfacx *
karman * vsurf * ( zm(i,k)-hin ) * ( 1. - ee*( (zm(i,k)-hin)/(h(i)-hin) ))**2
1304 subroutine esinit(ESTBLX)
1310 real(kind_real),
dimension(TABLESIZE) :: ESTBLX
1313 real(kind_real),
parameter :: ZEROC = 273.16, tmix = -20.0
1315 real(kind_real),
dimension(TABLESIZE) :: ESTBLE, ESTBLW
1318 real(kind_real) :: T, DELTA_T
1335 if(t>=tmix .and. t<0.0)
then 1336 estblx(i) = ( t/tmix )*( estble(i) - estblw(i) ) + estblw(i)
1338 estblx(i) = estble(i)
1352 real(kind_real) :: TL
1355 real(kind_real) :: QS
1358 real(kind_real),
parameter :: ZEROC = 273.16
1359 real(kind_real),
parameter :: TMINLQU = zeroc - 40.0
1361 real*8,
parameter :: B6 = 6.136820929e-11*100.0
1362 real*8,
parameter :: B5 = 2.034080948e-8 *100.0
1363 real*8,
parameter :: B4 = 3.031240396e-6 *100.0
1364 real*8,
parameter :: B3 = 2.650648471e-4 *100.0
1365 real*8,
parameter :: B2 = 1.428945805e-2 *100.0
1366 real*8,
parameter :: B1 = 4.436518521e-1 *100.0
1367 real*8,
parameter :: B0 = 6.107799961e+0 *100.0
1369 real(8) :: TX, EX, TI, TT
1373 if (tx<tminlqu)
then 1382 ex = (tt*(tt*(tt*(tt*(tt*(tt*b6+b5)+b4)+b3)+b2)+b1)+b0)
1398 real(kind_real) :: TL
1401 real(kind_real) :: QS
1404 real(kind_real),
parameter :: ZEROC = 273.16, tminstr = -95.0
1405 real(kind_real),
parameter :: TMINICE = zeroc + tminstr
1407 real(kind_real),
parameter :: TSTARR1 = -75.0, tstarr2 = -65.0, tstarr3 = -50.0, tstarr4 = -40.0
1409 real*8,
parameter :: BI6= 1.838826904e-10*100.0
1410 real*8,
parameter :: BI5= 4.838803174e-8 *100.0
1411 real*8,
parameter :: BI4= 5.824720280e-6 *100.0
1412 real*8,
parameter :: BI3= 4.176223716e-4 *100.0
1413 real*8,
parameter :: BI2= 1.886013408e-2 *100.0
1414 real*8,
parameter :: BI1= 5.034698970e-1 *100.0
1415 real*8,
parameter :: BI0= 6.109177956e+0 *100.0
1416 real*8,
parameter :: S16= 0.516000335e-11*100.0
1417 real*8,
parameter :: S15= 0.276961083e-8 *100.0
1418 real*8,
parameter :: S14= 0.623439266e-6 *100.0
1419 real*8,
parameter :: S13= 0.754129933e-4 *100.0
1420 real*8,
parameter :: S12= 0.517609116e-2 *100.0
1421 real*8,
parameter :: S11= 0.191372282e+0 *100.0
1422 real*8,
parameter :: S10= 0.298152339e+1 *100.0
1423 real*8,
parameter :: S26= 0.314296723e-10*100.0
1424 real*8,
parameter :: S25= 0.132243858e-7 *100.0
1425 real*8,
parameter :: S24= 0.236279781e-5 *100.0
1426 real*8,
parameter :: S23= 0.230325039e-3 *100.0
1427 real*8,
parameter :: S22= 0.129690326e-1 *100.0
1428 real*8,
parameter :: S21= 0.401390832e+0 *100.0
1429 real*8,
parameter :: S20= 0.535098336e+1 *100.0
1431 real(kind_real) :: TX, TI, TT, W, EX
1435 if (tx<tminice)
then 1437 elseif(tx>zeroc )
then 1444 if (tt < tstarr1 )
then 1445 ex = (tt*(tt*(tt*(tt*(tt*(tt*s16+s15)+s14)+s13)+s12)+s11)+s10)
1446 elseif(tt >= tstarr1 .and. tt < tstarr2)
then 1447 w = (tstarr2 - tt)/(tstarr2-tstarr1)
1448 ex = w *(tt*(tt*(tt*(tt*(tt*(tt*s16+s15)+s14)+s13)+s12)+s11)+s10) &
1449 + (1.-w)*(tt*(tt*(tt*(tt*(tt*(tt*s26+s25)+s24)+s23)+s22)+s21)+s20)
1450 elseif(tt >= tstarr2 .and. tt < tstarr3)
then 1451 ex = (tt*(tt*(tt*(tt*(tt*(tt*s26+s25)+s24)+s23)+s22)+s21)+s20)
1452 elseif(tt >= tstarr3 .and. tt < tstarr4)
then 1453 w = (tstarr4 - tt)/(tstarr4-tstarr3)
1454 ex = w *(tt*(tt*(tt*(tt*(tt*(tt*s26+s25)+s24)+s23)+s22)+s21)+s20) &
1455 + (1.-w)*(tt*(tt*(tt*(tt*(tt*(tt*bi6+bi5)+bi4)+bi3)+bi2)+bi1)+bi0)
1457 ex = (tt*(tt*(tt*(tt*(tt*(tt*bi6+bi5)+bi4)+bi3)+bi2)+bi1)+bi0)
1474 real(kind_real) :: TEMP, PLO
1475 real(kind_real) :: ESTBLX(:)
1478 real(kind_real) :: DQSi, QSSi
1481 real(kind_real),
parameter :: MAX_MIXING_RATIO = 1.0
1482 real(kind_real),
parameter :: ESFAC =
h2omw/
airmw 1484 real(kind_real) :: TL, TT, TI, DQSAT, QSAT, DQQ, QQ, PL, PP, DD
1503 dqq = estblx(it+1) - estblx(it)
1504 qq = (tt-it)*dqq + estblx(it)
1507 qsat = max_mixing_ratio
1510 dd = 1.0/(pp - (1.0-esfac)*qq)
1512 dqsat = (esfac*
degsubs)*dqq*pp*(dd*dd)
real(kind=kind_real), parameter, public grav
subroutine dqsat_sub_sca(DQSi, QSSi, TEMP, PLO, ESTBLX)
subroutine esinit(ESTBLX)
real(kind=kind_real), parameter, public p00
subroutine diffusivity_pbl2(i, ncol, lm, h, kfac, k_ent, vsurf, frland, zm, k_m, k_t)
real(kind=kind_real), parameter, public pi
subroutine mpbl_depth(i, ncol, nlev, tpfac, entrate, pceff, t, q, u, v, z, p, b_star, u_star, ipbl, ztop, ESTBLX)
real(kind=kind_real), parameter, public airmw
subroutine qsatlqu0(QS, TL)
subroutine, public bl_driver(IM, JM, LM, DT, U, V, TH, Q, P, QIT, QLT, FRLAND, FROCEAN, VARFLT, ZPBL, CM, CT, CQ, TURBPARAMS, TURBPARAMSI, USTAR, BSTAR, AKS, BKS, CKS, AKQ, BKQ, CKQ, AKV, BKV, CKV, EKV, FKV)
subroutine orodrag(IRUN, LM, DT, LAMBDA_B, C_B, FKV, BKV, U, V, ZFULL, VARFLT, PHALF)
subroutine preliminary(IRUN, LM, DT, T, QV, PHALF, TH, QIT, QLT, ZFULL, ZHALF, TV, PV, RDZ, DMI, PFULL)
subroutine lock_diff(ncol, nlev, tdtlw_in_dev, u_star_dev, b_star_dev, frland_dev, t_dev, qv_dev, qit_dev, qlt_dev, u_dev, v_dev, zfull_dev, pfull_dev, zhalf_dev, phalf_dev, diff_m_dev, diff_t_dev, prandtlsfc_const, prandtlrad_const, beta_surf_const, beta_rad_const, tpfac_sfc_const, entrate_sfc_const, pceff_sfc_const, khradfac_const, khsfcfac_const, radlw_dep, ESTBLX)
real(kind_real), parameter tmaxtbl
subroutine tridiag_setup(IRUN, LM, DT, KPBLMIN, ZFULL, PFULL, RDZ, DMI, PHALF, TV, CT, CQ, CU, T, Q, TH, U, V, DIFF_T, DIFF_M, AKQ, AKS, AKV, BKQ, BKS, BKV, CKQ, CKS, CKV, EKV, ZPBL)
subroutine louis_diff(IRUN, LM, KH, KM, RI, DU, ZPBL, ZZ, ZE, PV, UU, VV, LOUIS, MINSHEAR, MINTHICK, LAMBDAM, LAMBDAM2, LAMBDAH, LAMBDAH2, ZKMENV, ZKHENV, AKHMMAX, ALH_DIAG, KMLS_DIAG, KHLS_DIAG)
subroutine radml_depth(i, ncol, nlev, toplev, botlev, svp, zt, critjump, do_jump_exit, t, zf, zh, zb, zml)
integer, parameter tablesize
real(kind=kind_real), parameter, public cp
real(kind=kind_real), parameter, public vireps
integer, parameter degsubs
real(kind=kind_real), parameter, public tice
subroutine qsatice0(QS, TL)
real(kind=kind_real), parameter, public h2omw
real(kind=kind_real), parameter, public alhs
real(kind=kind_real), parameter, public rgas
real(kind_real), parameter tmintbl
real(kind=kind_real), parameter, public karman
real(kind=kind_real), parameter, public kappa
Constants for the FV3 model.
real(kind=kind_real), parameter, public alhl