anchor.diff:  	! 4/24/08 gmagoon: call EdgeFlux if AUTOFLAG is 1 to
   	! determine EDGEFLAG 
   		IF (AUTOFLAG.eq.1) THEN
  -			CALL EDGEFLUX(EDGEFLAG, Y, YPRIME,THRESH,ESPECIES, &
  +			CALL EDGEFLUX(EDGEFLAG,EDGEFLAGCORE,Y, YPRIME,THRESH,CORETHRESH,ESPECIES, &
       		 &     EREACTIONSIZE,NEREAC,NEPROD,IDEREAC,IDEPROD,KVEC, &
   		 &     MAXRATIO,PRUNEVEC,NSTATE)
  -		 	!update HIGHESTRATIO and store relevant variables that will be printed
  -			!later; note that we cannot exit the do loop once the IF statement is
  -			!caught because, even though output variables will be stored properly,
  -			!the HIGHESTRATIO will not necessarily have the highest value
  -			COPYQ=0
  +		 	!update HIGHESTRATIO
   			DO I=1, ESPECIES
   			    IF (MAXRATIO(I) .GT. HIGHESTRATIO) THEN
   				HIGHESTRATIO = MAXRATIO(I)
  -				COPYQ=1 !mark this ODE time step for copying into output variables
   			    END IF
   			END DO
  -			IF (COPYQ .EQ. 1) THEN
  +			!when core flux threshold is exceeded for the first time, store the values for output
  +			IF(EDGEFLAGCORE .GT. 0 .AND. CORESTORED .EQ. -1) THEN
   			    ITER_OUTPT=ITER
   			    TIME_OUTPT=TIME
   			    Y_OUTPT = Y
  
positive.code:       !core inclusion threshhold, and we therefore want to report the
        !final state back to the Java code so it will recognize that the
        !target time/conversion has been reached
        IF ((AUTOFLAG .NE. 1) .OR. (HIGHESTRATIO .LT. CORETHRESH)) THEN
  	ITER_OUTPT=ITER
  	TIME_OUTPT=TIME
  	Y_OUTPT = Y
  
negative.code: 	!IWORK_OUTPT = IWORK
  	!RWORK_OUTPT = RWORK
  	TOTALREACTIONFLUX_OUTPT = TOTALREACTIONFLUX
        END IF
        IWORK_OUTPT = IWORK
        RWORK_OUTPT = RWORK
  