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(2013,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.2
nlen=210
#nlen=58#100
dlist=[t0+dt.timedelta(days=ii*10) for ii in range(0,nlen)]
#sdir0='/results/SalishSea/nowcast-green/'
sdir1='/results/SalishSea/hindcast.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==sdir1:
fformatT='SalishSea_1h_%Y%m%d_%Y%m%d_ptrc_T.nc'
fformatP='SalishSea_1h_%Y%m%d_%Y%m%d_carp_T.nc'
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/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)]
/results/SalishSea/hindcast.201905/01jan13/SalishSea_1h_20130101_20130101_ptrc_T.nc /results/SalishSea/hindcast.201905/11jan13/SalishSea_1h_20130111_20130111_ptrc_T.nc /results/SalishSea/hindcast.201905/21jan13/SalishSea_1h_20130121_20130121_ptrc_T.nc /results/SalishSea/hindcast.201905/31jan13/SalishSea_1h_20130131_20130131_ptrc_T.nc /results/SalishSea/hindcast.201905/10feb13/SalishSea_1h_20130210_20130210_ptrc_T.nc /results/SalishSea/hindcast.201905/20feb13/SalishSea_1h_20130220_20130220_ptrc_T.nc /results/SalishSea/hindcast.201905/02mar13/SalishSea_1h_20130302_20130302_ptrc_T.nc /results/SalishSea/hindcast.201905/12mar13/SalishSea_1h_20130312_20130312_ptrc_T.nc /results/SalishSea/hindcast.201905/22mar13/SalishSea_1h_20130322_20130322_ptrc_T.nc /results/SalishSea/hindcast.201905/01apr13/SalishSea_1h_20130401_20130401_ptrc_T.nc /results/SalishSea/hindcast.201905/11apr13/SalishSea_1h_20130411_20130411_ptrc_T.nc /results/SalishSea/hindcast.201905/21apr13/SalishSea_1h_20130421_20130421_ptrc_T.nc /results/SalishSea/hindcast.201905/01may13/SalishSea_1h_20130501_20130501_ptrc_T.nc /results/SalishSea/hindcast.201905/11may13/SalishSea_1h_20130511_20130511_ptrc_T.nc /results/SalishSea/hindcast.201905/21may13/SalishSea_1h_20130521_20130521_ptrc_T.nc /results/SalishSea/hindcast.201905/31may13/SalishSea_1h_20130531_20130531_ptrc_T.nc /results/SalishSea/hindcast.201905/10jun13/SalishSea_1h_20130610_20130610_ptrc_T.nc /results/SalishSea/hindcast.201905/20jun13/SalishSea_1h_20130620_20130620_ptrc_T.nc /results/SalishSea/hindcast.201905/30jun13/SalishSea_1h_20130630_20130630_ptrc_T.nc /results/SalishSea/hindcast.201905/10jul13/SalishSea_1h_20130710_20130710_ptrc_T.nc /results/SalishSea/hindcast.201905/20jul13/SalishSea_1h_20130720_20130720_ptrc_T.nc /results/SalishSea/hindcast.201905/30jul13/SalishSea_1h_20130730_20130730_ptrc_T.nc /results/SalishSea/hindcast.201905/09aug13/SalishSea_1h_20130809_20130809_ptrc_T.nc /results/SalishSea/hindcast.201905/19aug13/SalishSea_1h_20130819_20130819_ptrc_T.nc /results/SalishSea/hindcast.201905/29aug13/SalishSea_1h_20130829_20130829_ptrc_T.nc /results/SalishSea/hindcast.201905/08sep13/SalishSea_1h_20130908_20130908_ptrc_T.nc /results/SalishSea/hindcast.201905/18sep13/SalishSea_1h_20130918_20130918_ptrc_T.nc /results/SalishSea/hindcast.201905/28sep13/SalishSea_1h_20130928_20130928_ptrc_T.nc /results/SalishSea/hindcast.201905/08oct13/SalishSea_1h_20131008_20131008_ptrc_T.nc /results/SalishSea/hindcast.201905/18oct13/SalishSea_1h_20131018_20131018_ptrc_T.nc /results/SalishSea/hindcast.201905/28oct13/SalishSea_1h_20131028_20131028_ptrc_T.nc /results/SalishSea/hindcast.201905/07nov13/SalishSea_1h_20131107_20131107_ptrc_T.nc /results/SalishSea/hindcast.201905/17nov13/SalishSea_1h_20131117_20131117_ptrc_T.nc /results/SalishSea/hindcast.201905/27nov13/SalishSea_1h_20131127_20131127_ptrc_T.nc /results/SalishSea/hindcast.201905/07dec13/SalishSea_1h_20131207_20131207_ptrc_T.nc /results/SalishSea/hindcast.201905/17dec13/SalishSea_1h_20131217_20131217_ptrc_T.nc /results/SalishSea/hindcast.201905/27dec13/SalishSea_1h_20131227_20131227_ptrc_T.nc /results/SalishSea/hindcast.201905/06jan14/SalishSea_1h_20140106_20140106_ptrc_T.nc /results/SalishSea/hindcast.201905/16jan14/SalishSea_1h_20140116_20140116_ptrc_T.nc /results/SalishSea/hindcast.201905/26jan14/SalishSea_1h_20140126_20140126_ptrc_T.nc /results/SalishSea/hindcast.201905/05feb14/SalishSea_1h_20140205_20140205_ptrc_T.nc /results/SalishSea/hindcast.201905/15feb14/SalishSea_1h_20140215_20140215_ptrc_T.nc /results/SalishSea/hindcast.201905/25feb14/SalishSea_1h_20140225_20140225_ptrc_T.nc /results/SalishSea/hindcast.201905/07mar14/SalishSea_1h_20140307_20140307_ptrc_T.nc /results/SalishSea/hindcast.201905/17mar14/SalishSea_1h_20140317_20140317_ptrc_T.nc /results/SalishSea/hindcast.201905/27mar14/SalishSea_1h_20140327_20140327_ptrc_T.nc /results/SalishSea/hindcast.201905/06apr14/SalishSea_1h_20140406_20140406_ptrc_T.nc /results/SalishSea/hindcast.201905/16apr14/SalishSea_1h_20140416_20140416_ptrc_T.nc /results/SalishSea/hindcast.201905/26apr14/SalishSea_1h_20140426_20140426_ptrc_T.nc /results/SalishSea/hindcast.201905/06may14/SalishSea_1h_20140506_20140506_ptrc_T.nc /results/SalishSea/hindcast.201905/16may14/SalishSea_1h_20140516_20140516_ptrc_T.nc /results/SalishSea/hindcast.201905/26may14/SalishSea_1h_20140526_20140526_ptrc_T.nc /results/SalishSea/hindcast.201905/05jun14/SalishSea_1h_20140605_20140605_ptrc_T.nc /results/SalishSea/hindcast.201905/15jun14/SalishSea_1h_20140615_20140615_ptrc_T.nc /results/SalishSea/hindcast.201905/25jun14/SalishSea_1h_20140625_20140625_ptrc_T.nc /results/SalishSea/hindcast.201905/05jul14/SalishSea_1h_20140705_20140705_ptrc_T.nc /results/SalishSea/hindcast.201905/15jul14/SalishSea_1h_20140715_20140715_ptrc_T.nc /results/SalishSea/hindcast.201905/25jul14/SalishSea_1h_20140725_20140725_ptrc_T.nc /results/SalishSea/hindcast.201905/04aug14/SalishSea_1h_20140804_20140804_ptrc_T.nc /results/SalishSea/hindcast.201905/14aug14/SalishSea_1h_20140814_20140814_ptrc_T.nc /results/SalishSea/hindcast.201905/24aug14/SalishSea_1h_20140824_20140824_ptrc_T.nc /results/SalishSea/hindcast.201905/03sep14/SalishSea_1h_20140903_20140903_ptrc_T.nc /results/SalishSea/hindcast.201905/13sep14/SalishSea_1h_20140913_20140913_ptrc_T.nc /results/SalishSea/hindcast.201905/23sep14/SalishSea_1h_20140923_20140923_ptrc_T.nc /results/SalishSea/hindcast.201905/03oct14/SalishSea_1h_20141003_20141003_ptrc_T.nc /results/SalishSea/hindcast.201905/13oct14/SalishSea_1h_20141013_20141013_ptrc_T.nc /results/SalishSea/hindcast.201905/23oct14/SalishSea_1h_20141023_20141023_ptrc_T.nc /results/SalishSea/hindcast.201905/02nov14/SalishSea_1h_20141102_20141102_ptrc_T.nc /results/SalishSea/hindcast.201905/12nov14/SalishSea_1h_20141112_20141112_ptrc_T.nc /results/SalishSea/hindcast.201905/22nov14/SalishSea_1h_20141122_20141122_ptrc_T.nc /results/SalishSea/hindcast.201905/02dec14/SalishSea_1h_20141202_20141202_ptrc_T.nc /results/SalishSea/hindcast.201905/12dec14/SalishSea_1h_20141212_20141212_ptrc_T.nc /results/SalishSea/hindcast.201905/22dec14/SalishSea_1h_20141222_20141222_ptrc_T.nc /results/SalishSea/hindcast.201905/01jan15/SalishSea_1h_20150101_20150101_ptrc_T.nc /results/SalishSea/hindcast.201905/11jan15/SalishSea_1h_20150111_20150111_ptrc_T.nc /results/SalishSea/hindcast.201905/21jan15/SalishSea_1h_20150121_20150121_ptrc_T.nc /results/SalishSea/hindcast.201905/31jan15/SalishSea_1h_20150131_20150131_ptrc_T.nc /results/SalishSea/hindcast.201905/10feb15/SalishSea_1h_20150210_20150210_ptrc_T.nc /results/SalishSea/hindcast.201905/20feb15/SalishSea_1h_20150220_20150220_ptrc_T.nc /results/SalishSea/hindcast.201905/02mar15/SalishSea_1h_20150302_20150302_ptrc_T.nc /results/SalishSea/hindcast.201905/12mar15/SalishSea_1h_20150312_20150312_ptrc_T.nc /results/SalishSea/hindcast.201905/22mar15/SalishSea_1h_20150322_20150322_ptrc_T.nc /results/SalishSea/hindcast.201905/01apr15/SalishSea_1h_20150401_20150401_ptrc_T.nc /results/SalishSea/hindcast.201905/11apr15/SalishSea_1h_20150411_20150411_ptrc_T.nc /results/SalishSea/hindcast.201905/21apr15/SalishSea_1h_20150421_20150421_ptrc_T.nc /results/SalishSea/hindcast.201905/01may15/SalishSea_1h_20150501_20150501_ptrc_T.nc /results/SalishSea/hindcast.201905/11may15/SalishSea_1h_20150511_20150511_ptrc_T.nc /results/SalishSea/hindcast.201905/21may15/SalishSea_1h_20150521_20150521_ptrc_T.nc /results/SalishSea/hindcast.201905/31may15/SalishSea_1h_20150531_20150531_ptrc_T.nc /results/SalishSea/hindcast.201905/10jun15/SalishSea_1h_20150610_20150610_ptrc_T.nc /results/SalishSea/hindcast.201905/20jun15/SalishSea_1h_20150620_20150620_ptrc_T.nc /results/SalishSea/hindcast.201905/30jun15/SalishSea_1h_20150630_20150630_ptrc_T.nc /results/SalishSea/hindcast.201905/10jul15/SalishSea_1h_20150710_20150710_ptrc_T.nc /results/SalishSea/hindcast.201905/20jul15/SalishSea_1h_20150720_20150720_ptrc_T.nc /results/SalishSea/hindcast.201905/30jul15/SalishSea_1h_20150730_20150730_ptrc_T.nc /results/SalishSea/hindcast.201905/09aug15/SalishSea_1h_20150809_20150809_ptrc_T.nc /results/SalishSea/hindcast.201905/19aug15/SalishSea_1h_20150819_20150819_ptrc_T.nc /results/SalishSea/hindcast.201905/29aug15/SalishSea_1h_20150829_20150829_ptrc_T.nc /results/SalishSea/hindcast.201905/08sep15/SalishSea_1h_20150908_20150908_ptrc_T.nc /results/SalishSea/hindcast.201905/18sep15/SalishSea_1h_20150918_20150918_ptrc_T.nc /results/SalishSea/hindcast.201905/28sep15/SalishSea_1h_20150928_20150928_ptrc_T.nc /results/SalishSea/hindcast.201905/08oct15/SalishSea_1h_20151008_20151008_ptrc_T.nc /results/SalishSea/hindcast.201905/18oct15/SalishSea_1h_20151018_20151018_ptrc_T.nc /results/SalishSea/hindcast.201905/28oct15/SalishSea_1h_20151028_20151028_ptrc_T.nc /results/SalishSea/hindcast.201905/07nov15/SalishSea_1h_20151107_20151107_ptrc_T.nc /results/SalishSea/hindcast.201905/17nov15/SalishSea_1h_20151117_20151117_ptrc_T.nc /results/SalishSea/hindcast.201905/27nov15/SalishSea_1h_20151127_20151127_ptrc_T.nc /results/SalishSea/hindcast.201905/07dec15/SalishSea_1h_20151207_20151207_ptrc_T.nc /results/SalishSea/hindcast.201905/17dec15/SalishSea_1h_20151217_20151217_ptrc_T.nc /results/SalishSea/hindcast.201905/27dec15/SalishSea_1h_20151227_20151227_ptrc_T.nc /results/SalishSea/hindcast.201905/06jan16/SalishSea_1h_20160106_20160106_ptrc_T.nc /results/SalishSea/hindcast.201905/16jan16/SalishSea_1h_20160116_20160116_ptrc_T.nc /results/SalishSea/hindcast.201905/26jan16/SalishSea_1h_20160126_20160126_ptrc_T.nc /results/SalishSea/hindcast.201905/05feb16/SalishSea_1h_20160205_20160205_ptrc_T.nc /results/SalishSea/hindcast.201905/15feb16/SalishSea_1h_20160215_20160215_ptrc_T.nc /results/SalishSea/hindcast.201905/25feb16/SalishSea_1h_20160225_20160225_ptrc_T.nc /results/SalishSea/hindcast.201905/06mar16/SalishSea_1h_20160306_20160306_ptrc_T.nc /results/SalishSea/hindcast.201905/16mar16/SalishSea_1h_20160316_20160316_ptrc_T.nc /results/SalishSea/hindcast.201905/26mar16/SalishSea_1h_20160326_20160326_ptrc_T.nc /results/SalishSea/hindcast.201905/05apr16/SalishSea_1h_20160405_20160405_ptrc_T.nc /results/SalishSea/hindcast.201905/15apr16/SalishSea_1h_20160415_20160415_ptrc_T.nc /results/SalishSea/hindcast.201905/25apr16/SalishSea_1h_20160425_20160425_ptrc_T.nc /results/SalishSea/hindcast.201905/05may16/SalishSea_1h_20160505_20160505_ptrc_T.nc /results/SalishSea/hindcast.201905/15may16/SalishSea_1h_20160515_20160515_ptrc_T.nc /results/SalishSea/hindcast.201905/25may16/SalishSea_1h_20160525_20160525_ptrc_T.nc /results/SalishSea/hindcast.201905/04jun16/SalishSea_1h_20160604_20160604_ptrc_T.nc /results/SalishSea/hindcast.201905/14jun16/SalishSea_1h_20160614_20160614_ptrc_T.nc /results/SalishSea/hindcast.201905/24jun16/SalishSea_1h_20160624_20160624_ptrc_T.nc /results/SalishSea/hindcast.201905/04jul16/SalishSea_1h_20160704_20160704_ptrc_T.nc /results/SalishSea/hindcast.201905/14jul16/SalishSea_1h_20160714_20160714_ptrc_T.nc /results/SalishSea/hindcast.201905/24jul16/SalishSea_1h_20160724_20160724_ptrc_T.nc /results/SalishSea/hindcast.201905/03aug16/SalishSea_1h_20160803_20160803_ptrc_T.nc /results/SalishSea/hindcast.201905/13aug16/SalishSea_1h_20160813_20160813_ptrc_T.nc /results/SalishSea/hindcast.201905/23aug16/SalishSea_1h_20160823_20160823_ptrc_T.nc /results/SalishSea/hindcast.201905/02sep16/SalishSea_1h_20160902_20160902_ptrc_T.nc /results/SalishSea/hindcast.201905/12sep16/SalishSea_1h_20160912_20160912_ptrc_T.nc /results/SalishSea/hindcast.201905/22sep16/SalishSea_1h_20160922_20160922_ptrc_T.nc /results/SalishSea/hindcast.201905/02oct16/SalishSea_1h_20161002_20161002_ptrc_T.nc /results/SalishSea/hindcast.201905/12oct16/SalishSea_1h_20161012_20161012_ptrc_T.nc /results/SalishSea/hindcast.201905/22oct16/SalishSea_1h_20161022_20161022_ptrc_T.nc /results/SalishSea/hindcast.201905/01nov16/SalishSea_1h_20161101_20161101_ptrc_T.nc /results/SalishSea/hindcast.201905/11nov16/SalishSea_1h_20161111_20161111_ptrc_T.nc /results/SalishSea/hindcast.201905/21nov16/SalishSea_1h_20161121_20161121_ptrc_T.nc /results/SalishSea/hindcast.201905/01dec16/SalishSea_1h_20161201_20161201_ptrc_T.nc /results/SalishSea/hindcast.201905/11dec16/SalishSea_1h_20161211_20161211_ptrc_T.nc /results/SalishSea/hindcast.201905/21dec16/SalishSea_1h_20161221_20161221_ptrc_T.nc /results/SalishSea/hindcast.201905/31dec16/SalishSea_1h_20161231_20161231_ptrc_T.nc /results/SalishSea/hindcast.201905/10jan17/SalishSea_1h_20170110_20170110_ptrc_T.nc /results/SalishSea/hindcast.201905/20jan17/SalishSea_1h_20170120_20170120_ptrc_T.nc /results/SalishSea/hindcast.201905/30jan17/SalishSea_1h_20170130_20170130_ptrc_T.nc /results/SalishSea/hindcast.201905/09feb17/SalishSea_1h_20170209_20170209_ptrc_T.nc /results/SalishSea/hindcast.201905/19feb17/SalishSea_1h_20170219_20170219_ptrc_T.nc /results/SalishSea/hindcast.201905/01mar17/SalishSea_1h_20170301_20170301_ptrc_T.nc /results/SalishSea/hindcast.201905/11mar17/SalishSea_1h_20170311_20170311_ptrc_T.nc /results/SalishSea/hindcast.201905/21mar17/SalishSea_1h_20170321_20170321_ptrc_T.nc /results/SalishSea/hindcast.201905/31mar17/SalishSea_1h_20170331_20170331_ptrc_T.nc /results/SalishSea/hindcast.201905/10apr17/SalishSea_1h_20170410_20170410_ptrc_T.nc /results/SalishSea/hindcast.201905/20apr17/SalishSea_1h_20170420_20170420_ptrc_T.nc /results/SalishSea/hindcast.201905/30apr17/SalishSea_1h_20170430_20170430_ptrc_T.nc /results/SalishSea/hindcast.201905/10may17/SalishSea_1h_20170510_20170510_ptrc_T.nc /results/SalishSea/hindcast.201905/20may17/SalishSea_1h_20170520_20170520_ptrc_T.nc /results/SalishSea/hindcast.201905/30may17/SalishSea_1h_20170530_20170530_ptrc_T.nc /results/SalishSea/hindcast.201905/09jun17/SalishSea_1h_20170609_20170609_ptrc_T.nc /results/SalishSea/hindcast.201905/19jun17/SalishSea_1h_20170619_20170619_ptrc_T.nc /results/SalishSea/hindcast.201905/29jun17/SalishSea_1h_20170629_20170629_ptrc_T.nc /results/SalishSea/hindcast.201905/09jul17/SalishSea_1h_20170709_20170709_ptrc_T.nc /results/SalishSea/hindcast.201905/19jul17/SalishSea_1h_20170719_20170719_ptrc_T.nc /results/SalishSea/hindcast.201905/29jul17/SalishSea_1h_20170729_20170729_ptrc_T.nc /results/SalishSea/hindcast.201905/08aug17/SalishSea_1h_20170808_20170808_ptrc_T.nc /results/SalishSea/hindcast.201905/18aug17/SalishSea_1h_20170818_20170818_ptrc_T.nc /results/SalishSea/hindcast.201905/28aug17/SalishSea_1h_20170828_20170828_ptrc_T.nc /results/SalishSea/hindcast.201905/07sep17/SalishSea_1h_20170907_20170907_ptrc_T.nc /results/SalishSea/hindcast.201905/17sep17/SalishSea_1h_20170917_20170917_ptrc_T.nc /results/SalishSea/hindcast.201905/27sep17/SalishSea_1h_20170927_20170927_ptrc_T.nc /results/SalishSea/hindcast.201905/07oct17/SalishSea_1h_20171007_20171007_ptrc_T.nc /results/SalishSea/hindcast.201905/17oct17/SalishSea_1h_20171017_20171017_ptrc_T.nc /results/SalishSea/hindcast.201905/27oct17/SalishSea_1h_20171027_20171027_ptrc_T.nc /results/SalishSea/hindcast.201905/06nov17/SalishSea_1h_20171106_20171106_ptrc_T.nc /results/SalishSea/hindcast.201905/16nov17/SalishSea_1h_20171116_20171116_ptrc_T.nc /results/SalishSea/hindcast.201905/26nov17/SalishSea_1h_20171126_20171126_ptrc_T.nc /results/SalishSea/hindcast.201905/06dec17/SalishSea_1h_20171206_20171206_ptrc_T.nc /results/SalishSea/hindcast.201905/16dec17/SalishSea_1h_20171216_20171216_ptrc_T.nc /results/SalishSea/hindcast.201905/26dec17/SalishSea_1h_20171226_20171226_ptrc_T.nc /results/SalishSea/hindcast.201905/05jan18/SalishSea_1h_20180105_20180105_ptrc_T.nc /results/SalishSea/hindcast.201905/15jan18/SalishSea_1h_20180115_20180115_ptrc_T.nc /results/SalishSea/hindcast.201905/25jan18/SalishSea_1h_20180125_20180125_ptrc_T.nc /results/SalishSea/hindcast.201905/04feb18/SalishSea_1h_20180204_20180204_ptrc_T.nc /results/SalishSea/hindcast.201905/14feb18/SalishSea_1h_20180214_20180214_ptrc_T.nc /results/SalishSea/hindcast.201905/24feb18/SalishSea_1h_20180224_20180224_ptrc_T.nc /results/SalishSea/hindcast.201905/06mar18/SalishSea_1h_20180306_20180306_ptrc_T.nc /results/SalishSea/hindcast.201905/16mar18/SalishSea_1h_20180316_20180316_ptrc_T.nc /results/SalishSea/hindcast.201905/26mar18/SalishSea_1h_20180326_20180326_ptrc_T.nc /results/SalishSea/hindcast.201905/05apr18/SalishSea_1h_20180405_20180405_ptrc_T.nc /results/SalishSea/hindcast.201905/15apr18/SalishSea_1h_20180415_20180415_ptrc_T.nc /results/SalishSea/hindcast.201905/25apr18/SalishSea_1h_20180425_20180425_ptrc_T.nc /results/SalishSea/hindcast.201905/05may18/SalishSea_1h_20180505_20180505_ptrc_T.nc /results/SalishSea/hindcast.201905/15may18/SalishSea_1h_20180515_20180515_ptrc_T.nc /results/SalishSea/hindcast.201905/25may18/SalishSea_1h_20180525_20180525_ptrc_T.nc /results/SalishSea/hindcast.201905/04jun18/SalishSea_1h_20180604_20180604_ptrc_T.nc /results/SalishSea/hindcast.201905/14jun18/SalishSea_1h_20180614_20180614_ptrc_T.nc /results/SalishSea/hindcast.201905/24jun18/SalishSea_1h_20180624_20180624_ptrc_T.nc /results/SalishSea/hindcast.201905/04jul18/SalishSea_1h_20180704_20180704_ptrc_T.nc /results/SalishSea/hindcast.201905/14jul18/SalishSea_1h_20180714_20180714_ptrc_T.nc /results/SalishSea/hindcast.201905/24jul18/SalishSea_1h_20180724_20180724_ptrc_T.nc /results/SalishSea/hindcast.201905/03aug18/SalishSea_1h_20180803_20180803_ptrc_T.nc /results/SalishSea/hindcast.201905/13aug18/SalishSea_1h_20180813_20180813_ptrc_T.nc /results/SalishSea/hindcast.201905/23aug18/SalishSea_1h_20180823_20180823_ptrc_T.nc /results/SalishSea/hindcast.201905/02sep18/SalishSea_1h_20180902_20180902_ptrc_T.nc /results/SalishSea/hindcast.201905/12sep18/SalishSea_1h_20180912_20180912_ptrc_T.nc /results/SalishSea/hindcast.201905/22sep18/SalishSea_1h_20180922_20180922_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==idir.startswith('/results/') or idir.startswith('/results2/') or ('link' in idir):
fformatT='SalishSea_1h_%Y%m%d_%Y%m%d_ptrc_T.nc'
fformatP='SalishSea_1h_%Y%m%d_%Y%m%d_carp_T.nc'
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/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
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)
/results/SalishSea/hindcast.201905/01jan13/SalishSea_1h_20130101_20130101_ptrc_T.nc /results/SalishSea/hindcast.201905/11jan13/SalishSea_1h_20130111_20130111_ptrc_T.nc /results/SalishSea/hindcast.201905/21jan13/SalishSea_1h_20130121_20130121_ptrc_T.nc /results/SalishSea/hindcast.201905/31jan13/SalishSea_1h_20130131_20130131_ptrc_T.nc /results/SalishSea/hindcast.201905/10feb13/SalishSea_1h_20130210_20130210_ptrc_T.nc /results/SalishSea/hindcast.201905/20feb13/SalishSea_1h_20130220_20130220_ptrc_T.nc /results/SalishSea/hindcast.201905/02mar13/SalishSea_1h_20130302_20130302_ptrc_T.nc /results/SalishSea/hindcast.201905/12mar13/SalishSea_1h_20130312_20130312_ptrc_T.nc /results/SalishSea/hindcast.201905/22mar13/SalishSea_1h_20130322_20130322_ptrc_T.nc /results/SalishSea/hindcast.201905/01apr13/SalishSea_1h_20130401_20130401_ptrc_T.nc /results/SalishSea/hindcast.201905/11apr13/SalishSea_1h_20130411_20130411_ptrc_T.nc /results/SalishSea/hindcast.201905/21apr13/SalishSea_1h_20130421_20130421_ptrc_T.nc /results/SalishSea/hindcast.201905/01may13/SalishSea_1h_20130501_20130501_ptrc_T.nc /results/SalishSea/hindcast.201905/11may13/SalishSea_1h_20130511_20130511_ptrc_T.nc /results/SalishSea/hindcast.201905/21may13/SalishSea_1h_20130521_20130521_ptrc_T.nc /results/SalishSea/hindcast.201905/31may13/SalishSea_1h_20130531_20130531_ptrc_T.nc /results/SalishSea/hindcast.201905/10jun13/SalishSea_1h_20130610_20130610_ptrc_T.nc /results/SalishSea/hindcast.201905/20jun13/SalishSea_1h_20130620_20130620_ptrc_T.nc /results/SalishSea/hindcast.201905/30jun13/SalishSea_1h_20130630_20130630_ptrc_T.nc /results/SalishSea/hindcast.201905/10jul13/SalishSea_1h_20130710_20130710_ptrc_T.nc /results/SalishSea/hindcast.201905/20jul13/SalishSea_1h_20130720_20130720_ptrc_T.nc /results/SalishSea/hindcast.201905/30jul13/SalishSea_1h_20130730_20130730_ptrc_T.nc /results/SalishSea/hindcast.201905/09aug13/SalishSea_1h_20130809_20130809_ptrc_T.nc /results/SalishSea/hindcast.201905/19aug13/SalishSea_1h_20130819_20130819_ptrc_T.nc /results/SalishSea/hindcast.201905/29aug13/SalishSea_1h_20130829_20130829_ptrc_T.nc /results/SalishSea/hindcast.201905/08sep13/SalishSea_1h_20130908_20130908_ptrc_T.nc /results/SalishSea/hindcast.201905/18sep13/SalishSea_1h_20130918_20130918_ptrc_T.nc /results/SalishSea/hindcast.201905/28sep13/SalishSea_1h_20130928_20130928_ptrc_T.nc /results/SalishSea/hindcast.201905/08oct13/SalishSea_1h_20131008_20131008_ptrc_T.nc /results/SalishSea/hindcast.201905/18oct13/SalishSea_1h_20131018_20131018_ptrc_T.nc /results/SalishSea/hindcast.201905/28oct13/SalishSea_1h_20131028_20131028_ptrc_T.nc /results/SalishSea/hindcast.201905/07nov13/SalishSea_1h_20131107_20131107_ptrc_T.nc /results/SalishSea/hindcast.201905/17nov13/SalishSea_1h_20131117_20131117_ptrc_T.nc /results/SalishSea/hindcast.201905/27nov13/SalishSea_1h_20131127_20131127_ptrc_T.nc /results/SalishSea/hindcast.201905/07dec13/SalishSea_1h_20131207_20131207_ptrc_T.nc /results/SalishSea/hindcast.201905/17dec13/SalishSea_1h_20131217_20131217_ptrc_T.nc /results/SalishSea/hindcast.201905/27dec13/SalishSea_1h_20131227_20131227_ptrc_T.nc /results/SalishSea/hindcast.201905/06jan14/SalishSea_1h_20140106_20140106_ptrc_T.nc /results/SalishSea/hindcast.201905/16jan14/SalishSea_1h_20140116_20140116_ptrc_T.nc /results/SalishSea/hindcast.201905/26jan14/SalishSea_1h_20140126_20140126_ptrc_T.nc /results/SalishSea/hindcast.201905/05feb14/SalishSea_1h_20140205_20140205_ptrc_T.nc /results/SalishSea/hindcast.201905/15feb14/SalishSea_1h_20140215_20140215_ptrc_T.nc /results/SalishSea/hindcast.201905/25feb14/SalishSea_1h_20140225_20140225_ptrc_T.nc /results/SalishSea/hindcast.201905/07mar14/SalishSea_1h_20140307_20140307_ptrc_T.nc /results/SalishSea/hindcast.201905/17mar14/SalishSea_1h_20140317_20140317_ptrc_T.nc /results/SalishSea/hindcast.201905/27mar14/SalishSea_1h_20140327_20140327_ptrc_T.nc /results/SalishSea/hindcast.201905/06apr14/SalishSea_1h_20140406_20140406_ptrc_T.nc /results/SalishSea/hindcast.201905/16apr14/SalishSea_1h_20140416_20140416_ptrc_T.nc /results/SalishSea/hindcast.201905/26apr14/SalishSea_1h_20140426_20140426_ptrc_T.nc /results/SalishSea/hindcast.201905/06may14/SalishSea_1h_20140506_20140506_ptrc_T.nc /results/SalishSea/hindcast.201905/16may14/SalishSea_1h_20140516_20140516_ptrc_T.nc /results/SalishSea/hindcast.201905/26may14/SalishSea_1h_20140526_20140526_ptrc_T.nc /results/SalishSea/hindcast.201905/05jun14/SalishSea_1h_20140605_20140605_ptrc_T.nc /results/SalishSea/hindcast.201905/15jun14/SalishSea_1h_20140615_20140615_ptrc_T.nc /results/SalishSea/hindcast.201905/25jun14/SalishSea_1h_20140625_20140625_ptrc_T.nc /results/SalishSea/hindcast.201905/05jul14/SalishSea_1h_20140705_20140705_ptrc_T.nc /results/SalishSea/hindcast.201905/15jul14/SalishSea_1h_20140715_20140715_ptrc_T.nc /results/SalishSea/hindcast.201905/25jul14/SalishSea_1h_20140725_20140725_ptrc_T.nc /results/SalishSea/hindcast.201905/04aug14/SalishSea_1h_20140804_20140804_ptrc_T.nc /results/SalishSea/hindcast.201905/14aug14/SalishSea_1h_20140814_20140814_ptrc_T.nc /results/SalishSea/hindcast.201905/24aug14/SalishSea_1h_20140824_20140824_ptrc_T.nc /results/SalishSea/hindcast.201905/03sep14/SalishSea_1h_20140903_20140903_ptrc_T.nc /results/SalishSea/hindcast.201905/13sep14/SalishSea_1h_20140913_20140913_ptrc_T.nc /results/SalishSea/hindcast.201905/23sep14/SalishSea_1h_20140923_20140923_ptrc_T.nc /results/SalishSea/hindcast.201905/03oct14/SalishSea_1h_20141003_20141003_ptrc_T.nc /results/SalishSea/hindcast.201905/13oct14/SalishSea_1h_20141013_20141013_ptrc_T.nc /results/SalishSea/hindcast.201905/23oct14/SalishSea_1h_20141023_20141023_ptrc_T.nc /results/SalishSea/hindcast.201905/02nov14/SalishSea_1h_20141102_20141102_ptrc_T.nc /results/SalishSea/hindcast.201905/12nov14/SalishSea_1h_20141112_20141112_ptrc_T.nc /results/SalishSea/hindcast.201905/22nov14/SalishSea_1h_20141122_20141122_ptrc_T.nc /results/SalishSea/hindcast.201905/02dec14/SalishSea_1h_20141202_20141202_ptrc_T.nc /results/SalishSea/hindcast.201905/12dec14/SalishSea_1h_20141212_20141212_ptrc_T.nc /results/SalishSea/hindcast.201905/22dec14/SalishSea_1h_20141222_20141222_ptrc_T.nc /results/SalishSea/hindcast.201905/01jan15/SalishSea_1h_20150101_20150101_ptrc_T.nc /results/SalishSea/hindcast.201905/11jan15/SalishSea_1h_20150111_20150111_ptrc_T.nc /results/SalishSea/hindcast.201905/21jan15/SalishSea_1h_20150121_20150121_ptrc_T.nc /results/SalishSea/hindcast.201905/31jan15/SalishSea_1h_20150131_20150131_ptrc_T.nc /results/SalishSea/hindcast.201905/10feb15/SalishSea_1h_20150210_20150210_ptrc_T.nc /results/SalishSea/hindcast.201905/20feb15/SalishSea_1h_20150220_20150220_ptrc_T.nc /results/SalishSea/hindcast.201905/02mar15/SalishSea_1h_20150302_20150302_ptrc_T.nc /results/SalishSea/hindcast.201905/12mar15/SalishSea_1h_20150312_20150312_ptrc_T.nc /results/SalishSea/hindcast.201905/22mar15/SalishSea_1h_20150322_20150322_ptrc_T.nc /results/SalishSea/hindcast.201905/01apr15/SalishSea_1h_20150401_20150401_ptrc_T.nc /results/SalishSea/hindcast.201905/11apr15/SalishSea_1h_20150411_20150411_ptrc_T.nc /results/SalishSea/hindcast.201905/21apr15/SalishSea_1h_20150421_20150421_ptrc_T.nc /results/SalishSea/hindcast.201905/01may15/SalishSea_1h_20150501_20150501_ptrc_T.nc /results/SalishSea/hindcast.201905/11may15/SalishSea_1h_20150511_20150511_ptrc_T.nc /results/SalishSea/hindcast.201905/21may15/SalishSea_1h_20150521_20150521_ptrc_T.nc /results/SalishSea/hindcast.201905/31may15/SalishSea_1h_20150531_20150531_ptrc_T.nc /results/SalishSea/hindcast.201905/10jun15/SalishSea_1h_20150610_20150610_ptrc_T.nc /results/SalishSea/hindcast.201905/20jun15/SalishSea_1h_20150620_20150620_ptrc_T.nc /results/SalishSea/hindcast.201905/30jun15/SalishSea_1h_20150630_20150630_ptrc_T.nc /results/SalishSea/hindcast.201905/10jul15/SalishSea_1h_20150710_20150710_ptrc_T.nc /results/SalishSea/hindcast.201905/20jul15/SalishSea_1h_20150720_20150720_ptrc_T.nc /results/SalishSea/hindcast.201905/30jul15/SalishSea_1h_20150730_20150730_ptrc_T.nc /results/SalishSea/hindcast.201905/09aug15/SalishSea_1h_20150809_20150809_ptrc_T.nc /results/SalishSea/hindcast.201905/19aug15/SalishSea_1h_20150819_20150819_ptrc_T.nc /results/SalishSea/hindcast.201905/29aug15/SalishSea_1h_20150829_20150829_ptrc_T.nc /results/SalishSea/hindcast.201905/08sep15/SalishSea_1h_20150908_20150908_ptrc_T.nc /results/SalishSea/hindcast.201905/18sep15/SalishSea_1h_20150918_20150918_ptrc_T.nc /results/SalishSea/hindcast.201905/28sep15/SalishSea_1h_20150928_20150928_ptrc_T.nc /results/SalishSea/hindcast.201905/08oct15/SalishSea_1h_20151008_20151008_ptrc_T.nc /results/SalishSea/hindcast.201905/18oct15/SalishSea_1h_20151018_20151018_ptrc_T.nc /results/SalishSea/hindcast.201905/28oct15/SalishSea_1h_20151028_20151028_ptrc_T.nc /results/SalishSea/hindcast.201905/07nov15/SalishSea_1h_20151107_20151107_ptrc_T.nc /results/SalishSea/hindcast.201905/17nov15/SalishSea_1h_20151117_20151117_ptrc_T.nc /results/SalishSea/hindcast.201905/27nov15/SalishSea_1h_20151127_20151127_ptrc_T.nc /results/SalishSea/hindcast.201905/07dec15/SalishSea_1h_20151207_20151207_ptrc_T.nc /results/SalishSea/hindcast.201905/17dec15/SalishSea_1h_20151217_20151217_ptrc_T.nc /results/SalishSea/hindcast.201905/27dec15/SalishSea_1h_20151227_20151227_ptrc_T.nc /results/SalishSea/hindcast.201905/06jan16/SalishSea_1h_20160106_20160106_ptrc_T.nc /results/SalishSea/hindcast.201905/16jan16/SalishSea_1h_20160116_20160116_ptrc_T.nc /results/SalishSea/hindcast.201905/26jan16/SalishSea_1h_20160126_20160126_ptrc_T.nc /results/SalishSea/hindcast.201905/05feb16/SalishSea_1h_20160205_20160205_ptrc_T.nc /results/SalishSea/hindcast.201905/15feb16/SalishSea_1h_20160215_20160215_ptrc_T.nc /results/SalishSea/hindcast.201905/25feb16/SalishSea_1h_20160225_20160225_ptrc_T.nc /results/SalishSea/hindcast.201905/06mar16/SalishSea_1h_20160306_20160306_ptrc_T.nc /results/SalishSea/hindcast.201905/16mar16/SalishSea_1h_20160316_20160316_ptrc_T.nc /results/SalishSea/hindcast.201905/26mar16/SalishSea_1h_20160326_20160326_ptrc_T.nc /results/SalishSea/hindcast.201905/05apr16/SalishSea_1h_20160405_20160405_ptrc_T.nc /results/SalishSea/hindcast.201905/15apr16/SalishSea_1h_20160415_20160415_ptrc_T.nc /results/SalishSea/hindcast.201905/25apr16/SalishSea_1h_20160425_20160425_ptrc_T.nc /results/SalishSea/hindcast.201905/05may16/SalishSea_1h_20160505_20160505_ptrc_T.nc /results/SalishSea/hindcast.201905/15may16/SalishSea_1h_20160515_20160515_ptrc_T.nc /results/SalishSea/hindcast.201905/25may16/SalishSea_1h_20160525_20160525_ptrc_T.nc /results/SalishSea/hindcast.201905/04jun16/SalishSea_1h_20160604_20160604_ptrc_T.nc /results/SalishSea/hindcast.201905/14jun16/SalishSea_1h_20160614_20160614_ptrc_T.nc /results/SalishSea/hindcast.201905/24jun16/SalishSea_1h_20160624_20160624_ptrc_T.nc /results/SalishSea/hindcast.201905/04jul16/SalishSea_1h_20160704_20160704_ptrc_T.nc /results/SalishSea/hindcast.201905/14jul16/SalishSea_1h_20160714_20160714_ptrc_T.nc /results/SalishSea/hindcast.201905/24jul16/SalishSea_1h_20160724_20160724_ptrc_T.nc /results/SalishSea/hindcast.201905/03aug16/SalishSea_1h_20160803_20160803_ptrc_T.nc /results/SalishSea/hindcast.201905/13aug16/SalishSea_1h_20160813_20160813_ptrc_T.nc /results/SalishSea/hindcast.201905/23aug16/SalishSea_1h_20160823_20160823_ptrc_T.nc /results/SalishSea/hindcast.201905/02sep16/SalishSea_1h_20160902_20160902_ptrc_T.nc /results/SalishSea/hindcast.201905/12sep16/SalishSea_1h_20160912_20160912_ptrc_T.nc /results/SalishSea/hindcast.201905/22sep16/SalishSea_1h_20160922_20160922_ptrc_T.nc /results/SalishSea/hindcast.201905/02oct16/SalishSea_1h_20161002_20161002_ptrc_T.nc /results/SalishSea/hindcast.201905/12oct16/SalishSea_1h_20161012_20161012_ptrc_T.nc /results/SalishSea/hindcast.201905/22oct16/SalishSea_1h_20161022_20161022_ptrc_T.nc /results/SalishSea/hindcast.201905/01nov16/SalishSea_1h_20161101_20161101_ptrc_T.nc /results/SalishSea/hindcast.201905/11nov16/SalishSea_1h_20161111_20161111_ptrc_T.nc /results/SalishSea/hindcast.201905/21nov16/SalishSea_1h_20161121_20161121_ptrc_T.nc /results/SalishSea/hindcast.201905/01dec16/SalishSea_1h_20161201_20161201_ptrc_T.nc /results/SalishSea/hindcast.201905/11dec16/SalishSea_1h_20161211_20161211_ptrc_T.nc /results/SalishSea/hindcast.201905/21dec16/SalishSea_1h_20161221_20161221_ptrc_T.nc /results/SalishSea/hindcast.201905/31dec16/SalishSea_1h_20161231_20161231_ptrc_T.nc /results/SalishSea/hindcast.201905/10jan17/SalishSea_1h_20170110_20170110_ptrc_T.nc /results/SalishSea/hindcast.201905/20jan17/SalishSea_1h_20170120_20170120_ptrc_T.nc /results/SalishSea/hindcast.201905/30jan17/SalishSea_1h_20170130_20170130_ptrc_T.nc /results/SalishSea/hindcast.201905/09feb17/SalishSea_1h_20170209_20170209_ptrc_T.nc /results/SalishSea/hindcast.201905/19feb17/SalishSea_1h_20170219_20170219_ptrc_T.nc /results/SalishSea/hindcast.201905/01mar17/SalishSea_1h_20170301_20170301_ptrc_T.nc /results/SalishSea/hindcast.201905/11mar17/SalishSea_1h_20170311_20170311_ptrc_T.nc /results/SalishSea/hindcast.201905/21mar17/SalishSea_1h_20170321_20170321_ptrc_T.nc /results/SalishSea/hindcast.201905/31mar17/SalishSea_1h_20170331_20170331_ptrc_T.nc /results/SalishSea/hindcast.201905/10apr17/SalishSea_1h_20170410_20170410_ptrc_T.nc /results/SalishSea/hindcast.201905/20apr17/SalishSea_1h_20170420_20170420_ptrc_T.nc /results/SalishSea/hindcast.201905/30apr17/SalishSea_1h_20170430_20170430_ptrc_T.nc /results/SalishSea/hindcast.201905/10may17/SalishSea_1h_20170510_20170510_ptrc_T.nc /results/SalishSea/hindcast.201905/20may17/SalishSea_1h_20170520_20170520_ptrc_T.nc /results/SalishSea/hindcast.201905/30may17/SalishSea_1h_20170530_20170530_ptrc_T.nc /results/SalishSea/hindcast.201905/09jun17/SalishSea_1h_20170609_20170609_ptrc_T.nc /results/SalishSea/hindcast.201905/19jun17/SalishSea_1h_20170619_20170619_ptrc_T.nc /results/SalishSea/hindcast.201905/29jun17/SalishSea_1h_20170629_20170629_ptrc_T.nc /results/SalishSea/hindcast.201905/09jul17/SalishSea_1h_20170709_20170709_ptrc_T.nc /results/SalishSea/hindcast.201905/19jul17/SalishSea_1h_20170719_20170719_ptrc_T.nc /results/SalishSea/hindcast.201905/29jul17/SalishSea_1h_20170729_20170729_ptrc_T.nc /results/SalishSea/hindcast.201905/08aug17/SalishSea_1h_20170808_20170808_ptrc_T.nc /results/SalishSea/hindcast.201905/18aug17/SalishSea_1h_20170818_20170818_ptrc_T.nc /results/SalishSea/hindcast.201905/28aug17/SalishSea_1h_20170828_20170828_ptrc_T.nc /results/SalishSea/hindcast.201905/07sep17/SalishSea_1h_20170907_20170907_ptrc_T.nc /results/SalishSea/hindcast.201905/17sep17/SalishSea_1h_20170917_20170917_ptrc_T.nc /results/SalishSea/hindcast.201905/27sep17/SalishSea_1h_20170927_20170927_ptrc_T.nc /results/SalishSea/hindcast.201905/07oct17/SalishSea_1h_20171007_20171007_ptrc_T.nc /results/SalishSea/hindcast.201905/17oct17/SalishSea_1h_20171017_20171017_ptrc_T.nc /results/SalishSea/hindcast.201905/27oct17/SalishSea_1h_20171027_20171027_ptrc_T.nc /results/SalishSea/hindcast.201905/06nov17/SalishSea_1h_20171106_20171106_ptrc_T.nc /results/SalishSea/hindcast.201905/16nov17/SalishSea_1h_20171116_20171116_ptrc_T.nc /results/SalishSea/hindcast.201905/26nov17/SalishSea_1h_20171126_20171126_ptrc_T.nc /results/SalishSea/hindcast.201905/06dec17/SalishSea_1h_20171206_20171206_ptrc_T.nc /results/SalishSea/hindcast.201905/16dec17/SalishSea_1h_20171216_20171216_ptrc_T.nc /results/SalishSea/hindcast.201905/26dec17/SalishSea_1h_20171226_20171226_ptrc_T.nc /results/SalishSea/hindcast.201905/05jan18/SalishSea_1h_20180105_20180105_ptrc_T.nc /results/SalishSea/hindcast.201905/15jan18/SalishSea_1h_20180115_20180115_ptrc_T.nc /results/SalishSea/hindcast.201905/25jan18/SalishSea_1h_20180125_20180125_ptrc_T.nc /results/SalishSea/hindcast.201905/04feb18/SalishSea_1h_20180204_20180204_ptrc_T.nc /results/SalishSea/hindcast.201905/14feb18/SalishSea_1h_20180214_20180214_ptrc_T.nc /results/SalishSea/hindcast.201905/24feb18/SalishSea_1h_20180224_20180224_ptrc_T.nc /results/SalishSea/hindcast.201905/06mar18/SalishSea_1h_20180306_20180306_ptrc_T.nc /results/SalishSea/hindcast.201905/16mar18/SalishSea_1h_20180316_20180316_ptrc_T.nc /results/SalishSea/hindcast.201905/26mar18/SalishSea_1h_20180326_20180326_ptrc_T.nc /results/SalishSea/hindcast.201905/05apr18/SalishSea_1h_20180405_20180405_ptrc_T.nc /results/SalishSea/hindcast.201905/15apr18/SalishSea_1h_20180415_20180415_ptrc_T.nc /results/SalishSea/hindcast.201905/25apr18/SalishSea_1h_20180425_20180425_ptrc_T.nc /results/SalishSea/hindcast.201905/05may18/SalishSea_1h_20180505_20180505_ptrc_T.nc /results/SalishSea/hindcast.201905/15may18/SalishSea_1h_20180515_20180515_ptrc_T.nc /results/SalishSea/hindcast.201905/25may18/SalishSea_1h_20180525_20180525_ptrc_T.nc /results/SalishSea/hindcast.201905/04jun18/SalishSea_1h_20180604_20180604_ptrc_T.nc /results/SalishSea/hindcast.201905/14jun18/SalishSea_1h_20180614_20180614_ptrc_T.nc /results/SalishSea/hindcast.201905/24jun18/SalishSea_1h_20180624_20180624_ptrc_T.nc /results/SalishSea/hindcast.201905/04jul18/SalishSea_1h_20180704_20180704_ptrc_T.nc /results/SalishSea/hindcast.201905/14jul18/SalishSea_1h_20180714_20180714_ptrc_T.nc /results/SalishSea/hindcast.201905/24jul18/SalishSea_1h_20180724_20180724_ptrc_T.nc /results/SalishSea/hindcast.201905/03aug18/SalishSea_1h_20180803_20180803_ptrc_T.nc /results/SalishSea/hindcast.201905/13aug18/SalishSea_1h_20180813_20180813_ptrc_T.nc /results/SalishSea/hindcast.201905/23aug18/SalishSea_1h_20180823_20180823_ptrc_T.nc /results/SalishSea/hindcast.201905/02sep18/SalishSea_1h_20180902_20180902_ptrc_T.nc /results/SalishSea/hindcast.201905/12sep18/SalishSea_1h_20180912_20180912_ptrc_T.nc /results/SalishSea/hindcast.201905/22sep18/SalishSea_1h_20180922_20180922_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: 1704653365.1410496 std err 20m bsi is: 168321582.56738612
# 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_1h_*_ptrc_T_%Y%m%d-*.nc'
fformatP='SalishSea_1h_*_ptrc_T_%Y%m%d-*.nc'
elif idir.startswith('/results/') or idir.startswith('/results2/') or ('link' in idir):
fformatT='SalishSea_1h_%Y%m%d_%Y%m%d_ptrc_T.nc'
fformatP='SalishSea_1h_%Y%m%d_%Y%m%d_carp_T.nc'
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/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)]
/results/SalishSea/hindcast.201905/01jan13/SalishSea_1h_20130101_20130101_ptrc_T.nc /results/SalishSea/hindcast.201905/11jan13/SalishSea_1h_20130111_20130111_ptrc_T.nc /results/SalishSea/hindcast.201905/21jan13/SalishSea_1h_20130121_20130121_ptrc_T.nc /results/SalishSea/hindcast.201905/31jan13/SalishSea_1h_20130131_20130131_ptrc_T.nc /results/SalishSea/hindcast.201905/10feb13/SalishSea_1h_20130210_20130210_ptrc_T.nc /results/SalishSea/hindcast.201905/20feb13/SalishSea_1h_20130220_20130220_ptrc_T.nc /results/SalishSea/hindcast.201905/02mar13/SalishSea_1h_20130302_20130302_ptrc_T.nc /results/SalishSea/hindcast.201905/12mar13/SalishSea_1h_20130312_20130312_ptrc_T.nc /results/SalishSea/hindcast.201905/22mar13/SalishSea_1h_20130322_20130322_ptrc_T.nc /results/SalishSea/hindcast.201905/01apr13/SalishSea_1h_20130401_20130401_ptrc_T.nc /results/SalishSea/hindcast.201905/11apr13/SalishSea_1h_20130411_20130411_ptrc_T.nc /results/SalishSea/hindcast.201905/21apr13/SalishSea_1h_20130421_20130421_ptrc_T.nc /results/SalishSea/hindcast.201905/01may13/SalishSea_1h_20130501_20130501_ptrc_T.nc /results/SalishSea/hindcast.201905/11may13/SalishSea_1h_20130511_20130511_ptrc_T.nc /results/SalishSea/hindcast.201905/21may13/SalishSea_1h_20130521_20130521_ptrc_T.nc /results/SalishSea/hindcast.201905/31may13/SalishSea_1h_20130531_20130531_ptrc_T.nc /results/SalishSea/hindcast.201905/10jun13/SalishSea_1h_20130610_20130610_ptrc_T.nc /results/SalishSea/hindcast.201905/20jun13/SalishSea_1h_20130620_20130620_ptrc_T.nc /results/SalishSea/hindcast.201905/30jun13/SalishSea_1h_20130630_20130630_ptrc_T.nc /results/SalishSea/hindcast.201905/10jul13/SalishSea_1h_20130710_20130710_ptrc_T.nc /results/SalishSea/hindcast.201905/20jul13/SalishSea_1h_20130720_20130720_ptrc_T.nc /results/SalishSea/hindcast.201905/30jul13/SalishSea_1h_20130730_20130730_ptrc_T.nc /results/SalishSea/hindcast.201905/09aug13/SalishSea_1h_20130809_20130809_ptrc_T.nc /results/SalishSea/hindcast.201905/19aug13/SalishSea_1h_20130819_20130819_ptrc_T.nc /results/SalishSea/hindcast.201905/29aug13/SalishSea_1h_20130829_20130829_ptrc_T.nc /results/SalishSea/hindcast.201905/08sep13/SalishSea_1h_20130908_20130908_ptrc_T.nc /results/SalishSea/hindcast.201905/18sep13/SalishSea_1h_20130918_20130918_ptrc_T.nc /results/SalishSea/hindcast.201905/28sep13/SalishSea_1h_20130928_20130928_ptrc_T.nc /results/SalishSea/hindcast.201905/08oct13/SalishSea_1h_20131008_20131008_ptrc_T.nc /results/SalishSea/hindcast.201905/18oct13/SalishSea_1h_20131018_20131018_ptrc_T.nc /results/SalishSea/hindcast.201905/28oct13/SalishSea_1h_20131028_20131028_ptrc_T.nc /results/SalishSea/hindcast.201905/07nov13/SalishSea_1h_20131107_20131107_ptrc_T.nc /results/SalishSea/hindcast.201905/17nov13/SalishSea_1h_20131117_20131117_ptrc_T.nc /results/SalishSea/hindcast.201905/27nov13/SalishSea_1h_20131127_20131127_ptrc_T.nc /results/SalishSea/hindcast.201905/07dec13/SalishSea_1h_20131207_20131207_ptrc_T.nc /results/SalishSea/hindcast.201905/17dec13/SalishSea_1h_20131217_20131217_ptrc_T.nc /results/SalishSea/hindcast.201905/27dec13/SalishSea_1h_20131227_20131227_ptrc_T.nc /results/SalishSea/hindcast.201905/06jan14/SalishSea_1h_20140106_20140106_ptrc_T.nc /results/SalishSea/hindcast.201905/16jan14/SalishSea_1h_20140116_20140116_ptrc_T.nc /results/SalishSea/hindcast.201905/26jan14/SalishSea_1h_20140126_20140126_ptrc_T.nc /results/SalishSea/hindcast.201905/05feb14/SalishSea_1h_20140205_20140205_ptrc_T.nc /results/SalishSea/hindcast.201905/15feb14/SalishSea_1h_20140215_20140215_ptrc_T.nc /results/SalishSea/hindcast.201905/25feb14/SalishSea_1h_20140225_20140225_ptrc_T.nc /results/SalishSea/hindcast.201905/07mar14/SalishSea_1h_20140307_20140307_ptrc_T.nc /results/SalishSea/hindcast.201905/17mar14/SalishSea_1h_20140317_20140317_ptrc_T.nc /results/SalishSea/hindcast.201905/27mar14/SalishSea_1h_20140327_20140327_ptrc_T.nc /results/SalishSea/hindcast.201905/06apr14/SalishSea_1h_20140406_20140406_ptrc_T.nc /results/SalishSea/hindcast.201905/16apr14/SalishSea_1h_20140416_20140416_ptrc_T.nc /results/SalishSea/hindcast.201905/26apr14/SalishSea_1h_20140426_20140426_ptrc_T.nc /results/SalishSea/hindcast.201905/06may14/SalishSea_1h_20140506_20140506_ptrc_T.nc /results/SalishSea/hindcast.201905/16may14/SalishSea_1h_20140516_20140516_ptrc_T.nc /results/SalishSea/hindcast.201905/26may14/SalishSea_1h_20140526_20140526_ptrc_T.nc /results/SalishSea/hindcast.201905/05jun14/SalishSea_1h_20140605_20140605_ptrc_T.nc /results/SalishSea/hindcast.201905/15jun14/SalishSea_1h_20140615_20140615_ptrc_T.nc /results/SalishSea/hindcast.201905/25jun14/SalishSea_1h_20140625_20140625_ptrc_T.nc /results/SalishSea/hindcast.201905/05jul14/SalishSea_1h_20140705_20140705_ptrc_T.nc /results/SalishSea/hindcast.201905/15jul14/SalishSea_1h_20140715_20140715_ptrc_T.nc /results/SalishSea/hindcast.201905/25jul14/SalishSea_1h_20140725_20140725_ptrc_T.nc /results/SalishSea/hindcast.201905/04aug14/SalishSea_1h_20140804_20140804_ptrc_T.nc /results/SalishSea/hindcast.201905/14aug14/SalishSea_1h_20140814_20140814_ptrc_T.nc /results/SalishSea/hindcast.201905/24aug14/SalishSea_1h_20140824_20140824_ptrc_T.nc /results/SalishSea/hindcast.201905/03sep14/SalishSea_1h_20140903_20140903_ptrc_T.nc /results/SalishSea/hindcast.201905/13sep14/SalishSea_1h_20140913_20140913_ptrc_T.nc /results/SalishSea/hindcast.201905/23sep14/SalishSea_1h_20140923_20140923_ptrc_T.nc /results/SalishSea/hindcast.201905/03oct14/SalishSea_1h_20141003_20141003_ptrc_T.nc /results/SalishSea/hindcast.201905/13oct14/SalishSea_1h_20141013_20141013_ptrc_T.nc /results/SalishSea/hindcast.201905/23oct14/SalishSea_1h_20141023_20141023_ptrc_T.nc /results/SalishSea/hindcast.201905/02nov14/SalishSea_1h_20141102_20141102_ptrc_T.nc /results/SalishSea/hindcast.201905/12nov14/SalishSea_1h_20141112_20141112_ptrc_T.nc /results/SalishSea/hindcast.201905/22nov14/SalishSea_1h_20141122_20141122_ptrc_T.nc /results/SalishSea/hindcast.201905/02dec14/SalishSea_1h_20141202_20141202_ptrc_T.nc /results/SalishSea/hindcast.201905/12dec14/SalishSea_1h_20141212_20141212_ptrc_T.nc /results/SalishSea/hindcast.201905/22dec14/SalishSea_1h_20141222_20141222_ptrc_T.nc /results/SalishSea/hindcast.201905/01jan15/SalishSea_1h_20150101_20150101_ptrc_T.nc /results/SalishSea/hindcast.201905/11jan15/SalishSea_1h_20150111_20150111_ptrc_T.nc /results/SalishSea/hindcast.201905/21jan15/SalishSea_1h_20150121_20150121_ptrc_T.nc /results/SalishSea/hindcast.201905/31jan15/SalishSea_1h_20150131_20150131_ptrc_T.nc /results/SalishSea/hindcast.201905/10feb15/SalishSea_1h_20150210_20150210_ptrc_T.nc /results/SalishSea/hindcast.201905/20feb15/SalishSea_1h_20150220_20150220_ptrc_T.nc /results/SalishSea/hindcast.201905/02mar15/SalishSea_1h_20150302_20150302_ptrc_T.nc /results/SalishSea/hindcast.201905/12mar15/SalishSea_1h_20150312_20150312_ptrc_T.nc /results/SalishSea/hindcast.201905/22mar15/SalishSea_1h_20150322_20150322_ptrc_T.nc /results/SalishSea/hindcast.201905/01apr15/SalishSea_1h_20150401_20150401_ptrc_T.nc /results/SalishSea/hindcast.201905/11apr15/SalishSea_1h_20150411_20150411_ptrc_T.nc /results/SalishSea/hindcast.201905/21apr15/SalishSea_1h_20150421_20150421_ptrc_T.nc /results/SalishSea/hindcast.201905/01may15/SalishSea_1h_20150501_20150501_ptrc_T.nc /results/SalishSea/hindcast.201905/11may15/SalishSea_1h_20150511_20150511_ptrc_T.nc /results/SalishSea/hindcast.201905/21may15/SalishSea_1h_20150521_20150521_ptrc_T.nc /results/SalishSea/hindcast.201905/31may15/SalishSea_1h_20150531_20150531_ptrc_T.nc /results/SalishSea/hindcast.201905/10jun15/SalishSea_1h_20150610_20150610_ptrc_T.nc /results/SalishSea/hindcast.201905/20jun15/SalishSea_1h_20150620_20150620_ptrc_T.nc /results/SalishSea/hindcast.201905/30jun15/SalishSea_1h_20150630_20150630_ptrc_T.nc /results/SalishSea/hindcast.201905/10jul15/SalishSea_1h_20150710_20150710_ptrc_T.nc /results/SalishSea/hindcast.201905/20jul15/SalishSea_1h_20150720_20150720_ptrc_T.nc /results/SalishSea/hindcast.201905/30jul15/SalishSea_1h_20150730_20150730_ptrc_T.nc /results/SalishSea/hindcast.201905/09aug15/SalishSea_1h_20150809_20150809_ptrc_T.nc /results/SalishSea/hindcast.201905/19aug15/SalishSea_1h_20150819_20150819_ptrc_T.nc /results/SalishSea/hindcast.201905/29aug15/SalishSea_1h_20150829_20150829_ptrc_T.nc /results/SalishSea/hindcast.201905/08sep15/SalishSea_1h_20150908_20150908_ptrc_T.nc /results/SalishSea/hindcast.201905/18sep15/SalishSea_1h_20150918_20150918_ptrc_T.nc /results/SalishSea/hindcast.201905/28sep15/SalishSea_1h_20150928_20150928_ptrc_T.nc /results/SalishSea/hindcast.201905/08oct15/SalishSea_1h_20151008_20151008_ptrc_T.nc /results/SalishSea/hindcast.201905/18oct15/SalishSea_1h_20151018_20151018_ptrc_T.nc /results/SalishSea/hindcast.201905/28oct15/SalishSea_1h_20151028_20151028_ptrc_T.nc /results/SalishSea/hindcast.201905/07nov15/SalishSea_1h_20151107_20151107_ptrc_T.nc /results/SalishSea/hindcast.201905/17nov15/SalishSea_1h_20151117_20151117_ptrc_T.nc /results/SalishSea/hindcast.201905/27nov15/SalishSea_1h_20151127_20151127_ptrc_T.nc /results/SalishSea/hindcast.201905/07dec15/SalishSea_1h_20151207_20151207_ptrc_T.nc /results/SalishSea/hindcast.201905/17dec15/SalishSea_1h_20151217_20151217_ptrc_T.nc /results/SalishSea/hindcast.201905/27dec15/SalishSea_1h_20151227_20151227_ptrc_T.nc /results/SalishSea/hindcast.201905/06jan16/SalishSea_1h_20160106_20160106_ptrc_T.nc /results/SalishSea/hindcast.201905/16jan16/SalishSea_1h_20160116_20160116_ptrc_T.nc /results/SalishSea/hindcast.201905/26jan16/SalishSea_1h_20160126_20160126_ptrc_T.nc /results/SalishSea/hindcast.201905/05feb16/SalishSea_1h_20160205_20160205_ptrc_T.nc /results/SalishSea/hindcast.201905/15feb16/SalishSea_1h_20160215_20160215_ptrc_T.nc /results/SalishSea/hindcast.201905/25feb16/SalishSea_1h_20160225_20160225_ptrc_T.nc /results/SalishSea/hindcast.201905/06mar16/SalishSea_1h_20160306_20160306_ptrc_T.nc /results/SalishSea/hindcast.201905/16mar16/SalishSea_1h_20160316_20160316_ptrc_T.nc /results/SalishSea/hindcast.201905/26mar16/SalishSea_1h_20160326_20160326_ptrc_T.nc /results/SalishSea/hindcast.201905/05apr16/SalishSea_1h_20160405_20160405_ptrc_T.nc /results/SalishSea/hindcast.201905/15apr16/SalishSea_1h_20160415_20160415_ptrc_T.nc /results/SalishSea/hindcast.201905/25apr16/SalishSea_1h_20160425_20160425_ptrc_T.nc /results/SalishSea/hindcast.201905/05may16/SalishSea_1h_20160505_20160505_ptrc_T.nc /results/SalishSea/hindcast.201905/15may16/SalishSea_1h_20160515_20160515_ptrc_T.nc /results/SalishSea/hindcast.201905/25may16/SalishSea_1h_20160525_20160525_ptrc_T.nc /results/SalishSea/hindcast.201905/04jun16/SalishSea_1h_20160604_20160604_ptrc_T.nc /results/SalishSea/hindcast.201905/14jun16/SalishSea_1h_20160614_20160614_ptrc_T.nc /results/SalishSea/hindcast.201905/24jun16/SalishSea_1h_20160624_20160624_ptrc_T.nc /results/SalishSea/hindcast.201905/04jul16/SalishSea_1h_20160704_20160704_ptrc_T.nc /results/SalishSea/hindcast.201905/14jul16/SalishSea_1h_20160714_20160714_ptrc_T.nc /results/SalishSea/hindcast.201905/24jul16/SalishSea_1h_20160724_20160724_ptrc_T.nc /results/SalishSea/hindcast.201905/03aug16/SalishSea_1h_20160803_20160803_ptrc_T.nc /results/SalishSea/hindcast.201905/13aug16/SalishSea_1h_20160813_20160813_ptrc_T.nc /results/SalishSea/hindcast.201905/23aug16/SalishSea_1h_20160823_20160823_ptrc_T.nc /results/SalishSea/hindcast.201905/02sep16/SalishSea_1h_20160902_20160902_ptrc_T.nc /results/SalishSea/hindcast.201905/12sep16/SalishSea_1h_20160912_20160912_ptrc_T.nc /results/SalishSea/hindcast.201905/22sep16/SalishSea_1h_20160922_20160922_ptrc_T.nc /results/SalishSea/hindcast.201905/02oct16/SalishSea_1h_20161002_20161002_ptrc_T.nc /results/SalishSea/hindcast.201905/12oct16/SalishSea_1h_20161012_20161012_ptrc_T.nc /results/SalishSea/hindcast.201905/22oct16/SalishSea_1h_20161022_20161022_ptrc_T.nc /results/SalishSea/hindcast.201905/01nov16/SalishSea_1h_20161101_20161101_ptrc_T.nc /results/SalishSea/hindcast.201905/11nov16/SalishSea_1h_20161111_20161111_ptrc_T.nc /results/SalishSea/hindcast.201905/21nov16/SalishSea_1h_20161121_20161121_ptrc_T.nc /results/SalishSea/hindcast.201905/01dec16/SalishSea_1h_20161201_20161201_ptrc_T.nc /results/SalishSea/hindcast.201905/11dec16/SalishSea_1h_20161211_20161211_ptrc_T.nc /results/SalishSea/hindcast.201905/21dec16/SalishSea_1h_20161221_20161221_ptrc_T.nc /results/SalishSea/hindcast.201905/31dec16/SalishSea_1h_20161231_20161231_ptrc_T.nc /results/SalishSea/hindcast.201905/10jan17/SalishSea_1h_20170110_20170110_ptrc_T.nc /results/SalishSea/hindcast.201905/20jan17/SalishSea_1h_20170120_20170120_ptrc_T.nc /results/SalishSea/hindcast.201905/30jan17/SalishSea_1h_20170130_20170130_ptrc_T.nc /results/SalishSea/hindcast.201905/09feb17/SalishSea_1h_20170209_20170209_ptrc_T.nc /results/SalishSea/hindcast.201905/19feb17/SalishSea_1h_20170219_20170219_ptrc_T.nc /results/SalishSea/hindcast.201905/01mar17/SalishSea_1h_20170301_20170301_ptrc_T.nc /results/SalishSea/hindcast.201905/11mar17/SalishSea_1h_20170311_20170311_ptrc_T.nc /results/SalishSea/hindcast.201905/21mar17/SalishSea_1h_20170321_20170321_ptrc_T.nc /results/SalishSea/hindcast.201905/31mar17/SalishSea_1h_20170331_20170331_ptrc_T.nc /results/SalishSea/hindcast.201905/10apr17/SalishSea_1h_20170410_20170410_ptrc_T.nc /results/SalishSea/hindcast.201905/20apr17/SalishSea_1h_20170420_20170420_ptrc_T.nc /results/SalishSea/hindcast.201905/30apr17/SalishSea_1h_20170430_20170430_ptrc_T.nc /results/SalishSea/hindcast.201905/10may17/SalishSea_1h_20170510_20170510_ptrc_T.nc /results/SalishSea/hindcast.201905/20may17/SalishSea_1h_20170520_20170520_ptrc_T.nc /results/SalishSea/hindcast.201905/30may17/SalishSea_1h_20170530_20170530_ptrc_T.nc /results/SalishSea/hindcast.201905/09jun17/SalishSea_1h_20170609_20170609_ptrc_T.nc /results/SalishSea/hindcast.201905/19jun17/SalishSea_1h_20170619_20170619_ptrc_T.nc /results/SalishSea/hindcast.201905/29jun17/SalishSea_1h_20170629_20170629_ptrc_T.nc /results/SalishSea/hindcast.201905/09jul17/SalishSea_1h_20170709_20170709_ptrc_T.nc /results/SalishSea/hindcast.201905/19jul17/SalishSea_1h_20170719_20170719_ptrc_T.nc /results/SalishSea/hindcast.201905/29jul17/SalishSea_1h_20170729_20170729_ptrc_T.nc /results/SalishSea/hindcast.201905/08aug17/SalishSea_1h_20170808_20170808_ptrc_T.nc /results/SalishSea/hindcast.201905/18aug17/SalishSea_1h_20170818_20170818_ptrc_T.nc /results/SalishSea/hindcast.201905/28aug17/SalishSea_1h_20170828_20170828_ptrc_T.nc /results/SalishSea/hindcast.201905/07sep17/SalishSea_1h_20170907_20170907_ptrc_T.nc /results/SalishSea/hindcast.201905/17sep17/SalishSea_1h_20170917_20170917_ptrc_T.nc /results/SalishSea/hindcast.201905/27sep17/SalishSea_1h_20170927_20170927_ptrc_T.nc /results/SalishSea/hindcast.201905/07oct17/SalishSea_1h_20171007_20171007_ptrc_T.nc /results/SalishSea/hindcast.201905/17oct17/SalishSea_1h_20171017_20171017_ptrc_T.nc /results/SalishSea/hindcast.201905/27oct17/SalishSea_1h_20171027_20171027_ptrc_T.nc /results/SalishSea/hindcast.201905/06nov17/SalishSea_1h_20171106_20171106_ptrc_T.nc /results/SalishSea/hindcast.201905/16nov17/SalishSea_1h_20171116_20171116_ptrc_T.nc /results/SalishSea/hindcast.201905/26nov17/SalishSea_1h_20171126_20171126_ptrc_T.nc /results/SalishSea/hindcast.201905/06dec17/SalishSea_1h_20171206_20171206_ptrc_T.nc /results/SalishSea/hindcast.201905/16dec17/SalishSea_1h_20171216_20171216_ptrc_T.nc /results/SalishSea/hindcast.201905/26dec17/SalishSea_1h_20171226_20171226_ptrc_T.nc /results/SalishSea/hindcast.201905/05jan18/SalishSea_1h_20180105_20180105_ptrc_T.nc /results/SalishSea/hindcast.201905/15jan18/SalishSea_1h_20180115_20180115_ptrc_T.nc /results/SalishSea/hindcast.201905/25jan18/SalishSea_1h_20180125_20180125_ptrc_T.nc /results/SalishSea/hindcast.201905/04feb18/SalishSea_1h_20180204_20180204_ptrc_T.nc /results/SalishSea/hindcast.201905/14feb18/SalishSea_1h_20180214_20180214_ptrc_T.nc /results/SalishSea/hindcast.201905/24feb18/SalishSea_1h_20180224_20180224_ptrc_T.nc /results/SalishSea/hindcast.201905/06mar18/SalishSea_1h_20180306_20180306_ptrc_T.nc /results/SalishSea/hindcast.201905/16mar18/SalishSea_1h_20180316_20180316_ptrc_T.nc /results/SalishSea/hindcast.201905/26mar18/SalishSea_1h_20180326_20180326_ptrc_T.nc /results/SalishSea/hindcast.201905/05apr18/SalishSea_1h_20180405_20180405_ptrc_T.nc /results/SalishSea/hindcast.201905/15apr18/SalishSea_1h_20180415_20180415_ptrc_T.nc /results/SalishSea/hindcast.201905/25apr18/SalishSea_1h_20180425_20180425_ptrc_T.nc /results/SalishSea/hindcast.201905/05may18/SalishSea_1h_20180505_20180505_ptrc_T.nc /results/SalishSea/hindcast.201905/15may18/SalishSea_1h_20180515_20180515_ptrc_T.nc /results/SalishSea/hindcast.201905/25may18/SalishSea_1h_20180525_20180525_ptrc_T.nc /results/SalishSea/hindcast.201905/04jun18/SalishSea_1h_20180604_20180604_ptrc_T.nc /results/SalishSea/hindcast.201905/14jun18/SalishSea_1h_20180614_20180614_ptrc_T.nc /results/SalishSea/hindcast.201905/24jun18/SalishSea_1h_20180624_20180624_ptrc_T.nc /results/SalishSea/hindcast.201905/04jul18/SalishSea_1h_20180704_20180704_ptrc_T.nc /results/SalishSea/hindcast.201905/14jul18/SalishSea_1h_20180714_20180714_ptrc_T.nc /results/SalishSea/hindcast.201905/24jul18/SalishSea_1h_20180724_20180724_ptrc_T.nc /results/SalishSea/hindcast.201905/03aug18/SalishSea_1h_20180803_20180803_ptrc_T.nc /results/SalishSea/hindcast.201905/13aug18/SalishSea_1h_20180813_20180813_ptrc_T.nc /results/SalishSea/hindcast.201905/23aug18/SalishSea_1h_20180823_20180823_ptrc_T.nc /results/SalishSea/hindcast.201905/02sep18/SalishSea_1h_20180902_20180902_ptrc_T.nc /results/SalishSea/hindcast.201905/12sep18/SalishSea_1h_20180912_20180912_ptrc_T.nc /results/SalishSea/hindcast.201905/22sep18/SalishSea_1h_20180922_20180922_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(SiGlobalTot[sdir1],open('SiGlobalTot_HC1905.pkl','wb'))
pickle.dump(NGlobalTot[sdir1],open('NGlobalTot_HC1905.pkl','wb'))
SiGlobalTotHC=pickle.load(open('SiGlobalTot_HC1905.pkl','rb'))
NGlobalTotHC=pickle.load(open('NGlobalTot_HC1905.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([t0+dt.timedelta(10*ii) for ii in range(0,len(SiGlobalTotHC))],SiGlobalTotHC,'y-')
plt.plot([t0+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 0x7f2e14fd7b00>]