# gsw_SP_from_SA

`Practical Salinity from Absolute Salinity`

## USAGE:

`[SP, in_ocean] = gsw_SP_from_SA(SA,p,long,lat)`

## DESCRIPTION:

`Calculates Practical Salinity from Absolute Salinity.`
 ```Click for a more detailed description of calculating Practical Salinity from Absolute Salinity.```

## INPUT:

```SA    =  Absolute Salinity                                      [ g/kg ]
p     =  sea pressure                                           [ dbar ]
( ie. absolute pressure - 10.1325 dbar )
long  =  longitude in decimal degrees                     [ 0 ... +360 ]
or  [ -180 ... +180 ]
lat   =  latitude in decimal degrees north               [ -90 ... +90 ]```
```p, lat and long may have dimensions 1x1 or Mx1 or 1xN or MxN,
where SA is MxN.```

## OUTPUT:

```SP        =  Practical Salinity  (PSS-78)                  [ unitless ]
in_ocean  =  0, if long and lat are a long way from the ocean
=  1, if long and lat are in the ocean
Note. This flag is only set when the observation is well and truly on
dry land; often the warning flag is not set until one is several
hundred kilometres inland from the coast.
```

## EXAMPLE:

```SA =   [34.7118; 34.8915; 35.0256; 34.8472; 34.7366; 34.7324;]
p =    [     10;      50;     125;     250;     600;    1000;]
lat =  [      4;       4;       4;       4;       4;       4;]
long = [    188;     188;     188;     188;     188;     188;]```
```If the profile data refers to one location (one station)
is it acceptable to enter the station location once. (i.e. the
following will produce the same result as the input above).```
```SA =   [34.7118; 34.8915; 35.0256; 34.8472; 34.7366; 34.7324;]
p =    [     10;      50;     125;     250;     600;    1000;]
lat =  4;
long = 188;```
`[SP, in_ocean] = gsw_SP_from_SA(SA,p,long,lat)`
`SP =                             in_ocean =`
```  34.548721553448317                  1
34.727477488096639                  1
34.860554877708005                  1
34.680971112271791                  1
34.567971663653388                  1
34.560036751118204                  1```

## AUTHOR:

`David Jackett, Trevor McDougall and Paul Barker    [ help@teos-10.org ]`

## VERSION NUMBER:

`3.05 (16th February, 2015)`

## REFERENCES:

```IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
seawater - 2010: Calculation and use of thermodynamic properties.
Intergovernmental Oceanographic Commission, Manuals and Guides No. 56,
UNESCO (English), 196 pp.  Available from the TEOS-10 web site.
See section 2.5 and appendices A.4 and A.5 of this TEOS-10 Manual.```
```McDougall, T.J., D.R. Jackett, F.J. Millero, R. Pawlowicz and
P.M. Barker, 2012: A global algorithm for estimating Absolute Salinity.
Ocean Science, 8, 1123-1134.
http://www.ocean-sci.net/8/1123/2012/os-8-1123-2012.pdf```
`The software is available from http://www.TEOS-10.org`