% SBEACH toolbox - fsbeach_getstdsettings % Written by Joshua Simmons 11/2017 % returns all the SBEACH default values % Syntax: % OPT = fsbeach_getstdsettings() % Input: % bathy = bathy data structure - output by fsbeach_genbathy % waves = wave data structure - output by fsbeach_genwaves % tides = tide data structure - output by fsbeach_gentides % % Output: % OPT = settings function OPT = fsbeach_getstdsettings(bathy, waves, tide, OPT) % preliminary work diffx = diff(bathy.x); dx = diffx(1); wavestt = (waves.time(end)-waves.time(1))*24*60; dwt = round((waves.time(2)-waves.time(1))*24*60); if isstruct(tide) tidett = (tide.time(end)-tide.time(1))*24*60; %total time dtt = round((tide.time(2)-tide.time(1))*24*60); %time steps end % Section A OPT.DXC = dx; OPT.NDX = length(bathy.x); %number of cells if isnan(OPT.XSTART) OPT.XSTART = bathy.x(1); %landward calculation boundary else warning('XSTART is %d m from first profile point',OPT.XSTART - bathy.x(1)) end OPT.NDT = round(wavestt/OPT.DT); % Section B OPT.DTWAV = dwt; OPT.DTANG = dwt; if isnan(OPT.DMEAS) OPT.DMEAS = -min(bathy.z); %assume it is input at the boundary if not specified end if isstruct(tide) OPT.DTELV = dtt; end % Section F - check for hard bottom if ~isnan(bathy.hbz) OPT.IHBOT = 1; end end