Absoft fortran shows the correct answer - gfortran has a problems with writing and reading a large arrays (If I set the array size to 800, it works Ok.) -
[dranta:~/tests/gfortran-D] dir% f90 -o testio7 testio7.f [dranta:~/tests/gfortran-D] dir% testio7 1.00000000000000 -1.00000000000000 2.00000000000000 -2.00000000000000 3.00000000000000 -3.00000000000000 4.00000000000000 -4.00000000000000 5.00000000000000 -5.00000000000000 [dranta:~/tests/gfortran-D] dir% gfortran -o testio7 testio7.f [dranta:~/tests/gfortran-D] dir% testio7 1.00000000000000 -1.00000000000000 1.00000000000000 -1.00000000000000 1.00000000000000 -1.00000000000000 1.00000000000000 -1.00000000000000 1.00000000000000 -1.00000000000000 [dranta:~/tests/gfortran-D] dir% gfortran --v Using built-in specs. Target: powerpc-apple-darwin8.5.0 Configured with: ../gcc/configure --prefix=/Users/dir/gfortran --enable-languages=c,f95 Thread model: posix gcc version 4.2.0 20060222 (experimental) [dranta:~/tests/gfortran-D] dir% cat testio7.f program test implicit real*8 (a-h,o-z) dimension a(8476) istoh=8476 do 10 j=1,5 a(1)=j a(istoh)=-j write(2)a 10 continue rewind 2 do 20 i=1,5 read(2)a write(6,*)a(1),a(istoh) 20 continue stop end -- Summary: Error on binary I/O for large array Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libfortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dir at lanl dot gov GCC host triplet: powerpc-apple-darwin8.5.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26423