Last updated: 2022-02-16

Checks: 7 0

Knit directory: emlr_obs_preprocessing/

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(20200707) 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 9755b16. 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:    data/
    Ignored:    output/

Untracked files:
    Untracked:  code/IO_1990_own_crossover_analysis_backup.R
    Untracked:  code/read_GLODAPv2_2020.Rmd

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/read_GLODAPv2_2021.Rmd) and HTML (docs/read_GLODAPv2_2021.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
Rmd 9755b16 jens-daniel-mueller 2022-02-16 cruise wise crossover analysis
html 6e65117 jens-daniel-mueller 2022-02-16 Build site.
Rmd fc1cf80 jens-daniel-mueller 2022-02-15 rerun with flux products
html cf43743 jens-daniel-mueller 2022-02-15 Build site.
Rmd 04014b7 jens-daniel-mueller 2022-02-15 decadal crossover evaluation pre subbasin
html 4a7550e jens-daniel-mueller 2022-02-15 Build site.
Rmd 856705f jens-daniel-mueller 2022-02-15 decadal crossover evaluation pre subbasin
html 8804a83 jens-daniel-mueller 2022-02-15 Build site.
Rmd 0c2d719 jens-daniel-mueller 2022-02-15 decadal crossover evaluation pre subbasin
html e1243c2 jens-daniel-mueller 2022-02-15 Build site.
Rmd 8eced63 jens-daniel-mueller 2022-02-15 decadal crossover evaluation pre subbasin
html efc2025 jens-daniel-mueller 2022-02-15 Build site.
Rmd 73fc278 jens-daniel-mueller 2022-02-15 decadal crossover evaluation pre subbasin
html 4d9d1cd jens-daniel-mueller 2022-01-17 Build site.
Rmd 0a1ca07 jens-daniel-mueller 2022-01-17 rerun without saving expocodes
html 9075296 jens-daniel-mueller 2022-01-12 Build site.
Rmd 86182f0 jens-daniel-mueller 2022-01-12 data contribution per cruise
html ecc669f jens-daniel-mueller 2022-01-04 Build site.
Rmd 98d874a jens-daniel-mueller 2022-01-04 calculate crossover of gap filled data
html 2620d02 jens-daniel-mueller 2022-01-03 Build site.
Rmd ee1e44a jens-daniel-mueller 2022-01-03 plot crossover of gap filled data
html ca3a146 jens-daniel-mueller 2022-01-03 Build site.
Rmd f71bc69 jens-daniel-mueller 2022-01-03 plot crossover of gap filled data
html 6e1b56c jens-daniel-mueller 2022-01-03 Build site.
Rmd c5258b1 jens-daniel-mueller 2022-01-03 plot crossover of gap filled data
html 9febbb8 jens-daniel-mueller 2022-01-03 Build site.
Rmd cd89345 jens-daniel-mueller 2022-01-03 plot crossover of gap filled data
html 1a9c797 jens-daniel-mueller 2022-01-03 Build site.
Rmd cde43c6 jens-daniel-mueller 2022-01-03 plot crossover of gap filled data
html 494beda jens-daniel-mueller 2022-01-03 Build site.
Rmd 47811bd jens-daniel-mueller 2022-01-03 plot crossover of gap filled data
html 51ec1fe jens-daniel-mueller 2021-12-23 Build site.
Rmd 468c324 jens-daniel-mueller 2021-12-23 added crossover cruise subsetting
html 28ed51f jens-daniel-mueller 2021-12-21 Build site.
Rmd f99a7ce jens-daniel-mueller 2021-12-21 print tables with flagging number
html fcff192 jens-daniel-mueller 2021-12-21 Build site.
Rmd e60be65 jens-daniel-mueller 2021-12-21 added flagging profiles
html a87f8c7 jens-daniel-mueller 2021-12-20 Build site.
Rmd 7511f8c jens-daniel-mueller 2021-12-20 revised IO analysis
html 2704ff6 jens-daniel-mueller 2021-12-20 Build site.
Rmd f4696af jens-daniel-mueller 2021-12-20 added cruise maps
html 7f65d3a jens-daniel-mueller 2021-12-20 Build site.
Rmd 208283d jens-daniel-mueller 2021-12-20 revised missing cruise crossover analysis
html 6106236 jens-daniel-mueller 2021-12-20 Build site.
Rmd 953ac0a jens-daniel-mueller 2021-12-20 revised missing cruise crossover analysis
html d5ef2c6 jens-daniel-mueller 2021-12-20 Build site.
Rmd 0b0800e jens-daniel-mueller 2021-12-20 restructured IO crossover analysis
html 00227e6 jens-daniel-mueller 2021-12-20 Build site.
Rmd 8728169 jens-daniel-mueller 2021-12-20 added IO crossover analysis
html e810585 jens-daniel-mueller 2021-12-16 Build site.
Rmd aca9273 jens-daniel-mueller 2021-12-16 added maps per expocode
html 6aa4b75 jens-daniel-mueller 2021-12-16 Build site.
Rmd 3511fa7 jens-daniel-mueller 2021-12-16 f == 9 analysis added
html 163f976 jens-daniel-mueller 2021-12-16 Build site.
Rmd 7fa3a99 jens-daniel-mueller 2021-12-16 added cumulative data contribution as threshold
html be0850d jens-daniel-mueller 2021-12-16 Build site.
Rmd 8db3760 jens-daniel-mueller 2021-12-16 plot maps of f and qc data loss
html 61d5f49 jens-daniel-mueller 2021-12-15 Build site.
Rmd be2f94e jens-daniel-mueller 2021-12-15 analyse IO 1990 CRM data from Millero 1998 - TA only
html d454df1 jens-daniel-mueller 2021-12-15 Build site.
Rmd 7802f47 jens-daniel-mueller 2021-12-15 analyse IO 1990 CRM data from Millero 1998
html ce6cdae jens-daniel-mueller 2021-12-15 Build site.
Rmd acff553 jens-daniel-mueller 2021-12-15 plot qc data loss by cruise size
html 7ace7ab jens-daniel-mueller 2021-12-15 Build site.
Rmd 554383a jens-daniel-mueller 2021-12-15 plot qc data loss by cruise size
html faa6b3c jens-daniel-mueller 2021-12-15 Build site.
Rmd be8751d jens-daniel-mueller 2021-12-15 started data loss assesment
html 70923f2 jens-daniel-mueller 2021-12-14 Build site.
Rmd 1acf7ff jens-daniel-mueller 2021-12-14 checked P18 nitrate data - quadratic fit
html b68b58e jens-daniel-mueller 2021-12-13 Build site.
Rmd 4c002c1 jens-daniel-mueller 2021-12-13 checked P18 nitrate data
html de20732 jens-daniel-mueller 2021-12-08 Build site.
Rmd badaed2 jens-daniel-mueller 2021-12-08 plotted f maps
html daa43b9 jens-daniel-mueller 2021-12-06 Build site.
Rmd b578bd9 jens-daniel-mueller 2021-12-06 plotted qc maps
html 2b22ffe jens-daniel-mueller 2021-11-24 Build site.
Rmd 1b7ec1f jens-daniel-mueller 2021-11-24 revised combined IO NS and EW analysis
html 0ef46e8 jens-daniel-mueller 2021-11-23 Build site.
Rmd 7fb15cf jens-daniel-mueller 2021-11-23 combined IO NS and EW analysis
html f2871b9 jens-daniel-mueller 2021-11-20 Build site.
Rmd 46c1246 jens-daniel-mueller 2021-11-19 rerun with GLODAP cast column
html 375d7c7 jens-daniel-mueller 2021-11-18 Build site.
Rmd 1839007 jens-daniel-mueller 2021-11-18 delta EW crossover values determined
html f30883c jens-daniel-mueller 2021-11-18 Build site.
Rmd 7acd48c jens-daniel-mueller 2021-11-18 delta crossover values determined
html 2e6c3f1 jens-daniel-mueller 2021-11-18 Build site.
Rmd 49ca05c jens-daniel-mueller 2021-11-18 delta crossover values determined
html 16dab59 jens-daniel-mueller 2021-11-18 Build site.
Rmd 620b6f4 jens-daniel-mueller 2021-11-18 delta crossover values determined
html 42965b9 jens-daniel-mueller 2021-11-18 Build site.
Rmd 69dbb5f jens-daniel-mueller 2021-11-18 crossing checks
html c9363ce jens-daniel-mueller 2021-11-18 Build site.
Rmd 6bc79d6 jens-daniel-mueller 2021-11-18 crossing checks
html 0908ee5 jens-daniel-mueller 2021-11-15 Build site.
html 6d6a23e jens-daniel-mueller 2021-11-01 Build site.
Rmd 2f36786 jens-daniel-mueller 2021-11-01 preprocess adjustment table, create new basinmaps
html 2a50fa9 jens-daniel-mueller 2021-10-28 Build site.
Rmd 67de9ab jens-daniel-mueller 2021-10-28 preprocess tracers
html a96bf9e jens-daniel-mueller 2021-10-27 Build site.
Rmd d99b131 jens-daniel-mueller 2021-10-27 added time series plots
html fde6c32 jens-daniel-mueller 2021-10-27 Build site.
Rmd db93d9f jens-daniel-mueller 2021-10-27 added time series plots
html 7db7e6a jens-daniel-mueller 2021-10-27 Build site.
Rmd d6fb0dc jens-daniel-mueller 2021-10-27 added time series plots
html 68d67e7 jens-daniel-mueller 2021-10-27 Build site.
Rmd b4ea199 jens-daniel-mueller 2021-10-27 added time series plots
html 7987bb7 jens-daniel-mueller 2021-10-21 Build site.
Rmd b64c54d jens-daniel-mueller 2021-10-21 added inventory layer depth
html 8d1aaf8 jens-daniel-mueller 2021-10-20 Build site.
Rmd 5bce752 jens-daniel-mueller 2021-10-20 corrected qc flag in glodap
html dc8d958 jens-daniel-mueller 2021-10-20 Build site.
Rmd b2ccc04 jens-daniel-mueller 2021-10-20 corrected qc flag in glodap
html 2438c5a jens-daniel-mueller 2021-08-30 Build site.
Rmd 4296433 jens-daniel-mueller 2021-08-30 rerun GLODAP preprocessing with officially released file
html e49875a jens-daniel-mueller 2021-07-07 Build site.
html 6312bd4 jens-daniel-mueller 2021-07-07 Build site.
Rmd 4905409 jens-daniel-mueller 2021-07-07 rerun with new setup_obs.Rmd file
html 58bc706 jens-daniel-mueller 2021-07-06 Build site.
Rmd 0db89e1 jens-daniel-mueller 2021-07-06 rerun with revised variable names
html f600971 jens-daniel-mueller 2021-07-02 Build site.
html 98599d8 jens-daniel-mueller 2021-06-27 Build site.
Rmd 4f9c370 jens-daniel-mueller 2021-06-27 update to latest GLODAP pre-release
html 265c4ef jens-daniel-mueller 2021-06-04 Build site.
html c79346a jens-daniel-mueller 2021-06-03 Build site.
html 9d8353f jens-daniel-mueller 2021-05-31 Build site.
Rmd b948168 jens-daniel-mueller 2021-05-31 ingest GLODAPv2_2021 beta data

path_glodapv2_2021  <- "/nfs/kryo/work/updata/glodapv2_2021/"
path_glodapv2_CRM  <- "/nfs/kryo/work/updata/glodapv2_CRM/"
path_crossover <- "/nfs/kryo/work/updata/glodapv2_crossover"

path_preprocessing  <- paste(path_root, "/observations/preprocessing/", sep = "")

1 Read files

1.1 Adjusted data

Main data source for this project is GLODAPv2.2021_Merged_Master_File.csv downloaded from https://www.ncei.noaa.gov/data/oceans/ncei/ocads/data/0237935/GLODAPv2.2021_Merged_Master_File.csv on Aug 30, 2021.

GLODAP <-
  read_csv(
    paste(
      path_glodapv2_2021,
      "GLODAPv2.2021_Merged_Master_File_20210830.csv",
      sep = ""
    ),
    na = "-9999",
    col_types = cols(.default = col_double())
  )


GLODAP <- GLODAP %>%
  rename_with(~str_remove(., 'G2'))

1.2 Adjustment table

GLODAP_adjustments <-
  read_csv(
    paste(
      path_glodapv2_2021,
      "GLODAPv2.2021_adjustments_last_updated_on_2021_05_10.csv",
      sep = ""
    ),
    na = c("-666", "-777", "-888", "-999"),
    skip = 2
  )

1.3 Expocodes

GLODAP_expocodes <-
  read_tsv(
    paste(
      path_glodapv2_2021,
      "EXPOCODES.txt",
      sep = ""
    ),
    col_names = c("cruise", "cruise_expocode")
  )

1.4 Crossover tables

# tables from glodapv2, provided by Steven van Heuven

glodapv2_xover_files <- fs::dir_ls(paste0(path_crossover, "/glodapv2"))

glodapv2_xover <- glodapv2_xover_files %>% 
  map_dfr(read_csv, .id = "parameter")

glodapv2_xover <- glodapv2_xover %>% 
  mutate(parameter = str_remove(parameter, ".csv"),
         parameter = str_sub(parameter, -3))


glodapv2_xover <- glodapv2_xover %>% 
  mutate(parameter = recode(parameter,
                            "ALK" = "talk",
                            "DIC" = "tco2",
                            "NO3" = "nitrate",
                            "_O2" = "oxygen",
                            "PO4" = "phosphate",
                            "SAL" = "salinity",
                            "SIL" = "silicate"))

# Note: In the files provided by Steven von Heuven
# the column names sigma_ratio and sigma_offset_sd were swapped

glodapv2_xover_absolute <- glodapv2_xover %>% 
  filter(parameter %in% c("salinity", "talk", "tco2")) %>% 
  select(parameter,
         offset = sigma_offset,
         offset_sd = sigma_ratio,
         cruise_A = CruiseA_EXPOCODE,
         cruise_B = CruiseB_EXPOCODE)

glodapv2_xover_ratio <- glodapv2_xover %>% 
  filter(!(parameter %in% c("salinity", "talk", "tco2"))) %>% 
  select(parameter,
         offset = sigma_offset_sd,
         offset_sd = sigma_ratio_sd,
         cruise_A = CruiseA_EXPOCODE,
         cruise_B = CruiseB_EXPOCODE)

glodapv2_xover <- bind_rows(
  glodapv2_xover_absolute,
  glodapv2_xover_ratio
)


rm(glodapv2_xover_files, glodapv2_2021_xover_files,
   glodapv2_xover_absolute, glodapv2_xover_ratio)

# tables created between glodapv2 and glodapv2.2021
# provided by Nico Lange

glodapv2_2021_xover_files <- fs::dir_ls(paste0(path_crossover, "/glodapv2_2021"))

glodapv2_2021_xover <- glodapv2_2021_xover_files %>% 
  map_dfr(readxl::read_excel)

glodapv2_2021_xover <- glodapv2_2021_xover %>%
  rename(parameter = Parameter) %>%
  mutate(parameter = recode(parameter,
                            "alkalinity" = "talk")) %>%
  filter(
    parameter %in%
      c(
        "tco2",
        "nitrate",
        "oxygen",
        "phosphate",
        "salinity",
        "silicate",
        "talk"
      )
  )


glodapv2_2021_xover <- glodapv2_2021_xover %>% 
  rename(offset = Offset,
         offset_sd = Std,
         cruise_A = Cruise_A,
         cruise_B = Cruise_B)


# tables for data not qc'ed in the regular GLODAP release
# provided by Nico Lange

glodapv2_2021_xover_files_add <-
  fs::dir_ls(paste0(path_crossover, "/glodapv2_2021_additional_crossover"))

glodapv2_2021_xover_add <- glodapv2_2021_xover_files_add %>% 
  map_dfr(readxl::read_excel)

glodapv2_2021_xover_add <- glodapv2_2021_xover_add %>%
  rename(parameter = Parameter) %>%
  mutate(parameter = recode(parameter,
                            "alkalinity" = "talk"))


glodapv2_2021_xover_add <- glodapv2_2021_xover_add %>% 
  rename(offset = Offset,
         offset_sd = Std,
         cruise_A = Cruise_A,
         cruise_B = Cruise_B)

1.5 Missing/flagged cruises

GLODAP_cruises_missing <-
  read_csv(
    paste(
      path_glodapv2_2021,
      "GLODAPv2.2021_major_cruises_missing_flagged.csv",
      sep = ""
    )
  )

1.6 IO CRM data

IO_CRM_meas <-
  read_csv(
    paste(
      path_glodapv2_CRM,
      "/Millero_1998_Tab2.csv",
      sep = ""
    )
  )

CRM_ref <-
  read_csv(
    paste(
      path_glodapv2_CRM,
      "/Dickson_CRM_reference_values_20211215.csv",
      sep = ""
    )
  )

2 Data preparation

2.1 Correct qc flag

From an email conversation with Nico Lange

Yes, we are aware of these faulty(!) calculated TA data (using DIC and fCO2). It is linked to v2.2020 where we’ve added fCO2 to the “missing carbon calculation matrix”. Overall, including fCO2 in these calculations has worked great to fill some missing carbon gaps. However, for this cruise in particular the fCO2 values have most likely been converted wrongly to 20°C and are thus off! The problem of this all is that we haven’t really done a 2nd QC on the fCO2 values neither have we defined the corresponding “G2fCO2qc” variable, hence for the sake of consistency we kept all fCO2 values in. Again and unfortunately, in this particular case it led to the bad calculations of TA data…. We plan to do a full 2nd QC on all (!) fCO2 data for v3.

But you have indeed found a flaw in our merging script, as the corresponding calculated TA values should not have received a 2nd QC flag of 1! I missed out on adding a line to our merging script to accommodate for the non-existence of 2nd fCO2 flags in the carbon calculation matrix.

So long story short: Thank you very much for finding this flaw and letting me know of it!

and

Yes, the all calculated TA data from cruise 695 should have a talkqc of 0 (as they are based upon un QC’d fCO2 data…).

And no (thanks to your hint and questions), I figured that this wrongly assigned 2nd QC flag is a problem for all calculated carbon data, which used fCO2 for the calculations. However, luckily this is not really often the case.

You can check if thats the case by looking at which other carbon parameters are measured, i.e. by checking their primary flags (e.g. G2talkf, G2tco2f and G2phts25p0f and G2fco2f). If only two are measured and one of them is fCO2, it means that the other carbon parameters (the ones with a primary flag of 0) are calculated using fCO2. Hence, for these instances no 2nd QC is done and the corresponding qc flag should be 0 and not 1.

GLODAP_qc_check <- GLODAP %>% 
  filter(cruise == 717) %>% 
  count(talkqc)
# calculate number of measured co2 system variables

GLODAP <- GLODAP %>%
  mutate(measured_CO2_vars = rowSums(select(., c(
    tco2f, talkf, fco2f, phts25p0f
  )) == 2))

# identify cruises on which talk/tco2 was calculated

talk_qc_error_cruises <- GLODAP %>%
  select(cruise, tco2:phtsqc, measured_CO2_vars) %>% 
  filter(measured_CO2_vars == 2,
         fco2f == 2,
         talkf == 0) %>% 
  distinct(cruise, talkf, talkqc, fco2f)

tco2_qc_error_cruises <- GLODAP %>%
  select(cruise, tco2:phtsqc, measured_CO2_vars) %>% 
  filter(measured_CO2_vars == 2,
         fco2f == 2,
         tco2f == 0) %>% 
  distinct(cruise, tco2f, tco2qc, fco2f)

talk_qc_error_cruises %>% 
  write_csv("data/talk_qc_error_cruises_GLODAPv2_2021.csv")

tco2_qc_error_cruises %>% 
  write_csv("data/tco2_qc_error_cruises_GLODAPv2_2021.csv")

rm(talk_qc_error_cruises, tco2_qc_error_cruises)


# set qc = 0 for tco2 and talk values calculated from fco2   

GLODAP <- GLODAP %>%
  mutate(tco2qc = if_else(measured_CO2_vars == 2 &
                            fco2f == 2 & tco2f == 0,
                          0,
                          tco2qc))

GLODAP <- GLODAP %>%
  mutate(talkqc = if_else(measured_CO2_vars == 2 &
                            fco2f == 2 & talkf == 0,
                          0,
                          talkqc))

GLODAP <- GLODAP %>% 
  select(-measured_CO2_vars)
# calculate number of measured co2 system variables

GLODAP <- GLODAP %>%
  mutate(measured_CO2_vars = rowSums(select(., c(
    tco2f, talkf, fco2f, phts25p0f
  )) == 2))

# identify cruises on which talk/tco2 was calculated

tco2_talk_calc <- GLODAP %>%
  select(cruise, tco2:phtsqc, measured_CO2_vars) %>% 
  filter(measured_CO2_vars == 2,
         fco2f == 2,
         phts25p0f == 2)

GLODAP <- GLODAP %>% 
  select(-measured_CO2_vars)

2.2 Harmonize nomenclature

# create date column
GLODAP <- GLODAP %>%
  mutate(date = ymd(paste(year, month, day))) %>%
  relocate(date)

# harmonize column names
GLODAP <- GLODAP  %>%
  rename(sal = salinity,
         temp = temperature)

# harmonize coordinates
GLODAP <- GLODAP  %>%
  rename(lon = longitude,
         lat = latitude) %>%
  mutate(lon = if_else(lon < 20, lon + 360, lon))

2.3 Horizontal gridding

For merging with other data sets, all observations were grouped into latitude intervals of:

  • 1° x 1°
GLODAP <- m_grid_horizontal(GLODAP)

2.4 Apply basin mask

# use only three basin to assign general basin mask
# ie this is not specific to the MLR fitting
basinmask_5 <- basinmask %>% 
  filter(MLR_basins == "5") %>% 
  select(lat, lon, basin)

basinmask <- basinmask %>% 
  filter(MLR_basins == "2") %>% 
  select(lat, lon, basin_AIP)

GLODAP <- inner_join(GLODAP, basinmask)

2.5 Add row number

GLODAP <- GLODAP  %>%  
  mutate(row_number = row_number()) %>% 
  relocate(row_number)

2.6 Split CO2 and tracers

# remove irrelevant columns
GLODAP <- GLODAP %>%
  select(-c(region,
            month:minute,
            maxsampdepth, sigma0:sigma4,
            nitrite:nitritef))


GLODAP_tracer <- GLODAP %>% 
  select(row_number:gamma,
         cfc11:sf6f,
         basin_AIP)

# select relevant columns
GLODAP <- GLODAP %>%
  select(row_number:talkqc,
         basin_AIP)

2.7 Subset measured data

2.7.1 tco2

The vast majority of rows is removed due to missing tco2 observations.

GLODAP <- GLODAP %>% 
  filter(!is.na(tco2))

2.7.2 tracer

Rows are removed if no tracer observation is available.

GLODAP_tracer <- GLODAP_tracer %>%
  filter(if_any(
    c(
      cfc11,
      cfc12,
      cfc113,
      ccl4,
      sf6,
      pcfc11,
      pcfc12,
      pcfc113,
      pccl4,
      psf6
    ),
    ~ !is.na(.)
  ))

2.8 Create clean observations grid

2.8.1 tco2

GLODAP_obs_grid <- GLODAP %>% 
  count(lat, lon)
GLODAP_grid_year <- GLODAP %>%
  count(lat, lon, year)

map +
  geom_raster(data = GLODAP_grid_year,
              aes(lon, lat)) +
  facet_wrap(~ year, ncol=3)

Version Author Date
dc8d958 jens-daniel-mueller 2021-10-20

2.8.2 tracer

GLODAP_obs_grid_tracer <- GLODAP_tracer %>% 
  count(lat, lon)
GLODAP_grid_year_tracer <- GLODAP_tracer %>%
  count(lat, lon, year)

map +
  geom_raster(data = GLODAP_grid_year_tracer,
              aes(lon, lat)) +
  facet_wrap(~ year, ncol=3)

Version Author Date
2a50fa9 jens-daniel-mueller 2021-10-28

3 Flagging

3.1 qc

qc_flag <- full_join(
  GLODAP,
  GLODAP_expocodes
)

qc_flag <- qc_flag %>%
  mutate(decade = cut(
    year,
    seq(1990, 2020, 10),
    right = FALSE,
    labels = c("1990-1999", "2000-2009", "2010-2019")
  ),
  .after = year) %>%
  filter(!is.na(decade)) %>% 
  select(lon, lat, basin_AIP, decade, cruise_expocode, ends_with("qc")) %>%
  pivot_longer(ends_with("qc"),
               names_to = "parameter",
               values_to = "value")

qc_flag_grid <- qc_flag %>%
  count(lon, lat, decade, parameter, value)

p_qc_flag_map <- qc_flag_grid %>% 
  group_split(value) %>%
  # head(1) %>% 
  map(
    ~map +
  geom_tile(data = .x,
            aes(lon, lat, fill=n)) +
  facet_grid(parameter ~ decade) +
  labs(title = paste("qc flag =", unique(.x$value))) +
    scale_fill_viridis_c(option = "magma",
                         direction = -1,
                         trans = "log10")
  )

p_qc_flag_map
[[1]]

Version Author Date
daa43b9 jens-daniel-mueller 2021-12-06

[[2]]

Version Author Date
daa43b9 jens-daniel-mueller 2021-12-06
pdf("output/qc_flag_coverage_maps.pdf")
p_qc_flag_map
[[1]]

[[2]]
dev.off()
png 
  2 
qc_flag %>% 
  filter(basin_AIP == "Pacific",
         decade == "1990-1999") %>% 
  count(cruise_expocode, parameter, value) %>% 
  arrange(value, -n) %>% 
  write_csv("output/Pacific_1990_qc_by_cruise_and_parameter.csv")

rm(qc_flag, qc_flag_grid, p_qc_flag_map)

3.2 f

f_flag <- full_join(
  GLODAP,
  GLODAP_expocodes
)

f_flag <- f_flag %>%
  mutate(decade = cut(
    year,
    seq(1990, 2020, 10),
    right = FALSE,
    labels = c("1990-1999", "2000-2009", "2010-2019")
  ),
  .after = year) %>%
  filter(!is.na(decade)) %>% 
  select(lon, lat, basin_AIP, decade, cruise_expocode, ends_with("f")) %>%
  pivot_longer(ends_with("f"),
               names_to = "parameter",
               values_to = "value")

f_flag_grid <- f_flag %>%
  count(lon, lat, decade, parameter, value)

p_f_flag_map <- f_flag_grid %>% 
  group_split(value) %>%
  # head(1) %>% 
  map(
    ~map +
  geom_tile(data = .x,
            aes(lon, lat, fill=n)) +
  facet_grid(parameter ~ decade) +
  labs(title = paste("f flag =", unique(.x$value))) +
    scale_fill_viridis_c(option = "magma",
                         direction = -1,
                         trans = "log10")
  )

p_f_flag_map
[[1]]

Version Author Date
de20732 jens-daniel-mueller 2021-12-08

[[2]]

Version Author Date
de20732 jens-daniel-mueller 2021-12-08

[[3]]

Version Author Date
de20732 jens-daniel-mueller 2021-12-08
pdf("output/f_flag_coverage_maps.pdf")
p_f_flag_map
[[1]]

[[2]]

[[3]]
dev.off()
png 
  2 
f_flag %>% 
  filter(basin_AIP == "Pacific",
         decade == "1990-1999") %>% 
  count(cruise_expocode, parameter, value) %>% 
  arrange(value, -n) %>% 
  write_csv("output/Pacific_1990_f_by_cruise_and_parameter.csv")

rm(f_flag, f_flag_grid, p_f_flag_map)

4 Data loss

loss_all <- full_join(
  GLODAP,
  GLODAP_expocodes
)

loss_all <- loss_all %>%
  mutate(decade = cut(
    year,
    seq(1989, 2019, 10),
    right = FALSE,
    labels = c("1989-1999", "2000-2009", "2010-2019")
  ),
  .after = year) %>%
  filter(!is.na(decade))

map +
  geom_tile(data = loss_all %>% distinct(lon, lat, decade),
            aes(lon, lat)) +
  facet_grid(decade ~ .)

Version Author Date
e810585 jens-daniel-mueller 2021-12-16
loss <- loss_all %>% 
  filter(if_all(ends_with("f"), ~ . != 9))

loss_all_n <- loss_all %>% 
  count(basin_AIP, decade)

loss_n <- loss %>% 
  count(basin_AIP, decade)

4.1 qc

loss_qc <- loss %>% 
  select(lon, lat, basin_AIP, decade, cruise_expocode, ends_with("qc")) %>%
  pivot_longer(ends_with("qc"),
               names_to = "parameter",
               values_to = "value") %>% 
  mutate(parameter = str_remove(parameter, "qc"))

loss_qc <- loss_qc %>%
  count(cruise_expocode, basin_AIP, decade, parameter, value) %>%
  pivot_wider(
    names_from = value,
    names_prefix = "qc_",
    values_from = n,
    values_fill = 0
  ) %>%
  mutate(n_cruise = qc_0 + qc_1,
         category = if_else(qc_0 <= 0.1 * (n_cruise), "OK", "loss"))

loss_qc_cruise <- loss_qc %>%
  mutate(parameter_class = if_else(
    parameter %in% c("tco2", "talk", "phosphate"),
    "target",
    "predictor"
  )) %>%
  count(cruise_expocode,
        basin_AIP,
        decade,
        n_cruise,
        parameter_class,
        category) %>% 
  pivot_wider(names_from = category,
              values_from = n,
              values_fill = 0) %>% 
  select(-OK) %>% 
  pivot_wider(names_from = parameter_class,
              values_from = loss) %>% 
  group_by(basin_AIP, decade) %>%
  mutate(rank_n_cruise = rank(-n_cruise)) %>%
  ungroup()

loss_qc_cruise <- full_join(loss_qc_cruise, loss_n)

loss_qc_cruise <- loss_qc_cruise %>% 
  mutate(n_cruise_rel = 100 * n_cruise / n) %>% 
  arrange(basin_AIP, decade, -n_cruise_rel) %>% 
  group_by(basin_AIP, decade) %>% 
  mutate(n_cruise_rel_cum = cumsum(n_cruise_rel)) %>% 
  ungroup() %>% 
  select(-n)

loss_qc_cruise <- loss_qc_cruise %>% 
  pivot_longer(predictor:target,
               names_to = "parameter_class",
               values_to = "loss") %>% 
  mutate(loss = as.factor(loss))

grey_plasma <- c("grey80", viridisLite::plasma(4))

loss_qc_cruise <- loss_qc_cruise %>%
  filter(n_cruise_rel >= 3)

loss_qc_cruise %>%
  group_split(basin_AIP) %>%
  # head(3) %>%
  map(
    ~ ggplot(data = .x,
             aes(rank_n_cruise, n_cruise_rel, fill = loss)) +
      geom_point(shape = 21, size = 2) +
      scale_fill_manual(values = grey_plasma,
                        name = "variables missing") +
      facet_grid(decade ~ parameter_class) +
      labs(title = paste("basin_AIP:", unique(.x$basin_AIP))) +
      ylim(0, NA)
  )
[[1]]

Version Author Date
6aa4b75 jens-daniel-mueller 2021-12-16
163f976 jens-daniel-mueller 2021-12-16
be0850d jens-daniel-mueller 2021-12-16
ce6cdae jens-daniel-mueller 2021-12-15

[[2]]

Version Author Date
6aa4b75 jens-daniel-mueller 2021-12-16
163f976 jens-daniel-mueller 2021-12-16
be0850d jens-daniel-mueller 2021-12-16
ce6cdae jens-daniel-mueller 2021-12-15

[[3]]

Version Author Date
6aa4b75 jens-daniel-mueller 2021-12-16
163f976 jens-daniel-mueller 2021-12-16
be0850d jens-daniel-mueller 2021-12-16
ce6cdae jens-daniel-mueller 2021-12-15
loss_qc_cruise %>% 
  filter(loss != 0) %>% 
  select(basin_AIP, decade, parameter_class, rank_n_cruise, cruise_expocode) %>% 
  arrange(basin_AIP, decade, parameter_class, rank_n_cruise) %>% 
  kable() %>% 
  kable_styling() %>% 
  scroll_box(height = "300px")
basin_AIP decade parameter_class rank_n_cruise cruise_expocode
Atlantic 1989-1999 target 11 06MT19900123
Atlantic 1989-1999 target 12 33LK19960415
Atlantic 1989-1999 target 13 33MW19930704
Atlantic 2000-2009 predictor 7 35TH20010823
Atlantic 2000-2009 predictor 13 33RO20070710
Atlantic 2000-2009 target 7 35TH20010823
Atlantic 2000-2009 target 8 74DI20040404
Atlantic 2000-2009 target 9 35TH20080610
Atlantic 2000-2009 target 11 35TH20040604
Atlantic 2000-2009 target 12 35TH20020611
Atlantic 2010-2019 predictor 5 74EQ20151206
Indian 1989-1999 target 11 320619960503
Pacific 1989-1999 predictor 2 31DS19940126
Pacific 1989-1999 predictor 4 31DS19920907
Pacific 1989-1999 target 4 31DS19920907
Pacific 1989-1999 target 6 316N19930222
Pacific 1989-1999 target 7 316N19921006
Pacific 1989-1999 target 8 90KD19920214
Pacific 1989-1999 target 11 316N19921204
loss_grid <- loss %>% distinct(lon, lat, cruise_expocode)

loss_qc_grid <- left_join(loss_qc_cruise,
                          loss_grid)

map +
  geom_tile(data = loss_qc_grid,
            aes(lon, lat, fill = loss)) +
  facet_grid(decade ~ parameter_class) +
  scale_fill_manual(values = grey_plasma)

Version Author Date
6aa4b75 jens-daniel-mueller 2021-12-16
163f976 jens-daniel-mueller 2021-12-16
be0850d jens-daniel-mueller 2021-12-16
loss_qc_grid %>% filter(loss != 0) %>%
  group_split(parameter_class, decade) %>%
  # head(1) %>%
  map(
    ~ map +
      geom_tile(data = .x,
                aes(lon, lat, fill = cruise_expocode)) +
      scale_fill_brewer(palette = "Paired") +
      facet_grid(decade ~ parameter_class)
  )
[[1]]

Version Author Date
e810585 jens-daniel-mueller 2021-12-16

[[2]]

Version Author Date
e810585 jens-daniel-mueller 2021-12-16

[[3]]

Version Author Date
e810585 jens-daniel-mueller 2021-12-16

[[4]]

Version Author Date
e810585 jens-daniel-mueller 2021-12-16

[[5]]

Version Author Date
e810585 jens-daniel-mueller 2021-12-16

4.2 f

loss_f <- loss %>% 
  select(lon, lat, basin_AIP, decade, cruise_expocode, ends_with("f")) %>%
  pivot_longer(ends_with("f"),
               names_to = "parameter",
               values_to = "value") %>% 
  mutate(parameter = str_remove(parameter, "f"))

loss_f <- loss_f %>%
  count(cruise_expocode, basin_AIP, decade, parameter, value) %>%
  pivot_wider(
    names_from = value,
    names_prefix = "f_",
    values_from = n,
    values_fill = 0
  ) %>%
  mutate(n_cruise = f_0 + f_2,
         category = if_else(f_0 <= 0.1 * (n_cruise), "OK", "loss"))

loss_f_cruise <- loss_f %>%
  mutate(parameter_class = if_else(
    parameter %in% c("tco2", "talk", "phosphate"),
    "target",
    "predictor"
  )) %>%
  count(cruise_expocode,
        basin_AIP,
        decade,
        n_cruise,
        parameter_class,
        category) %>% 
  pivot_wider(names_from = category,
              values_from = n,
              values_fill = 0) %>% 
  select(-OK) %>% 
  pivot_wider(names_from = parameter_class,
              values_from = loss) %>% 
  group_by(basin_AIP, decade) %>%
  mutate(rank_n_cruise = rank(-n_cruise)) %>%
  ungroup()

loss_f_cruise <- full_join(loss_f_cruise, loss_n)

loss_f_cruise <- loss_f_cruise %>% 
  mutate(n_cruise_rel = 100 * n_cruise / n) %>% 
  arrange(basin_AIP, decade, -n_cruise_rel) %>% 
  group_by(basin_AIP, decade) %>% 
  mutate(n_cruise_rel_cum = cumsum(n_cruise_rel)) %>% 
  ungroup() %>% 
  select(-n)

loss_f_cruise <- loss_f_cruise %>% 
  pivot_longer(predictor:target,
               names_to = "parameter_class",
               values_to = "loss") %>% 
  mutate(loss = as.factor(loss))

grey_plasma <- c("grey80", viridisLite::plasma(4))

loss_f_cruise <- loss_f_cruise %>%
    filter(n_cruise_rel >= 3)

loss_f_cruise %>%
  # filter(n_cruise_rel_cum <= 90) %>%
  group_split(basin_AIP) %>%
  # head(1) %>%
  map(
    ~ ggplot(data = .x,
             aes(rank_n_cruise, n_cruise, fill = loss)) +
      geom_point(shape = 21, size = 2) +
      scale_fill_manual(values = grey_plasma,
                        name = "variables missing") +
      facet_grid(decade ~ parameter_class) +
      labs(title = paste("basin_AIP:", unique(.x$basin_AIP))) +
      ylim(0, NA)
  )
[[1]]

Version Author Date
6aa4b75 jens-daniel-mueller 2021-12-16
163f976 jens-daniel-mueller 2021-12-16
ce6cdae jens-daniel-mueller 2021-12-15

[[2]]

Version Author Date
6aa4b75 jens-daniel-mueller 2021-12-16
163f976 jens-daniel-mueller 2021-12-16
ce6cdae jens-daniel-mueller 2021-12-15

[[3]]

Version Author Date
6aa4b75 jens-daniel-mueller 2021-12-16
163f976 jens-daniel-mueller 2021-12-16
ce6cdae jens-daniel-mueller 2021-12-15
loss_f_cruise %>% 
  filter(loss != 0) %>% 
  select(basin_AIP, decade, parameter_class, rank_n_cruise, cruise_expocode) %>% 
  arrange(basin_AIP, decade, parameter_class, rank_n_cruise) %>% 
  kable() %>% 
  kable_styling() %>% 
  scroll_box(height = "300px")
basin_AIP decade parameter_class rank_n_cruise cruise_expocode
Atlantic 1989-1999 target 1 323019940104
Atlantic 1989-1999 target 7 33RO19980123
Atlantic 1989-1999 target 9 35A319950113
Atlantic 1989-1999 target 11 06MT19900123
Atlantic 1989-1999 target 12 33LK19960415
Atlantic 1989-1999 target 13 33MW19930704
Atlantic 2000-2009 target 7 35TH20010823
Atlantic 2000-2009 target 8 74DI20040404
Atlantic 2000-2009 target 9 35TH20080610
Atlantic 2000-2009 target 11 35TH20040604
Atlantic 2000-2009 target 12 35TH20020611
Atlantic 2010-2019 target 10 33RO20110926
Indian 1989-1999 target 11 320619960503
Indian 2000-2009 target 2 33RR20080204
Pacific 1989-1999 target 3 31DS19960105
Pacific 1989-1999 target 6 316N19930222
Pacific 1989-1999 target 7 316N19921006
Pacific 1989-1999 target 8 90KD19920214
Pacific 1989-1999 target 11 316N19921204
Pacific 2000-2009 target 1 33RO20071215
Pacific 2010-2019 target 1 318M20091121
Pacific 2010-2019 target 5 320620170703
loss_grid <- loss %>% distinct(lon, lat, cruise_expocode)

loss_f_grid <- left_join(loss_f_cruise,
                          loss_grid)
map +
  geom_tile(data = loss_f_grid,
            aes(lon, lat, fill = loss)) +
  facet_grid(decade ~ parameter_class) +
  scale_fill_manual(values = grey_plasma)

Version Author Date
6aa4b75 jens-daniel-mueller 2021-12-16
163f976 jens-daniel-mueller 2021-12-16
be0850d jens-daniel-mueller 2021-12-16
loss_f_grid %>% filter(loss != 0) %>%
  group_split(parameter_class, decade) %>%
  # head(1) %>%
  map(
    ~ map +
      geom_tile(data = .x,
                aes(lon, lat, fill = cruise_expocode)) +
      scale_fill_brewer(palette = "Paired") +
      facet_grid(decade ~ parameter_class)
  )
[[1]]

Version Author Date
e810585 jens-daniel-mueller 2021-12-16

[[2]]

Version Author Date
e810585 jens-daniel-mueller 2021-12-16

[[3]]

Version Author Date
e810585 jens-daniel-mueller 2021-12-16

4.3 f == 9

loss_f9 <- loss_all %>% 
  select(lon, lat, basin_AIP, decade, cruise_expocode, ends_with("f")) %>%
  pivot_longer(ends_with("f"),
               names_to = "parameter",
               values_to = "value") %>% 
  mutate(parameter = str_remove(parameter, "f"))

loss_f9 <- loss_f9 %>%
  count(cruise_expocode, basin_AIP, decade, parameter, value) %>%
  pivot_wider(
    names_from = value,
    names_prefix = "f_",
    values_from = n,
    values_fill = 0
  ) %>%
  mutate(n_cruise = f_0 + f_2 + f_9,
         category = if_else(f_9 <= 0.1 * (n_cruise), "OK", "loss"))

loss_f9_cruise <- loss_f9 %>%
  mutate(parameter_class = if_else(
    parameter %in% c("tco2", "talk", "phosphate"),
    "target",
    "predictor"
  )) %>%
  count(cruise_expocode,
        basin_AIP,
        decade,
        n_cruise,
        parameter_class,
        category) %>% 
  pivot_wider(names_from = category,
              values_from = n,
              values_fill = 0) %>% 
  select(-OK) %>% 
  pivot_wider(names_from = parameter_class,
              values_from = loss) %>% 
  group_by(basin_AIP, decade) %>%
  mutate(rank_n_cruise = rank(-n_cruise)) %>%
  ungroup()

loss_f9_cruise <- full_join(loss_f9_cruise, loss_all_n)

loss_f9_cruise <- loss_f9_cruise %>% 
  mutate(n_cruise_rel = 100 * n_cruise / n) %>% 
  arrange(basin_AIP, decade, -n_cruise_rel) %>% 
  group_by(basin_AIP, decade) %>% 
  mutate(n_cruise_rel_cum = cumsum(n_cruise_rel)) %>% 
  ungroup() %>% 
  select(-n)

loss_f9_cruise <- loss_f9_cruise %>% 
  pivot_longer(predictor:target,
               names_to = "parameter_class",
               values_to = "loss") %>% 
  mutate(loss = as.factor(loss))

grey_plasma <- c("grey80", viridisLite::plasma(4))

loss_f9_cruise <- loss_f9_cruise %>%
    filter(n_cruise_rel >= 3)

loss_f9_cruise %>%
  group_split(basin_AIP) %>%
  # head(1) %>%
  map(
    ~ ggplot(data = .x,
             aes(rank_n_cruise, n_cruise, fill = loss)) +
      geom_point(shape = 21, size = 2) +
      scale_fill_manual(values = grey_plasma,
                        name = "variables missing") +
      facet_grid(decade ~ parameter_class) +
      labs(title = paste("basin_AIP:", unique(.x$basin_AIP))) +
      ylim(0, NA)
  )
[[1]]

Version Author Date
6aa4b75 jens-daniel-mueller 2021-12-16

[[2]]

Version Author Date
6aa4b75 jens-daniel-mueller 2021-12-16

[[3]]

Version Author Date
6aa4b75 jens-daniel-mueller 2021-12-16
loss_f9_cruise %>% 
  filter(loss != 0) %>% 
  select(basin_AIP, decade, parameter_class, rank_n_cruise, cruise_expocode) %>% 
  arrange(basin_AIP, decade, parameter_class, rank_n_cruise) %>% 
  kable() %>% 
  kable_styling() %>% 
  scroll_box(height = "300px")
basin_AIP decade parameter_class rank_n_cruise cruise_expocode
Atlantic 1989-1999 predictor 2 316N19871123
Atlantic 1989-1999 predictor 4 06AQ19980328
Atlantic 1989-1999 predictor 6 74DI19970807
Atlantic 1989-1999 target 2 316N19871123
Atlantic 1989-1999 target 3 33RO19980123
Atlantic 1989-1999 target 4 06AQ19980328
Atlantic 1989-1999 target 6 74DI19970807
Atlantic 1989-1999 target 7 33MW19930704
Atlantic 2000-2009 target 1 33RO20050111
Atlantic 2000-2009 target 2 33RO20030604
Atlantic 2000-2009 target 3 06AQ20050122
Atlantic 2000-2009 target 4 06AQ20080210
Atlantic 2000-2009 target 5 35TH19990712
Atlantic 2010-2019 predictor 10 06M220170104
Atlantic 2010-2019 predictor 11 06AQ20120107
Atlantic 2010-2019 target 3 33RO20110926
Atlantic 2010-2019 target 6 29HE20130320
Atlantic 2010-2019 target 10 06M220170104
Indian 1989-1999 predictor 1 316N19951202
Indian 1989-1999 predictor 3 316N19950310
Indian 1989-1999 predictor 7 35MF19960220
Indian 1989-1999 target 1 316N19951202
Indian 1989-1999 target 5 316N19941201
Indian 1989-1999 target 8 320619960503
Indian 1989-1999 target 10 316N19950611
Indian 1989-1999 target 12 35MF19930123
Indian 2000-2009 predictor 9 09AR20071216
Indian 2000-2009 target 6 09AR20060102
Indian 2010-2019 predictor 7 09AR20141205
Indian 2010-2019 target 7 09AR20141205
Pacific 1989-1999 predictor 6 33MW19920224
Pacific 1989-1999 target 1 316N19920502
Pacific 1989-1999 target 6 33MW19920224
Pacific 1989-1999 target 8 316N19921006
Pacific 2000-2009 predictor 6 325020060213
loss_all_grid <- loss_all %>% distinct(lon, lat, cruise_expocode)

loss_f9_grid <- left_join(loss_f9_cruise,
                          loss_all_grid)
map +
  geom_tile(data = loss_f9_grid,
            aes(lon, lat, fill = loss)) +
  facet_grid(decade ~ parameter_class) +
  scale_fill_manual(values = grey_plasma)

Version Author Date
6aa4b75 jens-daniel-mueller 2021-12-16
loss_f9_grid %>% filter(loss != 0) %>%
  group_split(parameter_class, decade) %>%
  # head(1) %>%
  map(
    ~ map +
      geom_tile(data = .x,
                aes(lon, lat, fill = cruise_expocode)) +
      scale_fill_brewer(palette = "Paired") +
      facet_grid(decade ~ parameter_class)
  )
[[1]]

Version Author Date
e810585 jens-daniel-mueller 2021-12-16

[[2]]

Version Author Date
e810585 jens-daniel-mueller 2021-12-16

[[3]]

Version Author Date
e810585 jens-daniel-mueller 2021-12-16

[[4]]

Version Author Date
e810585 jens-daniel-mueller 2021-12-16

[[5]]

Version Author Date
e810585 jens-daniel-mueller 2021-12-16

[[6]]

Version Author Date
e810585 jens-daniel-mueller 2021-12-16

4.4 Overview

expocodes_missing <- GLODAP_cruises_missing %>%
  distinct(cruise_expocode) %>%
  pull()

missing_cruise_grid <- loss_all %>%
  filter(cruise_expocode %in% expocodes_missing) %>% 
  distinct(cruise_expocode, decade, lon, lat)

missing_cruise_grid %>%
  group_split(decade) %>%
  # head(1) %>%
  map(
    ~ map +
      geom_tile(data = .x,
                aes(lon, lat, fill = str_sub(
                  cruise_expocode, 1, 4
                ))) +
      facet_grid(decade ~ .) +
      scale_fill_brewer(palette = "Paired",
                        name = "RV")
  )
[[1]]

Version Author Date
00227e6 jens-daniel-mueller 2021-12-20

[[2]]

Version Author Date
00227e6 jens-daniel-mueller 2021-12-20

[[3]]

Version Author Date
00227e6 jens-daniel-mueller 2021-12-20

4.5 P18 phosphate

P18 <- full_join(
  GLODAP,
  GLODAP_expocodes
)

P18 <- P18 %>% 
  filter(cruise_expocode %in% c("33RO20161119",
                                "33RO20071215",
                                "31DS19940126"))

P18 %>% 
  ggplot(aes(date, lat)) +
  geom_point() +
  facet_grid() +
  facet_wrap(cruise_expocode ~., scales = "free_x", ncol = 1)

Version Author Date
70923f2 jens-daniel-mueller 2021-12-14
b68b58e jens-daniel-mueller 2021-12-13
P18 %>% 
  filter(!is.na(nitrate)) %>% 
  ggplot(aes(lat, depth, col= nitrate)) +
  geom_point() +
  scale_color_viridis_c() +
  scale_y_reverse() +
  facet_grid(cruise_expocode ~.)

Version Author Date
70923f2 jens-daniel-mueller 2021-12-14
b68b58e jens-daniel-mueller 2021-12-13
P18_grid <- P18 %>% 
  select(lat, lon, depth, cruise_expocode, nitrate) %>% 
  mutate(depth = as.numeric(as.character(cut(depth,
                     seq(0,1e4, 500), 
                     seq(250,1e4,500))))) %>% 
  group_by(lat, depth, cruise_expocode) %>% 
  summarise(nitrate = mean(nitrate, na.rm=TRUE)) %>% 
  ungroup()

P18_grid %>% 
  ggplot(aes(lat, depth, col= nitrate)) +
  geom_point() +
  scale_color_viridis_c() +
  scale_y_reverse() +
  facet_grid(cruise_expocode ~.)

Version Author Date
70923f2 jens-daniel-mueller 2021-12-14
b68b58e jens-daniel-mueller 2021-12-13
P18_grid_offset <- P18_grid %>% 
  pivot_wider(names_from = cruise_expocode,
              values_from = nitrate) %>% 
  mutate(delta_nitrate_1994_2007 = (`31DS19940126` - `33RO20071215`) / `33RO20071215`,
         delta_nitrate_1994_2016 = (`31DS19940126` - `33RO20161119`) / `33RO20071215`,
         delta_nitrate_2007_2016 = (`33RO20071215` - `33RO20161119`) / `33RO20071215`) %>% 
  select(lat, depth, starts_with("delta")) %>% 
  pivot_longer(starts_with("delta"),
               values_to = "delta_nitrate",
               names_to = "years",
               names_prefix = "delta_nitrate_") %>% 
  filter(delta_nitrate > -20,
         depth > 1500)

P18_grid_offset %>% 
  ggplot(aes(lat, depth, col= delta_nitrate)) +
  geom_point() +
  scale_color_divergent() +
  scale_y_reverse() +
  facet_grid(years ~.)

Version Author Date
70923f2 jens-daniel-mueller 2021-12-14
P18_grid_offset %>%
  group_by(lat, years) %>%
  summarise(delta_nitrate = mean(delta_nitrate, na.rm = TRUE)) %>%
  ungroup() %>%
  ggplot(aes(lat, delta_nitrate, col = years, fill = years)) +
  geom_hline(yintercept = 0) +
  stat_smooth(method = "lm", formula = y ~ x + I(x ^ 2)) +
  geom_point() +
  geom_line()

Version Author Date
70923f2 jens-daniel-mueller 2021-12-14
rm(P18, P18_grid)

4.6 A16

A16 <- full_join(
  GLODAP,
  GLODAP_expocodes
)

A16 <- A16 %>% 
  filter(cruise_expocode %in% c(
    "33MW19930704" #A16N-1993
    ))

map + 
  geom_tile(data = A16 %>% distinct(lon, lat),
            aes(lon, lat))

Version Author Date
70923f2 jens-daniel-mueller 2021-12-14
A16 %>% 
  select(ends_with(c("qc"))) %>% 
  pivot_longer(everything(),
               names_to = "flag",
               values_to = "value") %>% 
  distinct(flag, value)
# A tibble: 9 × 2
  flag        value
  <chr>       <dbl>
1 salinityqc      1
2 oxygenqc        1
3 nitrateqc       1
4 silicateqc      1
5 phosphateqc     1
6 tco2qc          1
7 talkqc          1
8 talkqc          0
9 tco2qc          0
rm(A16)

5 Adjustments

Typically, the reasons for multiple expocode entries of the same cruise in the adjustment table list are:

  1. The cruise adjustments are different for different station, i.e. station split (e.g. 316N19821201)

-> How to merge? Based on first and last station? Cruise_ID not in GLODAP merged master file.

  1. The cruise adjustments are different for different legs (e.g. 316N19871123.6) but have been merged into one cruise (316N19871123) for the product

-> How to merge? Based on first and last station?

  1. The cruise adjustments have been updated/changed through the versions, here always look for the most recent entry (see table below) (e.g. 320620180309)

For the expocodes not listed in the expocode list the reason is that INDIGO has been splitted into three cruises: 35MF1985-1987 and the same holds for SAVE (316N1987 - 6legs). Further 49HH20011208 has been assigned wrongly and corrected to 49HH20011127.

Remove expocode INDIGO and maintain only 35MF19850224. Remove expocode SAVE and maintain only 316N1987.

GLODAP_adjustments <- GLODAP_adjustments %>%
  select(cruise_expocode,
         first_station, last_station,
         version,
         calculated_carbon_parameter,
         ends_with("_adj")) %>% 
  rename(talk_adj = alkalinity_adj)

# Remove cruises INDIGO and SAVE

GLODAP_adjustments <- 
  GLODAP_adjustments %>% 
  filter(!(cruise_expocode %in% c("INDIGO", "SAVE")))

# correct expocode 49HH20011208 to 49HH20011127

GLODAP_adjustments <- 
  GLODAP_adjustments %>% 
  mutate(cruise_expocode = if_else(
    cruise_expocode == "49HH20011208",
    "49HH20011127",
    cruise_expocode
  ))


# select latest adjustment versions

GLODAP_adjustments <- 
  GLODAP_adjustments %>% 
  group_by(cruise_expocode, first_station) %>% 
  mutate(n = n(),
         version_max = max(version)) %>%
  ungroup() %>% 
  filter(version == version_max | is.na(version)) %>% 
  select(-c(version_max, version, n))

# harmonize multiple cruise expocodes of 316N1987

GLODAP_adjustments <- GLODAP_adjustments %>% 
  # filter(str_detect(cruise_expocode, "\\.")) %>% 
  mutate(cruise_expocode = str_split(cruise_expocode,
                                     "\\.",
                                     simplify = TRUE)[,1])

# correct one wrong last_cruise label

GLODAP_adjustments <- GLODAP_adjustments %>%
  mutate(
    last_station = if_else(
      cruise_expocode == "318M20091121" &
        first_station == 1,
      127,
      last_station
    )
  )

# merge with expocode table
GLODAP_adjustments <- full_join(GLODAP_adjustments, GLODAP_expocodes) %>% 
  relocate(cruise)



GLODAP_adjustments_NA_cruises <- 
  GLODAP_adjustments %>% 
  filter(is.na(cruise))

GLODAP_adjustments_duplicated_cruises <- 
  GLODAP_adjustments %>% 
  group_by(cruise_expocode, cruise) %>% 
  mutate(n = n()) %>%
  ungroup() %>% 
  filter(n != 1)


GLODAP_adjustments %>% 
  pivot_longer(salinity_adj:c13_adj,
               names_to = "parameter",
               values_to = "adjustment") %>% 
  ggplot(aes(adjustment)) +
  geom_histogram() +
  scale_y_log10() +
  facet_wrap(~ parameter, scales = "free_x")

Version Author Date
6d6a23e jens-daniel-mueller 2021-11-01

6 Crossover analysis

GLODAP <-
  left_join(GLODAP,
            GLODAP_adjustments %>%
              distinct(cruise, cruise_expocode))

6.1 Histograms

GLODAP_adjustments_long <- GLODAP_adjustments %>%
  select(
    cruise_expocode,
    first_station,
    last_station,
    tco2_adj,
    talk_adj,
    phosphate_adj,
    nitrate_adj,
    oxygen_adj,
    silicate_adj,
    salinity_adj
  ) %>%
  pivot_longer(tco2_adj:salinity_adj,
               names_to = "parameter",
               values_to = "adjustment") %>% 
  mutate(parameter = str_remove(parameter, "_adj"))

p_adjustment_histo <- GLODAP_adjustments_long %>% 
  ggplot(aes(adjustment)) +
  geom_histogram() +
  scale_y_log10() +
  facet_wrap(~ parameter, scales = "free_x", ncol = 1)

p_xover_histo <- 
  ggplot() +
  geom_histogram(data = glodapv2_xover,
                 aes(offset)) +
  labs(title = "v2") +
  scale_y_log10() +
  facet_wrap(~ parameter, scales = "free_x", ncol = 1)

p_xover_histo_2021 <- 
  ggplot() +
  geom_histogram(data = glodapv2_2021_xover,
                 aes(offset)) +
  labs(title = "v2_2021") +
  scale_y_log10() +
  facet_wrap(~ parameter, scales = "free_x", ncol = 1)

p_xover_histo + p_xover_histo_2021 + p_adjustment_histo

Version Author Date
a87f8c7 jens-daniel-mueller 2021-12-20
d5ef2c6 jens-daniel-mueller 2021-12-20
rm(p_xover_histo, p_xover_histo_2021, p_adjustment_histo)

6.2 Adjustment correction

glodapv2_xover <- left_join(
  glodapv2_xover,
  GLODAP_adjustments_long %>%
    select(
      cruise_A = cruise_expocode,
      parameter,
      first_station_A = first_station,
      last_station_A = last_station,
      adjustment_A = adjustment
    )
)

glodapv2_xover <- left_join(
  glodapv2_xover,
  GLODAP_adjustments_long %>%
    select(
      cruise_B = cruise_expocode,
      parameter,
      first_station_B = first_station,
      last_station_B = last_station,
      adjustment_B = adjustment
    )
)

glodapv2_xover <- glodapv2_xover  %>%
  mutate(offset_adj = 
           if_else(parameter %in% c("salinity", "talk", "tco2"),
                   offset + adjustment_A - adjustment_B,
                   offset * adjustment_A / adjustment_B))

glodapv2_2021_xover <- left_join(
  glodapv2_2021_xover,
  GLODAP_adjustments_long %>%
    select(
      cruise_A = cruise_expocode,
      parameter,
      first_station_A = first_station,
      last_station_A = last_station,
      adjustment_A = adjustment
    )
)

glodapv2_2021_xover <- left_join(
  glodapv2_2021_xover,
  GLODAP_adjustments_long %>%
    select(
      cruise_B = cruise_expocode,
      parameter,
      first_station_B = first_station,
      last_station_B = last_station,
      adjustment_B = adjustment
    )
)

glodapv2_2021_xover <- glodapv2_2021_xover  %>%
  mutate(offset_adj = 
           if_else(parameter %in% c("salinity", "talk", "tco2"),
                   offset + adjustment_A,
                   offset * adjustment_A))


xover <- bind_rows(glodapv2_xover,
                   glodapv2_2021_xover)

6.3 Missing/flagged data

hline_intercept <-
  tibble(parameter = unique(xover$parameter)) %>%
  mutate(intercept = if_else(parameter %in% c("salinity", "talk", "tco2"),
                             0,
                             1))

for (i_expocodes_missing in expocodes_missing) {
  # i_expocodes_missing <- expocodes_missing[1]
  
  cruise <- GLODAP %>%
    filter(cruise_expocode == i_expocodes_missing) %>% 
    rename(salinity = sal)
  
  parameter_qc <- loss_qc %>%
    filter(cruise_expocode == i_expocodes_missing,
           category == "loss") 
  
  print(parameter_qc)
  
  parameter_qc <- parameter_qc %>%
    pull(parameter)
  
  if (length(parameter_qc) > 0) {
    parameter_qc <- parameter_qc %>% str_c(.,"qc")
  }
    
  parameter_f <- loss_f %>%
    filter(cruise_expocode == i_expocodes_missing,
           category == "loss")
  
  print(parameter_f)
  
  parameter_f <- parameter_f %>%
    pull(parameter)
    
  if (length(parameter_f) > 0) {
    parameter_f <- parameter_f %>% str_c(.,"f")
  }
  
  parameter_f9 <- loss_f9 %>%
    filter(cruise_expocode == i_expocodes_missing,
           category == "loss")
  
  print(parameter_f9)
  
  parameter_f9 <- parameter_f9 %>%
    pull(parameter)
  
  if (length(parameter_f9) > 0) {
    parameter_f9 <- parameter_f9 %>% str_c(.,"f")
  }
  
  parameter_check <-
    unique(c(parameter_qc, parameter_f, parameter_f9))
  
  print(parameter_check)
  
  rm(parameter_qc, parameter_f, parameter_f9)
  
  xover_cruise_A <- xover %>%
    filter(cruise_A %in% i_expocodes_missing)
  
  xover_cruise_B <- xover %>%
    filter(cruise_B %in% i_expocodes_missing)
  
  xover_cruise_B_rev <- xover_cruise_B %>%
    rename(
      cruise_A_back = cruise_A,
      cruise_A = cruise_B,
      adjustment_A_back = adjustment_A,
      adjustment_A = adjustment_B
    ) %>%
    rename(cruise_B = cruise_A_back,
           adjustment_B = adjustment_A_back) %>%
    mutate(
      offset = if_else(
        parameter %in% c("salinity", "talk", "tco2"),
        -offset,
        1 / offset
      ),
      offset_adj = if_else(
        parameter %in% c("salinity", "talk", "tco2"),
        -offset_adj,
        1 / offset_adj
      )
    )
  
  xover_cruise <- bind_rows(xover_cruise_A,
                            xover_cruise_B_rev)
  
  xover_cruise <- xover_cruise %>%
    mutate(dateA = ymd(str_sub(cruise_A, 5, 12)),
           dateB = ymd(str_sub(cruise_B, 5, 12)))
  
  
  # xover_cruise <- xover_cruise %>%
  #   mutate(RV = str_sub(cruise_B, 1, 4))
  
  for (i_parameter_check in parameter_check) {
    # i_parameter_check <- parameter_check[1]
    
    cruise_flag_count <- cruise %>%
      count(lon, lat, !!sym(i_parameter_check)) %>%
      group_by(lon, lat) %>%
      mutate(n_rel = 100 * n / sum(n)) %>%
      ungroup()
    
    print(
      map +
        geom_tile(data = cruise_flag_count,
                  aes(lon, lat, fill = n_rel)) +
        scale_fill_viridis_c(option = "magma",
                             direction = -1) +
        facet_wrap(i_parameter_check, ncol = 2) +
        labs(title = i_expocodes_missing,
             subtitle = i_parameter_check)
    )
    
    i_parameter_check_var <- str_remove(i_parameter_check, "f")
    i_parameter_check_var <- str_remove(i_parameter_check_var, "qc")
    
    print(
      cruise %>% 
        ggplot(aes(!!sym(i_parameter_check_var), depth, fill=station)) +
        geom_point(alpha = 0.2, shape = 21) +
        scale_fill_viridis_c() +
        scale_y_reverse() +
        facet_wrap(i_parameter_check, ncol = 2) +
        labs(title = i_expocodes_missing,
             subtitle = i_parameter_check)
    )
    
  }

  p_crossover_ts <- xover_cruise %>%
    ggplot(aes(dateB, offset_adj)) +
    geom_vline(xintercept = ymd(str_sub(i_expocodes_missing, 5)),
               col = "red") +
    geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
    geom_point() +
    facet_grid(parameter ~ ., scales = "free_y") +
    labs(title = i_expocodes_missing,
         subtitle = str_c(parameter_check, collapse = "+")) +
    theme(
      legend.position = "bottom",
      legend.direction = "vertical",
      axis.title.x = element_blank()
    )
  
  xover_cruise_decade <- xover_cruise %>%
    mutate(decade = cut(
      year(dateB),
      c(1989, 1999, 2009, 2019),
      labels = c("1989-1999", "2000-2009", "2010-2019")
    )) %>%
    filter(!is.na(decade),
           !is.na(offset_adj)) %>%
    group_by(parameter, decade) %>%
    mutate(n = n()) %>%
    ungroup() %>% 
    filter(n > 2)
  
  
  p_crossover_decadal <-
    ggplot() +
    geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
    geom_violin(
      data = xover_cruise_decade,
      aes(x = decade, y = offset_adj),
      fill = "gold"
    ) +
    geom_boxplot(
      data = xover_cruise_decade,
      aes(x = decade, y = offset_adj),
      width = 0.2
    ) +
    labs(title = "Decadal averages") +
    facet_grid(parameter ~ ., scales = "free_y") +
    theme(axis.title.x = element_blank(),
          axis.text.x = element_text(angle = 90))
  
  print(
  p_crossover_ts + p_crossover_decadal +
    plot_layout(widths = c(2, 1))
  )
  
  rm(p_crossover_ts, p_crossover_decadal)
  
}
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 320620170703    Pacific   2010-2019 talk       2809   449     3258 loss    
# A tibble: 0 × 9
# … with 9 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_9 <int>, f_0 <int>, n_cruise <int>,
#   category <chr>
[1] "talkf"

Version Author Date
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 323019940104    Atlantic  1989-1999 talk       2393   539     2932 loss    
# A tibble: 0 × 9
# … with 9 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_9 <int>, f_0 <int>, n_cruise <int>,
#   category <chr>
[1] "talkf"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_0 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 325020060213    Pacific   2000-… aou        2236   349     0     2585 loss    
[1] "aouf"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_0 <int>, n_cruise <int>, category <chr>
# A tibble: 4 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 06AQ19980328    Atlantic  1989-… nitrate    1343   706     9     2058 loss    
2 06AQ19980328    Atlantic  1989-… phosphate  1347   707     4     2058 loss    
3 06AQ19980328    Atlantic  1989-… silicate   1348   708     2     2058 loss    
4 06AQ19980328    Atlantic  1989-… talk          0  2058     0     2058 loss    
[1] "nitratef"   "phosphatef" "silicatef"  "talkf"     

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20
# A tibble: 2 × 8
  cruise_expocode basin_AIP decade    parameter  qc_0  qc_1 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 06MT19900123    Atlantic  1989-1999 talk        660     0      660 loss    
2 06MT19900123    Pacific   1989-1999 talk          9     0        9 loss    
# A tibble: 2 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 06MT19900123    Atlantic  1989-1999 talk          0   660      660 loss    
2 06MT19900123    Pacific   1989-1999 talk          0     9        9 loss    
# A tibble: 3 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 06MT19900123    Atlantic  1989-… talk          0   324   667      991 loss    
2 06MT19900123    Pacific   1989-… aou         233    62     0      295 loss    
3 06MT19900123    Pacific   1989-… talk          0   282    13      295 loss    
[1] "talkqc" "talkf"  "aouf"  

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_0 <int>, n_cruise <int>, category <chr>
# A tibble: 2 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 316N19871123    Atlantic  1989-… aou        2554   344     0     2898 loss    
2 316N19871123    Atlantic  1989-… talk       1870  1028     0     2898 loss    
[1] "aouf"  "talkf"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter  qc_0  qc_1 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 316N19920502    Pacific   1989-1999 talk        570     0      570 loss    
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 316N19920502    Pacific   1989-1999 talk          0   570      570 loss    
# A tibble: 2 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 316N19920502    Pacific   1989-… phosphate  2676   376    29     3081 loss    
2 316N19920502    Pacific   1989-… talk          0  2508   573     3081 loss    
[1] "talkqc"     "talkf"      "phosphatef"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
7f65d3a jens-daniel-mueller 2021-12-20
6106236 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter  qc_0  qc_1 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 316N19921006    Pacific   1989-1999 talk       1352     0     1352 loss    
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 316N19921006    Pacific   1989-1999 talk          0  1352     1352 loss    
# A tibble: 1 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 316N19921006    Pacific   1989-… talk          0   175  1359     1534 loss    
[1] "talkqc" "talkf" 

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_0 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 316N19941201    Indian    1989-… talk       1705   466     0     2171 loss    
[1] "talkf"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_0 <int>, n_cruise <int>, category <chr>
# A tibble: 2 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 316N19950310    Indian    1989-… aou        1958   439     0     2397 loss    
2 316N19950310    Indian    1989-… salinity   1989   394    14     2397 loss    
[1] "aouf"      "salinityf"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_0 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 316N19950611    Indian    1989-… talk       1657   264     0     1921 loss    
[1] "talkf"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 2 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 318M20091121    Pacific   2010-2019 talk       4159  1041     5200 loss    
2 318M20091121    Pacific   2010-2019 tco2       4332   868     5200 loss    
# A tibble: 0 × 9
# … with 9 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_9 <int>, f_0 <int>, n_cruise <int>,
#   category <chr>
[1] "talkf" "tco2f"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter  qc_0  qc_1 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 31DS19940126    Pacific   1989-1999 nitrate    2873     0     2873 loss    
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_0 <int>, n_cruise <int>, category <chr>
# A tibble: 0 × 9
# … with 9 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_9 <int>, f_0 <int>, n_cruise <int>,
#   category <chr>
[1] "nitrateqc"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 31DS19960105    Pacific   1989-1999 talk       2395   282     2677 loss    
# A tibble: 0 × 9
# … with 9 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_9 <int>, f_0 <int>, n_cruise <int>,
#   category <chr>
[1] "talkf"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter  qc_0  qc_1 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 33MW19930704    Atlantic  1989-1999 talk         78   545      623 loss    
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 33MW19930704    Atlantic  1989-1999 talk        500   123      623 loss    
# A tibble: 1 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 33MW19930704    Atlantic  1989-… phosphate   671  1146     1     1818 loss    
[1] "talkqc"     "talkf"      "phosphatef"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 33RO19980123    Atlantic  1989-1999 talk        864   385     1249 loss    
# A tibble: 1 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 33RO19980123    Atlantic  1989-… phosphate  1430   661     5     2096 loss    
[1] "talkf"      "phosphatef"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 33RO20071215    Pacific   2000-2009 talk       3549   951     4500 loss    
# A tibble: 0 × 9
# … with 9 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_9 <int>, f_0 <int>, n_cruise <int>,
#   category <chr>
[1] "talkf"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 33RO20110926    Atlantic  2010-2019 tco2        842   283     1125 loss    
# A tibble: 1 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 33RO20110926    Atlantic  2010-… phosphate  1239  1304     1     2544 loss    
[1] "tco2f"      "phosphatef"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 33RR20080204    Indian    2000-2009 tco2       1720   405     2125 loss    
# A tibble: 0 × 9
# … with 9 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_9 <int>, f_0 <int>, n_cruise <int>,
#   category <chr>
[1] "tco2f"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 35A319950113    Atlantic  1989-1999 tco2        733   162      895 loss    
# A tibble: 1 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 35A319950113    Atlantic  1989-… aou         900   198     0     1098 loss    
[1] "tco2f" "aouf" 

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
2704ff6 jens-daniel-mueller 2021-12-20
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_0 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 35MF19930123    Indian    1989-… phosphate     0  1436     0     1436 loss    
[1] "phosphatef"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_0 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 35MF19960220    Indian    1989-… silicate   1630   350    24     2004 loss    
[1] "silicatef"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter  qc_0  qc_1 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 35TH20020611    Atlantic  2000-2009 tco2        926     0      926 loss    
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 35TH20020611    Atlantic  2000-2009 tco2          0   926      926 loss    
# A tibble: 0 × 9
# … with 9 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_9 <int>, f_0 <int>, n_cruise <int>,
#   category <chr>
[1] "tco2qc" "tco2f" 

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter  qc_0  qc_1 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 35TH20040604    Atlantic  2000-2009 tco2        928     0      928 loss    
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 35TH20040604    Atlantic  2000-2009 tco2          0   928      928 loss    
# A tibble: 1 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 35TH20040604    Atlantic  2000-… nitrate     926   110    14     1050 loss    
[1] "tco2qc"   "tco2f"    "nitratef"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter  qc_0  qc_1 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 35TH20080610    Atlantic  2000-2009 tco2       1032     0     1032 loss    
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 35TH20080610    Atlantic  2000-2009 tco2          0  1032     1032 loss    
# A tibble: 0 × 9
# … with 9 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_9 <int>, f_0 <int>, n_cruise <int>,
#   category <chr>
[1] "tco2qc" "tco2f" 

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_0 <int>, n_cruise <int>, category <chr>
# A tibble: 3 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 74DI19970807    Atlantic  1989-… nitrate    1650   274    12     1936 loss    
2 74DI19970807    Atlantic  1989-… phosphate     0  1936     0     1936 loss    
3 74DI19970807    Atlantic  1989-… silicate   1649   262    25     1936 loss    
[1] "nitratef"   "phosphatef" "silicatef" 

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter  qc_0  qc_1 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 74DI20040404    Atlantic  2000-2009 talk        110   948     1058 loss    
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 74DI20040404    Atlantic  2000-2009 talk        948   110     1058 loss    
# A tibble: 0 × 9
# … with 9 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_9 <int>, f_0 <int>, n_cruise <int>,
#   category <chr>
[1] "talkqc" "talkf" 

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
# A tibble: 1 × 8
  cruise_expocode basin_AIP decade    parameter  qc_0  qc_1 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 74EQ20151206    Atlantic  2010-2019 nitrate    1844     0     1844 loss    
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_0 <int>, n_cruise <int>, category <chr>
# A tibble: 0 × 9
# … with 9 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_9 <int>, f_0 <int>, n_cruise <int>,
#   category <chr>
[1] "nitrateqc"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_0 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 33RO20030604    Atlantic  2000-… phosphate     0  2487     0     2487 loss    
[1] "phosphatef"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_0 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 33RO20050111    Atlantic  2000-… phosphate     0  2546     0     2546 loss    
[1] "phosphatef"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 3 × 8
  cruise_expocode basin_AIP decade    parameter   f_2   f_0 n_cruise category
  <chr>           <chr>     <fct>     <chr>     <int> <int>    <int> <chr>   
1 06AQ20080210    Pacific   2000-2009 nitrate      48    17       65 loss    
2 06AQ20080210    Pacific   2000-2009 phosphate    48    17       65 loss    
3 06AQ20080210    Pacific   2000-2009 silicate     48    17       65 loss    
# A tibble: 5 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 06AQ20080210    Atlantic  2000-… talk       1144   778     0     1922 loss    
2 06AQ20080210    Pacific   2000-… nitrate      62    31    24      117 loss    
3 06AQ20080210    Pacific   2000-… phosphate    62    31    24      117 loss    
4 06AQ20080210    Pacific   2000-… silicate     62    31    24      117 loss    
5 06AQ20080210    Pacific   2000-… talk         74    43     0      117 loss    
[1] "nitratef"   "phosphatef" "silicatef"  "talkf"     

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_0 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 06AQ20050122    Atlantic  2000-… talk          0  2248     0     2248 loss    
[1] "talkf"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, qc_0 <int>, qc_1 <int>, n_cruise <int>, category <chr>
# A tibble: 0 × 8
# … with 8 variables: cruise_expocode <chr>, basin_AIP <chr>, decade <fct>,
#   parameter <chr>, f_2 <int>, f_0 <int>, n_cruise <int>, category <chr>
# A tibble: 1 × 9
  cruise_expocode basin_AIP decade parameter   f_2   f_9   f_0 n_cruise category
  <chr>           <chr>     <fct>  <chr>     <int> <int> <int>    <int> <chr>   
1 29HE20130320    Atlantic  2010-… phosphate     0  2256     0     2256 loss    
[1] "phosphatef"

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
fcff192 jens-daniel-mueller 2021-12-21

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
fcff192 jens-daniel-mueller 2021-12-21

6.4 IO 1990 data

IO_1990_expocodes <- GLODAP %>%
  filter(str_detect(cruise_expocode, "316N199") &
           basin_AIP == "Indian") %>%
  distinct(cruise_expocode) %>%
  pull()

xover_IO_1990_A <- xover %>%
  filter(cruise_A %in% IO_1990_expocodes)

xover_IO_1990_B <- xover %>%
  filter(cruise_B %in% IO_1990_expocodes)

xover_IO_1990_B_rev <- xover_IO_1990_B %>%
  rename(
    cruise_A_back = cruise_A,
    cruise_A = cruise_B,
    adjustment_A_back = adjustment_A,
    adjustment_A = adjustment_B
  ) %>%
  rename(cruise_B = cruise_A_back,
         adjustment_B = adjustment_A_back) %>%
  mutate(
    offset = if_else(parameter %in% c("salinity", "talk", "tco2"),
                     -offset,
                     1/offset),
    offset_adj = if_else(
      parameter %in% c("salinity", "talk", "tco2"),
      -offset_adj,
      1/offset_adj
    )
  )

xover_IO_1990 <- bind_rows(xover_IO_1990_A,
                           xover_IO_1990_B_rev)

xover_IO_1990 <- xover_IO_1990 %>%
  mutate(dateA = ymd(str_sub(cruise_A, 5, 12)),
         dateB = ymd(str_sub(cruise_B, 5, 12)))


xover_IO_1990 <- xover_IO_1990 %>%
  mutate(RV = if_else(str_detect(cruise_B, "316N"),
                      "316N",
                      "other"))


xover_IO_1990_decade <- xover_IO_1990 %>%
    mutate(decade = cut(
      year(dateB),
      c(1989, 1999, 2009, 2019),
      labels = c("1989-1999", "2000-2009", "2010-2019")
    )) %>%
    filter(!is.na(decade),
           !is.na(offset_adj),
           !is.na(offset),
           RV != "316N") %>% 
  arrange(dateB)


xover_IO_1990_decade %>%
  group_by(parameter, decade) %>%
  summarise(offset_adj_mean = mean(offset_adj, na.rm = TRUE),
            offset_adj_median = median(offset_adj, na.rm = TRUE)) %>%
  ungroup() %>%
  kable() %>%
  kable_styling() %>%
  scroll_box(height = "300px")
parameter decade offset_adj_mean offset_adj_median
nitrate 1989-1999 0.9957851 0.9952475
nitrate 2000-2009 1.0018716 1.0034000
nitrate 2010-2019 0.9942423 0.9954335
oxygen 1989-1999 0.9951297 0.9961500
oxygen 2000-2009 0.9984347 1.0003001
oxygen 2010-2019 0.9992518 0.9981748
phosphate 1989-1999 0.9916439 0.9953220
phosphate 2000-2009 1.0050862 1.0052750
phosphate 2010-2019 1.0016116 1.0031516
salinity 1989-1999 -0.0014211 -0.0011000
salinity 2000-2009 -0.0009812 -0.0012000
salinity 2010-2019 -0.0008173 -0.0009442
silicate 1989-1999 0.9963137 0.9996248
silicate 2000-2009 1.0045634 1.0058000
silicate 2010-2019 1.0076910 1.0101825
talk 1989-1999 2.8826300 3.2700000
talk 2000-2009 2.9318063 3.4280000
talk 2010-2019 3.3860085 3.8736858
tco2 1989-1999 -0.7060357 -0.3462000
tco2 2000-2009 -2.6973312 -2.5524500
tco2 2010-2019 -2.0787148 -1.9810457
p_crossover_ts <- xover_IO_1990 %>%
  ggplot(aes(dateB, offset, col = RV)) +
  geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
  geom_point(shape = 21) +
  scale_color_brewer(palette = "Set1") +
  facet_grid(parameter ~ ., scales = "free_y") +
  labs(title = "Crossover 316N199XXXXX") +
  theme(
    legend.position = "bottom",
    legend.direction = "vertical",
    axis.title.x = element_blank()
  )

p_crossover_decadal <-
  ggplot() +
  geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
  geom_violin(data = xover_IO_1990_decade,
               aes(x = decade, y = offset), fill="gold") +
  geom_boxplot(data = xover_IO_1990_decade,
               aes(x = decade, y = offset),
               width = 0.2) +
  facet_grid(parameter ~ ., scales = "free_y") +
  labs(title = "Decadal offsets") +
  theme(axis.title.x = element_blank(),
        axis.text.x = element_text(angle = 90))


p_crossover_ts + p_crossover_decadal +
  plot_layout(widths = c(2, 1))

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
a87f8c7 jens-daniel-mueller 2021-12-20
d5ef2c6 jens-daniel-mueller 2021-12-20
00227e6 jens-daniel-mueller 2021-12-20
rm(p_crossover_ts, p_crossover_decadal)

p_crossover_ts <- xover_IO_1990 %>%
  ggplot(aes(dateB, offset_adj, col = RV)) +
  geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
  geom_point(shape = 21) +
  scale_color_brewer(palette = "Set1") +
  facet_grid(parameter ~ ., scales = "free_y") +
  labs(title = "Crossover 316N199XXXXX") +
  theme(
    legend.position = "bottom",
    legend.direction = "vertical",
    axis.title.x = element_blank()
  )

p_crossover_decadal <-
  ggplot() +
  geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
  geom_violin(data = xover_IO_1990_decade,
               aes(x = decade, y = offset_adj), fill="gold") +
  geom_boxplot(data = xover_IO_1990_decade,
               aes(x = decade, y = offset_adj),
               width = 0.2) +
  facet_grid(parameter ~ ., scales = "free_y") +
  labs(title = "Decadal offsets") +
  theme(axis.title.x = element_blank(),
        axis.text.x = element_text(angle = 90))

  ggplot() +
  geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
  # geom_violin(data = xover_IO_1990 %>% 
  #               filter(year(dateB) >= 2000, year(dateB) < 2010),
  #              aes(x = "2000-2009", y = offset_adj), fill="gold") +
  geom_boxplot(data = xover_IO_1990 %>% 
                filter(year(dateB) >= 2000, year(dateB) < 2010),
               aes(x = "2000-2009", y = offset_adj),
               width = 0.2) +
  facet_grid(parameter ~ ., scales = "free_y") +
  labs(title = "Decadal offsets") +
  theme(axis.title.x = element_blank(),
        axis.text.x = element_text(angle = 90))

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
a87f8c7 jens-daniel-mueller 2021-12-20
d5ef2c6 jens-daniel-mueller 2021-12-20
00227e6 jens-daniel-mueller 2021-12-20
p_crossover_ts + p_crossover_decadal +
  plot_layout(widths = c(2, 1))

Version Author Date
51ec1fe jens-daniel-mueller 2021-12-23
d5ef2c6 jens-daniel-mueller 2021-12-20
00227e6 jens-daniel-mueller 2021-12-20
rm(p_crossover_ts, p_crossover_decadal)

6.5 5 basin decadal

basinmask_5 <- basinmask_5 %>%
  mutate(
    basin = str_replace(basin, "_", ". "),
    basin = fct_relevel(
      basin,
      "N. Pacific",
      "S. Pacific",
      "N. Atlantic",
      "S. Atlantic",
      "Indian"
    )
  )

for (i_basin in unique(basinmask_5$basin)) {
  # i_basin <- unique(basinmask_5$basin)[5]
  
  expocodes_subbasin <- inner_join(GLODAP, basinmask_5) %>%
    filter(basin == i_basin)
  
  print(
  map +
    geom_tile(data = expocodes_subbasin %>% distinct(lon, lat),
              aes(lon, lat)) +
    labs(title = i_basin)
  )
  
  expocodes_subbasin_qc <- expocodes_subbasin %>%
    select(row_number, cruise_expocode, ends_with("qc")) %>%
    pivot_longer(ends_with("qc"),
                 names_to = "parameter",
                 values_to = "value") %>%
    filter(value == 1) %>%
    pivot_wider(names_from = parameter,
                values_from = value) %>%
    count(cruise_expocode)
  
  expocodes_subbasin_f <- expocodes_subbasin %>%
    select(row_number, cruise_expocode, ends_with("f")) %>%
    pivot_longer(ends_with("f"),
                 names_to = "parameter",
                 values_to = "value") %>%
    filter(value == 2) %>%
    pivot_wider(names_from = parameter,
                values_from = value) %>%
    count(cruise_expocode)
  
  expocodes_subbasin <- inner_join(expocodes_subbasin_f, expocodes_subbasin_qc) %>%
    group_by(cruise_expocode) %>%
    summarise(n = min(n)) %>%
    ungroup()
  
  rm(expocodes_subbasin_f, expocodes_subbasin_qc)
  
  xover_subbasin <- xover %>%
    filter(
      cruise_A %in% expocodes_subbasin$cruise_expocode &
        cruise_B %in% expocodes_subbasin$cruise_expocode
    )
  
  
  xover_subbasin <- xover_subbasin %>%
    mutate(dateA = year(ymd(str_sub(cruise_A, 5, 12))),
           dateB = year(ymd(str_sub(cruise_B, 5, 12))))
  
  
  for (i_cruise_expocode in expocodes_subbasin$cruise_expocode){
    # i_cruise_expocode <- expocodes_subbasin$cruise_expocode[1]
    
    xover_cruise_A <- xover_subbasin %>%
      filter(cruise_A == i_cruise_expocode)
    
    xover_cruise_B <- xover_subbasin %>%
      filter(cruise_B == i_cruise_expocode)

    xover_cruise_B_rev <- xover_cruise_B %>%
      rename(
        cruise_A_back = cruise_A,
        cruise_A = cruise_B,
        dateA_back = dateA,
        dateA = dateB,
        adjustment_A_back = adjustment_A,
        adjustment_A = adjustment_B
      ) %>%
      rename(cruise_B = cruise_A_back,
             dateB = dateA_back,
             adjustment_B = adjustment_A_back) %>%
      mutate(
        offset = if_else(
          parameter %in% c("salinity", "talk", "tco2"),
          -offset,
          1 / offset
        ),
        offset_adj = if_else(
          parameter %in% c("salinity", "talk", "tco2"),
          -offset_adj,
          1 / offset_adj
        )
      )
    
    xover_cruise <- bind_rows(xover_cruise_A,
                              xover_cruise_B_rev)
    
    rm(xover_cruise_A, xover_cruise_B, xover_cruise_B_rev)
    
    xover_cruise <- xover_cruise %>% 
      group_by(cruise_A, cruise_B, dateA, dateB, parameter) %>% 
      summarise(offset = mean(offset, na.rm = TRUE),
                offset_adj = mean(offset_adj, na.rm = TRUE)) %>% 
      ungroup()
    
    
    xover_cruise <- left_join(xover_cruise,
                              expocodes_subbasin %>% rename(cruise_B = cruise_expocode))
    
    xover_cruise <- xover_cruise %>%
      mutate(decade = cut(
        dateB,
        c(1989, 1999, 2009, 2019),
        labels = c("1990-1999", "2000-2009", "2010-2019")
      )) %>%
      filter(!is.na(decade),
             !is.na(offset_adj),
             !is.na(offset)) %>%
      arrange(dateB, dateA)
    
    xover_cruise_stats <- xover_cruise %>%
      group_by(parameter, dateA, decade) %>%
      summarise(
        offset_adj_mean = mean(offset_adj, na.rm = TRUE),
        offset_adj_sd = sd(offset_adj, na.rm = TRUE),
        offset_adj_mean_weighted = weighted.mean(x = offset_adj, w = n, na.rm = TRUE),
        offset_adj_median = median(offset_adj, na.rm = TRUE)
      )
    
    xover_cruise_stats <- xover_cruise_stats %>% 
      mutate(basin = i_basin,
             cruise_expocode = i_cruise_expocode)
    
    if (exists("xover_cruise_stats_all")) {
      xover_cruise_stats_all <-
        bind_rows(xover_cruise_stats_all, xover_cruise_stats)
    }
    
    if (!exists("xover_cruise_stats_all")) {
      xover_cruise_stats_all <- xover_cruise_stats
    }
    
  }
  
  
  
  for (i_decade_start in seq(1990, 2010, 10)) {
    # i_decade_start <- seq(1990, 2010, 10)[3]
    
    xover_subbasin_A <- xover_subbasin %>%
      filter(dateA >= i_decade_start & dateA < i_decade_start + 10)
    
    xover_subbasin_B <- xover_subbasin %>%
      filter(dateB >= i_decade_start & dateB < i_decade_start + 10)
    
    xover_subbasin_B_rev <- xover_subbasin_B %>%
      rename(
        cruise_A_back = cruise_A,
        cruise_A = cruise_B,
        dateA_back = dateA,
        dateA = dateB,
        adjustment_A_back = adjustment_A,
        adjustment_A = adjustment_B
      ) %>%
      rename(cruise_B = cruise_A_back,
             dateB = dateA_back,
             adjustment_B = adjustment_A_back) %>%
      mutate(
        offset = if_else(
          parameter %in% c("salinity", "talk", "tco2"),
          -offset,
          1 / offset
        ),
        offset_adj = if_else(
          parameter %in% c("salinity", "talk", "tco2"),
          -offset_adj,
          1 / offset_adj
        )
      )
    
    xover_subbasin_decade <- bind_rows(xover_subbasin_A,
                          xover_subbasin_B_rev)
    
    rm(xover_subbasin_A, xover_subbasin_B, xover_subbasin_B_rev)
    
    
    xover_subbasin_decade <- left_join(xover_subbasin_decade,
                          expocodes_subbasin %>% rename(cruise_A = cruise_expocode,
                                                  n_A = n))
    xover_subbasin_decade <- left_join(xover_subbasin_decade,
                          expocodes_subbasin %>% rename(cruise_B = cruise_expocode,
                                                  n_B = n))
    
    xover_subbasin_decade <- xover_subbasin_decade %>%
      mutate(n = n_A + n_B) %>%
      select(-starts_with("n_"))
    
    xover_subbasin_decade <- xover_subbasin_decade %>%
      mutate(decade = cut(
        dateB,
        c(1989, 1999, 2009, 2019),
        labels = c("1990-1999", "2000-2009", "2010-2019")
      )) %>%
      filter(!is.na(decade),
             !is.na(offset_adj),
             !is.na(offset)) %>%
      arrange(dateB, dateA)
    
    xover_subbasin_decade_stats <- xover_subbasin_decade %>%
      group_by(parameter, decade) %>%
      summarise(
        offset_adj_mean = mean(offset_adj, na.rm = TRUE),
        offset_adj_sd = sd(offset_adj, na.rm = TRUE),
        offset_adj_mean_weighted = weighted.mean(x = offset_adj, w = n, na.rm = TRUE),
        offset_adj_median = median(offset_adj, na.rm = TRUE)
      )
    
    xover_subbasin_decade_stats <- xover_subbasin_decade_stats %>% 
      mutate(basin = i_basin,
             decade_start = i_decade_start)
    
    if (exists("xover_subbasin_decade_stats_all")) {
      xover_subbasin_decade_stats_all <-
        bind_rows(xover_subbasin_decade_stats_all, xover_subbasin_decade_stats)
    }
    
    if (!exists("xover_subbasin_decade_stats_all")) {
      xover_subbasin_decade_stats_all <- xover_subbasin_decade_stats
    }
    
    
    print(
      xover_subbasin_decade_stats %>%
        kable(caption = paste0(i_basin, " | ", i_decade_start, "s")) %>%
        kable_styling() %>%
        scroll_box(height = "300px")
    )
    
    
    p_crossover_ts <- xover_subbasin_decade %>%
      ggplot(aes(dateB, offset_adj)) +
      geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
      geom_point(shape = 21) +
      scale_color_brewer(palette = "Set1") +
      facet_grid(parameter ~ ., scales = "free_y") +
      labs(title = paste0(i_basin, " | ", i_decade_start, "s")) +
      theme(
        legend.position = "bottom",
        legend.direction = "vertical",
        axis.title.x = element_blank()
      )
    
    p_crossover_decadal <-
      ggplot() +
      geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
      geom_violin(data = xover_subbasin_decade,
                  aes(x = decade, y = offset_adj),
                  fill = "gold") +
      geom_boxplot(data = xover_subbasin_decade,
                   aes(x = decade, y = offset_adj),
                   width = 0.2) +
      facet_grid(parameter ~ ., scales = "free_y") +
      labs(title = "Decadal offsets") +
      theme(axis.title.x = element_blank(),
            axis.text.x = element_text(angle = 90))
    
    print(p_crossover_ts + p_crossover_decadal +
            plot_layout(widths = c(2, 1)))
    
    rm(p_crossover_ts, p_crossover_decadal)
    
  }
}

Version Author Date
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15
S. Pacific | 1990s
parameter decade offset_adj_mean offset_adj_sd offset_adj_mean_weighted offset_adj_median basin decade_start
nitrate 1990-1999 1.0000910 0.0135540 1.0000372 1.0000002 S. Pacific 1990
nitrate 2000-2009 0.9987923 0.0125895 0.9997011 1.0004168 S. Pacific 1990
nitrate 2010-2019 0.9967609 0.0114346 0.9983688 0.9976484 S. Pacific 1990
oxygen 1990-1999 1.0021247 0.0675069 1.0012006 1.0000000 S. Pacific 1990
oxygen 2000-2009 1.0015645 0.0124248 1.0010338 1.0010930 S. Pacific 1990
oxygen 2010-2019 1.0062411 0.0248566 1.0092096 0.9999971 S. Pacific 1990
phosphate 1990-1999 1.0001459 0.0171707 1.0000378 1.0000000 S. Pacific 1990
phosphate 2000-2009 1.0048570 0.0130865 1.0057215 1.0030322 S. Pacific 1990
phosphate 2010-2019 1.0073893 0.0107726 1.0084500 1.0067516 S. Pacific 1990
salinity 1990-1999 0.0000000 0.0027627 0.0000000 0.0000000 S. Pacific 1990
salinity 2000-2009 -0.0004555 0.0017727 -0.0001972 0.0000000 S. Pacific 1990
salinity 2010-2019 0.0006308 0.0018835 0.0005616 0.0003744 S. Pacific 1990
silicate 1990-1999 1.0001243 0.0158518 1.0000261 1.0000000 S. Pacific 1990
silicate 2000-2009 0.9984605 0.0134817 0.9980534 0.9973000 S. Pacific 1990
silicate 2010-2019 0.9965859 0.0119938 0.9956523 0.9967000 S. Pacific 1990
talk 1990-1999 0.0000000 5.9961838 0.0000000 0.0000000 S. Pacific 1990
talk 2000-2009 -1.9069189 9.3838907 -2.2407446 0.9474929 S. Pacific 1990
talk 2010-2019 1.7413708 3.7810331 1.5103407 1.7398016 S. Pacific 1990
tco2 1990-1999 0.0000000 3.2332682 0.0000000 0.0000000 S. Pacific 1990
tco2 2000-2009 -0.5338567 2.7115335 -0.4998497 -0.7950000 S. Pacific 1990
tco2 2010-2019 -1.2565001 1.6924134 -0.9928463 -1.0330440 S. Pacific 1990

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15
S. Pacific | 2000s
parameter decade offset_adj_mean offset_adj_sd offset_adj_mean_weighted offset_adj_median basin decade_start
nitrate 1990-1999 1.0013699 0.0128325 1.0003412 0.9995834 S. Pacific 2000
nitrate 2000-2009 1.0000257 0.0071848 1.0000169 1.0000000 S. Pacific 2000
nitrate 2010-2019 1.0018432 0.0064809 1.0032042 1.0010000 S. Pacific 2000
oxygen 1990-1999 0.9985873 0.0121170 0.9990006 0.9989082 S. Pacific 2000
oxygen 2000-2009 1.0001226 0.0156835 1.0000061 1.0000000 S. Pacific 2000
oxygen 2010-2019 1.0048498 0.0187485 1.0077504 1.0008366 S. Pacific 2000
phosphate 1990-1999 0.9953337 0.0129161 0.9944604 0.9969770 S. Pacific 2000
phosphate 2000-2009 1.0001405 0.0167878 1.0000473 1.0000000 S. Pacific 2000
phosphate 2010-2019 1.0023287 0.0107479 1.0075652 1.0017836 S. Pacific 2000
salinity 1990-1999 0.0004555 0.0017727 0.0001972 0.0000000 S. Pacific 2000
salinity 2000-2009 0.0000000 0.0017937 0.0000000 0.0000000 S. Pacific 2000
salinity 2010-2019 0.0013737 0.0017565 0.0007828 0.0011662 S. Pacific 2000
silicate 1990-1999 1.0017204 0.0133112 1.0020400 1.0027073 S. Pacific 2000
silicate 2000-2009 1.0000616 0.0111178 1.0000493 1.0000000 S. Pacific 2000
silicate 2010-2019 0.9971455 0.0139991 0.9957033 0.9966471 S. Pacific 2000
talk 1990-1999 1.9069189 9.3838907 2.2407446 -0.9474929 S. Pacific 2000
talk 2000-2009 0.0000000 3.6173404 0.0000000 0.0000000 S. Pacific 2000
talk 2010-2019 0.4102622 2.6715271 0.3930889 0.0754311 S. Pacific 2000
tco2 1990-1999 0.5338567 2.7115335 0.4998497 0.7950000 S. Pacific 2000
tco2 2000-2009 0.0000000 3.0902109 0.0000000 0.0000000 S. Pacific 2000
tco2 2010-2019 -0.5040925 2.7686106 -0.1939446 -0.4672284 S. Pacific 2000

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15
S. Pacific | 2010s
parameter decade offset_adj_mean offset_adj_sd offset_adj_mean_weighted offset_adj_median basin decade_start
nitrate 1990-1999 1.0033810 0.0116295 1.0017172 1.0023572 S. Pacific 2010
nitrate 2000-2009 0.9982013 0.0064228 0.9968501 0.9990010 S. Pacific 2010
nitrate 2010-2019 1.0000207 0.0065305 1.0000299 1.0000000 S. Pacific 2010
oxygen 1990-1999 0.9943415 0.0223399 0.9915882 1.0000030 S. Pacific 2010
oxygen 2000-2009 0.9954891 0.0170950 0.9928671 0.9991641 S. Pacific 2010
oxygen 2010-2019 1.0001594 0.0180072 1.0006474 1.0000000 S. Pacific 2010
phosphate 1990-1999 0.9927765 0.0105861 0.9917255 0.9932937 S. Pacific 2010
phosphate 2000-2009 0.9977907 0.0107224 0.9925594 0.9982195 S. Pacific 2010
phosphate 2010-2019 1.0000294 0.0077158 1.0000333 1.0000001 S. Pacific 2010
salinity 1990-1999 -0.0006308 0.0018835 -0.0005616 -0.0003744 S. Pacific 2010
salinity 2000-2009 -0.0013737 0.0017565 -0.0007828 -0.0011662 S. Pacific 2010
salinity 2010-2019 0.0000000 0.0012701 0.0000000 0.0000000 S. Pacific 2010
silicate 1990-1999 1.0035691 0.0120731 1.0045246 1.0033109 S. Pacific 2010
silicate 2000-2009 1.0030595 0.0141461 1.0045904 1.0033641 S. Pacific 2010
silicate 2010-2019 1.0000484 0.0099059 1.0001006 1.0000001 S. Pacific 2010
talk 1990-1999 -1.7413708 3.7810331 -1.5103407 -1.7398016 S. Pacific 2010
talk 2000-2009 -0.4102622 2.6715271 -0.3930889 -0.0754311 S. Pacific 2010
talk 2010-2019 0.0000000 1.7840793 0.0000000 0.0000000 S. Pacific 2010
tco2 1990-1999 1.2565001 1.6924134 0.9928463 1.0330440 S. Pacific 2010
tco2 2000-2009 0.5040925 2.7686106 0.1939446 0.4672284 S. Pacific 2010
tco2 2010-2019 0.0000000 1.7742321 0.0000000 0.0000000 S. Pacific 2010

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15
S. Atlantic | 1990s
parameter decade offset_adj_mean offset_adj_sd offset_adj_mean_weighted offset_adj_median basin decade_start
nitrate 1990-1999 1.0002255 0.0213952 1.0002590 1.0000000 S. Atlantic 1990
nitrate 2000-2009 0.9988906 0.0322295 1.0001052 0.9991074 S. Atlantic 1990
nitrate 2010-2019 0.9998354 0.0164189 0.9986441 1.0007948 S. Atlantic 1990
oxygen 1990-1999 1.0000180 0.0060272 1.0000184 1.0000000 S. Atlantic 1990
oxygen 2000-2009 0.9999171 0.0092378 0.9987831 1.0003251 S. Atlantic 1990
oxygen 2010-2019 1.0021150 0.0087339 1.0016508 1.0015458 S. Atlantic 1990
phosphate 1990-1999 1.0001246 0.0159302 1.0001229 1.0000001 S. Atlantic 1990
phosphate 2000-2009 1.0004472 0.0207214 1.0008675 1.0003532 S. Atlantic 1990
phosphate 2010-2019 1.0041425 0.0288342 1.0018979 1.0036383 S. Atlantic 1990
salinity 1990-1999 0.0000000 0.0034319 0.0000000 0.0000000 S. Atlantic 1990
salinity 2000-2009 -0.0011322 0.0055341 -0.0009565 -0.0010000 S. Atlantic 1990
salinity 2010-2019 0.0004036 0.0029662 0.0001912 0.0004000 S. Atlantic 1990
silicate 1990-1999 1.0003375 0.0261537 1.0003305 1.0000004 S. Atlantic 1990
silicate 2000-2009 0.9901491 0.0375113 0.9922513 0.9935912 S. Atlantic 1990
silicate 2010-2019 0.9900532 0.0264099 0.9861078 0.9948350 S. Atlantic 1990
talk 1990-1999 0.0000000 1.3604734 0.0000000 0.0000000 S. Atlantic 1990
talk 2000-2009 -1.8070750 3.1753371 -2.1275570 -1.4167500 S. Atlantic 1990
talk 2010-2019 -0.5974985 2.7863374 -0.5783019 -0.8136912 S. Atlantic 1990
tco2 1990-1999 0.0000000 2.5388364 0.0000000 0.0000000 S. Atlantic 1990
tco2 2000-2009 -1.0285789 2.5567809 -1.1192790 -1.6913000 S. Atlantic 1990
tco2 2010-2019 -1.8598674 1.8542801 -1.7959912 -1.7432059 S. Atlantic 1990

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15
S. Atlantic | 2000s
parameter decade offset_adj_mean offset_adj_sd offset_adj_mean_weighted offset_adj_median basin decade_start
nitrate 1990-1999 1.0020362 0.0293242 1.0008357 1.0008934 S. Atlantic 2000
nitrate 2000-2009 1.0000725 0.0121769 1.0000580 1.0000000 S. Atlantic 2000
nitrate 2010-2019 1.0016937 0.0136628 0.9999443 1.0011000 S. Atlantic 2000
oxygen 1990-1999 1.0001672 0.0092431 1.0013016 0.9996750 S. Atlantic 2000
oxygen 2000-2009 1.0000574 0.0107910 1.0000638 1.0000004 S. Atlantic 2000
oxygen 2010-2019 1.0028668 0.0090837 1.0016501 1.0032604 S. Atlantic 2000
phosphate 1990-1999 0.9999784 0.0209686 0.9994902 0.9996469 S. Atlantic 2000
phosphate 2000-2009 1.0000953 0.0140014 1.0000507 1.0000006 S. Atlantic 2000
phosphate 2010-2019 1.0081250 0.0253785 1.0092757 1.0011000 S. Atlantic 2000
salinity 1990-1999 0.0011322 0.0055341 0.0009565 0.0010000 S. Atlantic 2000
salinity 2000-2009 0.0000000 0.0049318 0.0000000 0.0000000 S. Atlantic 2000
salinity 2010-2019 0.0012337 0.0067151 0.0011848 0.0000507 S. Atlantic 2000
silicate 1990-1999 1.0114300 0.0398372 1.0087609 1.0064502 S. Atlantic 2000
silicate 2000-2009 1.0018525 0.0619886 1.0015999 1.0000000 S. Atlantic 2000
silicate 2010-2019 0.9949076 0.0361630 0.9947182 0.9938433 S. Atlantic 2000
talk 1990-1999 1.8070750 3.1753371 2.1275570 1.4167500 S. Atlantic 2000
talk 2000-2009 0.0000000 3.1065346 0.0000000 0.0000000 S. Atlantic 2000
talk 2010-2019 1.3090154 2.6701418 1.1958616 0.9447500 S. Atlantic 2000
tco2 1990-1999 1.0285789 2.5567809 1.1192790 1.6913000 S. Atlantic 2000
tco2 2000-2009 0.0000000 2.5033593 0.0000000 0.0000000 S. Atlantic 2000
tco2 2010-2019 -0.0656638 1.8481982 -0.0647531 -0.1067000 S. Atlantic 2000

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15
S. Atlantic | 2010s
parameter decade offset_adj_mean offset_adj_sd offset_adj_mean_weighted offset_adj_median basin decade_start
nitrate 1990-1999 1.0004320 0.0166191 1.0016295 0.9992058 S. Atlantic 2010
nitrate 2000-2009 0.9984909 0.0136402 1.0002253 0.9989012 S. Atlantic 2010
nitrate 2010-2019 1.0000604 0.0112289 1.0000595 1.0000031 S. Atlantic 2010
oxygen 1990-1999 0.9979632 0.0085943 0.9984111 0.9984566 S. Atlantic 2010
oxygen 2000-2009 0.9972214 0.0089795 0.9984275 0.9967502 S. Atlantic 2010
oxygen 2010-2019 1.0000210 0.0065725 1.0000176 1.0000000 S. Atlantic 2010
phosphate 1990-1999 0.9966369 0.0272791 0.9988655 0.9963749 S. Atlantic 2010
phosphate 2000-2009 0.9925266 0.0239819 0.9914080 0.9989012 S. Atlantic 2010
phosphate 2010-2019 1.0001150 0.0156687 1.0000584 1.0000017 S. Atlantic 2010
salinity 1990-1999 -0.0004036 0.0029662 -0.0001912 -0.0004000 S. Atlantic 2010
salinity 2000-2009 -0.0012337 0.0067151 -0.0011848 -0.0000507 S. Atlantic 2010
salinity 2010-2019 0.0000000 0.0024898 0.0000000 0.0000000 S. Atlantic 2010
silicate 1990-1999 1.0107674 0.0275559 1.0148146 1.0051918 S. Atlantic 2010
silicate 2000-2009 1.0064439 0.0374334 1.0061670 1.0061948 S. Atlantic 2010
silicate 2010-2019 1.0001251 0.0161346 1.0001223 1.0000008 S. Atlantic 2010
talk 1990-1999 0.5974985 2.7863374 0.5783019 0.8136912 S. Atlantic 2010
talk 2000-2009 -1.3090154 2.6701418 -1.1958616 -0.9447500 S. Atlantic 2010
talk 2010-2019 0.0000000 1.7979367 0.0000000 0.0000000 S. Atlantic 2010
tco2 1990-1999 1.8598674 1.8542801 1.7959912 1.7432059 S. Atlantic 2010
tco2 2000-2009 0.0656638 1.8481982 0.0647531 0.1067000 S. Atlantic 2010
tco2 2010-2019 0.0000000 1.6005303 0.0000000 0.0000000 S. Atlantic 2010

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15
Indian | 1990s
parameter decade offset_adj_mean offset_adj_sd offset_adj_mean_weighted offset_adj_median basin decade_start
nitrate 1990-1999 1.0001047 0.0145383 1.0000564 1.0000000 Indian 1990
nitrate 2000-2009 0.9998960 0.0188514 1.0000253 1.0005000 Indian 1990
nitrate 2010-2019 0.9931633 0.0102768 0.9939763 0.9933495 Indian 1990
oxygen 1990-1999 1.0000701 0.0119076 1.0000841 1.0000000 Indian 1990
oxygen 2000-2009 0.9988041 0.0103323 0.9993330 0.9998678 Indian 1990
oxygen 2010-2019 1.0026078 0.0075400 1.0011090 1.0011786 Indian 1990
phosphate 1990-1999 1.0000907 0.0135443 1.0000861 1.0000003 Indian 1990
phosphate 2000-2009 1.0021132 0.0137941 1.0022736 1.0036183 Indian 1990
phosphate 2010-2019 1.0023022 0.0107815 1.0016784 1.0031516 Indian 1990
salinity 1990-1999 0.0000000 0.0025633 0.0000000 0.0000000 Indian 1990
salinity 2000-2009 0.0009612 0.0031643 0.0003647 -0.0001000 Indian 1990
salinity 2010-2019 0.0008975 0.0047108 -0.0000274 -0.0002009 Indian 1990
silicate 1990-1999 1.0003655 0.0272635 1.0004177 1.0000000 Indian 1990
silicate 2000-2009 1.0014820 0.0228503 1.0027016 1.0046000 Indian 1990
silicate 2010-2019 1.0048879 0.0154447 1.0066379 1.0057718 Indian 1990
talk 1990-1999 0.0000000 2.9762752 0.0000000 0.0000000 Indian 1990
talk 2000-2009 1.9866327 3.2416636 2.4022193 1.9213000 Indian 1990
talk 2010-2019 2.0841410 2.8443193 2.7929988 1.9921088 Indian 1990
tco2 1990-1999 0.0000000 1.6935864 0.0000000 0.0000000 Indian 1990
tco2 2000-2009 -1.6637212 2.1444850 -1.7945690 -1.8213000 Indian 1990
tco2 2010-2019 -2.4120977 1.6739726 -2.0509233 -2.2425192 Indian 1990

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15
Indian | 2000s
parameter decade offset_adj_mean offset_adj_sd offset_adj_mean_weighted offset_adj_median basin decade_start
nitrate 1990-1999 1.0004543 0.0187861 1.0001531 0.9995002 Indian 2000
nitrate 2000-2009 1.0001334 0.0164388 1.0000891 1.0000003 Indian 2000
nitrate 2010-2019 0.9938363 0.0090026 0.9932698 0.9956679 Indian 2000
oxygen 1990-1999 1.0013033 0.0103625 1.0007491 1.0001322 Indian 2000
oxygen 2000-2009 1.0000399 0.0089898 1.0000443 1.0000000 Indian 2000
oxygen 2010-2019 1.0007849 0.0067417 0.9993524 1.0008785 Indian 2000
phosphate 1990-1999 0.9980782 0.0137844 0.9978779 0.9963947 Indian 2000
phosphate 2000-2009 1.0000605 0.0111217 1.0000581 1.0000007 Indian 2000
phosphate 2010-2019 1.0009060 0.0097940 1.0014515 1.0020777 Indian 2000
salinity 1990-1999 -0.0009612 0.0031643 -0.0003647 0.0001000 Indian 2000
salinity 2000-2009 0.0000000 0.0025063 0.0000000 0.0000000 Indian 2000
salinity 2010-2019 0.0018489 0.0041454 0.0017559 0.0018358 Indian 2000
silicate 1990-1999 0.9990485 0.0234314 0.9977195 0.9954211 Indian 2000
silicate 2000-2009 1.0002136 0.0208118 1.0001160 1.0000001 Indian 2000
silicate 2010-2019 1.0005760 0.0175663 1.0021476 1.0018409 Indian 2000
talk 1990-1999 -1.9866327 3.2416636 -2.4022193 -1.9213000 Indian 2000
talk 2000-2009 0.0000000 3.1999028 0.0000000 0.0000000 Indian 2000
talk 2010-2019 0.4627533 3.0967473 0.2254189 -0.1629833 Indian 2000
tco2 1990-1999 1.6637212 2.1444850 1.7945690 1.8213000 Indian 2000
tco2 2000-2009 0.0000000 3.3864853 0.0000000 0.0000000 Indian 2000
tco2 2010-2019 -0.7239355 2.5428093 -0.5062694 -0.9718994 Indian 2000

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15
Indian | 2010s
parameter decade offset_adj_mean offset_adj_sd offset_adj_mean_weighted offset_adj_median basin decade_start
nitrate 1990-1999 1.0069899 0.0105564 1.0061261 1.0066951 Indian 2010
nitrate 2000-2009 1.0062825 0.0091450 1.0068542 1.0043510 Indian 2010
nitrate 2010-2019 1.0000230 0.0072457 1.0000238 1.0000008 Indian 2010
oxygen 1990-1999 0.9974536 0.0074586 0.9989410 0.9988229 Indian 2010
oxygen 2000-2009 0.9992598 0.0067273 1.0006850 0.9991223 Indian 2010
oxygen 2010-2019 1.0000122 0.0052798 1.0000159 1.0000001 Indian 2010
phosphate 1990-1999 0.9978153 0.0107862 0.9984112 0.9968583 Indian 2010
phosphate 2000-2009 0.9991875 0.0098673 0.9986294 0.9979266 Indian 2010
phosphate 2010-2019 1.0000224 0.0077246 1.0000181 1.0000068 Indian 2010
salinity 1990-1999 -0.0008975 0.0047108 0.0000274 0.0002009 Indian 2010
salinity 2000-2009 -0.0018489 0.0041454 -0.0017559 -0.0018358 Indian 2010
salinity 2010-2019 0.0000000 0.0019406 0.0000000 0.0000000 Indian 2010
silicate 1990-1999 0.9953659 0.0154007 0.9936255 0.9942641 Indian 2010
silicate 2000-2009 0.9997295 0.0178870 0.9980689 0.9981628 Indian 2010
silicate 2010-2019 1.0002316 0.0230110 1.0002007 1.0000313 Indian 2010
talk 1990-1999 -2.0841410 2.8443193 -2.7929988 -1.9921088 Indian 2010
talk 2000-2009 -0.4627533 3.0967473 -0.2254189 0.1629833 Indian 2010
talk 2010-2019 0.0000000 1.1152891 0.0000000 0.0000000 Indian 2010
tco2 1990-1999 2.4120977 1.6739726 2.0509233 2.2425192 Indian 2010
tco2 2000-2009 0.7239355 2.5428093 0.5062694 0.9718994 Indian 2010
tco2 2010-2019 0.0000000 2.0059804 0.0000000 0.0000000 Indian 2010

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15
N. Atlantic | 1990s
parameter decade offset_adj_mean offset_adj_sd offset_adj_mean_weighted offset_adj_median basin decade_start
nitrate 1990-1999 1.0002216 0.0210870 1.0002478 1.0000000 N. Atlantic 1990
nitrate 2000-2009 1.0060106 0.0231158 1.0072847 1.0033558 N. Atlantic 1990
nitrate 2010-2019 1.0076626 0.0227285 1.0057461 1.0087758 N. Atlantic 1990
oxygen 1990-1999 1.0000623 0.0111770 1.0000502 1.0000000 N. Atlantic 1990
oxygen 2000-2009 1.0028432 0.0151035 1.0026438 1.0020491 N. Atlantic 1990
oxygen 2010-2019 1.0059298 0.0127849 1.0049356 1.0050855 N. Atlantic 1990
phosphate 1990-1999 1.0004435 0.0298607 1.0004353 1.0000000 N. Atlantic 1990
phosphate 2000-2009 0.9935484 0.0435414 0.9943921 0.9988462 N. Atlantic 1990
phosphate 2010-2019 1.0039893 0.0323897 1.0013460 1.0010907 N. Atlantic 1990
salinity 1990-1999 0.0000000 0.0105298 0.0000000 0.0000000 N. Atlantic 1990
salinity 2000-2009 0.0002803 0.0135644 0.0007632 0.0013000 N. Atlantic 1990
salinity 2010-2019 -0.0035802 0.0129847 -0.0023281 0.0000487 N. Atlantic 1990
silicate 1990-1999 1.0015029 0.0552438 1.0013693 1.0000000 N. Atlantic 1990
silicate 2000-2009 1.0039906 0.0533408 1.0088465 0.9985367 N. Atlantic 1990
silicate 2010-2019 0.9861506 0.0531541 0.9870197 0.9825116 N. Atlantic 1990
talk 1990-1999 0.0000000 3.0549682 0.0000000 0.0000000 N. Atlantic 1990
talk 2000-2009 0.2509969 3.3257618 0.4016342 0.0668000 N. Atlantic 1990
talk 2010-2019 -0.3766157 4.6523587 -0.4021624 -0.8105105 N. Atlantic 1990
tco2 1990-1999 0.0000000 4.3495103 0.0000000 0.0000000 N. Atlantic 1990
tco2 2000-2009 -3.0020110 3.7962001 -2.4708710 -2.9689000 N. Atlantic 1990
tco2 2010-2019 -6.7308628 5.1418767 -5.2884049 -7.7144298 N. Atlantic 1990

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15
N. Atlantic | 2000s
parameter decade offset_adj_mean offset_adj_sd offset_adj_mean_weighted offset_adj_median basin decade_start
nitrate 1990-1999 0.9945440 0.0226545 0.9933068 0.9966554 N. Atlantic 2000
nitrate 2000-2009 1.0002885 0.0240904 1.0002526 1.0000000 N. Atlantic 2000
nitrate 2010-2019 1.0046295 0.0177526 1.0024768 1.0053216 N. Atlantic 2000
oxygen 1990-1999 0.9973873 0.0148099 0.9976011 0.9979551 N. Atlantic 2000
oxygen 2000-2009 1.0001412 0.0168356 1.0001818 1.0000000 N. Atlantic 2000
oxygen 2010-2019 1.0038086 0.0155267 1.0027344 1.0027017 N. Atlantic 2000
phosphate 1990-1999 1.0084914 0.0459496 1.0078826 1.0011552 N. Atlantic 2000
phosphate 2000-2009 1.0007723 0.0395190 1.0009562 1.0000002 N. Atlantic 2000
phosphate 2010-2019 1.0027112 0.0173204 1.0011740 1.0012237 N. Atlantic 2000
salinity 1990-1999 -0.0002803 0.0135644 -0.0007632 -0.0013000 N. Atlantic 2000
salinity 2000-2009 0.0000000 0.0132424 0.0000000 0.0000000 N. Atlantic 2000
salinity 2010-2019 -0.0064878 0.0129637 -0.0043466 -0.0026000 N. Atlantic 2000
silicate 1990-1999 0.9988106 0.0529929 0.9940171 1.0014655 N. Atlantic 2000
silicate 2000-2009 1.0008673 0.0417936 1.0008117 1.0000000 N. Atlantic 2000
silicate 2010-2019 0.9850334 0.0343804 0.9855459 0.9869000 N. Atlantic 2000
talk 1990-1999 -0.2509969 3.3257618 -0.4016342 -0.0668000 N. Atlantic 2000
talk 2000-2009 0.0000000 3.3115850 0.0000000 0.0000000 N. Atlantic 2000
talk 2010-2019 -0.7200088 5.4773205 -1.1461204 -1.2687164 N. Atlantic 2000
tco2 1990-1999 3.0020110 3.7962001 2.4708710 2.9689000 N. Atlantic 2000
tco2 2000-2009 0.0000000 2.9059169 0.0000000 0.0000000 N. Atlantic 2000
tco2 2010-2019 -3.8259951 3.4324554 -3.0322458 -3.7469366 N. Atlantic 2000

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15
N. Atlantic | 2010s
parameter decade offset_adj_mean offset_adj_sd offset_adj_mean_weighted offset_adj_median basin decade_start
nitrate 1990-1999 0.9928999 0.0224797 0.9947839 0.9913006 N. Atlantic 2010
nitrate 2000-2009 0.9957013 0.0176186 0.9978117 0.9947065 N. Atlantic 2010
nitrate 2010-2019 1.0001135 0.0151827 1.0001063 1.0000000 N. Atlantic 2010
oxygen 1990-1999 0.9942633 0.0124958 0.9952196 0.9949403 N. Atlantic 2010
oxygen 2000-2009 0.9964431 0.0154126 0.9974930 0.9973055 N. Atlantic 2010
oxygen 2010-2019 1.0000370 0.0086484 1.0000302 1.0000000 N. Atlantic 2010
phosphate 1990-1999 0.9970529 0.0320720 0.9996759 0.9989105 N. Atlantic 2010
phosphate 2000-2009 0.9975853 0.0168610 0.9990935 0.9987778 N. Atlantic 2010
phosphate 2010-2019 1.0000847 0.0131231 1.0000862 1.0000001 N. Atlantic 2010
salinity 1990-1999 0.0035802 0.0129847 0.0023281 -0.0000487 N. Atlantic 2010
salinity 2000-2009 0.0064878 0.0129637 0.0043466 0.0026000 N. Atlantic 2010
salinity 2010-2019 0.0000000 0.0042167 0.0000000 0.0000000 N. Atlantic 2010
silicate 1990-1999 1.0170031 0.0556180 1.0159833 1.0177997 N. Atlantic 2010
silicate 2000-2009 1.0164748 0.0369565 1.0158553 1.0132739 N. Atlantic 2010
silicate 2010-2019 1.0002313 0.0216609 1.0002201 1.0000004 N. Atlantic 2010
talk 1990-1999 0.3766157 4.6523587 0.4021624 0.8105105 N. Atlantic 2010
talk 2000-2009 0.7200088 5.4773205 1.1461204 1.2687164 N. Atlantic 2010
talk 2010-2019 0.0000000 6.4254264 0.0000000 0.0000000 N. Atlantic 2010
tco2 1990-1999 6.7308628 5.1418767 5.2884049 7.7144298 N. Atlantic 2010
tco2 2000-2009 3.8259951 3.4324554 3.0322458 3.7469366 N. Atlantic 2010
tco2 2010-2019 0.0000000 3.2444041 0.0000000 0.0000000 N. Atlantic 2010

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15
N. Pacific | 1990s
parameter decade offset_adj_mean offset_adj_sd offset_adj_mean_weighted offset_adj_median basin decade_start
nitrate 1990-1999 1.0000822 0.0128283 1.0001041 1.0000000 N. Pacific 1990
nitrate 2000-2009 0.9993837 0.0126450 0.9970720 0.9997000 N. Pacific 1990
nitrate 2010-2019 0.9996404 0.0107156 0.9966815 0.9986880 N. Pacific 1990
oxygen 1990-1999 1.0007308 0.0389311 1.0011947 1.0000000 N. Pacific 1990
oxygen 2000-2009 1.0076218 0.0312738 1.0042530 1.0057410 N. Pacific 1990
oxygen 2010-2019 1.0066858 0.0183370 1.0051605 1.0030434 N. Pacific 1990
phosphate 1990-1999 1.0001394 0.0167235 1.0001411 1.0000000 N. Pacific 1990
phosphate 2000-2009 0.9982351 0.0162192 0.9968676 0.9985219 N. Pacific 1990
phosphate 2010-2019 1.0059922 0.0152279 1.0030759 1.0067516 N. Pacific 1990
salinity 1990-1999 0.0000000 0.0021750 0.0000000 0.0000000 N. Pacific 1990
salinity 2000-2009 -0.0007977 0.0022377 -0.0009524 -0.0009000 N. Pacific 1990
salinity 2010-2019 -0.0010850 0.0176338 -0.0020684 0.0000190 N. Pacific 1990
silicate 1990-1999 1.0001737 0.0186622 1.0002312 1.0000000 N. Pacific 1990
silicate 2000-2009 0.9982685 0.0223113 0.9976305 0.9986708 N. Pacific 1990
silicate 2010-2019 0.9970521 0.0099473 0.9966349 0.9965594 N. Pacific 1990
talk 1990-1999 0.0000000 3.7896391 0.0000000 0.0000000 N. Pacific 1990
talk 2000-2009 0.6577284 3.1516485 1.0461176 0.4376000 N. Pacific 1990
talk 2010-2019 1.5502396 3.2648760 2.0912907 2.0013646 N. Pacific 1990
tco2 1990-1999 0.0000000 3.9913530 0.0000000 0.0000000 N. Pacific 1990
tco2 2000-2009 -0.3578554 3.8868821 -0.9168012 -0.4286000 N. Pacific 1990
tco2 2010-2019 -0.9094575 3.0694834 -1.1260676 -0.9545519 N. Pacific 1990

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15
N. Pacific | 2000s
parameter decade offset_adj_mean offset_adj_sd offset_adj_mean_weighted offset_adj_median basin decade_start
nitrate 1990-1999 1.0007770 0.0126884 1.0031072 1.0003001 N. Pacific 2000
nitrate 2000-2009 1.0000429 0.0092687 1.0000381 1.0000000 N. Pacific 2000
nitrate 2010-2019 0.9990939 0.0085547 0.9992134 0.9997290 N. Pacific 2000
oxygen 1990-1999 0.9936123 0.0404782 0.9973541 0.9942918 N. Pacific 2000
oxygen 2000-2009 1.0003993 0.0283617 1.0003619 1.0000000 N. Pacific 2000
oxygen 2010-2019 1.0029198 0.0182671 1.0042679 0.9994962 N. Pacific 2000
phosphate 1990-1999 1.0020508 0.0175578 1.0034528 1.0014803 N. Pacific 2000
phosphate 2000-2009 1.0001191 0.0155168 1.0001604 1.0000000 N. Pacific 2000
phosphate 2010-2019 1.0056392 0.0110298 1.0058295 1.0062517 N. Pacific 2000
salinity 1990-1999 0.0007977 0.0022377 0.0009524 0.0009000 N. Pacific 2000
salinity 2000-2009 0.0000000 0.0021318 0.0000000 0.0000000 N. Pacific 2000
salinity 2010-2019 0.0015983 0.0043209 0.0012445 0.0013562 N. Pacific 2000
silicate 1990-1999 1.0021669 0.0195615 1.0027186 1.0013310 N. Pacific 2000
silicate 2000-2009 1.0000821 0.0128734 1.0000937 1.0000000 N. Pacific 2000
silicate 2010-2019 0.9955159 0.0084629 0.9962325 0.9955220 N. Pacific 2000
talk 1990-1999 -0.6577284 3.1516485 -1.0461176 -0.4376000 N. Pacific 2000
talk 2000-2009 0.0000000 2.9385024 0.0000000 0.0000000 N. Pacific 2000
talk 2010-2019 1.5997282 2.6393958 1.5684540 1.6458585 N. Pacific 2000
tco2 1990-1999 0.3578554 3.8868821 0.9168012 0.4286000 N. Pacific 2000
tco2 2000-2009 0.0000000 3.2420278 0.0000000 0.0000000 N. Pacific 2000
tco2 2010-2019 -0.4773818 2.7125545 -0.6948785 -0.5675000 N. Pacific 2000

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15
N. Pacific | 2010s
parameter decade offset_adj_mean offset_adj_sd offset_adj_mean_weighted offset_adj_median basin decade_start
nitrate 1990-1999 1.0004739 0.0107055 1.0034215 1.0013137 N. Pacific 2010
nitrate 2000-2009 1.0009802 0.0085779 1.0008379 1.0002711 N. Pacific 2010
nitrate 2010-2019 1.0000078 0.0039653 1.0000076 1.0000000 N. Pacific 2010
oxygen 1990-1999 0.9936765 0.0175353 0.9951442 0.9969659 N. Pacific 2010
oxygen 2000-2009 0.9974012 0.0172020 0.9961867 1.0005040 N. Pacific 2010
oxygen 2010-2019 1.0000412 0.0090867 1.0000264 1.0000000 N. Pacific 2010
phosphate 1990-1999 0.9942793 0.0156666 0.9971747 0.9932937 N. Pacific 2010
phosphate 2000-2009 0.9945115 0.0108789 0.9942950 0.9937871 N. Pacific 2010
phosphate 2010-2019 1.0000225 0.0067122 1.0000212 1.0000000 N. Pacific 2010
salinity 1990-1999 0.0010850 0.0176338 0.0020684 -0.0000190 N. Pacific 2010
salinity 2000-2009 -0.0015983 0.0043209 -0.0012445 -0.0013562 N. Pacific 2010
salinity 2010-2019 0.0000000 0.0031958 0.0000000 0.0000000 N. Pacific 2010
silicate 1990-1999 1.0030559 0.0099876 1.0034864 1.0034525 N. Pacific 2010
silicate 2000-2009 1.0045767 0.0085289 1.0038398 1.0044981 N. Pacific 2010
silicate 2010-2019 1.0000277 0.0074419 1.0000254 1.0000000 N. Pacific 2010
talk 1990-1999 -1.5502396 3.2648760 -2.0912907 -2.0013646 N. Pacific 2010
talk 2000-2009 -1.5997282 2.6393958 -1.5684540 -1.6458585 N. Pacific 2010
talk 2010-2019 0.0000000 3.9756474 0.0000000 0.0000000 N. Pacific 2010
tco2 1990-1999 0.9094575 3.0694834 1.1260676 0.9545519 N. Pacific 2010
tco2 2000-2009 0.4773818 2.7125545 0.6948785 0.5675000 N. Pacific 2010
tco2 2010-2019 0.0000000 2.2247482 0.0000000 0.0000000 N. Pacific 2010

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
4a7550e jens-daniel-mueller 2022-02-15
8804a83 jens-daniel-mueller 2022-02-15
e1243c2 jens-daniel-mueller 2022-02-15
xover_subbasin_decade_stats_all <- xover_subbasin_decade_stats_all %>%
    mutate(
    basin = fct_relevel(
      basin,
      "N. Pacific",
      "S. Pacific",
      "N. Atlantic",
      "S. Atlantic",
      "Indian"
    )
  )


xover_subbasin_decade_stats_all_cstar <- xover_subbasin_decade_stats_all %>%
  filter(parameter %in% c("talk", "phosphate", "tco2")) %>% 
  select(
    parameter,
    basin,
    decade,
    decade_start,
    offset_adj_mean_weighted,
  ) %>%
  pivot_wider(names_from = parameter,
              values_from = offset_adj_mean_weighted) %>%
  mutate(cstar = tco2  - 
           (117 * (1 - phosphate) * 2e-6)  - 0.5 * 
           (talk - (16 * (1 - phosphate) * 2e-6))) %>%
  pivot_longer(phosphate:cstar,
               values_to = "offset_adj_mean_weighted",
               names_to = "parameter")
  # filter(parameter == "cstar")



xover_subbasin_decade_stats_all_cstar %>%
  # filter(parameter %in% c("talk", "tco2", "phosphate")) %>%
  ggplot(aes(decade_start, offset_adj_mean_weighted)) +
  geom_hline(data = hline_intercept %>%
               filter(parameter %in% c("talk", "tco2", "phosphate")),
             aes(yintercept = intercept)) +
  geom_point(aes(fill = basin), shape = 21) +
  geom_line(aes(col = basin)) +
  scale_fill_brewer(palette = "Paired") +
  scale_color_brewer(palette = "Paired") +
  scale_x_continuous(breaks = seq(1990, 2010, 10)) +
  facet_grid(parameter ~ decade, scales = "free_y")

Version Author Date
cf43743 jens-daniel-mueller 2022-02-15
4a7550e jens-daniel-mueller 2022-02-15
xover_subbasin_decade_stats_all %>% 
  filter(parameter %in% c("talk", "tco2", "phosphate")) %>%
  ggplot(aes(decade_start, offset_adj_mean_weighted)) +
  geom_hline(data = hline_intercept %>% filter(parameter %in% c("talk", "tco2", "phosphate")), aes(yintercept = intercept)) +
  geom_point(aes(fill = basin), shape = 21) +
  geom_linerange(aes(ymin = offset_adj_mean_weighted - offset_adj_sd,
                     ymax = offset_adj_mean_weighted + offset_adj_sd,
                     col = basin)) +
  geom_line(aes(col = basin)) +
  scale_fill_brewer(palette = "Paired") +
  scale_color_brewer(palette = "Paired") +
  scale_x_continuous(breaks = seq(1990, 2010, 10)) +
  facet_grid(parameter ~ decade, scales = "free_y")

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
cf43743 jens-daniel-mueller 2022-02-15
4a7550e jens-daniel-mueller 2022-02-15
xover_subbasin_decade_stats_all %>%
  filter(parameter %in% c("talk", "tco2", "phosphate")) %>%
  ggplot(aes(decade_start, offset_adj_mean)) +
  geom_hline(data = hline_intercept %>% filter(parameter %in% c("talk", "tco2", "phosphate")), aes(yintercept = intercept)) +
  geom_point(aes(fill = basin), shape = 21) +
  geom_line(aes(col = basin)) +
  scale_fill_brewer(palette = "Paired") +
  scale_color_brewer(palette = "Paired") +
  scale_x_continuous(breaks = seq(1990, 2010, 10)) +
  facet_grid(parameter ~ decade, scales = "free_y")

Version Author Date
6e65117 jens-daniel-mueller 2022-02-16
cf43743 jens-daniel-mueller 2022-02-15
xover_cruise_stats_all <- xover_cruise_stats_all %>%
  mutate(basin = fct_relevel(
    basin,
    "N. Pacific",
    "S. Pacific",
    "N. Atlantic",
    "S. Atlantic",
    "Indian"
  ))

expocodes <- inner_join(GLODAP, basinmask_5)

expocodes <- expocodes %>%
  count(basin, cruise_expocode)


xover_cruise_stats_all <- left_join(xover_cruise_stats_all,
                                    expocodes)

xover_cruise_stats_all_cstar <- xover_cruise_stats_all %>%
  filter(parameter %in% c("talk", "phosphate", "tco2")) %>%
  select(parameter,
         dateA,
         basin,
         decade,
         cruise_expocode,
         n,
         offset_adj_mean_weighted,) %>%
  pivot_wider(names_from = parameter,
              values_from = offset_adj_mean_weighted) %>%
  mutate(cstar = tco2  -
           (117 * (1 - phosphate) * 2e-6)  - 0.5 *
           (talk - (16 * (1 - phosphate) * 2e-6))) %>%
  pivot_longer(phosphate:cstar,
               values_to = "offset_adj_mean_weighted",
               names_to = "parameter")
# filter(parameter == "cstar")

hline_intercept <-
  tibble(parameter = unique(xover_cruise_stats_all_cstar$parameter)) %>%
  mutate(intercept = if_else(parameter %in% c("cstar", "talk", "tco2"),
                             0,
                             1))

xover_cruise_stats_all_cstar %>%
  # filter(parameter %in% c("talk", "tco2", "phosphate")) %>%
  group_by(basin) %>%
  group_split() %>%
  # head(1) %>%
  map(
    ~ ggplot(data = .x,
             aes(dateA, offset_adj_mean_weighted, size = n)) +
      geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
      geom_point(alpha = 0.3) +
      labs(title = .x$basin) +
      facet_grid(parameter ~ decade, scales = "free_y")
  )
[[1]]


[[2]]


[[3]]


[[4]]


[[5]]

7 RV activity

GLODAP_counts <- full_join(
  GLODAP,
  GLODAP_expocodes
)

GLODAP_counts <- GLODAP_counts %>%
  mutate(decade = cut(
    year,
    seq(1990, 2020, 10),
    right = FALSE,
    labels = c("1990-1999", "2000-2009", "2010-2019")
  ), .after = year) %>% 
  filter(!is.na(decade))

GLODAP_counts <- GLODAP_counts %>% 
  mutate(RV = str_sub(cruise_expocode, 1, 4))

RV_activity <- GLODAP_counts %>% 
  count(decade, basin_AIP, RV) %>% 
  group_by(decade, basin_AIP) %>% 
  mutate(n_total = sum(n)) %>% 
  ungroup() %>% 
  mutate(n_prop = 100* n / n_total)

RV_activity <-RV_activity %>% 
  group_by(decade, basin_AIP) %>% 
  mutate(rank = rank(-n_prop)) %>% 
  ungroup()

RV_activity %>% 
  ggplot(aes(rank, n_prop)) +
  geom_line() +
  geom_point() +
  geom_text(data = RV_activity %>% filter(n_prop > 20),
             aes(rank, n_prop, label = RV),
             nudge_x = 5) +
  labs(y = "proportion of tco2 samples (%)") +
  facet_grid(decade ~ basin_AIP)

Version Author Date
daa43b9 jens-daniel-mueller 2021-12-06
rm(RV_activity)

8 Largest cruises

large_cruises <- GLODAP_counts %>% 
  count(decade, basin_AIP, cruise_expocode) %>% 
  group_by(decade, basin_AIP) %>% 
  mutate(n_total = sum(n)) %>% 
  ungroup() %>% 
  mutate(n_prop = 100* n / n_total)

large_cruises <- large_cruises %>% 
  group_by(decade, basin_AIP) %>% 
  mutate(rank = rank(-n_prop)) %>% 
  ungroup()


large_cruises %>%
  group_split(decade, basin_AIP) %>%
  head(1) %>%
  map(
    ~
      ggplot(data = .x,
             aes(rank, n_prop)) +
      geom_line() +
      geom_point(
        data = .x %>% filter(rank <= 5),
        aes(rank, n_prop, fill = cruise_expocode), shape = 21) +
      scale_fill_brewer(palette = "Set1") +
      xlim(0, max(large_cruises$rank)) +
      labs(y = "proportion of tco2 samples (%)") +
      facet_grid(decade ~ basin_AIP)
  )
[[1]]

Version Author Date
9075296 jens-daniel-mueller 2022-01-12
large_cruises %>%
  filter(rank <= 5) %>% 
  select(decade, basin_AIP, rank, n_prop, cruise_expocode) %>% 
  mutate(n_prop = round(n_prop, 1)) %>% 
  arrange(decade, basin_AIP, rank) %>% 
  kable() %>% 
  kable_styling() %>% 
  scroll_box(height = "300px")
decade basin_AIP rank n_prop cruise_expocode
1990-1999 Atlantic 1 5.4 323019940104
1990-1999 Atlantic 2 3.9 33RO19980123
1990-1999 Atlantic 3 3.8 06AQ19980328
1990-1999 Atlantic 4 3.6 316N19970530
1990-1999 Atlantic 5 3.6 74DI19970807
1990-1999 Indian 1 8.1 316N19951202
1990-1999 Indian 2 8.0 316N19950124
1990-1999 Indian 3 7.7 316N19950310
1990-1999 Indian 4 7.3 316N19950829
1990-1999 Indian 5 7.0 316N19941201
1990-1999 Pacific 1 5.7 316N19920502
1990-1999 Pacific 2 5.6 31DS19960105
1990-1999 Pacific 3 5.6 31DS19940126
1990-1999 Pacific 4 5.5 318M19940327
1990-1999 Pacific 5 4.2 31DS19920907
2000-2009 Atlantic 1 4.6 33RO20050111
2000-2009 Atlantic 2 4.5 33RO20030604
2000-2009 Atlantic 3 4.1 06AQ20050122
2000-2009 Atlantic 4 3.5 06AQ20080210
2000-2009 Atlantic 5 2.7 35MF20080207
2000-2009 Indian 1 19.4 33RR20090320
2000-2009 Indian 2 10.4 33RR20070322
2000-2009 Indian 3 9.1 33RR20070204
2000-2009 Indian 4 9.0 33RR20080204
2000-2009 Indian 5 8.2 49NZ20031209
2000-2009 Pacific 1 7.0 33RO20071215
2000-2009 Pacific 2 6.0 318M20040615
2000-2009 Pacific 3 4.9 49NZ20030803
2000-2009 Pacific 4 4.6 49NZ20090410
2000-2009 Pacific 5 4.6 49NZ20051031
2010-2019 Atlantic 1 6.8 33RO20100308
2010-2019 Atlantic 2 6.3 33RO20130803
2010-2019 Atlantic 3 5.7 33RO20110926
2010-2019 Atlantic 4 5.5 740H20180228
2010-2019 Atlantic 5 5.1 33RO20131223
2010-2019 Indian 1 19.3 33RO20180423
2010-2019 Indian 2 18.4 33RR20160321
2010-2019 Indian 3 12.5 33RR20160208
2010-2019 Indian 4 10.5 096U20180111
2010-2019 Indian 5 9.6 325020190403
2010-2019 Pacific 1 5.9 33RO20161119
2010-2019 Pacific 2 4.1 318M20130321
2010-2019 Pacific 3 4.1 320620180309
2010-2019 Pacific 4 4.0 320620170703
2010-2019 Pacific 5 3.6 49RY20110515
rm(GLODAP_count, large_cruises)

9 Indian Ocean 1990 CRM

IO_CRM_meas <- IO_CRM_meas %>%
  fill(cruise:batch) %>% 
  select(-starts_with("ph")) %>% 
  rename(talk_meas = talk_ave,
         tco2_meas = tco2_ave)
  
CRM_ref <- CRM_ref %>% 
  select(-c(date, comment, sal)) %>% 
  rename(talk_ref = talk,
         tco2_ref = tco2)

IO_CRM_offset <-
  left_join(IO_CRM_meas,
            CRM_ref) %>% 
  mutate(batch = as.factor(batch))

IO_CRM_offset <- IO_CRM_offset %>% 
  mutate(talk_offset = talk_meas - talk_ref,
         tco2_offset = tco2_meas - tco2_ref)

IO_CRM_offset <- IO_CRM_offset %>% 
  select(-c(talk_meas:talk_ref)) %>% 
  pivot_longer(ends_with("_offset"),
               values_to = "offset",
               names_to = "parameter") %>% 
  mutate(parameter = str_remove(parameter, "_offset"),
         start_date = mdy(start_date))

IO_CRM_offset %>% 
  ggplot(aes(offset)) +
  geom_histogram(binwidth = 1) +
  facet_wrap(~ parameter)

Version Author Date
d454df1 jens-daniel-mueller 2021-12-15
IO_CRM_offset <- IO_CRM_offset %>% 
  filter(cell != "All")

IO_CRM_offset_mean <- IO_CRM_offset %>% 
  group_by(parameter) %>% 
  summarise(offset_mean = mean(offset),
            offset_sd = sd(offset)) %>% 
  ungroup()

IO_CRM_offset %>%
  filter(parameter == "talk") %>%
  ggplot() +
  scale_fill_brewer(palette = "Set1",
                    name = "CRM batch") +
  geom_hline(data = IO_CRM_offset_mean %>% filter(parameter == "talk"),
             aes(yintercept = offset_mean)) +
  geom_hline(
    data = IO_CRM_offset_mean %>% filter(parameter == "talk"),
    aes(yintercept = offset_mean - offset_sd),
    linetype = 2
  ) +
  geom_hline(
    data = IO_CRM_offset_mean %>% filter(parameter == "talk"),
    aes(yintercept = offset_mean + offset_sd),
    linetype = 2
  ) +
  geom_point(aes(start_date, offset, fill = batch, size=n),
             shape = 21) +
  scale_size(name = "Nr of\nmeasurements") +
  labs(x = "Cruise start date",
       y = "TA offset meas-CRM (µmol/kg)",
       title = "RV Knorr IO 1990 - TA reference measurements",
       subtitle = "Data source: Tables 1 and 2 from Millero et al. (1998)")

Version Author Date
61d5f49 jens-daniel-mueller 2021-12-15
d454df1 jens-daniel-mueller 2021-12-15

10 Write files

GLODAP  %>%
  select(-cruise_expocode) %>% 
  write_csv(paste(path_preprocessing,
                  "GLODAPv2.2021_preprocessed.csv",
                  sep = ""))

GLODAP_tracer  %>%
  write_csv(paste(
    path_preprocessing,
    "GLODAPv2.2021_preprocessed_tracer.csv",
    sep = ""
  ))

GLODAP_adjustments  %>%
  write_csv(paste(path_preprocessing,
                  "GLODAPv2.2021_adustments.csv",
                  sep = ""))

# GLODAP_adjustments_NA_cruises  %>%
#   select(cruise_expocode, cruise) %>%
#   write_csv(paste(
#     path_preprocessing,
#     "GLODAPv2.2021_adustments_NA_cruises.csv",
#     sep = ""
#   ))
# 
# GLODAP_adjustments_duplicated_cruises  %>%
#   drop_na() %>%
#   write_csv(
#     paste(
#       path_preprocessing,
#       "GLODAPv2.2021_adustments_duplicated_cruises.csv",
#       sep = ""
#     )
#   )

11 Overview plots

11.1 Assign coarse spatial grid

For the following plots, the cleaned data set was re-opened and observations were gridded spatially to intervals of:

  • 5° x 5°
GLODAP <- m_grid_horizontal_coarse(GLODAP)

11.2 Histogram Zonal coverage

GLODAP_histogram_lat <- GLODAP %>%
  group_by(lat_grid) %>%
  tally() %>%
  ungroup()

GLODAP_histogram_lat %>%
  ggplot(aes(lat_grid, n)) +
  geom_col() +
  coord_flip() +
  theme(legend.title = element_blank())

Version Author Date
98599d8 jens-daniel-mueller 2021-06-27
9d8353f jens-daniel-mueller 2021-05-31
rm(GLODAP_histogram_lat)

11.3 Histogram temporal coverage

GLODAP_histogram_year <- GLODAP %>%
  group_by(year) %>%
  tally() %>%
  ungroup()

GLODAP_histogram_year %>%
  ggplot() +
  geom_col(aes(year, n)) +
  theme(
    axis.title.x = element_blank()
  )

Version Author Date
98599d8 jens-daniel-mueller 2021-06-27
9d8353f jens-daniel-mueller 2021-05-31
rm(GLODAP_histogram_year)

11.4 Zonal temporal coverage (Hovmoeller)

GLODAP_hovmoeller_year <- GLODAP %>%
  group_by(year, lat_grid) %>%
  tally() %>%
  ungroup()

GLODAP_hovmoeller_year %>%
  ggplot(aes(year, lat_grid, fill = log10(n))) +
  geom_tile() +
  geom_vline(xintercept = c(1999.5, 2012.5)) +
  scale_fill_viridis_c(option = "magma", direction = -1) +
  theme(legend.position = "top",
        axis.title.x = element_blank())

Version Author Date
98599d8 jens-daniel-mueller 2021-06-27
9d8353f jens-daniel-mueller 2021-05-31
rm(GLODAP_hovmoeller_year)

11.5 Coverage map

map +
  geom_raster(data = GLODAP_obs_grid,
              aes(lon, lat, fill = log10(n))) +
  scale_fill_viridis_c(option = "magma",
                       direction = -1)

Version Author Date
98599d8 jens-daniel-mueller 2021-06-27
9d8353f jens-daniel-mueller 2021-05-31
GLODAP_obs_grid_all_vars <- GLODAP %>% 
  select(year, lat, lon, cruise, sal, temp, oxygen,
         phosphate, nitrate, silicate, tco2, talk) %>% 
  pivot_longer(cols = sal:talk,
               names_to = "parameter",
               values_to = "value") %>% 
  mutate(presence = if_else(is.na(value), "missing", "available")) %>% 
  count(year, lat, lon, parameter, presence)

GLODAP_obs_grid_all_vars_wide <- GLODAP_obs_grid_all_vars %>% 
  pivot_wider(names_from = "presence",
              values_from = n,
              values_fill = 0) %>% 
  mutate(ratio_available = available/(available+missing))

all_plots <- GLODAP_obs_grid_all_vars_wide %>%
  # mutate(cruise = as.factor(cruise)) %>%
  group_split(year) %>%
  # tail(3) %>%
  map(
    ~ map +
      geom_tile(
        data = .x,
        aes(
          x = lon,
          y = lat,
          width = 1,
          height = 1,
          fill = ratio_available
        )
      ) +
      scale_fill_scico(palette = "berlin",
                       limits = c(0,1)) +
      labs(title = unique(.x$year)) +
      facet_wrap(~ parameter)
  )


pdf(file = paste0(path_preprocessing, "GLODAPv2.2021_preprocessed_coverage_maps.pdf"),
    width = 10, 
    height = 5)
all_plots
[[1]]

[[2]]

[[3]]

[[4]]

[[5]]

[[6]]

[[7]]

[[8]]

[[9]]

[[10]]

[[11]]

[[12]]

[[13]]

[[14]]

[[15]]

[[16]]

[[17]]

[[18]]

[[19]]

[[20]]

[[21]]

[[22]]

[[23]]

[[24]]

[[25]]

[[26]]

[[27]]

[[28]]

[[29]]

[[30]]

[[31]]

[[32]]

[[33]]

[[34]]

[[35]]

[[36]]

[[37]]

[[38]]

[[39]]

[[40]]

[[41]]

[[42]]

[[43]]

[[44]]

[[45]]
dev.off()
png 
  2 

11.6 Time series

GLODAP_time_series <- GLODAP %>% 
  select(year, basin_AIP, lat, depth, sal, temp,
         oxygen, aou, nitrate, silicate, phosphate,
         tco2, talk)

GLODAP_time_series <- GLODAP_time_series %>% 
  mutate(depth_grid = cut(depth, seq(0,1e4,1000)))

GLODAP_time_series <- GLODAP_time_series %>% 
  pivot_longer(sal:talk,
               names_to = "parameter",
               values_to = "value") %>% 
  filter(!is.na(value),
         !is.na(depth_grid))

GLODAP_time_series %>%
  group_split(basin_AIP, depth_grid) %>%
  # head(1) %>%
  map(
    ~ ggplot(data = .x,
             aes(year, value, col = lat)) +
      geom_jitter(alpha = 0.1) +
      scale_color_divergent() +
      facet_grid(parameter ~ depth_grid,
                 scales = "free_y") +
      labs(title = paste(
        "basin_AIP:",
        unique(.x$basin_AIP),
        "| depth_grid:",
        unique(.x$depth_grid)
      ))
  )

12 CANYON-B

12.1 Prediction

source("/net/kryo/work/uptools/co2_calculation/CANYON-B/CANYONB.R")

GLODAP_CB <- GLODAP %>%
  mutate(lon = if_else(lon > 180, lon - 360, lon)) %>%
  arrange(year) %>% 
  select(row_number, year, date, lat, lon, depth, basin_AIP,
         temp, sal, oxygen,
         talk, tco2, nitrate, phosphate, silicate)

# filter rows with essential variables for Canyon-B
GLODAP_CB <- GLODAP_CB %>%
  filter(across(c(lat, lon, depth,
                  temp, sal, oxygen), ~ !is.na(.x)))

GLODAP_CB <- GLODAP_CB %>%
  mutate(as_tibble(
    CANYONB(
      date = paste0(as.character(date), " 12:00"),
      lat = lat,
      lon = lon,
      pres = depth,
      temp = temp,
      psal = sal,
      doxy = oxygen,
      param = c("AT", "CT", "NO3", "PO4", "SiOH4")
    )
  ))

GLODAP_CB <- GLODAP_CB %>%
  select(-ends_with(c("_cim", "_cin", "_cii")))


GLODAP_CB <- GLODAP_CB %>%
  rename(
    "talk_CANYONB" = "AT",
    "tco2_CANYONB" = "CT",
    "nitrate_CANYONB" = "NO3",
    "phosphate_CANYONB" = "PO4",
    "silicate_CANYONB" = "SiOH4"
  )

12.2 Comparison to observations

variables <- c("talk", "tco2", "nitrate", "phosphate", "silicate")

for (i_variable in variables) {
  # i_variable <- variables[1]
  
  # calculate equal axis limits and binwidth
  axis_lims <- GLODAP_CB %>%
    drop_na() %>% 
    summarise(max_value = max(c(max(
      !!sym(i_variable)
    ),
    max(!!sym(
      paste0(i_variable, "_CANYONB")
    )))),
    min_value = min(c(min(
      !!sym(i_variable)
    ),
    min(!!sym(
      paste0(i_variable, "_CANYONB")
    )))))
  
  binwidth_value <- (axis_lims$max_value - axis_lims$min_value) / 60
  axis_lims <- c(axis_lims$min_value, axis_lims$max_value)
  
  print(
    ggplot(GLODAP_CB, aes(
      x = !!sym(i_variable),
      y = !!sym(paste0(i_variable, "_CANYONB"))
    )) +
      geom_bin2d(binwidth = binwidth_value) +
      scale_fill_viridis_c(trans = "log10") +
      geom_abline(slope = 1, col = 'red') +
      coord_equal(xlim = axis_lims,
                  ylim = axis_lims) +
      facet_wrap( ~ basin_AIP) +
      labs(title = "All years")
  ) 
  
  
  # for (i_year in unique(GLODAP_CB$year)) {
  #   # i_year <- 2017
  #   
  #   print(
  #     ggplot(
  #       GLODAP_CB %>% filter(year == i_year),
  #       aes(x = !!sym(i_variable),
  #           y = !!sym(paste0(
  #             i_variable, "_CANYONB"
  #           )))
  #     ) +
  #       geom_bin2d(binwidth = binwidth_value) +
  #       scale_fill_viridis_c(trans = "log10") +
  #       geom_abline(slope = 1, col = 'red') +
  #       coord_equal(xlim = axis_lims,
  #                   ylim = axis_lims) +
  #       facet_wrap( ~ basin_AIP) +
  #       labs(title = paste("Year:", i_year))
  #   )
  # }
  
}

12.3 Write files

GLODAP_CB %>% 
  select(row_number,
         talk_CANYONB, tco2_CANYONB,
         nitrate_CANYONB, phosphate_CANYONB, silicate_CANYONB) %>% 
  write_csv(paste(path_preprocessing,
                             "GLODAPv2.2021_Canyon-B.csv",
                             sep = ""))

13 Crossover data

GLODAP_CB <-
  read_csv(paste(path_preprocessing,
                 "GLODAPv2.2021_Canyon-B.csv",
                 sep = ""))
cruises_phosphate_gap_fill <-
  c("33MW19930704",
    "33RO20030604",
    "33RO20050111",
    "33RO19980123")

cruises_talk_gap_fill <-
  c("06AQ19980328")

cruises_tco2_calc <-
  c("35TH20040604",
    "29AH20160617")

cruises_talk_calc <-
  c("06MT19900123",
    "316N19920502",
    "316N19921006")
xover_add_decade <- glodapv2_2021_xover_add %>%
  mutate(dateA = ymd(str_sub(cruise_A, 5, 12)),
         dateB = ymd(str_sub(cruise_B, 5, 12))) %>%
  mutate(decade = cut(
    year(dateB),
    c(1989, 1999, 2009, 2019),
    labels = c("1989-1999", "2000-2009", "2010-2019")
  )) %>%
  filter(!is.na(decade),
         !is.na(offset)) %>%
  arrange(dateB)

xover_add_decade %>%
  group_by(parameter, cruise_A) %>%
  summarise(offset_mean = mean(offset, na.rm = TRUE)) %>%
  ungroup() %>%
  kable(caption = "Long-term average per cruise and parameter") %>%
  kable_styling() %>%
  scroll_box(height = "250px")
Long-term average per cruise and parameter
parameter cruise_A offset_mean
phosphate 06AQ19980328 1.0076477
phosphate 06MT19900123 0.9952731
phosphate 29AH20160617 0.9848944
phosphate 316N19920502 1.0081928
phosphate 316N19921006 1.0099657
phosphate 33MW19930704 0.9890182
phosphate 33RO19980123 0.9965710
phosphate 33RO20030604 0.9966745
phosphate 33RO20050111 1.0019318
phosphate 35TH20040604 0.9740753
talk 06AQ19980328 0.5163006
talk 06MT19900123 -3.5574819
talk 29AH20160617 1.5479474
talk 316N19920502 -4.3333542
talk 316N19921006 -1.0527798
talk 33MW19930704 -0.6041569
talk 33RO19980123 -0.8518579
talk 33RO20030604 -1.8164213
talk 33RO20050111 1.6308865
talk 35TH20040604 0.3672771
tco2 06AQ19980328 -0.5510192
tco2 06MT19900123 -2.6515513
tco2 29AH20160617 6.3313796
tco2 316N19920502 0.2705865
tco2 316N19921006 0.7551445
tco2 33MW19930704 -1.3349429
tco2 33RO19980123 0.5594899
tco2 33RO20030604 -0.7151763
tco2 33RO20050111 -0.3622474
tco2 35TH20040604 1.2796712
xover_add_decade %>%
  group_by(parameter, decade, cruise_A) %>%
  summarise(offset_mean = mean(offset, na.rm = TRUE)) %>%
  ungroup() %>%
  kable(caption = "Decadal average per cruise and parameter") %>%
  kable_styling() %>%
  scroll_box(height = "250px")
Decadal average per cruise and parameter
parameter decade cruise_A offset_mean
phosphate 1989-1999 06AQ19980328 1.0088276
phosphate 1989-1999 06MT19900123 0.9925257
phosphate 1989-1999 29AH20160617 0.9796380
phosphate 1989-1999 316N19920502 1.0067578
phosphate 1989-1999 316N19921006 1.0017277
phosphate 1989-1999 33MW19930704 0.9882398
phosphate 1989-1999 33RO19980123 0.9952849
phosphate 1989-1999 33RO20030604 1.0012928
phosphate 1989-1999 33RO20050111 1.0009821
phosphate 1989-1999 35TH20040604 0.9712452
phosphate 2000-2009 06AQ19980328 1.0053414
phosphate 2000-2009 06MT19900123 1.0010033
phosphate 2000-2009 29AH20160617 0.9899738
phosphate 2000-2009 316N19920502 1.0075795
phosphate 2000-2009 316N19921006 1.0137857
phosphate 2000-2009 33MW19930704 0.9846140
phosphate 2000-2009 33RO19980123 1.0037495
phosphate 2000-2009 33RO20030604 0.9921003
phosphate 2000-2009 33RO20050111 1.0025604
phosphate 2000-2009 35TH20040604 0.9765408
phosphate 2010-2019 06AQ19980328 1.0092836
phosphate 2010-2019 06MT19900123 0.9922316
phosphate 2010-2019 29AH20160617 0.9904749
phosphate 2010-2019 316N19920502 1.0127004
phosphate 2010-2019 316N19921006 1.0143839
phosphate 2010-2019 33MW19930704 0.9964602
phosphate 2010-2019 33RO19980123 0.9950980
phosphate 2010-2019 33RO20030604 0.9944871
phosphate 2010-2019 33RO20050111 1.0032793
phosphate 2010-2019 35TH20040604 0.9766304
talk 1989-1999 06AQ19980328 4.2986091
talk 1989-1999 06MT19900123 -1.7866112
talk 1989-1999 29AH20160617 1.5510114
talk 1989-1999 316N19920502 -0.0551690
talk 1989-1999 316N19921006 0.4878711
talk 1989-1999 33MW19930704 -0.6029753
talk 1989-1999 33RO19980123 0.1289735
talk 1989-1999 33RO20030604 -2.6727990
talk 1989-1999 33RO20050111 1.2382129
talk 1989-1999 35TH20040604 0.3314651
talk 2000-2009 06AQ19980328 -0.2162355
talk 2000-2009 06MT19900123 -4.0659303
talk 2000-2009 29AH20160617 2.3884257
talk 2000-2009 316N19920502 -4.0265274
talk 2000-2009 316N19921006 -0.9215473
talk 2000-2009 33MW19930704 -0.3195600
talk 2000-2009 33RO19980123 -5.2032065
talk 2000-2009 33RO20030604 -0.9500663
talk 2000-2009 33RO20050111 1.2662351
talk 2000-2009 35TH20040604 1.1230941
talk 2010-2019 06AQ19980328 0.7206032
talk 2010-2019 06MT19900123 -3.9344689
talk 2010-2019 29AH20160617 -0.1395747
talk 2010-2019 316N19920502 -6.9326869
talk 2010-2019 316N19921006 -2.7246632
talk 2010-2019 33MW19930704 -0.9855887
talk 2010-2019 33RO19980123 0.3001826
talk 2010-2019 33RO20030604 -1.7612909
talk 2010-2019 33RO20050111 1.8786579
talk 2010-2019 35TH20040604 -1.0676170
tco2 1989-1999 06AQ19980328 1.1144077
tco2 1989-1999 06MT19900123 -0.2131875
tco2 1989-1999 29AH20160617 8.1120081
tco2 1989-1999 316N19920502 0.1582007
tco2 1989-1999 316N19921006 0.2100602
tco2 1989-1999 33MW19930704 -0.1342253
tco2 1989-1999 33RO19980123 0.4187870
tco2 1989-1999 33RO20030604 0.8379332
tco2 1989-1999 33RO20050111 1.4562572
tco2 1989-1999 35TH20040604 2.7288076
tco2 2000-2009 06AQ19980328 -1.3551591
tco2 2000-2009 06MT19900123 -3.4099140
tco2 2000-2009 29AH20160617 6.1180167
tco2 2000-2009 316N19920502 0.5997351
tco2 2000-2009 316N19921006 0.8386702
tco2 2000-2009 33MW19930704 -1.6191444
tco2 2000-2009 33RO19980123 1.0463619
tco2 2000-2009 33RO20030604 -1.2259491
tco2 2000-2009 33RO20050111 1.0973981
tco2 2000-2009 35TH20040604 1.2641341
tco2 2010-2019 06AQ19980328 -1.1823577
tco2 2010-2019 06MT19900123 -3.9523709
tco2 2010-2019 29AH20160617 1.1923250
tco2 2010-2019 316N19920502 -0.1669434
tco2 2010-2019 316N19921006 1.2167030
tco2 2010-2019 33MW19930704 -3.8756236
tco2 2010-2019 33RO19980123 0.4491628
tco2 2010-2019 33RO20030604 -2.5484791
tco2 2010-2019 33RO20050111 -2.0013224
tco2 2010-2019 35TH20040604 -3.0344442
xover_add_decade %>%
  filter(cruise_A %in% cruises_talk_calc,
         parameter == "talk") %>% 
  group_by(parameter, decade, cruise_A) %>%
  summarise(offset_mean = mean(offset, na.rm = TRUE)) %>%
  ungroup() %>%
  kable(caption = "Decadal talk average per cruise") %>%
  kable_styling() %>%
  scroll_box(height = "250px")
Decadal talk average per cruise
parameter decade cruise_A offset_mean
talk 1989-1999 06MT19900123 -1.7866112
talk 1989-1999 316N19920502 -0.0551690
talk 1989-1999 316N19921006 0.4878711
talk 2000-2009 06MT19900123 -4.0659303
talk 2000-2009 316N19920502 -4.0265274
talk 2000-2009 316N19921006 -0.9215473
talk 2010-2019 06MT19900123 -3.9344689
talk 2010-2019 316N19920502 -6.9326869
talk 2010-2019 316N19921006 -2.7246632
xover_add_decade %>%
  filter(cruise_A %in% cruises_talk_calc,
         parameter == "talk") %>% 
  group_by(parameter, decade) %>%
  summarise(offset_mean = mean(offset, na.rm = TRUE)) %>%
  ungroup() %>%
  kable(caption = "Decadal talk average") %>%
  kable_styling() %>%
  scroll_box(height = "250px")
Decadal talk average
parameter decade offset_mean
talk 1989-1999 -0.7851301
talk 2000-2009 -3.6581063
talk 2010-2019 -4.6182733
xover_add_decade %>%
  filter(cruise_A %in% cruises_talk_calc,
         parameter == "talk") %>% 
  group_by(parameter) %>%
  summarise(offset_mean = mean(offset, na.rm = TRUE)) %>%
  ungroup() %>%
  kable(caption = "talk average") %>%
  kable_styling() %>%
  scroll_box(height = "250px")
talk average
parameter offset_mean
talk -3.407015
xover_add_decade %>%
  filter(cruise_A %in% cruises_talk_calc,
         parameter == "talk") %>% 
  group_by(parameter, cruise_A) %>%
  summarise(offset_mean = mean(offset, na.rm = TRUE)) %>%
  ungroup() %>%
  kable(caption = "talk average per cruise") %>%
  kable_styling() %>%
  scroll_box(height = "250px")
talk average per cruise
parameter cruise_A offset_mean
talk 06MT19900123 -3.557482
talk 316N19920502 -4.333354
talk 316N19921006 -1.052780
hline_intercept <- hline_intercept %>% 
  filter(parameter %in% unique(xover_add_decade$parameter))


p_crossover_ts <- xover_add_decade %>%
  ggplot(aes(dateB, offset)) +
  geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
  geom_point(shape = 21) +
  scale_color_brewer(palette = "Set1") +
  facet_grid(parameter ~ ., scales = "free_y") +
  theme(
    legend.position = "bottom",
    legend.direction = "vertical",
    axis.title.x = element_blank()
  )

p_crossover_decadal <-
  ggplot() +
  geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
  geom_violin(data = xover_add_decade,
               aes(x = decade, y = offset), fill="gold") +
  geom_boxplot(data = xover_add_decade,
               aes(x = decade, y = offset),
               width = 0.2) +
  facet_grid(parameter ~ ., scales = "free_y") +
  labs(title = "Decadal offsets") +
  theme(axis.title.x = element_blank(),
        axis.text.x = element_text(angle = 90))


p_crossover_ts + p_crossover_decadal +
  plot_layout(widths = c(2, 1))

Version Author Date
ecc669f jens-daniel-mueller 2022-01-04
494beda jens-daniel-mueller 2022-01-03

13.1 Gap filling

GLODAP <- left_join(GLODAP,
                    GLODAP_CB %>% 
                      select(row_number, ends_with("_CANYONB")))

# fill missing phosphate with CANYON-B estimate

GLODAP_phosphate_fill <- GLODAP %>%
  filter(cruise_expocode %in% cruises_phosphate_gap_fill,
         is.na(phosphate),
         oxygenqc == 1)

GLODAP_phosphate_fill <- GLODAP_phosphate_fill %>% 
  mutate(phosphate = phosphate_CANYONB) %>% 
  filter(!is.na(phosphate))

map +
  geom_tile(data = GLODAP_phosphate_fill %>%
              distinct(lon, lat, cruise_expocode),
            aes(lon, lat, fill = cruise_expocode)) +
  scale_fill_brewer(palette = "Set1")

Version Author Date
494beda jens-daniel-mueller 2022-01-03
for (i_cruise in cruises_phosphate_gap_fill) {
  # i_cruise <- cruises_phosphate_gap_fill[1]
  
  p_crossover_ts <- xover_add_decade %>%
    filter(cruise_A %in% i_cruise) %>%
    ggplot(aes(dateB, offset)) +
    geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
    geom_point(shape = 21) +
    scale_color_brewer(palette = "Set1") +
    facet_grid(parameter ~ ., scales = "free_y") +
    labs(title = i_cruise) +
    theme(
      legend.position = "bottom",
      legend.direction = "vertical",
      axis.title.x = element_blank()
    )
  
  p_crossover_decadal <-
    ggplot() +
    geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
    geom_violin(
      data = xover_add_decade %>%
        filter(cruise_A %in% i_cruise),
      aes(x = decade, y = offset),
      fill = "gold"
    ) +
    geom_boxplot(
      data = xover_add_decade %>%
        filter(cruise_A %in% i_cruise),
      aes(x = decade, y = offset),
      width = 0.2
    ) +
    facet_grid(parameter ~ ., scales = "free_y") +
    theme(axis.title.x = element_blank(),
          axis.text.x = element_text(angle = 90))
  
  print(
  p_crossover_ts + p_crossover_decadal +
    plot_layout(widths = c(2, 1))
  )
  
}

Version Author Date
1a9c797 jens-daniel-mueller 2022-01-03
494beda jens-daniel-mueller 2022-01-03

Version Author Date
1a9c797 jens-daniel-mueller 2022-01-03
494beda jens-daniel-mueller 2022-01-03

Version Author Date
1a9c797 jens-daniel-mueller 2022-01-03
494beda jens-daniel-mueller 2022-01-03

Version Author Date
1a9c797 jens-daniel-mueller 2022-01-03
494beda jens-daniel-mueller 2022-01-03
# fill missing talk with CANYON-B estimate

GLODAP_talk_fill <- GLODAP %>%
  filter(cruise_expocode %in% cruises_talk_gap_fill,
         is.na(talk),
         oxygenqc == 1)

GLODAP_talk_fill <- GLODAP_talk_fill %>% 
  mutate(talk = talk_CANYONB) %>% 
  filter(!is.na(talk))


map +
  geom_tile(data = GLODAP_talk_fill %>%
              distinct(lon, lat, cruise_expocode),
            aes(lon, lat, fill = cruise_expocode)) +
  scale_fill_brewer(palette = "Set1")

Version Author Date
494beda jens-daniel-mueller 2022-01-03
for (i_cruise in cruises_talk_gap_fill) {
  # i_cruise <- cruises_phosphate_gap_fill[1]
  
  p_crossover_ts <- xover_add_decade %>%
    filter(cruise_A %in% i_cruise) %>%
    ggplot(aes(dateB, offset)) +
    geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
    geom_point(shape = 21) +
    scale_color_brewer(palette = "Set1") +
    facet_grid(parameter ~ ., scales = "free_y") +
    labs(title = i_cruise) +
    theme(
      legend.position = "bottom",
      legend.direction = "vertical",
      axis.title.x = element_blank()
    )
  
  p_crossover_decadal <-
    ggplot() +
    geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
    geom_violin(
      data = xover_add_decade %>%
        filter(cruise_A %in% i_cruise),
      aes(x = decade, y = offset),
      fill = "gold"
    ) +
    geom_boxplot(
      data = xover_add_decade %>%
        filter(cruise_A %in% i_cruise),
      aes(x = decade, y = offset),
      width = 0.2
    ) +
    facet_grid(parameter ~ ., scales = "free_y") +
    theme(axis.title.x = element_blank(),
          axis.text.x = element_text(angle = 90))
  
  print(p_crossover_ts + p_crossover_decadal +
          plot_layout(widths = c(2, 1)))
  
}

Version Author Date
1a9c797 jens-daniel-mueller 2022-01-03
494beda jens-daniel-mueller 2022-01-03
GLODAP_gap_fill <- bind_rows(
  GLODAP_phosphate_fill,
  GLODAP_talk_fill
)

13.2 Flagging

GLODAP_tco2_calc <- GLODAP %>% 
  filter(cruise_expocode %in% cruises_tco2_calc,
         tco2f == 0)


map +
  geom_tile(data = GLODAP_tco2_calc %>%
              distinct(lon, lat, cruise_expocode),
            aes(lon, lat, fill = cruise_expocode)) +
  scale_fill_brewer(palette = "Set1")

Version Author Date
494beda jens-daniel-mueller 2022-01-03
for (i_cruise in cruises_tco2_calc) {
  # i_cruise <- cruises_phosphate_gap_fill[1]
  
  p_crossover_ts <- xover_add_decade %>%
    filter(cruise_A %in% i_cruise) %>%
    ggplot(aes(dateB, offset)) +
    geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
    geom_point(shape = 21) +
    scale_color_brewer(palette = "Set1") +
    facet_grid(parameter ~ ., scales = "free_y") +
    labs(title = i_cruise) +
    theme(
      legend.position = "bottom",
      legend.direction = "vertical",
      axis.title.x = element_blank()
    )
  
  p_crossover_decadal <-
    ggplot() +
    geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
    geom_violin(
      data = xover_add_decade %>%
        filter(cruise_A %in% i_cruise),
      aes(x = decade, y = offset),
      fill = "gold"
    ) +
    geom_boxplot(
      data = xover_add_decade %>%
        filter(cruise_A %in% i_cruise),
      aes(x = decade, y = offset),
      width = 0.2
    ) +
    facet_grid(parameter ~ ., scales = "free_y") +
    theme(axis.title.x = element_blank(),
          axis.text.x = element_text(angle = 90))
  
  print(p_crossover_ts + p_crossover_decadal +
          plot_layout(widths = c(2, 1)))
  
}

Version Author Date
1a9c797 jens-daniel-mueller 2022-01-03
494beda jens-daniel-mueller 2022-01-03

Version Author Date
1a9c797 jens-daniel-mueller 2022-01-03
494beda jens-daniel-mueller 2022-01-03
GLODAP_talk_calc <- GLODAP %>% 
  filter(cruise_expocode %in% cruises_talk_calc,
         talkf == 0)


map +
  geom_tile(data = GLODAP_talk_calc %>%
              distinct(lon, lat, cruise_expocode),
            aes(lon, lat, fill = cruise_expocode)) +
  scale_fill_brewer(palette = "Set1")

Version Author Date
494beda jens-daniel-mueller 2022-01-03
for (i_cruise in cruises_talk_calc) {
  # i_cruise <- cruises_phosphate_gap_fill[1]
  
  p_crossover_ts <- xover_add_decade %>%
    filter(cruise_A %in% i_cruise) %>%
    ggplot(aes(dateB, offset)) +
    geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
    geom_point(shape = 21) +
    scale_color_brewer(palette = "Set1") +
    facet_grid(parameter ~ ., scales = "free_y") +
    labs(title = i_cruise) +
    theme(
      legend.position = "bottom",
      legend.direction = "vertical",
      axis.title.x = element_blank()
    )
  
  p_crossover_decadal <-
    ggplot() +
    geom_hline(data = hline_intercept, aes(yintercept = intercept)) +
    geom_violin(
      data = xover_add_decade %>%
        filter(cruise_A %in% i_cruise),
      aes(x = decade, y = offset),
      fill = "gold"
    ) +
    geom_boxplot(
      data = xover_add_decade %>%
        filter(cruise_A %in% i_cruise),
      aes(x = decade, y = offset),
      width = 0.2
    ) +
    facet_grid(parameter ~ ., scales = "free_y") +
    theme(axis.title.x = element_blank(),
          axis.text.x = element_text(angle = 90))
  
  print(
  p_crossover_ts + p_crossover_decadal +
    plot_layout(widths = c(2, 1))
  )
    
}

Version Author Date
1a9c797 jens-daniel-mueller 2022-01-03
494beda jens-daniel-mueller 2022-01-03

Version Author Date
1a9c797 jens-daniel-mueller 2022-01-03
494beda jens-daniel-mueller 2022-01-03

Version Author Date
1a9c797 jens-daniel-mueller 2022-01-03
494beda jens-daniel-mueller 2022-01-03
GLODAP_calc <- bind_rows(
  GLODAP_tco2_calc,
  GLODAP_talk_calc
)

13.3 Write files

GLODAP_crossover <- bind_rows(
  GLODAP_gap_fill,
  GLODAP_calc
) 

GLODAP_crossover_write <- GLODAP_crossover %>% 
  select(
    EXPOCODE = cruise_expocode,
    STNNBR = station,
    CASTNO = cast,
    BTLNBR = bottle,
    DATE = date,
    LATITUDE = lat,
    LONGITUDE = lon,
    CTDPRS = pressure,
    CTDTMP = temp,
    CTDSAL = sal,
    CTDSAL_FLAG_W = salinityf,
    PHSPHT = phosphate,
    PHSPHT_FLAG_W = phosphatef,
    TCARBN = tco2,
    TCARBN_FLAG_W = tco2f,
    ALKALI = talk,
    ALKALI_FLAG_W = talkf)

GLODAP_crossover_write <- GLODAP_crossover_write %>% 
  mutate(DATE = format(DATE,  "%Y%m%d"))


last_line <- "END_DATA"

for (i_EXPOCODE in unique(GLODAP_crossover_write$EXPOCODE)) {
  # i_EXPOCODE <- unique(GLODAP_crossover_write$EXPOCODE)[1]
  
  temp <- GLODAP_crossover_write %>%
    filter(EXPOCODE == i_EXPOCODE) %>%
    add_row(.before = 1)
  
  cat("Bottle",
      "\n",
      file = paste0(
        path_preprocessing,
        "crossover_cruises/",
        i_EXPOCODE,
        ".exc.csv"
      )
    )
  
  temp %>%
    write_csv(
      file = paste0(
        path_preprocessing,
        "crossover_cruises/",
        i_EXPOCODE,
        ".exc.csv"
      ),
      na = "",
      append = TRUE,
      col_names = TRUE
    )
  
  write(
    last_line,
    file = paste0(
      path_preprocessing,
      "crossover_cruises/",
      i_EXPOCODE,
      ".exc.csv"
    ),
    append = TRUE
  )
  
  
}

sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: openSUSE Leap 15.3

Matrix products: default
BLAS:   /usr/local/R-4.1.2/lib64/R/lib/libRblas.so
LAPACK: /usr/local/R-4.1.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] kableExtra_1.3.4 ggrepel_0.9.1    lubridate_1.8.0  ggforce_0.3.3   
 [5] metR_0.11.0      scico_1.3.0      patchwork_1.1.1  collapse_1.7.0  
 [9] forcats_0.5.1    stringr_1.4.0    dplyr_1.0.7      purrr_0.3.4     
