Assignment 1: Calculating Sea Level Rise Around Ireland

Clear variables and any open plots before loading in the data

graphics.off()
rm(list=ls())

Set the working directory containing the data that will be analyzed throughout the assignment.Also load the libraries necessary to carry out each task.

#Set Working Directory
setwd("E:/Workshop/Processed Monthly Tide Gauge Data-20190320") 

#install packages
library(VulnToolkit) 

library(maps) 

library(lattice)

library(RColorBrewer)

library(latticeExtra)

Estimating and accounting for twentieth-century global mean sea-level (GMSL) rise is critical to characterizing current and future human-induced sea-level change. Global sea level (GSL) rise and its acceleration are the subjects of an extensive scientific debate. Most of the evidence for global sea level acceleration comes from climate models, providing a wide range of estimates in the Intergovernmental Panel on Climate Change (IPCC) reports. Sea level is a critical variable of our environment and has a high impact on coastal populations. A tide gauge is a piece of equipment used for measuring the changes in sea level with respect to a height reference surface. Tide gauges are an important tool to determine trends in mean sea level, extreme conditions, and their relation to climate change. In undertaking sea level change analyses, the data is typically drawn from the Permanent Service for Mean sea Level (PSMSL) database at the Proudman Oceanographic Laboratory.

Task 1: Describe the National Tide Gauge Network Records

Read in the data that is in csv format, in the working directory.

##Read in data 

Arklow = read.csv(file.path(getwd(),'arklow_monthly.csv'),skip = 1,header=TRUE) 

Ballycotton = read.csv(file.path(getwd(),'ballycotton_monthly.csv'),skip = 1,header=TRUE) 

Ballyglass = read.csv(file.path(getwd(),'ballyglass_monthly.csv'),skip = 1,header=TRUE) 

Castletownbrere = read.csv(file.path(getwd(),'castletownbere_monthly.csv'),skip = 1,header=TRUE) 

Dublin = read.csv(file.path(getwd(),'dublin_monthly.csv'),skip = 1,header=TRUE) 

DunmoreEast = read.csv(file.path(getwd(),'dunmore_east_monthly.csv'),skip = 1,header=TRUE) 

Fenit = read.csv(file.path(getwd(),'fenit_monthly.csv'),skip = 1,header=TRUE) 

Galway = read.csv(file.path(getwd(),'galway_monthly.csv'),skip = 1,header=TRUE) 

Howth = read.csv(file.path(getwd(),'howth_monthly.csv'),skip = 1,header=TRUE) 

Malin = read.csv(file.path(getwd(),'malin_monthly.csv'),skip = 1,header=TRUE) 

PortOriel = read.csv(file.path(getwd(),'port_oriel_monthly.csv'),skip = 1,header=TRUE) 

Ringaskiddy = read.csv(file.path(getwd(),'ringaskiddy_monthly.csv'),skip = 1,header=TRUE) 

Rossaveel = read.csv(file.path(getwd(),'rossaveel_monthly.csv'),skip = 1,header=TRUE) 

The next thing to do is to format the column names, which will add a bit of clarity to the data we are working with.

# Arrange Column Names

names(Arklow)<-c("month","year","h","time") 

names(Ballycotton)<-c("month","year","h","time") 

names(Ballyglass)<-c("month","year","h","time") 

names(Castletownbrere)<-c("month","year","h","time") 

names(Dublin)<-c("month","year","h","time") 

names(DunmoreEast)<-c("month","year","h","time") 

names(Fenit)<-c("month","year","h","time") 

names(Galway)<-c("month","year","h","time") 

names(Howth)<-c("month","year","h","time") 

names(Malin)<-c("month","year","h","time") 

names(PortOriel)<-c("month","year","h","time") 

names(Ringaskiddy)<-c("month","year","h","time") 

names(Rossaveel)<-c("month","year","h","time") 

Here we are formatting the data from each station into Date, Month, and Year.

Arklow$time <- as.Date(Arklow$time, format = "%d/%m/%Y")
Ballycotton$time <- as.Date(Ballycotton$time, format = "%d/%m/%Y")
Ballyglass$time <- as.Date(Ballyglass$time, format = "%d/%m/%Y")
Castletownbrere$time <- as.Date(Castletownbrere$time, format = "%d/%m/%Y")
Dublin$time <- as.Date(Dublin$time, format = "%d/%m/%Y")
DunmoreEast$time <- as.Date(DunmoreEast$time, format = "%d/%m/%Y")
Fenit$time <- as.Date(Fenit$time, format = "%d/%m/%Y")
Galway$time <- as.Date(Galway$time, format = "%d/%m/%Y")
Howth$time <- as.Date(Howth$time, format = "%d/%m/%Y")
Malin$time <- as.Date(Malin$time, format = "%d/%m/%Y")
PortOriel$time <- as.Date(PortOriel$time, format = "%d/%m/%Y")
Ringaskiddy$time <- as.Date(Ringaskiddy$time, format = "%d/%m/%Y")
Rossaveel$time <- as.Date(Rossaveel$time, format = "%d/%m/%Y")

