EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH

MAD-X News


Hans Grote and Frank Schmidt

MAD-X News

This is a loose collection of new features, new sample jobs, and other possibly interesting remarks concerning MAD-X.

Work log between releases madX-4_00_09 and madX-4_00_19

Log report started Thu May 7 20:01:28 2009, ended Thu May 7 20:02:54 2009

elaface
Fixed argument of wrong type passed to the mtlmdl Fortran subroutine
warning fixed
Now the check for OSTYPE works with darwin9.0
frs
1) New TPSA package by lingyun.yang@gmail.com 2) General clean-up
Preliminary fix of memory crash - courtesy JBJ
Some rearrangements by Etienne and final clean-up of PTC
Workaround for a array out-off-bound problem due to LDA=16000 being too small. 1) LDAMAX set to 110'000 & lda_used =100000 2) Program stops when an out-off-bound array access is attempted. 3) Real fix needed to make LDA dynamic
Missing general "public" statements which creates pseudo bugs
More clean-up for the TPSA upgrade
Fortran Clean-up: indenting, remove potentially uninitialized variable and also remove unused variables
Minor clean-up concerning: character strings, possibly uninitialized variables and unused variables
ONLINE needs: libmdblib.a libmdbmth.a librpnlib.a libSDDS1.a libSDDS1c.a libz.a SLC5 needed: libX11.a
MAD-X production version 4.00.19
version madX-4_00_18_dev
Version 4.00.17: add LRAD to kickers
Version 4.00.16
Version 4.00.15
MAD-X version 4.00.14
MAD-X version madX-4_00_12_dev
version madX-4_00_12_dev
version madX-4_00_11_dev
version 4.00.10
version
Add attribute "range_plot" to allow range also for user defined horizontal axis (courtesy HG)
Allowing plotting at markers using the "marker_plot" attribute. Courtesy HG
Add ntpsa flag (if present the new C++ TPSA package by lingyun.yang@gmail.com in invoked) and the symprint flag pronts the symplecticity flag by default.
Remove "harmless" occurrence "dipole_bv" by the more obvious one "other_bv"
remove tabs
Clean-up unused variables
Take out: Unused external reference RESULT_FROM_NORMAL found with latest: NAG Fortran Compiler Release 5.2(668)
Minor clean-up
Get the compiler directives like "ifdef _WIN32_DLL working in F90 files using the Lahey compiler. Special Fujitsi flags for lf95 invoked e.g. lf95 -c -o1 -tp -lfe "-Cpp" -lfe "-D_WIN32_DLL" %FPP%\c_tpsa_interface.F90 -winconsole -ml msvc These compiler flags can be found at: http://www.lahey.com/docs/fujitsu%20compiler%20option%20list.pdf
To wrap up for Windows
Modification for c_tpsa_interface.F90
Added new tpsa package
Fixing the passing of a double array instead of an integer array.
Etienne's clean-up of AF
Fix C/C++ nonstandard features fix pseudo-bug in c_tpsa_interface.F90 found by NAG f95. Integer shall not be defined as an array of dimension 1.
Latest cleanup of Lingyun's TPSA including tpsa.dll needed for Windows
Clean-up
- gfortran broken in gcc4.4 - Therefore back to g95 however the LIBX flags must be fixed according to gcc being used
Fix the exclusion of f90 & F90 files with and without NTPSA
Yet another upgrade for MAC using g95
Clean-up for MAC
Generalization for f90/F90
Compiler preprocessing for c_tpsa_interface to drop DLL for LINUX
Add new tpsa
missing -fno-range-check flag for gfortran in particular for MAC
Back to standard "LF95"
Further adjustments to safeguard running with "gfortran" which can be steered with the new "SLC4" flag.
Fix further gfortran for SLC4
Default compiler oh lxplus: lf95 gfortran with -Wall -pedantic DEBUG flags even for Fortran
gfortran explanation for SLC4
Darwin fixes
no ONLINE as standard
More small fixes: - o4 off for lf95 - proper libraries for ONLINE
Fix gfortran Home link use proper LINK options for MAC
hbu
using semi automatic object file list
Makefile mac compatible
jbj
made more robust the capture of the Twiss data of the drift preceeding the current element - solving the '1st slice wrong n1' supressed the memory crash when aperture called twice with the same offsetlem in tfs format
nougaret
further prevent output mixup through forced flush when crossing the border in the other direction (i.e. Fortran calling C, which is more rare than the reverse)
handle flushing unit 6 on Intel ifort compiler
invoke 'call flush(6)' as 'flush(6)' with Intel compiler
suppress compilation warnings
skowron
Added filling of track summ table for ptc_trackline. Now the user can check what were the final coordinates of tracking
If plugin support: link dynamically; if debug: do not put -O4 optimization; g95 option: add proper debug flags

Work log between releases madX-4_00_09 and madX-4_00_19

Log report started Tue May 5 20:01:26 2009, ended Tue May 5 20:02:49 2009

elaface
Fixed argument of wrong type passed to the mtlmdl Fortran subroutine
warning fixed
Now the check for OSTYPE works with darwin9.0
frs
1) New TPSA package by lingyun.yang@gmail.com 2) General clean-up
Preliminary fix of memory crash - courtesy JBJ
Some rearrangements by Etienne and final clean-up of PTC
GET_C_J routine no longer needed
Missing general "public" statements which creates pseudo bugs
More clean-up for the TPSA upgrade
Fortran Clean-up: indenting, remove potentially uninitialized variable and also remove unused variables
Minor clean-up concerning: character strings, possibly uninitialized variables and unused variables
ONLINE needs: libmdblib.a libmdbmth.a librpnlib.a libSDDS1.a libSDDS1c.a libz.a SLC5 needed: libX11.a
MAD-X production version 4.00.19
version madX-4_00_18_dev
Version 4.00.17: add LRAD to kickers
Version 4.00.16
Version 4.00.15
MAD-X version 4.00.14
MAD-X version madX-4_00_12_dev
version madX-4_00_12_dev
version madX-4_00_11_dev
version 4.00.10
version
Add attribute "range_plot" to allow range also for user defined horizontal axis (courtesy HG)
Allowing plotting at markers using the "marker_plot" attribute. Courtesy HG
Add ntpsa flag (if present the new C++ TPSA package by lingyun.yang@gmail.com in invoked) and the symprint flag pronts the symplecticity flag by default.
Remove "harmless" occurrence "dipole_bv" by the more obvious one "other_bv"
remove tabs
Clean-up unused variables
Take out: Unused external reference RESULT_FROM_NORMAL found with latest: NAG Fortran Compiler Release 5.2(668)
Minor clean-up
Get the compiler directives like "ifdef _WIN32_DLL working in F90 files using the Lahey compiler. Special Fujitsi flags for lf95 invoked e.g. lf95 -c -o1 -tp -lfe "-Cpp" -lfe "-D_WIN32_DLL" %FPP%\c_tpsa_interface.F90 -winconsole -ml msvc These compiler flags can be found at: http://www.lahey.com/docs/fujitsu%20compiler%20option%20list.pdf
To wrap up for Windows
Modification for c_tpsa_interface.F90
Added new tpsa package
Fixing the passing of a double array instead of an integer array.
Etienne's clean-up of AF
Fix C/C++ nonstandard features fix pseudo-bug in c_tpsa_interface.F90 found by NAG f95. Integer shall not be defined as an array of dimension 1.
Latest cleanup of Lingyun's TPSA including tpsa.dll needed for Windows
Clean-up
- gfortran broken in gcc4.4 - Therefore back to g95 however the LIBX flags must be fixed according to gcc being used
Fix the exclusion of f90 & F90 files with and without NTPSA
Yet another upgrade for MAC using g95
Clean-up for MAC
Generalization for f90/F90
Compiler preprocessing for c_tpsa_interface to drop DLL for LINUX
Add new tpsa
missing -fno-range-check flag for gfortran in particular for MAC
Back to standard "LF95"
Further adjustments to safeguard running with "gfortran" which can be steered with the new "SLC4" flag.
Fix further gfortran for SLC4
Default compiler oh lxplus: lf95 gfortran with -Wall -pedantic DEBUG flags even for Fortran
gfortran explanation for SLC4
Darwin fixes
no ONLINE as standard
More small fixes: - o4 off for lf95 - proper libraries for ONLINE
Fix gfortran Home link use proper LINK options for MAC
hbu
using semi automatic object file list
Makefile mac compatible
jbj
made more robust the capture of the Twiss data of the drift preceeding the current element - solving the '1st slice wrong n1' supressed the memory crash when aperture called twice with the same offsetlem in tfs format
nougaret
further prevent output mixup through forced flush when crossing the border in the other direction (i.e. Fortran calling C, which is more rare than the reverse)
handle flushing unit 6 on Intel ifort compiler
invoke 'call flush(6)' as 'flush(6)' with Intel compiler
suppress compilation warnings
skowron
Added filling of track summ table for ptc_trackline. Now the user can check what were the final coordinates of tracking
If plugin support: link dynamically; if debug: do not put -O4 optimization; g95 option: add proper debug flags

Work log between releases madX-4_00_09 and madX-4_00_19

Log report started Mon May 4 20:02:18 2009, ended Mon May 4 20:03:41 2009

elaface
Fixed argument of wrong type passed to the mtlmdl Fortran subroutine
warning fixed
Now the check for OSTYPE works with darwin9.0
frs
1) New TPSA package by lingyun.yang@gmail.com 2) General clean-up
Preliminary fix of memory crash - courtesy JBJ
Some rearrangements by Etienne and final clean-up of PTC
GET_C_J routine no longer needed
Missing general "public" statements which creates pseudo bugs
More clean-up for the TPSA upgrade
Fortran Clean-up: indenting, remove potentially uninitialized variable and also remove unused variables
Minor clean-up concerning: character strings, possibly uninitialized variables and unused variables
ONLINE needs: libmdblib.a libmdbmth.a librpnlib.a libSDDS1.a libSDDS1c.a libz.a SLC5 needed: libX11.a
version madX-4_00_18_dev
Version 4.00.17: add LRAD to kickers
Version 4.00.16
Version 4.00.15
MAD-X version 4.00.14
MAD-X version madX-4_00_12_dev
version madX-4_00_12_dev
version madX-4_00_11_dev
version 4.00.10
version
Add attribute "range_plot" to allow range also for user defined horizontal axis (courtesy HG)
Allowing plotting at markers using the "marker_plot" attribute. Courtesy HG
Add ntpsa flag (if present the new C++ TPSA package by lingyun.yang@gmail.com in invoked) and the symprint flag pronts the symplecticity flag by default.
Remove "harmless" occurrence "dipole_bv" by the more obvious one "other_bv"
remove tabs
Clean-up unused variables
Take out: Unused external reference RESULT_FROM_NORMAL found with latest: NAG Fortran Compiler Release 5.2(668)
Minor clean-up
Get the compiler directives like "ifdef _WIN32_DLL working in F90 files using the Lahey compiler. Special Fujitsi flags for lf95 invoked e.g. lf95 -c -o1 -tp -lfe "-Cpp" -lfe "-D_WIN32_DLL" %FPP%\c_tpsa_interface.F90 -winconsole -ml msvc These compiler flags can be found at: http://www.lahey.com/docs/fujitsu%20compiler%20option%20list.pdf
To wrap up for Windows
Modification for c_tpsa_interface.F90
Added new tpsa package
Fixing the passing of a double array instead of an integer array.
Etienne's clean-up of AF
Fix C/C++ nonstandard features fix pseudo-bug in c_tpsa_interface.F90 found by NAG f95. Integer shall not be defined as an array of dimension 1.
Latest cleanup of Lingyun's TPSA including tpsa.dll needed for Windows
Clean-up
- gfortran broken in gcc4.4 - Therefore back to g95 however the LIBX flags must be fixed according to gcc being used
Fix the exclusion of f90 & F90 files with and without NTPSA
Yet another upgrade for MAC using g95
Clean-up for MAC
Generalization for f90/F90
Compiler preprocessing for c_tpsa_interface to drop DLL for LINUX
Add new tpsa
missing -fno-range-check flag for gfortran in particular for MAC
Back to standard "LF95"
Further adjustments to safeguard running with "gfortran" which can be steered with the new "SLC4" flag.
Fix further gfortran for SLC4
Default compiler oh lxplus: lf95 gfortran with -Wall -pedantic DEBUG flags even for Fortran
gfortran explanation for SLC4
Darwin fixes
no ONLINE as standard
More small fixes: - o4 off for lf95 - proper libraries for ONLINE
Fix gfortran Home link use proper LINK options for MAC
hbu
using semi automatic object file list
Makefile mac compatible
jbj
made more robust the capture of the Twiss data of the drift preceeding the current element - solving the '1st slice wrong n1' supressed the memory crash when aperture called twice with the same offsetlem in tfs format
nougaret
further prevent output mixup through forced flush when crossing the border in the other direction (i.e. Fortran calling C, which is more rare than the reverse)
handle flushing unit 6 on Intel ifort compiler
invoke 'call flush(6)' as 'flush(6)' with Intel compiler
suppress compilation warnings
skowron
Added filling of track summ table for ptc_trackline. Now the user can check what were the final coordinates of tracking
If plugin support: link dynamically; if debug: do not put -O4 optimization; g95 option: add proper debug flags

Work log between releases madX-4_00_07 and madX-4_00_09

Log report started Fri Mar 27 20:02:08 2009, ended Fri Mar 27 20:03:03 2009

frs
New files needed for MAD-X Version 4
Clean-up
Version 4.00.09
version 4.00.08
No lonfer needed for MAD-X Version 4
Clean wipes out fortran wrapper stuff
New Makefiles for Linux/Mac & Windows include all previous features

Work log between releases madX-4_00_00 and madX-4_00_07

Log report started Wed Mar 18 20:02:11 2009, ended Wed Mar 18 20:03:12 2009

frs
total_da_size set to very large (courtesy Piotr & Etienne)
madX-4_00_07_dev & first candidate for the production version
madX-4_00_06_dev
Fix of the faulty REPLACE command (coutesy HG)
madX-4_00_05_dev
madX-4_00_04_dev
Fix of the memory crash due to the USE command in a while loop (found by EB - fixed courtesy HG)
MAD-X vesrion: 4.00.02
Version 4.00.01; fixing the crash due to conflict with markers (courtesy HG)
Return NULL; needed to continue if the "no_fatal_stop" flag enforces program continuation
Harmon no longer ignored (courtesy HG)
Fix lethal bug in DELETE command (courtesy HG)
suppress forbidden TAB character
reorganize twbtin more logically
The chromatic functions wx, phix, wy, phiy could not be initialized properly for lines.
simplifying length fix
proper fix of doubling of the length of the machine with chrom & centre
suppress double length in summ table for chrom & currpos option
preparation for SLC5 in 32 & 64 bits
nougaret
Compute derivatives of the dispersion w.r.t. deltap
to scale from 32 to 64 bits platforms, obtain pointers size with sizeof(uintptr_t)
one-turn parameters such as the tune should now depend on deltap
merged Frank and Piotr's modifications
skowron
Removed one line from generated ROOT macros for plotting since the ROOT command disapeared in the new versions
protection against seg fault in case the command is executed before ptc_create_universe
Bug in knobs corrected
Twiss table was extended, definitions for new new columns were added in ptc_madx_knobs.inc, but the code was not modified apropriately and uninitialized univ. taylors were left in the results array
Swapped putusertable with puttwisstable so we values from the user table are copied properly to the twiss table if requested. See ptc_secordmatch example in the testsuite.
With modern versions of ROOT libraries were splitted to more files. Updated the code to lead all that are needed in ROOT version 2.21
yisun
Remove two useless messages.
zwe
use beam_bv flag to change sign for beam two in simultaneous orbit correction
Modifications to adapt to beam1/beam2 conventions for two beam orbit correction.
Resolve problem with RESOUT option

Work log between releases madX-3_04_72 and madX-4_00_00

Log report started Mon Feb 16 07:02:11 2009, ended Mon Feb 16 07:03:06 2009

frs
readtable stops with fatal_error when file with table does not exist (courtesy HG)
production version: madX-4_00_00
version: madX-3_04_77
Version: madX-3_04_76_dev
version: madX-3_04_75_dev
Fix the matching problem and the faulty set-up of the twiss_chrom flag (courtesy HG)
Intermediate version with improvement concerning chromaticity including coupling. More work concerning a hiccup in the matching of the LHC still under way. (courtesy HG)
Initializing q1_val_p & q2_val_p clean-up to avoid compiler warning
Solenoid becomes a marker if the integrated strength is zero otherwise a fake very short is used.
Take out doogy format for strlen - trivial clean-up
The flag chrom can now be set on demand. (coutesy HG)
Fixing small bug concerning undefined deltap. (courtesy YS)
hbu
keep new parameter mech_sep in slicing
jbj
/* BJ 13.02.2009. - added check |x-e| < dist_limit - removed useless calculations of sqrt - made consistent use of dist_limit and min_double */ /* BJ 13.02.2009 check if point x = (xm,ym) is in the segment [s,e] with s = (startx,starty) and e = (endx,endy) by computing cosfi = (x-s).(x-e) / |x-s||x-e|. cosfi = -1 : x is in first check if |x-s| and |x-e| are not too small.If yes for one of them : in if OK , the zero divide check must be superfluous. But keep it anyway. */

Work log between releases madX-3_04_68 and madX-3_04_72

Log report started Sun Feb 8 07:01:42 2009, ended Sun Feb 8 07:03:01 2009

frs
1) fix lethal error (no consequence for LHC) 2) Put back "etall" into DA vector headers (both courtesy EF)
Fixing the Twiss chromaticity problem in presence of coupling by runnining Twiss twice with different deltap (which is set to 1e-9) and calculate it numerically. Good workaround! (courtesy HG)
MAD-X version: madX-3_04_71_dev
MAD-X version: madX-3_04_70_dev
Version: madX-3_04_69_dev
chrom also for matching
Drop individual BV flag, requested by Thys.
More changes to ensure the "chrom" option to be always on (courtesy HG)
Throw a warning if EXTRACT is using unknown markers! (courtesy HG)
Clean up a pseudo-bug concerning "AF never dereferenced" claimed by the NAG compiler (courtesy EF)
Skip double allocation detected by G95
Fixing an inconsistent "TARGET" declaration found by NAG. (courtesy EF)
Putting back incorrect chromaticity calculation
1) Fix proper disp & ddisp definition for ring with respect to lines 2) Suppress chromaticity calculation in case of coupling since it is plain wrong.

First MAD-X LHC commissioning version 3.04: 09.07.2007

1) Allowing reading and writing of SDDS data sets for
communication with the LHC control system.
2) A large amount of medium size and smaller code changes
and bug fixes.
3) Full blown development for CLIC purposes.
4) New Jacobian matching method.
5) Non-linear and parametric matching.

All changes for each file:

