43 '$Id: Azimuth_Emissivity_F6_Module.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 45 REAL(fp),
PARAMETER ::
zero = 0.0_fp
46 REAL(fp),
PARAMETER ::
point5 = 0.5_fp
47 REAL(fp),
PARAMETER ::
one = 1.0_fp
48 REAL(fp),
PARAMETER ::
two = 2.0_fp
49 REAL(fp),
PARAMETER ::
three = 3.0_fp
50 REAL(fp),
PARAMETER ::
four = 4.0_fp
51 REAL(fp),
PARAMETER ::
pi = 3.141592653589793238462643383279_fp
65 [ 6.925_fp, 10.65_fp, 18.7_fp, 23.8_fp, 36.5_fp, 89.0_fp ]
87 REAL(fp) :: wind_speed =
zero 88 REAL(fp) :: frequency =
zero 89 REAL(fp) :: zenith_angle =
zero 92 LOGICAL :: lw18 = .false.
94 LOGICAL :: lw15 = .false.
98 REAL(fp),
DIMENSION(N_FREQUENCIES) :: a1v , a2v , a1h , a2h
99 REAL(fp),
DIMENSION(N_FREQUENCIES) :: a1s1, a1s2, a2s1, a2s2
100 REAL(fp),
DIMENSION(N_FREQUENCIES) :: a2s2_theta0
101 REAL(fp),
DIMENSION(N_FREQUENCIES) :: a1s1_theta, a1s2_theta, a2s1_theta, a2s2_theta
102 REAL(fp),
DIMENSION(N_FREQUENCIES) :: a1v_theta , a1h_theta , a2v_theta , a2h_theta
121 Wind_Speed , & ! Input
122 Azimuth_Angle, & ! Input
123 Frequency , & ! Input
124 Zenith_Angle , & ! Input
125 e_Azimuth , & ! Output
129 REAL(fp) ,
INTENT(IN) :: wind_speed
130 REAL(fp) ,
INTENT(IN) :: azimuth_angle
131 REAL(fp) ,
INTENT(IN) :: frequency
132 REAL(fp) ,
INTENT(IN) :: zenith_angle
133 REAL(fp) ,
INTENT(OUT) :: e_azimuth(:)
142 ivar%wind_speed = wind_speed
143 ivar%frequency = frequency
144 ivar%zenith_angle = zenith_angle
158 ivar%A1v(j) = azcoeff%C(1,j,
ivpol) * ( exp(-azcoeff%C(5,j,
ivpol) * ivar%w18**2 ) -
one ) * &
159 ( azcoeff%C(2,j,
ivpol) * ivar%w18 + &
160 azcoeff%C(3,j,
ivpol) * ivar%w18**2 + &
161 azcoeff%C(4,j,
ivpol) * ivar%w18**3 )
162 ivar%A2v(j) = azcoeff%C(6,j,
ivpol) * ivar%w18
164 ivar%A1h(j) = azcoeff%C(1,j,
ihpol) * ivar%w18
165 ivar%A2h(j) = azcoeff%C(2,j,
ihpol) * ( exp(-azcoeff%C(6,j,
ihpol) * ivar%w18**2 ) -
one ) * &
166 ( azcoeff%C(3,j,
ihpol) * ivar%w18 + &
167 azcoeff%C(4,j,
ihpol) * ivar%w18**2 + &
168 azcoeff%C(5,j,
ihpol) * ivar%w18**3 )
170 ivar%A1s1(j) = (ivar%A1v(j) + ivar%A1h(j))/
two 171 ivar%A1s2(j) = ivar%A1v(j) - ivar%A1h(j)
172 ivar%A2s1(j) = (ivar%A2v(j) + ivar%A2h(j))/
two 173 ivar%A2s2(j) = ivar%A2v(j) - ivar%A2h(j)
175 ivar%A2s2_theta0(j) = (ivar%w15**2 - (ivar%w15**3)/22.5_fp)/55.5556_fp * &
177 (
one - log10(30.0_fp/ivar%f37) )
179 ivar%A1s1_theta(j) = ivar%A1s1(j)*((ivar%zenith_angle/
theta_ref)**
xs11)
180 ivar%A2s1_theta(j) = ivar%A2s1(j)*((ivar%zenith_angle/
theta_ref)**
xs12)
181 ivar%A1s2_theta(j) = ivar%A1s2(j)*((ivar%zenith_angle/
theta_ref)**
xs21)
182 ivar%A2s2_theta(j) = ivar%A2s2_theta0(j) + &
183 (ivar%A2s2(j) - ivar%A2s2_theta0(j))*((ivar%zenith_angle/
theta_ref)**
xs22)
185 ivar%A1v_theta(j) =
point5*(
two*ivar%A1s1_theta(j) + ivar%A1s2_theta(j))
186 ivar%A1h_theta(j) =
point5*(
two*ivar%A1s1_theta(j) - ivar%A1s2_theta(j))
187 ivar%A2v_theta(j) =
point5*(
two*ivar%A2s1_theta(j) + ivar%A2s2_theta(j))
188 ivar%A2h_theta(j) =
point5*(
two*ivar%A2s1_theta(j) - ivar%A2s2_theta(j))
190 ivar%azimuth_component(j,
ivpol) = (ivar%A1v_theta(j) * cos(ivar%phi)) + (ivar%A2v_theta(j) * cos(
two*ivar%phi))
191 ivar%azimuth_component(j,
ihpol) = (ivar%A1h_theta(j) * cos(ivar%phi)) + (ivar%A2h_theta(j) * cos(
two*ivar%phi))
193 END DO frequency_loop
199 e_azimuth(
ivpol) = ivar%azimuth_component(1,
ivpol)
200 e_azimuth(
ihpol) = ivar%azimuth_component(1,
ihpol)
211 ivar%i2 = ivar%i1 + 1
214 e_azimuth(
ivpol) = ( ivar%lpoly * ivar%azimuth_component(ivar%i2,
ivpol)) + &
215 ((
one - ivar%lpoly) * ivar%azimuth_component(ivar%i1,
ivpol))
216 e_azimuth(
ihpol) = ( ivar%lpoly * ivar%azimuth_component(ivar%i2,
ihpol)) + &
217 ((
one - ivar%lpoly) * ivar%azimuth_component(ivar%i1,
ihpol))
226 Wind_Speed_TL , & ! Input
227 Azimuth_Angle_TL, & ! Input
228 e_Azimuth_TL , & ! Output
232 REAL(fp) ,
INTENT(IN) :: wind_speed_tl
233 REAL(fp) ,
INTENT(IN) :: azimuth_angle_tl
234 REAL(fp) ,
INTENT(OUT) :: e_azimuth_tl(:)
239 REAL(fp),
DIMENSION(N_FREQUENCIES) :: a1v_tl , a2v_tl , a1h_tl , a2h_tl
240 REAL(fp),
DIMENSION(N_FREQUENCIES) :: a1s1_tl, a1s2_tl, a2s1_tl, a2s2_tl
241 REAL(fp),
DIMENSION(N_FREQUENCIES) :: a2s2_theta0_tl
242 REAL(fp),
DIMENSION(N_FREQUENCIES) :: a1s1_theta_tl, a1s2_theta_tl, a2s1_theta_tl, a2s2_theta_tl
243 REAL(fp),
DIMENSION(N_FREQUENCIES) :: a1v_theta_tl , a1h_theta_tl , a2v_theta_tl , a2h_theta_tl
256 IF ( ivar%lw18 )
THEN 262 a1v_tl(j) = ( azcoeff%C(1,j,
ivpol) * ( exp(-azcoeff%C(5,j,
ivpol) * ivar%w18**2 ) -
one ) * &
263 ( azcoeff%C(2,j,
ivpol) + &
264 two * azcoeff%C(3,j,
ivpol) * ivar%w18 + &
265 three * azcoeff%C(4,j,
ivpol) * ivar%w18**2 ) - &
266 two * azcoeff%C(1,j,
ivpol) * azcoeff%C(5,j,
ivpol) * ivar%w18 * &
267 exp(-azcoeff%C(5,j,
ivpol) * ivar%w18**2 ) * &
268 ( azcoeff%C(2,j,
ivpol) * ivar%w18 + &
269 azcoeff%C(3,j,
ivpol) * ivar%w18**2 + &
270 azcoeff%C(4,j,
ivpol) * ivar%w18**3 ) ) * wind_speed_tl
271 a2v_tl(j) = azcoeff%C(6,j,
ivpol) * wind_speed_tl
273 a1h_tl(j) = azcoeff%C(1,j,
ihpol) * wind_speed_tl
275 a2h_tl(j) = ( azcoeff%C(2,j,
ihpol) * ( exp(-azcoeff%C(6,j,
ihpol) * ivar%w18**2 ) -
one ) * &
276 ( azcoeff%C(3,j,
ihpol) + &
277 two * azcoeff%C(4,j,
ihpol) * ivar%w18 + &
278 three * azcoeff%C(5,j,
ihpol) * ivar%w18**2 ) - &
279 two * azcoeff%C(2,j,
ihpol) * azcoeff%C(6,j,
ihpol) * ivar%w18 * &
280 exp(-azcoeff%C(6,j,
ihpol) * ivar%w18**2 ) * &
281 ( azcoeff%C(3,j,
ihpol) * ivar%w18 + &
282 azcoeff%C(4,j,
ihpol) * ivar%w18**2 + &
283 azcoeff%C(5,j,
ihpol) * ivar%w18**3 ) ) * wind_speed_tl
287 a1s1_tl(j) = (a1v_tl(j) + a1h_tl(j))/
two 288 a1s2_tl(j) = a1v_tl(j) - a1h_tl(j)
289 a2s1_tl(j) = (a2v_tl(j) + a2h_tl(j))/
two 290 a2s2_tl(j) = a2v_tl(j) - a2h_tl(j)
294 IF ( ivar%lw15 )
THEN 295 a2s2_theta0_tl(j) =
zero 297 a2s2_theta0_tl(j) = (
two*ivar%w15 - (
three*ivar%w15**2)/22.5_fp)/55.5556_fp * &
299 (
one - log10(30.0_fp/ivar%f37) ) * wind_speed_tl
303 a1s1_theta_tl(j) = a1s1_tl(j)*((ivar%zenith_angle/
theta_ref)**
xs11)
304 a2s1_theta_tl(j) = a2s1_tl(j)*((ivar%zenith_angle/
theta_ref)**
xs12)
305 a1s2_theta_tl(j) = a1s2_tl(j)*((ivar%zenith_angle/
theta_ref)**
xs21)
306 a2s2_theta_tl(j) = a2s2_theta0_tl(j) + &
307 (a2s2_tl(j) - a2s2_theta0_tl(j))*((ivar%zenith_angle/
theta_ref)**
xs22)
310 a1v_theta_tl(j) =
point5*(
two*a1s1_theta_tl(j) + a1s2_theta_tl(j))
311 a1h_theta_tl(j) =
point5*(
two*a1s1_theta_tl(j) - a1s2_theta_tl(j))
312 a2v_theta_tl(j) =
point5*(
two*a2s1_theta_tl(j) + a2s2_theta_tl(j))
313 a2h_theta_tl(j) =
point5*(
two*a2s1_theta_tl(j) - a2s2_theta_tl(j))
316 azimuth_component_tl(j,
ivpol) = (cos( ivar%phi ) * a1v_theta_tl(j)) + &
317 (cos(
two*ivar%phi) * a2v_theta_tl(j)) - &
318 ( ( ivar%A1v_theta(j) * sin( ivar%phi )) + &
319 (
two * ivar%A2v_theta(j) * sin(
two*ivar%phi)) ) * phi_tl
320 azimuth_component_tl(j,
ihpol) = (cos( ivar%phi ) * a1h_theta_tl(j)) + &
321 (cos(
two*ivar%phi) * a2h_theta_tl(j)) - &
322 ( ( ivar%A1h_theta(j) * sin( ivar%phi )) + &
323 (
two * ivar%A2h_theta(j) * sin(
two*ivar%phi)) ) * phi_tl
325 END DO frequency_loop
331 e_azimuth_tl(
ivpol) = azimuth_component_tl(1,
ivpol)
332 e_azimuth_tl(
ihpol) = azimuth_component_tl(1,
ihpol)
342 e_azimuth_tl(
ivpol) = ( ivar%lpoly * azimuth_component_tl(ivar%i2,
ivpol)) + &
343 ((
one - ivar%lpoly) * azimuth_component_tl(ivar%i1,
ivpol))
344 e_azimuth_tl(
ihpol) = ( ivar%lpoly * azimuth_component_tl(ivar%i2,
ihpol)) + &
345 ((
one - ivar%lpoly) * azimuth_component_tl(ivar%i1,
ihpol))
353 e_Azimuth_AD , & ! AD Input
354 Wind_Speed_AD , & ! AD Output
355 Azimuth_Angle_AD, & ! AD Output
359 REAL(fp) ,
INTENT(IN OUT) :: e_azimuth_ad(:)
360 REAL(fp) ,
INTENT(IN OUT) :: wind_speed_ad
361 REAL(fp) ,
INTENT(IN OUT) :: azimuth_angle_ad
366 REAL(fp),
DIMENSION(N_FREQUENCIES) :: a1v_ad , a2v_ad , a1h_ad , a2h_ad
367 REAL(fp),
DIMENSION(N_FREQUENCIES) :: a1s1_ad, a1s2_ad, a2s1_ad, a2s2_ad
368 REAL(fp),
DIMENSION(N_FREQUENCIES) :: a2s2_theta0_ad
369 REAL(fp),
DIMENSION(N_FREQUENCIES) :: a1s1_theta_ad, a1s2_theta_ad, a2s1_theta_ad, a2s2_theta_ad
370 REAL(fp),
DIMENSION(N_FREQUENCIES) :: a1v_theta_ad , a1h_theta_ad , a2v_theta_ad , a2h_theta_ad
377 a2s2_theta0_ad =
zero 378 a1s1_theta_ad =
zero; a1s2_theta_ad =
zero; a2s1_theta_ad =
zero; a2s2_theta_ad =
zero 379 a1v_theta_ad =
zero; a1h_theta_ad =
zero; a2v_theta_ad =
zero; a2h_theta_ad =
zero 380 azimuth_component_ad =
zero 386 azimuth_component_ad(1,
ihpol) = azimuth_component_ad(1,
ihpol) + e_azimuth_ad(
ihpol)
387 azimuth_component_ad(1,
ivpol) = azimuth_component_ad(1,
ivpol) + e_azimuth_ad(
ivpol)
394 azimuth_component_ad(ivar%i1,
ihpol) = ((
one - ivar%lpoly) * e_azimuth_ad(
ihpol)) + azimuth_component_ad(ivar%i1,
ihpol)
395 azimuth_component_ad(ivar%i2,
ihpol) = ( ivar%lpoly * e_azimuth_ad(
ihpol)) + azimuth_component_ad(ivar%i2,
ihpol)
396 azimuth_component_ad(ivar%i1,
ivpol) = ((
one - ivar%lpoly) * e_azimuth_ad(
ivpol)) + azimuth_component_ad(ivar%i1,
ivpol)
397 azimuth_component_ad(ivar%i2,
ivpol) = ( ivar%lpoly * e_azimuth_ad(
ivpol)) + azimuth_component_ad(ivar%i2,
ivpol)
407 ( ( ivar%A1h_theta(j) * sin( ivar%phi )) + &
408 (
two * ivar%A2h_theta(j) * sin(
two*ivar%phi)) ) * azimuth_component_ad(j,
ihpol)
409 a2h_theta_ad(j) = (cos(
two*ivar%phi) * azimuth_component_ad(j,
ihpol)) + a2h_theta_ad(j)
410 a1h_theta_ad(j) = (cos( ivar%phi ) * azimuth_component_ad(j,
ihpol)) + a1h_theta_ad(j)
414 ( ( ivar%A1v_theta(j) * sin( ivar%phi )) + &
415 (
two * ivar%A2v_theta(j) * sin(
two*ivar%phi)) ) * azimuth_component_ad(j,
ivpol)
416 a2v_theta_ad(j) = (cos(
two*ivar%phi) * azimuth_component_ad(j,
ivpol)) + a2v_theta_ad(j)
417 a1v_theta_ad(j) = (cos( ivar%phi ) * azimuth_component_ad(j,
ivpol)) + a1v_theta_ad(j)
421 a2s2_theta_ad(j) = a2s2_theta_ad(j) -
point5*a2h_theta_ad(j)
422 a2s1_theta_ad(j) = a2s1_theta_ad(j) + a2h_theta_ad(j)
423 a2h_theta_ad(j) =
zero 425 a2s2_theta_ad(j) = a2s2_theta_ad(j) +
point5*a2v_theta_ad(j)
426 a2s1_theta_ad(j) = a2s1_theta_ad(j) + a2v_theta_ad(j)
427 a2v_theta_ad(j) =
zero 429 a1s2_theta_ad(j) = a1s2_theta_ad(j) -
point5*a1h_theta_ad(j)
430 a1s1_theta_ad(j) = a1s1_theta_ad(j) + a1h_theta_ad(j)
431 a1h_theta_ad(j) =
zero 433 a1s2_theta_ad(j) = a1s2_theta_ad(j) +
point5*a1v_theta_ad(j)
434 a1s1_theta_ad(j) = a1s1_theta_ad(j) + a1v_theta_ad(j)
435 a1v_theta_ad(j) =
zero 438 a2s2_ad(j) = a2s2_ad(j) + a2s2_theta_ad(j)*((ivar%zenith_angle/
theta_ref)**
xs22)
439 a2s2_theta0_ad(j) = a2s2_theta0_ad(j) + a2s2_theta_ad(j)*(
one - (ivar%zenith_angle/
theta_ref)**
xs22)
440 a2s2_theta_ad(j) =
zero 442 a1s2_ad(j) = a1s2_ad(j) + a1s2_theta_ad(j)*((ivar%zenith_angle/
theta_ref)**
xs21)
443 a1s2_theta_ad(j) =
zero 445 a2s1_ad(j) = a2s1_ad(j) + a2s1_theta_ad(j)*((ivar%zenith_angle/
theta_ref)**
xs12)
446 a2s1_theta_ad(j) =
zero 448 a1s1_ad(j) = a1s1_ad(j) + a1s1_theta_ad(j)*((ivar%zenith_angle/
theta_ref)**
xs11)
449 a1s1_theta_ad(j) =
zero 453 IF ( ivar%lw15 )
THEN 454 a2s2_theta0_ad(j) =
zero 456 wind_speed_ad = wind_speed_ad + &
457 ((
two*ivar%w15 - (
three*ivar%w15**2)/22.5_fp)/55.5556_fp * &
459 (
one - log10(30.0_fp/ivar%f37)))*a2s2_theta0_ad(j)
460 a2s2_theta0_ad(j) =
zero 464 a2h_ad(j) = a2h_ad(j) - a2s2_ad(j)
465 a2v_ad(j) = a2v_ad(j) + a2s2_ad(j)
468 a2h_ad(j) = a2h_ad(j) +
point5*a2s1_ad(j)
469 a2v_ad(j) = a2v_ad(j) +
point5*a2s1_ad(j)
472 a1h_ad(j) = a1h_ad(j) - a1s2_ad(j)
473 a1v_ad(j) = a1v_ad(j) + a1s2_ad(j)
476 a1h_ad(j) = a1h_ad(j) +
point5*a1s1_ad(j)
477 a1v_ad(j) = a1v_ad(j) +
point5*a1s1_ad(j)
482 IF ( ivar%lw18 )
THEN 488 wind_speed_ad = wind_speed_ad + &
489 ( azcoeff%C(2,j,
ihpol) * ( exp(-azcoeff%C(6,j,
ihpol) * ivar%w18**2 ) -
one ) * &
490 ( azcoeff%C(3,j,
ihpol) + &
491 two * azcoeff%C(4,j,
ihpol) * ivar%w18 + &
492 three * azcoeff%C(5,j,
ihpol) * ivar%w18**2 ) - &
493 two * azcoeff%C(2,j,
ihpol) * azcoeff%C(6,j,
ihpol) * ivar%w18 * &
494 exp(-azcoeff%C(6,j,
ihpol) * ivar%w18**2 ) * &
495 ( azcoeff%C(3,j,
ihpol) * ivar%w18 + &
496 azcoeff%C(4,j,
ihpol) * ivar%w18**2 + &
497 azcoeff%C(5,j,
ihpol) * ivar%w18**3 ) ) * a2h_ad(j)
500 wind_speed_ad = wind_speed_ad + azcoeff%C(1,j,
ihpol)*a1h_ad(j)
503 wind_speed_ad = wind_speed_ad + azcoeff%C(6,j,
ivpol)*a2v_ad(j)
506 wind_speed_ad = wind_speed_ad + &
507 ( azcoeff%C(1,j,
ivpol) * ( exp(-azcoeff%C(5,j,
ivpol) * ivar%w18**2 ) -
one ) * &
508 ( azcoeff%C(2,j,
ivpol) + &
509 two * azcoeff%C(3,j,
ivpol) * ivar%w18 + &
510 three * azcoeff%C(4,j,
ivpol) * ivar%w18**2 ) - &
511 two * azcoeff%C(1,j,
ivpol) * azcoeff%C(5,j,
ivpol) * ivar%w18 * &
512 exp(-azcoeff%C(5,j,
ivpol) * ivar%w18**2 ) * &
513 ( azcoeff%C(2,j,
ivpol) * ivar%w18 + &
514 azcoeff%C(3,j,
ivpol) * ivar%w18**2 + &
515 azcoeff%C(4,j,
ivpol) * ivar%w18**3 ) ) * a1v_ad(j)
519 END DO frequency_loop
integer, parameter, public fp
real(fp), parameter degrees_to_radians
real(fp), parameter wind_speed_max15
subroutine, public azimuth_emissivity_f6(AZCoeff, Wind_Speed, Azimuth_Angle, Frequency, Zenith_Angle, e_Azimuth, iVar)
real(fp), parameter wind_speed_max18
real(fp), parameter three
real(fp), parameter frequency_max37
integer, parameter n_stokes
integer, parameter n_frequencies
real(fp), parameter point5
subroutine, public azimuth_emissivity_f6_tl(AZCoeff, Wind_Speed_TL, Azimuth_Angle_TL, e_Azimuth_TL, iVar)
real(fp), dimension(n_frequencies), parameter fit_frequency
character(*), parameter module_version_id
real(fp), parameter theta_ref
subroutine, public azimuth_emissivity_f6_ad(AZCoeff, e_Azimuth_AD, Wind_Speed_AD, Azimuth_Angle_AD, iVar)
integer function, public bisection_search(x, u, xLower, xUpper)