Grdcontour gets hung

I’m encountering a grdcontour issue that causes the grdcontour command to get hung.

I’ve isolated a 1x1° portion from a larger grid that causes my installation to run out of memory when attempting to make a very simple contour map.

Is there something amiss in the .grd file that causes grdcontour to hang? I’ve made a grd2xyz dump and can’t spot a specific questionable value in the grid that could be the cause.

Here is a short test script, and I’ll attach the .grd file.

Thanks for your help.

gmt psbasemap -JL-129.5/35.5/35.9/35.1/5.15453i -R-130/-129/35/36 -Bxag -Byag -Bwesn -K > t.ps
gmt grdcontour tt.grd -J -R -C100 -A500+f4p -Wa0.375p -Wc0.1775p -Gd1.5i -O -fg >> t.ps

tt.grd.zip (23.1 KB)

Using the -Vd option in grdcontour seems to reveal that there are problems when tracing the zero contour. Would this be the problem?

grdcontour [INFORMATION]: Tracing the 0 contour
grdcontour [INFORMATION]: Your -Gd|D option produced no contour labels for z = 0

Can you please open an issue with this? It looks like a bug in the algorithm.

I’ll open an issue. I think you’re right, Joaquim. It seems that there are values very close to zero, but not exact, that are causing the problem. When I re-set those values to be exactly zero, it runs fine.