Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

ifort read unformatted file?

laychao
Beginner
1,082 Views
I have a unformatted data which is write by gfortran (4.1.2). How can read the data using ifort compiler? which option should I use?
0 Kudos
4 Replies
Steven_L_Intel1
Employee
1,082 Views
On what kind of system was this written? If it is a "little-endian" (x86 or x64) system, then you should not need anything special. If it is a "big-endian" system (SPARC, POWER, etc.), then use -convert big_endian
0 Kudos
laychao
Beginner
1,082 Views
On what kind of system was this written? If it is a "little-endian" (x86 or x64) system, then you should not need anything special. If it is a "big-endian" system (SPARC, POWER, etc.), then use -convert big_endian

Thank you very much for the reply! I am very sorry for the vague description for the problem.

The data was written with the gfortran option "-frecord-marker= 8"(by default). I don't know how to make the option with ifort to recognize the data (record marker length is 8).
0 Kudos
Steven_L_Intel1
Employee
1,082 Views
There is no option in Intel Fortran to support that mode. gfortran added that only to provide compatibility with g77 which always used 8-byte record lengths on a 64-bit platform. gfortran, some years ago, switched to the system Intel uses with 4-byte lengths for shorter records, expanding to 8-byte only when necessary.
0 Kudos
laychao
Beginner
1,082 Views
Thank you very much for the reply! I have learned much from that.
0 Kudos
Reply