NCEPLIBS-w3emc  2.11.0
w3fa09.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Temperature to saturation vapor pressure.
3 C> @author P. Chase @date 1978-10-01
4 
5 C> Computes saturation vapor pressure in kilopascals given temperataure in kelvins.
6 C>
7 C> Program history log:
8 C> - P. Chase 1978-10-01 P.CHASE
9 C> - Ralph Jones 1984-06-26 Change to ibm vs fortran.
10 C> - Ralph Jones 1984-06-26 Change to microsoft fortran 4.10.
11 C> - Ralph Jones 1990-06-08 Change to sun fortran 1.3.
12 C> - Ralph Jones 1991-03-29 Convert to silicongraphic fortran.
13 C> - Ralph Jones 1993-03-29 Add save statement.
14 C> - Ralph Jones 1995-09-25 Change tk to cray 64 bit real, change double.
15 C> precision to cray 64 bit real.
16 C>
17 C> @param[in] TK REAL*8 Temperature in kelvins. if tk < 223.16, the value
18 C> 223.16 will be used. if tk > 323.16, the value 323.16
19 C> will be used as the argument. 'tk' itself is unchanged.
20 C> @return VP Saturation vapor pressure in kilopascals 0.0063558 < VP < 12.3395.
21 C>
22 C> @note W3FA09 may be declared real*8 so that a real*8 value is
23 C> returned, but no increase in accuracy is implied.
24 C>
25 C> @author P. Chase @date 1978-10-01
26  REAL function w3fa09 (tk)
27 C
28 C THE CHEBYSHEV COEFFICIENTS ARE IN ARRAY C, LOW-ORDER TERM FIRST.
29 C
30  REAL c(9)
31  REAL arg,h0,h1,h2
32 C
33  SAVE
34 C
35  DATA c /
36  & 0.313732865927e+01, 0.510038215244e+01, 0.277816535655e+01,
37  & 0.102673379933e+01, 0.254577145215e+00, 0.396055201295e-01,
38  & 0.292209288468e-02,-0.119497199712e-03,-0.352745603496e-04/
39 C
40 C SCALE TK TO RANGE -2, +2 FOR SERIES EVALUATION. INITIALIZE TERMS.
41 C
42  arg = -1.09264e1+4.0e-2*amax1(223.16,amin1(323.16,tk))
43  h0 = 0.0
44  h1 = 0.0
45 C
46 C EVALUATE CHEBYSHEV POLYNOMIAL
47 C
48  DO 10 i=1,9
49  h2 = h1
50  h1 = h0
51  h0 = arg * h1 - h2 + c(10-i)
52  10 CONTINUE
53  w3fa09 = 0.5 * (c(1) - h2 + h0)
54  RETURN
55  END
real function w3fa09(TK)
Computes saturation vapor pressure in kilopascals given temperataure in kelvins.
Definition: w3fa09.f:27