#!/usr/bin/env python # coding: utf-8 # Looking at high-frequency oscillation in nowcast green ssh at Point Atkinson 15 minute files. # In[1]: import netCDF4 as nc import matplotlib.pyplot as plt import numpy as np import os import datetime from salishsea_tools import nc_tools get_ipython().run_line_magic('matplotlib', 'inline') # ## A sample nowcast-green output # In[2]: f = nc.Dataset('/results/SalishSea/nowcast-green/08mar16/PointAtkinson.nc') ssh = f.variables['sossheig'][:,0,0] ts =nc_tools.timestamp(f,np.arange(ssh.shape[0])) dates = [d.datetime for d in ts] # In[3]: plt.plot(dates,ssh) plt.title(dates[0].strftime('%Y-%m-%d')) plt.ylabel('ssh [m]') # In[4]: ssh[-10:] # * Saw-tooth like behaviour and repeated values. # * Could this be because 15 minutes is not divisible by out 40 second time step? # ### Other NEMO 3.6 output (with 40s timestep) # Tested # * 15 minute output # * 10 minute output # * 20 minute output # In[5]: rundir = '/ocean/nsoontie/MEOPAR/SalishSea/results/mixing_paper/holl_jul/' times = [10,15,20] fig,ax = plt.subplots(1,1,figsize=(15,5)) for time in times: f = nc.Dataset(os.path.join(rundir,'PointAtkinson_{}.nc'.format(time))) ssh = f.variables['sossheig'][:,0,0] ts =nc_tools.timestamp(f,np.arange(ssh.shape[0])) dates = [d.datetime for d in ts] ax.plot(dates, ssh,label ='{} minute output'.format(time) ) ax.legend(loc=0) ax.set_ylabel('ssh [m]') print('{} minute output'.format(time)) print('last 8 ssh: ', ssh[-8:]) ax.set_xlim([datetime.datetime(2015,7,11),datetime.datetime(2015,7,12)]) # * This saw-tooth behaviour is not present in the 10 minute and 20 minute outputs. So, I think we should switch to 10 minute output in nowcast-green. The behaviors is an artifact of # * Unfortunately, this run went unstable in Boundary Pass at 15 m depth after ~15000 time steps. Using # * 40s timestep # * kappa/mu=10 # * background visc= 1e-5 # * background diff=1e-6 # * hollingsworth correction # * rn_bfri2 = 2e-3 # * ln_loglayer=T # * rn_bfri2_max = 1.e-1 # * rn_bfrz0=0.0015 # * bathy2 # * TS4 tides # # It was in the middle of a spring tides. A run without hollingsworth correction was stable. # # In[ ]: