Commit bab6a91b authored by Simon Waldman's avatar Simon Waldman

turbine_area_sigma.m : Replaced subplot functionality that was accidentally removed during rebase.

parent deb4123e
......@@ -2,17 +2,22 @@
%
% Example Usage:
%
% sigma_frac = turbine_area_sigma(H, Ht, r, sigLay, plot_fig)
% sigma_frac = turbine_area_sigma(H, Ht, r, sigLay, plot_fig, subplot_info)
%
% Input Parameters: H - mean sea level (m)
% Ht - height of turbine hub above seabed (m)
% r - turbine rotor radius (m)
% sigLay - number of sigma layers (not levels) in the model
% plot_fig - flag to plot a figure (optional)
% plot_fig - optional; flag to plot a figure
% subplot_info - optional; if present should be an
% array containing the three parameters to subplot
% that should be used to put the figure into a
% subplot.
%
% Rory O'Hara Murray, 19-Nov-2014
% Simon Waldman, 2016.
%
function sigma_frac = turbine_area_sigma(H, Ht, r, sigLay, plot_fig)
function sigma_frac = turbine_area_sigma(H, Ht, r, sigLay, plot_fig, subplot_info)
assert(nargin >= 4, 'Not enough arguments.');
assert(isnumeric(sigLay) && sigLay - fix(sigLay) < eps, 'sigLay (4th parameter) must be an integer number of sigma layers.');
......@@ -20,6 +25,11 @@ assert(isnumeric(sigLay) && sigLay - fix(sigLay) < eps, 'sigLay (4th parameter)
if nargin<5
plot_fig = false;
end
if nargin<6
splot = false;
else
splot = true;
end
% Turbine and sigma layer parameters
elev = 0; % water elevation above/below MSL - change this to see how the sigma layer occupation fraction changes with the tide
......@@ -38,7 +48,11 @@ hub_sigma = sum(drsl>=0);
%% draw sigma levels / layers
if plot_fig
figure
if splot
subplot( subplot_info(1), subplot_info(2), subplot_info(3) )
else
figure
end
plot([-r r], zLev*[1 1])
xlabel('Distance (m)')
ylabel('Depth (m)')
......
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