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

Make the sediment functions consistent with the behaviour of the other...

Make the sediment functions consistent with the behaviour of the other functions in the toolbox with respect verbose output.
parent 2c8ae50b
......@@ -27,8 +27,11 @@ function [dstar] = ST_Dstar(d,varargin)
%
%==============================================================================
global ftbverbose
[~, subname] = fileparts(mfilename('fullpath'));
fprintf('\nbegin : %s\n', subname)
if ftbverbose
fprintf('\nbegin : %s\n', subname)
end
% constants
grav = 9.8106; %g
......@@ -71,4 +74,6 @@ else
dstar = ([grav*(s-1)./(nu.^2)]).^(1/3).*d;
end
fprintf('end : %s\n', subname)
if ftbverbose
fprintf('end : %s\n', subname)
end
......@@ -34,9 +34,11 @@ function [erate] = ST_erate(d,varargin)
%
%==============================================================================
subname = 'ST_erate';
%fprintf('\n')
%fprintf(['begin : ' subname '\n'])
global ftbverbose
[~, subname] = fileparts(mfilename('fullpath'));
if ftbverbose
fprintf('\nbegin : %s\n', subname)
end
% constants
grav = 9.8106; %g
......@@ -70,6 +72,6 @@ wset = ST_wset(d,'temperature',T,'salinity',S,'sdens',sdens);
% calculate erosion rate
erate = 2.666e-4*wset*1000. - 2.51e-9*sdens;
%fprintf(['end : ' subname '\n'])
if ftbverbose
fprintf('end : %s\n', subname)
end
\ No newline at end of file
......@@ -22,9 +22,11 @@ function [d] = ST_phi2d(phi)
%
%==============================================================================
%subname = 'ST_phid2';
%fprintf('\n')
%fprintf(['begin : ' subname '\n'])
global ftbverbose
[~, subname] = fileparts(mfilename('fullpath'));
if ftbverbose
fprintf('\nbegin : %s\n', subname)
end
%------------------------------------------------------------------------------
% calculate d and convert to m
......@@ -33,4 +35,6 @@ function [d] = ST_phi2d(phi)
d = 2^(-phi);
d = d*.001;
%fprintf(['end : ' subname '\n'])
if ftbverbose
fprintf('end : %s\n', subname)
end
\ No newline at end of file
......@@ -29,8 +29,11 @@ function [taucr] = ST_taucr(d,varargin)
% 2017-03-27 Add support for matrices.
%==============================================================================
global ftbverbose
[~, subname] = fileparts(mfilename('fullpath'));
fprintf('\nbegin : %s\n', subname)
if ftbverbose
fprintf('\nbegin : %s\n', subname)
end
% constants
grav = 9.8106; %g
......@@ -74,4 +77,6 @@ else
taucr = theta_cr*grav*(sdens-dens)*d;
end
fprintf('end : %s\n', subname)
if ftbverbose
fprintf('end : %s\n', subname)
end
......@@ -22,6 +22,12 @@ function [Sclass] = wentworth(phi)
%
%==============================================================================
global ftbverbose
[~, subname] = fileparts(mfilename('fullpath'));
if ftbverbose
fprintf('\nbegin : %s\n', subname)
end
ClassNames = {'boulder','cobble','pebble','granule','very coarse sand', ...
'coarse sand','medium sand','fine sand','very fine sand','coarse silt', ...
'medium silt','fine silt','very fine silt','coarse clay','medium clay','fine clay'};
......@@ -30,3 +36,7 @@ pts = find(phi-ClassLbound > 0);
ClassIndex = pts(end);
Sclass = char(ClassNames{ClassIndex});
%fprintf('class of phi = %f is: %s\n',phi,class);
if ftbverbose
fprintf('end : %s\n', subname)
end
\ No newline at end of file
......@@ -28,9 +28,11 @@ function [wset] = ST_wset(d,varargin)
%
%==============================================================================
subname = 'ST_wset';
%fprintf('\n')
%fprintf(['begin : ' subname '\n'])
global ftbverbose
[~, subname] = fileparts(mfilename('fullpath'));
if ftbverbose
fprintf('\nbegin : %s\n', subname)
end
% constants
grav = 9.8106; %g
......@@ -72,5 +74,6 @@ dstar = ST_Dstar(d,'temp',T,'sal',S,'sdens',sdens);
% calculate wset
wset = (nu/d)*( sqrt(10.36^2 + 1.049*(dstar^3)) - 10.36);
%fprintf(['end : ' subname '\n'])
if ftbverbose
fprintf('end : %s\n', subname)
end
\ No newline at end of file
......@@ -38,6 +38,12 @@ function rho = SW_Density(T,S)
% range checking.
%=========================================================================
global ftbverbose
[~, subname] = fileparts(mfilename('fullpath'));
if ftbverbose
fprintf('\nbegin : %s\n', subname)
end
%----------------------
% CHECK INPUT ARGUMENTS
%----------------------
......@@ -75,5 +81,8 @@ for i = 1:vectorsize(1,1)
D_rho(i,j) = b1*s(i,j) + b2*s(i,j)*T(i,j) + b3*s(i,j)*T(i,j)^2 + b4*s(i,j)*T(i,j)^3 + b5*s(i,j)^2*T(i,j)^2;
rho(i,j) = rho_w(i,j) + D_rho(i,j);
end
end;
end
if ftbverbose
fprintf('end : %s\n', subname)
end
\ No newline at end of file
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