base/modules/psb_c_mat_mod.f90
 base/modules/psb_c_vect_mod.F90
 base/modules/psb_d_mat_mod.f90
 base/modules/psb_d_vect_mod.F90
 base/modules/psb_s_mat_mod.f90
 base/modules/psb_s_vect_mod.F90
 base/modules/psb_z_mat_mod.f90
 base/modules/psb_z_vect_mod.F90
 base/serial/impl/psb_c_mat_impl.F90
 base/serial/impl/psb_d_mat_impl.F90
 base/serial/impl/psb_s_mat_impl.F90
 base/serial/impl/psb_z_mat_impl.F90


Change many INTENT(OUT) routines: if FINALs are not enforced they are
not reliable.
psblas-3.2.0
Salvatore Filippone 11 years ago
parent 1e878989c6
commit a543c4009f

@ -348,7 +348,7 @@ module psb_c_mat_mod
interface
subroutine psb_c_csall(nr,nc,a,info,nz)
import :: psb_ipk_, psb_cspmat_type
class(psb_cspmat_type), intent(out) :: a
class(psb_cspmat_type), intent(inout) :: a
integer(psb_ipk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz
@ -466,7 +466,7 @@ module psb_c_mat_mod
& imin,imax,jmin,jmax,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(inout) :: b
integer(psb_ipk_),intent(out) :: info
integer(psb_ipk_), intent(in), optional :: imin,imax,jmin,jmax
logical, intent(in), optional :: rscale,cscale
@ -504,7 +504,7 @@ module psb_c_mat_mod
subroutine psb_c_transp_2mat(a,b)
import :: psb_ipk_, psb_cspmat_type
class(psb_cspmat_type), intent(in) :: a
class(psb_cspmat_type), intent(out) :: b
class(psb_cspmat_type), intent(inout) :: b
end subroutine psb_c_transp_2mat
end interface
@ -519,7 +519,7 @@ module psb_c_mat_mod
subroutine psb_c_transc_2mat(a,b)
import :: psb_ipk_, psb_cspmat_type
class(psb_cspmat_type), intent(in) :: a
class(psb_cspmat_type), intent(out) :: b
class(psb_cspmat_type), intent(inout) :: b
end subroutine psb_c_transc_2mat
end interface
@ -549,8 +549,8 @@ module psb_c_mat_mod
interface
subroutine psb_c_cscnv(a,b,info,type,mold,upd,dupl)
import :: psb_ipk_, psb_cspmat_type, psb_spk_, psb_c_base_sparse_mat
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(out) :: info
integer(psb_ipk_),optional, intent(in) :: dupl, upd
character(len=*), optional, intent(in) :: type
@ -588,8 +588,8 @@ module psb_c_mat_mod
interface
subroutine psb_c_clip_d(a,b,info)
import :: psb_ipk_, psb_cspmat_type
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(out) :: info
end subroutine psb_c_clip_d
end interface
@ -609,7 +609,7 @@ module psb_c_mat_mod
interface
subroutine psb_c_mv_from(a,b)
import :: psb_ipk_, psb_cspmat_type, psb_spk_, psb_c_base_sparse_mat
class(psb_cspmat_type), intent(out) :: a
class(psb_cspmat_type), intent(inout) :: a
class(psb_c_base_sparse_mat), intent(inout) :: b
end subroutine psb_c_mv_from
end interface
@ -626,7 +626,7 @@ module psb_c_mat_mod
subroutine psb_c_mv_to(a,b)
import :: psb_ipk_, psb_cspmat_type, psb_spk_, psb_c_base_sparse_mat
class(psb_cspmat_type), intent(inout) :: a
class(psb_c_base_sparse_mat), intent(out) :: b
class(psb_c_base_sparse_mat), intent(inout) :: b
end subroutine psb_c_mv_to
end interface
@ -634,7 +634,7 @@ module psb_c_mat_mod
subroutine psb_c_cp_to(a,b)
import :: psb_ipk_, psb_cspmat_type, psb_spk_, psb_c_base_sparse_mat
class(psb_cspmat_type), intent(in) :: a
class(psb_c_base_sparse_mat), intent(out) :: b
class(psb_c_base_sparse_mat), intent(inout) :: b
end subroutine psb_c_cp_to
end interface
@ -645,7 +645,7 @@ module psb_c_mat_mod
subroutine psb_cspmat_type_move(a,b,info)
import :: psb_ipk_, psb_cspmat_type
class(psb_cspmat_type), intent(inout) :: a
class(psb_cspmat_type), intent(out) :: b
class(psb_cspmat_type), intent(inout) :: b
integer(psb_ipk_), intent(out) :: info
end subroutine psb_cspmat_type_move
end interface

@ -158,11 +158,14 @@ contains
subroutine c_vect_bld_x(x,invect,mold)
complex(psb_spk_), intent(in) :: invect(:)
class(psb_c_vect_type), intent(out) :: x
class(psb_c_vect_type), intent(inout) :: x
class(psb_c_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_c_base_vect_type), pointer :: mld
if (allocated(x%v)) &
& call x%v%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
@ -185,11 +188,15 @@ contains
subroutine c_vect_bld_n(x,n,mold)
integer(psb_ipk_), intent(in) :: n
class(psb_c_vect_type), intent(out) :: x
class(psb_c_vect_type), intent(inout) :: x
class(psb_c_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_c_base_vect_type), pointer :: mld
if (allocated(x%v)) &
& call x%v%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
@ -493,11 +500,14 @@ contains
subroutine c_vect_all(n, x, info, mold)
implicit none
integer(psb_ipk_), intent(in) :: n
class(psb_c_vect_type), intent(out) :: x
integer(psb_ipk_), intent(in) :: n
class(psb_c_vect_type), intent(inout) :: x
class(psb_c_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_), intent(out) :: info
if (allocated(x%v)) &
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)

