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

/wrfv2_fire/phys/module_mp_etaold.F

http://github.com/jbeezley/wrf-fire
FORTRAN Legacy | 2623 lines | 1252 code | 57 blank | 1314 comment | 0 complexity | 1107106501dbbdf586b4326629c06084 MD5 | raw file
Possible License(s): AGPL-1.0
  1. !WRF:MODEL_MP:PHYSICS
  2. !
  3. MODULE module_mp_etaold
  4. !
  5. !-----------------------------------------------------------------------
  6. REAL,PRIVATE,SAVE :: ABFR, CBFR, CIACW, CIACR, C_N0r0, &
  7. & CN0r0, CN0r_DMRmin, CN0r_DMRmax, CRACW, CRAUT, ESW0, &
  8. & RFmax, RQR_DR1, RQR_DR2, RQR_DR3, RQR_DRmin, &
  9. & RQR_DRmax, RR_DRmin, RR_DR1, RR_DR2, RR_DR3, RR_DRmax
  10. !
  11. INTEGER, PRIVATE,PARAMETER :: MY_T1=1, MY_T2=35
  12. REAL,PRIVATE,DIMENSION(MY_T1:MY_T2),SAVE :: MY_GROWTH
  13. !
  14. REAL, PRIVATE,PARAMETER :: DMImin=.05e-3, DMImax=1.e-3, &
  15. & DelDMI=1.e-6,XMImin=1.e6*DMImin
  16. INTEGER, PUBLIC,PARAMETER :: XMImax=1.e6*DMImax, XMIexp=.0536, &
  17. & MDImin=XMImin, MDImax=XMImax
  18. REAL, PRIVATE,DIMENSION(MDImin:MDImax) :: &
  19. & ACCRI,SDENS,VSNOWI,VENTI1,VENTI2
  20. !
  21. REAL, PRIVATE,PARAMETER :: DMRmin=.05e-3, DMRmax=.45e-3, &
  22. & DelDMR=1.e-6,XMRmin=1.e6*DMRmin, XMRmax=1.e6*DMRmax
  23. INTEGER, PRIVATE,PARAMETER :: MDRmin=XMRmin, MDRmax=XMRmax
  24. REAL, PRIVATE,DIMENSION(MDRmin:MDRmax):: &
  25. & ACCRR,MASSR,RRATE,VRAIN,VENTR1,VENTR2
  26. !
  27. INTEGER, PRIVATE,PARAMETER :: Nrime=40
  28. REAL, DIMENSION(2:9,0:Nrime),PRIVATE,SAVE :: VEL_RF
  29. !
  30. INTEGER,PARAMETER :: NX=7501
  31. REAL, PARAMETER :: XMIN=180.0,XMAX=330.0
  32. REAL, DIMENSION(NX),SAVE :: TBPVS,TBPVS0
  33. REAL, SAVE :: C1XPVS0,C2XPVS0,C1XPVS,C2XPVS
  34. !
  35. REAL, PRIVATE,PARAMETER :: &
  36. !--- Physical constants follow:
  37. & CP=1004.6, EPSQ=1.E-12, GRAV=9.806, RHOL=1000., RD=287.04 &
  38. & ,RV=461.5, T0C=273.15, XLS=2.834E6 &
  39. !--- Derived physical constants follow:
  40. & ,EPS=RD/RV, EPS1=RV/RD-1., EPSQ1=1.001*EPSQ &
  41. & ,RCP=1./CP, RCPRV=RCP/RV, RGRAV=1./GRAV, RRHOL=1./RHOL &
  42. & ,XLS1=XLS*RCP, XLS2=XLS*XLS*RCPRV, XLS3=XLS*XLS/RV &
  43. !--- Constants specific to the parameterization follow:
  44. !--- CLIMIT/CLIMIT1 are lower limits for treating accumulated precipitation
  45. & ,CLIMIT=10.*EPSQ, CLIMIT1=-CLIMIT &
  46. & ,C1=1./3. &
  47. & ,DMR1=.1E-3, DMR2=.2E-3, DMR3=.32E-3 &
  48. & ,XMR1=1.e6*DMR1, XMR2=1.e6*DMR2, XMR3=1.e6*DMR3
  49. INTEGER, PARAMETER :: MDR1=XMR1, MDR2=XMR2, MDR3=XMR3
  50. !
  51. ! ======================================================================
  52. !--- Important tunable parameters that are exported to other modules
  53. ! * RHgrd - threshold relative humidity for onset of condensation
  54. ! * T_ICE - temperature (C) threshold at which all remaining liquid water
  55. ! is glaciated to ice
  56. ! * T_ICE_init - maximum temperature (C) at which ice nucleation occurs
  57. ! * NLImax - maximum number concentrations (m**-3) of large ice (snow/graupel/sleet)
  58. ! * NLImin - minimum number concentrations (m**-3) of large ice (snow/graupel/sleet)
  59. ! * N0r0 - assumed intercept (m**-4) of rain drops if drop diameters are between 0.2 and 0.45 mm
  60. ! * N0rmin - minimum intercept (m**-4) for rain drops
  61. ! * NCW - number concentrations of cloud droplets (m**-3)
  62. ! * FLARGE1, FLARGE2 - number fraction of large ice to total (large+snow) ice
  63. ! at T>0C and in presence of sublimation (FLARGE1), otherwise in
  64. ! presence of ice saturated/supersaturated conditions
  65. ! ======================================================================
  66. REAL, PUBLIC,PARAMETER :: &
  67. & RHgrd=1. &
  68. & ,T_ICE=-40. &
  69. & ,T_ICEK=T0C+T_ICE &
  70. & ,T_ICE_init=-5. &
  71. & ,NLImax=5.E3 &
  72. & ,NLImin=1.E3 &
  73. & ,N0r0=8.E6 &
  74. & ,N0rmin=1.E4 &
  75. & ,NCW=100.E6 &
  76. & ,FLARGE1=1. &
  77. & ,FLARGE2=.03 ! Improved simulated GOES radiances
  78. !--- Other public variables passed to other routines:
  79. REAL,PUBLIC,SAVE :: QAUT0
  80. REAL, PUBLIC,DIMENSION(MDImin:MDImax) :: MASSI
  81. !
  82. !
  83. CONTAINS
  84. !-----------------------------------------------------------------------
  85. !-----------------------------------------------------------------------
  86. SUBROUTINE ETAMP_OLD (itimestep,DT,DX,DY, &
  87. & dz8w,rho_phy,p_phy,pi_phy,th_phy,qv,qt, &
  88. & LOWLYR,SR, &
  89. & F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, &
  90. & QC,QR,QS, &
  91. & mp_restart_state,tbpvs_state,tbpvs0_state, &
  92. & RAINNC,RAINNCV, &
  93. & ids,ide, jds,jde, kds,kde, &
  94. & ims,ime, jms,jme, kms,kme, &
  95. & its,ite, jts,jte, kts,kte )
  96. !-----------------------------------------------------------------------
  97. IMPLICIT NONE
  98. !-----------------------------------------------------------------------
  99. INTEGER, PARAMETER :: ITLO=-60, ITHI=40
  100. INTEGER,INTENT(IN) :: IDS,IDE,JDS,JDE,KDS,KDE &
  101. & ,IMS,IME,JMS,JME,KMS,KME &
  102. & ,ITS,ITE,JTS,JTE,KTS,KTE &
  103. & ,ITIMESTEP
  104. REAL, INTENT(IN) :: DT,DX,DY
  105. REAL, INTENT(IN), DIMENSION(ims:ime, kms:kme, jms:jme):: &
  106. & dz8w,p_phy,pi_phy,rho_phy
  107. REAL, INTENT(INOUT), DIMENSION(ims:ime, kms:kme, jms:jme):: &
  108. & th_phy,qv,qt
  109. REAL, INTENT(INOUT), DIMENSION(ims:ime, kms:kme, jms:jme ) :: &
  110. & qc,qr,qs
  111. REAL, INTENT(INOUT), DIMENSION(ims:ime, kms:kme, jms:jme ) :: &
  112. & F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY
  113. REAL, INTENT(INOUT), DIMENSION(ims:ime,jms:jme) :: &
  114. & RAINNC,RAINNCV
  115. REAL, INTENT(OUT), DIMENSION(ims:ime,jms:jme):: SR
  116. !
  117. REAL,DIMENSION(*),INTENT(INOUT) :: MP_RESTART_STATE
  118. !
  119. REAL,DIMENSION(nx),INTENT(INOUT) :: TBPVS_STATE,TBPVS0_STATE
  120. !
  121. INTEGER, DIMENSION( ims:ime, jms:jme ),INTENT(INOUT) :: LOWLYR
  122. !-----------------------------------------------------------------------
  123. ! LOCAL VARS
  124. !-----------------------------------------------------------------------
  125. ! NSTATS,QMAX,QTOT are diagnostic vars
  126. INTEGER,DIMENSION(ITLO:ITHI,4) :: NSTATS
  127. REAL, DIMENSION(ITLO:ITHI,5) :: QMAX
  128. REAL, DIMENSION(ITLO:ITHI,22):: QTOT
  129. ! SOME VARS WILL BE USED FOR DATA ASSIMILATION (DON'T NEED THEM NOW).
  130. ! THEY ARE TREATED AS LOCAL VARS, BUT WILL BECOME STATE VARS IN THE
  131. ! FUTURE. SO, WE DECLARED THEM AS MEMORY SIZES FOR THE FUTURE USE
  132. ! TLATGS_PHY,TRAIN_PHY,APREC,PREC,ACPREC,SR are not directly related
  133. ! the microphysics scheme. Instead, they will be used by Eta precip
  134. ! assimilation.
  135. REAL, DIMENSION( ims:ime, kms:kme, jms:jme ) :: &
  136. & TLATGS_PHY,TRAIN_PHY
  137. REAL, DIMENSION(ims:ime,jms:jme):: APREC,PREC,ACPREC
  138. REAL, DIMENSION(its:ite, kts:kte, jts:jte):: t_phy
  139. INTEGER :: I,J,K,KFLIP
  140. REAL :: WC
  141. !
  142. !-----------------------------------------------------------------------
  143. !**********************************************************************
  144. !-----------------------------------------------------------------------
  145. !
  146. MY_GROWTH(MY_T1:MY_T2)=MP_RESTART_STATE(MY_T1:MY_T2)
  147. !
  148. C1XPVS0=MP_RESTART_STATE(MY_T2+1)
  149. C2XPVS0=MP_RESTART_STATE(MY_T2+2)
  150. C1XPVS =MP_RESTART_STATE(MY_T2+3)
  151. C2XPVS =MP_RESTART_STATE(MY_T2+4)
  152. CIACW =MP_RESTART_STATE(MY_T2+5)
  153. CIACR =MP_RESTART_STATE(MY_T2+6)
  154. CRACW =MP_RESTART_STATE(MY_T2+7)
  155. CRAUT =MP_RESTART_STATE(MY_T2+8)
  156. !
  157. TBPVS(1:NX) =TBPVS_STATE(1:NX)
  158. TBPVS0(1:NX)=TBPVS0_STATE(1:NX)
  159. !
  160. DO j = jts,jte
  161. DO k = kts,kte
  162. DO i = its,ite
  163. t_phy(i,k,j) = th_phy(i,k,j)*pi_phy(i,k,j)
  164. qv(i,k,j)=qv(i,k,j)/(1.+qv(i,k,j)) !Convert to specific humidity
  165. ENDDO
  166. ENDDO
  167. ENDDO
  168. ! initial diagnostic variables and data assimilation vars
  169. ! (will need to delete this part in the future)
  170. DO k = 1,4
  171. DO i = ITLO,ITHI
  172. NSTATS(i,k)=0.
  173. ENDDO
  174. ENDDO
  175. DO k = 1,5
  176. DO i = ITLO,ITHI
  177. QMAX(i,k)=0.
  178. ENDDO
  179. ENDDO
  180. DO k = 1,22
  181. DO i = ITLO,ITHI
  182. QTOT(i,k)=0.
  183. ENDDO
  184. ENDDO
  185. ! initial data assimilation vars (will need to delete this part in the future)
  186. DO j = jts,jte
  187. DO k = kts,kte
  188. DO i = its,ite
  189. TLATGS_PHY (i,k,j)=0.
  190. TRAIN_PHY (i,k,j)=0.
  191. ENDDO
  192. ENDDO
  193. ENDDO
  194. DO j = jts,jte
  195. DO i = its,ite
  196. ACPREC(i,j)=0.
  197. APREC (i,j)=0.
  198. PREC (i,j)=0.
  199. SR (i,j)=0.
  200. ENDDO
  201. ENDDO
  202. !-- NOTE: ARW QT has been advected, while QR, QS and QC have not
  203. !
  204. !-- Update QT, F_ice, F_rain arrays for WRF NMM only
  205. #if (NMM_CORE==1)
  206. !
  207. !-- NOTE: The total ice array in this code is "QS" because the vast
  208. ! majority of the ice mass is in the form of snow, and using
  209. ! the "QS" array should result in better coupling with the
  210. ! Dudhia SW package. NMM calls microphysics after other
  211. ! physics, so use updated QR, QS and QC to update QT array.
  212. !
  213. DO j = jts,jte
  214. DO k = kts,kte
  215. DO i = its,ite
  216. QT(I,K,J)=QC(I,K,J)+QR(I,K,J)+QS(I,K,J)
  217. IF (QS(I,K,J) <= EPSQ) THEN
  218. F_ICE_PHY(I,K,J)=0.
  219. IF (T_PHY(I,K,J) < T_ICEK) F_ICE_PHY(I,K,J)=1.
  220. ELSE
  221. F_ICE_PHY(I,K,J)=MAX( 0., MIN(1., QS(I,K,J)/QT(I,K,J) ) )
  222. ENDIF
  223. IF (QR(I,K,J) <= EPSQ) THEN
  224. F_RAIN_PHY(I,K,J)=0.
  225. ELSE
  226. F_RAIN_PHY(I,K,J)=QR(I,K,J)/(QC(I,K,J)+QR(I,K,J))
  227. ENDIF
  228. ENDDO
  229. ENDDO
  230. ENDDO
  231. #endif
  232. !-----------------------------------------------------------------------
  233. CALL EGCP01DRV(DT,LOWLYR, &
  234. & APREC,PREC,ACPREC,SR,NSTATS,QMAX,QTOT, &
  235. & dz8w,rho_phy,qt,t_phy,qv,F_ICE_PHY,P_PHY, &
  236. & F_RAIN_PHY,F_RIMEF_PHY,TLATGS_PHY,TRAIN_PHY, &
  237. & ids,ide, jds,jde, kds,kde, &
  238. & ims,ime, jms,jme, kms,kme, &
  239. & its,ite, jts,jte, kts,kte )
  240. !-----------------------------------------------------------------------
  241. DO j = jts,jte
  242. DO k = kts,kte
  243. DO i = its,ite
  244. th_phy(i,k,j) = t_phy(i,k,j)/pi_phy(i,k,j)
  245. qv(i,k,j)=qv(i,k,j)/(1.-qv(i,k,j)) !Convert to mixing ratio
  246. WC=qt(I,K,J)
  247. QS(I,K,J)=0.
  248. QR(I,K,J)=0.
  249. QC(I,K,J)=0.
  250. IF(F_ICE_PHY(I,K,J)>=1.)THEN
  251. QS(I,K,J)=WC
  252. ELSEIF(F_ICE_PHY(I,K,J)<=0.)THEN
  253. QC(I,K,J)=WC
  254. ELSE
  255. QS(I,K,J)=F_ICE_PHY(I,K,J)*WC
  256. QC(I,K,J)=WC-QS(I,K,J)
  257. ENDIF
  258. !
  259. IF(QC(I,K,J)>0..AND.F_RAIN_PHY(I,K,J)>0.)THEN
  260. IF(F_RAIN_PHY(I,K,J).GE.1.)THEN
  261. QR(I,K,J)=QC(I,K,J)
  262. QC(I,K,J)=0.
  263. ELSE
  264. QR(I,K,J)=F_RAIN_PHY(I,K,J)*QC(I,K,J)
  265. QC(I,K,J)=QC(I,K,J)-QR(I,K,J)
  266. ENDIF
  267. ENDIF
  268. ENDDO
  269. ENDDO
  270. ENDDO
  271. !
  272. ! update rain (from m to mm)
  273. DO j=jts,jte
  274. DO i=its,ite
  275. RAINNC(i,j)=APREC(i,j)*1000.+RAINNC(i,j)
  276. RAINNCV(i,j)=APREC(i,j)*1000.
  277. ENDDO
  278. ENDDO
  279. !
  280. MP_RESTART_STATE(MY_T1:MY_T2)=MY_GROWTH(MY_T1:MY_T2)
  281. MP_RESTART_STATE(MY_T2+1)=C1XPVS0
  282. MP_RESTART_STATE(MY_T2+2)=C2XPVS0
  283. MP_RESTART_STATE(MY_T2+3)=C1XPVS
  284. MP_RESTART_STATE(MY_T2+4)=C2XPVS
  285. MP_RESTART_STATE(MY_T2+5)=CIACW
  286. MP_RESTART_STATE(MY_T2+6)=CIACR
  287. MP_RESTART_STATE(MY_T2+7)=CRACW
  288. MP_RESTART_STATE(MY_T2+8)=CRAUT
  289. !
  290. TBPVS_STATE(1:NX) =TBPVS(1:NX)
  291. TBPVS0_STATE(1:NX)=TBPVS0(1:NX)
  292. !-----------------------------------------------------------------------
  293. END SUBROUTINE ETAMP_OLD
  294. !-----------------------------------------------------------------------
  295. SUBROUTINE EGCP01DRV( &
  296. & DTPH,LOWLYR,APREC,PREC,ACPREC,SR, &
  297. & NSTATS,QMAX,QTOT, &
  298. & dz8w,RHO_PHY,CWM_PHY,T_PHY,Q_PHY,F_ICE_PHY,P_PHY, &
  299. & F_RAIN_PHY,F_RIMEF_PHY,TLATGS_PHY,TRAIN_PHY, &
  300. & ids,ide, jds,jde, kds,kde, &
  301. & ims,ime, jms,jme, kms,kme, &
  302. & its,ite, jts,jte, kts,kte)
  303. !-----------------------------------------------------------------------
  304. ! DTPH Physics time step (s)
  305. ! CWM_PHY (qt) Mixing ratio of the total condensate. kg/kg
  306. ! Q_PHY Mixing ratio of water vapor. kg/kg
  307. ! F_RAIN_PHY Fraction of rain.
  308. ! F_ICE_PHY Fraction of ice.
  309. ! F_RIMEF_PHY Mass ratio of rimed ice (rime factor).
  310. !
  311. !TLATGS_PHY,TRAIN_PHY,APREC,PREC,ACPREC,SR are not directly related the
  312. !micrphysics sechme. Instead, they will be used by Eta precip assimilation.
  313. !
  314. !NSTATS,QMAX,QTOT are used for diagnosis purposes.
  315. !
  316. !-----------------------------------------------------------------------
  317. !--- Variables APREC,PREC,ACPREC,SR are calculated for precip assimilation
  318. ! and/or ZHAO's scheme in Eta and are not required by this microphysics
  319. ! scheme itself.
  320. !--- NSTATS,QMAX,QTOT are used for diagnosis purposes only. They will be
  321. ! printed out when PRINT_diag is true.
  322. !
  323. !-----------------------------------------------------------------------
  324. IMPLICIT NONE
  325. !-----------------------------------------------------------------------
  326. !
  327. INTEGER, PARAMETER :: ITLO=-60, ITHI=40
  328. LOGICAL, PARAMETER :: PRINT_diag=.FALSE.
  329. ! VARIABLES PASSED IN/OUT
  330. INTEGER,INTENT(IN ) :: ids,ide, jds,jde, kds,kde &
  331. & ,ims,ime, jms,jme, kms,kme &
  332. & ,its,ite, jts,jte, kts,kte
  333. REAL,INTENT(IN) :: DTPH
  334. INTEGER, DIMENSION( ims:ime, jms:jme ),INTENT(INOUT) :: LOWLYR
  335. INTEGER,DIMENSION(ITLO:ITHI,4),INTENT(INOUT) :: NSTATS
  336. REAL,DIMENSION(ITLO:ITHI,5),INTENT(INOUT) :: QMAX
  337. REAL,DIMENSION(ITLO:ITHI,22),INTENT(INOUT) :: QTOT
  338. REAL,DIMENSION(ims:ime,jms:jme),INTENT(INOUT) :: &
  339. & APREC,PREC,ACPREC,SR
  340. REAL,DIMENSION( its:ite, kts:kte, jts:jte ),INTENT(INOUT) :: t_phy
  341. REAL,DIMENSION( ims:ime, kms:kme, jms:jme ),INTENT(IN) :: &
  342. & dz8w,P_PHY,RHO_PHY
  343. REAL,DIMENSION( ims:ime, kms:kme, jms:jme ),INTENT(INOUT) :: &
  344. & CWM_PHY, F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY,TLATGS_PHY &
  345. & ,Q_PHY,TRAIN_PHY
  346. !
  347. !-----------------------------------------------------------------------
  348. !LOCAL VARIABLES
  349. !-----------------------------------------------------------------------
  350. !
  351. #define CACHE_FRIENDLY_MP_ETAOLD
  352. #ifdef CACHE_FRIENDLY_MP_ETAOLD
  353. # define TEMP_DIMS kts:kte,its:ite,jts:jte
  354. # define TEMP_DEX L,I,J
  355. #else
  356. # define TEMP_DIMS its:ite,jts:jte,kts:kte
  357. # define TEMP_DEX I,J,L
  358. #endif
  359. !
  360. INTEGER :: LSFC,I,J,I_index,J_index,L,K,KFLIP
  361. REAL,DIMENSION(TEMP_DIMS) :: CWM,T,Q,TRAIN,TLATGS,P
  362. REAL,DIMENSION(kts:kte,its:ite,jts:jte) :: F_ice,F_rain,F_RimeF
  363. INTEGER,DIMENSION(its:ite,jts:jte) :: LMH
  364. REAL :: TC,WC,QI,QR,QW,Fice,Frain,DUM,ASNOW,ARAIN
  365. REAL,DIMENSION(kts:kte) :: P_col,Q_col,T_col,QV_col,WC_col, &
  366. RimeF_col,QI_col,QR_col,QW_col, THICK_col,DPCOL
  367. REAL,DIMENSION(2) :: PRECtot,PRECmax
  368. !-----------------------------------------------------------------------
  369. !
  370. DO J=JTS,JTE
  371. DO I=ITS,ITE
  372. LMH(I,J) = KTE-LOWLYR(I,J)+1
  373. ENDDO
  374. ENDDO
  375. DO 98 J=JTS,JTE
  376. DO 98 I=ITS,ITE
  377. DO L=KTS,KTE
  378. KFLIP=KTE+1-L
  379. CWM(TEMP_DEX)=CWM_PHY(I,KFLIP,J)
  380. T(TEMP_DEX)=T_PHY(I,KFLIP,J)
  381. Q(TEMP_DEX)=Q_PHY(I,KFLIP,J)
  382. P(TEMP_DEX)=P_PHY(I,KFLIP,J)
  383. TLATGS(TEMP_DEX)=TLATGS_PHY(I,KFLIP,J)
  384. TRAIN(TEMP_DEX)=TRAIN_PHY(I,KFLIP,J)
  385. F_ice(L,I,J)=F_ice_PHY(I,KFLIP,J)
  386. F_rain(L,I,J)=F_rain_PHY(I,KFLIP,J)
  387. F_RimeF(L,I,J)=F_RimeF_PHY(I,KFLIP,J)
  388. ENDDO
  389. 98 CONTINUE
  390. DO 100 J=JTS,JTE
  391. DO 100 I=ITS,ITE
  392. LSFC=LMH(I,J) ! "L" of surface
  393. !
  394. DO K=KTS,KTE
  395. KFLIP=KTE+1-K
  396. DPCOL(K)=RHO_PHY(I,KFLIP,J)*GRAV*dz8w(I,KFLIP,J)
  397. ENDDO
  398. !
  399. !
  400. !--- Initialize column data (1D arrays)
  401. !
  402. L=1
  403. IF (CWM(TEMP_DEX) .LE. EPSQ) CWM(TEMP_DEX)=EPSQ
  404. F_ice(1,I,J)=1.
  405. F_rain(1,I,J)=0.
  406. F_RimeF(1,I,J)=1.
  407. DO L=1,LSFC
  408. !
  409. !--- Pressure (Pa) = (Psfc-Ptop)*(ETA/ETA_sfc)+Ptop
  410. !
  411. P_col(L)=P(TEMP_DEX)
  412. !
  413. !--- Layer thickness = RHO*DZ = -DP/G = (Psfc-Ptop)*D_ETA/(G*ETA_sfc)
  414. !
  415. THICK_col(L)=DPCOL(L)*RGRAV
  416. T_col(L)=T(TEMP_DEX)
  417. TC=T_col(L)-T0C
  418. QV_col(L)=max(EPSQ, Q(TEMP_DEX))
  419. IF (CWM(TEMP_DEX) .LE. EPSQ1) THEN
  420. WC_col(L)=0.
  421. IF (TC .LT. T_ICE) THEN
  422. F_ice(L,I,J)=1.
  423. ELSE
  424. F_ice(L,I,J)=0.
  425. ENDIF
  426. F_rain(L,I,J)=0.
  427. F_RimeF(L,I,J)=1.
  428. ELSE
  429. WC_col(L)=CWM(TEMP_DEX)
  430. ENDIF
  431. !
  432. !--- Determine composition of condensate in terms of
  433. ! cloud water, ice, & rain
  434. !
  435. WC=WC_col(L)
  436. QI=0.
  437. QR=0.
  438. QW=0.
  439. Fice=F_ice(L,I,J)
  440. Frain=F_rain(L,I,J)
  441. IF (Fice .GE. 1.) THEN
  442. QI=WC
  443. ELSE IF (Fice .LE. 0.) THEN
  444. QW=WC
  445. ELSE
  446. QI=Fice*WC
  447. QW=WC-QI
  448. ENDIF
  449. IF (QW.GT.0. .AND. Frain.GT.0.) THEN
  450. IF (Frain .GE. 1.) THEN
  451. QR=QW
  452. QW=0.
  453. ELSE
  454. QR=Frain*QW
  455. QW=QW-QR
  456. ENDIF
  457. ENDIF
  458. IF (QI .LE. 0.) F_RimeF(L,I,J)=1.
  459. RimeF_col(L)=F_RimeF(L,I,J) ! (real)
  460. QI_col(L)=QI
  461. QR_col(L)=QR
  462. QW_col(L)=QW
  463. ENDDO
  464. !
  465. !#######################################################################
  466. !
  467. !--- Perform the microphysical calculations in this column
  468. !
  469. I_index=I
  470. J_index=J
  471. CALL EGCP01COLUMN ( ARAIN, ASNOW, DTPH, I_index, J_index, LSFC, &
  472. & P_col, QI_col, QR_col, QV_col, QW_col, RimeF_col, T_col, &
  473. & THICK_col, WC_col,KTS,KTE,NSTATS,QMAX,QTOT )
  474. !
  475. !#######################################################################
  476. !
  477. !
  478. !--- Update storage arrays
  479. !
  480. DO L=1,LSFC
  481. TRAIN(TEMP_DEX)=(T_col(L)-T(TEMP_DEX))/DTPH
  482. TLATGS(TEMP_DEX)=T_col(L)-T(TEMP_DEX)
  483. T(TEMP_DEX)=T_col(L)
  484. Q(TEMP_DEX)=QV_col(L)
  485. CWM(TEMP_DEX)=WC_col(L)
  486. !
  487. !--- REAL*4 array storage
  488. !
  489. IF (QI_col(L) .LE. EPSQ) THEN
  490. F_ice(L,I,J)=0.
  491. IF (T_col(L) .LT. T_ICEK) F_ice(L,I,J)=1.
  492. F_RimeF(L,I,J)=1.
  493. ELSE
  494. F_ice(L,I,J)=MAX( 0., MIN(1., QI_col(L)/WC_col(L)) )
  495. F_RimeF(L,I,J)=MAX(1., RimeF_col(L))
  496. ENDIF
  497. IF (QR_col(L) .LE. EPSQ) THEN
  498. DUM=0
  499. ELSE
  500. DUM=QR_col(L)/(QR_col(L)+QW_col(L))
  501. ENDIF
  502. F_rain(L,I,J)=DUM
  503. !
  504. ENDDO
  505. !
  506. !--- Update accumulated precipitation statistics
  507. !
  508. !--- Surface precipitation statistics; SR is fraction of surface
  509. ! precipitation (if >0) associated with snow
  510. !
  511. APREC(I,J)=(ARAIN+ASNOW)*RRHOL ! Accumulated surface precip (depth in m) !<--- Ying
  512. PREC(I,J)=PREC(I,J)+APREC(I,J)
  513. ACPREC(I,J)=ACPREC(I,J)+APREC(I,J)
  514. IF(APREC(I,J) .LT. 1.E-8) THEN
  515. SR(I,J)=0.
  516. ELSE
  517. SR(I,J)=RRHOL*ASNOW/APREC(I,J)
  518. ENDIF
  519. !
  520. !--- Debug statistics
  521. !
  522. IF (PRINT_diag) THEN
  523. PRECtot(1)=PRECtot(1)+ARAIN
  524. PRECtot(2)=PRECtot(2)+ASNOW
  525. PRECmax(1)=MAX(PRECmax(1), ARAIN)
  526. PRECmax(2)=MAX(PRECmax(2), ASNOW)
  527. ENDIF
  528. !#######################################################################
  529. !#######################################################################
  530. !
  531. 100 CONTINUE ! End "I" & "J" loops
  532. DO 101 J=JTS,JTE
  533. DO 101 I=ITS,ITE
  534. DO L=KTS,KTE
  535. KFLIP=KTE+1-L
  536. CWM_PHY(I,KFLIP,J)=CWM(TEMP_DEX)
  537. T_PHY(I,KFLIP,J)=T(TEMP_DEX)
  538. Q_PHY(I,KFLIP,J)=Q(TEMP_DEX)
  539. TLATGS_PHY(I,KFLIP,J)=TLATGS(TEMP_DEX)
  540. TRAIN_PHY(I,KFLIP,J)=TRAIN(TEMP_DEX)
  541. F_ice_PHY(I,KFLIP,J)=F_ice(L,I,J)
  542. F_rain_PHY(I,KFLIP,J)=F_rain(L,I,J)
  543. F_RimeF_PHY(I,KFLIP,J)=F_RimeF(L,I,J)
  544. ENDDO
  545. 101 CONTINUE
  546. END SUBROUTINE EGCP01DRV
  547. !
  548. !
  549. !###############################################################################
  550. ! ***** VERSION OF MICROPHYSICS DESIGNED FOR HIGHER RESOLUTION MESO ETA MODEL
  551. ! (1) Represents sedimentation by preserving a portion of the precipitation
  552. ! through top-down integration from cloud-top. Modified procedure to
  553. ! Zhao and Carr (1997).
  554. ! (2) Microphysical equations are modified to be less sensitive to time
  555. ! steps by use of Clausius-Clapeyron equation to account for changes in
  556. ! saturation mixing ratios in response to latent heating/cooling.
  557. ! (3) Prevent spurious temperature oscillations across 0C due to
  558. ! microphysics.
  559. ! (4) Uses lookup tables for: calculating two different ventilation
  560. ! coefficients in condensation and deposition processes; accretion of
  561. ! cloud water by precipitation; precipitation mass; precipitation rate
  562. ! (and mass-weighted precipitation fall speeds).
  563. ! (5) Assumes temperature-dependent variation in mean diameter of large ice
  564. ! (Houze et al., 1979; Ryan et al., 1996).
  565. ! -> 8/22/01: This relationship has been extended to colder temperatures
  566. ! to parameterize smaller large-ice particles down to mean sizes of MDImin,
  567. ! which is 50 microns reached at -55.9C.
  568. ! (6) Attempts to differentiate growth of large and small ice, mainly for
  569. ! improved transition from thin cirrus to thick, precipitating ice
  570. ! anvils.
  571. ! -> 8/22/01: This feature has been diminished by effectively adjusting to
  572. ! ice saturation during depositional growth at temperatures colder than
  573. ! -10C. Ice sublimation is calculated more explicitly. The logic is
  574. ! that sources of are either poorly understood (e.g., nucleation for NWP)
  575. ! or are not represented in the Eta model (e.g., detrainment of ice from
  576. ! convection). Otherwise the model is too wet compared to the radiosonde
  577. ! observations based on 1 Feb - 18 March 2001 retrospective runs.
  578. ! (7) Top-down integration also attempts to treat mixed-phase processes,
  579. ! allowing a mixture of ice and water. Based on numerous observational
  580. ! studies, ice growth is based on nucleation at cloud top &
  581. ! subsequent growth by vapor deposition and riming as the ice particles
  582. ! fall through the cloud. Effective nucleation rates are a function
  583. ! of ice supersaturation following Meyers et al. (JAM, 1992).
  584. ! -> 8/22/01: The simulated relative humidities were far too moist compared
  585. ! to the rawinsonde observations. This feature has been substantially
  586. ! diminished, limited to a much narrower temperature range of 0 to -10C.
  587. ! (8) Depositional growth of newly nucleated ice is calculated for large time
  588. ! steps using Fig. 8 of Miller and Young (JAS, 1979), at 1 deg intervals
  589. ! using their ice crystal masses calculated after 600 s of growth in water
  590. ! saturated conditions. The growth rates are normalized by time step
  591. ! assuming 3D growth with time**1.5 following eq. (6.3) in Young (1993).
  592. ! -> 8/22/01: This feature has been effectively limited to 0 to -10C.
  593. ! (9) Ice precipitation rates can increase due to increase in response to
  594. ! cloud water riming due to (a) increased density & mass of the rimed
  595. ! ice, and (b) increased fall speeds of rimed ice.
  596. ! -> 8/22/01: This feature has been effectively limited to 0 to -10C.
  597. !###############################################################################
  598. !###############################################################################
  599. !
  600. SUBROUTINE EGCP01COLUMN ( ARAIN, ASNOW, DTPH, I_index, J_index, &
  601. & LSFC, P_col, QI_col, QR_col, QV_col, QW_col, RimeF_col, T_col, &
  602. & THICK_col, WC_col ,KTS,KTE,NSTATS,QMAX,QTOT)
  603. !
  604. !###############################################################################
  605. !###############################################################################
  606. !
  607. !-------------------------------------------------------------------------------
  608. !----- NOTE: Code is currently set up w/o threading!
  609. !-------------------------------------------------------------------------------
  610. !$$$ SUBPROGRAM DOCUMENTATION BLOCK
  611. ! . . .
  612. ! SUBPROGRAM: Grid-scale microphysical processes - condensation & precipitation
  613. ! PRGRMMR: Ferrier ORG: W/NP22 DATE: 08-2001
  614. ! PRGRMMR: Jin (Modification for WRF structure)
  615. !-------------------------------------------------------------------------------
  616. ! ABSTRACT:
  617. ! * Merges original GSCOND & PRECPD subroutines.
  618. ! * Code has been substantially streamlined and restructured.
  619. ! * Exchange between water vapor & small cloud condensate is calculated using
  620. ! the original Asai (1965, J. Japan) algorithm. See also references to
  621. ! Yau and Austin (1979, JAS), Rutledge and Hobbs (1983, JAS), and Tao et al.
  622. ! (1989, MWR). This algorithm replaces the Sundqvist et al. (1989, MWR)
  623. ! parameterization.
  624. !-------------------------------------------------------------------------------
  625. !
  626. ! USAGE:
  627. ! * CALL EGCP01COLUMN FROM SUBROUTINE EGCP01DRV
  628. !
  629. ! INPUT ARGUMENT LIST:
  630. ! DTPH - physics time step (s)
  631. ! I_index - I index
  632. ! J_index - J index
  633. ! LSFC - Eta level of level above surface, ground
  634. ! P_col - vertical column of model pressure (Pa)
  635. ! QI_col - vertical column of model ice mixing ratio (kg/kg)
  636. ! QR_col - vertical column of model rain ratio (kg/kg)
  637. ! QV_col - vertical column of model water vapor specific humidity (kg/kg)
  638. ! QW_col - vertical column of model cloud water mixing ratio (kg/kg)
  639. ! RimeF_col - vertical column of rime factor for ice in model (ratio, defined below)
  640. ! T_col - vertical column of model temperature (deg K)
  641. ! THICK_col - vertical column of model mass thickness (density*height increment)
  642. ! WC_col - vertical column of model mixing ratio of total condensate (kg/kg)
  643. !
  644. !
  645. ! OUTPUT ARGUMENT LIST:
  646. ! ARAIN - accumulated rainfall at the surface (kg)
  647. ! ASNOW - accumulated snowfall at the surface (kg)
  648. ! QV_col - vertical column of model water vapor specific humidity (kg/kg)
  649. ! WC_col - vertical column of model mixing ratio of total condensate (kg/kg)
  650. ! QW_col - vertical column of model cloud water mixing ratio (kg/kg)
  651. ! QI_col - vertical column of model ice mixing ratio (kg/kg)
  652. ! QR_col - vertical column of model rain ratio (kg/kg)
  653. ! RimeF_col - vertical column of rime factor for ice in model (ratio, defined below)
  654. ! T_col - vertical column of model temperature (deg K)
  655. !
  656. ! OUTPUT FILES:
  657. ! NONE
  658. !
  659. ! Subprograms & Functions called:
  660. ! * Real Function CONDENSE - cloud water condensation
  661. ! * Real Function DEPOSIT - ice deposition (not sublimation)
  662. !
  663. ! UNIQUE: NONE
  664. !
  665. ! LIBRARY: NONE
  666. !
  667. ! COMMON BLOCKS:
  668. ! CMICRO_CONS - key constants initialized in GSMCONST
  669. ! CMICRO_STATS - accumulated and maximum statistics
  670. ! CMY_GROWTH - lookup table for growth of ice crystals in
  671. ! water saturated conditions (Miller & Young, 1979)
  672. ! IVENT_TABLES - lookup tables for ventilation effects of ice
  673. ! IACCR_TABLES - lookup tables for accretion rates of ice
  674. ! IMASS_TABLES - lookup tables for mass content of ice
  675. ! IRATE_TABLES - lookup tables for precipitation rates of ice
  676. ! IRIME_TABLES - lookup tables for increase in fall speed of rimed ice
  677. ! RVENT_TABLES - lookup tables for ventilation effects of rain
  678. ! RACCR_TABLES - lookup tables for accretion rates of rain
  679. ! RMASS_TABLES - lookup tables for mass content of rain
  680. ! RVELR_TABLES - lookup tables for fall speeds of rain
  681. ! RRATE_TABLES - lookup tables for precipitation rates of rain
  682. !
  683. ! ATTRIBUTES:
  684. ! LANGUAGE: FORTRAN 90
  685. ! MACHINE : IBM SP
  686. !
  687. !
  688. !-------------------------------------------------------------------------
  689. !--------------- Arrays & constants in argument list ---------------------
  690. !-------------------------------------------------------------------------
  691. !
  692. IMPLICIT NONE
  693. !
  694. INTEGER,INTENT(IN) :: KTS,KTE,I_index, J_index, LSFC
  695. REAL,INTENT(INOUT) :: ARAIN, ASNOW
  696. REAL,DIMENSION(KTS:KTE),INTENT(INOUT) :: P_col, QI_col,QR_col &
  697. & ,QV_col ,QW_col, RimeF_col, T_col, THICK_col,WC_col
  698. !
  699. !-------------------------------------------------------------------------
  700. !-------------- Common blocks for microphysical statistics ---------------
  701. !-------------------------------------------------------------------------
  702. !
  703. !-------------------------------------------------------------------------
  704. !--------- Common blocks for constants initialized in GSMCONST ----------
  705. !
  706. INTEGER, PARAMETER :: ITLO=-60, ITHI=40
  707. INTEGER,INTENT(INOUT) :: NSTATS(ITLO:ITHI,4)
  708. REAL,INTENT(INOUT) :: QMAX(ITLO:ITHI,5),QTOT(ITLO:ITHI,22)
  709. !
  710. !-------------------------------------------------------------------------
  711. !--------------- Common blocks for various lookup tables -----------------
  712. !
  713. !--- Discretized growth rates of small ice crystals after their nucleation
  714. ! at 1 C intervals from -1 C to -35 C, based on calculations by Miller
  715. ! and Young (1979, JAS) after 600 s of growth. Resultant growth rates
  716. ! are multiplied by physics time step in GSMCONST.
  717. !
  718. !-------------------------------------------------------------------------
  719. !
  720. !--- Mean ice-particle diameters varying from 50 microns to 1000 microns
  721. ! (1 mm), assuming an exponential size distribution.
  722. !
  723. !---- Meaning of the following arrays:
  724. ! - mdiam - mean diameter (m)
  725. ! - VENTI1 - integrated quantity associated w/ ventilation effects
  726. ! (capacitance only) for calculating vapor deposition onto ice
  727. ! - VENTI2 - integrated quantity associated w/ ventilation effects
  728. ! (with fall speed) for calculating vapor deposition onto ice
  729. ! - ACCRI - integrated quantity associated w/ cloud water collection by ice
  730. ! - MASSI - integrated quantity associated w/ ice mass
  731. ! - VSNOWI - mass-weighted fall speed of snow (large ice), used to calculate
  732. ! precipitation rates
  733. !
  734. !
  735. !-------------------------------------------------------------------------
  736. !
  737. !--- VEL_RF - velocity increase of rimed particles as functions of crude
  738. ! particle size categories (at 0.1 mm intervals of mean ice particle
  739. ! sizes) and rime factor (different values of Rime Factor of 1.1**N,
  740. ! where N=0 to Nrime).
  741. !
  742. !-------------------------------------------------------------------------
  743. !
  744. !--- Mean rain drop diameters varying from 50 microns (0.05 mm) to 450 microns
  745. ! (0.45 mm), assuming an exponential size distribution.
  746. !
  747. !-------------------------------------------------------------------------
  748. !------- Key parameters, local variables, & important comments ---------
  749. !-----------------------------------------------------------------------
  750. !
  751. !--- TOLER => Tolerance or precision for accumulated precipitation
  752. !
  753. REAL, PARAMETER :: TOLER=5.E-7, C2=1./6., RHO0=1.194, Xratio=.025
  754. !
  755. !--- If BLEND=1:
  756. ! precipitation (large) ice amounts are estimated at each level as a
  757. ! blend of ice falling from the grid point above and the precip ice
  758. ! present at the start of the time step (see TOT_ICE below).
  759. !--- If BLEND=0:
  760. ! precipitation (large) ice amounts are estimated to be the precip
  761. ! ice present at the start of the time step.
  762. !
  763. !--- Extended to include sedimentation of rain on 2/5/01
  764. !
  765. REAL, PARAMETER :: BLEND=1.
  766. !
  767. !--- This variable is for debugging purposes (if .true.)
  768. !
  769. LOGICAL, PARAMETER :: PRINT_diag=.FALSE.
  770. !
  771. !-----------------------------------------------------------------------
  772. !--- Local variables
  773. !-----------------------------------------------------------------------
  774. !
  775. REAL EMAIRI, N0r, NLICE, NSmICE
  776. LOGICAL CLEAR, ICE_logical, DBG_logical, RAIN_logical
  777. INTEGER :: IDR,INDEX_MY,INDEXR,INDEXR1,INDEXS,IPASS,ITDX,IXRF, &
  778. & IXS,LBEF,L
  779. !
  780. REAL :: ABI,ABW,AIEVP,ARAINnew,ASNOWnew,BLDTRH,BUDGET, &
  781. & CREVP,DELI,DELR,DELT,DELV,DELW,DENOMF, &
  782. & DENOMI,DENOMW,DENOMWI,DIDEP, &
  783. & DIEVP,DIFFUS,DLI,DTPH,DTRHO,DUM,DUM1, &
  784. & DUM2,DWV0,DWVI,DWVR,DYNVIS,ESI,ESW,FIR,FLARGE,FLIMASS, &
  785. & FSMALL,FWR,FWS,GAMMAR,GAMMAS, &
  786. & PCOND,PIACR,PIACW,PIACWI,PIACWR,PICND,PIDEP,PIDEP_max, &
  787. & PIEVP,PILOSS,PIMLT,PP,PRACW,PRAUT,PREVP,PRLOSS, &
  788. & QI,QInew,QLICE,QR,QRnew,QSI,QSIgrd,QSInew,QSW,QSW0, &
  789. & QSWgrd,QSWnew,QT,QTICE,QTnew,QTRAIN,QV,QW,QW0,QWnew, &
  790. & RFACTOR,RHO,RIMEF,RIMEF1,RQR,RR,RRHO,SFACTOR, &
  791. & TC,TCC,TFACTOR,THERM_COND,THICK,TK,TK2,TNEW, &
  792. & TOT_ICE,TOT_ICEnew,TOT_RAIN,TOT_RAINnew, &
  793. & VEL_INC,VENTR,VENTIL,VENTIS,VRAIN1,VRAIN2,VRIMEF,VSNOW, &
  794. & WC,WCnew,WSgrd,WS,WSnew,WV,WVnew,WVQW, &
  795. & XLF,XLF1,XLI,XLV,XLV1,XLV2,XLIMASS,XRF,XSIMASS
  796. !
  797. !#######################################################################
  798. !########################## Begin Execution ############################
  799. !#######################################################################
  800. !
  801. !
  802. ARAIN=0. ! Accumulated rainfall into grid box from above (kg/m**2)
  803. ASNOW=0. ! Accumulated snowfall into grid box from above (kg/m**2)
  804. !
  805. !-----------------------------------------------------------------------
  806. !------------ Loop from top (L=1) to surface (L=LSFC) ------------------
  807. !-----------------------------------------------------------------------
  808. !
  809. DO 10 L=1,LSFC
  810. !--- Skip this level and go to the next lower level if no condensate
  811. ! and very low specific humidities
  812. !
  813. IF (QV_col(L).LE.EPSQ .AND. WC_col(L).LE.EPSQ) GO TO 10
  814. !
  815. !-----------------------------------------------------------------------
  816. !------------ Proceed with cloud microphysics calculations -------------
  817. !-----------------------------------------------------------------------
  818. !
  819. TK=T_col(L) ! Temperature (deg K)
  820. TC=TK-T0C ! Temperature (deg C)
  821. PP=P_col(L) ! Pressure (Pa)
  822. QV=QV_col(L) ! Specific humidity of water vapor (kg/kg)
  823. WV=QV/(1.-QV) ! Water vapor mixing ratio (kg/kg)
  824. WC=WC_col(L) ! Grid-scale mixing ratio of total condensate (water or ice; kg/kg)
  825. !
  826. !-----------------------------------------------------------------------
  827. !--- Moisture variables below are mixing ratios & not specifc humidities
  828. !-----------------------------------------------------------------------
  829. !
  830. CLEAR=.TRUE.
  831. !
  832. !--- This check is to determine grid-scale saturation when no condensate is present
  833. !
  834. ESW=MIN(1000.*FPVS0(TK),0.99*PP) ! Saturation vapor pressure w/r/t water
  835. QSW=EPS*ESW/(PP-ESW) ! Saturation mixing ratio w/r/t water
  836. WS=QSW ! General saturation mixing ratio (water/ice)
  837. IF (TC .LT. 0.) THEN
  838. ESI=MIN(1000.*FPVS(TK),0.99*PP) ! Saturation vapor pressure w/r/t ice
  839. QSI=EPS*ESI/(PP-ESI) ! Saturation mixing ratio w/r/t water
  840. WS=QSI ! General saturation mixing ratio (water/ice)
  841. ENDIF
  842. !
  843. !--- Effective grid-scale Saturation mixing ratios
  844. !
  845. QSWgrd=RHgrd*QSW
  846. QSIgrd=RHgrd*QSI
  847. WSgrd=RHgrd*WS
  848. !
  849. !--- Check if air is subsaturated and w/o condensate
  850. !
  851. IF (WV.GT.WSgrd .OR. WC.GT.EPSQ) CLEAR=.FALSE.
  852. !
  853. !--- Check if any rain is falling into layer from above
  854. !
  855. IF (ARAIN .GT. CLIMIT) THEN
  856. CLEAR=.FALSE.
  857. ELSE
  858. ARAIN=0.
  859. ENDIF
  860. !
  861. !--- Check if any ice is falling into layer from above
  862. !
  863. !--- NOTE that "SNOW" in variable names is synonomous with
  864. ! large, precipitation ice particles
  865. !
  866. IF (ASNOW .GT. CLIMIT) THEN
  867. CLEAR=.FALSE.
  868. ELSE
  869. ASNOW=0.
  870. ENDIF
  871. !
  872. !-----------------------------------------------------------------------
  873. !-- Loop to the end if in clear, subsaturated air free of condensate ---
  874. !-----------------------------------------------------------------------
  875. !
  876. IF (CLEAR) GO TO 10
  877. !
  878. !-----------------------------------------------------------------------
  879. !--------- Initialize RHO, THICK & microphysical processes -------------
  880. !-----------------------------------------------------------------------
  881. !
  882. !
  883. !--- Virtual temperature, TV=T*(1./EPS-1)*Q, Q is specific humidity;
  884. ! (see pp. 63-65 in Fleagle & Businger, 1963)
  885. !
  886. RHO=PP/(RD*TK*(1.+EPS1*QV)) ! Air density (kg/m**3)
  887. RRHO=1./RHO ! Reciprocal of air density
  888. DTRHO=DTPH*RHO ! Time step * air density
  889. BLDTRH=BLEND*DTRHO ! Blend parameter * time step * air density
  890. THICK=THICK_col(L) ! Layer thickness = RHO*DZ = -DP/G = (Psfc-Ptop)*D_ETA/(G*ETA_sfc)
  891. !
  892. ARAINnew=0. ! Updated accumulated rainfall
  893. ASNOWnew=0. ! Updated accumulated snowfall
  894. QI=QI_col(L) ! Ice mixing ratio
  895. QInew=0. ! Updated ice mixing ratio
  896. QR=QR_col(L) ! Rain mixing ratio
  897. QRnew=0. ! Updated rain ratio
  898. QW=QW_col(L) ! Cloud water mixing ratio
  899. QWnew=0. ! Updated cloud water ratio
  900. !
  901. PCOND=0. ! Condensation (>0) or evaporation (<0) of cloud water (kg/kg)
  902. PIDEP=0. ! Deposition (>0) or sublimation (<0) of ice crystals (kg/kg)
  903. PIACW=0. ! Cloud water collection (riming) by precipitation ice (kg/kg; >0)
  904. PIACWI=0. ! Growth of precip ice by riming (kg/kg; >0)
  905. PIACWR=0. ! Shedding of accreted cloud water to form rain (kg/kg; >0)
  906. PIACR=0. ! Freezing of rain onto large ice at supercooled temps (kg/kg; >0)
  907. PICND=0. ! Condensation (>0) onto wet, melting ice (kg/kg)
  908. PIEVP=0. ! Evaporation (<0) from wet, melting ice (kg/kg)
  909. PIMLT=0. ! Melting ice (kg/kg; >0)
  910. PRAUT=0. ! Cloud water autoconversion to rain (kg/kg; >0)
  911. PRACW=0. ! Cloud water collection (accretion) by rain (kg/kg; >0)
  912. PREVP=0. ! Rain evaporation (kg/kg; <0)
  913. !
  914. !--- Double check input hydrometeor mixing ratios
  915. !
  916. ! DUM=WC-(QI+QW+QR)
  917. ! DUM1=ABS(DUM)
  918. ! DUM2=TOLER*MIN(WC, QI+QW+QR)
  919. ! IF (DUM1 .GT. DUM2) THEN
  920. ! WRITE(6,"(/2(a,i4),a,i2)") '{@ i=',I_index,' j=',J_index,
  921. ! & ' L=',L
  922. ! WRITE(6,"(4(a12,g11.4,1x))")
  923. ! & '{@ TCold=',TC,'P=',.01*PP,'DIFF=',DUM,'WCold=',WC,
  924. ! & '{@ QIold=',QI,'QWold=',QW,'QRold=',QR
  925. ! ENDIF
  926. !
  927. !***********************************************************************
  928. !*********** MAIN MICROPHYSICS CALCULATIONS NOW FOLLOW! ****************
  929. !***********************************************************************
  930. !
  931. !--- Calculate a few variables, which are used more than once below
  932. !
  933. !--- Latent heat of vaporization as a function of temperature from
  934. ! Bolton (1980, JAS)
  935. !
  936. XLV=3.148E6-2370*TK ! Latent heat of vaporization (Lv)
  937. XLF=XLS-XLV ! Latent heat of fusion (Lf)
  938. XLV1=XLV*RCP ! Lv/Cp
  939. XLF1=XLF*RCP ! Lf/Cp
  940. TK2=1./(TK*TK) ! 1./TK**2
  941. XLV2=XLV*XLV*QSW*TK2/RV ! Lv**2*Qsw/(Rv*TK**2)
  942. DENOMW=1.+XLV2*RCP ! Denominator term, Clausius-Clapeyron correction
  943. !
  944. !--- Basic thermodynamic quantities
  945. ! * DYNVIS - dynamic viscosity [ kg/(m*s) ]
  946. ! * THERM_COND - thermal conductivity [ J/(m*s*K) ]
  947. ! * DIFFUS - diffusivity of water vapor [ m**2/s ]
  948. !
  949. TFACTOR=TK**1.5/(TK+120.)
  950. DYNVIS=1.496E-6*TFACTOR
  951. THERM_COND=2.116E-3*TFACTOR
  952. DIFFUS=8.794E-5*TK**1.81/PP
  953. !
  954. !--- Air resistance term for the fall speed of ice following the
  955. ! basic research by Heymsfield, Kajikawa, others
  956. !
  957. GAMMAS=(1.E5/PP)**C1
  958. !
  959. !--- Air resistance for rain fall speed (Beard, 1985, JAS, p.470)
  960. !
  961. GAMMAR=(RHO0/RHO)**.4
  962. !
  963. !----------------------------------------------------------------------
  964. !------------- IMPORTANT MICROPHYSICS DECISION TREE -----------------
  965. !----------------------------------------------------------------------
  966. !
  967. !--- Determine if conditions supporting ice are present
  968. !
  969. IF (TC.LT.0. .OR. QI.GT. EPSQ .OR. ASNOW.GT.CLIMIT) THEN
  970. ICE_logical=.TRUE.
  971. ELSE
  972. ICE_logical=.FALSE.
  973. QLICE=0.
  974. QTICE=0.
  975. ENDIF
  976. !
  977. !--- Determine if rain is present
  978. !
  979. RAIN_logical=.FALSE.
  980. IF (ARAIN.GT.CLIMIT .OR. QR.GT.EPSQ) RAIN_logical=.TRUE.
  981. !
  982. IF (ICE_logical) THEN
  983. !
  984. !--- IMPORTANT: Estimate time-averaged properties.
  985. !
  986. !---
  987. ! * FLARGE - ratio of number of large ice to total (large & small) ice
  988. ! * FSMALL - ratio of number of small ice crystals to large ice particles
  989. ! -> Small ice particles are assumed to have a mean diameter of 50 microns.
  990. ! * XSIMASS - used for calculating small ice mixing ratio
  991. !---
  992. ! * TOT_ICE - total mass (small & large) ice before microphysics,
  993. ! which is the sum of the total mass of large ice in the
  994. ! current layer and the input flux of ice from above
  995. ! * PILOSS - greatest loss (<0) of total (small & large) ice by
  996. ! sublimation, removing all of the ice falling from above
  997. ! and the ice within the layer
  998. ! * RimeF1 - Rime Factor, which is the mass ratio of total (unrimed & rimed)
  999. ! ice mass to the unrimed ice mass (>=1)
  1000. ! * VrimeF - the velocity increase due to rime factor or melting (ratio, >=1)
  1001. ! * VSNOW - Fall speed of rimed snow w/ air resistance correction
  1002. ! * EMAIRI - equivalent mass of air associated layer and with fall of snow into layer
  1003. ! * XLIMASS - used for calculating large ice mixing ratio
  1004. ! * FLIMASS - mass fraction of large ice
  1005. ! * QTICE - time-averaged mixing ratio of total ice
  1006. ! * QLICE - time-averaged mixing ratio of large ice
  1007. ! * NLICE - time-averaged number concentration of large ice
  1008. ! * NSmICE - number concentration of small ice crystals at current level
  1009. !---
  1010. !--- Assumed number fraction of large ice particles to total (large & small)
  1011. ! ice particles, which is based on a general impression of the literature.
  1012. !
  1013. WVQW=WV+QW ! Water vapor & cloud water
  1014. !
  1015. IF (TC.GE.0. .OR. WVQW.LT.QSIgrd) THEN
  1016. !
  1017. !--- Eliminate small ice particle contributions for melting & sublimation
  1018. !
  1019. FLARGE=FLARGE1
  1020. ELSE
  1021. !
  1022. !--- Enhanced number of small ice particles during depositional growth
  1023. ! (effective only when 0C > T >= T_ice [-10C] )
  1024. !
  1025. FLARGE=FLARGE2
  1026. !
  1027. !--- Larger number of small ice particles due to rime splintering
  1028. !
  1029. IF (TC.GE.-8. .AND. TC.LE.-3.) FLARGE=.5*FLARGE
  1030. !
  1031. ENDIF ! End IF (TC.GE.0. .OR. WVQW.LT.QSIgrd)
  1032. FSMALL=(1.-FLARGE)/FLARGE
  1033. XSIMASS=RRHO*MASSI(MDImin)*FSMALL
  1034. IF (QI.LE.EPSQ .AND. ASNOW.LE.CLIMIT) THEN
  1035. INDEXS=MDImin
  1036. TOT_ICE=0.
  1037. PILOSS=0.
  1038. RimeF1=1.
  1039. VrimeF=1.
  1040. VEL_INC=GAMMAS
  1041. VSNOW=0.
  1042. EMAIRI=THICK
  1043. XLIMASS=RRHO*RimeF1*MASSI(INDEXS)
  1044. FLIMASS=XLIMASS/(XLIMASS+XSIMASS)
  1045. QLICE=0.
  1046. QTICE=0.
  1047. NLICE=0.
  1048. NSmICE=0.
  1049. ELSE
  1050. !
  1051. !--- For T<0C mean particle size follows Houze et al. (JAS, 1979, p. 160),
  1052. ! converted from Fig. 5 plot of LAMDAs. Similar set of relationships
  1053. ! also shown in Fig. 8 of Ryan (BAMS, 1996, p. 66).
  1054. !
  1055. DUM=XMImax*EXP(.0536*TC)
  1056. INDEXS=MIN(MDImax, MAX(MDImin, INT(DUM) ) )
  1057. TOT_ICE=THICK*QI+BLEND*ASNOW
  1058. PILOSS=-TOT_ICE/THICK
  1059. LBEF=MAX(1,L-1)
  1060. DUM1=RimeF_col(LBEF)
  1061. DUM2=RimeF_col(L)
  1062. RimeF1=(DUM2*THICK*QI+DUM1*BLEND*ASNOW)/TOT_ICE
  1063. RimeF1=MIN(RimeF1, RFmax)
  1064. DO IPASS=0,1
  1065. IF (RimeF1 .LE. 1.) THEN
  1066. RimeF1=1.
  1067. VrimeF=1.
  1068. ELSE
  1069. IXS=MAX(2, MIN(INDEXS/100, 9))
  1070. XRF=10.492*ALOG(RimeF1)
  1071. IXRF=MAX(0, MIN(INT(XRF), Nrime))
  1072. IF (IXRF .GE. Nrime) THEN
  1073. VrimeF=VEL_RF(IXS,Nrime)
  1074. ELSE
  1075. VrimeF=VEL_RF(IXS,IXRF)+(XRF-FLOAT(IXRF))* &
  1076. & (VEL_RF(IXS,IXRF+1)-VEL_RF(IXS,IXRF))
  1077. ENDIF
  1078. ENDIF ! End IF (RimeF1 .LE. 1.)
  1079. VEL_INC=GAMMAS*VrimeF
  1080. VSNOW=VEL_INC*VSNOWI(INDEXS)
  1081. EMAIRI=THICK+BLDTRH*VSNOW
  1082. XLIMASS=RRHO*RimeF1*MASSI(INDEXS)
  1083. FLIMASS=XLIMASS/(XLIMASS+XSIMASS)
  1084. QTICE=TOT_ICE/EMAIRI
  1085. QLICE=FLIMASS*QTICE
  1086. NLICE=QLICE/XLIMASS
  1087. NSmICE=Fsmall*NLICE
  1088. !
  1089. IF ( (NLICE.GE.NLImin .AND. NLICE.LE.NLImax) &
  1090. & .OR. IPASS.EQ.1) THEN
  1091. EXIT
  1092. ELSE
  1093. IF (TC < 0) THEN
  1094. XLI=RHO*(QTICE/DUM-XSIMASS)/RimeF1
  1095. IF (XLI .LE. MASSI(MDImin) ) THEN
  1096. INDEXS=MDImin
  1097. ELSE IF (XLI .LE. MASSI(450) ) THEN
  1098. DLI=9.5885E5*XLI**.42066 ! DLI in microns
  1099. INDEXS=MIN(MDImax, MAX(MDImin, INT(DLI) ) )
  1100. ELSE IF (XLI .LE. MASSI(MDImax) ) THEN
  1101. DLI=3.9751E6*XLI**.49870 ! DLI in microns
  1102. INDEXS=MIN(MDImax, MAX(MDImin, INT(DLI) ) )
  1103. ELSE
  1104. INDEXS=MDImax
  1105. ENDIF ! End IF (XLI .LE. MASSI(MDImin) )
  1106. ENDIF ! End IF (TC < 0)
  1107. !
  1108. !--- Reduce excessive accumulation of ice at upper levels
  1109. ! associated with strong grid-resolved ascent
  1110. !
  1111. !--- Force NLICE to be between NLImin and NLImax
  1112. !
  1113. !
  1114. !--- 8/22/01: Increase density of large ice if maximum limits
  1115. ! are reached for number concentration (NLImax) and mean size
  1116. ! (MDImax). Done to increase fall out of ice.
  1117. !
  1118. DUM=MAX(NLImin, MIN(NLImax, NLICE) )
  1119. IF (DUM.GE.NLImax .AND. INDEXS.GE.MDImax) &
  1120. & RimeF1=RHO*(QTICE/NLImax-XSIMASS)/MASSI(INDEXS)
  1121. ! WRITE(6,"(4(a12,g11.4,1x))")
  1122. ! & '{$ TC=',TC,'P=',.01*PP,'NLICE=',NLICE,'DUM=',DUM,
  1123. ! & '{$ XLI=',XLI,'INDEXS=',FLOAT(INDEXS),'RHO=',RHO,'QTICE=',QTICE,
  1124. ! & '{$ XSIMASS=',XSIMASS,'RimeF1=',RimeF1
  1125. ENDIF ! End IF ( (NLICE.GE.NLImin .AND. NLICE.LE.NLImax) ...
  1126. ENDDO ! End DO IPASS=0,1
  1127. ENDIF ! End IF (QI.LE.EPSQ .AND. ASNOW.LE.CLIMIT)
  1128. ENDIF ! End IF (ICE_logical)
  1129. !
  1130. !----------------------------------------------------------------------
  1131. !--------------- Calculate individual processes -----------------------
  1132. !----------------------------------------------------------------------
  1133. !
  1134. !--- Cloud water autoconversion to rain and collection by rain
  1135. !
  1136. IF (QW.GT.EPSQ .AND. TC.GE.T_ICE) THEN
  1137. !
  1138. !--- QW0 could be modified based on land/sea properties,
  1139. ! presence of convection, etc. This is why QAUT0 and CRAUT
  1140. ! are passed into the subroutine as externally determined
  1141. ! parameters. Can be changed in the future if desired.
  1142. !
  1143. QW0=QAUT0*RRHO
  1144. PRAUT=MAX(0., MIN(QW-QW0, QW0) )*CRAUT
  1145. IF (QLICE .GT. EPSQ) THEN
  1146. !
  1147. !--- Collection of cloud water by large ice particles ("snow")
  1148. ! PIACWI=PIACW for riming, PIACWI=0 for shedding
  1149. !
  1150. FWS=MIN(1., CIACW*VEL_INC*NLICE*ACCRI(INDEXS)/PP**C1)
  1151. PIACW=FWS*QW
  1152. IF (TC .LT. 0.) PIACWI=PIACW ! Large ice riming
  1153. ENDIF ! End IF (QLICE .GT. EPSQ)
  1154. ENDIF ! End IF (QW.GT.EPSQ .AND. TC.GE.T_ICE)
  1155. !
  1156. !----------------------------------------------------------------------
  1157. !--- Loop around some of the ice-phase processes if no ice should be present
  1158. !----------------------------------------------------------------------
  1159. !
  1160. IF (ICE_logical .EQV. .FALSE.) GO TO 20
  1161. !
  1162. !--- Now the pretzel logic of calculating ice deposition
  1163. !
  1164. IF (TC.LT.T_ICE .AND. (WV.GT.QSIgrd .OR. QW.GT.EPSQ)) THEN
  1165. !
  1166. !--- Adjust to ice saturation at T<T_ICE (-10C) if supersaturated.
  1167. ! Sources of ice due to nucleation and convective detrainment are
  1168. ! either poorly understood, poorly resolved at typical NWP
  1169. ! resolutions, or are not represented (e.g., no detrained
  1170. ! condensate in BMJ Cu scheme).
  1171. !
  1172. PCOND=-QW
  1173. DUM1=TK+XLV1*PCOND ! Updated (dummy) temperature (deg K)
  1174. DUM2=WV+QW ! Updated (dummy) water vapor mixing ratio
  1175. DUM=MIN(1000.*FPVS(DUM1),0.99*PP) ! Updated (dummy) saturation vapor pressure w/r/t ice
  1176. DUM=RHgrd*EPS*DUM/(PP-DUM) ! Updated (dummy) saturation mixing ratio w/r/t ice
  1177. IF (DUM2 .GT. DUM) PIDEP=DEPOSIT (PP, DUM1, DUM2)
  1178. DWVi=0. ! Used only for debugging
  1179. !
  1180. ELSE IF (TC .LT. 0.) THEN
  1181. !
  1182. !--- These quantities are handy for ice deposition/sublimation
  1183. ! PIDEP_max - max deposition or minimum sublimation to ice saturation
  1184. !
  1185. DENOMI=1.+XLS2*QSI*TK2
  1186. DWVi=MIN(WVQW,QSW)-QSI
  1187. PIDEP_max=MAX(PILOSS, DWVi/DENOMI)
  1188. IF (QTICE .GT. 0.) THEN
  1189. !
  1190. !--- Calculate ice deposition/sublimation
  1191. ! * SFACTOR - [VEL_INC**.5]*[Schmidt**(1./3.)]*[(RHO/DYNVIS)**.5],
  1192. ! where Schmidt (Schmidt Number) =DYNVIS/(RHO*DIFFUS)
  1193. ! * Units: SFACTOR - s**.5/m ; ABI - m**2/s ; NLICE - m**-3 ;
  1194. ! VENTIL, VENTIS - m**-2 ; VENTI1 - m ;
  1195. ! VENTI2 - m**2/s**.5 ; DIDEP - unitless
  1196. !
  1197. SFACTOR=VEL_INC**.5*(RHO/(DIFFUS*DIFFUS*DYNVIS))**C2
  1198. ABI=1./(RHO*XLS3*QSI*TK2/THERM_COND+1./DIFFUS)
  1199. !
  1200. !--- VENTIL - Number concentration * ventilation factors for large ice
  1201. !--- VENTIS - Number concentration * ventilation factors for small ice
  1202. !
  1203. !--- Variation in the number concentration of ice with time is not
  1204. ! accounted for in these calculations (could be in the future).
  1205. !
  1206. VENTIL=(VENTI1(INDEXS)+SFACTOR*VENTI2(INDEXS))*NLICE
  1207. VENTIS=(VENTI1(MDImin)+SFACTOR*VENTI2(MDImin))*NSmICE
  1208. DIDEP=ABI*(VENTIL+VENTIS)*DTPH
  1209. !
  1210. !--- Account for change in water vapor supply w/ time
  1211. !
  1212. IF (DIDEP .GE. Xratio)then
  1213. DIDEP=(1.-EXP(-DIDEP*DENOMI))/DENOMI
  1214. endif
  1215. IF (DWVi .GT. 0.) THEN
  1216. PIDEP=MIN(DWVi*DIDEP, PIDEP_max)
  1217. ELSE IF (DWVi .LT. 0.) THEN
  1218. PIDEP=MAX(DWVi*DIDEP, PIDEP_max)
  1219. ENDIF
  1220. !
  1221. ELSE IF (WVQW.GT.QSI .AND. TC.LE.T_ICE_init) THEN
  1222. !
  1223. !--- Ice nucleation in near water-saturated conditions. Ice crystal
  1224. ! growth during time step calculated using Miller & Young (1979, JAS).
  1225. !--- These deposition rates could drive conditions below water saturation,
  1226. ! which is the basis of these calculations. Intended to approximate
  1227. ! more complex & computationally intensive calculations.
  1228. !
  1229. INDEX_MY=MAX(MY_T1, MIN( INT(.5-TC), MY_T2 ) )
  1230. !
  1231. !--- DUM1 is the supersaturation w/r/t ice at water-saturated conditions
  1232. !
  1233. !--- DUM2 is the number of ice crystals nucleated at water-saturated
  1234. ! conditions based on Meyers et al. (JAM, 1992).
  1235. !
  1236. !--- Prevent unrealistically large ice initiation (limited by PIDEP_max)
  1237. ! if DUM2 values are increased in future experiments
  1238. !
  1239. DUM1=QSW/QSI-1.
  1240. DUM2=1.E3*EXP(12.96*DUM1-.639)
  1241. PIDEP=MIN(PIDEP_max, DUM2*MY_GROWTH(INDEX_MY)*RRHO)
  1242. !
  1243. ENDIF ! End IF (QTICE .GT. 0.)
  1244. !
  1245. ENDIF ! End IF (TC.LT.T_ICE .AND. (WV.GT.QSIgrd .OR. QW.GT.EPSQ))
  1246. !
  1247. !------------------------------------------------------------------------
  1248. !
  1249. 20 CONTINUE ! Jump here if conditions for ice are not present
  1250. !
  1251. !------------------------------------------------------------------------
  1252. !
  1253. !--- Cloud water condensation
  1254. !
  1255. IF (TC.GE.T_ICE .AND. (QW.GT.EPSQ .OR. WV.GT.QSWgrd)) THEN
  1256. IF (PIACWI.EQ.0. .AND. PIDEP.EQ.0.) THEN
  1257. PCOND=CONDENSE (PP, QW, TK, WV)
  1258. ELSE
  1259. !
  1260. !--- Modify cloud condensation in response to ice processes
  1261. !
  1262. DUM=XLV*QSWgrd*RCPRV*TK2
  1263. DENOMWI=1.+XLS*DUM
  1264. DENOMF=XLF*DUM
  1265. DUM=MAX(0., PIDEP)
  1266. PCOND=(WV-QSWgrd-DENOMWI*DUM-DENOMF*PIACWI)/DENOMW
  1267. DUM1=-QW
  1268. DUM2=PCOND-PIACW
  1269. IF (DUM2 .LT. DUM1) THEN
  1270. !
  1271. !--- Limit cloud water sinks
  1272. !
  1273. DUM=DUM1/DUM2
  1274. PCOND=DUM*PCOND
  1275. PIACW=DUM*PIACW
  1276. PIACWI=DUM*PIACWI
  1277. ENDIF ! End IF (DUM2 .LT. DUM1)
  1278. ENDIF ! End IF (PIACWI.EQ.0. .AND. PIDEP.EQ.0.)
  1279. ENDIF ! End IF (TC.GE.T_ICE .AND. (QW.GT.EPSQ .OR. WV.GT.QSWgrd))
  1280. !
  1281. !--- Limit freezing of accreted rime to prevent temperature oscillations,
  1282. ! a crude Schumann-Ludlam limit (p. 209 of Young, 1993).
  1283. !
  1284. TCC=TC+XLV1*PCOND+XLS1*PIDEP+XLF1*PIACWI
  1285. IF (TCC .GT. 0.) THEN
  1286. PIACWI=0.
  1287. TCC=TC+XLV1*PCOND+XLS1*PIDEP
  1288. ENDIF
  1289. IF (TC.GT.0. .AND. TCC.GT.0. .AND. ICE_logical) THEN
  1290. !
  1291. !--- Calculate melting and evaporation/condensation
  1292. ! * Units: SFACTOR - s**.5/m ; ABI - m**2/s ; NLICE - m**-3 ;
  1293. ! VENTIL - m**-2 ; VENTI1 - m ;
  1294. ! VENTI2 - m**2/s**.5 ; CIEVP - /s
  1295. !
  1296. SFACTOR=VEL_INC**.5*(RHO/(DIFFUS*DIFFUS*DYNVIS))**C2
  1297. VENTIL=NLICE*(VENTI1(INDEXS)+SFACTOR*VENTI2(INDEXS))
  1298. AIEVP=VENTIL*DIFFUS*DTPH
  1299. IF (AIEVP .LT. Xratio) THEN
  1300. DIEVP=AIEVP
  1301. ELSE
  1302. DIEVP=1.-EXP(-AIEVP)
  1303. ENDIF
  1304. QSW0=EPS*ESW0/(PP-ESW0)
  1305. DWV0=MIN(WV,QSW)-QSW0
  1306. DUM=QW+PCOND
  1307. IF (WV.LT.QSW .AND. DUM.LE.EPSQ) THEN
  1308. !
  1309. !--- Evaporation from melting snow (sink of snow) or shedding
  1310. ! of water condensed onto melting snow (source of rain)
  1311. !
  1312. DUM=DWV0*DIEVP
  1313. PIEVP=MAX( MIN(0., DUM), PILOSS)
  1314. PICND=MAX(0., DUM)
  1315. ENDIF ! End IF (WV.LT.QSW .AND. DUM.LE.EPSQ)
  1316. PIMLT=THERM_COND*TCC*VENTIL*RRHO*DTPH/XLF
  1317. !
  1318. !--- Limit melting to prevent temperature oscillations across 0C
  1319. !
  1320. DUM1=MAX( 0., (TCC+XLV1*PIEVP)/XLF1 )
  1321. PIMLT=MIN(PIMLT, DUM1)
  1322. !
  1323. !--- Limit loss of snow by melting (>0) and evaporation
  1324. !
  1325. DUM=PIEVP-PIMLT
  1326. IF (DUM .LT. PILOSS) THEN
  1327. DUM1=PILOSS/DUM
  1328. PIMLT=PIMLT*DUM1
  1329. PIEVP=PIEVP*DUM1
  1330. ENDIF ! End IF (DUM .GT. QTICE)
  1331. ENDIF ! End IF (TC.GT.0. .AND. TCC.GT.0. .AND. ICE_logical)
  1332. !
  1333. !--- IMPORTANT: Estimate time-averaged properties.
  1334. !
  1335. ! * TOT_RAIN - total mass of rain before microphysics, which is the sum of
  1336. ! the total mass of rain in the current layer and the input
  1337. ! flux of rain from above
  1338. ! * VRAIN1 - fall speed of rain into grid from above (with air resistance correction)
  1339. ! * QTRAIN - time-averaged mixing ratio of rain (kg/kg)
  1340. ! * PRLOSS - greatest loss (<0) of rain, removing all rain falling from
  1341. ! above and the rain within the layer
  1342. ! * RQR - rain content (kg/m**3)
  1343. ! * INDEXR - mean size of rain drops to the nearest 1 micron in size
  1344. ! * N0r - intercept of rain size distribution (typically 10**6 m**-4)
  1345. !
  1346. TOT_RAIN=0.
  1347. VRAIN1=0.
  1348. QTRAIN=0.
  1349. PRLOSS=0.
  1350. RQR=0.
  1351. N0r=0.
  1352. INDEXR=MDRmin
  1353. INDEXR1=INDEXR !-- For debugging only
  1354. IF (RAIN_logical) THEN
  1355. IF (ARAIN .LE. 0.) THEN
  1356. INDEXR=MDRmin
  1357. VRAIN1=0.
  1358. ELSE
  1359. !
  1360. !--- INDEXR (related to mean diameter) & N0r could be modified
  1361. ! by land/sea properties, presence of convection, etc.
  1362. !
  1363. !--- Rain rate normalized to a density of 1.194 kg/m**3
  1364. !
  1365. RR=ARAIN/(DTPH*GAMMAR)
  1366. !
  1367. IF (RR .LE. RR_DRmin) THEN
  1368. !
  1369. !--- Assume fixed mean diameter of rain (0.2 mm) for low rain rates,
  1370. ! instead vary N0r with rain rate
  1371. !
  1372. INDEXR=MDRmin
  1373. ELSE IF (RR .LE. RR_DR1) THEN
  1374. !
  1375. !--- Best fit to mass-weighted fall speeds (V) from rain lookup tables
  1376. ! for mean diameters (Dr) between 0.05 and 0.10 mm:
  1377. ! V(Dr)=5.6023e4*Dr**1.136, V in m/s and Dr in m
  1378. ! RR = PI*1000.*N0r0*5.6023e4*Dr**(4+1.136) = 1.408e15*Dr**5.136,
  1379. ! RR in kg/(m**2*s)
  1380. ! Dr (m) = 1.123e-3*RR**.1947 -> Dr (microns) = 1.123e3*RR**.1947
  1381. !
  1382. INDEXR=INT( 1.123E3*RR**.1947 + .5 )
  1383. INDEXR=MAX( MDRmin, MIN(INDEXR, MDR1) )
  1384. ELSE IF (RR .LE. RR_DR2) THEN
  1385. !
  1386. !--- Best fit to mass-weighted fall speeds (V) from rain lookup tables
  1387. ! for mean diameters (Dr) between 0.10 and 0.20 mm:
  1388. ! V(Dr)=1.0867e4*Dr**.958, V in m/s and Dr in m
  1389. ! RR = PI*1000.*N0r0*1.0867e4*Dr**(4+.958) = 2.731e14*Dr**4.958,
  1390. ! RR in kg/(m**2*s)
  1391. ! Dr (m) = 1.225e-3*RR**.2017 -> Dr (microns) = 1.225e3*RR**.2017
  1392. !
  1393. INDEXR=INT( 1.225E3*RR**.2017 + .5 )
  1394. INDEXR=MAX( MDR1, MIN(INDEXR, MDR2) )
  1395. ELSE IF (RR .LE. RR_DR3) THEN
  1396. !
  1397. !--- Best fit to mass-weighted fall speeds (V) from rain lookup tables
  1398. ! for mean diameters (Dr) between 0.20 and 0.32 mm:
  1399. ! V(Dr)=2831.*Dr**.80, V in m/s and Dr in m
  1400. ! RR = PI*1000.*N0r0*2831.*Dr**(4+.80) = 7.115e13*Dr**4.80,
  1401. ! RR in kg/(m**2*s)
  1402. ! Dr (m) = 1.3006e-3*RR**.2083 -> Dr (microns) = 1.3006e3*RR**.2083
  1403. !
  1404. INDEXR=INT( 1.3006E3*RR**.2083 + .5 )
  1405. INDEXR=MAX( MDR2, MIN(INDEXR, MDR3) )
  1406. ELSE IF (RR .LE. RR_DRmax) THEN
  1407. !
  1408. !--- Best fit to mass-weighted fall speeds (V) from rain lookup tables
  1409. ! for mean diameters (Dr) between 0.32 and 0.45 mm:
  1410. ! V(Dr)=944.8*Dr**.6636, V in m/s and Dr in m
  1411. ! RR = PI*1000.*N0r0*944.8*Dr**(4+.6636) = 2.3745e13*Dr**4.6636,
  1412. ! RR in kg/(m**2*s)
  1413. ! Dr (m) = 1.355e-3*RR**.2144 -> Dr (microns) = 1.355e3*RR**.2144
  1414. !
  1415. INDEXR=INT( 1.355E3*RR**.2144 + .5 )
  1416. INDEXR=MAX( MDR3, MIN(INDEXR, MDRmax) )
  1417. ELSE
  1418. !
  1419. !--- Assume fixed mean diameter of rain (0.45 mm) for high rain rates,
  1420. ! instead vary N0r with rain rate
  1421. !
  1422. INDEXR=MDRmax
  1423. ENDIF ! End IF (RR .LE. RR_DRmin) etc.
  1424. VRAIN1=GAMMAR*VRAIN(INDEXR)
  1425. ENDIF ! End IF (ARAIN .LE. 0.)
  1426. INDEXR1=INDEXR ! For debugging only
  1427. TOT_RAIN=THICK*QR+BLEND*ARAIN
  1428. QTRAIN=TOT_RAIN/(THICK+BLDTRH*VRAIN1)
  1429. PRLOSS=-TOT_RAIN/THICK
  1430. RQR=RHO*QTRAIN
  1431. !
  1432. !--- RQR - time-averaged rain content (kg/m**3)
  1433. !
  1434. IF (RQR .LE. RQR_DRmin) THEN
  1435. N0r=MAX(N0rmin, CN0r_DMRmin*RQR)
  1436. INDEXR=MDRmin
  1437. ELSE IF (RQR .GE. RQR_DRmax) THEN
  1438. N0r=CN0r_DMRmax*RQR
  1439. INDEXR=MDRmax
  1440. ELSE
  1441. N0r=N0r0
  1442. INDEXR=MAX( XMRmin, MIN(CN0r0*RQR**.25, XMRmax) )
  1443. ENDIF
  1444. !
  1445. IF (TC .LT. T_ICE) THEN
  1446. PIACR=-PRLOSS
  1447. ELSE
  1448. DWVr=WV-PCOND-QSW
  1449. DUM=QW+PCOND
  1450. IF (DWVr.LT.0. .AND. DUM.LE.EPSQ) THEN
  1451. !
  1452. !--- Rain evaporation
  1453. !
  1454. ! * RFACTOR - [GAMMAR**.5]*[Schmidt**(1./3.)]*[(RHO/DYNVIS)**.5],
  1455. ! where Schmidt (Schmidt Number) =DYNVIS/(RHO*DIFFUS)
  1456. !
  1457. ! * Units: RFACTOR - s**.5/m ; ABW - m**2/s ; VENTR - m**-2 ;
  1458. ! N0r - m**-4 ; VENTR1 - m**2 ; VENTR2 - m**3/s**.5 ;
  1459. ! CREVP - unitless
  1460. !
  1461. RFACTOR=GAMMAR**.5*(RHO/(DIFFUS*DIFFUS*DYNVIS))**C2
  1462. ABW=1./(RHO*XLV2/THERM_COND+1./DIFFUS)
  1463. !
  1464. !--- Note that VENTR1, VENTR2 lookup tables do not include the
  1465. ! 1/Davg multiplier as in the ice tables
  1466. !
  1467. VENTR=N0r*(VENTR1(INDEXR)+RFACTOR*VENTR2(INDEXR))
  1468. CREVP=ABW*VENTR*DTPH
  1469. IF (CREVP .LT. Xratio) THEN
  1470. DUM=DWVr*CREVP
  1471. ELSE
  1472. DUM=DWVr*(1.-EXP(-CREVP*DENOMW))/DENOMW
  1473. ENDIF
  1474. PREVP=MAX(DUM, PRLOSS)
  1475. ELSE IF (QW .GT. EPSQ) THEN
  1476. FWR=CRACW*GAMMAR*N0r*ACCRR(INDEXR)
  1477. PRACW=MIN(1.,FWR)*QW
  1478. ENDIF ! End IF (DWVr.LT.0. .AND. DUM.LE.EPSQ)
  1479. !
  1480. IF (TC.LT.0. .AND. TCC.LT.0.) THEN
  1481. !
  1482. !--- Biggs (1953) heteorogeneous freezing (e.g., Lin et al., 1983)
  1483. ! - Rescaled mean drop diameter from microns (INDEXR) to mm (DUM) to prevent underflow
  1484. !
  1485. DUM=.001*FLOAT(INDEXR)
  1486. DUM=(EXP(ABFR*TC)-1.)*DUM*DUM*DUM*DUM*DUM*DUM*DUM
  1487. PIACR=MIN(CBFR*N0r*RRHO*DUM, QTRAIN)
  1488. IF (QLICE .GT. EPSQ) THEN
  1489. !
  1490. !--- Freezing of rain by collisions w/ large ice
  1491. !
  1492. DUM=GAMMAR*VRAIN(INDEXR)
  1493. DUM1=DUM-VSNOW
  1494. !
  1495. !--- DUM2 - Difference in spectral fall speeds of rain and
  1496. ! large ice, parameterized following eq. (48) on p. 112 of
  1497. ! Murakami (J. Meteor. Soc. Japan, 1990)
  1498. !
  1499. DUM2=(DUM1*DUM1+.04*DUM*VSNOW)**.5
  1500. DUM1=5.E-12*INDEXR*INDEXR+2.E-12*INDEXR*INDEXS &
  1501. & +.5E-12*INDEXS*INDEXS
  1502. FIR=MIN(1., CIACR*NLICE*DUM1*DUM2)
  1503. !
  1504. !--- Future? Should COLLECTION BY SMALL ICE SHOULD BE INCLUDED???
  1505. !
  1506. PIACR=MIN(PIACR+FIR*QTRAIN, QTRAIN)
  1507. ENDIF ! End IF (QLICE .GT. EPSQ)
  1508. DUM=PREVP-PIACR
  1509. If (DUM .LT. PRLOSS) THEN
  1510. DUM1=PRLOSS/DUM
  1511. PREVP=DUM1*PREVP
  1512. PIACR=DUM1*PIACR
  1513. ENDIF ! End If (DUM .LT. PRLOSS)
  1514. ENDIF ! End IF (TC.LT.0. .AND. TCC.LT.0.)
  1515. ENDIF ! End IF (TC .LT. T_ICE)
  1516. ENDIF ! End IF (RAIN_logical)
  1517. !
  1518. !----------------------------------------------------------------------
  1519. !---------------------- Main Budget Equations -------------------------
  1520. !----------------------------------------------------------------------
  1521. !
  1522. !
  1523. !-----------------------------------------------------------------------
  1524. !--- Update fields, determine characteristics for next lower layer ----
  1525. !-----------------------------------------------------------------------
  1526. !
  1527. !--- Carefully limit sinks of cloud water
  1528. !
  1529. DUM1=PIACW+PRAUT+PRACW-MIN(0.,PCOND)
  1530. IF (DUM1 .GT. QW) THEN
  1531. DUM=QW/DUM1
  1532. PIACW=DUM*PIACW
  1533. PIACWI=DUM*PIACWI
  1534. PRAUT=DUM*PRAUT
  1535. PRACW=DUM*PRACW
  1536. IF (PCOND .LT. 0.) PCOND=DUM*PCOND
  1537. ENDIF
  1538. PIACWR=PIACW-PIACWI ! TC >= 0C
  1539. !
  1540. !--- QWnew - updated cloud water mixing ratio
  1541. !
  1542. DELW=PCOND-PIACW-PRAUT-PRACW
  1543. QWnew=QW+DELW
  1544. IF (QWnew .LE. EPSQ) QWnew=0.
  1545. IF (QW.GT.0. .AND. QWnew.NE.0.) THEN
  1546. DUM=QWnew/QW
  1547. IF (DUM .LT. TOLER) QWnew=0.
  1548. ENDIF
  1549. !
  1550. !--- Update temperature and water vapor mixing ratios
  1551. !
  1552. DELT= XLV1*(PCOND+PIEVP+PICND+PREVP) &
  1553. & +XLS1*PIDEP+XLF1*(PIACWI+PIACR-PIMLT)
  1554. Tnew=TK+DELT
  1555. !
  1556. DELV=-PCOND-PIDEP-PIEVP-PICND-PREVP
  1557. WVnew=WV+DELV
  1558. !
  1559. !--- Update ice mixing ratios
  1560. !
  1561. !---
  1562. ! * TOT_ICEnew - total mass (small & large) ice after microphysics,
  1563. ! which is the sum of the total mass of large ice in the
  1564. ! current layer and the flux of ice out of the grid box below
  1565. ! * RimeF - Rime Factor, which is the mass ratio of total (unrimed &
  1566. ! rimed) ice mass to the unrimed ice mass (>=1)
  1567. ! * QInew - updated mixing ratio of total (large & small) ice in layer
  1568. ! -> TOT_ICEnew=QInew*THICK+BLDTRH*QLICEnew*VSNOW
  1569. ! -> But QLICEnew=QInew*FLIMASS, so
  1570. ! -> TOT_ICEnew=QInew*(THICK+BLDTRH*FLIMASS*VSNOW)
  1571. ! * ASNOWnew - updated accumulation of snow at bottom of grid cell
  1572. !---
  1573. !
  1574. DELI=0.
  1575. RimeF=1.
  1576. IF (ICE_logical) THEN
  1577. DELI=PIDEP+PIEVP+PIACWI+PIACR-PIMLT
  1578. TOT_ICEnew=TOT_ICE+THICK*DELI
  1579. IF (TOT_ICE.GT.0. .AND. TOT_ICEnew.NE.0.) THEN
  1580. DUM=TOT_ICEnew/TOT_ICE
  1581. IF (DUM .LT. TOLER) TOT_ICEnew=0.
  1582. ENDIF
  1583. IF (TOT_ICEnew .LE. CLIMIT) THEN
  1584. TOT_ICEnew=0.
  1585. RimeF=1.
  1586. QInew=0.
  1587. ASNOWnew=0.
  1588. ELSE
  1589. !
  1590. !--- Update rime factor if appropriate
  1591. !
  1592. DUM=PIACWI+PIACR
  1593. IF (DUM.LE.EPSQ .AND. PIDEP.LE.EPSQ) THEN
  1594. RimeF=RimeF1
  1595. ELSE
  1596. !
  1597. !--- Rime Factor, RimeF = (Total ice mass)/(Total unrimed ice mass)
  1598. ! DUM1 - Total ice mass, rimed & unrimed
  1599. ! DUM2 - Estimated mass of *unrimed* ice
  1600. !
  1601. DUM1=TOT_ICE+THICK*(PIDEP+DUM)
  1602. DUM2=TOT_ICE/RimeF1+THICK*PIDEP
  1603. IF (DUM2 .LE. 0.) THEN
  1604. RimeF=RFmax
  1605. ELSE
  1606. RimeF=MIN(RFmax, MAX(1., DUM1/DUM2) )
  1607. ENDIF
  1608. ENDIF ! End IF (DUM.LE.EPSQ .AND. PIDEP.LE.EPSQ)
  1609. QInew=TOT_ICEnew/(THICK+BLDTRH*FLIMASS*VSNOW)
  1610. IF (QInew .LE. EPSQ) QInew=0.
  1611. IF (QI.GT.0. .AND. QInew.NE.0.) THEN
  1612. DUM=QInew/QI
  1613. IF (DUM .LT. TOLER) QInew=0.
  1614. ENDIF
  1615. ASNOWnew=BLDTRH*FLIMASS*VSNOW*QInew
  1616. IF (ASNOW.GT.0. .AND. ASNOWnew.NE.0.) THEN
  1617. DUM=ASNOWnew/ASNOW
  1618. IF (DUM .LT. TOLER) ASNOWnew=0.
  1619. ENDIF
  1620. ENDIF ! End IF (TOT_ICEnew .LE. CLIMIT)
  1621. ENDIF ! End IF (ICE_logical)
  1622. !
  1623. !--- Update rain mixing ratios
  1624. !
  1625. !---
  1626. ! * TOT_RAINnew - total mass of rain after microphysics
  1627. ! current layer and the input flux of ice from above
  1628. ! * VRAIN2 - time-averaged fall speed of rain in grid and below
  1629. ! (with air resistance correction)
  1630. ! * QRnew - updated rain mixing ratio in layer
  1631. ! -> TOT_RAINnew=QRnew*(THICK+BLDTRH*VRAIN2)
  1632. ! * ARAINnew - updated accumulation of rain at bottom of grid cell
  1633. !---
  1634. !
  1635. DELR=PRAUT+PRACW+PIACWR-PIACR+PIMLT+PREVP+PICND
  1636. TOT_RAINnew=TOT_RAIN+THICK*DELR
  1637. IF (TOT_RAIN.GT.0. .AND. TOT_RAINnew.NE.0.) THEN
  1638. DUM=TOT_RAINnew/TOT_RAIN
  1639. IF (DUM .LT. TOLER) TOT_RAINnew=0.
  1640. ENDIF
  1641. IF (TOT_RAINnew .LE. CLIMIT) THEN
  1642. TOT_RAINnew=0.
  1643. VRAIN2=0.
  1644. QRnew=0.
  1645. ARAINnew=0.
  1646. ELSE
  1647. !
  1648. !--- 1st guess time-averaged rain rate at bottom of grid box
  1649. !
  1650. RR=TOT_RAINnew/(DTPH*GAMMAR)
  1651. !
  1652. !--- Use same algorithm as above for calculating mean drop diameter
  1653. ! (IDR, in microns), which is used to estimate the time-averaged
  1654. ! fall speed of rain drops at the bottom of the grid layer. This
  1655. ! isn't perfect, but the alternative is solving a transcendental
  1656. ! equation that is numerically inefficient and nasty to program
  1657. ! (coded in earlier versions of GSMCOLUMN prior to 8-22-01).
  1658. !
  1659. IF (RR .LE. RR_DRmin) THEN
  1660. IDR=MDRmin
  1661. ELSE IF (RR .LE. RR_DR1) THEN
  1662. IDR=INT( 1.123E3*RR**.1947 + .5 )
  1663. IDR=MAX( MDRmin, MIN(IDR, MDR1) )
  1664. ELSE IF (RR .LE. RR_DR2) THEN
  1665. IDR=INT( 1.225E3*RR**.2017 + .5 )
  1666. IDR=MAX( MDR1, MIN(IDR, MDR2) )
  1667. ELSE IF (RR .LE. RR_DR3) THEN
  1668. IDR=INT( 1.3006E3*RR**.2083 + .5 )
  1669. IDR=MAX( MDR2, MIN(IDR, MDR3) )
  1670. ELSE IF (RR .LE. RR_DRmax) THEN
  1671. IDR=INT( 1.355E3*RR**.2144 + .5 )
  1672. IDR=MAX( MDR3, MIN(IDR, MDRmax) )
  1673. ELSE
  1674. IDR=MDRmax
  1675. ENDIF ! End IF (RR .LE. RR_DRmin)
  1676. VRAIN2=GAMMAR*VRAIN(IDR)
  1677. QRnew=TOT_RAINnew/(THICK+BLDTRH*VRAIN2)
  1678. IF (QRnew .LE. EPSQ) QRnew=0.
  1679. IF (QR.GT.0. .AND. QRnew.NE.0.) THEN
  1680. DUM=QRnew/QR
  1681. IF (DUM .LT. TOLER) QRnew=0.
  1682. ENDIF
  1683. ARAINnew=BLDTRH*VRAIN2*QRnew
  1684. IF (ARAIN.GT.0. .AND. ARAINnew.NE.0.) THEN
  1685. DUM=ARAINnew/ARAIN
  1686. IF (DUM .LT. TOLER) ARAINnew=0.
  1687. ENDIF
  1688. ENDIF
  1689. !
  1690. WCnew=QWnew+QRnew+QInew
  1691. !
  1692. !----------------------------------------------------------------------
  1693. !-------------- Begin debugging & verification ------------------------
  1694. !----------------------------------------------------------------------
  1695. !
  1696. !--- QT, QTnew - total water (vapor & condensate) before & after microphysics, resp.
  1697. !
  1698. QT=THICK*(WV+WC)+ARAIN+ASNOW
  1699. QTnew=THICK*(WVnew+WCnew)+ARAINnew+ASNOWnew
  1700. BUDGET=QT-QTnew
  1701. !
  1702. !--- Additional check on budget preservation, accounting for truncation effects
  1703. !
  1704. DBG_logical=.FALSE.
  1705. ! DUM=ABS(BUDGET)
  1706. ! IF (DUM .GT. TOLER) THEN
  1707. ! DUM=DUM/MIN(QT, QTnew)
  1708. ! IF (DUM .GT. TOLER) DBG_logical=.TRUE.
  1709. ! ENDIF
  1710. !!
  1711. ! DUM=(RHgrd+.001)*QSInew
  1712. ! IF ( (QWnew.GT.EPSQ) .OR. QRnew.GT.EPSQ .OR. WVnew.GT.DUM)
  1713. ! & .AND. TC.LT.T_ICE ) DBG_logical=.TRUE.
  1714. !
  1715. ! IF (TC.GT.5. .AND. QInew.GT.EPSQ) DBG_logical=.TRUE.
  1716. !
  1717. IF ((WVnew.LT.EPSQ .OR. DBG_logical) .AND. PRINT_diag) THEN
  1718. !
  1719. WRITE(6,"(/2(a,i4),2(a,i2))") '{} i=',I_index,' j=',J_index,&
  1720. & ' L=',L,' LSFC=',LSFC
  1721. !
  1722. ESW=MIN(1000.*FPVS0(Tnew),0.99*PP)
  1723. QSWnew=EPS*ESW/(PP-ESW)
  1724. IF (TC.LT.0. .OR. Tnew .LT. 0.) THEN
  1725. ESI=MIN(1000.*FPVS(Tnew),0.99*PP)
  1726. QSInew=EPS*ESI/(PP-ESI)
  1727. ELSE
  1728. QSI=QSW
  1729. QSInew=QSWnew
  1730. ENDIF
  1731. WSnew=QSInew
  1732. WRITE(6,"(4(a12,g11.4,1x))") &
  1733. & '{} TCold=',TC,'TCnew=',Tnew-T0C,'P=',.01*PP,'RHO=',RHO, &
  1734. & '{} THICK=',THICK,'RHold=',WV/WS,'RHnew=',WVnew/WSnew, &
  1735. & 'RHgrd=',RHgrd, &
  1736. & '{} RHWold=',WV/QSW,'RHWnew=',WVnew/QSWnew,'RHIold=',WV/QSI, &
  1737. & 'RHInew=',WVnew/QSInew, &
  1738. & '{} QSWold=',QSW,'QSWnew=',QSWnew,'QSIold=',QSI,'QSInew=',QSInew, &
  1739. & '{} WSold=',WS,'WSnew=',WSnew,'WVold=',WV,'WVnew=',WVnew, &
  1740. & '{} WCold=',WC,'WCnew=',WCnew,'QWold=',QW,'QWnew=',QWnew, &
  1741. & '{} QIold=',QI,'QInew=',QInew,'QRold=',QR,'QRnew=',QRnew, &
  1742. & '{} ARAINold=',ARAIN,'ARAINnew=',ARAINnew,'ASNOWold=',ASNOW, &
  1743. & 'ASNOWnew=',ASNOWnew, &
  1744. & '{} TOT_RAIN=',TOT_RAIN,'TOT_RAINnew=',TOT_RAINnew, &
  1745. & 'TOT_ICE=',TOT_ICE,'TOT_ICEnew=',TOT_ICEnew, &
  1746. & '{} BUDGET=',BUDGET,'QTold=',QT,'QTnew=',QTnew
  1747. !
  1748. WRITE(6,"(4(a12,g11.4,1x))") &
  1749. & '{} DELT=',DELT,'DELV=',DELV,'DELW=',DELW,'DELI=',DELI, &
  1750. & '{} DELR=',DELR,'PCOND=',PCOND,'PIDEP=',PIDEP,'PIEVP=',PIEVP, &
  1751. & '{} PICND=',PICND,'PREVP=',PREVP,'PRAUT=',PRAUT,'PRACW=',PRACW, &
  1752. & '{} PIACW=',PIACW,'PIACWI=',PIACWI,'PIACWR=',PIACWR,'PIMLT=', &
  1753. & PIMLT, &
  1754. & '{} PIACR=',PIACR
  1755. !
  1756. IF (ICE_logical) WRITE(6,"(4(a12,g11.4,1x))") &
  1757. & '{} RimeF1=',RimeF1,'GAMMAS=',GAMMAS,'VrimeF=',VrimeF, &
  1758. & 'VSNOW=',VSNOW, &
  1759. & '{} INDEXS=',FLOAT(INDEXS),'FLARGE=',FLARGE,'FSMALL=',FSMALL, &
  1760. & 'FLIMASS=',FLIMASS, &
  1761. & '{} XSIMASS=',XSIMASS,'XLIMASS=',XLIMASS,'QLICE=',QLICE, &
  1762. & 'QTICE=',QTICE, &
  1763. & '{} NLICE=',NLICE,'NSmICE=',NSmICE,'PILOSS=',PILOSS, &
  1764. & 'EMAIRI=',EMAIRI, &
  1765. & '{} RimeF=',RimeF
  1766. !
  1767. IF (TOT_RAIN.GT.0. .OR. TOT_RAINnew.GT.0.) &
  1768. & WRITE(6,"(4(a12,g11.4,1x))") &
  1769. & '{} INDEXR1=',FLOAT(INDEXR1),'INDEXR=',FLOAT(INDEXR), &
  1770. & 'GAMMAR=',GAMMAR,'N0r=',N0r, &
  1771. & '{} VRAIN1=',VRAIN1,'VRAIN2=',VRAIN2,'QTRAIN=',QTRAIN,'RQR=',RQR, &
  1772. & '{} PRLOSS=',PRLOSS,'VOLR1=',THICK+BLDTRH*VRAIN1, &
  1773. & 'VOLR2=',THICK+BLDTRH*VRAIN2
  1774. !
  1775. IF (PRAUT .GT. 0.) WRITE(6,"(a12,g11.4,1x)") '{} QW0=',QW0
  1776. !
  1777. IF (PRACW .GT. 0.) WRITE(6,"(a12,g11.4,1x)") '{} FWR=',FWR
  1778. !
  1779. IF (PIACR .GT. 0.) WRITE(6,"(a12,g11.4,1x)") '{} FIR=',FIR
  1780. !
  1781. DUM=PIMLT+PICND-PREVP-PIEVP
  1782. IF (DUM.GT.0. .or. DWVi.NE.0.) &
  1783. & WRITE(6,"(4(a12,g11.4,1x))") &
  1784. & '{} TFACTOR=',TFACTOR,'DYNVIS=',DYNVIS, &
  1785. & 'THERM_CON=',THERM_COND,'DIFFUS=',DIFFUS
  1786. !
  1787. IF (PREVP .LT. 0.) WRITE(6,"(4(a12,g11.4,1x))") &
  1788. & '{} RFACTOR=',RFACTOR,'ABW=',ABW,'VENTR=',VENTR,'CREVP=',CREVP, &
  1789. & '{} DWVr=',DWVr,'DENOMW=',DENOMW
  1790. !
  1791. IF (PIDEP.NE.0. .AND. DWVi.NE.0.) &
  1792. & WRITE(6,"(4(a12,g11.4,1x))") &
  1793. & '{} DWVi=',DWVi,'DENOMI=',DENOMI,'PIDEP_max=',PIDEP_max, &
  1794. & 'SFACTOR=',SFACTOR, &
  1795. & '{} ABI=',ABI,'VENTIL=',VENTIL,'VENTIL1=',VENTI1(INDEXS), &
  1796. & 'VENTIL2=',SFACTOR*VENTI2(INDEXS), &
  1797. & '{} VENTIS=',VENTIS,'DIDEP=',DIDEP
  1798. !
  1799. IF (PIDEP.GT.0. .AND. PCOND.NE.0.) &
  1800. & WRITE(6,"(4(a12,g11.4,1x))") &
  1801. & '{} DENOMW=',DENOMW,'DENOMWI=',DENOMWI,'DENOMF=',DENOMF, &
  1802. & 'DUM2=',PCOND-PIACW
  1803. !
  1804. IF (FWS .GT. 0.) WRITE(6,"(4(a12,g11.4,1x))") &
  1805. & '{} FWS=',FWS
  1806. !
  1807. DUM=PIMLT+PICND-PIEVP
  1808. IF (DUM.GT. 0.) WRITE(6,"(4(a12,g11.4,1x))") &
  1809. & '{} SFACTOR=',SFACTOR,'VENTIL=',VENTIL,'VENTIL1=',VENTI1(INDEXS), &
  1810. & 'VENTIL2=',SFACTOR*VENTI2(INDEXS), &
  1811. & '{} AIEVP=',AIEVP,'DIEVP=',DIEVP,'QSW0=',QSW0,'DWV0=',DWV0
  1812. !
  1813. ENDIF
  1814. !
  1815. !-----------------------------------------------------------------------
  1816. !--------------- Water budget statistics & maximum values --------------
  1817. !-----------------------------------------------------------------------
  1818. !
  1819. IF (PRINT_diag) THEN
  1820. ITdx=MAX( ITLO, MIN( INT(Tnew-T0C), ITHI ) )
  1821. IF (QInew .GT. EPSQ) NSTATS(ITdx,1)=NSTATS(ITdx,1)+1
  1822. IF (QInew.GT.EPSQ .AND. QRnew+QWnew.GT.EPSQ) &
  1823. & NSTATS(ITdx,2)=NSTATS(ITdx,2)+1
  1824. IF (QWnew .GT. EPSQ) NSTATS(ITdx,3)=NSTATS(ITdx,3)+1
  1825. IF (QRnew .GT. EPSQ) NSTATS(ITdx,4)=NSTATS(ITdx,4)+1
  1826. !
  1827. QMAX(ITdx,1)=MAX(QMAX(ITdx,1), QInew)
  1828. QMAX(ITdx,2)=MAX(QMAX(ITdx,2), QWnew)
  1829. QMAX(ITdx,3)=MAX(QMAX(ITdx,3), QRnew)
  1830. QMAX(ITdx,4)=MAX(QMAX(ITdx,4), ASNOWnew)
  1831. QMAX(ITdx,5)=MAX(QMAX(ITdx,5), ARAINnew)
  1832. QTOT(ITdx,1)=QTOT(ITdx,1)+QInew*THICK
  1833. QTOT(ITdx,2)=QTOT(ITdx,2)+QWnew*THICK
  1834. QTOT(ITdx,3)=QTOT(ITdx,3)+QRnew*THICK
  1835. !
  1836. QTOT(ITdx,4)=QTOT(ITdx,4)+PCOND*THICK
  1837. QTOT(ITdx,5)=QTOT(ITdx,5)+PICND*THICK
  1838. QTOT(ITdx,6)=QTOT(ITdx,6)+PIEVP*THICK
  1839. QTOT(ITdx,7)=QTOT(ITdx,7)+PIDEP*THICK
  1840. QTOT(ITdx,8)=QTOT(ITdx,8)+PREVP*THICK
  1841. QTOT(ITdx,9)=QTOT(ITdx,9)+PRAUT*THICK
  1842. QTOT(ITdx,10)=QTOT(ITdx,10)+PRACW*THICK
  1843. QTOT(ITdx,11)=QTOT(ITdx,11)+PIMLT*THICK
  1844. QTOT(ITdx,12)=QTOT(ITdx,12)+PIACW*THICK
  1845. QTOT(ITdx,13)=QTOT(ITdx,13)+PIACWI*THICK
  1846. QTOT(ITdx,14)=QTOT(ITdx,14)+PIACWR*THICK
  1847. QTOT(ITdx,15)=QTOT(ITdx,15)+PIACR*THICK
  1848. !
  1849. QTOT(ITdx,16)=QTOT(ITdx,16)+(WVnew-WV)*THICK
  1850. QTOT(ITdx,17)=QTOT(ITdx,17)+(QWnew-QW)*THICK
  1851. QTOT(ITdx,18)=QTOT(ITdx,18)+(QInew-QI)*THICK
  1852. QTOT(ITdx,19)=QTOT(ITdx,19)+(QRnew-QR)*THICK
  1853. QTOT(ITdx,20)=QTOT(ITdx,20)+(ARAINnew-ARAIN)
  1854. QTOT(ITdx,21)=QTOT(ITdx,21)+(ASNOWnew-ASNOW)
  1855. IF (QInew .GT. 0.) &
  1856. & QTOT(ITdx,22)=QTOT(ITdx,22)+QInew*THICK/RimeF
  1857. !
  1858. ENDIF
  1859. !
  1860. !----------------------------------------------------------------------
  1861. !------------------------- Update arrays ------------------------------
  1862. !----------------------------------------------------------------------
  1863. !
  1864. T_col(L)=Tnew ! Updated temperature
  1865. !
  1866. QV_col(L)=max(EPSQ, WVnew/(1.+WVnew)) ! Updated specific humidity
  1867. WC_col(L)=max(EPSQ, WCnew) ! Updated total condensate mixing ratio
  1868. QI_col(L)=max(EPSQ, QInew) ! Updated ice mixing ratio
  1869. QR_col(L)=max(EPSQ, QRnew) ! Updated rain mixing ratio
  1870. QW_col(L)=max(EPSQ, QWnew) ! Updated cloud water mixing ratio
  1871. RimeF_col(L)=RimeF ! Updated rime factor
  1872. ASNOW=ASNOWnew ! Updated accumulated snow
  1873. ARAIN=ARAINnew ! Updated accumulated rain
  1874. !
  1875. !#######################################################################
  1876. !
  1877. 10 CONTINUE ! ##### End "L" loop through model levels #####
  1878. !
  1879. !#######################################################################
  1880. !
  1881. !-----------------------------------------------------------------------
  1882. !--------------------------- Return to GSMDRIVE -----------------------
  1883. !-----------------------------------------------------------------------
  1884. !
  1885. CONTAINS
  1886. !#######################################################################
  1887. !--------- Produces accurate calculation of cloud condensation ---------
  1888. !#######################################################################
  1889. !
  1890. REAL FUNCTION CONDENSE (PP, QW, TK, WV)
  1891. !
  1892. !---------------------------------------------------------------------------------
  1893. !------ The Asai (1965) algorithm takes into consideration the release of ------
  1894. !------ latent heat in increasing the temperature & in increasing the ------
  1895. !------ saturation mixing ratio (following the Clausius-Clapeyron eqn.). ------
  1896. !---------------------------------------------------------------------------------
  1897. !
  1898. IMPLICIT NONE
  1899. !
  1900. INTEGER, PARAMETER :: HIGH_PRES=Selected_Real_Kind(15)
  1901. REAL (KIND=HIGH_PRES), PARAMETER :: &
  1902. & RHLIMIT=.001, RHLIMIT1=-RHLIMIT
  1903. REAL (KIND=HIGH_PRES) :: COND, SSAT, WCdum
  1904. !
  1905. REAL,INTENT(IN) :: QW,PP,WV,TK
  1906. REAL WVdum,Tdum,XLV2,DWV,WS,ESW,XLV1,XLV
  1907. integer nsteps
  1908. !
  1909. !-----------------------------------------------------------------------
  1910. !
  1911. !--- LV (T) is from Bolton (JAS, 1980)
  1912. !
  1913. XLV=3.148E6-2370.*TK
  1914. XLV1=XLV*RCP
  1915. XLV2=XLV*XLV*RCPRV
  1916. Tdum=TK
  1917. WVdum=WV
  1918. WCdum=QW
  1919. ESW=MIN(1000.*FPVS0(Tdum),0.99*PP) ! Saturation vapor press w/r/t water
  1920. WS=RHgrd*EPS*ESW/(PP-ESW) ! Saturation mixing ratio w/r/t water
  1921. DWV=WVdum-WS ! Deficit grid-scale water vapor mixing ratio
  1922. SSAT=DWV/WS ! Supersaturation ratio
  1923. CONDENSE=0.
  1924. nsteps = 0
  1925. DO WHILE ((SSAT.LT.RHLIMIT1 .AND. WCdum.GT.EPSQ) &
  1926. & .OR. SSAT.GT.RHLIMIT)
  1927. nsteps = nsteps + 1
  1928. COND=DWV/(1.+XLV2*WS/(Tdum*Tdum)) ! Asai (1965, J. Japan)
  1929. COND=MAX(COND, -WCdum) ! Limit cloud water evaporation
  1930. Tdum=Tdum+XLV1*COND ! Updated temperature
  1931. WVdum=WVdum-COND ! Updated water vapor mixing ratio
  1932. WCdum=WCdum+COND ! Updated cloud water mixing ratio
  1933. CONDENSE=CONDENSE+COND ! Total cloud water condensation
  1934. ESW=MIN(1000.*FPVS0(Tdum),0.99*PP) ! Updated saturation vapor press w/r/t water
  1935. WS=RHgrd*EPS*ESW/(PP-ESW) ! Updated saturation mixing ratio w/r/t water
  1936. DWV=WVdum-WS ! Deficit grid-scale water vapor mixing ratio
  1937. SSAT=DWV/WS ! Grid-scale supersaturation ratio
  1938. ENDDO
  1939. !
  1940. END FUNCTION CONDENSE
  1941. !
  1942. !#######################################################################
  1943. !---------------- Calculate ice deposition at T<T_ICE ------------------
  1944. !#######################################################################
  1945. !
  1946. REAL FUNCTION DEPOSIT (PP, Tdum, WVdum)
  1947. !
  1948. !--- Also uses the Asai (1965) algorithm, but uses a different target
  1949. ! vapor pressure for the adjustment
  1950. !
  1951. IMPLICIT NONE
  1952. !
  1953. INTEGER, PARAMETER :: HIGH_PRES=Selected_Real_Kind(15)
  1954. REAL (KIND=HIGH_PRES), PARAMETER :: RHLIMIT=.001, &
  1955. & RHLIMIT1=-RHLIMIT
  1956. REAL (KIND=HIGH_PRES) :: DEP, SSAT
  1957. !
  1958. real,INTENT(IN) :: PP
  1959. real,INTENT(INOUT) :: WVdum,Tdum
  1960. real ESI,WS,DWV
  1961. !
  1962. !-----------------------------------------------------------------------
  1963. !
  1964. ESI=MIN(1000.*FPVS(Tdum),0.99*PP) ! Saturation vapor press w/r/t ice
  1965. WS=RHgrd*EPS*ESI/(PP-ESI) ! Saturation mixing ratio
  1966. DWV=WVdum-WS ! Deficit grid-scale water vapor mixing ratio
  1967. SSAT=DWV/WS ! Supersaturation ratio
  1968. DEPOSIT=0.
  1969. DO WHILE (SSAT.GT.RHLIMIT .OR. SSAT.LT.RHLIMIT1)
  1970. !
  1971. !--- Note that XLVS2=LS*LV/(CP*RV)=LV*WS/(RV*T*T)*(LS/CP*DEP1),
  1972. ! where WS is the saturation mixing ratio following Clausius-
  1973. ! Clapeyron (see Asai,1965; Young,1993,p.405)
  1974. !
  1975. DEP=DWV/(1.+XLS2*WS/(Tdum*Tdum)) ! Asai (1965, J. Japan)
  1976. Tdum=Tdum+XLS1*DEP ! Updated temperature
  1977. WVdum=WVdum-DEP ! Updated ice mixing ratio
  1978. DEPOSIT=DEPOSIT+DEP ! Total ice deposition
  1979. ESI=MIN(1000.*FPVS(Tdum),0.99*PP) ! Updated saturation vapor press w/r/t ice
  1980. WS=RHgrd*EPS*ESI/(PP-ESI) ! Updated saturation mixing ratio w/r/t ice
  1981. DWV=WVdum-WS ! Deficit grid-scale water vapor mixing ratio
  1982. SSAT=DWV/WS ! Grid-scale supersaturation ratio
  1983. ENDDO
  1984. !
  1985. END FUNCTION DEPOSIT
  1986. !
  1987. END SUBROUTINE EGCP01COLUMN
  1988. !#######################################################################
  1989. !------- Initialize constants & lookup tables for microphysics ---------
  1990. !#######################################################################
  1991. !
  1992. ! SH 0211/2002
  1993. !-----------------------------------------------------------------------
  1994. SUBROUTINE ETAOLDinit (GSMDT,DT,DELX,DELY,LOWLYR,restart, &
  1995. & F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY, &
  1996. & MP_RESTART_STATE,TBPVS_STATE,TBPVS0_STATE, &
  1997. & ALLOWED_TO_READ, &
  1998. & IDS,IDE,JDS,JDE,KDS,KDE, &
  1999. & IMS,IME,JMS,JME,KMS,KME, &
  2000. & ITS,ITE,JTS,JTE,KTS,KTE )
  2001. !-----------------------------------------------------------------------
  2002. !-------------------------------------------------------------------------------
  2003. !--- SUBPROGRAM DOCUMENTATION BLOCK
  2004. ! PRGRMMR: Ferrier ORG: W/NP22 DATE: February 2001
  2005. ! Jin ORG: W/NP22 DATE: January 2002
  2006. ! (Modification for WRF structure)
  2007. !
  2008. !-------------------------------------------------------------------------------
  2009. ! ABSTRACT:
  2010. ! * Reads various microphysical lookup tables used in COLUMN_MICRO
  2011. ! * Lookup tables were created "offline" and are read in during execution
  2012. ! * Creates lookup tables for saturation vapor pressure w/r/t water & ice
  2013. !-------------------------------------------------------------------------------
  2014. !
  2015. ! USAGE: CALL ETAOLDinit FROM SUBROUTINE GSMDRIVE AT MODEL START TIME
  2016. !
  2017. ! INPUT ARGUMENT LIST:
  2018. ! DTPH - physics time step (s)
  2019. !
  2020. ! OUTPUT ARGUMENT LIST:
  2021. ! NONE
  2022. !
  2023. ! OUTPUT FILES:
  2024. ! NONE
  2025. !
  2026. ! SUBROUTINES:
  2027. ! MY_GROWTH_RATES - lookup table for growth of nucleated ice
  2028. ! GPVS - lookup tables for saturation vapor pressure (water, ice)
  2029. !
  2030. ! UNIQUE: NONE
  2031. !
  2032. ! LIBRARY: NONE
  2033. !
  2034. ! COMMON BLOCKS:
  2035. ! CMICRO_CONS - constants used in GSMCOLUMN
  2036. ! CMY600 - lookup table for growth of ice crystals in
  2037. ! water saturated conditions (Miller & Young, 1979)
  2038. ! IVENT_TABLES - lookup tables for ventilation effects of ice
  2039. ! IACCR_TABLES - lookup tables for accretion rates of ice
  2040. ! IMASS_TABLES - lookup tables for mass content of ice
  2041. ! IRATE_TABLES - lookup tables for precipitation rates of ice
  2042. ! IRIME_TABLES - lookup tables for increase in fall speed of rimed ice
  2043. ! MAPOT - Need lat/lon grid resolution
  2044. ! RVENT_TABLES - lookup tables for ventilation effects of rain
  2045. ! RACCR_TABLES - lookup tables for accretion rates of rain
  2046. ! RMASS_TABLES - lookup tables for mass content of rain
  2047. ! RVELR_TABLES - lookup tables for fall speeds of rain
  2048. ! RRATE_TABLES - lookup tables for precipitation rates of rain
  2049. !
  2050. ! ATTRIBUTES:
  2051. ! LANGUAGE: FORTRAN 90
  2052. ! MACHINE : IBM SP
  2053. !
  2054. !-----------------------------------------------------------------------
  2055. !
  2056. !
  2057. !-----------------------------------------------------------------------
  2058. IMPLICIT NONE
  2059. !-----------------------------------------------------------------------
  2060. !-------------------------------------------------------------------------
  2061. !-------------- Parameters & arrays for lookup tables --------------------
  2062. !-------------------------------------------------------------------------
  2063. !
  2064. !--- Common block of constants used in column microphysics
  2065. !
  2066. !WRF
  2067. ! real DLMD,DPHD
  2068. !WRF
  2069. !
  2070. !-----------------------------------------------------------------------
  2071. !--- Parameters & data statement for local calculations
  2072. !-----------------------------------------------------------------------
  2073. !
  2074. INTEGER, PARAMETER :: MDR1=XMR1, MDR2=XMR2, MDR3=XMR3
  2075. !
  2076. ! VARIABLES PASSED IN
  2077. integer,INTENT(IN) :: IDS,IDE,JDS,JDE,KDS,KDE &
  2078. & ,IMS,IME,JMS,JME,KMS,KME &
  2079. & ,ITS,ITE,JTS,JTE,KTS,KTE
  2080. !WRF
  2081. INTEGER, DIMENSION(ims:ime,jms:jme),INTENT(INOUT) :: LOWLYR
  2082. !
  2083. real, INTENT(IN) :: DELX,DELY
  2084. real,DIMENSION(*), INTENT(INOUT) :: MP_RESTART_STATE
  2085. real,DIMENSION(NX), INTENT(INOUT) :: TBPVS_STATE,TBPVS0_STATE
  2086. real,DIMENSION(ims:ime, kms:kme, jms:jme),INTENT(OUT) :: &
  2087. & F_ICE_PHY,F_RAIN_PHY,F_RIMEF_PHY
  2088. INTEGER, PARAMETER :: ITLO=-60, ITHI=40
  2089. ! integer,DIMENSION(ITLO:ITHI,4),INTENT(INOUT) :: NSTATS
  2090. ! real,DIMENSION(ITLO:ITHI,5),INTENT(INOUT) :: QMAX
  2091. ! real,DIMENSION(ITLO:ITHI,22),INTENT(INOUT) :: QTOT
  2092. ! real,INTENT(INOUT) :: PRECtot(2),PRECmax(2)
  2093. real,INTENT(IN) :: DT,GSMDT
  2094. LOGICAL,INTENT(IN) :: allowed_to_read,restart
  2095. !
  2096. !-----------------------------------------------------------------------
  2097. ! LOCAL VARIABLES
  2098. !-----------------------------------------------------------------------
  2099. REAL :: BBFR,DTPH,PI,DX,Thour_print
  2100. INTEGER :: I,IM,J,L,K,JTF,KTF,ITF
  2101. INTEGER :: etampnew_unit1
  2102. LOGICAL, PARAMETER :: PRINT_diag=.FALSE.
  2103. LOGICAL :: opened
  2104. LOGICAL , EXTERNAL :: wrf_dm_on_monitor
  2105. CHARACTER*80 errmess
  2106. !
  2107. !-----------------------------------------------------------------------
  2108. !
  2109. JTF=MIN0(JTE,JDE-1)
  2110. KTF=MIN0(KTE,KDE-1)
  2111. ITF=MIN0(ITE,IDE-1)
  2112. !
  2113. DO J=JTS,JTF
  2114. DO I=ITS,ITF
  2115. LOWLYR(I,J)=1
  2116. ENDDO
  2117. ENDDO
  2118. !
  2119. IF(.NOT.RESTART)THEN
  2120. DO J = jts,jte
  2121. DO K = kts,kte
  2122. DO I= its,ite
  2123. F_ICE_PHY(i,k,j)=0.
  2124. F_RAIN_PHY(i,k,j)=0.
  2125. F_RIMEF_PHY(i,k,j)=1.
  2126. ENDDO
  2127. ENDDO
  2128. ENDDO
  2129. ENDIF
  2130. !
  2131. !-----------------------------------------------------------------------
  2132. IF(ALLOWED_TO_READ)THEN
  2133. !-----------------------------------------------------------------------
  2134. !
  2135. DX=((DELX)**2+(DELY)**2)**.5/1000. ! Model resolution at equator (km)
  2136. DX=MIN(100., MAX(5., DX) )
  2137. !
  2138. !-- Relative humidity threshold for the onset of grid-scale condensation
  2139. !!-- 9/1/01: Assume the following functional dependence for 5 - 100 km resolution:
  2140. !! RHgrd=0.90 for dx=100 km, 0.98 for dx=5 km, where
  2141. ! RHgrd=0.90+.08*((100.-DX)/95.)**.5
  2142. !
  2143. DTPH=MAX(GSMDT*60.,DT)
  2144. DTPH=NINT(DTPH/DT)*DT
  2145. !
  2146. !--- Create lookup tables for saturation vapor pressure w/r/t water & ice
  2147. !
  2148. CALL GPVS
  2149. !
  2150. !--- Read in various lookup tables
  2151. !
  2152. IF ( wrf_dm_on_monitor() ) THEN
  2153. DO i = 31,99
  2154. INQUIRE ( i , OPENED = opened )
  2155. IF ( .NOT. opened ) THEN
  2156. etampnew_unit1 = i
  2157. GOTO 2061
  2158. ENDIF
  2159. ENDDO
  2160. etampnew_unit1 = -1
  2161. 2061 CONTINUE
  2162. ENDIF
  2163. !
  2164. CALL wrf_dm_bcast_bytes ( etampnew_unit1 , IWORDSIZE )
  2165. !
  2166. IF ( etampnew_unit1 < 0 ) THEN
  2167. CALL wrf_error_fatal ( 'module_mp_etaold: ETAOLDinit: Can not find '// &
  2168. 'unused fortran unit to read in lookup table.' )
  2169. ENDIF
  2170. !
  2171. IF ( wrf_dm_on_monitor() ) THEN
  2172. OPEN(UNIT=etampnew_unit1,FILE="ETAMPNEW_DATA", &
  2173. & FORM="UNFORMATTED",STATUS="OLD",ERR=9061)
  2174. !
  2175. READ(etampnew_unit1) VENTR1
  2176. READ(etampnew_unit1) VENTR2
  2177. READ(etampnew_unit1) ACCRR
  2178. READ(etampnew_unit1) MASSR
  2179. READ(etampnew_unit1) VRAIN
  2180. READ(etampnew_unit1) RRATE
  2181. READ(etampnew_unit1) VENTI1
  2182. READ(etampnew_unit1) VENTI2
  2183. READ(etampnew_unit1) ACCRI
  2184. READ(etampnew_unit1) MASSI
  2185. READ(etampnew_unit1) VSNOWI
  2186. READ(etampnew_unit1) VEL_RF
  2187. CLOSE (etampnew_unit1)
  2188. ENDIF
  2189. !
  2190. CALL wrf_dm_bcast_bytes ( VENTR1 , size ( VENTR1 ) * RWORDSIZE )
  2191. CALL wrf_dm_bcast_bytes ( VENTR2 , size ( VENTR2 ) * RWORDSIZE )
  2192. CALL wrf_dm_bcast_bytes ( ACCRR , size ( ACCRR ) * RWORDSIZE )
  2193. CALL wrf_dm_bcast_bytes ( MASSR , size ( MASSR ) * RWORDSIZE )
  2194. CALL wrf_dm_bcast_bytes ( VRAIN , size ( VRAIN ) * RWORDSIZE )
  2195. CALL wrf_dm_bcast_bytes ( RRATE , size ( RRATE ) * RWORDSIZE )
  2196. CALL wrf_dm_bcast_bytes ( VENTI1 , size ( VENTI1 ) * RWORDSIZE )
  2197. CALL wrf_dm_bcast_bytes ( VENTI2 , size ( VENTI2 ) * RWORDSIZE )
  2198. CALL wrf_dm_bcast_bytes ( ACCRI , size ( ACCRI ) * RWORDSIZE )
  2199. CALL wrf_dm_bcast_bytes ( MASSI , size ( MASSI ) * RWORDSIZE )
  2200. CALL wrf_dm_bcast_bytes ( VSNOWI , size ( VSNOWI ) * RWORDSIZE )
  2201. CALL wrf_dm_bcast_bytes ( VEL_RF , size ( VEL_RF ) * RWORDSIZE )
  2202. !
  2203. !--- Calculates coefficients for growth rates of ice nucleated in water
  2204. ! saturated conditions, scaled by physics time step (lookup table)
  2205. !
  2206. CALL MY_GROWTH_RATES (DTPH)
  2207. ! CALL MY_GROWTH_RATES (DTPH,MY_GROWTH)
  2208. !
  2209. PI=ACOS(-1.)
  2210. !
  2211. !--- Constants associated with Biggs (1953) freezing of rain, as parameterized
  2212. ! following Lin et al. (JCAM, 1983) & Reisner et al. (1998, QJRMS).
  2213. !
  2214. ABFR=-0.66
  2215. BBFR=100.
  2216. CBFR=20.*PI*PI*BBFR*RHOL*1.E-21
  2217. !
  2218. !--- CIACW is used in calculating riming rates
  2219. ! The assumed effective collection efficiency of cloud water rimed onto
  2220. ! ice is =0.5 below:
  2221. !
  2222. CIACW=DTPH*0.25*PI*0.5*(1.E5)**C1
  2223. !
  2224. !--- CIACR is used in calculating freezing of rain colliding with large ice
  2225. ! The assumed collection efficiency is 1.0
  2226. !
  2227. CIACR=PI*DTPH
  2228. !
  2229. !--- Based on rain lookup tables for mean diameters from 0.05 to 0.45 mm
  2230. ! * Four different functional relationships of mean drop diameter as
  2231. ! a function of rain rate (RR), derived based on simple fits to
  2232. ! mass-weighted fall speeds of rain as functions of mean diameter
  2233. ! from the lookup tables.
  2234. !
  2235. RR_DRmin=N0r0*RRATE(MDRmin) ! RR for mean drop diameter of .05 mm
  2236. RR_DR1=N0r0*RRATE(MDR1) ! RR for mean drop diameter of .10 mm
  2237. RR_DR2=N0r0*RRATE(MDR2) ! RR for mean drop diameter of .20 mm
  2238. RR_DR3=N0r0*RRATE(MDR3) ! RR for mean drop diameter of .32 mm
  2239. RR_DRmax=N0r0*RRATE(MDRmax) ! RR for mean drop diameter of .45 mm
  2240. !
  2241. RQR_DRmin=N0r0*MASSR(MDRmin) ! Rain content for mean drop diameter of .05 mm
  2242. RQR_DR1=N0r0*MASSR(MDR1) ! Rain content for mean drop diameter of .10 mm
  2243. RQR_DR2=N0r0*MASSR(MDR2) ! Rain content for mean drop diameter of .20 mm
  2244. RQR_DR3=N0r0*MASSR(MDR3) ! Rain content for mean drop diameter of .32 mm
  2245. RQR_DRmax=N0r0*MASSR(MDRmax) ! Rain content for mean drop diameter of .45 mm
  2246. C_N0r0=PI*RHOL*N0r0
  2247. CN0r0=1.E6/C_N0r0**.25
  2248. CN0r_DMRmin=1./(PI*RHOL*DMRmin**4)
  2249. CN0r_DMRmax=1./(PI*RHOL*DMRmax**4)
  2250. !
  2251. !--- CRACW is used in calculating collection of cloud water by rain (an
  2252. ! assumed collection efficiency of 1.0)
  2253. !
  2254. CRACW=DTPH*0.25*PI*1.0
  2255. !
  2256. ESW0=1000.*FPVS0(T0C) ! Saturation vapor pressure at 0C
  2257. RFmax=1.1**Nrime ! Maximum rime factor allowed
  2258. !
  2259. !------------------------------------------------------------------------
  2260. !--------------- Constants passed through argument list -----------------
  2261. !------------------------------------------------------------------------
  2262. !
  2263. !--- Important parameters for self collection (autoconversion) of
  2264. ! cloud water to rain.
  2265. !
  2266. !--- CRAUT is proportional to the rate that cloud water is converted by
  2267. ! self collection to rain (autoconversion rate)
  2268. !
  2269. CRAUT=1.-EXP(-1.E-3*DTPH)
  2270. !
  2271. !--- QAUT0 is the threshold cloud content for autoconversion to rain
  2272. ! needed for droplets to reach a diameter of 20 microns (following
  2273. ! Manton and Cotton, 1977; Banta and Hanson, 1987, JCAM)
  2274. !--- QAUT0=1.2567, 0.8378, or 0.4189 g/m**3 for droplet number concentrations
  2275. ! of 300, 200, and 100 cm**-3, respectively
  2276. !
  2277. QAUT0=PI*RHOL*NCW*(20.E-6)**3/6.
  2278. !
  2279. !--- For calculating snow optical depths by considering bulk density of
  2280. ! snow based on emails from Q. Fu (6/27-28/01), where optical
  2281. ! depth (T) = 1.5*SWP/(Reff*DENS), SWP is snow water path, Reff
  2282. ! is effective radius, and DENS is the bulk density of snow.
  2283. !
  2284. ! SWP (kg/m**2)=(1.E-3 kg/g)*SWPrad, SWPrad in g/m**2 used in radiation
  2285. ! T = 1.5*1.E3*SWPrad/(Reff*DENS)
  2286. !
  2287. ! See derivation for MASSI(INDEXS), note equal to RHO*QSNOW/NSNOW
  2288. !
  2289. ! SDENS=1.5e3/DENS, DENS=MASSI(INDEXS)/[PI*(1.E-6*INDEXS)**3]
  2290. !
  2291. DO I=MDImin,MDImax
  2292. SDENS(I)=PI*1.5E-15*FLOAT(I*I*I)/MASSI(I)
  2293. ENDDO
  2294. !
  2295. Thour_print=-DTPH/3600.
  2296. ! SH 0211/2002
  2297. ! IF (PRINT_diag) THEN
  2298. !-------- Total and maximum quantities
  2299. !
  2300. ! NSTATS=0 ! Microphysical statistics dealing w/ grid-point counts
  2301. ! QMAX=0. ! Microphysical statistics dealing w/ hydrometeor mass
  2302. ! QTOT=0. ! Microphysical statistics dealing w/ hydrometeor mass
  2303. ! PRECmax=0. ! Maximum precip rates (rain, snow) at surface (mm/h)
  2304. ! PRECtot=0. ! Total precipitation (rain, snow) accumulation at surface
  2305. ! ENDIF
  2306. !wrf
  2307. IF(.NOT.RESTART)THEN
  2308. MP_RESTART_STATE(MY_T1:MY_T2)=MY_GROWTH(MY_T1:MY_T2)
  2309. MP_RESTART_STATE(MY_T2+1)=C1XPVS0
  2310. MP_RESTART_STATE(MY_T2+2)=C2XPVS0
  2311. MP_RESTART_STATE(MY_T2+3)=C1XPVS
  2312. MP_RESTART_STATE(MY_T2+4)=C2XPVS
  2313. MP_RESTART_STATE(MY_T2+5)=CIACW
  2314. MP_RESTART_STATE(MY_T2+6)=CIACR
  2315. MP_RESTART_STATE(MY_T2+7)=CRACW
  2316. MP_RESTART_STATE(MY_T2+8)=CRAUT
  2317. TBPVS_STATE(1:NX) =TBPVS(1:NX)
  2318. TBPVS0_STATE(1:NX)=TBPVS0(1:NX)
  2319. ENDIF
  2320. ENDIF ! Allowed_to_read
  2321. RETURN
  2322. !
  2323. !-----------------------------------------------------------------------
  2324. !
  2325. 9061 CONTINUE
  2326. WRITE( errmess , '(A,I4)' ) &
  2327. 'module_mp_etaold: error opening ETAMPNEW_DATA on unit ' &
  2328. &, etampnew_unit1
  2329. CALL wrf_error_fatal(errmess)
  2330. !
  2331. !-----------------------------------------------------------------------
  2332. END SUBROUTINE ETAOLDinit
  2333. !
  2334. SUBROUTINE MY_GROWTH_RATES (DTPH)
  2335. ! SUBROUTINE MY_GROWTH_RATES (DTPH,MY_GROWTH)
  2336. !
  2337. !--- Below are tabulated values for the predicted mass of ice crystals
  2338. ! after 600 s of growth in water saturated conditions, based on
  2339. ! calculations from Miller and Young (JAS, 1979). These values are
  2340. ! crudely estimated from tabulated curves at 600 s from Fig. 6.9 of
  2341. ! Young (1993). Values at temperatures colder than -27C were
  2342. ! assumed to be invariant with temperature.
  2343. !
  2344. !--- Used to normalize Miller & Young (1979) calculations of ice growth
  2345. ! over large time steps using their tabulated values at 600 s.
  2346. ! Assumes 3D growth with time**1.5 following eq. (6.3) in Young (1993).
  2347. !
  2348. IMPLICIT NONE
  2349. !
  2350. REAL,INTENT(IN) :: DTPH
  2351. !
  2352. REAL DT_ICE
  2353. REAL,DIMENSION(35) :: MY_600
  2354. !WRF
  2355. !
  2356. !-----------------------------------------------------------------------
  2357. DATA MY_600 / &
  2358. & 5.5e-8, 1.4E-7, 2.8E-7, 6.E-7, 3.3E-6, &
  2359. & 2.E-6, 9.E-7, 8.8E-7, 8.2E-7, 9.4e-7, &
  2360. & 1.2E-6, 1.85E-6, 5.5E-6, 1.5E-5, 1.7E-5, &
  2361. & 1.5E-5, 1.E-5, 3.4E-6, 1.85E-6, 1.35E-6, &
  2362. & 1.05E-6, 1.E-6, 9.5E-7, 9.0E-7, 9.5E-7, &
  2363. & 9.5E-7, 9.E-7, 9.E-7, 9.E-7, 9.E-7, &
  2364. & 9.E-7, 9.E-7, 9.E-7, 9.E-7, 9.E-7 / ! -31 to -35 deg C
  2365. !
  2366. !-----------------------------------------------------------------------
  2367. !
  2368. DT_ICE=(DTPH/600.)**1.5
  2369. MY_GROWTH=DT_ICE*MY_600*1.E-3 ! Convert from g to kg
  2370. !
  2371. !-----------------------------------------------------------------------
  2372. !
  2373. END SUBROUTINE MY_GROWTH_RATES
  2374. !
  2375. !-----------------------------------------------------------------------
  2376. !--------- Old GFS saturation vapor pressure lookup tables -----------
  2377. !-----------------------------------------------------------------------
  2378. !
  2379. SUBROUTINE GPVS
  2380. ! ******************************************************************
  2381. !$$$ SUBPROGRAM DOCUMENTATION BLOCK
  2382. ! . . .
  2383. ! SUBPROGRAM: GPVS COMPUTE SATURATION VAPOR PRESSURE TABLE
  2384. ! AUTHOR: N PHILLIPS W/NP2 DATE: 30 DEC 82
  2385. !
  2386. ! ABSTRACT: COMPUTE SATURATION VAPOR PRESSURE TABLE AS A FUNCTION OF
  2387. ! TEMPERATURE FOR THE TABLE LOOKUP FUNCTION FPVS.
  2388. ! EXACT SATURATION VAPOR PRESSURES ARE CALCULATED IN SUBPROGRAM FPVSX.
  2389. ! THE CURRENT IMPLEMENTATION COMPUTES A TABLE WITH A LENGTH
  2390. ! OF 7501 FOR TEMPERATURES RANGING FROM 180.0 TO 330.0 KELVIN.
  2391. !
  2392. ! PROGRAM HISTORY LOG:
  2393. ! 91-05-07 IREDELL
  2394. ! 94-12-30 IREDELL EXPAND TABLE
  2395. ! 96-02-19 HONG ICE EFFECT
  2396. ! 01-11-29 JIN MODIFIED FOR WRF
  2397. !
  2398. ! USAGE: CALL GPVS
  2399. !
  2400. ! SUBPROGRAMS CALLED:
  2401. ! (FPVSX) - INLINABLE FUNCTION TO COMPUTE SATURATION VAPOR PRESSURE
  2402. !
  2403. ! COMMON BLOCKS:
  2404. ! COMPVS - SCALING PARAMETERS AND TABLE FOR FUNCTION FPVS.
  2405. !
  2406. ! ATTRIBUTES:
  2407. ! LANGUAGE: FORTRAN 90
  2408. !
  2409. !$$$
  2410. IMPLICIT NONE
  2411. real :: X,XINC,T
  2412. integer :: JX
  2413. !----------------------------------------------------------------------
  2414. XINC=(XMAX-XMIN)/(NX-1)
  2415. C1XPVS=1.-XMIN/XINC
  2416. C2XPVS=1./XINC
  2417. C1XPVS0=1.-XMIN/XINC
  2418. C2XPVS0=1./XINC
  2419. !
  2420. DO JX=1,NX
  2421. X=XMIN+(JX-1)*XINC
  2422. T=X
  2423. TBPVS(JX)=FPVSX(T)
  2424. TBPVS0(JX)=FPVSX0(T)
  2425. ENDDO
  2426. !
  2427. END SUBROUTINE GPVS
  2428. !-----------------------------------------------------------------------
  2429. !***********************************************************************
  2430. !-----------------------------------------------------------------------
  2431. REAL FUNCTION FPVS(T)
  2432. !-----------------------------------------------------------------------
  2433. !$$$ SUBPROGRAM DOCUMENTATION BLOCK
  2434. ! . . .
  2435. ! SUBPROGRAM: FPVS COMPUTE SATURATION VAPOR PRESSURE
  2436. ! AUTHOR: N PHILLIPS W/NP2 DATE: 30 DEC 82
  2437. !
  2438. ! ABSTRACT: COMPUTE SATURATION VAPOR PRESSURE FROM THE TEMPERATURE.
  2439. ! A LINEAR INTERPOLATION IS DONE BETWEEN VALUES IN A LOOKUP TABLE
  2440. ! COMPUTED IN GPVS. SEE DOCUMENTATION FOR FPVSX FOR DETAILS.
  2441. ! INPUT VALUES OUTSIDE TABLE RANGE ARE RESET TO TABLE EXTREMA.
  2442. ! THE INTERPOLATION ACCURACY IS ALMOST 6 DECIMAL PLACES.
  2443. ! ON THE CRAY, FPVS IS ABOUT 4 TIMES FASTER THAN EXACT CALCULATION.
  2444. ! THIS FUNCTION SHOULD BE EXPANDED INLINE IN THE CALLING ROUTINE.
  2445. !
  2446. ! PROGRAM HISTORY LOG:
  2447. ! 91-05-07 IREDELL MADE INTO INLINABLE FUNCTION
  2448. ! 94-12-30 IREDELL EXPAND TABLE
  2449. ! 96-02-19 HONG ICE EFFECT
  2450. ! 01-11-29 JIN MODIFIED FOR WRF
  2451. !
  2452. ! USAGE: PVS=FPVS(T)
  2453. !
  2454. ! INPUT ARGUMENT LIST:
  2455. ! T - REAL TEMPERATURE IN KELVIN
  2456. !
  2457. ! OUTPUT ARGUMENT LIST:
  2458. ! FPVS - REAL SATURATION VAPOR PRESSURE IN KILOPASCALS (CB)
  2459. !
  2460. ! ATTRIBUTES:
  2461. ! LANGUAGE: FORTRAN 90
  2462. !$$$
  2463. IMPLICIT NONE
  2464. real,INTENT(IN) :: T
  2465. real XJ
  2466. integer :: JX
  2467. !-----------------------------------------------------------------------
  2468. XJ=MIN(MAX(C1XPVS+C2XPVS*T,1.),FLOAT(NX))
  2469. JX=MIN(XJ,NX-1.)
  2470. FPVS=TBPVS(JX)+(XJ-JX)*(TBPVS(JX+1)-TBPVS(JX))
  2471. !
  2472. END FUNCTION FPVS
  2473. !-----------------------------------------------------------------------
  2474. !-----------------------------------------------------------------------
  2475. REAL FUNCTION FPVS0(T)
  2476. !-----------------------------------------------------------------------
  2477. IMPLICIT NONE
  2478. real,INTENT(IN) :: T
  2479. real :: XJ1
  2480. integer :: JX1
  2481. !-----------------------------------------------------------------------
  2482. XJ1=MIN(MAX(C1XPVS0+C2XPVS0*T,1.),FLOAT(NX))
  2483. JX1=MIN(XJ1,NX-1.)
  2484. FPVS0=TBPVS0(JX1)+(XJ1-JX1)*(TBPVS0(JX1+1)-TBPVS0(JX1))
  2485. !
  2486. END FUNCTION FPVS0
  2487. !-----------------------------------------------------------------------
  2488. !***********************************************************************
  2489. !-----------------------------------------------------------------------
  2490. REAL FUNCTION FPVSX(T)
  2491. !-----------------------------------------------------------------------
  2492. !$$$ SUBPROGRAM DOCUMENTATION BLOCK
  2493. ! . . .
  2494. ! SUBPROGRAM: FPVSX COMPUTE SATURATION VAPOR PRESSURE
  2495. ! AUTHOR: N PHILLIPS W/NP2 DATE: 30 DEC 82
  2496. !
  2497. ! ABSTRACT: EXACTLY COMPUTE SATURATION VAPOR PRESSURE FROM TEMPERATURE.
  2498. ! THE WATER MODEL ASSUMES A PERFECT GAS, CONSTANT SPECIFIC HEATS
  2499. ! FOR GAS AND LIQUID, AND NEGLECTS THE VOLUME OF THE LIQUID.
  2500. ! THE MODEL DOES ACCOUNT FOR THE VARIATION OF THE LATENT HEAT
  2501. ! OF CONDENSATION WITH TEMPERATURE. THE ICE OPTION IS NOT INCLUDED.
  2502. ! THE CLAUSIUS-CLAPEYRON EQUATION IS INTEGRATED FROM THE TRIPLE POINT
  2503. ! TO GET THE FORMULA
  2504. ! PVS=PSATK*(TR**XA)*EXP(XB*(1.-TR))
  2505. ! WHERE TR IS TTP/T AND OTHER VALUES ARE PHYSICAL CONSTANTS
  2506. ! THIS FUNCTION SHOULD BE EXPANDED INLINE IN THE CALLING ROUTINE.
  2507. !
  2508. ! PROGRAM HISTORY LOG:
  2509. ! 91-05-07 IREDELL MADE INTO INLINABLE FUNCTION
  2510. ! 94-12-30 IREDELL EXACT COMPUTATION
  2511. ! 96-02-19 HONG ICE EFFECT
  2512. ! 01-11-29 JIN MODIFIED FOR WRF
  2513. !
  2514. ! USAGE: PVS=FPVSX(T)
  2515. ! REFERENCE: EMANUEL(1994),116-117
  2516. !
  2517. ! INPUT ARGUMENT LIST:
  2518. ! T - REAL TEMPERATURE IN KELVIN
  2519. !
  2520. ! OUTPUT ARGUMENT LIST:
  2521. ! FPVSX - REAL SATURATION VAPOR PRESSURE IN KILOPASCALS (CB)
  2522. !
  2523. ! ATTRIBUTES:
  2524. ! LANGUAGE: FORTRAN 90
  2525. !$$$
  2526. IMPLICIT NONE
  2527. !-----------------------------------------------------------------------
  2528. real, parameter :: TTP=2.7316E+2,HVAP=2.5000E+6,PSAT=6.1078E+2 &
  2529. , CLIQ=4.1855E+3,CVAP= 1.8460E+3 &
  2530. , CICE=2.1060E+3,HSUB=2.8340E+6
  2531. !
  2532. real, parameter :: PSATK=PSAT*1.E-3
  2533. real, parameter :: DLDT=CVAP-CLIQ,XA=-DLDT/RV,XB=XA+HVAP/(RV*TTP)
  2534. real, parameter :: DLDTI=CVAP-CICE &
  2535. , XAI=-DLDTI/RV,XBI=XAI+HSUB/(RV*TTP)
  2536. real T,TR
  2537. !-----------------------------------------------------------------------
  2538. TR=TTP/T
  2539. !
  2540. IF(T.GE.TTP)THEN
  2541. FPVSX=PSATK*(TR**XA)*EXP(XB*(1.-TR))
  2542. ELSE
  2543. FPVSX=PSATK*(TR**XAI)*EXP(XBI*(1.-TR))
  2544. ENDIF
  2545. !
  2546. END FUNCTION FPVSX
  2547. !-----------------------------------------------------------------------
  2548. !-----------------------------------------------------------------------
  2549. REAL FUNCTION FPVSX0(T)
  2550. !-----------------------------------------------------------------------
  2551. IMPLICIT NONE
  2552. real,parameter :: TTP=2.7316E+2,HVAP=2.5000E+6,PSAT=6.1078E+2 &
  2553. , CLIQ=4.1855E+3,CVAP=1.8460E+3 &
  2554. , CICE=2.1060E+3,HSUB=2.8340E+6
  2555. real,PARAMETER :: PSATK=PSAT*1.E-3
  2556. real,PARAMETER :: DLDT=CVAP-CLIQ,XA=-DLDT/RV,XB=XA+HVAP/(RV*TTP)
  2557. real,PARAMETER :: DLDTI=CVAP-CICE &
  2558. , XAI=-DLDT/RV,XBI=XA+HSUB/(RV*TTP)
  2559. real :: T,TR
  2560. !-----------------------------------------------------------------------
  2561. TR=TTP/T
  2562. FPVSX0=PSATK*(TR**XA)*EXP(XB*(1.-TR))
  2563. !
  2564. END FUNCTION FPVSX0
  2565. !
  2566. END MODULE module_mp_etaold