PageRenderTime 63ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/wrfv2_fire/phys/module_mp_etanew.F

http://github.com/jbeezley/wrf-fire
FORTRAN Legacy | 2675 lines | 1273 code | 68 blank | 1334 comment | 1 complexity | 8ae618e33a201896565cf54034d178fc MD5 | raw file
Possible License(s): AGPL-1.0

Large files files are truncated, but you can click here to view the full file

  1. !WRF:MODEL_MP:PHYSICS
  2. !
  3. MODULE module_mp_etanew
  4. !
  5. !-----------------------------------------------------------------------
  6. REAL,PRIVATE,SAVE :: ABFR, CBFR, CIACW, CIACR, C_N0r0, &
  7. & CN0r0, CN0r_DMRmin, CN0r_DMRmax, CRACW, CRAUT, ESW0, &
  8. & RFmax, RQR_DR1, RQR_DR2, RQR_DR3, RQR_DRmin, &
  9. & RQR_DRmax, RR_DRmin, RR_DR1, RR_DR2, RR_DR3, RR_DR4, &
  10. & RR_DR5, RR_DRmax
  11. !
  12. INTEGER, PRIVATE,PARAMETER :: MY_T1=1, MY_T2=35
  13. REAL,PRIVATE,DIMENSION(MY_T1:MY_T2),SAVE :: MY_GROWTH
  14. !
  15. REAL, PRIVATE,PARAMETER :: DMImin=.05e-3, DMImax=1.e-3, &
  16. & DelDMI=1.e-6,XMImin=1.e6*DMImin
  17. INTEGER, PUBLIC,PARAMETER :: XMImax=1.e6*DMImax, XMIexp=.0536, &
  18. & MDImin=XMImin, MDImax=XMImax
  19. REAL, PRIVATE,DIMENSION(MDImin:MDImax) :: &
  20. & ACCRI,SDENS,VSNOWI,VENTI1,VENTI2
  21. !
  22. REAL, PRIVATE,PARAMETER :: DMRmin=.05e-3, DMRmax=1.e-3, &
  23. & DelDMR=1.e-6,XMRmin=1.e6*DMRmin, XMRmax=1.e6*DMRmax
  24. INTEGER, PRIVATE,PARAMETER :: MDRmin=XMRmin, MDRmax=XMRmax
  25. REAL, PRIVATE,DIMENSION(MDRmin:MDRmax):: &
  26. & ACCRR,MASSR,RRATE,VRAIN,VENTR1,VENTR2
  27. !
  28. INTEGER, PRIVATE,PARAMETER :: Nrime=40
  29. REAL, DIMENSION(2:9,0:Nrime),PRIVATE,SAVE :: VEL_RF
  30. !
  31. INTEGER,PARAMETER :: NX=7501
  32. REAL, PARAMETER :: XMIN=180.0,XMAX=330.0
  33. REAL, DIMENSION(NX),SAVE :: TBPVS,TBPVS0
  34. REAL, SAVE :: C1XPVS0,C2XPVS0,C1XPVS,C2XPVS
  35. !
  36. REAL, PRIVATE,PARAMETER :: &
  37. !--- Physical constants follow:
  38. & CP=1004.6, EPSQ=1.E-12, GRAV=9.806, RHOL=1000., RD=287.04 &
  39. & ,RV=461.5, T0C=273.15, XLS=2.834E6 &
  40. !--- Derived physical constants follow:
  41. & ,EPS=RD/RV, EPS1=RV/RD-1., EPSQ1=1.001*EPSQ &
  42. & ,RCP=1./CP, RCPRV=RCP/RV, RGRAV=1./GRAV, RRHOL=1./RHOL &
  43. & ,XLS1=XLS*RCP, XLS2=XLS*XLS*RCPRV, XLS3=XLS*XLS/RV &
  44. !--- Constants specific to the parameterization follow:
  45. !--- CLIMIT/CLIMIT1 are lower limits for treating accumulated precipitation
  46. & ,CLIMIT=10.*EPSQ, CLIMIT1=-CLIMIT &
  47. & ,C1=1./3. &
  48. & ,DMR1=.1E-3, DMR2=.2E-3, DMR3=.32E-3, DMR4=0.45E-3 &
  49. & ,DMR5=0.67E-3 &
  50. & ,XMR1=1.e6*DMR1, XMR2=1.e6*DMR2, XMR3=1.e6*DMR3 &
  51. & ,XMR4=1.e6*DMR4, XMR5=1.e6*DMR5
  52. !
  53. INTEGER, PARAMETER :: MDR1=XMR1, MDR2=XMR2, MDR3=XMR3, MDR4=XMR4 &
  54. & , MDR5=XMR5
  55. !
  56. ! ======================================================================
  57. !--- Important tunable parameters that are exported to other modules
  58. ! * RHgrd - threshold relative humidity for onset of condensation
  59. ! * T_ICE - temperature (C) threshold at which all remaining liquid water
  60. ! is glaciated to ice
  61. ! * T_ICE_init - maximum temperature (C) at which ice nucleation occurs
  62. ! * NLImax - maximum number concentrations (m**-3) of large ice (snow/graupel/sleet)
  63. ! * NLImin - minimum number concentrations (m**-3) of large ice (snow/graupel/sleet)
  64. ! * N0r0 - assumed intercept (m**-4) of rain drops if drop diameters are between 0.2 and 1.0 mm
  65. ! * N0rmin - minimum intercept (m**-4) for rain drops
  66. ! * NCW - number concentrations of cloud droplets (m**-3)
  67. ! * FLARGE1, FLARGE2 - number fraction of large ice to total (large+snow) ice
  68. ! at T>0C and in presence of sublimation (FLARGE1), otherwise in
  69. ! presence of ice saturated/supersaturated conditions
  70. ! ======================================================================
  71. REAL, PUBLIC,PARAMETER :: &
  72. & RHgrd=1. &
  73. & ,T_ICE=-40. &
  74. & ,T_ICEK=T0C+T_ICE &
  75. & ,T_ICE_init=-5. &
  76. & ,NLImax=5.E3 &
  77. & ,NLImin=1.E3 &
  78. & ,N0r0=8.E6 &
  79. & ,N0rmin=1.E4 &
  80. & ,NCW=250.E6 &
  81. & ,FLARGE1=1. &
  82. & ,FLARGE2=.2
  83. !--- Other public variables passed to other routines:
  84. REAL,PUBLIC,SAVE :: QAUT0
  85. REAL, PUBLIC,DIMENSION(MDImin:MDImax) :: MASSI
  86. !
  87. !
  88. CONTAINS
  89. !-----------------------------------------------------------------------
  90. !-----------------------------------------------------------------------
  91. SUBROUTINE ETAMP_NEW (itimestep,DT,DX,DY, &
  92. & dz8w,rho_phy,p_phy,pi_phy,th_phy,qv,qt, &
  93. & LOWLYR,SR, &
  94. & F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, &
  95. & QC,QR,QS, &
  96. & mp_restart_state,tbpvs_state,tbpvs0_state, &
  97. & RAINNC,RAINNCV, &
  98. & ids,ide, jds,jde, kds,kde, &
  99. & ims,ime, jms,jme, kms,kme, &
  100. & its,ite, jts,jte, kts,kte )
  101. !-----------------------------------------------------------------------
  102. IMPLICIT NONE
  103. !-----------------------------------------------------------------------
  104. INTEGER, PARAMETER :: ITLO=-60, ITHI=40
  105. INTEGER,INTENT(IN) :: IDS,IDE,JDS,JDE,KDS,KDE &
  106. & ,IMS,IME,JMS,JME,KMS,KME &
  107. & ,ITS,ITE,JTS,JTE,KTS,KTE &
  108. & ,ITIMESTEP
  109. REAL, INTENT(IN) :: DT,DX,DY
  110. REAL, INTENT(IN), DIMENSION(ims:ime, kms:kme, jms:jme):: &
  111. & dz8w,p_phy,pi_phy,rho_phy
  112. REAL, INTENT(INOUT), DIMENSION(ims:ime, kms:kme, jms:jme):: &
  113. & th_phy,qv,qt
  114. REAL, INTENT(INOUT), DIMENSION(ims:ime, kms:kme, jms:jme ) :: &
  115. & qc,qr,qs
  116. REAL, INTENT(INOUT), DIMENSION(ims:ime, kms:kme, jms:jme ) :: &
  117. & F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY
  118. REAL, INTENT(INOUT), DIMENSION(ims:ime,jms:jme) :: &
  119. & RAINNC,RAINNCV
  120. REAL, INTENT(OUT), DIMENSION(ims:ime,jms:jme):: SR
  121. !
  122. REAL,DIMENSION(*),INTENT(INOUT) :: MP_RESTART_STATE
  123. !
  124. REAL,DIMENSION(nx),INTENT(INOUT) :: TBPVS_STATE,TBPVS0_STATE
  125. !
  126. INTEGER, DIMENSION( ims:ime, jms:jme ),INTENT(INOUT) :: LOWLYR
  127. !-----------------------------------------------------------------------
  128. ! LOCAL VARS
  129. !-----------------------------------------------------------------------
  130. ! NSTATS,QMAX,QTOT are diagnostic vars
  131. INTEGER,DIMENSION(ITLO:ITHI,4) :: NSTATS
  132. REAL, DIMENSION(ITLO:ITHI,5) :: QMAX
  133. REAL, DIMENSION(ITLO:ITHI,22):: QTOT
  134. ! SOME VARS WILL BE USED FOR DATA ASSIMILATION (DON'T NEED THEM NOW).
  135. ! THEY ARE TREATED AS LOCAL VARS, BUT WILL BECOME STATE VARS IN THE
  136. ! FUTURE. SO, WE DECLARED THEM AS MEMORY SIZES FOR THE FUTURE USE
  137. ! TLATGS_PHY,TRAIN_PHY,APREC,PREC,ACPREC,SR are not directly related
  138. ! the microphysics scheme. Instead, they will be used by Eta precip
  139. ! assimilation.
  140. REAL, DIMENSION( ims:ime, kms:kme, jms:jme ) :: &
  141. & TLATGS_PHY,TRAIN_PHY
  142. REAL, DIMENSION(ims:ime,jms:jme):: APREC,PREC,ACPREC
  143. REAL, DIMENSION(its:ite, kts:kte, jts:jte):: t_phy
  144. INTEGER :: I,J,K,KFLIP
  145. REAL :: WC
  146. !
  147. !-----------------------------------------------------------------------
  148. !**********************************************************************
  149. !-----------------------------------------------------------------------
  150. !
  151. MY_GROWTH(MY_T1:MY_T2)=MP_RESTART_STATE(MY_T1:MY_T2)
  152. !
  153. C1XPVS0=MP_RESTART_STATE(MY_T2+1)
  154. C2XPVS0=MP_RESTART_STATE(MY_T2+2)
  155. C1XPVS =MP_RESTART_STATE(MY_T2+3)
  156. C2XPVS =MP_RESTART_STATE(MY_T2+4)
  157. CIACW =MP_RESTART_STATE(MY_T2+5)
  158. CIACR =MP_RESTART_STATE(MY_T2+6)
  159. CRACW =MP_RESTART_STATE(MY_T2+7)
  160. CRAUT =MP_RESTART_STATE(MY_T2+8)
  161. !
  162. TBPVS(1:NX) =TBPVS_STATE(1:NX)
  163. TBPVS0(1:NX)=TBPVS0_STATE(1:NX)
  164. !
  165. DO j = jts,jte
  166. DO k = kts,kte
  167. DO i = its,ite
  168. t_phy(i,k,j) = th_phy(i,k,j)*pi_phy(i,k,j)
  169. qv(i,k,j)=qv(i,k,j)/(1.+qv(i,k,j)) !Convert to specific humidity
  170. ENDDO
  171. ENDDO
  172. ENDDO
  173. ! initial diagnostic variables and data assimilation vars
  174. ! (will need to delete this part in the future)
  175. DO k = 1,4
  176. DO i = ITLO,ITHI
  177. NSTATS(i,k)=0.
  178. ENDDO
  179. ENDDO
  180. DO k = 1,5
  181. DO i = ITLO,ITHI
  182. QMAX(i,k)=0.
  183. ENDDO
  184. ENDDO
  185. DO k = 1,22
  186. DO i = ITLO,ITHI
  187. QTOT(i,k)=0.
  188. ENDDO
  189. ENDDO
  190. ! initial data assimilation vars (will need to delete this part in the future)
  191. DO j = jts,jte
  192. DO k = kts,kte
  193. DO i = its,ite
  194. TLATGS_PHY (i,k,j)=0.
  195. TRAIN_PHY (i,k,j)=0.
  196. ENDDO
  197. ENDDO
  198. ENDDO
  199. DO j = jts,jte
  200. DO i = its,ite
  201. ACPREC(i,j)=0.
  202. APREC (i,j)=0.
  203. PREC (i,j)=0.
  204. SR (i,j)=0.
  205. ENDDO
  206. ENDDO
  207. !-- NOTE: ARW QT has been advected, while QR, QS and QC have not
  208. !
  209. !-- Update QT, F_ice, F_rain arrays for WRF NMM only
  210. #if (NMM_CORE==1)
  211. !
  212. !-- NOTE: The total ice array in this code is "QS" because the vast
  213. ! majority of the ice mass is in the form of snow, and using
  214. ! the "QS" array should result in better coupling with the
  215. ! Dudhia SW package. NMM calls microphysics after other
  216. ! physics, so use updated QR, QS and QC to update QT array.
  217. !
  218. DO j = jts,jte
  219. DO k = kts,kte
  220. DO i = its,ite
  221. QT(I,K,J)=QC(I,K,J)+QR(I,K,J)+QS(I,K,J)
  222. IF (QS(I,K,J) <= EPSQ) THEN
  223. F_ICE_PHY(I,K,J)=0.
  224. IF (T_PHY(I,K,J) < T_ICEK) F_ICE_PHY(I,K,J)=1.
  225. ELSE
  226. F_ICE_PHY(I,K,J)=MAX( 0., MIN(1., QS(I,K,J)/QT(I,K,J) ) )
  227. ENDIF
  228. IF (QR(I,K,J) <= EPSQ) THEN
  229. F_RAIN_PHY(I,K,J)=0.
  230. ELSE
  231. F_RAIN_PHY(I,K,J)=QR(I,K,J)/(QC(I,K,J)+QR(I,K,J))
  232. ENDIF
  233. ENDDO
  234. ENDDO
  235. ENDDO
  236. #endif
  237. !-----------------------------------------------------------------------
  238. CALL EGCP01DRV(DT,LOWLYR, &
  239. & APREC,PREC,ACPREC,SR,NSTATS,QMAX,QTOT, &
  240. & dz8w,rho_phy,qt,t_phy,qv,F_ICE_PHY,P_PHY, &
  241. & F_RAIN_PHY,F_RIMEF_PHY,TLATGS_PHY,TRAIN_PHY, &
  242. & ids,ide, jds,jde, kds,kde, &
  243. & ims,ime, jms,jme, kms,kme, &
  244. & its,ite, jts,jte, kts,kte )
  245. !-----------------------------------------------------------------------
  246. DO j = jts,jte
  247. DO k = kts,kte
  248. DO i = its,ite
  249. th_phy(i,k,j) = t_phy(i,k,j)/pi_phy(i,k,j)
  250. qv(i,k,j)=qv(i,k,j)/(1.-qv(i,k,j)) !Convert to mixing ratio
  251. WC=qt(I,K,J)
  252. QS(I,K,J)=0.
  253. QR(I,K,J)=0.
  254. QC(I,K,J)=0.
  255. IF(F_ICE_PHY(I,K,J)>=1.)THEN
  256. QS(I,K,J)=WC
  257. ELSEIF(F_ICE_PHY(I,K,J)<=0.)THEN
  258. QC(I,K,J)=WC
  259. ELSE
  260. QS(I,K,J)=F_ICE_PHY(I,K,J)*WC
  261. QC(I,K,J)=WC-QS(I,K,J)
  262. ENDIF
  263. !
  264. IF(QC(I,K,J)>0..AND.F_RAIN_PHY(I,K,J)>0.)THEN
  265. IF(F_RAIN_PHY(I,K,J).GE.1.)THEN
  266. QR(I,K,J)=QC(I,K,J)
  267. QC(I,K,J)=0.
  268. ELSE
  269. QR(I,K,J)=F_RAIN_PHY(I,K,J)*QC(I,K,J)
  270. QC(I,K,J)=QC(I,K,J)-QR(I,K,J)
  271. ENDIF
  272. ENDIF
  273. ENDDO
  274. ENDDO
  275. ENDDO
  276. !
  277. ! update rain (from m to mm)
  278. DO j=jts,jte
  279. DO i=its,ite
  280. RAINNC(i,j)=APREC(i,j)*1000.+RAINNC(i,j)
  281. RAINNCV(i,j)=APREC(i,j)*1000.
  282. ENDDO
  283. ENDDO
  284. !
  285. MP_RESTART_STATE(MY_T1:MY_T2)=MY_GROWTH(MY_T1:MY_T2)
  286. MP_RESTART_STATE(MY_T2+1)=C1XPVS0
  287. MP_RESTART_STATE(MY_T2+2)=C2XPVS0
  288. MP_RESTART_STATE(MY_T2+3)=C1XPVS
  289. MP_RESTART_STATE(MY_T2+4)=C2XPVS
  290. MP_RESTART_STATE(MY_T2+5)=CIACW
  291. MP_RESTART_STATE(MY_T2+6)=CIACR
  292. MP_RESTART_STATE(MY_T2+7)=CRACW
  293. MP_RESTART_STATE(MY_T2+8)=CRAUT
  294. !
  295. TBPVS_STATE(1:NX) =TBPVS(1:NX)
  296. TBPVS0_STATE(1:NX)=TBPVS0(1:NX)
  297. !-----------------------------------------------------------------------
  298. END SUBROUTINE ETAMP_NEW
  299. !-----------------------------------------------------------------------
  300. SUBROUTINE EGCP01DRV( &
  301. & DTPH,LOWLYR,APREC,PREC,ACPREC,SR, &
  302. & NSTATS,QMAX,QTOT, &
  303. & dz8w,RHO_PHY,CWM_PHY,T_PHY,Q_PHY,F_ICE_PHY,P_PHY, &
  304. & F_RAIN_PHY,F_RIMEF_PHY,TLATGS_PHY,TRAIN_PHY, &
  305. & ids,ide, jds,jde, kds,kde, &
  306. & ims,ime, jms,jme, kms,kme, &
  307. & its,ite, jts,jte, kts,kte)
  308. !-----------------------------------------------------------------------
  309. ! DTPH Physics time step (s)
  310. ! CWM_PHY (qt) Mixing ratio of the total condensate. kg/kg
  311. ! Q_PHY Mixing ratio of water vapor. kg/kg
  312. ! F_RAIN_PHY Fraction of rain.
  313. ! F_ICE_PHY Fraction of ice.
  314. ! F_RIMEF_PHY Mass ratio of rimed ice (rime factor).
  315. !
  316. !TLATGS_PHY,TRAIN_PHY,APREC,PREC,ACPREC,SR are not directly related the
  317. !micrphysics sechme. Instead, they will be used by Eta precip assimilation.
  318. !
  319. !NSTATS,QMAX,QTOT are used for diagnosis purposes.
  320. !
  321. !-----------------------------------------------------------------------
  322. !--- Variables APREC,PREC,ACPREC,SR are calculated for precip assimilation
  323. ! and/or ZHAO's scheme in Eta and are not required by this microphysics
  324. ! scheme itself.
  325. !--- NSTATS,QMAX,QTOT are used for diagnosis purposes only. They will be
  326. ! printed out when PRINT_diag is true.
  327. !
  328. !-----------------------------------------------------------------------
  329. IMPLICIT NONE
  330. !-----------------------------------------------------------------------
  331. !
  332. INTEGER, PARAMETER :: ITLO=-60, ITHI=40
  333. LOGICAL, PARAMETER :: PRINT_diag=.FALSE.
  334. ! VARIABLES PASSED IN/OUT
  335. INTEGER,INTENT(IN ) :: ids,ide, jds,jde, kds,kde &
  336. & ,ims,ime, jms,jme, kms,kme &
  337. & ,its,ite, jts,jte, kts,kte
  338. REAL,INTENT(IN) :: DTPH
  339. INTEGER, DIMENSION( ims:ime, jms:jme ),INTENT(INOUT) :: LOWLYR
  340. INTEGER,DIMENSION(ITLO:ITHI,4),INTENT(INOUT) :: NSTATS
  341. REAL,DIMENSION(ITLO:ITHI,5),INTENT(INOUT) :: QMAX
  342. REAL,DIMENSION(ITLO:ITHI,22),INTENT(INOUT) :: QTOT
  343. REAL,DIMENSION(ims:ime,jms:jme),INTENT(INOUT) :: &
  344. & APREC,PREC,ACPREC,SR
  345. REAL,DIMENSION( its:ite, kts:kte, jts:jte ),INTENT(INOUT) :: t_phy
  346. REAL,DIMENSION( ims:ime, kms:kme, jms:jme ),INTENT(IN) :: &
  347. & dz8w,P_PHY,RHO_PHY
  348. REAL,DIMENSION( ims:ime, kms:kme, jms:jme ),INTENT(INOUT) :: &
  349. & CWM_PHY, F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY,TLATGS_PHY &
  350. & ,Q_PHY,TRAIN_PHY
  351. !
  352. !-----------------------------------------------------------------------
  353. !LOCAL VARIABLES
  354. !-----------------------------------------------------------------------
  355. !
  356. #define CACHE_FRIENDLY_MP_ETANEW
  357. #ifdef CACHE_FRIENDLY_MP_ETANEW
  358. # define TEMP_DIMS kts:kte,its:ite,jts:jte
  359. # define TEMP_DEX L,I,J
  360. #else
  361. # define TEMP_DIMS its:ite,jts:jte,kts:kte
  362. # define TEMP_DEX I,J,L
  363. #endif
  364. !
  365. INTEGER :: LSFC,I,J,I_index,J_index,L,K,KFLIP
  366. REAL,DIMENSION(TEMP_DIMS) :: CWM,T,Q,TRAIN,TLATGS,P
  367. REAL,DIMENSION(kts:kte,its:ite,jts:jte) :: F_ice,F_rain,F_RimeF
  368. INTEGER,DIMENSION(its:ite,jts:jte) :: LMH
  369. REAL :: TC,WC,QI,QR,QW,Fice,Frain,DUM,ASNOW,ARAIN
  370. REAL,DIMENSION(kts:kte) :: P_col,Q_col,T_col,QV_col,WC_col, &
  371. RimeF_col,QI_col,QR_col,QW_col, THICK_col,DPCOL
  372. REAL,DIMENSION(2) :: PRECtot,PRECmax
  373. !-----------------------------------------------------------------------
  374. !
  375. DO J=JTS,JTE
  376. DO I=ITS,ITE
  377. LMH(I,J) = KTE-LOWLYR(I,J)+1
  378. ENDDO
  379. ENDDO
  380. DO 98 J=JTS,JTE
  381. DO 98 I=ITS,ITE
  382. DO L=KTS,KTE
  383. KFLIP=KTE+1-L
  384. CWM(TEMP_DEX)=CWM_PHY(I,KFLIP,J)
  385. T(TEMP_DEX)=T_PHY(I,KFLIP,J)
  386. Q(TEMP_DEX)=Q_PHY(I,KFLIP,J)
  387. P(TEMP_DEX)=P_PHY(I,KFLIP,J)
  388. TLATGS(TEMP_DEX)=TLATGS_PHY(I,KFLIP,J)
  389. TRAIN(TEMP_DEX)=TRAIN_PHY(I,KFLIP,J)
  390. F_ice(L,I,J)=F_ice_PHY(I,KFLIP,J)
  391. F_rain(L,I,J)=F_rain_PHY(I,KFLIP,J)
  392. F_RimeF(L,I,J)=F_RimeF_PHY(I,KFLIP,J)
  393. ENDDO
  394. 98 CONTINUE
  395. DO 100 J=JTS,JTE
  396. DO 100 I=ITS,ITE
  397. LSFC=LMH(I,J) ! "L" of surface
  398. !
  399. DO K=KTS,KTE
  400. KFLIP=KTE+1-K
  401. DPCOL(K)=RHO_PHY(I,KFLIP,J)*GRAV*dz8w(I,KFLIP,J)
  402. ENDDO
  403. !
  404. !
  405. !--- Initialize column data (1D arrays)
  406. !
  407. L=1
  408. IF (CWM(TEMP_DEX) .LE. EPSQ) CWM(TEMP_DEX)=EPSQ
  409. F_ice(1,I,J)=1.
  410. F_rain(1,I,J)=0.
  411. F_RimeF(1,I,J)=1.
  412. DO L=1,LSFC
  413. !
  414. !--- Pressure (Pa) = (Psfc-Ptop)*(ETA/ETA_sfc)+Ptop
  415. !
  416. P_col(L)=P(TEMP_DEX)
  417. !
  418. !--- Layer thickness = RHO*DZ = -DP/G = (Psfc-Ptop)*D_ETA/(G*ETA_sfc)
  419. !
  420. THICK_col(L)=DPCOL(L)*RGRAV
  421. T_col(L)=T(TEMP_DEX)
  422. TC=T_col(L)-T0C
  423. QV_col(L)=max(EPSQ, Q(TEMP_DEX))
  424. IF (CWM(TEMP_DEX) .LE. EPSQ1) THEN
  425. WC_col(L)=0.
  426. IF (TC .LT. T_ICE) THEN
  427. F_ice(L,I,J)=1.
  428. ELSE
  429. F_ice(L,I,J)=0.
  430. ENDIF
  431. F_rain(L,I,J)=0.
  432. F_RimeF(L,I,J)=1.
  433. ELSE
  434. WC_col(L)=CWM(TEMP_DEX)
  435. ENDIF
  436. !
  437. !--- Determine composition of condensate in terms of
  438. ! cloud water, ice, & rain
  439. !
  440. WC=WC_col(L)
  441. QI=0.
  442. QR=0.
  443. QW=0.
  444. Fice=F_ice(L,I,J)
  445. Frain=F_rain(L,I,J)
  446. IF (Fice .GE. 1.) THEN
  447. QI=WC
  448. ELSE IF (Fice .LE. 0.) THEN
  449. QW=WC
  450. ELSE
  451. QI=Fice*WC
  452. QW=WC-QI
  453. ENDIF
  454. IF (QW.GT.0. .AND. Frain.GT.0.) THEN
  455. IF (Frain .GE. 1.) THEN
  456. QR=QW
  457. QW=0.
  458. ELSE
  459. QR=Frain*QW
  460. QW=QW-QR
  461. ENDIF
  462. ENDIF
  463. IF (QI .LE. 0.) F_RimeF(L,I,J)=1.
  464. RimeF_col(L)=F_RimeF(L,I,J) ! (real)
  465. QI_col(L)=QI
  466. QR_col(L)=QR
  467. QW_col(L)=QW
  468. ENDDO
  469. !
  470. !#######################################################################
  471. !
  472. !--- Perform the microphysical calculations in this column
  473. !
  474. I_index=I
  475. J_index=J
  476. CALL EGCP01COLUMN ( ARAIN, ASNOW, DTPH, I_index, J_index, LSFC, &
  477. & P_col, QI_col, QR_col, QV_col, QW_col, RimeF_col, T_col, &
  478. & THICK_col, WC_col,KTS,KTE,NSTATS,QMAX,QTOT )
  479. !
  480. !#######################################################################
  481. !
  482. !
  483. !--- Update storage arrays
  484. !
  485. DO L=1,LSFC
  486. TRAIN(TEMP_DEX)=(T_col(L)-T(TEMP_DEX))/DTPH
  487. TLATGS(TEMP_DEX)=T_col(L)-T(TEMP_DEX)
  488. T(TEMP_DEX)=T_col(L)
  489. Q(TEMP_DEX)=QV_col(L)
  490. CWM(TEMP_DEX)=WC_col(L)
  491. !
  492. !--- REAL*4 array storage
  493. !
  494. IF (QI_col(L) .LE. EPSQ) THEN
  495. F_ice(L,I,J)=0.
  496. IF (T_col(L) .LT. T_ICEK) F_ice(L,I,J)=1.
  497. F_RimeF(L,I,J)=1.
  498. ELSE
  499. F_ice(L,I,J)=MAX( 0., MIN(1., QI_col(L)/WC_col(L)) )
  500. F_RimeF(L,I,J)=MAX(1., RimeF_col(L))
  501. ENDIF
  502. IF (QR_col(L) .LE. EPSQ) THEN
  503. DUM=0
  504. ELSE
  505. DUM=QR_col(L)/(QR_col(L)+QW_col(L))
  506. ENDIF
  507. F_rain(L,I,J)=DUM
  508. !
  509. ENDDO
  510. !
  511. !--- Update accumulated precipitation statistics
  512. !
  513. !--- Surface precipitation statistics; SR is fraction of surface
  514. ! precipitation (if >0) associated with snow
  515. !
  516. APREC(I,J)=(ARAIN+ASNOW)*RRHOL ! Accumulated surface precip (depth in m) !<--- Ying
  517. PREC(I,J)=PREC(I,J)+APREC(I,J)
  518. ACPREC(I,J)=ACPREC(I,J)+APREC(I,J)
  519. IF(APREC(I,J) .LT. 1.E-8) THEN
  520. SR(I,J)=0.
  521. ELSE
  522. SR(I,J)=RRHOL*ASNOW/APREC(I,J)
  523. ENDIF
  524. !
  525. !--- Debug statistics
  526. !
  527. IF (PRINT_diag) THEN
  528. PRECtot(1)=PRECtot(1)+ARAIN
  529. PRECtot(2)=PRECtot(2)+ASNOW
  530. PRECmax(1)=MAX(PRECmax(1), ARAIN)
  531. PRECmax(2)=MAX(PRECmax(2), ASNOW)
  532. ENDIF
  533. !#######################################################################
  534. !#######################################################################
  535. !
  536. 100 CONTINUE ! End "I" & "J" loops
  537. DO 101 J=JTS,JTE
  538. DO 101 I=ITS,ITE
  539. DO L=KTS,KTE
  540. KFLIP=KTE+1-L
  541. CWM_PHY(I,KFLIP,J)=CWM(TEMP_DEX)
  542. T_PHY(I,KFLIP,J)=T(TEMP_DEX)
  543. Q_PHY(I,KFLIP,J)=Q(TEMP_DEX)
  544. TLATGS_PHY(I,KFLIP,J)=TLATGS(TEMP_DEX)
  545. TRAIN_PHY(I,KFLIP,J)=TRAIN(TEMP_DEX)
  546. F_ice_PHY(I,KFLIP,J)=F_ice(L,I,J)
  547. F_rain_PHY(I,KFLIP,J)=F_rain(L,I,J)
  548. F_RimeF_PHY(I,KFLIP,J)=F_RimeF(L,I,J)
  549. ENDDO
  550. 101 CONTINUE
  551. END SUBROUTINE EGCP01DRV
  552. !
  553. !
  554. !###############################################################################
  555. ! ***** VERSION OF MICROPHYSICS DESIGNED FOR HIGHER RESOLUTION MESO ETA MODEL
  556. ! (1) Represents sedimentation by preserving a portion of the precipitation
  557. ! through top-down integration from cloud-top. Modified procedure to
  558. ! Zhao and Carr (1997).
  559. ! (2) Microphysical equations are modified to be less sensitive to time
  560. ! steps by use of Clausius-Clapeyron equation to account for changes in
  561. ! saturation mixing ratios in response to latent heating/cooling.
  562. ! (3) Prevent spurious temperature oscillations across 0C due to
  563. ! microphysics.
  564. ! (4) Uses lookup tables for: calculating two different ventilation
  565. ! coefficients in condensation and deposition processes; accretion of
  566. ! cloud water by precipitation; precipitation mass; precipitation rate
  567. ! (and mass-weighted precipitation fall speeds).
  568. ! (5) Assumes temperature-dependent variation in mean diameter of large ice
  569. ! (Houze et al., 1979; Ryan et al., 1996).
  570. ! -> 8/22/01: This relationship has been extended to colder temperatures
  571. ! to parameterize smaller large-ice particles down to mean sizes of MDImin,
  572. ! which is 50 microns reached at -55.9C.
  573. ! (6) Attempts to differentiate growth of large and small ice, mainly for
  574. ! improved transition from thin cirrus to thick, precipitating ice
  575. ! anvils.
  576. ! -> 8/22/01: This feature has been diminished by effectively adjusting to
  577. ! ice saturation during depositional growth at temperatures colder than
  578. ! -10C. Ice sublimation is calculated more explicitly. The logic is
  579. ! that sources of are either poorly understood (e.g., nucleation for NWP)
  580. ! or are not represented in the Eta model (e.g., detrainment of ice from
  581. ! convection). Otherwise the model is too wet compared to the radiosonde
  582. ! observations based on 1 Feb - 18 March 2001 retrospective runs.
  583. ! (7) Top-down integration also attempts to treat mixed-phase processes,
  584. ! allowing a mixture of ice and water. Based on numerous observational
  585. ! studies, ice growth is based on nucleation at cloud top &
  586. ! subsequent growth by vapor deposition and riming as the ice particles
  587. ! fall through the cloud. Effective nucleation rates are a function
  588. ! of ice supersaturation following Meyers et al. (JAM, 1992).
  589. ! -> 8/22/01: The simulated relative humidities were far too moist compared
  590. ! to the rawinsonde observations. This feature has been substantially
  591. ! diminished, limited to a much narrower temperature range of 0 to -10C.
  592. ! (8) Depositional growth of newly nucleated ice is calculated for large time
  593. ! steps using Fig. 8 of Miller and Young (JAS, 1979), at 1 deg intervals
  594. ! using their ice crystal masses calculated after 600 s of growth in water
  595. ! saturated conditions. The growth rates are normalized by time step
  596. ! assuming 3D growth with time**1.5 following eq. (6.3) in Young (1993).
  597. ! -> 8/22/01: This feature has been effectively limited to 0 to -10C.
  598. ! (9) Ice precipitation rates can increase due to increase in response to
  599. ! cloud water riming due to (a) increased density & mass of the rimed
  600. ! ice, and (b) increased fall speeds of rimed ice.
  601. ! -> 8/22/01: This feature has been effectively limited to 0 to -10C.
  602. !###############################################################################
  603. !###############################################################################
  604. !
  605. SUBROUTINE EGCP01COLUMN ( ARAIN, ASNOW, DTPH, I_index, J_index, &
  606. & LSFC, P_col, QI_col, QR_col, QV_col, QW_col, RimeF_col, T_col, &
  607. & THICK_col, WC_col ,KTS,KTE,NSTATS,QMAX,QTOT)
  608. !
  609. !###############################################################################
  610. !###############################################################################
  611. !
  612. !-------------------------------------------------------------------------------
  613. !----- NOTE: Code is currently set up w/o threading!
  614. !-------------------------------------------------------------------------------
  615. !$$$ SUBPROGRAM DOCUMENTATION BLOCK
  616. ! . . .
  617. ! SUBPROGRAM: Grid-scale microphysical processes - condensation & precipitation
  618. ! PRGRMMR: Ferrier ORG: W/NP22 DATE: 08-2001
  619. ! PRGRMMR: Jin (Modification for WRF structure)
  620. !-------------------------------------------------------------------------------
  621. ! ABSTRACT:
  622. ! * Merges original GSCOND & PRECPD subroutines.
  623. ! * Code has been substantially streamlined and restructured.
  624. ! * Exchange between water vapor & small cloud condensate is calculated using
  625. ! the original Asai (1965, J. Japan) algorithm. See also references to
  626. ! Yau and Austin (1979, JAS), Rutledge and Hobbs (1983, JAS), and Tao et al.
  627. ! (1989, MWR). This algorithm replaces the Sundqvist et al. (1989, MWR)
  628. ! parameterization.
  629. !-------------------------------------------------------------------------------
  630. !
  631. ! USAGE:
  632. ! * CALL EGCP01COLUMN FROM SUBROUTINE EGCP01DRV
  633. !
  634. ! INPUT ARGUMENT LIST:
  635. ! DTPH - physics time step (s)
  636. ! I_index - I index
  637. ! J_index - J index
  638. ! LSFC - Eta level of level above surface, ground
  639. ! P_col - vertical column of model pressure (Pa)
  640. ! QI_col - vertical column of model ice mixing ratio (kg/kg)
  641. ! QR_col - vertical column of model rain ratio (kg/kg)
  642. ! QV_col - vertical column of model water vapor specific humidity (kg/kg)
  643. ! QW_col - vertical column of model cloud water mixing ratio (kg/kg)
  644. ! RimeF_col - vertical column of rime factor for ice in model (ratio, defined below)
  645. ! T_col - vertical column of model temperature (deg K)
  646. ! THICK_col - vertical column of model mass thickness (density*height increment)
  647. ! WC_col - vertical column of model mixing ratio of total condensate (kg/kg)
  648. !
  649. !
  650. ! OUTPUT ARGUMENT LIST:
  651. ! ARAIN - accumulated rainfall at the surface (kg)
  652. ! ASNOW - accumulated snowfall at the surface (kg)
  653. ! QV_col - vertical column of model water vapor specific humidity (kg/kg)
  654. ! WC_col - vertical column of model mixing ratio of total condensate (kg/kg)
  655. ! QW_col - vertical column of model cloud water mixing ratio (kg/kg)
  656. ! QI_col - vertical column of model ice mixing ratio (kg/kg)
  657. ! QR_col - vertical column of model rain ratio (kg/kg)
  658. ! RimeF_col - vertical column of rime factor for ice in model (ratio, defined below)
  659. ! T_col - vertical column of model temperature (deg K)
  660. !
  661. ! OUTPUT FILES:
  662. ! NONE
  663. !
  664. ! Subprograms & Functions called:
  665. ! * Real Function CONDENSE - cloud water condensation
  666. ! * Real Function DEPOSIT - ice deposition (not sublimation)
  667. !
  668. ! UNIQUE: NONE
  669. !
  670. ! LIBRARY: NONE
  671. !
  672. ! COMMON BLOCKS:
  673. ! CMICRO_CONS - key constants initialized in GSMCONST
  674. ! CMICRO_STATS - accumulated and maximum statistics
  675. ! CMY_GROWTH - lookup table for growth of ice crystals in
  676. ! water saturated conditions (Miller & Young, 1979)
  677. ! IVENT_TABLES - lookup tables for ventilation effects of ice
  678. ! IACCR_TABLES - lookup tables for accretion rates of ice
  679. ! IMASS_TABLES - lookup tables for mass content of ice
  680. ! IRATE_TABLES - lookup tables for precipitation rates of ice
  681. ! IRIME_TABLES - lookup tables for increase in fall speed of rimed ice
  682. ! RVENT_TABLES - lookup tables for ventilation effects of rain
  683. ! RACCR_TABLES - lookup tables for accretion rates of rain
  684. ! RMASS_TABLES - lookup tables for mass content of rain
  685. ! RVELR_TABLES - lookup tables for fall speeds of rain
  686. ! RRATE_TABLES - lookup tables for precipitation rates of rain
  687. !
  688. ! ATTRIBUTES:
  689. ! LANGUAGE: FORTRAN 90
  690. ! MACHINE : IBM SP
  691. !
  692. !
  693. !-------------------------------------------------------------------------
  694. !--------------- Arrays & constants in argument list ---------------------
  695. !-------------------------------------------------------------------------
  696. !
  697. IMPLICIT NONE
  698. !
  699. INTEGER,INTENT(IN) :: KTS,KTE,I_index, J_index, LSFC
  700. REAL,INTENT(INOUT) :: ARAIN, ASNOW
  701. REAL,DIMENSION(KTS:KTE),INTENT(INOUT) :: P_col, QI_col,QR_col &
  702. & ,QV_col ,QW_col, RimeF_col, T_col, THICK_col,WC_col
  703. !
  704. !-------------------------------------------------------------------------
  705. !-------------- Common blocks for microphysical statistics ---------------
  706. !-------------------------------------------------------------------------
  707. !
  708. !-------------------------------------------------------------------------
  709. !--------- Common blocks for constants initialized in GSMCONST ----------
  710. !
  711. INTEGER, PARAMETER :: ITLO=-60, ITHI=40
  712. INTEGER,INTENT(INOUT) :: NSTATS(ITLO:ITHI,4)
  713. REAL,INTENT(INOUT) :: QMAX(ITLO:ITHI,5),QTOT(ITLO:ITHI,22)
  714. !
  715. !-------------------------------------------------------------------------
  716. !--------------- Common blocks for various lookup tables -----------------
  717. !
  718. !--- Discretized growth rates of small ice crystals after their nucleation
  719. ! at 1 C intervals from -1 C to -35 C, based on calculations by Miller
  720. ! and Young (1979, JAS) after 600 s of growth. Resultant growth rates
  721. ! are multiplied by physics time step in GSMCONST.
  722. !
  723. !-------------------------------------------------------------------------
  724. !
  725. !--- Mean ice-particle diameters varying from 50 microns to 1000 microns
  726. ! (1 mm), assuming an exponential size distribution.
  727. !
  728. !---- Meaning of the following arrays:
  729. ! - mdiam - mean diameter (m)
  730. ! - VENTI1 - integrated quantity associated w/ ventilation effects
  731. ! (capacitance only) for calculating vapor deposition onto ice
  732. ! - VENTI2 - integrated quantity associated w/ ventilation effects
  733. ! (with fall speed) for calculating vapor deposition onto ice
  734. ! - ACCRI - integrated quantity associated w/ cloud water collection by ice
  735. ! - MASSI - integrated quantity associated w/ ice mass
  736. ! - VSNOWI - mass-weighted fall speed of snow (large ice), used to calculate
  737. ! precipitation rates
  738. !
  739. !
  740. !-------------------------------------------------------------------------
  741. !
  742. !--- VEL_RF - velocity increase of rimed particles as functions of crude
  743. ! particle size categories (at 0.1 mm intervals of mean ice particle
  744. ! sizes) and rime factor (different values of Rime Factor of 1.1**N,
  745. ! where N=0 to Nrime).
  746. !
  747. !-------------------------------------------------------------------------
  748. !
  749. !--- Mean rain drop diameters varying from 50 microns (0.05 mm) to 1000 microns
  750. ! (1 mm), assuming an exponential size distribution.
  751. !
  752. !-------------------------------------------------------------------------
  753. !------- Key parameters, local variables, & important comments ---------
  754. !-----------------------------------------------------------------------
  755. !
  756. !--- TOLER => Tolerance or precision for accumulated precipitation
  757. !
  758. REAL, PARAMETER :: TOLER=5.E-7, C2=1./6., RHO0=1.194, Xratio=.025
  759. !
  760. !--- If BLEND=1:
  761. ! precipitation (large) ice amounts are estimated at each level as a
  762. ! blend of ice falling from the grid point above and the precip ice
  763. ! present at the start of the time step (see TOT_ICE below).
  764. !--- If BLEND=0:
  765. ! precipitation (large) ice amounts are estimated to be the precip
  766. ! ice present at the start of the time step.
  767. !
  768. !--- Extended to include sedimentation of rain on 2/5/01
  769. !
  770. REAL, PARAMETER :: BLEND=1.
  771. !
  772. !--- This variable is for debugging purposes (if .true.)
  773. !
  774. LOGICAL, PARAMETER :: PRINT_diag=.FALSE.
  775. !
  776. !-----------------------------------------------------------------------
  777. !--- Local variables
  778. !-----------------------------------------------------------------------
  779. !
  780. REAL EMAIRI, N0r, NLICE, NSmICE
  781. LOGICAL CLEAR, ICE_logical, DBG_logical, RAIN_logical
  782. INTEGER :: IDR,INDEX_MY,INDEXR,INDEXR1,INDEXS,IPASS,ITDX,IXRF, &
  783. & IXS,LBEF,L
  784. !
  785. REAL :: ABI,ABW,AIEVP,ARAINnew,ASNOWnew,BLDTRH,BUDGET, &
  786. & CREVP,DELI,DELR,DELT,DELV,DELW,DENOMF, &
  787. & DENOMI,DENOMW,DENOMWI,DIDEP, &
  788. & DIEVP,DIFFUS,DLI,DTPH,DTRHO,DUM,DUM1, &
  789. & DUM2,DWV0,DWVI,DWVR,DYNVIS,ESI,ESW,FIR,FLARGE,FLIMASS, &
  790. & FSMALL,FWR,FWS,GAMMAR,GAMMAS, &
  791. & PCOND,PIACR,PIACW,PIACWI,PIACWR,PICND,PIDEP,PIDEP_max, &
  792. & PIEVP,PILOSS,PIMLT,PP,PRACW,PRAUT,PREVP,PRLOSS, &
  793. & QI,QInew,QLICE,QR,QRnew,QSI,QSIgrd,QSInew,QSW,QSW0, &
  794. & QSWgrd,QSWnew,QT,QTICE,QTnew,QTRAIN,QV,QW,QW0,QWnew, &
  795. & RFACTOR,RHO,RIMEF,RIMEF1,RQR,RR,RRHO,SFACTOR, &
  796. & TC,TCC,TFACTOR,THERM_COND,THICK,TK,TK2,TNEW, &
  797. & TOT_ICE,TOT_ICEnew,TOT_RAIN,TOT_RAINnew, &
  798. & VEL_INC,VENTR,VENTIL,VENTIS,VRAIN1,VRAIN2,VRIMEF,VSNOW, &
  799. & WC,WCnew,WSgrd,WS,WSnew,WV,WVnew,WVQW, &
  800. & XLF,XLF1,XLI,XLV,XLV1,XLV2,XLIMASS,XRF,XSIMASS
  801. !
  802. !#######################################################################
  803. !########################## Begin Execution ############################
  804. !#######################################################################
  805. !
  806. !
  807. ARAIN=0. ! Accumulated rainfall into grid box from above (kg/m**2)
  808. ASNOW=0. ! Accumulated snowfall into grid box from above (kg/m**2)
  809. !
  810. !-----------------------------------------------------------------------
  811. !------------ Loop from top (L=1) to surface (L=LSFC) ------------------
  812. !-----------------------------------------------------------------------
  813. !
  814. DO 10 L=1,LSFC
  815. !--- Skip this level and go to the next lower level if no condensate
  816. ! and very low specific humidities
  817. !
  818. IF (QV_col(L).LE.EPSQ .AND. WC_col(L).LE.EPSQ) GO TO 10
  819. !
  820. !-----------------------------------------------------------------------
  821. !------------ Proceed with cloud microphysics calculations -------------
  822. !-----------------------------------------------------------------------
  823. !
  824. TK=T_col(L) ! Temperature (deg K)
  825. TC=TK-T0C ! Temperature (deg C)
  826. PP=P_col(L) ! Pressure (Pa)
  827. QV=QV_col(L) ! Specific humidity of water vapor (kg/kg)
  828. WV=QV/(1.-QV) ! Water vapor mixing ratio (kg/kg)
  829. WC=WC_col(L) ! Grid-scale mixing ratio of total condensate (water or ice; kg/kg)
  830. !
  831. !-----------------------------------------------------------------------
  832. !--- Moisture variables below are mixing ratios & not specifc humidities
  833. !-----------------------------------------------------------------------
  834. !
  835. CLEAR=.TRUE.
  836. !
  837. !--- This check is to determine grid-scale saturation when no condensate is present
  838. !
  839. ESW=MIN(1000.*FPVS0(TK),0.99*PP) ! Saturation vapor pressure w/r/t water
  840. QSW=EPS*ESW/(PP-ESW) ! Saturation mixing ratio w/r/t water
  841. WS=QSW ! General saturation mixing ratio (water/ice)
  842. IF (TC .LT. 0.) THEN
  843. ESI=MIN(1000.*FPVS(TK),0.99*PP) ! Saturation vapor pressure w/r/t ice
  844. QSI=EPS*ESI/(PP-ESI) ! Saturation mixing ratio w/r/t water
  845. WS=QSI ! General saturation mixing ratio (water/ice)
  846. ENDIF
  847. !
  848. !--- Effective grid-scale Saturation mixing ratios
  849. !
  850. QSWgrd=RHgrd*QSW
  851. QSIgrd=RHgrd*QSI
  852. WSgrd=RHgrd*WS
  853. !
  854. !--- Check if air is subsaturated and w/o condensate
  855. !
  856. IF (WV.GT.WSgrd .OR. WC.GT.EPSQ) CLEAR=.FALSE.
  857. !
  858. !--- Check if any rain is falling into layer from above
  859. !
  860. IF (ARAIN .GT. CLIMIT) THEN
  861. CLEAR=.FALSE.
  862. ELSE
  863. ARAIN=0.
  864. ENDIF
  865. !
  866. !--- Check if any ice is falling into layer from above
  867. !
  868. !--- NOTE that "SNOW" in variable names is synonomous with
  869. ! large, precipitation ice particles
  870. !
  871. IF (ASNOW .GT. CLIMIT) THEN
  872. CLEAR=.FALSE.
  873. ELSE
  874. ASNOW=0.
  875. ENDIF
  876. !
  877. !-----------------------------------------------------------------------
  878. !-- Loop to the end if in clear, subsaturated air free of condensate ---
  879. !-----------------------------------------------------------------------
  880. !
  881. IF (CLEAR) GO TO 10
  882. !
  883. !-----------------------------------------------------------------------
  884. !--------- Initialize RHO, THICK & microphysical processes -------------
  885. !-----------------------------------------------------------------------
  886. !
  887. !
  888. !--- Virtual temperature, TV=T*(1./EPS-1)*Q, Q is specific humidity;
  889. ! (see pp. 63-65 in Fleagle & Businger, 1963)
  890. !
  891. RHO=PP/(RD*TK*(1.+EPS1*QV)) ! Air density (kg/m**3)
  892. RRHO=1./RHO ! Reciprocal of air density
  893. DTRHO=DTPH*RHO ! Time step * air density
  894. BLDTRH=BLEND*DTRHO ! Blend parameter * time step * air density
  895. THICK=THICK_col(L) ! Layer thickness = RHO*DZ = -DP/G = (Psfc-Ptop)*D_ETA/(G*ETA_sfc)
  896. !
  897. ARAINnew=0. ! Updated accumulated rainfall
  898. ASNOWnew=0. ! Updated accumulated snowfall
  899. QI=QI_col(L) ! Ice mixing ratio
  900. QInew=0. ! Updated ice mixing ratio
  901. QR=QR_col(L) ! Rain mixing ratio
  902. QRnew=0. ! Updated rain ratio
  903. QW=QW_col(L) ! Cloud water mixing ratio
  904. QWnew=0. ! Updated cloud water ratio
  905. !
  906. PCOND=0. ! Condensation (>0) or evaporation (<0) of cloud water (kg/kg)
  907. PIDEP=0. ! Deposition (>0) or sublimation (<0) of ice crystals (kg/kg)
  908. PIACW=0. ! Cloud water collection (riming) by precipitation ice (kg/kg; >0)
  909. PIACWI=0. ! Growth of precip ice by riming (kg/kg; >0)
  910. PIACWR=0. ! Shedding of accreted cloud water to form rain (kg/kg; >0)
  911. PIACR=0. ! Freezing of rain onto large ice at supercooled temps (kg/kg; >0)
  912. PICND=0. ! Condensation (>0) onto wet, melting ice (kg/kg)
  913. PIEVP=0. ! Evaporation (<0) from wet, melting ice (kg/kg)
  914. PIMLT=0. ! Melting ice (kg/kg; >0)
  915. PRAUT=0. ! Cloud water autoconversion to rain (kg/kg; >0)
  916. PRACW=0. ! Cloud water collection (accretion) by rain (kg/kg; >0)
  917. PREVP=0. ! Rain evaporation (kg/kg; <0)
  918. !
  919. !--- Double check input hydrometeor mixing ratios
  920. !
  921. ! DUM=WC-(QI+QW+QR)
  922. ! DUM1=ABS(DUM)
  923. ! DUM2=TOLER*MIN(WC, QI+QW+QR)
  924. ! IF (DUM1 .GT. DUM2) THEN
  925. ! WRITE(6,"(/2(a,i4),a,i2)") '{@ i=',I_index,' j=',J_index,
  926. ! & ' L=',L
  927. ! WRITE(6,"(4(a12,g11.4,1x))")
  928. ! & '{@ TCold=',TC,'P=',.01*PP,'DIFF=',DUM,'WCold=',WC,
  929. ! & '{@ QIold=',QI,'QWold=',QW,'QRold=',QR
  930. ! ENDIF
  931. !
  932. !***********************************************************************
  933. !*********** MAIN MICROPHYSICS CALCULATIONS NOW FOLLOW! ****************
  934. !***********************************************************************
  935. !
  936. !--- Calculate a few variables, which are used more than once below
  937. !
  938. !--- Latent heat of vaporization as a function of temperature from
  939. ! Bolton (1980, JAS)
  940. !
  941. XLV=3.148E6-2370*TK ! Latent heat of vaporization (Lv)
  942. XLF=XLS-XLV ! Latent heat of fusion (Lf)
  943. XLV1=XLV*RCP ! Lv/Cp
  944. XLF1=XLF*RCP ! Lf/Cp
  945. TK2=1./(TK*TK) ! 1./TK**2
  946. XLV2=XLV*XLV*QSW*TK2/RV ! Lv**2*Qsw/(Rv*TK**2)
  947. DENOMW=1.+XLV2*RCP ! Denominator term, Clausius-Clapeyron correction
  948. !
  949. !--- Basic thermodynamic quantities
  950. ! * DYNVIS - dynamic viscosity [ kg/(m*s) ]
  951. ! * THERM_COND - thermal conductivity [ J/(m*s*K) ]
  952. ! * DIFFUS - diffusivity of water vapor [ m**2/s ]
  953. !
  954. TFACTOR=TK**1.5/(TK+120.)
  955. DYNVIS=1.496E-6*TFACTOR
  956. THERM_COND=2.116E-3*TFACTOR
  957. DIFFUS=8.794E-5*TK**1.81/PP
  958. !
  959. !--- Air resistance term for the fall speed of ice following the
  960. ! basic research by Heymsfield, Kajikawa, others
  961. !
  962. GAMMAS=(1.E5/PP)**C1
  963. !
  964. !--- Air resistance for rain fall speed (Beard, 1985, JAS, p.470)
  965. !
  966. GAMMAR=(RHO0/RHO)**.4
  967. !
  968. !----------------------------------------------------------------------
  969. !------------- IMPORTANT MICROPHYSICS DECISION TREE -----------------
  970. !----------------------------------------------------------------------
  971. !
  972. !--- Determine if conditions supporting ice are present
  973. !
  974. IF (TC.LT.0. .OR. QI.GT. EPSQ .OR. ASNOW.GT.CLIMIT) THEN
  975. ICE_logical=.TRUE.
  976. ELSE
  977. ICE_logical=.FALSE.
  978. QLICE=0.
  979. QTICE=0.
  980. ENDIF
  981. !
  982. !--- Determine if rain is present
  983. !
  984. RAIN_logical=.FALSE.
  985. IF (ARAIN.GT.CLIMIT .OR. QR.GT.EPSQ) RAIN_logical=.TRUE.
  986. !
  987. IF (ICE_logical) THEN
  988. !
  989. !--- IMPORTANT: Estimate time-averaged properties.
  990. !
  991. !---
  992. ! * FLARGE - ratio of number of large ice to total (large & small) ice
  993. ! * FSMALL - ratio of number of small ice crystals to large ice particles
  994. ! -> Small ice particles are assumed to have a mean diameter of 50 microns.
  995. ! * XSIMASS - used for calculating small ice mixing ratio
  996. !---
  997. ! * TOT_ICE - total mass (small & large) ice before microphysics,
  998. ! which is the sum of the total mass of large ice in the
  999. ! current layer and the input flux of ice from above
  1000. ! * PILOSS - greatest loss (<0) of total (small & large) ice by
  1001. ! sublimation, removing all of the ice falling from above
  1002. ! and the ice within the layer
  1003. ! * RimeF1 - Rime Factor, which is the mass ratio of total (unrimed & rimed)
  1004. ! ice mass to the unrimed ice mass (>=1)
  1005. ! * VrimeF - the velocity increase due to rime factor or melting (ratio, >=1)
  1006. ! * VSNOW - Fall speed of rimed snow w/ air resistance correction
  1007. ! * EMAIRI - equivalent mass of air associated layer and with fall of snow into layer
  1008. ! * XLIMASS - used for calculating large ice mixing ratio
  1009. ! * FLIMASS - mass fraction of large ice
  1010. ! * QTICE - time-averaged mixing ratio of total ice
  1011. ! * QLICE - time-averaged mixing ratio of large ice
  1012. ! * NLICE - time-averaged number concentration of large ice
  1013. ! * NSmICE - number concentration of small ice crystals at current level
  1014. !---
  1015. !--- Assumed number fraction of large ice particles to total (large & small)
  1016. ! ice particles, which is based on a general impression of the literature.
  1017. !
  1018. WVQW=WV+QW ! Water vapor & cloud water
  1019. !
  1020. IF (TC.GE.0. .OR. WVQW.LT.QSIgrd) THEN
  1021. !
  1022. !--- Eliminate small ice particle contributions for melting & sublimation
  1023. !
  1024. FLARGE=FLARGE1
  1025. ELSE
  1026. !
  1027. !--- Enhanced number of small ice particles during depositional growth
  1028. ! (effective only when 0C > T >= T_ice [-10C] )
  1029. !
  1030. FLARGE=FLARGE2
  1031. !
  1032. !--- Larger number of small ice particles due to rime splintering
  1033. !
  1034. IF (TC.GE.-8. .AND. TC.LE.-3.) FLARGE=.5*FLARGE
  1035. !
  1036. ENDIF ! End IF (TC.GE.0. .OR. WVQW.LT.QSIgrd)
  1037. FSMALL=(1.-FLARGE)/FLARGE
  1038. XSIMASS=RRHO*MASSI(MDImin)*FSMALL
  1039. IF (QI.LE.EPSQ .AND. ASNOW.LE.CLIMIT) THEN
  1040. INDEXS=MDImin
  1041. TOT_ICE=0.
  1042. PILOSS=0.
  1043. RimeF1=1.
  1044. VrimeF=1.
  1045. VEL_INC=GAMMAS
  1046. VSNOW=0.
  1047. EMAIRI=THICK
  1048. XLIMASS=RRHO*RimeF1*MASSI(INDEXS)
  1049. FLIMASS=XLIMASS/(XLIMASS+XSIMASS)
  1050. QLICE=0.
  1051. QTICE=0.
  1052. NLICE=0.
  1053. NSmICE=0.
  1054. ELSE
  1055. !
  1056. !--- For T<0C mean particle size follows Houze et al. (JAS, 1979, p. 160),
  1057. ! converted from Fig. 5 plot of LAMDAs. Similar set of relationships
  1058. ! also shown in Fig. 8 of Ryan (BAMS, 1996, p. 66).
  1059. !
  1060. DUM=XMImax*EXP(.0536*TC)
  1061. INDEXS=MIN(MDImax, MAX(MDImin, INT(DUM) ) )
  1062. TOT_ICE=THICK*QI+BLEND*ASNOW
  1063. PILOSS=-TOT_ICE/THICK
  1064. LBEF=MAX(1,L-1)
  1065. DUM1=RimeF_col(LBEF)
  1066. DUM2=RimeF_col(L)
  1067. RimeF1=(DUM2*THICK*QI+DUM1*BLEND*ASNOW)/TOT_ICE
  1068. RimeF1=MIN(RimeF1, RFmax)
  1069. DO IPASS=0,1
  1070. IF (RimeF1 .LE. 1.) THEN
  1071. RimeF1=1.
  1072. VrimeF=1.
  1073. ELSE
  1074. IXS=MAX(2, MIN(INDEXS/100, 9))
  1075. XRF=10.492*ALOG(RimeF1)
  1076. IXRF=MAX(0, MIN(INT(XRF), Nrime))
  1077. IF (IXRF .GE. Nrime) THEN
  1078. VrimeF=VEL_RF(IXS,Nrime)
  1079. ELSE
  1080. VrimeF=VEL_RF(IXS,IXRF)+(XRF-FLOAT(IXRF))* &
  1081. & (VEL_RF(IXS,IXRF+1)-VEL_RF(IXS,IXRF))
  1082. ENDIF
  1083. ENDIF ! End IF (RimeF1 .LE. 1.)
  1084. VEL_INC=GAMMAS*VrimeF
  1085. VSNOW=VEL_INC*VSNOWI(INDEXS)
  1086. EMAIRI=THICK+BLDTRH*VSNOW
  1087. XLIMASS=RRHO*RimeF1*MASSI(INDEXS)
  1088. FLIMASS=XLIMASS/(XLIMASS+XSIMASS)
  1089. QTICE=TOT_ICE/EMAIRI
  1090. QLICE=FLIMASS*QTICE
  1091. NLICE=QLICE/XLIMASS
  1092. NSmICE=Fsmall*NLICE
  1093. !
  1094. IF ( (NLICE.GE.NLImin .AND. NLICE.LE.NLImax) &
  1095. & .OR. IPASS.EQ.1) THEN
  1096. EXIT
  1097. ELSE
  1098. IF (TC < 0) THEN
  1099. XLI=RHO*(QTICE/DUM-XSIMASS)/RimeF1
  1100. IF (XLI .LE. MASSI(MDImin) ) THEN
  1101. INDEXS=MDImin
  1102. ELSE IF (XLI .LE. MASSI(450) ) THEN
  1103. DLI=9.5885E5*XLI**.42066 ! DLI in microns
  1104. INDEXS=MIN(MDImax, MAX(MDImin, INT(DLI) ) )
  1105. ELSE IF (XLI .LE. MASSI(MDImax) ) THEN
  1106. DLI=3.9751E6*XLI**.49870 ! DLI in microns
  1107. INDEXS=MIN(MDImax, MAX(MDImin, INT(DLI) ) )
  1108. ELSE
  1109. INDEXS=MDImax
  1110. ENDIF ! End IF (XLI .LE. MASSI(MDImin) )
  1111. ENDIF ! End IF (TC < 0)
  1112. !
  1113. !--- Reduce excessive accumulation of ice at upper levels
  1114. ! associated with strong grid-resolved ascent
  1115. !
  1116. !--- Force NLICE to be between NLImin and NLImax
  1117. !
  1118. !
  1119. !--- 8/22/01: Increase density of large ice if maximum limits
  1120. ! are reached for number concentration (NLImax) and mean size
  1121. ! (MDImax). Done to increase fall out of ice.
  1122. !
  1123. DUM=MAX(NLImin, MIN(NLImax, NLICE) )
  1124. IF (DUM.GE.NLImax .AND. INDEXS.GE.MDImax) &
  1125. & RimeF1=RHO*(QTICE/NLImax-XSIMASS)/MASSI(INDEXS)
  1126. ! WRITE(6,"(4(a12,g11.4,1x))")
  1127. ! & '{$ TC=',TC,'P=',.01*PP,'NLICE=',NLICE,'DUM=',DUM,
  1128. ! & '{…

Large files files are truncated, but you can click here to view the full file