~madteam/mg5amcnlo/series2.0

« back to all changes in this revision

Viewing changes to Template/FKS-born/Source/PDF/opendata.f

  • Committer: Marco Zaro
  • Date: 2012-08-28 21:06:34 UTC
  • mto: (78.35.14 AutoMint)
  • mto: This revision was merged to the branch mainline in revision 249.
  • Revision ID: marco.zaro@gmail.com-20120828210634-5a06yvda3hplw8ur
doing some renaming:
 Template/FKS-born -> Template/NLO
 fks_born.py -> fks_base.py
 fks_born_helas_objects.py -> fks_helas_objects.py
 export_fks_born.py -> export_fks.py

also functions/classes and tests renamed
all unit tests ok, exporting ok

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
      Integer Function NextUnopen()
2
 
c********************************************************************
3
 
C     Returns an unallocated FORTRAN i/o unit.
4
 
c********************************************************************
5
 
 
6
 
      Logical EX
7
 
C
8
 
      Do 10 N = 10, 300
9
 
         INQUIRE (UNIT=N, OPENED=EX)
10
 
         If (.NOT. EX) then
11
 
            NextUnopen = N
12
 
            Return
13
 
         Endif
14
 
 10   Continue
15
 
      Stop ' There is no available I/O unit. '
16
 
C               *************************
17
 
      End
18
 
 
19
 
 
20
 
 
21
 
      subroutine OpenData(Tablefile)
22
 
c********************************************************************
23
 
c generic subroutine to open the table files in the right directories
24
 
c********************************************************************
25
 
      implicit none
26
 
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
30
 
      External NextUnopen
31
 
      common/IU/IU
32
 
c
33
 
c--   start
34
 
c
35
 
      IU=NextUnopen()
36
 
 
37
 
c     first try in the current directory
38
 
 
39
 
      tempname=dir//Tablefile
40
 
      open(IU,file=tempname,status='old',ERR=10)
41
 
      return
42
 
 
43
 
 10   tempname=lib//tempname
44
 
      open(IU,file=tempname,status='old',ERR=20)
45
 
 
46
 
 20   continue
47
 
      do i=0,6
48
 
         open(IU,file=tempname,status='old',ERR=30)
49
 
         return
50
 
 30      tempname=up//tempname
51
 
         if (i.eq.6)then
52
 
            write(*,*) 'Error: PDF file ',Tablefile,' not found'
53
 
            stop
54
 
         endif
55
 
      enddo
56
 
 
57
 
      print*,'table for the pdf NOT found!!!'
58
 
      
59
 
      return
60
 
      end
61