      subroutine PACLDS(RECNUM)
      include 'SIZE.INC'
      include 'GLOBAL.INC'
      include 'LOCAL.INC'
      include 'UNITS.INC'
      real BUFFER(VARREC), IO(5*NPX*NCHEM*MAXDAT+MAXMAS)
      integer IBUFF(VARIEC), IOI(5*MAXMAS+50),RECNUM,OFFSET
      integer RRECS, IRECS, CRECS, TRECS, NREALS, NINTS, NCHARS
      integer RECDAT(FILDAT), HRECS
      integer I,NUSED,J,K,M,L,ISET
      character*1 CBUFF(VARCEC), IOC(62)
      do 100 I = 1, VARCEC
         CBUFF(I) = ' '
100   continue
      do 110 I = 1, VARIEC
         IBUFF(I) = 0
110   continue
      do 120 I = 1, VARREC
         BUFFER(I) = 0.0
120   continue
      NUSED = 0
      do 130 I = 1, MAXMAS
         IO(NUSED+I) = IMASSG(I)
130   continue
      NUSED = NUSED+MAXMAS
      do 160 I = 1, MAXDAT
         do 150 J = 1, NCHEM
            do 140 K = 1, NPX
               IO(NUSED+1) = STRLDG(K,J,I)
               IO(NUSED+2) = NPSLDG(K,J,I)
               IO(NUSED+3) = PCPLDG(K,J,I)
               IO(NUSED+4) = DRFLDG(K,J,I)
               IO(NUSED+5) = SEELDG(K,J,I)
               NUSED = NUSED+5
140         continue
150      continue
160   continue
      NUSED = 0
      do 170 I = 1, MAXMAS
         IOI(NUSED+1) = ISEGG(I)
         IOI(NUSED+2) = ICHEMG(I)
         IOI(NUSED+3) = IMONG(I)
         IOI(NUSED+4) = IDAYG(I)
         IOI(NUSED+5) = IYEARG(I)
         NUSED = NUSED+5
170   continue
      do 180 I = 1, 50
         IOC(I) = LOADNM(I)
180   continue
      NUSED = 50
      do 190 I = 1, 6
         IOC(NUSED+1) = RPASS(3)(I:I)
         IOC(NUSED+2) = WPASS(3)(I:I)
         NUSED = NUSED+2
190   continue
      HRECS = FILDAT/VARIEC
      if (FILDAT-VARIEC*HRECS.ne.0) HRECS = HRECS+1
      M = 0
      do 210 I = 1, HRECS
         read (RANUNT(MACHNO),rec=I) IBUFF
         do 200 L = 1, VARIEC
            M = M+1
            if (M.gt.FILDAT) go to 220
            RECDAT(M) = IBUFF(L)
200      continue
210   continue
220   continue
      RRECS = RECDAT(33)
      IRECS = RECDAT(34)
      CRECS = RECDAT(56)
      TRECS = RRECS+IRECS+CRECS
      NREALS = RECDAT(37)
      NINTS = RECDAT(38)
      NCHARS = RECDAT(52)
      ISET = RECDAT(45)-1
      OFFSET = (RECNUM-1)*TRECS+ISET
      do 250 I = 1, RRECS
         J = (I-1)*VARREC
         K = J+VARREC
         J = J+1
         M = 0
         do 230 L = J, K
            M = M+1
            if (L.gt.NREALS) go to 240
            BUFFER(M) = IO(L)
230      continue
240      continue
         J = OFFSET+I
         write (RANUNT(MACHNO),rec=J) BUFFER
250   continue
      OFFSET = OFFSET+RRECS
      do 280 I = 1, IRECS
         J = (I-1)*VARIEC
         K = J+VARIEC
         J = J+1
         M = 0
         do 260 L = J, K
            M = M+1
            if (L.gt.NINTS) go to 270
            IBUFF(M) = IOI(L)
260      continue
270      continue
         J = OFFSET+I
         write (RANUNT(MACHNO),rec=J) IBUFF
280   continue
      OFFSET = OFFSET+IRECS
      do 310 I = 1, CRECS
         J = (I-1)*VARCEC
         K = J+VARCEC
         J = J+1
         M = 0
         do 290 L = J, K
            M = M+1
            if (L.gt.NCHARS) go to 300
            CBUFF(M) = IOC(L)
290      continue
300      continue
         J = OFFSET+I
         write (RANUNT(MACHNO),rec=J) CBUFF
310   continue
      return
      end
