Due to a shift in policy, from 0900 GMT on Wednesday 14th July 2021, we will be disabling ssh access to the server for external users. External users who wish to continue to access code repositories on the server will need to switch to using https. This can be accomplished in the following way: 1) On the repo on gitlab, use the clone dialogue and select ‘Clone with HTTPS’ to get the address of the repo; 2) From within the checkout of your repo run: $ git remote set-url origin HTTPS_ADDRESS. Here, replace HTTPS_ADDRESS with the address you have just copied from GitLab. Pulls and pushes will now require you to enter a username and password rather than using a ssh key. If you would prefer not to enter a password each time, you might consider caching your login credentials.

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