- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Greetings,
I was wondering if anyone can help me with the following problem. I'm trying to write out a large array to disk using a single write statement but the call seems to blow out the stack. This did work in 6.0.B3 but seems to break since we upgraded to 6.5A. It seems that the write statement attempts to make a copy of the data on the stack before writing it. Does anyone know of a way around this? Sample code follows.
PROGRAM ftest2
IMPLICIT NONE
INTEGER(4), POINTER :: p (:)
INTEGER(4) :: ierr
INTEGER(4) :: size = (1024 * 1024 * 10) / 4
ALLOCATE( p ( 1 : size ) )
OPEN ( 69, FILE = 'test.bin', IOSTAT = ierr, status = 'REPLACE', FORM = 'BINARY' )
WRITE ( 69, '(B)', IOSTAT = ierr) p
CLOSE ( 69 )
END PROGRAM ftest2
I was wondering if anyone can help me with the following problem. I'm trying to write out a large array to disk using a single write statement but the call seems to blow out the stack. This did work in 6.0.B3 but seems to break since we upgraded to 6.5A. It seems that the write statement attempts to make a copy of the data on the stack before writing it. Does anyone know of a way around this? Sample code follows.
PROGRAM ftest2
IMPLICIT NONE
INTEGER(4), POINTER :: p (:)
INTEGER(4) :: ierr
INTEGER(4) :: size = (1024 * 1024 * 10) / 4
ALLOCATE( p ( 1 : size ) )
OPEN ( 69, FILE = 'test.bin', IOSTAT = ierr, status = 'REPLACE', FORM = 'BINARY' )
WRITE ( 69, '(B)', IOSTAT = ierr) p
CLOSE ( 69 )
END PROGRAM ftest2
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try the following:
WRITE ( 69, '(B)', IOSTAT = ierr) (p(I),I=1,SIZE)
WRITE ( 69, '(B)', IOSTAT = ierr) (p(I),I=1,SIZE)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, the program I gave is a little too simple. Actually, p is a structure with alot of different elements but totals in size close to 10 MB. How would I write out a structure that is 10 MB in size?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm confused - you open the file as FORM='BINARY' and then use a formatted write statement? (And do you really mean (B) as the format?)
Please send an example of your actual code to us at vf-support@compaq.com and we'll take a look. It doesn't help to look at something that's not representative of your problem.
Steve
Please send an example of your actual code to us at vf-support@compaq.com and we'll take a look. It doesn't help to look at something that's not representative of your problem.
Steve

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