source: PSPA/parmelaPSPA/trunk/scwall.f @ 418

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

parmela pspa initial

File size: 1.7 KB
Line 
1      subroutine scwall (r,z,er,ez)
2c---calculate electric field components due to image
3c---charges on wall caused by a ring of charge at z
4c---having a radius r
5c---having a radius r (only valid for r.le.0.9*rwall).
6c---------------------------------------------------------------------------
7      save
8c
9      include 'constcom.h'
10      include 'fldcom.h'
11      include 'ucom.h'
12c
13      common/splwall/ rr(10),s(8),sig(8,10),sx(8,10),
14     *                sy(8,10),sxy(8,10)
15      r1=rp
16      z1=zp
17c--------------------------------------------------------------------------
18c*
19      if (r1.lt.rwall) go to 10
20      if (r1.eq.rwall) go to 3
21c---inside wall.  set field to zero.
22      er=0.
23      ez=0.
24      return
25c---calculate fields on wall
26    3 continue
27      rx=r/rwall
28      sr=abs((z1-z)/rwall)
29      sg=0.
30c---calculate charge density on wall if sr.lt.4.
31      if (sr.lt.4.) sg=spl2d2 (rx,sr,10,rr,8,s,sig,sx,sy,sxy,8,0,0)
32      ez=0.
33      er=-sg/(twopi*rwall**2)
34      return
35   10 continue
36      rx=r/rwall
37      ersum=0.
38      ezsum=0.
39         do 20 n=1,7
40c---calculate mid point between knots of spline.
41         sb=.5*(s(n)+s(n+1))
42c---calculate charge density at mid point
43         sg=spl2d2(rx,sb,10,rr,8,s,sig,sx,sy,sxy,8,0,0)
44c---calculate total charge on segment
45          q=sg*(s(n+1)-s(n))
46c---calculate field components due to charged rings
47         call fldring (r1,z1,rwall,z+sb*rwall,er1,ez1)
48         call fldring (r1,z1,rwall,z-sb*rwall,er2,ez2)
49c---sum up fields due to all rings.
50         ersum=ersum+q*(er1+er2)
51         ezsum=ezsum+q*(ez1+ez2)
52   20    continue
53      er=ersum
54      ez=ezsum
55      return
56      end
57c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
Note: See TracBrowser for help on using the repository browser.