Disable caching for async prefetching
[u/mrichter/AliRoot.git] / DPMJET / openfile.f
1       SUBROUTINE DPMJET_OPENINP()
2 *
3 *----------------------------------------------------------------------*
4 * Opens a file with a given unit number
5 *
6 *
7 * IOUNIT: Input unit to be assiged to the file
8 * FILNAM: Name of the file
9 *
10 *----------------------------------------------------------------------*
11 *
12       IMPLICIT NONE
13       LOGICAL EXISTS
14       INTEGER LNROOT
15       INTEGER LNBLNK
16       CHARACTER*1000 FILNAM
17       CHARACTER*1000 CHROOT
18       CHROOT=' '
19       CALL GETENVF('ALICE_ROOT',CHROOT)
20       LNROOT = LNBLNK(CHROOT)
21       IF(LNROOT.LE.0) THEN
22          FILNAM='dpmjet.dat'
23       ELSE
24          FILNAM=CHROOT(1:LNROOT)//'/DPMJET/dpmjet.dat'
25       ENDIF
26       INQUIRE(FILE=FILNAM,EXIST=EXISTS)
27       IF(.NOT.EXISTS) THEN
28          PRINT*,'***********************************'
29          PRINT*,'*           openfile              *'
30          PRINT*,'*        ---------------          *'
31          PRINT*,'*   File dpmjet.dat not found     *'
32          PRINT*,'*         Program STOP            *'
33          PRINT*,'*   Check ALICE_ROOT environment  *'
34          PRINT*,'*           variable              *'
35          PRINT*,'***********************************'
36          STOP
37       ENDIF
38       OPEN (10, FILE="dpmjet.inp", STATUS="OLD")
39       OPEN (23, FILE=FILNAM, STATUS="OLD")
40       RETURN
41       END