Skip to content

Commit

Permalink
Fixed incorrect NORTH/EAST boundary indices
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco de Bruine committed Jun 29, 2020
1 parent e5da4f8 commit 1d141d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/modboundary.f90
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ subroutine setboundaries
integer :: n

do n=1,nsv
call closeboundaries(sv0(2-ih:i1+ih,2-jh:j1+jh,1:k1,n), 2,i1,ih, 2,j1,jh, 1,k1, 100.)
call closeboundaries(svm(2-ih:i1+ih,2-jh:j1+jh,1:k1,n), 2,i1,ih, 2,j1,jh, 1,k1, 100.)
call closeboundaries(sv0(2-ih:i1+ih,2-jh:j1+jh,1:k1,n), 2,i1,ih, 2,j1,jh, 1,k1, 0.)
call closeboundaries(svm(2-ih:i1+ih,2-jh:j1+jh,1:k1,n), 2,i1,ih, 2,j1,jh, 1,k1, 0.)
enddo

end subroutine setboundaries
Expand Down
8 changes: 4 additions & 4 deletions src/modmpi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,15 @@ subroutine closeboundaries(field, sx,ex,hx, sy,ey,hy, sz,ez, fillvalue_in)
real,optional :: fillvalue_in
if(present(fillvalue_in)) fillvalue=fillvalue_in

if (myidx == 0) then ! WEST boundary
if (myidx == 0) then ! WEST boundary
field(sx-hx:sx, sy-hy:ey+hy, sz:ez) = fillvalue
else if (myidx == nprocx) then ! EAST boundary
else if (myidx == nprocx-1) then ! EAST boundary
field(ex :ex+hx, sy-hy:ey+hy, sz:ez) = fillvalue
end if

if (myidy == 0) then ! SOUTH boundary
if (myidy == 0) then ! SOUTH boundary
field(sx-hx:ex+hx, sy-hy:sy, sz:ez) = fillvalue
else if (myidy == nprocy) then ! NORTH boundary
else if (myidy == nprocy-1) then ! NORTH boundary
field(sx-hx:ex+hx, ey :ey+hy, sz:ez) = fillvalue
end if

Expand Down

0 comments on commit 1d141d4

Please sign in to comment.