New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 4779 for branches/2014/dev_r4765_CNRS_agrif/NEMOGCM/EXTERNAL/AGRIF/LIB/decl.h – NEMO

Ignore:
Timestamp:
2014-09-19T16:21:37+02:00 (10 years ago)
Author:
rblod
Message:

Update AGRIF internal routines and conv on branch dev_r4765_CNRS_agrif

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4765_CNRS_agrif/NEMOGCM/EXTERNAL/AGRIF/LIB/decl.h

    r3294 r4779  
    3333/* version 1.7                                                                */ 
    3434/******************************************************************************/ 
    35 #define LONGNOM 8000 
    36  
    37 #define LONG_C 3000 
    38 #define LONG_4C 4000 
    39 #define LONG_4M 4000 
    40 #define LONG_40M 4000000 
     35#define LONG_VNAME 80      // Max length for a variable name 
     36#define LONG_FNAME 1000    // Max length for a file name 
     37#define LONG_C     200 
     38#define LONG_M     1500 
     39 
     40#define NB_CAT_VARIABLES 5 
    4141 
    4242/******************************************************************************/ 
     
    4646typedef struct 
    4747{ 
    48    char first[LONG_C]; 
    49    char last[LONG_C]; 
     48   char first[LONG_M]; 
     49   char last[LONG_M]; 
    5050} typedim ;                /* fortran dimension as 'ndeb:nfin'                */ 
    5151 
     
    5858typedef struct variable 
    5959{ 
    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]; 
     60   char v_typevar[LONG_VNAME]; 
     61   char v_nomvar[LONG_VNAME] ; 
     62   char v_oldname[LONG_VNAME] ; 
     63   char v_dimchar[LONG_VNAME]; 
     64   char v_modulename[LONG_VNAME]; 
     65   char v_commonname[LONG_VNAME]; 
     66   char v_vallengspec[LONG_VNAME]; 
     67   char v_nameinttypename[LONG_VNAME]; 
     68   char v_commoninfile[LONG_FNAME]; 
     69   char v_subroutinename[LONG_VNAME]; 
    7070   char v_precision[LONG_C]; 
    71    char v_initialvalue[LONG_4C]; 
    72    char v_IntentSpec[LONG_C]; 
    73    char v_readedlistdimension[LONG_C]; 
     71   char v_initialvalue[LONG_M]; 
     72   char v_IntentSpec[LONG_M]; 
     73   char v_readedlistdimension[LONG_M]; 
    7474   int  v_nbdim; 
    7575   int  v_common; 
     
    7777   int  v_module; 
    7878   int  v_save; 
     79   int  v_catvar; 
    7980   int  v_VariableIsParameter; 
    8081   int  v_PublicDeclare; 
     
    110111typedef struct listusemodule 
    111112{ 
    112    char u_usemodule[LONG_C]; 
    113    char u_charusemodule[LONG_C]; 
    114    char u_cursubroutine[LONG_C]; 
    115    char u_modulename[LONG_C]; 
     113   char u_usemodule[LONG_VNAME]; 
     114   char u_charusemodule[LONG_VNAME]; 
     115   char u_cursubroutine[LONG_VNAME]; 
     116   char u_modulename[LONG_VNAME]; 
    116117   int  u_firstuse; 
    117118   struct listusemodule * suiv; 
     
    120121typedef struct listparameter 
    121122{ 
    122    char p_name[LONG_C]; 
    123    char p_modulename[LONG_C]; 
     123   char p_name[LONG_M]; 
     124   char p_modulename[LONG_M]; 
    124125   struct listparameter * suiv; 
    125126} listparameter ;           /* list of names                                  */ 
     
    127128typedef struct listname 
    128129{ 
    129    char n_name[LONG_C]; 
     130   char n_name[LONG_VNAME]; 
    130131   struct  listname* suiv; 
    131132} listname ;            /* list of names                                  */ 
     
    133134typedef struct listcouple 
    134135{ 
    135    char c_namevar[LONG_C]; 
    136    char c_namepointedvar[LONG_C]; 
     136   char c_namevar[LONG_VNAME]; 
     137   char c_namepointedvar[LONG_VNAME]; 
    137138   struct listcouple * suiv; 
    138139} listcouple;              /* list of names                                   */ 
     
    142143{ 
    143144   char o_nom[LONG_C]; 
    144    char o_module[LONG_C]; 
    145    char o_subroutinename[LONG_C]; 
     145   char o_module[LONG_VNAME]; 
     146   char o_subroutinename[LONG_M]; 
    146147   int  o_val; 
    147148   listcouple *couple; 
     
    153154{ 
    154155   char a_nomvar[LONG_C]; 
    155    char a_subroutine[LONG_C]; 
    156    char a_module[LONG_C]; 
     156   char a_subroutine[LONG_VNAME]; 
     157   char a_module[LONG_VNAME]; 
    157158   struct listallocate * suiv; 
    158159} listallocate ; 
     
    161162typedef struct listvarpointtovar 
    162163{ 
    163    char t_usemodule[LONG_C]; 
    164    char t_cursubroutine[LONG_C]; 
     164   char t_usemodule[LONG_VNAME]; 
     165   char t_cursubroutine[LONG_VNAME]; 
    165166   listcouple *t_couple; 
    166167   struct  listvarpointtovar* suiv; 
     
    209210 listnom *List_Subroutine_For_Alloc; 
    210211 listnom *listofmodules; 
     212 listnom *listofkind; 
    211213 listnom *List_NameOfModule; 
    212214 listnom *List_NameOfCommon; 
     
    220222 listindice *Listofavailableindices; 
    221223                           /* List of available indices in the tabvars table  */ 
     224 listindice **Listofavailableindices_glob; 
    222225 
    223226 listdim *curdim; 
     
    229232 
    230233 int positioninblock; 
    231  char commonvar[LONG_C]; 
    232  char commonblockname[LONG_C]; 
     234 char commonvar[LONG_VNAME]; 
     235 char commonblockname[LONG_VNAME]; 
    233236 
    234237/******************************************************************************/ 
     
    239242 int sameagrifargument; 
    240243 int InAgrifParentDef; 
    241  char sameagrifname[LONG_C]; 
     244 char sameagrifname[LONG_VNAME]; 
    242245/******************************************************************************/ 
    243246/****************   *** VAR DEF Variables ***   *******************************/ 
    244247/******************************************************************************/ 
    245  int indicemaxtabvars;     /* Number of variables in the model i.e. last      */ 
     248 int indicemaxtabvars[NB_CAT_VARIABLES];     /* Number of variables in the model i.e. last      */ 
    246249                           /*    indice used in  the tabvars table            */ 
    247250 int PublicDeclare;        /* Variable has been declared as PUBLIC */ 
     
    255258 int pointerdeclare; 
    256259 int optionaldeclare; 
    257  int VarType; 
    258  int VarTypepar; 
     260 int inside_type_declare; 
    259261 int VariableIsParameter; 
    260262 int dimsgiven; 
    261263 int shouldincludempif; 
    262264 int c_star; 
    263  char DeclType[LONG_C]; 
    264  char nameinttypename[LONG_C]; 
    265  char nameinttypenameback[LONG_C];  
     265 char DeclType[LONG_VNAME]; 
     266 char nameinttypename[LONG_VNAME]; 
     267 char nameinttypenameback[LONG_VNAME]; 
    266268 int GlobalDeclaration; 
    267269 int GlobalDeclarationType; 
    268  char InitValue[LONG_4C]; 
    269  char IntentSpec[LONG_C]; 
     270 char InitValue[LONG_M]; 
     271 char IntentSpec[LONG_M]; 
    270272 char NamePrecision[LONG_C]; 
    271  char CharacterSize[LONG_C]; 
    272  char curmodulename[LONG_C]; 
    273  char vallengspec[LONG_C]; 
    274  char subroutinename[LONG_C]; 
     273 char CharacterSize[LONG_VNAME]; 
     274 char vallengspec[LONG_VNAME]; 
    275275 int isrecursive; 
    276  char previoussubroutinename[LONG_C]; 
     276 int is_result_present; 
    277277 
    278278/******************************************************************************/ 
     
    283283 int onlyfixedgrids;       /* = 1 if onlyfixedgrids is true                   */ 
    284284 int todebug; 
    285  int mark; 
    286  int todebugfree; 
    287285 int fixedgrids;           /* = 1 if fixedgrids is true                       */ 
    288  char nbmaillesX[LONG_C]; /* number of cells in the x direction              */ 
    289  char nbmaillesY[LONG_C]; /* number of cells in the y direction              */ 
    290  char nbmaillesZ[LONG_C]; /* number of cells in the z direction              */ 
     286 char nbmaillesX[LONG_VNAME]; // number of cells in the x direction 
     287 char nbmaillesY[LONG_VNAME]; // number of cells in the y direction 
     288 char nbmaillesZ[LONG_VNAME]; // number of cells in the z direction 
    291289 int IndicenbmaillesX; 
    292290 int IndicenbmaillesY; 
     
    297295 int aftercontainsdeclare; /* Signale si l'on vient d'un contains ou non */ 
    298296 int retour77; 
    299  int colnum; 
    300297 int callagrifinitgrids; 
    301298 int callmpiinit; 
    302299 int firstpass; 
    303  int couldaddvariable; 
    304300 int pointedvar; 
    305301 int NbMailleXDefined; 
     
    309305                           /*    only                                         */ 
    310306                           /*    scalar and not table u(1,1,1) in place of u  */ 
    311  int checkexistcommon; 
     307 int inprogramdeclare; 
    312308 int insubroutinedeclare; 
    313  int ininterfacedeclare; 
    314309 int inmoduledeclare; 
    315310 int dimsempty; 
     
    317312 int incontainssubroutine; 
    318313 
    319  char meetagrifinitgrids[LONG_C]; 
    320  char mpiinitvar[LONG_C]; 
    321  char *NameTamponfile; 
    322  char toprintglob[LONG_4C]; 
    323  char tmpvargridname[LONG_4C]; 
    324  char EmptyChar[2];        /* An empty char */ 
    325  char curfilename[LONG_C]; 
    326  char nomfileoutput[LONG_C]; 
    327  char curbuf[LONG_40M]; 
    328  char motparse[LONG_4C]; 
    329  char motparse1[LONG_4C]; 
    330  char charusemodule[LONG_C]; 
    331  char subofagrifinitgrids[LONG_C]; 
    332  char curfile[LONG_C]; 
    333  char mainfile[LONG_C]; 
    334  char nomdir[LONG_C]; 
    335  char commondirout[LONG_C]; 
    336  char commondirin[LONG_C]; 
    337  char filetoparse[LONG_C]; 
    338  
    339  FILE *fortranout;          /* Output File                                    */ 
    340  FILE *fortranin;           /* Input File                                     */ 
    341  FILE *oldfortranout; 
     314 char meetagrifinitgrids[LONG_M]; 
     315 char mpiinitvar[LONG_M]; 
     316 char toprintglob[LONG_M]; 
     317 char tmpvargridname[LONG_M]; 
     318 char dependfilename[LONG_FNAME]; 
     319 char charusemodule[LONG_VNAME]; 
     320 char subofagrifinitgrids[LONG_M]; 
     321 char curmodulename[LONG_VNAME]; 
     322 char subroutinename[LONG_VNAME]; 
     323 char cur_filename[LONG_FNAME];     // Name of the current parsed Fortran file 
     324 char config_file[LONG_FNAME];      // Name of conv configuration file (ex: amr.in) 
     325 char work_dir[LONG_FNAME];         // Work directory         (default: './') 
     326 char include_dir[LONG_FNAME];      // Include directory      (default: './AGRIF_INC') 
     327 char output_dir[LONG_FNAME];    // output directory       (default: './AGRIF_MODELFILES') 
     328 char input_dir[LONG_FNAME];     // source input directory (default: './') 
     329 
     330 FILE *fortran_out;          /* Output File                                    */ 
     331 FILE *fortran_in;           /* Input File                                     */ 
     332 FILE *oldfortran_out; 
    342333 FILE *subloop; 
    343334 FILE *module_declar; 
    344335 FILE *module_declar_type; 
    345336 FILE *allocationagrif; 
    346  FILE *paramout; 
    347337 
    348338 long int pos_cur;         /* current position in the output file             */ 
     
    359349 long int pos_cursave;     /* current position in the output file             */ 
    360350 long int pos_curdimension;/* current position in the output file             */ 
    361  long int pos_curinit;     /* current position in the output file             */ 
    362351 long int pos_curinclude;  /* final position of a line in file                */ 
    363352 long int pos_end;         /* final position of a line in file                */ 
     
    365354                           /* final position of a line in file                */ 
    366355 
    367 /* v_oldname = v_nomvar; */ 
    368 /* commonvar = v_nomvar; */ 
    369 /* commonblockname = v_commonname;*/ 
    370 /* sameagrifname = v_nomvar ; */ 
    371 /* DeclType = v_typevar; */ 
    372 /* nameinttypename = v_nameinttypename; */ 
    373 /* IntentSpec = v_IntentSpec; */ 
    374 /* NamePrecision = v_precision; */ 
    375 /* CharacterSize = v_dimchar; */ 
    376 /* curmodulename = v_modulename; */ 
    377 /* vallengspec = v_vallengspec; */ 
    378 /* subroutinename = v_subroutinename; */ 
    379 /* meetagrifinitgrids = v_subroutinename; */ 
    380 /* nbmaillesX = v_nomvar; */ 
    381 /* nbmaillesY = v_nomvar; */ 
    382 /* nbmaillesZ = v_nomvar; */ 
    383 /* mpiinitvar = v_nomvar; */ 
    384 /* EmptyChar = 2; */ 
    385 /* motparse1 = motparse;*/ 
    386 /* charusemodule = p_modulename; */ 
    387 /* subofagrifinitgrids = v_subroutinename; */ 
    388 /* curfile = mainfile; */ 
    389 /* InitValue = v_initialvalue; */ 
    390  
    391 /* p_name;???????? */ 
    392 /* p_modulename; ?????????????*/ 
    393  
    394  int length_last; 
    395  int length_first; 
    396  int length_v_typevar; 
    397  int length_v_nomvar; 
    398  int length_v_dimchar; 
    399  int length_v_modulename; 
    400  int length_v_commonname; 
    401  int length_v_vallengspec; 
    402  int length_v_nameinttypename; 
    403  int length_v_commoninfile; 
    404  int length_v_subroutinename; 
    405  int length_v_precision; 
    406  int length_v_IntentSpec; 
    407  int length_v_initialvalue; 
    408  int length_v_readedlistdimension; 
    409  int length_u_usemodule; 
    410  int length_u_charusemodule; 
    411  int length_u_cursubroutine; 
    412  int length_u_modulename; 
    413  int length_n_name; 
    414  int length_c_namevar; 
    415  int length_c_namepointedvar; 
    416  int length_o_nom; 
    417  int length_o_module; 
    418  int length_a_nomvar; 
    419  int length_a_subroutine; 
    420  int length_a_module; 
    421  int length_t_usemodule; 
    422  int length_t_cursubroutine; 
    423  int length_curfilename; 
    424  int length_nomfileoutput; 
    425  int length_motparse; 
    426  int length_mainfile; 
    427  int length_nomdir; 
    428  int length_commondirout; 
    429  int length_commondirin; 
    430  int length_filetoparse; 
    431  int length_curbuf; 
    432  int length_toprintglob; 
    433  int length_tmpvargridname; 
    434  int length_ligne_Subloop; 
    435  int length_lvargridname_toamr; 
    436  int length_toprint_utilagrif; 
    437  int length_toprinttmp_utilchar; 
    438  int length_ligne_writedecl; 
    439  int length_newname_toamr; 
    440  int length_newname_writedecl; 
    441  int length_ligne_toamr; 
    442  int length_tmpligne_writedecl; 
     356size_t length_last; 
     357size_t length_first; 
     358size_t length_v_vallengspec; 
     359size_t length_v_commoninfile; 
     360size_t length_v_precision; 
     361size_t length_v_IntentSpec; 
     362size_t length_v_initialvalue; 
     363size_t length_v_readedlistdimension; 
     364size_t length_a_nomvar; 
     365size_t length_toprintglob; 
     366size_t length_tmpvargridname; 
     367size_t length_ligne_Subloop; 
     368size_t length_toprint_utilagrif; 
     369size_t length_toprinttmp_utilchar; 
     370size_t length_ligne_writedecl; 
     371size_t length_newname_toamr; 
     372size_t length_newname_writedecl; 
     373size_t length_ligne_toamr; 
     374size_t length_tmpligne_writedecl; 
    443375 int value_char_size; 
    444376 int value_char_size1; 
     
    446378 int value_char_size3; 
    447379 
    448   
     380 
    449381 int inallocate; 
    450382 int infixed; 
     
    453385/*********** Declaration of externals subroutines *****************************/ 
    454386/***************************************************** ************************/ 
     387extern char *fortran_text; 
    455388/******************************************************************************/ 
    456389/*********** convert.y ********************************************************/ 
    457390/******************************************************************************/ 
    458391extern int main(int argc,char *argv[]); 
     392extern int convert_error(const char *s); 
    459393/******************************************************************************/ 
    460394/*********** fortran.y ********************************************************/ 
    461395/******************************************************************************/ 
    462 extern void processfortran(char *fichier_entree); 
     396extern void process_fortran(const char *input_file); 
     397extern int fortran_error(const char *s); 
    463398/******************************************************************************/ 
    464399/*********** dependfile.c *****************************************************/ 
     
    466401extern void Writethedependnbxnbyfile(); 
    467402extern void Readthedependnbxnbyfile(); 
    468 extern void Writethedependlistofmoduleused(char *NameTampon ); 
    469 extern void Readthedependlistofmoduleused(char *NameTampon); 
    470 extern void WritedependParameterList(char *NameTampon ); 
    471 extern listparameter *ReaddependParameterList(char *NameTampon, 
    472                                                         listparameter *listout); 
    473 extern void Writethedependfile(char *NameTampon, listvar *input ); 
    474 extern listvar *Readthedependfile( char *NameTampon , listvar *listout); 
     403extern void Writethedependlistofmoduleused(const char *NameTampon ); 
     404extern void Readthedependlistofmoduleused(const char *NameTampon); 
     405extern void WritedependParameterList(const char *NameTampon ); 
     406extern listparameter *ReaddependParameterList(const char *NameTampon, listparameter *listout); 
     407extern void Writethedependfile(const char *NameTampon, listvar *input ); 
     408extern listvar *Readthedependfile(const char *NameTampon , listvar *listout); 
    475409extern void Write_Subroutine_For_Alloc(); 
    476410extern void Read_Subroutine_For_Alloc(); 
    477411extern void Writethedependavailablefile(); 
    478412extern void Readthedependavailablefile(); 
    479 extern int Did_filetoparse_readed(char *NameTampon); 
    480 extern int Did_module_common_treaded(char *NameTampon); 
     413extern int is_dependfile_created(const char *NameTampon); 
    481414extern void Write_val_max(); 
    482415extern void Read_val_max(); 
     
    485418/******************************************************************************/ 
    486419extern void Add_Common_var_1(); 
    487 extern listnom *Addtolistnom(char *nom, listnom *listin,int value); 
    488 extern listname *Addtolistname(char *nom,listname *input); 
    489 extern int ModuleIsDefineInInputFile(char *name); 
    490 extern void Addmoduletothelisttmp(char *name); 
    491 extern void Add_NameOfModule_1(char *nom); 
    492 extern void Add_NameOfCommon_1(char *nom,char *cursubroutinename); 
    493 extern void Add_CouplePointed_Var_1(char *namemodule,listcouple *couple); 
    494 extern void Add_Include_1(char *name); 
     420extern listnom  *Addtolistnom(const char *nom, listnom *listin, int value); 
     421extern listname *Addtolistname(const char *nom, listname *input); 
     422extern int ModuleIsDefineInInputFile(const char *name); 
     423extern void Addmoduletothelisttmp(const char *name); 
     424extern void Add_NameOfModule_1(const char *nom); 
     425extern void Add_NameOfCommon_1(const char *nom, const char *cursubroutinename); 
     426extern void Add_CouplePointed_Var_1(const char *namemodule, listcouple *couple); 
     427extern void Add_Include_1(const char *name); 
    495428extern void Add_ImplicitNoneSubroutine_1(); 
    496 extern void WriteIncludeDeclaration(); 
    497 extern void Add_Save_Var_1 (char *name,listdim *d); 
     429extern void WriteIncludeDeclaration(FILE* tofile); 
     430extern void Add_Save_Var_1 (const char *name,listdim *d); 
    498431extern void Add_Save_Var_dcl_1 (listvar *var); 
    499432/******************************************************************************/ 
    500433/*********** SubLoopCreation.c ************************************************/ 
    501434/******************************************************************************/ 
    502 extern void writeheadnewsub_0(); 
    503 extern void WriteVariablelist_subloop(FILE *outputfile,char *ligne); 
    504 extern void WriteVariablelist_subloop_Call(FILE *outputfile,char *ligne); 
    505 extern void WriteVariablelist_subloop_Def(FILE *outputfile,char *ligne); 
     435extern void WriteBeginof_SubLoop(); 
     436extern void WriteVariablelist_subloop(char *ligne); 
     437extern void WriteVariablelist_subloop_Call(char **ligne, size_t line_length); 
     438extern void WriteVariablelist_subloop_Def(char *ligne); 
    506439extern void WriteHeadofSubroutineLoop(); 
    507440extern void closeandcallsubloopandincludeit_0(int suborfun); 
     
    510443/*********** toamr.c **********************************************************/ 
    511444/******************************************************************************/ 
    512 extern char *variablenameroottabvars (variable * var); 
    513 extern char *variablenametabvars (variable * var, int iorindice); 
    514 extern char *variablecurgridtabvars (variable * var,int ParentOrCurgrid); 
    515 extern void WARNING_CharSize(variable *var); 
    516 extern char *vargridnametabvars (variable * var,int iorindice); 
    517 extern char *vargridcurgridtabvars (variable * var,int ParentOrCurgrid); 
    518 extern char *vargridcurgridtabvarswithoutAgrif_Gr (variable * var); 
    519 extern char *vargridparam (variable * v, int whichone); 
     445extern void WARNING_CharSize(const variable *var); 
     446extern const char * tabvarsname(const variable *var); 
     447extern const char * variablecurgridtabvars(int which_grid); 
     448extern const char * vargridnametabvars(const variable *var, int iorindice); 
     449extern const char * vargridcurgridtabvars(const variable *var, int which_grid); 
     450extern const char * vargridcurgridtabvarswithoutAgrif_Gr(const variable *var); 
     451extern const char * vargridparam(const variable *var); 
    520452extern void write_probdimagrif_file(); 
    521453extern void write_keysagrif_file(); 
    522454extern void write_modtypeagrif_file(); 
    523 extern void write_createvarnameagrif_file(variable *v,FILE *createvarname, 
    524                                                                 int *InitEmpty); 
     455extern void write_createvarnameagrif_file(variable *v,FILE *createvarname,int *InitEmpty); 
     456extern void write_initialisationsagrif_file(variable *v,FILE *initproc,int *VarnameEmpty); 
    525457extern void write_Setnumberofcells_file(); 
    526458extern void write_Getnumberofcells_file(); 
    527 extern void write_initialisationsagrif_file(variable *v,FILE *initproc, 
    528                                                              int *VarnameEmpty); 
    529459extern void Write_Alloc_Agrif_Files(); 
    530460extern int IndiceInlist(int indic, listindice *listin); 
    531461extern void write_allocation_Common_0(); 
    532462extern void write_allocation_Global_0(); 
    533 extern void creefichieramr (char *NameTampon); 
     463extern void creefichieramr(); 
    534464/******************************************************************************/ 
    535465/*********** UtilAgrif.c ******************************************************/ 
    536466/******************************************************************************/ 
    537 extern int Vartonumber(char *tokname); 
    538 extern int Agrif_in_Tok_NAME(char *tokname); 
    539 extern void ModifyTheVariableName_0(char *ident,int lengthname); 
    540 extern void Add_SubroutineWhereAgrifUsed_1(char *sub,char *mod); 
     467extern int Vartonumber(const char *tokname); 
     468extern int Agrif_in_Tok_NAME(const char *tokname); 
     469extern void ModifyTheVariableName_0(const char *ident,int lengthname); 
     470extern void Add_SubroutineWhereAgrifUsed_1(const char *sub, const char *mod); 
    541471extern void AddUseAgrifUtil_0(FILE *fileout); 
    542472extern void AddUseAgrifUtilBeforeCall_0(FILE *fileout); 
    543 extern void NotifyAgrifFunction_0(char *ident); 
    544 extern void ModifyTheAgrifFunction_0(char *ident); 
    545 extern void AgriffunctionModify_0(char *ident,int whichone); 
    546 extern void Instanciation_0(char *ident); 
     473extern void NotifyAgrifFunction_0(const char *ident); 
     474extern void ModifyTheAgrifFunction_0(const char *ident); 
     475extern void AgriffunctionModify_0(const char *ident,int whichone); 
     476extern void Instanciation_0(const char *ident); 
    547477/******************************************************************************/ 
    548478/*********** UtilCharacter.c **************************************************/ 
    549479/******************************************************************************/ 
    550 extern void FindAndChangeNameToTabvars(char name[LONG_C],char toprint[LONG_4C], 
     480extern void FindAndChangeNameToTabvars(const char name[LONG_M],char toprint[LONG_M], 
    551481                                             listvar * listtosee, int whichone); 
    552 extern char *ChangeTheInitalvaluebyTabvarsName(char *nom,listvar *listtoread, 
    553                                                                   int whichone); 
    554 extern int IsVariableReal(char *nom); 
    555 extern void IsVarInUseFile(char *nom); 
    556 extern listnom *DecomposeTheNameinlistnom(char *nom, listnom * listout); 
    557 extern void DecomposeTheName(char *nom); 
    558 extern void convert2lower(char *name); 
    559 extern int convert2int(char *name); 
     482extern const char *ChangeTheInitalvaluebyTabvarsName(const char *nom,listvar *listtoread); 
     483extern int IsVariableReal(const char *nom); 
     484extern void IsVarInUseFile(const char *nom); 
     485extern listnom *DecomposeTheNameinlistnom(const char *nom, listnom * listout); 
     486extern void DecomposeTheName(const char *nom); 
     487extern void convert2lower(char *lowername, const char* inputname); 
     488extern int convert2int(const char *name); 
    560489/******************************************************************************/ 
    561490/*********** UtilFile.c *******************************************************/ 
    562491/******************************************************************************/ 
    563 extern FILE * associate (char *filename); 
    564 extern FILE * associateaplus (char *filename); 
     492extern FILE * open_for_write (const char *filename); 
     493extern FILE * open_for_append (const char *filename); 
    565494extern long int setposcur(); 
    566495extern long int setposcurname(FILE *fileout); 
    567 extern long int setposcurinoldfortranout(); 
    568 extern void copyuse_0(char *namemodule); 
    569 extern void copyuseonly_0(char *namemodule); 
     496extern void copyuse_0(const char *namemodule); 
     497extern void copyuseonly_0(const char *namemodule); 
    570498/******************************************************************************/ 
    571499/*********** UtilFortran.c ****************************************************/ 
    572500/******************************************************************************/ 
    573 extern void initdimprob(int dimprobmod, char * nx, char * ny,char* nz); 
    574 extern int Variableshouldberemove(char *nom); 
     501extern void initdimprob(int dimprobmod, const char *nx, const char *ny, const char *nz); 
     502extern int Variableshouldberemoved(const char *nom); 
    575503extern int variableisglobal(listvar *curvar, listvar *listin); 
    576504extern int VariableIsInListCommon(listvar *curvar,listvar *listin); 
    577505extern int VariableIsInList(listvar *curvar,listvar *listin); 
    578 extern void variableisglobalinmodule(listcouple *listin, char *module, 
     506extern void variableisglobalinmodule(listcouple *listin, const char *module, 
    579507                                                                 FILE *fileout,long int oldposcuruse); 
    580 extern void Remove_Word_Contains_0(); 
    581 extern void Remove_Word_end_module_0(int modulenamelength); 
    582 extern void Write_Word_Contains_0(); 
    583508extern void Write_Word_end_module_0(); 
    584 extern void Add_Subroutine_For_Alloc(char *nom); 
    585 extern void Write_Alloc_Subroutine_0(); 
    586 extern void Write_Alloc_Subroutine_For_End_0(); 
    587 extern void Write_GlobalParameter_Declaration_0(); 
    588 extern void Write_GlobalType_Declaration_0(); 
    589 extern void Write_NotGridDepend_Declaration_0(); 
     509extern void Add_Subroutine_For_Alloc(const char *nom); 
     510extern void Write_Closing_Module(); 
    590511extern int IsTabvarsUseInArgument_0(); 
    591512extern int ImplicitNoneInSubroutine(); 
     
    593514extern void Add_Pointer_Var_1(char *nom); 
    594515extern int varispointer_0(char *ident); 
    595 extern int VariableIsNotFunction(char *ident); 
     516extern int VariableIsFunction(const char *ident); 
    596517extern int varistyped_0(char *ident); 
     518extern void dump_var(const variable* var); 
    597519/******************************************************************************/ 
    598520/*********** UtilListe.c ******************************************************/ 
    599521/******************************************************************************/ 
    600522extern void Init_Variable(variable *var); 
    601 extern listvar * AddListvarToListvar(listvar *l,listvar *glob, 
    602                                                             int ValueFirstpass); 
    603 extern void CreateAndFillin_Curvar(char *type,variable *curvar); 
    604 extern void duplicatelistvar(listvar *orig); 
     523extern listvar * AddListvarToListvar(listvar *l,listvar *glob, int ValueFirstpass); 
     524extern void CreateAndFillin_Curvar(const char *type, variable *curvar); 
     525// extern void duplicatelistvar(listvar *orig); 
    605526extern listdim * insertdim(listdim *lin,typedim nom); 
    606527extern void change_dim_char(listdim *lin,listvar * l); 
    607 extern int num_dims(listdim *d); 
    608 extern variable * createvar(char *nom,listdim *d); 
     528extern int get_num_dims(const listdim *d); 
     529extern variable * createvar(const char *nom, listdim *d); 
    609530extern listvar * insertvar(listvar *lin,variable *v); 
    610 extern listvar *settype(char *nom,listvar *lin); 
     531extern listvar * settype(const char *nom,listvar *lin); 
    611532extern void printliste(listvar * lin); 
    612533extern int IsinListe(listvar *lin,char *nom); 
    613534extern listname *Insertname(listname *lin,char *nom,int sens); 
    614535extern listname *concat_listname(listname *l1, listname *l2); 
    615 extern void *createstringfromlistname(char *ligne, listname *lin); 
     536extern void createstringfromlistname(char *ligne, listname *lin); 
    616537extern void printname(listname * lin); 
    617538extern void removeglobfromlist(listname **lin); 
    618539extern void writelistpublic(listname *lin); 
    619540extern void Init_List_Data_Var(); 
     541extern void  addprecision_derivedfromkind(variable *curvar); 
     542extern int get_cat_var(variable *var); 
    620543/******************************************************************************/ 
    621544/*********** UtilNotGridDep.c *************************************************/ 
     
    626549/*********** WorkWithAllocatelist.c *******************************************/ 
    627550/******************************************************************************/ 
    628 extern void Add_Allocate_Var_1(char *nom,char *nommodule); 
    629 extern int IsVarAllocatable_0(char *ident); 
    630 extern int varisallocatable_0(char *ident); 
     551extern void Add_Allocate_Var_1(const char *nom, const char *nommodule); 
     552extern int IsVarAllocatable_0(const char *ident); 
    631553/******************************************************************************/ 
    632554/*********** WorkWithglobliste.c **********************************************/ 
     
    643565/*********** WorkWithlistmoduleinfile.c ***************************************/ 
    644566/******************************************************************************/ 
    645 extern void Save_Length(char *nom, int whichone); 
     567extern void Save_Length(const char *nom, int whichone); 
    646568extern void Save_Length_int(int val, int whichone); 
    647569/******************************************************************************/ 
     
    651573extern void  RecordUseModulesUseModulesVariables(); 
    652574extern void Add_NameOfModuleUsed_1(char *name); 
    653 extern void Addmoduletothelist(char *name); 
    654 extern void WriteUsemoduleDeclaration(char *cursubroutinename); 
     575extern void Addmoduletothelist(const char *name); 
     576extern void WriteUsemoduleDeclaration(const char *cursubroutinename); 
    655577/******************************************************************************/ 
    656578/*********** WorkWithlistvarindoloop.c ****************************************/ 
    657579/******************************************************************************/ 
    658 extern void Add_UsedInSubroutine_Var_1 (char *ident); 
     580extern void Add_UsedInSubroutine_Var_1 (const char *ident); 
    659581extern void ajoutevarindoloop_definedimension (char *name); 
    660582extern void  ModifyThelistvarindoloop(); 
    661583extern void  CompleteThelistvarindoloop(); 
    662 extern void CopyRecord(variable *var1,variable *var2); 
     584extern void Merge_Variables(variable *var1,variable *var2); 
    663585extern void Update_List_Subroutine_Var(listvar *list_to_modify); 
    664586extern void Update_List_Global_Var_From_List_Save_Var(); 
     
    669591extern int LookingForVariableInList(listvar *listin,variable *var); 
    670592extern int LookingForVariableInListGlobal(listvar *listin,variable *var); 
    671 extern int LookingForVariableInListName(listvar *listin,char *var); 
     593extern int LookingForVariableInListName(listvar *listin,const char *var); 
    672594extern int LookingForVariableInListGlob(listvar *listin,variable *var); 
    673 extern int LookingForVariableInListParamGlob(listparameter *listin, 
    674                                                                  variable *var); 
     595extern int LookingForVariableInListParamGlob(listparameter *listin, variable *var); 
     596extern variable *get_variable_in_list_from_name(listvar *listin, const char *name); 
    675597extern void UpdateListDeclarationWithDimensionList(); 
    676598extern void Clean_List_UsedInSubroutine_Var(); 
     599extern void Clean_List_ModuleUsed_Var(); 
    677600extern void Clean_List_SubroutineDeclaration_Var(); 
    678601extern void Clean_List_Global_Var(); 
     
    692615extern void UpdateList_SubroutineWhereAgrifUsed(); 
    693616extern void UpdateList_UsedInSubroutine_With_dimension(); 
    694 extern void Affiche(); 
     617extern void Affiche(listvar *parcours); 
    695618extern int SubInList_ContainsSubroutine(); 
     619extern void update_indicemaxtabvars(variable *var,listindice **Listofindices); 
    696620/******************************************************************************/ 
    697621/*********** WorkWithParameterlist.c ******************************************/ 
     
    704628/******************************************************************************/ 
    705629extern void Add_SubroutineArgument_Var_1(listvar *listtoadd); 
    706 extern void Add_FunctionType_Var_1(char *nom); 
    707 extern void Add_SubroutineDeclaration_Var_1 (listvar *listtoadd); 
     630extern void Add_FunctionType_Var_1(const char *nom); 
     631// extern void Add_SubroutineDeclaration_Var_1 (listvar *listtoadd); 
    708632/******************************************************************************/ 
    709633/*********** Writedeclarations.c **********************************************/ 
    710634/******************************************************************************/ 
    711 extern void WriteBeginDeclaration(variable *v,char ligne[LONG_4C],int visibility); 
    712 extern void WriteScalarDeclaration(variable *v,char ligne[LONG_4C]); 
    713 extern void WriteTableDeclaration(variable * v,char ligne[LONG_4C],int tmpok); 
    714 extern void writevardeclaration (listvar * var_record, FILE *fileout, 
    715                                                                      int value,int visibility); 
    716 extern void WriteLocalParamDeclaration(); 
    717 extern void WriteFunctionDeclaration(int value); 
     635extern void WriteBeginDeclaration(variable *v,char ligne[LONG_M],int visibility); 
     636extern void WriteScalarDeclaration(variable *v,char ligne[LONG_M]); 
     637extern void WriteTableDeclaration(variable * v,char ligne[LONG_M],int tmpok); 
     638extern void WriteVarDeclaration( variable *v, FILE *fileout, int value, int visibility ); 
     639extern void WriteLocalParamDeclaration(FILE* tofile); 
     640extern void WriteFunctionDeclaration(FILE* tofile, int value); 
    718641extern void WriteSubroutineDeclaration(int value); 
    719642extern void WriteArgumentDeclaration_beforecall(); 
    720 extern void WriteArgumentDeclaration_Sort(); 
    721 extern listnom *writedeclarationintoamr (listvar * deb_common, FILE *fileout, 
    722                                        variable *var , char commonname[LONG_C], 
    723                            listnom *neededparameter, char name_common[LONG_C]); 
    724 extern void writesub_loopdeclaration_scalar (listvar * deb_common, 
    725                                                                  FILE *fileout); 
    726 extern void writesub_loopdeclaration_tab (listvar * deb_common, FILE *fileout); 
     643extern void WriteArgumentDeclaration_Sort(FILE* tofile); 
     644extern listnom * writedeclarationintoamr(listvar *deb_common, FILE *fileout, variable *var, 
     645                  const char *commonname, listnom *neededparameter, const char *name_common); 
     646extern void writesub_loopdeclaration_scalar(listvar *deb_common, FILE *fileout); 
     647extern void writesub_loopdeclaration_tab(listvar *deb_common, FILE *fileout); 
    727648extern void ReWriteDeclarationAndAddTosubroutine_01(listvar *listdecl); 
    728649extern void ReWriteDataStatement_0(FILE * filout); 
     
    730651/*********** WriteInFile.c ****************************************************/ 
    731652/******************************************************************************/ 
    732 extern void tofich_reste (FILE * filout, char *s,int returnlineornot); 
    733 extern void tofich (FILE * filout, char *s, int returnlineornot); 
     653extern void tofich_reste (FILE * filout, const char *s, int do_returnline); 
     654extern void tofich (FILE * filout, const char *s, int do_returnline); 
    734655extern void tofich_blanc (FILE * filout, int size); 
    735 extern void tofich_line (FILE * filout, int size, int long position); 
    736 extern void RemoveWordSET_0(FILE * filout, long int position, 
    737                                                          long int sizetoremove); 
    738 extern void RemoveWordCUR_0(FILE * filout, long int position, 
    739                                                          long int sizetoremove); 
     656extern void RemoveWordSET_0(FILE * filout, long int position, int sizetoremove); 
     657extern void RemoveWordCUR_0(FILE * filout, int sizetoremove); 
    740658 
    741659/******************************************************************************/ 
    742660/*********** WorkWithlistofcoupled.c **********************************************/ 
    743 /******************************************************************************/                                                         
    744 extern int variscoupled_0(char *ident) ; 
    745 extern char * getcoupledname_0(char *ident); 
    746 extern void ModifyTheVariableNamecoupled_0(char *ident, char* coupledident); 
     661/******************************************************************************/ 
     662extern int variscoupled_0(const char *ident) ; 
     663extern const char * getcoupledname_0(const char *ident); 
Note: See TracChangeset for help on using the changeset viewer.