============================================================================= MAD-X proper ------------ C Files: -------- - minor C inconsistencies and some clean-up - Uninitiatized variables aperture.c - moved aperture code from madxn.c to new file aperture.c - corrections: - more apex in halo polygon - corrected the construction of rectellipse in the general case - secured potentially dangerous division by zero c6t.c - The brute force quick and dirty fix of frs has been reverted for a proper fixing at the source of the problem, IE assigning different names for different multipoles. It has been shown that SixTrack gives identical results for the "brute force" and the "proper solution". Courtesy Hans Grote (honorable ABP group member) - Fixing the problem of using the same name for very different multipoles. This is a quick fix and a more rigorous solution is needed. - R(E)COLLIMATORs were treated as thick elements in the single element list but later treated as thin elements leading to skrewed up linear optics in SixTrack. They are kept as distinct elements and are not joined with surrounding drifts. gxx11c.c, gxx11psc.c - Fix the month number in the ps files madxc.c - Added commands to allow reading of external orbit files - Correct read_my_table for long data elements madxe.c - compiler warnings removed - Changed default behaviour of ADD option madxn.c, madxp.c, madxu.c - moved aperture code from madxn.c to new file aperture.c corrections: - more apex in halo polygon - corrected the construction of rectellipse in the general case - secured potentially dangerous division by zero - Avoid divisions by zero in the aperture module. - minor C inconsistencies and some clean-up - mad-X_3_66 bugs found by EK - Array overflow reported from valgrind removed - Special non-existing End marker has been dropped. courtesy HG - mpar made compiling, three functions moved from matchc2.c to madxu.c - current in table_list initialized to 0 - add warning when use_macro option is used with too many variables - Introducing aptol_(1,2,3) "rtol", "xtol", "ytol" to be available in MAD-X input and e.g. to be added to a TWISS table. Courtesy H.G. Now table2(x,y) or stable(a,b,c) or things like that will not be modified. - First step for node layout tracking in ptc_trackline - fix a bug when you use a macro which define another macro for matching - madX-3_03_48: "Final" fix of the TILT saga! Tilt is calculated exclusively in twiss.F following the strategy: 0) These changes concern quad, sext, oct, elec separator; but NOT dipole or multipole 1) TILT input is the external tilt (+k ==> +ks for tilt < 0) 2) k & ks represent an internal tilt 3) at each element the total tilt & sqrt(k**2 + ks**2) is calculated including field errors, i.e. the correct way which might cause differences with MAD8 4) PTC has been adjusted appropriate 5) Possible effects on "survey" and "emit" will be tested 6) Many Thanks for HG for his help! - Bug corrected, replaced abs with fabs - Updated match with knobs - Constraints for ranges with match,use_macro; implemented - Debugging a) madxp: Wrong sign of TILT when calculated from k & KS b) madx_ptc_module: Total rewrite of TILT stuff! - tilt clean-up coutesy HG - Moments calculation fully imlemented; map buffering in ptc_twiss - New ptc_twiss, so A_ is tracked. This makes possible tracking of moments (to be completed). - Introducing aptol_(1,2,3) "rtol", "xtol", "ytol" to be available in MAD-X input and e.g. to be added to a TWISS table. Courtesy H.G. - Adding gino command following madx_ptc_script_module Problems: 1) pt not displayed in table. 2) deltap not in ptc_twiss header unless a twiss command was done before ptc_twiss! Solution: 1) Set up y properly 2) Put "deltap" into header of the ptc_twiss table permanently - Fix routine readrematrix by exchanging x(5) and x(6) - Fixing the plot crash: the header is not read if it does not exist (courtesy HG). - 1) Stefan Sorge new module keeper!!!! 2) Second order detuning with proper "hor" and "ver" names. In fact, vertical terms were missing. - 1) Bad memory bug found by RdM. Piotr found using valgrind the solution: in mymalloc("read_table", strlen(aux_buff->c)+1) the "+1" is essential because the character string has a "\0" at the end. 2) In plot there is still the crash when reading the header - temporary solution applied. - Fix the headvalue routine which stumbled over a blank line. (courtesy HG) - First step for node layout tracking in ptc_trackline - Adding a C routine to read headers of TFS tables (courtesy HG) - Taking deltap from table header both for TWISS and ptc_twiss (but NOT in case of a SUMM table!) and place on the plot. - Move the set_variable routine from madxn.c to madxu.c. Needed to compile mpars. - new setvar command; fixed readtable bug - Removed redundant debug printout - Exact name matching implemented, now passing name with :x - VORNAME assigned, the same as name of node in MADX but with capital letters - Updated match with knobs - Constraints for ranges with match,use_macro; implemented - Adding "e1", "e2", "h1", "h2", "hgap", "fint", "fintx" to the twiss table - Removed charge setting to the my_ring layout to make ptc_twiss running, redundant printouts removed - Moments calculation fully imlemented; map buffering in ptc_twiss - Few bugs corrected (f.g. map initialized to nd2 instead of npara when initial twiss provided). Moments seem to work (to be tested yet) - New ptc_twiss, so A_ is tracked. This makes possible tracking of moments (to be completed). -Not enough memory for buffers ==> FODO: LINE=(36*(CELL)); failed when cell was a line itself - clean-up of gino - Adding gino command following madx_ptc_script_module - PTC knobs (pol_blocks) almost completely interfaced to MAD-X. User sets a knob with ptc_knob command. Twiss parameters and user specified (with ptc_select) map components are buffered in memory after every element in form of taylor series. The problem with table (and tabstring) replacement was correctly stated, only in this case did simple string replacement take place (bad implememtation, my mistake). It has been corrected, the files concerned are madxd.h, madxp.c, and madxu.h in ~hansg/public/tmp Now table2(x,y) or stable(a,b,c) or things like that will not be modified. - In new_command_parameter_list pointer array of parameters initized with NULLs - Write only long in TFS tables - "string function" tabstring count start at 1 courtesy Hans Grote - Now alos ptc_normal accepted in matching with ptcknobs; bug corrections - Implemented: 1. ptc_setfieldcomp that set any order field strengh to requested value. It enables matching of higher order field components. 2. Special matching mode use_ptcknob. It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner. For further details see the comments at the top of matchptcknobs.c file. 3. Minor corrections and protections against segmentation vilation. - Implemented: - Problem: [1] Macro names and clashes with internal names ! OK mycrap(xx,yy,zz): macro = {ingvar = table(xx,yy,zz);}; somenamesarelong(xx,yy,zz): macro = {ingvar = table(xx,yy,zz);}; ! not OK table2(xx,yy,zz): macro = {ingvar = table(xx,yy,zz);}; redtableclothing(xx,yy,zz): macro = {ingvar = table(xx,yy,zz);}; readtable, file="/afs/cern.ch/user/h/hagen/public/MAD/ALL-emfq-0001.tfs"; Solution:courtesy Hans Grote - PTC knobs (pol_blocks) almost completely interfaced to MAD-X. User sets a knob with ptc_knob command. Twiss parameters and user specified (with ptc_select) map components are buffered in memory after every element in form of taylor series. They can be dumped to text file in two formats with ptc_printparametric command. They can be also visualized and further studied with rviewer from rplot plugin. Further, user can set numeric values of knobs with ptc_setknobvalue what updates all numeric values of the parameters in the tables. This way knobs can be used in matching. - New tracking feature by Andres Gomez Alonso: Using flag "recloss" in the tracking command creates a table called "trackloss", which keeps a record of lost particles. It can be saved using the "write, table= trackloss" command. - Changes for SDDS and online model - knobs implemented with PTC with pol_blocks; command to dump parametric results to file or stdout; content of ptc_madx_tablepush.f90 moved to ptc_madx_knobs.f90, the former one removed - Correct bug in read_table: can read long integers now - Sceleton for knobs and arbitrary element placement implemented. Lattice visualization via ROOT macro. Printing detailed lattice geometry in PTC. Several small bug corrections and some code cosmetics. - Sodd table names usinf small letters only - closing unit 34 to allow multiple SODD runs - changing table entries to more logical names - print out clean up - Proper initialization of pointers to NULL's, added function for deleting command_list structures - "string function" tabstring count start at 1 courtesy Hans Grote - New function "exist" courtesy Hans Grote - Add a ';' to the error message for a not found variable in the 'show' command - Error flag implemented that signals that error code occured - If a user table is used by ptc_select then org_cols=num_cols. Otherwise all values are overwritten by add_vars_to_table function. - PTC_Enforce6D implemented madxsdds.c - Add SDDS module makethin.c - Fixing TILT in multipole kick and make TILT proper in thick octupole. Courtesy HG - Changing the conflicting "ksl" for the integrated solenoid strength to "ksi". This name is reserved for the vector of the integrated skew multipoles "ksl={};". Thick solenoid can now have normal "knl" and skew "ksl" multipole errors in PTC, ignored in madx proper. Thin solenoids are presently not considered in PTC. matchc.c, matchc2.c - knobs: better definition - knobs file defines with ":=" - Experimental knob file generation - fix a bug when you use a macro which define another macro for matching - Comment corrected - Syntax error at 405: code lines must come after declarations at least for Windows "CL". - Printouts redirected to prt_file - mpar made compiling, three functions moved from matchc2.c to madxu.c - Updated match with knobs - Constraints for ranges with match,use_macro; implemented - fix compilation warnings - add warning when use_macro option is used with too many variables - New jacobian routine with svd. Option COND added for controlling the SVD. Increased number of constraints - Corrected bug in match use_macro in match2_evaluate_exressions - change in the print out of match summary when USE_MACRO - Redundant printf removed - Implemented: 1. ptc_setfieldcomp that set any order field strengh to requested value. It enables matching of higher order field components. 2. Special matching mode use_ptcknob. It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner. For further details see the comments at the top of matchptcknobs.c file. 3. Minor corrections and protections against segmentation vilation. - Error flag is monitored in mtcond so if an error occured during macro execution it is handled appropriately. matchptcknobs.c - Functions defined elsewhere should be defined with extern so linker does not complain about multiple definitions - Algorithm made more stable - Typo corrected - introduced correct treatment of magnet families - Protection against deletion of NULL pointer added - Parametric matching of initial conditions works now, final tests and debugging to be done - Updated match with knobs - New ptc_twiss, so A_ is tracked. This makes possible tracking of moments (to be completed). - Corrected bug in match use_macro in match2_evaluate_exressions - Now alos ptc_normal accepted in matching with ptcknobs; bug corrections - Implemented: 1. ptc_setfieldcomp that set any order field strengh to requested value. It enables matching of higher order field components. 2. Special matching mode use_ptcknob. It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner. For further details see the comments at the top of matchptcknobs.c file. 3. Minor corrections and protections against segmentation vilation. rplot.c - On some systems it is needed to load manually all needed ROOT libraries - Bug correction - Now alos ptc_normal accepted in matching with ptcknobs; bug corrections - Code cosmetics - Turn number added in rplot - rviewer plugin intefaced; from now on rplot is a plugin instead of compiled in optional code - Sever bug in knobs corrected: attempt to delete not properly assocoated taylors in case no knobs are set by the user C Header Files: --------------- madx.h - Add parameter (units) for orbit correction - Added: Enumeration type for matching mode; protection against multiple inclusion. madxl.h - Definitions for tables used by Slice Tracking with PTC - Momentum compaction "alfa" included into TWISS table for matching. - Add "polarity" parameter to the twiss table - Updated match with knobs - Adding "e1", "e2", "h1", "h2", "hgap", "fint", "fintx" to the twiss table - Suppressing "imax" in favor of "calib" - request by Thys Risselada - Adding node value "kmax" (maximum K value) and "imax" (maximum Current value) - New tracking feature by Andres Gomez Alonso: Using flag "recloss" in the tracking command creates a table called "trackloss", which keeps a record of lost particles. It can be saved using the "write, table= trackloss" command. - Added madX data types , mainly used in SDDS module - New function "exist" courtesy Hans Grote - Sodd table names usinf small letters only - closing unit 34 to allow multiple SODD runs - changing table entries to more logical names - print out clean up madxdict.h - Experimental knob file generation - Added option that tells to free memory at the end of the program execution. Option for ptc_trackline added that switches on/off track parameters storage in memory for every slice - Fix traditional matching of alfa - First step for node layout tracking in ptc_trackline - Added ptc names of twiss functions to constraint, hence one can set constraint in a range - new setvar command; fixed readtable bug - Add "polarity" parameter to the twiss table - Clean-up - wrap.f90 - Fixing the crash for sbend + exact + multipoles larger than 10. This set-up requires to solve Maxwell's equation up to SECTOR_NMUL_MAX. The default is set to 10 to avoid excessive computing time. This is now safeguarded in madxp. To this end the parameters SECTOR_NMUL and SECTOR_NMUL_MAX are transfered from "ptc_create_layout" to "ptc_create_universe" such that these global parameters can be set early enough. Internally in PTC the parameter "lda_used" is incremented where needed from 1500 to 3000 and set back. Moreover Etienne has done the following modifications to make this possible: "The modification I made in the new PTC I sent you are as follows: You first select SECTOR_NMUL and SECTOR_NMUL_MAX. For all multipole <= SECTOR_NMUL then maxwell's is solved to order SECTOR_NMUL_MAX. For multipole above SECTOR_NMUL , they are treated a la Sixtrack. So for example, it you have errors to order 20, you may bother with maxwells only to order nmul=4 and nmul_max=10 as far as Maxwell's is concerned. Multipole higher will be sixtrack multipoles. - Updated match with knobs -fix bug for select_ptc_normal - Added commands to allow reading external orbit files - Moments calculation fully imlemented; map buffering in ptc_twiss - Few bugs corrected (f.g. map initialized to nd2 instead of npara when initial twiss provided). Moments seem to work (to be tested yet) - New ptc_twiss, so A_ is tracked. This makes possible tracking of moments (to be completed). - New jacobian routine with svd. Option COND added for controlling the SVD. Increased number of constraints - Adding gino command following madx_ptc_script_module - Suppressing "imax" in favor of "calib" - request by Thys Risselada - Adding node value "kmax" (maximum K value) and "imax" (maximum Current value) - drop useless lcavity since ywcavity has same mad-8 element code - Implemented: 1. ptc_setfieldcomp that set any order field strengh to requested value. It enables matching of higher order field components. 2. Special matching mode use_ptcknob. It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner. For further details see the comments at the top of matchptcknobs.c file. 3. Minor corrections and protections against segmentation vilation. - PTC knobs (pol_blocks) almost completely interfaced to MAD-X. User sets a knob with ptc_knob command. Twiss parameters and user specified (with ptc_select) map components are buffered in memory after every element in form of taylor series. They can be dumped to text file in two formats with ptc_printparametric command. They can be also visualized and further studied with rviewer from rplot plugin. Further, user can set numeric values of knobs with ptc_setknobvalue what updates all numeric values of the parameters in the tables. This way knobs can be used in matching. - New tracking feature by Andres Gomez Alonso: Using flag "recloss" in the tracking command creates a table called "trackloss", which keeps a record of lost particles. It can be saved using the "write, table= trackloss" command. - change in beambeam command: usage of scattering beam with different radial shapes is possible: parameters: bbshape: 1 (default) Gaussian, standard as before 2 flattop (or trapezoidal) 3 hollow-parabolic width: for bbshape=2: fractional width of edge region for bbshape=3: fractional width of the parabolic part - knobs implemented with PTC with pol_blocks; command to dump parametric results to file or stdout; content of ptc_madx_tablepush.f90 moved to ptc_madx_knobs.f90, the former one removed - Comment removed - Element placement options added - Commands for SDDS read and write - Sceleton for knobs and arbitrary element placement implemented. Lattice visualization via ROOT macro. Printing detailed lattice geometry in PTC. Several small bug corrections and some code cosmetics. - Introducing TRUERBEND and WEDGRBEND in PTC. To this end 2 flags have been introduced in the NAD-X dictionary madxdict.h: 1) ptcrbend: if true it uses a PTC type RBEND 2) truerbend: if true it uses TRUERBEND; if false it uses WEDGRBEND - Option for ptc_trackline position given in global coordinate system added. - Changing the conflicting "ksl" for the integrated solenoid strength to "ksi". This name is reserved for the vector of the integrated skew multipoles "ksl={};". Thick solenoid can now have normal "knl" and skew "ksl" multipole errors in PTC, ignored in madx proper. Thin solenoids are presently not considered in PTC. - PTC_Enforce6D implemented - defaultlevel default has been 0 now 1 as planned originally matchptcknobs.h - Updated match with knobs - Now alos ptc_normal accepted in matching with ptcknobs; bug corrections - Implemented: 1. ptc_setfieldcomp that set any order field strengh to requested value. It enables matching of higher order field components. 2. Special matching mode use_ptcknob. It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner. For further details see the comments at the top of matchptcknobs.c file. 3. Minor corrections and protections against segmentation vilation. rplot.h - Code cosmetics - Turn number added in rplot - rviewer plugin intefaced; from now on rplot is a plugin instead of compiled in optional code - Sever bug in knobs corrected: attempt to delete not properly assocoated taylors in case no knobs are set by the user sdds.h - New files for MAD-X On-Line Modeling Version FORTRAN Files: -------------- Changes: -------- emit.F and all Fortran Files - Clean-up of unused variables - Fortran Clean-Up match.F - tentative new output for matching var matchjc.F - better ending jacobian - Penalty function printed with twise larger precision - New jacobian routine with svd. Option COND added for controlling the SVD. Increased number of constraints - change in calls behavior for JACOBIAN matchlib.F 1) Just the routines needed ==> 5 times smaller: 33% ==> 10% 2) Fortran90 Clean-up - Changes needed to compile routine dlamc1 without optimization in extra file matchlib2.F. Otherwise madx gets stuck in matching procedures. In all Linux Makefiles matchlib2.F is compiled when using g77. For the Fortran90 compilers lf95, g95, f95(NAG) and gfortran an optimized routine is used as provided by Andy Vaught, the "g95" maintainer. For Windows the special compile flag: -lfe "-D_G95" was needed (special undocumented Fujitsu compile flag of the Lahey lf95) to compile this special Fortran90 version of dlamc1. - Replacing the DLAMC1 by an improved Fortran90 one as proposed by Andy Vaught - remove Makefile_nag offending code - New jacobian routine with svd. Option COND added for controlling the SVD. Increased number of constraints matchlib2.F - Needed to compile routine dlamc1 without optimization. Otherwise madx gets stuck in matching procedures. orbf.F - no blanks between & position 6 and the start of the code. plot.F - Add energy label "E" in routine "pegetn", I.E. 69th item of svanno(69)=E - Safeguard uncontrolled access to unsupported labels like Energy - Fixing the plot crash: the header is not read if it does not exist (courtesy HG). - 1) Bad memory bug found by RdM. Piotr found using valgrind the solution: in mymalloc("read_table", strlen(aux_buff->c)+1) the "+1" is essential because the character string has a "\0" at the end. 2) In plot there is still the crash when reading the header - temporary solution applied. - Fix the headvalue routine which stumbled over a blank line. (courtesy HG) - Preliminary fix of the crash when the aperture table is used - Adding a C routine to read headers of TFS tables (courtesy HG) - Taking deltap from table header both for TWISS and ptc_twiss (but NOT in case of a SUMM table!) and place on the plot. - Blanking out buffer if ptc_flag = true - deltap plot entry taken from PTC plots ptc_dummy.F - First step for node layout tracking in ptc_trackline - Missing dummy definitions added - Moments calculation fully imlemented; map buffering in ptc_twiss - New ptc_twiss, so A_ is tracked. This makes possible tracking of moments (to be completed). - Adding gino command following madx_ptc_script_module - Implemented: 1. ptc_setfieldcomp that set any order field strengh to requested value. It enables matching of higher order field components. 2. Special matching mode use_ptcknob. It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner. For further details see the comments at the top of matchptcknobs.c file. 3. Minor corrections and protections against segmentation vilation. - PTC knobs (pol_blocks) almost completely interfaced to MAD-X. User sets a knob with ptc_knob command. Twiss parameters and user specified (with ptc_select) map components are buffered in memory after every element in form of taylor series. They can be dumped to text file in two formats with ptc_printparametric command. They can be also visualized and further studied with rviewer from rplot plugin. Further, user can set numeric values of knobs with ptc_setknobvalue what updates all numeric values of the parameters in the tables. This way knobs can be used in matching. - knobs implemented with PTC with pol_blocks; command to dump parametric results to file or stdout; content of ptc_madx_tablepush.f90 moved to ptc_madx_knobs.f90, the former one removed - Sceleton for knobs and arbitrary element placement implemented. Lattice visualization via ROOT macro. Printing detailed lattice geometry in PTC. Several small bug corrections and some code cosmetics. - PTC_Enforce6D implemented sodd.F - Suppression of excessive printing (courtesy SS) - 1) Stefan Sorge new module keeper!!!! 2) Second order detuning with proper "hor" and "ver" names. In fact, vertical terms were missing. - Close unit 34 even on error output - Sodd table names usinf small letters only - closing unit 34 to allow multiple SODD runs - changing table entries to more logical names - print out clean up trrun.F - The argument "el" was removed from argument list of subroutine tmarb called here (line 532 in trrun.F), because it did not coincide with the argument list of the real subroutine tmarb in twiss.F. - Bug found by Stefan Sorge in trrun/trinicmd: Variables 'bet0' and 'bet0i' were undefined, leading to erronous results. Corrected. - Fixing: Unwanted changes commented. - The aperture of the collimators was checked before undergoing the (possible) rotation at the entry of the element. Corrected now: If collimator has a roll angle ('tilt'), coordinates are transformed to the rotated local coordinate system and only after that apertures are checked. - Add BV flag to the solenoids - Some unnecessary changes taken out again by Andres Gomez Alonso. - Inconsistent variable declarations of z0 encountered by Piotr when using make -f Makefile_nag. Fixed. - New tracking feature by Andres Gomez Alonso: Using flag "recloss" in the tracking command creates a table called "trackloss", which keeps a record of lost particles. It can be saved using the "write, table= trackloss" command. - safeguard faulty input - change in beambeam command: usage of scattering beam with different radial shapes is possible: parameters: bbshape: 1 (default) Gaussian, standard as before 2 flattop (or trapezoidal) 3 hollow-parabolic width: for bbshape=2: fractional width of edge region for bbshape=3: fractional width of the parabolic part - Changing the conflicting "ksl" for the integrated solenoid strength to "ksi". This name is reserved for the vector of the integrated skew multipoles "ksl={};". Thick solenoid can now have normal "knl" and skew "ksl" multipole errors in PTC, ignored in madx proper. Thin solenoids are presently not considered in PTC. twiss.F - Closed orbit implemented in the maps for the beambeam element with flattop and hollow parabolic radial density profile, i.e. in the subtoutines tmbb_flattop and tmbb_hollowparabolic in twiss.F - Momentum compaction "alfa" included into TWISS table for matching. - Add "polarity" parameter to the twiss table - madX-3_03_48: "Final" fix of the TILT saga! Tilt is calculated exclusively in twiss.F following the strategy: 0) These changes concern quad, sext, oct, elec separator; but NOT dipole or multipole 1) TILT input is the external tilt (+k ==> +ks for tilt < 0) 2) k & ks represent an internal tilt 3) at each element the total tilt & sqrt(k**2 + ks**2) is calculated including field errors, i.e. the correct way which might cause differences with MAD8 4) PTC has been adjusted appropriate 5) Possible effects on "survey" and "emit" will be tested 6) Many Thanks for HG for his help! - safeguard atan2 against both arguments equal to zero - Fixing TILT in multipole kick and make TILT proper in thick octupole. Courtesy HG - tilt clean-up coutesy HG - Suppressing "imax" in favor of "calib" - request by Thys Risselada - Adding node value "kmax" (maximum K value) and "imax" (maximum Current value) - Add BV flag to the solenoids - Correction of an error occurring in subroutine tmbb_flattop for ftrk=.false. - safeguard faulty input - change in beambeam command: usage of scattering beam with different radial shapes is possible: parameters: bbshape: 1 (default) Gaussian, standard as before 2 flattop (or trapezoidal) 3 hollow-parabolic width: for bbshape=2: fractional width of edge region for bbshape=3: fractional width of the parabolic part - Changing the conflicting "ksl" for the integrated solenoid strength to "ksi". This name is reserved for the vector of the integrated skew multipoles "ksl={};". Thick solenoid can now have normal "knl" and skew "ksl" multipole errors in PTC, ignored in madx proper. Thin solenoids are presently not considered in PTC. user2_photon.f90 - unnused dummy variable DMASS in subr. photon is removed util.F - Added seterrorflag routine that sets the error flag in c part if an error occured. FORTRAN Include Files: ---------------------- plot.fi,touschek.fi, twiss0.fi, twissc.fi, win32calls.fi - Clean-up of fi files - Momentum compaction "alfa" included into TWISS table for matching. - Add "polarity" parameter to the twiss table - Adding node value "kmax" (maximum K value) and "imax" (maximum Current value) ============================================================================= PTC MODULES ----------- Changes: -------- - Throw out unused variables - Cleaned code so NAG warnings are minimized now: mainly unused variables - Fortran Clean-Up madx_ptc_distrib.inc - New ptc_twiss, so A_ is tracked. This makes possible tracking of moments (to be completed). madx_ptc_knobs.inc - Bug Corrected: Parametric twiss results where not scaled with energy - Moments calculation fully imlemented; map buffering in ptc_twiss - New ptc_twiss, so A_ is tracked. This makes possible tracking of moments (to be completed). - Implemented: 1. ptc_setfieldcomp that set any order field strengh to requested value. It enables matching of higher order field components. 2. Special matching mode use_ptcknob. It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner. For further details see the comments at the top of matchptcknobs.c file. 3. Minor corrections and protections against segmentation vilation. - knobs implemented with PTC with pol_blocks; command to dump parametric results to file or stdout; content of ptc_madx_tablepush.f90 moved to ptc_madx_knobs.f90, the former one removed madx_ptc_distrib.f90 - Moving from DAmap to Gmap - Fortran Clean-Up - Moments updated, initialization for 5D in twiss, moments not available in 5D due to a bug and few others - Removed charge setting to the my_ring layout to make ptc_twiss running, redundant printouts removed - Moments calculation fully imlemented; map buffering in ptc_twiss - Few bugs corrected (f.g. map initialized to nd2 instead of npara when initial twiss provided). Moments seem to work (to be tested yet) - New ptc_twiss, so A_ is tracked. This makes possible tracking of moments (to be completed). madx_ptc_eplacement.f90 - Root display support for new elements - serious memory leak removed - Added sextupoles, octupoles and not powered elements - Corrected RBEND drawing - Set of kinds added to drawing in root - In root macro generation: added protection against inclusion of headers in interpreted mode; automatical switch to white background; redundant debug printout removed. - Added header lines to ROOT macro that display layout geometry. This makes possible to compile a macro, what is a must in the case of lengthy machines. - Removed redundant debug printout - 2 interface routines added needeed by rplot - Bugs with rotations corrected - element placement works since now madx_ptc_intstate.f90 - New ptc_twiss, so A_ is tracked. This makes possible tracking of moments (to be completed). - add (lp) to logical function; indenting - Enforce 6d implemented - PTC_Enforce6D implemented - defaultlevel default has been 0 now 1 as planned originally madx_ptc_knobs.f90 - Bug Corrected: Parametric twiss results where not scaled with energy - Exact name matching implemented, now passing name with :x - Knobs for Initial parameters - New ptc_twiss, so A_ is tracked. This makes possible tracking of moments (to be completed). - PTC first changes stay October 2006 thinlens, cutting - Updated to the new nomenclature (beta12->beta22,...) - Bug corrected in the treatment of 4D and 5D cases; cosmetics; - Universal taylor nullified at the initialization level - Implemented: 1. ptc_setfieldcomp that set any order field strengh to requested value. It enables matching of higher order field components. 2. Special matching mode use_ptcknob. It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner. For further details see the comments at the top of matchptcknobs.c file. 3. Minor corrections and protections against segmentation vilation. - Do not print to file trailing blanks in the buffer - PTC knobs (pol_blocks) almost completely interfaced to MAD-X. User sets a knob with ptc_knob command. Twiss parameters and user specified (with ptc_select) map components are buffered in memory after every element in form of taylor series. They can be dumped to text file in two formats with ptc_printparametric command. They can be also visualized and further studied with rviewer from rplot plugin. Further, user can set numeric values of knobs with ptc_setknobvalue what updates all numeric values of the parameters in the tables. This way knobs can be used in matching. -Severe bug in knobs corrected: attempt to delete not properly assocoated taylors in case no knobs are set by the user - knobs implemented with PTC with pol_blocks; command to dump parametric results to file or stdout; content of ptc_madx_tablepush.f90 moved to ptc_madx_knobs.f90, the former one removed - Debug info printed only at appropriate debuglevel - Sceleton for knobs and arbitrary element placement implemented. Lattice visualization via ROOT macro. Printing detailed lattice geometry in PTC. Several small bug corrections and some code cosmetics. madx_ptc_module.f90 - RF cavity treated as TW cavity now - 1) madx_ptc_module without the ptc_normal stuff 2) fixing the "savemaps" bug - Fix to restricted print out format - 1) Se_status: preliminary fix of uninitialized variable RADIATION_NEW 2) madx_ptc_module: Fix of "ptc_normal" by fixing the string comparison 3) madx_ptc_module & madx_ptc_twiss: write & read traditional DA map format - PTC version including spin - madX-3_03_48: "Final" fix of the TILT saga! Tilt is calculated exclusively in twiss.F following the strategy: 0) These changes concern quad, sext, oct, elec separator; but NOT dipole or multipole 1) TILT input is the external tilt (+k ==> +ks for tilt < 0) 2) k & ks represent an internal tilt 3) at each element the total tilt & sqrt(k**2 + ks**2) is calculated including field errors, i.e. the correct way which might cause differences with MAD8 4) PTC has been adjusted appropriate 5) Possible effects on "survey" and "emit" will be tested 6) Many Thanks for HG for his help! - Redundant debug info available only in high level debug mode - VORNAME assigned, the same as name of node in MADX but with capital letters - Too long line split into 3 lines - useless print statements - Fixing the crash for sbend + exact + multipoles larger than 10. This set-up requires to solve Maxwell's equation up to SECTOR_NMUL_MAX. The default is set to 10 to avoid excessive computing time. This is now safeguarded in madxp. To this end the parameters SECTOR_NMUL and SECTOR_NMUL_MAX are transfered from "ptc_create_layout" to "ptc_create_universe" such that these global parameters can be set early enough. Internally in PTC the parameter "lda_used" is incremented where needed from 1500 to 3000 and set back. Moreover Etienne has done the following modifications to make this possible: "The modification I made in the new PTC I sent you are as follows: You first select SECTOR_NMUL and SECTOR_NMUL_MAX. For all multipole <= SECTOR_NMUL then maxwell's is solved to order SECTOR_NMUL_MAX. For multipole above SECTOR_NMUL , they are treated a la Sixtrack. So for example, it you have errors to order 20, you may bother with maxwells only to order nmul=4 and nmul_max=10 as far as Maxwell's is concerned. Multipole higher will be sixtrack multipoles. - Updated match with knobs - Fix dum1 dum2 definition - Missing declarations of dum1 and dum2 added - Debugging a) madxp: Wrong sign of TILT when calculated from k & KS b) madx_ptc_module: Total rewrite of TILT stuff! - Corrected state for 56D - In 4D, before setting in internal state only_4D we remove delta, otherwise delta stays - replacing "asin" by "-atan2" thereby fixing the sign for quad, sext, oct - set my_ring%charge=1 !preliminary fix - Removed charge setting to the my_ring layout to make ptc_twiss running, redundant printouts removed - Moments calculation fully imlemented; map buffering in ptc_twiss - Initialize mass(pma) and charge of MY_RING before set_madx - New ptc_twiss, so A_ is tracked. This makes possible tracking of moments (to be completed). - Initial orbit NOT closed orbit for initial betax - In case of instabilility in normal form, the code sets the global error flag and returns to the main command loop instead of fatal - fulfilled formalistic request for a change of the definition of numenclature of the ptc_twiss variables: beta, alfa and gama - Making unstable behavior in NormalForm a fatal error - All PTC track commands and NormalForm executions are checked for unstable behavior - First fill user tables and at the end TWISS table - Implemented: 1. ptc_setfieldcomp that set any order field strengh to requested value. It enables matching of higher order field components. 2. Special matching mode use_ptcknob. It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner. For further details see the comments at the top of matchptcknobs.c file. 3. Minor corrections and protections against segmentation vilation. - PTC knobs (pol_blocks) almost completely interfaced to MAD-X. User sets a knob with ptc_knob command. Twiss parameters and user specified (with ptc_select) map components are buffered in memory after every element in form of taylor series. They can be dumped to text file in two formats with ptc_printparametric command. They can be also visualized and further studied with rviewer from rplot plugin. Further, user can set numeric values of knobs with ptc_setknobvalue what updates all numeric values of the parameters in the tables. This way knobs can be used in matching. - Severe bug in knobs corrected: attempt to delete not properly assocoated taylors in case no knobs are set by the user - knobs implemented with PTC with pol_blocks; command to dump parametric results to file or stdout; content of ptc_madx_tablepush.f90 moved to ptc_madx_knobs.f90, the former one removed - Corrected twiss with parameters - Sceleton for knobs and arbitrary element placement implemented. Lattice visualization via ROOT macro. Printing detailed lattice geometry in PTC. Several small bug corrections and some code cosmetics. - Introducing TRUERBEND and WEDGRBEND in PTC. To this end 2 flags have been introduced in the NAD-X dictionary madxdict.h: 1) ptcrbend: if true it uses a PTC type RBEND 2) truerbend: if true it uses TRUERBEND; if false it uses WEDGRBEND - logical lp -> 4 and vice versa so NAG does not cry - problem causing compiler warning removed - open and close of unit 21 only for "getdebug() > 2" - Error flag implemented that signals that error code occured - Changing the conflicting "ksl" for the integrated solenoid strength to "ksi". This name is reserved for the vector of the integrated skew multipoles "ksl={};". Thick solenoid can now have normal "knl" and skew "ksl" multipole errors in PTC, ignored in madx proper. Thin solenoids are presently not considered in PTC. - Check of initial conditions provided by the user on imput. - PTC_Enforce6D implemented. If 6D TWISS calculation is performed with initial conditions (beta0 block) then non-zero betz is required - Fix writing 5/5 components of closed_orbit to twiss table - Bug corrected: writing maps should not be only in debug mode madx_ptc_normal.f90 - Pulled out the stuff for the "ptc_normal" module since "madx_ptc_module" is already very large. madx_ptc_script.f90 - Adding gino command following madx_ptc_script_module madx_ptc_setcavs.f90 - Cleaned code so NAG warnings are minimized now: mainly unused variables - RF cavity treated as TW cavity now, bug correction - temporary fix of non-existing "cav21" member - RF cavity treated as TW cavity now - Error flag implemented that signals that error code occured madx_ptc_tablepush.f90 - knobs implemented with PTC with pol_blocks; command to dump parametric results to file or stdout; content of ptc_madx_tablepush.f90 moved to ptc_madx_knobs.f90, the former one removed - Sceleton for knobs and arbitrary element placement implemented. Lattice visualization via ROOT macro. Printing detailed lattice geometry in PTC. Several small bug corrections and some code cosmetics. - Proper handling of 6D: 5th column and row are swapped with 6th ones. - Bug corrected. Added support for 6D case - 5th column and row is swapped with the 6th one then. - debug level 9 removed completely madx_ptc_track_run.f90 - unnused dummy variable in subr. photon is removed - Unused variables detected with Makefile_nag are removed - the re-initialization of NaN-flags - ICASE=56 created a fatal bug, fixed by setting ICASE=5. - ICASE other than 4, 5, (56->5), 6 throws a fatal error - For safety a "implicit none" statement plugged into every subroutine and also every function, independent if strictly needed or not! - PTC_Track tables: The last element is END (not START) - NaN-tracks by TRACK of PTC are blocked and tracking is terminated - Serious crash in ptc_track for unstable particles due to unitialized PTC aperture check variable. - Converted from windows to unix encoding - Bug in madx_ptc_track_run.f90 for ICASE=5 is fixed (Numb. of Eigens => 4) - Debug output only at debuglevel=4 madx_ptc_trackcavs.f90 - Removed bug in node tracking making impossible tracking for closed layouts - First step for node layout tracking in ptc_trackline - New ptc_twiss, so A_ is tracked. This makes possible tracking of moments (to be completed). - Track Global Coordinates corrected -> position is given with respect to fibre not magnet - Turn number added in rplot - Added switch to ptc_trackline command so user can choose if tracks shall be written to a ROOT ntuple. The feature is only accessible if rplot plugin is installed and madx is compiled with plugin support. - Sceleton for knobs and arbitrary element placement implemented. Lattice visualization via ROOT macro. Printing detailed lattice geometry in PTC. Several small bug corrections and some code cosmetics. - Change "logical(dp)" to the correct "logical(lp)" - Error flag implemented that signals that error code occured; Option for track position given in global coordinate system added. - debug level 9 removed completely madx_ptc_twiss.f90,v - mad-X_3_66 bugs found by EK - Problems: 1) pt not displayed in table. 2) deltap not in ptc_twiss header unless a twiss command was done before ptc_twiss! Solution: 1) Set up y properly 2) Put "deltap" into header of the ptc_twiss table permanently - Fix routine readrematrix by exchanging x(5) and x(6) - Adding deltap to ptc_twiss in case of initial conditions. - 1) madx_ptc_module without the ptc_normal stuff 2) fixing the "savemaps" bug - Don't display orbit in debug 0 mode - 1) Se_status: preliminary fix of uninitialized variable RADIATION_NEW 2) madx_ptc_module: Fix of "ptc_normal" by fixing the string comparison 3) madx_ptc_module & madx_ptc_twiss: write & read traditional DA map format - Type twiss becomes "public" to overcome problem with g95. Probably okay in g95 but may be overly picky. - Bug corrected (p0c was written to twiss table instead of energy - Bug Corrected: Parametric twiss results where not scaled with energy - Few protections agains seg faults added. Redundant debug info available only in high level debug mode - Knobs for Initial parameters - Moments updated, initialization for 5D in twiss, moments not available in 5D due to a bug and few others - Removed charge setting to the my_ring layout to make ptc_twiss running, redundant printouts removed - Moments calculation fully imlemented; map buffering in ptc_twiss - Few bugs corrected (f.g. map initialized to nd2 instead of npara when initial twiss provided). Moments seem to work (to be tested yet) - New ptc_twiss, so A_ is tracked. This makes possible tracking of moments (to be completed). wrap.f90 - needed changes to accept new "madx_ptc_normal_module" - First step for node layout tracking in ptc_trackline - Clean-up - Added feature that allows to set values of several knobs and only at the end recalculate values in tables. Normally all tables are recalculated after setting a new value. However, it slows dows parametric matching. New command ptc_refreshtable - Updated match with knobs - In addmoment, t and delta swapped so the MADX input corresponds to the MADX nomenclature. - Moments calculation fully imlemented; map buffering in ptc_twiss - New ptc_twiss, so A_ is tracked. This makes possible tracking of moments (to be completed). - Etienne's Gino stuff - Adding gino command following madx_ptc_script_module - Implemented: 1. ptc_setfieldcomp that set any order field strengh to requested value. It enables matching of higher order field components. 2. Special matching mode use_ptcknob. It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner. For further details see the comments at the top of matchptcknobs.c file. 3. Minor corrections and protections against segmentation violation. - PTC knobs (pol_blocks) almost completely interfaced to MAD-X. User sets a knob with ptc_knob command. Twiss parameters and user specified (with ptc_select) map components are buffered in memory after every element in form of taylor series. They can be dumped to text file in two formats with ptc_printparametric command. They can be also visualized and further studied with rviewer from rplot plugin. Further, user can set numeric values of knobs with ptc_setknobvalue what updates all numeric values of the parameters in the tables. This way knobs can be used in matching. - knobs implemented with PTC with pol_blocks; command to dump parametric results to file or stdout; content of ptc_madx_tablepush.f90 moved to ptc_madx_knobs.f90, the former one removed - Sceleton for knobs and arbitrary element placement implemented. Lattice visualization via ROOT macro. Printing detailed lattice geometry in PTC. Several small bug corrections and some code cosmetics. - PTC_Enforce6D implemented ============================================================================= PTC proper ---------- Files: ----- Sa_extend_poly.f90, Sb_sagan_pol_arbitrary.f90, Sc_euclidean.f90, Sd_frame.f90, Se_status.f90, Sf_def_all_kinds.f90, Sh_def_kind.f90, Si_def_element.f90, Si_def_element.f90, Sj_elements.f90, Sk_link_list.f90, Sl_family.f90, Sm_tracking.f90, Sma_multiparticle.f90, Sn_mad_like.f90, So_fitting.f90, Sp_keywords.f90, Spb_fake_gino_sub.f90, Sq_orbit_ptc.f90, Sqa_beam_beam_ptc.f90, Sqb_accel_ptc.f90, Sr_spin.f90, St_pointers.f90, Changes: -------- - PTC May 2007 - VORNAME assigned, the same as name of node in MADX but with capital letters - Fixing the crash for sbend + exact + multipoles larger than 10. This set-up requires to solve Maxwell's equation up to SECTOR_NMUL_MAX. The default is set to 10 to avoid excessive computing time. This is now safeguarded in madxp. To this end the parameters SECTOR_NMUL and SECTOR_NMUL_MAX are transfered from "ptc_create_layout" to "ptc_create_universe" such that these global parameters can be set early enough. Internally in PTC the parameter "lda_used" is incremented where needed from 1500 to 3000 and set back. Moreover Etienne has done the following modifications to make this possible: "The modification I made in the new PTC I sent you are as follows: You first select SECTOR_NMUL and SECTOR_NMUL_MAX. For all multipole <= SECTOR_NMUL then maxwell's is solved to order SECTOR_NMUL_MAX. For multipole above SECTOR_NMUL , they are treated a la Sixtrack. So for example, it you have errors to order 20, you may bother with maxwells only to order nmul=4 and nmul_max=10 as far as Maxwell's is concerned. Multipole higher will be sixtrack multipoles. - New PTC 2007 - PTC with crash security! - First BB - PTC version including spin - O-tone Etienne: Therefore I included this Zip file which contains the newest PTC. There are a few minor bugs related to patches in the present CVS version of PTC. This could affect the CHANGEREF command of Frank. It is fixed in this new PTC. In addition I included some routines in pointers.f90 and the script file for the example. - Etienne's clean-up - Change faulty print out of Totalpath 1) Se_status: preliminary fix of uninitialized variable RADIATION_NEW 2) madx_ptc_module: Fix of "ptc_normal" by fixing the string comparison 3) madx_ptc_module & madx_ptc_twiss: write & read traditional DA map format - PTC first changes stay October 2006 thinlens, cutting - Introducing TRUERBEND and WEDGRBEND in PTC. To this end 2 flags have been introduced in the NAD-X dictionary madxdict.h: 1) ptcrbend: if true it uses a PTC type RBEND 2) truerbend: if true it uses TRUERBEND; if false it uses WEDGRBEND - Etienne O-tone: I fixed a bug in the exit patches part of the backward survey. This bug was noticed while doing the Daphne backward ring. Patching was done correctly but the survey command was moving the layout. This reflects a bug in either patching or survey: dangerous. - The definition is: integer, pointer:: CAVITY_TOTALPATH ! REAL PILL B0X =1 , FAKE =0 default Accidentally it was set CAVITY_TOTALPATH=0 - Big bug in GETMAT7R and GETMAT7d DH wrong: "basically model 2 method 4 is messed up" - New PTC Etienne end of visit a) thin lense b) BB Spb_fake_gino_sub.f90 - New file needed for "Gino Version" pointers.f90 - remove bad temper comment - Etienne's Gino stuff - Adding gino command following madx_ptc_script_module - logical lp -> 4 and vice versa so NAG does not cry Spc_pointers.f90, St_pointers.f90, - Replaced by St_pointers.f90 - New 2007 PTC: this file replaces pointers.f90 Sq_orbit_ptc.f90 - New routines needed by PTC including spin Sqa_beam_beam_ptc.f90, Sqb_accel_ptc.f90, Sr_spin.f90 - New routines needed by PTC including spin ============================================================================= FPP --- Files: ------ a_def_all_kind.inc, a_def_element_fibre_layout.inc, a_def_frame_patch_chart.inc, a_def_sagan.inc, a_def_worm.inc, a_scratch_size.f90, b_da_arrays_all.f90, c_dabnew.f90, d_lielib.f90, h_definition.f90, i_tpsa.f90, j_tpsalie.f90, k_tpsalie_analysis.f90, l_complex_taylor.f90, m_real_polymorph.f90, n_complex_polymorph.f90, o_tree_element.f90 Changes: -------- - Throw out unused variables - Fix single/double precision definition that crashed NAG f95 - logical=>logical(lp) needed for NAG f95 - Bug corrected - only first 10 elements of an array was zeroed instead of whole - Check of initial conditions provided by the user on imput. - pointers initialized to null in universal_taylor e_define_newda.f90, f_newda.f90, g_newLielib.f90 - Experimental NEWDA no longer for this PTC version ============================================================================= Makefiles --------- Files: ------ Makefile, Makefile.bat, Makefile.prof, Makefile_develop, Makefile_g95, Makefile_gdb, Makefile_gfortran, Makefile_nag, Makeonline Changes: -------- - moved aperture code from madxn.c to new file aperture.c corrections: - more apex in halo polygon - corrected the construction of rectellipse in the general case - secured potentially dangerous division by zero - Cleaned code so NAG warnings are minimized now: mainly unused variables - PTC May 2007 - "madx_ptc_normal_module" - PTC version including spin - Changes needed to compile routine dlamc1 without optimization in extra file matchlib2.F. Otherwise madx gets stuck in matching procedures. In all Linux Makefiles matchlib2.F is compiled when using g77. For the Fortran90 compilers lf95, g95, f95(NAG) and gfortran an optimized routine is used as provided by Andy Vaught, the "g95" maintainer. For Windows the special compile flag: -lfe "-D_G95" was needed (special undocumented Fujitsu compile flag of the Lahey lf95) to compile this special Fortran90 version of dlamc1. - Adjustments to produce 32bit executables on AMD64 (not complete yet) - New PTC 2007: mod to Makefile due to filename change - plugin support off - New ptc_twiss, so A_ is tracked. This makes possible tracking of moments (to be completed). - New gino PTC version - Take out "-fno-second-underscore" from the gcc flags. Add "LIBX" for FC5 as a comment. - change in the print out of match summary when USE_MACRO - Implemented: 1. ptc_setfieldcomp that set any order field strengh to requested value. It enables matching of higher order field components. 2. Special matching mode use_ptcknob. It implements kind of macro that emplys parametric PTC calculations to perform matching in a faster manner. For further details see the comments at the top of matchptcknobs.c file. 3. Minor corrections and protections against segmentation vilation. - linker option added to export main program symbols so the function can be used from plugins - plugin support switched off by default - Optional plugin support added, that requires dynamic linking. Switched-Off by default. - corrected error - knobs implemented with PTC with pol_blocks; command to dump parametric results to file or stdout; content of ptc_madx_tablepush.f90 moved to ptc_madx_knobs.f90, the former one removed - Sceleton for knobs and arbitrary element placement implemented. Lattice visualization via ROOT macro. Printing detailed lattice geometry in PTC. Several small bug corrections and some code cosmetics. - Missing dependencies added - PTC with crash security! First BB Makefile.bat - JMJ: Added line to compile fatchlib2.f and modified lines to link it into madx.exe and madxp.exe. Makefile_gfortran - Makefile using gfortran - not working yet for PTC Makeonline New files for MAD-X On-Line Modeling Version =============================================================================

