[Fortran] 纯文本查看 复制代码
PROGRAM pardisotest
integer*8, dimension(64) :: pt
integer :: maxfct=1
integer :: mnum =1
integer :: mtype = -2
integer :: phase
integer :: n=8
REAL,dimension(18) :: a
integer,dimension(9):: ia
integer,dimension(18) :: ja
integer, dimension(8) :: perm
integer :: nrhs =1
integer, dimension(64) :: iparm
integer :: msglvl = 1
REAL, dimension(8) :: b
REAL, dimension(8) :: x
integer :: error = 0
ia = (/ 1, 5, 8, 10, 12, 15, 17, 18, 19 /)
ja = (/ 1, 3, 6, 7,
& 2, 3, 5,
& 3, 8,
& 4, 7,
& 5, 6, 7,
& 6, 8,
& 7,
& 8 /)
a = (/ 7.d0, 1.d0, 2.d0, 7.d0,
& -4.d0, 8.d0, 2.d0,
& 1.d0, 5.d0,
& 7.d0, 9.d0,
& 5.d0, 1.d0, 5.d0,
& -1.d0, 5.d0,
& 11.d0,
& 5.d0 /)
b=(/17.d0, 6.d0, 6.d0, 16.d0 ,11.d0, 4.d0, 11.d0, 5.d0/)
DO i = 1, 64
pt(i)=0
iparm(i) = 0
END DO
DO i = 1, 8
x(i) = 0
END DO
phase = 13
CALL pardiso (pt, maxfct, mnum, mtype, phase, n, a, ia, ja,
& perm, nrhs, iparm, msglvl, b, x, error)
WRITE(*,*) 'The solution of the system is '
DO i = 1, n
WRITE(*,*) ' x(',i,') = ', x(i)
END DO
read*
END PROGRAM pardisotest