subroutine sort(a, n) c c -- shell-metzner sort for vector a c -- figure 6.6 c integer n, i, j, jump, j2, j3 real a(1) c jump = n 10 jump = jump / 2 if (jump .eq. 0) goto 99 j2 = n - jump do 30 j = 1, j2 i = j 20 j3 = i + jump if (a(i) .le. a(j3)) goto 30 call swap(a(i), a(j3)) i = i - jump if (i .gt. 0) goto 20 30 continue goto 10 99 return end