Opens decay table, needed to connect with C++.
[u/mrichter/AliRoot.git] / PYTHIA6 / openDecayTable.F
1       SUBROUTINE OPENDECAYTABLE(LUN)
2       LOGICAL OPENED,EXISTS
3       LOGICAL LRMSCH, LRD1O2, LTRASP
4       INTEGER LUN
5       CHARACTER*100 FILNAM
6 #if defined(CERNLIB_LINUX)||defined(CERNLIB_UNIX)||defined(CERNLIB_VAX)||defined(CERNLIB_CRAY)
7       CHARACTER*100 CHROOT
8 #endif
9 #if defined(CERNLIB_LINUX) || defined(CERNLIB_UNIX)||defined(CERNLIB_CRAY)
10       CHROOT=' '
11       CALL GETENVF('ALICE_ROOT',CHROOT)
12       LNROOT = LNBLNK(CHROOT)
13       IF(LNROOT.LE.0) THEN
14          FILNAM='decaytable.dat'
15       ELSE
16          FILNAM=CHROOT(1:LNROOT)//'/data/decaytable.dat'
17       ENDIF
18       INQUIRE(FILE=FILNAM,EXIST=EXISTS)
19       IF(.NOT.EXISTS) THEN
20          PRINT*,'***********************************'
21          PRINT*,'*        OpenDecayTable           *'
22          PRINT*,'*        ---------------          *'
23          PRINT*,'*   File DECAYTABLE.DAT not found *'
24          PRINT*,'*         Program STOP            *'
25          PRINT*,'*   Check ALICE_ROOT environment  *'
26          PRINT*,'*           variable              *'
27          PRINT*,'***********************************'
28          STOP
29       ENDIF
30       OPEN(LUN,FILE=FILNAM,STATUS='OLD')
31 #endif
32 #if defined(CERNLIB_VAX)
33       ISTAT = LIB$SYS_TRNLOG ('ALICE_ROOT',NALL,CHROOT,,,%VAL(0))
34       IF(ISTAT.NE.1) THEN
35          FILNAM='decaytable.dat'
36       ELSE
37          FILNAM='ALICE_ROOT:[LIB]decaytable.dat'
38       ENDIF
39       INQUIRE(FILE=FILNAM,EXIST=EXISTS)
40       IF(.NOT.EXISTS) THEN
41          PRINT*,'***********************************'
42          PRINT*,'*        OpenDecayTable           *'
43          PRINT*,'*        ---------------          *'
44          PRINT*,'*   File DECAYTABLE.DAT not found *'
45          PRINT*,'*         Program STOP            *'
46          PRINT*,'*   Check ALICE_ROOT environment  *'
47          PRINT*,'*           variable              *'
48          PRINT*,'***********************************'
49          STOP
50       ENDIF
51       OPEN(LUN,FILE=FILNAM,STATUS='OLD',READONLY)
52 #endif
53 #if defined(CERNLIB_IBM)
54       FILNAM='/DECAYTABLE DAT *'
55       OPEN(LUN,FILE=FILNAM,STATUS='OLD')
56 #endif
57       RETURN
58       END