| 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 |
C======================================================================= |
| 7 |
SUBROUTINE DBVINI (NVARGL, NVARNP, NVAREL) |
| 8 |
C======================================================================= |
| 9 |
|
| 10 |
C --*** DBVINI *** (EXOLIB) Initialize for DBVTYP and DBVIX |
| 11 |
C -- Written by Amy Gilkey - revised 10/14/87 |
| 12 |
C -- |
| 13 |
C --DBVINI initializes the indices for DBVTYP and DBVID. It must be |
| 14 |
C --called before either of the other two routines are called. |
| 15 |
C -- |
| 16 |
C --Note that the indices are shared because the other two routines |
| 17 |
C --are ENTRY routines of DBVINI. |
| 18 |
C -- |
| 19 |
C --Parameters: |
| 20 |
C -- NVARGL - IN - the number of global variables |
| 21 |
C -- NVARNP - IN - the number of nodal variables |
| 22 |
C -- NVAREL - IN - the number of element variables |
| 23 |
|
| 24 |
INTEGER NVARGL, NVARNP, NVAREL |
| 25 |
|
| 26 |
INTEGER IXGV, IXNV, IXEV, IXGVE, IXNVE, IXEVE |
| 27 |
common /dbv/ IXGV, IXNV, IXEV, IXGVE, IXNVE, IXEVE |
| 28 |
|
| 29 |
IXGV = 1 |
| 30 |
IXGVE = IXGV + NVARGL - 1 |
| 31 |
IXNV = IXGVE + 1 |
| 32 |
IXNVE = IXNV + NVARNP - 1 |
| 33 |
IXEV = IXNVE + 1 |
| 34 |
IXEVE = IXEV + NVAREL - 1 |
| 35 |
|
| 36 |
RETURN |
| 37 |
END |
| 38 |
|
| 39 |
C======================================================================= |
| 40 |
SUBROUTINE DBVTYP (IIX, TYP, ID) |
| 41 |
C======================================================================= |
| 42 |
|
| 43 |
C --*** DBVTYP *** (EXOLIB) Return the variable type and number |
| 44 |
C -- Written by Amy Gilkey - revised 03/18/88 |
| 45 |
C -- |
| 46 |
C --DBVTYP is passed a variable index. It returns the variable type |
| 47 |
C --and variable number. |
| 48 |
C -- |
| 49 |
C --Note that DBVINI must be called before this routine to initialize |
| 50 |
C --the indices. The indices are shared because this routine is an |
| 51 |
C --ENTRY routine of DBVINI. |
| 52 |
C -- |
| 53 |
C --Parameters: |
| 54 |
C -- IIX - IN - the variable index |
| 55 |
C -- TYP - OUT - the variable type: 'G'lobal, 'N'odal, 'E'lement |
| 56 |
C -- ID - OUT - the variable number within the type |
| 57 |
|
| 58 |
INTEGER IXGV, IXNV, IXEV, IXGVE, IXNVE, IXEVE |
| 59 |
common /dbv/ IXGV, IXNV, IXEV, IXGVE, IXNVE, IXEVE |
| 60 |
|
| 61 |
INTEGER IIX, ID |
| 62 |
CHARACTER TYP |
| 63 |
|
| 64 |
IF ((IXGV .LE. 0) .AND. (IXNV .LE. 0) |
| 65 |
& .AND. (IXEV .LE. 0)) RETURN |
| 66 |
|
| 67 |
IF ((IIX .GE. IXGV) .AND. (IIX .LE. IXGVE)) THEN |
| 68 |
TYP = 'G' |
| 69 |
ID = IIX - IXGV + 1 |
| 70 |
ELSE IF ((IIX .GE. IXNV) .AND. (IIX .LE. IXNVE)) THEN |
| 71 |
TYP = 'N' |
| 72 |
ID = IIX - IXNV + 1 |
| 73 |
ELSE IF ((IIX .GE. IXEV) .AND. (IIX .LE. IXEVE)) THEN |
| 74 |
TYP = 'E' |
| 75 |
ID = IIX - IXEV + 1 |
| 76 |
ELSE |
| 77 |
TYP = ' ' |
| 78 |
ID = 0 |
| 79 |
END IF |
| 80 |
|
| 81 |
RETURN |
| 82 |
END |
| 83 |
|
| 84 |
C======================================================================= |
| 85 |
SUBROUTINE DBVIX (ITYP, IID, IX) |
| 86 |
C======================================================================= |
| 87 |
|
| 88 |
C --*** DBVIX *** (EXOLIB) Return the variable index |
| 89 |
C -- Written by Amy Gilkey - revised 10/14/87 |
| 90 |
C -- |
| 91 |
C --DBVIX is passed a variable type and number. It returns the variable |
| 92 |
C --index. |
| 93 |
C -- |
| 94 |
C --Note that DBVINI must be called before this routine to initialize |
| 95 |
C --the indices. The indices are shared because this routine is an |
| 96 |
C --ENTRY routine of DBVINI. |
| 97 |
C -- |
| 98 |
C --Parameters: |
| 99 |
C -- ITYP - IN - the variable type: 'G'lobal, 'N'odal, 'E'lement |
| 100 |
C -- IID - IN - the variable number within the type |
| 101 |
C -- IX - OUT - the variable index |
| 102 |
|
| 103 |
INTEGER IXGV, IXNV, IXEV, IXGVE, IXNVE, IXEVE |
| 104 |
common /dbv/ IXGV, IXNV, IXEV, IXGVE, IXNVE, IXEVE |
| 105 |
|
| 106 |
CHARACTER ITYP |
| 107 |
INTEGER IID, IX |
| 108 |
|
| 109 |
IF ((IXGV .LE. 0) .AND. (IXNV .LE. 0) |
| 110 |
& .AND. (IXEV .LE. 0)) RETURN |
| 111 |
|
| 112 |
IF (ITYP .EQ. 'G') THEN |
| 113 |
IX = IID + IXGV - 1 |
| 114 |
ELSE IF (ITYP .EQ. 'N') THEN |
| 115 |
IX = IID + IXNV - 1 |
| 116 |
ELSE IF (ITYP .EQ. 'E') THEN |
| 117 |
IX = IID + IXEV - 1 |
| 118 |
END IF |
| 119 |
|
| 120 |
RETURN |
| 121 |
END |