| 1 |
C Copyright(C) 1999-2020 National Technology & Engineering Solutions |
| 2 |
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 3 |
C NTESS, the U.S. Government retains certain rights in this software. |
| 4 |
C |
| 5 |
C See packages/seacas/LICENSE for details |
| 6 |
|
| 7 |
C======================================================================= |
| 8 |
INTEGER FUNCTION LOCINT (INT, LENLST, INTLST) |
| 9 |
C======================================================================= |
| 10 |
|
| 11 |
C --*** LOCINT *** (ETCLIB) Find integer in list |
| 12 |
C -- Written by Amy Gilkey - revised 11/10/87 |
| 13 |
C -- |
| 14 |
C --LOCINT returns the index of the given integer in a list of integers. |
| 15 |
C --If the integer is not in the list, returns 0. |
| 16 |
C -- |
| 17 |
C --Parameters: |
| 18 |
C -- INT - IN - the integer to be searched for |
| 19 |
C -- LENLST - IN - the number of integers in the list |
| 20 |
C -- INTLST - IN - the list of integers to be searched |
| 21 |
|
| 22 |
INTEGER INT |
| 23 |
INTEGER LENLST |
| 24 |
INTEGER INTLST(LENLST) |
| 25 |
|
| 26 |
DO I = 1, LENLST |
| 27 |
IF (INT .EQ. INTLST(I)) GOTO 20 |
| 28 |
END DO |
| 29 |
I = 0 |
| 30 |
|
| 31 |
20 CONTINUE |
| 32 |
LOCINT = I |
| 33 |
RETURN |
| 34 |
END |