/[MITgcm]/MITgcm_contrib/gmaze_pv/intbet2outcrops.m
ViewVC logotype

Diff of /MITgcm_contrib/gmaze_pv/intbet2outcrops.m

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

revision 1.1 by gmaze, Thu Jun 15 22:15:55 2006 UTC revision 1.2 by gmaze, Fri Jun 16 21:09:16 2006 UTC
# Line 24  function varargout = intbet2outcrops(TRA Line 24  function varargout = intbet2outcrops(TRA
24  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25  % PRE-PROCESS and ERROR CHECK %  % PRE-PROCESS and ERROR CHECK %
26  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27    pv_checkpath
28    
29  % Check number of input:  % Check number of input:
30  if nargin ~= 4  if nargin ~= 4
# Line 85  LONG_MAX = sort( LIMITS(5:6) ); Line 86  LONG_MAX = sort( LIMITS(5:6) );
86  [I2 I2mat dI2] = subfct_getsurf(TRACER,LAT,LONG,[OUTCROPS(2) LAT_MAX LONG_MAX]);  [I2 I2mat dI2] = subfct_getsurf(TRACER,LAT,LONG,[OUTCROPS(2) LAT_MAX LONG_MAX]);
87    
88  % Then we determine the outcrop surface limits:  % Then we determine the outcrop surface limits:
89  I1mat(find(I1mat==0))=NaN;  I1mat = abs(I1mat - 1);
90  I2mat(find(I2mat==0))=NaN;  Imat  = (I1mat + I2mat)./2;
91  I1mat(find(I1mat==1))=0;  Imat(find(Imat<1)) = 0;
 I2mat(find(I2mat==1))=0;  
 Imat = I1mat + I2mat;  
 Imat(find(Imat==0))=1;  
 Imat(isnan(Imat))=0;  
92  Imat = logical(Imat);  Imat = logical(Imat);
93    
94  % And the integral of the TRACER on it:  % And the integral of the TRACER on it:
# Line 104  I = sum(TRACER(Imat).*dI1(Imat)); Line 101  I = sum(TRACER(Imat).*dI1(Imat));
101  % OUTPUTS %  % OUTPUTS %
102  %%%%%%%%%%%  %%%%%%%%%%%
103  switch nargout  switch nargout
104   case 1   case {0,1}
105    varargout(1) = {I};    varargout(1) = {I};
106   case 2   case 2
107    varargout(1) = {I};    varargout(1) = {I};

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.22