Sensitivities of crenulate bay shorelines to wave climates

This notebook is a companion to your practical and is based on the COVE one-line model.

COVE is a vector-based one-line model that we will use in the practical to explore how the wave direction \(\theta_o\) and spreading \(\theta_{std}\) is influencing shorelines evolution in embayment beaches like the ones around Sydney.

See also

Part of the practical will require you to read through the paper from Hurst et al. (2015) available here.

Running COVE

The COVE model needs first to be installed on your system (own computer/remote sever). To do so you will have to run the following cell.

Note

The ! in IPython Notebook is a command magic which enable you to run terminal command directly from the code cell interface.

!cd COVE/driver_files; make -f spiral_bay_make.make; mv cove ../../
g++  ../coastline.o ../waveclimate.o ./spiral_bay_driver.o -lm -lstdc++ -o cove

It will create an executable named cove that will be used to run our different experiments.

To run the model, you will use the following command (don’t forget to put ! before calling the executable).

!./cove
Program needs 8 input arguments:	 
	- MeanWavePeriod
	- StDWavePeriod
	- MeanWaveHeight
	- StDWaveHeight
	- MeanWaveDirection
	- StDWaveDirection
	- TimeStep
	- EndTime

As shown in previous cell output the model requires 6 arguments.

Set the wave direction and spreading

We will give the following values for each of them:

  • MeanWavePeriod \(T_{mean}=6s\)

  • StDWavePeriod \(T_{std}=1s\)

  • MeanWaveHeight \(H_{mean}=1.m\)

  • StDWaveHeight \(H_{std}=0.1m\)

  • TimeStep \(dt=0.2\) days

  • EndTime \(50\) years

And for this first run we will use the following value for the wave direction and spreading:

  • MeanWaveDirection \(\theta_{mean}\)=\(25^o\)

  • StDWaveDirection \(\theta_{std}\)=\(10^o\)

# Define wave climate params
Tmean = 6
Tstd = 1
Hmean = 1.0
Hstd = 0.1
Theta = 25
ThetaStd = 10
dt = 0.2
end = 30
!./cove $Tmean $Tstd $Hmean $Hstd  $Theta $ThetaStd $dt $end
Coastline: Initialising Coastline as straight segment
	 MeanNodeSpacing = 50
	 CoastLength = 2000
	 Boundary Conditions = 2, 2

