subroutine scwall (r,z,er,ez) c---calculate electric field components due to image c---charges on wall caused by a ring of charge at z c---having a radius r c---having a radius r (only valid for r.le.0.9*rwall). c--------------------------------------------------------------------------- save c include 'constcom.h' include 'fldcom.h' include 'ucom.h' c common/splwall/ rr(10),s(8),sig(8,10),sx(8,10), * sy(8,10),sxy(8,10) r1=rp z1=zp c-------------------------------------------------------------------------- c* if (r1.lt.rwall) go to 10 if (r1.eq.rwall) go to 3 c---inside wall. set field to zero. er=0. ez=0. return c---calculate fields on wall 3 continue rx=r/rwall sr=abs((z1-z)/rwall) sg=0. c---calculate charge density on wall if sr.lt.4. if (sr.lt.4.) sg=spl2d2 (rx,sr,10,rr,8,s,sig,sx,sy,sxy,8,0,0) ez=0. er=-sg/(twopi*rwall**2) return 10 continue rx=r/rwall ersum=0. ezsum=0. do 20 n=1,7 c---calculate mid point between knots of spline. sb=.5*(s(n)+s(n+1)) c---calculate charge density at mid point sg=spl2d2(rx,sb,10,rr,8,s,sig,sx,sy,sxy,8,0,0) c---calculate total charge on segment q=sg*(s(n+1)-s(n)) c---calculate field components due to charged rings call fldring (r1,z1,rwall,z+sb*rwall,er1,ez1) call fldring (r1,z1,rwall,z-sb*rwall,er2,ez2) c---sum up fields due to all rings. ersum=ersum+q*(er1+er2) ezsum=ezsum+q*(ez1+ez2) 20 continue er=ersum ez=ezsum return end c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*