Debian Codegraph @

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