source: trunk/src/rh_to_spechum.pro

Last change on this file was 203, checked in by pinsard, 10 years ago

fix thanks to coding rules

  • Property svn:executable set to *
  • Property svn:keywords set to Id URL
File size: 946 bytes
Line 
1;+
2;
3; =================
4; rh_to_spechum.pro
5; =================
6;
7; .. function:: rh_to_spechum(rh,ta,P)
8;
9;     :param rh: in %
10;     :param ta: air temperature in degC
11;     :param P: pressure in hPa
12;
13;     :returns: Air specific humidity (g/kg)
14;
15; EXAMPLES
16; ========
17;
18; .. code-block:: idl
19;
20;    rh = +todo+
21;    ta = +todo+
22;    P = +todo+
23;    result = rh_to_spechum(rh,ta,P)
24;
25; TODO
26; ====
27;
28; coding rules
29;
30; complete example
31;
32; SEE ALSO
33; ========
34;
35; called by :func:`d2m_to_q2m_erai`
36;
37; use :func:`qsat`
38;
39; EVOLUTIONS
40; ==========
41;
42; $Id$
43;
44; $URL$
45;
46; - fplod 20110811T130223Z aedon.locean-ipsl.upmc.fr (Darwin)
47;
48;   * add reference to qsat function
49;
50; - fplod 20101214T093615Z aedon.locean-ipsl.upmc.fr (Darwin)
51;
52;   * minimal header
53;
54; - pbk 2008
55;
56;   * creation
57;
58;-
59function rh_to_spechum, rh,ta,P
60;
61rhf=rh/100.
62qw=qsat(ta,P)/1000.
63;
64; Air specific humidity (g/kg)
65q=(rhf*qw)/(1.-qw*(1-rhf))*1e3
66;
67return, q
68;
69end
Note: See TracBrowser for help on using the repository browser.