MAD-X production version 3.03: 04.05.2006

1) Documentation of standard PTC modules
2) New PTC module "ptc_track_line", i.e. lines with acceleration
3) Thin lens tracking in agreement with Ripken theory and PTC
4) Non-linear matching via encapsulated ptc_normal commands


All changes for each file:

Makefile -replacing madxdev by madxp -put pointers to the end on request of Etienne - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice ============================================================================= Makefile.bat -replacing madxdev by madxp -put pointers to the end on request of Etienne -Take out old Sb_1 and Sb_1 obj files -some misplaced commands - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice ============================================================================= madX/Makefile.prof -replacing madxdev by madxp -put pointers to the end on request of Etienne -Makefile for profiling courtesy PS ============================================================================= Makefile_develop -replacing madxdev by madxp -put pointers to the end on request of Etienne - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice ============================================================================= Makefile_g95 -replacing madxdev by madxp -put pointers to the end on request of Etienne - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice -Merged with version MAD-X 3.02.29 ============================================================================= Makefile_nag -Makefile for the NAG compiler -- for the moment not operational ============================================================================= Sa_extend_poly.f90 -PTC with dvds implemented in the travelling wave cavity. The voltage is given by: V=V0-dvds*z -Updated to energybefore = nfen%energy*1000. ============================================================================= Sb_1_pol_template.f90 -No longer needed after PTC upgrade 25.04.2005 ============================================================================= Sb_2_pol_template.f90 -No longer needed after PTC upgrade 25.04.2005 ============================================================================= Sd_frame.f90 -Updated to energybefore = nfen%energy*1000. ============================================================================= Se_status.f90 -Drop the printing of "NO=10" in curvbend - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice ============================================================================= Sf_def_all_kinds.f90 - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -updated latest head developements ============================================================================= Sg_1_fitted.f90 -No longer needed after PTC upgrade 25.04.2005 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -updated latest head developements -Updated to energybefore = nfen%energy*1000. ============================================================================= Sg_1_template_my_kind.f90 -No longer needed after PTC upgrade 25.04.2005 ============================================================================= Sg_2_template_my_kind.f90 -No longer needed after PTC upgrade 25.04.2005 ============================================================================= Sg_sagan_wiggler.f90 - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -updated latest head developements -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= Sh_def_kind.f90 - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice -PTC with dvds implemented in the travelling wave cavity. The voltage is given by: V=V0-dvds*z -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= Si_def_element.f90 - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice -PTC with dvds implemented in the travelling wave cavity. The voltage is given by: V=V0-dvds*z -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= Sk_link_list.f90 - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -updated latest head developements ============================================================================= Sl_family.f90 - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -updated latest head developements -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= Sm_tracking.f90 - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -updated latest head developements -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= Sma_multiparticle.f90 -Needed for PTC upgrade 25.04.2005 ============================================================================= Sn_mad_like.f90 - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -PTC with dvds implemented in the travelling wave cavity. The voltage is given by: V=V0-dvds*z -updated latest head developements -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= So_fitting.f90 -Fixing initialization problems - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -Wrong definition of JMIN and EPSNOW!!! -PTC with dvds implemented in the travelling wave cavity. The voltage is given by: V=V0-dvds*z -updated latest head developements -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= Sp_keywords.f90 - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice ============================================================================= a_def_all_kind.inc - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice -PTC with dvds implemented in the travelling wave cavity. The voltage is given by: V=V0-dvds*z -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= a_def_element_fibre_layout.inc - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice -PTC with dvds implemented in the travelling wave cavity. The voltage is given by: V=V0-dvds*z -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= a_def_user1.inc -No longer needed after PTC upgrade 25.04.2005 ============================================================================= a_def_user2.inc -No longer needed after PTC upgrade 25.04.2005 ============================================================================= a_scratch_size.f90 -logical must be without (lp) when going into INQUIRE function - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice -All constants collected here. Carefully checked and reordered. -PTC with dvds implemented in the travelling wave cavity. The voltage is given by: V=V0-dvds*z -updated latest head developements -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= b_da_arrays_all.f90 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -updated latest head developements -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= d_lielib.f90 -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= f_newda.f90 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -updated latest head developements ============================================================================= h_definition.f90 -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= j_tpsalie.f90 -Fixing initialization problems ============================================================================= k_tpsalie_analysis.f90 -PTC with dvds implemented in the travelling wave cavity. The voltage is given by: V=V0-dvds*z -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= madx_ptc_intstate.f90 -bug correction: always using eternal states instead of current ones. -Clean-up -New matching with macros that enables fitting of non-linear parameters with PTC 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -updated latest head developements ============================================================================= madx_ptc_module.f90 -The restrictions "IF(l.ne.0)" are removed. => -bug correction: always using eternal states instead of current ones. -Drop useless "make_states" call -in my_state: if requested dimensionality 6 and there are cavities, enforce dalta and only_4d to false. -Fixing division by l=zero in the multipole block -if icase=6 then only_4d=false -Reduntant debug printouts present only in debug mode -Fine tuning debug print-out -Fixing "eigen" print-out, the screw-up was due to 5D versus 6D -Clean-up -New matching with macros that enables fitting of non-linear parameters with PTC -output of eigen have proper row/column swap from (pt,t) to (-t,pt) -Fix the i2 variable bug of eigen in equaltwiss found Piotr - thanks -bugs in subr. SUMM_MULTIPOLES..: INTENT(INOUT) for key & normal_0123 initialized. -eigenvector calculation in ptc_twiss -6D "eign" in ptc_normal 1) Adding eigenvectors to ptc_normal 2) Suppress debug printing to unit 18/19 -remove bug (division by zero) due to dipole errors -Finishing multipoles in thick elements -Multipoles and Errors of any order are added to thick elements (for MADX-PTC only) 1) State "time" is default and can be set in create_layout. 2) C routines that write or read from TFS tables only operate with double precision numbers. This will ensure a proper operation when PTC is calculating in four-fold precision. -Merged with version MAD-X 3.02.29 -Updated to head, bug corrected in equaltwiss -compilation problem corrected -updated latest head developements -Reduntant debug printout removed -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= madx_ptc_script.f90 -put pointers to the end on request of Etienne - Adapting Makefiles for non-linear matching and PTC upgrade - PTC upgrade: Proper Thin Lens Lattice ============================================================================= madx_ptc_setcavs.f90 -Reduntant debug printouts present only in debug mode -Clean-up -New matching with macros that enables fitting of non-linear parameters with PTC 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -updated latest head developements -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= madx_ptc_tablepush.f90 -Clean-up -New matching with macros that enables fitting of non-linear parameters with PTC 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -Updated to head, bug corrected in equaltwiss updated latest head developements ============================================================================= madx_ptc_track_run.f90 -Fixing the closed orbit at the observation points for ELEMENT_BY_ELEMENT -calculation of CO is removed when ELEMENT_BY_ELEMENT is forced to ON at Closed_ORBIT=OFF. -text of print-out is corrected 1) Fixing "element_by_element=false" 2) Add CT variable print-out in 5D -remove bug (division by zero) due to dipole errors -The sign for the second coord. system {-pathelength,deltap} is corrected -Finishing multipoles in thick elements -use "real(kind(1d0) :: dble_num_C" variable as a double precision buffer number for an input parameter at all CALLs of the C-routine "double_to_table" -clean-up estetics 1) State "time" is default and can be set in create_layout. 2) deltap is transfered to pt when "time" is on. -Merged with version MAD-X 3.02.29 -Merged with version MAD-X 3.02.29 -Updated to head, bug corrected in equaltwiss -updated latest head developements -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= madx_ptc_trackcavs.f90 -Clean-up -New matching with macros that enables fitting of non-linear parameters with PTC 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -fill tables with single precision values -updated latest head developements -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= madxd.h -New matching with macros that enables fitting of non-linear parameters with PTC -version 3.02.25 => PTC examples (_track, _normal, _twiss) are checked on abploc with "strict" version of madxdev -The eigenvalue keyword is consistent set to the 2 characters "eign" -eigenvector calculation in ptc_twiss 1) Adding "eign" to ptc_normal table "normal_results" 2) Grow table "normal_results" if needed -Merged with version MAD-X 3.02.29 -Updated to head, bug corrected in equaltwiss -updated latest head developements -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 -weight paramter in constraint command to be used with use macro ============================================================================= madxdict.h -option no_fatal_stop to not let a fatal error kill madx -Clean-up -New matching with macros that enables fitting of non-linear parameters with PTC -Cleaned version of thintrack. No delta_p dependence internally any more. Only radiation part of code still contains delta. Full 6D equations (Ripken) used. Some further improvements. Closed orbit still computed by twiss. 1) Adding "eign" to ptc_normal table "normal_results" 2) Grow table "normal_results" if needed -Multipoles and Errors of any order are added to thick elements (for MADX-PTC only) 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -Merged with version MAD-X 3.02.29 -updated latest head developements -weight paramter in constraint command to be used with use macro ============================================================================= madxl.h -The eigenvalue keyword is consistent set to the 2 characters "eign" -eigenvector calculation in ptc_twiss 1) Adding "eign" to ptc_normal table "normal_results" 2) Grow table "normal_results" if needed -updated latest head developements ============================================================================= madxn.c -Reverting to old warning routine -Clean-up -New matching with macros that enables fitting of non-linear parameters with PTC -The eigenvalue keyword is consistent set to the 2 characters "eign" -eigenvector calculation in ptc_twiss -6D "eign" in ptc_normal 1) Adding "eign" to ptc_normal table "normal_results" 2) Grow table "normal_results" if needed -Merged with version MAD-X 3.02.29 -updated latest head developements -weight paramter in constraint command to be used with use macro ============================================================================= madxp.c -option no_fatal_stop to not let a fatal error kill madx -Reverting to old warning routine -fmt can not be register variable -Clean-up -New matching with macros that enables fitting of non-linear parameters with PTC -Merged with version MAD-X 3.02.29 -weight paramter in constraint command to be used with use macro ============================================================================= madxu.c -Clean-up -New matching with macros that enables fitting of non-linear parameters with PTC -weight paramter in constraint command to be used with use macro ============================================================================= matchc.c -Clean-up -New matching with macros that enables fitting of non-linear parameters with PTC -output fix -weight paramter in constraint command to be used with use macro ============================================================================= matchc2.c -New match library needed for non-linear matching -- readded due to dead revision -clean-up -fix compiler complain -output fix -weight paramter in constraint command to be used with use macro ============================================================================= matchjc.F -Clean-up -Jacobian fix. Avoid twiss or macro to be called before a check on the variables limits -New matching with macros that enables fitting of non-linear parameters with PTC -weight paramter in constraint command to be used with use macro ============================================================================= matchlib.F -New match library needed for non-linear matching -- readded due to dead revision ============================================================================= o_tree_element.f90 -Updated to madX-3_02_16; bug corrected in madx_ptc_setcavs.f90 ============================================================================= pointers.f90 put pointers to the end on request of Etienne -Fix write statement that was changed by automatic clean-up, IE replacing "pause" statements. -Needed for PTC upgrade 25.04.2005 ============================================================================= track.fi -Cleaned version of thintrack. No delta_p dependence internally any more. Only radiation part of code still contains delta. Full 6D equations (Ripken) used. Some further improvements. Closed orbit still computed by twiss. -Merged with version MAD-X 3.02.29 ============================================================================= trrun.F -Change the definition of the kicker. The acting on px/py now instead of x'/y' AK/FS -Cleaned version of thintrack. No delta_p dependence internally any more. Only radiation part of code still contains delta. Full 6D equations (Ripken) used. Some further improvements. Closed orbit still computed by twiss. -Merged with version MAD-X 3.02.29 ============================================================================= twiss.F -Take out debug printing of eigen -remove bug (division by zero) due to dipole errors ============================================================================= user2_photon.f90 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -updated latest head developements ============================================================================= wrap.f90 -clean-up 1) Remove residual left-over definition of double precision numbers. Should all be in a_scratch_size.f90. 2) The logical needs to be defined as "logical(lp)". Several instances found. -updated latest head developements =============================================================================

