program test_electrons use bmad use muon_interface use parameters_bmad implicit none type (lat_struct) lat type (coord_struct) co_muon_end, co_electron, co_elec_end integer n,turn,nmuons integer nargs integer ix,nbranch integer datetime_values(8) integer status/0/ integer system integer i logical make_movie/.false./ character*120 line, lat_file, string, lat_file_name character*16 date, time, zone real(rp) spin(3) nargs = command_argument_count() if (nargs == 1) then call get_command_argument(1, lat_file) print *, 'Using ', trim(lat_file) else lat_file = 'bmad.' print '(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.' endif print *, ' lat_file = ', lat_file call date_and_time(date,time,zone,datetime_values) print '(a10,a10,a1,a10)',' date = ',date,' time = ', time directory = trim(date)//'_'//trim(time(1:6)) status= system('mkdir ' // directory) call bmad_parser (lat_file, lat) n=1 turn=2 nmuons=1 spin = 0 spin(3)=-1 nbranch=1 call init_coord(co_muon_end, spin=spin) call init_coord(co_electron, spin=spin) do i=1,10000 call create_and_propagate_electron(lat,nbranch, co_muon_end, co_electron, n, turn, nmuons, make_movie) end do end