C---------------------------------------------------------------------- subroutine ftread(iunit,nrec,length,pbuff,status) C lowest-level routine to read a disk file record into a physical buffer C iunit i Fortran unit number to read from C nrec i number of the file record to read C length i number of bytes to read C pbuff i number of the physical buffer to read into C status i output error status integer iunit,nrec,length,pbuff,status C COMMON BLOCK DEFINITIONS:-------------------------------------------- integer nb,ne parameter (nb = 20) parameter (ne = 512) integer bufnum,chdu,hdutyp,maxhdu,hdstrt,hdend,nxthdr,dtstrt integer nxtfld logical wrmode common/ft0001/bufnum(199),chdu(nb),hdutyp(nb),maxhdu(nb), & wrmode(nb),hdstrt(nb,ne),hdend(nb),nxthdr(nb),dtstrt(nb),nxtfld integer buflun,currnt,reclen,bytnum,maxrec common/ftlbuf/buflun(nb),currnt(nb),reclen(nb), & bytnum(nb),maxrec(nb) C have to use separate character arrays because of compiler limitations character*2880 b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14, & b15,b16,b17,b18,b19,b20 common /ftbuff/b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14, & b15,b16,b17,b18,b19,b20 C END OF COMMON BLOCK DEFINITIONS----------------------------------- integer ibuff,ios C test if desired record exists before trying to read it ibuff=bufnum(iunit) if (nrec .gt. maxrec(ibuff)) then C record doesn't exist, so return EOF error status=107 return end if go to (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18, & 19,20)pbuff C if got here, then pbuff is out of range status=101 return 1 read(iunit,rec=nrec,iostat=ios)b1(1:length) go to 100 2 read(iunit,rec=nrec,iostat=ios)b2(1:length) go to 100 3 read(iunit,rec=nrec,iostat=ios)b3(1:length) go to 100 4 read(iunit,rec=nrec,iostat=ios)b4(1:length) go to 100 5 read(iunit,rec=nrec,iostat=ios)b5(1:length) go to 100 6 read(iunit,rec=nrec,iostat=ios)b6(1:length) go to 100 7 read(iunit,rec=nrec,iostat=ios)b7(1:length) go to 100 8 read(iunit,rec=nrec,iostat=ios)b8(1:length) go to 100 9 read(iunit,rec=nrec,iostat=ios)b9(1:length) go to 100 10 read(iunit,rec=nrec,iostat=ios)b10(1:length) go to 100 11 read(iunit,rec=nrec,iostat=ios)b11(1:length) go to 100 12 read(iunit,rec=nrec,iostat=ios)b12(1:length) go to 100 13 read(iunit,rec=nrec,iostat=ios)b13(1:length) go to 100 14 read(iunit,rec=nrec,iostat=ios)b14(1:length) go to 100 15 read(iunit,rec=nrec,iostat=ios)b15(1:length) go to 100 16 read(iunit,rec=nrec,iostat=ios)b16(1:length) go to 100 17 read(iunit,rec=nrec,iostat=ios)b17(1:length) go to 100 18 read(iunit,rec=nrec,iostat=ios)b18(1:length) go to 100 19 read(iunit,rec=nrec,iostat=ios)b19(1:length) go to 100 20 read(iunit,rec=nrec,iostat=ios)b20(1:length) 100 continue if (ios .ne. 0)then C assume that this error indicates an end of file condition status=107 end if end