diff --git a/gsw/gibbs/conversions.py b/gsw/gibbs/conversions.py index 5d00663..42edb23 100644 --- a/gsw/gibbs/conversions.py +++ b/gsw/gibbs/conversions.py @@ -24,7 +24,7 @@ 'SA_from_Sstar', 'SP_from_SA', 'SP_from_SR', - 'SP_from_Sstar', # TODO + #'SP_from_Sstar', # TODO 'SR_from_SP', 'Sstar_from_SA', 'deltaSA_from_SP', # TODO @@ -297,8 +297,8 @@ def SP_from_SR(SR): return 1. / uPS * SR -def SP_from_Sstar(): - pass +#def SP_from_Sstar(): +# pass @match_args_return diff --git a/gsw/gibbs/density_enthalpy_48_ct.py b/gsw/gibbs/density_enthalpy_48_ct.py index 5e44463..ea2ea27 100644 --- a/gsw/gibbs/density_enthalpy_48_ct.py +++ b/gsw/gibbs/density_enthalpy_48_ct.py @@ -4,101 +4,102 @@ import numpy as np -__all__ = ['alpha_CT', # TODO - 'beta_CT', # TODO - 'CT_from_rho', # TODO - 'CT_maxdensity', # TODO - 'dynamic_enthalpy_CT', # TODO - 'enthalpy_CT', # TODO - 'enthalpy_diff_CT', # TODO - 'internal_energy_CT', # TODO - 'rho_CT', # TODO - 'rho_alpha_beta_CT', # TODO - 'SA_from_rho_CT', # TODO - 'sigma0_CT', # TODO - 'sigma1_CT', # TODO - 'sigma2_CT', # TODO - 'sigma3_CT', # TODO - 'sigma4_CT', # TODO - 'sound_speed_CT', # TODO - 'specvol_CT', # TODO - 'specvol_anom_CT'] # TODO +__all__ = [] +# 'alpha_CT', # TODO +# 'beta_CT', # TODO +# 'CT_from_rho', # TODO +# 'CT_maxdensity', # TODO +# 'dynamic_enthalpy_CT', # TODO +# 'enthalpy_CT', # TODO +# 'enthalpy_diff_CT', # TODO +# 'internal_energy_CT', # TODO +# 'rho_CT', # TODO +# 'rho_alpha_beta_CT', # TODO +# 'SA_from_rho_CT', # TODO +# 'sigma0_CT', # TODO +# 'sigma1_CT', # TODO +# 'sigma2_CT', # TODO +# 'sigma3_CT', # TODO +# 'sigma4_CT', # TODO +# 'sound_speed_CT', # TODO +# 'specvol_CT', # TODO +# 'specvol_anom_CT'] # TODO -def alpha_CT(): - pass +#def alpha_CT(): +# pass -def beta_CT(): - pass +#def beta_CT(): +# pass -def CT_from_rho(): - pass +#def CT_from_rho(): +# pass -def CT_maxdensity(): - pass +#def CT_maxdensity(): +# pass -def dynamic_enthalpy_CT(): - pass +#def dynamic_enthalpy_CT(): +# pass -def enthalpy_CT(): - pass +#def enthalpy_CT(): +# pass -def enthalpy_diff_CT(): - pass +#def enthalpy_diff_CT(): +# pass -def internal_energy_CT(): - pass +#def internal_energy_CT(): +# pass -def rho_CT(): - pass +#def rho_CT(): +# pass -def rho_alpha_beta_CT(): - pass +#def rho_alpha_beta_CT(): +# pass -def SA_from_rho_CT(): - pass +#def SA_from_rho_CT(): +# pass -def sigma0_CT(): - pass +#def sigma0_CT(): +# pass -def sigma1_CT(): - pass +#def sigma1_CT(): +# pass -def sigma2_CT(): - pass +#def sigma2_CT(): +# pass -def sigma3_CT(): - pass +#def sigma3_CT(): +# pass -def sigma4_CT(): - pass +#def sigma4_CT(): +# pass -def sound_speed_CT(): - pass +#def sound_speed_CT(): +# pass -def specvol_CT(): - pass +#def specvol_CT(): +# pass -def specvol_anom_CT(): - pass +#def specvol_anom_CT(): +# pass if __name__ == '__main__': diff --git a/gsw/gibbs/geostrophic.py b/gsw/gibbs/geostrophic.py index ee3b751..63ebcc1 100644 --- a/gsw/gibbs/geostrophic.py +++ b/gsw/gibbs/geostrophic.py @@ -4,11 +4,12 @@ import numpy as np -__all__ = ['geostrophic_velocity'] # TODO +__all__ = [] +#__all__ = ['geostrophic_velocity'] # TODO -def geostrophic_velocity(): - pass +#def geostrophic_velocity(): +# pass if __name__ == '__main__': diff --git a/gsw/gibbs/geostrophic_48.py b/gsw/gibbs/geostrophic_48.py index 62d643f..cf83a24 100644 --- a/gsw/gibbs/geostrophic_48.py +++ b/gsw/gibbs/geostrophic_48.py @@ -4,36 +4,37 @@ import numpy as np -__all__ = ['geo_strf_Cunningham', # TODO - 'geo_strf_dyn_height', # TODO - 'geo_strf_dyn_height_pc', # TODO - 'geo_strf_isopycnal', # TODO - 'geof_str_isopycnal_pc', # TODO - 'geo_strf_Montgomery'] # TODO +__all__ = [] +# 'geo_strf_Cunningham', # TODO +# 'geo_strf_dyn_height', # TODO +# 'geo_strf_dyn_height_pc', # TODO +# 'geo_strf_isopycnal', # TODO +# 'geof_str_isopycnal_pc', # TODO +# 'geo_strf_Montgomery'] # TODO -def geo_strf_Cunningham(): - pass +#def geo_strf_Cunningham(): +# pass -def geo_strf_dyn_height(): - pass +#def geo_strf_dyn_height(): +# pass -def geo_strf_dyn_height_pc(): - pass +#def geo_strf_dyn_height_pc(): +# pass -def geo_strf_isopycnal(): - pass +#def geo_strf_isopycnal(): +# pass -def geof_str_isopycnal_pc(): - pass +#def geof_str_isopycnal_pc(): +# pass -def geo_strf_Montgomery(): - pass +#def geo_strf_Montgomery(): +# pass if __name__ == '__main__': diff --git a/gsw/gibbs/isobaric.py b/gsw/gibbs/isobaric.py index f60d72e..132edaa 100644 --- a/gsw/gibbs/isobaric.py +++ b/gsw/gibbs/isobaric.py @@ -6,19 +6,19 @@ from ..utilities import match_args_return -__all__ = ['latentheat_evap_CT', - 'latentheat_melting', - 'latentheat_evap_t'] +__all__ = ['latentheat_evap_t'] +# 'latentheat_evap_CT', +# 'latentheat_melting', -@match_args_return -def latentheat_evap_CT(SA, CT): - pass +#@match_args_return +#def latentheat_evap_CT(SA, CT): +# pass -@match_args_return -def latentheat_melting(SA, p): - pass +#@match_args_return +#def latentheat_melting(SA, p): +# pass @match_args_return diff --git a/gsw/gibbs/neutral_nonlinear_48.py b/gsw/gibbs/neutral_nonlinear_48.py index a27a4f8..8203ba9 100644 --- a/gsw/gibbs/neutral_nonlinear_48.py +++ b/gsw/gibbs/neutral_nonlinear_48.py @@ -4,31 +4,32 @@ import numpy as np -__all__ = ['cabbeling', # TODO - 'isopycnal_slope_ratio', # TODO - 'isopycnal_vs_ntp_CT_ratio', # TODO - 'ntp_pt_vs_CT_ratio', # TODO - 'thermobaric'] # TODO +__all__ = [] +# 'cabbeling', # TODO +# 'isopycnal_slope_ratio', # TODO +# 'isopycnal_vs_ntp_CT_ratio', # TODO +# 'ntp_pt_vs_CT_ratio', # TODO +# 'thermobaric'] # TODO -def cabbeling(): - pass +#def cabbeling(): +# pass -def isopycnal_slope_ratio(): - pass +#def isopycnal_slope_ratio(): +# pass -def isopycnal_vs_ntp_CT_ratio(): - pass +#def isopycnal_vs_ntp_CT_ratio(): +# pass -def ntp_pt_vs_CT_ratio(): - pass +#def ntp_pt_vs_CT_ratio(): +# pass -def thermobaric(): - pass +#def thermobaric(): +# pass if __name__ == '__main__': import doctest diff --git a/gsw/gibbs/steric.py b/gsw/gibbs/steric.py index f1728df..2277f8b 100644 --- a/gsw/gibbs/steric.py +++ b/gsw/gibbs/steric.py @@ -4,121 +4,121 @@ import numpy as np from ..utilities import match_args_return -from .geostrophic_48 import geo_strf_dyn_height - -__all__ = ['steric_height'] - - -@match_args_return -def steric_height(SA, CT, p, p_ref): - """ - Calculates steric height anomaly as the pressure integral of specific - volume anomaly from the pressure p of the "bottle" to the reference - pressure p_ref, divided by the constant value of the gravitational - acceleration, 9.7963 m s^-2. That is, this function returns the dynamic - height anomaly divided by 9.7963 m s^-2; this being the gravitational - acceleration averaged over the surface of the global ocean (see page 46 of - Griffies, 2004). Hence, steric_height is the steric height anomaly with - respect to a given reference pressure p_ref. - - Dynamic height anomaly is the geostrophic streamfunction for the difference - between the horizontal velocity at the pressure concerned, p, and the - horizontal velocity at p_ref. Dynamic height anomaly is the exact - geostrophic streamfunction in isobaric surfaces even though the - gravitational acceleration varies with latitude and pressure. Steric - height anomaly, being simply proportional to dynamic height anomaly, is - also an exact geostrophic streamfunction in an isobaric surface (up to the - constant of proportionality, 9.7963 m s^-2). - - Note however that steric_height is not exactly the height (in meters) of an - isobaric surface above a geopotential surface. It is tempting to divide - dynamic height anomaly by the local value of the gravitational - acceleration, but doing so robs the resulting quantity of either being - - (i) an exact geostrophic streamfunction, or - (ii) exactly the height of an isobaric surface above a geopotential - surface. - - By using a constant value of the gravitational acceleration, we have - retained the first of these two properties. So it should be noted that - because of the variation of the gravitational acceleration with latitude, - steric_height does not exactly represent the height of an isobaric surface - above a geopotential surface under the assumption of geostropy. - - The reference values used for the specific volume anomaly are - SSO = 35.16504 g/kg and CT = 0 deg C. This function calculates specific - volume anomaly using the computationally efficient 48-term expression for - specific volume of McDougall et al. (2011). Note that the 48-term equation - has been fitted in a restricted range of parameter space, and is most - accurate inside the "oceanographic funnel" described in McDougall et al. - (2011) and IOC et al. (2010). For dynamical oceanography we may take the - 48-term rational function expression for density as essentially reflecting - the full accuracy of TEOS-10. The GSW internal library function - "infunnel(SA,CT,p)" is available to be used if one wants to test if some of - one's data lies outside this "funnel". - - Parameters - ---------- - SA : array_like - Absolute salinity [g kg :sup:`-1`] - CT : array_like - Conservative Temperature [:math:`^\circ` C (ITS-90)] - p : array_like - pressure [dbar] - p_ref : int, float, optional - reference pressure, default = 0 - - Returns - ------- - steric_height : array_like - dynamic height anomaly divided by 9.7963 m s^-2 [m] - - Notes - ----- - If p_ref exceeds the pressure of the deepest "bottle" on a vertical - profile, the steric height anomaly for each "bottle" on the whole vertical - profile is returned as NaN. - - Examples - -------- - TODO - - References - ---------- - .. [1] 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. See section 3.27. - - .. [2] McDougall T.J., P.M. Barker, R. Feistel and D.R. Jackett, 2011: A - computationally efficient 48-term expression for the density of seawater - in terms of Conservative Temperature, and related properties of seawater. - - .. [3] Griffies, S. M., 2004: Fundamentals of Ocean Climate Models. - Princeton, NJ: Princeton University Press, 518 pp + xxxiv. - """ - - p_ref = np.asanyarray(p_ref) - - p_ref = np.unique(p_ref) - - if not np.isscalar(p_ref): - raise ValueError('The reference pressure p_ref must be unique') - - if (p_ref < 0).any(): - raise ValueError('The reference pressure p_ref must be positive') - - if (SA < 0).any(): - raise ValueError('The Absolute Salinity must be positive!') - - # Start of the calculation. - if p.max() < p_ref.max(): - raise ValueError('The reference pressure p_ref is deeper than bottles') - - dynamic_height_anomaly = geo_strf_dyn_height(SA, CT, p, p_ref) - const_grav = 9.7963 # Griffies, 2004. - - return dynamic_height_anomaly / const_grav +#from .geostrophic_48 import geo_strf_dyn_height + +__all__ = [] + +# Depends on geo_strf_dyn_height(), which was not implemented yet. +#@match_args_return +#def steric_height(SA, CT, p, p_ref): +# """ +# Calculates steric height anomaly as the pressure integral of specific +# volume anomaly from the pressure p of the "bottle" to the reference +# pressure p_ref, divided by the constant value of the gravitational +# acceleration, 9.7963 m s^-2. That is, this function returns the dynamic +# height anomaly divided by 9.7963 m s^-2; this being the gravitational +# acceleration averaged over the surface of the global ocean (see page 46 of +# Griffies, 2004). Hence, steric_height is the steric height anomaly with +# respect to a given reference pressure p_ref. +# +# Dynamic height anomaly is the geostrophic streamfunction for the difference +# between the horizontal velocity at the pressure concerned, p, and the +# horizontal velocity at p_ref. Dynamic height anomaly is the exact +# geostrophic streamfunction in isobaric surfaces even though the +# gravitational acceleration varies with latitude and pressure. Steric +# height anomaly, being simply proportional to dynamic height anomaly, is +# also an exact geostrophic streamfunction in an isobaric surface (up to the +# constant of proportionality, 9.7963 m s^-2). +# +# Note however that steric_height is not exactly the height (in meters) of an +# isobaric surface above a geopotential surface. It is tempting to divide +# dynamic height anomaly by the local value of the gravitational +# acceleration, but doing so robs the resulting quantity of either being +# +# (i) an exact geostrophic streamfunction, or +# (ii) exactly the height of an isobaric surface above a geopotential +# surface. +# +# By using a constant value of the gravitational acceleration, we have +# retained the first of these two properties. So it should be noted that +# because of the variation of the gravitational acceleration with latitude, +# steric_height does not exactly represent the height of an isobaric surface +# above a geopotential surface under the assumption of geostropy. +# +# The reference values used for the specific volume anomaly are +# SSO = 35.16504 g/kg and CT = 0 deg C. This function calculates specific +# volume anomaly using the computationally efficient 48-term expression for +# specific volume of McDougall et al. (2011). Note that the 48-term equation +# has been fitted in a restricted range of parameter space, and is most +# accurate inside the "oceanographic funnel" described in McDougall et al. +# (2011) and IOC et al. (2010). For dynamical oceanography we may take the +# 48-term rational function expression for density as essentially reflecting +# the full accuracy of TEOS-10. The GSW internal library function +# "infunnel(SA,CT,p)" is available to be used if one wants to test if some of +# one's data lies outside this "funnel". +# +# Parameters +# ---------- +# SA : array_like +# Absolute salinity [g kg :sup:`-1`] +# CT : array_like +# Conservative Temperature [:math:`^\circ` C (ITS-90)] +# p : array_like +# pressure [dbar] +# p_ref : int, float, optional +# reference pressure, default = 0 +# +# Returns +# ------- +# steric_height : array_like +# dynamic height anomaly divided by 9.7963 m s^-2 [m] +# +# Notes +# ----- +# If p_ref exceeds the pressure of the deepest "bottle" on a vertical +# profile, the steric height anomaly for each "bottle" on the whole vertical +# profile is returned as NaN. +# +# Examples +# -------- +# TODO +# +# References +# ---------- +# .. [1] 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. See section 3.27. +# +# .. [2] McDougall T.J., P.M. Barker, R. Feistel and D.R. Jackett, 2011: A +# computationally efficient 48-term expression for the density of seawater +# in terms of Conservative Temperature, and related properties of seawater. +# +# .. [3] Griffies, S. M., 2004: Fundamentals of Ocean Climate Models. +# Princeton, NJ: Princeton University Press, 518 pp + xxxiv. +# """ +# +# p_ref = np.asanyarray(p_ref) +# +# p_ref = np.unique(p_ref) +# +# if not np.isscalar(p_ref): +# raise ValueError('The reference pressure p_ref must be unique') +# +# if (p_ref < 0).any(): +# raise ValueError('The reference pressure p_ref must be positive') +# +# if (SA < 0).any(): +# raise ValueError('The Absolute Salinity must be positive!') +# +# # Start of the calculation. +# if p.max() < p_ref.max(): +# raise ValueError('The reference pressure p_ref is deeper than bottles') +# +# dynamic_height_anomaly = geo_strf_dyn_height(SA, CT, p, p_ref) +# const_grav = 9.7963 # Griffies, 2004. +# +# return dynamic_height_anomaly / const_grav if __name__ == '__main__': import doctest diff --git a/gsw/gibbs/thermodynamics_from_t.py b/gsw/gibbs/thermodynamics_from_t.py index ea9f93d..4aa9b97 100644 --- a/gsw/gibbs/thermodynamics_from_t.py +++ b/gsw/gibbs/thermodynamics_from_t.py @@ -24,7 +24,7 @@ 'chem_potential_salt_t_exact', 'chem_potential_water_t_exact', 'cp_t_exact', - 'deltaSA_from_rho_t_exact', +# 'deltaSA_from_rho_t_exact', 'dynamic_enthalpy_t_exact', 'enthalpy_t_exact', 'entropy_t_exact', @@ -621,9 +621,9 @@ def cp_t_exact(SA, t, p): return -(t + Kelvin) * gibbs(n0, n2, n0, SA, t, p) -@match_args_return -def deltaSA_from_rho_t_exact(rho, SP, t, p): - pass +#@match_args_return +#def deltaSA_from_rho_t_exact(rho, SP, t, p): +# pass @match_args_return