diff --git a/base/serial/impl/psb_c_coo_impl.f90 b/base/serial/impl/psb_c_coo_impl.f90 index cc8a78f0..f0f89286 100644 --- a/base/serial/impl/psb_c_coo_impl.f90 +++ b/base/serial/impl/psb_c_coo_impl.f90 @@ -2124,7 +2124,7 @@ contains logical, intent(in) :: append integer(psb_ipk_) :: info integer(psb_ipk_), optional :: iren(:) - integer(psb_ipk_) :: nzin_, nza, idx,ip,jp,i,k, nzt, irw, lrw + integer(psb_ipk_) :: nzin_, nza, idx,ip,jp,i,k, nzt, irw, lrw,nrd integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name='coo_getptn' @@ -2234,7 +2234,8 @@ contains if (debug_level >= psb_debug_serial_) & & write(debug_unit,*) trim(name),': unsorted ' - nzt = (nza*(lrw-irw+1))/max(a%get_nrows(),1) + nrd = max(a%get_nrows(),1) + nzt = ((nza+nrd-1)/nrd)*(lrw-irw+1) call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info /= psb_success_) return @@ -2246,7 +2247,7 @@ contains & (jmin <= a%ja(i)).and.(a%ja(i)<=jmax)) then k = k + 1 if (k > nzt) then - nzt = k + nzt = k + nzt call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info /= psb_success_) return @@ -2262,7 +2263,7 @@ contains & (jmin <= a%ja(i)).and.(a%ja(i)<=jmax)) then k = k + 1 if (k > nzt) then - nzt = k + nzt = k + nzt call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info /= psb_success_) return @@ -2403,7 +2404,7 @@ contains logical, intent(in) :: append integer(psb_ipk_) :: info integer(psb_ipk_), optional :: iren(:) - integer(psb_ipk_) :: nzin_, nza, idx,ip,jp,i,k, nzt, irw, lrw, nra, nca + integer(psb_ipk_) :: nzin_, nza, idx,ip,jp,i,k, nzt, irw, lrw, nra, nca, nrd integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name='coo_getrow' @@ -2518,7 +2519,8 @@ contains if (debug_level >= psb_debug_serial_) & & write(debug_unit,*) trim(name),': unsorted ' - nzt = (nza*(lrw-irw+1))/max(a%get_nrows(),1) + nrd = max(a%get_nrows(),1) + nzt = ((nza+nrd-1)/nrd)*(lrw-irw+1) call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,val,info) @@ -2531,7 +2533,7 @@ contains & (jmin <= a%ja(i)).and.(a%ja(i)<=jmax)) then k = k + 1 if (k > nzt) then - nzt = k + nzt = k + nzt call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,val,info) @@ -2549,7 +2551,7 @@ contains & (jmin <= a%ja(i)).and.(a%ja(i)<=jmax)) then k = k + 1 if (k > nzt) then - nzt = k + nzt = k + nzt call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,val,info) diff --git a/base/serial/impl/psb_c_csr_impl.f90 b/base/serial/impl/psb_c_csr_impl.f90 index fcb7c779..6d14e924 100644 --- a/base/serial/impl/psb_c_csr_impl.f90 +++ b/base/serial/impl/psb_c_csr_impl.f90 @@ -2051,12 +2051,11 @@ contains else nzin_ = 0 endif - - nrd = max(1,a%get_nrows()) - ncd = max(1,a%get_ncols()) - nzt = min((a%irp(lrw+1)-a%irp(irw)),& - & ((nza+ncd-1)/ncd)*(lcl+1-icl),& - & ((nza+nrd-1)/nrd)*(lrw+1-irw)) + ! + ! This is a row-oriented routine, so the following is a + ! good choice. + ! + nzt = (a%irp(lrw+1)-a%irp(irw)) nz = 0 call psb_ensure_size(nzin_+nzt,ia,info) @@ -2234,11 +2233,11 @@ contains nzin_ = 0 endif - nrd = max(1,a%get_nrows()) - ncd = max(1,a%get_ncols()) - nzt = min((a%irp(lrw+1)-a%irp(irw)),& - & ((nza+ncd-1)/ncd)*(lcl+1-icl),& - & ((nza+nrd-1)/nrd)*(lrw+1-irw)) + ! + ! This is a row-oriented routine, so the following is a + ! good choice. + ! + nzt = (a%irp(lrw+1)-a%irp(irw)) nz = 0 call psb_ensure_size(nzin_+nzt,ia,info) diff --git a/base/serial/impl/psb_d_coo_impl.f90 b/base/serial/impl/psb_d_coo_impl.f90 index 74de0868..36f4b9f6 100644 --- a/base/serial/impl/psb_d_coo_impl.f90 +++ b/base/serial/impl/psb_d_coo_impl.f90 @@ -2124,7 +2124,7 @@ contains logical, intent(in) :: append integer(psb_ipk_) :: info integer(psb_ipk_), optional :: iren(:) - integer(psb_ipk_) :: nzin_, nza, idx,ip,jp,i,k, nzt, irw, lrw + integer(psb_ipk_) :: nzin_, nza, idx,ip,jp,i,k, nzt, irw, lrw,nrd integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name='coo_getptn' @@ -2234,7 +2234,8 @@ contains if (debug_level >= psb_debug_serial_) & & write(debug_unit,*) trim(name),': unsorted ' - nzt = (nza*(lrw-irw+1))/max(a%get_nrows(),1) + nrd = max(a%get_nrows(),1) + nzt = ((nza+nrd-1)/nrd)*(lrw-irw+1) call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info /= psb_success_) return @@ -2246,7 +2247,7 @@ contains & (jmin <= a%ja(i)).and.(a%ja(i)<=jmax)) then k = k + 1 if (k > nzt) then - nzt = k + nzt = k + nzt call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info /= psb_success_) return @@ -2262,7 +2263,7 @@ contains & (jmin <= a%ja(i)).and.(a%ja(i)<=jmax)) then k = k + 1 if (k > nzt) then - nzt = k + nzt = k + nzt call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info /= psb_success_) return @@ -2403,7 +2404,7 @@ contains logical, intent(in) :: append integer(psb_ipk_) :: info integer(psb_ipk_), optional :: iren(:) - integer(psb_ipk_) :: nzin_, nza, idx,ip,jp,i,k, nzt, irw, lrw, nra, nca + integer(psb_ipk_) :: nzin_, nza, idx,ip,jp,i,k, nzt, irw, lrw, nra, nca, nrd integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name='coo_getrow' @@ -2518,7 +2519,8 @@ contains if (debug_level >= psb_debug_serial_) & & write(debug_unit,*) trim(name),': unsorted ' - nzt = (nza*(lrw-irw+1))/max(a%get_nrows(),1) + nrd = max(a%get_nrows(),1) + nzt = ((nza+nrd-1)/nrd)*(lrw-irw+1) call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,val,info) @@ -2531,7 +2533,7 @@ contains & (jmin <= a%ja(i)).and.(a%ja(i)<=jmax)) then k = k + 1 if (k > nzt) then - nzt = k + nzt = k + nzt call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,val,info) @@ -2549,7 +2551,7 @@ contains & (jmin <= a%ja(i)).and.(a%ja(i)<=jmax)) then k = k + 1 if (k > nzt) then - nzt = k + nzt = k + nzt call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,val,info) diff --git a/base/serial/impl/psb_d_csr_impl.f90 b/base/serial/impl/psb_d_csr_impl.f90 index 36705709..d081e016 100644 --- a/base/serial/impl/psb_d_csr_impl.f90 +++ b/base/serial/impl/psb_d_csr_impl.f90 @@ -2051,12 +2051,11 @@ contains else nzin_ = 0 endif - - nrd = max(1,a%get_nrows()) - ncd = max(1,a%get_ncols()) - nzt = min((a%irp(lrw+1)-a%irp(irw)),& - & ((nza+ncd-1)/ncd)*(lcl+1-icl),& - & ((nza+nrd-1)/nrd)*(lrw+1-irw)) + ! + ! This is a row-oriented routine, so the following is a + ! good choice. + ! + nzt = (a%irp(lrw+1)-a%irp(irw)) nz = 0 call psb_ensure_size(nzin_+nzt,ia,info) @@ -2234,11 +2233,11 @@ contains nzin_ = 0 endif - nrd = max(1,a%get_nrows()) - ncd = max(1,a%get_ncols()) - nzt = min((a%irp(lrw+1)-a%irp(irw)),& - & ((nza+ncd-1)/ncd)*(lcl+1-icl),& - & ((nza+nrd-1)/nrd)*(lrw+1-irw)) + ! + ! This is a row-oriented routine, so the following is a + ! good choice. + ! + nzt = (a%irp(lrw+1)-a%irp(irw)) nz = 0 call psb_ensure_size(nzin_+nzt,ia,info) diff --git a/base/serial/impl/psb_s_coo_impl.f90 b/base/serial/impl/psb_s_coo_impl.f90 index 5ec73188..1489a1f2 100644 --- a/base/serial/impl/psb_s_coo_impl.f90 +++ b/base/serial/impl/psb_s_coo_impl.f90 @@ -2124,7 +2124,7 @@ contains logical, intent(in) :: append integer(psb_ipk_) :: info integer(psb_ipk_), optional :: iren(:) - integer(psb_ipk_) :: nzin_, nza, idx,ip,jp,i,k, nzt, irw, lrw + integer(psb_ipk_) :: nzin_, nza, idx,ip,jp,i,k, nzt, irw, lrw,nrd integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name='coo_getptn' @@ -2234,7 +2234,8 @@ contains if (debug_level >= psb_debug_serial_) & & write(debug_unit,*) trim(name),': unsorted ' - nzt = (nza*(lrw-irw+1))/max(a%get_nrows(),1) + nrd = max(a%get_nrows(),1) + nzt = ((nza+nrd-1)/nrd)*(lrw-irw+1) call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info /= psb_success_) return @@ -2246,7 +2247,7 @@ contains & (jmin <= a%ja(i)).and.(a%ja(i)<=jmax)) then k = k + 1 if (k > nzt) then - nzt = k + nzt = k + nzt call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info /= psb_success_) return @@ -2262,7 +2263,7 @@ contains & (jmin <= a%ja(i)).and.(a%ja(i)<=jmax)) then k = k + 1 if (k > nzt) then - nzt = k + nzt = k + nzt call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info /= psb_success_) return @@ -2403,7 +2404,7 @@ contains logical, intent(in) :: append integer(psb_ipk_) :: info integer(psb_ipk_), optional :: iren(:) - integer(psb_ipk_) :: nzin_, nza, idx,ip,jp,i,k, nzt, irw, lrw, nra, nca + integer(psb_ipk_) :: nzin_, nza, idx,ip,jp,i,k, nzt, irw, lrw, nra, nca, nrd integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name='coo_getrow' @@ -2518,7 +2519,8 @@ contains if (debug_level >= psb_debug_serial_) & & write(debug_unit,*) trim(name),': unsorted ' - nzt = (nza*(lrw-irw+1))/max(a%get_nrows(),1) + nrd = max(a%get_nrows(),1) + nzt = ((nza+nrd-1)/nrd)*(lrw-irw+1) call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,val,info) @@ -2531,7 +2533,7 @@ contains & (jmin <= a%ja(i)).and.(a%ja(i)<=jmax)) then k = k + 1 if (k > nzt) then - nzt = k + nzt = k + nzt call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,val,info) @@ -2549,7 +2551,7 @@ contains & (jmin <= a%ja(i)).and.(a%ja(i)<=jmax)) then k = k + 1 if (k > nzt) then - nzt = k + nzt = k + nzt call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,val,info) diff --git a/base/serial/impl/psb_s_csr_impl.f90 b/base/serial/impl/psb_s_csr_impl.f90 index 12a839bc..d83e2c43 100644 --- a/base/serial/impl/psb_s_csr_impl.f90 +++ b/base/serial/impl/psb_s_csr_impl.f90 @@ -2051,12 +2051,11 @@ contains else nzin_ = 0 endif - - nrd = max(1,a%get_nrows()) - ncd = max(1,a%get_ncols()) - nzt = min((a%irp(lrw+1)-a%irp(irw)),& - & ((nza+ncd-1)/ncd)*(lcl+1-icl),& - & ((nza+nrd-1)/nrd)*(lrw+1-irw)) + ! + ! This is a row-oriented routine, so the following is a + ! good choice. + ! + nzt = (a%irp(lrw+1)-a%irp(irw)) nz = 0 call psb_ensure_size(nzin_+nzt,ia,info) @@ -2234,11 +2233,11 @@ contains nzin_ = 0 endif - nrd = max(1,a%get_nrows()) - ncd = max(1,a%get_ncols()) - nzt = min((a%irp(lrw+1)-a%irp(irw)),& - & ((nza+ncd-1)/ncd)*(lcl+1-icl),& - & ((nza+nrd-1)/nrd)*(lrw+1-irw)) + ! + ! This is a row-oriented routine, so the following is a + ! good choice. + ! + nzt = (a%irp(lrw+1)-a%irp(irw)) nz = 0 call psb_ensure_size(nzin_+nzt,ia,info) diff --git a/base/serial/impl/psb_z_coo_impl.f90 b/base/serial/impl/psb_z_coo_impl.f90 index 8e02dc05..30ddc0aa 100644 --- a/base/serial/impl/psb_z_coo_impl.f90 +++ b/base/serial/impl/psb_z_coo_impl.f90 @@ -2124,7 +2124,7 @@ contains logical, intent(in) :: append integer(psb_ipk_) :: info integer(psb_ipk_), optional :: iren(:) - integer(psb_ipk_) :: nzin_, nza, idx,ip,jp,i,k, nzt, irw, lrw + integer(psb_ipk_) :: nzin_, nza, idx,ip,jp,i,k, nzt, irw, lrw,nrd integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name='coo_getptn' @@ -2234,7 +2234,8 @@ contains if (debug_level >= psb_debug_serial_) & & write(debug_unit,*) trim(name),': unsorted ' - nzt = (nza*(lrw-irw+1))/max(a%get_nrows(),1) + nrd = max(a%get_nrows(),1) + nzt = ((nza+nrd-1)/nrd)*(lrw-irw+1) call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info /= psb_success_) return @@ -2246,7 +2247,7 @@ contains & (jmin <= a%ja(i)).and.(a%ja(i)<=jmax)) then k = k + 1 if (k > nzt) then - nzt = k + nzt = k + nzt call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info /= psb_success_) return @@ -2262,7 +2263,7 @@ contains & (jmin <= a%ja(i)).and.(a%ja(i)<=jmax)) then k = k + 1 if (k > nzt) then - nzt = k + nzt = k + nzt call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info /= psb_success_) return @@ -2403,7 +2404,7 @@ contains logical, intent(in) :: append integer(psb_ipk_) :: info integer(psb_ipk_), optional :: iren(:) - integer(psb_ipk_) :: nzin_, nza, idx,ip,jp,i,k, nzt, irw, lrw, nra, nca + integer(psb_ipk_) :: nzin_, nza, idx,ip,jp,i,k, nzt, irw, lrw, nra, nca, nrd integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name='coo_getrow' @@ -2518,7 +2519,8 @@ contains if (debug_level >= psb_debug_serial_) & & write(debug_unit,*) trim(name),': unsorted ' - nzt = (nza*(lrw-irw+1))/max(a%get_nrows(),1) + nrd = max(a%get_nrows(),1) + nzt = ((nza+nrd-1)/nrd)*(lrw-irw+1) call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,val,info) @@ -2531,7 +2533,7 @@ contains & (jmin <= a%ja(i)).and.(a%ja(i)<=jmax)) then k = k + 1 if (k > nzt) then - nzt = k + nzt = k + nzt call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,val,info) @@ -2549,7 +2551,7 @@ contains & (jmin <= a%ja(i)).and.(a%ja(i)<=jmax)) then k = k + 1 if (k > nzt) then - nzt = k + nzt = k + nzt call psb_ensure_size(nzin_+nzt,ia,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,ja,info) if (info == psb_success_) call psb_ensure_size(nzin_+nzt,val,info) diff --git a/base/serial/impl/psb_z_csr_impl.f90 b/base/serial/impl/psb_z_csr_impl.f90 index 42aa115a..b3e3419a 100644 --- a/base/serial/impl/psb_z_csr_impl.f90 +++ b/base/serial/impl/psb_z_csr_impl.f90 @@ -2051,12 +2051,11 @@ contains else nzin_ = 0 endif - - nrd = max(1,a%get_nrows()) - ncd = max(1,a%get_ncols()) - nzt = min((a%irp(lrw+1)-a%irp(irw)),& - & ((nza+ncd-1)/ncd)*(lcl+1-icl),& - & ((nza+nrd-1)/nrd)*(lrw+1-irw)) + ! + ! This is a row-oriented routine, so the following is a + ! good choice. + ! + nzt = (a%irp(lrw+1)-a%irp(irw)) nz = 0 call psb_ensure_size(nzin_+nzt,ia,info) @@ -2234,11 +2233,11 @@ contains nzin_ = 0 endif - nrd = max(1,a%get_nrows()) - ncd = max(1,a%get_ncols()) - nzt = min((a%irp(lrw+1)-a%irp(irw)),& - & ((nza+ncd-1)/ncd)*(lcl+1-icl),& - & ((nza+nrd-1)/nrd)*(lrw+1-irw)) + ! + ! This is a row-oriented routine, so the following is a + ! good choice. + ! + nzt = (a%irp(lrw+1)-a%irp(irw)) nz = 0 call psb_ensure_size(nzin_+nzt,ia,info)