I have not especially made time studies on my programs since I do not
normally run extremely large and CPU-consuming tasks.
But I find the modern Fortran constructs so much easier to work with,
yielding much less source code and thus less maintenance efforts. That is
the primary reason for using modern Fortran, of course.
But two occasions on efficiency regarding Fortran 77 and Fortran 90 spring
to my mind.
Some years ago I was ask to update a program, written in Fortran 77,
handling Life Cycle Analysis on jet engine components. After I had put in
the new stuff and modernized some parts I realized that the program spent
some CPU-time in a so called "Rain-Flow-Count" subroutine. It was an easy
matter to rewrite this small subroutine using whole array operations, array
sections and intrinsics like PACK. Not only did the "Rain-Flow-Count" code
become clearer but it shrunk considerably in size and now only comprises
some 25 lines of code. But the great thing was that the overall performance
of the program improved (this one CAN spend a lot of CPU time due to large
amounts of data) by a factor three to six. And this is regardless of the
compiler and computer we used (Lahey, Visual Fortran, SIG, VMS). Maybe the
original code "rain-Flow-Count" was badly written so that the optimizer
could not do its job. But doesn't the presence and knowledge of modern
structures on part of the (not so knowledgeable) programmer help him/her
avoid making such bad non-optimizable code?
The other case is a matrix module that I have made. When I started working
on it I used code for some of the functions from a Matrix processor that I
made in Pascal some years ago and converted it more or less directly into
Fortran. A matrix "compress" function was then implemented using Ifs and
Dos. When returning to optimize it I changed into using the PACK intrinsic
functions and whole arrays and array sections. When testing it I realized
that I got a performance gain of about four times for this kind of
construct. This was some years ago so I don't remember what compiler I
used. It could have been Lahey or Visual Fortran.
So there ARE cases when Fortran 90/95 is more efficient than Fortran 77.
Lars Mossberg
Volvo IT / Aero
HTU
At 14:42 2001-08-03 -0700, you wrote:
>I have been asked to address the following "question"
>on a panel at Supercomputing 2001:
>
>The Fortran 90 standard has ruined the efficiency
>of Fortran.
>
>Does anybody have any hard evidence supporting or
>refuting this?
>
>Thanks.
>
>--
>Walt Brainerd [log in to unmask]
>The Fortran Company +1-520-256-1455
>11155 E. Mountain Gate +1-520-760-1397 (fax)
>Tucson, AZ 85749 USA http://www.fortran.com
>
>
|