diff --git a/base/serial/impl/psb_c_csr_impl.F90 b/base/serial/impl/psb_c_csr_impl.F90 index a9b30413..2f766c93 100644 --- a/base/serial/impl/psb_c_csr_impl.F90 +++ b/base/serial/impl/psb_c_csr_impl.F90 @@ -3332,7 +3332,7 @@ subroutine psb_c_mv_csr_to_coo(a,b,info) if (a%is_dev()) call a%sync() nr = a%get_nrows() nc = a%get_ncols() - nza = a%get_nzeros() + nza = max(a%get_nzeros(),ione) b%psb_c_base_sparse_mat = a%psb_c_base_sparse_mat call b%set_nzeros(a%get_nzeros()) @@ -3503,7 +3503,7 @@ subroutine psb_c_cp_csr_to_fmt(a,b,info) if (a%is_dev()) call a%sync() b%psb_c_base_sparse_mat = a%psb_c_base_sparse_mat nr = a%get_nrows() - nz = a%get_nzeros() + nz = max(a%get_nzeros(),ione) if (.false.) then if (info == 0) call psb_safe_cpy( a%irp(1:nr+1), b%irp , info) if (info == 0) call psb_safe_cpy( a%ja(1:nz), b%ja , info) @@ -3608,7 +3608,7 @@ subroutine psb_c_cp_csr_from_fmt(a,b,info) if (b%is_dev()) call b%sync() a%psb_c_base_sparse_mat = b%psb_c_base_sparse_mat nr = b%get_nrows() - nz = b%get_nzeros() + nz = max(b%get_nzeros(),ione) if (.false.) then if (info == 0) call psb_safe_cpy( b%irp(1:nr+1), a%irp , info) if (info == 0) call psb_safe_cpy( b%ja(1:nz) , a%ja , info) diff --git a/base/serial/impl/psb_c_mat_impl.F90 b/base/serial/impl/psb_c_mat_impl.F90 index b98408c7..37d6083c 100644 --- a/base/serial/impl/psb_c_mat_impl.F90 +++ b/base/serial/impl/psb_c_mat_impl.F90 @@ -446,9 +446,9 @@ subroutine psb_c_set_upper(a,val) call psb_erractionsave(err_act) if (allocated(a%a)) then - call a%a%set_lower(val) + call a%a%set_upper(val) else if (allocated(a%ad)) then - call a%ad%set_lower(val) + call a%ad%set_upper(val) else info = psb_err_invalid_mat_state_ call psb_errpush(info,name) diff --git a/base/serial/impl/psb_d_csr_impl.F90 b/base/serial/impl/psb_d_csr_impl.F90 index 79ea651a..b6c9da91 100644 --- a/base/serial/impl/psb_d_csr_impl.F90 +++ b/base/serial/impl/psb_d_csr_impl.F90 @@ -3332,7 +3332,7 @@ subroutine psb_d_mv_csr_to_coo(a,b,info) if (a%is_dev()) call a%sync() nr = a%get_nrows() nc = a%get_ncols() - nza = a%get_nzeros() + nza = max(a%get_nzeros(),ione) b%psb_d_base_sparse_mat = a%psb_d_base_sparse_mat call b%set_nzeros(a%get_nzeros()) @@ -3503,7 +3503,7 @@ subroutine psb_d_cp_csr_to_fmt(a,b,info) if (a%is_dev()) call a%sync() b%psb_d_base_sparse_mat = a%psb_d_base_sparse_mat nr = a%get_nrows() - nz = a%get_nzeros() + nz = max(a%get_nzeros(),ione) if (.false.) then if (info == 0) call psb_safe_cpy( a%irp(1:nr+1), b%irp , info) if (info == 0) call psb_safe_cpy( a%ja(1:nz), b%ja , info) @@ -3608,7 +3608,7 @@ subroutine psb_d_cp_csr_from_fmt(a,b,info) if (b%is_dev()) call b%sync() a%psb_d_base_sparse_mat = b%psb_d_base_sparse_mat nr = b%get_nrows() - nz = b%get_nzeros() + nz = max(b%get_nzeros(),ione) if (.false.) then if (info == 0) call psb_safe_cpy( b%irp(1:nr+1), a%irp , info) if (info == 0) call psb_safe_cpy( b%ja(1:nz) , a%ja , info) diff --git a/base/serial/impl/psb_d_mat_impl.F90 b/base/serial/impl/psb_d_mat_impl.F90 index 1c9a7893..0777d179 100644 --- a/base/serial/impl/psb_d_mat_impl.F90 +++ b/base/serial/impl/psb_d_mat_impl.F90 @@ -446,9 +446,9 @@ subroutine psb_d_set_upper(a,val) call psb_erractionsave(err_act) if (allocated(a%a)) then - call a%a%set_lower(val) + call a%a%set_upper(val) else if (allocated(a%ad)) then - call a%ad%set_lower(val) + call a%ad%set_upper(val) else info = psb_err_invalid_mat_state_ call psb_errpush(info,name) diff --git a/base/serial/impl/psb_s_csr_impl.F90 b/base/serial/impl/psb_s_csr_impl.F90 index f12de45c..393c188c 100644 --- a/base/serial/impl/psb_s_csr_impl.F90 +++ b/base/serial/impl/psb_s_csr_impl.F90 @@ -3332,7 +3332,7 @@ subroutine psb_s_mv_csr_to_coo(a,b,info) if (a%is_dev()) call a%sync() nr = a%get_nrows() nc = a%get_ncols() - nza = a%get_nzeros() + nza = max(a%get_nzeros(),ione) b%psb_s_base_sparse_mat = a%psb_s_base_sparse_mat call b%set_nzeros(a%get_nzeros()) @@ -3503,7 +3503,7 @@ subroutine psb_s_cp_csr_to_fmt(a,b,info) if (a%is_dev()) call a%sync() b%psb_s_base_sparse_mat = a%psb_s_base_sparse_mat nr = a%get_nrows() - nz = a%get_nzeros() + nz = max(a%get_nzeros(),ione) if (.false.) then if (info == 0) call psb_safe_cpy( a%irp(1:nr+1), b%irp , info) if (info == 0) call psb_safe_cpy( a%ja(1:nz), b%ja , info) @@ -3608,7 +3608,7 @@ subroutine psb_s_cp_csr_from_fmt(a,b,info) if (b%is_dev()) call b%sync() a%psb_s_base_sparse_mat = b%psb_s_base_sparse_mat nr = b%get_nrows() - nz = b%get_nzeros() + nz = max(b%get_nzeros(),ione) if (.false.) then if (info == 0) call psb_safe_cpy( b%irp(1:nr+1), a%irp , info) if (info == 0) call psb_safe_cpy( b%ja(1:nz) , a%ja , info) diff --git a/base/serial/impl/psb_s_mat_impl.F90 b/base/serial/impl/psb_s_mat_impl.F90 index ca78bab0..217f8c8b 100644 --- a/base/serial/impl/psb_s_mat_impl.F90 +++ b/base/serial/impl/psb_s_mat_impl.F90 @@ -446,9 +446,9 @@ subroutine psb_s_set_upper(a,val) call psb_erractionsave(err_act) if (allocated(a%a)) then - call a%a%set_lower(val) + call a%a%set_upper(val) else if (allocated(a%ad)) then - call a%ad%set_lower(val) + call a%ad%set_upper(val) else info = psb_err_invalid_mat_state_ call psb_errpush(info,name) diff --git a/base/serial/impl/psb_z_csr_impl.F90 b/base/serial/impl/psb_z_csr_impl.F90 index a79e9b3c..4a13a163 100644 --- a/base/serial/impl/psb_z_csr_impl.F90 +++ b/base/serial/impl/psb_z_csr_impl.F90 @@ -3332,7 +3332,7 @@ subroutine psb_z_mv_csr_to_coo(a,b,info) if (a%is_dev()) call a%sync() nr = a%get_nrows() nc = a%get_ncols() - nza = a%get_nzeros() + nza = max(a%get_nzeros(),ione) b%psb_z_base_sparse_mat = a%psb_z_base_sparse_mat call b%set_nzeros(a%get_nzeros()) @@ -3503,7 +3503,7 @@ subroutine psb_z_cp_csr_to_fmt(a,b,info) if (a%is_dev()) call a%sync() b%psb_z_base_sparse_mat = a%psb_z_base_sparse_mat nr = a%get_nrows() - nz = a%get_nzeros() + nz = max(a%get_nzeros(),ione) if (.false.) then if (info == 0) call psb_safe_cpy( a%irp(1:nr+1), b%irp , info) if (info == 0) call psb_safe_cpy( a%ja(1:nz), b%ja , info) @@ -3608,7 +3608,7 @@ subroutine psb_z_cp_csr_from_fmt(a,b,info) if (b%is_dev()) call b%sync() a%psb_z_base_sparse_mat = b%psb_z_base_sparse_mat nr = b%get_nrows() - nz = b%get_nzeros() + nz = max(b%get_nzeros(),ione) if (.false.) then if (info == 0) call psb_safe_cpy( b%irp(1:nr+1), a%irp , info) if (info == 0) call psb_safe_cpy( b%ja(1:nz) , a%ja , info) diff --git a/base/serial/impl/psb_z_mat_impl.F90 b/base/serial/impl/psb_z_mat_impl.F90 index dc074c14..d87e5a07 100644 --- a/base/serial/impl/psb_z_mat_impl.F90 +++ b/base/serial/impl/psb_z_mat_impl.F90 @@ -446,9 +446,9 @@ subroutine psb_z_set_upper(a,val) call psb_erractionsave(err_act) if (allocated(a%a)) then - call a%a%set_lower(val) + call a%a%set_upper(val) else if (allocated(a%ad)) then - call a%ad%set_lower(val) + call a%ad%set_upper(val) else info = psb_err_invalid_mat_state_ call psb_errpush(info,name) diff --git a/prec/impl/psb_c_ilu0_fact.f90 b/prec/impl/psb_c_ilu0_fact.f90 index c016359f..850ffa69 100644 --- a/prec/impl/psb_c_ilu0_fact.f90 +++ b/prec/impl/psb_c_ilu0_fact.f90 @@ -139,7 +139,7 @@ subroutine psb_cilu0_fact(ialg,a,l,u,d,info,blck, upd,shft) ! Arguments integer(psb_ipk_), intent(in) :: ialg - type(psb_cspmat_type),intent(in) :: a + type(psb_cspmat_type),intent(inout) :: a type(psb_cspmat_type),intent(inout) :: l,u complex(psb_spk_), intent(inout) :: d(:) integer(psb_ipk_), intent(out) :: info @@ -150,7 +150,7 @@ subroutine psb_cilu0_fact(ialg,a,l,u,d,info,blck, upd,shft) ! Local variables integer(psb_ipk_) :: l1, l2, m, err_act type(psb_cspmat_type), pointer :: blck_ - type(psb_c_csr_sparse_mat) :: ll, uu + type(psb_c_csr_sparse_mat) :: ll, uu, aa, bb complex(psb_spk_) :: shft_ character :: upd_ character(len=20) :: name, ch_err @@ -196,10 +196,12 @@ subroutine psb_cilu0_fact(ialg,a,l,u,d,info,blck, upd,shft) call l%mv_to(ll) call u%mv_to(uu) + call a%cp_to(aa) + call blck_%cp_to(bb) ! ! Compute the ILU(0) or the MILU(0) factorization, depending on ialg ! - call psb_cilu0_factint(ialg,a,blck_,& + call psb_cilu0_factint(ialg,aa,bb,& & d,ll%val,ll%ja,ll%irp,uu%val,uu%ja,uu%irp,l1,l2,upd_,shft_,info) if(info.ne.0) then info=psb_err_from_subroutine_ @@ -327,7 +329,7 @@ contains ! Arguments integer(psb_ipk_), intent(in) :: ialg - type(psb_cspmat_type),intent(in) :: a,b + class(psb_c_base_sparse_mat),intent(inout) :: a,b integer(psb_ipk_),intent(inout) :: l1,l2,info integer(psb_ipk_), intent(inout) :: lja(:),lirp(:),uja(:),uirp(:) complex(psb_spk_), intent(inout) :: lval(:),uval(:),d(:) @@ -590,7 +592,7 @@ contains ! until we empty the buffer. Thus we will make a call to psb_sp_getblk ! every nrb calls to copyin. If A is in CSR format it is unused. ! - subroutine ilu_copyin(i,m,a,jd,jmin,jmax,l1,lja,lval,& + subroutine ilu_copyin(i,m,aa,jd,jmin,jmax,l1,lja,lval,& & dia,l2,uja,uval,ktrw,trw,upd,shft) use psb_base_mod @@ -598,7 +600,7 @@ contains implicit none ! Arguments - type(psb_cspmat_type), intent(in) :: a + class(psb_c_base_sparse_mat),intent(inout) :: aa type(psb_c_coo_sparse_mat), intent(inout) :: trw integer(psb_ipk_), intent(in) :: i,m,jd,jmin,jmax integer(psb_ipk_), intent(inout) :: ktrw,l1,l2 @@ -619,7 +621,7 @@ contains end if if (psb_toupper(upd) == 'F') then - select type(aa => a%a) + select type(aa) type is (psb_c_csr_sparse_mat) ! diff --git a/prec/impl/psb_c_iluk_fact.f90 b/prec/impl/psb_c_iluk_fact.f90 index 6c6d8a5f..fbcfa26e 100644 --- a/prec/impl/psb_c_iluk_fact.f90 +++ b/prec/impl/psb_c_iluk_fact.f90 @@ -137,7 +137,7 @@ subroutine psb_ciluk_fact(fill_in,ialg,a,l,u,d,info,blck,shft) ! Arguments integer(psb_ipk_), intent(in) :: fill_in, ialg integer(psb_ipk_), intent(out) :: info - type(psb_cspmat_type),intent(in) :: a + type(psb_cspmat_type),intent(inout) :: a type(psb_cspmat_type),intent(inout) :: l,u type(psb_cspmat_type),intent(in), optional, target :: blck complex(psb_spk_), intent(inout) :: d(:) @@ -147,7 +147,7 @@ subroutine psb_ciluk_fact(fill_in,ialg,a,l,u,d,info,blck,shft) complex(psb_spk_) :: shft_ type(psb_cspmat_type), pointer :: blck_ - type(psb_c_csr_sparse_mat) :: ll, uu + type(psb_c_csr_sparse_mat) :: ll, uu, aa, bb character(len=20) :: name, ch_err name='psb_ciluk_fact' @@ -186,11 +186,12 @@ subroutine psb_ciluk_fact(fill_in,ialg,a,l,u,d,info,blck,shft) call l%mv_to(ll) call u%mv_to(uu) - + call a%cp_to(aa) + call blck_%cp_to(bb) ! ! Compute the ILU(k) or the MILU(k) factorization, depending on ialg ! - call psb_ciluk_factint(fill_in,ialg,a,blck_,& + call psb_ciluk_factint(fill_in,ialg,aa,bb,& & d,ll%val,ll%ja,ll%irp,uu%val,uu%ja,uu%irp,l1,l2,info,shft_) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -313,7 +314,7 @@ contains ! Arguments integer(psb_ipk_), intent(in) :: fill_in, ialg - type(psb_cspmat_type),intent(in) :: a,b + class(psb_c_base_sparse_mat),intent(inout) :: a,b integer(psb_ipk_),intent(inout) :: l1,l2,info integer(psb_ipk_), allocatable, intent(inout) :: lja(:),lirp(:),uja(:),uirp(:) complex(psb_spk_), allocatable, intent(inout) :: lval(:),uval(:) @@ -524,14 +525,14 @@ contains ! until we empty the buffer. Thus we will make a call to psb_sp_getblk ! every nrb calls to copyin. If A is in CSR format it is unused. ! - subroutine iluk_copyin(i,m,a,jmin,jmax,row,rowlevs,heap,ktrw,trw,info,shft) + subroutine iluk_copyin(i,m,aa,jmin,jmax,row,rowlevs,heap,ktrw,trw,info,shft) use psb_base_mod implicit none ! Arguments - type(psb_cspmat_type), intent(in) :: a + class(psb_c_base_sparse_mat),intent(inout) :: aa type(psb_c_coo_sparse_mat), intent(inout) :: trw integer(psb_ipk_), intent(in) :: i,m,jmin,jmax integer(psb_ipk_), intent(inout) :: ktrw,info @@ -554,7 +555,7 @@ contains end if call heap%init(info) - select type (aa=> a%a) + select type (aa) type is (psb_c_csr_sparse_mat) ! ! Take a fast shortcut if the matrix is stored in CSR format diff --git a/prec/impl/psb_c_ilut_fact.f90 b/prec/impl/psb_c_ilut_fact.f90 index 8421ee1c..87be13b0 100644 --- a/prec/impl/psb_c_ilut_fact.f90 +++ b/prec/impl/psb_c_ilut_fact.f90 @@ -134,7 +134,7 @@ subroutine psb_cilut_fact(fill_in,thres,a,l,u,d,info,blck,iscale,shft) integer(psb_ipk_), intent(in) :: fill_in real(psb_spk_), intent(in) :: thres integer(psb_ipk_), intent(out) :: info - type(psb_cspmat_type),intent(in) :: a + type(psb_cspmat_type),intent(inout) :: a type(psb_cspmat_type),intent(inout) :: l,u complex(psb_spk_), intent(inout) :: d(:) type(psb_cspmat_type),intent(in), optional, target :: blck @@ -145,7 +145,7 @@ subroutine psb_cilut_fact(fill_in,thres,a,l,u,d,info,blck,iscale,shft) complex(psb_spk_) :: shft_ type(psb_cspmat_type), pointer :: blck_ - type(psb_c_csr_sparse_mat) :: ll, uu + type(psb_c_csr_sparse_mat) :: ll, uu, aa, bb real(psb_spk_) :: scale character(len=20) :: name, ch_err @@ -208,11 +208,12 @@ subroutine psb_cilut_fact(fill_in,thres,a,l,u,d,info,blck,iscale,shft) call l%mv_to(ll) call u%mv_to(uu) - + call a%cp_to(aa) + call blck_%cp_to(bb) ! ! Compute the ILU(k,t) factorization ! - call psb_cilut_factint(fill_in,thres,a,blck_,& + call psb_cilut_factint(fill_in,thres,aa,bb,& & d,ll%val,ll%ja,ll%irp,uu%val,uu%ja,uu%irp,l1,l2,info,scale,shft_) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -332,7 +333,7 @@ contains ! Arguments integer(psb_ipk_), intent(in) :: fill_in real(psb_spk_), intent(in) :: thres - type(psb_cspmat_type),intent(in) :: a,b + class(psb_c_base_sparse_mat),intent(inout) :: a,b integer(psb_ipk_),intent(inout) :: l1,l2,info integer(psb_ipk_), allocatable, intent(inout) :: lja(:),lirp(:),uja(:),uirp(:) complex(psb_spk_), allocatable, intent(inout) :: lval(:),uval(:) @@ -547,11 +548,11 @@ contains ! until we empty the buffer. Thus we will make a call to psb_sp_getblk ! every nrb calls to copyin. If A is in CSR format it is unused. ! - subroutine ilut_copyin(i,m,a,jd,jmin,jmax,nlw,nup,jmaxup,& + subroutine ilut_copyin(i,m,aa,jd,jmin,jmax,nlw,nup,jmaxup,& & nrmi,weight,row,heap,ktrw,trw,info,shft) use psb_base_mod implicit none - type(psb_cspmat_type), intent(in) :: a + class(psb_c_base_sparse_mat),intent(inout) :: aa type(psb_c_coo_sparse_mat), intent(inout) :: trw integer(psb_ipk_), intent(in) :: i, m,jmin,jmax,jd integer(psb_ipk_), intent(inout) :: ktrw,nlw,nup,jmaxup,info @@ -593,7 +594,7 @@ contains dmaxup = szero nrmi = szero - select type (aa=> a%a) + select type (aa) type is (psb_c_csr_sparse_mat) ! ! Take a fast shortcut if the matrix is stored in CSR format diff --git a/prec/impl/psb_d_ilu0_fact.f90 b/prec/impl/psb_d_ilu0_fact.f90 index dde22249..d4bb02f0 100644 --- a/prec/impl/psb_d_ilu0_fact.f90 +++ b/prec/impl/psb_d_ilu0_fact.f90 @@ -139,7 +139,7 @@ subroutine psb_dilu0_fact(ialg,a,l,u,d,info,blck, upd,shft) ! Arguments integer(psb_ipk_), intent(in) :: ialg - type(psb_dspmat_type),intent(in) :: a + type(psb_dspmat_type),intent(inout) :: a type(psb_dspmat_type),intent(inout) :: l,u real(psb_dpk_), intent(inout) :: d(:) integer(psb_ipk_), intent(out) :: info @@ -150,7 +150,7 @@ subroutine psb_dilu0_fact(ialg,a,l,u,d,info,blck, upd,shft) ! Local variables integer(psb_ipk_) :: l1, l2, m, err_act type(psb_dspmat_type), pointer :: blck_ - type(psb_d_csr_sparse_mat) :: ll, uu + type(psb_d_csr_sparse_mat) :: ll, uu, aa, bb real(psb_dpk_) :: shft_ character :: upd_ character(len=20) :: name, ch_err @@ -196,10 +196,12 @@ subroutine psb_dilu0_fact(ialg,a,l,u,d,info,blck, upd,shft) call l%mv_to(ll) call u%mv_to(uu) + call a%cp_to(aa) + call blck_%cp_to(bb) ! ! Compute the ILU(0) or the MILU(0) factorization, depending on ialg ! - call psb_dilu0_factint(ialg,a,blck_,& + call psb_dilu0_factint(ialg,aa,bb,& & d,ll%val,ll%ja,ll%irp,uu%val,uu%ja,uu%irp,l1,l2,upd_,shft_,info) if(info.ne.0) then info=psb_err_from_subroutine_ @@ -327,7 +329,7 @@ contains ! Arguments integer(psb_ipk_), intent(in) :: ialg - type(psb_dspmat_type),intent(in) :: a,b + class(psb_d_base_sparse_mat),intent(inout) :: a,b integer(psb_ipk_),intent(inout) :: l1,l2,info integer(psb_ipk_), intent(inout) :: lja(:),lirp(:),uja(:),uirp(:) real(psb_dpk_), intent(inout) :: lval(:),uval(:),d(:) @@ -590,7 +592,7 @@ contains ! until we empty the buffer. Thus we will make a call to psb_sp_getblk ! every nrb calls to copyin. If A is in CSR format it is unused. ! - subroutine ilu_copyin(i,m,a,jd,jmin,jmax,l1,lja,lval,& + subroutine ilu_copyin(i,m,aa,jd,jmin,jmax,l1,lja,lval,& & dia,l2,uja,uval,ktrw,trw,upd,shft) use psb_base_mod @@ -598,7 +600,7 @@ contains implicit none ! Arguments - type(psb_dspmat_type), intent(in) :: a + class(psb_d_base_sparse_mat),intent(inout) :: aa type(psb_d_coo_sparse_mat), intent(inout) :: trw integer(psb_ipk_), intent(in) :: i,m,jd,jmin,jmax integer(psb_ipk_), intent(inout) :: ktrw,l1,l2 @@ -619,7 +621,7 @@ contains end if if (psb_toupper(upd) == 'F') then - select type(aa => a%a) + select type(aa) type is (psb_d_csr_sparse_mat) ! diff --git a/prec/impl/psb_d_iluk_fact.f90 b/prec/impl/psb_d_iluk_fact.f90 index dc837ba9..6089db7c 100644 --- a/prec/impl/psb_d_iluk_fact.f90 +++ b/prec/impl/psb_d_iluk_fact.f90 @@ -137,7 +137,7 @@ subroutine psb_diluk_fact(fill_in,ialg,a,l,u,d,info,blck,shft) ! Arguments integer(psb_ipk_), intent(in) :: fill_in, ialg integer(psb_ipk_), intent(out) :: info - type(psb_dspmat_type),intent(in) :: a + type(psb_dspmat_type),intent(inout) :: a type(psb_dspmat_type),intent(inout) :: l,u type(psb_dspmat_type),intent(in), optional, target :: blck real(psb_dpk_), intent(inout) :: d(:) @@ -147,7 +147,7 @@ subroutine psb_diluk_fact(fill_in,ialg,a,l,u,d,info,blck,shft) real(psb_dpk_) :: shft_ type(psb_dspmat_type), pointer :: blck_ - type(psb_d_csr_sparse_mat) :: ll, uu + type(psb_d_csr_sparse_mat) :: ll, uu, aa, bb character(len=20) :: name, ch_err name='psb_diluk_fact' @@ -186,11 +186,12 @@ subroutine psb_diluk_fact(fill_in,ialg,a,l,u,d,info,blck,shft) call l%mv_to(ll) call u%mv_to(uu) - + call a%cp_to(aa) + call blck_%cp_to(bb) ! ! Compute the ILU(k) or the MILU(k) factorization, depending on ialg ! - call psb_diluk_factint(fill_in,ialg,a,blck_,& + call psb_diluk_factint(fill_in,ialg,aa,bb,& & d,ll%val,ll%ja,ll%irp,uu%val,uu%ja,uu%irp,l1,l2,info,shft_) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -210,7 +211,8 @@ subroutine psb_diluk_fact(fill_in,ialg,a,l,u,d,info,blck,shft) call u%set_triangle() call u%set_unit() call u%set_upper() - + write(0,*) 'In iluk__fact:',& + & l%is_triangle(),l%is_lower(),u%is_triangle(),u%is_upper() ! ! Nullify pointer / deallocate memory ! @@ -313,7 +315,7 @@ contains ! Arguments integer(psb_ipk_), intent(in) :: fill_in, ialg - type(psb_dspmat_type),intent(in) :: a,b + class(psb_d_base_sparse_mat),intent(inout) :: a,b integer(psb_ipk_),intent(inout) :: l1,l2,info integer(psb_ipk_), allocatable, intent(inout) :: lja(:),lirp(:),uja(:),uirp(:) real(psb_dpk_), allocatable, intent(inout) :: lval(:),uval(:) @@ -524,14 +526,14 @@ contains ! until we empty the buffer. Thus we will make a call to psb_sp_getblk ! every nrb calls to copyin. If A is in CSR format it is unused. ! - subroutine iluk_copyin(i,m,a,jmin,jmax,row,rowlevs,heap,ktrw,trw,info,shft) + subroutine iluk_copyin(i,m,aa,jmin,jmax,row,rowlevs,heap,ktrw,trw,info,shft) use psb_base_mod implicit none ! Arguments - type(psb_dspmat_type), intent(in) :: a + class(psb_d_base_sparse_mat),intent(inout) :: aa type(psb_d_coo_sparse_mat), intent(inout) :: trw integer(psb_ipk_), intent(in) :: i,m,jmin,jmax integer(psb_ipk_), intent(inout) :: ktrw,info @@ -554,7 +556,7 @@ contains end if call heap%init(info) - select type (aa=> a%a) + select type (aa) type is (psb_d_csr_sparse_mat) ! ! Take a fast shortcut if the matrix is stored in CSR format diff --git a/prec/impl/psb_d_ilut_fact.f90 b/prec/impl/psb_d_ilut_fact.f90 index cd185e80..a2d2a4d0 100644 --- a/prec/impl/psb_d_ilut_fact.f90 +++ b/prec/impl/psb_d_ilut_fact.f90 @@ -134,7 +134,7 @@ subroutine psb_dilut_fact(fill_in,thres,a,l,u,d,info,blck,iscale,shft) integer(psb_ipk_), intent(in) :: fill_in real(psb_dpk_), intent(in) :: thres integer(psb_ipk_), intent(out) :: info - type(psb_dspmat_type),intent(in) :: a + type(psb_dspmat_type),intent(inout) :: a type(psb_dspmat_type),intent(inout) :: l,u real(psb_dpk_), intent(inout) :: d(:) type(psb_dspmat_type),intent(in), optional, target :: blck @@ -145,7 +145,7 @@ subroutine psb_dilut_fact(fill_in,thres,a,l,u,d,info,blck,iscale,shft) real(psb_dpk_) :: shft_ type(psb_dspmat_type), pointer :: blck_ - type(psb_d_csr_sparse_mat) :: ll, uu + type(psb_d_csr_sparse_mat) :: ll, uu, aa, bb real(psb_dpk_) :: scale character(len=20) :: name, ch_err @@ -208,11 +208,12 @@ subroutine psb_dilut_fact(fill_in,thres,a,l,u,d,info,blck,iscale,shft) call l%mv_to(ll) call u%mv_to(uu) - + call a%cp_to(aa) + call blck_%cp_to(bb) ! ! Compute the ILU(k,t) factorization ! - call psb_dilut_factint(fill_in,thres,a,blck_,& + call psb_dilut_factint(fill_in,thres,aa,bb,& & d,ll%val,ll%ja,ll%irp,uu%val,uu%ja,uu%irp,l1,l2,info,scale,shft_) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -332,7 +333,7 @@ contains ! Arguments integer(psb_ipk_), intent(in) :: fill_in real(psb_dpk_), intent(in) :: thres - type(psb_dspmat_type),intent(in) :: a,b + class(psb_d_base_sparse_mat),intent(inout) :: a,b integer(psb_ipk_),intent(inout) :: l1,l2,info integer(psb_ipk_), allocatable, intent(inout) :: lja(:),lirp(:),uja(:),uirp(:) real(psb_dpk_), allocatable, intent(inout) :: lval(:),uval(:) @@ -547,11 +548,11 @@ contains ! until we empty the buffer. Thus we will make a call to psb_sp_getblk ! every nrb calls to copyin. If A is in CSR format it is unused. ! - subroutine ilut_copyin(i,m,a,jd,jmin,jmax,nlw,nup,jmaxup,& + subroutine ilut_copyin(i,m,aa,jd,jmin,jmax,nlw,nup,jmaxup,& & nrmi,weight,row,heap,ktrw,trw,info,shft) use psb_base_mod implicit none - type(psb_dspmat_type), intent(in) :: a + class(psb_d_base_sparse_mat),intent(inout) :: aa type(psb_d_coo_sparse_mat), intent(inout) :: trw integer(psb_ipk_), intent(in) :: i, m,jmin,jmax,jd integer(psb_ipk_), intent(inout) :: ktrw,nlw,nup,jmaxup,info @@ -593,7 +594,7 @@ contains dmaxup = szero nrmi = szero - select type (aa=> a%a) + select type (aa) type is (psb_d_csr_sparse_mat) ! ! Take a fast shortcut if the matrix is stored in CSR format diff --git a/prec/impl/psb_s_ilu0_fact.f90 b/prec/impl/psb_s_ilu0_fact.f90 index d9ce1298..f18e0d7b 100644 --- a/prec/impl/psb_s_ilu0_fact.f90 +++ b/prec/impl/psb_s_ilu0_fact.f90 @@ -139,7 +139,7 @@ subroutine psb_silu0_fact(ialg,a,l,u,d,info,blck, upd,shft) ! Arguments integer(psb_ipk_), intent(in) :: ialg - type(psb_sspmat_type),intent(in) :: a + type(psb_sspmat_type),intent(inout) :: a type(psb_sspmat_type),intent(inout) :: l,u real(psb_spk_), intent(inout) :: d(:) integer(psb_ipk_), intent(out) :: info @@ -150,7 +150,7 @@ subroutine psb_silu0_fact(ialg,a,l,u,d,info,blck, upd,shft) ! Local variables integer(psb_ipk_) :: l1, l2, m, err_act type(psb_sspmat_type), pointer :: blck_ - type(psb_s_csr_sparse_mat) :: ll, uu + type(psb_s_csr_sparse_mat) :: ll, uu, aa, bb real(psb_spk_) :: shft_ character :: upd_ character(len=20) :: name, ch_err @@ -196,10 +196,12 @@ subroutine psb_silu0_fact(ialg,a,l,u,d,info,blck, upd,shft) call l%mv_to(ll) call u%mv_to(uu) + call a%cp_to(aa) + call blck_%cp_to(bb) ! ! Compute the ILU(0) or the MILU(0) factorization, depending on ialg ! - call psb_silu0_factint(ialg,a,blck_,& + call psb_silu0_factint(ialg,aa,bb,& & d,ll%val,ll%ja,ll%irp,uu%val,uu%ja,uu%irp,l1,l2,upd_,shft_,info) if(info.ne.0) then info=psb_err_from_subroutine_ @@ -327,7 +329,7 @@ contains ! Arguments integer(psb_ipk_), intent(in) :: ialg - type(psb_sspmat_type),intent(in) :: a,b + class(psb_s_base_sparse_mat),intent(inout) :: a,b integer(psb_ipk_),intent(inout) :: l1,l2,info integer(psb_ipk_), intent(inout) :: lja(:),lirp(:),uja(:),uirp(:) real(psb_spk_), intent(inout) :: lval(:),uval(:),d(:) @@ -590,7 +592,7 @@ contains ! until we empty the buffer. Thus we will make a call to psb_sp_getblk ! every nrb calls to copyin. If A is in CSR format it is unused. ! - subroutine ilu_copyin(i,m,a,jd,jmin,jmax,l1,lja,lval,& + subroutine ilu_copyin(i,m,aa,jd,jmin,jmax,l1,lja,lval,& & dia,l2,uja,uval,ktrw,trw,upd,shft) use psb_base_mod @@ -598,7 +600,7 @@ contains implicit none ! Arguments - type(psb_sspmat_type), intent(in) :: a + class(psb_s_base_sparse_mat),intent(inout) :: aa type(psb_s_coo_sparse_mat), intent(inout) :: trw integer(psb_ipk_), intent(in) :: i,m,jd,jmin,jmax integer(psb_ipk_), intent(inout) :: ktrw,l1,l2 @@ -619,7 +621,7 @@ contains end if if (psb_toupper(upd) == 'F') then - select type(aa => a%a) + select type(aa) type is (psb_s_csr_sparse_mat) ! diff --git a/prec/impl/psb_s_iluk_fact.f90 b/prec/impl/psb_s_iluk_fact.f90 index 67fb8ada..793e4247 100644 --- a/prec/impl/psb_s_iluk_fact.f90 +++ b/prec/impl/psb_s_iluk_fact.f90 @@ -137,7 +137,7 @@ subroutine psb_siluk_fact(fill_in,ialg,a,l,u,d,info,blck,shft) ! Arguments integer(psb_ipk_), intent(in) :: fill_in, ialg integer(psb_ipk_), intent(out) :: info - type(psb_sspmat_type),intent(in) :: a + type(psb_sspmat_type),intent(inout) :: a type(psb_sspmat_type),intent(inout) :: l,u type(psb_sspmat_type),intent(in), optional, target :: blck real(psb_spk_), intent(inout) :: d(:) @@ -147,7 +147,7 @@ subroutine psb_siluk_fact(fill_in,ialg,a,l,u,d,info,blck,shft) real(psb_spk_) :: shft_ type(psb_sspmat_type), pointer :: blck_ - type(psb_s_csr_sparse_mat) :: ll, uu + type(psb_s_csr_sparse_mat) :: ll, uu, aa, bb character(len=20) :: name, ch_err name='psb_siluk_fact' @@ -186,11 +186,12 @@ subroutine psb_siluk_fact(fill_in,ialg,a,l,u,d,info,blck,shft) call l%mv_to(ll) call u%mv_to(uu) - + call a%cp_to(aa) + call blck_%cp_to(bb) ! ! Compute the ILU(k) or the MILU(k) factorization, depending on ialg ! - call psb_siluk_factint(fill_in,ialg,a,blck_,& + call psb_siluk_factint(fill_in,ialg,aa,bb,& & d,ll%val,ll%ja,ll%irp,uu%val,uu%ja,uu%irp,l1,l2,info,shft_) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -313,7 +314,7 @@ contains ! Arguments integer(psb_ipk_), intent(in) :: fill_in, ialg - type(psb_sspmat_type),intent(in) :: a,b + class(psb_s_base_sparse_mat),intent(inout) :: a,b integer(psb_ipk_),intent(inout) :: l1,l2,info integer(psb_ipk_), allocatable, intent(inout) :: lja(:),lirp(:),uja(:),uirp(:) real(psb_spk_), allocatable, intent(inout) :: lval(:),uval(:) @@ -524,14 +525,14 @@ contains ! until we empty the buffer. Thus we will make a call to psb_sp_getblk ! every nrb calls to copyin. If A is in CSR format it is unused. ! - subroutine iluk_copyin(i,m,a,jmin,jmax,row,rowlevs,heap,ktrw,trw,info,shft) + subroutine iluk_copyin(i,m,aa,jmin,jmax,row,rowlevs,heap,ktrw,trw,info,shft) use psb_base_mod implicit none ! Arguments - type(psb_sspmat_type), intent(in) :: a + class(psb_s_base_sparse_mat),intent(inout) :: aa type(psb_s_coo_sparse_mat), intent(inout) :: trw integer(psb_ipk_), intent(in) :: i,m,jmin,jmax integer(psb_ipk_), intent(inout) :: ktrw,info @@ -554,7 +555,7 @@ contains end if call heap%init(info) - select type (aa=> a%a) + select type (aa) type is (psb_s_csr_sparse_mat) ! ! Take a fast shortcut if the matrix is stored in CSR format diff --git a/prec/impl/psb_s_ilut_fact.f90 b/prec/impl/psb_s_ilut_fact.f90 index 3d111103..2066e35c 100644 --- a/prec/impl/psb_s_ilut_fact.f90 +++ b/prec/impl/psb_s_ilut_fact.f90 @@ -134,7 +134,7 @@ subroutine psb_silut_fact(fill_in,thres,a,l,u,d,info,blck,iscale,shft) integer(psb_ipk_), intent(in) :: fill_in real(psb_spk_), intent(in) :: thres integer(psb_ipk_), intent(out) :: info - type(psb_sspmat_type),intent(in) :: a + type(psb_sspmat_type),intent(inout) :: a type(psb_sspmat_type),intent(inout) :: l,u real(psb_spk_), intent(inout) :: d(:) type(psb_sspmat_type),intent(in), optional, target :: blck @@ -145,7 +145,7 @@ subroutine psb_silut_fact(fill_in,thres,a,l,u,d,info,blck,iscale,shft) real(psb_spk_) :: shft_ type(psb_sspmat_type), pointer :: blck_ - type(psb_s_csr_sparse_mat) :: ll, uu + type(psb_s_csr_sparse_mat) :: ll, uu, aa, bb real(psb_spk_) :: scale character(len=20) :: name, ch_err @@ -208,11 +208,12 @@ subroutine psb_silut_fact(fill_in,thres,a,l,u,d,info,blck,iscale,shft) call l%mv_to(ll) call u%mv_to(uu) - + call a%cp_to(aa) + call blck_%cp_to(bb) ! ! Compute the ILU(k,t) factorization ! - call psb_silut_factint(fill_in,thres,a,blck_,& + call psb_silut_factint(fill_in,thres,aa,bb,& & d,ll%val,ll%ja,ll%irp,uu%val,uu%ja,uu%irp,l1,l2,info,scale,shft_) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -332,7 +333,7 @@ contains ! Arguments integer(psb_ipk_), intent(in) :: fill_in real(psb_spk_), intent(in) :: thres - type(psb_sspmat_type),intent(in) :: a,b + class(psb_s_base_sparse_mat),intent(inout) :: a,b integer(psb_ipk_),intent(inout) :: l1,l2,info integer(psb_ipk_), allocatable, intent(inout) :: lja(:),lirp(:),uja(:),uirp(:) real(psb_spk_), allocatable, intent(inout) :: lval(:),uval(:) @@ -547,11 +548,11 @@ contains ! until we empty the buffer. Thus we will make a call to psb_sp_getblk ! every nrb calls to copyin. If A is in CSR format it is unused. ! - subroutine ilut_copyin(i,m,a,jd,jmin,jmax,nlw,nup,jmaxup,& + subroutine ilut_copyin(i,m,aa,jd,jmin,jmax,nlw,nup,jmaxup,& & nrmi,weight,row,heap,ktrw,trw,info,shft) use psb_base_mod implicit none - type(psb_sspmat_type), intent(in) :: a + class(psb_s_base_sparse_mat),intent(inout) :: aa type(psb_s_coo_sparse_mat), intent(inout) :: trw integer(psb_ipk_), intent(in) :: i, m,jmin,jmax,jd integer(psb_ipk_), intent(inout) :: ktrw,nlw,nup,jmaxup,info @@ -593,7 +594,7 @@ contains dmaxup = szero nrmi = szero - select type (aa=> a%a) + select type (aa) type is (psb_s_csr_sparse_mat) ! ! Take a fast shortcut if the matrix is stored in CSR format diff --git a/prec/impl/psb_z_ilu0_fact.f90 b/prec/impl/psb_z_ilu0_fact.f90 index 997a5e05..c4f7a8ae 100644 --- a/prec/impl/psb_z_ilu0_fact.f90 +++ b/prec/impl/psb_z_ilu0_fact.f90 @@ -139,7 +139,7 @@ subroutine psb_zilu0_fact(ialg,a,l,u,d,info,blck, upd,shft) ! Arguments integer(psb_ipk_), intent(in) :: ialg - type(psb_zspmat_type),intent(in) :: a + type(psb_zspmat_type),intent(inout) :: a type(psb_zspmat_type),intent(inout) :: l,u complex(psb_dpk_), intent(inout) :: d(:) integer(psb_ipk_), intent(out) :: info @@ -150,7 +150,7 @@ subroutine psb_zilu0_fact(ialg,a,l,u,d,info,blck, upd,shft) ! Local variables integer(psb_ipk_) :: l1, l2, m, err_act type(psb_zspmat_type), pointer :: blck_ - type(psb_z_csr_sparse_mat) :: ll, uu + type(psb_z_csr_sparse_mat) :: ll, uu, aa, bb complex(psb_dpk_) :: shft_ character :: upd_ character(len=20) :: name, ch_err @@ -196,10 +196,12 @@ subroutine psb_zilu0_fact(ialg,a,l,u,d,info,blck, upd,shft) call l%mv_to(ll) call u%mv_to(uu) + call a%cp_to(aa) + call blck_%cp_to(bb) ! ! Compute the ILU(0) or the MILU(0) factorization, depending on ialg ! - call psb_zilu0_factint(ialg,a,blck_,& + call psb_zilu0_factint(ialg,aa,bb,& & d,ll%val,ll%ja,ll%irp,uu%val,uu%ja,uu%irp,l1,l2,upd_,shft_,info) if(info.ne.0) then info=psb_err_from_subroutine_ @@ -327,7 +329,7 @@ contains ! Arguments integer(psb_ipk_), intent(in) :: ialg - type(psb_zspmat_type),intent(in) :: a,b + class(psb_z_base_sparse_mat),intent(inout) :: a,b integer(psb_ipk_),intent(inout) :: l1,l2,info integer(psb_ipk_), intent(inout) :: lja(:),lirp(:),uja(:),uirp(:) complex(psb_dpk_), intent(inout) :: lval(:),uval(:),d(:) @@ -590,7 +592,7 @@ contains ! until we empty the buffer. Thus we will make a call to psb_sp_getblk ! every nrb calls to copyin. If A is in CSR format it is unused. ! - subroutine ilu_copyin(i,m,a,jd,jmin,jmax,l1,lja,lval,& + subroutine ilu_copyin(i,m,aa,jd,jmin,jmax,l1,lja,lval,& & dia,l2,uja,uval,ktrw,trw,upd,shft) use psb_base_mod @@ -598,7 +600,7 @@ contains implicit none ! Arguments - type(psb_zspmat_type), intent(in) :: a + class(psb_z_base_sparse_mat),intent(inout) :: aa type(psb_z_coo_sparse_mat), intent(inout) :: trw integer(psb_ipk_), intent(in) :: i,m,jd,jmin,jmax integer(psb_ipk_), intent(inout) :: ktrw,l1,l2 @@ -619,7 +621,7 @@ contains end if if (psb_toupper(upd) == 'F') then - select type(aa => a%a) + select type(aa) type is (psb_z_csr_sparse_mat) ! diff --git a/prec/impl/psb_z_iluk_fact.f90 b/prec/impl/psb_z_iluk_fact.f90 index a5540880..e0d844ed 100644 --- a/prec/impl/psb_z_iluk_fact.f90 +++ b/prec/impl/psb_z_iluk_fact.f90 @@ -137,7 +137,7 @@ subroutine psb_ziluk_fact(fill_in,ialg,a,l,u,d,info,blck,shft) ! Arguments integer(psb_ipk_), intent(in) :: fill_in, ialg integer(psb_ipk_), intent(out) :: info - type(psb_zspmat_type),intent(in) :: a + type(psb_zspmat_type),intent(inout) :: a type(psb_zspmat_type),intent(inout) :: l,u type(psb_zspmat_type),intent(in), optional, target :: blck complex(psb_dpk_), intent(inout) :: d(:) @@ -147,7 +147,7 @@ subroutine psb_ziluk_fact(fill_in,ialg,a,l,u,d,info,blck,shft) complex(psb_dpk_) :: shft_ type(psb_zspmat_type), pointer :: blck_ - type(psb_z_csr_sparse_mat) :: ll, uu + type(psb_z_csr_sparse_mat) :: ll, uu, aa, bb character(len=20) :: name, ch_err name='psb_ziluk_fact' @@ -186,11 +186,12 @@ subroutine psb_ziluk_fact(fill_in,ialg,a,l,u,d,info,blck,shft) call l%mv_to(ll) call u%mv_to(uu) - + call a%cp_to(aa) + call blck_%cp_to(bb) ! ! Compute the ILU(k) or the MILU(k) factorization, depending on ialg ! - call psb_ziluk_factint(fill_in,ialg,a,blck_,& + call psb_ziluk_factint(fill_in,ialg,aa,bb,& & d,ll%val,ll%ja,ll%irp,uu%val,uu%ja,uu%irp,l1,l2,info,shft_) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -313,7 +314,7 @@ contains ! Arguments integer(psb_ipk_), intent(in) :: fill_in, ialg - type(psb_zspmat_type),intent(in) :: a,b + class(psb_z_base_sparse_mat),intent(inout) :: a,b integer(psb_ipk_),intent(inout) :: l1,l2,info integer(psb_ipk_), allocatable, intent(inout) :: lja(:),lirp(:),uja(:),uirp(:) complex(psb_dpk_), allocatable, intent(inout) :: lval(:),uval(:) @@ -524,14 +525,14 @@ contains ! until we empty the buffer. Thus we will make a call to psb_sp_getblk ! every nrb calls to copyin. If A is in CSR format it is unused. ! - subroutine iluk_copyin(i,m,a,jmin,jmax,row,rowlevs,heap,ktrw,trw,info,shft) + subroutine iluk_copyin(i,m,aa,jmin,jmax,row,rowlevs,heap,ktrw,trw,info,shft) use psb_base_mod implicit none ! Arguments - type(psb_zspmat_type), intent(in) :: a + class(psb_z_base_sparse_mat),intent(inout) :: aa type(psb_z_coo_sparse_mat), intent(inout) :: trw integer(psb_ipk_), intent(in) :: i,m,jmin,jmax integer(psb_ipk_), intent(inout) :: ktrw,info @@ -554,7 +555,7 @@ contains end if call heap%init(info) - select type (aa=> a%a) + select type (aa) type is (psb_z_csr_sparse_mat) ! ! Take a fast shortcut if the matrix is stored in CSR format diff --git a/prec/impl/psb_z_ilut_fact.f90 b/prec/impl/psb_z_ilut_fact.f90 index 0c278515..80edb4e4 100644 --- a/prec/impl/psb_z_ilut_fact.f90 +++ b/prec/impl/psb_z_ilut_fact.f90 @@ -134,7 +134,7 @@ subroutine psb_zilut_fact(fill_in,thres,a,l,u,d,info,blck,iscale,shft) integer(psb_ipk_), intent(in) :: fill_in real(psb_dpk_), intent(in) :: thres integer(psb_ipk_), intent(out) :: info - type(psb_zspmat_type),intent(in) :: a + type(psb_zspmat_type),intent(inout) :: a type(psb_zspmat_type),intent(inout) :: l,u complex(psb_dpk_), intent(inout) :: d(:) type(psb_zspmat_type),intent(in), optional, target :: blck @@ -145,7 +145,7 @@ subroutine psb_zilut_fact(fill_in,thres,a,l,u,d,info,blck,iscale,shft) complex(psb_dpk_) :: shft_ type(psb_zspmat_type), pointer :: blck_ - type(psb_z_csr_sparse_mat) :: ll, uu + type(psb_z_csr_sparse_mat) :: ll, uu, aa, bb real(psb_dpk_) :: scale character(len=20) :: name, ch_err @@ -208,11 +208,12 @@ subroutine psb_zilut_fact(fill_in,thres,a,l,u,d,info,blck,iscale,shft) call l%mv_to(ll) call u%mv_to(uu) - + call a%cp_to(aa) + call blck_%cp_to(bb) ! ! Compute the ILU(k,t) factorization ! - call psb_zilut_factint(fill_in,thres,a,blck_,& + call psb_zilut_factint(fill_in,thres,aa,bb,& & d,ll%val,ll%ja,ll%irp,uu%val,uu%ja,uu%irp,l1,l2,info,scale,shft_) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -332,7 +333,7 @@ contains ! Arguments integer(psb_ipk_), intent(in) :: fill_in real(psb_dpk_), intent(in) :: thres - type(psb_zspmat_type),intent(in) :: a,b + class(psb_z_base_sparse_mat),intent(inout) :: a,b integer(psb_ipk_),intent(inout) :: l1,l2,info integer(psb_ipk_), allocatable, intent(inout) :: lja(:),lirp(:),uja(:),uirp(:) complex(psb_dpk_), allocatable, intent(inout) :: lval(:),uval(:) @@ -547,11 +548,11 @@ contains ! until we empty the buffer. Thus we will make a call to psb_sp_getblk ! every nrb calls to copyin. If A is in CSR format it is unused. ! - subroutine ilut_copyin(i,m,a,jd,jmin,jmax,nlw,nup,jmaxup,& + subroutine ilut_copyin(i,m,aa,jd,jmin,jmax,nlw,nup,jmaxup,& & nrmi,weight,row,heap,ktrw,trw,info,shft) use psb_base_mod implicit none - type(psb_zspmat_type), intent(in) :: a + class(psb_z_base_sparse_mat),intent(inout) :: aa type(psb_z_coo_sparse_mat), intent(inout) :: trw integer(psb_ipk_), intent(in) :: i, m,jmin,jmax,jd integer(psb_ipk_), intent(inout) :: ktrw,nlw,nup,jmaxup,info @@ -593,7 +594,7 @@ contains dmaxup = szero nrmi = szero - select type (aa=> a%a) + select type (aa) type is (psb_z_csr_sparse_mat) ! ! Take a fast shortcut if the matrix is stored in CSR format diff --git a/prec/psb_c_ilu_fact_mod.f90 b/prec/psb_c_ilu_fact_mod.f90 index 0fae1fc5..dcaa4b4a 100644 --- a/prec/psb_c_ilu_fact_mod.f90 +++ b/prec/psb_c_ilu_fact_mod.f90 @@ -84,7 +84,7 @@ module psb_c_ilu_fact_mod import psb_cspmat_type, psb_spk_, psb_ipk_ integer(psb_ipk_), intent(in) :: ialg integer(psb_ipk_), intent(out) :: info - type(psb_cspmat_type),intent(in) :: a + type(psb_cspmat_type),intent(inout) :: a type(psb_cspmat_type),intent(inout) :: l,u type(psb_cspmat_type),intent(in), optional, target :: blck character, intent(in), optional :: upd @@ -98,7 +98,7 @@ module psb_c_ilu_fact_mod import psb_cspmat_type, psb_spk_, psb_ipk_ integer(psb_ipk_), intent(in) :: fill_in,ialg integer(psb_ipk_), intent(out) :: info - type(psb_cspmat_type),intent(in) :: a + type(psb_cspmat_type),intent(inout) :: a type(psb_cspmat_type),intent(inout) :: l,u type(psb_cspmat_type),intent(in), optional, target :: blck complex(psb_spk_), intent(inout) :: d(:) @@ -112,7 +112,7 @@ module psb_c_ilu_fact_mod integer(psb_ipk_), intent(in) :: fill_in real(psb_spk_), intent(in) :: thres integer(psb_ipk_), intent(out) :: info - type(psb_cspmat_type),intent(in) :: a + type(psb_cspmat_type),intent(inout) :: a type(psb_cspmat_type),intent(inout) :: l,u complex(psb_spk_), intent(inout) :: d(:) type(psb_cspmat_type),intent(in), optional, target :: blck diff --git a/prec/psb_d_ilu_fact_mod.f90 b/prec/psb_d_ilu_fact_mod.f90 index 6354573d..934cf784 100644 --- a/prec/psb_d_ilu_fact_mod.f90 +++ b/prec/psb_d_ilu_fact_mod.f90 @@ -84,7 +84,7 @@ module psb_d_ilu_fact_mod import psb_dspmat_type, psb_dpk_, psb_ipk_ integer(psb_ipk_), intent(in) :: ialg integer(psb_ipk_), intent(out) :: info - type(psb_dspmat_type),intent(in) :: a + type(psb_dspmat_type),intent(inout) :: a type(psb_dspmat_type),intent(inout) :: l,u type(psb_dspmat_type),intent(in), optional, target :: blck character, intent(in), optional :: upd @@ -98,7 +98,7 @@ module psb_d_ilu_fact_mod import psb_dspmat_type, psb_dpk_, psb_ipk_ integer(psb_ipk_), intent(in) :: fill_in,ialg integer(psb_ipk_), intent(out) :: info - type(psb_dspmat_type),intent(in) :: a + type(psb_dspmat_type),intent(inout) :: a type(psb_dspmat_type),intent(inout) :: l,u type(psb_dspmat_type),intent(in), optional, target :: blck real(psb_dpk_), intent(inout) :: d(:) @@ -112,7 +112,7 @@ module psb_d_ilu_fact_mod integer(psb_ipk_), intent(in) :: fill_in real(psb_dpk_), intent(in) :: thres integer(psb_ipk_), intent(out) :: info - type(psb_dspmat_type),intent(in) :: a + type(psb_dspmat_type),intent(inout) :: a type(psb_dspmat_type),intent(inout) :: l,u real(psb_dpk_), intent(inout) :: d(:) type(psb_dspmat_type),intent(in), optional, target :: blck diff --git a/prec/psb_s_ilu_fact_mod.f90 b/prec/psb_s_ilu_fact_mod.f90 index 4021adc9..d1b558e6 100644 --- a/prec/psb_s_ilu_fact_mod.f90 +++ b/prec/psb_s_ilu_fact_mod.f90 @@ -84,7 +84,7 @@ module psb_s_ilu_fact_mod import psb_sspmat_type, psb_spk_, psb_ipk_ integer(psb_ipk_), intent(in) :: ialg integer(psb_ipk_), intent(out) :: info - type(psb_sspmat_type),intent(in) :: a + type(psb_sspmat_type),intent(inout) :: a type(psb_sspmat_type),intent(inout) :: l,u type(psb_sspmat_type),intent(in), optional, target :: blck character, intent(in), optional :: upd @@ -98,7 +98,7 @@ module psb_s_ilu_fact_mod import psb_sspmat_type, psb_spk_, psb_ipk_ integer(psb_ipk_), intent(in) :: fill_in,ialg integer(psb_ipk_), intent(out) :: info - type(psb_sspmat_type),intent(in) :: a + type(psb_sspmat_type),intent(inout) :: a type(psb_sspmat_type),intent(inout) :: l,u type(psb_sspmat_type),intent(in), optional, target :: blck real(psb_spk_), intent(inout) :: d(:) @@ -112,7 +112,7 @@ module psb_s_ilu_fact_mod integer(psb_ipk_), intent(in) :: fill_in real(psb_spk_), intent(in) :: thres integer(psb_ipk_), intent(out) :: info - type(psb_sspmat_type),intent(in) :: a + type(psb_sspmat_type),intent(inout) :: a type(psb_sspmat_type),intent(inout) :: l,u real(psb_spk_), intent(inout) :: d(:) type(psb_sspmat_type),intent(in), optional, target :: blck diff --git a/prec/psb_z_ilu_fact_mod.f90 b/prec/psb_z_ilu_fact_mod.f90 index 4793b43b..394c24d7 100644 --- a/prec/psb_z_ilu_fact_mod.f90 +++ b/prec/psb_z_ilu_fact_mod.f90 @@ -84,7 +84,7 @@ module psb_z_ilu_fact_mod import psb_zspmat_type, psb_dpk_, psb_ipk_ integer(psb_ipk_), intent(in) :: ialg integer(psb_ipk_), intent(out) :: info - type(psb_zspmat_type),intent(in) :: a + type(psb_zspmat_type),intent(inout) :: a type(psb_zspmat_type),intent(inout) :: l,u type(psb_zspmat_type),intent(in), optional, target :: blck character, intent(in), optional :: upd @@ -98,7 +98,7 @@ module psb_z_ilu_fact_mod import psb_zspmat_type, psb_dpk_, psb_ipk_ integer(psb_ipk_), intent(in) :: fill_in,ialg integer(psb_ipk_), intent(out) :: info - type(psb_zspmat_type),intent(in) :: a + type(psb_zspmat_type),intent(inout) :: a type(psb_zspmat_type),intent(inout) :: l,u type(psb_zspmat_type),intent(in), optional, target :: blck complex(psb_dpk_), intent(inout) :: d(:) @@ -112,7 +112,7 @@ module psb_z_ilu_fact_mod integer(psb_ipk_), intent(in) :: fill_in real(psb_dpk_), intent(in) :: thres integer(psb_ipk_), intent(out) :: info - type(psb_zspmat_type),intent(in) :: a + type(psb_zspmat_type),intent(inout) :: a type(psb_zspmat_type),intent(inout) :: l,u complex(psb_dpk_), intent(inout) :: d(:) type(psb_zspmat_type),intent(in), optional, target :: blck