!+ Subroutine to find elements of an array exceeding a target.
!
! Method:
!	This subroutine replaces CRAY's own routine on other
!	machines. Elements of the array X are considered to
!	see when they exceed a target. The array INDEX is 
!	returned with the indices of the points satisfying
!	the condition.
!
! Current Owner of Code: J. M. Edwards
!
! History:
!	Version		Date			Comment
!	1.0		12-04-95		First Version under RCS
!						(J. M. Edwards)
!
! Description of Code:
!   FORTRAN 77  with extensions listed in documentation.
!
!- ---------------------------------------------------------------------
      SUBROUTINE WHENFGT(N, X, INC_X, TARGET, INDEX, N_INDEX)
!
!
!
      IMPLICIT NONE
!
!
      INTEGER	!, INTENT(IN)
     &     N
!             SIZE OF INPUT ARRAY
     &   , INC_X
!             STRIDE FOR STEPPING THROUGH ARRAY
      REAL*8	!, INTENT(IN)
     &     X(N)
!             ARRAY TO BE SEARCHED
     &   , TARGET
!             TARGET FOR SEARCHING
!
!
      INTEGER	!, INTENT(OUT)
     &     N_INDEX
!             NUMBER OF INDICES SATISFYING CONDITION
     &   , INDEX(N)
!             INDICES OF POINTS
!
!
!
!     LOCAL VARIABLES:
      INTEGER
     &     I
!             LOOP VARIABLE
!
!
!
!
      N_INDEX=0
      DO I=1, N, INC_X
         IF (X(I).GT.TARGET) THEN
            N_INDEX=N_INDEX+1
            INDEX(N_INDEX)=I
         ENDIF
      ENDDO
!
!
!
      RETURN
      END
