Skip to content

Commit

Permalink
Minor speed improvement for radiation setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSagan committed Oct 2, 2023
1 parent c1f9b98 commit 91e5d8e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bmad/modules/radiation_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ subroutine track1_radiation (orbit, ele, edge)
real(rp), parameter :: c1_spin = 2.0_rp / 9.0_rp, c2_spin = 8.0_rp / (5.0_rp * sqrt_3)

character(*), parameter :: r_name = 'track1_radiation'
logical doit

!

Expand All @@ -90,7 +91,9 @@ subroutine track1_radiation (orbit, ele, edge)

! Use stochastic and damp mats

call radiation_map_setup(ele)
doit = .not. associated(ele%rad_map)
if (.not. doit) doit = ele%rad_map%stale
if (doit) call radiation_map_setup(ele)
if (.not. associated(ele%rad_map)) return

if (edge == start_edge$) then
Expand Down

0 comments on commit 91e5d8e

Please sign in to comment.