Debian Codegraph @

packages/seacas/applications/ex1ex2v2/ex1_dbiini.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 DBIINI (NDB, OPTION, NVERS, TITLE,
9 & NDIM, NUMNP, NUMEL, NELBLK,
10 & NUMNPS, LNPSNL, NUMESS, LESSEL, LESSNL, *)
11 C=======================================================================
12
13 C --*** DBIINI *** (EXOLIB) Read database title and initial variables
14 C -- Written by Amy Gilkey - revised 05/24/88
15 C --
16 C --DBIINI rewinds the database and reads the title and the initial
17 C --variables from the database. An error message is displayed if
18 C --the end of file is read.
19 C --
20 C --Parameters:
21 C -- NDB - IN - the database file
22 C -- OPTION - IN - ' ' to not store, '*' to store all, else store options:
23 C -- 'T' to store title
24 C -- 'I' to store initial variables
25 C -- NVERS - OUT - the version number (not read, always 1)
26 C -- TITLE - OUT - the database title (if OPTION)
27 C -- NDIM - OUT - the number of coordinates per node
28 C -- NUMNP - OUT - the number of nodes
29 C -- NUMEL - OUT - the number of elements
30 C -- NELBLK - OUT - the number of element blocks
31 C -- NUMNPS - OUT - the number of node sets
32 C -- LNPSNL - OUT - the length of the node sets node list
33 C -- NUMESS - OUT - the number of side sets
34 C -- LESSEL - OUT - the length of the side sets element list
35 C -- LESSNL - OUT - the length of the side sets node list
36 C -- * - return statement if end of file or read error
37 C --
38 C --Database is rewound upon entry; upon exit positioned at end of
39 C --initial variables.
40
41 INTEGER NDB
42 CHARACTER*(*) OPTION
43 INTEGER NVERS
44 CHARACTER*80 TITLE
45 INTEGER NDIM, NUMNP, NUMEL, NELBLK,
46 & NUMNPS, LNPSNL, NUMESS, LESSEL, LESSNL
47
48 CHARACTER*80 ERRMSG
49
50 REWIND (NDB)
51
52 IF ((OPTION .EQ. '*') .OR. (INDEX (OPTION, 'T') .GT. 0)) THEN
53 READ (NDB, END=100, ERR=100, IOSTAT=IERR) TITLE
54 ELSE
55 READ (NDB, END=100, ERR=100, IOSTAT=IERR)
56 END IF
57
58 IF ((OPTION .EQ. '*') .OR. (INDEX (OPTION, 'I') .GT. 0)) THEN
59 READ (NDB, END=110, ERR=110, IOSTAT=IERR)
60 & NUMNP, NDIM, NUMEL, NELBLK,
61 & NUMNPS, LNPSNL, NUMESS, LESSEL, LESSNL
62 NVERS = 1
63 ELSE
64 READ (NDB, END=110, ERR=110, IOSTAT=IERR)
65 END IF
66
67 RETURN
68
69 100 CONTINUE
70 ERRMSG = 'TITLE'
71 GOTO 120
72 110 CONTINUE
73 ERRMSG = 'INITIAL VARIABLES'
74 GOTO 120
75 120 CONTINUE
76 CALL DBERR (IERR, ERRMSG)
77 RETURN 1
78 END