Skip to content

Commit

Permalink
Now beam_init%file_name will be trapped and an error message generate…
Browse files Browse the repository at this point in the history
…d. (#1113)
  • Loading branch information
DavidSagan authored Aug 1, 2024
1 parent 155eee0 commit b196666
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
Binary file modified bmad-doc/other_manuals/long_term_tracking.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions bmad/modules/bmad_struct.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,7 @@ module bmad_struct
logical :: use_z_as_t = .false. ! Only used if use_t_coords = .true.
! If true, z describes the t distribution
! If false, z describes the s distribution
character(200) :: file_name = '' ! OLD!! DO NOT USE!!
end type


Expand Down
5 changes: 5 additions & 0 deletions bmad/multiparticle/beam_utils.f90
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ subroutine init_beam_distribution (ele, param, beam_init, beam, err_flag, modes,

if (present(err_flag)) err_flag = .true.

if (beam_init%file_name /= '') then
call out_io(s_abort$, r_name, '"BEAM_INIT%FILE_NAME" SHOULD BE "BEAM_INIT%POSITION_FILE". PLEASE CHANGE.')
return
endif

! Init from file

if (beam_init%position_file /= '') then
Expand Down
6 changes: 3 additions & 3 deletions bsim/long_term_tracking/doc/long_term_tracking.tex
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

\title{Long Term Tracking Program}
\author{}
\date{David Sagan \\ June 13, 2024}
\date{David Sagan \\ August 1, 2024}

\begin{document}
\pdfbookmark[1]{Contents}{contents}
Expand Down Expand Up @@ -590,7 +590,7 @@
\vn{True}, the closed orbit position is added to the initial particle positions. To read in a file
with beam particle positions, set the \vn{beam_init} structure appropriately. Example:
\begin{code}
beam_init%file_name = 'beam_particle_file.init'
beam_init%position_file = 'beam_particle_file.init'
\end{code}

In all cases, tracking will start at the lattice element set by \vn{ltt%ele_start}.
Expand Down Expand Up @@ -1013,7 +1013,7 @@ \subsection{Output Parameters}
util_programs/beam_file_translate_format/DOC
\end{code}

To use a beam file that has been generated on a previous run with a new run set \vn{beam_init%file_name}
To use a beam file that has been generated on a previous run with a new run set \vn{beam_init%position_file}
to the name of the beam file.
%
\item[ltt\%column(:)] \Newline
Expand Down
2 changes: 1 addition & 1 deletion tao/code/tao_show_this.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@ subroutine tao_show_this (what, result_id, lines, nl)
dt = orb%t - ele%ref_time
pc = orb%p0c * (1 + orb%vec(6))
call convert_pc_to (pc, orb%species, e_tot = e_tot)
nl=nl+1; lines(nl) = ' Position[mm] Momentum[mrad] Spin |'
nl=nl+1; lines(nl) = ' Position[mm] Momentum[1E-3] Spin |'
if (bmad_com%spin_tracking_on) then
fmt = '(2x, a, 2f15.8, x, a, a, es16.8, 2x, a, es12.5)'
fmt2 = '(2x, a, 2f15.8, x, a, a, es16.8, 2x, a, f12.9)'
Expand Down

0 comments on commit b196666

Please sign in to comment.