Merge lp:~maddevelopers/mg5amcnlo/2.6.5_ewa into lp:~mg5core1/mg5amcnlo/2.7.4

Proposed by Olivier Mattelaer on 2021-02-05
Status: Work in progress
Proposed branch: lp:~maddevelopers/mg5amcnlo/2.6.5_ewa
Merge into: lp:~mg5core1/mg5amcnlo/2.7.4
Diff against target: 2653 lines (+2102/-87)
24 files modified
Template/LO/Source/PDF/ElectroweakFlux.f (+1484/-0)
Template/LO/Source/PDF/ElectroweakFlux.inc (+38/-0)
Template/LO/Source/PDF/PhotonFlux.f (+6/-4)
Template/LO/Source/PDF/makefile (+4/-3)
Template/LO/Source/PDF/pdg2pdf.f (+110/-16)
Template/LO/Source/PDF/pdg2pdf_lhapdf6.f (+110/-10)
Template/LO/Source/setrun.f (+2/-3)
Template/LO/SubProcesses/genps.f (+1/-0)
Template/MadWeight/src/setrun.f (+8/-0)
madgraph/core/base_objects.py (+3/-2)
madgraph/interface/common_run_interface.py (+15/-0)
madgraph/interface/madevent_interface.py (+3/-2)
madgraph/iolibs/export_v4.py (+60/-3)
madgraph/iolibs/template_files/auto_dsig_v4.inc (+15/-0)
madgraph/iolibs/template_files/matrix_madevent_group_v4.inc (+2/-15)
madgraph/iolibs/template_files/matrix_madevent_v4.inc (+2/-14)
madgraph/iolibs/template_files/super_auto_dsig_group_v4.inc (+7/-2)
madgraph/various/banner.py (+89/-7)
madgraph/various/cluster.py (+68/-4)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/auto_dsig.f (+30/-0)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/matrix1.f (+3/-0)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/super_auto_dsig.f (+8/-2)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f (+30/-0)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f (+4/-0)
To merge this branch: bzr merge lp:~maddevelopers/mg5amcnlo/2.6.5_ewa
Reviewer Review Type Date Requested Status
mg5core1 2021-02-05 Pending
Review via email: mp+397567@code.launchpad.net
To post a comment you must log in.

put comment for richard

so the important changes are
1) forcing MC over helicity [here simple copy-paste]
2) moving polarization from the parton to the PDF section (when needed--not perfectly done here due to DIS lack of support)
3) include the new PDF [here you should be ok, be carefull with the POL() normalization]
4) will need to worry about the number of helicty allowed for the W (what if only transverse)

Unmerged revisions

307. By olivier-mattelaer on 2020-08-13

merge with 2.7.4

306. By olivier-mattelaer on 2020-06-09

merge with 2.7.2

305. By olivier-mattelaer on 2019-08-22

merge with latest 2.6.7

304. By olivier-mattelaer on 2019-08-22

fix the helicity factor for the Z boson in EWA

303. By olivier-mattelaer on 2019-07-03

allow lhapdf + EWA for pW initial state

302. By olivier-mattelaer on 2019-05-24

merge with latest 2.6.6

301. By olivier-mattelaer on 2019-05-23

fixing some tests

300. By olivier-mattelaer on 2019-05-16

merge with latest 2.6.6

299. By olivier-mattelaer on 2019-05-08

implement EWA for proton collision --thanks to xiaoran

298. By olivier-mattelaer on 2019-05-08

