Debian Codegraph @

packages/seacas/applications/blot/calmag.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 CALMAG (DEFOK, IS3DIM, DEFFAC)
9 C=======================================================================
10
11 C --*** CALMAG *** (MESH) Calculate displacement magnification
12 C -- Written by Amy Gilkey - revised 01/26/88
13 C -- D. P. Flanagan, 11/17/82
14 C --
15 C --CALMAG calculates a default magnification factor for the
16 C --displacements.
17 C --
18 C --Parameters:
19 C -- DEFOK - IN - true iff the displacement variables were found
20 C -- IS3DIM - IN - true if and only if 3D versus 2D mesh
21 C -- DEFFAC - OUT - the default displacement magnification
22 C --
23
24 LOGICAL DEFOK
25 LOGICAL IS3DIM
26 REAL DEFFAC
27
28 DEFFAC = 0.0
29
30 IF (.NOT. DEFOK) THEN
31 DEFFAC = 0.0
32 ELSE
33 IF (.NOT. IS3DIM) THEN
34 DEFFAC = 1.0
35 ELSE
36 C --Compute default magnification factor for 3D
37 DEFFAC = 1.0
38 END IF
39 END IF
40
41 RETURN
42 END
43
44 C*******************************************************************
45 C SUBROUTINE CALMAG (A, UNMESH, WHOTIM, NPSURF, DEFOK, IXDEF,
46 C & IYDEF, IZDEF, DEFFAC)
47 C --CALMAG calculates a default magnification factor for the
48 C --displacements.
49 C --
50 C --Parameters:
51 C -- A - IN - the dynamic memory base array
52 C -- UNMESH - IN - the limits of the undeformed mesh
53 C -- WHOTIM - IN - true iff whole (versus history) time step
54 C -- NPSURF - IN - the node numbers of the surface nodes
55 C -- or mesh boundary nodes (2D)
56 C -- DEFOK - IN - true iff the displacement variables were found
57 C -- IXDEF, IYDEF, IZDEF - IN - the indices of the displacement variables
58 C -- DEFFAC - OUT - the default displacement magnification
59 C --
60 C --Common Variables:
61 C -- Uses NSTEPS of /DBNUMS/
62 C -- Uses IS3DIM, NNPSUR, NUMNPF of /D3NUMS/
63 C PARAMETER (KLFT=1, KRGT=2, KBOT=3, KTOP=4, KNEA=5, KFAR=6)
64 C include 'dbnums.blk'
65 C include 'd3nums.blk'
66 C DIMENSION A(*)
67 C REAL UNMESH(KFAR)
68 C LOGICAL WHOTIM(*)
69 C INTEGER NPSURF(*)
70 C LOGICAL DEFOK
71 C CHARACTER*8 CONVERT
72 C IF (.NOT. DEFOK) THEN
73 C DEFFAC = 0.0
74 C ELSE
75 C IF (.NOT. IS3DIM) THEN
76 C --Scale displacement variables (SCALER is too inefficient for this)
77 C CALL MDRSRV ('CMVAR', KVAR, NUMNPF)
78 C CALL MDSTAT (NERR, MEM)
79 C IF (NERR .GT. 0) GOTO 110
80 C DO 100 ISTEP = 1, NSTEPS
81 C IF (WHOTIM(ISTEP)) THEN
82 C CALL GTMVAR (A, IXDEF, -999, ISTEP, NUMNPF, A(KVAR))
83 C CALL MINMAX (NUMNPF, A(KVAR), XMIN, XMAX)
84 C IF (ISTEP .EQ. 1) THEN
85 C XDMIN = XMIN
86 C XDMAX = XMAX
87 C ELSE
88 C XDMIN = MIN (XDMIN, XMIN)
89 C XDMAX = MAX (XDMAX, XMAX)
90 C END IF
91 C CALL GTMVAR (A, IYDEF, -999, ISTEP, NUMNPF, A(KVAR))
92 C CALL MINMAX (NUMNPF, A(KVAR), XMIN, XMAX)
93 C IF (ISTEP .EQ. 1) THEN
94 C YDMIN = XMIN
95 C YDMAX = XMAX
96 C ELSE
97 C YDMIN = MIN (YDMIN, XMIN)
98 C YDMAX = MAX (YDMAX, XMAX)
99 C END IF
100 C END IF
101 C 100 CONTINUE
102 C CALL MDDEL ('CMVAR')
103 C --Compute default magnification factor for 2D
104 C DEFFAC = 1.0
105 C TLIM = .05 * MAX (
106 C & UNMESH(KRGT)-UNMESH(KLFT),
107 C & UNMESH(KTOP)-UNMESH(KBOT))
108 C DLIM = MAX (ABS(XDMIN), ABS(XDMAX), ABS(YDMIN), ABS(YDMAX))
109 C IF (DLIM .NE. 0.0) THEN
110 C WRITE (CONVERT, 10000) MAX (TLIM / DLIM, 1.0)
111 C READ (CONVERT, 10000) DEFFAC
112 C10000 FORMAT (E8.1)
113 C ELSE
114 C DEFFAC = 0.0
115 C END IF
116 C ELSE
117 C --Compute default magnification factor for 3D
118 C DEFFAC = 1.0
119 C END IF
120 C END IF
121 C 100 CONTINUE
122 C RETURN
123 C END