function q=qfromRH(T,RH,p)
% input: T [^o C], RH [%], p [mbar]
% output: g/kg
constants

% e_s=6.1121*exp(17.502*T ./(240.97+T));
% q=0.622*(e_s.*RH)./(p-e_s.*RH);
% http://www.theweatherprediction.com/basic/equations/
e = RH./100* 6.1078.*exp( Lv/Rv*(1/273.15-1./(T+273.15)) );  % e = RH * e_s --> mbar
% e=RH./100* 6.1078.*exp( 17.269 + T ./ (T+273.15 - 35.86) );
q= 0.622*e./(p-e) * 1000;