33 public :: atmos_profile_isa
35 interface atmos_profile_isa
36 module procedure atmos_profile_isa_1d
37 module procedure atmos_profile_isa_3d
38 end interface atmos_profile_isa
53 integer,
private,
parameter :: nref = 8
54 real(RP),
private,
parameter :: z_isa(nref) = (/ 0.0_rp, &
62 real(RP),
private,
parameter :: GAMMA(nref) = (/ -6.5e-3_rp, &
75 subroutine atmos_profile_isa_1d( &
83 integer,
intent(in) :: KA, KS, KE
84 real(RP),
intent(in) :: temp_sfc
85 real(RP),
intent(in) :: pres_sfc
86 real(RP),
intent(in) :: z (KA)
87 real(RP),
intent(out) :: pott(KA)
89 real(RP) :: temp_isa(nref)
90 real(RP) :: pres_isa(nref)
103 temp_isa(1) = temp_sfc
104 pres_isa(1) = pres_sfc
107 temp_isa(n) = temp_isa(n-1) + gamma(n-1) * ( z_isa(n)-z_isa(n-1) )
109 if ( gamma(n-1) == 0.0_rp )
then
110 pres_isa(n) = pres_isa(n-1) * exp( -gmr / temp_isa(n) * ( z_isa(n)-z_isa(n-1) ) )
112 pres_isa(n) = pres_isa(n-1) * ( temp_isa(n)/temp_isa(n-1) ) ** ( -gmr/gamma(n-1) )
117 log_info(
"ATMOS_PROFILE_isa_1D",*)
'###### ICAO International Standard Atmosphere ######'
118 log_info_cont(*)
' height: lapse rate: pressure: temperature'
120 log_info_cont(
'(4F13.5)') z_isa(n), gamma(n), pres_isa(n), temp_isa(n)
122 log_info_cont(*)
'####################################################'
126 if ( z(k) <= z_isa(1) )
then
128 temp(k) = temp_isa(1) + gamma(1) * ( z(k)-z_isa(1) )
129 pres(k) = pres_isa(1) * ( temp(k)/temp_isa(1) ) ** ( -gmr/gamma(1) )
131 elseif( z(k) > z_isa(nref) )
then
133 temp(k) = temp_isa(nref)
134 pres(k) = pres_isa(nref) * exp( -gmr/temp_isa(nref) * ( z(k)-z_isa(nref) ) )
138 if ( z(k) > z_isa(n-1) .AND. z(k) <= z_isa(n) )
then
140 temp(k) = temp_isa(n-1) + gamma(n-1) * ( z(k)-z_isa(n-1) )
141 if ( gamma(n-1) == 0.0_rp )
then
142 pres(k) = pres_isa(n-1) * exp( -gmr/temp_isa(n-1) * ( z(k)-z_isa(n-1) ) )
144 pres(k) = pres_isa(n-1) * ( temp(k)/temp_isa(n-1) ) ** ( -gmr/gamma(n-1) )
151 pott(k) = temp(k) * ( p00/pres(k) )**rovcp
155 end subroutine atmos_profile_isa_1d
159 subroutine atmos_profile_isa_3d( &
169 integer,
intent(in) :: KA, KS, KE
170 integer,
intent(in) :: IA, IS, IE
171 integer,
intent(in) :: JA, JS, JE
172 real(RP),
intent(in) :: temp_sfc(IA,JA)
173 real(RP),
intent(in) :: pres_sfc(IA,JA)
174 real(RP),
intent(in) :: z (KA,IA,JA)
175 real(RP),
intent(out) :: pott (KA,IA,JA)
177 real(RP) :: temp_isa(nref,IA,JA)
178 real(RP) :: pres_isa(nref,IA,JA)
184 integer :: k, i, j, n
193 temp_isa(1,i,j) = temp_sfc(i,j)
194 pres_isa(1,i,j) = pres_sfc(i,j)
201 temp_isa(n,i,j) = temp_isa(n-1,i,j) + gamma(n-1) * ( z_isa(n)-z_isa(n-1) )
203 if ( gamma(n-1) == 0.0_rp )
then
204 pres_isa(n,i,j) = pres_isa(n-1,i,j) * exp( -gmr / temp_isa(n,i,j) * ( z_isa(n)-z_isa(n-1) ) )
206 pres_isa(n,i,j) = pres_isa(n-1,i,j) * ( temp_isa(n,i,j)/temp_isa(n-1,i,j) ) ** ( -gmr/gamma(n-1) )
213 log_info(
"ATMOS_PROFILE_isa_3D",*)
'ICAO International Standard Atmosphere'
214 log_info_cont(*)
'####################################################'
215 log_info_cont(*)
' height: lapse rate: pressure: temperature'
217 log_info_cont(
'(4F13.5)') z_isa(n), gamma(n), pres_isa(n,is,js), temp_isa(n,is,js)
219 log_info_cont(*)
'####################################################'
225 if ( z(k,i,j) <= z_isa(1) )
then
227 temp(k) = temp_isa(1,i,j) + gamma(1) * ( z(k,i,j)-z_isa(1) )
228 pres(k) = pres_isa(1,i,j) * ( temp(k)/temp_isa(1,i,j) ) ** ( -gmr/gamma(1) )
230 elseif ( z(k,i,j) > z_isa(nref) )
then
232 temp(k) = temp_isa(nref,i,j)
233 pres(k) = pres_isa(nref,i,j) * exp( -gmr/temp_isa(nref,i,j) * ( z(k,i,j)-z_isa(nref) ) )
237 if ( z(k,i,j) > z_isa(n-1) .AND. z(k,i,j) <= z_isa(n) )
then
239 temp(k) = temp_isa(n-1,i,j) + gamma(n-1) * ( z(k,i,j)-z_isa(n-1) )
240 if ( gamma(n-1) == 0.0_rp )
then
241 pres(k) = pres_isa(n-1,i,j) * exp( -gmr/temp_isa(n-1,i,j) * ( z(k,i,j)-z_isa(n-1) ) )
243 pres(k) = pres_isa(n-1,i,j) * ( temp(k)/temp_isa(n-1,i,j) ) ** ( -gmr/gamma(n-1) )
250 pott(k,i,j) = temp(k) * ( p00/pres(k) )**rovcp
256 end subroutine atmos_profile_isa_3d