c
c     Second Edition
c     Numerical Analysis:
c     The Mathematics of Scientific Computing
c     D.R. Kincaid & E.W. Cheney
c     Brooks/Cole Publ., 1996
c     ISBN 0-534-33892-5
c     COPYRIGHT (c) 1996
c
c     Section 4.6
c
c     Example of Richardson's method
c
c
c     file: ex2s46.f
c
      parameter (n=3)
      dimension r(n),x(n)
      data (x(i),i=1,n) /0.0,0.0,0.0/
c 
      print *
      print *,' Richardson method example'
      print *,' Section 4.6, Kincaid-Cheney'
      print *
c
      do 3 k=1,100
         r(1) = (11./18.) - x(1) - .5*x(2) - (1./3.)*x(3)
         r(2) = (11./18.) - x(2) - .5*x(3) - (1./3.)*x(1)
         r(3) = (11./18.) - x(3) - .5*x(1) - (1./3.)*x(2)
         do 2 j=1,n
            x(j) = x(j) + r(j)
 2       continue
         if (0 .eq. mod(k,10)) then
            print *,' At iteration',k
            print 4,r
            print 5,x
            print *
         endif
 3    continue
c
 4    format (3x,'r is:',3(e13.6,2x))
 5    format (3x,'x is:',3(e13.6,2x))
      stop
      end
