- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
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?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Or, if the ONLY list is lengthy, just rename the conflicting variable to some unlikely name, e.g.:
[fortran]USE yourModuleName, null1492 => I [/fortran]

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page