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( &
84 integer,
intent(in) :: KA, KS, KE
85 real(RP),
intent(in) :: temp_sfc
86 real(RP),
intent(in) :: pres_sfc
87 real(RP),
intent(in) :: z (KA)
88 real(RP),
intent(out) :: pott(KA)
90 real(RP) :: temp_isa(nref)
91 real(RP) :: pres_isa(nref)
104 temp_isa(1) = temp_sfc
105 pres_isa(1) = pres_sfc
109 temp_isa(n) = temp_isa(n-1) + gamma(n-1) * ( z_isa(n)-z_isa(n-1) )
111 if ( gamma(n-1) == 0.0_rp )
then
112 pres_isa(n) = pres_isa(n-1) * exp( -gmr / temp_isa(n) * ( z_isa(n)-z_isa(n-1) ) )
114 pres_isa(n) = pres_isa(n-1) * ( temp_isa(n)/temp_isa(n-1) ) ** ( -gmr/gamma(n-1) )
120 log_info(
"ATMOS_PROFILE_isa_1D",*)
'###### ICAO International Standard Atmosphere ######'
121 log_info_cont(*)
' height: lapse rate: pressure: temperature'
123 log_info_cont(
'(4F13.5)') z_isa(n), gamma(n), pres_isa(n), temp_isa(n)
125 log_info_cont(*)
'####################################################'
130 if ( z(k) <= z_isa(1) )
then
132 temp(k) = temp_isa(1) + gamma(1) * ( z(k)-z_isa(1) )
133 pres(k) = pres_isa(1) * ( temp(k)/temp_isa(1) ) ** ( -gmr/gamma(1) )
135 elseif( z(k) > z_isa(nref) )
then
137 temp(k) = temp_isa(nref)
138 pres(k) = pres_isa(nref) * exp( -gmr/temp_isa(nref) * ( z(k)-z_isa(nref) ) )
142 if ( z(k) > z_isa(n-1) .AND. z(k) <= z_isa(n) )
then
144 temp(k) = temp_isa(n-1) + gamma(n-1) * ( z(k)-z_isa(n-1) )
145 if ( gamma(n-1) == 0.0_rp )
then
146 pres(k) = pres_isa(n-1) * exp( -gmr/temp_isa(n-1) * ( z(k)-z_isa(n-1) ) )
148 pres(k) = pres_isa(n-1) * ( temp(k)/temp_isa(n-1) ) ** ( -gmr/gamma(n-1) )
155 pott(k) = temp(k) * ( p00/pres(k) )**rovcp
159 end subroutine atmos_profile_isa_1d
163 subroutine atmos_profile_isa_3d( &
173 integer,
intent(in) :: KA, KS, KE
174 integer,
intent(in) :: IA, IS, IE
175 integer,
intent(in) :: JA, JS, JE
176 real(RP),
intent(in) :: temp_sfc(IA,JA)
177 real(RP),
intent(in) :: pres_sfc(IA,JA)
178 real(RP),
intent(in) :: z (KA,IA,JA)
179 real(RP),
intent(out) :: pott (KA,IA,JA)
181 real(RP) :: temp_isa(nref,IA,JA)
182 real(RP) :: pres_isa(nref,IA,JA)
188 integer :: k, i, j, n
200 temp_isa(1,i,j) = temp_sfc(i,j)
201 pres_isa(1,i,j) = pres_sfc(i,j)
210 temp_isa(n,i,j) = temp_isa(n-1,i,j) + gamma(n-1) * ( z_isa(n)-z_isa(n-1) )
212 if ( gamma(n-1) == 0.0_rp )
then
213 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) ) )
215 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) )
223 log_info(
"ATMOS_PROFILE_isa_3D",*)
'ICAO International Standard Atmosphere'
224 log_info_cont(*)
'####################################################'
225 log_info_cont(*)
' height: lapse rate: pressure: temperature'
227 log_info_cont(
'(4F13.5)') z_isa(n), gamma(n), pres_isa(n,is,js), temp_isa(n,is,js)
229 log_info_cont(*)
'####################################################'
238 if ( z(k,i,j) <= z_isa(1) )
then
240 temp(k) = temp_isa(1,i,j) + gamma(1) * ( z(k,i,j)-z_isa(1) )
241 pres(k) = pres_isa(1,i,j) * ( temp(k)/temp_isa(1,i,j) ) ** ( -gmr/gamma(1) )
243 elseif ( z(k,i,j) > z_isa(nref) )
then
245 temp(k) = temp_isa(nref,i,j)
246 pres(k) = pres_isa(nref,i,j) * exp( -gmr/temp_isa(nref,i,j) * ( z(k,i,j)-z_isa(nref) ) )
250 if ( z(k,i,j) > z_isa(n-1) .AND. z(k,i,j) <= z_isa(n) )
then
252 temp(k) = temp_isa(n-1,i,j) + gamma(n-1) * ( z(k,i,j)-z_isa(n-1) )
253 if ( gamma(n-1) == 0.0_rp )
then
254 pres(k) = pres_isa(n-1,i,j) * exp( -gmr/temp_isa(n-1,i,j) * ( z(k,i,j)-z_isa(n-1) ) )
256 pres(k) = pres_isa(n-1,i,j) * ( temp(k)/temp_isa(n-1,i,j) ) ** ( -gmr/gamma(n-1) )
263 pott(k,i,j) = temp(k) * ( p00/pres(k) )**rovcp
272 end subroutine atmos_profile_isa_3d