From af2d94e152a1a8a287261ca79a7f9e9c4503f2a7 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Mon, 14 Jan 2013 17:04:32 +0000 Subject: [PATCH] mld2p4-2 mlprec/mld_z_prec_mod.f90 mlprec/mld_c_prec_mod.f90 mlprec/mld_c_prec_type.f90 mlprec/mld_s_prec_mod.f90 mlprec/mld_s_prec_type.f90 mlprec/mld_d_prec_mod.f90 mlprec/impl/mld_sprecset.F90 mlprec/impl/mld_zprecset.F90 mlprec/impl/mld_dprecset.F90 mlprec/impl/mld_cprecset.F90 mlprec/mld_d_prec_type.f90 mlprec/mld_z_prec_type.f90 Changed inner_precset into class method. --- mlprec/impl/mld_cprecset.F90 | 12 ++++---- mlprec/impl/mld_dprecset.F90 | 12 ++++---- mlprec/impl/mld_sprecset.F90 | 12 ++++---- mlprec/impl/mld_zprecset.F90 | 12 ++++---- mlprec/mld_c_prec_mod.f90 | 56 ++++-------------------------------- mlprec/mld_c_prec_type.f90 | 53 ++++++++++++++++++++++++++++++++++ mlprec/mld_d_prec_mod.f90 | 56 ++++-------------------------------- mlprec/mld_d_prec_type.f90 | 53 ++++++++++++++++++++++++++++++++++ mlprec/mld_s_prec_mod.f90 | 56 ++++-------------------------------- mlprec/mld_s_prec_type.f90 | 53 ++++++++++++++++++++++++++++++++++ mlprec/mld_z_prec_mod.f90 | 56 ++++-------------------------------- mlprec/mld_z_prec_type.f90 | 53 ++++++++++++++++++++++++++++++++++ 12 files changed, 260 insertions(+), 224 deletions(-) diff --git a/mlprec/impl/mld_cprecset.F90 b/mlprec/impl/mld_cprecset.F90 index c0dad3bd..fdd269fe 100644 --- a/mlprec/impl/mld_cprecset.F90 +++ b/mlprec/impl/mld_cprecset.F90 @@ -95,7 +95,7 @@ subroutine mld_cprecseti(p,what,val,info,ilev) implicit none ! Arguments - type(mld_cprec_type), intent(inout) :: p + class(mld_cprec_type), intent(inout) :: p integer(psb_ipk_), intent(in) :: what integer(psb_ipk_), intent(in) :: val integer(psb_ipk_), intent(out) :: info @@ -571,7 +571,7 @@ subroutine mld_cprecsetsm(p,val,info,ilev) implicit none ! Arguments - type(mld_cprec_type), intent(inout) :: p + class(mld_cprec_type), intent(inout) :: p class(mld_c_base_smoother_type), intent(in) :: val integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: ilev @@ -634,7 +634,7 @@ subroutine mld_cprecsetsv(p,val,info,ilev) implicit none ! Arguments - type(mld_cprec_type), intent(inout) :: p + class(mld_cprec_type), intent(inout) :: p class(mld_c_base_solver_type), intent(in) :: val integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: ilev @@ -745,7 +745,7 @@ subroutine mld_cprecsetc(p,what,string,info,ilev) implicit none ! Arguments - type(mld_cprec_type), intent(inout) :: p + class(mld_cprec_type), intent(inout) :: p integer(psb_ipk_), intent(in) :: what character(len=*), intent(in) :: string integer(psb_ipk_), intent(out) :: info @@ -777,7 +777,7 @@ subroutine mld_cprecsetc(p,what,string,info,ilev) endif val = mld_stringval(string) - if (val >=0) call mld_inner_precset(p,what,val,info,ilev=ilev) + if (val >=0) call p%set(what,val,info,ilev=ilev) end subroutine mld_cprecsetc @@ -829,7 +829,7 @@ subroutine mld_cprecsetr(p,what,val,info,ilev) implicit none ! Arguments - type(mld_cprec_type), intent(inout) :: p + class(mld_cprec_type), intent(inout) :: p integer(psb_ipk_), intent(in) :: what real(psb_spk_), intent(in) :: val integer(psb_ipk_), intent(out) :: info diff --git a/mlprec/impl/mld_dprecset.F90 b/mlprec/impl/mld_dprecset.F90 index 91ccf47f..78cf906c 100644 --- a/mlprec/impl/mld_dprecset.F90 +++ b/mlprec/impl/mld_dprecset.F90 @@ -95,7 +95,7 @@ subroutine mld_dprecseti(p,what,val,info,ilev) implicit none ! Arguments - type(mld_dprec_type), intent(inout) :: p + class(mld_dprec_type), intent(inout) :: p integer(psb_ipk_), intent(in) :: what integer(psb_ipk_), intent(in) :: val integer(psb_ipk_), intent(out) :: info @@ -571,7 +571,7 @@ subroutine mld_dprecsetsm(p,val,info,ilev) implicit none ! Arguments - type(mld_dprec_type), intent(inout) :: p + class(mld_dprec_type), intent(inout) :: p class(mld_d_base_smoother_type), intent(in) :: val integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: ilev @@ -634,7 +634,7 @@ subroutine mld_dprecsetsv(p,val,info,ilev) implicit none ! Arguments - type(mld_dprec_type), intent(inout) :: p + class(mld_dprec_type), intent(inout) :: p class(mld_d_base_solver_type), intent(in) :: val integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: ilev @@ -745,7 +745,7 @@ subroutine mld_dprecsetc(p,what,string,info,ilev) implicit none ! Arguments - type(mld_dprec_type), intent(inout) :: p + class(mld_dprec_type), intent(inout) :: p integer(psb_ipk_), intent(in) :: what character(len=*), intent(in) :: string integer(psb_ipk_), intent(out) :: info @@ -777,7 +777,7 @@ subroutine mld_dprecsetc(p,what,string,info,ilev) endif val = mld_stringval(string) - if (val >=0) call mld_inner_precset(p,what,val,info,ilev=ilev) + if (val >=0) call p%set(what,val,info,ilev=ilev) end subroutine mld_dprecsetc @@ -829,7 +829,7 @@ subroutine mld_dprecsetr(p,what,val,info,ilev) implicit none ! Arguments - type(mld_dprec_type), intent(inout) :: p + class(mld_dprec_type), intent(inout) :: p integer(psb_ipk_), intent(in) :: what real(psb_dpk_), intent(in) :: val integer(psb_ipk_), intent(out) :: info diff --git a/mlprec/impl/mld_sprecset.F90 b/mlprec/impl/mld_sprecset.F90 index a4c00054..ca34cc74 100644 --- a/mlprec/impl/mld_sprecset.F90 +++ b/mlprec/impl/mld_sprecset.F90 @@ -95,7 +95,7 @@ subroutine mld_sprecseti(p,what,val,info,ilev) implicit none ! Arguments - type(mld_sprec_type), intent(inout) :: p + class(mld_sprec_type), intent(inout) :: p integer(psb_ipk_), intent(in) :: what integer(psb_ipk_), intent(in) :: val integer(psb_ipk_), intent(out) :: info @@ -571,7 +571,7 @@ subroutine mld_sprecsetsm(p,val,info,ilev) implicit none ! Arguments - type(mld_sprec_type), intent(inout) :: p + class(mld_sprec_type), intent(inout) :: p class(mld_s_base_smoother_type), intent(in) :: val integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: ilev @@ -634,7 +634,7 @@ subroutine mld_sprecsetsv(p,val,info,ilev) implicit none ! Arguments - type(mld_sprec_type), intent(inout) :: p + class(mld_sprec_type), intent(inout) :: p class(mld_s_base_solver_type), intent(in) :: val integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: ilev @@ -745,7 +745,7 @@ subroutine mld_sprecsetc(p,what,string,info,ilev) implicit none ! Arguments - type(mld_sprec_type), intent(inout) :: p + class(mld_sprec_type), intent(inout) :: p integer(psb_ipk_), intent(in) :: what character(len=*), intent(in) :: string integer(psb_ipk_), intent(out) :: info @@ -777,7 +777,7 @@ subroutine mld_sprecsetc(p,what,string,info,ilev) endif val = mld_stringval(string) - if (val >=0) call mld_inner_precset(p,what,val,info,ilev=ilev) + if (val >=0) call p%set(what,val,info,ilev=ilev) end subroutine mld_sprecsetc @@ -829,7 +829,7 @@ subroutine mld_sprecsetr(p,what,val,info,ilev) implicit none ! Arguments - type(mld_sprec_type), intent(inout) :: p + class(mld_sprec_type), intent(inout) :: p integer(psb_ipk_), intent(in) :: what real(psb_spk_), intent(in) :: val integer(psb_ipk_), intent(out) :: info diff --git a/mlprec/impl/mld_zprecset.F90 b/mlprec/impl/mld_zprecset.F90 index 7ad85d8e..ce78d24d 100644 --- a/mlprec/impl/mld_zprecset.F90 +++ b/mlprec/impl/mld_zprecset.F90 @@ -95,7 +95,7 @@ subroutine mld_zprecseti(p,what,val,info,ilev) implicit none ! Arguments - type(mld_zprec_type), intent(inout) :: p + class(mld_zprec_type), intent(inout) :: p integer(psb_ipk_), intent(in) :: what integer(psb_ipk_), intent(in) :: val integer(psb_ipk_), intent(out) :: info @@ -571,7 +571,7 @@ subroutine mld_zprecsetsm(p,val,info,ilev) implicit none ! Arguments - type(mld_zprec_type), intent(inout) :: p + class(mld_zprec_type), intent(inout) :: p class(mld_z_base_smoother_type), intent(in) :: val integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: ilev @@ -634,7 +634,7 @@ subroutine mld_zprecsetsv(p,val,info,ilev) implicit none ! Arguments - type(mld_zprec_type), intent(inout) :: p + class(mld_zprec_type), intent(inout) :: p class(mld_z_base_solver_type), intent(in) :: val integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: ilev @@ -745,7 +745,7 @@ subroutine mld_zprecsetc(p,what,string,info,ilev) implicit none ! Arguments - type(mld_zprec_type), intent(inout) :: p + class(mld_zprec_type), intent(inout) :: p integer(psb_ipk_), intent(in) :: what character(len=*), intent(in) :: string integer(psb_ipk_), intent(out) :: info @@ -777,7 +777,7 @@ subroutine mld_zprecsetc(p,what,string,info,ilev) endif val = mld_stringval(string) - if (val >=0) call mld_inner_precset(p,what,val,info,ilev=ilev) + if (val >=0) call p%set(what,val,info,ilev=ilev) end subroutine mld_zprecsetc @@ -828,7 +828,7 @@ subroutine mld_zprecsetr(p,what,val,info,ilev) implicit none ! Arguments - type(mld_zprec_type), intent(inout) :: p + class(mld_zprec_type), intent(inout) :: p integer(psb_ipk_), intent(in) :: what real(psb_dpk_), intent(in) :: val integer(psb_ipk_), intent(out) :: info diff --git a/mlprec/mld_c_prec_mod.f90 b/mlprec/mld_c_prec_mod.f90 index 67dc6589..103f782a 100644 --- a/mlprec/mld_c_prec_mod.f90 +++ b/mlprec/mld_c_prec_mod.f90 @@ -63,51 +63,7 @@ module mld_c_prec_mod & mld_c_iprecseti, mld_c_iprecsetc, mld_c_iprecsetr end interface - interface mld_inner_precset - subroutine mld_cprecsetsm(p,val,info,ilev) - import :: psb_cspmat_type, psb_desc_type, psb_spk_, & - & mld_cprec_type, mld_c_base_smoother_type, psb_ipk_ - type(mld_cprec_type), intent(inout) :: p - class(mld_c_base_smoother_type), intent(in) :: val - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_cprecsetsm - subroutine mld_cprecsetsv(p,val,info,ilev) - import :: psb_cspmat_type, psb_desc_type, psb_spk_, & - & mld_cprec_type, mld_c_base_solver_type, psb_ipk_ - type(mld_cprec_type), intent(inout) :: p - class(mld_c_base_solver_type), intent(in) :: val - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_cprecsetsv - subroutine mld_cprecseti(p,what,val,info,ilev) - import :: psb_cspmat_type, psb_desc_type, psb_spk_, & - & mld_cprec_type, psb_ipk_ - type(mld_cprec_type), intent(inout) :: p - integer(psb_ipk_), intent(in) :: what - integer(psb_ipk_), intent(in) :: val - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_cprecseti - subroutine mld_cprecsetr(p,what,val,info,ilev) - import :: psb_cspmat_type, psb_desc_type, psb_spk_, & - & mld_cprec_type, psb_ipk_ - type(mld_cprec_type), intent(inout) :: p - integer(psb_ipk_), intent(in) :: what - real(psb_spk_), intent(in) :: val - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_cprecsetr - subroutine mld_cprecsetc(p,what,string,info,ilev) - import :: psb_cspmat_type, psb_desc_type, psb_spk_, & - & mld_cprec_type, psb_ipk_ - type(mld_cprec_type), intent(inout) :: p - integer(psb_ipk_), intent(in) :: what - character(len=*), intent(in) :: string - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_cprecsetc - end interface +!!$ interface mld_inner_precset interface mld_precbld subroutine mld_cprecbld(a,desc_a,prec,info,amold,vmold) @@ -132,7 +88,7 @@ contains class(mld_c_base_smoother_type), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,val,info) + call p%set(val,info) end subroutine mld_c_iprecsetsm subroutine mld_c_iprecsetsv(p,val,info) @@ -140,7 +96,7 @@ contains class(mld_c_base_solver_type), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,val,info) + call p%set(val,info) end subroutine mld_c_iprecsetsv subroutine mld_c_iprecseti(p,what,val,info) @@ -149,7 +105,7 @@ contains integer(psb_ipk_), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,what,val,info) + call p%set(what,val,info) end subroutine mld_c_iprecseti subroutine mld_c_iprecsetr(p,what,val,info) @@ -158,7 +114,7 @@ contains real(psb_spk_), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,what,val,info) + call p%set(what,val,info) end subroutine mld_c_iprecsetr subroutine mld_c_iprecsetc(p,what,val,info) @@ -167,7 +123,7 @@ contains character(len=*), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,what,val,info) + call p%set(what,val,info) end subroutine mld_c_iprecsetc end module mld_c_prec_mod diff --git a/mlprec/mld_c_prec_type.f90 b/mlprec/mld_c_prec_type.f90 index 20faddbb..f9901d09 100644 --- a/mlprec/mld_c_prec_type.f90 +++ b/mlprec/mld_c_prec_type.f90 @@ -94,6 +94,12 @@ module mld_c_prec_type procedure, pass(prec) :: cmp_complexity => mld_c_cmp_compl procedure, pass(prec) :: get_nzeros => mld_c_get_nzeros procedure, pass(prec) :: sizeof => mld_cprec_sizeof + procedure, pass(prec) :: setsm => mld_cprecsetsm + procedure, pass(prec) :: setsv => mld_cprecsetsv + procedure, pass(prec) :: seti => mld_cprecseti + procedure, pass(prec) :: setc => mld_cprecsetc + procedure, pass(prec) :: setr => mld_cprecsetr + generic, public :: set => seti, setc, setr, setsm, setsv end type mld_cprec_type private :: mld_c_dump, mld_c_get_compl, mld_c_cmp_compl,& @@ -160,6 +166,53 @@ module mld_c_prec_type end subroutine mld_cprecaply1 end interface + interface + subroutine mld_cprecsetsm(prec,val,info,ilev) + import :: psb_cspmat_type, psb_desc_type, psb_spk_, & + & mld_cprec_type, mld_c_base_smoother_type, psb_ipk_ + class(mld_cprec_type), intent(inout) :: prec + class(mld_c_base_smoother_type), intent(in) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_cprecsetsm + subroutine mld_cprecsetsv(prec,val,info,ilev) + import :: psb_cspmat_type, psb_desc_type, psb_spk_, & + & mld_cprec_type, mld_c_base_solver_type, psb_ipk_ + class(mld_cprec_type), intent(inout) :: prec + class(mld_c_base_solver_type), intent(in) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_cprecsetsv + subroutine mld_cprecseti(prec,what,val,info,ilev) + import :: psb_cspmat_type, psb_desc_type, psb_spk_, & + & mld_cprec_type, psb_ipk_ + class(mld_cprec_type), intent(inout) :: prec + integer(psb_ipk_), intent(in) :: what + integer(psb_ipk_), intent(in) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_cprecseti + subroutine mld_cprecsetr(prec,what,val,info,ilev) + import :: psb_cspmat_type, psb_desc_type, psb_spk_, & + & mld_cprec_type, psb_ipk_ + class(mld_cprec_type), intent(inout) :: prec + integer(psb_ipk_), intent(in) :: what + real(psb_spk_), intent(in) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_cprecsetr + subroutine mld_cprecsetc(prec,what,string,info,ilev) + import :: psb_cspmat_type, psb_desc_type, psb_spk_, & + & mld_cprec_type, psb_ipk_ + class(mld_cprec_type), intent(inout) :: prec + integer(psb_ipk_), intent(in) :: what + character(len=*), intent(in) :: string + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_cprecsetc + end interface + + interface mld_move_alloc module procedure mld_cprec_move_alloc end interface diff --git a/mlprec/mld_d_prec_mod.f90 b/mlprec/mld_d_prec_mod.f90 index cfc4a81f..46141003 100644 --- a/mlprec/mld_d_prec_mod.f90 +++ b/mlprec/mld_d_prec_mod.f90 @@ -63,51 +63,7 @@ module mld_d_prec_mod & mld_d_iprecseti, mld_d_iprecsetc, mld_d_iprecsetr end interface - interface mld_inner_precset - subroutine mld_dprecsetsm(p,val,info,ilev) - import :: psb_dspmat_type, psb_desc_type, psb_dpk_, & - & mld_dprec_type, mld_d_base_smoother_type, psb_ipk_ - type(mld_dprec_type), intent(inout) :: p - class(mld_d_base_smoother_type), intent(in) :: val - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_dprecsetsm - subroutine mld_dprecsetsv(p,val,info,ilev) - import :: psb_dspmat_type, psb_desc_type, psb_dpk_, & - & mld_dprec_type, mld_d_base_solver_type, psb_ipk_ - type(mld_dprec_type), intent(inout) :: p - class(mld_d_base_solver_type), intent(in) :: val - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_dprecsetsv - subroutine mld_dprecseti(p,what,val,info,ilev) - import :: psb_dspmat_type, psb_desc_type, psb_dpk_, & - & mld_dprec_type, psb_ipk_ - type(mld_dprec_type), intent(inout) :: p - integer(psb_ipk_), intent(in) :: what - integer(psb_ipk_), intent(in) :: val - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_dprecseti - subroutine mld_dprecsetr(p,what,val,info,ilev) - import :: psb_dspmat_type, psb_desc_type, psb_dpk_, & - & mld_dprec_type, psb_ipk_ - type(mld_dprec_type), intent(inout) :: p - integer(psb_ipk_), intent(in) :: what - real(psb_dpk_), intent(in) :: val - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_dprecsetr - subroutine mld_dprecsetc(p,what,string,info,ilev) - import :: psb_dspmat_type, psb_desc_type, psb_dpk_, & - & mld_dprec_type, psb_ipk_ - type(mld_dprec_type), intent(inout) :: p - integer(psb_ipk_), intent(in) :: what - character(len=*), intent(in) :: string - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_dprecsetc - end interface +!!$ interface mld_inner_precset interface mld_precbld subroutine mld_dprecbld(a,desc_a,prec,info,amold,vmold) @@ -132,7 +88,7 @@ contains class(mld_d_base_smoother_type), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,val,info) + call p%set(val,info) end subroutine mld_d_iprecsetsm subroutine mld_d_iprecsetsv(p,val,info) @@ -140,7 +96,7 @@ contains class(mld_d_base_solver_type), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,val,info) + call p%set(val,info) end subroutine mld_d_iprecsetsv subroutine mld_d_iprecseti(p,what,val,info) @@ -149,7 +105,7 @@ contains integer(psb_ipk_), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,what,val,info) + call p%set(what,val,info) end subroutine mld_d_iprecseti subroutine mld_d_iprecsetr(p,what,val,info) @@ -158,7 +114,7 @@ contains real(psb_dpk_), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,what,val,info) + call p%set(what,val,info) end subroutine mld_d_iprecsetr subroutine mld_d_iprecsetc(p,what,val,info) @@ -167,7 +123,7 @@ contains character(len=*), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,what,val,info) + call p%set(what,val,info) end subroutine mld_d_iprecsetc end module mld_d_prec_mod diff --git a/mlprec/mld_d_prec_type.f90 b/mlprec/mld_d_prec_type.f90 index d27edcb0..e3f10ea4 100644 --- a/mlprec/mld_d_prec_type.f90 +++ b/mlprec/mld_d_prec_type.f90 @@ -94,6 +94,12 @@ module mld_d_prec_type procedure, pass(prec) :: cmp_complexity => mld_d_cmp_compl procedure, pass(prec) :: get_nzeros => mld_d_get_nzeros procedure, pass(prec) :: sizeof => mld_dprec_sizeof + procedure, pass(prec) :: setsm => mld_dprecsetsm + procedure, pass(prec) :: setsv => mld_dprecsetsv + procedure, pass(prec) :: seti => mld_dprecseti + procedure, pass(prec) :: setc => mld_dprecsetc + procedure, pass(prec) :: setr => mld_dprecsetr + generic, public :: set => seti, setc, setr, setsm, setsv end type mld_dprec_type private :: mld_d_dump, mld_d_get_compl, mld_d_cmp_compl,& @@ -160,6 +166,53 @@ module mld_d_prec_type end subroutine mld_dprecaply1 end interface + interface + subroutine mld_dprecsetsm(prec,val,info,ilev) + import :: psb_dspmat_type, psb_desc_type, psb_dpk_, & + & mld_dprec_type, mld_d_base_smoother_type, psb_ipk_ + class(mld_dprec_type), intent(inout) :: prec + class(mld_d_base_smoother_type), intent(in) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_dprecsetsm + subroutine mld_dprecsetsv(prec,val,info,ilev) + import :: psb_dspmat_type, psb_desc_type, psb_dpk_, & + & mld_dprec_type, mld_d_base_solver_type, psb_ipk_ + class(mld_dprec_type), intent(inout) :: prec + class(mld_d_base_solver_type), intent(in) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_dprecsetsv + subroutine mld_dprecseti(prec,what,val,info,ilev) + import :: psb_dspmat_type, psb_desc_type, psb_dpk_, & + & mld_dprec_type, psb_ipk_ + class(mld_dprec_type), intent(inout) :: prec + integer(psb_ipk_), intent(in) :: what + integer(psb_ipk_), intent(in) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_dprecseti + subroutine mld_dprecsetr(prec,what,val,info,ilev) + import :: psb_dspmat_type, psb_desc_type, psb_dpk_, & + & mld_dprec_type, psb_ipk_ + class(mld_dprec_type), intent(inout) :: prec + integer(psb_ipk_), intent(in) :: what + real(psb_dpk_), intent(in) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_dprecsetr + subroutine mld_dprecsetc(prec,what,string,info,ilev) + import :: psb_dspmat_type, psb_desc_type, psb_dpk_, & + & mld_dprec_type, psb_ipk_ + class(mld_dprec_type), intent(inout) :: prec + integer(psb_ipk_), intent(in) :: what + character(len=*), intent(in) :: string + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_dprecsetc + end interface + + interface mld_move_alloc module procedure mld_dprec_move_alloc end interface diff --git a/mlprec/mld_s_prec_mod.f90 b/mlprec/mld_s_prec_mod.f90 index 3a008a97..aa69495a 100644 --- a/mlprec/mld_s_prec_mod.f90 +++ b/mlprec/mld_s_prec_mod.f90 @@ -63,51 +63,7 @@ module mld_s_prec_mod & mld_s_iprecseti, mld_s_iprecsetc, mld_s_iprecsetr end interface - interface mld_inner_precset - subroutine mld_sprecsetsm(p,val,info,ilev) - import :: psb_sspmat_type, psb_desc_type, psb_spk_, & - & mld_sprec_type, mld_s_base_smoother_type, psb_ipk_ - type(mld_sprec_type), intent(inout) :: p - class(mld_s_base_smoother_type), intent(in) :: val - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_sprecsetsm - subroutine mld_sprecsetsv(p,val,info,ilev) - import :: psb_sspmat_type, psb_desc_type, psb_spk_, & - & mld_sprec_type, mld_s_base_solver_type, psb_ipk_ - type(mld_sprec_type), intent(inout) :: p - class(mld_s_base_solver_type), intent(in) :: val - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_sprecsetsv - subroutine mld_sprecseti(p,what,val,info,ilev) - import :: psb_sspmat_type, psb_desc_type, psb_spk_, & - & mld_sprec_type, psb_ipk_ - type(mld_sprec_type), intent(inout) :: p - integer(psb_ipk_), intent(in) :: what - integer(psb_ipk_), intent(in) :: val - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_sprecseti - subroutine mld_sprecsetr(p,what,val,info,ilev) - import :: psb_sspmat_type, psb_desc_type, psb_spk_, & - & mld_sprec_type, psb_ipk_ - type(mld_sprec_type), intent(inout) :: p - integer(psb_ipk_), intent(in) :: what - real(psb_spk_), intent(in) :: val - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_sprecsetr - subroutine mld_sprecsetc(p,what,string,info,ilev) - import :: psb_sspmat_type, psb_desc_type, psb_spk_, & - & mld_sprec_type, psb_ipk_ - type(mld_sprec_type), intent(inout) :: p - integer(psb_ipk_), intent(in) :: what - character(len=*), intent(in) :: string - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_sprecsetc - end interface +!!$ interface mld_inner_precset interface mld_precbld subroutine mld_sprecbld(a,desc_a,prec,info,amold,vmold) @@ -132,7 +88,7 @@ contains class(mld_s_base_smoother_type), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,val,info) + call p%set(val,info) end subroutine mld_s_iprecsetsm subroutine mld_s_iprecsetsv(p,val,info) @@ -140,7 +96,7 @@ contains class(mld_s_base_solver_type), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,val,info) + call p%set(val,info) end subroutine mld_s_iprecsetsv subroutine mld_s_iprecseti(p,what,val,info) @@ -149,7 +105,7 @@ contains integer(psb_ipk_), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,what,val,info) + call p%set(what,val,info) end subroutine mld_s_iprecseti subroutine mld_s_iprecsetr(p,what,val,info) @@ -158,7 +114,7 @@ contains real(psb_spk_), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,what,val,info) + call p%set(what,val,info) end subroutine mld_s_iprecsetr subroutine mld_s_iprecsetc(p,what,val,info) @@ -167,7 +123,7 @@ contains character(len=*), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,what,val,info) + call p%set(what,val,info) end subroutine mld_s_iprecsetc end module mld_s_prec_mod diff --git a/mlprec/mld_s_prec_type.f90 b/mlprec/mld_s_prec_type.f90 index 7f80dd7d..20babaaa 100644 --- a/mlprec/mld_s_prec_type.f90 +++ b/mlprec/mld_s_prec_type.f90 @@ -94,6 +94,12 @@ module mld_s_prec_type procedure, pass(prec) :: cmp_complexity => mld_s_cmp_compl procedure, pass(prec) :: get_nzeros => mld_s_get_nzeros procedure, pass(prec) :: sizeof => mld_sprec_sizeof + procedure, pass(prec) :: setsm => mld_sprecsetsm + procedure, pass(prec) :: setsv => mld_sprecsetsv + procedure, pass(prec) :: seti => mld_sprecseti + procedure, pass(prec) :: setc => mld_sprecsetc + procedure, pass(prec) :: setr => mld_sprecsetr + generic, public :: set => seti, setc, setr, setsm, setsv end type mld_sprec_type private :: mld_s_dump, mld_s_get_compl, mld_s_cmp_compl,& @@ -160,6 +166,53 @@ module mld_s_prec_type end subroutine mld_sprecaply1 end interface + interface + subroutine mld_sprecsetsm(prec,val,info,ilev) + import :: psb_sspmat_type, psb_desc_type, psb_spk_, & + & mld_sprec_type, mld_s_base_smoother_type, psb_ipk_ + class(mld_sprec_type), intent(inout) :: prec + class(mld_s_base_smoother_type), intent(in) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_sprecsetsm + subroutine mld_sprecsetsv(prec,val,info,ilev) + import :: psb_sspmat_type, psb_desc_type, psb_spk_, & + & mld_sprec_type, mld_s_base_solver_type, psb_ipk_ + class(mld_sprec_type), intent(inout) :: prec + class(mld_s_base_solver_type), intent(in) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_sprecsetsv + subroutine mld_sprecseti(prec,what,val,info,ilev) + import :: psb_sspmat_type, psb_desc_type, psb_spk_, & + & mld_sprec_type, psb_ipk_ + class(mld_sprec_type), intent(inout) :: prec + integer(psb_ipk_), intent(in) :: what + integer(psb_ipk_), intent(in) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_sprecseti + subroutine mld_sprecsetr(prec,what,val,info,ilev) + import :: psb_sspmat_type, psb_desc_type, psb_spk_, & + & mld_sprec_type, psb_ipk_ + class(mld_sprec_type), intent(inout) :: prec + integer(psb_ipk_), intent(in) :: what + real(psb_spk_), intent(in) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_sprecsetr + subroutine mld_sprecsetc(prec,what,string,info,ilev) + import :: psb_sspmat_type, psb_desc_type, psb_spk_, & + & mld_sprec_type, psb_ipk_ + class(mld_sprec_type), intent(inout) :: prec + integer(psb_ipk_), intent(in) :: what + character(len=*), intent(in) :: string + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_sprecsetc + end interface + + interface mld_move_alloc module procedure mld_sprec_move_alloc end interface diff --git a/mlprec/mld_z_prec_mod.f90 b/mlprec/mld_z_prec_mod.f90 index 435ece74..eb39f2f5 100644 --- a/mlprec/mld_z_prec_mod.f90 +++ b/mlprec/mld_z_prec_mod.f90 @@ -63,51 +63,7 @@ module mld_z_prec_mod & mld_z_iprecseti, mld_z_iprecsetc, mld_z_iprecsetr end interface - interface mld_inner_precset - subroutine mld_zprecsetsm(p,val,info,ilev) - import :: psb_zspmat_type, psb_desc_type, psb_dpk_, & - & mld_zprec_type, mld_z_base_smoother_type, psb_ipk_ - type(mld_zprec_type), intent(inout) :: p - class(mld_z_base_smoother_type), intent(in) :: val - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_zprecsetsm - subroutine mld_zprecsetsv(p,val,info,ilev) - import :: psb_zspmat_type, psb_desc_type, psb_dpk_, & - & mld_zprec_type, mld_z_base_solver_type, psb_ipk_ - type(mld_zprec_type), intent(inout) :: p - class(mld_z_base_solver_type), intent(in) :: val - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_zprecsetsv - subroutine mld_zprecseti(p,what,val,info,ilev) - import :: psb_zspmat_type, psb_desc_type, psb_dpk_, & - & mld_zprec_type, psb_ipk_ - type(mld_zprec_type), intent(inout) :: p - integer(psb_ipk_), intent(in) :: what - integer(psb_ipk_), intent(in) :: val - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_zprecseti - subroutine mld_zprecsetr(p,what,val,info,ilev) - import :: psb_zspmat_type, psb_desc_type, psb_dpk_, & - & mld_zprec_type, psb_ipk_ - type(mld_zprec_type), intent(inout) :: p - integer(psb_ipk_), intent(in) :: what - real(psb_dpk_), intent(in) :: val - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_zprecsetr - subroutine mld_zprecsetc(p,what,string,info,ilev) - import :: psb_zspmat_type, psb_desc_type, psb_dpk_, & - & mld_zprec_type, psb_ipk_ - type(mld_zprec_type), intent(inout) :: p - integer(psb_ipk_), intent(in) :: what - character(len=*), intent(in) :: string - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: ilev - end subroutine mld_zprecsetc - end interface +!!$ interface mld_inner_precset interface mld_precbld subroutine mld_zprecbld(a,desc_a,prec,info,amold,vmold) @@ -132,7 +88,7 @@ contains class(mld_z_base_smoother_type), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,val,info) + call p%set(val,info) end subroutine mld_z_iprecsetsm subroutine mld_z_iprecsetsv(p,val,info) @@ -140,7 +96,7 @@ contains class(mld_z_base_solver_type), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,val,info) + call p%set(val,info) end subroutine mld_z_iprecsetsv subroutine mld_z_iprecseti(p,what,val,info) @@ -149,7 +105,7 @@ contains integer(psb_ipk_), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,what,val,info) + call p%set(what,val,info) end subroutine mld_z_iprecseti subroutine mld_z_iprecsetr(p,what,val,info) @@ -158,7 +114,7 @@ contains real(psb_dpk_), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,what,val,info) + call p%set(what,val,info) end subroutine mld_z_iprecsetr subroutine mld_z_iprecsetc(p,what,val,info) @@ -167,7 +123,7 @@ contains character(len=*), intent(in) :: val integer(psb_ipk_), intent(out) :: info - call mld_inner_precset(p,what,val,info) + call p%set(what,val,info) end subroutine mld_z_iprecsetc end module mld_z_prec_mod diff --git a/mlprec/mld_z_prec_type.f90 b/mlprec/mld_z_prec_type.f90 index 92e25377..14d4c1a0 100644 --- a/mlprec/mld_z_prec_type.f90 +++ b/mlprec/mld_z_prec_type.f90 @@ -94,6 +94,12 @@ module mld_z_prec_type procedure, pass(prec) :: cmp_complexity => mld_z_cmp_compl procedure, pass(prec) :: get_nzeros => mld_z_get_nzeros procedure, pass(prec) :: sizeof => mld_zprec_sizeof + procedure, pass(prec) :: setsm => mld_zprecsetsm + procedure, pass(prec) :: setsv => mld_zprecsetsv + procedure, pass(prec) :: seti => mld_zprecseti + procedure, pass(prec) :: setc => mld_zprecsetc + procedure, pass(prec) :: setr => mld_zprecsetr + generic, public :: set => seti, setc, setr, setsm, setsv end type mld_zprec_type private :: mld_z_dump, mld_z_get_compl, mld_z_cmp_compl,& @@ -160,6 +166,53 @@ module mld_z_prec_type end subroutine mld_zprecaply1 end interface + interface + subroutine mld_zprecsetsm(prec,val,info,ilev) + import :: psb_zspmat_type, psb_desc_type, psb_dpk_, & + & mld_zprec_type, mld_z_base_smoother_type, psb_ipk_ + class(mld_zprec_type), intent(inout) :: prec + class(mld_z_base_smoother_type), intent(in) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_zprecsetsm + subroutine mld_zprecsetsv(prec,val,info,ilev) + import :: psb_zspmat_type, psb_desc_type, psb_dpk_, & + & mld_zprec_type, mld_z_base_solver_type, psb_ipk_ + class(mld_zprec_type), intent(inout) :: prec + class(mld_z_base_solver_type), intent(in) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_zprecsetsv + subroutine mld_zprecseti(prec,what,val,info,ilev) + import :: psb_zspmat_type, psb_desc_type, psb_dpk_, & + & mld_zprec_type, psb_ipk_ + class(mld_zprec_type), intent(inout) :: prec + integer(psb_ipk_), intent(in) :: what + integer(psb_ipk_), intent(in) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_zprecseti + subroutine mld_zprecsetr(prec,what,val,info,ilev) + import :: psb_zspmat_type, psb_desc_type, psb_dpk_, & + & mld_zprec_type, psb_ipk_ + class(mld_zprec_type), intent(inout) :: prec + integer(psb_ipk_), intent(in) :: what + real(psb_dpk_), intent(in) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_zprecsetr + subroutine mld_zprecsetc(prec,what,string,info,ilev) + import :: psb_zspmat_type, psb_desc_type, psb_dpk_, & + & mld_zprec_type, psb_ipk_ + class(mld_zprec_type), intent(inout) :: prec + integer(psb_ipk_), intent(in) :: what + character(len=*), intent(in) :: string + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: ilev + end subroutine mld_zprecsetc + end interface + + interface mld_move_alloc module procedure mld_zprec_move_alloc end interface