cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c      program pos2agraf
c     Converts binary post file to ascii with a marginal graph for scanning.

      character id*8, graf*1
        dimension graf(36)
      real post(8)
c
      call getfile2(10,' Infile ','in','unformatted','.pos')
      call getfile2(11,' Outfile ','out','formatted','.grf')

      print '(/,a,$)', ' Post option to graf (1 to 6): '
      read *, nopt
      nopt=nopt+2
      zmax=-1.0E38
      zmin=1.0E38

 10   call getpost (10, id, post, *30)
      zmax=amax1(zmax,post(nopt))
      zmin=amin1(zmin,post(nopt))
      go to 10
 30   if(zmax.eq.zmin) zmax=zmax+1.
      rewind 10

      npts=36
      do 40 i=1,npts
 40   graf(i)=' '

 50   call getpost (10, id, post, *90)
      index=ifix((npts-1)*(post(nopt)-zmin)/(zmax-zmin)) + 1
      graf(index)='+'
      write(11,101) id,post,graf
 101  format(a8,f10.4,f9.4,f8.2,f9.2,3f8.2,f11.3,' I',36a1,'I')
      graf(index)=' '
      go to 50

 90   close(10)
      close(11)

      stop ' '
      end



