      PARAMETER(IMAX=128,JMAX=64,KMAX=31)

      CHARACTER HEAD2(64)*16
      REAL PS(IMAX,JMAX,KMAX), X(1000,IMAX,JMAX,KMAX)
      INTEGER NO
C

C
C  Change following paremeters...................................
C     NO:  END Day No. for output
      NO = 365
C
      OPEN (20, FILE='./T_P',
     & access='SEQUENTIAL',form='UNFORMATTED',convert='BIG_ENDIAN')

      I = 0
 3000 CONTINUE
      I = I + 1
      READ(20,END=4000) HEAD2
      READ(20) PS
      DO II = 1, IMAX
       DO JJ = 1, JMAX
        DO KK = 1, KMAX
         X(I,II,JJ,KK)=PS(II,JJ,KK)
        END DO
       END DO
      END DO
      IF ( I .EQ. NO ) GO TO 4000 
      GOTO 3000
 4000 CONTINUE
      CLOSE (20)
C
C
      DO I = 1, NO 
       DO KK = 1, KMAX
        DO JJ = 1, JMAX
         DO II = 1, IMAX
           WRITE(6,5000) I, II, JJ, KK, X(I,II,JJ,KK)
         END DO
        END DO
       END DO
      END DO

 5000 FORMAT ( 4(I3,1X), 1X, E15.7 )

      END
