      SUBROUTINE PardisoTest

      IMPLICIT NONE

#ifdef _WIN64
      INTEGER*8  pt(64)
#else
      INTEGER    pt(64)
#endif
      INTEGER    i,j
      INTEGER    maxfct,mnum,mtype,phase,n,nrhs,msglvl,error
      INTEGER    iparm(64)

      INTEGER    ia(66),ja(252),perm(65)
      REAL*8     a(252),b(65,1),x(65,1)

      maxfct=1
      mnum=1
      mtype=2
      phase=13
      n=65
      nrhs=1
      msglvl=0
      DO i=1,n
         perm(i)=0
      ENDDO

c     Initialize the output parameters
      do j=1,nrhs
         do i=1,n
            x(i,j)=0.0d0
         enddo
      enddo
      error=0

c     Read the data that gets passed to Pardiso for this test
      open(98,FILE='C:\Work\PardisoData.TXT')
      read(98,*)
      read(98,*) a
      read(98,*)
      read(98,*) ia
      read(98,*)
      read(98,*) ja
      read(98,*)
      read(98,*) b
      close(98)

      CALL PardisoInit (pt, mtype, iparm)

      phase=13  ! Analyse, factorize and solve

      CALL Pardiso (pt, maxfct, mnum, mtype, phase, n, a, ia, ja
     c             ,perm, nrhs, iparm, msglvl, b, x, error)

      phase=-1  ! Release memory
      CALL Pardiso (pt, maxfct, mnum, mtype, phase, n, a, ia, ja
     c             ,perm, nrhs, iparm, msglvl, b, x, error)

      RETURN
      END
