Changeset 530 for trunk/AGRIF/LIB/UtilAgrif.c
- Timestamp:
- 2006-10-17T17:36:11+02:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AGRIF/LIB/UtilAgrif.c
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 /* */ 8 /* This program is free software; you can redistribute it and/or modify */ 9 /* it */ 10 /* */ 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. */ 15 /* */ 7 /* This software is governed by the CeCILL-C license under French law and */ 8 /* abiding by the rules of distribution of free software. You can use, */ 9 /* modify and/ or redistribute the software under the terms of the CeCILL-C */ 10 /* license as circulated by CEA, CNRS and INRIA at the following URL */ 11 /* "http://www.cecill.info". */ 12 /* */ 13 /* As a counterpart to the access to the source code and rights to copy, */ 14 /* modify and redistribute granted by the license, users are provided only */ 15 /* with a limited warranty and the software's author, the holder of the */ 16 /* economic rights, and the successive licensors have only limited */ 17 /* liability. */ 18 /* */ 19 /* In this respect, the user's attention is drawn to the risks associated */ 20 /* with loading, using, modifying and/or developing or reproducing the */ 21 /* software by the user in light of its specific status of free software, */ 22 /* that may mean that it is complicated to manipulate, and that also */ 23 /* therefore means that it is reserved for developers and experienced */ 24 /* professionals having in-depth computer knowledge. Users are therefore */ 25 /* encouraged to load and test the software's suitability as regards their */ 26 /* requirements in conditions enabling the security of their systems and/or */ 27 /* data to be ensured and, more generally, to use and operate it in the */ 28 /* same conditions as regards security. */ 29 /* */ 30 /* The fact that you are presently reading this means that you have had */ 31 /* knowledge of the CeCILL-C license and that you accept its terms. */ 32 /******************************************************************************/ 33 /* version 1.0 */ 16 34 /******************************************************************************/ 17 35 #include <stdio.h> … … 20 38 #include "decl.h" 21 39 /******************************************************************************/ 22 /* AGRIF_n_Vartonumber*/40 /* Vartonumber */ 23 41 /******************************************************************************/ 24 42 /* This subroutine is used to know if Agrif_ is locate in the char */ … … 27 45 /* */ 28 46 /******************************************************************************/ 29 int AGRIF_n_Vartonumber(char *tokname)47 int Vartonumber(char *tokname) 30 48 { 31 49 int agrifintheword; … … 53 71 54 72 /******************************************************************************/ 55 /* AGRIF_n_Agrif_in_Tok_NAME */73 /* Agrif_in_Tok_NAME */ 56 74 /******************************************************************************/ 57 75 /* This subroutine is used to know if Agrif_ is locate in the char */ … … 63 81 /* */ 64 82 /******************************************************************************/ 65 int A GRIF_n_Agrif_in_Tok_NAME(char *tokname)83 int Agrif_in_Tok_NAME(char *tokname) 66 84 { 67 85 int agrifintheword; … … 75 93 76 94 /******************************************************************************/ 77 /* AGRIF_1_completeListofvariableinagriffunction*/95 /* completeListofvariableinagriffunction_1 */ 78 96 /******************************************************************************/ 79 97 /* Firstpass 1 */ … … 91 109 /* */ 92 110 /******************************************************************************/ 93 void AGRIF_1_completeListofvariableinagriffunction(char *ident)111 void completeListofvariableinagriffunction_1(char *ident) 94 112 { 95 113 listnom *listnomtmp; … … 125 143 126 144 /******************************************************************************/ 127 /* AGRIF_0_ModifyTheVariableName*/145 /* ModifyTheVariableName_0 */ 128 146 /******************************************************************************/ 129 147 /* Firstpass 0 */ … … 133 151 /* */ 134 152 /******************************************************************************/ 135 void AGRIF_0_ModifyTheVariableName(char *ident)153 void ModifyTheVariableName_0(char *ident) 136 154 { 137 155 listvar *newvar; … … 156 174 { 157 175 /* remove the variable */ 158 RemoveWordCUR (fortranout,(long)(-strlen(ident)),176 RemoveWordCUR_0(fortranout,(long)(-strlen(ident)), 159 177 strlen(ident)); 160 178 fseek(fortranout,(long)(-strlen(ident)),SEEK_CUR); … … 164 182 else 165 183 { 166 fprintf(fortranout,"%s",vargridcurgridtabvars(newvar->var,0));167 colnum = strlen(vargridcurgridtabvars(newvar->var,0));168 184 if ( colnum >= 25 ) 169 185 { … … 177 193 } 178 194 } 195 fprintf(fortranout,"%s",vargridcurgridtabvars(newvar->var,0)); 196 colnum = strlen(vargridcurgridtabvars(newvar->var,0)); 179 197 } 180 198 } … … 193 211 { 194 212 /* remove the variable */ 195 RemoveWordCUR (fortranout,(long)(-strlen(ident)),213 RemoveWordCUR_0(fortranout,(long)(-strlen(ident)), 196 214 strlen(ident)); 197 215 fseek(fortranout,(long)(-strlen(ident)),SEEK_CUR); … … 218 236 219 237 /******************************************************************************/ 220 /* AGRIF_n_AddsubroutineTolistsubwhereagrifused */238 /* AddsubroutineTolistsubwhereagrifused */ 221 239 /******************************************************************************/ 222 240 /* This subroutine is used to add a record to */ … … 234 252 /* */ 235 253 /******************************************************************************/ 236 void A GRIF_n_AddsubroutineTolistsubwhereagrifused()254 void AddsubroutineTolistsubwhereagrifused() 237 255 { 238 256 listnom *listnomtmp; … … 264 282 265 283 /******************************************************************************/ 266 /* AGRIF_n_AddUseAgrifUtil*/284 /* AddUseAgrifUtil_0 */ 267 285 /******************************************************************************/ 268 286 /* Add use Agrif_Util at the beginning of the subroutine definition */ … … 280 298 /* */ 281 299 /******************************************************************************/ 282 void A GRIF_n_AddUseAgrifUtil()300 void AddUseAgrifUtil_0() 283 301 { 284 302 listnom *parcours; … … 286 304 int out; 287 305 306 if ( firstpass == 0 ) 307 { 308 adduseagrifutil = 0 ; 288 309 parcours = listofsubroutinewhereagrifisused; 289 310 while ( parcours && strcasecmp(parcours->nom,subroutinename) ) … … 312 333 } 313 334 } 314 } 315 316 317 /******************************************************************************/ 318 /* AGRIF_0_AgrifParentNotify */ 335 } 336 } 337 338 339 /******************************************************************************/ 340 /* AgrifParentNotify_0 */ 319 341 /******************************************************************************/ 320 342 /* Firstpass 0 */ … … 324 346 /* */ 325 347 /******************************************************************************/ 326 void AGRIF_0_NotifyAgrifFunction(char *ident)348 void NotifyAgrifFunction_0(char *ident) 327 349 { 328 350 if ( firstpass == 0 ) … … 482 504 483 505 /******************************************************************************/ 484 /* AGRIF_0_ModifyTheAgrifFunction*/506 /* ModifyTheAgrifFunction_0 */ 485 507 /******************************************************************************/ 486 508 /* Firstpass 0 */ … … 490 512 /* */ 491 513 /******************************************************************************/ 492 void AGRIF_0_ModifyTheAgrifFunction(char *ident)514 void ModifyTheAgrifFunction_0(char *ident) 493 515 { 494 516 if ( InAgrifParentDef != 0 ) 495 A GRIF_0_AgriffunctionModify(ident,InAgrifParentDef);517 AgriffunctionModify_0(ident,InAgrifParentDef); 496 518 /* */ 497 519 InAgrifParentDef = 0; … … 500 522 501 523 /******************************************************************************/ 502 /* A GRIF_0_AgriffunctionModify*/524 /* AgriffunctionModify_0 */ 503 525 /******************************************************************************/ 504 526 /* Firstpass 0 */ … … 566 588 /* */ 567 589 /******************************************************************************/ 568 void A GRIF_0_AgriffunctionModify(char *ident,int whichone)590 void AgriffunctionModify_0(char *ident,int whichone) 569 591 { 570 592 char toprint[LONGNOM]; … … 716 738 717 739 /******************************************************************************/ 718 /* AGRIF_0_AddUseAgrifInModuleDeclaration*/740 /* AddUseAgrifInModuleDeclaration_0 */ 719 741 /******************************************************************************/ 720 742 /* Add use Agrif_Util at the beginning of the subroutine definition */ … … 732 754 /* */ 733 755 /******************************************************************************/ 734 void A GRIF_0_AddUseAgrifInModuleDeclaration()756 void AddUseAgrifInModuleDeclaration_0() 735 757 { 736 758 listusemodule *newmodule; … … 760 782 } 761 783 } 784 785 786 /******************************************************************************/ 787 /* Instanciation_0 */ 788 /******************************************************************************/ 789 /* Firstpass 0 */ 790 /******************************************************************************/ 791 /* */ 792 /* Agrif_<toto>(variable) ====> Agrif_<toto>(variable) */ 793 /* */ 794 /******************************************************************************/ 795 void Instanciation_0(char *ident) 796 { 797 listvar *newvar; 798 int out; 799 800 if ( firstpass == 0 && sameagrifargument == 1 ) 801 { 802 if ( fortran77 == 0 ) newvar = globalvarofusefile; 803 else newvar = globliste; 804 805 out=0; 806 while ( newvar && out == 0 ) 807 { 808 if ( !strcasecmp(newvar->var->nomvar,ident) ) out = 1; 809 else newvar=newvar->suiv; 810 } 811 if ( out == 1 ) 812 { 813 /* then write the instanciation */ 814 fprintf(fortranout,"\n %s = %s",ident,vargridcurgridtabvars(newvar->var,3)); 815 colnum = 0; 816 } 817 else 818 { 819 newvar = globalvarofusefile; 820 821 out=0; 822 while ( newvar && out == 0 ) 823 { 824 if ( !strcasecmp(newvar->var->nomvar,ident) ) out = 1; 825 else newvar=newvar->suiv; 826 } 827 if ( out == 1 ) 828 { 829 /* then write the instanciation */ 830 fprintf(fortranout,"\n %s = %s",ident,vargridcurgridtabvars(newvar->var,3)); 831 colnum = 0; 832 } 833 } 834 } 835 sameagrifargument = 0; 836 }
Note: See TracChangeset
for help on using the changeset viewer.