-- sonntag_1990.lua ------------------------------------------------------------------------ -- Z. Meteorol. 70 (1990) 5, 340--344 -- -- Important new Values of the Physical Constants of 1986, -- Vapour Pressure Formulations based on the ITS-90, -- and Psychrometer Formulae -- -- By D. Sonntag ------------------------------------------------------------------------ -- Typed into Lua by H. Henkel, 2013. local t = {} local T0 = 273.15 t.T0 = T0 local p0 = 1013.25 t.p0 = p0 -- 2.1. Reference formula for the saturation vapour pressure -- in the pure phase with respect to water local e_w = function(T) assert((173.15 <= T) and (T <= 373.15)) local log_e_w = -6096.9385 * T^-1 + 16.635794 - 2.711193e-2 * T + 1.673952e-5 * T^2 + 2.433502 * math.log(T) -- (2) local e_w = math.exp(log_e_w) local unit = "hPa" return e_w, unit end t.e_w = e_w -- 2.2. Reference formula for the saturation vapour pressure -- in the pure phase with respect to ice local e_i = function(T) assert((173.15 <= T) and (T <= 273.16)) local log_e_i = -6024.5282 * T^-1 + 24.7219 + 1.0613868e-2 * T - 1.3198825e-5 * T^2 - 0.49382577 * math.log(T) -- (4) local e_i = math.exp(log_e_i) local unit = "hPa" return math.exp(log_e_i), unit end t.e_i = e_i -- 2.3. Magnus formula for the saturation vapour pressure -- in the pure phase with respect to water local e_w_magnus = function(t) assert((-45 <= t) and (t <= 60)) local log_e_w = math.log(6.112) + 17.62 * t / (243.12 + t) -- (5) local e_w = math.exp(log_e_w) local unit = "hPa" return e_w, unit end t.e_w_magnus = e_w_magnus local t_d_magnus = function(e) local t_d = 243.12 * math.log(e / 6.112) / (17.62 - math.log(e / 6.112)) -- (6) local unit = "deg. C" return t_d, unit end t.t_d_magnus = t_d_magnus -- 2.4. Magnus formula for the saturation vapour pressure -- in the pure phase with respect to ice local e_i_magnus = function(t) assert((-65 <= t) and (t <= 0.01)) local log_e_i = math.log(6.112) + 22.46 * t / (272.62 + t) -- (8) local e_i = math.exp(log_e_i) local unit = "hPa" return e_i, unit end t.e_i_magnus = e_i_magnus local t_f_magnus = function(e) local t_f = 272.62 * math.log(e / 6.112) / (22.46 - math.log(e / 6.112)) -- (9) local unit = "deg. C" return t_f, unit end t.t_f_magnus = t_f_magnus -- 2.5. Magnus formula for the saturation vapour pressure -- in the pure phase with respect to water -- for hypsometric purposes local p_hypsometer = function(t) assert((90 <= t) and (t <= 102)) local log_p = math.log(1014.19) + (11.654 * (t - 100)) / (326.541 + (t - 100)) -- (12) local p = math.exp(log_p) local unit = "hPa" return p, unit end t.p_hypsometer = p_hypsometer local p_aerological = function(t) assert((-7 <= t) and (t <= 102)) local log_p = math.log(6.112) + 17.0472 * t / (233.5 + t) -- (13) local p = math.exp(log_p) local unit = "hPa" return p, unit end t.p_aerological = p_aerological -- 2.6. Saturation vapour pressure values of moist air local f_w = function(p, t) local e_w = e_w(t + T0) local f_w = 1 + 1e-4 * e_w / (273 + t) * ((38 + 173 * math.exp(-t / 43)) * (1 - e_w / p) + (6.39 + 4.28 * math.exp(-t / 107)) * (p / e_w - 1)) -- (18) return f_w end t.f_w = f_w local f_i = function(p, t) local e_i = e_i(t + T0) local f_i = 1 + 1e-5 * e_i / (273 + t) * ((2100 - 65 * t) * (1 - e_i / p) + (109 - 0.35 * t + t^2 / 338) * (p / e_i - 1)) -- (19) return f_i end t.f_i = f_i local f_w_approx = function(p) local f_w = 1.0016 + 3.15e-6 * p - 0.074 / p -- (20) return f_w end t.f_w_approx = f_w_approx f_i_approx = function(p) return f_w_approx(p) end t.f_i_approx = f_i_approx e_w_prime = function(p, t) local e_w_prime = f_w(p, t) * e_w(t + T0) -- (14) local unit = "hPa" return e_w_prime, unit end t.e_w_prime = e_w_prime e_i_prime = function(p, t) local e_i_prime = f_i(p, t) * e_i(t + T0) -- (15) local unit = "hPa" return e_i_prime, unit end t.e_i_prime = e_i_prime -- 3. Psychrometer formulae local e_prime_w = function(p, t, t_w) local e_prime = e_w_prime(p, t_w) - 6.53e-4 * (1 + 0.000944 * t_w) * p * (t - t_w) -- (23) local unit = "hPa" return e_prime, unit end t.e_prime_w = e_prime_w local e_prime_i = function(p, t, t_i) local e_prime = e_i_prime(p, t_i) - 5.75e-4 * p * (t - t_i) -- (24) local unit = "hPa" return e_prime, unit end t.e_prime_i = e_prime_i local A = function(t_w) local A = 6.53e-4 * (1 + 0.000944 * t_w) -- (25) return A end return t