- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think there is a bug with the IFort v.11. I wrote a simple code to translate a binary file to an ascii file but it generates 3 nul characters between each letter.
But whenI compile the code with gfortran, it works.
Here is the code:
But whenI compile the code with gfortran, it works.
Here is the code:
program main
implicit none
Character :: Text =""
Open ( Unit = 99 , &
File = "sp.txt" , &
Access = "Direct" , &
Action = "WRITE" , &
Form = "Unformatted" , &
RecL = 1 , &
Status = "REPLACE" )
Write(Unit = 99, Rec=1) "A"
Write(Unit = 99, Rec=2) "B"
Text = "W"
Write(Unit = 99, Rec=3) TEXT
Text = "X"
Write(Unit = 99, Rec=4) TEXT
close(99)
end program main
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RECL=1 has a different meaning in Intel Fortran than in gfortran - by default, unformatted RECL is in units of "numeric storage units" or 4 bytes. Add:
-assume byterecl
and you'll get what you want.
-assume byterecl
and you'll get what you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am similar issue however the code don't use recl.
The code:
IRECLTH = 1
I make it with:
makefile:FFLAGS = -O3 -g -r8 -i8 -openmp -assume byterecl -convert big_endian
Binary file thinmxmn matches
However the the SP sometime replaced as nul and lf become nl.
What should I do to fix it?
Thank you very much.
Kenny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I assume your code has more than that one assignment statement. Can you show a small but complete program that demonstrates the problem? if you can attach a .tar of the binary file, that would help too.

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