Bug #686

Setting grid node count via -In+ fails

Added by Florian about 2 years ago. Updated about 2 years ago.

Status:ClosedStart date:2015-03-17
Priority:NormalDue date:
Assignee:Paul% Done:


Target version:Candidate for next minor release
Affected version:5.x-svn Platform:


Setting the number of nodes by appending + to the argument of -I does not work as expected:

gmt grdmath -r -Rg -I20+/10+ 0 = test.nc

gmt grdinfo test.nc
test.nc: x_min: 0 x_max: 360 x_inc: 20 name: longitude [degrees_east] nx: 18
test.nc: y_min: -90 y_max: 90 y_inc: 10 name: latitude [degrees_north] ny: 18

Large grid count numbers may even crash grdmath:

gmt grdmath -r -Rg -I720+/180+ 0 = test.nc
grdmath (GMTAPI_Export_Grid): NetCDF: NC_UNLIMITED in the wrong index [test.nc]
[Session gmt (0)]: Error returned from GMT API: GMT_GRID_WRITE_ERROR (19)

gmt grdmath -r -Rg -I1440+/180+ 0 = test.nc
ERROR: Caught signal number 11 (Segmentation fault)


#1 Updated by Paul about 2 years ago

  • Status changed from New to Resolved
  • Assignee set to Paul

Internal confusion in grdmath: While -I sets number of nodes and this is then correctly interpreted to create a temporary grid template, we then use that template (and its correct incs) to create additional grids, but the number-of-node flag is still set. Resetting the flag in grdmath fixes this problem. In r14179.

#2 Updated by Florian about 2 years ago

  • Status changed from Resolved to Closed

In r14179.


Also available in: Atom PDF