Debian Codegraph @

packages/seacas/applications/blot/spread.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 SPREAD (A, NPTIMS, IPTIMS, NENUM, PLTVAL)
9 C=======================================================================
10
11 C --*** SPREAD *** (SPLOT) Read plot variables from database
12 C -- Written by Amy Gilkey - revised 02/02/88
13 C --
14 C --SPREAD reads the database and stores all variables needed
15 C --for all time steps.
16 C --
17 C --This routine manipulates dynamic memory, so check after return.
18 C --
19 C --Parameters:
20 C -- A - IN - the dynamic memory base array
21 C -- NPTIMS - IN - the number of selected times
22 C -- IPTIMS - IN - the selected time steps
23 C -- NENUM - IN - the selected node/element numbers
24 C -- PLTVAL - OUT - the plot variable values
25 C --
26 C --Common Variables:
27 C -- Uses NDIM, NUMNP, NUMEL, NELBLK,
28 C -- NVARHI, NVARGL, NVARNP, NVAREL of /DBNUMS/
29 C -- Uses NODVAR, NNENUM of /SELNE/
30 C -- Uses NSPVAR of /SPVARS/
31
32 include 'params.blk'
33 include 'dbnums.blk'
34 include 'selne.blk'
35 include 'spvars.blk'
36
37 DIMENSION A(*)
38 INTEGER IPTIMS(NPTIMS)
39 INTEGER NENUM(NNENUM)
40 REAL PLTVAL(NNENUM,NSPVAR,*)
41
42 LOGICAL NEEDNV, NEEDEV
43
44 C --Determine which types of variables are needed
45
46 NEEDNV = .FALSE.
47 NEEDEV = .FALSE.
48 LDATA = 0
49
50 IF (NODVAR) THEN
51 NEEDNV = .TRUE.
52 LDATA = MAX (LDATA, NUMNP)
53 ELSE
54 NEEDEV = .TRUE.
55 LDATA = MAX (LDATA, NUMEL)
56 END IF
57
58 C --Reserve memory for data record
59
60 CALL MDRSRV ('DATA', KDATA, LDATA)
61 CALL MDSTAT (NERR, MEM)
62 IF (NERR .GT. 0) GOTO 110
63
64 C --Transfer element variables onto random file (for efficiency)
65
66 IF (NEEDEV) THEN
67 CALL SPTRND (A, IPTIMS(NPTIMS), 'E', NUMEL, NVAREL, A(KDATA))
68 END IF
69
70 DO 100 NPT = 1, NPTIMS
71
72 ISTEP = IPTIMS(NPT)
73
74 C --Read and store nodal data to be plotted
75
76 IF (NEEDNV) THEN
77 CALL SPSTOR (A, ISTEP, 'N', NUMNP, NVARNP, NENUM,
78 & PLTVAL(1,1,NPT), A(KDATA))
79 END IF
80
81 C --Read and store element data to be plotted
82
83 IF (NEEDEV) THEN
84 CALL SPSTOR (A, ISTEP, 'E', NUMEL, NVAREL, NENUM,
85 & PLTVAL(1,1,NPT), A(KDATA))
86 END IF
87
88 100 CONTINUE
89
90 CALL MDDEL ('DATA')
91
92 110 CONTINUE
93 RETURN
94 END