Debian Codegraph @

packages/seacas/applications/txtexo/rdinit.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 RDINIT (NTXT, VERS, TITLE, NDIM, NUMNP, NUMEL, NELBLK,
9 & NUMNPS, LNPSNL, LNPSDF, NUMESS, LESSEL, LESSNL, LESSDF, NAMLEN,
10 * *)
11 C=======================================================================
12
13 C --*** RDINIT *** (TXTEXO) Read database title and initial variables
14 C -- Written by Amy Gilkey - revised 12/16/87
15 C --
16 C --RDINIT reads the title and the initial variables from the text file.
17 C --An error message is displayed if the end of file is read.
18 C --
19 C --Parameters:
20 C -- NTXT - IN - the text file
21 C -- NVERS - OUT - the version number
22 C -- TITLE - OUT - the database title
23 C -- NDIM - OUT - the number of coordinates per node
24 C -- NUMNP - OUT - the number of nodes
25 C -- NUMEL - OUT - the number of elements
26 C -- NELBLK - OUT - the number of element blocks
27 C -- NUMNPS - OUT - the number of node sets
28 C -- LNPSNL - OUT - the length of the node sets node list
29 C -- NUMESS - OUT - the number of side sets
30 C -- LESSEL - OUT - the length of the side sets element list
31 C -- LESSNL - OUT - the length of the side sets node list
32 C -- * - return statement if end of file or read error
33 C --
34 C --Database must be rewound before entry; upon exit positioned at end of
35 C --initial variables.
36
37 CHARACTER*80 TITLE
38 CHARACTER*80 SCRATCH
39
40 READ (NTXT, *, END=110, ERR=110)
41 READ (NTXT, '(A)', END=110, ERR=110) TITLE
42
43 READ (NTXT, *, END=120, ERR=120)
44
45 C ... Split scratch string into pieces. The namlen does not exist on older
46 C databases, so we need to see if it is there or not. The others are always there.
47 READ (NTXT, '(A)', END=110, ERR=110) SCRATCH
48 READ(SCRATCH( 1:10),*) NDIM
49 READ(SCRATCH(11:20),*) VERS
50 if (scratch(21:30) .ne. ' ') then
51 READ(SCRATCH(21:30),*) NAMLEN
52 else
53 namlen = 32
54 end if
55
56 READ (NTXT, *, END=130, ERR=130) NUMNP, NUMEL, NELBLK
57 READ (NTXT, *, END=150, ERR=150) NUMNPS, NUMESS
58 READ (NTXT, *, END=160, ERR=160) LNPSNL, LNPSDF
59 READ (NTXT, *, END=170, ERR=170) LESSEL, LESSNL, LESSDF
60
61 RETURN
62
63 110 CONTINUE
64 CALL PRTERR ('FATAL', 'Reading TITLE')
65 GOTO 180
66 120 CONTINUE
67 CALL PRTERR ('FATAL', 'Reading NUMBER OF DIMENSIONS or VERSION')
68 GOTO 180
69 130 CONTINUE
70 CALL PRTERR ('FATAL',
71 & 'Reading NUMBER OF NODES, ELEMENTS, and ELEMENT BLOCKS')
72 GOTO 180
73 150 CONTINUE
74 CALL PRTERR ('FATAL',
75 & 'Reading NUMBER OF NODE SETS and SIDE SETS')
76 GOTO 180
77 160 CONTINUE
78 CALL PRTERR ('FATAL', 'Reading NODE SET NODE LENGTHS')
79 GOTO 180
80 170 CONTINUE
81 CALL PRTERR ('FATAL',
82 & 'Reading SIDE SET ELEMENT, NODE, and FACTOR COUNTS')
83 GOTO 180
84 180 CONTINUE
85 RETURN 1
86 END