c===========================================================
c     Implements ODEs for method-of-lines solution of 
c     wave equation with O(h^2) spatial discretization.
c
c        u_j' = v_j
c        v_j' = hm2 * (v_j+1 - v u_j + v_j-1)
c
c===========================================================
      subroutine fcn(neq,t,y,yprime)
         implicit    none

         include     'fcn.inc'

         integer     neq,   nx,       j
         real*8      t,     y(neq),   yprime(neq) 

         nx = neq / 2

c-----------------------------------------------------------
c        Dirichlet conditions at x = 0.
c-----------------------------------------------------------
         yprime(1)     = 0.0d0 
         yprime(1+nx)  = 0.0d0
         do j = 2 , nx - 1
c-----------------------------------------------------------
c           Interior equations.
c-----------------------------------------------------------
            yprime(j)    = y(j+nx)
            yprime(j+nx) = 
     &         hm2 * (y(j+1) - 2.0d0 * y(j) + y(j-1))
         end do
c-----------------------------------------------------------
c        Dirichlet conditions at x = 1.
c-----------------------------------------------------------
         yprime(nx)    = 0.0d0
         yprime(nx+nx) = 0.0d0

         return
      end

c===========================================================
c     Dummy Jacobian routine.
c===========================================================
      subroutine jac
         implicit    none

         return
      end
