      SUBROUTINE mmgather(NumMinVols,nobs,maxsize,
     &                    varray,hparray,oarray,isize)
C...................................................................
C                                                                  .
C  Program Name: MMGATHER                 
C                                                                  .
C  SUBROUTINE AHGATHER CREATES AN ARRAY OF SELECTED ELEMENTS OF    .
C  INPUT ARGUMENT "VARRAY".                                        .
C                                                                  .
C...................................................................
C**********************************************************************
C  Data parallel implementation (CM Fortran) : M. Makivic (NPAC)      *
C  Date:       4/94                                                   *
C**********************************************************************

      real RIDICULOUS
      parameter(RIDICULOUS=1.e+16)
      integer nobs,maxsize,NumMinVols
      real,dimension(nobs):: VARRAY 
!hpf$ distribute varray(block)
      real,dimension(NumMinVols,maxsize):: OARRAY
!hpf$ distribute oarray(block,block)
      real,dimension(NumMinVols,maxsize):: HPARRAY
!hpf$ distribute hparray(block,block)
      INTEGER,array(NumMinVols):: ISIZE
!hpf$ distribute isize(block)

      oarray=RIDICULOUS
c      print *, 'inside mmgather'
      forall(igp=1:NumMinVols,isize(igp).gt.0)   
     &oarray(igp,1:isize(igp))=varray(int(hparray(igp,1:isize(igp))))
c      print *, 'finished mmgather'
     
      RETURN
      END
