22 #include "goby/util/seawater/salinity.h" 23 #include "goby/util/sci.h" 30 using goby::util::unbiased_round;
33 double test_conductivity_ratio = 1.888091;
34 const double CONDUCTIVITY_AT_STANDARD = 42.914;
35 double test_conductivity_mSiemens_cm = test_conductivity_ratio * CONDUCTIVITY_AT_STANDARD;
37 double test_temperature_deg_C = 40;
38 double test_pressure_dbar = 10000;
40 double calculated_salinity = SalinityCalculator::salinity(
41 test_conductivity_mSiemens_cm, test_temperature_deg_C, test_pressure_dbar);
43 std::cout <<
"calculated salinity: " << std::fixed << std::setprecision(5)
44 << calculated_salinity <<
" for T = " << test_temperature_deg_C <<
" deg C," 45 <<
" P = " << test_pressure_dbar <<
" dbar," 46 <<
" C = " << test_conductivity_mSiemens_cm <<
" mSiemens / cm" << std::endl;
48 assert(goby::util::unbiased_round(calculated_salinity, 5) == 40.00000);