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.
stopcriterion
Salvatore Filippone 14 years ago
parent 953ee272ea
commit 8e4c0c99fd

@ -104,17 +104,18 @@ subroutine mld_cprecinit(p,ptype,info,nlev)
implicit none implicit none
! Arguments ! Arguments
type(mld_cprec_type), intent(inout) :: p type(mld_cprec_type), intent(inout) :: p
character(len=*), intent(in) :: ptype character(len=*), intent(in) :: ptype
integer, intent(out) :: info integer, intent(out) :: info
integer, optional, intent(in) :: nlev integer, optional, intent(in) :: nlev
! Local variables ! Local variables
integer :: nlev_, ilev_ integer :: nlev_, ilev_
real(psb_spk_) :: thr
character(len=*), parameter :: name='mld_precinit' character(len=*), parameter :: name='mld_precinit'
info = psb_success_ info = psb_success_
if (allocated(p%precv)) then if (allocated(p%precv)) then
call mld_precfree(p,info) call mld_precfree(p,info)
if (info /= psb_success_) then if (info /= psb_success_) then
@ -131,7 +132,7 @@ subroutine mld_cprecinit(p,ptype,info,nlev)
if (info /= psb_success_) return if (info /= psb_success_) return
allocate(mld_c_id_solver_type :: p%precv(ilev_)%sm%sv, stat=info) allocate(mld_c_id_solver_type :: p%precv(ilev_)%sm%sv, stat=info)
call p%precv(ilev_)%default() call p%precv(ilev_)%default()
case ('JAC','DIAG','JACOBI') case ('JAC','DIAG','JACOBI')
nlev_ = 1 nlev_ = 1
ilev_ = 1 ilev_ = 1
@ -149,7 +150,7 @@ subroutine mld_cprecinit(p,ptype,info,nlev)
if (info /= psb_success_) return if (info /= psb_success_) return
allocate(mld_c_ilu_solver_type :: p%precv(ilev_)%sm%sv, stat=info) allocate(mld_c_ilu_solver_type :: p%precv(ilev_)%sm%sv, stat=info)
call p%precv(ilev_)%default() call p%precv(ilev_)%default()
case ('AS') case ('AS')
nlev_ = 1 nlev_ = 1
ilev_ = 1 ilev_ = 1
@ -161,7 +162,7 @@ subroutine mld_cprecinit(p,ptype,info,nlev)
case ('ML') case ('ML')
if (present(nlev)) then if (present(nlev)) then
nlev_ = max(1,nlev) nlev_ = max(1,nlev)
else 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_prol_,psb_none_,info)
call p%precv(ilev_)%set(mld_sub_ovr_,0,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 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_ info = psb_err_pivot_too_small_
end select end select

@ -106,7 +106,8 @@ subroutine mld_cprecseti(p,what,val,info,ilev)
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
info = 3111 info = 3111
write(psb_err_unit,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
return return
endif endif
@ -120,7 +121,8 @@ subroutine mld_cprecseti(p,what,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1 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 return
endif endif
@ -166,14 +168,16 @@ subroutine mld_cprecseti(p,what,val,info,ilev)
case(mld_coarse_subsolve_) case(mld_coarse_subsolve_)
if (ilev_ /= nlev_) then 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 info = -2
return return
end if end if
call onelev_set_solver(p%precv(ilev_),val,info) call onelev_set_solver(p%precv(ilev_),val,info)
case(mld_coarse_solve_) case(mld_coarse_solve_)
if (ilev_ /= nlev_) then 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 info = -2
return return
end if end if
@ -206,7 +210,8 @@ subroutine mld_cprecseti(p,what,val,info,ilev)
endif endif
case(mld_coarse_sweeps_) case(mld_coarse_sweeps_)
if (ilev_ /= nlev_) then 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 info = -2
return return
end if end if
@ -214,7 +219,8 @@ subroutine mld_cprecseti(p,what,val,info,ilev)
case(mld_coarse_fillin_) case(mld_coarse_fillin_)
if (ilev_ /= nlev_) then 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 info = -2
return return
end if end if
@ -234,7 +240,7 @@ subroutine mld_cprecseti(p,what,val,info,ilev)
case(mld_sub_solve_) case(mld_sub_solve_)
do ilev_=1,max(1,nlev_-1) do ilev_=1,max(1,nlev_-1)
if (.not.allocated(p%precv(ilev_)%sm)) then if (.not.allocated(p%precv(ilev_)%sm)) then
write(0,*) name,& write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner component,',& & ': Error: uninitialized preconditioner component,',&
& ' should call MLD_PRECINIT' & ' should call MLD_PRECINIT'
info = -1 info = -1
@ -529,7 +535,8 @@ subroutine mld_cprecsetsm(p,val,info,ilev)
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
info = 3111 info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
return return
endif endif
@ -547,7 +554,8 @@ subroutine mld_cprecsetsm(p,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1 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 return
endif endif
@ -590,7 +598,8 @@ subroutine mld_cprecsetsv(p,val,info,ilev)
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
info = 3111 info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
return return
endif endif
@ -609,7 +618,8 @@ subroutine mld_cprecsetsv(p,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1 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 return
endif endif
@ -626,7 +636,7 @@ subroutine mld_cprecsetsv(p,val,info,ilev)
call p%precv(ilev_)%sm%sv%default() call p%precv(ilev_)%sm%sv%default()
else else
info = 3111 info = 3111
write(0,*) name,& write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner component,',& &': Error: uninitialized preconditioner component,',&
&' should call MLD_PRECINIT/MLD_PRECSET' &' should call MLD_PRECINIT/MLD_PRECSET'
return return
@ -712,7 +722,8 @@ subroutine mld_cprecsetc(p,what,string,info,ilev)
end if end if
if ((ilev_<1).or.(ilev_ > nlev_)) then 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 info = -1
return return
endif endif
@ -790,7 +801,8 @@ subroutine mld_cprecsetr(p,what,val,info,ilev)
end if end if
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
write(0,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
info = 3111 info = 3111
return return
@ -798,7 +810,8 @@ subroutine mld_cprecsetr(p,what,val,info,ilev)
nlev_ = size(p%precv) nlev_ = size(p%precv)
if ((ilev_<1).or.(ilev_ > nlev_)) then 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_ & ilev_, nlev_
info = -1 info = -1
return return

@ -107,17 +107,18 @@ subroutine mld_dprecinit(p,ptype,info,nlev)
implicit none implicit none
! Arguments ! Arguments
type(mld_dprec_type), intent(inout) :: p type(mld_dprec_type), intent(inout) :: p
character(len=*), intent(in) :: ptype character(len=*), intent(in) :: ptype
integer, intent(out) :: info integer, intent(out) :: info
integer, optional, intent(in) :: nlev integer, optional, intent(in) :: nlev
! Local variables ! Local variables
integer :: nlev_, ilev_ integer :: nlev_, ilev_
real(psb_dpk_) :: thr
character(len=*), parameter :: name='mld_precinit' character(len=*), parameter :: name='mld_precinit'
info = psb_success_ info = psb_success_
if (allocated(p%precv)) then if (allocated(p%precv)) then
call mld_precfree(p,info) call mld_precfree(p,info)
if (info /= psb_success_) then if (info /= psb_success_) then
@ -134,7 +135,7 @@ subroutine mld_dprecinit(p,ptype,info,nlev)
if (info /= psb_success_) return if (info /= psb_success_) return
allocate(mld_d_id_solver_type :: p%precv(ilev_)%sm%sv, stat=info) allocate(mld_d_id_solver_type :: p%precv(ilev_)%sm%sv, stat=info)
call p%precv(ilev_)%default() call p%precv(ilev_)%default()
case ('JAC','DIAG','JACOBI') case ('JAC','DIAG','JACOBI')
nlev_ = 1 nlev_ = 1
ilev_ = 1 ilev_ = 1
@ -152,7 +153,7 @@ subroutine mld_dprecinit(p,ptype,info,nlev)
if (info /= psb_success_) return if (info /= psb_success_) return
allocate(mld_d_ilu_solver_type :: p%precv(ilev_)%sm%sv, stat=info) allocate(mld_d_ilu_solver_type :: p%precv(ilev_)%sm%sv, stat=info)
call p%precv(ilev_)%default() call p%precv(ilev_)%default()
case ('AS') case ('AS')
nlev_ = 1 nlev_ = 1
ilev_ = 1 ilev_ = 1
@ -164,7 +165,7 @@ subroutine mld_dprecinit(p,ptype,info,nlev)
case ('ML') case ('ML')
if (present(nlev)) then if (present(nlev)) then
nlev_ = max(1,nlev) nlev_ = max(1,nlev)
else 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_prol_,psb_none_,info)
call p%precv(ilev_)%set(mld_sub_ovr_,0,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 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_ info = psb_err_pivot_too_small_
end select end select

@ -109,7 +109,8 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
info = 3111 info = 3111
write(psb_err_unit,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
return return
endif endif
@ -123,7 +124,8 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1 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 return
endif endif
@ -150,7 +152,6 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
case default case default
call p%precv(ilev_)%set(what,val,info) call p%precv(ilev_)%set(what,val,info)
call p%precv(ilev_)%set(what,val,info)
end select end select
else if (ilev_ > 1) then else if (ilev_ > 1) then
@ -170,14 +171,16 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
case(mld_coarse_subsolve_) case(mld_coarse_subsolve_)
if (ilev_ /= nlev_) then 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 info = -2
return return
end if end if
call onelev_set_solver(p%precv(ilev_),val,info) call onelev_set_solver(p%precv(ilev_),val,info)
case(mld_coarse_solve_) case(mld_coarse_solve_)
if (ilev_ /= nlev_) then 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 info = -2
return return
end if end if
@ -212,7 +215,8 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
endif endif
case(mld_coarse_sweeps_) case(mld_coarse_sweeps_)
if (ilev_ /= nlev_) then 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 info = -2
return return
end if end if
@ -220,14 +224,14 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
case(mld_coarse_fillin_) case(mld_coarse_fillin_)
if (ilev_ /= nlev_) then 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 info = -2
return return
end if end if
call p%precv(nlev_)%set(mld_sub_fillin_,val,info) call p%precv(nlev_)%set(mld_sub_fillin_,val,info)
case default case default
call p%precv(ilev_)%set(what,val,info) call p%precv(ilev_)%set(what,val,info)
call p%precv(ilev_)%set(what,val,info)
end select end select
endif endif
@ -241,7 +245,7 @@ subroutine mld_dprecseti(p,what,val,info,ilev)
case(mld_sub_solve_) case(mld_sub_solve_)
do ilev_=1,max(1,nlev_-1) do ilev_=1,max(1,nlev_-1)
if (.not.allocated(p%precv(ilev_)%sm)) then if (.not.allocated(p%precv(ilev_)%sm)) then
write(0,*) name,& write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner component,',& & ': Error: uninitialized preconditioner component,',&
& ' should call MLD_PRECINIT' & ' should call MLD_PRECINIT'
info = -1 info = -1
@ -554,7 +558,8 @@ subroutine mld_dprecsetsm(p,val,info,ilev)
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
info = 3111 info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
return return
endif endif
@ -572,7 +577,8 @@ subroutine mld_dprecsetsm(p,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1 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 return
endif endif
@ -615,7 +621,8 @@ subroutine mld_dprecsetsv(p,val,info,ilev)
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
info = 3111 info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
return return
endif endif
@ -634,7 +641,8 @@ subroutine mld_dprecsetsv(p,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1 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 return
endif endif
@ -651,7 +659,7 @@ subroutine mld_dprecsetsv(p,val,info,ilev)
call p%precv(ilev_)%sm%sv%default() call p%precv(ilev_)%sm%sv%default()
else else
info = 3111 info = 3111
write(0,*) name,& write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner component,',& &': Error: uninitialized preconditioner component,',&
&' should call MLD_PRECINIT/MLD_PRECSET' &' should call MLD_PRECINIT/MLD_PRECSET'
return return
@ -736,7 +744,8 @@ subroutine mld_dprecsetc(p,what,string,info,ilev)
end if end if
if ((ilev_<1).or.(ilev_ > nlev_)) then 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 info = -1
return return
endif endif
@ -813,7 +822,8 @@ subroutine mld_dprecsetr(p,what,val,info,ilev)
end if end if
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
write(0,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
info = 3111 info = 3111
return return
@ -821,7 +831,8 @@ subroutine mld_dprecsetr(p,what,val,info,ilev)
nlev_ = size(p%precv) nlev_ = size(p%precv)
if ((ilev_<1).or.(ilev_ > nlev_)) then 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_ & ilev_, nlev_
info = -1 info = -1
return return

@ -104,17 +104,18 @@ subroutine mld_sprecinit(p,ptype,info,nlev)
implicit none implicit none
! Arguments ! Arguments
type(mld_sprec_type), intent(inout) :: p type(mld_sprec_type), intent(inout) :: p
character(len=*), intent(in) :: ptype character(len=*), intent(in) :: ptype
integer, intent(out) :: info integer, intent(out) :: info
integer, optional, intent(in) :: nlev integer, optional, intent(in) :: nlev
! Local variables ! Local variables
integer :: nlev_, ilev_ integer :: nlev_, ilev_
real(psb_spk_) :: thr
character(len=*), parameter :: name='mld_precinit' character(len=*), parameter :: name='mld_precinit'
info = psb_success_ info = psb_success_
if (allocated(p%precv)) then if (allocated(p%precv)) then
call mld_precfree(p,info) call mld_precfree(p,info)
if (info /= psb_success_) then if (info /= psb_success_) then
@ -131,7 +132,7 @@ subroutine mld_sprecinit(p,ptype,info,nlev)
if (info /= psb_success_) return if (info /= psb_success_) return
allocate(mld_s_id_solver_type :: p%precv(ilev_)%sm%sv, stat=info) allocate(mld_s_id_solver_type :: p%precv(ilev_)%sm%sv, stat=info)
call p%precv(ilev_)%default() call p%precv(ilev_)%default()
case ('JAC','DIAG','JACOBI') case ('JAC','DIAG','JACOBI')
nlev_ = 1 nlev_ = 1
ilev_ = 1 ilev_ = 1
@ -149,7 +150,7 @@ subroutine mld_sprecinit(p,ptype,info,nlev)
if (info /= psb_success_) return if (info /= psb_success_) return
allocate(mld_s_ilu_solver_type :: p%precv(ilev_)%sm%sv, stat=info) allocate(mld_s_ilu_solver_type :: p%precv(ilev_)%sm%sv, stat=info)
call p%precv(ilev_)%default() call p%precv(ilev_)%default()
case ('AS') case ('AS')
nlev_ = 1 nlev_ = 1
ilev_ = 1 ilev_ = 1
@ -161,7 +162,7 @@ subroutine mld_sprecinit(p,ptype,info,nlev)
case ('ML') case ('ML')
if (present(nlev)) then if (present(nlev)) then
nlev_ = max(1,nlev) nlev_ = max(1,nlev)
else 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_prol_,psb_none_,info)
call p%precv(ilev_)%set(mld_sub_ovr_,0,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 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_ info = psb_err_pivot_too_small_
end select end select

@ -106,7 +106,8 @@ subroutine mld_sprecseti(p,what,val,info,ilev)
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
info = 3111 info = 3111
write(psb_err_unit,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
return return
endif endif
@ -120,7 +121,8 @@ subroutine mld_sprecseti(p,what,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1 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 return
endif endif
@ -166,14 +168,16 @@ subroutine mld_sprecseti(p,what,val,info,ilev)
case(mld_coarse_subsolve_) case(mld_coarse_subsolve_)
if (ilev_ /= nlev_) then 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 info = -2
return return
end if end if
call onelev_set_solver(p%precv(ilev_),val,info) call onelev_set_solver(p%precv(ilev_),val,info)
case(mld_coarse_solve_) case(mld_coarse_solve_)
if (ilev_ /= nlev_) then 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 info = -2
return return
end if end if
@ -206,7 +210,8 @@ subroutine mld_sprecseti(p,what,val,info,ilev)
endif endif
case(mld_coarse_sweeps_) case(mld_coarse_sweeps_)
if (ilev_ /= nlev_) then 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 info = -2
return return
end if end if
@ -214,7 +219,8 @@ subroutine mld_sprecseti(p,what,val,info,ilev)
case(mld_coarse_fillin_) case(mld_coarse_fillin_)
if (ilev_ /= nlev_) then 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 info = -2
return return
end if end if
@ -234,7 +240,7 @@ subroutine mld_sprecseti(p,what,val,info,ilev)
case(mld_sub_solve_) case(mld_sub_solve_)
do ilev_=1,max(1,nlev_-1) do ilev_=1,max(1,nlev_-1)
if (.not.allocated(p%precv(ilev_)%sm)) then if (.not.allocated(p%precv(ilev_)%sm)) then
write(0,*) name,& write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner component,',& & ': Error: uninitialized preconditioner component,',&
& ' should call MLD_PRECINIT' & ' should call MLD_PRECINIT'
info = -1 info = -1
@ -530,7 +536,8 @@ subroutine mld_sprecsetsm(p,val,info,ilev)
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
info = 3111 info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
return return
endif endif
@ -548,7 +555,8 @@ subroutine mld_sprecsetsm(p,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1 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 return
endif endif
@ -591,7 +599,8 @@ subroutine mld_sprecsetsv(p,val,info,ilev)
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
info = 3111 info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
return return
endif endif
@ -610,7 +619,8 @@ subroutine mld_sprecsetsv(p,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1 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 return
endif endif
@ -627,7 +637,7 @@ subroutine mld_sprecsetsv(p,val,info,ilev)
call p%precv(ilev_)%sm%sv%default() call p%precv(ilev_)%sm%sv%default()
else else
info = 3111 info = 3111
write(0,*) name,& write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner component,',& &': Error: uninitialized preconditioner component,',&
&' should call MLD_PRECINIT/MLD_PRECSET' &' should call MLD_PRECINIT/MLD_PRECSET'
return return
@ -713,7 +723,8 @@ subroutine mld_sprecsetc(p,what,string,info,ilev)
end if end if
if ((ilev_<1).or.(ilev_ > nlev_)) then 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 info = -1
return return
endif endif
@ -791,7 +802,8 @@ subroutine mld_sprecsetr(p,what,val,info,ilev)
end if end if
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
write(0,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
info = 3111 info = 3111
return return
@ -799,7 +811,8 @@ subroutine mld_sprecsetr(p,what,val,info,ilev)
nlev_ = size(p%precv) nlev_ = size(p%precv)
if ((ilev_<1).or.(ilev_ > nlev_)) then 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_ & ilev_, nlev_
info = -1 info = -1
return return

@ -107,17 +107,18 @@ subroutine mld_zprecinit(p,ptype,info,nlev)
implicit none implicit none
! Arguments ! Arguments
type(mld_zprec_type), intent(inout) :: p type(mld_zprec_type), intent(inout) :: p
character(len=*), intent(in) :: ptype character(len=*), intent(in) :: ptype
integer, intent(out) :: info integer, intent(out) :: info
integer, optional, intent(in) :: nlev integer, optional, intent(in) :: nlev
! Local variables ! Local variables
integer :: nlev_, ilev_ integer :: nlev_, ilev_
real(psb_dpk_) :: thr
character(len=*), parameter :: name='mld_precinit' character(len=*), parameter :: name='mld_precinit'
info = psb_success_ info = psb_success_
if (allocated(p%precv)) then if (allocated(p%precv)) then
call mld_precfree(p,info) call mld_precfree(p,info)
if (info /= psb_success_) then if (info /= psb_success_) then
@ -134,7 +135,7 @@ subroutine mld_zprecinit(p,ptype,info,nlev)
if (info /= psb_success_) return if (info /= psb_success_) return
allocate(mld_z_id_solver_type :: p%precv(ilev_)%sm%sv, stat=info) allocate(mld_z_id_solver_type :: p%precv(ilev_)%sm%sv, stat=info)
call p%precv(ilev_)%default() call p%precv(ilev_)%default()
case ('JAC','DIAG','JACOBI') case ('JAC','DIAG','JACOBI')
nlev_ = 1 nlev_ = 1
ilev_ = 1 ilev_ = 1
@ -152,7 +153,7 @@ subroutine mld_zprecinit(p,ptype,info,nlev)
if (info /= psb_success_) return if (info /= psb_success_) return
allocate(mld_z_ilu_solver_type :: p%precv(ilev_)%sm%sv, stat=info) allocate(mld_z_ilu_solver_type :: p%precv(ilev_)%sm%sv, stat=info)
call p%precv(ilev_)%default() call p%precv(ilev_)%default()
case ('AS') case ('AS')
nlev_ = 1 nlev_ = 1
ilev_ = 1 ilev_ = 1
@ -164,7 +165,7 @@ subroutine mld_zprecinit(p,ptype,info,nlev)
case ('ML') case ('ML')
if (present(nlev)) then if (present(nlev)) then
nlev_ = max(1,nlev) nlev_ = max(1,nlev)
else 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_prol_,psb_none_,info)
call p%precv(ilev_)%set(mld_sub_ovr_,0,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 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_ info = psb_err_pivot_too_small_
end select end select

@ -110,7 +110,8 @@ subroutine mld_zprecseti(p,what,val,info,ilev)
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
info = 3111 info = 3111
write(psb_err_unit,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
return return
endif endif
@ -124,7 +125,8 @@ subroutine mld_zprecseti(p,what,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1 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 return
endif endif
@ -170,14 +172,16 @@ subroutine mld_zprecseti(p,what,val,info,ilev)
case(mld_coarse_subsolve_) case(mld_coarse_subsolve_)
if (ilev_ /= nlev_) then 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 info = -2
return return
end if end if
call onelev_set_solver(p%precv(ilev_),val,info) call onelev_set_solver(p%precv(ilev_),val,info)
case(mld_coarse_solve_) case(mld_coarse_solve_)
if (ilev_ /= nlev_) then 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 info = -2
return return
end if end if
@ -212,7 +216,8 @@ subroutine mld_zprecseti(p,what,val,info,ilev)
endif endif
case(mld_coarse_sweeps_) case(mld_coarse_sweeps_)
if (ilev_ /= nlev_) then 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 info = -2
return return
end if end if
@ -220,7 +225,8 @@ subroutine mld_zprecseti(p,what,val,info,ilev)
case(mld_coarse_fillin_) case(mld_coarse_fillin_)
if (ilev_ /= nlev_) then 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 info = -2
return return
end if end if
@ -240,7 +246,7 @@ subroutine mld_zprecseti(p,what,val,info,ilev)
case(mld_sub_solve_) case(mld_sub_solve_)
do ilev_=1,max(1,nlev_-1) do ilev_=1,max(1,nlev_-1)
if (.not.allocated(p%precv(ilev_)%sm)) then if (.not.allocated(p%precv(ilev_)%sm)) then
write(0,*) name,& write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner component,',& & ': Error: uninitialized preconditioner component,',&
& ' should call MLD_PRECINIT' & ' should call MLD_PRECINIT'
info = -1 info = -1
@ -553,7 +559,8 @@ subroutine mld_zprecsetsm(p,val,info,ilev)
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
info = 3111 info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
return return
endif endif
@ -571,7 +578,8 @@ subroutine mld_zprecsetsm(p,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1 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 return
endif endif
@ -614,7 +622,8 @@ subroutine mld_zprecsetsv(p,val,info,ilev)
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
info = 3111 info = 3111
write(0,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
return return
endif endif
@ -633,7 +642,8 @@ subroutine mld_zprecsetsv(p,val,info,ilev)
if ((ilev_<1).or.(ilev_ > nlev_)) then if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1 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 return
endif endif
@ -650,7 +660,7 @@ subroutine mld_zprecsetsv(p,val,info,ilev)
call p%precv(ilev_)%sm%sv%default() call p%precv(ilev_)%sm%sv%default()
else else
info = 3111 info = 3111
write(0,*) name,& write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner component,',& &': Error: uninitialized preconditioner component,',&
&' should call MLD_PRECINIT/MLD_PRECSET' &' should call MLD_PRECINIT/MLD_PRECSET'
return return
@ -736,7 +746,8 @@ subroutine mld_zprecsetc(p,what,string,info,ilev)
end if end if
if ((ilev_<1).or.(ilev_ > nlev_)) then 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 info = -1
return return
endif endif
@ -815,7 +826,8 @@ subroutine mld_zprecsetr(p,what,val,info,ilev)
end if end if
if (.not.allocated(p%precv)) then if (.not.allocated(p%precv)) then
write(0,*) name,': Error: uninitialized preconditioner,',& write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT' &' should call MLD_PRECINIT'
info = 3111 info = 3111
return return
@ -823,7 +835,8 @@ subroutine mld_zprecsetr(p,what,val,info,ilev)
nlev_ = size(p%precv) nlev_ = size(p%precv)
if ((ilev_<1).or.(ilev_ > nlev_)) then 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_ & ilev_, nlev_
info = -1 info = -1
return return

Loading…
Cancel
Save