diff --git a/src/collision/collision_util.f90 b/src/collision/collision_util.f90 index fe1544b61..ddd8d4291 100644 --- a/src/collision/collision_util.f90 +++ b/src/collision/collision_util.f90 @@ -351,22 +351,29 @@ module subroutine collision_util_dealloc_fragments(self) class(collision_fragments), intent(inout) :: self if (allocated(self%info)) deallocate(self%info) - self%mtot = 0.0_DP - self%status = 0 - self%rh(:,:) = 0.0_DP - self%vh(:,:) = 0.0_DP - self%rb(:,:) = 0.0_DP - self%vb(:,:) = 0.0_DP - self%rot(:,:) = 0.0_DP - self%Ip(:,:) = 0.0_DP - self%mass(:) = 0.0_DP - self%radius(:) = 0.0_DP - self%density(:) = 0.0_DP - self%rc(:,:) = 0.0_DP - self%vc(:,:) = 0.0_DP - self%r_unit(:,:) = 0.0_DP - self%t_unit(:,:) = 0.0_DP - self%n_unit(:,:) = 0.0_DP + if (allocated(self%status)) deallocate(self%status) + if (allocated(self%rh)) deallocate(self%rh) + if (allocated(self%vh)) deallocate(self%vh) + if (allocated(self%rb)) deallocate(self%rb) + if (allocated(self%vb)) deallocate(self%vb) + if (allocated(self%rc)) deallocate(self%rc) + if (allocated(self%vc)) deallocate(self%vc) + if (allocated(self%r_unit)) deallocate(self%r_unit) + if (allocated(self%t_unit)) deallocate(self%t_unit) + if (allocated(self%n_unit)) deallocate(self%n_unit) + if (allocated(self%rot)) deallocate(self%rot) + if (allocated(self%Ip)) deallocate(self%Ip) + if (allocated(self%mass)) deallocate(self%mass) + if (allocated(self%radius)) deallocate(self%radius) + if (allocated(self%density)) deallocate(self%density) + if (allocated(self%rmag)) deallocate(self%rmag) + if (allocated(self%vmag)) deallocate(self%vmag) + if (allocated(self%rotmag)) deallocate(self%rotmag) + if (allocated(self%origin_body)) deallocate(self%origin_body) + if (allocated(self%L_orbit)) deallocate(self%L_orbit) + if (allocated(self%L_spin)) deallocate(self%L_spin) + if (allocated(self%ke_orbit)) deallocate(self%ke_orbit) + if (allocated(self%ke_spin)) deallocate(self%ke_spin) return end subroutine collision_util_dealloc_fragments diff --git a/src/swiftest/swiftest_driver.f90 b/src/swiftest/swiftest_driver.f90 index 9166533ec..0258ce16d 100644 --- a/src/swiftest/swiftest_driver.f90 +++ b/src/swiftest/swiftest_driver.f90 @@ -15,6 +15,7 @@ program swiftest_driver !! !! Adapted from Swifter by David E. Kaufmann's Swifter driver programs swifter_[bs,helio,ra15,rmvs,symba,tu4,whm].f90 !! Adapted from Hal Levison and Martin Duncan's Swift driver programs + use netcdf use swiftest implicit none @@ -54,7 +55,7 @@ program swiftest_driver idump = 0 ! Set up nbody_system storage for intermittent file dumps - if (dump_cadence == 0) dump_cadence = ceiling(nloops / (1.0_DP * istep_out), kind=I8B) + if (dump_cadence == 0) dump_cadence = int(ceiling(nloops / (1.0_DP * istep_out), kind=I8B), kind=I4B) ! Construct the main n-body nbody_system using the user-input integrator to choose the type of nbody_system call swiftest_util_setup_construct_system(nbody_system, param)