program MAKE_DATA_FILES implicit NONE character*80 infile character*80 outfile character*80 line integer first, last, frame integer ios, inlun, outlun double precision x, y, dx, dy, deriv c begin inlun = 20 outlun = 30 write (*, *) 'enter input file name' read (*, fmt='(a80)') infile open (unit=inlun, file = infile, & form = 'formatted', status = 'old') write (*, *) 'enter first frame' read (*, *) first write (*, *) 'enter last frame' read (*, *) last write (*, *) 'enter output file name' read (*, fmt='(a80)') outfile open (unit=outlun, file = outfile, & form = 'formatted', status = 'unknown') ios = 0 frame = 0 do while ( ios .eq. 0 ) read (inlun, fmt = '(a80)', iostat = ios) line if (ios .eq. 0 .and. .not. (line(1:1) .eq. '!') ) then if ( line(1:7) .eq. '# frame' ) then read(line(9:12), fmt='(i4)') frame else read (line, *) x, y, dx, dy, deriv endif if ( frame .ge. first .and. frame .le. last ) then write (outlun, fmt='(a80)') line endif endif end do close (inlun) close (outlun) stop END