-
Notifications
You must be signed in to change notification settings - Fork 0
/
gsw_depth_from_z.m
executable file
·42 lines (36 loc) · 1.28 KB
/
gsw_depth_from_z.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function depth = gsw_depth_from_z(z)
% gsw_depth_from_z depth from height, z
%==========================================================================
%
% USAGE:
% depth = gsw_depth_from_z(z)
%
% DESCRIPTION:
% Calculates depth from height, z. Note that in general height is
% negative in the ocean.
%
% INPUT:
% z = height [ m ]
%
% OUTPUT:
% depth = depth [ m ]
%
% AUTHOR:
% Winston [ [email protected] ]
%
% VERSION NUMBER: 3.05 (27th January 2015)
%
% This software is available from http://www.TEOS-10.org
%
%==========================================================================
%--------------------------------------------------------------------------
% Check variables and resize if necessary
%--------------------------------------------------------------------------
if ~(nargin == 1)
error('gsw_depth_from_z: Requires one input')
end %if
%--------------------------------------------------------------------------
% Start of the calculation
%--------------------------------------------------------------------------
depth = -z;
end