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

Commit

Permalink
Fixed output cadence variable bug
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Dec 1, 2022
1 parent 864b02d commit 5827b34
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
20 changes: 20 additions & 0 deletions src/io/io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,26 @@ module subroutine io_dump_system(self, param)
return
end subroutine io_dump_system

module subroutine io_dump_system_storage(self, param)
!! author: David A. Minton
!!
!! Dumps the time history of the simulation to file
implicit none
! Arguments
class(swiftest_storage(*)), intent(inout) :: self !! Swiftest simulation history storage object
class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters
! Internals
integer(I8B) :: i, iloop_start

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)
end do

return
end subroutine io_dump_system_storage


module subroutine io_get_args(integrator, param_file_name, display_style)
!! author: David A. Minton
Expand Down
5 changes: 1 addition & 4 deletions src/main/swiftest_driver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,7 @@ program swiftest_driver

if (idump == 0) then
call nbody_system%dump(param)
do iframe = 1_I8B, dump_cadence
ioutput = int((iloop - dump_cadence - 1_I8B + iframe) / istep_out, kind=I8B)
call system_history%frame(iframe)%system%write_frame(param)
end do
call system_history%dump(param)
idump = dump_cadence
end if

Expand Down
8 changes: 8 additions & 0 deletions src/modules/swiftest_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ module swiftest_classes
!! A class that that is used to store simulation history data between file output
type(storage_frame), dimension(nframes) :: frame
contains
procedure :: dump => io_dump_system_storage
end type swiftest_storage

abstract interface
Expand Down Expand Up @@ -624,6 +625,13 @@ module subroutine io_dump_system(self, param)
class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters
end subroutine io_dump_system


module subroutine io_dump_system_storage(self, param)
implicit none
class(swiftest_storage(*)), intent(inout) :: self !! Swiftest simulation history storage object
class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters
end subroutine io_dump_system_storage

module subroutine io_get_args(integrator, param_file_name, display_style)
implicit none
character(len=:), allocatable, intent(inout) :: integrator !! Symbolic code of the requested integrator
Expand Down

0 comments on commit 5827b34

Please sign in to comment.