Debian Codegraph @

packages/seacas/applications/blot/spmain.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 SPMAIN (A, NEUTRL, NAMES, NPTIMS, IPTIMS,
9 * TIMES, NENUM,
10 & XN, YN, ZN, XE, YE, ZE,
11 & IE2ELB, ISEVOK, LIDSP, BLKCOL, IDELB,
12 * MAPEL, MAPND)
13 C=======================================================================
14
15 C --*** SPMAIN *** (SPLOT) SPLOT main plot routine
16 C -- Modified by John Glick - 11/9/88
17 C -- Written by Amy Gilkey - revised 03/07/88
18 C --
19 C --SPMAIN calculates the distances, reads the variables, and displays
20 C --the distance-versus-variable plots.
21 C --
22 C --Parameters:
23 C -- A - IN - the dynamic memory base array
24 C -- NEUTRL - IN - the type of neutral file to write.
25 C -- NAMES - IN - the variable names
26 C -- NPTIMS - IN - the number of selected time steps
27 C -- IPTIMS - IN - the selected time steps
28 C -- TIMES - IN - the database times
29 C -- NENUM - IN - the selected node/element numbers
30 C -- XN,YN,ZN - IN - the nodal mesh coordinates
31 C -- XE,YE,ZE - IN - the element centroid mesh coordinates
32 C -- IE2ELB - IN - the element block for each element
33 C -- ISEVOK - IN - the element block variable truth table;
34 C -- variable i of block j exists iff ISEVOK(j,i)
35 C -- LIDSP(0:*) - IN - the indices of the selected variables
36 C -- whose values will be displayed on the plot legend.
37 C -- LIDSP(0) = the number of variables in the list.
38 C -- LIDSP(i) identifies the ith variable in the list.
39 C -- LIDSP(i) > 0, LIDSP(i) is the id of a history var.
40 C -- LIDSP(i) < 0, -LIDSP(i) is the id of a global var.
41 C -- LIDSP(i) = 0, TIME is displayed on the plot legend.
42 C -- BLKCOL - I/O - the user selected colors of the element blocks.
43 C -- BLKCOL(0) = 1 if the user defined material
44 C -- colors should be used in mesh plots.
45 C -- = -1 if program selected colors should
46 C -- be used.
47 C -- BLKCOL(i) = the user selected color of element
48 C -- block i:
49 C -- -2 - no color selected by user.
50 C -- -1 - black
51 C -- 0 - white
52 C -- 1 - red
53 C -- 2 - green
54 C -- 3 - yellow
55 C -- 4 - blue
56 C -- 5 - cyan
57 C -- 6 - magenta
58 C --
59 C --Common Variables:
60 C -- Uses NNENUM of /SELNE/
61 C -- Uses NSPVAR of /SPVARS/
62
63 include 'params.blk'
64
65 PARAMETER (KLFT=1, KRGT=2, KBOT=3, KTOP=4)
66
67 include 'dbnums.blk'
68 include 'selne.blk'
69 include 'spvars.blk'
70
71 DIMENSION A(*)
72 CHARACTER*(*) NAMES(*)
73 INTEGER IPTIMS(NPTIMS)
74 REAL TIMES(*)
75 INTEGER NENUM(NNENUM)
76 REAL XN(*), YN(*), ZN(*)
77 REAL XE(*), YE(*), ZE(*)
78 INTEGER IE2ELB(*)
79 LOGICAL ISEVOK(*)
80 INTEGER LIDSP(0:*)
81 INTEGER BLKCOL(0:NELBLK)
82 INTEGER IDELB(*)
83 INTEGER MAPEL(*), MAPND(*)
84
85 C --Use the selected color table
86 CALL GRCOLU ('ALTERNATE')
87
88 C --Reserve storage for plot variables
89
90 LPLVAL = NNENUM * NSPVAR * NPTIMS
91 CALL MDRSRV ('PLTVAL', KPLVAL, LPLVAL)
92 CALL MDSTAT (NERR, MEM)
93 IF (NERR .GT. 0) GOTO 100
94
95 C --Read plot variables
96
97 CALL SPREAD (A, NPTIMS, IPTIMS, NENUM, A(KPLVAL))
98
99 CALL MDSTAT (NERR, MEM)
100 IF (NERR .GT. 0) GOTO 100
101
102 C --Identify and index element variables with undefined values
103
104 CALL MDRSRV ('IXSEGV', KXSEGV, NSPVAR)
105 CALL MDSTAT (NERR, MEM)
106 IF (NERR .GT. 0) GOTO 100
107
108 CALL SPDSEG (A, NENUM, IE2ELB, ISEVOK,
109 & NSEGV, A(KXSEGV), KSEGEL)
110
111 CALL MDSTAT (NERR, MEM)
112 IF (NERR .GT. 0) GOTO 100
113
114 C --Calculate distances
115
116 CALL MDRSRV ('DIST', KDIST, NNENUM)
117 CALL MDSTAT (NERR, MEM)
118 IF (NERR .GT. 0) GOTO 100
119
120 IF (NODVAR) THEN
121 CALL CALDIS (NNENUM, NENUM, XN, YN, ZN, A(KDIST))
122 ELSE
123 CALL CALDIS (NNENUM, NENUM, XE, YE, ZE, A(KDIST))
124 END IF
125
126 C --Plot requested curves
127
128 IF (NSEGV .GT. 0) THEN
129 CALL MDRSRV ('XDIST', KXDIST, NNENUM)
130 CALL MDSTAT (NERR, MEM)
131 IF (NERR .GT. 0) GOTO 100
132 END IF
133
134 CALL SPPLOT (A, NEUTRL, NPTIMS, IPTIMS, TIMES, NENUM,
135 & A(KDIST), A(KPLVAL), NAMES,
136 & A(KXSEGV), A(KSEGEL), A(KXDIST), LIDSP, BLKCOL,
137 * MAPEL, MAPND)
138
139 CALL MDDEL ('PLTVAL')
140 CALL MDDEL ('DIST')
141 IF (NSEGV .GT. 0) THEN
142 CALL MDDEL ('XDIST')
143 END IF
144 CALL MDDEL ('IXSEGV')
145 IF (NSEGV .GT. 0) THEN
146 CALL MDDEL ('ISEGEL')
147 END IF
148
149 100 CONTINUE
150 RETURN
151 END