Skip to content

Commit

Permalink
Version 3.01
Browse files Browse the repository at this point in the history
Bug fix in gsw_SA_Sstar_from_SP (line 182).
  • Loading branch information
PaulMBarker committed May 29, 2015
1 parent c5b91a1 commit d276f56
Show file tree
Hide file tree
Showing 184 changed files with 812 additions and 1,492 deletions.
4 changes: 2 additions & 2 deletions Toolbox/gsw_Abs_Pressure_from_p.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
% Absolute_Pressure = Absolute Pressure [ Pa ]
%
% AUTHOR:
% Trevor McDougall and Paul Barker [ help_gsw@csiro.au ]
% Trevor McDougall and Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (29th March, 2011)
% VERSION NUMBER: 3.01 (29th March, 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_C3515.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
% C3515 = Conductivity at (SP=35, t_68=15, p=0) [ mS/cm ]
%
% AUTHOR:
% Trevor McDougall and Paul Barker [ help_gsw@csiro.au ]
% Trevor McDougall and Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (29th March, 2011)
% VERSION NUMBER: 3.01 (29th March, 2011)
%
% REFERENCES:
% Culkin and Smith, 1980: Determination of the Concentration of Potassium
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_CT_first_derivatives.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
% at constant SA. CT_pt is dimensionless. [ unitless ]
%
% AUTHOR:
% Trevor McDougall and Paul Barker [ help_gsw@csiro.au ]
% Trevor McDougall and Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (11th April 2011)
% VERSION NUMBER: 3.01 (11th April 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
2 changes: 1 addition & 1 deletion Toolbox/gsw_CT_freezing.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
% AUTHOR:
% Trevor McDougall, Paul Barker and Rainer Feistal [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (4th November, 2011)
% VERSION NUMBER: 3.01 (4th November, 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_CT_from_entropy.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
% CT = Conservative Temperature (ITS-90) [ deg C ]
%
% AUTHOR:
% Trevor McDougall and Paul Barker. [ help_gsw@csiro.au ]
% Trevor McDougall and Paul Barker. [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (3rd March, 2011)
% VERSION NUMBER: 3.01 (3rd March, 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_CT_from_pt.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
% CT = Conservative Temperature (ITS-90) [ deg C ]
%
% AUTHOR:
% David Jackett, Trevor McDougall and Paul Barker [ help_gsw@csiro.au ]
% David Jackett, Trevor McDougall and Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (29th March, 2011)
% VERSION NUMBER: 3.01 (29th March, 2011)
% This function is unchanged from version 2.0 (24th September, 2010).
%
% REFERENCES:
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_CT_from_rho.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
% called with two outputs the second variable will be set to NaN.
%
% AUTHOR:
% Trevor McDougall & Paul Barker [ help_gsw@csiro.au ]
% Trevor McDougall & Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (21th April, 2011)
% VERSION NUMBER: 3.01 (21th April, 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_CT_from_rho_exact.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
% outputs the second variable will be set to NaN.
%
% AUTHOR:
% Trevor McDougall & Paul Barker [ help_gsw@csiro.au ]
% Trevor McDougall & Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (21th April, 2011)
% VERSION NUMBER: 3.01 (21th April, 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_CT_from_t.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
% CT = Conservative Temperature (ITS-90) [ deg C ]
%
% AUTHOR:
% David Jackett, Trevor McDougall and Paul Barker [ help_gsw@csiro.au ]
% David Jackett, Trevor McDougall and Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (27th March, 2011)
% VERSION NUMBER: 3.01 (27th March, 2011)
% This function is unchanged from version 2.0 (24th September, 2010).
%
% REFERENCES:
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_CT_maxdensity.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
% given Absolute Salinity and pressure.
%
% AUTHOR:
% Trevor McDougall & Paul Barker [ help_gsw@csiro.au ]
% Trevor McDougall & Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (3rd April, 2011)
% VERSION NUMBER: 3.01 (3rd April, 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_CT_maxdensity_exact.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
% given Absolute Salinity and pressure.
%
% AUTHOR:
% Trevor McDougall & Paul Barker [ help_gsw@csiro.au ]
% Trevor McDougall & Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (3rd April, 2011)
% VERSION NUMBER: 3.01 (3rd April, 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_CT_second_derivatives.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
% CT_pt_pt has units of: [ 1/K ]
%
% AUTHOR:
% Trevor McDougall and Paul Barker [ help_gsw@csiro.au ]
% Trevor McDougall and Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (29th March, 2011)
% VERSION NUMBER: 3.01 (29th March, 2011)
% This function is unchanged from version 2.0 (24th September, 2010).
%
% REFERENCES:
Expand Down
6 changes: 3 additions & 3 deletions Toolbox/gsw_C_from_SP.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
% C = conductivity [ mS/cm ]
%
% AUTHOR:
% Trevor McDougall, Paul Barker and Rich Pawlowicz [ help_gsw@csiro.au ]
% Trevor McDougall, Paul Barker and Rich Pawlowicz [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (1st April, 2011)
% VERSION NUMBER: 3.01 (1st April, 2011)
%
% REFERENCES:
% Hill, K.D., T.M. Dauphinee and D.J. Woods, 1986: The extension of the
Expand All @@ -57,7 +57,7 @@
% See appendix E of this TEOS-10 Manual.
%
% Unesco, 1983: Algorithms for computation of fundamental properties of
% seawater. Unesco Technical Papers in Marine Science, 44, 53 pp.
% seawater. Unesco Technical Papers in Marine Science, 44, 53 pp.
%
% The software is available from http://www.TEOS-10.org
%
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_Helmholtz_energy_t_exact.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
% Helmholtz_energy_t_exact = Helmholtz energy [ J/kg ]
%
% AUTHOR:
% Trevor McDougall [ help_gsw@csiro.au ]
% Trevor McDougall [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (29th March, 2011)
% VERSION NUMBER: 3.01 (29th March, 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_IPV_vs_fNsquared_ratio.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
% That is, p_mid is on a (M-1)xN grid. [ dbar ]
%
% AUTHOR:
% Trevor McDougall and Paul Barker [ help_gsw@csiro.au ]
% Trevor McDougall and Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (23rd March, 2011)
% VERSION NUMBER: 3.01 (23rd March, 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_Nsquared.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
% p_mid = Mid pressure between p grid (M-1xN) [ dbar ]
%
% AUTHOR:
% Trevor McDougall and Paul Barker [ help_gsw@csiro.au ]
% Trevor McDougall and Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (22nd March, 2011)
% VERSION NUMBER: 3.01 (22nd March, 2011)
%
% REFERENCES:
% Griffies, S. M., 2004: Fundamentals of Ocean Climate Models. Princeton,
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_P0.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
% P0 = Absolute Pressure of one standard atmosphere. [ Pa ]
%
% AUTHOR:
% Trevor McDougall and Paul Barker [ help_gsw@csiro.au ]
% Trevor McDougall and Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (29th March, 2011)
% VERSION NUMBER: 3.01 (29th March, 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_R_from_SP.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
% R = conductivity ratio [ unitless ]
%
% AUTHOR:
% Trevor McDougall, Paul Barker and Rich Pawlowicz [ help_gsw@csiro.au ]
% Trevor McDougall, Paul Barker and Rich Pawlowicz [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (6th April, 2011)
% VERSION NUMBER: 3.01 (6th April, 2011)
%
% REFERENCES:
% Culkin and Smith, 1980: Determination of the Concentration of Potassium
Expand Down
21 changes: 18 additions & 3 deletions Toolbox/gsw_SA_CT_plot.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ function gsw_SA_CT_plot(SA,CT,p_ref,isopycs,title_string)
% isopycs can be either 1x1 or 1xN or Mx1
%
% AUTHOR:
% Rich Pawlowicz [ help_gsw@csiro.au ]
% Rich Pawlowicz [ help@teos-10.org ]
% Note. This function was extracted and adapted from Rich Pawlowicz's
% ocean toolbox.
%
% MODIFIED:
% Paul Barker & Trevor McDougall
%
% VERSION NUMBER: 3.0 (29th March, 2011)
% VERSION NUMBER: 3.01 (6th March, 2012)
%
% REFERENCES:
% McDougall T.J., P.M. Barker, R. Feistel and D.R. Jackett, 2011: A
Expand All @@ -68,12 +68,27 @@ function gsw_SA_CT_plot(SA,CT,p_ref,isopycs,title_string)
isopycs = 5;
end

if ischar(p_ref) == 1
title_string = p_ref;
p_ref = 0;
isopycs = 5;
end

if ~isscalar(unique(p_ref))
error('gsw_SA_CT_plot: Multiple reference pressures');
else
p_ref = unique(p_ref);
end

if ~exist('isopycs','var'),
isopycs = 5;
end

if ischar(isopycs) == 1
title_string = isopycs;
isopycs = 5;
end

isopycs = isopycs(:);
min_SA_data = min(min(SA(:)));
max_SA_data = max(max(SA(:)));
Expand Down Expand Up @@ -103,7 +118,7 @@ function gsw_SA_CT_plot(SA,CT,p_ref,isopycs,title_string)
[c1,h] = contour(SA_gridded,CT_gridded,isopycs_gridded,isopycs,':','Color',[.5 .5 .5]);
end
hold on;
[c2] = plot(SA(:,1),CT(:,1),'k.','linewidth',2);
[c2] = plot(SA,CT,'.','linewidth',2);

if exist('c1','var')
clabel(c1,h,'labelspacing',360,'fontsize',8,'color',[.5 .5 .5]);
Expand Down
2 changes: 1 addition & 1 deletion Toolbox/gsw_SA_Sstar_from_SP.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
% AUTHOR:
% Paul Barker and Trevor McDougall [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (11th November, 2011)
% VERSION NUMBER: 3.01 (11th November, 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
2 changes: 1 addition & 1 deletion Toolbox/gsw_SA_from_SP.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
% AUTHOR:
% David Jackett, Trevor McDougall & Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (31st May, 2011)
% VERSION NUMBER: 3.01 (31st May, 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_SA_from_Sstar.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
% hundred kilometres inland from the coast.
%
% AUTHOR:
% David Jackett, Trevor McDougall and Paul Barker [ help_gsw@csiro.au ]
% David Jackett, Trevor McDougall and Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (27th March, 2011)
% VERSION NUMBER: 3.01 (27th March, 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_SA_from_rho.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
% Scale of Millero et al. (2008).
%
% AUTHOR:
% Trevor McDougall & Paul Barker [ help_gsw@csiro.au ]
% Trevor McDougall & Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (4th April, 2011)
% VERSION NUMBER: 3.01 (4th April, 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_SA_from_rho_CT.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
% Scale of Millero et al. (2008).
%
% AUTHOR:
% Trevor McDougall & Paul Barker [ help_gsw@csiro.au ]
% Trevor McDougall & Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (4th April, 2011)
% VERSION NUMBER: 3.01 (4th April, 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
4 changes: 2 additions & 2 deletions Toolbox/gsw_SA_from_rho_t_exact.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
% Scale of Millero et al. (2008).
%
% AUTHOR:
% Trevor McDougall & Paul Barker [ help_gsw@csiro.au ]
% Trevor McDougall & Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.0 (28th March, 2011)
% VERSION NUMBER: 3.01 (28th March, 2011)
%
% REFERENCES:
% IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
Expand Down
54 changes: 54 additions & 0 deletions Toolbox/gsw_SK_from_SP.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
function SK = gsw_SK_from_SP(SP)

% gsw_SK_from_SP Knudsen Salinity from Practical Salinity
%==========================================================================
%
% USAGE:
% SK = gsw_SK_from_SP(SP)
%
% DESCRIPTION:
% Calculates Knudsen Salinity from Practical Salinity.
%
% INPUT:
% SP = Practical Salinity (PSS-78) [ unitless ]
%
% OUTPUT:
% SK = Knudsen Salinity [parts per thousand, ppt]
%
% AUTHOR:
% Trevor McDougall and Paul Barker [ help@teos-10.org ]
%
% VERSION NUMBER: 3.01 (16th November, 2011)
%
% 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 http://www.TEOS-10.org
% See Appendix A.3 of this TEOS-10 Manual.
%
% The software is available from http://www.TEOS-10.org
%
%==========================================================================

%--------------------------------------------------------------------------
% Check variables
%--------------------------------------------------------------------------

if ~(nargin == 1)
error('gsw_SK_from_SP: Requires only one input')
end %if

%--------------------------------------------------------------------------
% Start of the calculation
%--------------------------------------------------------------------------

% These few lines ensure that SP is non-negative.
[I_neg_SP] = find(SP < 0);
if ~isempty(I_neg_SP)
SP(I_neg_SP) = 0;
end

SK = 0.03 + SP.*(1.805/1.80655);

end

0 comments on commit d276f56

Please sign in to comment.