我正在尝试创建一个简单的示例,以便在 MKL 英特尔库中使用 Pardiso 求解器。我一直在按照提供的示例进行操作,但是如果我将对 Pardiso 的调用放在子例程中,它将不起作用。恐怕这与 INCLUDE 语句或链接方面有关。
所有子程序使用的数组都包含在一个名为 variables 的模块中
MODULE variables
INTEGER :: M ! Lines
INTEGER :: N ! Columns
REAL*8, DIMENSION(:,:), ALLOCATABLE :: MATRA ! original matrix
INTEGER, DIMENSION(:), ALLOCATABLE :: ROWSA,COLSA ! ia and ja in pardiso
REAL*8, dimension(:), ALLOCATABLE :: VALSA, RHSVC, SOLVC ! a, b, x
END MODULE variables
包含程序的文件如下:
INCLUDE 'mkl_pardiso.f90'
program PardisoFortran
use variables
use mkl_pardiso
implicit none
! do some stuff to create the matrices
call create_matrices
call INITPARDISO
end program
最后是文件 initpardiso
subroutine INITPARDISO
USE VARIABLES
USE mkl_pardiso
! pardiso variable declaration
TYPE(MKL_PARDISO_HANDLE), ALLOCATABLE :: pt(:)
INTEGER maxfct, mnum, mtype, phase, nrhs, error, msglvl
INTEGER, ALLOCATABLE, DIMENSION(:) :: iparm
INTEGER i, idum
REAL*8 waltime1, waltime2, ddum
! --- then I allocate and fill the variables
! Finally I can call pardiso
phase = 11 ! only reordering and symbolic factorization phase
CALL pardiso_64 (PT, maxfct, mnum, mtype, phase, M, VALSA, COLSA, &
ROWSA, idum, nrhs, iparm, msglvl, ddum, ddum, error)
end subroutine
现在,我还在 Visual Studio 项目配置中添加了 Additional Include Directories(即
C:\Program Files (x86)\Intel\ComposerXE-2011\mkl\include;
C:\Program Files (x86)\Intel\ComposerXE-2011\mkl\lib\intel64;
C:\Program Files (x86)\Intel\ComposerXE-2011\mkl\lib\ia32)
如果我评论对 pardiso 的调用,一切正常,否则它将停止编译并出现此错误:
错误 1 错误 #6285:此通用子例程调用没有匹配的特定子例程。[PARDISO_64] ....PardisoFortran\initpardiso.f 144
有什么想法吗?这是顶部的 INCLUDE 语句的问题吗?我应该在哪里包括它?