Skip to content

Instantly share code, notes, and snippets.

@madebyjeffrey
Created September 13, 2011 19:25
Show Gist options
  • Save madebyjeffrey/1214807 to your computer and use it in GitHub Desktop.
Save madebyjeffrey/1214807 to your computer and use it in GitHub Desktop.
subroutine step(positions, velocities)
real, dimension(p,2), intent(inout) :: positions, velocities
! verify lengths (? unnecessary?)
if (size(positions, 1) .ne. size(velocities, 1)) then
print *, "The sizes of two arrays are not the same"
end if
! move the particles to the new position
do i = 1, size(positions, 1)
positions(i, 1) = positions(i, 1) + velocities(i, 1)
positions(i, 2) = positions(i, 2) + velocities(i, 2)
end do
end subroutine step
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment