source: PSPA/parmelaPSPA/trunk/genfld.f @ 465

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

parmela pspa initial

File size: 1.5 KB
Line 
1      subroutine genfld(nc)
2c---------------------------------------------------------------------------
3c
4      include 'param_sz.h'
5      include 'cfldscom.h'
6      include 'constcom.h'
7      include 'misccom.h'
8      include 'pcordcom.h'
9      include 'syscom.h'
10      include 'ucom.h'
11
12c
13      common/fcoef/ncoef(100),noff(100),ncer(100)
14      common/pr/nz,nr,zbm(numz),rbm(numr)
15c--------------------------------------------------------------------------
16c*
17      ne=nel
18      rmax=el(2,ne)
19      iflag(nc)=-1
20      zmax=hcll(nc)
21      dz=zmax/(numz-1)
22      dr(nc)=rmax/(numr-1)
23      cwavel=wavel*freq/cellfreq(nc)
24      con1=twopi/cwavel
25      cl=2.*hcll(nc)
26      con2=pi/cl
27      ncf=ncoef(ne)
28      do 60 i=1,numz
29      zz=(i-1)*dz
30      zbm(i)=zz
31      a=con2*zz
32      do 60 k=1,numr
33      r=(k-1)*dr(nc)
34      rbm(k)=r
35      rsq=r**2
36      er=0.
37      ez=0.
38      bt=0.
39      do 40 j=1,ncf
40      xm=2*j-noff(ne)
41      c1=cos(xm*a)
42      s1=sin(xm*a)
43      caymsq=(xm*con2)**2-con1**2
44      crsq=caymsq*rsq
45      ez=ez+fc(j,nc)*xi0(crsq)*c1
46      if(r.eq.0.)go to 30
47      if(j.gt.ncer(ne)) go to 30
48      t1=fc(j,nc)*xi1ox(crsq)
49      er=er+t1*xm*s1
50      bt=bt+t1*c1
51   30 continue
52   40 continue
53      er=er*con2*r
54      bt=bt*con1*r
55      fer(k,i,nc)=er
56      fez(k,i,nc)=ez
57      fbt(k,i,nc)=bt
58 60   continue
59      nz=numz       
60      nr=numr   
61      if(ip.eq.2) call prchold(nc)
62      if(ip.eq.3) call prch(nc)
63      return
64      end
65c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
Note: See TracBrowser for help on using the repository browser.