Quick comparison between a week long run in Dec 11-17 with rivers at different depths
Both simulations began with a T/S profile from the spin ups.
%matplotlib inline
import matplotlib.pylab as plt
import numpy as np
import netCDF4 as NC
from salishsea_tools import viz_tools
from salishsea_tools import bathy_tools
from salishsea_tools import nc_tools
from __future__ import division
bathy = NC.Dataset('/data/nsoontie/MEOPAR/NEMO-forcing/grid/bathy_meter_SalishSea2.nc')
path = '/ocean/nsoontie/MEOPAR/SalishSea/results/storm-surges/final/dec2006/'
str1='all_forcing/SalishSea_4h_20061211_20061217_grid_T.nc'
str2='rivers2m/SalishSea_4h_20061211_20061217_grid_T.nc'
str3='all_forcing/SalishSea_4h_20061211_20061217_grid_U.nc'
str4='rivers2m/SalishSea_4h_20061211_20061217_grid_U.nc'
str5='all_forcing/SalishSea_4h_20061211_20061217_grid_V.nc'
str6='rivers2m/SalishSea_4h_20061211_20061217_grid_V.nc'
run1 = NC.Dataset(path+str1)
run2 = NC.Dataset(path+str2)
run3 = NC.Dataset(path+str3)
run4 = NC.Dataset(path+str4)
run5 = NC.Dataset(path+str5)
run6 = NC.Dataset(path+str6)
sal1=run1.variables['vosaline']
sal2=run2.variables['vosaline']
sals={'rivers3m':sal1, 'rivers2m':sal2 }
ssh1 = run1.variables['sossheig']
ssh2 = run2.variables['sossheig']
sshs = {'rivers3m':ssh1, 'rivers2m':ssh2 }
u1=run3.variables['vozocrtx']
u2=run4.variables['vozocrtx']
us={'rivers3m':u1, 'rivers2m':u2 }
v1=run5.variables['vomecrty']
v2=run6.variables['vomecrty']
vs={'rivers3m':v1, 'rivers2m':v2 }
#nc_tools.show_variables(run5)
def compare_Sal(key1,key2,t,depth,ax):
#sal1=np.ma.array(sals[key1][t,0,:,:],mask=sals[key1][t,0,:,:]==0)
#sal2=np.ma.array(sals[key2][t,0,:,:],mask=sals[key2][t,0,:,:]==0)
mesh=ax.pcolormesh(sals[key1][t,depth,:,:]-sals[key2][t,depth,:,:],cmap='RdBu_r',vmin=-2,vmax=2)
ax.set_title(key1 +'-' +key2 + ' t='+str(t) +' d = ' +str(depth))
cbar=plt.colorbar(mesh,ax=ax)
cbar.set_label('Difference in Salinity')
viz_tools.plot_coastline(ax,bathy)
def compare_ssh(key1,key2,t,ax):
mesh=ax.pcolormesh(sshs[key1][t,:,:]-sshs[key2][t,:,:],cmap='RdBu_r',vmin=-0.0025,vmax=0.0025)
ax.set_title(key1 +'-' +key2 + ' t='+str(t))
cbar=plt.colorbar(mesh,ax=ax)
cbar.set_label('Difference in Surface Height')
viz_tools.plot_coastline(ax,bathy)
def compare_u(key1,key2,t,depth,ax):
mesh=ax.pcolormesh(us[key1][t,depth,:,:]-us[key2][t,depth,:,:],cmap='RdBu_r',vmin=-0.08,vmax=0.08)
ax.set_title(key1 +'-' +key2 + ' t='+str(t) +' d = ' +str(depth))
cbar=plt.colorbar(mesh,ax=ax)
cbar.set_label('Difference in U velocity')
viz_tools.plot_coastline(ax,bathy)
def compare_v(key1,key2,t,depth,ax):
mesh=ax.pcolormesh(vs[key1][t,depth,:,:]-vs[key2][t,depth,:,:],cmap='RdBu_r',vmin=-0.08,vmax=0.08)
ax.set_title(key1 +'-' +key2 + ' t='+str(t) +' d = ' +str(depth))
cbar=plt.colorbar(mesh,ax=ax)
cbar.set_label('Difference in V velocity')
viz_tools.plot_coastline(ax,bathy)
Difference in salinity at surface,sea surface height, and U and V velocity components. One week of simulations.
fig,(ax,ax2,ax3,ax4)=plt.subplots(1,4,figsize=(20,8), sharey=True)
compare_Sal('rivers3m','rivers2m',41,0,ax)
compare_ssh('rivers3m','rivers2m',41,ax2)
compare_u('rivers3m','rivers2m',41,0,ax3)
compare_v('rivers3m','rivers2m',41,0,ax4)
At some rivers, surface salinity is higher in the 3 m case. So 2m rivers are fresher at the surface.
Fraser River, oddly, not affected. Maybe one week isn't long enough?
Difference in salinity, U and V velocity components at 1m depth. One week of simulations.
fig,(ax,ax3,ax4)=plt.subplots(1,3,figsize=(15,8), sharey=True)
compare_Sal('rivers3m','rivers2m',41,1,ax)
compare_u('rivers3m','rivers2m',41,1,ax3)
compare_v('rivers3m','rivers2m',41,1,ax4)
Difference in salinity, U and V velocity components at 2m depth. One week of simulations.
fig,(ax,ax3,ax4)=plt.subplots(1,3,figsize=(15,8), sharey=True)
compare_Sal('rivers3m','rivers2m',41,2,ax)
compare_u('rivers3m','rivers2m',41,2,ax3)
compare_v('rivers3m','rivers2m',41,2,ax4)
Difference in salinity, U and V velocity components at 3m depth. One week of simulation.
fig,(ax,ax3,ax4)=plt.subplots(1,3,figsize=(15,8), sharey=True)
compare_Sal('rivers3m','rivers2m',41,3,ax)
compare_u('rivers3m','rivers2m',41,3,ax3)
compare_v('rivers3m','rivers2m',41,3,ax4)