FV3 Bundle
CRTM_GeometryInfo.f90
Go to the documentation of this file.
1 !
2 ! CRTM_GeometryInfo
3 !
4 ! Application module for the GeometryInfo structure.
5 !
6 !
7 ! CREATION HISTORY:
8 ! Written by: Paul van Delst, 19-May-2004
9 ! paul.vandelst@noaa.gov
10 !
11 ! Yong Chen, CSU/CIRA 10-May-2006
12 ! Yong.Chen@noaa.gov
13 !
14 
16 
17  ! ------------------
18  ! Environment set up
19  ! ------------------
20  ! Module use
21  USE type_kinds , ONLY: fp
23  USE date_utility , ONLY: dayofyear
24  USE crtm_parameters, ONLY: zero, one, two , &
25  twopi , &
26  earth_radius , &
30  USE crtm_geometryinfo_define, ONLY: crtm_geometry_type , &
33  ! Disable implicit typing
34  IMPLICIT NONE
35 
36 
37  ! ------------
38  ! Visibilities
39  ! ------------
40  PRIVATE
42  PUBLIC :: saconv, saconv_tl, saconv_ad
43  PUBLIC :: vaconv, vaconv_tl, vaconv_ad
44  PUBLIC :: crtm_geometryinfo_version
45 
46 
47  ! -----------------
48  ! Module parameters
49  ! -----------------
50  ! Version Id for the module
51  CHARACTER(*), PARAMETER :: module_version_id = &
52  '$Id: CRTM_GeometryInfo.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $'
53  ! Metres->kilometres conversion factor
54  REAL(fp), PARAMETER :: m_to_km = 1.0e-03_fp
55 
56 
57 CONTAINS
58 
59 
60 !##################################################################################
61 !##################################################################################
62 !## ##
63 !## ## PUBLIC MODULE ROUTINES ## ##
64 !## ##
65 !##################################################################################
66 !##################################################################################
67 
68 !--------------------------------------------------------------------------------
69 !:sdoc+:
70 !
71 ! NAME:
72 ! CRTM_GeometryInfo_Compute
73 !
74 ! PURPOSE:
75 ! Elemental subroutine to compute the derived geometry from the user
76 ! specified components of the CRTM GeometryInfo structure.
77 !
78 ! CALLING SEQUENCE:
79 ! CALL CRTM_GeometryInfo_Compute( GeometryInfo )
80 !
81 ! INPUTS:
82 ! GeometryInfo: The GeometryInfo object containing the user
83 ! defined inputs
84 ! UNITS: N/A
85 ! TYPE: CRTM_GeometryInfo_type
86 ! DIMENSION: Scalar
87 ! ATTRIBUTES: INTENT(IN OUT)
88 !
89 ! OUTPUTS:
90 ! GeometryInfo: The GeometryInfo structure with the non-user
91 ! components filled.
92 ! UNITS: N/A
93 ! TYPE: CRTM_GeometryInfo_type
94 ! DIMENSION: Scalar
95 ! ATTRIBUTES: INTENT(IN OUT)
96 !
97 ! SIDE EFFECTS:
98 ! This function changes the values of the non-user components of the
99 ! GeometryInfo object.
100 !
101 !:sdoc-:
102 !--------------------------------------------------------------------------------
103 
104  ELEMENTAL SUBROUTINE crtm_geometryinfo_compute( gInfo )
105  TYPE(crtm_geometryinfo_type), INTENT(IN OUT) :: ginfo
106 
107  REAL(fp) :: cosv
108 
109  ! Compute the derived values
110  ! ...Derived sensor angles
111  ginfo%Sensor_Scan_Radian = degrees_to_radians * ginfo%user%Sensor_Scan_Angle
112  ginfo%Sensor_Zenith_Radian = degrees_to_radians * ginfo%user%Sensor_Zenith_Angle
113  ginfo%Sensor_Azimuth_Radian = degrees_to_radians * ginfo%user%Sensor_Azimuth_Angle
114  ginfo%Cosine_Sensor_Zenith = cos(ginfo%Sensor_Zenith_Radian)
115  ginfo%Secant_Sensor_Zenith = one / ginfo%Cosine_Sensor_Zenith
116  ! ...Check user zenith angle. If it is larger than the transmittance algorithms' limit
117  ! then use the limiting value in the algorithms. The optical depths will be scaled
118  ! back to the those at the user zenith angle.
119  IF( ginfo%user%Sensor_Zenith_Angle > max_trans_zenith_angle )THEN
120  ginfo%Trans_Zenith_Radian = degrees_to_radians * max_trans_zenith_angle
121  ginfo%Secant_Trans_Zenith = one / cos(ginfo%Trans_Zenith_Radian)
122  ELSE
123  ginfo%Trans_Zenith_Radian = ginfo%Sensor_Zenith_Radian
124  ginfo%Secant_Trans_Zenith = ginfo%Secant_Sensor_Zenith
125  END IF
126  ! ...Distance ratio, but only if zenith angle is large enough
127  IF ( abs(ginfo%user%Sensor_Zenith_Angle) > one ) THEN
128  ginfo%Distance_Ratio = abs(sin(ginfo%Sensor_Scan_Radian)/sin(ginfo%Sensor_Zenith_Radian))
129  END IF
130  ! ...Derived source angles
131  ginfo%Source_Zenith_Radian = degrees_to_radians * ginfo%user%Source_Zenith_Angle
132  ginfo%Source_Azimuth_Radian = degrees_to_radians * ginfo%user%Source_Azimuth_Angle
133  cosv = cos(ginfo%Source_Zenith_Radian)
134  IF( cosv /= zero )THEN
135  ginfo%Secant_Source_Zenith = one / cosv
136  ELSE
137  ! ...Set to a large number with the sign of the original value
138  ginfo%Secant_Source_Zenith = huge(cosv) * cosv/abs(cosv) ! SIGN(HUGE(cosv),cosv) ?
139  ENDIF
140 
141  ! ...Derived flux angles
142  ginfo%Flux_Zenith_Radian = degrees_to_radians * ginfo%user%Flux_Zenith_Angle
143  ginfo%Secant_Flux_Zenith = one / cos(ginfo%Flux_Zenith_Radian)
144  ! ...AU ratio term
145  ginfo%AU_ratio2 = compute_au_ratio2( ginfo%user%Year, ginfo%user%Month, ginfo%user%Day )
146 
147  END SUBROUTINE crtm_geometryinfo_compute
148 
149 
150 !----------------------------------------------------------------------------------
151 !:sdoc+:
152 ! NAME:
153 ! SACONV
154 !
155 ! PURPOSE:
156 ! Elemental subroutine to compute the sensor zenith angle at a given altitude
157 ! for a given surface sensor zenith angle.
158 !
159 ! CALLING SEQUENCE:
160 ! CALL SACONV( Sensor_Zenith_Radian, & ! Input
161 ! Altitude , & ! Input
162 ! Local_Zenith_Radian ) ! Output
163 !
164 ! INPUTS:
165 ! Sensor_Zenith_Radian: Sensor zenith angle at the Earth's surface
166 ! UNITS: radians
167 ! TYPE: REAL(fp)
168 ! DIMENSION: Scalar or any rank
169 ! ATTRIBUTES: INTENT(IN)
170 !
171 ! Altitude: The altitude at which the local sensor zenith angle
172 ! is required
173 ! UNITS: metres
174 ! TYPE: REAL(fp)
175 ! DIMENSION: Scalar or any rank
176 ! ATTRIBUTES: INTENT(IN)
177 !
178 ! OUTPUTS:
179 ! Local_Zenith_Radian: The sensor zenith angle at the supplied altitude.
180 ! UNITS: radians
181 ! TYPE: REAL(fp)
182 ! DIMENSION: Same as input
183 ! ATTRIBUTES: INTENT(OUT)
184 !
185 ! CREATION HISTORY:
186 ! Written by: Yong Chen, CSU/CIRA 10-May-2006
187 ! Yong.Chen@noaa.gov
188 !
189 ! Paul van Delst, 18-Nov-2009
190 ! paul.vandelst@noaa.gov
191 !:sdoc-:
192 !--------------------------------------------------------------------------------
193 
194  ELEMENTAL SUBROUTINE saconv( &
195  Sensor_Zenith_Radian, & ! Input
196  Altitude , & ! Input
197  Local_Zenith_Radian ) ! Output
198  ! Arguments
199  REAL(fp), INTENT(IN) :: sensor_zenith_radian
200  REAL(fp), INTENT(IN) :: altitude
201  REAL(fp), INTENT(OUT) :: local_zenith_radian
202  ! Local variables
203  REAL(fp) :: ra
204 
205  ! Compute the radius, in km, of the point at which to calc the angle
206  ra = earth_radius + (m_to_km * altitude)
207 
208  ! Compute the angle
209  local_zenith_radian = asin((earth_radius / ra) * sin(sensor_zenith_radian))
210 
211  END SUBROUTINE saconv
212 
213 
214 !----------------------------------------------------------------------------------
215 !:sdoc+:
216 ! NAME:
217 ! SACONV_TL
218 !
219 ! PURPOSE:
220 ! Tangent-linear form of elemental subroutine to compute the sensor zenith
221 ! angle at a given altitude for a given surface sensor zenith angle.
222 !
223 ! CALLING SEQUENCE:
224 ! CALL SACONV_TL( Sensor_Zenith_Radian , & ! FWD Input
225 ! Altitude , & ! FWD Input
226 ! Altitude_TL , & ! TL Input
227 ! Local_Zenith_Radian_TL ) ! TL Output
228 !
229 ! INPUTS:
230 ! Sensor_Zenith_Radian: Sensor zenith angle at the Earth's surface
231 ! UNITS: radians
232 ! TYPE: REAL(fp)
233 ! DIMENSION: Scalar or any rank
234 ! ATTRIBUTES: INTENT(IN)
235 !
236 ! Altitude: The altitude at which the local sensor zenith
237 ! angle is required
238 ! UNITS: metres
239 ! TYPE: REAL(fp)
240 ! DIMENSION: Scalar or any rank
241 ! ATTRIBUTES: INTENT(IN)
242 !
243 ! Altitude_TL: Tangent-linear altitude.
244 ! UNITS: metres
245 ! TYPE: REAL(fp)
246 ! DIMENSION: Scalar or any rank
247 ! ATTRIBUTES: INTENT(IN)
248 !
249 ! OUTPUTS:
250 ! Local_Zenith_Radian_TL: The tangent-linear sensor zenith angle at the
251 ! supplied altitude.
252 ! UNITS: radians
253 ! TYPE: REAL(fp)
254 ! DIMENSION: Same as input
255 ! ATTRIBUTES: INTENT(OUT)
256 !
257 ! CREATION HISTORY:
258 ! Written by: Yong Chen, CSU/CIRA 10-May-2006
259 ! Yong.Chen@noaa.gov
260 !
261 ! Paul van Delst, 20-Nov-2009
262 ! paul.vandelst@noaa.gov
263 !:sdoc-:
264 !--------------------------------------------------------------------------------
265 
266  ELEMENTAL SUBROUTINE saconv_tl( &
267  Sensor_Zenith_Radian, & ! FWD Input
268  Altitude, & ! FWD Input
269  Altitude_TL, & ! TL Input
270  Local_Zenith_Radian_TL ) ! TL Output
271  ! Arguments
272  REAL(fp), INTENT(IN) :: sensor_zenith_radian
273  REAL(fp), INTENT(IN) :: altitude
274  REAL(fp), INTENT(IN) :: altitude_tl
275  REAL(fp), INTENT(OUT) :: local_zenith_radian_tl
276  ! Local variables
277  REAL(fp) :: ra, ra_tl
278  REAL(fp) :: local_zenith_radian
279 
280  ! Compute the radius, in km, of the point at which to calc the angle
281  ra = earth_radius + (m_to_km * altitude)
282  ra_tl = m_to_km * altitude_tl
283 
284  ! Compute the tangent-linear angle
285  CALL saconv( sensor_zenith_radian, altitude, local_zenith_radian )
286  local_zenith_radian_tl = -tan(local_zenith_radian) * ra_tl / ra
287 
288  END SUBROUTINE saconv_tl
289 
290 
291 !----------------------------------------------------------------------------------
292 !:sdoc+:
293 ! NAME:
294 ! SACONV_AD
295 !
296 ! PURPOSE:
297 ! Adjoint form of elemental subroutine to compute the sensor zenith
298 ! angle at a given altitude for a given surface sensor zenith angle.
299 !
300 ! CALLING SEQUENCE:
301 ! CALL SACONV_AD( Sensor_Zenith_Radian , & ! FWD Input
302 ! Altitude , & ! FWD Input
303 ! Local_Zenith_Radian_AD, & ! AD Input
304 ! Altitude_AD ) ! AD Output
305 !
306 ! INPUTS:
307 ! Sensor_Zenith_Radian: Sensor zenith angle at the Earth's surface
308 ! UNITS: radians
309 ! TYPE: REAL(fp)
310 ! DIMENSION: Scalar or any rank
311 ! ATTRIBUTES: INTENT(IN)
312 !
313 ! Altitude: The altitude at which the local sensor zenith
314 ! angle is required
315 ! UNITS: metres
316 ! TYPE: REAL(fp)
317 ! DIMENSION: Scalar or any rank
318 ! ATTRIBUTES: INTENT(IN)
319 !
320 ! Local_Zenith_Radian_AD: The adjoint sensor zenith angle at the
321 ! supplied altitude.
322 ! *** SET TO ZERO ON EXIT ***
323 ! UNITS: radians
324 ! TYPE: REAL(fp)
325 ! DIMENSION: Scalar or any rank
326 ! ATTRIBUTES: INTENT(IN OUT)
327 !
328 ! OUTPUTS:
329 ! Altitude_AD: Adjoint altitude.
330 ! *** MUST HAVE VALUE ON ENTRY ***
331 ! UNITS: metres
332 ! TYPE: REAL(fp)
333 ! DIMENSION: Same as input
334 ! ATTRIBUTES: INTENT(IN OUT)
335 !
336 ! CREATION HISTORY:
337 ! Written by: Yong Chen, CSU/CIRA 10-May-2006
338 ! Yong.Chen@noaa.gov
339 !
340 ! Paul van Delst, 23-Nov-2009
341 ! paul.vandelst@noaa.gov
342 !:sdoc-:
343 !--------------------------------------------------------------------------------
344 
345  ELEMENTAL SUBROUTINE saconv_ad( &
346  Sensor_Zenith_Radian, & ! FWD Input
347  Altitude, & ! FWD Input
348  Local_Zenith_Radian_AD, & ! AD Input
349  Altitude_AD ) ! AD Output
350  ! Arguments
351  REAL(fp), INTENT(IN) :: sensor_zenith_radian
352  REAL(fp), INTENT(IN) :: altitude
353  REAL(fp), INTENT(IN OUT) :: local_zenith_radian_ad
354  REAL(fp), INTENT(IN OUT) :: altitude_ad
355  ! Local variables
356  REAL(fp) :: local_zenith_radian
357  REAL(fp) :: ra, ra_ad
358 
359  ! Forward model calculations
360  ra = earth_radius + (m_to_km * altitude)
361  CALL saconv( sensor_zenith_radian, altitude, local_zenith_radian )
362 
363  ! Compute the angle adjoint
364  ra_ad = -tan(local_zenith_radian) * local_zenith_radian_ad / ra
365  local_zenith_radian_ad = zero
366  altitude_ad = altitude_ad + (m_to_km * ra_ad)
367 
368  END SUBROUTINE saconv_ad
369 
370 
371 !----------------------------------------------------------------------------------
372 !:sdoc+:
373 ! NAME:
374 ! VACONV
375 !
376 ! PURPOSE:
377 ! Elemental subroutine to compute the sensor zenith angle at a given altitude
378 ! for a given sensor scan angle.
379 !
380 ! CALLING SEQUENCE:
381 ! CALL VACONV( Sensor_Scan_Radian, & ! Input
382 ! Satellite_Altitude, & ! Input
383 ! Altitude, & ! Input
384 ! Local_Zenith_Radian ) ! Output
385 !
386 ! INPUTS:
387 ! Sensor_Scan_Radian: Sensor scan angle.
388 ! UNITS: radians
389 ! TYPE: REAL(fp)
390 ! DIMENSION: Scalar or any rank
391 ! ATTRIBUTES: INTENT(IN)
392 !
393 ! Satellite_Altitude: The satellite altitude
394 ! UNITS: kilometres
395 ! TYPE: REAL(fp)
396 ! DIMENSION: Scalar or any rank
397 ! ATTRIBUTES: INTENT(IN)
398 !
399 ! Altitude: The altitude at which the local sensor zenith angle
400 ! is required
401 ! UNITS: metres
402 ! TYPE: REAL(fp)
403 ! DIMENSION: Scalar or any rank
404 ! ATTRIBUTES: INTENT(IN)
405 !
406 ! OUTPUTS:
407 ! Local_Zenith_Radian: The sensor zenith angle at the supplied altitude.
408 ! UNITS: radians
409 ! TYPE: REAL(fp)
410 ! DIMENSION: Same as input
411 ! ATTRIBUTES: INTENT(OUT)
412 !
413 ! CREATION HISTORY:
414 ! Written by: Yong Chen, CSU/CIRA 10-May-2006
415 ! Yong.Chen@noaa.gov
416 !
417 ! Paul van Delst, 23-Nov-2009
418 ! paul.vandelst@noaa.gov
419 !:sdoc-:
420 !--------------------------------------------------------------------------------
421 
422  ELEMENTAL SUBROUTINE vaconv( &
423  Sensor_Scan_Radian, & ! Input
424  Satellite_Altitude, & ! Input
425  Altitude, & ! Input
426  Local_Zenith_Radian ) ! Output
427  ! Arguments
428  REAL(fp), INTENT(IN) :: sensor_scan_radian
429  REAL(fp), INTENT(IN) :: satellite_altitude
430  REAL(fp), INTENT(IN) :: altitude
431  REAL(fp), INTENT(OUT) :: local_zenith_radian
432  ! Local variables
433  REAL(fp) :: ra
434  REAL(fp) :: rs
435 
436  ! Radius calculations
437  ! ...Compute the radius, in km, of the point at which to calc the angle
438  ra = earth_radius + (m_to_km * altitude)
439  ! ...The radius of the satellite orbit, in km.
440  rs = earth_radius + satellite_altitude
441 
442  ! Compute the angle
443  local_zenith_radian = asin((rs / ra) * sin(sensor_scan_radian))
444 
445  END SUBROUTINE vaconv
446 
447 
448 !----------------------------------------------------------------------------------
449 !:sdoc+:
450 ! NAME:
451 ! VACONV_TL
452 !
453 ! PURPOSE:
454 ! Tangent-linear form of elemental subroutine to compute the sensor zenith
455 ! angle at a given altitude for a given sensor scan angle.
456 !
457 ! CALLING SEQUENCE:
458 ! CALL VACONV_TL( Sensor_Scan_Radian, & ! FWD Input
459 ! Satellite_Altitude, & ! FWD Input
460 ! Altitude, & ! FWD Input
461 ! Altitude_TL, & ! TL Input
462 ! Local_Zenith_Radian_TL ) ! TL Output
463 !
464 ! INPUTS:
465 ! Sensor_Scan_Radian: Sensor scan angle.
466 ! UNITS: radians
467 ! TYPE: REAL(fp)
468 ! DIMENSION: Scalar or any rank
469 ! ATTRIBUTES: INTENT(IN)
470 !
471 ! Satellite_Altitude: The satellite altitude
472 ! UNITS: kilometres
473 ! TYPE: REAL(fp)
474 ! DIMENSION: Scalar or any rank
475 ! ATTRIBUTES: INTENT(IN)
476 !
477 ! Altitude: The altitude at which the local sensor zenith
478 ! angle is required
479 ! UNITS: metres
480 ! TYPE: REAL(fp)
481 ! DIMENSION: Scalar or any rank
482 ! ATTRIBUTES: INTENT(IN)
483 !
484 ! Altitude_TL: Tangent-linear altitude.
485 ! UNITS: metres
486 ! TYPE: REAL(fp)
487 ! DIMENSION: Scalar or any rank
488 ! ATTRIBUTES: INTENT(IN)
489 !
490 ! OUTPUTS:
491 ! Local_Zenith_Radian_TL: The tangent-linear sensor zenith angle at the
492 ! supplied altitude.
493 ! UNITS: radians
494 ! TYPE: REAL(fp)
495 ! DIMENSION: Same as input
496 ! ATTRIBUTES: INTENT(OUT)
497 !
498 ! CREATION HISTORY:
499 ! Written by: Yong Chen, CSU/CIRA 10-May-2006
500 ! Yong.Chen@noaa.gov
501 !
502 ! Paul van Delst, 23-Nov-2009
503 ! paul.vandelst@noaa.gov
504 !:sdoc-:
505 !--------------------------------------------------------------------------------
506 
507  ELEMENTAL SUBROUTINE vaconv_tl( &
508  Sensor_Scan_Radian, & ! FWD Input
509  Satellite_Altitude, & ! FWD Input
510  Altitude, & ! FWD Input
511  Altitude_TL, & ! TL Input
512  Local_Zenith_Radian_TL ) ! TL Output
513  ! Arguments
514  REAL(fp), INTENT(IN) :: sensor_scan_radian
515  REAL(fp), INTENT(IN) :: satellite_altitude
516  REAL(fp), INTENT(IN) :: altitude
517  REAL(fp), INTENT(IN) :: altitude_tl
518  REAL(fp), INTENT(OUT) :: local_zenith_radian_tl
519  ! Local variables
520  REAL(fp) :: ra, ra_tl
521  REAL(fp) :: rs
522  REAL(fp) :: local_zenith_radian
523 
524  ! Radius calculations
525  ! ...Compute the radius, in km, of the point at which to calc the angle
526  ra = earth_radius + (m_to_km * altitude)
527  ra_tl = m_to_km * altitude_tl
528  ! ...The radius of the satellite orbit, in km.
529  rs = earth_radius + satellite_altitude
530 
531  ! Compute the tangent-linear angle
532  CALL vaconv( sensor_scan_radian, satellite_altitude, altitude, local_zenith_radian )
533  local_zenith_radian_tl = -tan(local_zenith_radian) * ra_tl / ra
534 
535  END SUBROUTINE vaconv_tl
536 
537 
538 !----------------------------------------------------------------------------------
539 !:sdoc+:
540 ! NAME:
541 ! VACONV_AD
542 !
543 ! PURPOSE:
544 ! Adjoint form of elemental subroutine to compute the sensor zenith
545 ! angle at a given altitude for a given sensor scan angle.
546 !
547 ! CALLING SEQUENCE:
548 ! CALL VACONV_AD( Sensor_Scan_Radian, & ! FWD Input
549 ! Satellite_Altitude, & ! FWD Input
550 ! Altitude, & ! FWD Input
551 ! Local_Zenith_Radian_AD ) ! TL Output
552 ! Altitude_AD, & ! TL Input
553 !
554 ! INPUTS:
555 ! Sensor_Scan_Radian: Sensor scan angle.
556 ! UNITS: radians
557 ! TYPE: REAL(fp)
558 ! DIMENSION: Scalar or any rank
559 ! ATTRIBUTES: INTENT(IN)
560 !
561 ! Satellite_Altitude: The satellite altitude
562 ! UNITS: kilometres
563 ! TYPE: REAL(fp)
564 ! DIMENSION: Scalar or any rank
565 ! ATTRIBUTES: INTENT(IN)
566 !
567 ! Altitude: The altitude at which the local sensor zenith
568 ! angle is required
569 ! UNITS: metres
570 ! TYPE: REAL(fp)
571 ! DIMENSION: Scalar or any rank
572 ! ATTRIBUTES: INTENT(IN)
573 !
574 ! Local_Zenith_Radian_AD: The adjoint sensor zenith angle at the
575 ! supplied altitude.
576 ! *** SET TO ZERO ON EXIT ***
577 ! UNITS: radians
578 ! TYPE: REAL(fp)
579 ! DIMENSION: Scalar or any rank
580 ! ATTRIBUTES: INTENT(IN OUT)
581 !
582 ! OUTPUTS:
583 ! Altitude_AD: Adjoint altitude.
584 ! *** MUST HAVE VALUE ON ENTRY ***
585 ! UNITS: metres
586 ! TYPE: REAL(fp)
587 ! DIMENSION: Same as input
588 ! ATTRIBUTES: INTENT(IN OUT)
589 !
590 ! CREATION HISTORY:
591 ! Written by: Yong Chen, CSU/CIRA 10-May-2006
592 ! Yong.Chen@noaa.gov
593 !
594 ! Paul van Delst, 23-Nov-2009
595 ! paul.vandelst@noaa.gov
596 !:sdoc-:
597 !--------------------------------------------------------------------------------
598 
599  ELEMENTAL SUBROUTINE vaconv_ad( &
600  Sensor_Scan_Radian, & ! FWD Input
601  Satellite_Altitude, & ! FWD Input
602  Altitude, & ! FWD Input
603  Local_Zenith_Radian_AD, & ! AD Input
604  Altitude_AD ) ! AD Output
605  ! Arguments
606  REAL(fp), INTENT(IN) :: sensor_scan_radian
607  REAL(fp), INTENT(IN) :: satellite_altitude
608  REAL(fp), INTENT(IN) :: altitude
609  REAL(fp), INTENT(IN OUT) :: local_zenith_radian_ad
610  REAL(fp), INTENT(IN OUT) :: altitude_ad
611  ! Local variables
612  REAL(fp) :: ra, ra_ad
613  REAL(fp) :: rs
614  REAL(fp) :: local_zenith_radian
615 
616  ! Forward model calcuations
617  ra = earth_radius + (m_to_km * altitude)
618  rs = earth_radius + satellite_altitude
619  CALL vaconv( sensor_scan_radian, satellite_altitude, altitude, local_zenith_radian )
620 
621  ! Compute the angle adjoint
622  ra_ad = -tan(local_zenith_radian) * local_zenith_radian_ad / ra
623  local_zenith_radian_ad = zero
624  altitude_ad = altitude_ad + (m_to_km * ra_ad)
625 
626  END SUBROUTINE vaconv_ad
627 
628 
629 !--------------------------------------------------------------------------------
630 !:sdoc+:
631 !
632 ! NAME:
633 ! CRTM_GeometryInfo_Version
634 !
635 ! PURPOSE:
636 ! Subroutine to return the module version information.
637 !
638 ! CALLING SEQUENCE:
639 ! CALL CRTM_GeometryInfo_Version( Id )
640 !
641 ! OUTPUT ARGUMENTS:
642 ! Id: Character string containing the version Id information
643 ! for the module.
644 ! UNITS: N/A
645 ! TYPE: CHARACTER(*)
646 ! DIMENSION: Scalar
647 ! ATTRIBUTES: INTENT(OUT)
648 !
649 !:sdoc-:
650 !--------------------------------------------------------------------------------
651 
652  SUBROUTINE crtm_geometryinfo_version( Id )
653  CHARACTER(*), INTENT(OUT) :: id
654  id = module_version_id
655  END SUBROUTINE crtm_geometryinfo_version
656 
657 
658 !##################################################################################
659 !##################################################################################
660 !## ##
661 !## ## PRIVATE MODULE ROUTINES ## ##
662 !## ##
663 !##################################################################################
664 !##################################################################################
665 
666 !--------------------------------------------------------------------------------
667 !
668 ! NAME:
669 ! Compute_AU_ratio2
670 !
671 ! PURPOSE:
672 ! Elemental function to compute the square of the ratio between the
673 ! semi-major axis of the Earth's elliptical orbit about the Sun, and
674 ! the actual Earth-Sun distance.
675 !
676 ! CALLING SEQUENCE:
677 ! AU_ratio2 = Compute_AU_ratio2( Year, Month, Day )
678 !
679 ! INPUTS:
680 ! Year: The year in 4-digit format, e.g. 1997.
681 ! UNITS: N/A
682 ! TYPE: INTEGER
683 ! DIMENSION: Scalar or same as geo input
684 ! ATTRIBUTES: INTENT(IN), OPTIONAL
685 !
686 ! Month: The month of the year (1-12).
687 ! UNITS: N/A
688 ! TYPE: INTEGER
689 ! DIMENSION: Scalar or same as geo input
690 ! ATTRIBUTES: INTENT(IN), OPTIONAL
691 !
692 ! Day: The day of the month (1-28/29/30/31).
693 ! UNITS: N/A
694 ! TYPE: INTEGER
695 ! DIMENSION: Scalar or same as geo input
696 ! ATTRIBUTES: INTENT(IN), OPTIONAL
697 !
698 ! FUNCTION RESULT:
699 ! AU_Ratio2: The square of the ratio between the semi-major axis
700 ! of the Earth's elliptical orbit about the Sun, and
701 ! the actual Earth-Sun distance.
702 ! UNITS: N/A
703 ! TYPE: REAL(fp)
704 ! DIMENSION: Same as inputs.
705 !
706 ! PROCEDURE:
707 ! Adapted from eqn. 2.2.9 in
708 !
709 ! Liou, K.N., 2002, "An Introduction to Atmospheric Radiation",
710 ! 2nd Ed., Academic Press, San Diego, California
711 !
712 ! __ N
713 ! ( a )^2 \
714 ! (---) = > a(i).cos(i.t) + b(i).sin(i.t)
715 ! ( r ) /__
716 ! i=0
717 !
718 ! where
719 !
720 ! a = semi-major axis of Earth's orbit about the Sun
721 !
722 ! r = Earth-Sun distance at time t
723 !
724 ! 2.PI.(DoY-1)
725 ! t = ------------
726 ! Max_DoY
727 !
728 ! DoY = day of the year
729 !
730 ! Max_DoY = number of days in the year (365 or 366 for leap year)
731 !
732 ! and the coefficients are taken from table 2.2 in Liou(2002):
733 !
734 ! i a(i) b(i)
735 ! ---------------------------
736 ! 0 1.000110 0
737 ! 1 0.034221 0.001280
738 ! 2 0.000719 0.000077
739 !
740 !--------------------------------------------------------------------------------
741 
742  ELEMENTAL FUNCTION compute_au_ratio2( Year, Month, Day ) RESULT( AU_ratio2 )
743  ! Arguments
744  INTEGER, INTENT(IN) :: year
745  INTEGER, INTENT(IN) :: month
746  INTEGER, INTENT(IN) :: day
747  ! Function result
748  REAL(fp) :: au_ratio2
749  ! Local parameters
750  INTEGER , PARAMETER :: n = 2
751  REAL(fp), PARAMETER :: a(0:n) = (/ 1.000110_fp, 0.034221_fp, 0.000719_fp /)
752  REAL(fp), PARAMETER :: b(0:n) = (/ zero , 0.001280_fp, 0.000077_fp /)
753  ! Local variables
754  INTEGER :: i
755  REAL(fp) :: doy, max_doy, t, it
756 
757  ! Determine the days-of-year
758  doy = REAL(DayOfYear( Day, Month, Year ), fp)
759  max_doy = REAL(DayOfYear( 31, 12, Year ), fp)
760 
761  ! Location of Earth in orbit relative to perihelion
762  t = twopi * (doy-one)/max_doy
763 
764  ! Compute the ratio term
765  au_ratio2 = zero
766  DO i = 0, n
767  it = REAL(i,fp) * t
768  au_ratio2 = au_ratio2 + (a(i) * cos(it)) + (b(i) * sin(it))
769  END DO
770 
771  END FUNCTION compute_au_ratio2
772 
773 END MODULE crtm_geometryinfo
integer, parameter, public failure
real(fp), parameter, public zero
integer, parameter, public warning
real(fp), parameter, public max_trans_zenith_angle
logical function, public crtm_geometryinfo_isvalid(gInfo)
integer, parameter, public fp
Definition: Type_Kinds.f90:124
subroutine, public crtm_geometryinfo_version(Id)
elemental subroutine, public vaconv_tl(Sensor_Scan_Radian, Satellite_Altitude, Altitude, Altitude_TL, Local_Zenith_Radian_TL)
elemental subroutine, public crtm_geometryinfo_compute(gInfo)
elemental subroutine, public saconv_ad(Sensor_Zenith_Radian, Altitude, Local_Zenith_Radian_AD, Altitude_AD)
real(fp), parameter, public earth_radius
elemental subroutine, public saconv_tl(Sensor_Zenith_Radian, Altitude, Altitude_TL, Local_Zenith_Radian_TL)
elemental integer function, public dayofyear(Day, Month, Year)
elemental subroutine, public vaconv(Sensor_Scan_Radian, Satellite_Altitude, Altitude, Local_Zenith_Radian)
elemental subroutine, public saconv(Sensor_Zenith_Radian, Altitude, Local_Zenith_Radian)
real(fp), parameter, public one
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
real(fp), parameter, public twopi
real(fp), parameter, public two
real(fp), parameter, public degrees_to_radians
elemental subroutine, public vaconv_ad(Sensor_Scan_Radian, Satellite_Altitude, Altitude, Local_Zenith_Radian_AD, Altitude_AD)
real(fp), parameter, public satellite_height
character(*), parameter module_version_id
real(fp), parameter m_to_km
elemental real(fp) function compute_au_ratio2(Year, Month, Day)
integer, parameter, public success