@ -348,7 +348,7 @@ module psb_d_mat_mod
interface
subroutine psb_d_csall(nr,nc,a,info,nz)
import :: psb_ipk_, psb_dspmat_type
class(psb_dspmat_type), intent(out) :: a
class(psb_dspmat_type), intent(inout) :: a
integer(psb_ipk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz
@ -466,7 +466,7 @@ module psb_d_mat_mod
& imin,imax,jmin,jmax,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(inout) :: b
integer(psb_ipk_),intent(out) :: info
integer(psb_ipk_), intent(in), optional :: imin,imax,jmin,jmax
logical, intent(in), optional :: rscale,cscale
@ -504,7 +504,7 @@ module psb_d_mat_mod
subroutine psb_d_transp_2mat(a,b)
import :: psb_ipk_, psb_dspmat_type
class(psb_dspmat_type), intent(in) :: a
class(psb_dspmat_type), intent(out) :: b
class(psb_dspmat_type), intent(inout) :: b
end subroutine psb_d_transp_2mat
end interface
@ -519,7 +519,7 @@ module psb_d_mat_mod
subroutine psb_d_transc_2mat(a,b)
import :: psb_ipk_, psb_dspmat_type
class(psb_dspmat_type), intent(in) :: a
class(psb_dspmat_type), intent(out) :: b
class(psb_dspmat_type), intent(inout) :: b
end subroutine psb_d_transc_2mat
end interface
@ -549,8 +549,8 @@ module psb_d_mat_mod
interface
subroutine psb_d_cscnv(a,b,info,type,mold,upd,dupl)
import :: psb_ipk_, psb_dspmat_type, psb_dpk_, psb_d_base_sparse_mat
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(out) :: info
integer(psb_ipk_),optional, intent(in) :: dupl, upd
character(len=*), optional, intent(in) :: type
@ -588,8 +588,8 @@ module psb_d_mat_mod
interface
subroutine psb_d_clip_d(a,b,info)
import :: psb_ipk_, psb_dspmat_type
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(out) :: info
end subroutine psb_d_clip_d
end interface
@ -609,7 +609,7 @@ module psb_d_mat_mod
interface
subroutine psb_d_mv_from(a,b)
import :: psb_ipk_, psb_dspmat_type, psb_dpk_, psb_d_base_sparse_mat
class(psb_dspmat_type), intent(out) :: a
class(psb_dspmat_type), intent(inout) :: a
class(psb_d_base_sparse_mat), intent(inout) :: b
end subroutine psb_d_mv_from
end interface
@ -626,7 +626,7 @@ module psb_d_mat_mod
subroutine psb_d_mv_to(a,b)
import :: psb_ipk_, psb_dspmat_type, psb_dpk_, psb_d_base_sparse_mat
class(psb_dspmat_type), intent(inout) :: a
class(psb_d_base_sparse_mat), intent(out) :: b
class(psb_d_base_sparse_mat), intent(inout) :: b
end subroutine psb_d_mv_to
end interface
@ -634,7 +634,7 @@ module psb_d_mat_mod
subroutine psb_d_cp_to(a,b)
import :: psb_ipk_, psb_dspmat_type, psb_dpk_, psb_d_base_sparse_mat
class(psb_dspmat_type), intent(in) :: a
class(psb_d_base_sparse_mat), intent(out) :: b
class(psb_d_base_sparse_mat), intent(inout) :: b
end subroutine psb_d_cp_to
end interface
@ -645,7 +645,7 @@ module psb_d_mat_mod
subroutine psb_dspmat_type_move(a,b,info)
import :: psb_ipk_, psb_dspmat_type
class(psb_dspmat_type), intent(inout) :: a
class(psb_dspmat_type), intent(out) :: b
class(psb_dspmat_type), intent(inout) :: b
integer(psb_ipk_), intent(out) :: info
end subroutine psb_dspmat_type_move
end interface

@ -158,11 +158,14 @@ contains
subroutine d_vect_bld_x(x,invect,mold)
real(psb_dpk_), intent(in) :: invect(:)
class(psb_d_vect_type), intent(out) :: x
class(psb_d_vect_type), intent(inout) :: x
class(psb_d_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_d_base_vect_type), pointer :: mld
if (allocated(x%v)) &
& call x%v%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
@ -185,11 +188,15 @@ contains
subroutine d_vect_bld_n(x,n,mold)
integer(psb_ipk_), intent(in) :: n
class(psb_d_vect_type), intent(out) :: x
class(psb_d_vect_type), intent(inout) :: x
class(psb_d_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_d_base_vect_type), pointer :: mld
if (allocated(x%v)) &
& call x%v%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
@ -493,11 +500,14 @@ contains
subroutine d_vect_all(n, x, info, mold)
implicit none
integer(psb_ipk_), intent(in) :: n
class(psb_d_vect_type), intent(out) :: x
integer(psb_ipk_), intent(in) :: n
class(psb_d_vect_type), intent(inout) :: x
class(psb_d_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_), intent(out) :: info
if (allocated(x%v)) &
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)

