1! icbp : iso_c_binding for parpack
2
3subroutine pznaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
4                     iparam, ipntr, workd, workl, lworkl, rwork, info)       &
5                     bind(c, name="pznaupd_c")
6  use :: iso_c_binding
7  implicit none
8#include "arpackicb.h"
9  integer(kind=i_int),              value,              intent(in)    :: comm
10  integer(kind=i_int),                                  intent(inout) :: ido
11  character(kind=c_char),                               intent(in)    :: bmat
12  integer(kind=i_int),              value,              intent(in)    :: n
13  character(kind=c_char),           dimension(2),       intent(in)    :: which
14  integer(kind=i_int),              value,              intent(in)    :: nev
15  real(kind=c_double),              value,              intent(in)    :: tol
16  complex(kind=c_double_complex),   dimension(n),       intent(inout) :: resid
17  integer(kind=i_int),              value,              intent(in)    :: ncv
18  complex(kind=c_double_complex),   dimension(ldv, ncv),intent(out)   :: v
19  integer(kind=i_int),              value,              intent(in)    :: ldv
20  integer(kind=i_int),              dimension(11),      intent(inout) :: iparam
21  integer(kind=i_int),              dimension(14),      intent(out)   :: ipntr
22  complex(kind=c_double_complex),   dimension(3*n),     intent(out)   :: workd
23  complex(kind=c_double_complex),   dimension(lworkl),  intent(out)   :: workl
24  integer(kind=i_int),              value,              intent(in)    :: lworkl
25  complex(kind=c_double_complex),   dimension(ncv),     intent(out)   :: rwork
26  integer(kind=i_int),                                  intent(inout) :: info
27
28  character(len=2):: w
29  integer         :: i
30
31  do i =1,2
32      w(i:i) = which(i)
33  end do
34
35  call pznaupd(comm, ido, bmat, n, w, nev, tol, resid, ncv, v, ldv,&
36               iparam, ipntr, workd, workl, lworkl, rwork, info)
37end subroutine pznaupd_c
38
39subroutine pzneupd_c(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
40                     bmat, n, which, nev, tol, resid, ncv, v, ldv,        &
41                     iparam, ipntr, workd, workl, lworkl, rwork, info)    &
42                     bind(c, name="pzneupd_c")
43  use :: iso_c_binding
44  implicit none
45#include "arpackicb.h"
46  integer(kind=i_int),              value,              intent(in)    :: comm
47  integer(kind=i_int),              value,              intent(in)    :: rvec
48  character(kind=c_char),                               intent(in)    :: howmny
49  integer(kind=i_int),              dimension(ncv),     intent(in)    :: select
50  complex(kind=c_double_complex),   dimension(nev),     intent(out)   :: d
51  complex(kind=c_double_complex),   dimension(n, nev),  intent(out)   :: z
52  integer(kind=i_int),              value,              intent(in)    :: ldz
53  complex(kind=c_double_complex),   value,              intent(in)    :: sigma
54  complex(kind=c_double_complex),   dimension(2*ncv),   intent(out)   :: workev
55  character(kind=c_char),                               intent(in)    :: bmat
56  integer(kind=i_int),              value,              intent(in)    :: n
57  character(kind=c_char),           dimension(2),       intent(in)    :: which
58  integer(kind=i_int),              value,              intent(in)    :: nev
59  real(kind=c_double),              value,              intent(in)    :: tol
60  complex(kind=c_double_complex),   dimension(n),       intent(inout) :: resid
61  integer(kind=i_int),              value,              intent(in)    :: ncv
62  complex(kind=c_double_complex),   dimension(ldv, ncv),intent(out)   :: v
63  integer(kind=i_int),              value,              intent(in)    :: ldv
64  integer(kind=i_int),              dimension(11),      intent(inout) :: iparam
65  integer(kind=i_int),              dimension(14),      intent(out)   :: ipntr
66  complex(kind=c_double_complex),   dimension(3*n),     intent(out)   :: workd
67  complex(kind=c_double_complex),   dimension(lworkl),  intent(out)   :: workl
68  integer(kind=i_int),              value,              intent(in)    :: lworkl
69  complex(kind=c_double_complex),   dimension(ncv),     intent(out)   :: rwork
70  integer(kind=i_int),                                  intent(inout) :: info
71
72  ! convert parameters if needed.
73
74  logical :: rv
75  logical, dimension(ncv) :: slt
76  integer :: idx
77  character(len=2):: w
78  integer         :: i
79
80  rv = .false.
81  if (rvec .ne. 0) rv = .true.
82
83  slt = .false.
84  do idx=1, ncv
85    if (select(idx) .ne. 0) slt(idx) = .true.
86  enddo
87
88  do i =1,2
89      w(i:i) = which(i)
90  end do
91
92  ! call arpack.
93
94  call pzneupd(comm, rv, howmny, slt, d, z, ldz, sigma, workev,&
95               bmat, n, w, nev, tol, resid, ncv, v, ldv,   &
96               iparam, ipntr, workd, workl, lworkl, rwork, info)
97end subroutine pzneupd_c
98