Compare M2 and K1 tidal harmonics from NEMO model to observed harmonics. Model has Western boundary forcing and closed Northern boundary. These are early results; see the Model vs. Observed Harmonics with Open Northern Boundary notebook for analysis of more recent model results.
import netCDF4 as NC
import numpy as np
from salishsea_tools import tidetools
%matplotlib inline
#The run name is the unique part of the name of each run
#e.g. the run name for results in /data/dlatorne/MEOPAR/SalishSea/results/50s_26-29Sep/ is '50_26-29Sep'
#You must tell the notebook the name of the run, where the bathy grid is and where the results are
# if you only want to look at one run: runname = '40d'
# if you want to look at more than one run: runname = '40d','41d50d','51d60d'
#You must also tell the notebook where your grid is and the location of the results files, as this will change
#from user to user
runname = '41d70d'
grid = NC.Dataset('/ocean/klesouef/meopar/nemo-forcing/grid/bathy_meter_SalishSea2.nc','r')
resultsloc = '/ocean/dlatorne/MEOPAR/SalishSea/results/'
#Now, plot the amplitude and phase results
tidetools.plot_amp_phase_maps(runname, resultsloc, grid)
List of runs so far
concepts110 Subdomain, Nemo 3.1
jpp72 Subdomain, Nemo 3.4
7dx6h_d17-d23 Salish Sea 7 day hot start results
1h_8tides Salish Sea 1 hour of 8 tides results
24h_8tides Salish Sea 24 hours of 8 tides results
wknd_15-21Sep Salish Sea 7 day run, harmonics calculated from last 2 days
wknd_22-23Sep Salish Sea 2 day run, hotstarted after wknd_15_21Sep, harmonics calculated from last 2 days
4d_24-27Sep Salish Sea 4 day run
4d_28Sep-1Oct Salish Sea 4 day run
50s_15-21Sep Salish Sea 7 day run
50s_22-25Sep Salish Sea 4 day run, hostarted after 50s_15_21Sep
50s_26-29Sep Salish Sea 4 day run
50s_30-6Oct Salish Sea 7 day run
40d Salish Sea 40 day run with bathy 2 (60m2s-1)
41d70d Salish Sea 30 day run with bathy 2 (50m2s-1)
#Calculate differences and save to a csv
meas_wl_harm, Am_M2_all, Ao_M2_all, gm_M2_all, go_M2_all, \
D_F95_M2_all, D_M04_M2_all, Am_K1_all, Ao_K1_all, gm_K1_all, \
go_K1_all, D_F95_K1_all, D_M04_K1_all = tidetools.calc_diffs_meas_mod(runname,resultsloc,grid)
No point found in current domain for station 44 :( Results saved here: /ocean/klesouef/meopar/tools/compare_tides/wlev_harm_diffs_41d70d.csv
#Plot scatter plots for K1 and M2
tidetools.plot_scatter_pha_amp(Am_K1_all, Ao_K1_all, gm_K1_all, go_K1_all,'K1')
tidetools.plot_scatter_pha_amp(Am_M2_all, Ao_M2_all, gm_M2_all, go_M2_all,'M2')
Now plot the results of this analysis in some meaningful way.
#Plot the differences as circles of different areas on a map of the domain
tidetools.plot_diffs_on_domain(D_F95_M2_all, meas_wl_harm, 'F95', 'M2', grid)
tidetools.plot_diffs_on_domain(D_M04_M2_all, meas_wl_harm, 'M04', 'M2', grid)
tidetools.plot_diffs_on_domain(D_F95_K1_all, meas_wl_harm, 'F95', 'K1', grid)
tidetools.plot_diffs_on_domain(D_M04_K1_all, meas_wl_harm, 'M04', 'K1', grid)
Where points are on land, the comparison was made between the measured value at the point and the closest model point.
#Plot transects of modelled and measured tidal harmonics for three runs
runname1 = '41d70d'
loc1 = '/ocean/dlatorne/MEOPAR/SalishSea/results/'
runname2 = '40d'
loc2 = '/ocean/dlatorne/MEOPAR/SalishSea/results/'
runname3 = '40d','41d70d'
loc3 = '/ocean/dlatorne/MEOPAR/SalishSea/results/'
runname4 = '41d50d_nu200','51d60d_nu200','61d70d_nu200'
loc4 = '/ocean/dlatorne/MEOPAR/SalishSea/results/'
#plot the transect of some stations in approximate line through Salish Sea ('SS')
#Station numbers (1 based): 38, 1, 3, 4, 6, 5, 7, 9, 12, 14, 15, 16, 20, 21, 22, 23, 25, 26, 27
#Station numbers (0 based): 37, 0, 2, 3, 5, 4, 6, 8, 11, 13, 14, 15, 19, 20, 21, 22, 24, 25, 26
statnums = np.array([37, 0, 2, 3, 5, 4, 6, 8, 11, 13, 14, 15, 19, 20, 21, 22, 24, 25, 26])
tidetools.plot_wlev_const_transect('SS',statnums,runname1,loc1,grid,runname2,loc2,runname3,loc3,runname4,loc4)
#plot map that shows the location
tidetools.plot_wlev_transect_map(grid,statnums)
#add a line through the US points into Puget Sound ('PS')
#Neah Bay (39), Sekiu (40), Port Angeles (41), Port Townsend (42), Foulweather Bluff (47), Everett (48), Seattle (45), Tacoma (44), Budd Inlet (43)
#Station numbers (1 based): 39,40,41,42,47,48,45,44,43
#Station numbers (0 based): 38,39,40,41,46,47,44,43,42
statnums = np.array([38,39,40,41,46,47,44,43,42])
tidetools.plot_wlev_const_transect('PS',statnums,runname1,loc1,grid,runname2,loc2,runname3,loc3,runname4,loc4)
#plot map that shows the location
tidetools.plot_wlev_transect_map(grid,statnums)
#plot all measured stations together, just to see 'em!
statnums = np.arange(0,54)
tidetools.plot_wlev_const_transect('all',statnums,runname1,loc1,grid,runname2,loc2,runname3,loc3,runname4,loc4)
No point found in current domain for station 44 :( No point found in current domain for station 44 :( No point found in current domain for station 44 :( No point found in current domain for station 44 :( No point found in current domain for station 44 :( No point found in current domain for station 44 :( No point found in current domain for station 44 :( No point found in current domain for station 44 :( No point found in current domain for station 44 :( No point found in current domain for station 44 :( No point found in current domain for station 44 :( No point found in current domain for station 44 :(
(When I try to add labels to the stations the plot is disappearing in ipython notebook so here are the station numbers and names for reference)
Stations 1 - 38 are from Table 1 in Foreman et al (1995), refer to Figure 2 of Foreman et al (1995) (http://onlinelibrary.wiley.com/doi/10.1029/94JC02721/full) for a map with these station numbers on it
Stations 39 - 55 are from the NOAA website, refer to http://tidesandcurrents.noaa.gov/map/index.shtml?type=HarmonicConstituents%C2%AEion=Washington
Station Number, Station Name
1 Sooke
2 Port Angeles
3 Pedder Bay
4 Esquimalt
5 Clover Point
6 Victoria
7 Finnerty Cove
8 Port Townsend
9 Sidney
10 Patricia Bay
11 Maple Bay
12 Fulford Harbour
13 Ladysmith
14 Patos Island
15 Tumbo Channel
16 Whaler Bay
17 Silva Bay
18 Ferndale
19 Blaine
20 Tsawwassen
21 Sandheads
22 Point Grey
23 Point Atkinson
24 Squamish
25 Gibson's Landing
26 Halfmoon Bay
27 Irvines Landing
28 Winchelsea
29 Northwest Bay
30 Cherry Point
31 Friday Harbour
32 Rosario
33 North Beach
34 Bellingham
35 Anacortes
36 Reservation Bay
37 Hanbury Point
38 Sheringham Point
39 Neah Bay
40 Sekiu Clallam Bay
41 Port Angeles
42 Port Townsend
43 Budd Inlet
44 Tacoma
45 Seattle
46 Bangor
47 Foulweather Bluff
48 Everett
49 Sneeoosh Point
50 Turner Bay
51 Armitage Island
52 Friday Harbour
53 Richardson
54 Cherry Point
55 Blaine