diff --git a/base/newserial/Makefile b/base/newserial/Makefile index 39011b44..d8138d75 100644 --- a/base/newserial/Makefile +++ b/base/newserial/Makefile @@ -1,6 +1,6 @@ include ../../Make.inc -MODULES = psbn_base_mat_mod.o psbn_coo_mat.o psbn_csr_mat.o +MODULES = psbn_base_mat_mod.o psbn_d_base_mat_mod.o psbn_coo_mat.o psbn_csr_mat.o psbn_mat_mod.o LIBMOD= @@ -15,7 +15,8 @@ lib: $(MODULES) $(OBJS) $(LIBMOD) $(RANLIB) $(LIBDIR)/$(LIBNAME) # /bin/cp -p $(LIBMOD) $(LIBDIR) /bin/cp -p *$(.mod) $(LIBDIR) -psbn_coo_mat.o psbn_csr_mat.o: psbn_base_mat_mod.o +psbn_mat_mod.o: psbn_base_mat_mod.o +psbn_coo_mat.o psbn_csr_mat.o: psbn_d_base_mat_mod.o clean: diff --git a/base/newserial/psbn_base_mat_mod.f03 b/base/newserial/psbn_base_mat_mod.f03 index 3c04551a..447ce7e7 100644 --- a/base/newserial/psbn_base_mat_mod.f03 +++ b/base/newserial/psbn_base_mat_mod.f03 @@ -265,193 +265,3 @@ contains end module psbn_base_mat_mod -module psbn_d_base_mat_mod - - use psbn_base_mat_mod - type, extends(psbn_base_sparse_mat) :: psbn_d_base_sparse_mat - contains - procedure, pass(a) :: d_base_csmv - procedure, pass(a) :: d_base_csmm - generic, public :: psbn_csmm => d_base_csmm, d_base_csmv - procedure, pass(a) :: d_base_cssv - procedure, pass(a) :: d_base_cssm - generic, public :: psbn_cssm => d_base_cssm, d_base_cssv - - end type psbn_d_base_sparse_mat - -contains - - subroutine d_base_csmm(alpha,a,x,beta,y,info,trans) - use psb_error_mod - class(psbn_d_base_sparse_mat), intent(in) :: a - real(kind(1.d0)), intent(in) :: alpha, beta, x(:,:) - real(kind(1.d0)), intent(inout) :: y(:,:) - integer, intent(out) :: info - character, optional, intent(in) :: trans - - Integer :: err_act - character(len=20) :: name='d_base_csmm' - logical, parameter :: debug=.false. - - call psb_erractionsave(err_act) - ! This is the base version. If we get here - ! it means the derived class is incomplete, - ! so we throw an error. - call psb_errpush(700,name) - - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return - - end subroutine d_base_csmm - - subroutine d_base_csmv(alpha,a,x,beta,y,info,trans) - use psb_error_mod - class(psbn_d_base_sparse_mat), intent(in) :: a - real(kind(1.d0)), intent(in) :: alpha, beta, x(:) - real(kind(1.d0)), intent(inout) :: y(:) - integer, intent(out) :: info - character, optional, intent(in) :: trans - - Integer :: err_act - character(len=20) :: name='d_base_csmv' - logical, parameter :: debug=.false. - - call psb_erractionsave(err_act) - ! This is the base version. If we get here - ! it means the derived class is incomplete, - ! so we throw an error. - call psb_errpush(700,name) - - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return - - - end subroutine d_base_csmv - - subroutine d_base_cssm(alpha,a,x,beta,y,info,trans) - use psb_error_mod - class(psbn_d_base_sparse_mat), intent(in) :: a - real(kind(1.d0)), intent(in) :: alpha, beta, x(:,:) - real(kind(1.d0)), intent(inout) :: y(:,:) - integer, intent(out) :: info - character, optional, intent(in) :: trans - - Integer :: err_act - character(len=20) :: name='d_base_cssm' - logical, parameter :: debug=.false. - - call psb_erractionsave(err_act) - info = 700 - ! This is the base version. If we get here - ! it means the derived class is incomplete, - ! so we throw an error. - call psb_errpush(700,name) - - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return - - end subroutine d_base_cssm - - subroutine d_base_cssv(alpha,a,x,beta,y,info,trans) - use psb_error_mod - class(psbn_d_base_sparse_mat), intent(in) :: a - real(kind(1.d0)), intent(in) :: alpha, beta, x(:) - real(kind(1.d0)), intent(inout) :: y(:) - integer, intent(out) :: info - character, optional, intent(in) :: trans - - Integer :: err_act - character(len=20) :: name='d_base_cssv' - logical, parameter :: debug=.false. - - call psb_erractionsave(err_act) - info = 700 - ! This is the base version. If we get here - ! it means the derived class is incomplete, - ! so we throw an error. - call psb_errpush(700,name) - - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return - - - end subroutine d_base_cssv - -end module psbn_d_base_mat_mod - -module psbn_d_mat_mod - - use psbn_d_base_mat_mod - - type :: psbn_d_sparse_mat - - class(psbn_d_base_sparse_mat), allocatable :: a - - contains - - procedure, pass(a) :: d_csmv - procedure, pass(a) :: d_csmm - generic, public :: psbn_csmm => d_csmm, d_csmv - - procedure, pass(a) :: d_cssv - procedure, pass(a) :: d_cssm - generic, public :: psbn_cssm => d_cssm, d_cssv - - end type psbn_d_sparse_mat - -contains - - subroutine d_csmm(alpha,a,x,beta,y,info,trans) - class(psbn_d_sparse_mat), intent(in) :: a - real(kind(1.d0)), intent(in) :: alpha, beta, x(:,:) - real(kind(1.d0)), intent(inout) :: y(:,:) - integer, intent(out) :: info - character, optional, intent(in) :: trans - - call a%a%psbn_csmm(alpha,x,beta,y,info,trans) - - end subroutine d_csmm - - subroutine d_csmv(alpha,a,x,beta,y,info,trans) - class(psbn_d_sparse_mat), intent(in) :: a - real(kind(1.d0)), intent(in) :: alpha, beta, x(:) - real(kind(1.d0)), intent(inout) :: y(:) - integer, intent(out) :: info - character, optional, intent(in) :: trans - - call a%a%psbn_csmm(alpha,x,beta,y,info,trans) - - end subroutine d_csmv - - subroutine d_cssm(alpha,a,x,beta,y,info,trans) - class(psbn_d_sparse_mat), intent(in) :: a - real(kind(1.d0)), intent(in) :: alpha, beta, x(:,:) - real(kind(1.d0)), intent(inout) :: y(:,:) - integer, intent(out) :: info - character, optional, intent(in) :: trans - - call a%a%psbn_cssm(alpha,x,beta,y,info,trans) - - end subroutine d_cssm - - subroutine d_cssv(alpha,a,x,beta,y,info,trans) - class(psbn_d_sparse_mat), intent(in) :: a - real(kind(1.d0)), intent(in) :: alpha, beta, x(:) - real(kind(1.d0)), intent(inout) :: y(:) - integer, intent(out) :: info - character, optional, intent(in) :: trans - - call a%a%psbn_cssm(alpha,x,beta,y,info,trans) - - end subroutine d_cssv - -end module psbn_d_mat_mod - diff --git a/base/newserial/psbn_d_base_mat_mod.f03 b/base/newserial/psbn_d_base_mat_mod.f03 new file mode 100644 index 00000000..c92306aa --- /dev/null +++ b/base/newserial/psbn_d_base_mat_mod.f03 @@ -0,0 +1,122 @@ + +module psbn_d_base_mat_mod + + use psbn_base_mat_mod + type, extends(psbn_base_sparse_mat) :: psbn_d_base_sparse_mat + contains + procedure, pass(a) :: d_base_csmv + procedure, pass(a) :: d_base_csmm + generic, public :: psbn_csmm => d_base_csmm, d_base_csmv + procedure, pass(a) :: d_base_cssv + procedure, pass(a) :: d_base_cssm + generic, public :: psbn_cssm => d_base_cssm, d_base_cssv + + end type psbn_d_base_sparse_mat + +contains + + subroutine d_base_csmm(alpha,a,x,beta,y,info,trans) + use psb_error_mod + class(psbn_d_base_sparse_mat), intent(in) :: a + real(kind(1.d0)), intent(in) :: alpha, beta, x(:,:) + real(kind(1.d0)), intent(inout) :: y(:,:) + integer, intent(out) :: info + character, optional, intent(in) :: trans + + Integer :: err_act + character(len=20) :: name='d_base_csmm' + logical, parameter :: debug=.false. + + call psb_erractionsave(err_act) + ! This is the base version. If we get here + ! it means the derived class is incomplete, + ! so we throw an error. + call psb_errpush(700,name) + + if (err_act /= psb_act_ret_) then + call psb_error() + end if + return + + end subroutine d_base_csmm + + subroutine d_base_csmv(alpha,a,x,beta,y,info,trans) + use psb_error_mod + class(psbn_d_base_sparse_mat), intent(in) :: a + real(kind(1.d0)), intent(in) :: alpha, beta, x(:) + real(kind(1.d0)), intent(inout) :: y(:) + integer, intent(out) :: info + character, optional, intent(in) :: trans + + Integer :: err_act + character(len=20) :: name='d_base_csmv' + logical, parameter :: debug=.false. + + call psb_erractionsave(err_act) + ! This is the base version. If we get here + ! it means the derived class is incomplete, + ! so we throw an error. + call psb_errpush(700,name) + + if (err_act /= psb_act_ret_) then + call psb_error() + end if + return + + + end subroutine d_base_csmv + + subroutine d_base_cssm(alpha,a,x,beta,y,info,trans) + use psb_error_mod + class(psbn_d_base_sparse_mat), intent(in) :: a + real(kind(1.d0)), intent(in) :: alpha, beta, x(:,:) + real(kind(1.d0)), intent(inout) :: y(:,:) + integer, intent(out) :: info + character, optional, intent(in) :: trans + + Integer :: err_act + character(len=20) :: name='d_base_cssm' + logical, parameter :: debug=.false. + + call psb_erractionsave(err_act) + info = 700 + ! This is the base version. If we get here + ! it means the derived class is incomplete, + ! so we throw an error. + call psb_errpush(700,name) + + if (err_act /= psb_act_ret_) then + call psb_error() + end if + return + + end subroutine d_base_cssm + + subroutine d_base_cssv(alpha,a,x,beta,y,info,trans) + use psb_error_mod + class(psbn_d_base_sparse_mat), intent(in) :: a + real(kind(1.d0)), intent(in) :: alpha, beta, x(:) + real(kind(1.d0)), intent(inout) :: y(:) + integer, intent(out) :: info + character, optional, intent(in) :: trans + + Integer :: err_act + character(len=20) :: name='d_base_cssv' + logical, parameter :: debug=.false. + + call psb_erractionsave(err_act) + info = 700 + ! This is the base version. If we get here + ! it means the derived class is incomplete, + ! so we throw an error. + call psb_errpush(700,name) + + if (err_act /= psb_act_ret_) then + call psb_error() + end if + return + + + end subroutine d_base_cssv + +end module psbn_d_base_mat_mod diff --git a/base/newserial/psbn_mat_mod.f03 b/base/newserial/psbn_mat_mod.f03 new file mode 100644 index 00000000..db73a351 --- /dev/null +++ b/base/newserial/psbn_mat_mod.f03 @@ -0,0 +1,69 @@ + +module psbn_d_mat_mod + + use psbn_d_base_mat_mod + + type :: psbn_d_sparse_mat + + class(psbn_d_base_sparse_mat), allocatable :: a + + contains + + procedure, pass(a) :: d_csmv + procedure, pass(a) :: d_csmm + generic, public :: psbn_csmm => d_csmm, d_csmv + + procedure, pass(a) :: d_cssv + procedure, pass(a) :: d_cssm + generic, public :: psbn_cssm => d_cssm, d_cssv + + end type psbn_d_sparse_mat + +contains + + subroutine d_csmm(alpha,a,x,beta,y,info,trans) + class(psbn_d_sparse_mat), intent(in) :: a + real(kind(1.d0)), intent(in) :: alpha, beta, x(:,:) + real(kind(1.d0)), intent(inout) :: y(:,:) + integer, intent(out) :: info + character, optional, intent(in) :: trans + + call a%a%psbn_csmm(alpha,x,beta,y,info,trans) + + end subroutine d_csmm + + subroutine d_csmv(alpha,a,x,beta,y,info,trans) + class(psbn_d_sparse_mat), intent(in) :: a + real(kind(1.d0)), intent(in) :: alpha, beta, x(:) + real(kind(1.d0)), intent(inout) :: y(:) + integer, intent(out) :: info + character, optional, intent(in) :: trans + + call a%a%psbn_csmm(alpha,x,beta,y,info,trans) + + end subroutine d_csmv + + subroutine d_cssm(alpha,a,x,beta,y,info,trans) + class(psbn_d_sparse_mat), intent(in) :: a + real(kind(1.d0)), intent(in) :: alpha, beta, x(:,:) + real(kind(1.d0)), intent(inout) :: y(:,:) + integer, intent(out) :: info + character, optional, intent(in) :: trans + + call a%a%psbn_cssm(alpha,x,beta,y,info,trans) + + end subroutine d_cssm + + subroutine d_cssv(alpha,a,x,beta,y,info,trans) + class(psbn_d_sparse_mat), intent(in) :: a + real(kind(1.d0)), intent(in) :: alpha, beta, x(:) + real(kind(1.d0)), intent(inout) :: y(:) + integer, intent(out) :: info + character, optional, intent(in) :: trans + + call a%a%psbn_cssm(alpha,x,beta,y,info,trans) + + end subroutine d_cssv + +end module psbn_d_mat_mod +