Commit f32fe75f authored by Simon Waldman's avatar Simon Waldman

read_sms_mesh.m : If we have bathymetry in the .2dm file *and* a separate

   bathymetry file is provided, use the bathymetry in the file (with a
   warning) rather than ignoring it.
parent 46a2da14
......@@ -61,6 +61,9 @@ function [Mobj] = read_sms_mesh(varargin)
% 2018-05-16 Rewrote nodestring parsing. It's far less elegant, but now
% it still works if the number of nodes in a string is a multiple of 10.
% (SW)
% 2018-05-16 If we have bathymetry in the .2dm file *and* a separate
% bathymetry file provided, use the bathymetry in the file (with a
% warning) rather than ignoring it.
%
%==============================================================================
......@@ -300,7 +303,10 @@ fclose(fid);
bath_range = max(h) - min(h);
if have_bath
if bath_range == 0
if bath_range ~= 0
warning(['Bathymetry is present in the .2dm file, but a bathymetry .dat file was also provided. '...
'The .dat file will be used, and the depth info in the .2dm will be ignored.']);
end
fid = fopen(sms_bath, 'rt');
if fid < 0
error('file: %s does not exist', sms_bath);
......@@ -331,7 +337,7 @@ if have_bath
clear C2
fclose(fid);
end
elseif bath_range ~= 0
have_bath = true;
end
......
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