mld2p4-2:

mlprec/mld_cprecinit.F90
 mlprec/mld_cprecset.F90
 mlprec/mld_dprecinit.F90
 mlprec/mld_dprecset.F90
 mlprec/mld_sprecinit.F90
 mlprec/mld_sprecset.F90
 mlprec/mld_zprecinit.F90
 mlprec/mld_zprecset.F90


Merged fixes for aggregation threshold settings.
This commit is contained in:
Salvatore Filippone
2011-03-29 14:18:27 +00:00
parent 953ee272ea
commit 8e4c0c99fd
8 changed files with 171 additions and 96 deletions
+14 -9
View File
@@ -104,17 +104,18 @@ subroutine mld_cprecinit(p,ptype,info,nlev)
implicit none
! Arguments
! Arguments
type(mld_cprec_type), intent(inout) :: p
character(len=*), intent(in) :: ptype
integer, intent(out) :: info
integer, optional, intent(in) :: nlev
! Local variables
! Local variables
integer :: nlev_, ilev_
real(psb_spk_) :: thr
character(len=*), parameter :: name='mld_precinit'
info = psb_success_
if (allocated(p%precv)) then
call mld_precfree(p,info)
if (info /= psb_success_) then
@@ -131,7 +132,7 @@ subroutine mld_cprecinit(p,ptype,info,nlev)
if (info /= psb_success_) return
allocate(mld_c_id_solver_type :: p%precv(ilev_)%sm%sv, stat=info)
call p%precv(ilev_)%default()
case ('JAC','DIAG','JACOBI')
nlev_ = 1
ilev_ = 1
@@ -149,7 +150,7 @@ subroutine mld_cprecinit(p,ptype,info,nlev)
if (info /= psb_success_) return
allocate(mld_c_ilu_solver_type :: p%precv(ilev_)%sm%sv, stat=info)
call p%precv(ilev_)%default()
case ('AS')
nlev_ = 1
ilev_ = 1
@@ -161,7 +162,7 @@ subroutine mld_cprecinit(p,ptype,info,nlev)
case ('ML')
if (present(nlev)) then
nlev_ = max(1,nlev)
else
@@ -198,10 +199,14 @@ subroutine mld_cprecinit(p,ptype,info,nlev)
call p%precv(ilev_)%set(mld_sub_prol_,psb_none_,info)
call p%precv(ilev_)%set(mld_sub_ovr_,0,info)
!!$ write(0,*) 'Check 5: ',allocated(p%precv(1)%sm)
thr = 0.16
do ilev_=1,nlev_
call p%precv(ilev_)%set(mld_aggr_thresh_,thr,info)
thr = thr/2
end do
case default
write(0,*) name,': Warning: Unknown preconditioner type request "',ptype,'"'
write(psb_err_unit,*) name,&
& ': Warning: Unknown preconditioner type request "',ptype,'"'
info = psb_err_pivot_too_small_
end select
+28 -15
View File
@@ -106,7 +106,8 @@ subroutine mld_cprecseti(p,what,val,info,ilev)
if (.not.allocated(p%precv)) then
info = 3111
write(psb_err_unit,*) name,': Error: uninitialized preconditioner,',&
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
return
endif
@@ -120,7 +121,8 @@ subroutine mld_cprecseti(p,what,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
write(psb_err_unit,*) name,&
&': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
@@ -166,14 +168,16 @@ subroutine mld_cprecseti(p,what,val,info,ilev)
case(mld_coarse_subsolve_)
if (ilev_ /= nlev_) then
write(0,*) name,': Error: Inconsistent specification of WHAT vs. ILEV'
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call onelev_set_solver(p%precv(ilev_),val,info)
case(mld_coarse_solve_)
if (ilev_ /= nlev_) then
write(0,*) name,': Error: Inconsistent specification of WHAT vs. ILEV'
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
@@ -206,7 +210,8 @@ subroutine mld_cprecseti(p,what,val,info,ilev)
endif
case(mld_coarse_sweeps_)
if (ilev_ /= nlev_) then
write(0,*) name,': Error: Inconsistent specification of WHAT vs. ILEV'
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
@@ -214,7 +219,8 @@ subroutine mld_cprecseti(p,what,val,info,ilev)
case(mld_coarse_fillin_)
if (ilev_ /= nlev_) then
write(0,*) name,': Error: Inconsistent specification of WHAT vs. ILEV'
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
@@ -234,7 +240,7 @@ subroutine mld_cprecseti(p,what,val,info,ilev)
case(mld_sub_solve_)
do ilev_=1,max(1,nlev_-1)
if (.not.allocated(p%precv(ilev_)%sm)) then
write(0,*) name,&
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner component,',&
& ' should call MLD_PRECINIT'
info = -1
@@ -529,7 +535,8 @@ subroutine mld_cprecsetsm(p,val,info,ilev)
if (.not.allocated(p%precv)) then
info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',&
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
return
endif
@@ -547,7 +554,8 @@ subroutine mld_cprecsetsm(p,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(0,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
@@ -590,7 +598,8 @@ subroutine mld_cprecsetsv(p,val,info,ilev)
if (.not.allocated(p%precv)) then
info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',&
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
return
endif
@@ -609,7 +618,8 @@ subroutine mld_cprecsetsv(p,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(0,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
@@ -626,7 +636,7 @@ subroutine mld_cprecsetsv(p,val,info,ilev)
call p%precv(ilev_)%sm%sv%default()
else
info = 3111
write(0,*) name,&
write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner component,',&
&' should call MLD_PRECINIT/MLD_PRECSET'
return
@@ -712,7 +722,8 @@ subroutine mld_cprecsetc(p,what,string,info,ilev)
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
write(0,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',ilev_, nlev_
info = -1
return
endif
@@ -790,7 +801,8 @@ subroutine mld_cprecsetr(p,what,val,info,ilev)
end if
if (.not.allocated(p%precv)) then
write(0,*) name,': Error: uninitialized preconditioner,',&
write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
info = 3111
return
@@ -798,7 +810,8 @@ subroutine mld_cprecsetr(p,what,val,info,ilev)
nlev_ = size(p%precv)
if ((ilev_<1).or.(ilev_ > nlev_)) then
write(0,*) name,': Error: invalid ILEV/NLEV combination',&
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',&
& ilev_, nlev_
info = -1
return
+15 -7
View File
@@ -107,17 +107,18 @@ subroutine mld_dprecinit(p,ptype,info,nlev)
implicit none
! Arguments
! Arguments
type(mld_dprec_type), intent(inout) :: p
character(len=*), intent(in) :: ptype
integer, intent(out) :: info
integer, optional, intent(in) :: nlev
! Local variables
! Local variables
integer :: nlev_, ilev_
real(psb_dpk_) :: thr
character(len=*), parameter :: name='mld_precinit'
info = psb_success_
if (allocated(p%precv)) then
call mld_precfree(p,info)
if (info /= psb_success_) then
@@ -134,7 +135,7 @@ subroutine mld_dprecinit(p,ptype,info,nlev)
if (info /= psb_success_) return
allocate(mld_d_id_solver_type :: p%precv(ilev_)%sm%sv, stat=info)
call p%precv(ilev_)%default()
case ('JAC','DIAG','JACOBI')
nlev_ = 1
ilev_ = 1
@@ -152,7 +153,7 @@ subroutine mld_dprecinit(p,ptype,info,nlev)
if (info /= psb_success_) return
allocate(mld_d_ilu_solver_type :: p%precv(ilev_)%sm%sv, stat=info)
call p%precv(ilev_)%default()
case ('AS')
nlev_ = 1
ilev_ = 1
@@ -164,7 +165,7 @@ subroutine mld_dprecinit(p,ptype,info,nlev)
case ('ML')
if (present(nlev)) then
nlev_ = max(1,nlev)
else
@@ -203,8 +204,15 @@ subroutine mld_dprecinit(p,ptype,info,nlev)
call p%precv(ilev_)%set(mld_sub_prol_,psb_none_,info)
call p%precv(ilev_)%set(mld_sub_ovr_,0,info)
thr = 0.16
do ilev_=1,nlev_
call p%precv(ilev_)%set(mld_aggr_thresh_,thr,info)
thr = thr/2
end do
case default
write(0,*) name,': Warning: Unknown preconditioner type request "',ptype,'"'
write(psb_err_unit,*) name,&
&': Warning: Unknown preconditioner type request "',ptype,'"'
info = psb_err_pivot_too_small_
end select
+28 -17
View File
@@ -109,7 +109,8 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
if (.not.allocated(p%precv)) then
info = 3111
write(psb_err_unit,*) name,': Error: uninitialized preconditioner,',&
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
return
endif
@@ -123,7 +124,8 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
write(psb_err_unit,*) name,&
&': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
@@ -150,7 +152,6 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
case default
call p%precv(ilev_)%set(what,val,info)
call p%precv(ilev_)%set(what,val,info)
end select
else if (ilev_ > 1) then
@@ -170,14 +171,16 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
case(mld_coarse_subsolve_)
if (ilev_ /= nlev_) then
write(0,*) name,': Error: Inconsistent specification of WHAT vs. ILEV'
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call onelev_set_solver(p%precv(ilev_),val,info)
case(mld_coarse_solve_)
if (ilev_ /= nlev_) then
write(0,*) name,': Error: Inconsistent specification of WHAT vs. ILEV'
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
@@ -212,7 +215,8 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
endif
case(mld_coarse_sweeps_)
if (ilev_ /= nlev_) then
write(0,*) name,': Error: Inconsistent specification of WHAT vs. ILEV'
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
@@ -220,14 +224,14 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
case(mld_coarse_fillin_)
if (ilev_ /= nlev_) then
write(0,*) name,': Error: Inconsistent specification of WHAT vs. ILEV'
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(nlev_)%set(mld_sub_fillin_,val,info)
case default
call p%precv(ilev_)%set(what,val,info)
call p%precv(ilev_)%set(what,val,info)
end select
endif
@@ -241,7 +245,7 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
case(mld_sub_solve_)
do ilev_=1,max(1,nlev_-1)
if (.not.allocated(p%precv(ilev_)%sm)) then
write(0,*) name,&
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner component,',&
& ' should call MLD_PRECINIT'
info = -1
@@ -554,7 +558,8 @@ subroutine mld_dprecsetsm(p,val,info,ilev)
if (.not.allocated(p%precv)) then
info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',&
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
return
endif
@@ -572,7 +577,8 @@ subroutine mld_dprecsetsm(p,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(0,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
@@ -615,7 +621,8 @@ subroutine mld_dprecsetsv(p,val,info,ilev)
if (.not.allocated(p%precv)) then
info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',&
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
return
endif
@@ -634,7 +641,8 @@ subroutine mld_dprecsetsv(p,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(0,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
@@ -651,7 +659,7 @@ subroutine mld_dprecsetsv(p,val,info,ilev)
call p%precv(ilev_)%sm%sv%default()
else
info = 3111
write(0,*) name,&
write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner component,',&
&' should call MLD_PRECINIT/MLD_PRECSET'
return
@@ -736,7 +744,8 @@ subroutine mld_dprecsetc(p,what,string,info,ilev)
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
write(0,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',ilev_, nlev_
info = -1
return
endif
@@ -813,7 +822,8 @@ subroutine mld_dprecsetr(p,what,val,info,ilev)
end if
if (.not.allocated(p%precv)) then
write(0,*) name,': Error: uninitialized preconditioner,',&
write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
info = 3111
return
@@ -821,7 +831,8 @@ subroutine mld_dprecsetr(p,what,val,info,ilev)
nlev_ = size(p%precv)
if ((ilev_<1).or.(ilev_ > nlev_)) then
write(0,*) name,': Error: invalid ILEV/NLEV combination',&
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',&
& ilev_, nlev_
info = -1
return
+15 -9
View File
@@ -104,17 +104,18 @@ subroutine mld_sprecinit(p,ptype,info,nlev)
implicit none
! Arguments
! Arguments
type(mld_sprec_type), intent(inout) :: p
character(len=*), intent(in) :: ptype
integer, intent(out) :: info
integer, optional, intent(in) :: nlev
! Local variables
! Local variables
integer :: nlev_, ilev_
real(psb_spk_) :: thr
character(len=*), parameter :: name='mld_precinit'
info = psb_success_
if (allocated(p%precv)) then
call mld_precfree(p,info)
if (info /= psb_success_) then
@@ -131,7 +132,7 @@ subroutine mld_sprecinit(p,ptype,info,nlev)
if (info /= psb_success_) return
allocate(mld_s_id_solver_type :: p%precv(ilev_)%sm%sv, stat=info)
call p%precv(ilev_)%default()
case ('JAC','DIAG','JACOBI')
nlev_ = 1
ilev_ = 1
@@ -149,7 +150,7 @@ subroutine mld_sprecinit(p,ptype,info,nlev)
if (info /= psb_success_) return
allocate(mld_s_ilu_solver_type :: p%precv(ilev_)%sm%sv, stat=info)
call p%precv(ilev_)%default()
case ('AS')
nlev_ = 1
ilev_ = 1
@@ -161,7 +162,7 @@ subroutine mld_sprecinit(p,ptype,info,nlev)
case ('ML')
if (present(nlev)) then
nlev_ = max(1,nlev)
else
@@ -198,10 +199,15 @@ subroutine mld_sprecinit(p,ptype,info,nlev)
call p%precv(ilev_)%set(mld_sub_prol_,psb_none_,info)
call p%precv(ilev_)%set(mld_sub_ovr_,0,info)
!!$ write(0,*) 'Check 5: ',allocated(p%precv(1)%sm)
thr = 0.16
do ilev_=1,nlev_
call p%precv(ilev_)%set(mld_aggr_thresh_,thr,info)
thr = thr/2
end do
case default
write(0,*) name,': Warning: Unknown preconditioner type request "',ptype,'"'
write(psb_err_unit,*) name,&
&': Warning: Unknown preconditioner type request "',ptype,'"'
info = psb_err_pivot_too_small_
end select
+28 -15
View File
@@ -106,7 +106,8 @@ subroutine mld_sprecseti(p,what,val,info,ilev)
if (.not.allocated(p%precv)) then
info = 3111
write(psb_err_unit,*) name,': Error: uninitialized preconditioner,',&
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
return
endif
@@ -120,7 +121,8 @@ subroutine mld_sprecseti(p,what,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
write(psb_err_unit,*) name,&
&': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
@@ -166,14 +168,16 @@ subroutine mld_sprecseti(p,what,val,info,ilev)
case(mld_coarse_subsolve_)
if (ilev_ /= nlev_) then
write(0,*) name,': Error: Inconsistent specification of WHAT vs. ILEV'
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call onelev_set_solver(p%precv(ilev_),val,info)
case(mld_coarse_solve_)
if (ilev_ /= nlev_) then
write(0,*) name,': Error: Inconsistent specification of WHAT vs. ILEV'
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
@@ -206,7 +210,8 @@ subroutine mld_sprecseti(p,what,val,info,ilev)
endif
case(mld_coarse_sweeps_)
if (ilev_ /= nlev_) then
write(0,*) name,': Error: Inconsistent specification of WHAT vs. ILEV'
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
@@ -214,7 +219,8 @@ subroutine mld_sprecseti(p,what,val,info,ilev)
case(mld_coarse_fillin_)
if (ilev_ /= nlev_) then
write(0,*) name,': Error: Inconsistent specification of WHAT vs. ILEV'
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
@@ -234,7 +240,7 @@ subroutine mld_sprecseti(p,what,val,info,ilev)
case(mld_sub_solve_)
do ilev_=1,max(1,nlev_-1)
if (.not.allocated(p%precv(ilev_)%sm)) then
write(0,*) name,&
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner component,',&
& ' should call MLD_PRECINIT'
info = -1
@@ -530,7 +536,8 @@ subroutine mld_sprecsetsm(p,val,info,ilev)
if (.not.allocated(p%precv)) then
info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',&
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
return
endif
@@ -548,7 +555,8 @@ subroutine mld_sprecsetsm(p,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(0,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
@@ -591,7 +599,8 @@ subroutine mld_sprecsetsv(p,val,info,ilev)
if (.not.allocated(p%precv)) then
info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',&
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
return
endif
@@ -610,7 +619,8 @@ subroutine mld_sprecsetsv(p,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(0,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
@@ -627,7 +637,7 @@ subroutine mld_sprecsetsv(p,val,info,ilev)
call p%precv(ilev_)%sm%sv%default()
else
info = 3111
write(0,*) name,&
write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner component,',&
&' should call MLD_PRECINIT/MLD_PRECSET'
return
@@ -713,7 +723,8 @@ subroutine mld_sprecsetc(p,what,string,info,ilev)
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
write(0,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',ilev_, nlev_
info = -1
return
endif
@@ -791,7 +802,8 @@ subroutine mld_sprecsetr(p,what,val,info,ilev)
end if
if (.not.allocated(p%precv)) then
write(0,*) name,': Error: uninitialized preconditioner,',&
write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
info = 3111
return
@@ -799,7 +811,8 @@ subroutine mld_sprecsetr(p,what,val,info,ilev)
nlev_ = size(p%precv)
if ((ilev_<1).or.(ilev_ > nlev_)) then
write(0,*) name,': Error: invalid ILEV/NLEV combination',&
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',&
& ilev_, nlev_
info = -1
return
+15 -9
View File
@@ -107,17 +107,18 @@ subroutine mld_zprecinit(p,ptype,info,nlev)
implicit none
! Arguments
! Arguments
type(mld_zprec_type), intent(inout) :: p
character(len=*), intent(in) :: ptype
integer, intent(out) :: info
integer, optional, intent(in) :: nlev
! Local variables
! Local variables
integer :: nlev_, ilev_
real(psb_dpk_) :: thr
character(len=*), parameter :: name='mld_precinit'
info = psb_success_
if (allocated(p%precv)) then
call mld_precfree(p,info)
if (info /= psb_success_) then
@@ -134,7 +135,7 @@ subroutine mld_zprecinit(p,ptype,info,nlev)
if (info /= psb_success_) return
allocate(mld_z_id_solver_type :: p%precv(ilev_)%sm%sv, stat=info)
call p%precv(ilev_)%default()
case ('JAC','DIAG','JACOBI')
nlev_ = 1
ilev_ = 1
@@ -152,7 +153,7 @@ subroutine mld_zprecinit(p,ptype,info,nlev)
if (info /= psb_success_) return
allocate(mld_z_ilu_solver_type :: p%precv(ilev_)%sm%sv, stat=info)
call p%precv(ilev_)%default()
case ('AS')
nlev_ = 1
ilev_ = 1
@@ -164,7 +165,7 @@ subroutine mld_zprecinit(p,ptype,info,nlev)
case ('ML')
if (present(nlev)) then
nlev_ = max(1,nlev)
else
@@ -201,10 +202,15 @@ subroutine mld_zprecinit(p,ptype,info,nlev)
call p%precv(ilev_)%set(mld_sub_prol_,psb_none_,info)
call p%precv(ilev_)%set(mld_sub_ovr_,0,info)
!!$ write(0,*) 'Check 5: ',allocated(p%precv(1)%sm)
thr = 0.16
do ilev_=1,nlev_
call p%precv(ilev_)%set(mld_aggr_thresh_,thr,info)
thr = thr/2
end do
case default
write(0,*) name,': Warning: Unknown preconditioner type request "',ptype,'"'
write(psb_err_unit,*) name,&
&': Warning: Unknown preconditioner type request "',ptype,'"'
info = psb_err_pivot_too_small_
end select
+28 -15
View File
@@ -110,7 +110,8 @@ subroutine mld_zprecseti(p,what,val,info,ilev)
if (.not.allocated(p%precv)) then
info = 3111
write(psb_err_unit,*) name,': Error: uninitialized preconditioner,',&
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
return
endif
@@ -124,7 +125,8 @@ subroutine mld_zprecseti(p,what,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
write(psb_err_unit,*) name,&
&': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
@@ -170,14 +172,16 @@ subroutine mld_zprecseti(p,what,val,info,ilev)
case(mld_coarse_subsolve_)
if (ilev_ /= nlev_) then
write(0,*) name,': Error: Inconsistent specification of WHAT vs. ILEV'
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call onelev_set_solver(p%precv(ilev_),val,info)
case(mld_coarse_solve_)
if (ilev_ /= nlev_) then
write(0,*) name,': Error: Inconsistent specification of WHAT vs. ILEV'
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
@@ -212,7 +216,8 @@ subroutine mld_zprecseti(p,what,val,info,ilev)
endif
case(mld_coarse_sweeps_)
if (ilev_ /= nlev_) then
write(0,*) name,': Error: Inconsistent specification of WHAT vs. ILEV'
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
@@ -220,7 +225,8 @@ subroutine mld_zprecseti(p,what,val,info,ilev)
case(mld_coarse_fillin_)
if (ilev_ /= nlev_) then
write(0,*) name,': Error: Inconsistent specification of WHAT vs. ILEV'
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
@@ -240,7 +246,7 @@ subroutine mld_zprecseti(p,what,val,info,ilev)
case(mld_sub_solve_)
do ilev_=1,max(1,nlev_-1)
if (.not.allocated(p%precv(ilev_)%sm)) then
write(0,*) name,&
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner component,',&
& ' should call MLD_PRECINIT'
info = -1
@@ -553,7 +559,8 @@ subroutine mld_zprecsetsm(p,val,info,ilev)
if (.not.allocated(p%precv)) then
info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',&
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
return
endif
@@ -571,7 +578,8 @@ subroutine mld_zprecsetsm(p,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(0,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
@@ -614,7 +622,8 @@ subroutine mld_zprecsetsv(p,val,info,ilev)
if (.not.allocated(p%precv)) then
info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',&
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
return
endif
@@ -633,7 +642,8 @@ subroutine mld_zprecsetsv(p,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(0,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
@@ -650,7 +660,7 @@ subroutine mld_zprecsetsv(p,val,info,ilev)
call p%precv(ilev_)%sm%sv%default()
else
info = 3111
write(0,*) name,&
write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner component,',&
&' should call MLD_PRECINIT/MLD_PRECSET'
return
@@ -736,7 +746,8 @@ subroutine mld_zprecsetc(p,what,string,info,ilev)
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
write(0,*) name,': Error: invalid ILEV/NLEV combination',ilev_, nlev_
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',ilev_, nlev_
info = -1
return
endif
@@ -815,7 +826,8 @@ subroutine mld_zprecsetr(p,what,val,info,ilev)
end if
if (.not.allocated(p%precv)) then
write(0,*) name,': Error: uninitialized preconditioner,',&
write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
info = 3111
return
@@ -823,7 +835,8 @@ subroutine mld_zprecsetr(p,what,val,info,ilev)
nlev_ = size(p%precv)
if ((ilev_<1).or.(ilev_ > nlev_)) then
write(0,*) name,': Error: invalid ILEV/NLEV combination',&
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',&
& ilev_, nlev_
info = -1
return