Debian Codegraph @

packages/seacas/applications/blot/grinit.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 GRINIT (DBORD0, CHLSIZ)
9 C=======================================================================
10
11 C --*** GRINIT *** (GRPLIB) Initialize graphics (PLT)
12 C -- Written by Amy Gilkey - revised 04/27/88
13 C --
14 C --GRINIT initializes the graphics and sets graphics options and
15 C --parameters common to the entire run.
16 C --
17 C --Alphanumeric mode is set upon exit from this routine.
18 C --
19 C --Parameters:
20 C -- DBORD0 - OUT - the display / label area boundary (device units)
21 C -- (1=left, 2=right, 3=bottom, 4=top)
22 C -- CHLSIZ - OUT - the character line size (device units)
23 C --
24 C --Common Variables:
25 C -- Sets ICURDV, DEVOK, DEVNAM, DEVCOD, TALKOK, NSNAP, IFONT, SOFTCH,
26 C -- AUTOPL, MAXCOL, NUMCOL, MAPALT of /GRPCOM/
27
28 C --Routines Called:
29 C -- EXPARM - (SUPES) Get system-dependent parameters
30 C -- PLTINT - (PLTLIB) Initialize Graphics Status Area (GSA)
31 C -- PLTIQD - (PLTLIB) Obtain device information
32 C -- PLTSTT - (PLTLIB) Set text parameter
33 C -- 1 = (KHCHSZ) hardware character size
34 C -- 2 = (KSCHSZ) software character size
35 C -- 6 = (KCHLSZ) vertical line size
36 C -- GRSDEV - (GRPLIB) Select device
37
38 PARAMETER (KLFT=1, KRGT=2, KBOT=3, KTOP=4)
39
40 PARAMETER (KDVDI=10000)
41 PARAMETER (KHCHSZ=1, KSCHSZ=2, KCHLSZ=6)
42
43 include 'grpcom.blk'
44
45 REAL DBORD0(KTOP)
46 REAL CHLSIZ
47
48 LOGICAL LDUM, PLTSTT
49 LOGICAL BATCH
50 LOGICAL HRDCPY
51 REAL VDINFO(23)
52
53 character*2048 scratch
54 character*32 device
55
56 PARAMETER (MXDCOD = 12)
57
58 CHARACTER*3 NDCOD(MXDCOD)
59 CHARACTER*8 DCOD(MXDCOD)
60 SAVE NDCOD, DCOD
61 C --NDCOD - the device name for special devices
62 C --DCOD - the device code for special devices
63
64 DATA NDCOD / '16B', '16C',
65 & '35A', '35B', '35C', '3MB', '3MC',
66 & '24L', '48L', 'BSQ', 'CSQ',
67 & 'TK4' /
68 DATA DCOD / 'DICOMED ', 'DICOMED ',
69 & 'DICOMED ', 'DICOMED ', 'DICOMED ', 'DICOMED ', 'DICOMED ',
70 & 'DICOMED ', 'DICOMED ', 'DICOMED ', 'DICOMED ',
71 & 'WAIT ' /
72
73 C --Set up graph borders, etc
74
75 CHLSIZ = .014
76 DBORD0(KLFT) = 0.00 + 0.0001
77 DBORD0(KRGT) = 1.00 - 0.0001
78 DBORD0(KBOT) = 0.00 + 0.0001
79 DBORD0(KTOP) = 0.75 - 0.0001
80 C --Open unit 6 to tty (for PLT)
81
82 c OPEN (UNIT=6, FILE='tty', ERR=100)
83 c 100 CONTINUE
84
85 C --Get graphic output devices ready
86
87 C ... Get graphics device name from executable (follows . in executable name)
88 CALL GET_ARGUMENT(0,scratch, lfil)
89 last = indexr(scratch, '_')
90 if (last .gt. 2) then
91 device = scratch(last+1:lfil)
92 if (device(:lenstr(device)) .eq. 'dual') then
93 devnam(1) = 'x11'
94 devnam(2) = 'met'
95 else if (device(:lenstr(device)) .eq. 'xcps') then
96 devnam(1) = 'x11'
97 devnam(2) = 'cps'
98 else
99 devnam(1) = device(:lenstr(device))
100 devnam(2) = ' '
101 end if
102 else
103 last = indexr(scratch, '.')
104 if (last .gt. 2) then
105 device = scratch(last+1:lfil)
106 if (device(:lenstr(device)) .eq. 'dual') then
107 devnam(1) = 'x11'
108 devnam(2) = 'met'
109 else if (device(:lenstr(device)) .eq. 'xcps') then
110 devnam(1) = 'x11'
111 devnam(2) = 'cps'
112 else
113 devnam(1) = device(:lenstr(device))
114 devnam(2) = ' '
115 end if
116 else
117 call PRTERR('ERROR',
118 * 'Could not determine graphics device type.')
119 call PRTERR('CMDSPEC',scratch(:lfil))
120 C ... Assume single device, x11
121 devnam(1) = 'x11'
122 devnam(2) = ' '
123 end if
124 end if
125
126 CALL VDIQES (KDVDI, ION)
127 IF (ION .EQ. 1) THEN
128 DO 110 IDEV = 1, 2
129 CALL VDIQES (KDVDI + IDEV, ION)
130 DEVOK(IDEV) = (ION .EQ. 1)
131 IF (.NOT. DEVOK(IDEV)) THEN
132 DEVNAM(IDEV) = ' '
133 END IF
134 110 CONTINUE
135 ELSE
136 DO 120 IDEV = 1, 2
137 DEVOK(IDEV) = (DEVNAM(IDEV) .NE. ' ')
138 120 CONTINUE
139 IF (.NOT. (DEVOK(1) .OR. DEVOK(2))) THEN
140 DEVOK(1) = .TRUE.
141 DEVNAM(1) = '***'
142 END IF
143 END IF
144
145 C ... Temporary kludge until dual device available GDS
146 IF (DEVNAM(2) .eq. '***' ) then
147 DEVOK(2) = .FALSE.
148 DEVNAM(2) = ' '
149 end if
150
151 IF (.NOT. (DEVOK(1) .OR. DEVOK(2))) THEN
152 CALL PRTERR ('FATAL', 'No device is active')
153 STOP
154 END IF
155
156 C --Initialize the attached camera device (before the graphics device)
157
158 NSNAP(1) = -999
159 NSNAP(2) = -999
160
161 C --Initialize graphics devices
162
163 IDEV = 0
164 IF (DEVOK(1)) IDEV = IDEV + 1
165 IF (DEVOK(2)) IDEV = IDEV + 2
166 CALL VDESCP (KDVDI + IDEV, 0, 0)
167 CALL PLTINT
168
169 C --Set device dependent parameters, for both devices
170
171 DO 140 IDEV = 1, 2
172 IF (DEVOK(IDEV)) THEN
173 CALL VDESCP (KDVDI + IDEV, 0, 0)
174
175 CALL PLTIQD (VDINFO)
176
177 DEVCOD(IDEV) = ' '
178 DO 130 I = 1, MXDCOD
179 IF (NDCOD(I) .EQ. DEVNAM(IDEV)) DEVCOD(IDEV) = DCOD(I)
180 130 CONTINUE
181 HRDCPY = (NINT(VDINFO(1)) .EQ. 0)
182 TALKOK(IDEV) = (.NOT. HRDCPY) .AND. (.NOT. BATCH ())
183 C --Old: high resolution font if (1.75*VDINFO(15)) .GT. 1600
184 CALL GRSNAP ('QUERY', IDEV)
185 IFONT(IDEV) = 1
186 SOFTCH(IDEV) = HRDCPY .OR. (NINT(VDINFO(7)) .EQ. 0)
187 MAXCOL(IDEV) = MAX (0, NINT(VDINFO(4))-2)
188 NUMCOL(0,IDEV) = MIN (MAXCOL(IDEV), 6)
189 NUMCOL(1,IDEV) = 0
190 MAPALT(IDEV) = 0
191 MAPUSE(IDEV) = 0
192 AUTOPL(IDEV) = .NOT. TALKOK(IDEV)
193
194 ELSE
195 HRDCPY = .FALSE.
196 TALKOK(IDEV) = .FALSE.
197 NSNAP(IDEV) = -999
198 IFONT(IDEV) = 1
199 SOFTCH(IDEV) = .FALSE.
200 MAXCOL(IDEV) = 0
201 NUMCOL(0,IDEV) = 0
202 NUMCOL(1,IDEV) = 0
203 MAPALT(IDEV) = 0
204 MAPUSE(IDEV) = 0
205 AUTOPL(IDEV) = .NOT. TALKOK(IDEV)
206 END IF
207 140 CONTINUE
208
209 C --Set current device parameters
210
211 ICURDV = 0
212 CALL GRSDEV (0)
213
214 C --Set character sizes
215
216 RAT = 4.0 / 3.0
217 VCS = CHLSIZ / RAT
218 LDUM = PLTSTT (KSCHSZ, VCS)
219 LDUM = PLTSTT (KHCHSZ, VCS)
220 LDUM = PLTSTT (KCHLSZ, RAT)
221
222 RETURN
223 END