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

Commit

Permalink
Refactored to enforce line limit
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Feb 27, 2024
1 parent 8171caa commit c7b9585
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/base/base_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ module base

! The following are not set by the user, but instead are determined by the input value of INTERACTION_LOOPS
logical :: lflatten_interactions = .false. !! Use the flattened upper triangular matrix for pl-pl interaction loops
logical :: lencounter_sas_plpl = .false. !! Use the Sort and Sweep algorithm to prune the encounter list before checking
logical :: lencounter_sas_plpl = .false. !! Use the Sort and Sweep algorithm to prune the encounter list before checking
!! for close encounters
logical :: lencounter_sas_pltp = .false. !! Use the Sort and Sweep algorithm to prune the encounter list before checking
logical :: lencounter_sas_pltp = .false. !! Use the Sort and Sweep algorithm to prune the encounter list before checking
!! for close encounters

! Logical flags to turn on or off various features of the code
Expand All @@ -95,7 +95,7 @@ module base
logical :: lbig_discard = .false. !! Save big bodies on every discard
logical :: lclose = .false. !! Turn on close encounters
logical :: lenergy = .false. !! Track the total energy of the system
logical :: loblatecb = .false. !! Calculate acceleration from oblate central body (automatically turns true if nonzero J2
logical :: loblatecb = .false. !! Calculate acceleration from oblate central body (automatically turns true if nonzero J2
!! is input)
logical :: lrotation = .false. !! Include rotation states of big bodies
logical :: ltides = .false. !! Include tidal dissipation
Expand All @@ -118,7 +118,7 @@ module base
logical :: lrestart = .false. !! Indicates whether or not this is a restarted run

character(NAMELEN) :: display_style !! Style of the output display {["STANDARD"], "COMPACT"}).
integer(I4B) :: display_unit = OUTPUT_UNIT !! File unit number for display (either to stdout or to a log file)
integer(I4B) :: display_unit = OUTPUT_UNIT !! File unit number for display (either to stdout or to a log file)
logical :: log_output = .false. !! Logs the output to file instead of displaying it on the terminal

! Future features not implemented or in development
Expand Down Expand Up @@ -2113,7 +2113,7 @@ subroutine base_util_unique_DP(input_array, output_array, index_map)
real(DP), dimension(:), allocatable, intent(out) :: output_array !! Sorted array of unique values
integer(I4B), dimension(:), allocatable, intent(out) :: index_map !! An array of the same size as input_array that such
!! that any for any index i,
!! output_array(index_map(i)) = input_array(i)
!! output_array(index_map(i)) = input_array(i)
! Internals
real(DP), dimension(:), allocatable :: unique_array
integer(I4B) :: n
Expand Down
12 changes: 8 additions & 4 deletions src/rmvs/rmvs_step.f90
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@ subroutine rmvs_step_out(cb, pl, tp, nbody_system, param, t, dt)
tp%lfirst = lfirsttp
else
if (param%loblatecb) then
call swiftest_obl_acc(npl, cb%Gmass, cb%j2rp2, cb%j4rp4, pl%rbeg, pl%lmask, pl%outer(outer_index-1)%aobl, cb%rot, pl%Gmass, cb%aoblbeg)
call swiftest_obl_acc(npl, cb%Gmass, cb%j2rp2, cb%j4rp4, pl%rend, pl%lmask, pl%outer(outer_index)%aobl, cb%rot, pl%Gmass, cb%aoblend)
call swiftest_obl_acc(npl, cb%Gmass, cb%j2rp2, cb%j4rp4, pl%rbeg, pl%lmask, pl%outer(outer_index-1)%aobl, cb%rot,&
pl%Gmass, cb%aoblbeg)
call swiftest_obl_acc(npl, cb%Gmass, cb%j2rp2, cb%j4rp4, pl%rend, pl%lmask, pl%outer(outer_index)%aobl, cb%rot, &
pl%Gmass, cb%aoblend)
end if
call tp%step(nbody_system, param, outer_time, dto)
end if
Expand Down Expand Up @@ -268,7 +270,8 @@ subroutine rmvs_interp_in(cb, pl, nbody_system, param, dt, outer_index)
if ((param%loblatecb) .or. (param%ltides)) then
allocate(rh_original, source=pl%rh)
allocate(ah_original, source=pl%ah)
pl%rh(:, 1:npl) = xtmp(:, 1:npl) ! Temporarily replace heliocentric position with inner substep values to calculate the oblateness terms
pl%rh(:, 1:npl) = xtmp(:, 1:npl) ! Temporarily replace heliocentric position with inner substep values to calculate the
! oblateness terms
end if
if (param%loblatecb) then
call pl%accel_obl(nbody_system)
Expand Down Expand Up @@ -396,7 +399,8 @@ subroutine rmvs_step_in(cb, pl, tp, param, outer_time, dto)
call rmvs_peri_tp(tpenci, pl, inner_time, dti, .true., 0, i, param)
! now step the encountering test particles fully through the inner encounter
lfirsttp = .true.
do inner_index = 1, NTPHENC ! Integrate over the encounter region, using the "substitute" planetocentric systems at each level
do inner_index = 1, NTPHENC ! Integrate over the encounter region, using the "substitute" planetocentric
! systems at each level
plenci%rh(:, 1:npl) = plenci%inner(inner_index - 1)%x(:, 1:npl)
call plenci%set_beg_end(rbeg = plenci%inner(inner_index - 1)%x, &
rend = plenci%inner(inner_index)%x)
Expand Down
1 change: 0 additions & 1 deletion swiftest/init_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def get_rotpole(jpl):
RA = jpl.ephemerides()['NPole_RA'][0]
DEC = jpl.ephemerides()['NPole_DEC'][0]


if np.ma.is_masked(RA) or np.ma.is_masked(DEC):
return np.array([0.0,0.0,1.0])

Expand Down

0 comments on commit c7b9585

Please sign in to comment.