[396] | 1 | /******************************************************************************/ |
---|
| 2 | /* */ |
---|
| 3 | /* CONV (converter) for Agrif (Adaptive Grid Refinement In Fortran) */ |
---|
| 4 | /* */ |
---|
[663] | 5 | /* Copyright or or Copr. Laurent Debreu (Laurent.Debreu@imag.fr) */ |
---|
| 6 | /* Cyril Mazauric (Cyril_Mazauric@yahoo.fr) */ |
---|
[530] | 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". */ |
---|
[396] | 12 | /* */ |
---|
[530] | 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. */ |
---|
[396] | 18 | /* */ |
---|
[530] | 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. */ |
---|
[396] | 29 | /* */ |
---|
[530] | 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. */ |
---|
[396] | 32 | /******************************************************************************/ |
---|
[774] | 33 | /* version 1.7 */ |
---|
[530] | 34 | /******************************************************************************/ |
---|
[1200] | 35 | #define LONGNOM 8000 |
---|
[396] | 36 | |
---|
[1200] | 37 | #define LONG_C 3000 |
---|
| 38 | #define LONG_4C 4000 |
---|
[774] | 39 | #define LONG_4M 4000 |
---|
| 40 | #define LONG_40M 40000 |
---|
| 41 | |
---|
[396] | 42 | /******************************************************************************/ |
---|
| 43 | /*********** Declaration of structures used in conv ***************************/ |
---|
| 44 | /******************************************************************************/ |
---|
| 45 | |
---|
[663] | 46 | typedef struct |
---|
[396] | 47 | { |
---|
[774] | 48 | char first[LONG_C]; |
---|
| 49 | char last[LONG_C]; |
---|
[396] | 50 | } typedim ; /* fortran dimension as 'ndeb:nfin' */ |
---|
| 51 | |
---|
[663] | 52 | typedef struct listdim |
---|
| 53 | { |
---|
[396] | 54 | typedim dim; |
---|
| 55 | struct listdim *suiv; |
---|
| 56 | } listdim; /* list of the dimensions of a variable */ |
---|
[663] | 57 | |
---|
| 58 | typedef struct variable |
---|
[396] | 59 | { |
---|
[774] | 60 | char v_typevar[LONG_C]; |
---|
| 61 | char v_nomvar[LONG_C] ; |
---|
| 62 | char v_oldname[LONG_C] ; |
---|
| 63 | char v_dimchar[LONG_C]; |
---|
| 64 | char v_modulename[LONG_C]; |
---|
| 65 | char v_commonname[LONG_C]; |
---|
| 66 | char v_vallengspec[LONG_C]; |
---|
| 67 | char v_nameinttypename[LONG_C]; |
---|
| 68 | char v_commoninfile[LONG_C]; |
---|
| 69 | char v_subroutinename[LONG_C]; |
---|
| 70 | char v_precision[LONG_C]; |
---|
| 71 | char v_initialvalue[LONG_4C]; |
---|
| 72 | char v_IntentSpec[LONG_C]; |
---|
| 73 | char v_readedlistdimension[LONG_C]; |
---|
[663] | 74 | int v_nbdim; |
---|
| 75 | int v_common; |
---|
| 76 | int v_positioninblock; |
---|
| 77 | int v_module; |
---|
| 78 | int v_save; |
---|
| 79 | int v_VariableIsParameter; |
---|
| 80 | int v_PublicDeclare; |
---|
| 81 | int v_PrivateDeclare; |
---|
| 82 | int v_ExternalDeclare; |
---|
| 83 | int v_pointedvar; |
---|
| 84 | int v_notgrid; |
---|
| 85 | int v_dimensiongiven; |
---|
| 86 | int v_c_star; |
---|
| 87 | int v_indicetabvars; |
---|
| 88 | int v_pointerdeclare; |
---|
| 89 | int v_optionaldeclare; |
---|
| 90 | int v_allocatable; |
---|
| 91 | int v_dimsempty; |
---|
| 92 | listdim *v_dimension; |
---|
[396] | 93 | } variable ; /* type of a variable */ |
---|
[663] | 94 | /* v_typevar : type (integer, real, ...) */ |
---|
| 95 | /* v_nomvar : name of the variable */ |
---|
| 96 | /* v_dimension : list of dimensions of the variable*/ |
---|
| 97 | /* v_nbdim: 1 if the variable is 1d, etc ... */ |
---|
[396] | 98 | /* precision : Name of the variable which */ |
---|
| 99 | /* determine the precision. example : wp in the */ |
---|
| 100 | /* case where REAL(wp) */ |
---|
[663] | 101 | |
---|
[396] | 102 | typedef struct listvar |
---|
| 103 | { |
---|
| 104 | variable *var ; |
---|
| 105 | struct listvar * suiv; |
---|
| 106 | } listvar ; /* list of variables */ |
---|
| 107 | |
---|
| 108 | |
---|
[663] | 109 | typedef struct listusemodule |
---|
[396] | 110 | { |
---|
[774] | 111 | char u_usemodule[LONG_C]; |
---|
| 112 | char u_charusemodule[LONG_C]; |
---|
| 113 | char u_cursubroutine[LONG_C]; |
---|
| 114 | char u_modulename[LONG_C]; |
---|
[663] | 115 | int u_firstuse; |
---|
[396] | 116 | struct listusemodule * suiv; |
---|
| 117 | } listusemodule; /* list of names */ |
---|
| 118 | |
---|
| 119 | typedef struct listparameter |
---|
| 120 | { |
---|
[774] | 121 | char p_name[LONG_C]; |
---|
| 122 | char p_modulename[LONG_C]; |
---|
[396] | 123 | struct listparameter * suiv; |
---|
| 124 | } listparameter ; /* list of names */ |
---|
| 125 | |
---|
| 126 | typedef struct listname |
---|
| 127 | { |
---|
[774] | 128 | char n_name[LONG_C]; |
---|
[396] | 129 | struct listname* suiv; |
---|
| 130 | } listname ; /* list of names */ |
---|
| 131 | |
---|
[663] | 132 | typedef struct listcouple |
---|
[396] | 133 | { |
---|
[774] | 134 | char c_namevar[LONG_C]; |
---|
| 135 | char c_namepointedvar[LONG_C]; |
---|
[396] | 136 | struct listcouple * suiv; |
---|
| 137 | } listcouple; /* list of names */ |
---|
| 138 | |
---|
| 139 | |
---|
[663] | 140 | typedef struct listnom |
---|
[396] | 141 | { |
---|
[774] | 142 | char o_nom[LONG_C]; |
---|
| 143 | char o_module[LONG_C]; |
---|
[663] | 144 | int o_val; |
---|
[396] | 145 | listcouple *couple; |
---|
| 146 | struct listnom * suiv; |
---|
| 147 | } listnom; /* list of names */ |
---|
| 148 | |
---|
| 149 | |
---|
[663] | 150 | typedef struct listallocate |
---|
[396] | 151 | { |
---|
[774] | 152 | char a_nomvar[LONG_C]; |
---|
| 153 | char a_subroutine[LONG_C]; |
---|
| 154 | char a_module[LONG_C]; |
---|
[396] | 155 | struct listallocate * suiv; |
---|
| 156 | } listallocate ; |
---|
| 157 | |
---|
[663] | 158 | |
---|
| 159 | typedef struct listvarpointtovar |
---|
[396] | 160 | { |
---|
[774] | 161 | char t_usemodule[LONG_C]; |
---|
| 162 | char t_cursubroutine[LONG_C]; |
---|
[663] | 163 | listcouple *t_couple; |
---|
[396] | 164 | struct listvarpointtovar* suiv; |
---|
| 165 | }listvarpointtovar ; /* list of names */ |
---|
| 166 | |
---|
| 167 | |
---|
[663] | 168 | typedef struct listindice |
---|
[396] | 169 | { |
---|
[663] | 170 | int i_indice; |
---|
[396] | 171 | struct listindice * suiv; |
---|
| 172 | } listindice; /* list of indiced */ |
---|
| 173 | |
---|
[663] | 174 | variable *curvar; |
---|
| 175 | |
---|
| 176 | listvar *List_ModuleUsedInModuleUsed_Var; |
---|
| 177 | listvar *List_ModuleUsed_Var; |
---|
| 178 | listvar *listduplicated; |
---|
| 179 | |
---|
| 180 | listvar *List_GlobalParameter_Var; |
---|
| 181 | listvar *List_Global_Var; |
---|
| 182 | listvar *List_Data_Var; |
---|
| 183 | listvar *List_Save_Var; |
---|
| 184 | listvar *List_SubroutineArgument_Var; |
---|
| 185 | listvar *List_SubroutineDeclaration_Var; |
---|
| 186 | listvar *List_UsedInSubroutine_Var; |
---|
| 187 | listvar *List_Parameter_Var; |
---|
| 188 | listvar *List_Dimension_Var; |
---|
| 189 | listvar *List_FunctionType_Var; |
---|
| 190 | listvar *List_NotGridDepend_Var; |
---|
| 191 | listvar *List_Common_Var; |
---|
| 192 | |
---|
| 193 | |
---|
| 194 | listname *List_Pointer_Var; |
---|
| 195 | listname *List_ImplicitNoneSubroutine; |
---|
| 196 | |
---|
| 197 | listusemodule *List_NameOfModuleUsed; |
---|
| 198 | listusemodule *List_Include; |
---|
| 199 | listusemodule *listofmoduletmp; |
---|
| 200 | listusemodule *tmpuselocallist; |
---|
| 201 | |
---|
| 202 | listparameter *List_GlobParamModuleUsedInModuleUsed_Var; |
---|
| 203 | listparameter *List_GlobParamModuleUsed_Var; |
---|
| 204 | |
---|
| 205 | listnom *List_ContainsSubroutine; |
---|
| 206 | listnom *List_Subroutine_For_Alloc; |
---|
| 207 | listnom *listofmodules; |
---|
| 208 | listnom *List_NameOfModule; |
---|
| 209 | listnom *List_NameOfCommon; |
---|
| 210 | listnom *List_SubroutineWhereAgrifUsed; |
---|
| 211 | |
---|
| 212 | listallocate *List_Allocate_Var; |
---|
| 213 | |
---|
| 214 | listvarpointtovar *List_CouplePointed_Var; |
---|
| 215 | /* variables which are pointed to an other one */ |
---|
| 216 | |
---|
| 217 | listindice *Listofavailableindices; |
---|
| 218 | /* List of available indices in the tabvars table */ |
---|
| 219 | |
---|
| 220 | listdim *curdim; |
---|
| 221 | listdim *commondim; |
---|
| 222 | |
---|
[396] | 223 | /******************************************************************************/ |
---|
| 224 | /**************** *** COMMON Variables *** *********************************/ |
---|
| 225 | /******************************************************************************/ |
---|
| 226 | |
---|
| 227 | int positioninblock; |
---|
[774] | 228 | char commonvar[LONG_C]; |
---|
| 229 | char commonblockname[LONG_C]; |
---|
[396] | 230 | |
---|
| 231 | /******************************************************************************/ |
---|
| 232 | /**************** *** AGRIF Variables *** *********************************/ |
---|
| 233 | /******************************************************************************/ |
---|
| 234 | int inagrifcallargument; |
---|
[530] | 235 | int sameagrifargument; |
---|
[396] | 236 | int InAgrifParentDef; |
---|
[774] | 237 | char sameagrifname[LONG_C]; |
---|
[396] | 238 | /******************************************************************************/ |
---|
| 239 | /**************** *** VAR DEF Variables *** *******************************/ |
---|
| 240 | /******************************************************************************/ |
---|
| 241 | int indicemaxtabvars; /* Number of variables in the model i.e. last */ |
---|
| 242 | /* indice used in the tabvars table */ |
---|
[663] | 243 | int PublicDeclare; /* Variable has been declared as PUBLIC */ |
---|
| 244 | int PrivateDeclare; /* Variable has been declared as PRIVATE */ |
---|
| 245 | int ExternalDeclare; /* Variable has been declared as EXTERNAL */ |
---|
| 246 | int InitialValueGiven; /* An initial value has been given */ |
---|
[396] | 247 | int Allocatabledeclare; |
---|
| 248 | int SaveDeclare; |
---|
[663] | 249 | int functiondeclarationisdone; |
---|
[396] | 250 | int pointerdeclare; |
---|
| 251 | int optionaldeclare; |
---|
[663] | 252 | int VarType; |
---|
| 253 | int VarTypepar; |
---|
| 254 | int VariableIsParameter; |
---|
[396] | 255 | int dimsgiven; |
---|
[663] | 256 | int shouldincludempif; |
---|
[396] | 257 | int c_star; |
---|
[774] | 258 | char DeclType[LONG_C]; |
---|
| 259 | char nameinttypename[LONG_C]; |
---|
[1200] | 260 | char nameinttypenameback[LONG_C]; |
---|
[663] | 261 | int GlobalDeclaration; |
---|
[774] | 262 | char InitValue[LONG_4C]; |
---|
| 263 | char IntentSpec[LONG_C]; |
---|
| 264 | char NamePrecision[LONG_C]; |
---|
| 265 | char CharacterSize[LONG_C]; |
---|
| 266 | char curmodulename[LONG_C]; |
---|
| 267 | char vallengspec[LONG_C]; |
---|
| 268 | char subroutinename[LONG_C]; |
---|
[396] | 269 | |
---|
| 270 | /******************************************************************************/ |
---|
| 271 | /**************** *** CONV Variables *** **********************************/ |
---|
| 272 | /******************************************************************************/ |
---|
| 273 | int dimprob ; /* dimension of the problem : 1 for 1D,2 for 2D, */ |
---|
| 274 | /* 3 for 3D */ |
---|
| 275 | int onlyfixedgrids; /* = 1 if onlyfixedgrids is true */ |
---|
| 276 | int todebug; |
---|
[663] | 277 | int mark; |
---|
| 278 | int todebugfree; |
---|
[396] | 279 | int fixedgrids; /* = 1 if fixedgrids is true */ |
---|
[774] | 280 | char nbmaillesX[LONG_C]; /* number of cells in the x direction */ |
---|
| 281 | char nbmaillesY[LONG_C]; /* number of cells in the y direction */ |
---|
| 282 | char nbmaillesZ[LONG_C]; /* number of cells in the z direction */ |
---|
[396] | 283 | int IndicenbmaillesX; |
---|
| 284 | int IndicenbmaillesY; |
---|
| 285 | int IndicenbmaillesZ; |
---|
| 286 | |
---|
| 287 | int inmodulemeet; |
---|
| 288 | int incalldeclare; |
---|
| 289 | int aftercontainsdeclare; /* Signale si l'on vient d'un contains ou non */ |
---|
[663] | 290 | int retour77; |
---|
[396] | 291 | int colnum; |
---|
| 292 | int callagrifinitgrids; |
---|
| 293 | int callmpiinit; |
---|
| 294 | int firstpass; |
---|
| 295 | int couldaddvariable; |
---|
| 296 | int pointedvar; |
---|
[774] | 297 | int NbMailleXDefined; |
---|
[396] | 298 | int agrif_parentcall; |
---|
| 299 | int didvariableadded; |
---|
[663] | 300 | int SubloopScalar; /* = 1 we should put in argument of sub_loop */ |
---|
[396] | 301 | /* only */ |
---|
| 302 | /* scalar and not table u(1,1,1) in place of u */ |
---|
| 303 | int checkexistcommon; |
---|
| 304 | int insubroutinedeclare; |
---|
| 305 | int inmoduledeclare; |
---|
| 306 | int dimsempty; |
---|
[530] | 307 | int created_dimensionlist; |
---|
| 308 | |
---|
[774] | 309 | char meetagrifinitgrids[LONG_C]; |
---|
| 310 | char mpiinitvar[LONG_C]; |
---|
[396] | 311 | char *NameTamponfile; |
---|
[774] | 312 | char toprintglob[LONG_4C]; |
---|
| 313 | char tmpvargridname[LONG_4C]; |
---|
| 314 | char EmptyChar[2]; /* An empty char */ |
---|
| 315 | char curfilename[LONG_C]; |
---|
| 316 | char nomfileoutput[LONG_C]; |
---|
| 317 | char curbuf[LONG_40M]; |
---|
| 318 | char motparse[LONG_4C]; |
---|
| 319 | char motparse1[LONG_4C]; |
---|
| 320 | char charusemodule[LONG_C]; |
---|
| 321 | char subofagrifinitgrids[LONG_C]; |
---|
| 322 | char curfile[LONG_C]; |
---|
| 323 | char mainfile[LONG_C]; |
---|
| 324 | char nomdir[LONG_C]; |
---|
| 325 | char commondirout[LONG_C]; |
---|
| 326 | char commondirin[LONG_C]; |
---|
| 327 | char filetoparse[LONG_C]; |
---|
[396] | 328 | |
---|
[663] | 329 | FILE *fortranout; /* Output File */ |
---|
| 330 | FILE *fortranin; /* Input File */ |
---|
[396] | 331 | FILE *oldfortranout; |
---|
| 332 | FILE *subloop; |
---|
[663] | 333 | FILE *module_declar; |
---|
[396] | 334 | FILE *allocationagrif; |
---|
[663] | 335 | FILE *paramout; |
---|
[396] | 336 | |
---|
| 337 | long int pos_cur; /* current position in the output file */ |
---|
| 338 | long int pos_curagrifparent; |
---|
| 339 | /* current position in the output file */ |
---|
| 340 | long int pos_curcall; /* current position in the output file */ |
---|
| 341 | long int pos_curuse; /* current position in the output file */ |
---|
[1200] | 342 | long int pos_curuseold; /* current position in the output file */ |
---|
[663] | 343 | long int pos_curfunction; /* current position in the output file */ |
---|
[396] | 344 | long int pos_cur_decl; /* current position in the output file */ |
---|
| 345 | long int pos_curdata; /* current position in the output file */ |
---|
| 346 | long int pos_curparameter;/* current position in the output file */ |
---|
| 347 | long int pos_curcommon; /* current position in the output file */ |
---|
[663] | 348 | long int pos_cursave; /* current position in the output file */ |
---|
| 349 | long int pos_curdimension;/* current position in the output file */ |
---|
[396] | 350 | long int pos_curinit; /* current position in the output file */ |
---|
| 351 | long int pos_curinclude; /* final position of a line in file */ |
---|
| 352 | long int pos_end; /* final position of a line in file */ |
---|
[663] | 353 | long int pos_endsubroutine; |
---|
| 354 | /* final position of a line in file */ |
---|
[396] | 355 | |
---|
[774] | 356 | /* v_oldname = v_nomvar; */ |
---|
| 357 | /* commonvar = v_nomvar; */ |
---|
| 358 | /* commonblockname = v_commonname;*/ |
---|
| 359 | /* sameagrifname = v_nomvar ; */ |
---|
| 360 | /* DeclType = v_typevar; */ |
---|
| 361 | /* nameinttypename = v_nameinttypename; */ |
---|
| 362 | /* IntentSpec = v_IntentSpec; */ |
---|
| 363 | /* NamePrecision = v_precision; */ |
---|
| 364 | /* CharacterSize = v_dimchar; */ |
---|
| 365 | /* curmodulename = v_modulename; */ |
---|
| 366 | /* vallengspec = v_vallengspec; */ |
---|
| 367 | /* subroutinename = v_subroutinename; */ |
---|
| 368 | /* meetagrifinitgrids = v_subroutinename; */ |
---|
| 369 | /* nbmaillesX = v_nomvar; */ |
---|
| 370 | /* nbmaillesY = v_nomvar; */ |
---|
| 371 | /* nbmaillesZ = v_nomvar; */ |
---|
| 372 | /* mpiinitvar = v_nomvar; */ |
---|
| 373 | /* EmptyChar = 2; */ |
---|
| 374 | /* motparse1 = motparse;*/ |
---|
| 375 | /* charusemodule = p_modulename; */ |
---|
| 376 | /* subofagrifinitgrids = v_subroutinename; */ |
---|
| 377 | /* curfile = mainfile; */ |
---|
| 378 | /* InitValue = v_initialvalue; */ |
---|
| 379 | |
---|
| 380 | /* p_name;???????? */ |
---|
| 381 | /* p_modulename; ?????????????*/ |
---|
| 382 | |
---|
| 383 | int length_last; |
---|
| 384 | int length_first; |
---|
| 385 | int length_v_typevar; |
---|
| 386 | int length_v_nomvar; |
---|
| 387 | int length_v_dimchar; |
---|
| 388 | int length_v_modulename; |
---|
| 389 | int length_v_commonname; |
---|
| 390 | int length_v_vallengspec; |
---|
| 391 | int length_v_nameinttypename; |
---|
| 392 | int length_v_commoninfile; |
---|
| 393 | int length_v_subroutinename; |
---|
| 394 | int length_v_precision; |
---|
| 395 | int length_v_IntentSpec; |
---|
| 396 | int length_v_initialvalue; |
---|
| 397 | int length_v_readedlistdimension; |
---|
| 398 | int length_u_usemodule; |
---|
| 399 | int length_u_charusemodule; |
---|
| 400 | int length_u_cursubroutine; |
---|
| 401 | int length_u_modulename; |
---|
| 402 | int length_n_name; |
---|
| 403 | int length_c_namevar; |
---|
| 404 | int length_c_namepointedvar; |
---|
| 405 | int length_o_nom; |
---|
| 406 | int length_o_module; |
---|
| 407 | int length_a_nomvar; |
---|
| 408 | int length_a_subroutine; |
---|
| 409 | int length_a_module; |
---|
| 410 | int length_t_usemodule; |
---|
| 411 | int length_t_cursubroutine; |
---|
| 412 | int length_curfilename; |
---|
| 413 | int length_nomfileoutput; |
---|
| 414 | int length_motparse; |
---|
| 415 | int length_mainfile; |
---|
| 416 | int length_nomdir; |
---|
| 417 | int length_commondirout; |
---|
| 418 | int length_commondirin; |
---|
| 419 | int length_filetoparse; |
---|
| 420 | int length_curbuf; |
---|
| 421 | int length_toprintglob; |
---|
| 422 | int length_tmpvargridname; |
---|
| 423 | int length_ligne_Subloop; |
---|
| 424 | int length_lvargridname_toamr; |
---|
| 425 | int length_toprint_utilagrif; |
---|
| 426 | int length_toprinttmp_utilchar; |
---|
| 427 | int length_ligne_writedecl; |
---|
| 428 | int length_newname_toamr; |
---|
| 429 | int length_newname_writedecl; |
---|
| 430 | int length_ligne_toamr; |
---|
| 431 | int length_tmpligne_writedecl; |
---|
| 432 | int value_char_size; |
---|
| 433 | int value_char_size1; |
---|
| 434 | int value_char_size2; |
---|
| 435 | int value_char_size3; |
---|
| 436 | |
---|
[1200] | 437 | |
---|
| 438 | int inallocate; |
---|
| 439 | int infixed; |
---|
| 440 | int infree; |
---|
[396] | 441 | /******************************************************************************/ |
---|
| 442 | /*********** Declaration of externals subroutines *****************************/ |
---|
| 443 | /***************************************************** ************************/ |
---|
| 444 | /******************************************************************************/ |
---|
[663] | 445 | /*********** convert.y ********************************************************/ |
---|
[396] | 446 | /******************************************************************************/ |
---|
[663] | 447 | extern int main(int argc,char *argv[]); |
---|
[396] | 448 | /******************************************************************************/ |
---|
[663] | 449 | /*********** fortran.y ********************************************************/ |
---|
[396] | 450 | /******************************************************************************/ |
---|
[663] | 451 | extern void processfortran(char *fichier_entree); |
---|
[396] | 452 | /******************************************************************************/ |
---|
| 453 | /*********** dependfile.c *****************************************************/ |
---|
| 454 | /******************************************************************************/ |
---|
[530] | 455 | extern void Writethedependnbxnbyfile(); |
---|
| 456 | extern void Readthedependnbxnbyfile(); |
---|
[396] | 457 | extern void Writethedependlistofmoduleused(char *NameTampon ); |
---|
| 458 | extern void Readthedependlistofmoduleused(char *NameTampon); |
---|
| 459 | extern void WritedependParameterList(char *NameTampon ); |
---|
[663] | 460 | extern listparameter *ReaddependParameterList(char *NameTampon, |
---|
[396] | 461 | listparameter *listout); |
---|
| 462 | extern void Writethedependfile(char *NameTampon, listvar *input ); |
---|
[530] | 463 | extern listvar *Readthedependfile( char *NameTampon , listvar *listout); |
---|
[663] | 464 | extern void Write_Subroutine_For_Alloc(); |
---|
| 465 | extern void Read_Subroutine_For_Alloc(); |
---|
[396] | 466 | extern void Writethedependavailablefile(); |
---|
| 467 | extern void Readthedependavailablefile(); |
---|
| 468 | extern int Did_filetoparse_readed(char *NameTampon); |
---|
[663] | 469 | extern int Did_module_common_treaded(char *NameTampon); |
---|
[774] | 470 | extern void Write_val_max(); |
---|
| 471 | extern void Read_val_max(); |
---|
[396] | 472 | /******************************************************************************/ |
---|
[663] | 473 | /*********** DiversListe.c ****************************************************/ |
---|
| 474 | /******************************************************************************/ |
---|
| 475 | extern void Add_Common_var_1(); |
---|
| 476 | extern listnom *Addtolistnom(char *nom, listnom *listin,int value); |
---|
| 477 | extern listname *Addtolistname(char *nom,listname *input); |
---|
| 478 | extern int ModuleIsDefineInInputFile(char *name); |
---|
| 479 | extern void Addmoduletothelisttmp(char *name); |
---|
| 480 | extern void Add_NameOfModule_1(char *nom); |
---|
| 481 | extern void Add_NameOfCommon_1(char *nom); |
---|
| 482 | extern void Add_CouplePointed_Var_1(char *namemodule,listcouple *couple); |
---|
| 483 | extern void Add_Include_1(char *name); |
---|
| 484 | extern void Add_ImplicitNoneSubroutine_1(); |
---|
| 485 | extern void WriteIncludeDeclaration(); |
---|
| 486 | extern void Add_Save_Var_1 (char *name,listdim *d); |
---|
[774] | 487 | extern void Add_Save_Var_dcl_1 (listvar *var); |
---|
[663] | 488 | /******************************************************************************/ |
---|
[396] | 489 | /*********** SubLoopCreation.c ************************************************/ |
---|
| 490 | /******************************************************************************/ |
---|
[774] | 491 | extern void writeheadnewsub_0(); |
---|
[530] | 492 | extern void WriteVariablelist_subloop(FILE *outputfile); |
---|
| 493 | extern void WriteVariablelist_subloop_Call(FILE *outputfile); |
---|
| 494 | extern void WriteVariablelist_subloop_Def(FILE *outputfile); |
---|
| 495 | extern void WriteHeadofSubroutineLoop(); |
---|
[774] | 496 | extern void closeandcallsubloopandincludeit_0(int suborfun); |
---|
| 497 | extern void closeandcallsubloop_contains_0(); |
---|
[396] | 498 | /******************************************************************************/ |
---|
[663] | 499 | /*********** toamr.c **********************************************************/ |
---|
[396] | 500 | /******************************************************************************/ |
---|
[663] | 501 | extern char *variablenameroottabvars (variable * var); |
---|
| 502 | extern char *variablenametabvars (variable * var, int iorindice); |
---|
| 503 | extern char *variablecurgridtabvars (variable * var,int ParentOrCurgrid); |
---|
[774] | 504 | extern void WARNING_CharSize(variable *var); |
---|
[663] | 505 | extern char *vargridnametabvars (variable * var,int iorindice); |
---|
| 506 | extern char *vargridcurgridtabvars (variable * var,int ParentOrCurgrid); |
---|
| 507 | extern char *vargridcurgridtabvarswithoutAgrif_Gr (variable * var); |
---|
| 508 | extern char *vargridparam (variable * v, int whichone); |
---|
| 509 | extern void write_probdimagrif_file(); |
---|
| 510 | extern void write_keysagrif_file(); |
---|
| 511 | extern void write_modtypeagrif_file(); |
---|
| 512 | extern void write_createvarnameagrif_file(variable *v,FILE *createvarname, |
---|
| 513 | int *InitEmpty); |
---|
| 514 | extern void write_Setnumberofcells_file(); |
---|
| 515 | extern void write_Getnumberofcells_file(); |
---|
| 516 | extern void write_initialisationsagrif_file(variable *v,FILE *initproc, |
---|
| 517 | int *VarnameEmpty); |
---|
| 518 | extern void Write_Alloc_Agrif_Files(); |
---|
| 519 | extern int IndiceInlist(int indic, listindice *listin); |
---|
| 520 | extern void write_allocation_Common_0(); |
---|
| 521 | extern void write_allocation_Global_0(); |
---|
| 522 | extern void creefichieramr (char *NameTampon); |
---|
[396] | 523 | /******************************************************************************/ |
---|
| 524 | /*********** UtilAgrif.c ******************************************************/ |
---|
| 525 | /******************************************************************************/ |
---|
[530] | 526 | extern int Vartonumber(char *tokname); |
---|
| 527 | extern int Agrif_in_Tok_NAME(char *tokname); |
---|
[1200] | 528 | extern void ModifyTheVariableName_0(char *ident,int lengthname); |
---|
[663] | 529 | extern void Add_SubroutineWhereAgrifUsed_1(char *sub,char *mod); |
---|
[774] | 530 | extern void AddUseAgrifUtil_0(FILE *fileout); |
---|
| 531 | extern void AddUseAgrifUtilBeforeCall_0(FILE *fileout); |
---|
[530] | 532 | extern void NotifyAgrifFunction_0(char *ident); |
---|
| 533 | extern void ModifyTheAgrifFunction_0(char *ident); |
---|
| 534 | extern void AgriffunctionModify_0(char *ident,int whichone); |
---|
[663] | 535 | extern void Instanciation_0(char *ident); |
---|
[396] | 536 | /******************************************************************************/ |
---|
| 537 | /*********** UtilCharacter.c **************************************************/ |
---|
| 538 | /******************************************************************************/ |
---|
[774] | 539 | extern void FindAndChangeNameToTabvars(char name[LONG_C],char toprint[LONG_4C], |
---|
[663] | 540 | listvar * listtosee, int whichone); |
---|
[396] | 541 | extern char *ChangeTheInitalvaluebyTabvarsName(char *nom,listvar *listtoread, |
---|
| 542 | int whichone); |
---|
[530] | 543 | extern int IsVariableReal(char *nom); |
---|
[396] | 544 | extern void IsVarInUseFile(char *nom); |
---|
| 545 | extern listnom *DecomposeTheNameinlistnom(char *nom, listnom * listout); |
---|
| 546 | extern void DecomposeTheName(char *nom); |
---|
[663] | 547 | extern void convert2lower(char *name); |
---|
[774] | 548 | extern int convert2int(char *name); |
---|
[396] | 549 | /******************************************************************************/ |
---|
| 550 | /*********** UtilFile.c *******************************************************/ |
---|
| 551 | /******************************************************************************/ |
---|
| 552 | extern FILE * associate (char *filename); |
---|
| 553 | extern FILE * associateaplus (char *filename); |
---|
| 554 | extern long int setposcur(); |
---|
[1200] | 555 | extern long int setposcurname(FILE *fileout); |
---|
[396] | 556 | extern long int setposcurinoldfortranout(); |
---|
[530] | 557 | extern void copyuse_0(char *namemodule); |
---|
| 558 | extern void copyuseonly_0(char *namemodule); |
---|
[396] | 559 | /******************************************************************************/ |
---|
| 560 | /*********** UtilFortran.c ****************************************************/ |
---|
| 561 | /******************************************************************************/ |
---|
| 562 | extern void initdimprob(int dimprobmod, char * nx, char * ny,char* nz); |
---|
| 563 | extern int Variableshouldberemove(char *nom); |
---|
| 564 | extern int variableisglobal(listvar *curvar, listvar *listin); |
---|
[774] | 565 | extern int VariableIsInListCommon(listvar *curvar,listvar *listin); |
---|
[663] | 566 | extern int VariableIsInList(listvar *curvar,listvar *listin); |
---|
| 567 | extern void variableisglobalinmodule(listcouple *listin, char *module, |
---|
[1200] | 568 | FILE *fileout,long int oldposcuruse); |
---|
[663] | 569 | extern void Remove_Word_Contains_0(); |
---|
[1200] | 570 | extern void Remove_Word_end_module_0(int modulenamelength); |
---|
[663] | 571 | extern void Write_Word_Contains_0(); |
---|
| 572 | extern void Write_Word_end_module_0(); |
---|
| 573 | extern void Add_Subroutine_For_Alloc(char *nom); |
---|
| 574 | extern void Write_Alloc_Subroutine_0(); |
---|
| 575 | extern void Write_Alloc_Subroutine_For_End_0(); |
---|
| 576 | extern void Write_GlobalParameter_Declaration_0(); |
---|
[1200] | 577 | extern void Write_GlobalType_Declaration_0(); |
---|
[663] | 578 | extern void Write_NotGridDepend_Declaration_0(); |
---|
[530] | 579 | extern int IsTabvarsUseInArgument_0(); |
---|
[396] | 580 | extern int ImplicitNoneInSubroutine(); |
---|
[663] | 581 | extern void Add_Pointer_Var_From_List_1(listvar *listin); |
---|
| 582 | extern void Add_Pointer_Var_1(char *nom); |
---|
[530] | 583 | extern int varispointer_0(char *ident); |
---|
| 584 | extern int VariableIsNotFunction(char *ident); |
---|
[1200] | 585 | extern int varistyped_0(char *ident); |
---|
[396] | 586 | /******************************************************************************/ |
---|
[663] | 587 | /*********** UtilListe.c ******************************************************/ |
---|
[396] | 588 | /******************************************************************************/ |
---|
[663] | 589 | extern void Init_Variable(variable *var); |
---|
| 590 | extern listvar * AddListvarToListvar(listvar *l,listvar *glob, |
---|
| 591 | int ValueFirstpass); |
---|
| 592 | extern void CreateAndFillin_Curvar(char *type,variable *curvar); |
---|
| 593 | extern void duplicatelistvar(listvar *orig); |
---|
| 594 | extern listdim * insertdim(listdim *lin,typedim nom); |
---|
| 595 | extern void change_dim_char(listdim *lin,listvar * l); |
---|
| 596 | extern int num_dims(listdim *d); |
---|
| 597 | extern variable * createvar(char *nom,listdim *d); |
---|
| 598 | extern listvar * insertvar(listvar *lin,variable *v); |
---|
| 599 | extern listvar *settype(char *nom,listvar *lin); |
---|
[1200] | 600 | extern void printliste(listvar * lin); |
---|
| 601 | extern int IsinListe(listvar *lin,char *nom); |
---|
| 602 | extern listname *Insertname(listname *lin,char *nom); |
---|
| 603 | extern void printname(listname * lin); |
---|
| 604 | extern void removeglobfromlist(listname **lin); |
---|
| 605 | extern void writelistpublic(listname *lin); |
---|
[396] | 606 | /******************************************************************************/ |
---|
[663] | 607 | /*********** UtilNotGridDep.c *************************************************/ |
---|
| 608 | /******************************************************************************/ |
---|
| 609 | extern void Add_NotGridDepend_Var_1 (char *name); |
---|
| 610 | extern int VarIsNonGridDepend(char *name); |
---|
| 611 | /******************************************************************************/ |
---|
| 612 | /*********** WorkWithAllocatelist.c *******************************************/ |
---|
| 613 | /******************************************************************************/ |
---|
| 614 | extern void Add_Allocate_Var_1(char *nom,char *nommodule); |
---|
| 615 | extern int IsVarAllocatable_0(char *ident); |
---|
| 616 | extern int varisallocatable_0(char *ident); |
---|
| 617 | /******************************************************************************/ |
---|
| 618 | /*********** WorkWithglobliste.c **********************************************/ |
---|
| 619 | /******************************************************************************/ |
---|
| 620 | extern void Add_Globliste_1(listvar *listtoadd); |
---|
| 621 | extern void Add_SubroutineDeclarationSave_Var_1(listvar *listtoadd); |
---|
[1200] | 622 | extern void checkandchangedims(listvar *listsecondpass); |
---|
[663] | 623 | /******************************************************************************/ |
---|
| 624 | /*********** WorkWithlistdatavariable.c ***************************************/ |
---|
| 625 | /******************************************************************************/ |
---|
| 626 | extern void Add_Data_Var_1 (char *name,char *values); |
---|
| 627 | /******************************************************************************/ |
---|
| 628 | /*********** WorkWithlistmoduleinfile.c ***************************************/ |
---|
| 629 | /******************************************************************************/ |
---|
[774] | 630 | extern void Save_Length(char *nom, int whichone); |
---|
| 631 | extern void Save_Length_int(int val, int whichone); |
---|
[663] | 632 | /******************************************************************************/ |
---|
| 633 | /*********** WorkWithlistofmodulebysubroutine.c *******************************/ |
---|
| 634 | /******************************************************************************/ |
---|
| 635 | extern void RecordUseModulesVariables(); |
---|
| 636 | extern void RecordUseModulesUseModulesVariables(); |
---|
| 637 | extern void Add_NameOfModuleUsed_1(char *name); |
---|
| 638 | extern void Addmoduletothelist(char *name); |
---|
| 639 | extern void WriteUsemoduleDeclaration(); |
---|
| 640 | /******************************************************************************/ |
---|
| 641 | /*********** WorkWithlistvarindoloop.c ****************************************/ |
---|
| 642 | /******************************************************************************/ |
---|
| 643 | extern void Add_UsedInSubroutine_Var_1 (char *ident); |
---|
| 644 | extern void ajoutevarindoloop_definedimension (char *name); |
---|
| 645 | extern void ModifyThelistvarindoloop(); |
---|
| 646 | extern void CompleteThelistvarindoloop(); |
---|
| 647 | extern void CopyRecord(variable *var1,variable *var2); |
---|
| 648 | extern void Update_List_Subroutine_Var(listvar *list_to_modify); |
---|
| 649 | extern void Update_List_Global_Var_From_List_Save_Var(); |
---|
| 650 | extern void Update_List_From_Common_Var(listvar *list_to_modify); |
---|
| 651 | extern void Update_List_Var(listvar *list_to_modify); |
---|
| 652 | extern void List_UsedInSubroutine_Var_Update_From_Module_Used(); |
---|
| 653 | extern void Update_NotGridDepend_Var(listvar *list_to_modify); |
---|
| 654 | extern int LookingForVariableInList(listvar *listin,variable *var); |
---|
| 655 | extern int LookingForVariableInListGlobal(listvar *listin,variable *var); |
---|
[774] | 656 | extern int LookingForVariableInListName(listvar *listin,char *var); |
---|
[663] | 657 | extern int LookingForVariableInListGlob(listvar *listin,variable *var); |
---|
| 658 | extern int LookingForVariableInListParamGlob(listparameter *listin, |
---|
| 659 | variable *var); |
---|
| 660 | extern void UpdateListDeclarationWithDimensionList(); |
---|
| 661 | extern void Clean_List_UsedInSubroutine_Var(); |
---|
| 662 | extern void Clean_List_SubroutineDeclaration_Var(); |
---|
[774] | 663 | extern void Clean_List_Global_Var(); |
---|
[663] | 664 | extern void ListClean(); |
---|
| 665 | extern void ListUpdate(); |
---|
[774] | 666 | extern void GiveTypeOfVariables(); |
---|
[663] | 667 | extern void Sort_List_SubroutineArgument_Var(); |
---|
| 668 | extern void IndiceTabvars_Global_Var_Treated(char *nom); |
---|
| 669 | extern void IndiceTabvars_Global_Var_No_Treated(char *nom); |
---|
| 670 | extern void UpdateTheRemainingList(listvar *record); |
---|
| 671 | extern void IndiceTabvars_Common_Var_Treated(char *nom); |
---|
| 672 | extern void IndiceTabvars_Common_Var_No_Treated(char *nom); |
---|
| 673 | extern void IndiceTabvarsIdentification(); |
---|
| 674 | extern void New_Allocate_Subroutine_Is_Necessary(); |
---|
| 675 | extern void New_Allocate_Subroutine_For_Common_Is_Necessary(); |
---|
| 676 | extern void NewModule_Creation_0(); |
---|
| 677 | extern void UpdateList_SubroutineWhereAgrifUsed(); |
---|
| 678 | extern void UpdateList_UsedInSubroutine_With_dimension(); |
---|
| 679 | extern void Affiche(); |
---|
| 680 | extern int SubInList_ContainsSubroutine(); |
---|
| 681 | /******************************************************************************/ |
---|
| 682 | /*********** WorkWithParameterlist.c ******************************************/ |
---|
| 683 | /******************************************************************************/ |
---|
| 684 | extern void Add_GlobalParameter_Var_1(listvar *listin); |
---|
| 685 | extern void Add_Parameter_Var_1(listvar *listin); |
---|
| 686 | extern void Add_Dimension_Var_1(listvar *listin); |
---|
| 687 | /******************************************************************************/ |
---|
| 688 | /*********** WorkWithvarofsubroutineliste.c ***********************************/ |
---|
| 689 | /******************************************************************************/ |
---|
| 690 | extern void Add_SubroutineArgument_Var_1(listvar *listtoadd); |
---|
| 691 | extern void Add_FunctionType_Var_1(char *nom); |
---|
| 692 | extern void Add_SubroutineDeclaration_Var_1 (listvar *listtoadd); |
---|
| 693 | /******************************************************************************/ |
---|
| 694 | /*********** Writedeclarations.c **********************************************/ |
---|
| 695 | /******************************************************************************/ |
---|
[1200] | 696 | extern void WriteBeginDeclaration(variable *v,char ligne[LONG_4C],int visibility); |
---|
[774] | 697 | extern void WriteScalarDeclaration(variable *v,char ligne[LONG_4C]); |
---|
| 698 | extern void WriteTableDeclaration(variable * v,char ligne[LONG_4C],int tmpok); |
---|
[663] | 699 | extern void writevardeclaration (listvar * var_record, FILE *fileout, |
---|
[1200] | 700 | int value,int visibility); |
---|
[663] | 701 | extern void WriteLocalParamDeclaration(); |
---|
[1200] | 702 | extern void WriteFunctionDeclaration(int value); |
---|
[663] | 703 | extern void WriteSubroutineDeclaration(int value); |
---|
| 704 | extern void WriteArgumentDeclaration_beforecall(); |
---|
| 705 | extern void WriteArgumentDeclaration_Sort(); |
---|
| 706 | extern listnom *writedeclarationintoamr (listvar * deb_common, FILE *fileout, |
---|
[774] | 707 | variable *var , char commonname[LONG_C], |
---|
| 708 | listnom *neededparameter, char name_common[LONG_C]); |
---|
[663] | 709 | extern void writesub_loopdeclaration_scalar (listvar * deb_common, |
---|
| 710 | FILE *fileout); |
---|
| 711 | extern void writesub_loopdeclaration_tab (listvar * deb_common, FILE *fileout); |
---|
[1200] | 712 | extern void ReWriteDeclarationAndAddTosubroutine_01(listvar *listdecl); |
---|
[663] | 713 | /******************************************************************************/ |
---|
| 714 | /*********** WriteInFile.c ****************************************************/ |
---|
| 715 | /******************************************************************************/ |
---|
| 716 | extern void tofich_reste (FILE * filout, char *s,int returnlineornot); |
---|
| 717 | extern void tofich (FILE * filout, char *s, int returnlineornot); |
---|
| 718 | extern void tofich_blanc (FILE * filout, int size); |
---|
| 719 | extern void tofich_line (FILE * filout, int size, int long position); |
---|
| 720 | extern void RemoveWordSET_0(FILE * filout, long int position, |
---|
| 721 | long int sizetoremove); |
---|
| 722 | extern void RemoveWordCUR_0(FILE * filout, long int position, |
---|
| 723 | long int sizetoremove); |
---|
[1200] | 724 | |
---|
| 725 | /******************************************************************************/ |
---|
| 726 | /*********** WorkWithlistofcoupled.c **********************************************/ |
---|
| 727 | /******************************************************************************/ |
---|
| 728 | extern int variscoupled_0(char *ident) ; |
---|
| 729 | extern char * getcoupledname_0(char *ident); |
---|
| 730 | extern void ModifyTheVariableNamecoupled_0(char *ident, char* coupledident); |
---|