Debian Codegraph @

packages/seacas/applications/exotxt/et_wrmap.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 WRMAP (NTXT, OPTION, NUMNP, NUMEL,
9 & NPMAP, ELMAP, MAPEL)
10 C=======================================================================
11
12 C --*** WRMAP *** (EXOTXT) Write database node number map,
13 C -- element number map, and/or element order map
14 C -- Written by Amy Gilkey - revised 02/27/86
15 C -- Modified for ExodusIIv2 - 10/24/95
16 C --
17 C --Parameters:
18 C -- NTXT - IN - the database text file
19 C -- OPTION - IN - '*' write all
20 C -- 'N' write node number map
21 C -- 'E' write element number map
22 C -- 'O' write element order map
23 C -- NUMNP - IN - number of nodes
24 C -- NUMEL - IN - number of elements
25 C -- NPMAP - IN - node number map (if OPTION)
26 C -- ELMAP - IN - element number map (if OPTION)
27 C -- MAPEL - IN - element order map (if OPTION)
28
29 INTEGER NTXT
30 CHARACTER*(*) OPTION
31 INTEGER NUMNP
32 INTEGER NUMEL
33 INTEGER NPMAP(*)
34 INTEGER ELMAP(*)
35 INTEGER MAPEL(*)
36 LOGICAL ALL, NOPT, EOPT, OOPT
37 LOGICAL INORDR
38
39 ALL = (OPTION .EQ. '*')
40 NOPT = (INDEX (OPTION, 'N') .GT. 0)
41 EOPT = (INDEX (OPTION, 'E') .GT. 0)
42 OOPT = (INDEX (OPTION, 'O') .GT. 0)
43
44 C Write node number map
45 IF (ALL .OR. NOPT) THEN
46 WRITE (NTXT, 1000) '! Node number map'
47 if (inordr(npmap, numnp)) then
48 write (ntxt, 1000) 'sequence 1..numnp'
49 else
50 write (ntxt, 1000) 'explicit map'
51 WRITE (NTXT, 1010) (NPMAP(I), I = 1, NUMNP)
52 end if
53 END IF
54
55 C Write element number map
56 IF (ALL .OR. EOPT) THEN
57 WRITE (NTXT, 1000) '! Element number map'
58 if (inordr(elmap, numel)) then
59 write (ntxt, 1000) 'sequence 1..numel'
60 else
61 write (ntxt, 1000) 'explicit map'
62 WRITE (NTXT, 1010) (ELMAP(I), I = 1, NUMEL)
63 end if
64 END IF
65
66 C Write element order map
67 IF (ALL .OR. OOPT) THEN
68 WRITE (NTXT, 1000) '! Element order map'
69 if (inordr(mapel, numel)) then
70 write (ntxt, 1000) 'sequence 1..numel'
71 else
72 write (ntxt, 1000) 'explicit map'
73 WRITE (NTXT, 1010) (MAPEL(I), I = 1, NUMEL)
74 end if
75 END IF
76
77 1000 FORMAT (A)
78 1010 FORMAT (8I10)
79
80 RETURN
81 END
82
83 C=======================================================================
84 logical function inordr(MAP, ISIZE)
85 C=======================================================================
86
87 C ... Determine if the passed in map is simply a sequence from 1..isize
88
89 integer map(isize)
90
91 inordr = .FALSE.
92 do 10 i=1, isize
93 if (map(i) .ne. i) then
94 inordr = .FALSE.
95 return
96 end if
97 10 continue
98 inordr = .TRUE.
99 return
100 end