UPP (develop)
Loading...
Searching...
No Matches
ICAOHEIGHT.f
1 SUBROUTINE icaoheight(MAXWP, & !input
2 MAXWICAOZ) ! output
3
4! SUBPROGRAM: ICAOHEIGHT
5! PRGRMMR: CHUANG ORG: W/NP2 DATE: 09-05-08
6!
7! ABSTRACT:
8! THIS ROUTINE CONVERT PRESSURE FIELDS TO ICAO HEIGHT
9!
10
11! Description:
12! Convert pressure (Pa) to height (m) using ICAO standard atmosphere
13! adpt code from uk
14! Method:
15!
16!
17! Code Description:
18! Language: Fortran 90
19! Software Standards: UMDP3 v6
20
21use ctlblk_mod, only: jsta, jend, spval, im, ista, iend
22use physcons_post, only: con_g, con_rd
23IMPLICIT None
24
25! Subroutine Arguments:
26!REAL, INTENT(IN) :: SPVAL
27REAL, INTENT(IN) :: MAXWP(ista:iend,jsta:jend) !P field for conversion
28
29REAL, INTENT(INOUT) :: MAXWICAOZ(ista:iend,jsta:jend) !ICAO height in m
30!INTEGER, INTENT(INOUT) :: ErrorStatus
31
32! Local Constants:
33REAL, PARAMETER :: G_over_R = con_g / con_rd
34REAL, PARAMETER :: Lapse_RateL = 6.5e-03 ! For levels below 11,000 gpm
35REAL, PARAMETER :: Lapse_RateU = -1.0e-03 ! For levels above 11,000 gpm
36REAL, PARAMETER :: Press_Bot = 101325. ! ICAO std: surface pressure
37REAL, PARAMETER :: Press_Mid = 22632. ! pressure @ 11,000 gpm
38REAL, PARAMETER :: Press_Top = 5474.87 ! pressure @ 20,000 gpm
39REAL, PARAMETER :: Temp_Bot = 288.15 ! Surface temperature
40REAL, PARAMETER :: Temp_Top = 216.65 ! Temperature of isotherm
41REAL, PARAMETER :: Gpm1 = 11000.0 ! Ht limit (gpm) for std lower
42 ! lapse rate
43REAL, PARAMETER :: Gpm2 = 20000.0 ! Ht (gpm) of top of isothermal layer
44REAL, PARAMETER :: ZP1 = lapse_ratel/g_over_r ! Exponents used for
45REAL, PARAMETER :: ZP2 = lapse_rateu/g_over_r ! calculation
46
47! Local Variables:
48INTEGER :: i,j ! loop counters
49REAL :: Pressure ! Local pressure
50
51! End of header --------------------------------------------------------
52
53!IF ( ErrorStatus /= StatusOK ) THEN
54 ! Previous error - do not proceed
55! GO TO 9999
56!END IF
57
58!IF ( ASSOCIATED( IHField % RData ) ) THEN
59! DEALLOCATE( IHField % RData )
60!END IF
61
62
63
64DO j=jsta,jend
65 DO i=ista,iend
66 pressure = maxwp(i,j)
67 IF ( (pressure <= 1000.) .AND. (pressure >= 0.) ) THEN
68 pressure = 1000.
69 print*,'lower ICAO pressure to 10 mb'
70 END IF
71 IF ( pressure > press_bot .and. pressure<spval) THEN
72 pressure = press_bot
73 END IF
74
75 IF (pressure == spval) THEN
76 maxwicaoz(i,j) = spval
77 ELSE IF (pressure > press_mid) THEN ! Hts up to 11,000 GPM
78 pressure = pressure/press_bot
79 pressure = 1.0 - pressure**zp1
80 maxwicaoz(i,j) = pressure*temp_bot/lapse_ratel
81
82 ELSE IF (pressure > press_top) THEN ! Hts between 11,000
83 ! and 20,000 GPM
84 pressure = pressure/press_mid
85 pressure = -alog(pressure)
86 maxwicaoz(i,j) = gpm1 + pressure*temp_top/g_over_r
87
88 ELSE ! Hts above 20,000 GPM
89 pressure = pressure/press_top
90 pressure = 1.0 - pressure**zp2
91 maxwicaoz(i,j) = gpm2 + pressure*temp_top/lapse_rateu
92
93 END IF
94
95 ENDDO
96ENDDO
97
98
99!9999 CONTINUE
100
101END SUBROUTINE icaoheight
102
103