Fortran90 vs. Fortran77

Fortran90 vs. Fortran77

I am converting some Fortran77 codes into Fortran90. I want to make it faster by taking advantage of the features in Fotran90 - 'forall' and 'where' for array operations and intrinsic function - 'dot_product' for vector multiplication. But when I used program profile software to analyze the program, I got slower result for these changes, especially the dot_product function.

Does anybody know if there are advantages in Fortran90 which can be utilized to upgrade Fortran77 code? Thanks.


4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Don't bother. The constructs you refer to don't make the code faster - as you find, they can slow it down. Use these features if they make sense in your new coding, but leave your old code alone.


Steve - Intel Developer Support

The question is about f90 in general, not even about any particular Intel compiler. Even if I consider that it may have been intended to refer to Intel compilers, I can't place the response.

With efl/efc, I don't see any good alternative which performs as well as dot_product() and matmul() in many applications. CVF6.6 does an excellent job with matmul() and reshape() in certain contexts. ifl/ifc are improving.

Many compilers for non-IA architectures perform well with reasonable use of current syntax. I don't fully understand the recommendation to avoid it.

I didn't say that one should avoid the new features, but rather than one should not devote any energy to "converting" old, but working, code to F90. Sure, there are nice intrinsics such as MATMUL, but if you've already got a MATMUL coded in your application, there's rarely an advantage to recoding.

What I tend to see in my experience is that programmers familiar with F77 but not with F90 do these conversions in ways that often slow down the code and introduce errors. It's also a waste of effort - one of the major principles of Fortran is that as the language evolves, your old programs continue to work unchanged.

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today