The next step is to enter the latitude and longitude coordinates of each tide gauge station. These coordinates for each individual station were located on the National Tide Gauge Network (NTGN) website. They were entered, in order to accurately depict the location of each station on the map that will eventually be plotted.

### LAT & LONG  

Ark.lon             =  -6.145231 
Ark.lat             =  52.792046 

Ballyc.lon          =  -8.0007 
Ballyc.lat          =  51.8278 

Ballyg.lon          =  -9.8928 
Ballyg.lat          =  54.2536 

Castle.lon      =  -9.9034 
Castle.lat      =  51.6496 

Dub.lon             =  -6.2217 
Dub.lat             =  53.3457 

Dunmore.lon         =  -6.99188 
Dunmore.lat         =  52.14767 

Fenit.lon           =  -9.8635645 
Fenit.lat           =  52.270702 

Gal.lon             =  -9.048 
Gal.lat             =  53.269 

Howth.lon           =  -6.0683 
Howth.lat           =  53.3915 

Malin.lon           =  -7.3344 
Malin.lat           =  55.3717 

Porto.lon           =  -6.221441 
Porto.lat           =  53.798042 

Ring.lon         =  -8.305566 
Ring.lat         =  51.83496 

Ross.lon          =  -9.562056 
Ross.lat          =  53.266926 

The objective is to create a plot of the locations and records of the National Tide Gauge, by plotting them on a map of Ireland. This can now be achieved as coordinates have been logged.The location of each station was added to the plot of Ireland by using the points() function, and also the text() function was employed to label each station by their name.

map("world",c("ireland","uk"),fill=FALSE,xlim=c(-12,-4),ylim=c(51,56)) 
map.axes(cex.axis=1) 
title(main="Location of Tide Gauges",xlab="Longitude",ylab="Latitude") 

points(Ark.lon,Ark.lat,pch=21,col="gray",bg="red") 
text(Ark.lon-.5,Ark.lat,"Ark.",col="black") 

points(Ballyc.lon,Ballyc.lat,pch=21,col="gray",bg="red") 
text(Ballyc.lon+.51,Ballyc.lat,"BallyC.",col="black") 

points(Ballyg.lon,Ballyg.lat,pch=21,col="gray",bg="red") 
text(Ballyg.lon-0.5,Ballyg.lat,"BallyG.",col="black") 

points(Castle.lon,Castle.lat,pch=21,col="gray",bg="red") 
text(Castle.lon-.5,Castle.lat,"Castle.",col="black") 

points(Dub.lon,Dub.lat,pch=21,col="gray",bg="red") 
text(Dub.lon-.1,Dub.lat,"Dub.",col="black") 

points(Dunmore.lon,Dunmore.lat,pch=21,col="gray",bg="red") 
text(Dunmore.lon-.1,Dunmore.lat,"Dunmore",col="black") 

points(Fenit.lon,Fenit.lat,pch=21,col="gray",bg="red") 
text(Fenit.lon-.9,Fenit.lat,"Fenit.",col="black") 

points(Gal.lon,Gal.lat,pch=21,col="gray",bg="red") 
text(Gal.lon-.9,Gal.lat,"Gal.",col="black") 

points(Howth.lon,Howth.lat,pch=21,col="gray",bg="red") 
text(Howth.lon+0.8,Howth.lat,"Howth.",col="black") 

points(Malin.lon,Malin.lat,pch=21,col="gray",bg="red") 
text(Malin.lon-.5,Malin.lat,"Malin.",col="black") 

points(Porto.lon,Porto.lat,pch=21,col="gray",bg="red") 
text(Porto.lon-.5,Porto.lat,"Port.",col="black") 

points(Ring.lon,Ring.lat,pch=21,col="gray",bg="red") 
text(Ring.lon-.5,Ring.lat,"Ring.",col="black") 

points(Ross.lon,Ross.lat,pch=21,col="gray",bg="red") 
text(Ross.lon-.9,Ross.lat,"Ross.",col="black") 

