1 |
% |
% |
2 |
% V = volbet2iso(TRACER,LIMITS,DEPTH,LAT,LONG) |
% V = volbet2iso(TRACER,LIMITS,DEPTH,LAT,LONG) |
3 |
% |
% |
4 |
% This function computes the ocean volume between two 2 iso surfaces, |
% This function computes the ocean volume between two iso surfaces, |
5 |
% given fixed limits eastward, westward and southward. |
% given fixed limits eastward, westward and southward. |
6 |
% |
% |
7 |
% TRACER = TRACER(DEPTH,LAT,LONG) : surface tracer variable in 3D |
% TRACER = TRACER(DEPTH,LAT,LONG) : surface tracer variable in 3D |
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 ~= 5 |
if nargin ~= 5 |
100 |
V = max(V1,V2)-min(V1,V2); |
V = max(V1,V2)-min(V1,V2); |
101 |
|
|
102 |
|
|
103 |
|
% Last we determine the iso-0 volume limits: |
104 |
|
V1mat = abs(V1mat - 1); |
105 |
|
Vmat = (V1mat + V2mat)./2; |
106 |
|
Vmat(find(Vmat<1)) = 0; |
107 |
|
Vmat = logical(Vmat); |
108 |
|
|
109 |
|
|
110 |
|
|
111 |
%%%%%%%%%%% |
%%%%%%%%%%% |
112 |
% OUTPUTS % |
% OUTPUTS % |
113 |
%%%%%%%%%%% |
%%%%%%%%%%% |
114 |
switch nargout |
switch nargout |
115 |
case 1 |
case {0,1} |
116 |
varargout(1) = {V}; |
varargout(1) = {V}; |
117 |
case 2 |
case 2 |
118 |
varargout(1) = {V}; |
varargout(1) = {V}; |
119 |
varargout(2) = {V1mat}; |
varargout(2) = {Vmat}; |
120 |
case 3 |
case 3 |
121 |
varargout(1) = {V}; |
varargout(1) = {V}; |
122 |
varargout(2) = {V1mat}; |
varargout(2) = {Vmat}; |
123 |
varargout(3) = {dV1}; |
varargout(3) = {dV1}; |
124 |
end %switch nargout |
end %switch nargout |
125 |
|
|