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 have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

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