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

Gfortran printing on cygwin?

  1. May 8, 2009 #1


    User Avatar

    I use gfortran on cygwin and i want to print in the command window (like it prints in windows)
    i use the usual stuff:

    WRITE(6,*) 'Give a number:'


    PRINT(6,*) 'Give a number:'

    but the execution completes without any printing..

    What is wrong?
  2. jcsd
  3. May 8, 2009 #2
    Does the 'black window' stays on the screen without printing anything, or does it disappears without giving you time to read what's on it?

    In the former case, we will need more information.

    In the latter case, it is probably because the window shuts down at the end of the execution unless you put a command to halt the closing, such as requesting user to enter a key to continue.
  4. May 10, 2009 #3


    User Avatar

    When i use the command

    ./ a.exe it prints int the command window

    but when i use

    run a.exe it does not print

    I wonder whats the difference between those commands?
  5. May 10, 2009 #4
    I do not have a Linux system to verify the explanation, but I believe the run command opens a new shell so printing is displayed in a different process distinct from where you entered your command "run...". On the other hand, a.exe is executed in the command screen, so you get to see the output.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - Gfortran printing cygwin Date
C/++/# Why can I print C-Strings without a Loop? Apr 11, 2017
Fortran Teaching myself gfortran Mar 31, 2017
[Fortran] Filon's method Fourier Transform Jun 29, 2015
Fortran 90 - gfortran error - help! Mar 10, 2014