      FUNCTION CC8STE(CCHIRS,H8STE)
      IMPLICIT NONE
C***********************************************************************
C
C   NAME-  CC8STE
C
C   LANGUAGE- FORTRAN     TYPE- REAL FUNCTION    COMPUTER-  AIX
C
C   VERSION- 1.0    DATE- 03/02/06   PROGRAMMER- FRANK TILLEY (ERT)
C   VERSION- 2.0    DATE- 09/15/06   PROGRAMMER- FRANK TILLEY (IMSG)
C            ADDED REGRESSION COEFFICIENTS TO THE CALLING ARGUMENTS
C            AND REMOVED COMMON /REGCOE/.
C
C   FUNCTION-  THIS FUNCTION RETURNS THE HIRS CHANNEL 8 SURFACE
C              TEMPERATURE ESTIMATE COMPUTED USING CLOUD-CLEARED HIRS
C              CHANNEL BRIGHTNESS TEMPERATURES. THIS ROUTINE CAN
C              ALSO BE USED TO CALCULATE A HIRS 8 SURFACE TEMPERATURE
C              ESTIMATE USING ANY HIRS CHANNEL BRIGHTNESS TEMPERATURE
C              PROFILE.
C
C
C   CALLING SEQUENCE PARAMETERS-
C   NAME    TYPE   I/O   DESCRIPTION
C   ----    ----   ---   -----------
C   CCHIRS  REAL    I    ARRAY OF 19 HIRS BRIGHTNESS TEMPERATURES.
C   H8STE   REAL    I    REGRESSION COEFFICIENTS USED TO CALCULATE THE
C                        HIRS 8 SURFACE TEMPERATURE ESTIMATE.
C
C
C   LOCAL VARIABLES-
C   NAME    TYPE         DESCRIPTION
C   ----    ----         -----------
C   SPOT     INT         THE NEAR-NADIR HIRS SPOT NUMBER USED AS AN
C                        INDEX INTO THE TSE8 COEFFICIENT ARRAY IN
C                        COMMON /REGCOE/. THE TSE8 ARRAY HAS
C                        COEFFICIENTS FOR 56 SPOTS PER CHANNEL, BUT
C                        THEY ARE IDENTICAL FOR A GIVEN CHANNEL.
C
C   EXIT STATES- NONE
C
C   COMMENTS-
C
C     IF ANY OF THE HIRS VALUES USED TO COMPUTE THE SURFACE TEMPERATURE
C     ESTIMATE ARE MISSING, THE RETURN VALUE OF THE FUNCTION IS A
C     MISSING VALUE.
C
C***********************************************************************
C
      REAL CC8STE, CCHIRS(19), H8STE(56,6)
      LOGICAL   ISR4SPV
      INTEGER   SPOT
C
      INCLUDE 'SPVAL'
C
      SPOT = 26
C
C  IF ANY OF THE HIRS CHANNEL VALUES NEEDED FOR THE COMPUTATION ARE
C  MISSING, THE SURFACE TEMPERATURE ESTIMATE IS RETURNED AS A
C  MISSING VALUE.
C
      IF ((ISR4SPV(CCHIRS(6))) .OR.
     1    (ISR4SPV(CCHIRS(7))) .OR.
     2    (ISR4SPV(CCHIRS(10))) .OR.
     3    (ISR4SPV(CCHIRS(11))) .OR.
     4    (ISR4SPV(CCHIRS(8)))) THEN
C
         CC8STE = R4SPV
         RETURN
      ENDIF
C
C  COMPUTE THE SURFACE TEMPERATURE ESTIMATE FOR THE CHANNEL.
C
      CC8STE = H8STE(SPOT,1) + H8STE(SPOT,2)*CCHIRS(6)
     1         + H8STE(SPOT,3)*CCHIRS(7)
     2         + H8STE(SPOT,4)*CCHIRS(10)
     3         + H8STE(SPOT,5)*CCHIRS(11)
     4         + H8STE(SPOT,6)*CCHIRS(8)
C
      RETURN
      END
