Fixed wrong check on preconditioner in solvers.

psblas3-type-indexed
Salvatore Filippone 20 years ago
parent 7a4731c398
commit 81f09ff266

@ -103,7 +103,7 @@ subroutine psb_dbicg(a,prec,b,x,eps,desc_a,info,&
integer, pointer :: iperm(:), ipnull(:), ipsave(:), int_err(:)
real(kind(1.d0)) ::rerr
integer ::litmax, liter, naux, m, mglob, it, itrac,&
& nprows,npcols,me,mecol, n_row, n_col, listop, err_act
& nprows,npcols,me,mecol, n_row, n_col, istop_, err_act
character ::diagl, diagu
logical, parameter :: debug = .false.
logical, parameter :: exchange=.true., noexchange=.false.
@ -134,13 +134,13 @@ subroutine psb_dbicg(a,prec,b,x,eps,desc_a,info,&
if (present(istop)) then
listop = istop
istop_ = istop
else
listop = 1
istop_ = 1
endif
!
! listop = 1: normwise backward error, infinity norm
! listop = 2: ||r||/||b|| norm 2
! istop_ = 1: normwise backward error, infinity norm
! istop_ = 2: ||r||/||b|| norm 2
!
!!$
!!$ if ((prec%prec < min_prec_).or.(prec%prec > max_prec_) ) then
@ -149,10 +149,10 @@ subroutine psb_dbicg(a,prec,b,x,eps,desc_a,info,&
!!$ return
!!$ endif
if ((listop < 1 ).or.(listop > 2 ) ) then
write(0,*) 'psb_bicg: invalid istop',listop
if ((istop_ < 1 ).or.(istop_ > 2 ) ) then
write(0,*) 'psb_bicg: invalid istop',istop_
info=5001
int_err=listop
int_err=istop_
err=info
call psb_errpush(info,name,i_err=int_err)
goto 9999
@ -197,10 +197,10 @@ subroutine psb_dbicg(a,prec,b,x,eps,desc_a,info,&
diagu = 'u'
itx = 0
if (listop == 1) then
if (istop_ == 1) then
ani = psb_spnrmi(a,desc_a,info)
bni = psb_geamax(b,desc_a,info)
else if (listop == 2) then
else if (istop_ == 2) then
bn2 = psb_genrm2(b,desc_a,info)
endif
@ -228,10 +228,10 @@ subroutine psb_dbicg(a,prec,b,x,eps,desc_a,info,&
rho = dzero
if (debug) write(*,*) 'on entry to amax: b: ',size(b)
if (listop == 1) then
if (istop_ == 1) then
rni = psb_geamax(r,desc_a,info)
xni = psb_geamax(x,desc_a,info)
else if (listop == 2) then
else if (istop_ == 2) then
rni = psb_genrm2(r,desc_a,info)
endif
if(info.ne.0) then
@ -240,14 +240,14 @@ subroutine psb_dbicg(a,prec,b,x,eps,desc_a,info,&
goto 9999
end if
if (listop == 1) then
if (istop_ == 1) then
xni = psb_geamax(x,desc_a,info)
rerr = rni/(ani*xni+bni)
if (itrac /= -1) then
if (me.eq.0) write(itrac,'(a,i4,5(2x,es10.4))') 'bicg: ',itx,rerr,rni,bni,&
&xni,ani
endif
else if (listop == 2) then
else if (istop_ == 2) then
rerr = rni/bn2
if (itrac /= -1) then
if (me.eq.0) write(itrac,'(a,i4,3(2x,es10.4))') 'bicg: ',itx,rerr,rni,bn2
@ -307,21 +307,21 @@ subroutine psb_dbicg(a,prec,b,x,eps,desc_a,info,&
call psb_geaxpby(-alpha,qt,done,rt,desc_a,info)
if (listop == 1) then
if (istop_ == 1) then
rni = psb_geamax(r,desc_a,info)
xni = psb_geamax(x,desc_a,info)
else if (listop == 2) then
else if (istop_ == 2) then
rni = psb_genrm2(r,desc_a,info)
endif
if (listop == 1) then
if (istop_ == 1) then
xni = psb_geamax(x,desc_a,info)
rerr = rni/(ani*xni+bni)
if (itrac /= -1) then
if (me.eq.0) write(itrac,'(a,i4,5(2x,es10.4))') 'bicg: ',itx,rerr,rni,bni,&
&xni,ani
endif
else if (listop == 2) then
else if (istop_ == 2) then
rerr = rni/bn2
if (itrac /= -1) then
if (me.eq.0) write(itrac,'(a,i4,3(2x,es10.4))') 'bicg: ',itx,rerr,rni,bn2

@ -102,7 +102,7 @@ Subroutine psb_dcg(a,prec,b,x,eps,desc_a,info,&
real(kind(1.d0)) ::rerr
real(kind(1.d0)) ::alpha, beta, rho, rho_old, rni, xni, bni, ani,bn2,&
& sigma
integer :: litmax, liter, listop, naux, m, mglob, it, itx, itrac,&
integer :: litmax, liter, istop_, naux, m, mglob, it, itx, itrac,&
& nprows,npcols,me,mecol, n_col, isvch, ich, icontxt, n_row,err_act, int_err(5)
character ::diagl, diagu
logical, parameter :: exchange=.true., noexchange=.false.
@ -122,13 +122,13 @@ Subroutine psb_dcg(a,prec,b,x,eps,desc_a,info,&
if (present(istop)) then
listop = istop
istop_ = istop
else
listop = 1
istop_ = 1
endif
!
! LISTOP = 1: Normwise backward error, infinity norm
! LISTOP = 2: ||r||/||b|| norm 2
! ISTOP_ = 1: Normwise backward error, infinity norm
! ISTOP_ = 2: ||r||/||b|| norm 2
!
!!$ If ((prec%prec < min_prec_).Or.(prec%prec > max_prec_) ) Then
@ -137,10 +137,10 @@ Subroutine psb_dcg(a,prec,b,x,eps,desc_a,info,&
!!$ Return
!!$ Endif
if ((listop < 1 ).or.(listop > 2 ) ) then
write(0,*) 'psb_cg: invalid istop',listop
if ((istop_ < 1 ).or.(istop_ > 2 ) ) then
write(0,*) 'psb_cg: invalid istop',istop_
info=5001
int_err(1)=listop
int_err(1)=istop_
err=info
call psb_errpush(info,name,i_err=int_err)
goto 9999
@ -197,10 +197,10 @@ Subroutine psb_dcg(a,prec,b,x,eps,desc_a,info,&
end if
rho = dzero
if (listop == 1) then
if (istop_ == 1) then
ani = psb_spnrmi(a,desc_a,info)
bni = psb_geamax(b,desc_a,info)
else if (listop == 2) then
else if (istop_ == 2) then
bn2 = psb_genrm2(b,desc_a,info)
endif
if (info.ne.0) then
@ -241,7 +241,7 @@ Subroutine psb_dcg(a,prec,b,x,eps,desc_a,info,&
call psb_geaxpby(-alpha,q,done,r,desc_a,info)
if (listop == 1) Then
if (istop_ == 1) Then
rni = psb_geamax(r,desc_a,info)
xni = psb_geamax(x,desc_a,info)
rerr = rni/(ani*xni+bni)
@ -250,7 +250,7 @@ Subroutine psb_dcg(a,prec,b,x,eps,desc_a,info,&
&xni,ani
Endif
Else If (listop == 2) Then
Else If (istop_ == 2) Then
rni = psb_genrm2(r,desc_a,info)
rerr = rni/bn2

@ -101,7 +101,7 @@ Subroutine psb_dcgs(a,prec,b,x,eps,desc_a,info,&
Integer, Pointer :: iperm(:), ipnull(:), ipsave(:)
Real(Kind(1.d0)) ::rerr
Integer ::litmax, liter, naux, m, mglob, it, itrac,int_err(5),&
& nprows,npcols,me,mecol, n_row, n_col,listop, err_act
& nprows,npcols,me,mecol, n_row, n_col,istop_, err_act
Character ::diagl, diagu
Logical, Parameter :: exchange=.True., noexchange=.False.
Integer, Parameter :: irmax = 8
@ -126,13 +126,13 @@ Subroutine psb_dcgs(a,prec,b,x,eps,desc_a,info,&
n_col = desc_a%matrix_data(psb_n_col_)
If (Present(istop)) Then
listop = istop
istop_ = istop
Else
listop = 1
istop_ = 1
Endif
!
! listop = 1: normwise backward error, infinity norm
! listop = 2: ||r||/||b|| norm 2
! istop_ = 1: normwise backward error, infinity norm
! istop_ = 2: ||r||/||b|| norm 2
!
!!$
!!$ If ((prec%prec < 0).Or.(prec%prec > 6) ) Then
@ -141,10 +141,10 @@ Subroutine psb_dcgs(a,prec,b,x,eps,desc_a,info,&
!!$ Return
!!$ Endif
if ((listop < 1 ).or.(listop > 2 ) ) then
write(0,*) 'psb_cgs: invalid istop',listop
if ((istop_ < 1 ).or.(istop_ > 2 ) ) then
write(0,*) 'psb_cgs: invalid istop',istop_
info=5001
int_err=listop
int_err=istop_
err=info
call psb_errpush(info,name,i_err=int_err)
goto 9999
@ -195,10 +195,10 @@ Subroutine psb_dcgs(a,prec,b,x,eps,desc_a,info,&
diagu = 'u'
itx = 0
if (listop == 1) then
if (istop_ == 1) then
ani = psb_spnrmi(a,desc_a,info)
bni = psb_geamax(b,desc_a,info)
else if (listop == 2) then
else if (istop_ == 2) then
bn2 = psb_genrm2(b,desc_a,info)
endif
if(info/=0)then
@ -225,7 +225,7 @@ Subroutine psb_dcgs(a,prec,b,x,eps,desc_a,info,&
rho = dzero
If (debug) Write(*,*) 'on entry to amax: b: ',Size(b)
if (listop == 1) then
if (istop_ == 1) then
rni = psb_geamax(r,desc_a,info)
xni = psb_geamax(x,desc_a,info)
rerr = rni/(ani*xni+bni)
@ -233,7 +233,7 @@ Subroutine psb_dcgs(a,prec,b,x,eps,desc_a,info,&
If (me == 0) Write(itrac,'(a,i4,5(2x,es10.4))') 'cgs: ',&
& itx,rerr,rni,bni,xni,ani
endif
else if (listop == 2) then
else if (istop_ == 2) then
rni = psb_genrm2(r,desc_a,info)
rerr = rni/bn2
if (itrac /= -1) then
@ -301,7 +301,7 @@ Subroutine psb_dcgs(a,prec,b,x,eps,desc_a,info,&
Call psb_geaxpby(-alpha,qt,done,r,desc_a,info)
if (listop == 1) then
if (istop_ == 1) then
rni = psb_geamax(r,desc_a,info)
xni = psb_geamax(x,desc_a,info)
rerr = rni/(ani*xni+bni)
@ -310,7 +310,7 @@ Subroutine psb_dcgs(a,prec,b,x,eps,desc_a,info,&
& itx,rerr,rni,bni,xni,ani
endif
else if (listop == 2) then
else if (istop_ == 2) then
rni = psb_genrm2(r,desc_a,info)
rerr = rni/bn2

@ -107,7 +107,7 @@ Subroutine psb_dcgstab(a,prec,b,x,eps,desc_a,info,&
Logical, Parameter :: exchange=.True., noexchange=.False., debug1 = .False.
Integer, Parameter :: irmax = 8
Integer :: itx, i, isvch, ich, icontxt, err_act, int_err(5),ii
Integer :: listop
Integer :: istop_
Logical :: do_renum_left
Real(Kind(1.d0)) :: alpha, beta, rho, rho_old, rni, xni, bni, ani,&
& sigma, omega, tau, rn0, bn2
@ -129,28 +129,28 @@ Subroutine psb_dcgstab(a,prec,b,x,eps,desc_a,info,&
n_col = desc_a%matrix_data(psb_n_col_)
If (Present(istop)) Then
listop = istop
istop_ = istop
Else
listop = 1
istop_ = 1
Endif
!
! LISTOP = 1: Normwise backward error, infinity norm
! LISTOP = 2: ||r||/||b|| norm 2
! ISTOP_ = 1: Normwise backward error, infinity norm
! ISTOP_ = 2: ||r||/||b|| norm 2
!
If ((prec%prec < min_prec_).Or.(prec%prec > max_prec_) ) Then
Write(0,*) 'PSB_CGSTAB: Invalid IPREC',prec%prec
info=5002
int_err(1)=prec%prec
err=info
call psb_errpush(info,name,i_err=int_err)
goto 9999
Endif
!!$ If ((prec%prec < min_prec_).Or.(prec%prec > max_prec_) ) Then
!!$ Write(0,*) 'PSB_CGSTAB: Invalid IPREC',prec%prec
!!$ info=5002
!!$ int_err(1)=prec%prec
!!$ err=info
!!$ call psb_errpush(info,name,i_err=int_err)
!!$ goto 9999
!!$ Endif
if ((listop < 1 ).or.(listop > 2 ) ) then
write(0,*) 'psb_bicgstab: invalid istop',listop
if ((istop_ < 1 ).or.(istop_ > 2 ) ) then
write(0,*) 'psb_bicgstab: invalid istop',istop_
info=5001
int_err(1)=listop
int_err(1)=istop_
err=info
call psb_errpush(info,name,i_err=int_err)
goto 9999
@ -197,10 +197,10 @@ Subroutine psb_dcgstab(a,prec,b,x,eps,desc_a,info,&
itx = 0
If (listop == 1) Then
If (istop_ == 1) Then
ani = psb_spnrmi(a,desc_a,info)
bni = psb_geamax(b,desc_a,info)
Else If (listop == 2) Then
Else If (istop_ == 2) Then
bn2 = psb_genrm2(b,desc_a,info)
Endif
if (info /= 0) Then
@ -231,10 +231,10 @@ Subroutine psb_dcgstab(a,prec,b,x,eps,desc_a,info,&
! Must always provide norm of R into RNI below for first check on
! residual
!
If (listop == 1) Then
If (istop_ == 1) Then
rni = psb_geamax(r,desc_a,info)
xni = psb_geamax(x,desc_a,info)
Else If (listop == 2) Then
Else If (istop_ == 2) Then
rni = psb_genrm2(r,desc_a,info)
Endif
if (info /= 0) Then
@ -253,14 +253,14 @@ Subroutine psb_dcgstab(a,prec,b,x,eps,desc_a,info,&
Exit restart
End If
If (listop == 1) Then
If (istop_ == 1) Then
xni = psb_geamax(x,desc_a,info)
rerr = rni/(ani*xni+bni)
If (itrac /= -1) Then
If (myrow == 0) Write(itrac,'(a,i4,5(2x,es10.4))') 'bicgstab: ',itx,rerr,rni,bni,&
&xni,ani
Endif
Else If (listop == 2) Then
Else If (istop_ == 2) Then
rerr = rni/bn2
If (itrac /= -1) Then
If (myrow == 0) Write(itrac,'(a,i4,3(2x,es10.4))') 'bicgstab: ',itx,rerr,rni,bn2
@ -355,7 +355,7 @@ Subroutine psb_dcgstab(a,prec,b,x,eps,desc_a,info,&
Call psb_geaxpby(done,s,dzero,r,desc_a,info)
Call psb_geaxpby(-omega,t,done,r,desc_a,info)
If (listop == 1) Then
If (istop_ == 1) Then
rni = psb_geamax(r,desc_a,info)
xni = psb_geamax(x,desc_a,info)
rerr = rni/(ani*xni+bni)
@ -364,7 +364,7 @@ Subroutine psb_dcgstab(a,prec,b,x,eps,desc_a,info,&
& 'bicgstab: ',itx,rerr,rni,bni,xni,ani
Endif
Else If (listop == 2) Then
Else If (istop_ == 2) Then
rni = psb_genrm2(r,desc_a,info)
rerr = rni/bn2
If (itrac /= -1) Then

@ -114,7 +114,7 @@ Subroutine psb_dcgstabl(a,prec,b,x,eps,desc_a,info,&
Character ::diagl, diagu
Logical, Parameter :: exchange=.True., noexchange=.False.
Integer, Parameter :: irmax = 8
Integer :: itx, i, isvch, ich, icontxt,listop,j, int_err(5)
Integer :: itx, i, isvch, ich, icontxt,istop_,j, int_err(5)
Logical :: do_renum_left
Logical, Parameter :: debug = .False.
Real(Kind(1.d0)) :: alpha, beta, rho, rho_old, rni, xni, bni, ani,bn2,&
@ -136,19 +136,19 @@ Subroutine psb_dcgstabl(a,prec,b,x,eps,desc_a,info,&
n_col = desc_a%matrix_data(psb_n_col_)
if (present(istop)) then
listop = istop
istop_ = istop
else
listop = 1
istop_ = 1
endif
!
! LISTOP = 1: Normwise backward error, infinity norm
! LISTOP = 2: ||r||/||b|| norm 2
! ISTOP_ = 1: Normwise backward error, infinity norm
! ISTOP_ = 2: ||r||/||b|| norm 2
!
if ((listop < 1 ).or.(listop > 2 ) ) then
write(0,*) 'psb_bicgstabl: invalid istop',listop
if ((istop_ < 1 ).or.(istop_ > 2 ) ) then
write(0,*) 'psb_bicgstabl: invalid istop',istop_
info=5001
int_err=listop
int_err=istop_
err=info
call psb_errpush(info,name,i_err=int_err)
goto 9999
@ -211,10 +211,10 @@ Subroutine psb_dcgstabl(a,prec,b,x,eps,desc_a,info,&
ich = 1
Call blacs_set(icontxt,16,ich)
if (listop == 1) then
if (istop_ == 1) then
ani = psb_spnrmi(a,desc_a,info)
bni = psb_geamax(b,desc_a,info)
else if (listop == 2) then
else if (istop_ == 2) then
bn2 = psb_genrm2(b,desc_a,info)
endif
if (info.ne.0) Then
@ -253,7 +253,7 @@ Subroutine psb_dcgstabl(a,prec,b,x,eps,desc_a,info,&
If (debug) Write(0,*) 'on entry to amax: b: ',Size(b)
if (listop == 1) then
if (istop_ == 1) then
rni = psb_geamax(r,desc_a,info)
xni = psb_geamax(x,desc_a,info)
rerr = rni/(ani*xni+bni)
@ -261,7 +261,7 @@ Subroutine psb_dcgstabl(a,prec,b,x,eps,desc_a,info,&
If (me == 0) Write(itrac,'(a,i4,5(2x,es10.4))') 'bicgstab(l): ',&
& itx,rerr,rni,bni,xni,ani
endif
else if (listop == 2) then
else if (istop_ == 2) then
rni = psb_genrm2(r,desc_a,info)
rerr = rni/bn2
if (itrac /= -1) then
@ -362,7 +362,7 @@ Subroutine psb_dcgstabl(a,prec,b,x,eps,desc_a,info,&
Call psb_geaxpby(-gamma1(j),rh(:,j),done,rh(:,0),desc_a,info)
Enddo
if (listop == 1) then
if (istop_ == 1) then
rni = psb_geamax(rh(:,0),desc_a,info)
xni = psb_geamax(x,desc_a,info)
rerr = rni/(ani*xni+bni)
@ -371,7 +371,7 @@ Subroutine psb_dcgstabl(a,prec,b,x,eps,desc_a,info,&
& itx,rerr,rni,bni,xni,ani
endif
else if (listop == 2) then
else if (istop_ == 2) then
rni = psb_genrm2(rh(:,0),desc_a,info)
rerr = rni/bn2

@ -116,7 +116,7 @@ Subroutine psb_dgmresr(a,prec,b,x,eps,desc_a,info,&
Character ::diagl, diagu
Logical, Parameter :: exchange=.True., noexchange=.False.
Integer, Parameter :: irmax = 8
Integer :: itx, i, isvch, ich, icontxt,listop, err_act
Integer :: itx, i, isvch, ich, icontxt,istop_, err_act
Logical :: do_renum_left,inner_stop
Logical, Parameter :: debug = .false.
Real(Kind(1.d0)) :: alpha, beta, rho, rho_old, rni, xni, bni, ani,bn2,&
@ -139,19 +139,19 @@ Subroutine psb_dgmresr(a,prec,b,x,eps,desc_a,info,&
n_col = desc_a%matrix_data(psb_n_col_)
if (present(istop)) then
listop = istop
istop_ = istop
else
listop = 1
istop_ = 1
endif
!
! LISTOP = 1: Normwise backward error, infinity norm
! LISTOP = 2: ||r||/||b|| norm 2
! ISTOP_ = 1: Normwise backward error, infinity norm
! ISTOP_ = 2: ||r||/||b|| norm 2
!
if ((listop < 1 ).or.(listop > 2 ) ) then
write(0,*) 'psb_dgmres: invalid istop',listop
if ((istop_ < 1 ).or.(istop_ > 2 ) ) then
write(0,*) 'psb_dgmres: invalid istop',istop_
info=5001
int_err(1)=listop
int_err(1)=istop_
err=info
call psb_errpush(info,name,i_err=int_err)
goto 9999
@ -204,10 +204,10 @@ Subroutine psb_dgmresr(a,prec,b,x,eps,desc_a,info,&
ich = 1
Call blacs_set(icontxt,16,ich)
if (listop == 1) then
if (istop_ == 1) then
ani = psb_spnrmi(a,desc_a,info)
bni = psb_geamax(b,desc_a,info)
else if (listop == 2) then
else if (istop_ == 2) then
bn2 = psb_genrm2(b,desc_a,info)
endif
if (info.ne.0) Then
@ -244,7 +244,7 @@ Subroutine psb_dgmresr(a,prec,b,x,eps,desc_a,info,&
scal=done/rs(1)
If (debug) Write(0,*) 'on entry to amax: b: ',Size(b),rs(1),scal
if (listop == 1) then
if (istop_ == 1) then
rni = psb_geamax(v(:,1),desc_a,info)
xni = psb_geamax(x,desc_a,info)
rerr = rni/(ani*xni+bni)
@ -252,7 +252,7 @@ Subroutine psb_dgmresr(a,prec,b,x,eps,desc_a,info,&
If (me == 0) Write(itrac,'(a,i4,5(2x,es10.4))') 'gmresr(l): ',&
& itx,rerr,rni,bni,xni,ani
endif
else if (listop == 2) then
else if (istop_ == 2) then
rni = psb_genrm2(v(:,1),desc_a,info)
rerr = rni/bn2
if (itrac /= -1) then
@ -301,7 +301,7 @@ Subroutine psb_dgmresr(a,prec,b,x,eps,desc_a,info,&
rs(i) = c(i)*rs(i)
rr(i,i) = c(i)*h(i,i)+s(i)*h(i+1,i)
if (listop == 1) then
if (istop_ == 1) then
rni = abs(rs(i+1))
xni = psb_geamax(x,desc_a,info)
rerr = rni/(ani*xni+bni)
@ -309,7 +309,7 @@ Subroutine psb_dgmresr(a,prec,b,x,eps,desc_a,info,&
If (me == 0) Write(itrac,'(a,i4,5(2x,es10.4))') 'gmresr(l): ',&
& itx,rerr,rni,bni,xni,ani
endif
else if (listop == 2) then
else if (istop_ == 2) then
rni = abs(rs(i+1))
rerr = rni/bn2
if (itrac /= -1) then

@ -101,7 +101,7 @@ Subroutine psb_zcgs(a,prec,b,x,eps,desc_a,info,&
Integer, Pointer :: iperm(:), ipnull(:), ipsave(:)
Real(Kind(1.d0)) ::rerr
Integer ::litmax, liter, naux, m, mglob, it, itrac,int_err(5),&
& nprows,npcols,me,mecol, n_row, n_col,listop, err_act
& nprows,npcols,me,mecol, n_row, n_col,istop_, err_act
Character ::diagl, diagu
Logical, Parameter :: exchange=.True., noexchange=.False.
Integer, Parameter :: irmax = 8
@ -126,13 +126,13 @@ Subroutine psb_zcgs(a,prec,b,x,eps,desc_a,info,&
n_col = desc_a%matrix_data(psb_n_col_)
If (Present(istop)) Then
listop = istop
istop_ = istop
Else
listop = 1
istop_ = 1
Endif
!
! listop = 1: normwise backward error, infinity norm
! listop = 2: ||r||/||b|| norm 2
! istop_ = 1: normwise backward error, infinity norm
! istop_ = 2: ||r||/||b|| norm 2
!
!!$
!!$ If ((prec%prec < 0).Or.(prec%prec > 6) ) Then
@ -141,10 +141,10 @@ Subroutine psb_zcgs(a,prec,b,x,eps,desc_a,info,&
!!$ Return
!!$ Endif
if ((listop < 1 ).or.(listop > 2 ) ) then
write(0,*) 'psb_cgs: invalid istop',listop
if ((istop_ < 1 ).or.(istop_ > 2 ) ) then
write(0,*) 'psb_cgs: invalid istop',istop_
info=5001
int_err=listop
int_err=istop_
err=info
call psb_errpush(info,name,i_err=int_err)
goto 9999
@ -195,10 +195,10 @@ Subroutine psb_zcgs(a,prec,b,x,eps,desc_a,info,&
diagu = 'u'
itx = 0
if (listop == 1) then
if (istop_ == 1) then
ani = psb_spnrmi(a,desc_a,info)
bni = psb_geamax(b,desc_a,info)
else if (listop == 2) then
else if (istop_ == 2) then
bn2 = psb_genrm2(b,desc_a,info)
endif
if(info/=0)then
@ -225,7 +225,7 @@ Subroutine psb_zcgs(a,prec,b,x,eps,desc_a,info,&
rho = zzero
If (debug) Write(*,*) 'on entry to amax: b: ',Size(b)
if (listop == 1) then
if (istop_ == 1) then
rni = psb_geamax(r,desc_a,info)
xni = psb_geamax(x,desc_a,info)
rerr = rni/(ani*xni+bni)
@ -233,7 +233,7 @@ Subroutine psb_zcgs(a,prec,b,x,eps,desc_a,info,&
If (me == 0) Write(itrac,'(a,i4,5(2x,es10.4))') 'cgs: ',&
& itx,rerr,rni,bni,xni,ani
endif
else if (listop == 2) then
else if (istop_ == 2) then
rni = psb_genrm2(r,desc_a,info)
rerr = rni/bn2
if (itrac /= -1) then
@ -301,7 +301,7 @@ Subroutine psb_zcgs(a,prec,b,x,eps,desc_a,info,&
Call psb_geaxpby(-alpha,qt,zone,r,desc_a,info)
if (listop == 1) then
if (istop_ == 1) then
rni = psb_geamax(r,desc_a,info)
xni = psb_geamax(x,desc_a,info)
rerr = rni/(ani*xni+bni)
@ -310,7 +310,7 @@ Subroutine psb_zcgs(a,prec,b,x,eps,desc_a,info,&
& itx,rerr,rni,bni,xni,ani
endif
else if (listop == 2) then
else if (istop_ == 2) then
rni = psb_genrm2(r,desc_a,info)
rerr = rni/bn2

@ -107,7 +107,7 @@ Subroutine psb_zcgstab(a,prec,b,x,eps,desc_a,info,&
Logical, Parameter :: exchange=.True., noexchange=.False., debug1 = .False.
Integer, Parameter :: irmax = 8
Integer :: itx, i, isvch, ich, icontxt, err_act, int_err(5),ii
Integer :: listop
Integer :: istop_
Logical :: do_renum_left
complex(Kind(1.d0)) :: alpha, beta, rho, rho_old, sigma, omega, tau
Real(Kind(1.d0)) :: rni, xni, bni, ani, rn0, bn2
@ -129,28 +129,28 @@ Subroutine psb_zcgstab(a,prec,b,x,eps,desc_a,info,&
n_col = desc_a%matrix_data(psb_n_col_)
If (Present(istop)) Then
listop = istop
istop_ = istop
Else
listop = 1
istop_ = 1
Endif
!
! LISTOP = 1: Normwise backward error, infinity norm
! LISTOP = 2: ||r||/||b|| norm 2
! ISTOP_ = 1: Normwise backward error, infinity norm
! ISTOP_ = 2: ||r||/||b|| norm 2
!
If ((prec%prec < min_prec_).Or.(prec%prec > max_prec_) ) Then
Write(0,*) 'PSB_CGSTAB: Invalid IPREC',prec%prec
info=5002
int_err(1)=prec%prec
err=info
call psb_errpush(info,name,i_err=int_err)
goto 9999
Endif
!!$
!!$ If ((prec%prec < min_prec_).Or.(prec%prec > max_prec_) ) Then
!!$ Write(0,*) 'PSB_CGSTAB: Invalid IPREC',prec%prec
!!$ info=5002
!!$ int_err(1)=prec%prec
!!$ err=info
!!$ call psb_errpush(info,name,i_err=int_err)
!!$ goto 9999
!!$ Endif
if ((listop < 1 ).or.(listop > 2 ) ) then
write(0,*) 'psb_bicgstab: invalid istop',listop
if ((istop_ < 1 ).or.(istop_ > 2 ) ) then
write(0,*) 'psb_bicgstab: invalid istop',istop_
info=5001
int_err(1)=listop
int_err(1)=istop_
err=info
call psb_errpush(info,name,i_err=int_err)
goto 9999
@ -197,10 +197,10 @@ Subroutine psb_zcgstab(a,prec,b,x,eps,desc_a,info,&
itx = 0
If (listop == 1) Then
If (istop_ == 1) Then
ani = psb_spnrmi(a,desc_a,info)
bni = psb_geamax(b,desc_a,info)
Else If (listop == 2) Then
Else If (istop_ == 2) Then
bn2 = psb_genrm2(b,desc_a,info)
Endif
if (info /= 0) Then
@ -231,10 +231,10 @@ Subroutine psb_zcgstab(a,prec,b,x,eps,desc_a,info,&
! Must always provide norm of R into RNI below for first check on
! residual
!
If (listop == 1) Then
If (istop_ == 1) Then
rni = psb_geamax(r,desc_a,info)
xni = psb_geamax(x,desc_a,info)
Else If (listop == 2) Then
Else If (istop_ == 2) Then
rni = psb_genrm2(r,desc_a,info)
Endif
if (info /= 0) Then
@ -253,14 +253,14 @@ Subroutine psb_zcgstab(a,prec,b,x,eps,desc_a,info,&
Exit restart
End If
If (listop == 1) Then
If (istop_ == 1) Then
xni = psb_geamax(x,desc_a,info)
rerr = rni/(ani*xni+bni)
If (itrac /= -1) Then
If (myrow == 0) Write(itrac,'(a,i4,5(2x,es10.4))') 'bicgstab: ',itx,rerr,rni,bni,&
&xni,ani
Endif
Else If (listop == 2) Then
Else If (istop_ == 2) Then
rerr = rni/bn2
If (itrac /= -1) Then
If (myrow == 0) Write(itrac,'(a,i4,3(2x,es10.4))') 'bicgstab: ',itx,rerr,rni,bn2
@ -354,7 +354,7 @@ Subroutine psb_zcgstab(a,prec,b,x,eps,desc_a,info,&
Call psb_geaxpby(zone,s,zzero,r,desc_a,info)
Call psb_geaxpby(-omega,t,zone,r,desc_a,info)
If (listop == 1) Then
If (istop_ == 1) Then
rni = psb_geamax(r,desc_a,info)
xni = psb_geamax(x,desc_a,info)
rerr = rni/(ani*xni+bni)
@ -363,7 +363,7 @@ Subroutine psb_zcgstab(a,prec,b,x,eps,desc_a,info,&
& 'bicgstab: ',itx,rerr,rni,bni,xni,ani
Endif
Else If (listop == 2) Then
Else If (istop_ == 2) Then
rni = psb_genrm2(r,desc_a,info)
rerr = rni/bn2
If (itrac /= -1) Then

Loading…
Cancel
Save