Changeset 1685 in lmdz_wrf for trunk/tools/diag_tools.py
- Timestamp:
- Dec 4, 2017, 7:30:21 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/diag_tools.py
r1680 r1685 30 30 # var_clt: Function to compute the total cloud fraction following 'newmicro.F90' from LMDZ using 1D vertical column values 31 31 # var_mslp: Fcuntion to compute mean sea-level pressure 32 # var_td: Function to compute dew-point air temperature from temperature and pressure values 32 33 # var_virtualTemp: This function returns virtual temperature in K, 33 34 # var_WRFtime: Function to copmute CFtimes from WRFtime variable … … 1070 1071 1071 1072 return td, dnamesvar, dvnamesvar 1073 1074 def var_td(t, p, qv): 1075 """ Function to compute dew-point air temperature from temperature and pressure values 1076 t= temperature [K] 1077 p= pressure (Pa) 1078 formula: 1079 temp = theta*(p/p0)**(R/Cp) 1080 1081 """ 1082 fname = 'compute_td' 1083 1084 tk = (t)*(p/fdef.module_definitions.p0ref)**(fdef.module_definitions.rcp) 1085 data1 = 10.*0.6112*np.exp(17.67*(tk-273.16)/(tk-29.65)) 1086 data2 = 0.622*data1/(0.01*p-(1.-0.622)*data1) 1087 1088 rh = qv/data2 1089 1090 pa = rh * data1 1091 td = 257.44*np.log(pa/6.1121)/(18.678-np.log(pa/6.1121)) 1092 1093 return td
Note: See TracChangeset
for help on using the changeset viewer.