Why is Gfortran not printing on Cygwin?

  • Context: Fortran 
  • Thread starter Thread starter kth
  • Start date Start date
  • Tags Tags
    Gfortran Printing
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 3K views
kth
Messages
3
Reaction score
0
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:'

or

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

but the execution completes without any printing..

What is wrong?
 
Physics news on Phys.org
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.
 
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 what's the difference between those commands?
 
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.