;*********************************************************** ; saturation_mxrat.pro calculates saturation mixing ratio ; with respect to water ; ; INPUT ; temp = temperature in Celcius ; press = pressure in hPa=mb ; ; OUTPUT ; smxrat = saturation mixing ratio in g/kg ;*********************************************************** pro saturation_mxrat_w,temp,press,smxrat ; Pressure in mb press_mb=press ;mb ; Temperature in celcius temp_c=temp ;Celcius ; Calculate saturation vapor pressure (es) ; Source: Bolton, D., The computation of equivalent potential temperature, ; Monthly Weather Review, 108, 1046-1053, 1980. equation (10) ; Psat=6.112 * EXP(17.67 * Temp / (Temp+243.5)) ; Temp=Celcius ; Psat=hPa=mb es=6.112*exp((17.67*temp_c)/(temp_c+243.5)) ;mb ; Calculate mixing ratio ; mxrat=(0.622*e)/(p-e) where e is vapor pressure ; p is pressure ; mxrat is mixing ratio smxrat=(0.622*es)/(press_mb-es) ;kg water vapor / kg dry air ; Convert mixing ratio from kg/kg to g/kg smxrat=smxrat*1000.0 return end