Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Fixed bug that was causing the discard mask to be overwritten in the …
Browse files Browse the repository at this point in the history
…middle of spilling discards
  • Loading branch information
daminton committed Jun 15, 2021
1 parent b7d25dc commit bc1acc4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/util/util_spill_and_fill.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module subroutine util_spill_body(self, discards, lspill_list)
associate(keeps => self)
discards%name(:) = pack(keeps%name(:), lspill_list(:))
discards%status(:) = pack(keeps%status(:), lspill_list(:))
discards%ldiscard(:) = pack(keeps%ldiscard(:), lspill_list(:))
discards%a(:) = pack(keeps%a(:), lspill_list(:))
discards%e(:) = pack(keeps%e(:), lspill_list(:))
discards%capom(:) = pack(keeps%capom(:), lspill_list(:))
Expand All @@ -37,7 +36,6 @@ module subroutine util_spill_body(self, discards, lspill_list)
if (count(.not.lspill_list(:)) > 0) then
keeps%name(:) = pack(keeps%name(:), .not. lspill_list(:))
keeps%status(:) = pack(keeps%status(:), .not. lspill_list(:))
keeps%ldiscard(:) = pack(keeps%ldiscard(:), .not. lspill_list(:))
keeps%a(:) = pack(keeps%a(:), .not. lspill_list(:))
keeps%e(:) = pack(keeps%e(:), .not. lspill_list(:))
keeps%inc(:) = pack(keeps%inc(:), .not. lspill_list(:))
Expand All @@ -58,6 +56,12 @@ module subroutine util_spill_body(self, discards, lspill_list)
! Therefore we need to set the nbody values for both the keeps and discareds
discards%nbody = count(lspill_list(:))
keeps%nbody = count(.not.lspill_list(:))
if (allocated(keeps%ldiscard)) deallocate(keeps%ldiscard)
if (allocated(discards%ldiscard)) deallocate(discards%ldiscard)
allocate(keeps%ldiscard(keeps%nbody))
allocate(discards%ldiscard(discards%nbody))
keeps%ldiscard = .false.
discards%ldiscard = .true.

end associate

Expand Down

0 comments on commit bc1acc4

Please sign in to comment.