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

Intel v12 and v13 error out on conforming OPEN statement using NEWUNIT

dogunter
Beginner
560 Views

$ 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

0 Kudos
4 Replies
Steven_L_Intel1
Employee
560 Views
Thanks - this has been escalated as issue DPD200238261.
0 Kudos
Steven_L_Intel1
Employee
560 Views

This has been fixed for a future release.

0 Kudos
Niemeyer__Kyle
Beginner
560 Views

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.

0 Kudos
Steven_L_Intel1
Employee
560 Views

The fix is in for the next major release after 14.0, due later this year. My post about a future release was made after 14.0.
 

0 Kudos
Reply