Commit d4185d2c authored by Pierre Cazenave's avatar Pierre Cazenave

Change the returned variables to separate sigma level and sigma layer depths

parent 0c9ad637
...@@ -11,8 +11,9 @@ function Mobj = read_sigma(Mobj, sigmafile) ...@@ -11,8 +11,9 @@ function Mobj = read_sigma(Mobj, sigmafile)
% sigmafile : Full path to an FVCOM sigma.dat file. % sigmafile : Full path to an FVCOM sigma.dat file.
% %
% OUTPUT: % OUTPUT:
% Mobj: Mesh object with a new field (sigmaz) which contains the % Mobj: Mesh object with two new fields (siglayz and siglevz) which
% depths of the sigma layers at each grid node. % contain depths of the sigma layers and levels at each grid
% node.
% %
% EXAMPLE USAGE: % EXAMPLE USAGE:
% read_sigma(Mobj, 'sigma.dat') % read_sigma(Mobj, 'sigma.dat')
...@@ -98,7 +99,11 @@ switch lower(sigtype) ...@@ -98,7 +99,11 @@ switch lower(sigtype)
error('Can''t do that sigtype') error('Can''t do that sigtype')
end end
Mobj.sigmaz = repmat(Mobj.h, 1, nlev) .* repmat(z, Mobj.nVerts, 1); % Create a siglay variable (i.e. midpoint in the sigma levels).
zlay = z(1:end-1) + (diff(z)/2);
Mobj.siglevz = repmat(Mobj.h, 1, nlev) .* repmat(z, Mobj.nVerts, 1);
Mobj.siglayz = repmat(Mobj.h, 1, nlev-1) .* repmat(zlay, Mobj.nVerts, 1);
if ftbverbose; if ftbverbose;
fprintf(['end : ' subname '\n']) fprintf(['end : ' subname '\n'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment