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