In [ ]:
# this code assume you have cloned the ecoop GIT repository into your PYTHONPATH directory

In [ ]:
from ecoop.ecooputil import shareUtil
from ecoop.cf import cfData, cfPlot, cfPrint
from ecoop.ecooprovdict import ecooProvDict

In [ ]:
util = shareUtil()
cfd = cfData()
cfp = cfPlot()
cft = cfPrint()

In [ ]:
ID = util.get_id('Climate-forcing_pdf')

In [ ]:
# set the ECOOP PROV 
# ecoop:IPythonNotebookRun startedAtTime  
from datetime import datetime
ecooProvDict['IPythonNotebookRun']['startedAtTime'] = util.getTime()

Climate Forcing

Climate patterns over the North Atlantic are important drivers of oceanographic conditions and ecosystem states. Steadily increasing atmospheric carbon dioxide levels can not only affect climate on global and regional scales but alter critical aspects of ocean chemistry. Here, we describe the atmospheric forcing mechanisms related to climate in this region including large-scale atmospheric pressure systems, natural ocean temperature cycles in the North Atlantic, components of the large-scale circulation of the Atlantic Ocean, and issues related to ocean acidification.


In [ ]:
%%file {ID}/climate_forcing.txt
Climate patterns over the North Atlantic are important drivers of oceanographic conditions and ecosystem states. 
Steadily increasing atmospheric carbon dioxide levels can not only affect climate on global and regional scales 
but alter critical aspects of ocean chemistry. Here, we describe the atmospheric forcing mechanisms related 
to climate in this region including large-scale atmospheric pressure systems, natural ocean temperature cycles in the North Atlantic, 
components of the large-scale circulation of the Atlantic Ocean, and issues related to ocean acidification.

North Atlantic Osccilation (NAO)

Climate and weather over the North Atlantic are strongly influenced by the relative strengths of two large-scale atmospheric pressure cells -- the Icelandic Low and the Azores High [4]. As the relative strengths of these two pressure systems vary, characteristic patterns of temperature, precipitation, and wind fields are observed. An index of this dipole pattern has been developed based on the standardized difference in sea level pressure between Lisbon, Portugal and Reykjavík, Iceland in the winter (December-February; see Glossary for a description of methods used to create standardized indicators). This North Atlantic Oscillation (NAO) index has been related to key oceanographic and ecological processes in the North Atlantic basin [5].
When the NAO index is high (positive NAO state), the westerly winds shift northward and increase in strength. Additionally, there is an increase in precipitation over southeastern Canada, the eastern seaboard of the United States, and northwestern Europe. Water temperatures are cool off Labrador and northern Newfoundland, influencing the formation of Deep Labrador Slope water, but warm off the United States. Conversely, when the NAO index is low (negative NAO state), there is a southward shift and decrease in westerly winds, decreased storminess, and drier conditions over southeastern Canada, the eastern United States, and northwestern Europe. Water temperatures are warmer off Labrador and Newfoundland, but cooler off the eastern United States. Since 1972, the NAO has primarily been in a positive state (Figure 1), although notable short-term reversals to a negative state have been observed during this period. Changes in the NAO have been linked to changes in plankton community composition in the North Atlantic, reflecting changes in both the distribution and abundance of warm and cold-temperate species.


In [ ]:
%%file {ID}/nao.txt
Climate and weather over the North Atlantic are strongly influenced by the relative strengths 
of two large-scale atmospheric pressure cells -- the Icelandic Low and the Azores High [4]. 
As the relative strengths of these two pressure systems vary, characteristic patterns of temperature, precipitation, and wind fields are observed. 
An index of this dipole pattern has been developed based on the standardized difference in sea level pressure between Lisbon, Portugal and Reykjavík, 
Iceland in the winter (December-February; see Glossary for a description of methods used to create standardized indicators). 
This North Atlantic Oscillation (NAO) index has been related to key oceanographic and ecological processes in the North Atlantic basin [5].  
When the NAO index is high (positive NAO state), the westerly winds shift northward and increase in strength. 
Additionally, there is an increase in precipitation over southeastern Canada, the eastern seaboard of the United States, 
and northwestern Europe. Water temperatures are cool off Labrador and northern Newfoundland, influencing the formation of Deep Labrador Slope water, 
but warm off the United States. 
Conversely, when the NAO index is low (negative NAO state), there is a southward shift and decrease in westerly winds, decreased storminess, 
and drier conditions over southeastern Canada, the eastern United States, and northwestern Europe. 
Water temperatures are warmer off Labrador and Newfoundland, but cooler off the eastern United States. 
Since 1972, the NAO has primarily been in a positive state (Figure 1), although notable short-term reversals to a negative state have been observed during this period. 
Changes in the NAO have been linked to changes in plankton community composition in the North Atlantic, reflecting changes in both the distribution 
and abundance of warm and cold-temperate species.

