        subroutine CKICM2(Y)
      include 'SIZE.INC'
      include 'GLOBAL.INC'
      include 'LOCAL.INC'
      include 'UNITS.INC'
      include 'LOCAL1.INC'
        dimension  Y(KOUNT,KCHEM), TLOCAL(4)
        double precision Y, DTEMP
        real TLOCAL
        real MOLTST, CHECK, TEMP, YMAX, YOLD
        real SATST, TIME1, TIME2, TOTALT
        integer I, J, K, II, ITST, IPULS1, III, IV, VRAIL
        character FIXUP(4)*6
        data FIXUP/'hours ','days  ','months','years '/
        data TLOCAL / 1.0, 24.0, 730.5, 8766.0/
      IFLAG = 1
      if (NPULSE.eq.0) go to 130
      do 120 IPULS1 = 1, MAXMAS
         if (ICHEMG(IPULS1).eq.0) go to 130
         K = ICHEMG(IPULS1)
         J = ISEGG(IPULS1)
         MOLTST = MWTG(K)*0.01
         II = -3
         ITST = 0
         YOLD = Y(J,K)
         do 110 I = 1, 7
            II = II+1
            if (SPFLGG(I,K).eq.0) go to 110
            TEMP = 1.0E+06*IMASSG(IPULS1)/WATVOL(J)
            SATST = ALPHA(3*I+II,J,K)*YOLD
            CHECK = 0.50*YSATL(I,J,K)
            if (I.eq.1.and.CHECK.gt.MOLTST) CHECK = MOLTST
            if (SATST.le.CHECK) go to 100
            IFLAG = 9
            III = VRAIL(CHEMNA(1,K))
            write (TTYOUT(MACHNO),5000) (CHEMNA(IV,K),IV=1,III)
            write (TTYOUT(MACHNO),5010) J
5000        format (' Concentration of '/5X,50A1)
5010  format (' in segment ',I4/' reached a level at which EXAMS'' under
     &lying assumptions are'/' violated.  The RUN has been terminated.')
            go to 190
100         continue
            SATST = ALPHA(3*I+II,J,K)*(YOLD+TEMP)
            if (SATST.le.CHECK) go to 110
            if (ITST.eq.0) write (TTYOUT(MACHNO),5020) J
            ITST = 1
            YMAX = CHECK/ALPHA(3*I+II,J,K)
            IMASSG(IPULS1) = (YMAX-YOLD)*WATVOL(J)*1.0E-06
110      continue
         DTEMP = 0.0D+00
         DTEMP = 1.0E+06*IMASSG(IPULS1)/WATVOL(J)
         Y(J,K) = Y(J,K)+DTEMP
120   continue
5020  format (/1X,'Pulse in segment ',I5/1X,'too big.  Check output Tabl
     &es for adjusted value.')
130   continue
      if (TCODEG.ge.1.and.TCODEG.le.4) go to 140
      write (TTYOUT(MACHNO),5030) TCODEG
      IFLAG = 8
      go to 190
5030  format (/1X,'Faulty timer data: TCODE is ',I3/5X,'RUN aborted.')
140   continue
      if (TENDG.gt.0..and.TINITG.ge.0.0.and.CINTG.ge.0.0) go to 150
      write (TTYOUT(MACHNO),5040)
5040  format (/1X,'Timer controls include a bad value:'/1X,'TINIT or CIN
     &T is negative,'/1X,'or TEND is less than or equal to zero.  RUN ab
     &orted.')
      IFLAG = 8
      go to 190
150   continue
      TFACTR = TLOCAL(TCODEG)
      KDTIME = TCODEG
      T = 0.0D+00
      TENDL = 0.0D+00
      TINCRL = 0.0D+00
      T = TINITG*TFACTR
      TENDL = TENDG*TFACTR
      TINCRL = CINTG*TFACTR
      TOTALT = TENDL-T
      if (TOTALT.gt.0.0) go to 160
      TOTALT = TOTALT/TFACTR
      write (TTYOUT(MACHNO),5050) TOTALT,FIXUP(TCODEG)
5050  format (1X,'A simulation period of ',1PG11.4,A6/1X,'is inappropria
     &te.  RUN aborted.')
      IFLAG = 8
      go to 190
160   continue
      if (TINCRL.gt.0.0.and.TINCRL.lt.1.0D+00) TINCRL = 1.0D+00
      if (TINCRL.ge.1.0) go to 180
      if (TOTALT.le.288.) KDTIME = 1
      if (TOTALT.gt.288..and.TOTALT.le.8766.) KDTIME = 2
      if (TOTALT.gt.8766..and.TOTALT.le.105192.) KDTIME = 3
      if (TOTALT.gt.105192.) KDTIME = 4
      TFACTR = TLOCAL(KDTIME)
      TIME1 = TOTALT/12./TFACTR
      TIME2 = float(int(TIME1))
      if ((TIME1-TIME2).lt.0.5) go to 170
      TIME2 = TIME2+1.0
170   continue
      TINCRL = 0.0D+00
      TINCRL = TFACTR*TIME2
      if (TINCRL.lt.1.) TINCRL = 1.0D+00
      DTEMP = 0.0D+00
      DTEMP = TFACTR
      T = DTEMP*float(int(T/DTEMP))
      TENDL = T+TINCRL*12.0D+00
180   continue
190   continue
      return
      end