[13] readr_2.1.1      tidyr_1.1.4      tibble_3.1.6     ggplot2_3.3.5   
[17] tidyverse_1.3.1  workflowr_1.7.0 

loaded via a namespace (and not attached):
 [1] nlme_3.1-155       fs_1.5.2           bit64_4.0.5        RColorBrewer_1.1-2
 [5] webshot_0.5.2      httr_1.4.2         rprojroot_2.0.2    tools_4.1.2       
 [9] backports_1.4.1    bslib_0.3.1        utf8_1.2.2         R6_2.5.1          
[13] mgcv_1.8-38        DBI_1.1.2          colorspace_2.0-2   withr_2.4.3       
[17] tidyselect_1.1.1   processx_3.5.2     bit_4.0.4          compiler_4.1.2    
[21] git2r_0.29.0       cli_3.1.1          rvest_1.0.2        xml2_1.3.3        
[25] labeling_0.4.2     sass_0.4.0         scales_1.1.1       checkmate_2.0.0   
[29] callr_3.7.0        systemfonts_1.0.3  digest_0.6.29      svglite_2.0.0     
[33] rmarkdown_2.11     pkgconfig_2.0.3    htmltools_0.5.2    highr_0.9         
[37] dbplyr_2.1.1       fastmap_1.1.0      rlang_0.4.12       readxl_1.3.1      
[41] rstudioapi_0.13    jquerylib_0.1.4    generics_0.1.1     farver_2.1.0      
[45] jsonlite_1.7.3     vroom_1.5.7        magrittr_2.0.1     Matrix_1.4-0      
[49] Rcpp_1.0.8         munsell_0.5.0      fansi_1.0.2        lifecycle_1.0.1   
[53] stringi_1.7.6      whisker_0.4        yaml_2.2.1         MASS_7.3-55       
[57] grid_4.1.2         parallel_4.1.2     promises_1.2.0.1   crayon_1.4.2      
[61] lattice_0.20-45    splines_4.1.2      haven_2.4.3        hms_1.1.1         
[65] knitr_1.37         ps_1.6.0           pillar_1.6.4       reprex_2.0.1      
[69] glue_1.6.0         evaluate_0.14      getPass_0.2-2      data.table_1.14.2 
[73] modelr_0.1.8       vctrs_0.3.8        tzdb_0.2.0         tweenr_1.0.2      
[77] httpuv_1.6.5       cellranger_1.1.0   gtable_0.3.0       polyclip_1.10-0   
[81] assertthat_0.2.1   xfun_0.29          broom_0.7.11       later_1.3.0       
[85] viridisLite_0.4.0  ellipsis_0.3.2