      SUBROUTINE INIFRM(OVLBUF,OVLPRM,BUFLIN,SPOT,CHN,PARM,FRMBUF,
     +        FRMPRM,NUMLIN)
C********************************************************************
C   NAME-INIFRM
C
C   LANGUAGE- FORTRAN 77      TYPE- SUBROUTINE    COMPUTER- CRAY    
C
C   VERSION-1.0     DATE- 01/25/91   PROGRAMMER- JEFF MANNING (SMSRC)
C   VERSION-3.0     DATE- 05/09/96   PROGRAMMER- ALEX POZDNYAK (FDC) 
C      MODIFIED TO RUN ON THE CRAY.  REPLACED I*4 WITH INT AND
C      R*4 WITH REAL.
C 
C   FUNCTION- THIS ROUTINE INITIALIZES THE FRAME BUFFERS.THE FRAME
C             BUFFERS ARE FIRST SET TO R4SPV SPECIAL VALUES AND THEN THE
C             OVERLAP BUFFERS ARE READ INTO THEM. THE ROUTINE ALSO
C             RESETS THE OVERLAP BUFFERS TO R4SPV SPECIAL VALUES BEFORE
C             RETURNING TO THE CALLING PROGRAM.
C
C   CALLING SEQUENCE PARAMETERS-
C     VARIABLE   TYPE-      I/O    DEFINITION
C     --------   ----       ---    ----------
C      OVLBUF    REAL       I/O    THE DATA FRAME OVERLAP BUFFER
C                                  CONTAINS AT LEAST THE LAST 32 SECONDS
C                                  OF THE PREVIOUS FRAME AND AT LEAST TH
C                                  FIRST 32 SECONDS OF THE CURRENT FRAME
C                                  UNITS ARE IN DEGREES KELVIN(BRIGHT
C                                  -NESS TEMPERATURE).
C      OVLPRM    REAL       I/O    ANCILLARY OVERLAP BUFFER CONTAINS AT
C                                  LEAST THE LAST 32 SECONDS OF ANCILLAR
C                                  DATA FROM THE PREVIOUS FRAME AND AT L
C                                  THE FIRST 32 SECONDS OF ANCILLARY
C                                  DATA FROM THE CURRENT FRAME. CONTAINS
C                                  LATITUDE,LONGITUDE,SOLAR ZENITH ANGLE
C                                  SOLAR AZIMUTH (FOR HIRS ONLY),SATELLI
C                                  ZENITH ANGLE,SPOT CONFIDENCE,ETC.
C      BUFLIN     INT        I     THE NUMBER OF LINES IN THE OVERLAP
C                                  BUFFERS TO MEET THE MINIMUM OF THE 32
C                                  SECONDS FROM THE PREVIOUS FRAME AND T
C                                  32 SECONDS FROM THE CURRENT FRAME.
C      SPOT       INT        I     NUMBER OF SPOTS IN A LINE OF
C                                  INSTRUMENT DATA.
C      CHN        INT        I     NUMBER OF CHANNELS PLUS ADDITIONAL
C                                  DATA ELEMENTS FOR AN INSTRUMENT.
C      PARM       INT        I     NUMBER OF ANCILLARY DATA ELEMENTS.
C      FRMBUF    REAL        O     DATA FRAME BUFFER IS A 3-D ARRAY
C                                  CONTAINING BRIGHTNESS TEMPERATURES FO
C                                  AN EXTENDED FRAME OF DATA.
C      FRMPRM    REAL        O     DATA FRAME ANCILLARY BUFFER IS A 3-D
C                                  ARRAY CONTAINING ANCILLARY DATA ELEME
C                                  FOR AN EXTENDED FRAME OF DATA.
C      NUMLIN     INT        I     NUMBER OF LINES IN AN EXTENDED FRAME
C                                  OF DATA.
C
C      INCLUDES   SPVAL
C
C   LOCAL PARAMETERS-
C     VARIABLE    TYPE       DEFINITION
C     --------    ----       ----------
C      LINE       INT       DO LOOP COUNTER
C      FIELD      INT       DO LOOP COUNTER
C      CHAN       INT       DO LOOP COUNTER
C      PRM        INT       DO LOOP COUNTER
C
C   SUBPROGRAMS CALLED- CLRBUF
C
C   EXIT STATES- NONE
C
C********************************************************************
C
      INTEGER   BUFLIN,SPOT,CHN,PARM,LINE,FIELD,CHAN,NUMLIN,PRM
      REAL   OVLBUF(SPOT,BUFLIN,CHN),OVLPRM(SPOT,BUFLIN,PARM)
      REAL   FRMBUF(SPOT,NUMLIN,CHN),FRMPRM(SPOT,NUMLIN,PARM)
C
      INCLUDE 'SPVAL'
C
      CALL CLRBUF(FRMBUF,SPOT,NUMLIN,CHN)
      CALL CLRBUF(FRMPRM,SPOT,NUMLIN,PARM)
C
      DO 40,FIELD=1,SPOT
          DO 30, LINE=1,BUFLIN
              DO 10, CHAN=1,CHN
C
C                 READ OVLBUF INTO THE FRMBUF
C
                  FRMBUF(FIELD,LINE,CHAN)=OVLBUF(FIELD,LINE,CHAN)
  10          CONTINUE
              DO 20, PRM=1,PARM
C
C                 READ OVLPRM INTO FRMPRM
C
                  FRMPRM(FIELD,LINE,PRM)=OVLPRM(FIELD,LINE,PRM)
  20          CONTINUE
  30      CONTINUE
  40  CONTINUE
C
      CALL CLRBUF(OVLBUF,SPOT,BUFLIN,CHN)
      CALL CLRBUF(OVLPRM,SPOT,BUFLIN,PARM)
C
      RETURN
      END
