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



Jim Klein wrote:
glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

Jim Klein <jameseklein@xxxxxxxxxxxxx> wrote:
(snip)
It has a named common block that is inside an include file. The
variable in question is named LDIF2 and is used by the program,
depending on how it is set by the user to control some program
behavior. It is declaired as LOGICAL. It is the only variable in the
common block.
(snip)

In the IVF compile, when the program runs, the variable changes from
TRUE to FALSE unexpectedly during somewhat related operations but
nothing that should have changed its state. I have placed traps
wherever LDIF2 is explicitly set in the code (write statements). LDIF2
is not being reset at any code location I can find.
COMMON blocks are often located sequentially in memory, and if
you go outside an array on one it is easy to go into variables
in the next or previous block in memory.

Most compilers now have an option to do array bounds checking.
That has a good chance of finding the problem.

Most of the other problems with COMMON should not occur if it
only has one variable in it.

Another way to find problems like this is with a debugger
that can test for changes in a variable. gdb can do that,
I don't know which other ones can.

-- glen

/check:all catches nothing in CVF and caught two items in IVF. With
optimize off, IVF produced a code which crashes on launch with a
complaint that a variable in not defined, yet it is defined explicitly
since I have used IMPLICIT NONE religiously since 1987 and it appears
in a REAL*8 declairation.

this is the answer. As Jugoslav said in a follow on, some
compilers initialize almost everything to zero. Find whatever
variable the compiler complained about when it crashed, set
it to zero when the program starts, repeat as necessary.
Tedious, but it beats fooling around with modules and
compiler switches in the long run.

*** Hendrickson

I have a lot of includes. Is there a limit to the number of allowed
includes in IVF. I know there is in CVF but I'm under the max.
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)
.


Quantcast