Debian Codegraph @

packages/seacas/applications/algebra/ag_store.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 STORE (ISTEP, TYP, IBEGIN, IEND, NWRDS,
8 & NUMELB, IDELB, ISEVOK, VISELB, MAXNE, VARVAL, MERR)
9 C=======================================================================
10
11 C --*** STORE *** (ALGEBRA) Store database variable data
12 C -- Written by Amy Gilkey - revised 08/16/88
13 C --
14 C --STORE reads each database variable and stores it, if it is wanted,
15 C --into the proper location of VARVAL. The /VAR../ variables between
16 C --IBEGIN and IEND are assumed to be ordered on IDVAR, with no
17 C --repetitions.
18 C --
19 C --Parameters:
20 C -- ISTEP - IN - the time step number
21 C -- TYP - IN - the variable types
22 C -- IBEGIN - IN - the starting /VAR../ index of the variables
23 C -- IEND - IN - the ending /VAR../ index of the variables
24 C -- NWRDS - IN - the number of words to be read for each variable
25 C -- NUMELB - IN - the number of elements per block
26 C -- ISEVOK - IN - the element block variable truth table;
27 C -- variable i of block j exists iff ISEVOK(j,i)
28 C -- MAXNE - IN - the VARVAL dimension (max of NUMEL and NUMNP)
29 C -- VARVAL - OUT - the returned needed input variables
30 C -- MERR - OUT - error flag C --
31 C --Common Variables:
32 C -- Uses IDVAR, ISTVAR of /VAR../
33 C -- Uses NDBIN of /DBASE/
34
35 PARAMETER (ICURTM = 1, ILSTTM = 2, IONETM = 3)
36 include 'ag_namlen.blk'
37 include 'ag_var.blk'
38 include 'ag_dbase.blk'
39 include 'ag_dbnums.blk'
40
41 CHARACTER TYP
42 INTEGER NUMELB(*)
43 INTEGER IDELB(*)
44 LOGICAL ISEVOK(NELBLK,NVAREL)
45 LOGICAL VISELB(NELBLK)
46 REAL VARVAL(MAXNE,*)
47 INTEGER MERR
48 MERR = 0
49
50 C Read and store all global variables (if needed for the current step)
51 IF (TYP .EQ. 'G') THEN
52 IF (ISTVAR(ICURTM,IBEGIN) .NE. 0) THEN
53 NSTO = ISTVAR(ICURTM,IBEGIN)
54 ID = IDVAR(IBEGIN)
55 call exggv(ndbin, istep, nvargl, varval(id,nsto), ierr)
56 END IF
57 C Read and store all needed nodal variables for the current step
58 ELSE IF (TYP .EQ. 'N') THEN
59 DO 100 NVAR = IBEGIN, IEND
60 IF (ISTVAR(ICURTM,NVAR) .NE. 0) THEN
61 NSTO = IABS (ISTVAR(ICURTM,NVAR))
62 call exgnv(ndbin, istep, idvar(nvar), nwrds,
63 & varval(1,nsto), ierr)
64 END IF
65 100 CONTINUE
66 C Read and store all needed element variables for the current step
67 ELSE IF (TYP .EQ. 'E') THEN
68 IEL = 1
69 DO 130 IELB = 1, NELBLK
70 IDEB = IDELB(IELB)
71 NELEM = NUMELB(IELB)
72 IF (VISELB(IELB)) THEN
73 DO 120 NVAR = IBEGIN, IEND
74 INVAR = IDVAR(NVAR)
75 IF (ISTVAR(ICURTM,NVAR) .NE. 0) THEN
76 NSTO = IABS (ISTVAR(ICURTM,NVAR))
77 IF (ISEVOK(IELB,INVAR)) THEN
78 call exgev(ndbin, istep, INVAR,
79 & IDEB, NELEM, varval(iel,nsto), ierr)
80 ELSE
81 C --Make sure values for undefined elements are zero
82 DO 110 I = IEL, IEL+NUMELB(IELB) - 1
83 VARVAL(I,NSTO) = 0.0
84 110 CONTINUE
85 END IF
86 END IF
87 120 CONTINUE
88 END IF
89 IEL = IEL + NELEM
90 130 CONTINUE
91 ELSE
92 WRITE(*,10)
93 & 'Unknown Type in Subroutine Store: TYP = ',typ
94 10 format(A,A)
95 MERR = 1
96 END IF
97
98 RETURN
99 END