allow EWA for proton

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'Template/LO/Source/PDF/ElectroweakFlux.f'
2--- Template/LO/Source/PDF/ElectroweakFlux.f 1970-01-01 00:00:00 +0000
3+++ Template/LO/Source/PDF/ElectroweakFlux.f 2021-02-05 11:45:49 +0000
4@@ -0,0 +1,1484 @@
5+c/* ********************************************************* */
6+c/* Effective W Approximation Splitting Functions */
7+c/* Pulled from Barger and Phillips, pg 276 */
8+c/* ********************************************************* */
9+c
10+c List of functions:
11+c ewa_wX_ByPID,ewa_wX,ewa_wT,ewa_w0
12+c ewa_zX_ByPID,ewa_zT,ewa_z0
13+c
14+c Input for ewa_vX_ByPID:
15+c x: longitudinal momentum fraction carried by boson v
16+c q2max: scale^2 of v boson pdf
17+c pol: polarization of v boson (pol = +1,-1,0)
18+c ppid: pid of v boson's parent fermion
19+c/* ********************************************************* */
20+
21+c/* ********************************************************* */
22+c return ewa splitting function for w boson by parent PID
23+ double precision function ewa_wX_ByPID(x,q2max,pol,ppid)
24+ implicit none
25+ integer pol,ppid
26+ double precision x,q2max
27+ double precision ewa_wX
28+ double precision ewa_wp_p, ewa_wm_p
29+ external ewa_wX, ewa_wp_p, ewa_wm_p
30+
31+ include 'ElectroweakFlux.inc'
32+
33+ if(q2max.lt.ewa_mw2) then
34+c write (*,*) 'ERROR: q2max below MW2',q2max,ewa_mw2
35+ ewa_wX_ByPID = 0d0
36+ return
37+ endif
38+ if(x.lt.eps .or. x.gt.(1.d0-eps)) then
39+c write (*,*) 'ERROR: x out of range',x
40+ ewa_wX_ByPID =0d0
41+ return
42+ endif
43+
44+c is parent a proton (unbroken)
45+ if(ppid.eq.2212) then
46+ ewa_wX_ByPID = ewa_wp_p(x,q2max,pol)
47+ return
48+ else if(ppid.eq.-2212) then
49+ ewa_wX_ByPID = ewa_wm_p(x,q2max,pol)
50+ return
51+c other particle
52+ else
53+ ewa_wX_ByPID = ewa_wX(x,q2max,pol)
54+ endif
55+ return
56+ end
57+c/* ********************************************************* */
58+c return ewa splitting function for w boson
59+ double precision function ewa_wX(x,q2max,pol)
60+ implicit none
61+ integer pol
62+ double precision x,q2max
63+ double precision ewa_wT,ewa_w0
64+ external ewa_wT,ewa_w0
65+
66+ if(abs(pol).gt.0) then
67+ ewa_wX = ewa_wT(x,q2max,pol)
68+ else
69+ ewa_wX = ewa_w0(x)
70+ endif
71+ return
72+ end
73+c/* ********************************************************* */
74+c return ewa splitting function for z boson by parent PID
75+ double precision function ewa_zX_ByPID(x,q2max,pol,ppid)
76+ implicit none
77+ integer pol,ppid
78+ double precision x,q2max
79+ double precision ewa_zT,ewa_z0, ewa_z_p
80+ external ewa_zT,ewa_z0,ewa_z_p
81+
82+ include 'ElectroweakFlux.inc'
83+
84+ if(q2max.lt.ewa_mz2) then
85+c write (*,*) 'ERROR: q2max below MZ2',q2max,ewa_mz2
86+ ewa_zX_ByPID = 0d0
87+ return
88+ endif
89+ if(x.lt.eps .or. x.gt.(1.d0-eps))then
90+c write (*,*) 'ERROR: x out of range',x
91+ ewa_zX_ByPID = 0d0
92+ return
93+ endif
94+
95+c is parent a charged lepton?
96+ if( abs(ppid).eq.11
97+ & .or. abs(ppid).eq.13
98+ & .or. abs(ppid).eq.15) then
99+ if(abs(pol).gt.0) then
100+ ewa_zX_ByPID = ewa_zT(x,q2max,pol,ewa_gVl,ewa_gAl)
101+ else
102+ ewa_zX_ByPID = ewa_z0(x,ewa_gVl,ewa_gAl)
103+ endif
104+ return
105+c is parent a proton (unbroken)
106+ elseif(ppid.eq.2212) then
107+ ewa_zX_ByPID = ewa_Z_p(x,q2max,pol)
108+ return
109+c is parent a neutrino?
110+ elseif( abs(ppid).eq.12
111+ & .or. abs(ppid).eq.14
112+ & .or. abs(ppid).eq.16) then
113+ if(abs(pol).gt.0) then
114+ ewa_zX_ByPID = ewa_zT(x,q2max,pol,ewa_gVv,ewa_gAv)
115+ else
116+ ewa_zX_ByPID = ewa_z0(x,ewa_gVv,ewa_gAv)
117+ endif
118+ return
119+c is parent an up-type quark?
120+ elseif( abs(ppid).eq.2
121+ & .or. abs(ppid).eq.4
122+ & .or. abs(ppid).eq.6) then
123+ if(abs(pol).gt.0) then
124+ ewa_zX_ByPID = ewa_zT(x,q2max,pol,ewa_gVu,ewa_gAu)
125+ else
126+ ewa_zX_ByPID = ewa_z0(x,ewa_gVu,ewa_gAu)
127+ endif
128+ return
129+c is parent a down-type quark?
130+ elseif( abs(ppid).eq.1
131+ & .or. abs(ppid).eq.3
132+ & .or. abs(ppid).eq.5) then
133+ if(abs(pol).gt.0) then
134+ ewa_zX_ByPID = ewa_zT(x,q2max,pol,ewa_gVd,ewa_gAd)
135+ else
136+ ewa_zX_ByPID = ewa_z0(x,ewa_gVd,ewa_gAd)
137+ endif
138+ return
139+c or something else?
140+ else
141+ ewa_zX_ByPID = 0d0
142+ return
143+ endif
144+ end
145+c/* ********************************************************* */
146+c w boson splitting function: longitudinal polarization
147+ double precision function ewa_w0(x)
148+ implicit none
149+ double precision x
150+ double precision coup
151+
152+ include 'ElectroweakFlux.inc'
153+
154+c P_W(x,lambda=0) = (gW/4pi)**2 (1-x)/x
155+ coup = ewa_gW2/(16d0*pi2)
156+ ewa_w0 = coup * (1d0-x)/x
157+ return
158+ end
159+c/* ********************************************************* */
160+c z boson splitting function: longitudinal polarization
161+ double precision function ewa_z0(x,gV,gA)
162+ implicit none
163+ double precision x,gV,gA
164+ double precision coup
165+
166+ include 'ElectroweakFlux.inc'
167+
168+c P_Z(x,lambda=0) = (gW2/cw2*4pi2) * (gV2 + gA2) (1-x)/x
169+ coup = ewa_gW2/(ewa_cw2*4d0*pi2) * (gV**2 + gA**2)
170+ ewa_z0 = coup * (1d0-x)/x
171+ return
172+ end
173+c/* ********************************************************* */
174+c w boson splitting function: transverse polarization
175+ double precision function ewa_wT(x,q2max,pol)
176+ implicit none
177+ integer pol
178+ double precision x,q2max
179+ double precision coup,numer
180+
181+ include 'ElectroweakFlux.inc'
182+
183+c P_W(x,lambda=\pm) = coup * [(gV \mp gA)^2 + (gV \pm gA)^2 (1-x)^2] * log(Q2/MV2)
184+ coup = ewa_gW2/(8d0*16d0*pi2)
185+ numer = (ewa_gV-pol*ewa_gA)**2
186+ & + (ewa_gV+pol*ewa_gA)**2 * (1d0-x)**2
187+ ewa_wT = coup * numer * log(q2max/ewa_mw2) / x
188+ return
189+ end
190+c/* ********************************************************* */
191+c z boson splitting function: transverse polarization
192+ double precision function ewa_zT(x,q2max,pol,gV,gA)
193+ implicit none
194+ integer pol
195+ double precision x,q2max,gV,gA
196+ double precision coup,numer
197+
198+ include 'ElectroweakFlux.inc'
199+
200+c P_Z(x,lambda=\pm) = coup * [(gV \mp gA)^2 + (gV \pm gA)^2 (1-x)^2] * log(Q2/MV2)
201+ coup = ewa_gW2/(ewa_cw2*16d0*pi2)
202+ numer = (gV-pol*gA)**2
203+ & + (gV+pol*gA)**2 * (1d0-x)**2
204+ ewa_zT = coup * numer * log(q2max/ewa_mz2) / x
205+ return
206+ end
207+ FUNCTION dFINT(NARG,ARG,NENT,ENT,TABLE)
208+C
209+C INTERPOLATION ROUTINE. AUTHOR C. LETERTRE.
210+C MODIFIED BY B. SCHORR, 1.07.1982.
211+C
212+ implicit real * 8 (a-h,o-z)
213+ INTEGER NENT(*)
214+ REAL*8 ARG(*), ENT(*), TABLE(*)
215+ INTEGER INDEX(32)
216+ REAL*8 WEIGHT(32)
217+ LOGICAL MFLAG, RFLAG
218+ DFINT = 0.
219+ IF(NARG .LT. 1 .OR. NARG .GT. 5) GOTO 300
220+ LMAX = 0
221+ ISTEP = 1
222+ KNOTS = 1
223+ INDEX(1) = 1
224+ WEIGHT(1) = 1.
225+ DO 100 N = 1, NARG
226+ X = ARG(N)
227+ NDIM = NENT(N)
228+ LOCA = LMAX
229+ LMIN = LMAX + 1
230+ LMAX = LMAX + NDIM
231+ IF(NDIM .GT. 2) GOTO 10
232+ IF(NDIM .EQ. 1) GOTO 100
233+ H = X - ENT(LMIN)
234+ IF(H .EQ. 0.) GOTO 90
235+ ISHIFT = ISTEP
236+ IF(X-ENT(LMIN+1) .EQ. 0.) GOTO 21
237+ ISHIFT = 0
238+ ETA = H / (ENT(LMIN+1) - ENT(LMIN))
239+ GOTO 30
240+ 10 LOCB = LMAX + 1
241+ 11 LOCC = (LOCA+LOCB) / 2
242+ IF(X-ENT(LOCC)) 12, 20, 13
243+ 12 LOCB = LOCC
244+ GOTO 14
245+ 13 LOCA = LOCC
246+ 14 IF(LOCB-LOCA .GT. 1) GOTO 11
247+ LOCA = MIN0( MAX0(LOCA,LMIN), LMAX-1 )
248+ ISHIFT = (LOCA - LMIN) * ISTEP
249+ ETA = (X - ENT(LOCA)) / (ENT(LOCA+1) - ENT(LOCA))
250+ GOTO 30
251+ 20 ISHIFT = (LOCC - LMIN) * ISTEP
252+ 21 DO 22 K = 1, KNOTS
253+ INDEX(K) = INDEX(K) + ISHIFT
254+ 22 CONTINUE
255+ GOTO 90
256+ 30 DO 31 K = 1, KNOTS
257+ INDEX(K) = INDEX(K) + ISHIFT
258+ INDEX(K+KNOTS) = INDEX(K) + ISTEP
259+ WEIGHT(K+KNOTS) = WEIGHT(K) * ETA
260+ WEIGHT(K) = WEIGHT(K) - WEIGHT(K+KNOTS)
261+ 31 CONTINUE
262+ KNOTS = 2*KNOTS
263+ 90 ISTEP = ISTEP * NDIM
264+ 100 CONTINUE
265+ DO 200 K = 1, KNOTS
266+ I = INDEX(K)
267+ DFINT = DFINT + WEIGHT(K) * TABLE(I)
268+ 200 CONTINUE
269+ RETURN
270+ 300 CALL KERMTR('E104.1',LGFILE,MFLAG,RFLAG)
271+ IF(MFLAG) THEN
272+ IF(LGFILE .EQ. 0) THEN
273+ WRITE(*,1000) NARG
274+ ELSE
275+ WRITE(LGFILE,1000) NARG
276+ ENDIF
277+ ENDIF
278+ IF(.NOT. RFLAG) CALL ABEND
279+ RETURN
280+1000 FORMAT( 7X, 25HFUNCTION DFINT ... NARG =,I6,
281+ + 17H NOT WITHIN RANGE)
282+ END
283+ SUBROUTINE KERSET(ERCODE,LGFILE,LIMITM,LIMITR)
284+ PARAMETER(KOUNTE = 28)
285+ CHARACTER*6 ERCODE, CODE(KOUNTE)
286+ LOGICAL MFLAG, RFLAG
287+ INTEGER KNTM(KOUNTE), KNTR(KOUNTE)
288+ DATA LOGF / 0 /
289+ DATA CODE(1), KNTM(1), KNTR(1) / 'C204.1', 100, 100 /
290+ DATA CODE(2), KNTM(2), KNTR(2) / 'C204.2', 100, 100 /
291+ DATA CODE(3), KNTM(3), KNTR(3) / 'C204.3', 100, 100 /
292+ DATA CODE(4), KNTM(4), KNTR(4) / 'C205.1', 100, 100 /
293+ DATA CODE(5), KNTM(5), KNTR(5) / 'C205.2', 100, 100 /
294+ DATA CODE(6), KNTM(6), KNTR(6) / 'C205.3', 100, 100 /
295+ DATA CODE(7), KNTM(7), KNTR(7) / 'C305.1', 100, 100 /
296+ DATA CODE(8), KNTM(8), KNTR(8) / 'C308.1', 100, 100 /
297+ DATA CODE(9), KNTM(9), KNTR(9) / 'C312.1', 100, 100 /
298+ DATA CODE(10),KNTM(10),KNTR(10) / 'C313.1', 100, 100 /
299+ DATA CODE(11),KNTM(11),KNTR(11) / 'C336.1', 100, 100 /
300+ DATA CODE(12),KNTM(12),KNTR(12) / 'C337.1', 100, 100 /
301+ DATA CODE(13),KNTM(13),KNTR(13) / 'C341.1', 100, 100 /
302+ DATA CODE(14),KNTM(14),KNTR(14) / 'D103.1', 100, 100 /
303+ DATA CODE(15),KNTM(15),KNTR(15) / 'D106.1', 100, 100 /
304+ DATA CODE(16),KNTM(16),KNTR(16) / 'D209.1', 100, 100 /
305+ DATA CODE(17),KNTM(17),KNTR(17) / 'D509.1', 100, 100 /
306+ DATA CODE(18),KNTM(18),KNTR(18) / 'E100.1', 100, 100 /
307+ DATA CODE(19),KNTM(19),KNTR(19) / 'E104.1', 100, 100 /
308+ DATA CODE(20),KNTM(20),KNTR(20) / 'E105.1', 100, 100 /
309+ DATA CODE(21),KNTM(21),KNTR(21) / 'E208.1', 100, 100 /
310+ DATA CODE(22),KNTM(22),KNTR(22) / 'E208.2', 100, 100 /
311+ DATA CODE(23),KNTM(23),KNTR(23) / 'F010.1', 100, 0 /
312+ DATA CODE(24),KNTM(24),KNTR(24) / 'F011.1', 100, 0 /
313+ DATA CODE(25),KNTM(25),KNTR(25) / 'F012.1', 100, 0 /
314+ DATA CODE(26),KNTM(26),KNTR(26) / 'F406.1', 100, 0 /
315+ DATA CODE(27),KNTM(27),KNTR(27) / 'G100.1', 100, 100 /
316+ DATA CODE(28),KNTM(28),KNTR(28) / 'G100.2', 100, 100 /
317+ LOGF = LGFILE
318+ IF(ERCODE .EQ. ' ') THEN
319+ L = 0
320+ ELSE
321+ DO 10 L = 1, 6
322+ IF(ERCODE(1:L) .EQ. ERCODE) GOTO 12
323+ 10 CONTINUE
324+ 12 CONTINUE
325+ ENDIF
326+ DO 14 I = 1, KOUNTE
327+ IF(L .EQ. 0) GOTO 13
328+ IF(CODE(I)(1:L) .NE. ERCODE(1:L)) GOTO 14
329+ 13 KNTM(I) = LIMITM
330+ KNTR(I) = LIMITR
331+ 14 CONTINUE
332+ RETURN
333+ ENTRY KERMTR(ERCODE,LOG,MFLAG,RFLAG)
334+ LOG = LOGF
335+ DO 20 I = 1, KOUNTE
336+ IF(ERCODE .EQ. CODE(I)) GOTO 21
337+ 20 CONTINUE
338+ WRITE(*,1000) ERCODE
339+ CALL ABEND
340+ RETURN
341+ 21 RFLAG = KNTR(I) .GE. 1
342+ IF(RFLAG .AND. (KNTR(I) .LT. 100)) KNTR(I) = KNTR(I) - 1
343+ MFLAG = KNTM(I) .GE. 1
344+ IF(MFLAG .AND. (KNTM(I) .LT. 100)) KNTM(I) = KNTM(I) - 1
345+ IF(.NOT. RFLAG) THEN
346+ IF(LOGF .LT. 1) THEN
347+ WRITE(*,1001) CODE(I)
348+ ELSE
349+ WRITE(LOGF,1001) CODE(I)
350+ ENDIF
351+ ENDIF
352+ IF(MFLAG .AND. RFLAG) THEN
353+ IF(LOGF .LT. 1) THEN
354+ WRITE(*,1002) CODE(I)
355+ ELSE
356+ WRITE(LOGF,1002) CODE(I)
357+ ENDIF
358+ ENDIF
359+ RETURN
360+1000 FORMAT(' KERNLIB LIBRARY ERROR. ' /
361+ + ' ERROR CODE ',A6,' NOT RECOGNIZED BY KERMTR',
362+ + ' ERROR MONITOR. RUN ABORTED.')
363+1001 FORMAT(/' ***** RUN TERMINATED BY CERN LIBRARY ERROR ',
364+ + 'CONDITION ',A6)
365+1002 FORMAT(/' ***** CERN LIBRARY ERROR CONDITION ',A6)
366+ END
367+ SUBROUTINE ABEND
368+C
369+C CERN PROGLIB# Z035 ABEND .VERSION KERNVAX 1.10 811126
370+
371+ STOP '*** ABEND ***'
372+ END
373+ function ewa_wp_p(x,Q2,pol)
374+ implicit none
375+ real*8 ewa_wp_p
376+ real*8 x,Q2
377+ integer pol
378+ real*8 tmp
379+ real*8 y,z
380+ real*8 ylow,yupp,zlow,zupp
381+ parameter (ylow=-16.1181,yupp=-1e-07)
382+ parameter (zlow=4.38683,zupp=13.8155)
383+ real*8 ewa_wp_p_1p
384+ real*8 ewa_wp_p_1m
385+ real*8 ewa_wp_p_0
386+ y=log(x)
387+ z=0.5*log(Q2)
388+ if(pol.eq.1)then
389+ tmp=ewa_wp_p_1p(y,z)
390+ else if(pol.eq.-1)then
391+ tmp=ewa_wp_p_1m(y,z)
392+ else
393+ tmp=ewa_wp_p_0(y,z)
394+ endif
395+ ewa_wp_p=tmp/x*y*y
396+ end
397+ function ewa_wp_p_1p(y,z)
398+ implicit none
399+ real*8 ewa_wp_p_1p,y,z
400+ integer narg,nny,nnz
401+ parameter (narg=2)
402+ parameter (nny=32)
403+ parameter (nnz=8)
404+ integer iny,inz,nent(narg)
405+ real*8 tmp,dfint,ymap,zmap
406+ real*8 arg(narg),ent(nny+nnz)
407+ real*8 yv(nny),zv(nnz),gridv(nny,nnz)
408+ logical firsttime
409+ external dfint,ymap,zmap
410+ data yv/
411+ # -1.6118096e+01, -1.5094991e+01, -1.4105430e+01, -1.3149414e+01,
412+ # -1.2226943e+01, -1.1338015e+01, -1.0482632e+01, -9.6607941e+00,
413+ # -8.8725001e+00, -8.1177506e+00, -7.3965455e+00, -6.7088848e+00,
414+ # -6.0547686e+00, -5.4341967e+00, -4.8471693e+00, -4.2936863e+00,
415+ # -3.7737478e+00, -3.2873536e+00, -2.8345039e+00, -2.4151986e+00,
416+ # -2.0294377e+00, -1.6772213e+00, -1.3585493e+00, -1.0734217e+00,
417+ # -8.2183848e-01, -6.0379973e-01, -4.1930540e-01, -2.6835549e-01,
418+ # -1.5095001e-01, -6.7088947e-02, -1.6772312e-02, -1.0000000e-07/
419+ data zv/
420+ # 4.3868276e+00, 5.7337823e+00, 7.0807370e+00, 8.4276917e+00,
421+ # 9.7746464e+00, 1.1121601e+01, 1.2468556e+01, 1.3815511e+01/
422+ data (gridv(iny, 1),iny=1,32)/
423+ # 3.5423305e-07, 2.8295336e-07, 2.2903220e-07, 1.8758200e-07,
424+ # 1.5559163e-07, 1.3038773e-07, 1.1025515e-07, 9.4027921e-08,
425+ # 8.0829168e-08, 7.0061706e-08, 6.1294211e-08, 5.4182560e-08,
426+ # 4.8450890e-08, 4.3888687e-08, 4.0319491e-08, 3.7580596e-08,
427+ # 3.5520713e-08, 3.3952301e-08, 3.2625426e-08, 3.1187707e-08,
428+ # 2.9181849e-08, 2.6154236e-08, 2.1900372e-08, 1.6640020e-08,
429+ # 1.1099066e-08, 6.2780040e-09, 2.8842540e-09, 1.0025616e-09,
430+ # 2.4219639e-10, 3.2430180e-11, 1.7122412e-12, 4.1237372e-12/
431+ data (gridv(iny, 2),iny=1,32)/
432+ # 9.6800285e-03, 7.5895745e-03, 6.0144129e-03, 4.8116391e-03,
433+ # 3.8906828e-03, 3.1743361e-03, 2.6106310e-03, 2.1637757e-03,
434+ # 1.8068388e-03, 1.5208169e-03, 1.2917371e-03, 1.1084546e-03,
435+ # 9.6221855e-04, 8.4652524e-04, 7.5595982e-04, 6.8586986e-04,
436+ # 6.3206533e-04, 5.8999236e-04, 5.5430903e-04, 5.1815672e-04,
437+ # 4.7362998e-04, 4.1384517e-04, 3.3686600e-04, 2.4790947e-04,
438+ # 1.5951917e-04, 8.6605399e-05, 3.7927081e-05, 1.2444648e-05,
439+ # 2.7972986e-06, 3.3735215e-07, 1.3499999e-08, 3.8170248e-08/
440+ data (gridv(iny, 3),iny=1,32)/
441+ # 2.6802909e-02, 2.0666858e-02, 1.6084293e-02, 1.2619023e-02,
442+ # 9.9957736e-03, 7.9819494e-03, 6.4206742e-03, 5.2026236e-03,
443+ # 4.2458765e-03, 3.4918949e-03, 2.8976082e-03, 2.4290655e-03,
444+ # 2.0601111e-03, 1.7714145e-03, 1.5472491e-03, 1.3744754e-03,
445+ # 1.2417664e-03, 1.1376810e-03, 1.0498817e-03, 9.6384193e-04,
446+ # 8.6434504e-04, 7.3958460e-04, 5.8805171e-04, 4.2143198e-04,
447+ # 2.6317925e-04, 1.3808501e-04, 5.8100243e-05, 1.8168748e-05,
448+ # 3.8451248e-06, 4.2503569e-07, 1.2748665e-08, 4.3387870e-08/
449+ data (gridv(iny, 4),iny=1,32)/
450+ # 5.2421053e-02, 3.9824965e-02, 3.0512558e-02, 2.3545386e-02,
451+ # 1.8330098e-02, 1.4377269e-02, 1.1354532e-02, 9.0302263e-03,
452+ # 7.2316381e-03, 5.8351965e-03, 4.7504014e-03, 3.9068753e-03,
453+ # 3.2509450e-03, 2.7436667e-03, 2.3536072e-03, 2.0551591e-03,
454+ # 1.8269264e-03, 1.6483845e-03, 1.4987780e-03, 1.3553122e-03,
455+ # 1.1959351e-03, 1.0052207e-03, 7.8338419e-04, 5.4881055e-04,
456+ # 3.3404786e-04, 1.7020660e-04, 6.9197187e-05, 2.0763953e-05,
457+ # 4.1724093e-06, 4.2803444e-07, 9.3531305e-09, 3.9817765e-08/
458+ data (gridv(iny, 5),iny=1,32)/
459+ # 8.7314473e-02, 6.5462234e-02, 4.9470387e-02, 3.7629031e-02,
460+ # 2.8860417e-02, 2.2292410e-02, 1.7332180e-02, 1.3567321e-02,
461+ # 1.0692431e-02, 8.4897045e-03, 6.8007137e-03, 5.5036549e-03,
462+ # 4.5068644e-03, 3.7444546e-03, 3.1638216e-03, 2.7231011e-03,
463+ # 2.3880260e-03, 2.1270240e-03, 1.9097372e-03, 1.7046592e-03,
464+ # 1.4833082e-03, 1.2275453e-03, 9.4002916e-04, 6.4560015e-04,
465+ # 3.8423698e-04, 1.9081605e-04, 7.5273640e-05, 2.1785061e-05,
466+ # 4.1829038e-06, 4.0198589e-07, 6.0711799e-09, 3.4349528e-08/
467+ data (gridv(iny, 6),iny=1,32)/
468+ # 1.3235511e-01, 9.8047579e-02, 7.3187600e-02, 5.4960335e-02,
469+ # 4.1600160e-02, 3.1701979e-02, 2.4311750e-02, 1.8768166e-02,
470+ # 1.4585527e-02, 1.1418854e-02, 9.0192598e-03, 7.1973844e-03,
471+ # 5.8123298e-03, 4.7637364e-03, 3.9726338e-03, 3.3768371e-03,
472+ # 2.9266403e-03, 2.5776574e-03, 2.2889023e-03, 2.0198147e-03,
473+ # 1.7358250e-03, 1.4167343e-03, 1.0680290e-03, 7.2056798e-04,
474+ # 4.2032019e-04, 2.0398263e-04, 7.8308169e-05, 2.1899198e-05,
475+ # 4.0241531e-06, 3.6414048e-07, 3.7675413e-09, 2.9031813e-08/
476+ data (gridv(iny, 7),iny=1,32)/
477+ # 1.9057983e-01, 1.3957407e-01, 1.0297250e-01, 7.6391524e-02,
478+ # 5.7105084e-02, 4.2965226e-02, 3.2523923e-02, 2.4779895e-02,
479+ # 1.9003972e-02, 1.4680964e-02, 1.1442346e-02, 9.0104755e-03,
480+ # 7.1810453e-03, 5.8100245e-03, 4.7852651e-03, 4.0196945e-03,
481+ # 3.4450331e-03, 3.0020034e-03, 2.6377816e-03, 2.3022876e-03,
482+ # 1.9551214e-03, 1.5745712e-03, 1.1692227e-03, 7.7537535e-04,
483+ # 4.4359770e-04, 2.1050710e-04, 7.8557363e-05, 2.0871834e-05,
484+ # 3.5743974e-06, 2.9762988e-07, 2.7844229e-09, 2.2782149e-08/
485+ data (gridv(iny, 8),iny=1,32)/
486+ # 2.6712405e-01, 1.9341146e-01, 1.4102973e-01, 1.0336364e-01,
487+ # 7.6305708e-02, 5.6682239e-02, 4.2352056e-02, 3.1846115e-02,
488+ # 2.4101065e-02, 1.8371384e-02, 1.4128575e-02, 1.0978416e-02,
489+ # 8.6341061e-03, 6.8955860e-03, 5.6086588e-03, 4.6555113e-03,
490+ # 3.9452818e-03, 3.4012072e-03, 2.9571084e-03, 2.5527100e-03,
491+ # 2.1419401e-03, 1.7020208e-03, 1.2447953e-03, 8.1123628e-04,
492+ # 4.5515586e-04, 2.1111600e-04, 7.6224092e-05, 1.8396998e-05,
493+ # 2.7018652e-06, 1.8403044e-07, 1.1449565e-09, 1.2394449e-08/
494+ data firsttime/.true./
495+ save
496+ if(firsttime)then
497+ firsttime=.false.
498+ nent(1)=nny
499+ nent(2)=nnz
500+ do iny=1,nny
501+ ent(iny)=(yv(iny))
502+ enddo
503+ do inz=1,nnz
504+ ent(nny+inz)=(zv(inz))
505+ enddo
506+ endif
507+ arg(1)=(y)
508+ arg(2)=(z)
509+ tmp=dfint(narg,arg,nent,ent,gridv)
510+ ewa_wp_p_1p=tmp
511+ return
512+ end
513+ function ewa_wp_p_1m(y,z)
514+ implicit none
515+ real*8 ewa_wp_p_1m,y,z
516+ integer narg,nny,nnz
517+ parameter (narg=2)
518+ parameter (nny=32)
519+ parameter (nnz=8)
520+ integer iny,inz,nent(narg)
521+ real*8 tmp,dfint,ymap,zmap
522+ real*8 arg(narg),ent(nny+nnz)
523+ real*8 yv(nny),zv(nnz),gridv(nny,nnz)
524+ logical firsttime
525+ external dfint,ymap,zmap
526+ data yv/
527+ # -1.6118096e+01, -1.5094991e+01, -1.4105430e+01, -1.3149414e+01,
528+ # -1.2226943e+01, -1.1338015e+01, -1.0482632e+01, -9.6607941e+00,
529+ # -8.8725001e+00, -8.1177506e+00, -7.3965455e+00, -6.7088848e+00,
530+ # -6.0547686e+00, -5.4341967e+00, -4.8471693e+00, -4.2936863e+00,
531+ # -3.7737478e+00, -3.2873536e+00, -2.8345039e+00, -2.4151986e+00,
532+ # -2.0294377e+00, -1.6772213e+00, -1.3585493e+00, -1.0734217e+00,
533+ # -8.2183848e-01, -6.0379973e-01, -4.1930540e-01, -2.6835549e-01,
534+ # -1.5095001e-01, -6.7088947e-02, -1.6772312e-02, -1.0000000e-07/
535+ data zv/
536+ # 4.3868276e+00, 5.7337823e+00, 7.0807370e+00, 8.4276917e+00,
537+ # 9.7746464e+00, 1.1121601e+01, 1.2468556e+01, 1.3815511e+01/
538+ data (gridv(iny, 1),iny=1,32)/
539+ # 2.2352243e-07, 1.7777182e-07, 1.4298652e-07, 1.1622085e-07,
540+ # 9.5328508e-08, 7.8759840e-08, 6.5499586e-08, 5.4802442e-08,
541+ # 4.6136489e-08, 3.9104599e-08, 3.3386967e-08, 2.8725277e-08,
542+ # 2.4905274e-08, 2.1731925e-08, 1.9030359e-08, 1.6631364e-08,
543+ # 1.4386235e-08, 1.2169804e-08, 9.9111740e-09, 7.6254325e-09,
544+ # 5.4230477e-09, 3.4799784e-09, 1.9601523e-09, 9.3903981e-10,
545+ # 3.6862928e-10, 1.1297902e-10, 2.5188758e-11, 3.6724956e-12,
546+ # 2.9351639e-13, 8.1701272e-15, 7.6912480e-17, 6.8729255e-27/
547+ data (gridv(iny, 2),iny=1,32)/
548+ # 5.9726888e-03, 4.6455606e-03, 3.6455128e-03, 2.8853282e-03,
549+ # 2.3012642e-03, 1.8468005e-03, 1.4906859e-03, 1.2098779e-03,
550+ # 9.8764085e-04, 8.1150430e-04, 6.7166904e-04, 5.6040282e-04,
551+ # 4.7152850e-04, 3.9983688e-04, 3.4081959e-04, 2.9051542e-04,
552+ # 2.4549043e-04, 2.0307075e-04, 1.6177240e-04, 1.2167096e-04,
553+ # 8.4473943e-05, 5.2813192e-05, 2.8909650e-05, 1.3417511e-05,
554+ # 5.0832560e-06, 1.4959648e-06, 3.1801753e-07, 4.3791104e-08,
555+ # 3.2498348e-09, 8.1063886e-11, 6.0039546e-13, 6.3617388e-23/
556+ data (gridv(iny, 3),iny=1,32)/
557+ # 1.6219214e-02, 1.2379365e-02, 9.5193091e-03, 7.3739795e-03,
558+ # 5.7510065e-03, 4.5098861e-03, 3.5553416e-03, 2.8172455e-03,
559+ # 2.2446775e-03, 1.7999287e-03, 1.4539007e-03, 1.1841462e-03,
560+ # 9.7322588e-04, 8.0691077e-04, 6.7339686e-04, 5.6275965e-04,
561+ # 4.6677178e-04, 3.7925827e-04, 2.9674760e-04, 2.1907115e-04,
562+ # 1.4910620e-04, 9.1228668e-05, 4.8765008e-05, 2.2043195e-05,
563+ # 8.1072382e-06, 2.3064166e-06, 4.7120345e-07, 6.1862016e-08,
564+ # 4.3153587e-09, 9.8155908e-11, 5.5917625e-13, 7.2313499e-23/
565+ data (gridv(iny, 4),iny=1,32)/
566+ # 3.1188696e-02, 2.3420186e-02, 1.7702079e-02, 1.3467734e-02,
567+ # 1.0309782e-02, 7.9318460e-03, 6.1325773e-03, 4.7646388e-03,
568+ # 3.7215358e-03, 2.9251760e-03, 2.3161962e-03, 1.8496758e-03,
569+ # 1.4912341e-03, 1.2139639e-03, 9.9569551e-04, 8.1869337e-04,
570+ # 6.6868465e-04, 5.3525022e-04, 4.1252936e-04, 2.9977979e-04,
571+ # 2.0061564e-04, 1.2049765e-04, 6.3112103e-05, 2.7890159e-05,
572+ # 1.0000143e-05, 2.7633522e-06, 5.4561380e-07, 6.8754820e-08,
573+ # 4.5477918e-09, 9.5512862e-11, 4.0175364e-13, 6.6363321e-23/
574+ data (gridv(iny, 5),iny=1,32)/
575+ # 5.1182299e-02, 3.7889407e-02, 2.8215137e-02, 2.1136435e-02,
576+ # 1.5925131e-02, 1.2054633e-02, 9.1677464e-03, 7.0050385e-03,
577+ # 5.3803216e-03, 4.1584009e-03, 3.2378903e-03, 2.5431829e-03,
578+ # 2.0176932e-03, 1.6173071e-03, 1.3073170e-03, 1.0602661e-03,
579+ # 8.5475523e-04, 6.7549247e-04, 5.1388835e-04, 3.6836179e-04,
580+ # 2.4290493e-04, 1.4356363e-04, 7.3865824e-05, 3.2002011e-05,
581+ # 1.1221536e-05, 3.0227536e-06, 5.7924224e-07, 7.0416470e-08,
582+ # 4.4455239e-09, 8.7027993e-11, 2.5174163e-13, 5.7249565e-23/
583+ data (gridv(iny, 6),iny=1,32)/
584+ # 7.6557895e-02, 5.5955076e-02, 4.1120172e-02, 3.0385490e-02,
585+ # 2.2576036e-02, 1.6847439e-02, 1.2629288e-02, 9.5105660e-03,
586+ # 7.1985244e-03, 5.4827229e-03, 4.2072308e-03, 3.2573133e-03,
587+ # 2.5483598e-03, 2.0155007e-03, 1.6086767e-03, 1.2891809e-03,
588+ # 1.0274915e-03, 8.0291084e-04, 6.0382880e-04, 4.2759547e-04,
589+ # 2.7827791e-04, 1.6211285e-04, 8.2090171e-05, 3.4938634e-05,
590+ # 1.2008139e-05, 3.1607346e-06, 5.8901727e-07, 6.9129330e-08,
591+ # 4.1796650e-09, 7.6790396e-11, 1.4801921e-13, 4.8386670e-23/
592+ data (gridv(iny, 7),iny=1,32)/
593+ # 1.0885701e-01, 7.8595632e-02, 5.7044003e-02, 4.1606207e-02,
594+ # 3.0510595e-02, 2.2464186e-02, 1.6611725e-02, 1.2338586e-02,
595+ # 9.2105421e-03, 6.9185264e-03, 5.2361582e-03, 3.9989670e-03,
596+ # 3.0873318e-03, 2.4109199e-03, 1.9013023e-03, 1.5064199e-03,
597+ # 1.1876339e-03, 9.1812852e-04, 6.8290918e-04, 4.7797892e-04,
598+ # 3.0715516e-04, 1.7645732e-04, 8.7991353e-05, 3.6807315e-05,
599+ # 1.2399813e-05, 3.1850040e-06, 5.7189229e-07, 6.3166456e-08,
600+ # 3.5998373e-09, 6.0994275e-11, 1.0798487e-13, 3.7970497e-23/
601+ data (gridv(iny, 8),iny=1,32)/
602+ # 1.5068353e-01, 1.0749621e-01, 7.7041842e-02, 5.5476031e-02,
603+ # 4.0143008e-02, 2.9160969e-02, 2.1271437e-02, 1.5583408e-02,
604+ # 1.1472391e-02, 8.4985083e-03, 6.3433700e-03, 4.7785683e-03,
605+ # 3.6402566e-03, 2.8065350e-03, 2.1865589e-03, 1.7127763e-03,
606+ # 1.3356279e-03, 1.0214490e-03, 7.5140048e-04, 5.1978083e-04,
607+ # 3.2977123e-04, 1.8681197e-04, 9.1728471e-05, 3.7697570e-05,
608+ # 1.2430821e-05, 3.1016518e-06, 5.2367878e-07, 5.0603141e-08,
609+ # 2.5423963e-09, 3.4635376e-11, 4.1186342e-14, 2.0657555e-23/
610+ data firsttime/.true./
611+ save
612+ if(firsttime)then
613+ firsttime=.false.
614+ nent(1)=nny
615+ nent(2)=nnz
616+ do iny=1,nny
617+ ent(iny)=(yv(iny))
618+ enddo
619+ do inz=1,nnz
620+ ent(nny+inz)=(zv(inz))
621+ enddo
622+ endif
623+ arg(1)=(y)
624+ arg(2)=(z)
625+ tmp=dfint(narg,arg,nent,ent,gridv)
626+ ewa_wp_p_1m=tmp
627+ return
628+ end
629+ function ewa_wp_p_0(y,z)
630+ implicit none
631+ real*8 ewa_wp_p_0,y,z
632+ integer narg,nny,nnz
633+ parameter (narg=2)
634+ parameter (nny=32)
635+ parameter (nnz=8)
636+ integer iny,inz,nent(narg)
637+ real*8 tmp,dfint,ymap,zmap
638+ real*8 arg(narg),ent(nny+nnz)
639+ real*8 yv(nny),zv(nnz),gridv(nny,nnz)
640+ logical firsttime
641+ external dfint,ymap,zmap
642+ data yv/
643+ # -1.6118096e+01, -1.5094991e+01, -1.4105430e+01, -1.3149414e+01,
644+ # -1.2226943e+01, -1.1338015e+01, -1.0482632e+01, -9.6607941e+00,
645+ # -8.8725001e+00, -8.1177506e+00, -7.3965455e+00, -6.7088848e+00,
646+ # -6.0547686e+00, -5.4341967e+00, -4.8471693e+00, -4.2936863e+00,
647+ # -3.7737478e+00, -3.2873536e+00, -2.8345039e+00, -2.4151986e+00,
648+ # -2.0294377e+00, -1.6772213e+00, -1.3585493e+00, -1.0734217e+00,
649+ # -8.2183848e-01, -6.0379973e-01, -4.1930540e-01, -2.6835549e-01,
650+ # -1.5095001e-01, -6.7088947e-02, -1.6772312e-02, -1.0000000e-07/
651+ data zv/
652+ # 4.3868276e+00, 5.7337823e+00, 7.0807370e+00, 8.4276917e+00,
653+ # 9.7746464e+00, 1.1121601e+01, 1.2468556e+01, 1.3815511e+01/
654+ data (gridv(iny, 1),iny=1,32)/
655+ # 3.5187008e-03, 2.8034859e-03, 2.2605790e-03, 1.8430659e-03,
656+ # 1.5186478e-03, 1.2616393e-03, 1.0560624e-03, 8.9012320e-04,
657+ # 7.5538508e-04, 6.4582892e-04, 5.5671967e-04, 4.8420795e-04,
658+ # 4.2519673e-04, 3.7700036e-04, 3.3717825e-04, 3.0339543e-04,
659+ # 2.7329402e-04, 2.4447706e-04, 2.1469168e-04, 1.8222898e-04,
660+ # 1.4664818e-04, 1.0943422e-04, 7.3828376e-05, 4.3723959e-05,
661+ # 2.1983802e-05, 9.0102753e-06, 2.8448697e-06, 6.3299117e-07,
662+ # 8.7487931e-08, 5.2831049e-09, 1.1568847e-10, 1.8415286e-15/
663+ data (gridv(iny, 2),iny=1,32)/
664+ # 5.2548138e-03, 4.0999760e-03, 3.2295174e-03, 2.5667153e-03,
665+ # 2.0584664e-03, 1.6625476e-03, 1.3517402e-03, 1.1060358e-03,
666+ # 9.1078460e-04, 7.5538896e-04, 6.3160108e-04, 5.3288902e-04,
667+ # 4.5415547e-04, 3.9119341e-04, 3.4038971e-04, 2.9850573e-04,
668+ # 2.6252377e-04, 2.2960220e-04, 1.9724634e-04, 1.6373150e-04,
669+ # 1.2870167e-04, 9.3622734e-05, 6.1405954e-05, 3.5240336e-05,
670+ # 1.7102418e-05, 6.7317976e-06, 2.0267789e-06, 4.2595999e-07,
671+ # 5.4725748e-08, 2.9719851e-09, 4.8981810e-11, 9.4455659e-16/
672+ data (gridv(iny, 3),iny=1,32)/
673+ # 7.1876070e-03, 5.5076672e-03, 4.2546965e-03, 3.3120537e-03,
674+ # 2.5990113e-03, 2.0524391e-03, 1.6307512e-03, 1.3034276e-03,
675+ # 1.0481689e-03, 8.4882548e-04, 6.9291048e-04, 5.7083971e-04,
676+ # 4.7522642e-04, 4.0016654e-04, 3.4076979e-04, 2.9285118e-04,
677+ # 2.5271536e-04, 2.1707747e-04, 1.8321030e-04, 1.4933939e-04,
678+ # 1.1513883e-04, 8.2005502e-05, 5.2541044e-05, 2.9373325e-05,
679+ # 1.3840817e-05, 5.2672006e-06, 1.5241105e-06, 3.0542392e-07,
680+ # 3.6915891e-08, 1.8347912e-09, 2.2114402e-11, 5.3685066e-16/
681+ data (gridv(iny, 4),iny=1,32)/
682+ # 9.2731430e-03, 6.9948236e-03, 5.3144732e-03, 4.0652903e-03,
683+ # 3.1328132e-03, 2.4282484e-03, 1.8929862e-03, 1.4841263e-03,
684+ # 1.1704474e-03, 9.2943341e-04, 7.4399977e-04, 6.0109301e-04,
685+ # 4.9092271e-04, 4.0580385e-04, 3.3953903e-04, 2.8700023e-04,
686+ # 2.4383801e-04, 2.0634913e-04, 1.7159359e-04, 1.3773971e-04,
687+ # 1.0446314e-04, 7.3071554e-05, 4.5887405e-05, 2.5084061e-05,
688+ # 1.1524443e-05, 4.2604502e-06, 1.1914778e-06, 2.2920043e-07,
689+ # 2.6286612e-08, 1.2107299e-09, 1.0080946e-11, 3.2845426e-16/
690+ data (gridv(iny, 5),iny=1,32)/
691+ # 1.1477138e-02, 8.5381747e-03, 6.3939961e-03, 4.8178867e-03,
692+ # 3.6556258e-03, 2.7887348e-03, 2.1392407e-03, 1.6500181e-03,
693+ # 1.2800074e-03, 9.9975891e-04, 7.8717888e-04, 6.2562654e-04,
694+ # 5.0280633e-04, 4.0921770e-04, 3.3736136e-04, 2.8121172e-04,
695+ # 2.3579394e-04, 1.9702349e-04, 1.6176823e-04, 1.2814066e-04,
696+ # 9.5802895e-05, 6.5966820e-05, 4.0705648e-05, 2.1818543e-05,
697+ # 9.8043554e-06, 3.5336308e-06, 9.5911504e-07, 1.7800578e-07,
698+ # 1.9496528e-08, 8.4002050e-10, 4.3204403e-12, 2.1251138e-16/
699+ data (gridv(iny, 6),iny=1,32)/
700+ # 1.3802612e-02, 1.0141026e-02, 7.4971127e-03, 5.5741476e-03,
701+ # 4.1720271e-03, 3.1386776e-03, 2.3737894e-03, 1.8049673e-03,
702+ # 1.3802137e-03, 1.0625971e-03, 8.2471236e-04, 6.4617450e-04,
703+ # 5.1210721e-04, 4.1120934e-04, 3.3467950e-04, 2.7561780e-04,
704+ # 2.2846603e-04, 1.8878732e-04, 1.5327653e-04, 1.1999194e-04,
705+ # 8.8573452e-05, 6.0136140e-05, 3.6529669e-05, 1.9238247e-05,
706+ # 8.4746327e-06, 2.9853000e-06, 7.8837418e-07, 1.4128313e-07,
707+ # 1.4820095e-08, 6.0070190e-10, 1.7185758e-12, 1.4369011e-16/
708+ data (gridv(iny, 7),iny=1,32)/
709+ # 1.6432308e-02, 1.1930946e-02, 8.7133575e-03, 6.3970356e-03,
710+ # 4.7264435e-03, 3.5091707e-03, 2.6187361e-03, 1.9645111e-03,
711+ # 1.4819077e-03, 1.1254264e-03, 8.6166780e-04, 6.6606423e-04,
712+ # 5.2091794e-04, 4.1296488e-04, 3.3203523e-04, 2.7031018e-04,
713+ # 2.2163224e-04, 1.8120725e-04, 1.4555330e-04, 1.1266604e-04,
714+ # 8.2152609e-05, 5.5024591e-05, 3.2922540e-05, 1.7044970e-05,
715+ # 7.3639505e-06, 2.5349841e-06, 6.4817141e-07, 1.0938699e-07,
716+ # 1.0789142e-08, 4.0267815e-10, 9.9738412e-13, 9.3965182e-17/
717+ data (gridv(iny, 8),iny=1,32)/
718+ # 1.9588443e-02, 1.4054534e-02, 1.0140342e-02, 7.3511754e-03,
719+ # 5.3617513e-03, 3.9285711e-03, 2.8927241e-03, 2.1409034e-03,
720+ # 1.5930991e-03, 1.1934393e-03, 9.0134688e-04, 6.8734040e-04,
721+ # 5.3043871e-04, 4.1513075e-04, 3.2970284e-04, 2.6531895e-04,
722+ # 2.1516289e-04, 1.7405250e-04, 1.3830950e-04, 1.0585100e-04,
723+ # 7.6238215e-05, 5.0368640e-05, 2.9681423e-05, 1.5103253e-05,
724+ # 6.3960840e-06, 2.1473293e-06, 5.2444493e-07, 7.7848289e-08,
725+ # 6.7448840e-09, 2.0379331e-10, 2.3209743e-13, 4.3818080e-17/
726+ data firsttime/.true./
727+ save
728+ if(firsttime)then
729+ firsttime=.false.
730+ nent(1)=nny
731+ nent(2)=nnz
732+ do iny=1,nny
733+ ent(iny)=(yv(iny))
734+ enddo
735+ do inz=1,nnz
736+ ent(nny+inz)=(zv(inz))
737+ enddo
738+ endif
739+ arg(1)=(y)
740+ arg(2)=(z)
741+ tmp=dfint(narg,arg,nent,ent,gridv)
742+ ewa_wp_p_0=tmp
743+ return
744+ end
745+ function ewa_wm_p(x,Q2,pol)
746+ implicit none
747+ real*8 ewa_wm_p
748+ real*8 x,Q2
749+ integer pol
750+ real*8 tmp
751+ real*8 y,z
752+ real*8 ylow,yupp,zlow,zupp
753+ parameter (ylow=-16.1181,yupp=-1e-07)
754+ parameter (zlow=4.38683,zupp=13.8155)
755+ real*8 ewa_wm_p_1p
756+ real*8 ewa_wm_p_1m
757+ real*8 ewa_wm_p_0
758+ y=log(x)
759+ z=0.5*log(Q2)
760+ if(pol.eq.1)then
761+ tmp=ewa_wm_p_1p(y,z)
762+ else if(pol.eq.-1)then
763+ tmp=ewa_wm_p_1m(y,z)
764+ else
765+ tmp=ewa_wm_p_0(y,z)
766+ endif
767+ ewa_wm_p=tmp/x*y*y
768+ end
769+ function ewa_wm_p_1p(y,z)
770+ implicit none
771+ real*8 ewa_wm_p_1p,y,z
772+ integer narg,nny,nnz
773+ parameter (narg=2)
774+ parameter (nny=32)
775+ parameter (nnz=8)
776+ integer iny,inz,nent(narg)
777+ real*8 tmp,dfint,ymap,zmap
778+ real*8 arg(narg),ent(nny+nnz)
779+ real*8 yv(nny),zv(nnz),gridv(nny,nnz)
780+ logical firsttime
781+ external dfint,ymap,zmap
782+ data yv/
783+ # -1.6118096e+01, -1.5094991e+01, -1.4105430e+01, -1.3149414e+01,
784+ # -1.2226943e+01, -1.1338015e+01, -1.0482632e+01, -9.6607941e+00,
785+ # -8.8725001e+00, -8.1177506e+00, -7.3965455e+00, -6.7088848e+00,
786+ # -6.0547686e+00, -5.4341967e+00, -4.8471693e+00, -4.2936863e+00,
787+ # -3.7737478e+00, -3.2873536e+00, -2.8345039e+00, -2.4151986e+00,
788+ # -2.0294377e+00, -1.6772213e+00, -1.3585493e+00, -1.0734217e+00,
789+ # -8.2183848e-01, -6.0379973e-01, -4.1930540e-01, -2.6835549e-01,
790+ # -1.5095001e-01, -6.7088947e-02, -1.6772312e-02, -1.0000000e-07/
791+ data zv/
792+ # 4.3868276e+00, 5.7337823e+00, 7.0807370e+00, 8.4276917e+00,
793+ # 9.7746464e+00, 1.1121601e+01, 1.2468556e+01, 1.3815511e+01/
794+ data (gridv(iny, 1),iny=1,32)/
795+ # 3.5423305e-07, 2.8295336e-07, 2.2903220e-07, 1.8758200e-07,
796+ # 1.5559163e-07, 1.3038773e-07, 1.1025515e-07, 9.4027921e-08,
797+ # 8.0829168e-08, 7.0061706e-08, 6.1294211e-08, 5.4182560e-08,
798+ # 4.8450890e-08, 4.3888687e-08, 4.0319491e-08, 3.7580596e-08,
799+ # 3.5520713e-08, 3.3952301e-08, 3.2625426e-08, 3.1187707e-08,
800+ # 2.9181849e-08, 2.6154236e-08, 2.1900372e-08, 1.6640020e-08,
801+ # 1.1099066e-08, 6.2780040e-09, 2.8842540e-09, 1.0025616e-09,
802+ # 2.4219639e-10, 3.2430180e-11, 1.7122412e-12, 4.1237372e-12/
803+ data (gridv(iny, 2),iny=1,32)/
804+ # 9.6800285e-03, 7.5895745e-03, 6.0144129e-03, 4.8116391e-03,
805+ # 3.8906828e-03, 3.1743361e-03, 2.6106310e-03, 2.1637757e-03,
806+ # 1.8068388e-03, 1.5208169e-03, 1.2917371e-03, 1.1084546e-03,
807+ # 9.6221855e-04, 8.4652524e-04, 7.5595982e-04, 6.8586986e-04,
808+ # 6.3206533e-04, 5.8999236e-04, 5.5430903e-04, 5.1815672e-04,
809+ # 4.7362998e-04, 4.1384517e-04, 3.3686600e-04, 2.4790947e-04,
810+ # 1.5951917e-04, 8.6605399e-05, 3.7927081e-05, 1.2444648e-05,
811+ # 2.7972986e-06, 3.3735215e-07, 1.3499999e-08, 3.8170248e-08/
812+ data (gridv(iny, 3),iny=1,32)/
813+ # 2.6802909e-02, 2.0666858e-02, 1.6084293e-02, 1.2619023e-02,
814+ # 9.9957736e-03, 7.9819494e-03, 6.4206742e-03, 5.2026236e-03,
815+ # 4.2458765e-03, 3.4918949e-03, 2.8976082e-03, 2.4290655e-03,
816+ # 2.0601111e-03, 1.7714145e-03, 1.5472491e-03, 1.3744754e-03,
817+ # 1.2417664e-03, 1.1376810e-03, 1.0498817e-03, 9.6384193e-04,
818+ # 8.6434504e-04, 7.3958460e-04, 5.8805171e-04, 4.2143198e-04,
819+ # 2.6317925e-04, 1.3808501e-04, 5.8100243e-05, 1.8168748e-05,
820+ # 3.8451248e-06, 4.2503569e-07, 1.2748665e-08, 4.3387870e-08/
821+ data (gridv(iny, 4),iny=1,32)/
822+ # 5.2421053e-02, 3.9824965e-02, 3.0512558e-02, 2.3545386e-02,
823+ # 1.8330098e-02, 1.4377269e-02, 1.1354532e-02, 9.0302263e-03,
824+ # 7.2316381e-03, 5.8351965e-03, 4.7504014e-03, 3.9068753e-03,
825+ # 3.2509450e-03, 2.7436667e-03, 2.3536072e-03, 2.0551591e-03,
826+ # 1.8269264e-03, 1.6483845e-03, 1.4987780e-03, 1.3553122e-03,
827+ # 1.1959351e-03, 1.0052207e-03, 7.8338419e-04, 5.4881055e-04,
828+ # 3.3404786e-04, 1.7020660e-04, 6.9197187e-05, 2.0763953e-05,
829+ # 4.1724093e-06, 4.2803444e-07, 9.3531305e-09, 3.9817765e-08/
830+ data (gridv(iny, 5),iny=1,32)/
831+ # 8.7314473e-02, 6.5462234e-02, 4.9470387e-02, 3.7629031e-02,
832+ # 2.8860417e-02, 2.2292410e-02, 1.7332180e-02, 1.3567321e-02,
833+ # 1.0692431e-02, 8.4897045e-03, 6.8007137e-03, 5.5036549e-03,
834+ # 4.5068644e-03, 3.7444546e-03, 3.1638216e-03, 2.7231011e-03,
835+ # 2.3880260e-03, 2.1270240e-03, 1.9097372e-03, 1.7046592e-03,
836+ # 1.4833082e-03, 1.2275453e-03, 9.4002916e-04, 6.4560015e-04,
837+ # 3.8423698e-04, 1.9081605e-04, 7.5273640e-05, 2.1785061e-05,
838+ # 4.1829038e-06, 4.0198589e-07, 6.0711799e-09, 3.4349528e-08/
839+ data (gridv(iny, 6),iny=1,32)/
840+ # 1.3235511e-01, 9.8047579e-02, 7.3187600e-02, 5.4960335e-02,
841+ # 4.1600160e-02, 3.1701979e-02, 2.4311750e-02, 1.8768166e-02,
842+ # 1.4585527e-02, 1.1418854e-02, 9.0192598e-03, 7.1973844e-03,
843+ # 5.8123298e-03, 4.7637364e-03, 3.9726338e-03, 3.3768371e-03,
844+ # 2.9266403e-03, 2.5776574e-03, 2.2889023e-03, 2.0198147e-03,
845+ # 1.7358250e-03, 1.4167343e-03, 1.0680290e-03, 7.2056798e-04,
846+ # 4.2032019e-04, 2.0398263e-04, 7.8308169e-05, 2.1899198e-05,
847+ # 4.0241531e-06, 3.6414048e-07, 3.7675413e-09, 2.9031813e-08/
848+ data (gridv(iny, 7),iny=1,32)/
849+ # 1.9057983e-01, 1.3957407e-01, 1.0297250e-01, 7.6391524e-02,
850+ # 5.7105084e-02, 4.2965226e-02, 3.2523923e-02, 2.4779895e-02,
851+ # 1.9003972e-02, 1.4680964e-02, 1.1442346e-02, 9.0104755e-03,
852+ # 7.1810453e-03, 5.8100245e-03, 4.7852651e-03, 4.0196945e-03,
853+ # 3.4450331e-03, 3.0020034e-03, 2.6377816e-03, 2.3022876e-03,
854+ # 1.9551214e-03, 1.5745712e-03, 1.1692227e-03, 7.7537535e-04,
855+ # 4.4359770e-04, 2.1050710e-04, 7.8557363e-05, 2.0871834e-05,
856+ # 3.5743974e-06, 2.9762988e-07, 2.7844229e-09, 2.2782149e-08/
857+ data (gridv(iny, 8),iny=1,32)/
858+ # 2.6712405e-01, 1.9341146e-01, 1.4102973e-01, 1.0336364e-01,
859+ # 7.6305708e-02, 5.6682239e-02, 4.2352056e-02, 3.1846115e-02,
860+ # 2.4101065e-02, 1.8371384e-02, 1.4128575e-02, 1.0978416e-02,
861+ # 8.6341061e-03, 6.8955860e-03, 5.6086588e-03, 4.6555113e-03,
862+ # 3.9452818e-03, 3.4012072e-03, 2.9571084e-03, 2.5527100e-03,
863+ # 2.1419401e-03, 1.7020208e-03, 1.2447953e-03, 8.1123628e-04,
864+ # 4.5515586e-04, 2.1111600e-04, 7.6224092e-05, 1.8396998e-05,
865+ # 2.7018652e-06, 1.8403044e-07, 1.1449565e-09, 1.2394449e-08/
866+ data firsttime/.true./
867+ save
868+ if(firsttime)then
869+ firsttime=.false.
870+ nent(1)=nny
871+ nent(2)=nnz
872+ do iny=1,nny
873+ ent(iny)=(yv(iny))
874+ enddo
875+ do inz=1,nnz
876+ ent(nny+inz)=(zv(inz))
877+ enddo
878+ endif
879+ arg(1)=(y)
880+ arg(2)=(z)
881+ tmp=dfint(narg,arg,nent,ent,gridv)
882+ ewa_wm_p_1p=tmp
883+ return
884+ end
885+ function ewa_wm_p_1m(y,z)
886+ implicit none
887+ real*8 ewa_wm_p_1m,y,z
888+ integer narg,nny,nnz
889+ parameter (narg=2)
890+ parameter (nny=32)
891+ parameter (nnz=8)
892+ integer iny,inz,nent(narg)
893+ real*8 tmp,dfint,ymap,zmap
894+ real*8 arg(narg),ent(nny+nnz)
895+ real*8 yv(nny),zv(nnz),gridv(nny,nnz)
896+ logical firsttime
897+ external dfint,ymap,zmap
898+ data yv/
899+ # -1.6118096e+01, -1.5094991e+01, -1.4105430e+01, -1.3149414e+01,
900+ # -1.2226943e+01, -1.1338015e+01, -1.0482632e+01, -9.6607941e+00,
901+ # -8.8725001e+00, -8.1177506e+00, -7.3965455e+00, -6.7088848e+00,
902+ # -6.0547686e+00, -5.4341967e+00, -4.8471693e+00, -4.2936863e+00,
903+ # -3.7737478e+00, -3.2873536e+00, -2.8345039e+00, -2.4151986e+00,
904+ # -2.0294377e+00, -1.6772213e+00, -1.3585493e+00, -1.0734217e+00,
905+ # -8.2183848e-01, -6.0379973e-01, -4.1930540e-01, -2.6835549e-01,
906+ # -1.5095001e-01, -6.7088947e-02, -1.6772312e-02, -1.0000000e-07/
907+ data zv/
908+ # 4.3868276e+00, 5.7337823e+00, 7.0807370e+00, 8.4276917e+00,
909+ # 9.7746464e+00, 1.1121601e+01, 1.2468556e+01, 1.3815511e+01/
910+ data (gridv(iny, 1),iny=1,32)/
911+ # 2.2352243e-07, 1.7777182e-07, 1.4298652e-07, 1.1622085e-07,
912+ # 9.5328508e-08, 7.8759840e-08, 6.5499586e-08, 5.4802442e-08,
913+ # 4.6136489e-08, 3.9104599e-08, 3.3386967e-08, 2.8725277e-08,
914+ # 2.4905274e-08, 2.1731925e-08, 1.9030359e-08, 1.6631364e-08,
915+ # 1.4386235e-08, 1.2169804e-08, 9.9111740e-09, 7.6254325e-09,
916+ # 5.4230477e-09, 3.4799784e-09, 1.9601523e-09, 9.3903981e-10,
917+ # 3.6862928e-10, 1.1297902e-10, 2.5188758e-11, 3.6724956e-12,
918+ # 2.9351639e-13, 8.1701272e-15, 7.6912480e-17, 6.8729255e-27/
919+ data (gridv(iny, 2),iny=1,32)/
920+ # 5.9726888e-03, 4.6455606e-03, 3.6455128e-03, 2.8853282e-03,
921+ # 2.3012642e-03, 1.8468005e-03, 1.4906859e-03, 1.2098779e-03,
922+ # 9.8764085e-04, 8.1150430e-04, 6.7166904e-04, 5.6040282e-04,
923+ # 4.7152850e-04, 3.9983688e-04, 3.4081959e-04, 2.9051542e-04,
924+ # 2.4549043e-04, 2.0307075e-04, 1.6177240e-04, 1.2167096e-04,
925+ # 8.4473943e-05, 5.2813192e-05, 2.8909650e-05, 1.3417511e-05,
926+ # 5.0832560e-06, 1.4959648e-06, 3.1801753e-07, 4.3791104e-08,
927+ # 3.2498348e-09, 8.1063886e-11, 6.0039546e-13, 6.3617388e-23/
928+ data (gridv(iny, 3),iny=1,32)/
929+ # 1.6219214e-02, 1.2379365e-02, 9.5193091e-03, 7.3739795e-03,
930+ # 5.7510065e-03, 4.5098861e-03, 3.5553416e-03, 2.8172455e-03,
931+ # 2.2446775e-03, 1.7999287e-03, 1.4539007e-03, 1.1841462e-03,
932+ # 9.7322588e-04, 8.0691077e-04, 6.7339686e-04, 5.6275965e-04,
933+ # 4.6677178e-04, 3.7925827e-04, 2.9674760e-04, 2.1907115e-04,
934+ # 1.4910620e-04, 9.1228668e-05, 4.8765008e-05, 2.2043195e-05,
935+ # 8.1072382e-06, 2.3064166e-06, 4.7120345e-07, 6.1862016e-08,
936+ # 4.3153587e-09, 9.8155908e-11, 5.5917625e-13, 7.2313499e-23/
937+ data (gridv(iny, 4),iny=1,32)/
938+ # 3.1188696e-02, 2.3420186e-02, 1.7702079e-02, 1.3467734e-02,
939+ # 1.0309782e-02, 7.9318460e-03, 6.1325773e-03, 4.7646388e-03,
940+ # 3.7215358e-03, 2.9251760e-03, 2.3161962e-03, 1.8496758e-03,
941+ # 1.4912341e-03, 1.2139639e-03, 9.9569551e-04, 8.1869337e-04,
942+ # 6.6868465e-04, 5.3525022e-04, 4.1252936e-04, 2.9977979e-04,
943+ # 2.0061564e-04, 1.2049765e-04, 6.3112103e-05, 2.7890159e-05,
944+ # 1.0000143e-05, 2.7633522e-06, 5.4561380e-07, 6.8754820e-08,
945+ # 4.5477918e-09, 9.5512862e-11, 4.0175364e-13, 6.6363321e-23/
946+ data (gridv(iny, 5),iny=1,32)/
947+ # 5.1182299e-02, 3.7889407e-02, 2.8215137e-02, 2.1136435e-02,
948+ # 1.5925131e-02, 1.2054633e-02, 9.1677464e-03, 7.0050385e-03,
949+ # 5.3803216e-03, 4.1584009e-03, 3.2378903e-03, 2.5431829e-03,
950+ # 2.0176932e-03, 1.6173071e-03, 1.3073170e-03, 1.0602661e-03,
951+ # 8.5475523e-04, 6.7549247e-04, 5.1388835e-04, 3.6836179e-04,
952+ # 2.4290493e-04, 1.4356363e-04, 7.3865824e-05, 3.2002011e-05,
953+ # 1.1221536e-05, 3.0227536e-06, 5.7924224e-07, 7.0416470e-08,
954+ # 4.4455239e-09, 8.7027993e-11, 2.5174163e-13, 5.7249565e-23/
955+ data (gridv(iny, 6),iny=1,32)/
956+ # 7.6557895e-02, 5.5955076e-02, 4.1120172e-02, 3.0385490e-02,
957+ # 2.2576036e-02, 1.6847439e-02, 1.2629288e-02, 9.5105660e-03,
958+ # 7.1985244e-03, 5.4827229e-03, 4.2072308e-03, 3.2573133e-03,
959+ # 2.5483598e-03, 2.0155007e-03, 1.6086767e-03, 1.2891809e-03,
960+ # 1.0274915e-03, 8.0291084e-04, 6.0382880e-04, 4.2759547e-04,
961+ # 2.7827791e-04, 1.6211285e-04, 8.2090171e-05, 3.4938634e-05,
962+ # 1.2008139e-05, 3.1607346e-06, 5.8901727e-07, 6.9129330e-08,
963+ # 4.1796650e-09, 7.6790396e-11, 1.4801921e-13, 4.8386670e-23/
964+ data (gridv(iny, 7),iny=1,32)/
965+ # 1.0885701e-01, 7.8595632e-02, 5.7044003e-02, 4.1606207e-02,
966+ # 3.0510595e-02, 2.2464186e-02, 1.6611725e-02, 1.2338586e-02,
967+ # 9.2105421e-03, 6.9185264e-03, 5.2361582e-03, 3.9989670e-03,
968+ # 3.0873318e-03, 2.4109199e-03, 1.9013023e-03, 1.5064199e-03,
969+ # 1.1876339e-03, 9.1812852e-04, 6.8290918e-04, 4.7797892e-04,
970+ # 3.0715516e-04, 1.7645732e-04, 8.7991353e-05, 3.6807315e-05,
971+ # 1.2399813e-05, 3.1850040e-06, 5.7189229e-07, 6.3166456e-08,
972+ # 3.5998373e-09, 6.0994275e-11, 1.0798487e-13, 3.7970497e-23/
973+ data (gridv(iny, 8),iny=1,32)/
974+ # 1.5068353e-01, 1.0749621e-01, 7.7041842e-02, 5.5476031e-02,
975+ # 4.0143008e-02, 2.9160969e-02, 2.1271437e-02, 1.5583408e-02,
976+ # 1.1472391e-02, 8.4985083e-03, 6.3433700e-03, 4.7785683e-03,
977+ # 3.6402566e-03, 2.8065350e-03, 2.1865589e-03, 1.7127763e-03,
978+ # 1.3356279e-03, 1.0214490e-03, 7.5140048e-04, 5.1978083e-04,
979+ # 3.2977123e-04, 1.8681197e-04, 9.1728471e-05, 3.7697570e-05,
980+ # 1.2430821e-05, 3.1016518e-06, 5.2367878e-07, 5.0603141e-08,
981+ # 2.5423963e-09, 3.4635376e-11, 4.1186342e-14, 2.0657555e-23/
982+ data firsttime/.true./
983+ save
984+ if(firsttime)then
985+ firsttime=.false.
986+ nent(1)=nny
987+ nent(2)=nnz
988+ do iny=1,nny
989+ ent(iny)=(yv(iny))
990+ enddo
991+ do inz=1,nnz
992+ ent(nny+inz)=(zv(inz))
993+ enddo
994+ endif
995+ arg(1)=(y)
996+ arg(2)=(z)
997+ tmp=dfint(narg,arg,nent,ent,gridv)
998+ ewa_wm_p_1m=tmp
999+ return
1000+ end
1001+ function ewa_wm_p_0(y,z)
1002+ implicit none
1003+ real*8 ewa_wm_p_0,y,z
1004+ integer narg,nny,nnz
1005+ parameter (narg=2)
1006+ parameter (nny=32)
1007+ parameter (nnz=8)
1008+ integer iny,inz,nent(narg)
1009+ real*8 tmp,dfint,ymap,zmap
1010+ real*8 arg(narg),ent(nny+nnz)
1011+ real*8 yv(nny),zv(nnz),gridv(nny,nnz)
1012+ logical firsttime
1013+ external dfint,ymap,zmap
1014+ data yv/
1015+ # -1.6118096e+01, -1.5094991e+01, -1.4105430e+01, -1.3149414e+01,
1016+ # -1.2226943e+01, -1.1338015e+01, -1.0482632e+01, -9.6607941e+00,
1017+ # -8.8725001e+00, -8.1177506e+00, -7.3965455e+00, -6.7088848e+00,
1018+ # -6.0547686e+00, -5.4341967e+00, -4.8471693e+00, -4.2936863e+00,
1019+ # -3.7737478e+00, -3.2873536e+00, -2.8345039e+00, -2.4151986e+00,
1020+ # -2.0294377e+00, -1.6772213e+00, -1.3585493e+00, -1.0734217e+00,
1021+ # -8.2183848e-01, -6.0379973e-01, -4.1930540e-01, -2.6835549e-01,
1022+ # -1.5095001e-01, -6.7088947e-02, -1.6772312e-02, -1.0000000e-07/
1023+ data zv/
1024+ # 4.3868276e+00, 5.7337823e+00, 7.0807370e+00, 8.4276917e+00,
1025+ # 9.7746464e+00, 1.1121601e+01, 1.2468556e+01, 1.3815511e+01/
1026+ data (gridv(iny, 1),iny=1,32)/
1027+ # 3.5187008e-03, 2.8034859e-03, 2.2605790e-03, 1.8430659e-03,
1028+ # 1.5186478e-03, 1.2616393e-03, 1.0560624e-03, 8.9012320e-04,
1029+ # 7.5538508e-04, 6.4582892e-04, 5.5671967e-04, 4.8420795e-04,
1030+ # 4.2519673e-04, 3.7700036e-04, 3.3717825e-04, 3.0339543e-04,
1031+ # 2.7329402e-04, 2.4447706e-04, 2.1469168e-04, 1.8222898e-04,
1032+ # 1.4664818e-04, 1.0943422e-04, 7.3828376e-05, 4.3723959e-05,
1033+ # 2.1983802e-05, 9.0102753e-06, 2.8448697e-06, 6.3299117e-07,
1034+ # 8.7487931e-08, 5.2831049e-09, 1.1568847e-10, 1.8415286e-15/
1035+ data (gridv(iny, 2),iny=1,32)/
1036+ # 5.2548138e-03, 4.0999760e-03, 3.2295174e-03, 2.5667153e-03,
1037+ # 2.0584664e-03, 1.6625476e-03, 1.3517402e-03, 1.1060358e-03,
1038+ # 9.1078460e-04, 7.5538896e-04, 6.3160108e-04, 5.3288902e-04,
1039+ # 4.5415547e-04, 3.9119341e-04, 3.4038971e-04, 2.9850573e-04,
1040+ # 2.6252377e-04, 2.2960220e-04, 1.9724634e-04, 1.6373150e-04,
1041+ # 1.2870167e-04, 9.3622734e-05, 6.1405954e-05, 3.5240336e-05,
1042+ # 1.7102418e-05, 6.7317976e-06, 2.0267789e-06, 4.2595999e-07,
1043+ # 5.4725748e-08, 2.9719851e-09, 4.8981810e-11, 9.4455659e-16/
1044+ data (gridv(iny, 3),iny=1,32)/
1045+ # 7.1876070e-03, 5.5076672e-03, 4.2546965e-03, 3.3120537e-03,
1046+ # 2.5990113e-03, 2.0524391e-03, 1.6307512e-03, 1.3034276e-03,
1047+ # 1.0481689e-03, 8.4882548e-04, 6.9291048e-04, 5.7083971e-04,
1048+ # 4.7522642e-04, 4.0016654e-04, 3.4076979e-04, 2.9285118e-04,
1049+ # 2.5271536e-04, 2.1707747e-04, 1.8321030e-04, 1.4933939e-04,
1050+ # 1.1513883e-04, 8.2005502e-05, 5.2541044e-05, 2.9373325e-05,
1051+ # 1.3840817e-05, 5.2672006e-06, 1.5241105e-06, 3.0542392e-07,
1052+ # 3.6915891e-08, 1.8347912e-09, 2.2114402e-11, 5.3685066e-16/
1053+ data (gridv(iny, 4),iny=1,32)/
1054+ # 9.2731430e-03, 6.9948236e-03, 5.3144732e-03, 4.0652903e-03,
1055+ # 3.1328132e-03, 2.4282484e-03, 1.8929862e-03, 1.4841263e-03,
1056+ # 1.1704474e-03, 9.2943341e-04, 7.4399977e-04, 6.0109301e-04,
1057+ # 4.9092271e-04, 4.0580385e-04, 3.3953903e-04, 2.8700023e-04,
1058+ # 2.4383801e-04, 2.0634913e-04, 1.7159359e-04, 1.3773971e-04,
1059+ # 1.0446314e-04, 7.3071554e-05, 4.5887405e-05, 2.5084061e-05,
1060+ # 1.1524443e-05, 4.2604502e-06, 1.1914778e-06, 2.2920043e-07,
1061+ # 2.6286612e-08, 1.2107299e-09, 1.0080946e-11, 3.2845426e-16/
1062+ data (gridv(iny, 5),iny=1,32)/
1063+ # 1.1477138e-02, 8.5381747e-03, 6.3939961e-03, 4.8178867e-03,
1064+ # 3.6556258e-03, 2.7887348e-03, 2.1392407e-03, 1.6500181e-03,
1065+ # 1.2800074e-03, 9.9975891e-04, 7.8717888e-04, 6.2562654e-04,
1066+ # 5.0280633e-04, 4.0921770e-04, 3.3736136e-04, 2.8121172e-04,
1067+ # 2.3579394e-04, 1.9702349e-04, 1.6176823e-04, 1.2814066e-04,
1068+ # 9.5802895e-05, 6.5966820e-05, 4.0705648e-05, 2.1818543e-05,
1069+ # 9.8043554e-06, 3.5336308e-06, 9.5911504e-07, 1.7800578e-07,
1070+ # 1.9496528e-08, 8.4002050e-10, 4.3204403e-12, 2.1251138e-16/
1071+ data (gridv(iny, 6),iny=1,32)/
1072+ # 1.3802612e-02, 1.0141026e-02, 7.4971127e-03, 5.5741476e-03,
1073+ # 4.1720271e-03, 3.1386776e-03, 2.3737894e-03, 1.8049673e-03,
1074+ # 1.3802137e-03, 1.0625971e-03, 8.2471236e-04, 6.4617450e-04,
1075+ # 5.1210721e-04, 4.1120934e-04, 3.3467950e-04, 2.7561780e-04,
1076+ # 2.2846603e-04, 1.8878732e-04, 1.5327653e-04, 1.1999194e-04,
1077+ # 8.8573452e-05, 6.0136140e-05, 3.6529669e-05, 1.9238247e-05,
1078+ # 8.4746327e-06, 2.9853000e-06, 7.8837418e-07, 1.4128313e-07,
1079+ # 1.4820095e-08, 6.0070190e-10, 1.7185758e-12, 1.4369011e-16/
1080+ data (gridv(iny, 7),iny=1,32)/
1081+ # 1.6432308e-02, 1.1930946e-02, 8.7133575e-03, 6.3970356e-03,
1082+ # 4.7264435e-03, 3.5091707e-03, 2.6187361e-03, 1.9645111e-03,
1083+ # 1.4819077e-03, 1.1254264e-03, 8.6166780e-04, 6.6606423e-04,
1084+ # 5.2091794e-04, 4.1296488e-04, 3.3203523e-04, 2.7031018e-04,
1085+ # 2.2163224e-04, 1.8120725e-04, 1.4555330e-04, 1.1266604e-04,
1086+ # 8.2152609e-05, 5.5024591e-05, 3.2922540e-05, 1.7044970e-05,
1087+ # 7.3639505e-06, 2.5349841e-06, 6.4817141e-07, 1.0938699e-07,
1088+ # 1.0789142e-08, 4.0267815e-10, 9.9738412e-13, 9.3965182e-17/
1089+ data (gridv(iny, 8),iny=1,32)/
1090+ # 1.9588443e-02, 1.4054534e-02, 1.0140342e-02, 7.3511754e-03,
1091+ # 5.3617513e-03, 3.9285711e-03, 2.8927241e-03, 2.1409034e-03,
1092+ # 1.5930991e-03, 1.1934393e-03, 9.0134688e-04, 6.8734040e-04,
1093+ # 5.3043871e-04, 4.1513075e-04, 3.2970284e-04, 2.6531895e-04,
1094+ # 2.1516289e-04, 1.7405250e-04, 1.3830950e-04, 1.0585100e-04,
1095+ # 7.6238215e-05, 5.0368640e-05, 2.9681423e-05, 1.5103253e-05,
1096+ # 6.3960840e-06, 2.1473293e-06, 5.2444493e-07, 7.7848289e-08,
1097+ # 6.7448840e-09, 2.0379331e-10, 2.3209743e-13, 4.3818080e-17/
1098+ data firsttime/.true./
1099+ save
1100+ if(firsttime)then
1101+ firsttime=.false.
1102+ nent(1)=nny
1103+ nent(2)=nnz
1104+ do iny=1,nny
1105+ ent(iny)=(yv(iny))
1106+ enddo
1107+ do inz=1,nnz
1108+ ent(nny+inz)=(zv(inz))
1109+ enddo
1110+ endif
1111+ arg(1)=(y)
1112+ arg(2)=(z)
1113+ tmp=dfint(narg,arg,nent,ent,gridv)
1114+ ewa_wm_p_0=tmp
1115+ return
1116+ end
1117+ function ewa_z_p(x,Q2,pol)
1118+ implicit none
1119+ real*8 ewa_z_p
1120+ real*8 x,Q2
1121+ integer pol
1122+ real*8 tmp
1123+ real*8 y,z
1124+ real*8 ylow,yupp,zlow,zupp
1125+ parameter (ylow=-16.1181,yupp=-1e-07)
1126+ parameter (zlow=4.38683,zupp=13.8155)
1127+ real*8 ewa_z_p_1p
1128+ real*8 ewa_z_p_1m
1129+ real*8 ewa_z_p_0
1130+ y=log(x)
1131+ z=0.5*log(Q2)
1132+ if(pol.eq.1)then
1133+ tmp=ewa_z_p_1p(y,z)
1134+ else if(pol.eq.-1)then
1135+ tmp=ewa_z_p_1m(y,z)
1136+ else
1137+ tmp=ewa_z_p_0(y,z)
1138+ endif
1139+ ewa_z_p=tmp/x*y*y
1140+ end
1141+ function ewa_z_p_1p(y,z)
1142+ implicit none
1143+ real*8 ewa_z_p_1p,y,z
1144+ integer narg,nny,nnz
1145+ parameter (narg=2)
1146+ parameter (nny=32)
1147+ parameter (nnz=8)
1148+ integer iny,inz,nent(narg)
1149+ real*8 tmp,dfint,ymap,zmap
1150+ real*8 arg(narg),ent(nny+nnz)
1151+ real*8 yv(nny),zv(nnz),gridv(nny,nnz)
1152+ logical firsttime
1153+ external dfint,ymap,zmap
1154+ data yv/
1155+ # -1.6118096e+01, -1.5094991e+01, -1.4105430e+01, -1.3149414e+01,
1156+ # -1.2226943e+01, -1.1338015e+01, -1.0482632e+01, -9.6607941e+00,
1157+ # -8.8725001e+00, -8.1177506e+00, -7.3965455e+00, -6.7088848e+00,
1158+ # -6.0547686e+00, -5.4341967e+00, -4.8471693e+00, -4.2936863e+00,
1159+ # -3.7737478e+00, -3.2873536e+00, -2.8345039e+00, -2.4151986e+00,
1160+ # -2.0294377e+00, -1.6772213e+00, -1.3585493e+00, -1.0734217e+00,
1161+ # -8.2183848e-01, -6.0379973e-01, -4.1930540e-01, -2.6835549e-01,
1162+ # -1.5095001e-01, -6.7088947e-02, -1.6772312e-02, -1.0000000e-07/
1163+ data zv/
1164+ # 4.3868276e+00, 5.7337823e+00, 7.0807370e+00, 8.4276917e+00,
1165+ # 9.7746464e+00, 1.1121601e+01, 1.2468556e+01, 1.3815511e+01/
1166+ data (gridv(iny, 1),iny=1,32)/
1167+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1168+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1169+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1170+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1171+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1172+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1173+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1174+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00/
1175+ data (gridv(iny, 2),iny=1,32)/
1176+ # 3.7303045e-03, 2.9227921e-03, 2.3141955e-03, 1.8493581e-03,
1177+ # 1.4933843e-03, 1.2162782e-03, 9.9810630e-04, 8.2501787e-04,
1178+ # 6.8659282e-04, 5.7544120e-04, 4.8609674e-04, 4.1418784e-04,
1179+ # 3.5626496e-04, 3.0973606e-04, 2.7244727e-04, 2.4257706e-04,
1180+ # 2.1854792e-04, 1.9876081e-04, 1.8151373e-04, 1.6480475e-04,
1181+ # 1.4652391e-04, 1.2495404e-04, 9.9767621e-05, 7.2413235e-05,
1182+ # 4.6189116e-05, 2.4986033e-05, 1.0981613e-05, 3.6318686e-06,
1183+ # 8.2837802e-07, 1.0232602e-07, 4.9850666e-09, 1.2419766e-08/
1184+ data (gridv(iny, 3),iny=1,32)/
1185+ # 1.0860874e-02, 8.3686491e-03, 6.5072730e-03, 5.1000356e-03,
1186+ # 4.0344753e-03, 3.2163074e-03, 2.5819036e-03, 2.0867745e-03,
1187+ # 1.6975997e-03, 1.3904974e-03, 1.1478197e-03, 9.5566048e-04,
1188+ # 8.0324203e-04, 6.8259459e-04, 5.8722232e-04, 5.1178459e-04,
1189+ # 4.5182361e-04, 4.0308935e-04, 3.6137523e-04, 3.2211460e-04,
1190+ # 2.8093250e-04, 2.3463440e-04, 1.8303741e-04, 1.2940501e-04,
1191+ # 8.0128195e-05, 4.1902153e-05, 1.7698447e-05, 5.5786779e-06,
1192+ # 1.1982518e-06, 1.3567906e-07, 5.1862975e-09, 1.4921624e-08/
1193+ data (gridv(iny, 4),iny=1,32)/
1194+ # 2.1582709e-02, 1.6384815e-02, 1.2542453e-02, 9.6686760e-03,
1195+ # 7.5174482e-03, 5.8869725e-03, 4.6402349e-03, 3.6814614e-03,
1196+ # 2.9392736e-03, 2.3625196e-03, 1.9136197e-03, 1.5633551e-03,
1197+ # 1.2894368e-03, 1.0755569e-03, 9.0867962e-04, 7.7828223e-04,
1198+ # 6.7581905e-04, 5.9350250e-04, 5.2402918e-04, 4.5996420e-04,
1199+ # 3.9470912e-04, 3.2387169e-04, 2.4768512e-04, 1.7121604e-04,
1200+ # 1.0335642e-04, 5.2501923e-05, 2.1430744e-05, 6.4822592e-06,
1201+ # 1.3222258e-06, 1.3895999e-07, 4.1233808e-09, 1.3983723e-08/
1202+ data (gridv(iny, 5),iny=1,32)/
1203+ # 3.6225205e-02, 2.7139223e-02, 2.0491247e-02, 1.5570792e-02,
1204+ # 1.1927494e-02, 9.1990020e-03, 7.1389947e-03, 5.5752406e-03,
1205+ # 4.3810786e-03, 3.4655687e-03, 2.7625306e-03, 2.2211128e-03,
1206+ # 1.8030325e-03, 1.4806433e-03, 1.2320561e-03, 1.0399620e-03,
1207+ # 8.9058578e-04, 7.7179147e-04, 6.7267988e-04, 5.8270496e-04,
1208+ # 4.9308080e-04, 3.9840200e-04, 2.9945131e-04, 2.0297089e-04,
1209+ # 1.1982930e-04, 5.9340172e-05, 2.3506889e-05, 6.8579981e-06,
1210+ # 1.3368364e-06, 1.3162902e-07, 2.9711215e-09, 1.2215759e-08/
1211+ data (gridv(iny, 6),iny=1,32)/
1212+ # 5.5154342e-02, 4.0827860e-02, 3.0449006e-02, 2.2843096e-02,
1213+ # 1.7269263e-02, 1.3140804e-02, 1.0059401e-02, 7.7483419e-03,
1214+ # 6.0046554e-03, 4.6839966e-03, 3.6820525e-03, 2.9195345e-03,
1215+ # 2.3374414e-03, 1.8936267e-03, 1.5550949e-03, 1.2961420e-03,
1216+ # 1.0966733e-03, 9.3947224e-04, 8.0960033e-04, 6.9320130e-04,
1217+ # 5.7933366e-04, 4.6170562e-04, 3.4169800e-04, 2.2756193e-04,
1218+ # 1.3169713e-04, 6.3745564e-05, 2.4577867e-05, 6.9293186e-06,
1219+ # 1.2930488e-06, 1.1992460e-07, 2.0948206e-09, 1.0413998e-08/
1220+ data (gridv(iny, 7),iny=1,32)/
1221+ # 7.9641332e-02, 5.8283390e-02, 4.2961224e-02, 3.1840880e-02,
1222+ # 2.3773251e-02, 1.7861019e-02, 1.3496990e-02, 1.0261222e-02,
1223+ # 7.8482212e-03, 6.0415388e-03, 4.6867971e-03, 3.6676358e-03,
1224+ # 2.8981380e-03, 2.3178462e-03, 1.8798546e-03, 1.5481330e-03,
1225+ # 1.2949777e-03, 1.0972312e-03, 9.3539626e-04, 7.9205439e-04,
1226+ # 6.5410473e-04, 5.1445082e-04, 3.7509234e-04, 2.4557633e-04,
1227+ # 1.3941666e-04, 6.6000870e-05, 2.4739779e-05, 6.6282306e-06,
1228+ # 1.1538853e-06, 9.8657074e-08, 1.5984130e-09, 8.2433190e-09/
1229+ data (gridv(iny, 8),iny=1,32)/
1230+ # 1.1184163e-01, 8.0917333e-02, 5.8950236e-02, 4.3164542e-02,
1231+ # 3.1828151e-02, 2.3609789e-02, 1.7611453e-02, 1.3215123e-02,
1232+ # 9.9748771e-03, 7.5776696e-03, 5.8010863e-03, 4.4800093e-03,
1233+ # 3.4937519e-03, 2.7582893e-03, 2.2091448e-03, 1.7974773e-03,
1234+ # 1.4863368e-03, 1.2455380e-03, 1.0503765e-03, 8.7953603e-04,
1235+ # 7.1769738e-04, 5.5700142e-04, 4.0005545e-04, 2.5742663e-04,
1236+ # 1.4335613e-04, 6.6352481e-05, 2.4061846e-05, 5.8581041e-06,
1237+ # 8.7686172e-07, 6.1694293e-08, 7.6078967e-10, 4.5762876e-09/
1238+ data firsttime/.true./
1239+ save
1240+ if(firsttime)then
1241+ firsttime=.false.
1242+ nent(1)=nny
1243+ nent(2)=nnz
1244+ do iny=1,nny
1245+ ent(iny)=(yv(iny))
1246+ enddo
1247+ do inz=1,nnz
1248+ ent(nny+inz)=(zv(inz))
1249+ enddo
1250+ endif
1251+ arg(1)=(y)
1252+ arg(2)=(z)
1253+ tmp=dfint(narg,arg,nent,ent,gridv)
1254+ ewa_z_p_1p=tmp
1255+ return
1256+ end
1257+ function ewa_z_p_1m(y,z)
1258+ implicit none
1259+ real*8 ewa_z_p_1m,y,z
1260+ integer narg,nny,nnz
1261+ parameter (narg=2)
1262+ parameter (nny=32)
1263+ parameter (nnz=8)
1264+ integer iny,inz,nent(narg)
1265+ real*8 tmp,dfint,ymap,zmap
1266+ real*8 arg(narg),ent(nny+nnz)
1267+ real*8 yv(nny),zv(nnz),gridv(nny,nnz)
1268+ logical firsttime
1269+ external dfint,ymap,zmap
1270+ data yv/
1271+ # -1.6118096e+01, -1.5094991e+01, -1.4105430e+01, -1.3149414e+01,
1272+ # -1.2226943e+01, -1.1338015e+01, -1.0482632e+01, -9.6607941e+00,
1273+ # -8.8725001e+00, -8.1177506e+00, -7.3965455e+00, -6.7088848e+00,
1274+ # -6.0547686e+00, -5.4341967e+00, -4.8471693e+00, -4.2936863e+00,
1275+ # -3.7737478e+00, -3.2873536e+00, -2.8345039e+00, -2.4151986e+00,
1276+ # -2.0294377e+00, -1.6772213e+00, -1.3585493e+00, -1.0734217e+00,
1277+ # -8.2183848e-01, -6.0379973e-01, -4.1930540e-01, -2.6835549e-01,
1278+ # -1.5095001e-01, -6.7088947e-02, -1.6772312e-02, -1.0000000e-07/
1279+ data zv/
1280+ # 4.3868276e+00, 5.7337823e+00, 7.0807370e+00, 8.4276917e+00,
1281+ # 9.7746464e+00, 1.1121601e+01, 1.2468556e+01, 1.3815511e+01/
1282+ data (gridv(iny, 1),iny=1,32)/
1283+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1284+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1285+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1286+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1287+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1288+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1289+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1290+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00/
1291+ data (gridv(iny, 2),iny=1,32)/
1292+ # 2.4722465e-03, 1.9238378e-03, 1.5105106e-03, 1.1960749e-03,
1293+ # 9.5450636e-04, 7.6644980e-04, 6.1891326e-04, 5.0238454e-04,
1294+ # 4.0993066e-04, 3.3642652e-04, 2.7788916e-04, 2.3119738e-04,
1295+ # 1.9389505e-04, 1.6397539e-04, 1.3974473e-04, 1.1973970e-04,
1296+ # 1.0268876e-04, 8.7531986e-05, 7.3507411e-05, 6.0200203e-05,
1297+ # 4.7561978e-05, 3.5825675e-05, 2.5363959e-05, 1.6554077e-05,
1298+ # 9.6919422e-06, 4.9066425e-06, 2.0356874e-06, 6.4136541e-07,
1299+ # 1.3870147e-07, 1.5934953e-08, 3.8134239e-10, 1.5583767e-09/
1300+ data (gridv(iny, 3),iny=1,32)/
1301+ # 7.0798337e-03, 5.4081649e-03, 4.1625029e-03, 3.2271346e-03,
1302+ # 2.5192925e-03, 1.9775657e-03, 1.5603254e-03, 1.2371174e-03,
1303+ # 9.8575176e-04, 7.8989545e-04, 6.3703740e-04, 5.1756292e-04,
1304+ # 4.2407586e-04, 3.5069124e-04, 2.9260099e-04, 2.4581210e-04,
1305+ # 2.0699146e-04, 1.7346123e-04, 1.4331114e-04, 1.1548538e-04,
1306+ # 8.9728440e-05, 6.6379120e-05, 4.6055769e-05, 2.9366897e-05,
1307+ # 1.6731521e-05, 8.2008648e-06, 3.2726090e-06, 9.8342622e-07,
1308+ # 2.0024596e-07, 2.1085367e-08, 3.1115922e-10, 1.8414779e-09/
1309+ data (gridv(iny, 4),iny=1,32)/
1310+ # 1.3868555e-02, 1.0425215e-02, 7.8892735e-03, 6.0089146e-03,
1311+ # 4.6057219e-03, 3.5480566e-03, 2.7464613e-03, 2.1359653e-03,
1312+ # 1.6689984e-03, 1.3114613e-03, 1.0371878e-03, 8.2648300e-04,
1313+ # 6.6446546e-04, 5.3953412e-04, 4.4244464e-04, 3.6574043e-04,
1314+ # 3.0339116e-04, 2.5068534e-04, 2.0431482e-04, 1.6241791e-04,
1315+ # 1.2441356e-04, 9.0628951e-05, 6.1799132e-05, 3.8623433e-05,
1316+ # 2.1495349e-05, 1.0246602e-05, 3.9545153e-06, 1.1410065e-06,
1317+ # 2.2060684e-07, 2.1556121e-08, 1.5852146e-10, 1.6987942e-09/
1318+ data (gridv(iny, 5),iny=1,32)/
1319+ # 2.2986936e-02, 1.7037927e-02, 1.2705430e-02, 9.5306823e-03,
1320+ # 7.1915567e-03, 5.4521722e-03, 4.1524897e-03, 3.1768102e-03,
1321+ # 2.4418608e-03, 1.8873270e-03, 1.4682359e-03, 1.1510039e-03,
1322+ # 9.1077042e-04, 7.2826552e-04, 5.8860114e-04, 4.7999193e-04,
1323+ # 3.9314928e-04, 3.2098035e-04, 2.5857717e-04, 2.0315066e-04,
1324+ # 1.5370454e-04, 1.1046511e-04, 7.4187115e-05, 4.5556559e-05,
1325+ # 2.4836768e-05, 1.1553471e-05, 4.3299295e-06, 1.2055759e-06,
1326+ # 2.2273199e-07, 2.0385221e-08, 2.5365287e-11, 1.4614457e-09/
1327+ data (gridv(iny, 6),iny=1,32)/
1328+ # 3.4607710e-02, 2.5329231e-02, 1.8643112e-02, 1.3797244e-02,
1329+ # 1.0268406e-02, 7.6763540e-03, 5.7640388e-03, 4.3470540e-03,
1330+ # 3.2936565e-03, 2.5093254e-03, 1.9243527e-03, 1.4874209e-03,
1331+ # 1.1607380e-03, 9.1588915e-04, 7.3097517e-04, 5.8910398e-04,
1332+ # 4.7722044e-04, 3.8555267e-04, 3.0742488e-04, 2.3902283e-04,
1333+ # 1.7886336e-04, 1.2700213e-04, 8.4135064e-05, 5.0853622e-05,
1334+ # 2.7216172e-05, 1.2384960e-05, 4.5198910e-06, 1.2164900e-06,
1335+ # 2.1505007e-07, 1.8520572e-08, -5.3697542e-11, 1.2296759e-09/
1336+ data (gridv(iny, 7),iny=1,32)/
1337+ # 4.9445135e-02, 3.5757010e-02, 2.5994493e-02, 1.8993674e-02,
1338+ # 1.3952679e-02, 1.0293089e-02, 7.6258392e-03, 5.6738387e-03,
1339+ # 4.2408262e-03, 3.1872474e-03, 2.4113098e-03, 1.8389250e-03,
1340+ # 1.4163575e-03, 1.1035738e-03, 8.7029523e-04, 6.9356210e-04,
1341+ # 5.5597102e-04, 4.4470895e-04, 3.5113742e-04, 2.7029621e-04,
1342+ # 2.0013417e-04, 1.4045648e-04, 9.1828197e-05, 5.4657353e-05,
1343+ # 2.8729898e-05, 1.2794546e-05, 4.5409281e-06, 1.1613608e-06,
1344+ # 1.9109911e-07, 1.5092145e-08, -5.2811872e-11, 9.5507973e-10/
1345+ data (gridv(iny, 8),iny=1,32)/
1346+ # 6.8709761e-02, 4.9096606e-02, 3.5253307e-02, 2.5432125e-02,
1347+ # 1.8440272e-02, 1.3424173e-02, 9.8127739e-03, 7.2026791e-03,
1348+ # 5.3106334e-03, 3.9371633e-03, 2.9384004e-03, 2.2109274e-03,
1349+ # 1.6805250e-03, 1.2928794e-03, 1.0073789e-03, 7.9380317e-04,
1350+ # 6.2964750e-04, 4.9861161e-04, 3.8984865e-04, 2.9710009e-04,
1351+ # 2.1764892e-04, 1.5095775e-04, 9.7391148e-05, 5.7072702e-05,
1352+ # 2.9454329e-05, 1.2827026e-05, 4.4049387e-06, 1.0235568e-06,
1353+ # 1.4395353e-07, 9.1928386e-09, -5.1047909e-11, 4.9741292e-10/
1354+ data firsttime/.true./
1355+ save
1356+ if(firsttime)then
1357+ firsttime=.false.
1358+ nent(1)=nny
1359+ nent(2)=nnz
1360+ do iny=1,nny
1361+ ent(iny)=(yv(iny))
1362+ enddo
1363+ do inz=1,nnz
1364+ ent(nny+inz)=(zv(inz))
1365+ enddo
1366+ endif
1367+ arg(1)=(y)
1368+ arg(2)=(z)
1369+ tmp=dfint(narg,arg,nent,ent,gridv)
1370+ ewa_z_p_1m=tmp
1371+ return
1372+ end
1373+ function ewa_z_p_0(y,z)
1374+ implicit none
1375+ real*8 ewa_z_p_0,y,z
1376+ integer narg,nny,nnz
1377+ parameter (narg=2)
1378+ parameter (nny=32)
1379+ parameter (nnz=8)
1380+ integer iny,inz,nent(narg)
1381+ real*8 tmp,dfint,ymap,zmap
1382+ real*8 arg(narg),ent(nny+nnz)
1383+ real*8 yv(nny),zv(nnz),gridv(nny,nnz)
1384+ logical firsttime
1385+ external dfint,ymap,zmap
1386+ data yv/
1387+ # -1.6118096e+01, -1.5094991e+01, -1.4105430e+01, -1.3149414e+01,
1388+ # -1.2226943e+01, -1.1338015e+01, -1.0482632e+01, -9.6607941e+00,
1389+ # -8.8725001e+00, -8.1177506e+00, -7.3965455e+00, -6.7088848e+00,
1390+ # -6.0547686e+00, -5.4341967e+00, -4.8471693e+00, -4.2936863e+00,
1391+ # -3.7737478e+00, -3.2873536e+00, -2.8345039e+00, -2.4151986e+00,
1392+ # -2.0294377e+00, -1.6772213e+00, -1.3585493e+00, -1.0734217e+00,
1393+ # -8.2183848e-01, -6.0379973e-01, -4.1930540e-01, -2.6835549e-01,
1394+ # -1.5095001e-01, -6.7088947e-02, -1.6772312e-02, -1.0000000e-07/
1395+ data zv/
1396+ # 4.3868276e+00, 5.7337823e+00, 7.0807370e+00, 8.4276917e+00,
1397+ # 9.7746464e+00, 1.1121601e+01, 1.2468556e+01, 1.3815511e+01/
1398+ data (gridv(iny, 1),iny=1,32)/
1399+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1400+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1401+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1402+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1403+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1404+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1405+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00,
1406+ # 0.0000000e+00, 0.0000000e+00, 0.0000000e+00, 0.0000000e+00/
1407+ data (gridv(iny, 2),iny=1,32)/
1408+ # 2.2972746e-03, 1.7917254e-03, 1.4105851e-03, 1.1202991e-03,
1409+ # 8.9758753e-04, 7.2401692e-04, 5.8765422e-04, 4.7973220e-04,
1410+ # 3.9382732e-04, 3.2529169e-04, 2.7051159e-04, 2.2663375e-04,
1411+ # 1.9144281e-04, 1.6313368e-04, 1.4017673e-04, 1.2123763e-04,
1412+ # 1.0509369e-04, 9.0611789e-05, 7.6817182e-05, 6.3022584e-05,
1413+ # 4.9058611e-05, 3.5418441e-05, 2.3106352e-05, 1.3215971e-05,
1414+ # 6.4045348e-06, 2.5232862e-06, 7.6274114e-07, 1.6120969e-07,
1415+ # 2.0920899e-08, 1.1554945e-09, 2.1846051e-11, 3.8164747e-16/
1416+ data (gridv(iny, 3),iny=1,32)/
1417+ # 3.1443709e-03, 2.4086938e-03, 1.8599149e-03, 1.4469692e-03,
1418+ # 1.1345306e-03, 8.9494004e-04, 7.0998827e-04, 5.6630210e-04,
1419+ # 4.5410728e-04, 3.6631536e-04, 2.9748449e-04, 2.4339831e-04,
1420+ # 2.0085187e-04, 1.6729924e-04, 1.4065172e-04, 1.1916159e-04,
1421+ # 1.0130455e-04, 8.5745522e-05, 7.1384433e-05, 5.7493734e-05,
1422+ # 4.3890462e-05, 3.1023010e-05, 1.9770186e-05, 1.1015777e-05,
1423+ # 5.1834875e-06, 1.9746473e-06, 5.7369065e-07, 1.1562072e-07,
1424+ # 1.4116885e-08, 7.1378361e-10, 1.0286193e-11, 2.1760568e-16/
1425+ data (gridv(iny, 4),iny=1,32)/
1426+ # 4.0583782e-03, 3.0604630e-03, 2.3243967e-03, 1.7771165e-03,
1427+ # 1.3685115e-03, 1.0596807e-03, 8.2496027e-04, 6.4554632e-04,
1428+ # 5.0775614e-04, 4.0172285e-04, 3.1996314e-04, 2.5677121e-04,
1429+ # 2.0788121e-04, 1.6996988e-04, 1.4037525e-04, 1.1693715e-04,
1430+ # 9.7839570e-05, 8.1555616e-05, 6.6877295e-05, 5.3032557e-05,
1431+ # 3.9820348e-05, 2.7642036e-05, 1.7265954e-05, 9.4071798e-06,
1432+ # 4.3162443e-06, 1.5974573e-06, 4.4856401e-07, 8.6784619e-08,
1433+ # 1.0054849e-08, 4.7125287e-10, 5.0055779e-12, 1.3353325e-16/
1434+ data (gridv(iny, 5),iny=1,32)/
1435+ # 5.0242808e-03, 3.7368538e-03, 2.7975112e-03, 2.1069870e-03,
1436+ # 1.5976618e-03, 1.2178011e-03, 9.3297051e-04, 7.1829351e-04,
1437+ # 5.5582318e-04, 4.3260555e-04, 3.3896481e-04, 2.6762365e-04,
1438+ # 2.1321911e-04, 1.7163549e-04, 1.3964927e-04, 1.1469329e-04,
1439+ # 9.4678118e-05, 7.7901482e-05, 6.3058870e-05, 4.9337909e-05,
1440+ # 3.6517503e-05, 2.4952978e-05, 1.5315618e-05, 8.1824913e-06,
1441+ # 3.6722130e-06, 1.3251079e-06, 3.6114078e-07, 6.7413213e-08,
1442+ # 7.4593247e-09, 3.2711613e-10, 2.4150815e-12, 8.6646158e-17/
1443+ data (gridv(iny, 6),iny=1,32)/
1444+ # 6.0434242e-03, 4.4393078e-03, 3.2809706e-03, 2.4384204e-03,
1445+ # 1.8240018e-03, 1.3711741e-03, 1.0357484e-03, 7.8624158e-04,
1446+ # 5.9978597e-04, 4.6020082e-04, 3.5548403e-04, 2.7671910e-04,
1447+ # 2.1741591e-04, 1.7266372e-04, 1.3867688e-04, 1.1250016e-04,
1448+ # 9.1784840e-05, 7.4666871e-05, 5.9754966e-05, 4.6199819e-05,
1449+ # 3.3759746e-05, 2.2745966e-05, 1.3743797e-05, 7.2147556e-06,
1450+ # 3.1743092e-06, 1.1196153e-06, 2.9689509e-07, 5.3518235e-08,
1451+ # 5.6721821e-09, 2.3409415e-10, 1.1787607e-12, 5.8729404e-17/
1452+ data (gridv(iny, 7),iny=1,32)/
1453+ # 7.1959867e-03, 5.2238170e-03, 3.8140515e-03, 2.7991324e-03,
1454+ # 2.0670251e-03, 1.5335081e-03, 1.1431466e-03, 8.5620909e-04,
1455+ # 6.4440376e-04, 4.8779317e-04, 3.7174709e-04, 2.8552072e-04,
1456+ # 2.2138742e-04, 1.7357728e-04, 1.3770573e-04, 1.1041226e-04,
1457+ # 8.9081969e-05, 7.1687010e-05, 5.6748485e-05, 4.3377928e-05,
1458+ # 3.1310191e-05, 2.0811054e-05, 1.2385981e-05, 6.3920772e-06,
1459+ # 2.7583999e-06, 9.5083600e-07, 2.4412955e-07, 4.1454456e-08,
1460+ # 4.1336315e-09, 1.5732057e-10, 7.2362906e-13, 3.8540532e-17/
1461+ data (gridv(iny, 8),iny=1,32)/
1462+ # 8.5794573e-03, 6.1549995e-03, 4.4395854e-03, 3.2173803e-03,
1463+ # 2.3455029e-03, 1.7173947e-03, 1.2632918e-03, 9.3357781e-04,
1464+ # 6.9319431e-04, 5.1766046e-04, 3.8920495e-04, 2.9492776e-04,
1465+ # 2.2566512e-04, 1.7466681e-04, 1.3686160e-04, 1.0845033e-04,
1466+ # 8.6522845e-05, 6.8873718e-05, 5.3928273e-05, 4.0752757e-05,
1467+ # 2.9053811e-05, 1.9048548e-05, 1.1165828e-05, 5.6636607e-06,
1468+ # 2.3959922e-06, 8.0553030e-07, 1.9753531e-07, 2.9524070e-08,
1469+ # 2.5899490e-09, 8.0207162e-11, 2.5018623e-13, 1.8180313e-17/
1470+ data firsttime/.true./
1471+ save
1472+ if(firsttime)then
1473+ firsttime=.false.
1474+ nent(1)=nny
1475+ nent(2)=nnz
1476+ do iny=1,nny
1477+ ent(iny)=(yv(iny))
1478+ enddo
1479+ do inz=1,nnz
1480+ ent(nny+inz)=(zv(inz))
1481+ enddo
1482+ endif
1483+ arg(1)=(y)
1484+ arg(2)=(z)
1485+ tmp=dfint(narg,arg,nent,ent,gridv)
1486+ ewa_z_p_0=tmp
1487+ return
1488+ end
1489
1490=== added file 'Template/LO/Source/PDF/ElectroweakFlux.inc'
1491--- Template/LO/Source/PDF/ElectroweakFlux.inc 1970-01-01 00:00:00 +0000
1492+++ Template/LO/Source/PDF/ElectroweakFlux.inc 2021-02-05 11:45:49 +0000
1493@@ -0,0 +1,38 @@
1494+ double precision pi, pi2, sqrt2, eps
1495+ double precision ewa_mw2, ewa_mz2, ewa_gf
1496+ double precision ewa_qu,ewa_qd,ewa_qv,ewa_ql,ewa_t3u,ewa_t3d
1497+ double precision ewa_cw2,ewa_sw2,ewa_gW2
1498+ double precision ewa_gV,ewa_gVu,ewa_gVd,ewa_gVv,ewa_gVl
1499+ double precision ewa_gA,ewa_gAu,ewa_gAd,ewa_gAv,ewa_gAl
1500+c Math
1501+ parameter (pi=3.141592653589793d0)
1502+ parameter (pi2=9.869604401089358d0)
1503+ parameter (sqrt2=1.4142135623730951d0)
1504+ parameter (eps=1d-16)
1505+c Input EW parameters
1506+ parameter (ewa_mw2 = 80.379d0**2) ! [GeV]^2 PDG 2018
1507+ parameter (ewa_mz2 = 91.1876d0**2) ! [GeV]^2 PDG 2018
1508+ parameter (ewa_gf = 1.1663787d-5) ! [GeV]^-2 PDG 2018
1509+ parameter (ewa_qu = 2d0/3d0)
1510+ parameter (ewa_qd = -1d0/3d0)
1511+ parameter (ewa_qv = 0d0)
1512+ parameter (ewa_ql = -1d0)
1513+ parameter (ewa_t3u = 0.5d0)
1514+ parameter (ewa_t3d = -0.5d0)
1515+c Derived EW parameters
1516+ parameter (ewa_cw2 = ewa_mw2/ewa_mz2)
1517+ parameter (ewa_sw2 = 1d0 - ewa_mw2/ewa_mz2)
1518+ parameter (ewa_gW2 = sqrt2*4d0*ewa_gf*ewa_mw2)
1519+c Weak Vector Couplings
1520+ parameter (ewa_gV = 1d0)
1521+ parameter (ewa_gVu = 0.5d0*ewa_t3u - ewa_qu*ewa_sw2)
1522+ parameter (ewa_gVd = 0.5d0*ewa_t3d - ewa_qd*ewa_sw2)
1523+ parameter (ewa_gVv = 0.5d0*ewa_t3u)
1524+ parameter (ewa_gVl = 0.5d0*ewa_t3d - ewa_ql*ewa_sw2)
1525+c Weak Axialvector Couplings
1526+ parameter (ewa_gA = -1d0)
1527+ parameter (ewa_gAu = -0.5d0*ewa_t3u)
1528+ parameter (ewa_gAd = -0.5d0*ewa_t3d)
1529+ parameter (ewa_gAv = -0.5d0*ewa_t3u)
1530+ parameter (ewa_gAl = -0.5d0*ewa_t3d)
1531+c
1532\ No newline at end of file
1533
1534=== modified file 'Template/LO/Source/PDF/PhotonFlux.f'
1535--- Template/LO/Source/PDF/PhotonFlux.f 2020-08-07 14:49:25 +0000
1536+++ Template/LO/Source/PDF/PhotonFlux.f 2021-02-05 11:45:49 +0000
1537@@ -1,8 +1,10 @@
1538 c/* ********************************************************* */
1539-c/* Equivalent photon approximation structure function. * */
1540-c/* V.M.Budnev et al., Phys.Rep. 15C (1975) 181 * */
1541-c/* Improved Weizsaecker-Williams formula * */
1542-c/* http://inspirehep.net/record/359425 * */
1543+c/* Equivalent photon approximation structure function. * */
1544+c/* V.M.Budnev et al., Phys.Rep. 15C (1975) 181 * */
1545+c/* * */
1546+c/* Improved Weizsaecker-Williams formula * */
1547+c/* S. Frixione et al. hep-ph/9310350 * */
1548+c/* * */
1549 c/* ********************************************************* */
1550 c provided by Tomasz Pierzchala - UCL
1551
1552
1553=== modified file 'Template/LO/Source/PDF/makefile'
1554--- Template/LO/Source/PDF/makefile 2020-04-08 19:22:14 +0000
1555+++ Template/LO/Source/PDF/makefile 2021-02-05 11:45:49 +0000
1556@@ -14,15 +14,16 @@
1557 ifeq ($(lhapdfversion),5)
1558 $(error Bad lhadpfversion version 6 is now required)
1559 else
1560+ PDF = pdfwrap_lhapdf.o pdf_lhapdf6.o pdg2pdf_lhapdf6.o opendata.o PhotonFlux.o ElectroweakFlux.o
1561 ifeq ($(lhapdfsubversion),1) # 6.1.X
1562- PDF = pdfwrap_lhapdf.o pdf_lhapdf6.o pdg2pdf_lhapdf6.o opendata.o PhotonFlux.o
1563+ PDF = pdfwrap_lhapdf.o pdf_lhapdf6.o pdg2pdf_lhapdf6.o opendata.o PhotonFlux.o ElectroweakFlux.o
1564 else # 6.2.X
1565 CXXFLAGS+=-std=c++11
1566- PDF = pdfwrap_lhapdf.o pdf_lhapdf62.o pdg2pdf_lhapdf6.o opendata.o PhotonFlux.o
1567+ PDF = pdfwrap_lhapdf.o pdf_lhapdf62.o pdg2pdf_lhapdf6.o opendata.o PhotonFlux.o ElectroweakFlux.o
1568 endif
1569 endif
1570 else
1571- PDF = Ctq6Pdf.o pdfwrap.o opendata.o pdf.o PhotonFlux.o pdg2pdf.o NNPDFDriver.o
1572+ PDF = Ctq6Pdf.o pdfwrap.o opendata.o pdf.o PhotonFlux.o pdg2pdf.o NNPDFDriver.o ElectroweakFlux.o
1573 endif
1574
1575 all: $(LIBDIR)$(LIBRARY)
1576
1577=== modified file 'Template/LO/Source/PDF/pdg2pdf.f'
1578--- Template/LO/Source/PDF/pdg2pdf.f 2020-08-07 14:49:25 +0000
1579+++ Template/LO/Source/PDF/pdg2pdf.f 2021-02-05 11:45:49 +0000
1580@@ -32,7 +32,29 @@
1581 data pdflast/30*-99d9/
1582 data pdlabellast/2*'abcdefg'/
1583 data ihlast/2*-99/
1584-
1585+c
1586+c Special for EWA (need to know current helicity)
1587+c
1588+ double precision ewa_wX_ByPID, ewa_zX_ByPID
1589+ external ewa_wX_ByPID, ewa_zX_ByPID
1590+ integer hel, ppid
1591+ double precision hel_jacobian
1592+ INTEGER HEL_PICKED
1593+ COMMON/HEL_PICKED/HEL_PICKED,hel_jacobian
1594+ integer get_nhel
1595+ external get_nhel
1596+ REAL*8 POL(2)
1597+ common/to_polarization/ POL
1598+c
1599+c Collider
1600+c
1601+ integer lpp(2)
1602+ double precision ebeam(2), xbk(2),q2fact(2)
1603+ common/to_collider/ ebeam , xbk ,q2fact, lpp
1604+c
1605+c
1606+c
1607+ double precision factor
1608 if (ih.eq.9) then
1609 pdg2pdf = 1d0
1610 return
1611@@ -66,12 +88,14 @@
1612 ipart=7
1613 c This will be called for any PDG code, but we only support up to 7
1614 else if(iabs(ipart).gt.7)then
1615- write(*,*) 'PDF not supported for pdg ',ipdg
1616- write(*,*) 'For lepton colliders, please set the lpp* '//
1617- $ 'variables to 0 in the run_card'
1618- open(unit=26,file='../../../error',status='unknown')
1619- write(26,*) 'Error: PDF not supported for pdg ',ipdg
1620- stop 1
1621+ if(iabs(ih).lt.2)then
1622+ write(*,*) 'PDF not supported for pdg ',ipdg
1623+ write(*,*) 'For lepton colliders, please set the lpp* '//
1624+ $ 'variables to 0 in the run_card current is' , ih
1625+ open(unit=26,file='../../../error',status='unknown')
1626+ write(26,*) 'Error: PDF not supported for pdg ',ipdg
1627+ stop 1
1628+ endif
1629 endif
1630
1631 iporg=ipart
1632@@ -85,7 +109,7 @@
1633 enddo
1634
1635 c Reuse previous result, if possible
1636- if (ireuse.gt.0.)then
1637+ if (ireuse.gt.0.and.iabs(iporg).lt.8)then
1638 if (pdflast(iporg,ireuse).ne.-99d9) then
1639 pdg2pdf = get_ion_pdf(pdflast(-7, ireuse), iporg, nb_proton(beamid),
1640 $ nb_neutron(beamid))
1641@@ -129,15 +153,85 @@
1642 pdlabellast(ireuse)=pdlabel
1643 ihlast(ireuse)=ih
1644
1645- if(iabs(ipart).eq.7.and.ih.gt.1) then
1646+c
1647+c Special mode for Improved Weizsacker-Williams,
1648+c Equivalent photon, and Effective W/Z Approximations
1649+c
1650+ if (ih.gt.1.and.ih.ne.9) then
1651+c Effective photon approximation
1652 q2max=xmu*xmu
1653- if(abs(ih).eq.3.or.abs(ih).eq.4) then !from the electron or muonn
1654- pdg2pdf=epa_lepton(x,q2max, ih)
1655- elseif(ih .eq. 2) then !from a proton without breaking
1656- pdg2pdf=epa_proton(x,q2max,beamid)
1657- endif
1658- pdflast(iporg,ireuse)=pdg2pdf
1659- return
1660+ if (iabs(ipart).eq.7) then
1661+ if(abs(ih).eq.3.or.abs(ih).eq.4) then !from the electron or muonn
1662+ pdg2pdf=epa_lepton(x,q2max, ih)
1663+ elseif(ih .eq. 2) then !from a proton without breaking
1664+ pdg2pdf=epa_proton(x,q2max,beamid)
1665+ endif
1666+ pdflast(iporg,ireuse)=pdg2pdf
1667+ return
1668+ elseif(iabs(ipart).eq.23) then ! z boson
1669+ factor = 3d0 ! 3 to cancel the average over W helicities´
1670+ if (ABS(ih).eq.3) then
1671+ ppid = 11
1672+ elseif(ABS(ih).eq.4) then
1673+ ppid = 13
1674+ elseif(ABS(ih).eq.2) then
1675+ ppid = 2212
1676+ else
1677+ write(*,*) "type of beam not yet supported for EWA"
1678+ stop 4
1679+ endif
1680+ hel = GET_NHEL(HEL_PICKED, beamid)
1681+ pdg2pdf = factor * ewa_zX_ByPID(x,q2max,hel,ppid)
1682+ if (ABS(POL(beamid)).ne.1d0) then
1683+ write(*,*) 'beam polarization not supported for EWA with Z'
1684+ stop 33
1685+ endif
1686+
1687+ return
1688+ elseif(ipart.eq.24) then ! w+ boson
1689+ factor = 3d0 ! 3 to cancel the average over W helicities´
1690+ if (ih.eq.-3) then ! from e+
1691+ ppid = -11
1692+ elseif(ih.eq.-4) then ! from mu+
1693+ ppid = -13
1694+ elseif(ih.eq.2) then
1695+ ppid = 2212
1696+ else
1697+ write(*,*) "type of beam not yet supported for EWA"
1698+ stop 4
1699+ endif
1700+ hel = GET_NHEL(HEL_PICKED, beamid)
1701+ pdg2pdf = factor*ewa_wX_ByPID(x,q2max,hel,ppid)
1702+ if(pol(beamid).lt.0d0)then
1703+ pdg2pdf = pdg2pdf * (2-ABS(POL(beamid)))/2d0 ! couple only to right handed componenta
1704+ else
1705+ pdg2pdf = pdg2pdf * ABS(POL(beamid))/2d0 ! couple only to right handed componenta
1706+ endif
1707+ return
1708+ elseif(ipart.eq.-24) then ! w- boson
1709+ factor = 3d0 ! 3 to cancel the average over W helicities´
1710+ if (ih.eq.3) then ! from e-
1711+ ppid = 11
1712+ elseif(ih.eq.4) then ! from mu-
1713+ ppid = 13
1714+ elseif(ih.eq.2) then
1715+ ppid = -2212
1716+ else
1717+ write(*,*) "type of beam not yet supported for EWA"
1718+ stop 4
1719+ endif
1720+
1721+ hel = GET_NHEL(HEL_PICKED, beamid)
1722+ pdg2pdf = factor*ewa_wX_ByPID(x,q2max,hel,ppid)
1723+ if(pol(beamid)*lpp(beamid).lt.0d0)then
1724+ pdg2pdf = pdg2pdf * ABS(POL(beamid))/2d0 ! couple only to left handed componenta
1725+ else
1726+ pdg2pdf = pdg2pdf * (2-ABS(POL(beamid)))/2d0 ! couple only to left handed componenta
1727+ endif
1728+
1729+
1730+ return
1731+ endif
1732 endif
1733
1734 if (pdlabel(1:5) .eq. 'cteq6') then
1735
1736=== modified file 'Template/LO/Source/PDF/pdg2pdf_lhapdf6.f'
1737--- Template/LO/Source/PDF/pdg2pdf_lhapdf6.f 2020-08-07 14:49:25 +0000
1738+++ Template/LO/Source/PDF/pdg2pdf_lhapdf6.f 2021-02-05 11:45:49 +0000
1739@@ -33,6 +33,37 @@
1740 data pdflast/300*-99d9/
1741 data imemlast/20*-99/
1742 data i_replace/20/
1743+c
1744+c Special for EWA (need to know current helicity)
1745+c
1746+ double precision ewa_wX_ByPID, ewa_zX_ByPID
1747+ external ewa_wX_ByPID, ewa_zX_ByPID
1748+ integer hel, ppid
1749+ double precision hel_jacobian
1750+ INTEGER HEL_PICKED
1751+ COMMON/HEL_PICKED/HEL_PICKED,hel_jacobian
1752+ integer get_nhel
1753+ external get_nhel
1754+ REAL*8 POL(2)
1755+ common/to_polarization/ POL
1756+ double precision q2max
1757+ double precision epa_electron
1758+c
1759+c Collider
1760+c
1761+ integer lpp(2)
1762+ double precision ebeam(2), xbk(2),q2fact(2)
1763+ common/to_collider/ ebeam , xbk ,q2fact, lpp
1764+c
1765+c
1766+c
1767+ double precision factor
1768+
1769+ if (ih.eq.9) then
1770+ pdg2pdf = 1d0
1771+ return
1772+ endif
1773+
1774
1775 nb_hadron = (nb_proton(beamid)+nb_neutron(beamid))
1776 c Make sure we have a reasonable Bjorken x. Note that even though
1777@@ -62,12 +93,14 @@
1778 ipart=7
1779 c This will be called for any PDG code, but we only support up to 7
1780 else if(iabs(ipart).gt.7)then
1781- write(*,*) 'PDF not supported for pdg ',ipdg
1782- write(*,*) 'For lepton colliders, please set the lpp* '//
1783- $ 'variables to 0 in the run_card'
1784- open(unit=26,file='../../../error',status='unknown')
1785- write(26,*) 'Error: PDF not supported for pdg ',ipdg
1786- stop 1
1787+ if(iabs(ih).lt.2)then
1788+ write(*,*) 'PDF not supported for pdg ',ipdg
1789+ write(*,*) 'For lepton colliders, please set the lpp* '//
1790+ $ 'variables to 0 in the run_card'
1791+ open(unit=26,file='../../../error',status='unknown')
1792+ write(26,*) 'Error: PDF not supported for pdg ',ipdg
1793+ stop 1
1794+ endif
1795 endif
1796
1797 iporg=ipart
1798@@ -139,10 +172,77 @@
1799 pdg2pdf = get_ion_pdf(pdflast(-7, i_replace), ipart, nb_proton(beamid), nb_neutron(beamid))
1800 endif
1801 pdg2pdf=pdg2pdf/x
1802- else if(abs(ih).eq.3.or.abs(ih).eq.4) then !from the electron
1803- pdg2pdf=epa_lepton(x,xmu*xmu, ih)
1804- else if(ih.eq.2) then ! photon from a proton without breaking
1805- pdg2pdf = epa_proton(x,xmu*xmu)
1806+ else if(ih.gt.1.and.ih.ne.9) then ! photon from a proton without breaking
1807+c Effective photon approximation
1808+ q2max=xmu*xmu
1809+ if (iabs(ipart).eq.7) then
1810+ if(abs(ih).eq.3.or.abs(ih).eq.4) then !from the electron
1811+ pdg2pdf=epa_lepton(x,xmu*xmu, ih)
1812+ elseif(ih .eq. 2) then !from a proton without breaking
1813+ pdg2pdf=epa_proton(x,q2max,beamid)
1814+ endif
1815+ pdflast(iporg,ireuse)=pdg2pdf
1816+ return
1817+ elseif(iabs(ipart).eq.23) then ! z boson
1818+ if (ih.eq.3) then
1819+ ppid = 11
1820+ elseif(ih.eq.4) then
1821+ ppid = 13
1822+ elseif(ih.eq.2) then
1823+ ppid = 2212
1824+ else
1825+ write(*,*) "type of beam not yet supported for EWA"
1826+ stop 4
1827+ endif
1828+ hel = GET_NHEL(HEL_PICKED, beamid)
1829+ pdg2pdf = ewa_zX_ByPID(x,q2max,hel,ppid)
1830+ if (ABS(POL(beamid)).ne.1d0) then
1831+ write(*,*)
1832+ & 'beam polarization not supported for EWA with Z'
1833+ stop 33
1834+ endif
1835+ return
1836+ elseif(ipart.eq.24) then ! w+ boson
1837+ factor = 3d0 ! 3 to cancel the average over W helicities´
1838+ if (ih.eq.-3) then ! from e+
1839+ ppid = -11
1840+ elseif(ih.eq.-4) then ! from mu+
1841+ ppid = -13
1842+ elseif(ih.eq.2) then
1843+ ppid = 2212
1844+ else
1845+ write(*,*) "type of beam not yet supported for EWA"
1846+ stop 4
1847+ endif
1848+ hel = GET_NHEL(HEL_PICKED, beamid)
1849+ pdg2pdf = factor*ewa_wX_ByPID(x,q2max,hel,ppid)
1850+ if(pol(beamid).lt.0d0)then
1851+ pdg2pdf = pdg2pdf * (2-ABS(POL(beamid)))/2d0 ! couple only to right handed componenta
1852+ else
1853+ pdg2pdf = pdg2pdf * ABS(POL(beamid))/2d0 ! couple only to right handed componenta
1854+ endif
1855+ return
1856+ elseif(ipart.eq.-24) then ! w- boson
1857+ factor = 3d0 ! 3 to cancel the average over W helicities´
1858+ if (ih.eq.3) then ! from e-
1859+ ppid = 11
1860+ elseif(ih.eq.4) then ! from mu-
1861+ ppid = 13
1862+ elseif(ih.eq.2) then
1863+ ppid = -2212
1864+ else
1865+ write(*,*) "type of beam not yet supported for EWA"
1866+ stop 4
1867+ endif
1868+
1869+ hel = GET_NHEL(HEL_PICKED, beamid)
1870+ pdg2pdf = factor*ewa_wX_ByPID(x,q2max,hel,ppid)
1871+ if(pol(beamid)*lpp(beamid).lt.0d0)then
1872+ pdg2pdf = pdg2pdf * ABS(POL(beamid))/2d0 ! couple only to left handed componenta
1873+ else
1874+ pdg2pdf = pdg2pdf * (2-ABS(POL(beamid)))/2d0 ! couple only to left handed componenta
1875+ endif
1876+ endif
1877 else
1878 write (*,*) 'beam type not supported in lhadpf'
1879 stop 1
1880
1881=== modified file 'Template/LO/Source/setrun.f'
1882--- Template/LO/Source/setrun.f 2020-08-07 14:49:25 +0000
1883+++ Template/LO/Source/setrun.f 2021-02-05 11:45:49 +0000
1884@@ -97,14 +97,13 @@
1885 endif
1886 pol(2)=sign(1+abs(pb2)/100d0,pb2)
1887 endif
1888-
1889
1890 if(pb1.ne.0d0.and.lpp(1).eq.0) pol(1)=sign(1+abs(pb1)/100d0,pb1)
1891 if(pb2.ne.0d0.and.lpp(2).eq.0) pol(2)=sign(1+abs(pb2)/100d0,pb2)
1892
1893 if(pb1.ne.0.or.pb2.ne.0) write(*,*) 'Setting beam polarization ',
1894- $ sign((abs(pol(1))-1)*100,pol(1)),
1895- $ sign((abs(pol(2))-1)*100,pol(2))
1896+ $ pol(1), pol(2)
1897+
1898
1899 c !!! Default behavior changed (MH, Aug. 07) !!!
1900 c If no pdf, read the param_card and use the value from there and
1901
1902=== modified file 'Template/LO/SubProcesses/genps.f'
1903--- Template/LO/SubProcesses/genps.f 2020-08-10 19:06:52 +0000
1904+++ Template/LO/SubProcesses/genps.f 2021-02-05 11:45:49 +0000
1905@@ -572,6 +572,7 @@
1906 if (abs(lpp(2)) .eq. 1 .or. abs(lpp(2)) .eq. 2) m2 = 0.938d0
1907 if (abs(lpp(1)) .eq. 3) m1 = 0.000511d0
1908 if (abs(lpp(2)) .eq. 3) m2 = 0.000511d0
1909+ if (abs(lpp(1)) .eq. 4) m1 = 0.000511d0
1910 if (abs(lpp(1)) .eq. 4) m1 = 0.105658d0
1911 if (abs(lpp(2)) .eq. 4) m2 = 0.105658d0
1912 if (mass_ion(1).ge.0d0) m1 = mass_ion(1)
1913
1914=== modified file 'Template/MadWeight/src/setrun.f'
1915--- Template/MadWeight/src/setrun.f 2018-04-27 21:01:37 +0000
1916+++ Template/MadWeight/src/setrun.f 2021-02-05 11:45:49 +0000
1917@@ -536,3 +536,11 @@
1918
1919 return
1920 end
1921+
1922+ INTEGER FUNCTION GET_NHEL(HEL, IPART)
1923+ implicit none
1924+ integer hel
1925+ integer ipart
1926+ get_nhel = 99
1927+ return
1928+ end
1929
1930=== modified file 'madgraph/core/base_objects.py'
1931--- madgraph/core/base_objects.py 2020-08-20 15:12:34 +0000
1932+++ madgraph/core/base_objects.py 2021-02-05 11:45:49 +0000
1933@@ -1222,7 +1222,8 @@
1934
1935 if name == 'particles':
1936 # Ensure no doublets in particle list
1937- make_unique(value)
1938+ if value:
1939+ make_unique(value)
1940 # Reset dictionaries
1941 self['particle_dict'] = {}
1942 self['ref_dict_to0'] = {}
1943@@ -4068,7 +4069,7 @@
1944 is needed"""
1945
1946 assert isinstance(doubletlist, list), \
1947- "Argument to make_unique must be list"
1948+ "Argument to make_unique must be list not %s" % type(doubletlist)
1949
1950
1951 uniquelist = []
1952
1953=== modified file 'madgraph/interface/common_run_interface.py'
1954--- madgraph/interface/common_run_interface.py 2020-08-17 22:31:42 +0000
1955+++ madgraph/interface/common_run_interface.py 2021-02-05 11:45:49 +0000
1956@@ -5839,6 +5839,21 @@
1957 self.run_card['mass_ion1'] != self.run_card['mass_ion2']):
1958 raise Exception, "Heavy ion profile for both beam are different but the symmetry used forbids it. \n Please generate your process with \"set group_subprocesses False\"."
1959
1960+ # EWA mode should use MC over polarization and no systematics (due to pdf call inreweight)
1961+ if self.run_card['lpp1'] in [2,3,4,-3,-4] or self.run_card['lpp2'] in [2,3,4,-3,-4]:
1962+ if any(pdg in proc_charac['pdg_initial1']+ proc_charac['pdg_initial2']
1963+ for pdg in [24, -24, 23]):
1964+ if self.run_card['nhel'] == 0:
1965+ logger.warning("only MC over polarization supported for EWA mode")
1966+ self.do_set('run_card nhel 1')
1967+ if self.run_card['use_syst']:
1968+ logger.warning("evaluation of systematics not allowed in EWA mode. set use_syst to False")
1969+ self.do_set('run_card use_syst False')
1970+
1971+ if self.run_card['lpp1'] in [4,-4] or self.run_card['lpp2'] in [4,-4]:
1972+ if 22 in proc_charac['pdg_initial1']+ proc_charac['pdg_initial2']:
1973+ raise Exception, "EPA not implemented from muon beam. (please open a ticket and we will do it)"
1974+
1975 # check the status of small width status from LO
1976 for param in self.param_card['decay']:
1977 width = param.value
1978
1979=== modified file 'madgraph/interface/madevent_interface.py'
1980--- madgraph/interface/madevent_interface.py 2020-06-18 20:23:25 +0000
1981+++ madgraph/interface/madevent_interface.py 2021-02-05 11:45:49 +0000
1982@@ -5414,6 +5414,7 @@
1983 elif mode in [1,2]:
1984 exename = os.path.basename(exe)
1985 # For condor cluster, create the input/output files
1986+ misc.sprint(exename)
1987 if 'ajob' in exename:
1988 input_files = ['madevent','input_app.txt','symfact.dat','iproc.dat','dname.mg',
1989 pjoin(self.me_dir, 'SubProcesses','randinit')]
1990@@ -5509,7 +5510,7 @@
1991 #submitting
1992 self.cluster.cluster_submit(exe, stdout=stdout, cwd=cwd, argument=argument,
1993 input_files=input_files, output_files=output_files,
1994- required_output=required_output, **opt)
1995+ required_output=required_output, allow_array=True, **opt)
1996 elif "refine_splitted.sh" in exename:
1997 input_files = ['madevent','symfact.dat','iproc.dat', 'dname.mg',
1998 pjoin(self.me_dir, 'SubProcesses','randinit')]
1999@@ -5533,7 +5534,7 @@
2000 #submitting
2001 self.cluster.cluster_submit(exe, stdout=stdout, cwd=cwd, argument=argument,
2002 input_files=input_files, output_files=output_files,
2003- required_output=required_output, **opt)
2004+ required_output=required_output,allow_array=True, **opt)
2005
2006
2007
2008
2009=== modified file 'madgraph/iolibs/export_v4.py'
2010--- madgraph/iolibs/export_v4.py 2020-08-20 13:17:30 +0000
2011+++ madgraph/iolibs/export_v4.py 2021-02-05 11:45:49 +0000
2012@@ -166,6 +166,7 @@
2013 self.mgme_dir = MG5DIR
2014 self.dir_path = dir_path
2015 self.model = None
2016+ self.beam_polarization = True
2017
2018 self.opt = dict(self.default_opt)
2019 if opt:
2020@@ -185,12 +186,48 @@
2021 def export_processes(self, matrix_elements, fortran_model):
2022 """Make the switch between grouped and not grouped output"""
2023
2024+
2025 calls = 0
2026 if isinstance(matrix_elements, group_subprocs.SubProcessGroupList):
2027+ # check handling for the polarization
2028+ for m in matrix_elements:
2029+ for me in m.get('matrix_elements'):
2030+ for p in me.get('processes'):
2031+ for pid in p.get_initial_ids():
2032+ spin = p.get('model').get_particle(pid).get('spin')
2033+ if spin != 2:
2034+ self.beam_polarization = False
2035+ break
2036+ else:
2037+ continue
2038+ break
2039+ else:
2040+ continue
2041+ break
2042+ else:
2043+ continue
2044+ break
2045+
2046 for (group_number, me_group) in enumerate(matrix_elements):
2047 calls = calls + self.generate_subprocess_directory(\
2048 me_group, fortran_model, group_number)
2049 else:
2050+ # check handling for the polarization
2051+ self.beam_polarization = True
2052+ for me in matrix_elements.get_matrix_elements():
2053+ for p in me.get('processes'):
2054+ for pid in p.get_initial_ids():
2055+ spin = p.get('model').get_particle(pid).get('spin')
2056+ if spin != 2:
2057+ self.beam_polarization = False
2058+ break
2059+ else:
2060+ continue
2061+ break
2062+ else:
2063+ continue
2064+ break
2065+
2066 for me_number, me in enumerate(matrix_elements.get_matrix_elements()):
2067 calls = calls + self.generate_subprocess_directory(\
2068 me, fortran_model, me_number)
2069@@ -4197,11 +4234,24 @@
2070 split_orders if len(split_orders)>0 else ['ALL_ORDERS'])
2071 replace_dict['jamp_lines'] = '\n'.join(jamp_lines)
2072
2073+ if self.beam_polarization:
2074+ replace_dict['beam_polarization'] = """
2075+ DO JJ=1,nincoming
2076+ IF(POL(JJ).NE.1d0.AND.NHEL(JJ,I).EQ.INT(SIGN(1d0,POL(JJ)))) THEN
2077+ T=T*ABS(POL(JJ))
2078+ ELSE IF(POL(JJ).NE.1d0)THEN
2079+ T=T*(2d0-ABS(POL(JJ)))
2080+ ENDIF
2081+ ENDDO
2082+ """
2083+ else:
2084+ replace_dict['beam_polarization'] = ""
2085+
2086+
2087 replace_dict['template_file'] = pjoin(_file_path, \
2088 'iolibs/template_files/%s' % self.matrix_file)
2089 replace_dict['template_file2'] = pjoin(_file_path, \
2090- 'iolibs/template_files/split_orders_helping_functions.inc')
2091-
2092+ 'iolibs/template_files/split_orders_helping_functions.inc')
2093 s1,s2 = matrix_element.get_spin_state_initial()
2094 replace_dict['nb_spin_state1'] = s1
2095 replace_dict['nb_spin_state2'] = s2
2096@@ -4308,14 +4358,21 @@
2097 replace_dict['define_subdiag_lines'] = ""
2098 replace_dict['cutsdone'] = " cutsdone=.false.\n cutspassed=.false."
2099
2100+ ncomb=matrix_element.get_helicity_combinations()
2101+
2102+ replace_dict['ncomb']= ncomb
2103+ helicity_lines = self.get_helicity_lines(matrix_element)
2104+ replace_dict['helicity_lines'] = helicity_lines
2105+
2106 if not isinstance(self, ProcessExporterFortranMEGroup):
2107- ncomb=matrix_element.get_helicity_combinations()
2108 replace_dict['read_write_good_hel'] = self.read_write_good_hel(ncomb)
2109 else:
2110 replace_dict['read_write_good_hel'] = ""
2111+ # Extract helicity lines
2112
2113 context = {'read_write_good_hel':True}
2114
2115+
2116 if writer:
2117 file = open(pjoin(_file_path, \
2118 'iolibs/template_files/auto_dsig_v4.inc')).read()
2119
2120=== modified file 'madgraph/iolibs/template_files/auto_dsig_v4.inc'
2121--- madgraph/iolibs/template_files/auto_dsig_v4.inc 2019-06-10 19:05:58 +0000
2122+++ madgraph/iolibs/template_files/auto_dsig_v4.inc 2021-02-05 11:45:49 +0000
2123@@ -156,3 +156,18 @@
2124 %(read_write_good_hel)s
2125
2126 ## }
2127+
2128+
2129+ integer FUNCTION GET_NHEL%(proc_id)s(hel, ipart)
2130+ implicit none
2131+ integer hel,i, ipart
2132+ Include 'nexternal.inc'
2133+ integer one_nhel(nexternal)
2134+ INTEGER NCOMB
2135+ PARAMETER ( NCOMB=%(ncomb)d)
2136+ INTEGER NHEL(NEXTERNAL,NCOMB)
2137+ %(helicity_lines)s
2138+
2139+ get_nhel%(proc_id)s = nhel(ipart, hel)
2140+ return
2141+ end
2142
2143=== modified file 'madgraph/iolibs/template_files/matrix_madevent_group_v4.inc'
2144--- madgraph/iolibs/template_files/matrix_madevent_group_v4.inc 2020-05-18 19:26:16 +0000
2145+++ madgraph/iolibs/template_files/matrix_madevent_group_v4.inc 2021-02-05 11:45:49 +0000
2146@@ -127,13 +127,7 @@
2147 DO I=1,NCOMB
2148 IF (GOODHEL(I,IMIRROR) .OR. NTRY(IMIRROR).LE.MAXTRIES.or.(ISUM_HEL.NE.0).or.THIS_NTRY(IMIRROR).le.2) THEN
2149 T=MATRIX%(proc_id)s(P ,NHEL(1,I),JC(1))
2150- DO JJ=1,nincoming
2151- IF(POL(JJ).NE.1d0.AND.NHEL(JJ,I).EQ.INT(SIGN(1d0,POL(JJ)))) THEN
2152- T=T*ABS(POL(JJ))*NB_SPIN_STATE_IN(JJ)/2d0 ! NB_SPIN_STATE(JJ)/2d0 is added for polarised beam
2153- ELSE IF(POL(JJ).NE.1d0)THEN
2154- T=T*(2d0-ABS(POL(JJ)))*NB_SPIN_STATE_IN(JJ)/2d0
2155- ENDIF
2156- ENDDO
2157+ %(beam_polarization)s
2158 IF (ISUM_HEL.NE.0.and.DS_get_dim_status('Helicity').eq.0.and.ALLOW_HELICITY_GRID_ENTRIES) then
2159 call DS_add_entry('Helicity',I,T)
2160 endif
2161@@ -178,14 +172,7 @@
2162 I = HEL_PICKED
2163
2164 T=MATRIX%(proc_id)s(P ,NHEL(1,I),JC(1))
2165-
2166- DO JJ=1,nincoming
2167- IF(POL(JJ).NE.1d0.AND.NHEL(JJ,I).EQ.INT(SIGN(1d0,POL(JJ)))) THEN
2168- T=T*ABS(POL(JJ))
2169- ELSE IF(POL(JJ).NE.1d0)THEN
2170- T=T*(2d0-ABS(POL(JJ)))
2171- ENDIF
2172- ENDDO
2173+ %(beam_polarization)s
2174 c Always one helicity at a time
2175 ANS = T
2176 c Include the Jacobian from helicity sampling
2177
2178=== modified file 'madgraph/iolibs/template_files/matrix_madevent_v4.inc'
2179--- madgraph/iolibs/template_files/matrix_madevent_v4.inc 2019-09-26 11:09:58 +0000
2180+++ madgraph/iolibs/template_files/matrix_madevent_v4.inc 2021-02-05 11:45:49 +0000
2181@@ -103,13 +103,7 @@
2182 DO I=1,NCOMB
2183 IF (GOODHEL(I) .OR. NTRY .LE. MAXTRIES.OR.(ISUM_HEL.NE.0)) THEN
2184 T=MATRIX%(proc_id)s(P ,NHEL(1,I),JC(1))
2185- DO JJ=1,nincoming
2186- IF(POL(JJ).NE.1d0.AND.NHEL(JJ,I).EQ.INT(SIGN(1d0,POL(JJ)))) THEN
2187- T=T*ABS(POL(JJ))*NB_SPIN_STATE(JJ)/2d0 ! NB_SPIN_STATE(JJ)/2d0 is added for polarised beam
2188- ELSE IF(POL(JJ).NE.1d0)THEN
2189- T=T*(2d0-ABS(POL(JJ)))*NB_SPIN_STATE(JJ)/2d0
2190- ENDIF
2191- ENDDO
2192+ %(beam_polarization)s
2193 IF (ISUM_HEL.NE.0) then
2194 call DS_add_entry('Helicity',I,T)
2195 endif
2196@@ -153,13 +147,7 @@
2197 I = HEL_PICKED
2198
2199 T=MATRIX%(proc_id)s(P ,NHEL(1,I),JC(1))
2200- DO JJ=1,nincoming
2201- IF(POL(JJ).NE.1d0.AND.NHEL(JJ,I).EQ.INT(SIGN(1d0,POL(JJ)))) THEN
2202- T=T*ABS(POL(JJ))
2203- ELSE IF(POL(JJ).NE.1d0)THEN
2204- T=T*(2d0-ABS(POL(JJ)))
2205- ENDIF
2206- ENDDO
2207+ %(beam_polarization)s
2208 c Always one helicity at a time
2209 ANS = T
2210 c Include the Jacobian from helicity sampling
2211
2212=== modified file 'madgraph/iolibs/template_files/super_auto_dsig_group_v4.inc'
2213--- madgraph/iolibs/template_files/super_auto_dsig_group_v4.inc 2020-01-16 07:19:30 +0000
2214+++ madgraph/iolibs/template_files/super_auto_dsig_group_v4.inc 2021-02-05 11:45:49 +0000
2215@@ -506,5 +506,10 @@
2216 C
2217 %(read_write_good_hel)s
2218
2219-
2220-
2221+ integer function get_nhel(hel, partid)
2222+ implicit none
2223+ integer hel, partid
2224+ write(*,*) "do not support this type of pdf with group_subprocess=True"
2225+ stop 1
2226+ return
2227+ end
2228
2229=== modified file 'madgraph/various/banner.py'
2230--- madgraph/various/banner.py 2020-08-21 07:00:01 +0000
2231+++ madgraph/various/banner.py 2021-02-05 11:45:49 +0000
2232@@ -2897,10 +2897,10 @@
2233 self.add_param("nevents", 10000)
2234 self.add_param("iseed", 0)
2235 self.add_param("python_seed", -2, include=False, hidden=True, comment="controlling python seed [handling in particular the final unweighting].\n -1 means use default from random module.\n -2 means set to same value as iseed")
2236- self.add_param("lpp1", 1, fortran_name="lpp(1)", allowed=[-1,1,0,2,3,9, -2,-3,4,-4],
2237- comment='first beam energy distribution:\n 0: fixed energy\n 1: PDF from proton\n -1: PDF from anti-proton\n 2:photon from proton, 3:photon from electron, 4: photon from muon, 9: PLUGIN MODE')
2238- self.add_param("lpp2", 1, fortran_name="lpp(2)", allowed=[-1,1,0,2,3,9,4,-4],
2239- comment='first beam energy distribution:\n 0: fixed energy\n 1: PDF from proton\n -1: PDF from anti-proton\n 2:photon from proton, 3:photon from electron, 4: photon from muon, 9: PLUGIN MODE')
2240+ self.add_param("lpp1", 1, fortran_name="lpp(1)", allowed=[-1,1,0,2,3,4,9,-2,-3,-4],
2241+ comment='first beam energy distribution:\n 0: fixed energy\n 1: PDF from proton\n -1: PDF from anti-proton\n 2:photon from proton, 3:photon/W/Z from electron, 4:photon/W/Z from muon,\n 9: PLUGIN MODE')
2242+ self.add_param("lpp2", 1, fortran_name="lpp(2)", allowed=[-1,1,0,2,3,4,9,-3,-4],
2243+ comment='first beam energy distribution:\n 0: fixed energy\n 1: PDF from proton\n -1: PDF from anti-proton\n 2:photon from proton, 3:photon/W/Z from electron, 4:photon/W/Z from muon,\n 9: PLUGIN MODE')
2244 self.add_param("ebeam1", 6500.0, fortran_name="ebeam(1)")
2245 self.add_param("ebeam2", 6500.0, fortran_name="ebeam(2)")
2246 self.add_param("polbeam1", 0.0, fortran_name="pb1", hidden=True,
2247@@ -3296,8 +3296,11 @@
2248 process 1->N all cut set on off.
2249 loop_induced -> MC over helicity
2250 e+ e- beam -> lpp:0 ebeam:500
2251+ P X beam (X: neutrino, lepton, EWA)
2252+ support of EWA beam [ZW] (from proton by default -> 100TeV)
2253 p p beam -> set maxjetflavor automatically
2254 more than one multiplicity: ickkw=1 xqcut=30 use_syst=F
2255+ interference module -> no systematics
2256 """
2257
2258 if proc_characteristic['loop_induced']:
2259@@ -3321,11 +3324,87 @@
2260 beam_id.add(leg['id'])
2261
2262 if any(i in beam_id for i in [1,-1,2,-2,3,-3,4,-4,5,-5,21,22]):
2263- maxjetflavor = max([4]+[abs(i) for i in beam_id if -7< i < 7])
2264+ maxjetflavor = max([3]+[abs(i) for i in beam_id if -7< i < 7])
2265 self['maxjetflavor'] = maxjetflavor
2266 self['asrwgtflavor'] = maxjetflavor
2267
2268- if any(i in beam_id for i in [1,-1,2,-2,3,-3,4,-4,5,-5,21,22]):
2269+ # check EWA case -> for pp at 100TeV or EWA-lepton (1+1 TeV)
2270+ if any(i in beam_id for i in [23,24,-24]):
2271+
2272+ self['use_syst'] = False
2273+ self['nhel'] = 1
2274+
2275+ # check where the W/Z are (on which beam)
2276+ EWA_in1 = any(i in beam_id_split[0] for i in [23,24,-24])
2277+ EWA_in2 = any(i in beam_id_split[1] for i in [23,24,-24])
2278+ p_in1 = any(i in beam_id_split[0] for i in [1,-1,2,-2,3,-3,4,-4,5,-5,21])
2279+ p_in2 = any(i in beam_id_split[1] for i in [1,-1,2,-2,3,-3,4,-4,5,-5,21])
2280+
2281+
2282+ # case1 W W collision
2283+ if EWA_in1 and EWA_in2:
2284+ self['lpp1'] = 2
2285+ self['lpp2'] = 2
2286+ self['ebeam1'] = '50k'
2287+ self['ebeam2'] = '50k'
2288+ # case2 p W collision
2289+ elif p_in1 and EWA_in2:
2290+ self['lpp1'] = 1
2291+ self['lpp2'] = 2
2292+ self['ebeam1'] = '50k'
2293+ self['ebeam2'] = '50k'
2294+ # case3 W p collision
2295+ elif p_in2 and EWA_in1:
2296+ self['lpp1'] = 2
2297+ self['lpp2'] = 1
2298+ self['ebeam1'] = '50k'
2299+ self['ebeam2'] = '50k'
2300+ # case3 W X collision (mainly for X=lepton)
2301+ elif EWA_in1:
2302+ self['ebeam1'] = '1k'
2303+ self['ebeam2'] = '1k'
2304+ if 11 in beam_id_split[1]:
2305+ self['lpp1'] = -3
2306+ self['lpp2'] = 0
2307+ elif -11 in beam_id_split[1]:
2308+ self['lpp1'] = 3
2309+ self['lpp2'] = 0
2310+ elif 13 in beam_id_split[1]:
2311+ self['lpp1'] = -4
2312+ self['lpp2'] = 0
2313+ elif -13 in beam_id_split[1]:
2314+ self['lpp1'] = 4
2315+ self['lpp2'] = 0
2316+ else:
2317+ self['lpp1'] = 0
2318+ self['lpp2'] = 0
2319+ # case3 X W collision (mainly for X=lepton)
2320+ elif EWA_in2:
2321+ self['ebeam1'] = '1k'
2322+ self['ebeam2'] = '1k'
2323+ if 11 in beam_id_split[0]:
2324+ self['lpp1'] = 0
2325+ self['lpp2'] = -3
2326+ elif -11 in beam_id_split[0]:
2327+ self['lpp1'] = 0
2328+ self['lpp2'] = 3
2329+ elif 13 in beam_id_split[0]:
2330+ self['lpp1'] = 0
2331+ self['lpp2'] = -4
2332+ elif -13 in beam_id_split[0]:
2333+ self['lpp1'] = 0
2334+ self['lpp2'] = 4
2335+ else:
2336+ self['lpp1'] = 0
2337+ self['lpp2'] = 0
2338+ # anything else should it happen?
2339+ else:
2340+ self['nhel'] = 1
2341+ self['lpp1'] = 0
2342+ self['lpp2'] = 0
2343+ self['ebeam1'] = '1k'
2344+ self['ebeam2'] = '1k'
2345+ elif any(i in beam_id for i in [1,-1,2,-2,3,-3,4,-4,5,-5,21,22]):
2346 # check for e p collision
2347 if any(id in beam_id for id in [11,-11,13,-13]):
2348 self.display_block.append('beam_pol')
2349@@ -3339,7 +3418,7 @@
2350 self['lpp2'] = 0
2351 self['ebeam1'] = '6500'
2352 self['ebeam2'] = '1k'
2353-
2354+
2355 elif any(id in beam_id for id in [11,-11,13,-13]):
2356 self['lpp1'] = 0
2357 self['lpp2'] = 0
2358@@ -3349,6 +3428,9 @@
2359 if set([ abs(i) for i in beam_id_split[0]]) == set([ abs(i) for i in beam_id_split[1]]):
2360 self.display_block.append('ecut')
2361 self.display_block.append('beam_pol')
2362+
2363+ if beam_id_split[0] == beam_id_split[1]:
2364+ self.display_block.append('ecut')
2365 else:
2366 self['lpp1'] = 0
2367 self['lpp2'] = 0
2368
2369=== modified file 'madgraph/various/cluster.py'
2370--- madgraph/various/cluster.py 2017-11-17 14:15:01 +0000
2371+++ madgraph/various/cluster.py 2021-02-05 11:45:49 +0000
2372@@ -87,6 +87,7 @@
2373 """Basic Class for all cluster type submission"""
2374 name = 'mother class'
2375 identifier_length = 14
2376+ allow_arrays = False
2377
2378 def __init__(self,*args, **opts):
2379 """Init the cluster"""
2380@@ -97,6 +98,8 @@
2381 self.submitted_dirs = [] #HTCaaS
2382 self.submitted_exes = [] #HTCaaS
2383 self.submitted_args = [] #HTCaaS
2384+ self.waiting_array_job = [] # for job array submission
2385+
2386
2387 if 'cluster_queue' in opts:
2388 self.cluster_queue = opts['cluster_queue']
2389@@ -122,7 +125,6 @@
2390 """How to make one submission. Return status id on the cluster."""
2391 raise NotImplemented, 'No implementation of how to submit a job to cluster \'%s\'' % self.name
2392
2393-
2394 @store_input()
2395 def submit2(self, prog, argument=[], cwd=None, stdout=None, stderr=None,
2396 log=None, input_files=[], output_files=[], required_output=[],
2397@@ -199,10 +201,15 @@
2398
2399 def cluster_submit(self, prog, argument=[], cwd=None, stdout=None, stderr=None,
2400 log=None, input_files=[], output_files=[], required_output=[],
2401- nb_submit=0, packet_member=None):
2402+ nb_submit=0, packet_member=None, allow_array=False):
2403 """This function wrap the cluster submition with cluster independant
2404 method should not be overwritten (but for DAG type submission)"""
2405-
2406+
2407+ if allow_array and self.allow_array:
2408+ self.add_into_array(prog, argument, cwd, stdout, stderr, log, input_files,
2409+ output_files, required_output, nb_submit)
2410+ return None
2411+
2412 id = self.submit2(prog, argument, cwd, stdout, stderr, log, input_files,
2413 output_files, required_output, nb_submit)
2414
2415@@ -458,7 +465,27 @@
2416 self.submit2(**args)
2417 return 'resubmit'
2418 return 'done'
2419-
2420+
2421+ def add_into_array(self,*args, **opts):
2422+ """ """
2423+ raise NotImplemented, 'No implementation of how to submit with a job array to cluster \'%s\'' % self.name
2424+
2425+ def submit_array(self, list_of_args):
2426+ """ """
2427+ raise NotImplemented, 'No implementation of how to submit with a job array to cluster \'%s\'' % self.name
2428+
2429+
2430+ def release_array(self):
2431+
2432+ if not self.allow_arrays:
2433+ if self.waiting_array_jobs:
2434+ raise NotImplemented, 'No implementation of how to submit with a job array to cluster \'%s\'' % self.name
2435+ return None
2436+ elif self.waiting_array_jobs:
2437+ return self.submit_array(self.waiting_array_jobs)
2438+ else:
2439+ return None
2440+
2441 @check_interupt()
2442 def launch_and_wait(self, prog, argument=[], cwd=None, stdout=None,
2443 stderr=None, log=None, required_output=[], nb_submit=0,
2444@@ -1648,6 +1675,7 @@
2445 running_tag = ['R', 'CG']
2446 complete_tag = ['C']
2447 identifier_length = 8
2448+ allow_arrays = True
2449
2450 @multiple_try()
2451 def submit(self, prog, argument=[], cwd=None, stdout=None, stderr=None, log=None,
2452@@ -1692,6 +1720,42 @@
2453 self.submitted_ids.append(id)
2454 return id
2455
2456+ def add_into_array(prog, argument, cwd, stdout, stderr, log, input_files,
2457+ output_files, required_output, nb_submit):
2458+
2459+ self.waiting_array_job.append((prog, argument, cwd, stdout, stderr, log, input_files,
2460+ output_files, required_output, nb_submit))
2461+
2462+
2463+ def submit_array(self, waiting_array_jobs):
2464+ """write a temporary file in order to submit an array of jobs"""
2465+
2466+ for arg in waiting_array_jobs):
2467+ print( arg)
2468+ misc.sprint(waiting_array_jobs)
2469+ template= """
2470+#SBATCH --job-name=%(job_name)s # Job name
2471+#SBATCH --mail-type=NONE # Mail events (NONE, BEGIN, END, FAIL, ALL)
2472+#SBATCH --mail-user=gatorlink@ufl.edu # Where to send mail
2473+#SBATCH --nodes=1 # Use one node
2474+#SBATCH --ntasks=1 # Run a single task
2475+#SBATCH --output=array_%A-%a.out # Standard output and error log
2476+#SBATCH --array=1-5 # Array range
2477+ """
2478+
2479+ import os
2480+ import tempfile
2481+
2482+ fd, path = tempfile.mkstemp()
2483+ try:
2484+ with os.fdopen(fd, 'w') as tmp:
2485+ # do stuff with temp file
2486+ tmp.write('stuff')
2487+ finally:
2488+ os.remove(path)
2489+
2490+
2491+
2492 @multiple_try()
2493 def control_one_job(self, id):
2494 """ control the status of a single job with it's cluster id """
2495
2496=== modified file 'tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/auto_dsig.f'
2497--- tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/auto_dsig.f 2019-06-17 21:29:56 +0000
2498+++ tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/auto_dsig.f 2021-02-05 11:45:49 +0000
2499@@ -174,3 +174,33 @@
2500
2501
2502
2503+
2504+ INTEGER FUNCTION GET_NHEL1(HEL, IPART)
2505+ IMPLICIT NONE
2506+ INTEGER HEL,I, IPART
2507+ INCLUDE 'nexternal.inc'
2508+ INTEGER ONE_NHEL(NEXTERNAL)
2509+ INTEGER NCOMB
2510+ PARAMETER ( NCOMB=16)
2511+ INTEGER NHEL(NEXTERNAL,NCOMB)
2512+ DATA (NHEL(I, 1),I=1,4) / 1,-1,-1, 1/
2513+ DATA (NHEL(I, 2),I=1,4) / 1,-1,-1,-1/
2514+ DATA (NHEL(I, 3),I=1,4) / 1,-1, 1, 1/
2515+ DATA (NHEL(I, 4),I=1,4) / 1,-1, 1,-1/
2516+ DATA (NHEL(I, 5),I=1,4) / 1, 1,-1, 1/
2517+ DATA (NHEL(I, 6),I=1,4) / 1, 1,-1,-1/
2518+ DATA (NHEL(I, 7),I=1,4) / 1, 1, 1, 1/
2519+ DATA (NHEL(I, 8),I=1,4) / 1, 1, 1,-1/
2520+ DATA (NHEL(I, 9),I=1,4) /-1,-1,-1, 1/
2521+ DATA (NHEL(I, 10),I=1,4) /-1,-1,-1,-1/
2522+ DATA (NHEL(I, 11),I=1,4) /-1,-1, 1, 1/
2523+ DATA (NHEL(I, 12),I=1,4) /-1,-1, 1,-1/
2524+ DATA (NHEL(I, 13),I=1,4) /-1, 1,-1, 1/
2525+ DATA (NHEL(I, 14),I=1,4) /-1, 1,-1,-1/
2526+ DATA (NHEL(I, 15),I=1,4) /-1, 1, 1, 1/
2527+ DATA (NHEL(I, 16),I=1,4) /-1, 1, 1,-1/
2528+
2529+ GET_NHEL1 = NHEL(IPART, HEL)
2530+ RETURN
2531+ END
2532+
2533
2534=== modified file 'tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/matrix1.f'
2535--- tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/matrix1.f 2020-08-20 15:12:34 +0000
2536+++ tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/matrix1.f 2021-02-05 11:45:49 +0000
2537@@ -154,6 +154,7 @@
2538 $ .LE.MAXTRIES.OR.(ISUM_HEL.NE.0).OR.THIS_NTRY(IMIRROR).LE.2)
2539 $ THEN
2540 T=MATRIX1(P ,NHEL(1,I),JC(1))
2541+
2542 DO JJ=1,NINCOMING
2543 IF(POL(JJ).NE.1D0.AND.NHEL(JJ,I).EQ.INT(SIGN(1D0,POL(JJ))
2544 $ )) THEN
2545@@ -162,6 +163,7 @@
2546 T=T*(2D0-ABS(POL(JJ)))*NB_SPIN_STATE_IN(JJ)/2D0
2547 ENDIF
2548 ENDDO
2549+
2550 IF (ISUM_HEL.NE.0.AND.DS_GET_DIM_STATUS('Helicity')
2551 $ .EQ.0.AND.ALLOW_HELICITY_GRID_ENTRIES) THEN
2552 CALL DS_ADD_ENTRY('Helicity',I,T)
2553@@ -220,6 +222,7 @@
2554 T=T*(2D0-ABS(POL(JJ)))
2555 ENDIF
2556 ENDDO
2557+
2558 C Always one helicity at a time
2559 ANS = T
2560 C Include the Jacobian from helicity sampling
2561
2562=== modified file 'tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/super_auto_dsig.f'
2563--- tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/super_auto_dsig.f 2020-01-19 16:22:42 +0000
2564+++ tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/super_auto_dsig.f 2021-02-05 11:45:49 +0000
2565@@ -595,6 +595,12 @@
2566
2567
2568
2569-
2570-
2571+ INTEGER FUNCTION GET_NHEL(HEL, PARTID)
2572+ IMPLICIT NONE
2573+ INTEGER HEL, PARTID
2574+ WRITE(*,*) 'do not support this type of pdf with'
2575+ $ //' group_subprocess=True'
2576+ STOP 1
2577+ RETURN
2578+ END
2579
2580
2581=== modified file 'tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f'
2582--- tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f 2019-06-17 21:29:56 +0000
2583+++ tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f 2021-02-05 11:45:49 +0000
2584@@ -221,3 +221,33 @@
2585
2586
2587
2588+
2589+ INTEGER FUNCTION GET_NHEL(HEL, IPART)
2590+ IMPLICIT NONE
2591+ INTEGER HEL,I, IPART
2592+ INCLUDE 'nexternal.inc'
2593+ INTEGER ONE_NHEL(NEXTERNAL)
2594+ INTEGER NCOMB
2595+ PARAMETER ( NCOMB=16)
2596+ INTEGER NHEL(NEXTERNAL,NCOMB)
2597+ DATA (NHEL(I, 1),I=1,4) / 1,-1,-1,-1/
2598+ DATA (NHEL(I, 2),I=1,4) / 1,-1,-1, 1/
2599+ DATA (NHEL(I, 3),I=1,4) / 1,-1, 1,-1/
2600+ DATA (NHEL(I, 4),I=1,4) / 1,-1, 1, 1/
2601+ DATA (NHEL(I, 5),I=1,4) / 1, 1,-1,-1/
2602+ DATA (NHEL(I, 6),I=1,4) / 1, 1,-1, 1/
2603+ DATA (NHEL(I, 7),I=1,4) / 1, 1, 1,-1/
2604+ DATA (NHEL(I, 8),I=1,4) / 1, 1, 1, 1/
2605+ DATA (NHEL(I, 9),I=1,4) /-1,-1,-1,-1/
2606+ DATA (NHEL(I, 10),I=1,4) /-1,-1,-1, 1/
2607+ DATA (NHEL(I, 11),I=1,4) /-1,-1, 1,-1/
2608+ DATA (NHEL(I, 12),I=1,4) /-1,-1, 1, 1/
2609+ DATA (NHEL(I, 13),I=1,4) /-1, 1,-1,-1/
2610+ DATA (NHEL(I, 14),I=1,4) /-1, 1,-1, 1/
2611+ DATA (NHEL(I, 15),I=1,4) /-1, 1, 1,-1/
2612+ DATA (NHEL(I, 16),I=1,4) /-1, 1, 1, 1/
2613+
2614+ GET_NHEL = NHEL(IPART, HEL)
2615+ RETURN
2616+ END
2617+
2618
2619=== modified file 'tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f'
2620--- tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f 2020-06-20 21:10:10 +0000
2621+++ tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f 2021-02-05 11:45:49 +0000
2622@@ -122,6 +122,7 @@
2623 IF (GOODHEL(I) .OR. NTRY .LE. MAXTRIES.OR.(ISUM_HEL.NE.0))
2624 $ THEN
2625 T=MATRIX(P ,NHEL(1,I),JC(1))
2626+
2627 DO JJ=1,NINCOMING
2628 IF(POL(JJ).NE.1D0.AND.NHEL(JJ,I).EQ.INT(SIGN(1D0,POL(JJ))
2629 $ )) THEN
2630@@ -130,6 +131,7 @@
2631 T=T*(2D0-ABS(POL(JJ)))*NB_SPIN_STATE(JJ)/2D0
2632 ENDIF
2633 ENDDO
2634+
2635 IF (ISUM_HEL.NE.0) THEN
2636 CALL DS_ADD_ENTRY('Helicity',I,T)
2637 ENDIF
2638@@ -175,6 +177,7 @@
2639 I = HEL_PICKED
2640
2641 T=MATRIX(P ,NHEL(1,I),JC(1))
2642+
2643 DO JJ=1,NINCOMING
2644 IF(POL(JJ).NE.1D0.AND.NHEL(JJ,I).EQ.INT(SIGN(1D0,POL(JJ))))
2645 $ THEN
2646@@ -183,6 +186,7 @@
2647 T=T*(2D0-ABS(POL(JJ)))
2648 ENDIF
2649 ENDDO
2650+
2651 C Always one helicity at a time
2652 ANS = T
2653 C Include the Jacobian from helicity sampling

Subscribers

People subscribed via source and target branches

to all changes: