Skip to content

Commit

Permalink
fix(xt3d): iallpc getting adding twice to memory manager (MODFLOW-USG…
Browse files Browse the repository at this point in the history
…S#2035)

* warning message showing iallpc getting added multiple times to hashtable
* fix by using mem_reallocate instead of mem_deallocate/mem_allocate for the second call
  • Loading branch information
langevin-usgs authored Oct 11, 2024
1 parent dc0895a commit b5a9ca2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Model/ModelUtilities/Xt3dInterface.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ end subroutine allocate_arrays
!> @brief Allocate and populate iallpc array. Set lamatsaved.
subroutine xt3d_iallpc(this)
! -- modules
use MemoryManagerModule, only: mem_allocate, mem_deallocate
use MemoryManagerModule, only: mem_allocate, mem_reallocate
! -- dummy
class(Xt3dType) :: this
! -- local
Expand Down Expand Up @@ -1212,8 +1212,9 @@ subroutine xt3d_iallpc(this)
end if
!
if (.not. this%lamatsaved) then
call mem_deallocate(this%iallpc)
call mem_allocate(this%iallpc, 0, 'IALLPC', this%memoryPath)
! there are no permanently confined connections so deallocate iallpc
! in order to save memory
call mem_reallocate(this%iallpc, 0, 'IALLPC', this%memoryPath)
end if
!
! -- Return
Expand Down

0 comments on commit b5a9ca2

Please sign in to comment.