MAD-X version 3.02.14: 12.04.2006

1) PTC modules have been cleaned up and are all documented by now
2) New "PTC_TRACK_LINE" for tracking lines including acceleration
written and maintained by Piotr Skowronski
3) Numerous bug fixes and clean-ups

All changes for each file:

Makefile -Reverting to the previous version -Temporal work around implemented: there is some problem with internal state settings; \ in setcaenforcing preparing to merge with the recent HEAD developements hoping that the problem was alread solved over there. -new match mode ============================================================================= Makefile_develop -new match mode ============================================================================= Makefile_gdb -file Makefile_gdb was initially added on branch newmatch. -Temporal work around implemented: there is some problem with internal state settings; \ in setcaenforcing preparing to merge with the recent HEAD developements hoping that the problem was alread solved over there. -Dependences corrected so it can be made with -j N option -new match mode ============================================================================= Sh_def_kind.f90,So_fitting.f90,a_scratch_size.f90,i_tpsa.f90,j_tpsalie.f90, -Replace "double precision" by "real(dp) -Merged newmatch-060411 with recent HEAD developement ============================================================================= madx_ptc_intstate.f90 -global debuglevel integer added (0 completely silent, 1 normal printout, 2 most important debug information, 3 everything ============================================================================= madx_ptc_module.f90 - 1) Fix priority order between ICASE and DELTAP and cavities 2) Convert DELTAP to PT 3) Proper conversion between variables for 5D 4) Clean-Up 5) Replace "double precision" by generic "real(dp)

