1 | /******************************************************************************/ |
---|
2 | /* */ |
---|
3 | /* CONV (converter) for Agrif (Adaptive Grid Refinement In Fortran) */ |
---|
4 | /* */ |
---|
5 | /* Copyright or or Copr. Laurent Debreu (Laurent.Debreu@imag.fr) */ |
---|
6 | /* Cyril Mazauric (Cyril_Mazauric@yahoo.fr) */ |
---|
7 | /* This software is governed by the CeCILL-C license under French law and */ |
---|
8 | /* abiding by the rules of distribution of free software. You can use, */ |
---|
9 | /* modify and/ or redistribute the software under the terms of the CeCILL-C */ |
---|
10 | /* license as circulated by CEA, CNRS and INRIA at the following URL */ |
---|
11 | /* "http://www.cecill.info". */ |
---|
12 | /* */ |
---|
13 | /* As a counterpart to the access to the source code and rights to copy, */ |
---|
14 | /* modify and redistribute granted by the license, users are provided only */ |
---|
15 | /* with a limited warranty and the software's author, the holder of the */ |
---|
16 | /* economic rights, and the successive licensors have only limited */ |
---|
17 | /* liability. */ |
---|
18 | /* */ |
---|
19 | /* In this respect, the user's attention is drawn to the risks associated */ |
---|
20 | /* with loading, using, modifying and/or developing or reproducing the */ |
---|
21 | /* software by the user in light of its specific status of free software, */ |
---|
22 | /* that may mean that it is complicated to manipulate, and that also */ |
---|
23 | /* therefore means that it is reserved for developers and experienced */ |
---|
24 | /* professionals having in-depth computer knowledge. Users are therefore */ |
---|
25 | /* encouraged to load and test the software's suitability as regards their */ |
---|
26 | /* requirements in conditions enabling the security of their systems and/or */ |
---|
27 | /* data to be ensured and, more generally, to use and operate it in the */ |
---|
28 | /* same conditions as regards security. */ |
---|
29 | /* */ |
---|
30 | /* The fact that you are presently reading this means that you have had */ |
---|
31 | /* knowledge of the CeCILL-C license and that you accept its terms. */ |
---|
32 | /******************************************************************************/ |
---|
33 | /* version 1.6 */ |
---|
34 | /******************************************************************************/ |
---|
35 | #define LONGNOM 800 |
---|
36 | #define LONGLIGNE 800 |
---|
37 | |
---|
38 | /******************************************************************************/ |
---|
39 | /*********** Declaration of structures used in conv ***************************/ |
---|
40 | /******************************************************************************/ |
---|
41 | |
---|
42 | typedef struct |
---|
43 | { |
---|
44 | char first[LONGNOM]; |
---|
45 | char last[LONGNOM]; |
---|
46 | } typedim ; /* fortran dimension as 'ndeb:nfin' */ |
---|
47 | |
---|
48 | typedef struct listdim |
---|
49 | { |
---|
50 | typedim dim; |
---|
51 | struct listdim *suiv; |
---|
52 | } listdim; /* list of the dimensions of a variable */ |
---|
53 | |
---|
54 | typedef struct variable |
---|
55 | { |
---|
56 | char v_typevar[LONGNOM]; |
---|
57 | char v_nomvar[LONGNOM] ; |
---|
58 | char v_oldname[LONGNOM] ; |
---|
59 | char v_dimchar[LONGNOM]; |
---|
60 | char v_modulename[LONGNOM]; |
---|
61 | char v_commonname[LONGNOM]; |
---|
62 | char v_vallengspec[LONGNOM]; |
---|
63 | char v_nameinttypename[LONGNOM]; |
---|
64 | char v_commoninfile[LONGNOM]; |
---|
65 | char v_subroutinename[LONGNOM]; |
---|
66 | char v_precision[LONGNOM]; |
---|
67 | char v_initialvalue[LONGNOM]; |
---|
68 | char v_IntentSpec[LONGNOM]; |
---|
69 | char v_readedlistdimension[LONGNOM]; |
---|
70 | int v_nbdim; |
---|
71 | int v_common; |
---|
72 | int v_positioninblock; |
---|
73 | int v_module; |
---|
74 | int v_save; |
---|
75 | int v_VariableIsParameter; |
---|
76 | int v_PublicDeclare; |
---|
77 | int v_PrivateDeclare; |
---|
78 | int v_ExternalDeclare; |
---|
79 | int v_pointedvar; |
---|
80 | int v_notgrid; |
---|
81 | int v_dimensiongiven; |
---|
82 | int v_c_star; |
---|
83 | int v_indicetabvars; |
---|
84 | int v_pointerdeclare; |
---|
85 | int v_optionaldeclare; |
---|
86 | int v_allocatable; |
---|
87 | int v_dimsempty; |
---|
88 | listdim *v_dimension; |
---|
89 | } variable ; /* type of a variable */ |
---|
90 | /* v_typevar : type (integer, real, ...) */ |
---|
91 | /* v_nomvar : name of the variable */ |
---|
92 | /* v_dimension : list of dimensions of the variable*/ |
---|
93 | /* v_nbdim: 1 if the variable is 1d, etc ... */ |
---|
94 | /* precision : Name of the variable which */ |
---|
95 | /* determine the precision. example : wp in the */ |
---|
96 | /* case where REAL(wp) */ |
---|
97 | |
---|
98 | typedef struct listvar |
---|
99 | { |
---|
100 | variable *var ; |
---|
101 | struct listvar * suiv; |
---|
102 | } listvar ; /* list of variables */ |
---|
103 | |
---|
104 | |
---|
105 | typedef struct listusemodule |
---|
106 | { |
---|
107 | char u_usemodule[LONGNOM]; |
---|
108 | char u_charusemodule[LONGNOM]; |
---|
109 | char u_cursubroutine[LONGNOM]; |
---|
110 | char u_modulename[LONGNOM]; |
---|
111 | int u_firstuse; |
---|
112 | struct listusemodule * suiv; |
---|
113 | } listusemodule; /* list of names */ |
---|
114 | |
---|
115 | typedef struct listparameter |
---|
116 | { |
---|
117 | char p_name[LONGNOM]; |
---|
118 | char p_modulename[LONGNOM]; |
---|
119 | struct listparameter * suiv; |
---|
120 | } listparameter ; /* list of names */ |
---|
121 | |
---|
122 | typedef struct listname |
---|
123 | { |
---|
124 | char n_name[LONGNOM]; |
---|
125 | struct listname* suiv; |
---|
126 | } listname ; /* list of names */ |
---|
127 | |
---|
128 | typedef struct listcouple |
---|
129 | { |
---|
130 | char c_namevar[LONGNOM]; |
---|
131 | char c_namepointedvar[LONGNOM]; |
---|
132 | struct listcouple * suiv; |
---|
133 | } listcouple; /* list of names */ |
---|
134 | |
---|
135 | |
---|
136 | typedef struct listnom |
---|
137 | { |
---|
138 | char o_nom[LONGNOM]; |
---|
139 | char o_module[LONGNOM]; |
---|
140 | int o_val; |
---|
141 | listcouple *couple; |
---|
142 | struct listnom * suiv; |
---|
143 | } listnom; /* list of names */ |
---|
144 | |
---|
145 | |
---|
146 | typedef struct listallocate |
---|
147 | { |
---|
148 | char a_nomvar[LONGNOM]; |
---|
149 | char a_subroutine[LONGNOM]; |
---|
150 | char a_module[LONGNOM]; |
---|
151 | struct listallocate * suiv; |
---|
152 | } listallocate ; |
---|
153 | |
---|
154 | |
---|
155 | typedef struct listvarpointtovar |
---|
156 | { |
---|
157 | char t_usemodule[LONGNOM]; |
---|
158 | char t_cursubroutine[LONGNOM]; |
---|
159 | listcouple *t_couple; |
---|
160 | struct listvarpointtovar* suiv; |
---|
161 | }listvarpointtovar ; /* list of names */ |
---|
162 | |
---|
163 | |
---|
164 | typedef struct listindice |
---|
165 | { |
---|
166 | int i_indice; |
---|
167 | struct listindice * suiv; |
---|
168 | } listindice; /* list of indiced */ |
---|
169 | |
---|
170 | variable *curvar; |
---|
171 | |
---|
172 | listvar *List_ModuleUsedInModuleUsed_Var; |
---|
173 | listvar *List_ModuleUsed_Var; |
---|
174 | listvar *listduplicated; |
---|
175 | |
---|
176 | listvar *List_GlobalParameter_Var; |
---|
177 | listvar *List_Global_Var; |
---|
178 | listvar *List_Data_Var; |
---|
179 | listvar *List_Save_Var; |
---|
180 | listvar *List_SubroutineArgument_Var; |
---|
181 | listvar *List_SubroutineDeclaration_Var; |
---|
182 | listvar *List_UsedInSubroutine_Var; |
---|
183 | listvar *List_Parameter_Var; |
---|
184 | listvar *List_Dimension_Var; |
---|
185 | listvar *List_FunctionType_Var; |
---|
186 | listvar *List_NotGridDepend_Var; |
---|
187 | listvar *List_Common_Var; |
---|
188 | |
---|
189 | |
---|
190 | listname *List_Pointer_Var; |
---|
191 | listname *List_ImplicitNoneSubroutine; |
---|
192 | |
---|
193 | listusemodule *List_NameOfModuleUsed; |
---|
194 | listusemodule *List_Include; |
---|
195 | listusemodule *listofmoduletmp; |
---|
196 | listusemodule *tmpuselocallist; |
---|
197 | |
---|
198 | listparameter *List_GlobParamModuleUsedInModuleUsed_Var; |
---|
199 | listparameter *List_GlobParamModuleUsed_Var; |
---|
200 | |
---|
201 | listnom *List_ContainsSubroutine; |
---|
202 | listnom *List_Subroutine_For_Alloc; |
---|
203 | listnom *listofmodules; |
---|
204 | listnom *List_NameOfModule; |
---|
205 | listnom *List_NameOfCommon; |
---|
206 | listnom *List_SubroutineWhereAgrifUsed; |
---|
207 | |
---|
208 | listallocate *List_Allocate_Var; |
---|
209 | |
---|
210 | listvarpointtovar *List_CouplePointed_Var; |
---|
211 | /* variables which are pointed to an other one */ |
---|
212 | |
---|
213 | listindice *Listofavailableindices; |
---|
214 | /* List of available indices in the tabvars table */ |
---|
215 | |
---|
216 | listdim *curdim; |
---|
217 | listdim *commondim; |
---|
218 | |
---|
219 | /******************************************************************************/ |
---|
220 | /**************** *** COMMON Variables *** *********************************/ |
---|
221 | /******************************************************************************/ |
---|
222 | |
---|
223 | int positioninblock; |
---|
224 | char commonvar[LONGNOM]; |
---|
225 | char commonblockname[LONGNOM]; |
---|
226 | |
---|
227 | /******************************************************************************/ |
---|
228 | /**************** *** AGRIF Variables *** *********************************/ |
---|
229 | /******************************************************************************/ |
---|
230 | int inagrifcallargument; |
---|
231 | int sameagrifargument; |
---|
232 | int InAgrifParentDef; |
---|
233 | char sameagrifname[LONGNOM]; |
---|
234 | /******************************************************************************/ |
---|
235 | /**************** *** VAR DEF Variables *** *******************************/ |
---|
236 | /******************************************************************************/ |
---|
237 | int indicemaxtabvars; /* Number of variables in the model i.e. last */ |
---|
238 | /* indice used in the tabvars table */ |
---|
239 | int PublicDeclare; /* Variable has been declared as PUBLIC */ |
---|
240 | int PrivateDeclare; /* Variable has been declared as PRIVATE */ |
---|
241 | int ExternalDeclare; /* Variable has been declared as EXTERNAL */ |
---|
242 | int InitialValueGiven; /* An initial value has been given */ |
---|
243 | int Allocatabledeclare; |
---|
244 | int SaveDeclare; |
---|
245 | int functiondeclarationisdone; |
---|
246 | int pointerdeclare; |
---|
247 | int optionaldeclare; |
---|
248 | int VarType; |
---|
249 | int VarTypepar; |
---|
250 | int VariableIsParameter; |
---|
251 | int dimsgiven; |
---|
252 | int shouldincludempif; |
---|
253 | int c_star; |
---|
254 | char DeclType[LONGNOM]; |
---|
255 | char nameinttypename[LONGNOM]; |
---|
256 | int GlobalDeclaration; |
---|
257 | char InitValue[LONGNOM*2]; |
---|
258 | char IntentSpec[LONGNOM]; |
---|
259 | char NamePrecision[LONGNOM]; |
---|
260 | char CharacterSize[LONGNOM]; |
---|
261 | char curmodulename[LONGNOM]; |
---|
262 | char vallengspec[LONGNOM]; |
---|
263 | char subroutinename[LONGNOM]; |
---|
264 | |
---|
265 | /******************************************************************************/ |
---|
266 | /**************** *** CONV Variables *** **********************************/ |
---|
267 | /******************************************************************************/ |
---|
268 | int dimprob ; /* dimension of the problem : 1 for 1D,2 for 2D, */ |
---|
269 | /* 3 for 3D */ |
---|
270 | int onlyfixedgrids; /* = 1 if onlyfixedgrids is true */ |
---|
271 | int todebug; |
---|
272 | int mark; |
---|
273 | int todebugfree; |
---|
274 | int fixedgrids; /* = 1 if fixedgrids is true */ |
---|
275 | char nbmaillesX[LONGNOM]; /* number of cells in the x direction */ |
---|
276 | char nbmaillesY[LONGNOM]; /* number of cells in the y direction */ |
---|
277 | char nbmaillesZ[LONGNOM]; /* number of cells in the z direction */ |
---|
278 | int IndicenbmaillesX; |
---|
279 | int IndicenbmaillesY; |
---|
280 | int IndicenbmaillesZ; |
---|
281 | |
---|
282 | int inmodulemeet; |
---|
283 | int incalldeclare; |
---|
284 | int aftercontainsdeclare; /* Signale si l'on vient d'un contains ou non */ |
---|
285 | int retour77; |
---|
286 | int colnum; |
---|
287 | int callagrifinitgrids; |
---|
288 | int callmpiinit; |
---|
289 | int firstpass; |
---|
290 | int couldaddvariable; |
---|
291 | int pointedvar; |
---|
292 | int agrif_parentcall; |
---|
293 | int didvariableadded; |
---|
294 | int SubloopScalar; /* = 1 we should put in argument of sub_loop */ |
---|
295 | /* only */ |
---|
296 | /* scalar and not table u(1,1,1) in place of u */ |
---|
297 | int checkexistcommon; |
---|
298 | int insubroutinedeclare; |
---|
299 | int inmoduledeclare; |
---|
300 | int dimsempty; |
---|
301 | int created_dimensionlist; |
---|
302 | |
---|
303 | char meetagrifinitgrids[LONGNOM]; |
---|
304 | char mpiinitvar[LONGNOM]; |
---|
305 | char *NameTamponfile; |
---|
306 | char toprintglob[LONGNOM]; |
---|
307 | char tmpvargridname[LONGLIGNE]; |
---|
308 | char EmptyChar[LONGNOM]; /* An empty char */ |
---|
309 | char curfilename[LONGNOM]; |
---|
310 | char nomfileoutput[LONGNOM]; |
---|
311 | char curbuf[100*LONGNOM]; |
---|
312 | char motparse[LONGNOM]; |
---|
313 | char motparse1[LONGNOM]; |
---|
314 | char charusemodule[LONGNOM]; |
---|
315 | char subofagrifinitgrids[LONGNOM]; |
---|
316 | char curfile[LONGNOM]; |
---|
317 | char mainfile[LONGNOM]; |
---|
318 | char nomdir[LONGNOM]; |
---|
319 | char commondirout[LONGNOM]; |
---|
320 | char commondirin[LONGNOM]; |
---|
321 | char filetoparse[LONGNOM]; |
---|
322 | |
---|
323 | FILE *fortranout; /* Output File */ |
---|
324 | FILE *fortranin; /* Input File */ |
---|
325 | FILE *oldfortranout; |
---|
326 | FILE *subloop; |
---|
327 | FILE *module_declar; |
---|
328 | FILE *allocationagrif; |
---|
329 | FILE *paramout; |
---|
330 | |
---|
331 | long int pos_cur; /* current position in the output file */ |
---|
332 | long int pos_curagrifparent; |
---|
333 | /* current position in the output file */ |
---|
334 | long int pos_curcall; /* current position in the output file */ |
---|
335 | long int pos_curuse; /* current position in the output file */ |
---|
336 | long int pos_curfunction; /* current position in the output file */ |
---|
337 | long int pos_cur_decl; /* current position in the output file */ |
---|
338 | long int pos_curdata; /* current position in the output file */ |
---|
339 | long int pos_curparameter;/* current position in the output file */ |
---|
340 | long int pos_curcommon; /* current position in the output file */ |
---|
341 | long int pos_cursave; /* current position in the output file */ |
---|
342 | long int pos_curdimension;/* current position in the output file */ |
---|
343 | long int pos_curinit; /* current position in the output file */ |
---|
344 | long int pos_curinclude; /* final position of a line in file */ |
---|
345 | long int pos_end; /* final position of a line in file */ |
---|
346 | long int pos_endsubroutine; |
---|
347 | /* final position of a line in file */ |
---|
348 | |
---|
349 | /******************************************************************************/ |
---|
350 | /*********** Declaration of externals subroutines *****************************/ |
---|
351 | /***************************************************** ************************/ |
---|
352 | /******************************************************************************/ |
---|
353 | /*********** convert.y ********************************************************/ |
---|
354 | /******************************************************************************/ |
---|
355 | extern int main(int argc,char *argv[]); |
---|
356 | /******************************************************************************/ |
---|
357 | /*********** fortran.y ********************************************************/ |
---|
358 | /******************************************************************************/ |
---|
359 | extern void processfortran(char *fichier_entree); |
---|
360 | /******************************************************************************/ |
---|
361 | /*********** dependfile.c *****************************************************/ |
---|
362 | /******************************************************************************/ |
---|
363 | extern void Writethedependnbxnbyfile(); |
---|
364 | extern void Readthedependnbxnbyfile(); |
---|
365 | extern void Writethedependlistofmoduleused(char *NameTampon ); |
---|
366 | extern void Readthedependlistofmoduleused(char *NameTampon); |
---|
367 | extern void WritedependParameterList(char *NameTampon ); |
---|
368 | extern listparameter *ReaddependParameterList(char *NameTampon, |
---|
369 | listparameter *listout); |
---|
370 | extern void Writethedependfile(char *NameTampon, listvar *input ); |
---|
371 | extern listvar *Readthedependfile( char *NameTampon , listvar *listout); |
---|
372 | extern void Write_Subroutine_For_Alloc(); |
---|
373 | extern void Read_Subroutine_For_Alloc(); |
---|
374 | extern void Writethedependavailablefile(); |
---|
375 | extern void Readthedependavailablefile(); |
---|
376 | extern int Did_filetoparse_readed(char *NameTampon); |
---|
377 | extern int Did_module_common_treaded(char *NameTampon); |
---|
378 | /******************************************************************************/ |
---|
379 | /*********** DiversListe.c ****************************************************/ |
---|
380 | /******************************************************************************/ |
---|
381 | extern void Add_Common_var_1(); |
---|
382 | extern listnom *Addtolistnom(char *nom, listnom *listin,int value); |
---|
383 | extern listname *Addtolistname(char *nom,listname *input); |
---|
384 | extern int ModuleIsDefineInInputFile(char *name); |
---|
385 | extern void Addmoduletothelisttmp(char *name); |
---|
386 | extern void Add_NameOfModule_1(char *nom); |
---|
387 | extern void Add_NameOfCommon_1(char *nom); |
---|
388 | extern void Add_CouplePointed_Var_1(char *namemodule,listcouple *couple); |
---|
389 | extern void Add_Include_1(char *name); |
---|
390 | extern void Add_ImplicitNoneSubroutine_1(); |
---|
391 | extern void WriteIncludeDeclaration(); |
---|
392 | extern void Add_Save_Var_1 (char *name,listdim *d); |
---|
393 | /******************************************************************************/ |
---|
394 | /*********** SubLoopCreation.c ************************************************/ |
---|
395 | /******************************************************************************/ |
---|
396 | extern void writeheadnewsub_0(int suborfunc); |
---|
397 | extern void WriteVariablelist_subloop(FILE *outputfile); |
---|
398 | extern void WriteVariablelist_subloop_Call(FILE *outputfile); |
---|
399 | extern void WriteVariablelist_subloop_Def(FILE *outputfile); |
---|
400 | extern void WriteHeadofSubroutineLoop(); |
---|
401 | extern void closeandcallsubloopandincludeit_0(int suborfun, |
---|
402 | char endsub[LONGNOM]); |
---|
403 | /******************************************************************************/ |
---|
404 | /*********** toamr.c **********************************************************/ |
---|
405 | /******************************************************************************/ |
---|
406 | extern char *variablenameroottabvars (variable * var); |
---|
407 | extern char *variablenametabvars (variable * var, int iorindice); |
---|
408 | extern char *variablecurgridtabvars (variable * var,int ParentOrCurgrid); |
---|
409 | extern char *vargridnametabvars (variable * var,int iorindice); |
---|
410 | extern char *vargridcurgridtabvars (variable * var,int ParentOrCurgrid); |
---|
411 | extern char *vargridcurgridtabvarswithoutAgrif_Gr (variable * var); |
---|
412 | extern char *vargridparam (variable * v, int whichone); |
---|
413 | extern void write_probdimagrif_file(); |
---|
414 | extern void write_keysagrif_file(); |
---|
415 | extern void write_modtypeagrif_file(); |
---|
416 | extern void write_createvarnameagrif_file(variable *v,FILE *createvarname, |
---|
417 | int *InitEmpty); |
---|
418 | extern void write_Setnumberofcells_file(); |
---|
419 | extern void write_Getnumberofcells_file(); |
---|
420 | extern void write_initialisationsagrif_file(variable *v,FILE *initproc, |
---|
421 | int *VarnameEmpty); |
---|
422 | extern void Write_Alloc_Agrif_Files(); |
---|
423 | extern int IndiceInlist(int indic, listindice *listin); |
---|
424 | extern void write_allocation_Common_0(); |
---|
425 | extern void write_allocation_Global_0(); |
---|
426 | extern void creefichieramr (char *NameTampon); |
---|
427 | /******************************************************************************/ |
---|
428 | /*********** UtilAgrif.c ******************************************************/ |
---|
429 | /******************************************************************************/ |
---|
430 | extern int Vartonumber(char *tokname); |
---|
431 | extern int Agrif_in_Tok_NAME(char *tokname); |
---|
432 | extern void ModifyTheVariableName_0(char *ident); |
---|
433 | extern void Add_SubroutineWhereAgrifUsed_1(char *sub,char *mod); |
---|
434 | extern void AddUseAgrifUtil_0(FILE *fileout); |
---|
435 | extern void AddUseAgrifUtilBeforeCall_0(FILE *fileout); |
---|
436 | extern void NotifyAgrifFunction_0(char *ident); |
---|
437 | extern void ModifyTheAgrifFunction_0(char *ident); |
---|
438 | extern void AgriffunctionModify_0(char *ident,int whichone); |
---|
439 | extern void Instanciation_0(char *ident); |
---|
440 | /******************************************************************************/ |
---|
441 | /*********** UtilCharacter.c **************************************************/ |
---|
442 | /******************************************************************************/ |
---|
443 | extern void FindAndChangeNameToTabvars(char name[LONGNOM],char toprint[LONGNOM], |
---|
444 | listvar * listtosee, int whichone); |
---|
445 | extern char *ChangeTheInitalvaluebyTabvarsName(char *nom,listvar *listtoread, |
---|
446 | int whichone); |
---|
447 | extern int IsVariableReal(char *nom); |
---|
448 | extern void IsVarInUseFile(char *nom); |
---|
449 | extern listnom *DecomposeTheNameinlistnom(char *nom, listnom * listout); |
---|
450 | extern void DecomposeTheName(char *nom); |
---|
451 | extern void convert2lower(char *name); |
---|
452 | /******************************************************************************/ |
---|
453 | /*********** UtilFile.c *******************************************************/ |
---|
454 | /******************************************************************************/ |
---|
455 | extern FILE * associate (char *filename); |
---|
456 | extern FILE * associateaplus (char *filename); |
---|
457 | extern long int setposcur(); |
---|
458 | extern long int setposcurinoldfortranout(); |
---|
459 | extern void copyuse_0(char *namemodule); |
---|
460 | extern void copyuseonly_0(char *namemodule); |
---|
461 | /******************************************************************************/ |
---|
462 | /*********** UtilFortran.c ****************************************************/ |
---|
463 | /******************************************************************************/ |
---|
464 | extern void initdimprob(int dimprobmod, char * nx, char * ny,char* nz); |
---|
465 | extern int Variableshouldberemove(char *nom); |
---|
466 | extern int variableisglobal(listvar *curvar, listvar *listin); |
---|
467 | extern int VariableIsInList(listvar *curvar,listvar *listin); |
---|
468 | extern void variableisglobalinmodule(listcouple *listin, char *module, |
---|
469 | FILE *fileout); |
---|
470 | extern void Remove_Word_Contains_0(); |
---|
471 | extern void Remove_Word_end_module_0(); |
---|
472 | extern void Write_Word_Contains_0(); |
---|
473 | extern void Write_Word_end_module_0(); |
---|
474 | extern void Add_Subroutine_For_Alloc(char *nom); |
---|
475 | extern void Write_Alloc_Subroutine_0(); |
---|
476 | extern void Write_Alloc_Subroutine_For_End_0(); |
---|
477 | extern void Write_GlobalParameter_Declaration_0(); |
---|
478 | extern void Write_NotGridDepend_Declaration_0(); |
---|
479 | extern int IsTabvarsUseInArgument_0(); |
---|
480 | extern int ImplicitNoneInSubroutine(); |
---|
481 | extern void Add_Pointer_Var_From_List_1(listvar *listin); |
---|
482 | extern void Add_Pointer_Var_1(char *nom); |
---|
483 | extern int varispointer_0(char *ident); |
---|
484 | extern int VariableIsNotFunction(char *ident); |
---|
485 | /******************************************************************************/ |
---|
486 | /*********** UtilListe.c ******************************************************/ |
---|
487 | /******************************************************************************/ |
---|
488 | extern void Init_Variable(variable *var); |
---|
489 | extern listvar * AddListvarToListvar(listvar *l,listvar *glob, |
---|
490 | int ValueFirstpass); |
---|
491 | extern void CreateAndFillin_Curvar(char *type,variable *curvar); |
---|
492 | extern void duplicatelistvar(listvar *orig); |
---|
493 | extern listdim * insertdim(listdim *lin,typedim nom); |
---|
494 | extern void change_dim_char(listdim *lin,listvar * l); |
---|
495 | extern int num_dims(listdim *d); |
---|
496 | extern variable * createvar(char *nom,listdim *d); |
---|
497 | extern listvar * insertvar(listvar *lin,variable *v); |
---|
498 | extern listvar *settype(char *nom,listvar *lin); |
---|
499 | /******************************************************************************/ |
---|
500 | /*********** UtilNotGridDep.c *************************************************/ |
---|
501 | /******************************************************************************/ |
---|
502 | extern void Add_NotGridDepend_Var_1 (char *name); |
---|
503 | extern int VarIsNonGridDepend(char *name); |
---|
504 | /******************************************************************************/ |
---|
505 | /*********** WorkWithAllocatelist.c *******************************************/ |
---|
506 | /******************************************************************************/ |
---|
507 | extern void Add_Allocate_Var_1(char *nom,char *nommodule); |
---|
508 | extern int IsVarAllocatable_0(char *ident); |
---|
509 | extern int varisallocatable_0(char *ident); |
---|
510 | /******************************************************************************/ |
---|
511 | /*********** WorkWithglobliste.c **********************************************/ |
---|
512 | /******************************************************************************/ |
---|
513 | extern void Add_Globliste_1(listvar *listtoadd); |
---|
514 | extern void Add_SubroutineDeclarationSave_Var_1(listvar *listtoadd); |
---|
515 | /******************************************************************************/ |
---|
516 | /*********** WorkWithlistdatavariable.c ***************************************/ |
---|
517 | /******************************************************************************/ |
---|
518 | extern void Add_Data_Var_1 (char *name,char *values); |
---|
519 | /******************************************************************************/ |
---|
520 | /*********** WorkWithlistmoduleinfile.c ***************************************/ |
---|
521 | /******************************************************************************/ |
---|
522 | |
---|
523 | /******************************************************************************/ |
---|
524 | /*********** WorkWithlistofmodulebysubroutine.c *******************************/ |
---|
525 | /******************************************************************************/ |
---|
526 | extern void RecordUseModulesVariables(); |
---|
527 | extern void RecordUseModulesUseModulesVariables(); |
---|
528 | extern void Add_NameOfModuleUsed_1(char *name); |
---|
529 | extern void Addmoduletothelist(char *name); |
---|
530 | extern void WriteUsemoduleDeclaration(); |
---|
531 | /******************************************************************************/ |
---|
532 | /*********** WorkWithlistvarindoloop.c ****************************************/ |
---|
533 | /******************************************************************************/ |
---|
534 | extern void Add_UsedInSubroutine_Var_1 (char *ident); |
---|
535 | extern void ajoutevarindoloop_definedimension (char *name); |
---|
536 | extern void ModifyThelistvarindoloop(); |
---|
537 | extern void CompleteThelistvarindoloop(); |
---|
538 | extern void CopyRecord(variable *var1,variable *var2); |
---|
539 | extern void Update_List_Subroutine_Var(listvar *list_to_modify); |
---|
540 | extern void Update_List_Global_Var_From_List_Save_Var(); |
---|
541 | extern void Update_List_From_Common_Var(listvar *list_to_modify); |
---|
542 | extern void Update_List_Var(listvar *list_to_modify); |
---|
543 | extern void List_UsedInSubroutine_Var_Update_From_Module_Used(); |
---|
544 | extern void Update_NotGridDepend_Var(listvar *list_to_modify); |
---|
545 | extern int LookingForVariableInList(listvar *listin,variable *var); |
---|
546 | extern int LookingForVariableInListGlobal(listvar *listin,variable *var); |
---|
547 | extern int LookingForVariableInListGlob(listvar *listin,variable *var); |
---|
548 | extern int LookingForVariableInListParamGlob(listparameter *listin, |
---|
549 | variable *var); |
---|
550 | extern void UpdateListDeclarationWithDimensionList(); |
---|
551 | extern void Clean_List_UsedInSubroutine_Var(); |
---|
552 | extern void Clean_List_SubroutineDeclaration_Var(); |
---|
553 | extern void ListClean(); |
---|
554 | extern void ListUpdate(); |
---|
555 | extern void Sort_List_SubroutineArgument_Var(); |
---|
556 | extern void IndiceTabvars_Global_Var_Treated(char *nom); |
---|
557 | extern void IndiceTabvars_Global_Var_No_Treated(char *nom); |
---|
558 | extern void UpdateTheRemainingList(listvar *record); |
---|
559 | extern void IndiceTabvars_Common_Var_Treated(char *nom); |
---|
560 | extern void IndiceTabvars_Common_Var_No_Treated(char *nom); |
---|
561 | extern void IndiceTabvarsIdentification(); |
---|
562 | extern void New_Allocate_Subroutine_Is_Necessary(); |
---|
563 | extern void New_Allocate_Subroutine_For_Common_Is_Necessary(); |
---|
564 | extern void NewModule_Creation_0(); |
---|
565 | extern void UpdateList_SubroutineWhereAgrifUsed(); |
---|
566 | extern void UpdateList_UsedInSubroutine_With_dimension(); |
---|
567 | extern void Affiche(); |
---|
568 | extern int SubInList_ContainsSubroutine(); |
---|
569 | /******************************************************************************/ |
---|
570 | /*********** WorkWithParameterlist.c ******************************************/ |
---|
571 | /******************************************************************************/ |
---|
572 | extern void Add_GlobalParameter_Var_1(listvar *listin); |
---|
573 | extern void Add_Parameter_Var_1(listvar *listin); |
---|
574 | extern void Add_Dimension_Var_1(listvar *listin); |
---|
575 | /******************************************************************************/ |
---|
576 | /*********** WorkWithvarofsubroutineliste.c ***********************************/ |
---|
577 | /******************************************************************************/ |
---|
578 | extern void Add_SubroutineArgument_Var_1(listvar *listtoadd); |
---|
579 | extern void Add_FunctionType_Var_1(char *nom); |
---|
580 | extern void Add_SubroutineDeclaration_Var_1 (listvar *listtoadd); |
---|
581 | /******************************************************************************/ |
---|
582 | /*********** Writedeclarations.c **********************************************/ |
---|
583 | /******************************************************************************/ |
---|
584 | extern void WriteBeginDeclaration(variable *v,char ligne[LONGLIGNE]); |
---|
585 | extern void WriteScalarDeclaration(variable *v,char ligne[LONGLIGNE]); |
---|
586 | extern void WriteTableDeclaration(variable * v,char ligne[LONGLIGNE],int tmpok); |
---|
587 | extern void writevardeclaration (listvar * var_record, FILE *fileout, |
---|
588 | int value); |
---|
589 | extern void WriteLocalParamDeclaration(); |
---|
590 | extern void WriteFunctionDeclaration(); |
---|
591 | extern void WriteSubroutineDeclaration(int value); |
---|
592 | extern void WriteArgumentDeclaration_beforecall(); |
---|
593 | extern void WriteArgumentDeclaration_Sort(); |
---|
594 | extern listnom *writedeclarationintoamr (listvar * deb_common, FILE *fileout, |
---|
595 | variable *var , char commonname[LONGNOM], |
---|
596 | listnom *neededparameter, char name_common[LONGNOM]); |
---|
597 | extern void writesub_loopdeclaration_scalar (listvar * deb_common, |
---|
598 | FILE *fileout); |
---|
599 | extern void writesub_loopdeclaration_tab (listvar * deb_common, FILE *fileout); |
---|
600 | /******************************************************************************/ |
---|
601 | /*********** WriteInFile.c ****************************************************/ |
---|
602 | /******************************************************************************/ |
---|
603 | extern void tofich_reste (FILE * filout, char *s,int returnlineornot); |
---|
604 | extern void tofich (FILE * filout, char *s, int returnlineornot); |
---|
605 | extern void tofich_blanc (FILE * filout, int size); |
---|
606 | extern void tofich_line (FILE * filout, int size, int long position); |
---|
607 | extern void RemoveWordSET_0(FILE * filout, long int position, |
---|
608 | long int sizetoremove); |
---|
609 | extern void RemoveWordCUR_0(FILE * filout, long int position, |
---|
610 | long int sizetoremove); |
---|