diff --git a/docs/Users_Guide/reformat_point.rst b/docs/Users_Guide/reformat_point.rst index ae9691745..fefe71eef 100644 --- a/docs/Users_Guide/reformat_point.rst +++ b/docs/Users_Guide/reformat_point.rst @@ -1096,7 +1096,7 @@ Only 4 interpolation methods are applied to the field variables; MIN/MAX/MEDIAN/ For the GOES-16 and GOES-17 data, the computing lat/long is time consuming. The computed coordinate (lat/long) is saved to a temporary NetCDF file, as described in :numref:`Contributor's Guide Section %s `. The computing lat/long step can be skipped if the coordinate file is given through the environment variable MET_GEOSTATIONARY_DATA. The grid mapping to the target grid is saved to MET_TMP_DIR to save the execution time. Once this file is created, the MET_GEOSTATIONARY_DATA is ignored. The grid mapping file should be deleted manually in order to apply a new MET_GEOSTATIONARY_DATA environment variable or to re-generate the grid mapping file. An example of call point2grid to process GOES-16 AOD data is shown below: -The grid name or the grid definition can be given with the -field option when the grid information is missing from the input NetCDF file for the latitude_longitude projection. The latitude and longitude variable names should be defined by the user, and the grid information from the set_attr_grid is ignored in this case +The grid name or the grid definition can be given with the -field option when the grid information is missing from the input NetCDF file for the latitude_longitude projection. The latitude and longitude variable names should be defined by the user, and the grid information from the set_attr_grid is ignored in this case except nx and ny. .. code-block:: none diff --git a/internal/test_unit/xml/unit_point2grid.xml b/internal/test_unit/xml/unit_point2grid.xml index 1b538d42a..ac9468370 100644 --- a/internal/test_unit/xml/unit_point2grid.xml +++ b/internal/test_unit/xml/unit_point2grid.xml @@ -364,7 +364,7 @@ G231 \ &OUTPUT_DIR;/point2grid/point2grid_cice_to_G231.nc \ -config &CONFIG_DIR;/Point2GridConfig_tlat_tlon \ - -field 'name="hi_d"; level="(0,*,*)"; set_attr_grid="latlon 180 360 -80 -180 1 1";' \ + -field 'name="hi_d"; level="(0,*,*)"; set_attr_grid="latlon 1440 1080 -80 -180 0.1 0.1";' \ -v 1 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 a739c5ae0..e98587016 100644 --- a/src/libcode/vx_data2d_nc_cf/nc_cf_file.cc +++ b/src/libcode/vx_data2d_nc_cf/nc_cf_file.cc @@ -1079,6 +1079,18 @@ bool NcCfFile::getData(NcVar * v, const LongArray & a, DataPlane & plane) const const int nx = grid.nx(); const int ny = grid.ny(); + 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, (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 (nx and ny) if applied.\n\n"; + exit(1); + } + plane.clear(); plane.set_size(nx, ny);