hello everybody,
i am trying to compile some fortran code using gfortran but i have unfortunately run into some issues.
using:
Code:
program test
write(*,*)'Hello world!'
end program test
i can compile and run the code if i end it with a .f90:
gfortran -o test.exe test.f90
./test.exe
the output i get is:
however, when i try to end the file using .f:
gfortran -o test.exe test.f
the output i get is:
Code:
test.f:1.1:
program test
1
Error: Non-numeric character in statement label at (1)
test.f:1.1:
program test
1
Error: Unclassifiable statement at (1)
test.f:2.1:
write(*,*)'Hello world!'
1
Error: Non-numeric character in statement label at (1)
test.f:2.1:
write(*,*)'Hello world!'
1
Error: Unclassifiable statement at (1)
test.f:3.1:
end program test
1
Error: Non-numeric character in statement label at (1)
test.f:3.1:
end program test
1
Error: Unclassifiable statement at (1)
i get the aforementioned error message and gfortran will not compile the .f file. for some reason .f90 works but .f doesn't. i need both types to work (and do not see why it shouldn't as i have had this work on windows before but not on ubuntu).
can anybody help me please?
thank you.
Bookmarks