error #8169: The specified interface is not declared.

error #8169: The specified interface is not declared.

Hi, everyone, 

I tried to compile the source code below but the Intel Visual Fortran compiler 2013 issues a compiler error saying that error #8169: The specified interface is not declared at line 16.

However, the same source code can be compiled using the Portland Visual Fortran 12.10. Can anyone help me out with figuring out anything wrong in my program? Thanks!

Li

PS. I have the Visual Studio 2010 solution file attached. Also, the error list generated by the IVF compiler and the results obtained by the PVF compiler are enclosed in the attachment. 

MODULE toolbox 
IMPLICIT NONE 
REAL, DIMENSION(:), POINTER :: fvec1p, fvec2p 
ABSTRACT INTERFACE 
FUNCTION functions_system(x) RESULT(y) 
IMPLICIT NONE 
REAL, DIMENSION(:), INTENT(IN) :: x 
REAL, DIMENSION(SIZE(x)) :: y 
END FUNCTION 
END INTERFACE 
ABSTRACT INTERFACE 
FUNCTION middle_function_template(x,fvec_p,proc_p) RESULT(y) 
IMPLICIT NONE 
REAL, DIMENSION(:), INTENT(IN) :: x 
REAL, DIMENSION(:), POINTER :: fvec_p 
PROCEDURE(functions_system), POINTER :: proc_p 
REAL :: y 
END FUNCTION 
END INTERFACE 
PROCEDURE(functions_system), POINTER :: proc1p, proc2p 
CONTAINS 
FUNCTION func_system1(x) RESULT(y) 
IMPLICIT NONE 
REAL, DIMENSION(:), INTENT(IN) :: x 
REAL, DIMENSION(size(x)) :: y 
y(1)=x(1) 
y(2)=x(2) 
END FUNCTION func_system1
! the major program returns the normalization of
! a given vector 
SUBROUTINE MajorSolver(ans,x,fvec_p,proc_p)
IMPLICIT NONE
REAL, DIMENSION(:), POINTER :: ans
REAL, DIMENSION(:), INTENT(IN) :: x
REAL, DIMENSION(:), POINTER :: fvec_p
PROCEDURE(functions_system), POINTER :: proc_p
PROCEDURE(middle_function_template), POINTER :: proc3p
REAL, DIMENSION(SIZE(x)), TARGET :: y ! kept for other use
REAL :: z
fvec_p=>y 
proc3p=>MiddleFunction 
z=AssistantSolver(x,proc3p,fvec_p,proc_p) 
ans=fvec_p**2/z 
END SUBROUTINE MajorSolver 
FUNCTION AssistantSolver(x,func,fvec_p,proc_p) 
IMPLICIT NONE 
REAL, DIMENSION(:), INTENT(IN) :: x 
procedure(middle_function_template), pointer :: func
REAL, DIMENSION(:), POINTER :: fvec_p 
PROCEDURE(functions_system), POINTER :: proc_p 
REAL :: AssistantSolver 
AssistantSolver=func(x,fvec_p,proc_p) 
END FUNCTION AssistantSolver 
! return the innder product of the vector proc_p evaluated at x
FUNCTION MiddleFunction(x,fvec_p,proc_p) 
IMPLICIT NONE 
REAL, DIMENSION(:), INTENT(IN) :: x 
REAL, DIMENSION(:), POINTER :: fvec_p 
PROCEDURE(functions_system), POINTER :: proc_p
REAL :: MiddleFunction
fvec_p=proc_p(x)
MiddleFunction=dot_product(fvec_p,fvec_p)
END FUNCTION 
END MODULE toolbox
PROGRAM main
USE toolbox
IMPLICIT NONE
REAL, DIMENSION(:), POINTER :: ans
REAL :: data2(2)
data2=[1.,2.] 
proc1p=>func_system1 
allocate(ans(size(data2))) 
call MajorSolver(ans,data2,fvec1p,proc1p) 
write(*,'(a,2(f7.3))'),'Equations system 1: Ans= ',ans
nullify(ans,proc1p)
END PROGRAM main

3 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

I finally figure out the workaround mecej4 talked about in my previous post. I need to use the import declaration between lines 12 and 13. A clear explanation could be found in the reply by IanH at Stackoverflow.

As in another recent post ( http://software.intel.com/en-us/forums/topic/404621 ), you need IMPORT statements to make properties/attributes available by host association in an interface body.

Melden Sie sich an, um einen Kommentar zu hinterlassen.