Check a number of conditions determining whether to continue tracking the particle or terminate it, as well as whether to record any output data as per selected reporting conditions.
33 class(MethodCellType),
intent(inout) :: this
34 type(ParticleType),
pointer,
intent(inout) :: particle
35 type(CellDefnType),
pointer,
intent(inout) :: cell_defn
36 real(DP),
intent(in) :: tmax
38 logical(LGP) :: dry_cell, dry_particle, no_exit_face, stop_zone, weak_sink
40 real(DP) :: t, ttrackmax
42 dry_cell = this%fmi%ibdgwfsat0(cell_defn%icell) == 0
43 dry_particle = particle%z > cell_defn%top
44 no_exit_face = cell_defn%inoexitface > 0
45 stop_zone = cell_defn%izone > 0 .and. particle%istopzone == cell_defn%izone
46 weak_sink = cell_defn%iweaksink > 0
48 particle%izone = cell_defn%izone
50 particle%advancing = .false.
52 call this%save(particle, reason=3)
56 if (no_exit_face .and. .not. dry_cell)
then
57 particle%advancing = .false.
59 call this%save(particle, reason=3)
64 if (particle%istopweaksink > 0)
then
65 particle%advancing = .false.
67 call this%save(particle, reason=3)
70 call this%save(particle, reason=4)
75 if (particle%idrymeth == 0)
then
78 no_exit_face = .false.
79 else if (particle%idrymeth == 1)
then
81 particle%advancing = .false.
83 call this%save(particle, reason=3)
85 else if (particle%idrymeth == 2)
then
87 particle%advancing = .false.
88 no_exit_face = .false.
100 particle%ttrack =
totim
101 call this%save(particle, reason=2)
104 call this%tracktimes%advance()
105 if (this%tracktimes%any())
then
106 do i = this%tracktimes%selection(1), this%tracktimes%selection(2)
107 t = this%tracktimes%times(i)
111 call this%save(particle, reason=5)
112 if (t > ttrackmax) ttrackmax = t
119 particle%ttrack = ttrackmax
120 call this%save(particle, reason=3)
124 else if (dry_particle .and. this%name /=
"passtobottom")
then
125 if (particle%idrymeth == 0)
then
127 particle%z = cell_defn%top
128 call this%save(particle, reason=1)
129 else if (particle%idrymeth == 1)
then
131 particle%advancing = .false.
133 call this%save(particle, reason=3)
135 else if (particle%idrymeth == 2)
then
137 particle%advancing = .false.
138 no_exit_face = .false.
150 particle%ttrack =
totim
151 call this%save(particle, reason=2)
154 call this%tracktimes%advance()
155 if (this%tracktimes%any())
then
156 do i = this%tracktimes%selection(1), this%tracktimes%selection(2)
157 t = this%tracktimes%times(i)
161 call this%save(particle, reason=5)
162 if (t > ttrackmax) ttrackmax = t
168 if (no_exit_face)
then
169 particle%advancing = .false.
171 call this%save(particle, reason=3)
@ term_weaksink
terminated in a weak sink cell
@ term_inactive
terminated in an inactive cell
@ term_no_exits
terminated in a cell with no exit face
@ term_stopzone
terminated in a cell with a stop zone number
logical(lgp), pointer, public endofsimulation
flag indicating end of simulation
real(dp), pointer, public totim
time relative to start of simulation
real(dp), pointer, public totimc
simulation time at start of time step