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

FOR_PRINT and Unit=6 can't be merged?

longden_loo
Beginner
514 Views
I tried using the FOR_PRINT environment variable to capture Fortran output to a file, and this works OK for all the PRINT/WRITE statements directed to Unit "*" ... but I also wanted all the normal console output (normally WRITE's to unit 6) to go to the same file.

So I coded an OPEN statement that directed Unit=6 to the same file listed in FOR_PRINT (ACCESS='APPEND', STATUS='UNKNOWN', SHARED), and this seems to work for all the Unit=6 writes, but now when I hit a "print *" statement I get an open failure on the file (presumably because of the prior OPEN on unit=6).

Is there any way to get both unit=6 and unit=* writes to go to the same file? Thx.
0 Kudos
3 Replies
Steven_L_Intel1
Employee
514 Views
There is an undocumented switch to enable this: /switch:fe_defunit_56 Add this under "Additional Options" in the command line property page. In a future version, this will be the default.
0 Kudos
longden_loo
Beginner
514 Views
That's good to know, thx.

My solution has several Fortran projects (and C) ... does this option get added to the "Additonal Options" for each Fortran project (ie versus just the one for the final link)?

It sounds more compiler-related than linker-related.
0 Kudos
Steven_L_Intel1
Employee
514 Views
It's a compiler option and must be specified for each Fortran project.
0 Kudos
Reply