ATOM & FORTRAN command read in WINDOWS enviroment

I have installed a Fortran Package to ATOM Editor and I´m having trouble with the READ command, because apperantly ATOM doesn´t open an interactive terminal to enter a data for READ command!

A HelloWorld program works properly!

PROGRAM HELLOWORLD
PRINT *, ‘Hello, world!’
END
! Works fine

A ReadName program doesn´t work!

PROGRAM READNAME
PRINT *, 'Enter your name: ’
READ *, NAME
PRINT *, 'Your name is: ', NAME
END
! The program print: "Enter your name: " in a field at the bottom of ATOM Editor, but I can´t type anything the program accept!

An equivalent program written in C works properly:
#include <stdio.h>
int main() {
char str[100];
printf ("Enter your name: ");
gets (str);

printf (\n Your name is: ");
puts (str);

return 0;
} /* Open a Windows Terminal, and works fine! */

I don’t use Fortran but I suspect that you have the same problem encountered by others using Python. You cannot input data.

Dear d_I, thank you!
Although I didn´t tried a Python script, I belive that you are correct!
Opening a window in:
View → Terminal → New Terminal Window (Local) an untitled pane opens and show the command line used to compile a fortran program (after chosing CTRL-SHIFT-B):
[Command: cmd ‘/c gfortran C:\Users\Paulo\OneDrive\Documentos\FORTAN-STUDIES\hello.f90 -ffree-form -o /tmp/f90.out && /tmp/f90.out’]

and when I go to the /tmp directory, the f90.out program runs properly!

But, do anyone knows how can I redefine these compiler options? I would like to change the default name f90.out to a programname.out to the executable and already change the default /tmp file to the Project directory for the compiled programs!

Thank you!

Hi, guys!
In a trick way, I found the file that needs to be edited to create the exec file in the working directory!
In windows, we have to edit the file:
%USERPROFILE%.atom\packages\script\lib\grammars\fortran.coffee
and change the line:
cmd = “gfortran ‘#{filepath}’ -ffree-form -o /tmp/f90.out && /tmp/f90.out”
TO:
cmd = “gfortran ‘#{filepath}’ -ffree-form -o ‘#{filepath}’.out && ‘#{filepath}’.out”

In this way a program hello.f90 will be compiled and a executable file will be generated as hello.f90.out
in the work directory!

There should be an easy way to do that, but in this way we can live with the compiler!

Best regards for all!

pbelle!

Package process-palette allows such variables to be set as arguments in command line setting.

Read Preferences > Packages > process-palette > Settings > Variables.

image

Thank you d_I, but process package is a little complex, and I can´t configure it properly!
But the solution to run it in a cmd window is working for me now!!!
Best regards!
pbelle