BOUNDARIES: Convert arguments in a vector in block_edge_restict().

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2020-08-08 17:56:55 -03:00
parent d82c04e5de
commit 99535b97f0

View File

@ -3074,12 +3074,12 @@ module boundaries
! data block
!
#if NDIMS == 2
call block_edge_restrict(idir, i, j, k &
call block_edge_restrict(idir, (/ i, j, k /) &
, pneigh%data%q(1:nv, : , : , : ) &
, pmeta%data%q(1:nv,il:iu,jl:ju, : ))
#endif /* NDIMS == 2 */
#if NDIMS == 3
call block_edge_restrict(idir, i, j, k &
call block_edge_restrict(idir, (/ i, j, k /) &
, pneigh%data%q(1:nv, : , : , : ) &
, pmeta%data%q(1:nv,il:iu,jl:ju,kl:ku))
#endif /* NDIMS == 3 */
@ -3205,29 +3205,29 @@ module boundaries
select case(idir)
case(1)
#if NDIMS == 2
call block_edge_restrict(idir, i, j, k &
call block_edge_restrict(idir, (/ i, j, k /) &
, pneigh%data%q(1:nv, : , : , : ) &
, sbuf(l,1:nv,1:nh,1:ng, : ))
#endif /* NDIMS == 2 */
#if NDIMS == 3
call block_edge_restrict(idir, i, j, k &
call block_edge_restrict(idir, (/ i, j, k /) &
, pneigh%data%q(1:nv, : , : , : ) &
, sbuf(l,1:nv,1:nh,1:ng,1:ng))
#endif /* NDIMS == 3 */
case(2)
#if NDIMS == 2
call block_edge_restrict(idir, i, j, k &
call block_edge_restrict(idir, (/ i, j, k /) &
, pneigh%data%q(1:nv, : , : , : ) &
, sbuf(l,1:nv,1:ng,1:nh, : ))
#endif /* NDIMS == 2 */
#if NDIMS == 3
call block_edge_restrict(idir, i, j, k &
call block_edge_restrict(idir, (/ i, j, k /) &
, pneigh%data%q(1:nv, : , : , : ) &
, sbuf(l,1:nv,1:ng,1:nh,1:ng))
#endif /* NDIMS == 3 */
#if NDIMS == 3
case(3)
call block_edge_restrict(idir, i, j, k &
call block_edge_restrict(idir, (/ i, j, k /) &
, pneigh%data%q(1:nv, : , : , : ) &
, sbuf(l,1:nv,1:ng,1:ng,1:nh))
#endif /* NDIMS == 3 */
@ -5888,14 +5888,14 @@ module boundaries
!
! Arguments:
!
! nc - the edge direction;
! ic, jc, kc - the corner position;
! dir - the edge direction;
! pos - the edge position;
! qn - the input neighbor variable array;
! qb - the output edge boundary array;
!
!===============================================================================
!
subroutine block_edge_restrict(nc, ic, jc, kc, qn, qb)
subroutine block_edge_restrict(dir, pos, qn, qb)
! import external procedures and variables
!
@ -5909,7 +5909,8 @@ module boundaries
! subroutine arguments
!
integer , intent(in) :: nc, ic, jc, kc
integer , intent(in) :: dir
integer , dimension(3) , intent(in) :: pos
real(kind=8), dimension(:,:,:,:), intent(in) :: qn
real(kind=8), dimension(:,:,:,:), intent(out) :: qb
@ -5926,28 +5927,28 @@ module boundaries
! prepare indices for the edge region
!
#if NDIMS == 2
il = edges_dr(ic,jc,nc)%l(1)
jl = edges_dr(ic,jc,nc)%l(2)
il = edges_dr(pos(1),pos(2),dir)%l(1)
jl = edges_dr(pos(1),pos(2),dir)%l(2)
ip = il + 1
jp = jl + 1
iu = edges_dr(ic,jc,nc)%u(1)
ju = edges_dr(ic,jc,nc)%u(2)
iu = edges_dr(pos(1),pos(2),dir)%u(1)
ju = edges_dr(pos(1),pos(2),dir)%u(2)
#endif /* NDIMS == 2 */
#if NDIMS == 3
il = edges_dr(ic,jc,kc,nc)%l(1)
jl = edges_dr(ic,jc,kc,nc)%l(2)
kl = edges_dr(ic,jc,kc,nc)%l(3)
il = edges_dr(pos(1),pos(2),pos(3),dir)%l(1)
jl = edges_dr(pos(1),pos(2),pos(3),dir)%l(2)
kl = edges_dr(pos(1),pos(2),pos(3),dir)%l(3)
ip = il + 1
jp = jl + 1
kp = kl + 1
iu = edges_dr(ic,jc,kc,nc)%u(1)
ju = edges_dr(ic,jc,kc,nc)%u(2)
ku = edges_dr(ic,jc,kc,nc)%u(3)
iu = edges_dr(pos(1),pos(2),pos(3),dir)%u(1)
ju = edges_dr(pos(1),pos(2),pos(3),dir)%u(2)
ku = edges_dr(pos(1),pos(2),pos(3),dir)%u(3)
#endif /* NDIMS == 3 */
! process depending on the direction
!
select case(nc)
select case(dir)
case(1)
! restrict the edge region to the output array