1 |
% |
% |
2 |
% S = surfbet2outcrops(TRACER,LIMITS,LAT,LONG) |
% S = surfbet2outcrops(TRACER,LIMITS,LAT,LONG) |
3 |
% |
% |
4 |
% This function computes the horizontal surface between two 2 outcrops, |
% This function computes the horizontal surface between two outcrops, |
5 |
% given fixed limits eastward, westward and southward. |
% given fixed limits eastward, westward and southward. |
6 |
% |
% |
7 |
% TRACER = TRACER(LAT,LONG) : surface tracer variable in 2D |
% TRACER = TRACER(LAT,LONG) : surface tracer variable in 2D |
23 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
24 |
% PRE-PROCESS and ERROR CHECK % |
% PRE-PROCESS and ERROR CHECK % |
25 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
26 |
|
pv_checkpath |
27 |
|
|
28 |
% Check number of input: |
% Check number of input: |
29 |
if nargin ~= 4 |
if nargin ~= 4 |
90 |
S = max(S1,S2)-min(S1,S2); |
S = max(S1,S2)-min(S1,S2); |
91 |
|
|
92 |
|
|
93 |
|
% Last we determine the outcrop surface limits: |
94 |
|
S1mat = abs(S1mat - 1); |
95 |
|
Smat = (S1mat + S2mat)./2; |
96 |
|
Smat(find(Smat<1)) = 0; |
97 |
|
Smat = logical(Smat); |
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
%%%%%%%%%%% |
%%%%%%%%%%% |
103 |
% OUTPUTS % |
% OUTPUTS % |
104 |
%%%%%%%%%%% |
%%%%%%%%%%% |
105 |
switch nargout |
switch nargout |
106 |
case 1 |
case {0 , 1} |
107 |
varargout(1) = {S}; |
varargout(1) = {S}; |
108 |
case 2 |
case 2 |
109 |
varargout(1) = {S}; |
varargout(1) = {S}; |
110 |
varargout(2) = {S1mat}; |
varargout(2) = {Smat}; |
111 |
case 3 |
case 3 |
112 |
varargout(1) = {S}; |
varargout(1) = {S}; |
113 |
varargout(2) = {S1mat}; |
varargout(2) = {Smat}; |
114 |
varargout(3) = {dS1}; |
varargout(3) = {dS1}; |
115 |
end %switch nargout |
end %switch nargout |
116 |
|
|