Debian Codegraph @

packages/seacas/applications/algebra/ag_rwxyz.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 RWXYZ (NDBIN, NDBOUT, NDIM, NUMNP, NUMNPO,
8 & IXNODE, CORD, CRDSCR)
9 C=======================================================================
10
11 C --*** RWXYZ *** (ALGEBRA) Read and write database coordinates
12 C -- Written by Amy Gilkey - revised 11/30/87
13 C -- Modified for EXODUSIIV2 format 8/29/95
14 C --
15 C --RWXYZ reads and writes the coordinate array to the database.
16 C --Deleted nodes are removed.
17 C --
18 C --Parameters:
19 C -- NDBIN, NDBOUT - IN - the input and output database file
20 C -- NDIM - IN - the number of coordinates per node
21 C -- NUMNP - IN - the number of nodes
22 C -- NUMNPO - IN - the number of nodes
23 C -- IXNODE - IN - the indices of the output nodes (iff NUMNPO <> NUMNP)
24 C -- CORD - SCRATCH - coordinate I/O
25 C -- CRDSCR - SCRATCH - coordinate I/O
26
27 INTEGER NDBIN, NDBOUT
28 INTEGER NDIM
29 INTEGER NUMNP
30 INTEGER IXNODE(*)
31 REAL CORD(NUMNP,NDIM)
32 REAL CRDSCR(NUMNPO,NDIM)
33
34 if (ndim .eq. 2) then
35 CALL EXGCOR(ndbin, cord(1,1), cord(1,2), rdum, ierr)
36 else if (ndim .eq. 3) then
37 CALL EXGCOR(ndbin, cord(1,1), cord(1,2),
38 & cord(1,3), ierr)
39 else
40 call prterr('FATAL', 'Illegal model dimension')
41 RETURN
42 end if
43
44 IF ((NUMNPO .GT. 0) .AND. (NDIM .GT. 0)) THEN
45 IF (NUMNP .EQ. NUMNPO) THEN
46 if (ndim .eq. 2) then
47 CALL EXPCOR(ndbout, cord(1,1), cord(1,2), rdum, ierr)
48 else if (ndim .eq. 3) then
49 CALL EXPCOR(ndbout, cord(1,1), cord(1,2),
50 & cord(1,3), ioerr)
51 else
52 call prterr('FATAL', 'Illegal model dimension')
53 RETURN
54 end if
55 ELSE
56 do 20 idim=1, ndim
57 do 10 ix=1, numnpo
58 crdscr(ix,idim) = cord(ixnode(ix),idim)
59 10 continue
60 20 continue
61 if (ndim .eq. 2) then
62 CALL EXPCOR(ndbout, crdscr(1,1), crdscr(1,2),
63 & rdum, ioerr)
64 else if (ndim .eq. 3) then
65 CALL EXPCOR(ndbout, crdscr(1,1), crdscr(1,2),
66 & crdscr(1,3), ioerr)
67 else
68 call prterr('FATAL', 'Illegal model dimension')
69 end if
70 END IF
71 ELSE
72 continue
73 END IF
74
75 RETURN
76 END