      SUBROUTINE  POST ( M, NE, NG, NDFREE, NODES, LNODE, INDEX, 
     1    DD, N, NSPACE, NELFRE, NRB, NQP, NGEOM, NPARM, NNPFIX, 
     2    NNPFLO, MISCFX, MISCFL, NLPFIX, NLPFLO, COORD, S, C, H, 
     3    DGH, B, E, EB, STRAIN, STRAN0, STRESS, BODY, PT, WT, 
     4    XYZ, DLH, G, DLG, AJ, AJINV, HINTG, D, PRTLPT, FLTMIS, 
     5    ELPROP, PRTLPT, PRTMAT, MISFIX, LSHAPE, LPROP, LPPROP, 
     6    NTAPE1, NTAPE2, NTAPE3, NTAPE4, NTAPE5, IT, NITER,
     7    LTYPE, NLTYPE, LTDATA, GPT, GWT, LHOMO, FLTNP, FLTEL,
     8    NPFIX, LPFIX, USEREL, USERPT )
C     * * * * * * * * * * * * * * * * * * * * * * * * * * * *
C           ELEMENT LEVEL POST-SOLUTION CALCULATIONS
C     * * * * * * * * * * * * * * * * * * * * * * * * * * * *
CDP   IMPLICIT   REAL*8  (A-H,O-Z)
      DATA  LASTLT / 0 /
C        ALWAYS USED
      DIMENSION  COORD(N,NSPACE), S(NELFRE,NELFRE), DD(NDFREE), 
     1           D(NELFRE), NODES(NE,N), LNODE(N), INDEX(NELFRE),
     2           LTYPE(NE), LTDATA(6,NLTYPE)
C
C        USUALLY USED
      DIMENSION  C(NELFRE), H(N,0:NQP), DGH(NSPACE,N), B(NRB,NELFRE), 
     1           E(NRB,NRB), EB(NRB,NELFRE), STRAIN(NRB+2), 
     2           STRAN0(NRB), STRESS(NRB+2), BODY(NSPACE)
C
C        OPTIONAL FOR NUMERICAL INTEGRATION
      DIMENSION  PT(NPARM,0:NQP), WT(0:NQP), DLH(NSPACE,N,0:NQP), 
     1           G(NGEOM), DLG(NPARM,NGEOM), AJ(NSPACE,NSPACE), 
     2           AJINV(NSPACE,NSPACE), HINTG(N), XYZ(NSPACE),
     3           GPT(0:NQP), GWT(0:NQP)
C
C        OPTIONAL PROPERTY AND SOLUTION VALUES
      DIMENSION  D(NELFRE), PRTLPT(N,0:NNPFLO), FLTMIS(0:MISCFL), 
     1           ELPROP(0:NLPFLO), PRTLPT(N,0:NNPFLO), 
     2           PRTMAT(0:NLPFLO), MISFIX(0:MISCFX), 
     3           LPROP(0:NLPFIX), LPPROP(0:NNPFIX)
      DIMENSION  FLTNP(M,0:NNPFLO), FLTEL(NE,0:NLPFLO),
     1           NPFIX(M,0:NNPFIX), LPFIX(NE,0:NLPFIX)
C
C        OPTIONAL USER APPLICATION AT NODE OR ELEMENT
      DIMENSION  USERPT(NG), USEREL(NG,N)
