Need help with large file reading and writing.




Hello Pals:

When I use fortran 90 code to read larger files,about 1G each, and write the data to other opened files with 32-bit Intel-compiler. Each time, I just opened 3 files simultaneously and closed unused ones. The code always stops at the point of 10 files reading. I am not sure it is the compiler problem about the limitation of buffer memory.

Thanks very much

Liscon


Simple code:

open(unit=18,file="aux.out")
do i=1,10
open(unit=101+i,file="fort.1+i") !old file; unit and file name just for simplicity

open(unit=1001+i,file="fort.101+i") !New file

do j=1,EN ! number of lines wrote to the new file
read(101+i,format)n1,n2,n3,n4,n5,n6,n7
write(1001+i,format)n1,n2,n3,n4,n5,n6,n7
end o

do j=EN+1,N ! number of lines left,N=total lines of old file
read(101+i,format)n1,n2,n3,n4,n5,n6,n7
write(1001+i,format)n1,n2,n3,n4,n5,n6,n7
end do

close(101+i)
close(1001+i)

end do

.