anchor.diff:  C
         DO 70 N = 1, NREV
            I = IREV(N)
  -	 if(nur(i).eq.0) goto 70
  +       if(nur(i).eq.0) goto 70
            RKRT(I) = RPAR(1,N) * EXP(RPAR(2,N)*ALOGT - RPAR(3,N)/T)
            EQK(I)  = RKFT(I)/RKRT(I)
      70 CONTINUE
  
positive.code:          ALOGT = LOG(T)
  C
           DO 90 N = 1, NFAL
  	    i = ifal(n)
  	    if(nur(i).eq.0) goto 90
  C
              RKLOW = FPAR(1,N) * EXP(FPAR(2,N)*ALOGT - FPAR(3,N)/T)
  C
  
negative.code: C     course of the Adaptive Chemistry simulation. Adaptive Chemistry should
  C     evaluate and report the error of the skeletal model at the end of the
  C     steady-state simulation
        open(4,file='default.model',status='old')
        read(4,*) ivalr, ivals
        if(ivalr.eq.ii) then
  C     default is full model
           do i=1,ii
              NUR(i,1) = 1
           enddo
           do k=1,kk
              NUS(k,1) = 1
           enddo
        else
  C     default is subset of full model
           read(4,*) ( NUR(i,1), i=1, ii )
           read(4,*) ( NUS(k,1), k=1, kk )
        endif
        close(4)
        modelSize(1,1) = ivalr
        modelSize(1,2) = ivals ! number of species in default model
        nModels = 1
        ireadSize = 1
        ifoundSize = 0
        imodelSize = ii*10
        kmodelSize = kk*10
        do 100 while(7.gt.0)
           read(lin,*) line
           if(line(:3).eq.'END') return
           if(ireadSize.eq.1) then
              if (ifoundSize.eq.0) then
  C     look for model size
                if(line(2:9).eq.'Contains'.or.line(2:9).eq.'Includes')then
                  backspace(lin)
                  read(lin,*) line, kmodelSize
                  ifoundSize = 1
                endif
              elseif(ifoundSize.eq.1) then !found number of reactions; need number of species
  C     look for model species size
            if(line(2:9).eq.'Contains'.or.line(2:9).eq.'Includes') then
                backspace(lin)
                read(lin,*) line, imodelSize
                ifoundSize = 2
            elseif(line(:6).eq.'REGION') then
  C     model size not specified; never look for model size
                ireadSize = 0
            endif
              endif
           endif
           if(line(:6).eq.'REGION') then
              nModels = nModels + 1
  C     Store the model
              read(lin,*) (NUS(k,nModels), k=1,kk)!species
              read(lin,*) (NUR(i,nModels), i=1,ii)!reactions
              modelSize(nModels,1) = imodelSize
              modelSize(nModels,2) = kmodelSize
  C     Valid range
              read(lin,*) line
              do k=1, kk+1
           read(lin,*) rangeLo(k,nModels), rangeHi(k,nModels)
  C     <approx. for zero>
           if(rangeLo(k,nModels).lt.1.d-15) rangeLo(k,nModels) = 0.0d0
           rangeHi(k,nModels) = max(rangeHi(k,nModels),1.0d-15)
  C     </approx. for zero>
              enddo
              ifoundSize = 0
           endif
    100 continue
  
        return
        end
  
  C**********************************************************************
        subroutine findModel(jsolv,lin,iCall,kk,ii,kfuel,T,C,iModNum,
       & nFull,nRed)
  C     This subroutine finds the smallest valid model within the model library
  C     at a given set of species concentrations and temperature
  C     Luwi Oluwole 6/10/2004
        implicit double precision (a-h,o-z), integer (i-n)
        include 'ackparams.i'
        dimension C(kk)
        dimension rangeLo(kmax+1,nm+1), rangeHi(kmax+1,nm+1)
  C     save data for use on subsequent calls
        common /saveV/ rangeLo,rangeHi
        common /saveV1/ nModels
        if(iCall.eq.2) goto 007
  C     On first call, read and save model library
        call readModels(lin,kk,ii,rangeLo,rangeHi,nModels)
        close(lin)
        iCall = 2
  C     <modelLib: signal completion of model library upload>
        open(78,file='donemodels',status='new')
        close(78)
        if(jsolv .eq. -1) then
          return ! Luwi--4/23/2010--this call was for loading models only
          endif
  C     </modelLib>
    007 continue
  C
  C     If no valid reduced model is found use full model
        iModNum = 1
  C     Search model library for smallest valid model
        do 001 j = 2, nModels
           if(T.lt.rangeLo(1,j).or.T.gt.rangeHi(1,j)) goto 001
           do k = 1, kk
              if(abs(C(k)).lt.rangeLo(k+1,j).or.C(k).gt.rangeHi(k+1,j))
       &      goto 001
           enddo
           iModNum = j
           nRed = nRed + 1
           return
    001 continue
  C     Increment count of number of times full model is used
        nFull = nFull + 1
  
        return
        end
  
  C**********************************************************************
        subroutine closeadcfiles
        implicit double precision (a-h, o-z)
  C     close model Usage statistics files
        close (2) !filename: avgModelSize
        close (3) !filename: modelUsage
  
        return
        end
  
  C**********************************************************************
        SUBROUTINE ACKWC(nrxn,p,t,c,nur,nus,ickwrk,rckwrk,ispecies,wdotr)
  