2 #include "sll_working_precision.h"
3 #include "sll_memory.h"
4 use,
intrinsic :: iso_c_binding
10 integer(kind=C_INT) :: num_rows
11 integer(kind=C_INT) :: num_cols
12 integer(kind=C_INT) :: num_nz
13 integer(kind=C_INT),
pointer :: row_ptr(:)
14 integer(kind=C_INT),
pointer :: col_ind(:)
15 real(kind=c_double),
pointer :: val(:)
28 mformat, preconditioner, &
29 pformat, rows, cols, &
30 rval, rhs, atol, rtol, &
31 div, maxiter, basis, &
32 p, q, x, iter, resnorm, &
35 use,
intrinsic :: iso_c_binding, only: c_int, c_ptr, c_double, c_char
37 integer(kind=C_INT),
value,
intent(in) :: n, m, nnz, maxiter, basis, p, q
38 real(kind=c_double),
value,
intent(in) :: atol, rtol, div
39 integer(kind=C_INT),
intent(out) :: iter, ierr
40 real(kind=c_double),
intent(out) :: resnorm
41 type(c_ptr),
value,
intent(in) :: rows, cols, rval, rhs
42 type(c_ptr),
value :: x
43 character(kind=C_CHAR) :: solver
44 character(kind=C_CHAR) :: mformat
45 character(kind=C_CHAR) :: preconditioner
46 character(kind=C_CHAR) :: pformat
73 sll_int32,
intent(in) :: n
74 sll_int32,
intent(in) :: nnz
81 sll_allocate(self%val(nnz), error)
82 sll_allocate(self%col_ind(nnz), error)
83 sll_allocate(self%row_ptr(n + 1), error)
99 real(kind=c_double),
target ::
sol(:)
100 real(kind=c_double),
target :: rhs(:)
102 integer(kind=C_INT) :: iter
103 integer(kind=C_INT) :: ierr
104 real(kind=c_double) :: resnorm
114 'CSR'//c_null_char, &
115 'MultiColoredILU'//c_null_char, &
116 'CSR'//c_null_char, &
117 c_loc(self%row_ptr(1)), &
118 c_loc(self%col_ind(1)), &
119 c_loc(self%val(1)), &
134 if (ierr .eq. 0)
then
135 write (*, fmt=
'(A,I0,A,E12.5,A)')
'(Fortran) Solver took ', iter,
' iterations with residual norm ', resnorm,
'.'
137 write (*, fmt=
'(A,I0)')
'(Fortran) Solver returned status code ', ierr
subroutine solve_paralution_with_rhs(self, rhs, sol)
subroutine factorize_paralution(self)
subroutine free_paralution(self)
subroutine init_paralution(self, n, nnz)
subroutine sol(vkgs, vkgd, vkgi, vfg, kld, vu, neq, mp, ifac, isol, nsym, energ, ier, nsky)