Debian Codegraph @

packages/seacas/applications/genshell/gs_usids.f

raw
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, *)
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 PARAMETER (MAXSET=10)
31
32 INTEGER INTYP(*)
33 CHARACTER*8 CFIELD(*)
34 INTEGER IFIELD(*)
35 INTEGER IDOLD1(*), IDOLD2(*)
36 INTEGER IDNEW(*)
37
38 CHARACTER*5 STRA
39 LOGICAL DUPID
40
41 CALL INIINT (MAXSET, 0, IDNEW)
42 LENNEW = 0
43
44 10 CONTINUE
45 IF (INTYP(IFLD) .GE. -1) THEN
46
47 CALL FFINTG (IFLD, INTYP, IFIELD,
48 & 'set id', 0, ID, *50)
49
50 IF (LENNEW .GE. MAXSET) THEN
51 CALL INTSTR (1, 0, MAXSET, STRA, LSTRA)
52 CALL PRTERR ('CMDERR',
53 & 'Number of IDs must be less than ' // STRA(:LSTRA))
54 GOTO 60
55 END IF
56
57 DUPID = .FALSE.
58 DO 20 I = 1, LOLD1
59 IF (ID .EQ. IDOLD1(I)) DUPID = .TRUE.
60 20 CONTINUE
61 DO 30 I = 1, LOLD2
62 IF (ID .EQ. IDOLD2(I)) DUPID = .TRUE.
63 30 CONTINUE
64 DO 40 I = 1, LENNEW
65 IF (ID .EQ. IDNEW(I)) DUPID = .TRUE.
66 40 CONTINUE
67 IF (DUPID) THEN
68 CALL INTSTR (1, 0, ID, STRA, LSTRA)
69 CALL PRTERR ('CMDWARN',
70 & 'Duplicate ID ' // STRA(:LSTRA) // ' ignored')
71 GOTO 50
72 END IF
73
74 LENNEW = LENNEW + 1
75 IDNEW(LENNEW) = ID
76 50 CONTINUE
77 GOTO 10
78 END IF
79
80 60 CONTINUE
81 RETURN
82 END