function td = tdew(x)
% computes dew point temp from p in mb & q in g/kg
p = x(:,1);
q = x(:,2);
e = p.*q/1000./(0.622+0.378*q/1000);
z = log(e./(1.0007+3.46e-6*p)/6.112);
td = 241.*z./(17.502-z);
end