Fix cnv method for unallocated vectors

tspmm
Salvatore Filippone 2 years ago
parent a8d7cd5111
commit 00c69bfee9

@ -526,10 +526,12 @@ contains
allocate(tmp,stat=info,mold=psb_c_get_base_vect_default()) allocate(tmp,stat=info,mold=psb_c_get_base_vect_default())
end if end if
if (allocated(x%v)) then if (allocated(x%v)) then
if (allocated(x%v%v)) then
call x%v%sync() call x%v%sync()
if (info == psb_success_) call tmp%bld(x%v%v) if (info == psb_success_) call tmp%bld(x%v%v)
call x%v%free(info) call x%v%free(info)
endif endif
end if
call move_alloc(tmp,x%v) call move_alloc(tmp,x%v)
end subroutine c_vect_cnv end subroutine c_vect_cnv

@ -533,10 +533,12 @@ contains
allocate(tmp,stat=info,mold=psb_d_get_base_vect_default()) allocate(tmp,stat=info,mold=psb_d_get_base_vect_default())
end if end if
if (allocated(x%v)) then if (allocated(x%v)) then
if (allocated(x%v%v)) then
call x%v%sync() call x%v%sync()
if (info == psb_success_) call tmp%bld(x%v%v) if (info == psb_success_) call tmp%bld(x%v%v)
call x%v%free(info) call x%v%free(info)
endif endif
end if
call move_alloc(tmp,x%v) call move_alloc(tmp,x%v)
end subroutine d_vect_cnv end subroutine d_vect_cnv

@ -473,10 +473,12 @@ contains
allocate(tmp,stat=info,mold=psb_i_get_base_vect_default()) allocate(tmp,stat=info,mold=psb_i_get_base_vect_default())
end if end if
if (allocated(x%v)) then if (allocated(x%v)) then
if (allocated(x%v%v)) then
call x%v%sync() call x%v%sync()
if (info == psb_success_) call tmp%bld(x%v%v) if (info == psb_success_) call tmp%bld(x%v%v)
call x%v%free(info) call x%v%free(info)
endif endif
end if
call move_alloc(tmp,x%v) call move_alloc(tmp,x%v)
end subroutine i_vect_cnv end subroutine i_vect_cnv

@ -474,10 +474,12 @@ contains
allocate(tmp,stat=info,mold=psb_l_get_base_vect_default()) allocate(tmp,stat=info,mold=psb_l_get_base_vect_default())
end if end if
if (allocated(x%v)) then if (allocated(x%v)) then
if (allocated(x%v%v)) then
call x%v%sync() call x%v%sync()
if (info == psb_success_) call tmp%bld(x%v%v) if (info == psb_success_) call tmp%bld(x%v%v)
call x%v%free(info) call x%v%free(info)
endif endif
end if
call move_alloc(tmp,x%v) call move_alloc(tmp,x%v)
end subroutine l_vect_cnv end subroutine l_vect_cnv

@ -533,10 +533,12 @@ contains
allocate(tmp,stat=info,mold=psb_s_get_base_vect_default()) allocate(tmp,stat=info,mold=psb_s_get_base_vect_default())
end if end if
if (allocated(x%v)) then if (allocated(x%v)) then
if (allocated(x%v%v)) then
call x%v%sync() call x%v%sync()
if (info == psb_success_) call tmp%bld(x%v%v) if (info == psb_success_) call tmp%bld(x%v%v)
call x%v%free(info) call x%v%free(info)
endif endif
end if
call move_alloc(tmp,x%v) call move_alloc(tmp,x%v)
end subroutine s_vect_cnv end subroutine s_vect_cnv

@ -526,10 +526,12 @@ contains
allocate(tmp,stat=info,mold=psb_z_get_base_vect_default()) allocate(tmp,stat=info,mold=psb_z_get_base_vect_default())
end if end if
if (allocated(x%v)) then if (allocated(x%v)) then
if (allocated(x%v%v)) then
call x%v%sync() call x%v%sync()
if (info == psb_success_) call tmp%bld(x%v%v) if (info == psb_success_) call tmp%bld(x%v%v)
call x%v%free(info) call x%v%free(info)
endif endif
end if
call move_alloc(tmp,x%v) call move_alloc(tmp,x%v)
end subroutine z_vect_cnv end subroutine z_vect_cnv

Loading…
Cancel
Save