      function a=atg(S,T,P) 
%      function a=atg(S,T,P)
%
% ***************************************************************
% ADIABATIC TEMPERATURE GRADIENT DEG C PER DECIBAR
% REF: BRYDEN,H.,1973,DEEP-SEA RES.,20,401-408
% ***
% UNITS:      
%       PRESSURE        P        DECIBARS
%       TEMPERATURE     T        DEG CELSIUS (IPTS-68)
%       SALINITY        S        (IPSS-78)
%       ADIABATIC       ATG      DEG. C/DECIBAR
% ***
% CHECKVALUE: ATG=3.255976E-4 C/DBAR FOR S=40 (IPSS-78),
% T=40 DEG C,P0=10000 DECIBARS
% ***
      DS = S - 35.0;
      a = (((-2.1687E-16*T+1.8676E-14).*T-4.6206E-13).*P...
     +((2.7759E-12*T-1.1351E-10).*DS+((-5.4481E-14*T...
     +8.733E-12).*T-6.7795E-10).*T+1.8741E-8)).*P;
     % Expression is broken here to keep the line length in bounds.

     a = a+(-4.2393E-8.*T+1.8932E-6).*DS...
     +((6.6228E-10*T-6.836E-8).*T+8.5258E-6).*T+3.5803E-5;
