Skip to content

Commit

Permalink
Minor mods.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSagan committed Oct 25, 2023
1 parent 58a9785 commit eb930c3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 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

0 comments on commit eb930c3

Please sign in to comment.