C   25/11/79 002161912  MEMBER NAME  FAKALB   (SOURCE)      FORTRAN
      SUBROUTINE FAKALB(HEXP,HRUN,*)
C     PUT IN BAD CHANNEL INFO. INTO COMMON/CALIBR/
C     HEXP  :  INPUT EXPERIMENTAL #
C     HRUN  :  INPUT RUN#
C     HBUF  :  BUFFER FOR BAD CHANNELS. FOR THE OUTPUT OF THE PROG,
C              (J,I),J;1=ADC#,2=#CHANNELS TO BE SUBTRACTED.
C     CODED BY Y.WATANABE 19/9/79  09:05
      IMPLICIT INTEGER *2 (H)
#include "clgkalb.for"
      EQUIVALENCE (NEVNT,HBAD(1)),(HHEXP,HBAD(3)),(HHRUN,HBAD(4))
      EQUIVALENCE (HBUF(1),NCAL(3002))
      DIMENSION  HBBB(11526),HIN(4,2880),HBUF(1000),HBAD(1000)
      EQUIVALENCE (HIN(1,1),HBBB(7))
      EQUIVALENCE (HCAL(100),HBBB(1))
      DATA INIT/0/,HARUN/0/
C
C     PUT IN CALIBRATION DATA
      IF(INIT.GT.0) GO TO 30
C
C     PUT IN CALIBRATION CONSTS.
      CALL SETSL(HCAL,0,20000,0)
      READ(20) LENG,(HBBB(I),I=1,LENG)
C     WRITE(6,890) LENG,(HBBB(I),I=1,20)
C890  FORMAT(21I6)
      HP=10
      NCAL(2)=HP
      HP=HP+HP+1
      DO 10 I=1,2880
      HCAL(HP)=HIN(2,I)
      HCAL(HP+1)=HIN(4,I)
      HP=HP+2
10    CONTINUE
C     WRITE(6,900) (HCAL(I),I=22,5782,2)
C900  FORMAT(20I6)
      INIT=1
C
30    IF(HRUN.LE.0) RETURN1
      IFG=0
      NCAL(7)=3000
C
40    READ(21,END=60) NLENG,(HBAD(I),I=1,NLENG)
      IF(NLENG.LT.11) GO TO 40
      IF(NEVNT.LT.500) GO TO 55
      NCAL(3001)=NLENG
      DO 50 I=1,NLENG
50    HBUF(I)=HBAD(I)
55    IF(HHRUN.LT.HRUN) GO TO 40
      IF(HHRUN.GT.HRUN) GO TO 60
      WRITE(6,610) HRUN
  610 FORMAT(1X,'$$$ RUN # ',I4,' FOUND$$$ GOOD GOOD ')
      HARUN=HHRUN
      REWIND 21
C
      RETURN
C     WRITE(6,920) (HBUF(J),J=1,NLENG)
C920   FORMAT(10(2I6,1X))
C
60    REWIND 21
      WRITE(6,600) HRUN,HARUN
  600 FORMAT(1X,'*** RUN # ',I4,' NOT FOUND***  *USE',I4)
      RETURN
      END
