PWGJE
[u/mrichter/AliRoot.git] / DPMJET / openfile.f
CommitLineData
ee7c9a1a 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
f87dab60 13 LOGICAL EXISTS
14 INTEGER LNROOT
d5aebb16 15 INTEGER LNBLNK
f87dab60 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
ee7c9a1a 38 OPEN (10, FILE="dpmjet.inp", STATUS="OLD")
f87dab60 39 OPEN (23, FILE=FILNAM, STATUS="OLD")
ee7c9a1a 40 RETURN
41 END