- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
While compiling a fortran code on Intel fortran compiler 10.1.011 using visual studio. I ran into following error,
censub.f(110) : Error: The same named entity from different modules and/or program units cannot be referenced. [PRSINT]
censub.f(110) : Error: This name has not been declared as an array or a function. [PRSINT]
I am porting a old fortran 77 code to fortran 90.
Interface check for subroutines is switched off, Generate Block Interface is on.
Any suggestion help !!
Thanks
Mayur
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A little more code would help...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'd also like to see the code - but I expect that turning off Generate Interface Blocks will make the error go away. Is PRSINT a recursive call?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have similar problem, indeed it is with a recursive function (and subroutine)
Code:
====
recursive function fac(n) result(fac0)
integer n,fac0
if (n == 1) then
fac0 = 1
else
fac0 = n * fac(n-1)
fac0 = fac0 * fac(n-1)
endif
end
Command line and compilation result:
===========================
ifort tt.f90 -gen-interfaces -warn interface
fortcom: Error: tt.f90, line 8: The same named entity from different modules and/or program units cannot be referenced. [FAC]
fac0 = fac0 * fac(n-1)
------------------^
For the subroutine version:
Code:
=====
recursive subroutine fac_subr(n, fac0)
integer n,fac0
if (n == 1) then
fac0 = 1
else
call fac_subr(n-1, fac0)
call fac_subr(n-1, fac0)
fac0 = n * fac0
endif
end
Command line and compilation result:
===========================
ifort qq.f90 -gen-interfaces -warn interface
fortcom: Error: qq.f90, line 8: The same named entity from different modules and/or program units cannot be referenced. [FAC_SUBR]
call fac_subr(n-1, fac0)
---------^
compilation aborted for qq.f90 (code 1)
An observation:
- removing second call / invocation -> no message
Albert
Code:
====
recursive function fac(n) result(fac0)
integer n,fac0
if (n == 1) then
fac0 = 1
else
fac0 = n * fac(n-1)
fac0 = fac0 * fac(n-1)
endif
end
Command line and compilation result:
===========================
ifort tt.f90 -gen-interfaces -warn interface
fortcom: Error: tt.f90, line 8: The same named entity from different modules and/or program units cannot be referenced. [FAC]
fac0 = fac0 * fac(n-1)
------------------^
For the subroutine version:
Code:
=====
recursive subroutine fac_subr(n, fac0)
integer n,fac0
if (n == 1) then
fac0 = 1
else
call fac_subr(n-1, fac0)
call fac_subr(n-1, fac0)
fac0 = n * fac0
endif
end
Command line and compilation result:
===========================
ifort qq.f90 -gen-interfaces -warn interface
fortcom: Error: qq.f90, line 8: The same named entity from different modules and/or program units cannot be referenced. [FAC_SUBR]
call fac_subr(n-1, fac0)
---------^
compilation aborted for qq.f90 (code 1)
An observation:
- removing second call / invocation -> no message
Albert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Albert, please update your compiler. This bug was fixed a few months ago. 10.1.024 is current.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
I have a similar problem. The code is as follows:
integer:: i1, i2, i3
real*8:: d1, d2, d3
...
i3 = max (i1, i2)
d3 = max (d1, d2)
end
When compiling, the following error displayed:
Error: The same named entity from different modules and/or program units cannot be referenced.
However, if I change the "i3 = max (i1, i2)" to
i3 = imax0 (i1, i2)
The compiling can be passed.
My version is 10.1.029.
Thanks,
Zhanghong Tang
Quoting - Steve Lionel (Intel)
I have a similar problem. The code is as follows:
integer:: i1, i2, i3
real*8:: d1, d2, d3
...
i3 = max (i1, i2)
d3 = max (d1, d2)
end
When compiling, the following error displayed:
Error: The same named entity from different modules and/or program units cannot be referenced.
However, if I change the "i3 = max (i1, i2)" to
i3 = imax0 (i1, i2)
The compiling can be passed.
My version is 10.1.029.
Thanks,
Zhanghong Tang
Quoting - Steve Lionel (Intel)
Albert, please update your compiler. This bug was fixed a few months ago. 10.1.024 is current.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not enough information shown. Can you provide a small but complete example?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
Not enough information shown. Can you provide a small but complete example?
On the other hand, I will put a small example if I have simplified my current project.
Thanks,
Zhanghong Tang

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