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

Contents of /MITgcm_contrib/mlosch/interp_llc/sq.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:21 2007 UTC (18 years, 2 months ago) by mlosch
Branch: MAIN
CVS Tags: HEAD
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 % sq(A) is similar to squeeze(A) except that elements =0 are set to NaN
2 %
3 % sq(A) 0 -> NaN
4 % sq(A,val1) val1 -> NaN
5 % sq(A,val1,val2) val1 -> val2
6
7 function [A] = sq(B,varargin);
8 A=squeeze(B);
9 if nargin>=2
10 nodata=varargin{1};
11 else
12 nodata=0;
13 end
14 if nargin==3
15 newval=varargin{2};
16 else
17 newval=NaN;
18 end
19 %A(find(A==nodata))=A(find(A==nodata))*NaN;
20 A(find(A==nodata))=newval;

  ViewVC Help
Powered by ViewVC 1.1.22