10 SUBROUTINE rase( IDIM, IRUN, K0, ICMIN, DT, &
11 CONS_CP, CONS_ALHL, CONS_GRAV, CONS_RGAS, &
12 CONS_H2OMW, CONS_AIRMW, CONS_VIREPS, &
14 KCBL, WGT0, WGT1, FRLAND, TS, &
17 CLW, FLXD, CNV_PRC3, CNV_UPDFRC, &
23 INTEGER,
INTENT(IN ) :: idim, irun, k0, icmin
24 REAL(8),
DIMENSION (IDIM,K0+1),
INTENT(IN ) :: ple
25 REAL(8),
DIMENSION ( K0+1),
INTENT(IN ) :: sige
26 REAL(8),
INTENT(IN ) :: dt, cons_cp, cons_alhl, cons_grav, cons_rgas
27 REAL(8),
INTENT(IN ) :: cons_h2omw,cons_airmw,cons_vireps
28 INTEGER,
DIMENSION (IDIM) ,
INTENT(IN ) :: seedras
29 INTEGER,
DIMENSION (IDIM ),
INTENT(IN ) :: kcbl
30 REAL(8),
DIMENSION (IDIM ),
INTENT(IN ) :: ts, frland
31 REAL(8),
DIMENSION (IDIM ),
INTENT(IN ) :: co_auto
32 REAL(8),
DIMENSION (IDIM,K0 ),
INTENT(IN ) :: wgt0,wgt1
33 REAL(8),
DIMENSION(:),
INTENT(IN ) :: rasparams
34 REAL(8),
DIMENSION(:),
INTENT(IN ) :: estblx
37 REAL(8),
DIMENSION (IDIM,K0 ),
INTENT( OUT) :: clw , flxd
38 REAL(8),
DIMENSION (IDIM,K0 ),
INTENT( OUT) :: cnv_prc3
39 REAL(8),
DIMENSION (IDIM,K0 ),
INTENT( OUT) :: cnv_updfrc
42 REAL(8),
DIMENSION (IDIM,K0 ),
INTENT(INOUT) :: tho, qho, uho, vho
45 INTEGER :: i, ic, l, kk, k
48 REAL(8),
PARAMETER :: onepkap = 1.+ 2./7., daylen = 86400.0
49 REAL(8),
PARAMETER :: rhmax = 0.9999
50 REAL(8),
PARAMETER :: cbl_qpert = 0.0, cbl_tpert = 1.0
51 REAL(8),
PARAMETER :: cbl_tpert_mxocn = 2.0, cbl_tpert_mxlnd = 4.0
54 REAL(8) :: grav, cp, alhl, cpbg, alhi, cpi, gravi, ddt, lbcp
57 REAL(8) :: fricfac, cli_crit, rasal1, rasal2
59 REAL(8) :: sdqv2, sdqv3, sdqvt1
60 REAL(8) :: acritfac, pblfrac, autorampb
61 REAL(8) :: maxdallowed, rhmn, rhmx
64 REAL(8) :: tx2, tx3, akm, acr, alm, tth, qqh, dqx
65 REAL(8) :: wfn, tem, trg, trgexp, evp, wlq, qcc
66 REAL(8) :: cli, te_a, c00_x, cli_crit_x, toki
67 REAL(8) :: dt_lyr, rate, cvw_x, closs, f2, f3, f4
68 REAL(8) :: wght0, prcbl, rndu
69 REAL(8) :: lambda_min, lambda_max
70 REAL(8) :: tpert, qpert
73 REAL(8),
DIMENSION(K0) :: poi_sv, qoi_sv, uoi_sv, voi_sv
74 REAL(8),
DIMENSION(K0) :: poi, qoi, uoi, voi, dqq, bet, gam, cll
75 REAL(8),
DIMENSION(K0) :: poi_c, qoi_c
76 REAL(8),
DIMENSION(K0) :: prh, pri, ght, dpt, dpb, pki
77 REAL(8),
DIMENSION(K0) :: ucu, vcu
78 REAL(8),
DIMENSION(K0) :: cln, rns, pol
79 REAL(8),
DIMENSION(K0) :: qst, ssl, rmf, rnn, rn1, rmfc, rmfp
80 REAL(8),
DIMENSION(K0) :: gms, eta, gmh, eht, gm1, hcc, rmfd
81 REAL(8),
DIMENSION(K0) :: hol, hst, qol, zol, hcld, cll0,cllx,clli
82 REAL(8),
DIMENSION(K0) :: bke , cvw, updfrc
83 REAL(8),
DIMENSION(K0) :: rasal, updfrp,bk2,dll0,dllx
84 REAL(8),
DIMENSION(K0) :: wght, massf
85 REAL(8),
DIMENSION(K0) :: qss, dqs, pf, pk, tempf, zlo
86 REAL(8),
DIMENSION(K0+1) :: prj, prs, qht, sht ,zet, zle, pke
152 fricfac = rasparams(1)
153 cli_crit = rasparams(4)
154 rasal1 = rasparams(5)
155 rasal2 = rasparams(6)
156 friclambda = rasparams(11)
157 sdqv2 = rasparams(14)
158 sdqv3 = rasparams(15)
159 sdqvt1 = rasparams(16)
160 acritfac = rasparams(17)
161 pblfrac = rasparams(20)
162 autorampb = rasparams(21)
164 maxdallowed = rasparams(23)
185 pke = (ple(i,:)/1000.)**(cons_rgas/cons_cp)
186 pf = 0.5*(ple(i,1:k0) + ple(i,2:k0+1 ) )
187 pk = (pf/1000.)**(cons_rgas/cons_cp)
194 zle(l) = tho(i,l) * (1.+cons_vireps*qho(i,l))
195 zlo(l) = zle(l+1) + (cons_cp/cons_grav)*( pke(l+1)-pk(l ) ) * zle(l)
196 zle(l) = zlo(l) + (cons_cp/cons_grav)*( pk(l) -pke(l) ) * zle(l)
199 tpert = cbl_tpert * ( ts(i) - ( tempf(k0)+ cons_grav*zlo(k0)/cons_cp ) )
201 tpert =
max( tpert , 0.0 )
202 qpert =
max( qpert , 0.0 )
204 if (frland(i) < 0.1)
then 205 tpert =
min( tpert , cbl_tpert_mxocn )
207 tpert =
min( tpert , cbl_tpert_mxlnd )
210 call dqsat_ras(dqs,qss,tempf,pf,k0,estblx,cons_h2omw,cons_airmw)
216 prs(icmin:k0+1) = ple(i,icmin:k0+1)
217 poi(icmin:k) = tho(i,icmin:k)
218 qoi(icmin:k) = qho(i,icmin:k)
219 uoi(icmin:k) = uho(i,icmin:k)
220 voi(icmin:k) = vho(i,icmin:k)
222 qst(icmin:k) = qss(icmin:k)
223 dqq(icmin:k) = dqs(icmin:k)
231 prcbl = prcbl + massf(l)*( prs(l+1)-prs(l) )
234 prj(k+1) = (prs(k+1)/1000.)**(cons_rgas/cons_cp)
237 pol(l) = 0.5*(prs(l)+prs(l+1))
238 prh(l) = (prs(l+1)*prj(l+1)-prs(l)*prj(l)) / (onepkap*(prs(l+1)-prs(l)))
239 pki(l) = 1.0 / prh(l)
240 dpt(l) = prh(l ) - prj(l)
241 dpb(l) = prj(l+1) - prh(l)
242 pri(l) = .01 / (prs(l+1)-prs(l))
255 wght(l) = massf(l) * ( ple(i,l+1) - ple(i,l) ) / ( prs(k+1) - prs(k) )
259 poi(k) = poi(k) + wght(l)*tho(i,l)
260 qoi(k) = qoi(k) + wght(l)*qho(i,l)
261 uoi(k) = uoi(k) + wght(l)*uho(i,l)
262 voi(k) = voi(k) + wght(l)*vho(i,l)
265 call dqsats_ras(dqq(k), qst(k), poi(k)*prh(k),pol(k),estblx,cons_h2omw,cons_airmw)
269 rndu =
max( seedras(i)/1000000., 1e-6 )
270 mxdiam = maxdallowed*( rndu**(-1./2.) )
273 bet(l) = dqq(l)*pki(l)
274 gam(l) = pki(l)/(1.0+lbcp*dqq(l))
276 ght(l+1) = gam(l)*dpb(l) + gam(l+1)*dpt(l+1)
277 gm1(l+1) = 0.5*lbcp*(dqq(l )/(alhl*(1.0+lbcp*dqq(l ))) + dqq(l+1)/(alhl*(1.0+lbcp*dqq(l+1))) )
304 sht(k+1) = cp*poi(k)*prj(k+1)
306 qol(l) =
min(qst(l)*rhmax,qoi(l))
307 qol(l) =
max( 0.000, qol(l) )
308 ssl(l) = cp*prj(l+1)*poi(l) + grav*zet(l+1)
309 hol(l) = ssl(l) + qol(l)*alhl
310 hst(l) = ssl(l) + qst(l)*alhl
311 tem = poi(l)*(prj(l+1)-prj(l))*cpbg
312 zet(l) = zet(l+1) + tem
313 zol(l) = zet(l+1) + (prj(l+1)-prh(l))*poi(l)*cpbg
322 trg =
min(1.,(qoi(k)/qst(k)-rhmn)/(rhmx-rhmn))
324 f4 =
min( 1.0,
max( 0.0 , (autorampb-sige(ic))/0.2 ) )
326 IF (trg <= 1.0e-5)
THEN 333 poi_c(k) = poi_c(k) + tpert
334 qoi_c(k) = qoi_c(k) + qpert
337 sht(k+1) = cp*poi_c(k)*prj(k+1)
339 qol(l) =
min(qst(l)*rhmax,qoi_c(l))
340 qol(l) =
max( 0.000, qol(l) )
341 ssl(l) = cp*prj(l+1)*poi_c(l) + grav*zet(l+1)
342 hol(l) = ssl(l) + qol(l)*alhl
343 hst(l) = ssl(l) + qst(l)*alhl
344 tem = poi_c(l)*(prj(l+1)-prj(l))*cpbg
345 zet(l) = zet(l+1) + tem
346 zol(l) = zet(l+1) + (prj(l+1)-prh(l))*poi_c(l)*cpbg
350 tem = (prj(l)-prh(l-1))/(prh(l)-prh(l-1))
351 sht(l) = ssl(l-1) + tem*(ssl(l)-ssl(l-1))
352 qht(l) = .5*(qol(l)+qol(l-1))
356 lambda_min = .2/mxdiam
357 lambda_max = .2/ 200.
359 IF (hol(k) <= hst(ic))
THEN 365 tem = (hst(ic)-hol(ic))*(zol(ic)-zet(ic+1))
367 tem = tem + (hst(ic)-hol(l ))*(zet(l )-zet(l +1))
374 alm = (hol(k)-hst(ic)) / tem
376 IF (alm > lambda_max)
THEN 382 IF (alm < lambda_min)
THEN 383 toki = ( alm/lambda_min )**2
388 eta(l) = 1.0 + alm * (zet(l )-zet(k))
390 eta(ic) = 1.0 + alm * (zol(ic)-zet(k))
396 hcc(l) = hcc(l+1) + (eta(l) - eta(l+1))*hol(l)
397 tem = hcc(l+1)*dpb(l) + hcc(l)*dpt(l)
398 eht(l) = eta(l+1)*dpb(l) + eta(l)*dpt(l)
399 wfn = wfn + (tem - eht(l)*hst(l))*gam(l)
401 hcc(ic) = hst(ic)*eta(ic)
402 wfn = wfn + (hcc(ic+1)-hst(ic)*eta(ic+1))*gam(ic)*dpb(ic)
409 hcld(l) = ( eta(l+1)*hcld(l+1) + (eta(l) - eta(l+1))*hol(l) ) / eta(l)
410 tem = (hcld(l)-hst(l) )*(zet(l)-zet(l+1))/ (1.0+lbcp*dqq(l))
411 bke(l) = bke(l+1) + grav * tem / ( cp*prj(l+1)*poi(l) )
412 bk2(l) = bk2(l+1) + grav *
max(tem,0.0) / ( cp*prj(l+1)*poi(l) )
413 cvw(l) = sqrt( 2.0*
max( bk2(l) , 0.0 ) )
417 IF ( zet(ic) < 2000. )
THEN 420 IF ( zet(ic) >= 2000. )
THEN 421 rasal(ic) = rasal1 + (rasal2-rasal1)*(zet(ic) - 2000.)/8000.
423 rasal(ic) =
min( rasal(ic) , 1.0e5 )
425 rasal(ic) = dt / rasal(ic)
428 cvw(l) =
max( cvw(l) , 1.00 )
431 CALL acritn(pol(ic), prs(k), acr, acritfac)
444 tem = eta(l) - eta(l+1)
445 wlq = wlq + tem * qol(l)
446 uht = uht + tem * uoi(l)
447 vht = vht + tem * voi(l)
450 tx2 = 0.5*(qst(l)+qst(l-1))*eta(l)
451 tx3 = 0.5*(hst(l)+hst(l-1))*eta(l)
452 qcc = tx2 + gm1(l)*(hcc(l)-tx3)
455 cll0(l) = (wlq-qst(ic)*eta(ic))
458 cll0(l) =
max( cll0(l) , 0.00 )
460 cli = cll0(l) / eta(l)
463 CALL sundq3_ice( te_a, sdqv2, sdqv3, sdqvt1, f2 , f3 )
465 c00_x = co_auto(i) * f2 * f3 * f4
466 cli_crit_x = cli_crit / ( f2 * f3 )
468 rate = c00_x * ( 1.0 - exp( -(cli)**2 / cli_crit_x**2 ) )
470 cvw_x =
max( cvw(l) , 1.00 )
472 dt_lyr = ( zet(l)-zet(l+1) )/cvw_x
474 closs = cll0(l) * rate * dt_lyr
475 closs =
min( closs , cll0(l) )
477 cll0(l) = cll0(l) - closs
489 wlq = wlq - qst(ic)*eta(ic)
492 gms(k) = (sht(k)-ssl(k))*pri(k)
493 gmh(k) = gms(k) + (qht(k)-qol(k))*pri(k)*alhl
494 akm = gmh(k)*gam(k-1)*dpb(k-1)
498 gms(l) = ( eta(l )*(sht(l)-ssl(l )) + eta(l+1)*(ssl(l)-sht(l+1)) ) *pri(l)
499 gmh(l) = gms(l) + ( eta(l )*(qht(l)-qol(l )) + eta(l+1)*(qol(l)-qht(l+1)) )*alhl*pri(l)
500 tx2 = tx2 + (eta(l) - eta(l+1)) * gmh(l)
501 akm = akm - gms(l)*eht(l)*pki(l) + tx2*ght(l)
504 gms(ic) = eta(ic+1)*(ssl(ic)-sht(ic+1))*pri(ic)
505 akm = akm - gms(ic)*eta(ic+1)*dpb(ic)*pki(ic)
507 gmh(ic) = gms(ic) + ( eta(ic+1)*(qol(ic)-qht(ic+1))*alhl + eta(ic)*(hst(ic)-hol(ic)))*pri(ic)
510 IF (akm >= 0.0 .OR. wlq < 0.0)
THEN 514 wfn = - (wfn-acr)/akm
515 wfn =
min( ( rasal(ic)*trg*toki )*wfn , (prs(k+1)-prs(k) )*(100.*pblfrac))
519 cll(ic) = cll(ic) + wlq*tem
520 rmf(ic) = rmf(ic) + tem
521 rmfd(ic) = rmfd(ic) + tem * eta(ic)
524 rmfp(l) = tem * eta(l)
525 rmfc(l) = rmfc(l) + rmfp(l)
527 dllx(l) = dllx(l) + tem*dll0(l)
529 IF ( cvw(l) > 0.0 )
THEN 530 updfrp(l) = rmfp(l) * (ddt/daylen) * 1000. / ( cvw(l) * prs(l) )
535 clli(l) = cll0(l)/eta(l)
537 updfrc(l) = updfrc(l) + updfrp(l)
543 rns(l) = rns(l) + rnn(l)*tem
544 gmh(l) = gmh(l) * wfn
545 gms(l) = gms(l) * wfn
546 qoi(l) = qoi(l) + (gmh(l) - gms(l)) * alhi
547 poi(l) = poi(l) + gms(l)*pki(l)*cpi
548 qst(l) = qst(l) + gms(l)*bet(l)*cpi
554 IF (fricfac <= 0.0)
THEN 558 wfn = wfn*fricfac*exp( -alm / friclambda )
561 ucu(k) = ucu(k) + tem * (uoi(k-1) - uoi(k))
562 vcu(k) = vcu(k) + tem * (voi(k-1) - voi(k))
566 ucu(l) = ucu(l) + tem * ( (uoi(l-1) - uoi(l)) * eta(l) + (uoi(l) - uoi(l+1)) * eta(l+1) )
567 vcu(l) = vcu(l) + tem * ( (voi(l-1) - voi(l)) * eta(l) + (voi(l) - voi(l+1)) * eta(l+1) )
571 ucu(ic) = ucu(ic) + (2.*(uht-uoi(ic)*(eta(ic)-eta(ic+1))) - (uoi(ic)+uoi(ic+1))*eta(ic+1))*tem
572 vcu(ic) = vcu(ic) + (2.*(vht-voi(ic)*(eta(ic)-eta(ic+1))) - (voi(ic)+voi(ic+1))*eta(ic+1))*tem
575 uoi(l) = uoi(l) + ucu(l)
576 voi(l) = voi(l) + vcu(l)
581 IF ( sum( rmf(icmin:k) ) > 0.0 )
THEN 585 cnv_prc3(i,l) = rns(l)*tem
588 tho(i,icmin:k-1) = poi(icmin:k-1)
589 qho(i,icmin:k-1) = qoi(icmin:k-1)
590 uho(i,icmin:k-1) = uoi(icmin:k-1)
591 vho(i,icmin:k-1) = voi(icmin:k-1)
592 cnv_updfrc(i,icmin:k-1) = updfrc(icmin:k-1)
600 wght0 = wght0 + wght(l)* ( ple(i,l+1) - ple(i,l) )
603 wght0 = ( prs(k+1) - prs(k) )/wght0
607 tho(i,l) = tho(i,l) + wght(l)*(poi(k) - poi_sv(k))
608 qho(i,l) = qho(i,l) + wght(l)*(qoi(k) - qoi_sv(k))
609 uho(i,l) = uho(i,l) + wght(l)*(uoi(k) - uoi_sv(k))
610 vho(i,l) = vho(i,l) + wght(l)*(voi(k) - voi_sv(k))
613 flxd(i,icmin:k) = rmfd(icmin:k) * ddt/daylen
614 clw(i,icmin:k) = cll(icmin:k) * ddt/daylen
616 flxd(i,1:icmin-1) = 0.
617 clw(i,1:icmin-1) = 0.
640 SUBROUTINE acritn( PL, PLB, ACR, ACRITFAC )
644 REAL(8),
INTENT(IN ) :: pl, plb, acritfac
645 REAL(8),
INTENT(OUT) :: acr
649 REAL(8),
PARAMETER :: ph(15)=(/150.0, 200.0, 250.0, 300.0, 350.0, 400.0, 450.0, 500.0, &
650 550.0, 600.0, 650.0, 700.0, 750.0, 800.0, 850.0/)
652 REAL(8),
PARAMETER :: a(15)=(/ 1.6851, 1.1686, 0.7663, 0.5255, 0.4100, 0.3677, &
653 0.3151, 0.2216, 0.1521, 0.1082, 0.0750, 0.0664, &
654 0.0553, 0.0445, 0.0633 /)
656 iwk = int(pl * 0.02 - 0.999999999)
658 IF (iwk .GT. 1 .AND. iwk .LE. 15)
THEN 659 acr = a(iwk-1) + (pl-ph(iwk-1))*.02*(a(iwk)-a(iwk-1))
660 ELSEIF(iwk > 15)
THEN 666 acr = acritfac * acr * (plb - pl)
670 SUBROUTINE sundq3_ice( TEMP,RATE2,RATE3,TE1, F2, F3)
674 REAL(8),
INTENT( IN) :: temp,rate2,rate3,te1
675 REAL(8),
INTENT(OUT) :: f2, f3
677 REAL(8) :: xx, yy,te0,te2,jump1
681 jump1= (rate2-1.0) / ( ( te0-te1 )**0.333 )
684 IF ( temp .GE. te0 )
THEN 689 IF ( ( temp .GE. te1 ) .AND. ( temp .LT. te0 ) )
THEN 690 f2 = 1.0 + jump1 * (( te0 - temp )**0.3333)
694 IF ( temp .LT. te1 )
THEN 695 f2 = rate2 + (rate3-rate2)*(te1-temp)/(te1-te2)
699 IF ( f2 .GT. 27.0 )
THEN 705 subroutine dqsat_ras(DQSi,QSSi,TEMP,PLO,lm,ESTBLX,CONS_H2OMW,CONS_AIRMW)
714 REAL(8),
dimension(lm) :: temp, plo
716 REAL(8) :: cons_h2omw, cons_airmw
719 REAL(8),
dimension(lm) :: dqsi, qssi
722 REAL(8),
parameter :: max_mixing_ratio = 1.0
727 REAL(8) :: tl, tt, ti, dqsat, qsat, dqq, qq, pl, pp, dd
730 INTEGER,
parameter :: degsubs = 100
731 REAL(8),
parameter :: tmintbl = 150.0, tmaxtbl = 333.0
732 INTEGER,
parameter :: tablesize = nint(tmaxtbl-tmintbl)*degsubs + 1
734 esfac = cons_h2omw/cons_airmw
743 if (tl<=tmintbl)
then 745 elseif(tl>=tmaxtbl-.001)
then 751 tt = (ti - tmintbl)*degsubs+1
754 dqq = estblx(it+1) - estblx(it)
755 qq = (tt-it)*dqq + estblx(it)
758 qsat = max_mixing_ratio
761 dd = 1.0/(pp - (1.0-esfac)*qq)
763 dqsat = (esfac*degsubs)*dqq*pp*(dd*dd)
773 subroutine dqsats_ras(DQSi,QSSi,TEMP,PLO,ESTBLX,CONS_H2OMW,CONS_AIRMW)
783 REAL(8) :: cons_h2omw, cons_airmw
786 REAL(8) :: dqsi, qssi
789 REAL(8),
parameter :: max_mixing_ratio = 1.0
792 REAL(8) :: tl, tt, ti, dqsat, qsat, dqq, qq, pl, pp, dd
795 INTEGER,
parameter :: degsubs = 100
796 REAL(8),
parameter :: tmintbl = 150.0, tmaxtbl = 333.0
797 INTEGER,
parameter :: tablesize = nint(tmaxtbl-tmintbl)*degsubs + 1
799 esfac = cons_h2omw/cons_airmw
806 if (tl<=tmintbl)
then 808 elseif(tl>=tmaxtbl-.001)
then 814 tt = (ti - tmintbl)*degsubs+1
817 dqq = estblx(it+1) - estblx(it)
818 qq = (tt-it)*dqq + estblx(it)
821 qsat = max_mixing_ratio
824 dd = 1.0/(pp - (1.0-esfac)*qq)
826 dqsat = (esfac*degsubs)*dqq*pp*(dd*dd)
834 SUBROUTINE rase0(IDIM, IRUN, K0, ICMIN, DT, &
835 CONS_CP, CONS_ALHL, CONS_GRAV, CONS_RGAS, &
836 CONS_H2OMW, CONS_AIRMW, CONS_VIREPS, &
838 KCBL, WGT0, WGT1, FRLAND, TS, &
841 CLW, FLXD, CNV_PRC3, CNV_UPDFRC, &
847 INTEGER,
INTENT(IN ) :: idim, irun, k0, icmin
848 REAL(8),
DIMENSION (IDIM,K0+1),
INTENT(IN ) :: ple
849 REAL(8),
DIMENSION ( K0+1),
INTENT(IN ) :: sige
850 REAL(8),
INTENT(IN ) :: dt, cons_cp, cons_alhl, cons_grav, cons_rgas
851 REAL(8),
INTENT(IN ) :: cons_h2omw,cons_airmw,cons_vireps
852 INTEGER,
DIMENSION (IDIM) ,
INTENT(IN ) :: seedras
853 INTEGER,
DIMENSION (IDIM ),
INTENT(IN ) :: kcbl
854 REAL(8),
DIMENSION (IDIM ),
INTENT(IN ) :: ts, frland
855 REAL(8),
DIMENSION (IDIM ),
INTENT(IN ) :: co_auto
856 REAL(8),
DIMENSION (IDIM,K0 ),
INTENT(IN ) :: wgt0,wgt1
857 REAL(8),
DIMENSION(:),
INTENT(IN ) :: rasparams
858 REAL(8),
DIMENSION(:),
INTENT(IN ) :: estblx
861 REAL(8),
DIMENSION (IDIM,K0 ),
INTENT( OUT) :: clw , flxd
862 REAL(8),
DIMENSION (IDIM,K0 ),
INTENT( OUT) :: cnv_prc3
863 REAL(8),
DIMENSION (IDIM,K0 ),
INTENT( OUT) :: cnv_updfrc
866 REAL(8),
DIMENSION (IDIM,K0 ),
INTENT(INOUT) :: tho, qho
869 INTEGER :: i, ic, l, kk, k
872 REAL(8),
PARAMETER :: onepkap = 1.+ 2./7., daylen = 86400.0
873 REAL(8),
PARAMETER :: rhmax = 0.9999
874 REAL(8),
PARAMETER :: cbl_qpert = 0.0, cbl_tpert = 1.0
875 REAL(8),
PARAMETER :: cbl_tpert_mxocn = 2.0, cbl_tpert_mxlnd = 4.0
878 REAL(8) :: grav, cp, alhl, cpbg, alhi, cpi, gravi, ddt, lbcp
881 REAL(8) :: fricfac, cli_crit, rasal1, rasal2
882 REAL(8) :: friclambda
883 REAL(8) :: sdqv2, sdqv3, sdqvt1
884 REAL(8) :: acritfac, pblfrac, autorampb
885 REAL(8) :: maxdallowed, rhmn, rhmx
888 REAL(8) :: tx2, tx3, akm, acr, alm, tth, qqh, dqx
889 REAL(8) :: wfn, tem, trg, trgexp, evp, wlq, qcc
890 REAL(8) :: cli, te_a, c00_x, cli_crit_x, toki
891 REAL(8) :: dt_lyr, rate, cvw_x, closs, f2, f3, f4
892 REAL(8) :: wght0, prcbl, rndu
893 REAL(8) :: lambda_min, lambda_max
894 REAL(8) :: tpert,qpert
896 REAL(8),
DIMENSION(K0) :: poi_sv, qoi_sv
897 REAL(8),
DIMENSION(K0) :: poi, qoi, dqq, bet, gam, cll
898 REAL(8),
DIMENSION(K0) :: poi_c, qoi_c
899 REAL(8),
DIMENSION(K0) :: prh, pri, ght, dpt, dpb, pki
900 REAL(8),
DIMENSION(K0) :: cln, rns, pol,dm
901 REAL(8),
DIMENSION(K0) :: qst, ssl, rmf, rnn, rn1, rmfc, rmfp
902 REAL(8),
DIMENSION(K0) :: gms, eta, gmh, eht, gm1, hcc, rmfd
903 REAL(8),
DIMENSION(K0) :: hol, hst, qol, zol, hcld, cll0,cllx,clli
904 REAL(8),
DIMENSION(K0) :: bke , cvw, updfrc
905 REAL(8),
DIMENSION(K0) :: rasal, updfrp,bk2,dll0,dllx
906 REAL(8),
DIMENSION(K0) :: wght, massf
907 REAL(8),
DIMENSION(K0) :: qss, dqs, pf, pk, tempf, zlo
908 REAL(8),
DIMENSION(K0+1) :: prj, prs, qht, sht ,zet, zle, pke
915 fricfac = rasparams(1)
916 cli_crit = rasparams(4)
917 rasal1 = rasparams(5)
918 rasal2 = rasparams(6)
919 friclambda = rasparams(11)
920 sdqv2 = rasparams(14)
921 sdqv3 = rasparams(15)
922 sdqvt1 = rasparams(16)
923 acritfac = rasparams(17)
924 pblfrac = rasparams(20)
925 autorampb = rasparams(21)
927 maxdallowed = rasparams(23)
948 pke = (ple(i,:)/1000.)**(cons_rgas/cons_cp)
949 pf = 0.5*(ple(i,1:k0) + ple(i,2:k0+1 ) )
950 pk = (pf/1000.)**(cons_rgas/cons_cp)
957 zle(l) = tho(i,l) * (1.+cons_vireps*qho(i,l))
958 zlo(l) = zle(l+1) + (cons_cp/cons_grav)*( pke(l+1)-pk(l ) ) * zle(l)
959 zle(l) = zlo(l) + (cons_cp/cons_grav)*( pk(l) -pke(l) ) * zle(l)
962 tpert = cbl_tpert * ( ts(i) - ( tempf(k0)+ cons_grav*zlo(k0)/cons_cp ) )
964 tpert =
max( tpert , 0.0 )
965 qpert =
max( qpert , 0.0 )
967 if (frland(i) < 0.1)
then 968 tpert =
min( tpert , cbl_tpert_mxocn )
970 tpert =
min( tpert , cbl_tpert_mxlnd )
973 call dqsat_ras(dqs,qss,tempf,pf,k0,estblx,cons_h2omw,cons_airmw)
982 prs(icmin:k0+1) = ple(i,icmin:k0+1)
983 poi(icmin:k) = tho(i,icmin:k)
984 qoi(icmin:k) = qho(i,icmin:k)
986 qst(icmin:k) = qss(icmin:k)
987 dqq(icmin:k) = dqs(icmin:k)
995 prcbl = prcbl + massf(l)*( prs(l+1)-prs(l) )
998 prj(k+1) = (prs(k+1)/1000.)**(cons_rgas/cons_cp)
1001 pol(l) = 0.5*(prs(l)+prs(l+1))
1002 prh(l) = (prs(l+1)*prj(l+1)-prs(l)*prj(l)) / (onepkap*(prs(l+1)-prs(l)))
1003 pki(l) = 1.0 / prh(l)
1004 dpt(l) = prh(l ) - prj(l)
1005 dpb(l) = prj(l+1) - prh(l)
1006 pri(l) = .01 / (prs(l+1)-prs(l))
1017 wght(l) = massf(l) * ( ple(i,l+1) - ple(i,l) ) / ( prs(k+1) - prs(k) )
1021 poi(k) = poi(k) + wght(l)*tho(i,l)
1022 qoi(k) = qoi(k) + wght(l)*qho(i,l)
1025 call dqsats_ras(dqq(k), qst(k), poi(k)*prh(k),pol(k),estblx,cons_h2omw,cons_airmw)
1029 rndu =
max( seedras(i)/1000000., 1e-6 )
1030 mxdiam = maxdallowed*( rndu**(-1./2.) )
1033 bet(l) = dqq(l)*pki(l)
1034 gam(l) = pki(l)/(1.0+lbcp*dqq(l))
1036 ght(l+1) = gam(l)*dpb(l) + gam(l+1)*dpt(l+1)
1037 gm1(l+1) = 0.5*lbcp*(dqq(l )/(alhl*(1.0+lbcp*dqq(l ))) + dqq(l+1)/(alhl*(1.0+lbcp*dqq(l+1))) )
1062 sht(k+1) = cp*poi(k)*prj(k+1)
1064 qol(l) =
min(qst(l)*rhmax,qoi(l))
1065 qol(l) =
max( 0.000, qol(l) )
1066 ssl(l) = cp*prj(l+1)*poi(l) + grav*zet(l+1)
1067 hol(l) = ssl(l) + qol(l)*alhl
1068 hst(l) = ssl(l) + qst(l)*alhl
1069 tem = poi(l)*(prj(l+1)-prj(l))*cpbg
1070 zet(l) = zet(l+1) + tem
1071 zol(l) = zet(l+1) + (prj(l+1)-prh(l))*poi(l)*cpbg
1074 DO ic = k,icmin+1,-1
1077 trg =
min(1.,(qoi(k)/qst(k)-rhmn)/(rhmx-rhmn))
1079 f4 =
min( 1.0,
max( 0.0 , (autorampb-sige(ic))/0.2 ) )
1081 IF (trg <= 1.0e-5)
THEN 1088 poi_c(k) = poi_c(k) + tpert
1089 qoi_c(k) = qoi_c(k) + qpert
1092 sht(k+1) = cp*poi_c(k)*prj(k+1)
1094 qol(l) =
min(qst(l)*rhmax,qoi_c(l))
1095 qol(l) =
max( 0.000, qol(l) )
1096 ssl(l) = cp*prj(l+1)*poi_c(l) + grav*zet(l+1)
1097 hol(l) = ssl(l) + qol(l)*alhl
1098 hst(l) = ssl(l) + qst(l)*alhl
1099 tem = poi_c(l)*(prj(l+1)-prj(l))*cpbg
1100 zet(l) = zet(l+1) + tem
1101 zol(l) = zet(l+1) + (prj(l+1)-prh(l))*poi_c(l)*cpbg
1105 tem = (prj(l)-prh(l-1))/(prh(l)-prh(l-1))
1106 sht(l) = ssl(l-1) + tem*(ssl(l)-ssl(l-1))
1107 qht(l) = .5*(qol(l)+qol(l-1))
1111 lambda_min = .2/mxdiam
1112 lambda_max = .2/ 200.
1114 IF (hol(k) <= hst(ic))
THEN 1120 tem = (hst(ic)-hol(ic))*(zol(ic)-zet(ic+1))
1122 tem = tem + (hst(ic)-hol(l ))*(zet(l )-zet(l +1))
1125 IF (tem <= 0.0)
THEN 1129 alm = (hol(k)-hst(ic)) / tem
1131 IF (alm > lambda_max)
THEN 1137 IF (alm < lambda_min)
THEN 1138 toki = ( alm/lambda_min )**2
1143 eta(l) = 1.0 + alm * (zet(l )-zet(k))
1145 eta(ic) = 1.0 + alm * (zol(ic)-zet(k))
1151 hcc(l) = hcc(l+1) + (eta(l) - eta(l+1))*hol(l)
1152 tem = hcc(l+1)*dpb(l) + hcc(l)*dpt(l)
1153 eht(l) = eta(l+1)*dpb(l) + eta(l)*dpt(l)
1154 wfn = wfn + (tem - eht(l)*hst(l))*gam(l)
1156 hcc(ic) = hst(ic)*eta(ic)
1157 wfn = wfn + (hcc(ic+1)-hst(ic)*eta(ic+1))*gam(ic)*dpb(ic)
1164 hcld(l) = ( eta(l+1)*hcld(l+1) + (eta(l) - eta(l+1))*hol(l) ) / eta(l)
1165 tem = (hcld(l)-hst(l) )*(zet(l)-zet(l+1))/ (1.0+lbcp*dqq(l))
1166 bke(l) = bke(l+1) + grav * tem / ( cp*prj(l+1)*poi(l) )
1167 bk2(l) = bk2(l+1) + grav *
max(tem,0.0) / ( cp*prj(l+1)*poi(l) )
1168 cvw(l) = sqrt( 2.0*
max( bk2(l) , 0.0 ) )
1172 IF ( zet(ic) < 2000. )
THEN 1175 IF ( zet(ic) >= 2000. )
THEN 1176 rasal(ic) = rasal1 + (rasal2-rasal1)*(zet(ic) - 2000.)/8000.
1178 rasal(ic) =
min( rasal(ic) , 1.0e5 )
1180 rasal(ic) = dt / rasal(ic)
1182 cvw(ic:k) =
max( cvw(ic:k) , 1.00 )
1184 CALL acritn(pol(ic), prs(k), acr, acritfac)
1186 IF (wfn <= acr)
THEN 1195 tem = eta(l) - eta(l+1)
1196 wlq = wlq + tem * qol(l)
1199 tx2 = 0.5*(qst(l)+qst(l-1))*eta(l)
1200 tx3 = 0.5*(hst(l)+hst(l-1))*eta(l)
1201 qcc = tx2 + gm1(l)*(hcc(l)-tx3)
1204 cll0(l) = (wlq-qst(ic)*eta(ic))
1207 cll0(l) =
max( cll0(l) , 0.00 )
1209 cli = cll0(l) / eta(l)
1210 te_a = poi(l)*prh(l)
1212 CALL sundq3_ice( te_a, sdqv2, sdqv3, sdqvt1, f2 , f3 )
1214 c00_x = co_auto(i) * f2 * f3 * f4
1215 cli_crit_x = cli_crit / ( f2 * f3 )
1217 rate = c00_x * ( 1.0 - exp( -(cli)**2 / cli_crit_x**2 ) )
1219 cvw_x =
max( cvw(l) , 1.00 )
1221 dt_lyr = ( zet(l)-zet(l+1) )/cvw_x
1223 closs = cll0(l) * rate * dt_lyr
1224 closs =
min( closs , cll0(l) )
1226 cll0(l) = cll0(l) - closs
1238 wlq = wlq - qst(ic)*eta(ic)
1241 gms(k) = (sht(k)-ssl(k))*pri(k)
1242 gmh(k) = gms(k) + (qht(k)-qol(k))*pri(k)*alhl
1243 akm = gmh(k)*gam(k-1)*dpb(k-1)
1247 gms(l) = ( eta(l )*(sht(l)-ssl(l )) + eta(l+1)*(ssl(l)-sht(l+1)) ) *pri(l)
1248 gmh(l) = gms(l) + ( eta(l )*(qht(l)-qol(l )) + eta(l+1)*(qol(l)-qht(l+1)) )*alhl*pri(l)
1249 tx2 = tx2 + (eta(l) - eta(l+1)) * gmh(l)
1250 akm = akm - gms(l)*eht(l)*pki(l) + tx2*ght(l)
1253 gms(ic) = eta(ic+1)*(ssl(ic)-sht(ic+1))*pri(ic)
1254 akm = akm - gms(ic)*eta(ic+1)*dpb(ic)*pki(ic)
1256 gmh(ic) = gms(ic) + ( eta(ic+1)*(qol(ic)-qht(ic+1))*alhl + eta(ic)*(hst(ic)-hol(ic)))*pri(ic)
1259 IF (akm >= 0.0 .OR. wlq < 0.0)
THEN 1263 wfn = - (wfn-acr)/akm
1264 wfn =
min( ( rasal(ic)*trg*toki )*wfn , (prs(k+1)-prs(k) )*(100.*pblfrac))
1268 cll(ic) = cll(ic) + wlq*tem
1269 rmf(ic) = rmf(ic) + tem
1270 rmfd(ic) = rmfd(ic) + tem * eta(ic)
1273 rmfp(l) = tem * eta(l)
1274 rmfc(l) = rmfc(l) + rmfp(l)
1276 dllx(l) = dllx(l) + tem*dll0(l)
1278 IF ( cvw(l) > 0.0 )
THEN 1279 updfrp(l) = rmfp(l) * (ddt/daylen) * 1000. / ( cvw(l) * prs(l) )
1284 clli(l) = cll0(l)/eta(l)
1286 updfrc(l) = updfrc(l) + updfrp(l)
1292 rns(l) = rns(l) + rnn(l)*tem
1293 gmh(l) = gmh(l) * wfn
1294 gms(l) = gms(l) * wfn
1295 qoi(l) = qoi(l) + (gmh(l) - gms(l)) * alhi
1296 poi(l) = poi(l) + gms(l)*pki(l)*cpi
1297 qst(l) = qst(l) + gms(l)*bet(l)*cpi
1302 IF ( sum( rmf(icmin:k) ) > 0.0 )
THEN 1306 cnv_prc3(i,l) = rns(l)*tem
1309 tho(i,icmin:k-1) = poi(icmin:k-1)
1310 qho(i,icmin:k-1) = qoi(icmin:k-1)
1311 cnv_updfrc(i,icmin:k-1) = updfrc(icmin:k-1)
1319 wght0 = wght0 + wght(l)* ( ple(i,l+1) - ple(i,l) )
1322 wght0 = ( prs(k+1) - prs(k) )/wght0
1326 tho(i,l) = tho(i,l) + wght(l)*(poi(k) - poi_sv(k))
1327 qho(i,l) = qho(i,l) + wght(l)*(qoi(k) - qoi_sv(k))
1330 flxd(i,icmin:k) = rmfd(icmin:k) * ddt/daylen
1331 clw(i,icmin:k) = cll(icmin:k) * ddt/daylen
1333 flxd(i,1:icmin-1) = 0.
1334 clw(i,1:icmin-1) = 0.
1357 END SUBROUTINE rase0 subroutine, public acritn(PL, PLB, ACR, ACRITFAC)
subroutine, public dqsat_ras(DQSi, QSSi, TEMP, PLO, lm, ESTBLX, CONS_H2OMW, CONS_AIRMW)
subroutine, public dqsats_ras(DQSi, QSSi, TEMP, PLO, ESTBLX, CONS_H2OMW, CONS_AIRMW)
subroutine, public rase0(IDIM, IRUN, K0, ICMIN, DT, CONS_CP, CONS_ALHL, CONS_GRAV, CONS_RGAS, CONS_H2OMW, CONS_AIRMW, CONS_VIREPS, SEEDRAS, SIGE, KCBL, WGT0, WGT1, FRLAND, TS, THO, QHO, CO_AUTO, PLE, CLW, FLXD, CNV_PRC3, CNV_UPDFRC, RASPARAMS, ESTBLX)
subroutine, public rase(IDIM, IRUN, K0, ICMIN, DT, CONS_CP, CONS_ALHL, CONS_GRAV, CONS_RGAS, CONS_H2OMW, CONS_AIRMW, CONS_VIREPS, SEEDRAS, SIGE, KCBL, WGT0, WGT1, FRLAND, TS, THO, QHO, UHO, VHO, CO_AUTO, PLE, CLW, FLXD, CNV_PRC3, CNV_UPDFRC, RASPARAMS, ESTBLX)
subroutine, public sundq3_ice(TEMP, RATE2, RATE3, TE1, F2, F3)