Changeset 6225 for branches/2014/dev_r4704_NOC5_MPP_BDY_UPDATE/NEMOGCM/EXTERNAL/AGRIF/LIB/UtilFile.c
- Timestamp:
- 2016-01-08T10:35:19+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4704_NOC5_MPP_BDY_UPDATE/NEMOGCM/EXTERNAL/AGRIF/LIB/UtilFile.c
r2528 r6225 40 40 41 41 /******************************************************************************/ 42 /* associate*/42 /* open_for_write */ 43 43 /******************************************************************************/ 44 44 /* This subroutine is used to open a file */ 45 45 /******************************************************************************/ 46 FILE * associate (char *filename)46 FILE* open_for_write (const char *filename) 47 47 { 48 char filefich[LONG_C];49 sprintf(filefich,"%s/%s",nomdir,filename);50 return fopen(filefich, "w");48 char filefich[LONG_FNAME]; 49 sprintf(filefich,"%s/%s",include_dir,filename); 50 return fopen(filefich, "w"); 51 51 } 52 52 53 54 53 /******************************************************************************/ 55 /* associateaplus*/54 /* open_for_append */ 56 55 /******************************************************************************/ 57 56 /* This subroutine is used to open a file with option a+ */ 58 57 /******************************************************************************/ 59 FILE * associateaplus (char *filename)58 FILE* open_for_append (const char *filename) 60 59 { 61 char filefich[LONG_C];62 sprintf(filefich,"%s/%s",nomdir,filename);63 return fopen(filefich, "a+");60 char filefich[LONG_M]; 61 sprintf(filefich,"%s/%s",include_dir,filename); 62 return fopen(filefich, "a+"); 64 63 } 65 64 66 67 65 /******************************************************************************/ 68 /* setposcurname 66 /* setposcurname */ 69 67 /******************************************************************************/ 70 68 /* This subroutine is used to know the current position in the file in argument */ … … 76 74 long int setposcurname(FILE *fileout) 77 75 { 78 fflush(fileout);79 return ftell(fileout);76 fflush(fileout); 77 return ftell(fileout); 80 78 } 81 79 … … 91 89 long int setposcur() 92 90 { 93 fflush(fortranout); 94 return ftell(fortranout); 95 } 96 97 /******************************************************************************/ 98 /* setposcurinoldfortranout */ 99 /******************************************************************************/ 100 /* This subroutine is used to know the position in the oldfortranout */ 101 /******************************************************************************/ 102 /* */ 103 /* setposcurinoldfortranout ---------> position in file */ 104 /* */ 105 /******************************************************************************/ 106 long int setposcurinoldfortranout() 107 { 108 fflush(oldfortranout); 109 return ftell(oldfortranout); 91 return setposcurname(fortran_out); 110 92 } 111 93 … … 114 96 /******************************************************************************/ 115 97 /* Firstpass 0 */ 116 /* We should write in the fortran out the USE tok_name */98 /* We should write in the fortran_out the USE tok_name */ 117 99 /* read in the original file */ 118 100 /******************************************************************************/ 119 101 /* */ 120 102 /******************************************************************************/ 121 void copyuse_0(c har *namemodule)103 void copyuse_0(const char *namemodule) 122 104 { 123 if (firstpass == 0 &&IsTabvarsUseInArgument_0() == 1 )124 {125 /* We should write this declaration into the original subroutine too */126 fprintf(oldfortranout," USE %s \n",namemodule);127 }105 if ( IsTabvarsUseInArgument_0() == 1 ) 106 { 107 /* We should write this declaration into the original subroutine too */ 108 fprintf(oldfortran_out," use %s\n", namemodule); 109 } 128 110 } 129 111 … … 132 114 /******************************************************************************/ 133 115 /* Firstpass 0 */ 134 /* We should write in the fortran out the USE tok_name, only */116 /* We should write in the fortran_out the USE tok_name, only */ 135 117 /* read in the original file */ 136 118 /******************************************************************************/ 137 119 /* */ 138 120 /******************************************************************************/ 139 void copyuseonly_0(c har *namemodule)121 void copyuseonly_0(const char *namemodule) 140 122 { 141 123 if (firstpass == 0 && IsTabvarsUseInArgument_0() == 1 ) 142 124 { 143 125 /* We should write this declaration into the original subroutine too */ 144 fprintf(oldfortran out," USE %s , ONLY : \n",namemodule);126 fprintf(oldfortran_out," use %s , only : \n", namemodule); 145 127 } 146 128 }
Note: See TracChangeset
for help on using the changeset viewer.