diff --git a/base/modules/psb_c_mat_mod.f90 b/base/modules/psb_c_mat_mod.f90 index dbfe852b..350d098d 100644 --- a/base/modules/psb_c_mat_mod.f90 +++ b/base/modules/psb_c_mat_mod.f90 @@ -409,8 +409,8 @@ module psb_c_mat_mod subroutine psb_c_csgetblk(imin,imax,a,b,info,& & jmin,jmax,iren,append,rscale,cscale) import :: psb_ipk_, psb_cspmat_type, psb_spk_ - class(psb_cspmat_type), intent(in) :: a - class(psb_cspmat_type), intent(out) :: b + class(psb_cspmat_type), intent(in) :: a + class(psb_cspmat_type), intent(inout) :: b integer(psb_ipk_), intent(in) :: imin,imax integer(psb_ipk_),intent(out) :: info logical, intent(in), optional :: append diff --git a/base/modules/psb_d_mat_mod.f90 b/base/modules/psb_d_mat_mod.f90 index 4c69f161..dfc43a5e 100644 --- a/base/modules/psb_d_mat_mod.f90 +++ b/base/modules/psb_d_mat_mod.f90 @@ -409,8 +409,8 @@ module psb_d_mat_mod subroutine psb_d_csgetblk(imin,imax,a,b,info,& & jmin,jmax,iren,append,rscale,cscale) import :: psb_ipk_, psb_dspmat_type, psb_dpk_ - class(psb_dspmat_type), intent(in) :: a - class(psb_dspmat_type), intent(out) :: b + class(psb_dspmat_type), intent(in) :: a + class(psb_dspmat_type), intent(inout) :: b integer(psb_ipk_), intent(in) :: imin,imax integer(psb_ipk_),intent(out) :: info logical, intent(in), optional :: append diff --git a/base/modules/psb_s_mat_mod.f90 b/base/modules/psb_s_mat_mod.f90 index b2b38187..c5dfd1ee 100644 --- a/base/modules/psb_s_mat_mod.f90 +++ b/base/modules/psb_s_mat_mod.f90 @@ -409,8 +409,8 @@ module psb_s_mat_mod subroutine psb_s_csgetblk(imin,imax,a,b,info,& & jmin,jmax,iren,append,rscale,cscale) import :: psb_ipk_, psb_sspmat_type, psb_spk_ - class(psb_sspmat_type), intent(in) :: a - class(psb_sspmat_type), intent(out) :: b + class(psb_sspmat_type), intent(in) :: a + class(psb_sspmat_type), intent(inout) :: b integer(psb_ipk_), intent(in) :: imin,imax integer(psb_ipk_),intent(out) :: info logical, intent(in), optional :: append diff --git a/base/modules/psb_z_mat_mod.f90 b/base/modules/psb_z_mat_mod.f90 index 40d53a6a..32ae261a 100644 --- a/base/modules/psb_z_mat_mod.f90 +++ b/base/modules/psb_z_mat_mod.f90 @@ -409,8 +409,8 @@ module psb_z_mat_mod subroutine psb_z_csgetblk(imin,imax,a,b,info,& & jmin,jmax,iren,append,rscale,cscale) import :: psb_ipk_, psb_zspmat_type, psb_dpk_ - class(psb_zspmat_type), intent(in) :: a - class(psb_zspmat_type), intent(out) :: b + class(psb_zspmat_type), intent(in) :: a + class(psb_zspmat_type), intent(inout) :: b integer(psb_ipk_), intent(in) :: imin,imax integer(psb_ipk_),intent(out) :: info logical, intent(in), optional :: append diff --git a/base/serial/impl/psb_c_mat_impl.F90 b/base/serial/impl/psb_c_mat_impl.F90 index 309db2d1..aa4231b1 100644 --- a/base/serial/impl/psb_c_mat_impl.F90 +++ b/base/serial/impl/psb_c_mat_impl.F90 @@ -884,8 +884,8 @@ subroutine psb_c_csgetblk(imin,imax,a,b,info,& use psb_c_mat_mod, psb_protect_name => psb_c_csgetblk implicit none - class(psb_cspmat_type), intent(in) :: a - class(psb_cspmat_type), intent(out) :: b + class(psb_cspmat_type), intent(in) :: a + class(psb_cspmat_type), intent(inout) :: b integer(psb_ipk_), intent(in) :: imin,imax integer(psb_ipk_),intent(out) :: info logical, intent(in), optional :: append @@ -896,6 +896,7 @@ subroutine psb_c_csgetblk(imin,imax,a,b,info,& integer(psb_ipk_) :: err_act character(len=20) :: name='csget' logical, parameter :: debug=.false. + logical :: append_ type(psb_c_coo_sparse_mat), allocatable :: acoo @@ -906,8 +907,17 @@ subroutine psb_c_csgetblk(imin,imax,a,b,info,& call psb_errpush(info,name) goto 9999 endif + if (present(append)) then + append_ = append + else + append_ = .false. + end if allocate(acoo,stat=info) + if (append_.and.(info==psb_success_)) then + if (allocated(b%a)) & + & call b%a%mv_to_coo(acoo,info) + end if if (info == psb_success_) then call a%a%csget(imin,imax,acoo,info,& diff --git a/base/serial/impl/psb_d_mat_impl.F90 b/base/serial/impl/psb_d_mat_impl.F90 index d7fab12e..e39ffbc1 100644 --- a/base/serial/impl/psb_d_mat_impl.F90 +++ b/base/serial/impl/psb_d_mat_impl.F90 @@ -884,8 +884,8 @@ subroutine psb_d_csgetblk(imin,imax,a,b,info,& use psb_d_mat_mod, psb_protect_name => psb_d_csgetblk implicit none - class(psb_dspmat_type), intent(in) :: a - class(psb_dspmat_type), intent(out) :: b + class(psb_dspmat_type), intent(in) :: a + class(psb_dspmat_type), intent(inout) :: b integer(psb_ipk_), intent(in) :: imin,imax integer(psb_ipk_),intent(out) :: info logical, intent(in), optional :: append @@ -896,6 +896,7 @@ subroutine psb_d_csgetblk(imin,imax,a,b,info,& integer(psb_ipk_) :: err_act character(len=20) :: name='csget' logical, parameter :: debug=.false. + logical :: append_ type(psb_d_coo_sparse_mat), allocatable :: acoo @@ -906,8 +907,17 @@ subroutine psb_d_csgetblk(imin,imax,a,b,info,& call psb_errpush(info,name) goto 9999 endif + if (present(append)) then + append_ = append + else + append_ = .false. + end if allocate(acoo,stat=info) + if (append_.and.(info==psb_success_)) then + if (allocated(b%a)) & + & call b%a%mv_to_coo(acoo,info) + end if if (info == psb_success_) then call a%a%csget(imin,imax,acoo,info,& diff --git a/base/serial/impl/psb_s_mat_impl.F90 b/base/serial/impl/psb_s_mat_impl.F90 index ae51e296..e8f6a541 100644 --- a/base/serial/impl/psb_s_mat_impl.F90 +++ b/base/serial/impl/psb_s_mat_impl.F90 @@ -884,8 +884,8 @@ subroutine psb_s_csgetblk(imin,imax,a,b,info,& use psb_s_mat_mod, psb_protect_name => psb_s_csgetblk implicit none - class(psb_sspmat_type), intent(in) :: a - class(psb_sspmat_type), intent(out) :: b + class(psb_sspmat_type), intent(in) :: a + class(psb_sspmat_type), intent(inout) :: b integer(psb_ipk_), intent(in) :: imin,imax integer(psb_ipk_),intent(out) :: info logical, intent(in), optional :: append @@ -896,6 +896,7 @@ subroutine psb_s_csgetblk(imin,imax,a,b,info,& integer(psb_ipk_) :: err_act character(len=20) :: name='csget' logical, parameter :: debug=.false. + logical :: append_ type(psb_s_coo_sparse_mat), allocatable :: acoo @@ -906,8 +907,17 @@ subroutine psb_s_csgetblk(imin,imax,a,b,info,& call psb_errpush(info,name) goto 9999 endif + if (present(append)) then + append_ = append + else + append_ = .false. + end if allocate(acoo,stat=info) + if (append_.and.(info==psb_success_)) then + if (allocated(b%a)) & + & call b%a%mv_to_coo(acoo,info) + end if if (info == psb_success_) then call a%a%csget(imin,imax,acoo,info,& diff --git a/base/serial/impl/psb_z_mat_impl.F90 b/base/serial/impl/psb_z_mat_impl.F90 index 9ce6127a..f313f6fd 100644 --- a/base/serial/impl/psb_z_mat_impl.F90 +++ b/base/serial/impl/psb_z_mat_impl.F90 @@ -884,8 +884,8 @@ subroutine psb_z_csgetblk(imin,imax,a,b,info,& use psb_z_mat_mod, psb_protect_name => psb_z_csgetblk implicit none - class(psb_zspmat_type), intent(in) :: a - class(psb_zspmat_type), intent(out) :: b + class(psb_zspmat_type), intent(in) :: a + class(psb_zspmat_type), intent(inout) :: b integer(psb_ipk_), intent(in) :: imin,imax integer(psb_ipk_),intent(out) :: info logical, intent(in), optional :: append @@ -896,6 +896,7 @@ subroutine psb_z_csgetblk(imin,imax,a,b,info,& integer(psb_ipk_) :: err_act character(len=20) :: name='csget' logical, parameter :: debug=.false. + logical :: append_ type(psb_z_coo_sparse_mat), allocatable :: acoo @@ -906,8 +907,17 @@ subroutine psb_z_csgetblk(imin,imax,a,b,info,& call psb_errpush(info,name) goto 9999 endif + if (present(append)) then + append_ = append + else + append_ = .false. + end if allocate(acoo,stat=info) + if (append_.and.(info==psb_success_)) then + if (allocated(b%a)) & + & call b%a%mv_to_coo(acoo,info) + end if if (info == psb_success_) then call a%a%csget(imin,imax,acoo,info,&