From 31f7e91b21a07934e77a1b3d4ca794e65a9485db Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Tue, 12 Jan 2016 15:30:47 -0500 Subject: [PATCH 1/2] Make lattice outer error non-fatal --- src/geometry.F90 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/geometry.F90 b/src/geometry.F90 index 9a084a77cb..90fbc263ac 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -308,9 +308,10 @@ contains else ! Particle is outside the lattice. if (lat % outer == NO_OUTER_UNIVERSE) then - call fatal_error("A particle is outside latttice " & - // trim(to_str(lat % id)) // " but the lattice has no & - &defined outer universe.") + call handle_lost_particle(p, "Particle " // trim(to_str(p %id)) & + // " is outside lattice " // trim(to_str(lat % id)) & + // " but the lattice has no defined outer universe.") + return else p % coord(j + 1) % universe = lat % outer end if From b6d47c7054d95465b0093dea3d17014a657fc057 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Tue, 12 Jan 2016 15:44:50 -0500 Subject: [PATCH 2/2] Prevent handle_lost_particle being called twice --- src/geometry.F90 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/geometry.F90 b/src/geometry.F90 index 90fbc263ac..94f8876ed4 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -537,9 +537,11 @@ contains p % n_coord = 1 call find_cell(p, found) if (.not. found) then - call handle_lost_particle(p, "Could not locate particle " & - // trim(to_str(p % id)) // " after crossing a lattice boundary.") - return + if (p % alive) then ! Particle may have been killed in find_cell + call handle_lost_particle(p, "Could not locate particle " & + // trim(to_str(p % id)) // " after crossing a lattice boundary.") + return + end if end if else OUTSIDE_LAT