% Testing zgriduh.

xv = 29.1:0.1:40.5;  % e.g. 30-40 N by 10ths
yv = 0:50:6000;  % e.g. depths in 50-m intervals
zb = zeros(length(yv), length(xv));
zb(1:10,1:15) = NaN;  % Find out what gets blanked!

xsta = 29:0.6:41;
dsta = 0:20:6000;
nd = length(dsta);
nx = length(xsta);
XX = xsta(ones(nd,1),:);
DD = dsta(ones(nx,1),:).';

SS = 34 + (DD/6000).*sin(XX);

xp = XX(:);
yp = DD(:);
zp = SS(:);

DEL = 0.1;
CAY = 4;
NRNG = 3;
IDBUG = 0;


zg = zgriduh(xv,yv,zb,xp,yp,zp,DEL,CAY,NRNG,IDBUG);

[cc1, hc1] = contourf6(xv,yv,zg, [32.1:0.1:35]);
set(gca, 'YDir', 'reverse', 'XLim', [30 40]);


