~maddevelopers/mg5amcnlo/2.9.4

« back to all changes in this revision

Viewing changes to vendor/StdHEP/src/stdhep/stdxropen.F

pass to v2.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      subroutine stdxropen(filename,ntries,istream,lok)
 
2
c
 
3
c  initialize xdr reading
 
4
c
 
5
      implicit none
 
6
#include "mcfio.inc"
 
7
#include "stdlun.inc"
 
8
#include "stdhd.inc"
 
9
      integer istream,lok,ntries
 
10
      character*(*) filename
 
11
 
 
12
      logical lfirst
 
13
      data lfirst/.TRUE./
 
14
      save lfirst
 
15
c
 
16
c      Initialization phase.
 
17
c
 
18
C...print version number if this is the first call
 
19
      if(lfirst)then
 
20
        call stdversn
 
21
        lfirst=.FALSE.
 
22
      endif
 
23
      lok = 0
 
24
      istream = mcfio_OpenReadDirect(filename) 
 
25
      if (istream .eq. -1) go to 900
 
26
      call mcfio_InfoStreamChar(istream,MCFIO_CREATIONDATE,date,dlen)
 
27
      call mcfio_InfoStreamChar(istream,MCFIO_TITLE,title,tlen)
 
28
      call mcfio_InfoStreamChar(istream,MCFIO_COMMENT,comment,clen)
 
29
      call mcfio_InfoStreamInt(istream,MCFIO_NUMEVTS,ntries)
 
30
      call mcfio_InfoStreamInt(istream,MCFIO_NUMBLOCKS,numblocks)
 
31
      call mcfio_InfoStreamInt(istream,MCFIO_BLOCKIDS,blkids)
 
32
      write(lnhout,1001) istream,title(1:tlen),date(1:dlen),
 
33
     1                   comment(1:clen),ntries,numblocks
 
34
      return
 
35
        
 
36
 900  continue
 
37
      write(lnhout,1002)
 
38
      lok = -1
 
39
      stop
 
40
        
 
41
1001  format(/' STDXROPEN: successfully opened input stream ',i5/
 
42
     1       10x,'title: ',a60/
 
43
     2       10x,'date:  ',a60/
 
44
     3       10x,a70/
 
45
     4       20x,i10,' events'/
 
46
     5       20x,i10,' blocks per event'/)
 
47
1002  format(' STDXROPEN: Cannot open input file, give up ')
 
48
      end