subroutine cnplot0(acx,title,tim,ipage) c c Make contour plots of the field acx (complex mode coefficients). c implicit none include 'itg.par' include 'itg.cmn' c include 'post.cmn' integer ntor,l1,l2 parameter(ntor=600) complex acx(lz,mz,nz) real tim,ty(4*mz),tx(4*nz),a2(4*nz,4*mz),ator(ntor,ntor) real work(200*nz*mz),xx0,sc0,f1,f2,s1,s2 real rtor,xtor,ytor,thtor,q,alph,xx,zmax,zmin integer iwork(400*nz*mz),ipage,i,j,l,mr,nr,m,n,mpts,npts character*18 title character*30 maxstr mpts=4*mz npts=4*nz do m=1,mpts c ty(m)=2.0*pi*float(m-1)/float(mpts-1) ty(m)=2.0*pi*float(m-1-mpts/2)/float(mpts-1) enddo do n=1,npts c tx(n)=2.0*pi*float(n-1)/float(npts-1) tx(n)=2.0*pi*float(n-1-npts/2)/float(npts-1) enddo c c contours at theta=0 c l=(ld-1)/2 c zmax=0.0 zmin=0.0 do i=1,npts do j=1,mpts a2(i,j)=0.0 do n=1,nd nr=nrr(n) do m=1,md mr=mrr(m,n) a2(i,j)=a2(i,j)+real(acx(l,m,n))*cos(-mr*ty(j)+nr*tx(i)) & -aimag(acx(l,m,n))*sin(-mr*ty(j)+nr*tx(i)) enddo enddo if (a2(i,j).gt.zmax) zmax=a2(i,j) if (a2(i,j).lt.zmin) zmin=a2(i,j) enddo enddo xx0=y0/(shr*z0)*float((nd-1)/2) sc0=xx0 if (y0.gt.sc0) sc0=y0 write(maxstr,101) zmin,zmax 101 format(' min: ',f7.2,' max: ',f7.2) c Easy way c call ezcntr(a2,npts,mpts) call cpseti('LLP',0) ! no labels on contours c call cpseti('HIP',0) ! no high labels c call cpseti('HLP',0) ! no low labels call cpseti('CLS - CONTOUR LEVEL SELECTION',0) call cpseti('NCL - NUMBER OF CONTOUR LEVELS',14) do j=1,14 call cpseti('PAI - PARAMETER ARRAY INDEX',j) xx=(zmax-zmin)/13.*float(j-1)+zmin call cpsetr('CLV - CONTOUR LEVEL VALUE',xx) call cpseti('CLU - CONTOUR LEVEL USE',3) if (xx.lt.0) call cpseti('CLD - CONTOUR LINE DASH PATTERN',3855) if (xx.ge.0) call cpseti('CLD - CONTOUR LINE DASH PATTERN',65535) enddo call setzer call plchlq(.5,.95,title,20.,0.,0.) call plchlq(.65,.91,maxstr,9.,0.,-1.) c call conop4('DAS=LSS','$$''''$$''''$''',0,0) c call conop1('MES=OFF') c call conop1('PMM=ON') c call conop2('SSZ=ON',100) call cpseti('SET',0) call cpseti('MAP',3) call cpsetr('XC1',-xx0*pi) call cpsetr('XCM',xx0*pi) call cpsetr('YC1',-y0*pi) call cpsetr('YCN',y0*pi) call maps(-sc0*pi,sc0*pi,-sc0*pi,sc0*pi) call cprect(a2,npts,npts,mpts,work,200*mpts*npts,iwork, & 400*mpts*npts) call cpcldr(a2,work,iwork) c call cplbdr(a2,work,iwork) call finish(ipage) c if (title(1:9).eq.'Potential') then write(9,*) '------ Contour data ' write(9,*) mpts,npts do j=1,mpts do i=1,npts write(9,*) a2(i,j) enddo enddo c c skip this section usually, it just makes fancy annulus data c goto 33 do i=1,ntor do j=1,ntor ator(i,j)=0.0 xtor=float(i-1)/float(ntor-1)-0.500001 ytor=float(j-1)/float(ntor-1)-0.500001 rtor=sqrt(xtor**2+ytor**2)*2.*60. thtor=atan2(ytor,xtor) if ((rtor.gt.50.2).and.(rtor.lt.55.8)) then do l=1,ld-1 if ((r(l).lt.thtor).and.(r(l+1).gt.thtor)) then l1=l l2=l+1 endif enddo do n=1,nd nr=nrr(n) do m=1,md mr=mrr(m,n) q=qsf*(1.+(rtor-53.)/53.*shr) alph=-float(mr)*11.*q*(thtor-r0(m,n)) s1=thtor-r(l1) s2=r(l2)-thtor f1=s2/(s1+s2) f2=s1/(s1+s2) ator(i,j)=ator(i,j)+f1*( & real(acx(l1,m,n))*cos(alph)+aimag(acx(l1,m,n))*sin(alph) ) ator(i,j)=ator(i,j)+f2*( & real(acx(l2,m,n))*cos(alph)+aimag(acx(l2,m,n))*sin(alph) ) enddo enddo endif enddo enddo write(9,*) '------ more Contour data' write(9,*) ntor,ntor do i=1,ntor do j=1,ntor write(9,*) ator(i,j) enddo enddo 33 continue endif return end