33#ifndef WOSS_SSP_DEFINITIONS_H
34#define WOSS_SSP_DEFINITIONS_H
49 static constexpr inline double cf_C00 = (1402.388);
50 static constexpr inline double cf_A02 = (7.166e-5);
51 static constexpr inline double cf_C01 = (5.03830);
52 static constexpr inline double cf_A03 = (2.008e-6);
53 static constexpr inline double cf_C02 = (-5.81090e-2);
54 static constexpr inline double cf_A04 = (-3.21e-8);
55 static constexpr inline double cf_C03 = (3.3432e-4);
56 static constexpr inline double cf_A10 = (9.4742e-5);
57 static constexpr inline double cf_C04 = (-1.47797e-6);
58 static constexpr inline double cf_A11 = (-1.2583e-5);
59 static constexpr inline double cf_C05 = (3.1419e-9);
60 static constexpr inline double cf_A12 = (-6.4928e-8);
61 static constexpr inline double cf_C10 = (0.153563);
62 static constexpr inline double cf_A13 = (1.0515e-8);
63 static constexpr inline double cf_C11 = (6.8999e-4);
64 static constexpr inline double cf_A14 = (-2.0142e-10);
65 static constexpr inline double cf_C12 = (-8.1829e-6);
66 static constexpr inline double cf_A20 = (-3.9064e-7);
67 static constexpr inline double cf_C13 = (1.3632e-7);
68 static constexpr inline double cf_A21 = (9.1061e-9);
69 static constexpr inline double cf_C14 = (-6.1260e-10);
70 static constexpr inline double cf_A22 = (-1.6009e-10);
71 static constexpr inline double cf_C20 = (3.1260e-5);
72 static constexpr inline double cf_A23 = (7.994e-12);
73 static constexpr inline double cf_C21 = (-1.7111e-6);
74 static constexpr inline double cf_A30 = (1.100e-10);
75 static constexpr inline double cf_C22 = (2.5986e-8);
76 static constexpr inline double cf_A31 = (6.651e-12);
77 static constexpr inline double cf_C23 = (-2.5353e-10);
78 static constexpr inline double cf_A32 = (-3.391e-13);
79 static constexpr inline double cf_C24 = (1.0415e-12);
80 static constexpr inline double cf_B00 = (-1.922e-2);
81 static constexpr inline double cf_C30 = (-9.7729e-9);
82 static constexpr inline double cf_B01 = (-4.42e-5);
83 static constexpr inline double cf_C31 = (3.8513e-10);
84 static constexpr inline double cf_B10 = (7.3637e-5);
85 static constexpr inline double cf_C32 = (-2.3654e-12);
86 static constexpr inline double cf_B11 = (1.7950e-7);
87 static constexpr inline double cf_A00 = (1.389);
88 static constexpr inline double cf_D00 = (1.727e-3);
89 static constexpr inline double cf_A01 = (-1.262e-2);
90 static constexpr inline double cf_D10 = (-7.9836e-6);
93 static constexpr inline double TEO_10_c000 = -6.07991438090e-5;
94 static constexpr inline double TEO_10_c001 = 1.99712338438e-5;
95 static constexpr inline double TEO_10_c002 = -3.39280843110e-6;
96 static constexpr inline double TEO_10_c003 = 4.21246123200e-7;
97 static constexpr inline double TEO_10_c004 = -6.32363064300e-8;
98 static constexpr inline double TEO_10_c005 = 1.17681023580e-8;
99 static constexpr inline double TEO_10_c010 = 1.85057654290e-5;
100 static constexpr inline double TEO_10_c011 = -2.34727734620e-6;
101 static constexpr inline double TEO_10_c012 = -1.09581019659e-6;
102 static constexpr inline double TEO_10_c013 = 1.25816399608e-6;
103 static constexpr inline double TEO_10_c020 = -1.17166068530e-5;
104 static constexpr inline double TEO_10_c021 = 4.26100574800e-6;
105 static constexpr inline double TEO_10_c022 = 8.60877154770e-7;
106 static constexpr inline double TEO_10_c030 = 7.92796561730e-6;
107 static constexpr inline double TEO_10_c031 = -9.22650800740e-7;
108 static constexpr inline double TEO_10_c040 = -3.41021874820e-6;
109 static constexpr inline double TEO_10_c041 = -1.26705833028e-7;
110 static constexpr inline double TEO_10_c050 = 5.07367668140e-7;
111 static constexpr inline double TEO_10_c100 = 2.42624687470e-5;
112 static constexpr inline double TEO_10_c101 = -1.16968865968e-6;
113 static constexpr inline double TEO_10_c102 = 1.08930565545e-6;
114 static constexpr inline double TEO_10_c103 = -4.45885016920e-7;
115 static constexpr inline double TEO_10_c110 = -9.56770881560e-6;
116 static constexpr inline double TEO_10_c111 = -1.11398309114e-5;
117 static constexpr inline double TEO_10_c112 = -8.18870887110e-7;
118 static constexpr inline double TEO_10_c120 = -2.36783083610e-7;
119 static constexpr inline double TEO_10_c121 = 7.82747741600e-7;
120 static constexpr inline double TEO_10_c130 = -3.45587736550e-6;
121 static constexpr inline double TEO_10_c131 = 1.55237776184e-8;
122 static constexpr inline double TEO_10_c140 = 1.29567177830e-6;
123 static constexpr inline double TEO_10_c200 = -3.47924609740e-5;
124 static constexpr inline double TEO_10_c201 = -9.62445031940e-6;
125 static constexpr inline double TEO_10_c202 = 5.02389113400e-8;
126 static constexpr inline double TEO_10_c210 = 1.11008347650e-5;
127 static constexpr inline double TEO_10_c211 = 1.09241497668e-5;
128 static constexpr inline double TEO_10_c220 = 2.92833462950e-6;
129 static constexpr inline double TEO_10_c221 = -1.31462208134e-6;
130 static constexpr inline double TEO_10_c230 = 3.16553060780e-7;
131 static constexpr inline double TEO_10_c300 = 3.74707773050e-5;
132 static constexpr inline double TEO_10_c301 = 9.85262139960e-6;
133 static constexpr inline double TEO_10_c310 = -9.84471178440e-6;
134 static constexpr inline double TEO_10_c311 = -2.70883712540e-6;
135 static constexpr inline double TEO_10_c320 = -4.88261392000e-7;
136 static constexpr inline double TEO_10_c400 = -1.73222186120e-5;
137 static constexpr inline double TEO_10_c401 = -3.56239494540e-6;
138 static constexpr inline double TEO_10_c410 = 2.59092252600e-6;
139 static constexpr inline double TEO_10_c500 = 3.09274272530e-6;
140 static constexpr inline double TEO_10_v000 = 1.0769995862e-3;
141 static constexpr inline double TEO_10_v001 = -6.0799143809e-5;
142 static constexpr inline double TEO_10_v002 = 9.9856169219e-6;
143 static constexpr inline double TEO_10_v003 = -1.1309361437e-6;
144 static constexpr inline double TEO_10_v004 = 1.0531153080e-7;
145 static constexpr inline double TEO_10_v005 = -1.2647261286e-8;
146 static constexpr inline double TEO_10_v006 = 1.9613503930e-9;
147 static constexpr inline double TEO_10_v010 = -3.1038981976e-4;
148 static constexpr inline double TEO_10_v011 = 2.4262468747e-5;
149 static constexpr inline double TEO_10_v012 = -5.8484432984e-7;
150 static constexpr inline double TEO_10_v013 = 3.6310188515e-7;
151 static constexpr inline double TEO_10_v014 = -1.1147125423e-7;
152 static constexpr inline double TEO_10_v020 = 6.6928067038e-4;
153 static constexpr inline double TEO_10_v021 = -3.4792460974e-5;
154 static constexpr inline double TEO_10_v022 = -4.8122251597e-6;
155 static constexpr inline double TEO_10_v023 = 1.6746303780e-8;
156 static constexpr inline double TEO_10_v030 = -8.5047933937e-4;
157 static constexpr inline double TEO_10_v031 = 3.7470777305e-5;
158 static constexpr inline double TEO_10_v032 = 4.9263106998e-6;
159 static constexpr inline double TEO_10_v040 = 5.8086069943e-4;
160 static constexpr inline double TEO_10_v041 = -1.7322218612e-5;
161 static constexpr inline double TEO_10_v042 = -1.7811974727e-6;
162 static constexpr inline double TEO_10_v050 = -2.1092370507e-4;
163 static constexpr inline double TEO_10_v051 = 3.0927427253e-6;
164 static constexpr inline double TEO_10_v060 = 3.1932457305e-5;
165 static constexpr inline double TEO_10_v100 = -1.5649734675e-5;
166 static constexpr inline double TEO_10_v101 = 1.8505765429e-5;
167 static constexpr inline double TEO_10_v102 = -1.1736386731e-6;
168 static constexpr inline double TEO_10_v103 = -3.6527006553e-7;
169 static constexpr inline double TEO_10_v104 = 3.1454099902e-7;
170 static constexpr inline double TEO_10_v110 = 3.5009599764e-5;
171 static constexpr inline double TEO_10_v111 = -9.5677088156e-6;
172 static constexpr inline double TEO_10_v112 = -5.5699154557e-6;
173 static constexpr inline double TEO_10_v113 = -2.7295696237e-7;
174 static constexpr inline double TEO_10_v120 = -4.3592678561e-5;
175 static constexpr inline double TEO_10_v121 = 1.1100834765e-5;
176 static constexpr inline double TEO_10_v122 = 5.4620748834e-6;
177 static constexpr inline double TEO_10_v130 = 3.4532461828e-5;
178 static constexpr inline double TEO_10_v131 = -9.8447117844e-6;
179 static constexpr inline double TEO_10_v132 = -1.3544185627e-6;
180 static constexpr inline double TEO_10_v140 = -1.1959409788e-5;
181 static constexpr inline double TEO_10_v141 = 2.5909225260e-6;
182 static constexpr inline double TEO_10_v150 = 1.3864594581e-6;
183 static constexpr inline double TEO_10_v200 = 2.7762106484e-5;
184 static constexpr inline double TEO_10_v201 = -1.1716606853e-5;
185 static constexpr inline double TEO_10_v202 = 2.1305028740e-6;
186 static constexpr inline double TEO_10_v203 = 2.8695905159e-7;
187 static constexpr inline double TEO_10_v210 = -3.7435842344e-5;
188 static constexpr inline double TEO_10_v211 = -2.3678308361e-7;
189 static constexpr inline double TEO_10_v212 = 3.9137387080e-7;
190 static constexpr inline double TEO_10_v220 = 3.5907822760e-5;
191 static constexpr inline double TEO_10_v221 = 2.9283346295e-6;
192 static constexpr inline double TEO_10_v222 = -6.5731104067e-7;
193 static constexpr inline double TEO_10_v230 = -1.8698584187e-5;
194 static constexpr inline double TEO_10_v231 = -4.8826139200e-7;
195 static constexpr inline double TEO_10_v240 = 3.8595339244e-6;
196 static constexpr inline double TEO_10_v300 = -1.6521159259e-5;
197 static constexpr inline double TEO_10_v301 = 7.9279656173e-6;
198 static constexpr inline double TEO_10_v302 = -4.6132540037e-7;
199 static constexpr inline double TEO_10_v310 = 2.4141479483e-5;
200 static constexpr inline double TEO_10_v311 = -3.4558773655e-6;
201 static constexpr inline double TEO_10_v312 = 7.7618888092e-9;
202 static constexpr inline double TEO_10_v320 = -1.4353633048e-5;
203 static constexpr inline double TEO_10_v321 = 3.1655306078e-7;
204 static constexpr inline double TEO_10_v330 = 2.2863324556e-6;
205 static constexpr inline double TEO_10_v400 = 6.9111322702e-6;
206 static constexpr inline double TEO_10_v401 = -3.4102187482e-6;
207 static constexpr inline double TEO_10_v402 = -6.3352916514e-8;
208 static constexpr inline double TEO_10_v410 = -8.7595873154e-6;
209 static constexpr inline double TEO_10_v411 = 1.2956717783e-6;
210 static constexpr inline double TEO_10_v420 = 4.3703680598e-6;
211 static constexpr inline double TEO_10_v500 = -8.0539615540e-7;
212 static constexpr inline double TEO_10_v501 = 5.0736766814e-7;
213 static constexpr inline double TEO_10_v510 = -3.3052758900e-7;
214 static constexpr inline double TEO_10_v600 = 2.0543094268e-7;
216 static constexpr inline double TEO_10_gsw_sfac = (0.0248826675584615);
217 static constexpr inline double TEO_10_offset = (5.971840214030754e-1);
226 using DRIter = DepthMap::reverse_iterator;
233 static constexpr inline double SSP_CUSTOM_DEPTH_PRECISION = (1.0e-6);
238 static constexpr inline double SSP_CUSTOM_DEPTH_STEPS = (20.0);
322 virtual std::unique_ptr<SSP>
clone()
const {
return std::make_unique<SSP>(*
this); }
550 virtual std::unique_ptr<SSP>
transform(
const Coord& coordinates,
double new_min_depth = -HUGE_VAL,
double new_max_depth = HUGE_VAL,
int total_depth_steps = SSP_CUSTOM_DEPTH_STEPS )
const;
558 virtual std::unique_ptr<SSP>
truncate(
double max_depth )
const;
566 virtual std::unique_ptr<SSP>
fullRandomize(
double ratio_incr_value )
const;
573 virtual std::unique_ptr<SSP>
randomize(
double ratio_incr_value )
const;
580 virtual bool import( std::istream& stream_in );
587 virtual bool write( std::ostream& stream_out )
const;
606 SSP&
insertValue(
double depth,
double temperature,
double salinity,
const std::complex<double>& pressure,
double ssp_value );
616 SSP&
insertValue(
double temperature,
double salinity,
const std::complex<double>& pressure,
const Coord& coordinates =
Coord( 0.0, 0.0) );
890 friend std::ostream&
operator<<( std::ostream& os,
const SSP& instance );
962 constexpr double calculateSSP(
double temperature,
double salinity,
double pressure )
const;
1061 constexpr double thyh(
double z )
const;
1067 constexpr double g(
double lat )
const;
1074 constexpr double k(
double z,
double lat )
const;
1080 constexpr double hq(
double z )
const;
1087 constexpr double h(
double z,
double lat )
const;
1108 constexpr double g_z(
double lat )
const;
1130 constexpr double d(
double t,
double p )
const;
1137 constexpr double b(
double t,
double p )
const;
1144 constexpr double a(
double t,
double p )
const;
1151 constexpr double cw(
double t,
double p )
const;
1162 constexpr double gibbs(
int ns,
int nt,
int np,
double sa,
double t,
double p)
const;
1169 SSP&
operator+=( SSP& left,
const SSP& right );
1171 SSP&
operator-=( SSP& left,
const SSP& right );
1173 SSP&
operator*=( SSP& left,
const SSP& right );
1175 SSP&
operator/=( SSP& left,
const SSP& right );
1178 SSP&
operator+=( SSP& left,
const double right );
1180 SSP&
operator-=( SSP& left,
const double right );
1182 SSP&
operator/=( SSP& left,
const double right );
1184 SSP&
operator*=( SSP& left,
const double right );
1190 if ( &left == &right )
1197 if ( &left == &right )
1203 SSP ret_val ( left );
1209 SSP ret_val ( left );
1215 SSP ret_val ( left );
1222 SSP ret_val ( left );
1228 SSP ret_val ( left );
1234 SSP ret_val ( left );
1240 SSP ret_val ( left );
1246 SSP ret_val ( left );
1252 SSP ret_val ( right );
1258 SSP ret_val ( right );
1264 SSP ret_val ( right );
1270 SSP ret_val ( right );
1276 if ( !instance.
write( os ) )
1277 os.setstate( std::ios_base::failbit );
1282 if ( !instance.
import( is ) )
1283 is.setstate( std::ios_base::failbit );
1288 return (1.0e-2 * z/(z+100) + 6.2e-6 * z);
1291 inline constexpr double SSP::g(
double lat )
const {
1292 return( 9.7803*(1.0 + 5.3e-3 * pow(sin(lat),2.0)) );
1295 inline constexpr double SSP::k(
double z,
double lat )
const {
1296 return( (
g(lat) - 2e-5 * z) / (9.80612 - 2e-5 * z) );
1299 inline constexpr double SSP::hq(
double z )
const {
1300 return( 1.00818e-2 * z + 2.465e-8 * pow(z,2.0) - 1.25e-13 * pow(z,3.0) + 2.8e-19 * pow(z,4.0) );
1303 inline constexpr double SSP::h(
double z,
double lat )
const {
1304 return(
hq(z) *
k(z,lat) );
1308 return( 9.780318 * ( 1.0 + 5.2788 * 10e-3 * pow(sin(lat), 2.0) + 2.36 * 10e-5 * pow(sin(lat),4.0) ) );
1311 inline constexpr double SSP::calculateSSP(
double temperature,
double salinity,
double pressure)
const {
1314 return(
cw(temperature, pressure) +
a(temperature, pressure)*salinity
1315 +
b(temperature, pressure) * std::sqrt(salinity*salinity*salinity)
1316 +
d(temperature, pressure) * (salinity*salinity) );
1322 auto xs = std::sqrt(TEO_10_gsw_sfac*salinity + TEO_10_offset);
1323 auto ys = temperature*0.025;
1324 auto z = pressure*1e-4;
1326 auto v = TEO_10_v000
1327 + xs*(TEO_10_v010 + xs*(TEO_10_v020 + xs*(TEO_10_v030 + xs*(TEO_10_v040 + xs*(TEO_10_v050
1328 + TEO_10_v060*xs))))) + ys*(TEO_10_v100 + xs*(TEO_10_v110 + xs*(TEO_10_v120 + xs*(TEO_10_v130 + xs*(TEO_10_v140
1329 + TEO_10_v150*xs)))) + ys*(TEO_10_v200 + xs*(TEO_10_v210 + xs*(TEO_10_v220 + xs*(TEO_10_v230 + TEO_10_v240*xs)))
1330 + ys*(TEO_10_v300 + xs*(TEO_10_v310 + xs*(TEO_10_v320 + TEO_10_v330*xs)) + ys*(TEO_10_v400 + xs*(TEO_10_v410
1331 + TEO_10_v420*xs) + ys*(TEO_10_v500 + TEO_10_v510*xs + TEO_10_v600*ys))))) + z*(TEO_10_v001 + xs*(TEO_10_v011
1332 + xs*(TEO_10_v021 + xs*(TEO_10_v031 + xs*(TEO_10_v041 + TEO_10_v051*xs)))) + ys*(TEO_10_v101 + xs*(TEO_10_v111
1333 + xs*(TEO_10_v121 + xs*(TEO_10_v131 + TEO_10_v141*xs))) + ys*(TEO_10_v201 + xs*(TEO_10_v211 + xs*(TEO_10_v221
1334 + TEO_10_v231*xs)) + ys*(TEO_10_v301 + xs*(TEO_10_v311 + TEO_10_v321*xs) + ys*(TEO_10_v401 + TEO_10_v411*xs
1335 + TEO_10_v501*ys)))) + z*(TEO_10_v002 + xs*(TEO_10_v012 + xs*(TEO_10_v022 + xs*(TEO_10_v032 + TEO_10_v042*xs)))
1336 + ys*(TEO_10_v102 + xs*(TEO_10_v112 + xs*(TEO_10_v122 + TEO_10_v132*xs)) + ys*(TEO_10_v202 + xs*(TEO_10_v212
1337 + TEO_10_v222*xs) + ys*(TEO_10_v302 + TEO_10_v312*xs + TEO_10_v402*ys))) + z*(TEO_10_v003 + xs*(TEO_10_v013
1338 + TEO_10_v023*xs) + ys*(TEO_10_v103 + TEO_10_v113*xs + TEO_10_v203*ys) + z*(TEO_10_v004 + TEO_10_v014*xs + TEO_10_v104*ys
1339 + z*(TEO_10_v005 + TEO_10_v006*z)))));
1341 auto v_p = TEO_10_c000
1342 + xs*(TEO_10_c100 + xs*(TEO_10_c200 + xs*(TEO_10_c300 + xs*(TEO_10_c400 + TEO_10_c500*xs))))
1343 + ys*(TEO_10_c010 + xs*(TEO_10_c110 + xs*(TEO_10_c210 + xs*(TEO_10_c310 + TEO_10_c410*xs))) + ys*(TEO_10_c020
1344 + xs*(TEO_10_c120 + xs*(TEO_10_c220 + TEO_10_c320*xs)) + ys*(TEO_10_c030 + xs*(TEO_10_c130 + TEO_10_c230*xs)
1345 + ys*(TEO_10_c040 + TEO_10_c140*xs + TEO_10_c050*ys)))) + z*(TEO_10_c001 + xs*(TEO_10_c101 + xs*(TEO_10_c201
1346 + xs*(TEO_10_c301 + TEO_10_c401*xs))) + ys*(TEO_10_c011 + xs*(TEO_10_c111 + xs*(TEO_10_c211 + TEO_10_c311*xs))
1347 + ys*(TEO_10_c021 + xs*(TEO_10_c121 + TEO_10_c221*xs) + ys*(TEO_10_c031 + TEO_10_c131*xs + TEO_10_c041*ys)))
1348 + z*( TEO_10_c002 + xs*(TEO_10_c102 + TEO_10_c202*xs) + ys*(TEO_10_c012 + TEO_10_c112*xs + TEO_10_c022*ys)
1349 + z*(TEO_10_c003 + TEO_10_c103*xs + TEO_10_c013*ys + z*(TEO_10_c004 + TEO_10_c005*z))));
1351 return (10000.0*std::sqrt(-v*v/v_p));
1355 int n0=0, n1=1, n2=2;
1359 auto g_tt =
gibbs(n0, n2, n0, salinity, temperature, pressure);
1360 auto g_tp =
gibbs(n0, n1, n1, salinity, temperature, pressure);
1362 return (
gibbs(n0, n0, n1, salinity, temperature, pressure) * std::sqrt(g_tt/(g_tp*g_tp - g_tt*
gibbs(n0, n0, n2, salinity, temperature, pressure))));
1364 else return -HUGE_VAL;
1367 inline constexpr double SSP::gibbs(
int ns,
int nt,
int np,
double sa,
double t,
double p)
const
1371 double return_value = 0.0;
1373 auto x2 = TEO_10_gsw_sfac*sa;
1378 if (ns == 0 && nt == 0 && np == 0) {
1379 g03 = 101.342743139674 + z*(100015.695367145 +
1380 z*(-2544.5765420363 + z*(284.517778446287 +
1381 z*(-33.3146754253611 + (4.20263108803084 -
1382 0.546428511471039*z)*z)))) +
1383 y*(5.90578347909402 + z*(-270.983805184062 +
1384 z*(776.153611613101 + z*(-196.51255088122 +
1385 (28.9796526294175 - 2.13290083518327*z)*z))) +
1386 y*(-12357.785933039 + z*(1455.0364540468 +
1387 z*(-756.558385769359 + z*(273.479662323528 +
1388 z*(-55.5604063817218 + 4.34420671917197*z)))) +
1389 y*(736.741204151612 + z*(-672.50778314507 +
1390 z*(499.360390819152 + z*(-239.545330654412 +
1391 (48.8012518593872 - 1.66307106208905*z)*z))) +
1392 y*(-148.185936433658 + z*(397.968445406972 +
1393 z*(-301.815380621876 + (152.196371733841 -
1394 26.3748377232802*z)*z)) +
1395 y*(58.0259125842571 + z*(-194.618310617595 +
1396 z*(120.520654902025 + z*(-55.2723052340152 +
1397 6.48190668077221*z))) +
1398 y*(-18.9843846514172 + y*(3.05081646487967 -
1399 9.63108119393062*z) +
1400 z*(63.5113936641785 + z*(-22.2897317140459 +
1401 8.17060541818112*z))))))));
1403 g08 = x2*(1416.27648484197 + z*(-3310.49154044839 +
1404 z*(384.794152978599 + z*(-96.5324320107458 +
1405 (15.8408172766824 - 2.62480156590992*z)*z))) +
1406 x*(-2432.14662381794 + x*(2025.80115603697 +
1407 y*(543.835333000098 + y*(-68.5572509204491 +
1408 y*(49.3667694856254 + y*(-17.1397577419788 +
1409 2.49697009569508*y))) - 22.6683558512829*z) +
1410 x*(-1091.66841042967 - 196.028306689776*y +
1411 x*(374.60123787784 - 48.5891069025409*x +
1412 36.7571622995805*y) + 36.0284195611086*z) +
1413 z*(-54.7919133532887 + (-4.08193978912261 -
1414 30.1755111971161*z)*z)) +
1415 z*(199.459603073901 + z*(-52.2940909281335 +
1416 (68.0444942726459 - 3.41251932441282*z)*z)) +
1417 y*(-493.407510141682 + z*(-175.292041186547 +
1418 (83.1923927801819 - 29.483064349429*z)*z) +
1419 y*(-43.0664675978042 + z*(383.058066002476 +
1420 z*(-54.1917262517112 + 25.6398487389914*z)) +
1421 y*(-10.0227370861875 - 460.319931801257*z +
1422 y*(0.875600661808945 + 234.565187611355*z))))) +
1423 y*(168.072408311545 + z*(729.116529735046 +
1424 z*(-343.956902961561 + z*(124.687671116248 +
1425 z*(-31.656964386073 + 7.04658803315449*z)))) +
1426 y*(880.031352997204 + y*(-225.267649263401 +
1427 y*(91.4260447751259 + y*(-21.6603240875311 +
1428 2.13016970847183*y) +
1429 z*(-297.728741987187 + (74.726141138756 -
1430 36.4872919001588*z)*z)) +
1431 z*(694.244814133268 + z*(-204.889641964903 +
1432 (113.561697840594 - 11.1282734326413*z)*z))) +
1433 z*(-860.764303783977 + z*(337.409530269367 +
1434 z*(-178.314556207638 + (44.2040358308 -
1435 7.92001547211682*z)*z))))));
1438 g08 = g08 + x2*(5812.81456626732 +
1439 851.226734946706*y)*log(x);
1441 return_value = g03 + g08;
1443 else if (ns == 1 && nt == 0 && np == 0) {
1444 g08 = 8645.36753595126 + z*(-6620.98308089678 +
1445 z*(769.588305957198 + z*(-193.0648640214916 +
1446 (31.6816345533648 - 5.24960313181984*z)*z))) +
1447 x*(-7296.43987145382 + x*(8103.20462414788 +
1448 y*(2175.341332000392 + y*(-274.2290036817964 +
1449 y*(197.4670779425016 + y*(-68.5590309679152 +
1450 9.98788038278032*y))) - 90.6734234051316*z) +
1451 x*(-5458.34205214835 - 980.14153344888*y +
1452 x*(2247.60742726704 - 340.1237483177863*x +
1453 220.542973797483*y) + 180.142097805543*z) +
1454 z*(-219.1676534131548 + (-16.32775915649044 -
1455 120.7020447884644*z)*z)) +
1456 z*(598.378809221703 + z*(-156.8822727844005 +
1457 (204.1334828179377 - 10.23755797323846*z)*z)) +
1458 y*(-1480.222530425046 + z*(-525.876123559641 +
1459 (249.57717834054571 - 88.449193048287*z)*z) +
1460 y*(-129.1994027934126 + z*(1149.174198007428 +
1461 z*(-162.5751787551336 + 76.9195462169742*z)) +
1462 y*(-30.0682112585625 - 1380.9597954037708*z +
1463 y*(2.626801985426835 + 703.695562834065*z))))) +
1464 y*(1187.3715515697959 + z*(1458.233059470092 +
1465 z*(-687.913805923122 + z*(249.375342232496 +
1466 z*(-63.313928772146 + 14.09317606630898*z)))) +
1467 y*(1760.062705994408 + y*(-450.535298526802 +
1468 y*(182.8520895502518 + y*(-43.3206481750622 +
1469 4.26033941694366*y) +
1470 z*(-595.457483974374 + (149.452282277512 -
1471 72.9745838003176*z)*z)) +
1472 z*(1388.489628266536 + z*(-409.779283929806 +
1473 (227.123395681188 - 22.2565468652826*z)*z))) +
1474 z*(-1721.528607567954 + z*(674.819060538734 +
1475 z*(-356.629112415276 + (88.4080716616 -
1476 15.84003094423364*z)*z)))));
1479 g08 = g08 + (11625.62913253464 + 1702.453469893412*y)*log(x);
1483 return_value = 0.5*TEO_10_gsw_sfac*g08;
1485 else if (ns == 0 && nt == 1 && np == 0) {
1486 g03 = 5.90578347909402 + z*(-270.983805184062 +
1487 z*(776.153611613101 + z*(-196.51255088122 +
1488 (28.9796526294175 - 2.13290083518327*z)*z))) +
1489 y*(-24715.571866078 + z*(2910.0729080936 +
1490 z*(-1513.116771538718 + z*(546.959324647056 +
1491 z*(-111.1208127634436 + 8.68841343834394*z)))) +
1492 y*(2210.2236124548363 + z*(-2017.52334943521 +
1493 z*(1498.081172457456 + z*(-718.6359919632359 +
1494 (146.4037555781616 - 4.9892131862671505*z)*z))) +
1495 y*(-592.743745734632 + z*(1591.873781627888 +
1496 z*(-1207.261522487504 + (608.785486935364 -
1497 105.4993508931208*z)*z)) +
1498 y*(290.12956292128547 + z*(-973.091553087975 +
1499 z*(602.603274510125 + z*(-276.361526170076 +
1500 32.40953340386105*z))) +
1501 y*(-113.90630790850321 + y*(21.35571525415769 -
1502 67.41756835751434*z) +
1503 z*(381.06836198507096 + z*(-133.7383902842754 +
1504 49.023632509086724*z)))))));
1506 g08 = x2*(168.072408311545 + z*(729.116529735046 +
1507 z*(-343.956902961561 + z*(124.687671116248 +
1508 z*(-31.656964386073 + 7.04658803315449*z)))) +
1509 x*(-493.407510141682 + x*(543.835333000098 +
1510 x*(-196.028306689776 + 36.7571622995805*x) +
1511 y*(-137.1145018408982 + y*(148.10030845687618 +
1512 y*(-68.5590309679152 + 12.4848504784754*y))) -
1513 22.6683558512829*z) + z*(-175.292041186547 +
1514 (83.1923927801819 - 29.483064349429*z)*z) +
1515 y*(-86.1329351956084 + z*(766.116132004952 +
1516 z*(-108.3834525034224 + 51.2796974779828*z)) +
1517 y*(-30.0682112585625 - 1380.9597954037708*z +
1518 y*(3.50240264723578 + 938.26075044542*z)))) +
1519 y*(1760.062705994408 + y*(-675.802947790203 +
1520 y*(365.7041791005036 + y*(-108.30162043765552 +
1521 12.78101825083098*y) +
1522 z*(-1190.914967948748 + (298.904564555024 -
1523 145.9491676006352*z)*z)) +
1524 z*(2082.7344423998043 + z*(-614.668925894709 +
1525 (340.685093521782 - 33.3848202979239*z)*z))) +
1526 z*(-1721.528607567954 + z*(674.819060538734 +
1527 z*(-356.629112415276 + (88.4080716616 -
1528 15.84003094423364*z)*z)))));
1531 g08 = g08 + 851.226734946706*x2*log(x);
1533 return_value = (g03 + g08)*0.025;
1535 else if (ns == 0 && nt == 0 && np == 1) {
1536 g03 = 100015.695367145 + z*(-5089.1530840726 +
1537 z*(853.5533353388611 + z*(-133.2587017014444 +
1538 (21.0131554401542 - 3.278571068826234*z)*z))) +
1539 y*(-270.983805184062 + z*(1552.307223226202 +
1540 z*(-589.53765264366 + (115.91861051767 -
1541 10.664504175916349*z)*z)) +
1542 y*(1455.0364540468 + z*(-1513.116771538718 +
1543 z*(820.438986970584 + z*(-222.2416255268872 +
1544 21.72103359585985*z))) +
1545 y*(-672.50778314507 + z*(998.720781638304 +
1546 z*(-718.6359919632359 + (195.2050074375488 -
1547 8.31535531044525*z)*z)) +
1548 y*(397.968445406972 + z*(-603.630761243752 +
1549 (456.589115201523 - 105.4993508931208*z)*z) +
1550 y*(-194.618310617595 + y*(63.5113936641785 -
1551 9.63108119393062*y +
1552 z*(-44.5794634280918 + 24.511816254543362*z)) +
1553 z*(241.04130980405 + z*(-165.8169157020456 +
1554 25.92762672308884*z)))))));
1556 g08 = x2*(-3310.49154044839 + z*(769.588305957198 +
1557 z*(-289.5972960322374 + (63.3632691067296 -
1558 13.1240078295496*z)*z)) +
1559 x*(199.459603073901 + x*(-54.7919133532887 +
1560 36.0284195611086*x - 22.6683558512829*y +
1561 (-8.16387957824522 - 90.52653359134831*z)*z) +
1562 z*(-104.588181856267 + (204.1334828179377 -
1563 13.65007729765128*z)*z) +
1564 y*(-175.292041186547 + (166.3847855603638 -
1565 88.449193048287*z)*z +
1566 y*(383.058066002476 + y*(-460.319931801257 +
1567 234.565187611355*y) +
1568 z*(-108.3834525034224 + 76.9195462169742*z)))) +
1569 y*(729.116529735046 + z*(-687.913805923122 +
1570 z*(374.063013348744 + z*(-126.627857544292 +
1571 35.23294016577245*z))) +
1572 y*(-860.764303783977 + y*(694.244814133268 +
1573 y*(-297.728741987187 + (149.452282277512 -
1574 109.46187570047641*z)*z) +
1575 z*(-409.779283929806 + (340.685093521782 -
1576 44.5130937305652*z)*z)) +
1577 z*(674.819060538734 + z*(-534.943668622914 +
1578 (176.8161433232 - 39.600077360584095*z)*z)))));
1580 return_value = (g03 + g08)*1.0e-8;
1582 else if (ns == 0 && nt == 2 && np == 0) {
1583 g03 = -24715.571866078 + z*(2910.0729080936 + z*
1584 (-1513.116771538718 + z*(546.959324647056 +
1585 z*(-111.1208127634436 + 8.68841343834394*z)))) +
1586 y*(4420.4472249096725 + z*(-4035.04669887042 +
1587 z*(2996.162344914912 + z*(-1437.2719839264719 +
1588 (292.8075111563232 - 9.978426372534301*z)*z))) +
1589 y*(-1778.231237203896 + z*(4775.621344883664 +
1590 z*(-3621.784567462512 + (1826.356460806092 -
1591 316.49805267936244*z)*z)) +
1592 y*(1160.5182516851419 + z*(-3892.3662123519 +
1593 z*(2410.4130980405 + z*(-1105.446104680304 +
1594 129.6381336154442*z))) +
1595 y*(-569.531539542516 + y*(128.13429152494615 -
1596 404.50541014508605*z) +
1597 z*(1905.341809925355 + z*(-668.691951421377 +
1598 245.11816254543362*z))))));
1600 g08 = x2*(1760.062705994408 + x*(-86.1329351956084 +
1601 x*(-137.1145018408982 + y*(296.20061691375236 +
1602 y*(-205.67709290374563 + 49.9394019139016*y))) +
1603 z*(766.116132004952 + z*(-108.3834525034224 +
1604 51.2796974779828*z)) +
1605 y*(-60.136422517125 - 2761.9195908075417*z +
1606 y*(10.50720794170734 + 2814.78225133626*z))) +
1607 y*(-1351.605895580406 + y*(1097.1125373015109 +
1608 y*(-433.20648175062206 + 63.905091254154904*y) +
1609 z*(-3572.7449038462437 + (896.713693665072 -
1610 437.84750280190565*z)*z)) +
1611 z*(4165.4688847996085 + z*(-1229.337851789418 +
1612 (681.370187043564 - 66.7696405958478*z)*z))) +
1613 z*(-1721.528607567954 + z*(674.819060538734 +
1614 z*(-356.629112415276 + (88.4080716616 -
1615 15.84003094423364*z)*z))));
1617 return_value = (g03 + g08)*0.000625;
1619 else if (ns == 1 && nt == 0 && np == 1) {
1620 g08 = -6620.98308089678 + z*(1539.176611914396 +
1621 z*(-579.1945920644748 + (126.7265382134592 -
1622 26.2480156590992*z)*z)) +
1623 x*(598.378809221703 + x*(-219.1676534131548 +
1624 180.142097805543*x - 90.6734234051316*y +
1625 (-32.65551831298088 - 362.10613436539325*z)*z) +
1626 z*(-313.764545568801 + (612.4004484538132 -
1627 40.95023189295384*z)*z) +
1628 y*(-525.876123559641 + (499.15435668109143 -
1629 265.347579144861*z)*z +
1630 y*(1149.174198007428 + y*(-1380.9597954037708 +
1631 703.695562834065*y) +
1632 z*(-325.1503575102672 + 230.7586386509226*z)))) +
1633 y*(1458.233059470092 + z*(-1375.827611846244 +
1634 z*(748.126026697488 + z*(-253.255715088584 +
1635 70.4658803315449*z))) +
1636 y*(-1721.528607567954 + y*(1388.489628266536 +
1637 y*(-595.457483974374 + (298.904564555024 -
1638 218.92375140095282*z)*z) +
1639 z*(-819.558567859612 + (681.370187043564 -
1640 89.0261874611304*z)*z)) +
1641 z*(1349.638121077468 + z*(-1069.887337245828 +
1642 (353.6322866464 - 79.20015472116819*z)*z))));
1644 return_value = g08*TEO_10_gsw_sfac*0.5e-8;
1646 else if (ns == 0 && nt == 1 && np == 1) {
1647 g03 = -270.983805184062 + z*(1552.307223226202 +
1648 z*(-589.53765264366 + (115.91861051767 -
1649 10.664504175916349*z)*z)) +
1650 y*(2910.0729080936 + z*(-3026.233543077436 +
1651 z*(1640.877973941168 + z*(-444.4832510537744 +
1652 43.4420671917197*z))) +
1653 y*(-2017.52334943521 + z*(2996.162344914912 +
1654 z*(-2155.907975889708 + (585.6150223126464 -
1655 24.946065931335752*z)*z)) +
1656 y*(1591.873781627888 + z*(-2414.523044975008 +
1657 (1826.356460806092 - 421.9974035724832*z)*z) +
1658 y*(-973.091553087975 + z*(1205.20654902025 +
1659 z*(-829.084578510228 + 129.6381336154442*z)) +
1660 y*(381.06836198507096 - 67.41756835751434*y +
1661 z*(-267.4767805685508 + 147.07089752726017*z))))));
1663 g08 = x2*(729.116529735046 + z*(-687.913805923122 +
1664 z*(374.063013348744 + z*(-126.627857544292 +
1665 35.23294016577245*z))) +
1666 x*(-175.292041186547 - 22.6683558512829*x +
1667 (166.3847855603638 - 88.449193048287*z)*z +
1668 y*(766.116132004952 + y*(-1380.9597954037708 +
1669 938.26075044542*y) +
1670 z*(-216.7669050068448 + 153.8390924339484*z))) +
1671 y*(-1721.528607567954 + y*(2082.7344423998043 +
1672 y*(-1190.914967948748 + (597.809129110048 -
1673 437.84750280190565*z)*z) +
1674 z*(-1229.337851789418 + (1022.055280565346 -
1675 133.5392811916956*z)*z)) +
1676 z*(1349.638121077468 + z*(-1069.887337245828 +
1677 (353.6322866464 - 79.20015472116819*z)*z))));
1679 return_value = (g03 + g08)*2.5e-10;
1681 else if (ns == 1 && nt == 1 && np == 0) {
1682 g08 = 1187.3715515697959 + z*(1458.233059470092 +
1683 z*(-687.913805923122 + z*(249.375342232496 +
1684 z*(-63.313928772146 + 14.09317606630898*z)))) +
1685 x*(-1480.222530425046 + x*(2175.341332000392 +
1686 x*(-980.14153344888 + 220.542973797483*x) +
1687 y*(-548.4580073635929 + y*(592.4012338275047 +
1688 y*(-274.2361238716608 + 49.9394019139016*y))) -
1689 90.6734234051316*z) +
1690 z*(-525.876123559641 + (249.57717834054571 -
1691 88.449193048287*z)*z) +
1692 y*(-258.3988055868252 + z*(2298.348396014856 +
1693 z*(-325.1503575102672 + 153.8390924339484*z)) +
1694 y*(-90.2046337756875 - 4142.8793862113125*z +
1695 y*(10.50720794170734 + 2814.78225133626*z)))) +
1696 y*(3520.125411988816 + y*(-1351.605895580406 +
1697 y*(731.4083582010072 + y*(-216.60324087531103 +
1698 25.56203650166196*y) +
1699 z*(-2381.829935897496 + (597.809129110048 -
1700 291.8983352012704*z)*z)) +
1701 z*(4165.4688847996085 + z*(-1229.337851789418 +
1702 (681.370187043564 - 66.7696405958478*z)*z))) +
1703 z*(-3443.057215135908 + z*(1349.638121077468 +
1704 z*(-713.258224830552 + (176.8161433232 -
1705 31.68006188846728*z)*z))));
1708 g08 = g08 + 1702.453469893412*log(x);
1710 return_value = 0.5*TEO_10_gsw_sfac*0.025*g08;
1712 else if (ns == 2 && nt == 0 && np == 0) {
1713 g08 = 2.0*(8103.20462414788 +
1714 y*(2175.341332000392 + y*(-274.2290036817964 +
1715 y*(197.4670779425016 + y*(-68.5590309679152 +
1716 9.98788038278032*y))) - 90.6734234051316*z) +
1717 1.5*x*(-5458.34205214835 - 980.14153344888*y +
1718 (4.0/3.0)*x*(2247.60742726704 - 340.1237483177863*1.25*x +
1719 220.542973797483*y) + 180.142097805543*z) +
1720 z*(-219.1676534131548 + (-16.32775915649044 -
1721 120.7020447884644*z)*z));
1724 g08 += (-7296.43987145382 + z*(598.378809221703 +
1725 z*(-156.8822727844005 + (204.1334828179377 -
1726 10.23755797323846*z)*z)) +
1727 y*(-1480.222530425046 + z*(-525.876123559641 +
1728 (249.57717834054571 - 88.449193048287*z)*z) +
1729 y*(-129.1994027934126 + z*(1149.174198007428 +
1730 z*(-162.5751787551336 + 76.9195462169742*z)) +
1731 y*(-30.0682112585625 - 1380.9597954037708*z +
1732 y*(2.626801985426835 + 703.695562834065*z)))))/x +
1733 (11625.62913253464 + 1702.453469893412*y)/x2;
1737 return_value = 0.25*TEO_10_gsw_sfac*TEO_10_gsw_sfac*g08;
1739 else if (ns == 0 && nt == 0 && np == 2) {
1740 g03 = -5089.1530840726 + z*(1707.1066706777221 +
1741 z*(-399.7761051043332 + (84.0526217606168 -
1742 16.39285534413117*z)*z)) +
1743 y*(1552.307223226202 + z*(-1179.07530528732 +
1744 (347.75583155301 - 42.658016703665396*z)*z) +
1745 y*(-1513.116771538718 + z*(1640.877973941168 +
1746 z*(-666.7248765806615 + 86.8841343834394*z)) +
1747 y*(998.720781638304 + z*(-1437.2719839264719 +
1748 (585.6150223126464 - 33.261421241781*z)*z) +
1749 y*(-603.630761243752 + (913.178230403046 -
1750 316.49805267936244*z)*z +
1751 y*(241.04130980405 + y*(-44.5794634280918 +
1752 49.023632509086724*z) +
1753 z*(-331.6338314040912 + 77.78288016926652*z))))));
1755 g08 = x2*(769.588305957198 + z*(-579.1945920644748 +
1756 (190.08980732018878 - 52.4960313181984*z)*z) +
1757 x*(-104.588181856267 + x*(-8.16387957824522 -
1758 181.05306718269662*z) +
1759 (408.2669656358754 - 40.95023189295384*z)*z +
1760 y*(166.3847855603638 - 176.898386096574*z +
1761 y*(-108.3834525034224 + 153.8390924339484*z))) +
1762 y*(-687.913805923122 + z*(748.126026697488 +
1763 z*(-379.883572632876 + 140.9317606630898*z)) +
1764 y*(674.819060538734 + z*(-1069.887337245828 +
1765 (530.4484299696 - 158.40030944233638*z)*z) +
1766 y*(-409.779283929806 + y*(149.452282277512 -
1767 218.92375140095282*z) +
1768 (681.370187043564 - 133.5392811916956*z)*z))));
1770 return_value = (g03 + g08)*1e-16 ;
1773 return_value = -HUGE_VAL;
1775 return (return_value);
1778 inline constexpr double SSP::d(
double t,
double p)
const {
1779 return( cf_D00 + cf_D10*p );
1782 inline constexpr double SSP::b(
double t,
double p)
const {
1783 return( cf_B00 + cf_B01*t + (cf_B10 + cf_B11*t)*p );
1786 inline constexpr double SSP::a(
double t,
double p)
const {
1787 return( (cf_A00 + cf_A01*t + cf_A02*pow(t,2.0) + cf_A03*pow(t,3.0) + cf_A04*pow(t,4.0))
1788 + (cf_A10 + cf_A11*t + cf_A12*pow(t,2.0) + cf_A13*pow(t,3.0) + cf_A14*pow(t,4.0))*p
1789 + (cf_A20 + cf_A21*t + cf_A22*pow(t,2.0) + cf_A23*pow(t,3.0))*pow(p,2.0)
1790 + (cf_A30 + cf_A31*t + cf_A32*pow(t,2.0))*pow(p,3.0) );
1793 inline constexpr double SSP::cw(
double t,
double p)
const {
1794 return( (cf_C00 + cf_C01*t + cf_C02*pow(t,2.0) + cf_C03*pow(t,3.0) + cf_C04*pow(t,4.0) + cf_C05*pow(t,5.0))
1795 + (cf_C10 + cf_C11*t + cf_C12*pow(t,2.0) + cf_C13*pow(t,3.0) + cf_C14*pow(t,4.0))*p
1796 + (cf_C20 + cf_C21*t + cf_C22*pow(t,2.0) + cf_C23*pow(t,3.0) + cf_C24*pow(t,4.0))*pow(p,2.0)
1797 + (cf_C30 + cf_C31*t + cf_C32*pow(t,2.0))*pow(p,3.0) );
1803 return ( 1.0e-2 * depth / (depth + 100.0) + 6.2e-6*depth );
1806 return ( 8.0e-3 * depth / (depth + 1000.0) + 1.6e-6*depth );
1809 return ( -8.5e-6 * depth + 1.4e-9*pow(depth, 2.0) );
1811 else if (
isRedSea(coordinates) ) {
1815 return ( 7.8e-6*depth );
1818 return ( 8.0e-3 * depth / (depth + 50.0) + 1.3e-5*depth );
1821 return ( 1.0e-2 * depth / (depth + 100.0) + 1.6e-5*depth + 1e-9*pow(depth,2.0) );
1824 return ( 1.2e-2 * depth / (depth + 100.0) + 7.0e-6*depth + 2.5e-10*pow(depth,2.0) );
1827 return ( 1.13e-4 * depth );
1830 return ( 1.8e-4 * depth );
1833 return ( 8.0e-3 * depth / (depth + 1000.0) + 1.6e-6*depth );
1845 return( pressure / (pressure + 1.0) + 5.7e-2*pressure );
1848 return( -7.0e-2*pressure + 2.0e-3*pow(pressure, 2.0) );
1851 return( pressure / (pressure + 2.0) + 3.0e-2*pressure );
1853 else if (
isRedSea(coordinates) ) {
1857 return( 6.0e-2*pressure );
1860 return( 0.8*pressure / (pressure + 0.5) + 0.125*pressure );
1863 return( 0.9*pressure / (pressure + 1.0) + 0.17*pressure + 7.0e-4*pow(pressure,2.0) );
1866 return( 1.2*pressure / (pressure + 1.0) + 6.7e-2*pressure + 2.2e-4*pow(pressure,2.0) );
1869 return( 1.1*pressure );
1872 return( 1.8*pressure );
1875 return( 4.0e-2*pressure - 2.0e-4*pow(pressure, 2.0) );
1893 return( ( (9.72659e2 * pressure - 2.2512e-1 * pow(pressure, 2.0) + 2.279e-4 * pow(pressure, 3.0) - 1.82e-7 * pow(pressure, 4.0) )
Coordinates (lat, long) class definitions and functions library.
Definition coordinates-definitions.h:98
constexpr double getLongitude() const
Definition coordinates-definitions.h:167
constexpr double getLatitude() const
Definition coordinates-definitions.h:161
Custom precision long double class.
Definition custom-precision-double.h:58
SSP class offers multiple creation and manipulation capabilities for sound speed profile.
Definition ssp-definitions.h:247
static void setDebug(bool flag)
Definition ssp-definitions.h:904
friend SSP & operator-=(SSP &left, const SSP &right)
SSP & operator=(const SSP &x)=default
DConstIter pressure_upper_bound(const PDouble &depth) const
Definition ssp-definitions.h:422
virtual std::unique_ptr< SSP > clone() const
Definition ssp-definitions.h:322
DConstIter upper_bound(const PDouble &depth) const
Definition ssp-definitions.h:377
DConstIter salinity_begin() const
Definition ssp-definitions.h:480
DepthMap pressure_map
Definition ssp-definitions.h:941
virtual std::unique_ptr< SSP > truncate(double max_depth) const
Definition ssp-definitions.cpp:752
virtual std::unique_ptr< SSP > create(DepthMap &ssp_map, long double depth_precision=SSP_CUSTOM_DEPTH_PRECISION) const
Definition ssp-definitions.h:315
constexpr double getDepthCorreptions(const Coord &coordinates, double pressure) const
Definition ssp-definitions.h:1843
SSPEqType getSSPEqType() const
Definition ssp-definitions.h:692
constexpr double d(double t, double p) const
Definition ssp-definitions.h:1778
virtual bool isRandomizable() const
Definition ssp-definitions.h:537
double getMinDepthValue() const
Definition ssp-definitions.h:653
double getMinSSPValue() const
Definition ssp-definitions.h:666
SSP & eraseValue(const double &depth)
Definition ssp-definitions.h:640
constexpr double b(double t, double p) const
Definition ssp-definitions.h:1782
long double depth_precision
Definition ssp-definitions.h:926
constexpr double getDepthfromPressure(const Coord &coordinates, double pressure) const
Definition ssp-definitions.h:1890
constexpr double thyh(double z) const
Definition ssp-definitions.h:1287
constexpr bool isSuluSea(const Coord &coordinates) const
Definition ssp-definitions.h:1022
DConstIter lower_bound(const PDouble &depth) const
Definition ssp-definitions.h:370
DConstRIter pressure_rend() const
Definition ssp-definitions.h:408
virtual bool isValid() const
Definition ssp-definitions.h:525
DConstIter findValue(const double &depth) const
Definition ssp-definitions.h:633
constexpr double getPressureCorreptions(const Coord &coordinates, double depth) const
Definition ssp-definitions.h:1801
friend const SSP operator-(const SSP &left, const SSP &right)
Definition ssp-definitions.h:1208
constexpr double g_z(double lat) const
Definition ssp-definitions.h:1307
SSPEqType
Definition ssp-definitions.h:254
@ SSP_EQ_CHEN_MILLERO
UNESCO Chen & Miller, Wong Zu Eq.
@ SSP_EQ_INVALID
Must always be the last.
@ SSP_EQ_TEOS_10
TEOS-10 Eq (.
@ SSP_EQ_TEOS_10_EXACT
TEOS-10 Exact Eq (.
virtual std::unique_ptr< SSP > transform(const Coord &coordinates, double new_min_depth=-HUGE_VAL, double new_max_depth=HUGE_VAL, int total_depth_steps=SSP_CUSTOM_DEPTH_STEPS) const
Definition ssp-definitions.cpp:603
DConstIter salinity_end() const
Definition ssp-definitions.h:486
DConstRIter rend() const
Definition ssp-definitions.h:363
friend SSP & operator*=(SSP &left, const SSP &right)
static bool debug
Definition ssp-definitions.h:931
SSP(const SSP ©)=default
void clear()
Definition ssp-definitions.h:339
friend SSP & operator+=(SSP &left, const double right)
DepthMap ssp_map
Definition ssp-definitions.h:936
constexpr double hq(double z) const
Definition ssp-definitions.h:1299
virtual void setDepthPrecision(long double prec)
Definition ssp-definitions.cpp:572
DConstIter end() const
Definition ssp-definitions.h:351
DConstRIter rbegin() const
Definition ssp-definitions.h:357
SSP & setSSPEqType(SSPEqType eq_type)
Definition ssp-definitions.h:686
constexpr double gibbs(int ns, int nt, int np, double sa, double t, double p) const
Definition ssp-definitions.h:1367
DConstRIter temperature_rend() const
Definition ssp-definitions.h:453
DepthMap salinity_map
Definition ssp-definitions.h:946
DConstIter pressure_begin() const
Definition ssp-definitions.h:390
constexpr bool isBalticSea(const Coord &coordinates) const
Definition ssp-definitions.h:1054
friend std::ostream & operator>>(std::istream &is, const SSP &instance)
constexpr bool isMediterraneanSea(const Coord &coordinates) const
Definition ssp-definitions.h:991
DConstRIter salinity_rbegin() const
Definition ssp-definitions.h:492
DConstIter begin() const
Definition ssp-definitions.h:345
friend const SSP operator+(const SSP &left, const SSP &right)
Definition ssp-definitions.h:1202
constexpr bool isNEAtlanticOcean(const Coord &coordinates) const
Definition ssp-definitions.h:976
constexpr double getPressureFromDepth(const Coord &coordinates, double depth) const
Definition ssp-definitions.h:1885
friend std::ostream & operator<<(std::ostream &os, const SSP &instance)
Definition ssp-definitions.h:1275
double getMaxSSPValue() const
Definition ssp-definitions.h:660
constexpr bool isBlackSea(const Coord &coordinates) const
Definition ssp-definitions.h:1046
virtual std::unique_ptr< SSP > create(long double depth_precision=SSP_CUSTOM_DEPTH_PRECISION) const
Definition ssp-definitions.h:295
int size() const
Definition ssp-definitions.h:328
constexpr double a(double t, double p) const
Definition ssp-definitions.h:1786
DConstIter pressure_find(const PDouble &depth) const
Definition ssp-definitions.h:429
DConstIter salinity_find(const PDouble &depth) const
Definition ssp-definitions.h:519
constexpr bool isCelebesSea(const Coord &coordinates) const
Definition ssp-definitions.h:1038
virtual std::unique_ptr< SSP > fullRandomize(double ratio_incr_value) const
Definition ssp-definitions.cpp:814
DConstIter pressure_lower_bound(const PDouble &depth) const
Definition ssp-definitions.h:415
DConstRIter salinity_rend() const
Definition ssp-definitions.h:498
DConstIter temperature_lower_bound(const PDouble &depth) const
Definition ssp-definitions.h:460
DConstIter salinity_lower_bound(const PDouble &depth) const
Definition ssp-definitions.h:505
constexpr double h(double z, double lat) const
Definition ssp-definitions.h:1303
DConstRIter pressure_rbegin() const
Definition ssp-definitions.h:402
DConstIter temperature_find(const PDouble &depth) const
Definition ssp-definitions.h:474
friend SSP & operator*=(SSP &left, const double right)
double min_ssp_value
Definition ssp-definitions.h:916
constexpr double cw(double t, double p) const
Definition ssp-definitions.h:1793
virtual std::unique_ptr< SSP > create(DepthMap &ssp_map, DepthMap &temp_map, DepthMap &sal_map, DepthMap &press_map, long double depth_precision=SSP_CUSTOM_DEPTH_PRECISION) const
Definition ssp-definitions.h:306
constexpr bool isAntarcticOcean(const Coord &coordinates) const
Definition ssp-definitions.h:984
DConstIter temperature_end() const
Definition ssp-definitions.h:441
constexpr bool isJapanSea(const Coord &coordinates) const
Definition ssp-definitions.h:1014
constexpr bool isCanonOcean(const Coord &coordinates) const
Definition ssp-definitions.h:969
constexpr double k(double z, double lat) const
Definition ssp-definitions.h:1295
constexpr double calculateSSP(double temperature, double salinity, double pressure) const
Definition ssp-definitions.h:1311
constexpr double g(double lat) const
Definition ssp-definitions.h:1291
friend const SSP operator*(const SSP &left, const SSP &right)
Definition ssp-definitions.h:1214
SSPEqType ssp_eq_type
Definition ssp-definitions.h:911
SSP & operator=(SSP &&tmp)=default
DepthMap temperature_map
Definition ssp-definitions.h:951
virtual bool isTransformable() const
Definition ssp-definitions.h:531
DConstIter temperature_upper_bound(const PDouble &depth) const
Definition ssp-definitions.h:467
friend SSP & operator/=(SSP &left, const double right)
friend SSP & operator/=(SSP &left, const SSP &right)
constexpr bool isRedSea(const Coord &coordinates) const
Definition ssp-definitions.h:999
friend SSP & operator+=(SSP &left, const SSP &right)
DConstIter salinity_upper_bound(const PDouble &depth) const
Definition ssp-definitions.h:512
virtual bool write(std::ostream &stream_out) const
Definition ssp-definitions.cpp:529
virtual bool import(std::istream &stream_in)
Definition ssp-definitions.cpp:448
long double getDepthPrecision() const
Definition ssp-definitions.h:679
DConstRIter temperature_rbegin() const
Definition ssp-definitions.h:447
SSP & insertValue(double depth, double ssp_value)
Definition ssp-definitions.cpp:101
double max_ssp_value
Definition ssp-definitions.h:921
friend bool operator==(const SSP &left, const SSP &right)
Definition ssp-definitions.h:1189
friend const SSP operator/(const SSP &left, const SSP &right)
Definition ssp-definitions.h:1221
friend bool operator!=(const SSP &left, const SSP &right)
Definition ssp-definitions.h:1196
double getMaxDepthValue() const
Definition ssp-definitions.h:646
virtual std::unique_ptr< SSP > randomize(double ratio_incr_value) const
Definition ssp-definitions.cpp:859
friend SSP & operator-=(SSP &left, const double right)
constexpr bool isArcticOcean(const Coord &coordinates) const
Definition ssp-definitions.h:1007
DConstIter pressure_end() const
Definition ssp-definitions.h:396
DConstIter at(const int i) const
Definition ssp-definitions.cpp:89
DConstIter temperature_begin() const
Definition ssp-definitions.h:435
bool empty() const
Definition ssp-definitions.h:334
constexpr bool isHalmaheraSea(const Coord &coordinates) const
Definition ssp-definitions.h:1030
Provides the interface for the woss::Coord and woss::CoordZ classes.
Provides the interface for the woss::PDouble class.
Definition ac-toolbox-arr-asc-reader.h:44
bool operator!=(const Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.h:833
std::ostream & operator<<(std::ostream &os, const Altimetry &instance)
Definition altimetry-definitions.h:812
Altimetry & operator*=(Altimetry &left, double right)
Definition altimetry-definitions.cpp:346
const Altimetry operator/(const Altimetry &left, const double right)
Definition altimetry-definitions.cpp:264
bool operator==(const Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.h:826
Altimetry & operator+=(Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.cpp:306
std::map< PDouble, double > DepthMap
Definition ssp-definitions.h:223
DepthMap::iterator DIter
Definition ssp-definitions.h:225
DepthMap::const_reverse_iterator DConstRIter
Definition ssp-definitions.h:227
DepthMap::const_iterator DConstIter
Definition ssp-definitions.h:224
const Altimetry operator+(const Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.cpp:236
const Altimetry operator*(const Altimetry &left, const double right)
Definition altimetry-definitions.cpp:271
Altimetry & operator-=(Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.cpp:314
const Altimetry operator-(const Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.cpp:243
std::istream & operator>>(std::istream &is, PDouble &instance)
Definition custom-precision-double.h:426
DepthMap::reverse_iterator DRIter
Definition ssp-definitions.h:226
Altimetry & operator/=(Altimetry &left, double right)
Definition altimetry-definitions.cpp:338
Definitions and library for woss::Pressure class.