Changeset 5470 for anuga_core/source/anuga/shallow_water/urs_ext.c
- Timestamp:
- Jul 7, 2008, 12:18:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/urs_ext.c
r5469 r5470 29 29 30 30 Python call: 31 read_mux2(numSrc,filenames,weights,file_params, write)31 read_mux2(numSrc,filenames,weights,file_params,verbose) 32 32 33 33 NOTE: … … 43 43 float *weights; 44 44 long numSrc; 45 long write;45 long verbose; 46 46 47 47 float **cdata; … … 58 58 // Convert Python arguments to C 59 59 if (!PyArg_ParseTuple(args, "iOOOi", 60 &numSrc,&filenames,&pyweights,&file_params,& write)) {60 &numSrc,&filenames,&pyweights,&file_params,&verbose)) { 61 61 62 62 PyErr_SetString(PyExc_RuntimeError, … … 117 117 118 118 // Read in mux2 data from file 119 cdata=_read_mux2((int)numSrc,muxFileNameArray,weights,(double*)file_params->data,(int) write);119 cdata=_read_mux2((int)numSrc,muxFileNameArray,weights,(double*)file_params->data,(int)verbose); 120 120 121 121 … … 181 181 free(weights); 182 182 free(muxFileNameArray); 183 free(cdata); 183 184 return PyArray_Return(pydata); 184 185 185 186 } 186 187 187 float** _read_mux2(int numSrc, char **muxFileNameArray, float *weights, double *params, int write)188 float** _read_mux2(int numSrc, char **muxFileNameArray, float *weights, double *params, int verbose) 188 189 { 189 190 FILE *fp; … … 225 226 } 226 227 227 228 /* open the first muxfile */ 229 if((fp=fopen(muxFileNameArray[0],"r"))==NULL) 230 { 228 if (verbose){ 229 printf("Reading mux header information\n"); 230 } 231 232 /* Open the first muxfile */ 233 if((fp=fopen(muxFileNameArray[0],"r"))==NULL){ 231 234 fprintf(stderr, "cannot open file %s\n", muxFileNameArray[0]); 232 235 exit(-1); 233 236 } 234 237 235 /* read in the header */236 /* first read the number of stations*/238 /* Read in the header */ 239 /* First read the number of stations*/ 237 240 fread(&nsta0,sizeof(int),1,fp); 238 241 … … 364 367 exit(-1); 365 368 } 369 370 if (verbose){ 371 printf("Reading mux file %s\n",muxFileName); 372 } 366 373 367 374 offset=sizeof(int)+nsta0*(sizeof(struct tgsrwg)+2*sizeof(int));
Note: See TracChangeset
for help on using the changeset viewer.