load sst.mat
[x,y]=ll2xy(ixc(1).lat,ixc(1).lon,29,-82);
nx=length(x);
ny=length(y);
X=ones(ny,1)*[x(:)'];
Y=y(:)*ones(1,nx);
xx=X(:);
yy=Y(:);
in=0;

fp=fopen('sst.mir3d','w');
for k=1:30
    t=ixc(k).date_number-datenum(2002,1,1);
    in=in+1;
    S=ixc(k).sst;
    s=S(:);
    j=find(~isnan(s));
    for l=1:length(j)
        fprintf(fp,'%f %f %f %f %f %f %i\n',[t, xx(j(l))+randn*100, yy(j(l))+randn*100, -1, s(j(l)),1.0,in]);
    end
end
fclose(fp);
     