#!/usr/bin/env python # coding: utf-8 # Notebook to examined 3.6 test runs # In[1]: import netCDF4 as nc import numpy as np import matplotlib.pyplot as plt get_ipython().run_line_magic('matplotlib', 'inline') # In[2]: d = nc.Dataset('/data/nsoontie/MEOPAR/SalishSea/results/2Ddomain/3.4-compare/SalishSea_1h_20020915_20020921_grid_T.nc') sal = d.variables['vosaline'][:] sal = np.ma.masked_values(sal,0) deps = d.variables['deptht'][:] temp = d.variables['votemper'][:] temp = np.ma.masked_values(temp,0) ssh = d.variables['sossheig'][:] d = nc.Dataset('/data/nsoontie/MEOPAR/SalishSea/results/2Ddomain/3.4-compare/SalishSea_1h_20020915_20020921_grid_U.nc') U = d.variables['vozocrtx'][:] U = np.ma.masked_values(U,0) depsU = d.variables['depthu'][:] # In[3]: smin=22 smax=34 t=0 y=2 plt.pcolormesh(np.arange(0,sal.shape[3]),deps,sal[t,:,y,:],vmin=smin,vmax=smax) plt.axis([0,1100,400,0]) plt.colorbar() # In[4]: t=60 plt.pcolormesh(np.arange(0,sal.shape[3]),deps,sal[t,:,y,:],vmin=smin,vmax=smax) plt.axis([0,1100,400,0]) plt.colorbar() # In[5]: t=120 plt.pcolormesh(np.arange(0,sal.shape[3]),deps,sal[t,:,y,:],vmin=smin,vmax=smax) plt.axis([0,1100,400,0]) plt.colorbar() # In[6]: tmin=3; tmax=10 t=0 plt.pcolormesh(np.arange(0,sal.shape[3]),deps,temp[t,:,y,:],vmin=tmin,vmax=tmax) plt.axis([0,1100,400,0]) plt.colorbar() # In[7]: t=120 plt.pcolormesh(np.arange(0,sal.shape[3]),deps,temp[t,:,y,:],vmin=tmin,vmax=tmax) plt.axis([0,1100,400,0]) plt.colorbar() # In[8]: t=0 umin=-.5 umax=0.5 plt.pcolormesh(np.arange(0,U.shape[3]),depsU,U[t,:,y,:],vmin=umin,vmax=umax) plt.axis([0,1100,400,0]) plt.colorbar() # In[9]: t=100 plt.pcolormesh(np.arange(0,U.shape[3]),depsU,U[t,:,y,:],vmin=umin,vmax=umax) plt.axis([0,1100,400,0]) plt.colorbar() # In[10]: t=120 plt.pcolormesh(np.arange(0,U.shape[3]),depsU,U[t,:,y,:],vmin=umin,vmax=umax) plt.axis([0,1100,400,0]) plt.colorbar() # Tidal signal? Look at boundary # In[11]: plt.plot(U[:,0,y,3]) # I don't see a tidal signal at all. ssh? # In[12]: plt.plot(ssh[:,y,10]) # The amplitude seemse reall small but this looks like a tidal response. Howevever, the frequency is weird. Shoudnt there be two mins a day? this looks like 3 or 4. # In[14]: plt.pcolormesh(ssh[:,y,:],vmin=-3,vmax=3) plt.colorbar() # In[16]: plt.pcolormesh(U[:,0,y,:],vmin=-3,vmax=3) plt.colorbar() # Ok, I definitely have tides in 3.4 but they aren't there in 3.6... Check namelists. # In[ ]: