This is just a very basic script to run a Hello world! program by the language Fortran in Ubuntu.
print *, "Hello world!"
end program hello
Save the text file as fortran extention, here I save it as hello.f90
To compile in, open terminal and navigate to that folder, run this:
gfortran -o hello hello.f90
Explain: This code define the compiler gcc-fortran, output file has name “hello” and the script file is “hello.f90”.
When the compilation is finished, in that folder we will see the hello program, in terminal, to run it, just input
And you will see the line “Hello world!” in the terminal window.
Have fun programming!