subroutine write_full_turn(lat,turn, co, n_ele) use bmad use ramp_parameters implicit none type (lat_struct) lat type (coord_struct), allocatable:: co(:) integer j,turn, n_ele integer, save :: lunn logical first/.true./ if(first)then lunn = lunget() open(unit=lunn, file=trim(directory)//'/full_turn_orbit.dat') write(lunn,'(a10,7a12)')'element','s','x','xp','y','yp','z','delta' first=.false. endif write(lunn,'(/,a1,a7,i10,/)')'#', 'turn = ',turn ! write(6,'(/,a1,a7,i10,/)')'#', 'turn = ',turn do j = 1, n_ele write(lunn,'(i10,1x,7es12.4)')j,lat%ele(j)%s, co(j)%vec end do return end