Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing missing BV flag in twiss #950

Merged
merged 2 commits into from Aug 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/mad_6track.c
Expand Up @@ -3400,7 +3400,8 @@ write_f3_wire(void)
}

fprintf(f3,name_format_short,current_element->name);
for(int i=1; i < 9; i++) fprintf(f3,name_format_6, current_element->value[i]);
fprintf(f3, "%d", (int)current_element->value[1]);
for(int i=2; i < 9; i++) fprintf(f3,name_format_6, current_element->value[i]);
fprintf(f3,"\n");
}
current_element = current_element->next;
Expand Down
5 changes: 3 additions & 2 deletions src/twiss.f90
Expand Up @@ -3618,16 +3618,17 @@ SUBROUTINE tmbend(ftrk,fcentre,orbit,fmap,el,dl,ek,re,te,code)
fintx = g_elpar(b_fintx)
sks = g_elpar(b_k1s)
h = an / el
h_k = h
h_k = h * bvk
!---- Apply field errors and change coefficients using DELTAP.
F_ERRORS = zero
n_ferr = node_fd_errors(f_errors)
if (sk0 .ne. 0) then
f_errors(0) = f_errors(0) + sk0*el - g_elpar(b_angle)
h_k = sk0
h_k = sk0 * bvk
endif




!! if (sk0*el .ne. g_elpar(b_angle)) then
!! call element_name(name,len(name))
Expand Down
2 changes: 1 addition & 1 deletion tests/test-cororbit-2/corr.ref
@@ -1 +1 @@
1 0 1.004852e+01 2.636123e+00 9.581877e-01 8.998692e-02 5.343926e+00 2.511470e+00
1 0 1.006046e+01 2.637702e+00 9.588439e-01 9.004260e-02 5.350301e+00 2.513009e+00
14 changes: 7 additions & 7 deletions tests/test-cororbit-2/cx12.tab_1.ref
@@ -1,12 +1,12 @@
@ NAME %05s "CORR1"
@ TYPE %05s "CORR1"
@ TITLE %62s "LHC 6.503 with errors and two beam orbit correction using MADX"
@ ORIGIN %16s "5.05.02 Linux 64"
@ DATE %08s "10/08/20"
@ TIME %08s "13.26.36"
@ ORIGIN %16s "5.06.00 Linux 64"
@ DATE %08s "31/08/20"
@ TIME %08s "16.54.22"
* NAME PX.OLD PY.OLD PX.CORRECTION PY.CORRECTION
$ %s %le %le %le %le
"MCBXH.1R1" 0 0 -1.115668086e-06 0
"MCBXH.1R1" 0 0 -1.115690418e-06 0
"MCBXH.2R1" 0 0 0 0
"MCBXH.3R1" 0 0 0 0
"MCBXH.3L2" 0 0 0 0
Expand All @@ -17,8 +17,8 @@ $ %s %le %le %le
"MCBXH.3R2" 0 0 0 0
"MCBXH.3L5" 0 0 0 0
"MCBXH.2L5" 0 0 0 0
"MCBXH.1L5" 0 0 5.765931795e-07 0
"MCBXH.1R5" 0 0 -1.08438951e-06 0
"MCBXH.1L5" 0 0 5.765825041e-07 0
"MCBXH.1R5" 0 0 -1.084404528e-06 0
"MCBXH.2R5" 0 0 0 0
"MCBXH.3R5" 0 0 0 0
"MCBXH.3L8" 0 0 0 0
Expand All @@ -29,4 +29,4 @@ $ %s %le %le %le
"MCBXH.3R8" 0 0 0 0
"MCBXH.3L1" 0 0 0 0
"MCBXH.2L1" 0 0 0 0
"MCBXH.1L1" 0 0 2.271670499e-06 0
"MCBXH.1L1" 0 0 2.271654094e-06 0
14 changes: 7 additions & 7 deletions tests/test-cororbit-2/cx12.tab_2.ref
@@ -1,12 +1,12 @@
@ NAME %05s "CORR2"
@ TYPE %05s "CORR2"
@ TITLE %62s "LHC 6.503 with errors and two beam orbit correction using MADX"
@ ORIGIN %16s "5.05.02 Linux 64"
@ DATE %08s "10/08/20"
@ TIME %08s "13.26.36"
@ ORIGIN %16s "5.06.00 Linux 64"
@ DATE %08s "31/08/20"
@ TIME %08s "16.54.22"
* NAME PX.OLD PY.OLD PX.CORRECTION PY.CORRECTION
$ %s %le %le %le %le
"MCBXH.1R1" 0 0 -1.115668086e-06 0
"MCBXH.1R1" 0 0 -1.115690418e-06 0
"MCBXH.2R1" 0 0 0 0
"MCBXH.3R1" 0 0 0 0
"MCBXH.3L2" 0 0 0 0
Expand All @@ -17,8 +17,8 @@ $ %s %le %le %le
"MCBXH.3R2" 0 0 0 0
"MCBXH.3L5" 0 0 0 0
"MCBXH.2L5" 0 0 0 0
"MCBXH.1L5" 0 0 5.765931795e-07 0
"MCBXH.1R5" 0 0 -1.08438951e-06 0
"MCBXH.1L5" 0 0 5.765825041e-07 0
"MCBXH.1R5" 0 0 -1.084404528e-06 0
"MCBXH.2R5" 0 0 0 0
"MCBXH.3R5" 0 0 0 0
"MCBXH.3L8" 0 0 0 0
Expand All @@ -29,4 +29,4 @@ $ %s %le %le %le
"MCBXH.3R8" 0 0 0 0
"MCBXH.3L1" 0 0 0 0
"MCBXH.2L1" 0 0 0 0
"MCBXH.1L1" 0 0 2.271670499e-06 0
"MCBXH.1L1" 0 0 2.271654094e-06 0