Skip to content

Commit

Permalink
Minor fix in clipping function.
Browse files Browse the repository at this point in the history
  • Loading branch information
p-costa committed Jan 18, 2024
1 parent 0dba767 commit 9102647
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/two_fluid.f90
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,18 @@ subroutine clip_field(nh,minmax,p)
real(rp), intent(in ), dimension(2) :: minmax
real(rp), intent(inout), dimension(1-nh(1):,1-nh(2):,1-nh(3):) :: p
real(rp) :: rmin,rmax
integer :: n1,n2,n3,i,j,k
integer :: n1,n2,n3,nh1,nh2,nh3,i,j,k
!
n1 = size(p,1)-2*nh(1)
n2 = size(p,2)-2*nh(2)
n3 = size(p,3)-2*nh(3)
nh1 = nh(1)
nh2 = nh(2)
nh3 = nh(3)
rmin = minmax(1); rmax = minmax(2)
!
!$acc parallel loop collapse(3) default(present) private(rmin,rmax) async(1)
do concurrent(k=0:n3-1,j=0:n2-1,i=0:n1-1)
do concurrent(k=1-nh3:n3+nh3,j=1-nh2:n2+nh2,i=1-nh1:n1+nh1)
p(i,j,k) = min(max(rmin,p(i,j,k)),rmax)
end do
end subroutine clip_field
Expand Down

0 comments on commit 9102647

Please sign in to comment.