58 '$Id: CRTM_AtmOptics.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 110 LOGICAL :: no_scattering
152 LOGICAL :: include_scattering
160 atmoptics%Include_Scattering
196 REAL(fp) ,
INTENT(OUT) :: transmittance
198 k = atmoptics%n_layers
199 transmittance = exp(-
one*sum(atmoptics%optical_depth(1:k)))
243 atmoptics , & ! Input
244 atmoptics_TL , & ! Input
249 REAL(fp) ,
INTENT(OUT) :: transmittance_tl
252 REAL(fp) :: transmittance
254 k = atmoptics%n_layers
255 transmittance = exp(-
one*sum(atmoptics%optical_depth(1:k)))
256 transmittance_tl = -transmittance * sum(atmoptics_tl%optical_depth(1:k))
300 atmoptics , & ! Input
301 transmittance_AD, & ! Input
305 REAL(fp) ,
INTENT(IN OUT) :: transmittance_ad
309 REAL(fp) :: transmittance, t_delstar_t
311 k = atmoptics%n_layers
312 transmittance = exp(-
one*sum(atmoptics%optical_depth(1:k)))
313 t_delstar_t = transmittance*transmittance_ad
314 DO k = 1, atmoptics%n_layers
315 atmoptics_ad%optical_depth(k) = atmoptics_ad%optical_depth(k) - t_delstar_t
317 transmittance_ad =
zero 355 AtmOptics, & ! Output
361 CHARACTER(*),
PARAMETER :: routine_name =
'CRTM_Combine_AtmOptics' 366 atmoptics%Scattering_Optical_Depth =
zero 370 IF( (.NOT. atmoptics%Include_Scattering) .OR. &
371 atmoptics%n_Legendre_Terms == 0 )
RETURN 375 layer_loop:
DO k = 1, atmoptics%n_Layers
379 aovar%Optical_Depth(k) = atmoptics%Optical_Depth(k)
380 aovar%bs(k) = atmoptics%Single_Scatter_Albedo(k)
386 significant_scattering:
IF( aovar%bs(k) >
bs_threshold )
THEN 388 aovar%w(k) = atmoptics%Single_Scatter_Albedo(k) / atmoptics%Optical_Depth(k)
389 DO i = 1, atmoptics%n_Phase_Elements
390 DO l = 1, atmoptics%n_Legendre_Terms
391 atmoptics%Phase_Coefficient(l,i,k) = atmoptics%Phase_Coefficient(l,i,k) / &
392 atmoptics%Single_Scatter_Albedo(k)
395 atmoptics%Phase_Coefficient(0,i,k) =
point_5 397 atmoptics%Delta_Truncation(k) = atmoptics%Phase_Coefficient(atmoptics%n_Legendre_Terms,1,k)
402 atmoptics%Optical_Depth(k) = (
one - ( atmoptics%Delta_Truncation(k) * aovar%w(k) )) * &
403 atmoptics%Optical_Depth(k)
404 atmoptics%Single_Scatter_Albedo(k) = (
one - atmoptics%Delta_Truncation(k) ) * aovar%w(k) / &
405 (
one - ( atmoptics%Delta_Truncation(k) * aovar%w(k) ) )
407 END IF significant_scattering
411 atmoptics%Scattering_Optical_Depth = atmoptics%Scattering_Optical_Depth + &
412 (aovar%w(k) * aovar%Optical_Depth(k))
462 AtmOptics , & ! FWD Input
463 AtmOptics_TL, & ! TL Output
470 CHARACTER(*),
PARAMETER :: routine_name =
'CRTM_Combine_AtmOptics_TL' 473 REAL(fp) :: optical_depth_tl
478 atmoptics_tl%Scattering_Optical_Depth =
zero 482 IF( (.NOT. atmoptics%Include_Scattering) .OR. &
483 atmoptics%n_Legendre_Terms == 0 )
RETURN 487 layer_loop:
DO k = 1, atmoptics%n_Layers
491 optical_depth_tl = atmoptics_tl%Optical_Depth(k)
497 significant_scattering:
IF( aovar%bs(k) >
bs_threshold )
THEN 500 w_tl = ( atmoptics_tl%Single_Scatter_Albedo(k) / aovar%Optical_Depth(k) ) - &
501 ( atmoptics_tl%Optical_Depth(k) * aovar%w(k) / aovar%Optical_Depth(k) )
502 DO i = 1, atmoptics%n_Phase_Elements
503 DO l = 1, atmoptics%n_Legendre_Terms
504 atmoptics_tl%Phase_Coefficient(l,i,k) = &
505 ( atmoptics_tl%Phase_Coefficient(l,i,k) - &
506 (atmoptics%Phase_Coefficient(l,i,k) * atmoptics_tl%Single_Scatter_Albedo(k)) ) / aovar%bs(k)
509 atmoptics_tl%Phase_Coefficient(0,i,k) =
zero 511 atmoptics_tl%Delta_Truncation(k) = atmoptics_tl%Phase_Coefficient(atmoptics%n_Legendre_Terms,1,k)
531 atmoptics_tl%Optical_Depth(k) = &
532 ( (
one - ( atmoptics%Delta_Truncation(k) * aovar%w(k) ) ) * atmoptics_tl%Optical_Depth(k) ) - &
533 ( atmoptics%Delta_Truncation(k) * aovar%Optical_Depth(k) * w_tl ) - &
534 ( aovar%w(k) * aovar%Optical_Depth(k) * atmoptics_tl%Delta_Truncation(k) )
549 atmoptics_tl%Single_Scatter_Albedo(k) = &
550 ( ( (
one - atmoptics%Delta_Truncation(k) + &
551 ( atmoptics%Single_Scatter_Albedo(k)*atmoptics%Delta_Truncation(k) ) ) * w_tl ) + &
552 ( ( atmoptics%Single_Scatter_Albedo(k) -
one ) * aovar%w(k) * atmoptics_tl%Delta_Truncation(k) ) ) / &
553 (
one - ( atmoptics%Delta_Truncation(k) * aovar%w(k) ) )
555 END IF significant_scattering
559 atmoptics_tl%Scattering_Optical_Depth = atmoptics_tl%Scattering_Optical_Depth + &
560 (aovar%w(k) * optical_depth_tl) + &
561 (aovar%Optical_Depth(k) * w_tl)
614 AtmOptics , & ! FWD Input
615 AtmOptics_AD, & ! AD Input
622 CHARACTER(*),
PARAMETER :: routine_name =
'CRTM_Combine_AtmOptics_AD' 629 IF( (.NOT. atmoptics%Include_Scattering) .OR. &
630 atmoptics%n_Legendre_Terms == 0 )
RETURN 633 layer_loop:
DO k = atmoptics%n_Layers, 1, -1
639 significant_scattering:
IF( aovar%bs(k) >
bs_threshold)
THEN 662 atmoptics_ad%Delta_Truncation(k) = atmoptics_ad%Delta_Truncation(k) + &
663 ( ( atmoptics%Single_Scatter_Albedo(k) -
one ) * aovar%w(k) * atmoptics_ad%Single_Scatter_Albedo(k) / &
664 (
one - ( atmoptics%Delta_Truncation(k) * aovar%w(k) ) ) )
666 w_ad = w_ad + ( (
one - atmoptics%Delta_Truncation(k) + &
667 ( atmoptics%Single_Scatter_Albedo(k)*atmoptics%Delta_Truncation(k) ) ) * &
668 atmoptics_ad%Single_Scatter_Albedo(k) / &
669 (
one - ( atmoptics%Delta_Truncation(k) * aovar%w(k) ) ) )
671 atmoptics_ad%Single_Scatter_Albedo(k) =
zero 689 atmoptics_ad%Delta_Truncation(k) = atmoptics_ad%Delta_Truncation(k) - &
691 aovar%Optical_Depth(k) * &
692 atmoptics_ad%Optical_Depth(k) )
694 w_ad = w_ad - ( atmoptics%Delta_Truncation(k) * &
695 aovar%Optical_Depth(k) * &
696 atmoptics_ad%Optical_Depth(k) )
698 atmoptics_ad%Optical_Depth(k) = (
one - ( atmoptics%Delta_Truncation(k) * aovar%w(k) ) ) * &
699 atmoptics_ad%Optical_Depth(k)
703 l = atmoptics%n_Legendre_Terms
704 atmoptics_ad%Phase_Coefficient(l,1,k) = atmoptics_ad%Phase_Coefficient(l,1,k) + &
705 atmoptics_ad%Delta_Truncation(k)
706 atmoptics_ad%Delta_Truncation(k) =
zero 708 DO i = 1, atmoptics%n_Phase_Elements
710 atmoptics_ad%Phase_Coefficient(0,i,k) =
zero 711 DO l = 1, atmoptics%n_Legendre_Terms
712 atmoptics_ad%Single_Scatter_Albedo(k) = atmoptics_ad%Single_Scatter_Albedo(k) - &
713 atmoptics%Phase_Coefficient(l,i,k)*atmoptics_ad%Phase_Coefficient(l,i,k)/aovar%bs(k)
714 atmoptics_ad%Phase_Coefficient(l,i,k) = ( atmoptics_ad%Phase_Coefficient(l,i,k)/aovar%bs(k) )
718 atmoptics_ad%Single_Scatter_Albedo(k) = atmoptics_ad%Single_Scatter_Albedo(k) + &
719 w_ad / aovar%Optical_Depth(k)
720 atmoptics_ad%Optical_Depth(k) = atmoptics_ad%Optical_Depth(k) - &
721 w_ad*aovar%w(k) / aovar%Optical_Depth(k)
723 END IF significant_scattering
subroutine, public crtm_compute_transmittance(atmoptics, transmittance)
integer, parameter, public failure
subroutine, public crtm_compute_transmittance_tl(atmoptics, atmoptics_TL, transmittance_TL)
real(fp), parameter, public zero
subroutine, public crtm_combine_atmoptics(AtmOptics, AOvar)
elemental subroutine, public aovar_destroy(self)
integer, parameter, public fp
real(fp), parameter, public scattering_albedo_threshold
subroutine, public crtm_combine_atmoptics_ad(AtmOptics, AtmOptics_AD, AOvar)
pure logical function, public crtm_include_scattering(atmoptics)
elemental logical function, public aovar_associated(self)
pure logical function, public crtm_no_scattering(atmoptics)
real(fp), parameter, public bs_threshold
real(fp), parameter, public one
character(*), parameter module_version_id
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
subroutine, public crtm_compute_transmittance_ad(atmoptics, transmittance_AD, atmoptics_AD)
integer, parameter, public max_n_layers
real(fp), parameter, public point_5
elemental subroutine, public aovar_create(self, n_Layers)
integer, parameter, public success
integer, parameter, public information
subroutine, public crtm_combine_atmoptics_tl(AtmOptics, AtmOptics_TL, AOvar)