subroutine track_through_inj_line use bmad implicit none real(rp) x(3), B(3),z, b1(3,3),b2(3,3),y real(rp) xdum character*120 file, file_inf integer iz, iy,ix real(rp) xoffset/0.089/, yoffset/0.0/ logical out_of_range file = "../magneticfield/injec_fld.dat" file_inf = "../magneticfield/inf_field_alone.dat" ! file = "/home/dlr/development9_linux/g2_magneticfield/injec_fld.dat" ! file_inf = "/home/dlr/development9_linux/g2_magneticfield/inf_field_alone.dat" !write(11,'(/,a,i4,/)')'#' , iy ! call random_number(xdum) ! turns out that range in x where fields make sense is 7.5 to 9.5 ! and range in y is 0.25 to 2.75 ix= 0 do ix=-20,20 write(11,'(/,a,i4,/)')'#' , ix do iz = 1, 4395 !print * z = iz*0.1 + 0. x(1:3)=0 x(1) = 8.9 + ix*0.5 ! +xoffset*100 x(2) = 1.227 x(3)=z ! print *,file, x,B call get_g2_fields(file,file_inf, x, B, b1,b2, out_of_range) if(out_of_range)then ! print *,' Outside of field volume ' cycle else write(11, '(3es12.4,6x,3es12.4)')x,B ! print '(3es12.4,6x,3es12.4)',x,B endif end do end do return end subroutine