Gibbs Sea Water Functions

Provides an interface to the Gibbs 'SeaWater' ('TEOS-10') C library, version 3.05-4 (commit '5b4d959e54031f9e972f3e863f63e67fa4f5bfec', dated 2017-08-07, available at <>, which stems from 'Matlab' and other code written by members of Working Group 127 of 'SCOR'/'IAPSO' (Scientific Committee on Oceanic Research / International Association for the Physical Sciences of the Oceans).

Build Status codecov RStudio CRAN mirror downloads RStudio CRAN mirror downloads RStudio CRAN mirror downloads

gsw is an R package that provides a connection to the thermodynamic equation of seawater as defined at An earlier version of gsw was referenced to TEOS-10 version 3.03, but the present one is referenced to version 3.05-4, which is current as of Aug 7, 2017. See the CRAN website for check statistics, etc.

All the gsw functions reproduce test values to a tolerance of 1.5e-8, the default for numerical comparison in R working on a 64-bit machine. (The tests are part of the package-building process, as is usual in R.)

Function names, as well as most argument names, match those used in the TEOS-10 documentation.



  • use GSW-C version 3.05-4
  • make internal sort routines be machine-independent


  • use GSW-C version 3.05-3
  • handle NaN values better
  • add dozens of new GSW functions


  • first version, using GSW version 3.03

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.0-5 by Dan Kelley, 4 years ago

Report a bug at

Browse source code at

Authors: Dan Kelley [aut, cre, cph] (C wrapper plus R code , tests , and documentation) , Clark Richards [aut, cph] (C wrapper plus R code , tests , and documentation) , WG127 SCOR/IAPSO [aut, cph] (Original 'Matlab' and derived code)

Documentation:   PDF Manual  

GPL (>= 2) | file LICENSE license

Depends on testthat

Suggests knitr

Imported by vprr.

Depended on by oce, seacarb.

See at CRAN