diff --git a/make/makefile b/make/makefile
index 7aebe899061..27d99da2582 100644
--- a/make/makefile
+++ b/make/makefile
@@ -266,7 +266,8 @@ $(OBJDIR)/sort.o \
$(OBJDIR)/FlowModelInterface.o \
$(OBJDIR)/Cell.o \
$(OBJDIR)/Subcell.o \
-$(OBJDIR)/TrackData.o \
+$(OBJDIR)/TrackFile.o \
+$(OBJDIR)/TrackControl.o \
$(OBJDIR)/TimeSelect.o \
$(OBJDIR)/prt-fmi.o \
$(OBJDIR)/TimeStepSelect.o \
diff --git a/msvs/mf6core.vfproj b/msvs/mf6core.vfproj
index 2483ba98bdf..a90fddd986e 100644
--- a/msvs/mf6core.vfproj
+++ b/msvs/mf6core.vfproj
@@ -328,7 +328,8 @@
-
+
+
diff --git a/src/Model/ModelUtilities/TrackControl.f90 b/src/Model/ModelUtilities/TrackControl.f90
new file mode 100644
index 00000000000..d16474b471f
--- /dev/null
+++ b/src/Model/ModelUtilities/TrackControl.f90
@@ -0,0 +1,181 @@
+module TrackControlModule
+
+ use KindModule, only: DP, I4B, LGP
+ use ConstantsModule, only: DZERO, DONE, DPIO180
+ use ParticleModule, only: ParticleType
+ use BaseDisModule, only: DisBaseType
+ use GeomUtilModule, only: transform
+ use TrackFileModule, only: TrackFileType, save_record
+
+ implicit none
+ public :: TrackControlType
+
+ !> @brief Manages particle track (i.e. pathline) files.
+ !!
+ !! Optionally filters events ("ireason" codes, selectable in the PRT-OC pkg):
+ !!
+ !! 0: RELEASE: particle is released
+ !! 1: TRANSIT: particle moves from cell to cell
+ !! 2: TIMESTEP: timestep ends
+ !! 3: TERMINATE: tracking stops for a particle
+ !! 4: WEAKSINK: particle exits a weak sink
+ !! 5: USERTIME: user-specified tracking time
+ !!
+ !! An arbitrary number of files can be managed. Internal arrays
+ !! are resized as needed.
+ !<
+ type :: TrackControlType
+ private
+ type(TrackFileType), public, allocatable :: trackfiles(:) !< output files
+ integer(I4B), public :: ntrackfiles !< number of output files
+ logical(LGP), public :: trackrelease !< track release events
+ logical(LGP), public :: trackexit !< track cell-to-cell transitions
+ logical(LGP), public :: tracktimestep !< track timestep ends
+ logical(LGP), public :: trackterminate !< track termination events
+ logical(LGP), public :: trackweaksink !< track weak sink exit events
+ logical(LGP), public :: trackusertime !< track user-selected times
+ contains
+ procedure :: expand
+ procedure, public :: init_track_file
+ procedure, public :: save
+ procedure, public :: set_track_events
+ end type TrackControlType
+
+contains
+
+ !> @brief Initialize a new track file
+ subroutine init_track_file(this, iun, csv, iprp)
+ ! dummy
+ class(TrackControlType) :: this
+ integer(I4B), intent(in) :: iun
+ logical(LGP), intent(in), optional :: csv
+ integer(I4B), intent(in), optional :: iprp
+ ! local
+ type(TrackFileType), pointer :: file
+
+ ! Allocate or expand array
+ if (.not. allocated(this%trackfiles)) then
+ allocate (this%trackfiles(1))
+ else
+ call this%expand(increment=1)
+ end if
+
+ ! Setup new file
+ allocate (file)
+ file%iun = iun
+ if (present(csv)) file%csv = csv
+ if (present(iprp)) file%iprp = iprp
+
+ ! Update array and counter
+ this%ntrackfiles = size(this%trackfiles)
+ this%trackfiles(this%ntrackfiles) = file
+
+ end subroutine init_track_file
+
+ !> @brief Expand the trackfile array, internal use only
+ subroutine expand(this, increment)
+ ! dummy
+ class(TrackControlType) :: this
+ integer(I4B), optional, intent(in) :: increment
+ ! local
+ integer(I4B) :: inclocal
+ integer(I4B) :: isize
+ integer(I4B) :: newsize
+ type(TrackFileType), allocatable, dimension(:) :: temp
+
+ ! Initialize optional args
+ if (present(increment)) then
+ inclocal = increment
+ else
+ inclocal = 1
+ end if
+
+ ! Increase size of array
+ if (allocated(this%trackfiles)) then
+ isize = size(this%trackfiles)
+ newsize = isize + inclocal
+ allocate (temp(newsize))
+ temp(1:isize) = this%trackfiles
+ deallocate (this%trackfiles)
+ call move_alloc(temp, this%trackfiles)
+ else
+ allocate (this%trackfiles(inclocal))
+ end if
+
+ end subroutine expand
+
+ !> @brief Save the particle's state to track output file(s).
+ !!
+ !! A record is saved to all enabled model-level files and to
+ !! any PRP-level files with PRP index matching the particle's
+ !! PRP index.
+ !<
+ subroutine save(this, particle, kper, kstp, reason, level)
+ ! dummy
+ class(TrackControlType), intent(inout) :: this
+ type(ParticleType), pointer, intent(in) :: particle
+ integer(I4B), intent(in) :: kper
+ integer(I4B), intent(in) :: kstp
+ integer(I4B), intent(in) :: reason
+ integer(I4B), intent(in), optional :: level
+ ! local
+ integer(I4B) :: i
+ type(TrackFileType) :: file
+
+ ! Only save if reporting is enabled for specified event.
+ if (.not. ((this%trackrelease .and. reason == 0) .or. &
+ (this%trackexit .and. reason == 1) .or. &
+ (this%tracktimestep .and. reason == 2) .or. &
+ (this%trackterminate .and. reason == 3) .or. &
+ (this%trackweaksink .and. reason == 4) .or. &
+ (this%trackusertime .and. reason == 5))) &
+ return
+
+ ! For now, only allow reporting from outside the tracking
+ ! algorithm (e.g. release time), in which case level will
+ ! not be provided, or if within the tracking solution, in
+ ! subcells (level 3) only. This may change if the subcell
+ ! ever delegates tracking to even smaller subcomponents.
+ if (present(level)) then
+ if (level .ne. 3) return
+ end if
+
+ ! Save to any enabled model-scoped or PRP-scoped files
+ do i = 1, this%ntrackfiles
+ file = this%trackfiles(i)
+ if (file%iun > 0 .and. &
+ (file%iprp == -1 .or. &
+ file%iprp == particle%iprp)) &
+ call save_record(file%iun, particle, &
+ kper, kstp, reason, csv=file%csv)
+ end do
+ end subroutine save
+
+ !> @brief Configure particle events to track.
+ !!
+ !! Each tracking event corresponds to an "ireason" code
+ !! as appears in each row of track output.
+ !<
+ subroutine set_track_events(this, &
+ release, &
+ cellexit, &
+ timestep, &
+ terminate, &
+ weaksink, &
+ usertime)
+ class(TrackControlType) :: this
+ logical(LGP), intent(in) :: release
+ logical(LGP), intent(in) :: cellexit
+ logical(LGP), intent(in) :: timestep
+ logical(LGP), intent(in) :: terminate
+ logical(LGP), intent(in) :: weaksink
+ logical(LGP), intent(in) :: usertime
+ this%trackrelease = release
+ this%trackexit = cellexit
+ this%tracktimestep = timestep
+ this%trackterminate = terminate
+ this%trackweaksink = weaksink
+ this%trackusertime = usertime
+ end subroutine set_track_events
+
+end module TrackControlModule
diff --git a/src/Model/ModelUtilities/TrackData.f90 b/src/Model/ModelUtilities/TrackData.f90
deleted file mode 100644
index 77613ea13a3..00000000000
--- a/src/Model/ModelUtilities/TrackData.f90
+++ /dev/null
@@ -1,322 +0,0 @@
-module TrackModule
-
- use KindModule, only: DP, I4B, LGP
- use ConstantsModule, only: DZERO, DONE
- use ParticleModule, only: ParticleType
-
- implicit none
-
- private save_record
- public :: TrackFileType
- public :: TrackFileControlType
-
- !> @brief Output file containing all or some particle pathlines.
- !!
- !! Can be associated with a particle release point (PRP) package
- !! or with an entire model, and can be binary or comma-separated.
- !<
- type :: TrackFileType
- integer(I4B) :: iun = 0 !< file unit number
- logical(LGP) :: csv = .false. !< whether the file is binary or CSV
- integer(I4B) :: iprp = -1 !< -1 is model-level file, 0 is exchange PRP
- end type TrackFileType
-
- !> @brief Manages particle track (i.e. pathline) files.
- !!
- !! Optionally filters events ("ireason" codes, selectable in the PRT-OC pkg):
- !!
- !! 0: RELEASE: particle is released
- !! 1: TRANSIT: particle moves from cell to cell
- !! 2: TIMESTEP: timestep ends
- !! 3: TERMINATE: tracking stops for a particle
- !! 4: WEAKSINK: particle exits a weak sink
- !! 5: USERTIME: user-specified tracking time
- !!
- !! An arbitrary number of files can be managed. Internal arrays
- !! are resized as needed.
- !<
- type :: TrackFileControlType
- private
- type(TrackFileType), public, allocatable :: trackfiles(:) !< output files
- integer(I4B), public :: ntrackfiles !< number of output files
- logical(LGP), public :: trackrelease !< track release events
- logical(LGP), public :: trackexit !< track cell-to-cell transitions
- logical(LGP), public :: tracktimestep !< track timestep ends
- logical(LGP), public :: trackterminate !< track termination events
- logical(LGP), public :: trackweaksink !< track weak sink exit events
- logical(LGP), public :: trackusertime !< track user-selected times
- contains
- procedure :: expand
- procedure, public :: init_track_file
- procedure, public :: save
- procedure, public :: set_track_events
- end type TrackFileControlType
-
- ! Track file header
- character(len=*), parameter, public :: TRACKHEADER = &
- 'kper,kstp,imdl,iprp,irpt,ilay,icell,izone,&
- &istatus,ireason,trelease,t,x,y,z,name'
-
- ! Track file dtypes
- character(len=*), parameter, public :: TRACKDTYPES = &
- ' @brief Initialize a new track file
- subroutine init_track_file(this, iun, csv, iprp)
- ! -- dummy
- class(TrackFileControlType) :: this
- integer(I4B), intent(in) :: iun
- logical(LGP), intent(in), optional :: csv
- integer(I4B), intent(in), optional :: iprp
- ! -- local
- type(TrackFileType), pointer :: file
-
- ! -- allocate or expand array
- if (.not. allocated(this%trackfiles)) then
- allocate (this%trackfiles(1))
- else
- call this%expand(increment=1)
- end if
-
- ! -- setup new file
- allocate (file)
- file%iun = iun
- if (present(csv)) file%csv = csv
- if (present(iprp)) file%iprp = iprp
-
- ! -- update array and counter
- this%ntrackfiles = size(this%trackfiles)
- this%trackfiles(this%ntrackfiles) = file
-
- end subroutine init_track_file
-
- !> @brief Expand the trackfile array, internal use only
- subroutine expand(this, increment)
- ! -- dummy
- class(TrackFileControlType) :: this
- integer(I4B), optional, intent(in) :: increment
- ! -- local
- integer(I4B) :: inclocal
- integer(I4B) :: isize
- integer(I4B) :: newsize
- type(TrackFileType), allocatable, dimension(:) :: temp
-
- ! -- initialize
- if (present(increment)) then
- inclocal = increment
- else
- inclocal = 1
- end if
-
- ! -- increase size of array
- if (allocated(this%trackfiles)) then
- isize = size(this%trackfiles)
- newsize = isize + inclocal
- allocate (temp(newsize))
- temp(1:isize) = this%trackfiles
- deallocate (this%trackfiles)
- call move_alloc(temp, this%trackfiles)
- else
- allocate (this%trackfiles(inclocal))
- end if
-
- end subroutine expand
-
- !> @brief Save record to binary or CSV file, internal use only
- subroutine save_record(iun, particle, kper, kstp, reason, csv)
- ! -- dummy
- integer(I4B), intent(in) :: iun
- type(ParticleType), pointer, intent(in) :: particle
- integer(I4B), intent(in) :: kper
- integer(I4B), intent(in) :: kstp
- integer(I4B), intent(in) :: reason
- logical(LGP), intent(in) :: csv
- ! -- local
- real(DP) :: x
- real(DP) :: y
- real(DP) :: z
- integer(I4B) :: status
-
- ! -- Get model (global) coordinates
- call particle%get_model_coords(x, y, z)
-
- ! -- Get status
- if (particle%istatus .lt. 0) then
- status = 1
- else
- status = particle%istatus
- end if
-
- if (csv) then
- write (iun, '(*(G0,:,","))') &
- kper, &
- kstp, &
- particle%imdl, &
- particle%iprp, &
- particle%irpt, &
- particle%ilay, &
- particle%icu, &
- particle%izone, &
- status, &
- reason, &
- particle%trelease, &
- particle%ttrack, &
- x, &
- y, &
- z, &
- trim(adjustl(particle%name))
- else
- write (iun) &
- kper, &
- kstp, &
- particle%imdl, &
- particle%iprp, &
- particle%irpt, &
- particle%ilay, &
- particle%icu, &
- particle%izone, &
- status, &
- reason, &
- particle%trelease, &
- particle%ttrack, &
- x, &
- y, &
- z, &
- particle%name
- end if
-
- end subroutine
-
- !> @brief Save the particle's state to track output file(s).
- !!
- !! A record is saved to all enabled model-level files and to
- !! any PRP-level files with PRP index matching the particle's
- !! PRP index.
- !<
- subroutine save(this, particle, kper, kstp, reason, level)
- ! -- dummy
- class(TrackFileControlType), intent(inout) :: this
- type(ParticleType), pointer, intent(in) :: particle
- integer(I4B), intent(in) :: kper
- integer(I4B), intent(in) :: kstp
- integer(I4B), intent(in) :: reason
- integer(I4B), intent(in), optional :: level
- ! -- local
- integer(I4B) :: i
- type(TrackFileType) :: file
-
- ! -- Only save if reporting is enabled for specified event.
- if (.not. ((this%trackrelease .and. reason == 0) .or. &
- (this%trackexit .and. reason == 1) .or. &
- (this%tracktimestep .and. reason == 2) .or. &
- (this%trackterminate .and. reason == 3) .or. &
- (this%trackweaksink .and. reason == 4) .or. &
- (this%trackusertime .and. reason == 5))) &
- return
-
- ! -- For now, only allow reporting from outside the tracking
- ! algorithm (e.g. release time), in which case level will
- ! not be provided, or if within the tracking solution, in
- ! subcells (level 3) only. This may change if the subcell
- ! ever delegates tracking to even smaller subcomponents.
- if (present(level)) then
- if (level .ne. 3) return
- end if
-
- ! -- Save to any enabled model-scoped or PRP-scoped files
- do i = 1, this%ntrackfiles
- file = this%trackfiles(i)
- if (file%iun > 0 .and. &
- (file%iprp == -1 .or. &
- file%iprp == particle%iprp)) &
- call save_record(file%iun, particle, &
- kper, kstp, reason, csv=file%csv)
- end do
-
- end subroutine save
-
- !> @brief Configure particle events to track.
- !!
- !! Each tracking event corresponds to an "ireason" code
- !! as appears in each row of track output.
- !<
- subroutine set_track_events(this, &
- release, &
- cellexit, &
- timestep, &
- terminate, &
- weaksink, &
- usertime)
- class(TrackFileControlType) :: this
- logical(LGP), intent(in) :: release
- logical(LGP), intent(in) :: cellexit
- logical(LGP), intent(in) :: timestep
- logical(LGP), intent(in) :: terminate
- logical(LGP), intent(in) :: weaksink
- logical(LGP), intent(in) :: usertime
- this%trackrelease = release
- this%trackexit = cellexit
- this%tracktimestep = timestep
- this%trackterminate = terminate
- this%trackweaksink = weaksink
- this%trackusertime = usertime
- end subroutine set_track_events
-
-end module TrackModule
diff --git a/src/Model/ModelUtilities/TrackFile.f90 b/src/Model/ModelUtilities/TrackFile.f90
new file mode 100644
index 00000000000..4ba94b71e9c
--- /dev/null
+++ b/src/Model/ModelUtilities/TrackFile.f90
@@ -0,0 +1,148 @@
+module TrackFileModule
+ use KindModule, only: DP, I4B, LGP
+ use ConstantsModule, only: DZERO, DPIO180
+ use ParticleModule, only: ParticleType
+ use GeomUtilModule, only: transform
+
+ implicit none
+ public :: TrackFileType
+ public :: save_record
+
+ !> @brief Output file containing all or some particle pathlines.
+ !!
+ !! Can be associated with a particle release point (PRP) package
+ !! or with an entire model, and can be binary or comma-separated.
+ !!
+ !! Each particle's pathline consists of 1+ records reported as the particle
+ !! is tracked over the model domain. Records are snapshots of the particle's
+ !! state (e.g. tracking status, position) at a particular moment in time.
+ !!
+ !! Particles have no ID property. Particles can be uniquely identified
+ !! by composite key, i.e. combination of:
+ !!
+ !! - imdl: originating model ID
+ !! - iprp: originating PRP ID
+ !! - irpt: particle release location ID
+ !! - trelease: particle release time
+ !!
+ !! Each record has an "ireason" property, which identifies the cause of
+ !! the record. The user selects 1+ conditions or events for recording.
+ !! Identical records (except "ireason") may be duplicated if multiple
+ !! reporting conditions apply to particles at the same moment in time.
+ !! Each "ireason" value corresponds to an OC "trackevent" option value:
+ !!
+ !! 0: particle released
+ !! 1: particle transitioned between cells
+ !! 2: current time step ended****
+ !! 3: particle terminated
+ !! 4: particle exited weak sink
+ !! 5: user-specified tracking time
+ !!
+ !! Each record has an "istatus" property, which is the tracking status;
+ !! e.g., awaiting release, active, terminated. A particle may terminate
+ !! for several reasons. Status values greater than one imply termination.
+ !! Particle status strictly increases over time, starting at zero:
+ !!
+ !! 0: pending release*
+ !! 1: active
+ !! 2: terminated at boundary face
+ !! 3: terminated in weak sink cell
+ !! 4: terminated in weak source cell**
+ !! 5: terminated in cell with no exit face
+ !! 6: terminated in cell with specified zone number
+ !! 7: terminated in inactive cell
+ !! 8: permanently unreleased***
+ !! 9: terminated in subcell with no exit face*****
+ !!
+ !! PRT shares the same status enumeration as MODPATH 7. However, some
+ !! don't apply to PRT; for instance, MODPATH 7 distinguishes forwards
+ !! and backwards tracking, but status value 4 is not used by PRT.
+ !!
+ !! Notes
+ !! -----
+ !!
+ !! * is this necessary?
+ !! ** unnecessary since PRT makes no distinction between forwards/backwards tracking
+ !! *** e.g., released into an inactive cell, a stop zone cell, or a termination zone
+ !! **** this may coincide with termination, in which case two events are reported
+ !! ***** PRT-specific status indicating a particle stopped within a cell subcell
+ !<
+ type :: TrackFileType
+ private
+ integer(I4B), public :: iun = 0 !< file unit number
+ logical(LGP), public :: csv = .false. !< whether the file is binary or CSV
+ integer(I4B), public :: iprp = -1 !< -1 is model-level file, 0 is exchange PRP
+ end type TrackFileType
+
+ character(len=*), parameter, public :: TRACKHEADER = &
+ 'kper,kstp,imdl,iprp,irpt,ilay,icell,izone,&
+ &istatus,ireason,trelease,t,x,y,z,name'
+
+ character(len=*), parameter, public :: TRACKDTYPES = &
+ ' @brief Save a particle track record to a binary or CSV file.
+ subroutine save_record(iun, particle, kper, kstp, reason, csv)
+ ! dummy
+ integer(I4B), intent(in) :: iun
+ type(ParticleType), pointer, intent(in) :: particle
+ integer(I4B), intent(in) :: kper
+ integer(I4B), intent(in) :: kstp
+ integer(I4B), intent(in) :: reason
+ logical(LGP), intent(in) :: csv
+ ! local
+ real(DP) :: x, y, z
+ integer(I4B) :: status
+
+ ! Convert from cell-local to model coordinates if needed
+ call particle%get_model_coords(x, y, z)
+
+ ! Set status
+ if (particle%istatus .lt. 0) then
+ status = 1
+ else
+ status = particle%istatus
+ end if
+
+ if (csv) then
+ write (iun, '(*(G0,:,","))') &
+ kper, &
+ kstp, &
+ particle%imdl, &
+ particle%iprp, &
+ particle%irpt, &
+ particle%ilay, &
+ particle%icu, &
+ particle%izone, &
+ status, &
+ reason, &
+ particle%trelease, &
+ particle%ttrack, &
+ x, &
+ y, &
+ z, &
+ trim(adjustl(particle%name))
+ else
+ write (iun) &
+ kper, &
+ kstp, &
+ particle%imdl, &
+ particle%iprp, &
+ particle%irpt, &
+ particle%ilay, &
+ particle%icu, &
+ particle%izone, &
+ status, &
+ reason, &
+ particle%trelease, &
+ particle%ttrack, &
+ x, &
+ y, &
+ z, &
+ particle%name
+ end if
+ end subroutine
+end module TrackFileModule
diff --git a/src/Model/ParticleTracking/prt-oc.f90 b/src/Model/ParticleTracking/prt-oc.f90
index 405c87bffd8..5644b932f45 100644
--- a/src/Model/ParticleTracking/prt-oc.f90
+++ b/src/Model/ParticleTracking/prt-oc.f90
@@ -187,7 +187,7 @@ subroutine prt_oc_read_options(this)
use OpenSpecModule, only: access, form
use InputOutputModule, only: getunit, openfile, lowcase
use ConstantsModule, only: LINELENGTH
- use TrackModule, only: TRACKHEADER, TRACKDTYPES
+ use TrackFileModule, only: TRACKHEADER, TRACKDTYPES
use SimModule, only: store_error, store_error_unit
use InputOutputModule, only: openfile, getunit
! dummy
diff --git a/src/Model/ParticleTracking/prt-prp.f90 b/src/Model/ParticleTracking/prt-prp.f90
index 882e59bce12..fe69f888cec 100644
--- a/src/Model/ParticleTracking/prt-prp.f90
+++ b/src/Model/ParticleTracking/prt-prp.f90
@@ -17,7 +17,7 @@ module PrtPrpModule
use SimModule, only: count_errors, store_error, store_error_unit, &
store_warning
use SimVariablesModule, only: errmsg, warnmsg
- use TrackModule, only: TrackFileControlType
+ use TrackControlModule, only: TrackControlType
use GeomUtilModule, only: point_in_polygon, get_ijk, get_jk
use MemoryManagerModule, only: mem_allocate, mem_deallocate, &
mem_reallocate
@@ -41,7 +41,7 @@ module PrtPrpModule
type, extends(BndType) :: PrtPrpType
type(PrtFmiType), pointer :: fmi => null() !< flow model interface
type(ParticleStoreType), pointer :: particles => null() !< particle store
- type(TrackFileControlType), pointer :: tracks => null() !< output manager
+ type(TrackControlType), pointer :: trackctl => null() !< track control
type(ReleaseScheduleType), pointer :: schedule !< particle release schedule
integer(I4B), pointer :: nreleasepoints => null() !< number of release points
integer(I4B), pointer :: nreleasetimes => null() !< number of user-specified particle release times
@@ -188,15 +188,15 @@ subroutine prp_da(this)
end subroutine prp_da
!> @ brief Set pointers to model variables
- subroutine prp_set_pointers(this, ibound, izone, trackfilectl)
+ subroutine prp_set_pointers(this, ibound, izone, trackctl)
class(PrtPrpType) :: this
integer(I4B), dimension(:), pointer, contiguous :: ibound
integer(I4B), dimension(:), pointer, contiguous :: izone
- type(TrackFileControlType), pointer :: trackfilectl
+ type(TrackControlType), pointer :: trackctl
this%ibound => ibound
this%rptzone => izone
- this%tracks => trackfilectl
+ this%trackctl => trackctl
end subroutine prp_set_pointers
!> @brief Allocate arrays
@@ -659,7 +659,7 @@ subroutine prp_options(this, option, found)
use OpenSpecModule, only: access, form
use ConstantsModule, only: MAXCHARLEN, DZERO
use InputOutputModule, only: urword, getunit, openfile
- use TrackModule, only: TRACKHEADER, TRACKDTYPES
+ use TrackFileModule, only: TRACKHEADER, TRACKDTYPES
! dummy
class(PrtPrpType), intent(inout) :: this
character(len=*), intent(inout) :: option
diff --git a/src/Model/ParticleTracking/prt.f90 b/src/Model/ParticleTracking/prt.f90
index 25b08db707c..e47f8ff6a0b 100644
--- a/src/Model/ParticleTracking/prt.f90
+++ b/src/Model/ParticleTracking/prt.f90
@@ -19,7 +19,8 @@ module PrtModule
use BudgetModule, only: BudgetType
use ListModule, only: ListType
use ParticleModule, only: ParticleType, create_particle
- use TrackModule, only: TrackFileControlType, TrackFileType
+ use TrackFileModule, only: TrackFileType
+ use TrackControlModule, only: TrackControlType
use SimModule, only: count_errors, store_error, store_error_filename
use MemoryManagerModule, only: mem_allocate
use MethodModule, only: MethodType
@@ -43,7 +44,7 @@ module PrtModule
type(PrtOcType), pointer :: oc => null() ! output control package
type(BudgetType), pointer :: budget => null() ! budget object
class(MethodType), pointer :: method => null() ! tracking method
- type(TrackFileControlType), pointer :: trackfilectl ! track file control
+ type(TrackControlType), pointer :: trackctl ! track control
integer(I4B), pointer :: infmi => null() ! unit number FMI
integer(I4B), pointer :: inmip => null() ! unit number MIP
integer(I4B), pointer :: inmvt => null() ! unit number MVT
@@ -143,7 +144,7 @@ subroutine prt_cr(filename, id, modelname)
this%memoryPath = create_mem_path(modelname)
! -- Allocate track control object
- allocate (this%trackfilectl)
+ allocate (this%trackctl)
! -- Allocate scalars and add model to basemodellist
call this%allocate_scalars(modelname)
@@ -249,7 +250,7 @@ subroutine prt_ar(this)
select type (packobj)
type is (PrtPrpType)
call packobj%prp_set_pointers(this%ibound, this%mip%izone, &
- this%trackfilectl)
+ this%trackctl)
end select
! -- Read and allocate package
call packobj%bnd_ar()
@@ -260,7 +261,7 @@ subroutine prt_ar(this)
type is (DisType)
call method_dis%init( &
fmi=this%fmi, &
- trackfilectl=this%trackfilectl, &
+ trackctl=this%trackctl, &
izone=this%mip%izone, &
flowja=this%flowja, &
porosity=this%mip%porosity, &
@@ -270,7 +271,7 @@ subroutine prt_ar(this)
type is (DisvType)
call method_disv%init( &
fmi=this%fmi, &
- trackfilectl=this%trackfilectl, &
+ trackctl=this%trackctl, &
izone=this%mip%izone, &
flowja=this%flowja, &
porosity=this%mip%porosity, &
@@ -281,10 +282,10 @@ subroutine prt_ar(this)
! -- Initialize track output files and reporting options
if (this%oc%itrkout > 0) &
- call this%trackfilectl%init_track_file(this%oc%itrkout)
+ call this%trackctl%init_track_file(this%oc%itrkout)
if (this%oc%itrkcsv > 0) &
- call this%trackfilectl%init_track_file(this%oc%itrkcsv, csv=.true.)
- call this%trackfilectl%set_track_events( &
+ call this%trackctl%init_track_file(this%oc%itrkcsv, csv=.true.)
+ call this%trackctl%set_track_events( &
this%oc%trackrelease, &
this%oc%trackexit, &
this%oc%tracktimestep, &
@@ -742,7 +743,7 @@ subroutine prt_da(this)
call mem_deallocate(this%ratesto)
! -- Track file control
- deallocate (this%trackfilectl)
+ deallocate (this%trackctl)
! -- Parent type
call this%NumericalModelType%model_da()
@@ -912,12 +913,12 @@ subroutine prt_solve(this)
! -- Initialize PRP-specific track files, if enabled
if (packobj%itrkout > 0) then
- call this%trackfilectl%init_track_file( &
+ call this%trackctl%init_track_file( &
packobj%itrkout, &
iprp=iprp)
end if
if (packobj%itrkcsv > 0) then
- call this%trackfilectl%init_track_file( &
+ call this%trackctl%init_track_file( &
packobj%itrkcsv, &
csv=.true., &
iprp=iprp)
diff --git a/src/Solution/ParticleTracker/Method.f90 b/src/Solution/ParticleTracker/Method.f90
index 9d9d88e3ecf..38049b5d51a 100644
--- a/src/Solution/ParticleTracker/Method.f90
+++ b/src/Solution/ParticleTracker/Method.f90
@@ -9,7 +9,7 @@ module MethodModule
use PrtFmiModule, only: PrtFmiType
use CellModule, only: CellType
use CellDefnModule, only: CellDefnType
- use TrackModule, only: TrackFileControlType
+ use TrackControlModule, only: TrackControlType
use TimeSelectModule, only: TimeSelectType
implicit none
@@ -32,7 +32,7 @@ module MethodModule
type(PrtFmiType), pointer, public :: fmi => null() !< ptr to fmi
class(CellType), pointer, public :: cell => null() !< ptr to the current cell
class(SubcellType), pointer, public :: subcell => null() !< ptr to the current subcell
- type(TrackFileControlType), pointer, public :: trackfilectl => null() !< ptr to track file control
+ type(TrackControlType), pointer, public :: trackctl => null() !< ptr to track file control
type(TimeSelectType), pointer, public :: tracktimes => null() !< ptr to user-defined tracking times
integer(I4B), dimension(:), pointer, contiguous, public :: izone => null() !< pointer to zone numbers
real(DP), dimension(:), pointer, contiguous, public :: flowja => null() !< pointer to intercell flows
@@ -70,13 +70,13 @@ end subroutine deallocate
contains
- subroutine init(this, fmi, cell, subcell, trackfilectl, tracktimes, &
+ subroutine init(this, fmi, cell, subcell, trackctl, tracktimes, &
izone, flowja, porosity, retfactor)
class(MethodType), intent(inout) :: this
type(PrtFmiType), intent(in), pointer, optional :: fmi
class(CellType), intent(in), pointer, optional :: cell
class(SubcellType), intent(in), pointer, optional :: subcell
- type(TrackFileControlType), intent(in), pointer, optional :: trackfilectl
+ type(TrackControlType), intent(in), pointer, optional :: trackctl
type(TimeSelectType), intent(in), pointer, optional :: tracktimes
integer(I4B), intent(in), pointer, optional :: izone(:)
real(DP), intent(in), pointer, optional :: flowja(:)
@@ -86,7 +86,7 @@ subroutine init(this, fmi, cell, subcell, trackfilectl, tracktimes, &
if (present(fmi)) this%fmi => fmi
if (present(cell)) this%cell => cell
if (present(subcell)) this%subcell => subcell
- if (present(trackfilectl)) this%trackfilectl => trackfilectl
+ if (present(trackctl)) this%trackctl => trackctl
if (present(tracktimes)) this%tracktimes => tracktimes
if (present(izone)) this%izone => izone
if (present(flowja)) this%flowja => flowja
@@ -180,8 +180,8 @@ subroutine save(this, particle, reason)
end if
! Save the particle's state to any registered tracking output files
- call this%trackfilectl%save(particle, kper=per, &
- kstp=stp, reason=reason)
+ call this%trackctl%save(particle, kper=per, &
+ kstp=stp, reason=reason)
end subroutine save
!> @brief Update particle state and check termination conditions
@@ -192,7 +192,7 @@ end subroutine save
!! conditions apply, save particle state with the proper reason code.
!<
subroutine update(this, particle, cell_defn)
- ! -- dummy
+ ! dummy
class(MethodType), intent(inout) :: this
type(ParticleType), pointer, intent(inout) :: particle
type(CellDefnType), pointer, intent(inout) :: cell_defn
diff --git a/src/Solution/ParticleTracker/MethodCellPassToBot.f90 b/src/Solution/ParticleTracker/MethodCellPassToBot.f90
index 109491528cf..33825b5b7b6 100644
--- a/src/Solution/ParticleTracker/MethodCellPassToBot.f90
+++ b/src/Solution/ParticleTracker/MethodCellPassToBot.f90
@@ -8,7 +8,7 @@ module MethodCellPassToBotModule
use ParticleModule, only: ParticleType
use CellModule, only: CellType
use SubcellModule, only: SubcellType
- use TrackModule, only: TrackFileControlType
+ use TrackControlModule, only: TrackControlType
implicit none
private
@@ -41,7 +41,7 @@ end subroutine deallocate
!> @brief Pass particle vertically and instantaneously to the cell bottom
subroutine apply_ptb(this, particle, tmax)
- ! -- dummy
+ ! dummy
class(MethodCellPassToBotType), intent(inout) :: this
type(ParticleType), pointer, intent(inout) :: particle
real(DP), intent(in) :: tmax
diff --git a/src/Solution/ParticleTracker/MethodCellPollock.f90 b/src/Solution/ParticleTracker/MethodCellPollock.f90
index 669e989df8f..71fc327fef7 100644
--- a/src/Solution/ParticleTracker/MethodCellPollock.f90
+++ b/src/Solution/ParticleTracker/MethodCellPollock.f90
@@ -8,7 +8,6 @@ module MethodCellPollockModule
use CellRectModule, only: CellRectType, create_cell_rect
use SubcellRectModule, only: SubcellRectType, create_subcell_rect
use ParticleModule, only: ParticleType
- use TrackModule, only: TrackFileControlType
implicit none
private
@@ -28,9 +27,9 @@ module MethodCellPollockModule
!> @brief Create a tracking method
subroutine create_method_cell_pollock(method)
- ! -- dummy
+ ! dummy
type(MethodCellPollockType), pointer :: method
- ! -- local
+ ! local
type(CellRectType), pointer :: cell
type(SubcellRectType), pointer :: subcell
@@ -51,9 +50,9 @@ end subroutine destroy_mcp
!> @brief Load subcell tracking method
subroutine load_mcp(this, particle, next_level, submethod)
- ! -- modules
+ ! modules
use SubcellModule, only: SubcellType
- ! -- dummy
+ ! dummy
class(MethodCellPollockType), intent(inout) :: this
type(ParticleType), pointer, intent(inout) :: particle
integer, intent(in) :: next_level
@@ -66,7 +65,7 @@ subroutine load_mcp(this, particle, next_level, submethod)
call method_subcell_plck%init( &
cell=this%cell, &
subcell=this%subcell, &
- trackfilectl=this%trackfilectl, &
+ trackctl=this%trackctl, &
tracktimes=this%tracktimes)
submethod => method_subcell_plck
particle%idomain(next_level) = 1
@@ -75,15 +74,15 @@ end subroutine load_mcp
!> @brief Having exited the lone subcell, pass the particle to the cell face
!! In this case the lone subcell is the cell.
subroutine pass_mcp(this, particle)
- ! -- dummy
+ ! dummy
class(MethodCellPollockType), intent(inout) :: this
type(ParticleType), pointer, intent(inout) :: particle
- ! -- local
+ ! local
integer(I4B) :: exitface
integer(I4B) :: entryface
exitface = particle%iboundary(3)
- ! -- Map subcell exit face to cell face
+ ! Map subcell exit face to cell face
select case (exitface) ! note: exitFace uses Dave's iface convention
case (0)
entryface = -1
@@ -104,7 +103,7 @@ subroutine pass_mcp(this, particle)
particle%iboundary(2) = 0
else
if ((entryface .ge. 1) .and. (entryface .le. 4)) then
- ! -- Account for local cell rotation
+ ! Account for local cell rotation
select type (cell => this%cell)
type is (CellRectType)
entryface = entryface + cell%ipvOrigin - 1
@@ -117,11 +116,11 @@ end subroutine pass_mcp
!> @brief Apply Pollock's method to a rectangular cell
subroutine apply_mcp(this, particle, tmax)
- ! -- dummy
+ ! dummy
class(MethodCellPollockType), intent(inout) :: this
type(ParticleType), pointer, intent(inout) :: particle
real(DP), intent(in) :: tmax
- ! -- local
+ ! local
real(DP) :: xOrigin
real(DP) :: yOrigin
real(DP) :: zOrigin
@@ -130,26 +129,19 @@ subroutine apply_mcp(this, particle, tmax)
select type (cell => this%cell)
type is (CellRectType)
- ! -- Update particle state, checking whether any reporting or
- ! -- termination conditions apply
+ ! Update particle state, return early if done advancing
call this%update(particle, cell%defn)
-
- ! -- Return early if particle is done advancing
if (.not. particle%advancing) return
- ! -- If the particle is above the top of the cell (which is presumed to
- ! -- represent a water table above the cell bottom), pass the particle
- ! -- vertically and instantaneously to the cell top elevation and save
- ! -- the particle state to output file(s).
+ ! If the particle is above the top of the cell (presumed water table)
+ ! pass it vertically and instantaneously to the top
if (particle%z > cell%defn%top) then
particle%z = cell%defn%top
- call this%save(particle, reason=1) ! reason=1: cell transition
+ call this%save(particle, reason=1)
end if
- ! Transform particle location into local cell coordinates
- ! (translated and rotated but not scaled relative to model).
- ! Transform particle location back to model coordinates, then
- ! reset transformation and eliminate accumulated roundoff error.
+ ! Transform particle location into local cell coordinates
+ ! (translated and rotated but not scaled relative to model).
xOrigin = cell%xOrigin
yOrigin = cell%yOrigin
zOrigin = cell%zOrigin
@@ -157,7 +149,12 @@ subroutine apply_mcp(this, particle, tmax)
cosrot = cell%cosrot
call particle%transform(xOrigin, yOrigin, zOrigin, &
sinrot, cosrot)
+
+ ! Track the particle across the cell.
call this%track(particle, 2, tmax)
+
+ ! Transform particle location back to model coordinates, then
+ ! reset transformation and eliminate accumulated roundoff error.
call particle%transform(xOrigin, yOrigin, zOrigin, &
sinrot, cosrot, invert=.true.)
call particle%transform(reset=.true.)
@@ -166,17 +163,17 @@ end subroutine apply_mcp
!> @brief Loads the lone rectangular subcell from the rectangular cell
subroutine load_subcell(this, particle, subcell) !
- ! -- dummy
+ ! dummy
class(MethodCellPollockType), intent(inout) :: this
type(ParticleType), pointer, intent(inout) :: particle
type(SubcellRectType), intent(inout) :: subcell
select type (cell => this%cell)
type is (CellRectType)
- ! -- Set subcell number to 1
+ ! Set subcell number to 1
subcell%isubcell = 1
- ! -- Subcell calculations will be done in local subcell coordinates
+ ! Subcell calculations will be done in local subcell coordinates
subcell%dx = cell%dx
subcell%dy = cell%dy
subcell%dz = cell%dz
@@ -186,7 +183,7 @@ subroutine load_subcell(this, particle, subcell) !
subcell%yOrigin = DZERO
subcell%zOrigin = DZERO
- ! -- Set subcell edge velocities
+ ! Set subcell edge velocities
subcell%vx1 = cell%vx1 ! cell velocities already account for retfactor and porosity
subcell%vx2 = cell%vx2
subcell%vy1 = cell%vy1
diff --git a/src/Solution/ParticleTracker/MethodCellPollockQuad.f90 b/src/Solution/ParticleTracker/MethodCellPollockQuad.f90
index ff3f6234f09..8fe7e41525f 100644
--- a/src/Solution/ParticleTracker/MethodCellPollockQuad.f90
+++ b/src/Solution/ParticleTracker/MethodCellPollockQuad.f90
@@ -9,7 +9,6 @@ module MethodCellPollockQuadModule
use CellDefnModule, only: CellDefnType
use SubcellRectModule, only: SubcellRectType, create_subcell_rect
use ParticleModule, only: ParticleType
- use TrackModule, only: TrackFileControlType
implicit none
private
@@ -29,9 +28,9 @@ module MethodCellPollockQuadModule
!> @brief Create a new Pollock quad-refined cell method
subroutine create_method_cell_quad(method)
- ! -- dummy
+ ! dummy
type(MethodCellPollockQuadType), pointer :: method
- ! -- local
+ ! local
type(CellRectQuadType), pointer :: cell
type(SubcellRectType), pointer :: subcell
@@ -62,19 +61,20 @@ subroutine load_mcpq(this, particle, next_level, submethod)
call this%load_subcell(particle, subcell)
end select
call method_subcell_plck%init( &
+ fmi=this%fmi, &
cell=this%cell, &
subcell=this%subcell, &
- trackfilectl=this%trackfilectl, &
+ trackctl=this%trackctl, &
tracktimes=this%tracktimes)
submethod => method_subcell_plck
end subroutine load_mcpq
!> @brief Pass particle to next subcell if there is one, or to the cell face
subroutine pass_mcpq(this, particle)
- ! -- dummy
+ ! dummy
class(MethodCellPollockQuadType), intent(inout) :: this
type(ParticleType), pointer, intent(inout) :: particle
- ! -- local
+ ! local
integer(I4B) :: isc, exitFace, npolyverts, inface, infaceoff
select type (cell => this%cell)
@@ -86,46 +86,46 @@ subroutine pass_mcpq(this, particle)
! exitFace uses MODPATH 7 iface convention here
select case (exitFace)
case (0)
- ! -- Subcell interior (cell interior)
+ ! Subcell interior (cell interior)
inface = -1
case (1)
select case (isc)
case (1)
- ! -- W face, subcell 1 --> E face, subcell 4 (cell interior)
+ ! W face, subcell 1 --> E face, subcell 4 (cell interior)
particle%idomain(3) = 4
particle%iboundary(3) = 2
inface = 0 ! want Domain(2) unchanged; Boundary(2) = 0
case (2)
- ! -- W face, subcell 2 --> E face, subcell 3 (cell interior)
+ ! W face, subcell 2 --> E face, subcell 3 (cell interior)
particle%idomain(3) = 3
particle%iboundary(3) = 2
inface = 0 ! want Domain(2) unchanged; Boundary(2) = 0
case (3)
- ! -- W face, subcell 3 (cell face)
+ ! W face, subcell 3 (cell face)
inface = 1 ! want Domain(2) = -Domain(2); Boundary(2) = inface
infaceoff = 0
case (4)
- ! -- W face, subcell 4 (cell face)
+ ! W face, subcell 4 (cell face)
inface = 2 ! want Domain(2) = -Domain(2); Boundary(2) = inface
infaceoff = -1
end select
case (2)
select case (isc)
case (1)
- ! -- E face, subcell 1 (cell face)
+ ! E face, subcell 1 (cell face)
inface = 3 ! want Domain(2) = -Domain(2); Boundary(2) = inface
infaceoff = 0
case (2)
- ! -- E face, subcell 2 (cell face)
+ ! E face, subcell 2 (cell face)
inface = 4 ! want Domain(2) = -Domain(2); Boundary(2) = inface
infaceoff = -1
case (3)
- ! -- E face, subcell 3 --> W face, subcell 2 (cell interior)
+ ! E face, subcell 3 --> W face, subcell 2 (cell interior)
particle%idomain(3) = 2
particle%iboundary(3) = 1
inface = 0 ! want Domain(2) unchanged; Boundary(2) = 0
case (4)
- ! -- E face, subcell 4 --> W face subcell 1 (cell interior)
+ ! E face, subcell 4 --> W face subcell 1 (cell interior)
particle%idomain(3) = 1
particle%iboundary(3) = 1
inface = 0 ! want Domain(2) unchanged; Boundary(2) = 0
@@ -133,20 +133,20 @@ subroutine pass_mcpq(this, particle)
case (3)
select case (isc)
case (1)
- ! -- S face, subcell 1 --> N face, subcell 2 (cell interior)
+ ! S face, subcell 1 --> N face, subcell 2 (cell interior)
particle%idomain(3) = 2
particle%iboundary(3) = 4
inface = 0 ! want Domain(2) unchanged; Boundary(2) = 0
case (2)
- ! -- S face, subcell 2 (cell face)
+ ! S face, subcell 2 (cell face)
inface = 4 ! want Domain(2) = -Domain(2); Boundary(2) = inface
infaceoff = 0
case (3)
- ! -- S face, subcell 3 (cell face)
+ ! S face, subcell 3 (cell face)
inface = 1 ! want Domain(2) = -Domain(2); Boundary(2) = inface
infaceoff = -1
case (4)
- ! -- S face, subcell 4 --> N face, subcell 3 (cell interior)
+ ! S face, subcell 4 --> N face, subcell 3 (cell interior)
particle%idomain(3) = 3
particle%iboundary(3) = 4
inface = 0 ! want Domain(2) unchanged; Boundary(2) = 0
@@ -154,29 +154,29 @@ subroutine pass_mcpq(this, particle)
case (4)
select case (isc)
case (1)
- ! -- N face, subcell 1 (cell face)
+ ! N face, subcell 1 (cell face)
inface = 3 ! want Domain(2) = -Domain(2); Boundary(2) = inface
infaceoff = -1
case (2)
- ! -- N face, subcell 2 --> S face, subcell 1 (cell interior)
+ ! N face, subcell 2 --> S face, subcell 1 (cell interior)
particle%idomain(3) = 1
particle%iboundary(3) = 3
inface = 0 ! want Domain(2) unchanged; Boundary(2) = 0
case (3)
- ! -- N face, subcell 3 --> S face, subcell 4 (cell interior)
+ ! N face, subcell 3 --> S face, subcell 4 (cell interior)
particle%idomain(3) = 4
particle%iboundary(3) = 3
inface = 0 ! want Domain(2) unchanged; Boundary(2) = 0
case (4)
- ! -- N face, subcell 4 (cell face)
+ ! N face, subcell 4 (cell face)
inface = 2 ! want Domain(2) = -Domain(2); Boundary(2) = inface
infaceoff = 0
end select
case (5)
- ! -- Subcell bottom (cell bottom)
+ ! Subcell bottom (cell bottom)
inface = npolyverts + 2 ! want Domain(2) = -Domain(2); Boundary(2) = inface
case (6)
- ! -- Subcell top (cell top)
+ ! Subcell top (cell top)
inface = npolyverts + 3 ! want Domain(2) = -Domain(2); Boundary(2) = inface
end select
@@ -186,7 +186,7 @@ subroutine pass_mcpq(this, particle)
particle%iboundary(2) = 0
else
if ((inface .ge. 1) .and. (inface .le. 4)) then
- ! -- Account for local cell rotation
+ ! Account for local cell rotation
inface = inface + cell%irvOrigin - 1
if (inface .gt. 4) inface = inface - 4
inface = cell%irectvert(inface) + infaceoff
@@ -199,32 +199,28 @@ end subroutine pass_mcpq
!> @brief Solve the quad-rectangular cell via Pollock's method
subroutine apply_mcpq(this, particle, tmax)
- ! -- dummy
+ ! dummy
class(MethodCellPollockQuadType), intent(inout) :: this
type(ParticleType), pointer, intent(inout) :: particle
real(DP), intent(in) :: tmax
- ! -- local
+ ! local
double precision :: xOrigin, yOrigin, zOrigin, sinrot, cosrot
select type (cell => this%cell)
type is (CellRectQuadType)
- ! -- Update particle state, terminate early if done advancing
+ ! Update particle state, return early if done advancing
call this%update(particle, cell%defn)
if (.not. particle%advancing) return
- ! -- If the particle is above the top of the cell (which is presumed to
- ! -- represent a water table above the cell bottom), pass the particle
- ! -- vertically and instantaneously to the cell top elevation and save
- ! -- the particle state to output file(s).
+ ! If the particle is above the top of the cell (presumed water table)
+ ! pass it vertically and instantaneously to the top
if (particle%z > cell%defn%top) then
particle%z = cell%defn%top
call this%save(particle, reason=1) ! reason=1: cell transition
end if
- ! -- Transform particle location into local cell coordinates,
- ! translated and rotated but not scaled relative to model.
- ! Then track particle, transform back to model coordinates,
- ! and reset transformation (drop accumulated roundoff error)
+ ! Transform particle location into local cell coordinates
+ ! (translated and rotated but not scaled relative to model).
xOrigin = cell%xOrigin
yOrigin = cell%yOrigin
zOrigin = cell%zOrigin
@@ -232,7 +228,12 @@ subroutine apply_mcpq(this, particle, tmax)
cosrot = cell%cosrot
call particle%transform(xOrigin, yOrigin, zOrigin, &
sinrot, cosrot)
+
+ ! Track the particle across the cell.
call this%track(particle, 2, tmax)
+
+ ! Transform particle location back to model coordinates, then
+ ! reset transformation and eliminate accumulated roundoff error.
call particle%transform(xOrigin, yOrigin, zOrigin, &
sinrot, cosrot, invert=.true.)
call particle%transform(reset=.true.)
@@ -241,11 +242,11 @@ end subroutine apply_mcpq
!> @brief Load the rectangular subcell from the rectangular cell
subroutine load_subcell(this, particle, subcell)
- ! -- dummy
+ ! dummy
class(MethodCellPollockQuadType), intent(inout) :: this
type(ParticleType), pointer, intent(inout) :: particle
class(SubcellRectType), intent(inout) :: subcell
- ! -- local
+ ! local
real(DP) :: dx, dy, dz, areax, areay, areaz
real(DP) :: dxprel, dyprel
integer(I4B) :: isc, npolyverts, m1, m2
@@ -259,12 +260,12 @@ subroutine load_subcell(this, particle, subcell)
npolyverts = cell%defn%npolyverts
isc = particle%idomain(3)
- ! -- Subcells 1, 2, 3, and 4 are Pollock's subcells A, B, C, and D,
- ! -- respectively
+ ! Subcells 1, 2, 3, and 4 are Pollock's subcells A, B, C, and D,
+ ! respectively
dx = cell%dx
dy = cell%dy
- ! -- If not already known, determine subcell number
+ ! If not already known, determine subcell number
if (isc .le. 0) then
dxprel = particle%x / dx
dyprel = particle%y / dy
diff --git a/src/Solution/ParticleTracker/MethodCellTernary.f90 b/src/Solution/ParticleTracker/MethodCellTernary.f90
index ddc269d382e..fac00b00845 100644
--- a/src/Solution/ParticleTracker/MethodCellTernary.f90
+++ b/src/Solution/ParticleTracker/MethodCellTernary.f90
@@ -8,7 +8,6 @@ module MethodCellTernaryModule
use CellDefnModule
use SubcellTriModule, only: SubcellTriType, create_subcell_tri
use ParticleModule
- use TrackModule, only: TrackFileControlType
use GeomUtilModule, only: area
use ConstantsModule, only: DZERO, DONE, DTWO
implicit none
@@ -88,9 +87,10 @@ subroutine load_mct(this, particle, next_level, submethod)
call this%load_subcell(particle, subcell)
end select
call method_subcell_tern%init( &
+ fmi=this%fmi, &
cell=this%cell, &
subcell=this%subcell, &
- trackfilectl=this%trackfilectl, &
+ trackctl=this%trackctl, &
tracktimes=this%tracktimes)
submethod => method_subcell_tern
end subroutine load_mct
@@ -156,21 +156,18 @@ subroutine apply_mct(this, particle, tmax)
! local
integer(I4B) :: i
- ! Update particle state, checking whether any reporting or
- ! termination conditions apply
+ ! Update particle state, return early if done advancing
call this%update(particle, this%cell%defn)
-
- ! Return early if particle is done advancing
if (.not. particle%advancing) return
! If the particle is above the top of the cell (presumed water table)
- ! pass it vertically and instantaneously to the cell top and save the
- ! particle state to file
+ ! pass it vertically and instantaneously to the top
if (particle%z > this%cell%defn%top) then
particle%z = this%cell%defn%top
- call this%save(particle, reason=1) ! reason=1: cell transition
+ call this%save(particle, reason=1)
end if
+ ! (Re)allocate type-bound arrays
select type (cell => this%cell)
type is (CellPolyType)
! Number of vertices
@@ -216,10 +213,10 @@ subroutine apply_mct(this, particle, tmax)
this%yvertnext = cshift(this%yvert, 1)
end select
- ! Calculate vertex velocities
+ ! Calculate vertex velocities.
call this%vertvelo()
- ! Track across subcells
+ ! Track the particle across the cell.
call this%track(particle, 2, tmax)
end subroutine apply_mct
diff --git a/src/Solution/ParticleTracker/MethodDis.f90 b/src/Solution/ParticleTracker/MethodDis.f90
index 997e58842f7..ad427c9e411 100644
--- a/src/Solution/ParticleTracker/MethodDis.f90
+++ b/src/Solution/ParticleTracker/MethodDis.f90
@@ -10,7 +10,6 @@ module MethodDisModule
use ParticleModule
use PrtFmiModule, only: PrtFmiType
use DisModule, only: DisType
- use TrackModule, only: TrackFileControlType
use GeomUtilModule, only: get_ijk, get_jk
implicit none
@@ -133,15 +132,17 @@ subroutine load_dis(this, particle, next_level, submethod)
! -- If cell is active but dry, Initialize instant pass-to-bottom method
if (this%fmi%ibdgwfsat0(ic) == 0) then
call method_cell_ptb%init( &
+ fmi=this%fmi, &
cell=this%cell, &
- trackfilectl=this%trackfilectl, &
+ trackctl=this%trackctl, &
tracktimes=this%tracktimes)
submethod => method_cell_ptb
else
! -- Otherwise initialize Pollock's method
call method_cell_plck%init( &
+ fmi=this%fmi, &
cell=this%cell, &
- trackfilectl=this%trackfilectl, &
+ trackctl=this%trackctl, &
tracktimes=this%tracktimes)
submethod => method_cell_plck
end if
diff --git a/src/Solution/ParticleTracker/MethodDisv.f90 b/src/Solution/ParticleTracker/MethodDisv.f90
index d8acddc4379..4303594af9f 100644
--- a/src/Solution/ParticleTracker/MethodDisv.f90
+++ b/src/Solution/ParticleTracker/MethodDisv.f90
@@ -12,7 +12,6 @@ module MethodDisvModule
use PrtFmiModule, only: PrtFmiType
use DisvModule, only: DisvType
use ArrayHandlersModule, only: ExpandArray
- use TrackModule, only: TrackFileControlType
use GeomUtilModule, only: get_jk, shared_face
implicit none
@@ -93,38 +92,43 @@ subroutine load_disv(this, particle, next_level, submethod)
! -- Cell is active but dry, so select and initialize pass-to-bottom
! -- cell method and set cell method pointer
call method_cell_ptb%init( &
+ fmi=this%fmi, &
cell=this%cell, &
- trackfilectl=this%trackfilectl, &
+ trackctl=this%trackctl, &
tracktimes=this%tracktimes)
submethod => method_cell_ptb
else
! -- Select and initialize cell method and set cell method pointer
if (particle%ifrctrn > 0) then
call method_cell_tern%init( &
+ fmi=this%fmi, &
cell=this%cell, &
- trackfilectl=this%trackfilectl, &
+ trackctl=this%trackctl, &
tracktimes=this%tracktimes)
submethod => method_cell_tern
else if (cell%defn%can_be_rect) then
call cell_poly_to_rect(cell, rect)
base => rect
call method_cell_plck%init( &
+ fmi=this%fmi, &
cell=base, &
- trackfilectl=this%trackfilectl, &
+ trackctl=this%trackctl, &
tracktimes=this%tracktimes)
submethod => method_cell_plck
else if (cell%defn%can_be_quad) then
call cell_poly_to_quad(cell, quad)
base => quad
call method_cell_quad%init( &
+ fmi=this%fmi, &
cell=base, &
- trackfilectl=this%trackfilectl, &
+ trackctl=this%trackctl, &
tracktimes=this%tracktimes)
submethod => method_cell_quad
else
call method_cell_tern%init( &
+ fmi=this%fmi, &
cell=this%cell, &
- trackfilectl=this%trackfilectl, &
+ trackctl=this%trackctl, &
tracktimes=this%tracktimes)
submethod => method_cell_tern
end if
diff --git a/src/Solution/ParticleTracker/MethodSubcellPollock.f90 b/src/Solution/ParticleTracker/MethodSubcellPollock.f90
index 8eee9c55d53..de9157b8b9e 100644
--- a/src/Solution/ParticleTracker/MethodSubcellPollock.f90
+++ b/src/Solution/ParticleTracker/MethodSubcellPollock.f90
@@ -5,7 +5,6 @@ module MethodSubcellPollockModule
use SubcellRectModule, only: SubcellRectType, create_subcell_rect
use ParticleModule, only: ParticleType
use PrtFmiModule, only: PrtFmiType
- use TrackModule, only: TrackFileControlType
use BaseDisModule, only: DisBaseType
use CellModule, only: CellType
use ConstantsModule, only: DZERO, DONE
diff --git a/src/Solution/ParticleTracker/MethodSubcellTernary.f90 b/src/Solution/ParticleTracker/MethodSubcellTernary.f90
index 0ce5fe20c59..057eca00050 100644
--- a/src/Solution/ParticleTracker/MethodSubcellTernary.f90
+++ b/src/Solution/ParticleTracker/MethodSubcellTernary.f90
@@ -8,7 +8,6 @@ module MethodSubcellTernaryModule
use SubcellModule, only: SubcellType
use SubcellTriModule, only: SubcellTriType, create_subcell_tri
use ParticleModule, only: ParticleType
- use TrackModule, only: TrackFileControlType
use TernarySolveTrack, only: traverse_triangle, step_analytical, canonical
use PrtFmiModule, only: PrtFmiType
use BaseDisModule, only: DisBaseType
diff --git a/src/meson.build b/src/meson.build
index 2035b4936e5..0cd60f953c5 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -250,7 +250,8 @@ modflow_sources = files(
'Model' / 'ModelUtilities' / 'TspSpc.f90',
'Model' / 'ModelUtilities' / 'TimeSelect.f90',
'Model' / 'ModelUtilities' / 'TimeStepSelect.f90',
- 'Model' / 'ModelUtilities' / 'TrackData.f90',
+ 'Model' / 'ModelUtilities' / 'TrackFile.f90',
+ 'Model' / 'ModelUtilities' / 'TrackControl.f90',
'Model' / 'ModelUtilities' / 'UzfCellGroup.f90',
'Model' / 'ModelUtilities' / 'UzfEtUtil.f90',
'Model' / 'ModelUtilities' / 'VectorInterpolation.f90',