- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have an application that creates rather large files (up to 4 GB so far)that consist of rather large fixed length records (a real*8 array of size as large as 160 MB so far). I found that using direct access (unformatted) type files instead of sequential access files (unformatted), gave significant reduction in run times (wall clock). However, when using the directaccess type, it appears that I am limited by a maximum file size of about 2 GB. I get the following error:
forrtl: An attempt was made to move the file pointer before the beginning of the
file.
forrtl: severe (38): error during write, unit 1, file C:...direct.raf
file.
forrtl: severe (38): error during write, unit 1, file C:...direct.raf
I have tried changing the record length and found that the total file size seems to be the issue rather than the number of records or record length.
I am using DVF5. Is there really a 2GB limit on direct access files or am I up against another issue? Does the same limit exist in later releases of the compiler?
The following gives the above error message after printing rec1 = 270.
program direct
implicit none
integer, parameter :: lblok = 1000000
integer rlength,rec1,i
real*8 A(lblok)
rlength=2*lblok
A=1.3e3
open(1,status='unknown',file='direct.raf',access='direct'
& ,form='unformatted',action='readwrite',recl=rlength)
rec1=1
do i=1,300
print*,'rec1=',rec1
write (1,rec=rec1) A
rec1=rec1+1
end do
end
implicit none
integer, parameter :: lblok = 1000000
integer rlength,rec1,i
real*8 A(lblok)
rlength=2*lblok
A=1.3e3
open(1,status='unknown',file='direct.raf',access='direct'
& ,form='unformatted',action='readwrite',recl=rlength)
rec1=1
do i=1,300
print*,'rec1=',rec1
write (1,rec=rec1) A
rec1=rec1+1
end do
end
Randy
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This limit was effectively eliminated in a later version - 6.5, maybe. The current product is Intel Visual Fortran 8.0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
Thanks for the quick answer. I guess I finally have a good reason to update my compiler.;-)
Are you saying there are no compiler related limits on the direct access file size (or on the number of records)?
Randy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I recall correctly, the current version allows the record length to be 64 bits and the file size to be 64 bits. You'll havea hard time exceeding those.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Those limits do seem more than adequate for the forseeable future!
I found the error message and 2 GB file size limit went away when I applied
the 5.0D update. I thought I had already done that when I reinstalled on my new machine, but apparently had not.
Randy

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page