C
C                     VARIABLES:
C     AJ      = JACOBIAN
C     AJINV   = JACOBIAN INVERSE
C     B       = STRAIN-DISPLACEMENT (GRADIENT) MATRIX
C     BODY    = BODY FORCE VECTOR
C     COORD   = SPATIAL COORDINATES OF ELEMENT'S NODES
C     D       = NODAL PARAMETERS ASSOCIATED WITH AN ELEMENT
C     DD      = ARRAY OF SYSTEM DEGREES OF FREEDOM
C     DGH     = GLOBAL DERIVATIVES INTERPOLATION FUNCTIONS
C     DLG     = LOCAL DERIVATIVES GEOMETRIC INTERPOLATION
C     DLH     = LOCAL DERIVATIVES INTERPOLATION FUNCTIONS
C     E       = CONSTITUTIVE MATRIX
C     EB      = PRODUCT OF E*B
C     ELPROP  = ELEMENT ARRAY OF FLOATING PT PROPERTIES
C     FLTMIS  = SYSTEM STORAGE OF FLOATING PT MISC PROP
C     G       = GEOMETRIC INTERPOLATION FUNCTIONS
C     H       = SOLUTION INTERPOLATION FUNCTIONS
C     HINTG   = INTEGRAL OF INTERPOLATION FUNCTIONS
C     INDEX   = SYSTEM DOF NOS ASSOCIATED WITH ELEMENT
C     IT      = CURRENT ITERATION NUMBER
C     LNODE   = THE N ELEMENT INCIDENCES OF THE ELEMENT
C     LPPROP  = INTEGER PROPERTIES AT EACH ELEMENT NODE
C     LPROP   = ARRAY INTEGER POINT ELEMENT PROPERTIES
C     M       = TOTAL NUMBER OF NODES
C     MISFIX  = MISCELLANEOUS INTEGER SYSTEM PROPERTIES
C     N       = NUMBER OF NODES PER ELEMENT
C     NDFREE  = TOTAL NUMBER OF SYSTEM DEGREES OF FREEDOM
C     NE      = NUMBER OF ELEMENTS IN SYSTEM
C     NELFRE  = NUMBER OF DEGREES OF FREEDOM PER ELEMENT
C     NG      = NUMBERS PARAMETERS PER NODE
C     NGEOM   = NUMBER OF GEOMETRY NODES
C     NITER   = MAX NUMBER OF ITERATIONS
C     NMAT    = NUMBER OF MATERIAL TYPES
C     NODES   = ELEMENT INCIDENCES OF ALL ELEMENTS
C     NPARM   = DIMENSION OF PARAMWETRIC SPACE
C     NQP     = NUMBER OF QUADRATURE POINTS
C     NRB     = NUMBER OF ROWS IN B AND E MATRICES
C     NSPACE  = DIMENSION OF SPACE
C     NTAPE1  = UNIT FOR POST SOLUTION MATRICES STORAGE
C     NTAPE2,3,4 = OPTIONAL UNITS FOR USER (USED WHEN > 0)
C     PRTLPT  = REAL PROPERTIES AT ELEMENT NODES
C     PRTMAT  = REAL ELEM PROPERTIES BASED ON MATERIAL NUMBER
C     PT      = QUADRATURE COORDINATES
C     S       = ELEMENT SQUARE MATRIX
C     STRAIN  = STRAIN OR GRADIENT VECTOR
C     STRAN0  = INITIAL STRAIN OR GRADIENT VECTOR
C     STRESS  = STRESS VECTOR
C     USEREL  = (USER CHOICE) ELEMENT APPLICATION RESULT
C     USERPT  = (USER CHOICE) NODAL APPLICATION RESULT
C     WT      = QUADRATURE WEIGHTS
C     XYZ     = SPACE COORDINATES AT A POINT
C      NTAPE1 MUST BE > 0 
      IF ( NTAPE1 .GT. 0 )  THEN
        REWIND  NTAPE1
      ELSE
        STOP 'NO NTAPE1 IN POST'
      ENDIF
C
C-->   LOOP OVER ELEMENTS
      LPTEST = NLPFIX + NLPFLO
      DO 10  IE = 1, NE
C-->     GET ELEMENT TYPE NUMBER
        LT = 1
        IF ( NLTYPE .GT. 1 )  LT = LTYPE(IE) 
C        SAME AS LAST TYPE ?
        IF ( LT .NE. LASTLT )  THEN
          LASTLT = LT
C          GET CONTROLS FOR THIS TYPE
          CALL  GETLT (LT, NLTYPE, LTDATA, LTN, LTQP, LTGEOM,
     1                 LTPARM, LTSHAP, LTUSER )
          LTFREE = LTN*NG
C-->       GET QUADRATURE RULE FOR ELEMENT TYPE AND SHAPE
          IF ( LTQP .GT. 0 ) 
     1         CALL  GETQD (LTSHAP, LTQP, NSPACE, GPT, GWT, PT, WT)
        ENDIF
C-->     EXTRACT ELEMENT NODE NUMBERS
        CALL  LNODES (IE, NE, LTN, NODES, LNODE)
C-->     CALCULATE DEGREE OF FREEDOM NUMBERS
        CALL  INDXEL (LTN, LTFREE, NG, LNODE, INDEX)
C-->     EXTRACT NODAL PARAMETERS OF THE ELEMENT
        CALL  ELFRE (NDFREE, LTFREE, D, DD, INDEX)
C-->     EXTRACT NODAL POINT PROPERTIES (IF ANY)
        IF ( NNPFLO .GT. 0 )  CALL  LPTPRT (N,M,NNPFLO,FLTNP,PRTLPT,
     1                        NNPFIX,NPFIX,LPPROP,LNODE,NHOMO)
C-->     EXTRACT ELEMENT PROPERTIES (IF ANY)
        IF ( LPTEST .GT. 0 )  CALL ELPRTY (IE,LHOMO,NE,NLPFIX,
     1                        NLPFLO,LPFIX,FLTEL,LPROP,ELPROP)
C-->     EXTRACT MATERIAL PROPERTIES (IF ANY)
        IF ( NMAT .GT. 0 )  CALL MATPRT (NMAT,NLPFLO,MISCFL,
     1                                   FLTMIS,PRTMAT)
C
C-->     PERFORM PROBLEM DEPENDENT CALCULATIONS AND OUTPUT
C
        CALL  POSTEL (LTN, NSPACE, LTFREE, NRB, LTQP, LTGEOM,
     1    LTPARM, NNPFIX, NNPFLO, MISCFX, MISCFL, NLPFIX,
     2    NLPFLO, COORD, S, C, H, DGH, B, E, EB, STRAIN,
     3    STRAN0, STRESS, BODY, PT, WT, XYZ, DLH, G, DLG,
     4    AJ, AJINV, HINTG, D, PRTLPT, FLTMIS, ELPROP, PRTLPT, 
     5    PRTMAT, MISFIX, LTSHAP, LPROP, LPPROP, NTAPE1, 
     6    NTAPE2, NTAPE3, NTAPE4, NTAPE5, IT, NITER, IE, NE,
     7    LNODE, NG, USEREL, USERPT )
c23456789012345678901234567890123456789012345678901234567890-----------X
 10   CONTINUE
      RETURN
      END
