EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
flipol.F
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file flipol.F
1 
2 C **********************************************************************
3 
4  SUBROUTINE flipol(FLQ,FLG,FLM)
5 
6  IMPLICIT NONE
7 
8 C...QCD and target mass contributions to longitudinal structure function
9 C...from interpolation on x,Q2 grid.
10 
11 *
12 * to avoid variable conflictions, a second keep element is necessary
13 * with the same common block name (see LPTOU2)
14 *
15  COMMON /leptou/ cut(14),lst(40),parl(30),
16  & x,y,w2,q2,u
17  REAL cut,parl,x,y,w2,q2,u
18  INTEGER lst
19  SAVE /leptou/
20 
21  COMMON /flgrid/ nfx,nfq,xr(2),qr(2),flqt(41,16),flgt(41,16),
22  &flmt(41,16)
23  REAL xr,qr,flqt,flgt,flmt
24  INTEGER nfx,nfq
25  SAVE /flgrid/
26 
27 
28  INTEGER nout,nwarn,lqcd,ltm,lht,ix,iq
29  REAL flq,flg,flm,xp,q2p,q2l,q2h,xl,xh,qd,xd,x1p,x2p
30 
31  DATA nout/0/,nwarn/10/
32 
33  lqcd=mod(lst(11),10)
34  ltm=mod(lst(11)/10,10)
35  lht=lst(11)/100
36  xp=x
37  q2p=q2
38 C...NOTE: tiny mismatch between present x-value and those on grid.
39  qr(2)=x*parl(21)
40  IF(qr(1).GT.qr(2)) RETURN
41  IF(x.LT.xr(1).OR.x.GT.xr(2).OR.
42  &q2.LT.qr(1).OR.q2.GT.qr(2)) THEN
43 C...x and/or Q2 outside grid limits, write warning for first NWARN cases
44  IF(lst(2).GE.0) THEN
45  nout=nout+1
46  IF(lst(3).GE.1.AND.nout.LE.nwarn) WRITE(6,1000) x,q2,nwarn
47  ENDIF
48  IF(x.LT.xr(1)) xp=xr(1)
49  IF(x.GT.xr(2)) xp=xr(2)
50  IF(q2.LT.qr(1)) q2p=qr(1)
51  IF(q2.GT.qr(2)) q2p=qr(2)
52  ENDIF
53 
54  ix=(alog10(xp)-alog10(xr(1)))/
55  &(alog10(xr(2))-alog10(xr(1)))*(nfx-1)+1
56  iq=(alog10(q2p)-alog10(qr(1)))/
57  &(alog10(qr(2))-alog10(qr(1)))*(nfq-1)+1
58  ix=min(ix,nfx-1)
59  iq=min(iq,nfq-1)
60  q2l=10**(alog10(qr(1))+(alog10(qr(2))-alog10(qr(1)))*
61  &(iq-1)/(nfq-1))
62  q2h=10**(alog10(qr(1))+(alog10(qr(2))-alog10(qr(1)))*
63  &(iq )/(nfq-1))
64  xl=10**(alog10(xr(1))+(alog10(xr(2))-alog10(xr(1)))*
65  &(ix-1)/(nfx-1))
66  xh=10**(alog10(xr(1))+(alog10(xr(2))-alog10(xr(1)))*
67  &(ix )/(nfx-1))
68  qd=(q2p-q2l)/(q2h-q2l)
69  xd=(xp-xl)/(xh-xl)
70 
71  IF(lqcd.EQ.1) THEN
72  x1p=(flqt(ix+1,iq)-flqt(ix,iq))*xd+flqt(ix,iq)
73  x2p=(flqt(ix+1,iq+1)-flqt(ix,iq+1))*xd+flqt(ix,iq+1)
74  flq=(x2p-x1p)*qd+x1p
75  x1p=(flgt(ix+1,iq)-flgt(ix,iq))*xd+flgt(ix,iq)
76  x2p=(flgt(ix+1,iq+1)-flgt(ix,iq+1))*xd+flgt(ix,iq+1)
77  flg=(x2p-x1p)*qd+x1p
78  ENDIF
79  IF(ltm.EQ.1) THEN
80  x1p=(flmt(ix+1,iq)-flmt(ix,iq))*xd+flmt(ix,iq)
81  x2p=(flmt(ix+1,iq+1)-flmt(ix,iq+1))*xd+flmt(ix,iq+1)
82  flm=(x2p-x1p)*qd+x1p
83  ENDIF
84 
85  RETURN
86  1000 FORMAT(' Warning: x=',f7.4,' or Q2=',f6.1,' outside grid,',
87  &' for FL interpolation',/,10x,'value on grid limit used.',
88  &' Only first',i5,' warnings printed.',/)
89  END