PageRenderTime 86ms CodeModel.GetById 29ms RepoModel.GetById 0ms app.codeStats 1ms

/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
  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. ! & '{$ XLI=',XLI,'INDEXS=',FLOAT(INDEXS),'RHO=',RHO,'QTICE=',QTICE,
  1129. ! & '{$ XSIMASS=',XSIMASS,'RimeF1=',RimeF1
  1130. ENDIF ! End IF ( (NLICE.GE.NLImin .AND. NLICE.LE.NLImax) ...
  1131. ENDDO ! End DO IPASS=0,1
  1132. ENDIF ! End IF (QI.LE.EPSQ .AND. ASNOW.LE.CLIMIT)
  1133. ENDIF ! End IF (ICE_logical)
  1134. !
  1135. !----------------------------------------------------------------------
  1136. !--------------- Calculate individual processes -----------------------
  1137. !----------------------------------------------------------------------
  1138. !
  1139. !--- Cloud water autoconversion to rain and collection by rain
  1140. !
  1141. IF (QW.GT.EPSQ .AND. TC.GE.T_ICE) THEN
  1142. !
  1143. !--- QW0 could be modified based on land/sea properties,
  1144. ! presence of convection, etc. This is why QAUT0 and CRAUT
  1145. ! are passed into the subroutine as externally determined
  1146. ! parameters. Can be changed in the future if desired.
  1147. !
  1148. QW0=QAUT0*RRHO
  1149. PRAUT=MAX(0., MIN(QW-QW0, QW0) )*CRAUT
  1150. IF (QLICE .GT. EPSQ) THEN
  1151. !
  1152. !--- Collection of cloud water by large ice particles ("snow")
  1153. ! PIACWI=PIACW for riming, PIACWI=0 for shedding
  1154. !
  1155. FWS=MIN(.1, CIACW*VEL_INC*NLICE*ACCRI(INDEXS)/PP**C1)
  1156. PIACW=FWS*QW
  1157. IF (TC .LT. 0.) PIACWI=PIACW ! Large ice riming
  1158. ENDIF ! End IF (QLICE .GT. EPSQ)
  1159. ENDIF ! End IF (QW.GT.EPSQ .AND. TC.GE.T_ICE)
  1160. !
  1161. !----------------------------------------------------------------------
  1162. !--- Loop around some of the ice-phase processes if no ice should be present
  1163. !----------------------------------------------------------------------
  1164. !
  1165. IF (ICE_logical .EQV. .FALSE.) GO TO 20
  1166. !
  1167. !--- Now the pretzel logic of calculating ice deposition
  1168. !
  1169. IF (TC.LT.T_ICE .AND. (WV.GT.QSIgrd .OR. QW.GT.EPSQ)) THEN
  1170. !
  1171. !--- Adjust to ice saturation at T<T_ICE (-10C) if supersaturated.
  1172. ! Sources of ice due to nucleation and convective detrainment are
  1173. ! either poorly understood, poorly resolved at typical NWP
  1174. ! resolutions, or are not represented (e.g., no detrained
  1175. ! condensate in BMJ Cu scheme).
  1176. !
  1177. PCOND=-QW
  1178. DUM1=TK+XLV1*PCOND ! Updated (dummy) temperature (deg K)
  1179. DUM2=WV+QW ! Updated (dummy) water vapor mixing ratio
  1180. DUM=MIN(1000.*FPVS(DUM1),0.99*PP) ! Updated (dummy) saturation vapor pressure w/r/t ice
  1181. DUM=RHgrd*EPS*DUM/(PP-DUM) ! Updated (dummy) saturation mixing ratio w/r/t ice
  1182. IF (DUM2 .GT. DUM) PIDEP=DEPOSIT (PP, DUM1, DUM2)
  1183. DWVi=0. ! Used only for debugging
  1184. !
  1185. ELSE IF (TC .LT. 0.) THEN
  1186. !
  1187. !--- These quantities are handy for ice deposition/sublimation
  1188. ! PIDEP_max - max deposition or minimum sublimation to ice saturation
  1189. !
  1190. DENOMI=1.+XLS2*QSI*TK2
  1191. DWVi=MIN(WVQW,QSW)-QSI
  1192. PIDEP_max=MAX(PILOSS, DWVi/DENOMI)
  1193. IF (QTICE .GT. 0.) THEN
  1194. !
  1195. !--- Calculate ice deposition/sublimation
  1196. ! * SFACTOR - [VEL_INC**.5]*[Schmidt**(1./3.)]*[(RHO/DYNVIS)**.5],
  1197. ! where Schmidt (Schmidt Number) =DYNVIS/(RHO*DIFFUS)
  1198. ! * Units: SFACTOR - s**.5/m ; ABI - m**2/s ; NLICE - m**-3 ;
  1199. ! VENTIL, VENTIS - m**-2 ; VENTI1 - m ;
  1200. ! VENTI2 - m**2/s**.5 ; DIDEP - unitless
  1201. !
  1202. SFACTOR=VEL_INC**.5*(RHO/(DIFFUS*DIFFUS*DYNVIS))**C2
  1203. ABI=1./(RHO*XLS3*QSI*TK2/THERM_COND+1./DIFFUS)
  1204. !
  1205. !--- VENTIL - Number concentration * ventilation factors for large ice
  1206. !--- VENTIS - Number concentration * ventilation factors for small ice
  1207. !
  1208. !--- Variation in the number concentration of ice with time is not
  1209. ! accounted for in these calculations (could be in the future).
  1210. !
  1211. VENTIL=(VENTI1(INDEXS)+SFACTOR*VENTI2(INDEXS))*NLICE
  1212. VENTIS=(VENTI1(MDImin)+SFACTOR*VENTI2(MDImin))*NSmICE
  1213. DIDEP=ABI*(VENTIL+VENTIS)*DTPH
  1214. !
  1215. !--- Account for change in water vapor supply w/ time
  1216. !
  1217. IF (DIDEP .GE. Xratio)then
  1218. DIDEP=(1.-EXP(-DIDEP*DENOMI))/DENOMI
  1219. endif
  1220. IF (DWVi .GT. 0.) THEN
  1221. PIDEP=MIN(DWVi*DIDEP, PIDEP_max)
  1222. ELSE IF (DWVi .LT. 0.) THEN
  1223. PIDEP=MAX(DWVi*DIDEP, PIDEP_max)
  1224. ENDIF
  1225. !
  1226. ELSE IF (WVQW.GT.QSI .AND. TC.LE.T_ICE_init) THEN
  1227. !
  1228. !--- Ice nucleation in near water-saturated conditions. Ice crystal
  1229. ! growth during time step calculated using Miller & Young (1979, JAS).
  1230. !--- These deposition rates could drive conditions below water saturation,
  1231. ! which is the basis of these calculations. Intended to approximate
  1232. ! more complex & computationally intensive calculations.
  1233. !
  1234. INDEX_MY=MAX(MY_T1, MIN( INT(.5-TC), MY_T2 ) )
  1235. !
  1236. !--- DUM1 is the supersaturation w/r/t ice at water-saturated conditions
  1237. !
  1238. !--- DUM2 is the number of ice crystals nucleated at water-saturated
  1239. ! conditions based on Meyers et al. (JAM, 1992).
  1240. !
  1241. !--- Prevent unrealistically large ice initiation (limited by PIDEP_max)
  1242. ! if DUM2 values are increased in future experiments
  1243. !
  1244. DUM1=QSW/QSI-1.
  1245. DUM2=1.E3*EXP(12.96*DUM1-.639)
  1246. PIDEP=MIN(PIDEP_max, DUM2*MY_GROWTH(INDEX_MY)*RRHO)
  1247. !
  1248. ENDIF ! End IF (QTICE .GT. 0.)
  1249. !
  1250. ENDIF ! End IF (TC.LT.T_ICE .AND. (WV.GT.QSIgrd .OR. QW.GT.EPSQ))
  1251. !
  1252. !------------------------------------------------------------------------
  1253. !
  1254. 20 CONTINUE ! Jump here if conditions for ice are not present
  1255. !
  1256. !------------------------------------------------------------------------
  1257. !
  1258. !--- Cloud water condensation
  1259. !
  1260. IF (TC.GE.T_ICE .AND. (QW.GT.EPSQ .OR. WV.GT.QSWgrd)) THEN
  1261. IF (PIACWI.EQ.0. .AND. PIDEP.EQ.0.) THEN
  1262. PCOND=CONDENSE (PP, QW, TK, WV)
  1263. ELSE
  1264. !
  1265. !--- Modify cloud condensation in response to ice processes
  1266. !
  1267. DUM=XLV*QSWgrd*RCPRV*TK2
  1268. DENOMWI=1.+XLS*DUM
  1269. DENOMF=XLF*DUM
  1270. DUM=MAX(0., PIDEP)
  1271. PCOND=(WV-QSWgrd-DENOMWI*DUM-DENOMF*PIACWI)/DENOMW
  1272. DUM1=-QW
  1273. DUM2=PCOND-PIACW
  1274. IF (DUM2 .LT. DUM1) THEN
  1275. !
  1276. !--- Limit cloud water sinks
  1277. !
  1278. DUM=DUM1/DUM2
  1279. PCOND=DUM*PCOND
  1280. PIACW=DUM*PIACW
  1281. PIACWI=DUM*PIACWI
  1282. ENDIF ! End IF (DUM2 .LT. DUM1)
  1283. ENDIF ! End IF (PIACWI.EQ.0. .AND. PIDEP.EQ.0.)
  1284. ENDIF ! End IF (TC.GE.T_ICE .AND. (QW.GT.EPSQ .OR. WV.GT.QSWgrd))
  1285. !
  1286. !--- Limit freezing of accreted rime to prevent temperature oscillations,
  1287. ! a crude Schumann-Ludlam limit (p. 209 of Young, 1993).
  1288. !
  1289. TCC=TC+XLV1*PCOND+XLS1*PIDEP+XLF1*PIACWI
  1290. IF (TCC .GT. 0.) THEN
  1291. PIACWI=0.
  1292. TCC=TC+XLV1*PCOND+XLS1*PIDEP
  1293. ENDIF
  1294. IF (TC.GT.0. .AND. TCC.GT.0. .AND. ICE_logical) THEN
  1295. !
  1296. !--- Calculate melting and evaporation/condensation
  1297. ! * Units: SFACTOR - s**.5/m ; ABI - m**2/s ; NLICE - m**-3 ;
  1298. ! VENTIL - m**-2 ; VENTI1 - m ;
  1299. ! VENTI2 - m**2/s**.5 ; CIEVP - /s
  1300. !
  1301. SFACTOR=VEL_INC**.5*(RHO/(DIFFUS*DIFFUS*DYNVIS))**C2
  1302. VENTIL=NLICE*(VENTI1(INDEXS)+SFACTOR*VENTI2(INDEXS))
  1303. AIEVP=VENTIL*DIFFUS*DTPH
  1304. IF (AIEVP .LT. Xratio) THEN
  1305. DIEVP=AIEVP
  1306. ELSE
  1307. DIEVP=1.-EXP(-AIEVP)
  1308. ENDIF
  1309. QSW0=EPS*ESW0/(PP-ESW0)
  1310. DWV0=MIN(WV,QSW)-QSW0
  1311. DUM=QW+PCOND
  1312. IF (WV.LT.QSW .AND. DUM.LE.EPSQ) THEN
  1313. !
  1314. !--- Evaporation from melting snow (sink of snow) or shedding
  1315. ! of water condensed onto melting snow (source of rain)
  1316. !
  1317. DUM=DWV0*DIEVP
  1318. PIEVP=MAX( MIN(0., DUM), PILOSS)
  1319. PICND=MAX(0., DUM)
  1320. ENDIF ! End IF (WV.LT.QSW .AND. DUM.LE.EPSQ)
  1321. PIMLT=THERM_COND*TCC*VENTIL*RRHO*DTPH/XLF
  1322. !
  1323. !--- Limit melting to prevent temperature oscillations across 0C
  1324. !
  1325. DUM1=MAX( 0., (TCC+XLV1*PIEVP)/XLF1 )
  1326. PIMLT=MIN(PIMLT, DUM1)
  1327. !
  1328. !--- Limit loss of snow by melting (>0) and evaporation
  1329. !
  1330. DUM=PIEVP-PIMLT
  1331. IF (DUM .LT. PILOSS) THEN
  1332. DUM1=PILOSS/DUM
  1333. PIMLT=PIMLT*DUM1
  1334. PIEVP=PIEVP*DUM1
  1335. ENDIF ! End IF (DUM .GT. QTICE)
  1336. ENDIF ! End IF (TC.GT.0. .AND. TCC.GT.0. .AND. ICE_logical)
  1337. !
  1338. !--- IMPORTANT: Estimate time-averaged properties.
  1339. !
  1340. ! * TOT_RAIN - total mass of rain before microphysics, which is the sum of
  1341. ! the total mass of rain in the current layer and the input
  1342. ! flux of rain from above
  1343. ! * VRAIN1 - fall speed of rain into grid from above (with air resistance correction)
  1344. ! * QTRAIN - time-averaged mixing ratio of rain (kg/kg)
  1345. ! * PRLOSS - greatest loss (<0) of rain, removing all rain falling from
  1346. ! above and the rain within the layer
  1347. ! * RQR - rain content (kg/m**3)
  1348. ! * INDEXR - mean size of rain drops to the nearest 1 micron in size
  1349. ! * N0r - intercept of rain size distribution (typically 10**6 m**-4)
  1350. !
  1351. TOT_RAIN=0.
  1352. VRAIN1=0.
  1353. QTRAIN=0.
  1354. PRLOSS=0.
  1355. RQR=0.
  1356. N0r=0.
  1357. INDEXR=MDRmin
  1358. INDEXR1=INDEXR !-- For debugging only
  1359. IF (RAIN_logical) THEN
  1360. IF (ARAIN .LE. 0.) THEN
  1361. INDEXR=MDRmin
  1362. VRAIN1=0.
  1363. ELSE
  1364. !
  1365. !--- INDEXR (related to mean diameter) & N0r could be modified
  1366. ! by land/sea properties, presence of convection, etc.
  1367. !
  1368. !--- Rain rate normalized to a density of 1.194 kg/m**3
  1369. !
  1370. RR=ARAIN/(DTPH*GAMMAR)
  1371. !
  1372. IF (RR .LE. RR_DRmin) THEN
  1373. !
  1374. !--- Assume fixed mean diameter of rain (0.2 mm) for low rain rates,
  1375. ! instead vary N0r with rain rate
  1376. !
  1377. INDEXR=MDRmin
  1378. ELSE IF (RR .LE. RR_DR1) THEN
  1379. !
  1380. !--- Best fit to mass-weighted fall speeds (V) from rain lookup tables
  1381. ! for mean diameters (Dr) between 0.05 and 0.10 mm:
  1382. ! V(Dr)=5.6023e4*Dr**1.136, V in m/s and Dr in m
  1383. ! RR = PI*1000.*N0r0*5.6023e4*Dr**(4+1.136) = 1.408e15*Dr**5.136,
  1384. ! RR in kg/(m**2*s)
  1385. ! Dr (m) = 1.123e-3*RR**.1947 -> Dr (microns) = 1.123e3*RR**.1947
  1386. !
  1387. INDEXR=INT( 1.123E3*RR**.1947 + .5 )
  1388. INDEXR=MAX( MDRmin, MIN(INDEXR, MDR1) )
  1389. ELSE IF (RR .LE. RR_DR2) THEN
  1390. !
  1391. !--- Best fit to mass-weighted fall speeds (V) from rain lookup tables
  1392. ! for mean diameters (Dr) between 0.10 and 0.20 mm:
  1393. ! V(Dr)=1.0867e4*Dr**.958, V in m/s and Dr in m
  1394. ! RR = PI*1000.*N0r0*1.0867e4*Dr**(4+.958) = 2.731e14*Dr**4.958,
  1395. ! RR in kg/(m**2*s)
  1396. ! Dr (m) = 1.225e-3*RR**.2017 -> Dr (microns) = 1.225e3*RR**.2017
  1397. !
  1398. INDEXR=INT( 1.225E3*RR**.2017 + .5 )
  1399. INDEXR=MAX( MDR1, MIN(INDEXR, MDR2) )
  1400. ELSE IF (RR .LE. RR_DR3) THEN
  1401. !
  1402. !--- Best fit to mass-weighted fall speeds (V) from rain lookup tables
  1403. ! for mean diameters (Dr) between 0.20 and 0.32 mm:
  1404. ! V(Dr)=2831.*Dr**.80, V in m/s and Dr in m
  1405. ! RR = PI*1000.*N0r0*2831.*Dr**(4+.80) = 7.115e13*Dr**4.80,
  1406. ! RR in kg/(m**2*s)
  1407. ! Dr (m) = 1.3006e-3*RR**.2083 -> Dr (microns) = 1.3006e3*RR**.2083
  1408. !
  1409. INDEXR=INT( 1.3006E3*RR**.2083 + .5 )
  1410. INDEXR=MAX( MDR2, MIN(INDEXR, MDR3) )
  1411. ELSE IF (RR .LE. RR_DR4) THEN
  1412. !
  1413. !--- Best fit to mass-weighted fall speeds (V) from rain lookup tables
  1414. ! for mean diameters (Dr) between 0.32 and 0.45 mm:
  1415. ! V(Dr)=963.0*Dr**.666, V in m/s and Dr in m
  1416. ! RR = PI*1000.*N0r0*963.0*Dr**(4+.666) = 2.4205e13*Dr**4.666,
  1417. ! RR in kg/(m**2*s)
  1418. ! Dr (m) = 1.354e-3*RR**.2143 -> Dr (microns) = 1.354e3*RR**.2143
  1419. !
  1420. INDEXR=INT( 1.354E3*RR**.2143 + .5 )
  1421. INDEXR=MAX( MDR3, MIN(INDEXR, MDR4) )
  1422. ELSE IF (RR .LE. RR_DR5) THEN
  1423. !
  1424. !--- Best fit to mass-weighted fall speeds (V) from rain lookup tables
  1425. ! for mean diameters (Dr) between 0.45 and 0.675 mm:
  1426. ! V(Dr)=309.0*Dr**.5185, V in m/s and Dr in m
  1427. ! RR = PI*1000.*N0r0*309.0*Dr**(4+.5185) = 7.766e12*Dr**4.5185,
  1428. ! RR in kg/(m**2*s)
  1429. ! Dr (m) = 1.404e-3*RR**.2213 -> Dr (microns) = 1.404e3*RR**.2213
  1430. !
  1431. INDEXR=INT( 1.404E3*RR**.2213 + .5 )
  1432. INDEXR=MAX( MDR4, MIN(INDEXR, MDR5) )
  1433. ELSE IF (RR .LE. RR_DRmax) THEN
  1434. !
  1435. !--- Best fit to mass-weighted fall speeds (V) from rain lookup tables
  1436. ! for mean diameters (Dr) between 0.675 and 1.0 mm:
  1437. ! V(Dr)=85.81Dr**.343, V in m/s and Dr in m
  1438. ! RR = PI*1000.*N0r0*85.81*Dr**(4+.343) = 2.1566e12*Dr**4.343,
  1439. ! RR in kg/(m**2*s)
  1440. ! Dr (m) = 1.4457e-3*RR**.2303 -> Dr (microns) = 1.4457e3*RR**.2303
  1441. !
  1442. INDEXR=INT( 1.4457E3*RR**.2303 + .5 )
  1443. INDEXR=MAX( MDR5, MIN(INDEXR, MDRmax) )
  1444. ELSE
  1445. !--- Assume fixed mean diameter of rain (1.0 mm) for high rain rates,
  1446. INDEXR=MDRmax
  1447. ENDIF ! End IF (RR .LE. RR_DRmin) etc.
  1448. VRAIN1=GAMMAR*VRAIN(INDEXR)
  1449. ENDIF ! End IF (ARAIN .LE. 0.)
  1450. INDEXR1=INDEXR ! For debugging only
  1451. TOT_RAIN=THICK*QR+BLEND*ARAIN
  1452. QTRAIN=TOT_RAIN/(THICK+BLDTRH*VRAIN1)
  1453. PRLOSS=-TOT_RAIN/THICK
  1454. RQR=RHO*QTRAIN
  1455. !
  1456. !--- RQR - time-averaged rain content (kg/m**3)
  1457. !
  1458. IF (RQR .LE. RQR_DRmin) THEN
  1459. N0r=MAX(N0rmin, CN0r_DMRmin*RQR)
  1460. INDEXR=MDRmin
  1461. ELSE IF (RQR .GE. RQR_DRmax) THEN
  1462. N0r=CN0r_DMRmax*RQR
  1463. INDEXR=MDRmax
  1464. ELSE
  1465. N0r=N0r0
  1466. INDEXR=MAX( XMRmin, MIN(CN0r0*RQR**.25, XMRmax) )
  1467. ENDIF
  1468. IF (RQR .LE. EPSQ) THEN
  1469. VRAIN1=0.
  1470. ELSE
  1471. VRAIN1=GAMMAR*VRAIN(INDEXR)
  1472. ENDIF
  1473. !
  1474. IF (TC .LT. T_ICE) THEN
  1475. PIACR=-PRLOSS
  1476. ELSE
  1477. DWVr=WV-PCOND-QSW
  1478. DUM=QW+PCOND
  1479. IF (DWVr.LT.0. .AND. DUM.LE.EPSQ) THEN
  1480. !
  1481. !--- Rain evaporation
  1482. !
  1483. ! * RFACTOR - [GAMMAR**.5]*[Schmidt**(1./3.)]*[(RHO/DYNVIS)**.5],
  1484. ! where Schmidt (Schmidt Number) =DYNVIS/(RHO*DIFFUS)
  1485. !
  1486. ! * Units: RFACTOR - s**.5/m ; ABW - m**2/s ; VENTR - m**-2 ;
  1487. ! N0r - m**-4 ; VENTR1 - m**2 ; VENTR2 - m**3/s**.5 ;
  1488. ! CREVP - unitless
  1489. !
  1490. RFACTOR=GAMMAR**.5*(RHO/(DIFFUS*DIFFUS*DYNVIS))**C2
  1491. ABW=1./(RHO*XLV2/THERM_COND+1./DIFFUS)
  1492. !
  1493. !--- Note that VENTR1, VENTR2 lookup tables do not include the
  1494. ! 1/Davg multiplier as in the ice tables
  1495. !
  1496. VENTR=N0r*(VENTR1(INDEXR)+RFACTOR*VENTR2(INDEXR))
  1497. CREVP=ABW*VENTR*DTPH
  1498. IF (CREVP .LT. Xratio) THEN
  1499. DUM=DWVr*CREVP
  1500. ELSE
  1501. DUM=DWVr*(1.-EXP(-CREVP*DENOMW))/DENOMW
  1502. ENDIF
  1503. PREVP=MAX(DUM, PRLOSS)
  1504. ELSE IF (QW .GT. EPSQ) THEN
  1505. FWR=CRACW*GAMMAR*N0r*ACCRR(INDEXR)
  1506. PRACW=MIN(.1,FWR)*QW
  1507. ENDIF ! End IF (DWVr.LT.0. .AND. DUM.LE.EPSQ)
  1508. !
  1509. IF (TC.LT.0. .AND. TCC.LT.0.) THEN
  1510. !
  1511. !--- Biggs (1953) heteorogeneous freezing (e.g., Lin et al., 1983)
  1512. ! - Rescaled mean drop diameter from microns (INDEXR) to mm (DUM) to prevent underflow
  1513. !
  1514. DUM=.001*FLOAT(INDEXR)
  1515. DUM=(EXP(ABFR*TC)-1.)*DUM*DUM*DUM*DUM*DUM*DUM*DUM
  1516. PIACR=MIN(CBFR*N0r*RRHO*DUM, QTRAIN)
  1517. IF (QLICE .GT. EPSQ) THEN
  1518. !
  1519. !--- Freezing of rain by collisions w/ large ice
  1520. !
  1521. DUM=VRAIN1 !-- was DUM=GAMMAR*VRAIN(INDEXR)
  1522. DUM1=DUM-VSNOW
  1523. !
  1524. !--- DUM2 - Difference in spectral fall speeds of rain and
  1525. ! large ice, parameterized following eq. (48) on p. 112 of
  1526. ! Murakami (J. Meteor. Soc. Japan, 1990)
  1527. !
  1528. DUM2=(DUM1*DUM1+.04*DUM*VSNOW)**.5
  1529. DUM1=5.E-12*INDEXR*INDEXR+2.E-12*INDEXR*INDEXS &
  1530. & +.5E-12*INDEXS*INDEXS
  1531. FIR=MIN(1., CIACR*NLICE*DUM1*DUM2)
  1532. !
  1533. !--- Future? Should COLLECTION BY SMALL ICE SHOULD BE INCLUDED???
  1534. !
  1535. PIACR=MIN(PIACR+FIR*QTRAIN, QTRAIN)
  1536. ENDIF ! End IF (QLICE .GT. EPSQ)
  1537. DUM=PREVP-PIACR
  1538. If (DUM .LT. PRLOSS) THEN
  1539. DUM1=PRLOSS/DUM
  1540. PREVP=DUM1*PREVP
  1541. PIACR=DUM1*PIACR
  1542. ENDIF ! End If (DUM .LT. PRLOSS)
  1543. ENDIF ! End IF (TC.LT.0. .AND. TCC.LT.0.)
  1544. ENDIF ! End IF (TC .LT. T_ICE)
  1545. ENDIF ! End IF (RAIN_logical)
  1546. !
  1547. !----------------------------------------------------------------------
  1548. !---------------------- Main Budget Equations -------------------------
  1549. !----------------------------------------------------------------------
  1550. !
  1551. !
  1552. !-----------------------------------------------------------------------
  1553. !--- Update fields, determine characteristics for next lower layer ----
  1554. !-----------------------------------------------------------------------
  1555. !
  1556. !--- Carefully limit sinks of cloud water
  1557. !
  1558. DUM1=PIACW+PRAUT+PRACW-MIN(0.,PCOND)
  1559. IF (DUM1 .GT. QW) THEN
  1560. DUM=QW/DUM1
  1561. PIACW=DUM*PIACW
  1562. PIACWI=DUM*PIACWI
  1563. PRAUT=DUM*PRAUT
  1564. PRACW=DUM*PRACW
  1565. IF (PCOND .LT. 0.) PCOND=DUM*PCOND
  1566. ENDIF
  1567. PIACWR=PIACW-PIACWI ! TC >= 0C
  1568. !
  1569. !--- QWnew - updated cloud water mixing ratio
  1570. !
  1571. DELW=PCOND-PIACW-PRAUT-PRACW
  1572. QWnew=QW+DELW
  1573. IF (QWnew .LE. EPSQ) QWnew=0.
  1574. IF (QW.GT.0. .AND. QWnew.NE.0.) THEN
  1575. DUM=QWnew/QW
  1576. IF (DUM .LT. TOLER) QWnew=0.
  1577. ENDIF
  1578. !
  1579. !--- Update temperature and water vapor mixing ratios
  1580. !
  1581. DELT= XLV1*(PCOND+PIEVP+PICND+PREVP) &
  1582. & +XLS1*PIDEP+XLF1*(PIACWI+PIACR-PIMLT)
  1583. Tnew=TK+DELT
  1584. !
  1585. DELV=-PCOND-PIDEP-PIEVP-PICND-PREVP
  1586. WVnew=WV+DELV
  1587. !
  1588. !--- Update ice mixing ratios
  1589. !
  1590. !---
  1591. ! * TOT_ICEnew - total mass (small & large) ice after microphysics,
  1592. ! which is the sum of the total mass of large ice in the
  1593. ! current layer and the flux of ice out of the grid box below
  1594. ! * RimeF - Rime Factor, which is the mass ratio of total (unrimed &
  1595. ! rimed) ice mass to the unrimed ice mass (>=1)
  1596. ! * QInew - updated mixing ratio of total (large & small) ice in layer
  1597. ! -> TOT_ICEnew=QInew*THICK+BLDTRH*QLICEnew*VSNOW
  1598. ! -> But QLICEnew=QInew*FLIMASS, so
  1599. ! -> TOT_ICEnew=QInew*(THICK+BLDTRH*FLIMASS*VSNOW)
  1600. ! * ASNOWnew - updated accumulation of snow at bottom of grid cell
  1601. !---
  1602. !
  1603. DELI=0.
  1604. RimeF=1.
  1605. IF (ICE_logical) THEN
  1606. DELI=PIDEP+PIEVP+PIACWI+PIACR-PIMLT
  1607. TOT_ICEnew=TOT_ICE+THICK*DELI
  1608. IF (TOT_ICE.GT.0. .AND. TOT_ICEnew.NE.0.) THEN
  1609. DUM=TOT_ICEnew/TOT_ICE
  1610. IF (DUM .LT. TOLER) TOT_ICEnew=0.
  1611. ENDIF
  1612. IF (TOT_ICEnew .LE. CLIMIT) THEN
  1613. TOT_ICEnew=0.
  1614. RimeF=1.
  1615. QInew=0.
  1616. ASNOWnew=0.
  1617. ELSE
  1618. !
  1619. !--- Update rime factor if appropriate
  1620. !
  1621. DUM=PIACWI+PIACR
  1622. IF (DUM.LE.EPSQ .AND. PIDEP.LE.EPSQ) THEN
  1623. RimeF=RimeF1
  1624. ELSE
  1625. !
  1626. !--- Rime Factor, RimeF = (Total ice mass)/(Total unrimed ice mass)
  1627. ! DUM1 - Total ice mass, rimed & unrimed
  1628. ! DUM2 - Estimated mass of *unrimed* ice
  1629. !
  1630. DUM1=TOT_ICE+THICK*(PIDEP+DUM)
  1631. DUM2=TOT_ICE/RimeF1+THICK*PIDEP
  1632. IF (DUM2 .LE. 0.) THEN
  1633. RimeF=RFmax
  1634. ELSE
  1635. RimeF=MIN(RFmax, MAX(1., DUM1/DUM2) )
  1636. ENDIF
  1637. ENDIF ! End IF (DUM.LE.EPSQ .AND. PIDEP.LE.EPSQ)
  1638. QInew=TOT_ICEnew/(THICK+BLDTRH*FLIMASS*VSNOW)
  1639. IF (QInew .LE. EPSQ) QInew=0.
  1640. IF (QI.GT.0. .AND. QInew.NE.0.) THEN
  1641. DUM=QInew/QI
  1642. IF (DUM .LT. TOLER) QInew=0.
  1643. ENDIF
  1644. ASNOWnew=BLDTRH*FLIMASS*VSNOW*QInew
  1645. IF (ASNOW.GT.0. .AND. ASNOWnew.NE.0.) THEN
  1646. DUM=ASNOWnew/ASNOW
  1647. IF (DUM .LT. TOLER) ASNOWnew=0.
  1648. ENDIF
  1649. ENDIF ! End IF (TOT_ICEnew .LE. CLIMIT)
  1650. ENDIF ! End IF (ICE_logical)
  1651. !
  1652. !--- Update rain mixing ratios
  1653. !
  1654. !---
  1655. ! * TOT_RAINnew - total mass of rain after microphysics
  1656. ! current layer and the input flux of ice from above
  1657. ! * VRAIN2 - time-averaged fall speed of rain in grid and below
  1658. ! (with air resistance correction)
  1659. ! * QRnew - updated rain mixing ratio in layer
  1660. ! -> TOT_RAINnew=QRnew*(THICK+BLDTRH*VRAIN2)
  1661. ! * ARAINnew - updated accumulation of rain at bottom of grid cell
  1662. !---
  1663. !
  1664. DELR=PRAUT+PRACW+PIACWR-PIACR+PIMLT+PREVP+PICND
  1665. TOT_RAINnew=TOT_RAIN+THICK*DELR
  1666. IF (TOT_RAIN.GT.0. .AND. TOT_RAINnew.NE.0.) THEN
  1667. DUM=TOT_RAINnew/TOT_RAIN
  1668. IF (DUM .LT. TOLER) TOT_RAINnew=0.
  1669. ENDIF
  1670. IF (TOT_RAINnew .LE. CLIMIT) THEN
  1671. TOT_RAINnew=0.
  1672. VRAIN2=0.
  1673. QRnew=0.
  1674. ARAINnew=0.
  1675. ELSE
  1676. !
  1677. !--- 1st guess time-averaged rain rate at bottom of grid box
  1678. !
  1679. RR=TOT_RAINnew/(DTPH*GAMMAR)
  1680. !
  1681. !--- Use same algorithm as above for calculating mean drop diameter
  1682. ! (IDR, in microns), which is used to estimate the time-averaged
  1683. ! fall speed of rain drops at the bottom of the grid layer. This
  1684. ! isn't perfect, but the alternative is solving a transcendental
  1685. ! equation that is numerically inefficient and nasty to program
  1686. ! (coded in earlier versions of GSMCOLUMN prior to 8-22-01).
  1687. !
  1688. IF (RR .LE. RR_DRmin) THEN
  1689. IDR=MDRmin
  1690. ELSE IF (RR .LE. RR_DR1) THEN
  1691. IDR=INT( 1.123E3*RR**.1947 + .5 )
  1692. IDR=MAX( MDRmin, MIN(IDR, MDR1) )
  1693. ELSE IF (RR .LE. RR_DR2) THEN
  1694. IDR=INT( 1.225E3*RR**.2017 + .5 )
  1695. IDR=MAX( MDR1, MIN(IDR, MDR2) )
  1696. ELSE IF (RR .LE. RR_DR3) THEN
  1697. IDR=INT( 1.3006E3*RR**.2083 + .5 )
  1698. IDR=MAX( MDR2, MIN(IDR, MDR3) )
  1699. ELSE IF (RR .LE. RR_DR4) THEN
  1700. IDR=INT( 1.354E3*RR**.2143 + .5 )
  1701. IDR=MAX( MDR3, MIN(IDR, MDR4) )
  1702. ELSE IF (RR .LE. RR_DR5) THEN
  1703. IDR=INT( 1.404E3*RR**.2213 + .5 )
  1704. IDR=MAX( MDR4, MIN(IDR, MDR5) )
  1705. ELSE
  1706. IDR=INT( 1.4457E3*RR**.2303 + .5 )
  1707. IDR=MAX( MDR5, MIN(IDR, MDRmax) )
  1708. ENDIF ! End IF (RR .LE. RR_DRmin)
  1709. ! VRAIN2=GAMMAR*VRAIN(IDR)
  1710. VRAIN2=.5*(VRAIN1+GAMMAR*VRAIN(IDR))
  1711. QRnew=TOT_RAINnew/(THICK+BLDTRH*VRAIN2)
  1712. IF (QRnew .LE. EPSQ) QRnew=0.
  1713. IF (QR.GT.0. .AND. QRnew.NE.0.) THEN
  1714. DUM=QRnew/QR
  1715. IF (DUM .LT. TOLER) QRnew=0.
  1716. ENDIF
  1717. ARAINnew=BLDTRH*VRAIN2*QRnew
  1718. IF (ARAIN.GT.0. .AND. ARAINnew.NE.0.) THEN
  1719. DUM=ARAINnew/ARAIN
  1720. IF (DUM .LT. TOLER) ARAINnew=0.
  1721. ENDIF
  1722. ENDIF
  1723. !
  1724. WCnew=QWnew+QRnew+QInew
  1725. !
  1726. !----------------------------------------------------------------------
  1727. !-------------- Begin debugging & verification ------------------------
  1728. !----------------------------------------------------------------------
  1729. !
  1730. !--- QT, QTnew - total water (vapor & condensate) before & after microphysics, resp.
  1731. !
  1732. QT=THICK*(WV+WC)+ARAIN+ASNOW
  1733. QTnew=THICK*(WVnew+WCnew)+ARAINnew+ASNOWnew
  1734. BUDGET=QT-QTnew
  1735. !
  1736. !--- Additional check on budget preservation, accounting for truncation effects
  1737. !
  1738. DBG_logical=.FALSE.
  1739. ! DUM=ABS(BUDGET)
  1740. ! IF (DUM .GT. TOLER) THEN
  1741. ! DUM=DUM/MIN(QT, QTnew)
  1742. ! IF (DUM .GT. TOLER) DBG_logical=.TRUE.
  1743. ! ENDIF
  1744. !!
  1745. ! DUM=(RHgrd+.001)*QSInew
  1746. ! IF ( (QWnew.GT.EPSQ) .OR. QRnew.GT.EPSQ .OR. WVnew.GT.DUM)
  1747. ! & .AND. TC.LT.T_ICE ) DBG_logical=.TRUE.
  1748. !
  1749. ! IF (TC.GT.5. .AND. QInew.GT.EPSQ) DBG_logical=.TRUE.
  1750. !
  1751. IF ((WVnew.LT.EPSQ .OR. DBG_logical) .AND. PRINT_diag) THEN
  1752. !
  1753. WRITE(6,"(/2(a,i4),2(a,i2))") '{} i=',I_index,' j=',J_index,&
  1754. & ' L=',L,' LSFC=',LSFC
  1755. !
  1756. ESW=MIN(1000.*FPVS0(Tnew),0.99*PP)
  1757. QSWnew=EPS*ESW/(PP-ESW)
  1758. IF (TC.LT.0. .OR. Tnew .LT. 0.) THEN
  1759. ESI=MIN(1000.*FPVS(Tnew),0.99*PP)
  1760. QSInew=EPS*ESI/(PP-ESI)
  1761. ELSE
  1762. QSI=QSW
  1763. QSInew=QSWnew
  1764. ENDIF
  1765. WSnew=QSInew
  1766. WRITE(6,"(4(a12,g11.4,1x))") &
  1767. & '{} TCold=',TC,'TCnew=',Tnew-T0C,'P=',.01*PP,'RHO=',RHO, &
  1768. & '{} THICK=',THICK,'RHold=',WV/WS,'RHnew=',WVnew/WSnew, &
  1769. & 'RHgrd=',RHgrd, &
  1770. & '{} RHWold=',WV/QSW,'RHWnew=',WVnew/QSWnew,'RHIold=',WV/QSI, &
  1771. & 'RHInew=',WVnew/QSInew, &
  1772. & '{} QSWold=',QSW,'QSWnew=',QSWnew,'QSIold=',QSI,'QSInew=',QSInew, &
  1773. & '{} WSold=',WS,'WSnew=',WSnew,'WVold=',WV,'WVnew=',WVnew, &
  1774. & '{} WCold=',WC,'WCnew=',WCnew,'QWold=',QW,'QWnew=',QWnew, &
  1775. & '{} QIold=',QI,'QInew=',QInew,'QRold=',QR,'QRnew=',QRnew, &
  1776. & '{} ARAINold=',ARAIN,'ARAINnew=',ARAINnew,'ASNOWold=',ASNOW, &
  1777. & 'ASNOWnew=',ASNOWnew, &
  1778. & '{} TOT_RAIN=',TOT_RAIN,'TOT_RAINnew=',TOT_RAINnew, &
  1779. & 'TOT_ICE=',TOT_ICE,'TOT_ICEnew=',TOT_ICEnew, &
  1780. & '{} BUDGET=',BUDGET,'QTold=',QT,'QTnew=',QTnew
  1781. !
  1782. WRITE(6,"(4(a12,g11.4,1x))") &
  1783. & '{} DELT=',DELT,'DELV=',DELV,'DELW=',DELW,'DELI=',DELI, &
  1784. & '{} DELR=',DELR,'PCOND=',PCOND,'PIDEP=',PIDEP,'PIEVP=',PIEVP, &
  1785. & '{} PICND=',PICND,'PREVP=',PREVP,'PRAUT=',PRAUT,'PRACW=',PRACW, &
  1786. & '{} PIACW=',PIACW,'PIACWI=',PIACWI,'PIACWR=',PIACWR,'PIMLT=', &
  1787. & PIMLT, &
  1788. & '{} PIACR=',PIACR
  1789. !
  1790. IF (ICE_logical) WRITE(6,"(4(a12,g11.4,1x))") &
  1791. & '{} RimeF1=',RimeF1,'GAMMAS=',GAMMAS,'VrimeF=',VrimeF, &
  1792. & 'VSNOW=',VSNOW, &
  1793. & '{} INDEXS=',FLOAT(INDEXS),'FLARGE=',FLARGE,'FSMALL=',FSMALL, &
  1794. & 'FLIMASS=',FLIMASS, &
  1795. & '{} XSIMASS=',XSIMASS,'XLIMASS=',XLIMASS,'QLICE=',QLICE, &
  1796. & 'QTICE=',QTICE, &
  1797. & '{} NLICE=',NLICE,'NSmICE=',NSmICE,'PILOSS=',PILOSS, &
  1798. & 'EMAIRI=',EMAIRI, &
  1799. & '{} RimeF=',RimeF
  1800. !
  1801. IF (TOT_RAIN.GT.0. .OR. TOT_RAINnew.GT.0.) &
  1802. & WRITE(6,"(4(a12,g11.4,1x))") &
  1803. & '{} INDEXR1=',FLOAT(INDEXR1),'INDEXR=',FLOAT(INDEXR), &
  1804. & 'GAMMAR=',GAMMAR,'N0r=',N0r, &
  1805. & '{} VRAIN1=',VRAIN1,'VRAIN2=',VRAIN2,'QTRAIN=',QTRAIN,'RQR=',RQR, &
  1806. & '{} PRLOSS=',PRLOSS,'VOLR1=',THICK+BLDTRH*VRAIN1, &
  1807. & 'VOLR2=',THICK+BLDTRH*VRAIN2
  1808. !
  1809. IF (PRAUT .GT. 0.) WRITE(6,"(a12,g11.4,1x)") '{} QW0=',QW0
  1810. !
  1811. IF (PRACW .GT. 0.) WRITE(6,"(a12,g11.4,1x)") '{} FWR=',FWR
  1812. !
  1813. IF (PIACR .GT. 0.) WRITE(6,"(a12,g11.4,1x)") '{} FIR=',FIR
  1814. !
  1815. DUM=PIMLT+PICND-PREVP-PIEVP
  1816. IF (DUM.GT.0. .or. DWVi.NE.0.) &
  1817. & WRITE(6,"(4(a12,g11.4,1x))") &
  1818. & '{} TFACTOR=',TFACTOR,'DYNVIS=',DYNVIS, &
  1819. & 'THERM_CON=',THERM_COND,'DIFFUS=',DIFFUS
  1820. !
  1821. IF (PREVP .LT. 0.) WRITE(6,"(4(a12,g11.4,1x))") &
  1822. & '{} RFACTOR=',RFACTOR,'ABW=',ABW,'VENTR=',VENTR,'CREVP=',CREVP, &
  1823. & '{} DWVr=',DWVr,'DENOMW=',DENOMW
  1824. !
  1825. IF (PIDEP.NE.0. .AND. DWVi.NE.0.) &
  1826. & WRITE(6,"(4(a12,g11.4,1x))") &
  1827. & '{} DWVi=',DWVi,'DENOMI=',DENOMI,'PIDEP_max=',PIDEP_max, &
  1828. & 'SFACTOR=',SFACTOR, &
  1829. & '{} ABI=',ABI,'VENTIL=',VENTIL,'VENTIL1=',VENTI1(INDEXS), &
  1830. & 'VENTIL2=',SFACTOR*VENTI2(INDEXS), &
  1831. & '{} VENTIS=',VENTIS,'DIDEP=',DIDEP
  1832. !
  1833. IF (PIDEP.GT.0. .AND. PCOND.NE.0.) &
  1834. & WRITE(6,"(4(a12,g11.4,1x))") &
  1835. & '{} DENOMW=',DENOMW,'DENOMWI=',DENOMWI,'DENOMF=',DENOMF, &
  1836. & 'DUM2=',PCOND-PIACW
  1837. !
  1838. IF (FWS .GT. 0.) WRITE(6,"(4(a12,g11.4,1x))") &
  1839. & '{} FWS=',FWS
  1840. !
  1841. DUM=PIMLT+PICND-PIEVP
  1842. IF (DUM.GT. 0.) WRITE(6,"(4(a12,g11.4,1x))") &
  1843. & '{} SFACTOR=',SFACTOR,'VENTIL=',VENTIL,'VENTIL1=',VENTI1(INDEXS), &
  1844. & 'VENTIL2=',SFACTOR*VENTI2(INDEXS), &
  1845. & '{} AIEVP=',AIEVP,'DIEVP=',DIEVP,'QSW0=',QSW0,'DWV0=',DWV0
  1846. !
  1847. ENDIF
  1848. !
  1849. !-----------------------------------------------------------------------
  1850. !--------------- Water budget statistics & maximum values --------------
  1851. !-----------------------------------------------------------------------
  1852. !
  1853. IF (PRINT_diag) THEN
  1854. ITdx=MAX( ITLO, MIN( INT(Tnew-T0C), ITHI ) )
  1855. IF (QInew .GT. EPSQ) NSTATS(ITdx,1)=NSTATS(ITdx,1)+1
  1856. IF (QInew.GT.EPSQ .AND. QRnew+QWnew.GT.EPSQ) &
  1857. & NSTATS(ITdx,2)=NSTATS(ITdx,2)+1
  1858. IF (QWnew .GT. EPSQ) NSTATS(ITdx,3)=NSTATS(ITdx,3)+1
  1859. IF (QRnew .GT. EPSQ) NSTATS(ITdx,4)=NSTATS(ITdx,4)+1
  1860. !
  1861. QMAX(ITdx,1)=MAX(QMAX(ITdx,1), QInew)
  1862. QMAX(ITdx,2)=MAX(QMAX(ITdx,2), QWnew)
  1863. QMAX(ITdx,3)=MAX(QMAX(ITdx,3), QRnew)
  1864. QMAX(ITdx,4)=MAX(QMAX(ITdx,4), ASNOWnew)
  1865. QMAX(ITdx,5)=MAX(QMAX(ITdx,5), ARAINnew)
  1866. QTOT(ITdx,1)=QTOT(ITdx,1)+QInew*THICK
  1867. QTOT(ITdx,2)=QTOT(ITdx,2)+QWnew*THICK
  1868. QTOT(ITdx,3)=QTOT(ITdx,3)+QRnew*THICK
  1869. !
  1870. QTOT(ITdx,4)=QTOT(ITdx,4)+PCOND*THICK
  1871. QTOT(ITdx,5)=QTOT(ITdx,5)+PICND*THICK
  1872. QTOT(ITdx,6)=QTOT(ITdx,6)+PIEVP*THICK
  1873. QTOT(ITdx,7)=QTOT(ITdx,7)+PIDEP*THICK
  1874. QTOT(ITdx,8)=QTOT(ITdx,8)+PREVP*THICK
  1875. QTOT(ITdx,9)=QTOT(ITdx,9)+PRAUT*THICK
  1876. QTOT(ITdx,10)=QTOT(ITdx,10)+PRACW*THICK
  1877. QTOT(ITdx,11)=QTOT(ITdx,11)+PIMLT*THICK
  1878. QTOT(ITdx,12)=QTOT(ITdx,12)+PIACW*THICK
  1879. QTOT(ITdx,13)=QTOT(ITdx,13)+PIACWI*THICK
  1880. QTOT(ITdx,14)=QTOT(ITdx,14)+PIACWR*THICK
  1881. QTOT(ITdx,15)=QTOT(ITdx,15)+PIACR*THICK
  1882. !
  1883. QTOT(ITdx,16)=QTOT(ITdx,16)+(WVnew-WV)*THICK
  1884. QTOT(ITdx,17)=QTOT(ITdx,17)+(QWnew-QW)*THICK
  1885. QTOT(ITdx,18)=QTOT(ITdx,18)+(QInew-QI)*THICK
  1886. QTOT(ITdx,19)=QTOT(ITdx,19)+(QRnew-QR)*THICK
  1887. QTOT(ITdx,20)=QTOT(ITdx,20)+(ARAINnew-ARAIN)
  1888. QTOT(ITdx,21)=QTOT(ITdx,21)+(ASNOWnew-ASNOW)
  1889. IF (QInew .GT. 0.) &
  1890. & QTOT(ITdx,22)=QTOT(ITdx,22)+QInew*THICK/RimeF
  1891. !
  1892. ENDIF
  1893. !
  1894. !----------------------------------------------------------------------
  1895. !------------------------- Update arrays ------------------------------
  1896. !----------------------------------------------------------------------
  1897. !
  1898. T_col(L)=Tnew ! Updated temperature
  1899. !
  1900. QV_col(L)=max(EPSQ, WVnew/(1.+WVnew)) ! Updated specific humidity
  1901. WC_col(L)=max(EPSQ, WCnew) ! Updated total condensate mixing ratio
  1902. QI_col(L)=max(EPSQ, QInew) ! Updated ice mixing ratio
  1903. QR_col(L)=max(EPSQ, QRnew) ! Updated rain mixing ratio
  1904. QW_col(L)=max(EPSQ, QWnew) ! Updated cloud water mixing ratio
  1905. RimeF_col(L)=RimeF ! Updated rime factor
  1906. ASNOW=ASNOWnew ! Updated accumulated snow
  1907. ARAIN=ARAINnew ! Updated accumulated rain
  1908. !
  1909. !#######################################################################
  1910. !
  1911. 10 CONTINUE ! ##### End "L" loop through model levels #####
  1912. !
  1913. !#######################################################################
  1914. !
  1915. !-----------------------------------------------------------------------
  1916. !--------------------------- Return to GSMDRIVE -----------------------
  1917. !-----------------------------------------------------------------------
  1918. !
  1919. CONTAINS
  1920. !#######################################################################
  1921. !--------- Produces accurate calculation of cloud condensation ---------
  1922. !#######################################################################
  1923. !
  1924. REAL FUNCTION CONDENSE (PP, QW, TK, WV)
  1925. !
  1926. !---------------------------------------------------------------------------------
  1927. !------ The Asai (1965) algorithm takes into consideration the release of ------
  1928. !------ latent heat in increasing the temperature & in increasing the ------
  1929. !------ saturation mixing ratio (following the Clausius-Clapeyron eqn.). ------
  1930. !---------------------------------------------------------------------------------
  1931. !
  1932. IMPLICIT NONE
  1933. !
  1934. INTEGER, PARAMETER :: HIGH_PRES=Selected_Real_Kind(15)
  1935. REAL (KIND=HIGH_PRES), PARAMETER :: &
  1936. & RHLIMIT=.001, RHLIMIT1=-RHLIMIT
  1937. REAL (KIND=HIGH_PRES) :: COND, SSAT, WCdum
  1938. !
  1939. REAL,INTENT(IN) :: QW,PP,WV,TK
  1940. REAL WVdum,Tdum,XLV2,DWV,WS,ESW,XLV1,XLV
  1941. integer nsteps
  1942. !
  1943. !-----------------------------------------------------------------------
  1944. !
  1945. !--- LV (T) is from Bolton (JAS, 1980)
  1946. !
  1947. XLV=3.148E6-2370.*TK
  1948. XLV1=XLV*RCP
  1949. XLV2=XLV*XLV*RCPRV
  1950. Tdum=TK
  1951. WVdum=WV
  1952. WCdum=QW
  1953. ESW=MIN(1000.*FPVS0(Tdum),0.99*PP) ! Saturation vapor press w/r/t water
  1954. WS=RHgrd*EPS*ESW/(PP-ESW) ! Saturation mixing ratio w/r/t water
  1955. DWV=WVdum-WS ! Deficit grid-scale water vapor mixing ratio
  1956. SSAT=DWV/WS ! Supersaturation ratio
  1957. CONDENSE=0.
  1958. nsteps = 0
  1959. DO WHILE ((SSAT.LT.RHLIMIT1 .AND. WCdum.GT.EPSQ) &
  1960. & .OR. SSAT.GT.RHLIMIT)
  1961. nsteps = nsteps + 1
  1962. COND=DWV/(1.+XLV2*WS/(Tdum*Tdum)) ! Asai (1965, J. Japan)
  1963. COND=MAX(COND, -WCdum) ! Limit cloud water evaporation
  1964. Tdum=Tdum+XLV1*COND ! Updated temperature
  1965. WVdum=WVdum-COND ! Updated water vapor mixing ratio
  1966. WCdum=WCdum+COND ! Updated cloud water mixing ratio
  1967. CONDENSE=CONDENSE+COND ! Total cloud water condensation
  1968. ESW=MIN(1000.*FPVS0(Tdum),0.99*PP) ! Updated saturation vapor press w/r/t water
  1969. WS=RHgrd*EPS*ESW/(PP-ESW) ! Updated saturation mixing ratio w/r/t water
  1970. DWV=WVdum-WS ! Deficit grid-scale water vapor mixing ratio
  1971. SSAT=DWV/WS ! Grid-scale supersaturation ratio
  1972. ENDDO
  1973. !
  1974. END FUNCTION CONDENSE
  1975. !
  1976. !#######################################################################
  1977. !---------------- Calculate ice deposition at T<T_ICE ------------------
  1978. !#######################################################################
  1979. !
  1980. REAL FUNCTION DEPOSIT (PP, Tdum, WVdum)
  1981. !
  1982. !--- Also uses the Asai (1965) algorithm, but uses a different target
  1983. ! vapor pressure for the adjustment
  1984. !
  1985. IMPLICIT NONE
  1986. !
  1987. INTEGER, PARAMETER :: HIGH_PRES=Selected_Real_Kind(15)
  1988. REAL (KIND=HIGH_PRES), PARAMETER :: RHLIMIT=.001, &
  1989. & RHLIMIT1=-RHLIMIT
  1990. REAL (KIND=HIGH_PRES) :: DEP, SSAT
  1991. !
  1992. real,INTENT(IN) :: PP
  1993. real,INTENT(INOUT) :: WVdum,Tdum
  1994. real ESI,WS,DWV
  1995. !
  1996. !-----------------------------------------------------------------------
  1997. !
  1998. ESI=MIN(1000.*FPVS(Tdum),0.99*PP) ! Saturation vapor press w/r/t ice
  1999. WS=RHgrd*EPS*ESI/(PP-ESI) ! Saturation mixing ratio
  2000. DWV=WVdum-WS ! Deficit grid-scale water vapor mixing ratio
  2001. SSAT=DWV/WS ! Supersaturation ratio
  2002. DEPOSIT=0.
  2003. DO WHILE (SSAT.GT.RHLIMIT .OR. SSAT.LT.RHLIMIT1)
  2004. !
  2005. !--- Note that XLVS2=LS*LV/(CP*RV)=LV*WS/(RV*T*T)*(LS/CP*DEP1),
  2006. ! where WS is the saturation mixing ratio following Clausius-
  2007. ! Clapeyron (see Asai,1965; Young,1993,p.405)
  2008. !
  2009. DEP=DWV/(1.+XLS2*WS/(Tdum*Tdum)) ! Asai (1965, J. Japan)
  2010. Tdum=Tdum+XLS1*DEP ! Updated temperature
  2011. WVdum=WVdum-DEP ! Updated ice mixing ratio
  2012. DEPOSIT=DEPOSIT+DEP ! Total ice deposition
  2013. ESI=MIN(1000.*FPVS(Tdum),0.99*PP) ! Updated saturation vapor press w/r/t ice
  2014. WS=RHgrd*EPS*ESI/(PP-ESI) ! Updated saturation mixing ratio w/r/t ice
  2015. DWV=WVdum-WS ! Deficit grid-scale water vapor mixing ratio
  2016. SSAT=DWV/WS ! Grid-scale supersaturation ratio
  2017. ENDDO
  2018. !
  2019. END FUNCTION DEPOSIT
  2020. !
  2021. END SUBROUTINE EGCP01COLUMN
  2022. !#######################################################################
  2023. !------- Initialize constants & lookup tables for microphysics ---------
  2024. !#######################################################################
  2025. !
  2026. ! SH 0211/2002
  2027. !-----------------------------------------------------------------------
  2028. SUBROUTINE ETANEWinit (GSMDT,DT,DELX,DELY,LOWLYR,restart, &
  2029. & F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, &
  2030. & MP_RESTART_STATE,TBPVS_STATE,TBPVS0_STATE, &
  2031. & ALLOWED_TO_READ, &
  2032. & IDS,IDE,JDS,JDE,KDS,KDE, &
  2033. & IMS,IME,JMS,JME,KMS,KME, &
  2034. & ITS,ITE,JTS,JTE,KTS,KTE )
  2035. !-----------------------------------------------------------------------
  2036. !-------------------------------------------------------------------------------
  2037. !--- SUBPROGRAM DOCUMENTATION BLOCK
  2038. ! PRGRMMR: Ferrier ORG: W/NP22 DATE: February 2001
  2039. ! Jin ORG: W/NP22 DATE: January 2002
  2040. ! (Modification for WRF structure)
  2041. !
  2042. !-------------------------------------------------------------------------------
  2043. ! ABSTRACT:
  2044. ! * Reads various microphysical lookup tables used in COLUMN_MICRO
  2045. ! * Lookup tables were created "offline" and are read in during execution
  2046. ! * Creates lookup tables for saturation vapor pressure w/r/t water & ice
  2047. !-------------------------------------------------------------------------------
  2048. !
  2049. ! USAGE: CALL ETANEWinit FROM SUBROUTINE GSMDRIVE AT MODEL START TIME
  2050. !
  2051. ! INPUT ARGUMENT LIST:
  2052. ! DTPH - physics time step (s)
  2053. !
  2054. ! OUTPUT ARGUMENT LIST:
  2055. ! NONE
  2056. !
  2057. ! OUTPUT FILES:
  2058. ! NONE
  2059. !
  2060. ! SUBROUTINES:
  2061. ! MY_GROWTH_RATES - lookup table for growth of nucleated ice
  2062. ! GPVS - lookup tables for saturation vapor pressure (water, ice)
  2063. !
  2064. ! UNIQUE: NONE
  2065. !
  2066. ! LIBRARY: NONE
  2067. !
  2068. ! COMMON BLOCKS:
  2069. ! CMICRO_CONS - constants used in GSMCOLUMN
  2070. ! CMY600 - lookup table for growth of ice crystals in
  2071. ! water saturated conditions (Miller & Young, 1979)
  2072. ! IVENT_TABLES - lookup tables for ventilation effects of ice
  2073. ! IACCR_TABLES - lookup tables for accretion rates of ice
  2074. ! IMASS_TABLES - lookup tables for mass content of ice
  2075. ! IRATE_TABLES - lookup tables for precipitation rates of ice
  2076. ! IRIME_TABLES - lookup tables for increase in fall speed of rimed ice
  2077. ! MAPOT - Need lat/lon grid resolution
  2078. ! RVENT_TABLES - lookup tables for ventilation effects of rain
  2079. ! RACCR_TABLES - lookup tables for accretion rates of rain
  2080. ! RMASS_TABLES - lookup tables for mass content of rain
  2081. ! RVELR_TABLES - lookup tables for fall speeds of rain
  2082. ! RRATE_TABLES - lookup tables for precipitation rates of rain
  2083. !
  2084. ! ATTRIBUTES:
  2085. ! LANGUAGE: FORTRAN 90
  2086. ! MACHINE : IBM SP
  2087. !
  2088. !-----------------------------------------------------------------------
  2089. !
  2090. !
  2091. !-----------------------------------------------------------------------
  2092. IMPLICIT NONE
  2093. !-----------------------------------------------------------------------
  2094. !-------------------------------------------------------------------------
  2095. !-------------- Parameters & arrays for lookup tables --------------------
  2096. !-------------------------------------------------------------------------
  2097. !
  2098. !--- Common block of constants used in column microphysics
  2099. !
  2100. !WRF
  2101. ! real DLMD,DPHD
  2102. !WRF
  2103. !
  2104. !-----------------------------------------------------------------------
  2105. !--- Parameters & data statement for local calculations
  2106. !-----------------------------------------------------------------------
  2107. !
  2108. INTEGER, PARAMETER :: MDR1=XMR1, MDR2=XMR2, MDR3=XMR3
  2109. !
  2110. ! VARIABLES PASSED IN
  2111. integer,INTENT(IN) :: IDS,IDE,JDS,JDE,KDS,KDE &
  2112. & ,IMS,IME,JMS,JME,KMS,KME &
  2113. & ,ITS,ITE,JTS,JTE,KTS,KTE
  2114. !WRF
  2115. INTEGER, DIMENSION(ims:ime,jms:jme),INTENT(INOUT) :: LOWLYR
  2116. !
  2117. real, INTENT(IN) :: DELX,DELY
  2118. real,DIMENSION(*), INTENT(INOUT) :: MP_RESTART_STATE
  2119. real,DIMENSION(NX), INTENT(INOUT) :: TBPVS_STATE,TBPVS0_STATE
  2120. real,DIMENSION(ims:ime, kms:kme, jms:jme),INTENT(OUT) :: &
  2121. & F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY
  2122. INTEGER, PARAMETER :: ITLO=-60, ITHI=40
  2123. ! integer,DIMENSION(ITLO:ITHI,4),INTENT(INOUT) :: NSTATS
  2124. ! real,DIMENSION(ITLO:ITHI,5),INTENT(INOUT) :: QMAX
  2125. ! real,DIMENSION(ITLO:ITHI,22),INTENT(INOUT) :: QTOT
  2126. ! real,INTENT(INOUT) :: PRECtot(2),PRECmax(2)
  2127. real,INTENT(IN) :: DT,GSMDT
  2128. LOGICAL,INTENT(IN) :: allowed_to_read,restart
  2129. !
  2130. !-----------------------------------------------------------------------
  2131. ! LOCAL VARIABLES
  2132. !-----------------------------------------------------------------------
  2133. REAL :: BBFR,DTPH,PI,DX,Thour_print
  2134. INTEGER :: I,IM,J,L,K,JTF,KTF,ITF
  2135. INTEGER :: etampnew_unit1
  2136. LOGICAL, PARAMETER :: PRINT_diag=.FALSE.
  2137. LOGICAL :: opened
  2138. LOGICAL , EXTERNAL :: wrf_dm_on_monitor
  2139. CHARACTER*80 errmess
  2140. !
  2141. !-----------------------------------------------------------------------
  2142. !
  2143. JTF=MIN0(JTE,JDE-1)
  2144. KTF=MIN0(KTE,KDE-1)
  2145. ITF=MIN0(ITE,IDE-1)
  2146. !
  2147. DO J=JTS,JTF
  2148. DO I=ITS,ITF
  2149. LOWLYR(I,J)=1
  2150. ENDDO
  2151. ENDDO
  2152. !
  2153. IF(.NOT.RESTART)THEN
  2154. DO J = jts,jte
  2155. DO K = kts,kte
  2156. DO I= its,ite
  2157. F_ICE_PHY(i,k,j)=0.
  2158. F_RAIN_PHY(i,k,j)=0.
  2159. F_RIMEF_PHY(i,k,j)=1.
  2160. ENDDO
  2161. ENDDO
  2162. ENDDO
  2163. ENDIF
  2164. !
  2165. !-----------------------------------------------------------------------
  2166. IF(ALLOWED_TO_READ)THEN
  2167. !-----------------------------------------------------------------------
  2168. !
  2169. DX=((DELX)**2+(DELY)**2)**.5/1000. ! Model resolution at equator (km)
  2170. DX=MIN(100., MAX(5., DX) )
  2171. !
  2172. !-- Relative humidity threshold for the onset of grid-scale condensation
  2173. !!-- 9/1/01: Assume the following functional dependence for 5 - 100 km resolution:
  2174. !! RHgrd=0.90 for dx=100 km, 0.98 for dx=5 km, where
  2175. ! RHgrd=0.90+.08*((100.-DX)/95.)**.5
  2176. !
  2177. DTPH=MAX(GSMDT*60.,DT)
  2178. DTPH=NINT(DTPH/DT)*DT
  2179. !
  2180. !--- Create lookup tables for saturation vapor pressure w/r/t water & ice
  2181. !
  2182. CALL GPVS
  2183. !
  2184. !--- Read in various lookup tables
  2185. !
  2186. IF ( wrf_dm_on_monitor() ) THEN
  2187. DO i = 31,99
  2188. INQUIRE ( i , OPENED = opened )
  2189. IF ( .NOT. opened ) THEN
  2190. etampnew_unit1 = i
  2191. GOTO 2061
  2192. ENDIF
  2193. ENDDO
  2194. etampnew_unit1 = -1
  2195. 2061 CONTINUE
  2196. ENDIF
  2197. !
  2198. CALL wrf_dm_bcast_bytes ( etampnew_unit1 , IWORDSIZE )
  2199. !
  2200. IF ( etampnew_unit1 < 0 ) THEN
  2201. CALL wrf_error_fatal ( 'module_mp_etanew: ETANEWinit: Can not find '// &
  2202. 'unused fortran unit to read in lookup table.' )
  2203. ENDIF
  2204. !
  2205. IF ( wrf_dm_on_monitor() ) THEN
  2206. OPEN(UNIT=etampnew_unit1,FILE="ETAMPNEW_DATA.expanded_rain", &
  2207. & FORM="UNFORMATTED",STATUS="OLD",ERR=9061)
  2208. !
  2209. READ(etampnew_unit1) VENTR1
  2210. READ(etampnew_unit1) VENTR2
  2211. READ(etampnew_unit1) ACCRR
  2212. READ(etampnew_unit1) MASSR
  2213. READ(etampnew_unit1) VRAIN
  2214. READ(etampnew_unit1) RRATE
  2215. READ(etampnew_unit1) VENTI1
  2216. READ(etampnew_unit1) VENTI2
  2217. READ(etampnew_unit1) ACCRI
  2218. READ(etampnew_unit1) MASSI
  2219. READ(etampnew_unit1) VSNOWI
  2220. READ(etampnew_unit1) VEL_RF
  2221. CLOSE (etampnew_unit1)
  2222. ENDIF
  2223. !
  2224. CALL wrf_dm_bcast_bytes ( VENTR1 , size ( VENTR1 ) * RWORDSIZE )
  2225. CALL wrf_dm_bcast_bytes ( VENTR2 , size ( VENTR2 ) * RWORDSIZE )
  2226. CALL wrf_dm_bcast_bytes ( ACCRR , size ( ACCRR ) * RWORDSIZE )
  2227. CALL wrf_dm_bcast_bytes ( MASSR , size ( MASSR ) * RWORDSIZE )
  2228. CALL wrf_dm_bcast_bytes ( VRAIN , size ( VRAIN ) * RWORDSIZE )
  2229. CALL wrf_dm_bcast_bytes ( RRATE , size ( RRATE ) * RWORDSIZE )
  2230. CALL wrf_dm_bcast_bytes ( VENTI1 , size ( VENTI1 ) * RWORDSIZE )
  2231. CALL wrf_dm_bcast_bytes ( VENTI2 , size ( VENTI2 ) * RWORDSIZE )
  2232. CALL wrf_dm_bcast_bytes ( ACCRI , size ( ACCRI ) * RWORDSIZE )
  2233. CALL wrf_dm_bcast_bytes ( MASSI , size ( MASSI ) * RWORDSIZE )
  2234. CALL wrf_dm_bcast_bytes ( VSNOWI , size ( VSNOWI ) * RWORDSIZE )
  2235. CALL wrf_dm_bcast_bytes ( VEL_RF , size ( VEL_RF ) * RWORDSIZE )
  2236. !
  2237. !--- Calculates coefficients for growth rates of ice nucleated in water
  2238. ! saturated conditions, scaled by physics time step (lookup table)
  2239. !
  2240. CALL MY_GROWTH_RATES (DTPH)
  2241. ! CALL MY_GROWTH_RATES (DTPH,MY_GROWTH)
  2242. !
  2243. PI=ACOS(-1.)
  2244. !
  2245. !--- Constants associated with Biggs (1953) freezing of rain, as parameterized
  2246. ! following Lin et al. (JCAM, 1983) & Reisner et al. (1998, QJRMS).
  2247. !
  2248. ABFR=-0.66
  2249. BBFR=100.
  2250. CBFR=20.*PI*PI*BBFR*RHOL*1.E-21
  2251. !
  2252. !--- CIACW is used in calculating riming rates
  2253. ! The assumed effective collection efficiency of cloud water rimed onto
  2254. ! ice is =0.1 :
  2255. !
  2256. CIACW=0.1*DTPH*0.25*PI*(1.E5)**C1
  2257. !
  2258. !--- CIACR is used in calculating freezing of rain colliding with large ice
  2259. ! The assumed collection efficiency is 0.5
  2260. !
  2261. CIACR=0.5*PI*DTPH
  2262. !
  2263. !--- Based on rain lookup tables for mean diameters from 0.05 to 1.0 mm
  2264. ! * Four different functional relationships of mean drop diameter as
  2265. ! a function of rain rate (RR), derived based on simple fits to
  2266. ! mass-weighted fall speeds of rain as functions of mean diameter
  2267. ! from the lookup tables.
  2268. !
  2269. RR_DRmin=N0r0*RRATE(MDRmin) ! RR for mean drop diameter of .05 mm
  2270. RR_DR1=N0r0*RRATE(MDR1) ! RR for mean drop diameter of .10 mm
  2271. RR_DR2=N0r0*RRATE(MDR2) ! RR for mean drop diameter of .20 mm
  2272. RR_DR3=N0r0*RRATE(MDR3) ! RR for mean drop diameter of .32 mm
  2273. RR_DR4=N0r0*RRATE(MDR4) ! RR for mean drop diameter of .45 mm
  2274. RR_DR5=N0r0*RRATE(MDR5) ! RR for mean drop diameter of .675 mm
  2275. !
  2276. RQR_DRmin=N0r0*MASSR(MDRmin) ! Rain content for mean drop diameter of .05 mm
  2277. ! RQR_DR1=N0r0*MASSR(MDR1) ! Rain content for mean drop diameter of .10 mm
  2278. ! RQR_DR2=N0r0*MASSR(MDR2) ! Rain content for mean drop diameter of .20 mm
  2279. ! RQR_DR3=N0r0*MASSR(MDR3) ! Rain content for mean drop diameter of .32 mm
  2280. ! RQR_DR4=N0r0*MASSR(MDR4) ! Rain content for mean drop diameter of .45 mm
  2281. ! RQR_DR5=N0r0*MASSR(MDR5) ! Rain content for mean drop diameter of .675 mm
  2282. RQR_DRmax=N0r0*MASSR(MDRmax) ! Rain content for mean drop diameter of .45 mm
  2283. C_N0r0=PI*RHOL*N0r0
  2284. CN0r0=1.E6/C_N0r0**.25
  2285. CN0r_DMRmin=1./(PI*RHOL*DMRmin**4)
  2286. CN0r_DMRmax=1./(PI*RHOL*DMRmax**4)
  2287. !
  2288. !--- CRACW is used in calculating collection of cloud water by rain (an
  2289. ! assumed collection efficiency of 0.1)
  2290. !
  2291. CRACW=0.1*DTPH*0.25*PI
  2292. !
  2293. ESW0=1000.*FPVS0(T0C) ! Saturation vapor pressure at 0C
  2294. RFmax=1.1**Nrime ! Maximum rime factor allowed
  2295. !
  2296. !------------------------------------------------------------------------
  2297. !--------------- Constants passed through argument list -----------------
  2298. !------------------------------------------------------------------------
  2299. !
  2300. !--- Important parameters for self collection (autoconversion) of
  2301. ! cloud water to rain.
  2302. !
  2303. !--- CRAUT is proportional to the rate that cloud water is converted by
  2304. ! self collection to rain (autoconversion rate)
  2305. !
  2306. CRAUT=1.-EXP(-1.E-3*DTPH)
  2307. !
  2308. !--- QAUT0 is the threshold cloud content for autoconversion to rain
  2309. ! needed for droplets to reach a diameter of 20 microns (following
  2310. ! Manton and Cotton, 1977; Banta and Hanson, 1987, JCAM)
  2311. !--- QAUT0=1.2567, 0.8378, or 0.4189 g/m**3 for droplet number concentrations
  2312. ! of 300, 200, and 100 cm**-3, respectively
  2313. !
  2314. QAUT0=PI*RHOL*NCW*(20.E-6)**3/6.
  2315. !
  2316. !--- For calculating snow optical depths by considering bulk density of
  2317. ! snow based on emails from Q. Fu (6/27-28/01), where optical
  2318. ! depth (T) = 1.5*SWP/(Reff*DENS), SWP is snow water path, Reff
  2319. ! is effective radius, and DENS is the bulk density of snow.
  2320. !
  2321. ! SWP (kg/m**2)=(1.E-3 kg/g)*SWPrad, SWPrad in g/m**2 used in radiation
  2322. ! T = 1.5*1.E3*SWPrad/(Reff*DENS)
  2323. !
  2324. ! See derivation for MASSI(INDEXS), note equal to RHO*QSNOW/NSNOW
  2325. !
  2326. ! SDENS=1.5e3/DENS, DENS=MASSI(INDEXS)/[PI*(1.E-6*INDEXS)**3]
  2327. !
  2328. DO I=MDImin,MDImax
  2329. SDENS(I)=PI*1.5E-15*FLOAT(I*I*I)/MASSI(I)
  2330. ENDDO
  2331. !
  2332. Thour_print=-DTPH/3600.
  2333. ! SH 0211/2002
  2334. ! IF (PRINT_diag) THEN
  2335. !-------- Total and maximum quantities
  2336. !
  2337. ! NSTATS=0 ! Microphysical statistics dealing w/ grid-point counts
  2338. ! QMAX=0. ! Microphysical statistics dealing w/ hydrometeor mass
  2339. ! QTOT=0. ! Microphysical statistics dealing w/ hydrometeor mass
  2340. ! PRECmax=0. ! Maximum precip rates (rain, snow) at surface (mm/h)
  2341. ! PRECtot=0. ! Total precipitation (rain, snow) accumulation at surface
  2342. ! ENDIF
  2343. !wrf
  2344. IF(.NOT.RESTART)THEN
  2345. MP_RESTART_STATE(MY_T1:MY_T2)=MY_GROWTH(MY_T1:MY_T2)
  2346. MP_RESTART_STATE(MY_T2+1)=C1XPVS0
  2347. MP_RESTART_STATE(MY_T2+2)=C2XPVS0
  2348. MP_RESTART_STATE(MY_T2+3)=C1XPVS
  2349. MP_RESTART_STATE(MY_T2+4)=C2XPVS
  2350. MP_RESTART_STATE(MY_T2+5)=CIACW
  2351. MP_RESTART_STATE(MY_T2+6)=CIACR
  2352. MP_RESTART_STATE(MY_T2+7)=CRACW
  2353. MP_RESTART_STATE(MY_T2+8)=CRAUT
  2354. TBPVS_STATE(1:NX) =TBPVS(1:NX)
  2355. TBPVS0_STATE(1:NX)=TBPVS0(1:NX)
  2356. ENDIF
  2357. ENDIF ! Allowed_to_read
  2358. RETURN
  2359. !
  2360. !-----------------------------------------------------------------------
  2361. !
  2362. 9061 CONTINUE
  2363. WRITE( errmess , '(A,I4)' ) &
  2364. 'module_mp_etanew: error opening ETAMPNEW_DATA.expanded_rain on unit ' &
  2365. &, etampnew_unit1
  2366. CALL wrf_error_fatal(errmess)
  2367. !
  2368. !-----------------------------------------------------------------------
  2369. END SUBROUTINE ETANEWinit
  2370. !
  2371. SUBROUTINE MY_GROWTH_RATES (DTPH)
  2372. ! SUBROUTINE MY_GROWTH_RATES (DTPH,MY_GROWTH)
  2373. !
  2374. !--- Below are tabulated values for the predicted mass of ice crystals
  2375. ! after 600 s of growth in water saturated conditions, based on
  2376. ! calculations from Miller and Young (JAS, 1979). These values are
  2377. ! crudely estimated from tabulated curves at 600 s from Fig. 6.9 of
  2378. ! Young (1993). Values at temperatures colder than -27C were
  2379. ! assumed to be invariant with temperature.
  2380. !
  2381. !--- Used to normalize Miller & Young (1979) calculations of ice growth
  2382. ! over large time steps using their tabulated values at 600 s.
  2383. ! Assumes 3D growth with time**1.5 following eq. (6.3) in Young (1993).
  2384. !
  2385. IMPLICIT NONE
  2386. !
  2387. REAL,INTENT(IN) :: DTPH
  2388. !
  2389. REAL DT_ICE
  2390. REAL,DIMENSION(35) :: MY_600
  2391. !WRF
  2392. !
  2393. !-----------------------------------------------------------------------
  2394. DATA MY_600 / &
  2395. & 5.5e-8, 1.4E-7, 2.8E-7, 6.E-7, 3.3E-6, &
  2396. & 2.E-6, 9.E-7, 8.8E-7, 8.2E-7, 9.4e-7, &
  2397. & 1.2E-6, 1.85E-6, 5.5E-6, 1.5E-5, 1.7E-5, &
  2398. & 1.5E-5, 1.E-5, 3.4E-6, 1.85E-6, 1.35E-6, &
  2399. & 1.05E-6, 1.E-6, 9.5E-7, 9.0E-7, 9.5E-7, &
  2400. & 9.5E-7, 9.E-7, 9.E-7, 9.E-7, 9.E-7, &
  2401. & 9.E-7, 9.E-7, 9.E-7, 9.E-7, 9.E-7 / ! -31 to -35 deg C
  2402. !
  2403. !-----------------------------------------------------------------------
  2404. !
  2405. if ( DTPH .ge. 0.0 ) then
  2406. DT_ICE=(DTPH/600.)**1.5
  2407. MY_GROWTH=DT_ICE*MY_600*1.e-3 ! Convert from g to kg
  2408. else
  2409. my_growth = 0.0
  2410. endif
  2411. !
  2412. !-----------------------------------------------------------------------
  2413. !
  2414. END SUBROUTINE MY_GROWTH_RATES
  2415. !
  2416. !-----------------------------------------------------------------------
  2417. !--------- Old GFS saturation vapor pressure lookup tables -----------
  2418. !-----------------------------------------------------------------------
  2419. !
  2420. SUBROUTINE GPVS
  2421. ! ******************************************************************
  2422. !$$$ SUBPROGRAM DOCUMENTATION BLOCK
  2423. ! . . .
  2424. ! SUBPROGRAM: GPVS COMPUTE SATURATION VAPOR PRESSURE TABLE
  2425. ! AUTHOR: N PHILLIPS W/NP2 DATE: 30 DEC 82
  2426. !
  2427. ! ABSTRACT: COMPUTE SATURATION VAPOR PRESSURE TABLE AS A FUNCTION OF
  2428. ! TEMPERATURE FOR THE TABLE LOOKUP FUNCTION FPVS.
  2429. ! EXACT SATURATION VAPOR PRESSURES ARE CALCULATED IN SUBPROGRAM FPVSX.
  2430. ! THE CURRENT IMPLEMENTATION COMPUTES A TABLE WITH A LENGTH
  2431. ! OF 7501 FOR TEMPERATURES RANGING FROM 180.0 TO 330.0 KELVIN.
  2432. !
  2433. ! PROGRAM HISTORY LOG:
  2434. ! 91-05-07 IREDELL
  2435. ! 94-12-30 IREDELL EXPAND TABLE
  2436. ! 96-02-19 HONG ICE EFFECT
  2437. ! 01-11-29 JIN MODIFIED FOR WRF
  2438. !
  2439. ! USAGE: CALL GPVS
  2440. !
  2441. ! SUBPROGRAMS CALLED:
  2442. ! (FPVSX) - INLINABLE FUNCTION TO COMPUTE SATURATION VAPOR PRESSURE
  2443. !
  2444. ! COMMON BLOCKS:
  2445. ! COMPVS - SCALING PARAMETERS AND TABLE FOR FUNCTION FPVS.
  2446. !
  2447. ! ATTRIBUTES:
  2448. ! LANGUAGE: FORTRAN 90
  2449. !
  2450. !$$$
  2451. IMPLICIT NONE
  2452. real :: X,XINC,T
  2453. integer :: JX
  2454. !----------------------------------------------------------------------
  2455. XINC=(XMAX-XMIN)/(NX-1)
  2456. C1XPVS=1.-XMIN/XINC
  2457. C2XPVS=1./XINC
  2458. C1XPVS0=1.-XMIN/XINC
  2459. C2XPVS0=1./XINC
  2460. !
  2461. DO JX=1,NX
  2462. X=XMIN+(JX-1)*XINC
  2463. T=X
  2464. TBPVS(JX)=FPVSX(T)
  2465. TBPVS0(JX)=FPVSX0(T)
  2466. ENDDO
  2467. !
  2468. END SUBROUTINE GPVS
  2469. !-----------------------------------------------------------------------
  2470. !***********************************************************************
  2471. !-----------------------------------------------------------------------
  2472. REAL FUNCTION FPVS(T)
  2473. !-----------------------------------------------------------------------
  2474. !$$$ SUBPROGRAM DOCUMENTATION BLOCK
  2475. ! . . .
  2476. ! SUBPROGRAM: FPVS COMPUTE SATURATION VAPOR PRESSURE
  2477. ! AUTHOR: N PHILLIPS W/NP2 DATE: 30 DEC 82
  2478. !
  2479. ! ABSTRACT: COMPUTE SATURATION VAPOR PRESSURE FROM THE TEMPERATURE.
  2480. ! A LINEAR INTERPOLATION IS DONE BETWEEN VALUES IN A LOOKUP TABLE
  2481. ! COMPUTED IN GPVS. SEE DOCUMENTATION FOR FPVSX FOR DETAILS.
  2482. ! INPUT VALUES OUTSIDE TABLE RANGE ARE RESET TO TABLE EXTREMA.
  2483. ! THE INTERPOLATION ACCURACY IS ALMOST 6 DECIMAL PLACES.
  2484. ! ON THE CRAY, FPVS IS ABOUT 4 TIMES FASTER THAN EXACT CALCULATION.
  2485. ! THIS FUNCTION SHOULD BE EXPANDED INLINE IN THE CALLING ROUTINE.
  2486. !
  2487. ! PROGRAM HISTORY LOG:
  2488. ! 91-05-07 IREDELL MADE INTO INLINABLE FUNCTION
  2489. ! 94-12-30 IREDELL EXPAND TABLE
  2490. ! 96-02-19 HONG ICE EFFECT
  2491. ! 01-11-29 JIN MODIFIED FOR WRF
  2492. !
  2493. ! USAGE: PVS=FPVS(T)
  2494. !
  2495. ! INPUT ARGUMENT LIST:
  2496. ! T - REAL TEMPERATURE IN KELVIN
  2497. !
  2498. ! OUTPUT ARGUMENT LIST:
  2499. ! FPVS - REAL SATURATION VAPOR PRESSURE IN KILOPASCALS (CB)
  2500. !
  2501. ! ATTRIBUTES:
  2502. ! LANGUAGE: FORTRAN 90
  2503. !$$$
  2504. IMPLICIT NONE
  2505. real,INTENT(IN) :: T
  2506. real XJ
  2507. integer :: JX
  2508. !-----------------------------------------------------------------------
  2509. XJ=MIN(MAX(C1XPVS+C2XPVS*T,1.),FLOAT(NX))
  2510. JX=MIN(XJ,NX-1.)
  2511. FPVS=TBPVS(JX)+(XJ-JX)*(TBPVS(JX+1)-TBPVS(JX))
  2512. !
  2513. END FUNCTION FPVS
  2514. !-----------------------------------------------------------------------
  2515. !-----------------------------------------------------------------------
  2516. REAL FUNCTION FPVS0(T)
  2517. !-----------------------------------------------------------------------
  2518. IMPLICIT NONE
  2519. real,INTENT(IN) :: T
  2520. real :: XJ1
  2521. integer :: JX1
  2522. !-----------------------------------------------------------------------
  2523. XJ1=MIN(MAX(C1XPVS0+C2XPVS0*T,1.),FLOAT(NX))
  2524. JX1=MIN(XJ1,NX-1.)
  2525. FPVS0=TBPVS0(JX1)+(XJ1-JX1)*(TBPVS0(JX1+1)-TBPVS0(JX1))
  2526. !
  2527. END FUNCTION FPVS0
  2528. !-----------------------------------------------------------------------
  2529. !***********************************************************************
  2530. !-----------------------------------------------------------------------
  2531. REAL FUNCTION FPVSX(T)
  2532. !-----------------------------------------------------------------------
  2533. !$$$ SUBPROGRAM DOCUMENTATION BLOCK
  2534. ! . . .
  2535. ! SUBPROGRAM: FPVSX COMPUTE SATURATION VAPOR PRESSURE
  2536. ! AUTHOR: N PHILLIPS W/NP2 DATE: 30 DEC 82
  2537. !
  2538. ! ABSTRACT: EXACTLY COMPUTE SATURATION VAPOR PRESSURE FROM TEMPERATURE.
  2539. ! THE WATER MODEL ASSUMES A PERFECT GAS, CONSTANT SPECIFIC HEATS
  2540. ! FOR GAS AND LIQUID, AND NEGLECTS THE VOLUME OF THE LIQUID.
  2541. ! THE MODEL DOES ACCOUNT FOR THE VARIATION OF THE LATENT HEAT
  2542. ! OF CONDENSATION WITH TEMPERATURE. THE ICE OPTION IS NOT INCLUDED.
  2543. ! THE CLAUSIUS-CLAPEYRON EQUATION IS INTEGRATED FROM THE TRIPLE POINT
  2544. ! TO GET THE FORMULA
  2545. ! PVS=PSATK*(TR**XA)*EXP(XB*(1.-TR))
  2546. ! WHERE TR IS TTP/T AND OTHER VALUES ARE PHYSICAL CONSTANTS
  2547. ! THIS FUNCTION SHOULD BE EXPANDED INLINE IN THE CALLING ROUTINE.
  2548. !
  2549. ! PROGRAM HISTORY LOG:
  2550. ! 91-05-07 IREDELL MADE INTO INLINABLE FUNCTION
  2551. ! 94-12-30 IREDELL EXACT COMPUTATION
  2552. ! 96-02-19 HONG ICE EFFECT
  2553. ! 01-11-29 JIN MODIFIED FOR WRF
  2554. !
  2555. ! USAGE: PVS=FPVSX(T)
  2556. ! REFERENCE: EMANUEL(1994),116-117
  2557. !
  2558. ! INPUT ARGUMENT LIST:
  2559. ! T - REAL TEMPERATURE IN KELVIN
  2560. !
  2561. ! OUTPUT ARGUMENT LIST:
  2562. ! FPVSX - REAL SATURATION VAPOR PRESSURE IN KILOPASCALS (CB)
  2563. !
  2564. ! ATTRIBUTES:
  2565. ! LANGUAGE: FORTRAN 90
  2566. !$$$
  2567. IMPLICIT NONE
  2568. !-----------------------------------------------------------------------
  2569. real, parameter :: TTP=2.7316E+2,HVAP=2.5000E+6,PSAT=6.1078E+2 &
  2570. , CLIQ=4.1855E+3,CVAP= 1.8460E+3 &
  2571. , CICE=2.1060E+3,HSUB=2.8340E+6
  2572. !
  2573. real, parameter :: PSATK=PSAT*1.E-3
  2574. real, parameter :: DLDT=CVAP-CLIQ,XA=-DLDT/RV,XB=XA+HVAP/(RV*TTP)
  2575. real, parameter :: DLDTI=CVAP-CICE &
  2576. , XAI=-DLDTI/RV,XBI=XAI+HSUB/(RV*TTP)
  2577. real T,TR
  2578. !-----------------------------------------------------------------------
  2579. TR=TTP/T
  2580. !
  2581. IF(T.GE.TTP)THEN
  2582. FPVSX=PSATK*(TR**XA)*EXP(XB*(1.-TR))
  2583. ELSE
  2584. FPVSX=PSATK*(TR**XAI)*EXP(XBI*(1.-TR))
  2585. ENDIF
  2586. !
  2587. END FUNCTION FPVSX
  2588. !-----------------------------------------------------------------------
  2589. !-----------------------------------------------------------------------
  2590. REAL FUNCTION FPVSX0(T)
  2591. !-----------------------------------------------------------------------
  2592. IMPLICIT NONE
  2593. real,parameter :: TTP=2.7316E+2,HVAP=2.5000E+6,PSAT=6.1078E+2 &
  2594. , CLIQ=4.1855E+3,CVAP=1.8460E+3 &
  2595. , CICE=2.1060E+3,HSUB=2.8340E+6
  2596. real,PARAMETER :: PSATK=PSAT*1.E-3
  2597. real,PARAMETER :: DLDT=CVAP-CLIQ,XA=-DLDT/RV,XB=XA+HVAP/(RV*TTP)
  2598. real,PARAMETER :: DLDTI=CVAP-CICE &
  2599. , XAI=-DLDT/RV,XBI=XA+HSUB/(RV*TTP)
  2600. real :: T,TR
  2601. !-----------------------------------------------------------------------
  2602. TR=TTP/T
  2603. FPVSX0=PSATK*(TR**XA)*EXP(XB*(1.-TR))
  2604. !
  2605. END FUNCTION FPVSX0
  2606. !
  2607. END MODULE module_mp_etanew