C-------------------------------------------------------------     ************
C                                                                     GATHER
C                                                                  ************
      SUBROUTINE GATHER(N,A,B,INDEX)
C
C     This subroutine collects array elements accessed via an
C         integer pointer to contiguous storage.
C
      INTEGER N,INDEX(1)
      REAL A(1),B(1)

      DO 10 I = 1,N
	A(I) = B(INDEX(I))
   10 CONTINUE

      RETURN
      END

C-------------------------------------------------------------     ************
C                                                                    SCATTER
C                                                                  ************
      SUBROUTINE SCATTER(N,A,INDEX,B)
C
C     This subroutine disperses array elements accessed via an
C         integer pointer from contiguous storage to the appropriate
C         location.
C
      INTEGER N,INDEX(1)
      REAL A(1),B(1)

      DO 10 I = 1,N
	A(INDEX(I)) = B(I)
   10 CONTINUE

      RETURN
      END