diff --git a/base/serial/impl/psb_c_csr_impl.f90 b/base/serial/impl/psb_c_csr_impl.f90 index 1fda1ab9..6885be6a 100644 --- a/base/serial/impl/psb_c_csr_impl.f90 +++ b/base/serial/impl/psb_c_csr_impl.f90 @@ -3391,8 +3391,8 @@ subroutine psb_ccsrspspmm(a,b,c,info) ma = max(na,1) mb = max(mb,1) nb = max(nb,1) - nze = ma*(((nza+ma-1)/ma)*((nzb+mb-1)/mb) ) - nzeb = (((nza+na-1)/na)*((nzb+nb-1)/nb))*nb + nze = max(1,ma*(((nza+ma-1)/ma)*((nzb+mb-1)/mb) )) + nzeb = max(1,(((nza+na-1)/na)*((nzb+nb-1)/nb))*nb) nzc = min(nzc, nze+nzeb) call c%allocate(ma,nb,nzc) diff --git a/base/serial/impl/psb_d_csr_impl.f90 b/base/serial/impl/psb_d_csr_impl.f90 index fe62c86c..f1f496a6 100644 --- a/base/serial/impl/psb_d_csr_impl.f90 +++ b/base/serial/impl/psb_d_csr_impl.f90 @@ -3391,8 +3391,8 @@ subroutine psb_dcsrspspmm(a,b,c,info) ma = max(na,1) mb = max(mb,1) nb = max(nb,1) - nze = ma*(((nza+ma-1)/ma)*((nzb+mb-1)/mb) ) - nzeb = (((nza+na-1)/na)*((nzb+nb-1)/nb))*nb + nze = max(1,ma*(((nza+ma-1)/ma)*((nzb+mb-1)/mb) )) + nzeb = max(1,(((nza+na-1)/na)*((nzb+nb-1)/nb))*nb) nzc = min(nzc, nze+nzeb) call c%allocate(ma,nb,nzc) diff --git a/base/serial/impl/psb_s_csr_impl.f90 b/base/serial/impl/psb_s_csr_impl.f90 index 1e035662..b283d93f 100644 --- a/base/serial/impl/psb_s_csr_impl.f90 +++ b/base/serial/impl/psb_s_csr_impl.f90 @@ -3391,8 +3391,8 @@ subroutine psb_scsrspspmm(a,b,c,info) ma = max(na,1) mb = max(mb,1) nb = max(nb,1) - nze = ma*(((nza+ma-1)/ma)*((nzb+mb-1)/mb) ) - nzeb = (((nza+na-1)/na)*((nzb+nb-1)/nb))*nb + nze = max(1,ma*(((nza+ma-1)/ma)*((nzb+mb-1)/mb) )) + nzeb = max(1,(((nza+na-1)/na)*((nzb+nb-1)/nb))*nb) nzc = min(nzc, nze+nzeb) call c%allocate(ma,nb,nzc) diff --git a/base/serial/impl/psb_z_csr_impl.f90 b/base/serial/impl/psb_z_csr_impl.f90 index 21f82bf9..a1849c8e 100644 --- a/base/serial/impl/psb_z_csr_impl.f90 +++ b/base/serial/impl/psb_z_csr_impl.f90 @@ -3391,8 +3391,8 @@ subroutine psb_zcsrspspmm(a,b,c,info) ma = max(na,1) mb = max(mb,1) nb = max(nb,1) - nze = ma*(((nza+ma-1)/ma)*((nzb+mb-1)/mb) ) - nzeb = (((nza+na-1)/na)*((nzb+nb-1)/nb))*nb + nze = max(1,ma*(((nza+ma-1)/ma)*((nzb+mb-1)/mb) )) + nzeb = max(1,(((nza+na-1)/na)*((nzb+nb-1)/nb))*nb) nzc = min(nzc, nze+nzeb) call c%allocate(ma,nb,nzc)