C ********************************************* C C Code to calculate A_C for proton and the constant term C and the cos(phi)-moment of A_C C The code also gives the unpolarized cross section C C We consider two scenarios: C -------------------------- C A_C_Proton_Full: we keep all harmonics C A_C_Proton_LT: only LT harmonics, which are C all harmonic for BH amplitude and C twist-2 harmonics for DVCS and Interference: C c0_DVCS, c0_I and c1_I C C Using the dual parameterization of GPDs, * V. Guzey and T. Teckentrup, Phys. Rev. D74, 054027 (2006) [hep-ph/0607099] * V. Guzey, T. Teckentrup, e-Print: arXiv:0810.3899 C Note: used the non-factorized Regge-motivated t-dependence C C V. Guzey, Theory Group, Jefferson Lab, vguzey@jlab.org C January 2009 C ********************************************* program AC_Proton implicit double precision (a-h,o-z) C The notation to remind of the Trento sign convention dimension a_phi_Trento(20),w_phi(20) pi=acos(-1.0) C External kinematics C Positrons (a_sign=-1); electrons (a_sign=+1) C As an example, we use a typical HERMES kinematics a_sign=-1.0 E_lepton=27.5 write(6,65) 'Beam energy=',E_lepton 65 format(A,2f6.3) Qn=2.5 write(6,65) 'Q**2=',Qn xB=0.10 write(6,65) 'x_B=',xB t=-0.1 write(6,65) 't=',t C J_u and J_d C There are 49 allowed combinations C (J_u,J_d)=(0.6,1),(0.6,0.6),(0.6,0.2),(0.6, 0),(0.6,-0.2),(0.6,-0.6),(0.6.-1) C (0.4,1),(0.4,0.6),(0.4,0.2),(0.4, 0),(0.4,-0.2),(0.4,-0.6),(0.4.-1) C (0.2,1),(0.2,0.6),(0.2,0.2),(0.2, 0),(0.2,-0.2),(0.2,-0.6),(0.2.-1) C .................................................................. C (-0.6,1),(-0.6,0.6),(-0.6,0.2),(-0.6, 0),(-0.6,-0.2),(-0.6,-0.6),(-0.6.-1) aJu=0.0 aJd=0.0 C Integration to extract the constant term and the cos(phi)-moment of A_C C Note: const_term=\int_{0}^{2*pi} dphi A_C(cos phi) / (2*pi) C A_C^cos_phi=\int_{0}^{2*pi} dphi A_C(cos phi)*cos(phi) / pi N_phi=20 phi_min=0.0 phi_max=2.0*pi sum_phi1_full=0.0 sum_phi2_full=0.0 sum_phi1_lt=0.0 sum_phi2_lt=0.0 sum_cs_full=0.0 C Gaussian integration routine call gausab(a_phi_Trento,w_phi,phi_min,phi_max,N_phi) do i=1,N_phi C Note that the notations of BMK differ from the Trento convention C phi_Trento=pi-phi phi=pi-a_phi_Trento(i) call ASYMMETRY_AC_Proton >(a_sign,E_lepton,xB,Qn,t,phi,aJu,aJd, >A_C_Proton_Full,A_C_Proton_LT,CS_Full) C Full sum_phi1_full=sum_phi1_full >+A_C_Proton_Full*w_phi(i) sum_phi2_full=sum_phi2_full >+A_C_Proton_Full*cos(a_phi_Trento(i))*w_phi(i) C LT sum_phi1_lt=sum_phi1_lt >+A_C_Proton_LT*w_phi(i) sum_phi2_lt=sum_phi2_lt >+A_C_Proton_LT*cos(a_phi_Trento(i))*w_phi(i) sum_cs_full=sum_cs_full+CS_Full*w_phi(i) enddo A_C_Proton_Full_const=sum_phi1_full/(2.0*pi) A_C_Proton_Full_cos_phi=sum_phi2_full/pi A_C_Proton_LT_const=sum_phi1_lt/(2.0*pi) A_C_Proton_LT_cos_phi=sum_phi2_lt/pi UNPOL_CS_Full=sum_cs_full write(6,65) 'Full A_C(Proton)^const=', >A_C_Proton_Full_const write(6,65) 'Full A_C(Proton)^cos_phi=', >A_C_Proton_Full_cos_phi write(6,65) 'LT A_C(Proton)^const=', >A_C_Proton_LT_const write(6,65) 'LT A_C(Proton)^cos_phi=', >A_C_Proton_LT_cos_phi write(6,65) 'UNPOL. CROSS SECTION [nb/GeV**2]=', >UNPOL_CS_Full stop end C Main subroutine: C a_sign = the sign in front of the interf. term (a_sign=1 electrons; a_sign=-1 positrons) C E_lepton = lepton energy C x = x_Bjorken C Qn= Q**2 [GeV**2] C t = 4-momentum transfer C phi =angle between the lepton and production planes (we use the Trento convention) C aJu and aJd = total angular momentum carried by the u-quark and the d-quark C Use the results of C A.V. Belitsky, D. Mueller, A. Kirchner, Nucl. Phys. B629, 323 (2002) [hep-ph/0112108] C C Output: A_C_Proton_Full -- keep all harmonics C A_C_Proton_LT -- keep only LT harmonics subroutine ASYMMETRY_AC_Proton >(a_sign,E_lepton,x,Qn,t,phi,aJu,aJd, >A_C_Proton_Full,A_C_Proton_LT,CS_Full) implicit double precision (a-h,o-z) amn=0.938272 pi=acos(-1.0) C Total invariant energy s=2.0*E_lepton*amn+amn**2 y=Qn/(2.0*amn*x*E_lepton) eps=4.0*amn**2*x**2/Qn if (y.gt.0.95) then write(6,*) 'y is larger 0.95' endif C Minimal t t_min=-Qn*(2.*(1.-x)*(1.-(1.+eps)**0.5)+eps) >/(4.*x*(1.-x)+eps) C Kinematic K-factor factor_K=(-t/Qn*(1.-x)*(1.-y-0.25*y**2*eps) >*(1.-t_min/t)*((1.0+eps)**0.5+(4.*x*(1.-x)+eps) >/(4.*(1.-x))*(t-t_min)/Qn))**0.5 C Kinematic J-factor (needed for lepton propagators) factor_J=(1.-y-0.5*y*eps)*(1.+t/Qn) >-(1.-x)*(2.-y)*t/Qn C Lepton propagators aP1=-(factor_J+2.0*factor_K*cos(phi)) >/(y*(1.+eps)) aP2=1.+t/Qn-aP1 call BH_Proton(x,Qn,y,t,c0_BH_p,c1_BH_p,c2_BH_p) call DVCS_Proton(x,y,c0_DVCS_p) call FORM_FACTOR_NUCLEON(t,F1p,F2p,F1n,F2n) call Dual_Proton(x,Qn,t,aJu,aJd,Hscript_Im_p,Hscript_Re_p, >Escript_Im_p,Escript_Re_p) C IMPORTANT!!! C Guzey & Teckentrup sign convention for CFF differs by an overall sign C from BMK C Since we use the BMK expressions for the DVCS asymmetry, we need to reverse the sign Hscript_Im_p=-Hscript_Im_p Hscript_Re_p=-Hscript_Re_p Escript_Im_p=-Escript_Im_p Escript_Re_p=-Escript_Re_p C Building A_C C Note: a_sign=1 corresponds to electrons C a_sign=-1 corresponds to positrons C Numerator: Interference c0_I_p=-8.0*(2.0-y)*((2.0-y)**2/(1.-y)*(factor_K)**2 >*(F1p*Hscript_Re_p-t/(4.*amn**2)*F2p*Escript_Re_p) >+t/Qn*(1.-y)*(2.-x) >*((F1p*Hscript_Re_p-t/(4.*amn**2)*F2p*Escript_Re_p) >-x**2/(2.0-x)**2*(F1p+F2p)*(Hscript_Re_p+Escript_Re_p))) c1_I_p=-8.0*factor_K*(2.0-2.0*y+y**2) >*(F1p*Hscript_Re_p-t/(4.*amn**2)*F2p*Escript_Re_p) c2_I_p=-16.0*(factor_K)**2/(2.0-x)*(2.0-y) >*(F1p*Hscript_Re_p-t/(4.*amn**2)*F2p*Escript_Re_p) >*(-x) aInt_p_LT=a_sign*1.0/(x*y**3*t*aP1*aP2) >*(c0_I_p+c1_I_p*cos(phi)) aInt_p_Full=a_sign*1.0/(x*y**3*t*aP1*aP2) >*(c0_I_p+c1_I_p*cos(phi)+c2_I_p*cos(2.0*phi)) C Denominator: BH BH_p=1.0/(x**2*y**2*t*aP1*aP2*(1.0+eps)**2) >*(c0_BH_p+c1_BH_p*cos(phi)+c2_BH_p*cos(2.*phi)) C Denominator: DVCS DVCS_p_LT=1.0/(y**2*Qn) >*c0_DVCS_p >*1.0/(2.0-x)**2*(4.*(1.-x)*(Hscript_Im_p**2+Hscript_Re_p**2) >-x**2*2.0*(Hscript_Im_p*Escript_Im_p+Hscript_Re_p*Escript_Re_p) >-(x**2+(2.0-x)**2*t/(4.0*amn**2)) >*(Escript_Im_p**2+Escript_Re_p**2)) c1_DVCS_p=8.0*factor_K/(2.0-x)*(2.0-y)*(-x) DVCS_p_Full=1.0/(y**2*Qn) >*(c0_DVCS_p+c1_DVCS_p*cos(phi)) >*1.0/(2.0-x)**2*(4.*(1.-x)*(Hscript_Im_p**2+Hscript_Re_p**2) >-x**2*2.0*(Hscript_Im_p*Escript_Im_p+Hscript_Re_p*Escript_Re_p) >-(x**2+(2.0-x)**2*t/(4.0*amn**2)) >*(Escript_Im_p**2+Escript_Re_p**2)) A_C_Proton_Full=aInt_p_Full/(BH_p+DVCS_p_Full) A_C_Proton_LT=aInt_p_LT/(BH_p+DVCS_p_LT) C Unpolarized cross section alpha_em=1./137.0 CS_Full=(alpha_em**3*x*y)/(8.0*pi*Qn*(1.0+eps)**0.5) >*(BH_p+aInt_p_Full+DVCS_p_Full) >*0.389379*(10.0**6) C [Cross section] = nbarn/GeV**2 return end C BH amplitude squared subroutine BH_Proton(x,Qn,y,t,c0_BH_p,c1_BH_p,c2_BH_p) implicit double precision (a-h,o-z) amn=0.938272 eps=4.0*amn**2*x**2/Qn t_min=-Qn*(2.*(1.-x)*(1.-(1.+eps)**0.5)+eps) >/(4.*x*(1.-x)+eps) factor_K=(-t/Qn*(1.-x)*(1.-y-0.25*y**2*eps) >*(1.-t_min/t)*((1.+eps)**0.5+(4.*x*(1.-x)+eps) >/(4.*(1.-x))*(t-t_min)/Qn))**0.5 C Proton and neutron form factors call FORM_FACTOR_NUCLEON(t,F1p,F2p,F1n,F2n) Comb1_p=(F1p)**2-t/(4.*amn**2)*(F2p)**2 Comb2_p=(F1p+F2p)**2 C Free proton c0_BH_p=8.*(factor_K)**2*((2.+3.*eps)*Qn/t*Comb1_p >+2.*x**2*Comb2_p) >+(2.-y)**2*((2.+eps)*(4.*x**2*amn**2/t*(1.+t/Qn)**2 >+4.0*(1.-x)*(1.+x*t/Qn))*Comb1_p >+4.*x**2*(x+(1.-x+0.5*eps)*(1.-t/Qn)**2 >-x*(1.-2.0*x)*t**2/Qn**2)*Comb2_p) >+8.*(1.+eps)*(1.-y-0.25*y**2*eps) >*(2.0*eps*(1.-t/(4.*amn**2))*Comb1_p >-x**2*(1.-t/Qn)**2*Comb2_p) c1_BH_p=8.*factor_K*(2.-y)*((4.*x**2*amn**2/t >-2.*x-eps)*Comb1_p >+2.*x**2*(1.-(1.-2.*x)*t/Qn)*Comb2_p) c2_BH_p=8.*x**2*(factor_K)**2*(4.*amn**2/t*Comb1_p >+2.0*Comb2_p) return end subroutine DVCS_Proton(x,y,c0_DVCS_p) implicit double precision (a-h,o-z) c0_DVCS_p=2.0*(2.0-2.0*y+y**2) return end C Proton and neutron elastic form factors subroutine FORM_FACTOR_NUCLEON(t,F1p,F2p,F1n,F2n) implicit double precision (a-h,o-z) amn=0.938272 ammp=2.793 ammn=-1.913 F1p=1./(1.0-t/0.71)**2*1./(1.0-t/(4.*amn**2)) >*(1.-t/(4.*amn**2)*2.79) F2p=1./(1.0-t/0.71)**2*1./(1.0-t/(4.*amn**2)) >*(ammp-1.) F1n=1./(1.0-t/0.71)**2*1./(1.0-t/(4.*amn**2)) >*(-t/(4.*amn**2)*ammn) F2n=1./(1.0-t/0.71)**2*1./(1.0-t/(4.*amn**2))*ammn return end C Main subroutine for CFFs of GPDs H and E subroutine Dual_Proton(xB,Q2,t,aJu,aJd, >Hscript_Im_p,Hscript_Re_p,Escript_Im_p,Escript_Re_p) implicit double precision (a-h,o-z) Parameter (N_E_data_files=49) Character FileName1(N_E_data_files)*40,FileName2*40 * Arrays of variables from the read data files dimension xB_array(27),Q2_array(19),t_array(13), >Hscript_Re_array(13,27,19),Hscript_Im_array(13,27,19) * Temporary arrays used for 3D interpolation dimension Q2tmp_Im(19),Q2tmp_Re(19),xBtmp_Im(27), >xBtmp_Re(27),ttmp_Im(13),ttmp_Re(13) * The same for the GPD E dimension Q2E_array(10),Escript_Re_array(13,27,10), >Escript_Im_array(13,27,10) dimension Q2Etmp_Im(10),Q2Etmp_Re(10),xBEtmp_Im(27), >xBEtmp_Re(27),tEtmp_Im(13),tEtmp_Re(13) data FileName1 /'Escript_dual_guidal_Ju06_Jd1_2009.dat', >'Escript_dual_guidal_Ju06_Jd06_2009.dat', >'Escript_dual_guidal_Ju06_Jd02_2009.dat', >'Escript_dual_guidal_Ju06_Jd00_2009.dat', >'Escript_dual_guidal_Ju06_Jdm02_2009.dat', >'Escript_dual_guidal_Ju06_Jdm06_2009.dat', >'Escript_dual_guidal_Ju06_Jdm1_2009.dat', >'Escript_dual_guidal_Ju04_Jd1_2009.dat', >'Escript_dual_guidal_Ju04_Jd06_2009.dat', >'Escript_dual_guidal_Ju04_Jd02_2009.dat', >'Escript_dual_guidal_Ju04_Jd00_2009.dat', >'Escript_dual_guidal_Ju04_Jdm02_2009.dat', >'Escript_dual_guidal_Ju04_Jdm06_2009.dat', >'Escript_dual_guidal_Ju04_Jdm1_2009.dat', >'Escript_dual_guidal_Ju02_Jd1_2009.dat', >'Escript_dual_guidal_Ju02_Jd06_2009.dat', >'Escript_dual_guidal_Ju02_Jd02_2009.dat', >'Escript_dual_guidal_Ju02_Jd00_2009.dat', >'Escript_dual_guidal_Ju02_Jdm02_2009.dat', >'Escript_dual_guidal_Ju02_Jdm06_2009.dat', >'Escript_dual_guidal_Ju02_Jdm1_2009.dat', >'Escript_dual_guidal_Ju00_Jd1_2009.dat', >'Escript_dual_guidal_Ju00_Jd06_2009.dat', >'Escript_dual_guidal_Ju00_Jd02_2009.dat', >'Escript_dual_guidal_Ju00_Jd00_2009.dat', >'Escript_dual_guidal_Ju00_Jdm02_2009.dat', >'Escript_dual_guidal_Ju00_Jdm06_2009.dat', >'Escript_dual_guidal_Ju00_Jdm1_2009.dat', >'Escript_dual_guidal_Jum02_Jd1_2009.dat', >'Escript_dual_guidal_Jum02_Jd06_2009.dat', >'Escript_dual_guidal_Jum02_Jd02_2009.dat', >'Escript_dual_guidal_Jum02_Jd00_2009.dat', >'Escript_dual_guidal_Jum02_Jdm02_2009.dat', >'Escript_dual_guidal_Jum02_Jdm06_2009.dat', >'Escript_dual_guidal_Jum02_Jdm1_2009.dat', >'Escript_dual_guidal_Jum04_Jd1_2009.dat', >'Escript_dual_guidal_Jum04_Jd06_2009.dat', >'Escript_dual_guidal_Jum04_Jd02_2009.dat', >'Escript_dual_guidal_Jum04_Jd00_2009.dat', >'Escript_dual_guidal_Jum04_Jdm02_2009.dat', >'Escript_dual_guidal_Jum04_Jdm06_2009.dat', >'Escript_dual_guidal_Jum04_Jdm1_2009.dat', >'Escript_dual_guidal_Jum06_Jd1_2009.dat', >'Escript_dual_guidal_Jum06_Jd06_2009.dat', >'Escript_dual_guidal_Jum06_Jd02_2009.dat', >'Escript_dual_guidal_Jum06_Jd00_2009.dat', >'Escript_dual_guidal_Jum06_Jdm02_2009.dat', >'Escript_dual_guidal_Jum06_Jdm06_2009.dat', >'Escript_dual_guidal_Jum06_Jdm1_2009.dat'/ common /Dual_Data/xB_array,Q2_array,t_array, >Hscript_Re_array,Hscript_Im_array,Q2E_array, >Escript_Re_array,Escript_Im_array C Reading the data file for CFF H open(1,file='Hscript_dual_guidal_2009.dat',status='unknown') Nt=13 Nx=27 Nq=19 do it=1,Nt do ix=1,Nx do iq=1,Nq read(1,*)xB_array(ix),Q2_array(iq),t_array(it), >Hscript_Im_array(it,ix,iq),Hscript_Re_array(it,ix,iq) enddo enddo enddo close(1) C Determining the appropriate data file for the given (J_u,J_d) C Go through 49 possibilities if (aJu.eq.0.6.and.aJd.eq.1.0) then FileName2=FileName1(1) else if (aJu.eq.0.6.and.aJd.eq.0.6) then FileName2=FileName1(2) else if (aJu.eq.0.6.and.aJd.eq.0.2) then FileName2=FileName1(3) else if (aJu.eq.0.6.and.aJd.eq.0.0) then FileName2=FileName1(4) else if (aJu.eq.0.6.and.aJd.eq.-0.2) then FileName2=FileName1(5) else if (aJu.eq.0.6.and.aJd.eq.-0.6) then FileName2=FileName1(6) else if (aJu.eq.0.6.and.aJd.eq.-1.0) then FileName2=FileName1(7) else if (aJu.eq.0.4.and.aJd.eq.1.0) then FileName2=FileName1(8) else if (aJu.eq.0.4.and.aJd.eq.0.6) then FileName2=FileName1(9) else if (aJu.eq.0.4.and.aJd.eq.0.2) then FileName2=FileName1(10) else if (aJu.eq.0.4.and.aJd.eq.0.0) then FileName2=FileName1(11) else if (aJu.eq.0.4.and.aJd.eq.-0.2) then FileName2=FileName1(12) else if (aJu.eq.0.4.and.aJd.eq.-0.6) then FileName2=FileName1(13) else if (aJu.eq.0.4.and.aJd.eq.-1.0) then FileName2=FileName1(14) else if (aJu.eq.0.2.and.aJd.eq.1.0) then FileName2=FileName1(15) else if (aJu.eq.0.2.and.aJd.eq.0.6) then FileName2=FileName1(16) else if (aJu.eq.0.2.and.aJd.eq.0.2) then FileName2=FileName1(17) else if (aJu.eq.0.2.and.aJd.eq.0.0) then FileName2=FileName1(18) else if (aJu.eq.0.2.and.aJd.eq.-0.2) then FileName2=FileName1(19) else if (aJu.eq.0.2.and.aJd.eq.-0.6) then FileName2=FileName1(20) else if (aJu.eq.0.2.and.aJd.eq.-1.0) then FileName2=FileName1(21) else if (aJu.eq.0.0.and.aJd.eq.1.0) then FileName2=FileName1(22) else if (aJu.eq.0.0.and.aJd.eq.0.6) then FileName2=FileName1(23) else if (aJu.eq.0.0.and.aJd.eq.0.2) then FileName2=FileName1(24) else if (aJu.eq.0.0.and.aJd.eq.0.0) then FileName2=FileName1(25) else if (aJu.eq.0.0.and.aJd.eq.-0.2) then FileName2=FileName1(26) else if (aJu.eq.0.0.and.aJd.eq.-0.6) then FileName2=FileName1(27) else if (aJu.eq.0.0.and.aJd.eq.-1.0) then FileName2=FileName1(28) else if (aJu.eq.-0.2.and.aJd.eq.1.0) then FileName2=FileName1(29) else if (aJu.eq.-0.2.and.aJd.eq.0.6) then FileName2=FileName1(30) else if (aJu.eq.-0.2.and.aJd.eq.0.2) then FileName2=FileName1(31) else if (aJu.eq.-0.2.and.aJd.eq.0.0) then FileName2=FileName1(32) else if (aJu.eq.-0.2.and.aJd.eq.-0.2) then FileName2=FileName1(33) else if (aJu.eq.-0.2.and.aJd.eq.-0.6) then FileName2=FileName1(34) else if (aJu.eq.-0.2.and.aJd.eq.-1.0) then FileName2=FileName1(35) else if (aJu.eq.-0.4.and.aJd.eq.1.0) then FileName2=FileName1(36) else if (aJu.eq.-0.4.and.aJd.eq.0.6) then FileName2=FileName1(37) else if (aJu.eq.-0.4.and.aJd.eq.0.2) then FileName2=FileName1(38) else if (aJu.eq.-0.4.and.aJd.eq.0.0) then FileName2=FileName1(39) else if (aJu.eq.-0.4.and.aJd.eq.-0.2) then FileName2=FileName1(40) else if (aJu.eq.-0.4.and.aJd.eq.-0.6) then FileName2=FileName1(41) else if (aJu.eq.-0.4.and.aJd.eq.-1.0) then FileName2=FileName1(42) else if (aJu.eq.-0.6.and.aJd.eq.1.0) then FileName2=FileName1(43) else if (aJu.eq.-0.6.and.aJd.eq.0.6) then FileName2=FileName1(44) else if (aJu.eq.-0.6.and.aJd.eq.0.2) then FileName2=FileName1(45) else if (aJu.eq.-0.6.and.aJd.eq.0.0) then FileName2=FileName1(46) else if (aJu.eq.-0.6.and.aJd.eq.-0.2) then FileName2=FileName1(47) else if (aJu.eq.-0.6.and.aJd.eq.-0.6) then FileName2=FileName1(48) else if (aJu.eq.-0.6.and.aJd.eq.-1.0) then FileName2=FileName1(49) else write(6,*) 'Ju and Jd out or range' endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif endif c write(6,*) 'J_u and J_d out of range' endif open(2,file=FileName2,status='unknown') Nt=13 Nx=27 NqE=10 do it=1,Nt do ix=1,Nx do iq=1,NqE read(2,*)a,Q2E_array(iq),a, >Escript_Im_array(it,ix,iq),Escript_Re_array(it,ix,iq) enddo enddo enddo close(2) * 3D interpolation done separately in all three variables do it=1,Nt do ix=1,Nx do iq=1,Nq Q2tmp_Im(iq)=Hscript_Im_array(it,ix,iq) Q2tmp_Re(iq)=Hscript_Re_array(it,ix,iq) enddo do iq=1,NqE Q2Etmp_Im(iq)=Escript_Im_array(it,ix,iq) Q2Etmp_Re(iq)=Escript_Re_array(it,ix,iq) enddo call linear(Nq,Q2_array,Q2tmp_Im,Q2,xBtmp_Im(ix)) call linear(Nq,Q2_array,Q2tmp_Re,Q2,xBtmp_Re(ix)) call linear(NqE,Q2E_array,Q2Etmp_Im,Q2,xBEtmp_Im(ix)) call linear(NqE,Q2E_array,Q2Etmp_Re,Q2,xBEtmp_Re(ix)) enddo call linear(Nx,xB_array,xBtmp_Im,xB,ttmp_Im(it)) call linear(Nx,xB_array,xBtmp_Re,xB,ttmp_Re(it)) call linear(Nx,xB_array,xBEtmp_Im,xB,tEtmp_Im(it)) call linear(Nx,xB_array,xBEtmp_Re,xB,tEtmp_Re(it)) enddo call linear(Nt,t_array,ttmp_Im,t,Hscript_Im_p) call linear(Nt,t_array,ttmp_Re,t,Hscript_Re_p) call linear(Nt,t_array,tEtmp_Im,t,Escript_Im_p) call linear(Nt,t_array,tEtmp_Re,t,Escript_Re_p) return end * 1D linear interpolation subroutine linear(n,xa,ya,x,y) implicit double precision (a-h,o-z) integer n,ns,i dimension xa(n),ya(n) C just in case there is some rounding error y=0.0 C Later added by T. Teckentrup ns=0 dif=abs(x-xa(1)) do i=1,n-1 C Finding the closest index i dift=abs(x-xa(i)) if (dift.le.dif) then ns=i dif=dift endif enddo C x could be greater or smaller than xa(i) if (x.gt.xa(ns)) then y1=ya(ns) y2=ya(ns+1) x1=xa(ns) x2=xa(ns+1) y=((y1-y2)*x+(y2*x1-y1*x2))/(x1-x2) else y1=ya(ns-1) y2=ya(ns) x1=xa(ns-1) x2=xa(ns) y=((y1-y2)*x+(y2*x1-y1*x2))/(x1-x2) endif return end C*********************************************************************** C Integration SUBROUTINE GAUSAB( X, W, A, B, NPT ) C======================================================================= C /b C Gaussian quadratures for | f(x)dx. NPT must be even & <100. C /a C C======================================================================= implicit double precision (a-h,o-z) dimension X(1), W(1) COMMON / GAUSCM / XX(100), WW(100) C----------------------------------------------------------------------- NPT2 = NPT/2 IF( A .EQ. 0. .AND. B .GT. .5E20 ) THEN CALL GAUS(NPT,1) DO 5 N = 1, NPT X(N) = XX(N) W(N) = WW(N) 5 CONTINUE RETURN END IF CALL GAUS(NPT,0) C1 = (B-A)/2. C2 = (B+A)/2. DO 10 N = 1, NPT2 M = NPT2 + 1 - N X(N) = - XX(M)*C1 + C2 W(N) = WW(M)*C1 10 CONTINUE DO 20 N = NPT2+1, NPT M = N - NPT2 X(N) = XX(M)*C1 + C2 W(N) = WW(M)*C1 20 CONTINUE RETURN END C======================================================================= SUBROUTINE GAUS(NN,ITYPE) C C STANDARD SETTINGS ARE: IALF=IBTA=0,0