      SUBROUTINE RES_DAEPACK(NSTATE, T, Y, YPRIME, DEL, IRES, RPAR,
     $     IPAR)

      IMPLICIT NONE

C     INITIALIZE VARIABLES IN COMMON BLOC
      INTEGER NY, REACTIONSIZE, THIRDBODYREACTIONSIZE, TROEREACTIONSIZE,
     $     LINDEREACTIONSIZE
      COMMON /SIZE/ NY, REACTIONSIZE, THIRDBODYREACTIONSIZE,
     $     TROEREACTIONSIZE, LINDEREACTIONSIZE

      INTEGER REACTIONARRAY(10*100000), THIRDBODYREACTIONARRAY(21*100),
     $     TROEREACTIONARRAY(22*100), LINDEREACTIONARRAY(21*100)

      DOUBLE PRECISION REACTIONRATEARRAY(5*100000),
     $     THIRDBODYREACTIONRATEARRAY(16*100),
     $     TROEREACTIONRATEARRAY(21*100), TEMPERATURE, PRESSURE,
     $     LINDEREACTIONRATEARRAY(17*100)

      COMMON /REAC/ REACTIONRATEARRAY, ThirdbodyREACTIONRATEARRAY,
     $     TroeREACTIONRATEARRAY, TEMPERATURE, PRESSURE,
     $     REACTIONARRAY, THIRDBODYREACTIONARRAY, TROEREAcTIONARRAY,
     $     LINDEREACTIONRATEARRAY, LINDEREACTIONARRAY

      INTEGER IPAR(1), IRES, I, NSTATE
      DOUBLE PRECISION T, Y(NSTATE), YPRIME(NSTATE), CJ, DEL(NSTATE),
     $     RPAR(REACTIONSIZE+THIRDBODYREACTIONSIZE+
     $     TROEREACTIONSIZE+LINDEREACTIONSIZE), SUMY, SUMYPRIME
      EXTERNAL GETFLUX
      

      CALL GETFLUX(Y, DEL, RPAR)

      DO I=1,NSTATE
         DEL(I) = DEL(I) - YPRIME(I)
      END DO

      END SUBROUTINE RES_DAEPACK
