Changeset 1715 in lmdz_wrf
- Timestamp:
- Dec 13, 2017, 10:21:41 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/diag_tools.py
r1714 r1715 1272 1272 [p] = pressure field (assuming in [Pa]) 1273 1273 [q] = mixing ratio in [kgkg-1] 1274 ref.: M. G. Lawrence, BAMS, 2005, 225 1275 >>> print var_rh(101300., 290., 3.) 1276 0.250250256174 1274 1277 """ 1275 1278 fname = 'var_rh' 1276 1279 1277 data1 = 10.*0.6112*np.exp(17.67*(t-273.16)/(t-29.65)) 1278 data2 = 0.622*data1/(0.01*p-(1.-0.622)*data1) 1279 1280 rh = q/data2 1280 # Enthalpy of vaporization [Jkg-1] 1281 L = 2.453*10.**6 1282 # Gas constant for water vapor [JK-1Kg-1] 1283 Rv = 461.5 1284 1285 # Computing saturated pressure 1286 #es = 10.*0.6112*np.exp(17.67*(t-273.16)/(t-29.65)) 1287 #es = 6.11*np.exp(L/Rv*(1.-273./t)/273.) 1288 1289 # August - Roche - Magnus formula 1290 es = 6.1094*np.exp(17.625*(t-273.15)/((t-273.15)+243.04)) 1291 1292 # Saturated mixing ratio [g/kg] 1293 ws = 0.622*es/(0.01*p-es) 1294 1295 rh = q/(ws*1000.) 1281 1296 1282 1297 return rh
Note: See TracChangeset
for help on using the changeset viewer.