Skip to content

Commit

Permalink
Merge pull request #585 from bmad-sim/devel/step34
Browse files Browse the repository at this point in the history
devel/step34
  • Loading branch information
DavidSagan authored Oct 25, 2023
2 parents 44ad4af + eb930c3 commit cfa34a9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
20 changes: 16 additions & 4 deletions bmad/multiparticle/beam_file_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ subroutine write_ascii4_beam_file (file_name, beam, new_file, cols, lat)

character(*) file_name
character(*), optional :: cols
character(200) full_name
character(200) full_name, colum
character(*), parameter :: r_name = 'write_ascii4_beam_file'

logical, optional :: new_file
Expand All @@ -148,8 +148,20 @@ subroutine write_ascii4_beam_file (file_name, beam, new_file, cols, lat)
open (iu, file = full_name, access = 'append')
endif

if (present(cols)) then
colum = cols
else
colum = ''
endif

!

do ib = 1, size(beam%bunch)
bunch => beam%bunch(ib)
write (iu, '(a, i6)') 'ix_bunch =', ib
write (iu, '(a, i6)') 'n_particle =', size(bunch%particle)
write (iu, '(2a)') 'cols =', quote(cols)
enddo

close (iu)

Expand Down Expand Up @@ -687,20 +699,20 @@ subroutine read_beam_ascii4 (iu, file_name, beam, beam_init, err_flag, ele, prin
case ('z_center'); bunch%z_center = read_param(line)
case ('t_center'); bunch%t_center = read_param(line)

case ('columns'); cols = read_string(line)
case ('columns'); cols = unquote(read_string(line))

case ('location')
str = read_string(line)
call read_switch(line(:ix), p0%location, str, err)
if (err) return

case ('state')
str = read_string(line)
str = unquote(read_string(line))
call read_switch(line(:ix), p0%state, str, err)
if (err) return

case ('species')
str = read_string(line)
str = unquote(read_string(line))
call read_switch(line(:ix), p0%species, str, err)
if (err) return

Expand Down
2 changes: 1 addition & 1 deletion bsim/modules/ts_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ subroutine ts_init_params (ts, ts_com)

if (ts%dat_out_file == '') call file_suffixer(ts_com%master_input_file, ts%dat_out_file, 'dat', .true.)

if (ts%group_knobs(1) == '' .xor. ts%group_knobs(2) == '') then
if (ts%group_knobs(1) == '' .neqv. ts%group_knobs(2) == '') then
print '(a)', 'Error: Both ts%group_knobs(1) and ts%group_knobs(2) strings must be non-blank or both must be non-blank'
stop
endif
Expand Down
6 changes: 3 additions & 3 deletions tao/code/tao_show_this.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5788,14 +5788,14 @@ subroutine tao_show_this (what, result_id, lines, nl)
line = ''

do
call tao_next_switch (what2, [character(20):: '#format'], .true., switch, err, ix, print_err = .false.)
call tao_next_switch (what2, [character(20):: '#format'], .true., line2, err, ix, print_err = .false.)
if (err) return
select case (switch)
select case (line2)
case ('#format')
s_fmt = unquote(what2(1:ix))
call string_trim(what2(ix+1:), what2, ix)
case default
line = trim(line) // trim(switch)
line = trim(line) // trim(line2)
if (what2 == '') exit
end select
enddo
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/10/24 11:25:06"
character(*), parameter :: tao_version_date = "2023/10/25 00:03:49"
end module

0 comments on commit cfa34a9

Please sign in to comment.