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

construct names must be unique..?

Espen_M_
Beginner
794 Views

I want to use construct names for multiply nested DO constructs, but when I try to have several instances of such a "multiply nested DO block" (i.e. with the same names) within one scope the compiler complains. Note that the named constructs having identical names are _not_ nested.

I cannot find anything in the standard (N1830) about this, and in the Ifort documentation there is no mention about this restriction in the section about the DO construct.

Did I miss something?

0 Kudos
2 Replies
Espen_M_
Beginner
794 Views

When trying to use an EXIT statement from an IF construct I incidentally came across this sentence regarding named IF constructs:

"The same construct name must not be used for different named constructs in the same scoping unit."

It seems that this applies to DO constructs aswell, but (as far as I can tell) it is not mentioned in the documentation...

Is this an Intel specific restriction?

PS: The reason I found this is that I was trying to use an EXIT from a named IF construct; is this feature coming in Ifort any time soon?

0 Kudos
Steven_L_Intel1
Employee
794 Views

The restriction you want is in section 16.3.1 (Class of local identifiers) of Fortran 2008. A named construct is a local identifier of class (1). Paragraph 3 of that section says, "Within its scope, a local identifier of one class shall not be the same as another local identifier of the same class, ..."

As for EXIT out of non-loop blocks, that is a Fortran 2008 feature on our list for future implementation. I could not say when at this time.

0 Kudos
Reply