Re: Strange Porting Problem CVF to IVF, requesting help and ideas.

"Steve Lionel" <steve.lionel@xxxxxxxxx> wrote:

David Flower wrote:

You are confusing LOC with %LOC.

LOC is an intrinsic which returns the address of its argument.

And %LOC does the same thing. They have identical function in the DEC
and descendant compilers. The %LOC syntax came first, but we
eventually added a more normal looking LOC intrinsic as well.

Regarding the earlier comment about variables being "filled with
garbage" - Intel Fortran's default is to allocate local scalar
variables on the stack, so you get whatever was left over in the stack
contents. CVF's default was to allocate local variables statically.
You can change the Intel behavior by specifying /Qsave. /Qzero won't
do much by default as it affects static local variables only. You need
to pair it with /Qsave. Both are a Band-Aid to cover up incorrect code
and should not be used - fix your code instead.

Others have given good advice here - I would add that Jim should make
sure that his COMMONs are declared as the same length in all routines
(if one is using an INCLUDE for this it's rarely a problem, but I've
seen programs that used different includes for the same common and ran
into trouble.

Array bounds checking is good but doesn't help if you use (*)
dimensioned arrays. Argument type mismatches can also get you into
trouble - in Intel Fortran, add the options /gen_interface and
/warn:interface to help catch these.

Steve Lionel
Developer Products Division
Intel Corporation
Nashua, NH

User communities for Intel Software Development Products
Intel Fortran Support
My Fortran blog

Steve and all. I shall try Steve's switch change suggestions and plan
to convert the commons to modules. The latter is something I have
tought about but been recitent to do because of the massive size of
the job.

I'll get back after I try the above /Qsave /Qzero /gen_interface and

James E. Klein

Engineering Calculations
Engineering Calculations is the home of
the KDP-2 Optical Design Program
for Windows and (soon) MAC OSX
Free KDP-2 (DEMO) downloadable!
1-818-507-5706 (Voice and Fax)