Debian Codegraph @

packages/seacas/applications/algebra/ag_wnam.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 C=======================================================================
7 SUBROUTINE WNAM (NDBOUT, NDIM, NELBLK, NELBO, VISELB,
8 & NVARGO, NVARNO, NVAREO, NAMECO, BLKTYP,
9 & NAMEGV, NAMENV, NAMEEV, IEVVAR, ISEVOK,
10 & IDELB, NEWID, IEVOK)
11
12 C=======================================================================
13
14 C --*** WNAM *** Write the names of the coordinates, element block
15 C -- types, and the database result variables. Also,
16 C -- write the element block variable truth table
17 C -- Modified from RWNAM
18 C --*** RWNAM *** (ALGEBRA) Read and write database names
19 C -- Written by Amy Gilkey - revised 12/14/87
20 C --
21 C --Parameters:
22 C -- NDBOUT - IN - the output database file
23 C -- NDIM - IN - the number of coordinates per node
24 C -- NELBLK - IN - the number of input element blocks
25 C -- NELBO - IN - the number of output element blocks
26 C -- VISELB - IN - true iff element block i is to be written
27 C -- NVARGO - IN - the number of output global variables
28 C -- NVARNO - IN - the number of output nodal variables
29 C -- NVAREO - IN - the number of output element variables
30 C -- NAMECO - IN - the names of the coordinates
31 C -- BLKTYP - IN - the names of the element block types
32 C -- NAMEGV - IN - the names of the output global variables
33 C -- NAMENV - IN - the names of the output nodal variables
34 C -- NAMEEV - IN - the names of the output element variables
35 C -- IEVVAR - IN - the ISEVOK index of the output element variables
36 C -- ISEVOK - IN - the element block variable truth table;
37 C -- variable i of block j exists iff ISEVOK(j,i)
38 C -- IDELB - IN - element block IDs
39 C -- IEVOK - IN -
40 C -- NEWID - IN -
41 C -- IOERR - OUT - input/output error flag
42 C --
43 C --Common Variables:
44 C -- Uses ICOBEG, ICOEND of /DBXVAR/
45 C -- Uses NDBIN of /DBASE/
46 C -- Uses NDIM, NUMNP, NUMEL, NSTEPS of /DBNUMS/
47
48 include 'exodusII.inc'
49 include 'ag_namlen.blk'
50
51 LOGICAL VISELB(NELBLK)
52 CHARACTER*(namlen) NAMECO(*)
53 CHARACTER*(MXSTLN) BLKTYP(*)
54 CHARACTER*(*) NAMEGV(*)
55 CHARACTER*(*) NAMENV(*)
56 CHARACTER*(*) NAMEEV(*)
57 INTEGER IEVVAR(*)
58 LOGICAL ISEVOK(NELBLK,NVAREO)
59 INTEGER IDELB(*)
60 INTEGER IEVOK(NVAREO,NELBO)
61 INTEGER NEWID(*)
62
63 C Write the names of the coordinates to the output file
64 call expcon(ndbout, nameco, ierr)
65
66 C --Write the variable names
67
68 IF (NVARGO + NVARNO + NVAREO .GT. 0) THEN
69 if (nvargo .gt. 0) then
70 call expvp(ndbout, 'g', nvargo, ierr)
71 call expvan(ndbout, 'g', nvargo, namegv, ierr)
72 end if
73 if (nvarno .gt. 0) then
74 call expvp(ndbout, 'n', nvarno, ierr)
75 call expvan(ndbout, 'n', nvarno, namenv, ierr2)
76 end if
77 if (nvareo .gt. 0) then
78 call expvp(ndbout, 'e', nvareo, ierr)
79 call expvan(ndbout, 'e', nvareo, nameev, ierr)
80 end if
81 END IF
82
83 IF ((NVAREO .GT. 0) .AND. (NELBLK .GT. 0)) THEN
84 NO = 0
85 C Loop from 1 to number of element blocks
86 DO 110 IELB = 1, NELBLK
87 IF (VISELB(IELB)) THEN
88 C Increment counter for writing element block data
89 NO = NO + 1
90 C New block id index = element block ID
91 NEWID(NO) = IDELB(IELB)
92 C Loop from 1 to the number of variables to output
93 DO 100 I = 1, NVAREO
94 IEV = IEVVAR(I)
95 IF (ISEVOK(IELB,IEV)) THEN
96 IEVOK(I,NO) = 1
97 ELSE
98 IEVOK(I,NO) = 0
99 END IF
100 100 CONTINUE
101 end if
102 110 CONTINUE
103
104 C Write the element variable truth table to the output file
105 CALL EXPVTT (NDBOUT, NELBO, NVAREO, IEVOK, IERR)
106
107 END IF
108
109 RETURN
110 END