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

Commit

Permalink
Temporarily enabled reading from the binary dump files even in NetCDF…
Browse files Browse the repository at this point in the history
… mode in order to be able to restart, until writing/reading NetCDF dump files is enabled.
  • Loading branch information
daminton committed Aug 29, 2021
1 parent d2c9d4d commit c22a1a7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
13 changes: 11 additions & 2 deletions src/io/io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ module subroutine io_dump_particle_info_base(self, param, idx)
integer(I4B) :: i
character(STRMAX) :: errmsg

if ((param%out_type == REAL4_TYPE) .or. (param%out_type == REAL8_TYPE)) then
!if ((param%out_type == REAL4_TYPE) .or. (param%out_type == REAL8_TYPE)) then
if (lfirst) then
select case(param%out_stat)
case('APPEND')
Expand Down Expand Up @@ -190,7 +190,8 @@ module subroutine io_dump_particle_info_base(self, param, idx)
end select

close(unit = LUN, err = 667, iomsg = errmsg)
else if ((param%out_type == NETCDF_FLOAT_TYPE) .or. (param%out_type == NETCDF_DOUBLE_TYPE)) then
!else if ((param%out_type == NETCDF_FLOAT_TYPE) .or. (param%out_type == NETCDF_DOUBLE_TYPE)) then
if ((param%out_type == NETCDF_FLOAT_TYPE) .or. (param%out_type == NETCDF_DOUBLE_TYPE)) then
call param%nciu%open(param)
call self%write_particle_info(param%nciu)
call param%nciu%close(param)
Expand Down Expand Up @@ -1851,6 +1852,7 @@ module subroutine io_write_frame_system(self, param)
end if
call self%write_hdr(iu, param)
else if ((param%out_type == NETCDF_FLOAT_TYPE) .or. (param%out_type == NETCDF_DOUBLE_TYPE)) then

if (lfirst) then
inquire(file=param%outfile, exist=fileExists)

Expand All @@ -1872,6 +1874,13 @@ module subroutine io_write_frame_system(self, param)
end if
end select

select type(param)
class is (symba_parameters)
param%nciu%ltrack_origin = param%lfragmentation
class default
param%nciu%ltrack_origin = .false.
end select

select case(param%out_stat)
case('APPEND')
call param%nciu%open(param)
Expand Down
2 changes: 1 addition & 1 deletion src/main/swiftest_driver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ program swiftest_driver
nloops = ceiling(tstop / dt, kind=I8B)
ioutput = ceiling(t0/ dt, kind=I8B) / int(istep_out, kind=I8B)
! Prevent duplicate frames from being written if this is a restarted run
if (param%lrestart) then
if ((param%lrestart) .and. ((param%out_type == REAL8_TYPE) .or. param%out_type == REAL4_TYPE)) then
old_t_final = nbody_system%get_old_t_final(param)
else
old_t_final = t0
Expand Down
15 changes: 1 addition & 14 deletions src/setup/setup.f90
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,8 @@ module subroutine setup_initialize_particle_info_system(self, param)
integer(I4B) :: i

associate(cb => self%cb, pl => self%pl, npl => self%pl%nbody, tp => self%tp, ntp => self%tp%nbody)
select type(param)
class is (symba_parameters)
param%nciu%ltrack_origin = param%lfragmentation
class default
param%nciu%ltrack_origin = .false.
end select

select type(param)
class is (symba_parameters)
ltrack_origin = param%lfragmentation
class default
ltrack_origin = .false.
end select

if (ltrack_origin) then
if (param%nciu%ltrack_origin) then
cb%info%origin_type = "Initial conditions"
cb%info%origin_time = param%t0
cb%info%origin_xh(:) = 0.0_DP
Expand Down

0 comments on commit c22a1a7

Please sign in to comment.