Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real | :: | r | ||||
integer | :: | n | ||||
integer | :: | k |
subroutine r_shift(r,n,k)
implicit double precision (a-h,o-z)
dimension r(*)
if (k>0) then
do i=1,n
r(i)=r(i+k)
end do
else if (k<0) then
do i=n,1,-1
r(i)=r(i+k)
end do
end if
end subroutine r_shift