From b8503f0f27631e0e4e0aed6799d86c22a51fb035 Mon Sep 17 00:00:00 2001 From: Cirdans-Home Date: Fri, 9 Dec 2022 13:20:22 +0100 Subject: [PATCH] Inizialization to zero and print --- krylov/psb_ckrylovsubspace_mod.F90 | 5 ++--- krylov/psb_dkrylovsubspace_mod.F90 | 5 ++--- krylov/psb_skrylovsubspace_mod.F90 | 5 ++--- krylov/psb_zkrylovsubspace_mod.F90 | 5 ++--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/krylov/psb_ckrylovsubspace_mod.F90 b/krylov/psb_ckrylovsubspace_mod.F90 index 3b30ade2..b555a8f2 100644 --- a/krylov/psb_ckrylovsubspace_mod.F90 +++ b/krylov/psb_ckrylovsubspace_mod.F90 @@ -85,6 +85,7 @@ contains if (.not.allocated(kryl%h)) then allocate(kryl%h(maxsize+1,maxsize), stat=info) + kryl%h = czero else info = -1 end if @@ -255,7 +256,6 @@ contains end if scal = cone/kryl%h(i1,i) call psb_gescal(kryl%v(i1),scal,kryl%v(i1),desc_a,info) - !call psb_geaxpby(scal,kryl%v(i1),czero,kryl%v(i1),desc_a,info) if (info /= psb_success_) then info=psb_err_from_subroutine_non_ call psb_errpush(info,name) @@ -299,7 +299,7 @@ contains call psb_info(ctxt,iam,np) if (iam == psb_root_) then - call mm_array_write(kryl%h,"Projected Matrix",info,filename=trim(filename)//"_h") + call mm_array_write(kryl%h(1:kryl%k+1,1:kryl%k),"Projected Matrix",info,filename=trim(filename)//"_h") if (info /= psb_success_) then info=psb_err_from_subroutine_non_ call psb_errpush(info,name) @@ -343,5 +343,4 @@ contains end subroutine - end module psb_ckrylovsubspace_mod diff --git a/krylov/psb_dkrylovsubspace_mod.F90 b/krylov/psb_dkrylovsubspace_mod.F90 index e0e6cf51..7c33c751 100644 --- a/krylov/psb_dkrylovsubspace_mod.F90 +++ b/krylov/psb_dkrylovsubspace_mod.F90 @@ -85,6 +85,7 @@ contains if (.not.allocated(kryl%h)) then allocate(kryl%h(maxsize+1,maxsize), stat=info) + kryl%h = dzero else info = -1 end if @@ -255,7 +256,6 @@ contains end if scal = done/kryl%h(i1,i) call psb_gescal(kryl%v(i1),scal,kryl%v(i1),desc_a,info) - !call psb_geaxpby(scal,kryl%v(i1),dzero,kryl%v(i1),desc_a,info) if (info /= psb_success_) then info=psb_err_from_subroutine_non_ call psb_errpush(info,name) @@ -299,7 +299,7 @@ contains call psb_info(ctxt,iam,np) if (iam == psb_root_) then - call mm_array_write(kryl%h,"Projected Matrix",info,filename=trim(filename)//"_h") + call mm_array_write(kryl%h(1:kryl%k+1,1:kryl%k),"Projected Matrix",info,filename=trim(filename)//"_h") if (info /= psb_success_) then info=psb_err_from_subroutine_non_ call psb_errpush(info,name) @@ -343,5 +343,4 @@ contains end subroutine - end module psb_dkrylovsubspace_mod diff --git a/krylov/psb_skrylovsubspace_mod.F90 b/krylov/psb_skrylovsubspace_mod.F90 index 8643201e..cacc2a86 100644 --- a/krylov/psb_skrylovsubspace_mod.F90 +++ b/krylov/psb_skrylovsubspace_mod.F90 @@ -85,6 +85,7 @@ contains if (.not.allocated(kryl%h)) then allocate(kryl%h(maxsize+1,maxsize), stat=info) + kryl%h = szero else info = -1 end if @@ -255,7 +256,6 @@ contains end if scal = sone/kryl%h(i1,i) call psb_gescal(kryl%v(i1),scal,kryl%v(i1),desc_a,info) - !call psb_geaxpby(scal,kryl%v(i1),szero,kryl%v(i1),desc_a,info) if (info /= psb_success_) then info=psb_err_from_subroutine_non_ call psb_errpush(info,name) @@ -299,7 +299,7 @@ contains call psb_info(ctxt,iam,np) if (iam == psb_root_) then - call mm_array_write(kryl%h,"Projected Matrix",info,filename=trim(filename)//"_h") + call mm_array_write(kryl%h(1:kryl%k+1,1:kryl%k),"Projected Matrix",info,filename=trim(filename)//"_h") if (info /= psb_success_) then info=psb_err_from_subroutine_non_ call psb_errpush(info,name) @@ -343,5 +343,4 @@ contains end subroutine - end module psb_skrylovsubspace_mod diff --git a/krylov/psb_zkrylovsubspace_mod.F90 b/krylov/psb_zkrylovsubspace_mod.F90 index 925deb87..cd01e9ab 100644 --- a/krylov/psb_zkrylovsubspace_mod.F90 +++ b/krylov/psb_zkrylovsubspace_mod.F90 @@ -85,6 +85,7 @@ contains if (.not.allocated(kryl%h)) then allocate(kryl%h(maxsize+1,maxsize), stat=info) + kryl%h = zzero else info = -1 end if @@ -255,7 +256,6 @@ contains end if scal = zone/kryl%h(i1,i) call psb_gescal(kryl%v(i1),scal,kryl%v(i1),desc_a,info) - !call psb_geaxpby(scal,kryl%v(i1),zzero,kryl%v(i1),desc_a,info) if (info /= psb_success_) then info=psb_err_from_subroutine_non_ call psb_errpush(info,name) @@ -299,7 +299,7 @@ contains call psb_info(ctxt,iam,np) if (iam == psb_root_) then - call mm_array_write(kryl%h,"Projected Matrix",info,filename=trim(filename)//"_h") + call mm_array_write(kryl%h(1:kryl%k+1,1:kryl%k),"Projected Matrix",info,filename=trim(filename)//"_h") if (info /= psb_success_) then info=psb_err_from_subroutine_non_ call psb_errpush(info,name) @@ -343,5 +343,4 @@ contains end subroutine - end module psb_zkrylovsubspace_mod