******************************************************************
*
*       TITLE:  DRIVER FOR UNPACKING VOYAGER CR-2 MAG (PLS) EDR
*
*       FILE NAME:  UNPACKCR2.FOR
*     
*       PURPOSE:  TO CALL THE ROUTINES UNPACK THE SUBHEADER (PLS DATA) 
*                  AND UNPACK THE MAG DATA.
*
*       HISTORY:
*
*       AUTHOR               DATE           CHANGE
*       ------               ----           ------
*       S. B. KRAMER       02/01/96         ORIGINAL CODE
*
*       CALLING SEQUENCE:  SUBROUTINE UNPACKCR2 (INBUF)
*
*       MODULES REFERENCED:
*
*          PLSCR2, MAGCR2
*
*       COMMON AREAS:
*
*          SEE UNPACK.INC FOR COMMON AREA DEFINITIONS
*
*       PDL:
*
*          CALL PLSCR2 TO UNPACK THE 66 SUBHEADER PLS DATA WORDS
*          CALL MAGCR2 TO UNPACK THE 1508 MAG DATA WORDS
*          RETURN
*
*******************************************************************
      SUBROUTINE UNPACKCR2(INBUF)
C
      LOGICAL*1 INBUF(11280)
C
      INCLUDE 'UNPACK.INC'
C
C SEPARATE SUB-HEADER (PLASMA) DATA (264 BYTES)
C
      DO 2 I=241,504
         J=I-240
         PLS(J) = INBUF(I)
  2   CONTINUE
C
C SEPARATE MAG SCIENCE BLOCK ( BYTES)
C
      DO 3 I=505,6536
         J=I-504
         MAG(J) = INBUF(I)
  3   CONTINUE
C
      CALL PLSCR2()
      CALL MAGCR2()
C
      RETURN
      END
