Debian Codegraph @

packages/seacas/applications/blot/rxinta.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 RXINTA (INLINE, IFLD, INTYP, CFIELD, IFIELD,
9 & SELMSG, MAXSEL, NUMSEL, IXSEL, MAP, *)
10 C=======================================================================
11
12 C --*** RXINTA *** (BLOT) Alternate parse selection command
13 C -- John Glick - 10/28/88
14 C --
15 C --RXINTA 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, the
17 c --items are added to the items already selected, otherwise only the
18 C --listed items are selected. This routine behaves nearly like
19 C --the RIXINT routine in the RIXINT library. The only difference
20 C --is that duplicate items in IXSEL are eliminated only if they
21 C --would be adjacent in the array.
22 C --
23 C --Parameters:
24 C -- INLINE - IN/OUT - the parsed input line for the log file
25 C -- IFLD - IN/OUT - the free-field reader index
26 C -- INTYP - IN - the free-field reader field types
27 C -- CFIELD - IN - the character fields
28 C -- IFIELD - IN - the integer fields
29 C -- SELMSG - IN - the type of item for error messages
30 C -- MAXSEL - IN - the number of the maximum selected items
31 C -- NUMSEL - IN/OUT - the number of selected items; set to zero
32 C -- upon entry unless ADD is the first field
33 C -- IXSEL - IN/OUT - the selected items
34 C -- * - return statement if error before any items selected
35
36 CHARACTER*(*) INLINE
37 INTEGER INTYP(*)
38 CHARACTER*(*) CFIELD(*)
39 INTEGER IFIELD(*)
40 CHARACTER*(*) SELMSG
41 INTEGER IXSEL(*)
42 INTEGER MAP(*)
43
44 LOGICAL FFEXST, FFNUMB, FFMATC
45 CHARACTER*80 ERRMSG
46 CHARACTER*32 ISTR
47 INTEGER IRNG(3)
48
49 IF (.NOT. (FFEXST (IFLD, INTYP))) THEN
50
51 C --Select all items if no fields
52
53 NUMSEL = MAXSEL
54 DO 100 I = 1, MAXSEL
55 IXSEL(I) = I
56 100 CONTINUE
57
58 ELSE IF (FFMATC (IFLD, INTYP, CFIELD, 'OFF', 3)) THEN
59
60 C --Select no items if OFF
61
62 CALL FFADDC ('OFF', INLINE)
63 NUMSEL = 0
64
65 ELSE
66
67 C --Reset to none selected unless ADD
68
69 IF (FFMATC (IFLD, INTYP, CFIELD, 'ADD', 3)) THEN
70 CALL FFADDC ('ADD', INLINE)
71 ELSE
72 IF (.NOT. FFNUMB (IFLD, INTYP)) THEN
73 ERRMSG =
74 & 'Expected "OFF" or "ADD" or ' // SELMSG // ' range'
75 CALL PRTERR ('CMDERR', ERRMSG(:LENSTR(ERRMSG)))
76 GOTO 140
77 END IF
78 NUMSEL = 0
79 END IF
80
81 110 CONTINUE
82 IF (FFEXST (IFLD, INTYP)) THEN
83
84 C --Scan numeric range
85
86 CALL FFVRNG (IFLD, INTYP, CFIELD, IFIELD,
87 & SELMSG, -MAXSEL, IRNG, *130)
88 CALL FFADDV (IRNG, INLINE)
89
90 C --Store the range selected
91
92 DO 120 ID = IRNG(1), IRNG(2), IRNG(3)
93 C ... See if a node/element with id 'I' exists in map.
94 C Store the index of where this occurs.
95 I = LOCINT(ID, MAXSEL, MAP)
96
97 if (I .eq. 0) then
98 call intstr(1, -1, ID, ISTR, LSTR);
99 ERRMSG = 'No ' // SELMSG // ' with id equal '
100 * // ISTR(:LSTR) // ' found.'
101 ELSE
102 IF (NUMSEL .EQ. 0 .OR.
103 & LOCINT(ID, NUMSEL, IXSEL) .NE. NUMSEL) THEN
104 IF (NUMSEL .GE. MAXSEL) THEN
105 ERRMSG = 'Too many ' // SELMSG // 's selected'
106 CALL PRTERR ('CMDERR', ERRMSG(:LENSTR(ERRMSG)))
107 GOTO 130
108 END IF
109
110 NUMSEL = NUMSEL + 1
111 IXSEL(NUMSEL) = I
112 END IF
113 END IF
114 120 CONTINUE
115
116 GOTO 110
117 END IF
118
119 130 CONTINUE
120 IF (NUMSEL .EQ. 0) THEN
121 ERRMSG = 'No ' // SELMSG // 's are selected'
122 CALL PRTERR ('CMDWARN', ERRMSG(:LENSTR(ERRMSG)))
123 END IF
124 END IF
125
126 RETURN
127
128 140 CONTINUE
129 RETURN 1
130 END