      SUBROUTINE SRCOM (RSAV, ISAV, JOB)
C-----------------------------------------------------------------------
C THIS ROUTINE SAVES OR RESTORES (DEPENDING ON JOB) THE CONTENTS OF
C THE COMMON BLOCKS LS0001 AND EH0001, WHICH ARE USED INTERNALLY
C BY ONE OR MORE ODEPACK SOLVERS.
C
C RSAV = REAL ARRAY OF LENGTH 218 OR MORE.
C ISAV = INTEGER ARRAY OF LENGTH 41 OR MORE.
C JOB  = FLAG INDICATING TO SAVE OR RESTORE THE COMMON BLOCKS..
C        JOB  = 1 IF COMMON IS TO BE SAVED (WRITTEN TO RSAV/ISAV)
C        JOB  = 2 IF COMMON IS TO BE RESTORED (READ FROM RSAV/ISAV)
C        A CALL WITH JOB = 2 PRESUMES A PRIOR CALL WITH JOB = 1.
C-----------------------------------------------------------------------
      INTEGER ISAV, JOB
      INTEGER IEH, ILS
      INTEGER I, LENILS, LENRLS
      DOUBLE PRECISION RSAV,   RLS
      DIMENSION RSAV(1), ISAV(1)
      COMMON /LS0001/ RLS(218), ILS(39)
      COMMON /EH0001/ IEH(2)
      DATA LENRLS/218/, LENILS/39/
C
      IF (JOB .EQ. 2) GO TO 100
C
      DO 10 I = 1,LENRLS
 10     RSAV(I) = RLS(I)
      DO 20 I = 1,LENILS
 20     ISAV(I) = ILS(I)
      ISAV(LENILS+1) = IEH(1)
      ISAV(LENILS+2) = IEH(2)
      RETURN
C
 100  CONTINUE
      DO 110 I = 1,LENRLS
 110     RLS(I) = RSAV(I)
      DO 120 I = 1,LENILS
 120     ILS(I) = ISAV(I)
      IEH(1) = ISAV(LENILS+1)
      IEH(2) = ISAV(LENILS+2)
      RETURN
C----------------------- END OF SUBROUTINE SRCOM -----------------------
      END
