      program lorenz

      INTEGER NSTEP,NVAR
      PARAMETER(NVAR=3,NSTEP=150)
      INTEGER i,j
      real x(200),y(50,200)
      real sigma,r,b,ystart(NVAR),x1,x2
      real xa,xb,ya,yb

      COMMON /path/ x,y
      EXTERNAL derivs

      sigma=10.d0
      b=8.d0/3.d0
      r=20.d0

      x1=0.d0
      x2=60.d0
      ystart(1)=0.d0
      ystart(2)=0.10d0
      ystart(3)=0.d0

      call rkdumb(ystart,NVAR,x1,x2,NSTEP,derivs)

      do 1 i=1,nstep
      write(10,*) y(1,i),y(2,i)
      write(11,*) y(1,i),y(3,i)
      write(12,*) y(2,i),y(3,i)
      write(13,*) y(1,i),y(2,i),y(3,i)
1     continue

      stop
      end

      subroutine derivs(x,y,dydx)

      real x,y(*),dydx(*),sigma,r,b
 
      sigma=10.d0
      b=8.d0/3.d0
      r=20.d0
      dydx(1)=-sigma*y(1)+sigma*y(2)
      dydx(2)=-y(1)*y(3)+r*y(1)-y(2)
      dydx(3)=y(1)*y(2)-b*y(3)

      return
      end
