From d5b7aec1d4f2fad74bbde41e32e1cd04a2122f87 Mon Sep 17 00:00:00 2001 From: anand43 Date: Tue, 24 Oct 2023 16:37:46 -0400 Subject: [PATCH] Fixed missing sum in rotphase --- src/swiftest/swiftest_drift.f90 | 2 +- src/swiftest/swiftest_sph.f90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/swiftest/swiftest_drift.f90 b/src/swiftest/swiftest_drift.f90 index f83bb413a..08da848af 100644 --- a/src/swiftest/swiftest_drift.f90 +++ b/src/swiftest/swiftest_drift.f90 @@ -591,7 +591,7 @@ module subroutine swiftest_drift_cb_rotphase_update(self, param, dt) class(swiftest_parameters), intent(in) :: param !! Current run configuration parameters real(DP), intent(in) :: dt !! Stepsize - self%rotphase = MOD((.mag. self%rot(:)) * dt * param%TU2S, 2 * PI) ! radians + self%rotphase = MOD(self%rotphase + (.mag. self%rot(:)) * dt * param%TU2S, 2 * PI) ! radians end subroutine swiftest_drift_cb_rotphase_update diff --git a/src/swiftest/swiftest_sph.f90 b/src/swiftest/swiftest_sph.f90 index 7fc6bb4b7..933d716e1 100644 --- a/src/swiftest/swiftest_sph.f90 +++ b/src/swiftest/swiftest_sph.f90 @@ -105,7 +105,7 @@ module subroutine swiftest_sph_g_acc_pl_all(self, nbody_system) if (pl%lmask(i)) then r_mag = .mag. rh(:,i) theta = atan2(sqrt(rh(1,i)**2 + rh(2,i)**2), rh(3,i)) - phi = atan2(rh(2,i), rh(1,i)) - cb%rotphase ! CALCULATE CB PHASE VALUE FOR PHI + phi = atan2(rh(2,i), rh(1,i)) - cb%rotphase call swiftest_sph_g_acc_one(cb%Gmass, r_mag, phi, theta, rh(:,i), cb%c_lm, g_sph, pl%Gmass(i), cb%aobl) pl%ah(:, i) = pl%ah(:, i) + g_sph(:) - cb%aobl(:)