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

common alignement

sieur_blabla
Beginner
610 Views
Hi,

I am asking your help because I have a problem when I try to make a programm written on linux work on windows. This program was written with fortran 77.
Compilation and build are successful and I have the .exe file. But when I test it if it works well, problems begin.
When I execute with MS DOS, I have this message:

forrtl: severe (408): fort: (2): Subscript # 1 of the array P value Has 4 WHICH IS Greater Than the upper bound of 3

(fort is the input file in which the program is supposed to read.)

I tried to spot the error and I found that I have in a header the following line:
COMMON/COM07 / PPRO (0:3), RPRO (4)

this line meant that when I finished filling the table PPRO it starts filling rpro. and therefore in the following subroutine:

DO 2 J = 0,7
2 PPRO (J) = P (J)

was going very well on linux. On windows this is no longer the case. Please why not spend more? And what could I do?

thanks.
0 Kudos
2 Replies
Arjen_Markus
Honored Contributor II
610 Views
This is a rather nasty practice dating from earlier decades. Common, but nasty nonetheless.

I guess you are using the debug configuration on Windows? In that case array bound checking is turned
on by default (or at least it happens to be turned on) and then you can not do this.

Remedies:
- Scanthe source code for this type of constructions and properly fill each array
(The most recommendable solution, but it may be a great effort to correct everything)
- Turn off the array bound checking - this is a compile option.

Regards,

Arjen
0 Kudos
sieur_blabla
Beginner
610 Views
Thank you very much.
0 Kudos
Reply