@ -348,7 +348,7 @@ module psb_s_mat_mod
interface
subroutine psb_s_csall(nr,nc,a,info,nz)
import :: psb_ipk_, psb_sspmat_type
class(psb_sspmat_type), intent(out) :: a
class(psb_sspmat_type), intent(inout) :: a
integer(psb_ipk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz
@ -466,7 +466,7 @@ module psb_s_mat_mod
& imin,imax,jmin,jmax,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(inout) :: b
integer(psb_ipk_),intent(out) :: info
integer(psb_ipk_), intent(in), optional :: imin,imax,jmin,jmax
logical, intent(in), optional :: rscale,cscale
@ -504,7 +504,7 @@ module psb_s_mat_mod
subroutine psb_s_transp_2mat(a,b)
import :: psb_ipk_, psb_sspmat_type
class(psb_sspmat_type), intent(in) :: a
class(psb_sspmat_type), intent(out) :: b
class(psb_sspmat_type), intent(inout) :: b
end subroutine psb_s_transp_2mat
end interface
@ -519,7 +519,7 @@ module psb_s_mat_mod
subroutine psb_s_transc_2mat(a,b)
import :: psb_ipk_, psb_sspmat_type
class(psb_sspmat_type), intent(in) :: a
class(psb_sspmat_type), intent(out) :: b
class(psb_sspmat_type), intent(inout) :: b
end subroutine psb_s_transc_2mat
end interface
@ -549,8 +549,8 @@ module psb_s_mat_mod
interface
subroutine psb_s_cscnv(a,b,info,type,mold,upd,dupl)
import :: psb_ipk_, psb_sspmat_type, psb_spk_, psb_s_base_sparse_mat
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(out) :: info
integer(psb_ipk_),optional, intent(in) :: dupl, upd
character(len=*), optional, intent(in) :: type
@ -588,8 +588,8 @@ module psb_s_mat_mod
interface
subroutine psb_s_clip_d(a,b,info)
import :: psb_ipk_, psb_sspmat_type
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(out) :: info
end subroutine psb_s_clip_d
end interface
@ -609,7 +609,7 @@ module psb_s_mat_mod
interface
subroutine psb_s_mv_from(a,b)
import :: psb_ipk_, psb_sspmat_type, psb_spk_, psb_s_base_sparse_mat
class(psb_sspmat_type), intent(out) :: a
class(psb_sspmat_type), intent(inout) :: a
class(psb_s_base_sparse_mat), intent(inout) :: b
end subroutine psb_s_mv_from
end interface
@ -626,7 +626,7 @@ module psb_s_mat_mod
subroutine psb_s_mv_to(a,b)
import :: psb_ipk_, psb_sspmat_type, psb_spk_, psb_s_base_sparse_mat
class(psb_sspmat_type), intent(inout) :: a
class(psb_s_base_sparse_mat), intent(out) :: b
class(psb_s_base_sparse_mat), intent(inout) :: b
end subroutine psb_s_mv_to
end interface
@ -634,7 +634,7 @@ module psb_s_mat_mod
subroutine psb_s_cp_to(a,b)
import :: psb_ipk_, psb_sspmat_type, psb_spk_, psb_s_base_sparse_mat
class(psb_sspmat_type), intent(in) :: a
class(psb_s_base_sparse_mat), intent(out) :: b
class(psb_s_base_sparse_mat), intent(inout) :: b
end subroutine psb_s_cp_to
end interface
@ -645,7 +645,7 @@ module psb_s_mat_mod
subroutine psb_sspmat_type_move(a,b,info)
import :: psb_ipk_, psb_sspmat_type
class(psb_sspmat_type), intent(inout) :: a
class(psb_sspmat_type), intent(out) :: b
class(psb_sspmat_type), intent(inout) :: b
integer(psb_ipk_), intent(out) :: info
end subroutine psb_sspmat_type_move
end interface

@ -158,11 +158,14 @@ contains
subroutine s_vect_bld_x(x,invect,mold)
real(psb_spk_), intent(in) :: invect(:)
class(psb_s_vect_type), intent(out) :: x
class(psb_s_vect_type), intent(inout) :: x
class(psb_s_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_s_base_vect_type), pointer :: mld
if (allocated(x%v)) &
& call x%v%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
@ -185,11 +188,15 @@ contains
subroutine s_vect_bld_n(x,n,mold)
integer(psb_ipk_), intent(in) :: n
class(psb_s_vect_type), intent(out) :: x
class(psb_s_vect_type), intent(inout) :: x
class(psb_s_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_s_base_vect_type), pointer :: mld
if (allocated(x%v)) &
& call x%v%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
@ -493,11 +500,14 @@ contains
subroutine s_vect_all(n, x, info, mold)
implicit none
integer(psb_ipk_), intent(in) :: n
class(psb_s_vect_type), intent(out) :: x
integer(psb_ipk_), intent(in) :: n
class(psb_s_vect_type), intent(inout) :: x
class(psb_s_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_), intent(out) :: info
if (allocated(x%v)) &
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)

