diff --git a/bmad/multiparticle/beam_utils.f90 b/bmad/multiparticle/beam_utils.f90 index a21de0cc5b..9ffa065ec3 100644 --- a/bmad/multiparticle/beam_utils.f90 +++ b/bmad/multiparticle/beam_utils.f90 @@ -1412,6 +1412,9 @@ subroutine calc_bunch_params (bunch, bunch_params, error, print_err, n_mat, is_t if (bunch_params%n_particle_live < 6) return call calc_emittances_and_twiss_from_sigma_matrix (bunch_params%sigma, bunch_params, error, print_err, n_mat) +if (error .and. logic_option(.true., print_err)) then + call out_io(s_blank$, r_name, 'This at element: ' // ele_full_name(ele)) +endif end subroutine calc_bunch_params diff --git a/bmad/space_charge/space_charge_mod.f90 b/bmad/space_charge/space_charge_mod.f90 index 642cd36060..f7c107e226 100644 --- a/bmad/space_charge/space_charge_mod.f90 +++ b/bmad/space_charge/space_charge_mod.f90 @@ -215,8 +215,12 @@ subroutine sc_step(bunch, ele, include_image, t_end, sc_field, n_emit) ! Calculate space charge field if (space_charge_com%particle_sigma_cutoff > 0) then - call calc_bunch_params(bunch, bunch_params, error, is_time_coords=.true., ele=ele) - call sc_field_calc(bunch, ele%branch, include_image, t_end, sc_field, bunch_params) + call calc_bunch_params(bunch, bunch_params, error, .false., is_time_coords=.true., ele=ele) + if (error) then + call sc_field_calc(bunch, ele%branch, include_image, t_end, sc_field) + else + call sc_field_calc(bunch, ele%branch, include_image, t_end, sc_field, bunch_params) + endif else call sc_field_calc(bunch, ele%branch, include_image, t_end, sc_field) endif diff --git a/tao/code/tao_show_this.f90 b/tao/code/tao_show_this.f90 index ba9a78c416..d747c288cb 100644 --- a/tao/code/tao_show_this.f90 +++ b/tao/code/tao_show_this.f90 @@ -293,7 +293,7 @@ subroutine tao_show_this (what, result_id, lines, nl) zb = -1 do - call tao_next_switch (what2, [character(16):: '-universe'], .true., switch, err) + call tao_next_switch (what2, [character(16):: '-universe', '-lattice', '-comb', '-z'], .true., switch, err) if (err) return if (switch == '') exit @@ -357,7 +357,7 @@ subroutine tao_show_this (what, result_id, lines, nl) return endif - if (what_to_show == '-comb' .and. ele_name == '') then + if (what_to_show == '-comb' .and. ele_name == '') then ! -comb used without comb index. if (.not. allocated(tao_branch%bunch_params_comb)) then nl=nl+1; lines(nl) = 'Beam parameter comb not calculated (check comb_ds_save)' return @@ -445,6 +445,9 @@ subroutine tao_show_this (what, result_id, lines, nl) nl=nl+1; write(lines(nl), amt) 'dump_at = ', quote(u%beam%dump_at) nl=nl+1; write(lines(nl), amt) 'dump_file = ', quote(u%beam%dump_file) nl=nl+1; write(lines(nl), rmt3) 'comb_ds_save = ', tao_branch%comb_ds_save, ' ! Note: -1 => Use (latice branch length)/plot_page%n_curve_pts' + if (allocated(tao_branch%bunch_params_comb)) then + nl=nl+1; write(lines(nl), amt) 'comb index range = [0, ', int_str(tao_branch%bunch_params_comb(1)%n_pt), ']' + endif !!!! nl=nl+1; write(lines(nl), rmt) 'comb_max_ds_save = ', tao_branch%bunch_params_comb(1)%max_ds_save nl=nl+1; write(lines(nl), amt) 'track_start = ', quote(bb%track_start), ' ! ', ele_full_name(branch%ele(bb%ix_track_start)) nl=nl+1; write(lines(nl), amt) 'track_end = ', quote(bb%track_end), ' ! ', ele_full_name(branch%ele(bb%ix_track_end)) diff --git a/tao/version/tao_version_mod.f90 b/tao/version/tao_version_mod.f90 index 62214b67ab..a2a9cdfd6d 100644 --- a/tao/version/tao_version_mod.f90 +++ b/tao/version/tao_version_mod.f90 @@ -6,5 +6,5 @@ !- module tao_version_mod -character(*), parameter :: tao_version_date = "2024/12/22 21:46:37" +character(*), parameter :: tao_version_date = "2025/01/07 00:41:27" end module