Debian Codegraph @

packages/seacas/applications/blot/dispv.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 DISPV (INIT, INLINE, IFLD, INTYP, CFIELD,
9 & NAMES, LIDSP, NAMLEN)
10 C============================================================================
11
12 C --*** DISPV *** (BLOT) Process DISPVAR command
13 C -- Written by John Glick - 11/1/88
14 C --
15 C --Parameters:
16 C -- INIT - IN - .TRUE. iff the purpose of the call is to
17 C -- initialize the list of display variables and
18 C -- not to modify it.
19 C -- INLINE - IN/OUT - the parsed input lines for the log file
20 C -- IFLD, INTYP, CFIELD, - IN/OUT - the free-field reader index
21 C -- and character field.
22 C -- NAMES - IN - the variable names
23 C -- LIDSP(0:*) - IN/OUT - the indices of the selected variables
24 C -- whose values will be displayed on the plot legend.
25 C -- ABS(LIDSP(0)) = the number of variables in the list.
26 C -- SIGN(LIDSP(0)) specifies whether the variables in the
27 C -- list should have their values displayed on
28 C -- the plot legend. If >0, they should;
29 C -- If <=0, they should not.
30 C -- LIDSP(i) identifies the ith variable in the list.
31 C -- If LIDSP(i) < 0, -LIDSP(i) is the id of a global variable.
32 C -- If LIDSP(i) = 0, TIME is to be displayed on the plot legend.
33
34 include 'params.blk'
35 LOGICAL INIT
36 CHARACTER*(*) INLINE(*)
37 INTEGER IFLD, INTYP(*)
38 CHARACTER*(*) CFIELD(*)
39 CHARACTER*(NAMLEN) NAMES(*)
40 INTEGER LIDSP(0:*)
41
42 include 'dbnums.blk'
43 include 'dbnumgq.blk'
44
45 LOGICAL FFMATC
46
47 C *****************************************************************
48
49 C Check that database is in the EXODUS format
50
51 CALL CKEXOD (EXODUS, *140)
52 CALL DBVIX_BL ('G', 1, IXGL)
53
54 IF (INIT) THEN
55
56 LIDSP(0) = 1
57 LIDSP(1) = 0
58
59 ELSE
60
61 C If there are no fields on the DISPV command line,
62 C toggle the ON/OFF flag.
63
64 IF (INTYP(IFLD) .LE. -1) THEN
65 LIDSP(0) = -LIDSP(0)
66
67 C Check for ON flag.
68
69 ELSE IF (FFMATC (IFLD, INTYP, CFIELD, 'ON', 2)) THEN
70 LIDSP(0) = ABS(LIDSP(0))
71 CALL FFADDC ('ON', INLINE(1))
72
73 C Check for OFF flag.
74
75 ELSE IF (FFMATC (IFLD, INTYP, CFIELD, 'OFF', 3)) THEN
76 LIDSP(0) = - ABS(LIDSP(0))
77 CALL FFADDC ('OFF', INLINE(1))
78
79 C Check for ALL parameter
80
81 ELSE IF (FFMATC (IFLD, INTYP, CFIELD, 'ALL', 3)) THEN
82 LIDSP(0) = NVARGL
83 LIDSP(1) = 0
84 DO 110 I = 1, NVARGL
85 LIDSP(I) = -I
86 110 CONTINUE
87 CALL FFADDC ('ALL', INLINE(1))
88
89 ELSE
90
91 C Temporarily convert existing list to a list
92 C containing all positive integers.
93
94 LIDSP(0) = ABS(LIDSP(0))
95 DO 120 I = 1, LIDSP(0)
96 IF (LIDSP(I) .EQ. 0) THEN
97 LIDSP(I) = 1
98 ELSE IF (LIDSP(I) .LT. 0) THEN
99 LIDSP(I) = 1 - LIDSP(I)
100 ENDIF
101 120 CONTINUE
102
103 C Get list of selected variables
104 CALL RIXWRD (INLINE(1), IFLD, INTYP, CFIELD,
105 & 'display variable name', NVARGL, NAMES(IXGL),
106 & LIDSP(0), LIDSP(1), *140)
107
108 C Convert the list back to the proper format.
109
110 DO 130 I = 1, LIDSP(0)
111 LIDSP(I) = LIDSP(I) + 1
112 IF (LIDSP(I) .LE. 1) THEN
113 LIDSP(I) = LIDSP(I) - 1
114 ELSE
115 LIDSP(I) = -(LIDSP(I) - 1)
116 ENDIF
117 130 CONTINUE
118
119 ENDIF
120
121 ENDIF
122 GO TO 150
123
124 140 CONTINUE
125 INLINE(1) = ' '
126
127 150 CONTINUE
128 RETURN
129 END