Bug #566

Bug of KM2DEG in grdmath for GMT4

Added by Dongdong about 3 years ago. Updated about 3 years ago.

Status:ClosedStart date:2014-05-25
Priority:NormalDue date:
Assignee:Paul% Done:

100%

Category:-
Target version:Candidate for next bugfix release
Affected version:4.x-svn Platform:

Description

Calculate great circle distance between grid nodes and (0,0):

$ grdmath -Rg -I1 0 0 SDIST KM2DEG = dist.nc
$ grdinfo dist.nc 
dist.nc: Title: dist.nc
dist.nc: Command: grdmath -Rg -I1 0 0 SDIST KM2DEG = dist.nc
dist.nc: Remark: 
dist.nc: Gridline node registration used
dist.nc: Grid file format: nf (# 18) GMT netCDF format (float)  (COARDS-compliant) [DEFAULT] 
dist.nc: x_min: 0 x_max: 360 x_inc: 1 name: longitude [degrees_east] nx: 361
dist.nc: y_min: -90 y_max: 90 y_inc: 1 name: latitude [degrees_north] ny: 181
dist.nc: z_min: 0 z_max: 2225582.25 name: z
dist.nc: scale_factor: 1 add_offset: 0

In Line 1938 of grdmath.c:

for (i = 0; i < info->nm; i++) stack[last][i] = (float)((constant[last]) ? a : (stack[last][i] * project_info.DIST_KM_PR_DEG));

should be corrected to
for (i = 0; i < info->nm; i++) stack[last][i] = (float)((constant[last]) ? a : (stack[last][i] * f));

History

#1 Updated by Paul about 3 years ago

  • Status changed from New to Resolved
  • Assignee set to Paul
  • Target version set to Candidate for next bugfix release
  • % Done changed from 0 to 100

Thanks, and fixed in r10232.

#2 Updated by Paul about 3 years ago

  • Status changed from Resolved to Closed

Closing this issue.

Also available in: Atom PDF