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

Commit

Permalink
Fixed issue that was preventing discard information from being writte…
Browse files Browse the repository at this point in the history
…n to NetCDF
  • Loading branch information
daminton committed Jan 3, 2023
1 parent 2edaf59 commit ec4d44b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/swiftest/swiftest_discard.f90
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module subroutine swiftest_discard_system(self, param)
lpl_check = allocated(self%pl_discards)
ltp_check = allocated(self%tp_discards)

associate(nbody_system => self, tp => self%tp, pl => self%pl, tp_discards => self%tp_discards, pl_discards => self%pl_discards)
associate(nbody_system => self, tp => self%tp, pl => self%pl, tp_discards => self%tp_discards, pl_discards => self%pl_discards, nc => param%system_history%nc)
lpl_discards = .false.
ltp_discards = .false.
if (lpl_check) then
Expand All @@ -37,9 +37,11 @@ module subroutine swiftest_discard_system(self, param)
call tp%discard(nbody_system, param)
ltp_discards = (tp_discards%nbody > 0)
end if
call nc%open(param)
if (ltp_discards) call tp_discards%write_info(param%system_history%nc, param)
if (lpl_discards) call pl_discards%write_info(param%system_history%nc, param)
if (lpl_discards .and. param%lenergy) call self%conservation_report(param, lterminal=.false.)
call nc%close()
if (lpl_check) call pl_discards%setup(0,param)
if (ltp_check) call tp_discards%setup(0,param)

Expand Down

0 comments on commit ec4d44b

Please sign in to comment.