Coastline: Time is 0.00 years
Simulated time is 0.00 years
Coastline: Time is 0.10 years
Coastline: Time is 0.20 years
Coastline: Time is 0.30 years
Coastline: Time is 0.40 years
Coastline: Time is 0.50 years
Coastline: Time is 0.60 years
Coastline: Time is 0.70 years
Coastline: Time is 0.80 years
Coastline: Time is 0.90 years
Coastline: Time is 1.00 years
Simulated time is 1.00 years
Coastline: Time is 1.10 years
Coastline: Time is 1.20 years
Coastline: Time is 1.30 years
Coastline: Time is 1.40 years
Coastline: Time is 1.50 years
Coastline: Time is 1.60 years
Coastline: Time is 1.70 years
Coastline: Time is 1.80 years
Coastline: Time is 1.90 years
Coastline: Time is 2.00 years
Simulated time is 2.00 years
Coastline: Time is 2.10 years
Coastline: Time is 2.20 years
Coastline: Time is 2.30 years
Coastline: Time is 2.40 years
Coastline: Time is 2.50 years
Coastline: Time is 2.60 years
Coastline: Time is 2.70 years
Coastline: Time is 2.80 years
Coastline: Time is 2.90 years
Coastline: Time is 3.00 years
Simulated time is 3.00 years
Coastline: Time is 3.10 years
Coastline: Time is 3.20 years
Coastline: Time is 3.30 years
Coastline: Time is 3.40 years
Coastline: Time is 3.50 years
Coastline: Time is 3.60 years
Coastline: Time is 3.70 years
Coastline: Time is 3.80 years
Coastline: Time is 3.90 years
Coastline: Time is 4.00 years
Simulated time is 4.00 years
Coastline: Time is 4.10 years
Coastline: Time is 4.20 years
Coastline: Time is 4.30 years
Coastline: Time is 4.40 years
Coastline: Time is 4.50 years
Coastline: Time is 4.60 years
Coastline: Time is 4.70 years
Coastline: Time is 4.80 years
Coastline: Time is 4.90 years
Coastline: Time is 5.00 years
Simulated time is 5.00 years
Coastline: Time is 5.10 years
Coastline: Time is 5.20 years
Coastline: Time is 5.30 years
Coastline: Time is 5.40 years
Coastline: Time is 5.50 years
Coastline: Time is 5.60 years
Coastline: Time is 5.70 years
Coastline: Time is 5.80 years
Coastline: Time is 5.90 years
Coastline: Time is 6.00 years
Simulated time is 6.00 years
Coastline: Time is 6.10 years
Coastline: Time is 6.20 years
Coastline: Time is 6.30 years
Coastline: Time is 6.40 years
Coastline: Time is 6.50 years
Coastline: Time is 6.60 years
Coastline: Time is 6.70 years
Coastline: Time is 6.80 years
Coastline: Time is 6.90 years
Coastline: Time is 7.00 years
Simulated time is 7.00 years
Coastline: Time is 7.10 years
Coastline: Time is 7.20 years
Coastline: Time is 7.30 years
Coastline: Time is 7.40 years
Coastline: Time is 7.50 years
Coastline: Time is 7.60 years
Coastline: Time is 7.70 years
Coastline: Time is 7.80 years
Coastline: Time is 7.90 years
Coastline: Time is 8.00 years
Simulated time is 8.00 years
Coastline: Time is 8.10 years
Coastline: Time is 8.20 years
Coastline: Time is 8.30 years
Coastline: Time is 8.40 years
Coastline: Time is 8.50 years
Coastline: Time is 8.60 years
Coastline: Time is 8.70 years
Coastline: Time is 8.80 years
Coastline: Time is 8.90 years
Coastline: Time is 9.00 years
Simulated time is 9.00 years
Coastline: Time is 9.10 years
Coastline: Time is 9.20 years
Coastline: Time is 9.30 years
Coastline: Time is 9.40 years
Coastline: Time is 9.50 years
Coastline: Time is 9.60 years
Coastline: Time is 9.70 years
Coastline: Time is 9.80 years
Coastline: Time is 9.90 years
Coastline: Time is 10.00 years
Simulated time is 10.00 years
Coastline: Time is 10.10 years
Coastline: Time is 10.20 years
Coastline: Time is 10.30 years
Coastline: Time is 10.40 years
Coastline: Time is 10.50 years
Coastline: Time is 10.60 years
Coastline: Time is 10.70 years
Coastline: Time is 10.80 years
Coastline: Time is 10.90 years
Coastline: Time is 11.00 years
Simulated time is 11.00 years
Coastline: Time is 11.10 years
Coastline: Time is 11.20 years
Coastline: Time is 11.30 years
Coastline: Time is 11.40 years
Coastline: Time is 11.50 years
Coastline: Time is 11.60 years
Coastline: Time is 11.70 years
Coastline: Time is 11.80 years
Coastline: Time is 11.90 years
Coastline: Time is 12.00 years
Simulated time is 12.00 years
Coastline: Time is 12.10 years
Coastline: Time is 12.20 years
Coastline: Time is 12.30 years
Coastline: Time is 12.40 years
Coastline: Time is 12.50 years
Coastline: Time is 12.60 years
Coastline: Time is 12.70 years
Coastline: Time is 12.80 years
Coastline: Time is 12.90 years
Coastline: Time is 13.00 years
Simulated time is 13.00 years
Coastline: Time is 13.10 years
Coastline: Time is 13.20 years
Coastline: Time is 13.30 years
Coastline: Time is 13.40 years
Coastline: Time is 13.50 years
Coastline: Time is 13.60 years
Coastline: Time is 13.70 years
Coastline: Time is 13.80 years
Coastline: Time is 13.90 years
Coastline: Time is 14.00 years
Simulated time is 14.00 years
Coastline: Time is 14.10 years
Coastline: Time is 14.20 years
Coastline: Time is 14.30 years
Coastline: Time is 14.40 years
Coastline: Time is 14.50 years
Coastline: Time is 14.60 years
Coastline: Time is 14.70 years
Coastline: Time is 14.80 years
Coastline: Time is 14.90 years
Coastline: Time is 15.00 years
Simulated time is 15.00 years
Coastline: Time is 15.10 years
Coastline: Time is 15.20 years
Coastline: Time is 15.30 years
Coastline: Time is 15.40 years
Coastline: Time is 15.50 years
Coastline: Time is 15.60 years
Coastline: Time is 15.70 years
Coastline: Time is 15.80 years
Coastline: Time is 15.90 years
Coastline: Time is 16.00 years
Simulated time is 16.00 years
Coastline: Time is 16.10 years
Coastline: Time is 16.20 years
Coastline: Time is 16.30 years
Coastline: Time is 16.40 years
Coastline: Time is 16.50 years
Coastline: Time is 16.60 years
Coastline: Time is 16.70 years
Coastline: Time is 16.80 years
Coastline: Time is 16.90 years
Coastline: Time is 17.00 years
Simulated time is 17.00 years
Coastline: Time is 17.10 years
Coastline: Time is 17.20 years
Coastline: Time is 17.30 years
Coastline: Time is 17.40 years
Coastline: Time is 17.50 years
Coastline: Time is 17.60 years
Coastline: Time is 17.70 years
Coastline: Time is 17.80 years
Coastline: Time is 17.90 years
Coastline: Time is 18.00 years
Simulated time is 18.00 years
Coastline: Time is 18.10 years
Coastline: Time is 18.20 years
Coastline: Time is 18.30 years
Coastline: Time is 18.40 years
Coastline: Time is 18.50 years
Coastline: Time is 18.60 years
Coastline: Time is 18.70 years
Coastline: Time is 18.80 years
Coastline: Time is 18.90 years
Coastline: Time is 19.00 years
Simulated time is 19.00 years
Coastline: Time is 19.10 years
Coastline: Time is 19.20 years
Coastline: Time is 19.30 years
Coastline: Time is 19.40 years
Coastline: Time is 19.50 years
Coastline: Time is 19.60 years
Coastline: Time is 19.70 years
Coastline: Time is 19.80 years
Coastline: Time is 19.90 years
Coastline: Time is 20.00 years
Simulated time is 20.00 years
Coastline: Time is 20.10 years
Coastline: Time is 20.20 years
Coastline: Time is 20.30 years
Coastline: Time is 20.40 years
Coastline: Time is 20.50 years
Coastline: Time is 20.60 years
Coastline: Time is 20.70 years
Coastline: Time is 20.80 years
Coastline: Time is 20.90 years
Coastline: Time is 21.00 years
Simulated time is 21.00 years
Coastline: Time is 21.10 years
Coastline: Time is 21.20 years
Coastline: Time is 21.30 years
Coastline: Time is 21.40 years
Coastline: Time is 21.50 years
Coastline: Time is 21.60 years
Coastline: Time is 21.70 years
Coastline: Time is 21.80 years
Coastline: Time is 21.90 years
Coastline: Time is 22.00 years
Simulated time is 22.00 years
Coastline: Time is 22.10 years
Coastline: Time is 22.20 years
Coastline: Time is 22.30 years
Coastline: Time is 22.40 years
Coastline: Time is 22.50 years
Coastline: Time is 22.60 years
Coastline: Time is 22.70 years
Coastline: Time is 22.80 years
Coastline: Time is 22.90 years
Coastline: Time is 23.00 years
Simulated time is 23.00 years
Coastline: Time is 23.10 years
Coastline: Time is 23.20 years
Coastline: Time is 23.30 years
Coastline: Time is 23.40 years
Coastline: Time is 23.50 years
Coastline: Time is 23.60 years
Coastline: Time is 23.70 years
Coastline: Time is 23.80 years
Coastline: Time is 23.90 years
Coastline: Time is 24.00 years
Simulated time is 24.00 years
Coastline: Time is 24.10 years
Coastline: Time is 24.20 years
Coastline: Time is 24.30 years
Coastline: Time is 24.40 years
Coastline: Time is 24.50 years
Coastline: Time is 24.60 years
Coastline: Time is 24.70 years
Coastline: Time is 24.80 years
Coastline: Time is 24.90 years
Coastline: Time is 25.00 years
Simulated time is 25.00 years
Coastline: Time is 25.10 years
Coastline: Time is 25.20 years
Coastline: Time is 25.30 years
Coastline: Time is 25.40 years
Coastline: Time is 25.50 years
Coastline: Time is 25.60 years
Coastline: Time is 25.70 years
Coastline: Time is 25.80 years
Coastline: Time is 25.90 years
Coastline: Time is 26.00 years
Simulated time is 26.00 years
Coastline: Time is 26.10 years
Coastline: Time is 26.20 years
Coastline: Time is 26.30 years
Coastline: Time is 26.40 years
Coastline: Time is 26.50 years
Coastline: Time is 26.60 years
Coastline: Time is 26.70 years
Coastline: Time is 26.80 years
Coastline: Time is 26.90 years
Coastline: Time is 27.00 years
Simulated time is 27.00 years
Coastline: Time is 27.10 years
Coastline: Time is 27.20 years
Coastline: Time is 27.30 years
Coastline: Time is 27.40 years
Coastline: Time is 27.50 years
Coastline: Time is 27.60 years
Coastline: Time is 27.70 years
Coastline: Time is 27.80 years
Coastline: Time is 27.90 years
Coastline: Time is 28.00 years
Simulated time is 28.00 years
Coastline: Time is 28.10 years
Coastline: Time is 28.20 years
Coastline: Time is 28.30 years
Coastline: Time is 28.40 years
Coastline: Time is 28.50 years
Coastline: Time is 28.60 years
Coastline: Time is 28.70 years
Coastline: Time is 28.80 years
Coastline: Time is 28.90 years
Coastline: Time is 29.00 years
Simulated time is 29.00 years
Coastline: Time is 29.10 years
Coastline: Time is 29.20 years
Coastline: Time is 29.30 years
Coastline: Time is 29.40 years
Coastline: Time is 29.50 years
Coastline: Time is 29.60 years
Coastline: Time is 29.70 years
Coastline: Time is 29.80 years
Coastline: Time is 29.90 years
Coastline: Time is 30.00 years

