Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29302 Discussions

Undefined address when specifying double precision real variables

Richard_Moser
Beginner
859 Views
I have a code which was working fine. In trying to compare to some experimental results, I changed all of my real variables to double precision, at which point I got an access violation message, where an integer array is said to have an undefined address (the whole array, not just elements within it). If I go back to single precision real, it works fine.

In trying to narrow the problem down, I inserted a statement at the very top of the main code which tries to initialise the integer array, but I get the same problem.

Why does changing from single to double precision real affect the access of an integer array?

I am using compiler version 11.0.075, in Visual Studio 2005.
0 Kudos
5 Replies
jimdempseyatthecove
Honored Contributor III
859 Views

Does your code contain COMMON with EQUIVALENCE?
The size change in real may move the former positions of equivalence.

Also, your calling arguments may now be messed up. Try geninterfaces and check interfaces (and use IMPLICIT NONE if possible)

Jim Dempsey
0 Kudos
Richard_Moser
Beginner
859 Views
Jim,

Thanks for your response. I am using IMPLICIT NONE, and I do not have any COMMON statements.

The error occurs before any calls are made.

Richard

0 Kudos
Les_Neilson
Valued Contributor II
859 Views
Quoting - Richard Moser
Jim,

Thanks for your response. I am using IMPLICIT NONE, and I do not have any COMMON statements.

The error occurs before any calls are made.

Richard


Do you have any EQUIVALENCE statements ?

As jim mentioned turn on interface checking (Project->Properties->Fortran->Diagnostics)
If that doesn't show up any compile messages then :

The usual suspects :
turn on all debugging flags : (Project -> Properties -> Fortran -> Run-time -> Runtime Error checking : ALL

Put a "breakpoint" on the first statement of your program
Run your program (in debug mode of course)
It should stop on thatfirst breakpoint
Pressing F10 will then step though the program one statement at a time until you get to the error. This should give you a better idea of where the problem lies.


Les
0 Kudos
Richard_Moser
Beginner
859 Views
Quoting - Les Neilson

Do you have any EQUIVALENCE statements ?

As jim mentioned turn on interface checking (Project->Properties->Fortran->Diagnostics)
If that doesn't show up any compile messages then :

The usual suspects :
turn on all debugging flags : (Project -> Properties -> Fortran -> Run-time -> Runtime Error checking : ALL

Put a "breakpoint" on the first statement of your program
Run your program (in debug mode of course)
It should stop on thatfirst breakpoint
Pressing F10 will then step though the program one statement at a time until you get to the error. This should give you a better idea of where the problem lies.


Les

Les,

I don't have any EQUIVALENCE statements in the code. Interface checking was already active, with no messages during compilation, and runtime error checking was set to ALL.

I had already moved the troubled statement to the very start of the main program, to ensure that no other routines were interfering.

I declare my integer array as INTEGER N_ORDS(6)

My first executable statement in the code is then:

DO I = 1, 6
N_ORDS(I) = 0
ENDDO

and it fails on execution, listing the elements of N_ORDS as having an undefined address. There are also other (single value) integer variables which are listed as this. All REAL variables seem to be ok (uninitialised, but having an address).


Richard
0 Kudos
jimdempseyatthecove
Honored Contributor III
859 Views

Richard,

Can you submit a simple example program that exhibits this behavior?

Note,

If you are debugging the Release build with optimizations, and if N_ORDS is not used, or used only within that routine (but not modified after initialization) then the compiler might optimize out the N_ORDS array.

Jim Dempsey
0 Kudos
Reply