Table of Contents

  1. Introduction
  2. Read Data
    1. World Map
    2. Ocean pH Data
  3. Data Map
    1. Late 20th Century Change
  4. Topic Background

Introduction

This RMarkdown document is to go over reading in a netCDF file of ocean acidification levels by pH on the total hydrogen ion scale.

# load libraries
library(sf)
library(stars)
library(ggplot2)
install.packages("ncmeta")

Read Data

Here is where I read in the data for this topic.

World Map

First, I create a world map here to use with my dataset. Read in a file of country borders worldwide and change it to be simple features.

# world_sf
world_sf     <- st_as_sf(maps::map("world", plot = FALSE, fill = TRUE))
world_otl_sf <- st_geometry(world_sf)

Plot the borders.

# ggplot map of world_outline
ggplot() +
  geom_sf(data = world_otl_sf, fill = NA, col = "darkgreen") +
  scale_x_continuous(breaks = seq(0, 360, 30)) +
  scale_y_continuous(breaks = seq(-90, 90, 30)) +
  coord_sf(xlim = c(0, 360), ylim = c(-90, 90), expand = FALSE) +
  theme_bw()

Ocean pH Data

Then, I read in the data containing ocean pH levels to depict acidification which came from the National Oceanic and Atmospheric Administration’s operation called Ocean Carbon and Acidification Data System.

# read pH
nc_path   <- "C:\\Users\\kedeh\\Documents\\GEOG490_R\\data\\"
nc_name   <- "pHT_median_historical.nc"
nc_file   <- paste(nc_path, nc_name, sep="")
pHT_stars <- read_ncdf(nc_file, var="pHT", proxy = FALSE)

The data needs some manipulation to format the map and its bounds.

# convert stars to sf
pHT_sf <- st_as_sf(pHT_stars, as_points = TRUE)

real_lat <- seq(-89.5, 89.5, by = 1)
real_lon <- c(seq(20.5, 359.5, by = 1), seq(0.5, 19.5, by = 1))

# setup to plot pH
# make a data.frame
lon_index     <- st_coordinates(pHT_sf)[,1]
lat_index     <- st_coordinates(pHT_sf)[,2]
pHT           <- as.vector(pHT_sf$`2010`) # select year
pHT_df        <- data.frame(real_lon[lon_index], real_lat[lat_index], pHT)
names(pHT_df) <- c("lon", "lat", "pHT")


# set axis labels (breaks)
# breaks_x <- c(seq(-180, 180, by = 60))
breaks_x   <- c(seq(0, 360, by = 60))
breaks_y   <- c(seq(-90, 90, by = 30))
labels_x   <- as.character(breaks_x)
labels_y   <- as.character(breaks_y)

Data Map

Now, I map out the data with the world map for a full rendering.

# ggplot2 map of pH
ggplot() +
  geom_tile(data = pHT_df[,,1], aes(x = lon, y = lat, fill = pHT)) +
  scale_fill_gradient2(low = "brown", mid="white", high = "blue", midpoint = 8) +
  geom_sf(data = world_otl_sf, col = "black", fill = NA) +
  coord_sf(xlim = c(-0, 360.0), ylim = c(-90, 90), expand = FALSE) +
  scale_x_continuous(breaks = breaks_x) +
  scale_y_continuous(breaks = breaks_y) +
  labs(x = "Longitude", y = "Latitude", title="2010 Global pH", fill="pHT") +
  theme_bw()

Understanding the pH scale legend: These seemingly small changes in pH levels are actually very important because pH is measured as a logarithm so the change is much more than it looks.

The pH scale goes from 1 to 14 with a middle value of 7. Everything below 7 is an acid and represents a high amount of dissolved Hydrogen ions. Everything above 7 is a base and represents a low amount of dissolved Hydrogen ions.

Ocean levels are never expected to drop below 7 and become truly acidic, but ocean acidification means that it is becoming more acidic and approaching closer to 7.

Late 20th Century Change

The most change across the dataset happened in the years of the late 20th century, so each of those years present in the dataset are shown below for timeline comparison.

Topic Background

Ocean acidification is damaging to the health of ocean ecosystems, the and ecosystems that depend on them, and the future of global warming. The fundamental chemical balance through all ocean water globally is threatened by this change.

Marine biogenic calcification is how creatures produce calcium carbonate for their skeletal structures and hard tissue. It is necessary for marine life such as corals, shellfish like bivalve mollusks (oysters, scallops, etc.), plankton, echinoderms (starfish, sea urchins, etc.), and pteropods. The consumption of carbonate ions disrupts the calcification process and is referred to as “osteoporosis of the sea.”

It causes harmful species of algae to create more toxins and bloom faster which can be dangerous for human health, causing things like gatroenteritis. This is also dangerous to pets and livestock.Coming into contact with these toxins may be seen through consuming the water or contaminated sea food. This means that it will also make fish and marine mammals sick as well.

Carbon dioxide from the atmosphere is absorbed in increasing amounts through time. However, oceans will have a much more reduced ability to store pollutants such as carbon emissions.

This is an issue that sees clear contributions from human activity. These activities are the burning of fossil fuels like coal, gas, and oil as well as land use changes like turning natural forests into crop farms.