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

Commit

Permalink
More tweaks to ensure repeatability on restart
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Jan 25, 2023
1 parent f68f01a commit 214e7ba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helio/helio_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ module subroutine helio_util_setup_initialize_system(self, param)
class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters

call swiftest_util_setup_initialize_system(self, param)
call self%pl%h2b(self%cb)
call self%tp%h2b(self%cb)
call self%pl%sort("mass", ascending=.false.)
call self%pl%vh2vb(self%cb)
call self%tp%h2b(self%cb)

! Make sure that the discard list gets allocated initially
call self%tp_discards%setup(0, param)
Expand Down
16 changes: 16 additions & 0 deletions src/swiftest/swiftest_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3038,6 +3038,22 @@ module subroutine swiftest_util_snapshot_system(self, param, nbody_system, t, ar
! Internals
class(swiftest_nbody_system), allocatable :: snapshot

! To allow for runs to be restarted in a bit-identical way, we'll need to run the same coordinate conversion routines we would run upon restarting
select type(pl => nbody_system%pl)
class is (whm_pl)
call pl%h2j(nbody_system%cb)
class is (helio_pl)
call pl%vh2vb(nbody_system%cb)
end select

select type(tp => nbody_system%tp)
class is (helio_tp)
select type(cb => nbody_system%cb)
class is (helio_cb)
call tp%vh2vb(vbcb = -cb%ptbeg)
end select
end select

! Take a minimal snapshot wihout all of the extra storage objects
allocate(snapshot, mold=nbody_system)
allocate(snapshot%cb, source=nbody_system%cb )
Expand Down

0 comments on commit 214e7ba

Please sign in to comment.