diff --git a/base/modules/serial/psb_c_csc_mat_mod.f90 b/base/modules/serial/psb_c_csc_mat_mod.f90 index bb06977b..5ccdd19a 100644 --- a/base/modules/serial/psb_c_csc_mat_mod.f90 +++ b/base/modules/serial/psb_c_csc_mat_mod.f90 @@ -87,7 +87,7 @@ module psb_c_csc_mat_mod procedure, pass(a) :: mv_from_coo => psb_c_mv_csc_from_coo procedure, pass(a) :: mv_to_fmt => psb_c_mv_csc_to_fmt procedure, pass(a) :: mv_from_fmt => psb_c_mv_csc_from_fmt - procedure, pass(a) :: clean_zeros => psb_c_csc_clean_zeros +! procedure, pass(a) :: clean_zeros => psb_c_csc_clean_zeros procedure, pass(a) :: csput_a => psb_c_csc_csput_a procedure, pass(a) :: get_diag => psb_c_csc_get_diag procedure, pass(a) :: csgetptn => psb_c_csc_csgetptn @@ -143,7 +143,7 @@ module psb_c_csc_mat_mod procedure, pass(a) :: mv_from_coo => psb_lc_mv_csc_from_coo procedure, pass(a) :: mv_to_fmt => psb_lc_mv_csc_to_fmt procedure, pass(a) :: mv_from_fmt => psb_lc_mv_csc_from_fmt - procedure, pass(a) :: clean_zeros => psb_lc_csc_clean_zeros +! procedure, pass(a) :: clean_zeros => psb_lc_csc_clean_zeros procedure, pass(a) :: csput_a => psb_lc_csc_csput_a procedure, pass(a) :: get_diag => psb_lc_csc_get_diag procedure, pass(a) :: csgetptn => psb_lc_csc_csgetptn @@ -313,18 +313,18 @@ module psb_c_csc_mat_mod end subroutine psb_c_mv_csc_from_fmt end interface - ! - !> - !! \memberof psb_c_csc_sparse_mat - !! \see psb_c_base_mat_mod::psb_c_base_clean_zeros - ! - interface - subroutine psb_c_csc_clean_zeros(a, info) - import - class(psb_c_csc_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - end subroutine psb_c_csc_clean_zeros - end interface +!!$ ! +!!$ !> +!!$ !! \memberof psb_c_csc_sparse_mat +!!$ !! \see psb_c_base_mat_mod::psb_c_base_clean_zeros +!!$ ! +!!$ interface +!!$ subroutine psb_c_csc_clean_zeros(a, info) +!!$ import +!!$ class(psb_c_csc_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ end subroutine psb_c_csc_clean_zeros +!!$ end interface !> \memberof psb_c_csc_sparse_mat @@ -717,18 +717,18 @@ module psb_c_csc_mat_mod end subroutine psb_lc_mv_csc_from_fmt end interface - ! - !> - !! \memberof psb_lc_csc_sparse_mat - !! \see psb_lc_base_mat_mod::psb_lc_base_clean_zeros - ! - interface - subroutine psb_lc_csc_clean_zeros(a, info) - import - class(psb_lc_csc_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - end subroutine psb_lc_csc_clean_zeros - end interface +!!$ ! +!!$ !> +!!$ !! \memberof psb_lc_csc_sparse_mat +!!$ !! \see psb_lc_base_mat_mod::psb_lc_base_clean_zeros +!!$ ! +!!$ interface +!!$ subroutine psb_lc_csc_clean_zeros(a, info) +!!$ import +!!$ class(psb_lc_csc_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ end subroutine psb_lc_csc_clean_zeros +!!$ end interface !> \memberof psb_lc_csc_sparse_mat !! \see psb_lc_base_mat_mod::psb_lc_base_cp_from diff --git a/base/modules/serial/psb_c_csr_mat_mod.f90 b/base/modules/serial/psb_c_csr_mat_mod.f90 index d09eca2b..a39c204b 100644 --- a/base/modules/serial/psb_c_csr_mat_mod.f90 +++ b/base/modules/serial/psb_c_csr_mat_mod.f90 @@ -91,7 +91,7 @@ module psb_c_csr_mat_mod procedure, pass(a) :: mv_from_coo => psb_c_mv_csr_from_coo procedure, pass(a) :: mv_to_fmt => psb_c_mv_csr_to_fmt procedure, pass(a) :: mv_from_fmt => psb_c_mv_csr_from_fmt - procedure, pass(a) :: clean_zeros => psb_c_csr_clean_zeros +! procedure, pass(a) :: clean_zeros => psb_c_csr_clean_zeros procedure, pass(a) :: csput_a => psb_c_csr_csput_a procedure, pass(a) :: get_diag => psb_c_csr_get_diag procedure, pass(a) :: csgetptn => psb_c_csr_csgetptn @@ -261,18 +261,18 @@ module psb_c_csr_mat_mod end subroutine psb_c_csr_triu end interface - ! - !> - !! \memberof psb_c_csr_sparse_mat - !! \see psb_c_base_mat_mod::psb_c_base_clean_zeros - ! - interface - subroutine psb_c_csr_clean_zeros(a, info) - import - class(psb_c_csr_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - end subroutine psb_c_csr_clean_zeros - end interface +!!$ ! +!!$ !> +!!$ !! \memberof psb_c_csr_sparse_mat +!!$ !! \see psb_c_base_mat_mod::psb_c_base_clean_zeros +!!$ ! +!!$ interface +!!$ subroutine psb_c_csr_clean_zeros(a, info) +!!$ import +!!$ class(psb_c_csr_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ end subroutine psb_c_csr_clean_zeros +!!$ end interface !> \memberof psb_c_csr_sparse_mat !! \see psb_c_base_mat_mod::psb_c_base_cp_to_coo @@ -716,7 +716,7 @@ module psb_c_csr_mat_mod procedure, pass(a) :: mv_from_coo => psb_lc_mv_csr_from_coo procedure, pass(a) :: mv_to_fmt => psb_lc_mv_csr_to_fmt procedure, pass(a) :: mv_from_fmt => psb_lc_mv_csr_from_fmt - procedure, pass(a) :: clean_zeros => psb_lc_csr_clean_zeros +! procedure, pass(a) :: clean_zeros => psb_lc_csr_clean_zeros procedure, pass(a) :: csput_a => psb_lc_csr_csput_a procedure, pass(a) :: get_diag => psb_lc_csr_get_diag procedure, pass(a) :: csgetptn => psb_lc_csr_csgetptn @@ -895,17 +895,17 @@ module psb_c_csr_mat_mod end interface ! - !> - !! \memberof psb_lc_csr_sparse_mat - !! \see psb_lc_base_mat_mod::psb_lc_base_clean_zeros - ! - interface - subroutine psb_lc_csr_clean_zeros(a, info) - import - class(psb_lc_csr_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - end subroutine psb_lc_csr_clean_zeros - end interface +!!$ !> +!!$ !! \memberof psb_lc_csr_sparse_mat +!!$ !! \see psb_lc_base_mat_mod::psb_lc_base_clean_zeros +!!$ ! +!!$ interface +!!$ subroutine psb_lc_csr_clean_zeros(a, info) +!!$ import +!!$ class(psb_lc_csr_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ end subroutine psb_lc_csr_clean_zeros +!!$ end interface diff --git a/base/modules/serial/psb_d_csc_mat_mod.f90 b/base/modules/serial/psb_d_csc_mat_mod.f90 index 60d91bf2..08d31256 100644 --- a/base/modules/serial/psb_d_csc_mat_mod.f90 +++ b/base/modules/serial/psb_d_csc_mat_mod.f90 @@ -87,7 +87,7 @@ module psb_d_csc_mat_mod procedure, pass(a) :: mv_from_coo => psb_d_mv_csc_from_coo procedure, pass(a) :: mv_to_fmt => psb_d_mv_csc_to_fmt procedure, pass(a) :: mv_from_fmt => psb_d_mv_csc_from_fmt - procedure, pass(a) :: clean_zeros => psb_d_csc_clean_zeros +! procedure, pass(a) :: clean_zeros => psb_d_csc_clean_zeros procedure, pass(a) :: csput_a => psb_d_csc_csput_a procedure, pass(a) :: get_diag => psb_d_csc_get_diag procedure, pass(a) :: csgetptn => psb_d_csc_csgetptn @@ -143,7 +143,7 @@ module psb_d_csc_mat_mod procedure, pass(a) :: mv_from_coo => psb_ld_mv_csc_from_coo procedure, pass(a) :: mv_to_fmt => psb_ld_mv_csc_to_fmt procedure, pass(a) :: mv_from_fmt => psb_ld_mv_csc_from_fmt - procedure, pass(a) :: clean_zeros => psb_ld_csc_clean_zeros +! procedure, pass(a) :: clean_zeros => psb_ld_csc_clean_zeros procedure, pass(a) :: csput_a => psb_ld_csc_csput_a procedure, pass(a) :: get_diag => psb_ld_csc_get_diag procedure, pass(a) :: csgetptn => psb_ld_csc_csgetptn @@ -313,18 +313,18 @@ module psb_d_csc_mat_mod end subroutine psb_d_mv_csc_from_fmt end interface - ! - !> - !! \memberof psb_d_csc_sparse_mat - !! \see psb_d_base_mat_mod::psb_d_base_clean_zeros - ! - interface - subroutine psb_d_csc_clean_zeros(a, info) - import - class(psb_d_csc_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_csc_clean_zeros - end interface +!!$ ! +!!$ !> +!!$ !! \memberof psb_d_csc_sparse_mat +!!$ !! \see psb_d_base_mat_mod::psb_d_base_clean_zeros +!!$ ! +!!$ interface +!!$ subroutine psb_d_csc_clean_zeros(a, info) +!!$ import +!!$ class(psb_d_csc_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ end subroutine psb_d_csc_clean_zeros +!!$ end interface !> \memberof psb_d_csc_sparse_mat @@ -717,18 +717,18 @@ module psb_d_csc_mat_mod end subroutine psb_ld_mv_csc_from_fmt end interface - ! - !> - !! \memberof psb_ld_csc_sparse_mat - !! \see psb_ld_base_mat_mod::psb_ld_base_clean_zeros - ! - interface - subroutine psb_ld_csc_clean_zeros(a, info) - import - class(psb_ld_csc_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - end subroutine psb_ld_csc_clean_zeros - end interface +!!$ ! +!!$ !> +!!$ !! \memberof psb_ld_csc_sparse_mat +!!$ !! \see psb_ld_base_mat_mod::psb_ld_base_clean_zeros +!!$ ! +!!$ interface +!!$ subroutine psb_ld_csc_clean_zeros(a, info) +!!$ import +!!$ class(psb_ld_csc_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ end subroutine psb_ld_csc_clean_zeros +!!$ end interface !> \memberof psb_ld_csc_sparse_mat !! \see psb_ld_base_mat_mod::psb_ld_base_cp_from diff --git a/base/modules/serial/psb_d_csr_mat_mod.f90 b/base/modules/serial/psb_d_csr_mat_mod.f90 index 12d71755..0669725f 100644 --- a/base/modules/serial/psb_d_csr_mat_mod.f90 +++ b/base/modules/serial/psb_d_csr_mat_mod.f90 @@ -91,7 +91,7 @@ module psb_d_csr_mat_mod procedure, pass(a) :: mv_from_coo => psb_d_mv_csr_from_coo procedure, pass(a) :: mv_to_fmt => psb_d_mv_csr_to_fmt procedure, pass(a) :: mv_from_fmt => psb_d_mv_csr_from_fmt - procedure, pass(a) :: clean_zeros => psb_d_csr_clean_zeros +! procedure, pass(a) :: clean_zeros => psb_d_csr_clean_zeros procedure, pass(a) :: csput_a => psb_d_csr_csput_a procedure, pass(a) :: get_diag => psb_d_csr_get_diag procedure, pass(a) :: csgetptn => psb_d_csr_csgetptn @@ -261,18 +261,18 @@ module psb_d_csr_mat_mod end subroutine psb_d_csr_triu end interface - ! - !> - !! \memberof psb_d_csr_sparse_mat - !! \see psb_d_base_mat_mod::psb_d_base_clean_zeros - ! - interface - subroutine psb_d_csr_clean_zeros(a, info) - import - class(psb_d_csr_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_csr_clean_zeros - end interface +!!$ ! +!!$ !> +!!$ !! \memberof psb_d_csr_sparse_mat +!!$ !! \see psb_d_base_mat_mod::psb_d_base_clean_zeros +!!$ ! +!!$ interface +!!$ subroutine psb_d_csr_clean_zeros(a, info) +!!$ import +!!$ class(psb_d_csr_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ end subroutine psb_d_csr_clean_zeros +!!$ end interface !> \memberof psb_d_csr_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_cp_to_coo @@ -716,7 +716,7 @@ module psb_d_csr_mat_mod procedure, pass(a) :: mv_from_coo => psb_ld_mv_csr_from_coo procedure, pass(a) :: mv_to_fmt => psb_ld_mv_csr_to_fmt procedure, pass(a) :: mv_from_fmt => psb_ld_mv_csr_from_fmt - procedure, pass(a) :: clean_zeros => psb_ld_csr_clean_zeros +! procedure, pass(a) :: clean_zeros => psb_ld_csr_clean_zeros procedure, pass(a) :: csput_a => psb_ld_csr_csput_a procedure, pass(a) :: get_diag => psb_ld_csr_get_diag procedure, pass(a) :: csgetptn => psb_ld_csr_csgetptn @@ -895,17 +895,17 @@ module psb_d_csr_mat_mod end interface ! - !> - !! \memberof psb_ld_csr_sparse_mat - !! \see psb_ld_base_mat_mod::psb_ld_base_clean_zeros - ! - interface - subroutine psb_ld_csr_clean_zeros(a, info) - import - class(psb_ld_csr_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - end subroutine psb_ld_csr_clean_zeros - end interface +!!$ !> +!!$ !! \memberof psb_ld_csr_sparse_mat +!!$ !! \see psb_ld_base_mat_mod::psb_ld_base_clean_zeros +!!$ ! +!!$ interface +!!$ subroutine psb_ld_csr_clean_zeros(a, info) +!!$ import +!!$ class(psb_ld_csr_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ end subroutine psb_ld_csr_clean_zeros +!!$ end interface diff --git a/base/modules/serial/psb_s_csc_mat_mod.f90 b/base/modules/serial/psb_s_csc_mat_mod.f90 index ccd4f445..db874600 100644 --- a/base/modules/serial/psb_s_csc_mat_mod.f90 +++ b/base/modules/serial/psb_s_csc_mat_mod.f90 @@ -87,7 +87,7 @@ module psb_s_csc_mat_mod procedure, pass(a) :: mv_from_coo => psb_s_mv_csc_from_coo procedure, pass(a) :: mv_to_fmt => psb_s_mv_csc_to_fmt procedure, pass(a) :: mv_from_fmt => psb_s_mv_csc_from_fmt - procedure, pass(a) :: clean_zeros => psb_s_csc_clean_zeros +! procedure, pass(a) :: clean_zeros => psb_s_csc_clean_zeros procedure, pass(a) :: csput_a => psb_s_csc_csput_a procedure, pass(a) :: get_diag => psb_s_csc_get_diag procedure, pass(a) :: csgetptn => psb_s_csc_csgetptn @@ -143,7 +143,7 @@ module psb_s_csc_mat_mod procedure, pass(a) :: mv_from_coo => psb_ls_mv_csc_from_coo procedure, pass(a) :: mv_to_fmt => psb_ls_mv_csc_to_fmt procedure, pass(a) :: mv_from_fmt => psb_ls_mv_csc_from_fmt - procedure, pass(a) :: clean_zeros => psb_ls_csc_clean_zeros +! procedure, pass(a) :: clean_zeros => psb_ls_csc_clean_zeros procedure, pass(a) :: csput_a => psb_ls_csc_csput_a procedure, pass(a) :: get_diag => psb_ls_csc_get_diag procedure, pass(a) :: csgetptn => psb_ls_csc_csgetptn @@ -313,18 +313,18 @@ module psb_s_csc_mat_mod end subroutine psb_s_mv_csc_from_fmt end interface - ! - !> - !! \memberof psb_s_csc_sparse_mat - !! \see psb_s_base_mat_mod::psb_s_base_clean_zeros - ! - interface - subroutine psb_s_csc_clean_zeros(a, info) - import - class(psb_s_csc_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - end subroutine psb_s_csc_clean_zeros - end interface +!!$ ! +!!$ !> +!!$ !! \memberof psb_s_csc_sparse_mat +!!$ !! \see psb_s_base_mat_mod::psb_s_base_clean_zeros +!!$ ! +!!$ interface +!!$ subroutine psb_s_csc_clean_zeros(a, info) +!!$ import +!!$ class(psb_s_csc_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ end subroutine psb_s_csc_clean_zeros +!!$ end interface !> \memberof psb_s_csc_sparse_mat @@ -717,18 +717,18 @@ module psb_s_csc_mat_mod end subroutine psb_ls_mv_csc_from_fmt end interface - ! - !> - !! \memberof psb_ls_csc_sparse_mat - !! \see psb_ls_base_mat_mod::psb_ls_base_clean_zeros - ! - interface - subroutine psb_ls_csc_clean_zeros(a, info) - import - class(psb_ls_csc_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - end subroutine psb_ls_csc_clean_zeros - end interface +!!$ ! +!!$ !> +!!$ !! \memberof psb_ls_csc_sparse_mat +!!$ !! \see psb_ls_base_mat_mod::psb_ls_base_clean_zeros +!!$ ! +!!$ interface +!!$ subroutine psb_ls_csc_clean_zeros(a, info) +!!$ import +!!$ class(psb_ls_csc_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ end subroutine psb_ls_csc_clean_zeros +!!$ end interface !> \memberof psb_ls_csc_sparse_mat !! \see psb_ls_base_mat_mod::psb_ls_base_cp_from diff --git a/base/modules/serial/psb_s_csr_mat_mod.f90 b/base/modules/serial/psb_s_csr_mat_mod.f90 index 884ede38..356e5b32 100644 --- a/base/modules/serial/psb_s_csr_mat_mod.f90 +++ b/base/modules/serial/psb_s_csr_mat_mod.f90 @@ -91,7 +91,7 @@ module psb_s_csr_mat_mod procedure, pass(a) :: mv_from_coo => psb_s_mv_csr_from_coo procedure, pass(a) :: mv_to_fmt => psb_s_mv_csr_to_fmt procedure, pass(a) :: mv_from_fmt => psb_s_mv_csr_from_fmt - procedure, pass(a) :: clean_zeros => psb_s_csr_clean_zeros +! procedure, pass(a) :: clean_zeros => psb_s_csr_clean_zeros procedure, pass(a) :: csput_a => psb_s_csr_csput_a procedure, pass(a) :: get_diag => psb_s_csr_get_diag procedure, pass(a) :: csgetptn => psb_s_csr_csgetptn @@ -261,18 +261,18 @@ module psb_s_csr_mat_mod end subroutine psb_s_csr_triu end interface - ! - !> - !! \memberof psb_s_csr_sparse_mat - !! \see psb_s_base_mat_mod::psb_s_base_clean_zeros - ! - interface - subroutine psb_s_csr_clean_zeros(a, info) - import - class(psb_s_csr_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - end subroutine psb_s_csr_clean_zeros - end interface +!!$ ! +!!$ !> +!!$ !! \memberof psb_s_csr_sparse_mat +!!$ !! \see psb_s_base_mat_mod::psb_s_base_clean_zeros +!!$ ! +!!$ interface +!!$ subroutine psb_s_csr_clean_zeros(a, info) +!!$ import +!!$ class(psb_s_csr_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ end subroutine psb_s_csr_clean_zeros +!!$ end interface !> \memberof psb_s_csr_sparse_mat !! \see psb_s_base_mat_mod::psb_s_base_cp_to_coo @@ -716,7 +716,7 @@ module psb_s_csr_mat_mod procedure, pass(a) :: mv_from_coo => psb_ls_mv_csr_from_coo procedure, pass(a) :: mv_to_fmt => psb_ls_mv_csr_to_fmt procedure, pass(a) :: mv_from_fmt => psb_ls_mv_csr_from_fmt - procedure, pass(a) :: clean_zeros => psb_ls_csr_clean_zeros +! procedure, pass(a) :: clean_zeros => psb_ls_csr_clean_zeros procedure, pass(a) :: csput_a => psb_ls_csr_csput_a procedure, pass(a) :: get_diag => psb_ls_csr_get_diag procedure, pass(a) :: csgetptn => psb_ls_csr_csgetptn @@ -895,17 +895,17 @@ module psb_s_csr_mat_mod end interface ! - !> - !! \memberof psb_ls_csr_sparse_mat - !! \see psb_ls_base_mat_mod::psb_ls_base_clean_zeros - ! - interface - subroutine psb_ls_csr_clean_zeros(a, info) - import - class(psb_ls_csr_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - end subroutine psb_ls_csr_clean_zeros - end interface +!!$ !> +!!$ !! \memberof psb_ls_csr_sparse_mat +!!$ !! \see psb_ls_base_mat_mod::psb_ls_base_clean_zeros +!!$ ! +!!$ interface +!!$ subroutine psb_ls_csr_clean_zeros(a, info) +!!$ import +!!$ class(psb_ls_csr_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ end subroutine psb_ls_csr_clean_zeros +!!$ end interface diff --git a/base/modules/serial/psb_z_csc_mat_mod.f90 b/base/modules/serial/psb_z_csc_mat_mod.f90 index 222742eb..b9828f59 100644 --- a/base/modules/serial/psb_z_csc_mat_mod.f90 +++ b/base/modules/serial/psb_z_csc_mat_mod.f90 @@ -87,7 +87,7 @@ module psb_z_csc_mat_mod procedure, pass(a) :: mv_from_coo => psb_z_mv_csc_from_coo procedure, pass(a) :: mv_to_fmt => psb_z_mv_csc_to_fmt procedure, pass(a) :: mv_from_fmt => psb_z_mv_csc_from_fmt - procedure, pass(a) :: clean_zeros => psb_z_csc_clean_zeros +! procedure, pass(a) :: clean_zeros => psb_z_csc_clean_zeros procedure, pass(a) :: csput_a => psb_z_csc_csput_a procedure, pass(a) :: get_diag => psb_z_csc_get_diag procedure, pass(a) :: csgetptn => psb_z_csc_csgetptn @@ -143,7 +143,7 @@ module psb_z_csc_mat_mod procedure, pass(a) :: mv_from_coo => psb_lz_mv_csc_from_coo procedure, pass(a) :: mv_to_fmt => psb_lz_mv_csc_to_fmt procedure, pass(a) :: mv_from_fmt => psb_lz_mv_csc_from_fmt - procedure, pass(a) :: clean_zeros => psb_lz_csc_clean_zeros +! procedure, pass(a) :: clean_zeros => psb_lz_csc_clean_zeros procedure, pass(a) :: csput_a => psb_lz_csc_csput_a procedure, pass(a) :: get_diag => psb_lz_csc_get_diag procedure, pass(a) :: csgetptn => psb_lz_csc_csgetptn @@ -313,18 +313,18 @@ module psb_z_csc_mat_mod end subroutine psb_z_mv_csc_from_fmt end interface - ! - !> - !! \memberof psb_z_csc_sparse_mat - !! \see psb_z_base_mat_mod::psb_z_base_clean_zeros - ! - interface - subroutine psb_z_csc_clean_zeros(a, info) - import - class(psb_z_csc_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - end subroutine psb_z_csc_clean_zeros - end interface +!!$ ! +!!$ !> +!!$ !! \memberof psb_z_csc_sparse_mat +!!$ !! \see psb_z_base_mat_mod::psb_z_base_clean_zeros +!!$ ! +!!$ interface +!!$ subroutine psb_z_csc_clean_zeros(a, info) +!!$ import +!!$ class(psb_z_csc_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ end subroutine psb_z_csc_clean_zeros +!!$ end interface !> \memberof psb_z_csc_sparse_mat @@ -717,18 +717,18 @@ module psb_z_csc_mat_mod end subroutine psb_lz_mv_csc_from_fmt end interface - ! - !> - !! \memberof psb_lz_csc_sparse_mat - !! \see psb_lz_base_mat_mod::psb_lz_base_clean_zeros - ! - interface - subroutine psb_lz_csc_clean_zeros(a, info) - import - class(psb_lz_csc_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - end subroutine psb_lz_csc_clean_zeros - end interface +!!$ ! +!!$ !> +!!$ !! \memberof psb_lz_csc_sparse_mat +!!$ !! \see psb_lz_base_mat_mod::psb_lz_base_clean_zeros +!!$ ! +!!$ interface +!!$ subroutine psb_lz_csc_clean_zeros(a, info) +!!$ import +!!$ class(psb_lz_csc_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ end subroutine psb_lz_csc_clean_zeros +!!$ end interface !> \memberof psb_lz_csc_sparse_mat !! \see psb_lz_base_mat_mod::psb_lz_base_cp_from diff --git a/base/modules/serial/psb_z_csr_mat_mod.f90 b/base/modules/serial/psb_z_csr_mat_mod.f90 index c328fead..0bc66bcc 100644 --- a/base/modules/serial/psb_z_csr_mat_mod.f90 +++ b/base/modules/serial/psb_z_csr_mat_mod.f90 @@ -91,7 +91,7 @@ module psb_z_csr_mat_mod procedure, pass(a) :: mv_from_coo => psb_z_mv_csr_from_coo procedure, pass(a) :: mv_to_fmt => psb_z_mv_csr_to_fmt procedure, pass(a) :: mv_from_fmt => psb_z_mv_csr_from_fmt - procedure, pass(a) :: clean_zeros => psb_z_csr_clean_zeros +! procedure, pass(a) :: clean_zeros => psb_z_csr_clean_zeros procedure, pass(a) :: csput_a => psb_z_csr_csput_a procedure, pass(a) :: get_diag => psb_z_csr_get_diag procedure, pass(a) :: csgetptn => psb_z_csr_csgetptn @@ -261,18 +261,18 @@ module psb_z_csr_mat_mod end subroutine psb_z_csr_triu end interface - ! - !> - !! \memberof psb_z_csr_sparse_mat - !! \see psb_z_base_mat_mod::psb_z_base_clean_zeros - ! - interface - subroutine psb_z_csr_clean_zeros(a, info) - import - class(psb_z_csr_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - end subroutine psb_z_csr_clean_zeros - end interface +!!$ ! +!!$ !> +!!$ !! \memberof psb_z_csr_sparse_mat +!!$ !! \see psb_z_base_mat_mod::psb_z_base_clean_zeros +!!$ ! +!!$ interface +!!$ subroutine psb_z_csr_clean_zeros(a, info) +!!$ import +!!$ class(psb_z_csr_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ end subroutine psb_z_csr_clean_zeros +!!$ end interface !> \memberof psb_z_csr_sparse_mat !! \see psb_z_base_mat_mod::psb_z_base_cp_to_coo @@ -716,7 +716,7 @@ module psb_z_csr_mat_mod procedure, pass(a) :: mv_from_coo => psb_lz_mv_csr_from_coo procedure, pass(a) :: mv_to_fmt => psb_lz_mv_csr_to_fmt procedure, pass(a) :: mv_from_fmt => psb_lz_mv_csr_from_fmt - procedure, pass(a) :: clean_zeros => psb_lz_csr_clean_zeros +! procedure, pass(a) :: clean_zeros => psb_lz_csr_clean_zeros procedure, pass(a) :: csput_a => psb_lz_csr_csput_a procedure, pass(a) :: get_diag => psb_lz_csr_get_diag procedure, pass(a) :: csgetptn => psb_lz_csr_csgetptn @@ -895,17 +895,17 @@ module psb_z_csr_mat_mod end interface ! - !> - !! \memberof psb_lz_csr_sparse_mat - !! \see psb_lz_base_mat_mod::psb_lz_base_clean_zeros - ! - interface - subroutine psb_lz_csr_clean_zeros(a, info) - import - class(psb_lz_csr_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - end subroutine psb_lz_csr_clean_zeros - end interface +!!$ !> +!!$ !! \memberof psb_lz_csr_sparse_mat +!!$ !! \see psb_lz_base_mat_mod::psb_lz_base_clean_zeros +!!$ ! +!!$ interface +!!$ subroutine psb_lz_csr_clean_zeros(a, info) +!!$ import +!!$ class(psb_lz_csr_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ end subroutine psb_lz_csr_clean_zeros +!!$ end interface diff --git a/base/serial/impl/psb_c_coo_impl.F90 b/base/serial/impl/psb_c_coo_impl.F90 index a56a79a4..2ef9af89 100644 --- a/base/serial/impl/psb_c_coo_impl.F90 +++ b/base/serial/impl/psb_c_coo_impl.F90 @@ -609,6 +609,7 @@ subroutine psb_c_coo_clean_zeros(a, info) end if end do call a%set_nzeros(j) + call a%fix(info) call a%trim() end subroutine psb_c_coo_clean_zeros diff --git a/base/serial/impl/psb_c_csc_impl.F90 b/base/serial/impl/psb_c_csc_impl.F90 index 7916d954..787334ab 100644 --- a/base/serial/impl/psb_c_csc_impl.F90 +++ b/base/serial/impl/psb_c_csc_impl.F90 @@ -2403,36 +2403,36 @@ subroutine psb_c_mv_csc_from_fmt(a,b,info) end subroutine psb_c_mv_csc_from_fmt -subroutine psb_c_csc_clean_zeros(a, info) - use psb_error_mod - use psb_c_csc_mat_mod, psb_protect_name => psb_c_csc_clean_zeros - implicit none - class(psb_c_csc_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - ! - integer(psb_ipk_) :: i, j, k, nc - integer(psb_ipk_), allocatable :: ilcp(:) - - info = 0 - call a%sync() - nc = a%get_ncols() - ilcp = a%icp - a%icp(1) = 1 - j = a%icp(1) - do i=1, nc - do k = ilcp(i), ilcp(i+1) -1 - ! Always keep the diagonal, even if numerically zero - if ((a%val(k) /= czero).or.(i == a%ia(k))) then - a%val(j) = a%val(k) - a%ia(j) = a%ia(k) - j = j + 1 - end if - end do - a%icp(i+1) = j - end do - call a%trim() - call a%set_host() -end subroutine psb_c_csc_clean_zeros +!!$subroutine psb_c_csc_clean_zeros(a, info) +!!$ use psb_error_mod +!!$ use psb_c_csc_mat_mod, psb_protect_name => psb_c_csc_clean_zeros +!!$ implicit none +!!$ class(psb_c_csc_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ ! +!!$ integer(psb_ipk_) :: i, j, k, nc +!!$ integer(psb_ipk_), allocatable :: ilcp(:) +!!$ +!!$ info = 0 +!!$ call a%sync() +!!$ nc = a%get_ncols() +!!$ ilcp = a%icp +!!$ a%icp(1) = 1 +!!$ j = a%icp(1) +!!$ do i=1, nc +!!$ do k = ilcp(i), ilcp(i+1) -1 +!!$ ! Always keep the diagonal, even if numerically zero +!!$ if ((a%val(k) /= czero).or.(i == a%ia(k))) then +!!$ a%val(j) = a%val(k) +!!$ a%ia(j) = a%ia(k) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ a%icp(i+1) = j +!!$ end do +!!$ call a%trim() +!!$ call a%set_host() +!!$end subroutine psb_c_csc_clean_zeros subroutine psb_c_cp_csc_from_fmt(a,b,info) use psb_const_mod @@ -4305,36 +4305,36 @@ subroutine psb_lc_cp_csc_from_fmt(a,b,info) end subroutine psb_lc_cp_csc_from_fmt -subroutine psb_lc_csc_clean_zeros(a, info) - use psb_error_mod - use psb_c_csc_mat_mod, psb_protect_name => psb_lc_csc_clean_zeros - implicit none - class(psb_lc_csc_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - ! - integer(psb_lpk_) :: i, j, k, nc - integer(psb_lpk_), allocatable :: ilcp(:) - - info = 0 - call a%sync() - nc = a%get_ncols() - ilcp = a%icp - a%icp(1) = 1 - j = a%icp(1) - do i=1, nc - do k = ilcp(i), ilcp(i+1) -1 - ! Always keep the diagonal, even if numerically zero - if ((a%val(k) /= czero).or.(i == a%ia(k))) then - a%val(j) = a%val(k) - a%ia(j) = a%ia(k) - j = j + 1 - end if - end do - a%icp(i+1) = j - end do - call a%trim() - call a%set_host() -end subroutine psb_lc_csc_clean_zeros +!!$subroutine psb_lc_csc_clean_zeros(a, info) +!!$ use psb_error_mod +!!$ use psb_c_csc_mat_mod, psb_protect_name => psb_lc_csc_clean_zeros +!!$ implicit none +!!$ class(psb_lc_csc_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ ! +!!$ integer(psb_lpk_) :: i, j, k, nc +!!$ integer(psb_lpk_), allocatable :: ilcp(:) +!!$ +!!$ info = 0 +!!$ call a%sync() +!!$ nc = a%get_ncols() +!!$ ilcp = a%icp +!!$ a%icp(1) = 1 +!!$ j = a%icp(1) +!!$ do i=1, nc +!!$ do k = ilcp(i), ilcp(i+1) -1 +!!$ ! Always keep the diagonal, even if numerically zero +!!$ if ((a%val(k) /= czero).or.(i == a%ia(k))) then +!!$ a%val(j) = a%val(k) +!!$ a%ia(j) = a%ia(k) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ a%icp(i+1) = j +!!$ end do +!!$ call a%trim() +!!$ call a%set_host() +!!$end subroutine psb_lc_csc_clean_zeros subroutine psb_lc_csc_mold(a,b,info) diff --git a/base/serial/impl/psb_c_csr_impl.F90 b/base/serial/impl/psb_c_csr_impl.F90 index 6a31e522..6fde6980 100644 --- a/base/serial/impl/psb_c_csr_impl.F90 +++ b/base/serial/impl/psb_c_csr_impl.F90 @@ -3624,36 +3624,36 @@ subroutine psb_c_cp_csr_from_fmt(a,b,info) end select end subroutine psb_c_cp_csr_from_fmt -subroutine psb_c_csr_clean_zeros(a, info) - use psb_error_mod - use psb_c_csr_mat_mod, psb_protect_name => psb_c_csr_clean_zeros - implicit none - class(psb_c_csr_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - ! - integer(psb_ipk_) :: i, j, k, nr - integer(psb_ipk_), allocatable :: ilrp(:) - - info = 0 - call a%sync() - nr = a%get_nrows() - ilrp = a%irp - a%irp(1) = 1 - j = a%irp(1) - do i=1, nr - do k = ilrp(i), ilrp(i+1) -1 - ! Always keep the diagonal, even if numerically zero - if ((a%val(k) /= czero).or.(i == a%ja(k))) then - a%val(j) = a%val(k) - a%ja(j) = a%ja(k) - j = j + 1 - end if - end do - a%irp(i+1) = j - end do - call a%trim() - call a%set_host() -end subroutine psb_c_csr_clean_zeros +!!$subroutine psb_c_csr_clean_zeros(a, info) +!!$ use psb_error_mod +!!$ use psb_c_csr_mat_mod, psb_protect_name => psb_c_csr_clean_zeros +!!$ implicit none +!!$ class(psb_c_csr_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ ! +!!$ integer(psb_ipk_) :: i, j, k, nr +!!$ integer(psb_ipk_), allocatable :: ilrp(:) +!!$ +!!$ info = 0 +!!$ call a%sync() +!!$ nr = a%get_nrows() +!!$ ilrp = a%irp +!!$ a%irp(1) = 1 +!!$ j = a%irp(1) +!!$ do i=1, nr +!!$ do k = ilrp(i), ilrp(i+1) -1 +!!$ ! Always keep the diagonal, even if numerically zero +!!$ if ((a%val(k) /= czero).or.(i == a%ja(k))) then +!!$ a%val(j) = a%val(k) +!!$ a%ja(j) = a%ja(k) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ a%irp(i+1) = j +!!$ end do +!!$ call a%trim() +!!$ call a%set_host() +!!$end subroutine psb_c_csr_clean_zeros #if defined(OPENMP) subroutine psb_ccsrspspmm(a,b,c,info) @@ -6544,36 +6544,36 @@ subroutine psb_lc_cp_csr_from_fmt(a,b,info) end subroutine psb_lc_cp_csr_from_fmt -subroutine psb_lc_csr_clean_zeros(a, info) - use psb_error_mod - use psb_c_csr_mat_mod, psb_protect_name => psb_lc_csr_clean_zeros - implicit none - class(psb_lc_csr_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - ! - integer(psb_lpk_) :: i, j, k, nr - integer(psb_lpk_), allocatable :: ilrp(:) - - info = 0 - call a%sync() - nr = a%get_nrows() - ilrp = a%irp - a%irp(1) = 1 - j = a%irp(1) - do i=1, nr - do k = ilrp(i), ilrp(i+1) -1 - ! Always keep the diagonal, even if numerically zero - if ((a%val(k) /= czero).or.(i == a%ja(k))) then - a%val(j) = a%val(k) - a%ja(j) = a%ja(k) - j = j + 1 - end if - end do - a%irp(i+1) = j - end do - call a%trim() - call a%set_host() -end subroutine psb_lc_csr_clean_zeros +!!$subroutine psb_lc_csr_clean_zeros(a, info) +!!$ use psb_error_mod +!!$ use psb_c_csr_mat_mod, psb_protect_name => psb_lc_csr_clean_zeros +!!$ implicit none +!!$ class(psb_lc_csr_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ ! +!!$ integer(psb_lpk_) :: i, j, k, nr +!!$ integer(psb_lpk_), allocatable :: ilrp(:) +!!$ +!!$ info = 0 +!!$ call a%sync() +!!$ nr = a%get_nrows() +!!$ ilrp = a%irp +!!$ a%irp(1) = 1 +!!$ j = a%irp(1) +!!$ do i=1, nr +!!$ do k = ilrp(i), ilrp(i+1) -1 +!!$ ! Always keep the diagonal, even if numerically zero +!!$ if ((a%val(k) /= czero).or.(i == a%ja(k))) then +!!$ a%val(j) = a%val(k) +!!$ a%ja(j) = a%ja(k) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ a%irp(i+1) = j +!!$ end do +!!$ call a%trim() +!!$ call a%set_host() +!!$end subroutine psb_lc_csr_clean_zeros subroutine psb_lccsrspspmm(a,b,c,info) use psb_c_mat_mod diff --git a/base/serial/impl/psb_d_coo_impl.F90 b/base/serial/impl/psb_d_coo_impl.F90 index e3e7b42c..743ae3a3 100644 --- a/base/serial/impl/psb_d_coo_impl.F90 +++ b/base/serial/impl/psb_d_coo_impl.F90 @@ -609,6 +609,7 @@ subroutine psb_d_coo_clean_zeros(a, info) end if end do call a%set_nzeros(j) + call a%fix(info) call a%trim() end subroutine psb_d_coo_clean_zeros diff --git a/base/serial/impl/psb_d_csc_impl.F90 b/base/serial/impl/psb_d_csc_impl.F90 index 886add04..129d2a73 100644 --- a/base/serial/impl/psb_d_csc_impl.F90 +++ b/base/serial/impl/psb_d_csc_impl.F90 @@ -2403,36 +2403,36 @@ subroutine psb_d_mv_csc_from_fmt(a,b,info) end subroutine psb_d_mv_csc_from_fmt -subroutine psb_d_csc_clean_zeros(a, info) - use psb_error_mod - use psb_d_csc_mat_mod, psb_protect_name => psb_d_csc_clean_zeros - implicit none - class(psb_d_csc_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - ! - integer(psb_ipk_) :: i, j, k, nc - integer(psb_ipk_), allocatable :: ilcp(:) - - info = 0 - call a%sync() - nc = a%get_ncols() - ilcp = a%icp - a%icp(1) = 1 - j = a%icp(1) - do i=1, nc - do k = ilcp(i), ilcp(i+1) -1 - ! Always keep the diagonal, even if numerically zero - if ((a%val(k) /= dzero).or.(i == a%ia(k))) then - a%val(j) = a%val(k) - a%ia(j) = a%ia(k) - j = j + 1 - end if - end do - a%icp(i+1) = j - end do - call a%trim() - call a%set_host() -end subroutine psb_d_csc_clean_zeros +!!$subroutine psb_d_csc_clean_zeros(a, info) +!!$ use psb_error_mod +!!$ use psb_d_csc_mat_mod, psb_protect_name => psb_d_csc_clean_zeros +!!$ implicit none +!!$ class(psb_d_csc_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ ! +!!$ integer(psb_ipk_) :: i, j, k, nc +!!$ integer(psb_ipk_), allocatable :: ilcp(:) +!!$ +!!$ info = 0 +!!$ call a%sync() +!!$ nc = a%get_ncols() +!!$ ilcp = a%icp +!!$ a%icp(1) = 1 +!!$ j = a%icp(1) +!!$ do i=1, nc +!!$ do k = ilcp(i), ilcp(i+1) -1 +!!$ ! Always keep the diagonal, even if numerically zero +!!$ if ((a%val(k) /= dzero).or.(i == a%ia(k))) then +!!$ a%val(j) = a%val(k) +!!$ a%ia(j) = a%ia(k) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ a%icp(i+1) = j +!!$ end do +!!$ call a%trim() +!!$ call a%set_host() +!!$end subroutine psb_d_csc_clean_zeros subroutine psb_d_cp_csc_from_fmt(a,b,info) use psb_const_mod @@ -4305,36 +4305,36 @@ subroutine psb_ld_cp_csc_from_fmt(a,b,info) end subroutine psb_ld_cp_csc_from_fmt -subroutine psb_ld_csc_clean_zeros(a, info) - use psb_error_mod - use psb_d_csc_mat_mod, psb_protect_name => psb_ld_csc_clean_zeros - implicit none - class(psb_ld_csc_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - ! - integer(psb_lpk_) :: i, j, k, nc - integer(psb_lpk_), allocatable :: ilcp(:) - - info = 0 - call a%sync() - nc = a%get_ncols() - ilcp = a%icp - a%icp(1) = 1 - j = a%icp(1) - do i=1, nc - do k = ilcp(i), ilcp(i+1) -1 - ! Always keep the diagonal, even if numerically zero - if ((a%val(k) /= dzero).or.(i == a%ia(k))) then - a%val(j) = a%val(k) - a%ia(j) = a%ia(k) - j = j + 1 - end if - end do - a%icp(i+1) = j - end do - call a%trim() - call a%set_host() -end subroutine psb_ld_csc_clean_zeros +!!$subroutine psb_ld_csc_clean_zeros(a, info) +!!$ use psb_error_mod +!!$ use psb_d_csc_mat_mod, psb_protect_name => psb_ld_csc_clean_zeros +!!$ implicit none +!!$ class(psb_ld_csc_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ ! +!!$ integer(psb_lpk_) :: i, j, k, nc +!!$ integer(psb_lpk_), allocatable :: ilcp(:) +!!$ +!!$ info = 0 +!!$ call a%sync() +!!$ nc = a%get_ncols() +!!$ ilcp = a%icp +!!$ a%icp(1) = 1 +!!$ j = a%icp(1) +!!$ do i=1, nc +!!$ do k = ilcp(i), ilcp(i+1) -1 +!!$ ! Always keep the diagonal, even if numerically zero +!!$ if ((a%val(k) /= dzero).or.(i == a%ia(k))) then +!!$ a%val(j) = a%val(k) +!!$ a%ia(j) = a%ia(k) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ a%icp(i+1) = j +!!$ end do +!!$ call a%trim() +!!$ call a%set_host() +!!$end subroutine psb_ld_csc_clean_zeros subroutine psb_ld_csc_mold(a,b,info) diff --git a/base/serial/impl/psb_d_csr_impl.F90 b/base/serial/impl/psb_d_csr_impl.F90 index f5891870..d2651e0b 100644 --- a/base/serial/impl/psb_d_csr_impl.F90 +++ b/base/serial/impl/psb_d_csr_impl.F90 @@ -3624,36 +3624,36 @@ subroutine psb_d_cp_csr_from_fmt(a,b,info) end select end subroutine psb_d_cp_csr_from_fmt -subroutine psb_d_csr_clean_zeros(a, info) - use psb_error_mod - use psb_d_csr_mat_mod, psb_protect_name => psb_d_csr_clean_zeros - implicit none - class(psb_d_csr_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - ! - integer(psb_ipk_) :: i, j, k, nr - integer(psb_ipk_), allocatable :: ilrp(:) - - info = 0 - call a%sync() - nr = a%get_nrows() - ilrp = a%irp - a%irp(1) = 1 - j = a%irp(1) - do i=1, nr - do k = ilrp(i), ilrp(i+1) -1 - ! Always keep the diagonal, even if numerically zero - if ((a%val(k) /= dzero).or.(i == a%ja(k))) then - a%val(j) = a%val(k) - a%ja(j) = a%ja(k) - j = j + 1 - end if - end do - a%irp(i+1) = j - end do - call a%trim() - call a%set_host() -end subroutine psb_d_csr_clean_zeros +!!$subroutine psb_d_csr_clean_zeros(a, info) +!!$ use psb_error_mod +!!$ use psb_d_csr_mat_mod, psb_protect_name => psb_d_csr_clean_zeros +!!$ implicit none +!!$ class(psb_d_csr_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ ! +!!$ integer(psb_ipk_) :: i, j, k, nr +!!$ integer(psb_ipk_), allocatable :: ilrp(:) +!!$ +!!$ info = 0 +!!$ call a%sync() +!!$ nr = a%get_nrows() +!!$ ilrp = a%irp +!!$ a%irp(1) = 1 +!!$ j = a%irp(1) +!!$ do i=1, nr +!!$ do k = ilrp(i), ilrp(i+1) -1 +!!$ ! Always keep the diagonal, even if numerically zero +!!$ if ((a%val(k) /= dzero).or.(i == a%ja(k))) then +!!$ a%val(j) = a%val(k) +!!$ a%ja(j) = a%ja(k) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ a%irp(i+1) = j +!!$ end do +!!$ call a%trim() +!!$ call a%set_host() +!!$end subroutine psb_d_csr_clean_zeros #if defined(OPENMP) subroutine psb_dcsrspspmm(a,b,c,info) @@ -6544,36 +6544,36 @@ subroutine psb_ld_cp_csr_from_fmt(a,b,info) end subroutine psb_ld_cp_csr_from_fmt -subroutine psb_ld_csr_clean_zeros(a, info) - use psb_error_mod - use psb_d_csr_mat_mod, psb_protect_name => psb_ld_csr_clean_zeros - implicit none - class(psb_ld_csr_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - ! - integer(psb_lpk_) :: i, j, k, nr - integer(psb_lpk_), allocatable :: ilrp(:) - - info = 0 - call a%sync() - nr = a%get_nrows() - ilrp = a%irp - a%irp(1) = 1 - j = a%irp(1) - do i=1, nr - do k = ilrp(i), ilrp(i+1) -1 - ! Always keep the diagonal, even if numerically zero - if ((a%val(k) /= dzero).or.(i == a%ja(k))) then - a%val(j) = a%val(k) - a%ja(j) = a%ja(k) - j = j + 1 - end if - end do - a%irp(i+1) = j - end do - call a%trim() - call a%set_host() -end subroutine psb_ld_csr_clean_zeros +!!$subroutine psb_ld_csr_clean_zeros(a, info) +!!$ use psb_error_mod +!!$ use psb_d_csr_mat_mod, psb_protect_name => psb_ld_csr_clean_zeros +!!$ implicit none +!!$ class(psb_ld_csr_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ ! +!!$ integer(psb_lpk_) :: i, j, k, nr +!!$ integer(psb_lpk_), allocatable :: ilrp(:) +!!$ +!!$ info = 0 +!!$ call a%sync() +!!$ nr = a%get_nrows() +!!$ ilrp = a%irp +!!$ a%irp(1) = 1 +!!$ j = a%irp(1) +!!$ do i=1, nr +!!$ do k = ilrp(i), ilrp(i+1) -1 +!!$ ! Always keep the diagonal, even if numerically zero +!!$ if ((a%val(k) /= dzero).or.(i == a%ja(k))) then +!!$ a%val(j) = a%val(k) +!!$ a%ja(j) = a%ja(k) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ a%irp(i+1) = j +!!$ end do +!!$ call a%trim() +!!$ call a%set_host() +!!$end subroutine psb_ld_csr_clean_zeros subroutine psb_ldcsrspspmm(a,b,c,info) use psb_d_mat_mod diff --git a/base/serial/impl/psb_s_coo_impl.F90 b/base/serial/impl/psb_s_coo_impl.F90 index 023cde51..96424a98 100644 --- a/base/serial/impl/psb_s_coo_impl.F90 +++ b/base/serial/impl/psb_s_coo_impl.F90 @@ -609,6 +609,7 @@ subroutine psb_s_coo_clean_zeros(a, info) end if end do call a%set_nzeros(j) + call a%fix(info) call a%trim() end subroutine psb_s_coo_clean_zeros diff --git a/base/serial/impl/psb_s_csc_impl.F90 b/base/serial/impl/psb_s_csc_impl.F90 index 3bb47d95..20c9321e 100644 --- a/base/serial/impl/psb_s_csc_impl.F90 +++ b/base/serial/impl/psb_s_csc_impl.F90 @@ -2403,36 +2403,36 @@ subroutine psb_s_mv_csc_from_fmt(a,b,info) end subroutine psb_s_mv_csc_from_fmt -subroutine psb_s_csc_clean_zeros(a, info) - use psb_error_mod - use psb_s_csc_mat_mod, psb_protect_name => psb_s_csc_clean_zeros - implicit none - class(psb_s_csc_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - ! - integer(psb_ipk_) :: i, j, k, nc - integer(psb_ipk_), allocatable :: ilcp(:) - - info = 0 - call a%sync() - nc = a%get_ncols() - ilcp = a%icp - a%icp(1) = 1 - j = a%icp(1) - do i=1, nc - do k = ilcp(i), ilcp(i+1) -1 - ! Always keep the diagonal, even if numerically zero - if ((a%val(k) /= szero).or.(i == a%ia(k))) then - a%val(j) = a%val(k) - a%ia(j) = a%ia(k) - j = j + 1 - end if - end do - a%icp(i+1) = j - end do - call a%trim() - call a%set_host() -end subroutine psb_s_csc_clean_zeros +!!$subroutine psb_s_csc_clean_zeros(a, info) +!!$ use psb_error_mod +!!$ use psb_s_csc_mat_mod, psb_protect_name => psb_s_csc_clean_zeros +!!$ implicit none +!!$ class(psb_s_csc_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ ! +!!$ integer(psb_ipk_) :: i, j, k, nc +!!$ integer(psb_ipk_), allocatable :: ilcp(:) +!!$ +!!$ info = 0 +!!$ call a%sync() +!!$ nc = a%get_ncols() +!!$ ilcp = a%icp +!!$ a%icp(1) = 1 +!!$ j = a%icp(1) +!!$ do i=1, nc +!!$ do k = ilcp(i), ilcp(i+1) -1 +!!$ ! Always keep the diagonal, even if numerically zero +!!$ if ((a%val(k) /= szero).or.(i == a%ia(k))) then +!!$ a%val(j) = a%val(k) +!!$ a%ia(j) = a%ia(k) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ a%icp(i+1) = j +!!$ end do +!!$ call a%trim() +!!$ call a%set_host() +!!$end subroutine psb_s_csc_clean_zeros subroutine psb_s_cp_csc_from_fmt(a,b,info) use psb_const_mod @@ -4305,36 +4305,36 @@ subroutine psb_ls_cp_csc_from_fmt(a,b,info) end subroutine psb_ls_cp_csc_from_fmt -subroutine psb_ls_csc_clean_zeros(a, info) - use psb_error_mod - use psb_s_csc_mat_mod, psb_protect_name => psb_ls_csc_clean_zeros - implicit none - class(psb_ls_csc_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - ! - integer(psb_lpk_) :: i, j, k, nc - integer(psb_lpk_), allocatable :: ilcp(:) - - info = 0 - call a%sync() - nc = a%get_ncols() - ilcp = a%icp - a%icp(1) = 1 - j = a%icp(1) - do i=1, nc - do k = ilcp(i), ilcp(i+1) -1 - ! Always keep the diagonal, even if numerically zero - if ((a%val(k) /= szero).or.(i == a%ia(k))) then - a%val(j) = a%val(k) - a%ia(j) = a%ia(k) - j = j + 1 - end if - end do - a%icp(i+1) = j - end do - call a%trim() - call a%set_host() -end subroutine psb_ls_csc_clean_zeros +!!$subroutine psb_ls_csc_clean_zeros(a, info) +!!$ use psb_error_mod +!!$ use psb_s_csc_mat_mod, psb_protect_name => psb_ls_csc_clean_zeros +!!$ implicit none +!!$ class(psb_ls_csc_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ ! +!!$ integer(psb_lpk_) :: i, j, k, nc +!!$ integer(psb_lpk_), allocatable :: ilcp(:) +!!$ +!!$ info = 0 +!!$ call a%sync() +!!$ nc = a%get_ncols() +!!$ ilcp = a%icp +!!$ a%icp(1) = 1 +!!$ j = a%icp(1) +!!$ do i=1, nc +!!$ do k = ilcp(i), ilcp(i+1) -1 +!!$ ! Always keep the diagonal, even if numerically zero +!!$ if ((a%val(k) /= szero).or.(i == a%ia(k))) then +!!$ a%val(j) = a%val(k) +!!$ a%ia(j) = a%ia(k) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ a%icp(i+1) = j +!!$ end do +!!$ call a%trim() +!!$ call a%set_host() +!!$end subroutine psb_ls_csc_clean_zeros subroutine psb_ls_csc_mold(a,b,info) diff --git a/base/serial/impl/psb_s_csr_impl.F90 b/base/serial/impl/psb_s_csr_impl.F90 index 0a166b0c..72c85fd2 100644 --- a/base/serial/impl/psb_s_csr_impl.F90 +++ b/base/serial/impl/psb_s_csr_impl.F90 @@ -3624,36 +3624,36 @@ subroutine psb_s_cp_csr_from_fmt(a,b,info) end select end subroutine psb_s_cp_csr_from_fmt -subroutine psb_s_csr_clean_zeros(a, info) - use psb_error_mod - use psb_s_csr_mat_mod, psb_protect_name => psb_s_csr_clean_zeros - implicit none - class(psb_s_csr_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - ! - integer(psb_ipk_) :: i, j, k, nr - integer(psb_ipk_), allocatable :: ilrp(:) - - info = 0 - call a%sync() - nr = a%get_nrows() - ilrp = a%irp - a%irp(1) = 1 - j = a%irp(1) - do i=1, nr - do k = ilrp(i), ilrp(i+1) -1 - ! Always keep the diagonal, even if numerically zero - if ((a%val(k) /= szero).or.(i == a%ja(k))) then - a%val(j) = a%val(k) - a%ja(j) = a%ja(k) - j = j + 1 - end if - end do - a%irp(i+1) = j - end do - call a%trim() - call a%set_host() -end subroutine psb_s_csr_clean_zeros +!!$subroutine psb_s_csr_clean_zeros(a, info) +!!$ use psb_error_mod +!!$ use psb_s_csr_mat_mod, psb_protect_name => psb_s_csr_clean_zeros +!!$ implicit none +!!$ class(psb_s_csr_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ ! +!!$ integer(psb_ipk_) :: i, j, k, nr +!!$ integer(psb_ipk_), allocatable :: ilrp(:) +!!$ +!!$ info = 0 +!!$ call a%sync() +!!$ nr = a%get_nrows() +!!$ ilrp = a%irp +!!$ a%irp(1) = 1 +!!$ j = a%irp(1) +!!$ do i=1, nr +!!$ do k = ilrp(i), ilrp(i+1) -1 +!!$ ! Always keep the diagonal, even if numerically zero +!!$ if ((a%val(k) /= szero).or.(i == a%ja(k))) then +!!$ a%val(j) = a%val(k) +!!$ a%ja(j) = a%ja(k) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ a%irp(i+1) = j +!!$ end do +!!$ call a%trim() +!!$ call a%set_host() +!!$end subroutine psb_s_csr_clean_zeros #if defined(OPENMP) subroutine psb_scsrspspmm(a,b,c,info) @@ -6544,36 +6544,36 @@ subroutine psb_ls_cp_csr_from_fmt(a,b,info) end subroutine psb_ls_cp_csr_from_fmt -subroutine psb_ls_csr_clean_zeros(a, info) - use psb_error_mod - use psb_s_csr_mat_mod, psb_protect_name => psb_ls_csr_clean_zeros - implicit none - class(psb_ls_csr_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - ! - integer(psb_lpk_) :: i, j, k, nr - integer(psb_lpk_), allocatable :: ilrp(:) - - info = 0 - call a%sync() - nr = a%get_nrows() - ilrp = a%irp - a%irp(1) = 1 - j = a%irp(1) - do i=1, nr - do k = ilrp(i), ilrp(i+1) -1 - ! Always keep the diagonal, even if numerically zero - if ((a%val(k) /= szero).or.(i == a%ja(k))) then - a%val(j) = a%val(k) - a%ja(j) = a%ja(k) - j = j + 1 - end if - end do - a%irp(i+1) = j - end do - call a%trim() - call a%set_host() -end subroutine psb_ls_csr_clean_zeros +!!$subroutine psb_ls_csr_clean_zeros(a, info) +!!$ use psb_error_mod +!!$ use psb_s_csr_mat_mod, psb_protect_name => psb_ls_csr_clean_zeros +!!$ implicit none +!!$ class(psb_ls_csr_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ ! +!!$ integer(psb_lpk_) :: i, j, k, nr +!!$ integer(psb_lpk_), allocatable :: ilrp(:) +!!$ +!!$ info = 0 +!!$ call a%sync() +!!$ nr = a%get_nrows() +!!$ ilrp = a%irp +!!$ a%irp(1) = 1 +!!$ j = a%irp(1) +!!$ do i=1, nr +!!$ do k = ilrp(i), ilrp(i+1) -1 +!!$ ! Always keep the diagonal, even if numerically zero +!!$ if ((a%val(k) /= szero).or.(i == a%ja(k))) then +!!$ a%val(j) = a%val(k) +!!$ a%ja(j) = a%ja(k) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ a%irp(i+1) = j +!!$ end do +!!$ call a%trim() +!!$ call a%set_host() +!!$end subroutine psb_ls_csr_clean_zeros subroutine psb_lscsrspspmm(a,b,c,info) use psb_s_mat_mod diff --git a/base/serial/impl/psb_z_coo_impl.F90 b/base/serial/impl/psb_z_coo_impl.F90 index 7dfceb06..0895c011 100644 --- a/base/serial/impl/psb_z_coo_impl.F90 +++ b/base/serial/impl/psb_z_coo_impl.F90 @@ -609,6 +609,7 @@ subroutine psb_z_coo_clean_zeros(a, info) end if end do call a%set_nzeros(j) + call a%fix(info) call a%trim() end subroutine psb_z_coo_clean_zeros diff --git a/base/serial/impl/psb_z_csc_impl.F90 b/base/serial/impl/psb_z_csc_impl.F90 index 32be36af..b47a3727 100644 --- a/base/serial/impl/psb_z_csc_impl.F90 +++ b/base/serial/impl/psb_z_csc_impl.F90 @@ -2403,36 +2403,36 @@ subroutine psb_z_mv_csc_from_fmt(a,b,info) end subroutine psb_z_mv_csc_from_fmt -subroutine psb_z_csc_clean_zeros(a, info) - use psb_error_mod - use psb_z_csc_mat_mod, psb_protect_name => psb_z_csc_clean_zeros - implicit none - class(psb_z_csc_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - ! - integer(psb_ipk_) :: i, j, k, nc - integer(psb_ipk_), allocatable :: ilcp(:) - - info = 0 - call a%sync() - nc = a%get_ncols() - ilcp = a%icp - a%icp(1) = 1 - j = a%icp(1) - do i=1, nc - do k = ilcp(i), ilcp(i+1) -1 - ! Always keep the diagonal, even if numerically zero - if ((a%val(k) /= zzero).or.(i == a%ia(k))) then - a%val(j) = a%val(k) - a%ia(j) = a%ia(k) - j = j + 1 - end if - end do - a%icp(i+1) = j - end do - call a%trim() - call a%set_host() -end subroutine psb_z_csc_clean_zeros +!!$subroutine psb_z_csc_clean_zeros(a, info) +!!$ use psb_error_mod +!!$ use psb_z_csc_mat_mod, psb_protect_name => psb_z_csc_clean_zeros +!!$ implicit none +!!$ class(psb_z_csc_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ ! +!!$ integer(psb_ipk_) :: i, j, k, nc +!!$ integer(psb_ipk_), allocatable :: ilcp(:) +!!$ +!!$ info = 0 +!!$ call a%sync() +!!$ nc = a%get_ncols() +!!$ ilcp = a%icp +!!$ a%icp(1) = 1 +!!$ j = a%icp(1) +!!$ do i=1, nc +!!$ do k = ilcp(i), ilcp(i+1) -1 +!!$ ! Always keep the diagonal, even if numerically zero +!!$ if ((a%val(k) /= zzero).or.(i == a%ia(k))) then +!!$ a%val(j) = a%val(k) +!!$ a%ia(j) = a%ia(k) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ a%icp(i+1) = j +!!$ end do +!!$ call a%trim() +!!$ call a%set_host() +!!$end subroutine psb_z_csc_clean_zeros subroutine psb_z_cp_csc_from_fmt(a,b,info) use psb_const_mod @@ -4305,36 +4305,36 @@ subroutine psb_lz_cp_csc_from_fmt(a,b,info) end subroutine psb_lz_cp_csc_from_fmt -subroutine psb_lz_csc_clean_zeros(a, info) - use psb_error_mod - use psb_z_csc_mat_mod, psb_protect_name => psb_lz_csc_clean_zeros - implicit none - class(psb_lz_csc_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - ! - integer(psb_lpk_) :: i, j, k, nc - integer(psb_lpk_), allocatable :: ilcp(:) - - info = 0 - call a%sync() - nc = a%get_ncols() - ilcp = a%icp - a%icp(1) = 1 - j = a%icp(1) - do i=1, nc - do k = ilcp(i), ilcp(i+1) -1 - ! Always keep the diagonal, even if numerically zero - if ((a%val(k) /= zzero).or.(i == a%ia(k))) then - a%val(j) = a%val(k) - a%ia(j) = a%ia(k) - j = j + 1 - end if - end do - a%icp(i+1) = j - end do - call a%trim() - call a%set_host() -end subroutine psb_lz_csc_clean_zeros +!!$subroutine psb_lz_csc_clean_zeros(a, info) +!!$ use psb_error_mod +!!$ use psb_z_csc_mat_mod, psb_protect_name => psb_lz_csc_clean_zeros +!!$ implicit none +!!$ class(psb_lz_csc_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ ! +!!$ integer(psb_lpk_) :: i, j, k, nc +!!$ integer(psb_lpk_), allocatable :: ilcp(:) +!!$ +!!$ info = 0 +!!$ call a%sync() +!!$ nc = a%get_ncols() +!!$ ilcp = a%icp +!!$ a%icp(1) = 1 +!!$ j = a%icp(1) +!!$ do i=1, nc +!!$ do k = ilcp(i), ilcp(i+1) -1 +!!$ ! Always keep the diagonal, even if numerically zero +!!$ if ((a%val(k) /= zzero).or.(i == a%ia(k))) then +!!$ a%val(j) = a%val(k) +!!$ a%ia(j) = a%ia(k) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ a%icp(i+1) = j +!!$ end do +!!$ call a%trim() +!!$ call a%set_host() +!!$end subroutine psb_lz_csc_clean_zeros subroutine psb_lz_csc_mold(a,b,info) diff --git a/base/serial/impl/psb_z_csr_impl.F90 b/base/serial/impl/psb_z_csr_impl.F90 index e2ddf0d7..6088d534 100644 --- a/base/serial/impl/psb_z_csr_impl.F90 +++ b/base/serial/impl/psb_z_csr_impl.F90 @@ -3624,36 +3624,36 @@ subroutine psb_z_cp_csr_from_fmt(a,b,info) end select end subroutine psb_z_cp_csr_from_fmt -subroutine psb_z_csr_clean_zeros(a, info) - use psb_error_mod - use psb_z_csr_mat_mod, psb_protect_name => psb_z_csr_clean_zeros - implicit none - class(psb_z_csr_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - ! - integer(psb_ipk_) :: i, j, k, nr - integer(psb_ipk_), allocatable :: ilrp(:) - - info = 0 - call a%sync() - nr = a%get_nrows() - ilrp = a%irp - a%irp(1) = 1 - j = a%irp(1) - do i=1, nr - do k = ilrp(i), ilrp(i+1) -1 - ! Always keep the diagonal, even if numerically zero - if ((a%val(k) /= zzero).or.(i == a%ja(k))) then - a%val(j) = a%val(k) - a%ja(j) = a%ja(k) - j = j + 1 - end if - end do - a%irp(i+1) = j - end do - call a%trim() - call a%set_host() -end subroutine psb_z_csr_clean_zeros +!!$subroutine psb_z_csr_clean_zeros(a, info) +!!$ use psb_error_mod +!!$ use psb_z_csr_mat_mod, psb_protect_name => psb_z_csr_clean_zeros +!!$ implicit none +!!$ class(psb_z_csr_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ ! +!!$ integer(psb_ipk_) :: i, j, k, nr +!!$ integer(psb_ipk_), allocatable :: ilrp(:) +!!$ +!!$ info = 0 +!!$ call a%sync() +!!$ nr = a%get_nrows() +!!$ ilrp = a%irp +!!$ a%irp(1) = 1 +!!$ j = a%irp(1) +!!$ do i=1, nr +!!$ do k = ilrp(i), ilrp(i+1) -1 +!!$ ! Always keep the diagonal, even if numerically zero +!!$ if ((a%val(k) /= zzero).or.(i == a%ja(k))) then +!!$ a%val(j) = a%val(k) +!!$ a%ja(j) = a%ja(k) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ a%irp(i+1) = j +!!$ end do +!!$ call a%trim() +!!$ call a%set_host() +!!$end subroutine psb_z_csr_clean_zeros #if defined(OPENMP) subroutine psb_zcsrspspmm(a,b,c,info) @@ -6544,36 +6544,36 @@ subroutine psb_lz_cp_csr_from_fmt(a,b,info) end subroutine psb_lz_cp_csr_from_fmt -subroutine psb_lz_csr_clean_zeros(a, info) - use psb_error_mod - use psb_z_csr_mat_mod, psb_protect_name => psb_lz_csr_clean_zeros - implicit none - class(psb_lz_csr_sparse_mat), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info - ! - integer(psb_lpk_) :: i, j, k, nr - integer(psb_lpk_), allocatable :: ilrp(:) - - info = 0 - call a%sync() - nr = a%get_nrows() - ilrp = a%irp - a%irp(1) = 1 - j = a%irp(1) - do i=1, nr - do k = ilrp(i), ilrp(i+1) -1 - ! Always keep the diagonal, even if numerically zero - if ((a%val(k) /= zzero).or.(i == a%ja(k))) then - a%val(j) = a%val(k) - a%ja(j) = a%ja(k) - j = j + 1 - end if - end do - a%irp(i+1) = j - end do - call a%trim() - call a%set_host() -end subroutine psb_lz_csr_clean_zeros +!!$subroutine psb_lz_csr_clean_zeros(a, info) +!!$ use psb_error_mod +!!$ use psb_z_csr_mat_mod, psb_protect_name => psb_lz_csr_clean_zeros +!!$ implicit none +!!$ class(psb_lz_csr_sparse_mat), intent(inout) :: a +!!$ integer(psb_ipk_), intent(out) :: info +!!$ ! +!!$ integer(psb_lpk_) :: i, j, k, nr +!!$ integer(psb_lpk_), allocatable :: ilrp(:) +!!$ +!!$ info = 0 +!!$ call a%sync() +!!$ nr = a%get_nrows() +!!$ ilrp = a%irp +!!$ a%irp(1) = 1 +!!$ j = a%irp(1) +!!$ do i=1, nr +!!$ do k = ilrp(i), ilrp(i+1) -1 +!!$ ! Always keep the diagonal, even if numerically zero +!!$ if ((a%val(k) /= zzero).or.(i == a%ja(k))) then +!!$ a%val(j) = a%val(k) +!!$ a%ja(j) = a%ja(k) +!!$ j = j + 1 +!!$ end if +!!$ end do +!!$ a%irp(i+1) = j +!!$ end do +!!$ call a%trim() +!!$ call a%set_host() +!!$end subroutine psb_lz_csr_clean_zeros subroutine psb_lzcsrspspmm(a,b,c,info) use psb_z_mat_mod