File: shell.f90

package info (click to toggle)
wsjtx 2.7.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 70,440 kB
  • sloc: cpp: 75,379; f90: 46,460; python: 27,241; ansic: 13,367; fortran: 2,382; makefile: 197; sh: 133
file content (27 lines) | stat: -rwxr-xr-x 366 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
subroutine shell(n,a)
  integer n
  real a(n)
  integer i,j,inc
  real v

  inc=1
1 inc=3*inc+1
  if(inc.le.n) go to 1
2  inc=inc/3

  do i=inc+1,n
     v=a(i)
     j=i
3    if(a(j-inc).gt.v) then
        a(j)=a(j-inc)
        j=j-inc
        if(j.le.inc) go to 4
        go to 3
     endif
4    a(j)=v
  enddo

  if(inc.gt.1) go to 2

  return
end subroutine shell