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

Commit

Permalink
Merge branch 'coarray_test_particles' into debug
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed May 13, 2023
2 parents 8b1acfb + 4a4440c commit 6f724c1
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions src/swiftest/swiftest_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -414,42 +414,34 @@ module subroutine swiftest_io_dump_storage(self, param)
class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters
! Internals
integer(I4B) :: i
type(walltimer) :: iotimer

if (self%iframe == 0) return
call self%make_index_map()
associate(nc => self%nc)
#ifdef COARRAY
critical
sync all
if (param%lcoarray .and. (this_image() /= 1)) sync images(this_image() - 1)
write(param%display_unit,*) "File output started"
call iotimer%start()
#endif
call nc%open(param)
#ifdef COARRAY
end critical
#endif
do i = 1, self%iframe
! Writing files is more efficient if we write out the common frames from each image before going to the next frame
#ifdef COARRAY
if (param%lcoarray .and. (this_image() /= 1)) sync images(this_image() - 1)
#endif
if (allocated(self%frame(i)%item)) then
select type(nbody_system => self%frame(i)%item)
class is (swiftest_nbody_system)
call nbody_system%write_frame(nc, param)
end select
deallocate(self%frame(i)%item)
end if
#ifdef COARRAY
if (param%lcoarray .and. (this_image() < num_images())) sync images(this_image() + 1)
sync all
#endif
end do
#ifdef COARRAY
if (this_image() == 1) then
#endif
call nc%close()
#ifdef COARRAY
else
nc%lfile_is_open = .false.
end if
call nc%close()
#ifdef COARRAY
if (param%lcoarray .and. (this_image() < num_images())) sync images(this_image() + 1)
call iotimer%stop()
call iotimer%report(message="File output :", unit=param%display_unit)
sync all
#endif
end associate

Expand Down

0 comments on commit 6f724c1

Please sign in to comment.