Once the individual stations are correctly plotted across the island of Ireland, it is important to plot the trends of the sea levels for each of the stations examined in Ireland. This will produce an insightful visualisation into the sea level records.This can not only display the length of each record, but the increase and decrease in sea level rise at each station. The graph was created using the lines() function, which connects a series of points by drawing line segments between them.

plot(Arklow$time, Arklow$h -0.1, type = "l", col = "coral", main ="Sea Level vs Year",xlab="Year",ylab="Sea Level", ylim = c(3, -3)) 

lines(Ballycotton$time, Ballycotton$h +1, type = "l", col = "blue") 

lines(Ballyglass$time, Ballyglass$h -0.5, type = "l", col = "navyblue")

lines(Castletownbrere$time, Castletownbrere$h -2, type = "l", col = "orange") 

lines(Dublin$time, Dublin$h -1.5, type = "l", col = "green") 

lines(Fenit$time, Fenit$h -3, type = "l", col = "chocolate4") 

lines(Galway$time, Galway$h +.6, type = "l", col = "hotpink") 

lines(Howth$time, Howth$h -2.5, type = "l", col = "darkgray") 

lines(Malin$time, Malin$h +3, type = "l", col = "dodgerblue") 

lines(PortOriel$time, PortOriel$h +2.5, type = "l", col = "lightsalmon") 

lines(Ringaskiddy$time, Ringaskiddy$h +2, type = "l", col = "indianred") 

lines(Rossaveel$time, Rossaveel$h -1, type = "l", col = "mediumorchid3") 

legend("bottomleft", legend=c("Arklow Year", "BallyC Year", "BallyG Year", "Castle Year","Dublin Year","Fenit Year",
                              "Galway Year", "Howth Year","Malin Year","Porto Year","Ring Year", "Ross Year"), 
       col=c("coral","blue","navyblue","orange","green", "chocolate4","hotpink","darkgray","dodgerblue",
             "lightsalmon", "indianred","mediumorchid3"),lty=1:1, cex=0.6)

From just quickly analzing the trends, it is clear that Arklow has data ranging from 2003 - 2019, which appears to be the largest dataset. In comparison, stations such as Ringaskiddy appear to have some of the least data, as the lines are shorter, ranging from 2012 - 2019.

Task II - Download the PSMSL Records

The stations being observed from the PSMSL records are Malin / Belfast/ Portrush/ Dublin / Bangor. The data was located at www.psmsl.org. Each file was saved as a .txt file. The data was also modified using excel. This includes changing -99999 or negative values to Not Available (NA) data, to avoid complications of using the data. The data is known as RLR or ‘Revised Local Reference’.

Firstly, we had to load in the psmsl data.

#### load psmsl data

path <- file.path(getwd(), "Data")
Dublin.psmsl <- read.table(file.path(path,"Dublin.txt"), header = TRUE)
Malin.psmsl <- read.table(file.path(path,"Malin.txt"), header = TRUE)
Portrush.psmsl <- read.table(file.path(path,"Portrush.txt"), header = TRUE)
Belfast.psmsl <- read.table(file.path(path,"Belfast.txt"), header = TRUE)
Bangor.psmsl <- read.table(file.path(path,"Bangor.txt"), header = TRUE)

Next step is to enter the latitude and longitude coordinates of each station, similar to Task I.

Dub.lon             =  -6.2217 
Dub.lat             =  53.3457 

Malin.lon           =  -7.3344 
Malin.lat           =  55.3717

Portrush.lon        = -6.6568
Portrush.lat        = 55.2067

Bangor.lon          = -5.6694
Bangor.lat          = 54.6647

Belfast.lon         = -5.9166
Belfast.lat         = 54.6000

Now, we want to plot the points of each of the five stations being examined, similar to a few steps in Task I. We plot the location of each station on the island, by using the points() function, and the coordinates previously entered.

#### Map PSMSL

map("world",c("ireland","uk"),fill=FALSE,xlim=c(-12,-4),ylim=c(51,56)) 

map.axes(cex.axis=1) 

title(main="PSMSL Data",xlab="Longitude",ylab="Latitude") 

points(Dub.lon,Dub.lat,pch=21,col="gray",bg="red") 
text(Dub.lon-.5,Dub.lat,"Dub.",col="black") 

points(Malin.lon,Malin.lat,pch=21,col="gray",bg="red") 
text(Malin.lon-.9,Malin.lat,"Malin.",col="black") 

points(Bangor.lon,Bangor.lat,pch=21,col="gray",bg="red") 
text(Bangor.lon-.01,Bangor.lat,"Bangor.",col="black") 

points(Portrush.lon,Portrush.lat,pch=21,col="gray",bg="red") 
text(Portrush.lon-0.01,Portrush.lat,"Port.",col="black") 

