PROGRAM PRINTALONG
C=======================================================================
C        THIS PROVIDES A FILE CONTAINING CALCULATED VALUES AT 
C                      SELECTED NODAL POINTS.
C        INPUT FILES: STATICX.DAT
C                     PRINTDISP.DAT
C                     STRESSX.OUT
C        OUTPUT FILE: DISP.OUT
C     NOV. 28, 2012
C     EIJI FUKUMORI
C=======================================================================
      IMPLICIT REAL*8 ( A-H , O-Z )
      INCLUDE 'PARAM.DAT'
CCCCC      PARAMETER ( ND=4, INTEPT=2, MXE=31300, MXN=34410, MXB=21000 )
C=======================================================================
      DIMENSION XCOORD(2,MXN), U(2,MXN),GLBTAU(8,MXN)
      DIMENSION NEUTRAL(MXN), INNER(MXN)
      CHARACTER PROJECT*12,EXFILE*3
      CHARACTER*12 INPFILE, OUTFILE
C=======================================================================
      IF ( ND .EQ.  4 ) INPFILE = 'STATIC4.DAT'
      IF ( ND .EQ.  8 ) INPFILE = 'STATIC8.DAT'
      IF ( ND .EQ.  9 ) INPFILE = 'STATIC9.DAT'
      IF ( ND .EQ. 12 ) INPFILE = 'STATICC.DAT'
      OPEN ( 1, FILE=INPFILE, STATUS='OLD' )
      READ (1,*) YOUNG, POISSON
      READ (1,*) NE
      DO I = 1 , NE
      READ (1,*)
      END DO
      READ (1,*) NNODE
      CLOSE (1)
      WRITE (*,*)'NNODE=',NNODE
C=======================================================================
      OPEN ( 1, FILE='PRINTDISP.DAT', STATUS='UNKNOWN' )
      READ(1,*) NPOINT
      DO I = 1 , NPOINT
      READ(1,*) INNER(I)
      END DO
      CLOSE (1)
C=======================================================================
      IF ( ND .EQ.  4 ) OUTFILE = 'STRESS4.OUT'
      IF ( ND .EQ.  8 ) OUTFILE = 'STRESS8.OUT'
      IF ( ND .EQ.  9 ) OUTFILE = 'STRESS9.OUT'
      IF ( ND .EQ. 12 ) OUTFILE = 'STRESSC.OUT'
      OPEN ( 1, FILE=OUTFILE, STATUS='UNKNOWN' )
      READ (1,*)
      DO I = 1 , NNODE
      READ (1,*) K, XCOORD(1,I),XCOORD(2,I),U(1,I),U(2,I),
     *    (GLBTAU(J,I),J=1,8)
      END DO
      CLOSE (1)
C=======================================================================
      OPEN ( 1, FILE='DISP.OUT', STATUS='UNKNOWN' )
      WRITE (1,*) 'ND# R Z U W TAURR TAU00 TAUZZ TAURZ ERR E00 EZZ DUDZ'
      PREVIOUS = XCOORD(2,INNER(1))
      DO J = 1 , NPOINT
      I = INNER(J)
      IF ( PREVIOUS .NE. XCOORD(2,I) ) WRITE (1,*)
      WRITE (1,*) I, XCOORD(1,I),XCOORD(2,I),U(1,I),U(2,I),
     *    (GLBTAU(K,I),K=1,8)
      PREVIOUS = XCOORD(2,I)
      END DO
      CLOSE (1)
      STOP 'NORMAL TERMINATION'
      END