/[MITgcm]/MITgcm/verification/global_ocean.90x40x15/diags_matlab/sq.m
ViewVC logotype

Contents of /MITgcm/verification/global_ocean.90x40x15/diags_matlab/sq.m

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


Revision 1.1.2.1 - (show annotations) (download)
Wed Oct 23 18:26:35 2002 UTC (21 years, 6 months ago) by mlosch
Branch: release1
CVS Tags: release1_p12, release1_p10, release1_p16, release1_p15, release1_p11, release1_p14, release1_p13, release1_p17, release1_p8, release1_p9, release1_p6, release1_p7, release1_p13_pre, release1_p12_pre
Branch point for: release1_50yr
Changes since 1.1: +0 -0 lines
o fixed the verification/global_ocean.90x40x15 experiment:
 - new bathymetry (the world according to A., JMC, and M.)
 - new initial fields and forcing fields (*.bin files)
 - new POLY3.COEFFS (for the next release one should switch to a full
   equation of state)
 - fixed several errors and redundancies in the data file
 - experiment uses looped cells
 - added matlab directory with diagnostic scripts for plotting of output

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