36 inline double density_anomaly(
double S,
double T,
double P0)
90 double R3500 = 1028.1063;
91 double R4 = 4.8314E-4;
92 double DR350 = 28.106331;
97 double SR = sqrt(abs(S));
102 double R1 = ((((6.536332E-9 * T - 1.120083E-6) * T + 1.001685E-4) * T - 9.095290E-3) * T +
108 double R2 = (((5.3875E-9 * T - 8.2467E-7) * T + 7.6438E-5) * T - 4.0899E-3) * T + 8.24493E-1;
109 double R3 = (-1.6546E-6 * T + 1.0227E-4) * T - 5.72466E-3;
111 double SIG = (R4 * S + R3 * SR + R2) * S + R1;
113 double V350P = 1.0 / R3500;
114 double SVA = -SIG * V350P / (R3500 + SIG);
115 double SIGMA = SIG + DR350;
127 double E = (9.1697E-10 * T + 2.0816E-8) * T - 9.9348E-7;
128 double BW = (5.2787E-8 * T - 6.12293E-6) * T + 3.47718E-5;
129 double B = BW + E * S;
133 double D = 1.91075E-4;
134 double C = (-1.6078E-6 * T - 1.0981E-5) * T + 2.2838E-3;
135 double AW = ((-5.77905E-7 * T + 1.16092E-4) * T + 1.43713E-3) * T - 0.1194975;
136 double A = (D * SR + C) * S + AW;
140 double B1 = (-5.3009E-4 * T + 1.6483E-2) * T + 7.944E-2;
141 double A1 = ((-6.1670E-5 * T + 1.09987E-2) * T - 0.603459) * T + 54.6746;
142 double KW = (((-5.155288E-5 * T + 1.360477E-2) * T - 2.327105) * T + 148.4206) * T - 1930.06;
143 double K0 = (B1 * SR + A1) * S + KW;
151 double DK = (B * P + A) * P + K0;
152 double K35 = (5.03217E-5 * P + 3.359406) * P + 21582.27;
153 double GAM = P / K35;
154 double PK = 1.0 - GAM;
155 SVA = SVA * PK + (V350P + SVA) * P * DK / (K35 * (K35 + DK));
168 double DR35P = GAM / V350P;
169 double DVAN = SVA / (V350P * (V350P + SVA));
170 SIGMA = DR350 + DR35P - DVAN;