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

array dimension

andrea_scarabello
403 Views
Hi There,
At the moment I am using IVFC version 9.
I have a code that was written with an extremely old version of a Fortran compiler.
When starting without debugging I get problems with array dimensions, lower or upper bound.
Is it possible that the original compiler used to write the code set the lower bound of the array to 0 and the IVFC to 1 so I have to set manually the lower bound value when defining the array dimension?
Thanks
Andrea
0 Kudos
5 Replies
TimP
Honored Contributor III
403 Views
More likely, the author of the code never checked for out of bounds access, and thought her code worked well enough. I've worked on code which had to be "fixed" by adding a declared lower bound of 0.
0 Kudos
andrea_scarabello
403 Views

Thanks

I declared the dimension of the lower bound and it solved that problem.

Now I a m facing other problems, with other array, such as values over the upper bound. If I change them and it looks like it apparently solves the problem than I get problem with the solver and the DAE resolution.

Andrea

0 Kudos
ferrad
New User
403 Views

I'm having the same problem, switching on full (including array bounds) checking in an old product. I would not recommend simply redimensioning the arrays. I would stick with the old dimensions (1:orig_max) as they were probably correctly sized when the original author wrote the code. I would investigate why the code is trying to pass arguments outside the array bounds and fix that logic.

Adrian

0 Kudos
Steven_L_Intel1
Employee
403 Views
Some old code is written to index outside the declared bounds of the array. For these programs, bounds checking should be disabled, though the compiler does in most ways treat (1) as (*) for the purpose of bounds checking. You do need to make sure that the program is correct and not just go changing declarations to avoid the errors.
0 Kudos
hansr
Beginner
403 Views

I have had succes correcting lower bounds by doing this:

c Converted to the Intel Visual Fortran 8.0 environment.
c The following compiler and linker options have been set:
c * Fortran->Data->Local Variable Storage = All Variables SAVE
c * Fortran->Data->Initialize Local Saved Scalars to Zero = Yes

Hans


0 Kudos
Reply