Debian Codegraph @

packages/seacas/applications/ex1ex2v2/ex1_dbinps.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 DBINPS (NDB, OPTION, NUMNPS, LNPSNL,
9 & IDNPS, NNNPS, IXNNPS, LTNNPS, FACNPS, *)
10 C=======================================================================
11
12 C --*** DBINPS *** (EXOLIB) Read database node sets
13 C -- Written by Amy Gilkey - revised 10/14/87
14 C --
15 C --DBINPS reads the node set information from the database.
16 C --An error message is displayed if the end of file is read.
17 C --
18 C --Parameters:
19 C -- NDB - IN - the database file
20 C -- OPTION - IN - ' ' to not store, '*' to store all, else store options:
21 C -- 'H' to store information about node sets
22 C -- 'N' to store node set nodes
23 C -- 'F' to store node set factors
24 C -- NUMNPS - IN - the number of node sets
25 C -- LNPSNL - IN - the length of the node sets node list
26 C -- IDNPS - OUT - the node set ID for each set (if OPTION)
27 C -- NNNPS - OUT - the number of nodes for each set (if OPTION)
28 C -- IXNNPS - OUT - the index of the first node for each set (if OPTION)
29 C -- LTNNPS - OUT - the nodes for all sets (if OPTION)
30 C -- FACNPS - OUT - the distribution factors for all sets (if OPTION)
31 C -- * - return statement if end of file or read error
32 C --
33 C --Database must be positioned at start of node set information
34 C --upon entry; upon exit at end of node set information.
35
36 INTEGER NDB
37 CHARACTER*(*) OPTION
38 INTEGER NUMNPS, LNPSNL
39 INTEGER IDNPS(*)
40 INTEGER NNNPS(*)
41 INTEGER IXNNPS(*)
42 INTEGER LTNNPS(*)
43 REAL FACNPS(*)
44
45 CHARACTER*80 ERRMSG
46
47 IF ((OPTION .EQ. '*') .OR. (INDEX (OPTION, 'H') .GT. 0)) THEN
48 READ (NDB, END=100, ERR=100, IOSTAT=IERR)
49 & (IDNPS(INPS), INPS=1,NUMNPS)
50 READ (NDB, END=110, ERR=110, IOSTAT=IERR)
51 & (NNNPS(INPS), INPS=1,NUMNPS)
52 READ (NDB, END=120, ERR=120, IOSTAT=IERR)
53 & (IXNNPS(INPS), INPS=1,NUMNPS)
54 ELSE
55 READ (NDB, END=100, ERR=100, IOSTAT=IERR)
56 READ (NDB, END=110, ERR=110, IOSTAT=IERR)
57 READ (NDB, END=120, ERR=120, IOSTAT=IERR)
58 END IF
59
60 IF ((OPTION .EQ. '*') .OR. (INDEX (OPTION, 'N') .GT. 0)) THEN
61 READ (NDB, END=130, ERR=130, IOSTAT=IERR)
62 & (LTNNPS(NL), NL=1,LNPSNL)
63 ELSE
64 READ (NDB, END=130, ERR=130, IOSTAT=IERR)
65 END IF
66
67 IF ((OPTION .EQ. '*') .OR. (INDEX (OPTION, 'F') .GT. 0)) THEN
68 READ (NDB, END=140, ERR=140, IOSTAT=IERR)
69 & (FACNPS(NL), NL=1,LNPSNL)
70 ELSE
71 READ (NDB, END=140, ERR=140, IOSTAT=IERR)
72 END IF
73
74 RETURN
75
76 100 CONTINUE
77 ERRMSG = 'NODE SET IDS'
78 GOTO 150
79 110 CONTINUE
80 ERRMSG = 'NODE SET NUMBER OF NODES'
81 GOTO 150
82 120 CONTINUE
83 ERRMSG = 'NODE SET INDICES'
84 GOTO 150
85 130 CONTINUE
86 ERRMSG = 'NODE SET NODES'
87 GOTO 150
88 140 CONTINUE
89 ERRMSG = 'NODE SET DISTRIBUTION FACTORS'
90 GOTO 150
91 150 CONTINUE
92 CALL DBERR (IERR, ERRMSG)
93 RETURN 1
94 END