Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions binary/private/binary_timestep.f90
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ subroutine set_star_timesteps(b) ! sets the smallest next timestep for all star
else
dt_why_str(Tlim_binary) = binary_dt_why_str(b% dt_why_reason)
end if
if (b% have_to_reduce_timestep_due_to_j) then
! lower timesteps after retries due to large changes in angular momentum
dt_min = dt_min * b% dt_reduction_factor_for_j

b% have_to_reduce_timestep_due_to_j = .false.
end if

do l = 1, num_stars
if (l == 1 .and. b% point_mass_i == 1) then
i = 2
Expand All @@ -83,16 +90,7 @@ subroutine set_star_timesteps(b) ! sets the smallest next timestep for all star
end if
end do

if (b% have_to_reduce_timestep_due_to_j) then
! lower timesteps after retries due to large changes in angular momentum
if (b% point_mass_i /= 1) then
b% s1% dt = b% s1% dt*b% dt_reduction_factor_for_j
end if
if (b% point_mass_i /= 2) then
b% s2% dt = b% s2% dt*b% dt_reduction_factor_for_j
end if
b% have_to_reduce_timestep_due_to_j = .false.
end if
b% dt = dt_min ! Set the binary dt to the minimum of the timesteps

end subroutine set_star_timesteps

Expand Down