C ********************************************* C C Code to calculate A_C for neutron 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_Neutron 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_Neutron >(a_sign,E_lepton,xB,Qn,t,phi,aJu,aJd, >A_C_Neutron_Full,A_C_Neutron_LT,CS_Full) C Full sum_phi1_full=sum_phi1_full >+A_C_Neutron_Full*w_phi(i) sum_phi2_full=sum_phi2_full >+A_C_Neutron_Full*cos(a_phi_Trento(i))*w_phi(i) C LT sum_phi1_lt=sum_phi1_lt >+A_C_Neutron_LT*w_phi(i) sum_phi2_lt=sum_phi2_lt >+A_C_Neutron_LT*cos(a_phi_Trento(i))*w_phi(i) sum_cs_full=sum_cs_full+CS_Full*w_phi(i) enddo A_C_Neutron_Full_const=sum_phi1_full/(2.0*pi) A_C_Neutron_Full_cos_phi=sum_phi2_full/pi A_C_Neutron_LT_const=sum_phi1_lt/(2.0*pi) A_C_Neutron_LT_cos_phi=sum_phi2_lt/pi UNPOL_CS_Full=sum_cs_full write(6,65) 'Full A_C(Neutron)^const=', >A_C_Neutron_Full_const write(6,65) 'Full A_C(Neutron)^cos_phi=', >A_C_Neutron_Full_cos_phi write(6,65) 'LT A_C(Neutron)^const=', >A_C_Neutron_LT_const write(6,65) 'LT A_C(Neutron)^cos_phi=', >A_C_Neutron_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_Neutron_Full -- keep all harmonics C A_C_Neutron_LT -- keep only LT harmonics subroutine ASYMMETRY_AC_Neutron >(a_sign,E_lepton,x,Qn,t,phi,aJu,aJd, >A_C_Neutron_Full,A_C_Neutron_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_Neutron(x,Qn,y,t,c0_BH_n,c1_BH_n,c2_BH_n) call DVCS_Proton(x,y,c0_DVCS_p) call FORM_FACTOR_NUCLEON(t,F1p,F2p,F1n,F2n) call Dual_Neutron(x,Qn,t,aJu,aJd,Hscript_Im_n, >Hscript_Re_n,Escript_Im_n,Escript_Re_n) 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_n=-Hscript_Im_n Hscript_Re_n=-Hscript_Re_n Escript_Im_n=-Escript_Im_n Escript_Re_n=-Escript_Re_n C Building A_C C Note: a_sign=1 corresponds to electrons C a_sign=-1 corresponds to positrons C Numerator: Interference c0_I_n=-8.0*(2.0-y)*((2.0-y)**2/(1.-y)*(factor_K)**2 >*(F1n*Hscript_Re_n-t/(4.*amn**2)*F2n*Escript_Re_n) >+t/Qn*(1.-y)*(2.-x) >*((F1n*Hscript_Re_n-t/(4.*amn**2)*F2n*Escript_Re_n) >-x**2/(2.0-x)**2*(F1n+F2n)*(Hscript_Re_n+Escript_Re_n))) c1_I_n=-8.0*factor_K*(2.0-2.0*y+y**2) >*(F1n*Hscript_Re_n-t/(4.*amn**2)*F2n*Escript_Re_n) c2_I_n=-16.0*(factor_K)**2/(2.0-x)*(2.0-y) >*(F1n*Hscript_Re_n-t/(4.*amn**2)*F2n*Escript_Re_n) >*(-x) aInt_n_LT=a_sign*1.0/(x*y**3*t*aP1*aP2) >*(c0_I_n+c1_I_n*cos(phi)) aInt_n_Full=a_sign*1.0/(x*y**3*t*aP1*aP2) >*(c0_I_n+c1_I_n*cos(phi)+c2_I_n*cos(2.0*phi)) C Denominator: BH BH_n=1.0/(x**2*y**2*t*aP1*aP2*(1.0+eps)**2) >*(c0_BH_n+c1_BH_n*cos(phi)+c2_BH_n*cos(2.*phi)) C Denominator: DVCS DVCS_n_LT=1.0/(y**2*Qn) >*c0_DVCS_p >*1.0/(2.0-x)**2*(4.*(1.-x)*(Hscript_Im_n**2+Hscript_Re_n**2) >-x**2*2.0*(Hscript_Im_n*Escript_Im_n+Hscript_Re_n*Escript_Re_n) >-(x**2+(2.0-x)**2*t/(4.0*amn**2)) >*(Escript_Im_n**2+Escript_Re_n**2)) c1_DVCS_p=8.0*factor_K/(2.0-x)*(2.0-y)*(-x) DVCS_n_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_n**2+Hscript_Re_n**2) >-x**2*2.0*(Hscript_Im_n*Escript_Im_n+Hscript_Re_n*Escript_Re_n) >-(x**2+(2.0-x)**2*t/(4.0*amn**2)) >*(Escript_Im_n**2+Escript_Re_n**2)) A_C_Neutron_Full=aInt_n_Full/(BH_n+DVCS_n_Full) A_C_Neutron_LT=aInt_n_LT/(BH_n+DVCS_n_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_n+aInt_n_Full+DVCS_n_Full) >*0.389379*(10.0**6) C [Cross section] = nbarn/GeV**2 return end C BH amplitude squared subroutine BH_Neutron(x,Qn,y,t,c0_BH_n,c1_BH_n,c2_BH_n) 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_n=(F1n)**2-t/(4.*amn**2)*(F2n)**2 Comb2_n=(F1n+F2n)**2 C Free neutron c0_BH_n=8.*(factor_K)**2*((2.+3.*eps)*Qn/t*Comb1_n >+2.*x**2*Comb2_n) >+(2.-y)**2*((2.+eps)*(4.*x**2*amn**2/t*(1.+t/Qn)**2 >+4.0*(1.-x)*(1.+x*t/Qn))*Comb1_n >+4.*x**2*(x+(1.-x+0.5*eps)*(1.-t/Qn)**2 >-x*(1.-2.0*x)*t**2/Qn**2)*Comb2_n) >+8.*(1.+eps)*(1.-y-0.25*y**2*eps) >*(2.0*eps*(1.-t/(4.*amn**2))*Comb1_n >-x**2*(1.-t/Qn)**2*Comb2_n) c1_BH_n=8.*factor_K*(2.-y)*((4.*x**2*amn**2/t >-2.*x-eps)*Comb1_n >+2.*x**2*(1.-(1.-2.*x)*t/Qn)*Comb2_n) c2_BH_n=8.*x**2*(factor_K)**2*(4.*amn**2/t*Comb1_n >+2.0*Comb2_n) 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 of the Neutron subroutine Dual_Neutron(xB,Q2,t,aJu,aJd, >Hscript_Im_n,Hscript_Re_n,Escript_Im_n,Escript_Re_n) implicit double precision (a-h,o-z) Parameter (N_E_data_files=49) Character FileName1_n(N_E_data_files)*46, >FileName2_n*46 * Arrays of variables from the read data files dimension xB_array_n(27),Q2_array_n(19),t_array_n(13), >Hscript_Re_array_n(13,27,19),Hscript_Im_array_n(13,27,19) * Temporary arrays used for 3D interpolation dimension Q2tmp_Im_n(19),Q2tmp_Re_n(19),xBtmp_Im_n(27), >xBtmp_Re_n(27),ttmp_Im_n(13),ttmp_Re_n(13) * The same for the GPD E dimension Q2E_array_n(10),Escript_Re_array_n(13,27,10), >Escript_Im_array_n(13,27,10) dimension Q2Etmp_Im_n(10),Q2Etmp_Re_n(10),xBEtmp_Im_n(27), >xBEtmp_Re_n(27),tEtmp_Im_n(13),tEtmp_Re_n(13) data FileName1_n / >'Escript_dual_guidal_Ju06_Jd1_neutron_2009.dat', >'Escript_dual_guidal_Ju06_Jd06_neutron_2009.dat', >'Escript_dual_guidal_Ju06_Jd02_neutron_2009.dat', >'Escript_dual_guidal_Ju06_Jd00_neutron_2009.dat', >'Escript_dual_guidal_Ju06_Jdm02_neutron_2009.dat', >'Escript_dual_guidal_Ju06_Jdm06_neutron_2009.dat', >'Escript_dual_guidal_Ju06_Jdm1_neutron_2009.dat', >'Escript_dual_guidal_Ju04_Jd1_neutron_2009.dat', >'Escript_dual_guidal_Ju04_Jd06_neutron_2009.dat', >'Escript_dual_guidal_Ju04_Jd02_neutron_2009.dat', >'Escript_dual_guidal_Ju04_Jd00_neutron_2009.dat', >'Escript_dual_guidal_Ju04_Jdm02_neutron_2009.dat', >'Escript_dual_guidal_Ju04_Jdm06_neutron_2009.dat', >'Escript_dual_guidal_Ju04_Jdm1_neutron_2009.dat', >'Escript_dual_guidal_Ju02_Jd1_neutron_2009.dat', >'Escript_dual_guidal_Ju02_Jd06_neutron_2009.dat', >'Escript_dual_guidal_Ju02_Jd02_neutron_2009.dat', >'Escript_dual_guidal_Ju02_Jd00_neutron_2009.dat', >'Escript_dual_guidal_Ju02_Jdm02_neutron_2009.dat', >'Escript_dual_guidal_Ju02_Jdm06_neutron_2009.dat', >'Escript_dual_guidal_Ju02_Jdm1_neutron_2009.dat', >'Escript_dual_guidal_Ju00_Jd1_neutron_2009.dat', >'Escript_dual_guidal_Ju00_Jd06_neutron_2009.dat', >'Escript_dual_guidal_Ju00_Jd02_neutron_2009.dat', >'Escript_dual_guidal_Ju00_Jd00_neutron_2009.dat', >'Escript_dual_guidal_Ju00_Jdm02_neutron_2009.dat', >'Escript_dual_guidal_Ju00_Jdm06_neutron_2009.dat', >'Escript_dual_guidal_Ju00_Jdm1_neutron_2009.dat', >'Escript_dual_guidal_Jum02_Jd1_neutron_2009.dat', >'Escript_dual_guidal_Jum02_Jd06_neutron_2009.dat', >'Escript_dual_guidal_Jum02_Jd02_neutron_2009.dat', >'Escript_dual_guidal_Jum02_Jd00_neutron_2009.dat', >'Escript_dual_guidal_Jum02_Jdm02_neutron_2009.dat', >'Escript_dual_guidal_Jum02_Jdm06_neutron_2009.dat', >'Escript_dual_guidal_Jum02_Jdm1_neutron_2009.dat', >'Escript_dual_guidal_Jum04_Jd1_neutron_2009.dat', >'Escript_dual_guidal_Jum04_Jd06_neutron_2009.dat', >'Escript_dual_guidal_Jum04_Jd02_neutron_2009.dat', >'Escript_dual_guidal_Jum04_Jd00_neutron_2009.dat', >'Escript_dual_guidal_Jum04_Jdm02_neutron_2009.dat', >'Escript_dual_guidal_Jum04_Jdm06_neutron_2009.dat', >'Escript_dual_guidal_Jum04_Jdm1_neutron_2009.dat', >'Escript_dual_guidal_Jum06_Jd1_neutron_2009.dat', >'Escript_dual_guidal_Jum06_Jd06_neutron_2009.dat', >'Escript_dual_guidal_Jum06_Jd02_neutron_2009.dat', >'Escript_dual_guidal_Jum06_Jd00_neutron_2009.dat', >'Escript_dual_guidal_Jum06_Jdm02_neutron_2009.dat', >'Escript_dual_guidal_Jum06_Jdm06_neutron_2009.dat', >'Escript_dual_guidal_Jum06_Jdm1_neutron_2009.dat'/ common /Dual_Data/xB_array_n,Q2_array_n,t_array_n, >Hscript_Re_array_n,Hscript_Im_array_n,Q2E_array_n, >Escript_Re_array_n,Escript_Im_array_n C Reading the data file for CFF H open(11,file='Hscript_dual_guidal_neutron_2009.dat', >status='unknown') Nt=13 Nx=27 Nq=19 do it=1,Nt do ix=1,Nx do iq=1,Nq read(11,*)xB_array_n(ix),Q2_array_n(iq),t_array_n(it), >Hscript_Im_array_n(it,ix,iq),Hscript_Re_array_n(it,ix,iq) enddo enddo enddo close(11) 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_n=FileName1_n(1) else if (aJu.eq.0.6.and.aJd.eq.0.6) then FileName2_n=FileName1_n(2) else if (aJu.eq.0.6.and.aJd.eq.0.2) then FileName2_n=FileName1_n(3) else if (aJu.eq.0.6.and.aJd.eq.0.0) then FileName2_n=FileName1_n(4) else if (aJu.eq.0.6.and.aJd.eq.-0.2) then FileName2_n=FileName1_n(5) else if (aJu.eq.0.6.and.aJd.eq.-0.6) then FileName2_n=FileName1_n(6) else if (aJu.eq.0.6.and.aJd.eq.-1.0) then FileName2_n=FileName1_n(7) else if (aJu.eq.0.4.and.aJd.eq.1.0) then FileName2_n=FileName1_n(8) else if (aJu.eq.0.4.and.aJd.eq.0.6) then FileName2_n=FileName1_n(9) else if (aJu.eq.0.4.and.aJd.eq.0.2) then FileName2_n=FileName1_n(10) else if (aJu.eq.0.4.and.aJd.eq.0.0) then FileName2_n=FileName1_n(11) else if (aJu.eq.0.4.and.aJd.eq.-0.2) then FileName2_n=FileName1_n(12) else if (aJu.eq.0.4.and.aJd.eq.-0.6) then FileName2_n=FileName1_n(13) else if (aJu.eq.0.4.and.aJd.eq.-1.0) then FileName2_n=FileName1_n(14) else if (aJu.eq.0.2.and.aJd.eq.1.0) then FileName2_n=FileName1_n(15) else if (aJu.eq.0.2.and.aJd.eq.0.6) then FileName2_n=FileName1_n(16) else if (aJu.eq.0.2.and.aJd.eq.0.2) then FileName2_n=FileName1_n(17) else if (aJu.eq.0.2.and.aJd.eq.0.0) then FileName2_n=FileName1_n(18) else if (aJu.eq.0.2.and.aJd.eq.-0.2) then FileName2_n=FileName1_n(19) else if (aJu.eq.0.2.and.aJd.eq.-0.6) then FileName2_n=FileName1_n(20) else if (aJu.eq.0.2.and.aJd.eq.-1.0) then FileName2_n=FileName1_n(21) else if (aJu.eq.0.0.and.aJd.eq.1.0) then FileName2_n=FileName1_n(22) else if (aJu.eq.0.0.and.aJd.eq.0.6) then FileName2_n=FileName1_n(23) else if (aJu.eq.0.0.and.aJd.eq.0.2) then FileName2_n=FileName1_n(24) else if (aJu.eq.0.0.and.aJd.eq.0.0) then FileName2_n=FileName1_n(25) else if (aJu.eq.0.0.and.aJd.eq.-0.2) then FileName2_n=FileName1_n(26) else if (aJu.eq.0.0.and.aJd.eq.-0.6) then FileName2_n=FileName1_n(27) else if (aJu.eq.0.0.and.aJd.eq.-1.0) then FileName2_n=FileName1_n(28) else if (aJu.eq.-0.2.and.aJd.eq.1.0) then FileName2_n=FileName1_n(29) else if (aJu.eq.-0.2.and.aJd.eq.0.6) then FileName2_n=FileName1_n(30) else if (aJu.eq.-0.2.and.aJd.eq.0.2) then FileName2_n=FileName1_n(31) else if (aJu.eq.-0.2.and.aJd.eq.0.0) then FileName2_n=FileName1_n(32) else if (aJu.eq.-0.2.and.aJd.eq.-0.2) then FileName2_n=FileName1_n(33) else if (aJu.eq.-0.2.and.aJd.eq.-0.6) then FileName2_n=FileName1_n(34) else if (aJu.eq.-0.2.and.aJd.eq.-1.0) then FileName2_n=FileName1_n(35) else if (aJu.eq.-0.4.and.aJd.eq.1.0) then FileName2_n=FileName1_n(36) else if (aJu.eq.-0.4.and.aJd.eq.0.6) then FileName2_n=FileName1_n(37) else if (aJu.eq.-0.4.and.aJd.eq.0.2) then FileName2_n=FileName1_n(38) else if (aJu.eq.-0.4.and.aJd.eq.0.0) then FileName2_n=FileName1_n(39) else if (aJu.eq.-0.4.and.aJd.eq.-0.2) then FileName2_n=FileName1_n(40) else if (aJu.eq.-0.4.and.aJd.eq.-0.6) then FileName2_n=FileName1_n(41) else if (aJu.eq.-0.4.and.aJd.eq.-1.0) then FileName2_n=FileName1_n(42) else if (aJu.eq.-0.6.and.aJd.eq.1.0) then FileName2_n=FileName1_n(43) else if (aJu.eq.-0.6.and.aJd.eq.0.6) then FileName2_n=FileName1_n(44) else if (aJu.eq.-0.6.and.aJd.eq.0.2) then FileName2_n=FileName1_n(45) else if (aJu.eq.-0.6.and.aJd.eq.0.0) then FileName2_n=FileName1_n(46) else if (aJu.eq.-0.6.and.aJd.eq.-0.2) then FileName2_n=FileName1_n(47) else if (aJu.eq.-0.6.and.aJd.eq.-0.6) then FileName2_n=FileName1_n(48) else if (aJu.eq.-0.6.and.aJd.eq.-1.0) then FileName2_n=FileName1_n(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 endif open(12,file=FileName2_n,status='unknown') Nt=13 Nx=27 NqE=10 do it=1,Nt do ix=1,Nx do iq=1,NqE read(12,*)a,Q2E_array_n(iq),a, >Escript_Im_array_n(it,ix,iq),Escript_Re_array_n(it,ix,iq) enddo enddo enddo close(12) * 3D interpolation done separately in all three variables do it=1,Nt do ix=1,Nx do iq=1,Nq Q2tmp_Im_n(iq)=Hscript_Im_array_n(it,ix,iq) Q2tmp_Re_n(iq)=Hscript_Re_array_n(it,ix,iq) enddo do iq=1,NqE Q2Etmp_Im_n(iq)=Escript_Im_array_n(it,ix,iq) Q2Etmp_Re_n(iq)=Escript_Re_array_n(it,ix,iq) enddo call linear(Nq,Q2_array_n,Q2tmp_Im_n,Q2,xBtmp_Im_n(ix)) call linear(Nq,Q2_array_n,Q2tmp_Re_n,Q2,xBtmp_Re_n(ix)) call linear(NqE,Q2E_array_n,Q2Etmp_Im_n,Q2,xBEtmp_Im_n(ix)) call linear(NqE,Q2E_array_n,Q2Etmp_Re_n,Q2,xBEtmp_Re_n(ix)) enddo call linear(Nx,xB_array_n,xBtmp_Im_n,xB,ttmp_Im_n(it)) call linear(Nx,xB_array_n,xBtmp_Re_n,xB,ttmp_Re_n(it)) call linear(Nx,xB_array_n,xBEtmp_Im_n,xB,tEtmp_Im_n(it)) call linear(Nx,xB_array_n,xBEtmp_Re_n,xB,tEtmp_Re_n(it)) enddo call linear(Nt,t_array_n,ttmp_Im_n,t,Hscript_Im_n) call linear(Nt,t_array_n,ttmp_Re_n,t,Hscript_Re_n) call linear(Nt,t_array_n,tEtmp_Im_n,t,Escript_Im_n) call linear(Nt,t_array_n,tEtmp_Re_n,t,Escript_Re_n) 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