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

IVF vs. Lahey Fujitsu Fortran 95 Compiler

h-faber
Beginner
1,904 Views
Hi,
actually I have a problem converting a Fortran 95 program from Lahey Fujitsu Fortran 95 Compiler (5.50j) to Intel Visual Fortran Compiler.
When I use the same source code, the calculation output (file) is different. In some cases just some rounding issue like 3.1 instead of 3.2, but in several cases the difference is much bigger - 12730 instead of 12717 etc. As I do not have the Lahey Fujitsu Fortran 95 Compiler (so I cannot insert some debug output), I would like to know whether there are known issues for taking over working code to IVF compiler.
What I see with Salford 95 Compiler are error messages like

error 600 - The KIND number should be 1, 2, or 3

(when the source code is
real(kind=8), dimension(0:damax) :: fread)
But I don't know whether the Salford Compiler behaves as the Lahey Compiler. So maybe I am wasting time figuring out the Salford Compiler errors.

Can anyone help?
Thanks in advance!
0 Kudos
3 Replies
TimP
Honored Contributor III
1,904 Views

LF95 and ifort use the KIND numbers in the same (not fully portable) way. You would have to fix this to use Salford; otherwise it should not be an issue.

You may want to use options such as -fp:precise (ifort 9.1) or -fltconsistency (earlier ifort) so as to avoid risky optimization. You might also expect rounding differences, assuming the LF96 build uses x87 extended precision. You would not be able to duplicate that consistently. Modern options such as -QxW give much better performance, without any of the occasional extra precision.

0 Kudos
h-faber
Beginner
1,905 Views
Hi Tim,
after reading your answer about 5 times, I still do not understand the answer in detail (for my mother language is not English though). Does it mean that Lahey and Intel Fortran compiler only differ in the KIND definition and some roundings? I use IVF 8.1, rounding differences are not that big problem I guess, unless the calculation differences are based on accumulating rounding differences. At the moment I am not able to figure that out, trying to figure out how to use the Lahey compiler so that I can debug and compare.
So could you explain to me more clearly what differences exist between Lahey 95 and IVF (8.1)?
Thanks in advance.
0 Kudos
TimP
Honored Contributor III
1,905 Views

Even your Intel compiler is somewhat old, which rules out one of the options I suggested. Guessing that you are running on Pentium 4 or newer, a typical compile option might be

ifort /QxW /fltconsistency yourfile.f

This should be reasonably consistent with

lf95 -tp4 -sse2 -o2 yourfile.f

My copy of LF95 is so old as not to support those options, so I don't want to guess further about your situation.

0 Kudos
Reply