- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's a compiler option and must be specified for each Fortran project.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page