Changeset 5541 for anuga_core/source/anuga/shallow_water/urs_ext.c
- Timestamp:
- Jul 21, 2008, 12:30:26 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/urs_ext.c
r5539 r5541 33 33 double *params, 34 34 int *number_of_stations, 35 int*permutation,35 long *permutation, 36 36 int verbose); 37 37 … … 74 74 // Convert Python arguments to C 75 75 if (!PyArg_ParseTuple(args, "iOOOOi", 76 &numSrc, &filenames, &pyweights, &file_params, &permutation, &verbose)) 76 &numSrc, &filenames, &pyweights, &file_params, 77 &permutation, &verbose)) 77 78 { 78 79 PyErr_SetString(PyExc_RuntimeError, … … 155 156 (double*)file_params->data, 156 157 &number_of_selected_stations, // Desired number of stations 157 ( int*) permutation->data, // Ordering of selected stations158 (long*) permutation->data, // Ordering of selected stations 158 159 verbose); 159 160 … … 207 208 dimensions[0] = number_of_selected_stations; 208 209 dimensions[1] = num_ts + POFFSET; 210 209 211 pydata = (PyArrayObject*)PyArray_FromDims(2, dimensions, PyArray_DOUBLE); 210 212 if(pydata == NULL) … … 264 266 double *params, 265 267 int *number_of_stations, 266 int*permutation,268 long *permutation, 267 269 int verbose) 268 270 { … … 404 406 405 407 // Create the Identity permutation vector 406 permutation = ( int *) malloc(number_of_selected_stations*sizeof(int));408 permutation = (long *) malloc(number_of_selected_stations*sizeof(long)); 407 409 for (i = 0; i < number_of_selected_stations; i++) 408 410 { 409 permutation[i] = i; 410 } 411 } 412 413 411 permutation[i] = (long) i; 412 } 413 } 414 415 /* 416 printf("number_of_selected_stations = %d\n", number_of_selected_stations); 417 for (i = 0; i < number_of_selected_stations; i++) { 418 printf("permutation[%d] = %d\n", i, (int) permutation[i]); 419 } 420 */ 421 422 414 423 415 424 /* Make array(s) to hold demuxed data for stations given in the permutation file */ … … 433 442 } 434 443 435 ista = permutation[i]; // Get global index into mux data444 ista = (int) permutation[i]; // Get global index into mux data 436 445 437 446 sts_data[i][mytgs0[0].nt] = (float)mytgs0[ista].geolat; … … 477 486 { 478 487 479 ista = permutation[i]; // Get global index into mux data488 ista = (int) permutation[i]; // Get global index into mux data 480 489 481 490 /* fill the data0 array from the mux file, and weight it */
Note: See TracChangeset
for help on using the changeset viewer.