NCEPLIBS-w3emc  2.11.0
w3fa03v.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Compute standard height, temp, and pot temp.
3 C> @author James McDonell @date 1974-06-01
4 C>
5 C> Computes the standard height, temperature, and potential
6 C> temperature given the pressure in millibars (>8.68 mb). For
7 C> height and temperature the results duplicate the values in the
8 C> U.S. standard atmosphere (l962), which is the icao standard
9 C> atmosphere to 54.7487 mb (20 km) and the proposed extension to
10 C> 8.68 mb (32 km). For potential temperature a value of 2/7 is
11 C> used for rd/cp.
12 C>
13 C> Program history log:
14 C> - James McDonell 1974-06-01
15 C> - Ralph Jones 1984-06-01 Change to ibm vs fortran.
16 C> - Dennis Keyser 1992-06-29 Convert to cray cft77 fortran.
17 C> - Ralph Jones 1994-09-13 Vectorized version to do array instead of one word.
18 C>
19 C> @param[in] PRESS Pressure array in millibars.
20 C> @param[out] HEIGHT Height array in meters.
21 C> @param[out] TEMP Temperature array in degrees kelvin.
22 C> @param[out] THETA Potential temperature array in degrees kelvin.
23 C> @param[out] N Number of points in array press.
24 C>
25 C> @note Not valid for pressures less than 8.68 millibars, declare
26 C> all parameters as type real.
27 C>
28 C> @note Height, temp, theta are now all arrays, you must
29 C> have arrays of size n or you will wipe out memory.
30 C>
31 C> @author James McDonell @date 1974-06-01
32  SUBROUTINE w3fa03v(PRESS,HEIGHT,TEMP,THETA,N)
33 C
34  REAL M0
35  REAL HEIGHT(*)
36  REAL PRESS(*)
37  REAL TEMP(*)
38  REAL THETA(*)
39 C
40  SAVE
41 C
42  DATA g/9.80665/,rstar/8314.32/,m0/28.9644/,piso/54.7487/,
43  $ ziso/20000./,salp/-.0010/,pzero/1013.25/,t0/288.15/,alp/.0065/,
44  $ ptrop/226.321/,tstr/216.65/
45 C
46  rovcp = 2.0/7.0
47  r = rstar/m0
48  rovg = r/g
49  fkt = rovg * tstr
50  ar = alp * rovg
51  pp0 = pzero**ar
52  ar1 = salp * rovg
53  pp01 = piso**ar1
54 C
55  DO j = 1,n
56  IF (press(j).LT.piso) THEN
57 C
58 C COMPUTE LAPSE RATE = -.0010 CASES
59 C
60  height(j) = ((tstr/(pp01 * salp )) * (pp01-(press(j) ** ar1)))
61  & + ziso
62  temp(j) = tstr - ((height(j) - ziso) * salp)
63 C
64  ELSE IF (press(j).GT.ptrop) THEN
65 C
66  height(j) = (t0/(pp0 * alp)) * (pp0 - (press(j) ** ar))
67  temp(j) = t0 - (height(j) * alp)
68 C
69  ELSE
70 C
71 C COMPUTE ISOTHERMAL CASES
72 C
73  height(j) = 11000.0 + (fkt * alog(ptrop/press(j)))
74  temp(j) = tstr
75 C
76  END IF
77  theta(j) = temp(j) * ((1000./press(j))**rovcp)
78  END DO
79 C
80  RETURN
81  END