Debian Codegraph @

packages/seacas/applications/gen3d/g3_makrow.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 MAKROW (LINK, XN, NUMCEN, NUMCOL,
9 & NEROW, IELROW, IXROW)
10 C=======================================================================
11
12 C --*** MAKROW *** (GEN3D) Order center elements in rows
13 C -- Written by Amy Gilkey - revised 04/26/88
14 C --
15 C --MAKROW orders the elements in all center blocks into rows. Only the
16 C --elements in the needed number of columns for each row are stored.
17 C --
18 C --Parameters:
19 C -- LINK - IN - the connectivity for the 2D elements, always 4 nodes
20 C -- XN - IN - the coordinates, needed to find node ordering
21 C -- NUMCEN - IN - the number of elements in the center blocks
22 C -- NUMCOL - IN - the number of columns in the center block
23 C -- NEROW - OUT - the number of element rows in the center blocks
24 C -- IELROW - IN/OUT - the element numbers of the center elements;
25 C -- returned as rows of elements
26 C -- IXROW - OUT - the IELROW index of the starting column for each row
27 C --
28 C --Common Variables:
29 C -- Uses IX1, IX2, IX3, IX4 of /CENPAR/
30
31 INCLUDE 'g3_cenpar.blk'
32
33 INTEGER LINK(4,*)
34 REAL XN(*)
35 INTEGER IELROW(*)
36 INTEGER IXROW(*)
37
38 C --Initialize the IELROW array
39 C -- IELROW(1..ICOL1-1) holds the ordered elements for previous rows
40 C -- IELROW(ICOL1..ICOL+NCOL-1) holds the ordered elements for this row
41 C -- IELROW(IFILL..NUMCEN) holds the elements yet to be ordered
42
43 IFILL = 1
44 ICOL1 = 1
45
46 10 CONTINUE
47 IF (IFILL .LE. NUMCEN) THEN
48
49 C --Pick leftmost unordered element for the next row
50
51 ICHK = IFILL
52 XMIN = XN(LINK(IX1,IELROW(IFILL)))
53 DO 20 I = IFILL+1, NUMCEN
54 IF (XN(LINK(IX1,IELROW(I))) .LT. XMIN) THEN
55 ICHK = I
56 XMIN = XN(LINK(IX1,IELROW(I)))
57 END IF
58 20 CONTINUE
59
60 NEROW = NEROW + 1
61 IC = IELROW(ICHK)
62 IELROW(ICHK) = IELROW(IFILL)
63 IFILL = IFILL + 1
64 IELROW(ICOL1) = IC
65 IXROW(NEROW) = ICOL1
66 NCOL = 1
67
68 c --Find elements to the left of the element until at leftmost column !#VAX
69
70 C --Find elements to the right of the element until at rightmost column
71
72 40 CONTINUE
73 IEL = IELROW(ICOL1+NCOL-1)
74 L2 = LINK(IX2,IEL)
75 L3 = LINK(IX3,IEL)
76 DO 50 ICHK = IFILL, NUMCEN
77 IC = IELROW(ICHK)
78 IF ((L2 .EQ. LINK(IX1,IC))
79 & .AND. (L3 .EQ. LINK(IX4,IC))) THEN
80 IELROW(ICHK) = IELROW(IFILL)
81 IFILL = IFILL + 1
82 IELROW(ICOL1+NCOL) = IC
83 NCOL = NCOL + 1
84 GOTO 40
85 END IF
86 50 CONTINUE
87
88 NCOL = MIN (NCOL, NUMCOL)
89 ICOL1 = ICOL1 + NCOL
90
91 GOTO 10
92 END IF
93
94 IXROW(NEROW+1) = ICOL1
95
96 RETURN
97 END