$ ifort --version
ifort (IFORT) 13.0.1 20121010
Copyright (C) 1985-2012 Intel Corporation. All rights reserved.
$ cat intel-bug-20121024.f90
!!
!! INCORRECT ANALYSIS OF OPEN STATEMENT
!!
program main
open(newunit=n,status='replace',file='foo')
end program
$ ifort intel-bug-20121024.f90
intel-bug-20121024.f90(21): error #8414: If NEWUNIT appears in OPEN statement either FILE or STATUS (with value SCRATCH) specifiers must appear. [STATUS]
open(newunit=n,status='replace',file='foo')
---------------^
compilation aborted for intel-bug-20121024.f90 (code 1)
Note that if the order of the key/value pairs is changed, the code will correctly compile, i.e. this works:
open(newunit=n,file='foo',status='replace')
-david
連結已複製
I'm using ifort v14.0.0 and still seeing a similar error:
OPEN (UNIT = newunit(lfile), STATUS = "OLD", FORM = "formatted", FILE = "file.txt")
returns the error
error #8414: If NEWUNIT appears in OPEN statement either FILE or STATUS (with value SCRATCH) specifiers must appear. [STATUS]
I can get around this by using an INQUIRE, but I believe this code should compile fine.
