cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c     p2xyz
c     Converts binary post format to xyz format.

      character*4 id(2)
      character*80 ifile,ofile
      real post(8),xyz(3)

      print*,'*Give input 6-channel post file:'
      read 800, ifile
800   format(a80)
      open(10, file=ifile, form='unformatted', status='old')
      print*,'*Give output xyz file name: '
      read 800, ofile
      open(11, file=ofile, form='unformatted', status='new')

      write(*, 801)
801   format(/' Which post option goes to z? [1 to 6]:  '$)
      read *,ipick
      ipick=ipick+2

 30   read(10,end=90) id,post
      xyz(1)=post(1)
      xyz(2)=post(2)
      xyz(3)=post(ipick)
      write(11) xyz
      go to 30

 90   close(10)
      close(11)
      return
      end



