function [ meshele]=gridmake(meshnodold)
%  [ meshele]=gridmake(meshnodold)
% Given a meshnod type array this will build meshele array

%  Make a big circle surrounding the data
R = 1*max( max(meshnodold(:,2))-min(meshnodold(:,2)), ...
           max(meshnodold(:,3))-min(meshnodold(:,3)) );
xo = mean(meshnodold(:,2)); yo = mean(meshnodold(:,2));
theta =0:(2*pi/20):(2*pi);
 noderingx = R*cos(theta)+xo;
noderingy = R*sin(theta)+yo;
[nring,m]=size(noderingx');
 ringnod = [ ones(nring,1) noderingx' noderingy' ];
meshnod= [ meshnodold; ringnod];

plot(meshnodold(:,2),meshnodold(:,3))
L = axis;
bathy = meshnod(:,1:2);
disp('Add extra points to prevent triangles outside convex boundaries')
[meshnodextra,bathyextra]=putnodes(L,meshnod,bathy);

meshnodextra(:,1) = [1:length(meshnodextra)]';
[meshele] = makeeles(meshnodextra);


n = length(meshnodold);
l = find(meshele(:,2)<=n & meshele(:,3)<=n ...
                                    & meshele(:,4)<=n );
meshele =meshele(l,:);
