Debian Codegraph @

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