Last updated: 2023-12-06
Checks: 7 0
Knit directory: bgc_argo_r_argodata/
This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20211008)
was run prior to running
the code in the R Markdown file. Setting a seed ensures that any results
that rely on randomness, e.g. subsampling or permutations, are
reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 83269d5. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for
the analysis have been committed to Git prior to generating the results
(you can use wflow_publish
or
wflow_git_commit
). workflowr only checks the R Markdown
file, but you know if there are other scripts or data files that it
depends on. Below is the status of the Git repository when the results
were generated:
Ignored files:
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: output/
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were
made to the R Markdown (analysis/oceanSODA_argo_temp.Rmd
)
and HTML (docs/oceanSODA_argo_temp.html
) files. If you’ve
configured a remote Git repository (see ?wflow_git_remote
),
click on the hyperlinks in the table below to view the files as they
were in that past version.
File | Version | Author | Date | Message |
---|---|---|---|---|
html | cec2a2a | ds2n19 | 2023-11-24 | Build site. |
Rmd | 59f5cc4 | ds2n19 | 2023-11-23 | Moved spatiotemporal analysis to use aligned profiles. |
html | 80c16c2 | ds2n19 | 2023-11-15 | Build site. |
html | 4b55c43 | ds2n19 | 2023-10-12 | Build site. |
html | c16000b | ds2n19 | 2023-10-12 | Build site. |
Rmd | 723c772 | ds2n19 | 2023-10-12 | refresh coverage and analysis after full core load 2013 - 2023 |
Rmd | 1ae81b3 | ds2n19 | 2023-10-11 | reworked core load process to work initially by year and then finally create consolidated all years files. |
html | 1ae81b3 | ds2n19 | 2023-10-11 | reworked core load process to work initially by year and then finally create consolidated all years files. |
Rmd | 44f5720 | ds2n19 | 2023-10-09 | manual commit |
html | 44f5720 | ds2n19 | 2023-10-09 | manual commit |
Rmd | ce19a66 | ds2n19 | 2023-10-04 | Revised version of OceanSODA product -v2023 |
html | 7b3d8c5 | pasqualina-vonlanthendinenna | 2022-08-29 | Build site. |
Rmd | 8e81570 | pasqualina-vonlanthendinenna | 2022-08-29 | load and add in core-argo data (1 month) |
html | bdd516d | pasqualina-vonlanthendinenna | 2022-05-23 | Build site. |
html | 4173c20 | jens-daniel-mueller | 2022-05-12 | Build site. |
html | dfe89d7 | jens-daniel-mueller | 2022-05-12 | Build site. |
html | 710edd4 | jens-daniel-mueller | 2022-05-11 | Build site. |
Rmd | 2f20a76 | jens-daniel-mueller | 2022-05-11 | rebuild all after subsetting AB profiles and code cleaning |
html | 68eff8b | jens-daniel-mueller | 2022-05-11 | Build site. |
html | 6a6e874 | pasqualina-vonlanthendinenna | 2022-04-29 | Build site. |
html | 2d44f8a | pasqualina-vonlanthendinenna | 2022-04-29 | Build site. |
html | e61c08e | pasqualina-vonlanthendinenna | 2022-04-27 | Build site. |
html | 10036ed | pasqualina-vonlanthendinenna | 2022-04-26 | Build site. |
Rmd | 3e1ac14 | pasqualina-vonlanthendinenna | 2022-04-26 | separated loading data pages, added mayot biomes, switched to pH and temp flag A |
html | c03dd24 | pasqualina-vonlanthendinenna | 2022-04-20 | Build site. |
html | 8805f99 | pasqualina-vonlanthendinenna | 2022-04-11 | Build site. |
html | acc96b0 | pasqualina-vonlanthendinenna | 2022-02-28 | Build site. |
Rmd | 840030e | pasqualina-vonlanthendinenna | 2022-02-28 | removed 2021 from SST comparison |
html | fd521d1 | pasqualina-vonlanthendinenna | 2022-02-25 | Build site. |
Rmd | 64c2c71 | pasqualina-vonlanthendinenna | 2022-02-25 | plotted line profiles and changed HNL colors |
html | 7d7874c | pasqualina-vonlanthendinenna | 2022-02-24 | Build site. |
Rmd | 58d2846 | pasqualina-vonlanthendinenna | 2022-02-24 | added st dev for temp profiles |
html | c68163a | pasqualina-vonlanthendinenna | 2022-02-22 | Build site. |
Rmd | 818ac54 | pasqualina-vonlanthendinenna | 2022-02-22 | updated regression and merging for extreme_temp |
html | 905d82f | pasqualina-vonlanthendinenna | 2022-02-15 | Build site. |
Rmd | 01ae9da | pasqualina-vonlanthendinenna | 2022-02-15 | added OceanSODA-Argo SST comparison |
Compare BGC- and Core-Argo surface temperature to OceanSODA surface temperature
theme_set(theme_bw())
Load in surface Argo temperature, and OceanSODA temperature, on a 1ºx1º grid
path_argo <- '/nfs/kryo/work/updata/bgc_argo_r_argodata'
path_argo_preprocessed <- paste0(path_argo, "/preprocessed_bgc_data")
path_emlr_utilities <- "/nfs/kryo/work/jenmueller/emlr_cant/utilities/files/"
path_argo_core <- '/nfs/kryo/work/updata/core_argo_r_argodata'
path_argo_core_preprocessed <- paste0(
path_argo_core, "/preprocessed_core_data")
path_argo <- '/nfs/kryo/work/datasets/ungridded/3d/ocean/floats/bgc_argo'
path_argo_preprocessed <- paste0(path_argo, "/preprocessed_bgc_data")
path_argo_core <- '/nfs/kryo/work/datasets/ungridded/3d/ocean/floats/core_argo_r_argodata'
path_argo_core_preprocessed <- paste0(path_argo_core, "/preprocessed_core_data")
# Load in surface Argo and OceanSODA temperature data
OceanSODA_temp <- read_rds(file = paste0(path_argo_preprocessed, "/OceanSODA_temp.rds"))
argo_surf_temp <- read_rds(file = paste0(path_argo_preprocessed, '/temp_bgc_observed.rds')) %>%
filter(between(depth, 0, 20))
# argo_surf_temp <-
# read_rds(file = paste0(path_argo_preprocessed, "/bgc_merge_flag_AB.rds")) %>%
# filter(between(depth, 0, 20)) %>%
# mutate(year = year(date),
# month = month(date)) %>%
# select(
# -c(
# ph_in_situ_total_adjusted,
# ph_in_situ_total_adjusted_qc,
# ph_in_situ_total_adjusted_error,
# profile_ph_in_situ_total_qc
# )
# )
# for plotting later, load in region information
nm_biomes <- read_rds(file = paste0(path_argo_preprocessed, "/nm_biomes.rds"))
# read in the map from updata
map <-
read_rds(paste(path_emlr_utilities,
"map_landmask_WOA18.rds",
sep = ""))
Calculate monthly-mean Argo temperature for each lat/lon grid and each month
argo_temp_monthly <- argo_surf_temp %>%
mutate(year_month = format_ISO8601(date, precision = "ym"), .after = 'date') %>%
group_by(year, month, year_month, date, lat, lon) %>%
summarise(argo_temp_month = mean(temp_adjusted, na.rm = TRUE)) %>%
ungroup() %>%
select(
date,
year_month,
year,
month,
lon,
lat,
argo_temp_month
)
Join Argo and OceanSODA
OceanSODA_temp <- OceanSODA_temp %>%
mutate(year_month = format_ISO8601(date, precision = "ym")) %>%
rename(date_OceanSODA = date)# change date format in OceanSODA to match argo date (yyyy-mm)
argo_OceanSODA_temp <- left_join(argo_temp_monthly, OceanSODA_temp) %>%
rename(OceanSODA_temp = temperature)
Focus on the Southern Ocean, south of 30ºS, as defined in the Mayot biome regions
# keep only Southern Ocean data
argo_OceanSODA_temp_SO <-
inner_join(argo_OceanSODA_temp, nm_biomes)
Map monthly mean SST from the OceanSODA data product, where BGC-Argo SST exists
Climatological OceanSODA SST
# calculate average monthly pH, and the difference between the two (offset)
argo_OceanSODA_temp_SO_clim <- argo_OceanSODA_temp_SO %>%
group_by(lon, lat, month) %>%
summarise(
clim_OceanSODA_temp = mean(OceanSODA_temp, na.rm = TRUE),
clim_argo_temp = mean(argo_temp_month, na.rm = TRUE),
offset_clim = clim_OceanSODA_temp - clim_argo_temp
) %>%
ungroup()
# regrid to a 2x2 grid for mapping
argo_OceanSODA_temp_SO_clim_2x2 <- argo_OceanSODA_temp_SO_clim %>%
mutate(
lat = cut(lat, seq(-90, 90, 2), seq(-89, 89, 2)),
lat = as.numeric(as.character(lat)),
lon = cut(lon, seq(20, 380, 2), seq(21, 379, 2)),
lon = as.numeric(as.character(lon))
) %>%
group_by(lon, lat, month) %>%
summarise(
clim_OceanSODA_temp = mean(clim_OceanSODA_temp, na.rm = TRUE),
clim_argo_temp = mean(clim_argo_temp, na.rm = TRUE),
offset_clim = mean(offset_clim, na.rm = TRUE)
) %>%
ungroup()
map +
geom_tile(data = argo_OceanSODA_temp_SO_clim_2x2,
aes(x = lon, y = lat, fill = clim_OceanSODA_temp)) +
lims(y = c(-85, -25)) +
scale_fill_viridis_c() +
labs(x = 'lon',
y = 'lat',
fill = 'SST (ºC)',
title = 'Monthly climatological \nOceanSODA SST') +
theme(legend.position = 'right') +
facet_wrap(~month, ncol = 2)
# plot the climatological monthly OceanSODA SST on a polar projection
basemap(limits = -32, data = argo_OceanSODA_temp_SO_clim_2x2) + # change to polar projection
geom_spatial_tile(data = argo_OceanSODA_temp_SO_clim_2x2,
aes(x = lon,
y = lat,
fill = clim_OceanSODA_temp),
linejoin = 'mitre',
col = 'transparent',
detail = 60)+
scale_fill_viridis_c()+
theme(legend.position = 'right')+
labs(x = 'lon',
y = 'lat',
fill = 'SST (ºC)',
title = 'monthly climatological \nOceanSODA SST')+
facet_wrap(~month, ncol = 2)
Climatological Argo SST
map +
geom_tile(data = argo_OceanSODA_temp_SO_clim_2x2,
aes(lon, lat, fill = clim_argo_temp)) +
lims(y = c(-85, -25)) +
scale_fill_viridis_c() +
labs(x = 'lon',
y = 'lat',
fill = 'SST (ºC)',
title = 'Monthly climatological \nArgo SST') +
theme(legend.position = 'right') +
facet_wrap(~month, ncol = 2)
Version | Author | Date |
---|---|---|
cec2a2a | ds2n19 | 2023-11-24 |
80c16c2 | ds2n19 | 2023-11-15 |
1ae81b3 | ds2n19 | 2023-10-11 |
44f5720 | ds2n19 | 2023-10-09 |
68eff8b | jens-daniel-mueller | 2022-05-11 |
10036ed | pasqualina-vonlanthendinenna | 2022-04-26 |
8805f99 | pasqualina-vonlanthendinenna | 2022-04-11 |
905d82f | pasqualina-vonlanthendinenna | 2022-02-15 |
basemap(limits = -32, data = argo_OceanSODA_temp_SO_clim_2x2) + # change to polar projection
geom_spatial_tile(data = argo_OceanSODA_temp_SO_clim_2x2,
aes(x = lon,
y = lat,
fill = clim_argo_temp),
linejoin = 'mitre',
col = 'transparent',
detail = 60)+
scale_fill_viridis_c()+
theme(legend.position = 'right')+
labs(x = 'lon',
y = 'lat',
fill = 'SST (ºC)',
title = 'monthly climatological \nArgo SST')+
facet_wrap(~month, ncol = 2)
Evolution of monthly SST, for the three Southern Ocean Mayot biomes
map +
geom_raster(data = nm_biomes,
aes(x = lon, y = lat)) +
geom_raster(data = nm_biomes,
aes(x = lon,
y = lat,
fill = biome_name)) +
labs(title = 'Southern Ocean Mayot regions',
fill = 'biome')
# plot timeseries of monthly OceanSODA SST
argo_OceanSODA_temp_SO_clim_regional <- argo_OceanSODA_temp_SO %>%
select(year, month, biome_name, OceanSODA_temp, argo_temp_month) %>%
pivot_longer(c(OceanSODA_temp,argo_temp_month),
values_to = "temp",
names_to = "data_source") %>%
group_by(year, month, biome_name, data_source) %>%
summarise(temp = mean(temp, na.rm = TRUE)) %>%
ungroup()
argo_OceanSODA_temp_SO_clim_regional %>%
ggplot(aes(x = year,
y = temp,
col = biome_name)) +
facet_grid(month ~ data_source) +
geom_line() +
geom_point() +
labs(x = 'year',
y = 'SST (ºC)',
title = 'monthly mean SST (Southern Ocean)',
col = 'biome')
argo_OceanSODA_temp_SO_clim_regional %>%
# filter(year != 2021) %>%
ggplot(aes(x = month,
y = temp,
group = year,
col = as.character(year)))+
geom_line()+
geom_point()+
scale_x_continuous(breaks = seq(1, 12, 2))+
facet_grid(biome_name~data_source)+
lims(y = c(-5, 20))+
labs(x = 'month',
y = 'SST (ºC)',
title = 'monthly mean SST (Southern Ocean)',
col = 'year')
Version | Author | Date |
---|---|---|
cec2a2a | ds2n19 | 2023-11-24 |
80c16c2 | ds2n19 | 2023-11-15 |
1ae81b3 | ds2n19 | 2023-10-11 |
44f5720 | ds2n19 | 2023-10-09 |
68eff8b | jens-daniel-mueller | 2022-05-11 |
10036ed | pasqualina-vonlanthendinenna | 2022-04-26 |
fd521d1 | pasqualina-vonlanthendinenna | 2022-02-25 |
905d82f | pasqualina-vonlanthendinenna | 2022-02-15 |
Calculate the difference between Argo and OceanSODA SST values
Offset between in-situ monthly SST:
argo_OceanSODA_temp_SO <- argo_OceanSODA_temp_SO %>%
mutate(offset = OceanSODA_temp - argo_temp_month)
argo_OceanSODA_temp_SO %>%
# drop_na() %>%
# filter(year != '2021') %>%
ggplot() +
geom_hline(yintercept = 0, size = 1)+
geom_point(aes(x = year_month, y = offset, col = biome_name), size = 0.7, pch = 19) +
scale_x_discrete(breaks = c('2013-01', '2014-01', '2015-01', '2016-01', '2017-01', '2018-01', '2019-01', '2020-01', '2021-01', '2022-01', '2023-01'))+
labs(title = 'oceanSODA SST - Argo SST',
x = 'date',
y = 'offset (ºC)',
col = 'region')
Version | Author | Date |
---|---|---|
cec2a2a | ds2n19 | 2023-11-24 |
80c16c2 | ds2n19 | 2023-11-15 |
1ae81b3 | ds2n19 | 2023-10-11 |
44f5720 | ds2n19 | 2023-10-09 |
68eff8b | jens-daniel-mueller | 2022-05-11 |
10036ed | pasqualina-vonlanthendinenna | 2022-04-26 |
acc96b0 | pasqualina-vonlanthendinenna | 2022-02-28 |
905d82f | pasqualina-vonlanthendinenna | 2022-02-15 |
argo_OceanSODA_temp_SO %>%
# drop_na() %>%
ggplot(aes(x = OceanSODA_temp, y = argo_temp_month))+
# geom_point(pch = 19, size = 0.7)+
geom_bin2d(aes(x = OceanSODA_temp, y = argo_temp_month), size = 0.3, bins = 60)+
scale_fill_viridis_c()+
coord_fixed(ratio = 1,
xlim = c(-3, 27),
ylim= c(-3, 27)) +
geom_abline(slope = 1, intercept = 0)+
facet_wrap(~biome_name)+
labs(x = 'OceanSODA SST (ºC)',
y = 'Argo SST (ºC)',
title = 'Southern Ocean regional SST')
# test with basin and biome
basinmask <-
read_csv(paste(path_emlr_utilities,
"basin_mask_WOA18.csv",
sep = ""),
col_types = cols("MLR_basins" = col_character()))
basinmask <- basinmask %>%
filter(MLR_basins == unique(basinmask$MLR_basins)[1]) %>%
select(lon, lat, basin_AIP)
argo_OceanSODA_temp_SO <- inner_join(argo_OceanSODA_temp_SO, basinmask)
argo_OceanSODA_temp_SO %>%
ggplot(aes(x = OceanSODA_temp, y = argo_temp_month))+
geom_bin2d(aes(x = OceanSODA_temp, y = argo_temp_month), size = 0.3, bins = 60)+
scale_fill_viridis_c()+
coord_fixed(ratio = 1,
xlim = c(-3, 27),
ylim = c(-3, 27))+
geom_abline(slope = 1, intercept = 0)+
facet_grid(basin_AIP~biome_name)+
labs(x = 'Argo SST (ºC)',
y = 'OceanSODA SST (ºC)',
title = 'Southern Ocean subregional SST')
Mean offset between in-situ OceanSODA SST and in-situ BGC-Argo SST
mean_insitu_offset <- argo_OceanSODA_temp_SO %>%
group_by(year_month, biome_name) %>%
summarise(mean_offset = mean(offset, na.rm = TRUE),
std_offset = sd(offset, na.rm = TRUE))
mean_insitu_offset %>%
# drop_na() %>%
# filter(year != '2021') %>%
ggplot() +
geom_hline(yintercept = 0, size = 1, col = 'red')+
geom_point(aes(x = year_month, y = mean_offset, group = biome_name, col = biome_name), size = 0.7, pch = 19) +
geom_line(aes(x = year_month, y = mean_offset, group = biome_name, col = biome_name))+
geom_ribbon(aes(x = year_month,
ymin = mean_offset-std_offset,
ymax = mean_offset+std_offset,
group = biome_name,
fill =biome_name),
alpha = 0.2)+
scale_x_discrete(breaks = c('2013-01', '2014-01', '2015-01', '2016-01', '2017-01', '2018-01', '2019-01', '2020-01', '2021-01', '2022-01', '2023-01'))+
# facet_wrap(~year)+
labs(title = 'Mean offset (in situ oceanSODA SST - in situ Argo SST)',
x = 'date',
y = 'offset (ºC)',
col = 'region',
fill = '± 1 std')
Version | Author | Date |
---|---|---|
cec2a2a | ds2n19 | 2023-11-24 |
80c16c2 | ds2n19 | 2023-11-15 |
1ae81b3 | ds2n19 | 2023-10-11 |
44f5720 | ds2n19 | 2023-10-09 |
68eff8b | jens-daniel-mueller | 2022-05-11 |
10036ed | pasqualina-vonlanthendinenna | 2022-04-26 |
acc96b0 | pasqualina-vonlanthendinenna | 2022-02-28 |
c68163a | pasqualina-vonlanthendinenna | 2022-02-22 |
905d82f | pasqualina-vonlanthendinenna | 2022-02-15 |
Offset between climatological Argo and climatological OceanSODA SST:
# Offset between climatological argo and climatological OceanSODA SST
argo_OceanSODA_temp_SO_clim <- inner_join(argo_OceanSODA_temp_SO_clim, nm_biomes)
argo_OceanSODA_temp_SO_clim %>%
# drop_na() %>%
ggplot() +
geom_point(aes(x = month, y = offset_clim, col = biome_name), size = 0.7, pch = 19) +
geom_hline(yintercept = 0, size = 1, col = 'red')+
scale_x_continuous(breaks = seq(1, 12, 1))+
labs(title = 'clim oceanSODA SST - clim Argo SST',
x = 'month',
y = 'offset (ºC)',
col = 'region')
Mean offset between climatological OceanSODA SST and climatological BGC-Argo SST
mean_clim_offset <- argo_OceanSODA_temp_SO_clim %>%
group_by(month, biome_name) %>%
summarise(mean_offset_clim = mean(offset_clim, na.rm = TRUE),
std_offset_clim = sd(offset_clim, na.rm = TRUE))
mean_clim_offset %>%
ggplot()+
geom_point(aes(x = month, y = mean_offset_clim, col = biome_name))+
geom_line(aes(x = month, y = mean_offset_clim, col = biome_name))+
geom_hline(yintercept = 0, col = 'red') +
geom_ribbon(aes(x = month,
ymin = mean_offset_clim - std_offset_clim,
ymax = mean_offset_clim + std_offset_clim,
group = biome_name,
fill = biome_name),
alpha = 0.2) +
scale_x_continuous(breaks = seq(1, 12, 1)) +
labs(x = 'month',
y = 'mean offset (ºC)',
title = 'Mean offset (clim OceanSODA SST - clim Argo SST)',
col = 'region',
fill = '± 1 std')
Mapped offset between climatological OceanSODA SST and climatological BGC-Argo SST
# bin the offsets for better plotting
# plot the offsets on a map of the Southern Ocean
argo_OceanSODA_temp_SO_clim_2x2 <- argo_OceanSODA_temp_SO_clim_2x2 %>%
mutate(offset_clim_binned =
cut(offset_clim,
breaks = c(-Inf, -0.025, -0.005, 0.000, 0.005, 0.025, 0.035, 0.05, Inf))) # bin the offsets into intervals (create a discrete variable instead of continuous)
# offset_clim_binned = as.factor(as.character(offset_clim_binned))) %>%
# drop_na()
map +
geom_tile(data = argo_OceanSODA_temp_SO_clim_2x2,
aes(lon, lat, fill = offset_clim_binned)) +
lims(y = c(-85, -30)) +
scale_fill_brewer(palette = 'RdBu', drop = FALSE) +
labs(x = 'lon',
y = 'lat',
fill = 'offset (ºC)',
title = 'clim OceanSODA SST - clim Argo SST') +
theme(legend.position = 'right')+
facet_wrap(~month, ncol = 2)
basemap(limits = -32, data = argo_OceanSODA_temp_SO_clim_2x2) + # change to polar projection
geom_spatial_tile(data = argo_OceanSODA_temp_SO_clim_2x2,
aes(x = lon,
y = lat,
fill = offset_clim_binned),
linejoin = 'mitre',
col = 'transparent',
detail = 60)+
scale_fill_brewer(palette = 'RdBu', drop = FALSE)+
theme(legend.position = 'right')+
labs(x = 'lon',
y = 'lat',
fill = 'offset (ºC)',
title = 'clim Ocean SODA SST - clim Argo SST')+
facet_wrap(~month, ncol = 2)
Using full OceanSODA data (even where there is no Argo data) Each Mayot biome is separated into basins (Atlantic, Pacific, Indian)
basinmask <-
read_csv(paste(path_emlr_utilities,
"basin_mask_WOA18.csv",
sep = ""),
col_types = cols("MLR_basins" = col_character()))
basinmask <- basinmask %>%
filter(MLR_basins == unique(basinmask$MLR_basins)[1]) %>%
select(lon, lat, basin_AIP)
OceanSODA_temp_SO <- inner_join(OceanSODA_temp, nm_biomes) %>%
filter(year >= 2013)
OceanSODA_temp_SO <- inner_join(OceanSODA_temp_SO, basinmask) %>%
mutate(year = year(date_OceanSODA),
month = month(date_OceanSODA)) %>%
mutate(date = format_ISO8601(date_OceanSODA, precision = 'ym'))
# plot timeseries of monthly OceanSODA SST
OceanSODA_temp_SO_clim_subregional <- OceanSODA_temp_SO %>%
group_by(year, month, biome_name, basin_AIP) %>% # compute regional mean OceanSODA SST for the three biomes
summarise(temp = mean(temperature, na.rm = TRUE)) %>%
ungroup()
# plot a timeseries of monthly average OceanSODA pH, per region and per basin
OceanSODA_temp_SO_clim_subregional %>%
ggplot(aes(x = month,
y = temp,
group = year,
col = as.character(year)))+
geom_line()+
geom_point()+
scale_x_continuous(breaks = seq(1, 12, 2))+
facet_grid(biome_name~basin_AIP)+
labs(x = 'month',
y = 'SST (ºC)',
title = 'monthly mean OceanSODA SST (Southern Ocean basins)',
col = 'year')
OceanSODA_temp_SO_clim_subregional %>%
ggplot(aes(x = year,
y = temp,
col = biome_name)) +
facet_grid(month ~ basin_AIP) +
geom_line() +
geom_point() +
labs(x = 'year',
y = 'SST (ºC)',
title = 'monthly mean OceanSODA SST (Southern Ocean basins)',
col = 'region')
Bin the SST data into 20º longitude bins
OceanSODA_temp_SO_lon_binned <- OceanSODA_temp_SO %>%
mutate(lon = cut(lon, seq(20, 380, 20), seq(30, 370, 20)),
lon = as.numeric(as.character(lon))
) %>%
group_by(lon, year, month, biome_name) %>%
summarise(
OceanSODA_temp_binned = mean(temperature, na.rm = TRUE)
) %>%
ungroup()
OceanSODA_temp_SO_lon_binned %>%
# drop_na() %>%
ggplot(aes(x = month, y = OceanSODA_temp_binned, group = lon, col = as.factor(lon))) +
geom_line()+
geom_point()+
scale_x_continuous(breaks = seq(1, 12, 2))+
facet_grid(year~biome_name)+
labs(x = 'month',
y = 'OceanSODA SST (ºC)',
col = 'longitude bin')
rm(OceanSODA_temp_SO_lon_binned, OceanSODA_temp_SO_clim_subregional, argo_OceanSODA_temp_SO_clim_2x2, mean_clim_offset, argo_OceanSODA_temp_SO_clim, mean_insitu_offset, argo_OceanSODA_temp_SO, argo_OceanSODA_temp_SO_clim_regional)
Repeat analysis with SST data from the Core-Argo dataset
# argo_surf_temp_core <-
# read_rds(file = paste0(
# path_argo_core_preprocessed, "/core_temp_flag_A.rds")) %>%
# filter(between(depth, 0, 20)) %>%
# mutate(year = year(date),
# month = month(date))
argo_surf_temp_core <- read_rds(file = paste0(path_argo_core_preprocessed, '/temp_core_observed.rds')) %>%
filter(between(depth, 0, 20))
argo_temp_monthly_core <- argo_surf_temp_core %>%
mutate(year_month = format_ISO8601(date, precision = "ym"), .after = 'date') %>%
group_by(year, month, year_month, date, lat, lon) %>%
summarise(argo_temp_month = mean(temp_adjusted, na.rm = TRUE)) %>%
ungroup() %>%
select(
date,
year_month,
year,
month,
lon,
lat,
argo_temp_month
)
Join Core-Argo and OceanSODA
argo_OceanSODA_temp_core <- left_join(
argo_temp_monthly_core, OceanSODA_temp) %>%
rename(OceanSODA_temp = temperature)
Compare Southern Ocean Core-SST to OceanSODA SST
# keep only Southern Ocean data
argo_OceanSODA_temp_SO <-
inner_join(argo_OceanSODA_temp_core, nm_biomes)
Map OceanSODA SST where Core-Argo SST measurements exist
# calculate average monthly SST between, and the difference between the two (offset)
argo_OceanSODA_temp_SO_clim <- argo_OceanSODA_temp_SO %>%
group_by(lon, lat, month) %>%
summarise(
clim_OceanSODA_temp = mean(OceanSODA_temp, na.rm = TRUE),
clim_argo_temp = mean(argo_temp_month, na.rm = TRUE),
offset_clim = clim_OceanSODA_temp - clim_argo_temp
) %>%
ungroup()
# regrid to a 2x2 grid for mapping
argo_OceanSODA_temp_SO_clim_2x2 <- argo_OceanSODA_temp_SO_clim %>%
mutate(
lat = cut(lat, seq(-90, 90, 2), seq(-89, 89, 2)),
lat = as.numeric(as.character(lat)),
lon = cut(lon, seq(20, 380, 2), seq(21, 379, 2)),
lon = as.numeric(as.character(lon))
) %>%
group_by(lon, lat, month) %>%
summarise(
clim_OceanSODA_temp = mean(clim_OceanSODA_temp, na.rm = TRUE),
clim_argo_temp = mean(clim_argo_temp, na.rm = TRUE),
offset_clim = mean(offset_clim, na.rm = TRUE)
) %>%
ungroup()
map +
geom_tile(data = argo_OceanSODA_temp_SO_clim_2x2,
aes(x = lon, y = lat, fill = clim_OceanSODA_temp)) +
lims(y = c(-85, -25)) +
scale_fill_viridis_c() +
labs(x = 'lon',
y = 'lat',
fill = 'SST (ºC)',
title = 'Monthly climatological \nOceanSODA SST') +
theme(legend.position = 'right') +
facet_wrap(~month, ncol = 2)
map +
geom_tile(data = argo_OceanSODA_temp_SO_clim_2x2,
aes(lon, lat, fill = clim_argo_temp)) +
lims(y = c(-85, -25)) +
scale_fill_viridis_c() +
labs(x = 'lon',
y = 'lat',
fill = 'SST (ºC)',
title = 'Monthly climatological \nArgo SST') +
theme(legend.position = 'right') +
facet_wrap(~month, ncol = 2)
# plot timeseries of monthly OceanSODA SST
argo_OceanSODA_temp_SO_clim_regional <- argo_OceanSODA_temp_SO %>%
select(year, month, biome_name, OceanSODA_temp, argo_temp_month) %>%
pivot_longer(c(OceanSODA_temp,argo_temp_month),
values_to = "temp",
names_to = "data_source") %>%
group_by(year, month, biome_name, data_source) %>%
summarise(temp = mean(temp, na.rm = TRUE)) %>%
ungroup()
argo_OceanSODA_temp_SO_clim_regional %>%
# filter(year != 2021) %>%
ggplot(aes(x = month,
y = temp,
group = year,
col = as.character(year)))+
geom_line()+
geom_point()+
scale_x_continuous(breaks = seq(1, 12, 2))+
facet_grid(biome_name~data_source)+
lims(y = c(-5, 20))+
labs(x = 'month',
y = 'SST (ºC)',
title = 'monthly mean SST (Southern Ocean)',
col = 'year')
argo_OceanSODA_temp_SO <- argo_OceanSODA_temp_SO %>%
mutate(offset = OceanSODA_temp - argo_temp_month)
argo_OceanSODA_temp_SO %>%
# drop_na() %>%
# filter(year != '2021') %>%
ggplot() +
geom_hline(yintercept = 0, size = 1)+
geom_point(aes(x = year_month, y = offset, col = biome_name), size = 0.7, pch = 19) +
scale_x_discrete(breaks = c('2013-01', '2014-01', '2015-01', '2016-01', '2017-01', '2018-01', '2019-01', '2020-01', '2021-01', '2022-01', '2023-01'))+
labs(title = 'oceanSODA SST - Argo SST',
x = 'date',
y = 'offset (ºC)',
col = 'region')
argo_OceanSODA_temp_SO %>%
# drop_na() %>%
ggplot(aes(x = OceanSODA_temp, y = argo_temp_month))+
# geom_point(pch = 19, size = 0.7)+
geom_bin2d(aes(x = OceanSODA_temp, y = argo_temp_month), size = 0.3, bins = 60)+
scale_fill_viridis_c()+
coord_fixed(ratio = 1,
xlim = c(-3, 27),
ylim= c(-3, 27)) +
geom_abline(slope = 1, intercept = 0)+
facet_wrap(~biome_name)+
labs(x = 'OceanSODA SST (ºC)',
y = 'Argo SST (ºC)',
title = 'Southern Ocean regional SST')
# test with basin and biome
basinmask <-
read_csv(paste(path_emlr_utilities,
"basin_mask_WOA18.csv",
sep = ""),
col_types = cols("MLR_basins" = col_character()))
basinmask <- basinmask %>%
filter(MLR_basins == unique(basinmask$MLR_basins)[1]) %>%
select(lon, lat, basin_AIP)
argo_OceanSODA_temp_SO <- inner_join(argo_OceanSODA_temp_SO, basinmask)
argo_OceanSODA_temp_SO %>%
ggplot(aes(x = OceanSODA_temp, y = argo_temp_month))+
geom_bin2d(aes(x = OceanSODA_temp, y = argo_temp_month), size = 0.3, bins = 60)+
scale_fill_viridis_c()+
coord_fixed(ratio = 1,
xlim = c(-3, 27),
ylim = c(-3, 27))+
geom_abline(slope = 1, intercept = 0)+
facet_grid(basin_AIP~biome_name)+
labs(x = 'Argo SST (ºC)',
y = 'OceanSODA SST (ºC)',
title = 'Southern Ocean subregional SST')
Mean offset between in-situ OceanSODA SST and in-situ Core-Argo SST
mean_insitu_offset <- argo_OceanSODA_temp_SO %>%
group_by(year_month, biome_name) %>%
summarise(mean_offset = mean(offset, na.rm = TRUE),
std_offset = sd(offset, na.rm = TRUE))
mean_insitu_offset %>%
# drop_na() %>%
# filter(year != '2021') %>%
ggplot() +
geom_hline(yintercept = 0, size = 1, col = 'red')+
geom_point(aes(x = year_month, y = mean_offset, group = biome_name, col = biome_name), size = 0.7, pch = 19) +
geom_line(aes(x = year_month, y = mean_offset, group = biome_name, col = biome_name))+
geom_ribbon(aes(x = year_month,
ymin = mean_offset-std_offset,
ymax = mean_offset+std_offset,
group = biome_name,
fill =biome_name),
alpha = 0.2)+
scale_x_discrete(breaks = c('2013-01', '2014-01', '2015-01', '2016-01', '2017-01', '2018-01', '2019-01', '2020-01', '2021-01', '2022-01', '2023-01'))+
# facet_wrap(~year)+
labs(title = 'Mean offset (in situ oceanSODA SST - in situ Argo SST)',
x = 'date',
y = 'offset (ºC)',
col = 'region',
fill = '± 1 std')
Offset between climatological Core-Argo and climatological OceanSODA SST
# Offset between climatological argo and climatological OceanSODA SST
argo_OceanSODA_temp_SO_clim <- inner_join(argo_OceanSODA_temp_SO_clim, nm_biomes)
argo_OceanSODA_temp_SO_clim %>%
# drop_na() %>%
ggplot() +
geom_point(aes(x = month, y = offset_clim, col = biome_name), size = 0.7, pch = 19) +
geom_hline(yintercept = 0, size = 1, col = 'red')+
scale_x_continuous(breaks = seq(1, 12, 1))+
labs(title = 'clim oceanSODA SST - clim Argo SST',
x = 'month',
y = 'offset (ºC)',
col = 'region')
Mean offset between climatological OceanSODA SST and climatological Core-Argo SST
mean_clim_offset <- argo_OceanSODA_temp_SO_clim %>%
group_by(month, biome_name) %>%
summarise(mean_offset_clim = mean(offset_clim, na.rm = TRUE),
std_offset_clim = sd(offset_clim, na.rm = TRUE))
mean_clim_offset %>%
ggplot()+
geom_point(aes(x = month, y = mean_offset_clim, col = biome_name))+
geom_line(aes(x = month, y = mean_offset_clim, col = biome_name))+
geom_hline(yintercept = 0, col = 'red') +
geom_ribbon(aes(x = month,
ymin = mean_offset_clim - std_offset_clim,
ymax = mean_offset_clim + std_offset_clim,
group = biome_name,
fill = biome_name),
alpha = 0.2) +
scale_x_continuous(breaks = seq(1, 12, 1)) +
labs(x = 'month',
y = 'mean offset (ºC)',
title = 'Mean offset (clim OceanSODA SST - clim Argo SST)',
col = 'region',
fill = '± 1 std')
Mapped offset between climatological OceanSODA SST and climatological Core-Argo SST
# bin the offsets for better plotting
# plot the offsets on a map of the Southern Ocean
argo_OceanSODA_temp_SO_clim_2x2 <- argo_OceanSODA_temp_SO_clim_2x2 %>%
mutate(offset_clim_binned =
cut(offset_clim,
breaks = c(-Inf, -0.025, -0.005, 0.000, 0.005, 0.025, 0.035, 0.05, Inf))) # bin the offsets into intervals (create a discrete variable instead of continuous)
# offset_clim_binned = as.factor(as.character(offset_clim_binned))) %>%
# drop_na()
map +
geom_tile(data = argo_OceanSODA_temp_SO_clim_2x2,
aes(lon, lat, fill = offset_clim_binned)) +
lims(y = c(-85, -30)) +
scale_fill_brewer(palette = 'RdBu', drop = FALSE) +
labs(x = 'lon',
y = 'lat',
fill = 'offset (ºC)',
title = 'clim OceanSODA SST - clim Argo SST') +
theme(legend.position = 'right')+
facet_wrap(~month, ncol = 2)
sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: openSUSE Leap 15.5
Matrix products: default
BLAS: /usr/local/R-4.2.2/lib64/R/lib/libRblas.so
LAPACK: /usr/local/R-4.2.2/lib64/R/lib/libRlapack.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] metR_0.13.0 ggOceanMaps_1.3.4 ggspatial_1.1.7 lubridate_1.9.0
[5] timechange_0.1.1 forcats_0.5.2 stringr_1.5.0 dplyr_1.1.3
[9] purrr_1.0.2 readr_2.1.3 tidyr_1.3.0 tibble_3.2.1
[13] ggplot2_3.4.4 tidyverse_1.3.2
loaded via a namespace (and not attached):
[1] fs_1.5.2 sf_1.0-9 bit64_4.0.5
[4] RColorBrewer_1.1-3 httr_1.4.4 rprojroot_2.0.3
[7] tools_4.2.2 backports_1.4.1 bslib_0.4.1
[10] utf8_1.2.2 R6_2.5.1 KernSmooth_2.23-20
[13] rgeos_0.5-9 DBI_1.1.3 colorspace_2.0-3
[16] raster_3.6-11 withr_2.5.0 sp_1.5-1
[19] tidyselect_1.2.0 bit_4.0.5 compiler_4.2.2
[22] git2r_0.30.1 cli_3.6.1 rvest_1.0.3
[25] xml2_1.3.3 labeling_0.4.2 sass_0.4.4
[28] scales_1.2.1 checkmate_2.1.0 classInt_0.4-8
[31] proxy_0.4-27 digest_0.6.30 rmarkdown_2.18
[34] pkgconfig_2.0.3 htmltools_0.5.3 highr_0.9
[37] dbplyr_2.2.1 fastmap_1.1.0 rlang_1.1.1
[40] readxl_1.4.1 rstudioapi_0.15.0 farver_2.1.1
[43] jquerylib_0.1.4 generics_0.1.3 jsonlite_1.8.3
[46] vroom_1.6.0 googlesheets4_1.0.1 magrittr_2.0.3
[49] Rcpp_1.0.10 munsell_0.5.0 fansi_1.0.3
[52] lifecycle_1.0.3 terra_1.7-39 stringi_1.7.8
[55] whisker_0.4 yaml_2.3.6 grid_4.2.2
[58] parallel_4.2.2 promises_1.2.0.1 crayon_1.5.2
[61] lattice_0.20-45 haven_2.5.1 hms_1.1.2
[64] knitr_1.41 pillar_1.9.0 codetools_0.2-18
[67] reprex_2.0.2 glue_1.6.2 evaluate_0.18
[70] data.table_1.14.6 modelr_0.1.10 vctrs_0.6.4
[73] tzdb_0.3.0 httpuv_1.6.6 cellranger_1.1.0
[76] gtable_0.3.1 assertthat_0.2.1 cachem_1.0.6
[79] xfun_0.35 broom_1.0.5 e1071_1.7-12
[82] later_1.3.0 viridisLite_0.4.1 class_7.3-20
[85] googledrive_2.0.0 gargle_1.2.1 memoise_2.0.1
[88] workflowr_1.7.0 units_0.8-0 ellipsis_0.3.2