Debian Codegraph @

packages/seacas/applications/exotxt/et_dbinam.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 DBINAM (NDB, C, KNAMES, NVARGL, NVARNP, NVAREL,
9 & IXGV, IXNV, IXEV, IOERR, NAMLEN)
10 C=======================================================================
11
12 C --*** DBINAM *** Read the names of the of global, node, and
13 C -- element result variables
14 C -- Modified for ExodusIIV2 database 8/26/95
15 C --This code originated from the subroutine
16 C --*** DBINAM *** (EXOLIB) Read database names
17 C -- Written by Amy Gilkey - revised 02/08/88
18 C --
19 C --DBINAM performed a number of different input file read base
20 C --on the passed in option argument. DBINAM was split up
21 C --into a number of different subroutins
22 C --
23 C --This routine calls DBVINI and uses DBVIX to get the variable name
24 C --indices. This subroutine includes and call DBINM2.
25 C --
26 C --Parameters:
27 C -- NDB - IN - the database number
28 C -- C - OUT - the dynamic memory base array (character)
29 C -- NVARGL - IN - the number of global variables; <0 if end-of-file
30 C -- NVARNP - IN - the number of nodal variables; <0 if end-of-file
31 C -- NVAREL - IN - the number of element variables; <0 if end-of-file
32 C -- IXGV - OUT - the VNAMES index of the global variable names
33 C -- IXNV - OUT - the VNAMES index of the nodal variable names
34 C -- IXEV - OUT - the VNAMES index of the element variable names
35 C -- IOERR - OUT - error flag
36 C --
37
38 C --Routines Called:
39 C -- EXUPCS - (SUPES) Convert to uppercase and blank non-standard
40 C -- MDRSRV - (SUPES) Reserve dynamic memory
41 C -- PCKSTR - (STRLIB) Remove embedded blanks
42
43 PARAMETER (MAXDIM=6)
44
45 INTEGER NDB
46 CHARACTER*1 C(*)
47 CHARACTER*(NAMLEN) KNAMES(*)
48 INTEGER NVARGL, NVARNP, NVAREL
49 INTEGER IXGV, IXNV, IXEV
50 INTEGER IOERR
51 IOERR = 0
52
53 C There are no global, nodal, or element variables
54 IF ((nvargl + nvarnp + nvarel) .eq. 0) RETURN
55
56 C DBVINI Initializes the indices for DBVTYP and DBVIX
57 C DBVINI(num_global_var, num_nodal_var, num_elem_var)
58 CALL DBVINI (NVARGL, NVARNP, NVAREL)
59
60 C call dbvix(var_index, ret_var_type, ret_var_num)
61 CALL DBVIX ('G', 1, IXGV)
62 CALL DBVIX ('G', NVARGL, IXGVE)
63 CALL DBVIX ('N', 1, IXNV)
64 CALL DBVIX ('N', NVARNP, IXNVE)
65 CALL DBVIX ('E', 1, IXEV)
66 CALL DBVIX ('E', NVAREL, IXEVE)
67
68 C --Read and pack variable names
69 call dbinm2 (ndb, nvargl, nvarnp, nvarel, KNAMES(IXGV),
70 & KNAMES(IXNV), KNAMES(IXEV), IOERR, namlen)
71 IF (IOERR .EQ. 1) RETURN
72
73 RETURN
74 END
75
76 C *********************************************************
77 SUBROUTINE DBINM2 (ndb, nvargl, nvarnp, nvarel,
78 & namgv, namnv, namev, ioerr, namlen)
79 C *********************************************************
80 C NDB - IN - File ID
81 C NVARGL - IN - Number of global variables read
82 C NVARNP - IN - Number of nodal variables read
83 C NVAREL - IN - Number of element variables rea
84 C NAMGV - OUT - Returned character array with global variable names
85 C NAMNV - OUT - Returned character array with nodal variable names
86 C NAMEV - OUT - Returned character array with element variable names
87 C IOERR - OUT - error flag
88
89 character*(namlen) namgv(*), namnv(*), namev(*)
90 integer ioerr
91
92 IOERR = 0
93
94 C Reads the names of the results variables from the database
95 C call exgvan(fileid, vartyp, num_var, array_var_names(num_var), errorid)
96 if (nvargl .gt. 0) then
97 call exgvan(ndb, 'G', nvargl, namgv, ierr)
98 end if
99 if (nvarnp .gt. 0) then
100 call exgvan(ndb, 'N', nvarnp, namnv, ierr)
101 end if
102 if (nvarel .gt. 0) then
103 call exgvan(ndb, 'E', nvarel, namev, ierr)
104 end if
105
106 DO 130 I = 1, nvargl
107 CALL EXUPCS (namgv(i))
108 130 CONTINUE
109 CALL PCKSTR (NVARGL, namgv)
110
111 DO 140 I = 1, nvarnp
112 CALL EXUPCS (namnv(i))
113 140 CONTINUE
114 CALL PCKSTR (NVARNP, namnv)
115
116 DO 150 I = 1, nvarel
117 CALL EXUPCS (namev(i))
118 150 CONTINUE
119 CALL PCKSTR (NVAREL, namev)
120
121 return
122 end