/[MITgcm]/MITgcm_contrib/mlosch/interp_llc/findocean_fast.m
ViewVC logotype

Contents of /MITgcm_contrib/mlosch/interp_llc/findocean_fast.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Thu May 3 21:07:20 2007 UTC (18 years, 2 months ago) by mlosch
Branch: MAIN
CVS Tags: HEAD
Error occurred while calculating annotation data.
initial checkin of topography and hydrography interpolation scripts for
the llc-grid, based on old matlab scripts by Alistair Adcroft
Let's hope, they are useful.

1 function [msk] = findocean_fast( oldmsk );
2
3 msk=oldmsk;
4
5 [nx ny nt nk]=size(msk);
6 xp=[2:nx 1];
7 xm=[nx 1:nx-1];
8 yp=[2:ny 1];
9 ym=[ny 1:ny-1];
10
11 C=msk.*(msk+msk(xp,:,:,:)+msk(xm,:,:,:)+msk(:,ym,:,:)+msk(:,yp,:,:));
12 jj=find(C==1 | C==2 );
13 while size(jj)
14 msk( jj )=0;
15 C=msk.*(msk+msk(xp,:,:,:)+msk(xm,:,:,:)+msk(:,ym,:,:)+msk(:,yp,:,:));
16 jj=find(C==1 | C==2);
17 end

  ViewVC Help
Powered by ViewVC 1.1.22