Debian Codegraph @

packages/seacas/applications/blot/conlab.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 CONLAB (ICNTR, CNTR, NHIT, LABINC, LINSET,
9 & VARNP, XN, YN, ZN, IN2ELB, *)
10 C=======================================================================
11
12 C --*** CONLAB *** (DETOUR) Label contour line
13 C -- Written by Amy Gilkey - revised 06/01/87
14 C -- D. P. Flanagan, 03/30/83
15 C --
16 C --CONLAB labels a contour line that intersects the given line with the
17 C --contour letter. If LABINC is greater than one, only every LABINCth
18 C --crossing is labeled.
19 C --
20 C --Parameters:
21 C -- ICNTR - IN - the contour label number
22 C -- CNTR - IN - the contour value
23 C -- NHIT - IN/OUT - the number of "hits" so far, initialize to zero
24 C -- LABINC - IN - the number of "hits" to skip before labelling
25 C -- LINSET - IN - the line set
26 C -- VARNP - IN - the contour function values
27 C -- XN, YN, ZN - IN - the nodal coordinates
28 C -- IN2ELB - IN - the element block for each node;
29 C -- <0 if not in any selected element block
30 C -- =0 if in more than one selected element block
31 C -- * - return statement if the cancel function is active
32 C --
33 C --Common Variables:
34 C -- Uses IS3DIM of /D3NUMS/
35
36 PARAMETER (DXO = .0015, DYO = .0015)
37
38 include 'd3nums.blk'
39
40 INTEGER LINSET(3)
41 REAL VARNP(*)
42 REAL XN(*), YN(*), ZN(*)
43 INTEGER IN2ELB(*)
44
45 LOGICAL INTERP_BL
46 LOGICAL GRABRT
47 LOGICAL EXISTS
48
49 EXISTS (M) = (MOD(M,2) .NE. 0)
50
51 IF (IS3DIM) THEN
52 C --Skip invisible line
53 IF (LINSET(3) .EQ. 0) GOTO 100
54 END IF
55
56 N1 = LINSET(1)
57 N2 = LINSET(2)
58 IF ((IN2ELB(N1) .GE. 0) .AND. (IN2ELB(N2) .GE. 0)) THEN
59
60 IF (INTERP_BL (CNTR, VARNP(N1), VARNP(N2), PSI)) THEN
61 NHIT = NHIT + 1
62 IF (NHIT .GE. LABINC) THEN
63 IF (GRABRT ()) RETURN 1
64 IF (IS3DIM) THEN
65 C --Replace invisible node with partial line node
66 IF (ABS (LINSET(3)) .GT. 1)
67 & N2 = ABS (LINSET(3))
68 END IF
69 X0 = XN(N1) * (1.-PSI) + XN(N2) * PSI
70 Y0 = YN(N1) * (1.-PSI) + YN(N2) * PSI
71 CALL MP2PT (1, X0, Y0, DX0, DY0, MASK)
72 IF (EXISTS (MASK)) CALL PLTXTS (DX0+DXO, DY0+DYO,
73 & CHAR (ICHAR('A')-1+ICNTR))
74 NHIT = 0
75 END IF
76 END IF
77 END IF
78
79 100 CONTINUE
80 RETURN
81 END