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

pipe screen output to file

Maughan__Justin
Beginner
897 Views

i am fairly new to fortran and am using an existing code it opens a file using

 OPEN (6,FILE='outdata')

it is my understand that 6 is reserved for printing to screen and so this works to direct anything printed to screen to the outdata file and it works when i use gfortran for example 

but when i use ifort it does not is there any simple way for me to fix this with out going through the entire code and changing every print statement (there are many of them)

0 Kudos
2 Replies
TimP
Honored Contributor III
897 Views

No, this open discards preconnection to screen.,  then it goes directly to the file.

0 Kudos
Steven_L_Intel1
Employee
897 Views

Unit 6 is not "reserved", but it is "preconnected". The difference is probably if you also use PRINT or WRITE to unit * - by default these don't use unit 6. The easy solution is to compile with the switch -standard-semantics . This implies -assume noold_unit_star and will get the behavior you want.

0 Kudos
Reply