        subroutine UNPSCR(IBUFF,ABEXIT,NYR)
      include 'SIZE.INC'
      include 'GLOBAL.INC'
      include 'LOCAL.INC'
      include 'UNITS.INC'
      include 'INPAR.INC'
      include 'LOCAL1.INC'
      include 'LOCAL2.INC'
        double precision BUFF2(NPX*NCHEM*(2+NPX+NCHEM))
        real BUFF1 (NPX*(4+47*NCHEM))
        real RVAR(TOTLEN)
        common /CALL2/ RVAR
        equivalence (BUFF1(1), BUFF2(1), RVAR(1))
        integer IBUFF(VARIEC), NYR
        logical ABEXIT
        integer I, J, K, NSP, NSTART, NEND
        integer OFFSET, NVAR, NRECS, FIRREC, LASTRC, ITRAIL, IALPHA(7)
        data IALPHA/1,5,9,13,17,21,25/
      if ((NDAT.gt.1.or.NYR.gt.FRSTYR).and..not.ABEXIT) go to 170
      do 140 K = 1, NCHEM
         do 130 J = 1, NPX
            do 100 I = 1, 32
               ALPHA(I,J,K) = 0.0
100         continue
            BIOLKL(J,K) = 0.0
            EXPOKL(J,K) = 0.0
            HYDRKL(J,K) = 0.0
            OXIDKL(J,K) = 0.0
            PHOTKL(J,K) = 0.0
            REDKL(J,K) = 0.0
            S1O2KL(J,K) = 0.0
            VOLKL(J,K) = 0.0
            do 110 I = 1, 7
               YSATL(I,J,K) = 0.0
110         continue
            CONLDL(J,K) = 0.0D+00
            do 120 I = 1, NPX
               INTINL(I,J,K) = 0.0D+00
120         continue
            TOTKL(J,K) = 0.0D+00
130      continue
140   continue
      do 150 J = 1, NPX
         BIOTOL(J) = 0.0
         SEDCOL(J) = 0.0
         SEDMSL(J) = 0.0
         WATVOL(J) = 0.0
150   continue
      do 160 J = 1, NPX
         do 160 K = 1, NCHEM
            do 160 I = 1, NCHEM
               YIELDL(I,K,J) = 0.0D+00
160   continue
170   continue
      if (NDAT.eq.1.or.ABEXIT) read (WRKLUN(MACHNO),rec=1) (IBUFF(I),I=1
     &   ,4)
      OFFSET = 1+(NDAT-1)*(IBUFF(1)+IBUFF(3))
      NRECS = IBUFF(1)
      ITRAIL = IBUFF(2)
      FIRREC = OFFSET+1
      LASTRC = FIRREC+NRECS-1
      NSTART = 1
      if (NRECS.eq.1) go to 190
      NEND = VARREC
      do 180 K = FIRREC, LASTRC-1
         read (WRKLUN(MACHNO),rec=K) (BUFF1(I),I=NSTART,NEND)
         NSTART = NEND+1
         NEND = NEND+VARREC
180   continue
190   continue
      NEND = (NRECS-1)*VARREC+ITRAIL
      read (WRKLUN(MACHNO),rec=LASTRC) (BUFF1(I),I=NSTART,NEND)
      NVAR = 1
      do 240 K = 1, KCHEM
         do 230 J = 1, KOUNT
            do 210 NSP = 1, 7
               if (SPFLGG(NSP,K).eq.0) go to 210
               do 200 I = IALPHA(NSP), IALPHA(NSP)+3
                  ALPHA(I,J,K) = BUFF1(NVAR)
                  NVAR = NVAR+1
200            continue
210         continue
            do 220 I = 29, 32
               ALPHA(I,J,K) = BUFF1(NVAR)
               NVAR = NVAR+1
220         continue
230      continue
240   continue
      do 260 K = 1, KCHEM
         do 250 J = 1, KOUNT
            BIOLKL(J,K) = BUFF1(NVAR)
            NVAR = NVAR+1
