C*******************************************
C     GRID TRANSFORMATION 
C********************************************
C
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      PARAMETER(NF0=11000)
      CHARACTER LINE1*20, LINE2*20, LINE3*20
      DIMENSION EL(NF0,3,3)
C
      open(2, file='kiretu3.dxf', status='unknown',blank='null')
      N=0
   10 NF=N
      N=N+1
      read(2,500) LINE1
      if (LINE1.eq.'EOF') GO TO 20
      if (N.GT.10000) GO TO 20 
      read(2,500) LINE2
      read(2,500) LINE3
      DO J=1,3
      DO K=1,3
      read(2,*) point
      read(2,*) EL(N,J,K)
      ENDDO
      ENDDO
      DO K=1,3
      read(2,*) point
      read(2,*) eldummy
      ENDDO
      read(2,*) endel
      GO TO 10
  20  CLOSE(2)
      open(2, file='KIRETU3.DAT', status='unknown',blank='null')
      write(2,*) NF
      write(2,'(7F12.7)') (((EL(N,J,K),N=1,NF),J=1,3),K=1,3)
      CLOSE(2)
 500  FORMAT(A10)
C
      STOP
      END
