Debian Codegraph @

packages/seacas/applications/blot/msmemy.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 MSMEMY (A, ANYDEF, ANYUND,
9 & DOIXF, DON2B, DOELED, DOELEU, DODEAD, DONPS, DOESS,
10 & NSURFS, KN2ELB, KDN2B, KIF2EL,
11 & KXN, KYN, KZN, KHZ, KVT, KPD, KDHZ, KDVT, KDPD,
12 & KXF, KYF, KZF, KDXF, KDYF, KDZF, KHIDEN, KHIDEF, KIXFAC,
13 & KSNPS, KSESS)
14 C=======================================================================
15
16 C --*** MSMEMY *** (MESH) Reserve memory for mesh plot
17 C -- Written by Amy Gilkey - revised 07/27/88
18 C --
19 C --MSMEMY reserves or finds the memory needed to plot a mesh.
20 C --
21 C --This routine reserves and finds the following dynamic memory arrays:
22 C -- IN2ELB - the element block for each node;
23 C -- <0 if not in any selected element block
24 C -- =0 if in more than one selected element block
25 C -- IDN2B - the element block for each dead node; dead if >= 0
26 C -- HZ, VT, PD - the undeformed nodal coordinates
27 C -- (rotated for 3D, PD for 3D only)
28 C -- DHZ, DVT, DPD - the deformed nodal coordinates
29 C -- (rotated for 3D, DPD for 3D only)
30 C -- XF, YF, ZF - the undeformed face center coordinates
31 C -- (rotated for 3D, ZF for 3D only)
32 C -- DXF, DYF, DZF - the deformed face center coordinates
33 C -- (rotated for 3D, DZF for 3D only)
34 C -- HIDENP(i) - true iff node i is hidden (3D only)
35 C -- HIDEF(i) - true iff face i is hidden (3D only)
36 C -- IXFAC - the indices of the ordered faces (3D only)
37 C -- IX2NP - the node number for each mesh index
38 C -- SCRNPS - scratch array for node sets
39 C -- SCRESS - scratch array for side sets
40 C --
41 C --This routine uses MDFIND to find the following dynamic memory arrays:
42 C -- IF2EL - the element number of each face
43 C -- XN, YN, ZN - IN - the nodal coordinates (ZN for 3D only)
44 C --
45 C --Parameters:
46 C -- A - IN - the dynamic memory base array
47 C -- ANYDEF - IN - true iff any deformed mesh is to be plotted
48 C -- ANYUND - IN - true iff any undeformed mesh is to be plotted
49 C -- DOIXF - IN - true iff the IXFAC array is needed
50 C -- DON2B - IN - true iff the IN2ELB array is needed
51 C -- DOELED - IN - true iff the deformed element quarilateral centers
52 C -- are needed
53 C -- DOELEU - IN - true iff the undeformed element quarilateral centers
54 C -- are needed
55 C -- DODEAD - IN - true iff dead nodes are needed
56 C -- DONPS - IN - true iff node set information is needed
57 C -- DOESS - IN - true iff side set information is needed
58 C -- NSURFS - IN - the number of surface faces
59 C -- KN2ELB - OUT - the index of IN2ELB
60 C -- KDN2B - OUT - the index of IDN2B
61 C -- KIF2EL - OUT - the index of IF2EL
62 C -- KXN, KYN, KZN - OUT - the indices of XN, YN, ZN
63 C -- KHZ, KVT, KPD - OUT - the indices of HZ, VT, PD
64 C -- KDHZ, KDVT, KDPD - OUT - the indices of DHZ, DVT, DPD
65 C -- KXF, KYF, KZF - OUT - the indices of XF, YF, ZF
66 C -- KDXF, KDYF, KDZF - OUT - the indices of DXF, DYF, DZF
67 C -- KHIDEN - OUT - the index of HIDENP
68 C -- KHIDEF - OUT - the index of HIDEF
69 C -- KIXFAC - OUT - the index of IXFAC
70 C -- KSNPS - OUT - the index of SCRNPS
71 C -- KSESS - OUT - the index of SCRESS
72 C --
73 C --Common Variables:
74 C -- Uses NDIM of /DBNUMS/
75 C -- Uses IS3DIM, NUMNPF of /D3NUMS/
76 C -- Uses DEFPRO, DEFOK of /DEFORM/
77 C -- Sets NPSIZ of /SIZES/
78
79 include 'dbnumgq.blk'
80 include 'dbnums.blk'
81 include 'd3nums.blk'
82 include 'deform.blk'
83 include 'sizes.blk'
84
85 DIMENSION A(*)
86 LOGICAL ANYDEF, ANYUND
87 LOGICAL DOIXF, DON2B, DOELED, DOELEU, DODEAD, DONPS, DOESS
88
89 LOGICAL FIRST
90 SAVE FIRST
91 C --FIRST - true iff first time through routine
92
93 DATA FIRST / .TRUE. /
94
95 IF (FIRST) THEN
96 FIRST = .FALSE.
97
98 C --Reserve memory (most will be expanded when needed)
99
100 CALL MDRSRV ('IN2ELB', KN2ELB, 0)
101 CALL MDFIND ('IF2EL', KIF2EL, IDUM)
102
103 CALL MDFIND ('XN', KXN, IDUM)
104 CALL MDFIND ('YN', KYN, IDUM)
105 IF (IS3DIM) THEN
106 CALL MDFIND ('ZN', KZN, IDUM)
107 ELSE
108 KZN = 1
109 END IF
110
111 C --Set size of deformed coordinate arrays for hidden line algorithm
112 NPSIZ = NUMNPF
113 IF (IS3DIM) NPSIZ = (13 * NUMNPF) / 10
114
115 IF (IS3DIM) THEN
116 C --QNPICK uses MDFIND to find HZ, VT, PD
117 CALL MDRSRV ('HZ', KHZ, 0)
118 CALL MDRSRV ('VT', KVT, 0)
119 CALL MDRSRV ('PD', KPD, 0)
120 ELSE
121 KHZ = KXN
122 KVT = KYN
123 KPD = KZN
124 END IF
125
126 IF (DEFOK) THEN
127 C --QNPICK uses MDFIND to find DHZ, DVT, DPD
128 CALL MDRSRV ('DHZ', KDHZ, 0)
129 CALL MDRSRV ('DVT', KDVT, 0)
130 IF (IS3DIM) THEN
131 CALL MDRSRV ('DPD', KDPD, 0)
132 ELSE
133 KDPD = 1
134 END IF
135 ELSE
136 KDHZ = 1
137 KDVT = 1
138 KDPD = 1
139 END IF
140
141 CALL MDRSRV ('XF', KXF, 0)
142 CALL MDRSRV ('YF', KYF, 0)
143 IF (IS3DIM) THEN
144 CALL MDRSRV ('ZF', KZF, 0)
145 ELSE
146 KZF = 1
147 END IF
148
149 IF (DEFOK) THEN
150 CALL MDRSRV ('DXF', KDXF, 0)
151 CALL MDRSRV ('DYF', KDYF, 0)
152 IF (IS3DIM) THEN
153 CALL MDRSRV ('DZF', KDZF, 0)
154 ELSE
155 KDZF = 1
156 END IF
157 END IF
158
159 C --QNPICK uses MDFIND to find HIDENP
160 IF (IS3DIM) THEN
161 CALL MDRSRV ('HIDENP', KHIDEN, NUMNPF)
162 ELSE
163 KHIDEN = 1
164 END IF
165 IF (IS3DIM) THEN
166 CALL MDRSRV ('HIDEF', KHIDEF, NSURFS)
167 ELSE
168 KHIDEF = 1
169 END IF
170
171 C --Reserve the mesh index to node number index
172 CALL MDRSRV ('IX2NP', KIX2NP, 0)
173 END IF
174
175 C --Find memory
176
177 CALL MDFIND ('IN2ELB', KN2ELB, IDUM)
178 CALL MDFIND ('IF2EL', KIF2EL, IDUM)
179
180 IF (DODEAD) THEN
181 CALL MDRSRV ('IDN2B', KDN2B, 0)
182 ELSE
183 KDN2B = 1
184 END IF
185
186 CALL MDFIND ('XN', KXN, IDUM)
187 CALL MDFIND ('YN', KYN, IDUM)
188 IF (IS3DIM) THEN
189 CALL MDFIND ('ZN', KZN, IDUM)
190 ELSE
191 KZN = 1
192 END IF
193
194 IF (IS3DIM) THEN
195 CALL MDFIND ('HZ', KHZ, IDUM)
196 CALL MDFIND ('VT', KVT, IDUM)
197 CALL MDFIND ('PD', KPD, IDUM)
198 ELSE
199 KHZ = KXN
200 KVT = KYN
201 KPD = KZN
202 END IF
203
204 IF (DEFOK .AND. DEFPRO) THEN
205 CALL MDFIND ('DHZ', KDHZ, IDUM)
206 CALL MDFIND ('DVT', KDVT, IDUM)
207 IF (IS3DIM) THEN
208 CALL MDFIND ('DPD', KDPD, IDUM)
209 ELSE
210 KDPD = 1
211 END IF
212 ELSE
213 KDHZ = 1
214 KDVT = 1
215 KDPD = 1
216 END IF
217
218 CALL MDFIND ('XF', KXF, IDUM)
219 CALL MDFIND ('YF', KYF, IDUM)
220 IF (IS3DIM) THEN
221 CALL MDFIND ('ZF', KZF, IDUM)
222 ELSE
223 KZF = 1
224 END IF
225
226 IF (DEFOK .AND. DEFPRO) THEN
227 CALL MDFIND ('DXF', KDXF, IDUM)
228 CALL MDFIND ('DYF', KDYF, IDUM)
229 IF (IS3DIM) THEN
230 CALL MDFIND ('DZF', KDZF, IDUM)
231 ELSE
232 KDZF = 1
233 END IF
234 ELSE
235 KDXF = 1
236 KDYF = 1
237 KDZF = 1
238 END IF
239
240 IF (IS3DIM) THEN
241 CALL MDFIND ('HIDENP', KHIDEN, IDUM)
242 ELSE
243 KHIDEN = 1
244 END IF
245 KIXFAC = 1
246 IF (IS3DIM) THEN
247 CALL MDFIND ('HIDEF', KHIDEF, IDUM)
248 IF (DOIXF) CALL MDRSRV ('IXFAC', KIXFAC, NSURFS)
249 ELSE
250 KHIDEF = 1
251 END IF
252
253 IF (DONPS) THEN
254 CALL MDRSRV ('SCRNPS', KSNPS, NUMNPS)
255 ELSE
256 KSNPS = 1
257 END IF
258 IF (DOESS) THEN
259 CALL MDRSRV ('SCRESS', KSESS, NUMESS)
260 ELSE
261 KSESS = 1
262 END IF
263
264 CALL MDSTAT (NERR, MEM)
265 IF (NERR .GT. 0) GOTO 100
266
267 100 CONTINUE
268 RETURN
269 END