      SUBROUTINE HEC_CRL_INI
C ----------------------------------------------------------------------
C-
C-    User initialization
C-
C ----------------------------------------------------------------------
C
      IMPLICIT NONE
C
      INCLUDE 'hec_par.inc'
      INCLUDE 'hec_geo.inc'
c
c user datacard values common
c
      include'hec_datacard.inc'
C
C ****  Local variable declarations
C
      INTEGER NVAR1
      PARAMETER (NVAR1=4)
      CHARACTER*6 TAGS1(NVAR1) 
C
      INTEGER NVAR2
      PARAMETER (NVAR2=4)
      CHARACTER*6 TAGS2(NVAR2) 
c
      INTEGER NVAR3
      PARAMETER (NVAR3=4)
      CHARACTER*6 TAGS3(NVAR3) 
c
      INTEGER ISTAT
C ----------------------------------------------------------------------
c
      data tags1/'ADCHAN','TIMSAM','PEDEST','ANOISE'/
      data tags2/'ADCHAN','TIMSA1','TIMSA2','CORTIM'/
      data tags3/'TIMSAM','ADCHA1','ADCHA2','CORADC'/
C
C ****  Open user hbook file
C
      CALL HROPEN (io_crl, 'crl', 'crl.hbook', 'N', 1024, ISTAT)
C
C ****  Book ntuples
C
      CALL HBOOKN (1,'Pedestal and noise',  NVAR1,'//crl',2000,TAGS1)
      CALL HBOOKN (2,'Correl. - time samps',NVAR2,'//crl',2000,TAGS2)
      CALL HBOOKN (3,'Correl. - channels',  NVAR3,'//crl',2000,TAGS3)
C
C ****  User initialisation
C
      CALL HEC_CRL_CORREL (-1)
C
C ****  Print used parameters
C
      PRINT *, ' '
      PRINT *, ' Number of used ADC channels   - ',I_ADC_USED
      PRINT *, ' Number of used time samplings - ',I_TIM_USED
      PRINT *, ' '
      PRINT *, ' *** CRL initialization done'
C
      END
C ======================================================================