@ -348,7 +348,7 @@ module psb_z_mat_mod
interface
subroutine psb_z_csall(nr,nc,a,info,nz)
import :: psb_ipk_, psb_zspmat_type
class(psb_zspmat_type), intent(out) :: a
class(psb_zspmat_type), intent(inout) :: a
integer(psb_ipk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz
@ -466,7 +466,7 @@ module psb_z_mat_mod
& imin,imax,jmin,jmax,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(inout) :: b
integer(psb_ipk_),intent(out) :: info
integer(psb_ipk_), intent(in), optional :: imin,imax,jmin,jmax
logical, intent(in), optional :: rscale,cscale
@ -504,7 +504,7 @@ module psb_z_mat_mod
subroutine psb_z_transp_2mat(a,b)
import :: psb_ipk_, psb_zspmat_type
class(psb_zspmat_type), intent(in) :: a
class(psb_zspmat_type), intent(out) :: b
class(psb_zspmat_type), intent(inout) :: b
end subroutine psb_z_transp_2mat
end interface
@ -519,7 +519,7 @@ module psb_z_mat_mod
subroutine psb_z_transc_2mat(a,b)
import :: psb_ipk_, psb_zspmat_type
class(psb_zspmat_type), intent(in) :: a
class(psb_zspmat_type), intent(out) :: b
class(psb_zspmat_type), intent(inout) :: b
end subroutine psb_z_transc_2mat
end interface
@ -549,8 +549,8 @@ module psb_z_mat_mod
interface
subroutine psb_z_cscnv(a,b,info,type,mold,upd,dupl)
import :: psb_ipk_, psb_zspmat_type, psb_dpk_, psb_z_base_sparse_mat
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(out) :: info
integer(psb_ipk_),optional, intent(in) :: dupl, upd
character(len=*), optional, intent(in) :: type
@ -588,8 +588,8 @@ module psb_z_mat_mod
interface
subroutine psb_z_clip_d(a,b,info)
import :: psb_ipk_, psb_zspmat_type
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(out) :: info
end subroutine psb_z_clip_d
end interface
@ -609,7 +609,7 @@ module psb_z_mat_mod
interface
subroutine psb_z_mv_from(a,b)
import :: psb_ipk_, psb_zspmat_type, psb_dpk_, psb_z_base_sparse_mat
class(psb_zspmat_type), intent(out) :: a
class(psb_zspmat_type), intent(inout) :: a
class(psb_z_base_sparse_mat), intent(inout) :: b
end subroutine psb_z_mv_from
end interface
@ -626,7 +626,7 @@ module psb_z_mat_mod
subroutine psb_z_mv_to(a,b)
import :: psb_ipk_, psb_zspmat_type, psb_dpk_, psb_z_base_sparse_mat
class(psb_zspmat_type), intent(inout) :: a
class(psb_z_base_sparse_mat), intent(out) :: b
class(psb_z_base_sparse_mat), intent(inout) :: b
end subroutine psb_z_mv_to
end interface
@ -634,7 +634,7 @@ module psb_z_mat_mod
subroutine psb_z_cp_to(a,b)
import :: psb_ipk_, psb_zspmat_type, psb_dpk_, psb_z_base_sparse_mat
class(psb_zspmat_type), intent(in) :: a
class(psb_z_base_sparse_mat), intent(out) :: b
class(psb_z_base_sparse_mat), intent(inout) :: b
end subroutine psb_z_cp_to
end interface
@ -645,7 +645,7 @@ module psb_z_mat_mod
subroutine psb_zspmat_type_move(a,b,info)
import :: psb_ipk_, psb_zspmat_type
class(psb_zspmat_type), intent(inout) :: a
class(psb_zspmat_type), intent(out) :: b
class(psb_zspmat_type), intent(inout) :: b
integer(psb_ipk_), intent(out) :: info
end subroutine psb_zspmat_type_move
end interface

@ -158,11 +158,14 @@ contains
subroutine z_vect_bld_x(x,invect,mold)
complex(psb_dpk_), intent(in) :: invect(:)
class(psb_z_vect_type), intent(out) :: x
class(psb_z_vect_type), intent(inout) :: x
class(psb_z_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_z_base_vect_type), pointer :: mld
if (allocated(x%v)) &
& call x%v%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
@ -185,11 +188,15 @@ contains
subroutine z_vect_bld_n(x,n,mold)
integer(psb_ipk_), intent(in) :: n
class(psb_z_vect_type), intent(out) :: x
class(psb_z_vect_type), intent(inout) :: x
class(psb_z_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_z_base_vect_type), pointer :: mld
if (allocated(x%v)) &
& call x%v%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
@ -493,11 +500,14 @@ contains
subroutine z_vect_all(n, x, info, mold)
implicit none
integer(psb_ipk_), intent(in) :: n
class(psb_z_vect_type), intent(out) :: x
integer(psb_ipk_), intent(in) :: n
class(psb_z_vect_type), intent(inout) :: x
class(psb_z_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_), intent(out) :: info
if (allocated(x%v)) &
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)