points(Belfast.lon,Belfast.lat,pch=21,col="gray",bg="red") 
text(Belfast.lon-1.3,Belfast.lat,"Belfast.",col="black") 

PDub <- aggregate(Dublin.psmsl$Rlr, by = list(Dublin.psmsl$Year), FUN = mean,   na.rm = TRUE) 
names(PDub)<-c("year","flow") 

PMal <- aggregate(Malin.psmsl$Rlr, by = list(Malin.psmsl$Year), FUN = mean,   na.rm = TRUE) 
names(PMal)<-c("year","flow") 

PBel <- aggregate(Belfast.psmsl$Rlr, by = list(Belfast.psmsl$Year), FUN = mean,   na.rm = TRUE) 
names(PBel)<-c("year","flow") 

PBang <- aggregate(Bangor.psmsl$Rlr, by = list(Bangor.psmsl$Year), FUN = mean,   na.rm = TRUE) 
names(PBang)<-c("year","flow") 

PRush <- aggregate(Portrush.psmsl$Rlr, by = list(Portrush.psmsl$Year), FUN = mean,   na.rm = TRUE) 
names(PRush)<-c("year","flow")

We also want to rename the columns, making things easier and clearer.

names(Dublin_fix)<-c("index","Year","h")
names(Malin_fixed)<-c("index","Year","h")

We need to aggregate and then plot the data of the stations Malin and Dublin.

Dublin_PSMSLdata <- aggregate(Dublin_fix$h, by = list( Dublin_fix$Year), FUN = mean, na.rm = TRUE)
Mal_PSMSLdata <- aggregate(Malin_fixed$h, by = list( Malin_fixed$Year), FUN = mean, na.rm = TRUE)
colnames(Dublin_PSMSLdata) <- c("year", "Flow")  
colnames(Mal_PSMSLdata) <- c("year", "Flow") 
# Plot
plot(Dublin_PSMSLdata$year, Dublin_PSMSLdata$Flow, type= "l", col = "red",  main="PSMSL Data",xlab="Year",ylab="Sea Level",xlim=c(1938,2019))
lines(Mal_PSMSLdata$year, Mal_PSMSLdata$Flow, type = "l", col = "blue")
legend("topleft", legend=c("Dublin", "Malin"), 
       col=c("red", "blue"),lty=1:1, cex=0.7)

Unfortunately, this was not the outcome that I desired. The only information it does tell us accurately is that there is data available from Dublin station from 1938 onwards, and there is data available from Malin station from 1960 onwards. Disappointingly, I was unable to produce a graph to compare and contrast the trends between these two stations, which are both in the NTGN and PSMSL datsets.

I was also unable to finish the remaining tasks of Task II

What we get is an insightful map, containing the valuable data that has been plotted. The triangles on the map are all different sizes. This is due to the fact that the size of the triangle plotted is relative to the weight of the trend on display. The black inverted triangles on the map are what correlate to trends which are negative in sea level, and the blue upstanding triangles on the map correlate to positive trends in sea level.

The next thing we want to do is observe the seasonality in each individual time series.

Arklow.Month.lm <- lm(Arklow[1:183,3]~Arklow[1:183,1])
BallyC.Month.lm <- lm(Ballycotton[1:87,3]~Ballycotton[1:87,1])
BallyG.month.lm <- lm(Ballyglass[1:114,3]~Ballyglass[1:114,1])
Castle.month.lm <- lm(Castletownbrere[1:134,3]~Castletownbrere[1:134,1])
Dub.month.lm <- lm(Dublin[1:135,3]~Dublin[1:135,1])
Dunmore.month.lm <- lm(DunmoreEast[1:74,3]~DunmoreEast[1:74,1])
Fen.month.lm <- lm(Fenit[1:77,3]~Fenit[1:77,1])
Gal.month.lm <- lm(Galway[1:135,3]~Galway[1:135,1])
Malin.month.lm <- lm(Malin[1:105,3]~Malin[1:105,1])
Porto.month.lm <- lm(PortOriel[1:108,3]~PortOriel[1:108,1])
Ringa.month.lm <- lm(Ringaskiddy[1:84,3]~Ringaskiddy[1:84,1])
Ross.month.lm <- lm(Rossaveel[1:96,3]~Rossaveel[1:96,1])
Arklow.ms= 0.0103
BallyC.ms = 0.007833
BallyG.ms = 0.009469
Castle.ms = 0.008361
Dublin.ms = 0.01120
Dunmore.ms = 0.008218
Fen.ms = 0.009894
Gal.ms = 0.007701
How.ms = 0.009496
Mal.ms = 0.01326
Port.ms = 0.01433
Ring.ms = 0.01037
Ross.ms = 0.008105

