import netCDF4 as nc
import datetime as dt
import subprocess
import requests
import matplotlib.pyplot as plt
import cmocean
import numpy as np
import os
import glob
import dateutil as dutil
from salishsea_tools import viz_tools
import pickle
%matplotlib inline
recalc=True #False
t0=dt.datetime(2007,1,1) #
if recalc:
with nc.Dataset('/ocean/eolson/MEOPAR/NEMO-forcing/grid/mesh_mask201702_noLPE.nc') as fm:
tmask=np.copy(fm.variables['tmask'])
umask=np.copy(fm.variables['umask'])
vmask=np.copy(fm.variables['vmask'])
navlon=np.copy(fm.variables['nav_lon'])
navlat=np.copy(fm.variables['nav_lat'])
e3t_0=np.copy(fm.variables['e3t_0'])
e3u_0=np.copy(fm.variables['e3u_0'])
e3v_0=np.copy(fm.variables['e3v_0'])
e1t=np.copy(fm.variables['e1t'])
e2t=np.copy(fm.variables['e2t'])
e1v=np.copy(fm.variables['e1v'])
e2u=np.copy(fm.variables['e2u'])
A=fm.variables['e1t'][0,:,:]*fm.variables['e2t'][0,:,:]*tmask[0,0,:,:]
#te=dt.datetime(2016,12,1)# last start date of runfnum=18
stm=np.shape(tmask)
SiN=1.8
nyears=13
tint=20 # calculate every 20 days
nlen= int(365*nyears/tint) # 2 yrs210
#nlen=58#100
dlist=[t0+dt.timedelta(days=ii*tint) for ii in range(0,nlen)]
#sdir0='/results/SalishSea/nowcast-green/'
sdir1='/results2/SalishSea/nowcast-green.201905/'
#sdir3='/data/eolson/MEOPAR/SS36runs/CedarRuns/spring2015_HCMZ/'
tmaskC=np.copy(tmask)
tmaskC[:,:,370:490,:12]=0
tmaskC[:,:,887:,30:70]=0
if recalc:
tlist=dlist
SiGlobalTot=dict()
SiTot=dict()
BSiTot=dict()
DiatTot=dict()
changeSiGlobalTot=dict()
for idir in (sdir1,):
fformat1='%d%b%y/'
if idir.startswith('/data/eolson/MEOPAR/SS36runs/CedarRuns/'):
fformatT='SalishSea_1d_*_ptrc_T_%Y%m%d-*.nc'
fformatP='SalishSea_1d_*_ptrc_T_%Y%m%d-*.nc'
elif idir.startswith('/results'):
fformatT='SalishSea_1h_%Y%m%d_%Y%m%d_ptrc_T.nc'
fformatP='SalishSea_1h_%Y%m%d_%Y%m%d_carp_T.nc'
elif idir.startswith('/data/sallen/results/MEOPAR/202007/'):
fformatT='SalishSea_1d_????????_????????_ptrc_T_%Y%m%d-*.nc'
fformatP='SalishSea_1d_????????_????????_carp_T_%Y%m%d-*.nc'
else:
raise Exception('Name Error')
sumSi=np.zeros((len(tlist),stm[2],stm[3]))
sumBSi=np.zeros((len(tlist),stm[2],stm[3]))
sumDiat=np.zeros((len(tlist),stm[2],stm[3]))
ind=-1
for idt0 in tlist:
ind=ind+1
cdir=idt0.strftime(fformat1).lower()
iffT=idt0.strftime(fformatT)
iffP=idt0.strftime(fformatP)
if idir.startswith('/data/') and not ('link' in idir): #eolson/MEOPAR/SS36runs/CedarRuns/
sffT=idir+iffT
sffP=idir+iffP
elif idir.startswith('/results/') or idir.startswith('/results2/') or ('link' in idir):
sffT=idir+cdir+iffT
sffP=idir+cdir+iffP
print(sffT)
f=nc.Dataset(glob.glob(sffT)[0])
fP=nc.Dataset(glob.glob(sffP)[0])
#if idir==sdir0:
# e3t=np.expand_dims((1+fP.variables['sossheig'][0,:,:]/np.sum(e3t_0*tmask,1)),0)*e3t_0
if idir==sdir1:
e3t=fP.variables['e3t'][:2,:,:,:]
Vol=A*e3t
sumSi[ind,:,:]=1e-3*np.sum(tmaskC[0,:,:,:]*Vol[0,:,:,:]*f.variables['silicon'][0,:,:,:],0) #mmol/m3*m3*10^-3=mol
sumBSi[ind,:,:]=1e-3*np.sum(tmaskC[0,:,:,:]*Vol[0,:,:,:]*f.variables['biogenic_silicon'][0,:,:,:],0) #mmol/m3*m3*10^-3=mol
sumDiat[ind,:,:]=SiN*1e-3*np.sum(tmaskC[0,:,:,:]*Vol[0,:,:,:]*f.variables['diatoms'][0,:,:,:],0) #mmol/m3*m3*10^-3=mol
f.close()
fP.close()
SiGlobalTot[idir]=np.sum(np.sum(sumSi+sumBSi+sumDiat,2),1)
SiTot[idir]=np.sum(np.sum(sumSi,2),1)
BSiTot[idir]=np.sum(np.sum(sumBSi,2),1)
DiatTot[idir]=np.sum(np.sum(sumDiat,2),1)
changeSiGlobalTot[idir]=[SiGlobalTot[idir][ii+1]-SiGlobalTot[idir][ii] for ii in range(0,len(tlist)-1)]
/results2/SalishSea/nowcast-green.201905/01jan07/SalishSea_1h_20070101_20070101_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21jan07/SalishSea_1h_20070121_20070121_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10feb07/SalishSea_1h_20070210_20070210_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02mar07/SalishSea_1h_20070302_20070302_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22mar07/SalishSea_1h_20070322_20070322_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11apr07/SalishSea_1h_20070411_20070411_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01may07/SalishSea_1h_20070501_20070501_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21may07/SalishSea_1h_20070521_20070521_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10jun07/SalishSea_1h_20070610_20070610_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30jun07/SalishSea_1h_20070630_20070630_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20jul07/SalishSea_1h_20070720_20070720_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09aug07/SalishSea_1h_20070809_20070809_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29aug07/SalishSea_1h_20070829_20070829_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18sep07/SalishSea_1h_20070918_20070918_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08oct07/SalishSea_1h_20071008_20071008_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28oct07/SalishSea_1h_20071028_20071028_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17nov07/SalishSea_1h_20071117_20071117_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07dec07/SalishSea_1h_20071207_20071207_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27dec07/SalishSea_1h_20071227_20071227_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16jan08/SalishSea_1h_20080116_20080116_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05feb08/SalishSea_1h_20080205_20080205_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25feb08/SalishSea_1h_20080225_20080225_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16mar08/SalishSea_1h_20080316_20080316_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05apr08/SalishSea_1h_20080405_20080405_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25apr08/SalishSea_1h_20080425_20080425_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15may08/SalishSea_1h_20080515_20080515_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04jun08/SalishSea_1h_20080604_20080604_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24jun08/SalishSea_1h_20080624_20080624_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14jul08/SalishSea_1h_20080714_20080714_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03aug08/SalishSea_1h_20080803_20080803_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23aug08/SalishSea_1h_20080823_20080823_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12sep08/SalishSea_1h_20080912_20080912_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02oct08/SalishSea_1h_20081002_20081002_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22oct08/SalishSea_1h_20081022_20081022_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11nov08/SalishSea_1h_20081111_20081111_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01dec08/SalishSea_1h_20081201_20081201_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21dec08/SalishSea_1h_20081221_20081221_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10jan09/SalishSea_1h_20090110_20090110_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30jan09/SalishSea_1h_20090130_20090130_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19feb09/SalishSea_1h_20090219_20090219_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11mar09/SalishSea_1h_20090311_20090311_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/31mar09/SalishSea_1h_20090331_20090331_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20apr09/SalishSea_1h_20090420_20090420_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10may09/SalishSea_1h_20090510_20090510_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30may09/SalishSea_1h_20090530_20090530_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19jun09/SalishSea_1h_20090619_20090619_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09jul09/SalishSea_1h_20090709_20090709_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29jul09/SalishSea_1h_20090729_20090729_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18aug09/SalishSea_1h_20090818_20090818_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07sep09/SalishSea_1h_20090907_20090907_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27sep09/SalishSea_1h_20090927_20090927_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17oct09/SalishSea_1h_20091017_20091017_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06nov09/SalishSea_1h_20091106_20091106_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26nov09/SalishSea_1h_20091126_20091126_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16dec09/SalishSea_1h_20091216_20091216_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05jan10/SalishSea_1h_20100105_20100105_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25jan10/SalishSea_1h_20100125_20100125_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14feb10/SalishSea_1h_20100214_20100214_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06mar10/SalishSea_1h_20100306_20100306_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26mar10/SalishSea_1h_20100326_20100326_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15apr10/SalishSea_1h_20100415_20100415_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05may10/SalishSea_1h_20100505_20100505_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25may10/SalishSea_1h_20100525_20100525_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14jun10/SalishSea_1h_20100614_20100614_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04jul10/SalishSea_1h_20100704_20100704_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24jul10/SalishSea_1h_20100724_20100724_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13aug10/SalishSea_1h_20100813_20100813_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02sep10/SalishSea_1h_20100902_20100902_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22sep10/SalishSea_1h_20100922_20100922_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12oct10/SalishSea_1h_20101012_20101012_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01nov10/SalishSea_1h_20101101_20101101_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21nov10/SalishSea_1h_20101121_20101121_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11dec10/SalishSea_1h_20101211_20101211_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/31dec10/SalishSea_1h_20101231_20101231_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20jan11/SalishSea_1h_20110120_20110120_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09feb11/SalishSea_1h_20110209_20110209_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01mar11/SalishSea_1h_20110301_20110301_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21mar11/SalishSea_1h_20110321_20110321_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10apr11/SalishSea_1h_20110410_20110410_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30apr11/SalishSea_1h_20110430_20110430_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20may11/SalishSea_1h_20110520_20110520_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09jun11/SalishSea_1h_20110609_20110609_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29jun11/SalishSea_1h_20110629_20110629_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19jul11/SalishSea_1h_20110719_20110719_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08aug11/SalishSea_1h_20110808_20110808_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28aug11/SalishSea_1h_20110828_20110828_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17sep11/SalishSea_1h_20110917_20110917_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07oct11/SalishSea_1h_20111007_20111007_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27oct11/SalishSea_1h_20111027_20111027_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16nov11/SalishSea_1h_20111116_20111116_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06dec11/SalishSea_1h_20111206_20111206_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26dec11/SalishSea_1h_20111226_20111226_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15jan12/SalishSea_1h_20120115_20120115_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04feb12/SalishSea_1h_20120204_20120204_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24feb12/SalishSea_1h_20120224_20120224_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15mar12/SalishSea_1h_20120315_20120315_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04apr12/SalishSea_1h_20120404_20120404_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24apr12/SalishSea_1h_20120424_20120424_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14may12/SalishSea_1h_20120514_20120514_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03jun12/SalishSea_1h_20120603_20120603_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23jun12/SalishSea_1h_20120623_20120623_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13jul12/SalishSea_1h_20120713_20120713_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02aug12/SalishSea_1h_20120802_20120802_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22aug12/SalishSea_1h_20120822_20120822_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11sep12/SalishSea_1h_20120911_20120911_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01oct12/SalishSea_1h_20121001_20121001_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21oct12/SalishSea_1h_20121021_20121021_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10nov12/SalishSea_1h_20121110_20121110_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30nov12/SalishSea_1h_20121130_20121130_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20dec12/SalishSea_1h_20121220_20121220_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09jan13/SalishSea_1h_20130109_20130109_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29jan13/SalishSea_1h_20130129_20130129_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18feb13/SalishSea_1h_20130218_20130218_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10mar13/SalishSea_1h_20130310_20130310_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30mar13/SalishSea_1h_20130330_20130330_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19apr13/SalishSea_1h_20130419_20130419_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09may13/SalishSea_1h_20130509_20130509_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29may13/SalishSea_1h_20130529_20130529_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18jun13/SalishSea_1h_20130618_20130618_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08jul13/SalishSea_1h_20130708_20130708_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28jul13/SalishSea_1h_20130728_20130728_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17aug13/SalishSea_1h_20130817_20130817_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06sep13/SalishSea_1h_20130906_20130906_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26sep13/SalishSea_1h_20130926_20130926_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16oct13/SalishSea_1h_20131016_20131016_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05nov13/SalishSea_1h_20131105_20131105_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25nov13/SalishSea_1h_20131125_20131125_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15dec13/SalishSea_1h_20131215_20131215_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04jan14/SalishSea_1h_20140104_20140104_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24jan14/SalishSea_1h_20140124_20140124_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13feb14/SalishSea_1h_20140213_20140213_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05mar14/SalishSea_1h_20140305_20140305_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25mar14/SalishSea_1h_20140325_20140325_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14apr14/SalishSea_1h_20140414_20140414_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04may14/SalishSea_1h_20140504_20140504_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24may14/SalishSea_1h_20140524_20140524_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13jun14/SalishSea_1h_20140613_20140613_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03jul14/SalishSea_1h_20140703_20140703_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23jul14/SalishSea_1h_20140723_20140723_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12aug14/SalishSea_1h_20140812_20140812_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01sep14/SalishSea_1h_20140901_20140901_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21sep14/SalishSea_1h_20140921_20140921_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11oct14/SalishSea_1h_20141011_20141011_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/31oct14/SalishSea_1h_20141031_20141031_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20nov14/SalishSea_1h_20141120_20141120_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10dec14/SalishSea_1h_20141210_20141210_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30dec14/SalishSea_1h_20141230_20141230_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19jan15/SalishSea_1h_20150119_20150119_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08feb15/SalishSea_1h_20150208_20150208_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28feb15/SalishSea_1h_20150228_20150228_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20mar15/SalishSea_1h_20150320_20150320_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09apr15/SalishSea_1h_20150409_20150409_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29apr15/SalishSea_1h_20150429_20150429_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19may15/SalishSea_1h_20150519_20150519_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08jun15/SalishSea_1h_20150608_20150608_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28jun15/SalishSea_1h_20150628_20150628_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18jul15/SalishSea_1h_20150718_20150718_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07aug15/SalishSea_1h_20150807_20150807_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27aug15/SalishSea_1h_20150827_20150827_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16sep15/SalishSea_1h_20150916_20150916_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06oct15/SalishSea_1h_20151006_20151006_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26oct15/SalishSea_1h_20151026_20151026_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15nov15/SalishSea_1h_20151115_20151115_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05dec15/SalishSea_1h_20151205_20151205_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25dec15/SalishSea_1h_20151225_20151225_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14jan16/SalishSea_1h_20160114_20160114_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03feb16/SalishSea_1h_20160203_20160203_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23feb16/SalishSea_1h_20160223_20160223_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14mar16/SalishSea_1h_20160314_20160314_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03apr16/SalishSea_1h_20160403_20160403_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23apr16/SalishSea_1h_20160423_20160423_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13may16/SalishSea_1h_20160513_20160513_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02jun16/SalishSea_1h_20160602_20160602_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22jun16/SalishSea_1h_20160622_20160622_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12jul16/SalishSea_1h_20160712_20160712_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01aug16/SalishSea_1h_20160801_20160801_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21aug16/SalishSea_1h_20160821_20160821_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10sep16/SalishSea_1h_20160910_20160910_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30sep16/SalishSea_1h_20160930_20160930_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20oct16/SalishSea_1h_20161020_20161020_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09nov16/SalishSea_1h_20161109_20161109_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29nov16/SalishSea_1h_20161129_20161129_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19dec16/SalishSea_1h_20161219_20161219_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08jan17/SalishSea_1h_20170108_20170108_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28jan17/SalishSea_1h_20170128_20170128_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17feb17/SalishSea_1h_20170217_20170217_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09mar17/SalishSea_1h_20170309_20170309_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29mar17/SalishSea_1h_20170329_20170329_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18apr17/SalishSea_1h_20170418_20170418_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08may17/SalishSea_1h_20170508_20170508_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28may17/SalishSea_1h_20170528_20170528_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17jun17/SalishSea_1h_20170617_20170617_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07jul17/SalishSea_1h_20170707_20170707_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27jul17/SalishSea_1h_20170727_20170727_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16aug17/SalishSea_1h_20170816_20170816_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05sep17/SalishSea_1h_20170905_20170905_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25sep17/SalishSea_1h_20170925_20170925_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15oct17/SalishSea_1h_20171015_20171015_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04nov17/SalishSea_1h_20171104_20171104_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24nov17/SalishSea_1h_20171124_20171124_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14dec17/SalishSea_1h_20171214_20171214_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03jan18/SalishSea_1h_20180103_20180103_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23jan18/SalishSea_1h_20180123_20180123_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12feb18/SalishSea_1h_20180212_20180212_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04mar18/SalishSea_1h_20180304_20180304_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24mar18/SalishSea_1h_20180324_20180324_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13apr18/SalishSea_1h_20180413_20180413_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03may18/SalishSea_1h_20180503_20180503_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23may18/SalishSea_1h_20180523_20180523_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12jun18/SalishSea_1h_20180612_20180612_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02jul18/SalishSea_1h_20180702_20180702_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22jul18/SalishSea_1h_20180722_20180722_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11aug18/SalishSea_1h_20180811_20180811_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/31aug18/SalishSea_1h_20180831_20180831_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20sep18/SalishSea_1h_20180920_20180920_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10oct18/SalishSea_1h_20181010_20181010_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30oct18/SalishSea_1h_20181030_20181030_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19nov18/SalishSea_1h_20181119_20181119_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09dec18/SalishSea_1h_20181209_20181209_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29dec18/SalishSea_1h_20181229_20181229_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18jan19/SalishSea_1h_20190118_20190118_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07feb19/SalishSea_1h_20190207_20190207_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27feb19/SalishSea_1h_20190227_20190227_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19mar19/SalishSea_1h_20190319_20190319_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08apr19/SalishSea_1h_20190408_20190408_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28apr19/SalishSea_1h_20190428_20190428_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18may19/SalishSea_1h_20190518_20190518_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07jun19/SalishSea_1h_20190607_20190607_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27jun19/SalishSea_1h_20190627_20190627_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17jul19/SalishSea_1h_20190717_20190717_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06aug19/SalishSea_1h_20190806_20190806_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26aug19/SalishSea_1h_20190826_20190826_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15sep19/SalishSea_1h_20190915_20190915_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05oct19/SalishSea_1h_20191005_20191005_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25oct19/SalishSea_1h_20191025_20191025_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14nov19/SalishSea_1h_20191114_20191114_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04dec19/SalishSea_1h_20191204_20191204_ptrc_T.nc
klim=20
if recalc:
tlist=dlist
BSiTotS=dict()
DiatTotS=dict()
for idir in (sdir1,):
fformat1='%d%b%y/'
if idir.startswith('/data/eolson/MEOPAR/SS36runs/CedarRuns/'):
fformatT='SalishSea_1d_*_ptrc_T_%Y%m%d-*.nc'
fformatP='SalishSea_1d_*_ptrc_T_%Y%m%d-*.nc'
elif idir.startswith('/results'):
fformatT='SalishSea_1h_%Y%m%d_%Y%m%d_ptrc_T.nc'
fformatP='SalishSea_1h_%Y%m%d_%Y%m%d_carp_T.nc'
elif idir.startswith('/data/sallen/results/MEOPAR/202007/'):
fformatT='SalishSea_1d_????????_????????_ptrc_T_%Y%m%d-*.nc'
fformatP='SalishSea_1d_????????_????????_carp_T_%Y%m%d-*.nc'
else:
raise Exception('Name Error')
sumBSiS=np.zeros((len(tlist),stm[2],stm[3]))
sumDiatS=np.zeros((len(tlist),stm[2],stm[3]))
ind=-1
for idt0 in tlist:
ind=ind+1
cdir=idt0.strftime(fformat1).lower()
iffT=idt0.strftime(fformatT)
iffP=idt0.strftime(fformatP)
if idir.startswith('/data/') and not ('link' in idir): #eolson/MEOPAR/SS36runs/CedarRuns/
sffT=idir+iffT
sffP=idir+iffP
elif idir.startswith('/results') or ('link' in idir):
sffT=idir+cdir+iffT
sffP=idir+cdir+iffP
print(sffT)
f=nc.Dataset(glob.glob(sffT)[0])
fP=nc.Dataset(glob.glob(sffP)[0])
#if idir==sdir0:
# e3t=np.expand_dims((1+fP.variables['sossheig'][0,:,:]/np.sum(e3t_0*tmask,1)),0)*e3t_0
if idir==sdir1:
e3t=fP.variables['e3t'][:2,:,:,:]
Vol=A*e3t
sumBSiS[ind,:,:]=1e-3*np.sum(tmaskC[0,:klim,:,:]*Vol[0,:klim,:,:]*f.variables['biogenic_silicon'][0,:klim,:,:],0) #mmol/m3*m3*10^-3=mol
sumDiatS[ind,:,:]=SiN*1e-3*np.sum(tmaskC[0,:klim,:,:]*Vol[0,:klim,:,:]*f.variables['diatoms'][0,:klim,:,:],0) #mmol/m3*m3*10^-3=mol
f.close()
fP.close()
BSiTotS[idir]=np.sum(np.sum(sumBSiS,2),1)
DiatTotS[idir]=np.sum(np.sum(sumDiatS,2),1)
/results2/SalishSea/nowcast-green.201905/01jan07/SalishSea_1h_20070101_20070101_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21jan07/SalishSea_1h_20070121_20070121_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10feb07/SalishSea_1h_20070210_20070210_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02mar07/SalishSea_1h_20070302_20070302_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22mar07/SalishSea_1h_20070322_20070322_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11apr07/SalishSea_1h_20070411_20070411_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01may07/SalishSea_1h_20070501_20070501_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21may07/SalishSea_1h_20070521_20070521_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10jun07/SalishSea_1h_20070610_20070610_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30jun07/SalishSea_1h_20070630_20070630_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20jul07/SalishSea_1h_20070720_20070720_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09aug07/SalishSea_1h_20070809_20070809_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29aug07/SalishSea_1h_20070829_20070829_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18sep07/SalishSea_1h_20070918_20070918_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08oct07/SalishSea_1h_20071008_20071008_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28oct07/SalishSea_1h_20071028_20071028_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17nov07/SalishSea_1h_20071117_20071117_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07dec07/SalishSea_1h_20071207_20071207_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27dec07/SalishSea_1h_20071227_20071227_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16jan08/SalishSea_1h_20080116_20080116_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05feb08/SalishSea_1h_20080205_20080205_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25feb08/SalishSea_1h_20080225_20080225_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16mar08/SalishSea_1h_20080316_20080316_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05apr08/SalishSea_1h_20080405_20080405_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25apr08/SalishSea_1h_20080425_20080425_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15may08/SalishSea_1h_20080515_20080515_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04jun08/SalishSea_1h_20080604_20080604_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24jun08/SalishSea_1h_20080624_20080624_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14jul08/SalishSea_1h_20080714_20080714_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03aug08/SalishSea_1h_20080803_20080803_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23aug08/SalishSea_1h_20080823_20080823_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12sep08/SalishSea_1h_20080912_20080912_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02oct08/SalishSea_1h_20081002_20081002_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22oct08/SalishSea_1h_20081022_20081022_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11nov08/SalishSea_1h_20081111_20081111_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01dec08/SalishSea_1h_20081201_20081201_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21dec08/SalishSea_1h_20081221_20081221_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10jan09/SalishSea_1h_20090110_20090110_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30jan09/SalishSea_1h_20090130_20090130_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19feb09/SalishSea_1h_20090219_20090219_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11mar09/SalishSea_1h_20090311_20090311_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/31mar09/SalishSea_1h_20090331_20090331_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20apr09/SalishSea_1h_20090420_20090420_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10may09/SalishSea_1h_20090510_20090510_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30may09/SalishSea_1h_20090530_20090530_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19jun09/SalishSea_1h_20090619_20090619_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09jul09/SalishSea_1h_20090709_20090709_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29jul09/SalishSea_1h_20090729_20090729_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18aug09/SalishSea_1h_20090818_20090818_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07sep09/SalishSea_1h_20090907_20090907_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27sep09/SalishSea_1h_20090927_20090927_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17oct09/SalishSea_1h_20091017_20091017_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06nov09/SalishSea_1h_20091106_20091106_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26nov09/SalishSea_1h_20091126_20091126_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16dec09/SalishSea_1h_20091216_20091216_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05jan10/SalishSea_1h_20100105_20100105_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25jan10/SalishSea_1h_20100125_20100125_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14feb10/SalishSea_1h_20100214_20100214_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06mar10/SalishSea_1h_20100306_20100306_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26mar10/SalishSea_1h_20100326_20100326_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15apr10/SalishSea_1h_20100415_20100415_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05may10/SalishSea_1h_20100505_20100505_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25may10/SalishSea_1h_20100525_20100525_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14jun10/SalishSea_1h_20100614_20100614_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04jul10/SalishSea_1h_20100704_20100704_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24jul10/SalishSea_1h_20100724_20100724_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13aug10/SalishSea_1h_20100813_20100813_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02sep10/SalishSea_1h_20100902_20100902_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22sep10/SalishSea_1h_20100922_20100922_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12oct10/SalishSea_1h_20101012_20101012_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01nov10/SalishSea_1h_20101101_20101101_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21nov10/SalishSea_1h_20101121_20101121_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11dec10/SalishSea_1h_20101211_20101211_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/31dec10/SalishSea_1h_20101231_20101231_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20jan11/SalishSea_1h_20110120_20110120_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09feb11/SalishSea_1h_20110209_20110209_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01mar11/SalishSea_1h_20110301_20110301_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21mar11/SalishSea_1h_20110321_20110321_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10apr11/SalishSea_1h_20110410_20110410_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30apr11/SalishSea_1h_20110430_20110430_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20may11/SalishSea_1h_20110520_20110520_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09jun11/SalishSea_1h_20110609_20110609_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29jun11/SalishSea_1h_20110629_20110629_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19jul11/SalishSea_1h_20110719_20110719_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08aug11/SalishSea_1h_20110808_20110808_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28aug11/SalishSea_1h_20110828_20110828_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17sep11/SalishSea_1h_20110917_20110917_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07oct11/SalishSea_1h_20111007_20111007_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27oct11/SalishSea_1h_20111027_20111027_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16nov11/SalishSea_1h_20111116_20111116_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06dec11/SalishSea_1h_20111206_20111206_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26dec11/SalishSea_1h_20111226_20111226_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15jan12/SalishSea_1h_20120115_20120115_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04feb12/SalishSea_1h_20120204_20120204_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24feb12/SalishSea_1h_20120224_20120224_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15mar12/SalishSea_1h_20120315_20120315_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04apr12/SalishSea_1h_20120404_20120404_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24apr12/SalishSea_1h_20120424_20120424_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14may12/SalishSea_1h_20120514_20120514_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03jun12/SalishSea_1h_20120603_20120603_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23jun12/SalishSea_1h_20120623_20120623_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13jul12/SalishSea_1h_20120713_20120713_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02aug12/SalishSea_1h_20120802_20120802_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22aug12/SalishSea_1h_20120822_20120822_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11sep12/SalishSea_1h_20120911_20120911_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01oct12/SalishSea_1h_20121001_20121001_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21oct12/SalishSea_1h_20121021_20121021_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10nov12/SalishSea_1h_20121110_20121110_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30nov12/SalishSea_1h_20121130_20121130_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20dec12/SalishSea_1h_20121220_20121220_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09jan13/SalishSea_1h_20130109_20130109_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29jan13/SalishSea_1h_20130129_20130129_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18feb13/SalishSea_1h_20130218_20130218_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10mar13/SalishSea_1h_20130310_20130310_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30mar13/SalishSea_1h_20130330_20130330_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19apr13/SalishSea_1h_20130419_20130419_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09may13/SalishSea_1h_20130509_20130509_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29may13/SalishSea_1h_20130529_20130529_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18jun13/SalishSea_1h_20130618_20130618_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08jul13/SalishSea_1h_20130708_20130708_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28jul13/SalishSea_1h_20130728_20130728_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17aug13/SalishSea_1h_20130817_20130817_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06sep13/SalishSea_1h_20130906_20130906_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26sep13/SalishSea_1h_20130926_20130926_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16oct13/SalishSea_1h_20131016_20131016_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05nov13/SalishSea_1h_20131105_20131105_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25nov13/SalishSea_1h_20131125_20131125_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15dec13/SalishSea_1h_20131215_20131215_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04jan14/SalishSea_1h_20140104_20140104_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24jan14/SalishSea_1h_20140124_20140124_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13feb14/SalishSea_1h_20140213_20140213_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05mar14/SalishSea_1h_20140305_20140305_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25mar14/SalishSea_1h_20140325_20140325_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14apr14/SalishSea_1h_20140414_20140414_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04may14/SalishSea_1h_20140504_20140504_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24may14/SalishSea_1h_20140524_20140524_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13jun14/SalishSea_1h_20140613_20140613_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03jul14/SalishSea_1h_20140703_20140703_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23jul14/SalishSea_1h_20140723_20140723_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12aug14/SalishSea_1h_20140812_20140812_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01sep14/SalishSea_1h_20140901_20140901_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21sep14/SalishSea_1h_20140921_20140921_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11oct14/SalishSea_1h_20141011_20141011_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/31oct14/SalishSea_1h_20141031_20141031_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20nov14/SalishSea_1h_20141120_20141120_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10dec14/SalishSea_1h_20141210_20141210_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30dec14/SalishSea_1h_20141230_20141230_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19jan15/SalishSea_1h_20150119_20150119_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08feb15/SalishSea_1h_20150208_20150208_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28feb15/SalishSea_1h_20150228_20150228_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20mar15/SalishSea_1h_20150320_20150320_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09apr15/SalishSea_1h_20150409_20150409_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29apr15/SalishSea_1h_20150429_20150429_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19may15/SalishSea_1h_20150519_20150519_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08jun15/SalishSea_1h_20150608_20150608_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28jun15/SalishSea_1h_20150628_20150628_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18jul15/SalishSea_1h_20150718_20150718_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07aug15/SalishSea_1h_20150807_20150807_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27aug15/SalishSea_1h_20150827_20150827_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16sep15/SalishSea_1h_20150916_20150916_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06oct15/SalishSea_1h_20151006_20151006_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26oct15/SalishSea_1h_20151026_20151026_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15nov15/SalishSea_1h_20151115_20151115_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05dec15/SalishSea_1h_20151205_20151205_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25dec15/SalishSea_1h_20151225_20151225_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14jan16/SalishSea_1h_20160114_20160114_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03feb16/SalishSea_1h_20160203_20160203_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23feb16/SalishSea_1h_20160223_20160223_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14mar16/SalishSea_1h_20160314_20160314_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03apr16/SalishSea_1h_20160403_20160403_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23apr16/SalishSea_1h_20160423_20160423_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13may16/SalishSea_1h_20160513_20160513_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02jun16/SalishSea_1h_20160602_20160602_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22jun16/SalishSea_1h_20160622_20160622_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12jul16/SalishSea_1h_20160712_20160712_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01aug16/SalishSea_1h_20160801_20160801_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21aug16/SalishSea_1h_20160821_20160821_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10sep16/SalishSea_1h_20160910_20160910_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30sep16/SalishSea_1h_20160930_20160930_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20oct16/SalishSea_1h_20161020_20161020_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09nov16/SalishSea_1h_20161109_20161109_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29nov16/SalishSea_1h_20161129_20161129_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19dec16/SalishSea_1h_20161219_20161219_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08jan17/SalishSea_1h_20170108_20170108_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28jan17/SalishSea_1h_20170128_20170128_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17feb17/SalishSea_1h_20170217_20170217_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09mar17/SalishSea_1h_20170309_20170309_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29mar17/SalishSea_1h_20170329_20170329_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18apr17/SalishSea_1h_20170418_20170418_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08may17/SalishSea_1h_20170508_20170508_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28may17/SalishSea_1h_20170528_20170528_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17jun17/SalishSea_1h_20170617_20170617_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07jul17/SalishSea_1h_20170707_20170707_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27jul17/SalishSea_1h_20170727_20170727_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16aug17/SalishSea_1h_20170816_20170816_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05sep17/SalishSea_1h_20170905_20170905_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25sep17/SalishSea_1h_20170925_20170925_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15oct17/SalishSea_1h_20171015_20171015_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04nov17/SalishSea_1h_20171104_20171104_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24nov17/SalishSea_1h_20171124_20171124_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14dec17/SalishSea_1h_20171214_20171214_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03jan18/SalishSea_1h_20180103_20180103_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23jan18/SalishSea_1h_20180123_20180123_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12feb18/SalishSea_1h_20180212_20180212_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04mar18/SalishSea_1h_20180304_20180304_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24mar18/SalishSea_1h_20180324_20180324_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13apr18/SalishSea_1h_20180413_20180413_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03may18/SalishSea_1h_20180503_20180503_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23may18/SalishSea_1h_20180523_20180523_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12jun18/SalishSea_1h_20180612_20180612_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02jul18/SalishSea_1h_20180702_20180702_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22jul18/SalishSea_1h_20180722_20180722_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11aug18/SalishSea_1h_20180811_20180811_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/31aug18/SalishSea_1h_20180831_20180831_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20sep18/SalishSea_1h_20180920_20180920_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10oct18/SalishSea_1h_20181010_20181010_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30oct18/SalishSea_1h_20181030_20181030_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19nov18/SalishSea_1h_20181119_20181119_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09dec18/SalishSea_1h_20181209_20181209_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29dec18/SalishSea_1h_20181229_20181229_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18jan19/SalishSea_1h_20190118_20190118_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07feb19/SalishSea_1h_20190207_20190207_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27feb19/SalishSea_1h_20190227_20190227_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19mar19/SalishSea_1h_20190319_20190319_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08apr19/SalishSea_1h_20190408_20190408_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28apr19/SalishSea_1h_20190428_20190428_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18may19/SalishSea_1h_20190518_20190518_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07jun19/SalishSea_1h_20190607_20190607_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27jun19/SalishSea_1h_20190627_20190627_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17jul19/SalishSea_1h_20190717_20190717_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06aug19/SalishSea_1h_20190806_20190806_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26aug19/SalishSea_1h_20190826_20190826_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15sep19/SalishSea_1h_20190915_20190915_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05oct19/SalishSea_1h_20191005_20191005_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25oct19/SalishSea_1h_20191025_20191025_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14nov19/SalishSea_1h_20191114_20191114_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04dec19/SalishSea_1h_20191204_20191204_ptrc_T.nc
#test=np.sum(np.sum((sumSi[-1,:,:]+np.sum(1e-3*7*tmaskC[0,:,:,:]*Vol[0,:,:,:],0))+sumBSi[-1,:,:]+sumDiat[-1,:,:],1),0)
#test2=np.sum(np.sum(sumSi[-1,:,:]+sumBSi[-1,:,:]+sumDiat[-1,:,:],1),0)
if recalc:
fig,ax=plt.subplots(1,1,figsize=(6,5))
ax.plot(SiGlobalTot[sdir1]-SiGlobalTot[sdir1][0],'b-')
ax.set_xlabel('10-day intervals since '+t0.strftime('%b $d $Y'))
ax.set_ylabel('Difference in Total Si')
if recalc:
## plots related to sinking
fig,ax=plt.subplots(1,1,figsize=(18,5))
ax.plot(BSiTot[sdir1],'r-',label='bSi')
ax.plot(DiatTot[sdir1],'b-',label='diatoms')
ax.set_xlabel('10-day intervals since '+t0.strftime('%b $d $Y'))
ax.legend()
if recalc:
## plots related to sinking
fig,ax=plt.subplots(1,1,figsize=(18,5))
ax.plot(BSiTotS[sdir1],'r-',label='bSi')
ax.plot(DiatTotS[sdir1],'b-',label='diatoms')
ax.set_xlabel('10-day intervals since '+t0.strftime('%b $d $Y'))
ax.legend()
if recalc:
fig,ax=plt.subplots(1,1,figsize=(18,5))
ax.plot((BSiTot[sdir1]-np.mean(BSiTot[sdir1]))/np.std(BSiTot[sdir1]),'r-',label='bSi all')
ax.plot((BSiTotS[sdir1]-np.mean(BSiTotS[sdir1]))/np.std(BSiTotS[sdir1]),'r--',label='bSi surf')
ax.plot((BSiTot[sdir1])/np.std(BSiTot[sdir1]),'r:',label='bSi norm')
ax.plot(np.tanh(.5*(BSiTot[sdir1])/np.std(BSiTot[sdir1])),'b-',label='limiter')
ax.plot(np.tanh(.5*(BSiTot[sdir1])/1000000000),'g-',label='limiter2')
ax.plot(np.tanh(.5*(BSiTotS[sdir1])/200000000),'c-',label='limiter2')
ax.set_xlabel('10-day intervals since '+t0.strftime('%b $d $Y'))
ax.legend()
print('std err total bsi is:',np.std(BSiTot[sdir1]))
print(' std err 20m bsi is:',np.std(BSiTotS[sdir1]))
std err total bsi is: 1894820282.977223 std err 20m bsi is: 180413085.64805856
# for bSi sinking rate, use:
# wmin+tanh(.5*bSi_20_sum/200000000)*(wmax-wmin)
# need to use cvol = e3t* e1t* e2t, so update code above...
# copy restart and add 7 to Si old and new
if recalc:
tlist=dlist
NGlobalTot=dict()
VolTot=dict()
NO3Tot=dict()
NH4Tot=dict()
PONTot=dict()
DONTot=dict()
DiatTot=dict()
MyriTot=dict()
NanoTot=dict()
MiZoTot=dict()
changeNGlobalTot=dict()
for idir in (sdir1,):
fformat1='%d%b%y/'
if idir.startswith('/data/eolson/MEOPAR/SS36runs/CedarRuns/'):
fformatT='SalishSea_1d_*_ptrc_T_%Y%m%d-*.nc'
fformatP='SalishSea_1d_*_ptrc_T_%Y%m%d-*.nc'
elif idir.startswith('/results'):
fformatT='SalishSea_1h_%Y%m%d_%Y%m%d_ptrc_T.nc'
fformatP='SalishSea_1h_%Y%m%d_%Y%m%d_carp_T.nc'
elif idir.startswith('/data/sallen/results/MEOPAR/202007/'):
fformatT='SalishSea_1d_????????_????????_ptrc_T_%Y%m%d-*.nc'
fformatP='SalishSea_1d_????????_????????_carp_T_%Y%m%d-*.nc'
else:
raise Exception('Name Error')
sumNO3=np.zeros((len(tlist),stm[2],stm[3]))
sumVol=np.zeros((len(tlist),stm[2],stm[3]))
sumNH4=np.zeros((len(tlist),stm[2],stm[3]))
sumPON=np.zeros((len(tlist),stm[2],stm[3]))
sumDON=np.zeros((len(tlist),stm[2],stm[3]))
sumDiat=np.zeros((len(tlist),stm[2],stm[3]))
sumMyri=np.zeros((len(tlist),stm[2],stm[3]))
sumNano=np.zeros((len(tlist),stm[2],stm[3]))
sumMiZo=np.zeros((len(tlist),stm[2],stm[3]))
ind=-1
for idt0 in tlist:
ind=ind+1
cdir=idt0.strftime(fformat1).lower()
iffT=idt0.strftime(fformatT)
iffP=idt0.strftime(fformatP)
if idir.startswith('/data/') and not ('link' in idir): #eolson/MEOPAR/SS36runs/CedarRuns/'):
sffT=idir+iffT
sffP=idir+iffP
elif idir.startswith('/results/') or idir.startswith('/results2/') or ('link' in idir):
sffT=idir+cdir+iffT
sffP=idir+cdir+iffP
print(sffT)
f=nc.Dataset(glob.glob(sffT)[0])
fP=nc.Dataset(glob.glob(sffP)[0])
#if idir==sdir0:
# e3t=np.expand_dims((1+fP.variables['sossheig'][0,:,:]/np.sum(e3t_0*tmask,1)),0)*e3t_0
if idir==sdir1:
e3t=fP.variables['e3t'][:2,:,:,:]
Vol=A*e3t
sumVol[ind,:,:]=1e-3*np.sum(tmaskC[0,:,:,:]*Vol[0,:,:,:],0) #mmol/m3*m3*10^-3=mol
sumNO3[ind,:,:]=1e-3*np.sum(tmaskC[0,:,:,:]*Vol[0,:,:,:]*f.variables['nitrate'][0,:,:,:],0) #mmol/m3*m3*10^-3=mol
sumNH4[ind,:,:]=1e-3*np.sum(tmaskC[0,:,:,:]*Vol[0,:,:,:]*f.variables['ammonium'][0,:,:,:],0) #mmol/m3*m3*10^-3=mol
sumPON[ind,:,:]=1e-3*np.sum(tmaskC[0,:,:,:]*Vol[0,:,:,:]*f.variables['particulate_organic_nitrogen'][0,:,:,:],0) #mmol/m3*m3*10^-3=mol
sumDON[ind,:,:]=1e-3*np.sum(tmaskC[0,:,:,:]*Vol[0,:,:,:]*f.variables['dissolved_organic_nitrogen'][0,:,:,:],0) #mmol/m3*m3*10^-3=mol
sumDiat[ind,:,:]=1e-3*np.sum(tmaskC[0,:,:,:]*Vol[0,:,:,:]*f.variables['diatoms'][0,:,:,:],0) #mmol/m3*m3*10^-3=mol
sumMyri[ind,:,:]=1e-3*np.sum(tmaskC[0,:,:,:]*Vol[0,:,:,:]*f.variables['ciliates'][0,:,:,:],0) #mmol/m3*m3*10^-3=mol
sumMiZo[ind,:,:]=1e-3*np.sum(tmaskC[0,:,:,:]*Vol[0,:,:,:]*f.variables['microzooplankton'][0,:,:,:],0) #mmol/m3*m3*10^-3=mol
f.close()
fP.close()
NGlobalTot[idir]=np.sum(np.sum(sumNO3+sumNH4+sumPON+sumDON+sumDiat+sumMyri+sumNano+sumMiZo,2),1)
VolTot[idir]=np.sum(np.sum(sumVol,2),1)
NO3Tot[idir]=np.sum(np.sum(sumNO3,2),1)
NH4Tot[idir]=np.sum(np.sum(sumNH4,2),1)
PONTot[idir]=np.sum(np.sum(sumPON,2),1)
DONTot[idir]=np.sum(np.sum(sumDON,2),1)
DiatTot[idir]=np.sum(np.sum(sumDiat,2),1)
MyriTot[idir]=np.sum(np.sum(sumMyri,2),1)
NanoTot[idir]=np.sum(np.sum(sumNano,2),1)
MiZoTot[idir]=np.sum(np.sum(sumMiZo,2),1)
changeNGlobalTot[idir]=[NGlobalTot[idir][ii+1]-NGlobalTot[idir][ii] for ii in range(0,len(tlist)-1)]
/results2/SalishSea/nowcast-green.201905/01jan07/SalishSea_1h_20070101_20070101_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21jan07/SalishSea_1h_20070121_20070121_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10feb07/SalishSea_1h_20070210_20070210_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02mar07/SalishSea_1h_20070302_20070302_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22mar07/SalishSea_1h_20070322_20070322_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11apr07/SalishSea_1h_20070411_20070411_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01may07/SalishSea_1h_20070501_20070501_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21may07/SalishSea_1h_20070521_20070521_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10jun07/SalishSea_1h_20070610_20070610_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30jun07/SalishSea_1h_20070630_20070630_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20jul07/SalishSea_1h_20070720_20070720_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09aug07/SalishSea_1h_20070809_20070809_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29aug07/SalishSea_1h_20070829_20070829_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18sep07/SalishSea_1h_20070918_20070918_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08oct07/SalishSea_1h_20071008_20071008_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28oct07/SalishSea_1h_20071028_20071028_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17nov07/SalishSea_1h_20071117_20071117_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07dec07/SalishSea_1h_20071207_20071207_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27dec07/SalishSea_1h_20071227_20071227_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16jan08/SalishSea_1h_20080116_20080116_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05feb08/SalishSea_1h_20080205_20080205_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25feb08/SalishSea_1h_20080225_20080225_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16mar08/SalishSea_1h_20080316_20080316_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05apr08/SalishSea_1h_20080405_20080405_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25apr08/SalishSea_1h_20080425_20080425_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15may08/SalishSea_1h_20080515_20080515_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04jun08/SalishSea_1h_20080604_20080604_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24jun08/SalishSea_1h_20080624_20080624_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14jul08/SalishSea_1h_20080714_20080714_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03aug08/SalishSea_1h_20080803_20080803_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23aug08/SalishSea_1h_20080823_20080823_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12sep08/SalishSea_1h_20080912_20080912_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02oct08/SalishSea_1h_20081002_20081002_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22oct08/SalishSea_1h_20081022_20081022_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11nov08/SalishSea_1h_20081111_20081111_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01dec08/SalishSea_1h_20081201_20081201_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21dec08/SalishSea_1h_20081221_20081221_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10jan09/SalishSea_1h_20090110_20090110_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30jan09/SalishSea_1h_20090130_20090130_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19feb09/SalishSea_1h_20090219_20090219_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11mar09/SalishSea_1h_20090311_20090311_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/31mar09/SalishSea_1h_20090331_20090331_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20apr09/SalishSea_1h_20090420_20090420_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10may09/SalishSea_1h_20090510_20090510_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30may09/SalishSea_1h_20090530_20090530_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19jun09/SalishSea_1h_20090619_20090619_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09jul09/SalishSea_1h_20090709_20090709_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29jul09/SalishSea_1h_20090729_20090729_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18aug09/SalishSea_1h_20090818_20090818_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07sep09/SalishSea_1h_20090907_20090907_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27sep09/SalishSea_1h_20090927_20090927_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17oct09/SalishSea_1h_20091017_20091017_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06nov09/SalishSea_1h_20091106_20091106_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26nov09/SalishSea_1h_20091126_20091126_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16dec09/SalishSea_1h_20091216_20091216_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05jan10/SalishSea_1h_20100105_20100105_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25jan10/SalishSea_1h_20100125_20100125_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14feb10/SalishSea_1h_20100214_20100214_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06mar10/SalishSea_1h_20100306_20100306_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26mar10/SalishSea_1h_20100326_20100326_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15apr10/SalishSea_1h_20100415_20100415_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05may10/SalishSea_1h_20100505_20100505_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25may10/SalishSea_1h_20100525_20100525_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14jun10/SalishSea_1h_20100614_20100614_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04jul10/SalishSea_1h_20100704_20100704_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24jul10/SalishSea_1h_20100724_20100724_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13aug10/SalishSea_1h_20100813_20100813_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02sep10/SalishSea_1h_20100902_20100902_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22sep10/SalishSea_1h_20100922_20100922_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12oct10/SalishSea_1h_20101012_20101012_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01nov10/SalishSea_1h_20101101_20101101_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21nov10/SalishSea_1h_20101121_20101121_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11dec10/SalishSea_1h_20101211_20101211_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/31dec10/SalishSea_1h_20101231_20101231_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20jan11/SalishSea_1h_20110120_20110120_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09feb11/SalishSea_1h_20110209_20110209_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01mar11/SalishSea_1h_20110301_20110301_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21mar11/SalishSea_1h_20110321_20110321_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10apr11/SalishSea_1h_20110410_20110410_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30apr11/SalishSea_1h_20110430_20110430_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20may11/SalishSea_1h_20110520_20110520_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09jun11/SalishSea_1h_20110609_20110609_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29jun11/SalishSea_1h_20110629_20110629_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19jul11/SalishSea_1h_20110719_20110719_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08aug11/SalishSea_1h_20110808_20110808_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28aug11/SalishSea_1h_20110828_20110828_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17sep11/SalishSea_1h_20110917_20110917_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07oct11/SalishSea_1h_20111007_20111007_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27oct11/SalishSea_1h_20111027_20111027_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16nov11/SalishSea_1h_20111116_20111116_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06dec11/SalishSea_1h_20111206_20111206_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26dec11/SalishSea_1h_20111226_20111226_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15jan12/SalishSea_1h_20120115_20120115_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04feb12/SalishSea_1h_20120204_20120204_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24feb12/SalishSea_1h_20120224_20120224_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15mar12/SalishSea_1h_20120315_20120315_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04apr12/SalishSea_1h_20120404_20120404_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24apr12/SalishSea_1h_20120424_20120424_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14may12/SalishSea_1h_20120514_20120514_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03jun12/SalishSea_1h_20120603_20120603_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23jun12/SalishSea_1h_20120623_20120623_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13jul12/SalishSea_1h_20120713_20120713_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02aug12/SalishSea_1h_20120802_20120802_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22aug12/SalishSea_1h_20120822_20120822_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11sep12/SalishSea_1h_20120911_20120911_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01oct12/SalishSea_1h_20121001_20121001_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21oct12/SalishSea_1h_20121021_20121021_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10nov12/SalishSea_1h_20121110_20121110_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30nov12/SalishSea_1h_20121130_20121130_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20dec12/SalishSea_1h_20121220_20121220_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09jan13/SalishSea_1h_20130109_20130109_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29jan13/SalishSea_1h_20130129_20130129_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18feb13/SalishSea_1h_20130218_20130218_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10mar13/SalishSea_1h_20130310_20130310_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30mar13/SalishSea_1h_20130330_20130330_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19apr13/SalishSea_1h_20130419_20130419_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09may13/SalishSea_1h_20130509_20130509_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29may13/SalishSea_1h_20130529_20130529_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18jun13/SalishSea_1h_20130618_20130618_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08jul13/SalishSea_1h_20130708_20130708_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28jul13/SalishSea_1h_20130728_20130728_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17aug13/SalishSea_1h_20130817_20130817_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06sep13/SalishSea_1h_20130906_20130906_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26sep13/SalishSea_1h_20130926_20130926_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16oct13/SalishSea_1h_20131016_20131016_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05nov13/SalishSea_1h_20131105_20131105_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25nov13/SalishSea_1h_20131125_20131125_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15dec13/SalishSea_1h_20131215_20131215_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04jan14/SalishSea_1h_20140104_20140104_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24jan14/SalishSea_1h_20140124_20140124_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13feb14/SalishSea_1h_20140213_20140213_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05mar14/SalishSea_1h_20140305_20140305_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25mar14/SalishSea_1h_20140325_20140325_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14apr14/SalishSea_1h_20140414_20140414_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04may14/SalishSea_1h_20140504_20140504_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24may14/SalishSea_1h_20140524_20140524_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13jun14/SalishSea_1h_20140613_20140613_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03jul14/SalishSea_1h_20140703_20140703_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23jul14/SalishSea_1h_20140723_20140723_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12aug14/SalishSea_1h_20140812_20140812_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01sep14/SalishSea_1h_20140901_20140901_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21sep14/SalishSea_1h_20140921_20140921_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11oct14/SalishSea_1h_20141011_20141011_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/31oct14/SalishSea_1h_20141031_20141031_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20nov14/SalishSea_1h_20141120_20141120_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10dec14/SalishSea_1h_20141210_20141210_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30dec14/SalishSea_1h_20141230_20141230_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19jan15/SalishSea_1h_20150119_20150119_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08feb15/SalishSea_1h_20150208_20150208_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28feb15/SalishSea_1h_20150228_20150228_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20mar15/SalishSea_1h_20150320_20150320_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09apr15/SalishSea_1h_20150409_20150409_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29apr15/SalishSea_1h_20150429_20150429_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19may15/SalishSea_1h_20150519_20150519_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08jun15/SalishSea_1h_20150608_20150608_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28jun15/SalishSea_1h_20150628_20150628_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18jul15/SalishSea_1h_20150718_20150718_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07aug15/SalishSea_1h_20150807_20150807_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27aug15/SalishSea_1h_20150827_20150827_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16sep15/SalishSea_1h_20150916_20150916_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06oct15/SalishSea_1h_20151006_20151006_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26oct15/SalishSea_1h_20151026_20151026_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15nov15/SalishSea_1h_20151115_20151115_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05dec15/SalishSea_1h_20151205_20151205_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25dec15/SalishSea_1h_20151225_20151225_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14jan16/SalishSea_1h_20160114_20160114_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03feb16/SalishSea_1h_20160203_20160203_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23feb16/SalishSea_1h_20160223_20160223_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14mar16/SalishSea_1h_20160314_20160314_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03apr16/SalishSea_1h_20160403_20160403_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23apr16/SalishSea_1h_20160423_20160423_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13may16/SalishSea_1h_20160513_20160513_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02jun16/SalishSea_1h_20160602_20160602_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22jun16/SalishSea_1h_20160622_20160622_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12jul16/SalishSea_1h_20160712_20160712_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/01aug16/SalishSea_1h_20160801_20160801_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/21aug16/SalishSea_1h_20160821_20160821_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10sep16/SalishSea_1h_20160910_20160910_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30sep16/SalishSea_1h_20160930_20160930_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20oct16/SalishSea_1h_20161020_20161020_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09nov16/SalishSea_1h_20161109_20161109_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29nov16/SalishSea_1h_20161129_20161129_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19dec16/SalishSea_1h_20161219_20161219_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08jan17/SalishSea_1h_20170108_20170108_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28jan17/SalishSea_1h_20170128_20170128_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17feb17/SalishSea_1h_20170217_20170217_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09mar17/SalishSea_1h_20170309_20170309_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29mar17/SalishSea_1h_20170329_20170329_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18apr17/SalishSea_1h_20170418_20170418_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08may17/SalishSea_1h_20170508_20170508_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28may17/SalishSea_1h_20170528_20170528_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17jun17/SalishSea_1h_20170617_20170617_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07jul17/SalishSea_1h_20170707_20170707_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27jul17/SalishSea_1h_20170727_20170727_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/16aug17/SalishSea_1h_20170816_20170816_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05sep17/SalishSea_1h_20170905_20170905_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25sep17/SalishSea_1h_20170925_20170925_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15oct17/SalishSea_1h_20171015_20171015_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04nov17/SalishSea_1h_20171104_20171104_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24nov17/SalishSea_1h_20171124_20171124_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14dec17/SalishSea_1h_20171214_20171214_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03jan18/SalishSea_1h_20180103_20180103_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23jan18/SalishSea_1h_20180123_20180123_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12feb18/SalishSea_1h_20180212_20180212_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04mar18/SalishSea_1h_20180304_20180304_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/24mar18/SalishSea_1h_20180324_20180324_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/13apr18/SalishSea_1h_20180413_20180413_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/03may18/SalishSea_1h_20180503_20180503_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/23may18/SalishSea_1h_20180523_20180523_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/12jun18/SalishSea_1h_20180612_20180612_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/02jul18/SalishSea_1h_20180702_20180702_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/22jul18/SalishSea_1h_20180722_20180722_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/11aug18/SalishSea_1h_20180811_20180811_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/31aug18/SalishSea_1h_20180831_20180831_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/20sep18/SalishSea_1h_20180920_20180920_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/10oct18/SalishSea_1h_20181010_20181010_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/30oct18/SalishSea_1h_20181030_20181030_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19nov18/SalishSea_1h_20181119_20181119_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/09dec18/SalishSea_1h_20181209_20181209_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/29dec18/SalishSea_1h_20181229_20181229_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18jan19/SalishSea_1h_20190118_20190118_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07feb19/SalishSea_1h_20190207_20190207_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27feb19/SalishSea_1h_20190227_20190227_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/19mar19/SalishSea_1h_20190319_20190319_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/08apr19/SalishSea_1h_20190408_20190408_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/28apr19/SalishSea_1h_20190428_20190428_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/18may19/SalishSea_1h_20190518_20190518_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/07jun19/SalishSea_1h_20190607_20190607_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/27jun19/SalishSea_1h_20190627_20190627_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/17jul19/SalishSea_1h_20190717_20190717_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/06aug19/SalishSea_1h_20190806_20190806_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/26aug19/SalishSea_1h_20190826_20190826_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/15sep19/SalishSea_1h_20190915_20190915_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/05oct19/SalishSea_1h_20191005_20191005_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/25oct19/SalishSea_1h_20191025_20191025_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/14nov19/SalishSea_1h_20191114_20191114_ptrc_T.nc /results2/SalishSea/nowcast-green.201905/04dec19/SalishSea_1h_20191204_20191204_ptrc_T.nc
if recalc:
#plt.plot(SiGlobalTot[sdir0]-SiGlobalTot[sdir0][0],'r-')
#plt.plot(SiGlobalTot[sdir3]-SiGlobalTot[sdir3][0],'g-')
#plt.plot(40,test-SiGlobalTot[sdir1][0],'r*')
#plt.plot(40,test2-SiGlobalTot[sdir1][0],'k*')
fig,ax=plt.subplots(1,1,figsize=(6,5))
ax.plot(NGlobalTot[sdir1]-NGlobalTot[sdir1][0],'r-')
ax.set_xlabel('10-day intervals since '+t0.strftime('%b $d $Y'))
ax.set_ylabel('Difference in Total N')
if recalc:
plt.plot(SiGlobalTot[sdir1]-SiGlobalTot[sdir1][0],'b-')
plt.plot(NGlobalTot[sdir1]-NGlobalTot[sdir1][0],'r-')
if recalc:
pickle.dump((dlist,SiGlobalTot[sdir1],NGlobalTot[sdir1]),open('GlobalTot_HC201905.pkl','wb'))
SiGlobalTot7F=pickle.load(open('SiGlobalTot_202007F.pkl','rb'))
NGlobalTot7F=pickle.load(open('NGlobalTot_202007F.pkl','rb'))
(dlist,SiGlobalTot1905,NGlobalTot1905)=pickle.load(open('GlobalTot_HC201905.pkl','rb'))
SiGlobalTotHC=pickle.load(open('SiGlobalTot_201905_1d.pkl','rb'))
NGlobalTotHC=pickle.load(open('NGlobalTot_201905_1d.pkl','rb'))
SiGlobalTotHC18=pickle.load(open('SiGlobalTot_HCDec.pkl','rb'))
NGlobalTotHC18=pickle.load(open('NGlobalTot_HCDec.pkl','rb'))
SiGlobalTotHC1=pickle.load(open('SiGlobalTot_HC19spin1.pkl','rb'))
NGlobalTotHC1=pickle.load(open('NGlobalTot_HC19spin1.pkl','rb'))
#SiGlobalTotT3=pickle.load(open('SiGlobalTotT3.pkl','rb'))
#NGlobalTotT3=pickle.load(open('NGlobalTotT3.pkl','rb'))
#SiGlobalTotZ1=pickle.load(open('SiGlobalTotZ1.pkl','rb'))
#NGlobalTotZ1=pickle.load(open('NGlobalTotZ1.pkl','rb'))
#tit='spring2015_Z3'
#SiGlobalTotZ3=pickle.load(open('SiGlobalTot_'+tit+'.pkl','rb'))
#NGlobalTotZ3=pickle.load(open('NGlobalTot_'+tit+'.pkl','rb'))
bdir='/data/eolson/MEOPAR/SS36runs/CedarRuns/'
fig,ax=plt.subplots(1,1,figsize=(16,8))
plt.plot(dlist,SiGlobalTot1905,'k-')
plt.plot(dlist,NGlobalTot1905,'k--')
plt.plot([dt.datetime(2015,1,1)+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotHC))],SiGlobalTotHC,'y-')
plt.plot([dt.datetime(2015,1,1)+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotHC))],NGlobalTotHC,'m-')
plt.plot([dt.datetime(2015,1,1)+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotHC18))],SiGlobalTotHC18,'g--')
plt.plot([dt.datetime(2015,1,1)+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotHC18))],NGlobalTotHC18,'r--')
plt.plot([dt.datetime(2013,1,1)+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotHC1))],SiGlobalTotHC1,'c--')
plt.plot([dt.datetime(2013,1,1)+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotHC1))],NGlobalTotHC1,'--',color='purple')
#plt.plot([dt.datetime(2015,1,11)+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotZ4))],SiGlobalTotZ4,'c--')
#plt.plot([dt.datetime(2015,1,11)+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotZ4))],NGlobalTotZ4,'c--')
#ax.plot([dt.datetime(2015,1,11)+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotZ5))],SiGlobalTotZ5,'m:')
#ax.plot([dt.datetime(2015,1,11)+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotZ5))],NGlobalTotZ5,'m:')
#ax.plot([dt.datetime(2015,1,11)+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotZtest))],SiGlobalTotZtest,'b:')
#ax.plot([dt.datetime(2015,1,11)+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotZtest))],NGlobalTotZtest,'b:')
#ax.plot([dt.datetime(2016,1,6)+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotZ6))],SiGlobalTotZ6,'r:')
#ax.plot([dt.datetime(2016,1,6)+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotZ6))],NGlobalTotZ6,'r:')
#ax.plot([dt.datetime(2016,1,6)+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotZ7))],SiGlobalTotZ7,'g:')
#ax.plot([dt.datetime(2016,1,6)+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotZ7))],NGlobalTotZ7,'g:')
[<matplotlib.lines.Line2D at 0x7fb96913d5e0>]