Debian Codegraph @

packages/seacas/applications/exotxt/exotxt.f

raw
1 C Copyright(C) 1999-2022 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 PROGRAM EXOTXT
9 C=======================================================================
10
11 C --*** EXOTXT *** (EXOTXT) EXODUS to TEXT translator
12 C -- Modified for ExodusIIv2 database format
13 C --
14 C --EXOTXT reads either from an EXODUS database or from the user
15 C --and writes a text file of the database contents.
16 C --
17 C --Expects the input database on unit 9, the output text file on unit 20.
18
19 include 'exodusII.inc'
20 INCLUDE 'argparse.inc'
21
22 C Input/Output File Arguments
23 C CPUWS - The word size in bytes of the floating point variables
24 C used in the application program
25 C IOWS - The word size in bytes of the floating point data as they
26 C are stored in the EXODUS II file
27 C IERR - error code
28 C NERR - error flag for dynamic memory errors - numeric
29 C CERR - error flag for dynamic memory errors - character
30 C IOERR - Input/output error flag
31 INTEGER CPUWS, IOWS, IERR, NERR, CERR, IOERR
32 C VERS - version number of database
33 REAL VERS
34 C QA program information
35 CHARACTER*(MXSTLN) QAINFO(6)
36 C Title of database/experiment
37 CHARACTER*(MXLNLN) TITLE
38 C Output string for number of time steps processed
39 CHARACTER*8 STR8
40 C Input filename
41 CHARACTER*2048 FILNAM, SCRATCH
42
43 C A(1) dynamic memory base array for numeric data
44 C C(1) dynamic memory base array for character data
45 DIMENSION A(1)
46 CHARACTER*1 C(1)
47
48 C Program Information
49 C.
50 QAINFO(1) = 'exotxt '
51 QAINFO(2) = '2021/01/28 '
52 QAINFO(3) = ' 2.01 '
53 QAINFO(4) = ' '
54 QAINFO(5) = ' '
55 QAINFO(6) = ' '
56
57 CALL STRTUP (QAINFO)
58
59 CALL BANNER (0, QAINFO,
60 & 'EXODUSII DATABASE TO TEXT FILE TRANSLATOR',
61 & ' ', ' ')
62
63 CALL PRTERR ('CMDSPEC',
64 $ 'Please use ncdump/ncgen instead of exotxt/txtexo.')
65 CALL MDINIT (A)
66 CALL MCINIT (C)
67 CALL MDSTAT (NERR, MEM)
68 CALL MCSTAT (CERR, MEM)
69 IF ((NERR .GT. 0) .OR. (CERR .GT. 0)) THEN
70 CALL MEMERR
71 GOTO 140
72 END IF
73
74 C --Open the input and output files
75
76 NDB = 11
77 NTXT = 20
78
79 C .. Get filename from command line. If not specified, emit error message
80 NARG = argument_count()
81 if (narg .lt. 2) then
82 CALL PRTERR ('FATAL', 'Filename not specified.')
83 CALL PRTERR ('CMDSPEC', 'Syntax is: "exotxt db_file text_file"')
84 CALL PRTERR ('CMDSPEC',
85 * 'Documentation: https://sandialabs.github.io' //
86 $ '/seacas-docs/sphinx/html/index.html#exotxt')
87 GOTO 140
88 else if (narg .gt. 2) then
89 CALL PRTERR ('FATAL', 'Too many arguments specified.')
90 CALL PRTERR ('CMDSPEC', 'Syntax is: "exotxt db_file text_file"')
91 CALL PRTERR ('CMDSPEC',
92 * 'Documentation: https://sandialabs.github.io' //
93 $ '/seacas-docs/sphinx/html/index.html#exotxt')
94 GOTO 140
95 end if
96
97 C Open the input database; Exit on error
98 CALL get_argument(1,FILNAM, LFIL)
99 CPUWS = 0
100 IOWS = 0
101 NDB = EXOPEN(FILNAM(:LFIL), EXREAD, CPUWS, IOWS,
102 & VERS, IERR)
103 IF (IERR .NE. 0) THEN
104 SCRATCH = 'Database "'//FILNAM(:LFIL)//'" does not exist.'
105 CALL PRTERR ('FATAL', SCRATCH(:LENSTR(SCRATCH)))
106 GOTO 140
107 END IF
108
109 CALL get_argument(2,FILNAM, LFIL)
110 open(unit=ntxt, file=filnam(:lfil), iostat=ierr)
111 IF (IERR .NE. 0) THEN
112 SCRATCH = 'Could not create "'//FILNAM(:LFIL)//'"'
113 CALL PRTERR ('FATAL', SCRATCH(:LENSTR(SCRATCH)))
114 GOTO 140
115 END IF
116
117 C --Read the initial variables
118 CALL EXGINI (NDB, TITLE, NNDIM, NUMNP, NUMEL, NELBLK,
119 & NUMNPS, NUMESS, IERR)
120
121 call exinq(ndb, EXDBMXUSNM, namlen, rdum, cdum, ierr)
122 call exmxnm(ndb, namlen, ierr)
123
124 C Request length of the concatenated node set node list
125 CALL EXINQ (NDB, EXNSNL, LNPSNL, RNUM, CNUM, IERR)
126 C Request length of the node set distribution factors list
127 CALL EXINQ (NDB, EXNSDF, LNPSDF, RDUM, CDUM, IERR)
128 C Request length of the concatenated side sets element list
129 CALL EXINQ (NDB, EXSSEL, LESSEL, RNUM, CNUM, IERR)
130 C Request length of the concatenated side sets node list
131 CALL EXINQ (NDB, EXSSNL, LESSNL, RNUM, CNUM, IERR)
132 C Request length of the side set distribution factors list
133 CALL EXINQ (NDB, EXSSDF, LESSDF, RNUM, CNUM, IERR)
134
135 CALL WRINIT (NTXT, VERS, TITLE, NNDIM, NUMNP, NUMEL, NELBLK,
136 & NUMNPS, LNPSNL, LNPSDF, NUMESS, LESSEL, LESSNL,
137 & LESSDF,QAINFO, NAMLEN)
138 CALL DBPINI ('TIS', NDB, TITLE, NNDIM, NUMNP, NUMEL, NELBLK,
139 & NUMNPS, LNPSNL, LNPSDF, NUMESS, LESSEL, LESSDF,
140 & IDUM, IDUM, IDUM, ' ')
141
142 C --Read the coordinates
143
144 CALL MDRSRV ('XN', KXN, NUMNP)
145 IF (NNDIM .GE. 2) CALL MDRSRV ('YN', KYN, NUMNP)
146 IF (NNDIM .GE. 3) CALL MDRSRV ('ZN', KZN, NUMNP)
147 CALL MDSTAT (NERR, MEM)
148 IF (NERR .GT. 0) THEN
149 CALL MEMERR
150 GOTO 140
151 END IF
152
153 C Reserve memory for coordinate array names
154 CALL MCRSRV ('NAMECO', KNACOR, NAMLEN*NNDIM)
155
156 call getxyz(ndb, c(knacor), a(kXN), A(KYN), A(KZN), IERR, namlen)
157 CALL WRXYZ (NTXT, NNDIM, NUMNP, A(KXN), A(KYN), A(KZN),
158 * C(knacor), namlen)
159
160 CALL MDDEL ('XN')
161 IF (NNDIM .GE. 2) CALL MDDEL ('YN')
162 IF (NNDIM .GE. 3) CALL MDDEL ('ZN')
163 CALL MCDEL ('NAMECO')
164
165 C --ExodusIIv2 Read node number map, element number map,
166 C --and element order map
167 CALL MDRSRV ('NPMAP', KNPMAP, NUMNP)
168 CALL MDRSRV ('ELMAP', KELMAP, NUMEL)
169 CALL MDRSRV ('MAPEL', KMAPEL, NUMEL)
170 CALL MDSTAT (NERR, MEM)
171 IF (NERR .GT. 0) THEN
172 CALL MEMERR
173 GOTO 140
174 END IF
175
176 C Read node number map
177 CALL EXGNNM (NDB, A(KNPMAP), IERR)
178 C Read element number map
179 CALL EXGENM (NDB, A(KELMAP), IERR)
180 C Read element order map
181 CALL EXGMAP (NDB, A(KMAPEL), IERR)
182
183 CALL WRMAP (NTXT, '*', NUMNP, NUMEL,
184 & A(KNPMAP), A(KELMAP), A(KMAPEL))
185
186 CALL MDDEL ('NPMAP')
187 CALL MDDEL ('ELMAP')
188 CALL MDDEL ('MAPEL')
189 CALL MDSTAT (NERR, MEM)
190 IF (NERR .GT. 0) THEN
191 CALL MEMERR
192 GOTO 140
193 END IF
194
195 C --Read/write the element blocks
196 C call MxRSRV(array_name, ret_array_index, array_size)
197 C IDELB: Element block ID's for each block
198 CALL MDRSRV ('IDELB', KIDELB, NELBLK)
199 C NUMELB: Number of elements in each block
200 CALL MDRSRV ('NUMELB', KNELB, NELBLK)
201 C NUMLNK: Number of nodes per element in each block
202 CALL MDRSRV ('NUMLNK', KNLNK, NELBLK)
203 C NUMATR: Number of attributes in each block
204 CALL MDRSRV ('NUMATR', KNATR, NELBLK)
205 C VISELB(i) = True iff element block i is to be written
206 CALL MDRSRV ('VISELB', KVISEB, NELBLK)
207 C NAMELB: Element type
208 CALL MCRSRV ('NAMELB', KNMLB, NELBLK * MXSTLN)
209 C Reserving space for the element block connectivity arrays
210 CALL MDRSRV ('LINK', KLINK, 0)
211 C Reserving space for the element block attributes
212 CALL MDRSRV ('ATRIB', KATRIB, 0)
213 C Check for dynamic memory errors
214 CALL MDSTAT (NERR, MEM)
215 CALL MCSTAT (CERR, MEM)
216 IF ((NERR .GT. 0) .OR. (CERR .GT. 0)) THEN
217 CALL MEMERR
218 GOTO 140
219 END IF
220
221 C DBIELB reads and returns the following:
222 C 1. Element block ID's
223 C 2. Element type in each element block
224 C 3. Number of elements in each element block
225 C 4. Number of nodes per element in each element block
226 C 5. Number of attributes per element in each element block
227 C 6. If Option = A or * -> element block attributes
228 C 7. If Option = C or * -> element block connectivity
229 C 8. If Option = H or * -> read all header information
230 C 9. If Option = I or * -> read the element block ID's
231 C Note: Element block ID's must be read for all options
232 C DBIELB reads the element block information from the database.
233 C An error message is displayed if the end of file is read.
234 CALL DBIELB (NDB, '*', 1, NELBLK, A(KIDELB), A(KNELB),
235 & A(KNLNK), A(KNATR), C(KNMLB), A, IELNK, IEATR, IOERR)
236 C Exit program on error reading element block information
237 IF (IOERR .EQ. 1) GO TO 140
238 CALL MDFIND ('LINK', KLINK, IELNK)
239 CALL MDFIND ('ATRIB', KATRIB, IEATR)
240 CALL WRELB (NTXT, NELBLK, A(KIDELB), A(KNELB), A(KNLNK),
241 & A(KNATR), C(KNMLB), A(KLINK), A(KATRIB))
242
243 CALL MDDEL ('NUMLNK')
244 CALL MDDEL ('NUMATR')
245 CALL MDDEL ('LINK')
246 CALL MDDEL ('VISELB')
247 CALL MDDEL ('ATRIB')
248 CALL MCDEL ('NAMELB')
249 CALL MDSTAT (NERR,MEM)
250 CALL MCSTAT (CERR, MEM)
251 IF ((NERR .GT. 0) .OR. (CERR .GT. 0)) THEN
252 CALL MEMERR
253 GO TO 140
254 END IF
255
256 C --Read/write the node sets
257
258 C if number of node set > 0
259 IF (NUMNPS .GT. 0) THEN
260 C IDNPS - array containing the node set ID's for each node set
261 C NNNPS - array containing the number of nodes for each node set
262 C NDNPS - array containing number of dist. fact for each node set
263 C IXNNPS - array containing indices into the LTNNPS array which
264 C are the location of the 1st nodes for each set
265 C IXDNPS - array containing indices into the FACNPS array which
266 C are the location of the 1st dist factor for each set
267 C LTNNPS - Returned array containing the nodes for all node sets
268 C Internal node IDs
269 C FACNPS - Returned array containing the distribution factors
270 C for all node sets
271 CALL MDRSRV ('IDNPS', KIDNS, NUMNPS)
272 CALL MDRSRV ('NNNPS', KNNNS, NUMNPS)
273 CALL MDRSRV ('NDNPS', KNDNPS, NUMNPS)
274 CALL MDRSRV ('IXNNPS', KIXNNS, NUMNPS)
275 CALL MDRSRV ('IXDNPS', KDISNS, NUMNPS)
276 CALL MDRSRV ('LTNNPS', KLTNNS, LNPSNL)
277 CALL MDRSRV ('FACNPS', KFACNS, LNPSNL)
278 CALL MDSTAT (NERR,MEM)
279 IF (NERR .GT. 0) THEN
280 CALL MEMERR
281 GO TO 140
282 END IF
283 C Read the concatenated node sets
284 CALL EXGCNS (ndb, a(kidns), a(knnns), a(kndnps),
285 & a(kixnns), a(kdisns), a(kltnns),
286 & a(kfacns), IERR)
287 CALL WRNPS (NTXT, NUMNPS, LNPSNL, LNPSDF, A(KIDNS),
288 & A(KNNNS), A(KNDNPS), A(KIXNNS), A(KDISNS),
289 & A(KLTNNS), A(KFACNS))
290
291 CALL MDDEL ('IDNPS')
292 CALL MDDEL ('NNNPS')
293 CALL MDDEL ('NDNPS')
294 CALL MDDEL ('IXNNPS')
295 CALL MDDEL ('IXDNPS')
296 CALL MDDEL ('LTNNPS')
297 CALL MDDEL ('FACNPS')
298 CALL MDSTAT (NERR,MEM)
299 IF (NERR .GT. 0) THEN
300 CALL MEMERR
301 GO TO 140
302 END IF
303 END IF
304
305 C --Read/write the element side sets
306
307 IF (NUMESS .GT. 0) THEN
308 C IDESS - array containing side set IDS
309 C NEESS - array containing the number of sides for each sets
310 C KNDSS - Returned array containing the number of dist
311 C factors for each set
312 C IXEESS - returned array containing the indices into the
313 C LTEESS array which are the locations of the 1st
314 C element of each set
315 C IXNESS - Returned array containing the indices into the
316 C FACESS array which are the locations of the 1st
317 C distribution factor for each set.
318 C LTEESS - Returned array containing the elements for all side
319 C sets. Internal element IDS are used in this list
320 C LTSESS - Returned array containing the sides for all side sets
321 C FACESS - Returned array containing dist factors for all side sets
322 C NNESS - the number of nodes for each side set
323 C IXNESS - index into LTNESS - the 1st node for each side set
324 C LTNESS - array of nodes for all side sets
325 C LTNNN - array of number of nodes for each side in a side set
326 CALL MDRSRV ('IDESS' , KIDSS , NUMESS)
327 CALL MDRSRV ('NEESS' , KNESS , NUMESS)
328 CALL MDRSRV ('NDESS' , KNDSS , NUMESS)
329 CALL MDRSRV ('IXEESS', KIXESS, NUMESS)
330 CALL MDRSRV ('IXDESS', KIDESS, NUMESS)
331 CALL MDRSRV ('LTEESS', KLTESS, LESSEL)
332 CALL MDRSRV ('LTSESS', KLTSSS, LESSEL)
333 CALL MDRSRV ('FACESS', KFACSS, LESSNL)
334 CALL MDRSRV ('NNESS' , KNNSS, NUMESS)
335 CALL MDRSRV ('IXNESS', KIXNSS, NUMESS)
336 CALL MDRSRV ('LTNESS', KLTNSS, LESSNL)
337 CALL MDRSRV ('LTNNN' , KLTNNN, LESSEL)
338 CALL MDSTAT(NERR, MEM)
339 IF (NERR .GT. 0) THEN
340 CALL MEMERR
341 GO TO 140
342 END IF
343
344 C Read concatenated side sets
345 CALL EXGCSS (NDB, A(KIDSS), A(KNESS), A(KNDSS),
346 & A(KIXESS), A(KIDESS), A(KLTESS),
347 & A(KLTSSS), A(KFACSS), IOERR)
348
349 C Convert sides to nodes
350 CALL DBIGN (NDB, NUMESS, A(KIDSS), A(KNNSS),
351 & A(KIXNSS), A(KLTNSS), A(KLTNNN), IOERR)
352 IF (IOERR .EQ. 1) GO TO 140
353
354 CALL WRESS (NTXT, NUMESS, LESSEL, LESSNL, LESSDF,
355 & A(KIDSS), A(KNESS), A(KNDSS), A(KIXESS), A(KIDESS),
356 & A(KLTESS), A(KLTSSS), A(KFACSS), A(KNNSS), A(KIXNSS),
357 & A(KLTNSS), A(KLTNNN))
358
359 CALL MDDEL ('IDESS')
360 CALL MDDEL ('NEESS')
361 CALL MDDEL ('NDESS')
362 CALL MDDEL ('IXEESS')
363 CALL MDDEL ('IXDESS')
364 CALL MDDEL ('LTEESS')
365 CALL MDDEL ('LTSESS')
366 CALL MDDEL ('FACESS')
367 CALL MDDEL ('NNESS')
368 CALL MDDEL ('IXNESS')
369 CALL MDDEL ('LTNESS')
370 CALL MDDEL ('LTNNN')
371 CALL MDSTAT (NERR, MEM)
372 IF (NERR .GT. 0) THEN
373 CALL MEMERR
374 GOTO 140
375 END IF
376
377 END IF
378
379 write (ntxt, '(A)') '! Properties'
380 C Element Block, Node Set, and Side Set Properties
381 C number of element block properties
382 call exinq(ndb, EXNEBP, numebp, rdum, cdum, ierr)
383 C number of node set properties
384 call exinq(ndb, EXNNSP, numnsp, rdum, cdum, ierr)
385 C number of side set properties
386 call exinq(ndb, EXNSSP, numssp, rdum, cdum, ierr)
387 C************************************************************************
388 C Read element block properties
389 C************************************************************************
390 C Reserve memory for element block properties names and values
391 call mcrsrv ('EBPNAM', iebpn, numebp * namlen)
392 call mdrsrv ('EBPVAL', iebpv, numebp * nelblk)
393 call mcstat (cerr, mem)
394 call mdstat (nerr, mem)
395 if ((nerr .ne. 0) .or. (cerr .ne. 0)) then
396 call memerr()
397 ioerr = 1
398 end if
399 write (NTXT, '(I10,12x,A)') numebp,
400 & '! Number of ELEMENT BLOCK Properties'
401 call wrprop (ndb, NTXT, EXEBLK, numebp, nelblk,
402 & c(iebpn), a(iebpv), namlen)
403
404 call mcdel ('EBPNAM')
405 call mddel ('EBPVAL')
406
407 C************************************************************************
408 C read/write node set properties
409 C************************************************************************
410 call mcrsrv ('NSPNAM', inspn, numnsp * namlen)
411 call mdrsrv ('NSPVAL', inspv, numnsp * numnps)
412 call mcstat (cerr, mem)
413 call mdstat (nerr, mem)
414 if ((nerr .ne. 0) .or. (cerr .ne. 0)) then
415 call memerr()
416 ioerr = 1
417 end if
418
419 write (NTXT, '(I10,12x,A)') numnsp,
420 & '! Number of NODE SET Properties'
421 call wrprop (ndb, NTXT, EXNSET, numnsp, numnps,
422 & c(inspn), a(inspv), namlen)
423
424 call mcdel ('NSPNAM')
425 call mddel ('NSPVAL')
426
427 C************************************************************************
428 C read/write side set properties
429 C************************************************************************
430
431 call mcrsrv ('SSPNAM', isspn, numssp * namlen)
432 call mdrsrv ('SSPVAL', isspv, numssp * numess)
433 call mcstat (cerr, mem)
434 call mdstat (nerr, mem)
435 if ((nerr .ne. 0) .or. (cerr .ne. 0)) then
436 call memerr()
437 ioerr = 1
438 end if
439
440 write (NTXT, '(I10,12x,A)') numssp,
441 & '! Number of SIDE SET Properties'
442 call wrprop (ndb, NTXT, EXSSET, numssp, numess,
443 & c(isspn), a(isspv), namlen)
444
445 call mcdel ('SSPNAM')
446 call mddel ('SSPVAL')
447 call mdstat (nerr, mem)
448 if (nerr .ne. 0) then
449 call memerr()
450 ioerr = 1
451 end if
452
453 C --Read the QA records
454 C QA and Information record number stored in dbnumq.blk
455 C Request the number of QA records. Return the value
456 C as an integer in nqarec
457 call exinq(ndb, EXQA, nqarec, rdum, cdum, ierr)
458 C Request the number of information records. Return the
459 C value as an integer in ninfo
460 call exinq(ndb, EXINFO, ninfo, rdum, cdum, ierr)
461
462 C Reserve space to read the QA and information records
463 CALL MCRSRV ('QAREC', KQAREC, (NQAREC+1)*4*MXSTLN)
464 CALL MCRSRV ('INFREC', KINFO, NINFO*MXLNLN)
465 CALL MCSTAT (CERR, MEM)
466 IF (CERR .GT. 0) THEN
467 CALL MEMERR
468 GOTO 140
469 END IF
470
471 CALL DBIQA (NDB, '*', NQAREC, C(KQAREC), NINFO, C(KINFO))
472 CALL WRQA (NTXT, NQAREC, C(KQAREC), NINFO, C(KINFO), QAINFO)
473
474 CALL MCDEL ('QAREC')
475 CALL MCDEL ('INFREC')
476 CALL MCSTAT (CERR, MEM)
477 IF (CERR .GT. 0) THEN
478 CALL MEMERR
479 GOTO 140
480 END IF
481
482 C --Read the database names
483
484 C Read the number of global, node, and element variables
485 C EXGVP reads the number of global, nodal, or element
486 C variables stored in the database
487 C Read number of global variables = nvargl
488 call exgvp(ndb, 'G', nvargl, ierr)
489 C Read number of nodal variables = nvarnp
490 call exgvp(ndb, 'N', nvarnp, ierr)
491 C Read number of element variables = nvarel
492 call exgvp(ndb, 'E', nvarel, ierr)
493
494 C Reserve memory for global, node, and element variable
495 CALL MCRSRV ('NAMES', KNAMES, NAMLEN*(NVARGL+NVARNP+NVAREL))
496 C Reserve memory for element variable truth table
497 CALL MDRSRV ('ISEVOK', KIEVOK, NELBLK * NVAREL)
498 CALL MDRSRV ('ITMP', KITMP, NELBLK * NVAREL)
499 CALL MCSTAT (CERR, MEM)
500 CALL MDSTAT (NERR, MEM)
501 IF ((NERR .GT. 0) .OR. (CERR .GT. 0)) THEN
502 CALL MEMERR
503 GOTO 140
504 END IF
505
506 C Read the names of the global, node, and element variables
507 CALL DBINAM (NDB, C, C(KNAMES), NVARGL, NVARNP, NVAREL,
508 & KNAMGV, KNAMNV, KNAMEV, IOERR, NAMLEN)
509 IF (IOERR .EQ. 1) GO TO 140
510
511 CALL DBPINI ('V', NDB, TITLE, NNDIM, NUMNP, NUMEL, NELBLK,
512 & NUMNPS, LNPSNL, LNPSDF, NUMESS, LESSEL, LESSDF,
513 & NVARGL, NVARNP, NVAREL, ' ')
514
515 C Read the element variable truth table
516 CALL DBIVTT (NDB, A(KIEVOK), A(KITMP), NELBLK, NVAREL)
517
518 CALL WRNAME (NTXT, NNDIM, NELBLK, NVARGL, NVARNP, NVAREL,
519 & C(KNAMES+NAMLEN*(KNAMGV-1)), C(KNAMES+NAMLEN*(KNAMNV-1)),
520 & C(KNAMES+NAMLEN*(KNAMEV-1)), A(KIEVOK), NAMLEN)
521
522 C Delete temporary dynamic memory
523 CALL MCDEL('NAMES')
524 CALL MDDEL('ITMP')
525 CALL MCSTAT (CERR, MEM)
526 CALL MDSTAT (NERR, MEM)
527 if ((NERR .GT. 0) .OR. (CERR .GT. 0)) then
528 CALL MEMERR
529 GO TO 140
530 end if
531
532 C --Read the number of database time steps
533 call exinq(ndb, EXTIMS, nsteps, rdum, cdum, ierr)
534
535 CALL MDRSRV ('VARGL', KVARGL, NVARGL)
536 CALL MDRSRV ('VARNP', KVARNP, NVARNP * NUMNP)
537 CALL MDRSRV ('VAREL', KVAREL, NVAREL * NUMEL)
538 CALL MDSTAT (NERR, MEM)
539 if (NERR .GT. 0) then
540 CALL MEMERR
541 GO TO 140
542 end if
543
544 C ... Zero out memory to account for variables not read from DB
545 C due to truth table...
546 CALL INIREA(NVAREL*NUMEL, 0.0, A(KVAREL))
547 CALL INIREA(NVARNP*NUMNP, 0.0, A(KVARNP))
548
549 WRITE (*, *)
550 WRITE (*, *)
551
552 WRITE (*, 10020) NSTEPS
553 10020 FORMAT (' ', I8, ' time steps on the input database')
554 DO 110 ISTEP = 1, NSTEPS
555 CALL DBISTE (NDB, '*', ISTEP, NELBLK, TIME,
556 & NVARGL, NVARNP, NVAREL, NUMNP,
557 & A(KIDELB), A(KNELB), A(KIEVOK),
558 & A(KVARGL), A(KVARNP), A(KVAREL), IOERR)
559 IF (IOERR .EQ. 1) GO TO 140
560
561 CALL WRSTEP (NTXT, ISTEP, NELBLK, TIME,
562 & NVARGL, NVARNP, NVAREL, NUMNP,
563 & A(KIDELB), A(KNELB), A(KIEVOK),
564 & A(KVARGL), A(KVARNP), A(KVAREL),
565 & MAX(1, NVARGL), MAX(1, NVARNP),
566 & MAX(1, NVAREL), IOERR)
567 IF (IOERR .EQ. 1) GO TO 140
568
569 WRITE (*, 10000) ISTEP
570 10000 FORMAT (I8, ' time steps processed')
571 110 CONTINUE
572
573 WRITE (STR8, '(I8)', IOSTAT=K) NSTEPS
574 CALL SQZSTR (STR8, LSTR)
575 WRITE (*, 10010) STR8(:LSTR)
576 10010 FORMAT (/, 4X, A,
577 & ' time steps have been written to the text file')
578
579 C Delete dynamic memory
580 CALL MDDEL ('IDELB')
581 CALL MDDEL ('NUMELB')
582 CALL MDDEL ('ISEVOK')
583 CALL MDDEL ('VARGL')
584 CALL MDDEL ('VARNP')
585 CALL MDDEL ('VAREL')
586 CALL MDSTAT (NERR, MEM)
587 if (NERR .GT. 0) CALL MEMERR
588
589 140 CONTINUE
590
591 CLOSE (NTXT, IOSTAT=K)
592 if (ndb .ne. 11 .and. ndb .gt. 0) call exclos(ndb, ierr)
593 call addlog (QAINFO(1)(:lenstr(QAINFO(1))))
594 CALL PRTERR ('CMDSPEC',
595 $ 'Please use ncdump/ncgen instead of exotxt/txtexo.')
596 CALL WRAPUP (QAINFO(1))
597
598 END
599
600 C ... Written as wrapper to get string lengths correct on coordinate
601 C name array which is dynamically allocated
602 SUBROUTINE GETXYZ(NDB, NAMECO, X, Y, Z, ierr, namlen)
603 character*(NAMLEN) NAMECO(*)
604 real x(*), y(*), z(*)
605 CALL EXGCOR(NDB, X, Y, Z, ierr)
606 call exgcon(ndb, nameco, ierr)
607 return
608 end