# How do Fotran77 and Fortran90/95 differ in performance via present-day compilers with array manipulation?

I would like to write the most optimized program for array manipulation in Fortran (e.g. matrix multiplication of large matrices, squaring large matrices, etc.)

So, using the fortran compilers on the market today (e.g. gfortran), how does F77 measure up against F90/95 (or F03)? Is there a particular compiler I should use to optimize speed with a certain version of Fortran?

Furthermore, is there a difference in how I code these Fortran programs to optimize speed that is based distinctly in the version of Fortran used? Or is this simply changing the extension name (e.g. .f90 to .f70) and the program will run faster?

• Simpler languages are easier to optimize. Fortran 77 is the simplest Fortran. However, your Fortran compiler will not care about the suffix, but only the syntax. – Jeff Jun 14 '15 at 2:59
• @Jeff So, if I write Fortran with F77 syntax, gfortran will compile it at a higher performance than F90/F95? – ShanZhengYang Jun 14 '15 at 3:13
• That's not what I said. If you specify what you want to do precisely, I'll be able to make a proper evaluation. – Jeff Jun 14 '15 at 3:29
• Use MATMUL to multiply to matrices. My question boils down to whether there's an inherent difference in performance between the two languages. I realize that with F03, your average user could create a good deal of overhead from pointer aliasing. But I have seen charts where Fortran77 is claimed to be "fastest"---I have no idea what this is supposed to mean. – ShanZhengYang Jun 14 '15 at 3:34
• The performance of the MATMUL intrinsic is invariant to language except in 77, where it is not supported. – Jeff Jun 14 '15 at 3:40