source: PSPA/parmelaPSPA/trunk/buncher.f @ 315

Last change on this file since 315 was 12, checked in by lemeur, 12 years ago

parmela pspa initial

File size: 1.0 KB
Line 
1      subroutine buncher(phase,iend,ibeg)
2c---transformation for zero-length buncher
3      save
4c
5      include 'param_sz.h'
6      include 'constcom.h'
7      include 'pcordcom.h'
8      include 'syscom.h'
9      include 'ucom.h'
10c--------------------------------------------------------------------------
11c*
12      ne=rne
13      cay=el(8,ne)
14      rsq=x*x+y*y
15      dwm=el(4,ne)
16      csrs=cay*cay*rsq
17      bgzin=bgz
18      dg=dwm*xi0(csrs)*sin(phase)/erest*sign(1.,bgzin)
19      g=sqrt(1.+bgz**2)+dg
20c-----allow particle to go backward
21      if (g.lt.1.) then
22      g=1+(1-g)
23      bgz=-sign(sqrt(g**2-1.),bgzin)
24      else
25      bgz=sign(sqrt(g**2-1.),bgzin)
26      endif
27      bgzb=.5*(bgzin+bgz)
28      dbgr=dwm*cos(phase)*cay*xi1ox(csrs)/(bgzb*erest)
29      bgx=bgx+dbgr*x
30      bgy=bgy+dbgr*y
31      gamma=sqrt(1.+bgx**2+bgy**2+bgz**2)
32      if(bgz.lt.0.)then
33      ibeg=1
34      else
35      iend=1
36      endif
37      return
38c   10 bgz=0
39c      return
40      end
41c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
Note: See TracBrowser for help on using the repository browser.