source: PSPA/madxPSPA/src/mad_gvar.h @ 447

Last change on this file since 447 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 17.1 KB
Line 
1#ifndef MAD_GVAR_H
2#define MAD_GVAR_H
3
4/* Temporary file: global variables
5   these variables will be split over their respective modules...
6*/
7
8extern int debuglevel;
9
10/* Global structure variables by type (alphabetic) */
11
12extern struct char_array* aux_buff;       /* temporary buffer for many purposes */
13extern struct char_array* c_dum;
14extern struct char_array* c_join;
15extern struct char_array* work;
16extern struct char_array* l_wrk;
17
18extern struct char_array_list* char_buff; /* buffer for all sorts of strings */
19
20extern struct char_p_array* tmp_p_array;  /* temporary buffer for splits */
21extern struct char_p_array* tmp_l_array;  /* temporary buffer for special commands */
22extern struct char_p_array* line_buffer;  /* buffer for line expansion */
23
24extern struct command* current_beam;    /* current reference beam */
25extern struct command* probe_beam;      /* current beam */
26extern struct command* options;         /* current options */
27extern struct command* plot_options;    /* current plot options */
28extern struct command* current_error;   /* current error command */
29extern struct command* current_correct; /* current correct command */
30extern struct command* current_ibs;     /* current ibs command */
31extern struct command* current_touschek;/* current touschek command */
32extern struct command* current_survey;  /* current survey command */
33extern struct command* current_ptc;     /* current ptc command */
34extern struct command* current_twiss;   /* current twiss command */
35extern struct command* current_command; /* current command clone */
36extern struct command* current_gweight; /* current gweight clone */
37extern struct command* current_weight;  /* current weight clone */
38extern struct command* current_match;   /* current match comm. */
39extern struct command* current_eopt ;   /* to keep eoption command */
40extern struct command* threader_par ;   /* threader parameters */
41
42extern struct command_list* beam_list;         /* list of all beam commands */
43extern struct command_list* beta0_list;        /* list of user defined beta0s */
44extern struct command_list* defined_commands;  /* from dictionary */
45extern struct command_list* error_select;      /* current error select commands */
46extern struct command_list* optics_select;     /* current optics select commands */
47extern struct command_list* optics_list;       /* list of optics command/sequence */
48extern struct command_list* savebeta_list;
49extern struct command_list* seqedit_select;    /* current seqedit select commands */
50extern struct command_list* save_select;       /* current save select commands */
51extern struct command_list* slice_select;      /* current slice select commands */
52extern struct command_list* stored_commands;   /* list of stored commands */
53extern struct command_list* stored_match_var;  /* list of match vary commands */
54extern struct command_list* stored_track_start;/* list of track start commands */
55extern struct command_list* sector_select;     /* current sectormap select commands */
56
57extern struct command_list_list* table_deselect; /* list of table deselect lists */
58extern struct command_list_list* table_select; /* list of all table select lists */
59
60extern struct constraint_list* comm_constraints; /* for each constraint command */
61extern struct double_array* cat_doubles;    /* Polish: constant values */
62extern struct double_array* doubles;        /* doubles buffer */
63extern struct double_array* twiss_deltas;   /* for deltap loop in twiss command */
64extern struct double_array* vary_vect;      /* for matching */
65extern struct double_array* vary_dvect;     /* for matching */
66extern struct double_array* fun_vect;       /* for matching */
67extern struct double_array* match_work[MATCH_WORK];/* work space for matching */
68
69extern struct el_list* drift_list;
70extern struct el_list* element_list;
71extern struct el_list* base_type_list;
72extern struct el_list* selected_elements;
73
74extern struct expression* backup_expr;
75
76extern struct in_buff_list* in;      /* list of all active input buffers */
77extern struct in_buff_list* pro;     /* list of active processing buffers */
78
79extern struct int_array* deco;       /* Polish: coded expression */
80extern struct int_array* cat;        /* Polish: catgories */
81extern struct int_array* d_var;      /* Polish: variable references */
82extern struct int_array* oper;       /* Polish: operator references */
83extern struct int_array* func;       /* Polish: function references */
84extern struct int_array* s_range;    /* starts of ranges */
85extern struct int_array* e_range;    /* ends of ranges */
86extern struct int_array* sd_range;   /* starts of deselect ranges */
87extern struct int_array* ed_range;   /* ends of deselect ranges */
88extern struct int_array* match_i_work[MATCH_WORK];  /* int work space for matching */
89
90extern struct in_cmd* this_cmd;      /* contains command just read */
91extern struct in_cmd* local_twiss[2];
92extern struct in_cmd* embedded_twiss_cmd; /* current plot command */
93
94extern struct in_cmd_list* buffered_cmds;
95
96extern struct macro_list* line_list;
97extern struct macro_list* macro_list;
98
99extern struct name_list* expr_chunks;
100extern struct name_list* occ_list;
101extern struct name_list* sxf_list;
102
103extern struct node* prev_node;
104extern struct node* current_node;
105extern struct node* debug_node;
106
107extern struct node_list* selected_ranges; /* filled by some select commands */
108extern struct node_list* sector_ranges;   /* filled by the sectormap select command */
109
110extern struct sequence* current_sequ;  /* pointer to currently used sequence */
111extern struct sequence* edit_sequ;     /* pointer to sequence being edited */
112
113extern struct sequence_list* sequences;    /* pointer to sequence list */
114extern struct sequence_list* match_sequs;  /* pointer to sequence list for match */
115
116extern struct table* aperture_table;     /* current aperture table */
117extern struct table* ibs_table;          /* current ibs table */
118extern struct table* touschek_table;     /* current touschek table */
119extern struct table* summ_table;         /* current twiss summary table */
120extern struct table* twiss_table;        /* current twiss table */
121extern struct table* twiss_table_beam1;  /* current twiss table beam1 */
122extern struct table* twiss_table_beam2;  /* current twiss table beam2 */
123extern struct table* twiss_sector_table; /* used for sectormap */
124extern struct table* ptc_twiss_summary_table; /* holds summary data after one turn */
125extern struct table* map_table;          /* added for twiss_input_table */
126extern struct table_list* table_register;
127extern struct table_list* moments_tables;/* tables for moments */
128
129extern struct table* embedded_twiss_table;/* current twiss table */
130extern struct table* normal_results;     /* ptc table containing the selected high order functions (such as dx,qx,anhx etc.) */
131
132extern struct table* errors_dipole;
133extern struct table* errors_field;
134extern struct table* errors_total;
135extern struct table* errors_read;        /* table needed for IO of errors with PTC */
136
137extern struct table* survey_table;       /* current survey table */
138extern struct table* corr_table;         /* corrector table after orbit correction */
139extern struct table* corr_table1;        /* corrector table after orbit correction, beam 1 for two rings */
140extern struct table* corr_table2;        /* corrector table after orbit correction, beam 2 for two rings */
141extern struct table* mon_table;          /* monitor table after orbit correction */
142extern struct table* orbit_table;        /* orbit positions at monitors */
143extern struct table* sodd_table_70;      /* sodd output table detune_1_end */
144extern struct table* sodd_table_71;      /* sodd output table detune_1_all */
145extern struct table* sodd_table_72;      /* sodd output table detune_2_end */
146extern struct table* sodd_table_73;      /* sodd output table detune_2_all */
147extern struct table* sodd_table_74;      /* sodd output table distort_1_f_end */
148extern struct table* sodd_table_75;      /* sodd output table distort_1_h_end */
149extern struct table* sodd_table_76;      /* sodd output table distort_1_f_all */
150extern struct table* sodd_table_77;      /* sodd output table distort_1_h_all */
151extern struct table* sodd_table_78;      /* sodd output table distort_2_f_end */
152extern struct table* sodd_table_79;      /* sodd output table distort_2_h_end */
153extern struct table* target_table;       /* current target table */
154extern struct table* model_table;        /* current model table */
155extern struct table* orbin_table;        /* current orbit table */
156
157
158extern struct table_list* optics_tables; /* contains optics tables from last twiss */
159extern struct table_list* table_register; /* contains all tables */
160
161extern struct table_list_list* all_table_lists; /* all table lists are entered here */
162
163extern struct variable* current_variable; /* set by act_value (table access) */
164extern struct var_list* variable_list;
165
166extern struct orb_cor*  correct_orbit;   /* information and links for orbit correction */
167extern struct orb_cor2* correct_orbit1;  /* information and links for orbit correction */
168extern struct orb_cor2* correct_orbit2;  /* information and links for orbit correction */
169extern struct orb_cor2* correct_orbit12; /* information and links for orbit correction */
170
171extern double corrl;                  /* global limit for orbit corrector strength  */
172
173extern struct table* efield_table;    /* field errors in table form  */
174extern FILE* fddata;
175extern FILE* fcdata;
176extern FILE* ftdata;
177extern FILE* fgdata;
178
179extern struct char_p_array* sdds_pat; /* array for selected sdds patterns */
180
181extern FILE* debug_file;              /* for debug output */
182extern FILE* stamp_file;              /* for debug output */
183extern FILE* out_file;                /* for table output */
184extern FILE* prt_file;                /* for echo output */
185extern FILE* sec_file;                /* for sector output in "embedded" twiss */
186extern FILE* tab_file;                /* for table input */
187
188/* Global simple variables by type */
189
190extern char quote;                      /* current open single or double quote */
191extern char int_format[20],             /* current integer format */
192            float_format[20],           /* current float format */
193            string_format[20];          /* current string format */
194extern char var_form[1000];             /* buffer for the user-controlled formats */
195extern char blank[];
196extern char none[];
197extern char one_string[];
198extern char aptwfile[FNAME_L];
199extern char* aux_char_pt;               /* for debug purposes */
200extern char* exx;
201extern char* current_link_group;
202extern char* current_range;             /* currently used range, or NULL */
203extern char* title;
204extern char* match_seqs[2];
205extern char* match_beta[2];
206extern char* match_range[2];
207extern char* track_filename;            /* track module file name start */
208extern char* track_fileext;             /* track module file name extension */
209extern char  track_plot_filename[NAME_L];/* plot module: output postscript file name in track mode */
210
211extern double pi, twopi, degrad, raddeg, e, clight, hbar;
212extern double penalty;
213extern double match_tol;
214extern double orbit0[6];
215extern double disp0[6];
216extern double sxf_suml;   
217extern double track_deltap;
218extern double oneturnmat[36];
219extern double fintx_plot;    /* to save the value of fintx for the reset_interpolation routine */
220
221extern const double zero;
222extern const double one;
223extern const double two;
224extern const double ten_p_3;
225extern const double ten_p_6;
226extern const double ten_p_9;
227extern const double ten_p_12;
228extern const double ten_m_3;
229extern const double ten_m_6;
230extern const double ten_m_9;
231extern const double ten_m_12;
232extern const double ten_m_15;
233extern const double ten_m_16;
234extern const double ten_m_19;
235
236extern int add_error_opt;          /* ADD error option, set with eoption */
237extern int backup_type;
238
239extern int embedded_flag;          /* flag (= 1 when entering routine pro_embedded_twiss, 0 at exit) */
240extern int min_order;              /* minimum required order */
241extern int print_correct_opt;      /* PRINT options for orbit correction */
242extern int debug_correct_opt;      /* DEBUG options for orbit correction */
243extern int assign_start;           /* flag for multiple assign statements */
244extern int aux_count;              /* for debug purposes */
245extern int beam_info;              /* flag to print beam information once */
246extern int c_range_end;            /* node count of current range end */
247extern int c_range_start;          /* node count of current range start */
248extern int curr_obs_points;        /* current number of observation points */
249extern int current_calls;          /* call counter in match */
250extern int current_call_lim;       /* current call limit in match */
251extern int current_const;          /* current constraint number in match */
252extern int default_beam_saved;     /* flag to avoid multiple save of default beam */
253extern int edit_is_on;             /* != 0 if inside current sequence edit */
254extern int final_message;          /* set to 1 when end message written */
255extern int group_is_on;            /* true when inside group */
256extern int guess_flag;             /* != 0 if coguess read */
257extern int in_stop;                /* input buffer stop flag */
258extern int inbuf_level;            /* input buffer level */
259extern int init_warn;              /* intialisation warning level */
260extern int interactive;            /* non-zero if interactive */
261extern int irn_rand[NR_RAND];      /* for random generator */
262extern int keep_tw_print;          /* previous twiss print flag (match) */
263extern int loop_cnt;               /* used to detect infinite loops */
264extern int match_calls;            /* command call limit in match */
265extern int match_is_on;            /* true when inside match command */
266extern int match_num_beta;
267extern int match_num_range;
268extern int match_num_seqs;
269extern int mig_strategy;           /* migrad strategy (match) */
270extern int jac_strategy;           /* jacobian strategy (match) */
271extern int jac_repeat;             /* jacobian repeat (match) */
272extern double jac_cool;            /* jacobian cool factor (match) */
273extern double jac_balance;         /* jacobian balance cool factor (match) */
274extern double jac_random;          /* jacobian random factor (match) */
275extern int jac_bisec;              /* jacobian bisec factor (match) */
276extern double jac_cond;            /* jacobian svd cond. num (match) */
277extern int new_name_count;         /* to make internal names */
278extern int next_rand;              /* for random generator */
279extern int plots_made;             /* set to 1 if plots are made */
280extern int polish_cnt;             /* used to detect infinite loops */
281extern int print_match_summary;    /* activate the print option in the
282                                      'mtgeti' and 'collect' routines (mtgeti->mtgetc) */
283extern int quote_toggle;           /* for quote strings on input */
284extern int return_flag;            /* 1 when "return" read */
285extern int scrap_count;            /* running counter to make things unique */
286extern int seqedit_install;        /* counter for seqedit installs */
287extern int seqedit_move;           /* counter for seqedit moves */
288extern int seqedit_remove;         /* counter for seqedit removes */
289extern int sequ_is_on;             /* != 0 if inside current sequence decl. */
290extern int stamp_flag;             /* checks for extern double delete when != 0 */
291extern int start_cnt;              /* counter for start commands */
292extern int start_var;              /* start of variables after predefined constants */
293extern int total_const;            /* total no. of constraints in match */
294extern int total_vars;             /* total no. of variables in match */
295extern int track_is_on;            /* true when inside track command */
296extern int track_start_cnt;        /* counter for track start commands */
297extern int twiss_success;          /* set by twiss module to 1 if OK */
298extern int use_count;              /* incremented by 1 every time use is executed */
299extern int vary_cnt;               /* counter for vary commands */
300extern int watch_flag;             /* produces debug output when != 0 */
301
302extern int na_err,                 /* current no. of alignment errors */
303           nf_err,                 /* current no. of field errors */
304           indent,                 /* current indentation count */
305           b_level,                /* current brace level */
306           sxf_elem_cnt,           /* element count */
307           tag_flag,               /* if > 0, tag = parent name written */
308           tag_cnt,                /* if > 0, tag = specified type code
309                                      written for selected types only */
310           sxf_align_cnt,          /* element with align errors count */
311           sxf_field_cnt,          /* element with field errors count */
312           stop_flag,              /* 1 if stop condition */
313           occnt_add,              /* flag for element name modification */
314           b_indent[100],          /* list of indents */
315           add_indent[];
316
317extern double
318           guess_orbit[6],
319           al_errors[ALIGN_MAX],
320           fd_errors[FIELD_MAX];
321
322extern char
323           line[MADX_LINE_MAX],
324           tag_type[MAX_TAG][16],
325           tag_code[MAX_TAG][16];
326
327time_t     last_time,
328           start_time;
329
330extern char filenames[100][500];
331extern int  currentline[100];
332
333extern double** trackstrarpositions; /* two dimensional array with track positions*/
334
335#endif // MAD_STR_H
336
337
Note: See TracBrowser for help on using the repository browser.