Skip to content

Commit

Permalink
Merge pull request #610 from hibtc/tmbend-interpolate-k0
Browse files Browse the repository at this point in the history
Fix incorrect field errors in tmbend with INTERPOLATE
  • Loading branch information
ldeniau committed Mar 28, 2018
2 parents b7f4133 + ab90c58 commit 49b4e7f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/twiss.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3539,12 +3539,6 @@ SUBROUTINE tmbend(ftrk,fcentre,orbit,fmap,el,dl,ek,re,te)
sks = g_elpar(b_k1s)
h = an / el

!--- calculate body slice from start (no exit fringe field):
if (dl .lt. el .and. .not. fcentre) then
el = dl
kill_exi_fringe = .true.
endif

!---- Apply field errors and change coefficients using DELTAP.
F_ERRORS = zero
n_ferr = node_fd_errors(f_errors)
Expand All @@ -3560,6 +3554,12 @@ SUBROUTINE tmbend(ftrk,fcentre,orbit,fmap,el,dl,ek,re,te)
sk2 = bvk * (sk2 + f_errors(4) / el) / (one + deltap) ! sext term
sks = bvk * (sks + f_errors(3) / el) / (one + deltap) ! skew quad term

!--- calculate body slice from start (no exit fringe field):
if (dl .lt. el .and. .not. fcentre) then
el = dl
kill_exi_fringe = .true.
endif

!---- Half radiation effects at entrance.
if (ftrk .and. radiate) then
ct = cos(tilt)
Expand Down

0 comments on commit 49b4e7f

Please sign in to comment.