82 '$Id: ODSSU_AtmAbsorption.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 84 INTEGER,
PARAMETER ::
ml = 256
93 TYPE(odas_aavar_type) :: odas(2)
94 REAL(fp) :: weight(2) =
zero 95 REAL(fp) :: co2_cell =
zero 96 INTEGER :: index_low = 1
167 SSU_Input , & ! Input
168 SensorIndex , & ! Input
169 ChannelIndex, & ! Input
173 INTEGER ,
INTENT(IN) :: sensorindex
174 INTEGER ,
INTENT(IN) :: channelindex
177 CHARACTER(*),
PARAMETER :: routine_name =
'ODSSU_Compute_Weights' 180 REAL(fp) :: time, cell_pressure
186 channel = channelindex, &
187 cell_pressure = cell_pressure )
188 ivar%CO2_Cell = cell_pressure
189 ivar%Index_low =
bisection_search(
tc(sensorindex)%TC_CellPressure(:,channelindex), ivar%CO2_Cell )
193 IF( time <
tc(sensorindex)%Ref_Time(1) )
THEN 194 time =
tc(sensorindex)%Ref_Time(1)
195 WRITE( msg,
'("Invalid time. Reset to ",f8.2)' ) time
199 CALL get_co2_cell_p( sensorindex, channelindex, time, ivar%CO2_Cell )
200 ivar%Index_low =
bisection_search(
tc(sensorindex)%TC_CellPressure(:,channelindex), ivar%CO2_Cell )
205 ivar%Weight(1) = (ivar%CO2_Cell -
tc(sensorindex)%TC_CellPressure(ivar%Index_low,channelindex))/ &
206 (
tc(sensorindex)%TC_CellPressure(ivar%Index_low+1,channelindex) - &
207 tc(sensorindex)%TC_CellPressure(ivar%Index_low ,channelindex) )
208 ivar%Weight(2) =
one - ivar%Weight(1)
289 SensorIndex , & ! Input
290 ChannelIndex , & ! Input
291 Predictor , & ! Input
292 AtmOptics , & ! Output
295 INTEGER ,
INTENT(IN) :: SensorIndex
296 INTEGER ,
INTENT(IN) :: ChannelIndex
297 TYPE(ODAS_Predictor_type),
INTENT(IN) :: Predictor
298 TYPE(CRTM_AtmOptics_type),
INTENT(IN OUT) :: AtmOptics
299 TYPE(iVar_type) ,
INTENT(IN OUT) :: iVar
301 REAL(fp) :: optical_depth( AtmOptics%n_Layers )
307 tc(sensorindex)%ODAS(ivar%Index_low), &
312 optical_depth = atmoptics%Optical_Depth
315 tc(sensorindex)%ODAS(ivar%Index_low+1), &
321 atmoptics%Optical_Depth = ivar%Weight(1)*atmoptics%Optical_Depth + &
322 ivar%Weight(2)*optical_depth
328 SensorIndex , & ! Input
329 ChannelIndex, & ! Input
330 Predictor , & ! Input
331 AtmOptics , & ! Output
334 INTEGER ,
INTENT(IN) :: SensorIndex
335 INTEGER ,
INTENT(IN) :: ChannelIndex
336 TYPE(ODPS_Predictor_type),
INTENT(IN OUT) :: Predictor
337 TYPE(CRTM_AtmOptics_type),
INTENT(IN OUT) :: AtmOptics
338 TYPE(iVar_type) ,
INTENT(IN OUT) :: iVar
340 REAL(fp) :: optical_depth( AtmOptics%n_Layers )
345 tc(sensorindex)%ODPS(ivar%Index_low), &
349 optical_depth = atmoptics%Optical_Depth
352 tc(sensorindex)%ODPS(ivar%Index_low+1), &
357 atmoptics%Optical_Depth = ivar%Weight(1)*atmoptics%Optical_Depth + &
358 ivar%Weight(2)*optical_depth
448 SensorIndex , & ! Input
449 ChannelIndex, & ! Input
450 Predictor , & ! FWD Input
451 Predictor_TL, & ! TL Input
452 AtmOptics_TL, & ! TL Output
455 INTEGER ,
INTENT(IN) :: SensorIndex
456 INTEGER ,
INTENT(IN) :: ChannelIndex
457 TYPE(ODAS_Predictor_type),
INTENT(IN) :: Predictor
458 TYPE(ODAS_Predictor_type),
INTENT(IN) :: Predictor_TL
459 TYPE(CRTM_AtmOptics_type),
INTENT(IN OUT) :: AtmOptics_TL
460 TYPE(iVar_type) ,
INTENT(IN) :: iVar
462 REAL(fp) :: optical_depth_TL(AtmOptics_TL%n_Layers)
467 tc(sensorindex)%ODAS(ivar%Index_low), &
473 optical_depth_tl = atmoptics_tl%Optical_Depth
476 tc(sensorindex)%ODAS(ivar%Index_low+1), &
483 atmoptics_tl%Optical_Depth = ivar%Weight(1)*atmoptics_tl%Optical_Depth + &
484 ivar%Weight(2)*optical_depth_tl
490 SensorIndex , & ! Input
491 ChannelIndex, & ! Input
492 Predictor , & ! FWD Input
493 Predictor_TL, & ! TL Input
494 AtmOptics_TL, & ! TL Output
497 INTEGER ,
INTENT(IN) :: SensorIndex
498 INTEGER ,
INTENT(IN) :: ChannelIndex
499 TYPE(ODPS_Predictor_type),
INTENT(IN) :: Predictor
500 TYPE(ODPS_Predictor_type),
INTENT(IN OUT) :: Predictor_TL
501 TYPE(CRTM_AtmOptics_type),
INTENT(IN OUT) :: AtmOptics_TL
502 TYPE(iVar_type) ,
INTENT(IN) :: iVar
504 REAL(fp) :: optical_depth_TL(AtmOptics_TL%n_Layers)
509 tc(sensorindex)%ODPS(ivar%Index_low), &
514 optical_depth_tl = atmoptics_tl%Optical_Depth
517 tc(sensorindex)%ODPS(ivar%Index_low+1), &
523 atmoptics_tl%Optical_Depth = ivar%Weight(1)*atmoptics_tl%Optical_Depth + &
524 ivar%Weight(2)*optical_depth_tl
611 SensorIndex , & ! Input
612 ChannelIndex, & ! Input
613 Predictor , & ! FWD Input
614 AtmOptics_AD, & ! AD Input
615 Predictor_AD, & ! AD Output
618 INTEGER ,
INTENT(IN) :: SensorIndex
619 INTEGER ,
INTENT(IN) :: ChannelIndex
620 TYPE(ODAS_Predictor_type),
INTENT(IN) :: Predictor
621 TYPE(CRTM_AtmOptics_type),
INTENT(IN OUT) :: AtmOptics_AD
622 TYPE(ODAS_Predictor_type),
INTENT(IN OUT) :: Predictor_AD
623 TYPE(iVar_type) ,
INTENT(IN) :: iVar
625 REAL(fp) :: optical_depth_AD( AtmOptics_AD%n_Layers)
628 optical_depth_ad = ivar%Weight(2)*atmoptics_ad%Optical_Depth
629 atmoptics_ad%Optical_Depth = ivar%Weight(1)*atmoptics_ad%Optical_Depth
634 tc(sensorindex)%ODAS(ivar%Index_low+1), &
640 atmoptics_ad%Optical_Depth = atmoptics_ad%Optical_Depth + optical_depth_ad
643 tc(sensorindex)%ODAS(ivar%Index_low), &
661 INTEGER ,
INTENT(IN) :: SensorIndex
662 INTEGER ,
INTENT(IN) :: ChannelIndex
663 TYPE(ODPS_Predictor_type),
INTENT(IN) :: Predictor
664 TYPE(CRTM_AtmOptics_type),
INTENT(IN OUT) :: AtmOptics_AD
665 TYPE(ODPS_Predictor_type),
INTENT(IN OUT) :: Predictor_AD
666 TYPE(iVar_type) ,
INTENT(IN) :: iVar
668 REAL(fp) :: optical_depth_AD( AtmOptics_AD%n_Layers)
671 optical_depth_ad = ivar%Weight(2)*atmoptics_ad%Optical_Depth
672 atmoptics_ad%Optical_Depth = ivar%Weight(1)*atmoptics_ad%Optical_Depth
677 tc(sensorindex)%ODPS(ivar%Index_low+1), &
682 atmoptics_ad%Optical_Depth = atmoptics_ad%Optical_Depth + optical_depth_ad
685 tc(sensorindex)%ODPS(ivar%Index_low), &
699 INTEGER,
INTENT( IN ) :: SensorIndex, ChannelIndex
700 REAL(fp),
INTENT( IN ) :: u
701 REAL(fp),
INTENT( OUT ) :: y0
702 INTEGER :: n, jLower, jUpper, indx
704 n =
SIZE(
tc(sensorindex)%Ref_Time)
708 if(u.ge.
tc(sensorindex)%Ref_Time(n))
then 709 y0 =
tc(sensorindex)%Ref_CellPressure(n,channelindex)
711 else if(u.le.
tc(sensorindex)%Ref_Time(1))
then 712 y0 =
tc(sensorindex)%Ref_CellPressure(1,channelindex)
718 y0 =
tc(sensorindex)%Ref_CellPressure(indx,channelindex) + &
719 (
tc(sensorindex)%Ref_CellPressure(indx+1,channelindex)- &
720 tc(sensorindex)%Ref_CellPressure(indx,channelindex))/ &
721 (
tc(sensorindex)%Ref_Time(indx+1)-
tc(sensorindex)%Ref_Time(indx))* &
722 (u-
tc(sensorindex)%Ref_Time(indx))
subroutine compute_odas_atmabsorption(SensorIndex, ChannelIndex, Predictor, AtmOptics, iVar)
integer, parameter, public failure
real(fp), parameter, public zero
integer, parameter, public warning
subroutine, public odssu_compute_weights(SSU_Input, SensorIndex, ChannelIndex, iVar)
integer, parameter, public fp
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)
subroutine, public odps_compute_atmabsorption(TC, ChannelIndex, Predictor, AtmAbsorption)
subroutine, public odps_compute_atmabsorption_ad(TC, ChannelIndex, Predictor, AtmAbsorption_AD, Predictor_AD)
character(*), parameter module_version_id
subroutine compute_odps_atmabsorption_ad(SensorIndex, ChannelIndex, Predictor, AtmOptics_AD, Predictor_AD, iVar)
real(fp), parameter, public one
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
subroutine get_co2_cell_p(SensorIndex, ChannelIndex, u, y0)
subroutine compute_odps_atmabsorption_tl(SensorIndex, ChannelIndex, Predictor, Predictor_TL, AtmOptics_TL, iVar)
subroutine compute_odas_atmabsorption_ad(SensorIndex, ChannelIndex, Predictor, AtmOptics_AD, Predictor_AD, iVar)
subroutine compute_odas_atmabsorption_tl(SensorIndex, ChannelIndex, Predictor, Predictor_TL, AtmOptics_TL, iVar)
subroutine, public odas_compute_atmabsorption(TC, ChannelIndex, Predictor, AtmOptics, iVar)
type(odssu_taucoeff_type), dimension(:), allocatable, target, save, public tc
subroutine compute_odps_atmabsorption(SensorIndex, ChannelIndex, Predictor, AtmOptics, iVar)
integer, parameter, public success
subroutine, public odps_compute_atmabsorption_tl(TC, ChannelIndex, Predictor, Predictor_TL, AtmAbsorption_TL)
integer function, public bisection_search(x, u, xLower, xUpper)