      SUBROUTINE CLRFIN(DMLNMP,QFLAGS,SCTIM,CLCOEF,BUFLEN,NCHAN)
C***********************************************************************
C
C   NAME- CLRFIN
C
C   LANGUAGE- FORTRAN 77     TYPE- SUBROUTINE    COMPUTER- CRAY    
C
C   VERSION- 1.0        DATE- 6/4/91   PROGRAMMER- CARLA NEIGH (SMSRC)
C   VERSION- 2.0        DATE- 12/4/95  PROGRAMMER- CARLA NEIGH (SMSRC)
C    ATOVS-264:  CHANGE DIMENSION OF QFLAGS TO 32 X BUFLEN. CHANGE
C                CLCOEF TO DIMENSION 3 X NCHAN X BUFLEN.
C   VERSION- 3.0        DATE- 12/4/95  PROGRAMMER- ALEX POZDNYAK (FDC)
C      MODIFIED TO RUN ON THE CRAY.  REPLACED I*4 WITH INT, L*4 WITH
C      LOG AND R*4 WITH REAL.
C 
C   FUNCTION- THIS SUBROUTINE INITIALIZES EACH OF THE ARRAYS USED IN
C             THE COMMON BLOCK FRMINF AND THE ARRAY OF INSTRUMENT
C             CALIBRATION COEFFICIENTS.  THIS ROUTINE IS CALLED ONLY
C             FOR THE CASE OF THE DATA FRAME BEING THE FIRST FRAME
C             INGESTED FOLLOWING SYNCHRONIZATION, WHERE NO OVERLAP
C             FROM THE PREVIOUS FRAME EXISTS AND THE ENTIRE BUFFER MUST
C             BE INITIALIZED TO A DESIGNATED VALUE.
C
C   CALLING SEQUENCE PARAMETERS-
C   NAME      TYPE   I/O   DESCRIPTION
C   ----      ----   ---   -----------
C   DMLNMP    LOG    I/O   INSTRUMENT DUMMY LINE MAP (DIM BUFLEN)-
C                          ELEMENT SET TO TRUE IF SCAN LINE CONTAINS
C                          USABLE DATA, SET TO FALSE IF DATA IS
C                          NOT USABLE
C   QFLAGS    INT    I/O   ARRAY OF 1B* SCAN LINE QUALITY INFORMATION
C                          FOR EACH LINE OF THE EXTENDED FRAME BUFFER- 
C                          DIM 32 X BUFLEN
C   SCTIM     INT    I/O   2D ARRAY OF SCAN LINE TIMES FOR EACH LINE
C                          OF THE EXTENDED FRAME BUFFER IN FORMAT
C                          CENTURY DAY, MILLISECOND OF DAY (2 X BUFLEN)
C   CLCOEF    REAL   I/O   3D ARRAY OF CALIBRATION COEFFICIENTS FOR EACH
C                          CHANNEL FOR INSTRUMENT EXTENDED DATA FRAME
C                           (DIMENSIONED 3 X NCHAN X BUFLEN)
C   BUFLEN    INT     I    NUMBER OF SCAN LINES IN EXTENDED DATA FRAME
C                          BUFFER FOR INSTRUMENT
C   NCHAN     INT     I    NUMBER OF CHANNELS FOR INSTRUMENT
C
C   LOCAL VARIABLES
C   NAME     TYPE    DESCRIPTION
C   ----     ----    -----------
C   INDX     INT     DO LOOP COUNTER FOR ARRAY INDEX
C   CHAN     INT     DO LOOP COUNTER FOR CHANNELS
C   I        INT     DO LOOP COUNTER  
C
C   INCLUDES- SPVAL
C
C   EXIT STATES- NONE
C
C***********************************************************************
      INTEGER   BUFLEN, INDX, NCHAN, CHAN, I
      INTEGER   QFLAGS(32,BUFLEN), SCTIM(2,BUFLEN)
      REAL      CLCOEF(3,NCHAN,BUFLEN)
      LOGICAL*1   DMLNMP(BUFLEN)
C
      INCLUDE 'SPVAL'
C
C  INITIALIZE ARRAY ELEMENTS
C 
      DO 30 INDX = 1, BUFLEN
        DMLNMP(INDX) = .FALSE.
        SCTIM(1,INDX) = I4SPV
        SCTIM(2,INDX) = I4SPV
        DO 10 CHAN = 1, NCHAN
          CLCOEF(1,CHAN,INDX) = R4SPV
          CLCOEF(2,CHAN,INDX) = R4SPV
          CLCOEF(3,CHAN,INDX) = R4SPV
   10   CONTINUE
        DO 20 I = 1, 32
           QFLAGS(I,INDX) = I4SPV
   20   CONTINUE
   30 CONTINUE
C
      RETURN
      END
