Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
testing overflow error
Browse files Browse the repository at this point in the history
  • Loading branch information
anand43 committed Nov 27, 2023
1 parent d7ed97e commit b1417b1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/swiftest/swiftest_drift.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b1417b1

Please sign in to comment.