Debian Codegraph @

packages/seacas/applications/blot/lnlab.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 LNLAB (A, NEWSET, NPTIMS, IPTIMS, TIMES,
9 & NAMECO, NAMES, IELBST,
10 & ISSNPS, IDNPS, ISSESS, IDESS, ISCNPS, ISCESS,
11 & LIDSP, BLKCOL, *)
12 C=======================================================================
13
14 C --*** LNLAB *** (PATHLN) Label plot
15 C -- Modified by John Glick - 11/9/88
16 C -- Written by Amy Gilkey - revised 05/31/88
17 C --
18 C --LNLAB calls MSLAB to draw the standard mesh plot label, then adds
19 C --PATHLN-specific labeling. MSLAB also draws the axes.
20 C --
21 C --Parameters:
22 C -- A - IN - the dynamic memory base array
23 C -- NEWSET - IN - true iff starting a new plot set
24 C -- NPTIMS - IN - the number of times on this plot; 0 for no time
25 C -- IPTIMS - IN - the plot time indices (starting with current plot)
26 C -- TIMES - IN - the database times
27 C -- NAMECO - IN - the coordinate names
28 C -- NAMES - IN - the variable names
29 C -- IELBST - IN - the element block status:
30 C -- -1 = OFF, 0 = ON, but not selected, 1 = selected
31 C -- ISSNPS - IN - the indices of the selected node sets
32 C -- IDNPS - IN - the node set IDs
33 C -- ISSESS - IN - the indices of the selected side sets
34 C -- IDESS - IN - the side set IDs
35 C -- ISCNPS - IN/OUT - size = NUMNPS, set iff NEWSET
36 C -- ISCESS - IN/OUT - size = NUMESS, set iff NEWSET
37 C -- LIDSP(0:*) - IN - the indices of the selected variables
38 C -- whose values will be displayed on the plot legend.
39 C -- LIDSP(0) = the number of variables in the list.
40 C -- LIDSP(i) identifies the ith variable in the list.
41 C -- If LIDSP(i) > 0, LIDSP(i) is the id of a history variable.
42 C -- If LIDSP(i) < 0, -LIDSP(i) is the id of a global variable.
43 C -- If LIDSP(i) = 0, TIME is to be displayed on the plot legend.
44 C -- BLKCOL - IN/OUT - the user selected colors of the element blocks.
45 C -- BLKCOL(0) = 1 if the user defined material
46 C -- colors should be used in mesh plots.
47 C -- = -1 if program selected colors should
48 C -- be used.
49 C -- BLKCOL(i) = the user selected color of element
50 C -- block i:
51 C -- -2 - no color selected by user.
52 C -- -1 - black
53 C -- 0 - white
54 C -- 1 - red
55 C -- 2 - green
56 C -- 3 - yellow
57 C -- 4 - blue
58 C -- 5 - cyan
59 C -- 6 - magenta
60 C -- * - return statement if the cancel function is active
61 C --
62 C --Common Variables:
63 C -- Uses NDIM, NELBLK of /DBNUMS/
64 C -- Uses IS3DIM of /D3NUMS/
65 C -- Uses DOLEG of /LEGOPT/
66 C -- Uses CHLSIZ of /LAYOUT/
67
68 PARAMETER (KLFT=1, KRGT=2, KBOT=3, KTOP=4, KNEA=5, KFAR=6)
69
70 include 'dbnums.blk'
71 include 'dbnumgq.blk'
72 include 'd3nums.blk'
73 include 'legopt.blk'
74 include 'lnvars.blk'
75 include 'layout.blk'
76
77 common /debugc/ cdebug
78 common /debugn/ idebug
79 character*8 cdebug
80
81 DIMENSION A(*)
82 LOGICAL NEWSET
83 INTEGER IPTIMS(*)
84 REAL TIMES(*)
85 CHARACTER*(*) NAMECO(*)
86 CHARACTER*(*) NAMES(*)
87 INTEGER IELBST(NELBLK)
88 INTEGER ISSNPS(NUMNPS,4)
89 INTEGER ISSESS(NUMESS,4)
90 INTEGER IDNPS(*)
91 INTEGER IDESS(*)
92 INTEGER ISCNPS(*)
93 INTEGER ISCESS(*)
94 INTEGER LIDSP(0:*)
95 INTEGER BLKCOL(0:NELBLK)
96
97 LOGICAL SOFTCH
98
99 REAL DLEGND(KTOP)
100 CHARACTER*80 STRING
101 REAL RNUM(2)
102 CHARACTER*20 RSTR(2)
103 CHARACTER TYP
104
105 REAL DYCRV, DYTIMS
106 SAVE DYCRV, DYTIMS
107
108 C *** Standard plot labeling ***
109
110 CALL MSLAB (A, NEWSET, 0, IDUM, RDUM,
111 & NAMECO, NAMES, IELBST,
112 & ISSNPS, IDNPS, ISSESS, IDESS, ISCNPS, ISCESS,
113 & DLEGND, LIDSP, BLKCOL, *130)
114 CALL OUTLIN (BLKCOL, *130)
115
116 C *** Plot legend ***
117
118 IF (.NOT. DOLEG(1)) GOTO 120
119
120 C --Set up labeling
121
122 IF (NEWSET) THEN
123
124 C --Get the number of lines needed
125 NCRVLN = 0
126 DO 100 NP = 1, NLNCRV
127 CALL DBVTYP_BL (ILVID(1,NP), TYP, IDUM)
128 IF (TYP .EQ. 'H') THEN
129 NCRVLN = NCRVLN + 1
130 ELSE
131 NCRVLN = NCRVLN + 2
132 END IF
133 100 CONTINUE
134
135 NCENLN = NCRVLN + 1 + 2
136
137 DYLTOP = DLEGND(KTOP) - 1.5*CHLSIZ
138 DYLBOT = DLEGND(KBOT) + 1.5*CHLSIZ
139 CALL GRYCEN (CHLSIZ, DYLTOP, DYLBOT, NCENLN, NOVER)
140 DYCRV = DYLTOP
141 DYLTOP = DYCRV - (NCRVLN+1) * CHLSIZ
142 DYTIMS = DYLTOP
143 DYLTOP = DYTIMS - (2+1) * CHLSIZ
144 END IF
145
146 C --Get software character flag for current device
147 CALL GRGPARD ('SOFTCHAR', 0, SOFTCH, STRING)
148
149 C --Display plot item(s) (variable names and number) for each pathline
150
151 DY = DYCRV
152 DO 110 NP = 1, NLNCRV
153 CALL DBVTYP_BL (ILVID(1,NP), TYP, IDUM)
154 WRITE (STRING, '(4 (A, 1X))')
155 & (NAMES(ILVID(I,NP)), I=1,NDIM)
156 CALL SQZSTR (STRING, LSTR)
157 CALL GRTEXT (DLEGND(KLFT), DY, STRING(:LSTR))
158 DY = DY - CHLSIZ
159 IF ((TYP .EQ. 'N') .OR. (TYP .EQ. 'E')) THEN
160 CALL INTSTR (1, 0, ILVNE(NP), STRING, LSTR)
161 IF (TYP .EQ. 'N') THEN
162 CALL GRTEXT (DLEGND(KLFT), DY,
163 & 'Node ' // STRING(:LSTR))
164 ELSE
165 CALL GRTEXT (DLEGND(KLFT), DY,
166 & 'Element ' // STRING(:LSTR))
167 END IF
168 DY = DY - CHLSIZ
169 END IF
170 110 CONTINUE
171
172 CALL UGRCOL (0, BLKCOL)
173 DY = DY - CHLSIZ
174
175 C --Display times for pathlines
176
177 RNUM(1) = TIMES(IPTIMS(1))
178 RNUM(2) = TIMES(IPTIMS(NPTIMS))
179 CALL NUMSTR (2, 4, RNUM, RSTR, LSTR)
180 CALL PCKSTR (2, RSTR)
181 CALL GRTEXT (DLEGND(KLFT), DY, 'TIMES ' // RSTR(1))
182 DY = DY - CHLSIZ
183 CALL GRTEXT (DLEGND(KLFT), DY, ' TO ' // RSTR(2))
184 DY = DY - CHLSIZ
185
186 120 CONTINUE
187
188 C --Flush buffer, so label is complete at this point
189 CALL PLTFLU
190
191 RETURN
192
193 130 CONTINUE
194 RETURN 1
195 END