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

Disastrous number of name conflict

yw3_1999
Beginner
466 Views
Hi,
I found that I had hundreds of error '#6401: The attributes of this name conflict with those made accessible by a USE statement. '. I think the reason is that I was defined in almost every module as a local variable but Fortran treats everything as PUBLIC. I think going to each module and give every 'I' a PRIVATE attribute will do the work. Is that any quick way to correct this error?
0 Kudos
2 Replies
jimdempseyatthecove
Honored Contributor III
466 Views
Why is "I" in your module?
Is this a result of I originally being declared as COMMON?

If I is a loop control variable, then consider removing it from the MODULE
If I is a ligitimate "common" variable then consider renaming it (Icommon) or encapsulating it in a user defined type contained in the module. Example

type wasCOMMON
integer :: I
...
end type wasCOMMON
...
(in your MODULE)
type (wasCOMMON) :: oldCOMMON

Then in your code

... oldCOMMON%I ...

At least do that until later in your conversion process after you cleanup the conflicting names.

You can also use

USE yourModuleName, ONLY : X, Y, Z,... (but not I)

Read your code, see what I is use for.

Jim Dempsey
0 Kudos
John4
Valued Contributor I
466 Views

Or, if the ONLY list is lengthy, just rename the conflicting variable to some unlikely name, e.g.:

[fortran]USE yourModuleName, null1492 => I
[/fortran]

0 Kudos
Reply