def R_moistAir(q):
    """
    Calculates the gas constant for umid air from the specific humidity q

    Parameters
    ----------
    q: float
        the specific humidity in g(water)/g(air)

    Returns
    -------
    R_air: float
        the specific gas constant for humid air in J/(g*K)
    """
    from .constants import R_spec
    return q * R_spec['h2o'] + (1.0 - q) * R_spec['dry_air']
