******************************************************************
*
*       TITLE:  DRIVER FOR UNPACKING VOYAGER CR-5 MAG (PLS) EDR
*
*       FILE NAME:  UNPACKCR5.FOR
*     
*       PURPOSE:  TO CALL THE ROUTINES UNPACK THE SUBHEADER (PLS DATA) 
*                  AND UNPACK THE MAG DATA.
*
*       HISTORY:
*
*       AUTHOR               DATE           CHANGE
*       ------               ----           ------
*       S. B. KRAMER       09/26/94         ORIGINAL CODE
*
*       CALLING SEQUENCE:  SUBROUTINE UNPACKCR5 (INBUF)
*
*       MODULES REFERENCED:
*
*          UNPLS, UNMAG
*
*       COMMON AREAS:
*
*          SEE UNPACK.INC FOR COMMON AREA DEFINITIONS
*
*       PDL:
*
*          CALL UNPLS TO UNPACK THE 322 SUBHEADER PLS DATA WORDS
*          CALL UNMAG TO UNPACK THE 1080 MAG DATA WORDS
*          RETURN
*
*******************************************************************
      SUBROUTINE UNPACKCR5(INBUF)
C
      LOGICAL*1 INBUF(11280)
C
      INCLUDE 'UNPACK.INC'
C
C SEPARATE SUB-HEADER (PLASMA) DATA (1288 BYTES)
C
      DO 2 I=241,1528
         J=I-240
         PLS(J) = INBUF(I)
  2   CONTINUE
C
C SEPARATE MAG SCIENCE BLOCK (4320 BYTES)
C
      DO 3 I=1529,5848
         J=I-1528
         MAG(J) = INBUF(I)
  3   CONTINUE
C
      CALL PLSCR5()
      CALL MAGCR5()
C
      RETURN
      END
