diff --git a/.gitignore b/.gitignore index 2befad225d..048f705f21 100644 --- a/.gitignore +++ b/.gitignore @@ -73,6 +73,7 @@ bsim/**/doc/*.pdf regression_tests/*/output.now regression_tests/*/lat.bmad regression_tests/*/r +regression_tests/*/rr regression_tests/*/rt regression_tests/*/m regression_tests/bbu_test/bunch_vec.txt diff --git a/bmad/code/attribute_bookkeeper.f90 b/bmad/code/attribute_bookkeeper.f90 index f47987202b..627dc9b387 100644 --- a/bmad/code/attribute_bookkeeper.f90 +++ b/bmad/code/attribute_bookkeeper.f90 @@ -93,9 +93,9 @@ subroutine attribute_bookkeeper (ele, force_bookkeeping) if (ele%bookkeeping_state%attributes /= stale$) return if (.false. .and. bp_com%parser_name == '') then ! If not parsing should not be here - call out_io (s_error$, r_name, & + call out_io (s_warn$, r_name, & '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!', & - '!!!!! Setting bmad_com%auto_bookkeeper = .false. will, in the near future, be mandated for all !!!!!', & + '!!!!! Using intelligent bookkeeping will, in the near future, be mandated for all !!!!!', & '!!!!! Bmad programs that modify lattice parameters. !!!!!', & '!!!!! See the "Intelligent Bookkeeping" section in the Bmad manual. !!!!!', & '!!!!! Contact the maintainer of this program with this information. !!!!!', & diff --git a/bmad/code/chrom_tune.f90 b/bmad/code/chrom_tune.f90 index dfbf133f5b..19ec0308ed 100644 --- a/bmad/code/chrom_tune.f90 +++ b/bmad/code/chrom_tune.f90 @@ -110,6 +110,7 @@ subroutine chrom_tune(lat, delta_e, target_x, target_y, err_tol, err_flag) if (status < 0) then call out_io (s_error$, r_name, 'SINGULAR MATRIX ENCOUNTERED!') + call this_bookkeeping() return endif @@ -127,6 +128,7 @@ subroutine chrom_tune(lat, delta_e, target_x, target_y, err_tol, err_flag) else lat%ele(ix_y_sex(:))%value(k2$) = sex_y_value(:) * (1 + k2_vec(2)) endif + call this_bookkeeping() return endif enddo @@ -134,9 +136,26 @@ subroutine chrom_tune(lat, delta_e, target_x, target_y, err_tol, err_flag) call out_io (s_error$, r_name, 'CANNOT ADJUST SEXTUPOLES TO GET DESIRED CHROMATICITIES!') err_flag = .true. -!------------------------------------------------------ +!------------------------------------------------------- contains +subroutine this_bookkeeping() + +do i = 1, size(ix_x_sex) + ele => lat%ele(ix_x_sex(i)) + call set_flags_for_changed_attribute(ele, ele%value(k2$)) +enddo + +do i = 1, size(ix_y_sex) + ele => lat%ele(ix_y_sex(i)) + call set_flags_for_changed_attribute(ele, ele%value(k2$)) +enddo + +end subroutine this_bookkeeping + +!------------------------------------------------------ +! contains + subroutine chrom_func (a_try, y_fit, dy_da, status) real(rp), intent(in) :: a_try(:) @@ -161,7 +180,9 @@ subroutine chrom_func (a_try, y_fit, dy_da, status) lat%ele(ix_y_sex(:))%value(k2$) = sex_y_value(:) * (1 + a_try(2)) endif +call this_bookkeeping() call chrom_calc(lat, delta_e, chrom_x0, chrom_y0) + y_fit = [chrom_x0, chrom_y0] if (all_x_zero) then @@ -176,7 +197,9 @@ subroutine chrom_func (a_try, y_fit, dy_da, status) lat%ele(ix_y_sex(:))%value(k2$) = sex_y_value(:) * (1 + a_try(2)) endif +call this_bookkeeping() call chrom_calc(lat, delta_e, chrom_x, chrom_y) + dy_da(1,1) = (chrom_x - chrom_x0) / delta dy_da(2,1) = (chrom_y - chrom_y0) / delta @@ -192,7 +215,9 @@ subroutine chrom_func (a_try, y_fit, dy_da, status) lat%ele(ix_y_sex(:))%value(k2$) = sex_y_value(:) * (1 + a_try(2) + delta) endif +call this_bookkeeping() call chrom_calc(lat, delta_e, chrom_x, chrom_y) + dy_da(1,2) = (chrom_x - chrom_x0) / delta dy_da(2,2) = (chrom_y - chrom_y0) / delta diff --git a/bmad/code/lat_compute_reference_energy.f90 b/bmad/code/lat_compute_reference_energy.f90 index 466345b3a5..b2ea9a0ee9 100644 --- a/bmad/code/lat_compute_reference_energy.f90 +++ b/bmad/code/lat_compute_reference_energy.f90 @@ -69,8 +69,10 @@ subroutine lat_compute_ref_energy_and_time (lat, err_flag) if (begin_ele%value(inherit_from_fork$) == real_garbage$) then ! Happens first time this routine is called from bmad_parser. begin_ele%value(inherit_from_fork$) = false$ if (associated(fork_ele)) then - if (begin_ele%ref_species == fork_ele%ref_species .or. begin_ele%ref_species == not_set$) & - begin_ele%value(inherit_from_fork$) = true$ + if (begin_ele%ref_species == fork_ele%ref_species .or. begin_ele%ref_species == not_set$) then + begin_ele%value(inherit_from_fork$) = true$ + begin_ele%old_value(inherit_from_fork$) = true$ + endif endif endif @@ -138,6 +140,10 @@ subroutine lat_compute_ref_energy_and_time (lat, err_flag) begin_ele%value(ref_time_start$) = begin_ele%ref_time endif + begin_ele%old_value(e_tot$) = begin_ele%value(e_tot$) + begin_ele%old_value(e_tot_start$) = begin_ele%value(e_tot_start$) + begin_ele%old_value(p0c$) = begin_ele%value(p0c$) + begin_ele%old_value(p0c_start$) = begin_ele%value(p0c_start$) begin_ele%bookkeeping_state%ref_energy = ok$ ! diff --git a/bmad/code/lattice_bookkeeper.f90 b/bmad/code/lattice_bookkeeper.f90 index 0cc783be44..18c6aaf4e4 100644 --- a/bmad/code/lattice_bookkeeper.f90 +++ b/bmad/code/lattice_bookkeeper.f90 @@ -29,6 +29,7 @@ subroutine lattice_bookkeeper (lat, err_flag) use bookkeeper_mod, dummy => lattice_bookkeeper use precision_constants, only: e_muon ! PTC +use bmad_parser_struct, only: bp_com implicit none @@ -60,6 +61,17 @@ subroutine lattice_bookkeeper (lat, err_flag) do j = 0, branch%n_ele_max call set_ele_status_stale (branch%ele(j), all_groups$, .false.) call attributes_need_bookkeeping(branch%ele(j), dval) + + if (any(dval /= 0) .and. bp_com%parser_name == '') then ! If not parsing then error + call out_io (s_warn$, r_name, & + '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!', & + '!!!!! Using intelligent bookkeeping will, in the near future, be mandated for all !!!!!', & + '!!!!! Bmad programs that modify lattice parameters. !!!!!', & + '!!!!! See the "Intelligent Bookkeeping" section in the Bmad manual. !!!!!', & + '!!!!! Contact the maintainer of this program with this information. !!!!!', & + '!!!!! This program will run now but in the future this will change. !!!!!', & + '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') + endif enddo enddo endif diff --git a/bmad/code/set_z_tune.f90 b/bmad/code/set_z_tune.f90 index 68c32df184..ec06a4dd33 100644 --- a/bmad/code/set_z_tune.f90 +++ b/bmad/code/set_z_tune.f90 @@ -46,7 +46,7 @@ subroutine set_z_tune (branch, z_tune, ok, print_err) integer i, j, k, ix, is, status integer :: loop_max = 10 -logical found_control, err_flag +logical found_control, err_flag, auto_saved ! common @@ -58,6 +58,7 @@ subroutine set_z_tune (branch, z_tune, ok, print_err) ! Error detec and init. +auto_saved = bmad_com%auto_bookkeeper Qz_rel_tol = 1d-5 Qz_abs_tol = 1d-7 @@ -140,6 +141,7 @@ subroutine set_z_tune (branch, z_tune, ok, print_err) ' 1) ON, AND', & ' 2) HAVE A FINETE RF_FREQUENCY!', & ' THE Z TUNE WILL NOT BE SET.') + bmad_com%auto_bookkeeper = auto_saved return endif @@ -152,6 +154,7 @@ subroutine set_z_tune (branch, z_tune, ok, print_err) if (branch%z%tune == 0) then call out_io (s_error$, r_name, 'CALCULATED Z TUNE IS ZERO. CANNOT SET THE TUNE.') if (global_com%exit_on_error) call err_exit + bmad_com%auto_bookkeeper = auto_saved return endif @@ -182,7 +185,10 @@ subroutine set_z_tune (branch, z_tune, ok, print_err) ! now set cavity voltage to get the correct tune do k = 1, loop_max - if (abs(dz_tune) < Qz_abs_tol) return + if (abs(dz_tune) < Qz_abs_tol) then + bmad_com%auto_bookkeeper = auto_saved + return + endif if (dz_tune * dz_tune0 < 0) exit ! Have bracketed solution @@ -202,6 +208,7 @@ subroutine set_z_tune (branch, z_tune, ok, print_err) if (global_com%exit_on_error) call err_exit endif branch%z%stable = .false. + bmad_com%auto_bookkeeper = auto_saved return endif enddo @@ -211,6 +218,7 @@ subroutine set_z_tune (branch, z_tune, ok, print_err) coef = super_zbrent (dz_tune_func, min(coef0, coef), max(coef0, coef), Qz_rel_tol, Qz_abs_tol, status) dz_tune = dz_tune_func(coef, status) branch%z%stable = .true. +bmad_com%auto_bookkeeper = auto_saved !------------------------------------------------------------------------------------- contains diff --git a/bmad/modules/bookkeeper_mod.f90 b/bmad/modules/bookkeeper_mod.f90 index ccca2ba519..d076f6b363 100644 --- a/bmad/modules/bookkeeper_mod.f90 +++ b/bmad/modules/bookkeeper_mod.f90 @@ -1908,6 +1908,7 @@ subroutine attributes_need_bookkeeping (ele, dval) select case (ele%key) case (overlay$, group$, hybrid$) ele%bookkeeping_state%attributes = ok$ + if (present(dval)) dval = 0 return end select diff --git a/regression_tests/bend_test/bend_test.bmad b/regression_tests/bend_test/bend_test.bmad index a606234b16..3d81e62b89 100644 --- a/regression_tests/bend_test/bend_test.bmad +++ b/regression_tests/bend_test/bend_test.bmad @@ -11,10 +11,23 @@ beginning[alpha_a] = 0 beginning[alpha_b] = 0 beginning[etap_x] = 0.001 -b: rbend, l_rectangle = 2.0, angle = -0.1, fiducial_pt = entrance_end, e2 = -0 +b1: rbend, l_rectangle = 2.0, angle = -0.1, e1 = -0.01, e2 = 0.02, fiducial_pt = none +b2: rbend, l_rectangle = 2.0, angle = -0.1, e1 = -0.01, e2 = 0.02, fiducial_pt = entrance_end +b3: rbend, l_rectangle = 2.0, angle = -0.1, e1 = -0.01, e2 = 0.02, fiducial_pt = center +b4: rbend, l_rectangle = 2.0, angle = -0.1, e1 = -0.01, e2 = 0.02, fiducial_pt = exit_end -ln: line = (b) +ln: line = (b1, b2, b3, b4) use, ln no_digested + +end_file + +!------------------------ + + +¶ms + dg = 0.01 + dangle = 0.1 +/ diff --git a/regression_tests/bend_test/bend_test.f90 b/regression_tests/bend_test/bend_test.f90 index ea08fc9bf5..19a5069b6c 100644 --- a/regression_tests/bend_test/bend_test.f90 +++ b/regression_tests/bend_test/bend_test.f90 @@ -8,23 +8,42 @@ program bend_test type (ele_struct), pointer :: ele type (ele_struct) ele0 -real(rp) dparam(5), pa(4), f -integer ie, ip, iz, ix_param(5), np +real(rp) dparam(3), vals(4), f, dg, dangle +integer ie, ip, iz, ix_param(3), np, nargs +character(40) str +character(200) lat_file + +namelist / params / dg, dangle + +! + +lat_file = 'bend_test.bmad' +nargs = command_argument_count() +if (nargs > 0) then + call get_command_argument(1, lat_file) +endif ! open (1, file = 'output.now', recl = 200) bmad_com%auto_bookkeeper = .false. -call bmad_parser('bend_test.bmad', lat) +call bmad_parser(lat_file, lat) + +open (2, file = lat_file) +read (2, nml = params) +close (2) + +! f = lat%ele(0)%value(p0c$) / c_light -dparam = [0.01_rp, 0.1_rp, 0.1_rp * f, 0.1_rp, 0.1_rp] -ix_param = [g$, angle$, b_field$, l$, l_rectangle$] +dparam = [dg, dangle, dg * f] +ix_param = [g$, angle$, b_field$] do ie = 1, lat%n_ele_track ele0 = lat%ele(ie) + if (ie > 1) write (1, *) do ip = 1, size(ix_param) ele => lat%ele(ie) @@ -33,12 +52,13 @@ program bend_test ele%value(np) = ele%value(np) + dparam(ip) call set_flags_for_changed_attribute(ele, ele%value(np)) call lattice_bookkeeper(lat) + str = '"' // int_str(ie) // '-' // trim(ele%name) // '-' // trim(attribute_name(ele, np)) - pa(1:3) = [ele%value(ix_param(1)), ele%value(ix_param(2)), ele%value(ix_param(3)) / f] - write (1, '(a, i0, 3a, 4f16.10)') '"', ie, '-', trim(attribute_name(ele, np)), ':g-ang-field" ABS 1E-10', pa(1:3) + vals(1:3) = [ele%value(g$), ele%value(angle$), ele%value(b_field$) / f] + write (1, '(2a, 4f16.10)') trim(str), ' g-ang-field" ABS 1E-10', vals(1:3) - pa = [ele%value(ix_param(4)), ele%value(ix_param(5)), ele%value(e1$), ele%value(e2$)] - write (1, '(a, i0, 3a, 4f16.10)') '"', ie, '-', trim(attribute_name(ele, np)), ':l-lr-e1/2" ABS 1E-10', pa + vals = [ele%value(l$), ele%value(l_rectangle$), ele%value(e1$), ele%value(e2$)] + write (1, '(2a, 4f16.10)') trim(str), ' l-lr-e1/2" ABS 1E-10', vals enddo enddo diff --git a/regression_tests/bend_test/output.correct b/regression_tests/bend_test/output.correct index 9b56da4fc9..5364dfa340 100644 --- a/regression_tests/bend_test/output.correct +++ b/regression_tests/bend_test/output.correct @@ -1,20 +1,27 @@ -"1-p1-G" ABS 1E-10 0.0100000000 0.0200013336 -0.0100000000 -"1-p2-G" ABS 1E-10 2.0001333573 2.0000000000 0.0000000000 0.0200013336 -"1-p1-ANGLE" ABS 1E-10 0.0499167083 0.0998334166 -0.0499167083 -"1-p2-ANGLE" ABS 1E-10 2.0000000000 1.9966794182 0.0000000000 0.1000000000 -"1-p1-B_FIELD" ABS 1E-10 -0.1000000000 -0.2013579208 0.1000000000 -"1-p2-B_FIELD" ABS 1E-10 2.0135792079 2.0000000000 0.0000000000 -0.2013579208 -"1-p1-L" ABS 1E-10 0.0000000000 0.0000000000 0.0000000000 -"1-p2-L" ABS 1E-10 2.1000000000 2.1000000000 0.0000000000 0.0000000000 -"1-p1-L_RECTANGLE" ABS 1E-10 0.0000000000 0.0000000000 0.0000000000 -"1-p2-L_RECTANGLE" ABS 1E-10 2.1000000000 2.1000000000 0.0000000000 0.0000000000 -"2-p1-NOISE" ABS 1E-10 0.0100000000 0.0000000000 0.0000000000 -"2-p2-NOISE" ABS 1E-10 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -"2-p1-!NULL" ABS 1E-10 0.0000000000 0.1000000000 0.0000000000 -"2-p2-!NULL" ABS 1E-10 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -"2-p1-!NULL" ABS 1E-10 0.0000000000 0.0000000000 0.1000000000 -"2-p2-!NULL" ABS 1E-10 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -"2-p1-L" ABS 1E-10 0.0000000000 0.0000000000 0.0000000000 -"2-p2-L" ABS 1E-10 0.1000000000 0.0000000000 0.0000000000 0.0000000000 -"2-p1-X_DISPERSION_ERR" ABS 1E-10 0.0000000000 0.0000000000 0.0000000000 -"2-p2-X_DISPERSION_ERR" ABS 1E-10 0.0000000000 0.1000000000 0.0000000000 0.0000000000 +"1-B1-G g-ang-field" ABS 1E-10 -0.0899583385 -0.0899958321 0.0899583385 +"1-B1-G l-lr-e1/2" ABS 1E-10 1.0004167882 1.0000792130 -0.0600000000 -0.0300000000 +"1-B1-ANGLE g-ang-field" ABS 1E-10 0.0000000000 0.0000000000 0.0000000000 +"1-B1-ANGLE l-lr-e1/2" ABS 1E-10 1.0004167882 1.0004167882 -0.0600000000 -0.0300000000 +"1-B1-B_FIELD g-ang-field" ABS 1E-10 -0.1099583385 -0.1100041679 0.1099583385 +"1-B1-B_FIELD l-lr-e1/2" ABS 1E-10 1.0004167882 0.9999124495 -0.0600000000 -0.0300000000 + +"2-B2-G g-ang-field" ABS 1E-10 -0.0399167083 -0.0798465124 0.0399167083 +"2-B2-G l-lr-e1/2" ABS 1E-10 2.0003280761 1.9982032498 -0.0100000000 -0.0598465124 +"2-B2-ANGLE g-ang-field" ABS 1E-10 0.0000000000 0.0000000000 0.0000000000 +"2-B2-ANGLE l-lr-e1/2" ABS 1E-10 1.9997998065 1.9997998065 -0.0100000000 0.0200000000 +"2-B2-B_FIELD g-ang-field" ABS 1E-10 -0.0599167083 -0.1199652011 0.0599167083 +"2-B2-B_FIELD l-lr-e1/2" ABS 1E-10 2.0021994607 1.9974004232 -0.0100000000 -0.0999652011 + +"3-B3-G g-ang-field" ABS 1E-10 -0.0899583385 -0.0899780267 0.0899583385 +"3-B3-G l-lr-e1/2" ABS 1E-10 1.0002188584 0.9998814835 -0.0550050486 -0.0249729781 +"3-B3-ANGLE g-ang-field" ABS 1E-10 0.0000000000 0.0000000000 0.0000000000 +"3-B3-ANGLE l-lr-e1/2" ABS 1E-10 0.9999874957 0.9999874957 -0.0600000000 0.0200000000 +"3-B3-B_FIELD g-ang-field" ABS 1E-10 -0.1099583385 -0.1099980130 0.1099583385 +"3-B3-B_FIELD l-lr-e1/2" ABS 1E-10 1.0003608132 0.9998565591 -0.0650227503 -0.0349752627 + +"4-B4-G g-ang-field" ABS 1E-10 -0.0399167083 -0.0799545201 0.0399167083 +"4-B4-G l-lr-e1/2" ABS 1E-10 2.0030339039 2.0009004450 -0.0899545201 0.0200000000 +"4-B4-ANGLE g-ang-field" ABS 1E-10 0.0000000000 0.0000000000 0.0000000000 +"4-B4-ANGLE l-lr-e1/2" ABS 1E-10 2.0001000868 2.0001000868 -0.0100000000 0.0200000000 +"4-B4-B_FIELD g-ang-field" ABS 1E-10 -0.0599167083 -0.1202008094 0.0599167083 +"4-B4-B_FIELD l-lr-e1/2" ABS 1E-10 2.0061317242 2.0013043692 -0.1302008094 0.0200000000 diff --git a/regression_tests/bookkeeper_test/bookkeeper_test.f90 b/regression_tests/bookkeeper_test/bookkeeper_test.f90 index 97bc254990..2d7c838657 100644 --- a/regression_tests/bookkeeper_test/bookkeeper_test.f90 +++ b/regression_tests/bookkeeper_test/bookkeeper_test.f90 @@ -60,6 +60,7 @@ program bookkeeper_test !----------------------------------------- +bmad_com%auto_bookkeeper = .false. call bmad_parser('ramper.bmad', lat) call lat_ele_locator ('ramper::*', lat, ramper, n, err) diff --git a/regression_tests/cesr_test/cesr_test.f90 b/regression_tests/cesr_test/cesr_test.f90 index a7ebddd4f6..9214a1b473 100644 --- a/regression_tests/cesr_test/cesr_test.f90 +++ b/regression_tests/cesr_test/cesr_test.f90 @@ -24,6 +24,7 @@ program twiss_track_test open (2, file = 'output.now', recl = 200) +bmad_com%auto_bookkeeper = .false. lat_file = "bmad_L9A18A000-_MOVEREC.lat" call bmad_parser (lat_file, lat2) call write_digested_bmad_file ('digested.file', lat2) diff --git a/regression_tests/cesr_test/output.correct b/regression_tests/cesr_test/output.correct index baccea97e3..41624de21d 100644 --- a/regression_tests/cesr_test/output.correct +++ b/regression_tests/cesr_test/output.correct @@ -1,122 +1,122 @@ "Closed Orb 6T Start" ABS 1e-12 3.508067E-05 -2.428907E-03 -1.049389E-06 -8.469213E-06 1.875147E-02 -8.180222E-06 "Closed Orb 6T Del" ABS 2e-12 4.1981E-12 4.4894E-12 -1.5420E-13 3.5643E-12 1.2062E-11 -1.0100E-12 -"Closed Orb 6 Start" ABS 1e-12 3.508240E-05 -2.428896E-03 -1.050208E-06 -8.470257E-06 1.875647E-02 -7.606271E-06 -"Closed Orb 6 Del" ABS 1e-12 -3.2088E-13 1.1814E-12 1.5955E-14 3.7440E-12 1.1162E-12 1.1522E-13 +"Closed Orb 6 Start" ABS 1e-12 3.508133E-05 -2.428888E-03 -1.050212E-06 -8.469965E-06 1.875401E-02 -7.620517E-06 +"Closed Orb 6 Del" ABS 1e-12 -8.9509E-13 5.8234E-13 4.0972E-14 3.2304E-12 -8.0077E-13 2.5650E-13 "Closed Orb 5 Start" ABS 1e-12 3.314039E-05 -2.390967E-03 -1.052821E-06 -8.300689E-06 0.000000E+00 -7.459401E-06 -"Closed Orb 5 Del" ABS 1e-12 -6.4307E-12 -1.4295E-11 5.6571E-14 2.6228E-13 1.4039E-12 6.7763E-21 +"Closed Orb 5 Del" ABS 1e-12 -6.4187E-12 -1.4294E-11 5.6758E-14 2.5941E-13 1.6036E-12 -1.6941E-21 "Closed Orb 4 Start" ABS 1e-12 3.314039E-05 -2.390967E-03 -1.052821E-06 -8.300688E-06 0.000000E+00 -7.459401E-06 -"Closed Orb 4 Del" ABS 1e-12 -6.9784E-15 -4.6018E-15 4.1413E-16 1.0235E-15 1.2878E-12 1.6941E-21 +"Closed Orb 4 Del" ABS 1e-12 -7.2993E-15 -4.8204E-15 4.1444E-16 1.0405E-15 1.4876E-12 -5.0822E-21 "First Descrip" STR "First" "Second Descrip" STR "Second" -"Cache Diff: I1-no_wig" ABS 1e-8 496 6.179560500E-04 -"Cache Diff: I2-no_wig" ABS 1e-8 10 5.551230207E-06 -"Cache Diff: I3-no_wig" ABS 1e-8 10 1.523799473E-06 -"Cache Diff: I4a-no_wig" ABS 1e-8 156 1.405752968E-04 -"Cache Diff: I4b-no_wig" ABS 1e-8 428 2.912442463E-04 -"Cache Diff: I5a-no_wig" ABS 1e-8 824 8.203538350E-03 -"Cache Diff: I5b-no_wig" ABS 1e-8 402 9.804946504E-04 -"Dif:Orb(1)" ABS 1.0E-07 -2.33685141549922E-14 -"Dif:Orb(2)" ABS 1.0E-07 4.77123549003089E-13 -"Dif:Orb(3)" ABS 1.0E-07 1.45020108558759E-15 -"Dif:Orb(4)" ABS 1.0E-07 -1.07199236195742E-14 -"Dif:Orb(5)" ABS 1.0E-07 4.84725107274819E-12 -"Dif:Orb(6)" ABS 1.0E-07 -1.03619970236331E-12 -"Dif:Beta_X" ABS 1.0E-07 -2.16615538228826E-06 -"Dif:Beta_Y" ABS 1.0E-07 3.55004957722227E-09 -"Dif:Alpha_X" ABS 1.0E-07 1.09135069879121E-05 -"Dif:Alpha_Y" ABS 1.0E-07 1.48104998647092E-07 -"Dif:Eta_X " ABS 1.0E-07 4.28192300504812E-06 -"Dif:Eta_Y " ABS 1.0E-07 3.40292745522851E-09 -"Dif:Etap_X" ABS 1.0E-06 -3.04071629210270E-05 -"Dif:Etap_Y" ABS 1.0E-06 2.26380020518007E-06 -"Dif:Etap_X" ABS 1.0E-06 -3.04073952120190E-05 -"Dif:Etap_Y" ABS 1.0E-06 2.16063616251174E-06 -"Lat1:Beta_a" ABS 1.0E-06 5.74755728175682E+00 -"Lat1:Alpha_a" ABS 1.0E-06 6.17183084954029E-01 -"Lat1:Eta_a" ABS 1.0E-06 3.81079580219623E-01 -"Lat1:Etap_a" ABS 1.0E-06 -1.50985407074940E-01 -"Lat1:Deta_a_Ds" ABS 1.0E-06 -1.49491430805345E-01 -"Lat1:Eta_x" ABS 1.0E-06 3.81072825854607E-01 -"Lat1:Etap_x" ABS 1.0E-06 -1.50984512203686E-01 -"Lat1:Deta_x_Ds" ABS 1.0E-06 -1.49490538943290E-01 -"Lat1:Phi_a" ABS 1.0E-06 6.67148580318659E+00 -"Lat1:Beta_b" ABS 1.0E-06 3.00630062638158E+01 -"Lat1:Alpha_y" ABS 1.0E-06 -1.70228379556182E+00 -"Lat1:Eta_b" ABS 1.0E-06 -2.69791050794704E-02 -"Lat1:Etap_b" ABS 1.0E-06 -1.86491344469377E-03 -"Lat1:Deta_b_Ds" ABS 1.0E-06 -1.85821671279631E-03 -"Lat1:Eta_y" ABS 1.0E-06 -2.26187288294449E-02 -"Lat1:Etap_y" ABS 1.0E-06 -1.53834524844234E-03 -"Lat1:Deta_y_Ds" ABS 1.0E-06 -1.53504330951996E-03 -"Lat1:Phi_y" ABS 1.0E-06 5.93989686093169E+00 -"Lat1:Orb X" ABS 1.0E-10 3.25325012796147E-03 -"Lat1:Orb P_X" ABS 1.0E-10 -1.48509969948590E-03 -"Lat1:Orb Y" ABS 1.0E-10 -5.00260133818829E-05 -"Lat1:Orb P_Y" ABS 1.0E-10 -3.21009899475808E-06 -"Lat1:Orb Z" ABS 1.0E-10 1.77574474419780E-02 -"Lat1:Orb P_Z" ABS 1.0E-10 5.99542531502537E-05 -"Lat1:Chrom_x" ABS 1.0E-05 -1.17355450638179E+00 -"Lat1:Chrom_y" ABS 1.0E-05 -9.41786942512124E-01 -"Lat1:Synch_int(1)" ABS 1.0E-06 8.84194890492006E+00 -"Lat1:Synch_int(2)" ABS 1.0E-06 1.04424863370109E-01 -"Lat1:Synch_int(3)" ABS 1.0E-06 2.30420629537313E-03 -"Lat1:Sige_e" ABS 1.0E-10 6.75242117421361E-04 -"Lat1:Sig_z" ABS 1.0E-08 1.85933501233728E-02 -"Lat1:E_loss" ABS 1.0E-01 1.15047899411770E+06 -"Lat1:A%Emittance" ABS 1.0E-12 2.02129364314750E-07 -"Lat1:B%Emittance" ABS 1.0E-14 1.79689109250504E-11 -"Lat1:Z%Emittance" ABS 1.0E-11 1.25550131072629E-05 -"Lat1:A%Synch_int(4)" ABS 1.0E-07 -1.35181825937264E-03 -"Lat1:A%Synch_int(5)" ABS 1.0E-07 5.20827232154712E-04 -"Lat1:B%Synch_int(4)" ABS 1.0E-07 -4.09638242656544E-05 -"Lat1:B%Synch_int(5)" ABS 1.0E-11 4.56385534430111E-08 -"Lat1:Z%Synch_int(4)" ABS 1.0E-08 -1.39278208363830E-03 +"Cache Diff: I1-no_wig" ABS 1e-8 496 6.179583489E-04 +"Cache Diff: I2-no_wig" ABS 1e-8 10 5.550280336E-06 +"Cache Diff: I3-no_wig" ABS 1e-8 10 1.523408683E-06 +"Cache Diff: I4a-no_wig" ABS 1e-8 156 1.405828188E-04 +"Cache Diff: I4b-no_wig" ABS 1e-8 428 2.912854650E-04 +"Cache Diff: I5a-no_wig" ABS 1e-8 824 8.203329946E-03 +"Cache Diff: I5b-no_wig" ABS 1e-8 402 9.804384557E-04 +"Dif:Orb(1)" ABS 1.0E-07 -2.35761117659689E-14 +"Dif:Orb(2)" ABS 1.0E-07 4.55031845536524E-13 +"Dif:Orb(3)" ABS 1.0E-07 1.38947094085182E-15 +"Dif:Orb(4)" ABS 1.0E-07 -1.02058101959747E-14 +"Dif:Orb(5)" ABS 1.0E-07 4.69316599471803E-12 +"Dif:Orb(6)" ABS 1.0E-07 -9.83813269227001E-13 +"Dif:Beta_X" ABS 1.0E-07 -2.15649285817410E-06 +"Dif:Beta_Y" ABS 1.0E-07 3.52817076942902E-09 +"Dif:Alpha_X" ABS 1.0E-07 1.08622493285590E-05 +"Dif:Alpha_Y" ABS 1.0E-07 1.47277328301637E-07 +"Dif:Eta_X " ABS 1.0E-07 4.27534809348826E-06 +"Dif:Eta_Y " ABS 1.0E-07 3.29323072913341E-09 +"Dif:Etap_X" ABS 1.0E-06 -3.03395851193183E-05 +"Dif:Etap_Y" ABS 1.0E-06 2.25111294846806E-06 +"Dif:Etap_X" ABS 1.0E-06 -3.03398166748570E-05 +"Dif:Etap_Y" ABS 1.0E-06 2.16949700173621E-06 +"Lat1:Beta_a" ABS 1.0E-06 5.74763693582010E+00 +"Lat1:Alpha_a" ABS 1.0E-06 6.17173215710126E-01 +"Lat1:Eta_a" ABS 1.0E-06 3.81069240411844E-01 +"Lat1:Etap_a" ABS 1.0E-06 -1.50983619694150E-01 +"Lat1:Deta_a_Ds" ABS 1.0E-06 -1.49489640285543E-01 +"Lat1:Eta_x" ABS 1.0E-06 3.81062496575199E-01 +"Lat1:Etap_x" ABS 1.0E-06 -1.50982726908926E-01 +"Lat1:Deta_x_Ds" ABS 1.0E-06 -1.49488750504103E-01 +"Lat1:Phi_a" ABS 1.0E-06 6.67147846934146E+00 +"Lat1:Beta_b" ABS 1.0E-06 3.00629345895890E+01 +"Lat1:Alpha_y" ABS 1.0E-06 -1.70227675430852E+00 +"Lat1:Eta_b" ABS 1.0E-06 -2.69801515993396E-02 +"Lat1:Etap_b" ABS 1.0E-06 -1.86495518147771E-03 +"Lat1:Deta_b_Ds" ABS 1.0E-06 -1.85825864933178E-03 +"Lat1:Eta_y" ABS 1.0E-06 -2.26186862260131E-02 +"Lat1:Etap_y" ABS 1.0E-06 -1.53834718246416E-03 +"Lat1:Deta_y_Ds" ABS 1.0E-06 -1.53504580256869E-03 +"Lat1:Phi_y" ABS 1.0E-06 5.93989353758205E+00 +"Lat1:Orb X" ABS 1.0E-10 3.25344073879008E-03 +"Lat1:Orb P_X" ABS 1.0E-10 -1.48512279658479E-03 +"Lat1:Orb Y" ABS 1.0E-10 -5.00215599740055E-05 +"Lat1:Orb P_Y" ABS 1.0E-10 -3.20974518281774E-06 +"Lat1:Orb Z" ABS 1.0E-10 1.76698079928362E-02 +"Lat1:Orb P_Z" ABS 1.0E-10 5.98201750949046E-05 +"Lat1:Chrom_x" ABS 1.0E-05 -1.17355158067767E+00 +"Lat1:Chrom_y" ABS 1.0E-05 -9.41784476014007E-01 +"Lat1:Synch_int(1)" ABS 1.0E-06 8.84194951854081E+00 +"Lat1:Synch_int(2)" ABS 1.0E-06 1.04424830428763E-01 +"Lat1:Synch_int(3)" ABS 1.0E-06 2.30420569814754E-03 +"Lat1:Sige_e" ABS 1.0E-10 6.75240370801801E-04 +"Lat1:Sig_z" ABS 1.0E-08 1.85916378318212E-02 +"Lat1:E_loss" ABS 1.0E-01 1.15047863119335E+06 +"Lat1:A%Emittance" ABS 1.0E-12 2.02131722332084E-07 +"Lat1:B%Emittance" ABS 1.0E-14 1.79690565371388E-11 +"Lat1:Z%Emittance" ABS 1.0E-11 1.25538244233717E-05 +"Lat1:A%Synch_int(4)" ABS 1.0E-07 -1.35073700572230E-03 +"Lat1:A%Synch_int(5)" ABS 1.0E-07 5.20827821884271E-04 +"Lat1:B%Synch_int(4)" ABS 1.0E-07 -4.09597221574309E-05 +"Lat1:B%Synch_int(5)" ABS 1.0E-11 4.56389077930481E-08 +"Lat1:Z%Synch_int(4)" ABS 1.0E-08 -1.39169672787973E-03 -"Cache Diff: I1-wig" ABS 1e-8 398 6.427705296E-04 +"Cache Diff: I1-wig" ABS 1e-8 398 6.427705305E-04 "Cache Diff: I2-wig" ABS 1e-8 917 1.796173843E-06 "Cache Diff: I3-wig" ABS 1e-8 917 2.004272991E-07 -"Cache Diff: I4a-wig" ABS 1e-8 56 5.063753843E-05 -"Cache Diff: I4b-wig" ABS 1e-8 917 1.234030878E-04 -"Cache Diff: I5a-wig" ABS 1e-8 50 2.867657461E-05 -"Cache Diff: I5b-wig" ABS 1e-8 862 1.389303589E-05 -"Lat2:Beta_a" ABS 1.0E-05 1.63241327697001E+01 -"Lat2:Alpha_a" ABS 1.0E-05 -1.51916901683317E+00 -"Lat2:Eta_a" ABS 1.0E-05 2.25296842978664E+00 -"Lat2:Etap_a" ABS 1.0E-05 1.86023795976713E-01 -"Lat2:Deta_a_Ds" ABS 1.0E-05 1.85471761338328E-01 -"Lat2:Eta_x" ABS 1.0E-05 2.25293014970255E+00 -"Lat2:Etap_x" ABS 1.0E-05 1.86006226079604E-01 -"Lat2:Deta_x_Ds" ABS 1.0E-05 1.85454230057977E-01 -"Lat2:Phi_a" ABS 1.0E-05 5.68599666766948E+00 -"Lat2:Beta_b" ABS 1.0E-05 2.65318213916517E+01 -"Lat2:Alpha_b" ABS 1.0E-05 1.51859630159158E+00 -"Lat2:Eta_b" ABS 1.0E-05 -8.81652263112590E-03 -"Lat2:Etap_b" ABS 1.0E-05 -7.50700635274169E-04 -"Lat2:Deta_b_Ds" ABS 1.0E-05 -7.46691960696562E-04 -"Lat2:Eta_y" ABS 1.0E-05 -2.03201128939990E-02 -"Lat2:Etap_y" ABS 1.0E-05 1.95191415148456E-03 -"Lat2:Deta_y_Ds" ABS 1.0E-05 1.94624610264159E-03 -"Lat2:Phi_b" ABS 1.0E-05 4.76647532786521E+00 -"Lat2:Orb X" ABS 1.0E-07 1.18493311706587E-02 -"Lat2:Orb P_X" ABS 1.0E-07 5.52227738196148E-04 -"Lat2:Orb Y" ABS 1.0E-07 -2.65182968855430E-05 -"Lat2:Orb P_Y" ABS 1.0E-07 5.67048074485485E-06 -"Lat2:Orb Z" ABS 1.0E-07 -1.49778902918623E-03 -"Lat2:Orb P_Z" ABS 1.0E-07 -1.25318583885772E-06 -"Lat2:Chrom_x" ABS 1.0E-04 6.41525629885287E+00 -"Lat2:Chrom_y" ABS 1.0E-04 5.70528459500785E+00 -"Lat2:Synch_int(1)" ABS 1.0E-06 8.66018423912542E+00 -"Lat2:Synch_int(2)" ABS 1.0E-06 9.97053316812563E-01 -"Lat2:Synch_int(3)" ABS 1.0E-06 2.62658509891663E-01 -"Lat2:Sige_e" ABS 1.0E-10 8.41149646134634E-04 -"Lat2:Sig_z" ABS 1.0E-08 2.27386275458037E-02 -"Lat2:E_loss" ABS 1.0E-01 1.77232886436639E+05 -"Lat2:A%Emittance" ABS 1.0E-12 1.23659335790078E-07 -"Lat2:B%Emittance" ABS 1.0E-14 9.54067929109133E-11 -"Lat2:Z%Emittance" ABS 1.0E-11 1.91265885137401E-05 -"Lat2:A%Synch_int(4)" ABS 1.0E-07 -5.90562374954820E-02 -"Lat2:A%Synch_int(5)" ABS 1.0E-07 2.50457845985681E-02 -"Lat2:B%Synch_int(4)" ABS 1.0E-07 6.85852825836967E-04 -"Lat2:B%Synch_int(5)" ABS 1.0E-11 1.81627016056510E-05 -"Lat2:Z%Synch_int(4)" ABS 1.0E-08 -5.83703846696451E-02 +"Cache Diff: I4a-wig" ABS 1e-8 56 5.063753855E-05 +"Cache Diff: I4b-wig" ABS 1e-8 917 1.234030905E-04 +"Cache Diff: I5a-wig" ABS 1e-8 50 2.867657455E-05 +"Cache Diff: I5b-wig" ABS 1e-8 862 1.389303604E-05 +"Lat2:Beta_a" ABS 1.0E-05 1.63241327868863E+01 +"Lat2:Alpha_a" ABS 1.0E-05 -1.51916902332895E+00 +"Lat2:Eta_a" ABS 1.0E-05 2.25296842647764E+00 +"Lat2:Etap_a" ABS 1.0E-05 1.86023795662848E-01 +"Lat2:Deta_a_Ds" ABS 1.0E-05 1.85471761023797E-01 +"Lat2:Eta_x" ABS 1.0E-05 2.25293014638741E+00 +"Lat2:Etap_x" ABS 1.0E-05 1.86006225765405E-01 +"Lat2:Deta_x_Ds" ABS 1.0E-05 1.85454229743116E-01 +"Lat2:Phi_a" ABS 1.0E-05 5.68599666970430E+00 +"Lat2:Beta_b" ABS 1.0E-05 2.65318213344550E+01 +"Lat2:Alpha_b" ABS 1.0E-05 1.51859629695549E+00 +"Lat2:Eta_b" ABS 1.0E-05 -8.81652338691513E-03 +"Lat2:Etap_b" ABS 1.0E-05 -7.50700551721111E-04 +"Lat2:Deta_b_Ds" ABS 1.0E-05 -7.46691877456410E-04 +"Lat2:Eta_y" ABS 1.0E-05 -2.03201127498233E-02 +"Lat2:Etap_y" ABS 1.0E-05 1.95191413943622E-03 +"Lat2:Deta_y_Ds" ABS 1.0E-05 1.94624609058638E-03 +"Lat2:Phi_b" ABS 1.0E-05 4.76647532910460E+00 +"Lat2:Orb X" ABS 1.0E-07 1.18493311707277E-02 +"Lat2:Orb P_X" ABS 1.0E-07 5.52227738206236E-04 +"Lat2:Orb Y" ABS 1.0E-07 -2.65182968852765E-05 +"Lat2:Orb P_Y" ABS 1.0E-07 5.67048074484847E-06 +"Lat2:Orb Z" ABS 1.0E-07 -1.49778902918638E-03 +"Lat2:Orb P_Z" ABS 1.0E-07 -1.25318230750584E-06 +"Lat2:Chrom_x" ABS 1.0E-04 6.41525681991162E+00 +"Lat2:Chrom_y" ABS 1.0E-04 5.70528511074642E+00 +"Lat2:Synch_int(1)" ABS 1.0E-06 8.66018423831030E+00 +"Lat2:Synch_int(2)" ABS 1.0E-06 9.97053316709504E-01 +"Lat2:Synch_int(3)" ABS 1.0E-06 2.62658509850258E-01 +"Lat2:Sige_e" ABS 1.0E-10 8.41149645811921E-04 +"Lat2:Sig_z" ABS 1.0E-08 2.27386275360098E-02 +"Lat2:E_loss" ABS 1.0E-01 1.77232886418320E+05 +"Lat2:A%Emittance" ABS 1.0E-12 1.23659335724819E-07 +"Lat2:B%Emittance" ABS 1.0E-14 9.54067899532743E-11 +"Lat2:Z%Emittance" ABS 1.0E-11 1.91265884981638E-05 +"Lat2:A%Synch_int(4)" ABS 1.0E-07 -5.90562361097726E-02 +"Lat2:A%Synch_int(5)" ABS 1.0E-07 2.50457845500441E-02 +"Lat2:B%Synch_int(4)" ABS 1.0E-07 6.85852826413000E-04 +"Lat2:B%Synch_int(5)" ABS 1.0E-11 1.81627010385696E-05 +"Lat2:Z%Synch_int(4)" ABS 1.0E-08 -5.83703832833595E-02 "Lat2:Lat" STR "T" diff --git a/regression_tests/csr_time_test/CSR.tao b/regression_tests/csr_time_test/CSR.tao new file mode 100644 index 0000000000..f4ee898301 --- /dev/null +++ b/regression_tests/csr_time_test/CSR.tao @@ -0,0 +1,17 @@ +set space_charge_com beam_chamber_height = 0.0254 !1 inch full height +set space_charge_com n_shield_images = 0 +set space_charge_com ds_track_step = 0.01 +set space_charge_com n_bin = 40 +set space_charge_com particle_bin_span = 2 +set space_charge_com lsc_sigma_cutoff = 0.1 ! Cutoff for the lsc calc. If a bin sigma is < cutoff * sigma_ave then ignore. + +set bmad_com csr_and_space_charge_on = T + +set ele * csr_method = 1_dim +set ele * space_charge_method = off + +timer start +set global track_type = beam +timer read +quit + diff --git a/regression_tests/csr_time_test/csr_time_test.bmad b/regression_tests/csr_time_test/csr_time_test.bmad new file mode 100644 index 0000000000..50d4c3981b --- /dev/null +++ b/regression_tests/csr_time_test/csr_time_test.bmad @@ -0,0 +1,43 @@ + + + + +BEGINNING[beta_a] = 0.3145469848 +BEGINNING[alpha_a] = -2.2075642140 +BEGINNING[beta_b] = 0.3438568976 +BEGINNING[alpha_b] = 1.9751085275 +BEGINNING[eta_x] = -0.0065229769 +BEGINNING[etap_x] = 0.0671001523 + +parameter[geometry] = open +PARAMETER[particle] = electron +parameter[e_tot] = 42e6 +parameter[absolute_time_tracking] = F + + + +!--- Pipes +dft00b: drift, L = 0.06 +dft01: drift, L = 0.07 +dft02a: drift, L = 0.06 +dft02: drift, L = 0.12 ! Only used in straight cells + +Qd: QUAD, fringe_type = full, field_master = T +Qd01: Qd +Qd02: Qd + +! Scott solution 2016 May 9 +Qd01[B1_GRADIENT] = -10.620985849931532 +Qd02[B1_GRADIENT] = 10.016651755070429 +Qd01[X_OFFSET] = -7.1820899274544639e-03 +Qd02[X_OFFSET] = 20.131871679706329e-03 + +Qd01[L] = .133 +Qd02[L] = .122 + +Ben01: sbend, L = Qd01[L], b_field = .17, b1_gradient = Qd01[b1_gradient] +Ben02: sbend, L = Qd02[L], b_field = -0.28, b1_gradient = Qd02[b1_gradient] + +cell: line = (dft00b, Ben01, dft01, Ben02, dft02a) +ln: line = (100*cell) +use, ln diff --git a/regression_tests/csr_time_test/tao.init b/regression_tests/csr_time_test/tao.init new file mode 100644 index 0000000000..60519347f6 --- /dev/null +++ b/regression_tests/csr_time_test/tao.init @@ -0,0 +1,64 @@ +!------------------------------------------------------------------------ + +&tao_start + plot_file = 'tao_plot.init' + startup_file = 'CSR.tao' +/ +!Beam Initialization +!-------------------------------------------------------- +&tao_design_lattice + n_universes =1 + ! unique_name_suffix="*::_?" + design_lattice(1)%file = "csr_time_test.bmad" +/ + +!------------------------------------------------------------------------ +&tao_params + global%plot_on = F + global%track_type = 'single' + global%beam_timer_on = T + global%random_engine = 'pseudo' + global%de_lm_step_ratio = 1500 + global%optimizer = 'lmdif' + global%n_opti_cycles = 100 + !---Bmad--- + bmad_com%radiation_damping_on = F + bmad_com%radiation_fluctuations_on = F +/ + +!----MODE X ---- +&tao_beam_init + beam_init%n_particle = 1000 + beam_init%random_engine = 'quasi' + !beam_init%random_engine = 'pseudo' + ix_universe = 1 + saved_at = "MARKER::*, BEGINNING, END" + beam_init%a_norm_emit = 1.0e-6 ! normalized emit = emit * gamma + beam_init%b_norm_emit = 1.0e-6 ! normalized emit = emit * gamma + beam_init%dPz_dz = 0.0 + beam_init%n_bunch = 1 + beam_init%bunch_charge = 77.0e-12 + beam_init%sig_pz = 0e-9 + beam_init%sig_z = 0.000899377 ! 3 ps * cLight +/ + +!------------------------Data-------------------------------------------- +!------------------------------------------------------------------------ + + +! FFAG orbit matching + +!&tao_d2_data + d2_data%name = "o1" + universe = 1 + n_d1_data = 1 +/ + +!&tao_d1_data + ix_d1_data = 1 + default_weight = 1 + d1_data%name = "end" + datum( 1) = "orbit.x" '' '' 'FFAG.CELLMATCH\1' 'target' -0.0169816520 40 + datum( 2) = "orbit.px" '' '' 'FFAG.CELLMATCH\1' 'target' -0.0931239496 1 +/ + diff --git a/regression_tests/csr_time_test/tao_plot.init b/regression_tests/csr_time_test/tao_plot.init new file mode 100644 index 0000000000..09e2139e15 --- /dev/null +++ b/regression_tests/csr_time_test/tao_plot.init @@ -0,0 +1,166 @@ +This initialization file defines how plotting is done. + +The following namelist block defines how the plot window (also called +the plot page) is broken up. + +&tao_plot_page + plot_page%size = 600 , 300 + plot_page%text_height = 12.0 + plot_page%border = 0, 0, 0, 0, '%PAGE' + plot_page%n_curve_pts = 1600 + + plot_page%floor_plan_shape_scale = 0.01 !m to cm + + region(1)%name = 'floor' + region(1)%location = 0.0, 1.0, 0.5, 0.95 + + region(2)%name = 'top' + region(2)%location = 0.0, 1.0, 0.3, 0.5 + + region(3)%name = 'middle' + region(3)%location = 0.0, 1.0, 0.1, 0.26 + + region(4)%name = 'bottom' + region(4)%location = 0.0, 1.0, 0.0, 0.1 + + region(5)%name = 'r21' + region(5)%location = 0.0, .5, 0.1, 0.5 + region(6)%name = 'r11' + region(6)%location = 0.0, .5, .5, 1.0 + region(7)%name = 'r22' + region(7)%location = 0.5, 1.0, 0.1, 0.5 + region(8)%name = 'r12' + region(8)%location = 0.5, 1.0, 0.5, 1.0 + + region(9)%name = 'r00' + region(9)%location = 0.0, 1.0, 0.0, 1.0 + + + ! 2-plot layout + region(10)%name = 'top2' + region(10)%location = 0.0, 1.0, 0.5, .95 + + region(11)%name = 'middle2' + region(11)%location = 0.0, 1.0, 0.1, 0.45 + + + + place(1) = 'r00', 'floor_plan' + +/ + + + +!------------------ layout ------ +&tao_template_plot + plot%name = 'layout' + default_graph%x%label = ' ' + plot%n_graph = 1 + plot%x_axis_type = 's' +/ + +&tao_template_graph + graph_index = 1 + graph%name = 'u1' + graph%type = 'lat_layout' + graph%box = 1, 1, 1, 1 + graph%x%draw_numbers = False + graph%ix_universe = -1 !Syntax Changed from 0 + graph%margin = 0.15, 0.05, 0.12, 0.12, '%BOX' + !graph%y%label = 'Layout' + graph%y%max = 2 + graph%y%min = -2 + graph%y%major_div = 4 +/ + +&lat_layout_drawing + ele_shape(1) = "Quadrupole::*" "asym_var_box" "Blue" 0.1 'none' + ele_shape(2) = "SBend::*" "Box" "Red" 1 'none' + ele_shape(3) = "lcavity::*" "XBox" "Green" 0.5 'none' + ele_shape(4) = "wiggler::*" "XBox" "Orange" 0.5 'none' + ele_shape(5) = "Sextupole::*" "asym_var_box" "magenta" 0.1 'none' + ele_shape(6) = "ECOLLIMATOR::*" "Xbox" "Black" 20 'none' + ele_shape(7) = "hkicker::*" "XBox" "Red" 0.2 'none' + ele_shape(8) = "vkicker::*" "bow_tie" "Red" 0.2 'none' + ele_shape(9) = "INSTRUMENT::*BPM*" "Diamond" "Black" 0.1 'none' + ele_shape(10) = "kicker::*" "Box" "Red" 0.2 'none' + ele_shape(11) = "PIPE::*" "Box" "Light_Grey" 0.01 'none' + ele_shape(12) = "INSTRUMENT::*" "Xbox" "Black" 1 'none' + ele_shape(13) = "SOLENOID::*" "Xbox" "Blue" 1 'none' + ele_shape(14) = "rfcavity::*" "XBox" "Red" 100 'none' + ele_shape(15) = "E_GUN::*" "XBox" "Black" 20 'none' + ele_shape(16) = "EM_FIELD::*" "Box" "Blue" 20 'none' + !ele_shape(16) = "wall::beam_chamber" "XBox" "Black" 500 'none' +/ + +&floor_plan_drawing + ele_shape(1) = "Quadrupole::F*" "Box" "Blue" 30 'none' ! 30 cm radius FFAG Quads + ele_shape(2) = "SBend::*" "Box" "Red" 12 'none' + ele_shape(3) = "lcavity::*" "XBox" "Green" 20 'none' + ele_shape(4) = "wiggler::*" "XBox" "Orange" 10 'none' + ele_shape(5) = "Sextupole::*" "Box" "orange" 4 'none' + ele_shape(6) = "ECOLLIMATOR::*" "Xbox" "Black" 10 'none' + ele_shape(7) = "hkicker::*" "XBox" "Red" 5 'none' + ele_shape(8) = "vkicker::*" "bow_tie" "Red" 5 'none' + ele_shape(9) = "INSTRUMENT::*BPM*" "Diamond" "Black" 1 'none' + ele_shape(10) = "kicker::*" "Box" "Red" 5 'none' + ele_shape(11) = "PIPE::F*" "Box" "Light_Grey" 3.7 'none' + ele_shape(12) = "PIPE::*" "Box" "Light_Grey" 2.54 'none' + ele_shape(13) = "INSTRUMENT::*" "Xbox" "Black" 5 'none' + ele_shape(14) = "SOLENOID::*" "Xbox" "Blue" 5 'none' + ele_shape(15) = "rfcavity::*" "XBox" "Red" 10 'none' + ele_shape(16) = "E_GUN::*" "XBox" "Black" 20 'none' + ele_shape(17) = "EM_FIELD::*" "Box" "Blue" 20 'none' + ele_shape(18) = "Quadrupole::Z*" "Box" "Blue" 30 'none' ! 30 cm radius FFAG Quads + ele_shape(19) = "Quadrupole::*" "Box" "Blue" 7 'none' ! All other quads + ele_shape(20) = 'building_wall::*' "solid_line" 'black' 0 '-' +/ + +! Colors: +!"BLACK" +!"RED" +!"ORANGE" +!"MAGENTA" +!"YELLOW" +!"GREEN" +!"CYAN" +!"BLUE" +!"PURPLE" + + + + +!----------------- + +&tao_template_plot + plot%name = 'zphase' + default_graph%x%min = -6 + default_graph%x%max = 6 + !default_graph%x%major_div = 10 + default_graph%x%label = 'z (mm)' + plot%n_graph = 1 +/ + +&tao_template_graph + graph_index = 1 + graph%name = 'z' + graph%type = 'phase_space' + graph%box = 1, 1, 1, 1 + graph%title = 'Z-Pz' + graph%margin = 0.15, 0.06, 0.12, 0.12, '%BOX' + graph%x_axis_scale_factor = 1000.00 !m->mm + graph%y%label = '\gd (10\u-3\d)' + graph%y%max = 3 + graph%y%min = -3 + graph%y%major_div = 4 + graph%y%label_offset=.4 + curve(1)%data_type = 'z-pz' + curve(1)%y_axis_scale_factor = 1000.0 !1->10^-3 relative + curve(1)%data_source = 'beam_tracking' + curve(1)%ele_ref_name = "BEGINNING" + curve(1)%symbol%type = "dot" +/ + +!-------------------------------------------------------------- + + diff --git a/regression_tests/mat6_calc_method_test/mat6_calc_method_test.f90 b/regression_tests/mat6_calc_method_test/mat6_calc_method_test.f90 index 497307ac8b..d88092f7bc 100644 --- a/regression_tests/mat6_calc_method_test/mat6_calc_method_test.f90 +++ b/regression_tests/mat6_calc_method_test/mat6_calc_method_test.f90 @@ -46,6 +46,7 @@ program mat6_calc_method_test ! +bmad_com%auto_bookkeeper = .false. bmad_com%spin_tracking_on = .true. call bmad_parser (lat_file, lat, make_mats6 = .false.) abs_time = bmad_com%absolute_time_tracking diff --git a/regression_tests/mode3_test/mode3_test.f90 b/regression_tests/mode3_test/mode3_test.f90 index e0f18d152c..11f7c85370 100644 --- a/regression_tests/mode3_test/mode3_test.f90 +++ b/regression_tests/mode3_test/mode3_test.f90 @@ -42,6 +42,7 @@ program one_turn_mat ! +bmad_com%auto_bookkeeper = .false. call bmad_parser ('small_ring.bmad', lat) call twiss_and_track(lat, orbit) call choose_quads_for_set_tune(lat%branch(0), dk1, eles) diff --git a/regression_tests/nonlin_test/nonlin_test.f90 b/regression_tests/nonlin_test/nonlin_test.f90 index 412b769af6..8d6bb58717 100644 --- a/regression_tests/nonlin_test/nonlin_test.f90 +++ b/regression_tests/nonlin_test/nonlin_test.f90 @@ -15,6 +15,7 @@ program nonlin_test open (1, file = 'output.now', recl = 200) +bmad_com%auto_bookkeeper = .false. call bmad_parser('small_ring.bmad', lat) call twiss_and_track (lat, orb, status) diff --git a/tao/version/tao_version_mod.f90 b/tao/version/tao_version_mod.f90 index dc7c991000..bde75ee2e0 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 = "2024/06/17 23:32:03" +character(*), parameter :: tao_version_date = "2024/06/20 04:46:43" end module