From e6a59968626177b189dd52e96642dfddadc33de8 Mon Sep 17 00:00:00 2001 From: "Thermodynamic Equation Of Seawater - 2010 (TEOS-10)" Date: Fri, 29 May 2015 18:04:17 +1000 Subject: [PATCH] Version 3.03 Added isentropic compressibility (kappa) for the 48-term equation of state. gsw_rho_first derivatves and gsw_rho_first derivatves_CT_exact. gsw_alpha_on_beta and gsw_alpha_on_beta_CT_exact. gsw_t_from_pt0 gsw_t_from_entropy gsw_adiabatic_lapse_rate_from_CT. gsw_deltaSA_from_rho_t_exact. Remaned gsw_entropy_t_exact to gsw_entropy_from_t, and added ths inverse function (gsw_t_from_entropy) Renamed gsw_adiabatic_lapse_rate_t_exact to gsw_adiabatic_lapse_rate_from_t --- Toolbox/Contents.m | 215 ++++++------ Toolbox/gsw_Abs_Pressure_from_p.m | 2 +- Toolbox/gsw_C3515.m | 2 +- Toolbox/gsw_CT_first_derivatives.m | 7 +- Toolbox/gsw_CT_freezing.m | 2 +- Toolbox/gsw_CT_from_entropy.m | 2 +- Toolbox/gsw_CT_from_pt.m | 2 +- Toolbox/gsw_CT_from_rho.m | 11 +- Toolbox/gsw_CT_from_rho_exact.m | 2 +- Toolbox/gsw_CT_from_t.m | 2 +- Toolbox/gsw_CT_maxdensity.m | 13 +- Toolbox/gsw_CT_maxdensity_exact.m | 2 +- Toolbox/gsw_CT_second_derivatives.m | 7 +- Toolbox/gsw_C_from_SP.m | 2 +- Toolbox/gsw_IPV_vs_fNsquared_ratio.m | 11 +- Toolbox/gsw_Nsquared.m | 9 +- Toolbox/gsw_P0.m | 2 +- Toolbox/gsw_R_from_SP.m | 2 +- Toolbox/gsw_SA_CT_plot.m | 6 +- Toolbox/gsw_SA_Sstar_from_SP.m | 2 +- Toolbox/gsw_SA_from_SP.m | 2 +- Toolbox/gsw_SA_from_Sstar.m | 2 +- Toolbox/gsw_SA_from_rho.m | 11 +- Toolbox/gsw_SA_from_rho_CT.m | 11 +- Toolbox/gsw_SA_from_rho_CT_exact.m | 6 +- Toolbox/gsw_SA_from_rho_t.m | 219 ------------ Toolbox/gsw_SA_from_rho_t_pmid.m | 228 ------------- Toolbox/gsw_SK_from_SP.m | 51 --- Toolbox/gsw_SP_from_C.m | 28 +- Toolbox/gsw_SP_from_R.m | 26 +- Toolbox/gsw_SP_from_SA.m | 2 +- Toolbox/gsw_SP_from_SK.m | 2 +- Toolbox/gsw_SP_from_SR.m | 2 +- Toolbox/gsw_SP_from_Sstar.m | 2 +- Toolbox/gsw_SP_salinometer.m | 2 +- Toolbox/gsw_SR_from_SP.m | 2 +- Toolbox/gsw_SSO.m | 2 +- Toolbox/gsw_SonCl.m | 2 +- Toolbox/gsw_Sstar_from_SA.m | 2 +- Toolbox/gsw_Sstar_from_SP.m | 2 +- Toolbox/gsw_T0.m | 2 +- Toolbox/gsw_Turner_Rsubrho.m | 11 +- Toolbox/gsw_adiabatic_lapse_rate_from_CT.m | 99 ++++++ ...ct.m => gsw_adiabatic_lapse_rate_from_t.m} | 20 +- Toolbox/gsw_alpha.m | 11 +- Toolbox/gsw_alpha_CT.m | 11 +- Toolbox/gsw_alpha_CT_exact.m | 11 +- Toolbox/gsw_alpha_on_beta.m | 255 ++++++++++++++ Toolbox/gsw_alpha_on_beta_CT.m | 112 ++++++ Toolbox/gsw_alpha_on_beta_CT_exact.m | 107 ++++++ Toolbox/gsw_atomic_weight.m | 2 +- Toolbox/gsw_beta.m | 11 +- Toolbox/gsw_beta_CT.m | 11 +- Toolbox/gsw_beta_CT_exact.m | 11 +- Toolbox/gsw_brineSA_CT.m | 2 +- Toolbox/gsw_brineSA_t.m | 2 +- Toolbox/gsw_cabbeling.m | 250 ++++++++++---- Toolbox/gsw_cabbeling_CT.m | 106 ++++++ Toolbox/gsw_cabbeling_CT_exact.m | 121 +++++++ Toolbox/gsw_check_functions.m | 321 ++++++++++++------ Toolbox/gsw_cp0.m | 2 +- Toolbox/gsw_deltaSA_from_SP.m | 2 +- Toolbox/gsw_depth_from_z.m | 2 +- Toolbox/gsw_distance.m | 2 +- Toolbox/gsw_dynamic_enthalpy.m | 24 +- Toolbox/gsw_dynamic_enthalpy_CT.m | 14 +- Toolbox/gsw_dynamic_enthalpy_CT_exact.m | 12 +- Toolbox/gsw_enthalpy.m | 14 +- Toolbox/gsw_enthalpy_CT.m | 14 +- Toolbox/gsw_enthalpy_CT_exact.m | 13 +- Toolbox/gsw_enthalpy_diff.m | 14 +- Toolbox/gsw_enthalpy_diff_CT.m | 14 +- Toolbox/gsw_enthalpy_diff_CT_exact.m | 12 +- Toolbox/gsw_enthalpy_first_derivatives.m | 115 +++---- Toolbox/gsw_enthalpy_first_derivatives_CT.m | 117 +++++++ .../gsw_enthalpy_first_derivatives_CT_exact.m | 171 ++++++++++ Toolbox/gsw_enthalpy_second_derivatives.m | 103 +++--- Toolbox/gsw_enthalpy_second_derivatives_CT.m | 127 +++++++ ...gsw_enthalpy_second_derivatives_CT_exact.m | 164 +++++++++ Toolbox/gsw_entropy_first_derivatives.m | 3 +- Toolbox/gsw_entropy_from_CT.m | 2 +- Toolbox/gsw_entropy_from_pt.m | 2 +- ...entropy_t_exact.m => gsw_entropy_from_t.m} | 20 +- Toolbox/gsw_entropy_second_derivatives.m | 3 +- Toolbox/gsw_f.m | 2 +- Toolbox/gsw_geo_strf_Cunningham.m | 14 +- Toolbox/gsw_geo_strf_Montgomery.m | 13 +- Toolbox/gsw_geo_strf_dyn_height.m | 27 +- Toolbox/gsw_geo_strf_dyn_height_pc.m | 11 +- Toolbox/gsw_geo_strf_isopycnal.m | 9 +- Toolbox/gsw_geo_strf_isopycnal_pc.m | 9 +- Toolbox/gsw_geostrophic_velocity.m | 7 +- Toolbox/gsw_grav.m | 2 +- Toolbox/gsw_internal_energy.m | 11 +- Toolbox/gsw_internal_energy_CT.m | 11 +- Toolbox/gsw_internal_energy_CT_exact.m | 2 +- Toolbox/gsw_ionic_strength_from_SA.m | 2 +- Toolbox/gsw_isopycnal_slope_ratio.m | 11 +- Toolbox/gsw_isopycnal_vs_ntp_CT_ratio.m | 11 +- Toolbox/gsw_kappa.m | 201 +++++++++++ Toolbox/gsw_kappa_CT.m | 102 ++++++ Toolbox/gsw_kappa_CT_exact.m | 102 ++++++ Toolbox/gsw_latentheat_evap_CT.m | 2 +- Toolbox/gsw_latentheat_evap_t.m | 2 +- Toolbox/gsw_latentheat_melting.m | 2 +- Toolbox/gsw_molality_from_SA.m | 2 +- Toolbox/gsw_ntp_pt_vs_CT_ratio.m | 11 +- Toolbox/gsw_p_from_Abs_Pressure.m | 2 +- Toolbox/gsw_p_from_z.m | 62 ++-- Toolbox/gsw_pot_enthalpy_from_pt.m | 2 +- Toolbox/gsw_pt0_from_t.m | 8 +- Toolbox/gsw_pt_first_derivatives.m | 8 +- Toolbox/gsw_pt_from_CT.m | 8 +- Toolbox/gsw_pt_from_CT_plus.m | 127 ------- Toolbox/gsw_pt_from_CT_plus2.m | 126 ------- Toolbox/gsw_pt_from_entropy.m | 2 +- Toolbox/gsw_pt_from_t.m | 8 +- Toolbox/gsw_pt_second_derivatives.m | 8 +- Toolbox/gsw_rho.m | 11 +- Toolbox/gsw_rho_CT.m | 11 +- Toolbox/gsw_rho_CT_exact.m | 11 +- Toolbox/gsw_rho_alpha_beta.m | 12 +- Toolbox/gsw_rho_alpha_beta_CT.m | 12 +- Toolbox/gsw_rho_alpha_beta_CT_exact.m | 12 +- Toolbox/gsw_rho_first_derivatives.m | 299 ++++++++++++++++ Toolbox/gsw_rho_first_derivatives_CT.m | 121 +++++++ Toolbox/gsw_rho_first_derivatives_CT_exact.m | 172 ++++++++++ Toolbox/gsw_sigma0.m | 13 +- Toolbox/gsw_sigma0_CT.m | 11 +- Toolbox/gsw_sigma0_CT_exact.m | 11 +- Toolbox/gsw_sigma1.m | 9 +- Toolbox/gsw_sigma1_CT.m | 9 +- Toolbox/gsw_sigma1_CT_exact.m | 11 +- Toolbox/gsw_sigma2.m | 9 +- Toolbox/gsw_sigma2_CT.m | 9 +- Toolbox/gsw_sigma2_CT_exact.m | 11 +- Toolbox/gsw_sigma3.m | 9 +- Toolbox/gsw_sigma3_CT.m | 9 +- Toolbox/gsw_sigma3_CT_exact.m | 11 +- Toolbox/gsw_sigma4.m | 9 +- Toolbox/gsw_sigma4_CT.m | 9 +- Toolbox/gsw_sigma4_CT_exact.m | 11 +- Toolbox/gsw_sound_speed.m | 11 +- Toolbox/gsw_sound_speed_CT.m | 11 +- Toolbox/gsw_sound_speed_CT_exact.m | 4 +- Toolbox/gsw_specvol.m | 11 +- Toolbox/gsw_specvol_CT.m | 11 +- Toolbox/gsw_specvol_CT_exact.m | 9 +- Toolbox/gsw_specvol_anom.m | 13 +- Toolbox/gsw_specvol_anom_CT.m | 13 +- Toolbox/gsw_specvol_anom_CT_exact.m | 14 +- Toolbox/gsw_steric_height.m | 11 +- Toolbox/gsw_t90_from_t48.m | 2 +- Toolbox/gsw_t90_from_t68.m | 2 +- Toolbox/gsw_t_freezing.m | 2 +- Toolbox/gsw_t_from_CT.m | 2 +- Toolbox/gsw_t_from_entropy.m | 95 ++++++ Toolbox/gsw_t_from_pt0.m | 102 ++++++ Toolbox/gsw_thermobaric.m | 251 +++++++++++--- Toolbox/gsw_thermobaric_CT.m | 110 ++++++ Toolbox/gsw_thermobaric_CT_exact.m | 114 +++++++ Toolbox/gsw_uPS.m | 2 +- Toolbox/gsw_valence_factor.m | 2 +- Toolbox/gsw_ver.m | 6 +- Toolbox/gsw_z_from_depth.m | 2 +- Toolbox/gsw_z_from_p.m | 58 ++-- Toolbox/library/gsw_Fdelta.m | 2 +- Toolbox/library/gsw_Hill_ratio_at_SP2.m | 8 +- Toolbox/library/gsw_SAAR.m | 6 +- Toolbox/library/gsw_SA_from_SP_Baltic.m | 2 +- Toolbox/library/gsw_SP_from_SA_Baltic.m | 2 +- Toolbox/library/gsw_data_v3_0.mat | Bin 4711440 -> 4739088 bytes Toolbox/library/gsw_deltaSA_atlas.m | 20 +- Toolbox/library/gsw_enthalpy_SSO_0_p.m | 2 +- Toolbox/library/gsw_entropy_part.m | 2 +- Toolbox/library/gsw_entropy_part_zerop.m | 2 +- Toolbox/library/gsw_gibbs.m | 2 +- Toolbox/library/gsw_gibbs_pt0_pt0.m | 2 +- Toolbox/library/gsw_infunnel.m | 2 +- Toolbox/library/gsw_interp_SA_CT.m | 4 +- Toolbox/library/gsw_interp_ref_cast.m | 4 +- Toolbox/library/gsw_specvol_SSO_0_p.m | 2 +- .../gsw_Helmholtz_energy_t_exact.m | 2 +- .../gsw_SA_from_rho_t_exact.m | 4 +- .../gsw_adiabatic_lapse_rate_t_exact.m | 49 +++ .../gsw_alpha_wrt_CT_t_exact.m | 2 +- .../gsw_alpha_wrt_pt_t_exact.m | 2 +- .../gsw_alpha_wrt_t_exact.m | 2 +- .../gsw_beta_const_CT_t_exact.m | 2 +- .../gsw_beta_const_pt_t_exact.m | 2 +- .../gsw_beta_const_t_exact.m | 2 +- .../gsw_chem_potential_relative_t_exact.m | 5 +- .../gsw_chem_potential_salt_t_exact.m | 4 +- .../gsw_chem_potential_water_t_exact.m | 10 +- .../gsw_cp_t_exact.m | 2 +- .../gsw_deltaSA_from_rho_t_exact.m | 112 ++++++ .../gsw_dynamic_enthalpy_t_exact.m | 2 +- .../gsw_enthalpy_t_exact.m | 2 +- .../gsw_entropy_t_exact.m | 46 +++ .../gsw_internal_energy_t_exact.m | 2 +- .../gsw_isochoric_heat_cap_t_exact.m | 2 +- .../gsw_kappa_const_t_exact.m | 2 +- .../gsw_kappa_t_exact.m | 2 +- .../gsw_osmotic_coefficient_t_exact.m | 2 +- .../gsw_osmotic_pressure_t_exact.m | 2 +- .../gsw_pot_rho_t_exact.m | 2 +- .../gsw_rho_t_exact.m | 2 +- .../gsw_sigma0_pt0_exact.m | 2 +- .../gsw_sound_speed_t_exact.m | 2 +- .../gsw_specvol_anom_t_exact.m | 2 +- .../gsw_specvol_t_exact.m | 2 +- .../gsw_t_from_rho_exact.m | 2 +- .../gsw_t_maxdensity_exact.m | 2 +- 213 files changed, 4337 insertions(+), 1949 deletions(-) delete mode 100644 Toolbox/gsw_SA_from_rho_t.m delete mode 100644 Toolbox/gsw_SA_from_rho_t_pmid.m delete mode 100644 Toolbox/gsw_SK_from_SP.m create mode 100644 Toolbox/gsw_adiabatic_lapse_rate_from_CT.m rename Toolbox/{gsw_adiabatic_lapse_rate_t_exact.m => gsw_adiabatic_lapse_rate_from_t.m} (77%) create mode 100644 Toolbox/gsw_alpha_on_beta.m create mode 100644 Toolbox/gsw_alpha_on_beta_CT.m create mode 100644 Toolbox/gsw_alpha_on_beta_CT_exact.m create mode 100644 Toolbox/gsw_cabbeling_CT.m create mode 100644 Toolbox/gsw_cabbeling_CT_exact.m create mode 100644 Toolbox/gsw_enthalpy_first_derivatives_CT.m create mode 100644 Toolbox/gsw_enthalpy_first_derivatives_CT_exact.m create mode 100644 Toolbox/gsw_enthalpy_second_derivatives_CT.m create mode 100644 Toolbox/gsw_enthalpy_second_derivatives_CT_exact.m rename Toolbox/{gsw_entropy_t_exact.m => gsw_entropy_from_t.m} (80%) create mode 100644 Toolbox/gsw_kappa.m create mode 100644 Toolbox/gsw_kappa_CT.m create mode 100644 Toolbox/gsw_kappa_CT_exact.m delete mode 100644 Toolbox/gsw_pt_from_CT_plus.m delete mode 100644 Toolbox/gsw_pt_from_CT_plus2.m create mode 100644 Toolbox/gsw_rho_first_derivatives.m create mode 100644 Toolbox/gsw_rho_first_derivatives_CT.m create mode 100644 Toolbox/gsw_rho_first_derivatives_CT_exact.m create mode 100644 Toolbox/gsw_t_from_entropy.m create mode 100644 Toolbox/gsw_t_from_pt0.m create mode 100644 Toolbox/gsw_thermobaric_CT.m create mode 100644 Toolbox/gsw_thermobaric_CT_exact.m rename Toolbox/{ => thermodynamics_from_t}/gsw_Helmholtz_energy_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_SA_from_rho_t_exact.m (97%) create mode 100644 Toolbox/thermodynamics_from_t/gsw_adiabatic_lapse_rate_t_exact.m rename Toolbox/{ => thermodynamics_from_t}/gsw_alpha_wrt_CT_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_alpha_wrt_pt_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_alpha_wrt_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_beta_const_CT_t_exact.m (99%) rename Toolbox/{ => thermodynamics_from_t}/gsw_beta_const_pt_t_exact.m (99%) rename Toolbox/{ => thermodynamics_from_t}/gsw_beta_const_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_chem_potential_relative_t_exact.m (95%) rename Toolbox/{ => thermodynamics_from_t}/gsw_chem_potential_salt_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_chem_potential_water_t_exact.m (95%) rename Toolbox/{ => thermodynamics_from_t}/gsw_cp_t_exact.m (98%) create mode 100644 Toolbox/thermodynamics_from_t/gsw_deltaSA_from_rho_t_exact.m rename Toolbox/{ => thermodynamics_from_t}/gsw_dynamic_enthalpy_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_enthalpy_t_exact.m (98%) create mode 100644 Toolbox/thermodynamics_from_t/gsw_entropy_t_exact.m rename Toolbox/{ => thermodynamics_from_t}/gsw_internal_energy_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_isochoric_heat_cap_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_kappa_const_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_kappa_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_osmotic_coefficient_t_exact.m (99%) rename Toolbox/{ => thermodynamics_from_t}/gsw_osmotic_pressure_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_pot_rho_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_rho_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_sigma0_pt0_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_sound_speed_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_specvol_anom_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_specvol_t_exact.m (98%) rename Toolbox/{ => thermodynamics_from_t}/gsw_t_from_rho_exact.m (99%) rename Toolbox/{ => thermodynamics_from_t}/gsw_t_maxdensity_exact.m (98%) diff --git a/Toolbox/Contents.m b/Toolbox/Contents.m index 63461df..a58ef0b 100644 --- a/Toolbox/Contents.m +++ b/Toolbox/Contents.m @@ -1,5 +1,5 @@ % GSW Oceanographic Toolbox -% Version 3.02 (R2011a) 15-May-2011 +% Version 3.03 (R2011a) 23-May-2013 % % documentation set % gsw_front_page - front page to the GSW Oceanographic Toolbox @@ -12,6 +12,7 @@ % gsw_SP_from_R - Practical Salinity from conductivity ratio, R (inc. for SP < 2) % gsw_R_from_SP - conductivity ratio, R, from Practical Salinity (inc. for SP < 2) % gsw_SP_salinometer - Practical Salinity from a laboratory salinometer (inc. for SP < 2) +% gsw_SP_from_SK - Practical Salinity from Knudsen Salinity % % Absolute Salinity (SA), Preformed Salinity (Sstar) and Conservative Temperature (CT) % gsw_SA_from_SP - Absolute Salinity from Practical Salinity @@ -24,93 +25,100 @@ % and selected potential density contours % % other conversions between temperatures, salinities, pressure and height -% gsw_deltaSA_from_SP - Absolute Salinity Anomaly from Practical Salinity -% gsw_SA_Sstar_from_SP - Absolute Salinity & Preformed Salinity from Practical Salinity -% gsw_SR_from_SP - Reference Salinity from Practical Salinity -% gsw_SP_from_SR - Practical Salinity from Reference Salinity -% gsw_SP_from_SA - Practical Salinity from Absolute Salinity -% gsw_Sstar_from_SA - Preformed Salinity from Absolute Salinity -% gsw_SA_from_Sstar - Absolute Salinity from Preformed Salinity -% gsw_SP_from_Sstar - Practical Salinity from Preformed Salinity -% gsw_pt_from_CT - potential temperature from Conservative Temperature -% gsw_t_from_CT - in-situ temperature from Conservative Temperature -% gsw_CT_from_pt - Conservative Temperature from potential temperature -% gsw_pot_enthalpy_from_pt - potential enthalpy from potential temperature -% gsw_pt0_from_t - potential temperature with a reference pressure of zero dbar -% gsw_pt_from_t - potential temperature -% gsw_t90_from_t48 - ITS-90 temperature from IPTS-48 temperature -% gsw_t90_from_t68 - ITS-90 temperature from IPTS-68 temperature -% gsw_z_from_p - height from pressure -% gsw_p_from_z - pressure from height -% gsw_depth_from_z - depth from height -% gsw_z_from_depth - height from depth -% gsw_Abs_Pressure_from_p - Absolute Pressure,P, from pressure, p -% gsw_p_from_Abs_Pressure - pressure, p, from Absolute Pressure, P -% gsw_entropy_from_CT - entropy from Conservative Temperature -% gsw_CT_from_entropy - Conservative Temperature from entropy -% gsw_entropy_from_pt - entropy from potential temperature -% gsw_pt_from_entropy - potential temperature from entropy -% gsw_molality_from_SA - molality of seawater -% gsw_ionic_strength_from_SA - ionic strength of seawater +% gsw_deltaSA_from_SP - Absolute Salinity Anomaly from Practical Salinity +% gsw_SA_Sstar_from_SP - Absolute Salinity & Preformed Salinity from Practical Salinity +% gsw_SR_from_SP - Reference Salinity from Practical Salinity +% gsw_SP_from_SR - Practical Salinity from Reference Salinity +% gsw_SP_from_SA - Practical Salinity from Absolute Salinity +% gsw_Sstar_from_SA - Preformed Salinity from Absolute Salinity +% gsw_SA_from_Sstar - Absolute Salinity from Preformed Salinity +% gsw_SP_from_Sstar - Practical Salinity from Preformed Salinity +% gsw_pt_from_CT - potential temperature from Conservative Temperature +% gsw_t_from_CT - in-situ temperature from Conservative Temperature +% gsw_CT_from_pt - Conservative Temperature from potential temperature +% gsw_pot_enthalpy_from_pt - potential enthalpy from potential temperature +% gsw_pt_from_t - potential temperature +% gsw_pt0_from_t - potential temperature with a reference pressure of zero dbar +% gsw_t_from_pt0 - in-situ temperature from potential temperature with p_ref = 0 dbar +% gsw_t90_from_t48 - ITS-90 temperature from IPTS-48 temperature +% gsw_t90_from_t68 - ITS-90 temperature from IPTS-68 temperature +% gsw_z_from_p - height from pressure +% gsw_p_from_z - pressure from height +% gsw_z_from_depth - height from depth +% gsw_depth_from_z - depth from height +% gsw_Abs_Pressure_from_p - Absolute Pressure,P, from pressure, p +% gsw_p_from_Abs_Pressure - pressure, p, from Absolute Pressure, P +% gsw_entropy_from_CT - entropy from Conservative Temperature +% gsw_CT_from_entropy - Conservative Temperature from entropy +% gsw_entropy_from_pt - entropy from potential temperature +% gsw_pt_from_entropy - potential temperature from entropy +% gsw_entropy_from_t - entropy from in-situ temperature +% gsw_t_from_entropy - in-situ temperature from entropy +% gsw_adiabatic_lapse_rate_from_CT - adiabatic lapse rate from Conservative Temperature +% gsw_adiabatic_lapse_rate_from_t - adiabatic lapse rate from in-situ temperature +% gsw_molality_from_SA - molality of seawater +% gsw_ionic_strength_from_SA - ionic strength of seawater % % density and enthalpy, based on the 48-term expression for density -% (The functions in this group ending in "_CT" may also be called without "_CT".) -% gsw_rho_CT - in-situ density from CT, and potential density -% gsw_alpha_CT - thermal expansion coefficient with respect to CT -% gsw_beta_CT - saline contraction coefficient at constant CT -% gsw_rho_alpha_beta_CT - in-situ density, thermal expansion & saline contraction coefficients -% gsw_specvol_CT - specific volume -% gsw_specvol_anom_CT - specific volume anomaly -% gsw_sigma0_CT - sigma0 from CT with reference pressure of 0 dbar -% gsw_sigma1_CT - sigma1 from CT with reference pressure of 1000 dbar -% gsw_sigma2_CT - sigma2 from CT with reference pressure of 2000 dbar -% gsw_sigma3_CT - sigma3 from CT with reference pressure of 3000 dbar -% gsw_sigma4_CT - sigma4 from CT with reference pressure of 4000 dbar -% gsw_sound_speed_CT - sound speed (approximate, with r.m.s. error of 0.067 m/s) -% gsw_internal_energy_CT - internal energy -% gsw_enthalpy_CT - enthalpy -% gsw_enthalpy_diff_CT - difference of enthalpy between two pressures -% gsw_dynamic_enthalpy_CT - dynamic enthalpy -% gsw_SA_from_rho_CT - Absolute Salinity from density & CT -% gsw_CT_from_rho - Conservative Temperature from density -% gsw_CT_maxdensity - Conservative Temperature of maximum density of seawater +% gsw_rho - in-situ density and potential density +% gsw_alpha - thermal expansion coefficient with respect to CT +% gsw_beta - saline contraction coefficient at constant CT +% gsw_rho_alpha_beta - in-situ density, thermal expansion & saline contraction coefficients +% gsw_alpha_on_beta - alpha divied by beta +% gsw_rho_first_derivaties - first derivaties of rho +% gsw_specvol - specific volume +% gsw_specvol_anom - specific volume anomaly +% gsw_sigma0 - sigma0 with reference pressure of 0 dbar +% gsw_sigma1 - sigma1 with reference pressure of 1000 dbar +% gsw_sigma2 - sigma2 with reference pressure of 2000 dbar +% gsw_sigma3 - sigma3 with reference pressure of 3000 dbar +% gsw_sigma4 - sigma4 with reference pressure of 4000 dbar +% gsw_sound_speed - sound speed (approximate, with r.m.s. error of 0.067 m/s) +% gsw_kappa - isentropic compressibility +% gsw_cabbeling - cabbeling coefficient +% gsw_thermobaric - thermobaric coefficient +% gsw_SA_from_rho - Absolute Salinity from density +% gsw_CT_from_rho - Conservative Temperature from density +% gsw_CT_maxdensity - Conservative Temperature of maximum density of seawater +% gsw_internal_energy - internal energy +% gsw_enthalpy - enthalpy +% gsw_enthalpy_diff - difference of enthalpy between two pressures +% gsw_dynamic_enthalpy - dynamic enthalpy +% gsw_enthalpy_first_derivaties - first derivaties of enthalpy +% gsw_enthalpy_second_derivaties - second derivaties of enthalpy % % water column properties, based on the 48-term expression for density -% gsw_Nsquared - buoyancy (Brunt-Vaisala) frequency squared (N^2) -% gsw_Turner_Rsubrho - Turner angle & Rsubrho -% gsw_IPV_vs_fNsquared_ratio - ratio of the vertical gradient of potential density -% (with reference pressure, p_ref), to the vertical gradient -% of locally-referenced potential density -% -% neutral and non-linear properties, based on the 48-term expression for density -% gsw_cabbeling - cabbeling coefficient -% gsw_thermobaric - thermobaric coefficient -% gsw_isopycnal_slope_ratio - ratio of the slopes of isopycnals on the SA-CT diagram -% for p & p_ref -% gsw_isopycnal_vs_ntp_CT_ratio - ratio of the gradient of Conservative Temperature -% in a potential density surface to that in the neutral -% tangent plane -% gsw_ntp_pt_vs_CT_ratio - ratio of gradients of potential temperature & -% Conservative Temperature in a neutral tangent plane -% (i.e. in a locally-referenced potential density surface) +% gsw_Nsquared - buoyancy (Brunt-Vaisala) frequency squared (N^2) +% gsw_Turner_Rsubrho - Turner angle & Rsubrho +% gsw_IPV_vs_fNsquared_ratio - ratio of the vertical gradient of potential density +% (with reference pressure, p_ref), to the vertical +% gradient of locally-referenced potential density +% +% neutral properties, based on the 48-term expression for density +% gsw_isopycnal_slope_ratio - ratio of the slopes of isopycnals on the SA-CT diagram +% for p & p_ref +% gsw_isopycnal_vs_ntp_CT_ratio - ratio of the gradient of Conservative Temperature +% in a potential density surface to that in the neutral +% tangent plane +% gsw_ntp_pt_vs_CT_ratio - ratio of gradients of potential temperature & +% Conservative Temperature in a neutral tangent plane +% (i.e. in a locally-referenced potential density surface) % % geostrophic streamfunctions, based on the 48-term expression for density -% gsw_geo_strf_dyn_height - dynamic height anomaly -% gsw_geo_strf_dyn_height_pc - dynamic height anomaly for piecewise constant profiles -% gsw_geo_strf_isopycnal - approximate isopycnal geostrophic streamfunction -% gsw_geof_str_isopycnal_pc - approximate isopycnal geostrophic streamfunction for -% piecewise constant profiles -% gsw_geo_strf_Montgomery - Montgomery geostrophic streamfunction -% gsw_geo_strf_Cunningham - Cunningham geostrophic streamfunction +% gsw_geo_strf_dyn_height - dynamic height anomaly +% gsw_geo_strf_dyn_height_pc - dynamic height anomaly for piecewise constant profiles +% gsw_geo_strf_isopycnal - approximate isopycnal geostrophic streamfunction +% gsw_geof_str_isopycnal_pc - approximate isopycnal geostrophic streamfunction for +% piecewise constant profiles +% gsw_geo_strf_Montgomery - Montgomery geostrophic streamfunction +% gsw_geo_strf_Cunningham - Cunningham geostrophic streamfunction % % geostrophic velocity -% gsw_geostrophic_velocity - geostrophic velocity +% gsw_geostrophic_velocity - geostrophic velocity % -% derivatives of enthalpy, entropy, CT and pt +% derivatives of entropy, CT and pt % gsw_CT_first_derivatives - first derivatives of Conservative Temperature % gsw_CT_second_derivatives - second derivatives of Conservative Temperature -% gsw_enthalpy_first_derivatives - first derivatives of enthalpy -% gsw_enthalpy_second_derivatives - second derivatives of enthalpy % gsw_entropy_first_derivatives - first derivatives of entropy % gsw_entropy_second_derivatives - second derivatives of entropy % gsw_pt_first_derivatives - first derivatives of potential temperature @@ -149,26 +157,37 @@ % gsw_atomic_weight - mole-weighted atomic weight of sea salt; 31.4038218... g/mol % % density and enthalpy in terms of CT, based on the exact Gibbs function -% gsw_rho_CT_exact - in-situ density from CT, and potential density from CT -% gsw_alpha_CT_exact - thermal expansion coefficient with respect to CT -% gsw_beta_CT_exact - saline contraction coefficientat constant CT -% gsw_rho_alpha_beta_CT_exact - in-situ density, thermal expansion & saline contraction -% coefficient from CT -% gsw_specvol_CT_exact - specific volume from CT -% gsw_specvol_anom_CT_exact - specific volume anomaly from CT -% gsw_sigma0_CT_exact - sigma0 from CT with reference pressure of 0 dbar -% gsw_sigma1_CT_exact - sigma1 from CT with reference pressure of 1000 dbar -% gsw_sigma2_CT_exact - sigma2 from CT with reference pressure of 2000 dbar -% gsw_sigma3_CT_exact - sigma3 from CT with reference pressure of 3000 dbar -% gsw_sigma4_CT_exact - sigma4 from CT with reference pressure of 4000 dbar -% gsw_sound_speed_CT_exact - sound speed -% gsw_internal_energy_CT_exact - internal energy -% gsw_enthalpy_CT_exact - enthalpy from CT -% gsw_enthalpy_diff_CT_exact - difference of enthalpy from CT between two pressures -% gsw_dynamic_enthalpy_CT_exact - dynamic enthalpy from CT -% gsw_SA_from_rho_CT_exact - Absolute Salinity from Density & CT -% gsw_CT_from_rho_exact - Conservative Temperature from density -% gsw_CT_maxdensity_exact - Conservative Temperature of maximum density of seawater +% gsw_rho_CT_exact - in-situ density and potential density +% gsw_alpha_CT_exact - thermal expansion coefficient with respect to CT +% gsw_beta_CT_exact - saline contraction coefficientat constant CT +% gsw_rho_alpha_beta_CT_exact - in-situ density, thermal expansion & saline contraction coefficient +% gsw_alpha_on_beta_CT_exact - alpha divied by beta +% gsw_rho_first_derivaties_CT_exact - first derivaties of rho +% gsw_specvol_CT_exact - specific volume +% gsw_specvol_anom_CT_exact - specific volume anomaly +% gsw_sigma0_CT_exact - sigma0 with reference pressure of 0 dbar +% gsw_sigma1_CT_exact - sigma1 with reference pressure of 1000 dbar +% gsw_sigma2_CT_exact - sigma2 with reference pressure of 2000 dbar +% gsw_sigma3_CT_exact - sigma3 with reference pressure of 3000 dbar +% gsw_sigma4_CT_exact - sigma4 with reference pressure of 4000 dbar +% gsw_sound_speed_CT_exact - sound speed +% gsw_kappa_CT_exact - isentropic compressibility +% gsw_cabbeling_CT_exact - cabbeling coefficient +% gsw_thermobaric_CT_exact - thermobaric coefficient +% gsw_SA_from_rho_CT_exact - Absolute Salinity from density +% gsw_CT_from_rho_exact - Conservative Temperature from density +% gsw_CT_maxdensity_exact - Conservative Temperature of maximum density of seawater +% gsw_internal_energy_CT_exact - internal energy +% gsw_enthalpy_CT_exact - enthalpy +% gsw_enthalpy_diff_CT_exact - difference of enthalpy between two pressures +% gsw_dynamic_enthalpy_CT_exact - dynamic enthalpy +% gsw_enthalpy_first_derivaties_CT_exact - first derivaties of enthalpy +% gsw_enthalpy_second_derivaties_CT_exact - second derivaties of enthalpy +% +% Labroratory functions, for use with a densimeter measuremants +% gsw_SA_from_rho_t_exact - Absolute Salinity from density +% gsw_deltaSA_from_rho_t_exact - Absolute Salinity Anomaly from density +% gsw_rho_t_exact - in-situ density % % basic thermodynamic properties in terms of in-situ t, based on the exact Gibbs function % gsw_rho_t_exact - in-situ density @@ -197,14 +216,12 @@ % gsw_SA_from_rho_t_exact - Absolute Salinity from density % gsw_t_from_rho_exact - in-situ temperature from density % gsw_t_maxdensity_exact - in-situ temperature of maximum density of seawater -% gsw_entropy_t_exact - entropy % gsw_cp_t_exact - isobaric heat capacity % gsw_isochoric_heat_cap_t_exact - isochoric heat capacity % gsw_chem_potential_relative_t_exact - relative chemical potential % gsw_chem_potential_water_t_exact - chemical potential of water in seawater % gsw_chem_potential_salt_t_exact - chemical potential of salt in seawater % gsw_Helmholtz_energy_t_exact - Helmholtz energy -% gsw_adiabatic_lapse_rate_t_exact - adiabatic lapse rate % gsw_osmotic_coefficient_t_exact - osmotic coefficient of seawater % gsw_osmotic_pressure_t_exact - osmotic pressure of seawater % diff --git a/Toolbox/gsw_Abs_Pressure_from_p.m b/Toolbox/gsw_Abs_Pressure_from_p.m index 28029a9..1f49f26 100644 --- a/Toolbox/gsw_Abs_Pressure_from_p.m +++ b/Toolbox/gsw_Abs_Pressure_from_p.m @@ -19,7 +19,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_C3515.m b/Toolbox/gsw_C3515.m index 2b7aeb3..8f93af9 100644 --- a/Toolbox/gsw_C3515.m +++ b/Toolbox/gsw_C3515.m @@ -17,7 +17,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % Culkin and Smith, 1980: Determination of the Concentration of Potassium diff --git a/Toolbox/gsw_CT_first_derivatives.m b/Toolbox/gsw_CT_first_derivatives.m index 6ceddf8..e9aad64 100644 --- a/Toolbox/gsw_CT_first_derivatives.m +++ b/Toolbox/gsw_CT_first_derivatives.m @@ -34,7 +34,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (11th March, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -79,12 +79,9 @@ %-------------------------------------------------------------------------- cp0 = 3991.86795711963; % from Eqn. 3.3.3 of IOC et al. (2010). -n0 = 0; -n2 = 2; -pr0 = zeros(size(SA)); abs_pt = 273.15 + pt; -CT_pt = - (abs_pt.*gsw_gibbs(n0,n2,n0,SA,pt,pr0))./cp0; +CT_pt = - (abs_pt.*gsw_gibbs_pt0_pt0(SA,pt))./cp0; %-------------------------------------------------------------------------- diff --git a/Toolbox/gsw_CT_freezing.m b/Toolbox/gsw_CT_freezing.m index 0bb9454..5772118 100644 --- a/Toolbox/gsw_CT_freezing.m +++ b/Toolbox/gsw_CT_freezing.m @@ -31,7 +31,7 @@ % AUTHOR: % Trevor McDougall, Paul Barker and Rainer Feistal [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_CT_from_entropy.m b/Toolbox/gsw_CT_from_entropy.m index 339612a..8425180 100644 --- a/Toolbox/gsw_CT_from_entropy.m +++ b/Toolbox/gsw_CT_from_entropy.m @@ -22,7 +22,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker. [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_CT_from_pt.m b/Toolbox/gsw_CT_from_pt.m index e7f5c68..0af1446 100644 --- a/Toolbox/gsw_CT_from_pt.m +++ b/Toolbox/gsw_CT_from_pt.m @@ -22,7 +22,7 @@ % AUTHOR: % David Jackett, Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_CT_from_rho.m b/Toolbox/gsw_CT_from_rho.m index c7a4f36..5d78a62 100644 --- a/Toolbox/gsw_CT_from_rho.m +++ b/Toolbox/gsw_CT_from_rho.m @@ -11,11 +11,11 @@ % Calculates the Conservative Temperature of a seawater sample, for given % values of its density, Absolute Salinity and sea pressure (in dbar), % using the computationally-efficient 48-term expression for density in -% terms of SA, CT and p (McDougall et al., 2011) +% terms of SA, CT and p (IOC et al., 2010) % % 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). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -43,7 +43,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -51,11 +51,6 @@ % Intergovernmental Oceanographic Commission, Manuals and Guides No. 56, % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_CT_from_rho_exact.m b/Toolbox/gsw_CT_from_rho_exact.m index c615af4..e65b5d1 100644 --- a/Toolbox/gsw_CT_from_rho_exact.m +++ b/Toolbox/gsw_CT_from_rho_exact.m @@ -34,7 +34,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_CT_from_t.m b/Toolbox/gsw_CT_from_t.m index 53beb93..c5fc015 100644 --- a/Toolbox/gsw_CT_from_t.m +++ b/Toolbox/gsw_CT_from_t.m @@ -25,7 +25,7 @@ % AUTHOR: % David Jackett, Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_CT_maxdensity.m b/Toolbox/gsw_CT_maxdensity.m index d2f95ca..31dd35f 100644 --- a/Toolbox/gsw_CT_maxdensity.m +++ b/Toolbox/gsw_CT_maxdensity.m @@ -12,12 +12,12 @@ % This function returns the Conservative temperature at which the density % of seawater is a maximum, at given Absolute Salinity, SA, and sea % pressure, p (in dbar). This function uses the computationally-efficient -% 48-term expression for density in terms of SA, CT and p (McDougall et -% al., 2013). +% 48-term expression for density in terms of SA, CT and p (IOC et +% al., 2010). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -36,7 +36,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.01 (3rd April, 2011) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -45,11 +45,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See section 3.42 of this TEOS-10 Manual. % -% 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 S.J. Wotherspoon, 2012: A simple modification of % Newton’s method to achieve convergence of order "1 + sqrt(2)". % Submitted to Applied Mathematics and Computation. diff --git a/Toolbox/gsw_CT_maxdensity_exact.m b/Toolbox/gsw_CT_maxdensity_exact.m index 5039452..aa923f1 100644 --- a/Toolbox/gsw_CT_maxdensity_exact.m +++ b/Toolbox/gsw_CT_maxdensity_exact.m @@ -28,7 +28,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_CT_second_derivatives.m b/Toolbox/gsw_CT_second_derivatives.m index cce850f..ffba2c1 100644 --- a/Toolbox/gsw_CT_second_derivatives.m +++ b/Toolbox/gsw_CT_second_derivatives.m @@ -44,7 +44,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -53,11 +53,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org. % See appendix A.12 of this TEOS-10 Manual. % -% 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. -% % This software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_C_from_SP.m b/Toolbox/gsw_C_from_SP.m index 661157f..dd3d6d0 100644 --- a/Toolbox/gsw_C_from_SP.m +++ b/Toolbox/gsw_C_from_SP.m @@ -43,7 +43,7 @@ % AUTHOR: % Trevor McDougall, Paul Barker and Rich Pawlowicz [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % Hill, K.D., T.M. Dauphinee and D.J. Woods, 1986: The extension of the diff --git a/Toolbox/gsw_IPV_vs_fNsquared_ratio.m b/Toolbox/gsw_IPV_vs_fNsquared_ratio.m index f80d19b..8cd79d6 100644 --- a/Toolbox/gsw_IPV_vs_fNsquared_ratio.m +++ b/Toolbox/gsw_IPV_vs_fNsquared_ratio.m @@ -21,11 +21,11 @@ % IPV_vs_fNsquared_ratio is evaluated at the mid pressure between the % individual data points in the vertical. This function uses the % computationally-efficient 48-term expression for density in terms of -% SA, CT and p (McDougall et al., 2013). +% SA, CT and p (IOC et al., 2010). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -53,7 +53,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -62,11 +62,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (3.20.5) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_Nsquared.m b/Toolbox/gsw_Nsquared.m index a7bbb17..8971963 100644 --- a/Toolbox/gsw_Nsquared.m +++ b/Toolbox/gsw_Nsquared.m @@ -23,7 +23,7 @@ % efficient 48-term expression for density in terms of SA, CT and p. 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. (2013). The GSW library function +% in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -49,7 +49,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % Griffies, S. M., 2004: Fundamentals of Ocean Climate Models. Princeton, @@ -61,11 +61,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See section 3.10 and Eqn. (3.10.2) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_P0.m b/Toolbox/gsw_P0.m index bef30c0..15442e6 100644 --- a/Toolbox/gsw_P0.m +++ b/Toolbox/gsw_P0.m @@ -15,7 +15,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_R_from_SP.m b/Toolbox/gsw_R_from_SP.m index 46cf24a..856125c 100644 --- a/Toolbox/gsw_R_from_SP.m +++ b/Toolbox/gsw_R_from_SP.m @@ -43,7 +43,7 @@ % AUTHOR: % Trevor McDougall, Paul Barker and Rich Pawlowicz [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % Culkin and Smith, 1980: Determination of the Concentration of Potassium diff --git a/Toolbox/gsw_SA_CT_plot.m b/Toolbox/gsw_SA_CT_plot.m index fbd2bcd..5d65d03 100644 --- a/Toolbox/gsw_SA_CT_plot.m +++ b/Toolbox/gsw_SA_CT_plot.m @@ -14,11 +14,11 @@ function gsw_SA_CT_plot(SA,CT,p_ref,isopycs,title_string) % point for p = 0 dbar assuming the seawater is completely saturated with % dissolved air and user defined potential density contours. This % function uses the computationally efficient 48-term expression for -% density in terms of SA, CT and p (McDougall et al., 2011). +% density in terms of SA, CT and p (McDougall et al., 2013). % % 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). The GSW library function +% described in McDougall et al. (2013). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -47,7 +47,7 @@ function gsw_SA_CT_plot(SA,CT,p_ref,isopycs,title_string) % MODIFIED: % Paul Barker & Trevor McDougall % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % McDougall T.J., P.M. Barker, R. Feistel and D.R. Jackett, 2013: A diff --git a/Toolbox/gsw_SA_Sstar_from_SP.m b/Toolbox/gsw_SA_Sstar_from_SP.m index ac5baf9..5887b3c 100644 --- a/Toolbox/gsw_SA_Sstar_from_SP.m +++ b/Toolbox/gsw_SA_Sstar_from_SP.m @@ -36,7 +36,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (7th January, 2013) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_SA_from_SP.m b/Toolbox/gsw_SA_from_SP.m index 90f8935..c17a190 100644 --- a/Toolbox/gsw_SA_from_SP.m +++ b/Toolbox/gsw_SA_from_SP.m @@ -33,7 +33,7 @@ % AUTHOR: % David Jackett, Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (7th January, 2013) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_SA_from_Sstar.m b/Toolbox/gsw_SA_from_Sstar.m index 0b7a9df..2d08ab2 100644 --- a/Toolbox/gsw_SA_from_Sstar.m +++ b/Toolbox/gsw_SA_from_Sstar.m @@ -31,7 +31,7 @@ % AUTHOR: % David Jackett, Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (7th January, 2013) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_SA_from_rho.m b/Toolbox/gsw_SA_from_rho.m index bb46f19..48e07b9 100644 --- a/Toolbox/gsw_SA_from_rho.m +++ b/Toolbox/gsw_SA_from_rho.m @@ -10,11 +10,11 @@ % Calculates the Absolute Salinity of a seawater sample, for given values % of its density, Conservative Temperature and sea pressure (in dbar). % This function uses the computationally-efficient 48-term expression for -% density in terms of SA, CT and p (McDougall et al., 2013). +% density in terms of SA, CT and p (IOC et al., 2013). % % 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. (2013). The GSW library function +% described in IOC et al. (2013). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -37,7 +37,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -46,11 +46,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See section 2.5 of this TEOS-10 Manual. % -% 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. -% % Millero, F. J., R. Feistel, D. G. Wright, and T. J. McDougall, 2008: % The composition of Standard Seawater and the definition of the % Reference-Composition Salinity Scale, Deep-Sea Res. I, 55, 50-72. diff --git a/Toolbox/gsw_SA_from_rho_CT.m b/Toolbox/gsw_SA_from_rho_CT.m index 6d100d4..3a521ed 100644 --- a/Toolbox/gsw_SA_from_rho_CT.m +++ b/Toolbox/gsw_SA_from_rho_CT.m @@ -16,11 +16,11 @@ % Calculates the Absolute Salinity of a seawater sample, for given values % of its density, Conservative Temperature and sea pressure (in dbar). % This function uses the computationally-efficient 48-term expression for -% density in terms of SA, CT and p (McDougall et al., 2013). +% density in terms of SA, CT and p (IOC et al., 2013). % % 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. (2013). The GSW library function +% described in IOC et al. (2013). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -43,7 +43,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -52,11 +52,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See section 2.5 of this TEOS-10 Manual. % -% 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. -% % Millero, F. J., R. Feistel, D. G. Wright, and T. J. McDougall, 2008: % The composition of Standard Seawater and the definition of the % Reference-Composition Salinity Scale, Deep-Sea Res. I, 55, 50-72. diff --git a/Toolbox/gsw_SA_from_rho_CT_exact.m b/Toolbox/gsw_SA_from_rho_CT_exact.m index d81aaa9..7d0c75d 100644 --- a/Toolbox/gsw_SA_from_rho_CT_exact.m +++ b/Toolbox/gsw_SA_from_rho_CT_exact.m @@ -12,9 +12,9 @@ % % Note that this function uses the full Gibbs function. There is an % alternative to calling this function, namely -% gsw_SA_from_rho_CT(rho,CT,p), which uses the computationally +% gsw_SA_from_rho(rho,CT,p), which uses the computationally % efficient 48-term expression for density in terms of SA, CT and p -% (McDougall et al., 2013). +% (IOC et al., 2013). % % INPUT: % rho = density of a seawater sample (e.g. 1026 kg/m^3). [ kg/m^3 ] @@ -35,7 +35,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker [ help_gsw@csiro.au ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_SA_from_rho_t.m b/Toolbox/gsw_SA_from_rho_t.m deleted file mode 100644 index 9b4e329..0000000 --- a/Toolbox/gsw_SA_from_rho_t.m +++ /dev/null @@ -1,219 +0,0 @@ -function SA = gsw_SA_from_rho_t(rho,t,p) - -% gsw_SA_from_rho_t Absolute Salinity from density -% ========================================================================= -% -% USAGE: -% SA = gsw_SA_from_rho_t(rho,t,p) -% -% DESCRIPTION: -% Calculates the Absolute Salinity of a seawater sample, for given values -% of its density, in-situ temperature and sea pressure (in dbar). -% This function uses the computationally-efficient 48-term expression for -% density in terms of SA, CT and p (McDougall et al., 2013). -% -% 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. (2013). The GSW library function -% "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if -% some of one's data lies outside this "funnel". -% -% INPUT: -% rho = density of a seawater sample (e.g. 1026 kg/m^3). [ kg/m^3 ] -% Note. This input has not had 1000 kg/m^3 subtracted from it. -% That is, it is 'density', not 'density anomaly'. -% t = in-situ temperature (ITS-90) [ deg C ] -% p = sea pressure [ dbar ] -% ( i.e. absolute pressure - 10.1325 dbar ) -% -% rho & t need to have the same dimensions. -% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where rho & t are MxN. -% -% OUTPUT: -% SA = Absolute Salinity. [ g/kg ] -% Note. This is expressed on the Reference-Composition Salinity -% Scale of Millero et al. (2008). -% -% AUTHOR: -% Paul Barker and Trevor McDougall [ help@teos-10.org ] -% -% VERSION NUMBER: 3.02 (15th 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 http://www.TEOS-10.org -% -% 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. -% -% Millero, F. J., R. Feistel, D. G. Wright, and T. J. McDougall, 2008: -% The composition of Standard Seawater and the definition of the -% Reference-Composition Salinity Scale, Deep-Sea Res. I, 55, 50-72. -% -% The software is available from http://www.TEOS-10.org -% -%========================================================================== - -%-------------------------------------------------------------------------- -% Check variables and resize if necessary -%-------------------------------------------------------------------------- - -if ~(nargin==3) - error('gsw_SA_from_rho_t: Requires three inputs') -end %if - -[md,nd] = size(rho); -[mt,nt] = size(t); -[mp,np] = size(p); - -if (mt ~= md | nt ~= nd) - error('gsw_SA_from_rho_t: rho and t must have same dimensions') -end - -if (mp == 1) & (np == 1) % p scalar - fill to size of rho - p = p*ones(size(rho)); -elseif (nd == np) & (mp == 1) % p is row vector, - p = p(ones(1,md), :); % copy down each column. -elseif (md == mp) & (np == 1) % p is column vector, - p = p(:,ones(1,nd)); % copy across each row. -elseif (nd == mp) & (np == 1) % p is a transposed row vector, - p = p.'; % transposed then - p = p(ones(1,md), :); % copy down each column. -elseif (md == mp) & (nd == np) - % ok -else - error('gsw_SA_from_rho_t: Inputs array dimensions arguments do not agree') -end %if - -if md == 1 - rho = rho.'; - t = t.'; - p = p.'; - transposed = 1; -else - transposed = 0; -end - -%-------------------------------------------------------------------------- -% Start of the calculation -%-------------------------------------------------------------------------- - -v_lab = ones(size(rho))./rho; -CT_0 = gsw_CT_from_t(zeros(size(rho)),t,p); -v_0 = gsw_specvol(zeros(size(rho)),CT_0,p); -CT_50 = gsw_CT_from_t(50*ones(size(rho)),t,p); -v_50 = gsw_specvol(50*ones(size(rho)),CT_50,p); - -SA = 50*(v_lab - v_0)./(v_50 - v_0); % initial estimate of SA. -SA(SA < 0 | SA > 50) = NaN; - -v_SA_t = 0.02.*(v_50 - v_0); % initial estimate of the derivative of -% specific volume with respect to -% Absolute Salinity at constant in-situ -% temperature and pressure. - -%-------------------------------------------------------------------------- -% Begin the modified Newton-Raphson iterative procedure -%-------------------------------------------------------------------------- - -for Number_of_iterations = 1:2 - SA_old = SA; - CT_old = gsw_CT_from_t(SA_old,t,p); - delta_v = gsw_specvol(SA_old,CT_old,p) - v_lab; - SA = SA_old - delta_v./v_SA_t; % this is half way through the modified N-R method (McDougall and Wotherspoon, 2012) - SA(SA < 0) = 0; - SA_mean = 0.5*(SA + SA_old); - CT_mean = gsw_CT_from_t(SA_mean,t,p); - [rho,alpha,beta] = gsw_rho_alpha_beta(SA_mean,CT_mean,p); - specvol = 1./rho; - v_SA = - beta.*specvol; - v_CT = alpha.*specvol; - dCT_dSA = gsw_dCT_dSA(SA_mean,t,p);% This is a call to get the -% derivative of CT with respect to -% Absolute Salinity at constant -% in-situ temperature and pressure. - - v_SA_t = v_SA + v_CT.*dCT_dSA; -% v_SA_t is the derivative of specific volume with respect to -% Absolute Salinity at constant in-situ temperature and pressure, -% while v_SA is the derivative of specific volume with respect to -% Absolute Salinity at constant Conservative Temperature and pressure. - - SA = SA_old - delta_v./v_SA_t; - SA(SA < 0 | SA > 50) = NaN; -end - -% After two iterations of this modified Newton-Raphson iteration, -% the error in SA is no larger than 3x10^-12 g/kg, which -% is machine precision for this calculation. - -if transposed - SA = SA.'; -end - -end - -%########################################################################## - -function dCT_dSA = gsw_dCT_dSA(SA,t,p) -%-------------------------------------------------------------------------- -% This function calculates the derivative of Conservative Temperature -% with respect to Absolute Salinity at constant in-situ temperature and -% pressure. The equation for this derivative, in terms of the derivatives -% of the Gibbs function is given in Eqn. (A.15.8) of the TEOS-10 Manual -% (IOC et al., 2010). The code below is identical to the first part of the -% GSW function gsw_beta_const_CT_t_exact. -% -% INPUT: -% SA = Absolute Salinity [ g/kg ] -% t = in-situ temperature (ITS-90) [ deg C ] -% p = sea pressure [ dbar ] -% ( i.e. absolute pressure - 10.1325 dbar ) -%-------------------------------------------------------------------------- - -db2Pa = 1e-4; -sfac = 0.0248826675584615; % sfac = 1/(40*(35.16504/35)). -cp0 = 3991.86795711963; - -pt0 = gsw_pt0_from_t(SA,t,p); - -x2 = sfac.*SA; -x = sqrt(x2); -y = 0.025*t; -y_pt = 0.025*pt0; -z = db2Pa*p; %Note.The input pressure (p) is sea pressure in units of dbar. - -g_SA_T_mod = 1187.3715515697959 + z.*(1458.233059470092 + ... - z.*(-687.913805923122 + z.*(249.375342232496 + z.*(-63.313928772146 + 14.09317606630898.*z)))) + ... - x.*(-1480.222530425046 + x.*(2175.341332000392 + x.*(-980.14153344888 + 220.542973797483.*x) + ... - y.*(-548.4580073635929 + y.*(592.4012338275047 + y.*(-274.2361238716608 + 49.9394019139016.*y))) - ... - 90.6734234051316.*z) + z.*(-525.876123559641 + (249.57717834054571 - 88.449193048287.*z).*z) + ... - y.*(-258.3988055868252 + z.*(2298.348396014856 + z.*(-325.1503575102672 + 153.8390924339484.*z)) + ... - y.*(-90.2046337756875 - 4142.8793862113125.*z + y.*(10.50720794170734 + 2814.78225133626.*z)))) + ... - y.*(3520.125411988816 + y.*(-1351.605895580406 + ... - y.*(731.4083582010072 + y.*(-216.60324087531103 + 25.56203650166196.*y) + ... - z.*(-2381.829935897496 + (597.809129110048 - 291.8983352012704.*z).*z)) + ... - z.*(4165.4688847996085 + z.*(-1229.337851789418 + (681.370187043564 - 66.7696405958478.*z).*z))) + ... - z.*(-3443.057215135908 + z.*(1349.638121077468 + ... - z.*(-713.258224830552 + (176.8161433232 - 31.68006188846728.*z).*z)))); -g_SA_T_mod = 0.5*sfac*0.025*g_SA_T_mod; - -g_SA_mod = 8645.36753595126 + ... - x.*(-7296.43987145382 + x.*(8103.20462414788 + ... - y_pt.*(2175.341332000392 + y_pt.*(-274.2290036817964 + ... - y_pt.*(197.4670779425016 + y_pt.*(-68.5590309679152 + 9.98788038278032.*y_pt)))) + ... - x.*(-5458.34205214835 - 980.14153344888.*y_pt + ... - x.*(2247.60742726704 - 340.1237483177863.*x + 220.542973797483.*y_pt))) + ... - y_pt.*(-1480.222530425046 + y_pt.*(-129.1994027934126 + ... - y_pt.*(-30.0682112585625 + y_pt.*(2.626801985426835 ))))) + ... - y_pt.*(1187.3715515697959 + y_pt.*(1760.062705994408 + y_pt.*(-450.535298526802 + ... - y_pt.*(182.8520895502518 + y_pt.*(-43.3206481750622 + 4.26033941694366.*y_pt))))); -g_SA_mod = 0.5*sfac*g_SA_mod; - -dCT_dSA = (g_SA_mod - (273.15 + pt0).*g_SA_T_mod)./cp0; - -end diff --git a/Toolbox/gsw_SA_from_rho_t_pmid.m b/Toolbox/gsw_SA_from_rho_t_pmid.m deleted file mode 100644 index 6604a04..0000000 --- a/Toolbox/gsw_SA_from_rho_t_pmid.m +++ /dev/null @@ -1,228 +0,0 @@ -function SA = gsw_SA_from_rho_t_pmid(rho,t,p,pmid) - -% gsw_SA_from_rho_t_pmid Absolute Salinity from density -% ========================================================================= -% -% USAGE: -% SA = gsw_SA_from_rho_t_pmid(rho,t,p,pmid) -% -% DESCRIPTION: -% Calculates the Absolute Salinity of a seawater sample, for given values -% of its density, in-situ temperature and sea pressure (in dbar). -% This function uses the computationally-efficient 48-term expression for -% density in terms of SA, CT and p (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). The GSW library function -% "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if -% some of one's data lies outside this "funnel". -% -% INPUT: -% rho = density of a seawater sample (e.g. 1026 kg/m^3). [ kg/m^3 ] -% Note. This input has not had 1000 kg/m^3 subtracted from it. -% That is, it is 'density', not 'density anomaly'. -% t = in-situ temperature (ITS-90) [ deg C ] -% p = sea pressure [ dbar ] -% ( i.e. absolute pressure - 10.1325 dbar ) -% pmid = mid-point sea pressure [ dbar ] -% -% rho & t need to have the same dimensions. -% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where rho & t are MxN. -% pmid need to have dimensions 1x1. -% -% OUTPUT: -% SA = Absolute Salinity. [ g/kg ] -% Note. This is expressed on the Reference-Composition Salinity -% Scale of Millero et al. (2008). -% -% AUTHOR: -% Paul Barker and Trevor McDougall [ help@teos-10.org ] -% -% VERSION NUMBER: 3.02 (15th 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 http://www.TEOS-10.org -% -% 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. -% -% Millero, F. J., R. Feistel, D. G. Wright, and T. J. McDougall, 2008: -% The composition of Standard Seawater and the definition of the -% Reference-Composition Salinity Scale, Deep-Sea Res. I, 55, 50-72. -% -% The software is available from http://www.TEOS-10.org -% -%========================================================================== - -%-------------------------------------------------------------------------- -% Check variables and resize if necessary -%-------------------------------------------------------------------------- - -if ~(nargin == 4) - error('gsw_SA_from_rho_t_pmid: Requires three inputs') -end %if - -[md,nd] = size(rho); -[mt,nt] = size(t); -[mp,np] = size(p); - -if (mt ~= md | nt ~= nd) - error('gsw_SA_from_rho_t_pmid: rho and t must have same dimensions') -end - -if (mp == 1) & (np == 1) % p scalar - fill to size of rho - p = p*ones(size(rho)); -elseif (nd == np) & (mp == 1) % p is row vector, - p = p(ones(1,md), :); % copy down each column. -elseif (md == mp) & (np == 1) % p is column vector, - p = p(:,ones(1,nd)); % copy across each row. -elseif (nd == mp) & (np == 1) % p is a transposed row vector, - p = p.'; % transposed then - p = p(ones(1,md), :); % copy down each column. -elseif (md == mp) & (nd == np) - % ok -else - error('gsw_SA_from_rho_t: Inputs array dimensions arguments do not agree') -end %if - -[mpm,npm] = size(pmid); -if (mpm ~= 1 | npm ~= 1) - error('gsw_SA_from_rho_t_pmid: pmid needs to be a single value') -end - -if md == 1 - rho = rho.'; - t = t.'; - p = p.'; - transposed = 1; -else - transposed = 0; -end - -%-------------------------------------------------------------------------- -% Start of the calculation -%-------------------------------------------------------------------------- - -v_lab = ones(size(rho))./rho; -CT_0 = gsw_CT_from_t(zeros(size(rho)),t,p); -v_0 = gsw_specvol(zeros(size(rho)),CT_0,pmid); -CT_50 = gsw_CT_from_t(50*ones(size(rho)),t,p); -v_50 = gsw_specvol(50*ones(size(rho)),CT_50,pmid); - -SA = 50*(v_lab - v_0)./(v_50 - v_0); % initial estimate of SA. - -SA(SA < 0 | SA > 50) = NaN; - -v_SA_t = 0.02.*(v_50 - v_0); % initial estimate of the derivative of -% specific volume with respect to -% Absolute Salinity at constant in-situ -% temperature and pressure. - -%-------------------------------------------------------------------------- -% Begin the modified Newton-Raphson iterative procedure (McDougall and -% Wotherspoon, 2012) -%-------------------------------------------------------------------------- - -for Number_of_iterations = 1:2 - SA_old = SA; - CT_old = gsw_CT_from_t(SA_old,t,p); - delta_v = gsw_specvol(SA_old,CT_old,pmid) - v_lab; - SA = SA_old - delta_v./v_SA_t; % this is half way through the modified N-R method - SA(SA < 0) = 0; - SA_mean = 0.5*(SA + SA_old); - CT_mean = gsw_CT_from_t(SA_mean,t,p); - [rho,alpha,beta] = gsw_rho_alpha_beta(SA_mean,CT_mean,pmid); - specvol = 1./rho; - v_SA = - beta.*specvol; - v_CT = alpha.*specvol; - dCT_dSA = gsw_dCT_dSA(SA_mean,t,pmid);% This is a call to get the -% derivative of CT with respect to -% Absolute Salinity at constant -% in-situ temperature and pressure. - - v_SA_t = v_SA + v_CT.*dCT_dSA; -% v_SA_t is the derivative of specific volume with respect to -% Absolute Salinity at constant in-situ temperature and pressure, -% while v_SA is the derivative of specific volume with respect to -% Absolute Salinity at constant Conservative Temperature and pressure. - - SA = SA_old - delta_v./v_SA_t; - SA(SA < 0 | SA > 50) = NaN; -end - -% After two iterations of this modified Newton-Raphson iteration, -% the error in SA is no larger than 3x10^-12 g/kg, which -% is machine precision for this calculation. - -if transposed - SA = SA.'; -end - -end - -%########################################################################## - -function dCT_dSA = gsw_dCT_dSA(SA,t,p) -%-------------------------------------------------------------------------- -% This function calculates the derivative of Conservative Temperature -% with respect to Absolute Salinity at constant in-situ temperature and -% pressure. The equation for this derivative, in terms of the derivatives -% of the Gibbs function is given in Eqn. (A.15.8) of the TEOS-10 Manual -% (IOC et al., 2010). The code below is identical to the first part of the -% GSW function gsw_beta_const_CT_t_exact. -% -% INPUT: -% SA = Absolute Salinity [ g/kg ] -% t = in-situ temperature (ITS-90) [ deg C ] -% p = sea pressure [ dbar ] -% ( i.e. absolute pressure - 10.1325 dbar ) -%-------------------------------------------------------------------------- - -db2Pa = 1e-4; -sfac = 0.0248826675584615; % sfac = 1/(40*(35.16504/35)). -cp0 = 3991.86795711963; - -pt0 = gsw_pt0_from_t(SA,t,p); - -x2 = sfac.*SA; -x = sqrt(x2); -y = 0.025*t; -y_pt = 0.025*pt0; -z = db2Pa*p; %Note.The input pressure (p) is sea pressure in units of dbar. - -g_SA_T_mod = 1187.3715515697959 + z.*(1458.233059470092 + ... - z.*(-687.913805923122 + z.*(249.375342232496 + z.*(-63.313928772146 + 14.09317606630898.*z)))) + ... - x.*(-1480.222530425046 + x.*(2175.341332000392 + x.*(-980.14153344888 + 220.542973797483.*x) + ... - y.*(-548.4580073635929 + y.*(592.4012338275047 + y.*(-274.2361238716608 + 49.9394019139016.*y))) - ... - 90.6734234051316.*z) + z.*(-525.876123559641 + (249.57717834054571 - 88.449193048287.*z).*z) + ... - y.*(-258.3988055868252 + z.*(2298.348396014856 + z.*(-325.1503575102672 + 153.8390924339484.*z)) + ... - y.*(-90.2046337756875 - 4142.8793862113125.*z + y.*(10.50720794170734 + 2814.78225133626.*z)))) + ... - y.*(3520.125411988816 + y.*(-1351.605895580406 + ... - y.*(731.4083582010072 + y.*(-216.60324087531103 + 25.56203650166196.*y) + ... - z.*(-2381.829935897496 + (597.809129110048 - 291.8983352012704.*z).*z)) + ... - z.*(4165.4688847996085 + z.*(-1229.337851789418 + (681.370187043564 - 66.7696405958478.*z).*z))) + ... - z.*(-3443.057215135908 + z.*(1349.638121077468 + ... - z.*(-713.258224830552 + (176.8161433232 - 31.68006188846728.*z).*z)))); -g_SA_T_mod = 0.5*sfac*0.025*g_SA_T_mod; - -g_SA_mod = 8645.36753595126 + ... - x.*(-7296.43987145382 + x.*(8103.20462414788 + ... - y_pt.*(2175.341332000392 + y_pt.*(-274.2290036817964 + ... - y_pt.*(197.4670779425016 + y_pt.*(-68.5590309679152 + 9.98788038278032.*y_pt)))) + ... - x.*(-5458.34205214835 - 980.14153344888.*y_pt + ... - x.*(2247.60742726704 - 340.1237483177863.*x + 220.542973797483.*y_pt))) + ... - y_pt.*(-1480.222530425046 + y_pt.*(-129.1994027934126 + ... - y_pt.*(-30.0682112585625 + y_pt.*(2.626801985426835 ))))) + ... - y_pt.*(1187.3715515697959 + y_pt.*(1760.062705994408 + y_pt.*(-450.535298526802 + ... - y_pt.*(182.8520895502518 + y_pt.*(-43.3206481750622 + 4.26033941694366.*y_pt))))); -g_SA_mod = 0.5*sfac*g_SA_mod; - -dCT_dSA = (g_SA_mod - (273.15 + pt0).*g_SA_T_mod)./cp0; - -end diff --git a/Toolbox/gsw_SK_from_SP.m b/Toolbox/gsw_SK_from_SP.m deleted file mode 100644 index 09d76c8..0000000 --- a/Toolbox/gsw_SK_from_SP.m +++ /dev/null @@ -1,51 +0,0 @@ -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.02 (16th 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 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 -%-------------------------------------------------------------------------- - -% This line ensures that SP is non-negative. -SP(SP < 0) = 0; - -SK = 0.03 + SP.*(1.805/1.80655); - -end diff --git a/Toolbox/gsw_SP_from_C.m b/Toolbox/gsw_SP_from_C.m index c673d7f..6dee1e0 100644 --- a/Toolbox/gsw_SP_from_C.m +++ b/Toolbox/gsw_SP_from_C.m @@ -31,7 +31,7 @@ % AUTHOR: % Paul Barker, Trevor McDougall and Rich Pawlowicz [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (12th March, 2013) % % REFERENCES: % Culkin and Smith, 1980: Determination of the Concentration of Potassium @@ -142,41 +142,45 @@ k = 0.0162; -t68 = t.*1.00024; +[Iocean] = find(~isnan(C + t + p)); + +t68 = t(Iocean).*1.00024; ft68 = (t68 - 15)./(1 + k*(t68 - 15)); % The dimensionless conductivity ratio, R, is the conductivity input, C, % divided by the present estimate of C(SP=35, t_68=15, p=0) which is % 42.9140 mS/cm (=4.29140 S/m), (Culkin and Smith, 1980). -R = 0.023302418791070513.*C; % 0.023302418791070513 = 1./42.9140 +R = 0.023302418791070513.*C(Iocean); % 0.023302418791070513 = 1./42.9140 % rt_lc corresponds to rt as defined in the UNESCO 44 (1983) routines. rt_lc = c0 + (c1 + (c2 + (c3 + c4.*t68).*t68).*t68).*t68; -Rp = 1 + (p.*(e1 + e2.*p + e3.*p.*p))./ ... +Rp = 1 + (p(Iocean).*(e1 + e2.*p(Iocean) + e3.*p(Iocean).*p(Iocean)))./ ... (1 + d1.*t68 + d2.*t68.*t68 + (d3 + d4.*t68).*R); -Rt = R./(Rp.*rt_lc); +Rt = R./(Rp.*rt_lc); Rt(Rt < 0) = NaN; Rtx = sqrt(Rt); -SP = a0 + (a1 + (a2 + (a3 + (a4 + a5.*Rtx).*Rtx).*Rtx).*Rtx).*Rtx + ... +SP = NaN(size(C)); + +SP(Iocean) = a0 + (a1 + (a2 + (a3 + (a4 + a5.*Rtx).*Rtx).*Rtx).*Rtx).*Rtx + ... ft68.*(b0 + (b1 + (b2 + (b3 + (b4 + b5.*Rtx).*Rtx).*Rtx).*Rtx).*Rtx); % The following section of the code is designed for SP < 2 based on the % Hill et al. (1986) algorithm. This algorithm is adjusted so that it is % exactly equal to the PSS-78 algorithm at SP = 2. -if any(SP < 2) - [I2] = find(SP < 2); - Hill_ratio = gsw_Hill_ratio_at_SP2(t(I2)); +if any(SP(Iocean) < 2) + [I2] = find(SP(Iocean) < 2); + Hill_ratio = gsw_Hill_ratio_at_SP2(t(Iocean(I2))); x = 400*Rt(I2); sqrty = 10*Rtx(I2); - part1 = 1 + x.*(1.5 + x) ; + part1 = 1 + x.*(1.5 + x); part2 = 1 + sqrty.*(1 + sqrty.*(1 + sqrty)); - SP_Hill_raw = SP(I2) - a0./part1 - b0.*ft68(I2)./part2; - SP(I2) = Hill_ratio.*SP_Hill_raw; + SP_Hill_raw = SP(Iocean(I2)) - a0./part1 - b0.*ft68(I2)./part2; + SP(Iocean(I2)) = Hill_ratio.*SP_Hill_raw; end % This line ensures that SP is non-negative. diff --git a/Toolbox/gsw_SP_from_R.m b/Toolbox/gsw_SP_from_R.m index 51c862c..bb69104 100644 --- a/Toolbox/gsw_SP_from_R.m +++ b/Toolbox/gsw_SP_from_R.m @@ -30,7 +30,7 @@ % AUTHOR: % Paul Barker, Trevor McDougall and Rich Pawlowicz [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (12th March, 2013) % % REFERENCES: % Hill, K.D., T.M. Dauphinee & D.J. Woods, 1986: The extension of the @@ -136,35 +136,39 @@ k = 0.0162; -t68 = t.*1.00024; +[Iocean] = find(~isnan(R + t + p)); + +t68 = t(Iocean).*1.00024; ft68 = (t68 - 15)./(1 + k*(t68 - 15)); % rt_lc corresponds to rt as defined in the UNESCO 44 (1983) routines. rt_lc = c0 + (c1 + (c2 + (c3 + c4.*t68).*t68).*t68).*t68; -Rp = 1 + (p.*(e1 + e2.*p + e3.*p.*p))./ ... - (1 + d1.*t68 + d2.*t68.*t68 + (d3 + d4.*t68).*R); -Rt = R./(Rp.*rt_lc); +Rp = 1 + (p(Iocean).*(e1 + p(Iocean).*(e2 + e3.*p(Iocean))))./ ... + (1 + d1.*t68 + d2.*t68.*t68 + (d3 + d4.*t68).*R(Iocean)); +Rt = R(Iocean)./(Rp.*rt_lc); Rt(Rt < 0) = NaN; Rtx = sqrt(Rt); -SP = a0 + (a1 + (a2 + (a3 + (a4 + a5.*Rtx).*Rtx).*Rtx).*Rtx).*Rtx + ... +SP = NaN(size(R)); + +SP(Iocean) = a0 + (a1 + (a2 + (a3 + (a4 + a5.*Rtx).*Rtx).*Rtx).*Rtx).*Rtx + ... ft68.*(b0 + (b1 + (b2+ (b3 + (b4 + b5.*Rtx).*Rtx).*Rtx).*Rtx).*Rtx); % The following section of the code is designed for SP < 2 based on the % Hill et al. (1986) algorithm. This algorithm is adjusted so that it is % exactly equal to the PSS-78 algorithm at SP = 2. -if any(SP < 2) - [I2] = find(SP < 2); - Hill_ratio = gsw_Hill_ratio_at_SP2(t(I2)); +if any(SP(Iocean) < 2) + [I2] = find(SP(Iocean) < 2); + Hill_ratio = gsw_Hill_ratio_at_SP2(t(Iocean(I2))); x = 400*Rt(I2); sqrty = 10*Rtx(I2); - part1 = 1 + x.*(1.5 + x) ; + part1 = 1 + x.*(1.5 + x); part2 = 1 + sqrty.*(1 + sqrty.*(1 + sqrty)); SP_Hill_raw = SP(I2) - a0./part1 - b0.*ft68(I2)./part2; - SP(I2) = Hill_ratio.*SP_Hill_raw; + SP(Iocean(I2)) = Hill_ratio.*SP_Hill_raw; end % This line ensures that SP is non-negative. diff --git a/Toolbox/gsw_SP_from_SA.m b/Toolbox/gsw_SP_from_SA.m index 22b860e..b17db78 100644 --- a/Toolbox/gsw_SP_from_SA.m +++ b/Toolbox/gsw_SP_from_SA.m @@ -31,7 +31,7 @@ % AUTHOR: % David Jackett, Trevor McDougall and Paul Barker [ help_gsw@csiro.au ] % -% VERSION NUMBER: 3.02 (7th January, 2013) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_SP_from_SK.m b/Toolbox/gsw_SP_from_SK.m index 8a639a8..6f2f330 100644 --- a/Toolbox/gsw_SP_from_SK.m +++ b/Toolbox/gsw_SP_from_SK.m @@ -18,7 +18,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_SP_from_SR.m b/Toolbox/gsw_SP_from_SR.m index 1548d33..d5d8107 100644 --- a/Toolbox/gsw_SP_from_SR.m +++ b/Toolbox/gsw_SP_from_SR.m @@ -18,7 +18,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_SP_from_Sstar.m b/Toolbox/gsw_SP_from_Sstar.m index b5bfae5..0376660 100644 --- a/Toolbox/gsw_SP_from_Sstar.m +++ b/Toolbox/gsw_SP_from_Sstar.m @@ -31,7 +31,7 @@ % AUTHOR: % David Jackett, Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (7th January, 2013) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_SP_salinometer.m b/Toolbox/gsw_SP_salinometer.m index e8b985a..a44fa2d 100644 --- a/Toolbox/gsw_SP_salinometer.m +++ b/Toolbox/gsw_SP_salinometer.m @@ -32,7 +32,7 @@ % AUTHOR: % Paul Barker, Trevor McDougall and Rich Pawlowicz [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % Fofonoff, P. and R.C. Millard Jr. 1983: Algorithms for computation of diff --git a/Toolbox/gsw_SR_from_SP.m b/Toolbox/gsw_SR_from_SP.m index afff60e..1918e1a 100644 --- a/Toolbox/gsw_SR_from_SP.m +++ b/Toolbox/gsw_SR_from_SP.m @@ -18,7 +18,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_SSO.m b/Toolbox/gsw_SSO.m index b97293b..95b4d7d 100644 --- a/Toolbox/gsw_SSO.m +++ b/Toolbox/gsw_SSO.m @@ -20,7 +20,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_SonCl.m b/Toolbox/gsw_SonCl.m index 450f8ff..86fe104 100644 --- a/Toolbox/gsw_SonCl.m +++ b/Toolbox/gsw_SonCl.m @@ -20,7 +20,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % Millero, F. J., R. Feistel, D. G. Wright, and T. J. McDougall, 2008: diff --git a/Toolbox/gsw_Sstar_from_SA.m b/Toolbox/gsw_Sstar_from_SA.m index dfc83d7..f31d3c1 100644 --- a/Toolbox/gsw_Sstar_from_SA.m +++ b/Toolbox/gsw_Sstar_from_SA.m @@ -31,7 +31,7 @@ % AUTHOR: % David Jackett, Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (7th January, 2013) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_Sstar_from_SP.m b/Toolbox/gsw_Sstar_from_SP.m index da2e56a..f3430d1 100644 --- a/Toolbox/gsw_Sstar_from_SP.m +++ b/Toolbox/gsw_Sstar_from_SP.m @@ -33,7 +33,7 @@ % AUTHOR: % David Jackett, Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (7th January, 2013) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_T0.m b/Toolbox/gsw_T0.m index 04422fe..0ecd76d 100644 --- a/Toolbox/gsw_T0.m +++ b/Toolbox/gsw_T0.m @@ -16,7 +16,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_Turner_Rsubrho.m b/Toolbox/gsw_Turner_Rsubrho.m index da6bafc..5512530 100644 --- a/Toolbox/gsw_Turner_Rsubrho.m +++ b/Toolbox/gsw_Turner_Rsubrho.m @@ -14,7 +14,7 @@ % Brunt-Vaisala Frequency squared, N^2). Tu and Rsubrho are evaluated at % the mid pressure between the individual data points in the vertical. % This function uses computationally-efficient 48-term expression for -% density in terms of SA, CT and p (McDougall et al., 2013). Note that +% density in terms of SA, CT and p (IOC et al., 2010). Note that % in the double-diffusive literature, papers concerned with the % "diffusive" form of double-diffusive convection often define the % stability ratio as the reciprocal of what is defined here as the @@ -22,7 +22,7 @@ % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -47,7 +47,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -56,11 +56,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqns. (3.15.1) and (3.16.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_adiabatic_lapse_rate_from_CT.m b/Toolbox/gsw_adiabatic_lapse_rate_from_CT.m new file mode 100644 index 0000000..d01886c --- /dev/null +++ b/Toolbox/gsw_adiabatic_lapse_rate_from_CT.m @@ -0,0 +1,99 @@ +function adiabatic_lapse_rate = gsw_adiabatic_lapse_rate_from_CT(SA,CT,p) + +% gsw_adiabatic_lapse_rate_from_CT adiabatic lapse rate +%========================================================================== +% +% USAGE: +% adiabatic_lapse_rate = gsw_adiabatic_lapse_rate_from_CT(SA,CT,p) +% +% DESCRIPTION: +% Calculates the adiabatic lapse rate of sea water from Conservative +% Temperature. +% +% INPUT: +% SA = Absolute Salinity [ g/kg ] +% CT = Conservative Temperature (ITS-90) [ deg C ] +% p = sea pressure [ dbar ] +% ( i.e. absolute pressure - 10.1325 dbar ) +% +% SA & CT need to have the same dimensions. +% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & CT are MxN. +% +% OUTPUT: +% adiabatic_lapse_rate = adiabatic lapse rate [ K/Pa ] +% Note. The output is in unit of degress Celsius per Pa, +% (or equivilently K/Pa) not in units of K/dbar. +% +% AUTHOR: +% Trevor McDougall and Paul Barker [ help@teos-10.org ] +% +% VERSION NUMBER: 3.03 (29th April, 2013) +% +% 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 Eqn. (2.22.1) of this TEOS-10 Manual. +% +% The software is available from http://www.TEOS-10.org +% +%========================================================================== + +%-------------------------------------------------------------------------- +% Check variables and resize if necessary +%-------------------------------------------------------------------------- + +if ~(nargin == 3) + error('gsw_adiabatic_lapse_rate_from_CT: Requires three inputs') +end + +[ms,ns] = size(SA); +[mt,nt] = size(CT); +[mp,np] = size(p); + +if (mt ~= ms | nt ~= ns) + error('gsw_adiabatic_lapse_rate_from_CT: SA and CT must have same dimensions') +end + +if (mp == 1) & (np == 1) % p scalar - fill to size of SA + p = p*ones(size(SA)); +elseif (ns == np) & (mp == 1) % p is row vector, + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (np == 1) % p is column vector, + p = p(:,ones(1,ns)); % copy across each row. +elseif (ns == mp) & (np == 1) % p is a transposed row vector, + p = p.'; % transposed then + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (ns == np) + % ok +else + error('gsw_adiabatic_lapse_rate_from_CT: Inputs array dimensions arguments do not agree') +end %if + +if ms == 1 + SA = SA.'; + CT = CT.'; + p = p.'; + transposed = 1; +else + transposed = 0; +end + +%-------------------------------------------------------------------------- +% Start of the calculation +%-------------------------------------------------------------------------- + +n0 = 0; +n1 = 1; +n2 = 2; + +t = gsw_t_from_CT(SA,CT,p); + +adiabatic_lapse_rate = -gsw_gibbs(n0,n1,n1,SA,t,p)./(gsw_gibbs(n0,n2,n0,SA,t,p)); + +if transposed + adiabatic_lapse_rate = adiabatic_lapse_rate.'; +end + +end diff --git a/Toolbox/gsw_adiabatic_lapse_rate_t_exact.m b/Toolbox/gsw_adiabatic_lapse_rate_from_t.m similarity index 77% rename from Toolbox/gsw_adiabatic_lapse_rate_t_exact.m rename to Toolbox/gsw_adiabatic_lapse_rate_from_t.m index 319660e..55f1f01 100644 --- a/Toolbox/gsw_adiabatic_lapse_rate_t_exact.m +++ b/Toolbox/gsw_adiabatic_lapse_rate_from_t.m @@ -1,10 +1,10 @@ -function adiabatic_lapse_rate_t_exact = gsw_adiabatic_lapse_rate_t_exact(SA,t,p) +function adiabatic_lapse_rate = gsw_adiabatic_lapse_rate_from_t(SA,t,p) -% gsw_adiabatic_lapse_rate_t_exact adiabatic lapse rate +% gsw_adiabatic_lapse_rate_from_t adiabatic lapse rate %========================================================================== % % USAGE: -% adiabatic_lapse_rate_t_exact = gsw_adiabatic_lapse_rate_t_exact(SA,t,p) +% adiabatic_lapse_rate = gsw_adiabatic_lapse_rate_from_t(SA,t,p) % % DESCRIPTION: % Calculates the adiabatic lapse rate of sea water @@ -19,14 +19,14 @@ % p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & t are MxN. % % OUTPUT: -% adiabatic_lapse_rate_t_exact = adiabatic lapse rate [ K/Pa ] +% adiabatic_lapse_rate = adiabatic lapse rate [ K/Pa ] % Note. The output is in unit of degress Celsius per Pa, % (or equivilently K/Pa) not in units of K/dbar. % % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -44,7 +44,7 @@ %-------------------------------------------------------------------------- if ~(nargin == 3) - error('gsw_adiabatic_lapse_rate_t_exact: Requires three inputs') + error('gsw_adiabatic_lapse_rate_from_t: Requires three inputs') end [ms,ns] = size(SA); @@ -52,7 +52,7 @@ [mp,np] = size(p); if (mt ~= ms | nt ~= ns) - error('gsw_adiabatic_lapse_rate_t_exact: SA and t must have same dimensions') + error('gsw_adiabatic_lapse_rate_from_t: SA and t must have same dimensions') end if (mp == 1) & (np == 1) % p scalar - fill to size of SA @@ -67,7 +67,7 @@ elseif (ms == mp) & (ns == np) % ok else - error('gsw_adiabatic_lapse_rate_t_exact: Inputs array dimensions arguments do not agree') + error('gsw_adiabatic_lapse_rate_from_t: Inputs array dimensions arguments do not agree') end %if if ms == 1 @@ -87,10 +87,10 @@ n1 = 1; n2 = 2; -adiabatic_lapse_rate_t_exact = -gsw_gibbs(n0,n1,n1,SA,t,p)./(gsw_gibbs(n0,n2,n0,SA,t,p)); +adiabatic_lapse_rate = -gsw_gibbs(n0,n1,n1,SA,t,p)./(gsw_gibbs(n0,n2,n0,SA,t,p)); if transposed - adiabatic_lapse_rate_t_exact = adiabatic_lapse_rate_t_exact.'; + adiabatic_lapse_rate = adiabatic_lapse_rate.'; end end diff --git a/Toolbox/gsw_alpha.m b/Toolbox/gsw_alpha.m index 20977a8..4b5a24c 100644 --- a/Toolbox/gsw_alpha.m +++ b/Toolbox/gsw_alpha.m @@ -10,11 +10,11 @@ % DESCRIPTION: % Calculates the thermal expansion coefficient of seawater with respect to % Conservative Temperature using the computationally-efficient 48-term -% expression for density in terms of SA, CT and p (McDougall et al., 2011) +% expression for density in terms of SA, CT and p (McDougall et al., 2010) % % 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. (2013). The GSW library function +% described in McDougall et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -34,7 +34,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -43,11 +43,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (2.18.3) of this TEOS-10 manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_alpha_CT.m b/Toolbox/gsw_alpha_CT.m index dd22aaf..1fb48f9 100644 --- a/Toolbox/gsw_alpha_CT.m +++ b/Toolbox/gsw_alpha_CT.m @@ -16,11 +16,11 @@ % DESCRIPTION: % Calculates the thermal expansion coefficient of seawater with respect to % Conservative Temperature using the computationally-efficient 48-term -% expression for density in terms of SA, CT and p (McDougall et al., 2013) +% expression for density in terms of SA, CT and p (IOC et al., 2010) % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -40,7 +40,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -49,11 +49,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (2.18.3) of this TEOS-10 manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_alpha_CT_exact.m b/Toolbox/gsw_alpha_CT_exact.m index 9a02f6d..c19f521 100644 --- a/Toolbox/gsw_alpha_CT_exact.m +++ b/Toolbox/gsw_alpha_CT_exact.m @@ -13,9 +13,9 @@ % Temperature. % % Note that this function uses the full Gibbs function. There is an -% alternative to calling this function, namely gsw_alpha_wrt_CT(SA,CT,p) +% alternative to calling this function, namely gsw_alpha(SA,CT,p) % which uses the computationally efficient 48-term expression for density -% in terms of SA, CT and p (McDougall et al., (2013)). +% in terms of SA, CT and p (McDougall et al., (2010)). % % INPUT: % SA = Absolute Salinity [ g/kg ] @@ -33,7 +33,7 @@ % AUTHOR: % David Jackett, Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -42,11 +42,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (2.18.3) of this TEOS-10 manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_alpha_on_beta.m b/Toolbox/gsw_alpha_on_beta.m new file mode 100644 index 0000000..b14e52a --- /dev/null +++ b/Toolbox/gsw_alpha_on_beta.m @@ -0,0 +1,255 @@ +function alpha_on_beta = gsw_alpha_on_beta(SA,CT,p) + +% gsw_alpha_on_beta alpha/beta (48-term equation) +%========================================================================== +% +% USAGE: +% alpha_on_beta = gsw_alpha_on_beta(SA,CT,p) +% +% DESCRIPTION: +% Calculates alpha divided by beta, where alpha is the thermal expansion +% coefficient and beta is the saline contraction coefficient of seawater +% from Absolute Salinity and Conservative Temperature. This function uses +% the computationally-efficient 48-term expression for density in terms of +% SA, CT and p (IOC et al., 2010). +% +% 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 IOC et al. (2010). The GSW library function +% "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if +% some of one's data lies outside this "funnel". +% +% INPUT: +% SA = Absolute Salinity [ g/kg ] +% CT = Conservative Temperature (ITS-90) [ deg C ] +% p = sea pressure [ dbar ] +% ( i.e. absolute pressure - 10.1325 dbar ) +% +% SA & CT need to have the same dimensions. +% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & CT are MxN. +% +% OUTPUT: +% alpha_on_beta = thermal expansion coefficient with respect to +% Conservative Temperature divided by the saline +% contraction coefficient at constant Conservative +% Temperature [ kg g^-1 K^-1 ] +% +% AUTHOR: +% Paul Barker and Trevor McDougall [ help@teos-10.org ] +% +% VERSION NUMBER: 3.03 (10th May, 2013) +% +% 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.20 and appendix K of this TEOS-10 Manual. +% +% The software is available from http://www.TEOS-10.org +% +%========================================================================== + +%-------------------------------------------------------------------------- +% Check variables and resize if necessary +%-------------------------------------------------------------------------- + +if ~(nargin == 3) + error('gsw_alpha_on_beta: Requires three inputs') +end %if +if ~(nargout == 1) + error('gsw_alpha_on_beta: Requires one outputs') +end %if + +[ms,ns] = size(SA); +[mt,nt] = size(CT); +[mp,np] = size(p); + +if (mt ~= ms | nt ~= ns) + error('gsw_alpha_on_beta: SA and CT must have same dimensions') +end + +if (mp == 1) & (np == 1) % p scalar - fill to size of SA + p = p*ones(size(SA)); +elseif (ns == np) & (mp == 1) % p is row vector, + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (np == 1) % p is column vector, + p = p(:,ones(1,ns)); % copy across each row. +elseif (ns == mp) & (np == 1) % p is a transposed row vector, + p = p.'; % transposed then + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (ns == np) + % ok +else + error('gsw_alpha_on_beta: Inputs array dimensions arguments do not agree') +end %if + +if ms == 1 + SA = SA.'; + CT = CT.'; + p = p.'; + transposed = 1; +else + transposed = 0; +end + +%-------------------------------------------------------------------------- +% Start of the calculation +%-------------------------------------------------------------------------- + +% This line ensures that SA is non-negative. +SA(SA < 0) = 0; + +v01 = 9.998420897506056e+2; +v02 = 2.839940833161907; +v03 = -3.147759265588511e-2; +v04 = 1.181805545074306e-3; +v05 = -6.698001071123802; +v06 = -2.986498947203215e-2; +v07 = 2.327859407479162e-4; +v08 = -3.988822378968490e-2; +v09 = 5.095422573880500e-4; +v10 = -1.426984671633621e-5; +v11 = 1.645039373682922e-7; +v12 = -2.233269627352527e-2; +v13 = -3.436090079851880e-4; +v14 = 3.726050720345733e-6; +v15 = -1.806789763745328e-4; +v16 = 6.876837219536232e-7; +v17 = -3.087032500374211e-7; +v18 = -1.988366587925593e-8; +v19 = -1.061519070296458e-11; +v20 = 1.550932729220080e-10; +v21 = 1.0; +v22 = 2.775927747785646e-3; +v23 = -2.349607444135925e-5; +v24 = 1.119513357486743e-6; +v25 = 6.743689325042773e-10; +v26 = -7.521448093615448e-3; +v27 = -2.764306979894411e-5; +v28 = 1.262937315098546e-7; +v29 = 9.527875081696435e-10; +v30 = -1.811147201949891e-11; +v31 = -3.303308871386421e-5; +v32 = 3.801564588876298e-7; +v33 = -7.672876869259043e-9; +v34 = -4.634182341116144e-11; +v35 = 2.681097235569143e-12; +v36 = 5.419326551148740e-6; +v37 = -2.742185394906099e-5; +v38 = -3.212746477974189e-7; +v39 = 3.191413910561627e-9; +v40 = -1.931012931541776e-12; +v41 = -1.105097577149576e-7; +v42 = 6.211426728363857e-10; +v43 = -1.119011592875110e-10; +v44 = -1.941660213148725e-11; +v45 = -1.864826425365600e-14; +v46 = 1.119522344879478e-14; +v47 = -1.200507748551599e-15; +v48 = 6.057902487546866e-17; + +a01 = 2.839940833161907; +a02 = -6.295518531177023e-2; +a03 = 3.545416635222918e-3; +a04 = -2.986498947203215e-2; +a05 = 4.655718814958324e-4; +a06 = 5.095422573880500e-4; +a07 = -2.853969343267241e-5; +a08 = 4.935118121048767e-7; +a09 = -3.436090079851880e-4; +a10 = 7.452101440691467e-6; +a11 = 6.876837219536232e-7; +a12 = -1.988366587925593e-8; +a13 = -2.123038140592916e-11; + +a14 = 2.775927747785646e-3; +a15 = -4.699214888271850e-5; +a16 = 3.358540072460230e-6; +a17 = 2.697475730017109e-9; +a18 = -2.764306979894411e-5; +a19 = 2.525874630197091e-7; +a20 = 2.858362524508931e-9; +a21 = -7.244588807799565e-11; +a22 = 3.801564588876298e-7; +a23 = -1.534575373851809e-8; +a24 = -1.390254702334843e-10; +a25 = 1.072438894227657e-11; +a26 = -3.212746477974189e-7; +a27 = 6.382827821123254e-9; +a28 = -5.793038794625329e-12; +a29 = 6.211426728363857e-10; +a30 = -1.941660213148725e-11; +a31 = -3.729652850731201e-14; +a32 = 1.119522344879478e-14; +a33 = 6.057902487546866e-17; + +b01 = -6.698001071123802; +b02 = -2.986498947203215e-2; +b03 = 2.327859407479162e-4; +b04 = -5.983233568452735e-2; +b05 = 7.643133860820750e-4; +b06 = -2.140477007450431e-5; +b07 = 2.467559060524383e-7; +b08 = -1.806789763745328e-4; +b09 = 6.876837219536232e-7; +b10 = 1.550932729220080e-10; +b11 = -7.521448093615448e-3; +b12 = -2.764306979894411e-5; +b13 = 1.262937315098546e-7; +b14 = 9.527875081696435e-10; +b15 = -1.811147201949891e-11; +b16 = -4.954963307079632e-5; +b17 = 5.702346883314446e-7; +b18 = -1.150931530388857e-8; +b19 = -6.951273511674217e-11; +b20 = 4.021645853353715e-12; +b21 = 1.083865310229748e-5; +b22 = -1.105097577149576e-7; +b23 = 6.211426728363857e-10; +b24 = 1.119522344879478e-14; + +sqrtSA = sqrt(SA); + +v_hat_denominator = v01 + CT.*(v02 + CT.*(v03 + v04*CT)) ... + + SA.*(v05 + CT.*(v06 + v07*CT) ... + + sqrtSA.*(v08 + CT.*(v09 + CT.*(v10 + v11*CT)))) ... + + p.*(v12 + CT.*(v13 + v14*CT) + SA.*(v15 + v16*CT) ... + + p.*(v17 + CT.*(v18 + v19*CT) + v20*SA)); + +v_hat_numerator = v21 + CT.*(v22 + CT.*(v23 + CT.*(v24 + v25*CT))) ... + + SA.*(v26 + CT.*(v27 + CT.*(v28 + CT.*(v29 + v30*CT))) + v36*SA ... + + sqrtSA.*(v31 + CT.*(v32 + CT.*(v33 + CT.*(v34 + v35*CT))))) ... + + p.*(v37 + CT.*(v38 + CT.*(v39 + v40*CT)) ... + + SA.*(v41 + v42*CT) ... + + p.*(v43 + CT.*(v44 + v45*CT + v46*SA) ... + + p.*(v47 + v48*CT))); + +dvhatden_dCT = a01 + CT.*(a02 + a03*CT) ... + + SA.*(a04 + a05*CT ... + + sqrtSA.*(a06 + CT.*(a07 + a08*CT))) ... + + p.*(a09 + a10*CT + a11*SA ... + + p.*(a12 + a13*CT)); + +dvhatnum_dCT = a14 + CT.*(a15 + CT.*(a16 + a17*CT)) ... + + SA.*(a18 + CT.*(a19 + CT.*(a20 + a21*CT)) ... + + sqrtSA.*(a22 + CT.*(a23 + CT.*(a24 + a25*CT)))) ... + + p.*(a26 + CT.*(a27 + a28*CT) + a29*SA ... + + p.*(a30 + a31*CT + a32*SA + a33*p)); + +dvhatden_dSA = b01 + CT.*(b02 + b03*CT) ... + + sqrtSA.*(b04 + CT.*(b05 + CT.*(b06 + b07*CT))) ... + + p.*(b08 + b09*CT + b10*p) ; + +dvhatnum_dSA = b11 + CT.*(b12 + CT.*(b13 + CT.*(b14 + b15*CT))) ... + + sqrtSA.*(b16 + CT.*(b17 + CT.*(b18 + CT.*(b19 + b20*CT)))) + b21*SA ... + + p.*(b22 + CT.*(b23 + b24*p)); + +alpha_on_beta = (dvhatnum_dCT.*v_hat_denominator - dvhatden_dCT.*v_hat_numerator)./ ... + (dvhatden_dSA.*v_hat_numerator - dvhatnum_dSA.*v_hat_denominator); + +if transposed + alpha_on_beta = alpha_on_beta.'; +end + +end diff --git a/Toolbox/gsw_alpha_on_beta_CT.m b/Toolbox/gsw_alpha_on_beta_CT.m new file mode 100644 index 0000000..826c632 --- /dev/null +++ b/Toolbox/gsw_alpha_on_beta_CT.m @@ -0,0 +1,112 @@ +function alpha_on_beta_CT = gsw_alpha_on_beta_CT(SA,CT,p) + +% gsw_alpha_on_beta_CT alpha/beta (48-term equation) +%========================================================================== +% +% USAGE: +% alpha_on_beta_CT = gsw_alpha_on_beta_CT(SA,CT,p), or equivalently +% alpha_on_beta = gsw_alpha_on_beta(SA,CT,p) +% +% Note that gsw_alpha_on_beta_CT(SA,CT,p) is identical to +% gsw_alpha_on_beta(SA,CT,p). The extra "_CT" emphasises that the +% input temperature is Conservative Temperature, but the extra "_CT" part +% of the function name is not needed. +% +% DESCRIPTION: +% Calculates alpha divided by beta, where alpha is the thermal expansion +% coefficient and beta is the saline contraction coefficient of seawater +% from Absolute Salinity and Conservative Temperature. This function uses +% the computationally-efficient 48-term expression for density in terms of +% SA, CT and p (IOC et al., 2010). +% +% 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 IOC et al. (2010). The GSW library function +% "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if +% some of one's data lies outside this "funnel". +% +% INPUT: +% SA = Absolute Salinity [ g/kg ] +% CT = Conservative Temperature (ITS-90) [ deg C ] +% p = sea pressure [ dbar ] +% ( i.e. absolute pressure - 10.1325 dbar ) +% +% SA & CT need to have the same dimensions. +% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & CT are MxN. +% +% OUTPUT: +% alpha_on_beta_CT = thermal expansion coefficient with respect to +% Conservative Temperature divided by the saline +% contraction coefficient at constant Conservative +% Temperature [ kg g^-1 K^-1 ] +% +% AUTHOR: +% Paul Barker and Trevor McDougall [ help@teos-10.org ] +% +% VERSION NUMBER: 3.03 (10th May, 2013) +% +% 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.20 and appendix K of this TEOS-10 Manual. +% +% The software is available from http://www.TEOS-10.org +% +%========================================================================== + +%-------------------------------------------------------------------------- +% Check variables and resize if necessary +%-------------------------------------------------------------------------- + +if ~(nargin == 3) + error('gsw_alpha_on_beta_CT: Requires three inputs') +end %if +if ~(nargout == 1) + error('gsw_alpha_on_beta_CT: Requires one outputs') +end %if + +[ms,ns] = size(SA); +[mt,nt] = size(CT); +[mp,np] = size(p); + +if (mt ~= ms | nt ~= ns) + error('gsw_alpha_on_beta_CT: SA and CT must have same dimensions') +end + +if (mp == 1) & (np == 1) % p scalar - fill to size of SA + p = p*ones(size(SA)); +elseif (ns == np) & (mp == 1) % p is row vector, + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (np == 1) % p is column vector, + p = p(:,ones(1,ns)); % copy across each row. +elseif (ns == mp) & (np == 1) % p is a transposed row vector, + p = p.'; % transposed then + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (ns == np) + % ok +else + error('gsw_alpha_on_beta_CT: Inputs array dimensions arguments do not agree') +end %if + +if ms == 1 + SA = SA.'; + CT = CT.'; + p = p.'; + transposed = 1; +else + transposed = 0; +end + +%-------------------------------------------------------------------------- +% Start of the calculation +%-------------------------------------------------------------------------- + +alpha_on_beta_CT = gsw_alpha_on_beta(SA,CT,p); + +if transposed + alpha_on_beta_CT = alpha_on_beta_CT.'; +end + +end diff --git a/Toolbox/gsw_alpha_on_beta_CT_exact.m b/Toolbox/gsw_alpha_on_beta_CT_exact.m new file mode 100644 index 0000000..7e97edd --- /dev/null +++ b/Toolbox/gsw_alpha_on_beta_CT_exact.m @@ -0,0 +1,107 @@ +function alpha_on_beta_CT_exact = gsw_alpha_on_beta_CT_exact(SA,CT,p) + +% gsw_alpha_on_beta_CT_exact alpha/beta +%========================================================================== +% +% USAGE: +% alpha_on_beta_CT_exact = gsw_alpha_on_beta_CT_exact(SA,CT,p) +% +% DESCRIPTION: +% Calculates alpha divided by beta, where alpha is the thermal expansion +% coefficient and beta is the saline contraction coefficient of seawater +% from Absolute Salinity and Conservative Temperature. +% +% Note that this function uses the full Gibbs function. There is an +% alternative to calling this function, namely gsw_alpha_on_beta(SA,CT,p), +% which uses the computationally efficient 48-term expression for density +% in terms of SA, CT and p (IOC et al., 2010). +% +% INPUT: +% SA = Absolute Salinity [ g/kg ] +% CT = Conservative Temperature (ITS-90) [ deg C ] +% p = sea pressure [ dbar ] +% ( i.e. absolute pressure - 10.1325 dbar ) +% +% SA & CT need to have the same dimensions. +% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & CT are MxN. +% +% OUTPUT: +% alpha_on_beta_CT_exact = thermal expansion coefficient with respect to +% Conservative Temperature divided by the +% saline contraction coefficient at constant +% Conservative Temperature [ kg g^-1 K^-1 ] +% +% AUTHOR: +% Paul Barker and Trevor McDougall [ help@teos-10.org ] +% +% VERSION NUMBER: 3.03 (13th May, 2013) +% +% 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.20 and appendix K of this TEOS-10 Manual. +% +% The software is available from http://www.TEOS-10.org +% +%========================================================================== + +%-------------------------------------------------------------------------- +% Check variables and resize if necessary +%-------------------------------------------------------------------------- + +if ~(nargin == 3) + error('gsw_alpha_on_beta_CT_exact: Requires three inputs') +end %if +if ~(nargout == 1) + error('gsw_alpha_on_beta_CT_exact: Requires one outputs') +end %if + +[ms,ns] = size(SA); +[mt,nt] = size(CT); +[mp,np] = size(p); + +if (mt ~= ms | nt ~= ns) + error('gsw_alpha_on_beta_CT_exact: SA and CT must have same dimensions') +end + +if (mp == 1) & (np == 1) % p scalar - fill to size of SA + p = p*ones(size(SA)); +elseif (ns == np) & (mp == 1) % p is row vector, + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (np == 1) % p is column vector, + p = p(:,ones(1,ns)); % copy across each row. +elseif (ns == mp) & (np == 1) % p is a transposed row vector, + p = p.'; % transposed then + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (ns == np) + % ok +else + error('gsw_alpha_on_beta_CT_exact: Inputs array dimensions arguments do not agree') +end %if + +if ms == 1 + SA = SA.'; + CT = CT.'; + p = p.'; + transposed = 1; +else + transposed = 0; +end + +%-------------------------------------------------------------------------- +% Start of the calculation +%-------------------------------------------------------------------------- + +% This line ensures that SA is non-negative. +SA(SA < 0) = 0; + +[dummy, alpha_CT_exact, beta_CT_exact] = gsw_rho_alpha_beta_CT_exact(SA,CT,p); +alpha_on_beta_CT_exact = alpha_CT_exact./beta_CT_exact; + +if transposed + alpha_on_beta_CT_exact = alpha_on_beta_CT_exact.'; +end + +end diff --git a/Toolbox/gsw_atomic_weight.m b/Toolbox/gsw_atomic_weight.m index fa22e08..d6f9c74 100644 --- a/Toolbox/gsw_atomic_weight.m +++ b/Toolbox/gsw_atomic_weight.m @@ -19,7 +19,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_beta.m b/Toolbox/gsw_beta.m index 43f5a2b..d5187b4 100644 --- a/Toolbox/gsw_beta.m +++ b/Toolbox/gsw_beta.m @@ -11,11 +11,11 @@ % Calculates the saline (i.e. haline) contraction coefficient of seawater % at constant Conservative Temperature using the computationally-efficient % 48-term expression for density in terms of SA, CT and p -% (McDougall et al., 2013). +% (McDougall et al., 2010). % % 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. (2013). The GSW library function +% described in McDougall et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -35,7 +35,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2012) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -44,11 +44,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (2.19.3) of this TEOS-10 manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_beta_CT.m b/Toolbox/gsw_beta_CT.m index 63901cc..41d00d1 100644 --- a/Toolbox/gsw_beta_CT.m +++ b/Toolbox/gsw_beta_CT.m @@ -17,11 +17,11 @@ % Calculates the saline (i.e. haline) contraction coefficient of seawater % at constant Conservative Temperature using the computationally-efficient % 48-term expression for density in terms of SA, CT and p -% (McDougall et al., 2013). +% (McDougall et al., 2010). % % 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. (2013). The GSW library function +% described in McDougall et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -41,7 +41,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -50,11 +50,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (2.19.3) of this TEOS-10 manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_beta_CT_exact.m b/Toolbox/gsw_beta_CT_exact.m index 2d1bc34..587bc40 100644 --- a/Toolbox/gsw_beta_CT_exact.m +++ b/Toolbox/gsw_beta_CT_exact.m @@ -12,9 +12,9 @@ % at constant Conservative Temperature. % % Note that this function uses the full Gibbs function. There is an -% alternative to calling this function, namely gsw_beta_const_CT(SA,CT,p) +% alternative to calling this function, namely gsw_beta(SA,CT,p) % which uses the computationally efficient 48-term expression for density -% in terms of SA, CT and p (McDougall et al., (2011)). +% in terms of SA, CT and p (McDougall et al., (2010)). % % INPUT: % SA = Absolute Salinity [ g/kg ] @@ -32,7 +32,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -41,11 +41,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (2.19.3) of this TEOS-10 manual. % -% 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. To be submitted to Ocean Science Discussions. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_brineSA_CT.m b/Toolbox/gsw_brineSA_CT.m index 96f8b55..f1fc91f 100644 --- a/Toolbox/gsw_brineSA_CT.m +++ b/Toolbox/gsw_brineSA_CT.m @@ -36,7 +36,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_brineSA_t.m b/Toolbox/gsw_brineSA_t.m index bf8fcbc..37f4ca3 100644 --- a/Toolbox/gsw_brineSA_t.m +++ b/Toolbox/gsw_brineSA_t.m @@ -36,7 +36,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_cabbeling.m b/Toolbox/gsw_cabbeling.m index 1853dc8..f0577fb 100644 --- a/Toolbox/gsw_cabbeling.m +++ b/Toolbox/gsw_cabbeling.m @@ -11,11 +11,11 @@ % Calculates the cabbeling coefficient of seawater with respect to % Conservative Temperature. This function uses the computationally- % efficient 48-term expression for density in terms of SA, CT and p -% (McDougall et al., 2013) +% (IOC et al., 2010) % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -33,9 +33,9 @@ % Conservative Temperature. % % AUTHOR: -% David Jackett, Trevor McDougall and Paul Barker [ help@teos-10.org ] +% Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (5th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -44,11 +44,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqns. (3.9.2) and (P.4) of this TEOS-10 manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== @@ -97,62 +92,203 @@ % Start of the calculation %-------------------------------------------------------------------------- -dCT = 1e-3; % increment in Conservative Temperature is 1e-3 deg C. -CT_l = CT - dCT; -CT_u = CT + dCT; -[dummy,alpha,beta] = gsw_rho_alpha_beta(SA,CT,p); -alpha_u = gsw_alpha(SA,CT_u,p); -alpha_l = gsw_alpha(SA,CT_l,p); +v01 = 9.998420897506056e+2; +v02 = 2.839940833161907; +v03 = -3.147759265588511e-2; +v04 = 1.181805545074306e-3; +v05 = -6.698001071123802; +v06 = -2.986498947203215e-2; +v07 = 2.327859407479162e-4; +v08 = -3.988822378968490e-2; +v09 = 5.095422573880500e-4; +v10 = -1.426984671633621e-5; +v11 = 1.645039373682922e-7; +v12 = -2.233269627352527e-2; +v13 = -3.436090079851880e-4; +v14 = 3.726050720345733e-6; +v15 = -1.806789763745328e-4; +v16 = 6.876837219536232e-7; +v17 = -3.087032500374211e-7; +v18 = -1.988366587925593e-8; +v19 = -1.061519070296458e-11; +v20 = 1.550932729220080e-10; +v21 = 1.0; +v22 = 2.775927747785646e-3; +v23 = -2.349607444135925e-5; +v24 = 1.119513357486743e-6; +v25 = 6.743689325042773e-10; +v26 = -7.521448093615448e-3; +v27 = -2.764306979894411e-5; +v28 = 1.262937315098546e-7; +v29 = 9.527875081696435e-10; +v30 = -1.811147201949891e-11; +v31 = -3.303308871386421e-5; +v32 = 3.801564588876298e-7; +v33 = -7.672876869259043e-9; +v34 = -4.634182341116144e-11; +v35 = 2.681097235569143e-12; +v36 = 5.419326551148740e-6; +v37 = -2.742185394906099e-5; +v38 = -3.212746477974189e-7; +v39 = 3.191413910561627e-9; +v40 = -1.931012931541776e-12; +v41 = -1.105097577149576e-7; +v42 = 6.211426728363857e-10; +v43 = -1.119011592875110e-10; +v44 = -1.941660213148725e-11; +v45 = -1.864826425365600e-14; +v46 = 1.119522344879478e-14; +v47 = -1.200507748551599e-15; +v48 = 6.057902487546866e-17; -alpha_on_beta = alpha./beta; -alpha_CT = (alpha_u - alpha_l)./(CT_u - CT_l); +a01 = 2.839940833161907; +a02 = -6.295518531177023e-2; +a03 = 3.545416635222918e-3; +a04 = -2.986498947203215e-2; +a05 = 4.655718814958324e-4; +a06 = 5.095422573880500e-4; +a07 = -2.853969343267241e-5; +a08 = 4.935118121048767e-7; +a09 = -3.436090079851880e-4; +a10 = 7.452101440691467e-6; +a11 = 6.876837219536232e-7; +a12 = -1.988366587925593e-8; +a13 = -2.123038140592916e-11; -dSA = 1e-3; % increment in Absolute Salinity is 1e-3 g kg^-1 +a14 = 2.775927747785646e-3; +a15 = -4.699214888271850e-5; +a16 = 3.358540072460230e-6; +a17 = 2.697475730017109e-9; +a18 = -2.764306979894411e-5; +a19 = 2.525874630197091e-7; +a20 = 2.858362524508931e-9; +a21 = -7.244588807799565e-11; +a22 = 3.801564588876298e-7; +a23 = -1.534575373851809e-8; +a24 = -1.390254702334843e-10; +a25 = 1.072438894227657e-11; +a26 = -3.212746477974189e-7; +a27 = 6.382827821123254e-9; +a28 = -5.793038794625329e-12; +a29 = 6.211426728363857e-10; +a30 = -1.941660213148725e-11; +a31 = -3.729652850731201e-14; +a32 = 1.119522344879478e-14; +a33 = 6.057902487546866e-17; -SA_l = nan(size(SA)); -SA_l(SA >= dSA) = SA(SA >= dSA) - dSA; -SA_l(SA=dSA) = SA(SA>=dSA)-dSA; -% SA_l(SA=dSA) = SA(SA>=dSA)-dSA; +SA_l(SA= gsw_cv.SP_from_SK_ca); +if ~isempty(gsw_cf.ISP_from_SK) + fprintf(2,'gsw_SP_from_SK: Failed\n'); + gsw_cf.gsw_chks = 0; +end + %% Absolute Salinity (SA), Preformed Salinity (Sstar) and Conservative Temperature (CT) gsw_cf.SA_from_SP = gsw_SA_from_SP(gsw_cv.SP_chck_cast,gsw_cv.p_chck_cast,gsw_cv.long_chck_cast,gsw_cv.lat_chck_cast); @@ -286,6 +298,34 @@ gsw_cf.gsw_chks = 0; end +gsw_cf.entropy_from_t = gsw_entropy_from_t(gsw_cv.SA_chck_cast,gsw_cv.t_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Ientropy_from_t] = find(abs(gsw_cv.entropy_from_t - gsw_cf.entropy_from_t) >= gsw_cv.entropy_from_t_ca); +if ~isempty(gsw_cf.Ientropy_from_t) + fprintf(2,'gsw_entropy_from_t: Failed\n'); + gsw_cf.gsw_chks = 0; +end + +gsw_cf.t_from_entropy = gsw_t_from_entropy(gsw_cv.SA_chck_cast,gsw_cf.entropy_from_t,gsw_cv.p_chck_cast); +[gsw_cf.It_from_entropy] = find(abs(gsw_cv.t_from_entropy - gsw_cf.t_from_entropy) >= gsw_cv.t_from_entropy_ca); +if ~isempty(gsw_cf.It_from_entropy) + fprintf(2,'gsw_t_from_entropy: Failed\n'); + gsw_cf.gsw_chks = 0; +end + +gsw_cf.adiabatic_lapse_rate_from_CT = gsw_adiabatic_lapse_rate_from_CT(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Iadiabatic_lapse_rate_from_CT] = find(abs(gsw_cv.adiabatic_lapse_rate_from_CT - gsw_cf.adiabatic_lapse_rate_from_CT) >= gsw_cv.adiabatic_lapse_rate_from_CT_ca); +if ~isempty(gsw_cf.Iadiabatic_lapse_rate_from_CT) + fprintf(2,'gsw_adiabatic_lapse_rate_from_CT: Failed\n'); + gsw_cf.gsw_chks = 0; +end + +gsw_cf.adiabatic_lapse_rate_from_t = gsw_adiabatic_lapse_rate_from_t(gsw_cv.SA_chck_cast,gsw_cv.t_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Iadiabatic_lapse_rate_from_t] = find(abs(gsw_cv.adiabatic_lapse_rate_from_t - gsw_cf.adiabatic_lapse_rate_from_t) >= gsw_cv.adiabatic_lapse_rate_from_t_ca); +if ~isempty(gsw_cf.Iadiabatic_lapse_rate_from_t) + fprintf(2,'gsw_adiabatic_lapse_rate_from_t: Failed\n'); + gsw_cf.gsw_chks = 0; +end + gsw_cf.molality_from_SA = gsw_molality_from_SA(gsw_cv.SA_chck_cast); [gsw_cf.Imolality_from_SA] = find(abs(gsw_cv.molality_from_SA - gsw_cf.molality_from_SA) >= gsw_cv.molality_from_SA_ca); if ~isempty(gsw_cf.Imolality_from_SA) @@ -335,6 +375,22 @@ gsw_cf.gsw_chks = 0; end +gsw_cf.alpha_on_beta = gsw_alpha_on_beta_CT(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Ialpha_on_beta] = find(abs(gsw_cv.alpha_on_beta - gsw_cf.alpha_on_beta) >= gsw_cv.alpha_on_beta_ca); +if ~isempty(gsw_cf.Ialpha_on_beta) + fprintf(2,'gsw_alpha_on_beta_CT: Failed\n'); + gsw_cf.gsw_chks = 0; +end + +[gsw_cf.drho_dSA, gsw_cf.drho_dCT, gsw_cf.drho_dp] = gsw_rho_first_derivatives_CT(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Irho_fd] = find(abs(gsw_cv.drho_dSA - gsw_cf.drho_dSA) >= gsw_cv.drho_dSA_ca | ... + abs(gsw_cv.drho_dCT - gsw_cf.drho_dCT) >= gsw_cv.drho_dCT_ca | ... + abs(gsw_cv.drho_dp - gsw_cf.drho_dp) >= gsw_cv.drho_dp_ca); +if ~isempty(gsw_cf.Irho_fd) + fprintf(2,'gsw_rho_first_derivatives_CT: Failed\n'); + gsw_cf.gsw_chks = 0; +end + gsw_cf.specvol = gsw_specvol_CT(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); [gsw_cf.Ispecvol] = find(abs(gsw_cv.specvol - gsw_cf.specvol) >= gsw_cv.specvol_ca); if ~isempty(gsw_cf.Ispecvol) @@ -391,6 +447,48 @@ gsw_cf.gsw_chks = 0; end +gsw_cf.kappa = gsw_kappa_CT(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Ikappa] = find(abs(gsw_cv.kappa - gsw_cf.kappa) >= gsw_cv.kappa_ca); +if ~isempty(gsw_cf.Ikappa) + fprintf(2,'gsw_kappa_CT: Failed\n'); + gsw_cf.gsw_chks = 0; +end + +gsw_cf.cabbeling = gsw_cabbeling_CT(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Icabbeling] = find(abs(gsw_cv.cabbeling - gsw_cf.cabbeling) >= gsw_cv.cabbeling_ca); +if ~isempty(gsw_cf.Icabbeling) + fprintf(2,'gsw_cabbeling: Failed\n'); + gsw_cf.gsw_chks = 0; +end + +gsw_cf.thermobaric = gsw_thermobaric_CT(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Ithermobaric] = find(abs(gsw_cv.thermobaric - gsw_cf.thermobaric) >= gsw_cv.thermobaric_ca); +if ~isempty(gsw_cf.Ithermobaric) + fprintf(2,'gsw_thermobaric: Failed\n'); + gsw_cf.gsw_chks = 0; +end + +gsw_cf.SA_from_rho = gsw_SA_from_rho_CT(gsw_cf.rho,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.ISA_from_rho] = find(abs(gsw_cv.SA_from_rho - gsw_cf.SA_from_rho) >= gsw_cv.SA_from_rho_ca); +if ~isempty(gsw_cf.ISA_from_rho) + fprintf(2,'gsw_SA_from_rho_CT: Failed\n'); + gsw_cf.gsw_chks = 0; +end + +gsw_cf.CT_from_rho = gsw_CT_from_rho(gsw_cf.rho,gsw_cv.SA_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.ICT_from_rho] = find(abs(gsw_cv.CT_from_rho - gsw_cf.CT_from_rho) >= gsw_cv.CT_from_rho_ca); +if ~isempty(gsw_cf.ICT_from_rho) + fprintf(2,'gsw_CT_from_rho: Failed\n'); + gsw_cf.gsw_chks = 0; +end + +gsw_cf.CT_maxdensity = gsw_CT_maxdensity(gsw_cv.SA_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.ICT_maxdensity] = find(abs(gsw_cv.CT_maxdensity - gsw_cf.CT_maxdensity) >= gsw_cv.CT_maxdensity_ca); +if ~isempty(gsw_cf.ICT_maxdensity) + fprintf(2,'gsw_CT_maxdensity: Failed\n'); + gsw_cf.gsw_chks = 0; +end + gsw_cf.internal_energy = gsw_internal_energy_CT(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); [gsw_cf.Iinternal_energy] = find(abs(gsw_cv.internal_energy - gsw_cf.internal_energy) >= gsw_cv.internal_energy_ca); if ~isempty(gsw_cf.Iinternal_energy) @@ -419,24 +517,20 @@ gsw_cf.gsw_chks = 0; end -gsw_cf.SA_from_rho = gsw_SA_from_rho_CT(gsw_cf.rho,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); -[gsw_cf.ISA_from_rho] = find(abs(gsw_cv.SA_from_rho - gsw_cf.SA_from_rho) >= gsw_cv.SA_from_rho_ca); -if ~isempty(gsw_cf.ISA_from_rho) - fprintf(2,'gsw_SA_from_rho_CT: Failed\n'); - gsw_cf.gsw_chks = 0; -end - -gsw_cf.CT_maxdensity = gsw_CT_maxdensity(gsw_cv.SA_chck_cast,gsw_cv.p_chck_cast); -[gsw_cf.ICT_maxdensity] = find(abs(gsw_cv.CT_maxdensity - gsw_cf.CT_maxdensity) >= gsw_cv.CT_maxdensity_ca); -if ~isempty(gsw_cf.ICT_maxdensity) - fprintf(2,'gsw_CT_maxdensity: Failed\n'); +[gsw_cf.h_SA, gsw_cf.h_CT] = gsw_enthalpy_first_derivatives_CT(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Ienthalpy_first_deriv] = find(abs(gsw_cv.h_SA - gsw_cf.h_SA) >= gsw_cv.h_SA_ca | ... + abs(gsw_cv.h_CT - gsw_cf.h_CT) >= gsw_cv.h_CT_ca); +if ~isempty(gsw_cf.Ienthalpy_first_deriv) + fprintf(2,'gsw_enthalpy_first_derivatives: Failed\n'); gsw_cf.gsw_chks = 0; end -gsw_cf.CT_from_rho = gsw_CT_from_rho(gsw_cf.rho,gsw_cv.SA_chck_cast,gsw_cv.p_chck_cast); -[gsw_cf.ICT_from_rho] = find(abs(gsw_cv.CT_from_rho - gsw_cf.CT_from_rho) >= gsw_cv.CT_from_rho_ca); -if ~isempty(gsw_cf.ICT_from_rho) - fprintf(2,'gsw_CT_from_rho: Failed\n'); +[gsw_cf.h_SA_SA, gsw_cf.h_SA_CT, gsw_cf.h_CT_CT] = gsw_enthalpy_second_derivatives_CT(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Ienthalpy_second_deriv] = find(abs(gsw_cv.h_SA_SA - gsw_cf.h_SA_SA) >= gsw_cv.h_SA_SA_ca | ... + abs(gsw_cv.h_SA_CT - gsw_cf.h_SA_CT) >= gsw_cv.h_SA_CT_ca | ... + abs(gsw_cv.h_CT_CT - gsw_cf.h_CT_CT) >= gsw_cv.h_CT_CT_ca); +if ~isempty(gsw_cf.Ienthalpy_second_deriv) + fprintf(2,'gsw_enthalpy_second_derivatives: Failed\n'); gsw_cf.gsw_chks = 0; end @@ -469,21 +563,7 @@ fprintf(1,'.'); end -%% neutral and non-linear properties, based on the 48-term expression for density - -gsw_cf.cabbeling = gsw_cabbeling(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); -[gsw_cf.Icabbeling] = find(abs(gsw_cv.cabbeling - gsw_cf.cabbeling) >= gsw_cv.cabbeling_ca); -if ~isempty(gsw_cf.Icabbeling) - fprintf(2,'gsw_cabbeling: Failed\n'); - gsw_cf.gsw_chks = 0; -end - -gsw_cf.thermobaric = gsw_thermobaric(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); -[gsw_cf.Ithermobaric] = find(abs(gsw_cv.thermobaric - gsw_cf.thermobaric) >= gsw_cv.thermobaric_ca); -if ~isempty(gsw_cf.Ithermobaric) - fprintf(2,'gsw_thermobaric: Failed\n'); - gsw_cf.gsw_chks = 0; -end +%% neutral properties, based on the 48-term expression for density if gsw_cf.gsw_chks == 1 ; fprintf(1,'.'); @@ -587,29 +667,11 @@ gsw_cf.gsw_chks = 0; end -[gsw_cf.h_SA, gsw_cf.h_CT, gsw_cf.h_P] = gsw_enthalpy_first_derivatives(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); -[gsw_cf.Ienthalpy_first_deriv] = find(abs(gsw_cv.h_SA - gsw_cf.h_SA) >= gsw_cv.h_SA_ca | ... - abs(gsw_cv.h_CT - gsw_cf.h_CT) >= gsw_cv.h_CT_ca | ... - abs(gsw_cv.h_P - gsw_cf.h_P) >= gsw_cv.h_P_ca); -if ~isempty(gsw_cf.Ienthalpy_first_deriv) - fprintf(2,'gsw_enthalpy_first_derivatives: Failed\n'); - gsw_cf.gsw_chks = 0; -end - -[gsw_cf.h_SA_SA, gsw_cf.h_SA_CT, gsw_cf.h_CT_CT] = gsw_enthalpy_second_derivatives(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); -[gsw_cf.Ienthalpy_second_deriv] = find(abs(gsw_cv.h_SA_SA - gsw_cf.h_SA_SA) >= gsw_cv.h_SA_SA_ca | ... - abs(gsw_cv.h_SA_CT - gsw_cf.h_SA_CT) >= gsw_cv.h_SA_CT_ca | ... - abs(gsw_cv.h_CT_CT - gsw_cf.h_CT_CT) >= gsw_cv.h_CT_CT_ca); -if ~isempty(gsw_cf.Ienthalpy_second_deriv) - fprintf(2,'gsw_enthalpy_second_derivatives: Failed\n'); - gsw_cf.gsw_chks = 0; -end - [gsw_cf.eta_SA, gsw_cf.eta_CT] = gsw_entropy_first_derivatives(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast); [gsw_cf.Ientropy_first_deriv] = find(abs(gsw_cv.eta_SA - gsw_cf.eta_SA) >= gsw_cv.eta_SA_ca | ... abs(gsw_cv.eta_CT - gsw_cf.eta_CT) >= gsw_cv.eta_CT_ca); if ~isempty(gsw_cf.Ientropy_first_deriv) - fprintf(2,'gsw_enthalpy_first_derivatives: Failed\n'); + fprintf(2,'gsw_entropy_first_derivatives: Failed\n'); gsw_cf.gsw_chks = 0; end @@ -673,7 +735,6 @@ gsw_cf.gsw_chks = 0; end - %% isobaric melting enthalpy and isobaric gsw_cf.latentheat_melting = gsw_latentheat_melting(gsw_cv.SA_chck_cast,gsw_cv.p_chck_cast); @@ -729,7 +790,6 @@ gsw_cf.gsw_chks = 0; end - %% TEOS-10 constants gsw_cf.T0 = gsw_T0; @@ -827,6 +887,22 @@ gsw_chks = 0; end +gsw_cf.alpha_on_beta_CT_exact = gsw_alpha_on_beta_CT_exact(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Ialpha_on_beta_CT_exact] = find(abs(gsw_cv.alpha_on_beta_CT_exact - gsw_cf.alpha_on_beta_CT_exact) >= gsw_cv.alpha_on_beta_CT_exact_ca); +if ~isempty(gsw_cf.Ialpha_on_beta_CT_exact) + fprintf(2,'gsw_alpha_on_beta_CT_exact: Failed\n'); + gsw_cf.gsw_chks = 0; +end + +[gsw_cf.drho_dSA_CT_exact, gsw_cf.drho_dCT_CT_exact, gsw_cf.drho_dp_CT_exact] = gsw_rho_first_derivatives_CT_exact(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Irho_fd_CT_exact] = find(abs(gsw_cv.drho_dSA_CT_exact - gsw_cf.drho_dSA_CT_exact) >= gsw_cv.drho_dSA_CT_exact_ca | ... + abs(gsw_cv.drho_dCT_CT_exact - gsw_cf.drho_dCT_CT_exact) >= gsw_cv.drho_dCT_CT_exact_ca | ... + abs(gsw_cv.drho_dp_CT_exact - gsw_cf.drho_dp_CT_exact) >= gsw_cv.drho_dp_CT_exact_ca); +if ~isempty(gsw_cf.Irho_fd_CT_exact) + fprintf(2,'gsw_rho_first_derivatives_CT_exact: Failed\n'); + gsw_cf.gsw_chks = 0; +end + gsw_cf.specvol_CT_exact = gsw_specvol_CT_exact(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); [gsw_cf.Ispecvol_CT_exact] = find(abs(gsw_cv.specvol_CT_exact - gsw_cf.specvol_CT_exact) >= gsw_cv.specvol_CT_exact_ca); if ~isempty(gsw_cf.Ispecvol_CT_exact) @@ -883,6 +959,48 @@ gsw_cf.gsw_chks = 0; end +gsw_cf.kappa_CT_exact = gsw_kappa_CT_exact(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Ikappa_CT_exact] = find(abs(gsw_cv.kappa_CT_exact - gsw_cf.kappa_CT_exact) >= gsw_cv.kappa_CT_exact_ca); +if ~isempty(gsw_cf.Ikappa_CT_exact) + fprintf(2,'gsw_kappa_CT_exact: Failed\n'); + gsw_cf.gsw_chks = 0; +end + +gsw_cf.cabbeling_CT_exact = gsw_cabbeling_CT_exact(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Icabbeling_CT_exact] = find(abs(gsw_cv.cabbeling_CT_exact - gsw_cf.cabbeling_CT_exact) >= gsw_cv.cabbeling_CT_exact_ca); +if ~isempty(gsw_cf.Icabbeling_CT_exact) + fprintf(2,'gsw_cabbeling_CT_exact: Failed\n'); + gsw_cf.gsw_chks = 0; +end + +gsw_cf.thermobaric_CT_exact = gsw_thermobaric_CT_exact(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Ithermobaric_CT_exact] = find(abs(gsw_cv.thermobaric_CT_exact - gsw_cf.thermobaric_CT_exact) >= gsw_cv.thermobaric_CT_exact_ca); +if ~isempty(gsw_cf.Ithermobaric_CT_exact) + fprintf(2,'gsw_thermobaric_CT_exact: Failed\n'); + gsw_cf.gsw_chks = 0; +end + +gsw_cf.SA_from_rho_CT_exact = gsw_SA_from_rho_CT_exact(gsw_cf.rho_CT_exact,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.ISA_from_rho_CT_exact] = find(abs(gsw_cv.SA_from_rho_CT_exact - gsw_cf.SA_from_rho_CT_exact) >= gsw_cv.SA_from_rho_CT_exact_ca); +if ~isempty(gsw_cf.ISA_from_rho_CT_exact) + fprintf(2,'gsw_SA_from_rho_CT_exact: Failed\n'); + gsw_cf.gsw_chks = 0; +end + +gsw_cf.CT_from_rho_exact = gsw_CT_from_rho_exact(gsw_cf.rho_CT_exact,gsw_cv.SA_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.ICT_from_rho_exact] = find(abs(gsw_cv.CT_from_rho_exact - gsw_cf.CT_from_rho_exact) >= gsw_cv.CT_from_rho_exact_ca); +if ~isempty(gsw_cf.ICT_from_rho_exact) + fprintf(2,'gsw_CT_from_rho_exact: Failed\n'); + gsw_cf.gsw_chks = 0; +end + +gsw_cf.CT_maxdensity_exact = gsw_CT_maxdensity_exact(gsw_cv.SA_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.ICT_maxdensity_exact] = find(abs(gsw_cv.CT_maxdensity_exact - gsw_cf.CT_maxdensity_exact) >= gsw_cv.CT_maxdensity_exact_ca); +if ~isempty(gsw_cf.ICT_maxdensity_exact) + fprintf(2,'gsw_CT_maxdensity_exact: Failed\n'); + gsw_cf.gsw_chks = 0; +end + gsw_cf.internal_energy_CT_exact = gsw_internal_energy_CT_exact(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); [gsw_cf.Iinternal_energy_CT_exact] = find(abs(gsw_cv.internal_energy_CT_exact - gsw_cf.internal_energy_CT_exact) >= gsw_cv.internal_energy_CT_exact_ca); if ~isempty(gsw_cf.Iinternal_energy_CT_exact) @@ -911,28 +1029,24 @@ gsw_cf.gsw_chks = 0; end -gsw_cf.SA_from_rho_CT_exact = gsw_SA_from_rho_CT_exact(gsw_cf.rho_CT_exact,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); -[gsw_cf.ISA_from_rho_CT_exact] = find(abs(gsw_cv.SA_from_rho_CT_exact - gsw_cf.SA_from_rho_CT_exact) >= gsw_cv.SA_from_rho_CT_exact_ca); -if ~isempty(gsw_cf.ISA_from_rho_CT_exact) - fprintf(2,'gsw_SA_from_rho_CT_exact: Failed\n'); - gsw_cf.gsw_chks = 0; -end - -gsw_cf.CT_from_rho_exact = gsw_CT_from_rho_exact(gsw_cf.rho_CT_exact,gsw_cv.SA_chck_cast,gsw_cv.p_chck_cast); -[gsw_cf.ICT_from_rho_exact] = find(abs(gsw_cv.CT_from_rho_exact - gsw_cf.CT_from_rho_exact) >= gsw_cv.CT_from_rho_exact_ca); -if ~isempty(gsw_cf.ICT_from_rho_exact) - fprintf(2,'gsw_CT_from_rho_exact: Failed\n'); +[gsw_cf.h_SA_CT_exact, gsw_cf.h_CT_CT_exact] = gsw_enthalpy_first_derivatives_CT_exact(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Ienthalpy_first_deriv_CT_exact] = find(abs(gsw_cv.h_SA_CT_exact - gsw_cf.h_SA_CT_exact) >= gsw_cv.h_SA_CT_exact_ca | ... + abs(gsw_cv.h_CT_CT_exact - gsw_cf.h_CT_CT_exact) >= gsw_cv.h_CT_CT_exact_ca); +if ~isempty(gsw_cf.Ienthalpy_first_deriv_CT_exact) + fprintf(2,'gsw_enthalpy_first_derivatives_CT_exact: Failed\n'); gsw_cf.gsw_chks = 0; end -gsw_cf.CT_maxdensity_exact = gsw_CT_maxdensity_exact(gsw_cv.SA_chck_cast,gsw_cv.p_chck_cast); -[gsw_cf.ICT_maxdensity_exact] = find(abs(gsw_cv.CT_maxdensity_exact - gsw_cf.CT_maxdensity_exact) >= gsw_cv.CT_maxdensity_exact_ca); -if ~isempty(gsw_cf.ICT_maxdensity_exact) - fprintf(2,'gsw_CT_maxdensity_exact: Failed\n'); +[gsw_cf.h_SA_SA_CT_exact, gsw_cf.h_SA_CT_CT_exact, gsw_cf.h_CT_CT_CT_exact] = gsw_enthalpy_second_derivatives_CT_exact(gsw_cv.SA_chck_cast,gsw_cv.CT_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Ienthalpy_second_deriv_CT_exact] = find(abs(gsw_cv.h_SA_SA_CT_exact - gsw_cf.h_SA_SA_CT_exact) >= gsw_cv.h_SA_SA_CT_exact_ca | ... + abs(gsw_cv.h_SA_CT_CT_exact - gsw_cf.h_SA_CT_CT_exact) >= gsw_cv.h_SA_CT_CT_exact_ca | ... + abs(gsw_cv.h_CT_CT_CT_exact - gsw_cf.h_CT_CT_CT_exact) >= gsw_cv.h_CT_CT_CT_exact_ca); +if ~isempty(gsw_cf.Ienthalpy_second_deriv_CT_exact) + fprintf(2,'gsw_enthalpy_second_derivatives_CT_exact: Failed\n'); gsw_cf.gsw_chks = 0; end -%% basic thermodynamic properties interms of in-situ t, derived from the exact Gibbs function +%% Labrortory functions gsw_cf.rho_t_exact = gsw_rho_t_exact(gsw_cv.SA_chck_cast,gsw_cv.t_chck_cast,gsw_cv.p_chck_cast); [gsw_cf.Irho_t_exact] = find(abs(gsw_cv.rho_t_exact - gsw_cf.rho_t_exact) >= gsw_cv.rho_t_exact_ca); @@ -941,6 +1055,30 @@ gsw_cf.gsw_chks = 0; end +gsw_cf.SA_from_rho_t_exact = gsw_SA_from_rho_t_exact(gsw_cf.rho_t_exact,gsw_cv.t_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.ISA_from_rho_t_exact] = find(abs(gsw_cv.SA_from_rho_t_exact - gsw_cf.SA_from_rho_t_exact) >= gsw_cv.SA_from_rho_t_exact_ca); +if ~isempty(gsw_cf.ISA_from_rho_t_exact) + fprintf(2,'gsw_SA_from_rho_t_exact: Failed\n'); + gsw_cf.gsw_chks = 0; +end + +gsw_cf.deltaSA_from_rho_t_exact = gsw_deltaSA_from_rho_t_exact(gsw_cf.rho_t_exact,gsw_cv.SP_chck_cast,gsw_cv.t_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.IdeltaSA_from_rho_t_exact] = find(abs(gsw_cv.deltaSA_from_rho_t_exact - gsw_cf.deltaSA_from_rho_t_exact) >= gsw_cv.deltaSA_from_rho_t_exact_ca); +if ~isempty(gsw_cf.IdeltaSA_from_rho_t_exact) + fprintf(2,'gsw_deltaSA_from_rho_t_exact: Failed\n'); + gsw_cf.gsw_chks = 0; +end + + +%% basic thermodynamic properties interms of in-situ t, derived from the exact Gibbs function + +% gsw_cf.rho_t_exact = gsw_rho_t_exact(gsw_cv.SA_chck_cast,gsw_cv.t_chck_cast,gsw_cv.p_chck_cast); +% [gsw_cf.Irho_t_exact] = find(abs(gsw_cv.rho_t_exact - gsw_cf.rho_t_exact) >= gsw_cv.rho_t_exact_ca); +% if ~isempty(gsw_cf.Irho_t_exact) +% fprintf(2,'gsw_rho_t_exact: Failed\n'); +% gsw_cf.gsw_chks = 0; +% end + gsw_cf.pot_rho_t_exact = gsw_pot_rho_t_exact(gsw_cv.SA_chck_cast,gsw_cv.t_chck_cast,gsw_cv.p_chck_cast,gsw_cv.pr); [gsw_cf.Ipot_rho_t_exact] = find(abs(gsw_cv.pot_rho_t_exact - gsw_cf.pot_rho_t_exact) >= gsw_cv.pot_rho_t_exact_ca); if ~isempty(gsw_cf.Ipot_rho_t_exact) @@ -1015,7 +1153,6 @@ fprintf(1,'.'); end - gsw_cf.sound_speed_t_exact = gsw_sound_speed_t_exact(gsw_cv.SA_chck_cast,gsw_cv.t_chck_cast,gsw_cv.p_chck_cast); [gsw_cf.Isound_speed_t_exact] = find(abs(gsw_cv.sound_speed_t_exact - gsw_cf.sound_speed_t_exact) >= gsw_cv.sound_speed_t_exact_ca); if ~isempty(gsw_cf.Isound_speed_t_exact) @@ -1058,12 +1195,12 @@ gsw_chks = 0; end -gsw_cf.SA_from_rho_t_exact = gsw_SA_from_rho_t_exact(gsw_cf.rho_t_exact,gsw_cv.t_chck_cast,gsw_cv.p_chck_cast); -[gsw_cf.ISA_from_rho_t_exact] = find(abs(gsw_cv.SA_from_rho_t_exact - gsw_cf.SA_from_rho_t_exact) >= gsw_cv.SA_from_rho_t_exact_ca); -if ~isempty(gsw_cf.ISA_from_rho_t_exact) - fprintf(2,'gsw_SA_from_rho_t_exact: Failed\n'); - gsw_cf.gsw_chks = 0; -end +% gsw_cf.SA_from_rho_t_exact = gsw_SA_from_rho_t_exact(gsw_cf.rho_t_exact,gsw_cv.t_chck_cast,gsw_cv.p_chck_cast); +% [gsw_cf.ISA_from_rho_t_exact] = find(abs(gsw_cv.SA_from_rho_t_exact - gsw_cf.SA_from_rho_t_exact) >= gsw_cv.SA_from_rho_t_exact_ca); +% if ~isempty(gsw_cf.ISA_from_rho_t_exact) +% fprintf(2,'gsw_SA_from_rho_t_exact: Failed\n'); +% gsw_cf.gsw_chks = 0; +% end gsw_cf.t_from_rho_exact = gsw_t_from_rho_exact(gsw_cf.rho_t_exact,gsw_cv.SA_chck_cast,gsw_cv.p_chck_cast); [gsw_cf.It_from_rho_exact] = find(abs(gsw_cv.t_from_rho_exact - gsw_cf.t_from_rho_exact) >= gsw_cv.t_from_rho_exact_ca); @@ -1079,13 +1216,6 @@ gsw_cf.gsw_chks = 0; end -gsw_cf.entropy_t_exact = gsw_entropy_t_exact(gsw_cv.SA_chck_cast,gsw_cv.t_chck_cast,gsw_cv.p_chck_cast); -[gsw_cf.Ientropy_t_exact] = find(abs(gsw_cv.entropy_t_exact - gsw_cf.entropy_t_exact) >= gsw_cv.entropy_t_exact_ca); -if ~isempty(gsw_cf.Ientropy_t_exact) - fprintf(2,'gsw_entropy_t_exact: Failed\n'); - gsw_cf.gsw_chks = 0; -end - gsw_cf.cp_t_exact = gsw_cp_t_exact(gsw_cv.SA_chck_cast,gsw_cv.t_chck_cast,gsw_cv.p_chck_cast); [gsw_cf.Icp_t_exact] = find(abs(gsw_cv.cp_t_exact - gsw_cf.cp_t_exact) >= gsw_cv.cp_t_exact_ca); if ~isempty(gsw_cf.Icp_t_exact) @@ -1100,9 +1230,9 @@ gsw_chks = 0; end -gsw_cf.chem_potential_t_exact = gsw_chem_potential_relative_t_exact(gsw_cv.SA_chck_cast,gsw_cv.t_chck_cast,gsw_cv.p_chck_cast); -[gsw_cf.Ichem_potential_t_exact] = find(abs(gsw_cv.chem_potential_t_exact - gsw_cf.chem_potential_t_exact) >= gsw_cv.chem_potential_t_exact_ca); -if ~isempty(gsw_cf.Ichem_potential_t_exact) +gsw_cf.chem_potential_relative_t_exact = gsw_chem_potential_relative_t_exact(gsw_cv.SA_chck_cast,gsw_cv.t_chck_cast,gsw_cv.p_chck_cast); +[gsw_cf.Ichem_potential_relative_t_exact] = find(abs(gsw_cv.chem_potential_relative_t_exact - gsw_cf.chem_potential_relative_t_exact) >= gsw_cv.chem_potential_relative_t_exact_ca); +if ~isempty(gsw_cf.Ichem_potential_relative_t_exact) fprintf(2,'gsw_chem_potential_relative_t_exact: Failed\n'); gsw_chks = 0; end @@ -1132,13 +1262,6 @@ gsw_cf.gsw_chks = 0; end -gsw_cf.adiabatic_lapse_rate_t_exact = gsw_adiabatic_lapse_rate_t_exact(gsw_cv.SA_chck_cast,gsw_cv.t_chck_cast,gsw_cv.p_chck_cast); -[gsw_cf.Iadiabatic_lapse_rate_t_exact] = find(abs(gsw_cv.adiabatic_lapse_rate_t_exact - gsw_cf.adiabatic_lapse_rate_t_exact) >= gsw_cv.adiabatic_lapse_rate_t_exact_ca); -if ~isempty(gsw_cf.Iadiabatic_lapse_rate_t_exact) - fprintf(2,'gsw_adiabatic_lapse_rate_t_exact: Failed\n'); - gsw_cf.gsw_chks = 0; -end - gsw_cf.osmotic_coefficient_t_exact = gsw_osmotic_coefficient_t_exact(gsw_cv.SA_chck_cast,gsw_cv.t_chck_cast,gsw_cv.p_chck_cast); [gsw_cf.Iosmotic_coefficient_t_exact] = find(abs(gsw_cv.osmotic_coefficient_t_exact - gsw_cf.osmotic_coefficient_t_exact) >= gsw_cv.osmotic_coefficient_t_exact_ca); if ~isempty(gsw_cf.Iosmotic_coefficient_t_exact) @@ -1158,9 +1281,9 @@ end % library -gsw_cf.fdelta = gsw_Fdelta(gsw_cv.p_chck_cast,gsw_cv.long_chck_cast,gsw_cv.lat_chck_cast); -[gsw_cf.Ifdelta] = find(abs(gsw_cv.fdelta - gsw_cf.fdelta) >= gsw_cv.fdelta_ca); -if ~isempty(gsw_cf.Ifdelta) +gsw_cf.Fdelta = gsw_Fdelta(gsw_cv.p_chck_cast,gsw_cv.long_chck_cast,gsw_cv.lat_chck_cast); +[gsw_cf.IFdelta] = find(abs(gsw_cv.Fdelta - gsw_cf.Fdelta) >= gsw_cv.Fdelta_ca); +if ~isempty(gsw_cf.IFdelta) fprintf(2,'gsw_Fdelta: Failed. \n'); gsw_cf.gsw_chks = 0; end @@ -1170,10 +1293,10 @@ gsw_cf.lat_chck_cast_temp(I,:) = gsw_cv.lat_chck_cast(1,:); end [I] = find(~isnan(gsw_cv.p_chck_cast)); -gsw_cf.delta_sa_ref = nan(45,3); -gsw_cf.delta_sa_ref(I) = gsw_deltaSA_atlas(gsw_cv.p_chck_cast(I),gsw_cf.long_chck_cast_temp(I),gsw_cf.lat_chck_cast_temp(I)); -[gsw_cf.Idelta_sa_ref] = find(abs(gsw_cv.delta_sa_ref - gsw_cf.delta_sa_ref) >= gsw_cv.delta_sa_ref_ca); -if ~isempty(gsw_cf.Idelta_sa_ref) +gsw_cf.deltaSA_atlas = nan(45,3); +gsw_cf.deltaSA_atlas(I) = gsw_deltaSA_atlas(gsw_cv.p_chck_cast(I),gsw_cf.long_chck_cast_temp(I),gsw_cf.lat_chck_cast_temp(I)); +[gsw_cf.IdeltaSA_atlas] = find(abs(gsw_cv.deltaSA_atlas - gsw_cf.deltaSA_atlas) >= gsw_cv.deltaSA_atlas_ca); +if ~isempty(gsw_cf.IdeltaSA_atlas) fprintf(2,'gsw_deltaSA_atlas: Failed. \n'); gsw_cf.gsw_chks = 0; end diff --git a/Toolbox/gsw_cp0.m b/Toolbox/gsw_cp0.m index b335b54..a0f5919 100644 --- a/Toolbox/gsw_cp0.m +++ b/Toolbox/gsw_cp0.m @@ -17,7 +17,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (13th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_deltaSA_from_SP.m b/Toolbox/gsw_deltaSA_from_SP.m index 2b530cd..61c34ca 100644 --- a/Toolbox/gsw_deltaSA_from_SP.m +++ b/Toolbox/gsw_deltaSA_from_SP.m @@ -29,7 +29,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (7th January, 2013) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_depth_from_z.m b/Toolbox/gsw_depth_from_z.m index b90c51b..6f160fe 100644 --- a/Toolbox/gsw_depth_from_z.m +++ b/Toolbox/gsw_depth_from_z.m @@ -19,7 +19,7 @@ % AUTHOR: % Winston [ god@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % This software is available from http://www.TEOS-10.org % diff --git a/Toolbox/gsw_distance.m b/Toolbox/gsw_distance.m index 024a8b4..28eb02e 100644 --- a/Toolbox/gsw_distance.m +++ b/Toolbox/gsw_distance.m @@ -43,7 +43,7 @@ % MODIFIED: % 4th April, 2011 by Paul Barker and Trevor McDougall. % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCE: % http://www.eos.ubc.ca/~rich/map.html diff --git a/Toolbox/gsw_dynamic_enthalpy.m b/Toolbox/gsw_dynamic_enthalpy.m index 10935b6..57d372f 100644 --- a/Toolbox/gsw_dynamic_enthalpy.m +++ b/Toolbox/gsw_dynamic_enthalpy.m @@ -10,12 +10,12 @@ % DESCRIPTION: % Calculates dynamic enthalpy of seawater using the computationally- % efficient 48-term expression for density in terms of SA, CT and p -% (McDougall et al., 2011). Dynamic enthalpy is defined as enthalpy minus +% (IOC et al., 2010). Dynamic enthalpy is defined as enthalpy minus % potential enthalpy (Young, 2010). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -34,7 +34,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (12th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -43,10 +43,10 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See section 3.2 of this TEOS-10 Manual. % -% 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., 2003: Potential enthalpy: A conservative oceanic +% variable for evaluating heat content and heat fluxes. Journal of +% Physical Oceanography, 33, 945-963. +% See Eqns. (18) and (22) % % Young, W.R., 2010: Dynamic enthalpy, Conservative Temperature, and the % seawater Boussinesq approximation. Journal of Physical Oceanography, @@ -190,16 +190,6 @@ + (M./(2*b2)).*log(1 + p.*(2*b1 + b2.*p)./b0) ... + part.*log(1 + (b2.*p.*(B - A))./(A.*(B + b2.*p)))); -%-------------------------------------------------------------------------- -% This function calculates dynamic_enthalpy using the computationally- -% efficient 48-term expression for density in terms of SA, CT and p. If -% one wanted to compute dynamic_enthalpy from SA, CT, and p with the full -% TEOS-10 Gibbs function, the following lines of code will enable this. -% -% dynamic_enthalpy = gsw_dynamic_enthalpy_CT_exact(SA,CT,p) -% -%-----------------This is the end of the alternative code------------------ - if transposed dynamic_enthalpy = dynamic_enthalpy.'; end diff --git a/Toolbox/gsw_dynamic_enthalpy_CT.m b/Toolbox/gsw_dynamic_enthalpy_CT.m index 3f00436..9cc9218 100644 --- a/Toolbox/gsw_dynamic_enthalpy_CT.m +++ b/Toolbox/gsw_dynamic_enthalpy_CT.m @@ -16,12 +16,12 @@ % DESCRIPTION: % Calculates dynamic enthalpy of seawater using the computationally- % efficient 48-term expression for density in terms of SA, CT and p -% (McDougall et al., 2013). Dynamic enthalpy is defined as enthalpy minus +% (IOC et al., 2010). Dynamic enthalpy is defined as enthalpy minus % potential enthalpy (Young, 2010). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -40,7 +40,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -49,10 +49,10 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See section 3.2 of this TEOS-10 Manual. % -% 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., 2003: Potential enthalpy: A conservative oceanic +% variable for evaluating heat content and heat fluxes. Journal of +% Physical Oceanography, 33, 945-963. +% See Eqns. (18) and (22) % % Young, W.R., 2010: Dynamic enthalpy, Conservative Temperature, and the % seawater Boussinesq approximation. Journal of Physical Oceanography, diff --git a/Toolbox/gsw_dynamic_enthalpy_CT_exact.m b/Toolbox/gsw_dynamic_enthalpy_CT_exact.m index a0b1f0a..ba15aa5 100644 --- a/Toolbox/gsw_dynamic_enthalpy_CT_exact.m +++ b/Toolbox/gsw_dynamic_enthalpy_CT_exact.m @@ -15,7 +15,7 @@ % alternative to calling this function, namely % gsw_dynamic_enthalpy(SA,CT,p), which uses the computationally % efficient 48-term expression for density in terms of SA, CT and p -% (McDougall et al., 2013). +% (IOC et al., 2010). % % INPUT: % SA = Absolute Salinity [ g/kg ] @@ -32,7 +32,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker. [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -41,10 +41,10 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See apendix A.30 of this TEOS-10 Manual. % -% 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., 2003: Potential enthalpy: A conservative oceanic +% variable for evaluating heat content and heat fluxes. Journal of +% Physical Oceanography, 33, 945-963. +% See Eqns. (18) and (22) % % Young, W.R., 2010: Dynamic enthalpy, Conservative Temperature, and the % seawater Boussinesq approximation. Journal of Physical Oceanography, diff --git a/Toolbox/gsw_enthalpy.m b/Toolbox/gsw_enthalpy.m index 345289d..417c62b 100644 --- a/Toolbox/gsw_enthalpy.m +++ b/Toolbox/gsw_enthalpy.m @@ -10,11 +10,11 @@ % DESCRIPTION: % Calculates specific enthalpy of seawater using the computationally- % efficient 48-term expression for density in terms of SA, CT and p -% (McDougall et al., 2013) +% (IOC et al., 2010) % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -34,7 +34,7 @@ % Trevor McDougall, David Jackett, Claire Roberts-Thomson and Paul Barker. % [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -43,10 +43,10 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.6) of this TEOS-10 Manual. % -% 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., 2003: Potential enthalpy: A conservative oceanic +% variable for evaluating heat content and heat fluxes. Journal of +% Physical Oceanography, 33, 945-963. +% See Eqns. (18) and (22) % % The software is available from http://www.TEOS-10.org % diff --git a/Toolbox/gsw_enthalpy_CT.m b/Toolbox/gsw_enthalpy_CT.m index c27d90e..ed30eb5 100644 --- a/Toolbox/gsw_enthalpy_CT.m +++ b/Toolbox/gsw_enthalpy_CT.m @@ -16,11 +16,11 @@ % DESCRIPTION: % Calculates specific enthalpy of seawater using the computationally- % efficient 48-term expression for density in terms of SA, CT and p -% (McDougall et al., 2013) +% (IOC et al., 2010) % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -40,7 +40,7 @@ % Trevor McDougall, David Jackett, Claire Roberts-Thomson and Paul Barker. % [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -49,10 +49,10 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.6) of this TEOS-10 Manual. % -% 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., 2003: Potential enthalpy: A conservative oceanic +% variable for evaluating heat content and heat fluxes. Journal of +% Physical Oceanography, 33, 945-963. +% See Eqns. (18) and (22) % % The software is available from http://www.TEOS-10.org % diff --git a/Toolbox/gsw_enthalpy_CT_exact.m b/Toolbox/gsw_enthalpy_CT_exact.m index 7ca1531..8ae2173 100644 --- a/Toolbox/gsw_enthalpy_CT_exact.m +++ b/Toolbox/gsw_enthalpy_CT_exact.m @@ -13,7 +13,7 @@ % Note that this function uses the full Gibbs function. There is an % alternative to calling this function, namely gsw_enthalpy_CT(SA,CT,p), % which uses the computationally-efficient 48-term expression for density -% in terms of SA, CT and p (McDougall et al., 2013). +% in terms of SA, CT and p (IOC et al., 2010). % % INPUT: % SA = Absolute Salinity [ g/kg ] @@ -30,7 +30,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (12th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -39,10 +39,10 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See apendix A.11 of this TEOS-10 Manual. % -% 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., 2003: Potential enthalpy: A conservative oceanic +% variable for evaluating heat content and heat fluxes. Journal of +% Physical Oceanography, 33, 945-963. +% See Eqns. (18) and (22) % % The software is available from http://www.TEOS-10.org % @@ -92,7 +92,6 @@ % Start of the calculation %-------------------------------------------------------------------------- - t = gsw_t_from_CT(SA,CT,p); enthalpy_CT_exact = gsw_enthalpy_t_exact(SA,t,p); diff --git a/Toolbox/gsw_enthalpy_diff.m b/Toolbox/gsw_enthalpy_diff.m index fcdcbc3..907cb9c 100644 --- a/Toolbox/gsw_enthalpy_diff.m +++ b/Toolbox/gsw_enthalpy_diff.m @@ -12,13 +12,13 @@ % two different pressures, p_deep (the deeper pressure) and p_shallow % (the shallower pressure), at the same values of SA and CT. This % function uses the computationally-efficient 48-term expression for -% density in terms of SA, CT and p (McDougall et al., 2013). The output +% density in terms of SA, CT and p (IOC et al., 2010). The output % (enthalpy_diff_CT) is the specific enthalpy evaluated at (SA,CT,p_deep) % minus the specific enthalpy at (SA,CT,p_shallow). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -40,7 +40,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker. [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -49,10 +49,10 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqns. (3.32.2) and (A.30.6) of this TEOS-10 Manual. % -% 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., 2003: Potential enthalpy: A conservative oceanic +% variable for evaluating heat content and heat fluxes. Journal of +% Physical Oceanography, 33, 945-963. +% See Eqns. (18) and (22) % % The software is available from http://www.TEOS-10.org % diff --git a/Toolbox/gsw_enthalpy_diff_CT.m b/Toolbox/gsw_enthalpy_diff_CT.m index 966b5f0..5c9f72b 100644 --- a/Toolbox/gsw_enthalpy_diff_CT.m +++ b/Toolbox/gsw_enthalpy_diff_CT.m @@ -18,13 +18,13 @@ % two different pressures, p_deep (the deeper pressure) and p_shallow % (the shallower pressure), at the same values of SA and CT. This % function uses the computationally-efficient 48-term expression for -% density in terms of SA, CT and p (McDougall et al., 2013). The output +% density in terms of SA, CT and p (IOC et al., 2010). The output % (enthalpy_diff_CT) is the specific enthalpy evaluated at (SA,CT,p_deep) % minus the specific enthalpy at (SA,CT,p_shallow). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -46,7 +46,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker. [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -55,10 +55,10 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqns. (3.32.2) and (A.30.6) of this TEOS-10 Manual. % -% 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., 2003: Potential enthalpy: A conservative oceanic +% variable for evaluating heat content and heat fluxes. Journal of +% Physical Oceanography, 33, 945-963. +% See Eqns. (18) and (22) % % The software is available from http://www.TEOS-10.org % diff --git a/Toolbox/gsw_enthalpy_diff_CT_exact.m b/Toolbox/gsw_enthalpy_diff_CT_exact.m index 0f8d6a3..1fa93f7 100644 --- a/Toolbox/gsw_enthalpy_diff_CT_exact.m +++ b/Toolbox/gsw_enthalpy_diff_CT_exact.m @@ -17,7 +17,7 @@ % alternative to calling this function, namely % gsw_enthalpy_diff_CT(SA,CT,p), which uses the computationally % efficient 48-term expression for density in terms of SA, CT and p -% (McDougall et al., 2013). +% (IOC et al., 2010). % % INPUT: % SA = Absolute Salinity [ g/kg ] @@ -37,7 +37,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -46,10 +46,10 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqns. (3.32.2) of this TEOS-10 Manual. % -% 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., 2003: Potential enthalpy: A conservative oceanic +% variable for evaluating heat content and heat fluxes. Journal of +% Physical Oceanography, 33, 945-963. +% See Eqns. (18) and (22) % % The software is available from http://www.TEOS-10.org % diff --git a/Toolbox/gsw_enthalpy_first_derivatives.m b/Toolbox/gsw_enthalpy_first_derivatives.m index 2bde70f..6e7294e 100644 --- a/Toolbox/gsw_enthalpy_first_derivatives.m +++ b/Toolbox/gsw_enthalpy_first_derivatives.m @@ -1,18 +1,26 @@ -function [h_SA, h_CT, h_P] = gsw_enthalpy_first_derivatives(SA,CT,p) +function [h_SA, h_CT] = gsw_enthalpy_first_derivatives(SA,CT,p) % gsw_enthalpy_first_derivatives first derivatives of enthalpy %========================================================================== % % USAGE: -% [h_SA, h_CT, h_P] = gsw_enthalpy_first_derivatives(SA,CT,p) +% [h_SA, h_CT] = gsw_enthalpy_first_derivatives(SA,CT,p) % % DESCRIPTION: -% Calculates the following three derivatives of specific enthalpy (h) +% Calculates the following two derivatives of specific enthalpy (h) of +% seawater using the computationally-efficient 48-term expression for +% density in terms of SA, CT and p (IOC et al., 2010). % (1) h_SA, the derivative with respect to Absolute Salinity at % constant CT and p, and % (2) h_CT, derivative with respect to CT at constant SA and p. -% (3) h_P, derivative with respect to pressure (in Pa) at constant -% SA and CT. +% Note that h_P is specific volume (1/rho) it can be calulated by calling +% gsw_specvol(SA,CT,p). +% +% 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 IOC et al. (2010). The GSW library function +% "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if +% some of one's data lies outside this "funnel". % % INPUT: % SA = Absolute Salinity [ g/kg ] @@ -29,15 +37,11 @@ % [ J/(kg (g/kg))] i.e. [ J/g ] % h_CT = The first derivative of specific enthalpy with respect to % CT at constant SA and p. [ J/(kg K) ] -% h_P = The first partial derivative of specific enthalpy with -% respect to pressure (in Pa) at fixed SA and CT. Note that -% h_P is specific volume (1/rho). % % AUTHOR: -% Trevor McDougall. [ help@teos-10.org ] +% Trevor McDougall and Paul Barker. [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) -% This function is unchanged from version 2.0 (24th September, 2010). +% VERSION NUMBER: 3.03 (20th May, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -46,6 +50,11 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org. % See Eqns. (A.11.18), (A.11.15) and (A.11.12) of this TEOS-10 Manual. % +% McDougall, T. J., 2003: Potential enthalpy: A conservative oceanic +% variable for evaluating heat content and heat fluxes. Journal of +% Physical Oceanography, 33, 945-963. +% See Eqns. (18) and (22) +% % This software is available from http://www.TEOS-10.org % %========================================================================== @@ -58,8 +67,8 @@ error('gsw_enthalpy_first_derivatives: Requires three inputs') end %if -if ~(nargout == 3) - error('gsw_enthalpy_first_derivatives: Requires three outputs') +if ~(nargout == 2) + error('gsw_enthalpy_first_derivatives: Requires two outputs') end %if [ms,ns] = size(SA); @@ -98,70 +107,30 @@ % Start of the calculation %-------------------------------------------------------------------------- -cp0 = 3991.86795711963; % from Eqn. (3.3.3) of IOC et al. (2010). -n0 = 0; -n1 = 1; - -t = gsw_t_from_CT(SA,CT,p); -pt0 = gsw_pt_from_CT(SA,CT); - -temp_ratio = (273.15 + t)./(273.15 + pt0); - -h_CT = cp0.*temp_ratio; % from Eqn. (A.11.15) of IOC et al. (2010). - -h_P = gsw_gibbs(n0,n0,n1,SA,t,p); %from Eqn. (A.11.12) of IOC et al. (2010). - -db2Pa = 1e-4; -sfac = 0.0248826675584615; % sfac = 1/(40*(35.16504/35)). - -x = sqrt(sfac.*SA); -y = 0.025*t; -z = db2Pa*p; %Note.The input pressure (p) is sea pressure in units of dbar. - -g_SA_mod_t = 8645.36753595126 + z.*(-6620.98308089678 + ... - z.*(769.588305957198 + z.*(-193.0648640214916 + (31.6816345533648 - 5.24960313181984.*z).*z))) + ... - x.*(-7296.43987145382 + x.*(8103.20462414788 + ... - y.*(2175.341332000392 + y.*(-274.2290036817964 + ... - y.*(197.4670779425016 + y.*(-68.5590309679152 + 9.98788038278032.*y))) - 90.6734234051316.*z) + ... - x.*(-5458.34205214835 - 980.14153344888.*y + ... - x.*(2247.60742726704 - 340.1237483177863.*x + 220.542973797483.*y) + 180.142097805543.*z) + ... - z.*(-219.1676534131548 + (-16.32775915649044 - 120.7020447884644.*z).*z)) + ... - z.*(598.378809221703 + z.*(-156.8822727844005 + (204.1334828179377 - 10.23755797323846.*z).*z)) + ... - y.*(-1480.222530425046 + z.*(-525.876123559641 + (249.57717834054571 - 88.449193048287.*z).*z) + ... - y.*(-129.1994027934126 + z.*(1149.174198007428 + z.*(-162.5751787551336 + 76.9195462169742.*z)) + ... - y.*(-30.0682112585625 - 1380.9597954037708.*z + y.*(2.626801985426835 + 703.695562834065.*z))))) + ... - y.*(1187.3715515697959 + z.*(1458.233059470092 + ... - z.*(-687.913805923122 + z.*(249.375342232496 + z.*(-63.313928772146 + 14.09317606630898.*z)))) + ... - y.*(1760.062705994408 + y.*(-450.535298526802 + ... - y.*(182.8520895502518 + y.*(-43.3206481750622 + 4.26033941694366.*y) + ... - z.*(-595.457483974374 + (149.452282277512 - 72.9745838003176.*z).*z)) + ... - z.*(1388.489628266536 + z.*(-409.779283929806 + (227.123395681188 - 22.2565468652826.*z).*z))) + ... - z.*(-1721.528607567954 + z.*(674.819060538734 + ... - z.*(-356.629112415276 + (88.4080716616 - 15.84003094423364.*z).*z))))); - -g_SA_mod_t = 0.5.*sfac.*g_SA_mod_t; - -y_pt = 0.025*pt0; - -g_SA_mod_pt = 8645.36753595126 + ... - x.*(-7296.43987145382 + x.*(8103.20462414788 + ... - y_pt.*(2175.341332000392 + y_pt.*(-274.2290036817964 + ... - y_pt.*(197.4670779425016 + y_pt.*(-68.5590309679152 + 9.98788038278032.*y_pt)))) + ... - x.*(-5458.34205214835 - 980.14153344888.*y_pt + ... - x.*(2247.60742726704 - 340.1237483177863.*x + 220.542973797483.*y_pt))) + ... - y_pt.*(-1480.222530425046 + y_pt.*(-129.1994027934126 + ... - y_pt.*(-30.0682112585625 + y_pt.*2.626801985426835)))) + ... - y_pt.*(1187.3715515697959 + y_pt.*(1760.062705994408 + y_pt.*(-450.535298526802 + ... - y_pt.*(182.8520895502518 + y_pt.*(-43.3206481750622 + 4.26033941694366.*y_pt))))); - -g_SA_mod_pt = 0.5*sfac*g_SA_mod_pt; - -h_SA = g_SA_mod_t - temp_ratio.*g_SA_mod_pt; +SA(SA<0) = 0; +dSA = 0.01; % increment in Absolute Salinity is 1e-2 g kg^-1 +SA_l = nan(size(SA)); +SA_l(SA >= dSA) = SA(SA >= dSA) - dSA; +SA_l(SA= dSA) = SA(SA >= dSA) - dSA; +SA_l(SA0.5 & SA<1); + + h_SA_SA(SA>0.5 & SA<1) = SA_taper.*(h_SA_SA_exact(SA>0.5 & SA<1)) + (1-SA_taper).*h_SA_SA_48(SA>0.5 & SA<1); + + h_SA_SA(SA<=0.5) = h_SA_SA_exact(SA<=0.5); end -h_SA_CT = cp0.*part - factor.*h_CT_CT; +[hSA_l,dummy] = gsw_enthalpy_first_derivatives(SA,CT_l,p); +[hSA_u,dummy] = gsw_enthalpy_first_derivatives(SA,CT_u,p); + +h_SA_CT = (hSA_u - hSA_l)./(CT_u - CT_l); + +hCT_l = gsw_dynamic_enthalpy(SA,CT_l,p); +hCT = gsw_dynamic_enthalpy(SA,CT,p); +hCT_u = gsw_dynamic_enthalpy(SA,CT_u,p); + +h_CT_CT = 4.*(hCT_u - 2.*hCT + hCT_l)./((CT_u - CT_l).^2); if transposed h_SA_SA = h_SA_SA.'; diff --git a/Toolbox/gsw_enthalpy_second_derivatives_CT.m b/Toolbox/gsw_enthalpy_second_derivatives_CT.m new file mode 100644 index 0000000..ee9c151 --- /dev/null +++ b/Toolbox/gsw_enthalpy_second_derivatives_CT.m @@ -0,0 +1,127 @@ +function [h_SA_SA, h_SA_CT, h_CT_CT] = gsw_enthalpy_second_derivatives_CT(SA,CT,p) + +% gsw_enthalpy_second_derivatives_CT second derivatives of enthalpy +% (48-term equation) +% ========================================================================= +% +% USAGE: +% [h_SA_SA, h_SA_CT, h_CT_CT] = gsw_enthalpy_second_derivatives_CT(SA,CT,p) +%, or equivalently +% [h_SA_SA, h_SA_CT, h_CT_CT] = gsw_enthalpy_second_derivatives(SA,CT,p) +% +% Note that gsw_enthalpy_second_derivatives_CT(SA,CT,p) is identical to +% gsw_enthalpy_second_derivatives(SA,CT,p). The extra "_CT" emphasises +% that the input temperature is Conservative Temperature, but the extra +% "_CT" part of the function name is not needed. +% +% DESCRIPTION: +% Calculates the following three second-order derivatives of specific +% enthalpy (h),using the computationally-efficient 48-term expression for +% density in terms of SA, CT and p (McDougall et al., 2013). +% (1) h_SA_SA, second-order derivative with respect to Absolute Salinity +% at constant CT & p. +% (2) h_SA_CT, second-order derivative with respect to SA & CT at +% constant p. +% (3) h_CT_CT, second-order derivative with respect to CT at constant SA +% and p. +% +% 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 IOC et al. (2010). The GSW library function +% "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if +% some of one's data lies outside this "funnel". +% +% INPUT: +% SA = Absolute Salinity [ g/kg ] +% CT = Conservative Temperature (ITS-90) [ deg C ] +% p = sea pressure [ dbar ] +% ( i.e. absolute pressure - 10.1325 dbar ) +% +% SA & CT need to have the same dimensions. +% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & CT are MxN. +% +% OUTPUT: +% h_SA_SA = The second derivative of specific enthalpy with respect to +% Absolute Salinity at constant CT & p. [ J/(kg (g/kg)^2) ] +% h_SA_CT = The second derivative of specific enthalpy with respect to +% SA and CT at constant p. [ J/(kg K(g/kg)) ] +% h_CT_CT = The second derivative of specific enthalpy with respect to +% CT at constant SA and p. [ J/(kg K^2) ] +% +% AUTHOR: +% Trevor McDougall and Paul Barker. [ help@teos-10.org ] +% +% VERSION NUMBER: 3.03 (26th April, 2013) +% +% 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. +% +% McDougall, T. J., 2003: Potential enthalpy: A conservative oceanic +% variable for evaluating heat content and heat fluxes. Journal of +% Physical Oceanography, 33, 945-963. +% See Eqns. (18) and (22) +% +% This software is available from http://www.TEOS-10.org +% +%========================================================================== + +%-------------------------------------------------------------------------- +% Check variables and resize if necessary +%-------------------------------------------------------------------------- + +if ~(nargin == 3) + error('gsw_enthalpy_second_derivatives: Requires three inputs') +end %if + +if ~(nargout == 3) + error('gsw_enthalpy_second_derivatives: Requires three outputs') +end %if + +[ms,ns] = size(SA); +[mt,nt] = size(CT); +[mp,np] = size(p); + +if (ms ~= mt | ns ~= nt ) + error('gsw_enthalpy_second_derivatives: SA and CT do not have the same dimensions') +end %if + +if (mp == 1) & (np == 1) % p scalar - fill to size of SA + p = p*ones(size(SA)); +elseif (ns == np) & (mp == 1) % p is row vector, + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (np == 1) % p is column vector, + p = p(:,ones(1,ns)); % copy across each row. +elseif (ns == mp) & (np == 1) % p is a transposed row vector, + p = p.'; % transposed then + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (ns == np) + % ok +else + error('gsw_enthalpy_second_derivatives: The dimensions of p do not agree') +end %if + +if ms == 1 + SA = SA.'; + CT = CT.'; + p = p.'; + transposed = 1; +else + transposed = 0; +end + +%-------------------------------------------------------------------------- +% Start of the calculation +%-------------------------------------------------------------------------- + +[h_SA_SA, h_SA_CT, h_CT_CT] = gsw_enthalpy_second_derivatives(SA,CT,p); + +if transposed + h_SA_SA = h_SA_SA.'; + h_SA_CT = h_SA_CT.'; + h_CT_CT = h_CT_CT.'; +end + +end diff --git a/Toolbox/gsw_enthalpy_second_derivatives_CT_exact.m b/Toolbox/gsw_enthalpy_second_derivatives_CT_exact.m new file mode 100644 index 0000000..13f8e37 --- /dev/null +++ b/Toolbox/gsw_enthalpy_second_derivatives_CT_exact.m @@ -0,0 +1,164 @@ +function [h_SA_SA, h_SA_CT, h_CT_CT] = gsw_enthalpy_second_derivatives_CT_exact(SA,CT,p) + +% gsw_enthalpy_second_derivatives_CT_exact second derivatives of enthalpy +% ========================================================================= +% +% USAGE: +% [h_SA_SA, h_SA_CT, h_CT_CT] = gsw_enthalpy_second_derivatives_CT_exact(SA,CT,p) +% +% DESCRIPTION: +% Calculates the following three second-order derivatives of specific +% enthalpy (h), +% (1) h_SA_SA, second-order derivative with respect to Absolute Salinity +% at constant CT & p. +% (2) h_SA_CT, second-order derivative with respect to SA & CT at +% constant p. +% (3) h_CT_CT, second-order derivative with respect to CT at constant SA +% and p. +% +% Note that this function uses the full Gibbs function. There is an +% alternative to calling this function, namely +% gsw_enthalpy_second_derivatives(SA,CT,p) which uses the computationally +% efficient 48-term expression for density in terms of SA, CT and p +% (IOC et al., 2010). +% +% INPUT: +% SA = Absolute Salinity [ g/kg ] +% CT = Conservative Temperature (ITS-90) [ deg C ] +% p = sea pressure [ dbar ] +% ( i.e. absolute pressure - 10.1325 dbar ) +% +% SA & CT need to have the same dimensions. +% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & CT are MxN. +% +% OUTPUT: +% h_SA_SA = The second derivative of specific enthalpy with respect to +% Absolute Salinity at constant CT & p. [ J/(kg (g/kg)^2) ] +% h_SA_CT = The second derivative of specific enthalpy with respect to +% SA and CT at constant p. [ J/(kg K(g/kg)) ] +% h_CT_CT = The second derivative of specific enthalpy with respect to +% CT at constant SA and p. [ J/(kg K^2) ] +% +% AUTHOR: +% Trevor McDougall and Paul Barker. [ help@teos-10.org ] +% +% VERSION NUMBER: 3.03 (12th April, 2013) +% +% 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. +% +% McDougall, T. J., 2003: Potential enthalpy: A conservative oceanic +% variable for evaluating heat content and heat fluxes. Journal of +% Physical Oceanography, 33, 945-963. +% See Eqns. (18) and (22) +% +% This software is available from http://www.TEOS-10.org +% +%========================================================================== + +%-------------------------------------------------------------------------- +% Check variables and resize if necessary +%-------------------------------------------------------------------------- + +if ~(nargin == 3) + error('gsw_enthalpy_second_derivatives_CT_exact: Requires three inputs') +end %if + +if ~(nargout == 3) + error('gsw_enthalpy_second_derivatives_CT_exact: Requires three outputs') +end %if + +[ms,ns] = size(SA); +[mt,nt] = size(CT); +[mp,np] = size(p); + +if (ms ~= mt | ns ~= nt ) + error('gsw_enthalpy_second_derivatives_CT_exact: SA and CT do not have the same dimensions') +end %if + +if (mp == 1) & (np == 1) % p scalar - fill to size of SA + p = p*ones(size(SA)); +elseif (ns == np) & (mp == 1) % p is row vector, + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (np == 1) % p is column vector, + p = p(:,ones(1,ns)); % copy across each row. +elseif (ns == mp) & (np == 1) % p is a transposed row vector, + p = p.'; % transposed then + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (ns == np) + % ok +else + error('gsw_enthalpy_second_derivatives_CT_exact: The dimensions of p do not agree') +end %if + +if ms == 1 + SA = SA.'; + CT = CT.'; + p = p.'; + transposed = 1; +else + transposed = 0; +end + +%-------------------------------------------------------------------------- +% Start of the calculation +%-------------------------------------------------------------------------- + +cp0 = 3991.86795711963; % from Eqn. 3.3.3 of IOC et al. (2010). +n0 = 0; +n1 = 1; +n2 = 2; +pr0 = zeros(size(SA)); + +pt0 = gsw_pt_from_CT(SA,CT); +rec_abs_pt0 = 1./(273.15 + pt0); +t = gsw_pt_from_t(SA,pt0,pr0,p); +temp_ratio = (273.15 + t).*rec_abs_pt0; + +rec_gTT_pt0 = 1./gsw_gibbs(n0,n2,n0,SA,pt0,pr0); +rec_gTT_t = 1./gsw_gibbs(n0,n2,n0,SA,t,p); +gST_pt0 = gsw_gibbs(n1,n1,n0,SA,pt0,pr0); +gST_t = gsw_gibbs(n1,n1,n0,SA,t,p); +gS_pt0 = gsw_gibbs(n1,n0,n0,SA,pt0,pr0); + +% h_CT_CT is naturally well-behaved as SA approaches zero. +h_CT_CT = cp0.*cp0.* ... + (temp_ratio.*rec_gTT_pt0 - rec_gTT_t).*(rec_abs_pt0.*rec_abs_pt0); + +part = (temp_ratio.*gST_pt0.*rec_gTT_pt0 - gST_t.*rec_gTT_t).*rec_abs_pt0; +factor = gS_pt0./cp0; + +% h_SA_SA has a singularity at SA = 0, and blows up as SA approaches zero. +h_SA_SA = gsw_gibbs(n2,n0,n0,SA,t,p) ... + - temp_ratio.*gsw_gibbs(n2,n0,n0,SA,pt0,pr0) ... + + temp_ratio.*gST_pt0.*gST_pt0.*rec_gTT_pt0 ... + - gST_t.*gST_t.*rec_gTT_t ... + - 2.0.*gS_pt0.*part + (factor.*factor).*h_CT_CT; + +% h_SA_CT should not blow up as SA approaches zero. The following lines +% of code ensure that the h_SA_CT output of this function does not blow +% up in this limit. That is, when SA < 1e-100 g/kg, we force the h_SA_CT +% output to be the same as if SA = 1e-100 g/kg. +if any(SA < 1e-100) + SA(SA < 1e-100) = 1e-100; + rec_gTT_pt0 = 1./gsw_gibbs(n0,n2,n0,SA,pt0,pr0); + rec_gTT_t = 1./gsw_gibbs(n0,n2,n0,SA,t,p); + gST_pt0 = gsw_gibbs(n1,n1,n0,SA,pt0,pr0); + gST_t = gsw_gibbs(n1,n1,n0,SA,t,p); + gS_pt0 = gsw_gibbs(n1,n0,n0,SA,pt0,pr0); + part = (temp_ratio.*gST_pt0.*rec_gTT_pt0 - gST_t.*rec_gTT_t).*rec_abs_pt0; + factor = gS_pt0./cp0; +end + +h_SA_CT = cp0.*part - factor.*h_CT_CT; + +if transposed + h_SA_SA = h_SA_SA.'; + h_SA_CT = h_SA_CT.'; + h_CT_CT = h_CT_CT.'; +end + +end diff --git a/Toolbox/gsw_entropy_first_derivatives.m b/Toolbox/gsw_entropy_first_derivatives.m index 5cca328..4e04196 100644 --- a/Toolbox/gsw_entropy_first_derivatives.m +++ b/Toolbox/gsw_entropy_first_derivatives.m @@ -32,8 +32,7 @@ % AUTHOR: % Trevor McDougall. [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) -% This function is unchanged from version 2.0 (24th September, 2010). +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_entropy_from_CT.m b/Toolbox/gsw_entropy_from_CT.m index 2c98a30..dd7e895 100644 --- a/Toolbox/gsw_entropy_from_CT.m +++ b/Toolbox/gsw_entropy_from_CT.m @@ -22,7 +22,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_entropy_from_pt.m b/Toolbox/gsw_entropy_from_pt.m index 48455c3..6cebd48 100644 --- a/Toolbox/gsw_entropy_from_pt.m +++ b/Toolbox/gsw_entropy_from_pt.m @@ -22,7 +22,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_entropy_t_exact.m b/Toolbox/gsw_entropy_from_t.m similarity index 80% rename from Toolbox/gsw_entropy_t_exact.m rename to Toolbox/gsw_entropy_from_t.m index ee084fc..6b16eba 100644 --- a/Toolbox/gsw_entropy_t_exact.m +++ b/Toolbox/gsw_entropy_from_t.m @@ -1,10 +1,10 @@ -function entropy_t_exact = gsw_entropy_t_exact(SA,t,p) +function entropy = gsw_entropy_from_t(SA,t,p) -% gsw_entropy_t_exact specific entropy of seawater +% gsw_entropy_from_t specific entropy of seawater %========================================================================== % % USAGE: -% entropy_t_exact = gsw_entropy_t_exact(SA,t,p) +% entropy = gsw_entropy_from_t(SA,t,p) % % DESCRIPTION: % Calculates specific entropy of seawater. @@ -19,12 +19,12 @@ % p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & t are MxN. % % OUTPUT: -% entropy_t_exact = specific entropy [ J/(kg*K) ] +% entropy = specific entropy [ J/(kg*K) ] % % AUTHOR: % David Jackett, Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -41,7 +41,7 @@ %-------------------------------------------------------------------------- if ~(nargin == 3) - error('gsw_entropy_t_exact: Requires three inputs') + error('gsw_entropy_from_t: Requires three inputs') end %if [ms,ns] = size(SA); @@ -49,7 +49,7 @@ [mp,np] = size(p); if (mt ~= ms | nt ~= ns) - error('gsw_entropy_t_exact: SA and t must have same dimensions') + error('gsw_entropy_from_t: SA and t must have same dimensions') end if (mp == 1) & (np == 1) % p scalar - fill to size of SA @@ -64,7 +64,7 @@ elseif (ms == mp) & (ns == np) % ok else - error('gsw_entropy_t_exact: Inputs array dimensions arguments do not agree') + error('gsw_entropy_from_t: Inputs array dimensions arguments do not agree') end %if if ms == 1 @@ -83,10 +83,10 @@ n0 = 0; n1 = 1; -entropy_t_exact = -gsw_gibbs(n0,n1,n0,SA,t,p); +entropy = -gsw_gibbs(n0,n1,n0,SA,t,p); if transposed - entropy_t_exact = entropy_t_exact.'; + entropy = entropy.'; end end \ No newline at end of file diff --git a/Toolbox/gsw_entropy_second_derivatives.m b/Toolbox/gsw_entropy_second_derivatives.m index 733f0e7..453f77d 100644 --- a/Toolbox/gsw_entropy_second_derivatives.m +++ b/Toolbox/gsw_entropy_second_derivatives.m @@ -37,8 +37,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) -% This function is unchanged from version 2.0 (24th September, 2010). +% VERSION NUMBER: 3.03 (16th April, 2012) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_f.m b/Toolbox/gsw_f.m index 153447f..0e2e7a5 100644 --- a/Toolbox/gsw_f.m +++ b/Toolbox/gsw_f.m @@ -24,7 +24,7 @@ % MODIFIED: % 28th July, 2010 by Paul Barker % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % This function is unchanged from version 2.0 (28th July, 2010). % % REFERENCE: diff --git a/Toolbox/gsw_geo_strf_Cunningham.m b/Toolbox/gsw_geo_strf_Cunningham.m index 8d3f1de..8861e46 100644 --- a/Toolbox/gsw_geo_strf_Cunningham.m +++ b/Toolbox/gsw_geo_strf_Cunningham.m @@ -13,8 +13,7 @@ % difference between the horizontal velocity at the pressure concerned, % p, and the horizontal velocity on the pressure surface, p_ref. This % function calculates specific volume anomaly using the computationally -% efficient 48-term expression for specific volume of McDougall et al. -% (2013). +% efficient 48-term expression for specific volume of IOC et al. (2010). % % Note that p_ref, is the reference pressure to which the streamfunction % is referenced. When p_ref is zero, "gsw_geo_strf_Cunningham" returns @@ -24,7 +23,7 @@ % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -48,7 +47,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % Cunningham, S.A., 2000: Circulation and volume flux of the North @@ -61,11 +60,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See section 3.29 of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== @@ -75,7 +69,7 @@ %-------------------------------------------------------------------------- if ~(nargin == 4) - error('gsw_geo_strf_Cunningham: Requires four inputs') + error('gsw_geo_strf_Cunningham: Requires four inputs') end %if unique_p_ref = unique(p_ref); diff --git a/Toolbox/gsw_geo_strf_Montgomery.m b/Toolbox/gsw_geo_strf_Montgomery.m index f7ee54f..9b52847 100644 --- a/Toolbox/gsw_geo_strf_Montgomery.m +++ b/Toolbox/gsw_geo_strf_Montgomery.m @@ -17,7 +17,7 @@ % for the specific volume anomaly are SA = 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. (2013). +% IOC et al. (2010). % % Note that p_ref, is the reference pressure to which the streamfunction % is referenced. When p_ref is zero, "gsw_geo_strf_Montgomery" returns @@ -27,7 +27,7 @@ % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -51,7 +51,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -60,11 +60,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See section 3.28 of this TEOS-10 Manual. % -% 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. -% % Montgomery, R. B., 1937: A suggested method for representing gradient % flow in isentropic surfaces. Bull. Amer. Meteor. Soc. 18, 210-212. % @@ -77,7 +72,7 @@ %-------------------------------------------------------------------------- if ~(nargin == 4) - error('gsw_geo_strf_Montgomery: Requires four inputs') + error('gsw_geo_strf_Montgomery: Requires four inputs') end %if unique_p_ref = unique(p_ref); diff --git a/Toolbox/gsw_geo_strf_dyn_height.m b/Toolbox/gsw_geo_strf_dyn_height.m index 21e1ca8..8b249b3 100644 --- a/Toolbox/gsw_geo_strf_dyn_height.m +++ b/Toolbox/gsw_geo_strf_dyn_height.m @@ -20,7 +20,7 @@ % 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). +% expression for specific volume of IOC et al. (2010). % % This function evaluates the pressure integral of specific volume using % SA and CT “interpolated” with respect to pressure using a scheme based @@ -32,7 +32,7 @@ % % 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). For dynamical oceanography we may +% described in 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 library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if @@ -60,7 +60,7 @@ % AUTHOR: % Paul Barker, Jeff Dunn and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -69,11 +69,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (3.7.3) and section 3.27 of this TEOS-10 Manual. % -% 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. -% % Reiniger, R. F. and C. K. Ross, 1968: A method of interpolation with % application to oceanographic data. Deep-Sea Res. 15, 185-193. % @@ -481,7 +476,9 @@ return; end -if nargin<3 | isempty(maxdis); maxdis = 1; end +if nargin<3 | isempty(maxdis); + maxdis = 1; +end if ndeps < 4 | maxdis == -1 sidx = (1:nlvl)'; @@ -588,9 +585,15 @@ yi = []; return; end -if size(x,1) == 1; x =x'; end -if size(y,1) == 1; y =y'; end -if size(xi,1) == 1; xi =xi'; end +if size(x,1) == 1; + x =x'; +end +if size(y,1) == 1; + y = y'; +end +if size(xi,1) == 1; + xi =xi'; +end tidx = (1:length(xi))'; yi = repmat(NaN,size(tidx)); if x(nobs)>x(1) diff --git a/Toolbox/gsw_geo_strf_dyn_height_pc.m b/Toolbox/gsw_geo_strf_dyn_height_pc.m index 5d29368..92c973a 100644 --- a/Toolbox/gsw_geo_strf_dyn_height_pc.m +++ b/Toolbox/gsw_geo_strf_dyn_height_pc.m @@ -24,11 +24,11 @@ % given at the mid-point pressures, p_mid, of each layer in which SA and % CT are vertically piecewice constant (pc). This function calculates % specific volume anomaly using the computationally-efficient 48-term -% expression for specific volume of McDougall et al. (2013). +% expression for specific volume of IOC et al. (2010). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -51,7 +51,7 @@ % AUTHOR: % Trevor McDougall and Claire Roberts-Thomson [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -60,11 +60,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqns. (3.32.2) and (A.30.6) of this TEOS-10 Manual. % -% 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. diff --git a/Toolbox/gsw_geo_strf_isopycnal.m b/Toolbox/gsw_geo_strf_isopycnal.m index 9c25872..7cbdb84 100644 --- a/Toolbox/gsw_geo_strf_isopycnal.m +++ b/Toolbox/gsw_geo_strf_isopycnal.m @@ -21,7 +21,7 @@ % variable being Neutral_Density (gamma_n). This function calculates % specific volume anomaly using the computationally efficient 48-term % expression for specific volume anomaly in terms of SA, CT and p -% (McDougall et al., 2011). +% (IOC et al., 2010). % % The first three input arguments are a series of vertical profiles. The % fourth argument, p_ref, is the reference pressure to which the stream @@ -74,7 +74,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -89,11 +89,6 @@ % 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. diff --git a/Toolbox/gsw_geo_strf_isopycnal_pc.m b/Toolbox/gsw_geo_strf_isopycnal_pc.m index 6f6ccfc..6b79969 100644 --- a/Toolbox/gsw_geo_strf_isopycnal_pc.m +++ b/Toolbox/gsw_geo_strf_isopycnal_pc.m @@ -21,7 +21,7 @@ % 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. (2011). +% 48-term expression for specific volume of IOC et al. (2010). % % INPUT: % SA = Absolute Salinity [ g/kg ] @@ -52,7 +52,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -67,11 +67,6 @@ % 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. diff --git a/Toolbox/gsw_geostrophic_velocity.m b/Toolbox/gsw_geostrophic_velocity.m index d7eef4a..ba225b8 100644 --- a/Toolbox/gsw_geostrophic_velocity.m +++ b/Toolbox/gsw_geostrophic_velocity.m @@ -59,7 +59,7 @@ % AUTHOR: % Paul Barker, Trevor McDougall and Phil Morgan [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % Cunningham, S. A., 2000: Circulation and volume flux of the North @@ -78,11 +78,6 @@ % 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. diff --git a/Toolbox/gsw_grav.m b/Toolbox/gsw_grav.m index f609111..07fd193 100644 --- a/Toolbox/gsw_grav.m +++ b/Toolbox/gsw_grav.m @@ -27,7 +27,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_internal_energy.m b/Toolbox/gsw_internal_energy.m index 2093048..201dad7 100644 --- a/Toolbox/gsw_internal_energy.m +++ b/Toolbox/gsw_internal_energy.m @@ -10,11 +10,11 @@ % DESCRIPTION: % Calculates specific internal energy of seawater using the % computationally-efficient 48-term expression for density in terms of SA, -% CT and p (McDougall et al., 2013). +% CT and p (IOC et al., 2010). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -33,7 +33,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker. [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -41,11 +41,6 @@ % Intergovernmental Oceanographic Commission, Manuals and Guides No. 56, % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_internal_energy_CT.m b/Toolbox/gsw_internal_energy_CT.m index 34982b9..b804e7f 100644 --- a/Toolbox/gsw_internal_energy_CT.m +++ b/Toolbox/gsw_internal_energy_CT.m @@ -16,11 +16,11 @@ % DESCRIPTION: % Calculates specific internal energy of seawater using the % computationally-efficient 48-term expression for density in terms of SA, -% CT and p (McDougall et al., 2013). +% CT and p (IOC et al., 2010). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -39,7 +39,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker. [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -47,11 +47,6 @@ % Intergovernmental Oceanographic Commission, Manuals and Guides No. 56, % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_internal_energy_CT_exact.m b/Toolbox/gsw_internal_energy_CT_exact.m index b64a1b8..04d4a1e 100644 --- a/Toolbox/gsw_internal_energy_CT_exact.m +++ b/Toolbox/gsw_internal_energy_CT_exact.m @@ -25,7 +25,7 @@ % AUTHOR: % Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_ionic_strength_from_SA.m b/Toolbox/gsw_ionic_strength_from_SA.m index 03f91e7..2049636 100644 --- a/Toolbox/gsw_ionic_strength_from_SA.m +++ b/Toolbox/gsw_ionic_strength_from_SA.m @@ -18,7 +18,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_isopycnal_slope_ratio.m b/Toolbox/gsw_isopycnal_slope_ratio.m index 926d8d0..3ddb577 100644 --- a/Toolbox/gsw_isopycnal_slope_ratio.m +++ b/Toolbox/gsw_isopycnal_slope_ratio.m @@ -11,11 +11,11 @@ % DESCRIPTION: % Calculates the ratio of alpha/beta at pressure, p, to that at reference % pressure, p_ref. This function uses the computationally-efficient 48-term -% expression for density in terms of SA, CT & p (McDougall et al., 2011). +% expression for density in terms of SA, CT & p (IOC et al., 2010). % % 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). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -39,7 +39,7 @@ % AUTHOR: % Trevor McDougall, Paul Barker & David Jackett [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -48,11 +48,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org. % See Eqn. (3.17.2) of this TEOS-10 Manual. % -% 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. -% % This software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_isopycnal_vs_ntp_CT_ratio.m b/Toolbox/gsw_isopycnal_vs_ntp_CT_ratio.m index 16e2393..6f09866 100644 --- a/Toolbox/gsw_isopycnal_vs_ntp_CT_ratio.m +++ b/Toolbox/gsw_isopycnal_vs_ntp_CT_ratio.m @@ -19,11 +19,11 @@ % vertical. The reference sea pressure of the potential density surface % must have a constant value. This function uses the computationally % efficient 48-term expression for density in terms of SA, CT and p -% (McDougall et al., 2013). +% (IOC et al., 2010). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -51,7 +51,7 @@ % AUTHOR: % Trevor McDougall, Paul Barker & David Jackett [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -63,11 +63,6 @@ % McDougall, T. J., 1987: Neutral surfaces. Journal of Physical % Oceanography, 17, 1950-1964. See Eqn. (29) of this paper. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_kappa.m b/Toolbox/gsw_kappa.m new file mode 100644 index 0000000..fa5cdf0 --- /dev/null +++ b/Toolbox/gsw_kappa.m @@ -0,0 +1,201 @@ +function kappa = gsw_kappa(SA,CT,p) + +% gsw_kappa isentropic compressibility (48-term equation) +%========================================================================== +% +% USAGE: +% kappa = gsw_kappa(SA,CT,p) +% +% DESCRIPTION: +% Calculates the isentropic compressibility of seawater. This function +% has inputs of Absolute Salinity and Conservative Temperature. This +% function uses the computationally-efficient 48-term expression for +% density in terms of SA, CT and p (IOC et al., 2010). +% +% 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 IOC et al. (2010). The GSW library function +% "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if +% some of one's data lies outside this "funnel". +% +% INPUT: +% SA = Absolute Salinity [ g/kg ] +% CT = Conservative Temperature (ITS-90) [ deg C ] +% p = sea pressure [ dbar ] +% ( i.e. absolute pressure - 10.1325 dbar ) +% +% SA & CT need to have the same dimensions. +% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & CT are MxN. +% +% OUTPUT: +% kappa = isentropic compressibility of seawater [ 1/Pa ] +% +% AUTHOR: +% Paul Barker and Trevor McDougall [ help@teos-10.org ] +% +% VERSION NUMBER: 3.03 (29th April, 2013) +% +% 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 Eqn. (2.17.1) of this TEOS-10 Manual. +% +% The software is available from http://www.TEOS-10.org +% +%========================================================================== + +%-------------------------------------------------------------------------- +% Check variables and resize if necessary +%-------------------------------------------------------------------------- + +if ~(nargin == 3) + error('gsw_kappa: Requires three inputs') +end %if + +[ms,ns] = size(SA); +[mt,nt] = size(CT); +[mp,np] = size(p); + +if (mt ~= ms | nt ~= ns) + error('gsw_kappa: SA and CT must have same dimensions') +end + +if (mp == 1) & (np == 1) % p scalar - fill to size of SA + p = p*ones(size(SA)); +elseif (ns == np) & (mp == 1) % p is row vector, + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (np == 1) % p is column vector, + p = p(:,ones(1,ns)); % copy across each row. +elseif (ns == mp) & (np == 1) % p is a transposed row vector, + p = p.'; % transposed then + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (ns == np) + % ok +else + error('gsw_kappa: Inputs array dimensions arguments do not agree') +end %if + +if ms == 1 + SA = SA.'; + CT = CT.'; + p = p.'; + transposed = 1; +else + transposed = 0; +end + +%-------------------------------------------------------------------------- +% Start of the calculation +%-------------------------------------------------------------------------- + +% This line ensures that SA is non-negative. +SA(SA < 0) = 0; + + +v01 = 9.998420897506056e+2; +v02 = 2.839940833161907; +v03 = -3.147759265588511e-2; +v04 = 1.181805545074306e-3; +v05 = -6.698001071123802; +v06 = -2.986498947203215e-2; +v07 = 2.327859407479162e-4; +v08 = -3.988822378968490e-2; +v09 = 5.095422573880500e-4; +v10 = -1.426984671633621e-5; +v11 = 1.645039373682922e-7; +v12 = -2.233269627352527e-2; +v13 = -3.436090079851880e-4; +v14 = 3.726050720345733e-6; +v15 = -1.806789763745328e-4; +v16 = 6.876837219536232e-7; +v17 = -3.087032500374211e-7; +v18 = -1.988366587925593e-8; +v19 = -1.061519070296458e-11; +v20 = 1.550932729220080e-10; + +v21 = 1.0; +v22 = 2.775927747785646e-3; +v23 = -2.349607444135925e-5; +v24 = 1.119513357486743e-6; +v25 = 6.743689325042773e-10; +v26 = -7.521448093615448e-3; +v27 = -2.764306979894411e-5; +v28 = 1.262937315098546e-7; +v29 = 9.527875081696435e-10; +v30 = -1.811147201949891e-11; +v31 = -3.303308871386421e-5; +v32 = 3.801564588876298e-7; +v33 = -7.672876869259043e-9; +v34 = -4.634182341116144e-11; +v35 = 2.681097235569143e-12; +v36 = 5.419326551148740e-6; +v37 = -2.742185394906099e-5; +v38 = -3.212746477974189e-7; +v39 = 3.191413910561627e-9; +v40 = -1.931012931541776e-12; +v41 = -1.105097577149576e-7; +v42 = 6.211426728363857e-10; +v43 = -1.119011592875110e-10; +v44 = -1.941660213148725e-11; +v45 = -1.864826425365600e-14; +v46 = 1.119522344879478e-14; +v47 = -1.200507748551599e-15; +v48 = 6.057902487546866e-17; + +c01 = -2.233269627352527e-2; +c02 = -3.436090079851880e-4; +c03 = 3.726050720345733e-6; +c04 = -1.806789763745328e-4; +c05 = 6.876837219536232e-7; +c06 = -6.174065000748422e-7; +c07 = -3.976733175851186e-8; +c08 = -2.123038140592916e-11; +c09 = 3.101865458440160e-10; + +c10 = -2.742185394906099e-5; +c11 = -3.212746477974189e-7; +c12 = 3.191413910561627e-9; +c13 = -1.931012931541776e-12; +c14 = -1.105097577149576e-7; +c15 = 6.211426728363857e-10; +c16 = -2.238023185750219e-10; +c17 = -3.883320426297450e-11; +c18 = -3.729652850731201e-14; +c19 = 2.239044689758956e-14; +c20 = -3.601523245654798e-15; +c21 = 1.817370746264060e-16; + +sqrtSA = sqrt(SA); + +v_hat_denominator = v01 + CT.*(v02 + CT.*(v03 + v04*CT)) ... + + SA.*(v05 + CT.*(v06 + v07*CT) ... + + sqrtSA.*(v08 + CT.*(v09 + CT.*(v10 + v11*CT)))) ... + + p.*(v12 + CT.*(v13 + v14*CT) + SA.*(v15 + v16*CT) ... + + p.*(v17 + CT.*(v18 + v19*CT) + v20*SA)); + +v_hat_numerator = v21 + CT.*(v22 + CT.*(v23 + CT.*(v24 + v25*CT))) ... + + SA.*(v26 + CT.*(v27 + CT.*(v28 + CT.*(v29 + v30*CT))) + v36*SA ... + + sqrtSA.*(v31 + CT.*(v32 + CT.*(v33 + CT.*(v34 + v35*CT))))) ... + + p.*(v37 + CT.*(v38 + CT.*(v39 + v40*CT)) ... + + SA.*(v41 + v42*CT) ... + + p.*(v43 + CT.*(v44 + v45*CT + v46*SA) ... + + p.*(v47 + v48*CT))); + +dvden_dp = c01 + CT.*(c02 + c03*CT) ... + + SA.*(c04 + c05*CT) ... + + p.*(c06 + CT.*(c07 + c08*CT) + c09*SA); + +dvnum_dp = c10 + CT.*(c11 + CT.*(c12 + c13*CT)) ... + + SA.*(c14 + c15*CT) ... + + p.*(c16 + CT.*(c17 + c18*CT + c19*SA) ... + + p.*(c20 + c21*CT)); + +kappa = 1e-4.*(dvden_dp./v_hat_denominator - dvnum_dp./v_hat_numerator); + +if transposed + kappa = kappa.'; +end + +end \ No newline at end of file diff --git a/Toolbox/gsw_kappa_CT.m b/Toolbox/gsw_kappa_CT.m new file mode 100644 index 0000000..0333fef --- /dev/null +++ b/Toolbox/gsw_kappa_CT.m @@ -0,0 +1,102 @@ +function kappa = gsw_kappa_CT(SA,CT,p) + +% gsw_kappa isentropic compressibility (48-term equation) +%========================================================================== +% +% USAGE: +% kappa = gsw_kappa(SA,CT,p) +% +% DESCRIPTION: +% Calculates the isentropic compressibility of seawater. This function +% has inputs of Absolute Salinity and Conservative Temperature. This +% function uses the computationally-efficient 48-term expression for +% density in terms of SA, CT and p (IOC et al., 2010). +% +% 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 IOC et al. (2010). The GSW library function +% "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if +% some of one's data lies outside this "funnel". +% +% INPUT: +% SA = Absolute Salinity [ g/kg ] +% CT = Conservative Temperature (ITS-90) [ deg C ] +% p = sea pressure [ dbar ] +% ( i.e. absolute pressure - 10.1325 dbar ) +% +% SA & CT need to have the same dimensions. +% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & CT are MxN. +% +% OUTPUT: +% kappa = isentropic compressibility of seawater [ 1/Pa ] +% +% AUTHOR: +% Paul Barker and Trevor McDougall [ help@teos-10.org ] +% +% VERSION NUMBER: 3.03 (26th Febuary, 2013) +% +% 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 Eqn. (2.17.1) of this TEOS-10 Manual. +% +% The software is available from http://www.TEOS-10.org +% +%========================================================================== + +%-------------------------------------------------------------------------- +% Check variables and resize if necessary +%-------------------------------------------------------------------------- + +if ~(nargin == 3) + error('gsw_kappa: Requires three inputs') +end %if + +[ms,ns] = size(SA); +[mt,nt] = size(CT); +[mp,np] = size(p); + +if (mt ~= ms | nt ~= ns) + error('gsw_kappa: SA and CT must have same dimensions') +end + +if (mp == 1) & (np == 1) % p scalar - fill to size of SA + p = p*ones(size(SA)); +elseif (ns == np) & (mp == 1) % p is row vector, + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (np == 1) % p is column vector, + p = p(:,ones(1,ns)); % copy across each row. +elseif (ns == mp) & (np == 1) % p is a transposed row vector, + p = p.'; % transposed then + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (ns == np) + % ok +else + error('gsw_kappa: Inputs array dimensions arguments do not agree') +end %if + +if ms == 1 + SA = SA.'; + CT = CT.'; + p = p.'; + transposed = 1; +else + transposed = 0; +end + +%-------------------------------------------------------------------------- +% Start of the calculation +%-------------------------------------------------------------------------- + +% This line ensures that SA is non-negative. +SA(SA < 0) = 0; + +kappa = gsw_kappa(SA,CT,p); + +if transposed + kappa = kappa.'; +end + +end \ No newline at end of file diff --git a/Toolbox/gsw_kappa_CT_exact.m b/Toolbox/gsw_kappa_CT_exact.m new file mode 100644 index 0000000..8f6508c --- /dev/null +++ b/Toolbox/gsw_kappa_CT_exact.m @@ -0,0 +1,102 @@ +function kappa_CT_exact = gsw_kappa_CT_exact(SA,CT,p) + +% gsw_kappa_CT_exact isentropic compressibility +%========================================================================== +% +% USAGE: +% kappa_CT_exact = gsw_kappa_CT_exact(SA,CT,p) +% +% DESCRIPTION: +% Calculates the isentropic compressibility of seawater. +% +% INPUT: +% SA = Absolute Salinity [ g/kg ] +% CT = Conservative Temperature (ITS-90) [ deg C ] +% p = sea pressure [ dbar ] +% ( i.e. absolute pressure - 10.1325 dbar ) +% +% SA & CT need to have the same dimensions. +% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & CT are MxN. +% +% OUTPUT: +% kappa_CT_exact = isentropic compressibility [ 1/Pa ] +% Note. The output units are 1/Pa not 1/dbar. +% +% AUTHOR: +% Trevor McDougall and Paul Barker [ help@teos-10.org ] +% +% VERSION NUMBER: 3.03 (28th Febuary, 2013) +% +% 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 Eqns. (2.16.1) and the row for kappa in Table P.1 of appendix P +% of this TEOS-10 Manual. +% +% The software is available from http://www.TEOS-10.org +% +%========================================================================== + +%-------------------------------------------------------------------------- +% Check variables and resize if necessary +%-------------------------------------------------------------------------- + +if ~(nargin == 3) + error('gsw_kappa_CT_exact: Requires three inputs') +end %if + +[ms,ns] = size(SA); +[mt,nt] = size(CT); +[mp,np] = size(p); + +if (mt ~= ms | nt ~= ns) + error('gsw_kappa_CT_exact: SA and CT must have same dimensions') +end + +if (mp == 1) & (np == 1) % p scalar - fill to size of SA + p = p*ones(size(SA)); +elseif (ns == np) & (mp == 1) % p is row vector, + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (np == 1) % p is column vector, + p = p(:,ones(1,ns)); % copy across each row. +elseif (ns == mp) & (np == 1) % p is a transposed row vector, + p = p.'; % transposed then + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (ns == np) + % ok +else + error('gsw_kappa_CT_exact: Inputs array dimensions arguments do not agree') +end %if + +if ms == 1 + SA = SA.'; + CT = CT.'; + p = p.'; + transposed = 1; +else + transposed = 0; +end + +%-------------------------------------------------------------------------- +% Start of the calculation +%-------------------------------------------------------------------------- + +n0 = 0; +n1 = 1; +n2 = 2; + +t = gsw_t_from_CT(SA,CT,p); + +g_tt = gsw_gibbs(n0,n2,n0,SA,t,p); +g_tp = gsw_gibbs(n0,n1,n1,SA,t,p); + +kappa_CT_exact = (g_tp.*g_tp - g_tt.*gsw_gibbs(n0,n0,n2,SA,t,p))./ ... + (gsw_gibbs(n0,n0,n1,SA,t,p).*g_tt); + +if transposed + kappa_CT_exact = kappa_CT_exact.'; +end + +end \ No newline at end of file diff --git a/Toolbox/gsw_latentheat_evap_CT.m b/Toolbox/gsw_latentheat_evap_CT.m index f66138a..8937c07 100644 --- a/Toolbox/gsw_latentheat_evap_CT.m +++ b/Toolbox/gsw_latentheat_evap_CT.m @@ -25,7 +25,7 @@ % AUTHOR: % Paul Barker, Trevor McDougall & Rainer Feistel [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_latentheat_evap_t.m b/Toolbox/gsw_latentheat_evap_t.m index a6d8ac3..fc44444 100644 --- a/Toolbox/gsw_latentheat_evap_t.m +++ b/Toolbox/gsw_latentheat_evap_t.m @@ -24,7 +24,7 @@ % AUTHOR: % Paul Barker, Trevor McDougall & Rainer Feistel [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_latentheat_melting.m b/Toolbox/gsw_latentheat_melting.m index dd037ab..bd0e8a1 100644 --- a/Toolbox/gsw_latentheat_melting.m +++ b/Toolbox/gsw_latentheat_melting.m @@ -25,7 +25,7 @@ % AUTHOR: % Paul Barker, Trevor McDougall & Rainer Feistel [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_molality_from_SA.m b/Toolbox/gsw_molality_from_SA.m index 962375c..d94d644 100644 --- a/Toolbox/gsw_molality_from_SA.m +++ b/Toolbox/gsw_molality_from_SA.m @@ -18,7 +18,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_ntp_pt_vs_CT_ratio.m b/Toolbox/gsw_ntp_pt_vs_CT_ratio.m index b2fea36..35d0236 100644 --- a/Toolbox/gsw_ntp_pt_vs_CT_ratio.m +++ b/Toolbox/gsw_ntp_pt_vs_CT_ratio.m @@ -15,11 +15,11 @@ % neutral tangent plane. The potential temperature is the regular one % which has a reference sea pressure of 0 dbar. Part of the calculation % uses the computationally-efficient 48-term expression for density in -% terms of SA, CT and p (McDougall et al., 2013). +% terms of SA, CT and p (IOC et al., 2010). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -41,7 +41,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -50,11 +50,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org. % See Eqn. (A.14.5) of this TEOS-10 Manual. % -% 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. -% % This software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_p_from_Abs_Pressure.m b/Toolbox/gsw_p_from_Abs_Pressure.m index b0b2169..436b60e 100644 --- a/Toolbox/gsw_p_from_Abs_Pressure.m +++ b/Toolbox/gsw_p_from_Abs_Pressure.m @@ -19,7 +19,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_p_from_z.m b/Toolbox/gsw_p_from_z.m index 6441a44..dd2ac7f 100644 --- a/Toolbox/gsw_p_from_z.m +++ b/Toolbox/gsw_p_from_z.m @@ -1,23 +1,25 @@ -function p = gsw_p_from_z(z,lat,geo_strf_dyn_height) +function p = gsw_p_from_z(z,lat,geo_strf_dyn_height,sea_surface_geopotental) % gsw_p_from_z pressure from height %========================================================================== % % USAGE: -% p = gsw_p_from_z(z,lat,{geo_strf_dyn_height}) +% p = gsw_p_from_z(z,lat,{geo_strf_dyn_height},{sea_surface_geopotental}) % % DESCRIPTION: % Calculates sea pressure from height using computationally-efficient -% 48-term expression for density, in terms of SA, CT and p (McDougall et -% al., 2011). Dynamic height anomaly, geo_strf_dyn_height, if provided, -% must be computed with its p_ref = 0 (the surface). +% 48-term expression for density, in terms of SA, CT and p (IOC et +% al., 2010). Dynamic height anomaly, geo_strf_dyn_height, if provided, +% must be computed with its p_ref = 0 (the surface). Also if provided, +% sea_surface_geopotental is the geopotential at zero sea pressure. This +% function solves Eqn.(3.32.3) of IOC et al. (2010) iteratively for p. % % Note. Height (z) is NEGATIVE in the ocean. Depth is -z. % Depth is not used in the GSW computer software library. % % 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). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -32,10 +34,11 @@ % geo_strf_dyn_height = dynamic height anomaly [ m^2/s^2 ] % Note that the reference pressure, p_ref, of geo_strf_dyn_height must % be zero (0) dbar. +% sea_surface_geopotental = geopotential at zero sea pressure. [ m ] % % lat may have dimensions 1x1 or Mx1 or 1xN or MxN, where z is MxN. -% geo_strf_dyn_height, if provided, must have dimensions MxN, which is -% the same as z. +% geo_strf_dyn_height and geo_strf_dyn_height, if provided, must have +% dimensions MxN, which are the same as z. % % OUTPUT: % p = sea pressure [ dbar ] @@ -45,7 +48,7 @@ % Trevor McDougall, Claire Roberts-Thomson and Paul Barker. % [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (19th July, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -53,14 +56,10 @@ % Intergovernmental Oceanographic Commission, Manuals and Guides No. 56, % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % -% 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 S.J. Wotherspoon, 2012: A simple modification of % Newton’s method to achieve convergence of order "1 + sqrt(2)". -% Submitted to Applied Mathematics and Computation. +% Submitted to Applied Mathematics and Computation. +% % Moritz (2000) Goedetic reference system 1980. J. Geodesy, 74, 128-133. % % Saunders, P. M., 1981: Practical conversion of pressure to depth. @@ -74,21 +73,33 @@ % Check variables and resize if necessary %-------------------------------------------------------------------------- -if ~(nargin == 2 | nargin == 3) - error('gsw_p_from_z: Requires two or three inputs') +if ~(nargin == 2 | nargin == 3 | nargin == 4) + error('gsw_p_from_z: Requires two, three or four inputs') end %if +if any(z > 5) + error('gsw_p_from_z: The input z should be negative and values must be less than 5 m.') +end + if ~exist('geo_strf_dyn_height','var') geo_strf_dyn_height = zeros(size(z)); end +if ~exist('sea_surface_geopotental','var') + sea_surface_geopotental = zeros(size(z)); +end + [mz,nz] = size(z); [ml,nl] = size(lat); [mdh,ndh] = size(geo_strf_dyn_height); +[msg,nsg] = size(sea_surface_geopotental); if (mz ~= mdh) | (nz ~= ndh) error('gsw_p_from_z: height & dynamic height anomaly need to have the same dimensions') end +if (mdh ~= msg) | (ndh ~= nsg) + error('gsw_p_from_z: dynamic height anomaly & the geopotential at zero sea pressure need to have the same dimensions') +end if (ml == 1) & (nl == 1) % lat is a scalar - fill to size of z lat = lat*ones(size(z)); @@ -109,6 +120,7 @@ z = z.'; lat = lat.'; geo_strf_dyn_height = geo_strf_dyn_height.'; + sea_surface_geopotental = sea_surface_geopotental.'; transposed = 1; else transposed = 0; @@ -119,11 +131,14 @@ %-------------------------------------------------------------------------- db2Pa = 1e4; -gamma = 2.26e-7; -DEG2RAD = pi/180; -X = sin(lat*DEG2RAD); -sin2 = X.*X; -gs = 9.780327*(1.0 + (5.2792e-3 + (2.32e-5*sin2)).*sin2); +gamma = 2.26e-7; % If the graviational acceleration were to be regarded as + % being depth-independent, which is often the case in + % ocean models, then gamma would be set to be zero here, + % and the code below works perfectly well. +deg2rad = pi/180; +X = sin(lat*deg2rad); +sin2 = X.*X; +gs = 9.780327*(1.0 + (5.2792e-3 + (2.32e-5*sin2)).*sin2); % get the first estimate of p from Saunders (1981) c1 = 5.25e-3*sin2 + 5.92e-3; @@ -132,7 +147,8 @@ df_dp = db2Pa * gsw_specvol_SSO_0_p(p); % initial value of the derivative of f -f = gsw_enthalpy_SSO_0_p(p) + gs.*(z - 0.5*gamma*(z.*z)) - geo_strf_dyn_height; +f = gsw_enthalpy_SSO_0_p(p) + gs.*(z - 0.5*gamma*(z.*z)) ... + - (geo_strf_dyn_height + sea_surface_geopotental); p_old = p; p = p_old - f./df_dp; p_mid = 0.5*(p + p_old); diff --git a/Toolbox/gsw_pot_enthalpy_from_pt.m b/Toolbox/gsw_pot_enthalpy_from_pt.m index f242cdf..8c1f844 100644 --- a/Toolbox/gsw_pot_enthalpy_from_pt.m +++ b/Toolbox/gsw_pot_enthalpy_from_pt.m @@ -22,7 +22,7 @@ % AUTHOR: % David Jackett, Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % This function is unchanged from version 2.0 (24th September, 2010). % % REFERENCES: diff --git a/Toolbox/gsw_pt0_from_t.m b/Toolbox/gsw_pt0_from_t.m index 004f608..cad7bcb 100644 --- a/Toolbox/gsw_pt0_from_t.m +++ b/Toolbox/gsw_pt0_from_t.m @@ -33,8 +33,7 @@ % Trevor McDougall, David Jackett, Claire Roberts-Thomson and Paul Barker. % [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) -% This function is unchanged from version 2.0 (24th September, 2010). +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -43,11 +42,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See section 3.1 of this TEOS-10 Manual. % -% 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 S.J. Wotherspoon, 2012: A simple modification of % Newton’s method to achieve convergence of order "1 + sqrt(2)". % Submitted to Applied Mathematics and Computation. diff --git a/Toolbox/gsw_pt_first_derivatives.m b/Toolbox/gsw_pt_first_derivatives.m index 305301e..2d6147a 100644 --- a/Toolbox/gsw_pt_first_derivatives.m +++ b/Toolbox/gsw_pt_first_derivatives.m @@ -31,8 +31,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) -% This function is unchanged from version 2.0 (24th September, 2010). +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -41,11 +40,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org. % See Eqns. (A.12.6), (A.12.3), (P.6) and (P.8) of this TEOS-10 Manual. % -% 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. -% % This software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_pt_from_CT.m b/Toolbox/gsw_pt_from_CT.m index 28160be..b4409e1 100644 --- a/Toolbox/gsw_pt_from_CT.m +++ b/Toolbox/gsw_pt_from_CT.m @@ -27,8 +27,7 @@ % Trevor McDougall, David Jackett, Claire Roberts-Thomson and Paul Barker. % [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) -% This function is unchanged from version 2.0 (24th September, 2010). +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -37,11 +36,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See sections 3.1 and 3.3 of this TEOS-10 Manual. % -% 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 S.J. Wotherspoon, 2012: A simple modification of % Newton’s method to achieve convergence of order "1 + sqrt(2)". % Submitted to Applied Mathematics and Computation. diff --git a/Toolbox/gsw_pt_from_CT_plus.m b/Toolbox/gsw_pt_from_CT_plus.m deleted file mode 100644 index 1880085..0000000 --- a/Toolbox/gsw_pt_from_CT_plus.m +++ /dev/null @@ -1,127 +0,0 @@ -function pt = gsw_pt_from_CT_plus(SA,CT_plus,r) - -% gsw_pt_from_CT_plus potential temperature from CT_plus -%========================================================================== -% -% USAGE: -% pt = gsw_pt_from_CT_plus(SA,CT_plus,r) -% -% DESCRIPTION: -% Calculates potential temperature (with a reference sea pressure of -% zero dbar) from CT_plus. CT_plus is the version of Conservative -% Temperature which has an amplified difference from potential -% temperature (pt). That is, CT_plus obeys -% -% (pt - CT_plus) = r*(pt - CT) -% -% This function uses NNN iterations through a modified Newton-Raphson -% (N-R) iterative solution proceedure, starting from a first guess as -% described in the Notes (paper?) -% -% INPUT: -% SA = Absolute Salinity [ g/kg ] -% CT = Conservative Temperature (ITS-90) [ deg C ] -% r = amplification factor [ unitless ] -% -% SA & CT need to have the same dimensions and r should be a solitary -% number. -% -% OUTPUT: -% pt = potential temperature referenced to a sea pressure -% of zero dbar (ITS-90) [ deg C ] -% -% AUTHOR: -% Trevor McDougall and Paul Barker. -% [ help@teos-10.org ] -% -% VERSION NUMBER: 3.02 (20th December, 2012) -% It is not envisaged that this function become part of GSW. -% -% 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 sections 3.1 and 3.3 of this TEOS-10 Manual. -% -% McDougall T.J., P.M. Barker and R. Feistel, 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 S.J. Wotherspoon, 2012: A simple modification of -% Newton’s method to achieve convergence of order "1 + sqrt(2)". -% Submitted to Applied Mathematics and Computation. -% -% The software is available from http://www.TEOS-10.org -% -%========================================================================== - -%-------------------------------------------------------------------------- -% Check variables and resize if necessary -%-------------------------------------------------------------------------- - -if ~(nargin == 3) - error('gsw_pt_from_CT_plus: Requires three inputs') -end - -[ms,ns] = size(SA); -[mt,nt] = size(CT_plus); - -if (mt ~= ms | nt ~= ns) - error('gsw_pt_from_CT: SA and CT must have same dimensions') -end - -if ~isscalar(r) - error('gsw_pt_from_CT: r must be a scalar') -end - -if ms == 1 - SA = SA.'; - CT_plus = CT_plus.'; - transposed = 1; -else - transposed = 0; -end - -%-------------------------------------------------------------------------- -% Start of the calculation -%-------------------------------------------------------------------------- - -% This line ensures that SA is non-negative. -SA(SA < 0) = 0; - -cp0 = 3991.86795711963; % from Eqn. (3.3.3) of IOC et al. (2010). -SSO = 35.16504; % this is the Reference Salinity of the Standard Ocean -a = 0.05*(1 - SA/SSO); - -pt = (1 - a).*CT_plus./(1 + (r - 1).*a); % the starting estimate of pt - -df_dpt = 1 ; % the starting estimate of df_dpt - -% start the 2 iterations through the modified Newton-Rapshon iterative -% method (McDougall and Wotherspoon, 2012). - -for Number_of_iterations = 1:2 - pt_old = pt; - f = pt - CT_plus -r*(pt - gsw_CT_from_pt(SA,pt)); - pt = pt_old - f./df_dpt; % 1/2-way through a modified N-R loop - ptm = 0.5*(pt + pt_old); - -% This routine calls gibbs_pt0_pt0(SA,pt0) to get the second derivative -% of the Gibbs function with respect to temperature at zero sea pressure. - - dCT_pt = -(ptm + 273.15).*gsw_gibbs_pt0_pt0(SA,ptm)./cp0; - df_dpt = 1 - r*(1 - dCT_pt); - pt = pt_old - f./df_dpt; % end of a full modified N-R iteration -end - -% After 2 iterations this calulation is at machine precission for this -% calculation which is 2 x 10 ^-13 (for r = 10). - -if transposed - pt = pt.'; -end - - -end diff --git a/Toolbox/gsw_pt_from_CT_plus2.m b/Toolbox/gsw_pt_from_CT_plus2.m deleted file mode 100644 index 235f19c..0000000 --- a/Toolbox/gsw_pt_from_CT_plus2.m +++ /dev/null @@ -1,126 +0,0 @@ -function pt = gsw_pt_from_CT_plus(SA,CT_plus,r) - -% gsw_pt_from_CT_plus potential temperature from CT_plus -%========================================================================== -% -% USAGE: -% pt = gsw_pt_from_CT_plus(SA,CT_plus,r) -% -% DESCRIPTION: -% Calculates potential temperature (with a reference sea pressure of -% zero dbar) from CT_plus. CT_plus is the version of Conservative -% Temperature which has an amplified difference from potential -% temperature (pt). That is, CT_plus obeys -% -% (pt - CT_plus) = r*(pt - CT) -% -% This function uses NNN iterations through a modified Newton-Raphson -% (N-R) iterative solution proceedure, starting from a first guess as -% described in the Notes (paper?) -% -% INPUT: -% SA = Absolute Salinity [ g/kg ] -% CT = Conservative Temperature (ITS-90) [ deg C ] -% r = amplification factor [ unitless ] -% -% SA & CT need to have the same dimensions and r should be a solitary -% number. -% -% OUTPUT: -% pt = potential temperature referenced to a sea pressure -% of zero dbar (ITS-90) [ deg C ] -% -% AUTHOR: -% Trevor McDougall and Paul Barker. -% [ help@teos-10.org ] -% -% VERSION NUMBER: 3.02 (20th December, 2012) -% It is not envisaged that this function become part of GSW. -% -% 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 sections 3.1 and 3.3 of this TEOS-10 Manual. -% -% McDougall T.J., P.M. Barker and R. Feistel, 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 S.J. Wotherspoon, 2012: A simple modification of -% Newton’s method to achieve convergence of order "1 + sqrt(2)". -% Submitted to Applied Mathematics and Computation. -% -% The software is available from http://www.TEOS-10.org -% -%========================================================================== - -%-------------------------------------------------------------------------- -% Check variables and resize if necessary -%-------------------------------------------------------------------------- - -if ~(nargin == 3) - error('gsw_pt_from_CT_plus: Requires three inputs') -end - -[ms,ns] = size(SA); -[mt,nt] = size(CT_plus); - -if (mt ~= ms | nt ~= ns) - error('gsw_pt_from_CT: SA and CT must have same dimensions') -end - -if ~isscalar(r) - error('gsw_pt_from_CT: r must be a scalar') -end - -if ms == 1 - SA = SA.'; - CT_plus = CT_plus.'; - transposed = 1; -else - transposed = 0; -end - -%-------------------------------------------------------------------------- -% Start of the calculation -%-------------------------------------------------------------------------- - -% This line ensures that SA is non-negative. -SA(SA < 0) = 0; - -cp0 = 3991.86795711963; % from Eqn. (3.3.3) of IOC et al. (2010). -SSO = 35.16504; % this is the Reference Salinity of the Standard Ocean -a = 0.05*(1 - SA/SSO); - -pt = (1 - a).*CT_plus./(1 + (r - 1).*a); % the starting estimate of pt - -df_dpt = 1 ; % the starting estimate of df_dpt - -% start the NNN iterations through the modified Newton-Rapshon iterative -% method (McDougall and Wotherspoon, 2012). - -for Number_of_iterations = 1:2 -pt_old = pt; -f = pt - CT_plus -r*(pt - gsw_CT_from_pt(SA,pt)); -pt = pt_old - f./df_dpt; % 1/2-way through the modified N-R loop -ptm = 0.5*(pt + pt_old); - -% This routine calls gibbs_pt0_pt0(SA,pt0) to get the second derivative -% of the Gibbs function with respect to temperature at zero sea pressure. - -dCT_pt = -(ptm + 273.15).*gsw_gibbs_pt0_pt0(SA,ptm)./cp0; -df_dpt = 1 - r*(1 - dCT_pt); -pt = pt_old - f./df_dpt; % end of 1st full modified N-R iteration - - -end - -if transposed - pt = pt.'; -end - - -end diff --git a/Toolbox/gsw_pt_from_entropy.m b/Toolbox/gsw_pt_from_entropy.m index 772ce8d..1fa8971 100644 --- a/Toolbox/gsw_pt_from_entropy.m +++ b/Toolbox/gsw_pt_from_entropy.m @@ -26,7 +26,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_pt_from_t.m b/Toolbox/gsw_pt_from_t.m index 2283025..adcc541 100644 --- a/Toolbox/gsw_pt_from_t.m +++ b/Toolbox/gsw_pt_from_t.m @@ -36,8 +36,7 @@ % Trevor McDougall, David Jackett, Claire Roberts-Thomson and Paul Barker. % [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) -% This function is unchanged from version 2.0 (24th September, 2010). +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -46,11 +45,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See section 3.1 of this TEOS-10 Manual. % -% 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 S.J. Wotherspoon, 2012: A simple modification of % Newton’s method to achieve convergence of order "1 + sqrt(2)". % Submitted to Applied Mathematics and Computation. diff --git a/Toolbox/gsw_pt_second_derivatives.m b/Toolbox/gsw_pt_second_derivatives.m index f8f54f6..f6fcf2e 100644 --- a/Toolbox/gsw_pt_second_derivatives.m +++ b/Toolbox/gsw_pt_second_derivatives.m @@ -40,8 +40,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker. [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) -% This function is unchanged from version 2.0 (24th September, 2010). +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -50,11 +49,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org. % See Eqns. (A.12.9) and (A.12.10) of this TEOS-10 Manual. % -% 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. -% % This software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_rho.m b/Toolbox/gsw_rho.m index 63fb835..816adb2 100644 --- a/Toolbox/gsw_rho.m +++ b/Toolbox/gsw_rho.m @@ -9,7 +9,7 @@ % DESCRIPTION: % Calculates in-situ density from Absolute Salinity and Conservative % Temperature, using the computationally-efficient 48-term expression for -% density in terms of SA, CT and p (McDougall et al., 2013). +% density in terms of SA, CT and p (IOC et al., 2010). % % Note that potential density with respect to reference pressure, pr, is % obtained by calling this function with the pressure argument being pr @@ -17,7 +17,7 @@ % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -36,7 +36,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -45,11 +45,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See appendix A.20 and appendix K of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_rho_CT.m b/Toolbox/gsw_rho_CT.m index fd971f1..13124cc 100644 --- a/Toolbox/gsw_rho_CT.m +++ b/Toolbox/gsw_rho_CT.m @@ -15,7 +15,7 @@ % DESCRIPTION: % Calculates in-situ density from Absolute Salinity and Conservative % Temperature, using the computationally-efficient 48-term expression for -% density in terms of SA, CT and p (McDougall et al., 2011). +% density in terms of SA, CT and p (IOC et al., 2010). % % Note that potential density with respect to reference pressure, p_ref, is % obtained by calling this function with the pressure argument being p_ref @@ -23,7 +23,7 @@ % % 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). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -42,7 +42,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -51,11 +51,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See appendix A.20 and appendix K of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_rho_CT_exact.m b/Toolbox/gsw_rho_CT_exact.m index 3a9a503..705f7cc 100644 --- a/Toolbox/gsw_rho_CT_exact.m +++ b/Toolbox/gsw_rho_CT_exact.m @@ -15,9 +15,9 @@ % (i.e. "gsw_rho_CT_exact(SA,CT,p_ref)"). % % Note that this function uses the full Gibbs function. There is an -% alternative to calling this function, namely gsw_rho_CT(SA,CT,p), +% alternative to calling this function, namely gsw_rho(SA,CT,p), % which uses the computationally efficient 48-term expression for density -% in terms of SA, CT and p (McDougall et al., 2013). +% in terms of SA, CT and p (IOC et al., 2010). % % INPUT: % SA = Absolute Salinity [ g/kg ] @@ -34,7 +34,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -43,11 +43,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (2.8.2) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_rho_alpha_beta.m b/Toolbox/gsw_rho_alpha_beta.m index 781823d..b287440 100644 --- a/Toolbox/gsw_rho_alpha_beta.m +++ b/Toolbox/gsw_rho_alpha_beta.m @@ -12,7 +12,7 @@ % and the appropriate saline contraction coefficient of seawater from % Absolute Salinity and Conservative Temperature. This function uses the % computationally-efficient 48-term expression for density in terms of -% SA, CT and p (McDougall et al., 2013). +% SA, CT and p (IOC et al., 2010). % % Note that potential density (pot_rho) with respect to reference pressure % p_ref is obtained by calling this function with the pressure argument @@ -20,7 +20,7 @@ % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -43,7 +43,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -52,11 +52,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See appendix A.20 and appendix K of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== @@ -68,6 +63,7 @@ if ~(nargin == 3) error('gsw_rho_alpha_beta: Requires three inputs') end %if + if ~(nargout == 3 | nargout == 4) error('gsw_rho_alpha_beta: Requires three outputs') end %if diff --git a/Toolbox/gsw_rho_alpha_beta_CT.m b/Toolbox/gsw_rho_alpha_beta_CT.m index af4ec22..64311c9 100644 --- a/Toolbox/gsw_rho_alpha_beta_CT.m +++ b/Toolbox/gsw_rho_alpha_beta_CT.m @@ -19,7 +19,7 @@ % and the appropriate saline contraction coefficient of seawater from % Absolute Salinity and Conservative Temperature. This function uses the % computationally-efficient 48-term expression for density in terms of -% SA, CT and p (McDougall et al., 2013). +% SA, CT and p (IOC et al., 2010). % % Note that potential density (pot_rho) with respect to reference pressure % p_ref is obtained by calling this function with the pressure argument @@ -27,7 +27,7 @@ % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -50,7 +50,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -59,11 +59,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See appendix A.20 and appendix K of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== @@ -75,6 +70,7 @@ if ~(nargin == 3) error('gsw_rho_alpha_beta_CT: Requires three inputs') end %if + if ~(nargout == 3 | nargout == 4) error('gsw_rho_alpha_beta_CT: Requires three outputs') end %if diff --git a/Toolbox/gsw_rho_alpha_beta_CT_exact.m b/Toolbox/gsw_rho_alpha_beta_CT_exact.m index 5c89a5d..77a36c7 100644 --- a/Toolbox/gsw_rho_alpha_beta_CT_exact.m +++ b/Toolbox/gsw_rho_alpha_beta_CT_exact.m @@ -15,8 +15,8 @@ % Note that this function uses the full Gibbs function. There is an % alternative to calling this function, namely % gsw_rho_alpha_beta(SA,CT,p), which uses the computationally-efficient -% 48-term expression for density in terms of SA, CT and p (McDougall et -% al., 2013). +% 48-term expression for density in terms of SA, CT and p (IOC et +% al., 2010). % % INPUT: % SA = Absolute Salinity [ g/kg ] @@ -37,7 +37,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (15th November, 2012) +% VERSION NUMBER: 3.03 (16th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -46,11 +46,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See sections (2.8), (2.18) and (2.19) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== @@ -62,6 +57,7 @@ if ~(nargin == 3) error('gsw_rho_alpha_beta_CT_exact: Requires three inputs') end %if + if ~(nargout == 3) error('gsw_rho_alpha_beta_CT_exact: Requires three outputs') end %if diff --git a/Toolbox/gsw_rho_first_derivatives.m b/Toolbox/gsw_rho_first_derivatives.m new file mode 100644 index 0000000..29a870f --- /dev/null +++ b/Toolbox/gsw_rho_first_derivatives.m @@ -0,0 +1,299 @@ +function [drho_dSA, drho_dCT, drho_dP] = gsw_rho_first_derivatives(SA,CT,p) + +% gsw_rho_first_derivatives SA, CT and p partial derivatives +% of density (48-term equation) +%========================================================================== +% +% USAGE: +% [drho_dSA, drho_dCT, drho_dP] = gsw_rho_first_derivatives(SA,CT,p) +% +% DESCRIPTION: +% Calculates the three (3) partial derivatives of in situ density with +% respect to Absolute Salinity, Conservative Temperature and pressure. +% Note that the pressure derivative is done with respect to pressure in +% Pa, not dbar. This function uses the computationally-efficient 48-term +% expression for density in terms of SA, CT and p. +% +% 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 IOC et al. (2010). The GSW library function +% "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if +% some of one's data lies outside this "funnel". +% +% INPUT: +% SA = Absolute Salinity [ g/kg ] +% CT = Conservative Temperature (ITS-90) [ deg C ] +% p = sea pressure [ dbar ] +% ( i.e. absolute pressure - 10.1325 dbar ) +% +% SA & CT need to have the same dimensions. +% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & CT are MxN. +% +% OUTPUT: +% drho_dSA = partial derivatives of density [ kg^2/(g m^3) ] +% with respect to Absolute Salinity +% drho_dCT = partial derivatives of density [ kg/(K m^3) ] +% with respect to Conservative Temperature +% drho_dP = partial derivatives of density [ kg/(Pa m^3) ] +% with respect to pressure in Pa +% +% AUTHOR: +% Paul Barker and Trevor McDougall [ help@teos-10.org ] +% +% VERSION NUMBER: 3.03 (29th April, 2013) +% +% 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.20 and appendix K of this TEOS-10 Manual. +% +% The software is available from http://www.TEOS-10.org +% +%========================================================================== + +%-------------------------------------------------------------------------- +% Check variables and resize if necessary +%-------------------------------------------------------------------------- + +if ~(nargin == 3) + error('gsw_rho_first_derivatives: Requires three inputs') +end %if +if ~(nargout == 3 | nargout == 4) + error('gsw_rho_first_derivatives: Requires three outputs') +end %if + +[ms,ns] = size(SA); +[mt,nt] = size(CT); +[mp,np] = size(p); + +if (mt ~= ms | nt ~= ns) + error('gsw_rho_first_derivatives: SA and CT must have same dimensions') +end + +if (mp == 1) & (np == 1) % p scalar - fill to size of SA + p = p*ones(size(SA)); +elseif (ns == np) & (mp == 1) % p is row vector, + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (np == 1) % p is column vector, + p = p(:,ones(1,ns)); % copy across each row. +elseif (ns == mp) & (np == 1) % p is a transposed row vector, + p = p.'; % transposed then + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (ns == np) + % ok +else + error('gsw_rho_first_derivatives: Inputs array dimensions arguments do not agree') +end %if + +if ms == 1 + SA = SA.'; + CT = CT.'; + p = p.'; + transposed = 1; +else + transposed = 0; +end + +%-------------------------------------------------------------------------- +% Start of the calculation +%-------------------------------------------------------------------------- + +% This line ensures that SA is non-negative. +SA(SA < 0) = 0; + +v01 = 9.998420897506056e+2; +v02 = 2.839940833161907; +v03 = -3.147759265588511e-2; +v04 = 1.181805545074306e-3; +v05 = -6.698001071123802; +v06 = -2.986498947203215e-2; +v07 = 2.327859407479162e-4; +v08 = -3.988822378968490e-2; +v09 = 5.095422573880500e-4; +v10 = -1.426984671633621e-5; +v11 = 1.645039373682922e-7; +v12 = -2.233269627352527e-2; +v13 = -3.436090079851880e-4; +v14 = 3.726050720345733e-6; +v15 = -1.806789763745328e-4; +v16 = 6.876837219536232e-7; +v17 = -3.087032500374211e-7; +v18 = -1.988366587925593e-8; +v19 = -1.061519070296458e-11; +v20 = 1.550932729220080e-10; +v21 = 1.0; +v22 = 2.775927747785646e-3; +v23 = -2.349607444135925e-5; +v24 = 1.119513357486743e-6; +v25 = 6.743689325042773e-10; +v26 = -7.521448093615448e-3; +v27 = -2.764306979894411e-5; +v28 = 1.262937315098546e-7; +v29 = 9.527875081696435e-10; +v30 = -1.811147201949891e-11; +v31 = -3.303308871386421e-5; +v32 = 3.801564588876298e-7; +v33 = -7.672876869259043e-9; +v34 = -4.634182341116144e-11; +v35 = 2.681097235569143e-12; +v36 = 5.419326551148740e-6; +v37 = -2.742185394906099e-5; +v38 = -3.212746477974189e-7; +v39 = 3.191413910561627e-9; +v40 = -1.931012931541776e-12; +v41 = -1.105097577149576e-7; +v42 = 6.211426728363857e-10; +v43 = -1.119011592875110e-10; +v44 = -1.941660213148725e-11; +v45 = -1.864826425365600e-14; +v46 = 1.119522344879478e-14; +v47 = -1.200507748551599e-15; +v48 = 6.057902487546866e-17; + +a01 = 2.839940833161907; +a02 = -6.295518531177023e-2; +a03 = 3.545416635222918e-3; +a04 = -2.986498947203215e-2; +a05 = 4.655718814958324e-4; +a06 = 5.095422573880500e-4; +a07 = -2.853969343267241e-5; +a08 = 4.935118121048767e-7; +a09 = -3.436090079851880e-4; +a10 = 7.452101440691467e-6; +a11 = 6.876837219536232e-7; +a12 = -1.988366587925593e-8; +a13 = -2.123038140592916e-11; +a14 = 2.775927747785646e-3; +a15 = -4.699214888271850e-5; +a16 = 3.358540072460230e-6; +a17 = 2.697475730017109e-9; +a18 = -2.764306979894411e-5; +a19 = 2.525874630197091e-7; +a20 = 2.858362524508931e-9; +a21 = -7.244588807799565e-11; +a22 = 3.801564588876298e-7; +a23 = -1.534575373851809e-8; +a24 = -1.390254702334843e-10; +a25 = 1.072438894227657e-11; +a26 = -3.212746477974189e-7; +a27 = 6.382827821123254e-9; +a28 = -5.793038794625329e-12; +a29 = 6.211426728363857e-10; +a30 = -1.941660213148725e-11; +a31 = -3.729652850731201e-14; +a32 = 1.119522344879478e-14; +a33 = 6.057902487546866e-17; + +b01 = -6.698001071123802; +b02 = -2.986498947203215e-2; +b03 = 2.327859407479162e-4; +b04 = -5.983233568452735e-2; +b05 = 7.643133860820750e-4; +b06 = -2.140477007450431e-5; +b07 = 2.467559060524383e-7; +b08 = -1.806789763745328e-4; +b09 = 6.876837219536232e-7; +b10 = 1.550932729220080e-10; +b11 = -7.521448093615448e-3; +b12 = -2.764306979894411e-5; +b13 = 1.262937315098546e-7; +b14 = 9.527875081696435e-10; +b15 = -1.811147201949891e-11; +b16 = -4.954963307079632e-5; +b17 = 5.702346883314446e-7; +b18 = -1.150931530388857e-8; +b19 = -6.951273511674217e-11; +b20 = 4.021645853353715e-12; +b21 = 1.083865310229748e-5; +b22 = -1.105097577149576e-7; +b23 = 6.211426728363857e-10; +b24 = 1.119522344879478e-14; + +c01 = -2.233269627352527e-2; +c02 = -3.436090079851880e-4; +c03 = 3.726050720345733e-6; +c04 = -1.806789763745328e-4; +c05 = 6.876837219536232e-7; +c06 = -6.174065000748422e-7; +c07 = -3.976733175851186e-8; +c08 = -2.123038140592916e-11; +c09 = 3.101865458440160e-10; +c10 = -2.742185394906099e-5; +c11 = -3.212746477974189e-7; +c12 = 3.191413910561627e-9; +c13 = -1.931012931541776e-12; +c14 = -1.105097577149576e-7; +c15 = 6.211426728363857e-10; +c16 = -2.238023185750219e-10; +c17 = -3.883320426297450e-11; +c18 = -3.729652850731201e-14; +c19 = 2.239044689758956e-14; +c20 = -3.601523245654798e-15; +c21 = 1.817370746264060e-16; + +sqrtSA = sqrt(SA); + +v_hat_denominator = v01 + CT.*(v02 + CT.*(v03 + v04*CT)) ... + + SA.*(v05 + CT.*(v06 + v07*CT) ... + + sqrtSA.*(v08 + CT.*(v09 + CT.*(v10 + v11*CT)))) ... + + p.*(v12 + CT.*(v13 + v14*CT) + SA.*(v15 + v16*CT) ... + + p.*(v17 + CT.*(v18 + v19*CT) + v20*SA)); + +v_hat_numerator = v21 + CT.*(v22 + CT.*(v23 + CT.*(v24 + v25*CT))) ... + + SA.*(v26 + CT.*(v27 + CT.*(v28 + CT.*(v29 + v30*CT))) + v36*SA ... + + sqrtSA.*(v31 + CT.*(v32 + CT.*(v33 + CT.*(v34 + v35*CT))))) ... + + p.*(v37 + CT.*(v38 + CT.*(v39 + v40*CT)) ... + + SA.*(v41 + v42*CT) ... + + p.*(v43 + CT.*(v44 + v45*CT + v46*SA) ... + + p.*(v47 + v48*CT))); + +dvhatden_dSA = b01 + CT.*(b02 + b03*CT) ... + + sqrtSA.*(b04 + CT.*(b05 + CT.*(b06 + b07*CT))) ... + + p.*(b08 + b09*CT + b10*p) ; + +dvhatnum_dSA = b11 + CT.*(b12 + CT.*(b13 + CT.*(b14 + b15*CT))) ... + + sqrtSA.*(b16 + CT.*(b17 + CT.*(b18 + CT.*(b19 + b20*CT)))) + b21*SA ... + + p.*(b22 + CT.*(b23 + b24*p)); + +dvhatden_dCT = a01 + CT.*(a02 + a03*CT) ... + + SA.*(a04 + a05*CT ... + + sqrtSA.*(a06 + CT.*(a07 + a08*CT))) ... + + p.*(a09 + a10*CT + a11*SA ... + + p.*(a12 + a13*CT)); + +dvhatnum_dCT = a14 + CT.*(a15 + CT.*(a16 + a17*CT)) ... + + SA.*(a18 + CT.*(a19 + CT.*(a20 + a21*CT)) ... + + sqrtSA.*(a22 + CT.*(a23 + CT.*(a24 + a25*CT)))) ... + + p.*(a26 + CT.*(a27 + a28*CT) + a29*SA ... + + p.*(a30 + a31*CT + a32*SA + a33*p)); + +dvhatden_dp = c01 + CT.*(c02 + c03*CT) ... + + SA.*(c04 + c05*CT) ... + + p.*(c06 + CT.*(c07 + c08*CT) + c09*SA); + +dvhatnum_dp = c10 + CT.*(c11 + CT.*(c12 + c13*CT)) ... + + SA.*(c14 + c15*CT) ... + + p.*(c16 + CT.*(c17 + c18*CT + c19*SA) ... + + p.*(c20 + c21*CT)); + +rec_num = ones(size(v_hat_numerator))./v_hat_numerator; + +rho = rec_num.*v_hat_denominator; + +drho_dSA = (dvhatden_dSA - dvhatnum_dSA.*rho).*rec_num; + +drho_dCT = (dvhatden_dCT - dvhatnum_dCT.*rho).*rec_num; + +Pa2db = 1e-4; % factor to convert from Pa to dbar + +drho_dP = Pa2db.*(dvhatden_dp - dvhatnum_dp.*rho).*rec_num; + +if transposed + drho_dSA = drho_dSA.'; + drho_dCT = drho_dCT.'; + drho_dP = drho_dP.'; +end + +end diff --git a/Toolbox/gsw_rho_first_derivatives_CT.m b/Toolbox/gsw_rho_first_derivatives_CT.m new file mode 100644 index 0000000..9d0b4c3 --- /dev/null +++ b/Toolbox/gsw_rho_first_derivatives_CT.m @@ -0,0 +1,121 @@ +function [drho_dSA, drho_dCT, drho_dP] = gsw_rho_first_derivatives_CT(SA,CT,p) + +% gsw_rho_first_derivatives_CT SA, CT and p partial derivatives +% of density (48-term equation) +%========================================================================== +% +% USAGE: +% [drho_dSA, drho_dCT, drho_dP] = gsw_rho_first_derivatives_CT(SA,CT,p), +% or equivalently +% [drho_dSA, drho_dCT, drho_dP] = gsw_rho_first_derivatives(SA,CT,p) +% +% Note that gsw_rho_first_derivatives(SA,CT,p) is identical to +% gsw_rho_first_derivatives_CT(SA,CT,p). The extra "_CT" emphasises that +% the input temperature is Conservative Temperature, but the extra "_CT" +% part of the function name is not needed. +% +% +% DESCRIPTION: +% Calculates the three (3) partial derivatives of in situ density with +% respect to Absolute Salinity, Conservative Temperature and pressure. +% Note that the pressure derivative is done with respect to pressure in +% Pa, not dbar. This function uses the computationally-efficient 48-term +% expression for density in terms of SA, CT and p. +% +% +% 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 IOC et al. (2010). The GSW library function +% "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if +% some of one's data lies outside this "funnel". +% +% INPUT: +% SA = Absolute Salinity [ g/kg ] +% CT = Conservative Temperature (ITS-90) [ deg C ] +% p = sea pressure [ dbar ] +% ( i.e. absolute pressure - 10.1325 dbar ) +% +% SA & CT need to have the same dimensions. +% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & CT are MxN. +% +% +% OUTPUT: +% drho_dSA = partial derivatives of density [ kg^2/(g m^3) ] +% with respect to Absolute Salinity +% drho_dCT = partial derivatives of density [ kg/(K m^3) ] +% with respect to Conservative Temperature +% drho_dP = partial derivatives of density [ kg/(Pa m^3) ] +% with respect to pressure in Pa +% +% AUTHOR: +% Paul Barker and Trevor McDougall [ help@teos-10.org ] +% +% VERSION NUMBER: 3.03 (29th April, 2013) +% +% 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.20 and appendix K of this TEOS-10 Manual. +% +% The software is available from http://www.TEOS-10.org +% +%========================================================================== + +%-------------------------------------------------------------------------- +% Check variables and resize if necessary +%-------------------------------------------------------------------------- + +if ~(nargin == 3) + error('gsw_rho_first_derivatives_CT: Requires three inputs') +end %if +if ~(nargout == 3 | nargout == 4) + error('gsw_rho_first_derivatives_CT: Requires three outputs') +end %if + +[ms,ns] = size(SA); +[mt,nt] = size(CT); +[mp,np] = size(p); + +if (mt ~= ms | nt ~= ns) + error('gsw_rho_first_derivatives_CT: SA and CT must have same dimensions') +end + +if (mp == 1) & (np == 1) % p scalar - fill to size of SA + p = p*ones(size(SA)); +elseif (ns == np) & (mp == 1) % p is row vector, + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (np == 1) % p is column vector, + p = p(:,ones(1,ns)); % copy across each row. +elseif (ns == mp) & (np == 1) % p is a transposed row vector, + p = p.'; % transposed then + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (ns == np) + % ok +else + error('gsw_rho_first_derivatives_CT: Inputs array dimensions arguments do not agree') +end %if + +if ms == 1 + SA = SA.'; + CT = CT.'; + p = p.'; + transposed = 1; +else + transposed = 0; +end + +%-------------------------------------------------------------------------- +% Start of the calculation +%-------------------------------------------------------------------------- + +[drho_dSA, drho_dCT, drho_dP] = gsw_rho_first_derivatives(SA,CT,p); + +if transposed + drho_dSA = drho_dSA.'; + drho_dCT = drho_dCT.'; + drho_dP = drho_dP.'; +end + +end diff --git a/Toolbox/gsw_rho_first_derivatives_CT_exact.m b/Toolbox/gsw_rho_first_derivatives_CT_exact.m new file mode 100644 index 0000000..0417e89 --- /dev/null +++ b/Toolbox/gsw_rho_first_derivatives_CT_exact.m @@ -0,0 +1,172 @@ +function [drho_dSA, drho_dCT, drho_dP] = gsw_rho_first_derivatives_CT_exact(SA,CT,p) + +% gsw_rho_first_derivatives_CT_exact SA, CT and p partial derivatives +% of density +%========================================================================== +% +% USAGE: +% [drho_dSA, drho_dCT, drho_dP] = gsw_rho_first_derivatives_CT_exact(SA,CT,p) +% +% DESCRIPTION: +% Calculates the three (3) partial derivatives of in situ density with +% respect to Absolute Salinity, Conservative Temperature and pressure. +% Note that the pressure derivative is done with respect to pressure in +% Pa, not dbar. +% +% Note that this function uses the full Gibbs function. There is an +% alternative to calling this function, namely +% gsw_rho_first_derivatives(SA,CT,p), which uses the computationally +% efficient 48-term expression for density in terms of SA, CT and p +% (IOC et al., 2010). +% +% INPUT: +% SA = Absolute Salinity [ g/kg ] +% CT = Conservative Temperature (ITS-90) [ deg C ] +% p = sea pressure [ dbar ] +% ( i.e. absolute pressure - 10.1325 dbar ) +% +% SA & CT need to have the same dimensions. +% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & CT are MxN. +% +% OUTPUT: +% drho_dSA = partial derivatives of density [ kg^2/(g m^3) ] +% with respect to Absolute Salinity +% drho_dCT = partial derivatives of density [ kg/(K m^3) ] +% with respect to Conservative Temperature +% drho_dP = partial derivatives of density [ kg/(Pa m^3) ] +% with respect to pressure in Pa +% +% AUTHOR: +% Paul Barker and Trevor McDougall [ help@teos-10.org ] +% +% VERSION NUMBER: 3.03 (10th May, 2013) +% +% 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.20 and appendix K of this TEOS-10 Manual. +% +% The software is available from http://www.TEOS-10.org +% +%========================================================================== + +%-------------------------------------------------------------------------- +% Check variables and resize if necessary +%-------------------------------------------------------------------------- + +if ~(nargin == 3) + error('gsw_rho_first_derivatives_CT_exact: Requires three inputs') +end %if +if ~(nargout == 3 | nargout == 4) + error('gsw_rho_first_derivatives_CT_exact: Requires three outputs') +end %if + +[ms,ns] = size(SA); +[mt,nt] = size(CT); +[mp,np] = size(p); + +if (mt ~= ms | nt ~= ns) + error('gsw_rho_first_derivatives_CT_exact: SA and CT must have same dimensions') +end + +if (mp == 1) & (np == 1) % p scalar - fill to size of SA + p = p*ones(size(SA)); +elseif (ns == np) & (mp == 1) % p is row vector, + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (np == 1) % p is column vector, + p = p(:,ones(1,ns)); % copy across each row. +elseif (ns == mp) & (np == 1) % p is a transposed row vector, + p = p.'; % transposed then + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (ns == np) + % ok +else + error('gsw_rho_first_derivatives_CT_exact: Inputs array dimensions arguments do not agree') +end %if + +if ms == 1 + SA = SA.'; + CT = CT.'; + p = p.'; + transposed = 1; +else + transposed = 0; +end + +%-------------------------------------------------------------------------- +% Start of the calculation +%-------------------------------------------------------------------------- + +% This line ensures that SA is non-negative. +SA(SA < 0) = 0; + +t = gsw_t_from_CT(SA,CT,p); + +n0 = 0; +n1 = 1; +n2 = 2; +db2Pa = 1e-4; +sfac = 0.0248826675584615; % sfac = 1/(40*(35.16504/35)). + +pt0 = gsw_pt0_from_t(SA,t,p); + +x2 = sfac.*SA; +x = sqrt(x2); +y = 0.025*t; +y_pt = 0.025*pt0; +z = db2Pa*p; %Note.The input pressure (p) is sea pressure in units of dbar. + +g_SA_T_mod = 1187.3715515697959 + z.*(1458.233059470092 + ... + z.*(-687.913805923122 + z.*(249.375342232496 + z.*(-63.313928772146 + 14.09317606630898.*z)))) + ... + x.*(-1480.222530425046 + x.*(2175.341332000392 + x.*(-980.14153344888 + 220.542973797483.*x) + ... + y.*(-548.4580073635929 + y.*(592.4012338275047 + y.*(-274.2361238716608 + 49.9394019139016.*y))) - ... + 90.6734234051316.*z) + z.*(-525.876123559641 + (249.57717834054571 - 88.449193048287.*z).*z) + ... + y.*(-258.3988055868252 + z.*(2298.348396014856 + z.*(-325.1503575102672 + 153.8390924339484.*z)) + ... + y.*(-90.2046337756875 - 4142.8793862113125.*z + y.*(10.50720794170734 + 2814.78225133626.*z)))) + ... + y.*(3520.125411988816 + y.*(-1351.605895580406 + ... + y.*(731.4083582010072 + y.*(-216.60324087531103 + 25.56203650166196.*y) + ... + z.*(-2381.829935897496 + (597.809129110048 - 291.8983352012704.*z).*z)) + ... + z.*(4165.4688847996085 + z.*(-1229.337851789418 + (681.370187043564 - 66.7696405958478.*z).*z))) + ... + z.*(-3443.057215135908 + z.*(1349.638121077468 + ... + z.*(-713.258224830552 + (176.8161433232 - 31.68006188846728.*z).*z)))); +g_SA_T_mod = 0.5*sfac*0.025*g_SA_T_mod; + +g_SA_mod = 8645.36753595126 + ... + x.*(-7296.43987145382 + x.*(8103.20462414788 + ... + y_pt.*(2175.341332000392 + y_pt.*(-274.2290036817964 + ... + y_pt.*(197.4670779425016 + y_pt.*(-68.5590309679152 + 9.98788038278032.*y_pt)))) + ... + x.*(-5458.34205214835 - 980.14153344888.*y_pt + ... + x.*(2247.60742726704 - 340.1237483177863.*x + 220.542973797483.*y_pt))) + ... + y_pt.*(-1480.222530425046 + ... + y_pt.*(-129.1994027934126 + ... + y_pt.*(-30.0682112585625 + y_pt.*(2.626801985426835 ))))) + ... + y_pt.*(1187.3715515697959 + ... + y_pt.*(1760.062705994408 + y_pt.*(-450.535298526802 + ... + y_pt.*(182.8520895502518 + y_pt.*(-43.3206481750622 + 4.26033941694366.*y_pt))))); +g_SA_mod = 0.5*sfac*g_SA_mod; + +g_p = gsw_gibbs(n0,n0,n1,SA,t,p); + +g_psq_g_tt = g_p.*g_p.*gsw_gibbs(n0,n2,n0,SA,t,p); + +g_tp = gsw_gibbs(n0,n1,n1,SA,t,p); + +factora = g_SA_T_mod - g_SA_mod./(273.15+pt0); + +factor = factora./g_psq_g_tt; + +drho_dSA = g_tp.*factor - gsw_gibbs(n1,n0,n1,SA,t,p)./(g_p.*g_p); + +drho_dCT = g_tp.*gsw_cp0./((273.15+pt0).*g_psq_g_tt); + +drho_dP = (g_tp.^2 - gsw_gibbs(n0,n2,n0,SA,t,p).*gsw_gibbs(n0,n0,n2,SA,t,p))./(g_psq_g_tt); + +if transposed + drho_dSA = drho_dSA.'; + drho_dCT = drho_dCT.'; + drho_dP = drho_dP.'; +end + +end diff --git a/Toolbox/gsw_sigma0.m b/Toolbox/gsw_sigma0.m index d87c3b8..c27090d 100644 --- a/Toolbox/gsw_sigma0.m +++ b/Toolbox/gsw_sigma0.m @@ -5,18 +5,18 @@ %========================================================================== % % USAGE: -% sigma0 = gsw_sigma0(SA,CT,p) +% sigma0 = gsw_sigma0(SA,CT) % % DESCRIPTION: % Calculates potential density anomaly with reference pressure of 0 dbar, % this being this particular potential density minus 1000 kg/m^3. This % function has inputs of Absolute Salinity and Conservative Temperature. % This function uses the computationally-efficient 48-term expression for -% density in terms of SA, CT and p (McDougall et al., 2013). +% density in terms of SA, CT and p (IOC et al., 2010). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -34,7 +34,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -43,11 +43,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sigma0_CT.m b/Toolbox/gsw_sigma0_CT.m index 83c45d5..51d5212 100644 --- a/Toolbox/gsw_sigma0_CT.m +++ b/Toolbox/gsw_sigma0_CT.m @@ -18,11 +18,11 @@ % this being this particular potential density minus 1000 kg/m^3. This % function has inputs of Absolute Salinity and Conservative Temperature. % This function uses the computationally-efficient 48-term expression for -% density in terms of SA, CT and p (McDougall et al., 2013). +% density in terms of SA, CT and p (IOC et al., 2010). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -40,7 +40,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -49,11 +49,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sigma0_CT_exact.m b/Toolbox/gsw_sigma0_CT_exact.m index 72cd506..f39ab20 100644 --- a/Toolbox/gsw_sigma0_CT_exact.m +++ b/Toolbox/gsw_sigma0_CT_exact.m @@ -13,9 +13,9 @@ % function has inputs of Absolute Salinity and Conservative Temperature. % % Note that this function uses the full Gibbs function. There is an -% alternative to calling this function, namely gsw_sigma0_CT(SA,CT,p), +% alternative to calling this function, namely gsw_sigma0(SA,CT,p), % which uses the computationally efficient 48-term expression for density -% in terms of SA, CT and p (McDougall et al., 2013). +% in terms of SA, CT and p (IOC et al., 2010). % % INPUT: % SA = Absolute Salinity [ g/kg ] @@ -31,7 +31,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -40,11 +40,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sigma1.m b/Toolbox/gsw_sigma1.m index b3e4750..26f40fe 100644 --- a/Toolbox/gsw_sigma1.m +++ b/Toolbox/gsw_sigma1.m @@ -15,7 +15,7 @@ % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -33,7 +33,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -42,11 +42,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sigma1_CT.m b/Toolbox/gsw_sigma1_CT.m index a87c88d..99164c4 100644 --- a/Toolbox/gsw_sigma1_CT.m +++ b/Toolbox/gsw_sigma1_CT.m @@ -21,7 +21,7 @@ % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -39,7 +39,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -48,11 +48,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sigma1_CT_exact.m b/Toolbox/gsw_sigma1_CT_exact.m index bb25664..4685e70 100644 --- a/Toolbox/gsw_sigma1_CT_exact.m +++ b/Toolbox/gsw_sigma1_CT_exact.m @@ -14,9 +14,9 @@ % Temperature. % % Note that this function uses the full Gibbs function. There is an -% alternative to calling this function, namely gsw_sigma1_CT(SA,CT,p), +% alternative to calling this function, namely gsw_sigma1(SA,CT,p), % which uses the computationally efficient 48-term expression for density -% in terms of SA, CT and p (McDougall et al., 2013). +% in terms of SA, CT and p (IOC et al., 2010). % % INPUT: % SA = Absolute Salinity [ g/kg ] @@ -32,7 +32,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -41,11 +41,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sigma2.m b/Toolbox/gsw_sigma2.m index 5b75d88..a17f465 100644 --- a/Toolbox/gsw_sigma2.m +++ b/Toolbox/gsw_sigma2.m @@ -15,7 +15,7 @@ % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -33,7 +33,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -42,11 +42,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sigma2_CT.m b/Toolbox/gsw_sigma2_CT.m index 6dccced..918fae4 100644 --- a/Toolbox/gsw_sigma2_CT.m +++ b/Toolbox/gsw_sigma2_CT.m @@ -21,7 +21,7 @@ % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -39,7 +39,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -48,11 +48,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sigma2_CT_exact.m b/Toolbox/gsw_sigma2_CT_exact.m index 0a59ea6..de33119 100644 --- a/Toolbox/gsw_sigma2_CT_exact.m +++ b/Toolbox/gsw_sigma2_CT_exact.m @@ -14,9 +14,9 @@ % Temperature. % % Note that this function uses the full Gibbs function. There is an -% alternative to calling this function, namely gsw_sigma2_CT(SA,CT,p), +% alternative to calling this function, namely gsw_sigma2(SA,CT,p), % which uses the computationally efficient 48-term expression for density -% in terms of SA, CT and p (McDougall et al., 2013). +% in terms of SA, CT and p (IOC et al., 2010). % % INPUT: % SA = Absolute Salinity [ g/kg ] @@ -32,7 +32,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -41,11 +41,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.1) of this TEOS-10 Manual. % -% 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. To be submitted to Ocean Science Discussions. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sigma3.m b/Toolbox/gsw_sigma3.m index b0a5037..3c5f28a 100644 --- a/Toolbox/gsw_sigma3.m +++ b/Toolbox/gsw_sigma3.m @@ -15,7 +15,7 @@ % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -33,7 +33,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -42,11 +42,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sigma3_CT.m b/Toolbox/gsw_sigma3_CT.m index 3745a3b..3a82fc9 100644 --- a/Toolbox/gsw_sigma3_CT.m +++ b/Toolbox/gsw_sigma3_CT.m @@ -21,7 +21,7 @@ % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -39,7 +39,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -48,11 +48,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sigma3_CT_exact.m b/Toolbox/gsw_sigma3_CT_exact.m index 8b71716..c5445e5 100644 --- a/Toolbox/gsw_sigma3_CT_exact.m +++ b/Toolbox/gsw_sigma3_CT_exact.m @@ -14,9 +14,9 @@ % Temperature. % % Note that this function uses the full Gibbs function. There is an -% alternative to calling this function, namely gsw_sigma3_CT(SA,CT,p), +% alternative to calling this function, namely gsw_sigma3(SA,CT,p), % which uses the computationally efficient 48-term expression for density -% in terms of SA, CT and p (McDougall et al., 2013). +% in terms of SA, CT and p (IOC et al., 2010). % % INPUT: % SA = Absolute Salinity [ g/kg ] @@ -32,7 +32,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -41,11 +41,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sigma4.m b/Toolbox/gsw_sigma4.m index 053ca37..32c888b 100644 --- a/Toolbox/gsw_sigma4.m +++ b/Toolbox/gsw_sigma4.m @@ -15,7 +15,7 @@ % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -33,7 +33,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -42,11 +42,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sigma4_CT.m b/Toolbox/gsw_sigma4_CT.m index 8885a4f..8bcc209 100644 --- a/Toolbox/gsw_sigma4_CT.m +++ b/Toolbox/gsw_sigma4_CT.m @@ -21,7 +21,7 @@ % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -39,7 +39,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -48,11 +48,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sigma4_CT_exact.m b/Toolbox/gsw_sigma4_CT_exact.m index e652b3d..e8b440c 100644 --- a/Toolbox/gsw_sigma4_CT_exact.m +++ b/Toolbox/gsw_sigma4_CT_exact.m @@ -14,9 +14,9 @@ % Temperature. % % Note that this function uses the full Gibbs function. There is an -% alternative to calling this function, namely gsw_sigma4_CT(SA,CT,p), +% alternative to calling this function, namely gsw_sigma4(SA,CT,p), % which uses the computationally efficient 48-term expression for density -% in terms of SA, CT and p (McDougall et al., 2013). +% in terms of SA, CT and p (IOC et al., 2010). % % INPUT: % SA = Absolute Salinity [ g/kg ] @@ -32,7 +32,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -41,11 +41,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (A.30.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sound_speed.m b/Toolbox/gsw_sound_speed.m index 93b6c2f..f1b2ac5 100644 --- a/Toolbox/gsw_sound_speed.m +++ b/Toolbox/gsw_sound_speed.m @@ -11,11 +11,11 @@ % Calculates the speed of sound in seawater. This function has inputs of % Absolute Salinity and Conservative Temperature. This function uses the % computationally-efficient 48-term expression for density in terms of SA, -% CT and p (McDougall et al., 2013). +% CT and p (IOC et al., 2010). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -34,7 +34,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -43,11 +43,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (2.17.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sound_speed_CT.m b/Toolbox/gsw_sound_speed_CT.m index 56d68d6..eb81834 100644 --- a/Toolbox/gsw_sound_speed_CT.m +++ b/Toolbox/gsw_sound_speed_CT.m @@ -17,11 +17,11 @@ % Calculates the speed of sound in seawater. This function has inputs of % Absolute Salinity and Conservative Temperature. This function uses the % computationally-efficient 48-term expression for density in terms of SA, -% CT and p (McDougall et al., 2013). +% CT and p (IOC et al., 2010). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -40,7 +40,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -49,11 +49,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (2.17.1) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_sound_speed_CT_exact.m b/Toolbox/gsw_sound_speed_CT_exact.m index 80f5931..1a2ffab 100644 --- a/Toolbox/gsw_sound_speed_CT_exact.m +++ b/Toolbox/gsw_sound_speed_CT_exact.m @@ -4,7 +4,7 @@ %========================================================================== % % USAGE: -% sound_speed_CT = gsw_sound_speed_CT(SA,CT,p) +% sound_speed_CT_exact = gsw_sound_speed_CT_exact(SA,CT,p) % % DESCRIPTION: % Calculates the speed of sound in seawater from Absolute Salinity and @@ -25,7 +25,7 @@ % AUTHOR: % David Jackett, Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_specvol.m b/Toolbox/gsw_specvol.m index 5d6706b..061cb1a 100644 --- a/Toolbox/gsw_specvol.m +++ b/Toolbox/gsw_specvol.m @@ -9,11 +9,11 @@ % DESCRIPTION: % Calculates specific volume from Absolute Salinity, Conservative % Temperature and pressure, using the computationally-efficient 48-term -% expression for density (McDougall et al., 2013). +% expression for density (IOC et al., 2010). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -32,7 +32,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -41,11 +41,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (2.7.2) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_specvol_CT.m b/Toolbox/gsw_specvol_CT.m index 2eb8b19..25a17da 100644 --- a/Toolbox/gsw_specvol_CT.m +++ b/Toolbox/gsw_specvol_CT.m @@ -15,11 +15,11 @@ % DESCRIPTION: % Calculates specific volume from Absolute Salinity, Conservative % Temperature and pressure, using the computationally-efficient 48-term -% expression for density (McDougall et al., 2013). +% expression for density (IOC et al., 2010). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -38,7 +38,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -47,11 +47,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (2.7.2) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_specvol_CT_exact.m b/Toolbox/gsw_specvol_CT_exact.m index 015331c..52177b6 100644 --- a/Toolbox/gsw_specvol_CT_exact.m +++ b/Toolbox/gsw_specvol_CT_exact.m @@ -13,7 +13,7 @@ % Note that this function uses the full Gibbs function. There is an % alternative to calling this function, namely gsw_specvol_CT(SA,CT,p), % which uses the computationally efficient 48-term expression for density -% in terms of SA, CT and p (McDougall et al., 2013). +% in terms of SA, CT and p (IOC et al., 2010). % % INPUT: % SA = Absolute Salinity [ g/kg ] @@ -30,7 +30,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -39,11 +39,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (2.7.2) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_specvol_anom.m b/Toolbox/gsw_specvol_anom.m index f5d6800..6aec197 100644 --- a/Toolbox/gsw_specvol_anom.m +++ b/Toolbox/gsw_specvol_anom.m @@ -9,13 +9,13 @@ % DESCRIPTION: % Calculates specific volume anomaly from Absolute Salinity, Conservative % Temperature and pressure. It uses the computationally-efficient 48-term -% expression for density as a function of SA, CT and p (McDougall et al., -% 2011). The reference value of Absolute Salinity is SSO and the reference +% expression for density as a function of SA, CT and p (IOC et al., +% 2010). The reference value of Absolute Salinity is SSO and the reference % value of Conservative Temperature is equal to 0 degress C. % % 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). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -34,7 +34,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -43,11 +43,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (3.7.3) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_specvol_anom_CT.m b/Toolbox/gsw_specvol_anom_CT.m index fdd9b44..260070a 100644 --- a/Toolbox/gsw_specvol_anom_CT.m +++ b/Toolbox/gsw_specvol_anom_CT.m @@ -15,13 +15,13 @@ % DESCRIPTION: % Calculates specific volume anomaly from Absolute Salinity, Conservative % Temperature and pressure. It uses the computationally-efficient 48-term -% expression for density as a function of SA, CT and p (McDougall et al., -% 2013). The reference value of Absolute Salinity is SSO and the reference +% expression for density as a function of SA, CT and p (IOC et al., +% 2010). The reference value of Absolute Salinity is SSO and the reference % value of Conservative Temperature is equal to 0 degress C. % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -40,7 +40,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -49,11 +49,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (3.7.3) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_specvol_anom_CT_exact.m b/Toolbox/gsw_specvol_anom_CT_exact.m index b3d7471..21a16b4 100644 --- a/Toolbox/gsw_specvol_anom_CT_exact.m +++ b/Toolbox/gsw_specvol_anom_CT_exact.m @@ -13,10 +13,9 @@ % 0 degress C. % % Note that this function uses the full Gibbs function. There is an -% alternative to calling this function, namely -% gsw_specvol_anom_CT(SA,CT,p), which uses the computationally efficient -% 48-term expression for density in terms of SA, CT and p -% (McDougall et al., 2013). +% alternative to calling this function, namely gsw_specvol_anom(SA,CT,p), +% which uses the computationally efficient 48-term expression for density +% in terms of SA, CT and p (IOC et al., 2010). % % INPUT: % SA = Absolute Salinity [ g/kg ] @@ -33,7 +32,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -42,11 +41,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (3.7.3) of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_steric_height.m b/Toolbox/gsw_steric_height.m index 7876f2f..1149ca9 100644 --- a/Toolbox/gsw_steric_height.m +++ b/Toolbox/gsw_steric_height.m @@ -43,10 +43,10 @@ % 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. (2013). Note that the +% expression for specific volume of IOC et al. (2010). 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. (2013) and IOC et al. (2010). For dynamical +% in IOC et al. (2010) 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 "gsw_infunnel(SA,CT,p)" is avaialble to be @@ -75,7 +75,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % Griffies, S. M., 2004: Fundamentals of Ocean Climate Models. Princeton, @@ -87,11 +87,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqn. (3.7.3) and section 3.27 of this TEOS-10 Manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== diff --git a/Toolbox/gsw_t90_from_t48.m b/Toolbox/gsw_t90_from_t48.m index 949baa2..410f1b1 100644 --- a/Toolbox/gsw_t90_from_t48.m +++ b/Toolbox/gsw_t90_from_t48.m @@ -20,7 +20,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % This function is unchanged from version 2.0 (24th September, 2010). % % REFERENCES: diff --git a/Toolbox/gsw_t90_from_t68.m b/Toolbox/gsw_t90_from_t68.m index 70a8336..e85b1ad 100644 --- a/Toolbox/gsw_t90_from_t68.m +++ b/Toolbox/gsw_t90_from_t68.m @@ -20,7 +20,7 @@ % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % This function is unchanged from version 2.0 (24th September, 2010). % % REFERENCES: diff --git a/Toolbox/gsw_t_freezing.m b/Toolbox/gsw_t_freezing.m index 17188c8..52cc09c 100644 --- a/Toolbox/gsw_t_freezing.m +++ b/Toolbox/gsw_t_freezing.m @@ -30,7 +30,7 @@ % AUTHOR: % Trevor McDougall, Paul Barker and Rainer Feistal [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_t_from_CT.m b/Toolbox/gsw_t_from_CT.m index 1c48586..310129d 100644 --- a/Toolbox/gsw_t_from_CT.m +++ b/Toolbox/gsw_t_from_CT.m @@ -25,7 +25,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % This function is unchanged from version 2.0 (24th September, 2010). % % REFERENCES: diff --git a/Toolbox/gsw_t_from_entropy.m b/Toolbox/gsw_t_from_entropy.m new file mode 100644 index 0000000..dc70710 --- /dev/null +++ b/Toolbox/gsw_t_from_entropy.m @@ -0,0 +1,95 @@ +function t = gsw_t_from_entropy(SA,entropy,p) + +% gsw_t_from_entropy in-situ temperature +% as a function of entropy +% ========================================================================= +% +% USAGE: +% t = gsw_t_from_entropy(SA,entropy,p) +% +% DESCRIPTION: +% Calculates in-situ temperature with entropy as an input variable. +% +% INPUT: +% SA = Absolute Salinity [ g/kg ] +% entropy = specific entropy [ J/(kg*K) ] +% p = sea pressure [ dbar ] +% ( i.e. absolute pressure - 10.1325 dbar ) +% +% SA & entropy need to have the same dimensions. +% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & entropy are +% MxN. +% +% OUTPUT: +% t = in-situ temperature (ITS-90) [ deg C ] +% +% AUTHOR: +% Trevor McDougall and Paul Barker [ help@teos-10.org ] +% +% VERSION NUMBER: 3.03 (29th April, 2013) +% +% 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.10 of this TEOS-10 Manual. +% +% The software is available from http://www.TEOS-10.org +% +%========================================================================== + +%-------------------------------------------------------------------------- +% Check variables and resize if necessary +%-------------------------------------------------------------------------- + +if ~(nargin == 3) + error('gsw_t_from_entropy: Requires 3 inputs, Absolute Salinity, entropy and pressure') +end %if + +[ms,ns] = size(SA); +[me,ne] = size(entropy); +[mp,np] = size(p); + +if (ms ~= me | ns ~= ne ) + error('gsw_t_from_entropy: Input arguments do not have the same dimensions') +end %if + +if (mp == 1) & (np == 1) % p scalar - fill to size of SA + p = p*ones(size(SA)); +elseif (ns == np) & (mp == 1) % p is row vector, + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (np == 1) % p is column vector, + p = p(:,ones(1,ns)); % copy across each row. +elseif (ns == mp) & (np == 1) % p is a transposed row vector, + p = p.'; % transposed then + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (ns == np) + % ok +else + error('gsw_adiabatic_lapse_rate_from_CT: Inputs array dimensions arguments do not agree') +end %if + +if ms == 1 + SA = SA.'; + entropy = entropy.'; + p = p.'; + transposed = 1; +else + transposed = 0; +end + +%-------------------------------------------------------------------------- +% Start of the calculation +%-------------------------------------------------------------------------- + +pt = gsw_pt_from_entropy(SA,entropy); +% Note that pt is potential temperature with a reference pressure of zero. +p0 = zeros(size(SA)); +t = gsw_pt_from_t(SA,pt,p0,p); + +if transposed + t = t.'; +end + +end diff --git a/Toolbox/gsw_t_from_pt0.m b/Toolbox/gsw_t_from_pt0.m new file mode 100644 index 0000000..ff56dc1 --- /dev/null +++ b/Toolbox/gsw_t_from_pt0.m @@ -0,0 +1,102 @@ +function t = gsw_t_from_pt0(SA,pt0,p) + +% gsw_t_from_pt0 in-situ temperature from potential +% temperature with a p_ref = 0 dbar +% ========================================================================= +% +% USAGE: +% t = gsw_t_from_pt0(SA,pt0,p) +% +% DESCRIPTION: +% Calculates in-situ temperature from potential temperature with a +% reference pressure of 0 dbar. +% +% It is also possible to calculate in-situ temperature from potential +% temparature using the function gsw_pt_from_t. In this case it would be +% called with Absolute Salinity, SA, potential temperature referenced to +% 0 dbar, pt0, and the in-situ pressure (i.e. gsw_pt_from_t(SA,pt0,0,p) ). +% +% INPUT: +% SA = Absolute Salinity [ g/kg ] +% pt0 = potential temperature with reference pressure = 0 dbar [ deg C ] +% p = sea pressure [ dbar ] +% ( i.e. absolute pressure - 10.1325 dbar ) +% +% SA & pt0 need to have the same dimensions. p may have dimensions 1x1 or +% Mx1 or 1xN or MxN, where SA & pt0 are MxN. +% +% OUTPUT: +% t = in-situ temperature (ITS-90) [ deg C ] +% +% AUTHOR: +% Trevor McDougall and Paul Barker. [ help@teos-10.org ] +% +% VERSION NUMBER: 3.03 (22nd May, 2013) +% +% 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 section 3.1 of this TEOS-10 Manual. +% +% McDougall T.J. and S.J. Wotherspoon, 2012: A simple modification of +% Newton’s method to achieve convergence of order "1 + sqrt(2)". +% Submitted to Applied Mathematics and Computation. +% +% The software is available from http://www.TEOS-10.org +% +%========================================================================== + +%-------------------------------------------------------------------------- +% Check variables and resize if necessary +%-------------------------------------------------------------------------- + +if ~(nargin == 3) + error('gsw_t_from_pt0: Requires either three inputs.') +end %if + +[ms,ns] = size(SA); +[mt,nt] = size(pt0); +[mp,np] = size(p); + +if (ms ~= mt | ns ~= nt ) + error('gsw_t_from_pt0: Input arguments do not have the same dimensions') +end %if + +if (mp == 1) & (np == 1) % p scalar - fill to size of SA + p = p*ones(size(SA)); +elseif (ns == np) & (mp == 1) % p is row vector, + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (np == 1) % p is column vector, + p = p(:,ones(1,ns)); % copy across each row. +elseif (ns == mp) & (np == 1) % p is a transposed row vector, + p = p.'; % transposed then + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (ns == np) + % ok +else + error('gsw_t_from_pt0: Inputs array dimensions arguments do not agree') +end %if + +if ms == 1 + SA = SA.'; + pt0 = pt0.'; + p = p.'; + transposed = 1; +else + transposed = 0; +end + +%-------------------------------------------------------------------------- +% Start of the calculation +%-------------------------------------------------------------------------- + +p0 = zeros(size(SA)); +t = gsw_pt_from_t(SA,pt0,p0,p); + +if transposed + t = t.'; +end + +end diff --git a/Toolbox/gsw_thermobaric.m b/Toolbox/gsw_thermobaric.m index c870017..4e0ced1 100644 --- a/Toolbox/gsw_thermobaric.m +++ b/Toolbox/gsw_thermobaric.m @@ -10,11 +10,11 @@ % Calculates the thermobaric coefficient of seawater with respect to % Conservative Temperature. This routine calculates rho from the % computationally-efficient 48-term expression for density in terms of -% SA, CT and p (McDougall et al., 2013). +% SA, CT and p (IOC et al., 2010). % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -34,9 +34,9 @@ % pressure in Pa not dbar. % % AUTHOR: -% David Jackett, Trevor McDougall and Paul Barker [ help@teos-10.org ] +% Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (5th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -45,11 +45,6 @@ % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % See Eqns. (3.8.2) and (P.2) of this TEOS-10 manual. % -% 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. -% % The software is available from http://www.TEOS-10.org % %========================================================================== @@ -97,45 +92,219 @@ %-------------------------------------------------------------------------- % Start of the calculation %-------------------------------------------------------------------------- +% This line ensures that SA is non-negative. +SA(SA < 0) = 0; -db2Pa = 1e4; -dp = 1e-1; % pressure increment is 1e-1 dbar (10 Pa) +v01 = 9.998420897506056e+2; +v02 = 2.839940833161907; +v03 = -3.147759265588511e-2; +v04 = 1.181805545074306e-3; +v05 = -6.698001071123802; +v06 = -2.986498947203215e-2; +v07 = 2.327859407479162e-4; +v08 = -3.988822378968490e-2; +v09 = 5.095422573880500e-4; +v10 = -1.426984671633621e-5; +v11 = 1.645039373682922e-7; +v12 = -2.233269627352527e-2; +v13 = -3.436090079851880e-4; +v14 = 3.726050720345733e-6; +v15 = -1.806789763745328e-4; +v16 = 6.876837219536232e-7; +v17 = -3.087032500374211e-7; +v18 = -1.988366587925593e-8; +v19 = -1.061519070296458e-11; +v20 = 1.550932729220080e-10; -p_u = zeros(size(p)); -p_u(p >= dp) = p(p >= dp) - dp; +v21 = 1.0; +v22 = 2.775927747785646e-3; +v23 = -2.349607444135925e-5; +v24 = 1.119513357486743e-6; +v25 = 6.743689325042773e-10; +v26 = -7.521448093615448e-3; +v27 = -2.764306979894411e-5; +v28 = 1.262937315098546e-7; +v29 = 9.527875081696435e-10; +v30 = -1.811147201949891e-11; +v31 = -3.303308871386421e-5; +v32 = 3.801564588876298e-7; +v33 = -7.672876869259043e-9; +v34 = -4.634182341116144e-11; +v35 = 2.681097235569143e-12; +v36 = 5.419326551148740e-6; +v37 = -2.742185394906099e-5; +v38 = -3.212746477974189e-7; +v39 = 3.191413910561627e-9; +v40 = -1.931012931541776e-12; +v41 = -1.105097577149576e-7; +v42 = 6.211426728363857e-10; +v43 = -1.119011592875110e-10; +v44 = -1.941660213148725e-11; +v45 = -1.864826425365600e-14; +v46 = 1.119522344879478e-14; +v47 = -1.200507748551599e-15; +v48 = 6.057902487546866e-17; -p_l = dp*ones(size(p)); -p_l(p >= dp) = p(p >= dp) + dp; +a01 = 2.839940833161907; +a02 = -6.295518531177023e-2; +a03 = 3.545416635222918e-3; +a04 = -2.986498947203215e-2; +a05 = 4.655718814958324e-4; +a06 = 5.095422573880500e-4; +a07 = -2.853969343267241e-5; +a08 = 4.935118121048767e-7; +a09 = -3.436090079851880e-4; +a10 = 7.452101440691467e-6; +a11 = 6.876837219536232e-7; +a12 = -1.988366587925593e-8; +a13 = -2.123038140592916e-11; -[dummy,alpha,beta] = gsw_rho_alpha_beta(SA,CT,p); -[dummy,alpha_u,beta_u] = gsw_rho_alpha_beta(SA,CT,p_u); -[dummy,alpha_l,beta_l] = gsw_rho_alpha_beta(SA,CT,p_l); +a14 = 2.775927747785646e-3; +a15 = -4.699214888271850e-5; +a16 = 3.358540072460230e-6; +a17 = 2.697475730017109e-9; +a18 = -2.764306979894411e-5; +a19 = 2.525874630197091e-7; +a20 = 2.858362524508931e-9; +a21 = -7.244588807799565e-11; +a22 = 3.801564588876298e-7; +a23 = -1.534575373851809e-8; +a24 = -1.390254702334843e-10; +a25 = 1.072438894227657e-11; +a26 = -3.212746477974189e-7; +a27 = 6.382827821123254e-9; +a28 = -5.793038794625329e-12; +a29 = 6.211426728363857e-10; +a30 = -1.941660213148725e-11; +a31 = -3.729652850731201e-14; +a32 = 1.119522344879478e-14; +a33 = 6.057902487546866e-17; -alpha_p = (alpha_u - alpha_l)./(p_u - p_l); -beta_p = (beta_u - beta_l)./(p_u - p_l); +b01 = -6.698001071123802; +b02 = -2.986498947203215e-2; +b03 = 2.327859407479162e-4; +b04 = -5.983233568452735e-2; +b05 = 7.643133860820750e-4; +b06 = -2.140477007450431e-5; +b07 = 2.467559060524383e-7; +b08 = -1.806789763745328e-4; +b09 = 6.876837219536232e-7; +b10 = 1.550932729220080e-10; +b11 = -7.521448093615448e-3; +b12 = -2.764306979894411e-5; +b13 = 1.262937315098546e-7; +b14 = 9.527875081696435e-10; +b15 = -1.811147201949891e-11; +b16 = -4.954963307079632e-5; +b17 = 5.702346883314446e-7; +b18 = -1.150931530388857e-8; +b19 = -6.951273511674217e-11; +b20 = 4.021645853353715e-12; +b21 = 1.083865310229748e-5; +b22 = -1.105097577149576e-7; +b23 = 6.211426728363857e-10; +b24 = 1.119522344879478e-14; -thermobaric = alpha_p - (alpha./beta).*beta_p; -thermobaric = thermobaric./db2Pa; % To have units of 1/(K Pa) +c01 = -2.233269627352527e-2; +c02 = -3.436090079851880e-4; +c03 = 3.726050720345733e-6; +c04 = -1.806789763745328e-4; +c05 = 6.876837219536232e-7; +c06 = -6.174065000748422e-7; +c07 = -3.976733175851186e-8; +c08 = -2.123038140592916e-11; +c09 = 3.101865458440160e-10; -%-------------------------------------------------------------------------- -% This function calculates thermobaric_CT using the computationally -% efficient 48-term expression for density in terms of SA, CT and p. If -% one wanted to compute thermobaric_CT with the full TEOS-10 Gibbs function -% expression for density, the following lines of code will do this. -% -% pr0 = zeros(size(p)); -% pt = gsw_pt_from_CT(SA,CT); -% t_l = gsw_pt_from_t(SA,pt,pr0,p_l); -% t_u = gsw_pt_from_t(SA,pt,pr0,p_u); -% t = 0.5*(t_l + t_u); -% alpha = gsw_alpha_wrt_CT_t_exact(SA,t,p); -% beta = gsw_beta_const_CT_t_exact(SA,t,p); -% alpha_p = (gsw_alpha_wrt_CT_t_exact(SA,t_u,p_u) - gsw_alpha_wrt_CT_t_exact(SA,t_l,p_l))./(p_u - p_l); -% beta_p = (gsw_beta_const_CT_t_exact(SA,t_u,p_u) - gsw_beta_const_CT_t_exact(SA,t_l,p_l))./(p_u - p_l); -% thermobaric = alpha_p - (alpha./beta).*beta_p; -% thermobaric = thermobaric./db2Pa; % To have units of 1/(K Pa) -% -%----------------This is the end of the alternative code------------------- +c10 = -2.742185394906099e-5; +c11 = -3.212746477974189e-7; +c12 = 3.191413910561627e-9; +c13 = -1.931012931541776e-12; +c14 = -1.105097577149576e-7; +c15 = 6.211426728363857e-10; +c16 = -2.238023185750219e-10; +c17 = -3.883320426297450e-11; +c18 = -3.729652850731201e-14; +c19 = 2.239044689758956e-14; +c20 = -3.601523245654798e-15; +c21 = 1.817370746264060e-16; + +sqrtSA = sqrt(SA); + +v_hat_denominator = v01 + CT.*(v02 + CT.*(v03 + v04*CT)) ... + + SA.*(v05 + CT.*(v06 + v07*CT) ... + + sqrtSA.*(v08 + CT.*(v09 + CT.*(v10 + v11*CT)))) ... + + p.*(v12 + CT.*(v13 + v14*CT) + SA.*(v15 + v16*CT) ... + + p.*(v17 + CT.*(v18 + v19*CT) + v20*SA)); + +v_hat_numerator = v21 + CT.*(v22 + CT.*(v23 + CT.*(v24 + v25*CT))) ... + + SA.*(v26 + CT.*(v27 + CT.*(v28 + CT.*(v29 + v30*CT))) + v36*SA ... + + sqrtSA.*(v31 + CT.*(v32 + CT.*(v33 + CT.*(v34 + v35*CT))))) ... + + p.*(v37 + CT.*(v38 + CT.*(v39 + v40*CT)) ... + + SA.*(v41 + v42*CT) ... + + p.*(v43 + CT.*(v44 + v45*CT + v46*SA) ... + + p.*(v47 + v48*CT))); + +dvhatden_dCT = a01 + CT.*(a02 + a03*CT) ... + + SA.*(a04 + a05*CT ... + + sqrtSA.*(a06 + CT.*(a07 + a08*CT))) ... + + p.*(a09 + a10*CT + a11*SA ... + + p.*(a12 + a13*CT)); + +dvhatnum_dCT = a14 + CT.*(a15 + CT.*(a16 + a17*CT)) ... + + SA.*(a18 + CT.*(a19 + CT.*(a20 + a21*CT)) ... + + sqrtSA.*(a22 + CT.*(a23 + CT.*(a24 + a25*CT)))) ... + + p.*(a26 + CT.*(a27 + a28*CT) + a29*SA ... + + p.*(a30 + a31*CT + a32*SA + a33*p)); + +dvhatden_dSA = b01 + CT.*(b02 + b03*CT) ... + + sqrtSA.*(b04 + CT.*(b05 + CT.*(b06 + b07*CT))) ... + + p.*(b08 + b09*CT + b10*p) ; + +dvhatnum_dSA = b11 + CT.*(b12 + CT.*(b13 + CT.*(b14 + b15*CT))) ... + + sqrtSA.*(b16 + CT.*(b17 + CT.*(b18 + CT.*(b19 + b20*CT)))) + b21*SA ... + + p.*(b22 + CT.*(b23 + b24*p)); + +dvhatden_dp = c01 + CT.*(c02 + c03*CT) ... + + SA.*(c04 + c05*CT) ... + + p.*(c06 + CT.*(c07 + c08*CT) + c09*SA); + +dvhatnum_dp = c10 + CT.*(c11 + CT.*(c12 + c13*CT)) ... + + SA.*(c14 + c15*CT) ... + + p.*(c16 + CT.*(c17 + c18*CT + c19*SA) ... + + p.*(c20 + c21*CT)); + +dvhatden_dpdCT = c02 + 2*c03*CT + c05*SA ... + + p.*(c07 + 2*c08*CT); + +dvhatnum_dpdCT = c11 + CT.*(2*c12 + 3*c13*CT) + c15*SA ... + + p.*(c17 + CT.*2*c18 + c19*SA + c21*p); + +dvhatden_dpdSA = c04 + c05*CT + c09*p; + +dvhatnum_dpdSA = c14 + c15*CT + c19*CT.*p; + +p1a = (dvhatnum_dpdCT./v_hat_numerator); +p1b = (dvhatnum_dCT.*dvhatden_dp)./(v_hat_numerator.*v_hat_denominator); +p1c = (dvhatnum_dp.*dvhatden_dCT)./(v_hat_numerator.*v_hat_denominator); +p1d = (dvhatden_dp.*dvhatden_dCT)./(v_hat_denominator.^2); +p1e = (dvhatden_dpdCT./v_hat_denominator); + +Part1 = p1a - p1b - p1c + 2*p1d - p1e; + +factor2 = (v_hat_denominator.*dvhatnum_dCT - v_hat_numerator.*dvhatden_dCT)./ ... + (v_hat_denominator.*dvhatnum_dSA - v_hat_numerator.*dvhatden_dSA); + +p2a = (dvhatnum_dpdSA./v_hat_numerator); +p2b = (dvhatnum_dSA.*dvhatden_dp)./(v_hat_numerator.*v_hat_denominator); +p2c = (dvhatnum_dp.*dvhatden_dSA)./(v_hat_numerator.*v_hat_denominator); +p2d = (dvhatden_dp.*dvhatden_dSA)./(v_hat_denominator.^2); +p2e = (dvhatden_dpdSA./v_hat_denominator); + +Part2 = p2a - p2b - p2c + 2*p2d - p2e; + +db2Pa = 1e-4; % To have units of 1/(K Pa) + +thermobaric = (Part1 - factor2.*Part2)*db2Pa; if transposed thermobaric = thermobaric.'; diff --git a/Toolbox/gsw_thermobaric_CT.m b/Toolbox/gsw_thermobaric_CT.m new file mode 100644 index 0000000..7c9fc59 --- /dev/null +++ b/Toolbox/gsw_thermobaric_CT.m @@ -0,0 +1,110 @@ +function thermobaric_CT = gsw_thermobaric_CT(SA,CT,p) + +% gsw_thermobaric_CT thermobaric coefficient (48-term equation) +%========================================================================== +% +% USAGE: +% thermobaric_CT = gsw_thermobaric_CT(SA,CT,p), or equivalently +% thermobaric = gsw_thermobaric(SA,CT,p) +% +% Note that gsw_thermobaric_CT(SA,CT,p) is identical to +% gsw_thermobaric(SA,CT,p). The extra "_CT" emphasises that the +% input temperature is Conservative Temperature, but the extra "_CT" part +% of the function name is not needed. +% +% DESCRIPTION: +% Calculates the thermobaric coefficient of seawater with respect to +% Conservative Temperature. This routine calculates rho from the +% computationally-efficient 48-term expression for density in terms of +% SA, CT and p (IOC et al., 2010). +% +% 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 IOC et al. (2010). The GSW library function +% "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if +% some of one's data lies outside this "funnel". +% +% INPUT: +% SA = Absolute Salinity [ g/kg ] +% CT = Conservative Temperature (ITS-90) [ deg C ] +% p = sea pressure [ dbar ] +% ( i.e. absolute pressure - 10.1325 dbar ) +% +% SA & CT need to have the same dimensions. +% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & CT are MxN. +% +% OUTPUT: +% thermobaric_CT = thermobaric coefficient with [ 1/(K Pa) ] +% respect to Conservative Temperature. +% Note. The pressure derivative is taken with respect to +% pressure in Pa not dbar. +% +% AUTHOR: +% Trevor McDougall and Paul Barker [ help@teos-10.org ] +% +% VERSION NUMBER: 3.03 (5th April, 2013) +% +% 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 Eqns. (3.8.2) and (P.2) of this TEOS-10 manual. +% +% The software is available from http://www.TEOS-10.org +% +%========================================================================== + +%-------------------------------------------------------------------------- +% Check variables and resize if necessary +%-------------------------------------------------------------------------- + +if ~(nargin == 3) + error('gsw_thermobaric_CT: Requires three inputs') +end %if + +[ms,ns] = size(SA); +[mt,nt] = size(CT); +[mp,np] = size(p); + +if (mt ~= ms | nt ~= ns) + error('gsw_thermobaric_CT: SA and CT must have same dimensions') +end + +if (mp == 1) & (np == 1) % p scalar - fill to size of SA + p = p*ones(size(SA)); +elseif (ns == np) & (mp == 1) % p is row vector, + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (np == 1) % p is column vector, + p = p(:,ones(1,ns)); % copy across each row. +elseif (ns == mp) & (np == 1) % p is a transposed row vector, + p = p.'; % transposed then + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (ns == np) + % ok +else + error('gsw_thermobaric_CT: Inputs array dimensions arguments do not agree') +end %if + +if ms == 1 + SA = SA.'; + CT = CT.'; + p = p.'; + transposed = 1; +else + transposed = 0; +end + +%-------------------------------------------------------------------------- +% Start of the calculation +%-------------------------------------------------------------------------- +% This line ensures that SA is non-negative. +SA(SA < 0) = 0; + +thermobaric_CT = gsw_thermobaric(SA,CT,p); + +if transposed + thermobaric_CT = thermobaric_CT.'; +end + +end diff --git a/Toolbox/gsw_thermobaric_CT_exact.m b/Toolbox/gsw_thermobaric_CT_exact.m new file mode 100644 index 0000000..3ebb693 --- /dev/null +++ b/Toolbox/gsw_thermobaric_CT_exact.m @@ -0,0 +1,114 @@ +function thermobaric_CT_exact = gsw_thermobaric_CT_exact(SA,CT,p) + +% gsw_thermobaric_CT_exact thermobaric coefficient +%========================================================================== +% +% USAGE: +% thermobaric_CT_exact = gsw_thermobaric_CT_exact(SA,CT,p) +% +% DESCRIPTION: +% Calculates the thermobaric coefficient of seawater with respect to +% Conservative Temperature. This routine calculates the thermobaric +% coefficient with the full TEOS-10 Gibbs function expression for density. +% This function uses finite differences to calculate the temperature and +% pressure derivatives. +% +% Note that this function uses the full Gibbs function. There is an +% alternative to calling this function, namely gsw_thermobaric(SA,CT,p) +% which uses the computationally efficient 48-term expression for density +% in terms of SA, CT and p (IOC et al., 2010). +% +% INPUT: +% SA = Absolute Salinity [ g/kg ] +% CT = Conservative Temperature (ITS-90) [ deg C ] +% p = sea pressure [ dbar ] +% ( i.e. absolute pressure - 10.1325 dbar ) +% +% SA & CT need to have the same dimensions. +% p may have dimensions 1x1 or Mx1 or 1xN or MxN, where SA & CT are MxN. +% +% OUTPUT: +% thermobaric_CT_exact = thermobaric coefficient with [ 1/(K Pa) ] +% respect to Conservative Temperature. +% Note. The pressure derivative is taken with respect to +% pressure in Pa not dbar. +% +% AUTHOR: +% Trevor McDougall and Paul Barker [ help@teos-10.org ] +% +% VERSION NUMBER: 3.03 (5th April, 2013) +% +% 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 Eqns. (3.8.2) and (P.2) of this TEOS-10 manual. +% +% The software is available from http://www.TEOS-10.org +% +%========================================================================== + +%-------------------------------------------------------------------------- +% Check variables and resize if necessary +%-------------------------------------------------------------------------- + +if ~(nargin == 3) + error('gsw_thermobaric_CT_exact: Requires three inputs') +end %if + +[ms,ns] = size(SA); +[mt,nt] = size(CT); +[mp,np] = size(p); + +if (mt ~= ms | nt ~= ns) + error('gsw_thermobaric_CT_exact: SA and CT must have same dimensions') +end + +if (mp == 1) & (np == 1) % p scalar - fill to size of SA + p = p*ones(size(SA)); +elseif (ns == np) & (mp == 1) % p is row vector, + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (np == 1) % p is column vector, + p = p(:,ones(1,ns)); % copy across each row. +elseif (ns == mp) & (np == 1) % p is a transposed row vector, + p = p.'; % transposed then + p = p(ones(1,ms), :); % copy down each column. +elseif (ms == mp) & (ns == np) + % ok +else + error('gsw_thermobaric_CT_exact: Inputs array dimensions arguments do not agree') +end %if + +if ms == 1 + SA = SA.'; + CT = CT.'; + p = p.'; + transposed = 1; +else + transposed = 0; +end + +%-------------------------------------------------------------------------- +% Start of the calculation +%-------------------------------------------------------------------------- + +beta = gsw_beta_CT_exact(SA,CT,p); + +dp = 0.1; % pressure increment is 0.1 dbar (1000 Pa) +p_u = p - dp; +p_l = p + dp; + +alpha_on_beta_u = gsw_alpha_on_beta_CT_exact(SA,CT,p_u); +alpha_on_beta_l = gsw_alpha_on_beta_CT_exact(SA,CT,p_l); + +thermobaric_CT_exact = beta.*(alpha_on_beta_u - alpha_on_beta_l)./(p_u - p_l); +Pa2db = 1e-4; % To have units of 1/(K Pa) +thermobaric_CT_exact = thermobaric_CT_exact.*Pa2db; + + +if transposed + thermobaric_CT_exact = thermobaric_CT_exact.'; +end + +end diff --git a/Toolbox/gsw_uPS.m b/Toolbox/gsw_uPS.m index a4ecd94..c949727 100644 --- a/Toolbox/gsw_uPS.m +++ b/Toolbox/gsw_uPS.m @@ -16,7 +16,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_valence_factor.m b/Toolbox/gsw_valence_factor.m index ea621bd..ffa5249 100644 --- a/Toolbox/gsw_valence_factor.m +++ b/Toolbox/gsw_valence_factor.m @@ -20,7 +20,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_ver.m b/Toolbox/gsw_ver.m index a202699..8ecdbf3 100644 --- a/Toolbox/gsw_ver.m +++ b/Toolbox/gsw_ver.m @@ -1,6 +1,6 @@ function gsw_ver -% gsw_ver GSW Oceanographic toolbox version number +% gsw_ver GSW Oceanographic Toolbox version number %========================================================================== % % USAGE: @@ -8,12 +8,12 @@ % % DESCRIPTION: % This function displays the version number of the GSW Oceanographic -% toolbox. +% Toolbox. % % AUTHOR: % Paul Barker and Trevor McDougall [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (8th March, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/gsw_z_from_depth.m b/Toolbox/gsw_z_from_depth.m index af0e395..2f4568a 100644 --- a/Toolbox/gsw_z_from_depth.m +++ b/Toolbox/gsw_z_from_depth.m @@ -19,7 +19,7 @@ % AUTHOR: % Winston [ god@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % This software is available from http://www.TEOS-10.org % diff --git a/Toolbox/gsw_z_from_p.m b/Toolbox/gsw_z_from_p.m index be8d49f..eedcb8f 100644 --- a/Toolbox/gsw_z_from_p.m +++ b/Toolbox/gsw_z_from_p.m @@ -1,23 +1,25 @@ -function z = gsw_z_from_p(p,lat,geo_strf_dyn_height) +function z = gsw_z_from_p(p,lat,geo_strf_dyn_height,sea_surface_geopotental) % gsw_z_from_p height from pressure %========================================================================== % % USAGE: -% z = gsw_z_from_p(p,lat,{geo_strf_dyn_height}) +% z = gsw_z_from_p(p,lat,{geo_strf_dyn_height},{sea_surface_geopotental}) % % DESCRIPTION: % Calculates height from sea pressure using the computationally-efficient -% 48-term expression for density in terms of SA, CT and p (McDougall et -% al., 2013). Dynamic height anomaly, geo_strf_dyn_height, if provided, -% must be computed with its p_ref = 0 (the surface). +% 48-term expression for density in terms of SA, CT and p (IOC et al., +% 2010). Dynamic height anomaly, geo_strf_dyn_height, if provided, +% must be computed with its p_ref = 0 (the surface). Also if provided, +% sea_surface_geopotental is the geopotential at zero sea pressure. This +% function solves Eqn.(3.32.3) of IOC et al. (2010). % % Note. Height z is NEGATIVE in the ocean. i.e. Depth is -z. % Depth is not used in the GSW computer software library. % % 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. (2013). The GSW library function +% described in IOC et al. (2010). The GSW library function % "gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if % some of one's data lies outside this "funnel". % @@ -30,10 +32,11 @@ % geo_strf_dyn_height = dynamic height anomaly [ m^2/s^2 ] % Note that the refernce pressure, p_ref, of geo_strf_dyn_height must be % zero (0) dbar. +% sea_surface_geopotental = geopotential at zero sea pressure [ m^2/s^2 ] % % lat may have dimensions 1x1 or Mx1 or 1xN or MxN, where p is MxN. -% geo_strf_dyn_height, if provided, must have dimensions MxN which is -% the same as p. +% geo_strf_dyn_height and geo_strf_dyn_height, if provided, must have +% dimensions MxN, which are the same as p. % % OUTPUT: % z = height [ m ] @@ -45,7 +48,7 @@ % Trevor McDougall, Claire Roberts-Thomson & Paul Barker. % [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (19th July, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -53,11 +56,6 @@ % Intergovernmental Oceanographic Commission, Manuals and Guides No. 56, % UNESCO (English), 196 pp. Available from http://www.TEOS-10.org % -% 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. -% % Moritz (2000) Goedetic reference system 1980. J. Geodesy, 74, 128-133. % % This software is available from http://www.TEOS-10.org @@ -68,21 +66,29 @@ % Check variables and resize if necessary %-------------------------------------------------------------------------- -if ~(nargin == 2 | nargin == 3) - error('gsw_z_from_p: Requires two or three inputs') +if ~(nargin == 2 | nargin == 3 | nargin == 4) + error('gsw_z_from_p: Requires two, three or four inputs') end %if if ~exist('geo_strf_dyn_height','var') geo_strf_dyn_height = zeros(size(p)); end +if ~exist('sea_surface_geopotental','var') + sea_surface_geopotental = zeros(size(p)); +end [mp,np] = size(p); [ml,nl] = size(lat); [mdh,ndh] = size(geo_strf_dyn_height); +[msg,nsg] = size(sea_surface_geopotental); if (mp ~= mdh) | (np ~= ndh) error('gsw_z_from_p: pressure & dynamic height anomaly need to have the same dimensions') end +if (mdh ~= msg) | (ndh ~= nsg) + error('gsw_z_from_p: dynamic height anomaly & the geopotential at zero sea pressure need to have the same dimensions') +end + if (ml == 1) & (nl == 1) % lat scalar - fill to size of p lat = lat*ones(size(p)); @@ -103,6 +109,7 @@ p = p.'; lat = lat.'; geo_strf_dyn_height = geo_strf_dyn_height.'; + sea_surface_geopotental = sea_surface_geopotental.'; transposed = 1; else transposed = 0; @@ -112,14 +119,17 @@ % Start of the calculation %-------------------------------------------------------------------------- -gamma = 2.26e-7 ; -DEG2RAD = pi/180; -X = sin(lat*DEG2RAD); -sin2 = X.*X; -B = 9.780327*(1.0 + (5.2792e-3 + (2.32e-5*sin2)).*sin2); -A = -0.5*gamma*B ; -C = gsw_enthalpy_SSO_0_p(p) - geo_strf_dyn_height; -z = -2*C./(B + sqrt(B.*B - 4.*A.*C)); +gamma = 2.26e-7; % If the graviational acceleration were to be regarded as + % being depth-independent, which is often the case in + % ocean models, then gamma would be set to be zero here, + % and the code below works perfectly well. +deg2rad = pi/180; +X = sin(lat*deg2rad); +sin2 = X.*X; +B = 9.780327*(1.0 + (5.2792e-3 + (2.32e-5*sin2)).*sin2); +A = -0.5*gamma*B; +C = gsw_enthalpy_SSO_0_p(p) - (geo_strf_dyn_height + sea_surface_geopotental); +z = -2*C./(B + sqrt(B.*B - 4.*A.*C)); if transposed z = z.'; diff --git a/Toolbox/library/gsw_Fdelta.m b/Toolbox/library/gsw_Fdelta.m index 57ee5cc..7169fb3 100644 --- a/Toolbox/library/gsw_Fdelta.m +++ b/Toolbox/library/gsw_Fdelta.m @@ -34,7 +34,7 @@ % AUTHOR: % Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (7th January, 2013) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/library/gsw_Hill_ratio_at_SP2.m b/Toolbox/library/gsw_Hill_ratio_at_SP2.m index d938d7a..611ba0c 100644 --- a/Toolbox/library/gsw_Hill_ratio_at_SP2.m +++ b/Toolbox/library/gsw_Hill_ratio_at_SP2.m @@ -23,7 +23,7 @@ % AUTHOR: % Trevor McDougall and Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (16th November, 2012) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % Hill, K.D., T.M. Dauphinee & D.J. Woods, 1986: The extension of the @@ -107,11 +107,11 @@ %-------------------------------------------------------------------------- SP_est = a0 + (a1 + (a2 + (a3 + (a4 + a5.*Rtx0).*Rtx0).*Rtx0).*Rtx0).*Rtx0 ... + ft68.*(b0 + (b1 + (b2+ (b3 + (b4 + b5.*Rtx0).*Rtx0).*Rtx0).*Rtx0).*Rtx0); - Rtx = Rtx0 - (SP_est - SP2)./dSP_dRtx; - Rtxm = 0.5*(Rtx + Rtx0); +Rtx = Rtx0 - (SP_est - SP2)./dSP_dRtx; +Rtxm = 0.5*(Rtx + Rtx0); dSP_dRtx = a1 + (2*a2 + (3*a3 + (4*a4 + 5*a5.*Rtxm).*Rtxm).*Rtxm).*Rtxm... + ft68.*(b1 + (2*b2 + (3*b3 + (4*b4 + 5*b5.*Rtxm).*Rtxm).*Rtxm).*Rtxm); - Rtx = Rtx0 - (SP_est - SP2)./dSP_dRtx; +Rtx = Rtx0 - (SP_est - SP2)./dSP_dRtx; % This is the end of one full iteration of the modified Newton-Raphson % iterative equation solver. The error in Rtx at this point is equivalent diff --git a/Toolbox/library/gsw_SAAR.m b/Toolbox/library/gsw_SAAR.m index 8a0ede0..2b6829f 100644 --- a/Toolbox/library/gsw_SAAR.m +++ b/Toolbox/library/gsw_SAAR.m @@ -43,7 +43,7 @@ % Paul Barker and Trevor McDougall % Aknowlegments. Matlab programming assisance from Sunke Schmidtko. % -% VERSION NUMBER: 3.02 (7th January, 2013) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -255,7 +255,7 @@ % Paul Barker and Trevor McDougall % Aknowlegments. Matlab programming assisance from Sjoerd Groeskamp. % -% VERSION NUMBER: 3.02 (7th January, 2013) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of @@ -329,7 +329,7 @@ % MODIFIED: % Paul Barker and Trevor McDougall % -% VERSION NUMBER: 3.02 (7th January, 2013) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of diff --git a/Toolbox/library/gsw_SA_from_SP_Baltic.m b/Toolbox/library/gsw_SA_from_SP_Baltic.m index c729745..7306d65 100644 --- a/Toolbox/library/gsw_SA_from_SP_Baltic.m +++ b/Toolbox/library/gsw_SA_from_SP_Baltic.m @@ -24,7 +24,7 @@ % AUTHOR: % David Jackett, Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (7th January, 2013) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % Feistel, R., S. Weinreben, H. Wolf, S. Seitz, P. Spitzer, B. Adel, diff --git a/Toolbox/library/gsw_SP_from_SA_Baltic.m b/Toolbox/library/gsw_SP_from_SA_Baltic.m index 245a5d0..4ccb90b 100644 --- a/Toolbox/library/gsw_SP_from_SA_Baltic.m +++ b/Toolbox/library/gsw_SP_from_SA_Baltic.m @@ -23,7 +23,7 @@ % AUTHOR: % David Jackett, Trevor McDougall & Paul Barker [ help@teos-10.org ] % -% VERSION NUMBER: 3.02 (7th January, 2013) +% VERSION NUMBER: 3.03 (29th April, 2013) % % REFERENCES: % Feistel, R., S. Weinreben, H. Wolf, S. Seitz, P. Spitzer, B. Adel, diff --git a/Toolbox/library/gsw_data_v3_0.mat b/Toolbox/library/gsw_data_v3_0.mat index 2cbb759fee178b8a7a8e310a0481054d3a7ab421..a977039af5d365c44a3e06005bcc8967e2fd41ac 100644 GIT binary patch delta 26149 zcmZs?2UHW!-o*+kQllb*gj~*C$s20EIKcX&c~wjv*-dWx*&@##G(tc z=prn-D2u*?MHgeym$K;MEV=}XF3F-xvFOWKbZHh{hDDcU(dAflc@}*+i>|<;uVB#? zS@e}Gx)O`NibYpu(N$P1MOSChHCS{_7F~-)*JjamSoGB_`WhBpmqlO8qOW7o z^;mR$7TthFH)PR`Saf3+-GoIqWzo%8^z|(I1{U3%MYmwlEm?GgMMqh5z@k%FbSjH( z^_WhJWyYv?*p{ky*nO1}G9oP{kx25-*#hA-)1_+gm<<0OHYJgqwy_-}Xv^8kaWrA} zp>WzNHY=Q_#x5YhAuvdQKLSF7fDHj(0xSXr1ULi+3GhckXb`Z0;D`5c+VoHVcmz#? z2Nv!Jke9RlB5BHO7SXJL0EfUJ0sbfm4FWap^0fIw- z|00A20UH7wqJu#K{P7SP1Z)WS5@7u;5@&r0um}|V1#yByV32@D0!@akkU(2X9Kj9< z_!3|dC?LQgFbF}+B53%%C}Ni8)5O?oFVI%7ZHTe?5@7v3BF4rdQ1Ew@1O^H4Cqift zup!_}fJLBy0EfUJ0sbTi4FWa@Lz(^AYenl zmjH`E0RawyK?3|KG&PC;GaWqH+b+{&h5mWlPE?{KFACfIQvn?yDn$NM5%{wBqA$Tz{DgNH+?`#tg_V)Dh@;!R!*uj6gJCFz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