Hi,
as previously mentioned we are evaluating PGI Visual Fortran for porting our FEM application to CUDA. However we have some issues not related to CUDA that we need to solve:
It seems that there is a compiler error in the treatment of generic procedures, below is an example that fails with PGI fortran (11.1) but compiles with e.g. intel fortran.
Here is the code:
!
module A
private
public :: A_new
interface A_new
module procedure new
end interface A_New
contains
subroutine new( r )
real :: r
r = 5.0
end subroutine new
end module A
module AA
use A
private
public :: A_new
interface A_new
module procedure new
end interface A_New
contains
subroutine new( r, i )
integer :: i
real :: r
r = 5.0
i =6
end subroutine new
end module AA
module AAA
!use A
use AA
contains
subroutine new( r, i )
integer :: i
real :: r
call A_new( r )
call A_new( r,i )
end subroutine new
end module AAA
The error message is:
: error S0155 : Could not resolve generic procedure a_new
However, changing the general “private” statement in module A and AA to the specific “private new”, the compilation returns with no error. As each module contains only one subroutine, these 2 version of the code should be identical but the compiler “believes” different.
In our code we have as a general principle that we use the “private” statement to change the default from public to private in our modules, and we think that there must be an error in the compiler or are there some compiler flags that may correct this?
Einar