Finally, we look to plot all the data on the map.

map("world",c("ireland","uk"),fill=FALSE,xlim=c(-12,-4),ylim=c(51,56))
map.axes(cex.axis=1)
points(Ark.lon,Ark.lat,pch=24,col="gray",bg="blue", cex = Arklow.ms*200, lwd = 0.4)
text(Ark.lon-.7,Ark.lat,"Ark",col="black")
points(Ballyc.lon,Ballyc.lat,pch=24,col="gray",bg="blue", cex = BallyC.ms*200, lwd = 0.4)
text(Ballyc.lon-.7,Ballyc.lat,"BallyC",col="black")
points(Ballyg.lon,Ballyg.lat,pch=24,col="gray",bg="blue", cex = BallyG.ms*200, lwd = 0.4)
text(Ballyg.lon-.7,Ballyg.lat,"BallyG",col="black")
points(Castle.lon,Castle.lat,pch=24,col="gray",bg="blue", cex = Castle.ms*200, lwd = 0.4)
text(Castle.lon-1.0,Castle.lat,"Castle",col="black")
points(Dub.lon,Dub.lat,pch=24,col="gray",bg="blue", cex = Dublin.ms*200, lwd = 0.4)
text(Dub.lon-0.9,Dub.lat,"Dub",col="black")
points(Dunmore.lon,Dunmore.lat,pch=24,col="gray",bg="blue", cex = Dunmore.ms*200, lwd = 0.4)
text(Dunmore.lon-.7,Dunmore.lat,"Dunmore",col="black")
points(Fenit.lon,Fenit.lat,pch=24,col="gray",bg="blue", cex = Fen.ms*200, lwd = 0.4)
text(Fenit.lon-.9,Fenit.lat,"Fen",col="black")
points(Gal.lon,Gal.lat,pch=24,col="gray",bg="blue", cex = Gal.ms*200, lwd = 0.4)
text(Gal.lon-1.0,Gal.lat,"Gal",col="black")
points(Howth.lon,Howth.lat,pch=24,col="gray",bg="blue", cex = How.ms*200, lwd = 0.4)
text(Howth.lon+.7,Howth.lat,"How",col="black")
points(Malin.lon,Malin.lat,pch=24,col="gray",bg="blue", cex = Mal.ms*200, lwd = 0.4)
text(Malin.lon-.9,Malin.lat,"Malin",col="black")
points(Porto.lon,Porto.lat,pch=24,col="gray",bg="blue", cex = Port.ms*200, lwd = 0.4)
text(Porto.lon-1.0,Porto.lat,"Porto",col="black")
points(Ring.lon,Ring.lat,pch=24,col="gray",bg="blue", cex = Ring.ms*200, lwd = 0.4)
text(Ring.lon+1.1,Ring.lat,"Ring",col="black")
points(Ross.lon,Ross.lat,pch=24,col="gray",bg="blue", cex = Ross.ms*200, lwd = 0.4)
text(Ross.lon+1.0,Ross.lat,"Ross",col="black")

As we can see from the map, all the triangles are upstanding, which indicates that each station on the map represents an upward sea level trend. The seasonality trend gives us a more clinical trend of what Ireland can expect in terms of sea level rise.

Climate change has a variety of important impacts, one of which is reflected in sea levels (Hannah, J. 2010). Long term rising trends in global sea levels are often used to corroborate the assertion of long term climate change. Although tide gauges have not been used as a primary source of sea-level data for several years, they play a key role in the instrumentation at modern-day tide gauge locations to verify water level. Tide-gauges do not offer straightforward information on sea level trends, on the contrary they have to be treated with care. It is difficult to work with this data, due to the complexity of tide gauges.

Tide gauges provide records of local sea-level changes that, in the case of some sites, extend back to the eighteenth century. However, using the database of tide gauge records to estimate historical GMSL rise(defined as the increase in ocean volume normalized by ocean area) is challenging. Tide gauges sample the ocean sparsely and non-uniformly, with a bias towards coastal sites and the Northern Hemisphere, and with few sites at latitudes greater than 60 degrees. In addition, tide gauge time series show significant inter-annual to decadal variability, and they are characterized by missing data.

References

Jevrejeva, S., Moore, J. C., Grinstead, A., & Woodwort, P. L. (2008) Recent global sea level acceleration started over 200 years ago? Geophysical research Letters, 35(8)

Hannah, J. 2010, The difficulties in using tide gauges to monitor long-term sea level change