C**********************************************************                  SWTT.2     
C             SUBROUTINE SWTT                                                SWTT.3     
C**********************************************************                  SWTT.4     
      SUBROUTINE SWTT (KNU,KA,APAD,BPAD,D,PU,PTR)                            SWTT.5     
C                                                                            SWTT.6     
C input everything apart from PTR (called ZR1 in SW and PU ZW)               SWTT.7     
C     PURPOSE.                                                               SWTT.8     
C     --------                                                               SWTT.9     
C           THIS ROUTINE COMPUTES THE TRANSMISSION FUNCTIONS FOR ALL THE     SWTT.10    
C     ABSORBERS (H2O, UNIFORMLY MIXED GASES, AND O3) IN THE TWO SPECTRAL     SWTT.11    
C     INTERVALS.                                                             SWTT.12    
C                                                                            SWTT.13    
C**   INTERFACE.                                                             SWTT.14    
C     ----------                                                             SWTT.15    
C          *SWTT* IS CALLED FROM *SW*.                                       SWTT.16    
C                                                                            SWTT.17    
C        EXPLICIT ARGUMENTS                                                  SWTT.18    
C        --------------------                                                SWTT.19    
C KNU    :                     ; INDEX OF THE SPECTRAL INTERVAL              SWTT.20    
C KA     :                     ; INDEX OF THE ABSORBER                       SWTT.21    
C                                                                            SWTT.22    
C        IMPLICIT ARGUMENTS                                                  SWTT.23    
C        --------------------                                                SWTT.24    
C                                                                            SWTT.25    
C     ==== INPUTS ===                                                        SWTT.26    
C PU     : (KDLON)             ; ABSORBER AMOUNT                             SWTT.27    
C     ==== OUTPUTS ===                                                       SWTT.28    
C PTR    : (KDLON)             ; TRANSMISSION FUNCTION                       SWTT.29    
C                                                                            SWTT.30    
C     METHOD.                                                                SWTT.31    
C     -------                                                                SWTT.32    
C                                                                            SWTT.33    
C          TRANSMISSION FUNCTION ARE COMPUTED USING PADE APPROXIMANTS        SWTT.34    
C     AND HORNER'S ALGORITHM.                                                SWTT.35    
C                                                                            SWTT.36    
C PMF 23-2-98                                                                SWTT.37    
C-----------------------------------------------------------------           SWTT.38    
      IMPLICIT NONE                                                          SWTT.39    
      INTEGER NLON,JLON                                                      SWTT.40    
      PARAMETER (NLON=1)                                                     SWTT.41    
      INTEGER KNU,KA                                                         SWTT.42    
      REAL PTR(NLON),PU(NLON)                                                SWTT.43    
      REAL D(2,3),APAD(2,3,7),BPAD(2,3,7)                                    SWTT.44    
      REAL ZR2(NLON)                                                         SWTT.45    
C                                                                            SWTT.46    
C*         1.      HORNER'S ALGORITHM TO COMPUTE TRANSMISSION FUNCTION       SWTT.47    
C                                                                            SWTT.48    
      DO 101 JLON = 1 , NLON                                                 SWTT.49    
        PTR(JLON) = APAD(KNU,KA,1) + PU(JLON) *(APAD(KNU,KA,2)+PU(JLON)      SWTT.50    
     S         * ( APAD(KNU,KA,3) + PU(JLON) * (APAD(KNU,KA,4)+PU(JLON)      SWTT.51    
     S         * ( APAD(KNU,KA,5) + PU(JLON) * (APAD(KNU,KA,6)+PU(JLON)      SWTT.52    
     S         * ( APAD(KNU,KA,7) ))))))                                     SWTT.53    
C                                                                            SWTT.54    
        ZR2(JLON) = BPAD(KNU,KA,1) + PU(JLON)*(BPAD(KNU,KA,2)+PU(JLON)       SWTT.55    
     S         * ( BPAD(KNU,KA,3) + PU(JLON) *(BPAD(KNU,KA,4)+PU(JLON)       SWTT.56    
     S         * ( BPAD(KNU,KA,5) + PU(JLON) *(BPAD(KNU,KA,6)+PU(JLON)       SWTT.57    
     S         * ( BPAD(KNU,KA,7) ))))))                                     SWTT.58    
 101  CONTINUE                                                               SWTT.59    
C                                                                            SWTT.60    
C*         2.      ADD THE BACKGROUND TRANSMISSION                           SWTT.61    
C                                                                            SWTT.62    
C                                                                            SWTT.63    
      DO 201 JLON = 1 , NLON                                                 SWTT.64    
         PTR(JLON) = (PTR(JLON) / ZR2(JLON))*(1.-D(KNU,KA))+D(KNU,KA)        SWTT.65    
 201  CONTINUE                                                               SWTT.66    
C                                                                            SWTT.67    
      RETURN                                                                 SWTT.68    
      END                                                                    SWTT.69    
