II = ones(floor(length(coast(:,1))/2),1)*nan;
JJ = ones(floor(length(coast(:,1))/2),1)*nan;
k=0;
for i=1:2:length(coast(:,1))
    [tmp1,tmp2] = near2d(RLON,RLAT,squeeze(coast(i,1)),squeeze(coast(i,2)));
    if(isfinite(tmp1));
        k=k+1;
        II(k) = tmp1;
        JJ(k) = tmp2;
    end
end
