25 #ifndef GOBY_UTIL_SALINITY_H
26 #define GOBY_UTIL_SALINITY_H
30 #include <boost/units/quantity.hpp>
31 #include <boost/units/systems/si.hpp>
33 #include <boost/units/systems/temperature/celsius.hpp>
55 typename TemperatureUnit = boost::units::celsius::temperature,
56 typename PressureUnit = decltype(boost::units::si::deci*
bar)>
57 boost::units::quantity<boost::units::si::dimensionless>
59 boost::units::quantity<boost::units::absolute<TemperatureUnit> > temperature,
60 boost::units::quantity<PressureUnit>
pressure)
64 double T = quantity<absolute<celsius::temperature> >(temperature).value();
65 double P = quantity<decltype(si::deci * bar)>(
pressure).value();
67 return quantity<si::dimensionless>(
78 template <
typename TemperatureUnit = boost::units::celsius::temperature,
80 typename PressureUnit = decltype(boost::units::si::deci*
bar)>
83 boost::units::quantity<boost::units::absolute<TemperatureUnit> > temperature,
84 boost::units::quantity<PressureUnit>
pressure)
88 double T = quantity<absolute<celsius::temperature> >(temperature).value();
89 double P = quantity<decltype(si::deci * bar)>(
pressure).value();
103 template <
typename TemperatureUnit = boost::units::celsius::temperature,
104 typename PressureUnit = decltype(boost::units::si::deci*
bar)>
107 boost::units::quantity<boost::units::absolute<TemperatureUnit> > temperature,
108 boost::units::quantity<PressureUnit>
pressure)