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
http://softwareforums.intel.com/
Intel Fortran Support
http://developer.intel.com/software/products/support/
My Fortran blog
http://www.intel.com/software/drfortran


For the time being, /Qzero and /Qsave seem to have been the fixes
required.

I know how to remove Qzero. Initialize all uninitialized variables but
is the removal of Qsave related to converting COMMON blocks in
includes to modules ?

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)
.



Relevant Pages

  • Re: Strange Porting Problem CVF to IVF, requesting help and ideas.
    ... LOC is an intrinsic which returns the address of its argument. ... CVF's default was to allocate local variables statically. ... You can change the Intel behavior by specifying /Qsave. ... Intel Fortran Support ...
    (comp.lang.fortran)
  • Re: Strange Porting Problem CVF to IVF, requesting help and ideas.
    ... LOC is an intrinsic which returns the address of its argument. ... CVF's default was to allocate local variables statically. ... You can change the Intel behavior by specifying /Qsave. ... Intel Fortran Support ...
    (comp.lang.fortran)
  • Re: Hogwarts Special
    ... At one time you just used to standard "LOC" signs but it has become more ... common to see something identifying the production or the company. ...
    (uk.railway)
  • Re: BEST PERL BOOK FOR SYSTEM ADMINISTRATION UNIX
    ... what other metric is common to programs that's easily measured? ... I had probably 1000 LOC in a ... Perl, but I constantly wished it was Perl. ... Wise is the man who attempts to answer his question before asking it. ...
    (comp.lang.perl.misc)