PageRenderTime 73ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/wrfv2_fire/phys/module_mp_HWRF.F

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