From 4f5ddae1dbcd03c00910ac3e1d736975537b648e Mon Sep 17 00:00:00 2001 From: Shiyu-Sandy-Du Date: Tue, 10 Dec 2024 15:22:47 +0100 Subject: [PATCH] modify the intent regarding tnsr3d --- src/les/elementwise_filter.f90 | 5 +++-- src/math/bcknd/cpu/tensor_cpu.f90 | 8 ++++---- src/math/bcknd/sx/tensor_sx.f90 | 8 ++++---- src/math/bcknd/xsmm/tensor_xsmm.F90 | 4 ++-- src/math/tensor.f90 | 4 ++-- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/les/elementwise_filter.f90 b/src/les/elementwise_filter.f90 index beb0c27ea43..b42c346bd15 100644 --- a/src/les/elementwise_filter.f90 +++ b/src/les/elementwise_filter.f90 @@ -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) diff --git a/src/math/bcknd/cpu/tensor_cpu.f90 b/src/math/bcknd/cpu/tensor_cpu.f90 index de2e63ea3b5..0160cc75ec2 100644 --- a/src/math/bcknd/cpu/tensor_cpu.f90 +++ b/src/math/bcknd/cpu/tensor_cpu.f90 @@ -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) @@ -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 @@ -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 @@ -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 diff --git a/src/math/bcknd/sx/tensor_sx.f90 b/src/math/bcknd/sx/tensor_sx.f90 index acb6356d3f3..6e7f57e12a2 100644 --- a/src/math/bcknd/sx/tensor_sx.f90 +++ b/src/math/bcknd/sx/tensor_sx.f90 @@ -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) @@ -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 @@ -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 @@ -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 diff --git a/src/math/bcknd/xsmm/tensor_xsmm.F90 b/src/math/bcknd/xsmm/tensor_xsmm.F90 index 507d5e683db..391d5f59e83 100644 --- a/src/math/bcknd/xsmm/tensor_xsmm.F90 +++ b/src/math/bcknd/xsmm/tensor_xsmm.F90 @@ -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 diff --git a/src/math/tensor.f90 b/src/math/tensor.f90 index 67e92f94a91..bcb3970ca64 100644 --- a/src/math/tensor.f90 +++ b/src/math/tensor.f90 @@ -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