C
C SUBROUTINE 'CCPI2I'
C ===================
C
C Copy an array of INTEGER*2 elements into an integer array
C
C (Must be implemented if ccpbyt function returns .TRUE.)
C
      SUBROUTINE CCPI2I(IA,I2,NE,SIGNED,SWAPB)
C
C Parameters
C
C      IA (O)   Array to return INTEGER values
C      I2 (I)   Array holding INTEGER*2 data (may be an INTEGER array for 
C               example with data packed into adjacant INTEGER*2 elements
C      NE (I)   The number of elements to be copied
C  SIGNED (I)   Logical flag =.TRUE.  Copy as signed integer*2 values
C                            =.FALSE. Copy as unsigned integer*2 values
C   SWAPB (I)   Logical flag =.TRUE.  Swap bytes in the integer*2 elements
C                            =.FALSE. Do not swap bytes
C
C ***VAX VERSION***
C
C====== Specification statements
C
      LOGICAL SIGNED, SWAPB
      INTEGER IA(*)
      INTEGER*2 I2(*)
      INTEGER*2 J2(2)
      INTEGER*2 IEIGHT
      EQUIVALENCE (JA,J2(1))
C
C====== Swap bytes if required
C
      IEIGHT = 8
      IF (SWAPB) THEN
         DO 10 I = 1,NE
            I2(I) = IOR(IAND(ISHFT(I2(I),-IEIGHT),255),
     +              ISHFT(I2(I),IEIGHT))
10       CONTINUE
      END IF
C
C====== Copy data
C
      IF (SIGNED) THEN
         DO 20 I=1,NE
            IA(I) = I2(I)
20       CONTINUE
      ELSE
         JA=0
         DO 30 I=1,NE
         J2(1)=I2(I)
         IA(I)=JA
30       CONTINUE
      END IF
      RETURN
      END
