| 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 QALAB (DBORD0, DVIEW0, CHLSIZ, DOQA, DOAXIS, DOLAB, |
| 9 |
& CAPTN, TITLE, CREATE, MODIFY, DRAW, DLEGND, BLKCOL, *) |
| 10 |
C======================================================================= |
| 11 |
|
| 12 |
C --*** QALAB *** (BLOT) Draw standard label (PLT) |
| 13 |
C -- Written by Amy Gilkey - revised 02/02/88 |
| 14 |
C -- |
| 15 |
C --QALAB starts a "standard" plot by: |
| 16 |
C -- o starting a new plot, |
| 17 |
C -- o outlining the display area (if DOQA true), |
| 18 |
C -- o displaying the database title and creation, modification and |
| 19 |
C -- plot information (if DOQA true), |
| 20 |
C -- o displaying the plot caption, and |
| 21 |
C -- o returning the legend coordinates. |
| 22 |
C -- |
| 23 |
C --Parameters: |
| 24 |
C -- DBORD0 - IN - the plot boundary, including legend |
| 25 |
C -- (left, right, bottom, top) |
| 26 |
C -- DVIEW0 - IN - the plot view boundary (left, right, bottom, top) |
| 27 |
C -- CHLSIZ - IN - the size of a character line |
| 28 |
C -- DOQA - IN - true iff QA information is to be included in label |
| 29 |
C -- DOAXIS - IN - true iff axis is to be numbered (not in this routine) |
| 30 |
C -- DOLAB - IN - true iff axis is to be labeled (not in this routine) |
| 31 |
C -- CAPTN - IN - the three-line plot caption |
| 32 |
C -- TITLE - IN - the database title |
| 33 |
C -- CREATE - IN - the database creation code name, version, date, time |
| 34 |
C -- MODIFY - IN - the database modification code name, version, date, time |
| 35 |
C -- DRAW - IN - the database plot code name, version, date, time |
| 36 |
C -- DLEGND - OUT - the location of the legend (device units) |
| 37 |
C -- (left, right, bottom, top) |
| 38 |
C -- BLKCOL - IN/OUT - the user selected colors of the element blocks. |
| 39 |
C -- BLKCOL(0) = 1 if the user defined material |
| 40 |
C -- colors should be used in mesh plots. |
| 41 |
C -- = -1 if program selected colors should |
| 42 |
C -- be used. |
| 43 |
C -- BLKCOL(i) = the user selected color of element |
| 44 |
C -- block i: |
| 45 |
C -- -2 - no color selected by user. |
| 46 |
C -- -1 - black |
| 47 |
C -- 0 - white |
| 48 |
C -- 1 - red |
| 49 |
C -- 2 - green |
| 50 |
C -- 3 - yellow |
| 51 |
C -- 4 - blue |
| 52 |
C -- 5 - cyan |
| 53 |
C -- 6 - magenta |
| 54 |
C -- * - the return statement if the cancel function is active |
| 55 |
|
| 56 |
C --Routines Called: |
| 57 |
C -- GRABRT - (GRPLIB) Check for plot set abort |
| 58 |
C -- GRBOX - (GRPLIB) Draw box |
| 59 |
C -- GRPBEG - (PLTLIB) Begin a new plot |
| 60 |
C -- GRTEXT - (GRPLIB) Display a software/hardware string |
| 61 |
C -- GRYCEN - (GRPLIB) Find center lines of text area |
| 62 |
C -- LENSTR - (STRLIB) Find string length |
| 63 |
|
| 64 |
PARAMETER (KLFT=1, KRGT=2, KBOT=3, KTOP=4) |
| 65 |
|
| 66 |
include 'params.blk' |
| 67 |
include 'dbnums.blk' |
| 68 |
|
| 69 |
REAL DBORD0(KTOP), DVIEW0(KTOP) |
| 70 |
REAL CHLSIZ |
| 71 |
LOGICAL DOQA, DOAXIS, DOLAB |
| 72 |
CHARACTER*80 CAPTN(3) |
| 73 |
CHARACTER*80 TITLE |
| 74 |
CHARACTER*(MXSTLN) CREATE(4), MODIFY(4), DRAW(4) |
| 75 |
REAL DLEGND(KTOP) |
| 76 |
CHARACTER*256 CDUM1(5) |
| 77 |
CHARACTER*8 CDUM2(10) |
| 78 |
INTEGER IDUM2, IDUM3(10) |
| 79 |
INTEGER BLKCOL(0:NELBLK) |
| 80 |
|
| 81 |
LOGICAL GRABRT |
| 82 |
|
| 83 |
C --Set background color |
| 84 |
|
| 85 |
CALL SETBCK (2, CDUM1, IDUM2, IDUM3, CDUM2, *100) |
| 86 |
GOTO 110 |
| 87 |
100 CONTINUE |
| 88 |
WRITE (*, *) 'Problem setting background color' |
| 89 |
|
| 90 |
110 CONTINUE |
| 91 |
|
| 92 |
C --Begin a new plot |
| 93 |
|
| 94 |
CALL GRPBEG |
| 95 |
|
| 96 |
C --Set foreground color |
| 97 |
|
| 98 |
CALL UGRCOL (0, BLKCOL) |
| 99 |
|
| 100 |
C --Set up layout |
| 101 |
|
| 102 |
DLEGND(KLFT) = DVIEW0(KRGT) + CHLSIZ |
| 103 |
DLEGND(KRGT) = DBORD0(KRGT) |
| 104 |
DLEGND(KTOP) = DVIEW0(KTOP) |
| 105 |
DLEGND(KBOT) = DVIEW0(KBOT) |
| 106 |
|
| 107 |
IF (DOQA) THEN |
| 108 |
|
| 109 |
C --Outline the display area |
| 110 |
|
| 111 |
IF (GRABRT ()) RETURN 1 |
| 112 |
CALL GRBOX ('L', |
| 113 |
& DBORD0(KLFT), DBORD0(KRGT), DBORD0(KBOT), DBORD0(KTOP)) |
| 114 |
|
| 115 |
C *** Database title and dates *** |
| 116 |
|
| 117 |
C --Title |
| 118 |
|
| 119 |
IF (GRABRT ()) RETURN 1 |
| 120 |
DXTITL = 0.5 * (DBORD0(KRGT) - DBORD0(KLFT)) |
| 121 |
DYTITL = DBORD0(KTOP) - |
| 122 |
& 0.5 * (DBORD0(KTOP) - DVIEW0(KTOP) + CHLSIZ) |
| 123 |
|
| 124 |
C --Left-justify title |
| 125 |
DO 120 N1 = 1, 79 |
| 126 |
IF (TITLE(N1:N1) .NE. ' ') GO TO 130 |
| 127 |
120 CONTINUE |
| 128 |
130 CONTINUE |
| 129 |
|
| 130 |
CALL GRTEXC (DXTITL, DYTITL, TITLE(N1:)) |
| 131 |
|
| 132 |
C --Creator |
| 133 |
call qaleg(dlegnd, chlsiz, create, 1.0, 'Cre') |
| 134 |
|
| 135 |
C --Modifier |
| 136 |
call qaleg(dlegnd, chlsiz, modify, 1.5, 'Mod') |
| 137 |
|
| 138 |
C --User |
| 139 |
call qaleg(dlegnd, chlsiz, draw, 1.5, 'Drw') |
| 140 |
|
| 141 |
end if |
| 142 |
C *** Plot caption *** |
| 143 |
|
| 144 |
DO 140 IEND = 3, 1, -1 |
| 145 |
IF (CAPTN(IEND) .NE. ' ') GOTO 150 |
| 146 |
140 CONTINUE |
| 147 |
150 CONTINUE |
| 148 |
IF (IEND .GT. 0) THEN |
| 149 |
DXCAPT = DVIEW0(KLFT) + 0.5 * (DVIEW0(KRGT) - DVIEW0(KLFT)) |
| 150 |
DTOP = DVIEW0(KBOT) - CHLSIZ |
| 151 |
IF (DOAXIS) THEN |
| 152 |
DTOP = DTOP - 3.0*CHLSIZ |
| 153 |
ELSE IF (DOLAB) THEN |
| 154 |
DTOP = DTOP - 1.5*CHLSIZ |
| 155 |
END IF |
| 156 |
DBOT = DBORD0(KBOT) |
| 157 |
CALL GRYCEN (CHLSIZ, DTOP, DBOT, IEND, IDUM) |
| 158 |
DO 160 I = 1, IEND |
| 159 |
IF (GRABRT ()) RETURN 1 |
| 160 |
CALL GRTEXC (DXCAPT, DTOP, CAPTN(I)) |
| 161 |
DTOP = DTOP - CHLSIZ |
| 162 |
160 CONTINUE |
| 163 |
END IF |
| 164 |
|
| 165 |
C --Flush buffer, so label is complete at this point |
| 166 |
CALL PLTFLU |
| 167 |
|
| 168 |
RETURN |
| 169 |
END |
| 170 |
|
| 171 |
subroutine qaleg(dlegnd, chlsiz, entry, factor, label) |
| 172 |
include 'params.blk' |
| 173 |
PARAMETER (KLFT=1, KRGT=2, KBOT=3, KTOP=4) |
| 174 |
REAL DLEGND(KTOP) |
| 175 |
REAL CHLSIZ |
| 176 |
CHARACTER*(MXSTLN) entry(4) |
| 177 |
character*3 label |
| 178 |
|
| 179 |
DLEGND(KTOP) = DLEGND(KTOP) - factor * CHLSIZ |
| 180 |
C ... Limit creator, modified by, and drawn by strings to 20 characters |
| 181 |
C Larger strings cause problems with metafiles |
| 182 |
L1 = MIN(20, LENSTR(ENTRY(1))) |
| 183 |
CALL GRTEXT (DLEGND(KLFT), DLEGND(KTOP), |
| 184 |
& label//': '//ENTRY(1)(:L1)) |
| 185 |
DLEGND(KTOP) = DLEGND(KTOP) - CHLSIZ |
| 186 |
|
| 187 |
l3 = lenstr(entry(3)) |
| 188 |
l4 = lenstr(entry(4)) |
| 189 |
CALL GRTEXT (DLEGND(KLFT), DLEGND(KTOP), |
| 190 |
& ' '//ENTRY(3)(:l3) // |
| 191 |
* ' '//ENTRY(4)(:l4)) |
| 192 |
|
| 193 |
return |
| 194 |
end |