subroutine touschek_life(lat,energy_aperture, n_particles, emit_rat) use bmad use mode3_mod use touschek_mod implicit none type (lat_struct) lat type (coord_struct), allocatable :: co(:) type (normal_modes_struct) mode type (rad_int_all_ele_struct) rad_int integer i_dim/6/, ix_cache/0/ real(rp) tl, energy_aperture, emit_rat, n_particles call reallocate_coord(co,lat%n_ele_max) call closed_orbit_calc(lat, co, i_dim) call radiation_integrals (lat, co, mode, ix_cache, 0, rad_int) if(emit_rat > 0)mode%b%emittance = emit_rat * mode%a%emittance mode%pz_aperture = energy_aperture lat%param%n_part = n_particles call touschek_lifetime(mode,tl,lat) print '(a,es12.4,a)',' touschek lifetime = ',tl, ' seconds' print '(a,es12.4,a,es12.4)',' emit_x = ',mode%a%emittance,' emit_y = ',mode%b%emittance print '(a,es12.4)',' rf_voltage = ',mode%rf_voltage,' e_loss = ',mode%e_loss print * return end