|
|
|
|
@ -167,24 +167,15 @@ contains
|
|
|
|
|
class(psb_l_vect_type), intent(inout) :: x
|
|
|
|
|
class(psb_l_base_vect_type), intent(in), optional :: mold
|
|
|
|
|
integer(psb_ipk_) :: info
|
|
|
|
|
class(psb_l_base_vect_type), pointer :: mld
|
|
|
|
|
|
|
|
|
|
info = psb_success_
|
|
|
|
|
if (allocated(x%v)) &
|
|
|
|
|
& call x%free(info)
|
|
|
|
|
|
|
|
|
|
if (present(mold)) then
|
|
|
|
|
#ifdef HAVE_MOLD
|
|
|
|
|
allocate(x%v,stat=info,mold=mold)
|
|
|
|
|
#else
|
|
|
|
|
call mold%mold(x%v,info)
|
|
|
|
|
#endif
|
|
|
|
|
else
|
|
|
|
|
#ifdef HAVE_MOLD
|
|
|
|
|
allocate(x%v,stat=info, mold=psb_l_get_base_vect_default())
|
|
|
|
|
#else
|
|
|
|
|
mld = psb_l_get_base_vect_default()
|
|
|
|
|
call mld%mold(x%v,info)
|
|
|
|
|
#endif
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
if (info == psb_success_) call x%v%bld(invect)
|
|
|
|
|
@ -199,23 +190,14 @@ contains
|
|
|
|
|
integer(psb_ipk_) :: info
|
|
|
|
|
class(psb_l_base_vect_type), pointer :: mld
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
info = psb_success_
|
|
|
|
|
if (allocated(x%v)) &
|
|
|
|
|
& call x%free(info)
|
|
|
|
|
|
|
|
|
|
if (present(mold)) then
|
|
|
|
|
#ifdef HAVE_MOLD
|
|
|
|
|
allocate(x%v,stat=info,mold=mold)
|
|
|
|
|
#else
|
|
|
|
|
call mold%mold(x%v,info)
|
|
|
|
|
#endif
|
|
|
|
|
else
|
|
|
|
|
#ifdef HAVE_MOLD
|
|
|
|
|
allocate(x%v,stat=info, mold=psb_l_get_base_vect_default())
|
|
|
|
|
#else
|
|
|
|
|
mld = psb_l_get_base_vect_default()
|
|
|
|
|
call mld%mold(x%v,info)
|
|
|
|
|
#endif
|
|
|
|
|
endif
|
|
|
|
|
if (info == psb_success_) call x%v%bld(n)
|
|
|
|
|
|
|
|
|
|
@ -227,25 +209,16 @@ contains
|
|
|
|
|
class(psb_l_vect_type), intent(inout) :: x
|
|
|
|
|
class(psb_l_base_vect_type), intent(in), optional :: mold
|
|
|
|
|
integer(psb_ipk_) :: info
|
|
|
|
|
class(psb_l_base_vect_type), pointer :: mld
|
|
|
|
|
|
|
|
|
|
info = psb_success_
|
|
|
|
|
|
|
|
|
|
if (allocated(x%v)) &
|
|
|
|
|
& call x%free(info)
|
|
|
|
|
|
|
|
|
|
if (present(mold)) then
|
|
|
|
|
#ifdef HAVE_MOLD
|
|
|
|
|
allocate(x%v,stat=info,mold=mold)
|
|
|
|
|
#else
|
|
|
|
|
call mold%mold(x%v,info)
|
|
|
|
|
#endif
|
|
|
|
|
else
|
|
|
|
|
#ifdef HAVE_MOLD
|
|
|
|
|
allocate(x%v,stat=info, mold=psb_l_get_base_vect_default())
|
|
|
|
|
#else
|
|
|
|
|
mld = psb_l_get_base_vect_default()
|
|
|
|
|
call mld%mold(x%v,info)
|
|
|
|
|
#endif
|
|
|
|
|
endif
|
|
|
|
|
if (info == psb_success_) call x%v%bld(n)
|
|
|
|
|
|
|
|
|
|
@ -326,6 +299,7 @@ contains
|
|
|
|
|
res = 'NULL'
|
|
|
|
|
if (allocated(x%v)) res = x%v%get_fmt()
|
|
|
|
|
end function l_vect_get_fmt
|
|
|
|
|
|
|
|
|
|
subroutine l_vect_all(n, x, info, mold)
|
|
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
|
@ -338,11 +312,7 @@ contains
|
|
|
|
|
& call x%free(info)
|
|
|
|
|
|
|
|
|
|
if (present(mold)) then
|
|
|
|
|
#ifdef HAVE_MOLD
|
|
|
|
|
allocate(x%v,stat=info,mold=mold)
|
|
|
|
|
#else
|
|
|
|
|
call mold%mold(x%v,info)
|
|
|
|
|
#endif
|
|
|
|
|
else
|
|
|
|
|
allocate(psb_l_base_vect_type :: x%v,stat=info)
|
|
|
|
|
endif
|
|
|
|
|
@ -486,21 +456,22 @@ contains
|
|
|
|
|
class(psb_l_vect_type), intent(inout) :: x
|
|
|
|
|
class(psb_l_base_vect_type), intent(in), optional :: mold
|
|
|
|
|
class(psb_l_base_vect_type), allocatable :: tmp
|
|
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: info
|
|
|
|
|
|
|
|
|
|
info = psb_success_
|
|
|
|
|
if (present(mold)) then
|
|
|
|
|
#ifdef HAVE_MOLD
|
|
|
|
|
allocate(tmp,stat=info,mold=mold)
|
|
|
|
|
#else
|
|
|
|
|
call mold%mold(tmp,info)
|
|
|
|
|
#endif
|
|
|
|
|
if (allocated(x%v)) then
|
|
|
|
|
call x%v%sync()
|
|
|
|
|
if (info == psb_success_) call tmp%bld(x%v%v)
|
|
|
|
|
call x%v%free(info)
|
|
|
|
|
end if
|
|
|
|
|
call move_alloc(tmp,x%v)
|
|
|
|
|
else
|
|
|
|
|
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)
|
|
|
|
|
end if
|
|
|
|
|
call move_alloc(tmp,x%v)
|
|
|
|
|
|
|
|
|
|
end subroutine l_vect_cnv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -698,19 +669,11 @@ contains
|
|
|
|
|
integer(psb_ipk_) :: info
|
|
|
|
|
class(psb_l_base_multivect_type), pointer :: mld
|
|
|
|
|
|
|
|
|
|
info = psb_success_
|
|
|
|
|
if (present(mold)) then
|
|
|
|
|
#ifdef HAVE_MOLD
|
|
|
|
|
allocate(x%v,stat=info,mold=mold)
|
|
|
|
|
#else
|
|
|
|
|
call mold%mold(x%v,info)
|
|
|
|
|
#endif
|
|
|
|
|
else
|
|
|
|
|
#ifdef HAVE_MOLD
|
|
|
|
|
allocate(x%v,stat=info, mold=psb_l_get_base_multivect_default())
|
|
|
|
|
#else
|
|
|
|
|
mld = psb_l_get_base_multivect_default()
|
|
|
|
|
call mld%mold(x%v,info)
|
|
|
|
|
#endif
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
if (info == psb_success_) call x%v%bld(invect)
|
|
|
|
|
@ -723,21 +686,12 @@ contains
|
|
|
|
|
class(psb_l_multivect_type), intent(out) :: x
|
|
|
|
|
class(psb_l_base_multivect_type), intent(in), optional :: mold
|
|
|
|
|
integer(psb_ipk_) :: info
|
|
|
|
|
class(psb_l_base_multivect_type), pointer :: mld
|
|
|
|
|
|
|
|
|
|
info = psb_success_
|
|
|
|
|
if (present(mold)) then
|
|
|
|
|
#ifdef HAVE_MOLD
|
|
|
|
|
allocate(x%v,stat=info,mold=mold)
|
|
|
|
|
#else
|
|
|
|
|
call mold%mold(x%v,info)
|
|
|
|
|
#endif
|
|
|
|
|
else
|
|
|
|
|
#ifdef HAVE_MOLD
|
|
|
|
|
allocate(x%v,stat=info, mold=psb_l_get_base_multivect_default())
|
|
|
|
|
#else
|
|
|
|
|
mld = psb_l_get_base_multivect_default()
|
|
|
|
|
call mld%mold(x%v,info)
|
|
|
|
|
#endif
|
|
|
|
|
endif
|
|
|
|
|
if (info == psb_success_) call x%v%bld(m,n)
|
|
|
|
|
|
|
|
|
|
@ -834,11 +788,7 @@ contains
|
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
|
|
if (present(mold)) then
|
|
|
|
|
#ifdef HAVE_MOLD
|
|
|
|
|
allocate(x%v,stat=info,mold=mold)
|
|
|
|
|
#else
|
|
|
|
|
call mold%mold(x%v,info)
|
|
|
|
|
#endif
|
|
|
|
|
else
|
|
|
|
|
allocate(psb_l_base_multivect_type :: x%v,stat=info)
|
|
|
|
|
endif
|
|
|
|
|
@ -997,18 +947,16 @@ contains
|
|
|
|
|
integer(psb_ipk_) :: info
|
|
|
|
|
|
|
|
|
|
if (present(mold)) then
|
|
|
|
|
#ifdef HAVE_MOLD
|
|
|
|
|
allocate(tmp,stat=info,mold=mold)
|
|
|
|
|
#else
|
|
|
|
|
call mold%mold(tmp,info)
|
|
|
|
|
#endif
|
|
|
|
|
if (allocated(x%v)) then
|
|
|
|
|
call x%v%sync()
|
|
|
|
|
if (info == psb_success_) call tmp%bld(x%v%v)
|
|
|
|
|
call x%v%free(info)
|
|
|
|
|
end if
|
|
|
|
|
call move_alloc(tmp,x%v)
|
|
|
|
|
else
|
|
|
|
|
allocate(tmp,stat=info, mold=psb_l_get_base_multivect_default())
|
|
|
|
|
endif
|
|
|
|
|
if (allocated(x%v)) then
|
|
|
|
|
call x%v%sync()
|
|
|
|
|
if (info == psb_success_) call tmp%bld(x%v%v)
|
|
|
|
|
call x%v%free(info)
|
|
|
|
|
end if
|
|
|
|
|
call move_alloc(tmp,x%v)
|
|
|
|
|
end subroutine l_vect_cnv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|