diff --git a/base/modules/psb_spmat_type.f90 b/base/modules/psb_spmat_type.f90 index d53c870c..69b50f46 100644 --- a/base/modules/psb_spmat_type.f90 +++ b/base/modules/psb_spmat_type.f90 @@ -751,6 +751,11 @@ contains ia = nza i1 = nza i2 = a%m + 1 + case('csc') + nza = a%ia2(a%k+1)-1 + ia = nza + i1 = nza + i2 = a%k + 1 case('coo','coi') nza = a%infoa(psb_nnz_) i1 = nza @@ -1238,6 +1243,11 @@ contains ia = nza i1 = nza i2 = a%m + 1 + case('csc') + nza = a%ia2(a%k+1)-1 + ia = nza + i1 = nza + i2 = a%k + 1 case('coo','coi') nza = a%infoa(psb_nnz_) i1 = nza diff --git a/base/serial/psb_dipcoo2csc.f90 b/base/serial/psb_dipcoo2csc.f90 index 2b433558..f72be4ad 100644 --- a/base/serial/psb_dipcoo2csc.f90 +++ b/base/serial/psb_dipcoo2csc.f90 @@ -76,9 +76,11 @@ subroutine psb_dipcoo2csc(a,info,clshr) end if call psb_fixcoo(a,info,idir=1) - nc = a%k - nza = a%infoa(psb_nnz_) - allocate(iaux(max(nc+1,1)),stat=info) + if (info == 0) then + nc = a%k + nza = a%infoa(psb_nnz_) + allocate(iaux(max(nc+1,1)),stat=info) + end if if (info /= 0) then info=4025 call psb_errpush(info,name,a_err='integer',i_err=(/max(nc+1,1),0,0,0,0/)) @@ -88,7 +90,12 @@ subroutine psb_dipcoo2csc(a,info,clshr) & ': out of fixcoo',nza,nc,size(a%ia2),size(iaux) call psb_transfer(a%ia2,itemp,info) - call psb_transfer(iaux,a%ia2,info) + if (info == 0) call psb_transfer(iaux,a%ia2,info) + if (info /= 0) then + info=4010 + call psb_errpush(info,name,a_err='psb_transfer') + goto 9999 + end if ! ! This routine can be used in two modes: diff --git a/base/serial/psb_zipcoo2csc.f90 b/base/serial/psb_zipcoo2csc.f90 index 8e199ef2..1f8ba03b 100644 --- a/base/serial/psb_zipcoo2csc.f90 +++ b/base/serial/psb_zipcoo2csc.f90 @@ -76,9 +76,11 @@ subroutine psb_zipcoo2csc(a,info,clshr) end if call psb_fixcoo(a,info,idir=1) - nc = a%k - nza = a%infoa(psb_nnz_) - allocate(iaux(max(nc+1,1)),stat=info) + if (info == 0) then + nc = a%k + nza = a%infoa(psb_nnz_) + allocate(iaux(max(nc+1,1)),stat=info) + end if if (info /= 0) then info=4025 call psb_errpush(info,name,a_err='integer',i_err=(/max(nc+1,1),0,0,0,0/)) @@ -88,7 +90,12 @@ subroutine psb_zipcoo2csc(a,info,clshr) & ': out of fixcoo',nza,nc,size(a%ia2),size(iaux) call psb_transfer(a%ia2,itemp,info) - call psb_transfer(iaux,a%ia2,info) + if (info == 0) call psb_transfer(iaux,a%ia2,info) + if (info /= 0) then + info=4010 + call psb_errpush(info,name,a_err='psb_transfer') + goto 9999 + end if ! ! This routine can be used in two modes: