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

Errors due to non-conformance with standard for TARGET and array conformance?

New Contributor II

In upgrading IFORT to 2023.0.0 from the previous version, code that compiled previously without error now has two kinds of compilation errors:

1) TARGET missing from declaration. Adding the attribute fixed these errors.

2) Array size does not conform in code such as

iGridPt0 = MINVAL(iGrid0(1:nRadialPoints), MASK = radialPlotOn)

where the extent of iGrid0 and radialPlotOn did not agree; correcting it to

iGridPt0 = MINVAL(iGrid0(1:nRadialPoints), MASK = radialPlotOn(1:nRadialPoints)) 

fixed this type of error.

My question is, in the code prior to the above types of corrections, compiled with the previous version of IFORT, could there have been any errors in the result of running the pgm? Or is the addition of the TARGET attribute and the conforming of the arrays just necessary for optimization?

0 Kudos
1 Reply
Black Belt

The TARGET attribute is needed for correctness according to the standard. It's possible that not having it allowed the compiler to do something it shouldn't, but the probability is low.

As for the array shape issue, it's not likely that the earlier build gave you wrong results, but it's impossible to say for certain.

0 Kudos