subroutine cellfeld(fileelec,nc,ne,ns) c---------------------------------------------------------------------- c modifie glm : suppression de filesuper (var_char.h) remplace par fileelec c include 'param_sz.h' include 'cfldscom.h' include 'constcom.h' include 'misccom.h' include 'syscom.h' c include 'var_char.h' include 'ucom.h' c common/cathcur/rcur common/pr/nz,nr,zbm(numz),rbm(numr) logical rcurflag c-------------------------------------------------------------------------- c* character*256 fileelec data rcurflag/.true./ itest=0 iorsay=0 c open (unit=nfld,file=filesuper//'.sffld',status='old') nlast = index(fileelec, ' ') print *, ' cellfeld recoit : ', fileelec if (nlast .eq. 0) nlast = len(fileelec) + 1 open (unit=nfld,file=fileelec(1:nlast-1)//'.sffld', 1 status='old') do 100 i=nc,ne,ns if(i.gt.numc)then write(ndiag,*)'cell number must less then or equal to',numc, 1 ' nc=',i return endif read(nfld,*) zmin,zmax,nz,sffreq if( sffreq.eq.0.)then sffreq=cellfreq(i) rewind(nfld) read(nfld,*) zmin,zmax,nz endif read(nfld,*) rmin,rmax,nr if(hcll(i).eq.0.)then write(ndiag,*)'no data for cell number nc=',i return endif r=hcll(i)/(zmax-zmin) if(abs(r-1.).gt.01)then write(ndiag,*) ' warning cell length doesn''t match cfield data' endif dr(i)=r*rmax/(numr-1) drp=dr(i) drbm=(rmax-rmin)/nr dz=(zmax-zmin)/(numz-1) dzbm=(zmax-zmin)/nz if(itest.eq.1) write(ndiag,*) ' dz = ',dz,' drbm = ',drbm if(nz.le.numz-1.and.nr.le.numr-1)then do 10 j=1,nr+1 rbm(j)=(j-1)*drbm do 10 k=1,nz+1 zbm(k)=(k-1)*dzbm read(nfld,*) fez(j,k,i),fer(j,k,i),dum,fbt(j,k,i) c--- the factor .0001/.26544 scales the B field from sfo7 to be in units c of Mv/m . In sfo7 h is multiplied by .26544 and er and ez are c multiplied by .0001. Before these factors were used in sfo7 er and bt c had the same units. The superfish frequency may be slightly different c than the cell frequency so the B field must be scaled by this ratio. fbt(j,k,i)=fbt(j,k,i)*.0001/.26544*cellfreq(i)/sffreq 10 continue endif iflag(i)=-1 100 continue close(nfld) check if a curved cathode is in use. if (rcur.ne.0.and.rcurflag)then curved cathode so fix the first cells field data rcurflag=.false. do 15 i=2,numr aa=asin((i-1)*drp/rcur) z=rcur*(1.-cos(aa)) j=z/dz+1 if(fbt(i,j,nc).eq.0..and.fbt(i,j+1,nc).ne.0.)then fbt(i,j,nc)=fbt(i,j+1,nc)*2-fbt(i,j+2,nc) fez(i,j,nc)=fez(i,j+1,nc)*2-fez(i,j+2,nc) fer(i,j,nc)=fer(i,j+1,nc)*2-fer(i,j+2,nc) endif 15 continue endif if(ip.eq.3) call prch(nc) if(ip.eq.2.and.iorsay.eq.1) call prchold(nc) return end c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*