| ASEM 21-25 | If only equation resolution is to be performed during this iteration, do not set the global stiffness coefficients to zero. |
| ASEM 29 | Loop for each element. |
| ASEM 30 | Read ESTIF for the current element. |
| ASEM 31 | Loop for each node ‘INODE’ of current element. |
| ASEM 32 | From LNODS array identify node number of current node ‘INODE’. |
| ASEM 33 | Loop for each degree of freedom of the current node ‘INODE’. |
| ASEM 34 | Establish the row position in the global stiffness matrix and load vector. |
| ASEM 35 | Establish the row position in the element stiffness matrix and load vector. |
| ASEM 36 | Add the contribution to the global load vector from the element load vector. |
| ASEM 40 | If equation resolution is to be performed, avoid assembling the global stiffness matrix. |
| ASEM 41 | Loop for each node ‘JNODE’ of the current element. |
| ASEM 42 | From LNODS array identify node number of current node ‘JNODE’. |
| ASEM 43 | Loop for each degree of freedom of the current node ‘JNODE’. |
| ASEM 44 | Establish the column position in the global stiffness matrix. |
| ASEM 45 | Establish the column position in the element stiffness matrix. |
| ASEM 46 | Add the contribution to the global stiffness matrix from the element stiffness matrix. |
| ASEM 48 | End element loop. |
For the problem described in Section 3.4.1, the main variables have the following values
$$
\mathrm{NNODE} = 2, \text { NELEM } = 4, \text { NDOFN } = 1, \text { NSVAB } = 5,
$$
$$
\text { LNODS } = \left[ \begin{array}{l l} 1 & 3 \\ 2 & 3 \\ 3 & 4 \\ 4 & 5 \end{array} \right] \begin{array}{l} - \text { Element I } \\ - \text { Element II } \\ - \text { Element III } \\ - \text { Element IV }. \end{array}
$$
# 3.4.3 Subroutine GREDUC
This subroutine undertakes the equation elimination process for equation solution by Gaussian reduction as outlined in Section 3.4.1. The additional variable names employed are defined below.
# Dictionary of variable names
ASLOD (MEQNS)
ASTIF (MEQNS, MEQNS)
ASembled LOaD vector.
Assembled global STIFFness matrix.
IEQNS, NEQNS, MEQNS
IFPRE (MEQNS)
FIXED (MEQNS)
ICOLS
IROWS
FACTR
FRESV ( )
PIVOT
Index, Number, Maximum of EQuatioNS.
Vector of parameters defining the fixity of a node. 0 - free; 1 - fixed.
Vector of prescribed displacements (zero if not prescribed).
Index COLumn of Structural stiffness matrix.
Index ROW of Structural stiffness matrix.
Gaussian reduction FACToR.
Stored Gaussian reduction factors.
Diagonal term of variable which is currently being eliminated.
```csv
SUBROUTINE GREDUC GRED 1
C**************************GRED 2
C GRED 3
C *** GAUSSIAN REDUCTION ROUTINE GRED 4
C GRED 5
C**************************GRED 6
COMMON/UNIM1/NPOIN,NELEM,NBOUN,NLOAD,NPROP,NNODE,IINCS,IITER, GRED 7
. KRESL,NCHEK,TOLER,NALGO,NSVAB,NDOFN,NINCS,NEVAB, GRED 8
. NITER,NOUTP,FACTO,PVALU GRED 9
COMMON/UNIM2/PROPS(5,4),COORD(26),LNODS(25,2),IFPRE(52), GRED 10
. FIXED(52),TLOAD(25,4),RLOAD(25,4),ELOAD(25,4), GRED 11
. MATNO(25),STRES(25,2),PLAST(25),XDISP(52), GRED 12
. TDISP(26,2),TREAC(26,2),ASTIF(52,52),ASLOD(52), GRED 13
. REACT(52),FRESV(1352),PEFIX(52),ESTIF(4,4) GRED 14
C GRED 15
C GAUSSIAN REDUCTION ROUTINE GRED 16
C GRED 17
KOUNT=0 GRED 18
NEQNS=NSVAB GRED 19
DO 70 IEQNS=1,NEQNS GRED 20
IF(IFPRE(IEQNS).EQ.1) GO TO 40 GRED 21
C GRED 22
C REDUCE EQUATIONS GRED 23
C GRED 24
PIVOT=ASTIF(IEQNS,IEQNS) GRED 25
IF(ABS(PIVOT).LT.1.0E-10) GO TO 60 GRED 26
IF(IEQNS.EQ.NEQNS) GO TO 70 GRED 27
IEQN1=IEQNS+1 GRED 28
DO 30 IROWS=IEQN1,NEQNS GRED 29
KOUNT=KOUNT+1 GRED 30
FACTR=ASTIF(IROWS.IEQNS)/PIVOT GRED 31
FRESV(KOUNT)=FACTR GRED 32
IF(FACTR.EQ.0.0) GO TO 30 GRED 33
DO 10 ICOLS=IEQNS,NEQNS GRED 34
ASTIF(IROWS,ICOLS)=ASTIF(IROWS,ICOLS)-FACTR*ASTIF(IEQNS,ICOLS) GRED 35
10 CONTINUE GRED 36
ASLOD(IROWS)=ASLOD(IROWS)-FACTR*ASLOD(IEQNS) GRED 37
30 CONTINUE GRED 38
GO TO 70 GRED 39
C GRED 40
C ADJUST RHS(LOADS) FOR PRESCRIBED DISPLACEMENTS GRED 41
```