source: PSPA/parmelaPSPA/trunk/byfield.f @ 448

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

parmela pspa initial

File size: 890 bytes
Line 
1      subroutine byfield(dwtp) ! Lui
2c     this subroutine describe the applied transverse bending field
3c     vertically traversing the cathode cavity
4c------------------------------------------------------------------------
5c
6      include 'constcom.h'
7      include 'pcordcom.h'
8      include 'tstepcom.h'
9c
10      common/back/bmax,byz0,byzs,pzowmin,pzowmax,iback
11c-----------------------------------------------------------------------
12c*
13      data itest/0/
14      bdis(z)=1./(1.+((z-byz0)/byzs)**2) 
15      if(bmax.eq.0.0) go to 20
16      if(itest.eq.0) then
17              byc0=bmax/brhof
18              itest=1
19      endif
20      dd=dcon*dwtp
21      bz=bgz/gamma
22      bx=bgx/gamma
23      byc=byc0*bdis(z)
24      dbgx=byc*bz*dd
25      dbgz=-byc*bx*dd
26      bgx=bgx+dbgx
27      bgz=bgz+dbgz
2820    continue
29      return
30      end
31c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
Note: See TracBrowser for help on using the repository browser.