tbl=tblList(('Budget Component','2015','2016','2017'),'fluxesTBL.tex')
tbl.addlines('Primary Production',
-1*(sums[2015]['NO3-based Primary Production']+sums[2015]['NH4-based Primary Production']),
-1*(sums[2016]['NO3-based Primary Production']+sums[2016]['NH4-based Primary Production']),
-1*(sums[2017]['NO3-based Primary Production']+sums[2017]['NH4-based Primary Production']))
tbl.addlinesSub(' NO$_3$-based',
-1*sums[2015]['NO3-based Primary Production'],
-1*sums[2016]['NO3-based Primary Production'],
-1*sums[2017]['NO3-based Primary Production'])
tbl.addlinesSub(' NH$_4$-based',
-1*sums[2015]['NH4-based Primary Production'],
-1*sums[2016]['NH4-based Primary Production'],
-1*sums[2017]['NH4-based Primary Production'])
tbl.addlines('Remineralization (to NH$_4$)',
-1*sums[2015]['PON&DON->NH4'],
-1*sums[2016]['PON&DON->NH4'],
-1*sums[2017]['PON&DON->NH4'])
tbl.addlines('Nitrification',
sums[2015]['Nitrification'],
sums[2016]['Nitrification'],
sums[2017]['Nitrification'])
#tbl.addlines('Remineralization (to NH$_4$)',
# sums[2015]['PON&DON->NH4'],
# sums[2016]['PON&DON->NH4'],
# sums[2017]['PON&DON->NH4'])
#tbl.addlines('Loss to Refractory Pool',
# sums[2015]['To Refractory N'],
# sums[2016]['To Refractory N'],
# sums[2017]['To Refractory N'])
tbl.addlines('Loss to Sediments',
-1*(sums[2015]['Bottom flux diatoms']+sums[2015]['Bottom flux PON']),
-1*(sums[2016]['Bottom flux diatoms']+sums[2016]['Bottom flux PON']),
-1*(sums[2017]['Bottom flux diatoms']+sums[2017]['Bottom flux PON']))
tbl.addlinesSub(' diatoms',
-1*sums[2015]['Bottom flux diatoms'],
-1*sums[2016]['Bottom flux diatoms'],
-1*sums[2017]['Bottom flux diatoms'])
tbl.addlinesSub(' detrital PON',
-1*sums[2015]['Bottom flux PON'],
-1*sums[2016]['Bottom flux PON'],
-1*sums[2017]['Bottom flux PON'])
tbl.addlines('Rivers (DIN)',
sums[2015]['DIN (NH4+NO3) from Rivers'],
sums[2016]['DIN (NH4+NO3) from Rivers'],
sums[2017]['DIN (NH4+NO3) from Rivers'])
tbl.addlinesSub('NO$_3$',
sums[2015]['Rivers NO3'],
sums[2016]['Rivers NO3'],
sums[2017]['Rivers NO3'])
tbl.addlinesSub('NH$_4$',
sums[2015]['DIN (NH4+NO3) from Rivers']-sums[2015]['Rivers NO3'],
sums[2016]['DIN (NH4+NO3) from Rivers']-sums[2016]['Rivers NO3'],
sums[2017]['DIN (NH4+NO3) from Rivers']-sums[2017]['Rivers NO3'])
tbl.addlines('Deep Transport, Haro Strait',
sums[2015]['Deep Haro Strait NO3']+sums[2015]['Deep Haro Strait NH4']+\
sums[2015]['Deep Haro Strait PON']+sums[2015]['Deep Haro Strait DON']+sums[2015]['Deep Haro Strait Living'],
sums[2016]['Deep Haro Strait NO3']+sums[2016]['Deep Haro Strait NH4']+\
sums[2016]['Deep Haro Strait PON']+sums[2016]['Deep Haro Strait DON']+sums[2016]['Deep Haro Strait Living'],
sums[2017]['Deep Haro Strait NO3']+sums[2017]['Deep Haro Strait NH4']+\
sums[2017]['Deep Haro Strait PON']+sums[2017]['Deep Haro Strait DON']+sums[2017]['Deep Haro Strait Living'])
tbl.addlinesSub('NO$_3$',
sums[2015]['Deep Haro Strait NO3'],
sums[2016]['Deep Haro Strait NO3'],
sums[2017]['Deep Haro Strait NO3'])
tbl.addlinesSub('NH$_4$',
sums[2015]['Deep Haro Strait NH4'],
sums[2016]['Deep Haro Strait NH4'],
sums[2017]['Deep Haro Strait NH4'])
tbl.addlinesSub('detrital PON',
sums[2015]['Deep Haro Strait PON'],
sums[2016]['Deep Haro Strait PON'],
sums[2017]['Deep Haro Strait PON'])
tbl.addlinesSub('DON',
sums[2015]['Deep Haro Strait DON'],
sums[2016]['Deep Haro Strait DON'],
sums[2017]['Deep Haro Strait DON'])
tbl.addlinesSub('Living',
sums[2015]['Deep Haro Strait Living'],
sums[2016]['Deep Haro Strait Living'],
sums[2017]['Deep Haro Strait Living'])
tbl.addlines('Total Transport, Haro Strait',
sums[2015]['Haro Strait NO3']+sums[2015]['Haro Strait NH4']+\
sums[2015]['Haro Strait PON']+sums[2015]['Haro Strait DON']+sums[2015]['Haro Strait Living'],
sums[2016]['Haro Strait NO3']+sums[2016]['Haro Strait NH4']+\
sums[2016]['Haro Strait PON']+sums[2016]['Haro Strait DON']+sums[2016]['Haro Strait Living'],
sums[2017]['Haro Strait NO3']+sums[2017]['Haro Strait NH4']+\
sums[2017]['Haro Strait PON']+sums[2017]['Haro Strait DON']+sums[2017]['Haro Strait Living'])
tbl.addlinesSub('NO$_3$',
sums[2015]['Haro Strait NO3'],
sums[2016]['Haro Strait NO3'],
sums[2017]['Haro Strait NO3'])
tbl.addlinesSub('NH$_4$',
sums[2015]['Haro Strait NH4'],
sums[2016]['Haro Strait NH4'],
sums[2017]['Haro Strait NH4'])
tbl.addlinesSub('detrital PON',
sums[2015]['Haro Strait PON'],
sums[2016]['Haro Strait PON'],
sums[2017]['Haro Strait PON'])
tbl.addlinesSub('DON',
sums[2015]['Haro Strait DON'],
sums[2016]['Haro Strait DON'],
sums[2017]['Haro Strait DON'])
tbl.addlinesSub('Living',
sums[2015]['Haro Strait Living'],
sums[2016]['Haro Strait Living'],
sums[2017]['Haro Strait Living'])
tbl.addlines('Total Transport, Southern Straits',
sums[2015]['Southern NO3']+sums[2015]['Southern NH4']+\
sums[2015]['Southern PON']+sums[2015]['Southern DON']+sums[2015]['Southern Living'],
sums[2016]['Southern NO3']+sums[2016]['Southern NH4']+\
sums[2016]['Southern PON']+sums[2016]['Southern DON']+sums[2016]['Southern Living'],
sums[2017]['Southern NO3']+sums[2017]['Southern NH4']+\
sums[2017]['Southern PON']+sums[2017]['Southern DON']+sums[2017]['Southern Living'])
tbl.addlinesSub('NO$_3$',
sums[2015]['Southern NO3'],
sums[2016]['Southern NO3'],
sums[2017]['Southern NO3'])
tbl.addlinesSub('NH$_4$',
sums[2015]['Southern NH4'],
sums[2016]['Southern NH4'],
sums[2017]['Southern NH4'])
tbl.addlinesSub('detrital PON',
sums[2015]['Southern PON'],
sums[2016]['Southern PON'],
sums[2017]['Southern PON'])
tbl.addlinesSub('DON',
sums[2015]['Southern DON'],
sums[2016]['Southern DON'],
sums[2017]['Southern DON'])
tbl.addlinesSub('Living',
sums[2015]['Southern Living'],
sums[2016]['Southern Living'],
sums[2017]['Southern Living'])
tbl.addlines('Total Transport, Northern Straits',
sums[2015]['Northern NO3']+sums[2015]['Northern NH4']+\
sums[2015]['Northern PON']+sums[2015]['Northern DON']+sums[2015]['Northern Living'],
sums[2016]['Northern NO3']+sums[2016]['Northern NH4']+\
sums[2016]['Northern PON']+sums[2016]['Northern DON']+sums[2016]['Northern Living'],
sums[2017]['Northern NO3']+sums[2017]['Northern NH4']+\
sums[2017]['Northern PON']+sums[2017]['Northern DON']+sums[2017]['Northern Living'])
tbl.addlinesSub('NO$_3$',
sums[2015]['Northern NO3'],
sums[2016]['Northern NO3'],
sums[2017]['Northern NO3'])
tbl.addlinesSub('NH$_4$',
sums[2015]['Northern NH4'],
sums[2016]['Northern NH4'],
sums[2017]['Northern NH4'])
tbl.addlinesSub('detrital PON',
sums[2015]['Northern PON'],
sums[2016]['Northern PON'],
sums[2017]['Northern PON'])
tbl.addlinesSub('DON',
sums[2015]['Northern DON'],
sums[2016]['Northern DON'],
sums[2017]['Northern DON'])
tbl.addlinesSub('Living',
sums[2015]['Northern Living'],
sums[2016]['Northern Living'],
sums[2017]['Northern Living'])
tbl.addlines('Net Change',
sums[2015]['Net change'],
sums[2016]['Net change'],
sums[2017]['Net change'])
tbl.finish()
tbl.write()