I understand gfortran can compile f90 or f95? How does it know which one it is compiling? Also can it compile f77 code? Does ubuntu already have a fortran compiler or do I n
Yes, gfortran can compile FORTRAN 77 and Fortran 90,95 etc. It has many features of 2003 & 2008 implemented. For Fortran 90/95/2003/2008 code a good extension to use is .f90. Some other compilers don't recognize .f95, .f2003, etc. And do you really want to rename your files when a new standard comes out? Use .f or .for for FORTRAN 77. The main difference is the source layout that the compiler will expect: free form for .f90, fixed form for .f or .for. (Upper-case filetypes will cause the preprocessor to be run.) You can force fixed-form layout with the options -ffixed-form -ffixed-line-length-none.