;************************************************************* ; Goff Gratch Equation for Saturation Vapor Pressure over ; liquid water below 0C ; http://cires.colorado.edu/~voemel/vp.html ; Log10 pw = -7.90298 (373.16/T-1) ; + 5.02808 Log10(373.16/T) ; - 1.3816 10^-7 (10^(11.344*(1-T/373.16)) -1) ; + 8.1328 10^-3 (10^(-3.49149 (373.16/T-1)) -1) ; + Log10(1013.246) ; with T in [K] and pw (vapor pressure over liquid water) in [hPa]=mb ;************************************************************* pro gg_sat_vap_pres_eq,temp,esw,missing ; Number of elements in the 1d array num=n_elements(temp) ; Create some arrays y=make_array(/float,num,value=missing) esw=make_array(/float,num,value=missing) ; Find the temperature values that are not missing result=where(temp ge missing,count) ; Calculate y y[result]=373.16/temp[result] ; Goff Gratch equation to calculate saturation vapor ; pressure from temperature. ; esw=saturation vapor pressure over liquid water (hPa=mb) esw[result]=-7.90298*(y[result]-1.0)+$ 5.02808*alog10(y[result])-$ 1.3816e-07*((10.0^(11.344*(1.0-(1.0/y[result]))))-1.0)+$ 8.1328e-03*((10.0^(-3.49149*(y[result]-1.0)))-1.0)+$ alog10(1013.246) esw[result]=10.0^esw[result] ;hPa=mb return end