Problems Reading an Array in Version 3.20

Product Version(s): 3.20
Operating System:   MS-DOS
Flags: ENDUSER | buglist3.20 fixlist3.30
Last Modified:  7-OCT-1988    ArticleIdent: Q10659

Problem:

Array reads that read the entire array do not function correctly if
the array crosses a 64K boundary in a particular way. In the program
below, support "array" is more than 64K in length, and "barray" is
equivalenced to array so that barray crosses the 64K boundary in
array. Reading barray with READ() (barray(i),i=1,dim) works properly,
but READ()barray fails.

The following is an example:

        integer*4 array(20000)
        integer*4 barray(2000)
        equivalence(array(16001),barray)
c
c
        write(*,*)' writing data'
        open(6,file='data',status='new',form='unformatted')
        write(6)(i,i=1,2000)
c
c
        write(*,*)' reading data'
        rewind(6)
        read(6)barray
c
        ierr=0
        do 10 i=1,2000
        if (barray(i).eq.i) goto 10
        write(*,*)i,barray(i)
        ierr=ierr+1
        if (ierr.eq.10) goto 11
   10   continue
   11   write(*,*)' done checking implicit read'
c
c
        write(*,*)' reading data'
        rewind(6)
        read(6)(barray(i),i=1,2000)
c
        ierr=0
        do 20 i=1,2000
        if (barray(i).eq.i) goto 20
        write(*,*)i,barray(i)
   20   continue
        write(*,*)' done checking explicit read'
        end

Response:

The reported behavior was due to an arithmetic overflow in the huge
array I/O routines.

Microsoft has confirmed this to be a problem in Version 3.20. This
problem was corrected in Version 3.30.