Skip to content

Commit

Permalink
More bmad_to_julia devel. (#1083)
Browse files Browse the repository at this point in the history
* Minor doc tweaks.

* More bmad_to_julia devel.
  • Loading branch information
DavidSagan authored Jul 26, 2024
1 parent 5260f44 commit 83f26e6
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 25 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/doc/bmad.tex
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

\setlength{\textwidth}{6.25in}
\setlength{\hoffset}{0.0in}
\setlength{\oddsidemargin}{0.25in}
\setlength{\oddsidemargin}{0.0in}
\setlength{\evensidemargin}{0.0in}
\setlength{\textheight}{8.5in}
\setlength{\topmargin}{0in}
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
1 change: 1 addition & 0 deletions bmad/photon/track1_photon_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ subroutine track1_crystal (ele, param, orbit)
h_bar = h_norm * cp%wavelength / ele%value(d_spacing$) ! H-vector B&C Eq (1) normalized by the wavelength.

! cp%new_vvec is the normalized outgoing wavevector outside the crystal
! See B&C Eq (27) and paragraph after equation as well as Fig 10.

cp%old_vvec = orbit%vec(2:6:2) ! Incomming K-vector (real part) normalized by the wavelength
cp%new_vvec = orbit%vec(2:6:2) + h_bar ! Outgoing K-vector (real part) normalized by the wavelength
Expand Down
2 changes: 1 addition & 1 deletion bsim/ibs_ring/doc/ibs_ring.tex
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
\setlength{\textwidth}{6.25in}
\setlength{\hoffset}{0.0in}
\setlength{\oddsidemargin}{0.25in}
\setlength{\oddsidemargin}{0.0in}
\setlength{\evensidemargin}{0.0in}
\setlength{\textheight}{8.5in}
\setlength{\topmargin}{0in}
Expand Down
2 changes: 1 addition & 1 deletion bsim/synrad/doc/synrad.tex
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
\setlength{\textwidth}{6.25in}
\setlength{\hoffset}{0.0in}
\setlength{\oddsidemargin}{0.25in}
\setlength{\oddsidemargin}{0.0in}
\setlength{\evensidemargin}{0.0in}
\setlength{\textheight}{8.5in}
\setlength{\topmargin}{0in}
Expand Down
2 changes: 1 addition & 1 deletion bsim/synrad3d/doc/synrad3d.tex
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
\setlength{\textwidth}{6.25in}
\setlength{\hoffset}{0.0in}
\setlength{\oddsidemargin}{0.25in}
\setlength{\oddsidemargin}{0.0in}
\setlength{\evensidemargin}{0.0in}
\setlength{\textheight}{8.5in}
\setlength{\topmargin}{0in}
Expand Down
2 changes: 1 addition & 1 deletion bsim/touschek_background/doc/touschek_background.tex
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
\setlength{\textwidth}{6.25in}
\setlength{\hoffset}{0.0in}
\setlength{\oddsidemargin}{0.25in}
\setlength{\oddsidemargin}{0.0in}
\setlength{\evensidemargin}{0.0in}
\setlength{\textheight}{8.5in}
\setlength{\topmargin}{0in}
Expand Down
2 changes: 1 addition & 1 deletion lux/doc/lux.tex
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
\setlength{\textwidth}{6.25in}
\setlength{\hoffset}{0.0in}
\setlength{\oddsidemargin}{0.25in}
\setlength{\oddsidemargin}{0.0in}
\setlength{\evensidemargin}{0.0in}
\setlength{\textheight}{8.5in}
\setlength{\topmargin}{0in}
Expand Down
4 changes: 2 additions & 2 deletions tao/doc/tao.tex
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
\externaldocument[B-]{../../bmad/doc/lattice-file}

\setlength{\textwidth}{6.25in}
\setlength{\oddsidemargin}{0.25in}
\setlength{\evensidemargin}{0.00in}
\setlength{\oddsidemargin}{0.0in}
\setlength{\evensidemargin}{0.0in}
\setlength{\textheight}{8.5in}
\setlength{\topmargin}{0in}
\setlength{\skip\footins}{6pt}
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 83f26e6

Please sign in to comment.