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

Commit

Permalink
Rearranging loops for efficiency
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Jul 23, 2021
1 parent e47a6f1 commit 8070dc5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/obl/obl.f90
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ module subroutine obl_acc_pl(self, system)
cb%aobl(i) = -sum(pl%Gmass(1:npl) * pl%aobl(i, 1:npl)) / cb%Gmass
end do

do i = 1, NDIM
pl%ah(i, 1:npl) = pl%ah(i, 1:npl) + pl%aobl(i, 1:npl) - cb%aobl(i)
do i = 1, npl
pl%ah(:, i) = pl%ah(:, i) + pl%aobl(:, i) - cb%aobl(:)
end do
end associate

Expand Down Expand Up @@ -89,8 +89,8 @@ module subroutine obl_acc_tp(self, system)
aoblcb = cb%aoblend
end if

do i = 1, NDIM
tp%ah(i, 1:ntp) = tp%ah(i, 1:ntp) + tp%aobl(i, 1:ntp) - aoblcb(i)
do i = 1, ntp
tp%ah(:, i) = tp%ah(:, i) + tp%aobl(:, i) - aoblcb(:)
end do

end associate
Expand Down

0 comments on commit 8070dc5

Please sign in to comment.