Skip to content

Commit

Permalink
modify the intent regarding tnsr3d
Browse files Browse the repository at this point in the history
  • Loading branch information
Shiyu-Sandy-Du committed Dec 10, 2024
1 parent 4508b5a commit 4f5ddae
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
5 changes: 3 additions & 2 deletions src/les/elementwise_filter.f90
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,10 @@ end subroutine build_1d

!> Filter a 3D field.
subroutine elementwise_field_filter_3d(this, v, u, nelv)
class(elementwise_filter_t), intent(inout) :: this
class(elementwise_filter_t), intent(in) :: this
integer, intent(inout) :: nelv
real(kind=rp), intent(inout), dimension(this%nx, this%nx, this%nx, nelv) :: u,v
real(kind=rp), intent(inout), dimension(this%nx, this%nx, this%nx, nelv) :: v
real(kind=rp), intent(in), dimension(this%nx, this%nx, this%nx, nelv) :: u

! v = fh x fh x fh x u
call tnsr3d(v, this%nx, u, this%nx, this%fh, this%fht, this%fht, nelv)
Expand Down
8 changes: 4 additions & 4 deletions src/math/bcknd/cpu/tensor_cpu.f90
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ subroutine tnsr3d_cpu(v, nv, u, nu, A, Bt, Ct, nelv)
integer, intent(in) :: nv, nu, nelv
real(kind=rp), intent(inout) :: v(nv*nv*nv,nelv)
real(kind=rp), intent(in) :: u(nu*nu*nu,nelv)
real(kind=rp), intent(inout) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp), intent(in) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)

if (nu .eq. 2 .and. nv .eq. 4) then
call tnsr3d_nu2nv4_cpu(v, u, A, Bt, Ct, nelv)
Expand All @@ -894,7 +894,7 @@ subroutine tnsr3d_nvnu_cpu(v, nv, u, nu, A, Bt, Ct, nelv)
integer, intent(in) :: nv, nu, nelv
real(kind=rp), intent(inout) :: v(nv*nv*nv,nelv)
real(kind=rp), intent(in) :: u(nu*nu*nu,nelv)
real(kind=rp), intent(inout) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp), intent(in) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp) :: work(nu**2*nv), work2(nu*nv**2), tmp
integer :: ie, i, j, k, l, ii, jj
integer :: nunu, nvnu, nvnv
Expand Down Expand Up @@ -953,7 +953,7 @@ subroutine tnsr3d_nu2nv4_cpu(v, u, A, Bt, Ct, nelv)
integer, intent(in) :: nelv
real(kind=rp), intent(inout) :: v(nv*nv*nv,nelv)
real(kind=rp), intent(in) :: u(nu*nu*nu,nelv)
real(kind=rp), intent(inout) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp), intent(in) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp) :: work(nu**2*nv), work2(nu*nv**2), tmp
integer :: ie, i, j, k, l, ii, jj

Expand Down Expand Up @@ -997,7 +997,7 @@ subroutine tnsr3d_nu4_cpu(v, nv, u, A, Bt, Ct, nelv)
integer, intent(in) :: nv, nelv
real(kind=rp), intent(inout) :: v(nv*nv*nv,nelv)
real(kind=rp), intent(in) :: u(nu*nu*nu,nelv)
real(kind=rp), intent(inout) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp), intent(in) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp) :: work(nu**2*nv), work2(nu*nv**2), tmp
integer :: ie, i, j, k, l, ii, jj
integer :: nvnu, nvnv
Expand Down
8 changes: 4 additions & 4 deletions src/math/bcknd/sx/tensor_sx.f90
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ subroutine tnsr3d_sx(v, nv, u, nu, A, Bt, Ct, nelv)
integer, intent(in) :: nv, nu, nelv
real(kind=rp), intent(inout) :: v(nv*nv*nv,nelv)
real(kind=rp), intent(in) :: u(nu*nu*nu,nelv)
real(kind=rp), intent(inout) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp), intent(in) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)

if (nu .eq. 2 .and. nv .eq. 4) then
call tnsr3d_nu2nv4_sx(v, u, A, Bt, Ct, nelv)
Expand All @@ -91,7 +91,7 @@ subroutine tnsr3d_nvnu_sx(v, nv, u, nu, A, Bt, Ct, nelv)
integer, intent(in) :: nv, nu, nelv
real(kind=rp), intent(inout) :: v(nv*nv*nv,nelv)
real(kind=rp), intent(in) :: u(nu*nu*nu,nelv)
real(kind=rp), intent(inout) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp), intent(in) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp) :: work(nu**2*nv), work2(nu*nv**2), tmp
integer :: ie, i, j, k, l, ii, jj
integer :: nunu, nvnu, nvnv
Expand Down Expand Up @@ -150,7 +150,7 @@ subroutine tnsr3d_nu2nv4_sx(v, u, A, Bt, Ct, nelv)
integer, intent(in) :: nelv
real(kind=rp), intent(inout) :: v(nv*nv*nv,nelv)
real(kind=rp), intent(in) :: u(nu*nu*nu,nelv)
real(kind=rp), intent(inout) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp), intent(in) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp) :: work(nu**2*nv,nelv), work2(nu*nv**2,nelv), tmp
integer :: ie, i, j, k, l, ii, jj

Expand Down Expand Up @@ -200,7 +200,7 @@ subroutine tnsr3d_nu4_sx(v, nv, u, A, Bt, Ct, nelv)
integer, intent(in) :: nv, nelv
real(kind=rp), intent(inout) :: v(nv*nv*nv,nelv)
real(kind=rp), intent(in) :: u(nu*nu*nu,nelv)
real(kind=rp), intent(inout) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp), intent(in) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp) :: work(nu**2*nv, nelv), work2(nu*nv**2, nelv), tmp
integer :: ie, i, j, k, l, ii, jj
integer :: nvnu, nvnv
Expand Down
4 changes: 2 additions & 2 deletions src/math/bcknd/xsmm/tensor_xsmm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ subroutine tnsr3d_el_xsmm(v, nv, u, nu, A, Bt, Ct)
end subroutine tnsr3d_el_xsmm

subroutine tnsr3d_xsmm(v, nv, u, nu, A, Bt, Ct, nelv)
integer, intent(inout) :: nv, nu, nelv
integer, intent(in) :: nv, nu, nelv
real(kind=rp), intent(inout) :: v(nv*nv*nv,nelv)
real(kind=rp), intent(in) :: u(nu*nu*nu,nelv)
real(kind=rp), intent(inout) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp), intent(in) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp) :: work(0:nu**2*nv), work2(0:nu*nv**2)
integer :: ie, i, nunu, nvnu, nvnv

Expand Down
4 changes: 2 additions & 2 deletions src/math/tensor.f90
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ end subroutine tnsr3d_el_list
!> Tensor product \f$ v =(C \otimes B \otimes A) u \f$ performed on
!!`nelv` elements.
subroutine tnsr3d(v, nv, u, nu, A, Bt, Ct, nelv)
integer, intent(inout) :: nv, nu, nelv
integer, intent(in) :: nv, nu, nelv
real(kind=rp), intent(inout) :: v(nv*nv*nv,nelv)
real(kind=rp), intent(in) :: u(nu*nu*nu,nelv)
real(kind=rp), intent(inout) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
real(kind=rp), intent(in) :: A(nv,nu), Bt(nu, nv), Ct(nu,nv)
type(c_ptr) :: v_d, u_d, A_d, Bt_d, Ct_d


Expand Down

0 comments on commit 4f5ddae

Please sign in to comment.