subroutine open_maf1 (ieof) c c----------------------------------------------------------------------- c----------------------------------------------------------------------- c byte file(132) integer*4 ieof c c----------------------------------------------------------------------- c get the name of the maf1 file c----------------------------------------------------------------------- c write (*, 25) 25 format ($,' Enter MAF1 file name: ') read (*, 50, end=150) n, (file(i), i=1,n) 50 format (q, 132a1) if ((n .gt. 0) .and. (n .lt. 132)) then file(n+1) = 0 open (unit=1, type='old', name=file(1), form='unformatted', * readonly, err=150) ieof = 0 return else ieof = 1 write (*, 75) file(1) 75 format ('ERROR: inputting file name') call exit(0) end if c c----------------------------------------------------------------------- c error opening the maf1 file c----------------------------------------------------------------------- c 100 continue ieof = 1 write (*, 125) file(1) 125 format ('ERROR: cannot open ', a) 150 call exit(0) c c----------------------------------------------------------------------- c----------------------------------------------------------------------- c return end subroutine read_maf1 (buf, lbuf, read_err) c c----------------------------------------------------------------------- c----------------------------------------------------------------------- c integer*2 buf(lbuf) integer*4 lbuf, read_err c c----------------------------------------------------------------------- c initialize read flag c----------------------------------------------------------------------- c read_err = -1 c c----------------------------------------------------------------------- c read a data record c----------------------------------------------------------------------- c read (1, end=25) ibuf read_err = 0 return c c----------------------------------------------------------------------- c EOF encountered c----------------------------------------------------------------------- c 25 read_err = -10 return c c----------------------------------------------------------------------- c----------------------------------------------------------------------- c end subroutine close_maf1 c c----------------------------------------------------------------------- c----------------------------------------------------------------------- c close (unit=1) return end