diff --git a/src/swiftest/swiftest_obl.f90 b/src/swiftest/swiftest_obl.f90 index fd0260fc4..273a97c5e 100644 --- a/src/swiftest/swiftest_obl.f90 +++ b/src/swiftest/swiftest_obl.f90 @@ -221,7 +221,7 @@ module subroutine swiftest_obl_acc_pl(self, nbody_system) associate(pl => self, cb => nbody_system%cb) npl = self%nbody - call swiftest_obl_acc(npl, cb%Gmass, cb%j2rp2, cb%j4rp4, pl%rh, pl%lmask, pl%aobl, pl%Gmass, cb%aobl) + call swiftest_obl_acc(npl, cb%Gmass, cb%j2rp2, cb%j4rp4, pl%rh, pl%lmask, pl%aobl, cb%rot, pl%Gmass, cb%aobl) #ifdef DOCONLOC do concurrent(i = 1:npl, pl%lmask(i)) shared(cb,pl) diff --git a/src/swiftest/swiftest_sph.f90 b/src/swiftest/swiftest_sph.f90 index 933d716e1..a981d099c 100644 --- a/src/swiftest/swiftest_sph.f90 +++ b/src/swiftest/swiftest_sph.f90 @@ -48,7 +48,12 @@ module subroutine swiftest_sph_g_acc_one(GMcb, r_0, phi, theta, rh, c_lm, g_sph, l_max = size(c_lm, 2) - 1 N = (l_max + 1) * (l_max + 2) / 2 allocate(p(N),p_deriv(N)) - call PlmON_d1(p, p_deriv, l_max, cos(theta)) ! Orthonormalized Associated Legendre Polynomials and the 1st Derivative + + if(cos(theta) > epsilon(0.0_DP)) then + call PlmON_d1(p, p_deriv, l_max, cos(theta)) ! Orthonormalized Associated Legendre Polynomials and the 1st Derivative + else + call PlmON_d1(p, p_deriv, l_max, 0.0_DP) + end if do l = 1, l_max ! skipping the l = 0 term; It is the spherical body term do m = 0, l