c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++* c graphic part not use in Orsay * c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++* subroutine ggplot (i,option,core,m,ngood,ns) c----------------------------------------------------------------------- c include 'param_sz.h' include 'ucom.h' c common/com1/scale(10),ws,ps,zs,bgs,wts,ntape common/outbuf/tcor(8,imaa*imb) character*10 label(6) real x(2,imaa),y(2,imaa) dimension core(m,imaa), scl(4), it(2) dimension xb(2),yb(2),xsq(2),ysq(2),xy(2),a(2),b(2),e(2) equivalence (tcor(1,(imb-1)*imaa+1),x(1,1)) equivalence (tcor(1,(imb-1)*imaa+imaa/2),y(1,1)) c-------------------------------------------------------------------------- c* data label /'x-xprime ','y-yprime ','phi-w ','z-zprime ' 1 ,'x-y ','no plot '/ do 2 n=1,2 xb(n)=0. yb(n)=0. xy(n)=0. xsq(n)=0. ysq(n)=0. a(n)=0. b(n)=0. 2 e(n)=0. nc=i k=ns-1 do 5 n=1,4 k=k+1 5 scl(n)=scale(k) if (nc.eq.0) nc=amod(wts,360.) it(1)=option/10.0 if (it(1).eq.0) it(1)=6 it(2)=option-it(1)*10 if (it(2).eq.0) it(2)=6 do 130 n=1,2 itype=it(n) if (itype.le.0) go to 110 go to (10,30,50,50,90), itype c x-xp space 10 do 20 np=1,ngood x(n,np)=core(1,np) y(n,np)=core(2,np) if (i.eq.0) y(n,np)=y(n,np)/core(6,np) 20 continue go to 130 c y-yp space 30 do 40 np=1,ngood x(n,np)=core(3,np) y(n,np)=core(4,np) if (i.eq.0) y(n,np)=y(n,np)/core(6,np) 40 continue go to 130 50 if (i.eq.0) go to 70 c phi-w space do 60 np=1,ngood x(n,np)=core(5,np)-ps 60 y(n,np)=core(6,np)-ws it(n)=3 go to 130 c z-zp space 70 do 80 np=1,ngood x(n,np)=core(5,np)-zs 80 y(n,np)=core(6,np)/bgs - 1. it(n)=4 go to 130 c x-y space 90 do 100 np=1,ngood x(n,np)=core(1,np) 100 y(n,np)=core(3,np) go to 130 c no graph 110 do 120 np=1,ngood x(n,np)=0.0 120 y(n,np)=0.0 130 continue fng=ngood do 135 n=1,2 do 133 np=1,ngood xb(n)=xb(n)+x(n,np) yb(n)=yb(n)+y(n,np) xy(n)=xy(n)+x(n,np)*y(n,np) xsq(n)=xsq(n)+x(n,np)**2 133 ysq(n)=ysq(n)+y(n,np)**2 xb(n)=xb(n)/fng yb(n)=yb(n)/fng xy(n)=xy(n)/fng - xb(n)*yb(n) xsq(n)=xsq(n)/fng-xb(n)**2 ysq(n)=ysq(n)/fng-yb(n)**2 if(xsq(n)*ysq(n).le.0.)go to 135 e(n)=sqrt(xsq(n)*ysq(n)-xy(n)**2) a(n)=-xy(n)/e(n) if(it(n).le.3)e(n)=1000.*e(n) b(n)=xsq(n)/e(n) if(it(n).le.2)e(n)=e(n)*bgs 135 continue it1=it(1) it2=it(2) write(ntape,140)label(it1),scl(1),scl(2),zs,ngood,label(it2), 1 scl(3),scl(4) call ttyplot (x,y,ngood,scl,ntape) write(ntape,150) a(1),b(1),e(1),a(2),b(2),e(2) return c 140 format (/,1x,a10,f7.3,' x',f6.3,' zr=',f7.1,' ngood=',i4, * 1x,a10,f7.3,' x',f6.3) 150 format (10x,'alpha',6x,'beta',6x,'erms',15x,'alpha',6x,'beta', 1 6x,'erms'/5x,3f10.3,10x,3f10.3) end c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++* subroutine ttyplot (x,y,np,scale,ntape) c generate 2 plots on tape ntape include 'param_sz.h' include 'ucom.h' c character*1 aline dimension x(2,imaa), y(2,imaa), scale(4), iword(39,2,25), 1 aline(80) c-------------------------------------------------------------------------- c* do 10 n=1,25 do 10 j=1,39 iword(j,1,n)=0 iword(j,2,n)=0 10 continue c load first plot dx=scale(1)/18.0 dy=scale(2)/12.0 do 20 n=1,np nv=13.5-y(1,n)/dy if (nv.le.0) go to 20 if (nv.gt.25) go to 20 nh=20.5+x(1,n)/dx if (nh.gt.39) go to 20 if (nh.le.0) go to 20 iword(nh,1,nv)=1 20 continue c load second plot dx=scale(3)/18.0 dy=scale(4)/12.0 do 30 n=1,np nv=13.5-y(2,n)/dy if (nv.le.0) go to 30 if (nv.gt.25) go to 30 nh=20.5+x(2,n)/dx if (nh.le.0) go to 30 if (nh.gt.39) go to 30 iword(nh,2,nv)=1 30 continue do 40 n=1,25 m=0 if (n.eq.1) m=1 if (n.eq.13) m=1 if (n.eq.25) m=1 call ttyline (iword(1,1,n),m,aline,0) write(ntape,50) aline 40 continue return c 50 format (80a1) end c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++* subroutine pplot (i,option,core,m,ngood) c include 'param_sz.h' include 'ucom.h' c c generate 2 profile or distribution function plots on the tty c common/blcom1/x,y common/com1/scale(10),ws,ps,zs,bgs,wts,ntape common/outbuf/tcor(8,imaa*imb) character*10 label(11) real x(2,imaa),y(2,imaa) dimension core(m,imaa), scl(4),it(2) equivalence (tcor(1,(imb-1)*imaa+1),x(1,1)) equivalence (tcor(1,(imb-1)*imaa+imaa/2),y(1,1)) c-------------------------------------------------------------------------- c* data label /'x profile ','xp profile','y profile ', 1'yp profile','p profile ','w profile ','r profile ', 2'rp profile','no profile','z profile ','zp profile'/ opt=abs(option) itype=opt/10.0 nc=i scl(1)=scale(5) scl(3)=scale(6) if(nc.eq.0)nc=amod(wts,360.) do 110 n=1,2 nn=2*n-1 it(n)=itype if (itype.le.0) go to 90 go to (10,25,10,25,30,50,70,70,90), itype c x or y 10 do 20 np=1,ngood 20 x(n,np)=core(itype,np) go to 110 c xp or yp 25 if (i.ne.0)go to 10 do 26 np=1,ngood 26 x(n,np)=core(itype,np)/core(6,np) go to 110 30 if (i.eq.0) go to 45 c p-ps do 40 np=1,ngood 40 x(n,np)=core(5,np)-ps go to 110 c z-zs 45 do 46 np=1,ngood 46 x(n,np)=core(5,np)-zs it(n)=10 go to 110 50 if (i.eq.0) go to 65 c w-ws do 60 np=1,ngood 60 x(n,np)=core(6,np)-ws go to 110 c zp 65 do 66 np=1,ngood 66 x(n,np)=core(6,np)/bgs-1. it(n)=11 go to 110 c r or rp 70 do 80 np=1,ngood x(n,np)=sqrt(core(1,np)**2+core(3,np)**2) if (itype.ne.8) go to 80 if (x(n,np).ne.0.0) x(n,np)=(core(1,np)*core(2,np)+core(3,np)*core 1 (4,np))/x(n,np) if (x(n,np).eq.0.0) x(n,np)=sqrt(core(2,np)**2+core(4,np)**2) 80 continue go to 110 c no graph 90 do 100 np=1,ngood 100 x(n,np)=0.0 110 itype=opt-itype*10 if(option.lt.0.)go to 170 do 130 n=1,2 nn=2*n-1 dx=scl(nn)/18. xmax=19.*dx call pdist(ngood,x(n,1),xmax,39,y(n,1)) ymax=0. do 120 j=1,38 y(n,j)=y(n,j+1)-y(n,j) if(y(n,j).gt.ymax)ymax=y(n,j) 120 continue scl(nn+1)=.005 if(ymax.gt.0.01)scl(nn+1)=.02 if(ymax.gt.0.02)scl(nn+1)=.04 if(ymax.gt.0.04)scl(nn+1)=.10 if(ymax.gt.0.10)scl(nn+1)=.20 if(ymax.gt.0.20)scl(nn+1)=.40 if(ymax.gt.0.40)scl(nn+1)=1.0 do 125 j=1,37 x(n,j)=(j-1)*dx-scl(nn) 125 y(n,j)=y(n,j)-.5*scl(nn+1) 130 continue it1=it(1) it2=it(2) write(ntape,140) label(it1),scl(1),scl(2),zs,ngood, * label(it2),scl(3),scl(4) scl(2)=.5*scl(2) scl(4)=.5*scl(4) 140 format(1x,a10,f8.3,' x ',f4.2,' zs=',f7.1,' ngood=',i4,1x,a10, * f8.3,' x ',f4.2) call ttyplot(x,y,37,scl,ntape) return c plot distribution functions 170 do 190 n=1,2 nn=2*n-1 scl(nn+1)=.5 call pdist(ngood,x(n,1),scl(nn),37,y(n,1)) dx=scl(nn)/18. do 180 j=1,37 x(n,j)=(j-1)*dx-scl(nn) 180 y(n,j)=y(n,j)-.5 190 continue it1=it(1) it2=it(2) write(ntape,160) label(it1),scl(1),zs,ngood,label(it2),scl(3) call ttyplot(x,y,37,scl,ntape) return c 150 format (8a10) 160 format (5x,a10,4x,f8.3,' zs=',f7.1,' ngood=',i4, 2x,a10,4x,f8.3) end c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++* subroutine ttyline (ib,m,line,nc) c produce an 80-character line for plotting on tty c if m.ne.0, fill line with minus signs for horizontal border c c include 'param_sz.h' c include 'ucom.h' c character*1 line(80) character*1 minus ,iast ,iblnk ,ii,ichar include 'param_sz.h' include 'ucom.h' dimension ib(39,2) c----------------------------------------------------------------------- c* data minus /'-'/, iast /'*'/ data iblnk /' '/, ii /'i'/ c set leading blanks line(1)=iblnk line(41)=iblnk do 50 j=1,2 do 40 k=2,40 ij=k+40*(j-1) c make ichar blank, minus, or i ichar=iblnk if (m.eq.0) go to 20 if (k.ne.2.and.k.ne.40) ichar=minus 20 continue if (k.eq.3 .or. k.eq.21 .or. k.eq.39) ichar=ii c if sign bit of mask is set, plot an asterisk if (ib(k-1,j).ne.0) ichar=iast line(ij)=ichar 40 continue 50 continue if (nc.eq.0) return ihun=nc/100 ibal=nc-(ihun*100) iten=ibal/10 ibal=ibal-(10*iten) c encode (2,60,line(41)) iten write(line(41),60)iten c encode (2,60,line(42)) ibal write(line(42),60)ibal if (ihun.eq.0) return c encode (1,60,line(40)) ihun write(line(40),60)ihun return c 60 format (i1) end