Commit fcc7af99 authored by Uwe Schulzweida's avatar Uwe Schulzweida

print_lonlat: check lons/lats for NaNs.

parent 5ef70d05
Pipeline #5660 passed with stages
in 14 minutes and 43 seconds
......@@ -728,6 +728,14 @@ verify_grid(size_t gridsize, size_t nx, int ncorner,
static void
print_lonlat(int dig, int gridID, size_t gridsize, const Varray<double> &lon, const Varray<double> &lat)
{
size_t num_lons_nan = 0;
for (size_t i = 0; i < gridsize; ++i) if (std::isnan(lon[i])) num_lons_nan++;
if (num_lons_nan) cdoPrint(Red("%9zu longitudes are NaN"), num_lons_nan);
size_t num_lats_nan = 0;
for (size_t i = 0; i < gridsize; ++i) if (std::isnan(lat[i])) num_lats_nan++;
if (num_lats_nan) cdoPrint(Red("%9zu latitudes are NaN"), num_lats_nan);
char name[CDI_MAX_NAME];
int length = CDI_MAX_NAME;
cdiInqKeyString(gridID, CDI_XAXIS, CDI_KEY_NAME, name, &length);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment