NCEPLIBS-w3emc  2.11.0
isrchne.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Searches a vector for the first element not equal to a target
3 C> @author Stephen Gilbert @date 1999-02-11
4 
5 C> Program history log:
6 C> - Stephen Gilbert 1999-02-11
7 C>
8 C> @param[in] n Number of elements to be searched.
9 C> @param[in] x Real or integer array of dimension (n-1) * |incx| + 1.
10 C> Array x contains the vector to be searched.
11 C> @param[in] incx Increment between elements of the searched array.
12 C> @param[in] target Value for which to search in the array.
13 C> @return index Index of the first element equal or not equal to target.
14 C> If target is not found, n+1 is returned. If n <= 0, 0 is returned.
15 C>
16 C> @note This code and documentation was taken directly from the
17 C> man page for routine ISRCHNE on a CRAY UNICOS system.
18 C>
19 C> @author Stephen Gilbert @date 1999-02-11
20  FUNCTION isrchne(N,X,INCX,TARGET)
21  INTEGER x(*), target
22  j=1
23  isrchne=0
24  IF(n.LE.0) RETURN
25  IF(incx.LT.0) j=1-(n-1)*incx
26  DO 100 i=1,n
27  IF(x(j).NE.TARGET) GO TO 200
28  j=j+incx
29  100 CONTINUE
30  200 isrchne=i
31  RETURN
32  END
function isrchne(N, X, INCX, TARGET)
Program history log:
Definition: isrchne.f:21