|
|
@ -307,7 +307,7 @@ contains
|
|
|
|
real(psb_spk_) :: weight
|
|
|
|
real(psb_spk_) :: weight
|
|
|
|
integer(psb_ipk_), allocatable :: idxs(:)
|
|
|
|
integer(psb_ipk_), allocatable :: idxs(:)
|
|
|
|
complex(psb_spk_), allocatable :: row(:)
|
|
|
|
complex(psb_spk_), allocatable :: row(:)
|
|
|
|
type(psb_int_heap) :: heap
|
|
|
|
type(psb_i_heap) :: heap
|
|
|
|
type(psb_c_coo_sparse_mat) :: trw
|
|
|
|
type(psb_c_coo_sparse_mat) :: trw
|
|
|
|
character(len=20), parameter :: name='mld_cilut_factint'
|
|
|
|
character(len=20), parameter :: name='mld_cilut_factint'
|
|
|
|
character(len=20) :: ch_err
|
|
|
|
character(len=20) :: ch_err
|
|
|
@ -517,7 +517,7 @@ contains
|
|
|
|
real(psb_spk_), intent(inout) :: nrmi
|
|
|
|
real(psb_spk_), intent(inout) :: nrmi
|
|
|
|
complex(psb_spk_), intent(inout) :: row(:)
|
|
|
|
complex(psb_spk_), intent(inout) :: row(:)
|
|
|
|
real(psb_spk_), intent(in) :: weight
|
|
|
|
real(psb_spk_), intent(in) :: weight
|
|
|
|
type(psb_int_heap), intent(inout) :: heap
|
|
|
|
type(psb_i_heap), intent(inout) :: heap
|
|
|
|
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: k,j,irb,kin,nz
|
|
|
|
integer(psb_ipk_) :: k,j,irb,kin,nz
|
|
|
|
integer(psb_ipk_), parameter :: nrb=40
|
|
|
|
integer(psb_ipk_), parameter :: nrb=40
|
|
|
@ -529,7 +529,7 @@ contains
|
|
|
|
info = psb_success_
|
|
|
|
info = psb_success_
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
|
|
|
|
|
|
|
call psb_init_heap(heap,info)
|
|
|
|
call heap%init(info)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
call psb_errpush(info,name,a_err='psb_init_heap')
|
|
|
|
call psb_errpush(info,name,a_err='psb_init_heap')
|
|
|
@ -559,7 +559,7 @@ contains
|
|
|
|
k = aa%ja(j)
|
|
|
|
k = aa%ja(j)
|
|
|
|
if ((jmin<=k).and.(k<=jmax)) then
|
|
|
|
if ((jmin<=k).and.(k<=jmax)) then
|
|
|
|
row(k) = aa%val(j)*weight
|
|
|
|
row(k) = aa%val(j)*weight
|
|
|
|
call psb_insert_heap(k,heap,info)
|
|
|
|
call heap%insert(k,info)
|
|
|
|
if (info /= psb_success_) exit
|
|
|
|
if (info /= psb_success_) exit
|
|
|
|
if (k<jd) nlw = nlw + 1
|
|
|
|
if (k<jd) nlw = nlw + 1
|
|
|
|
if (k>jd) then
|
|
|
|
if (k>jd) then
|
|
|
@ -610,7 +610,7 @@ contains
|
|
|
|
k = trw%ja(ktrw)
|
|
|
|
k = trw%ja(ktrw)
|
|
|
|
if ((jmin<=k).and.(k<=jmax)) then
|
|
|
|
if ((jmin<=k).and.(k<=jmax)) then
|
|
|
|
row(k) = trw%val(ktrw)*weight
|
|
|
|
row(k) = trw%val(ktrw)*weight
|
|
|
|
call psb_insert_heap(k,heap,info)
|
|
|
|
call heap%insert(k,info)
|
|
|
|
if (info /= psb_success_) exit
|
|
|
|
if (info /= psb_success_) exit
|
|
|
|
if (k<jd) nlw = nlw + 1
|
|
|
|
if (k<jd) nlw = nlw + 1
|
|
|
|
if (k>jd) then
|
|
|
|
if (k>jd) then
|
|
|
@ -662,7 +662,7 @@ contains
|
|
|
|
! 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.
|
|
|
|
! it contains also the zero entries of the row.
|
|
|
|
! it contains also the zero entries of the row.
|
|
|
|
! heap - type(psb_int_heap), input/output.
|
|
|
|
! heap - type(psb_i_heap), input/output.
|
|
|
|
! The heap containing the column indices of the nonzero entries
|
|
|
|
! The heap containing the column indices of the nonzero entries
|
|
|
|
! in the processed row. In input it contains the indices concerning
|
|
|
|
! in the processed row. In input it contains the indices concerning
|
|
|
|
! the row before the elimination step, while in output it contains
|
|
|
|
! the row before the elimination step, while in output it contains
|
|
|
@ -702,10 +702,10 @@ contains
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
|
! Arguments
|
|
|
|
! Arguments
|
|
|
|
type(psb_int_heap), intent(inout) :: heap
|
|
|
|
type(psb_i_heap), intent(inout) :: heap
|
|
|
|
integer(psb_ipk_), intent(in) :: i
|
|
|
|
integer(psb_ipk_), intent(in) :: i
|
|
|
|
integer(psb_ipk_), intent(inout) :: nidx,info
|
|
|
|
integer(psb_ipk_), intent(inout) :: nidx,info
|
|
|
|
real(psb_spk_), intent(in) :: thres,nrmi
|
|
|
|
real(psb_spk_), intent(in) :: thres,nrmi
|
|
|
|
integer(psb_ipk_), allocatable, intent(inout) :: idxs(:)
|
|
|
|
integer(psb_ipk_), allocatable, intent(inout) :: idxs(:)
|
|
|
|
integer(psb_ipk_), intent(inout) :: uja(:),uirp(:)
|
|
|
|
integer(psb_ipk_), intent(inout) :: uja(:),uirp(:)
|
|
|
|
complex(psb_spk_), intent(inout) :: row(:), uval(:),d(:)
|
|
|
|
complex(psb_spk_), intent(inout) :: row(:), uval(:),d(:)
|
|
|
@ -724,7 +724,7 @@ contains
|
|
|
|
!
|
|
|
|
!
|
|
|
|
do
|
|
|
|
do
|
|
|
|
|
|
|
|
|
|
|
|
call psb_heap_get_first(k,heap,iret)
|
|
|
|
call heap%get_first(k,iret)
|
|
|
|
if (iret < 0) exit
|
|
|
|
if (iret < 0) exit
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -772,7 +772,7 @@ contains
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Do the insertion.
|
|
|
|
! Do the insertion.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
call psb_insert_heap(j,heap,info)
|
|
|
|
call heap%insert(j,info)
|
|
|
|
if (info /= psb_success_) return
|
|
|
|
if (info /= psb_success_) return
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
end do
|
|
|
|
end do
|
|
|
@ -903,7 +903,7 @@ contains
|
|
|
|
complex(psb_spk_) :: witem
|
|
|
|
complex(psb_spk_) :: witem
|
|
|
|
integer(psb_ipk_) :: widx
|
|
|
|
integer(psb_ipk_) :: widx
|
|
|
|
integer(psb_ipk_) :: k,isz,err_act,int_err(5),idxp, nz
|
|
|
|
integer(psb_ipk_) :: k,isz,err_act,int_err(5),idxp, nz
|
|
|
|
type(psb_scomplex_idx_heap) :: heap
|
|
|
|
type(psb_c_idx_heap) :: heap
|
|
|
|
character(len=20), parameter :: name='ilut_copyout'
|
|
|
|
character(len=20), parameter :: name='ilut_copyout'
|
|
|
|
character(len=20) :: ch_err
|
|
|
|
character(len=20) :: ch_err
|
|
|
|
logical :: fndmaxup
|
|
|
|
logical :: fndmaxup
|
|
|
@ -921,7 +921,7 @@ contains
|
|
|
|
! is the largest absolute value.
|
|
|
|
! is the largest absolute value.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
|
|
|
|
|
|
|
|
call psb_init_heap(heap,info,dir=psb_asort_down_)
|
|
|
|
call heap%init(info,dir=psb_asort_down_)
|
|
|
|
|
|
|
|
|
|
|
|
if (info == psb_success_) allocate(xwid(nidx),xw(nidx),indx(nidx),stat=info)
|
|
|
|
if (info == psb_success_) allocate(xwid(nidx),xw(nidx),indx(nidx),stat=info)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
@ -953,7 +953,7 @@ contains
|
|
|
|
nz = nz + 1
|
|
|
|
nz = nz + 1
|
|
|
|
xw(nz) = witem
|
|
|
|
xw(nz) = witem
|
|
|
|
xwid(nz) = widx
|
|
|
|
xwid(nz) = widx
|
|
|
|
call psb_insert_heap(witem,widx,heap,info)
|
|
|
|
call heap%insert(witem,widx,info)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
call psb_errpush(info,name,a_err='psb_insert_heap')
|
|
|
|
call psb_errpush(info,name,a_err='psb_insert_heap')
|
|
|
@ -971,7 +971,7 @@ contains
|
|
|
|
else
|
|
|
|
else
|
|
|
|
nz = nlw+fill_in
|
|
|
|
nz = nlw+fill_in
|
|
|
|
do k=1,nz
|
|
|
|
do k=1,nz
|
|
|
|
call psb_heap_get_first(witem,widx,heap,info)
|
|
|
|
call heap%get_first(witem,widx,info)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
call psb_errpush(info,name,a_err='psb_heap_get_first')
|
|
|
|
call psb_errpush(info,name,a_err='psb_heap_get_first')
|
|
|
@ -1058,7 +1058,7 @@ contains
|
|
|
|
! Now the upper part
|
|
|
|
! Now the upper part
|
|
|
|
!
|
|
|
|
!
|
|
|
|
|
|
|
|
|
|
|
|
call psb_init_heap(heap,info,dir=psb_asort_down_)
|
|
|
|
call heap%init(info,dir=psb_asort_down_)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
call psb_errpush(info,name,a_err='psb_init_heap')
|
|
|
|
call psb_errpush(info,name,a_err='psb_init_heap')
|
|
|
@ -1090,7 +1090,7 @@ contains
|
|
|
|
nz = nz + 1
|
|
|
|
nz = nz + 1
|
|
|
|
xw(nz) = witem
|
|
|
|
xw(nz) = witem
|
|
|
|
xwid(nz) = widx
|
|
|
|
xwid(nz) = widx
|
|
|
|
call psb_insert_heap(witem,widx,heap,info)
|
|
|
|
call heap%insert(witem,widx,info)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
call psb_errpush(info,name,a_err='psb_insert_heap')
|
|
|
|
call psb_errpush(info,name,a_err='psb_insert_heap')
|
|
|
@ -1112,7 +1112,7 @@ contains
|
|
|
|
fndmaxup = .false.
|
|
|
|
fndmaxup = .false.
|
|
|
|
nz = nup+fill_in
|
|
|
|
nz = nup+fill_in
|
|
|
|
do k=1,nz
|
|
|
|
do k=1,nz
|
|
|
|
call psb_heap_get_first(witem,widx,heap,info)
|
|
|
|
call heap%get_first(witem,widx,info)
|
|
|
|
xw(k) = witem
|
|
|
|
xw(k) = witem
|
|
|
|
xwid(k) = widx
|
|
|
|
xwid(k) = widx
|
|
|
|
if (widx == jmaxup) fndmaxup=.true.
|
|
|
|
if (widx == jmaxup) fndmaxup=.true.
|
|
|
|