Skip to content

Commit

Permalink
Modified tao_calc_data_at_s_pts to better track Twiss parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSagan committed Jan 11, 2025
1 parent 0468557 commit 4386d99
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tao/code/tao_graph_setup_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2446,18 +2446,23 @@ subroutine tao_calc_data_at_s_pts (tao_lat, curve, comp_sign, good)
first_time = .false.

else
call twiss_and_track_from_s_to_s (branch, orbit, s_now, orbit_end, ele, ele, err_flag, compute_floor_coords = .true.)
mat6 = matmul(ele%mat6, mat6) ! Matrix from beginning of branch.
vec0 = matmul(ele%mat6, vec0) + ele%vec0
call twiss_and_track_from_s_to_s (branch, orbit, s_now, orbit_end, ele, ele, err_flag, &
compute_floor_coords = .true., compute_twiss = .false.)
orbit = orbit_end
vec0 = matmul(ele%mat6, vec0) + ele%vec0
mat6 = matmul(ele%mat6, mat6) ! Matrix from beginning of branch.
ele%vec0 = vec0
ele%mat6 = mat6
ele%key = hybrid$ ! So twiss_propagate1 does not get confused.
call twiss_propagate1(branch%ele(0), ele, err_flag)
endif


if (cache_status == loading_cache$) then
tao_branch%plot_cache(ii)%ele = ele
tao_branch%plot_cache(ii)%orbit = orbit
tao_branch%plot_cache(ii)%ele%mat6 = mat6
tao_branch%plot_cache(ii)%ele%vec0 = vec0
tao_branch%plot_cache(ii)%ele%mat6 = ele%mat6
tao_branch%plot_cache(ii)%ele%vec0 = ele%vec0
tao_branch%plot_cache(ii)%err = err_flag
endif

Expand Down

0 comments on commit 4386d99

Please sign in to comment.