NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
isrchne.f
Go to the documentation of this file.
1C> @file
2C> @brief Searches a vector for the first element not equal to a target
3C> @author Stephen Gilbert @date 1999-02-11
4
5C> Program history log:
6C> - Stephen Gilbert 1999-02-11
7C>
8C> @param[in] n Number of elements to be searched.
9C> @param[in] x Real or integer array of dimension (n-1) * |incx| + 1.
10C> Array x contains the vector to be searched.
11C> @param[in] incx Increment between elements of the searched array.
12C> @param[in] target Value for which to search in the array.
13C> @return index Index of the first element equal or not equal to target.
14C> If target is not found, n+1 is returned. If n <= 0, 0 is returned.
15C>
16C> @note This code and documentation was taken directly from the
17C> man page for routine ISRCHNE on a CRAY UNICOS system.
18C>
19C> @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