source: PSPA/parmelaPSPA/trunk/cellfld.for @ 418

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

parmela pspa initial

File size: 2.5 KB
Line 
1      subroutine cellfld(cl,nc)
2c     cell initialization
3c----------------------------------------------------------------------
4      save
5c
6      include 'param_sz.h'
7      include 'cfldscom.h'
8      include 'constcom.h'
9      include 'misccom.h'
10      include 'syscom.h'
11      include 'ucom.h'
12c
13      common/jones/ajones,zjones,zcath(imaa)
14      common/fcoef/ncoef(100),noff(100),ncer(100)
15c--------------------------------------------------------------------------
16c*
17      hcll(nc)=.5*cl
18      beta=2.*cl/wavel
19      cellfreq(nc)=freq
20      lctype=ltype
21      if(nn.ge.9)then
22      if(vv(9).ne.0.)cellfreq(nc)=vv(9)
23      beta=beta*cellfreq(nc)/freq
24      endif
25      if(nn.ge.10.and.vv(10).ne.0.)lctype=vv(10)
26      phi=el(4,nel)*radian
27      el(9,nel)=sin(phi)
28      el(10,nel)=cos(phi)
29      el(4,nel)=cellfreq(nc)
30      do 30 i = 1,numcf
31      fc(i,nc) = 0.
32   30 continue
33      if (ip.eq.1 .or. ip.eq.2) then
34        write(nnout,20) lctype,cellfreq(nc),hcll(nc)
35   20   format (
36     . ' cell type =',t40,i8/
37     . ' cell frequency =',t40,1pg12.3,' MHz'/
38     . ' "half-cell" length =',t40,g12.3,' cm')
39        if (nel.eq.1.and.ajones.gt.0.) then
40          write(nnout,21)
41   21     format (' rf fields from analytic form of M. Jones')
42          return
43        endif
44      endif
45      if(nn.gt.11) then
46      np=nn
47      ncoef(nel)=vv(12)
48      noff(nel)=vv(13)
49      ncer(nel)=vv(14)
50      nmax=14+ncoef(nel)
51      if(np.gt.nmax)np=nmax
52      do 10 i=15,nmax
53      fc(i-14,nc)=vv(i)
54   10 continue
55        if (ip.eq.1 .or. ip.eq.2) then
56          write(nnout,39) ncoef(nel),noff(nel)
57   39     format (' No. of Fourier coefs =',t40,i8/
58     .    ' odd/even cosines =',t40,i8)
59          write(nnout,40) nmax
60   40     format (' Using vv(15 to ',i2,') as Fourier coefficents of'
61     .    ,' this cell')
62          write(nnout,41) ncer(nel)
63   41     format (' No. of Fourier coefs used in er calculation =',
64     .    t50,i8)
65        endif
66        go to 100
67      endif
68c        get fourier coefficients for special cells from tables
69      ncoef(nel) = 14
70      noff(nel)  =  1
71      ncer(nel)  = 14
72      iflag(nc)=1
73      if(iflag(nc).ne.0)return
74      if(lctype.eq.8.and.abs(hcll(nc)-2.21).lt..01)beta=1.02
75      if(lctype.eq.6)call rtmfc(beta,fc(1,nc))
76      if(lctype.eq.2)call sccfc(beta,fc(1,nc))
77      if(lctype.ne.1.and.lctype.ne.2)call genfc(beta,fc(1,nc))
78      return
79c         make lookup table for rf field
80  100 continue
81      call genfld(nc)
82      return
83      end
84c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
Note: See TracBrowser for help on using the repository browser.