| 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 |
SUBROUTINE USIDS (IFLD, INTYP, CFIELD, IFIELD, |
| 9 |
& LOLD1, IDOLD1, LOLD2, IDOLD2, LENNEW, IDNEW, MAXSET, *) |
| 10 |
C======================================================================= |
| 11 |
|
| 12 |
C --*** USIDS *** (GEN3D) Read list of IDs |
| 13 |
C -- Written by Amy Gilkey - revised 05/21/86 |
| 14 |
C -- |
| 15 |
C --USIDS processes a list of IDs. The ID list is checked for |
| 16 |
C --repetitions with the existing list and with itself. Repetitions |
| 17 |
C --are flagged with an error message and ignored. |
| 18 |
C -- |
| 19 |
C --Parameters: |
| 20 |
C -- IFLD - IN/OUT - the free-field index |
| 21 |
C -- INTYP - IN - the free-field type |
| 22 |
C -- CFIELD - IN - the free-field characters |
| 23 |
C -- IFIELD - IN - the free-field integers |
| 24 |
C -- LOLD1, LOLD2 - IN - the length of the existing IDs |
| 25 |
C -- IDOLD1, IDOLD2 - IN - the existing IDs |
| 26 |
C -- LENNEW - OUT - the length of the returned IDs |
| 27 |
C -- IDNEW - OUT - the returned IDs |
| 28 |
C -- * - return statement iff serious error |
| 29 |
|
| 30 |
INTEGER INTYP(*) |
| 31 |
CHARACTER*8 CFIELD(*) |
| 32 |
INTEGER IFIELD(*) |
| 33 |
INTEGER IDOLD1(*), IDOLD2(*) |
| 34 |
INTEGER IDNEW(*) |
| 35 |
|
| 36 |
CHARACTER*5 STRA |
| 37 |
LOGICAL DUPID |
| 38 |
|
| 39 |
CALL INIINT (MAXSET, 0, IDNEW) |
| 40 |
LENNEW = 0 |
| 41 |
|
| 42 |
10 CONTINUE |
| 43 |
IF (INTYP(IFLD) .GE. -1) THEN |
| 44 |
|
| 45 |
CALL FFINTG (IFLD, INTYP, IFIELD, |
| 46 |
& 'set id', 0, ID, *50) |
| 47 |
|
| 48 |
IF (LENNEW .GE. MAXSET) THEN |
| 49 |
CALL INTSTR (1, 0, MAXSET, STRA, LSTRA) |
| 50 |
CALL PRTERR ('CMDERR', |
| 51 |
& 'Number of IDs must be less than ' // STRA(:LSTRA)) |
| 52 |
GOTO 60 |
| 53 |
END IF |
| 54 |
|
| 55 |
DUPID = .FALSE. |
| 56 |
DO 20 I = 1, LOLD1 |
| 57 |
IF (ID .EQ. IDOLD1(I)) DUPID = .TRUE. |
| 58 |
20 CONTINUE |
| 59 |
DO 30 I = 1, LOLD2 |
| 60 |
IF (ID .EQ. IDOLD2(I)) DUPID = .TRUE. |
| 61 |
30 CONTINUE |
| 62 |
DO 40 I = 1, LENNEW |
| 63 |
IF (ID .EQ. IDNEW(I)) DUPID = .TRUE. |
| 64 |
40 CONTINUE |
| 65 |
IF (DUPID) THEN |
| 66 |
CALL INTSTR (1, 0, ID, STRA, LSTRA) |
| 67 |
CALL PRTERR ('CMDWARN', |
| 68 |
& 'Duplicate ID ' // STRA(:LSTRA) // ' ignored') |
| 69 |
GOTO 50 |
| 70 |
END IF |
| 71 |
|
| 72 |
LENNEW = LENNEW + 1 |
| 73 |
IDNEW(LENNEW) = ID |
| 74 |
50 CONTINUE |
| 75 |
GOTO 10 |
| 76 |
END IF |
| 77 |
|
| 78 |
60 CONTINUE |
| 79 |
RETURN |
| 80 |
END |