I am using the latest version of the matlab tools, from SVN revision 722. I create a coarse resolution grid, which I have attached to this post. I then create a high resolution file with coarse2fine.m and then run contacts with the following code:
Code: Select all
cgridname='ocean_grid_SVD.nc' %input
fgridname='ocean_grid_WB.nc' %created
outname='baseTwoGrids_contacts.nc' %created
Imin=3; Imax=36;
Jmin=3; Jmax=453;
fgrid=coarse2fine(cgridname,fgridname,3,Imin,Imax,Jmin,Jmax);
grids={cgridname,fgridname}
[S,G]=contact(grids,outname,false,false,false)
If anyone has got contact.m to work along a grid boundary, I would love to see their changes to the code.
I could deal with this fixing contact.m. But I am loath to do so when Hernan says he is about to release a revised version. Instead I could use a land mask to offset the land/sea boundary from the model boundary. Can anyone think of a better way? Has anyone sealed off an entire boundary of the fine grid with a mask?
Cheers, and thanks,
Jamie
Error if Imin=1 and Jmin=1:
Code: Select all
Error in <a href="matlab:matlab.internal.language.introspective.errorDocCallback('contact>refinement', '/Users/pringle/workfiles/dPdy/runs/make_grids_and_contacts/matlab/grid/contact.m', 1505)" style="font-weight:bold">contact>refinement</a> (<a href="matlab: opentoline('/Users/pringle/workfiles/dPdy/runs/make_grids_and_contacts/matlab/grid/contact.m',1505,0)">line 1505</a>)
Ngrids = length(G); % number of nested grids
Output argument "R" (and maybe others) not assigned during call to
"/Users/pringle/workfiles/dPdy/runs/make_grids_and_contacts/matlab/grid/contact.m>refinement".
Error in contact (line 322)
[P, R] = refinement (cr, dg, rg, Lmask, G, S, MaskInterp);
Error in make_contacts (line 5)
[S,G]=contact(grids,outname,false,false,true)
Code: Select all
Error using sub2ind (line 52)
Out of range subscript.
Error in contact>Hweights (line 2453)
RindexB = sub2ind([Ir, Jr], ...
Error in contact (line 352)
S = Hweights(G, S, ImposeMask);
Error in make_contacts (line 5)
[S,G]=contact(grids,outname,false,false,true)