source: PSPA/parmelaPSPA/trunk/outlaldp.f @ 75

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

parmela pspa initial

File size: 3.7 KB
Line 
1      subroutine outlaldp
2c         from SLAC modified LAL
3c         type 2 plots x-xprime, y-yprime, x-y,x and y profiles
4c         and prints normalized rms, 100% and 90% emittance for
5c         x-xp and y-yp
6c         xmax and ymax in cm
7c         xpmax and ypmax in mrads.
8c-------------------------------------------------------------------------
9c
10      include 'param_sz.h'
11      include 'constcom.h'
12      include 'ncordscom.h'
13      include 'ucom.h'
14c
15      double precision hor(imaa),vrt(imaa),x(imaa)
16      double precision gam
17      double precision xrms,yrms,x90,x100,y90,y100
18      double precision a,b
19      common/cout7/corout7(6,imaa),spbgs,ne,nbufl,iout7
20      common/ct/var,rp,dzmin,dzmax,wrm,dwbm,xrmsbg,yrmsbg,
21     1xsmax,xpsmax,ysmax,ypsmax,istat,nebm
22c--------------------------------------------------------------------------
23c*
24      itest=0
25      if(iout7.eq.1) then
26        write(nemit,*) ' '
27          if(itest.eq.1) then
28          write(nemit,*)' units betagamma mm-mrad normalized emittance'
29          write(nemit,*) ' '
30          itest=1
31          else
32          write(nemit,*) ' units mm-mrad unormalized emittance'
33          write(nemit,*)' '
34          endif
35        write(nemit,370)
36        write(nemit,330)
37      else
38      endif
39      nbufe=nbufl
40c             plot xprime vs x
41      n=0
42      do 10 n10=1,nbufe
43      gam=corout7(6,n10)/erest
44      x(n10)=dsqrt(gam*(2.+gam))
45      if(x(n10).eq.0.) go to 10
46      n=n+1
47      hor(n)=corout7(1,n10)
48      vrt(n)=corout7(2,n10)*1000.
49   10 continue
50      if (n.lt.50) go to 30
51c     calculate rms,maxe,90%e and save all three.
52      do 15 np=1,n
53      vrt(np)=x(np)*vrt(np)
54  15  continue
55      nt90=1
56      call emit90dp(nt90,n,hor,vrt,a,b,x90,x100,xrms)
57      aax=a
58      bbx=b
59c             plot yprime vs y
60   30 continue
61      do 40 np=1,n
62      hor(np)=corout7(3,np)
63      vrt(np)=corout7(4,np)*1000.
64   40 continue
65      if (n.lt.50) go to 60
66      do 45 np=1,n
67      vrt(np)=x(np)*vrt(np)
68   45 continue
69      nt90=2
70      call emit90dp(nt90,n,hor,vrt,a,b,y90,y100,yrms)
71      aay=a
72      bby=b
73      xrms=xrms*10.
74      yrms=yrms*10.
75      x90=x90*10.
76      x100=x100*10.
77      y90=y90*10.
78      y100=y100*10.
79      if(itest.eq.1) then
80        write(nemit, 350) ne,npoints,n,xrms,x90,x100,yrms,y90,y100,spbgs
81      else
82      endif
83      if(spbgs.eq.0) then
84      write(nemit,*) 'Value of bgs in outlal',spbgs
85      return
86      else
87      endif
88      xrms=xrms/spbgs
89      yrms=yrms/spbgs
90      x90=x90/spbgs
91      x100=x100/spbgs
92      y90=y90/spbgs
93      y100=y100/spbgs
94      xrmsbg=4.*spbgs*xrms
95      yrmsbg=4.*spbgs*yrms
96      write(nemit, 350)ne,npoints,n,xrms,x90,x100,yrms,y90,y100,spbgs
97      if(istat.eq.1.and.nebm.ne.0) then
98      write(nstat)var,nebm,n,rp,dzmin,dzmax,wrm,dwbm,xrmsbg,yrmsbg,
99     1            xsmax,xpsmax,ysmax,ypsmax
100      endif
101      if(itest.eq.1) then
102        write(nemit,*) 
103     *' Parametres des ellipses alpha sans unite beta cm/rad'
104        write(nemit,*) ' alpha_x   beta_x ',aax,bbx
105        write(nemit,*) ' alpha_y   beta_y ',aay,bby
106      endif
107      go to 99
108   60 continue
109      write(nemit,*) ' '
110      write(nemit,9013) n,ne
111 9013 format(' Emittance not calculated np =',i3,' < 50 in element',i4)
112      return
113   99 continue
114      return
115c
116  370 format (/' Emittances are calculated in double precision'/)
117c  change format 330 - 04/94
118  330 format ('  nel part  part    rms,n   emax,n   emax,n',
119     1        '    rms,n   emax,n   emax,n   bg'/
120     2        '  no.  in    out      x      x,90%   x,100%',
121     3        '      y      y,90%   y,100%')
122  350 format (i4,i6,i6,6f9.3,f7.4)
123  360 format (f9.2,i4,3f8.2,2f8.3,2f9.2)
124      end
125c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
Note: See TracBrowser for help on using the repository browser.