Hi all, I was wondering if someone could help me solve the issue I have with I/O when I mix f77 and f90 codes on ifort. So I have a package of f77 codes and the skeleton of the code, regarding the line at which I get the error, is like this: PROGRAM F77PRG IINPUT = 25 OPEN (IINPUT, FORM='UNFORMATTED', STATUS='UNKNOWN', FILE='input.bin') CALL FOO(IINPUT) END SUBROUTINE FOO (IINPUT) READ (IINPUT, ERR=100) INTGR END This code runs perfectly fine and the program reads the binary data from the file. Now, I want to combine this f77 program with a module written in f90, so I added the 'use' line to the top of the f77 program as: PROGRAM F77PRG use f90module ! only this line is modified IINPUT = 25 OPEN (IINPUT, FORM='UNFORMATTED', STATUS='UNKNOWN', FILE='input.bin') CALL FOO(IINPUT) END SUBROUTINE FOO (IINPUT) READ (IINPUT, ERR=100) INTGR END With this 'use' line (but not using any of the subroutines in the module), I get an error on the READ line, saying "forrtl: severe (256): unformatted I/O to unit open for formatted transfers, unit 25, file /mydirectory/input.bin." Compiling is done as follows without error: ifort -c f90module.f90 ifort -c main.f ifort -o mycode.exe f90module.o main.o Does anybody have an idea why this happens and how to get away with it? Thanks.
For more complete information about compiler optimizations, see our Optimization Notice.