xgrid 2dx2d order1 refactor#1796
Conversation
|
is this the same one as in fmsgridtools repo? |
grid_utils/grid_utils.c
Outdated
| return the grid area. | ||
| *******************************************************************************/ | ||
| void get_grid_area_(const int *nlon, const int *nlat, const double *lon, const double *lat, double *area) | ||
| void get_grid_area_(const int nlon, const int nlat, const double *lon, const double *lat, double *area) |
There was a problem hiding this comment.
does the pass in by value work when fortran calls function_?
grid_utils/grid_utils.c
Outdated
|
|
||
| nx = *nlon; | ||
| ny = *nlat; | ||
| nx = nlon; |
There was a problem hiding this comment.
it's going to be a pain to fix, but nx and ny are not needed anymore
grid_utils/grid_utils.c
Outdated
| double *x=NULL, *y=NULL, *z=NULL; | ||
|
|
||
| nl = *npts; | ||
| nl = npts; |
grid_utils/grid_utils.c
Outdated
| nx = *nlon; | ||
| ny = *nlat; | ||
| nx = nlon; | ||
| ny = nlat; |
There was a problem hiding this comment.
nx, ny here too, not needed
There was a problem hiding this comment.
and for all the following functions :)
| return (product<=SMALL) ? 1:0; | ||
|
|
||
| } /* inside_edge */ | ||
|
|
| &istart2, &iend2, &pstart, &pnxgrid, nx_output_cells, ny_output_cells); | ||
|
|
||
| // allocate the rest of the arrays used | ||
| lon_out_min_list = (double *)malloc(nx_output_cells*ny_output_cells*sizeof(double)); |
There was a problem hiding this comment.
would it be a pain to put this malloc section into compute_output_cell_ bounds?
| int nx_input_cells, int ny_input_cells, int nx_input_points, | ||
| const double *input_grid_lon, const double *input_grid_lat, | ||
| const double *skip_input_cells, | ||
| int nx_output_cells, |
There was a problem hiding this comment.
put int nx_output_cells with the rest of the ints in the front?
| return nxgrid; | ||
|
|
||
| }/* get_xgrid_2Dx2D_order1 */ | ||
| };/* get_xgrid_2Dx2D_order1 */ |
There was a problem hiding this comment.
i think C functions definitions don't need the semicolon at the end, just when your declaring them in a header file.
| for(m=0; m<nblocks; m++) { | ||
| for(i=0; i<pnxgrid[m]; i++) { | ||
| nn = pstart[m] + i; | ||
| for(curr_thread=0; curr_thread<nthreads; curr_thread++) { |
There was a problem hiding this comment.
for consistency, is there a way to remove the if statement and replace it with a #if defined(_OPENMP)?
| } | ||
|
|
||
| /* compute per-output-cell min/max/avg and store vertex lists */ | ||
| void compute_output_cell_bounds(const int nx_output_cells, const int ny_output_cells, |
There was a problem hiding this comment.
the block_setup and comput_output_cell_bounds will also replace sections of create_xgrid_2dx2d_order2?
Description
create_xgrid_2dx2d_order1into smaller functions (to be eventually reused in the other variants)How Has This Been Tested?
gcc 14 on amd
Checklist:
make distcheckpasses