Fix uninitialized INFO in cp/mv _from

This commit is contained in:
Salvatore Filippone
2020-04-18 18:31:07 +02:00
parent b56abbb270
commit eb934e2a45
4 changed files with 24 additions and 4 deletions
+6 -1
View File
@@ -2508,6 +2508,8 @@ subroutine psb_c_mv_from_lb(a,b)
class(psb_cspmat_type), intent(inout) :: a
class(psb_lc_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
info = psb_success_
if (.not.allocated(a%a)) allocate(psb_c_csr_sparse_mat :: a%a, stat=info)
if (info == psb_success_) call a%a%mv_from_lfmt(b,info)
@@ -2524,6 +2526,7 @@ subroutine psb_c_cp_from_lb(a,b)
class(psb_lc_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
info = psb_success_
if (.not.allocated(a%a)) allocate(psb_c_csr_sparse_mat :: a%a, stat=info)
if (info == psb_success_) call a%a%cp_from_lfmt(b,info)
@@ -2574,6 +2577,7 @@ subroutine psb_c_mv_from_l(a,b)
class(psb_lcspmat_type), intent(inout) :: b
integer(psb_ipk_) :: info
info = psb_success_
if (allocated(b%a)) then
if (.not.allocated(a%a)) allocate(psb_c_csr_sparse_mat :: a%a, stat=info)
call a%a%mv_from_lfmt(b%a,info)
@@ -2594,7 +2598,8 @@ subroutine psb_c_cp_from_l(a,b)
class(psb_cspmat_type), intent(out) :: a
class(psb_lcspmat_type), intent(in) :: b
integer(psb_ipk_) :: info
info = psb_success_
if (allocated(b%a)) then
if (.not.allocated(a%a)) allocate(psb_c_csr_sparse_mat :: a%a, stat=info)
call a%a%cp_from_lfmt(b%a,info)
+6 -1
View File
@@ -2508,6 +2508,8 @@ subroutine psb_d_mv_from_lb(a,b)
class(psb_dspmat_type), intent(inout) :: a
class(psb_ld_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
info = psb_success_
if (.not.allocated(a%a)) allocate(psb_d_csr_sparse_mat :: a%a, stat=info)
if (info == psb_success_) call a%a%mv_from_lfmt(b,info)
@@ -2524,6 +2526,7 @@ subroutine psb_d_cp_from_lb(a,b)
class(psb_ld_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
info = psb_success_
if (.not.allocated(a%a)) allocate(psb_d_csr_sparse_mat :: a%a, stat=info)
if (info == psb_success_) call a%a%cp_from_lfmt(b,info)
@@ -2574,6 +2577,7 @@ subroutine psb_d_mv_from_l(a,b)
class(psb_ldspmat_type), intent(inout) :: b
integer(psb_ipk_) :: info
info = psb_success_
if (allocated(b%a)) then
if (.not.allocated(a%a)) allocate(psb_d_csr_sparse_mat :: a%a, stat=info)
call a%a%mv_from_lfmt(b%a,info)
@@ -2594,7 +2598,8 @@ subroutine psb_d_cp_from_l(a,b)
class(psb_dspmat_type), intent(out) :: a
class(psb_ldspmat_type), intent(in) :: b
integer(psb_ipk_) :: info
info = psb_success_
if (allocated(b%a)) then
if (.not.allocated(a%a)) allocate(psb_d_csr_sparse_mat :: a%a, stat=info)
call a%a%cp_from_lfmt(b%a,info)
+6 -1
View File
@@ -2508,6 +2508,8 @@ subroutine psb_s_mv_from_lb(a,b)
class(psb_sspmat_type), intent(inout) :: a
class(psb_ls_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
info = psb_success_
if (.not.allocated(a%a)) allocate(psb_s_csr_sparse_mat :: a%a, stat=info)
if (info == psb_success_) call a%a%mv_from_lfmt(b,info)
@@ -2524,6 +2526,7 @@ subroutine psb_s_cp_from_lb(a,b)
class(psb_ls_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
info = psb_success_
if (.not.allocated(a%a)) allocate(psb_s_csr_sparse_mat :: a%a, stat=info)
if (info == psb_success_) call a%a%cp_from_lfmt(b,info)
@@ -2574,6 +2577,7 @@ subroutine psb_s_mv_from_l(a,b)
class(psb_lsspmat_type), intent(inout) :: b
integer(psb_ipk_) :: info
info = psb_success_
if (allocated(b%a)) then
if (.not.allocated(a%a)) allocate(psb_s_csr_sparse_mat :: a%a, stat=info)
call a%a%mv_from_lfmt(b%a,info)
@@ -2594,7 +2598,8 @@ subroutine psb_s_cp_from_l(a,b)
class(psb_sspmat_type), intent(out) :: a
class(psb_lsspmat_type), intent(in) :: b
integer(psb_ipk_) :: info
info = psb_success_
if (allocated(b%a)) then
if (.not.allocated(a%a)) allocate(psb_s_csr_sparse_mat :: a%a, stat=info)
call a%a%cp_from_lfmt(b%a,info)
+6 -1
View File
@@ -2508,6 +2508,8 @@ subroutine psb_z_mv_from_lb(a,b)
class(psb_zspmat_type), intent(inout) :: a
class(psb_lz_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
info = psb_success_
if (.not.allocated(a%a)) allocate(psb_z_csr_sparse_mat :: a%a, stat=info)
if (info == psb_success_) call a%a%mv_from_lfmt(b,info)
@@ -2524,6 +2526,7 @@ subroutine psb_z_cp_from_lb(a,b)
class(psb_lz_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_) :: info
info = psb_success_
if (.not.allocated(a%a)) allocate(psb_z_csr_sparse_mat :: a%a, stat=info)
if (info == psb_success_) call a%a%cp_from_lfmt(b,info)
@@ -2574,6 +2577,7 @@ subroutine psb_z_mv_from_l(a,b)
class(psb_lzspmat_type), intent(inout) :: b
integer(psb_ipk_) :: info
info = psb_success_
if (allocated(b%a)) then
if (.not.allocated(a%a)) allocate(psb_z_csr_sparse_mat :: a%a, stat=info)
call a%a%mv_from_lfmt(b%a,info)
@@ -2594,7 +2598,8 @@ subroutine psb_z_cp_from_l(a,b)
class(psb_zspmat_type), intent(out) :: a
class(psb_lzspmat_type), intent(in) :: b
integer(psb_ipk_) :: info
info = psb_success_
if (allocated(b%a)) then
if (.not.allocated(a%a)) allocate(psb_z_csr_sparse_mat :: a%a, stat=info)
call a%a%cp_from_lfmt(b%a,info)