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

Commit

Permalink
Simplified swiftest_driver even further. No need to explicitly call t…
Browse files Browse the repository at this point in the history
…he dealloc method on the nbody_system, all possible types have finalizers built in that do that automatically
  • Loading branch information
daminton committed Dec 1, 2022
1 parent 74e5fde commit 561c0b8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/io/io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,10 @@ module subroutine io_dump_system_storage(self, param)
iloop_start = param%iloop - param%istep_out * param%dump_cadence + 1_I8B
do i = 1_I8B, param%dump_cadence
param%ioutput = int(iloop_start / param%istep_out, kind=I8B) + i
call self%frame(i)%system%write_frame(param)
if (allocated(self%frame(i)%system)) then
call self%frame(i)%system%write_frame(param)
deallocate(self%frame(i)%system)
end if
end do

return
Expand Down
6 changes: 2 additions & 4 deletions src/main/swiftest_driver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,10 @@ program swiftest_driver
end if

end do
! Dump any remaining history if it exists
call system_history%dump(param)
if (display_style == "COMPACT") write(*,*) "SWIFTEST STOP" // trim(adjustl(param%integrator))
end associate

call nbody_system%dealloc()

call util_exit(SUCCESS)

stop
end program swiftest_driver
2 changes: 2 additions & 0 deletions src/symba/symba_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ module subroutine symba_util_final_pl(self)
return
end subroutine symba_util_final_pl


module subroutine symba_util_final_system(self)
!! author: David A. Minton
!!
Expand All @@ -495,6 +496,7 @@ module subroutine symba_util_final_system(self)
return
end subroutine symba_util_final_system


module subroutine symba_util_final_tp(self)
!! author: David A. Minton
!!
Expand Down

0 comments on commit 561c0b8

Please sign in to comment.