!OPTIONS XOPT(NOEVAL)
SUBROUTINE SWTT115 ( KIDIA,KFDIA,KLON,KNU,KABS,KIND,&
 & PU,&
 & PTR                             )  

!**** *SWTT115* - COMPUTES THE SHORTWAVE TRANSMISSION FUNCTIONS
!****             FROZEN VERSION (CYCLE 15) OF SWTT1

!     PURPOSE.
!     --------
!           THIS ROUTINE COMPUTES THE TRANSMISSION FUNCTIONS FOR ALL THE
!     ABSORBERS (H2O, UNIFORMLY MIXED GASES, AND O3) IN THE TWO SPECTRAL
!     INTERVALS.

!**   INTERFACE.
!     ----------
!          *SWTT115* IS CALLED FROM *SW1S15*.

!        EXPLICIT ARGUMENTS :
!        --------------------
! KNU    :                     ; INDEX OF THE SPECTRAL INTERVAL
! KABS   :                     ; NUMBER OF ABSORBERS
! KIND   : (KABS)              ; INDICES OF THE ABSORBERS
! PU     : (KLON,KABS)        ; ABSORBER AMOUNT
!     ==== OUTPUTS ===
! PTR    : (KLON,KABS)        ; TRANSMISSION FUNCTION

!        IMPLICIT ARGUMENTS :   NONE
!        --------------------

!     METHOD.
!     -------

!          TRANSMISSION FUNCTION ARE COMPUTED USING PADE APPROXIMANTS
!     AND HORNER'S ALGORITHM.

!     EXTERNALS.
!     ----------

!          NONE

!     REFERENCE.
!     ----------

!        SEE RADIATION'S PART OF THE MODEL'S DOCUMENTATION AND
!        ECMWF RESEARCH DEPARTMENT DOCUMENTATION OF THE IFS

!     AUTHOR.
!     -------
!        96-11: Ph. Dandin. Meteo-France
!        ORIGINAL : 95-01-20 BY JEAN-JACQUES MORCRETTE  *ECMWF*

!     MODIFICATIONS.
!     --------------
!        M.Hamrud      01-Oct-2003 CY28 Cleaning

!-----------------------------------------------------------------------

USE PARKIND1  ,ONLY : JPIM     ,JPRB
USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK

USE YOMSW15  , ONLY : APAD15   ,BPAD15   ,D15

IMPLICIT NONE

INTEGER(KIND=JPIM),INTENT(IN)    :: KLON 
INTEGER(KIND=JPIM),INTENT(IN)    :: KABS 
INTEGER(KIND=JPIM),INTENT(IN)    :: KIDIA 
INTEGER(KIND=JPIM),INTENT(IN)    :: KFDIA 
INTEGER(KIND=JPIM),INTENT(IN)    :: KNU 
INTEGER(KIND=JPIM),INTENT(IN)    :: KIND(KABS) 
REAL(KIND=JPRB)   ,INTENT(IN)    :: PU(KLON,KABS) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PTR(KLON,KABS) 
!-----------------------------------------------------------------------

!*       0.1   ARGUMENTS
!              ---------

!-----------------------------------------------------------------------

!              ------------

REAL(KIND=JPRB) :: ZR1(KLON), ZR2(KLON), ZU(KLON)

INTEGER(KIND=JPIM) :: IA, JA, JL
REAL(KIND=JPRB) :: ZHOOK_HANDLE

!-----------------------------------------------------------------------

!*         1.      HORNER'S ALGORITHM TO COMPUTE TRANSMISSION FUNCTION

IF (LHOOK) CALL DR_HOOK('SWTT115',0,ZHOOK_HANDLE)
DO JA = 1,KABS
  IA=KIND(JA)
  DO JL = KIDIA,KFDIA
    ZU(JL) = PU(JL,JA)
    ZR1(JL) = APAD15(KNU,IA,1) + ZU(JL) * (APAD15(KNU,IA,2) +&
     & ZU(JL)&
     & * ( APAD15(KNU,IA,3) + ZU(JL) * (APAD15(KNU,IA,4) + ZU(JL)&
     & * ( APAD15(KNU,IA,5) + ZU(JL) * (APAD15(KNU,IA,6) + ZU(JL)&
     & * ( APAD15(KNU,IA,7) ))))))  

    ZR2(JL) = BPAD15(KNU,IA,1) + ZU(JL) * (BPAD15(KNU,IA,2) +&
     & ZU(JL)&
     & * ( BPAD15(KNU,IA,3) + ZU(JL) * (BPAD15(KNU,IA,4) + ZU(JL)&
     & * ( BPAD15(KNU,IA,5) + ZU(JL) * (BPAD15(KNU,IA,6) + ZU(JL)&
     & * ( BPAD15(KNU,IA,7) ))))))  

!*         2.      ADD THE BACKGROUND TRANSMISSION

    PTR(JL,JA) = (ZR1(JL)/ZR2(JL)) * (1.0_JPRB-D15(KNU,IA)) + D15(KNU,IA)
  ENDDO
ENDDO

IF (LHOOK) CALL DR_HOOK('SWTT115',1,ZHOOK_HANDLE)
END SUBROUTINE SWTT115
