1
Integer Function NextUnopen()
2
c********************************************************************
3
C Returns an unallocated FORTRAN i/o unit.
4
c********************************************************************
9
INQUIRE (UNIT=N, OPENED=EX)
15
Stop ' There is no available I/O unit. '
16
C *************************
21
subroutine OpenData(Tablefile)
22
c********************************************************************
23
c generic subroutine to open the table files in the right directories
24
c********************************************************************
27
Character Tablefile*40,up*3,lib*4,dir*8,tempname*100
28
data up,lib,dir/'../','lib/','Pdfdata/'/
29
Integer IU,NextUnopen,i
37
c first try in the current directory (for cluster use)
39
open(IU,file=tempname,status='old',ERR=10)
42
10 tempname=up//Tablefile
43
open(IU,file=tempname,status='old',ERR=20)
46
c then try PdfData directory
47
20 tempname=dir//Tablefile
48
open(IU,file=tempname,status='old',ERR=30)
51
30 tempname=lib//tempname
52
open(IU,file=tempname,status='old',ERR=40)
56
open(IU,file=tempname,status='old',ERR=50)
58
50 tempname=up//tempname
60
write(*,*) 'Error: PDF file ',Tablefile,' not found'
65
print*,'table for the pdf NOT found!!!'