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