Coastline: Results written to Spiral_6_1_1.0_0.1_25_10.xy
Coastline: Model run complete.

Plotting shoreline evolution

The model results are been written on disk in a file called Spiral_6_1_1._0.1_25_10.xy. As you can see the output file is named based on the input parameters given for the model run.

First we need to load the usually libraries (numpy and matplotlib).

%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt

# Customise figure style 
from matplotlib import rc
rc('font',size=13)
rc('ytick.major',pad=5)
rc('xtick.major',pad=5)
padding = 5

%config InlineBackend.figure_format = 'svg'

Read the output file

We will now open the file and read the content:

# Open coastline evolution file
filename = "Spiral_"+str(Tmean)+"_"+str(Tstd)+"_"+str(Hmean)+"_"+str(Hstd)+"_"+str(Theta)+"_"+str(ThetaStd)+".xy"

# Read the header info and get the lines
f = open(filename,"r")
Lines = f.readlines()
NoLines = len(Lines)-1
Header = Lines[0]

Define output time to visualise

The outputs are created at specific time intervals (defined in years) and we will first specified the times we want to visualise:

# Times we want to extract from the output files
TimeIntervals = [0.2,0.5,1,2,4,8,16,20,30]

Time = np.zeros(NoLines-1)
for i in range(0,NoLines-1,2):
    Time[i] = float(Lines[i+1].strip().split(" ")[0])

