From 7148b39c702c5f84e16730a63062085dce755abe Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Mon, 6 Nov 2006 13:08:04 +0000 Subject: [PATCH] Changed allocation of bnd_elem to match the actual number of boundary nodes. --- src/internals/psi_crea_bnd_elem.f90 | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/internals/psi_crea_bnd_elem.f90 b/src/internals/psi_crea_bnd_elem.f90 index a9377378..591dc40c 100644 --- a/src/internals/psi_crea_bnd_elem.f90 +++ b/src/internals/psi_crea_bnd_elem.f90 @@ -80,16 +80,20 @@ subroutine psi_crea_bnd_elem(desc_a,info) j = 0 endif - allocate(desc_a%bnd_elem(j+1),stat=info) - if (info /= 0) then - call psb_errpush(4010,name,a_err='Allocate') - goto 9999 - end if - if (.false.) then - desc_a%bnd_elem(1) = j - desc_a%bnd_elem(2:j+1) = work(1:j) + if (.true.) then + allocate(desc_a%bnd_elem(j),stat=info) + if (info /= 0) then + call psb_errpush(4010,name,a_err='Allocate') + goto 9999 + end if + desc_a%bnd_elem(1:j) = work(1:j) else + allocate(desc_a%bnd_elem(j+1),stat=info) + if (info /= 0) then + call psb_errpush(4010,name,a_err='Allocate') + goto 9999 + end if desc_a%bnd_elem(1:j) = work(1:j) desc_a%bnd_elem(j+1) = -1 endif