C LOG DATA Integer*4 function logdata(buf,nbytes,filspc,ifil) integer*4 rabptr,rabsts,sys$flush,for$rab c really want to treat buf as an array of bytes, but round c here to allow more efficient I/O Integer*4 buf(1) INTEGER*4 nbytes,ifil character*255 filspc integer*4 init save init data init/0/ C log the data buffered in buf, for nbytes bytes, to a file C whose specification is in filspc if ifil .ne. 0 if(init.ne.0)goto 1 init=1 if(ifil.eq.0)goto 2 c open(unit=1,file=filspc,status='unknown',access='sequential', c 1 recl=250,form='unformatted') goto 3 2 continue c open(unit=1,file='FVlog.jrn',status='unknown',access='sequential', c 1 recl=250,form='unformatted') 3 continue 1 continue if(nbytes.lt.0)goto 100 c dummy version, ignores errors in writing. c also does NO writes. C Write 1000 bytes/record, just padding end with whatever's there. C This adds some extra junk at the end nblks=(nbytes+999)/1000 ilo=1 ihi=251 do 10 i=1,nblks c write(1,err=1000)(buf(i),i=ilo,ihi) ilo=ilo+250 ihi=ihi+250 10 continue c flush to disk c rabptr=for$rab(1) c rabsts=sys$flush(%val(rabptr)) goto 1000 100 continue c close call c close(unit=1) 1000 continue logdata=1 return end