From 06e9da6b12a7c0b9aa874ca674ceae61a62ebfd6 Mon Sep 17 00:00:00 2001 From: Howard Soh Date: Mon, 9 Sep 2024 22:09:53 +0000 Subject: [PATCH] #2968 Compare the DataPlane size and the variable data size --- src/libcode/vx_data2d_nc_cf/nc_cf_file.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libcode/vx_data2d_nc_cf/nc_cf_file.cc b/src/libcode/vx_data2d_nc_cf/nc_cf_file.cc index b66c2b0aec..e985870169 100644 --- a/src/libcode/vx_data2d_nc_cf/nc_cf_file.cc +++ b/src/libcode/vx_data2d_nc_cf/nc_cf_file.cc @@ -1079,15 +1079,15 @@ bool NcCfFile::getData(NcVar * v, const LongArray & a, DataPlane & plane) const const int nx = grid.nx(); const int ny = grid.ny(); - int data_size = 1; + size_t data_size = 1; for (int k=0; kgetDim(k).getSize(); } if (data_size == 1) data_size = v->getDim(x_slot).getSize() * v->getDim(y_slot).getSize(); - if (!is_eq(data_size, nx*ny)) { + if (!is_eq(data_size, (size_t)nx*ny)) { mlog << Error << "\n" << method_name << "Allocated DataPlane from Grid (" << nx*ny << ") does not match with the variable size (" - << data_size << "). Please check set_attr_grid settings if applied.\n\n"; + << data_size << "). Please check set_attr_grid settings (nx and ny) if applied.\n\n"; exit(1); }