subroutine hmplotk(ac,title,tim,ipage) c c Plot bounce-averaged complex field ac, vs. pitch angle kappa c implicit none include 'itg.par' include 'itg.cmn' c include 'post.cmn' include 'post2.cmn' complex ac(kz,mz,nz) character title*(*) real tim integer ipage c Used to be local variables, now in itg.cmn (be careful): c real kap(kz) c integer kd,kdpass c local variables: real yval,ymin,ymax,xmin,xmax,ydata(kz),zkapmax integer ic,m,n,isympa,l character*25 strtime character ctitle*80 integer ltitle c c Define the kappa grid for the x-axis: c kd=ldb/2 kdpass=ldb do l=1,kd kap(l)=sin(r(ldb/2+l)/2.) enddo if(epse .gt. 0.0) then zkapmax=1./sqrt(2.*epse) else zkapmax=2.0 endif do l=kd+1,kdpass kap(l)=1.0+(1.0-kap(kd))+(l-kd-1)*(zkapmax-1.0)/(kdpass-kd) enddo c define a mirror point on the other side of the maximum kappa c to make differencing formulas easier: kap(kdpass+1)=zkapmax+(zkapmax-kap(kdpass)) c Loop over real and imaginary parts: do ic=1,2 c Find ymin and ymax for plot: ymin=0. ymax=0. c do 10 n=1,nd n=nplot2 do 10 m=1,md do 10 l=1,kdpass if(ic .eq. 1) yval=real(ac(l,m,n)) if(ic .eq. 2) yval=aimag(ac(l,m,n)) if (yval.gt.ymax) ymax=yval if (yval.lt.ymin) ymin=yval 10 continue c ymax=1.1*ymax c ymin=1.1*ymin xmin=kap(1) xmax=kap(kdpass) if (ymin.eq.ymax) ymax=ymin+1. c put exactly the same title on as old cosine/sine version: if(ic .eq. 1) then ctitle=title//' (real)' else ctitle=title//' (imag)' endif ltitle=index(ctitle,')') call setzer call plchlq(.5,.08,'kappa (pitch angle)',15.,0.,0.) call plchlq(.5,.97,ctitle(1:ltitle),20.,0.,0.) write(strtime,'(a,i3,a,f7.2)') 'n = ',nplot2, ', time = ',tim call plchlq(.98,.93,strtime,15.,0.,1.) call mapsm(xmin,xmax,ymin,ymax) isympa=(ld-1)/10 c plot only a single n (or plots for nonlinear runs take forever): c do 12 n=1,nd n=nplot2 do 12 m=1,md if(ic .eq. 1) then do l=1,kdpass ydata(l)=real(ac(l,m,n)) enddo else do l=1,kdpass ydata(l)=aimag(ac(l,m,n)) enddo endif call dashdb(dash(m)) call curved(kap,ydata,kdpass) 12 continue call finish(ipage) enddo ! end ic=1,2 loop return end