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

error #6405: The same named entity from different modules and/or program units cannot be referenced

milenko1976
Beginner
1,454 Views
I have read Stve Lionel's explanation,but I still don't get it.
ifort -c ircg.for
ircg.for(2153): error #6405: The same named entity from different modules and/or program units cannot be referenced. [APR1DSENS]
group(1,:,:)= apr1dsens(:,:)
---------------------^
ircg.for(2154): error #6405: The same named entity from different modules and/or program units cannot be referenced. [APR2DSENS]
group(2,:,:)= apr2dsens(:,:)
---------------------^
ircg.for(2155): error #6405: The same named entity from different modules and/or program units cannot be referenced. [APR3DSENS]
group(3,:,:)= apr3dsens(:,:)
---------------------^
ircg.for(2156): error #6405: The same named entity from different modules and/or program units cannot be referenced. [APR4DSENS]
group(4,:,:)= apr4dsens(:,:)
---------------------^
I try to put 4 arrays into one.These 4 arrays are defined in module mt2dsens.
0 Kudos
2 Replies
mecej4
Honored Contributor III
1,454 Views
Judging from Steve Lionel's points, he has only around ten-thousand posts; so, looking for the specific one that you alluded to should be a good test of the search features of the forum software, but I am sufficiently negatively biased about its capabilities to not even try.

You have, in file ircg.for, the following subroutine heading:

[fxfortran]        subroutine transenpas(group,apr1dsens,
& apr2dsens,apr3dsens,apr4dsens)
...
use params
use mt2dsens
...
[/fxfortran]
but module mt2dsens, which is USEd in the subroutine, already contains declarations for subroutine arguments 2, 3, 4 and 5:

[fxfortran]        real*4 apr1dsens(npmax,ncs)
real*4 apr2dsens(npmax,ncs)
real*4 apr3dsens(npmax,ncs)
real*4 apr4dsens(npmax,ncs)
[/fxfortran]
Even if the duplicated declarations match perfectly as to type, size, etc., such redeclarations of entities already associated through USE statements are not allowed.

0 Kudos
milenko1976
Beginner
1,454 Views
Thanks mecej,I will use interfaces.
0 Kudos
Reply