|
|
@ -393,7 +393,7 @@ contains
|
|
|
|
if(debug_level > 1) then
|
|
|
|
if(debug_level > 1) then
|
|
|
|
write(debug_unit,*) me,' Start inner_ml_aply at level ',level, info
|
|
|
|
write(debug_unit,*) me,' Start inner_ml_aply at level ',level, info
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (me >= 0) then
|
|
|
|
select case(p%precv(level)%parms%ml_cycle)
|
|
|
|
select case(p%precv(level)%parms%ml_cycle)
|
|
|
|
|
|
|
|
|
|
|
|
case(amg_no_ml_)
|
|
|
|
case(amg_no_ml_)
|
|
|
@ -426,6 +426,7 @@ contains
|
|
|
|
if(debug_level > 1) then
|
|
|
|
if(debug_level > 1) then
|
|
|
|
write(debug_unit,*) me,' End inner_ml_aply at level ',level
|
|
|
|
write(debug_unit,*) me,' End inner_ml_aply at level ',level
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -492,6 +493,7 @@ contains
|
|
|
|
& base_a => p%precv(level)%base_a, base_desc=>p%precv(level)%base_desc,&
|
|
|
|
& base_a => p%precv(level)%base_a, base_desc=>p%precv(level)%base_desc,&
|
|
|
|
& wv => p%precv(level)%wrk%wv)
|
|
|
|
& wv => p%precv(level)%wrk%wv)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (me >= 0) then
|
|
|
|
if (allocated(p%precv(level)%sm2a)) then
|
|
|
|
if (allocated(p%precv(level)%sm2a)) then
|
|
|
|
call psb_geaxpby(cone,vx2l,czero,vy2l,base_desc,info)
|
|
|
|
call psb_geaxpby(cone,vx2l,czero,vy2l,base_desc,info)
|
|
|
|
|
|
|
|
|
|
|
@ -515,6 +517,7 @@ contains
|
|
|
|
& base_desc, trans,&
|
|
|
|
& base_desc, trans,&
|
|
|
|
& sweeps,work,wv,info,init='Z')
|
|
|
|
& sweeps,work,wv,info,init='Z')
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
end if
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
& a_err='Error during ADD smoother_apply')
|
|
|
|
& a_err='Error during ADD smoother_apply')
|
|
|
@ -602,7 +605,6 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
ctxt = p%precv(level)%base_desc%get_context()
|
|
|
|
ctxt = p%precv(level)%base_desc%get_context()
|
|
|
|
call psb_info(ctxt, me, np)
|
|
|
|
call psb_info(ctxt, me, np)
|
|
|
|
|
|
|
|
|
|
|
|
if(debug_level > 1) then
|
|
|
|
if(debug_level > 1) then
|
|
|
|
write(debug_unit,*) me,' inner_mult at level ',level
|
|
|
|
write(debug_unit,*) me,' inner_mult at level ',level
|
|
|
|
end if
|
|
|
|
end if
|
|
|
@ -623,6 +625,8 @@ contains
|
|
|
|
!
|
|
|
|
!
|
|
|
|
|
|
|
|
|
|
|
|
if (pre) then
|
|
|
|
if (pre) then
|
|
|
|
|
|
|
|
if (me >=0) then
|
|
|
|
|
|
|
|
!!$ write(0,*) me,'Applying smoother pre ', level
|
|
|
|
if (trans == 'N') then
|
|
|
|
if (trans == 'N') then
|
|
|
|
sweeps = p%precv(level)%parms%sweeps_pre
|
|
|
|
sweeps = p%precv(level)%parms%sweeps_pre
|
|
|
|
if (info == psb_success_) call p%precv(level)%sm%apply(cone,&
|
|
|
|
if (info == psb_success_) call p%precv(level)%sm%apply(cone,&
|
|
|
@ -641,6 +645,7 @@ contains
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
endif
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Compute the residual for next level and call recursively
|
|
|
|
! Compute the residual for next level and call recursively
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -696,11 +701,13 @@ contains
|
|
|
|
|
|
|
|
|
|
|
|
if (p%precv(level)%parms%ml_cycle == amg_wcycle_ml_) then
|
|
|
|
if (p%precv(level)%parms%ml_cycle == amg_wcycle_ml_) then
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (me >=0) then
|
|
|
|
call psb_geaxpby(cone,vx2l, czero,vty,&
|
|
|
|
call psb_geaxpby(cone,vx2l, czero,vty,&
|
|
|
|
& base_desc,info)
|
|
|
|
& base_desc,info)
|
|
|
|
if (info == psb_success_) call psb_spmm(-cone,base_a,&
|
|
|
|
if (info == psb_success_) call psb_spmm(-cone,base_a,&
|
|
|
|
& vy2l,cone,vty,&
|
|
|
|
& vy2l,cone,vty,&
|
|
|
|
& base_desc,info,work=work,trans=trans)
|
|
|
|
& base_desc,info,work=work,trans=trans)
|
|
|
|
|
|
|
|
end if
|
|
|
|
if (info == psb_success_) &
|
|
|
|
if (info == psb_success_) &
|
|
|
|
& call p%precv(level+1)%map_rstr(cone,vty,&
|
|
|
|
& call p%precv(level+1)%map_rstr(cone,vty,&
|
|
|
|
& czero,p%precv(level+1)%wrk%vx2l,info,work=work,&
|
|
|
|
& czero,p%precv(level+1)%wrk%vx2l,info,work=work,&
|
|
|
@ -728,6 +735,7 @@ contains
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (post) then
|
|
|
|
if (post) then
|
|
|
|
|
|
|
|
if (me >=0) then
|
|
|
|
call psb_geaxpby(cone,vx2l,&
|
|
|
|
call psb_geaxpby(cone,vx2l,&
|
|
|
|
& czero,vty,&
|
|
|
|
& czero,vty,&
|
|
|
|
& base_desc,info)
|
|
|
|
& base_desc,info)
|
|
|
@ -754,6 +762,7 @@ contains
|
|
|
|
& vty,cone,vy2l, base_desc, trans,&
|
|
|
|
& vty,cone,vy2l, base_desc, trans,&
|
|
|
|
& sweeps,work,wv,info,init='Z')
|
|
|
|
& sweeps,work,wv,info,init='Z')
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
@ -764,11 +773,14 @@ contains
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
else if (level == nlev) then
|
|
|
|
else if (level == nlev) then
|
|
|
|
|
|
|
|
!!$ write(0,*) me,'Applying smoother at top level ',psb_errstatus_fatal()
|
|
|
|
|
|
|
|
if (me >=0) then
|
|
|
|
sweeps = p%precv(level)%parms%sweeps_pre
|
|
|
|
sweeps = p%precv(level)%parms%sweeps_pre
|
|
|
|
if (info == psb_success_) call p%precv(level)%sm%apply(cone,&
|
|
|
|
if (info == psb_success_) call p%precv(level)%sm%apply(cone,&
|
|
|
|
& vx2l,czero,vy2l,base_desc, trans,&
|
|
|
|
& vx2l,czero,vy2l,base_desc, trans,&
|
|
|
|
& sweeps,work,wv,info)
|
|
|
|
& sweeps,work,wv,info)
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
!!$ write(0,*) me,' Done applying smoother at top level ',psb_errstatus_fatal()
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
|
@ -778,7 +790,7 @@ contains
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end associate
|
|
|
|
end associate
|
|
|
|
|
|
|
|
9998 continue
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
@ -847,7 +859,9 @@ contains
|
|
|
|
& vtx => p%precv(level)%wrk%vtx,vty => p%precv(level)%wrk%vty,&
|
|
|
|
& vtx => p%precv(level)%wrk%vtx,vty => p%precv(level)%wrk%vty,&
|
|
|
|
& base_a => p%precv(level)%base_a, base_desc=>p%precv(level)%base_desc,&
|
|
|
|
& base_a => p%precv(level)%base_a, base_desc=>p%precv(level)%base_desc,&
|
|
|
|
& wv => p%precv(level)%wrk%wv(8:))
|
|
|
|
& wv => p%precv(level)%wrk%wv(8:))
|
|
|
|
|
|
|
|
|
|
|
|
if (level == nlev) then
|
|
|
|
if (level == nlev) then
|
|
|
|
|
|
|
|
if (me >= 0) then
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Apply smoother
|
|
|
|
! Apply smoother
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -855,8 +869,9 @@ contains
|
|
|
|
if (info == psb_success_) call p%precv(level)%sm%apply(cone,&
|
|
|
|
if (info == psb_success_) call p%precv(level)%sm%apply(cone,&
|
|
|
|
& vx2l,czero,vy2l,base_desc, trans,&
|
|
|
|
& vx2l,czero,vy2l,base_desc, trans,&
|
|
|
|
& sweeps,work,wv,info,init='Z')
|
|
|
|
& sweeps,work,wv,info,init='Z')
|
|
|
|
|
|
|
|
end if
|
|
|
|
else if (level < nlev) then
|
|
|
|
else if (level < nlev) then
|
|
|
|
|
|
|
|
if (me >= 0) then
|
|
|
|
|
|
|
|
|
|
|
|
if (trans == 'N') then
|
|
|
|
if (trans == 'N') then
|
|
|
|
sweeps = p%precv(level)%parms%sweeps_pre
|
|
|
|
sweeps = p%precv(level)%parms%sweeps_pre
|
|
|
@ -869,14 +884,12 @@ contains
|
|
|
|
& vx2l,czero,vy2l,base_desc, trans,&
|
|
|
|
& vx2l,czero,vy2l,base_desc, trans,&
|
|
|
|
& sweeps,work,wv,info,init='Z')
|
|
|
|
& sweeps,work,wv,info,init='Z')
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
& a_err='Error during 2-PRE smoother_apply')
|
|
|
|
& a_err='Error during 2-PRE smoother_apply')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Compute the residual and call recursively
|
|
|
|
! Compute the residual and call recursively
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -892,7 +905,7 @@ contains
|
|
|
|
& a_err='Error during residue')
|
|
|
|
& a_err='Error during residue')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
end if
|
|
|
|
! Apply the restriction
|
|
|
|
! Apply the restriction
|
|
|
|
call p%precv(level + 1)%map_rstr(cone,vty,&
|
|
|
|
call p%precv(level + 1)%map_rstr(cone,vty,&
|
|
|
|
& czero,p%precv(level + 1)%wrk%vx2l,&
|
|
|
|
& czero,p%precv(level + 1)%wrk%vx2l,&
|
|
|
@ -940,7 +953,7 @@ contains
|
|
|
|
& a_err='Error during prolongation')
|
|
|
|
& a_err='Error during prolongation')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
if (me >= 0) then
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Compute the residual
|
|
|
|
! Compute the residual
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -974,6 +987,8 @@ contains
|
|
|
|
& a_err='Error during POST smoother_apply')
|
|
|
|
& a_err='Error during POST smoother_apply')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
|
|
info = psb_err_internal_error_
|
|
|
|
info = psb_err_internal_error_
|
|
|
@ -991,7 +1006,6 @@ contains
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine amg_c_inner_k_cycle
|
|
|
|
end subroutine amg_c_inner_k_cycle
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
recursive subroutine amg_cinneritkcycle(p, level, trans, work, innersolv)
|
|
|
|
recursive subroutine amg_cinneritkcycle(p, level, trans, work, innersolv)
|
|
|
|
use psb_base_mod
|
|
|
|
use psb_base_mod
|
|
|
|
use amg_prec_mod
|
|
|
|
use amg_prec_mod
|
|
|
|