From b1417b115d768078107d748c35413682ec9940ce Mon Sep 17 00:00:00 2001 From: anand43 Date: Mon, 27 Nov 2023 11:08:34 -0500 Subject: [PATCH] testing overflow error --- src/swiftest/swiftest_drift.f90 | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/swiftest/swiftest_drift.f90 b/src/swiftest/swiftest_drift.f90 index 08da848af..fe315fc74 100644 --- a/src/swiftest/swiftest_drift.f90 +++ b/src/swiftest/swiftest_drift.f90 @@ -460,6 +460,12 @@ pure subroutine swiftest_drift_kepu_new(s, dt, r0, mu, alpha, u, fp, c1, c2, c3, do nc = 0, 6 x = s*s*alpha + + ! for debugging overflow error + if (abs(x) .ge. HUGE(0.0_DP)) then + write(*,*) "big x" + end if + call swiftest_drift_kepu_stumpff(x, c0, c1, c2, c3) c1 = c1*s c2 = c2*s*s @@ -553,6 +559,28 @@ pure subroutine swiftest_drift_kepu_stumpff(x, c0, c1, c2, c3) integer(I4B) :: i, n real(DP) :: xm + + ! for debugging Floating overflow error + if (abs(x) .ge. HUGE(0.0_DP)) then + write(*,*) "big x" + end if + + if (abs(c0) .ge. HUGE(0.0_DP)) then + write(*,*) "big c0" + end if + + if (abs(c1) .ge. HUGE(0.0_DP)) then + write(*,*) "big c1" + end if + + if (abs(c2) .ge. HUGE(0.0_DP)) then + write(*,*) "big c2" + end if + + if (abs(c3) .ge. HUGE(0.0_DP)) then + write(*,*) "big c3" + end if + n = 0 xm = 0.1_DP do while (abs(x) >= xm)