program wig_test ! Track n turns ! write matrix x(n,i) where n is turns and i is detector 1:100 ! Then do svd and check singular values use bmad use nr implicit none type (lat_struct) lat type (ele_struct) ele type (coord_struct), allocatable :: orbit(:) type (coord_struct) start, end type (rad_int_common_struct) rad_int type (normal_modes_struct) mode integer unit, number, m, n_turns/100/, i, ix, nargs, ix_cache character*19 file_name character*3 num character*140 lat_file character*120 line, last_line character*7 det_name character*3 bpm_name real(rp) matrix(100,100) ! nargs = cesr_iargc() ! if(nargs == 1)then ! call cesr_getarg(1,lat_file) ! print *, 'Using ', trim(lat_file) ! else lat_file = 'wiggler_i5_test.bmad' type '(a,$)',' Lattice file name ? (default= bmad.) ' read(5,'(a)') line call string_trim(line, line, ix) lat_file = line if(ix == 0) lat_file = 'bmad.' type *, ' lat_file = ', lat_file ! endif call bmad_parser (lat_file, lat) call reallocate_coord(orbit,lat%n_ele_max) ! call twiss_at_start(lat) lat%ele(0)%a%beta=10 lat%ele(0)%b%beta=10 lat%ele(0)%x%eta=0 lat%ele(0)%x%etap=0 call twiss_propagate_all(lat) orbit(0)%vec = 0 call radiation_integrals (lat, orbit, mode, ix_cache, rad_int) print '(a24,e12.4,a25,e12.4)',' horizontal emittance = ', mode%a%emittance, & ' vertical emittance = ',mode%b%emittance print '(a17,e12.4,a18,e12.4, a, e12.4)',' Energy spread = ',mode%sige_e,' Bunch length = ',mode%sig_z ,& ' Energy loss/turn [MeV] ',mode%e_loss/1.e6 if(mode%a%alpha_damp /= 0.)then print '(a7,e12.4,a10,e12.4)',' i1 =',mode%synch_int(1), & ' alpha_p =',mode%synch_int(1)/lat%ele(lat%n_ele_track)%s print '(a7,e12.4)',' i2 =',mode%synch_int(2) print '(a7,e12.4)',' i3 =',mode%synch_int(3) print '(a7,e12.4)',' i4 =',mode%a%synch_int(4) print '(a7,e12.4)',' i5a =',mode%a%synch_int(5) print '(a7,e12.4)',' i6b =',mode%b%synch_int(6) endif end