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 :: tracktransit
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'
126 integer(I4B),
intent(in) :: iun
127 logical(LGP),
intent(in),
optional :: csv
128 integer(I4B),
intent(in),
optional :: iprp
133 if (.not.
allocated(this%trackfiles))
then
134 allocate (this%trackfiles(1))
136 call this%expand(increment=1)
142 if (
present(csv)) file%csv = csv
143 if (
present(iprp)) file%iprp = iprp
146 this%ntrackfiles =
size(this%trackfiles)
147 this%trackfiles(this%ntrackfiles) = file
155 integer(I4B),
optional,
intent(in) :: increment
157 integer(I4B) :: inclocal
158 integer(I4B) :: isize
159 integer(I4B) :: newsize
163 if (
present(increment))
then
170 if (
allocated(this%trackfiles))
then
171 isize =
size(this%trackfiles)
172 newsize = isize + inclocal
173 allocate (temp(newsize))
174 temp(1:isize) = this%trackfiles
175 deallocate (this%trackfiles)
176 call move_alloc(temp, this%trackfiles)
178 allocate (this%trackfiles(inclocal))
186 integer(I4B),
intent(in) :: iun
188 integer(I4B),
intent(in) :: kper
189 integer(I4B),
intent(in) :: kstp
190 integer(I4B),
intent(in) :: reason
191 logical(LGP),
intent(in) :: csv
196 integer(I4B) :: status
199 call particle%get_model_coords(x, y, z)
202 if (particle%istatus .lt. 0)
then
205 status = particle%istatus
209 write (iun,
'(*(G0,:,","))') &
225 trim(adjustl(particle%name))
254 subroutine save(this, particle, kper, kstp, reason, level)
258 integer(I4B),
intent(in) :: kper
259 integer(I4B),
intent(in) :: kstp
260 integer(I4B),
intent(in) :: reason
261 integer(I4B),
intent(in),
optional :: level
267 if (.not. ((this%trackrelease .and. reason == 0) .or. &
268 (this%tracktransit .and. reason == 1) .or. &
269 (this%tracktimestep .and. reason == 2) .or. &
270 (this%trackterminate .and. reason == 3) .or. &
271 (this%trackweaksink .and. reason == 4) .or. &
272 (this%trackusertime .and. reason == 5))) &
280 if (
present(level))
then
281 if (level .ne. 3)
return
285 do i = 1, this%ntrackfiles
286 file = this%trackfiles(i)
287 if (file%iun > 0 .and. &
288 (file%iprp == -1 .or. &
289 file%iprp == particle%iprp)) &
291 kper, kstp, reason, csv=file%csv)
309 logical(LGP),
intent(in) :: release
310 logical(LGP),
intent(in) :: transit
311 logical(LGP),
intent(in) :: timestep
312 logical(LGP),
intent(in) :: terminate
313 logical(LGP),
intent(in) :: weaksink
314 logical(LGP),
intent(in) :: usertime
315 this%trackrelease = release
316 this%tracktransit = transit
317 this%tracktimestep = timestep
318 this%trackterminate = terminate
319 this%trackweaksink = weaksink
320 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.
subroutine set_track_events(this, release, transit, timestep, terminate, weaksink, usertime)
Configure particle events to track.
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.
A particle tracked by the PRT model.
Manages particle track (i.e. pathline) files.
Output file containing all or some particle pathlines.