From afe8e6bdbcfbca397197cf3f8c75a4bdc6f6528d Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Thu, 8 May 2008 09:06:15 +0000 Subject: [PATCH] psblas2-dev/base: modules/psb_spmat_type.f90 serial/psb_dipcoo2csc.f90 serial/psb_zipcoo2csc.f90 Fixed handling of trim for CSC (needed for UMFPACK). --- base/modules/psb_spmat_type.f90 | 10 ++++++++++ base/serial/psb_dipcoo2csc.f90 | 15 +++++++++++---- base/serial/psb_zipcoo2csc.f90 | 15 +++++++++++---- 3 files changed, 32 insertions(+), 8 deletions(-) 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: