67 character(len=LENBOUNDNAME),
public :: name =
''
68 integer(I4B),
public :: imdl
69 integer(I4B),
public :: iprp
70 integer(I4B),
public :: irpt
71 integer(I4B),
public :: ip
73 logical(LGP),
public :: extend
74 logical(LGP),
public :: frctrn
75 integer(I4B),
public :: istopweaksink
76 integer(I4B),
public :: istopzone
77 integer(I4B),
public :: idrymeth
78 integer(I4B),
public :: iexmeth
79 integer(I4B),
public :: icycwin
80 real(dp),
public :: extol
84 integer(I4B),
public :: icu
85 integer(I4B),
public :: ilay
86 integer(I4B),
public :: izone
87 integer(I4B),
public :: istatus
91 real(dp),
public :: trelease
92 real(dp),
public :: tstop
93 real(dp),
public :: ttrack
94 real(dp),
public :: xorigin
95 real(dp),
public :: yorigin
96 real(dp),
public :: zorigin
97 real(dp),
public :: sinrot
98 real(dp),
public :: cosrot
99 logical(LGP),
public :: transformed
100 logical(LGP),
public :: advancing
114 character(len=LENBOUNDNAME),
dimension(:),
pointer,
public,
contiguous :: name
115 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: imdl
116 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: iprp
117 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: irpt
119 logical(LGP),
dimension(:),
pointer,
public,
contiguous :: extend
120 logical(LGP),
dimension(:),
pointer,
public,
contiguous :: frctrn
121 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: istopweaksink
122 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: istopzone
123 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: idrymeth
124 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: iexmeth
125 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: icycwin
126 real(dp),
dimension(:),
pointer,
public,
contiguous :: extol
128 integer(I4B),
dimension(:, :),
pointer,
public,
contiguous :: itrdomain
129 integer(I4B),
dimension(:, :),
pointer,
public,
contiguous :: iboundary
130 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: icu
131 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: ilay
132 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: izone
133 integer(I4B),
dimension(:),
pointer,
public,
contiguous :: istatus
134 real(dp),
dimension(:),
pointer,
public,
contiguous :: x
135 real(dp),
dimension(:),
pointer,
public,
contiguous :: y
136 real(dp),
dimension(:),
pointer,
public,
contiguous :: z
137 real(dp),
dimension(:),
pointer,
public,
contiguous :: trelease
138 real(dp),
dimension(:),
pointer,
public,
contiguous :: tstop
139 real(dp),
dimension(:),
pointer,
public,
contiguous :: ttrack
155 allocate (particle%history)
161 integer(I4B),
intent(in) :: np
162 character(*),
intent(in) :: mempath
172 call mem_allocate(store%istatus, np,
'PLISTATUS', mempath)
176 call mem_allocate(store%trelease, np,
'PLTRELEASE', mempath)
178 call mem_allocate(store%ttrack, np,
'PLTTRACK', mempath)
179 call mem_allocate(store%istopweaksink, np,
'PLISTOPWEAKSINK', mempath)
180 call mem_allocate(store%istopzone, np,
'PLISTOPZONE', mempath)
181 call mem_allocate(store%idrymeth, np,
'PLIDRYMETH', mempath)
182 call mem_allocate(store%frctrn, np,
'PLFRCTRN', mempath)
183 call mem_allocate(store%iexmeth, np,
'PLIEXMETH', mempath)
185 call mem_allocate(store%extend, np,
'PLEXTEND', mempath)
186 call mem_allocate(store%icycwin, np,
'PLICYCWIN', mempath)
194 character(*),
intent(in) :: mempath
210 call mem_deallocate(this%istopweaksink,
'PLISTOPWEAKSINK', mempath)
225 deallocate (particle%history)
232 integer(I4B),
intent(in) :: np
233 character(*),
intent(in) :: mempath
249 call mem_reallocate(this%istopweaksink, np,
'PLISTOPWEAKSINK', mempath)
266 subroutine get(this, particle, imdl, iprp, ip)
269 integer(I4B),
intent(in) :: imdl
270 integer(I4B),
intent(in) :: iprp
271 integer(I4B),
intent(in) :: ip
273 call particle%reset_transform()
274 call particle%history%Clear()
277 particle%irpt = this%irpt(ip)
279 particle%name = this%name(ip)
280 particle%istopweaksink = this%istopweaksink(ip)
281 particle%istopzone = this%istopzone(ip)
282 particle%idrymeth = this%idrymeth(ip)
283 particle%icu = this%icu(ip)
284 particle%ilay = this%ilay(ip)
285 particle%izone = this%izone(ip)
286 particle%istatus = this%istatus(ip)
287 particle%x = this%x(ip)
288 particle%y = this%y(ip)
289 particle%z = this%z(ip)
290 particle%trelease = this%trelease(ip)
291 particle%tstop = this%tstop(ip)
292 particle%ttrack = this%ttrack(ip)
293 particle%advancing = .true.
296 particle%itrdomain(1) = imdl
299 particle%frctrn = this%frctrn(ip)
300 particle%iexmeth = this%iexmeth(ip)
301 particle%extol = this%extol(ip)
302 particle%extend = this%extend(ip)
303 particle%icycwin = this%icycwin(ip)
307 subroutine put(this, particle, ip)
310 integer(I4B),
intent(in) :: ip
312 this%imdl(ip) = particle%imdl
313 this%iprp(ip) = particle%iprp
314 this%irpt(ip) = particle%irpt
315 this%name(ip) = particle%name
316 this%istopweaksink(ip) = particle%istopweaksink
317 this%istopzone(ip) = particle%istopzone
318 this%idrymeth(ip) = particle%idrymeth
319 this%icu(ip) = particle%icu
320 this%ilay(ip) = particle%ilay
321 this%izone(ip) = particle%izone
322 this%istatus(ip) = particle%istatus
323 this%x(ip) = particle%x
324 this%y(ip) = particle%y
325 this%z(ip) = particle%z
326 this%trelease(ip) = particle%trelease
327 this%tstop(ip) = particle%tstop
328 this%ttrack(ip) = particle%ttrack
337 this%frctrn(ip) = particle%frctrn
338 this%iexmeth(ip) = particle%iexmeth
339 this%extol(ip) = particle%extol
340 this%extend(ip) = particle%extend
341 this%icycwin(ip) = particle%icycwin
353 np = source%num_stored()
355 if (this%num_stored() /= np)
then
356 write (
errmsg,
'(a,i0,a,i0,a)') &
357 'Cannot copy particle store, size mismatch (source=', np, &
358 ', dest=', this%num_stored(),
')'
362 this%name(:) = source%name(:)
363 this%imdl(:) = source%imdl(:)
364 this%iprp(:) = source%iprp(:)
365 this%irpt(:) = source%irpt(:)
366 this%extend(:) = source%extend(:)
367 this%frctrn(:) = source%frctrn(:)
368 this%istopweaksink(:) = source%istopweaksink(:)
369 this%istopzone(:) = source%istopzone(:)
370 this%idrymeth(:) = source%idrymeth(:)
371 this%iexmeth(:) = source%iexmeth(:)
372 this%icycwin(:) = source%icycwin(:)
373 this%extol(:) = source%extol(:)
374 this%itrdomain(:, :) = source%itrdomain(:, :)
375 this%iboundary(:, :) = source%iboundary(:, :)
376 this%icu(:) = source%icu(:)
377 this%ilay(:) = source%ilay(:)
378 this%izone(:) = source%izone(:)
379 this%istatus(:) = source%istatus(:)
380 this%x(:) = source%x(:)
381 this%y(:) = source%y(:)
382 this%z(:) = source%z(:)
383 this%trelease(:) = source%trelease(:)
384 this%tstop(:) = source%tstop(:)
385 this%ttrack(:) = source%ttrack(:)
395 sinrot, cosrot, invert)
398 real(DP),
intent(in),
optional :: xorigin
399 real(DP),
intent(in),
optional :: yorigin
400 real(DP),
intent(in),
optional :: zorigin
401 real(DP),
intent(in),
optional :: sinrot
402 real(DP),
intent(in),
optional :: cosrot
403 logical(LGP),
intent(in),
optional :: invert
406 this%x, this%y, this%z, &
407 xorigin, yorigin, zorigin, &
408 sinrot, cosrot, invert)
415 call compose(this%xorigin, this%yorigin, this%zorigin, &
416 this%sinrot, this%cosrot, &
417 xorigin, yorigin, zorigin, &
418 sinrot, cosrot, invert)
420 this%transformed = .true.
433 this%transformed = .false.
442 real(DP),
intent(out) :: x
443 real(DP),
intent(out) :: y
444 real(DP),
intent(out) :: z
446 if (this%transformed)
then
447 call transform(this%x, this%y, this%z, x, y, z, &
448 this%xorigin, this%yorigin, this%zorigin, &
449 this%sinrot, this%cosrot, invert=.true.)
466 character(len=:),
allocatable :: str
468 character(len=LINELENGTH) :: temp
470 write (temp,
'(I0,1a,I0,1a,I0,1a,G0)') &
471 this%imdl, this%iprp, this%irpt, this%trelease
472 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 pstop(status, message)
Stop the program, optionally specifying an error status code.
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 copy_from(this, source)
Copy all particle state from source to this store. The two particle stores must already be of the sam...
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.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
A generic heterogeneous doubly-linked list.
Structure of arrays to store particles.
Particle tracked by the PRT model.