Home > omviz > fiddlegrid.m

fiddlegrid

PURPOSE ^

script for fiddling model_grid

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 script for fiddling model_grid

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % script for fiddling model_grid
0002 
0003 oldgrid='model_grid';
0004 newgrid='new_model_grid';
0005 
0006 % 1. Read old grid
0007 [d,x,y,i,j,xx,yy,h,data,str]=readgrid(oldgrid);
0008 
0009 % 2. Fiddle it
0010 
0011 
0012 ind=find(h~=-99999.);
0013 h(ind)=max(h(ind),.8);  % make minimum depth 0.8 meters
0014 data(ind,5)=h(ind);
0015 
0016 % 3. Write new grid
0017 
0018 fid=fopen(newgrid,'w');
0019    for i=1:length(str);
0020      fprintf(fid,'%s\n',str{i});
0021    end
0022    fprintf(fid,'%4d%4d%10.2f%10.2f%10.2f%7.1f%7.1f%5.2f %15.6f %15.6f\n',data');
0023 fclose(fid);

Generated on Thu 01-Dec-2005 08:50:35 by m2html © 2003