MAD-X version 3.02.05: 22.03.2006

0) Stable Production Version 
1) Tracking Linacs including acceleration using PTC
2) General PTC upgrade
3) Strict Compile Flags revealed a couple of subtle Fortran bugs like
the use of initialized variables and out-of bound usage of arrays
4) Examples including Documentation brought up to date

All changes for each file:

Makefile -New functionality for PTC: track linac, ptc_twiss with acceleration, ptc_select, ptc_script, ptc_dumpmaps -Take out Sg_0_fitted.f90 since no longer needed for PTC upgrade. ============================================================================= Makefile.bat -Fixes needed to get it to run on Windows -Missing file added -New functionality for PTC: track linac, ptc_twiss with acceleration, ptc_select, ptc_script, ptc_dumpmaps -Take out Sg_0_fitted.f90 since no longer needed for PTC upgrade. -Updated to include matchjc. -Default location for checked-out files changed, comment added. ============================================================================= Makefile_develop -More interesting flags: --chk a,e,s,u,x --chkglobal --info -Adapting to Piotr's new PTC additions -Switching to lf95 with very tough compile flags -New functionality for PTC: track linac, ptc_twiss with acceleration, ptc_select, ptc_script, ptc_dumpmaps -Take out Sg_0_fitted.f90 since no longer needed for PTC upgrade. ============================================================================= Makefile_g95 -New functionality for PTC: track linac, ptc_twiss with acceleration, ptc_select, ptc_script, ptc_dumpmaps -Take out Sg_0_fitted.f90 since no longer needed for PTC upgrade. ============================================================================= madxp.c -Indenting -Fixing of: madxp.c:396: warning: ISO C90 forbids mixed declarations and code -Reduntant debug printout removed ============================================================================= madxn.c -Indenting -Compiler warnings removed -Fix a memory leak in "pro_ptc_twiss" ============================================================================= madxreg.c, madxu.c -Indenting ============================================================================= makethin.c -Warning on inconsistent child/parent slicing removed as this has become an allowed feature + clean up of old, now rather obsolete comments. ============================================================================= madxd.h -Compiler warnings removed ============================================================================= madx_ptc_setcavs.f90 -the variable "givendene" was uninitialized ============================================================================= madxdict.h -In ptc_create_layout by default it is closed now -fix defaults for matching with chrom ============================================================================= c6t.c 1) In case drifts are combined at the end of the machine, the "end_marker" in fc.34 (input file for sodd) came with erroneous values for position, beta-functions and phase advances. 2) For various reasons the number of elements with field errors and/or alignment errors may vary between SixTrack and MAD-X. Obviously, the physics is identical! ============================================================================= dynap.F Various bug fixes, write out of distance in phase space into file lyapunov.data FZ&FS ============================================================================= gxx11c.c Defining templates mycalloc and myfree ============================================================================= ibsdb.F In Routine twsint variable "alam" was used before being initialized, again no effect on the results. ============================================================================= trrun.F -Various bug fixes, write out of distance in phase space into file lyapunov.data FZ&FS -Fix bug in aperture check of "rectellipse": The parameters of rectangle/ellipse were swapped, thus wrong. ============================================================================= twiss.F -fixing the restsum problem of overwriten arrays and lack of initialization -logical cplxy & dorad were uninitialize ============================================================================= poisson.F -Fortran clean-up: implicit none etc. ============================================================================= madx_main.f90 Clean-up: missing public & implicit none statements ============================================================================= Sg_0_fitted.f90 -No longer needed after PTC upgrade ============================================================================= Sh_def_kind.f90 changed some stuff in kind7 and kind6(sixtrack) ============================================================================= So_fitting.f90 -unintialized. Line 979 added: mx=zero ============================================================================= Sa_extend_poly.f90, Sb_1_pol_template.f90, Sb_2_pol_template.f90, Sb_sagan_pol_arbitrary.f90, Sb_sagan_pol_arbitrary.f90, Sc_euclidean.f90, Sd_frame.f90, Se_status.f90, Sf_def_all_kinds.f90, Sg_1_fitted.f90, Sg_1_template_my_kind.f90, Sg_2_template_my_kind.f90, Sg_sagan_wiggler.f90, Sh_def_kind.f90, Si_def_element.f90, Sj_elements.f90, Sk_link_list.f90, Sl_family.f90, Sm_tracking.f90,Sn_mad_like.f90, So_fitting.f90, Sp_keywords.f90, a_def_all_kind.inc, a_def_element_fibre_layout.inc, a_scratch_size.f90, b_da_arrays_all.f90, c_dabnew.f90,e_define_newda.f90, h_definition.f90, i_tpsa.f90, j_tpsalie.f90, k_tpsalie_analysis.f90, l_complex_taylor.f90, m_real_polymorph.f90, madx_ptc_module.f90, n_complex_polymorph.f90, o_tree_element.f90, run_madx.f90 0) Features kindfitted, ZGOUBI are taken out. 1) Plug in "public" in each module 2) Partial unitialized array in "FIND_ORBIT_LAYOUT_noda" in "So_fitting.f90". 3) A couple of missing "implicit none" statements as described before. 4) check_iteration, check_interpolate_x, check_interpolate_y where un-associate pointers after PTC upgrade. ============================================================================= Sg_1_fitted.f90, Sg_1_template_my_kind.f90, Sg_2_template_my_kind.f90, Sg_sagan_wiggler.f90, Sh_def_kind.f90, Sp_keywords.f90, b_da_arrays_all.f90, - Missing "implicit none" and "public" statement - File "b_da_arrays_all.f90": ndamaxi initialized to zero - File "Sh_def_kind.f90": unused variable "copyMULTIP" & "find_fb" removed ============================================================================= a_def_element_fibre_layout.inc -Passive field for kind21 (twcavity) added containing a lag ============================================================================= madx_ptc_intstate.f90, madx_ptc_script.f90, madx_ptc_setcavs.f90, madx_ptc_tablepush.f90, madx_ptc_track_run.f90, madx_ptc_trackcavs.f90, madx_ptc_module.f90, wrap.f90, ptc_dummy.F, Sn_mad_like.f90, madxp.c, madxn.c, madxu.c, rplot.c, madxd.h, madxdict.h, madxl.h, rplot.h -Fortran code processed by frs's indentation script -Clean-up: missing public & implicit none statements -New functionality for PTC: track linac, ptc_twiss with acceleration, ptc_select, ptc_script, ptc_dumpmaps ============================================================================= madx_ptc_module.f90 -Fortran code processed by frs's indentation script -Normaliztion error found in the calculation of higher order chromaticity (RT) ============================================================================= madx_ptc_setcavs.f90 locate_all_cav substituted with new locate_all_twcav that counts only twcavities =============================================================================

MAD-X version 3.02.01: 08.02.2006

1) Many bug fixes
2) "Jacobian" matching
4) PTC upgrade
3) Worldwide CVS read access from:
MAD-X Source

All changes for each file:

Makefile -Modified to allow more flexible PTC modeling using madx_main.f90 and run_madx.f90 -Adding new PTC file Sg_1_fitted.f90 -Missing dependence on madxreg.c ============================================================================= Makefile.bat -Updated to include matchjc. Default location for checked-out files changed, comment added. -Modified to allow more flexible PTC modeling using madx_main.f90 and run_madx.f90 -Adding new PTC file Sg_1_fitted.f90 ============================================================================= Makefile_develop -New match routine "jacobian". In the matching routine there is the new command "jacobian" similar to lmdif. It allows to use more variable than constraints, finding the least square solution for the parameters to be varied. -Modified to allow more flexible PTC modeling using madx_main.f90 and run_madx.f90 -Bug fix of dependence of Sg_1_fitted.f90 -Adding new PTC file Sg_1_fitted.f90 1) Add missing dependence on madxreg.c 2) Replace obsolete g95 compiler flag "-g90" by "-g" ============================================================================= Makefile_g95 -The link option 'static' does not yet work for 'madxdev' using g95. -Modified to allow more flexible PTC modeling using madx_main.f90 and run_madx.f90 -Makefile using the g95 compiler ============================================================================= Sc_euclidean.f90, Sd_frame.f90, Se_status.f90, Sf_def_all_kinds.f90, Sg_0_fitted.f90, Sg_1_fitted.f90, Sg_1_template_my_kind.f90, Sg_2_template_my_kind.f90, Sg_sagan_wiggler.f90, Sh_def_kind.f90, Si_def_element.f90, Sj_elements.f90, Sk_link_list.f90, Sl_family.f90 Sm_tracking.f90, So_fitting.f90, Sp_keywords.f90, a_def_all_kind.inc, a_def_element_fibre_layout.inc, a_scratch_size.f90, h_definition.f90, i_tpsa.f90, k_tpsalie_analysis.f90, l_complex_taylor.f90, m_real_polymorph.f90, n_complex_polymorph.f90, o_tree_element.f90 -PTC Upgrade: 1) Improved Knobs 2) Acceleration 3) Add rectellipse aperture 4) Kill memory leaks -More on PTC Upgrade: In Etienne's words: The type pancake will be made of equidistant slices in cylindrical coordinates amenable to rk2 or rk4 integration (nonsymplectic). I will tentatively represent bx,by,bz by a polynomial in x-y. This polynomial will be extracted using Berz's wavelets.... This is my plan. I will most likely destroy fitted magnets and this experimental multip. Both will be taken over by pancake.... -fixing npara -adding KINDMU -Mytrue & Myfalse in call to ENGE_COM -ENGE_COM has to have LOGICAL(LP) as the third variable -add Runge Kutta, Zgoubi stuff -Lethal bug in patch of tracking -j_global, OTHER PROGRAM, TRACK_R -ZGOUBI_MULTIP, patch, CHANGEREF, other_program 3) Add rectellipse aperture 4) Kill memory leaks -Fix normalization of arc length in PTC. MAD-X always gives arc length internally: 1) rbarc=true input straight length ==> internally arc length 2) rbarc=false arc length always -Destructors and Constructors for my_1D_taylor ============================================================================= c_dabnew.f90 -Serious DA bug: do ib1 =2,invc+1 in routine mtree PTC Upgrade: 1) Improved Knobs 2) Acceleration 3) Add rectellipse aperture 4) Kill memory leaks ============================================================================= a_def_frame_patch_chart.inc, a_def_worm.in, New PTC include file ============================================================================= c6t.c -For SixTrack runs the length of the machine has to be known to 1mu. This value is transfered to SixTrack via fc.3.aux. -Sequence length is written out to 1mu meter -More work on the f34 fake crash -Under certain conditions writing to unit 34 (twiss parameters for SODD) failed leading to a fake MAD-X crash when running 'sixtrack' or 'sodd'. -Remove tabs introduce by earlier indenting. Indenting by 2 characters & brackets below operator for better readability. FS has recipe to do it semi-automatic. ============================================================================= c6t.h, gxx11c.c, gxx11psc.c, madx.h, madxl.h, madxreg.c, madxreg.h, madxu.c, makethin.c, matchc.c, sxf.c, timel.c -Remove tabs introduce by earlier indenting. Indenting by 2 characters & brackets below operator for better readability. FS has recipe to do it semi-automatic. ============================================================================= gxx11c.c -Replacing calloc & free by the wrappers mycalloc & myfree ============================================================================= madx.h, madxd.h, madxdict.h, madxn.c, madxp.c, madxu.c, makethin.c 1) Warning if sequedit of lines and no action 2) New Attribute 'bare' od 'save' command Example: tl3:line=(ldl6,qtl301,mqn,qtl301,ldl7,qtl302,mqn,qtl302,ldl8,ison); DLTL3 : LINE=(delay, tl3); use, period=dltl3; save,sequence=dltl3,file=t1,bare; // new parameter "bare": only sequ. saved call,file=t1; // sequence is read in and is now a "real" sequence // if the two preceding lines are suppressed, seqedit will print a warning // and else do nothing use, period=dltl3; twiss, save, betx=bxa, alfx=alfxa, bety=bya, alfy=alfya; plot, vaxis=betx, bety, haxis=s, colour:=100; SEQEDIT, SEQUENCE=dltl3; remove,element=cx.bhe0330; remove,element=cd.bhe0330; ENDEDIT; use, period=dltl3; twiss, save, betx=bxa, alfx=alfxa, bety=bya, alfy=alfya; ============================================================================= madx_main.f90 -2 of 2 routines to replace madxm.F: routines added in run_madx can be called here ============================================================================= madx_ptc_module.f90 -Normaliztion error found in the calculation of higher order chromaticity (RT) -Proper print-out of closed orbit in PTC -Skew quadrupole, sextupole and octupole components k1s, k2s, k3s have been added respectively. Field error components are added as well. Results have been confirmed with using k1, k2, k3 and the the proper tilt -Finish patch; Survey output 1) Hans Grote non-dynamic buffer fix 2) Adding Generating Function to ptc_normal (more work needed!) -initialization bug courtesy PS -trivial formating like indenting trailing blanks etc ============================================================================= madx_ptc_track_run.f90 -Fix t pt which have reversed order in PTC -trivial formating like indenting trailing blanks etc ============================================================================= madxc.c -Hans Grote non-dynamic buffer fix -Name added for namelist ============================================================================= madxd.h -In the matching routine there is the new command "jacobian" similar to lmdif. It allows to use more variable than constraints, finding the least square solution for the parameters to be varied. -Issuing the number of warnings during a MAD-X run -Hans Grote non-dynamic buffer fix -fixing the crash after "save" command courtesy HG -name in namelist HG 1) Add fill_twiss_header_ptc routine and template to produce short but proper ptc_twiss table headers. 2) Remove tabs introduce by earlier indenting. Indenting by 2 characters & brackets below operator for better readability. FS has recipe to do it semi-automatic. 3) madxn.c: remove unused variables 4) madxd.h: new version number -Missing "for" loop over all sequences in memory in add_to_el_list.c Adverse effect when trying to read in 2 previously "save"d sequences (courtesy HG) ============================================================================= madxdict.h -New match routine "jacobian". In the matching routine there is the new command "jacobian" similar to lmdif. It allows to use more variable than constraints, finding the least square solution for the parameters to be varied. -Hans Grote non-dynamic buffer fix -solenoid and makethin selection consistency -The deltap variable was wrongly defined in the match section, this lead to a crash when matching was attempted with deltap. Crash fixed but functionality still has to be tested (kindly pointed at WH) ============================================================================= madxl.h 1) Hans Grote non-dynamic buffer fix 2) Adapt for adding Generating Function to madx_ptc_module.f90 -SXF upgrade in particular adding the "angle" attribute NM -Memory Leak Detection courtesy EM -Wrong Touschek table definition in madxl.h ============================================================================= madxn.c 1) New match routine "jacobian". RdM In the matching routine there is the new command "jacobian" similar to lmdif. It allows to use more variable than constraints, finding the least square solution for the parameters to be varied. 2) Fixing the Windows end-of-line problem of TFS tables. (courtesy HG) -The normalization of mu to 2*pi has been done in "twiss" and "embedded twiss" in the C part, as a result the value of a BETA0 block had an inconsistent normalization (found my Frank Tecker). -Write out sectormap file with variable format. 1) Hans Grote non-dynamic buffer fix 2) Adding Generating Function to ptc_normal (more work needed!) -Names added for name_list HG -allow "0" as the first letter of a file SB -reset curr_obs_points=1 -drop unused variable -Replacing malloc by the wrapper mymalloc 1) Add fill_twiss_header_ptc routine and template to produce short but proper ptc_twiss table headers. 2) Remove tabs introduce by earlier indenting. Indenting by 2 characters & brackets below operator for better readability. FS has recipe to do it semi-automatic. 3) madxn.c: remove unused variables 4) madxd.h: new version number ============================================================================= madxp.c -Issuing the number of warnings during a MAD-X run -Fatal_error if row name is not found in TFS table. 1) Modifications to allow 'D' format in routine get_val_num (courtesy HG) 2) The table_access with 3 variables table(x,y,z) has usually implied: 'accesses value named "z" for element "y" of table "x"'. To specify a certain row number 'n' in table access one can use: table(x,z,n). -Hans Grote non-dynamic buffer fix -fixing the crash after "save" command courtesy HG - Names for namelist HG - Fix input error la "a=2d" HG 1) Fix rare bug that produced wrong (straight) length of rbend in case shared or un-flattened sequences are used. Bug fix in make_element (courtesy HG) 2) Remove tabs introduce by earlier indenting. Indenting by 2 characters & brackets below operator for better readability. FS has recipe to do it semi-automatic. 3) Remove unused variables. -Missing "for" loop over all sequences in memory in add_to_el_list.c Adverse effect when trying to read in 2 previously "save"d sequences (courtesy HG) ============================================================================= madxreg.c -Replacing calloc/malloc/free by the wrappers mycalloc/mymalloc/myfree ============================================================================= madxu.c -Modifications to allow 'D' format (courtesy HG) -Avoid potentially uninitialized variable -Hans Grote non-dynamic buffer fix -fixing the crash after "save" command courtesy HG -Memory Leak Detection courtesy EM -fixing a=2d input error HG -names in namelist HG -Missing "for" loop over all sequences in memory in add_to_el_list.c Adverse effect when trying to read in 2 previously "save"d sequences (courtesy HG) ============================================================================= makethin.c -indentation 1) Hans Grote non-dynamic buffer fix 2) Issue message if thick bend has fringe fields -improved treatement of selection conflicts -selection consistency and solenoid ============================================================================= match.F, matchc.c, matchjc.F, matchsa.F -New match routine "jacobian". In the matching routine there is the new command "jacobian" similar to lmdif. It allows to use more variable than constraints, finding the least square solution for the parameters to be varied. ============================================================================= matchc.c -name in namelist HG -Replacing malloc by the wrapper mymalloc ============================================================================= plot.fi -Increased buffer size for long axis annotation ============================================================================= run_madx.f90 -1 of 2 codes to replace madxm.f90: one can add more routines at the end ============================================================================= sxf.c -Remove unused variables -Hans Grote non-dynamic buffer fix -SXF upgrade in particular adding the "angle" attribute NM -name in namelist ============================================================================= trrun.F -solenoid, Koschick + hbu ============================================================================= twiss.F The normalization of mu to 2*pi has been done in "twiss" and "embedded twiss" in the C part, as a result the value of a BETA0 block had an inconsistent normalization (found my Frank Tecker). -Add thin solenoid -Fix rmatrix calculation - inverse similarity transformation =============================================================================

