From c7b95856191dd704f0def2ac77dffb9184417926 Mon Sep 17 00:00:00 2001 From: David Minton Date: Tue, 27 Feb 2024 08:17:11 -0500 Subject: [PATCH] Refactored to enforce line limit --- src/base/base_module.f90 | 10 +++++----- src/rmvs/rmvs_step.f90 | 12 ++++++++---- swiftest/init_cond.py | 1 - 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/base/base_module.f90 b/src/base/base_module.f90 index 9cff4cff5..8be20f9d3 100644 --- a/src/base/base_module.f90 +++ b/src/base/base_module.f90 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/src/rmvs/rmvs_step.f90 b/src/rmvs/rmvs_step.f90 index f7d1a87bf..04fadb74b 100644 --- a/src/rmvs/rmvs_step.f90 +++ b/src/rmvs/rmvs_step.f90 @@ -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 @@ -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) @@ -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) diff --git a/swiftest/init_cond.py b/swiftest/init_cond.py index 0c57ddecf..a8770328a 100644 --- a/swiftest/init_cond.py +++ b/swiftest/init_cond.py @@ -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])