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

Fortrtan 2003 Standard, concerns re

windscion
Beginner
465 Views
Under f03, assignment to an allocatable array will change the size of the allocatable array to conform to the target. This, of course, completely and utterly defeats any hope of the compiler, much less the debugger, detecting an array conformance mismatch. With the results that the actual error message (should the programmer be so fortunate as to receive one) will be some distance from where the actual problem occured. [ref: The New Features of Fortran 2003" by John Reid, section 3.3]

Of course one can program defensively, but I would prefer that it were possible to direct the compiler not to do this sort of thing in the first place. That is, I would breath easier if their were a way, short of specifying "f90 -stand=f95" to disallow such promiscuous realignment of allocatable arrays.

0 Kudos
2 Replies
Steven_L_Intel1
Employee
465 Views
We hear you. Actually, the 10.0 compiler doesn't do that automatic reallocation, but a future version will. In that version, the automatic reallocation is NOT the default, but you can ask for it using a new command line option. The automatic reallocation would slow down ordinary code that didn't need it, and perhaps one day we'll implement shape checking which can be an added help.

I'll also note that -stand is intended to produce diagnostic messages only and not to change any behavior.


0 Kudos
windscion
Beginner
465 Views
whew!
Thanks

0 Kudos
Reply