;+ ; ; ================= ; rh_to_spechum.pro ; ================= ; ; .. function:: rh_to_spechum(rh,ta,P) ; ; :param rh: in % ; :param ta: air temperature in degC ; :param P: pressure in hPa ; ; :returns: Air specific humidity (g/kg) ; ; EXAMPLES ; ======== ; ; .. code-block:: idl ; ; rh = +todo+ ; ta = +todo+ ; P = +todo+ ; result = rh_to_spechum(rh,ta,P) ; ; TODO ; ==== ; ; coding rules ; ; complete example ; ; SEE ALSO ; ======== ; ; called by :func:`d2m_to_q2m_erai` ; ; use :func:`qsat` ; ; EVOLUTIONS ; ========== ; ; $Id$ ; ; $URL$ ; ; - fplod 20110811T130223Z aedon.locean-ipsl.upmc.fr (Darwin) ; ; * add reference to qsat function ; ; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin) ; ; * minimal header ; ; - pbk 2008 ; ; * creation ; ;- function rh_to_spechum, rh,ta,P ; rhf=rh/100. qw=qsat(ta,P)/1000. ; ; Air specific humidity (g/kg) q=(rhf*qw)/(1.-qw*(1-rhf))*1e3 ; return, q ; end