44 'kper,kstp,imdl,iprp,irpt,ilay,icell,izone,&
45 &istatus,ireason,trelease,t,x,y,z,name'
48 '<i4,<i4,<i4,<i4,<i4,<i4,<i4,<i4,&
49 &<i4,<i4,<f8,<f8,<f8,<f8,<f8,|S40'
58 integer(I4B),
public :: iun = 0
59 logical(LGP),
public :: csv = .false.
60 integer(I4B),
public :: iprp = -1
65 logical(LGP) :: release
66 logical(LGP) :: featexit
67 logical(LGP) :: timestep
68 logical(LGP) :: terminate
69 logical(LGP) :: weaksink
70 logical(LGP) :: usertime
71 logical(LGP) :: subfexit
72 logical(LGP) :: dropped
82 integer(I4B),
public :: iout = -1
83 integer(I4B),
public :: ntrackfiles
103 integer(I4B),
intent(in) :: iun
104 logical(LGP),
intent(in),
optional :: csv
105 integer(I4B),
intent(in),
optional :: iprp
109 if (.not.
allocated(this%files))
then
110 allocate (this%files(1))
112 call this%expand_files(increment=1)
117 if (
present(csv)) file%csv = csv
118 if (
present(iprp)) file%iprp = iprp
119 this%ntrackfiles =
size(this%files)
120 this%files(this%ntrackfiles) = file
125 if (
allocated(this%files))
deallocate (this%files)
132 integer(I4B),
optional,
intent(in) :: increment
134 integer(I4B) :: inclocal
135 integer(I4B) :: isize
136 integer(I4B) :: newsize
139 if (
present(increment))
then
145 if (
allocated(this%files))
then
146 isize =
size(this%files)
147 newsize = isize + inclocal
148 allocate (temp(newsize))
149 temp(1:isize) = this%files
150 deallocate (this%files)
151 call move_alloc(temp, this%files)
153 allocate (this%files(inclocal))
168 logical(LGP),
intent(in) :: release
169 logical(LGP),
intent(in) :: featexit
170 logical(LGP),
intent(in) :: timestep
171 logical(LGP),
intent(in) :: terminate
172 logical(LGP),
intent(in) :: weaksink
173 logical(LGP),
intent(in) :: usertime
174 logical(LGP),
intent(in) :: subfexit
175 logical(LGP),
intent(in) :: dropped
176 this%selected%release = release
177 this%selected%featexit = featexit
178 this%selected%timestep = timestep
179 this%selected%terminate = terminate
180 this%selected%weaksink = weaksink
181 this%selected%usertime = usertime
182 this%selected%subfexit = subfexit
183 this%selected%dropped = dropped
193 selected = this%selected%release
195 selected = this%selected%featexit
197 selected = this%selected%subfexit
199 selected = this%selected%timestep
201 selected = this%selected%terminate
203 selected = this%selected%weaksink
205 selected = this%selected%usertime
207 selected = this%selected%dropped
209 call pstop(1,
"unknown event type")
221 save = (file%iun > 0 .and. &
222 (file%iprp == -1 .or. file%iprp == particle%iprp))
228 integer(I4B),
intent(in) :: iun
231 logical(LGP),
intent(in) :: csv
234 write (iun,
'(*(G0,:,","))') &
250 trim(adjustl(particle%name))
288 if (this%should_log()) &
289 call event%log(this%iout)
291 if (this%is_selected(event))
then
292 do i = 1, this%ntrackfiles
294 if (this%should_save(particle, file)) &
295 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.
character(len= *), parameter, public trackheader
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, 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).