Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/madX/mad_gvar.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #ifndef MAD_GVAR_H
0002 #define MAD_GVAR_H
0003 
0004 /* Temporary file: global variables
0005    these variables will be split over their respective modules...
0006 */
0007 
0008 extern int debuglevel;
0009 
0010 /* Global structure variables by type (alphabetic) */
0011 
0012 extern struct char_array* aux_buff;       /* temporary buffer for many purposes */
0013 extern struct char_array* c_dum;
0014 extern struct char_array* c_join;
0015 extern struct char_array* work;
0016 extern struct char_array* l_wrk;
0017 
0018 extern struct char_p_array* tmp_p_array;  /* temporary buffer for splits */
0019 extern struct char_p_array* tmp_l_array;  /* temporary buffer for special commands */
0020 extern struct char_p_array* line_buffer;  /* buffer for line expansion */
0021 
0022 extern struct command* current_beam;    /* current reference beam */
0023 extern struct command* probe_beam;      /* current beam */
0024 extern struct command* options;         /* current options */
0025 extern struct command* plot_options;    /* current plot options */
0026 extern struct command* current_error;   /* current error command */
0027 extern struct command* current_correct; /* current correct command */
0028 extern struct command* current_ibs;     /* current ibs command */
0029 extern struct command* current_touschek;/* current touschek command */
0030 extern struct command* current_survey;  /* current survey command */
0031 extern struct command* current_ptc;     /* current ptc command */
0032 extern struct command* current_twiss;   /* current twiss command */
0033 extern struct command* current_command; /* current command clone */
0034 extern struct command* current_gweight; /* current gweight clone */
0035 extern struct command* current_weight;  /* current weight clone */
0036 extern struct command* current_match;   /* current match comm. */
0037 extern struct command* current_eopt;    /* to keep eoption command */
0038 extern struct command* threader_par;    /* threader parameters */
0039 extern struct command* current_format_f;   /* current formats */
0040 
0041 extern struct command_list* beam_list;         /* list of all beam commands */
0042 extern struct command_list* beta0_list;        /* list of user defined beta0s */
0043 extern struct command_list* defined_commands;  /* from dictionary */
0044 extern struct command_list* error_select;      /* current error select commands */
0045 extern struct command_list* optics_select;     /* current optics select commands */
0046 extern struct command_list* optics_list;       /* list of optics command/sequence */
0047 extern struct command_list* savebeta_list;
0048 extern struct command_list* seqedit_select;    /* current seqedit select commands */
0049 extern struct command_list* save_select;       /* current save select commands */
0050 extern struct command_list* slice_select;      /* current slice select commands */
0051 extern struct command_list* stored_commands;   /* list of stored commands */
0052 extern struct command_list* stored_match_var;  /* list of match vary commands */
0053 extern struct command_list* stored_track_start;/* list of track start commands */
0054 extern struct command_list* sector_select;     /* current sectormap select commands */
0055 extern struct command_list* interp_select;     /* current interpolate select commands */
0056 
0057 extern struct command_list_list* table_deselect; /* list of table deselect lists */
0058 extern struct command_list_list* table_select; /* list of all table select lists */
0059 
0060 extern struct constraint_list* comm_constraints; /* for each constraint command */
0061 extern struct double_array* cat_doubles;    /* Polish: constant values */
0062 extern struct double_array* doubles;        /* doubles buffer */
0063 extern struct double_array* twiss_deltas;   /* for deltap loop in twiss command */
0064 extern struct double_array* vary_vect;      /* for matching */
0065 extern struct double_array* vary_dvect;     /* for matching */
0066 extern struct double_array* fun_vect;       /* for matching */
0067 extern struct double_array* match_work[MATCH_WORK];/* work space for matching */
0068 
0069 extern struct el_list* element_list;        /* Explicitly defined elems. No implicit drifts! */
0070 extern struct el_list* base_type_list;
0071 extern struct el_list* selected_elements;
0072 
0073 extern struct expression* backup_expr;
0074 
0075 extern struct in_buff_list* in;      /* list of all active input buffers */
0076 extern struct in_buff_list* pro;     /* list of active processing buffers */
0077 
0078 extern struct int_array* deco;       /* Polish: coded expression */
0079 extern struct int_array* cat;        /* Polish: catgories */
0080 extern struct int_array* d_var;      /* Polish: variable references */
0081 extern struct int_array* oper;       /* Polish: operator references */
0082 extern struct int_array* func;       /* Polish: function references */
0083 extern struct int_array* s_range;    /* starts of ranges */
0084 extern struct int_array* e_range;    /* ends of ranges */
0085 extern struct int_array* sd_range;   /* starts of deselect ranges */
0086 extern struct int_array* ed_range;   /* ends of deselect ranges */
0087 extern struct int_array* match_i_work[MATCH_WORK];  /* int work space for matching */
0088 
0089 extern struct in_cmd* this_cmd;      /* contains command just read */
0090 extern struct in_cmd* local_twiss[2];
0091 extern struct in_cmd* embedded_twiss_cmd; /* current plot command */
0092 
0093 extern struct in_cmd_list* buffered_cmds;
0094 
0095 extern struct macro_list* line_list;
0096 extern struct macro_list* macro_list;
0097 
0098 extern struct name_list* expr_chunks;
0099 extern struct name_list* occ_list;
0100 extern struct name_list* sxf_list;
0101 
0102 extern struct node* prev_node;
0103 extern struct node* current_node;
0104 extern struct node* debug_node;
0105 
0106 extern struct node_list* selected_ranges; /* filled by some select commands */
0107 extern struct node_list* sector_ranges;   /* filled by the sectormap select command */
0108 
0109 extern struct sequence* current_sequ;  /* pointer to currently used sequence */
0110 extern struct sequence* edit_sequ;     /* pointer to sequence being edited */
0111 
0112 extern struct sequence_list* sequences;    /* pointer to sequence list */
0113 extern struct sequence_list* match_sequs;  /* pointer to sequence list for match */
0114 
0115 extern struct table* aperture_table;     /* current aperture table */
0116 extern struct table* ibs_table;          /* current ibs table */
0117 extern struct table* touschek_table;     /* current touschek table */
0118 extern struct table* summ_table;         /* current twiss summary table */
0119 extern struct table* twiss_table;        /* current twiss table */
0120 extern struct table* twiss_table_beam1;  /* current twiss table beam1 */
0121 extern struct table* twiss_table_beam2;  /* current twiss table beam2 */
0122 extern struct table* twiss_sector_table; /* used for sectormap */
0123 extern struct table* ptc_twiss_summary_table; /* holds summary data after one turn */
0124 extern struct table* map_table;          /* added for twiss_input_table */
0125 extern struct table_list* table_register;
0126 extern struct table_list* moments_tables;/* tables for moments */
0127 
0128 extern struct table* embedded_twiss_table;/* current twiss table */
0129 extern struct table* normal_results;     /* ptc table containing the selected high order functions (such as dx,qx,anhx etc.) */
0130 
0131 extern struct table* errors_dipole;
0132 extern struct table* errors_field;
0133 extern struct table* errors_total;
0134 extern struct table* errors_read;        /* table needed for IO of errors with PTC */
0135 
0136 extern struct table* survey_table;       /* current survey table */
0137 extern struct table* emit_table;         /* current emit table */
0138 extern struct table* emitsumm_table;         /* current emit table */
0139 extern struct table* corr_table;         /* corrector table after orbit correction */
0140 extern struct table* corr_table1;        /* corrector table after orbit correction, beam 1 for two rings */
0141 extern struct table* corr_table2;        /* corrector table after orbit correction, beam 2 for two rings */
0142 extern struct table* mon_table;          /* monitor table after orbit correction */
0143 extern struct table* orbit_table;        /* orbit positions at monitors */
0144 extern struct table* sodd_table_70;      /* sodd output table detune_1_end */
0145 extern struct table* sodd_table_71;      /* sodd output table detune_1_all */
0146 extern struct table* sodd_table_72;      /* sodd output table detune_2_end */
0147 extern struct table* sodd_table_73;      /* sodd output table detune_2_all */
0148 extern struct table* sodd_table_74;      /* sodd output table distort_1_f_end */
0149 extern struct table* sodd_table_75;      /* sodd output table distort_1_h_end */
0150 extern struct table* sodd_table_76;      /* sodd output table distort_1_f_all */
0151 extern struct table* sodd_table_77;      /* sodd output table distort_1_h_all */
0152 extern struct table* sodd_table_78;      /* sodd output table distort_2_f_end */
0153 extern struct table* sodd_table_79;      /* sodd output table distort_2_h_end */
0154 extern struct table* target_table;       /* current target table */
0155 extern struct table* model_table;        /* current model table */
0156 extern struct table* orbin_table;        /* current orbit table */
0157 
0158 
0159 extern struct table_list* optics_tables; /* contains optics tables from last twiss */
0160 extern struct table_list* table_register; /* contains all tables */
0161 
0162 extern struct table_list_list* all_table_lists; /* all table lists are entered here */
0163 
0164 extern struct variable* current_variable; /* set by act_value (table access) */
0165 extern struct var_list* variable_list;
0166 
0167 extern struct orb_cor*  correct_orbit;   /* information and links for orbit correction */
0168 extern struct orb_cor2* correct_orbit1;  /* information and links for orbit correction */
0169 extern struct orb_cor2* correct_orbit2;  /* information and links for orbit correction */
0170 extern struct orb_cor2* correct_orbit12; /* information and links for orbit correction */
0171 
0172 extern double corrl;                  /* global limit for orbit corrector strength  */
0173 
0174 extern struct table* efield_table;    /* field errors in table form  */
0175 extern FILE* fddata;
0176 extern FILE* fcdata;
0177 extern FILE* ftdata;
0178 extern FILE* fgdata;
0179 
0180 extern struct char_p_array* sdds_pat; /* array for selected sdds patterns */
0181 
0182 extern FILE* debug_file;              /* for debug output */
0183 extern FILE* stamp_file;              /* for debug output */
0184 extern FILE* out_file;                /* for table output */
0185 extern FILE* prt_file;                /* for echo output */
0186 extern FILE* sec_file;                /* for sector output in "embedded" twiss */
0187 extern FILE* tab_file;                /* for table input */
0188 
0189 /* Global simple variables by type */
0190 
0191 extern char quote;                      /* current open single or double quote */
0192 extern char int_format[20],             /* current integer format */
0193             float_format[20],           /* current float format */
0194             string_format[20];          /* current string format */
0195 extern char blank[];
0196 extern char none[];
0197 extern char one_string[];
0198 
0199 // 2015-Jul-31  11:41:59  ghislain: aperture twiss file for output of twiss table ! not needed
0200 //extern char aptwfile[FNAME_L];
0201 extern char* aux_char_pt;               /* for debug purposes */
0202 extern char* exx;
0203 extern char* current_link_group;
0204 extern char* current_range;             /* currently used range, or NULL */
0205 extern char* title;
0206 extern char* match_seqs[2];
0207 extern char* match_beta[2];
0208 extern char* match_range[2];
0209 extern char* track_filename;            /* track module file name start */
0210 extern char* track_fileext;             /* track module file name extension */
0211 extern char  track_plot_filename[NAME_L];/* plot module: output postscript file name in track mode */
0212 
0213 extern double pi, twopi, degrad, raddeg, e, clight, hbar;
0214 extern double penalty;
0215 extern double match_tol;
0216 extern double orbit0[6];
0217 extern double disp0[6];
0218 extern double sxf_suml;
0219 extern double track_deltap;
0220 extern double oneturnmat[36];
0221 
0222 extern const double zero;
0223 extern const double one;
0224 extern const double two;
0225 extern const double ten_p_3;
0226 extern const double ten_p_6;
0227 extern const double ten_p_9;
0228 extern const double ten_p_12;
0229 extern const double ten_m_3;
0230 extern const double ten_m_6;
0231 extern const double ten_m_9;
0232 extern const double ten_m_12;
0233 extern const double ten_m_15;
0234 extern const double ten_m_16;
0235 extern const double ten_m_19;
0236 
0237 extern int add_error_opt;          /* ADD error option, set with eoption */
0238 extern int backup_type;
0239 
0240 extern int embedded_flag;          /* flag (= 1 when entering routine pro_embedded_twiss, 0 at exit) */
0241 extern int min_order;              /* minimum required order */
0242 extern int print_correct_opt;      /* PRINT options for orbit correction */
0243 extern int assign_start;           /* flag for multiple assign statements */
0244 extern int aux_count;              /* for debug purposes */
0245 extern int beam_info;              /* flag to print beam information once */
0246 extern int curr_obs_points;        /* current number of observation points */
0247 extern int current_calls;          /* call counter in match */
0248 extern int current_call_lim;       /* current call limit in match */
0249 extern int current_const;          /* current constraint number in match */
0250 extern int default_beam_saved;     /* flag to avoid multiple save of default beam */
0251 extern int edit_is_on;             /* != 0 if inside current sequence edit */
0252 extern int final_message;          /* set to 1 when end message written */
0253 extern int group_is_on;            /* true when inside group */
0254 extern int guess_flag;             /* != 0 if coguess read */
0255 extern int in_stop;                /* input buffer stop flag */
0256 extern int inbuf_level;            /* input buffer level */
0257 extern int init_warn;              /* intialisation warning level */
0258 extern int interactive;            /* non-zero if interactive */
0259 extern int keep_tw_print;          /* previous twiss print flag (match) */
0260 // extern int loop_cnt;               /* used to detect infinite loops ; removed 2014-Mar-20  16:20:13  ghislain */
0261 extern int match_calls;            /* command call limit in match */
0262 extern int match_is_on;            /* true when inside match command */
0263 extern int chrom_match;            /* true when the match summary*/
0264 extern int match_num_beta;
0265 extern int match_num_range;
0266 extern int match_num_seqs;
0267 extern int mig_strategy;           /* migrad strategy (match) */
0268 extern int jac_strategy;           /* jacobian strategy (match) */
0269 extern int jac_repeat;             /* jacobian repeat (match) */
0270 extern double jac_cool;            /* jacobian cool factor (match) */
0271 extern double jac_balance;         /* jacobian balance cool factor (match) */
0272 extern double jac_random;          /* jacobian random factor (match) */
0273 extern int jac_bisec;              /* jacobian bisec factor (match) */
0274 extern double jac_cond;            /* jacobian svd cond. num (match) */
0275 extern int new_name_count;         /* to make internal names */
0276 extern int next_rand;              /* for random generator */
0277 extern int plots_made;             /* set to 1 if plots are made */
0278 extern int polish_cnt;             /* used to detect infinite loops */
0279 extern int print_match_summary;    /* activate the print option in the
0280                                       'mtgeti' and 'collect' routines (mtgeti->mtgetc) */
0281 extern int quote_toggle;           /* for quote strings on input */
0282 extern int return_flag;            /* 1 when "return" read */
0283 extern int scrap_count;            /* running counter to make things unique */
0284 extern int seqedit_install;        /* counter for seqedit installs */
0285 extern int seqedit_move;           /* counter for seqedit moves */
0286 extern int seqedit_remove;         /* counter for seqedit removes */
0287 extern int seqedit_replace;        /* counter for seqedit replaces -- 2014-Jul-01  13:27:11  ghislain */
0288 extern int sequ_is_on;             /* != 0 if inside current sequence decl. */
0289 extern int stamp_flag;             /* checks for extern double delete when != 0 */
0290 extern int start_cnt;              /* counter for start commands */
0291 extern int start_var;              /* start of variables after predefined constants */
0292 extern int total_const;            /* total no. of constraints in match */
0293 extern int total_vars;             /* total no. of variables in match */
0294 extern int track_is_on;            /* true when inside track command */
0295 extern int track_start_cnt;        /* counter for track start commands */
0296 extern int twiss_success;          /* set by twiss module to 1 if OK */
0297 extern int use_count;              /* incremented by 1 every time use is executed */
0298 extern int vary_cnt;               /* counter for vary commands */
0299 extern int watch_flag;             /* produces debug output when != 0 */
0300 
0301 extern int na_err,                 /* current no. of alignment errors */
0302            nf_err,                 /* current no. of field errors */
0303            indent,                 /* current indentation count */
0304            b_level,                /* current brace level */
0305            sxf_elem_cnt,           /* element count */
0306            tag_flag,               /* if > 0, tag = parent name written */
0307            tag_cnt,                /* if > 0, tag = specified type code
0308                                       written for selected types only */
0309            sxf_align_cnt,          /* element with align errors count */
0310            sxf_field_cnt,          /* element with field errors count */
0311            stop_flag,              /* 1 if stop condition */
0312            occnt_add,              /* flag for element name modification */
0313            b_indent[100],          /* list of indents */
0314            add_indent[];
0315 
0316 extern double
0317            guess_orbit[6],
0318            al_errors[ALIGN_MAX],
0319            fd_errors[FIELD_MAX];
0320 
0321 extern char
0322            line[MADX_LINE_MAX],
0323            tag_type[MAX_TAG][16],
0324            tag_code[MAX_TAG][16];
0325 
0326 extern time_t last_time,
0327               start_time;
0328 
0329 extern char filenames[100][500];
0330 extern int  currentline[100];
0331 
0332 extern double** trackstrarpositions; /* two dimensional array with track positions*/
0333 
0334 #endif // MAD_STR_H
0335 
0336