You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
2.0 KiB
Fortran
97 lines
2.0 KiB
Fortran
14 years ago
|
subroutine psb_d_mat_renum(alg,mat,info)
|
||
|
use psb_base_mod
|
||
|
use psb_renum_mod, psb_protect_name => psb_d_mat_renum
|
||
14 years ago
|
implicit none
|
||
14 years ago
|
integer, intent(in) :: alg
|
||
|
type(psb_dspmat_type), intent(inout) :: mat
|
||
|
integer, intent(out) :: info
|
||
|
|
||
|
integer :: err_act
|
||
14 years ago
|
character(len=20) :: name
|
||
14 years ago
|
|
||
|
info = psb_success_
|
||
14 years ago
|
name = 'mat_renum'
|
||
14 years ago
|
call psb_erractionsave(err_act)
|
||
|
|
||
|
info = psb_success_
|
||
|
|
||
14 years ago
|
select case (alg)
|
||
|
case(psb_renum_gps_)
|
||
14 years ago
|
|
||
14 years ago
|
call psb_mat_renum_gps(mat,info)
|
||
14 years ago
|
|
||
14 years ago
|
case default
|
||
|
info = psb_err_input_value_invalid_i_
|
||
|
call psb_errpush(info,name,i_err=(/1,alg,0,0,0/))
|
||
|
goto 9999
|
||
|
end select
|
||
|
|
||
|
if (info /= psb_success_) then
|
||
|
info = psb_err_from_subroutine_non_
|
||
|
call psb_errpush(info,name)
|
||
|
goto 9999
|
||
|
end if
|
||
|
|
||
14 years ago
|
call psb_erractionrestore(err_act)
|
||
|
return
|
||
|
|
||
|
9999 continue
|
||
|
call psb_erractionrestore(err_act)
|
||
|
if (err_act == psb_act_abort_) then
|
||
14 years ago
|
call psb_error()
|
||
14 years ago
|
return
|
||
|
end if
|
||
|
return
|
||
|
|
||
14 years ago
|
contains
|
||
|
subroutine psb_mat_renum_gps(a,info)
|
||
|
use psb_base_mod
|
||
|
use psb_gps_mod
|
||
|
implicit none
|
||
|
type(psb_dspmat_type), intent(inout) :: a
|
||
|
integer, intent(out) :: info
|
||
|
|
||
|
!
|
||
|
class(psb_d_base_sparse_mat), allocatable :: aa
|
||
|
type(psb_d_csr_sparse_mat) :: acsr
|
||
|
type(psb_d_coo_sparse_mat) :: acoo
|
||
|
|
||
|
integer :: err_act
|
||
|
character(len=20) :: name
|
||
|
|
||
|
info = psb_success_
|
||
|
name = 'mat_renum'
|
||
|
call psb_erractionsave(err_act)
|
||
|
|
||
|
info = psb_success_
|
||
|
|
||
14 years ago
|
call a%mold(aa)
|
||
|
call a%mv_to(aa)
|
||
14 years ago
|
call aa%mv_to_fmt(acsr,info)
|
||
|
! Insert call to gps_reduce
|
||
|
|
||
|
|
||
|
! Move to coordinate to apply renumbering
|
||
|
call acsr%mv_to_coo(acoo,info)
|
||
|
|
||
|
|
||
|
! Get back to where we started from
|
||
|
call aa%mv_from_coo(acoo,info)
|
||
|
|
||
|
call a%mv_from(aa)
|
||
|
|
||
|
deallocate(aa)
|
||
|
call psb_erractionrestore(err_act)
|
||
|
return
|
||
|
|
||
|
9999 continue
|
||
|
call psb_erractionrestore(err_act)
|
||
|
if (err_act == psb_act_abort_) then
|
||
|
call psb_error()
|
||
|
return
|
||
|
end if
|
||
|
return
|
||
|
end subroutine psb_mat_renum_gps
|
||
14 years ago
|
|
||
|
end subroutine psb_d_mat_renum
|