|
|
@ -48,13 +48,14 @@ Module psb_c_krylov_conv_mod
|
|
|
|
|
|
|
|
|
|
|
|
contains
|
|
|
|
contains
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_c_init_conv(methdname,stopc,trace,itmax,a,b,eps,desc_a,stopdat,info)
|
|
|
|
subroutine psb_c_init_conv(methdname,stopc,trace,itmax,a,x,b,eps,&
|
|
|
|
|
|
|
|
& desc_a,stopdat,info)
|
|
|
|
use psb_base_mod
|
|
|
|
use psb_base_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
character(len=*), intent(in) :: methdname
|
|
|
|
character(len=*), intent(in) :: methdname
|
|
|
|
integer(psb_ipk_), intent(in) :: stopc, trace, itmax
|
|
|
|
integer(psb_ipk_), intent(in) :: stopc, trace, itmax
|
|
|
|
type(psb_cspmat_type), intent(in) :: a
|
|
|
|
type(psb_cspmat_type), intent(in) :: a
|
|
|
|
complex(psb_spk_), intent(in) :: b(:)
|
|
|
|
complex(psb_spk_), intent(inout) :: b(:), x(:)
|
|
|
|
real(psb_spk_), intent(in) :: eps
|
|
|
|
real(psb_spk_), intent(in) :: eps
|
|
|
|
type(psb_desc_type), intent(in) :: desc_a
|
|
|
|
type(psb_desc_type), intent(in) :: desc_a
|
|
|
|
type(psb_itconv_type) :: stopdat
|
|
|
|
type(psb_itconv_type) :: stopdat
|
|
|
@ -62,6 +63,7 @@ contains
|
|
|
|
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: ictxt, me, np, err_act, ierr(5)
|
|
|
|
integer(psb_ipk_) :: ictxt, me, np, err_act, ierr(5)
|
|
|
|
character(len=20) :: name
|
|
|
|
character(len=20) :: name
|
|
|
|
|
|
|
|
complex(psb_spk_), allocatable :: r(:)
|
|
|
|
|
|
|
|
|
|
|
|
info = psb_success_
|
|
|
|
info = psb_success_
|
|
|
|
name = 'psb_init_conv'
|
|
|
|
name = 'psb_init_conv'
|
|
|
@ -88,6 +90,12 @@ contains
|
|
|
|
case (2)
|
|
|
|
case (2)
|
|
|
|
stopdat%values(psb_ik_bn2_) = psb_genrm2(b,desc_a,info)
|
|
|
|
stopdat%values(psb_ik_bn2_) = psb_genrm2(b,desc_a,info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case (3)
|
|
|
|
|
|
|
|
call psb_geall(r,desc_a,info)
|
|
|
|
|
|
|
|
call psb_geaxpby(cone,b,czero,r,desc_a,info)
|
|
|
|
|
|
|
|
call psb_spmm(-cone,a,x,cone,r,desc_a,info)
|
|
|
|
|
|
|
|
stopdat%values(psb_ik_r0n2_) = psb_genrm2(r,desc_a,info)
|
|
|
|
|
|
|
|
call psb_gefree(r,desc_a,info)
|
|
|
|
case default
|
|
|
|
case default
|
|
|
|
info=psb_err_invalid_istop_
|
|
|
|
info=psb_err_invalid_istop_
|
|
|
|
ierr(1) = stopc
|
|
|
|
ierr(1) = stopc
|
|
|
@ -152,6 +160,11 @@ contains
|
|
|
|
stopdat%values(psb_ik_errnum_) = stopdat%values(psb_ik_rn2_)
|
|
|
|
stopdat%values(psb_ik_errnum_) = stopdat%values(psb_ik_rn2_)
|
|
|
|
stopdat%values(psb_ik_errden_) = stopdat%values(psb_ik_bn2_)
|
|
|
|
stopdat%values(psb_ik_errden_) = stopdat%values(psb_ik_bn2_)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case(3)
|
|
|
|
|
|
|
|
stopdat%values(psb_ik_rn2_) = psb_genrm2(r,desc_a,info)
|
|
|
|
|
|
|
|
stopdat%values(psb_ik_errnum_) = stopdat%values(psb_ik_rn2_)
|
|
|
|
|
|
|
|
stopdat%values(psb_ik_errden_) = stopdat%values(psb_ik_r0n2_)
|
|
|
|
|
|
|
|
|
|
|
|
case default
|
|
|
|
case default
|
|
|
|
info=psb_err_internal_error_
|
|
|
|
info=psb_err_internal_error_
|
|
|
|
call psb_errpush(info,name,a_err="Control data in stopdat messed up!")
|
|
|
|
call psb_errpush(info,name,a_err="Control data in stopdat messed up!")
|
|
|
@ -188,20 +201,21 @@ contains
|
|
|
|
end function psb_c_check_conv
|
|
|
|
end function psb_c_check_conv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine psb_c_init_conv_vect(methdname,stopc,trace,itmax,a,b,eps,desc_a,stopdat,info)
|
|
|
|
subroutine psb_c_init_conv_vect(methdname,stopc,trace,itmax,a,x,b,eps,desc_a,stopdat,info)
|
|
|
|
use psb_base_mod
|
|
|
|
use psb_base_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
character(len=*), intent(in) :: methdname
|
|
|
|
character(len=*), intent(in) :: methdname
|
|
|
|
integer(psb_ipk_), intent(in) :: stopc, trace,itmax
|
|
|
|
integer(psb_ipk_), intent(in) :: stopc, trace,itmax
|
|
|
|
type(psb_cspmat_type), intent(in) :: a
|
|
|
|
type(psb_cspmat_type), intent(in) :: a
|
|
|
|
real(psb_spk_), intent(in) :: eps
|
|
|
|
real(psb_spk_), intent(in) :: eps
|
|
|
|
type(psb_c_vect_type), intent(inout) :: b
|
|
|
|
type(psb_c_vect_type), intent(inout) :: x, b
|
|
|
|
type(psb_desc_type), intent(in) :: desc_a
|
|
|
|
type(psb_desc_type), intent(in) :: desc_a
|
|
|
|
type(psb_itconv_type) :: stopdat
|
|
|
|
type(psb_itconv_type) :: stopdat
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: ictxt, me, np, err_act, ierr(5)
|
|
|
|
integer(psb_ipk_) :: ictxt, me, np, err_act, ierr(5)
|
|
|
|
character(len=20) :: name
|
|
|
|
character(len=20) :: name
|
|
|
|
|
|
|
|
type(psb_c_vect_type) :: r
|
|
|
|
|
|
|
|
|
|
|
|
info = psb_success_
|
|
|
|
info = psb_success_
|
|
|
|
name = 'psb_init_conv'
|
|
|
|
name = 'psb_init_conv'
|
|
|
@ -228,6 +242,12 @@ contains
|
|
|
|
case (2)
|
|
|
|
case (2)
|
|
|
|
stopdat%values(psb_ik_bn2_) = psb_genrm2(b,desc_a,info)
|
|
|
|
stopdat%values(psb_ik_bn2_) = psb_genrm2(b,desc_a,info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case (3)
|
|
|
|
|
|
|
|
call psb_geasb(r,desc_a,info,scratch=.true.)
|
|
|
|
|
|
|
|
call psb_geaxpby(cone,b,czero,r,desc_a,info)
|
|
|
|
|
|
|
|
call psb_spmm(-cone,a,x,cone,r,desc_a,info)
|
|
|
|
|
|
|
|
stopdat%values(psb_ik_r0n2_) = psb_genrm2(r,desc_a,info)
|
|
|
|
|
|
|
|
call psb_gefree(r,desc_a,info)
|
|
|
|
case default
|
|
|
|
case default
|
|
|
|
info=psb_err_invalid_istop_
|
|
|
|
info=psb_err_invalid_istop_
|
|
|
|
ierr(1) = stopc
|
|
|
|
ierr(1) = stopc
|
|
|
@ -293,6 +313,11 @@ contains
|
|
|
|
stopdat%values(psb_ik_errnum_) = stopdat%values(psb_ik_rn2_)
|
|
|
|
stopdat%values(psb_ik_errnum_) = stopdat%values(psb_ik_rn2_)
|
|
|
|
stopdat%values(psb_ik_errden_) = stopdat%values(psb_ik_bn2_)
|
|
|
|
stopdat%values(psb_ik_errden_) = stopdat%values(psb_ik_bn2_)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case(3)
|
|
|
|
|
|
|
|
stopdat%values(psb_ik_rn2_) = psb_genrm2(r,desc_a,info)
|
|
|
|
|
|
|
|
stopdat%values(psb_ik_errnum_) = stopdat%values(psb_ik_rn2_)
|
|
|
|
|
|
|
|
stopdat%values(psb_ik_errden_) = stopdat%values(psb_ik_r0n2_)
|
|
|
|
|
|
|
|
|
|
|
|
case default
|
|
|
|
case default
|
|
|
|
info=psb_err_internal_error_
|
|
|
|
info=psb_err_internal_error_
|
|
|
|
call psb_errpush(info,name,a_err="Control data in stopdat messed up!")
|
|
|
|
call psb_errpush(info,name,a_err="Control data in stopdat messed up!")
|
|
|
|