Debian Codegraph @

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