|
|
@ -78,7 +78,7 @@
|
|
|
|
! The U factor (except its diagonal) in the incomplete factorization.
|
|
|
|
! The U factor (except its diagonal) in the incomplete factorization.
|
|
|
|
! Note: its allocation is managed by the calling routine mld_ilu_bld,
|
|
|
|
! Note: its allocation is managed by the calling routine mld_ilu_bld,
|
|
|
|
! hence it cannot be only intent(out).
|
|
|
|
! hence it cannot be only intent(out).
|
|
|
|
! d - complex(kind(1.d0)), dimension(:), input/output.
|
|
|
|
! d - complex(psb_dpk_), dimension(:), input/output.
|
|
|
|
! The inverse of the diagonal entries of the U factor in the incomplete
|
|
|
|
! The inverse of the diagonal entries of the U factor in the incomplete
|
|
|
|
! factorization.
|
|
|
|
! factorization.
|
|
|
|
! Note: its allocation is managed by the calling routine mld_ilu_bld,
|
|
|
|
! Note: its allocation is managed by the calling routine mld_ilu_bld,
|
|
|
@ -101,11 +101,11 @@ subroutine mld_zilut_fact(fill_in,thres,a,l,u,d,info,blck)
|
|
|
|
|
|
|
|
|
|
|
|
! Arguments
|
|
|
|
! Arguments
|
|
|
|
integer, intent(in) :: fill_in
|
|
|
|
integer, intent(in) :: fill_in
|
|
|
|
real(kind(1.d0)), intent(in) :: thres
|
|
|
|
real(psb_dpk_), intent(in) :: thres
|
|
|
|
integer, intent(out) :: info
|
|
|
|
integer, intent(out) :: info
|
|
|
|
type(psb_zspmat_type),intent(in) :: a
|
|
|
|
type(psb_zspmat_type),intent(in) :: a
|
|
|
|
type(psb_zspmat_type),intent(inout) :: l,u
|
|
|
|
type(psb_zspmat_type),intent(inout) :: l,u
|
|
|
|
complex(kind(1.d0)), intent(inout) :: d(:)
|
|
|
|
complex(psb_dpk_), intent(inout) :: d(:)
|
|
|
|
type(psb_zspmat_type),intent(in), optional, target :: blck
|
|
|
|
type(psb_zspmat_type),intent(in), optional, target :: blck
|
|
|
|
|
|
|
|
|
|
|
|
! Local Variables
|
|
|
|
! Local Variables
|
|
|
@ -238,10 +238,10 @@ contains
|
|
|
|
! to build an Additive Schwarz base preconditioner with overlap
|
|
|
|
! to build an Additive Schwarz base preconditioner with overlap
|
|
|
|
! greater than 0. If the overlap is 0 or the matrix has been reordered
|
|
|
|
! greater than 0. If the overlap is 0 or the matrix has been reordered
|
|
|
|
! (see mld_fact_bld), then b does not contain any row.
|
|
|
|
! (see mld_fact_bld), then b does not contain any row.
|
|
|
|
! d - complex(kind(1.d0)), dimension(:), output.
|
|
|
|
! d - complex(psb_dpk_), dimension(:), output.
|
|
|
|
! The inverse of the diagonal entries of the U factor in the incomplete
|
|
|
|
! The inverse of the diagonal entries of the U factor in the incomplete
|
|
|
|
! factorization.
|
|
|
|
! factorization.
|
|
|
|
! laspk - complex(kind(1.d0)), dimension(:), input/output.
|
|
|
|
! laspk - complex(psb_dpk_), dimension(:), input/output.
|
|
|
|
! The L factor in the incomplete factorization.
|
|
|
|
! The L factor in the incomplete factorization.
|
|
|
|
! lia1 - integer, dimension(:), input/output.
|
|
|
|
! lia1 - integer, dimension(:), input/output.
|
|
|
|
! The column indices of the nonzero entries of the L factor,
|
|
|
|
! The column indices of the nonzero entries of the L factor,
|
|
|
@ -249,7 +249,7 @@ contains
|
|
|
|
! lia2 - integer, dimension(:), input/output.
|
|
|
|
! lia2 - integer, dimension(:), input/output.
|
|
|
|
! The indices identifying the first nonzero entry of each row
|
|
|
|
! The indices identifying the first nonzero entry of each row
|
|
|
|
! of the L factor in laspk, according to the CSR storage format.
|
|
|
|
! of the L factor in laspk, according to the CSR storage format.
|
|
|
|
! uaspk - complex(kind(1.d0)), dimension(:), input/output.
|
|
|
|
! uaspk - complex(psb_dpk_), dimension(:), input/output.
|
|
|
|
! The U factor in the incomplete factorization.
|
|
|
|
! The U factor in the incomplete factorization.
|
|
|
|
! The entries of U are stored according to the CSR format.
|
|
|
|
! The entries of U are stored according to the CSR format.
|
|
|
|
! uia1 - integer, dimension(:), input/output.
|
|
|
|
! uia1 - integer, dimension(:), input/output.
|
|
|
@ -274,18 +274,18 @@ contains
|
|
|
|
|
|
|
|
|
|
|
|
! Arguments
|
|
|
|
! Arguments
|
|
|
|
integer, intent(in) :: fill_in
|
|
|
|
integer, intent(in) :: fill_in
|
|
|
|
real(kind(1.d0)), intent(in) :: thres
|
|
|
|
real(psb_dpk_), intent(in) :: thres
|
|
|
|
type(psb_zspmat_type), intent(in) :: a,b
|
|
|
|
type(psb_zspmat_type), intent(in) :: a,b
|
|
|
|
integer, intent(inout) :: m,l1,l2,info
|
|
|
|
integer, intent(inout) :: m,l1,l2,info
|
|
|
|
integer, allocatable, intent(inout) :: lia1(:),lia2(:),uia1(:),uia2(:)
|
|
|
|
integer, allocatable, intent(inout) :: lia1(:),lia2(:),uia1(:),uia2(:)
|
|
|
|
complex(kind(1.d0)), allocatable, intent(inout) :: laspk(:),uaspk(:)
|
|
|
|
complex(psb_dpk_), allocatable, intent(inout) :: laspk(:),uaspk(:)
|
|
|
|
complex(kind(1.d0)), intent(inout) :: d(:)
|
|
|
|
complex(psb_dpk_), intent(inout) :: d(:)
|
|
|
|
|
|
|
|
|
|
|
|
! Local Variables
|
|
|
|
! Local Variables
|
|
|
|
integer :: i, ktrw,err_act,nidx,nlw,nup,jmaxup, ma, mb
|
|
|
|
integer :: i, ktrw,err_act,nidx,nlw,nup,jmaxup, ma, mb
|
|
|
|
real(kind(1.d0)) :: nrmi
|
|
|
|
real(psb_dpk_) :: nrmi
|
|
|
|
integer, allocatable :: idxs(:)
|
|
|
|
integer, allocatable :: idxs(:)
|
|
|
|
complex(kind(1.d0)), allocatable :: row(:)
|
|
|
|
complex(psb_dpk_), allocatable :: row(:)
|
|
|
|
type(psb_int_heap) :: heap
|
|
|
|
type(psb_int_heap) :: heap
|
|
|
|
type(psb_zspmat_type) :: trw
|
|
|
|
type(psb_zspmat_type) :: trw
|
|
|
|
character(len=20), parameter :: name='mld_zilut_factint'
|
|
|
|
character(len=20), parameter :: name='mld_zilut_factint'
|
|
|
@ -451,9 +451,9 @@ contains
|
|
|
|
! jmaxup - integer, output.
|
|
|
|
! jmaxup - integer, output.
|
|
|
|
! The column index of the first entry with maximum absolute
|
|
|
|
! The column index of the first entry with maximum absolute
|
|
|
|
! value in the part of the row belonging to the upper triangle
|
|
|
|
! value in the part of the row belonging to the upper triangle
|
|
|
|
! nrmi - real(kind(1.d0)), output.
|
|
|
|
! nrmi - real(psb_dpk_), output.
|
|
|
|
! The 2-norm of the current row.
|
|
|
|
! The 2-norm of the current row.
|
|
|
|
! row - complex(kind(1.d0)), dimension(:), input/output.
|
|
|
|
! row - complex(psb_dpk_), dimension(:), input/output.
|
|
|
|
! In input it is the null vector (see mld_ilut_factint and
|
|
|
|
! In input it is the null vector (see mld_ilut_factint and
|
|
|
|
! ilut_copyout). In output it contains the row extracted
|
|
|
|
! ilut_copyout). In output it contains the row extracted
|
|
|
|
! from the matrix A. It actually contains a full row, i.e.
|
|
|
|
! from the matrix A. It actually contains a full row, i.e.
|
|
|
@ -486,14 +486,14 @@ contains
|
|
|
|
type(psb_zspmat_type), intent(inout) :: trw
|
|
|
|
type(psb_zspmat_type), intent(inout) :: trw
|
|
|
|
integer, intent(in) :: i, m,jmin,jmax,jd
|
|
|
|
integer, intent(in) :: i, m,jmin,jmax,jd
|
|
|
|
integer, intent(inout) :: ktrw,nlw,nup,jmaxup,info
|
|
|
|
integer, intent(inout) :: ktrw,nlw,nup,jmaxup,info
|
|
|
|
real(kind(1.d0)), intent(inout) :: nrmi
|
|
|
|
real(psb_dpk_), intent(inout) :: nrmi
|
|
|
|
complex(kind(1.d0)), intent(inout) :: row(:)
|
|
|
|
complex(psb_dpk_), intent(inout) :: row(:)
|
|
|
|
type(psb_int_heap), intent(inout) :: heap
|
|
|
|
type(psb_int_heap), intent(inout) :: heap
|
|
|
|
|
|
|
|
|
|
|
|
integer :: k,j,irb,kin,nz
|
|
|
|
integer :: k,j,irb,kin,nz
|
|
|
|
integer, parameter :: nrb=16
|
|
|
|
integer, parameter :: nrb=16
|
|
|
|
real(kind(1.d0)) :: dmaxup
|
|
|
|
real(psb_dpk_) :: dmaxup
|
|
|
|
real(kind(1.d0)), external :: dznrm2
|
|
|
|
real(psb_dpk_), external :: dznrm2
|
|
|
|
character(len=20), parameter :: name='mld_zilut_factint'
|
|
|
|
character(len=20), parameter :: name='mld_zilut_factint'
|
|
|
|
|
|
|
|
|
|
|
|
if (psb_get_errstatus() /= 0) return
|
|
|
|
if (psb_get_errstatus() /= 0) return
|
|
|
@ -628,10 +628,10 @@ contains
|
|
|
|
! The threshold t, i.e. the drop tolerance, in ILU(k,t).
|
|
|
|
! The threshold t, i.e. the drop tolerance, in ILU(k,t).
|
|
|
|
! i - integer, input.
|
|
|
|
! i - integer, input.
|
|
|
|
! The local index of the row to which the factorization is applied.
|
|
|
|
! The local index of the row to which the factorization is applied.
|
|
|
|
! nrmi - real(kind(1.d0)), input.
|
|
|
|
! nrmi - real(psb_dpk_), input.
|
|
|
|
! The 2-norm of the row to which the elimination step has to be
|
|
|
|
! The 2-norm of the row to which the elimination step has to be
|
|
|
|
! applied.
|
|
|
|
! applied.
|
|
|
|
! row - complex(kind(1.d0)), dimension(:), input/output.
|
|
|
|
! row - complex(psb_dpk_), dimension(:), input/output.
|
|
|
|
! In input it contains the row to which the elimination step
|
|
|
|
! In input it contains the row to which the elimination step
|
|
|
|
! has to be applied. In output it contains the row after the
|
|
|
|
! has to be applied. In output it contains the row after the
|
|
|
|
! elimination step. It actually contains a full row, i.e.
|
|
|
|
! elimination step. It actually contains a full row, i.e.
|
|
|
@ -642,7 +642,7 @@ contains
|
|
|
|
! the row before the elimination step, while in output it contains
|
|
|
|
! the row before the elimination step, while in output it contains
|
|
|
|
! the previous indices plus the ones corresponding to transformed
|
|
|
|
! the previous indices plus the ones corresponding to transformed
|
|
|
|
! entries in the 'upper part' that have not been dropped.
|
|
|
|
! entries in the 'upper part' that have not been dropped.
|
|
|
|
! d - complex(kind(1.d0)), input.
|
|
|
|
! d - complex(psb_dpk_), input.
|
|
|
|
! The inverse of the diagonal entries of the part of the U factor
|
|
|
|
! The inverse of the diagonal entries of the part of the U factor
|
|
|
|
! above the current row (see ilut_copyout).
|
|
|
|
! above the current row (see ilut_copyout).
|
|
|
|
! uia1 - integer, dimension(:), input.
|
|
|
|
! uia1 - integer, dimension(:), input.
|
|
|
@ -655,7 +655,7 @@ contains
|
|
|
|
! the U factor above the current row, stored in uaspk row by row
|
|
|
|
! the U factor above the current row, stored in uaspk row by row
|
|
|
|
! (see ilut_copyout, called by mld_zilut_factint), according to
|
|
|
|
! (see ilut_copyout, called by mld_zilut_factint), according to
|
|
|
|
! the CSR storage format.
|
|
|
|
! the CSR storage format.
|
|
|
|
! uaspk - complex(kind(1.d0)), dimension(:), input.
|
|
|
|
! uaspk - complex(psb_dpk_), dimension(:), input.
|
|
|
|
! The entries of the U factor above the current row (except the
|
|
|
|
! The entries of the U factor above the current row (except the
|
|
|
|
! diagonal ones), stored according to the CSR format.
|
|
|
|
! diagonal ones), stored according to the CSR format.
|
|
|
|
! nidx - integer, output.
|
|
|
|
! nidx - integer, output.
|
|
|
@ -679,14 +679,14 @@ contains
|
|
|
|
type(psb_int_heap), intent(inout) :: heap
|
|
|
|
type(psb_int_heap), intent(inout) :: heap
|
|
|
|
integer, intent(in) :: i
|
|
|
|
integer, intent(in) :: i
|
|
|
|
integer, intent(inout) :: nidx,info
|
|
|
|
integer, intent(inout) :: nidx,info
|
|
|
|
real(kind(1.d0)), intent(in) :: thres,nrmi
|
|
|
|
real(psb_dpk_), intent(in) :: thres,nrmi
|
|
|
|
integer, allocatable, intent(inout) :: idxs(:)
|
|
|
|
integer, allocatable, intent(inout) :: idxs(:)
|
|
|
|
integer, intent(inout) :: uia1(:),uia2(:)
|
|
|
|
integer, intent(inout) :: uia1(:),uia2(:)
|
|
|
|
complex(kind(1.d0)), intent(inout) :: row(:), uaspk(:),d(:)
|
|
|
|
complex(psb_dpk_), intent(inout) :: row(:), uaspk(:),d(:)
|
|
|
|
|
|
|
|
|
|
|
|
! Local Variables
|
|
|
|
! Local Variables
|
|
|
|
integer :: k,j,jj,lastk, iret
|
|
|
|
integer :: k,j,jj,lastk, iret
|
|
|
|
complex(kind(1.d0)) :: rwk
|
|
|
|
complex(psb_dpk_) :: rwk
|
|
|
|
|
|
|
|
|
|
|
|
info = 0
|
|
|
|
info = 0
|
|
|
|
call psb_ensure_size(200,idxs,info)
|
|
|
|
call psb_ensure_size(200,idxs,info)
|
|
|
@ -811,9 +811,9 @@ contains
|
|
|
|
! jmaxup - integer, input.
|
|
|
|
! jmaxup - integer, input.
|
|
|
|
! The column index of the first entry with maximum absolute
|
|
|
|
! The column index of the first entry with maximum absolute
|
|
|
|
! value in the 'upper part' of the row in the initial matrix.
|
|
|
|
! value in the 'upper part' of the row in the initial matrix.
|
|
|
|
! nrmi - real(kind(1.d0)), input.
|
|
|
|
! nrmi - real(psb_dpk_), input.
|
|
|
|
! The 2-norm of the current row in the initial matrix.
|
|
|
|
! The 2-norm of the current row in the initial matrix.
|
|
|
|
! row - complex(kind(1.d0)), dimension(:), input/output.
|
|
|
|
! row - complex(psb_dpk_), dimension(:), input/output.
|
|
|
|
! It contains, input, the row to be copied, and, in output,
|
|
|
|
! It contains, input, the row to be copied, and, in output,
|
|
|
|
! the null vector (the latter is used in the next call to
|
|
|
|
! the null vector (the latter is used in the next call to
|
|
|
|
! ilut_copyin in mld_ilut_fact).
|
|
|
|
! ilut_copyin in mld_ilut_fact).
|
|
|
@ -836,10 +836,10 @@ contains
|
|
|
|
! The indices identifying the first nonzero entry of each row
|
|
|
|
! The indices identifying the first nonzero entry of each row
|
|
|
|
! of the L factor, copied in laspk row by row (see
|
|
|
|
! of the L factor, copied in laspk row by row (see
|
|
|
|
! mld_zilut_factint), according to the CSR storage format.
|
|
|
|
! mld_zilut_factint), according to the CSR storage format.
|
|
|
|
! laspk - complex(kind(1.d0)), dimension(:), input/output.
|
|
|
|
! laspk - complex(psb_dpk_), dimension(:), input/output.
|
|
|
|
! The array where the entries of the row corresponding to the
|
|
|
|
! The array where the entries of the row corresponding to the
|
|
|
|
! L factor are copied.
|
|
|
|
! L factor are copied.
|
|
|
|
! d - complex(kind(1.d0)), dimension(:), input/output.
|
|
|
|
! d - complex(psb_dpk_), dimension(:), input/output.
|
|
|
|
! The array where the inverse of the diagonal entry of the
|
|
|
|
! The array where the inverse of the diagonal entry of the
|
|
|
|
! row is copied (only d(i) is used by the routine).
|
|
|
|
! row is copied (only d(i) is used by the routine).
|
|
|
|
! uia1 - integer, dimension(:), input/output.
|
|
|
|
! uia1 - integer, dimension(:), input/output.
|
|
|
@ -850,7 +850,7 @@ contains
|
|
|
|
! The indices identifying the first nonzero entry of each row
|
|
|
|
! The indices identifying the first nonzero entry of each row
|
|
|
|
! of the U factor copied in uaspk row by row (see
|
|
|
|
! of the U factor copied in uaspk row by row (see
|
|
|
|
! mld_zilu_fctint), according to the CSR storage format.
|
|
|
|
! mld_zilu_fctint), according to the CSR storage format.
|
|
|
|
! uaspk - complex(kind(1.d0)), dimension(:), input/output.
|
|
|
|
! uaspk - complex(psb_dpk_), dimension(:), input/output.
|
|
|
|
! The array where the entries of the row corresponding to the
|
|
|
|
! The array where the entries of the row corresponding to the
|
|
|
|
! U factor are copied.
|
|
|
|
! U factor are copied.
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -866,14 +866,14 @@ contains
|
|
|
|
integer, intent(in) :: idxs(:)
|
|
|
|
integer, intent(in) :: idxs(:)
|
|
|
|
integer, intent(inout) :: l1,l2, info
|
|
|
|
integer, intent(inout) :: l1,l2, info
|
|
|
|
integer, allocatable, intent(inout) :: uia1(:),uia2(:), lia1(:),lia2(:)
|
|
|
|
integer, allocatable, intent(inout) :: uia1(:),uia2(:), lia1(:),lia2(:)
|
|
|
|
real(kind(1.d0)), intent(in) :: thres,nrmi
|
|
|
|
real(psb_dpk_), intent(in) :: thres,nrmi
|
|
|
|
complex(kind(1.d0)),allocatable, intent(inout) :: uaspk(:), laspk(:)
|
|
|
|
complex(psb_dpk_),allocatable, intent(inout) :: uaspk(:), laspk(:)
|
|
|
|
complex(kind(1.d0)), intent(inout) :: row(:), d(:)
|
|
|
|
complex(psb_dpk_), intent(inout) :: row(:), d(:)
|
|
|
|
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
! Local variables
|
|
|
|
complex(kind(1.d0)),allocatable :: xw(:)
|
|
|
|
complex(psb_dpk_),allocatable :: xw(:)
|
|
|
|
integer, allocatable :: xwid(:), indx(:)
|
|
|
|
integer, allocatable :: xwid(:), indx(:)
|
|
|
|
complex(kind(1.d0)) :: witem
|
|
|
|
complex(psb_dpk_) :: witem
|
|
|
|
integer :: widx
|
|
|
|
integer :: widx
|
|
|
|
integer :: k,isz,err_act,int_err(5),idxp, nz
|
|
|
|
integer :: k,isz,err_act,int_err(5),idxp, nz
|
|
|
|
type(psb_dcomplex_idx_heap) :: heap
|
|
|
|
type(psb_dcomplex_idx_heap) :: heap
|
|
|
@ -900,7 +900,7 @@ contains
|
|
|
|
if (info /= 0) then
|
|
|
|
if (info /= 0) then
|
|
|
|
info=4025
|
|
|
|
info=4025
|
|
|
|
call psb_errpush(info,name,i_err=(/3*nidx,0,0,0,0/),&
|
|
|
|
call psb_errpush(info,name,i_err=(/3*nidx,0,0,0,0/),&
|
|
|
|
& a_err='complex(kind(1.d0))')
|
|
|
|
& a_err='complex(psb_dpk_)')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|