~maddevelopers/mg5amcnlo/2.7.4_array

« back to all changes in this revision

Viewing changes to models/template_files/fortran/lha_read.f

  • Committer: olivier-mattelaer
  • Date: 2020-03-09 19:05:51 UTC
  • mfrom: (284.1.17 2.7.1)
  • Revision ID: olivier-mattelaer-20200309190551-x8nv2tnob4qmu3om
pass to 2.7.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
201
201
 
202
202
      param(1)=' '
203
203
      value(1)=' '
204
 
 
205
204
      ! Try to open param-card file
206
205
      call LHA_open_file(iunit,param_name,fopened)
207
206
      if(.not.fopened) then
339
338
      integer fine
340
339
      integer dirup,i
341
340
 
 
341
      character*90 lastopen
 
342
      save lastopen
 
343
      data lastopen /''/
 
344
      integer sindex
 
345
      
342
346
c-----
343
347
c     Begin Code
344
348
c-----
347
351
c
348
352
      open(unit=lun,file=filename,status='old',ERR=20)
349
353
c      write(*,*) 'read model file ',filename
 
354
      sindex = INDEX(filename, '/' , .true.)
 
355
      if (sindex.ne.0)then
 
356
         lastopen = filename(1:sindex)
 
357
      endif
350
358
      fopened=.true.
351
359
      return
 
360
 
 
361
 20   if (lastopen(1:2).ne.' ')then
 
362
         fine=index(lastopen,' ')
 
363
         if (fine.ne.0) then
 
364
            tempname = lastopen(1:fine-1)//filename
 
365
         else
 
366
            tempname = lastopen//filename
 
367
         endif
 
368
         open(unit=lun,file=tempname,status='old',ERR=30)
 
369
         fopened=.true.
 
370
         return
 
371
      endif
352
372
      
353
 
20    tempname=filename
 
373
30    tempname=filename
354
374
      fine=index(tempname,' ')
355
375
      if(fine.eq.0) fine=len(tempname)
356
376
      tempname=tempname(1:fine)
363
383
 
364
384
      fopened=.false.
365
385
      do i=0,5
366
 
        open(unit=lun,file=tempname,status='old',ERR=30)
 
386
        open(unit=lun,file=tempname,status='old',ERR=40)
367
387
        fopened=.true.
368
388
c        write(*,*) 'read model file ',tempname
369
389
        exit
370
 
30      tempname='../'//tempname
 
390
40      tempname='../'//tempname
371
391
        if (i.eq.5)then
372
392
           write(*,*) 'Warning: file ',filename,
373
393
     &                           ' not found in the parent directories!(lha_read)'