-
Notifications
You must be signed in to change notification settings - Fork 155
xgrid 2dx2d order1 refactor #1796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: horiz_interp_dev
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
likewise, n1 is not needed
grid_utils/grid_utils.c
Outdated
| nx = *nlon; | ||
| ny = *nlat; | ||
| nx = nlon; | ||
| ny = nlat; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nx, ny here too, not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and for all the following functions :)
| return (product<=SMALL) ? 1:0; | ||
|
|
||
| } /* inside_edge */ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra lines
| &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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the semicolon?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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