Deallocate output if needed in indxmap%clone.

merge-paraggr
Salvatore Filippone 6 years ago
parent 3bafaa242a
commit 08063d4f48

@ -1029,8 +1029,8 @@ contains
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
name = 'psb_cdcpy' name = 'psb_cdcpy'
if (desc%is_valid()) then call desc_out%free(info)
call desc_out%free(info) if ((info == psb_success_).and.desc%is_valid()) then
ictxt = desc%get_context() ictxt = desc%get_context()
! check on blacs grid ! check on blacs grid
@ -1061,14 +1061,8 @@ contains
& call psb_safe_ab_cpy(desc%lprm,desc_out%lprm,info) & call psb_safe_ab_cpy(desc%lprm,desc_out%lprm,info)
if (info == psb_success_)& if (info == psb_success_)&
& call psb_safe_ab_cpy(desc%idx_space,desc_out%idx_space,info) & call psb_safe_ab_cpy(desc%idx_space,desc_out%idx_space,info)
!!$ if ((info == psb_success_).and.(allocated(desc%indxmap))) &
!!$ & call desc%indxmap%clone(desc_out%indxmap,info)
!!$ associate(indxin => desc%indxmap)
!!$ if ((info == psb_success_).and.(allocated(desc%indxmap))) &
!!$ & call indxin%clone(desc_out%indxmap,info)
!!$ end associate
if ((info == psb_success_).and.(allocated(desc%indxmap))) & if ((info == psb_success_).and.(allocated(desc%indxmap))) &
& allocate(desc_out%indxmap,source=desc%indxmap,stat=info) & call desc%indxmap%clone(desc_out%indxmap,info)
if (info == psb_success_) & if (info == psb_success_) &
& call desc%v_halo_index%clone(desc_out%v_halo_index,info) & call desc%v_halo_index%clone(desc_out%v_halo_index,info)
if (info == psb_success_) & if (info == psb_success_) &
@ -1078,9 +1072,6 @@ contains
if (info == psb_success_) & if (info == psb_success_) &
& call desc%v_ovr_mst_idx%clone(desc_out%v_ovr_mst_idx,info) & call desc%v_ovr_mst_idx%clone(desc_out%v_ovr_mst_idx,info)
else
call desc_out%free(info)
end if end if
if (info /= psb_success_) then if (info /= psb_success_) then
info = psb_err_from_subroutine_ info = psb_err_from_subroutine_

@ -2075,12 +2075,16 @@ contains
info = psb_success_ info = psb_success_
call psb_get_erraction(err_act) call psb_get_erraction(err_act)
if (allocated(outmap)) then if (allocated(outmap)) then
write(0,*) 'Error: should not be allocated on input' call outmap%free()
deallocate(outmap,stat=info)
end if
if (info /= 0) then
write(0,*) 'Error: could not cleanup output'
info = -87 info = -87
goto 9999 goto 9999
end if end if
allocate(psb_gen_block_map :: outmap, stat=info) allocate(psb_gen_block_map :: outmap, stat=info)
if (info /= psb_success_) then if (info /= psb_success_) then
info = psb_err_alloc_dealloc_ info = psb_err_alloc_dealloc_

@ -203,12 +203,17 @@ contains
info = psb_success_ info = psb_success_
call psb_get_erraction(err_act) call psb_get_erraction(err_act)
if (allocated(outmap)) then if (allocated(outmap)) then
write(0,*) 'Error: should not be allocated on input' call outmap%free()
deallocate(outmap,stat=info)
end if
if (info /= 0) then
write(0,*) 'Error: could not cleanup output'
info = -87 info = -87
goto 9999 goto 9999
end if end if
allocate(psb_glist_map :: outmap, stat=info) allocate(psb_glist_map :: outmap, stat=info)
if (info /= psb_success_) then if (info /= psb_success_) then
info = psb_err_alloc_dealloc_ info = psb_err_alloc_dealloc_

@ -1445,11 +1445,16 @@ contains
info = psb_success_ info = psb_success_
call psb_get_erraction(err_act) call psb_get_erraction(err_act)
if (allocated(outmap)) then if (allocated(outmap)) then
write(0,*) 'Error: should not be allocated on input' call outmap%free()
deallocate(outmap,stat=info)
end if
if (info /= 0) then
write(0,*) 'Error: could not cleanup output'
info = -87 info = -87
goto 9999 goto 9999
end if end if
allocate(psb_hash_map :: outmap, stat=info ) allocate(psb_hash_map :: outmap, stat=info )
if (info /= psb_success_) then if (info /= psb_success_) then

@ -1181,8 +1181,12 @@ contains
info = psb_success_ info = psb_success_
call psb_get_erraction(err_act) call psb_get_erraction(err_act)
if (allocated(outmap)) then if (allocated(outmap)) then
write(0,*) 'Error: should not be allocated on input' call outmap%free()
deallocate(outmap,stat=info)
end if
if (info /= 0) then
write(0,*) 'Error: could not cleanup output'
info = -87 info = -87
goto 9999 goto 9999
end if end if

@ -799,8 +799,12 @@ contains
info = psb_success_ info = psb_success_
call psb_get_erraction(err_act) call psb_get_erraction(err_act)
if (allocated(outmap)) then if (allocated(outmap)) then
write(0,*) 'Error: should not be allocated on input' call outmap%free()
deallocate(outmap,stat=info)
end if
if (info /= 0) then
write(0,*) 'Error: could not cleanup output'
info = -87 info = -87
goto 9999 goto 9999
end if end if

Loading…
Cancel
Save