@@ -317,27 +317,51 @@ contains
317317
318318 ! x- dir
319319 if (bc_x%beg == - 2 .and. (cell(1 ) <= mapCells - 1 )) then
320- cellaux(1 ) = abs (cellaux(1 )) - 1
320+ if (cell(1 ) >= 0 ) then
321+ cellaux(1 ) = abs (cellaux(1 )) - 1
322+ else
323+ print * , " Lagrangian bubbles must not be located in the ghost cells of a symmetric boundary (bc_x%beg)."
324+ end if
321325 end if
322326 if (bc_x%end == - 2 .and. (cell(1 ) >= m + 1 - mapCells)) then
323- cellaux(1 ) = cellaux(1 ) - (2 * (cellaux(1 ) - m) - 1 )
327+ if (cell(1 ) <= m) then
328+ cellaux(1 ) = cellaux(1 ) - (2 * (cellaux(1 ) - m) - 1 )
329+ else
330+ print * , " Lagrangian bubbles must not be located in the ghost cells of a symmetric boundary (bc_x%end)."
331+ end if
324332 end if
325333
326334 !y- dir
327335 if (bc_y%beg == - 2 .and. (cell(2 ) <= mapCells - 1 )) then
328- cellaux(2 ) = abs (cellaux(2 )) - 1
336+ if (cell(2 ) >= 0 ) then
337+ cellaux(2 ) = abs (cellaux(2 )) - 1
338+ else
339+ print * , " Lagrangian bubbles must not be located in the ghost cells of a symmetric boundary (bc_y%beg)."
340+ end if
329341 end if
330342 if (bc_y%end == - 2 .and. (cell(2 ) >= n + 1 - mapCells)) then
331- cellaux(2 ) = cellaux(2 ) - (2 * (cellaux(2 ) - n) - 1 )
343+ if (cell(2 ) <= n) then
344+ cellaux(2 ) = cellaux(2 ) - (2 * (cellaux(2 ) - n) - 1 )
345+ else
346+ print * , " Lagrangian bubbles must not be located in the ghost cells of a symmetric boundary (bc_y%end)."
347+ end if
332348 end if
333349
334350 if (p > 0 ) then
335351 !z- dir
336352 if (bc_z%beg == - 2 .and. (cell(3 ) <= mapCells - 1 )) then
337- cellaux(3 ) = abs (cellaux(3 )) - 1
353+ if (cell(3 ) >= 0 ) then
354+ cellaux(3 ) = abs (cellaux(3 )) - 1
355+ else
356+ print * , " Lagrangian bubbles must not be located in the ghost cells of a symmetric boundary (bc_z%beg)."
357+ end if
338358 end if
339359 if (bc_z%end == - 2 .and. (cell(3 ) >= p + 1 - mapCells)) then
340- cellaux(3 ) = cellaux(3 ) - (2 * (cellaux(3 ) - p) - 1 )
360+ if (cell(3 ) <= p) then
361+ cellaux(3 ) = cellaux(3 ) - (2 * (cellaux(3 ) - p) - 1 )
362+ else
363+ print * , " Lagrangian bubbles must not be located in the ghost cells of a symmetric boundary (bc_z%end)."
364+ end if
341365 end if
342366 end if
343367
0 commit comments