Last updated: 2024-04-19

Checks: 7 0

Knit directory: bgc_argo_r_argodata/analysis/

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 c4eb5b4. 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:    .Rproj.user/

Untracked files:
    Untracked:  analysis/anomay_SST_2023.Rmd
    Untracked:  analysis/draft.Rmd

Unstaged changes:
    Modified:   analysis/MHWs_categorisation.Rmd
    Modified:   analysis/_site.yml
    Modified:   analysis/coverage_maps_North_Atlantic.Rmd
    Modified:   analysis/load_broullon_DIC_TA_clim.Rmd
    Modified:   analysis/temp_core_SO_cluster_analysis.Rmd
    Modified:   code/Workflowr_project_managment.R
    Modified:   code/start_background_job.R
    Modified:   code/start_background_job_load.R
    Modified:   code/start_background_job_partial.R

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/variability_pH.Rmd) and HTML (docs/variability_pH.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 1a72545 mlarriere 2024-04-12 Build site.
html 9ff080a mlarriere 2024-04-12 Build site.
html c076fba mlarriere 2024-04-12 Build site.
html 91f08a6 mlarriere 2024-04-07 Build site.
html db21f55 mlarriere 2024-04-06 Build site.
html 488ff93 mlarriere 2024-04-01 Build site.
html f9de50e ds2n19 2024-01-01 Build site.
html 07d4eb8 ds2n19 2023-12-20 Build site.
html fa6cf38 ds2n19 2023-12-14 Build site.
Rmd 64fd104 ds2n19 2023-12-14 revised coverage analysis and SO focused cluster analysis.
html f110b74 ds2n19 2023-12-13 Build site.
Rmd fa9795c ds2n19 2023-12-12 dependencies listed are start of markdown files.
html e60ebd2 ds2n19 2023-12-07 Build site.
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.
Rmd 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 7b3d8c5 pasqualina-vonlanthendinenna 2022-08-29 Build site.
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 b917bd0 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.
html c03dd24 pasqualina-vonlanthendinenna 2022-04-20 Build site.
html 8805f99 pasqualina-vonlanthendinenna 2022-04-11 Build site.
html 6dd0945 pasqualina-vonlanthendinenna 2022-03-25 Build site.
html e12a216 pasqualina-vonlanthendinenna 2022-03-15 Build site.
Rmd e4d1d1e pasqualina-vonlanthendinenna 2022-03-15 updated to new only flag A data
html c8451b9 pasqualina-vonlanthendinenna 2022-03-14 Build site.
Rmd 0da56b4 pasqualina-vonlanthendinenna 2022-03-14 added variability pages

Task

Explore the spatial variability of Argo pH profiles

Dependencies

pH_bgc_observed.rds - bgc preprocessed folder, created by ph_align_climatology. Not this file is written BEFORE the vertical alignment stage.

theme_set(theme_bw())

Load data

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_updata <- '/nfs/kryo/work/updata'

path_argo <- '/nfs/kryo/work/datasets/ungridded/3d/ocean/floats/bgc_argo'
# /nfs/kryo/work/datasets/ungridded/3d/ocean/floats/bgc_argo/preprocessed_bgc_data
path_argo_preprocessed <- paste0(path_argo, "/preprocessed_bgc_data")
region_masks_all_1x1 <- read_rds(file = paste0(path_argo_preprocessed,
                                               "/region_masks_all_1x1.rds"))

region_masks_all_1x1 <- region_masks_all_1x1 %>%
  rename(biome = value) %>% 
  mutate(coast = as.character(coast))

# WOA 18 basin mask

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(-c(MLR_basins, basin))

# full argo data
# original_argo <- read_rds(file = paste0(path_argo_preprocessed, "/bgc_merge_pH_qc_1.rds"))

# change the date format for compatibility with OceanSODA data
# original_argo <- full_argo %>%
#   mutate(year = year(date),
#          month = month(date)) %>%
#   mutate(date = ymd(format(date, "%Y-%m-15")))

# full_argo <- read_rds(file = paste0(path_argo_preprocessed, '/bgc_merge_flag_AB.rds')) %>% 
#   select(-c(temp_adjusted:temp_adjusted_error, profile_temp_qc))
# 
# full_argo <- full_argo %>%
#   mutate(year = year(date),
#          month = month(date)) %>%
#   mutate(date = ymd(format(date, "%Y-%m-15")))

# load validated and vertically aligned pH profiles, 
full_argo <-
  read_rds(file = paste0(path_argo_preprocessed, "/pH_bgc_observed.rds")) %>%
  mutate(date = ymd(format(date, "%Y-%m-15")))

map <-
  read_rds(paste(path_emlr_utilities,
                 "map_landmask_WOA18.rds",
                 sep = ""))

Regions

Biomes

# keep only southern ocean biomes 

region_masks_all_1x1 <- region_masks_all_1x1 %>%
  filter(region == 'southern',
         biome != 0) %>% 
  select(-region)

# remove coastal data 

region_masks_all_1x1 <- region_masks_all_1x1 %>% 
  filter(coast == "0")
map +
  geom_tile(data = region_masks_all_1x1, 
            aes(x = lon, 
                y = lat, 
                fill = biome))+
  lims(y = c(-85, -30))+
  scale_fill_brewer(palette = 'Dark2')

Version Author Date
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

Basins

basinmask <- basinmask %>%
  filter(lat < -30)
map +
  geom_tile(data = basinmask, 
            aes(x = lon, 
                y = lat, 
                fill = basin_AIP))+
  lims(y = c(-85, -30))+
  scale_fill_brewer(palette = 'Dark2')

Version Author Date
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

Southern Ocean Argo pH

full_argo_SO <- inner_join(full_argo, region_masks_all_1x1)

full_argo_SO <- inner_join(full_argo_SO, basinmask)

# full_argo_SO <- full_argo_SO %>%
#   unite('platform_cycle', platform_number:cycle_number, sep = '_', remove = FALSE)

# original_argo_SO <- inner_join(original_argo, region_masks_all_1x1)
# 
# original_argo_SO <- inner_join(original_argo_SO, basinmask)
# 
# original_argo_SO <- original_argo_SO %>% 
#   unite('platform_cycle', platform_number:cycle_number, sep = '_', remove = FALSE)

Profiles by longitude

# plot the argo temperature profiles according to their longitude, in each biome, basin, and year

full_argo_SO %>% 
  group_split(biome, basin_AIP, year) %>% 
  head(12) %>%
  map(
    ~ ggplot(data = .x,
             aes(x = ph_in_situ_total_adjusted,
                 y = depth,
                 group = file_id,
                 col = lon))+
      geom_path(data = .x,
                aes(x = ph_in_situ_total_adjusted,
                    y = depth,
                    group = file_id,
                    col = lon), 
                size = 0.3)+
      scale_y_reverse()+
      scale_color_viridis_c()+
      facet_wrap(~month, ncol = 6)+
      labs(title = paste0('biome: ', unique(.x$biome), '| basin: ', unique(.x$basin_AIP), ' |', unique(.x$year)),
           x = 'Argo pH',
           y = 'depth (m)',
           col = 'longitude')
  )
[[1]]

Version Author Date
80c16c2 ds2n19 2023-11-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[2]]

