ccccccccccccccccccccccccc     Program 6.2     cccccccccccccccccccccccccc
c
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c                                                                      c
c Please Note:                                                         c
c                                                                      c
c (1) This computer program is part of the book, "An Introduction to   c
c     Computational Physics," written by Tao Pang and published and    c
c     copyrighted by Cambridge University Press in 1997.               c
c                                                                      c
c (2) No warranties, express or implied, are made for this program.    c
c                                                                      c
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c
      SUBROUTINE RLXN (FN,DN,S,N,P,H)
C
C Subroutine performing one iteration of Relaxation for the
C one-dimensional stationary diffusion equation. DN is the
C diffusion coefficient shifted half step towards x=0.
C
      DIMENSION FN(N),DN(N),S(N)
      H2 = H*H
      Q  = 1.0-P
      DO 100 I = 2, N-1
        FN(I) = Q*FN(I)+P*(DN(I+1)*FN(I+1)
     *         +DN(I)*FN(I-1)+H2*S(I))/(DN(I+1)+DN(I))
  100 CONTINUE
      RETURN
      END
