Line | |
---|
1 | subroutine cathode(dwtp,iend,ibeg) |
---|
2 | c---------------------------------------------------------------------- |
---|
3 | c |
---|
4 | include 'param_sz.h' |
---|
5 | include 'bfieldcom.h' |
---|
6 | include 'constcom.h' |
---|
7 | include 'pcordcom.h' |
---|
8 | include 'syscom.h' |
---|
9 | include 'ucom.h' |
---|
10 | c |
---|
11 | common/cathcur/rcur |
---|
12 | c-------------------------------------------------------------------------- |
---|
13 | c* |
---|
14 | ne=rne |
---|
15 | bz=bgz/gamma |
---|
16 | dz=bz*dcon*dwtp |
---|
17 | c----particle will be moved into next element during this step. |
---|
18 | c----the next element should be a cell of length greater then |
---|
19 | c----the distance this element moves the particles. |
---|
20 | c----the next element in particular must not have zero length! |
---|
21 | c----the location of this element should be at z=0. a zero length |
---|
22 | c----drift could preceed this element. |
---|
23 | if(dz.ge.0.)iend=1 |
---|
24 | c-----allow particle to go backwards |
---|
25 | if(ne.ge.1.and.dz.lt.0.and.z+dz.le.zloc(ne-1))then |
---|
26 | c----particle will cross into previous element during this step |
---|
27 | ibeg=1 |
---|
28 | endif |
---|
29 | r=sqrt(x*x+y*y) |
---|
30 | if(iend.eq.1.and.rcur.gt.r)then |
---|
31 | theata=asin(r/rcur) |
---|
32 | dz=rcur*(1.-cos(theata)) |
---|
33 | z=z+dz |
---|
34 | bgz=bgz*cos(theata) |
---|
35 | bgr=-bgz*sin(theata) |
---|
36 | if(r.ne.0.)then |
---|
37 | bgx=x/r*bgr |
---|
38 | bgy=y/r*bgr |
---|
39 | endif |
---|
40 | endif |
---|
41 | if(ibeg.eq.1)z=zloc(ne-1) |
---|
42 | dwtp=0. |
---|
43 | return |
---|
44 | end |
---|
45 | c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++* |
---|
Note: See
TracBrowser
for help on using the repository browser.