Debian Codegraph @

packages/seacas/applications/grepos/gp_renix.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 RENIX (LLIST, IOFFIX, IX, LIST, ZEROIT)
9 C=======================================================================
10
11 C --*** RENIX *** (GJOIN) Renumbers items according to an index list
12 C -- Written by Amy Gilkey - revised 09/29/87
13 C --
14 C --RENIX renumbers each item in the list to the index given in another
15 C --list or adds an offset to the item.
16 C --
17 C --Parameters:
18 C -- LLIST - IN - the length of LIST
19 C -- IOFFIX - IN - the offset to be added; if <0, use IX
20 C -- IX - IN - the new index of the specified item
21 C -- LIST - IN/OUT - the list of integers; renumbered
22 C -- ZEROIT - IN - logical, if true and IX(LIST(I)) <= 0,
23 C set LIST(I) = 0, else set to ABS value.
24 INTEGER IX(*)
25 INTEGER LIST(*)
26 LOGICAL ZEROIT
27
28 IF (IOFFIX .GE. 0) THEN
29 DO 100 I = 1, LLIST
30 LIST(I) = LIST(I) + IOFFIX
31 100 CONTINUE
32 ELSE
33 DO 110 I = 1, LLIST
34 IF (IX(LIST(I)) .LE. 0 .AND. ZEROIT) THEN
35 LIST(I) = 0
36 ELSE
37 LIST(I) = ABS(IX(LIST(I)))
38 END IF
39 110 CONTINUE
40 END IF
41
42 RETURN
43 END