# gsw_geo_strf_isopycnal_pc

    approximate isopycnal geostrophic streamfunction
    for piecewise constant profiles

## Contents

- USAGE:
- DESCRIPTION:
- INPUT:
- OUTPUT:
- EXAMPLE:
- AUTHOR:
- VERSION NUMBER:
- REFERENCES:

## USAGE:

    [geo_strf_McD_Klocker_pc, p_mid] = gsw_geo_strf_isopycnal_pc(SA,CT,delta_p,gamma_n,layer_indx,A)

## DESCRIPTION:

    Calculates the McDougall-Klocker geostrophic streamfunction (see Eqn.
    (3.30.1) of IOC et al. (2010).  This function is to used when the
    Absolute Salinity and Conservative Temperature are piecewise constant in
    the vertical over sucessive pressure intervals of delta_p (such as in a
    forward "z-coordinate" ocean model, and in isopycnal layered ocean
    models).  The McDougall-Klocker geostrophic streamfunction is designed
    to be used as the geostrophic streamfunction in an approximately neutral
    surface (such as a Neutral Density surface, a potential density surface
    or an omega surface (Klocker et al. (2009)).  Reference values of
    Absolute Salinity, Conservative Temperature and pressure are found by
    interpolation of a one-dimensional look-up table, with the interpolating
    variable being Neutral Density (gamma_n) or sigma_2.  This function
    calculates specific volume anomaly using the computationally efficient
    48-term expression for specific volume of McDougall et al. (2013).

    Click for a more detailed description of the
    isopycnal geostrophic streamfunction
    for piecewise constant profiles

## INPUT:

    SA         =  Absolute Salinity                                 [ g/kg ]
    CT         =  Conservative Temperature                         [ deg C ]
    delta_p    =  difference in sea pressure between the deep and shallow
                  extents of each layer in which SA and CT are vertically
                  constant.  delta_p must be positive.              [ dbar ]
    Note. Sea pressure is absolute pressure minus 10.1325 dbar.

    gamma_n    =  Neutral Density anomaly                         [ kg/m^3 ]
                  ( i.e. Neutral Density minus 1000 kg/m^3 )
    layer_indx =  Index of the layers of the gamma_n surfaces

    OPTIONAL:

    A          =  if nothing is entered the programme defaults to "Neutral
                  Density" as the vertical interpolating variable.
               =  's2' or 'sigma2', for sigma_2 as the vertical interpolating
                  variable.

    SA, CT & delta_p need to have the same dimensions.
    gamma_n & layer_indx need to have the same dimensions, there should be
    only one "gamma_n" or "sigma_2" value per level of interest.
    A needs to be 1x1.

## OUTPUT:

    geo_strf_isopycnal_pc =  isopycnal geostrophic               [ m^2/s^2 ]
                             streamfunction as defined by
                             McDougall & Klocker (2010)
    p_mid                 =  mid-point pressure in each layer       [ dbar ]

## EXAMPLE:

    SA      = [34.7118; 34.8915; 35.0256; 34.8472; 34.7366; 34.7324;]
    CT      = [28.8099; 28.4392; 22.7862; 10.2262;  6.8272;  4.3236;]
    delta_p = [     10;      40;      75;     125;     350;     400;]

    gamma_n     = [26.7; 27.8;]
    layer_indx  = [   3;    5;]

    [geo_strf_isopycnal_pc, p_mid] = ...
                gsw_geo_strf_isopycnal_pc(SA,CT,delta_p,gamma_n,layer_indx)

    geo_strf_isopycnal_pc =

       -5.270210120033314
      -10.377557395801716

    p_mid =

      1.0e+002 *

       0.875000000000000
       4.250000000000000

## AUTHOR:

    Trevor McDougall and Paul Barker                    [ help@teos-10.org ]

## VERSION NUMBER:

    3.02 (17th November, 2012)

## 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 3.30 of this TEOS-10 Manual.

    Jackett, D. R. and T. J. McDougall, 1997: A neutral density variable
     for the world’s oceans. Journal of Physical Oceanography, 27, 237-263.

    Klocker, A., T. J. McDougall and D. R. Jackett, 2009: A new method
     for forming approximately neutral surfaces.  Ocean Sci., 5, 155-172.

    McDougall T.J., P.M. Barker, R. Feistel and D.R. Jackett, 2013:  A
     computationally efficient 48-term expression for the density of
     seawater in terms of Conservative Temperature, and related properties
     of seawater.  To be submitted to J. Atm. Ocean. Technol., xx, yyy-zzz.

    McDougall, T. J. and A. Klocker, 2010: An approximate geostrophic
     streamfunction for use in density surfaces.  Ocean Modelling, 32,
     105-117.
      The McDougall-Klocker geostrophic streamfunction is defined in
     Eqn. (62) of this paper.
      See section 8 of this paper for a discussion of this piecewise-
     constant version of the McDougall-Klocker geostrophic streamfunction.

    The software is available from http://www.TEOS-10.org