Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Wired binary files reading

sabergemini
Beginner
592 Views

When I want to develop a code  with intel fortran (version 11.1) to process the binary output of  an executable file, which is compliled in gfortran (ver 4.1.2), the procedure of file opening and reading have been proven no erros. However, the dara read is just zero. But when I change the compiler to gfortran, the data reading is correct when comparing with the original ASCII output.

The file processing specifer I used as listed as follows:

      OPEN(UNIT=IOBIN, FILE=FILNAM, ERR=100, STATUS='UNKNOWN', ACCESS='SEQUENTIAL', FORM='UNFORMATTED',CONVERT='LITTLE_ENDIAN',IOSTAT=IOS)
      READ(UNIT=IOBIN,ERR=200,IOSTAT=IOS)  LENGTH,(WORK(I),I=1,LENGTH)
      CLOSE(UNIT=IOBIN, ERR=300, STATUS='KEEP',IOSTAT=IOS)

Compiling options are : -assume byterecl

For my question, is there other complie option or file processing specifiers should be added.Thanks for any suggestions.

0 Kudos
2 Replies
TimP
Honored Contributor III
592 Views
gnu fortran used to have a specific incompatibility in sequential record length specification between -m32 and -m64 mode. I don't remember in which version gfortran adopted compatibility with ifort (gfortran 4.1 is obsolete). You could try specifying RECL in case there is a problem associated with differing defaults.
0 Kudos
Steven_L_Intel1
Employee
592 Views
It was several years ago, at least, when gfortran changed to use a method compatible with Intel Fortran.
0 Kudos
Reply