From 222ecf11678ff2cad2ab9b0712bb2e715c3a959a Mon Sep 17 00:00:00 2001 From: sbiri <sbiri@noc.ac.uk> Date: Mon, 23 Aug 2021 09:04:32 +0100 Subject: [PATCH] Update hum_subs.py --- hum_subs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hum_subs.py b/hum_subs.py index f0f4a7d..9eff6a4 100644 --- a/hum_subs.py +++ b/hum_subs.py @@ -137,8 +137,8 @@ def VaporPressure(temp, P, phase, meth): Standards and Recommended Practices, App. A, 1988.""" Ts = 273.16 # triple point temperature in K Psat = np.power(10, 10.79574*(1-Ts/T)-5.028*np.log10(T/Ts) + - 1.50475e-4*(1-np.power(10, -8.2969*(T/Ts-1))) + - 0.42873e-3*(np.power(10, 4.76955*(1-Ts/T))-1) + # in eq. 13 is -4.76955; in aerobulk is like this + 1.50475e-4*(1-10**(-8.2969*(T/Ts-1))) + + 0.42873e-3*(10**(4.76955*(1-Ts/T))-1) + # in eq. 13 is -4.76955; in aerobulk is like this 0.78614) if (meth == 'WMO2018'): """WMO 2018 edition. Annex 4.B, eq. 4.B.1, 4.B.2, 4.B.5 """ @@ -393,7 +393,6 @@ def get_hum(hum, T, sst, P, qmeth): esd = 611.21*np.exp(17.502*((Td-273.16)/(Td-32.19))) es = 611.21*np.exp(17.502*((T-273.16)/(T-32.19))) RH = 100*esd/es - # RH = np.where(RH > 100, np.nan, RH) # ensure RH <=100 qair = qsat_air(T, P, RH, qmeth)/1000 # q of air (kg/kg) qsea = qsat_sea(sst, P, qmeth)/1000 # surface water q (kg/kg) return qair, qsea @@ -417,7 +416,8 @@ def gamma(opt, sst, t, q, cp): q : float specific humidity of air [kg/kg] cp : float - specific capacity of air at constant Pressure [kJ/(kg*K)] + specific capacity of air at constant Pressure + Returns ------- gamma : float -- GitLab