Skip to content
Snippets Groups Projects
Commit cb8e5c1e authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

gridSearchPointHealpix: abort if max number of neighbors is exceeded

parent f49542f8
No related branches found
No related tags found
1 merge request!73M214003/develop
......@@ -10,6 +10,7 @@
#include "cdo_math.h"
#include "remap.h"
#include <mpim_grid.h>
#include "cdo_output.h"
static size_t
fill_src_add(bool isCyclic, long nx, long ny, long ii, long jj, long k, size_t *psrc_add)
......@@ -118,6 +119,7 @@ gridSearchPointHealpix(GridPointSearch &gps, double plon, double plat, knnWeight
knnWeights.m_dist[numNeighbors] : distance to each of the closest points
*/
auto numNeighbors = knnWeights.maxNeighbors();
if (numNeighbors > 9) cdo_abort("Max number of neighbors is 9!");
// Initialize distance and address arrays
knnWeights.initAddr();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment