acccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c      program pwinnow

c     Selects every nth data record and writes to a new winnowed file...

      character id*8
      real post(8)

      call getfile2(21,' Infile ','in','unformatted','.pos')
      call getfile2(22,' Outfile ','out','unformatted','.win')

      call getint (' To select every nth observation...give n ',2,n)

      nout=0

c     Read n observations.
 10   do 20 i=1,n
 20   call getpost (21, id, post, *90)

c     Output the nth.
      nout=nout+1
      call putpost (22, id, post)

c     Go read n more observations.
      go to 10

 90   close (21)
      call closeblp (22)

      print *, ' '
      print *, ' NUMBER OF RECORDS OUTPUT =', nout

      stop ' '
      end


all closeblp (22)

      print *, ' '
      print *, ' NUMBER OF RECORDS OUTPUT ='
