~madteam/mg5amcnlo/series2.0

« back to all changes in this revision

Viewing changes to Template/FKS-born/Source/open_file.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
 
      subroutine open_file(lun,filename,fopened)
2
 
c***********************************************************************
3
 
c     opens file input-card.dat in current directory or above
4
 
c***********************************************************************
5
 
      implicit none
6
 
c
7
 
c     Arguments
8
 
c
9
 
      integer lun
10
 
      logical fopened
11
 
      character*(*) filename
12
 
      character*90  tempname
13
 
      integer fine
14
 
      integer i
15
 
      
16
 
c-----
17
 
c  Begin Code
18
 
c-----
19
 
c
20
 
c     first check that we will end in the main directory
21
 
c
22
 
 
23
 
c
24
 
c         if I have to read a card
25
 
c
26
 
 
27
 
      tempname=filename          
28
 
      fine=index(tempname,' ')   
29
 
      if(fine.eq.0) fine=len(tempname)
30
 
 
31
 
      if(index(filename,"_card").gt.0) then
32
 
         tempname='Cards/'//tempname(1:fine)
33
 
         fine=fine+6
34
 
      endif
35
 
      
36
 
      fopened=.false.
37
 
      do i=0,5
38
 
         open(unit=lun,file=tempname,status='old',ERR=30)
39
 
         fopened=.true.
40
 
         exit
41
 
 30      tempname='../'//tempname
42
 
         if (i.eq.5)then
43
 
            write(*,*) 'Warning: file ',filename,' not found'
44
 
         endif
45
 
      enddo
46
 
      end