Turn off writing to screen in Fortran 90

Click For Summary
SUMMARY

To suppress all write(*,*) statements in Fortran 90, users can redirect standard output to /dev/null on Unix-based systems. For Windows systems, the equivalent command is to redirect output to NUL. This method allows users to run long processes without the overhead of screen writing, which can significantly improve performance during production runs. Implementing this solution eliminates the need for conditional statements around each write(*,*) command.

PREREQUISITES
  • Familiarity with Fortran 90 programming language
  • Understanding of standard output redirection in Unix-based systems
  • Knowledge of command-line operations in Windows
  • Basic concepts of performance optimization in long-running applications
NEXT STEPS
  • Research output redirection techniques in Unix and Windows environments
  • Explore performance optimization strategies for Fortran 90 applications
  • Learn about compiler flags and options for Fortran 90
  • Investigate debugging techniques for long-running Fortran programs
USEFUL FOR

This discussion is beneficial for Fortran developers, performance engineers, and anyone involved in optimizing long-running computational tasks in Fortran 90.

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)
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 37 ·
2
Replies
37
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
12K
  • · Replies 2 ·
Replies
2
Views
8K
Replies
14
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 8 ·
Replies
8
Views
4K