- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, this open discards preconnection to screen., then it goes directly to the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page