      SUBROUTINE CLSPTH(PATHID,ITERR,EIGVCT,EIGVAL,CLSBND,NUMINT,CLSTBL,
     1                  CHNAVG,AVGFLG,EIGFLG,NUMEIG)
C
C*********************************************************************
C
C   NAME- CLSPTH
C
C   LANGUAGE- VS FORTRAN      TYPE- SUBROUTINE    COMPUTER- CRAY J916
C
C   VERSION- 1.0   DATE- 9/9/91   PROGRAMMER- CARLA NEIGH (SMSRC)
C   VERSION- 2.0   DATE-12/01/94  PROGRAMMER- SURYA JANDHYALA(SMSRC)
C     ATOVS-43  ADDED INCLUDE RETPARM. REMOVED A CALLING ARGUMENT.
C   VERSION- 3.0   DATE- 3/15/96  PROGRAMMER- ALEX POZDNYAK (FDC)
C      MODIFIED TO RUN ON THE CRAY.  REPLACED I*4 WITH INT AND
C      R*4 WITH REAL.
C   VERSION- 3.1   DATE- 01/14/97  PROGRAMMER- TIM GARDNER (HSTX)
C   VERSION- 3.2   DATE- 11/19/97  PROGRAMMER- LEAH WILSON (HSTX)
C
C   FUNCTION- THIS SUBROUTINE OBTAINS THE CLASSIFICATION CDB VALUES
C             FOR THE GIVEN PATH FROM THE COMMON BLOCK CLASIF.  VALUES
C             OBTAINED FROM THE COMMON BLOCK INCLUDE RADIANCE
C             EIGENVECTORS AND EIGENVALUES, SUBCLASS BOUNDARIES, NUMBER
C             OF EIGENVECTOR RANGE INTERVALS, CLASS INDEX TABLE, CHANNEL
C             AVERAGES, CHANNELS TO USE TO COMPUTE AVERAGE, AND CHANNELS
C             USED TO COMPUTE EIGENVECTORS.
C
C   VERSION 3.1- ADDED OUTPUT VARIABLE WHICH CONTAINS NUMBER OF
C                EIGENVECTORS TO USE.
C   VERSION 3.2- RTOVS UPGRADES INVOLVING SPLITTING LAND/SEA COEFFS.
C
C   CALLING SEQUENCE PARAMETERS-
C   NAME     TYPE    I/O    DESCRIPTION
C   ----     ----    ---    -----------
C   PATHID   INT      I     PATH IDENTIFICATION NUMBER
C                           1 = CLEAR/CLOUD-CLEARED, 2 = CLOUDY,
C                           3 = NO-HIRS.
C   ITERR    INT      I     TERRAIN TYPE.
C   EIGVCT   REAL     O     2D ARRAY CONTAINING RADIANCE EIGENVECTORS
C                           FOR THE PATH. DIMESIONED RETPARM:NUMCHN X
C                           RETPARM:NUMCHN.
C   EIGVAL   REAL     O     ARRAY CONTAINING THE RADIANCE EIGENVALUES
C                           FOR THE PATH. DIMENSIONED RETPARM:NUMCHN.
C   CLSBND   REAL     O     2D ARRAY (DIM 16 X 4) CONTAINING EIGENVECTOR
C                           SUBCLASS INTERVAL BOUNDARIES FOR THE PATH
C   NUMINT   INT      O     ARRAY (DIM 4) OF NUMBER OF INTERVALS USED
C                           FOR CLASS BOUNDARIES FOR THE PATH.
C   CLSTBL   INT      O     4D ARRAY (DIM 16 X 4 X 2 X 2) CONTAINING
C                           LOOK-UP TABLE OF CLASS INDICES FOR PATH.
C   CHNAVG   REAL     O     ARRAY CONTAINING AVERAGE RADIANCE
C                           TEMPERATURE VALUES FOR EACH CHANNEL OVER
C                           THE DEPENDENT SAMPLE. DIMENSIONED
C                           RETPARM:NUMCHN.
C   AVGFLG   INT      O     ARRAY (DIM 2) CONTAINING BIT FLAGS FOR
C                           CHANNELS TO USE IN COMPUTING RADIANCE
C                           TEMPERATURE AVERAGE(1 = USE, 0 = DON'T USE).
C   EIGFLG   INT      O     ARRAY (DIM 2) CONTAINING BIT FLAGS FOR
C                           CHANNELS TO USE EIGENVECTOR CALCULATIONS
C                           (1 = USE, 0 = DON'T USE).
C   NUMEIG   INT      O     NUMBER OF EIGENVECTORS TO USE.
C
C   COMMON AREA PARAMETERS-  CLASIF,RETPARM
      INCLUDE'RETPARM'
C
C   LOCAL VARIABLES-
C   NAME    TYPE    DESCRIPTION
C   ----    ----    -----------
C   I,J,K,L  INT    DO LOOP INDICES.
C
C
C   EXIT STATES- NONE
C
C**********************************************************************
C
      INTEGER   PATHID, NUMINT(4), CLSTBL(16,4,2,2), ITERR
      INTEGER   AVGFLG(2), EIGFLG(2), NUMEIG, I, J, K, L
      REAL      EIGVCT(NUMCHN,NUMCHN), CLSBND(16,4), CHNAVG(NUMCHN)
      REAL      EIGVAL(NUMCHN)
C
      INCLUDE'CLASIF'
C
      IF (PATHID .EQ. 1) THEN
C
C     ASSIGN THE NUMBER OF EIGENVECTORS FOR PATH 1.
C
      IF(ITERR.EQ.1) NUMEIG = EIGNM1
      IF(ITERR.EQ.2) NUMEIG = EIGNM3
C
C     ASSIGN CDB VALUES FOR PATH 1
C
        DO 20 I = 1,NUMCHN
          CHNAVG(I) = P1CHAV(I,ITERR)
          EIGVAL(I) = P1EVAL(I,ITERR)
          DO 10 J = 1,NUMCHN
            EIGVCT(I,J) = P1EIGV(I,J,ITERR)
   10     CONTINUE
   20   CONTINUE
C
        DO 60 I = 1,16
          DO 50 J = 1,4
            CLSBND(I,J) = P1CLBN(I,J)
            DO 40 K = 1,2
              DO 30 L = 1,2
                CLSTBL(I,J,K,L) = P1CLTB(I,J,K,L)
   30         CONTINUE
   40       CONTINUE
   50     CONTINUE
   60   CONTINUE
C
        DO 70 I = 1,4
          NUMINT(I) = P1NINT(I)
          IF (I.LE.2) THEN
             AVGFLG(I) = P1AVFL(I)
             EIGFLG(I) = P1EGFL(I,ITERR)
          ENDIF
   70   CONTINUE

C
      ELSE IF (PATHID .EQ. 2) THEN
C
C     ASSIGN THE NUMBER OF EIGENVECTORS FOR PATH 2.
C
      IF(ITERR.EQ.1) NUMEIG = EIGNM2
      IF(ITERR.EQ.2) NUMEIG = EIGNM4
C
C     ASSIGN CDB VALUES FOR PATH 2
C
        DO 90 I = 1,NUMCHN
          CHNAVG(I) = P2CHAV(I,ITERR)
          EIGVAL(I) = P2EVAL(I,ITERR)
          DO 80 J = 1,NUMCHN
            EIGVCT(I,J) = P2EIGV(I,J,ITERR)
   80     CONTINUE
   90   CONTINUE
C
        DO 130 I = 1,16
          DO 120 J = 1,4
            CLSBND(I,J) = P2CLBN(I,J)
            DO 110 K = 1,2
              DO 100 L = 1,2
                CLSTBL(I,J,K,L) = P2CLTB(I,J,K,L)
  100         CONTINUE
  110       CONTINUE
  120     CONTINUE
  130   CONTINUE
C
        DO 140 I = 1,4
          NUMINT(I) = P2NINT(I)
          IF (I.LE.2) THEN
             AVGFLG(I) = P2AVFL(I)
             EIGFLG(I) = P2EGFL(I,ITERR)
          ENDIF
  140     CONTINUE
C
      ELSE
C
C     ASSIGN CDB VALUES FOR PATH 3
C
        DO 160 I = 1,NUMCHN
          CHNAVG(I) = P3CHAV(I,ITERR)
          EIGVAL(I) = P3EVAL(I,ITERR)
          DO 150 J = 1,NUMCHN
            EIGVCT(I,J) = P3EIGV(I,J,ITERR)
  150     CONTINUE
  160   CONTINUE
C
        DO 200 I = 1,16
          DO 190 J = 1,4
            CLSBND(I,J) = P3CLBN(I,J)
            DO 180 K = 1,2
              DO 170 L = 1,2
                CLSTBL(I,J,K,L) = P3CLTB(I,J,K,L)
  170         CONTINUE
  180       CONTINUE
  190     CONTINUE
  200   CONTINUE
C
        DO 210 I = 1,4
          NUMINT(I) = P3NINT(I)
          IF (I.LE.2) THEN
             AVGFLG(I) = P3AVFL(I)
             EIGFLG(I) = P3EGFL(I,ITERR)
          ENDIF
  210   CONTINUE
C
      ENDIF
C
      RETURN
      END