In [ ]:
naodata = cfd.nao_get(save=ID, csvout="nao.csv")
cfp.plot_index(name='NAO_lowess', xticks=10, xticks_fontsize=10, 
               data=naodata, nb='y', scategory='lowess', frac=1./6, it=6, 
               output=ID, dateformat=True, figsave="nao.png")

Atlantic Multidecadal Oscillation (AMO)

Multidecadal patterns in sea surface temperature (SST) in the North Atlantic are represented by the Atlantic Multidecadal Oscillation (AMO) index. The AMO signal is based on spatial patterns in SST variability after removing the effects of anthropogenic forcing on temperature, revealing natural long term cycles in SST. The AMO is characterized by warm and cool phases [6] with periods of approximately 20-40 years. The AMO index is related to air temperatures and rainfall over North America and Europe and is associated with changes in the frequency of droughts in North America and the frequency of severe hurricane events. The AMO is thought to be related to the North Atlantic branch of the deep thermohaline circulation (for more see The Gulf Stream below) which is in turn directly related to dynamics of the Gulf Stream. The AMO index shows a relatively cool period starting in the early 1960s, extending through the mid 1990s. Since 1997, the AMO has been in a warm phase (Figure 2). If past patterns continue to hold, the warm phase will potentially continue for the next several decades.


In [ ]:
%%file {ID}/amo.txt
Multidecadal patterns in sea surface temperature (SST) in the North Atlantic are represented by the Atlantic Multidecadal Oscillation (AMO) index. 
The AMO signal is based on spatial patterns in SST variability after removing the effects of anthropogenic forcing on temperature, 
revealing natural long term cycles in SST.
The AMO is characterized by warm and cool phases [6] with periods of approximately 20-40 years. 
The AMO index is related to air temperatures and rainfall over North America and Europe and is associated 
with changes in the frequency of droughts in North America and the frequency of severe hurricane events. 
The AMO is thought to be related to the North Atlantic branch of the deep thermohaline circulation 
(for more see The Gulf Stream below) which is in turn directly related to dynamics of the Gulf Stream.
The AMO index shows a relatively cool period starting in the early 1960s, extending through the mid 1990s. 
Since 1997, the AMO has been in a warm phase (Figure 2). 
If past patterns continue to hold, the warm phase will potentially continue for the next several decades.

In [ ]:
# fake for shutdown
amodata = cfd.amo_get(save=ID, csvout="amo.csv")
cfp.plot_index(name='AMO_lowess', xticks=10, xticks_fontsize=10, 
               data=amodata, nb='y', scategory='lowess', frac=1./6, it=6, 
               output=ID, dateformat=True, figsave="amo.png")

In [ ]:
nb_name = "ecoop_t1.ipynb"
util.save_notebook(ID, nb_name)

In [ ]:
import os
nb_name = 'ecoop_t1.ipynb'
nao_datafile = os.path.join(ID,'nao.csv')
amo_datafile = os.path.join(ID,'amo.csv')

nbviewerlink = util.gistit(filename=nb_name, jist='/usr/local/bin/jist', type='notebook')
naodatalink = util.gistit(filename=nao_datafile, jist='/usr/local/bin/jist', type='text')
amodatalink = util.gistit(filename=amo_datafile, jist='/usr/local/bin/jist', type='text')

In [ ]:
pdfdict = {}

pdfdict['amofigfile']= ID+'/amo.png'
pdfdict['naofigfile']=ID+'/nao.png'
pdfdict['cf'] = ID+'/climate_forcing.txt'
pdfdict['amotxt'] = ID+'/amo.txt'
pdfdict['naotxt'] = ID+'/nao.txt'
pdfdict['textfile'] = 'climate_forcing.tex'
pdfdict['nbviewerlink'] = nbviewerlink
pdfdict['naodatalink'] = naodatalink
pdfdict['amodatalink'] = amodatalink

In [ ]:
pdfdict['textfile']

In [ ]:
cfPrint().cftemplate(ID=ID, pdfdict=pdfdict)

In [ ]:
!pdflatex -output-directory={ID} {ID}/climate_forcing.tex

In [ ]:
# set the ECOOP PROV 
# ecoop:IPythonNotebookRun endedAtTime  
ecooProvDict['IPythonNotebookRun']['endedAtTime'] = datetime.now()

In [ ]:
username = 'username'
password = 'password'
hostname = 'ligo.tw.rpi.edu'
port = 22
inputfile = ID
outputfile = '/var/www/esr/%s' % ID

In [ ]:
util.uploadfile(username=username, password=password, hostname=hostname, port=port, inputfile=inputfile,outputfile=outputfile, zip=True, link=True, qr=True)

Source code used :

ecoop


In [ ]:
util.save_notebook(ID, nb_name)