Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

strange array bounds exceeded

cep1dm
Beginner
576 Views
Hi,
I am running a fortran code with compaq visual fortran 6 on a win2000.
I get a program exception -array bounds exceeded, on a subroutine that was created on 1984 and that I have personally used for more than 2 years without any problem so far. The array and string bounds checking is on.
The subroutine is a non linear equation solver. It works finefor 726 equations, but when I change a parameter and has to solve846 equations, it fails. I just call the routine, I have not change it. So let's say that it cannot be the routine since it has not failed in more than 2 years. All the information that I give to the routineseems to be inside the bounds. But surprisingly an array which is an integer gets a value of -443395 whenthe "real value"should be 43. The same happens for any other number of equations higher than 846. the funny integer is different though, as well as the "real value" is.
Is it possible,that itis failing as consequence of any other problem out of the routine? Any help would be appreciated.
This is what I get in:
The exception Array bounds exceeded.
(0xc000008c) ocurred in th application at location 0x0054f5e0
forrtl: severe (161): Program Exception - array bounds exceeded
Image PC Routine Line Source
Endo.exe 0054F8E1 Unknown Unknown Unknown
Endo.exe 0054CCB4 Unknown Unknown Unknown
Endo.exe 0054B4E9 Unknown Unknown Unknown
Endo.exe 0054AC5F Unknown Unknown Unknown
Endo.exe 004F481C Unknown Unknown Unknown
Endo.exe 004F348F Unknown Unknown Unknown
Endo.exe 00409D7A Unknown Unknown Unknown
Endo.exe 00401C3D Unknown Unknown Unknown
Endo.exe 0046E7F2 Unknown Unknown Unknown
Endo.exe 0058CF99 Unknown Unknown Unknown
Endo.exe 0057E084 Unknown Unknown Unknown
KERNEL32.dll 7C598989 Unknown Unknown Unknown
Thanks
Daniel
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
576 Views
Note that array bounds checking pretty much doesn't work on assumed-size array arguments; I pressume the error still happens within the routine rather than triggered from something outside.

There's a nice debugger feature in Debug/Breakpoints/Data tab. Simply, set a "data breakpoint" within the routine to be triggered when e.g. foo(x) < 0. You will get a debug break when that happens, and if it's on a seemingly irrelevant place, check carefully the bounds yourself.

Alternatively, you can turn assumed-size arguments (*) into assumed-shape (:) and provide an explicit interface. In that case, you will get the full bounds checking for argument arrays too.

Hope that helps,
Jugoslav
0 Kudos
cep1dm
Beginner
576 Views
thanks jugoslav.
I'll try it later.
daniel
0 Kudos
Reply