From fc24530518c7814fb4273c14fe2343ca0ea4a80f Mon Sep 17 00:00:00 2001 From: David A Minton Date: Tue, 24 Aug 2021 01:02:55 -0400 Subject: [PATCH] Deallocate all of the orbital element vectors after conversion to prevent array range problems later. --- src/orbel/orbel.f90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/orbel/orbel.f90 b/src/orbel/orbel.f90 index 0a93ec599..f01c97529 100644 --- a/src/orbel/orbel.f90 +++ b/src/orbel/orbel.f90 @@ -5,7 +5,8 @@ module subroutine orbel_el2xv_vec(self, cb) !! author: David A. Minton !! - !! A wrapper method that converts all of the cartesian position and velocity vectors of a Swiftest body object to orbital elements. + !! A wrapper method that converts all of the orbital element vectors into cartesian position and velocity vectors for a Swiftest body object. + !! This method deallocates all of the orbital elements after it is finished. implicit none ! Arguments class(swiftest_body), intent(inout) :: self !! Swiftest body object @@ -20,6 +21,8 @@ module subroutine orbel_el2xv_vec(self, cb) call orbel_el2xv(self%mu(i), self%a(i), self%e(i), self%inc(i), self%capom(i), & self%omega(i), self%capm(i), self%xh(:, i), self%vh(:, i)) end do + deallocate(self%a, self%e, self%inc, self%capom, self%omega, self%capm) + return end subroutine orbel_el2xv_vec