MAD-X version 3.00.01: 07.09.2005


Overview:

1) New major release featuring PTC as an integral part of MAD-X PTC modules are: a) ptc_twiss: Ripken style Twiss parameters now with intial optics conditions b) ptc_track: the thick lens tracking module using PTC with most features of the thin lens tracking c) ptc_normal: Nonlinear parameters, Hamiltonian terms etc. 2) Essential upgrade of makethin 3) IBS upgrade 4) Adding PS file in the plotting 5) Removing limit on length of macros 6) Clean-up

All changes for each file:

============================================================================= Makefile -drop not needed epause.o & usleep.o -Add missing dependence of madxp.c on madxreg.h 1) Mods needed due to added files in V3.00 2) Missing dependencies for touschek 3) maxcontine=100 a) Raising optimization to O4 in: Makefile b) Full checking in: Makefile_develop ============================================================================= Makefile.bat 1) Mods needed due to added files in V3.00 2) Missing dependencies for touschek 3) maxcontine=100 ============================================================================= Makefile_develop -drop not needed epause.o & usleep.o 1) Mods needed due to added files in V3.00 2) Missing dependencies for touschek 3) maxcontine=100 a) Raising optimization to O4 in: Makefile b) Full checking in: Makefile_develop -FOPT=-Bstatic does not work on the MAC and has been taken out. -The "-c" option was missing for MAC compilation. -Fix bad link static flag "-static" by the proper "-Bstatic" one ============================================================================= a_scratch_size.f90 - Sp_keywords.f90 PTC Version ~February 2005 (courtesy Etienne Forest) ============================================================================= Sb_sagan_pol_arbitrary.f90, Sg_sagan_wiggler.f90, a_def_sagan.inc -new code entity for PTC Version ~February 2005 (courtesy Etienne Forest) ============================================================================= a_def_arbitrary.inc -no longer needed in PTC Version ~February 2005 (courtesy Etienne Forest) ============================================================================= c6t.c,v -simple clean-up -frs + hbu : General cleaning. Tabs to blanks. Remove blanks at eol. Convert any C++ comments to ansi c comments. Fix possible uninitialized variables in madxn.c ============================================================================= dynap.F -Modified dynap to track several pairs of particles; write tunes, smear and lyapunov exponent of each pair to tables dynap and dynaptune; improve estimate of Lyapunov exponent by considering 3 angles in normalized phase space instead of 6-D distance in original phase space. ============================================================================= epause.c, usleep.c -No longer needed ============================================================================= gxx11.F, gxx11ps.F -new track plot routine, plots are appended to existing ps file -Flush in a portable way for ps plot -During interactive use the ps plot file is consistent and can be viewed after each plot command. (Not for tracking plot which uses a different system) ============================================================================= gxx11psc.c -frs + hbu : General cleaning. Tabs to blanks. Remove blanks at eol. Convert any C++ comments to ansi c comments. Fix possible uninitialized variables in madxn.c ============================================================================= ibsdb.F -Code logic unchanged but: Fortran90 compatibility changes -Remove one obsolete write command. -IBS horizontal growth rate corrected; effect of vertical dispersion added to al three IBS growth rates. ============================================================================= madx.h -simple clean-up -frs + hbu : General cleaning. Tabs to blanks. Remove blanks at eol. Convert any C++ comments to ansi c comments. Fix possible uninitialized variables in madxn.c ============================================================================= madx_ptc_module.f90 -Mods needed for the ptc_twiss upgrade and the new ptc_track module ============================================================================= madx_ptc_track_run.f90 -New ptc_track thick lens tracking module ============================================================================= madxc.c -Revert "clean-up" -frs + hbu : General cleaning. Tabs to blanks. Remove blanks at eol. Convert any C++ comments to ansi c comments. Fix possible uninitialized variables in madxn.c -Fixing the limit of the length of 10000 characters for macros (courtesy HG) -Clean up to avoid compiler warnings ============================================================================= madxd.h -version number 3.00.01 -Changes to the Core Code needed for PTC upgrade V3.00 -frs + hbu : General cleaning. Tabs to blanks. Remove blanks at eol. Convert any C++ comments to ansi c comments. Fix possible uninitialized variables in madxn.c -new track plot routine, plots are appended to existing ps file -Version number V2.13.12 -Fixing the limit of the length of 10000 characters for macros (courtesy HG) -new version number -Fix of install bug (courtesy HG) -Clean up to avoid compiler warnings ============================================================================= madxdict.h -Fix of the "start" command bug in ptc_track. For the time being "ptc_start" has to be used. To be followed up... -Changes to the Core Code needed for PTC upgrade V3.00 -frs + hbu : General cleaning. Tabs to blanks. Remove blanks at eol. Convert any C++ comments to ansi c comments. Fix possible uninitialized variables in madxn.c -introduce Werner's improved readtable ============================================================================= madxe.c -Revert "clean-up" -frs + hbu : General cleaning. Tabs to blanks. Remove blanks at eol. Convert any C++ comments to ansi c comments. Fix possible uninitialized variables in madxn.c -Clean up to avoid compiler warnings ============================================================================= madxl.h -Changes to the Core Code needed for PTC upgrade V3.00 -frs + hbu : General cleaning. Tabs to blanks. Remove blanks at eol. Convert any C++ comments to ansi c comments. Fix possible uninitialized variables in madxn.c ============================================================================= madxn.c -Changes to the Core Code needed for PTC upgrade V3.00 -frs + hbu : General cleaning. Tabs to blanks. Remove blanks at eol. Convert any C++ comments to ansi c comments. Fix possible uninitialized variables in madxn.c -remove set_selected_elements() now done in makethin.c -new track plot routine, plots are appended to existing ps file -Fixing the limit of the length of 10000 characters for macros (courtesy HG) -Doubled the number of tracked particles in track_dynap so as to include the Lyapunov partners. -Tracking plot fix: now different postscript output filenames can be used. Note: the plotting routine plots only at the end of mad executing a gnuplot command file. The data used for plotting are last data stored in the table file. -introduce Werner's improved readtable, further clean-up ============================================================================= madxp.c -Changes to the Core Code needed for PTC upgrade V3.00 -frs + hbu : General cleaning. Tabs to blanks. Remove blanks at eol. Convert any C++ comments to ansi c comments. Fix possible uninitialized variables in madxn.c -new track plot routine, plots are appended to existing ps file -Fixing the limit of the length of 10000 characters for macros (courtesy HG) ============================================================================= madxu.c -simple clean-up -frs + hbu : General cleaning. Tabs to blanks. Remove blanks at eol. Convert any C++ comments to ansi c comments. Fix possible uninitialized variables in madxn.c -Fix of install bug (courtesy HG) ============================================================================= makethin.c -compound_expr moved from madxn.c to makethin.c as only used here and increased precision sprintf(tmp, "%e" -> sprintf(tmp, "%.14g" -additional check in set_selected_elements() that current_sequ is not NULL -frs + hbu : General cleaning. Tabs to blanks. Remove blanks at eol. Convert any C++ comments to ansi c comments. Fix possible uninitialized variables in madxn.c -improved selection -code for select,flag=makethin rewrittes, with class, range and pattern ============================================================================= matchc.c -simple clean-up -frs + hbu : General cleaning. Tabs to blanks. Remove blanks at eol. Convert any C++ comments to ansi c comments. Fix possible uninitialized variables in madxn.c ============================================================================= photoni.inc -New routine needed for Frank's quadrupole radiation in ptc_track ============================================================================= plot.F -The momemtum offset label is not displayed when deltap is the horizzontal axis ============================================================================= plot.fi -simple clean-up ============================================================================= plot_b.fi -simple clean-up ============================================================================= user2_photon.f90, poisson.F -New routine needed for Frank's quadrupole radiation in ptc_track ============================================================================= resindex.fi -simple clean-up ============================================================================= -simple clean-up -frs + hbu : General cleaning. Tabs to blanks. Remove blanks at eol. Convert any C++ comments to ansi c comments. Fix possible uninitialized variables in madxn.c -Fixing the limit of the length of 10000 characters for macros (courtesy HG) ============================================================================= timel.c -simple clean-up -frs + hbu : General cleaning. Tabs to blanks. Remove blanks at eol. Convert any C++ comments to ansi c comments. Fix possible uninitialized variables in madxn.c ============================================================================= touschek.F -simple clean-up ============================================================================= trrun.F -simple clean-up -Fix bug introduced to upgrade dynap -Made TRRUN consistent with new version of DYNAP: removed switch=3, which was never active, and added Lyapunov calculation to switch=2. ============================================================================= wrap.f90 -Mods needed for the ptc_twiss upgrade and the new ptc_track module =============================================================================

MAD-X version 2.13.09: 09.03.2005


Overview:

1) New Touscheck module (CM & FZ) 2) Hamiltonian terms from the ptc_normal module put into TFS table (Td'A) 3) Orbit correction: Changes to orbit correction: setcorr and input of external file (WH) 4) Error module (WH): - Changes to correction factor in EFCOMP as requested by Massimo - Additional routines to read errors from ESAVE: seterror command 5) Aperture Module (Ivar Iwaarum): Various changes 6) Improved "readtable" command (WH) 7) New "dipedge" element in trrun & twiss module: this allows to track (thin lens) through all systems that can be described with MAD-X except higher order non-symplectic terms. (AV & FS) 8) Deselect command for twiss tables (HG) 9) Include tilt of various elements into the survey module (FT) 10) Complete clean-up of all Fortan77 & C routines to produce code compliant with Fortran and C standards, suppress all warnings from compilers with strict checking, unless acceptable (E.g. unused variables due to include files) 10) Various bug fixes. Special thanks to Hans Grote for correcting some tricky ones!

All changes for each file:

============================================================================= Makefile - add resindex dependence + touschek typo ============================================================================= Makefile.bat - naming bug of resindex.F - Reintroduce location of proper .h files for CL compiler - drop Include add resindex ============================================================================= Makefile_develop - Fix bad link static flag "-static" by the proper "-Bstatic" one - fully for testing now - This development Makefile makes the most stringent tests both Fortran & C - add resindex subroutine - Produce static executables ============================================================================= madX/c6t.c - avoid possible undefined "tag_element" & automatic indent ============================================================================= dynap.F - Fortran clean-up with mymod, f2c, lf95, f95 ============================================================================= emit.F - In routine emdamp bv0 was uninitialized - Fortran clean-up with mymod, f2c, lf95, f95 ============================================================================= gxx11.F - Fortran clean-up with mymod, f2c, lf95, f95 ============================================================================= gxx11c.c - solid & dash_list changed from "static unsigned char" to "static char" courtesy HG - get rid of C++ style ============================================================================= gxx11ps.F - Fortran clean-up with mymod, f2c, lf95, f95 ============================================================================= ibsdb.F - minor cleaning - Fortran clean-up with mymod, f2c, lf95, f95 ============================================================================= madx.h - Removed pedantic errors. - Added possibility to give an elements true profile, and its offset w.r.t. a point in space. - Aperture command no longer prints aper1.out as default. - Deselect command for tables (courtesy H.G.) - Repair: 1) multiple negative Lines 2) bug in seq_replace - Add: deselect command (Courtesy HG) - Changes for error, orbit and aperture module - revert Ivar's last changes - Aperture madx.h: Added struct aper_node. madxd.h: Added aperture module function declarations, the aperture table and char aptwfile as global variables. madxdict.h: Added aperture command and aper_tol argument for all elements. madxl.h: Added MAXARRAY definition, racetrack as an apertype, an aperture table definition and added n1 to the Twiss table definition. madxn.c: Added all aperture functions, and made the exec_plot able to print aperture tables. madxp.c: Added call to pro_aperture. ============================================================================= madx_ptc_module.f90 - change to mode definition: qx ==> q1 etc - add Hamiltonian terms to ptc_normal Td'A ============================================================================= madxc.c - Clean up to avoid compiler warnings - Changes to orbit correction: setcorr and input of external file. ============================================================================= madxd.h - Clean up to avoid compiler warnings - Removed pedantic errors. - Added possibility to give an elements true profile, and its offset w.r.t. a point in space. - Aperture command no longer prints aper1.out as default. - Deselect command for tables (courtesy H.G.) - Fortran clean-up with mymod, f2c, lf95, f95 - fix res_index format fix - Repair: 1) multiple negative Lines 2) bug in seq_replace - Add: deselect command (Courtesy HG) - change to mode definition: qx ==> q1 etc - add Hamiltonian terms to ptc_normal Td'A - IWAARUM 07.01.2005: aperture module now supports long file names for Twiss table output. - IWAARUM 06.01.2005: Altered function header of aper_write_table(). - Changes for error, orbit and aperture modules - revert Ivar's last changes - Aperture madx.h: Added struct aper_node. madxd.h: Added aperture module function declarations, the aperture table and char aptwfile as global variables. madxdict.h: Added aperture command and aper_tol argument for all elements. madxl.h: Added MAXARRAY definition, racetrack as an apertype, an aperture table definition and added n1 to the Twiss table definition. madxn.c: Added all aperture functions, and made the exec_plot able to print aperture tables. madxp.c: Added call to pro_aperture. ============================================================================= madxdict.h - introduce Werner's improved readtable - Removed bug due to uppercase/lowercase in offsetelem file. - Added the possibility to assign self-made apertures from external coordinate files. - Removed pedantic errors. - Added possibility to give an elements true profile, and its offset w.r.t. a point in space. - Aperture command no longer prints aper1.out as default. - Deselect command for tables (courtesy H.G.) - Adding a "dipedge" element so as to have all elements available in the thin-lens tracking except second order (non-symplectic) terms. FS & AV - Fortran clean-up with mymod, f2c, lf95, f95 - Changes needed for the touschek module - Repair: 1) multiple negative Lines 2) bug in seq_replace - Add: deselect command (Courtesy HG) - change to mode definition: qx ==> q1 etc - add Hamiltonian terms to ptc_normal Td'A - Changes to error, orbit and aperture modules - New options for errors to allow time memory effects, extern option in orbit correction - revert Ivar's last changes - Aperture madx.h: Added struct aper_node. madxd.h: Added aperture module function declarations, the aperture table and char aptwfile as global variables. madxdict.h: Added aperture command and aper_tol argument for all elements. madxl.h: Added MAXARRAY definition, racetrack as an apertype, an aperture table definition and added n1 to the Twiss table definition. madxn.c: Added all aperture functions, and made the exec_plot able to print aperture tables. madxp.c: Added call to pro_aperture. ============================================================================= madxe. - Clean up to avoid compiler warnings - Changes to correction factor in EFCOMP as requested by Massimo - Additional routines to read errors from ESAVE: seterror command ============================================================================= madxl.h - Removed pedantic errors. - Added possibility to give an elements true profile, and its offset w.r.t. a point in space. - Aperture command no longer prints aper1.out as default. - Changes needed for the touschek module - change to mode definition: qx ==> q1 etc - add Hamiltonian terms to ptc_normal Td'A - IWAARUM 06.01.2005: Cleaned up aperture table. Added n1 in SI units to the aperture table. - Changes for orbit and aperture modules. - Aperture table and additional apertypes - n1 into Twiss table - revert Ivar's last changes - Aperture madx.h: Added struct aper_node. madxd.h: Added aperture module function declarations, the aperture table and char aptwfile as global variables. madxdict.h: Added aperture command and aper_tol argument for all elements. madxl.h: Added MAXARRAY definition, racetrack as an apertype, an aperture table definition and added n1 to the Twiss table definition. madxn.c: Added all aperture functions, and made the exec_plot able to print aperture tables. madxp.c: Added call to pro_aperture. ============================================================================= madxn.c - introduce Werner's improved readtable, further clean-up - letting point "at" of an freshly installed element to the position Courtesy HG - Fix the "no haxis" bug introduced in the clean-up (found by JBJ) - Removed bug due to uppercase/lowercase in offsetelem file. - Added the possibility to assign self-made apertures from external coordinate files. - Suppress unused variables, safeguard potentially uninitialized variables, sanity checks in embedded_twiss, exec_plot & sodd - Removed pedantic errors. - Added possibility to describe an elements true profile, and its offset w.r.t. a point in space. - Deselect command for tables (courtesy H.G.) - Fix of pseudo-crash when an element had been re-installed (with class attribute) in a seqedit - now simply ignored (courtesy HG) - Changes needed for the touschek module - Repair: 1) multiple negative Lines 2) bug in seq_replace - Add: deselect command (Courtesy HG) - change to mode definition: qx ==> q1 etc - add Hamiltonian terms to ptc_normal Td'A - IWAARUM 06.01.2005: No longer uses isnan(). No longer uses strcasecmp() and strncasecmp(). Corrected printing of n1 to Twiss table. Changed ap# to aper_# in aperture table. Removed printing of "node_minimum" line in aperture table. - Added aperture module functions, plot function can plot aperture table - revert Ivar's last changes - Aperture madx.h: Added struct aper_node. madxd.h: Added aperture module function declarations, the aperture table and char aptwfile as global variables. madxdict.h: Added aperture command and aper_tol argument for all elements. madxl.h: Added MAXARRAY definition, racetrack as an apertype, an aperture table definition and added n1 to the Twiss table definition. madxn.c: Added all aperture functions, and made the exec_plot able to print aperture tables. madxp.c: Added call to pro_aperture. ============================================================================= madxp.c - Suppress unused variables, safeguard potentially uninitialized variables, sanity checks in embedded_twiss, exec_plot & sodd - Deselect command for tables (courtesy H.G.) - Repair: 1) multiple negative Lines 2) bug in seq_replace - Add: deselect command (Courtesy HG) - Call to aperture module - revert Ivar's last changes - Aperture madx.h: Added struct aper_node. madxd.h: Added aperture module function declarations, the aperture table and char aptwfile as global variables. madxdict.h: Added aperture command and aper_tol argument for all elements. madxl.h: Added MAXARRAY definition, racetrack as an apertype, an aperture table definition and added n1 to the Twiss table definition. madxn.c: Added all aperture functions, and made the exec_plot able to print aperture tables. madxp.c: Added call to pro_aperture. ============================================================================= madxu.c - Fix of pseudo-crash when an element had been re-installed (with class attribute) in a seqedit - now simply ignored (courtesy HG) ============================================================================= makethin.c - implement element instrument ============================================================================= match. - Fortran clean-up with mymod, f2c, lf95, f95 ============================================================================= matchc.c - Fortran clean-up with mymod, f2c, lf95, f95 ============================================================================= matchsa.F - Fortran clean-up with mymod, f2c, lf95, f95 ============================================================================= orbf.F - Formal changes to satisfy f2c and Fortran90 compatibility ============================================================================= plot.F - Fortran clean-up with mymod, f2c, lf95, f95 - plot_style & plot_symbol have to be defined as integer arrays - bug corrected in plot.F (check of style+symbol in wrong place). Only the first variable was plotted. ============================================================================= plot_math.f - add missing newline ============================================================================= resindex.F - Fortran clean-up with mymod, f2c, lf95, f95 - Finding resonance indices ============================================================================= resindex.fi - Fortran clean-up with mymod, f2c, lf95, f95 - Finding resonance indices ============================================================================= sodd.F - Fortran clean-up with mymod, f2c, lf95, f95 - Fix of mix-up of data and define statements - adjust sodd results to PTC NormalForm by multiplying with multiples of 1000 ============================================================================= survey.F - suelem in util.F returns tilt for all elements (except BEND + MULT with angle=0) - GLOBALTILT takes into account tilt for all elements now - repeated angle initialization taken out ============================================================================= sxf.c - automatic indent ============================================================================= touschek.F - Fortran clean-up with mymod, f2c, lf95, f95 - Well tested touschek module ============================================================================= touschek.f - General input for touschek.F ============================================================================= trrun.F - Adding a "dipedge" element so as to have all elements available in the thin-lens tracking except second order (non-symplectic) terms. FS & AV - Fortran clean-up with mymod, f2c, lf95, f95 - Introduction of dipedge. AV ============================================================================= twiss.F - Adding a "dipedge" element so as to have all elements available in the thin-lens tracking except second order (non-symplectic) terms. FS & AV - Fortran clean-up with mymod, f2c, lf95, f95 - Activating synch_1, synch_2,synch_3,synch_5, first use in touschek - Centre option corrected when closed orbit present ============================================================================= util.F - suelem in util.F returns tilt for all elements (except BEND + MULT with angle=0) - GLOBALTILT takes into account tilt for all elements now - Fortran clean-up with mymod, f2c, lf95, f95 =============================================================================

