clear all
close all

Depths =       [200 150  100   50];
PolyLengths =  [185 135   85   35];


WaveHeights = [4];
WaveAmps = WaveHeights/2;
WavePers = [10];


CurrentFactors = .1:.2:1.7;
CurrentFactors = .5;

Title{1} = '200m ESP Mooring';
Title{2} = '150m ESP Mooring';
Title{3} = '100m ESP Mooring';
Title{4} = '50m ESP Mooring';
%for dl = -.5:.1:.9       

for i = length(WaveAmps):-1:1

for j = 1:length(CurrentFactors);

for m = 2 %1:length(Depths)

  LAYOUT.title = Title{m};
  
  ENV.depth = Depths(m);
  ENV.tf = 240; 
  %ENV.tf = 0;
  ENV.dt = .1;
  ENV.ramptime = 30;
  ENV.xwaveamp = WaveAmps(i);
  ENV.xwaveperiod = WavePers(i);
  ENV.xwavephase = 0;
  ENV.xwind = 1;
  ENV.dynamiclambda = -.5;

  ENV.currentscale = CurrentFactors(j);
  ENV.xcurrent = NaN(2,2);
  ENV.xcurrent(1,:) = [0 1.0];
 % ENV.xcurrent(2,:) = [ENV.depth 0.0];  %Linear Current Profile 
  ENV.xcurrent(2,:) = [ENV.depth 1.0];  %Slab Current Profile
  %ENV.xcurrent(2,:) = [5 1.0];
  %ENV.xcurrent(3,:) = [10 0.9];
  %ENV.xcurrent(4,:) = [20 0.45];
  %ENV.xcurrent(5,:) = [30 0.3];
  %ENV.xcurrent(6,:) = [ENV.depth 0.05];
  %ENV.xcurrent(6,:) = [ENV.depth-.8 0.05]; % DEPTH Specified here is 0.8 m shallower to account for anchor 

  LAYOUT.em_length = 21;
 
 LAYOUT.poly_nodespace = .5;  %meters per node
  LAYOUT.poly_length = PolyLengths(m);
 
  LAYOUT.shockle_length = 3;
  LAYOUT.shockle_nodespace = 0.5; %meters per node

  filename = RunCable(ENV,LAYOUT);


%  load([filename '.mat']);


end   %End of m-loop (Mooring Depths)

end   %End of j-loop (current factors)

end   %End of i-loop (sea state)

%end  %dynamic lambda loop
