Debian Codegraph @

packages/seacas/applications/blot/grncrv.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 GRNCRV (LABSID, ICURVE, NPTS, XPTS, YPTS, DRAWLN)
9 C=======================================================================
10
11 C --*** GRNCRV *** (GRPLIB) Label Curve (PLT)
12 C -- Written by Amy Gilkey - revised 10/07/87
13 C --
14 C --GRNCRV finds the device coordinates of the first, last or middle
15 C --point of a curve within the plot window and labels the curve with
16 C --the line number.
17 C --
18 C --Parameters:
19 C -- LABSID - IN - label curve on "FIRST", "MIDDLE" or "LAST" point
20 C -- ICURVE - IN - the curve number
21 C -- NPTS - IN - the number of points in the curve
22 C -- XPTS, YPTS - IN - the X and Y points
23 C -- DRAWLN - IN - true if vector, false if points
24
25 C --Routines Called:
26 C -- MP2VC - (PLTLIB) Get device coordinates of vector
27 C -- MP2PT - (PLTLIB) Get device coordinates of point
28 C -- PLTGTT - (PLTLIB) Get text parameter
29 C -- 2 = (KSCHSZ) software character size
30 C -- INTSTR - (STRLIB) Convert integer to string
31
32 PARAMETER (KSCHSZ=2)
33
34 CHARACTER*8 LABSID
35 INTEGER ICURVE
36 INTEGER NPTS
37 REAL XPTS(*), YPTS(*)
38 LOGICAL DRAWLN
39
40 LOGICAL LDUM, PLTGTT
41 CHARACTER*2 STR2
42
43 C --Find the nearest line or point within the window
44
45 IF (LABSID .EQ. 'FIRST') THEN
46 ISTART = 1
47 IEND = NPTS
48 INC = 1
49 ELSE IF (LABSID .EQ. 'MIDDLE') THEN
50 ISTART = NPTS / 2
51 IEND = NPTS
52 INC = 1
53 ELSE
54 ISTART = NPTS
55 IEND = 1
56 INC = -1
57 END IF
58
59 IF (DRAWLN) THEN
60 DO 100 I = ISTART, IEND-INC, INC
61 MASK = -1
62 CALL MP2VC (1, XPTS(I), YPTS(I), XPTS(I+INC), YPTS(I+INC),
63 & DX, DY, DXX, DYY, MASK)
64 IF (MOD (MASK,2) .NE. 0) GOTO 120
65 100 CONTINUE
66
67 ELSE
68 DO 110 I = ISTART, IEND, INC
69 MASK = -1
70 CALL MP2PT (1, XPTS(I), YPTS(I), DX, DY, MASK)
71 IF (MOD (MASK,2) .NE. 0) GOTO 120
72 110 CONTINUE
73 END IF
74
75 GOTO 130
76
77 C --Write the curve number (location is dependent on the placement)
78
79 120 CONTINUE
80 C --Get curve number
81 CALL INTSTR (1, 0, ICURVE, STR2, LNUM)
82
83 LDUM = PLTGTT (KSCHSZ, VCS)
84 IF (DRAWLN) THEN
85 DXO = .25
86 ELSE
87 DXO = .50
88 END IF
89 IF (LABSID .EQ. 'FIRST') THEN
90 DX = DX - (LNUM+DXO) * VCS
91 ELSE
92 DX = DX + DXO*VCS
93 END IF
94 IF (LABSID .EQ. 'MIDDLE') THEN
95 DY = DY + .002
96 ELSE
97 DY = DY - .5*VCS
98 END IF
99
100 CALL GRTEXT (DX, DY, STR2)
101
102 130 CONTINUE
103 RETURN
104 END