function q = spec_humid(pressure, ew)

%function q = spec_humid(pressure, ew)
%spec_humid returns q, the specific humidity, given the air pressure
%and the vapour pressure.  See formula A4.5 in Gill.  Note that the
%specific humidity is dimensionless and the two pressures only need to
%be in the same units.

%     Copyright J. V. Mansbridge, CSIRO, september 28 1993

mol_rat = 0.62197;% ratio of molecular weight of water to air.
q = mol_rat*ew./(pressure - (1 - mol_rat)*ew);