250      continue
260   continue
      do 270 J = 1, KOUNT
         BIOTOL(J) = BUFF1(NVAR)
         NVAR = NVAR+1
270   continue
      do 290 K = 1, KCHEM
         do 280 J = 1, KOUNT
            EXPOKL(J,K) = BUFF1(NVAR)
            NVAR = NVAR+1
280      continue
290   continue
      do 310 K = 1, KCHEM
         do 300 J = 1, KOUNT
            HYDRKL(J,K) = BUFF1(NVAR)
            NVAR = NVAR+1
300      continue
310   continue
      do 330 K = 1, KCHEM
         do 320 J = 1, KOUNT
            OXIDKL(J,K) = BUFF1(NVAR)
            NVAR = NVAR+1
320      continue
330   continue
      do 350 K = 1, KCHEM
         do 340 J = 1, KOUNT
            PHOTKL(J,K) = BUFF1(NVAR)
            NVAR = NVAR+1
340      continue
350   continue
      do 370 K = 1, KCHEM
         do 360 J = 1, KOUNT
            REDKL(J,K) = BUFF1(NVAR)
            NVAR = NVAR+1
360      continue
370   continue
      do 390 K = 1, KCHEM
         do 380 J = 1, KOUNT
            S1O2KL(J,K) = BUFF1(NVAR)
            NVAR = NVAR+1
380      continue
390   continue
      do 400 J = 1, KOUNT
         SEDCOL(J) = BUFF1(NVAR)
         NVAR = NVAR+1
400   continue
      do 410 J = 1, KOUNT
         SEDMSL(J) = BUFF1(NVAR)
         NVAR = NVAR+1
410   continue
      do 430 K = 1, KCHEM
         do 420 J = 1, KOUNT
            VOLKL(J,K) = BUFF1(NVAR)
            NVAR = NVAR+1
420      continue
430   continue
      do 440 J = 1, KOUNT
         WATVOL(J) = BUFF1(NVAR)
         NVAR = NVAR+1
440   continue
      do 470 K = 1, KCHEM
         do 460 J = 1, KOUNT
            do 450 NSP = 1, 7
               if (SPFLGG(NSP,K).eq.0) go to 450
               YSATL(NSP,J,K) = BUFF1(NVAR)
               NVAR = NVAR+1
450         continue
460      continue
470   continue
      OFFSET = LASTRC
      NVAR = 1
      NRECS = IBUFF(3)
      ITRAIL = IBUFF(4)
      FIRREC = OFFSET+1
      LASTRC = FIRREC+NRECS-1
      NSTART = 1
      if (NRECS.eq.1) go to 490
      NEND = VARDEC
      do 480 K = FIRREC, LASTRC-1
         read (WRKLUN(MACHNO),rec=K) (BUFF2(I),I=NSTART,NEND)
         NSTART = NEND+1
         NEND = NEND+VARDEC
480   continue
490   continue
      NEND = (NRECS-1)*VARDEC+ITRAIL
      read (WRKLUN(MACHNO),rec=LASTRC) (BUFF2(I),I=NSTART,NEND)
      do 510 K = 1, KCHEM
         do 500 J = 1, KOUNT
            CONLDL(J,K) = BUFF2(NVAR)
            NVAR = NVAR+1
500      continue
510   continue
      do 540 K = 1, KCHEM
         do 530 J = 1, KOUNT
            do 520 I = 1, KOUNT
               INTINL(I,J,K) = BUFF2(NVAR)
               NVAR = NVAR+1
520         continue
530      continue
540   continue
      do 560 K = 1, KCHEM
         do 550 J = 1, KOUNT
            TOTKL(J,K) = BUFF2(NVAR)
            NVAR = NVAR+1
550      continue
560   continue
      do 590 J = 1, KOUNT
         do 580 K = 1, KCHEM
            do 570 I = 1, KCHEM
               YIELDL(I,K,J) = BUFF2(NVAR)
               NVAR = NVAR+1
570         continue
580      continue
590   continue
      return
      end
