Debian Codegraph @

packages/seacas/applications/algebra/ag_dofnc1.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 DOFNC1 (FUNC, PARTYP, LENARY, NELBLK, IXELB, ISEVOK,
9 & NUMIX, IXNODE, IXELEM, PARM, RESULT)
10 C=======================================================================
11
12 C --*** DOFNC1 *** (ALGEBRA) Perform function (1 parameter)
13 C -- Written by Amy Gilkey - revised 05/17/88
14 C --
15 C --DOFNC1 performs an intrinsic or external function with one parameter
16 C --on each array value.
17 C --
18 C --Parameters:
19 C -- FUNC - IN - the intrinsic or external function
20 C -- PARTYP - IN - the parameter type (element must be handled differently)
21 C -- LENARY - IN - the length of the parameter array
22 C -- NELBLK - IN - the number of element blocks
23 C -- IXELB - IN - the cumulative element counts for each element block
24 C -- ISEVOK - IN - the element variable truth table for each element block
25 C -- NUMIX - IN - the number of selected values; <0 if all
26 C -- IXNODE - IN - the indices of the selected nodes (only if NUMIX>=0)
27 C -- IXELEM - IN - the indices of the selected elements (only if NUMIX>=0)
28 C -- PARM - IN - the parameter array
29 C -- RESULT - OUT - the returned result array
30
31 CHARACTER PARTYP
32 INTEGER IXELB(0:NELBLK)
33 LOGICAL ISEVOK(*)
34 INTEGER IXNODE(*)
35 INTEGER IXELEM(*)
36 REAL PARM(*)
37 REAL RESULT(*)
38
39 IF (NUMIX .GE. 0) THEN
40 IF (PARTYP .NE. 'E') THEN
41 DO 100 I = 1, NUMIX
42 J = IXNODE(I)
43 RESULT(J) = FUNC (PARM(J))
44 100 CONTINUE
45 ELSE
46 DO 120 IELB = 1, NELBLK
47 IF (ISEVOK(IELB)) THEN
48 DO 110 I = IXELB(IELB-1)+1, IXELB(IELB)
49 J = IXELEM(I)
50 RESULT(J) = FUNC (PARM(J))
51 110 CONTINUE
52 END IF
53 120 CONTINUE
54 END IF
55
56 ELSE
57 C NUMIX < 0; All Values are selected
58 C NUMEL = NUMELO; NUMNP = NUMNPO; IXELB(J) = IXELBO(J) J=1,NELBLK
59 IF (PARTYP .NE. 'E') THEN
60 DO 130 J = 1, LENARY
61 RESULT(J) = FUNC (PARM(J))
62 130 CONTINUE
63 ELSE
64 DO 150 IELB = 1, NELBLK
65 IF (ISEVOK(IELB)) THEN
66 DO 140 J = IXELB(IELB-1)+1, IXELB(IELB)
67 RESULT(J) = FUNC (PARM(J))
68 140 CONTINUE
69 END IF
70 150 CONTINUE
71 END IF
72 END IF
73
74 RETURN
75 END