Plot the results

We will now plot the result the wvolution of the given bay morphology toward an equilibrium morphology between the two fixed headlands (defined as the thick black lines).

The plot will show the wave conditions defined by θmean and θstd as a wave rose.

Note

In the plot, model evolution starts from a straight coastline and the boundary conditions allow sediment to exit the model domain at either boundary by alongshore transport but sediment is not permitted to enter the bay from outside the domain.

# Define outputfile name based on theta nd thetastd values 
# (this file will be save on disk and could be used in your report)
outputfile = "mean"+ str(Theta) + "std" + str(ThetaStd) + ".png"

Let’s make the plotting now. Each red dashed lines corresponds to a specific time interval defined by the TimeIntervals parameter above:

# Setup the figure space, axis and line to animate
fig = plt.figure(1, figsize=(6,6))
plt.subplots_adjust(0.2,0.15,0.9,0.85)


# Get the shoreline positions
X = np.array(Lines[1].strip().split(" ")[1:],dtype='float64')
Y = np.array(Lines[2].strip().split(" ")[1:],dtype='float64')
plt.plot(X,Y,'b.',ms=5,label="Initial Coastline")

plt.xlabel('X-coordinate (m)')
plt.ylabel('Y-coordinate (m)')

plt.xlim(-500,2000)
plt.ylim(-2100,0)

