The specific humidity formula is:
SH = Mwv / Mma
where Mwv and Mma are mass of water vapor and moist air, respectively.
Read more