Calculating depth in the TMbottle data

The depth values in these TMbottle files have been calculated from pressure by the US JGOFS Data Management Office using the algorithm below. The latitude used in the computation was the beginning latitude recorded in the TMbottle file. The CHECKVALUE was used to verify the accuracy of the computation. The stated accuracy of this algorithm is 0.1 meters. The calculated depths have been rounded to the nearest whole meter.
function DEPTH=depth(P,LAT); DEPTH Computes depth given the pressure at some latitude D=DEPTH(P,LAT) gives the depth D (m) for a pressure P (dbars) at some latitude LAT (degrees). Fofonoff and Millard (1982). UNESCO Tech Paper #44. Notes: (ETP3, MBARI) This algorithm was originally compiled by RP @ WHOI. It was copied from the UNESCO technical report. The algorithm was endorsed by SCOR Working Group 51. The equations were originally developed by Saunders and Fofonoff (1976). DSR 23: 109-111. The parameters were re-fit for the 1980 equation of state for seawater (EOS80). CHECKVALUE: D=9712.653 M FOR P=10000 DECIBARS, LAT=30 DEG CALCULATON ASSUMES STD OCEAN: T = 0 DEG C; S = 35 (IPSS-78) X = sin(LAT/57.29578); X' = X*X; GR = GRAVITY VARIATION WITH LAT: ANON (1970) BULLETIN GEODESIQUE GR = 9.780318*(1.0+(5.2788E-3+2.36E-5*X')*X') + 1.092E-6*P D = DEPTH BEFORE GRAVITY CORRECTION D = (((-1.82E-15*P+2.279E-10)*P-2.2512E-5)*P+9.72659)*P DEPTH = D/GR
Pressure calculated from nominal depth: For three events added by the DMO to R/V Nathaniel B. Palmer (AESOPS/NBP-97-3) Ross Sea Process Cruise 3, pressure was calculated from the nominal depth (depth_n). These events, added by the DMO to facilitate the production of merged data products during the US JGOFS synthesis phase, were omitted from the data originally submitted to the DMO. PRESSURE Computes pressure given the depth at some latitude P=PRESSURE(D,LAT) gives the pressure P (dbars) at a depth D (m) at some latitude LAT (degrees). Ref: Saunders, "Practical Conversion of Pressure to Depth", J. Phys. Oceanog., April 1981. Notes: RP (WHOI) 2/Dec/91 I copied this directly from the UNESCO algorithms. CHECK VALUE: P80=7500.004 DBARS;FOR LAT=30 DEG., DEPTH=7321.45 METERS PLAT=abs(XLAT*pi/180.) D=sin(PLAT) C1=5.92E-3+(D^2)*5.25E-3 P80=((1-C1)-sqrt(((1-C1)^2)-(8.84E-6*DPTH)))/4.42E-6