Crashing on first time step on the western boundary at 2 465 14 in fortran.
Going to try smoothing the restart file.
import matplotlib.pyplot as plt
import numpy as np
import xarray as xr
%matplotlib inline
restart_file = xr.open_dataset('/results/SalishSea/nowcast-agrif.201702/13nov20/SalishSea_04914000_restart.nc')
restart_file
[357404 values with dtype=float32]
[357404 values with dtype=float32]
array([ 0.5 , 1.500003, 2.500011, 3.500031, 4.500071, 5.500151, 6.50031 , 7.500623, 8.501236, 9.502433, 10.504766, 11.509312, 12.518167, 13.535412, 14.568982, 15.634288, 16.761173, 18.007135, 19.481785, 21.389978, 24.100256, 28.229916, 34.685757, 44.517723, 58.484333, 76.58559 , 98.06296 , 121.866516, 147.08946 , 173.11449 , 199.57304 , 226.2603 , 253.06664 , 279.93454 , 306.8342 , 333.75018 , 360.67453 , 387.6032 , 414.5341 , 441.4661 ], dtype=float32)
array([4914000.])
array(4914000.)
array(20201113.)
array(2275.)
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[357404 values with dtype=float64]
[14296160 values with dtype=float64]
[357404 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
array(40.)
array(40.)
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[357404 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[14296160 values with dtype=float64]
[357404 values with dtype=float64]
[14296160 values with dtype=float64]
prob = 465-1
pz = 14-1
Look at velocity
ib, ie = 385, 467
uveln19 = restart_file.un[0, pz]
uvelb19 = restart_file.ub[0, pz]
uvelb19[ib:ie, 1].plot(label="Before 1", linewidth=5)
uveln19[ib:ie, 1].plot(label="Next 1")
uvelb19[ib:ie, 3].plot(label="Before 3", linewidth=5)
uveln19[ib:ie, 3].plot(label="Next 3")
plt.plot([prob-ib, prob-ib], [-0.5, 2], color='k');
plt.legend();
ib, ie = 385, 467
vveln19 = restart_file.vn[0, pz]
vvelb19 = restart_file.vb[0, pz]
vvelb19[ib:ie, 1].plot(label="Before 1", linewidth=5)
vveln19[ib:ie, 1].plot(label="Next 1")
vvelb19[ib:ie, 3].plot(label="Before 3", linewidth=5)
vveln19[ib:ie, 3].plot(label="Next 3")
plt.plot([prob-ib, prob-ib], [-0.5, 2], color='k');
plt.legend();
restart_file.un[0, :, :, 1] = restart_file.un[0, :, :, 2]
restart_file.ub[0, :, :, 1] = restart_file.ub[0, :, :, 2]
restart_file.vn[0, :, :, 1] = restart_file.vn[0, :, :, 2]
restart_file.vb[0, :, :, 1] = restart_file.vb[0, :, :, 2]
restart_file.attrs['Modified'] = 'copied velocity one away from west boundary to boundary'
restart_file.attrs
{'file_name': 'SalishSea_04914000_restart.nc', 'TimeStamp': '13/11/2020 10:56:10 -0800', 'Modified': 'copied velocity one away from west boundary to boundary'}
restart_file.to_netcdf('SalishSea_04914000_restart.nc')