MAD-X version 2.13: Update-I WH 09.12.2004


error module:
1. allows to add time memory effects to
   field errors, see documentation on
   EFCOMP
2. set errors directly from a file previously
   produced by an ESAVE command

orbit module:
1. set correctors directly from a file 
   produced by a CORRECT command
2. allow correction of orbits read from
   and external file.
3. READMYTABLE as new generic table access
   function.

Aperture Module:
****************

madxn.c:
16 function definitions for the aperture module. 
A change in 
exec_plot allows the PLOT-command to take the argument table=aperture to 
print an aperture table.
Inserted a line in pro_twiss which saves the output filename for the twiss 
table.

madxp.c:
A call to pro_aperture.

madxl.h:
Added racetrack as a possible apertype.
Defined the aperture table.
Added n1 to the Twiss table.

madxd.h:
16 aperture function declarations.
Added char aptwfile as global variable.

madx.h:
New aperture struct declaration.

madxdict.h:
Aperture command definition.
Added aper_tol as a possible argument to all elements.


MAD-X version 2.13: FS 23.11.2004


Summary:
The first step has been done for MAD-X matching with nonlinear terms
from PTC. By the end of the year matching should be operation in the
latest MAD-X version 2.13.

Changes with respect to the previous version listed per modified routine:
=============================================================================
Makefile

-Extra link flag to work under SLC3
=============================================================================
Makefile.bat

-Fix of SET INCLUDE path for stdio.h
=============================================================================
emit.F

-Fix the notorious tilt issues since this was still in the intermediate
state using k0/k0s instead of tilt.
=============================================================================
madx_ptc_module.f90

-nonlinear ptc acquisition -- Td'A
-fixed illegal extension "<>" by ".ne."
-use current index in structure table instead of external indexing
-length instead of dimension in character definition for "string_from_table"

-Allow any rest mass
=============================================================================
madxd.h

-nonlinear ptc acquisition -- Td'A
-use current index in structure table instead of external indexing

-add cf77flush template
=============================================================================
madxdict.h

-nonlinear ptc acquisition -- Td'A
=============================================================================
madxl.h,v

nonlinear ptc acquisition -- Td'A
=============================================================================
madxn.c,v

-fix "read_table" bug (courtesy HG)

-nonlinear ptc acquisition Td'A
-use current index in structure table instead of external indexing

-Two essential select bugs (courtesy HG)
=============================================================================
madxp.c,v

-fix "read_table" bug (courtesy HG)

-nonlinear ptc acquisition Td'A
-use current index in structure table instead of external indexing

-Fix of faulty "resbeam" command  found by EK and fixed courtesy HG
=============================================================================
madxu.c

-C routine cf77flush for flushing unit 6 in C & F subroutines
=============================================================================
plot.F

-fixed 4th argument of comm_para

-attribute 'trackfile' for plot.

-correct treatment of tracking plots for particles for which no tracking is
available.

-check of the zero values of the style & symbole attributes.
=============================================================================
timest.f90

-First timing routine needed for PTC
=============================================================================
timex.f90

-Second timing routine needed for PTC
=============================================================================
trrun.F

-correction of bug in thin multipole focusing. AV
=============================================================================

MAD-X version 2.12: FS 29.09.2004


Summary:
Main new addition is the SODD module added courtesy Eric
d'Amico. Split madxn.c madxu.c into the parser part madxp.c and the
rest back to madxn.c madxu.c (courtesy HG). The parser consists only
of these three routines and the MAD-X header files. This allows to
attach other applications to the MAD-X parser as requested by SLAC and
Cornell. It can read and save (MAD8 format as well!) beams,variables,
elements and sequences. In the routine "control" one can add hooks
for any additional command as required by the parser users. The parser
is provided as an extra program in the binary directory for Linux,
Windows and MAC OS-X.

Changes with respect to the previous version listed per modified routine:
=============================================================================
Makefile

For f90 case timel.c is replace by timest.f90 and timex.f90 to allow for
identical code on Linux and Windows.

Modify Lahey compile flags for version 6.2C

added timel.o (used by Sodd.F routines) in madx_objectsf77.

Actually the flag "-g" makes the code very slow therefore the change is
reverted.

put in -g compile flag for debug which should not slow down code
=============================================================================
Makefile.bat

Using timest.f90 and timex.f90 instead of timel.c for timing to avoid
the missing *.h system files

Trivial Makefile for Windows
=============================================================================
Makefile_develop

For f90 case timel.c is replace by timest.f90 and timex.f90 to allow for
identical code on Linux and Windows.

Add the "sodd" in development Makefile

Adding Helmut Burkhardt's modifications needed for MAC OS10

Simple Makefile for testing and development
=============================================================================
c6t.c

forgotten reset of global variable last_row=0 after usage FS

small bug fixed concerning the special f34 write out

A more general fix of the special f34 write out was needed. It should now
work for thin and thick lattices as well. To this end a new routine:
"my_table_row" had to written that allows to find the table row number
including occurrence count.

Correct special write out on fc.34 (position,name,magnet name magnet type,
betax,betay,mux,muy) for sodd input
=============================================================================
c6t.h

A more general fix of the special f34 write out was needed. It should now
work for thin and thick lattices as well. To this end a new routine:
"my_table_row" had to written that allows to find the table row number
including occurrence count.
=============================================================================
madx_ptc_module.f90

Adding closed orbit correctors strength and dipole errors to the kickers.

minor mods in preparation of CVF Windows version
=============================================================================
madxd.h

Madx Version 2.12

Added sodd command.

Added scatter plot for tracking using gnuplot package
=============================================================================
madxdict.h

Added sodd command.

Added scatter plot for tracking using gnuplot package

=============================================================================
madxl.h

Added sodd command.

Changed int to constant in size of char plot_title & version_title
=============================================================================
madxn.c

Added sodd command.

changed int to constant in size of char plot_title & version_title

1) Added scatter plot for tracking using gnuplot package
2) Adding bv flag to update_element function (courtesy Hans Grote)
=============================================================================
madxu.c

Added sodd command.
=============================================================================
makethin.c

bug fix affecting combined function magnets
=============================================================================
sodd.F

Enlarge by 1 of length of character variable "name_5"
in routine "write_table()"

Changed routine name from error to prror.

Added command sodd.
=============================================================================
trrun.F

Introduction of srot. Preliminary check by HB. AV
=============================================================================
match.F,matchsa.F,plot.F,plot.fi,ptc_dummy.F,survey.F,trrun.F,twiss.F,util.F, 

clean-up & missing implicit none
=============================================================================

MAD-X version 2.11: FS 02.06.2004


Summary:
A) Simultaneous closed correction of 2 beams including common elements.
B) Major memory problem solved concerning malloc & free.
C) Implementing missing dipole edge effects in plot thereby reaching
its final state of development.
D) Using the Lahey f95 compiler: performance and platform portability.
E) Bug fixes

Changes with respect to the previous version listed per modified routine:
=============================================================================
Latest:
-BV flag was left unchanged when an element was updated (Courtesy Hans
Grote)
-The missing SROT was activated in the trrun.F (AV)
-The scatter plot for tracking data was added to the plot module using
gnuplot. This is the final addition to the basic plotting facilities.
=============================================================================
Working file: makethin.c

bug fix affecting combined function magnets
=============================================================================
Working file: madX/emit.F

Dipole contribution had been ignored in the emit module for thin lenses.
Allowing cavity with zero length           in accordance with RA
=============================================================================
Working file: madX/madx.h

Changes for two beam orbit corrections
=============================================================================
Working file: madX/madxc.c

-A few changes to correct for version inconsistencies
-Changes for two beam orbit correction and tilted monitors
=============================================================================
Working file: madX/madxd.h

-Version number 2.11
-Add missing match_i_work variable definition
-Completed fringe fields treatment in the plot module.
-Changes for two beam orbit corrections
-In macros the attribute "table" is now correctly treated (found by WH,
fixed courtesy HG)
=============================================================================
Working file: madX/madxdict.h

-Changes for two beam orbit corrections
-Added ptc & ptc_table attributes to the command plot. This allows plotting
data from twiss tables produced by PTC package.
-Bug fixes in plot module (phase advances by two pi, range,
reset of start & end nodes in pro_embedded_twiss).
-Interpolate attribute instead of spline attribute in plot command.
-No interpolation is now default.
-Added interpolate attribute to setplot command.
=============================================================================
Working file: madX/madxn.c

-The Track module works now with the observe attribute for closed machines. 
-Completed fringe fields treatment in the plot module.
-Setting necessary flags for "damp" & "quantum" tracking   ITEP collaboration
-In macros the attribute "table" is now correctly treated (found by WH,
fixed courtesy HG)
-Bug fixes in plot module (phase advances by two pi, range,
reset of start & end nodes in pro_embedded_twiss).
-Interpolate attribute instead of spline attribute in plot command.
-No interpolation is now default.
-Added interpolate attribute to setplot command.
-Removed a few forgotten _WIN32 compiler directives
=============================================================================
Working file: madX/madxu.c

-Completed fringe fields treatment in the plot module.
-Changed memory offset in MYALLOC and MYCALLOC to avoid
wrong alignment of data structures
-Offset is now 8 bytes (4 bytes before)
-In macros the attribute "table" is now correctly treated (found by WH,
fixed courtesy HG)
=============================================================================
Working file: madX/match.F

Added the 'implicit none' at the beginning of the subroutine. OB
=============================================================================
Working file: madX/matchc.c

Changed the variable type in the 'matchsa' soubroutine call
from 'double_working_array' to 'int_working_array'. OB.
=============================================================================
Working file: madX/matchsa.F

add missing implicit none statements
=============================================================================
Working file: madX/orbf.F

-Added implicit none to PRIMAT and PRDMAT
-Changes and additions for two beam orbit correction
=============================================================================
Working file: madX/plot.F

-The command "implicit none" has been taken out from the file plot.fi and
added to all the subroutines of plot.F which include plot.fi.
-Added ptc & ptc_table attributes to the command plot. This allows plotting
data from twiss tables produced by PTC package.
-Bug fixes in plot module (phase advances by two pi, range,
reset of start & end nodes in pro_embedded_twiss).
-Interpolate attribute instead of spline attribute in plot command.
-No interpolation is now default.
-Added interpolate attribute to setplot command.
-Removed a few forgotten _WIN32 compiler directives
=============================================================================
Working file: madX/plot.fi

-The command "implicit none" has been taken out from the file plot.fi and
added to all the subroutines of plot.F which include plot.fi.
-Bug fixes in plot module (phase advances by two pi, range,
reset of start & end nodes in pro_embedded_twiss).
-Interpolate attribute instead of spline attribute in plot command.
-No interpolation is now default.
-Added interpolate attribute to setplot command.
=============================================================================
Working file: madX/plot_b.fi

Added ptc & ptc_table attributes to the command plot. This allows plotting
data from twiss tables produced by PTC package.
found missing and added                          by FS
=============================================================================
Working file: madX/twiss.F

The "damp" & "quantum" part has been included for the multipoles like in
Mad8. This concludes the first round of of adding "damp" & "quantum" to the
track command.
=============================================================================
Working file: madX/Sa_extend_poly.f90
Working file: madX/Sd_frame.f90
Working file: madX/Se_status.f90
Working file: madX/Sf_def_all_kinds.f90
Working file: madX/Sh_def_kind.f90
Working file: madX/Si_def_element.f90
Working file: madX/Sk_link_list.f90
Working file: madX/Sl_family.f90
Working file: madX/Sm_tracking.f90
Working file: madX/Sn_mad_like.f90
Working file: madX/So_fitting.f90
Working file: madX/Sp_keywords.f90
Working file: madX/a_def_all_kind.inc
Working file: madX/a_def_element_fibre_layout.inc
Working file: madX/a_scratch_size.f90
Working file: madX/h_definition.f90
Working file: madX/i_tpsa.f90
Working file: madX/j_tpsalie.f90
Working file: madX/k_tpsalie_analysis.f90
Working file: madX/l_complex_taylor.f90
Working file: madX/m_real_polymorph.f90
Working file: madX/n_complex_polymorph.f90
Working file: madX/o_tree_element.f90

Etienne's major clean-up
=============================================================================
Working file: madX/Makefile

Changing f95 compiler to Lahey with static link
Nag still available for debugging
=============================================================================

MAD-X version 2.10: FS 27.03.2004

Changes with respect to the previous version:

Additions
*********
-fix of the problem with the "table" attribute in the macro environment
-first minor fix of emit, which still does not work for a thin lens lattices
-linking the plotting to the PTC table ptc_twiss
-"damp" & "quantum" attribute to thinlens tracking in collaboration with ITEP

New Files
*********
-gxx11ps.F & gxx11psc.c needed for PS production on Windows Courtesy Hans Grote
-a_def_arbitrary.inc    PTC arbitrary include file   Courtesy Etienne Forest
-o_tree_element.f90 tree tracking for the new map element Courtesy Etienne Forest

Windows Version
***************
-Taking out compiler directives not needed for Lahey om Windows.
-Windows version of gxx11.F useful to produce ps files  courtesy    HG

PTC
***
-Fixing missing k1 in wedge (now MAD-X has to be fixed!) adding Taylor Map
 (arbitrary Matrix in MAD-X but any order)          Courtesy Etienne Forest
-Watch orbit PTC routines for overflows, officialize thin dipole stuff,
 some clean-up                        courtesy E. Forest
-Watch orbit PTC routines for overflows, officialize thin dipole stuff,
 some clean-up                        courtesy E. Forest
-Monster bug found in PTC concerning solenoids courtesy E. Forest
-(Re)fixing solenoid for the DRIFT-KICK-DRIFT (kind2) mode E.Forest & FS
-Adding range and initial matrix (first go)                           FS

Makefile
********
-Modernize                                          Courtesy Helmut Burkhardt
-gxx11ps.F/gxx11ps_f77.F excluded from compile of all .F

save command
************
-Adding a flatten to the save command if needed               Courtesy H.G.
-fixing all 3 save deficiencies and "no element definition allowed
 in seqedit"                                                   courtesy H.G
-Fixing the q->k1=something problem being ommitted in save     courtesy HG

plot command
************
-Fixing various plotting bugs                                         FS&TdA
-global variables for plot                                           TdA
-plot upgrade, 2 new routines (pro_)embedded_twiss                    TdA
-take out illegal tab
-Element slicing by creation of intermediate nodes.
-Direct use of twiss routines in computing Twiss parameters 
 for these intermediate nodes.
-Table access to Twiss parameters at intermediate nodes.
-Clearing of intermediate nodes on exit of each element.
-Display of momentum spread given in %.                       16.03.2004 TdA
-Fixing the improper resetting of e2 at exit of a rbend 
 (sbend was okay) Courtesy Ed'A

touschek module
***************
-touscheck set-up                                                     FS

match module
************
-Updated the dictionary file to include user defined
 variables for the MATCH routine.                                      OB

twiss module
************
-Allowing fintx (fint at end of bend) to be zero courtesy C.Milardi
-Add the thin_foc flag to supress the 1/(rho**2) focussing term of thin
 dipoles. Needed for compatibility with old LHC lattices.
-correcting warning printout

c6t.c
*****
-fixing faulty variable passing to "create_aperture"                     FS

c_dabnew.f90
************
-Adding da counter

madxc.c
*******
-drop printing of nonexisting variable                                   FS

madxu.c
*******
-fix missing myfree of p_loc in routine grow_table                   TdA
-2 new routines for plotting "interp_node" and "reset_interpolation" TdA
-missing mymalloc in expand_curr_sequ
-"c_node" instead "node" in replace_one in routine seq_replace

timel.c
*******
-syntax error                                                             FS
-Fixing HZ unconditional to 60

MAD-X version 2.00: FS 24.11.2003


Changes in version mad-X 2.00:
=============================

+++++++++++++
Main Changes:
+++++++++++++

1) There is now the first development version of MAD-X including PTC. The binary is madxdev and 
it id compiled in debug mode to find problems fast.
2) Smaller clean-up

+++++++++++++
Changes per
Modules or
file
+++++++++++++


+++++++++++++
Makefile: 
+++++++++++++


1) use default gcc compiler on MacOSX
2) Go to ieee error handling such that the FORTRAN90 madxdev (MAD-X+PTC)
does not stop on infinity. Gives a friendly message about it.
3) Updated file to include compilation of the 'matchsa.F' file. OB
Modification to avoid crash when orbit correction is
attempted without valid twiss_table.
=============================================================================

+++++++++++++
madxdict.h: 
+++++++++++++


1) New Version MAD-X PTC 2.00
2) Added option FULL (true,false=default) to EPRINT command
3) Revert to full version but keep mods of OB
4) Modified file to include 'rmatrix' matching. -> entries for 'match' and
'constraint' key words. OB
5) Dispersion, Tunes, Chromaticities and Anharmonicities to arbitrary Order
=============================================================================

+++++++++++++
madxe.c: 
+++++++++++++


1) Changed factor in printout for field errors for
command EPRINT
2) Changes to EPRINT to allow printout of all elements,
activated with: EPRINT, FULL=TRUE;
=============================================================================

+++++++++++++
madxl.h: 
+++++++++++++


1) Add rectellipse aperture
=============================================================================

+++++++++++++
madxn.c: 
+++++++++++++


1) New Version MAD-X PTC 2.00
2) mu in beta0 now in rad -- courtesy H.G.
3) Reinstallation of the fix to activate the tolerance attribute of TWISS
4) Intermediate restoration however found memory bug to be fixed
5) Added code in routines exec_plot & store_node_value to permit access by the routine peintp in file plot.F to the routines tmbend & tmquad in twiss.F --- E.T. d'Amico
6) Modified file to include 'rmatrix' matching. OB
7) Activate the tolerance attribute of the twiss command it superseeds what
you get from coguess
8) Fixing faulty interpretation of "E" format of attribute deltap of the twiss module courtesy Hans Grote
9) Supress initial message about unknown sequence HG
10) Fix access of unknown pointer HG
=============================================================================

+++++++++++++
madx_ptc_module.f90: 
+++++++++++++

New file for Version MAD-X PTC 2.00
=============================================================================

+++++++++++++
match.F: 
+++++++++++++


1) Modified file to include 'rmatrix' matching and updated the match summary
for matching with more than one sequence file. OB
=============================================================================

+++++++++++++
matchc.c: 
+++++++++++++


