diff --git a/src/io/io.f90 b/src/io/io.f90 index c3417f094..65a61da6a 100644 --- a/src/io/io.f90 +++ b/src/io/io.f90 @@ -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') @@ -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) @@ -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) @@ -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) diff --git a/src/main/swiftest_driver.f90 b/src/main/swiftest_driver.f90 index 3b7765347..e7b327e93 100644 --- a/src/main/swiftest_driver.f90 +++ b/src/main/swiftest_driver.f90 @@ -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 diff --git a/src/setup/setup.f90 b/src/setup/setup.f90 index 11bd69fd1..4477fd788 100644 --- a/src/setup/setup.f90 +++ b/src/setup/setup.f90 @@ -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