FV3 Bundle
CRTM_AtmAbsorption.f90
Go to the documentation of this file.
1 !
2 ! CRTM_AtmAbsorption
3 !
4 ! Module containing routines to compute the optical depth profile
5 ! due to gaseous absorption.
6 !
7 !
8 ! CREATION HISTORY:
9 ! Modifed by: Yong Han, NESDIS/STAR 25-June-2008
10 ! yong.han@noaa.gov
11 
12 
14 
15  ! -----------------
16  ! Environment setup
17  ! -----------------
18  ! Module use
19  USE type_kinds, ONLY: fp
21  USE crtm_parameters, ONLY: zero, &
24  USE crtm_taucoeff, ONLY: tc
30  ! ODAS modules
31  USE odas_atmabsorption, ONLY: odas_aavar_type => ivar_type , &
35  ! ODPS modules
36  USE odps_atmabsorption, ONLY: odps_aavar_type => ivar_type , &
40  ! ODSSU modules
41  USE odssu_atmabsorption, ONLY: odssu_aavar_type => ivar_type , &
46  ! ODZeeman modules
51 
52  ! Disable implicit typing
53  IMPLICIT NONE
54 
55 
56  ! ------------
57  ! Visibilities
58  ! ------------
59  ! Everything private by default
60  PRIVATE
61  ! Datatypes
62  PUBLIC :: ivar_type
63  ! Procedures
67 
68 
69  ! -----------------
70  ! Module parameters
71  ! -----------------
72  CHARACTER(*), PARAMETER :: module_version_id = &
73  '$Id: CRTM_AtmAbsorption.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $'
74  ! Message string length
75  INTEGER, PARAMETER :: ml = 256
76 
77 
78  ! ---------------------------------------------
79  ! Structure to hold AtmAbsorption forward model
80  ! variables across FWD, TL, and AD calls
81  ! ---------------------------------------------
82  !:tdoc+:
83  TYPE :: ivar_type
84  PRIVATE
85  TYPE(odas_aavar_type) :: odas
86  TYPE(odps_aavar_type) :: odps
87  TYPE(odssu_aavar_type) :: odssu
88  END TYPE ivar_type
89  !:tdoc-:
90 
91 
92 CONTAINS
93 
94 
95 !################################################################################
96 !################################################################################
97 !## ##
98 !## ## PUBLIC MODULE ROUTINES ## ##
99 !## ##
100 !################################################################################
101 !################################################################################
102 
103 !------------------------------------------------------------------------------
104 !:sdoc+:
105 !
106 ! NAME:
107 ! CRTM_Compute_AtmAbsorption
108 !
109 ! PURPOSE:
110 ! Subroutine to calculate the layer optical depths due to gaseous
111 ! absorption for a given sensor and channel and atmospheric profile.
112 ! It is a wrapper which calls the algorithm-specific routine.
113 !
114 ! CALLING SEQUENCE:
115 ! CALL CRTM_Compute_AtmAbsorption( &
116 ! SensorIndex , & ! Input
117 ! ChannelIndex , & ! Input
118 ! AncillaryInput, & ! Input
119 ! Predictor , & ! Input
120 ! AtmOptics , & ! Output
121 ! iVar ) ! Internal variable output
122 !
123 ! INPUTS:
124 ! SensorIndex:
125 ! Sensor index id. This is a unique index associated
126 ! with a (supported) sensor used to access the
127 ! shared coefficient data for a particular sensor.
128 ! See the ChannelIndex argument.
129 ! UNITS: N/A
130 ! TYPE: INTEGER
131 ! DIMENSION: Scalar
132 ! ATTRIBUTES: INTENT(IN)
133 !
134 ! ChannelIndex:
135 ! Channel index id. This is a unique index associated
136 ! with a (supported) sensor channel used to access the
137 ! shared coefficient data for a particular sensor's
138 ! channel.
139 ! See the SensorIndex argument.
140 ! UNITS: N/A
141 ! TYPE: INTEGER
142 ! DIMENSION: Scalar
143 ! ATTRIBUTES: INTENT(IN)
144 !
145 ! AncillaryInput:
146 ! Structure holding ancillary inputs
147 ! UNITS: N/A
148 ! TYPE: AncillaryInput_type
149 ! DIMENSION: Scalar
150 ! ATTRIBUTES: INTENT(IN)
151 !
152 ! Predictor:
153 ! Structure containing the integrated absorber and
154 ! predictor profile data.
155 ! UNITS: N/A
156 ! TYPE: CRTM_Predictor_type
157 ! DIMENSION: Scalar
158 ! ATTRIBUTES: INTENT(IN)
159 !
160 ! OUTPUTS:
161 ! AtmOptics:
162 ! Structure containing computed optical depth profile data.
163 ! UNITS: N/A
164 ! TYPE: CRTM_AtmOptics_type
165 ! DIMENSION: Scalar
166 ! ATTRIBUTES: INTENT(IN OUT)
167 !
168 ! iVar:
169 ! Structure containing internal variables required for
170 ! subsequent tangent-linear or adjoint model calls.
171 ! The contents of this structure are NOT accessible
172 ! outside of this module.
173 ! UNITS: N/A
174 ! TYPE: iVar_type
175 ! DIMENSION: Scalar
176 ! ATTRIBUTES: INTENT(OUT)
177 !
178 !:sdoc-:
179 !------------------------------------------------------------------------------
180 
181  SUBROUTINE crtm_compute_atmabsorption( &
182  SensorIndex , & ! Input
183  ChannelIndex , & ! Input
184  AncillaryInput, & ! Input
185  Predictor , & ! Input
186  AtmOptics , & ! Output
187  iVar ) ! Internal variable output
188  ! Arguments
189  INTEGER , INTENT(IN) :: sensorindex
190  INTEGER , INTENT(IN) :: channelindex
191  TYPE(crtm_ancillaryinput_type), INTENT(IN) :: ancillaryinput
192  TYPE(crtm_predictor_type) , INTENT(IN OUT) :: predictor
193  TYPE(crtm_atmoptics_type) , INTENT(IN OUT) :: atmoptics
194  TYPE(ivar_type) , INTENT(IN OUT) :: ivar
195  ! Local variables
196  INTEGER :: idx
197 
198  ! Is this a Zeeman channel?
199  idx = tc%ZSensor_LoIndex(sensorindex)
200  IF( idx > 0 )THEN
201  IF( is_zeeman_channel(tc%ODZeeman(idx), channelindex) )THEN
203  tc%ODZeeman(idx) , & ! Input
204  channelindex , & ! Input
205  predictor%ODZeeman, & ! Input
206  atmoptics ) ! Output
207  RETURN
208  END IF
209  END IF
210 
211 
212  ! Call required model
213  idx = tc%Sensor_LoIndex(sensorindex)
214  SELECT CASE( tc%Algorithm_ID(sensorindex) )
215 
216  ! ODAS transmittance model
217  CASE( odas_algorithm )
219  tc%ODAS(idx) , & ! Input
220  channelindex , & ! Input
221  predictor%ODAS, & ! Input
222  atmoptics , & ! Output
223  ivar%ODAS ) ! Internal variable output
224 
225  ! ODPS transmittance model
226  CASE( odps_algorithm )
228  tc%ODPS(idx) , & ! Input
229  channelindex , & ! Input
230  predictor%ODPS, & ! Input
231  atmoptics ) ! Output
232 
233  ! SSU instrument specific
234  CASE( odssu_algorithm )
235  CALL odssu_compute_weights( &
236  ancillaryinput%SSU, & ! Input
237  sensorindex , & ! Input
238  channelindex , & ! Input
239  ivar%ODSSU ) ! Internal variable output
240 
241  ! ...Select particular transmittance algorithm for this instrument
242  SELECT CASE( tc%ODSSU(idx)%subAlgorithm )
243  CASE( odas_algorithm )
245  tc%Sensor_LoIndex(sensorindex), & ! Input
246  channelindex , & ! Input
247  predictor%ODAS , & ! Input
248  atmoptics , & ! Output
249  ivar%ODSSU ) ! Internal variable output
250  CASE( odps_algorithm )
252  tc%Sensor_LoIndex(sensorindex), & ! Input
253  channelindex , & ! Input
254  predictor%ODPS , & ! Input
255  atmoptics , & ! Output
256  ivar%ODSSU ) ! Internal variable output
257  END SELECT
258  END SELECT
259 
260  END SUBROUTINE crtm_compute_atmabsorption
261 
262 
263 !------------------------------------------------------------------------------
264 !:sdoc+:
265 !
266 ! NAME:
267 ! CRTM_Compute_AtmAbsorption_TL
268 !
269 ! PURPOSE:
270 ! Subroutine to calculate the tangent-linear layer optical depths due
271 ! to gaseous absorption for a given sensor and channel and atmospheric
272 ! profile. It is a wrapper which calls the algorithm specific routine.
273 !
274 ! CALLING SEQUENCE:
275 ! CALL CRTM_Compute_AtmAbsorption_TL( &
276 ! SensorIndex , & ! Input
277 ! ChannelIndex , & ! Input
278 ! Predictor , & ! FWD Input
279 ! Predictor_TL , & ! TL Input
280 ! AtmOptics_TL , & ! TL Output
281 ! iVar ) ! Internal variable input
282 !
283 ! INPUTS:
284 ! SensorIndex:
285 ! Sensor index id. This is a unique index associated
286 ! with a (supported) sensor used to access the
287 ! shared coefficient data for a particular sensor.
288 ! See the ChannelIndex argument.
289 ! UNITS: N/A
290 ! TYPE: INTEGER
291 ! DIMENSION: Scalar
292 ! ATTRIBUTES: INTENT(IN)
293 !
294 ! ChannelIndex:
295 ! Channel index id. This is a unique index associated
296 ! with a (supported) sensor channel used to access the
297 ! shared coefficient data for a particular sensor's
298 ! channel.
299 ! See the SensorIndex argument.
300 ! UNITS: N/A
301 ! TYPE: INTEGER
302 ! DIMENSION: Scalar
303 ! ATTRIBUTES: INTENT(IN)
304 !
305 ! Predictor:
306 ! Structure containing the integrated absorber and
307 ! predictor profile data.
308 ! UNITS: N/A
309 ! TYPE: CRTM_Predictor_type
310 ! DIMENSION: Scalar
311 ! ATTRIBUTES: INTENT(IN)
312 !
313 ! Predictor_TL:
314 ! Structure containing the tangent-linearintegrated absorber and
315 ! predictor profile data.
316 ! UNITS: N/A
317 ! TYPE: CRTM_Predictor_type
318 ! DIMENSION: Scalar
319 ! ATTRIBUTES: INTENT(IN)
320 !
321 ! iVar:
322 ! Structure containing internal variables required for
323 ! subsequent tangent-linear or adjoint model calls.
324 ! The contents of this structure are NOT accessible
325 ! outside of this module.
326 ! UNITS: N/A
327 ! TYPE: iVar_type
328 ! DIMENSION: Scalar
329 ! ATTRIBUTES: INTENT(IN)
330 !
331 ! OUTPUTS:
332 ! AtmOptics_TL:
333 ! Structure containing the computed tangent-linear
334 ! optical depth profile data.
335 ! UNITS: N/A
336 ! TYPE: CRTM_AtmOptics_type
337 ! DIMENSION: Scalar
338 ! ATTRIBUTES: INTENT(IN OUT)
339 !
340 ! :sdoc-:
341 !------------------------------------------------------------------------------
342 
343  SUBROUTINE crtm_compute_atmabsorption_tl( &
344  SensorIndex , & ! Input
345  ChannelIndex , & ! Input
346  Predictor , & ! Input
347  Predictor_TL , & ! Input
348  AtmOptics_TL , & ! Output
349  iVar ) ! Internal variable input
350  ! Arguments
351  INTEGER , INTENT(IN) :: sensorindex
352  INTEGER , INTENT(IN) :: channelindex
353  TYPE(crtm_predictor_type), INTENT(IN) :: predictor
354  TYPE(crtm_predictor_type), INTENT(IN OUT) :: predictor_tl
355  TYPE(crtm_atmoptics_type), INTENT(IN OUT) :: atmoptics_tl
356  TYPE(ivar_type) , INTENT(IN) :: ivar
357  ! Local variables
358  INTEGER :: idx
359 
360  ! Is this a Zeeman channel?
361  idx = tc%ZSensor_LoIndex(sensorindex)
362  IF( idx > 0 )THEN
363  IF( is_zeeman_channel(tc%ODZeeman(idx), channelindex) )THEN
365  tc%ODZeeman(idx) , & ! Input
366  channelindex , & ! Input
367  predictor%ODZeeman , & ! Input
368  predictor_tl%ODZeeman, & ! Input
369  atmoptics_tl ) ! Output
370  RETURN
371  END IF
372  END IF
373 
374 
375  ! Call required model
376  idx = tc%Sensor_LoIndex(sensorindex)
377  SELECT CASE( tc%Algorithm_ID(sensorindex) )
378 
379  ! ODAS transmittance model
380  CASE( odas_algorithm )
382  tc%ODAS(idx) , & ! Input
383  channelindex , & ! Input
384  predictor%ODAS , & ! Input
385  predictor_tl%ODAS, & ! Input
386  atmoptics_tl , & ! Output
387  ivar%ODAS ) ! Internal variable input
388 
389  ! ODPS transmittance model
390  CASE( odps_algorithm )
392  tc%ODPS(idx) , & ! Input
393  channelindex , & ! Input
394  predictor%ODPS , & ! Input
395  predictor_tl%ODPS, & ! Input
396  atmoptics_tl ) ! Output
397 
398  ! SSU instrument specific
399  CASE( odssu_algorithm )
400 
401  ! ...Select particular transmittance algorithm for this instrument
402  SELECT CASE( tc%ODSSU(idx)%subAlgorithm )
403  CASE( odas_algorithm )
405  tc%Sensor_LoIndex(sensorindex), & ! Input
406  channelindex , & ! Input
407  predictor%ODAS , & ! Input
408  predictor_tl%ODAS , & ! Input
409  atmoptics_tl , & ! Output
410  ivar%ODSSU ) ! Internal variable input
411  CASE( odps_algorithm )
413  tc%Sensor_LoIndex(sensorindex), & ! Input
414  channelindex , & ! Input
415  predictor%ODPS , & ! Input
416  predictor_tl%ODPS , & ! Input
417  atmoptics_tl , & ! Output
418  ivar%ODSSU ) ! Internal variable input
419  END SELECT
420  END SELECT
421 
422  END SUBROUTINE crtm_compute_atmabsorption_tl
423 
424 
425 !--------------------------------------------------------------------------------
426 !
427 ! NAME:
428 ! CRTM_Compute_AtmAbsorption_AD
429 !
430 ! PURPOSE:
431 ! Subroutine to calculate the layer optical depth adjoints due to
432 ! gaseous absorption for a given sensor and channel and atmospheric
433 ! profile. It is a wrapper which calls the algorithm specific routine.
434 !
435 ! CALLING SEQUENCE:
436 ! CALL CRTM_Compute_AtmAbsorption_AD( &
437 ! SensorIndex , & ! Input
438 ! ChannelIndex, & ! Input
439 ! Predictor , & ! FWD Input
440 ! AtmOptics_AD, & ! AD Input
441 ! Predictor_AD, & ! AD Output
442 ! iVar ) ! Internal variable input
443 !
444 ! INPUT ARGUMENTS:
445 ! SensorIndex:
446 ! Sensor index id. This is a unique index associated
447 ! with a (supported) sensor used to access the
448 ! shared coefficient data for a particular sensor.
449 ! See the ChannelIndex argument.
450 ! UNITS: N/A
451 ! TYPE: INTEGER
452 ! DIMENSION: Scalar
453 ! ATTRIBUTES: INTENT(IN)
454 !
455 ! ChannelIndex:
456 ! Channel index id. This is a unique index associated
457 ! with a (supported) sensor channel used to access the
458 ! shared coefficient data for a particular sensor's
459 ! channel.
460 ! See the SensorIndex argument.
461 ! UNITS: N/A
462 ! TYPE: INTEGER
463 ! DIMENSION: Scalar
464 ! ATTRIBUTES: INTENT(IN)
465 !
466 ! Predictor:
467 ! Structure containing the integrated absorber and
468 ! predictor profile data.
469 ! UNITS: N/A
470 ! TYPE: CRTM_Predictor_type
471 ! DIMENSION: Scalar
472 ! ATTRIBUTES: INTENT(IN)
473 !
474 ! AtmOptics_AD:
475 ! Structure containing the computed adjoint optical depth profile data.
476 ! UNITS: N/A
477 ! TYPE: CRTM_AtmOptics_type
478 ! DIMENSION: Scalar
479 ! ATTRIBUTES: INTENT(IN OUT)
480 !
481 ! iVar:
482 ! Structure containing internal variables required for
483 ! subsequent tangent-linear or adjoint model calls.
484 ! The contents of this structure are NOT accessible
485 ! outside of this module.
486 ! UNITS: N/A
487 ! TYPE: iVar_type
488 ! DIMENSION: Scalar
489 ! ATTRIBUTES: INTENT(IN)
490 !
491 ! OUTPUT ARGUMENTS:
492 ! Predictor_AD:
493 ! Structure containing the adjoint integrated absorber and
494 ! predictor profile data.
495 ! UNITS: N/A
496 ! TYPE: CRTM_Predictor_type
497 ! DIMENSION: Scalar
498 ! ATTRIBUTES: INTENT(IN OUT)
499 !
500 ! SIDE EFFECTS:
501 ! Components of the AtmOptics_AD structure argument are modified
502 ! in this function.
503 !
504 !:sdoc-:
505 !------------------------------------------------------------------------------
506 
507  SUBROUTINE crtm_compute_atmabsorption_ad( &
508  SensorIndex , & ! Input
509  ChannelIndex, & ! Input
510  Predictor , & ! FWD Input
511  AtmOptics_AD, & ! AD Input
512  Predictor_AD, & ! AD Output
513  iVar ) ! Internal variable input
514  ! Arguments
515  INTEGER , INTENT(IN) :: sensorindex
516  INTEGER , INTENT(IN) :: channelindex
517  TYPE(crtm_predictor_type), INTENT(IN) :: predictor
518  TYPE(crtm_atmoptics_type), INTENT(IN OUT) :: atmoptics_ad
519  TYPE(crtm_predictor_type), INTENT(IN OUT) :: predictor_ad
520  TYPE(ivar_type) , INTENT(IN) :: ivar
521  ! Local variables
522  INTEGER :: idx
523 
524  ! Is this a Zeeman channel?
525  idx = tc%ZSensor_LoIndex(sensorindex)
526  IF( idx > 0 )THEN
527  IF( is_zeeman_channel(tc%ODZeeman(idx), channelindex) )THEN
529  tc%ODZeeman(idx) , & ! Input
530  channelindex , & ! Input
531  predictor%ODZeeman , & ! Input
532  atmoptics_ad , & ! AD Input
533  predictor_ad%ODZeeman ) ! AD Output
534  RETURN
535  END IF
536  END IF
537 
538  ! Call required model
539  idx = tc%Sensor_LoIndex(sensorindex)
540  SELECT CASE( tc%Algorithm_ID(sensorindex) )
541 
542  ! ODAS transmittance model
543  CASE( odas_algorithm )
545  tc%ODAS(idx) , & ! Input
546  channelindex , & ! Input
547  predictor%ODAS , & ! FWD Input
548  atmoptics_ad , & ! AD Input
549  predictor_ad%ODAS, & ! AD Output
550  ivar%ODAS ) ! Internal variable input
551 
552  ! ODPS transmittance model
553  CASE( odps_algorithm )
555  tc%ODPS(idx) , & ! Input
556  channelindex , & ! Input
557  predictor%ODPS , & ! FWD Input
558  atmoptics_ad , & ! AD Input
559  predictor_ad%ODPS ) ! AD Output
560 
561  ! SSU instrument specific
562  CASE( odssu_algorithm )
563 
564  ! Select particular transmittance algorithm for this instrument
565  SELECT CASE( tc%ODSSU(idx)%subAlgorithm )
566  CASE( odas_algorithm )
568  tc%Sensor_LoIndex(sensorindex), & ! Input
569  channelindex , & ! Input
570  predictor%ODAS , & ! FWD Input
571  atmoptics_ad , & ! AD Input
572  predictor_ad%ODAS , & ! AD Output
573  ivar%ODSSU ) ! Internal variable input
574  CASE( odps_algorithm )
576  tc%Sensor_LoIndex(sensorindex), & ! Input
577  channelindex , & ! Input
578  predictor%ODPS , & ! FWD Input
579  atmoptics_ad , & ! AD Input
580  predictor_ad%ODPS , & ! AD Output
581  ivar%ODSSU ) ! Internal variable input
582  END SELECT
583  END SELECT
584 
585  END SUBROUTINE crtm_compute_atmabsorption_ad
586 
587 END MODULE crtm_atmabsorption
integer, parameter, public failure
real(fp), parameter, public zero
subroutine, public odssu_compute_weights(SSU_Input, SensorIndex, ChannelIndex, iVar)
integer, parameter, public fp
Definition: Type_Kinds.f90:124
subroutine, public odas_compute_atmabsorption_ad(TC, ChannelIndex, Predictor, AtmOptics_AD, Predictor_AD, iVar)
subroutine, public odas_compute_atmabsorption_tl(TC, ChannelIndex, Predictor, Predictor_TL, AtmOptics_TL, iVar)
logical function, public is_zeeman_channel(TC, ChannelIndex)
subroutine, public odps_compute_atmabsorption(TC, ChannelIndex, Predictor, AtmAbsorption)
subroutine, public crtm_compute_atmabsorption_tl(SensorIndex, ChannelIndex, Predictor, Predictor_TL, AtmOptics_TL, iVar)
subroutine, public odps_compute_atmabsorption_ad(TC, ChannelIndex, Predictor, AtmAbsorption_AD, Predictor_AD)
subroutine, public zeeman_compute_atmabsorption_ad(TC, ChannelIndex, Predictor, AtmOptics_AD, Predictor_AD)
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
subroutine, public zeeman_compute_atmabsorption_tl(TC, ChannelIndex, Predictor, Predictor_TL, AtmOptics_TL)
integer, parameter, public odssu_algorithm
integer, parameter, public odps_algorithm
integer, parameter, public odas_algorithm
subroutine, public odas_compute_atmabsorption(TC, ChannelIndex, Predictor, AtmOptics, iVar)
subroutine, public crtm_compute_atmabsorption_ad(SensorIndex, ChannelIndex, Predictor, AtmOptics_AD, Predictor_AD, iVar)
subroutine, public crtm_compute_atmabsorption(SensorIndex, ChannelIndex, AncillaryInput, Predictor, AtmOptics, iVar)
integer, parameter ml
subroutine, public zeeman_compute_atmabsorption(TC, ChannelIndex, Predictor, AtmOptics)
type(taucoeff_type), save, public tc
integer, parameter, public success
character(*), parameter module_version_id
elemental subroutine, public crtm_geometryinfo_getvalue(gInfo, Geometry, iFOV, Longitude, Latitude, Surface_Altitude, Sensor_Scan_Angle, Sensor_Zenith_Angle, Sensor_Azimuth_Angle, Source_Zenith_Angle, Source_Azimuth_Angle, Flux_Zenith_Angle, Year, Month, Day, Distance_Ratio, Sensor_Scan_Radian, Sensor_Zenith_Radian, Sensor_Azimuth_Radian, Secant_Sensor_Zenith, Cosine_Sensor_Zenith, Source_Zenith_Radian, Source_Azimuth_Radian, Secant_Source_Zenith, Flux_Zenith_Radian, Secant_Flux_Zenith, Trans_Zenith_Radian, Secant_Trans_Zenith, AU_ratio2)
subroutine, public odps_compute_atmabsorption_tl(TC, ChannelIndex, Predictor, Predictor_TL, AtmAbsorption_TL)