Exodus 8.24
Loading...
Searching...
No Matches
/exodus_for/test/testwt.f
1C Copyright(C) 1999-2020 National Technology & Engineering Solutions
2C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3C NTESS, the U.S. Government retains certain rights in this software.
4C
5C See packages/seacas/LICENSE for details
6
7 program testwt
8
9c This is a test program for the Fortran binding of the EXODUS II
10c database write routines.
11
12 include 'exodusII.inc'
13
14 integer iin, iout
15 integer exoid, num_dim,num_nodes,elem_map(5),num_elem,num_elem_blk
16 integer num_elem_in_block(10), num_nodes_per_elem(10),numattr(10)
17 integer num_node_sets, num_side_sets
18 integer i, j, k, m, connect(10)
19 integer node_list(100), elem_list(100), side_list(100)
20 integer ebids(10),ids(10), num_nodes_per_set(10)
21 integer num_elem_per_set(10), num_df_per_set(10)
22 integer df_ind(10), node_ind(10), elem_ind(10)
23 integer num_qa_rec, num_info
24 integer num_glo_vars, num_nod_vars, num_ele_vars
25 integer truth_tab(3,5)
26 integer whole_time_step, num_time_steps
27 integer cpu_word_size, io_word_size
28 integer prop_array(2)
29
30 real glob_var_vals(100), nodal_var_vals(100)
31 real time_value, elem_var_vals(100)
32 real x(100), y(100), z(100)
33 real attrib(100), dist_fact(100)
34
35 character*(MXSTLN) coord_names(3)
36 character*(MXSTLN) blk_names(5)
37 character*(MXSTLN) nset_names(2)
38 character*(MXSTLN) sset_names(5)
39 character*(MXSTLN) cname
40 character*(MXSTLN) var_names(3)
41 character*(MXSTLN) qa_record(4,2)
42 character*(MXLNLN) inform(3)
43 character*(MXSTLN) prop_names(2)
44 character*(MXSTLN) attrib_names(1)
45
46 data iin /5/, iout /6/
47
48 call exopts (exabrt, ierr)
49 write (iout,'("after exopts, error = ", i4)') ierr
50 cpu_word_size = 0
51 io_word_size = 0
52
53c create EXODUS II files
54
55 exoid = excre("test.exo",
56 1 exclob, cpu_word_size, io_word_size, ierr)
57 write (iout,'("after excre for test.exo, id: ", i4)') exoid
58 write (iout,'(" cpu word size: ",i4," io word size: ",i4)')
59 1 cpu_word_size, io_word_size
60 write (iout,'("after excre, error = ", i4)') ierr
61
62c initialize file with parameters
63
64 num_dim = 3
65 num_nodes = 26
66 num_elem = 5
67 num_elem_blk = 5
68 num_node_sets = 2
69 num_side_sets = 5
70 call expini (exoid, "This is a test", num_dim, num_nodes,
71 1 num_elem, num_elem_blk, num_node_sets,
72 2 num_side_sets, ierr)
73
74 write (iout, '("after expini, error = ", i4)' ) ierr
75
76 if (ierr .ne. 0) then
77 call exclos(exoid,ierr)
78 call exit (0)
79 endif
80
81c write nodal coordinates values and names to database
82
83c Quad #1
84 x(1) = 0.0
85 x(2) = 1.0
86 x(3) = 1.0
87 x(4) = 0.0
88
89 y(1) = 0.0
90 y(2) = 0.0
91 y(3) = 1.0
92 y(4) = 1.0
93
94 z(1) = 0.0
95 z(2) = 0.0
96 z(3) = 0.0
97 z(4) = 0.0
98
99c Quad #2
100 x(5) = 1.0
101 x(6) = 2.0
102 x(7) = 2.0
103 x(8) = 1.0
104
105 y(5) = 0.0
106 y(6) = 0.0
107 y(7) = 1.0
108 y(8) = 1.0
109
110 z(5) = 0.0
111 z(6) = 0.0
112 z(7) = 0.0
113 z(8) = 0.0
114
115c Hex #1
116 x(9) = 0.0
117 x(10) = 10.0
118 x(11) = 10.0
119 x(12) = 1.0
120 x(13) = 1.0
121 x(14) = 10.0
122 x(15) = 10.0
123 x(16) = 1.0
124
125 y(9) = 0.0
126 y(10) = 0.0
127 y(11) = 0.0
128 y(12) = 0.0
129 y(13) = 10.0
130 y(14) = 10.0
131 y(15) = 10.0
132 y(16) = 10.0
133
134 z(9) = 0.0
135 z(10) = 0.0
136 z(11) =-10.0
137 z(12) =-10.0
138 z(13) = 0.0
139 z(14) = 0.0
140 z(15) =-10.0
141 z(16) =-10.0
142
143c Tetra #1
144 x(17) = 0.0
145 x(18) = 1.0
146 x(19) = 10.0
147 x(20) = 7.0
148
149 y(17) = 0.0
150 y(18) = 0.0
151 y(19) = 0.0
152 y(20) = 5.0
153
154 z(17) = 0.0
155 z(18) = 5.0
156 z(19) = 2.0
157 z(20) = 3.0
158
159c Wedge #1
160 x(21) = 3.0
161 x(22) = 6.0
162 x(23) = 0.0
163 x(24) = 3.0
164 x(25) = 6.0
165 x(26) = 0.0
166
167 y(21) = 0.0
168 y(22) = 0.0
169 y(23) = 0.0
170 y(24) = 2.0
171 y(25) = 2.0
172 y(26) = 2.0
173
174 z(21) = 6.0
175 z(22) = 0.0
176 z(23) = 0.0
177 z(24) = 6.0
178 z(25) = 2.0
179 z(26) = 0.0
180 call expcor (exoid, x, y, z, ierr)
181 write (iout, '("after expcor, error = ", i4)' ) ierr
182 if (ierr .ne. 0) then
183 call exclos(exoid,ierr)
184 call exit (0)
185 endif
186
187 coord_names(1) = "xcoor"
188 coord_names(2) = "ycoor"
189 coord_names(3) = "zcoor"
190
191 call expcon (exoid, coord_names, ierr)
192 write (iout, '("after expcon, error = ", i4)' ) ierr
193 call exupda(exoid,ierr)
194 if (ierr .ne. 0) then
195 call exclos(exoid,ierr)
196 call exit (0)
197 endif
198
199c write element order map
200
201 do 10 i = 1, num_elem
202 elem_map(i) = i
20310 continue
204
205 call expmap (exoid, elem_map, ierr)
206 write (iout, '("after expmap, error = ", i4)' ) ierr
207 if (ierr .ne. 0) then
208 call exclos(exoid,ierr)
209 call exit (0)
210 endif
211
212c write element block parameters
213
214 num_elem_in_block(1) = 1
215 num_elem_in_block(2) = 1
216 num_elem_in_block(3) = 1
217 num_elem_in_block(4) = 1
218 num_elem_in_block(5) = 1
219
220 num_nodes_per_elem(1) = 4
221 num_nodes_per_elem(2) = 4
222 num_nodes_per_elem(3) = 8
223 num_nodes_per_elem(4) = 4
224 num_nodes_per_elem(5) = 6
225
226 ebids(1) = 10
227 ebids(2) = 11
228 ebids(3) = 12
229 ebids(4) = 13
230 ebids(5) = 14
231
232 numattr(1) = 1
233 numattr(2) = 1
234 numattr(3) = 1
235 numattr(4) = 1
236 numattr(5) = 1
237
238 cname = "quad"
239 call expelb (exoid,ebids(1),cname,num_elem_in_block(1),
240 1 num_nodes_per_elem(1),numattr(1),ierr)
241 write (iout, '("after expelb, error = ", i4)' ) ierr
242 if (ierr .ne. 0) then
243 call exclos(exoid,ierr)
244 call exit (0)
245 endif
246
247 call expelb (exoid,ebids(2),cname,num_elem_in_block(2),
248 1 num_nodes_per_elem(2),numattr(2),ierr)
249 write (iout, '("after expelb, error = ", i4)' ) ierr
250 if (ierr .ne. 0) then
251 call exclos(exoid,ierr)
252 call exit (0)
253 endif
254
255 cname = "hex"
256 call expelb (exoid,ebids(3),cname,num_elem_in_block(3),
257 1 num_nodes_per_elem(3),numattr(3),ierr)
258 write (iout, '("after expelb, error = ", i4)' ) ierr
259 if (ierr .ne. 0) then
260 call exclos(exoid,ierr)
261 call exit (0)
262 endif
263
264 cname = "tetra"
265 call expelb (exoid,ebids(4),cname,num_elem_in_block(4),
266 1 num_nodes_per_elem(4),numattr(4),ierr)
267 write (iout, '("after expelb, error = ", i4)' ) ierr
268 if (ierr .ne. 0) then
269 call exclos(exoid,ierr)
270 call exit (0)
271 endif
272
273 cname = "wedge"
274 call expelb (exoid,ebids(5),cname,num_elem_in_block(5),
275 1 num_nodes_per_elem(5),numattr(5),ierr)
276 write (iout, '("after expelb, error = ", i4)' ) ierr
277 if (ierr .ne. 0) then
278 call exclos(exoid,ierr)
279 call exit (0)
280 endif
281
282 blk_names(1) = "block_a";
283 blk_names(2) = "block_b";
284 blk_names(3) = "block_c";
285 blk_names(4) = "block_d";
286 blk_names(5) = "block_e";
287
288 call expnams(exoid, ex_elem_block, num_elem_blk, blk_names, ierr)
289 write (iout, '("after expnams, error = ", i4)' ) ierr
290 if (ierr .ne. 0) then
291 call exclos(exoid,ierr)
292 call exit (0)
293 endif
294
295c write element block properties
296
297 prop_names(1) = "MATL"
298 prop_names(2) = "DENSITY"
299 call exppn(exoid,ex_elem_block,2,prop_names,ierr)
300 write (iout, '("after exppn, error = ", i4)' ) ierr
301 if (ierr .ne. 0) then
302 call exclos(exoid,ierr)
303 call exit (0)
304 endif
305
306 call expp(exoid, ex_elem_block, ebids(1), "MATL", 10, ierr)
307 write (iout, '("after expp, error = ", i4)' ) ierr
308 if (ierr .ne. 0) then
309 call exclos(exoid,ierr)
310 call exit (0)
311 endif
312 call expp(exoid, ex_elem_block, ebids(2), "MATL", 20, ierr)
313 write (iout, '("after expp, error = ", i4)' ) ierr
314 if (ierr .ne. 0) then
315 call exclos(exoid,ierr)
316 call exit (0)
317 endif
318 call expp(exoid, ex_elem_block, ebids(3), "MATL", 30, ierr)
319 write (iout, '("after expp, error = ", i4)' ) ierr
320 if (ierr .ne. 0) then
321 call exclos(exoid,ierr)
322 call exit (0)
323 endif
324 call expp(exoid, ex_elem_block, ebids(4), "MATL", 40, ierr)
325 write (iout, '("after expp, error = ", i4)' ) ierr
326 if (ierr .ne. 0) then
327 call exclos(exoid,ierr)
328 call exit (0)
329 endif
330 call expp(exoid, ex_elem_block, ebids(5), "MATL", 50, ierr)
331 write (iout, '("after expp, error = ", i4)' ) ierr
332 if (ierr .ne. 0) then
333 call exclos(exoid,ierr)
334 call exit (0)
335 endif
336
337c write element connectivity
338
339 connect(1) = 1
340 connect(2) = 2
341 connect(3) = 3
342 connect(4) = 4
343
344 call expelc (exoid, ebids(1), connect, ierr)
345 write (iout, '("after expelc, error = ", i4)' ) ierr
346 if (ierr .ne. 0) then
347 call exclos(exoid,ierr)
348 call exit (0)
349 endif
350
351 connect(1) = 5
352 connect(2) = 6
353 connect(3) = 7
354 connect(4) = 8
355
356 call expelc (exoid, ebids(2), connect, ierr)
357 write (iout, '("after expelc, error = ", i4)' ) ierr
358 if (ierr .ne. 0) then
359 call exclos(exoid,ierr)
360 call exit (0)
361 endif
362
363 connect(1) = 9
364 connect(2) = 10
365 connect(3) = 11
366 connect(4) = 12
367 connect(5) = 13
368 connect(6) = 14
369 connect(7) = 15
370 connect(8) = 16
371
372 call expelc (exoid, ebids(3), connect, ierr)
373 write (iout, '("after expelc, error = ", i4)' ) ierr
374 if (ierr .ne. 0) then
375 call exclos(exoid,ierr)
376 call exit (0)
377 endif
378
379 connect(1) = 17
380 connect(2) = 18
381 connect(3) = 19
382 connect(4) = 20
383
384 call expelc (exoid, ebids(4), connect, ierr)
385 write (iout, '("after expelc, error = ", i4)' ) ierr
386 if (ierr .ne. 0) then
387 call exclos(exoid,ierr)
388 call exit (0)
389 endif
390
391 connect(1) = 21
392 connect(2) = 22
393 connect(3) = 23
394 connect(4) = 24
395 connect(5) = 25
396 connect(6) = 26
397
398 call expelc (exoid, ebids(5), connect, ierr)
399 write (iout, '("after expelc, error = ", i4)' ) ierr
400 if (ierr .ne. 0) then
401 call exclos(exoid,ierr)
402 call exit (0)
403 endif
404
405c write element block attributes
406
407 attrib(1) = 3.14159
408 call expeat (exoid, ebids(1), attrib, ierr)
409 write (iout, '("after expeat, error = ", i4)' ) ierr
410 if (ierr .ne. 0) then
411 call exclos(exoid,ierr)
412 call exit (0)
413 endif
414
415 attrib(1) = 6.14159
416 call expeat (exoid, ebids(2), attrib, ierr)
417 write (iout, '("after expeat, error = ", i4)' ) ierr
418 if (ierr .ne. 0) then
419 call exclos(exoid,ierr)
420 call exit (0)
421 endif
422
423 call expeat (exoid, ebids(3), attrib, ierr)
424 write (iout, '("after expeat, error = ", i4)' ) ierr
425 if (ierr .ne. 0) then
426 call exclos(exoid,ierr)
427 call exit (0)
428 endif
429
430 call expeat (exoid, ebids(4), attrib, ierr)
431 write (iout, '("after expeat, error = ", i4)' ) ierr
432 if (ierr .ne. 0) then
433 call exclos(exoid,ierr)
434 call exit (0)
435 endif
436
437 call expeat (exoid, ebids(5), attrib, ierr)
438 write (iout, '("after expeat, error = ", i4)' ) ierr
439 if (ierr .ne. 0) then
440 call exclos(exoid,ierr)
441 call exit (0)
442 endif
443
444 attrib_names(1) = 'THICKNESS'
445 do i=1, 5
446 call expean (exoid, ebids(i), 1, attrib_names, ierr)
447 write (iout, '("after expean, error = ", i4)' ) ierr
448 if (ierr .ne. 0) then
449 call exclos(exoid,ierr)
450 call exit (0)
451 endif
452 end do
453
454c write individual node sets
455
456 node_list(1) = 100
457 node_list(2) = 101
458 node_list(3) = 102
459 node_list(4) = 103
460 node_list(5) = 104
461
462 dist_fact(1) = 1.0
463 dist_fact(2) = 2.0
464 dist_fact(3) = 3.0
465 dist_fact(4) = 4.0
466 dist_fact(5) = 5.0
467
468 call expnp (exoid, 20, 5, 5, ierr)
469 write (iout, '("after expnp, error = ", i4)' ) ierr
470 if (ierr .ne. 0) then
471 call exclos(exoid,ierr)
472 call exit (0)
473 endif
474 call expns (exoid, 20, node_list, ierr)
475 write (iout, '("after expns, error = ", i4)' ) ierr
476 if (ierr .ne. 0) then
477 call exclos(exoid,ierr)
478 call exit (0)
479 endif
480 call expnsd (exoid, 20, dist_fact, ierr)
481 write (iout, '("after expnsd, error = ", i4)' ) ierr
482 if (ierr .ne. 0) then
483 call exclos(exoid,ierr)
484 call exit (0)
485 endif
486
487 node_list(1) = 200
488 node_list(2) = 201
489 node_list(3) = 202
490
491 dist_fact(1) = 1.1
492 dist_fact(2) = 2.1
493 dist_fact(3) = 3.1
494
495 call expnp (exoid, 21, 3, 3, ierr)
496 write (iout, '("after expnp, error = ", i4)' ) ierr
497 if (ierr .ne. 0) then
498 call exclos(exoid,ierr)
499 call exit (0)
500 endif
501 call expns (exoid, 21, node_list, ierr)
502 write (iout, '("after expns, error = ", i4)' ) ierr
503 if (ierr .ne. 0) then
504 call exclos(exoid,ierr)
505 call exit (0)
506 endif
507 call expnsd (exoid, 21, dist_fact, ierr)
508 write (iout, '("after expnsd, error = ", i4)' ) ierr
509 if (ierr .ne. 0) then
510 call exclos(exoid,ierr)
511 call exit (0)
512 endif
513
514c write concatenated node sets; this produces the same information as
515c the above code which writes individual node sets
516
517 ids(1) = 20
518 ids(2) = 21
519
520 num_nodes_per_set(1) = 5
521 num_nodes_per_set(2) = 3
522
523 num_df_per_set(1) = 5
524 num_df_per_set(2) = 3
525
526 node_ind(1) = 1
527 node_ind(2) = 6
528
529 df_ind(1) = 1
530 df_ind(2) = 6
531
532 node_list(1) = 100
533 node_list(2) = 101
534 node_list(3) = 102
535 node_list(4) = 103
536 node_list(5) = 104
537 node_list(6) = 200
538 node_list(7) = 201
539 node_list(8) = 202
540
541 dist_fact(1) = 1.0
542 dist_fact(2) = 2.0
543 dist_fact(3) = 3.0
544 dist_fact(4) = 4.0
545 dist_fact(5) = 5.0
546 dist_fact(6) = 1.1
547 dist_fact(7) = 2.1
548 dist_fact(8) = 3.1
549
550c call expcns (exoid, ids, num_nodes_per_set, num_df_per_set,
551c 1 node_ind, df_ind, node_list, dist_fact, ierr)
552c write (iout, '("after expcns, error = ", i4)' ) ierr
553
554 nset_names(1) = "nodeset_a1";
555 nset_names(2) = "nodeset_b2";
556
557 call expnams(exoid, ex_node_set, num_node_sets, nset_names, ierr)
558 write (iout, '("after expnams, error = ", i4)' ) ierr
559 if (ierr .ne. 0) then
560 call exclos(exoid,ierr)
561 call exit (0)
562 endif
563
564c write node set properties
565
566 prop_names(1) = "FACE"
567 call expp(exoid, ex_node_set, 20, prop_names(1), 4, ierr)
568 write (iout, '("after expp, error = ", i4)' ) ierr
569 if (ierr .ne. 0) then
570 call exclos(exoid,ierr)
571 call exit (0)
572 endif
573
574 call expp(exoid, ex_node_set, 21, prop_names(1), 5, ierr)
575 write (iout, '("after expp, error = ", i4)' ) ierr
576 if (ierr .ne. 0) then
577 call exclos(exoid,ierr)
578 call exit (0)
579 endif
580
581 prop_array(1) = 1000
582 prop_array(2) = 2000
583
584 prop_names(1) = "VELOCITY"
585 call exppa(exoid, ex_node_set, prop_names(1), prop_array, ierr)
586 write (iout, '("after exppa, error = ", i4)' ) ierr
587 if (ierr .ne. 0) then
588 call exclos(exoid,ierr)
589 call exit (0)
590 endif
591
592c write individual side sets
593
594c side set #1 - quad
595
596 elem_list(1) = 2
597 elem_list(2) = 2
598
599 side_list(1) = 4
600 side_list(2) = 2
601
602 dist_fact(1) = 30.0
603 dist_fact(2) = 30.1
604 dist_fact(3) = 30.2
605 dist_fact(4) = 30.3
606
607 call expsp (exoid, 30, 2, 4, ierr)
608 write (iout, '("after expsp, error = ", i4)' ) ierr
609 if (ierr .ne. 0) then
610 call exclos(exoid,ierr)
611 call exit (0)
612 endif
613
614 call expss (exoid, 30, elem_list, side_list, ierr)
615 write (iout, '("after expss, error = ", i4)' ) ierr
616 if (ierr .ne. 0) then
617 call exclos(exoid,ierr)
618 call exit (0)
619 endif
620
621 call expssd (exoid, 30, dist_fact, ierr)
622 write (iout, '("after expssd, error = ", i4)' ) ierr
623 if (ierr .ne. 0) then
624 call exclos(exoid,ierr)
625 call exit (0)
626 endif
627
628c side set #2 - quad, spanning 2 elements
629
630 elem_list(1) = 1
631 elem_list(2) = 2
632
633 side_list(1) = 2
634 side_list(2) = 3
635
636 dist_fact(1) = 31.0
637 dist_fact(2) = 31.1
638 dist_fact(3) = 31.2
639 dist_fact(4) = 31.3
640
641 call expsp (exoid, 31, 2, 4, ierr)
642 write (iout, '("after expsp, error = ", i4)' ) ierr
643 if (ierr .ne. 0) then
644 call exclos(exoid,ierr)
645 call exit (0)
646 endif
647
648 call expss (exoid, 31, elem_list, side_list, ierr)
649 write (iout, '("after expss, error = ", i4)' ) ierr
650 if (ierr .ne. 0) then
651 call exclos(exoid,ierr)
652 call exit (0)
653 endif
654
655 call expssd (exoid, 31, dist_fact, ierr)
656 write (iout, '("after expssd, error = ", i4)' ) ierr
657 if (ierr .ne. 0) then
658 call exclos(exoid,ierr)
659 call exit (0)
660 endif
661
662c side set #3 - hex
663
664 elem_list(1) = 3
665 elem_list(2) = 3
666 elem_list(3) = 3
667 elem_list(4) = 3
668 elem_list(5) = 3
669 elem_list(6) = 3
670 elem_list(7) = 3
671
672 side_list(1) = 5
673 side_list(2) = 3
674 side_list(3) = 3
675 side_list(4) = 2
676 side_list(5) = 4
677 side_list(6) = 1
678 side_list(7) = 6
679
680 call expsp (exoid, 32, 7, 0, ierr)
681 write (iout, '("after expsp, error = ", i4)' ) ierr
682 if (ierr .ne. 0) then
683 call exclos(exoid,ierr)
684 call exit (0)
685 endif
686
687 call expss (exoid, 32, elem_list, side_list, ierr)
688 write (iout, '("after expss, error = ", i4)' ) ierr
689 if (ierr .ne. 0) then
690 call exclos(exoid,ierr)
691 call exit (0)
692 endif
693
694c side set #4 - tetras
695
696 elem_list(1) = 4
697 elem_list(2) = 4
698 elem_list(3) = 4
699 elem_list(4) = 4
700
701 side_list(1) = 1
702 side_list(2) = 2
703 side_list(3) = 3
704 side_list(4) = 4
705
706 call expsp (exoid, 33, 4, 0, ierr)
707 write (iout, '("after expsp, error = ", i4)' ) ierr
708 if (ierr .ne. 0) then
709 call exclos(exoid,ierr)
710 call exit (0)
711 endif
712
713 call expss (exoid, 33, elem_list, side_list, ierr)
714 write (iout, '("after expss, error = ", i4)' ) ierr
715 if (ierr .ne. 0) then
716 call exclos(exoid,ierr)
717 call exit (0)
718 endif
719
720c side set #5 - wedges
721
722 elem_list(1) = 5
723 elem_list(2) = 5
724 elem_list(3) = 5
725 elem_list(4) = 5
726 elem_list(5) = 5
727
728 side_list(1) = 1
729 side_list(2) = 2
730 side_list(3) = 3
731 side_list(4) = 4
732 side_list(5) = 5
733
734 call expsp (exoid, 34, 5, 0, ierr)
735 write (iout, '("after expsp, error = ", i4)' ) ierr
736 if (ierr .ne. 0) then
737 call exclos(exoid,ierr)
738 call exit (0)
739 endif
740
741 call expss (exoid, 34, elem_list, side_list, ierr)
742 write (iout, '("after expss, error = ", i4)' ) ierr
743 if (ierr .ne. 0) then
744 call exclos(exoid,ierr)
745 call exit (0)
746 endif
747
748c write concatenated side sets; this produces the same information as
749c the above code which writes individual side sets
750
751 ids(1) = 30
752 ids(2) = 31
753 ids(3) = 32
754 ids(4) = 33
755 ids(5) = 34
756
757c side set #1
758 node_list(1) = 8
759 node_list(2) = 5
760 node_list(3) = 6
761 node_list(4) = 7
762
763c side set #2
764 node_list(5) = 2
765 node_list(6) = 3
766 node_list(7) = 7
767 node_list(8) = 8
768
769c side set #3
770 node_list(9) = 9
771 node_list(10) = 12
772 node_list(11) = 11
773 node_list(12) = 10
774
775 node_list(13) = 11
776 node_list(14) = 12
777 node_list(15) = 16
778 node_list(16) = 15
779
780 node_list(17) = 16
781 node_list(18) = 15
782 node_list(19) = 11
783 node_list(20) = 12
784
785 node_list(21) = 10
786 node_list(22) = 11
787 node_list(23) = 15
788 node_list(24) = 14
789
790 node_list(25) = 13
791 node_list(26) = 16
792 node_list(27) = 12
793 node_list(28) = 9
794
795 node_list(29) = 14
796 node_list(30) = 13
797 node_list(31) = 9
798 node_list(32) = 10
799
800 node_list(33) = 16
801 node_list(34) = 13
802 node_list(35) = 14
803 node_list(36) = 15
804
805c side set #4
806 node_list(37) = 17
807 node_list(38) = 18
808 node_list(39) = 20
809
810 node_list(40) = 18
811 node_list(41) = 19
812 node_list(42) = 20
813
814 node_list(43) = 20
815 node_list(44) = 19
816 node_list(45) = 17
817
818 node_list(46) = 19
819 node_list(47) = 18
820 node_list(48) = 17
821
822c side set #5
823 node_list(49) = 25
824 node_list(50) = 24
825 node_list(51) = 21
826 node_list(52) = 22
827
828 node_list(53) = 26
829 node_list(54) = 25
830 node_list(55) = 22
831 node_list(56) = 23
832
833 node_list(57) = 26
834 node_list(58) = 23
835 node_list(59) = 21
836 node_list(60) = 24
837
838 node_list(61) = 23
839 node_list(62) = 22
840 node_list(63) = 21
841
842 node_list(64) = 24
843 node_list(65) = 25
844 node_list(66) = 26
845
846 num_elem_per_set(1) = 2
847 num_elem_per_set(2) = 2
848 num_elem_per_set(3) = 7
849 num_elem_per_set(4) = 4
850 num_elem_per_set(5) = 5
851
852 num_nodes_per_set(1) = 4
853 num_nodes_per_set(2) = 4
854 num_nodes_per_set(3) = 28
855 num_nodes_per_set(4) = 12
856 num_nodes_per_set(5) = 20
857
858 elem_ind(1) = 1
859 elem_ind(2) = 3
860 elem_ind(3) = 5
861 elem_ind(4) = 12
862 elem_ind(5) = 16
863
864 node_ind(1) = 1
865 node_ind(2) = 5
866 node_ind(3) = 9
867 node_ind(4) = 37
868 node_ind(5) = 48
869
870 elem_list(1) = 3
871 elem_list(2) = 3
872 elem_list(3) = 1
873 elem_list(4) = 3
874 elem_list(5) = 4
875 elem_list(6) = 4
876 elem_list(7) = 4
877 elem_list(8) = 4
878 elem_list(9) = 4
879 elem_list(10) = 4
880 elem_list(11) = 4
881 elem_list(12) = 5
882 elem_list(13) = 5
883 elem_list(14) = 5
884 elem_list(15) = 5
885 elem_list(16) = 6
886 elem_list(17) = 6
887 elem_list(18) = 6
888 elem_list(19) = 6
889 elem_list(20) = 6
890
891c side_list(1) = 1
892c side_list(2) = 2
893c side_list(3) = 3
894c side_list(4) = 4
895
896c call excn2s(exoid, num_elem_per_set, num_nodes_per_set, elem_ind,
897c 1 node_ind, elem_list, node_list, side_list, ierr)
898c write (iout, '("after excn2s, error = ", i4)' ) ierr
899
900 num_df_per_set(1) = 4
901 num_df_per_set(2) = 4
902 num_df_per_set(3) = 0
903 num_df_per_set(4) = 0
904 num_df_per_set(5) = 0
905
906 df_ind(1) = 1
907 df_ind(2) = 5
908
909 dist_fact(1) = 30.0
910 dist_fact(2) = 30.1
911 dist_fact(3) = 30.2
912 dist_fact(4) = 30.3
913 dist_fact(5) = 31.0
914 dist_fact(6) = 31.1
915 dist_fact(7) = 31.2
916 dist_fact(8) = 31.3
917
918c call expcss (exoid, ids, num_elem_per_set, num_df_per_set,
919c 1 elem_ind, df_ind, elem_list, side_list, dist_fact,
920c 2 ierr)
921c write (iout, '("after expcss, error = ", i4)' ) ierr
922
923 prop_names(1) = "COLOR"
924 call expp(exoid, ex_side_set, 30, prop_names(1), 100, ierr)
925 write (iout, '("after expp, error = ", i4)' ) ierr
926 if (ierr .ne. 0) then
927 call exclos(exoid,ierr)
928 call exit (0)
929 endif
930
931 call expp(exoid, ex_side_set, 31, prop_names(1), 101, ierr)
932 write (iout, '("after expp, error = ", i4)' ) ierr
933 if (ierr .ne. 0) then
934 call exclos(exoid,ierr)
935 call exit (0)
936 endif
937
938 sset_names(1) = "surf_first"
939 sset_names(2) = "surf_second";
940 sset_names(3) = "surf_third";
941 sset_names(4) = "surf_fourth";
942 sset_names(5) = "surf_fifth";
943
944 call expnams(exoid, ex_side_set, num_side_sets, sset_names, ierr)
945 write (iout, '("after expnams, error = ", i4)' ) ierr
946 if (ierr .ne. 0) then
947 call exclos(exoid,ierr)
948 call exit (0)
949 endif
950
951c write QA records
952
953 num_qa_rec = 2
954
955 qa_record(1,1) = "TESTWT fortran version"
956 qa_record(2,1) = "testwt"
957 qa_record(3,1) = "07/07/93"
958 qa_record(4,1) = "15:41:33"
959 qa_record(1,2) = "FASTQ"
960 qa_record(2,2) = "fastq"
961 qa_record(3,2) = "07/07/93"
962 qa_record(4,2) = "16:41:33"
963
964 call expqa (exoid, num_qa_rec, qa_record, ierr)
965 write (iout, '("after expqa, error = ", i4)' ) ierr
966 if (ierr .ne. 0) then
967 call exclos(exoid,ierr)
968 call exit (0)
969 endif
970
971c write information records
972
973 num_info = 3
974
975 inform(1) = "This is the first information record."
976 inform(2) = "This is the second information record."
977 inform(3) = "This is the third information record."
978
979 call expinf (exoid, num_info, inform, ierr)
980 write (iout, '("after expinf, error = ", i4)' ) ierr
981 if (ierr .ne. 0) then
982 call exclos(exoid,ierr)
983 call exit (0)
984 endif
985
986c write results variables parameters and names
987
988 num_glo_vars = 1
989
990 var_names(1) = "glo_vars"
991
992 call expvp (exoid, "g", num_glo_vars, ierr)
993 write (iout, '("after expvp, error = ", i4)' ) ierr
994 if (ierr .ne. 0) then
995 call exclos(exoid,ierr)
996 call exit (0)
997 endif
998 call expvan (exoid, "g", num_glo_vars, var_names, ierr)
999 write (iout, '("after expvan, error = ", i4)' ) ierr
1000 if (ierr .ne. 0) then
1001 call exclos(exoid,ierr)
1002 call exit (0)
1003 endif
1004
1005 num_nod_vars = 2
1006
1007 var_names(1) = "nod_var0"
1008 var_names(2) = "nod_var1"
1009
1010 call expvp (exoid, "n", num_nod_vars, ierr)
1011 write (iout, '("after expvp, error = ", i4)' ) ierr
1012 if (ierr .ne. 0) then
1013 call exclos(exoid,ierr)
1014 call exit (0)
1015 endif
1016 call expvan (exoid, "n", num_nod_vars, var_names, ierr)
1017 write (iout, '("after expvan, error = ", i4)' ) ierr
1018 if (ierr .ne. 0) then
1019 call exclos(exoid,ierr)
1020 call exit (0)
1021 endif
1022
1023 num_ele_vars = 3
1024
1025 var_names(1) = "ele_var0"
1026 var_names(2) = "ele_var1"
1027 var_names(3) = "ele_var2"
1028
1029 call expvp (exoid, "e", num_ele_vars, ierr)
1030 write (iout, '("after expvp, error = ", i4)' ) ierr
1031 if (ierr .ne. 0) then
1032 call exclos(exoid,ierr)
1033 call exit (0)
1034 endif
1035 call expvan (exoid, "e", num_ele_vars, var_names, ierr)
1036 write (iout, '("after expvan, error = ", i4)' ) ierr
1037 if (ierr .ne. 0) then
1038 call exclos(exoid,ierr)
1039 call exit (0)
1040 endif
1041
1042c write element variable truth table
1043
1044 k = 0
1045
1046 do 30 i = 1,num_elem_blk
1047 do 20 j = 1,num_ele_vars
1048 truth_tab(j,i) = 1
104920 continue
105030 continue
1051
1052 call expvtt (exoid, num_elem_blk, num_ele_vars, truth_tab, ierr)
1053 write (iout, '("after expvtt, error = ", i4)' ) ierr
1054 if (ierr .ne. 0) then
1055 call exclos(exoid,ierr)
1056 call exit (0)
1057 endif
1058
1059c for each time step, write the analysis results;
1060c the code below fills the arrays glob_var_vals,
1061c nodal_var_vals, and elem_var_vals with values for debugging purposes;
1062c obviously the analysis code will populate these arrays
1063
1064 whole_time_step = 1
1065 num_time_steps = 10
1066
1067 do 110 i = 1, num_time_steps
1068 time_value = real(i)/100.
1069
1070c write time value
1071
1072 call exptim (exoid, whole_time_step, time_value, ierr)
1073 write (iout, '("after exptim, error = ", i4)' ) ierr
1074 if (ierr .ne. 0) then
1075 call exclos(exoid,ierr)
1076 call exit (0)
1077 endif
1078
1079c write global variables
1080
1081 do 50 j = 1, num_glo_vars
1082 glob_var_vals(j) = real(j+1) * time_value
108350 continue
1084
1085 call expgv (exoid, whole_time_step, num_glo_vars,
1086 1 glob_var_vals, ierr)
1087 write (iout, '("after expgv, error = ", i4)' ) ierr
1088 if (ierr .ne. 0) then
1089 call exclos(exoid,ierr)
1090 call exit (0)
1091 endif
1092
1093c write nodal variables
1094
1095 do 70 k = 1, num_nod_vars
1096 do 60 j = 1, num_nodes
1097
1098 nodal_var_vals(j) = real(k) + (real(j) * time_value)
1099
110060 continue
1101
1102 call expnv (exoid, whole_time_step, k, num_nodes,
1103 1 nodal_var_vals, ierr)
1104 write (iout, '("after expnv, error = ", i4)' ) ierr
1105 if (ierr .ne. 0) then
1106 call exclos(exoid,ierr)
1107 call exit (0)
1108 endif
1109
111070 continue
1111
1112c write element variables
1113
1114 do 100 k = 1, num_ele_vars
1115 do 90 j = 1, num_elem_blk
1116 do 80 m = 1, num_elem_in_block(j)
1117
1118 elem_var_vals(m) = real(k+1) + real(j+1) +
1119 1 (real(m)*time_value)
1120c write(iout,*)'elem_var_val(',m,'): ',elem_var_vals(m)
1121
112280 continue
1123
1124 call expev (exoid, whole_time_step, k, ebids(j),
1125 1 num_elem_in_block(j), elem_var_vals, ierr)
1126 write (iout, '("after expev, error = ", i4)' ) ierr
1127 if (ierr .ne. 0) then
1128 call exclos(exoid,ierr)
1129 call exit (0)
1130 endif
1131
113290 continue
1133100 continue
1134
1135 whole_time_step = whole_time_step + 1
1136
1137c update the data file; this should be done at the end of every time
1138c step to ensure that no data is lost if the analysis dies
1139
1140 call exupda (exoid, ierr)
1141 write (iout, '("after exupda, error = ", i4)' ) ierr
1142 if (ierr .ne. 0) then
1143 call exclos(exoid,ierr)
1144 call exit (0)
1145 endif
1146
1147110 continue
1148
1149c close the EXODUS files
1150
1151 call exclos (exoid, ierr)
1152 write (iout, '("after exclos, error = ", i4)' ) ierr
1153
1154 stop
1155 end
#define real
Definition exo_jack-windows.c:59
void expgv(int *idexo, int *time_step, int *num_glob_vars, real *glob_var_vals, int *ierr)
Definition exo_jack.c:2184
int excre(char *path, int *clobmode, int *cpu_word_size, int *io_word_size, int *ierr, int pathlen)
Definition exo_jack.c:179
void expini(int *idexo, char *title, void_int *num_dim, void_int *num_nodes, void_int *num_elem, void_int *num_elem_blk, void_int *num_node_sets, void_int *num_side_sets, int *ierr, int titlelen)
Definition exo_jack.c:242
void expcor(int *idexo, real *x_coor, real *y_coor, real *z_coor, int *ierr)
Definition exo_jack.c:558
void expnp(int *idexo, entity_id *node_set_id, void_int *num_nodes_in_set, void_int *num_dist_in_set, int *ierr)
Definition exo_jack.c:1505
void expssd(int *idexo, entity_id *side_set_id, real *side_set_dist_fact, int *ierr)
Definition exo_jack.c:1744
void expnv(int *idexo, int *time_step, int *nodal_var_index, void_int *num_nodes, real *nodal_var_vals, int *ierr)
Definition exo_jack.c:2215
void expnams(int *idexo, int *type, int *num_obj, char *names, int *ierr, int nameslen)
Definition exo_jack.c:1053
void expsp(int *idexo, entity_id *side_set_id, void_int *num_sides_in_set, void_int *num_df_in_set, int *ierr)
Definition exo_jack.c:1686
void expvan(int *idexo, char *var_type, int *num_vars, char *var_names, int *ierr, int var_typelen, int var_nameslen)
Definition exo_jack.c:1942
void expqa(int *idexo, int *num_qa_records, char *qa_record, int *ierr, int qa_recordlen)
Definition exo_jack.c:313
void expeat(int *idexo, entity_id *elem_blk_id, real *attrib, int *ierr)
Definition exo_jack.c:928
void exclos(int *idexo, int *ierr)
Definition exo_jack.c:230
void expnsd(int *idexo, entity_id *node_set_id, real *node_set_dist_fact, int *ierr)
Definition exo_jack.c:1543
void expev(int *idexo, int *time_step, int *elem_var_index, entity_id *elem_blk_id, void_int *num_elem_this_blk, real *elem_var_vals, int *ierr)
Definition exo_jack.c:2270
void expp(int *idexo, int *obj_type, entity_id *obj_id, char *prop_name, entity_id *value, int *ierr, int prop_namelen)
Definition exo_jack.c:1369
void expss(int *idexo, entity_id *side_set_id, void_int *side_set_elem_list, void_int *side_set_side_list, int *ierr)
Definition exo_jack.c:1724
void expelb(int *idexo, entity_id *elem_blk_id, char *elem_type, void_int *num_elem_this_blk, void_int *num_nodes_per_elem, void_int *num_attr, int *ierr, int elem_typelen)
Definition exo_jack.c:764
void exppn(int *idexo, int *obj_type, int *num_props, char *prop_names, int *ierr, int prop_nameslen)
Definition exo_jack.c:1228
void expvtt(int *idexo, int *num_entity, int *num_var, int *var_tab, int *ierr)
Definition exo_jack.c:2062
void expns(int *idexo, entity_id *node_set_id, void_int *node_set_node_list, int *ierr)
Definition exo_jack.c:1534
void expmap(int *idexo, void_int *elem_map, int *ierr)
Definition exo_jack.c:695
void expean(int *idexo, entity_id *elem_blk_id, int *num_attr, char *names, int *ierr, int nameslen)
Definition exo_jack.c:1003
void expelc(int *idexo, entity_id *elem_blk_id, void_int *connect, int *ierr)
Definition exo_jack.c:846
void expcon(int *idexo, char *coord_names, int *ierr, int coord_nameslen)
Definition exo_jack.c:576
void expinf(int *idexo, int *num_info, char *info, int *ierr, int infolen)
Definition exo_jack.c:449
void expvp(int *idexo, char *var_type, int *num_vars, int *ierr, int var_typelen)
Definition exo_jack.c:1920
void exopts(int *option_val, int *ierr)
Definition exo_jack.c:2656
void exppa(int *idexo, int *obj_type, char *prop_name, void_int *values, int *ierr, int prop_namelen)
Definition exo_jack.c:1471
void exupda(int *idexo, int *ierr)
Definition exo_jack.c:236
void exptim(int *idexo, int *time_step, real *time_value, int *ierr)
Definition exo_jack.c:2399