c
c *** Program reading COSMOS's USC-Type Strong Motion Data
c
      program read
c
      dimension X(33000),Y(33000),Z(33000),t(33000)
      character line*80,infile1*80,infile2*80,infile3*80
c
      write(*,*)'Program for Reading USC-Type Strong Motion Data'
      write(*,*)
      write(*,*)'Enter 1st File Name of 3 Components'
c      read(*,'(a80)')infile1
      write(*,*)'Enter 2nd File Name of 3 Components'
c      read(*,'(a80)')infile2
      write(*,*)'Enter 3rd File Name of 3 Components'
c      read(*,'(a80)')infile3
c
      open(11,file='N00E.txt',status='old')
c      open(11,file=infile1,status='old')
        read(11,*)
        read(11,*)
        read(11,*)
        read(11,*)
        read(11,'(a80)')line
        write(*,*)line
        read(11,'(a80)')line
        write(*,*)line
        read(11,'(a80)')line
        write(*,*)line
        read(11,*)
        read(11,*)
        read(11,*)
        read(11,1000)nt
        write(*,*)'nt =',nt
        do i=1,16
          read(11,*)
        end do
         do i=1,nt-5,5
         read(11,*)t(i),x(i),t(i+1),x(i+1),t(i+2),x(i+2)
     *            ,t(i+3),x(i+3),t(i+4),x(i+4)
         end do
      close(11)
 1000 format(15x,i7)
c
c
      write(*,*)
      write(*,*)'Enter Output Acceleration File Name (CSV format)'
      read(*,'(a80)')infile1
      open(11,file=infile1,status='unknown')
        do i=1,nt
          write(11,2000)t(i),x(i),y(i),z(i)
        end do
      close(11)
 2000 format(f7.3,3(',',f10.3))
c
      stop
      end
