*
* $Id$
*
* $Log$
*
*CMZ :  3.00/00 01/05/2001  18.30.37  by  Marialuigia Ambriola
*CMZ :  2.01/00 05/04/2000  14.35.18  by  Marialuigia Ambriola
*CMZ :  2.00/00 03/03/2000  15.39.05  by  Francesco Cafagna
*CMZ :  1.02/00 10/03/97  17.55.00  by  Francesco Cafagna
*CMZ :  1.01/00 13/05/96  09.16.26  by  Francesco Cafagna
*CMZ :  1.00/02 14/03/96  12.01.32  by  Francesco Cafagna
*-- Author :    Francesco Cafagna   30/11/95
      SUBROUTINE UGINIT
************************************************************************
*                                                                      *
* GEANT user initialization routine                                    *
*                                                                      *
* Author: Francesco Cafagna, 30/11/95 01.59.13                         *
*                                                                      *
************************************************************************
#include "gclist.inc"
#include "gcunit.inc"
#include "gpunit.inc"
#include "gpkey.inc"
*
      CHARACTER*8 VERSQQ
      INTEGER IDATQQ,ITIMQQ,IVERSQ
*
#include "gpdunit.inc"
*
* Put version and date creation
*
C #       IDATQQ = CPP_DATE
C #       ITIMQQ = CPP_TIME
C #       VERSQQ = CPP_VERS
*
*     -----------------------------------------------------------------
*
*             Initialize GEANT
*
      CALL GINIT
*
*             Prints version number
*
C #       WRITE(LOUT,10000)
*
*             Define additional data cards
*
      CALL GPFFR
*
*             Read data cards with FFREAD
*
*
      OPEN(UNIT=LUFFR,FILE=CHFFR,STATUS='UNKNOWN',FORM='FORMATTED')
      CALL GFFGO
      CLOSE(LUFFR)
*
*             Open user files
*
      CALL GPFIL
*
*             Initialize GEANT/ZEBRA data structures
*
      CALL GZINIT
*.
#if defined(GPAMELA_HIGZ)
*
*             Initialize graphics package
*
      CALL GDINIT
#endif
*
*             Set default values for PAMELA
*
      CALL GPDAT
*
*             GEANT standard material data
*             User's geometry and materials description.
*             Special tracking media material
*             Sets, detectors, hits and digi definition
*
      CALL GMATE
      CALL GPMAT
      CALL GPMED
      CALL GPSPTM
      CALL GPGEO
      CALL GPSED
      CALL GPHIT
      CALL GPADIGI
*
* Close the geometry definition
*
      CALL GGCLOS
*
*             Particle table definition and energy loss initialization.
*
      CALL GPART
      CALL GPIONS
      CALL GPHYSI
*.
#if defined(GPAMELA_HIGZ)
*
*             Create a view bank
*
      CALL GVIEWYZ(1)
#endif
*
*              Geant standards hitos, if requested
*              User histos
*
      IF(NHSTA.GT.0) CALL GBHSTA
      IF(HBK) CALL GPHBK
#if defined(GPAMELA_GARFIELD)
*
* 	GARFIELD init
*
      CALL GPGARIN
#endif
*
*
*              User action
*
      CALL GPUINI
*
C # 10000 FORMAT(/,2X,'This program history:',/,
C #      + CPP_TITLE_CH
C #      + // '                              '
C #      +       )
      END
*#include "TITLE.gpamela"
