File: ford.f

package info (click to toggle)
scilab 4.0-12
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 100,640 kB
  • ctags: 57,333
  • sloc: ansic: 377,889; fortran: 242,862; xml: 179,819; tcl: 42,062; sh: 10,593; ml: 9,441; makefile: 4,377; cpp: 1,354; java: 621; csh: 260; yacc: 247; perl: 130; lex: 126; asm: 72; lisp: 30
file content (38 lines) | stat: -rw-r--r-- 961 bytes parent folder | download | duplicates (3)
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
28
29
30
31
32
33
34
35
36
37
38
      subroutine ford(i0,la1,long,lp1,ls1,m,n,p,pi)
      implicit integer (a-z)
      dimension lp1(*),ls1(m),p(n),la1(m)
      doubleprecision long(m),pi(n),infr,z
      logical modif
      infe=32700
      infr=10.e6
      if (i0 .lt. 0 .or. i0 .gt. n) then
         call erro('bad internal node number')
         return
      endif
      do 10 i=1,n
         pi(i)=  infr
         p(i)= - infe
 10   continue
      pi(i0)=0.
      p(i0)=0
      k=1
 100  continue
      modif=.false.
      do 160 i=1,n
         if(lp1(i).eq.lp1(i+1))goto 160
         do 150 ll= lp1(i),lp1(i+1)-1
            u=la1(ll)
            j=ls1(ll)
            z=pi(i)+long(u)
            if(z.ge.pi(j))goto 150
            pi(j)=z
            p(j)=i
            modif=.true.
 150     continue
 160  continue
      if(.not.modif)goto 999
      k=k+1
      if(k.lt.n)goto 100
      call erro('negative length circuit')
 999  continue
      end