Version Author Date
cec2a2a ds2n19 2023-11-24
80c16c2 ds2n19 2023-11-15
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[3]]

Version Author Date
cec2a2a ds2n19 2023-11-24
80c16c2 ds2n19 2023-11-15
4b55c43 ds2n19 2023-10-12
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[4]]

Version Author Date
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[5]]

Version Author Date
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[6]]

Version Author Date
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[7]]

Version Author Date
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[8]]

Version Author Date
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[9]]

Version Author Date
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[10]]

Version Author Date
f9de50e ds2n19 2024-01-01
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[11]]

Version Author Date
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[12]]

Version Author Date
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

Profiles by latitude

# color the argo profiles according to their latitude, for each biome, basin, and year 

full_argo_SO %>%
  group_split(biome, basin_AIP, year) %>%
  head(12) %>%
  map(
    ~ ggplot(data = .x,
             aes(x = ph_in_situ_total_adjusted,
                 y = depth,
                 group = file_id,
                 col = lat))+
      geom_path(data = .x,
                aes(x = ph_in_situ_total_adjusted,
                    y = depth,
                    group = file_id,
                    col = lat), 
                size = 0.3)+
      scale_y_reverse()+
      scale_color_viridis_c()+
      facet_wrap(~month, ncol = 6)+
      labs(title = paste0('biome: ', unique(.x$biome), '| basin: ', unique(.x$basin_AIP), ' |', unique(.x$year)),
           x = 'Argo pH',
           y = 'depth (m)',
           col = 'latitude')
  )
