Compute in-situ freezing temperature of seawater, using either the UNESCO formulation (computed as in Section 5 of Fofonoff and Millard, 1983) or the GSW formulation (computed by using gsw::gsw_SA_from_SP() to get Absolute Salinity, and then gsw::gsw_t_freezing() to get the freezing temperature).

  pressure = NULL,
  longitude = NULL,
  latitude = NULL,
  saturation_fraction = 1,
  eos = getOption("oceEOS", default = "gsw")



Either practical salinity (PSU) or a ctd object from which practical salinity and pressure (plus in the eos="gsw" case, longitude and latitude) are inferred.


Seawater pressure (dbar).


Longitude of observation (only used if eos="gsw"; see “Details”).


Latitude of observation (only used if eos="gsw"; see “Details”).


The saturation fraction of dissolved air in seawater, ignored if eos="unesco").


The equation of state, either "unesco" (Fofonoff and Millard, 1983; Gill 1982) or "gsw" (IOC, SCOR and IAPSO 2010; McDougall and Barker 2011).


Temperature (degC), defined on the ITS-90 scale.


If the first argument is an oce object, and if the pressure argument is NULL, then the pressure is sought within the first argument. In the case of eos="gsw", then a similar procedure also applies to the longitude and latitude arguments.


Fofonoff, N. P., and R. C. Millard. Algorithms for Computation of Fundamental Properties of Seawater. UNESCO Technical Papers in Marine Research. SCOR working group on Evaluation of CTD data; UNESCO/ICES/SCOR/IAPSO Joint Panel on Oceanographic Tables and Standards, 1983.

Gill, A E. Atmosphere-Ocean Dynamics. New York, NY, USA: Academic Press, 1982.

IOC, SCOR, and IAPSO (2010). The international thermodynamic equation of seawater-2010: Calculation and use of thermodynamic properties. Technical Report 56, Intergovernmental Oceanographic Commission, Manuals and Guide, 2010.

McDougall, Trevor J., and Paul M. Barker. Getting Started with TEOS-10 and the Gibbs Seawater (GSW) Oceanographic Toolbox. SCOR/IAPSO WG127, 2011.


Dan Kelley


# 1. Test for a check-value given in reference 1. This value, -2.588567 degC,
# is in the 1968 temperature scale (IPTS-68), but swTFreeze reports
# in the newer ITS-90 scale, so we must convert before checking.
Tcheck <- -2.588567 # IPTS-68
T <- swTFreeze(salinity = 40, pressure = 500, eos = "unesco")
stopifnot(abs(Tcheck - T68fromT90(T)) < 1e-6)

# 2. Compare unesco and gsw formulations.
p <- ctd[["pressure"]]
par(mfrow = c(1, 2), mar = c(3, 3, 1, 2), mgp = c(2, 0.7, 0))
plot(swTFreeze(ctd, eos = "unesco"),
    xlab = "unesco", ylim = rev(range(p))
plot(swTFreeze(ctd, eos = "unesco") - swTFreeze(ctd, eos = "gsw"),
    xlab = "unesco-gsw", ylim = rev(range(p))