1) correction of small format error in fprintf
2) file modified to include 'rmatrix' matching and to update the match summary
for matching with more than one sequence file. OB
=============================================================================

+++++++++++++
matchsa.F: 
+++++++++++++


1) Remove special DOS characters and replace dfloat by dble (FORTRAN90 conflict)
2) New fortran source file for 'simulated annealing' matching. The file has been
prepared by Dobrin Kaltchev. The matching works but one might still run into
problems with TWISS if no stable matrix is found during the matching. OB
=============================================================================

+++++++++++++
plot.F: 
+++++++++++++


1) Accidental switching off of e2 at the end of bends - FS & Ed'A
2) Correct treatment of e2 within dipole.
3) SPLINE atribute is now obsolete for twiss parameters plots. A warning message is issued if used.Twiss parameters plots are now always interpolated.
4) Zeroing uninitialize variables
=============================================================================

+++++++++++++
ptc_dummy.F: 
+++++++++++++


New file for Version MAD-X PTC 2.00
=============================================================================

+++++++++++++
ptc_input.f90: 
+++++++++++++


1) not needed for New Version MAD-X PTC 2.00
2) frame/chart/patch flags commented
3) Fixing cavity handling in the MAD-X PTC combination
=============================================================================

+++++++++++++
ptc_normal.f90: 
+++++++++++++


1) not needed for New Version MAD-X PTC 2.00
2) Fixing cavity handling in the MAD-X PTC combination
3) Dispersion, Tunes, Chromaticities and Anharmonicities to arbitrary Order
=============================================================================

+++++++++++++
ptc_twiss.f90: 
+++++++++++++


1) not needed for New Version MAD-X PTC 2.00
2)Fixing cavity handling in the MAD-X PTC combination
=============================================================================

+++++++++++++
set_para.f90: 
+++++++++++++


not needed for New Version MAD-X PTC 2.00
=============================================================================

+++++++++++++
trrun.F: 
+++++++++++++


Introduction of rectellipse in tracking. AV
=============================================================================

+++++++++++++
ttwm_dum.F: 
+++++++++++++


not needed for New Version MAD-X PTC 2.00
=============================================================================

+++++++++++++
twiss.F: 
+++++++++++++


1) Transfer maps of lines are were evaluated as for rings FS & CM (Frascati)
2) Zeroing uninitialize variables
3) When using the centre option the misalignment was not properly handled in
the center of the element, although it was done properly when reaching the
end of the element.  Found by WH.
=============================================================================

+++++++++++++
u1_twiss.f90: 
+++++++++++++


not needed for New Version MAD-X PTC 2.00
=============================================================================

+++++++++++++
wrap.f90: 
+++++++++++++


New files for Version MAD-X PTC 2.00
=============================================================================

+++++++++++++
zza_keywords.f90: 
+++++++++++++


Small upgrade to remove unnecessary stuff
=============================================================================

MAD-X version 1.12: FS 04.07.2003

Changes with respect to the previous version:

Changes in version mad-X 1.12:
=============================

++++++++
Changes:
++++++++

1) Safeguard free to avoid "segmentation faults" using "myfree"
2) orbf.F: Changes to allow correction to target orbit.
Remove unused and uninitialized variable lgfile.
3) Fixing position matching
4) SXF mods to protect against loose user input:
-when the position is missing, it is inserted directly behind the preceding
element, like for a LINE.
-If a bend does have "arc" undefined it uses "l" as length.
Courtesy of Hans Grote.
5) Clean-up and Windows Version Compatibility
6) Remove command EFIELD from dictionary madxdict.h
7) We had an old value of the "Unified Atomic Mass Unit", spotted by J. Jowett.
8) Element lengths had to be defined before the definition of the element,
i.e. concerning length the ":=" operator did not function properly.
Detected by AV solved by HG
9) If a one or both plains are unstable you now get the
"cosmux,cosmuy" for evaluation and a warning instead of a program
exit.
10) orbf.F: Changes to allow correction to target orbit.
Remove unused and uninitialized variable lgfile.
11) New set command
  a) variable format of printout
  b) select current sequence 
12) Change beam command on request:
for ion only:
  a) give total energy
  b) use mass & charge
  c) attribute nucleon suppressed 
13) Adding arbitrary matrix element twiss, thintrack & makethin 
14) Fix plot problem of variables starting with 'r' which had been
stripped.
15) Slicing of solenoid
16) New free in the orbit part plus minor clean-up.
17) When "Cycle"ing the machine internally a marker was created with a 
separate name. However, when using "save" afterwards 2 identical
markers were defined causing a crash.
18) Obsolete options removed for TRACK and DYNAP / AV
19) A faulty "free" caused the "remove of ranges" to fail.
=============================================================================

MAD-X version 1.11: FS 26.04.2003

Changes with respect to the previous version:

Changes in version mad-X 1.11:
=============================

+++++++++++++
Main Changes:
+++++++++++++

1) Introduce missing stability check in the vertical plane (AV&FS).
2) Introduce missing aperture attributes when saving to a file (HB).
3) Problem solved with the plot module, i.e. due the change from
"k0/k0s" to "angle/tilt" the info about bends was missing such that 
the figures of the dispersion displayed nasty and unphysical kinks (Td'A&FS).
4) PC version it became necessary to drop trailing blanks and special
characters from all files. All ".f" had to renamed ".F" to allow precompiling
with compiler directives (JJ&FS).
5) A very first and still buggy PC version is available (JJ). However, checks
have been done to verify that LINUX version still works fine (WH&FS).

+++++++++++++
Changes per
Modules or
file
+++++++++++++

+++++++++++++
c6t: 
+++++++++++++

fixed segmentation fault which was due to a faulty free-ing of object that
had already been freed before
=============================================================================

+++++++++++++
madxc.c: 
+++++++++++++

-Change to fextim
-Routine ftime replaced in fextim.
-Changes to comply with new format of make_table
=============================================================================

+++++++++++++
madxd.h:
+++++++++++++

-fatal error -> warning for multiple def. in sequ.
-print bpm name in threader routine
-remove names of lines from list of lines to allow thin lens expansion (ti8 problem)
=============================================================================

+++++++++++++
madxdict.h:
+++++++++++++

TWISS docu clean-up
=============================================================================

+++++++++++++
madxe.c:
+++++++++++++

-Changed order of columns in ESAVE
-New version of ESAVE, prints now alignment errors as well as field errors
=============================================================================

+++++++++++++
madxl.h:
+++++++++++++

-Fix order of vraiables in efield table
- Memory Leak clean-up
- Reduce table size to the minimum necessary HG & FS
-Changed order of columns for ESAVE
-Remove usage of k0 + k0s for dipole
-Fix bug in twiss table (bv flag error at angle and k0,
                        angle contained length_square)
-Changes to EFIELD table definition used by ESAVE
=============================================================================

+++++++++++++
madxn.c:
+++++++++++++

-fix in update_element, avoids loss of information in writing a sequence
-TWISS docu clean-up
-Fixed another serious "segmentation fault" due to a faulty free. Thanks to HG
-Fixed a bug that crashed the program when putting apertures in a twiss table.
-The margin for the table size had been chosen slightly too small.
-An attempted fix for a free leak caused serious problems with lines and had to be removed.
-Memory Leak clean-up
-Reduce table size to the minimum necessary HG & FS
-Keep k0 & k0s to be read in. "Angle" remains master
-Remove usage of k0 + k0s for dipole
-Fix bug in twiss table (bv flag error at angle and k0,
                        angle contained length_square)
-fatal error -> warning for multiple def. in sequ.
-print bpm name in threader routine
-remove names of lines from list of lines to allow thin lens expansion (ti8 problem)
=============================================================================

+++++++++++++
madxu.c:
+++++++++++++

-Fixed another serious "segmentation fault" due to a faulty free. Thanks to HG
-Memory Leak clean-up
-Reduce table size to the minimum necessary HG & FS
-fatal error -> warning for multiple def. in sequ.
-print bpm name in threader routine
-remove names of lines from list of lines to allow thin lens expansion (ti8 problem)
=============================================================================

makethin.c:
-fatal error -> warning for multiple def. in sequ.
-print bpm name in threader routine
-remove names of lines from list of lines to allow thin lens expansion (ti8 problem)
=============================================================================

plot.F:
use angle&tilt instead of k0l&k0sl since the later are no longer calculated
from the former in madxn.c
=============================================================================

survey.F:
correction of angle for output with dipole_bv
=============================================================================

+++++++++++++
sxf.c:
+++++++++++++

-fatal error -> warning for multiple def. in sequ.
-print bpm name in threader routine
-remove names of lines from list of lines to allow thin lens expansion (ti8 problem)
=============================================================================

+++++++++++++
trrun.F:
+++++++++++++

-drop prints and suppress nn=24 AV+FS
-Tilt implemented in tracking. Tested on simple example. AV
-Apertures for all elements but drifts (AV).
-Clean-up of dimensions + introduction of initialisations (FS+AV)
=============================================================================

+++++++++++++
twiss.F:
+++++++++++++

-Stability check for the vertical plane was faulty (bug detected courtesy
André Verdier)
-TWISS docu clean-up
-fatal error -> warning for multiple def. in sequ.
-print bpm name in threader routine
-remove names of lines from list of lines to allow thin lens expansion (ti8 problem)
-Clean-up of dimensions + introduction of initialisations (FS+AV)
=============================================================================

+++++++++++++
twtrr.fi
+++++++++++++

-Clean-up of dimensions + introduction of initialisations (FS+AV)
=============================================================================

+++++++++++++
util.F:
+++++++++++++

-Clean-up of dimensions + introduction of initialisations (FS+AV)
=============================================================================

MAD-X version 1.10: HG & FS 20.01.2003

Changes with respect to the previous version:

Changes in version mad-X 1.10:
=============================

New commands:

coguess,x=..,px=..,y=..,py=..,t=..,pt=..,tolerance=..;

introduces the user's guess of the closed orbit start; it will be
used for all subsequent TWISS executions.
tolerance is the maximum error (in any component) for the closed
orbit convergence test (default = 1.e-6).

threader,vector={xmax,ymax,att}; defaults: {5.e-3,5.e-3,1.}

sets the parameters for the threader (see below).
xmax, ymax: orbit excursion (at a monitor) at which threader acts;
att       : attenuation factor for the kicks applied by the threader.

New command parameters:

twiss,keeporbit,useorbit;
match,useorbit;

The keeporbit (with an optional name, keeporbit=name) stores the orbit
under this name at the start, and at all monitors.

useorbit (with an optional name, useorbit=name) uses the start value
provided for the closed orbit search; the values at the monitors are
used by the threader (see below).

match,useorbit;

transfers the useorbit request to the Twiss module.

option,threader;

When set, the threader checks at all monitors the difference with
respect to the stored orbit there (from keeporbit) if useorbit is
present. The threader then provides kicks (if possible) to reduce
the orbit difference below the maxima specified on the threader
command. This procedure allows to thread with orbit bumps present.

save,class=..,pattern="..";

The save command without sequence specification saves all sequences
present, their elements, and their variables (this is not new).
When a class is specified in addition, all saved elements must belong
to that class; when a pattern is specified, the names of all
sequences, elements, and variables saved must match the regular
expression provided. Example: the user want to save all variables
containing the string"mb", and only those, i.e. no elements:

save,class=nonesuch,pattern="mb.*";

beam,particle=ion,nucleon=..;

The ion has the following effect:
the total mass is set to nucleon (a real number) * nmass (an average
nucleon mass); the total energy is set to charge * beam_energy.
See as well the IBS module documentation.

MAD-X version 1.09: FS 09.12.2002

Changes with respect to the previous version:


New Developments and Important Fixes:
*************************************

A) New SXF Module:
------------------

Introduction of the SXF module - reading and writing SXF files  - HG 4.12.02

B) Tilt restored:
-----------------

Tilt restored, global tilt introduced in Twiss and Survey Module

C) MadX SixTrack Convertor:
---------------------------

a) Fixed bug allowing evaluation of expressions for aperture parameter.

b) A vertical field error is no longer treated as a vertical kicker. The same
cure is used as for the horizontal case.

c) fixed two problems:
1. missing last component of a (skew) multipole.
2. multipoles with dipole component are now correctly split with the b1 
component listed in the fc.2 file. (altered subroutine pre_multipole)

d) Kickers are now converted properly MH & FS

e) Addition of tilt to sixtrack input. (MH+FRS)

f) Minor formatting changes to remove superfluous comments.

g) Addition of tilt_err flag (MH+FRS).

D) Important Add-Ons:
---------------------

1. Access to multipole components from the command line:  
   name->k0l, name->k0sl etc.

2. Addition of variables to (any internal) table:
   select,flag=table,column=name,s,betx,...,var1,var2,...; ot
   select,flag=table,full,column=var1,var2,...; ! default col.s + new
   will write the current value of var1 etc. into the table each trime
   a new line is added; values from the same (current) line can be
   accessed by these variables, e.g.
   var1:= sqrt(beam->ex*table(twiss,betx));
   in the case of table above being "twiss". The plot command accepts
   the new variables.
   Remark: this replaces the "string" variables of MAD-8

3. User-defined tables:
   create,table=name,column=var1,var2,...;
   creates a table with the columns specified.
   fill,table=name;
   adds one line to the table with the current values of var1 etc.
   write,table=name{,file=filename};  ! {} means "optional"
   will write the table in TFS format onto the file or, if missing,
   onto standard output.
   Remark: this replaces the "push" etc. commands of MAD-8

   HG 9.12.2002


Fixes and Minor Improvements:
*****************************

a) Fixing bug in match range - HG 22.11.2002

b) Added a working array in the 'mtmigr' function definition.

c) Introduced advertised defaults for  and  for plot module

d) Tolerance changed into maxaper for tracking and dynap AV+FS

e) Bug fix in tracking: deltap on TRACK command now transmitted
INFO from TWISS suppressed if called from matching  -  HG 20.11.02

f) modified slicer to copy tilt parameter across again.

g) Slicer: Fixed LRAD bug. Because of default l=0 the lrad was always 
being overwritten by the length when sliced (it assumed the user had asked 
for a length=0 element). NEW DEFAULT: any object with length=0 is just 
copied to the thin sequence and not "sliced". i.e. magnetic elements are 
only converted to thin_mutipoles if they have a length. If they have no 
length they retain their original type. (i.e. l=0 sextupoles remain 
sextupoles).

h) Introduction of character string length of names for all Fortran modules. 
(AV&FS)

i) Modified the working array numbers for 'symeig' subroutine.

j) Added a working array for the MIGRAT routine.

k) SUELEM, SUMTRX AND SUTRAN moved to util.f (used also in twiss). AV+FS

l) Misalignment of apertures introduced. AV

m) Dimension of al_errors changes to 14. It compiles. No other test. AV

n) Tolerance changed into maxaper AV+FS

o) Accidental FORTRAN90 feature found in FORTRAN77 subroutine charconv: "<" instead of ".lt."

p) Cleanup of Unix Incosistencies:
darwin (MacOS compatibility);consistency of unix header files;
hbu include unistd.h for sleep;hbu include stdlib.h for getenv;
hbu replace old ftime by gettimeofday for newer gnu compilers;
hbu consistency of include for unix header files

MAD-X version 1.08: FS 18.11.2002

Changes with respect to the previous version:

New Features:
-------------

-Added emit code

-Added tilt element parameter, mods in twiss + twiss output file

-Introduction of globaltilt to align the quadrupoles

-Added SXF file export - HG 7.11.02

-Removing drifts from line SAVE

-Added filename + extension for track files

-Added range to TWISS and MATCH

-Added SIGT to twiss file header                  -  HG 14.11.02

-Windows Version in progress:
#ifndef exclusion of body of exec-plot is a temporary fix so that
the WIN32 version does not try to do X11 graphics.
However this has the consequence that the program will not
make Postscript files either.  HG will make a clean separation of
these  graphics functions later. (JMJ).  With this change the WIN32
version now compiles but does not yet link.

-Introducing _WIN32 flag  - HG 6.11.02

-add current_eopt command to allow the show command to show the updated eoption(s)

-Error module:
Changes to allow assignment of relative errors to multipoles with
only skew components, this requires a NEGATIVE radius

Bugs Fixes and minor Changes:
----------------------------- 

-Communicates maxmul parameter between twiss and trrun.

-In the call suelem the 4th passed variable was missing.

-Fixed bug in trrun (buffer with max. number of particles)  HG 22.10.02

-Changed template for trrun AV & FS

-Fixed bug in trrun (buffer with max. number of particles)  HG 22.10.02

-Restoring the definition of el in ttrf AV & FS

-Fixed minor typo in track_run and track_dynap. Print message when exiting the
track module. This helps to avoid confusion since before after a missing start
command nothing was written at all.

-Marguerite introduced and tested on single element.

-Correction of Phi and Psi. Yet to be tested on transfer lines. AV

-atan2 removed from survey FS & AV

-changed thin creation to allow inheritance of the aperture parameter correctly.

-Fixing missing k0 in SAVE

-Replacing min and max by mymin and mymax

-Introducing _WIN32 flag  - HG 6.11.02

-Fixed buf_dxt, buf_dyt for both track_dynap and track_run which call trrun AV & FS

-Increased number of dp numbers to 100000000

-Introduced _WINDOWS_ compile flag - HG 29.10.02

-Fixed bug in table value evaluation - HG 21.10.02

-Fixed bug in write_nice (SAVE output) - HG 17.10.02

-Fixed bug in seqedit INSTALL (simultaneous element definition)

-Fixed trivial bug in expression list copy routine -

-Removing second level of includes in c6t.c,

-moved include of c6t.h to madxn.c (JMJ).

-Fixed trivial bug in expression list copy routine -

-Clean-up of emit.f and madxdict.h                 -  HG 28.10.02

-Fixing output format of SAVE statement

-Fixing missing k0 in SAVE

-Replacing min and max by mymin and mymax

-Fixed bug in sectormap file creation - HG 3.11.02

-Fixed trivial bug in expression list copy routine -

-Fixed bug in special command check - HG 8.11.02

-Removing second level of includes in c6t.c,

-moved include of c6t.h to madxn.c (JMJ).

-Fixing output format of SAVE statement

MAD-X version 1.06: FS 16.10.2002

Changes with respect to the previous version:

New command MONCUT in correction module
Addition of EMIT module - HG 15.10.02
Correction of RF cavity map
Correction in drift slicing
Additions to track tables
Estetics in slicer MH

MAD-X version 1.05: HG 25.9.2002

Changes with respect to the previous version:

SURVEY:
correction of multipole treatment, various small mods.

ORBIT CORRECTION:
Orbit correction module changed to make 3 algorithms
available: MICADO, LSQ (Least Squares correction) and
SVD (Singular Value Decomposition). Selected with MODE
option in the CORRECT command.
The latter technique can optionally be used to configure
the response matrix for MICADO or LSQ to avoid bumps
and unphysical corrector strengths. Selected with
COND=1 option in the CORRECT command.
Highly recommended: read the forthcoming report before
use.

New sample job to create footprints for LHC: HG 18.9.2002

/afs/cern.ch/group/si/slap/share/mad-X/test_suite/foot/V1.04/footprint.mad

Creates a footprint for head-on + parasitic collisions at IP1+5 
of lhc.6.4; both lhcb1 (for tracking) and lhcb2 (to define the
beam-beam elements, i.e. weak-strong) are used; there are flags to
select head-on, left, and right parasitic separately at all IPs.
The bunch spacing can be given in nanosec and automatically creates
the beam-beam interaction points at the correct positions.
It is important to set the correct BEAM parameters, i.e. number
of particles, emittances, bunch length, energy.

The output file "footprint" can be viewed with gnuplot:

gnuplot
plot "footprint" w l