[[1]]

Version Author Date
80c16c2 ds2n19 2023-11-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[2]]

Version Author Date
cec2a2a ds2n19 2023-11-24
80c16c2 ds2n19 2023-11-15
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[3]]

Version Author Date
cec2a2a ds2n19 2023-11-24
80c16c2 ds2n19 2023-11-15
4b55c43 ds2n19 2023-10-12
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[4]]

Version Author Date
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[5]]

Version Author Date
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[6]]

Version Author Date
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[7]]

Version Author Date
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[8]]

Version Author Date
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[9]]

Version Author Date
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[10]]

Version Author Date
f9de50e ds2n19 2024-01-01
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[11]]

Version Author Date
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

[[12]]

Version Author Date
cec2a2a ds2n19 2023-11-24
710edd4 jens-daniel-mueller 2022-05-11
b917bd0 jens-daniel-mueller 2022-05-11
e12a216 pasqualina-vonlanthendinenna 2022-03-15
c8451b9 pasqualina-vonlanthendinenna 2022-03-14

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] ggforce_0.4.1     metR_0.13.0       scico_1.3.1       ggOceanMaps_1.3.4
 [5] ggspatial_1.1.7   broom_1.0.5       lubridate_1.9.0   timechange_0.1.1 
 [9] forcats_0.5.2     stringr_1.5.0     dplyr_1.1.3       purrr_1.0.2      
[13] readr_2.1.3       tidyr_1.3.0       tibble_3.2.1      ggplot2_3.4.4    
[17] 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.2.2           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] checkmate_2.1.0     scales_1.2.1        classInt_0.4-8     
[31] proxy_0.4-27        digest_0.6.30       rmarkdown_2.18     
[34] pkgconfig_2.0.3     htmltools_0.5.8.1   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-65        stringi_1.7.8      
[55] whisker_0.4         yaml_2.3.6          MASS_7.3-58.1      
[58] grid_4.2.2          parallel_4.2.2      promises_1.2.0.1   
[61] crayon_1.5.2        lattice_0.20-45     haven_2.5.1        
[64] hms_1.1.2           knitr_1.41          pillar_1.9.0       
[67] codetools_0.2-18    reprex_2.0.2        glue_1.6.2         
[70] evaluate_0.18       data.table_1.14.6   modelr_0.1.10      
[73] tweenr_2.0.2        vctrs_0.6.4         tzdb_0.3.0         
[76] httpuv_1.6.6        cellranger_1.1.0    polyclip_1.10-4    
[79] gtable_0.3.1        assertthat_0.2.1    cachem_1.0.6       
[82] xfun_0.35           e1071_1.7-12        later_1.3.0        
[85] viridisLite_0.4.1   class_7.3-20        googledrive_2.0.0  
[88] gargle_1.2.1        memoise_2.0.1       workflowr_1.7.0    
[91] units_0.8-0         ellipsis_0.3.2