From 0239569e2b06295a2e4611791806ca917ff0f005 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Tue, 23 Sep 2025 13:10:49 +0200 Subject: [PATCH] Final fixes for compilation with INTEL --- base/modules/serial/psb_c_mat_mod.F90 | 7 ++-- base/modules/serial/psb_c_serial_mod.f90 | 10 +++++ base/modules/serial/psb_d_mat_mod.F90 | 7 ++-- base/modules/serial/psb_d_serial_mod.f90 | 10 +++++ base/modules/serial/psb_s_mat_mod.F90 | 7 ++-- base/modules/serial/psb_s_serial_mod.f90 | 10 +++++ base/modules/serial/psb_z_mat_mod.F90 | 7 ++-- base/modules/serial/psb_z_serial_mod.f90 | 10 +++++ base/serial/Makefile | 1 + base/serial/psb_caplusat.f90 | 50 ++++++++++++++++++++++++ base/serial/psb_daplusat.f90 | 50 ++++++++++++++++++++++++ base/serial/psb_saplusat.f90 | 50 ++++++++++++++++++++++++ base/serial/psb_zaplusat.f90 | 50 ++++++++++++++++++++++++ 13 files changed, 257 insertions(+), 12 deletions(-) create mode 100644 base/serial/psb_caplusat.f90 create mode 100644 base/serial/psb_daplusat.f90 create mode 100644 base/serial/psb_saplusat.f90 create mode 100644 base/serial/psb_zaplusat.f90 diff --git a/base/modules/serial/psb_c_mat_mod.F90 b/base/modules/serial/psb_c_mat_mod.F90 index 165a5451..91d8bf4d 100644 --- a/base/modules/serial/psb_c_mat_mod.F90 +++ b/base/modules/serial/psb_c_mat_mod.F90 @@ -78,6 +78,8 @@ ! module psb_c_mat_mod + use psb_c_vect_mod + use psb_i_vect_mod use psb_c_base_mat_mod use psb_c_csr_mat_mod, only : psb_c_csr_sparse_mat, psb_lc_csr_sparse_mat,& & psb_c_ecsr_sparse_mat @@ -661,9 +663,8 @@ module psb_c_mat_mod interface subroutine psb_c_csput_v(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) - use psb_c_vect_mod, only : psb_c_vect_type - use psb_i_vect_mod, only : psb_i_vect_type - import :: psb_ipk_, psb_lpk_, psb_cspmat_type + import :: psb_ipk_, psb_lpk_, psb_cspmat_type, & + & psb_c_vect_type, psb_i_vect_type class(psb_cspmat_type), intent(inout) :: a type(psb_c_vect_type), intent(inout) :: val type(psb_i_vect_type), intent(inout) :: ia, ja diff --git a/base/modules/serial/psb_c_serial_mod.f90 b/base/modules/serial/psb_c_serial_mod.f90 index 24fba38e..5ad71641 100644 --- a/base/modules/serial/psb_c_serial_mod.f90 +++ b/base/modules/serial/psb_c_serial_mod.f90 @@ -98,6 +98,16 @@ module psb_c_serial_mod end subroutine psb_cbase_numbmm end interface psb_numbmm + interface psb_aplusat + subroutine psb_caplusat(ain,aout,info) + use psb_c_mat_mod, only : psb_cspmat_type + import :: psb_ipk_ + implicit none + type(psb_cspmat_type) :: ain, aout + integer(psb_ipk_) :: info + end subroutine psb_caplusat + end interface + interface psb_rwextd subroutine psb_crwextd(nr,a,info,b,rowscale) use psb_c_mat_mod, only : psb_cspmat_type diff --git a/base/modules/serial/psb_d_mat_mod.F90 b/base/modules/serial/psb_d_mat_mod.F90 index a4318ba4..754196b7 100644 --- a/base/modules/serial/psb_d_mat_mod.F90 +++ b/base/modules/serial/psb_d_mat_mod.F90 @@ -78,6 +78,8 @@ ! module psb_d_mat_mod + use psb_d_vect_mod + use psb_i_vect_mod use psb_d_base_mat_mod use psb_d_csr_mat_mod, only : psb_d_csr_sparse_mat, psb_ld_csr_sparse_mat,& & psb_d_ecsr_sparse_mat @@ -661,9 +663,8 @@ module psb_d_mat_mod interface subroutine psb_d_csput_v(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) - use psb_d_vect_mod, only : psb_d_vect_type - use psb_i_vect_mod, only : psb_i_vect_type - import :: psb_ipk_, psb_lpk_, psb_dspmat_type + import :: psb_ipk_, psb_lpk_, psb_dspmat_type, & + & psb_d_vect_type, psb_i_vect_type class(psb_dspmat_type), intent(inout) :: a type(psb_d_vect_type), intent(inout) :: val type(psb_i_vect_type), intent(inout) :: ia, ja diff --git a/base/modules/serial/psb_d_serial_mod.f90 b/base/modules/serial/psb_d_serial_mod.f90 index 1c186cf7..6446a9f5 100644 --- a/base/modules/serial/psb_d_serial_mod.f90 +++ b/base/modules/serial/psb_d_serial_mod.f90 @@ -98,6 +98,16 @@ module psb_d_serial_mod end subroutine psb_dbase_numbmm end interface psb_numbmm + interface psb_aplusat + subroutine psb_daplusat(ain,aout,info) + use psb_d_mat_mod, only : psb_dspmat_type + import :: psb_ipk_ + implicit none + type(psb_dspmat_type) :: ain, aout + integer(psb_ipk_) :: info + end subroutine psb_daplusat + end interface + interface psb_rwextd subroutine psb_drwextd(nr,a,info,b,rowscale) use psb_d_mat_mod, only : psb_dspmat_type diff --git a/base/modules/serial/psb_s_mat_mod.F90 b/base/modules/serial/psb_s_mat_mod.F90 index e342ed8c..ac619c03 100644 --- a/base/modules/serial/psb_s_mat_mod.F90 +++ b/base/modules/serial/psb_s_mat_mod.F90 @@ -78,6 +78,8 @@ ! module psb_s_mat_mod + use psb_s_vect_mod + use psb_i_vect_mod use psb_s_base_mat_mod use psb_s_csr_mat_mod, only : psb_s_csr_sparse_mat, psb_ls_csr_sparse_mat,& & psb_s_ecsr_sparse_mat @@ -661,9 +663,8 @@ module psb_s_mat_mod interface subroutine psb_s_csput_v(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) - use psb_s_vect_mod, only : psb_s_vect_type - use psb_i_vect_mod, only : psb_i_vect_type - import :: psb_ipk_, psb_lpk_, psb_sspmat_type + import :: psb_ipk_, psb_lpk_, psb_sspmat_type, & + & psb_s_vect_type, psb_i_vect_type class(psb_sspmat_type), intent(inout) :: a type(psb_s_vect_type), intent(inout) :: val type(psb_i_vect_type), intent(inout) :: ia, ja diff --git a/base/modules/serial/psb_s_serial_mod.f90 b/base/modules/serial/psb_s_serial_mod.f90 index 9872e53e..c475ab8d 100644 --- a/base/modules/serial/psb_s_serial_mod.f90 +++ b/base/modules/serial/psb_s_serial_mod.f90 @@ -98,6 +98,16 @@ module psb_s_serial_mod end subroutine psb_sbase_numbmm end interface psb_numbmm + interface psb_aplusat + subroutine psb_saplusat(ain,aout,info) + use psb_s_mat_mod, only : psb_sspmat_type + import :: psb_ipk_ + implicit none + type(psb_sspmat_type) :: ain, aout + integer(psb_ipk_) :: info + end subroutine psb_saplusat + end interface + interface psb_rwextd subroutine psb_srwextd(nr,a,info,b,rowscale) use psb_s_mat_mod, only : psb_sspmat_type diff --git a/base/modules/serial/psb_z_mat_mod.F90 b/base/modules/serial/psb_z_mat_mod.F90 index 47342aee..521e665a 100644 --- a/base/modules/serial/psb_z_mat_mod.F90 +++ b/base/modules/serial/psb_z_mat_mod.F90 @@ -78,6 +78,8 @@ ! module psb_z_mat_mod + use psb_z_vect_mod + use psb_i_vect_mod use psb_z_base_mat_mod use psb_z_csr_mat_mod, only : psb_z_csr_sparse_mat, psb_lz_csr_sparse_mat,& & psb_z_ecsr_sparse_mat @@ -661,9 +663,8 @@ module psb_z_mat_mod interface subroutine psb_z_csput_v(nz,ia,ja,val,a,imin,imax,jmin,jmax,info) - use psb_z_vect_mod, only : psb_z_vect_type - use psb_i_vect_mod, only : psb_i_vect_type - import :: psb_ipk_, psb_lpk_, psb_zspmat_type + import :: psb_ipk_, psb_lpk_, psb_zspmat_type, & + & psb_z_vect_type, psb_i_vect_type class(psb_zspmat_type), intent(inout) :: a type(psb_z_vect_type), intent(inout) :: val type(psb_i_vect_type), intent(inout) :: ia, ja diff --git a/base/modules/serial/psb_z_serial_mod.f90 b/base/modules/serial/psb_z_serial_mod.f90 index fa0b3ef2..6339f5e1 100644 --- a/base/modules/serial/psb_z_serial_mod.f90 +++ b/base/modules/serial/psb_z_serial_mod.f90 @@ -98,6 +98,16 @@ module psb_z_serial_mod end subroutine psb_zbase_numbmm end interface psb_numbmm + interface psb_aplusat + subroutine psb_zaplusat(ain,aout,info) + use psb_z_mat_mod, only : psb_zspmat_type + import :: psb_ipk_ + implicit none + type(psb_zspmat_type) :: ain, aout + integer(psb_ipk_) :: info + end subroutine psb_zaplusat + end interface + interface psb_rwextd subroutine psb_zrwextd(nr,a,info,b,rowscale) use psb_z_mat_mod, only : psb_zspmat_type diff --git a/base/serial/Makefile b/base/serial/Makefile index ec0e2c82..57e4bfa1 100644 --- a/base/serial/Makefile +++ b/base/serial/Makefile @@ -11,6 +11,7 @@ FOBJS = psb_lsame.o psi_m_serial_impl.o psi_e_serial_impl.o \ smmp.o lsmmp.o \ psb_sgeprt.o psb_dgeprt.o psb_cgeprt.o psb_zgeprt.o\ psb_spdot_srtd.o psb_aspxpby.o psb_spge_dot.o\ + psb_saplusat.o psb_daplusat.o psb_caplusat.o psb_zaplusat.o \ psb_samax_s.o psb_damax_s.o psb_camax_s.o psb_zamax_s.o \ psb_sasum_s.o psb_dasum_s.o psb_casum_s.o psb_zasum_s.o diff --git a/base/serial/psb_caplusat.f90 b/base/serial/psb_caplusat.f90 new file mode 100644 index 00000000..6beb7f17 --- /dev/null +++ b/base/serial/psb_caplusat.f90 @@ -0,0 +1,50 @@ +subroutine psb_caplusat(ain,aout,info) + use psb_c_mat_mod + + implicit none + type(psb_cspmat_type), intent(inout) :: ain + type(psb_cspmat_type), intent(out) :: aout + integer(psb_ipk_) :: info + + type(psb_c_coo_sparse_mat) :: acoo1, acoo2 + integer(psb_ipk_) :: nr, nc, nz1, nz2 + integer(psb_ipk_) :: err_act + character(len=20) :: name, ch_err + + name='psb_caplusat' + info = psb_success_ + call psb_erractionsave(err_act) + + + + nr = ain%get_nrows() + nc = ain%get_ncols() + + if (nr /= nc) then + info=psb_err_internal_error_ + call psb_errpush(info,name) + goto 9999 + end if + + call ain%cp_to(acoo1) + call acoo1%cp_to_coo(acoo2,info) + nz1 = acoo1%get_nzeros() + nz2 = acoo2%get_nzeros() + call acoo1%reallocate(nz1+nz2) + acoo1%ia(nz1+1:nz1+nz2) = acoo2%ja(1:nz2) + acoo1%ja(nz1+1:nz1+nz2) = acoo2%ia(1:nz2) + acoo1%val(nz1+1:nz1+nz2) = acoo2%val(1:nz2) + call acoo1%set_nrows(nr) + call acoo1%set_ncols(nr) + call acoo1%set_nzeros(nz1+nz2) + call aout%cp_from(acoo1) + + call psb_erractionrestore(err_act) + return + +9999 call psb_error_handler(err_act) + + return + + +end subroutine psb_caplusat diff --git a/base/serial/psb_daplusat.f90 b/base/serial/psb_daplusat.f90 new file mode 100644 index 00000000..6ae0b462 --- /dev/null +++ b/base/serial/psb_daplusat.f90 @@ -0,0 +1,50 @@ +subroutine psb_daplusat(ain,aout,info) + use psb_d_mat_mod + + implicit none + type(psb_dspmat_type), intent(inout) :: ain + type(psb_dspmat_type), intent(out) :: aout + integer(psb_ipk_) :: info + + type(psb_d_coo_sparse_mat) :: acoo1, acoo2 + integer(psb_ipk_) :: nr, nc, nz1, nz2 + integer(psb_ipk_) :: err_act + character(len=20) :: name, ch_err + + name='psb_daplusat' + info = psb_success_ + call psb_erractionsave(err_act) + + + + nr = ain%get_nrows() + nc = ain%get_ncols() + + if (nr /= nc) then + info=psb_err_internal_error_ + call psb_errpush(info,name) + goto 9999 + end if + + call ain%cp_to(acoo1) + call acoo1%cp_to_coo(acoo2,info) + nz1 = acoo1%get_nzeros() + nz2 = acoo2%get_nzeros() + call acoo1%reallocate(nz1+nz2) + acoo1%ia(nz1+1:nz1+nz2) = acoo2%ja(1:nz2) + acoo1%ja(nz1+1:nz1+nz2) = acoo2%ia(1:nz2) + acoo1%val(nz1+1:nz1+nz2) = acoo2%val(1:nz2) + call acoo1%set_nrows(nr) + call acoo1%set_ncols(nr) + call acoo1%set_nzeros(nz1+nz2) + call aout%cp_from(acoo1) + + call psb_erractionrestore(err_act) + return + +9999 call psb_error_handler(err_act) + + return + + +end subroutine psb_daplusat diff --git a/base/serial/psb_saplusat.f90 b/base/serial/psb_saplusat.f90 new file mode 100644 index 00000000..3e9024d3 --- /dev/null +++ b/base/serial/psb_saplusat.f90 @@ -0,0 +1,50 @@ +subroutine psb_saplusat(ain,aout,info) + use psb_s_mat_mod + + implicit none + type(psb_sspmat_type), intent(inout) :: ain + type(psb_sspmat_type), intent(out) :: aout + integer(psb_ipk_) :: info + + type(psb_s_coo_sparse_mat) :: acoo1, acoo2 + integer(psb_ipk_) :: nr, nc, nz1, nz2 + integer(psb_ipk_) :: err_act + character(len=20) :: name, ch_err + + name='psb_saplusat' + info = psb_success_ + call psb_erractionsave(err_act) + + + + nr = ain%get_nrows() + nc = ain%get_ncols() + + if (nr /= nc) then + info=psb_err_internal_error_ + call psb_errpush(info,name) + goto 9999 + end if + + call ain%cp_to(acoo1) + call acoo1%cp_to_coo(acoo2,info) + nz1 = acoo1%get_nzeros() + nz2 = acoo2%get_nzeros() + call acoo1%reallocate(nz1+nz2) + acoo1%ia(nz1+1:nz1+nz2) = acoo2%ja(1:nz2) + acoo1%ja(nz1+1:nz1+nz2) = acoo2%ia(1:nz2) + acoo1%val(nz1+1:nz1+nz2) = acoo2%val(1:nz2) + call acoo1%set_nrows(nr) + call acoo1%set_ncols(nr) + call acoo1%set_nzeros(nz1+nz2) + call aout%cp_from(acoo1) + + call psb_erractionrestore(err_act) + return + +9999 call psb_error_handler(err_act) + + return + + +end subroutine psb_saplusat diff --git a/base/serial/psb_zaplusat.f90 b/base/serial/psb_zaplusat.f90 new file mode 100644 index 00000000..cb418474 --- /dev/null +++ b/base/serial/psb_zaplusat.f90 @@ -0,0 +1,50 @@ +subroutine psb_zaplusat(ain,aout,info) + use psb_z_mat_mod + + implicit none + type(psb_zspmat_type), intent(inout) :: ain + type(psb_zspmat_type), intent(out) :: aout + integer(psb_ipk_) :: info + + type(psb_z_coo_sparse_mat) :: acoo1, acoo2 + integer(psb_ipk_) :: nr, nc, nz1, nz2 + integer(psb_ipk_) :: err_act + character(len=20) :: name, ch_err + + name='psb_zaplusat' + info = psb_success_ + call psb_erractionsave(err_act) + + + + nr = ain%get_nrows() + nc = ain%get_ncols() + + if (nr /= nc) then + info=psb_err_internal_error_ + call psb_errpush(info,name) + goto 9999 + end if + + call ain%cp_to(acoo1) + call acoo1%cp_to_coo(acoo2,info) + nz1 = acoo1%get_nzeros() + nz2 = acoo2%get_nzeros() + call acoo1%reallocate(nz1+nz2) + acoo1%ia(nz1+1:nz1+nz2) = acoo2%ja(1:nz2) + acoo1%ja(nz1+1:nz1+nz2) = acoo2%ia(1:nz2) + acoo1%val(nz1+1:nz1+nz2) = acoo2%val(1:nz2) + call acoo1%set_nrows(nr) + call acoo1%set_ncols(nr) + call acoo1%set_nzeros(nz1+nz2) + call aout%cp_from(acoo1) + + call psb_erractionrestore(err_act) + return + +9999 call psb_error_handler(err_act) + + return + + +end subroutine psb_zaplusat