c
c Program to take an RCS file in SRCRCS file format and convert
c the format to write out apsect angle & RCS in 2 columns. 
c
c Note: The header data in the original data file is NOT written
c       to the  new column-format file.
c
      character dummy*80
      character infile*40, outfile*40
      real rcs(4000)

      write(6,*) ' '
      write(6,*) ' '
      write(6,*) ' Conversion of SRCRCS RCS files into column format.'
 100  continue
      write(6,*) ' '
      write(6,*) 'Name of RCS file to be converted to columns(CR=end):'
      read(5,'(a40)') infile
      if( infile .eq. ' ' ) go to 999
      open(57,file=infile,status='old',readonly)
      write(6,*)
      write(6,*) 'Name of output file: '
      read(5,'(a40)') outfile
      open(3,file=outfile,status='new')


      read(57,'(a80)') dummy
      write(6,'(a80)') dummy

      read(57,'(a80)') dummy
      write(6,'(a80)') dummy

      read(57,'(a80)') dummy
      write(6,'(a80)') dummy

      read(57,'(a34,f8.2,f8.2,f8.2)') dummy,start,stop,by
      write(6,'(a34,f8.2,f8.2,f8.2)') dummy,start,stop,by

      read(57,'(a80)') dummy
      write(6,'(a80)') dummy

      read(57,'(a80)') dummy
      write(6,'(a80)') dummy

      read(57,'(a80)') dummy
      write(6,'(a80)') dummy

      write(6,*) ' '
      write(6,*) ' '

      nrcs = ( (stop-start) / abs(by) ) + 1
      read(57,'(10F7.2)') (rcs(i),i=1,nrcs)
      do i=1,nrcs
        x = start + by*real(i-1)
        write(3,*) x, rcs(i)
      end do

      close(57)
      close(3)
      write(6,*) ' ----- This file has been converted.'
      write(6,*) '       You may convert another file.'
      go to 100

 999  continue
      stop
      end
      
