Intel Fortran v. 11 generates 3 nul characters between each letter

Intel Fortran v. 11 generates 3 nul characters between each letter

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:

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


end program main

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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.

Steve - Intel Developer Support

I am similar issue however the code don't use recl.
The code:

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.


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.

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today