Create the GeoClaw dtopo file AKmaxWA.tt3
for use in tsunami modeling projects for Washington State.
%pylab inline
import os,sys
from clawpack.geoclaw import topotools,dtopotools
# topography for plots:
etopo1 = topotools.read_netcdf('etopo1', extent=[-160,-140,53,63], coarsen=3)
Using Clawpack 5.7.1 with with an updated version of https://sift.pmel.noaa.gov/ComMIT/compressed/info_sz.dat that will be added to v5.8.0, replacing the file clawpack/geoclaw/src/python/geoclaw/data/info_sz.dat.txt
.
Check that some subfaults have been corrected:
AKmaxWA = dtopotools.SiftFault(longitude_shift=-360.)
SIFT = AKmaxWA.sift_subfaults
k = 'acsza38'
s = SIFT[k]
print('%s, dip = %i, depth = %.3f km' % (k,s.dip, s.depth/1e3))
assert s.dip==15, '*** wrong dip'
assert s.depth/1e3==17.94, '*** wrong depth'
k = 'acszz38'
s = SIFT[k]
print('%s, dip = %i, depth = %.3f km' % (k,s.dip, s.depth/1e3))
assert s.dip==15, '*** wrong dip'
assert s.depth/1e3==30.88, '*** wrong depth'
Note that we have also shifted longitudes by 360 to put into coordinates W used in WA state projects.
sift_slipAKmaxWA = {}
slip_uniform = 20.
for usrc in range(29,39):
k = 'acsza%s' % usrc
sift_slipAKmaxWA[k] = slip_uniform
k = 'acszz%s' % usrc
sift_slipAKmaxWA[k] = slip_uniform
AKmaxWA.set_subfaults(sift_slipAKmaxWA)
print('With uniform slip %.2f meters, Magnitude = %.2f' % (slip_uniform,AKmaxWA.Mw()))
print(' src long lat dip strike rake depth slip')
for usrc in range(29,39):
k = 'acsza%s' % usrc
s = AKmaxWA.sift_subfaults[k]
print('%s %.4f %.4f %4.1f %.4f %.1f %5.2f %5.2f' \
% (k, s.longitude, s.latitude, s.dip, s.strike, s.rake, (s.depth/1e3), s.slip))
k = 'acszz%s' % usrc
s = AKmaxWA.sift_subfaults[k]
print('%s %.4f %.4f %4.1f %.4f %.1f %5.2f %5.2f' \
% (k, s.longitude, s.latitude, s.dip, s.strike, s.rake, (s.depth/1e3), s.slip))
x1 = -160.783294677734
x2 = -139.783294677734
mx = 316
dx = (x2-x1) / (mx-1)
y1 = 50.64400100708008
y2 = 61.653900146484375
my = 301
dy = (y2-y1) / (my-1)
print('Will create %i by %i dtopo with spacing' % (mx,my))
print(' dx = %.14f, dy = %.14f' % (dx,dy))
x_unif = linspace(x1, x2, mx)
y_unif = linspace(y1, y2, my)
dtopo_AKmaxWA = AKmaxWA.create_dtopography(x_unif, y_unif, times=[1.],verbose=True)
fname = 'AKmaxWA.tt3'
dtopo_AKmaxWA.write(fname, 3)
print('Created ', fname)
figure(figsize=(13,13))
contourf(etopo1.X, etopo1.Y, etopo1.Z, [0,10000], colors=[[0.6,1,0.6]])
contour(etopo1.X, etopo1.Y, etopo1.Z, [0], colors='g', linewidths=0.5)
plot([-149.9],[61.2],'ko')
text(-150.2,61.4,'Anchorage',color='k',fontsize=14)
axis([-158, -143, 54, 62])
gca().set_aspect(1/cos(57*pi/180))
grid(True)
clines_neg = arange(-10,0.,1.)
clines_pos = arange(1,16,1.)
dd = dtopo_AKmaxWA
dZ = dd.dZ[0,:,:]
contour(dd.X, dd.Y, dZ, clines_neg, colors='b', linestyles='-')
contour(dd.X, dd.Y, dZ, clines_pos, colors='r', linestyles='-')
dZmin = dZ.min()
dZmax = dZ.max()
axis([-160,-143,54,62]);
title('AKmaxWA Seafloor Deformation')
fname = 'AKmaxWA.png'
savefig(fname)
print('Created ',fname);