@ -618,7 +618,7 @@ subroutine psb_c_csall(nr,nc,a,info,nz)
use psb_c_base_mat_mod
use psb_error_mod
implicit none
class(psb_cspmat_type), intent(out) :: a
class(psb_cspmat_type), intent(inout) :: a
integer(psb_ipk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz
@ -629,6 +629,8 @@ subroutine psb_c_csall(nr,nc,a,info,nz)
call psb_get_erraction(err_act)
call a%free()
info = psb_success_
allocate(psb_c_coo_sparse_mat :: a%a, stat=info)
if (info /= psb_success_) then
@ -968,8 +970,8 @@ subroutine psb_c_tril(a,b,info,diag,imin,imax,&
call psb_errpush(info,name)
goto 9999
endif
allocate(acoo,stat=info)
call b%free()
if (info == psb_success_) then
call a%a%tril(acoo,info,diag,imin,imax,&
@ -1023,6 +1025,7 @@ subroutine psb_c_triu(a,b,info,diag,imin,imax,&
endif
allocate(acoo,stat=info)
call b%free()
if (info == psb_success_) then
call a%a%triu(acoo,info,diag,imin,imax,&
@ -1059,7 +1062,7 @@ subroutine psb_c_csclip(a,b,info,&
implicit none
class(psb_cspmat_type), intent(in) :: a
class(psb_cspmat_type), intent(out) :: b
class(psb_cspmat_type), intent(inout) :: b
integer(psb_ipk_),intent(out) :: info
integer(psb_ipk_), intent(in), optional :: imin,imax,jmin,jmax
logical, intent(in), optional :: rscale,cscale
@ -1078,7 +1081,7 @@ subroutine psb_c_csclip(a,b,info,&
endif
allocate(acoo,stat=info)
call b%free()
if (info == psb_success_) then
call a%a%csclip(acoo,info,&
& imin,imax,jmin,jmax,rscale,cscale)
@ -1155,8 +1158,8 @@ subroutine psb_c_cscnv(a,b,info,type,mold,upd,dupl)
use psb_string_mod
use psb_c_mat_mod, psb_protect_name => psb_c_cscnv
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(out) :: info
integer(psb_ipk_),optional, intent(in) :: dupl, upd
character(len=*), optional, intent(in) :: type
@ -1177,6 +1180,7 @@ subroutine psb_c_cscnv(a,b,info,type,mold,upd,dupl)
call psb_errpush(info,name)
goto 9999
endif
call b%free()
if (count( (/present(mold),present(type) /)) > 1) then
info = psb_err_many_optional_arg_
call psb_errpush(info,name,a_err='TYPE, MOLD')
@ -1426,8 +1430,8 @@ subroutine psb_c_clip_d(a,b,info)
use psb_c_mat_mod, psb_protect_name => psb_c_clip_d
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(out) :: info
integer(psb_ipk_) :: err_act
@ -1547,10 +1551,11 @@ subroutine psb_c_mv_from(a,b)
use psb_string_mod
use psb_c_mat_mod, psb_protect_name => psb_c_mv_from
implicit none
class(psb_cspmat_type), intent(out) :: a
class(psb_cspmat_type), intent(inout) :: a
class(psb_c_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
call a%free()
#if defined(HAVE_MOLD)
allocate(a%a,mold=b, stat=info)
#else
@ -1577,6 +1582,7 @@ subroutine psb_c_cp_from(a,b)
call psb_erractionsave(err_act)
info = psb_success_
call a%free()
!
! Note: it is tempting to use SOURCE allocation below;
! however this would run the risk of messing up with data
@ -1610,9 +1616,9 @@ subroutine psb_c_mv_to(a,b)
use psb_c_mat_mod, psb_protect_name => psb_c_mv_to
implicit none
class(psb_cspmat_type), intent(inout) :: a
class(psb_c_base_sparse_mat), intent(out) :: b
class(psb_c_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
call b%mv_from_fmt(a%a,info)
return
@ -1625,7 +1631,7 @@ subroutine psb_c_cp_to(a,b)
use psb_c_mat_mod, psb_protect_name => psb_c_cp_to
implicit none
class(psb_cspmat_type), intent(in) :: a
class(psb_c_base_sparse_mat), intent(out) :: b
class(psb_c_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
call b%cp_from_fmt(a%a,info)
@ -1652,7 +1658,7 @@ subroutine psb_cspmat_type_move(a,b,info)
use psb_c_mat_mod, psb_protect_name => psb_cspmat_type_move
implicit none
class(psb_cspmat_type), intent(inout) :: a
class(psb_cspmat_type), intent(out) :: b
class(psb_cspmat_type), intent(inout) :: b
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
@ -1660,6 +1666,7 @@ subroutine psb_cspmat_type_move(a,b,info)
logical, parameter :: debug=.false.
info = psb_success_
call b%free()
call move_alloc(a%a,b%a)
return
@ -1743,7 +1750,7 @@ subroutine psb_c_transp_2mat(a,b)
use psb_c_mat_mod, psb_protect_name => psb_c_transp_2mat
implicit none
class(psb_cspmat_type), intent(in) :: a
class(psb_cspmat_type), intent(out) :: b
class(psb_cspmat_type), intent(inout) :: b
integer(psb_ipk_) :: err_act, info
character(len=20) :: name='transp'
@ -1756,7 +1763,7 @@ subroutine psb_c_transp_2mat(a,b)
call psb_errpush(info,name)
goto 9999
endif
call b%free()
#if defined(HAVE_MOLD)
allocate(b%a,mold=a%a,stat=info)
#else
@ -1823,8 +1830,8 @@ subroutine psb_c_transc_2mat(a,b)
use psb_string_mod
use psb_c_mat_mod, psb_protect_name => psb_c_transc_2mat
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_) :: err_act, info
character(len=20) :: name='transc'
@ -1837,7 +1844,7 @@ subroutine psb_c_transc_2mat(a,b)
call psb_errpush(info,name)
goto 9999
endif
call b%free()
#if defined(HAVE_MOLD)
allocate(b%a,mold=a%a,stat=info)
#else

@ -618,7 +618,7 @@ subroutine psb_d_csall(nr,nc,a,info,nz)
use psb_d_base_mat_mod
use psb_error_mod
implicit none
class(psb_dspmat_type), intent(out) :: a
class(psb_dspmat_type), intent(inout) :: a
integer(psb_ipk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz
@ -629,6 +629,8 @@ subroutine psb_d_csall(nr,nc,a,info,nz)
call psb_get_erraction(err_act)
call a%free()
info = psb_success_
allocate(psb_d_coo_sparse_mat :: a%a, stat=info)
if (info /= psb_success_) then
@ -968,8 +970,8 @@ subroutine psb_d_tril(a,b,info,diag,imin,imax,&
call psb_errpush(info,name)
goto 9999
endif
allocate(acoo,stat=info)
call b%free()
if (info == psb_success_) then
call a%a%tril(acoo,info,diag,imin,imax,&
@ -1023,6 +1025,7 @@ subroutine psb_d_triu(a,b,info,diag,imin,imax,&
endif
allocate(acoo,stat=info)
call b%free()
if (info == psb_success_) then
call a%a%triu(acoo,info,diag,imin,imax,&
@ -1059,7 +1062,7 @@ subroutine psb_d_csclip(a,b,info,&
implicit none
class(psb_dspmat_type), intent(in) :: a
class(psb_dspmat_type), intent(out) :: b
class(psb_dspmat_type), intent(inout) :: b
integer(psb_ipk_),intent(out) :: info
integer(psb_ipk_), intent(in), optional :: imin,imax,jmin,jmax
logical, intent(in), optional :: rscale,cscale
@ -1078,7 +1081,7 @@ subroutine psb_d_csclip(a,b,info,&
endif
allocate(acoo,stat=info)
call b%free()
if (info == psb_success_) then
call a%a%csclip(acoo,info,&
& imin,imax,jmin,jmax,rscale,cscale)
@ -1155,8 +1158,8 @@ subroutine psb_d_cscnv(a,b,info,type,mold,upd,dupl)
use psb_string_mod
use psb_d_mat_mod, psb_protect_name => psb_d_cscnv
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(out) :: info
integer(psb_ipk_),optional, intent(in) :: dupl, upd
character(len=*), optional, intent(in) :: type
@ -1177,6 +1180,7 @@ subroutine psb_d_cscnv(a,b,info,type,mold,upd,dupl)
call psb_errpush(info,name)
goto 9999
endif
call b%free()
if (count( (/present(mold),present(type) /)) > 1) then
info = psb_err_many_optional_arg_
call psb_errpush(info,name,a_err='TYPE, MOLD')
@ -1426,8 +1430,8 @@ subroutine psb_d_clip_d(a,b,info)
use psb_d_mat_mod, psb_protect_name => psb_d_clip_d
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(out) :: info
integer(psb_ipk_) :: err_act
@ -1547,10 +1551,11 @@ subroutine psb_d_mv_from(a,b)
use psb_string_mod
use psb_d_mat_mod, psb_protect_name => psb_d_mv_from
implicit none
class(psb_dspmat_type), intent(out) :: a
class(psb_dspmat_type), intent(inout) :: a
class(psb_d_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
call a%free()
#if defined(HAVE_MOLD)
allocate(a%a,mold=b, stat=info)
#else
@ -1577,6 +1582,7 @@ subroutine psb_d_cp_from(a,b)
call psb_erractionsave(err_act)
info = psb_success_
call a%free()
!
! Note: it is tempting to use SOURCE allocation below;
! however this would run the risk of messing up with data
@ -1610,9 +1616,9 @@ subroutine psb_d_mv_to(a,b)
use psb_d_mat_mod, psb_protect_name => psb_d_mv_to
implicit none
class(psb_dspmat_type), intent(inout) :: a
class(psb_d_base_sparse_mat), intent(out) :: b
class(psb_d_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
call b%mv_from_fmt(a%a,info)
return
@ -1625,7 +1631,7 @@ subroutine psb_d_cp_to(a,b)
use psb_d_mat_mod, psb_protect_name => psb_d_cp_to
implicit none
class(psb_dspmat_type), intent(in) :: a
class(psb_d_base_sparse_mat), intent(out) :: b
class(psb_d_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
call b%cp_from_fmt(a%a,info)
@ -1652,7 +1658,7 @@ subroutine psb_dspmat_type_move(a,b,info)
use psb_d_mat_mod, psb_protect_name => psb_dspmat_type_move
implicit none
class(psb_dspmat_type), intent(inout) :: a
class(psb_dspmat_type), intent(out) :: b
class(psb_dspmat_type), intent(inout) :: b
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
@ -1660,6 +1666,7 @@ subroutine psb_dspmat_type_move(a,b,info)
logical, parameter :: debug=.false.
info = psb_success_
call b%free()
call move_alloc(a%a,b%a)
return
@ -1743,7 +1750,7 @@ subroutine psb_d_transp_2mat(a,b)
use psb_d_mat_mod, psb_protect_name => psb_d_transp_2mat
implicit none
class(psb_dspmat_type), intent(in) :: a
class(psb_dspmat_type), intent(out) :: b
class(psb_dspmat_type), intent(inout) :: b
integer(psb_ipk_) :: err_act, info
character(len=20) :: name='transp'
@ -1756,7 +1763,7 @@ subroutine psb_d_transp_2mat(a,b)
call psb_errpush(info,name)
goto 9999
endif
call b%free()
#if defined(HAVE_MOLD)
allocate(b%a,mold=a%a,stat=info)
#else
@ -1823,8 +1830,8 @@ subroutine psb_d_transc_2mat(a,b)
use psb_string_mod
use psb_d_mat_mod, psb_protect_name => psb_d_transc_2mat
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_) :: err_act, info
character(len=20) :: name='transc'
@ -1837,7 +1844,7 @@ subroutine psb_d_transc_2mat(a,b)
call psb_errpush(info,name)
goto 9999
endif
call b%free()
#if defined(HAVE_MOLD)
allocate(b%a,mold=a%a,stat=info)
#else

@ -618,7 +618,7 @@ subroutine psb_s_csall(nr,nc,a,info,nz)
use psb_s_base_mat_mod
use psb_error_mod
implicit none
class(psb_sspmat_type), intent(out) :: a
class(psb_sspmat_type), intent(inout) :: a
integer(psb_ipk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz
@ -629,6 +629,8 @@ subroutine psb_s_csall(nr,nc,a,info,nz)
call psb_get_erraction(err_act)
call a%free()
info = psb_success_
allocate(psb_s_coo_sparse_mat :: a%a, stat=info)
if (info /= psb_success_) then
@ -968,8 +970,8 @@ subroutine psb_s_tril(a,b,info,diag,imin,imax,&
call psb_errpush(info,name)
goto 9999
endif
allocate(acoo,stat=info)
call b%free()
if (info == psb_success_) then
call a%a%tril(acoo,info,diag,imin,imax,&
@ -1023,6 +1025,7 @@ subroutine psb_s_triu(a,b,info,diag,imin,imax,&
endif
allocate(acoo,stat=info)
call b%free()
if (info == psb_success_) then
call a%a%triu(acoo,info,diag,imin,imax,&
@ -1059,7 +1062,7 @@ subroutine psb_s_csclip(a,b,info,&
implicit none
class(psb_sspmat_type), intent(in) :: a
class(psb_sspmat_type), intent(out) :: b
class(psb_sspmat_type), intent(inout) :: b
integer(psb_ipk_),intent(out) :: info
integer(psb_ipk_), intent(in), optional :: imin,imax,jmin,jmax
logical, intent(in), optional :: rscale,cscale
@ -1078,7 +1081,7 @@ subroutine psb_s_csclip(a,b,info,&
endif
allocate(acoo,stat=info)
call b%free()
if (info == psb_success_) then
call a%a%csclip(acoo,info,&
& imin,imax,jmin,jmax,rscale,cscale)
@ -1155,8 +1158,8 @@ subroutine psb_s_cscnv(a,b,info,type,mold,upd,dupl)
use psb_string_mod
use psb_s_mat_mod, psb_protect_name => psb_s_cscnv
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(out) :: info
integer(psb_ipk_),optional, intent(in) :: dupl, upd
character(len=*), optional, intent(in) :: type
@ -1177,6 +1180,7 @@ subroutine psb_s_cscnv(a,b,info,type,mold,upd,dupl)
call psb_errpush(info,name)
goto 9999
endif
call b%free()
if (count( (/present(mold),present(type) /)) > 1) then
info = psb_err_many_optional_arg_
call psb_errpush(info,name,a_err='TYPE, MOLD')
@ -1426,8 +1430,8 @@ subroutine psb_s_clip_d(a,b,info)
use psb_s_mat_mod, psb_protect_name => psb_s_clip_d
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(out) :: info
integer(psb_ipk_) :: err_act
@ -1547,10 +1551,11 @@ subroutine psb_s_mv_from(a,b)
use psb_string_mod
use psb_s_mat_mod, psb_protect_name => psb_s_mv_from
implicit none
class(psb_sspmat_type), intent(out) :: a
class(psb_sspmat_type), intent(inout) :: a
class(psb_s_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
call a%free()
#if defined(HAVE_MOLD)
allocate(a%a,mold=b, stat=info)
#else
@ -1577,6 +1582,7 @@ subroutine psb_s_cp_from(a,b)
call psb_erractionsave(err_act)
info = psb_success_
call a%free()
!
! Note: it is tempting to use SOURCE allocation below;
! however this would run the risk of messing up with data
@ -1610,9 +1616,9 @@ subroutine psb_s_mv_to(a,b)
use psb_s_mat_mod, psb_protect_name => psb_s_mv_to
implicit none
class(psb_sspmat_type), intent(inout) :: a
class(psb_s_base_sparse_mat), intent(out) :: b
class(psb_s_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
call b%mv_from_fmt(a%a,info)
return
@ -1625,7 +1631,7 @@ subroutine psb_s_cp_to(a,b)
use psb_s_mat_mod, psb_protect_name => psb_s_cp_to
implicit none
class(psb_sspmat_type), intent(in) :: a
class(psb_s_base_sparse_mat), intent(out) :: b
class(psb_s_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
call b%cp_from_fmt(a%a,info)
@ -1652,7 +1658,7 @@ subroutine psb_sspmat_type_move(a,b,info)
use psb_s_mat_mod, psb_protect_name => psb_sspmat_type_move
implicit none
class(psb_sspmat_type), intent(inout) :: a
class(psb_sspmat_type), intent(out) :: b
class(psb_sspmat_type), intent(inout) :: b
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
@ -1660,6 +1666,7 @@ subroutine psb_sspmat_type_move(a,b,info)
logical, parameter :: debug=.false.
info = psb_success_
call b%free()
call move_alloc(a%a,b%a)
return
@ -1743,7 +1750,7 @@ subroutine psb_s_transp_2mat(a,b)
use psb_s_mat_mod, psb_protect_name => psb_s_transp_2mat
implicit none
class(psb_sspmat_type), intent(in) :: a
class(psb_sspmat_type), intent(out) :: b
class(psb_sspmat_type), intent(inout) :: b
integer(psb_ipk_) :: err_act, info
character(len=20) :: name='transp'
@ -1756,7 +1763,7 @@ subroutine psb_s_transp_2mat(a,b)
call psb_errpush(info,name)
goto 9999
endif
call b%free()
#if defined(HAVE_MOLD)
allocate(b%a,mold=a%a,stat=info)
#else
@ -1823,8 +1830,8 @@ subroutine psb_s_transc_2mat(a,b)
use psb_string_mod
use psb_s_mat_mod, psb_protect_name => psb_s_transc_2mat
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_) :: err_act, info
character(len=20) :: name='transc'
@ -1837,7 +1844,7 @@ subroutine psb_s_transc_2mat(a,b)
call psb_errpush(info,name)
goto 9999
endif
call b%free()
#if defined(HAVE_MOLD)
allocate(b%a,mold=a%a,stat=info)
#else

@ -618,7 +618,7 @@ subroutine psb_z_csall(nr,nc,a,info,nz)
use psb_z_base_mat_mod
use psb_error_mod
implicit none
class(psb_zspmat_type), intent(out) :: a
class(psb_zspmat_type), intent(inout) :: a
integer(psb_ipk_), intent(in) :: nr,nc
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: nz
@ -629,6 +629,8 @@ subroutine psb_z_csall(nr,nc,a,info,nz)
call psb_get_erraction(err_act)
call a%free()
info = psb_success_
allocate(psb_z_coo_sparse_mat :: a%a, stat=info)
if (info /= psb_success_) then
@ -968,8 +970,8 @@ subroutine psb_z_tril(a,b,info,diag,imin,imax,&
call psb_errpush(info,name)
goto 9999
endif
allocate(acoo,stat=info)
call b%free()
if (info == psb_success_) then
call a%a%tril(acoo,info,diag,imin,imax,&
@ -1023,6 +1025,7 @@ subroutine psb_z_triu(a,b,info,diag,imin,imax,&
endif
allocate(acoo,stat=info)
call b%free()
if (info == psb_success_) then
call a%a%triu(acoo,info,diag,imin,imax,&
@ -1059,7 +1062,7 @@ subroutine psb_z_csclip(a,b,info,&
implicit none
class(psb_zspmat_type), intent(in) :: a
class(psb_zspmat_type), intent(out) :: b
class(psb_zspmat_type), intent(inout) :: b
integer(psb_ipk_),intent(out) :: info
integer(psb_ipk_), intent(in), optional :: imin,imax,jmin,jmax
logical, intent(in), optional :: rscale,cscale
@ -1078,7 +1081,7 @@ subroutine psb_z_csclip(a,b,info,&
endif
allocate(acoo,stat=info)
call b%free()
if (info == psb_success_) then
call a%a%csclip(acoo,info,&
& imin,imax,jmin,jmax,rscale,cscale)
@ -1155,8 +1158,8 @@ subroutine psb_z_cscnv(a,b,info,type,mold,upd,dupl)
use psb_string_mod
use psb_z_mat_mod, psb_protect_name => psb_z_cscnv
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(out) :: info
integer(psb_ipk_),optional, intent(in) :: dupl, upd
character(len=*), optional, intent(in) :: type
@ -1177,6 +1180,7 @@ subroutine psb_z_cscnv(a,b,info,type,mold,upd,dupl)
call psb_errpush(info,name)
goto 9999
endif
call b%free()
if (count( (/present(mold),present(type) /)) > 1) then
info = psb_err_many_optional_arg_
call psb_errpush(info,name,a_err='TYPE, MOLD')
@ -1426,8 +1430,8 @@ subroutine psb_z_clip_d(a,b,info)
use psb_z_mat_mod, psb_protect_name => psb_z_clip_d
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(out) :: info
integer(psb_ipk_) :: err_act
@ -1547,10 +1551,11 @@ subroutine psb_z_mv_from(a,b)
use psb_string_mod
use psb_z_mat_mod, psb_protect_name => psb_z_mv_from
implicit none
class(psb_zspmat_type), intent(out) :: a
class(psb_zspmat_type), intent(inout) :: a
class(psb_z_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
call a%free()
#if defined(HAVE_MOLD)
allocate(a%a,mold=b, stat=info)
#else
@ -1577,6 +1582,7 @@ subroutine psb_z_cp_from(a,b)
call psb_erractionsave(err_act)
info = psb_success_
call a%free()
!
! Note: it is tempting to use SOURCE allocation below;
! however this would run the risk of messing up with data
@ -1610,9 +1616,9 @@ subroutine psb_z_mv_to(a,b)
use psb_z_mat_mod, psb_protect_name => psb_z_mv_to
implicit none
class(psb_zspmat_type), intent(inout) :: a
class(psb_z_base_sparse_mat), intent(out) :: b
class(psb_z_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
call b%mv_from_fmt(a%a,info)
return
@ -1625,7 +1631,7 @@ subroutine psb_z_cp_to(a,b)
use psb_z_mat_mod, psb_protect_name => psb_z_cp_to
implicit none
class(psb_zspmat_type), intent(in) :: a
class(psb_z_base_sparse_mat), intent(out) :: b
class(psb_z_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
call b%cp_from_fmt(a%a,info)
@ -1652,7 +1658,7 @@ subroutine psb_zspmat_type_move(a,b,info)
use psb_z_mat_mod, psb_protect_name => psb_zspmat_type_move
implicit none
class(psb_zspmat_type), intent(inout) :: a
class(psb_zspmat_type), intent(out) :: b
class(psb_zspmat_type), intent(inout) :: b
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
@ -1660,6 +1666,7 @@ subroutine psb_zspmat_type_move(a,b,info)
logical, parameter :: debug=.false.
info = psb_success_
call b%free()
call move_alloc(a%a,b%a)
return
@ -1743,7 +1750,7 @@ subroutine psb_z_transp_2mat(a,b)
use psb_z_mat_mod, psb_protect_name => psb_z_transp_2mat
implicit none
class(psb_zspmat_type), intent(in) :: a
class(psb_zspmat_type), intent(out) :: b
class(psb_zspmat_type), intent(inout) :: b
integer(psb_ipk_) :: err_act, info
character(len=20) :: name='transp'
@ -1756,7 +1763,7 @@ subroutine psb_z_transp_2mat(a,b)
call psb_errpush(info,name)
goto 9999
endif
call b%free()
#if defined(HAVE_MOLD)
allocate(b%a,mold=a%a,stat=info)
#else
@ -1823,8 +1830,8 @@ subroutine psb_z_transc_2mat(a,b)
use psb_string_mod
use psb_z_mat_mod, psb_protect_name => psb_z_transc_2mat
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_) :: err_act, info
character(len=20) :: name='transc'
@ -1837,7 +1844,7 @@ subroutine psb_z_transc_2mat(a,b)
call psb_errpush(info,name)
goto 9999
endif
call b%free()
#if defined(HAVE_MOLD)
allocate(b%a,mold=a%a,stat=info)
#else

Loading…
Cancel
Save