# Loop over the chosen time intervals
for TimeInt in TimeIntervals:
    Diff = np.abs(Time-TimeInt)
    Line = np.argmin(Diff)
    Xt = np.array(Lines[Line+1].strip().split(" ")[1:],dtype='float64')
    Yt = np.array(Lines[Line+2].strip().split(" ")[1:],dtype='float64')
    plt.plot(Xt,Yt,'r--',lw=1.5)

xmin = np.min(Xt)-500.
xmax = np.max(Xt)+500
ymin = np.min(Yt)-500.
ymax = np.max(Yt)+500

SeaX = np.append(Xt,[xmax,xmax,Xt[0]])
SeaY = np.append(Yt,[ymin,ymax,Yt[0]])
BeachX = np.append(Xt,[xmin,xmin,Xt[0]])
BeachY = np.append(Yt,[ymin,ymax,Yt[0]])
    
plt.fill(SeaX, SeaY, color=[0.7,0.9,1.0])
plt.fill(BeachX, BeachY, color=[1.0,0.9,0.6])

plt.plot(Xt,Yt,'r--',lw=1.5,label="Intermediate Coastlines")
plt.plot(Xt,Yt,'r-',lw=2,label="50 Year Coastline")
plt.plot(Xt,Yt,'ro',ms=6)

plt.plot(X[0:2],Y[0:2],'k-',lw=5)
plt.plot(X[-2:],Y[-2:],'k-',lw=5)

# Display legend
plt.rcParams.update({'legend.labelspacing':0.1}) 
plt.rcParams.update({'legend.numpoints':2}) 
plt.rcParams.update({'legend.frameon':False}) 
plt.rcParams.update({'legend.handlelength':1.5}) 
plt.legend(loc=3)
leg = plt.gca().get_legend()

# Set fontsize to small
ltext  = leg.get_texts()
plt.setp(ltext, fontsize=10) 

# Bin all wave data
Waves = np.random.normal(Theta,ThetaStd,10000)
widths = 15*np.pi/180.0
ax = plt.axes([0.65,0.55,0.25,0.25],polar=True)
hist = np.histogram(Waves*np.pi/180.0,bins=np.arange(0,361*np.pi/180.0,widths))
plt.bar(hist[1][:-1],hist[0],widths,color='white',edgecolor='k')
ax.set_theta_zero_location("N")
ax.set_theta_direction(-1)
ax.set_facecolor('none')
plt.axis('off')
plt.yticks([])
plt.xticks([])

plt.savefig(outputfile)
plt.show()
../_images/baysensitivity_16_0.svg

Clean run

To avoid storage of extensive data on the server delete the output file using the command rm. This is all right as you already have saved the model outputs as a png file!

!rm Spiral_*.xy