Changeset 1200 for trunk/AGRIF/LIB/UtilAgrif.c
- Timestamp:
- 2008-09-24T15:05:20+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AGRIF/LIB/UtilAgrif.c
r774 r1200 103 103 /* */ 104 104 /******************************************************************************/ 105 void ModifyTheVariableName_0(char *ident )105 void ModifyTheVariableName_0(char *ident, int lengthname) 106 106 { 107 107 listvar *newvar; 108 108 int out; 109 109 110 110 if ( firstpass == 0 ) 111 111 { … … 150 150 { 151 151 /* remove the variable */ 152 RemoveWordCUR_0(fortranout,(long)(- strlen(ident)),153 strlen(ident));154 fseek(fortranout,(long)(- strlen(ident)),SEEK_CUR);152 RemoveWordCUR_0(fortranout,(long)(-lengthname), 153 lengthname); 154 fseek(fortranout,(long)(-lengthname),SEEK_CUR); 155 155 /* then write the new name */ 156 156 if ( inagrifcallargument == 1 && agrif_parentcall == 0 ) … … 181 181 { 182 182 if ( !strcasecmp(newvar->var->v_nomvar,ident) ) out = 1; 183 else newvar=newvar->suiv; 184 } 185 if ( out == 1 ) 186 { 187 /* remove the variable */ 188 RemoveWordCUR_0(fortranout,(long)(-lengthname), 189 lengthname); 190 fseek(fortranout,(long)(-lengthname),SEEK_CUR); 191 /* then write the new name */ 192 if ( retour77 == 0 ) 193 { 194 fprintf(fortranout," Agrif_tabvars & \n "); 195 } 196 else 197 { 198 fprintf(fortranout," \n & Agrif_tabvars"); 199 } 200 fprintf(fortranout,"%s", 201 vargridcurgridtabvarswithoutAgrif_Gr(newvar->var)); 202 colnum = strlen( 203 vargridcurgridtabvarswithoutAgrif_Gr(newvar->var)); 204 } 205 } 206 } 207 } 208 } 209 210 /******************************************************************************/ 211 /* ModifyTheVariableName_0 */ 212 /******************************************************************************/ 213 /* Firstpass 0 */ 214 /******************************************************************************/ 215 /* */ 216 /* Agrif_<toto>(variable) ====> Agrif_<toto>(variable) */ 217 /* */ 218 /******************************************************************************/ 219 void ModifyTheVariableNamecoupled_0(char *ident, char* coupledident) 220 { 221 listvar *newvar; 222 int out; 223 224 if ( firstpass == 0 ) 225 { 226 newvar = List_Global_Var; 227 out=0; 228 while ( newvar && out == 0 ) 229 { 230 if ( !strcasecmp(newvar->var->v_nomvar,coupledident) ) out = 1; 231 else newvar=newvar->suiv; 232 } 233 234 if ( out == 0 ) 235 { 236 newvar = List_ModuleUsed_Var; 237 while ( newvar && out == 0 ) 238 { 239 if ( !strcasecmp(newvar->var->v_nomvar,coupledident) ) out = 1; 240 else newvar=newvar->suiv; 241 } 242 } 243 if ( out == 0 ) 244 { 245 newvar = List_Common_Var; 246 while ( newvar && out == 0 ) 247 { 248 if ( !strcasecmp(newvar->var->v_nomvar,coupledident) ) out = 1; 249 else newvar=newvar->suiv; 250 } 251 } 252 253 if ( out == 0 ) 254 { 255 newvar = List_ModuleUsedInModuleUsed_Var; 256 while ( newvar && out == 0 ) 257 { 258 if ( !strcasecmp(newvar->var->v_nomvar,coupledident) ) out = 1; 259 else newvar=newvar->suiv; 260 } 261 } 262 263 if ( out == 1 ) 264 { 265 /* remove the variable */ 266 RemoveWordCUR_0(fortranout,(long)(-strlen(ident)), 267 strlen(ident)); 268 fseek(fortranout,(long)(-strlen(ident)),SEEK_CUR); 269 /* then write the new name */ 270 if ( inagrifcallargument == 1 && agrif_parentcall == 0 ) 271 fprintf(fortranout,"%d",newvar->var->v_indicetabvars); 272 else 273 { 274 if ( retour77 == 0 ) 275 { 276 fprintf(fortranout," Agrif_tabvars & \n "); 277 } 278 else 279 { 280 fprintf(fortranout,"Agrif_tabvars"); 281 fprintf(fortranout," \n & "); 282 } 283 fprintf(fortranout,"%s", 284 vargridcurgridtabvarswithoutAgrif_Gr(newvar->var)); 285 colnum = strlen(vargridcurgridtabvarswithoutAgrif_Gr(newvar->var)); 286 } 287 } 288 else 289 { 290 /* we should look in the List_ModuleUsed_Var */ 291 if ( inagrifcallargument != 1 ) 292 { 293 newvar = List_ModuleUsed_Var; 294 while ( newvar && out == 0 ) 295 { 296 if ( !strcasecmp(newvar->var->v_nomvar,coupledident) ) out = 1; 183 297 else newvar=newvar->suiv; 184 298 } … … 207 321 } 208 322 } 323 209 324 210 325 … … 581 696 { 582 697 char toprint[LONG_C]; 583 584 698 if ( firstpass == 0 ) 585 699 {
Note: See TracChangeset
for help on using the changeset viewer.