This repository has been archived by the owner on Feb 22, 2021. It is now read-only.
forked from alisw/POWHEG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloadstorenlo.f
95 lines (89 loc) · 2.47 KB
/
loadstorenlo.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
subroutine openstorenlo(filetag)
implicit none
character * (*) filetag
character * 100 fname
integer iunit
integer innlounit,outnlounit
common/cnlounits/innlounit,outnlounit
call getfilename(filetag,fname)
c inquire(file=fname,exist=present)
call newunit(iunit)
open(unit=iunit,file=fname,access='sequential',
1 form='unformatted',status='new')
innlounit=0
outnlounit=iunit
end
subroutine closeloadstorenlo
implicit none
integer innlounit,outnlounit
common/cnlounits/innlounit,outnlounit
if(innlounit.gt.0) then
close(innlounit)
innlounit=0
endif
if(outnlounit.gt.0) then
close(outnlounit)
outnlounit=0
endif
end
subroutine storenlo(xx)
implicit none
include 'hepevt.h'
real * 8 xx
integer innlounit,outnlounit
common/cnlounits/innlounit,outnlounit
if(outnlounit.gt.0) then
write(outnlounit) nhep
write(outnlounit) idhep(1:nhep),isthep(1:nhep),
1 phep(:,1:nhep),xx
endif
end
subroutine storeendseqnlo
implicit none
include 'hepevt.h'
integer innlounit,outnlounit
common/cnlounits/innlounit,outnlounit
if(outnlounit.gt.0) then
c a negative nhep signals the end of a bunch of correlated events
write(outnlounit) -1
endif
end
subroutine readnlo(xx,iret)
implicit none
include 'hepevt.h'
real * 8 xx
integer iret
integer innlounit,outnlounit
common/cnlounits/innlounit,outnlounit
if(innlounit.gt.0) then
read(innlounit) nhep
if(nhep.eq.-1) then
iret=1
else
read(outnlounit) idhep(1:nhep),isthep(1:nhep),
1 phep(:,1:nhep),xx
iret=0
endif
endif
end
subroutine getfilename(filetag,fname)
implicit none
character *(*) filetag, fname
include 'pwhg_rnd.h'
character * 20 pwgprefix
integer lprefix
common/cpwgprefix/pwgprefix,lprefix
integer ltag,lname
ltag=len(filetag)
lname=len(fname)
1 if(filetag(ltag:ltag).eq.' ') then
ltag=ltag-1
goto 1
endif
if(rnd_cwhichseed.eq.'none') then
fname=pwgprefix(1:lprefix)//filetag(1:ltag)//'.dat'
else
fname=pwgprefix(1:lprefix)//filetag(1:ltag)//'-'//
1 rnd_cwhichseed//'.dat'
endif
end