Skip to content

Commit

Permalink
Renamed Tao global%dead_cutoff -> global%beam_dead_cutoff.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSagan committed Apr 16, 2024
1 parent 9e93329 commit 632f8db
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions tao/code/tao_lattice_calc_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ subroutine tao_beam_track (u, tao_lat, ix_branch, beam, calc_ok)
ix_track = ie
call out_io (s_warn$, r_name, &
'TOO MANY PARTICLES HAVE BEEN LOST AT ELEMENT ' // trim(ele_loc_name(ele)) // ': ' // trim(ele%name), &
'PERCENTAGE OF DEAD PARTICLES OVER GLOBAL%DEAD_CUTOFF OF: ' // real_str(s%global%dead_cutoff, 6, 4), &
'PERCENTAGE OF DEAD PARTICLES OVER GLOBAL%BEAM_DEAD_CUTOFF OF: ' // real_str(s%global%beam_dead_cutoff, 6, 4), &
'WILL STOP TRACKING AT ELEMENT: ' // ele_full_name(ele))
exit
endif
Expand Down Expand Up @@ -712,7 +712,7 @@ function tao_too_many_particles_lost (beam) result (no_beam)
logical no_beam
character(*), parameter :: r_name = "tao_too_many_particles_lost"

! Cutoff is if in any bunch the number lost is above global%dead_cutoff
! Cutoff is if in any bunch the number lost is above global%beam_dead_cutoff
! Note: Previously having no charge or field triggered no beam left.
! It was decided that this case was acceptible.

Expand All @@ -721,7 +721,7 @@ function tao_too_many_particles_lost (beam) result (no_beam)
do ib = 1, size(beam%bunch)
p => beam%bunch(ib)%particle(:)
n_dead = count(p%state /= alive$ .and. p%state /= pre_born$)
if (n_dead * (1.0000001_rp) < size(p) * s%global%dead_cutoff) cycle
if (n_dead * (1.0000001_rp) < size(p) * s%global%beam_dead_cutoff) cycle
no_beam = .true.
return
enddo
Expand Down Expand Up @@ -935,7 +935,7 @@ subroutine tao_inject_beam (u, model, ix_branch, beam, init_ok)

if (tao_too_many_particles_lost(beam)) then
call out_io (s_warn$, r_name, 'NOT ENOUGH PARTICLES FOR BEAM INITIALIZATION IN BRANCH ' // int_str(ix_branch), &
'PERCENTAGE OF DEAD PARTICLES OVER GLOBAL%DEAD_CUTOFF OF: ' // real_str(s%global%dead_cutoff, 6, 4), &
'PERCENTAGE OF DEAD PARTICLES OVER GLOBAL%BEAM_DEAD_CUTOFF OF: ' // real_str(s%global%beam_dead_cutoff, 6, 4), &
'NO BEAM TRACKING WILL BE DONE.')
return
endif
Expand Down
4 changes: 2 additions & 2 deletions tao/code/tao_show_this.f90
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ subroutine tao_show_this (what, result_id, lines, nl)
nl=nl+1; lines(nl) = ''
nl=nl+1; write(lines(nl), amt) 'global%track_type = ', quote(s%global%track_type)
nl=nl+1; write(lines(nl), lmt) 'global%beam_timer_on = ', s%global%beam_timer_on
nl=nl+1; write(lines(nl), rmt) 'global%dead_cutoff = ', s%global%dead_cutoff
nl=nl+1; write(lines(nl), rmt) 'global%beam_dead_cutoff = ', s%global%beam_dead_cutoff

fmt = '(3a, i0, a)'
nl=nl+1; lines(nl) = ''
Expand Down Expand Up @@ -2115,7 +2115,7 @@ subroutine tao_show_this (what, result_id, lines, nl)
nl=nl+1; write(lines(nl), imt) ' %bunch_to_plot = ', s%global%bunch_to_plot
nl=nl+1; write(lines(nl), imt) ' %datum_err_messages_max = ', s%global%datum_err_messages_max
nl=nl+1; write(lines(nl), lmt) ' %concatenate_maps = ', s%global%concatenate_maps
nl=nl+1; write(lines(nl), rmt) ' %deat_cutoff = ', s%global%dead_cutoff
nl=nl+1; write(lines(nl), rmt) ' %beam_dead_cutoff = ', s%global%beam_dead_cutoff
nl=nl+1; write(lines(nl), rmt) ' %delta_e_chrom = ', s%global%delta_e_chrom
nl=nl+1; write(lines(nl), lmt) ' %disable_smooth_line_calc = ', s%global%disable_smooth_line_calc
nl=nl+1; write(lines(nl), lmt) ' %draw_curve_off_scale_warn = ', s%global%draw_curve_off_scale_warn
Expand Down
2 changes: 1 addition & 1 deletion tao/code/tao_struct.f90
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ module tao_struct
! If this structure is changed, change tao_set_global_cmd.

type tao_global_struct
real(rp) :: beam_dead_cutoff = 0.99 ! Percentage of dead particles at which beam tracking is stopped.
real(rp) :: lm_opt_deriv_reinit = -1 ! Reinit derivative matrix cutoff
real(rp) :: de_lm_step_ratio = 1 ! Scaling for step sizes between DE and LM optimizers.
real(rp) :: de_var_to_population_factor = 5.0_rp ! DE population = max(n_var*factor, 20)
Expand All @@ -645,7 +646,6 @@ module tao_struct
real(rp) :: dmerit_stop_value = 0 ! Fractional Merit change below which an optimizer will stop.
real(rp) :: random_sigma_cutoff = -1 ! Cut-off in sigmas.
real(rp) :: delta_e_chrom = 0 ! Delta E used from chrom calc.
real(rp) :: dead_cutoff = 0.99 ! Percentage of dead particles at which beam tracking is stopped.
integer :: default_universe = 1 ! Default universe to work with.
integer :: default_branch = 0 ! Default lattice branch to work with.
integer :: n_opti_cycles = 20 ! Number of optimization cycles
Expand Down
2 changes: 1 addition & 1 deletion tao/doc/cover-page.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

\begin{flushright}
\large
Revision: April 15, 2024 \\
Revision: April 16, 2024 \\
\end{flushright}

\vfill
Expand Down
8 changes: 4 additions & 4 deletions tao/doc/initialization.tex
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,10 @@ \subsection{Tao\_global\_struct Structure}
The \vn{tao_global_struct} structure contains \tao global parameters. The components of this structure are:
\begin{example}
type tao_global_struct:
beam_dead_cutoff = 0.99 ! Dead particle cutoff for stopping beam tracking.
lm_opt_deriv_reinit = -1 ! Derivative matrix cutoff. -1 => ignore this.
de_lm_step_ratio = 1 ! Step sizes between DE and LM optimizers.
de_var_to_population_factor = 5
dead_cutoff = 0.99 ! Dead particle cutoff for stopping beam tracking.
lmdif_eps = 1e-12 ! Tolerance for lmdif optimizer.
lmdif_negligible_merit = 1d-30 ! lmdif stops if merit is smaller.
svd_cutoff = 1e-5 ! SVD singular value cutoff limit.
Expand Down Expand Up @@ -656,6 +656,9 @@ \subsection{Tao\_global\_struct Structure}
value using the \vn{set} command (\sref{s:set}).

\begin{description}
\item{\vn{global%beam_dead_cutoff}} \Newline
Percentage of dead particles at which beam tracking is stopped.
%
\item{\vn{global%concatenate_maps}} \Newline
When constructing transfer Taylor maps the default method, used with \vn{global%concatenate_maps} =
False, is to use Differential Algebra (DA) to integrate the map from the starting point to the
Expand All @@ -671,9 +674,6 @@ \subsection{Tao\_global\_struct Structure}
``cycle'', which generally happens after most commands or every optimization cycle, consists of the
reevaluation of lattice parameters and subsequent datum evaluations. Limiting the number of error
messages is useful when many essentially similar error messages are being generated.
%
\item{\vn{global%dead_cutoff}} \Newline
Percentage of dead particles at which beam tracking is stopped.
%
\item{\vn{global%derivative_recalc}} \Newline
The \vn{global%derivative_recalc} logical determines whether the derivative matrix is
Expand Down

0 comments on commit 632f8db

Please sign in to comment.