Changeset 530 for trunk/AGRIF/LIB/decl.h
- Timestamp:
- 2006-10-17T17:36:11+02:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AGRIF/LIB/decl.h
r396 r530 3 3 /* CONV (converter) for Agrif (Adaptive Grid Refinement In Fortran) */ 4 4 /* */ 5 /* Copyright (C) 2005 Laurent Debreu (Laurent.Debreu@imag.fr)*/5 /* Copyright or © or Copr. Laurent Debreu (Laurent.Debreu@imag.fr) */ 6 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". */ 7 12 /* */ 8 /* This program is free software; you can redistribute it and/or modify */ 9 /* it */ 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. */ 10 18 /* */ 11 /* This program is distributed in the hope that it will be useful, */ 12 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 13 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 14 /* GNU General Public License for more details. */ 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. */ 15 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 */ 16 34 /******************************************************************************/ 17 35 #define LONGNOM 800 … … 42 60 listdim *dimension; 43 61 int nbdim; 44 struct variable *vinit;45 62 int common; 46 63 int positioninblock; … … 55 72 char vallengspec[LONGNOM]; 56 73 char nameinttypename[LONGNOM]; 57 int lengspecgiven;58 74 int pointedvar; 59 75 char commoninfile[LONGNOM]; … … 62 78 int c_star; 63 79 int typegiven; 64 int isparameter;65 80 char precision[LONGNOM]; 66 81 char initialvalue[LONGNOM]; … … 92 107 char nomvar[LONGNOM] ; 93 108 char commonname[LONGNOM]; 94 char commoninfile[LONGNOM];95 109 char subroutinename[LONGNOM]; 96 110 int dimensiongiven; … … 132 146 } listname ; /* list of names */ 133 147 134 listname *listimplicitnone;135 148 136 149 typedef struct listmodule 137 150 { 138 151 char module[LONGNOM]; 139 int InstanceShouldMade;140 int Instance;152 int AllocShouldMade; 153 int Alloc; 141 154 struct listmodule * suiv; 142 155 } listmodule; /* list of names */ … … 185 198 186 199 187 typedef struct listparameters188 {189 char initial[LONGNOM];190 char nom[LONGNOM];191 char subroutinename[LONGNOM];192 struct listparameters * suiv;193 } listparameters; /* list of parameters */194 195 typedef struct196 {197 char name[LONGNOM];198 char filename[LONGNOM];199 int inclcommon;200 listvar *lvar;201 } common;202 203 typedef struct listcommons204 {205 common *curcommon ;206 struct listcommons *suiv;207 } listcommons ;208 209 210 typedef struct listcommonsname211 {212 char nom[LONGNOM] ;213 listnom *subroutine;214 struct listcommonsname *suiv;215 } listcommonsname ;216 217 218 219 200 int fortran77; /* = 1; the code has been writen in */ 220 201 /* fortran77 else in fortran 90 */ … … 226 207 char commonvar[LONGNOM]; 227 208 char commonblockname[LONGNOM]; 228 listdim *commondim;229 209 230 210 /******************************************************************************/ … … 233 213 int inagrifcallargument; 234 214 int adduseagrifutil; 235 215 int sameagrifargument; 236 216 int InAgrifParentDef; 237 217 char sameagrifname[LONGNOM]; 238 218 /******************************************************************************/ 239 219 /**************** *** VAR DEF Variables *** *******************************/ … … 245 225 int PrivateDeclare; /* Variable has been declared as PRIVATE */ 246 226 int ExternalDeclare; /* Variable has been declared as EXTERNAL */ 247 int PrecisionGiven; /* A precision has been given for the variable */248 int CharacterSizeGiven; /* A size for the character has been given */249 227 int InitialValueGiven; /* An initial value has been given */ 250 228 int formatdeclare; 251 int inttypename;252 229 int Allocatabledeclare; 253 int lengspecgiven;254 230 int SaveDeclare; 255 231 int pointerdeclare; … … 257 233 int VariableIsParameter; 258 234 int dimsgiven; 259 int IntentDeclare;260 235 int c_star; 261 236 char DeclType[LONGNOM]; … … 277 252 /**************** *** CONV Variables *** **********************************/ 278 253 /******************************************************************************/ 279 int coeffrafx; /* space refinement factor in the x */280 int coeffrafy; /* space refinement factor in the y */281 int coeffrafz; /* space refinement factor in the z */282 int coeffraftx; /* time refinement factor in the x */283 int coeffrafty; /* time refinement factor in the y */284 int coeffraftz; /* time refinement factor in the z */285 int regridding; /* number of time steps between two regridding */286 254 int dimprob ; /* dimension of the problem : 1 for 1D,2 for 2D, */ 287 255 /* 3 for 3D */ 288 int rafmaxx;289 int rafmaxy;290 int rafmaxz;291 int userefficiency; /* = 1 efficiency is given in the input */292 int minwidth; /* minimum width of the rectangles in the */293 /* clustering algorithm */294 256 int onlyfixedgrids; /* = 1 if onlyfixedgrids is true */ 295 257 int todebug; 296 258 int fixedgrids; /* = 1 if fixedgrids is true */ 297 int efficiency; /* efficacity of the clustering algorithm */298 /* (by percent) */299 259 char nbmaillesX[LONGNOM]; /* number of cells in the x direction */ 300 260 char nbmaillesY[LONGNOM]; /* number of cells in the y direction */ … … 304 264 int IndicenbmaillesZ; 305 265 306 listvar *listvartempo;307 variable *variabletempo;308 309 listdim *curdim;310 variable *curvar;311 266 listvar *globliste; 312 listvar *globvarforcommon;313 267 listvar *globparam; 314 268 listvar *listdatavariable; … … 324 278 listvar *functionlistvar; 325 279 listvar *listenotgriddepend; /* List of the variables which are not grid dependent */ 280 listvar *listvartempo; 281 listvar *listduplicated; 282 326 283 listvarcommon *commonlist; 284 285 listname *listimplicitnone; 286 327 287 listusemodule *listofmodulebysubroutine; 328 288 listusemodule *listofincludebysubroutine; 329 289 listusemodule *listofmoduletmp; 330 290 listusemodule *tmpuselocallist; 291 331 292 listparameter *tmpparameterlocallist2; 332 293 listparameter *tmpparameterlocallist; 294 333 295 listmodule *listmoduleinfile; 296 334 297 listnamelist *listenamelist; 298 335 299 listnom *NewModuleList; 336 300 listnom *listofmodules; … … 338 302 listnom *Listofvariableinagriffunction; 339 303 listnom *listofsubroutinewhereagrifisused; 304 340 305 listallocate *AllocateList; 306 341 307 listvarpointtovar *Listofvarpointtovar; 342 308 /* variables which are pointed to an other one */ 309 343 310 listindice *Listofavailableindices; 344 311 /* List of available indices in the tabvars table */ 312 345 313 int indeclarationvar; 346 314 int inmodulemeet; … … 365 333 int insubroutinedeclare; 366 334 int tmpdeclaration_everdone; 335 int paramdeclaration_everdone; 336 int inmoduledeclare; 337 int AllocEmpty; 338 int dimsempty; 339 int created_dimensionlist; 340 367 341 char meetagrifinitgrids[LONGNOM]; 368 342 char meetmpiinit[LONGNOM]; 369 343 char mpiinitvar[LONGNOM]; 370 int paramdeclaration_everdone;371 int inmoduledeclare;372 int IntegerIShouldBeAdd;373 int AllocEmpty;374 int dimsempty;375 344 char *NameTamponfile; 376 345 char toprintglob[LONGNOM]; … … 380 349 char OriginalFileName[LONGNOM]; /* Name of the parsing file*/ 381 350 char EmptyChar[LONGNOM]; /* An empty char */ 382 char commonfile[LONGNOM];383 351 char curfilename[LONGNOM]; 384 char commonfile_main[LONGNOM]; /* name of the common file */385 352 char nomfileoutput[LONGNOM]; 386 353 char curbuf[100*LONGNOM]; … … 418 385 long int pos_end; /* final position of a line in file */ 419 386 387 variable *variabletempo; 388 variable *curvar; 389 390 listdim *curdim; 391 listdim *commondim; 420 392 421 393 /******************************************************************************/ … … 429 401 extern void RemoveNotgriddependFromGlobliste(); 430 402 extern int VarIsNonGridDepend(char *name); 431 extern void DECL_0_NonGridDepDeclaration(listvar *listtomodify);403 extern void NonGridDepDeclaration_0(listvar *listtomodify); 432 404 /******************************************************************************/ 433 405 /*********** WriteInFile.c ****************************************************/ … … 436 408 extern void tofich (FILE * filout, char *s,int returnlineornot); 437 409 extern void tofich_blanc (FILE * filout, int size); 438 extern void RemoveWordCUR (FILE * filout, long int position,439 long int sizetoremove);440 extern void RemoveWordSET (FILE * filout, long int position,441 long int sizetoremove);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); 442 414 /******************************************************************************/ 443 415 /*********** Writedeclarations.c **********************************************/ … … 446 418 extern void WriteScalarDeclaration(variable *v,char ligne[LONGLIGNE]); 447 419 extern void WriteTableDeclaration(variable * v,char ligne[LONGLIGNE],int tmpok); 448 extern void ModifTableDeclaration(variable * v,char ligne[LONGLIGNE]);449 420 extern void writevardeclaration (listvar * var_record, FILE *fileout); 450 421 extern void NonGridDepDeclaration(listvar * deb_common); … … 461 432 extern void CleanThelistvarofsubroutineliste(); 462 433 extern void UpdatevarofsubroutinelisteWithcommonlist(); 463 extern void OPTI_1_ajoutvarofsubroutine(listvar *listtoadd);464 extern void COM_1_UpdatevarsubroutineWithvarofsubroutinelist();434 extern void ajoutvarofsubroutine_1(listvar *listtoadd); 435 extern void UpdatevarsubroutineWithvarofsubroutinelist_1(); 465 436 /******************************************************************************/ 466 437 /*********** toamr.c **********************************************************/ … … 473 444 extern char *vargridparam (variable * v, int whichone); 474 445 extern void write_probdimagrif_file(); 475 extern void write_includeagrif_file();476 446 extern void write_keysagrif_file(); 477 447 extern void write_clusteringagrif_file(); … … 486 456 listnom *listedesnoms, 487 457 FILE *alloccalls, 488 FILE * instanceUSE,458 FILE *AllocUSE, 489 459 FILE *modulealloc, 490 460 int *IndiceMax); … … 493 463 /*********** dependfile.c *****************************************************/ 494 464 /******************************************************************************/ 495 extern void Writethedependnbxnbyfile _fromgloliste();496 extern void Readthedependnbxnbyfile _fromgloliste();465 extern void Writethedependnbxnbyfile(); 466 extern void Readthedependnbxnbyfile(); 497 467 extern void Writethedependlistofmoduleused(char *NameTampon ); 498 468 extern void Readthedependlistofmoduleused(char *NameTampon); … … 501 471 listparameter *listout); 502 472 extern void Writethedependfile(char *NameTampon, listvar *input ); 503 extern void Recordtmplocallist( char *NameTampon); 504 extern listvar *Recordglobalvarofusefile( char *NameTampon , listvar *listout); 473 extern listvar *Readthedependfile( char *NameTampon , listvar *listout); 505 474 extern void Writethedependavailablefile(); 506 475 extern void Readthedependavailablefile(); … … 509 478 /*********** SubLoopCreation.c ************************************************/ 510 479 /******************************************************************************/ 511 extern void OPTI_0_writeheadnewsubforsub(); 512 extern void OPTI_0_writeheadnewsubforfunc(); 513 extern void OPTI_0_writesubroutinedeclaration(listvar *listtomodify); 514 extern void WriteVariablelist_subloop(FILE *outputfile); 515 extern void WriteVariablelist_subloop_Call(FILE *outputfile); 516 extern void WriteVariablelist_subloop_Def(FILE *outputfile); 517 extern void WriteHeadofSubroutineLoop(); 518 extern void OPTI_0_closeandcallsubloopandincludeit(int suborfun, 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, 519 487 char endsub[LONGNOM], char optname[LONGNOM]); 520 488 /******************************************************************************/ … … 522 490 /******************************************************************************/ 523 491 extern void CompareNewparsingandoldone(); 524 extern void decl_1_ajoutevar(listvar *listtoadd);525 extern void decl_1_ajoutevarsave(listvar *listtoadd);492 extern void ajoutevar_1(listvar *listtoadd); 493 extern void ajoutevarsave_1(listvar *listtoadd); 526 494 extern void UpdateIndiceTabvarsofGlobliste(); 527 495 extern void UpdateIndiceTabvarsofGloblisteFromCommon(); 528 extern void COM_1_UpdateGloblisteWithcommonlist();496 extern void UpdateGloblisteWithcommonlist_1(); 529 497 /******************************************************************************/ 530 498 /*********** WorkWithlistvarindoloop.c ****************************************/ 531 499 /******************************************************************************/ 532 extern void OPTI_1_cleanlistvarfordoloop(int endsuborfunc); 533 extern void OPTI_1_ajoutevarindoloop(char *ident); 534 extern void ajoutevarindoloop (char *name); 500 extern void cleanlistvarfordoloop_1(int endsuborfunc); 501 extern void ajoutevarindoloop_1(char *ident); 535 502 extern void ajoutevarindoloop_definedimension (char *name); 536 503 extern void CleanFromThelistvarindoloopTheAgrifSubArguments(); … … 539 506 extern void CompleteThelistvarindoloop(); 540 507 /******************************************************************************/ 541 /*********** test.c ***********************************************************/542 /******************************************************************************/543 extern int tests_entrees();544 /******************************************************************************/545 508 /*********** WorkWithlistdatavariable.c ***************************************/ 546 509 /******************************************************************************/ 547 extern void DATA_n_CompleteDataList (char *name,char *values);548 extern void DATA_1_CompleteGlobListeWithDatalist();510 extern void CompleteDataList (char *name,char *values); 511 extern void CompleteGlobListeWithDatalist_1(); 549 512 /******************************************************************************/ 550 513 /*********** UtilAgrif.c ******************************************************/ 551 514 /******************************************************************************/ 552 extern int AGRIF_n_Vartonumber(char *tokname); 553 extern int AGRIF_n_Agrif_in_Tok_NAME(char *tokname); 554 extern void AGRIF_1_completeListofvariableinagriffunction(char *ident); 555 extern void AGRIF_0_ModifyTheVariableName(char *ident); 556 extern void AGRIF_n_AddsubroutineTolistsubwhereagrifused(); 557 extern void AGRIF_n_AddUseAgrifUtil(); 558 extern void AGRIF_0_NotifyAgrifFunction(char *ident); 559 extern void AGRIF_0_ModifyTheAgrifFunction(char *ident); 560 extern void AGRIF_0_AgriffunctionModify(char *ident,int whichone); 561 extern void AGRIF_0_AddUseAgrifInModuleDeclaration(); 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(); 562 526 /******************************************************************************/ 563 527 /*********** WorkWithParameterlist.c ******************************************/ 564 528 /******************************************************************************/ 565 extern void COM_1_AddvartoParamlist(listvar *listin);566 extern void COM_1_UpdateparameterlistWithlistvarindoloop();529 extern void AddvartoParamlist_1(listvar *listin); 530 extern void UpdateparameterlistWithlistvarindoloop_1(); 567 531 /******************************************************************************/ 568 532 /*********** WorkWithAllocatelist.c *******************************************/ 569 533 /******************************************************************************/ 570 extern void OPTI_1_AddIdentToTheAllocateList(char *nom);571 extern int OPTI_0_IsAllocateInThisSubroutine();572 extern int OPTI_0_IsVarAllocatable(char *ident);573 extern int OPTI_0_varisallocatable(char *ident);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); 574 538 /******************************************************************************/ 575 539 /*********** UtilCharacter.c **************************************************/ … … 579 543 extern char *ChangeTheInitalvaluebyTabvarsName(char *nom,listvar *listtoread, 580 544 int whichone); 545 extern int IsVariableReal(char *nom); 581 546 extern void IsVarInUseFile(char *nom); 582 547 extern listnom *DecomposeTheNameinlistnom(char *nom, listnom * listout); … … 589 554 extern void CreateAndFillin_Curvar(char *type,char *tokname, 590 555 listdim *dims,variable *curvar); 591 extern listvar *duplicatelistvar(listvar * orig);556 extern void duplicatelistvar(listvar * orig); 592 557 extern listdim *insertdim(listdim *lin,typedim nom); 593 extern listdim *reverse(listdim *lin);594 558 extern void change_dim_char(listdim *lin,listvar * l); 595 559 extern int num_dims(listdim *d); … … 604 568 extern long int setposcur(); 605 569 extern long int setposcurinoldfortranout(); 606 extern void decl_0_modifdeclarationssave(listvar *listtomodify); 607 extern void OPTI_0_copyuse(char *namemodule); 608 extern void OPTI_0_copyuseonly(char *namemodule); 570 extern void copyuse_0(char *namemodule); 571 extern void copyuseonly_0(char *namemodule); 609 572 /******************************************************************************/ 610 573 /*********** WorkWithlistofmodulebysubroutine.c *******************************/ 611 574 /******************************************************************************/ 612 575 extern void RecordUseModulesVariables(); 613 extern void RecordUseModulesUseModulesVariables(); 576 extern void RecordUseModulesUseModulesVariables(); 577 extern void Addmoduletothelist_1(char *name); 614 578 extern void Addmoduletothelist(char *name); 615 579 extern void WriteUsemoduleDeclaration(); … … 617 581 /*********** WorkWithlistmoduleinfile.c ***************************************/ 618 582 /******************************************************************************/ 619 extern void MOD_1_FillInlistmodule();620 extern void MOD_1_InstanceShouldMadeTo0InModule();621 extern void MOD_1_InstanceShouldMadeTo1InModule();622 extern void MOD_1_InstanceTo1InModule();623 extern int MOD_n_InstanceShouldMadeInModule();624 extern int MOD_n_InstanceInModule();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(); 625 589 /******************************************************************************/ 626 590 /*********** UtilFortran.c ****************************************************/ … … 629 593 extern int Variableshouldberemove(char *nom); 630 594 extern int variableisglobal(listvar *curvar, listvar *listin); 595 extern void variableisglobalinmodule(listcouple *listin, char *module, 596 FILE *fileout); 631 597 extern int variableisparameterglobal(listvar *curvar, listparameter *listin); 632 extern void add i_0_addsubroutine_inst_back_alloc(int moduleorcontains);633 extern int OPTI_0_IsTabvarsUseInArgument();598 extern void addsubroutine_alloc_0(int moduleorcontains); 599 extern int IsTabvarsUseInArgument_0(); 634 600 extern int ImplicitNoneInSubroutine(); 635 extern int OPTI_0_varispointer(char *ident); 601 extern int varispointer_0(char *ident); 602 extern int VariableIsNotFunction(char *ident); 636 603 /******************************************************************************/ 637 604 /*********** DiversListe.c ****************************************************/ 638 605 /******************************************************************************/ 639 extern void COM_1_AddCommonvartolist();606 extern void Addtolistvarcommon(); 640 607 extern listnom *Addtolistnom(char *nom, listnom *listin); 641 extern listname *Add_listname(char *nom,listname *input); 642 extern void Add_ModuleTo_listofmodules(char *nom); 608 extern listname *Addtolistname(char *nom,listname *input); 643 609 extern int ModuleIsDefineInInputFile(char *name); 644 extern void AddNameToListNamelist (char * name);610 extern void AddNameToListNamelist_1(char * name); 645 611 extern void Addmoduletothelisttmp(char *name); 646 extern void Add_ModuleTo_Modulelist (char *nom);647 extern void OPTI_1_completelistvarpointtovar(char *namemodule,612 extern void Add_ModuleTo_Modulelist_1(char *nom); 613 extern void completelistvarpointtovar_1(char *namemodule, 648 614 listcouple *couple); 649 extern void Addincludetothelist (char *name);615 extern void Addincludetothelist_1(char *name); 650 616 extern void WriteIncludeDeclaration(); 651 617 /******************************************************************************/
Note: See TracChangeset
for help on using the changeset viewer.