Debian Codegraph @

packages/seacas/applications/blot/plcomd.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 PLCOMD (A, CURPRO, XYTYPE, MESHOK, INLINE,
9 & INVERB, IFLD, INTYP, CFIELD, IFIELD, RFIELD,
10 & TIMES, WHOTIM, IPTIMS)
11 C=======================================================================
12
13 C --*** PLCOMD *** (BLOT) Process general graphics commands
14 C -- Written by Amy Gilkey - revised 04/26/88
15 C --
16 C --PLCOMD interprets general graphics commands.
17 C --
18 C --The commands are listed below with their parameters and their
19 C --function.
20 C --
21 C --Time step control
22 C -- TMIN {tmin} Set minimum selected time
23 C -- TMAX {tmax} Set maximum selected time
24 C -- DELTIME {delt} Set selected time interval
25 C -- NINTV {nintv} Change selected time interval
26 C -- ZINTV {nintv} Change selected time interval (zero interval)
27 C -- ALLTIMES Select all times
28 C -- TIMES {t1,t2...} Select specified times
29 C -- STEPS {n1,n2...} Select specified steps
30 C -- HISTORY {ON/OFF} Allow history steps to be selected
31 C --
32 C --Display control
33 C -- QA {ON/OFF} Set plot QA information on label flag
34 C -- AXIS {ON/OFF} Set axis numbering flag
35 C -- LEGEND {ON/OFF} Set legend information on label flag
36 C -- CAPTION {line_number} Set plot caption (on following lines)
37 C -- SOFTCHAR {ON/OFF,device} Select software or hardware characters
38 C -- FONT {STICK/SANSERIF/ROMAN,device} Set font
39 C -- COLOR {numcol} Set number of colors
40 C -- SPECTRUM {numcol} Set number of spectrum colors
41 C -- SNAP {nsnap,device} Set number of frames to snap for movies
42 C -- AUTO {ON/OFF,device} Select automatic or user-directed plotting
43 C --
44 C --Display
45 C -- reset Reset default conditions
46 C -- postplot Initialize after plot
47 C -- initprog Initialize for program change
48 C -- initres Initialize for program change and reset
49 C -- postinit Initialize for program change (second pass)
50 C --
51 C --Information
52 C -- show {option} Display program information (based on type)
53 C -- help {option} Display system dependent HELP
54 C --
55 C --Parameters:
56 C -- A - IN - the dynamic memory base array
57 C -- CURPRO - IN - the current program name
58 C -- XYTYPE - IN - true iff current program is an XY curve versus mesh plot
59 C -- MESHOK - IN - true iff mesh can be displayed
60 C -- INLINE - IN/OUT - the parsed input lines for the log file
61 C -- INVERB - IN/OUT - the command verb
62 C -- IFLD, INTYP, CFIELD, IFIELD, RFIELD - IN/OUT - the free-field
63 C -- reader index and fields
64 C -- TIMES - IN - the database times
65 C -- WHOTIM - IN - true iff whole (versus history) time step
66 C -- IPTIMS - IN/OUT - the selected time steps
67 C --
68 C --Common Variables:
69 C -- Uses NSTEPS of /DBNUMS/
70 C -- Sets DOQA, DOLEG, DOAXIS, CAPTN of /LEGOPT/
71 C -- Sets and uses NPTIMS, NPTIMW, TMIN, TMAX, DELT, NINTV, NTIMIN,
72 C -- WHONLY, HISTOK of /TIMES/
73
74 EXTERNAL BLKDAT
75
76 include 'params.blk'
77 include 'dbnums.blk'
78 include 'times.blk'
79 include 'legopt.blk'
80 include 'icrnbw.blk'
81
82 DIMENSION A(*)
83 CHARACTER*(*) CURPRO
84 LOGICAL XYTYPE, MESHOK
85 CHARACTER*(*) INLINE(*)
86 CHARACTER*(*) INVERB
87 INTEGER INTYP(*)
88 CHARACTER*(*) CFIELD(*)
89 INTEGER IFIELD(*)
90 REAL RFIELD(*)
91 REAL TIMES(*)
92 LOGICAL WHOTIM(*)
93 INTEGER IPTIMS(*)
94
95 CHARACTER*(MXSTLN) VERB
96 C --VERB - the command verb used in the SHOW
97
98 CHARACTER*(MXSTLN) WORD
99 LOGICAL HELP
100 LOGICAL ISON
101
102 LOGICAL FIRST
103 SAVE FIRST
104 C --FIRST - true iff first time through routine
105
106 CHARACTER*(MXSTLN) CMDTBL(24)
107 SAVE CMDTBL
108 C --CMDTBL - the command table
109
110 DATA FIRST /.TRUE./
111
112 C --Command table follows. The table is ended by a blank entry.
113 C --Remember to change the dimensioned size when changing the table.
114 DATA (CMDTBL(I),I=1,10) /
115 1 'TMIN ',
116 * 'TMAX ',
117 * 'DELTIME ',
118 * 'NINTV ',
119 * 'ZINTV ',
120 2 'ALLTIMES ',
121 * 'TIMES ',
122 * 'STEPS ',
123 * 'HISTORY ',
124 3 'QA '/
125
126 DATA (CMDTBL(I),I=11,20) /
127 * 'AXIS ',
128 * 'LEGEND ',
129 * 'CAPTION ',
130 * 'OUTLINE ',
131 4 'SOFTCHARACTERS ',
132 * 'FONT ',
133 * 'COLOR ',
134 * 'SPECTRUM ',
135 * 'SNAP ',
136 5 'AUTO '/
137
138 DATA (CMDTBL(I),I=21,24) /
139 * 'BACKGROUND ',
140 * 'FOREGROUND ',
141 * 'RAINBOW ',
142 6 ' ' /
143
144 C --Get the command verb
145
146 WORD = INVERB
147 CALL ABRSTR (VERB, WORD, CMDTBL)
148 IF (VERB .EQ. ' ') VERB = WORD
149
150 C *** Initialization ***
151
152 IF ((VERB .EQ. 'postplot') .OR. (VERB .EQ. 'initprog')
153 & .OR. (VERB .EQ. 'initres') .OR. (VERB .EQ. 'reset')
154 & .OR. (VERB .EQ. 'postinit')) THEN
155 INVERB = VERB
156
157 C --Initialize parameters first time through, then reset
158
159 IF (FIRST) THEN
160
161 C --Set default time step selection to 10 times with delta interval
162 HISTOK = .FALSE.
163 WHONLY = .NOT. HISTOK
164 NTIMIN = 10
165
166 C --Set to one time step if no time steps
167 IF (NSTEPS .LE. 0) THEN
168 TIMES(1) = 0.0
169 WHOTIM(1) = .TRUE.
170 NPTIMS = 1
171 NPTIMW = 1
172 IPTIMS(1) = 1
173 DELT = 0.0
174 NINTV = 1
175 END IF
176
177 VERB = 'initres'
178 END IF
179
180 C --Initialize for program change
181
182 IF (VERB .EQ. 'initprog') THEN
183
184 C --Change the time step selection when 'postinit'
185
186 C --Set display options
187
188 C --DOQA, DOAXIS, and DOLEG are not changed
189
190 c CALL INISTR (3, ' ', CAPTN(1,1))
191 c CALL INISTR (3, ' ', CAPTN(1,2))
192 END IF
193
194 C --Initialize for program change or program reset (part 2)
195
196 IF (VERB .EQ. 'postinit') THEN
197
198 C --Set time step selection to selected default
199
200 WHONLY = .NOT. HISTOK
201 IF (NSTEPS .GT. 0) THEN
202 IF ((.NOT. WHONLY) .OR. (NSTEPW .GT. 0)) THEN
203 CALL INITIM (NTIMIN, WHONLY, NSTEPS, TIMES, WHOTIM,
204 & TMIN, TMAX, DELT, NINTV, NPTIMS, IPTIMS)
205 NPTIMW = NWHSEL (NPTIMS, IPTIMS, WHOTIM)
206 ELSE
207 NPTIMS = 1
208 NPTIMW = 1
209 IPTIMS(1) = 1
210 DELT = 0.0
211 NINTV = 1
212 END IF
213 END IF
214 END IF
215
216 C --Reset parameters
217
218 IF ((VERB .EQ. 'reset') .OR. (VERB .EQ. 'initres')) THEN
219
220 C --Change the time step selection when 'postinit'
221
222 C --Set time step selection according to default
223
224 C --Set display options
225
226 DOQA(1) = .TRUE.
227 DOQA(2) = .TRUE.
228 DOAXIS(1) = (NDIM .LE. 2)
229 DOAXIS(2) = .TRUE.
230 DOLEG(1) = .TRUE.
231 DOLEG(2) = .TRUE.
232 DOBOX = .TRUE.
233
234 if (verb .EQ. 'reset') then
235 CALL INISTR (3, ' ', CAPTN(1,1))
236 CALL INISTR (3, ' ', CAPTN(1,2))
237 end if
238
239 C reset background color
240
241 CALL SETBCK (3, INLINE, IFLD, INTYP, CFIELD, *100)
242
243 C reset foreground color
244
245 CALL SETFOR (2, INLINE, IFLD, INTYP, CFIELD, *100)
246
247 FIRST = .FALSE.
248 END IF
249
250 C --Initialize for new plot set
251
252 IF (VERB .EQ. 'postplot') THEN
253 CONTINUE
254 END IF
255
256 IF (VERB .NE. 'postplot') THEN
257 CONTINUE
258 END IF
259
260 VERB = ' '
261
262 C *** Time step control ***
263
264 ELSE IF ((VERB .EQ. 'TMIN') .OR. (VERB .EQ. 'TMAX')
265 & .OR. (VERB .EQ. 'DELTIME')
266 & .OR. (VERB .EQ. 'NINTV') .OR. (VERB .EQ. 'ZINTV')
267 & .OR. (VERB .EQ. 'ALLTIMES')
268 & .OR. (VERB .EQ. 'TIMES') .OR. (VERB .EQ. 'STEPS')) THEN
269 INVERB = ' '
270 CALL CKNONE (NSTEPS, .FALSE., 'time steps', *100)
271 IF (WHONLY) THEN
272 CALL CKNONE (NSTEPW, .FALSE., 'whole time steps', *100)
273 END IF
274
275 CALL CMDTIM (INLINE,
276 & VERB, IFLD, INTYP, CFIELD, IFIELD, RFIELD,
277 & NSTEPS, TIMES, WHOTIM,
278 & WHONLY, TMIN, TMAX, DELT, NINTV, NPTIMS, IPTIMS)
279 NPTIMW = NWHSEL (NPTIMS, IPTIMS, WHOTIM)
280
281 ELSE IF (VERB .EQ. 'HISTORY') THEN
282 CALL FFADDC (VERB, INLINE(1))
283 INVERB = ' '
284 CALL CKNONE (NSTEPS, .FALSE., 'time steps', *100)
285 IF (.NOT. HISTOK) THEN
286 CALL PRTERR ('CMDERR',
287 & 'History time steps cannot be referenced'
288 & // ' by this subprogram')
289 GOTO 100
290 END IF
291
292 CALL FFONOF (IFLD, INTYP, CFIELD, ISON, *100)
293 CALL FFADDO (ISON, INLINE(1))
294 WHONLY = .NOT. ISON
295
296 IF ((.NOT. WHONLY) .OR. (NSTEPW .GT. 0)) THEN
297 NPTIMS = -999
298 CALL CALTIM (WHONLY, TMIN, TMAX, DELT, NINTV,
299 & NSTEPS, TIMES, WHOTIM, NPTIMS, IPTIMS)
300 NPTIMW = NWHSEL (NPTIMS, IPTIMS, WHOTIM)
301 ELSE
302 CALL PRTERR ('CMDWARN',
303 & 'There are no whole time steps defined')
304 NPTIMS = 1
305 NPTIMW = 1
306 IPTIMS(1) = 1
307 DELT = 0.0
308 NINTV = 1
309 END IF
310
311 CALL PLSHOW (VERB, XYTYPE, MESHOK, TIMES, WHOTIM, IPTIMS)
312 VERB = 'TMIN'
313
314 ELSE IF ((VERB .EQ. 'QA') .OR. (VERB .EQ. 'LEGEND')
315 & .OR. (VERB .EQ. 'AXIS') .OR. (VERB .EQ. 'CAPTION')
316 * .OR. (VERB .EQ. 'OUTLINE')) THEN
317 INVERB = ' '
318
319 CALL CMDLEG (INLINE, VERB, IFLD, INTYP, CFIELD, IFIELD,
320 & XYTYPE, MESHOK, DOQA, DOLEG, DOAXIS, DOBOX, CAPTN, *100)
321
322 ELSE IF ((VERB .EQ. 'SOFTCHARACTERS') .OR. (VERB .EQ. 'FONT')
323 & .OR. (VERB .EQ. 'COLOR') .OR. (VERB .EQ. 'SPECTRUM')
324 & .OR. (VERB .EQ. 'SNAP') .OR. (VERB .EQ. 'AUTO')
325 & .OR. (VERB .EQ. 'RAINBOW')) THEN
326
327 C Check for RAINBOW command, which will be reset to 'SPECTRUM'
328 IF (VERB .EQ. 'RAINBOW')THEN
329 C RAINBOW sets the flag for using the rainbow spectrum rather
330 C than the default blue-brown-red spectrum
331 IRAINB=1
332 CALL PRTERR('CMDSPEC','Using rainbow color scale.')
333 VERB='SPECTRUM'
334 ELSEIF (VERB .EQ. 'SPECTRUM')THEN
335 IRAINB=0
336 ENDIF
337
338 INVERB = ' '
339
340 CALL CMDDEV (INLINE,
341 & VERB, IFLD, INTYP, CFIELD, IFIELD, RFIELD, *100)
342
343 C --COLOR and SPECTRUM are to be passed as lower-case commands
344 IF ((VERB .EQ. 'COLOR') .OR. (VERB .EQ. 'SPECTRUM'))
345 & CALL LOWSTR (INVERB, VERB)
346
347 ELSE IF (VERB .EQ. 'BACKGROUND') THEN
348 CALL FFADDC (VERB, INLINE(1))
349 INVERB = ' '
350 CALL SETBCK (1, INLINE, IFLD, INTYP, CFIELD, *100)
351
352 ELSE IF (VERB .EQ. 'FOREGROUND') THEN
353 CALL FFADDC (VERB, INLINE(1))
354 INVERB = ' '
355 CALL SETFOR (1, INLINE, IFLD, INTYP, CFIELD, *100)
356
357 C *** Information ***
358
359 ELSE IF (VERB .EQ. 'show') THEN
360
361 CALL FFCHAR (IFLD, INTYP, CFIELD, ' ', WORD)
362 CALL ABRSTR (VERB, WORD, CMDTBL)
363 IF (VERB .NE. ' ') THEN
364 CALL PLSHOW (VERB, XYTYPE, MESHOK, TIMES, WHOTIM, IPTIMS)
365 INVERB = ' '
366 END IF
367 VERB = ' '
368
369 ELSE IF (VERB .EQ. 'help') THEN
370
371 ISON = HELP ('BLOT', 'COMMANDS', CFIELD(IFLD))
372 IF (.NOT. ISON)
373 & CALL SHOCMD ('General Graphics Commands', CMDTBL)
374 VERB = ' '
375
376 ELSE
377 VERB = ' '
378 END IF
379
380 GOTO 110
381
382 100 CONTINUE
383 INLINE(1) = ' '
384
385 110 CONTINUE
386 IF (VERB .NE. ' ') THEN
387 CALL PLSHOW (VERB, XYTYPE, MESHOK, TIMES, WHOTIM, IPTIMS)
388 END IF
389
390 RETURN
391 END