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

/wrfv2_fire/phys/module_mp_etaold.F

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

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