subroutine cellimp(wtp,dwtp) c---apply impulse of duration dwtp (in degrees) due to linac cell. c---if dwtp is larger than dwtmax, set dwtp = dwtmax. c---------------------------------------------------------------------- save c include 'param_sz.h' include 'cfldscom.h' include 'constcom.h' include 'misccom.h' include 'outcom.h' include 'pcordcom.h' include 'tstepcom.h' include 'syscom.h' include 'ucom.h' c common/back/bmax,byz0,byzs,pzowmin,pzowmax,iback c-------------------------------------------------------------------------- c* data cp/1./ ne=rne if(iback.eq.1) call byfield(dwtp) nc=el(6,ne) ph=wtp*radian*cellfreq(nc)/freq if(ph.eq.phold)go to 10 sp=sin(ph) cp=cos(ph) phold=ph 10 continue dwtmax=el(7,ne) if(dwtp.gt.dwtmax)dwtp=dwtmax con=dwtp*dcon/erest zc=z+hcll(nc)-zloc(ne) if (el(8,ne).gt.0.) zc=zc-hcll(nc) rsq=x**2+y**2 if (rsq.gt.0.)then r=sqrt(rsq) else r=0. endif call cfield(r,zc,nc,ez,er,bt) s=sp*el(10,ne)+cp*el(9,ne) ezsauv=ez*el(10,ne) if(el(8,ne).eq.-2.) ezsauv=-ezsauv ez=el(5,ne)*ez*s dbgz=ez*con if((ip.eq.999).and.(r.eq.0.)) 1write(nimp,*) z,zc,ezsauv,ez*1.e02 if(rsq.eq.0.)go to 20 c bt component of rf magnetic field c bz beta_z c br beta_r bz=bgz/gamma c=cp*el(10,ne)-sp*el(9,ne) fr=el(5,ne)*(er*s-bz*bt*c) br=sqrt(bgx**2+bgy**2)/gamma c dbgz=dbgz+con*el(5,ne)*br*c !!! dbgz=dbgz+con*el(5,ne)*br*bt*c dbgr=fr*con dbgx=dbgr*x/r dbgy=dbgr*y/r bgx=bgx+dbgx bgy=bgy+dbgy 20 continue bgz=bgz+dbgz gamma=sqrt(1.+bgx**2+bgy**2+bgz**2) return end c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*