60 character(len=LENBOUNDNAME),
public :: name =
''
61 integer(I4B),
public :: imdl
62 integer(I4B),
public :: iprp
63 integer(I4B),
public :: irpt
64 integer(I4B),
public :: ip
66 logical(LGP),
public :: extend
67 logical(LGP),
public :: frctrn
68 integer(I4B),
public :: istopweaksink
69 integer(I4B),
public :: istopzone
70 integer(I4B),
public :: idrymeth
71 integer(I4B),
public :: iexmeth
72 integer(I4B),
public :: icycwin
73 real(dp),
public :: extol
77 integer(I4B),
public :: icu
78 integer(I4B),
public :: ilay
79 integer(I4B),
public :: izone
80 integer(I4B),
public :: istatus
84 real(dp),
public :: trelease
85 real(dp),
public :: tstop
86 real(dp),
public :: ttrack
87 real(dp),
public :: xorigin
88 real(dp),
public :: yorigin
89 real(dp),
public :: zorigin
90 real(dp),
public :: sinrot
91 real(dp),
public :: cosrot
92 logical(LGP),
public :: transformed
93 logical(LGP),
public :: advancing
107 character(len=LENBOUNDNAME),
dimension(:),
pointer,
public,
contiguous :: name
108 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: imdl
109 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: iprp
110 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: irpt
112 logical(LGP),
dimension(:),
pointer,
public,
contiguous :: extend
113 logical(LGP),
dimension(:),
pointer,
public,
contiguous :: frctrn
114 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: istopweaksink
115 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: istopzone
116 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: idrymeth
117 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: iexmeth
118 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: icycwin
119 real(dp),
dimension(:),
pointer,
public,
contiguous :: extol
121 integer(I4B),
dimension(:, :),
pointer,
public,
contiguous :: itrdomain
122 integer(I4B),
dimension(:, :),
pointer,
public,
contiguous :: iboundary
123 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: icu
124 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: ilay
125 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: izone
126 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: istatus
127 real(dp),
dimension(:),
pointer,
public,
contiguous :: x
128 real(dp),
dimension(:),
pointer,
public,
contiguous :: y
129 real(dp),
dimension(:),
pointer,
public,
contiguous :: z
130 real(dp),
dimension(:),
pointer,
public,
contiguous :: trelease
131 real(dp),
dimension(:),
pointer,
public,
contiguous :: tstop
132 real(dp),
dimension(:),
pointer,
public,
contiguous :: ttrack
147 allocate (particle%history)
153 integer(I4B),
intent(in) :: np
154 character(*),
intent(in) :: mempath
164 call mem_allocate(store%istatus, np,
'PLISTATUS', mempath)
168 call mem_allocate(store%trelease, np,
'PLTRELEASE', mempath)
170 call mem_allocate(store%ttrack, np,
'PLTTRACK', mempath)
171 call mem_allocate(store%istopweaksink, np,
'PLISTOPWEAKSINK', mempath)
172 call mem_allocate(store%istopzone, np,
'PLISTOPZONE', mempath)
173 call mem_allocate(store%idrymeth, np,
'PLIDRYMETH', mempath)
174 call mem_allocate(store%frctrn, np,
'PLFRCTRN', mempath)
175 call mem_allocate(store%iexmeth, np,
'PLIEXMETH', mempath)
177 call mem_allocate(store%extend, np,
'PLEXTEND', mempath)
178 call mem_allocate(store%icycwin, np,
'PLICYCWIN', mempath)
186 character(*),
intent(in) :: mempath
202 call mem_deallocate(this%istopweaksink,
'PLISTOPWEAKSINK', mempath)
217 deallocate (particle%history)
224 integer(I4B),
intent(in) :: np
225 character(*),
intent(in) :: mempath
242 call mem_reallocate(this%istopweaksink, np,
'PLISTOPWEAKSINK', mempath)
259 subroutine get(this, particle, imdl, iprp, ip)
262 integer(I4B),
intent(in) :: imdl
263 integer(I4B),
intent(in) :: iprp
264 integer(I4B),
intent(in) :: ip
266 call particle%reset_transform()
267 call particle%history%Clear()
270 particle%irpt = this%irpt(ip)
272 particle%name = this%name(ip)
273 particle%istopweaksink = this%istopweaksink(ip)
274 particle%istopzone = this%istopzone(ip)
275 particle%idrymeth = this%idrymeth(ip)
276 particle%icu = this%icu(ip)
277 particle%ilay = this%ilay(ip)
278 particle%izone = this%izone(ip)
279 particle%istatus = this%istatus(ip)
280 particle%x = this%x(ip)
281 particle%y = this%y(ip)
282 particle%z = this%z(ip)
283 particle%trelease = this%trelease(ip)
284 particle%tstop = this%tstop(ip)
285 particle%ttrack = this%ttrack(ip)
286 particle%advancing = .true.
289 particle%itrdomain(1) = imdl
292 particle%frctrn = this%frctrn(ip)
293 particle%iexmeth = this%iexmeth(ip)
294 particle%extol = this%extol(ip)
295 particle%extend = this%extend(ip)
296 particle%icycwin = this%icycwin(ip)
300 subroutine put(this, particle, ip)
303 integer(I4B),
intent(in) :: ip
305 this%imdl(ip) = particle%imdl
306 this%iprp(ip) = particle%iprp
307 this%irpt(ip) = particle%irpt
308 this%name(ip) = particle%name
309 this%istopweaksink(ip) = particle%istopweaksink
310 this%istopzone(ip) = particle%istopzone
311 this%idrymeth(ip) = particle%idrymeth
312 this%icu(ip) = particle%icu
313 this%ilay(ip) = particle%ilay
314 this%izone(ip) = particle%izone
315 this%istatus(ip) = particle%istatus
316 this%x(ip) = particle%x
317 this%y(ip) = particle%y
318 this%z(ip) = particle%z
319 this%trelease(ip) = particle%trelease
320 this%tstop(ip) = particle%tstop
321 this%ttrack(ip) = particle%ttrack
330 this%frctrn(ip) = particle%frctrn
331 this%iexmeth(ip) = particle%iexmeth
332 this%extol(ip) = particle%extol
333 this%extend(ip) = particle%extend
334 this%icycwin(ip) = particle%icycwin
344 sinrot, cosrot, invert)
347 real(DP),
intent(in),
optional :: xorigin
348 real(DP),
intent(in),
optional :: yorigin
349 real(DP),
intent(in),
optional :: zorigin
350 real(DP),
intent(in),
optional :: sinrot
351 real(DP),
intent(in),
optional :: cosrot
352 logical(LGP),
intent(in),
optional :: invert
355 this%x, this%y, this%z, &
356 xorigin, yorigin, zorigin, &
357 sinrot, cosrot, invert)
359 call compose(this%xorigin, this%yorigin, this%zorigin, &
360 this%sinrot, this%cosrot, &
361 xorigin, yorigin, zorigin, &
362 sinrot, cosrot, invert)
364 this%transformed = .true.
377 this%transformed = .false.
386 real(DP),
intent(out) :: x
387 real(DP),
intent(out) :: y
388 real(DP),
intent(out) :: z
390 if (this%transformed)
then
391 call transform(this%x, this%y, this%z, x, y, z, &
392 this%xorigin, this%yorigin, this%zorigin, &
393 this%sinrot, this%cosrot, invert=.true.)
410 character(len=:),
allocatable :: str
412 character(len=LINELENGTH) :: temp
414 write (temp,
'(I0,1a,I0,1a,I0,1a,G0)') &
415 this%imdl, this%iprp, this%irpt, this%trelease
416 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.