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

Commit

Permalink
Cleaned up formatting and restyled for consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Jul 29, 2021
1 parent e32e3d6 commit 0d8ad93
Show file tree
Hide file tree
Showing 45 changed files with 519 additions and 280 deletions.

Large diffs are not rendered by default.

15 changes: 12 additions & 3 deletions src/discard/discard.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
submodule (swiftest_classes) s_discard
use swiftest
contains

module subroutine discard_system(self, param)
!! author: David A. Minton
!!
Expand All @@ -15,9 +16,11 @@ module subroutine discard_system(self, param)
call pl%discard(system, param)
if (any(tp%ldiscard(:) .or. any(pl%ldiscard(:)))) call system%write_discard(param)
end associate

return
end subroutine discard_system


module subroutine discard_pl(self, system, param)
!! author: David A. Minton
!!
Expand All @@ -29,9 +32,11 @@ module subroutine discard_pl(self, system, param)
class(swiftest_nbody_system), intent(inout) :: system !! Swiftest nbody system object
class(swiftest_parameters), intent(in) :: param !! Current run configuration parameter
self%ldiscard(:) = .false.

return
end subroutine discard_pl


module subroutine discard_tp(self, system, param)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -59,9 +64,11 @@ module subroutine discard_tp(self, system, param)
if (param%lclose .and. ntp > 0) call discard_pl_tp(tp, system, param)
if (any(tp%ldiscard)) call tp%spill(system%tp_discards, tp%ldiscard)
end associate

return
end subroutine discard_tp


subroutine discard_sun_tp(tp, system, param)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -111,6 +118,7 @@ subroutine discard_sun_tp(tp, system, param)
return
end subroutine discard_sun_tp


subroutine discard_peri_tp(tp, system, param)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -153,10 +161,11 @@ subroutine discard_peri_tp(tp, system, param)
end if
end do
end associate

return

end subroutine discard_peri_tp


subroutine discard_pl_tp(tp, system, param)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -192,11 +201,11 @@ subroutine discard_pl_tp(tp, system, param)
end do
end if
end do

end associate

return

end subroutine discard_pl_tp


subroutine discard_pl_close(dx, dv, dt, r2crit, iflag, r2min)
!! author: David A. Minton
Expand Down
12 changes: 12 additions & 0 deletions src/drift/drift.f90
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module subroutine drift_body(self, system, param, dt, mask)
return
end subroutine drift_body


module pure subroutine drift_all(mu, x, v, n, param, dt, mask, iflag)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -84,6 +85,7 @@ module pure subroutine drift_all(mu, x, v, n, param, dt, mask, iflag)
return
end subroutine drift_all


