47 'kper,kstp,imdl,iprp,irpt,ilay,icell,izone,&
48 &istatus,ireason,trelease,t,x,y,z,name'
51 '<i4,<i4,<i4,<i4,<i4,<i4,<i4,<i4,&
52 &<i4,<i4,<f8,<f8,<f8,<f8,<f8,|S40'
56 logical(LGP) :: release
57 logical(LGP) :: featexit
58 logical(LGP) :: timestep
59 logical(LGP) :: terminate
60 logical(LGP) :: weaksink
61 logical(LGP) :: usertime
62 logical(LGP) :: subfexit
63 logical(LGP) :: dropped
77 integer(I4B),
public :: iout = -1
78 integer(I4B),
public :: ntrackfiles
99 integer(I4B),
intent(in) :: iun
100 logical(LGP),
intent(in),
optional :: csv
101 integer(I4B),
intent(in),
optional :: iprp
104 call this%expand_files(increment=1)
108 if (
present(csv)) file%csv = csv
109 if (
present(iprp)) file%iprp = iprp
110 this%ntrackfiles =
size(this%files)
111 this%files(this%ntrackfiles) = file
117 logical(LGP),
intent(in) :: scratch
124 call this%buffer%init()
130 call this%buffer%destroy()
136 integer(I4B),
optional,
intent(in) :: increment
137 integer(I4B) :: inclocal, isize, newsize
140 if (
present(increment))
then
146 if (
allocated(this%files))
then
147 isize =
size(this%files)
148 newsize = isize + inclocal
149 allocate (temp(newsize))
150 temp(1:isize) = this%files
151 deallocate (this%files)
152 call move_alloc(temp, this%files)
154 allocate (this%files(inclocal))
169 logical(LGP),
intent(in) :: release
170 logical(LGP),
intent(in) :: featexit
171 logical(LGP),
intent(in) :: timestep
172 logical(LGP),
intent(in) :: terminate
173 logical(LGP),
intent(in) :: weaksink
174 logical(LGP),
intent(in) :: usertime
175 logical(LGP),
intent(in) :: subfexit
176 logical(LGP),
intent(in) :: dropped
177 this%selected%release = release
178 this%selected%featexit = featexit
179 this%selected%timestep = timestep
180 this%selected%terminate = terminate
181 this%selected%weaksink = weaksink
182 this%selected%usertime = usertime
183 this%selected%subfexit = subfexit
184 this%selected%dropped = dropped
194 selected = this%selected%release
196 selected = this%selected%featexit
198 selected = this%selected%subfexit
200 selected = this%selected%timestep
202 selected = this%selected%terminate
204 selected = this%selected%weaksink
206 selected = this%selected%usertime
208 selected = this%selected%dropped
210 call pstop(1,
"unknown event type")
222 rec%kper = event%kper; rec%kstp = event%kstp
223 rec%imdl = event%imdl; rec%iprp = event%iprp
224 rec%irpt = event%irpt; rec%ilay = event%ilay
225 rec%icu = event%icu; rec%izone = event%izone
226 rec%istatus = event%istatus; rec%ireason = event%get_code()
227 rec%trelease = event%trelease; rec%ttrack = event%ttrack
228 rec%x = event%x; rec%y = event%y; rec%z = event%z
229 rec%name = trim(adjustl(particle%name))
231 call this%buffer%append(rec)
237 call this%buffer%flush(this%files)
243 call this%buffer%discard()
253 class(*),
pointer :: context
256 logical(LGP) :: handled
258 select type (context)
260 if (context%iout >= 0) &
261 call event%log(context%iout)
262 if (context%is_selected(event)) &
263 call context%buffer_event(particle, event)
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.
This module defines variable data types.
In-memory particle event buffer module.
Particle event buffering strategies.
Particle track output module.
subroutine discard_buffer(this)
Discard buffered events without writing.
logical function is_selected(this, event)
Check if a given event code is selected for tracking.
subroutine destroy(this)
Destroy the particle track manager.
subroutine init_file(this, iun, csv, iprp)
Initialize a binary or CSV output file.
subroutine buffer_event(this, particle, event)
Buffer an event for deferred write.
logical(lgp) function, public add_particle_event(context, particle, event)
Add a particle event to be written to eligible files and printed to an output file unit if requested....
character(len= *), parameter, public trackheader
subroutine flush_buffer(this)
Flush the event buffer to disk.
subroutine select_events(this, release, featexit, timestep, terminate, weaksink, usertime, subfexit, dropped)
Pick events to track.
subroutine expand_files(this, increment)
Grow the array of track files.
subroutine init_buffer(this, scratch)
Initialize the event buffer strategy.
character(len= *), parameter, public trackdtypes
Scratch-file particle event buffer module.
In-memory particle event buffer. Records are held in a dynamically growing array that doubles in capa...
Base type for particle events.
Dispatcher for particle events. Consumers subscribe handlers to the dispatcher. Events may be dispatc...
Particle tracked by the PRT model.
Event buffering strategy.
Output file containing all or some particle pathlines.
Flat record of a particle track event.
Selection of particle events.
Particle track output manager. Handles printing as well as writing to files. One output unit can be c...
Scratch-file particle event buffer. Records are written to an unformatted sequential scratch file tha...