In [ ]:
#!f2py --f90exec=mpif90 -I. -c -m ocean ocean.f90
In [ ]:
import time
import numpy as np
import wave as ocean
import cmocean as cmo
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
%matplotlib inline
In [ ]:
file1='../data/gbr_south.csv'
file2='../data/topoGBR1000.csv'
# Bathymetric filename
bfile = file1
# Resolution factor
rfac = 4
In [ ]:
# Wave heights (m)
H0 = [2,3,2]
# Define wave source direction at boundary
# (angle in degrees counterclock wise from horizontal axis)
dir = [300,0,90]
# Percentage of each wave scenario activity (in %)
perc = [3,3,4]
# Maximum depth for wave influence (m)
wbase = 20
# Sea level position (m)
slvl = 0.
In [ ]:
# Mean grain size diameter in m
d50 = 0.0001
# Steps used to perform sediment transport
tsteps = 1000
# Steps used to perform sediment diffusion
dsteps = 1000
In [ ]:
#help(ocean.runWaveSed)
In [ ]:
avewH,avewS,aveDZ,sim = ocean.runWaveSed(bfile,rfac,H0,dir,perc,
wbase,slvl,d50,tsteps,
dsteps,size = (10,40))
In [ ]:
size = (20,40)
# i1 = 0
# i2 = -1
# j1 = 0
# j2 = -1
# Zooming to a specific region
i1 = 600
i2 = 1200
j1 = 0
j2 = 500
fig = plt.figure(figsize=size)
ax = plt.gca()
ax.set_title('Erosion/deposition (m)', fontsize=10)
im = ax.imshow(np.flipud(aveDZ[i1:i2,j1:j2].T),interpolation='nearest',
cmap=cmo.cm.balance,vmin=-0.25, vmax=0.25)
ax.contour(np.flipud(sim.regZ[i1:i2,j1:j2].T-sim.sealvl), 0,
colors='k', linewidths=2)
divider1 = make_axes_locatable(ax)
cax1 = divider1.append_axes("right", size="5%", pad=0.05)
cbar1 = plt.colorbar(im,cax=cax1)
plt.tight_layout()
plt.show()
In [ ]: