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.

I am thinking Qsave is going to be the immediate "fix". If it is, what
is the correct fix instead of "Q/save" ?

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.

Could this be a problem even if the commons did not involve the
variable in question.

Jim

James E. Klein
jameseklein@xxxxxxxxxxxxx

Engineering Calculations
http://www.ecalculations.com
ecalculations@xxxxxxxxxxxxxxxxx
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)
.