Skip to content

Commit f98da70

Browse files
authored
refactor(prt): rename particle idomain -> itrdomain (#2457)
Disambiguate particle tracking domain index from the existing grid-related term idomain by renaming to itrdomain
1 parent e02a56c commit f98da70

File tree

9 files changed

+42
-46
lines changed

9 files changed

+42
-46
lines changed

src/Model/ParticleTracking/prt-prp.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,11 +535,11 @@ subroutine initialize_particle(this, particle, ip, trelease)
535535
end if
536536

537537
particle%ttrack = particle%trelease
538-
particle%idomain(1) = 0
538+
particle%itrdomain(1) = 0
539539
particle%iboundary(1) = 0
540-
particle%idomain(2) = ic
540+
particle%itrdomain(2) = ic
541541
particle%iboundary(2) = 0
542-
particle%idomain(3) = 0
542+
particle%itrdomain(3) = 0
543543
particle%iboundary(3) = 0
544544
particle%ifrctrn = this%ifrctrn
545545
particle%iexmeth = this%iexmeth

src/Model/ParticleTracking/prt.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ subroutine prt_cq_sto(this)
464464
istatus = packobj%particles%istatus(np)
465465
! this may need to change if istatus flags change
466466
if ((istatus > 0) .and. (istatus /= 8)) then
467-
n = packobj%particles%idomain(np, 2)
467+
n = packobj%particles%itrdomain(np, 2)
468468
! Each particle currently assigned unit mass
469469
this%masssto(n) = this%masssto(n) + DONE
470470
end if

src/Solution/ParticleTracker/Method/MethodCellPollock.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ subroutine load_mcp(this, particle, next_level, submethod)
6969
events=this%events, &
7070
tracktimes=this%tracktimes)
7171
submethod => method_subcell_plck
72-
particle%idomain(next_level) = 1
72+
particle%itrdomain(next_level) = 1
7373
end subroutine load_mcp
7474

7575
!> @brief Having exited the lone subcell, pass the particle to the cell face

src/Solution/ParticleTracker/Method/MethodCellPollockQuad.f90

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ subroutine pass_mcpq(this, particle)
8181
select type (cell => this%cell)
8282
type is (CellRectQuadType)
8383
exitFace = particle%iboundary(3)
84-
isc = particle%idomain(3)
84+
isc = particle%itrdomain(3)
8585
npolyverts = cell%defn%npolyverts
8686

8787
! exitFace uses MODPATH 7 iface convention here
@@ -93,12 +93,12 @@ subroutine pass_mcpq(this, particle)
9393
select case (isc)
9494
case (1)
9595
! W face, subcell 1 --> E face, subcell 4 (cell interior)
96-
particle%idomain(3) = 4
96+
particle%itrdomain(3) = 4
9797
particle%iboundary(3) = 2
9898
inface = 0 ! want Domain(2) unchanged; Boundary(2) = 0
9999
case (2)
100100
! W face, subcell 2 --> E face, subcell 3 (cell interior)
101-
particle%idomain(3) = 3
101+
particle%itrdomain(3) = 3
102102
particle%iboundary(3) = 2
103103
inface = 0 ! want Domain(2) unchanged; Boundary(2) = 0
104104
case (3)
@@ -122,20 +122,20 @@ subroutine pass_mcpq(this, particle)
122122
infaceoff = -1
123123
case (3)
124124
! E face, subcell 3 --> W face, subcell 2 (cell interior)
125-
particle%idomain(3) = 2
125+
particle%itrdomain(3) = 2
126126
particle%iboundary(3) = 1
127127
inface = 0 ! want Domain(2) unchanged; Boundary(2) = 0
128128
case (4)
129129
! E face, subcell 4 --> W face subcell 1 (cell interior)
130-
particle%idomain(3) = 1
130+
particle%itrdomain(3) = 1
131131
particle%iboundary(3) = 1
132132
inface = 0 ! want Domain(2) unchanged; Boundary(2) = 0
133133
end select
134134
case (3)
135135
select case (isc)
136136
case (1)
137137
! S face, subcell 1 --> N face, subcell 2 (cell interior)
138-
particle%idomain(3) = 2
138+
particle%itrdomain(3) = 2
139139
particle%iboundary(3) = 4
140140
inface = 0 ! want Domain(2) unchanged; Boundary(2) = 0
141141
case (2)
@@ -148,7 +148,7 @@ subroutine pass_mcpq(this, particle)
148148
infaceoff = -1
149149
case (4)
150150
! S face, subcell 4 --> N face, subcell 3 (cell interior)
151-
particle%idomain(3) = 3
151+
particle%itrdomain(3) = 3
152152
particle%iboundary(3) = 4
153153
inface = 0 ! want Domain(2) unchanged; Boundary(2) = 0
154154
end select
@@ -160,12 +160,12 @@ subroutine pass_mcpq(this, particle)
160160
infaceoff = -1
161161
case (2)
162162
! N face, subcell 2 --> S face, subcell 1 (cell interior)
163-
particle%idomain(3) = 1
163+
particle%itrdomain(3) = 1
164164
particle%iboundary(3) = 3
165165
inface = 0 ! want Domain(2) unchanged; Boundary(2) = 0
166166
case (3)
167167
! N face, subcell 3 --> S face, subcell 4 (cell interior)
168-
particle%idomain(3) = 4
168+
particle%itrdomain(3) = 4
169169
particle%iboundary(3) = 3
170170
inface = 0 ! want Domain(2) unchanged; Boundary(2) = 0
171171
case (4)
@@ -251,7 +251,7 @@ subroutine load_subcell(this, particle, subcell)
251251
factor = factor / cell%defn%porosity
252252
npolyverts = cell%defn%npolyverts
253253

254-
isc = particle%idomain(3)
254+
isc = particle%itrdomain(3)
255255
! Subcells 1, 2, 3, and 4 are Pollock's subcells A, B, C, and D,
256256
! respectively
257257

@@ -277,7 +277,7 @@ subroutine load_subcell(this, particle, subcell)
277277
end if
278278

279279
subcell%isubcell = isc
280-
particle%idomain(3) = isc
280+
particle%itrdomain(3) = isc
281281
end if
282282
dx = 5d-1 * dx
283283
dy = 5d-1 * dy

src/Solution/ParticleTracker/Method/MethodCellTernary.f90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ subroutine pass_mct(this, particle)
109109
integer(I4B) :: inface
110110

111111
exitFace = particle%iboundary(3)
112-
isc = particle%idomain(3)
112+
isc = particle%itrdomain(3)
113113

114114
select case (exitFace)
115115
case (0)
@@ -123,14 +123,14 @@ subroutine pass_mct(this, particle)
123123
! Subcell face --> next subcell in "cycle" (cell interior)
124124
isc = isc + 1
125125
if (isc .gt. this%nverts) isc = 1
126-
particle%idomain(3) = isc
126+
particle%itrdomain(3) = isc
127127
particle%iboundary(3) = 3
128128
inface = 0
129129
case (3)
130130
! Subcell face --> preceding subcell in "cycle" (cell interior)
131131
isc = isc - 1
132132
if (isc .lt. 1) isc = this%nverts
133-
particle%idomain(3) = isc
133+
particle%itrdomain(3) = isc
134134
particle%iboundary(3) = 2
135135
inface = 0
136136
case (4)
@@ -280,7 +280,7 @@ subroutine load_subcell(this, particle, subcell)
280280
type is (CellPolyType)
281281
ic = cell%defn%icell
282282
subcell%icell = ic
283-
isc = particle%idomain(3)
283+
isc = particle%itrdomain(3)
284284
if (isc .le. 0) then
285285
xi = particle%x
286286
yi = particle%y
@@ -315,7 +315,7 @@ subroutine load_subcell(this, particle, subcell)
315315

316316
call pstop(1)
317317
else
318-
particle%idomain(3) = isc
318+
particle%itrdomain(3) = isc
319319
end if
320320
end if
321321
subcell%isubcell = isc

src/Solution/ParticleTracker/Method/MethodDis.f90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ subroutine load_dis(this, particle, next_level, submethod)
145145

146146
select type (cell => this%cell)
147147
type is (CellRectType)
148-
ic = particle%idomain(next_level)
148+
ic = particle%itrdomain(next_level)
149149
call this%load_celldefn(ic, cell%defn)
150150
call this%load_cell(ic, cell)
151151
if (this%fmi%ibdgwfsat0(ic) == 0) then
@@ -211,18 +211,18 @@ subroutine load_particle(this, cell, particle)
211211
! as can occur e.g. in wells. terminate
212212
! in the previous cell.
213213
if (ic == particle%icp .and. inface == 7 .and. ilay < particle%ilay) then
214-
particle%idomain(2) = particle%icp
214+
particle%itrdomain(2) = particle%icp
215215
particle%izone = particle%izp
216216
call this%terminate(particle, &
217217
status=TERM_BOUNDARY)
218218
return
219219
else
220-
particle%icp = particle%idomain(2)
220+
particle%icp = particle%itrdomain(2)
221221
particle%izp = particle%izone
222222
end if
223223

224224
! update node numbers and layer
225-
particle%idomain(2) = ic
225+
particle%itrdomain(2) = ic
226226
particle%icu = icu
227227
particle%ilay = ilay
228228

src/Solution/ParticleTracker/Method/MethodDisv.f90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ subroutine load_disv(this, particle, next_level, submethod)
8686

8787
select type (cell => this%cell)
8888
type is (CellPolyType)
89-
ic = particle%idomain(next_level)
89+
ic = particle%itrdomain(next_level)
9090
call this%load_cell_defn(ic, cell%defn)
9191
if (this%fmi%ibdgwfsat0(ic) == 0) then
9292
! Cell is active but dry, so select and initialize pass-to-bottom
@@ -175,25 +175,25 @@ subroutine load_particle(this, cell, particle)
175175
! as can occur e.g. in wells. terminate
176176
! in the previous cell.
177177
if (ic == particle%icp .and. inface == 7 .and. ilay < particle%ilay) then
178-
particle%idomain(2) = particle%icp
178+
particle%itrdomain(2) = particle%icp
179179
particle%izone = particle%izp
180180
call this%terminate(particle, &
181181
status=TERM_BOUNDARY)
182182
return
183183
else
184-
particle%icp = particle%idomain(2)
184+
particle%icp = particle%itrdomain(2)
185185
particle%izp = particle%izone
186186
end if
187187

188-
particle%idomain(2) = ic
188+
particle%itrdomain(2) = ic
189189
particle%icu = icu
190190
particle%ilay = ilay
191191

192192
z = particle%z
193193
call this%map_neighbor(cell%defn, inface, z)
194194

195195
particle%iboundary(2) = inface
196-
particle%idomain(3:) = 0
196+
particle%itrdomain(3:) = 0
197197
particle%iboundary(3:) = 0
198198
particle%z = z
199199
end select

src/Solution/ParticleTracker/Method/MethodSubcell.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ subroutine subcellexit(this, particle)
3535
allocate (SubCellExitEventType :: event)
3636
select type (event)
3737
type is (SubCellExitEventType)
38-
event%isc = particle%idomain(3)
38+
event%isc = particle%itrdomain(3)
3939
event%exit_face = particle%iboundary(3)
4040
end select
4141
call this%events%dispatch(particle, event)

src/Solution/ParticleTracker/Particle/Particle.f90

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ module ParticleModule
7070
integer(I4B), public :: istopzone !< stop zone number
7171
integer(I4B), public :: idrymeth !< dry tracking method
7272
! state
73-
integer(I4B), allocatable, public :: idomain(:) !< tracking domain hierarchy ! TODO: rename to itdomain? idomain
74-
integer(I4B), allocatable, public :: iboundary(:) !< tracking domain boundaries
73+
integer(I4B), public :: itrdomain(MAX_LEVEL) !< tracking domain indices
74+
integer(I4B), public :: iboundary(MAX_LEVEL) !< tracking domain boundary indices
7575
integer(I4B), public :: icp !< previous cell number (reduced)
7676
integer(I4B), public :: icu !< user cell number
7777
integer(I4B), public :: ilay !< grid layer
@@ -117,7 +117,7 @@ module ParticleModule
117117
integer(I4B), dimension(:), pointer, public, contiguous :: istopzone !< stop zone number
118118
integer(I4B), dimension(:), pointer, public, contiguous :: idrymeth !< stop in dry cells
119119
! state
120-
integer(I4B), dimension(:, :), pointer, public, contiguous :: idomain !< array of indices for domains in the tracking domain hierarchy
120+
integer(I4B), dimension(:, :), pointer, public, contiguous :: itrdomain !< array of indices for domains in the tracking domain hierarchy
121121
integer(I4B), dimension(:, :), pointer, public, contiguous :: iboundary !< array of indices for tracking domain boundaries
122122
integer(I4B), dimension(:), pointer, public, contiguous :: icu !< cell number (user)
123123
integer(I4B), dimension(:), pointer, public, contiguous :: ilay !< layer
@@ -150,8 +150,6 @@ subroutine create_particle(particle)
150150
type(ParticleType), pointer :: particle !< particle
151151
allocate (particle)
152152
allocate (particle%history)
153-
allocate (particle%idomain(MAX_LEVEL))
154-
allocate (particle%iboundary(MAX_LEVEL))
155153
end subroutine create_particle
156154

157155
!> @brief Allocate particle store
@@ -184,7 +182,7 @@ subroutine create_particle_store(store, np, mempath)
184182
call mem_allocate(store%extol, np, 'PLEXTOL', mempath)
185183
call mem_allocate(store%extend, np, 'PLIEXTEND', mempath)
186184
call mem_allocate(store%icycwin, np, 'PLICYCWIN', mempath)
187-
call mem_allocate(store%idomain, np, MAX_LEVEL, 'PLIDOMAIN', mempath)
185+
call mem_allocate(store%itrdomain, np, MAX_LEVEL, 'PLIDOMAIN', mempath)
188186
call mem_allocate(store%iboundary, np, MAX_LEVEL, 'PLIBOUNDARY', mempath)
189187
end subroutine create_particle_store
190188

@@ -216,16 +214,14 @@ subroutine destroy(this, mempath)
216214
call mem_deallocate(this%extol, 'PLEXTOL', mempath)
217215
call mem_deallocate(this%extend, 'PLIEXTEND', mempath)
218216
call mem_deallocate(this%icycwin, 'PLICYCWIN', mempath)
219-
call mem_deallocate(this%idomain, 'PLIDOMAIN', mempath)
217+
call mem_deallocate(this%itrdomain, 'PLIDOMAIN', mempath)
220218
call mem_deallocate(this%iboundary, 'PLIBOUNDARY', mempath)
221219
end subroutine destroy
222220

223221
!> @brief Destroy a particle after use.
224222
subroutine destroy_particle(particle)
225223
class(ParticleType), intent(inout) :: particle !< particle
226224
deallocate (particle%history)
227-
deallocate (particle%idomain)
228-
deallocate (particle%iboundary)
229225
end subroutine destroy_particle
230226

231227
!> @brief Reallocate particle storage to the given size.
@@ -259,7 +255,7 @@ subroutine resize(this, np, mempath)
259255
call mem_reallocate(this%extol, np, 'PLEXTOL', mempath)
260256
call mem_reallocate(this%extend, np, 'PLIEXTEND', mempath)
261257
call mem_reallocate(this%icycwin, np, 'PLICYCWIN', mempath)
262-
call mem_reallocate(this%idomain, np, MAX_LEVEL, 'PLIDOMAIN', mempath)
258+
call mem_reallocate(this%itrdomain, np, MAX_LEVEL, 'PLIDOMAIN', mempath)
263259
call mem_reallocate(this%iboundary, np, MAX_LEVEL, 'PLIBOUNDARY', mempath)
264260
end subroutine resize
265261

@@ -298,9 +294,9 @@ subroutine get(this, particle, imdl, iprp, ip)
298294
particle%tstop = this%tstop(ip)
299295
particle%ttrack = this%ttrack(ip)
300296
particle%advancing = .true.
301-
particle%idomain(1:MAX_LEVEL) = &
302-
this%idomain(ip, 1:MAX_LEVEL)
303-
particle%idomain(1) = imdl
297+
particle%itrdomain(1:MAX_LEVEL) = &
298+
this%itrdomain(ip, 1:MAX_LEVEL)
299+
particle%itrdomain(1) = imdl
304300
particle%iboundary(1:MAX_LEVEL) = &
305301
this%iboundary(ip, 1:MAX_LEVEL)
306302
particle%ifrctrn = this%ifrctrn(ip)
@@ -334,10 +330,10 @@ subroutine put(this, particle, ip)
334330
this%trelease(ip) = particle%trelease
335331
this%tstop(ip) = particle%tstop
336332
this%ttrack(ip) = particle%ttrack
337-
this%idomain( &
333+
this%itrdomain( &
338334
ip, &
339335
1:MAX_LEVEL) = &
340-
particle%idomain(1:MAX_LEVEL)
336+
particle%itrdomain(1:MAX_LEVEL)
341337
this%iboundary( &
342338
ip, &
343339
1:MAX_LEVEL) = &

0 commit comments

Comments
 (0)