From 15178a9005a7dba4fef8a0a2c87756b05c31211a Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Thu, 12 May 2022 12:58:29 +0200 Subject: [PATCH] FIx vect%cnv on unallocated internals --- base/modules/serial/psb_c_vect_mod.F90 | 8 +++++--- base/modules/serial/psb_d_vect_mod.F90 | 8 +++++--- base/modules/serial/psb_i_vect_mod.F90 | 8 +++++--- base/modules/serial/psb_l_vect_mod.F90 | 8 +++++--- base/modules/serial/psb_s_vect_mod.F90 | 8 +++++--- base/modules/serial/psb_z_vect_mod.F90 | 8 +++++--- 6 files changed, 30 insertions(+), 18 deletions(-) diff --git a/base/modules/serial/psb_c_vect_mod.F90 b/base/modules/serial/psb_c_vect_mod.F90 index 0edb7245..ee6eef28 100644 --- a/base/modules/serial/psb_c_vect_mod.F90 +++ b/base/modules/serial/psb_c_vect_mod.F90 @@ -526,9 +526,11 @@ contains allocate(tmp,stat=info,mold=psb_c_get_base_vect_default()) end if if (allocated(x%v)) then - call x%v%sync() - if (info == psb_success_) call tmp%bld(x%v%v) - call x%v%free(info) + if (allocated(x%v%v)) then + call x%v%sync() + if (info == psb_success_) call tmp%bld(x%v%v) + call x%v%free(info) + endif end if call move_alloc(tmp,x%v) diff --git a/base/modules/serial/psb_d_vect_mod.F90 b/base/modules/serial/psb_d_vect_mod.F90 index ec928584..c3cad97e 100644 --- a/base/modules/serial/psb_d_vect_mod.F90 +++ b/base/modules/serial/psb_d_vect_mod.F90 @@ -533,9 +533,11 @@ contains allocate(tmp,stat=info,mold=psb_d_get_base_vect_default()) end if if (allocated(x%v)) then - call x%v%sync() - if (info == psb_success_) call tmp%bld(x%v%v) - call x%v%free(info) + if (allocated(x%v%v)) then + call x%v%sync() + if (info == psb_success_) call tmp%bld(x%v%v) + call x%v%free(info) + endif end if call move_alloc(tmp,x%v) diff --git a/base/modules/serial/psb_i_vect_mod.F90 b/base/modules/serial/psb_i_vect_mod.F90 index 75064b81..369aca6d 100644 --- a/base/modules/serial/psb_i_vect_mod.F90 +++ b/base/modules/serial/psb_i_vect_mod.F90 @@ -473,9 +473,11 @@ contains allocate(tmp,stat=info,mold=psb_i_get_base_vect_default()) end if if (allocated(x%v)) then - call x%v%sync() - if (info == psb_success_) call tmp%bld(x%v%v) - call x%v%free(info) + if (allocated(x%v%v)) then + call x%v%sync() + if (info == psb_success_) call tmp%bld(x%v%v) + call x%v%free(info) + endif end if call move_alloc(tmp,x%v) diff --git a/base/modules/serial/psb_l_vect_mod.F90 b/base/modules/serial/psb_l_vect_mod.F90 index 3c86f8a2..0c36df14 100644 --- a/base/modules/serial/psb_l_vect_mod.F90 +++ b/base/modules/serial/psb_l_vect_mod.F90 @@ -474,9 +474,11 @@ contains allocate(tmp,stat=info,mold=psb_l_get_base_vect_default()) end if if (allocated(x%v)) then - call x%v%sync() - if (info == psb_success_) call tmp%bld(x%v%v) - call x%v%free(info) + if (allocated(x%v%v)) then + call x%v%sync() + if (info == psb_success_) call tmp%bld(x%v%v) + call x%v%free(info) + endif end if call move_alloc(tmp,x%v) diff --git a/base/modules/serial/psb_s_vect_mod.F90 b/base/modules/serial/psb_s_vect_mod.F90 index 8f378c6d..8da759fc 100644 --- a/base/modules/serial/psb_s_vect_mod.F90 +++ b/base/modules/serial/psb_s_vect_mod.F90 @@ -533,9 +533,11 @@ contains allocate(tmp,stat=info,mold=psb_s_get_base_vect_default()) end if if (allocated(x%v)) then - call x%v%sync() - if (info == psb_success_) call tmp%bld(x%v%v) - call x%v%free(info) + if (allocated(x%v%v)) then + call x%v%sync() + if (info == psb_success_) call tmp%bld(x%v%v) + call x%v%free(info) + endif end if call move_alloc(tmp,x%v) diff --git a/base/modules/serial/psb_z_vect_mod.F90 b/base/modules/serial/psb_z_vect_mod.F90 index 60c5b6f0..35327ace 100644 --- a/base/modules/serial/psb_z_vect_mod.F90 +++ b/base/modules/serial/psb_z_vect_mod.F90 @@ -526,9 +526,11 @@ contains allocate(tmp,stat=info,mold=psb_z_get_base_vect_default()) end if if (allocated(x%v)) then - call x%v%sync() - if (info == psb_success_) call tmp%bld(x%v%v) - call x%v%free(info) + if (allocated(x%v%v)) then + call x%v%sync() + if (info == psb_success_) call tmp%bld(x%v%v) + call x%v%free(info) + endif end if call move_alloc(tmp,x%v)