60 '$Id: ODAS_AtmAbsorption.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 69 REAL(fp),
DIMENSION(MAX_N_LAYERS, &
0:MAX_N_PREDICTORS_USED, &
MAX_N_ABSORBERS) :: b
70 REAL(fp),
DIMENSION(MAX_N_LAYERS,MAX_N_ABSORBERS) :: ln_chi
71 REAL(fp),
DIMENSION(MAX_N_LAYERS,MAX_N_ABSORBERS) :: chi
154 ChannelIndex, & ! Input
155 Predictor , & ! Input
156 AtmOptics , & ! Output
159 TYPE(odas_taucoeff_type) ,
INTENT(IN) ::
tc 160 INTEGER ,
INTENT(IN) :: channelindex
181 n_layers = predictor%n_Layers
183 atmoptics%Optical_Depth =
zero 187 absorber_loop:
DO j = 1, predictor%n_Absorbers
192 np =
tc%Pre_Index(0,j,l)
193 IF ( np < 0 ) cycle absorber_loop
208 ps =
tc%Pos_Index(j,l)
209 n_orders =
tc%Order(j,l)
212 ivar%b(1:n_layers,0,j) =
tc%C(ic_0)
216 ivar%b(k,0,j) = ivar%b(k,0,j) + (c * predictor%Ap(k, ic, j))
234 ivar%LN_Chi(1:n_layers, j) = ivar%b(1:n_layers,0,j)
237 ic_0 = ps + i*(n_orders+1)
238 ivar%b(1:n_layers,i,j) =
tc%C(ic_0)
242 ivar%b(k,i,j) = ivar%b(k,i,j) + (c * predictor%Ap(k, ic, j))
246 ip =
tc%Pre_Index(i,j,l)
248 ivar%LN_Chi(k,j) = ivar%LN_Chi(k,j) + (ivar%b(k, i, j) * predictor%X(k,ip))
258 ELSE IF( ivar%LN_Chi(k,j) < -
limit_exp )
THEN 261 ivar%Chi(k,j) = exp(ivar%LN_Chi(k,j))
264 atmoptics%Optical_Depth(k) = atmoptics%Optical_Depth(k) + (ivar%Chi(k,j) * predictor%dA(k,j))
271 atmoptics%Optical_Depth = atmoptics%Optical_Depth / predictor%Secant_Sensor_Zenith
352 ChannelIndex, & ! Input
353 Predictor , & ! FWD Input
354 Predictor_TL, & ! TL Input
355 AtmOptics_TL, & ! TL Output
358 TYPE(odas_taucoeff_type) ,
INTENT(IN) ::
tc 359 INTEGER ,
INTENT(IN) :: channelindex
375 REAL(fp) :: b_tl(predictor%n_layers)
376 REAL(fp) :: ln_chi_tl(predictor%n_layers)
383 n_layers = predictor%n_Layers
385 atmoptics_tl%Optical_Depth =
zero 389 absorber_loop:
DO j = 1, predictor%n_Absorbers
394 np =
tc%Pre_Index(0,j,l)
395 IF ( np < 0 ) cycle absorber_loop
410 ps =
tc%Pos_Index(j,l)
411 n_orders =
tc%Order(j,l)
414 b_tl(1:n_layers) =
zero 418 b_tl(k) = b_tl(k) + (c * predictor_tl%Ap(k, ic, j))
435 ln_chi_tl(1:n_layers) = b_tl(1:n_layers)
438 ic_0 = ps + i*(n_orders+1)
439 b_tl(1:n_layers) =
zero 443 b_tl(k) = b_tl(k) + (c * predictor_tl%Ap(k, ic, j))
447 ip =
tc%Pre_Index(i,j,l)
449 ln_chi_tl(k) = ln_chi_tl(k) + (b_tl(k) * predictor%X(k,ip)) &
450 + (ivar%b(k,i,j) * predictor_tl%X(k,ip))
460 ELSE IF( ivar%LN_Chi(k,j) < -
limit_exp )
THEN 463 chi_tl = ivar%Chi(k,j) * ln_chi_tl(k)
466 atmoptics_tl%Optical_Depth(k) = atmoptics_tl%Optical_Depth(k) &
467 + (chi_tl * predictor%dA(k,j)) &
468 + (ivar%Chi(k,j) * predictor_tl%dA(k,j))
475 atmoptics_tl%Optical_Depth = atmoptics_tl%Optical_Depth / &
476 predictor%Secant_Sensor_Zenith
559 ChannelIndex, & ! Input
560 Predictor , & ! FWD Input
561 AtmOptics_AD, & ! AD Input
562 Predictor_AD, & ! AD Output
565 TYPE(odas_taucoeff_type) ,
INTENT(IN) ::
tc 566 INTEGER ,
INTENT(IN) :: channelindex
582 REAL(fp) :: b_ad(predictor%n_layers)
583 REAL(fp) :: ln_chi_ad(predictor%n_layers)
591 n_layers = predictor%n_Layers
599 atmoptics_ad%Optical_Depth = atmoptics_ad%Optical_Depth / &
600 predictor%Secant_Sensor_Zenith
604 absorber_loop:
DO j = 1, predictor%n_Absorbers
609 np =
tc%Pre_Index(0,j,l)
610 IF ( np < 0 ) cycle absorber_loop
613 ps =
tc%Pos_Index(j,l)
614 n_orders =
tc%Order(j,l)
618 DO k = n_layers, 1, -1
619 predictor_ad%dA(k,j) = predictor_ad%dA(k,j) + &
620 (ivar%Chi(k,j) * atmoptics_ad%Optical_Depth(k))
621 chi_ad = chi_ad + (predictor%dA(k,j) * atmoptics_ad%Optical_Depth(k))
627 ELSE IF( ivar%LN_Chi(k,j) < -
limit_exp )
THEN 630 ln_chi_ad(k) = ln_chi_ad(k) + ivar%Chi(k,j) * chi_ad
639 ip =
tc%Pre_Index(i,j,l)
640 DO k = n_layers, 1, -1
641 b_ad(k) = b_ad(k) + (ln_chi_ad(k) * predictor%X(k,ip))
642 predictor_ad%X(k,ip) = predictor_ad%X(k,ip) + (ivar%b(k,i,j) * ln_chi_ad(k))
645 ic_0 = ps + i*(n_orders+1)
646 DO ic = n_orders, 1, -1
648 DO k = n_layers, 1, -1
649 predictor_ad%Ap(k, ic, j) = predictor_ad%Ap(k, ic, j) + (c * b_ad(k))
652 b_ad(1:n_layers) =
zero 654 b_ad(1:n_layers) = b_ad(1:n_layers) + ln_chi_ad(1:n_layers)
655 ln_chi_ad(1:n_layers) =
zero 660 DO ic = n_orders, 1, -1
662 DO k = n_layers, 1, -1
663 predictor_ad%Ap(k, ic, j) = predictor_ad%Ap(k, ic, j) + (c * b_ad(k))
666 b_ad(1:n_layers) =
zero 672 atmoptics_ad%Optical_Depth =
zero 677 integer, parameter, public failure
real(fp), parameter, public zero
integer, parameter, public warning
integer, parameter, public fp
subroutine, public odas_compute_atmabsorption_ad(TC, ChannelIndex, Predictor, AtmOptics_AD, Predictor_AD, iVar)
integer, parameter, public max_n_absorbers
real(fp), parameter, public limit_exp
real(fp), parameter, public limit_log
character(*), parameter module_version_id
subroutine, public odas_compute_atmabsorption_tl(TC, ChannelIndex, Predictor, Predictor_TL, AtmOptics_TL, iVar)
integer, parameter, public max_n_orders
integer, parameter, public max_n_predictors_used
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
integer, parameter, public max_n_layers
subroutine, public odas_compute_atmabsorption(TC, ChannelIndex, Predictor, AtmOptics, iVar)
type(odas_taucoeff_type), dimension(:), allocatable, target, save, public tc
integer, parameter, public success