Skip to content

Commit

Permalink
Merge pull request #648 from bmad-sim/devel/57
Browse files Browse the repository at this point in the history
Added RF_BUCKET_LENGTH to type_ele for rfcavity elements.
  • Loading branch information
DavidSagan authored Nov 25, 2023
2 parents ff8c0ca + 2754e87 commit c94a257
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions bmad/code/type_ele.f90
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ subroutine type_ele (ele, type_zero_attrib, type_mat6, type_taylor, twiss_out, t
attrib2 = ele_attribute_struct()

select case (a_name)
case ('LONGITUDINAL_MODE')
if (ele%key == rfcavity$) attrib2 = &
ele_attribute_struct('RF_BUCKET_LENGTH', dependent$, is_real$, 'm', -1, ele%value(rf_wavelength$) * ele%value(p0c$) / ele%value(E_tot$))
case ('P0C')
if (particle == photon$) then
attrib2 = ele_attribute_struct('REF_WAVELENGTH', dependent$, is_real$, 'm', -1, c_light * h_planck / ele%value(p0c$))
Expand Down
12 changes: 6 additions & 6 deletions bmad/modules/bmad_struct.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module bmad_struct
! IF YOU CHANGE THE LAT_STRUCT OR ANY ASSOCIATED STRUCTURES YOU MUST INCREASE THE VERSION NUMBER !!!
! THIS IS USED BY BMAD_PARSER TO MAKE SURE DIGESTED FILES ARE OK.

integer, parameter :: bmad_inc_version$ = 305
integer, parameter :: bmad_inc_version$ = 306

!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Expand Down Expand Up @@ -1665,11 +1665,11 @@ module bmad_struct
integer, parameter :: sig_y$ = 15, graze_angle_in$ = 15, r0_elec$ = 15, rf_frequency$ = 15
integer, parameter :: sig_z$ = 16, graze_angle_out$ = 16, r0_mag$ = 16, rf_wavelength$ = 16
integer, parameter :: sig_vx$ = 17, static_linear_map$ = 17
integer, parameter :: sig_vy$ = 18, autoscale_amplitude$ = 18
integer, parameter :: sig_e$ = 19, autoscale_phase$ = 19, sig_pz$ = 19
integer, parameter :: d1_thickness$ = 20, default_tracking_species$ = 20
integer, parameter :: n_slice$ = 20, y_gain_calib$ = 20, constant_ref_energy$ = 20
integer, parameter :: longitudinal_mode$ = 20, sig_e2$ = 20
! longitudinal_mode$ is near to rf_wavelength$ for type_ele to print rf_bucket_length near rf_wavelength$
integer, parameter :: sig_vy$ = 18, constant_ref_energy$ = 18, longitudinal_mode$ = 18
integer, parameter :: sig_e$ = 19, sig_pz$ = 19, autoscale_amplitude$ = 19
integer, parameter :: d1_thickness$ = 20, default_tracking_species$ = 20, autoscale_phase$ = 20
integer, parameter :: n_slice$ = 20, y_gain_calib$ = 20, sig_e2$ = 20
integer, parameter :: fb1$ = 21, polarity$ = 21, crunch_calib$ = 21, alpha_angle$ = 21, d2_thickness$ = 21
integer, parameter :: beta_a_strong$ = 21, beta_a_out$ = 21, e_loss$ = 21, gap$ = 21, spin_x$ = 21, E_center$ = 21
integer, parameter :: fb2$ = 22, x_offset_calib$ = 22, v1_unitcell$ = 22, psi_angle$ = 22, cavity_type$ = 22, emit_fraction$ = 22
Expand Down
2 changes: 2 additions & 0 deletions bmad/parsing/bmad_parser_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ subroutine parser_set_attribute (how, ele, delim, delim_found, err_flag, pele, c
if (word == 'B_FIELD_ERR') word = 'DB_FIELD'
endif

if ((word == 'HARM' .or. word == 'HARMO') .and. has_attribute(ele, 'HARMON')) word = 'HARMON'

if (key == def_particle_start$ .or. key == def_bmad_com$ .or. key == def_space_charge_com$ .or. key == def_ptc_com$) then
name = ele%name

Expand Down
2 changes: 1 addition & 1 deletion tao/version/tao_version_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
!-

module tao_version_mod
character(*), parameter :: tao_version_date = "2023/11/21 21:18:50"
character(*), parameter :: tao_version_date = "2023/11/24 23:28:27"
end module

0 comments on commit c94a257

Please sign in to comment.