65 character(len=LENBOUNDNAME),
public :: name =
''
66 integer(I4B),
public :: imdl
67 integer(I4B),
public :: iprp
68 integer(I4B),
public :: irpt
69 integer(I4B),
public :: ip
71 logical(LGP),
public :: extend
72 logical(LGP),
public :: frctrn
73 integer(I4B),
public :: istopweaksink
74 integer(I4B),
public :: istopzone
75 integer(I4B),
public :: idrymeth
76 integer(I4B),
public :: iexmeth
77 integer(I4B),
public :: icycwin
78 real(dp),
public :: extol
82 integer(I4B),
public :: icu
83 integer(I4B),
public :: ilay
84 integer(I4B),
public :: izone
85 integer(I4B),
public :: istatus
89 real(dp),
public :: trelease
90 real(dp),
public :: tstop
91 real(dp),
public :: ttrack
92 real(dp),
public :: xorigin
93 real(dp),
public :: yorigin
94 real(dp),
public :: zorigin
95 real(dp),
public :: sinrot
96 real(dp),
public :: cosrot
97 logical(LGP),
public :: transformed
98 logical(LGP),
public :: advancing
112 character(len=LENBOUNDNAME),
dimension(:),
pointer,
public,
contiguous :: name
113 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: imdl
114 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: iprp
115 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: irpt
117 logical(LGP),
dimension(:),
pointer,
public,
contiguous :: extend
118 logical(LGP),
dimension(:),
pointer,
public,
contiguous :: frctrn
119 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: istopweaksink
120 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: istopzone
121 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: idrymeth
122 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: iexmeth
123 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: icycwin
124 real(dp),
dimension(:),
pointer,
public,
contiguous :: extol
126 integer(I4B),
dimension(:, :),
pointer,
public,
contiguous :: itrdomain
127 integer(I4B),
dimension(:, :),
pointer,
public,
contiguous :: iboundary
128 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: icu
129 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: ilay
130 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: izone
131 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: istatus
132 real(dp),
dimension(:),
pointer,
public,
contiguous :: x
133 real(dp),
dimension(:),
pointer,
public,
contiguous :: y
134 real(dp),
dimension(:),
pointer,
public,
contiguous :: z
135 real(dp),
dimension(:),
pointer,
public,
contiguous :: trelease
136 real(dp),
dimension(:),
pointer,
public,
contiguous :: tstop
137 real(dp),
dimension(:),
pointer,
public,
contiguous :: ttrack
152 allocate (particle%history)
158 integer(I4B),
intent(in) :: np
159 character(*),
intent(in) :: mempath
169 call mem_allocate(store%istatus, np,
'PLISTATUS', mempath)
173 call mem_allocate(store%trelease, np,
'PLTRELEASE', mempath)
175 call mem_allocate(store%ttrack, np,
'PLTTRACK', mempath)
176 call mem_allocate(store%istopweaksink, np,
'PLISTOPWEAKSINK', mempath)
177 call mem_allocate(store%istopzone, np,
'PLISTOPZONE', mempath)
178 call mem_allocate(store%idrymeth, np,
'PLIDRYMETH', mempath)
179 call mem_allocate(store%frctrn, np,
'PLFRCTRN', mempath)
180 call mem_allocate(store%iexmeth, np,
'PLIEXMETH', mempath)
182 call mem_allocate(store%extend, np,
'PLEXTEND', mempath)
183 call mem_allocate(store%icycwin, np,
'PLICYCWIN', mempath)
191 character(*),
intent(in) :: mempath
207 call mem_deallocate(this%istopweaksink,
'PLISTOPWEAKSINK', mempath)
222 deallocate (particle%history)
229 integer(I4B),
intent(in) :: np
230 character(*),
intent(in) :: mempath
247 call mem_reallocate(this%istopweaksink, np,
'PLISTOPWEAKSINK', mempath)
264 subroutine get(this, particle, imdl, iprp, ip)
267 integer(I4B),
intent(in) :: imdl
268 integer(I4B),
intent(in) :: iprp
269 integer(I4B),
intent(in) :: ip
271 call particle%reset_transform()
272 call particle%history%Clear()
275 particle%irpt = this%irpt(ip)
277 particle%name = this%name(ip)
278 particle%istopweaksink = this%istopweaksink(ip)
279 particle%istopzone = this%istopzone(ip)
280 particle%idrymeth = this%idrymeth(ip)
281 particle%icu = this%icu(ip)
282 particle%ilay = this%ilay(ip)
283 particle%izone = this%izone(ip)
284 particle%istatus = this%istatus(ip)
285 particle%x = this%x(ip)
286 particle%y = this%y(ip)
287 particle%z = this%z(ip)
288 particle%trelease = this%trelease(ip)
289 particle%tstop = this%tstop(ip)
290 particle%ttrack = this%ttrack(ip)
291 particle%advancing = .true.
294 particle%itrdomain(1) = imdl
297 particle%frctrn = this%frctrn(ip)
298 particle%iexmeth = this%iexmeth(ip)
299 particle%extol = this%extol(ip)
300 particle%extend = this%extend(ip)
301 particle%icycwin = this%icycwin(ip)
305 subroutine put(this, particle, ip)
308 integer(I4B),
intent(in) :: ip
310 this%imdl(ip) = particle%imdl
311 this%iprp(ip) = particle%iprp
312 this%irpt(ip) = particle%irpt
313 this%name(ip) = particle%name
314 this%istopweaksink(ip) = particle%istopweaksink
315 this%istopzone(ip) = particle%istopzone
316 this%idrymeth(ip) = particle%idrymeth
317 this%icu(ip) = particle%icu
318 this%ilay(ip) = particle%ilay
319 this%izone(ip) = particle%izone
320 this%istatus(ip) = particle%istatus
321 this%x(ip) = particle%x
322 this%y(ip) = particle%y
323 this%z(ip) = particle%z
324 this%trelease(ip) = particle%trelease
325 this%tstop(ip) = particle%tstop
326 this%ttrack(ip) = particle%ttrack
335 this%frctrn(ip) = particle%frctrn
336 this%iexmeth(ip) = particle%iexmeth
337 this%extol(ip) = particle%extol
338 this%extend(ip) = particle%extend
339 this%icycwin(ip) = particle%icycwin
349 sinrot, cosrot, invert)
352 real(DP),
intent(in),
optional :: xorigin
353 real(DP),
intent(in),
optional :: yorigin
354 real(DP),
intent(in),
optional :: zorigin
355 real(DP),
intent(in),
optional :: sinrot
356 real(DP),
intent(in),
optional :: cosrot
357 logical(LGP),
intent(in),
optional :: invert
360 this%x, this%y, this%z, &
361 xorigin, yorigin, zorigin, &
362 sinrot, cosrot, invert)
369 call compose(this%xorigin, this%yorigin, this%zorigin, &
370 this%sinrot, this%cosrot, &
371 xorigin, yorigin, zorigin, &
372 sinrot, cosrot, invert)
374 this%transformed = .true.
387 this%transformed = .false.
396 real(DP),
intent(out) :: x
397 real(DP),
intent(out) :: y
398 real(DP),
intent(out) :: z
400 if (this%transformed)
then
401 call transform(this%x, this%y, this%z, x, y, z, &
402 this%xorigin, this%yorigin, this%zorigin, &
403 this%sinrot, this%cosrot, invert=.true.)
420 character(len=:),
allocatable :: str
422 character(len=LINELENGTH) :: temp
424 write (temp,
'(I0,1a,I0,1a,I0,1a,G0)') &
425 this%imdl, this%iprp, this%irpt, this%trelease
426 str = trim(adjustl(temp))
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lenboundname
maximum length of a bound name
real(dp), parameter dzero
real constant zero
integer(i4b), parameter lenmempath
maximum length of the memory path
real(dp), parameter done
real constant 1
subroutine, public transform(xin, yin, zin, xout, yout, zout, xorigin, yorigin, zorigin, sinrot, cosrot, invert)
Apply a 3D translation and optional 2D rotation to coordinates.
subroutine, public compose(xorigin, yorigin, zorigin, sinrot, cosrot, xorigin_new, yorigin_new, zorigin_new, sinrot_new, cosrot_new, invert)
Apply a 3D translation and 2D rotation to an existing transformation.
This module defines variable data types.
subroutine get(this, particle, imdl, iprp, ip)
Load a particle from the particle store.
subroutine resize(this, np, mempath)
Reallocate particle storage to the given size.
subroutine create_particle_store(store, np, mempath)
Allocate particle store.
character(len=:) function, allocatable get_id(this)
Get a string identifier for the particle.
subroutine get_model_coords(this, x, y, z)
Return the particle's model coordinates, inverting any applied transformation if needed....
integer function num_stored(this)
Return the number of particles.
subroutine reset_transform(this)
Reset particle coordinate transformation properties.
@ term_weaksink
terminated in a weak sink cell
@ term_timeout
terminated at stop time or end of simulation
@ 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
@ term_no_exits_sub
terminated in a subcell with no exit face
@ term_unreleased
terminated permanently unreleased
@ term_boundary
terminated at a boundary face
subroutine transform_coords(this, xorigin, yorigin, zorigin, sinrot, cosrot, invert)
Transform particle coordinates.
subroutine destroy(this, mempath)
Destroy particle store after use.
subroutine create_particle(particle)
Create a new particle.
subroutine put(this, particle, ip)
Save a particle's state to the particle store.
integer, parameter max_level
Tracking "levels" defined in method modules. Currently only 3 used.
subroutine destroy_particle(particle)
Destroy a particle after use.
A generic heterogeneous doubly-linked list.
Structure of arrays to store particles.
Particle tracked by the PRT model.