-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgsw_z_from_depth.m
42 lines (36 loc) · 1.24 KB
/
gsw_z_from_depth.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 z = gsw_z_from_depth(depth)
% gsw_z_from_depth height, z, from depth
%==========================================================================
%
% USAGE:
% z = gsw_z_from_depth(depth)
%
% DESCRIPTION:
% Calculates height, z, from depth. Note that in general height is
% negative in the ocean.
%
% INPUT:
% depth = depth [ m ]
%
% OUTPUT:
% z = height [ m ]
%
% AUTHOR:
% Winston [ god@teos-10.org ]
%
% 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_z_from_depth: Requires one input')
end %if
%--------------------------------------------------------------------------
% Start of the calculation
%--------------------------------------------------------------------------
z = -depth;
end