30 integer(I4B),
public :: ntrackfiles
31 logical(LGP),
public :: trackrelease
32 logical(LGP),
public :: trackexit
33 logical(LGP),
public :: tracktimestep
34 logical(LGP),
public :: trackterminate
35 logical(LGP),
public :: trackweaksink
36 logical(LGP),
public :: trackusertime
40 procedure,
public ::
save
50 integer(I4B),
intent(in) :: iun
51 logical(LGP),
intent(in),
optional :: csv
52 integer(I4B),
intent(in),
optional :: iprp
57 if (.not.
allocated(this%trackfiles))
then
58 allocate (this%trackfiles(1))
60 call this%expand(increment=1)
66 if (
present(csv)) file%csv = csv
67 if (
present(iprp)) file%iprp = iprp
70 this%ntrackfiles =
size(this%trackfiles)
71 this%trackfiles(this%ntrackfiles) = file
79 integer(I4B),
optional,
intent(in) :: increment
81 integer(I4B) :: inclocal
83 integer(I4B) :: newsize
87 if (
present(increment))
then
94 if (
allocated(this%trackfiles))
then
95 isize =
size(this%trackfiles)
96 newsize = isize + inclocal
97 allocate (temp(newsize))
98 temp(1:isize) = this%trackfiles
99 deallocate (this%trackfiles)
100 call move_alloc(temp, this%trackfiles)
102 allocate (this%trackfiles(inclocal))
113 subroutine save(this, particle, kper, kstp, reason, level)
117 integer(I4B),
intent(in) :: kper
118 integer(I4B),
intent(in) :: kstp
119 integer(I4B),
intent(in) :: reason
120 integer(I4B),
intent(in),
optional :: level
126 if (.not. ((this%trackrelease .and. reason == 0) .or. &
127 (this%trackexit .and. reason == 1) .or. &
128 (this%tracktimestep .and. reason == 2) .or. &
129 (this%trackterminate .and. reason == 3) .or. &
130 (this%trackweaksink .and. reason == 4) .or. &
131 (this%trackusertime .and. reason == 5))) &
139 if (
present(level))
then
140 if (level .ne. 3)
return
144 do i = 1, this%ntrackfiles
145 file = this%trackfiles(i)
146 if (file%iun > 0 .and. &
147 (file%iprp == -1 .or. &
148 file%iprp == particle%iprp)) &
150 kper, kstp, reason, csv=file%csv)
167 logical(LGP),
intent(in) :: release
168 logical(LGP),
intent(in) :: cellexit
169 logical(LGP),
intent(in) :: timestep
170 logical(LGP),
intent(in) :: terminate
171 logical(LGP),
intent(in) :: weaksink
172 logical(LGP),
intent(in) :: usertime
173 this%trackrelease = release
174 this%trackexit = cellexit
175 this%tracktimestep = timestep
176 this%trackterminate = terminate
177 this%trackweaksink = weaksink
178 this%trackusertime = usertime
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, 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.
subroutine save(this, particle, kper, kstp, reason, level)
Save the particle's state to track output file(s).
subroutine expand(this, increment)
Expand the trackfile array, internal use only.
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.
subroutine, public save_record(iun, particle, kper, kstp, reason, csv)
Save a particle track record to a binary or CSV file.
Particle tracked by the PRT model.
Manages particle track (i.e. pathline) files.
Output file containing all or some particle pathlines.