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


First, what ever is wrong is either my fault of I missed reading the
necessary documentation.

Here is the problem.

I have a large engineering analysis code, developed first with Lahey
then CVF for the last 6 years.

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.

The variable is never used in a function or subroutine call and does
not appear in any other common block or in a module.

I started before modules (1987) so that is why I still have static
arrays and variables in common blocks. Up to now no problem.

Under CVF 6.6b is has behaved as it was expected to behave, staying
set either TRUE or FALSE depending upon either how it is initialized
(TRUE) or how the user sets it via a program command.

I compile via batch and have successfully established BAT files which
will wither compile in CVF (under one directory structure) or in IVF
(under a completely different directory structure.) Nothing is shared
between the builds. I'm dumb sometimes but not that dumb. :-)

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.

The behavior is similar to a behavior I saw years ago where the same
named common appeared is several places and had different variables in
the different copies. After that I put all my common blocks (all
named) in include files.

I use all of the same switches in compile and link in CVF and IVF.

Is there a difference between how IVF alignes common blocks in memory.
I remember once in an old DEC VAX compiler, you could not mix logical
with real in a common block but I have seen nothing like that since
1990 or was it 16 bit MS Fortran ? Not really sure.

I sure hope the above decription triggers something in somebody, cause
I'm a wee bit on the lost side right now.

I'm going to try a compile with no optimization this evening but that
is just a shot in the dark on my part.

Sincerely and thanks in advance.

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)

Relevant Pages