| 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 DOFNC2 (FUNC, PARTYP, LENARY, NELBLK, IXELB, ISEVOK, |
| 9 |
& NUMIX, IXNODE, IXELEM, PARM1, PARM2, RESULT) |
| 10 |
C======================================================================= |
| 11 |
|
| 12 |
C --*** DOFNC2 *** (ALGEBRA) Perform function (2 parameters) |
| 13 |
C -- Written by Amy Gilkey - revised 05/17/88 |
| 14 |
C -- |
| 15 |
C --DOFNC2 performs an intrinsic or external function with two parameters |
| 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 arrays |
| 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 -- PARM1 - IN - parameter 1 array |
| 29 |
C -- PARM2 - IN - parameter 2 array |
| 30 |
C -- RESULT - OUT - the returned result array |
| 31 |
|
| 32 |
CHARACTER PARTYP |
| 33 |
INTEGER IXELB(0:NELBLK) |
| 34 |
LOGICAL ISEVOK(*) |
| 35 |
INTEGER IXNODE(*) |
| 36 |
INTEGER IXELEM(*) |
| 37 |
REAL PARM1(*), PARM2(*) |
| 38 |
REAL RESULT(*) |
| 39 |
|
| 40 |
IF (NUMIX .GE. 0) THEN |
| 41 |
IF (PARTYP .NE. 'E') THEN |
| 42 |
DO 100 I = 1, NUMIX |
| 43 |
J = IXNODE(I) |
| 44 |
RESULT(J) = FUNC (PARM1(J), PARM2(J)) |
| 45 |
100 CONTINUE |
| 46 |
ELSE |
| 47 |
DO 120 IELB = 1, NELBLK |
| 48 |
IF (ISEVOK(IELB)) THEN |
| 49 |
DO 110 I = IXELB(IELB-1)+1, IXELB(IELB) |
| 50 |
J = IXELEM(I) |
| 51 |
RESULT(J) = FUNC (PARM1(J), PARM2(J)) |
| 52 |
110 CONTINUE |
| 53 |
END IF |
| 54 |
120 CONTINUE |
| 55 |
END IF |
| 56 |
|
| 57 |
ELSE |
| 58 |
C NUMIX < 0; All values selected |
| 59 |
C NUMEL = NUMELO; NUMNP = NUMNPO; IXELB(J) = IXELBO(J) J=1, NELBLK |
| 60 |
IF (PARTYP .NE. 'E') THEN |
| 61 |
DO 130 J = 1, LENARY |
| 62 |
RESULT(J) = FUNC (PARM1(J), PARM2(J)) |
| 63 |
130 CONTINUE |
| 64 |
ELSE |
| 65 |
DO 150 IELB = 1, NELBLK |
| 66 |
IF (ISEVOK(IELB)) THEN |
| 67 |
DO 140 J = IXELB(IELB-1)+1, IXELB(IELB) |
| 68 |
RESULT(J) = FUNC (PARM1(J), PARM2(J)) |
| 69 |
140 CONTINUE |
| 70 |
END IF |
| 71 |
150 CONTINUE |
| 72 |
END IF |
| 73 |
END IF |
| 74 |
|
| 75 |
RETURN |
| 76 |
END |