|
|
@ -16,7 +16,21 @@ subroutine psb_dneigh(a,idx,neigh,n,info,lev)
|
|
|
|
integer, pointer :: neigh(:) ! the neighbours
|
|
|
|
integer, pointer :: neigh(:) ! the neighbours
|
|
|
|
integer, optional :: lev ! level of neighbours to find
|
|
|
|
integer, optional :: lev ! level of neighbours to find
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface psb_spgtrow
|
|
|
|
|
|
|
|
subroutine psb_dspgtrow(irw,a,b,info,append,iren,lrw)
|
|
|
|
|
|
|
|
use psb_spmat_type
|
|
|
|
|
|
|
|
type(psb_dspmat_type), intent(in) :: a
|
|
|
|
|
|
|
|
integer, intent(in) :: irw
|
|
|
|
|
|
|
|
type(psb_dspmat_type), intent(inout) :: b
|
|
|
|
|
|
|
|
logical, intent(in), optional :: append
|
|
|
|
|
|
|
|
integer, intent(in), target, optional :: iren(:)
|
|
|
|
|
|
|
|
integer, intent(in), optional :: lrw
|
|
|
|
|
|
|
|
integer, intent(out) :: info
|
|
|
|
|
|
|
|
end subroutine psb_dspgtrow
|
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type(psb_dspmat_type) :: atmp
|
|
|
|
|
|
|
|
integer, pointer :: tmpn(:)
|
|
|
|
integer :: level, dim, i, j, k, r, c, brow,&
|
|
|
|
integer :: level, dim, i, j, k, r, c, brow,&
|
|
|
|
& elem_pt, ii, n1, col_idx, ne, err_act
|
|
|
|
& elem_pt, ii, n1, col_idx, ne, err_act
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
@ -25,12 +39,6 @@ subroutine psb_dneigh(a,idx,neigh,n,info,lev)
|
|
|
|
info = 0
|
|
|
|
info = 0
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
|
|
|
|
|
|
|
if ((a%fida /= 'CSR')) then
|
|
|
|
|
|
|
|
info=135
|
|
|
|
|
|
|
|
ch_err=a%fida(1:3)
|
|
|
|
|
|
|
|
call psb_errpush(info,name,a_err=ch_err)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
n = 0
|
|
|
|
n = 0
|
|
|
|
info = 0
|
|
|
|
info = 0
|
|
|
|
if(present(lev)) then
|
|
|
|
if(present(lev)) then
|
|
|
@ -44,7 +52,51 @@ subroutine psb_dneigh(a,idx,neigh,n,info,lev)
|
|
|
|
level=1
|
|
|
|
level=1
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if(a%fida.eq.'CSR') then
|
|
|
|
if ((a%fida /= 'CSR')) then
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call psb_spall(atmp,1,info)
|
|
|
|
|
|
|
|
if(info.ne.0) then
|
|
|
|
|
|
|
|
call psb_errpush(4010,name)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
call psb_spgtrow(idx,a,atmp,info)
|
|
|
|
|
|
|
|
if(info.ne.0) then
|
|
|
|
|
|
|
|
call psb_errpush(4010,name)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
dim=atmp%infoa(psb_nnz_)
|
|
|
|
|
|
|
|
allocate(tmpn(dim))
|
|
|
|
|
|
|
|
tmpn(1:dim)=atmp%ia2(1:dim)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(level.eq.2) then
|
|
|
|
|
|
|
|
do i=1,dim
|
|
|
|
|
|
|
|
if ((1<=tmpn(i)).and.(tmpn(i)<=a%m).and.(tmpn(i).ne.idx)) then
|
|
|
|
|
|
|
|
call psb_spgtrow(tmpn(i),a,atmp,info,append=.true.)
|
|
|
|
|
|
|
|
if(info.ne.0) then
|
|
|
|
|
|
|
|
call psb_errpush(4010,name)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dim=atmp%infoa(psb_nnz_)
|
|
|
|
|
|
|
|
if(dim.gt.size(neigh)) &
|
|
|
|
|
|
|
|
& call psb_realloc(dim,neigh,info)
|
|
|
|
|
|
|
|
if(info.ne.0) then
|
|
|
|
|
|
|
|
call psb_errpush(4010,name)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
call psb_spfree(atmp,info)
|
|
|
|
|
|
|
|
if(info.ne.0) then
|
|
|
|
|
|
|
|
call psb_errpush(4010,name)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
call psb_nullify_sp(atmp)
|
|
|
|
|
|
|
|
deallocate(tmpn)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else if(a%fida.eq.'CSR') then
|
|
|
|
|
|
|
|
|
|
|
|
dim=0
|
|
|
|
dim=0
|
|
|
|
if(level.eq.1) dim=(a%ia2(idx+1)-a%ia2(idx))
|
|
|
|
if(level.eq.1) dim=(a%ia2(idx+1)-a%ia2(idx))
|
|
|
|