Fortran Turn off writing to screen in Fortran 90

AI Thread Summary
A user inquires about a command to suppress all write(*,*) statements in a Fortran program to enhance performance during long runs. They seek a solution that avoids modifying each write statement with conditional checks. A suggestion is made to redirect standard output to /dev/null on Unix-based systems. The user then asks for a similar solution for Windows systems. The discussion highlights the need for efficient output management in lengthy computational tasks.
MichielM
Messages
22
Reaction score
0
Hi,
Is there a command available that makes the compiler ignore all write(*,*) statements?!
The thing is, I'm working on a code which will eventually run for several hours (perhaps days) to complete a single run. At the moment I'm testing so I write a lot of data to the screen in order to 'follow the program', but once I start do production runs the screen writing will probably take valuable time so then I want to turn it off.

Of course I can write if..then statements around each write(*,*) such that I can use a variable to switch writing on or off, but I was wondering if there might be a compiler command to suppress write(*,*) statements?!

Thanks in advance
 
Technology news on Phys.org
If you're using a Unix-based system, you can redirect standard output to /dev/null:

% myprogram > /dev/null
 
nice, thanks!

And if I use a windows system? (I have linux at home, but my university uses windows)
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Replies
8
Views
4K
Replies
16
Views
2K
Replies
2
Views
1K
Replies
11
Views
11K
Replies
8
Views
2K
Replies
6
Views
3K
Replies
8
Views
4K
Back
Top