From c3985888f7dde1e37f6ad113702c527f52d4af55 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Wed, 27 Sep 2017 13:15:21 +0100 Subject: [PATCH] Fixed base smoother descr. --- .../smoother/mld_c_base_smoother_descr.f90 | 29 ++++++++++++++----- .../smoother/mld_d_base_smoother_descr.f90 | 29 ++++++++++++++----- .../smoother/mld_s_base_smoother_descr.f90 | 29 ++++++++++++++----- .../smoother/mld_z_base_smoother_descr.f90 | 29 ++++++++++++++----- 4 files changed, 84 insertions(+), 32 deletions(-) diff --git a/mlprec/impl/smoother/mld_c_base_smoother_descr.f90 b/mlprec/impl/smoother/mld_c_base_smoother_descr.f90 index f59ab7f4..b9ce5a34 100644 --- a/mlprec/impl/smoother/mld_c_base_smoother_descr.f90 +++ b/mlprec/impl/smoother/mld_c_base_smoother_descr.f90 @@ -39,6 +39,7 @@ subroutine mld_c_base_smoother_descr(sm,info,iout,coarse) use psb_base_mod use mld_c_base_smoother_mod, mld_protect_name => mld_c_base_smoother_descr + use mld_c_id_solver Implicit None ! Arguments @@ -69,16 +70,28 @@ subroutine mld_c_base_smoother_descr(sm,info,iout,coarse) iout_ = psb_out_unit end if - if (.not.coarse_) & - & write(iout_,*) 'Decoupled preconditioner/smoother with local solver' - if (allocated(sm%sv)) then - call sm%sv%descr(info,iout,coarse) - if (info /= psb_success_) then - info = psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='Local solver') - goto 9999 + if (coarse_) then + if (allocated(sm%sv)) call sm%sv%descr(info,iout,coarse) + else + if (allocated(sm%sv)) then + select type (sv => sm%sv) + class is (mld_c_id_solver_type) + write(iout_,*) 'No preconditioner/smoother' + class default + write(iout_,*) 'Decoupled preconditioner/smoother with local solver' + call sm%sv%descr(info,iout,coarse) + end select + else + write(iout_,*) 'No preconditioner/smoother' end if end if + + if (info /= psb_success_) then + info = psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='Local solver') + goto 9999 + end if + call psb_erractionrestore(err_act) return diff --git a/mlprec/impl/smoother/mld_d_base_smoother_descr.f90 b/mlprec/impl/smoother/mld_d_base_smoother_descr.f90 index a55c410d..86f3af20 100644 --- a/mlprec/impl/smoother/mld_d_base_smoother_descr.f90 +++ b/mlprec/impl/smoother/mld_d_base_smoother_descr.f90 @@ -39,6 +39,7 @@ subroutine mld_d_base_smoother_descr(sm,info,iout,coarse) use psb_base_mod use mld_d_base_smoother_mod, mld_protect_name => mld_d_base_smoother_descr + use mld_d_id_solver Implicit None ! Arguments @@ -69,16 +70,28 @@ subroutine mld_d_base_smoother_descr(sm,info,iout,coarse) iout_ = psb_out_unit end if - if (.not.coarse_) & - & write(iout_,*) 'Decoupled preconditioner/smoother with local solver' - if (allocated(sm%sv)) then - call sm%sv%descr(info,iout,coarse) - if (info /= psb_success_) then - info = psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='Local solver') - goto 9999 + if (coarse_) then + if (allocated(sm%sv)) call sm%sv%descr(info,iout,coarse) + else + if (allocated(sm%sv)) then + select type (sv => sm%sv) + class is (mld_d_id_solver_type) + write(iout_,*) 'No preconditioner/smoother' + class default + write(iout_,*) 'Decoupled preconditioner/smoother with local solver' + call sm%sv%descr(info,iout,coarse) + end select + else + write(iout_,*) 'No preconditioner/smoother' end if end if + + if (info /= psb_success_) then + info = psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='Local solver') + goto 9999 + end if + call psb_erractionrestore(err_act) return diff --git a/mlprec/impl/smoother/mld_s_base_smoother_descr.f90 b/mlprec/impl/smoother/mld_s_base_smoother_descr.f90 index 7da08114..f4177757 100644 --- a/mlprec/impl/smoother/mld_s_base_smoother_descr.f90 +++ b/mlprec/impl/smoother/mld_s_base_smoother_descr.f90 @@ -39,6 +39,7 @@ subroutine mld_s_base_smoother_descr(sm,info,iout,coarse) use psb_base_mod use mld_s_base_smoother_mod, mld_protect_name => mld_s_base_smoother_descr + use mld_s_id_solver Implicit None ! Arguments @@ -69,16 +70,28 @@ subroutine mld_s_base_smoother_descr(sm,info,iout,coarse) iout_ = psb_out_unit end if - if (.not.coarse_) & - & write(iout_,*) 'Decoupled preconditioner/smoother with local solver' - if (allocated(sm%sv)) then - call sm%sv%descr(info,iout,coarse) - if (info /= psb_success_) then - info = psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='Local solver') - goto 9999 + if (coarse_) then + if (allocated(sm%sv)) call sm%sv%descr(info,iout,coarse) + else + if (allocated(sm%sv)) then + select type (sv => sm%sv) + class is (mld_s_id_solver_type) + write(iout_,*) 'No preconditioner/smoother' + class default + write(iout_,*) 'Decoupled preconditioner/smoother with local solver' + call sm%sv%descr(info,iout,coarse) + end select + else + write(iout_,*) 'No preconditioner/smoother' end if end if + + if (info /= psb_success_) then + info = psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='Local solver') + goto 9999 + end if + call psb_erractionrestore(err_act) return diff --git a/mlprec/impl/smoother/mld_z_base_smoother_descr.f90 b/mlprec/impl/smoother/mld_z_base_smoother_descr.f90 index 64777267..0e4c2bd8 100644 --- a/mlprec/impl/smoother/mld_z_base_smoother_descr.f90 +++ b/mlprec/impl/smoother/mld_z_base_smoother_descr.f90 @@ -39,6 +39,7 @@ subroutine mld_z_base_smoother_descr(sm,info,iout,coarse) use psb_base_mod use mld_z_base_smoother_mod, mld_protect_name => mld_z_base_smoother_descr + use mld_z_id_solver Implicit None ! Arguments @@ -69,16 +70,28 @@ subroutine mld_z_base_smoother_descr(sm,info,iout,coarse) iout_ = psb_out_unit end if - if (.not.coarse_) & - & write(iout_,*) 'Decoupled preconditioner/smoother with local solver' - if (allocated(sm%sv)) then - call sm%sv%descr(info,iout,coarse) - if (info /= psb_success_) then - info = psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='Local solver') - goto 9999 + if (coarse_) then + if (allocated(sm%sv)) call sm%sv%descr(info,iout,coarse) + else + if (allocated(sm%sv)) then + select type (sv => sm%sv) + class is (mld_z_id_solver_type) + write(iout_,*) 'No preconditioner/smoother' + class default + write(iout_,*) 'Decoupled preconditioner/smoother with local solver' + call sm%sv%descr(info,iout,coarse) + end select + else + write(iout_,*) 'No preconditioner/smoother' end if end if + + if (info /= psb_success_) then + info = psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='Local solver') + goto 9999 + end if + call psb_erractionrestore(err_act) return