Commit cbba46e9 authored by Pierre Cazenave's avatar Pierre Cazenave
Browse files

Don't try and use more vertical layers than there are in the data.

parent 26164099
......@@ -150,7 +150,7 @@ if ~isfield(Mobj, 'hc')
end
max_obc_depth = max([max(Mobj.h([Mobj.read_obc_nodes{:}])), max(Mobj.hc([Mobj.read_obc_elems{:}]))]);
[~, zidx] = min(abs(hycom.Depth.data - max_obc_depth));
zidx = zidx + 1;
zidx = min([zidx + 1, length(hycom.Depth.data)]);
if ftbverbose
tic
......
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