Debian Codegraph @

packages/seacas/applications/txtexo/rdxyz.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 RWXYZ (NTXT, NDB, NDIM, NUMNP, XN, YN, ZN, NAMECO,
9 * NAMLEN,*)
10 C=======================================================================
11
12 C --*** RDXYZ *** (TXTEXO) Read database coordinates
13 C -- Written by Amy Gilkey - revised 02/27/86
14 C --
15 C --RDXYZ reads the coordinate array from the text file. An error
16 C --message is displayed if the end of file is read.
17 C --
18 C --Parameters:
19 C -- NTXT - IN - the text file
20 C -- NDIM - IN - the number of coordinates per node
21 C -- NUMNP - IN - the number of nodes
22 C -- XN, YN, ZN - OUT - the coordinates
23 C -- * - return statement if end of file or read error
24 C --
25 C --Database must be positioned at start of coordinates upon entry;
26 C --upon exit at end of coordinates.
27
28 REAL XN(*), YN(*), ZN(*)
29 CHARACTER*(NAMLEN) NAMECO(*)
30 integer kval(3)
31 real rval(3)
32 integer ival(3)
33
34 character*512 scratch
35 CHARACTER*32 STRA
36
37 INP = 0
38 nfield = 3
39 READ (NTXT, *, END=110, ERR=110)
40 READ (ntxt, '(A)', END=110, ERR=110) scratch
41 idcont = 0
42 call ffistr (scratch, ndim, idcont, nfield, kval, nameco,
43 * ival, rval)
44
45 READ (NTXT, *, END=120, ERR=120)
46 DO 100 INP = 1, NUMNP
47 IF (NDIM .EQ. 1) THEN
48 READ (NTXT, *, END=120, ERR=120) XN(INP)
49 ELSE IF (NDIM .EQ. 2) THEN
50 READ (NTXT, *, END=120, ERR=120) XN(INP), YN(INP)
51 ELSE IF (NDIM .EQ. 3) THEN
52 READ (NTXT, *, END=120, ERR=120) XN(INP), YN(INP), ZN(INP)
53 END IF
54 100 CONTINUE
55
56 call expcon (ndb, nameco, ierr)
57 call expcor (ndb, xn, yn, zn, ierr)
58
59 RETURN
60
61 110 continue
62 CALL PRTERR ('FATAL', 'Reading COORDINATE NAMES')
63 RETURN 1
64
65 120 CONTINUE
66 CALL INTSTR (1, 0, INP, STRA, LSTRA)
67 CALL PRTERR ('FATAL',
68 & 'Reading COORDINATES for node ' // STRA(:LSTRA))
69 RETURN 1
70 END