Debian Codegraph @

packages/seacas/applications/blot/spplt1.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 SPPLT1 (A, NEUTRL, IPTIMS, TIMES, IDTIME,
9 & N, OVER, NCRV, NUMCRV,
10 & NENUM, DIST, PLTVAL, TXLAB, TYLAB, NAMES,
11 & NNE, ISEGEL, NPDON, NPTOT, LIDSP, BLKCOL,
12 * MAPEL, MAPND, *)
13 C=======================================================================
14
15 C --*** SPPLT1 *** (SPLOT) Plot the curve for a time and a variable
16 C -- Modified by John Glick - 11/4/88
17 C -- Written by Amy Gilkey - revised 01/22/88
18 C --
19 C --SPPLT1 plots the curve requested for a single time step and for
20 C --a single variable, it assumes that the X axis (and possibly the Y
21 C --axis) has been scaled.
22 C --
23 C --Parameters:
24 C -- A - IN - the dynamic memory base array
25 C -- NEUTRL - IN - the type of neutral file to write.
26 C -- IPTIMS - IN - the selected time steps
27 C -- TIMES - IN - the database times
28 C -- IDTIME - IN - the id in the IPTIMS array identifying the
29 C -- timeplane of the time being plotted.
30 C -- N - IN - the curve variable number
31 C -- OVER - IN - true iff the curve is overlaid
32 C -- NCRV - IN - the curve number
33 C -- NUMCRV - IN - true iff the curve limits needs to be numbered
34 C -- NENUM - IN - the selected node/element numbers
35 C -- DIST - IN - the plot distances (compressed)
36 C -- PLTVAL - IN - the plot data for this curve (compressed)
37 C -- TXLAB, TYLAB - IN - the X and Y axis labels (scratch for neutral file)
38 C -- NAMES - IN - the variable names
39 C -- NNE - IN - the number of selected nodes/elements with defined values
40 C -- ISEGEL - IN - the NENUM indices of the defined elements
41 C -- (only if NNE < NNENUM)
42 C -- NPDON - IN - the current plot number (only if OVER)
43 C -- NPTOT - IN - the total number of plots (only if OVER)
44 C -- LIDSP(0:*) - IN - the indices of the selected variables
45 C -- whose values will be displayed on the plot legend.
46 C -- LIDSP(0) = the number of variables in the list.
47 C -- LIDSP(i) identifies the ith variable in the list.
48 C -- If LIDSP(i) > 0, LIDSP(i) is the id of a history variable.
49 C -- If LIDSP(i) < 0, -LIDSP(i) is the id of a global variable.
50 C -- If LIDSP(i) = 0, TIME is to be displayed on the plot legend
51 C -- BLKCOL - IN/OUT - the user selected colors of the element blocks.
52 C -- BLKCOL(0) = 1 if the user defined material
53 C -- colors should be used in mesh plots.
54 C -- = -1 if program selected colors should
55 C -- be used.
56 C -- BLKCOL(i) = the user selected color of element
57 C -- block i:
58 C -- -2 - no color selected by user.
59 C -- -1 - black
60 C -- 0 - white
61 C -- 1 - red
62 C -- 2 - green
63 C -- 3 - yellow
64 C -- 4 - blue
65 C -- 5 - cyan
66 C -- 6 - magenta
67 C -- * - return statement if cancel or quit
68 C --
69 C --Common Variables:
70 C -- Uses NNENUM of /SELNE/
71 C -- Uses NSPVAR of /SPVARS/
72 C -- Uses DOGRID, LINTYP, ISYTYP, LABSID of /XYOPT/
73 C -- Uses IYSCAL of /XYLIM/
74 C -- Sets YMIN, YMAX of /XYLIM/
75
76 include 'params.blk'
77 include 'neutral.blk'
78 include 'dbnums.blk'
79 include 'xyopt.blk'
80 include 'selne.blk'
81 include 'spvars.blk'
82 include 'xylim.blk'
83
84 DIMENSION A(*)
85 INTEGER IPTIMS(*)
86 REAL TIMES(*)
87 INTEGER IDTIME
88 LOGICAL OVER
89 LOGICAL NUMCRV
90 INTEGER NENUM(NNENUM)
91 REAL DIST(NNENUM)
92 REAL PLTVAL(NNENUM)
93 CHARACTER*(*) TXLAB, TYLAB
94 CHARACTER*(*) NAMES(*)
95 INTEGER ISEGEL(*)
96 INTEGER LIDSP(0:*)
97 INTEGER BLKCOL(0:NELBLK)
98 INTEGER MAPEL(*), MAPND(*)
99
100 LOGICAL GRABRT
101 CHARACTER*80 PLTITL
102
103 C --Calculate min/max if needed
104
105 IF (IYSCAL .EQ. 'CURVE') THEN
106 CALL MINMAX (NNE, PLTVAL, YMIN, YMAX)
107 IF (NEUTRL .EQ. 0)
108 * CALL EXPMAX (' ', YMIN, YMAX)
109 END IF
110 IF (OVER) THEN
111 IF (IYSCAL .EQ. 'CURVE')
112 & CALL XYAXIS (NCRV, DOGRID, TXLAB, TYLAB, BLKCOL, *120)
113 END IF
114
115 IF (NEUTRL .EQ. CSV) THEN
116 CALL prterr('CMDREQ','CSV neutral format not yet '//
117 $ 'supported for SPLOT.')
118 return 1
119 END IF
120
121 IF (NEUTRL .EQ. 0) THEN
122
123 C --Label plot if needed
124
125 100 CONTINUE
126 IF (.NOT. OVER) THEN
127 CALL SPLAB (A, 1, IPTIMS(IDTIME), TIMES,
128 & NENUM, N, 1, NUMCRV, NAMES,
129 & TXLAB, TYLAB, LIDSP, BLKCOL, MAPEL, MAPND, *120)
130 CALL XYAXIS (0, DOGRID, TXLAB, TYLAB, BLKCOL, *120)
131 END IF
132
133 IF (GRABRT()) RETURN 1
134
135 IF (OVER) THEN
136 CALL GRCOLR (NCRV)
137 CALL GRSYMB (LINTYP, ISYTYP, NCRV)
138 ELSE
139 CALL GRCOLR (1)
140 CALL GRSYMB (LINTYP, ISYTYP, 1)
141 END IF
142
143 IF (GRABRT()) RETURN 1
144
145 C --Plot variable against distances
146
147 IEND = 0
148 110 CONTINUE
149 IF (IEND .LT. NNE) THEN
150 IF (NNE .LT. NNENUM) THEN
151 CALL SPSEGM (NNE, ISEGEL, ISTART, IEND)
152 ELSE
153 ISTART = 1
154 IEND = NNENUM
155 END IF
156 NLEFT = IEND - ISTART + 1
157 CALL PLTCUR (DIST(ISTART), PLTVAL(ISTART), NLEFT)
158 GOTO 110
159 END IF
160
161 IF (NUMCRV) THEN
162 IF (GRABRT()) RETURN 1
163 CALL GRNCRV (LABSID, NCRV, NNE, DIST, PLTVAL,
164 & (LINTYP .EQ. 0))
165 END IF
166
167 C --Finish plot
168
169 IF (OVER) CALL PLTFLU
170 IF (.NOT. OVER) THEN
171 C --Set color in case text is requested
172 CALL UGRCOL (0, BLKCOL)
173 CALL GRPEND (.TRUE., .TRUE., NPDON, NPTOT, .FALSE.,
174 * *100, *120)
175 END IF
176
177 ELSE
178
179 C --Get plot labels
180
181 CALL SPLABN (N, TIMES(IPTIMS(IDTIME)), NENUM, NAMES,
182 & PLTITL, TXLAB, TYLAB, MAPEL, MAPND)
183
184 C --Plot variable against distances
185
186 IF (NEUTRL .EQ. XMGR) THEN
187 CALL WRTNEU (NNE, DIST, PLTVAL, PLTITL, TXLAB, TYLAB)
188 ELSE IF (NEUTRL .EQ. GRAF) THEN
189 CALL GRFNEU (NNE, DIST, PLTVAL, PLTITL, TXLAB, TYLAB)
190 ELSE IF (NEUTRL .EQ. CSV .or. NEUTRL .EQ. XML) THEN
191 CALL prterr('CMDREQ','CSV neutral format not yet '//
192 $ 'supported for SPLOT.')
193 END IF
194 END IF
195
196 RETURN
197
198 120 CONTINUE
199 RETURN 1
200 END