Skip to content

Commit 250b523

Browse files
mlee03mlee03
authored andcommitted
remvoe if in upbound
1 parent 65d0b4e commit 250b523

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

tools/libfrencutils_acc/create_xgrid_acc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ int get_upbound_nxcells_2dx2d_acc(const int nlon_input_cells, const int nlat_in
9494
if(output_grid_cells->lat_max[ij2] <= input_cell_lat_min) continue;
9595

9696
dlon_cent = output_grid_cells->lon_cent[ij2] - input_cell_lon_cent;
97-
if(dlon_cent < -M_PI) rotate = +TPI;
98-
if(dlon_cent > M_PI) rotate = -TPI;
97+
rotate = - (int)(dlon_cent/M_PI) * TPI;
98+
//if(dlon_cent < -M_PI) rotate = +TPI;
99+
//if(dlon_cent > M_PI) rotate = -TPI;
99100

100101
// adjust according to input_grid_lon_cent
101102
// TODO: breakup grid into quadrants to avoid if statements?

tools/libfrencutils_acc/create_xgrid_utils_acc.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ void create_upbound_nxcells_arrays_on_device_acc(const int n, int **approx_nxcel
5858
void free_upbound_nxcells_arrays_acc( const int n, int **approx_nxcells_per_ij1,
5959
int **ij2_start, int **ij2_end);
6060

61-
void copy_data_to_xgrid_on_device_acc(const int nxcells, const int input_ncells, const int upbound_nxcells,
62-
int *xcells_per_ij1, double *xcell_clon, double *xcell_clat,
63-
int *approx_xcells_per_ij1, int *parent_input_indices, int *parent_output_indices,
64-
double *xcell_areas, Interp_per_input_tile *interp_for_input_tile);
61+
void copy_data_to_interp_on_device_acc(const int nxcells, const int input_ncells, const int upbound_nxcells,
62+
int *xcells_per_ij1, double *xcell_clon, double *xcell_clat,
63+
int *approx_xcells_per_ij1, int *parent_input_indices, int *parent_output_indices,
64+
double *xcell_areas, Interp_per_input_tile *interp_for_input_tile);
6565
#endif

0 commit comments

Comments
 (0)