43 'kper,kstp,imdl,iprp,irpt,ilay,icell,izone,&
44 &istatus,ireason,trelease,t,x,y,z,name'
47 '<i4,<i4,<i4,<i4,<i4,<i4,<i4,<i4,&
48 &<i4,<i4,<f8,<f8,<f8,<f8,<f8,|S40'
57 integer(I4B),
public :: iun = 0
58 logical(LGP),
public :: csv = .false.
59 integer(I4B),
public :: iprp = -1
64 logical(LGP) :: release
65 logical(LGP) :: featexit
66 logical(LGP) :: timestep
67 logical(LGP) :: terminate
68 logical(LGP) :: weaksink
69 logical(LGP) :: usertime
70 logical(LGP) :: subfexit
80 integer(I4B),
public :: iout = -1
81 integer(I4B),
public :: ntrackfiles
101 integer(I4B),
intent(in) :: iun
102 logical(LGP),
intent(in),
optional :: csv
103 integer(I4B),
intent(in),
optional :: iprp
107 if (.not.
allocated(this%files))
then
108 allocate (this%files(1))
110 call this%expand_files(increment=1)
115 if (
present(csv)) file%csv = csv
116 if (
present(iprp)) file%iprp = iprp
117 this%ntrackfiles =
size(this%files)
118 this%files(this%ntrackfiles) = file
123 if (
allocated(this%files))
deallocate (this%files)
130 integer(I4B),
optional,
intent(in) :: increment
132 integer(I4B) :: inclocal
133 integer(I4B) :: isize
134 integer(I4B) :: newsize
137 if (
present(increment))
then
143 if (
allocated(this%files))
then
144 isize =
size(this%files)
145 newsize = isize + inclocal
146 allocate (temp(newsize))
147 temp(1:isize) = this%files
148 deallocate (this%files)
149 call move_alloc(temp, this%files)
151 allocate (this%files(inclocal))
165 logical(LGP),
intent(in) :: release
166 logical(LGP),
intent(in) :: featexit
167 logical(LGP),
intent(in) :: timestep
168 logical(LGP),
intent(in) :: terminate
169 logical(LGP),
intent(in) :: weaksink
170 logical(LGP),
intent(in) :: usertime
171 logical(LGP),
intent(in) :: subfexit
172 this%selected%release = release
173 this%selected%featexit = featexit
174 this%selected%timestep = timestep
175 this%selected%terminate = terminate
176 this%selected%weaksink = weaksink
177 this%selected%usertime = usertime
178 this%selected%subfexit = subfexit
188 selected = this%selected%release
190 selected = this%selected%featexit
192 selected = this%selected%subfexit
194 selected = this%selected%timestep
196 selected = this%selected%terminate
198 selected = this%selected%weaksink
200 selected = this%selected%usertime
202 call pstop(1,
"unknown event type")
214 save = (file%iun > 0 .and. &
215 (file%iprp == -1 .or. file%iprp == particle%iprp))
221 integer(I4B),
intent(in) :: iun
224 logical(LGP),
intent(in) :: csv
227 write (iun,
'(*(G0,:,","))') &
243 trim(adjustl(particle%name))
281 if (this%should_log()) &
282 call event%log(this%iout)
284 if (this%is_selected(event))
then
285 do i = 1, this%ntrackfiles
287 if (this%should_save(particle, file)) &
288 call save_event(file%iun, particle, event, csv=file%csv)
This module contains simulation constants.
real(dp), parameter dpio180
real constant
real(dp), parameter dzero
real constant zero
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.
This module defines variable data types.
Particle track output module.
logical function is_selected(this, event)
Check if a given event code is selected for tracking.
subroutine init_file(this, iun, csv, iprp)
Initialize a binary or CSV file.
subroutine select_events(this, release, featexit, timestep, terminate, weaksink, usertime, subfexit)
Pick events to track.
character(len= *), parameter, public trackheader
subroutine expand_files(this, increment)
Grow the array of track files.
subroutine, private save_event(iun, particle, event, csv)
Save an event to a binary or CSV file.
logical function should_log(this)
Log output unit valid?
character(len= *), parameter, public trackdtypes
logical function should_save(this, particle, file)
Check whether a particle belongs in a given file i.e. if the file is enabled and its group matches th...
Base type for particle events.
Particle tracked by the PRT model.
Selection of particle events.
Output file containing all or some particle pathlines.
Manages particle track output (logging/writing).