User`s manual
Appendix IV: Derived Parameter Formulas
84
depth = [m]
salinity = [PSU]
(Salinity is PSS-78.)
Depth calculation:
C Computer Code –
// Depth
double Depth(int dtype, double p, double latitude)
// dtype = fresh water or salt water, p = pressure in decibars, latitude in degrees
{
double x, d, gr;
if (dtype == FRESH_WATER) /* fresh water */
d = p * 1.019716;
else { /* salt water */
x = sin(latitude / 57.29578);
x = x * x;
gr = 9.780318 * (1.0 + (5.2788e-3 + 2.36e-5 * x) * x) + 1.092e-6 * p;
d = (((-1.82e-15 * p + 2.279e-10) * p - 2.2512e-5) * p + 9.72659) * p;
if (gr) d /= gr;
}
return(d);
}
Salinity calculation:
Using the following constants -
A1 = 2.070e-5, A2 = -6.370e-10, A3 = 3.989e-15, B1 = 3.426e-2, B2 = 4.464e-4, B3 = 4.215e-1,
B4 = -3.107e-3, C0 = 6.766097e-1, C1 = 2.00564e-2, C2 = 1.104259e-4, C3 = -6.9698e-7,
C4 = 1.0031e-9
C Computer Code –
static double a[6] = { /* constants for salinity calculation */
0.0080, -0.1692, 25.3851, 14.0941, -7.0261, 2.7081
};
static double b[6]={ /* constants for salinity calculation */
0.0005, -0.0056, -0.0066, -0.0375, 0.0636, -0.0144
};
double Salinity(double C, double T, double P) /* compute salinity */
// C = conductivity S/m, T = temperature deg C ITPS-68, P = pressure in decibars
{
double R, RT, RP, temp, sum1, sum2, result, val;
int i;
if (C <= 0.0)
result = 0.0;
else {
C *= 10.0; /* convert Siemens/meter to mmhos/cm */
R = C / 42.914;
val = 1 + B1 * T + B2 * T * T + B3 * R + B4 * R * T;
if (val) RP = 1 + (P * (A1 + P * (A2 + P * A3))) / val;
val = RP * (C0 + (T * (C1 + T * (C2 + T * (C3 + T * C4)))));
if (val) RT = R / val;
if (RT <= 0.0) RT = 0.000001;
sum1 = sum2 = 0.0;
for (i = 0;i < 6;i++) {
temp = pow(RT, (double)i/2.0);
sum1 += a[i] * temp;
sum2 += b[i] * temp;
}
val = 1.0 + 0.0162 * (T - 15.0);
if (val)
result = sum1 + sum2 * (T - 15.0) / val;
else
result = -99.;
}
return result;
}