- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I am trying to run a program compiled using intel fortran 17.0.5 20170817 compiler on opensuse 12 having ~512 GB ram. The code -
user@machine1:~/STORE/TESTING/ssmis> cat test.f program main irecl= 538109432 c irecl= 2147483647 open(3,file='obstore.data',form='unformatted', & access='direct',recl=irecl) end
here is what i get when i compile & run this code -
user@machine1:~/OBSTORE/TESTING/ssmis> ifort test.f user@machine1:~/OBSTORE/TESTING/ssmis> ./a.out forrtl: severe (118): The 'RECL=' value in an OPEN statement for unit 3, file /home/user/STORE/TESTING/ssmis/obstore.data, exceeds the maximum allowed for the file's record type. Image PC Routine Line Source a.out 000000000042AA63 Unknown Unknown Unknown a.out 0000000000408CBE Unknown Unknown Unknown a.out 00000000004029FE Unknown Unknown Unknown a.out 000000000040294E Unknown Unknown Unknown libc-2.22.so 00002B501C0D66E5 __libc_start_main Unknown Unknown a.out 0000000000402869 Unknown Unknown Unknown user@machine1:~/STORE/TESTING/ssmis>
In function,
open(3,file='obstore.data',form='unformatted', access='direct',recl=irecl)
form = formatted, then code works fine.
- What is the "maximum/permissible/allowed" value of irecl for unformatted file.
- Is there a compiler flag through which i can get past the "record length" limitation on unformatted file?
I have already tried integer(kind=8) for irecl, but the error message was same.
Please let me know if more information is required from my end.
Eagerly awaiting your replies.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Omit the rec=1 and stream access does exactly what you want. If you need to always overwrite the file, do a REWIND on the unit first. The maximum record length is 2**31-1, as documented under OPEN > RECL.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try:
user@machine1:~/STORE/TESTING/ssmis> cat test.f program main integer(8) :: irecl c irecl= 538109432_8 irecl= 2147483647_8 open(3,file='obstore.data',form='unformatted', & access='direct',recl=irecl) end
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am going to guess that you really don't want direct access, but instead are trying to read data without record structure. Please use ACCESS='STREAM' for that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
user@machine1:~/STORE/TESTING/ssmis> rm a.out rm: remove regular file 'a.out'? y user@machine1:~/STORE/TESTING/ssmis> cat test2.f program main integer(8) :: irecl c irecl= 538109432_8 irecl= 2147483647_8 open(3,file='STORE.data',form='unformatted', & access='direct',recl=irecl) end user@machine1:~/STORE/TESTING/ssmis> ifort test2.f user@machine1:~/STORE/TESTING/ssmis> ./a.out forrtl: severe (118): The 'RECL=' value in an OPEN statement for unit 3, file /home/user/STORE/TESTING/ssmis/STORE.data, exceeds the maximum allowed for the file's record type. Image PC Routine Line Source a.out 000000000042AA63 Unknown Unknown Unknown a.out 0000000000408CBE Unknown Unknown Unknown a.out 00000000004029FE Unknown Unknown Unknown a.out 000000000040294E Unknown Unknown Unknown libc-2.22.so 00002B9A5E41C6E5 __libc_start_main Unknown Unknown a.out 0000000000402869 Unknown Unknown Unknown user@machine1:~/STORE/TESTING/ssmis>
user@machine1:~/STORE/TESTING/ssmis> cat test3.f program main irecl= 538109432 c irecl= 2147483647 open(3,file='STORE.data',form='unformatted', & access='stream',recl=irecl) end user@machine1:~/STORE/TESTING/ssmis> ifort test3.f user@machine1:~/STORE/TESTING/ssmis> ./a.out forrtl: severe (112): RECL= specifier may not be applied to stream access file, unit 3, file /home/user/STORE/TESTING/ssmis/STORE.data Image PC Routine Line Source a.out 000000000042AA63 Unknown Unknown Unknown a.out 0000000000408CBE Unknown Unknown Unknown a.out 00000000004029FE Unknown Unknown Unknown a.out 000000000040294E Unknown Unknown Unknown libc-2.22.so 00002ADBB9A7F6E5 __libc_start_main Unknown Unknown a.out 0000000000402869 Unknown Unknown Unknown user@machine1:~/STORE/TESTING/ssmis> vim test3.f user@machine1:~/STORE/TESTING/ssmis> cat test3.f program main integer(8) :: irecl irecl=538109432 c irecl= 538109432 c irecl= 2147483647 open(3,file='STORE.data',form='unformatted', & access='stream',recl=irecl) end user@machine1:~/STORE/TESTING/ssmis> ifort test3.f user@machine1:~/STORE/TESTING/ssmis> ./a.out forrtl: severe (112): RECL= specifier may not be applied to stream access file, unit 3, file /home/user/STORE/TESTING/ssmis/STORE.data Image PC Routine Line Source a.out 000000000042AA63 Unknown Unknown Unknown a.out 0000000000408CBE Unknown Unknown Unknown a.out 00000000004029FE Unknown Unknown Unknown a.out 000000000040294E Unknown Unknown Unknown libc-2.22.so 00002B5E6CFA76E5 __libc_start_main Unknown Unknown a.out 0000000000402869 Unknown Unknown Unknown user@machine1:~/STORE/TESTING/ssmis>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From the Fortran 2003 Standard:
9.4.5.12 RECL= specifier in the OPEN statement:... This specifier shall not appear when a file is being connected for stream access.
Just remove the RECL clause from the OPEN statement for the stream file. Note Dave Cutler's derisive "Get a byte, get a byte, get a byte byte byte" .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need to write data as -
write(3,rec=1)fixhdr,((LDC(i,j),j=1,kcol),i=1,nrow), &((RDC(i,j),j=1,kcol),i=1,nrow),((CDC(i,j),j=1,kcol),i=1,nrow), &((LUT(i,j),j=1,128),i=1,nrow),(data(i),i=1,ilength)
Is there no way of making the "direct" method work ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Omit the rec=1 and stream access does exactly what you want. If you need to always overwrite the file, do a REWIND on the unit first. The maximum record length is 2**31-1, as documented under OPEN > RECL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve, no runtime errors and i am able to write data.
Now, Need to verify the content of the output file.
:)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page