Bottom water

## =============================================================================
## Scripts to create Deep-water concentrations
## implemented by Karline Soetaert
## =============================================================================
#
# The deep concentration of phosphate and oxygen

require(RNetCDF)
require(OceanView)

# The directory and name of the file with oxygen saturation data:
Directory <- "ftp://ftp.nodc.noaa.gov/pub/data.nodc/woa/WOA05nc/annual/"
varname <- c( "i00an1", "n00an1", "p00an1", "O00an1", "s00an1", "t00an1")
File <- paste(varname,".nc", sep = "")
Name <- c("Silicate", "Nitrate", "Phosphate", "Oxygen", "Salinity", "Temperature")
units <- c(rep("mmol/m3", 3), "%", "", "dgC")
url <- paste(Directory, File, sep="")

par(oma = c(2, 0, 2, 0), mfrow = c(2, 2), mar = c(3,2,3,2))

Botvals <- array(dim = c(360, 180, 6))
Surfvals <- array(dim = c(360, 180, 6))

for (i in 1:4) {
# get data
Nc <- open.nc(File[i])
# print.nc(Nc)

lat <- var.get.nc(Nc, "lat")
lon <- var.get.nc(Nc, "lon")
depth <- var.get.nc(Nc, "depth")
Var <- var.get.nc(Nc, varname[i])

# convert to Atlantic-central
lon <- c(lon[181:360] - 360, lon[1:180])
Var <- Var[c(181:360, 1:180), , ]

# Find deepest box - don't mind the warnings
Deep <- apply(Var, MARGIN = 1:2, FUN = function(x) x[max(which(!is.na(x)))])
Deep[is.infinite(Deep)] <- NA
Botvals[,,i] <- Deep
Surfvals[,,i] <- Var[,,1]
image2D(x = lon, y = lat, z = Deep, NAcol = "black",
resfac = 2, shade = 0.05, #contour = TRUE,
xlab = "", ylab = "", main = Name[i], clab = units[i])
}

mtext(side = 3, outer = TRUE, text = "Bottom water", cex = 1.25)

Go back