Skip to content

Commit

Permalink
More bmad_to_julia devel.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSagan committed Jul 26, 2024
1 parent 12d3370 commit 88ccfb7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions bmad/code/multipass_all_info.f90
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ subroutine multipass_all_info (lat, info)
allocate (info%lord(n_multi_lord), info%branch(0:ubound(lat%branch, 1)))
do ib = 0, ubound(lat%branch, 1)
branch => lat%branch(ib)
allocate (info%branch(ib)%ele(branch%n_ele_max))
allocate (info%branch(ib)%ele(0:branch%n_ele_max))
info%branch(ib)%ele(:)%multipass = .false.
info%branch(ib)%ele(:)%ix_pass = -1
do i = 1, branch%n_ele_max
do i = 0, branch%n_ele_max
s_info => info%branch(ib)%ele(i)
allocate (s_info%ix_lord(0))
allocate (s_info%ix_super(0))
Expand Down
2 changes: 1 addition & 1 deletion bmad/output/write_lat_file_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ subroutine multipass_region_info(lat, mult_lat, m_info)
allocate (mult_lat%branch(0:ubound(lat%branch, 1)))
do ib = 0, ubound(lat%branch, 1)
branch => lat%branch(ib)
allocate (mult_lat%branch(ib)%ele(branch%n_ele_max))
allocate (mult_lat%branch(ib)%ele(0:branch%n_ele_max))
mult_lat%branch(ib)%ele(:)%ix_region = 0
mult_lat%branch(ib)%ele(:)%region_start_pt = .false.
mult_lat%branch(ib)%ele(:)%region_stop_pt = .false.
Expand Down
26 changes: 13 additions & 13 deletions bmad/output/write_lattice_in_julia.f90
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,17 @@ subroutine write_lattice_in_julia(bmad_file, lat, julia_file)

if (ie == 0) then
line = trim(line) // ', pc_ref = ' // re_str(ele%value(p0c$))
line = trim(line) // ', species_ref = ' // trim(openpmd_species_name(ele%ref_species))
if (ele%a%beta /= 0) line = trim(line) // ', twiss.a.beta = ' // re_str(ele%a%beta)
if (ele%b%beta /= 0) line = trim(line) // ', twiss.b.beta = ' // re_str(ele%b%beta)
if (ele%a%alpha /= 0) line = trim(line) // ', twiss.a.alpha = ' // re_str(ele%a%alpha)
if (ele%b%alpha /= 0) line = trim(line) // ', twiss.b.alpha = ' // re_str(ele%b%alpha)
if (ele%x%eta /= 0) line = trim(line) // ', twiss.x.eta = ' // re_str(ele%x%eta)
if (ele%y%eta /= 0) line = trim(line) // ', twiss.y.eta = ' // re_str(ele%y%eta)
if (ele%x%etap /= 0) line = trim(line) // ', twiss.x.etap = ' // re_str(ele%x%etap)
if (ele%y%etap /= 0) line = trim(line) // ', twiss.y.etap = ' // re_str(ele%y%etap)
if (any(ele%c_mat /= 0)) line = trim(line) // ', twiss.c_mat = [' // re_str(ele%c_mat(1,1)) // ', ' // re_str(ele%c_mat(1,2)) // &
'; ' // re_str(ele%c_mat(2,1)) // ', ' // re_str(ele%c_mat(2,2)) // ']'
line = trim(line) // ', species_ref = species(' // quote(openpmd_species_name(ele%ref_species)) // ')'
if (ele%a%beta /= 0) line = trim(line) // ', beta_a = ' // re_str(ele%a%beta)
if (ele%b%beta /= 0) line = trim(line) // ', beta_b = ' // re_str(ele%b%beta)
if (ele%a%alpha /= 0) line = trim(line) // ', alpha_a = ' // re_str(ele%a%alpha)
if (ele%b%alpha /= 0) line = trim(line) // ', alpha_b = ' // re_str(ele%b%alpha)
if (ele%x%eta /= 0) line = trim(line) // ', eta_x = ' // re_str(ele%x%eta)
if (ele%y%eta /= 0) line = trim(line) // ', eta_y = ' // re_str(ele%y%eta)
if (ele%x%etap /= 0) line = trim(line) // ', etap_x = ' // re_str(ele%x%etap)
if (ele%y%etap /= 0) line = trim(line) // ', etap_y = ' // re_str(ele%y%etap)
!! if (any(ele%c_mat /= 0)) line = trim(line) // ', c_mat = [' // re_str(ele%c_mat(1,1)) // ', ' // re_str(ele%c_mat(1,2)) // &
!! '; ' // re_str(ele%c_mat(2,1)) // ', ' // re_str(ele%c_mat(2,2)) // ']'
orb => lat%particle_start
if (any(orb%vec /= 0)) line = trim(line) // ', particle.orbit = [' // re_str(orb%vec(1)) // ', ' // re_str(orb%vec(2)) // ', ' // &
re_str(orb%vec(3)) // ', ' // re_str(orb%vec(4)) // ', ' // re_str(orb%vec(5)) // ', ' // re_str(orb%vec(6)) // ']'
Expand Down Expand Up @@ -236,14 +236,14 @@ subroutine write_lattice_in_julia(bmad_file, lat, julia_file)
!

if (ele%key == lcavity$) then
if (ele%value(rf_frequency$) /= 0) line = trim(line) // ', rf_frequency = ' // re_str(ele%value(rf_frequency$))
if (ele%value(rf_frequency$) /= 0) line = trim(line) // ', frequency = ' // re_str(ele%value(rf_frequency$))
if (ele%value(voltage$) /= 0) line = trim(line) // ', voltage_ref = ' // re_str(ele%value(voltage$))
if (ele%value(voltage_err$) /= 0) line = trim(line) // ', voltage_err = ' // re_str(ele%value(voltage_err$))
if (ele%value(phi0$) /= 0) line = trim(line) // ', phase_ref = ' // re_str(ele%value(phi0$))
if (ele%value(phi0_err$) /= 0) line = trim(line) // ', phase_err = ' // re_str(ele%value(phi0_err$))

elseif (has_attribute(ele, 'RF_FREQUENCY')) then
if (ele%value(rf_frequency$) /= 0) line = trim(line) // ', rf_frequency = ' // re_str(ele%value(rf_frequency$))
if (ele%value(rf_frequency$) /= 0) line = trim(line) // ', frequency = ' // re_str(ele%value(rf_frequency$))
if (ele%value(voltage$) /= 0) line = trim(line) // ', voltage = ' // re_str(ele%value(voltage$))
if (ele%value(phi0$) /= 0) line = trim(line) // ', phase = ' // re_str(ele%value(phi0$))
endif
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 = "2024/07/24 00:47:55"
character(*), parameter :: tao_version_date = "2024/07/24 20:44:28"
end module

0 comments on commit 88ccfb7

Please sign in to comment.