Debian Codegraph @

packages/seacas/applications/blot/rixid.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 RIXID (INLINE, IFLD, INTYP, CFIELD, IFIELD,
9 & SELMSG, MAXSEL, IDSEL, NUMSEL, IXSEL, *)
10 C=======================================================================
11
12 C --*** RIXID *** (BLOT) Parse selection command
13 C -- Written by Amy Gilkey - revised 05/20/88
14 C --
15 C --RIXID selects the items listed in the command. If there are no
16 C --fields, all the items are selected. If the first field is ADD,
17 C --the items are added to the items already selected, otherwise
18 C --only the listed items are selected.
19 C --
20 C --Parameters:
21 C -- INLINE - IN/OUT - the parsed input line for the log file
22 C -- IFLD - IN/OUT - the free-field reader index
23 C -- INTYP - IN - the free-field reader field types
24 C -- CFIELD - IN - the character fields
25 C -- IFIELD - IN - the integer fields
26 C -- SELMSG - IN - the type of item for error messages
27 C -- MAXSEL - IN - the number of the maximum selected items
28 C -- IDSEL - IN - the IDs of the items to be selected
29 C -- NUMSEL - IN/OUT - the number of selected items; set to zero
30 C -- upon entry unless ADD is the first field
31 C -- IXSEL - IN/OUT - the selected items
32 C -- * - return statement if error before any items selected
33
34 CHARACTER*(*) INLINE
35 INTEGER INTYP(*)
36 CHARACTER*(*) CFIELD(*)
37 INTEGER IFIELD(*)
38 CHARACTER*(*) SELMSG
39 INTEGER IDSEL(*)
40 INTEGER IXSEL(*)
41
42 LOGICAL FFEXST, FFNUMB, FFMATC
43 CHARACTER*80 ERRMSG
44 CHARACTER*8 WORD
45
46 IF (.NOT. (FFEXST (IFLD, INTYP))) THEN
47
48 C --Select all items if no fields
49
50 NUMSEL = MAXSEL
51 DO 100 I = 1, MAXSEL
52 IXSEL(I) = I
53 100 CONTINUE
54
55 ELSE IF (FFMATC (IFLD, INTYP, CFIELD, 'OFF', 3)) THEN
56
57 C --Select no items if OFF
58
59 CALL FFADDC ('OFF', INLINE)
60 NUMSEL = 0
61
62 ELSE
63
64 C --Reset to none selected unless ADD
65
66 IF (FFMATC (IFLD, INTYP, CFIELD, 'ADD', 3)) THEN
67 CALL FFADDC ('ADD', INLINE)
68 ELSE
69 IF (.NOT. FFNUMB (IFLD, INTYP)) THEN
70 ERRMSG =
71 & 'Expected "OFF" or "ADD" or ' // SELMSG // ' range'
72 CALL PRTERR ('CMDERR', ERRMSG(:LENSTR(ERRMSG)))
73 GOTO 130
74 END IF
75 NUMSEL = 0
76 END IF
77
78 110 CONTINUE
79 IF (FFEXST (IFLD, INTYP)) THEN
80
81 C --Scan ID
82
83 CALL FFINTG (IFLD, INTYP, IFIELD,
84 & SELMSG, 0, ID, *120)
85
86 C --Find and store the index of the ID
87
88 IX = LOCINT (ID, MAXSEL, IDSEL)
89
90 IF (IX .LE. 0) THEN
91 CALL INTSTR (1, 0, ID, WORD, LSTR)
92 ERRMSG = SELMSG // ' ' //
93 & WORD(:LSTR) // ' does not exist, ignored'
94 CALL PRTERR ('CMDERR', ERRMSG(:LENSTR(ERRMSG)))
95
96 ELSE IF (LOCINT (IX, NUMSEL, IXSEL) .LE. 0) THEN
97 CALL FFADDI (ID, INLINE)
98 IF (NUMSEL .GE. MAXSEL) THEN
99 ERRMSG = 'Too many ' // SELMSG // 's selected'
100 CALL PRTERR ('CMDERR', ERRMSG(:LENSTR(ERRMSG)))
101 GOTO 120
102 END IF
103
104 NUMSEL = NUMSEL + 1
105 IXSEL(NUMSEL) = IX
106 END IF
107
108 GOTO 110
109 END IF
110
111 120 CONTINUE
112 IF (NUMSEL .EQ. 0) THEN
113 ERRMSG = 'No ' // SELMSG // 's are selected'
114 CALL PRTERR ('CMDWARN', ERRMSG(:LENSTR(ERRMSG)))
115 END IF
116 END IF
117
118 RETURN
119
120 130 CONTINUE
121 RETURN 1
122 END