36 class(MethodSubcellType), intent(inout) :: this
37 type(ParticleType), pointer, intent(inout) :: particle
38 class(ParticleEventType), pointer :: event
39
40 integer(I4B) :: i, nhist
41 class(*), pointer :: prev
42
43 allocate (subcellexiteventtype :: event)
44 select type (event)
45 type is (subcellexiteventtype)
46 event%isc = particle%itrdomain(level_subfeature)
47 event%exit_face = particle%iboundary(level_subfeature)
48 end select
49 call this%events%broadcast(particle, event)
50 if (particle%icycwin == 0) then
51 deallocate (event)
52 return
53 end if
54 if (this%forms_cycle(particle, event)) then
55 print *, "Cyclic subcell pathline detected"
56 nhist = particle%history%Count()
57 do i = 1, nhist
58 prev => particle%history%GetItem(i)
59 select type (prev)
60 class is (particleeventtype)
61 print *, "Back ", nhist - i + 1, ": ", prev%get_text()
62 end select
63 end do
64 print *, "Current :", event%get_text()
65 call pstop(1, 'Cyclic subcell pathline detected, aborting')
66 else
67 call this%store_event(particle, event)
68 end if