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

Overriding module variable names

rahzan
New Contributor I
555 Views
If a variable of the same name as a module variable is decalred in a contained routine, it overrides the latter.

Is there a compiler option which prevents this, so that the user is warned of the override?

Thanks,
TSH
0 Kudos
2 Replies
Steven_L_Intel1
Employee
555 Views
No - that's a standard Fortran feature. I think if you use ONLY, though, the compiler will complain if you also declare the item locally.

Steve
0 Kudos
Jugoslav_Dujic
Valued Contributor II
555 Views
I had a problem other way round -- see this thread on comp.lang.fortran. I still think it's a language misfeature.

Jugoslav
0 Kudos
Reply