anchor.diff:  			CALL EDGEFLUX(EDGEFLAG, Y, YPRIME,THRESH,ESPECIES, &
       		 &     EREACTIONSIZE,NEREAC,NEPROD,IDEREAC,IDEPROD,KVEC, &
   		 &     MAXRATIO, 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
  +			DO I=1, EDGESPECIES
  +			    IF (MAXRATIO(I) .GT. HIGHESTRATIO) THEN
  +				HIGHESTRATIO = MAXRATIO(I)
  +				ITER_OUTPT=ITER
  +				TIME_OUTPT=TIME
  +				Y_OUTPT = Y
  +				YPRIME_OUTPT = YPRIME
  +				IWORK_OUTPT = IWORK
  +				RWORK_OUTPT = RWORK
  +				TOTALREACTIONFLUX_OUTPT = TOTALREACTIONFLUX
  +			    END IF
  +			END DO
   		ENDIF
               GO TO 1
            END IF
  
positive.code:    ! 5/9/08 gmagoon: these values are read by RMG as flux; corrected to
     ! include volume changing effects (dV/dt) using quotient rule
     !      WRITE(16,*) YPRIME(I)/Y(NSTATE)
            WRITE(16,*) (Y(NSTATE)*YPRIME(I)-Y(I)*YPRIME(NSTATE))/(Y(NSTATE)**2)
        END DO
  
        DO I=1,REACTIONSIZE+THIRDBODYREACTIONSIZE+TROEREACTIONSIZE+LINDEREACTIONSIZE
           WRITE(16,*) TOTALREACTIONFLUX(I)
        END DO
        
        write(16,*) y(nstate)
        
        !for autoflag cases, display the final time integrated to,
        !along with pruning information
        DO I=1, ESPECIES
  	  WRITE(16,*) MAXRATIO(I)
        END DO
  
        CLOSE(16)
  
        OPEN(UNIT=14, FILE='RWORK.DAT', FORM='UNFORMATTED')
        WRITE(14) (RWORK(I),I=1,LRW)
        CLOSE(14)
  
        OPEN(UNIT=15, FILE='IWORK.DAT', FORM='UNFORMATTED')
        WRITE(15) (IWORK(I),I=1,LIW)
        CLOSE(15)
        
        if (idid .eq. 1 .or. idid .eq. 2 .or. idid .eq. 3 .or. idid .eq. 0) then
  
negative.code:       !write(*,*) 'Time-stepping timing: ', (finishT-startT)
       ! write(*,*) (finishT-startT)
  
        !if we are not using AUTOFLAG, we just want to output the final times
        IF (AUTOFLAG .NE. 1) THEN
  	ITER_OUTPT=ITER
  	TIME_OUTPT=TIME
  	Y_OUTPT = Y
  	YPRIME_OUTPT = YPRIME
  	IWORK_OUTPT = IWORK
  	RWORK_OUTPT = RWORK
        END IF
  
        OPEN(UNIT=16, FILE='SolverOutput.dat')
  
        write(16,*) ITER_OUTPT
        WRITE(16,*) NSTATE-1
        write(16,*) TIME_OUTPT
        DO I=1,NSTATE-1
           WRITE(16,*) Y_OUTPT(I)/Y_OUTPT(NSTATE)
        END DO
        
  
  