19 integer(I4B) :: iun = 0
20 logical(LGP) :: csv = .false.
21 integer(I4B) :: iprp = -1
41 integer(I4B),
public :: ntrackfiles
42 logical(LGP),
public :: trackrelease
43 logical(LGP),
public :: trackexit
44 logical(LGP),
public :: tracktimestep
45 logical(LGP),
public :: trackterminate
46 logical(LGP),
public :: trackweaksink
47 logical(LGP),
public :: trackusertime
51 procedure,
public ::
save
57 'kper,kstp,imdl,iprp,irpt,ilay,icell,izone,&
58 &istatus,ireason,trelease,t,x,y,z,name'
62 '<i4,<i4,<i4,<i4,<i4,<i4,<i4,<i4,&
63 &<i4,<i4,<f8,<f8,<f8,<f8,<f8,|S40'
125 integer(I4B),
intent(in) :: iun
126 logical(LGP),
intent(in),
optional :: csv
127 integer(I4B),
intent(in),
optional :: iprp
132 if (.not.
allocated(this%trackfiles))
then
133 allocate (this%trackfiles(1))
135 call this%expand(increment=1)
141 if (
present(csv)) file%csv = csv
142 if (
present(iprp)) file%iprp = iprp
145 this%ntrackfiles =
size(this%trackfiles)
146 this%trackfiles(this%ntrackfiles) = file
154 integer(I4B),
optional,
intent(in) :: increment
156 integer(I4B) :: inclocal
157 integer(I4B) :: isize
158 integer(I4B) :: newsize
162 if (
present(increment))
then
169 if (
allocated(this%trackfiles))
then
170 isize =
size(this%trackfiles)
171 newsize = isize + inclocal
172 allocate (temp(newsize))
173 temp(1:isize) = this%trackfiles
174 deallocate (this%trackfiles)
175 call move_alloc(temp, this%trackfiles)
177 allocate (this%trackfiles(inclocal))
185 integer(I4B),
intent(in) :: iun
187 integer(I4B),
intent(in) :: kper
188 integer(I4B),
intent(in) :: kstp
189 integer(I4B),
intent(in) :: reason
190 logical(LGP),
intent(in) :: csv
195 integer(I4B) :: status
198 call particle%get_model_coords(x, y, z)
201 if (particle%istatus .lt. 0)
then
204 status = particle%istatus
208 write (iun,
'(*(G0,:,","))') &
224 trim(adjustl(particle%name))
253 subroutine save(this, particle, kper, kstp, reason, level)
257 integer(I4B),
intent(in) :: kper
258 integer(I4B),
intent(in) :: kstp
259 integer(I4B),
intent(in) :: reason
260 integer(I4B),
intent(in),
optional :: level
266 if (.not. ((this%trackrelease .and. reason == 0) .or. &
267 (this%trackexit .and. reason == 1) .or. &
268 (this%tracktimestep .and. reason == 2) .or. &
269 (this%trackterminate .and. reason == 3) .or. &
270 (this%trackweaksink .and. reason == 4) .or. &
271 (this%trackusertime .and. reason == 5))) &
279 if (
present(level))
then
280 if (level .ne. 3)
return
284 do i = 1, this%ntrackfiles
285 file = this%trackfiles(i)
286 if (file%iun > 0 .and. &
287 (file%iprp == -1 .or. &
288 file%iprp == particle%iprp)) &
290 kper, kstp, reason, csv=file%csv)
308 logical(LGP),
intent(in) :: release
309 logical(LGP),
intent(in) :: cellexit
310 logical(LGP),
intent(in) :: timestep
311 logical(LGP),
intent(in) :: terminate
312 logical(LGP),
intent(in) :: weaksink
313 logical(LGP),
intent(in) :: usertime
314 this%trackrelease = release
315 this%trackexit = cellexit
316 this%tracktimestep = timestep
317 this%trackterminate = terminate
318 this%trackweaksink = weaksink
319 this%trackusertime = usertime
This module contains simulation constants.
real(dp), parameter dzero
real constant zero
real(dp), parameter done
real constant 1
This module defines variable data types.
subroutine, private save_record(iun, particle, kper, kstp, reason, csv)
Save record to binary or CSV file, internal use only.
character(len= *), parameter, public trackheader
subroutine expand(this, increment)
Expand the trackfile array, internal use only.
character(len= *), parameter, public trackdtypes
subroutine save(this, particle, kper, kstp, reason, level)
Save the particle's state to track output file(s).
subroutine init_track_file(this, iun, csv, iprp)
Initialize a new track file.
subroutine set_track_events(this, release, cellexit, timestep, terminate, weaksink, usertime)
Configure particle events to track.
Particle tracked by the PRT model.
Manages particle track (i.e. pathline) files.
Output file containing all or some particle pathlines.