Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Fortran90 vs. Fortran77

ccflian
Beginner
520 Views
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.

ccflian
0 Kudos
3 Replies
Steven_L_Intel1
Employee
520 Views
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
0 Kudos
TimP
Honored Contributor III
520 Views
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.
0 Kudos
Steven_L_Intel1
Employee
520 Views
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.

0 Kudos
Reply