module pure elemental subroutine drift_one(mu, px, py, pz, vx, vy, vz, dt, iflag)
!! author: The Purdue Swiftest Team - David A. Minton, Carlisle A. Wishard, Jennifer L.L. Pouplin, and Jacob R. Elliott
!!
Expand Down Expand Up @@ -119,6 +121,7 @@ module pure elemental subroutine drift_one(mu, px, py, pz, vx, vy, vz, dt, iflag
return
end subroutine drift_one


pure subroutine drift_dan(mu, x0, v0, dt0, iflag)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -185,9 +188,11 @@ pure subroutine drift_dan(mu, x0, v0, dt0, iflag)
x0(:) = x(:)
v0(:) = v(:)
end if

return
end subroutine drift_dan


pure subroutine drift_kepmd(dm, es, ec, x, s, c)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -226,6 +231,7 @@ pure subroutine drift_kepmd(dm, es, ec, x, s, c)
return
end subroutine drift_kepmd


pure subroutine drift_kepu(dt,r0,mu,alpha,u,fp,c1,c2,c3,iflag)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -253,6 +259,7 @@ pure subroutine drift_kepu(dt,r0,mu,alpha,u,fp,c1,c2,c3,iflag)
return
end subroutine drift_kepu


pure subroutine drift_kepu_fchk(dt, r0, mu, alpha, u, s, f)
!! author: David A. Minton
!!
Expand All @@ -275,6 +282,7 @@ pure subroutine drift_kepu_fchk(dt, r0, mu, alpha, u, s, f)
return
end subroutine drift_kepu_fchk


pure subroutine drift_kepu_guess(dt, r0, mu, alpha, u, s)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -312,6 +320,7 @@ pure subroutine drift_kepu_guess(dt, r0, mu, alpha, u, s)
return
end subroutine drift_kepu_guess


pure subroutine drift_kepu_lag(s, dt, r0, mu, alpha, u, fp, c1, c2, c3, iflag)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -356,6 +365,7 @@ pure subroutine drift_kepu_lag(s, dt, r0, mu, alpha, u, fp, c1, c2, c3, iflag)
return
end subroutine drift_kepu_lag


pure subroutine drift_kepu_new(s, dt, r0, mu, alpha, u, fp, c1, c2, c3, iflag)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -397,6 +407,7 @@ pure subroutine drift_kepu_new(s, dt, r0, mu, alpha, u, fp, c1, c2, c3, iflag)
return
end subroutine drift_kepu_new


pure subroutine drift_kepu_p3solve(dt, r0, mu, alpha, u, s, iflag)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -439,6 +450,7 @@ pure subroutine drift_kepu_p3solve(dt, r0, mu, alpha, u, s, iflag)

return
end subroutine drift_kepu_p3solve


pure subroutine drift_kepu_stumpff(x, c0, c1, c2, c3)
!! author: David A. Minton
Expand Down
3 changes: 2 additions & 1 deletion src/eucl/eucl.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
submodule (swiftest_classes) s_eucl
use swiftest
contains

module subroutine eucl_dist_index_plpl(self)
!! author: Jacob R. Elliott and David A. Minton
!!
Expand Down Expand Up @@ -30,8 +31,8 @@ module subroutine eucl_dist_index_plpl(self)
end do
end do
end associate
return

return
end subroutine eucl_dist_index_plpl

end submodule s_eucl
12 changes: 9 additions & 3 deletions src/gr/gr.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
submodule(swiftest_classes) s_gr
use swiftest
contains

module pure subroutine gr_kick_getaccb_ns_body(self, system, param)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -36,13 +37,12 @@ module pure subroutine gr_kick_getaccb_ns_body(self, system, param)
cb%agr(i) = -sum(self%Gmass(1:n) * self%agr(1:n, i) / cb%Gmass)
end do
end select

end associate

return

end subroutine gr_kick_getaccb_ns_body


module pure subroutine gr_p4_pos_kick(param, x, v, dt)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -71,6 +71,7 @@ module pure subroutine gr_p4_pos_kick(param, x, v, dt)
return
end subroutine gr_p4_pos_kick


module pure subroutine gr_pseudovel2vel(param, mu, xh, pv, vh)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -98,9 +99,11 @@ module pure subroutine gr_pseudovel2vel(param, mu, xh, pv, vh)
grterm = 1.0_DP - inv_c2 * (0.5_DP * vmag2 + 3 * mu / rmag)
vh(:) = pv(:) * grterm
end associate

return
end subroutine gr_pseudovel2vel


module pure subroutine gr_pv2vh_body(self, param)
!! author: David A. Minton
!!
Expand All @@ -121,9 +124,11 @@ module pure subroutine gr_pv2vh_body(self, param)
end do
call move_alloc(vh, self%vh)
end associate

return
end subroutine gr_pv2vh_body


module pure subroutine gr_vel2pseudovel(param, mu, xh, vh, pv)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -200,6 +205,7 @@ module pure subroutine gr_vel2pseudovel(param, mu, xh, vh, pv)
return
end subroutine gr_vel2pseudovel


module pure subroutine gr_vh2pv_body(self, param)
!! author: David A. Minton
!!
Expand All @@ -220,8 +226,8 @@ module pure subroutine gr_vh2pv_body(self, param)
end do
call move_alloc(pv, self%vh)
end associate

return
end subroutine gr_vh2pv_body


end submodule s_gr
5 changes: 5 additions & 0 deletions src/helio/helio_coord.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
submodule (helio_classes) s_helio_coord
use swiftest
contains

module subroutine helio_coord_vb2vh_pl(self, cb)
!! author: David A. Minton
!!
Expand All @@ -26,6 +27,7 @@ module subroutine helio_coord_vb2vh_pl(self, cb)
return
end subroutine helio_coord_vb2vh_pl


module subroutine helio_coord_vb2vh_tp(self, vbcb)
!! author: David A. Minton
!!
Expand All @@ -49,6 +51,7 @@ module subroutine helio_coord_vb2vh_tp(self, vbcb)
return
end subroutine helio_coord_vb2vh_tp


module subroutine helio_coord_vh2vb_pl(self, cb)
!! author: David A. Minton
!!
Expand Down Expand Up @@ -76,6 +79,7 @@ module subroutine helio_coord_vh2vb_pl(self, cb)
return
end subroutine helio_coord_vh2vb_pl


module subroutine helio_coord_vh2vb_tp(self, vbcb)
!! author: David A. Minton
!!
Expand All @@ -98,5 +102,6 @@ module subroutine helio_coord_vh2vb_tp(self, vbcb)

return
end subroutine helio_coord_vh2vb_tp

end submodule s_helio_coord

7 changes: 7 additions & 0 deletions src/helio/helio_drift.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
submodule (helio_classes) s_helio_drift
use swiftest
contains

module subroutine helio_drift_body(self, system, param, dt, mask)

!! author: David A. Minton
Expand Down Expand Up @@ -39,6 +40,7 @@ module subroutine helio_drift_body(self, system, param, dt, mask)
return
end subroutine helio_drift_body


module subroutine helio_drift_pl(self, system, param, dt, mask)
!! author: David A. Minton
!!
Expand All @@ -52,9 +54,11 @@ module subroutine helio_drift_pl(self, system, param, dt, mask)
logical, dimension(:), intent(in) :: mask !! Logical mask of size self%nbody that determines which bodies to drift.

call helio_drift_body(self, system, param, dt, mask)

return
end subroutine helio_drift_pl


module subroutine helio_drift_tp(self, system, param, dt, mask)
!! author: David A. Minton
!!
Expand All @@ -68,8 +72,10 @@ module subroutine helio_drift_tp(self, system, param, dt, mask)
logical, dimension(:), intent(in) :: mask !! Logical mask of size self%nbody that determines which bodies to drift.

call helio_drift_body(self, system, param, dt, mask)

return
end subroutine helio_drift_tp


module subroutine helio_drift_linear_pl(self, cb, dt, mask, lbeg)
!! author: David A. Minton
Expand Down Expand Up @@ -108,6 +114,7 @@ module subroutine helio_drift_linear_pl(self, cb, dt, mask, lbeg)

return
end subroutine helio_drift_linear_pl


module subroutine helio_drift_linear_tp(self, cb, dt, mask, lbeg)
!! author: David A. Minton
Expand Down
Loading

0 comments on commit 0d8ad93

Please sign in to comment.