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@imag.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.0 */ |
---|
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 typevar[LONGNOM]; |
---|
57 | char nomvar[LONGNOM] ; |
---|
58 | char oldname[LONGNOM] ; |
---|
59 | char dimchar[LONGNOM]; |
---|
60 | listdim *dimension; |
---|
61 | int nbdim; |
---|
62 | int common; |
---|
63 | int positioninblock; |
---|
64 | int module; |
---|
65 | int save; |
---|
66 | int VariableIsParameter; |
---|
67 | int PublicDeclare; |
---|
68 | int PrivateDeclare; |
---|
69 | int ExternalDeclare; |
---|
70 | char modulename[LONGNOM]; |
---|
71 | char commonname[LONGNOM]; |
---|
72 | char vallengspec[LONGNOM]; |
---|
73 | char nameinttypename[LONGNOM]; |
---|
74 | int pointedvar; |
---|
75 | char commoninfile[LONGNOM]; |
---|
76 | char subroutinename[LONGNOM]; |
---|
77 | int dimensiongiven; |
---|
78 | int c_star; |
---|
79 | int typegiven; |
---|
80 | char precision[LONGNOM]; |
---|
81 | char initialvalue[LONGNOM]; |
---|
82 | int indicetabvars; |
---|
83 | int pointerdeclare; |
---|
84 | int optionaldeclare; |
---|
85 | int allocatable; |
---|
86 | char IntentSpec[LONGNOM]; |
---|
87 | int dimsempty; |
---|
88 | char readedlistdimension[LONGNOM]; |
---|
89 | } variable ; /* type of a variable */ |
---|
90 | /* typevar : type (integer, real, ...) */ |
---|
91 | /* nomvar : name of the variable */ |
---|
92 | /* dimension : list of dimensions of the variable */ |
---|
93 | /* 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 listvarcommon |
---|
106 | { |
---|
107 | char nomvar[LONGNOM] ; |
---|
108 | char commonname[LONGNOM]; |
---|
109 | char subroutinename[LONGNOM]; |
---|
110 | int dimensiongiven; |
---|
111 | int nbdim; |
---|
112 | int indicetabvars; |
---|
113 | int positioninblock; |
---|
114 | listdim *dimension; |
---|
115 | char readedlistdimension[LONGNOM]; |
---|
116 | struct listvarcommon * suiv; |
---|
117 | } listvarcommon ; /* list of variables in common block */ |
---|
118 | |
---|
119 | |
---|
120 | typedef struct listusemodule |
---|
121 | { |
---|
122 | char usemodule[LONGNOM]; |
---|
123 | char charusemodule[LONGNOM]; |
---|
124 | char cursubroutine[LONGNOM]; |
---|
125 | int firstuse; |
---|
126 | struct listusemodule * suiv; |
---|
127 | } listusemodule; /* list of names */ |
---|
128 | |
---|
129 | typedef struct listparameter |
---|
130 | { |
---|
131 | char name[LONGNOM]; |
---|
132 | char modulename[LONGNOM]; |
---|
133 | struct listparameter * suiv; |
---|
134 | } listparameter ; /* list of names */ |
---|
135 | |
---|
136 | typedef struct listnamelist |
---|
137 | { |
---|
138 | char name[LONGNOM]; |
---|
139 | struct listnamelist * suiv; |
---|
140 | } listnamelist ; /* list of names */ |
---|
141 | |
---|
142 | typedef struct listname |
---|
143 | { |
---|
144 | char name[LONGNOM]; |
---|
145 | struct listname* suiv; |
---|
146 | } listname ; /* list of names */ |
---|
147 | |
---|
148 | |
---|
149 | typedef struct listmodule |
---|
150 | { |
---|
151 | char module[LONGNOM]; |
---|
152 | int AllocShouldMade; |
---|
153 | int Alloc; |
---|
154 | struct listmodule * suiv; |
---|
155 | } listmodule; /* list of names */ |
---|
156 | |
---|
157 | |
---|
158 | |
---|
159 | typedef struct listcouple |
---|
160 | { |
---|
161 | char namevar[LONGNOM]; |
---|
162 | char namepointedvar[LONGNOM]; |
---|
163 | struct listcouple * suiv; |
---|
164 | } listcouple; /* list of names */ |
---|
165 | |
---|
166 | |
---|
167 | typedef struct listnom |
---|
168 | { |
---|
169 | char nom[LONGNOM]; |
---|
170 | listcouple *couple; |
---|
171 | struct listnom * suiv; |
---|
172 | } listnom; /* list of names */ |
---|
173 | |
---|
174 | |
---|
175 | typedef struct listallocate |
---|
176 | { |
---|
177 | char nomvar[LONGNOM]; |
---|
178 | char subroutine[LONGNOM]; |
---|
179 | char module[LONGNOM]; |
---|
180 | struct listallocate * suiv; |
---|
181 | } listallocate ; |
---|
182 | |
---|
183 | |
---|
184 | typedef struct listvarpointtovar |
---|
185 | { |
---|
186 | char usemodule[LONGNOM]; |
---|
187 | char cursubroutine[LONGNOM]; |
---|
188 | listcouple *couple; |
---|
189 | struct listvarpointtovar* suiv; |
---|
190 | }listvarpointtovar ; /* list of names */ |
---|
191 | |
---|
192 | |
---|
193 | typedef struct listindice |
---|
194 | { |
---|
195 | int indice; |
---|
196 | struct listindice * suiv; |
---|
197 | } listindice; /* list of indiced */ |
---|
198 | |
---|
199 | |
---|
200 | int fortran77; /* = 1; the code has been writen in */ |
---|
201 | /* fortran77 else in fortran 90 */ |
---|
202 | /******************************************************************************/ |
---|
203 | /**************** *** COMMON Variables *** *********************************/ |
---|
204 | /******************************************************************************/ |
---|
205 | |
---|
206 | int positioninblock; |
---|
207 | char commonvar[LONGNOM]; |
---|
208 | char commonblockname[LONGNOM]; |
---|
209 | |
---|
210 | /******************************************************************************/ |
---|
211 | /**************** *** AGRIF Variables *** *********************************/ |
---|
212 | /******************************************************************************/ |
---|
213 | int inagrifcallargument; |
---|
214 | int adduseagrifutil; |
---|
215 | int sameagrifargument; |
---|
216 | int InAgrifParentDef; |
---|
217 | char sameagrifname[LONGNOM]; |
---|
218 | /******************************************************************************/ |
---|
219 | /**************** *** VAR DEF Variables *** *******************************/ |
---|
220 | /******************************************************************************/ |
---|
221 | int oldindicemaxtabvars; /* Number of variables in the model i.e. last */ |
---|
222 | int indicemaxtabvars; /* Number of variables in the model i.e. last */ |
---|
223 | /* indice used in the tabvars table */ |
---|
224 | int PublicDeclare; /* Variable has been declared as PUBLIC */ |
---|
225 | int PrivateDeclare; /* Variable has been declared as PRIVATE */ |
---|
226 | int ExternalDeclare; /* Variable has been declared as EXTERNAL */ |
---|
227 | int InitialValueGiven; /* An initial value has been given */ |
---|
228 | int formatdeclare; |
---|
229 | int Allocatabledeclare; |
---|
230 | int SaveDeclare; |
---|
231 | int pointerdeclare; |
---|
232 | int optionaldeclare; |
---|
233 | int VariableIsParameter; |
---|
234 | int dimsgiven; |
---|
235 | int c_star; |
---|
236 | char DeclType[LONGNOM]; |
---|
237 | char nameinttypename[LONGNOM]; |
---|
238 | char InitValue[LONGNOM*2]; |
---|
239 | char IntentSpec[LONGNOM]; |
---|
240 | char NamePrecision[LONGNOM]; |
---|
241 | char CharacterSize[LONGNOM]; |
---|
242 | char curmodulename[LONGNOM]; |
---|
243 | char vallengspec[LONGNOM]; |
---|
244 | char subroutinename[LONGNOM]; |
---|
245 | |
---|
246 | /******************************************************************************/ |
---|
247 | /**************** *** TOAMR Variables *** *********************************/ |
---|
248 | /******************************************************************************/ |
---|
249 | char Alloctreatedname[LONGNOM]; |
---|
250 | |
---|
251 | /******************************************************************************/ |
---|
252 | /**************** *** CONV Variables *** **********************************/ |
---|
253 | /******************************************************************************/ |
---|
254 | int dimprob ; /* dimension of the problem : 1 for 1D,2 for 2D, */ |
---|
255 | /* 3 for 3D */ |
---|
256 | int onlyfixedgrids; /* = 1 if onlyfixedgrids is true */ |
---|
257 | int todebug; |
---|
258 | int fixedgrids; /* = 1 if fixedgrids is true */ |
---|
259 | char nbmaillesX[LONGNOM]; /* number of cells in the x direction */ |
---|
260 | char nbmaillesY[LONGNOM]; /* number of cells in the y direction */ |
---|
261 | char nbmaillesZ[LONGNOM]; /* number of cells in the z direction */ |
---|
262 | int IndicenbmaillesX; |
---|
263 | int IndicenbmaillesY; |
---|
264 | int IndicenbmaillesZ; |
---|
265 | |
---|
266 | listvar *globliste; |
---|
267 | listvar *globparam; |
---|
268 | listvar *listdatavariable; |
---|
269 | listvar *listargsubroutine; |
---|
270 | listvar *varofsubroutineliste; |
---|
271 | listvar *varsubroutine; |
---|
272 | listvar *listvarindoloop; |
---|
273 | listvar *finglobliste; |
---|
274 | listvar *tmplocallist; |
---|
275 | listvar *parameterlist; |
---|
276 | listvar *globalvarofusefile2; |
---|
277 | listvar *globalvarofusefile; |
---|
278 | listvar *functionlistvar; |
---|
279 | listvar *listenotgriddepend; /* List of the variables which are not grid dependent */ |
---|
280 | listvar *listvartempo; |
---|
281 | listvar *listduplicated; |
---|
282 | |
---|
283 | listvarcommon *commonlist; |
---|
284 | |
---|
285 | listname *listimplicitnone; |
---|
286 | |
---|
287 | listusemodule *listofmodulebysubroutine; |
---|
288 | listusemodule *listofincludebysubroutine; |
---|
289 | listusemodule *listofmoduletmp; |
---|
290 | listusemodule *tmpuselocallist; |
---|
291 | |
---|
292 | listparameter *tmpparameterlocallist2; |
---|
293 | listparameter *tmpparameterlocallist; |
---|
294 | |
---|
295 | listmodule *listmoduleinfile; |
---|
296 | |
---|
297 | listnamelist *listenamelist; |
---|
298 | |
---|
299 | listnom *NewModuleList; |
---|
300 | listnom *listofmodules; |
---|
301 | listnom *modulelist; |
---|
302 | listnom *Listofvariableinagriffunction; |
---|
303 | listnom *listofsubroutinewhereagrifisused; |
---|
304 | |
---|
305 | listallocate *AllocateList; |
---|
306 | |
---|
307 | listvarpointtovar *Listofvarpointtovar; |
---|
308 | /* variables which are pointed to an other one */ |
---|
309 | |
---|
310 | listindice *Listofavailableindices; |
---|
311 | /* List of available indices in the tabvars table */ |
---|
312 | |
---|
313 | int indeclarationvar; |
---|
314 | int inmodulemeet; |
---|
315 | int incalldeclare; |
---|
316 | int Did_filetoparse_treated; |
---|
317 | int aftercontainsdeclare; /* Signale si l'on vient d'un contains ou non */ |
---|
318 | int colnum; |
---|
319 | int callagrifinitgrids; |
---|
320 | int callmpiinit; |
---|
321 | int firstpass; |
---|
322 | int listofvarofusemodulecreated; |
---|
323 | int couldaddvariable; |
---|
324 | int Savemeet; |
---|
325 | int pointedvar; |
---|
326 | int agrif_parentcall; |
---|
327 | int didvariableadded; |
---|
328 | int infunctiondeclare; |
---|
329 | int SubloopScalar; /* =1 we should put in argument of sub_loop */ |
---|
330 | /* only */ |
---|
331 | /* scalar and not table u(1,1,1) in place of u */ |
---|
332 | int checkexistcommon; |
---|
333 | int insubroutinedeclare; |
---|
334 | int tmpdeclaration_everdone; |
---|
335 | int paramdeclaration_everdone; |
---|
336 | int inmoduledeclare; |
---|
337 | int AllocEmpty; |
---|
338 | int dimsempty; |
---|
339 | int created_dimensionlist; |
---|
340 | |
---|
341 | char meetagrifinitgrids[LONGNOM]; |
---|
342 | char meetmpiinit[LONGNOM]; |
---|
343 | char mpiinitvar[LONGNOM]; |
---|
344 | char *NameTamponfile; |
---|
345 | char toprintglob[LONGNOM]; |
---|
346 | char recorddimension[LONGNOM]; |
---|
347 | char tmpvargridname[LONGLIGNE]; |
---|
348 | char curdimchar[10]; |
---|
349 | char OriginalFileName[LONGNOM]; /* Name of the parsing file*/ |
---|
350 | char EmptyChar[LONGNOM]; /* An empty char */ |
---|
351 | char curfilename[LONGNOM]; |
---|
352 | char nomfileoutput[LONGNOM]; |
---|
353 | char curbuf[100*LONGNOM]; |
---|
354 | char motparse[LONGNOM]; |
---|
355 | char charusemodule[LONGNOM]; |
---|
356 | char subofagrifinitgrids[LONGNOM]; |
---|
357 | char motparse1[LONGNOM]; |
---|
358 | char curfile[LONGNOM]; /* name of the current file */ |
---|
359 | char mainfile[LONGNOM]; /* name of the configuration file */ |
---|
360 | char nomdir[LONGNOM]; /* name of the directory where include files are put */ |
---|
361 | char commondirout[LONGNOM]; /* name of the directory where comon files are put */ |
---|
362 | char commondirin[LONGNOM]; /* name of the directory containing the common files */ |
---|
363 | char filetoparse[LONGNOM]; /* name of the file where all the module file are listed */ |
---|
364 | |
---|
365 | FILE *fortranout; /* Output File */ |
---|
366 | FILE *fortranin; /* Input File */ |
---|
367 | FILE *oldfortranout; |
---|
368 | FILE *subloop; |
---|
369 | FILE *commontomoduleout; |
---|
370 | FILE *paramtomoduleout; |
---|
371 | FILE *inputmodule; |
---|
372 | FILE *allocationagrif; |
---|
373 | |
---|
374 | long int pos_cur; /* current position in the output file */ |
---|
375 | long int pos_curagrifparent; |
---|
376 | /* current position in the output file */ |
---|
377 | long int pos_curcall; /* current position in the output file */ |
---|
378 | long int pos_curuse; /* current position in the output file */ |
---|
379 | long int pos_cur_decl; /* current position in the output file */ |
---|
380 | long int pos_curdata; /* current position in the output file */ |
---|
381 | long int pos_curparameter;/* current position in the output file */ |
---|
382 | long int pos_curcommon; /* current position in the output file */ |
---|
383 | long int pos_curinit; /* current position in the output file */ |
---|
384 | long int pos_curinclude; /* final position of a line in file */ |
---|
385 | long int pos_end; /* final position of a line in file */ |
---|
386 | |
---|
387 | variable *variabletempo; |
---|
388 | variable *curvar; |
---|
389 | |
---|
390 | listdim *curdim; |
---|
391 | listdim *commondim; |
---|
392 | |
---|
393 | /******************************************************************************/ |
---|
394 | /*********** Declaration of externals subroutines *****************************/ |
---|
395 | /***************************************************** ************************/ |
---|
396 | |
---|
397 | /******************************************************************************/ |
---|
398 | /*********** UtilNotGridDep.c *************************************************/ |
---|
399 | /******************************************************************************/ |
---|
400 | extern void ajoutenotgriddep (char *name); |
---|
401 | extern void RemoveNotgriddependFromGlobliste(); |
---|
402 | extern int VarIsNonGridDepend(char *name); |
---|
403 | extern void NonGridDepDeclaration_0(listvar *listtomodify); |
---|
404 | /******************************************************************************/ |
---|
405 | /*********** WriteInFile.c ****************************************************/ |
---|
406 | /******************************************************************************/ |
---|
407 | extern void tofich_reste (FILE * filout, char *s,int returnlineornot); |
---|
408 | extern void tofich (FILE * filout, char *s,int returnlineornot); |
---|
409 | extern void tofich_blanc (FILE * filout, int size); |
---|
410 | extern void RemoveWordCUR_0(FILE * filout, long int position, |
---|
411 | long int sizetoremove); |
---|
412 | extern void RemoveWordSET_0(FILE * filout, long int position, |
---|
413 | long int sizetoremove); |
---|
414 | /******************************************************************************/ |
---|
415 | /*********** Writedeclarations.c **********************************************/ |
---|
416 | /******************************************************************************/ |
---|
417 | extern void WriteBeginDeclaration(variable *v,char ligne[LONGLIGNE]); |
---|
418 | extern void WriteScalarDeclaration(variable *v,char ligne[LONGLIGNE]); |
---|
419 | extern void WriteTableDeclaration(variable * v,char ligne[LONGLIGNE],int tmpok); |
---|
420 | extern void writevardeclaration (listvar * var_record, FILE *fileout); |
---|
421 | extern void NonGridDepDeclaration(listvar * deb_common); |
---|
422 | extern void writedeclaration (listvar * deb_common, FILE *fileout, |
---|
423 | listvar *presentinthislist); |
---|
424 | extern void writesub_loopdeclaration (listvar * deb_common, FILE *fileout); |
---|
425 | extern void writedeclarationintoamr (listvar * deb_common, FILE *fileout, |
---|
426 | listvar *listin , char commonname[LONGNOM]); |
---|
427 | extern void writedeclarationsubroutinedeclaration(listvar * deb_common, |
---|
428 | FILE *fileout,listvar *listin); |
---|
429 | /******************************************************************************/ |
---|
430 | /*********** WorkWithvarofsubroutineliste.c ***********************************/ |
---|
431 | /******************************************************************************/ |
---|
432 | extern void CleanThelistvarofsubroutineliste(); |
---|
433 | extern void UpdatevarofsubroutinelisteWithcommonlist(); |
---|
434 | extern void ajoutvarofsubroutine_1(listvar *listtoadd); |
---|
435 | extern void UpdatevarsubroutineWithvarofsubroutinelist_1(); |
---|
436 | /******************************************************************************/ |
---|
437 | /*********** toamr.c **********************************************************/ |
---|
438 | /******************************************************************************/ |
---|
439 | extern char *variablenameroottabvars (variable * var); |
---|
440 | extern char *variablenametabvars (variable * var, int iorindice); |
---|
441 | extern char *variablecurgridtabvars (variable * var,int ParentOrCurgrid); |
---|
442 | extern char *vargridnametabvars (variable * var,int iorindice); |
---|
443 | extern char *vargridcurgridtabvars (variable * var,int ParentOrCurgrid); |
---|
444 | extern char *vargridparam (variable * v, int whichone); |
---|
445 | extern void write_probdimagrif_file(); |
---|
446 | extern void write_keysagrif_file(); |
---|
447 | extern void write_clusteringagrif_file(); |
---|
448 | extern void write_modtypeagrif_file(); |
---|
449 | extern void write_createvarnameagrif_file(variable *v,FILE *createvarname, |
---|
450 | int *InitEmpty); |
---|
451 | extern void write_Setnumberofcells_file(); |
---|
452 | extern void write_Getnumberofcells_file(); |
---|
453 | extern void write_initialisationsagrif_file(variable *v,FILE *initproc, |
---|
454 | int *VarnameEmpty); |
---|
455 | extern listnom *write_allocation(listvar *newvar,variable *v, |
---|
456 | listnom *listedesnoms, |
---|
457 | FILE *alloccalls, |
---|
458 | FILE *AllocUSE, |
---|
459 | FILE *modulealloc, |
---|
460 | int *IndiceMax); |
---|
461 | extern void creefichieramr (char *NameTampon); |
---|
462 | /******************************************************************************/ |
---|
463 | /*********** dependfile.c *****************************************************/ |
---|
464 | /******************************************************************************/ |
---|
465 | extern void Writethedependnbxnbyfile(); |
---|
466 | extern void Readthedependnbxnbyfile(); |
---|
467 | extern void Writethedependlistofmoduleused(char *NameTampon ); |
---|
468 | extern void Readthedependlistofmoduleused(char *NameTampon); |
---|
469 | extern void WritedependParameterList(char *NameTampon ); |
---|
470 | extern listparameter *ReaddependParameterList(char *NameTampon, |
---|
471 | listparameter *listout); |
---|
472 | extern void Writethedependfile(char *NameTampon, listvar *input ); |
---|
473 | extern listvar *Readthedependfile( char *NameTampon , listvar *listout); |
---|
474 | extern void Writethedependavailablefile(); |
---|
475 | extern void Readthedependavailablefile(); |
---|
476 | extern int Did_filetoparse_readed(char *NameTampon); |
---|
477 | /******************************************************************************/ |
---|
478 | /*********** SubLoopCreation.c ************************************************/ |
---|
479 | /******************************************************************************/ |
---|
480 | extern void writeheadnewsub_0(); |
---|
481 | extern void writesubroutinedeclaration_0(listvar *listtomodify); |
---|
482 | extern void WriteVariablelist_subloop(FILE *outputfile); |
---|
483 | extern void WriteVariablelist_subloop_Call(FILE *outputfile); |
---|
484 | extern void WriteVariablelist_subloop_Def(FILE *outputfile); |
---|
485 | extern void WriteHeadofSubroutineLoop(); |
---|
486 | extern void closeandcallsubloopandincludeit_0(int suborfun, |
---|
487 | char endsub[LONGNOM], char optname[LONGNOM]); |
---|
488 | /******************************************************************************/ |
---|
489 | /*********** WorkWithglobliste.c **********************************************/ |
---|
490 | /******************************************************************************/ |
---|
491 | extern void CompareNewparsingandoldone(); |
---|
492 | extern void ajoutevar_1(listvar *listtoadd); |
---|
493 | extern void ajoutevarsave_1(listvar *listtoadd); |
---|
494 | extern void UpdateIndiceTabvarsofGlobliste(); |
---|
495 | extern void UpdateIndiceTabvarsofGloblisteFromCommon(); |
---|
496 | extern void UpdateGloblisteWithcommonlist_1(); |
---|
497 | /******************************************************************************/ |
---|
498 | /*********** WorkWithlistvarindoloop.c ****************************************/ |
---|
499 | /******************************************************************************/ |
---|
500 | extern void cleanlistvarfordoloop_1(int endsuborfunc); |
---|
501 | extern void ajoutevarindoloop_1(char *ident); |
---|
502 | extern void ajoutevarindoloop_definedimension (char *name); |
---|
503 | extern void CleanFromThelistvarindoloopTheAgrifSubArguments(); |
---|
504 | extern void CleanThelistvarindoloop (); |
---|
505 | extern void ModifyThelistvarindoloop(); |
---|
506 | extern void CompleteThelistvarindoloop(); |
---|
507 | /******************************************************************************/ |
---|
508 | /*********** WorkWithlistdatavariable.c ***************************************/ |
---|
509 | /******************************************************************************/ |
---|
510 | extern void CompleteDataList (char *name,char *values); |
---|
511 | extern void CompleteGlobListeWithDatalist_1(); |
---|
512 | /******************************************************************************/ |
---|
513 | /*********** UtilAgrif.c ******************************************************/ |
---|
514 | /******************************************************************************/ |
---|
515 | extern void Instanciation_0(char *ident); |
---|
516 | extern int Vartonumber(char *tokname); |
---|
517 | extern int Agrif_in_Tok_NAME(char *tokname); |
---|
518 | extern void completeListofvariableinagriffunction_1(char *ident); |
---|
519 | extern void ModifyTheVariableName_0(char *ident); |
---|
520 | extern void AddsubroutineTolistsubwhereagrifused(); |
---|
521 | extern void AddUseAgrifUtil_0(); |
---|
522 | extern void NotifyAgrifFunction_0(char *ident); |
---|
523 | extern void ModifyTheAgrifFunction_0(char *ident); |
---|
524 | extern void AgriffunctionModify_0(char *ident,int whichone); |
---|
525 | extern void AddUseAgrifInModuleDeclaration_0(); |
---|
526 | /******************************************************************************/ |
---|
527 | /*********** WorkWithParameterlist.c ******************************************/ |
---|
528 | /******************************************************************************/ |
---|
529 | extern void AddvartoParamlist_1(listvar *listin); |
---|
530 | extern void UpdateparameterlistWithlistvarindoloop_1(); |
---|
531 | /******************************************************************************/ |
---|
532 | /*********** WorkWithAllocatelist.c *******************************************/ |
---|
533 | /******************************************************************************/ |
---|
534 | extern void AddIdentToTheAllocateList_1(char *nom); |
---|
535 | extern int IsAllocateInThisSubroutine_0(); |
---|
536 | extern int IsVarAllocatable_0(char *ident); |
---|
537 | extern int varisallocatable_0(char *ident); |
---|
538 | /******************************************************************************/ |
---|
539 | /*********** UtilCharacter.c **************************************************/ |
---|
540 | /******************************************************************************/ |
---|
541 | extern void FindAndChangeNameToTabvars(char name[LONGNOM], |
---|
542 | char toprint[LONGNOM],listvar * listtosee, int ParentOrCurgrid); |
---|
543 | extern char *ChangeTheInitalvaluebyTabvarsName(char *nom,listvar *listtoread, |
---|
544 | int whichone); |
---|
545 | extern int IsVariableReal(char *nom); |
---|
546 | extern void IsVarInUseFile(char *nom); |
---|
547 | extern listnom *DecomposeTheNameinlistnom(char *nom, listnom * listout); |
---|
548 | extern void DecomposeTheName(char *nom); |
---|
549 | /******************************************************************************/ |
---|
550 | /*********** UtilListe.c ******************************************************/ |
---|
551 | /******************************************************************************/ |
---|
552 | extern listvar *AddListvarToListvar(listvar *l,listvar *glob, |
---|
553 | int ValueFirstpass); |
---|
554 | extern void CreateAndFillin_Curvar(char *type,char *tokname, |
---|
555 | listdim *dims,variable *curvar); |
---|
556 | extern void duplicatelistvar(listvar * orig); |
---|
557 | extern listdim *insertdim(listdim *lin,typedim nom); |
---|
558 | extern void change_dim_char(listdim *lin,listvar * l); |
---|
559 | extern int num_dims(listdim *d); |
---|
560 | extern variable *createvar(char *nom,listdim *d); |
---|
561 | extern listvar *insertvar(listvar *lin,variable *v); |
---|
562 | extern listvar *settype(char *nom,listvar *lin); |
---|
563 | /******************************************************************************/ |
---|
564 | /*********** UtilFile.c *******************************************************/ |
---|
565 | /******************************************************************************/ |
---|
566 | extern FILE * associate (char *filename); |
---|
567 | extern FILE * associateaplus (char *filename); |
---|
568 | extern long int setposcur(); |
---|
569 | extern long int setposcurinoldfortranout(); |
---|
570 | extern void copyuse_0(char *namemodule); |
---|
571 | extern void copyuseonly_0(char *namemodule); |
---|
572 | /******************************************************************************/ |
---|
573 | /*********** WorkWithlistofmodulebysubroutine.c *******************************/ |
---|
574 | /******************************************************************************/ |
---|
575 | extern void RecordUseModulesVariables(); |
---|
576 | extern void RecordUseModulesUseModulesVariables(); |
---|
577 | extern void Addmoduletothelist_1(char *name); |
---|
578 | extern void Addmoduletothelist(char *name); |
---|
579 | extern void WriteUsemoduleDeclaration(); |
---|
580 | /******************************************************************************/ |
---|
581 | /*********** WorkWithlistmoduleinfile.c ***************************************/ |
---|
582 | /******************************************************************************/ |
---|
583 | extern void FillInlistmodule_1(); |
---|
584 | extern void AllocShouldMadeTo0InModule_1(); |
---|
585 | extern void AllocShouldMadeTo1InModule_1(); |
---|
586 | extern void AllocTo1InModule_1(); |
---|
587 | extern int AllocShouldMadeInModule(); |
---|
588 | extern int AllocInModule(); |
---|
589 | /******************************************************************************/ |
---|
590 | /*********** UtilFortran.c ****************************************************/ |
---|
591 | /******************************************************************************/ |
---|
592 | extern void initdimprob(int dimprobmod, char * nx, char * ny,char* nz); |
---|
593 | extern int Variableshouldberemove(char *nom); |
---|
594 | extern int variableisglobal(listvar *curvar, listvar *listin); |
---|
595 | extern void variableisglobalinmodule(listcouple *listin, char *module, |
---|
596 | FILE *fileout); |
---|
597 | extern int variableisparameterglobal(listvar *curvar, listparameter *listin); |
---|
598 | extern void addsubroutine_alloc_0(int moduleorcontains); |
---|
599 | extern int IsTabvarsUseInArgument_0(); |
---|
600 | extern int ImplicitNoneInSubroutine(); |
---|
601 | extern int varispointer_0(char *ident); |
---|
602 | extern int VariableIsNotFunction(char *ident); |
---|
603 | /******************************************************************************/ |
---|
604 | /*********** DiversListe.c ****************************************************/ |
---|
605 | /******************************************************************************/ |
---|
606 | extern void Addtolistvarcommon(); |
---|
607 | extern listnom *Addtolistnom(char *nom, listnom *listin); |
---|
608 | extern listname *Addtolistname(char *nom,listname *input); |
---|
609 | extern int ModuleIsDefineInInputFile(char *name); |
---|
610 | extern void AddNameToListNamelist_1(char * name); |
---|
611 | extern void Addmoduletothelisttmp(char *name); |
---|
612 | extern void Add_ModuleTo_Modulelist_1(char *nom); |
---|
613 | extern void completelistvarpointtovar_1(char *namemodule, |
---|
614 | listcouple *couple); |
---|
615 | extern void Addincludetothelist_1(char *name); |
---|
616 | extern void WriteIncludeDeclaration(); |
---|
617 | /******************************************************************************/ |
---|
618 | extern void processfortran(char *fichier_entree); |
---|