        subroutine FDER(TIME,Y,W,YP)
      include 'SIZE.INC'
      include 'GLOBAL.INC'
      include 'LOCAL.INC'
      include 'LOCAL1.INC'
        integer I, IPAR, ISEG1, IST, J, JW, K, KK
        dimension Y(KOUNT,KCHEM), YP(KOUNT,KCHEM), W(KEQN,KEQN)
        double precision TIME, Y, YP, W
      do 100 J = 1, KEQN
         do 100 I = 1, KEQN
            W(I,J) = 0.0
100   continue
      IST = 0
      do 160 K = 1, KCHEM
         do 120 J = 1, KOUNT
            do 110 I = 1, KOUNT
               W(I+IST,J+IST) = INTINL(J,I,K)
110         continue
            JW = J+IST
            W(JW,JW) = -TOTKL(J,K)
120      continue
         if (IST.eq.0) go to 150
         J = 1
         KK = K-1
         do 140 IPAR = 1, KK
            I = IST+1
            do 130 ISEG1 = 1, KOUNT
               W(I,J) = YIELDL(K,IPAR,ISEG1)
               W(J,I) = YIELDL(IPAR,K,ISEG1)
               I = I+1
               J = J+1
130         continue
140      continue
150      continue
         IST = IST+KOUNT
160   continue
      return
      end
