Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Turn off writing to screen in Fortran 90

  1. Jun 7, 2010 #1
    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
  2. jcsd
  3. Jun 7, 2010 #2


    User Avatar

    Staff: Mentor

    If you're using a Unix-based system, you can redirect standard output to /dev/null:

    % myprogram > /dev/null
  4. Jun 7, 2010 #3
    nice, thanks!

    And if I use a windows system? (I have linux at home, but my university uses windows)
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook