Skip to content

Commit 25e1bed

Browse files
committed
pull get_iatop routine into base Method
1 parent 4747def commit 25e1bed

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

src/Solution/ParticleTracker/Method.f90

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -180,21 +180,12 @@ subroutine update(this, particle, celldefn)
180180

181181
end subroutine update
182182

183-
!> @brief Get the index used to locate top elevation of a cell in the grid.
184-
!! This is -1 if the cell is in the top layer and 1 otherwise. (kluge?)
185-
function get_iatop(dis, ic) result(iatop)
183+
!> @brief Get the index corresponding to top elevation of a cell in the grid.
184+
!! This is -1 if the cell is in the top layer and 1 otherwise.
185+
function get_iatop(ncpl, icu) result(iatop)
186186
use BaseDisModule, only: DisBaseType
187-
implicit none
188-
! -- dummy
189-
class(DisBaseType), intent(in) :: dis
190-
integer, intent(in) :: ic
191-
! -- result
187+
integer, intent(in) :: ncpl, icu
192188
integer :: iatop
193-
! -- local
194-
integer :: ncpl, icu
195-
!
196-
ncpl = dis%get_ncpl()
197-
icu = dis%get_nodeuser(ic)
198189
!
199190
if (icu .le. ncpl) then
200191
iatop = -1

src/Solution/ParticleTracker/MethodDis.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ subroutine load_cellDefn_basic(this, ic, cellDefn)
327327
cellDefn%npolyverts = 4 ! rectangular cell always has 4 vertices
328328
!
329329
! -- iatop, top, and bot
330-
iatop = get_iatop(this%fmi%dis, ic)
330+
iatop = get_iatop(this%fmi%dis%get_ncpl(), &
331+
this%fmi%dis%get_nodeuser(ic))
331332
cellDefn%iatop = iatop
332333
top = this%fmi%dis%top(ic)
333334
bot = this%fmi%dis%bot(ic)

src/Solution/ParticleTracker/MethodDisv.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@ subroutine load_cellDefn_basic(this, ic, cellDefn)
377377
cellDefn%npolyverts = this%get_npolyverts(ic)
378378
!
379379
! -- iatop, top, and bot
380-
iatop = get_iatop(this%fmi%dis, ic)
380+
iatop = get_iatop(this%fmi%dis%get_ncpl(), &
381+
this%fmi%dis%get_nodeuser(ic))
381382
cellDefn%iatop = iatop
382383
top = this%fmi%dis%top(ic)
383384
bot = this%fmi%dis%bot(ic)

0 commit comments

Comments
 (0)