5 REAL , PARAMETER :: cincap = -10.
6 REAL , PARAMETER :: capemin = 10.
7 REAL , PARAMETER :: dpthmin = 1000.
8 REAL , PARAMETER :: alpha = 0.00002
9 REAL , PARAMETER :: eps = 0.5
10 REAL , PARAMETER :: Vfall = 5.
12 !--------------------------------------------------------------------
17 ids,ide, jds,jde, kds,kde &
18 ,ims,ime, jms,jme, kms,kme &
19 ,its,ite, jts,jte, kts,kte &
21 ,rho,RAINCV,NCA, PRATEC & ! add PRATEC by zhuxiao
22 ,U,V,TH,T,W,dz8w,Z,Pcps,pi &
24 ,CP,RD,RV,G,XLV & ! constant variable
25 ,EP2,SVP1,SVP2,SVP3,SVPT0 & ! constant variable
26 ,STEPCU,CU_ACT_FLAG,warm_rain,CUTOP,CUBOT &
32 !-------------------------------------------------------------
34 !-------------------------------------------------------------
35 INTEGER, INTENT(IN ) :: &
36 ids,ide, jds,jde, kds,kde, &
37 ims,ime, jms,jme, kms,kme, &
38 its,ite, jts,jte, kts,kte
40 INTEGER, INTENT(IN ) :: STEPCU
41 LOGICAL, INTENT(IN ) :: warm_rain
43 REAL, INTENT(IN ) :: XLV
44 REAL, INTENT(IN ) :: CP,RD,RV,G,EP2
45 REAL, INTENT(IN ) :: SVP1,SVP2,SVP3,SVPT0
47 INTEGER, INTENT(IN ) :: KTAU
49 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , &
63 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , &
67 REAL, INTENT(IN ) :: DT, DX
69 REAL, DIMENSION( ims:ime , jms:jme ), &
70 INTENT(INOUT) :: RAINCV &
73 REAL, DIMENSION( ims:ime , jms:jme ), &
76 REAL, DIMENSION( ims:ime , jms:jme ), &
77 INTENT(OUT) :: CUBOT, &
80 LOGICAL, DIMENSION( ims:ime , jms:jme ), &
81 INTENT(INOUT) :: CU_ACT_FLAG
87 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), &
96 LOGICAL :: flag_qr, flag_qi, flag_qs
98 REAL, DIMENSION( kts:kte ) :: &
110 REAL, DIMENSION( kts:kte ):: &
114 REAL :: PPRATE,TST,tv,PRS,RHOE,W0,SCR1,DXSQ,RTHCUMAX
116 INTEGER :: i,j,k,i_start,i_end,j_start,j_end,sz,NTST,ICLDCK
121 ICLDCK=MOD(KTAU,NTST)
122 IF(ICLDCK.EQ.0 .or. KTAU .eq. 1) then
124 ! Keep away from specified and relaxation zone (should be for just specified and nested bc)
126 i_start=max(ids+sz,its)
127 i_end=min(ide-1-sz,ite)
128 j_start=max(jds+sz,jts)
129 j_end=min(jde-1-sz,jte)
131 DO J = j_start, j_end
143 ! assign vars from 3D to 1D
152 IF ( QV1D(K) .LT. 1.E-08 ) QV1D(K) = 1.E-08
154 W0AVG1D(K) =W0AVG(I,K,J)
159 U1D,V1D,T1D,QV1D,P1D,DZ1D,Z1D, &
160 W0AVG1D,DT,DX,DXSQ,RHO1D,TH1D, &
162 EP2,SVP1,SVP2,SVP3,SVPT0, &
166 ids,ide, jds,jde, kds,kde, &
167 ims,ime, jms,jme, kms,kme, &
168 its,ite, jts,jte, kts,kte)
169 IF(PRESENT(rthcuten).AND.PRESENT(rqvcuten)) THEN
171 RTHCUTEN(I,K,J)=DTHDT(K)
172 RQVCUTEN(I,K,J)=DQVDT(K)
175 RAINCV(I,J)=PPRATE*DT
182 ! ****************************************************************************
183 !-----------------------------------------------------------
184 SUBROUTINE DUCU1D (I, J, &
185 U0,V0,T0,QV0,P0,DZQ,Z,W0AVG1D, &
186 DELT,DX,DXSQ,rhoe,TH0, &
188 EP2,SVP1,SVP2,SVP3,SVPT0, &
192 ids,ide, jds,jde, kds,kde, &
193 ims,ime, jms,jme, kms,kme, &
194 its,ite, jts,jte, kts,kte)
195 !-----------------------------------------------------------
198 !-----------------------------------------------------------
199 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde, &
200 ims,ime, jms,jme, kms,kme, &
201 its,ite, jts,jte, kts,kte, &
205 REAL, DIMENSION( kts:kte ), &
217 REAL, INTENT(IN ) :: DELT,DX,DXSQ
220 REAL, INTENT(IN ) :: XLV,CP,RD,RV,G
221 REAL, INTENT(IN ) :: EP2,SVP1,SVP2,SVP3,SVPT0
224 REAL, DIMENSION( kts:kte ), INTENT(INOUT) :: &
228 REAL, DIMENSION( ims:ime , jms:jme ), &
231 REAL, DIMENSION( ims:ime , jms:jme ), &
232 INTENT(OUT) :: CUBOT, &
234 REAL, INTENT(OUT ) :: PPRATE
236 !...DEFINE LOCAL VARIABLES...
238 REAL, DIMENSION( kts:kte ) :: cond,h,hs,qs,x
239 REAL :: buoy,cape,cin,dh,dq,dt,dtm,ep,es, &
240 evap,hp,mp,qp,qsp,rrk,rrkp, &
242 INTEGER :: ipos,isat,k,kb,ki,kt
246 h(k)=cp*t0(k)+g*z(k)+xlv*qv0(k)
247 es=1000.*svp1*EXP(svp2*(t0(k)-svpt0)/(t0(k)-svp3))
248 qs(k)=ep2*es/(p0(k)-es)
249 hs(k)=cp*t0(k)+g*z(k)+xlv*qs(k)
250 x(k)=xlv*xlv*qs(k)/(cp*rv*t0(k)*t0(k))
257 !...LOOP OVER PARCELS
258 loop_origin: DO ki=kts,kte
261 mp=alpha*rhoe(ki)*dzq(ki)
276 loop_lift: DO k=ki+1,kte
277 tadp=t0(ki)+(g/cp)*(z(ki)-z(k))
278 ep=p0(k)*qv0(ki)/(ep2+qv0(ki))
279 tdp=(svpt0-(svp3/svp2)*ALOG(0.001*ep/svp1))/(1.-(1./svp2)*ALOG(0.001*ep/svp1))
283 print *,i,j,'sounding warning: unsat above sat'
296 qsp=qs(k)+(dh/xlv)*x(k)/(1.+x(k))
297 !...CONDENSATE PRODUCED
301 buoy=buoy+g*dt*dzq(k)/t0(k)
303 IF(buoy.GE.cincap)cin=min(cin,buoy)
307 ELSE IF(dt .LT. 0. .AND. dtm .GE. 0.)THEN
308 ! cloud top is level closest to parcel temperature
309 IF(abs(dt) .LT. abs(dtm))THEN
315 ! continue lifting until buoyancy is gone
316 IF(buoy.LT.cincap)THEN
320 ! positive area detected
327 print *,'sounding warning: cloud top at model top'
333 ! no cloud from lifting - no convection
336 IF(zt-zb.LE.dpthmin)THEN
337 ! not more than one cloud level - no convection
341 ! no buoyancy in cloud - no convection
344 IF(cape.LE.capemin)THEN
349 !...IF CHECK FOR CLOUD SUCCESSFUL
353 dt=(dh/cp)/(1.+x(kt))
354 dq=qs(kt)+(dh/xlv)*x(kt)/(1.+x(kt))-qv0(kt)
355 dthdt(kt)=dthdt(kt)+mp*(th0(kt)/t0(kt))*dt/(rhoe(kt)*dzq(kt))
356 dqvdt(kt)=dqvdt(kt)+mp*dq/(rhoe(kt)*dzq(kt))
359 loop_subsidence: DO k=kt-1,ki,-1
360 dthdt(k)=dthdt(k)+mp*(th0(k+1)-th0(k))/(rhoe(k)*dzq(k))
361 dqvdt(k)=dqvdt(k)+mp*(qv0(k+1)-qv0(k))/(rhoe(k)*dzq(k))
362 ENDDO loop_subsidence
364 !...RAINFALL AND EVAPORATION
366 loop_rainfall: DO k=kt,1,-1
368 evap=dzq(k)*rrkp/Vfall*eps*(qs(k)-qv0(k))
370 ! restrict evap to below cloud base
375 dqvdt(k)=dqvdt(k)+evap/(rhoe(k)*dzq(k))
376 dthdt(k)=dthdt(k)-(xlv/cp)*(th0(kt)/t0(kt))*evap/(rhoe(k)*dzq(k))
383 !-----------------------------------------------------------------------
384 END SUBROUTINE DUCU1D
385 ! ***********************************************************************
386 !====================================================================
387 SUBROUTINE ducuinit(RTHCUTEN,RQVCUTEN,RQCCUTEN,RQRCUTEN, &
388 RQICUTEN,RQSCUTEN,NCA,W0AVG,P_QC,P_QR, &
389 SVP1,SVP2,SVP3,SVPT0, &
390 P_FIRST_SCALAR,restart,allowed_to_read, &
391 ids, ide, jds, jde, kds, kde, &
392 ims, ime, jms, jme, kms, kme, &
393 its, ite, jts, jte, kts, kte )
394 !--------------------------------------------------------------------
396 !--------------------------------------------------------------------
397 LOGICAL , INTENT(IN) :: restart,allowed_to_read
398 INTEGER , INTENT(IN) :: ids, ide, jds, jde, kds, kde, &
399 ims, ime, jms, jme, kms, kme, &
400 its, ite, jts, jte, kts, kte
401 INTEGER , INTENT(IN) :: P_QC,P_QR,P_FIRST_SCALAR
403 REAL, DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: &
411 REAL , DIMENSION( ims:ime , kms:kme , jms:jme ) , INTENT(OUT) :: W0AVG
413 REAL, DIMENSION( ims:ime , jms:jme ), INTENT(INOUT):: NCA
415 INTEGER :: i, j, k, itf, jtf, ktf
416 REAL, INTENT(IN) :: SVP1,SVP2,SVP3,SVPT0
433 IF (P_QC .ge. P_FIRST_SCALAR) THEN
459 END SUBROUTINE ducuinit
461 END MODULE module_cu_du