Debian Codegraph @

packages/seacas/applications/blot/sorlnk.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 SORLNK (A, NSETS, NEWELB,
9 & LENF, NLNKF, LINKF, IF2EL, IF2EL2, IE2ELB)
10 C=======================================================================
11
12 C --*** SORLNK *** (MESH) Sort faces
13 C -- Written by Amy Gilkey - revised 03/10/88
14 C --
15 C --SORLNK resorts all the faces into new element block sets. This
16 C --is done by coping the faces, then renaming the arrays.
17 C --
18 C --This routine uses MDFIND to find the following dynamic memory arrays:
19 C -- LINKF - for length only
20 C -- IF2EL - for length only
21 C --
22 C --Parameters:
23 C -- A - IN - the dynamic memory base array
24 C -- NSETS - IN - the number of element block sets in LINKF
25 C -- NEWELB - IN - the new element block set for each face
26 C -- LENF - IN/OUT - the cumulative face counts by element block for LINKF
27 C -- NLNKF - IN - the number of nodes for each element block
28 C -- LINKF - IN/OUT - the unsorted connectivity for all faces
29 C -- IF2EL - IN/OUT - the element number of each face in LINKF
30 C -- IF2EL2 - IN/OUT - the secondary element number of each face in LINKF
31 C -- IE2ELB - IN - the element for each element block
32 C --
33 C --Common Variables:
34 C -- Uses NELBLK of /DBNUMS/
35
36 common /debugc/ cdebug
37 common /debugn/ idebug
38 character*8 cdebug
39
40 include 'dbnums.blk'
41 include 'd3nums.blk'
42
43 DIMENSION A(*)
44 INTEGER NEWELB(*)
45 INTEGER LENF(0:NSETS)
46 INTEGER NLNKF(NELBLK)
47 INTEGER LINKF(*)
48 INTEGER IF2EL(*), IF2EL2(*)
49 INTEGER IE2ELB(*)
50
51 LOGICAL SOMMOV
52
53 C --Check that some faces will move
54
55 SOMMOV = .FALSE.
56 DO 110 IELB = 1, NSETS
57 DO 100 IFAC = LENF(IELB-1)+1, LENF(IELB)
58 IF (IELB .NE. IABS (NEWELB(IFAC))) THEN
59 SOMMOV = .TRUE.
60 GOTO 120
61 END IF
62 100 CONTINUE
63 110 CONTINUE
64 120 CONTINUE
65
66 IF (SOMMOV) THEN
67 CALL MDRSRV ('XLENF', KLENF, 1+NSETS)
68 CALL MDFIND ('LINKF', IDUM, LENLNK)
69 CALL MDRSRV ('XLINKF', KLINKF, LENLNK)
70 CALL MDFIND ('IF2EL', IDUM, LENF2E)
71 CALL MDRSRV ('XIF2EL', KIF2EL, LENF2E)
72 IF (IS3DIM) CALL MDRSRV ('XIF2E2', KIF2E2, LENF2E)
73 CALL MDSTAT (NERR, MEM)
74 IF (NERR .GT. 0) GOTO 130
75
76 CALL CPYINT (1+NSETS, LENF, A(KLENF))
77 CALL CPYINT (LENLNK, LINKF, A(KLINKF))
78 CALL CPYINT (LENF2E, IF2EL, A(KIF2EL))
79 IF (IS3DIM) CALL CPYINT (LENF2E, IF2EL2, A(KIF2E2))
80
81 CALL SORLNX (NSETS, NEWELB, IE2ELB,
82 & NLNKF, A(KLENF), A(KLINKF), A(KIF2EL), A(KIF2E2),
83 & LENF, LINKF, IF2EL, IF2EL2)
84
85 CALL MDDEL ('XLENF')
86 CALL MDDEL ('XLINKF')
87 CALL MDDEL ('XIF2EL')
88 IF (IS3DIM) CALL MDDEL ('XIF2E2')
89 CALL MDSTAT (NERR, MEM)
90 IF (NERR .GT. 0) GOTO 130
91 END IF
92 130 CONTINUE
93 RETURN
94 END