subroutine trfrmb(bvec,vec,nvec,ndsr)
use precision, only: dp
implicit none
real(kind=dp), intent(inout), dimension(:,:) :: bvec
real(kind=dp), intent(in), dimension(:,:) :: vec
integer, intent(in) :: nvec, ndsr
real(kind=dp), allocatable, dimension(:,:) :: scr
integer :: xvec_dim
xvec_dim = ubound(bvec, 1)
allocate(scr(xvec_dim,ndsr), &
source=0.0_dp)
scr = bvec
! Get a new Bvec
call dgemm('n', 'n', xvec_dim, ndsr, nvec, &
1.0_dp, scr, xvec_dim, &
vec, nvec,&
0.0_dp, bvec, xvec_dim)
! do ii = 1, xvec_dim
! do jj = 1, ndsr
! bvec(ii,jj) = 0.0_dp
! do kk = 1, nvec
! bvec(ii,jj) = bvec(ii,jj)+scr(ii,kk)*vec(kk,jj)
! end do
! end do
! end do
deallocate(scr)
end subroutine trfrmb