From 58a9785c5344f5220bc584f976a67d25e72c970a Mon Sep 17 00:00:00 2001 From: David Sagan Date: Wed, 25 Oct 2023 16:38:26 -0400 Subject: [PATCH 1/2] Fix line length problem. --- tao/code/tao_show_this.f90 | 6 +++--- tao/version/tao_version_mod.f90 | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tao/code/tao_show_this.f90 b/tao/code/tao_show_this.f90 index f04e5114cb..0cf9f225d6 100644 --- a/tao/code/tao_show_this.f90 +++ b/tao/code/tao_show_this.f90 @@ -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 diff --git a/tao/version/tao_version_mod.f90 b/tao/version/tao_version_mod.f90 index 2ea94a5a3a..c540a3edda 100644 --- a/tao/version/tao_version_mod.f90 +++ b/tao/version/tao_version_mod.f90 @@ -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 From eb930c3b78a72d8b54455b983af51a84259cda96 Mon Sep 17 00:00:00 2001 From: David Sagan Date: Wed, 25 Oct 2023 16:49:48 -0400 Subject: [PATCH 2/2] Minor mods. --- bmad/multiparticle/beam_file_io.f90 | 20 ++++++++++++++++---- bsim/modules/ts_mod.f90 | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/bmad/multiparticle/beam_file_io.f90 b/bmad/multiparticle/beam_file_io.f90 index 6639210105..399c055d5d 100644 --- a/bmad/multiparticle/beam_file_io.f90 +++ b/bmad/multiparticle/beam_file_io.f90 @@ -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 @@ -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) @@ -687,7 +699,7 @@ 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) @@ -695,12 +707,12 @@ subroutine read_beam_ascii4 (iu, file_name, beam, beam_init, err_flag, ele, prin 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 diff --git a/bsim/modules/ts_mod.f90 b/bsim/modules/ts_mod.f90 index 5cb4d98586..f52675d912 100644 --- a/bsim/modules/ts_mod.f90 +++ b/bsim/modules/ts_mod.f90 @@ -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