Skip to content

Commit

Permalink
corrected indices used by z_long kick to account for fft shift (bmad-…
Browse files Browse the repository at this point in the history
…sim#1327)

* fixing z_long wake
* corrected indices used by z_long kick to account for fft shift
  • Loading branch information
ndwang authored Nov 26, 2024
1 parent 1e0c029 commit cbc2ec1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bmad/multiparticle/wake_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -578,12 +578,12 @@ subroutine sr_z_long_wake (ele, bunch, z_ave)
p => bunch%particle(i)
if (p%state /= alive$) cycle

rz_rel = sr%z_scale * (p%vec(5) - z_ave) / srz%dz + 1
ix1 = floor(rz_rel)
ix2 = ix1 + 1
rz_rel = sr%z_scale * (p%vec(5) - z_ave) / srz%dz + n2 + 1
ix1 = MOD(floor(rz_rel) + n2 - 1, nn) + 1
ix2 = MOD(ix1, nn) + 1

r1 = ix2 - rz_rel
r2 = rz_rel - ix1
r2 = MOD(rz_rel, 1.0_rp)
r1 = 1 - r2

select case (srz%position_dependence)
case (none$, x_leading$, y_leading$)
Expand Down

0 comments on commit cbc2ec1

Please sign in to comment.